作者 tangxvhui

修正一些问题

package command
type MarkTaskAnomalyCommand struct {
Id int `json:"id,string"`
TaskId int `json:"taskId,string"`
CompanyId int `json:"-"`
MarkType string `json:"markType"` //a:去更新,b:去反馈,c:去求助,d:去辅导
}
... ...
... ... @@ -1326,7 +1326,20 @@ func (srv TaskService) listTask3ForHrbp(param *command.SearchTaskCommand) (map[s
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "统计任务反馈异常总数"+err.Error())
}
var taskAnomalyList []*domain.TaskAnomaly
//获取异常的任务反馈记录
taskAnomalyRepo := factory.CreateTaskAnomalyRepository(map[string]interface{}{
"transactionContext": transactionContext,
})
for _, val := range taskListData {
_, listData, err := taskAnomalyRepo.Find(map[string]interface{}{
"taskId": val.TaskId,
"is_last": 1,
})
if err == nil {
taskAnomalyList = append(taskAnomalyList, listData...)
}
}
taskResult := []*adapter.TaskItem{}
taskStageRepo := factory.CreateTaskStageRepository(map[string]interface{}{
"transactionContext": transactionContext,
... ... @@ -1405,6 +1418,28 @@ func (srv TaskService) listTask3ForHrbp(param *command.SearchTaskCommand) (map[s
}
}
tk.GenStatusDescript()
for _, val := range taskAnomalyList {
if tk.Id != val.TaskId {
continue
}
if val.Marks == nil {
val.Marks = map[string]string{}
}
r := val.Remark + ",该条异常已通知"
for _, val2 := range val.NoticeWho {
r += val2["name"] + " "
}
tk.AnomalyDesc = append(tk.AnomalyDesc, r)
switch val.Category {
case domain.AnomalyCategoryType1:
tk.Marks["a"] = val.Marks["a"]
tk.Marks["c"] = val.Marks["c"]
case domain.AnomalyCategoryType2:
tk.Marks["b"] = val.Marks["b"]
case domain.AnomalyCategoryType3:
tk.Marks["d"] = val.Marks["d"]
}
}
taskResult = append(taskResult, &tk)
}
result := tool_funs.SimpleWrapGridMap(int64(taskCount), taskResult)
... ...
... ... @@ -447,6 +447,8 @@ func (srv TaskService) UserSelect(param *command.UserSelectCommand) []adapter.Us
// 对异常记录的操作标记
func (srv TaskService) MarkTaskAnomaly(param *command.MarkTaskAnomalyCommand) (map[string]string, error) {
//MarkType= "a" 或者 MarkType= "b"
//检查最新的异常记录,进行标记
// 检查是否有任务相关连的每日评估
return nil, nil
}
... ...
... ... @@ -55,7 +55,8 @@ func (c *TaskController) CreateTask() {
c.Response(nil, e)
return
}
userReq := middlewares.GetUser(c.Ctx)
paramReq.CompanyId = int(userReq.CompanyId)
resp, err := srv.CreateTask(paramReq)
c.Response(resp, err)
}
... ...