作者 tangxvhui

调整 任务列表查询

... ... @@ -1293,11 +1293,12 @@ func (srv TaskService) listTask3ForHrbp(param *command.SearchTaskCommand) (map[s
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "统计任务总数"+err.Error())
}
//
//里程碑异常
taskStageAnomalyCnt, err := taskDao.CountTaskStageAnomalyNotHrbp(condition)
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "统计任务里程碑总数"+err.Error())
}
//反馈异常数
taskAnomalyCnt, err := taskDao.CountTaskAnomalyNotHrbp(condition)
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "统计任务里程碑总数"+err.Error())
... ...
... ... @@ -608,6 +608,7 @@ func (d TaskDao) TaskStageAnomalyAll(companyId int) ([]TaskData4, error) {
}
type ListTask struct {
SortBy1 int `pg:"sort_by_1"`
CPlanCompletedAt int `pg:"c_plan_completed_at"`
LastStageDiff int `pg:"last_stage_diff"`
TaskId int `pg:"task_id"`
... ... @@ -636,6 +637,7 @@ func (d *TaskDao) ListTaskByHrbpV2(param ListTaskCondition) ([]ListTask, error)
cast(COALESCE(task.current_stage ->>'plan_completed_at','0') as int) as c_plan_completed_at,
cast(COALESCE(task.last_stage ->>'plan_completed_at','0') as int) as l_plan_completed_at,
cast(COALESCE(task.last_stage ->>'real_completed_at','0') as int) as l_real_completed_at,
floor(extract(epoch from now())) as now_time,
task.id ,
task.alias ,
task.leader ->>'name' as leader_name,
... ... @@ -647,7 +649,7 @@ func (d *TaskDao) ListTaskByHrbpV2(param ListTaskCondition) ([]ListTask, error)
task.created_at
from task
left join t_task_ignore on t_task_ignore.task_id=task.id
where 1=1 and t_task_ignore.id isnull
where 1=1 and t_task_ignore.id isnull and task.company_id=?
%s
),
t_task_1 as (
... ... @@ -659,7 +661,7 @@ func (d *TaskDao) ListTaskByHrbpV2(param ListTaskCondition) ([]ListTask, error)
end) as sort_by_1,
t_task.c_plan_completed_at ,
t_task.l_plan_completed_at-t_task.l_real_completed_at as last_stage_diff,
t_task.id ,
t_task.id as task_id,
t_task.alias ,
t_task.leader_name,
t_task."level",
... ... @@ -702,6 +704,7 @@ func (d *TaskDao) ListTaskNotHrbpV2(param ListTaskCondition) ([]ListTask, error)
cast(COALESCE(task.current_stage ->>'plan_completed_at','0') as int) as c_plan_completed_at,
cast(COALESCE(task.last_stage ->>'plan_completed_at','0') as int) as l_plan_completed_at,
cast(COALESCE(task.last_stage ->>'real_completed_at','0') as int) as l_real_completed_at,
floor(extract(epoch from now())) as now_time,
task.id ,
task.alias ,
task.leader ->>'name' as leader_name,
... ... @@ -713,7 +716,7 @@ func (d *TaskDao) ListTaskNotHrbpV2(param ListTaskCondition) ([]ListTask, error)
task.created_at
from task
join t_task_1 on t_task_1.id=task.id
where 1=1
where 1=1 and task.company_id=?
%s
),
t_task_1 as (
... ... @@ -725,7 +728,7 @@ func (d *TaskDao) ListTaskNotHrbpV2(param ListTaskCondition) ([]ListTask, error)
end) as sort_by_1,
t_task.c_plan_completed_at ,
t_task.l_plan_completed_at-t_task.l_real_completed_at as last_stage_diff,
t_task.id ,
t_task.id as task_id,
t_task.alias ,
t_task.leader_name,
t_task."level",
... ...
... ... @@ -137,7 +137,7 @@ func (c *TaskController) ListTask2() {
userReq := middlewares.GetUser(c.Ctx)
paramReq.CompanyId = int(userReq.CompanyId)
paramReq.UserId = int(userReq.UserId)
result, err := srv.ListTask2(paramReq)
result, err := srv.ListTask3(paramReq)
c.Response(result, err)
}
... ...