正在显示
2 个修改的文件
包含
30 行增加
和
14 行删除
@@ -157,6 +157,7 @@ func (srv *MessagePersonalService) TodayMessageTaskStageAnomaly(param *command.G | @@ -157,6 +157,7 @@ func (srv *MessagePersonalService) TodayMessageTaskStageAnomaly(param *command.G | ||
157 | if err != nil { | 157 | if err != nil { |
158 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取下级员工"+err.Error()) | 158 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取下级员工"+err.Error()) |
159 | } | 159 | } |
160 | + //我的直属下级人员 | ||
160 | childUserId := []string{} | 161 | childUserId := []string{} |
161 | for _, val := range childUser { | 162 | for _, val := range childUser { |
162 | if val.Level == 2 { | 163 | if val.Level == 2 { |
@@ -171,6 +172,7 @@ func (srv *MessagePersonalService) TodayMessageTaskStageAnomaly(param *command.G | @@ -171,6 +172,7 @@ func (srv *MessagePersonalService) TodayMessageTaskStageAnomaly(param *command.G | ||
171 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "检查任务里程碑异常的消息"+err.Error()) | 172 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "检查任务里程碑异常的消息"+err.Error()) |
172 | } | 173 | } |
173 | } | 174 | } |
175 | + //我的下下级人员 | ||
174 | childUserId2 := []string{} | 176 | childUserId2 := []string{} |
175 | for _, val := range childUser { | 177 | for _, val := range childUser { |
176 | if val.Level >= 3 { | 178 | if val.Level >= 3 { |
@@ -270,11 +272,20 @@ func (srv *MessagePersonalService) TodayMessageTaskStageAnomaly(param *command.G | @@ -270,11 +272,20 @@ func (srv *MessagePersonalService) TodayMessageTaskStageAnomaly(param *command.G | ||
270 | } | 272 | } |
271 | uidStr := strconv.Itoa(param.UserId) | 273 | uidStr := strconv.Itoa(param.UserId) |
272 | //我作为任务相关人 | 274 | //我作为任务相关人 |
275 | +loop: | ||
273 | for _, val := range taskStageList0 { | 276 | for _, val := range taskStageList0 { |
274 | - | 277 | + // 排除 我就是负责人, |
275 | if val.LeaderId == uidStr { | 278 | if val.LeaderId == uidStr { |
276 | continue | 279 | continue |
277 | } | 280 | } |
281 | + | ||
282 | + //排除 我是任务负责人的直属上级 | ||
283 | + for _, val2 := range childUserId { | ||
284 | + if val.LeaderId == val2 { | ||
285 | + continue loop | ||
286 | + } | ||
287 | + } | ||
288 | + | ||
278 | s := fmt.Sprintf("【您关注的【%s】里程碑未按时完成,请知晓。】", val.TaskAlias) | 289 | s := fmt.Sprintf("【您关注的【%s】里程碑未按时完成,请知晓。】", val.TaskAlias) |
279 | msgList = append(msgList, adapter.MessageListAdapter{ | 290 | msgList = append(msgList, adapter.MessageListAdapter{ |
280 | Content: s, | 291 | Content: s, |
@@ -392,6 +403,7 @@ func (srv *MessagePersonalService) TodayMessageTaskRecordAnomaly(param *command. | @@ -392,6 +403,7 @@ func (srv *MessagePersonalService) TodayMessageTaskRecordAnomaly(param *command. | ||
392 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "检查任务里程碑异常的消息"+err.Error()) | 403 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "检查任务里程碑异常的消息"+err.Error()) |
393 | } | 404 | } |
394 | } | 405 | } |
406 | + // 我作为任务相关方 | ||
395 | 407 | ||
396 | msgList := []adapter.MessageListAdapter{} | 408 | msgList := []adapter.MessageListAdapter{} |
397 | for _, val := range taskStageList { | 409 | for _, val := range taskStageList { |
@@ -595,11 +595,12 @@ func (d *TaskDao) TaskStageAnomalyForCompany() ([]int, error) { | @@ -595,11 +595,12 @@ func (d *TaskDao) TaskStageAnomalyForCompany() ([]int, error) { | ||
595 | } | 595 | } |
596 | 596 | ||
597 | type TaskData4 struct { | 597 | type TaskData4 struct { |
598 | - TaskId int `pg:"task_id"` | ||
599 | - TaskName string `pg:"task_name"` | ||
600 | - TaskAlias string `pg:"task_alias"` | ||
601 | - LeaderName string `pg:"leader_name"` | ||
602 | - LeaderId int `pg:"leader_id"` | 598 | + TaskId int `pg:"task_id"` |
599 | + TaskName string `pg:"task_name"` | ||
600 | + TaskAlias string `pg:"task_alias"` | ||
601 | + LeaderName string `pg:"leader_name"` | ||
602 | + LeaderId int `pg:"leader_id"` | ||
603 | + RelatedUser []int `pg:"related_user,type:jsonb"` | ||
603 | } | 604 | } |
604 | 605 | ||
605 | // TaskStageAnomalyAll 获取所有里程碑异常的任务, | 606 | // TaskStageAnomalyAll 获取所有里程碑异常的任务, |
@@ -609,7 +610,8 @@ func (d TaskDao) TaskStageAnomalyAll() ([]TaskData4, error) { | @@ -609,7 +610,8 @@ func (d TaskDao) TaskStageAnomalyAll() ([]TaskData4, error) { | ||
609 | task."name" as task_name , | 610 | task."name" as task_name , |
610 | task.alias as task_alias, | 611 | task.alias as task_alias, |
611 | task.leader ->>'id' as leader_id, | 612 | task.leader ->>'id' as leader_id, |
612 | - task.leader ->>'name' as leader_name | 613 | + task.leader ->>'name' as leader_name, |
614 | + task.related_user | ||
613 | from task where 1=1 | 615 | from task where 1=1 |
614 | and task.deleted_at isnull | 616 | and task.deleted_at isnull |
615 | and ( | 617 | and ( |
@@ -624,12 +626,13 @@ and ( | @@ -624,12 +626,13 @@ and ( | ||
624 | } | 626 | } |
625 | 627 | ||
626 | type TaskData5 struct { | 628 | type TaskData5 struct { |
627 | - TaskId int `pg:"task_id"` | ||
628 | - TaskName string `pg:"task_name"` | ||
629 | - TaskAlias string `pg:"task_alias"` | ||
630 | - LeaderName string `pg:"leader_name"` | ||
631 | - LeaderId int `pg:"leader_id"` | ||
632 | - Anomaly int `pg:"anomaly"` | 629 | + TaskId int `pg:"task_id"` |
630 | + TaskName string `pg:"task_name"` | ||
631 | + TaskAlias string `pg:"task_alias"` | ||
632 | + LeaderName string `pg:"leader_name"` | ||
633 | + LeaderId int `pg:"leader_id"` | ||
634 | + RelatedUser []int `pg:"related_user,type:jsonb"` | ||
635 | + Anomaly int `pg:"anomaly"` | ||
633 | } | 636 | } |
634 | 637 | ||
635 | // TaskRecordAnomalyAll 获取所有反馈异常的任务, | 638 | // TaskRecordAnomalyAll 获取所有反馈异常的任务, |
@@ -640,7 +643,8 @@ func (d TaskDao) TaskRecordAnomalyAll() ([]TaskData5, error) { | @@ -640,7 +643,8 @@ func (d TaskDao) TaskRecordAnomalyAll() ([]TaskData5, error) { | ||
640 | task.alias as task_alias, | 643 | task.alias as task_alias, |
641 | task.anomaly, | 644 | task.anomaly, |
642 | task.leader ->>'id' as leader_id, | 645 | task.leader ->>'id' as leader_id, |
643 | - task.leader ->>'name' as leader_name | 646 | + task.leader ->>'name' as leader_name, |
647 | + task.related_user | ||
644 | from task where 1=1 | 648 | from task where 1=1 |
645 | and task.deleted_at isnull | 649 | and task.deleted_at isnull |
646 | and task.anomaly>0 ` | 650 | and task.anomaly>0 ` |
-
请 注册 或 登录 后发表评论