作者 tangxvhui

修复bug

@@ -268,7 +268,7 @@ func (srv *MessagePersonalService) TodayMessageTaskStageAnomaly(param *command.G @@ -268,7 +268,7 @@ func (srv *MessagePersonalService) TodayMessageTaskStageAnomaly(param *command.G
268 } 268 }
269 //我作为任务相关人 269 //我作为任务相关人
270 for _, val := range taskStageList0 { 270 for _, val := range taskStageList0 {
271 - s := fmt.Sprintf("【您下级%s关注的项目【%s】里程碑未按时完成,请前往辅导。】", val.LeaderName, val.TaskName) 271 + s := fmt.Sprintf("【您关注的【%s】里程碑未按时完成,请知晓。】", val.TaskAlias)
272 msgList = append(msgList, adapter.MessageListAdapter{ 272 msgList = append(msgList, adapter.MessageListAdapter{
273 Content: s, 273 Content: s,
274 }) 274 })
@@ -718,7 +718,7 @@ func (srv TaskService) ListTask2(param *command.SearchTaskCommand) (map[string]i @@ -718,7 +718,7 @@ func (srv TaskService) ListTask2(param *command.SearchTaskCommand) (map[string]i
718 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取任务列表"+err.Error()) 718 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取任务列表"+err.Error())
719 } 719 }
720 //查到的任务数据总数 720 //查到的任务数据总数
721 - taskCount, err := taskDao.CountTaskStageNotHrbp(condition) 721 + taskCount, err := taskDao.CountTaskNotHrbp(condition)
722 if err != nil { 722 if err != nil {
723 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "统计任务总数"+err.Error()) 723 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "统计任务总数"+err.Error())
724 } 724 }
@@ -827,7 +827,7 @@ func (srv TaskService) listTask2ForHrbp(param *command.SearchTaskCommand) (map[s @@ -827,7 +827,7 @@ func (srv TaskService) listTask2ForHrbp(param *command.SearchTaskCommand) (map[s
827 if err != nil { 827 if err != nil {
828 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取任务列表"+err.Error()) 828 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取任务列表"+err.Error())
829 } 829 }
830 - taskCount, err := taskDao.CountTaskStageByHrbp(condition) 830 + taskCount, err := taskDao.CountTaskByHrbp(condition)
831 if err != nil { 831 if err != nil {
832 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "统计任务总数"+err.Error()) 832 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "统计任务总数"+err.Error())
833 } 833 }
@@ -1203,7 +1203,7 @@ func (srv TaskService) ListTask3(param *command.SearchTaskCommand) (map[string]i @@ -1203,7 +1203,7 @@ func (srv TaskService) ListTask3(param *command.SearchTaskCommand) (map[string]i
1203 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取任务列表"+err.Error()) 1203 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取任务列表"+err.Error())
1204 } 1204 }
1205 //查到的任务数据总数 1205 //查到的任务数据总数
1206 - taskCount, err := taskDao.CountTaskStageNotHrbp(condition) 1206 + taskCount, err := taskDao.CountTaskNotHrbp(condition)
1207 if err != nil { 1207 if err != nil {
1208 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "统计任务总数"+err.Error()) 1208 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "统计任务总数"+err.Error())
1209 } 1209 }
@@ -1344,7 +1344,7 @@ func (srv TaskService) listTask3ForHrbp(param *command.SearchTaskCommand) (map[s @@ -1344,7 +1344,7 @@ func (srv TaskService) listTask3ForHrbp(param *command.SearchTaskCommand) (map[s
1344 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取任务列表"+err.Error()) 1344 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取任务列表"+err.Error())
1345 } 1345 }
1346 //查到的任务数据总数 1346 //查到的任务数据总数
1347 - taskCount, err := taskDao.CountTaskStageNotHrbp(condition) 1347 + taskCount, err := taskDao.CountTaskByHrbp(condition)
1348 if err != nil { 1348 if err != nil {
1349 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "统计任务总数"+err.Error()) 1349 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "统计任务总数"+err.Error())
1350 } 1350 }
@@ -43,9 +43,10 @@ func (d *TaskDao) catchTaskIdByPermission(userId int) string { @@ -43,9 +43,10 @@ func (d *TaskDao) catchTaskIdByPermission(userId int) string {
43 t_task_0 as ( 43 t_task_0 as (
44 (select task.id from task 44 (select task.id from task
45 join t_user on task.leader ->>'id'=t_user.id::text 45 join t_user on task.leader ->>'id'=t_user.id::text
  46 + where task.deleted_at isnull
46 ) 47 )
47 union 48 union
48 - (select task.id from task where task.related_user@>'[%d]') 49 + (select task.id from task where task.related_user@>'[%d]' and task.deleted_at isnull)
49 ), 50 ),
50 t_task_ignore as ( 51 t_task_ignore as (
51 select * from task_ignore where task_ignore.user_id =%d 52 select * from task_ignore where task_ignore.user_id =%d
@@ -175,11 +176,11 @@ func (d *TaskDao) ListTaskStageNotHrbp(param ListTaskCondition) ([]ListTaskStage @@ -175,11 +176,11 @@ func (d *TaskDao) ListTaskStageNotHrbp(param ListTaskCondition) ([]ListTaskStage
175 } 176 }
176 177
177 // 获取任务总数,用于页面展示; 有过滤查看权限 178 // 获取任务总数,用于页面展示; 有过滤查看权限
178 -func (d *TaskDao) CountTaskStageNotHrbp(param ListTaskCondition) (int, error) { 179 +func (d *TaskDao) CountTaskNotHrbp(param ListTaskCondition) (int, error) {
179 task1 := d.catchTaskIdByPermission(param.UserId) 180 task1 := d.catchTaskIdByPermission(param.UserId)
180 withSql := task1 + `select count(*) from task 181 withSql := task1 + `select count(*) from task
181 join t_task_1 on task.id =t_task_1.id 182 join t_task_1 on task.id =t_task_1.id
182 - where 1=1 and task.company_id=?` 183 + where 1=1 and task.deleted_at isnull and task.company_id=?`
183 condition := []interface{}{param.CompanyId} 184 condition := []interface{}{param.CompanyId}
184 whereSql := `` 185 whereSql := ``
185 if param.OnlyMy { 186 if param.OnlyMy {
@@ -286,14 +287,14 @@ func (d *TaskDao) ListTaskStageByHrbp(param ListTaskCondition) ([]ListTaskStage, @@ -286,14 +287,14 @@ func (d *TaskDao) ListTaskStageByHrbp(param ListTaskCondition) ([]ListTaskStage,
286 } 287 }
287 288
288 // 获取任务总数,用于页面展示; 无过滤查看权限 289 // 获取任务总数,用于页面展示; 无过滤查看权限
289 -func (d *TaskDao) CountTaskStageByHrbp(param ListTaskCondition) (int, error) { 290 +func (d *TaskDao) CountTaskByHrbp(param ListTaskCondition) (int, error) {
290 291
291 withSql := `with 292 withSql := `with
292 t_task_ignore as ( 293 t_task_ignore as (
293 select task_ignore.task_id,task_ignore.id from task_ignore where task_ignore.user_id =? 294 select task_ignore.task_id,task_ignore.id from task_ignore where task_ignore.user_id =?
294 )select count(*) from task 295 )select count(*) from task
295 left join t_task_ignore on t_task_ignore.task_id=task.id 296 left join t_task_ignore on t_task_ignore.task_id=task.id
296 - where 1=1 and t_task_ignore.id isnull and task.company_id=?` 297 + where 1=1 and task.deleted_at isnull and t_task_ignore.id isnull and task.company_id=?`
297 condition := []interface{}{param.UserId, param.CompanyId} 298 condition := []interface{}{param.UserId, param.CompanyId}
298 whereSql := `` 299 whereSql := ``
299 if param.OnlyMy { 300 if param.OnlyMy {