作者 tangxvhui

调整接口

@@ -5,4 +5,5 @@ type ListTaskCommand struct { @@ -5,4 +5,5 @@ type ListTaskCommand struct {
5 PageNumber int `json:"pageNumber"` 5 PageNumber int `json:"pageNumber"`
6 CompanyId int `json:"-"` 6 CompanyId int `json:"-"`
7 SearchWord string `json:"searchWord"` 7 SearchWord string `json:"searchWord"`
  8 + LevelName string `json:"levelName"`
8 } 9 }
1 package command 1 package command
2 2
3 type MarkTaskAnomalyCommand struct { 3 type MarkTaskAnomalyCommand struct {
4 - TaskId int `json:"taskId,string"` 4 + Id int `json:"id,string"` //异常记录id
5 CompanyId int `json:"-"` 5 CompanyId int `json:"-"`
6 MarkType string `json:"markType"` //a:去更新,b:去反馈,c:去求助,d:去辅导 6 MarkType string `json:"markType"` //a:去更新,b:去反馈,c:去求助,d:去辅导
7 } 7 }
@@ -699,6 +699,9 @@ func (srv TaskService) ListTask(param *command.ListTaskCommand) (map[string]inte @@ -699,6 +699,9 @@ func (srv TaskService) ListTask(param *command.ListTaskCommand) (map[string]inte
699 if len(param.SearchWord) > 0 { 699 if len(param.SearchWord) > 0 {
700 condition["aliasOrLeader"] = "%" + param.SearchWord + "%" 700 condition["aliasOrLeader"] = "%" + param.SearchWord + "%"
701 } 701 }
  702 + if len(param.LevelName) > 0 {
  703 + condition["levelName"] = param.LevelName
  704 + }
702 if param.PageSize > 0 { 705 if param.PageSize > 0 {
703 condition["limit"] = param.PageSize 706 condition["limit"] = param.PageSize
704 if param.PageNumber > 0 { 707 if param.PageNumber > 0 {
@@ -457,17 +457,23 @@ func (srv TaskService) MarkTaskAnomaly(param *command.MarkTaskAnomalyCommand) (m @@ -457,17 +457,23 @@ func (srv TaskService) MarkTaskAnomaly(param *command.MarkTaskAnomalyCommand) (m
457 defer func() { 457 defer func() {
458 _ = transactionContext.RollbackTransaction() 458 _ = transactionContext.RollbackTransaction()
459 }() 459 }()
460 - // taskAnomalyRepo := factory.CreateTaskAnomalyRepository(map[string]interface{}{  
461 - // "transactionContext": transactionContext,  
462 - // })  
463 - //MarkType= "a" 或者 MarkType= "b" 460 + taskAnomalyRepo := factory.CreateTaskAnomalyRepository(map[string]interface{}{
  461 + "transactionContext": transactionContext,
  462 + })
  463 + _, anomalyList, err := taskAnomalyRepo.Find(map[string]interface{}{"id": param.Id, "limit": 1})
  464 + if err != nil {
  465 +
  466 + }
  467 + _ = anomalyList
  468 + //MarkType= "a" 去更新,对应里程碑异常
464 //检查最新的异常记录,进行标记 469 //检查最新的异常记录,进行标记
465 //检查是否有任务相关连的每日评估 470 //检查是否有任务相关连的每日评估
466 - if param.MarkType == "a" || param.MarkType == "b" { 471 + if param.MarkType == "a" {
467 472
468 } 473 }
469 -  
470 - //MarkTYpe="c" 或者 MarkType = "d" 474 + // 或者 MarkType= "b" 去反馈,对应反馈异常
  475 + //MarkTYpe="c" //
  476 + //MarkType = "d"
471 //检查最新的异常记录,进行标记 477 //检查最新的异常记录,进行标记
472 478
473 if err := transactionContext.CommitTransaction(); err != nil { 479 if err := transactionContext.CommitTransaction(); err != nil {
@@ -115,6 +115,9 @@ func (repo *TaskAnomalyRepository) Find(queryOptions map[string]interface{}) (in @@ -115,6 +115,9 @@ func (repo *TaskAnomalyRepository) Find(queryOptions map[string]interface{}) (in
115 query.Offset(offset) 115 query.Offset(offset)
116 } 116 }
117 } 117 }
  118 + if val, ok := queryOptions["id"]; ok {
  119 + query.Where(" id=? ", val)
  120 + }
118 if val, ok := queryOptions["taskId"]; ok { 121 if val, ok := queryOptions["taskId"]; ok {
119 query.Where(" task_id=? ", val) 122 query.Where(" task_id=? ", val)
120 } 123 }
@@ -157,11 +157,15 @@ func (repo *TaskRepository) Find(queryOptions map[string]interface{}) (int, []*d @@ -157,11 +157,15 @@ func (repo *TaskRepository) Find(queryOptions map[string]interface{}) (int, []*d
157 if val, ok := queryOptions["createdBy"]; ok { 157 if val, ok := queryOptions["createdBy"]; ok {
158 query.Where("created_by = ?", val) 158 query.Where("created_by = ?", val)
159 } 159 }
  160 + if val, ok := queryOptions["levelName"]; ok {
  161 + query.Where("level_name like ?", val)
  162 + }
160 if val, ok := queryOptions["limit"]; ok { 163 if val, ok := queryOptions["limit"]; ok {
161 if limit, err := strconv.Atoi(fmt.Sprintf("%v", val)); err == nil { 164 if limit, err := strconv.Atoi(fmt.Sprintf("%v", val)); err == nil {
162 query.Limit(limit) 165 query.Limit(limit)
163 } 166 }
164 } 167 }
  168 +
165 if val, ok := queryOptions["offset"]; ok { 169 if val, ok := queryOptions["offset"]; ok {
166 if offset, err := strconv.Atoi(fmt.Sprintf("%v", val)); err == nil { 170 if offset, err := strconv.Atoi(fmt.Sprintf("%v", val)); err == nil {
167 query.Offset(offset) 171 query.Offset(offset)