...
|
...
|
@@ -1116,6 +1116,20 @@ func (srv TaskService) ListTask3(param *command.SearchTaskCommand) (map[string]i |
|
|
listData, err := srv.listTask3ForHrbp(param)
|
|
|
return listData, err
|
|
|
}
|
|
|
// 获取我的上级人员
|
|
|
userRepo := factory.CreateUserRepository(map[string]interface{}{"transactionContext": transactionContext})
|
|
|
_, me, err := userRepo.Find(map[string]interface{}{"id": param.UserId})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取用户的信息"+err.Error())
|
|
|
}
|
|
|
if len(me) == 0 {
|
|
|
return nil, nil
|
|
|
}
|
|
|
var meParent []*domain.User
|
|
|
if me[0].ParentId > 0 {
|
|
|
_, meParent, _ = userRepo.Find(map[string]interface{}{"id": me[0].ParentId})
|
|
|
}
|
|
|
|
|
|
param.SearchWord = strings.TrimSpace(param.SearchWord)
|
|
|
if len(param.SearchWord) > 0 {
|
|
|
param.SearchWord = "%" + param.SearchWord + "%"
|
...
|
...
|
@@ -1167,6 +1181,7 @@ func (srv TaskService) ListTask3(param *command.SearchTaskCommand) (map[string]i |
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取下级员工"+err.Error())
|
|
|
}
|
|
|
|
|
|
var taskAnomalyList []*domain.TaskAnomaly
|
|
|
//获取异常的任务反馈记录
|
|
|
taskAnomalyRepo := factory.CreateTaskAnomalyRepository(map[string]interface{}{
|
...
|
...
|
@@ -1225,6 +1240,9 @@ func (srv TaskService) ListTask3(param *command.SearchTaskCommand) (map[string]i |
|
|
if val.CurrentStage.RealCompletedAt > 0 {
|
|
|
tk.CurrentStage.RealCompletedAt = time.Unix(int64(val.CurrentStage.RealCompletedAt), 0).Local().Format("2006-01-02")
|
|
|
}
|
|
|
if val.WarnFlag > 0 {
|
|
|
val.WarnFlag = 1
|
|
|
}
|
|
|
// if val.LastStage.Id > 0 && val.LastStage.PlanCompletedAt < val.LastStage.RealCompletedAt {
|
|
|
// tk.WarnFlag = int(domain.TaskWarn)
|
|
|
// }
|
...
|
...
|
@@ -1341,6 +1359,9 @@ func (srv TaskService) ListTask3(param *command.SearchTaskCommand) (map[string]i |
|
|
userId := strconv.Itoa(param.UserId)
|
|
|
isChildUser := false
|
|
|
for _, child := range childUser {
|
|
|
if child.Level == 1 {
|
|
|
continue
|
|
|
}
|
|
|
cid := strconv.Itoa(child.Id)
|
|
|
if cid == val.LeaderId {
|
|
|
isChildUser = true
|
...
|
...
|
@@ -1353,8 +1374,10 @@ func (srv TaskService) ListTask3(param *command.SearchTaskCommand) (map[string]i |
|
|
if userId == val.LeaderId {
|
|
|
// 去更新
|
|
|
tk.Marks["a"] = val3.Marks["a"]
|
|
|
// 找上级
|
|
|
tk.Marks["c"] = val3.Marks["c"]
|
|
|
if len(meParent) > 0 {
|
|
|
// 找上级
|
|
|
tk.Marks["c"] = val3.Marks["c"]
|
|
|
}
|
|
|
} else if isChildUser {
|
|
|
// 去辅导
|
|
|
tk.Marks["d"] = val3.Marks["d"]
|
...
|
...
|
@@ -1793,10 +1816,12 @@ func (srv *TaskService) ListTaskIgnore(param *command.SearchTaskCommand) (result |
|
|
tk.CurrentStage.RealCompletedAt = time.Unix(int64(val.CurrentStage.RealCompletedAt), 0).Local().Format("2006-01-02")
|
|
|
}
|
|
|
if val.LastStage.Id > 0 && val.LastStage.PlanCompletedAt < val.LastStage.RealCompletedAt {
|
|
|
tk.WarnFlag = int(domain.TaskWarn)
|
|
|
// tk.WarnFlag = int(domain.TaskWarn)
|
|
|
tk.WarnFlag = 1
|
|
|
}
|
|
|
if val.CurrentStage.Id > 0 && val.CurrentStage.PlanCompletedAt < nowTime {
|
|
|
tk.WarnFlag = int(domain.TaskWarn)
|
|
|
// tk.WarnFlag = int(domain.TaskWarn)
|
|
|
tk.WarnFlag = 1
|
|
|
}
|
|
|
_, stageList, err := taskStageRepo.Find(map[string]interface{}{
|
|
|
"taskId": val.TaskId,
|
...
|
...
|
|