作者 tangxvhui

调整任务列表对异常操作的标记

@@ -1157,6 +1157,12 @@ func (srv TaskService) ListTask3(param *command.SearchTaskCommand) (map[string]i @@ -1157,6 +1157,12 @@ func (srv TaskService) ListTask3(param *command.SearchTaskCommand) (map[string]i
1157 if err != nil { 1157 if err != nil {
1158 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "统计任务反馈异常总数"+err.Error()) 1158 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "统计任务反馈异常总数"+err.Error())
1159 } 1159 }
  1160 + userDao := dao.NewUserDao(map[string]interface{}{"transactionContext": transactionContext})
  1161 + // 获取员工全部子集
  1162 + childUser, err := userDao.AllChildUser(param.UserId)
  1163 + if err != nil {
  1164 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取下级员工"+err.Error())
  1165 + }
1160 var taskAnomalyList []*domain.TaskAnomaly 1166 var taskAnomalyList []*domain.TaskAnomaly
1161 //获取异常的任务反馈记录 1167 //获取异常的任务反馈记录
1162 taskAnomalyRepo := factory.CreateTaskAnomalyRepository(map[string]interface{}{ 1168 taskAnomalyRepo := factory.CreateTaskAnomalyRepository(map[string]interface{}{
@@ -1328,20 +1334,43 @@ func (srv TaskService) ListTask3(param *command.SearchTaskCommand) (map[string]i @@ -1328,20 +1334,43 @@ func (srv TaskService) ListTask3(param *command.SearchTaskCommand) (map[string]i
1328 }) 1334 })
1329 } 1335 }
1330 } 1336 }
  1337 + //设置操作标识
1331 userId := strconv.Itoa(param.UserId) 1338 userId := strconv.Itoa(param.UserId)
  1339 + isChildUser := false
  1340 + for _, child := range childUser {
  1341 + cid := strconv.Itoa(child.Id)
  1342 + if cid == val.LeaderId {
  1343 + isChildUser = true
  1344 + break
  1345 + }
  1346 + }
1332 switch val3.Category { 1347 switch val3.Category {
1333 case domain.AnomalyCategoryType1: 1348 case domain.AnomalyCategoryType1:
  1349 + // 里程碑异常
1334 if userId == val.LeaderId { 1350 if userId == val.LeaderId {
  1351 + // 去更新
1335 tk.Marks["a"] = val3.Marks["a"] 1352 tk.Marks["a"] = val3.Marks["a"]
  1353 + // 找上级
1336 tk.Marks["c"] = val3.Marks["c"] 1354 tk.Marks["c"] = val3.Marks["c"]
1337 - } else { 1355 + } else if isChildUser {
  1356 + // 去辅导
1338 tk.Marks["d"] = val3.Marks["d"] 1357 tk.Marks["d"] = val3.Marks["d"]
1339 } 1358 }
1340 case domain.AnomalyCategoryType2: 1359 case domain.AnomalyCategoryType2:
1341 - tk.Marks["b"] = val3.Marks["b"] 1360 + if userId == val.LeaderId {
  1361 + // 去反馈
  1362 + tk.Marks["b"] = val3.Marks["b"]
  1363 + } else if isChildUser {
  1364 + // 去辅导
  1365 + tk.Marks["d"] = val3.Marks["d"]
  1366 + }
1342 case domain.AnomalyCategoryType3: 1367 case domain.AnomalyCategoryType3:
1343 - tk.Marks["d"] = val3.Marks["d"] 1368 + if isChildUser {
  1369 + // 去辅导
  1370 + tk.Marks["d"] = val3.Marks["d"]
  1371 + }
1344 } 1372 }
  1373 +
1345 } 1374 }
1346 taskResult = append(taskResult, &tk) 1375 taskResult = append(taskResult, &tk)
1347 } 1376 }