正在显示
3 个修改的文件
包含
34 行增加
和
20 行删除
@@ -1255,11 +1255,19 @@ func (srv StaffAssessServeice) SaveSelfAssess(in *command.SaveSelfAssessCommand) | @@ -1255,11 +1255,19 @@ func (srv StaffAssessServeice) SaveSelfAssess(in *command.SaveSelfAssessCommand) | ||
1255 | it.AssistLevel = v.AssistLevel // 更新上级辅导情况 | 1255 | it.AssistLevel = v.AssistLevel // 更新上级辅导情况 |
1256 | it.AssistContent = v.AssistContent // 更新上级辅导内容 | 1256 | it.AssistContent = v.AssistContent // 更新上级辅导内容 |
1257 | if v.TaskStageId == it.TaskStageCheck.Id { // 更新里程碑状态 | 1257 | if v.TaskStageId == it.TaskStageCheck.Id { // 更新里程碑状态 |
1258 | - it.TaskStageCheck.Status = v.Status | 1258 | + if v.Check == domain.TaskStageUncompleted { |
1259 | + it.TaskStageCheck.RealCompletedAt = 0 | ||
1260 | + } else { | ||
1261 | + it.TaskStageCheck.RealCompletedAt = time.Now().Unix() | ||
1262 | + } | ||
1259 | } | 1263 | } |
1260 | for j := range it.TaskStages { | 1264 | for j := range it.TaskStages { |
1261 | if v.TaskStageId == it.TaskStages[j].Id { // 更新里程碑状态 | 1265 | if v.TaskStageId == it.TaskStages[j].Id { // 更新里程碑状态 |
1262 | - it.TaskStages[j].Status = v.Status | 1266 | + if v.Check == domain.TaskStageUncompleted { |
1267 | + it.TaskStages[j].RealCompletedAt = 0 | ||
1268 | + } else { | ||
1269 | + it.TaskStages[j].RealCompletedAt = time.Now().Unix() | ||
1270 | + } | ||
1263 | } | 1271 | } |
1264 | } | 1272 | } |
1265 | _, err := taskRecordRepository.Insert(it) | 1273 | _, err := taskRecordRepository.Insert(it) |
@@ -2,6 +2,13 @@ package domain | @@ -2,6 +2,13 @@ package domain | ||
2 | 2 | ||
3 | import "time" | 3 | import "time" |
4 | 4 | ||
5 | +type TaskStageCheck int | ||
6 | + | ||
7 | +const ( | ||
8 | + TaskStageUncompleted TaskStageCheck = 0 // 里程碑未完成 | ||
9 | + TaskStageCompleted TaskStageCheck = 1 // 里程碑完成 | ||
10 | +) | ||
11 | + | ||
5 | // StaffAssessCache 填写评估数据(缓存暂未提交) | 12 | // StaffAssessCache 填写评估数据(缓存暂未提交) |
6 | type StaffAssessCache struct { | 13 | type StaffAssessCache struct { |
7 | Id int64 `json:"id,string" comment:"ID"` | 14 | Id int64 `json:"id,string" comment:"ID"` |
@@ -30,7 +37,7 @@ type AssessTaskStage struct { | @@ -30,7 +37,7 @@ type AssessTaskStage struct { | ||
30 | Name string `json:"name"` | 37 | Name string `json:"name"` |
31 | TaskRecordId int `json:"taskRecordId" comment:"任务记录ID"` | 38 | TaskRecordId int `json:"taskRecordId" comment:"任务记录ID"` |
32 | TaskStageId int `json:"taskStageId" comment:"里程碑ID"` | 39 | TaskStageId int `json:"taskStageId" comment:"里程碑ID"` |
33 | - Status TaskStageState `json:"status" comment:"里程碑完成情况"` | 40 | + Check TaskStageCheck `json:"check" comment:"里程碑完成情况"` |
34 | AssistLevel int `json:"assistLevel" comment:"上级辅导情况"` | 41 | AssistLevel int `json:"assistLevel" comment:"上级辅导情况"` |
35 | AssistContent string `json:"assistContent" comment:"上级辅导内容"` | 42 | AssistContent string `json:"assistContent" comment:"上级辅导内容"` |
36 | } | 43 | } |
@@ -2,26 +2,25 @@ package domain | @@ -2,26 +2,25 @@ package domain | ||
2 | 2 | ||
3 | import "time" | 3 | import "time" |
4 | 4 | ||
5 | -type TaskStageState int | ||
6 | - | ||
7 | -const ( | ||
8 | - TaskStageUncompleted TaskStageState = 1 //里程碑未完成 | ||
9 | - TaskStageCompleted TaskStageState = 2 //里程碑完成 | ||
10 | - | ||
11 | -) | 5 | +//type TaskStageState int |
6 | +// | ||
7 | +//const ( | ||
8 | +// TaskStageUncompleted TaskStageState = 1 //里程碑未完成 | ||
9 | +// TaskStageCompleted TaskStageState = 2 //里程碑完成 | ||
10 | +// | ||
11 | +//) | ||
12 | 12 | ||
13 | // 任务阶段 | 13 | // 任务阶段 |
14 | type TaskStage struct { | 14 | type TaskStage struct { |
15 | - Id int `json:"id"` | ||
16 | - TaskId int `json:"taskId"` | ||
17 | - CreatedAt time.Time `json:"createdAt"` | ||
18 | - UpdatedAt time.Time `json:"updatedAt"` | ||
19 | - DeletedAt *time.Time `json:"deletedAt"` | ||
20 | - Name string `json:"name"` //里程碑名称 | ||
21 | - SortBy int `json:"sortBy"` //排序 | ||
22 | - // Status TaskStageState `json:"status"` //里程碑完成情况 | ||
23 | - PlanCompletedAt int64 `json:"planCompletedAt"` //计划完成时间戳,秒 | ||
24 | - RealCompletedAt int64 `json:"realCompletedAt"` //时间完成时间戳,秒 | 15 | + Id int `json:"id"` |
16 | + TaskId int `json:"taskId"` | ||
17 | + CreatedAt time.Time `json:"createdAt"` | ||
18 | + UpdatedAt time.Time `json:"updatedAt"` | ||
19 | + DeletedAt *time.Time `json:"deletedAt"` | ||
20 | + Name string `json:"name"` // 里程碑名称 | ||
21 | + SortBy int `json:"sortBy"` // 排序 | ||
22 | + PlanCompletedAt int64 `json:"planCompletedAt"` // 计划完成时间戳,秒 | ||
23 | + RealCompletedAt int64 `json:"realCompletedAt"` // 实际完成时间戳,秒 | ||
25 | } | 24 | } |
26 | type TaskStageRepository interface { | 25 | type TaskStageRepository interface { |
27 | Save(param []*TaskStage) error | 26 | Save(param []*TaskStage) error |
-
请 注册 或 登录 后发表评论