作者 tangxvhui

更新

@@ -304,6 +304,25 @@ func anomalyIsAssistFlag(transactionContext application.TransactionContext, task @@ -304,6 +304,25 @@ func anomalyIsAssistFlag(transactionContext application.TransactionContext, task
304 "transactionContext": transactionContext, 304 "transactionContext": transactionContext,
305 }) 305 })
306 306
  307 + //检查任务负责人是否有上级
  308 +
  309 + _, userList, _ := userRepo.Find(map[string]interface{}{
  310 + "id": taskData.Leader.Id,
  311 + "limit": 1,
  312 + })
  313 + if len(userList) == 0 {
  314 + return nil
  315 + }
  316 + if userList[0].ParentId > 0 {
  317 + _, leaderList, _ := userRepo.Find(map[string]interface{}{
  318 + "id": userList[0].ParentId,
  319 + "limit": 1,
  320 + })
  321 + if len(leaderList) == 0 {
  322 + return nil
  323 + }
  324 + }
  325 +
307 _, oldAnomaly, err := taskAnomalyRepo.Find(map[string]interface{}{ 326 _, oldAnomaly, err := taskAnomalyRepo.Find(map[string]interface{}{
308 "isLast": 1, 327 "isLast": 1,
309 "category": domain.AnomalyCategoryType3, 328 "category": domain.AnomalyCategoryType3,
@@ -64,8 +64,16 @@ func (t *TaskAnomaly) MarkD() { @@ -64,8 +64,16 @@ func (t *TaskAnomaly) MarkD() {
64 } 64 }
65 65
66 func (t *TaskAnomaly) SetNoticeWho(u *User) { 66 func (t *TaskAnomaly) SetNoticeWho(u *User) {
  67 +
  68 + uid := strconv.Itoa(int(u.Id))
  69 + for _, v := range t.NoticeWho {
  70 + if v["id"] == uid {
  71 + return
  72 + }
  73 + }
  74 +
67 t.NoticeWho = append(t.NoticeWho, map[string]string{ 75 t.NoticeWho = append(t.NoticeWho, map[string]string{
68 - "id": strconv.Itoa(int(u.Id)), "name": u.Name, 76 + "id": uid, "name": u.Name,
69 }) 77 })
70 } 78 }
71 79