作者 tangxvhui

调整 弹窗通知的内容

... ... @@ -157,6 +157,7 @@ func (srv *MessagePersonalService) TodayMessageTaskStageAnomaly(param *command.G
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取下级员工"+err.Error())
}
//我的直属下级人员
childUserId := []string{}
for _, val := range childUser {
if val.Level == 2 {
... ... @@ -171,6 +172,7 @@ func (srv *MessagePersonalService) TodayMessageTaskStageAnomaly(param *command.G
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "检查任务里程碑异常的消息"+err.Error())
}
}
//我的下下级人员
childUserId2 := []string{}
for _, val := range childUser {
if val.Level >= 3 {
... ... @@ -270,11 +272,20 @@ func (srv *MessagePersonalService) TodayMessageTaskStageAnomaly(param *command.G
}
uidStr := strconv.Itoa(param.UserId)
//我作为任务相关人
loop:
for _, val := range taskStageList0 {
// 排除 我就是负责人,
if val.LeaderId == uidStr {
continue
}
//排除 我是任务负责人的直属上级
for _, val2 := range childUserId {
if val.LeaderId == val2 {
continue loop
}
}
s := fmt.Sprintf("【您关注的【%s】里程碑未按时完成,请知晓。】", val.TaskAlias)
msgList = append(msgList, adapter.MessageListAdapter{
Content: s,
... ... @@ -392,6 +403,7 @@ func (srv *MessagePersonalService) TodayMessageTaskRecordAnomaly(param *command.
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "检查任务里程碑异常的消息"+err.Error())
}
}
// 我作为任务相关方
msgList := []adapter.MessageListAdapter{}
for _, val := range taskStageList {
... ...
... ... @@ -600,6 +600,7 @@ type TaskData4 struct {
TaskAlias string `pg:"task_alias"`
LeaderName string `pg:"leader_name"`
LeaderId int `pg:"leader_id"`
RelatedUser []int `pg:"related_user,type:jsonb"`
}
// TaskStageAnomalyAll 获取所有里程碑异常的任务,
... ... @@ -609,7 +610,8 @@ func (d TaskDao) TaskStageAnomalyAll() ([]TaskData4, error) {
task."name" as task_name ,
task.alias as task_alias,
task.leader ->>'id' as leader_id,
task.leader ->>'name' as leader_name
task.leader ->>'name' as leader_name,
task.related_user
from task where 1=1
and task.deleted_at isnull
and (
... ... @@ -629,6 +631,7 @@ type TaskData5 struct {
TaskAlias string `pg:"task_alias"`
LeaderName string `pg:"leader_name"`
LeaderId int `pg:"leader_id"`
RelatedUser []int `pg:"related_user,type:jsonb"`
Anomaly int `pg:"anomaly"`
}
... ... @@ -640,7 +643,8 @@ func (d TaskDao) TaskRecordAnomalyAll() ([]TaskData5, error) {
task.alias as task_alias,
task.anomaly,
task.leader ->>'id' as leader_id,
task.leader ->>'name' as leader_name
task.leader ->>'name' as leader_name,
task.related_user
from task where 1=1
and task.deleted_at isnull
and task.anomaly>0 `
... ...