作者 tangxvhui

修复bug

@@ -1430,6 +1430,12 @@ func (srv TaskService) listTask3ForHrbp(param *command.SearchTaskCommand) (map[s @@ -1430,6 +1430,12 @@ func (srv TaskService) listTask3ForHrbp(param *command.SearchTaskCommand) (map[s
1430 if err != nil { 1430 if err != nil {
1431 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "统计任务总数"+err.Error()) 1431 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "统计任务总数"+err.Error())
1432 } 1432 }
  1433 + userDao := dao.NewUserDao(map[string]interface{}{"transactionContext": transactionContext})
  1434 + // 获取员工全部子集
  1435 + childUser, err := userDao.AllChildUser(param.UserId)
  1436 + if err != nil {
  1437 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取下级员工"+err.Error())
  1438 + }
1433 //里程碑异常 1439 //里程碑异常
1434 taskStageAnomalyCnt, err := taskDao.CountTaskStageAnomalyByHrbp(condition) 1440 taskStageAnomalyCnt, err := taskDao.CountTaskStageAnomalyByHrbp(condition)
1435 if err != nil { 1441 if err != nil {
@@ -1612,18 +1618,39 @@ func (srv TaskService) listTask3ForHrbp(param *command.SearchTaskCommand) (map[s @@ -1612,18 +1618,39 @@ func (srv TaskService) listTask3ForHrbp(param *command.SearchTaskCommand) (map[s
1612 val3.Marks = map[string]string{} 1618 val3.Marks = map[string]string{}
1613 } 1619 }
1614 userId := strconv.Itoa(param.UserId) 1620 userId := strconv.Itoa(param.UserId)
  1621 + isChildUser := false
  1622 + for _, child := range childUser {
  1623 + cid := strconv.Itoa(child.Id)
  1624 + if cid == val.LeaderId {
  1625 + isChildUser = true
  1626 + break
  1627 + }
  1628 + }
1615 switch val3.Category { 1629 switch val3.Category {
1616 case domain.AnomalyCategoryType1: 1630 case domain.AnomalyCategoryType1:
  1631 + // 里程碑异常
1617 if userId == val.LeaderId { 1632 if userId == val.LeaderId {
  1633 + // 去更新
1618 tk.Marks["a"] = val3.Marks["a"] 1634 tk.Marks["a"] = val3.Marks["a"]
  1635 + // 找上级
1619 tk.Marks["c"] = val3.Marks["c"] 1636 tk.Marks["c"] = val3.Marks["c"]
1620 - } else { 1637 + } else if isChildUser {
  1638 + // 去辅导
1621 tk.Marks["d"] = val3.Marks["d"] 1639 tk.Marks["d"] = val3.Marks["d"]
1622 } 1640 }
1623 case domain.AnomalyCategoryType2: 1641 case domain.AnomalyCategoryType2:
1624 - tk.Marks["b"] = val3.Marks["b"] 1642 + if userId == val.LeaderId {
  1643 + // 去反馈
  1644 + tk.Marks["b"] = val3.Marks["b"]
  1645 + } else if isChildUser {
  1646 + // 去辅导
  1647 + tk.Marks["d"] = val3.Marks["d"]
  1648 + }
1625 case domain.AnomalyCategoryType3: 1649 case domain.AnomalyCategoryType3:
1626 - tk.Marks["d"] = val3.Marks["d"] 1650 + if isChildUser {
  1651 + // 去辅导
  1652 + tk.Marks["d"] = val3.Marks["d"]
  1653 + }
1627 } 1654 }
1628 } 1655 }
1629 taskResult = append(taskResult, &tk) 1656 taskResult = append(taskResult, &tk)