作者 tangxvhui

调整接口

... ... @@ -5,4 +5,5 @@ type ListTaskCommand struct {
PageNumber int `json:"pageNumber"`
CompanyId int `json:"-"`
SearchWord string `json:"searchWord"`
LevelName string `json:"levelName"`
}
... ...
package command
type MarkTaskAnomalyCommand struct {
TaskId int `json:"taskId,string"`
Id int `json:"id,string"` //异常记录id
CompanyId int `json:"-"`
MarkType string `json:"markType"` //a:去更新,b:去反馈,c:去求助,d:去辅导
}
... ...
... ... @@ -699,6 +699,9 @@ func (srv TaskService) ListTask(param *command.ListTaskCommand) (map[string]inte
if len(param.SearchWord) > 0 {
condition["aliasOrLeader"] = "%" + param.SearchWord + "%"
}
if len(param.LevelName) > 0 {
condition["levelName"] = param.LevelName
}
if param.PageSize > 0 {
condition["limit"] = param.PageSize
if param.PageNumber > 0 {
... ...
... ... @@ -457,17 +457,23 @@ func (srv TaskService) MarkTaskAnomaly(param *command.MarkTaskAnomalyCommand) (m
defer func() {
_ = transactionContext.RollbackTransaction()
}()
// taskAnomalyRepo := factory.CreateTaskAnomalyRepository(map[string]interface{}{
// "transactionContext": transactionContext,
// })
//MarkType= "a" 或者 MarkType= "b"
taskAnomalyRepo := factory.CreateTaskAnomalyRepository(map[string]interface{}{
"transactionContext": transactionContext,
})
_, anomalyList, err := taskAnomalyRepo.Find(map[string]interface{}{"id": param.Id, "limit": 1})
if err != nil {
}
_ = anomalyList
//MarkType= "a" 去更新,对应里程碑异常
//检查最新的异常记录,进行标记
//检查是否有任务相关连的每日评估
if param.MarkType == "a" || param.MarkType == "b" {
if param.MarkType == "a" {
}
//MarkTYpe="c" 或者 MarkType = "d"
// 或者 MarkType= "b" 去反馈,对应反馈异常
//MarkTYpe="c" //
//MarkType = "d"
//检查最新的异常记录,进行标记
if err := transactionContext.CommitTransaction(); err != nil {
... ...
... ... @@ -115,6 +115,9 @@ func (repo *TaskAnomalyRepository) Find(queryOptions map[string]interface{}) (in
query.Offset(offset)
}
}
if val, ok := queryOptions["id"]; ok {
query.Where(" id=? ", val)
}
if val, ok := queryOptions["taskId"]; ok {
query.Where(" task_id=? ", val)
}
... ...
... ... @@ -157,11 +157,15 @@ func (repo *TaskRepository) Find(queryOptions map[string]interface{}) (int, []*d
if val, ok := queryOptions["createdBy"]; ok {
query.Where("created_by = ?", val)
}
if val, ok := queryOptions["levelName"]; ok {
query.Where("level_name like ?", val)
}
if val, ok := queryOptions["limit"]; ok {
if limit, err := strconv.Atoi(fmt.Sprintf("%v", val)); err == nil {
query.Limit(limit)
}
}
if val, ok := queryOptions["offset"]; ok {
if offset, err := strconv.Atoi(fmt.Sprintf("%v", val)); err == nil {
query.Offset(offset)
... ...