正在显示
6 个修改的文件
包含
29 行增加
和
21 行删除
@@ -15,4 +15,5 @@ type TaskItem struct { | @@ -15,4 +15,5 @@ type TaskItem struct { | ||
15 | StageE TaskStage `json:"stageE"` // 里程碑5 | 15 | StageE TaskStage `json:"stageE"` // 里程碑5 |
16 | UpdatedAt string `json:"updatedAt"` // | 16 | UpdatedAt string `json:"updatedAt"` // |
17 | Anomaly int `json:"anomaly"` //异常反馈情况 | 17 | Anomaly int `json:"anomaly"` //异常反馈情况 |
18 | + WarnFlag int `json:"warnFlag"` //里程碑完成时间异常标记 0:正常 1标记为异常 | ||
18 | } | 19 | } |
@@ -578,6 +578,7 @@ func (srv TaskService) ListTask(param *command.ListTaskCommand) (map[string]inte | @@ -578,6 +578,7 @@ func (srv TaskService) ListTask(param *command.ListTaskCommand) (map[string]inte | ||
578 | Level: val.Level, | 578 | Level: val.Level, |
579 | LevelName: val.LevelName, | 579 | LevelName: val.LevelName, |
580 | Anomaly: val.Anomaly, | 580 | Anomaly: val.Anomaly, |
581 | + WarnFlag: int(val.WarnFlag), | ||
581 | // StageA: adapter.TaskStage{}, | 582 | // StageA: adapter.TaskStage{}, |
582 | // StageB: adapter.TaskStage{}, | 583 | // StageB: adapter.TaskStage{}, |
583 | // StageC: adapter.TaskStage{}, | 584 | // StageC: adapter.TaskStage{}, |
@@ -726,12 +727,9 @@ func (srv TaskService) ListTask2(param *command.SearchTaskCommand) (map[string]i | @@ -726,12 +727,9 @@ func (srv TaskService) ListTask2(param *command.SearchTaskCommand) (map[string]i | ||
726 | Status: val.TaskStatus, | 727 | Status: val.TaskStatus, |
727 | Level: val.Level, | 728 | Level: val.Level, |
728 | LevelName: val.LevelName, | 729 | LevelName: val.LevelName, |
730 | + UpdatedAt: val.UpdatedAt.Local().Format("2006-01-02 15:04:05"), | ||
729 | Anomaly: val.Anomaly, | 731 | Anomaly: val.Anomaly, |
730 | - // StageA: adapter.TaskStage{}, | ||
731 | - // StageB: adapter.TaskStage{}, | ||
732 | - // StageC: adapter.TaskStage{}, | ||
733 | - // StageD: adapter.TaskStage{}, | ||
734 | - // StageE: adapter.TaskStage{}, | 732 | + WarnFlag: val.WarnFlag, |
735 | } | 733 | } |
736 | taskMapResult[val.TaskId] = &tk | 734 | taskMapResult[val.TaskId] = &tk |
737 | taskResult = append(taskResult, &tk) | 735 | taskResult = append(taskResult, &tk) |
@@ -836,7 +834,9 @@ func (srv TaskService) listTask2ForHrbp(param *command.SearchTaskCommand) (map[s | @@ -836,7 +834,9 @@ func (srv TaskService) listTask2ForHrbp(param *command.SearchTaskCommand) (map[s | ||
836 | Status: val.TaskStatus, | 834 | Status: val.TaskStatus, |
837 | Level: val.Level, | 835 | Level: val.Level, |
838 | LevelName: val.LevelName, | 836 | LevelName: val.LevelName, |
837 | + UpdatedAt: val.UpdatedAt.Local().Format("2006-01-02 15:04:05"), | ||
839 | Anomaly: val.Anomaly, | 838 | Anomaly: val.Anomaly, |
839 | + WarnFlag: val.WarnFlag, | ||
840 | // StageA: adapter.TaskStage{}, | 840 | // StageA: adapter.TaskStage{}, |
841 | // StageB: adapter.TaskStage{}, | 841 | // StageB: adapter.TaskStage{}, |
842 | // StageC: adapter.TaskStage{}, | 842 | // StageC: adapter.TaskStage{}, |
@@ -24,17 +24,17 @@ type Task struct { | @@ -24,17 +24,17 @@ type Task struct { | ||
24 | UpdatedAt time.Time `json:"updatedAt"` | 24 | UpdatedAt time.Time `json:"updatedAt"` |
25 | DeletedAt *time.Time `json:"deletedAt"` | 25 | DeletedAt *time.Time `json:"deletedAt"` |
26 | CompanyId int `json:"companyId,string"` | 26 | CompanyId int `json:"companyId,string"` |
27 | - Name string `json:"name"` // 任务名称 | ||
28 | - Alias string `json:"alias"` // 任务别名 | ||
29 | - Leader TaskLeader `json:"leader"` // 任务负责人 | ||
30 | - Status TaskState `json:"status"` // 任务的状态 | ||
31 | - Level int `json:"level"` // 优先级,值越小优先级越高 | ||
32 | - LevelName string `json:"levelName"` // 优先级名称 | ||
33 | - RelatedUser []int `json:"relatedUser"` // 相关的员工id | ||
34 | - RunAt int64 `json:"runAt"` // 启动的时间戳,秒 | ||
35 | - StopAt int64 `json:"stopAt"` // 停止的时间戳,秒 | ||
36 | - Anomaly int `json:"anomaly"` // 异常反馈的次数 | ||
37 | - WarnFlag TaskWarnFlag `json:"stageAnomaly"` // 里程碑异常标记 | 27 | + Name string `json:"name"` // 任务名称 |
28 | + Alias string `json:"alias"` // 任务别名 | ||
29 | + Leader TaskLeader `json:"leader"` // 任务负责人 | ||
30 | + Status TaskState `json:"status"` // 任务的状态 | ||
31 | + Level int `json:"level"` // 优先级,值越小优先级越高 | ||
32 | + LevelName string `json:"levelName"` // 优先级名称 | ||
33 | + RelatedUser []int `json:"relatedUser"` // 相关的员工id | ||
34 | + RunAt int64 `json:"runAt"` // 启动的时间戳,秒 | ||
35 | + StopAt int64 `json:"stopAt"` // 停止的时间戳,秒 | ||
36 | + Anomaly int `json:"anomaly"` // 异常反馈的次数 | ||
37 | + WarnFlag TaskWarnFlag `json:"warnFlag"` // 里程碑异常标记 | ||
38 | } | 38 | } |
39 | 39 | ||
40 | type TaskLeader struct { | 40 | type TaskLeader struct { |
@@ -80,6 +80,7 @@ type ListTaskStage struct { | @@ -80,6 +80,7 @@ type ListTaskStage struct { | ||
80 | LevelName string `pg:"level_name"` | 80 | LevelName string `pg:"level_name"` |
81 | Level int `pg:"level"` | 81 | Level int `pg:"level"` |
82 | Anomaly int `pg:"anomaly"` | 82 | Anomaly int `pg:"anomaly"` |
83 | + WarnFlag int `pg:"warn_flag"` | ||
83 | UpdatedAt time.Time `pg:"updated_at"` | 84 | UpdatedAt time.Time `pg:"updated_at"` |
84 | CreatedAt time.Time `pg:"created_at"` | 85 | CreatedAt time.Time `pg:"created_at"` |
85 | StageId int `pg:"stage_id"` | 86 | StageId int `pg:"stage_id"` |
@@ -109,6 +110,7 @@ func (d *TaskDao) ListTaskStageNotHrbp(param ListTaskCondition) ([]ListTaskStage | @@ -109,6 +110,7 @@ func (d *TaskDao) ListTaskStageNotHrbp(param ListTaskCondition) ([]ListTaskStage | ||
109 | task.updated_at , | 110 | task.updated_at , |
110 | task.created_at , | 111 | task.created_at , |
111 | task."level" , | 112 | task."level" , |
113 | + task."warn_flag", | ||
112 | task."status" as task_status, | 114 | task."status" as task_status, |
113 | task_stage."id" as stage_id, | 115 | task_stage."id" as stage_id, |
114 | task_stage."name" as stage_name, | 116 | task_stage."name" as stage_name, |
@@ -148,7 +150,8 @@ func (d *TaskDao) ListTaskStageNotHrbp(param ListTaskCondition) ([]ListTaskStage | @@ -148,7 +150,8 @@ func (d *TaskDao) ListTaskStageNotHrbp(param ListTaskCondition) ([]ListTaskStage | ||
148 | t_task_tage_1.real_completed_at, | 150 | t_task_tage_1.real_completed_at, |
149 | t_task_tage_1.stage_name, | 151 | t_task_tage_1.stage_name, |
150 | t_task_tage_1.stage_id, | 152 | t_task_tage_1.stage_id, |
151 | - t_task_tage_1.stage_sort_by | 153 | + t_task_tage_1.stage_sort_by, |
154 | + t_task_tage_1."warn_flag" | ||
152 | from t_task_tage_1 | 155 | from t_task_tage_1 |
153 | where t_task_tage_1.task_id in( | 156 | where t_task_tage_1.task_id in( |
154 | select t_task_page.task_id from t_task_page | 157 | select t_task_page.task_id from t_task_page |
@@ -229,6 +232,7 @@ func (d *TaskDao) ListTaskStageByHrbp(param ListTaskCondition) ([]ListTaskStage, | @@ -229,6 +232,7 @@ func (d *TaskDao) ListTaskStageByHrbp(param ListTaskCondition) ([]ListTaskStage, | ||
229 | task.level_name , | 232 | task.level_name , |
230 | task.anomaly , | 233 | task.anomaly , |
231 | task.updated_at , | 234 | task.updated_at , |
235 | + task."warn_flag", | ||
232 | task.created_at , | 236 | task.created_at , |
233 | task."level" , | 237 | task."level" , |
234 | task_stage."id" as stage_id, | 238 | task_stage."id" as stage_id, |
@@ -270,6 +274,7 @@ func (d *TaskDao) ListTaskStageByHrbp(param ListTaskCondition) ([]ListTaskStage, | @@ -270,6 +274,7 @@ func (d *TaskDao) ListTaskStageByHrbp(param ListTaskCondition) ([]ListTaskStage, | ||
270 | t_task_tage_1.real_completed_at, | 274 | t_task_tage_1.real_completed_at, |
271 | t_task_tage_1.stage_name, | 275 | t_task_tage_1.stage_name, |
272 | t_task_tage_1.stage_id, | 276 | t_task_tage_1.stage_id, |
277 | + t_task_tage_1."warn_flag", | ||
273 | t_task_tage_1.stage_sort_by | 278 | t_task_tage_1.stage_sort_by |
274 | from t_task_tage_1 | 279 | from t_task_tage_1 |
275 | where t_task_tage_1.task_id in( | 280 | where t_task_tage_1.task_id in( |
@@ -305,7 +310,7 @@ func (d *TaskDao) CountTaskStageByHrbp(param ListTaskCondition) (int, error) { | @@ -305,7 +310,7 @@ func (d *TaskDao) CountTaskStageByHrbp(param ListTaskCondition) (int, error) { | ||
305 | 310 | ||
306 | withSql := `with | 311 | withSql := `with |
307 | t_task_ignore as ( | 312 | t_task_ignore as ( |
308 | - select task_ignore.task_id,task_ignore.id from task_ignore where task_ignore.user_id =? | 313 | + select task_ignore.task_id,task_ignore.id from task_ignore where task_ignore.user_id =? |
309 | )select count(*) from task | 314 | )select count(*) from task |
310 | left join t_task_ignore on t_task_ignore.task_id=task.id | 315 | left join t_task_ignore on t_task_ignore.task_id=task.id |
311 | where 1=1 ` | 316 | where 1=1 ` |
@@ -23,6 +23,6 @@ type Task struct { | @@ -23,6 +23,6 @@ type Task struct { | ||
23 | RelatedUser []int `pg:"related_user"` // | 23 | RelatedUser []int `pg:"related_user"` // |
24 | RunAt int64 `pg:"run_at"` // 启动的时间 | 24 | RunAt int64 `pg:"run_at"` // 启动的时间 |
25 | StopAt int64 `pg:"stop_at"` // 停止的时间 | 25 | StopAt int64 `pg:"stop_at"` // 停止的时间 |
26 | - Anomaly int `json:"anomaly"` // 异常反馈的数量 | ||
27 | - | 26 | + Anomaly int `pg:"anomaly"` // 异常反馈的数量 |
27 | + WarnFlag int `pg:"warn_flag"` // 里程碑异常标记 | ||
28 | } | 28 | } |
@@ -40,6 +40,7 @@ func (repo *TaskRepository) TransformToDomain(d *models.Task) *domain.Task { | @@ -40,6 +40,7 @@ func (repo *TaskRepository) TransformToDomain(d *models.Task) *domain.Task { | ||
40 | RunAt: d.RunAt, | 40 | RunAt: d.RunAt, |
41 | StopAt: d.StopAt, | 41 | StopAt: d.StopAt, |
42 | Anomaly: d.Anomaly, | 42 | Anomaly: d.Anomaly, |
43 | + WarnFlag: domain.TaskWarnFlag(d.WarnFlag), | ||
43 | } | 44 | } |
44 | } | 45 | } |
45 | 46 | ||
@@ -55,15 +56,16 @@ func (repo *TaskRepository) Save(param *domain.Task) error { | @@ -55,15 +56,16 @@ func (repo *TaskRepository) Save(param *domain.Task) error { | ||
55 | DeletedAt: param.DeletedAt, | 56 | DeletedAt: param.DeletedAt, |
56 | Name: param.Name, | 57 | Name: param.Name, |
57 | Alias: param.Alias, | 58 | Alias: param.Alias, |
59 | + CompanyId: param.CompanyId, | ||
58 | Leader: param.Leader, | 60 | Leader: param.Leader, |
59 | Status: int(param.Status), | 61 | Status: int(param.Status), |
60 | Level: param.Level, | 62 | Level: param.Level, |
61 | LevelName: param.LevelName, | 63 | LevelName: param.LevelName, |
62 | RelatedUser: param.RelatedUser, | 64 | RelatedUser: param.RelatedUser, |
63 | RunAt: param.RunAt, | 65 | RunAt: param.RunAt, |
64 | - CompanyId: param.CompanyId, | ||
65 | StopAt: param.StopAt, | 66 | StopAt: param.StopAt, |
66 | Anomaly: param.Anomaly, | 67 | Anomaly: param.Anomaly, |
68 | + WarnFlag: int(param.WarnFlag), | ||
67 | } | 69 | } |
68 | db := repo.transactionContext.PgTx | 70 | db := repo.transactionContext.PgTx |
69 | if m.Id == 0 { | 71 | if m.Id == 0 { |
-
请 注册 或 登录 后发表评论