...
|
...
|
@@ -1157,6 +1157,12 @@ func (srv TaskService) ListTask3(param *command.SearchTaskCommand) (map[string]i |
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "统计任务反馈异常总数"+err.Error())
|
|
|
}
|
|
|
userDao := dao.NewUserDao(map[string]interface{}{"transactionContext": transactionContext})
|
|
|
// 获取员工全部子集
|
|
|
childUser, err := userDao.AllChildUser(param.UserId)
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取下级员工"+err.Error())
|
|
|
}
|
|
|
var taskAnomalyList []*domain.TaskAnomaly
|
|
|
//获取异常的任务反馈记录
|
|
|
taskAnomalyRepo := factory.CreateTaskAnomalyRepository(map[string]interface{}{
|
...
|
...
|
@@ -1328,21 +1334,44 @@ func (srv TaskService) ListTask3(param *command.SearchTaskCommand) (map[string]i |
|
|
})
|
|
|
}
|
|
|
}
|
|
|
//设置操作标识
|
|
|
userId := strconv.Itoa(param.UserId)
|
|
|
isChildUser := false
|
|
|
for _, child := range childUser {
|
|
|
cid := strconv.Itoa(child.Id)
|
|
|
if cid == val.LeaderId {
|
|
|
isChildUser = true
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
switch val3.Category {
|
|
|
case domain.AnomalyCategoryType1:
|
|
|
// 里程碑异常
|
|
|
if userId == val.LeaderId {
|
|
|
// 去更新
|
|
|
tk.Marks["a"] = val3.Marks["a"]
|
|
|
// 找上级
|
|
|
tk.Marks["c"] = val3.Marks["c"]
|
|
|
} else {
|
|
|
} else if isChildUser {
|
|
|
// 去辅导
|
|
|
tk.Marks["d"] = val3.Marks["d"]
|
|
|
}
|
|
|
case domain.AnomalyCategoryType2:
|
|
|
if userId == val.LeaderId {
|
|
|
// 去反馈
|
|
|
tk.Marks["b"] = val3.Marks["b"]
|
|
|
} else if isChildUser {
|
|
|
// 去辅导
|
|
|
tk.Marks["d"] = val3.Marks["d"]
|
|
|
}
|
|
|
case domain.AnomalyCategoryType3:
|
|
|
if isChildUser {
|
|
|
// 去辅导
|
|
|
tk.Marks["d"] = val3.Marks["d"]
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
taskResult = append(taskResult, &tk)
|
|
|
}
|
|
|
result := tool_funs.SimpleWrapGridMap(int64(taskCount), taskResult)
|
...
|
...
|
|