作者 tangxvhui

修复bug

... ... @@ -1430,6 +1430,12 @@ func (srv TaskService) listTask3ForHrbp(param *command.SearchTaskCommand) (map[s
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())
}
//里程碑异常
taskStageAnomalyCnt, err := taskDao.CountTaskStageAnomalyByHrbp(condition)
if err != nil {
... ... @@ -1612,18 +1618,39 @@ func (srv TaskService) listTask3ForHrbp(param *command.SearchTaskCommand) (map[s
val3.Marks = map[string]string{}
}
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:
tk.Marks["b"] = val3.Marks["b"]
if userId == val.LeaderId {
// 去反馈
tk.Marks["b"] = val3.Marks["b"]
} else if isChildUser {
// 去辅导
tk.Marks["d"] = val3.Marks["d"]
}
case domain.AnomalyCategoryType3:
tk.Marks["d"] = val3.Marks["d"]
if isChildUser {
// 去辅导
tk.Marks["d"] = val3.Marks["d"]
}
}
}
taskResult = append(taskResult, &tk)
... ...