作者 tangxvhui

调整任务列表标记

... ... @@ -1243,6 +1243,9 @@ func (srv TaskService) ListTask3(param *command.SearchTaskCommand) (map[string]i
if val.WarnFlag > 0 {
val.WarnFlag = 1
}
if val.CurrentStage.Id == 0 {
tk.WarnFlag = 0
}
// if val.LastStage.Id > 0 && val.LastStage.PlanCompletedAt < val.LastStage.RealCompletedAt {
// tk.WarnFlag = int(domain.TaskWarn)
// }
... ... @@ -1528,6 +1531,12 @@ func (srv TaskService) listTask3ForHrbp(param *command.SearchTaskCommand) (map[s
if val.CurrentStage.RealCompletedAt > 0 {
tk.CurrentStage.RealCompletedAt = time.Unix(int64(val.CurrentStage.RealCompletedAt), 0).Local().Format("2006-01-02")
}
if tk.WarnFlag > 0 {
tk.WarnFlag = 1
}
if val.CurrentStage.Id == 0 {
tk.WarnFlag = 0
}
// if val.LastStage.Id > 0 && val.LastStage.PlanCompletedAt < val.LastStage.RealCompletedAt {
// tk.WarnFlag = int(domain.TaskWarn)
// }
... ... @@ -1779,7 +1788,7 @@ func (srv *TaskService) ListTaskIgnore(param *command.SearchTaskCommand) (result
taskStageRepo := factory.CreateTaskStageRepository(map[string]interface{}{
"transactionContext": transactionContext,
})
nowTime := time.Now().Unix()
for _, val := range taskListData {
tk := adapter.TaskItem{
Id: val.TaskId,
... ... @@ -1791,7 +1800,7 @@ func (srv *TaskService) ListTaskIgnore(param *command.SearchTaskCommand) (result
LevelName: val.LevelName,
UpdatedAt: val.UpdatedAt.Local().Format("2006-01-02 15:04:05"),
Anomaly: val.Anomaly,
WarnFlag: 0,
WarnFlag: val.WarnFlag,
LastStage: adapter.TaskStage{
Id: val.LastStage.Id,
Name: val.LastStage.Name,
... ... @@ -1815,13 +1824,19 @@ func (srv *TaskService) ListTaskIgnore(param *command.SearchTaskCommand) (result
if val.CurrentStage.RealCompletedAt > 0 {
tk.CurrentStage.RealCompletedAt = time.Unix(int64(val.CurrentStage.RealCompletedAt), 0).Local().Format("2006-01-02")
}
if val.LastStage.Id > 0 && val.LastStage.PlanCompletedAt < val.LastStage.RealCompletedAt {
// tk.WarnFlag = int(domain.TaskWarn)
// if val.LastStage.Id > 0 && val.LastStage.PlanCompletedAt < val.LastStage.RealCompletedAt {
// // tk.WarnFlag = int(domain.TaskWarn)
// tk.WarnFlag = 1
// }
// if val.CurrentStage.Id > 0 && val.CurrentStage.PlanCompletedAt < nowTime {
// // tk.WarnFlag = int(domain.TaskWarn)
// tk.WarnFlag = 1
// }
if tk.WarnFlag > 0 {
tk.WarnFlag = 1
}
if val.CurrentStage.Id > 0 && val.CurrentStage.PlanCompletedAt < nowTime {
// tk.WarnFlag = int(domain.TaskWarn)
tk.WarnFlag = 1
if val.CurrentStage.Id == 0 {
tk.WarnFlag = 0
}
_, stageList, err := taskStageRepo.Find(map[string]interface{}{
"taskId": val.TaskId,
... ...
... ... @@ -422,6 +422,7 @@ func (srv TaskService) ListTaskAnomaly1(param *command.ListTaskAnomalyCommand) (
taskAnomalyDao := dao.NewTaskAnomalyDao(map[string]interface{}{
"transactionContext": transactionContext,
})
limit := 1000
offset := 0
cnt, anomalyList, err := taskAnomalyDao.List1(param.UserId, param.CompanyId, param.TaskName, param.Category, param.DayTime, limit, offset)
... ...
... ... @@ -364,7 +364,7 @@ func (d *TaskAnomalyDao) List3(userId int, companyId int, taskName string, categ
where t_task_ignore.id isnull and task.deleted_at isnull
and task_anomaly.company_id = ?
and task.related_user@> ?
and task.leader->>'id' not in (select id::text from t_user where t_user."level" <3)
and not exists (select t_user.id::text from t_user where t_user."level" <3 and task.leader->>'id'=t_user.id::text )
and task_anomaly.is_last=1
`
... ... @@ -395,7 +395,7 @@ func (d *TaskAnomalyDao) List3(userId int, companyId int, taskName string, categ
where t_task_ignore.id isnull and task.deleted_at isnull
and task_anomaly.company_id = ?
and task.related_user@> ?
and task.leader->>'id' not in (select id::text from t_user where t_user."level" <3)
and not exists (select t_user.id::text from t_user where t_user."level" <3 and task.leader->>'id'=t_user.id::text )
and task_anomaly.is_last=1
`
... ...