|
@@ -1116,6 +1116,20 @@ func (srv TaskService) ListTask3(param *command.SearchTaskCommand) (map[string]i |
|
@@ -1116,6 +1116,20 @@ func (srv TaskService) ListTask3(param *command.SearchTaskCommand) (map[string]i |
1116
|
listData, err := srv.listTask3ForHrbp(param)
|
1116
|
listData, err := srv.listTask3ForHrbp(param)
|
1117
|
return listData, err
|
1117
|
return listData, err
|
1118
|
}
|
1118
|
}
|
|
|
1119
|
+ // 获取我的上级人员
|
|
|
1120
|
+ userRepo := factory.CreateUserRepository(map[string]interface{}{"transactionContext": transactionContext})
|
|
|
1121
|
+ _, me, err := userRepo.Find(map[string]interface{}{"id": param.UserId})
|
|
|
1122
|
+ if err != nil {
|
|
|
1123
|
+ return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取用户的信息"+err.Error())
|
|
|
1124
|
+ }
|
|
|
1125
|
+ if len(me) == 0 {
|
|
|
1126
|
+ return nil, nil
|
|
|
1127
|
+ }
|
|
|
1128
|
+ var meParent []*domain.User
|
|
|
1129
|
+ if me[0].ParentId > 0 {
|
|
|
1130
|
+ _, meParent, _ = userRepo.Find(map[string]interface{}{"id": me[0].ParentId})
|
|
|
1131
|
+ }
|
|
|
1132
|
+
|
1119
|
param.SearchWord = strings.TrimSpace(param.SearchWord)
|
1133
|
param.SearchWord = strings.TrimSpace(param.SearchWord)
|
1120
|
if len(param.SearchWord) > 0 {
|
1134
|
if len(param.SearchWord) > 0 {
|
1121
|
param.SearchWord = "%" + param.SearchWord + "%"
|
1135
|
param.SearchWord = "%" + param.SearchWord + "%"
|
|
@@ -1167,6 +1181,7 @@ func (srv TaskService) ListTask3(param *command.SearchTaskCommand) (map[string]i |
|
@@ -1167,6 +1181,7 @@ func (srv TaskService) ListTask3(param *command.SearchTaskCommand) (map[string]i |
1167
|
if err != nil {
|
1181
|
if err != nil {
|
1168
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取下级员工"+err.Error())
|
1182
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取下级员工"+err.Error())
|
1169
|
}
|
1183
|
}
|
|
|
1184
|
+
|
1170
|
var taskAnomalyList []*domain.TaskAnomaly
|
1185
|
var taskAnomalyList []*domain.TaskAnomaly
|
1171
|
//获取异常的任务反馈记录
|
1186
|
//获取异常的任务反馈记录
|
1172
|
taskAnomalyRepo := factory.CreateTaskAnomalyRepository(map[string]interface{}{
|
1187
|
taskAnomalyRepo := factory.CreateTaskAnomalyRepository(map[string]interface{}{
|
|
@@ -1225,6 +1240,9 @@ func (srv TaskService) ListTask3(param *command.SearchTaskCommand) (map[string]i |
|
@@ -1225,6 +1240,9 @@ func (srv TaskService) ListTask3(param *command.SearchTaskCommand) (map[string]i |
1225
|
if val.CurrentStage.RealCompletedAt > 0 {
|
1240
|
if val.CurrentStage.RealCompletedAt > 0 {
|
1226
|
tk.CurrentStage.RealCompletedAt = time.Unix(int64(val.CurrentStage.RealCompletedAt), 0).Local().Format("2006-01-02")
|
1241
|
tk.CurrentStage.RealCompletedAt = time.Unix(int64(val.CurrentStage.RealCompletedAt), 0).Local().Format("2006-01-02")
|
1227
|
}
|
1242
|
}
|
|
|
1243
|
+ if val.WarnFlag > 0 {
|
|
|
1244
|
+ val.WarnFlag = 1
|
|
|
1245
|
+ }
|
1228
|
// if val.LastStage.Id > 0 && val.LastStage.PlanCompletedAt < val.LastStage.RealCompletedAt {
|
1246
|
// if val.LastStage.Id > 0 && val.LastStage.PlanCompletedAt < val.LastStage.RealCompletedAt {
|
1229
|
// tk.WarnFlag = int(domain.TaskWarn)
|
1247
|
// tk.WarnFlag = int(domain.TaskWarn)
|
1230
|
// }
|
1248
|
// }
|
|
@@ -1341,6 +1359,9 @@ func (srv TaskService) ListTask3(param *command.SearchTaskCommand) (map[string]i |
|
@@ -1341,6 +1359,9 @@ func (srv TaskService) ListTask3(param *command.SearchTaskCommand) (map[string]i |
1341
|
userId := strconv.Itoa(param.UserId)
|
1359
|
userId := strconv.Itoa(param.UserId)
|
1342
|
isChildUser := false
|
1360
|
isChildUser := false
|
1343
|
for _, child := range childUser {
|
1361
|
for _, child := range childUser {
|
|
|
1362
|
+ if child.Level == 1 {
|
|
|
1363
|
+ continue
|
|
|
1364
|
+ }
|
1344
|
cid := strconv.Itoa(child.Id)
|
1365
|
cid := strconv.Itoa(child.Id)
|
1345
|
if cid == val.LeaderId {
|
1366
|
if cid == val.LeaderId {
|
1346
|
isChildUser = true
|
1367
|
isChildUser = true
|
|
@@ -1353,8 +1374,10 @@ func (srv TaskService) ListTask3(param *command.SearchTaskCommand) (map[string]i |
|
@@ -1353,8 +1374,10 @@ func (srv TaskService) ListTask3(param *command.SearchTaskCommand) (map[string]i |
1353
|
if userId == val.LeaderId {
|
1374
|
if userId == val.LeaderId {
|
1354
|
// 去更新
|
1375
|
// 去更新
|
1355
|
tk.Marks["a"] = val3.Marks["a"]
|
1376
|
tk.Marks["a"] = val3.Marks["a"]
|
1356
|
- // 找上级
|
|
|
1357
|
- tk.Marks["c"] = val3.Marks["c"]
|
1377
|
+ if len(meParent) > 0 {
|
|
|
1378
|
+ // 找上级
|
|
|
1379
|
+ tk.Marks["c"] = val3.Marks["c"]
|
|
|
1380
|
+ }
|
1358
|
} else if isChildUser {
|
1381
|
} else if isChildUser {
|
1359
|
// 去辅导
|
1382
|
// 去辅导
|
1360
|
tk.Marks["d"] = val3.Marks["d"]
|
1383
|
tk.Marks["d"] = val3.Marks["d"]
|
|
@@ -1793,10 +1816,12 @@ func (srv *TaskService) ListTaskIgnore(param *command.SearchTaskCommand) (result |
|
@@ -1793,10 +1816,12 @@ func (srv *TaskService) ListTaskIgnore(param *command.SearchTaskCommand) (result |
1793
|
tk.CurrentStage.RealCompletedAt = time.Unix(int64(val.CurrentStage.RealCompletedAt), 0).Local().Format("2006-01-02")
|
1816
|
tk.CurrentStage.RealCompletedAt = time.Unix(int64(val.CurrentStage.RealCompletedAt), 0).Local().Format("2006-01-02")
|
1794
|
}
|
1817
|
}
|
1795
|
if val.LastStage.Id > 0 && val.LastStage.PlanCompletedAt < val.LastStage.RealCompletedAt {
|
1818
|
if val.LastStage.Id > 0 && val.LastStage.PlanCompletedAt < val.LastStage.RealCompletedAt {
|
1796
|
- tk.WarnFlag = int(domain.TaskWarn)
|
1819
|
+ // tk.WarnFlag = int(domain.TaskWarn)
|
|
|
1820
|
+ tk.WarnFlag = 1
|
1797
|
}
|
1821
|
}
|
1798
|
if val.CurrentStage.Id > 0 && val.CurrentStage.PlanCompletedAt < nowTime {
|
1822
|
if val.CurrentStage.Id > 0 && val.CurrentStage.PlanCompletedAt < nowTime {
|
1799
|
- tk.WarnFlag = int(domain.TaskWarn)
|
1823
|
+ // tk.WarnFlag = int(domain.TaskWarn)
|
|
|
1824
|
+ tk.WarnFlag = 1
|
1800
|
}
|
1825
|
}
|
1801
|
_, stageList, err := taskStageRepo.Find(map[string]interface{}{
|
1826
|
_, stageList, err := taskStageRepo.Find(map[string]interface{}{
|
1802
|
"taskId": val.TaskId,
|
1827
|
"taskId": val.TaskId,
|