...
|
...
|
@@ -408,17 +408,21 @@ type TaskData3 struct { |
|
|
|
|
|
// 根据负责人获取超期未完成的异常的里程碑任务
|
|
|
func (d *TaskDao) TaskStageAnomalyByLeader(leaderId []string) ([]TaskData3, error) {
|
|
|
sqlStr := `select distinct
|
|
|
task.id as task_id,
|
|
|
task.leader ->>'name' as leader_name,
|
|
|
task.leader ->>'id' as leader_id,
|
|
|
task.alias as task_alias,
|
|
|
task.name as task_name
|
|
|
from task
|
|
|
join task_stage on task.id=task_stage.task_id
|
|
|
where 1=1
|
|
|
and task_stage.real_completed_at=0 and task_stage.plan_completed_at<extract(epoch from now())
|
|
|
and task.leader ->>'id' in(?) `
|
|
|
sqlStr := `select
|
|
|
task.id as task_id,
|
|
|
task."name" as task_name ,
|
|
|
task.alias as task_alias,
|
|
|
task.leader ->>'id' as leader_id,
|
|
|
task.leader ->>'name' as leader_name
|
|
|
from task where 1=1
|
|
|
and task.deleted_at isnull
|
|
|
and (
|
|
|
task.last_stage ->>'planCompletedAt'< task.last_stage ->>'realCompletedAt'
|
|
|
or
|
|
|
cast(COALESCE(task.current_stage ->>'plan_completed_at','0') as int) between 1 and floor(extract(epoch from now()))
|
|
|
)
|
|
|
and task.leader ->>'id' in(?) `
|
|
|
|
|
|
result := []TaskData3{}
|
|
|
tx := d.transactionContext.PgTx
|
|
|
_, err := tx.Query(&result, sqlStr, pg.In(leaderId))
|
...
|
...
|
@@ -427,17 +431,20 @@ func (d *TaskDao) TaskStageAnomalyByLeader(leaderId []string) ([]TaskData3, erro |
|
|
|
|
|
// 根据任务相关人获取超期未完成的异常的里程碑任务
|
|
|
func (d *TaskDao) TaskStageAnomalyByRelatedUser(relatedUserId int) ([]TaskData3, error) {
|
|
|
sqlStr := `select distinct
|
|
|
sqlStr := `select
|
|
|
task.id as task_id,
|
|
|
task.leader ->>'name' as leader_name,
|
|
|
task.leader ->>'id' as leader_id,
|
|
|
task."name" as task_name ,
|
|
|
task.alias as task_alias,
|
|
|
task.name as task_name
|
|
|
from task
|
|
|
join task_stage on task.id=task_stage.task_id
|
|
|
where 1=1
|
|
|
and task_stage.real_completed_at=0 and task_stage.plan_completed_at<extract(epoch from now())
|
|
|
and task.related_user @>? `
|
|
|
task.leader ->>'id' as leader_id,
|
|
|
task.leader ->>'name' as leader_name
|
|
|
from task where 1=1
|
|
|
and task.deleted_at isnull
|
|
|
and (
|
|
|
task.last_stage ->>'planCompletedAt'< task.last_stage ->>'realCompletedAt'
|
|
|
or
|
|
|
cast(COALESCE(task.current_stage ->>'plan_completed_at','0') as int) between 1 and floor(extract(epoch from now()))
|
|
|
)
|
|
|
and task.related_user @>? `
|
|
|
|
|
|
relatedUser := fmt.Sprintf("[%d]", relatedUserId)
|
|
|
result := []TaskData3{}
|
...
|
...
|
|