作者 tangxvhui

修复bug

... ... @@ -268,7 +268,7 @@ func (srv *MessagePersonalService) TodayMessageTaskStageAnomaly(param *command.G
}
//我作为任务相关人
for _, val := range taskStageList0 {
s := fmt.Sprintf("【您下级%s关注的项目【%s】里程碑未按时完成,请前往辅导。】", val.LeaderName, val.TaskName)
s := fmt.Sprintf("【您关注的【%s】里程碑未按时完成,请知晓。】", val.TaskAlias)
msgList = append(msgList, adapter.MessageListAdapter{
Content: s,
})
... ...
... ... @@ -718,7 +718,7 @@ func (srv TaskService) ListTask2(param *command.SearchTaskCommand) (map[string]i
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取任务列表"+err.Error())
}
//查到的任务数据总数
taskCount, err := taskDao.CountTaskStageNotHrbp(condition)
taskCount, err := taskDao.CountTaskNotHrbp(condition)
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "统计任务总数"+err.Error())
}
... ... @@ -827,7 +827,7 @@ func (srv TaskService) listTask2ForHrbp(param *command.SearchTaskCommand) (map[s
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取任务列表"+err.Error())
}
taskCount, err := taskDao.CountTaskStageByHrbp(condition)
taskCount, err := taskDao.CountTaskByHrbp(condition)
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "统计任务总数"+err.Error())
}
... ... @@ -1203,7 +1203,7 @@ func (srv TaskService) ListTask3(param *command.SearchTaskCommand) (map[string]i
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取任务列表"+err.Error())
}
//查到的任务数据总数
taskCount, err := taskDao.CountTaskStageNotHrbp(condition)
taskCount, err := taskDao.CountTaskNotHrbp(condition)
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "统计任务总数"+err.Error())
}
... ... @@ -1344,7 +1344,7 @@ func (srv TaskService) listTask3ForHrbp(param *command.SearchTaskCommand) (map[s
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取任务列表"+err.Error())
}
//查到的任务数据总数
taskCount, err := taskDao.CountTaskStageNotHrbp(condition)
taskCount, err := taskDao.CountTaskByHrbp(condition)
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "统计任务总数"+err.Error())
}
... ...
... ... @@ -43,9 +43,10 @@ func (d *TaskDao) catchTaskIdByPermission(userId int) string {
t_task_0 as (
(select task.id from task
join t_user on task.leader ->>'id'=t_user.id::text
where task.deleted_at isnull
)
union
(select task.id from task where task.related_user@>'[%d]')
(select task.id from task where task.related_user@>'[%d]' and task.deleted_at isnull)
),
t_task_ignore as (
select * from task_ignore where task_ignore.user_id =%d
... ... @@ -175,11 +176,11 @@ func (d *TaskDao) ListTaskStageNotHrbp(param ListTaskCondition) ([]ListTaskStage
}
// 获取任务总数,用于页面展示; 有过滤查看权限
func (d *TaskDao) CountTaskStageNotHrbp(param ListTaskCondition) (int, error) {
func (d *TaskDao) CountTaskNotHrbp(param ListTaskCondition) (int, error) {
task1 := d.catchTaskIdByPermission(param.UserId)
withSql := task1 + `select count(*) from task
join t_task_1 on task.id =t_task_1.id
where 1=1 and task.company_id=?`
where 1=1 and task.deleted_at isnull and task.company_id=?`
condition := []interface{}{param.CompanyId}
whereSql := ``
if param.OnlyMy {
... ... @@ -286,14 +287,14 @@ func (d *TaskDao) ListTaskStageByHrbp(param ListTaskCondition) ([]ListTaskStage,
}
// 获取任务总数,用于页面展示; 无过滤查看权限
func (d *TaskDao) CountTaskStageByHrbp(param ListTaskCondition) (int, error) {
func (d *TaskDao) CountTaskByHrbp(param ListTaskCondition) (int, error) {
withSql := `with
t_task_ignore as (
select task_ignore.task_id,task_ignore.id from task_ignore where task_ignore.user_id =?
)select count(*) from task
left join t_task_ignore on t_task_ignore.task_id=task.id
where 1=1 and t_task_ignore.id isnull and task.company_id=?`
where 1=1 and task.deleted_at isnull and t_task_ignore.id isnull and task.company_id=?`
condition := []interface{}{param.UserId, param.CompanyId}
whereSql := ``
if param.OnlyMy {
... ...