Merge branch 'dev-zhengzhou' into test
正在显示
5 个修改的文件
包含
21 行增加
和
5 行删除
@@ -3,6 +3,7 @@ package service | @@ -3,6 +3,7 @@ package service | ||
3 | import ( | 3 | import ( |
4 | "fmt" | 4 | "fmt" |
5 | "strconv" | 5 | "strconv" |
6 | + "strings" | ||
6 | "time" | 7 | "time" |
7 | 8 | ||
8 | service "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/role" | 9 | service "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/role" |
@@ -1250,8 +1251,15 @@ func (srv StaffAssessServeice) SaveSelfAssess(in *command.SaveSelfAssessCommand) | @@ -1250,8 +1251,15 @@ func (srv StaffAssessServeice) SaveSelfAssess(in *command.SaveSelfAssessCommand) | ||
1250 | for i := range taskRecords { | 1251 | for i := range taskRecords { |
1251 | it := taskRecords[i] | 1252 | it := taskRecords[i] |
1252 | if v, ok := recordMap[it.Id]; ok { | 1253 | if v, ok := recordMap[it.Id]; ok { |
1253 | - it.AssistLevel = v.AssistLevel // 更新上级辅导情况 | ||
1254 | - it.AssistContent = v.AssistContent // 更新上级辅导内容 | 1254 | + it.AssistLevel = v.AssistLevel // 更新上级辅导情况 |
1255 | + it.AssistContent = v.AssistContent // 更新上级辅导内容 | ||
1256 | + // 去掉前后空格进行判断 | ||
1257 | + trimSpace := strings.TrimSpace(v.AssistContent) | ||
1258 | + if len(trimSpace) == 0 || trimSpace == "无" { | ||
1259 | + it.AnomalyState = domain.AnomalyState0 | ||
1260 | + } else { | ||
1261 | + it.AnomalyState = domain.AnomalyState1 | ||
1262 | + } | ||
1255 | if v.TaskStageId == it.TaskStageCheck.Id { // 更新里程碑状态 | 1263 | if v.TaskStageId == it.TaskStageCheck.Id { // 更新里程碑状态 |
1256 | if v.Check == domain.TaskStageUncompleted { | 1264 | if v.Check == domain.TaskStageUncompleted { |
1257 | it.TaskStageCheck.RealCompletedAt = 0 | 1265 | it.TaskStageCheck.RealCompletedAt = 0 |
@@ -887,8 +887,7 @@ func (srv TaskService) ReplyTaskStage(transactionContext application.Transaction | @@ -887,8 +887,7 @@ func (srv TaskService) ReplyTaskStage(transactionContext application.Transaction | ||
887 | if err != nil { | 887 | if err != nil { |
888 | return application.ThrowError(application.INTERNAL_SERVER_ERROR, "找不到任务数据"+err.Error()) | 888 | return application.ThrowError(application.INTERNAL_SERVER_ERROR, "找不到任务数据"+err.Error()) |
889 | } | 889 | } |
890 | - | ||
891 | - if !(len(val.AssistContent) == 0 || val.AssistContent == "无") { | 890 | + if val.AnomalyState == domain.AnomalyState1 { |
892 | taskData.Anomaly = 0 | 891 | taskData.Anomaly = 0 |
893 | } | 892 | } |
894 | taskList = append(taskList, taskData) | 893 | taskList = append(taskList, taskData) |
@@ -9,6 +9,11 @@ const ( | @@ -9,6 +9,11 @@ const ( | ||
9 | AssistLevel4 int = 4 // 已辅导-辅导对里程碑作用很好 | 9 | AssistLevel4 int = 4 // 已辅导-辅导对里程碑作用很好 |
10 | ) | 10 | ) |
11 | 11 | ||
12 | +const ( | ||
13 | + AnomalyState0 int = 0 // 异常 | ||
14 | + AnomalyState1 int = 1 // 正常 | ||
15 | +) | ||
16 | + | ||
12 | // TaskRecord 任务反馈情况记录 | 17 | // TaskRecord 任务反馈情况记录 |
13 | type TaskRecord struct { | 18 | type TaskRecord struct { |
14 | Id int `json:"id,string" comment:"记录ID"` | 19 | Id int `json:"id,string" comment:"记录ID"` |
@@ -21,6 +26,7 @@ type TaskRecord struct { | @@ -21,6 +26,7 @@ type TaskRecord struct { | ||
21 | TaskLeader TaskLeader `json:"taskLeader" comment:"任务负责人"` | 26 | TaskLeader TaskLeader `json:"taskLeader" comment:"任务负责人"` |
22 | AssistLevel int `json:"assistLevel" comment:"上级辅导情况"` | 27 | AssistLevel int `json:"assistLevel" comment:"上级辅导情况"` |
23 | AssistContent string `json:"assistContent" comment:"上级辅导内容"` | 28 | AssistContent string `json:"assistContent" comment:"上级辅导内容"` |
29 | + AnomalyState int `json:"anomalyState" comment:"异常反馈状态(0异常、1正常)"` | ||
24 | TaskStages []TaskStage `json:"taskStages" comment:"里程碑列表"` | 30 | TaskStages []TaskStage `json:"taskStages" comment:"里程碑列表"` |
25 | TaskStageCheck TaskStage `json:"taskStageCheck" comment:"提交的里程碑"` | 31 | TaskStageCheck TaskStage `json:"taskStageCheck" comment:"提交的里程碑"` |
26 | CreatedAt time.Time `json:"createdAt" comment:"创建时间"` | 32 | CreatedAt time.Time `json:"createdAt" comment:"创建时间"` |
@@ -16,8 +16,9 @@ type TaskRecord struct { | @@ -16,8 +16,9 @@ type TaskRecord struct { | ||
16 | TaskName string `comment:"任务名称"` | 16 | TaskName string `comment:"任务名称"` |
17 | TaskAlias string `comment:"任务别名"` | 17 | TaskAlias string `comment:"任务别名"` |
18 | TaskLeader domain.TaskLeader `comment:"任务负责人"` | 18 | TaskLeader domain.TaskLeader `comment:"任务负责人"` |
19 | - AssistLevel int `comment:"上级辅导情况"` | 19 | + AssistLevel int `comment:"上级辅导情况" pg:",use_zero"` |
20 | AssistContent string `comment:"上级辅导内容"` | 20 | AssistContent string `comment:"上级辅导内容"` |
21 | + AnomalyState int `comment:"异常反馈状态" pg:",use_zero"` | ||
21 | TaskStages []domain.TaskStage `comment:"里程碑列表"` | 22 | TaskStages []domain.TaskStage `comment:"里程碑列表"` |
22 | TaskStageCheck domain.TaskStage `comment:"提交的里程碑"` | 23 | TaskStageCheck domain.TaskStage `comment:"提交的里程碑"` |
23 | CreatedAt time.Time `comment:"创建时间"` | 24 | CreatedAt time.Time `comment:"创建时间"` |
@@ -32,6 +32,7 @@ func (repo *TaskRecordRepository) TransformToDomain(m *models.TaskRecord) domain | @@ -32,6 +32,7 @@ func (repo *TaskRecordRepository) TransformToDomain(m *models.TaskRecord) domain | ||
32 | TaskLeader: m.TaskLeader, | 32 | TaskLeader: m.TaskLeader, |
33 | AssistLevel: m.AssistLevel, | 33 | AssistLevel: m.AssistLevel, |
34 | AssistContent: m.AssistContent, | 34 | AssistContent: m.AssistContent, |
35 | + AnomalyState: m.AnomalyState, | ||
35 | TaskStages: m.TaskStages, | 36 | TaskStages: m.TaskStages, |
36 | TaskStageCheck: m.TaskStageCheck, | 37 | TaskStageCheck: m.TaskStageCheck, |
37 | CreatedAt: m.CreatedAt.Local(), | 38 | CreatedAt: m.CreatedAt.Local(), |
@@ -52,6 +53,7 @@ func (repo *TaskRecordRepository) TransformToModel(d *domain.TaskRecord) models. | @@ -52,6 +53,7 @@ func (repo *TaskRecordRepository) TransformToModel(d *domain.TaskRecord) models. | ||
52 | TaskLeader: d.TaskLeader, | 53 | TaskLeader: d.TaskLeader, |
53 | AssistLevel: d.AssistLevel, | 54 | AssistLevel: d.AssistLevel, |
54 | AssistContent: d.AssistContent, | 55 | AssistContent: d.AssistContent, |
56 | + AnomalyState: d.AnomalyState, | ||
55 | TaskStages: d.TaskStages, | 57 | TaskStages: d.TaskStages, |
56 | TaskStageCheck: d.TaskStageCheck, | 58 | TaskStageCheck: d.TaskStageCheck, |
57 | CreatedAt: d.CreatedAt, | 59 | CreatedAt: d.CreatedAt, |
-
请 注册 或 登录 后发表评论