正在显示
7 个修改的文件
包含
46 行增加
和
24 行删除
@@ -1285,10 +1285,13 @@ func (srv StaffAssessServeice) SaveSelfAssess(in *command.SaveSelfAssessCommand) | @@ -1285,10 +1285,13 @@ func (srv StaffAssessServeice) SaveSelfAssess(in *command.SaveSelfAssessCommand) | ||
1285 | if v, ok := recordMap[it.Id]; ok { | 1285 | if v, ok := recordMap[it.Id]; ok { |
1286 | it.AssistLevel = v.AssistLevel // 更新上级辅导情况 | 1286 | it.AssistLevel = v.AssistLevel // 更新上级辅导情况 |
1287 | it.AssistContent = v.AssistContent // 更新上级辅导内容 | 1287 | it.AssistContent = v.AssistContent // 更新上级辅导内容 |
1288 | + it.RemarkContent = make([]domain.RemarkText, 0) // 更新填写反馈内容 | ||
1288 | 1289 | ||
1289 | var anomalyState = domain.AnomalyState0 | 1290 | var anomalyState = domain.AnomalyState0 |
1290 | key := fmt.Sprintf("%s-%s", v.Category, v.Name) | 1291 | key := fmt.Sprintf("%s-%s", v.Category, v.Name) |
1291 | if item, ok := contentCategoryMap[key]; ok { | 1292 | if item, ok := contentCategoryMap[key]; ok { |
1293 | + it.RemarkContent = append(it.RemarkContent, item.Remark...) | ||
1294 | + | ||
1292 | for _, remark := range item.Remark { | 1295 | for _, remark := range item.Remark { |
1293 | trimSpace := strings.TrimLeft(remark.RemarkText, "\n") // 去掉前换行符 | 1296 | trimSpace := strings.TrimLeft(remark.RemarkText, "\n") // 去掉前换行符 |
1294 | trimSpace = strings.TrimRight(trimSpace, "\n") // 去掉后换行符 | 1297 | trimSpace = strings.TrimRight(trimSpace, "\n") // 去掉后换行符 |
1 | package adapter | 1 | package adapter |
2 | 2 | ||
3 | +import "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/domain" | ||
4 | + | ||
3 | type TaskRecordAdapter struct { | 5 | type TaskRecordAdapter struct { |
4 | Id int `json:"id,string" ` //comment:"记录ID" | 6 | Id int `json:"id,string" ` //comment:"记录ID" |
5 | StaffAssessId int `json:"staffAssessId,string" ` //comment:"每日评估的ID" | 7 | StaffAssessId int `json:"staffAssessId,string" ` //comment:"每日评估的ID" |
@@ -8,7 +10,9 @@ type TaskRecordAdapter struct { | @@ -8,7 +10,9 @@ type TaskRecordAdapter struct { | ||
8 | TaskName string `json:"taskName" ` //comment:"任务名称" | 10 | TaskName string `json:"taskName" ` //comment:"任务名称" |
9 | TaskAlias string `json:"taskAlias" ` //comment:"任务别名" | 11 | TaskAlias string `json:"taskAlias" ` //comment:"任务别名" |
10 | TaskLeader string `json:"taskLeader"` //comment:"任务负责人" | 12 | TaskLeader string `json:"taskLeader"` //comment:"任务负责人" |
11 | - AssistContent string `json:"assistContent" ` //comment:"反馈内容" | 13 | + RemarkContent []domain.RemarkText `json:"remarkContent" ` //comment:"任务填写反馈" |
14 | + AssistLevel int `json:"assistLevel"` //comment:"上级辅导情况" | ||
15 | + AssistContent string `json:"assistContent" ` //comment:"上级辅导内容" | ||
12 | TaskStageCheck TaskStage `json:"taskStageCheck" ` //comment:"提交的里程碑" | 16 | TaskStageCheck TaskStage `json:"taskStageCheck" ` //comment:"提交的里程碑" |
13 | CreatedAt string `json:"createdAt" ` //格式2006-01-02comment:"创建时间" | 17 | CreatedAt string `json:"createdAt" ` //格式2006-01-02comment:"创建时间" |
14 | AnomalyState int `json:"anomalyState"` // | 18 | AnomalyState int `json:"anomalyState"` // |
@@ -801,12 +801,10 @@ func (srv TaskService) ListTaskRecord(param *command.ListTaskRecordCommand) (map | @@ -801,12 +801,10 @@ func (srv TaskService) ListTaskRecord(param *command.ListTaskRecordCommand) (map | ||
801 | defer func() { | 801 | defer func() { |
802 | _ = transactionContext.RollbackTransaction() | 802 | _ = transactionContext.RollbackTransaction() |
803 | }() | 803 | }() |
804 | - taskRecordRepo := factory.CreateTaskRecordRepository(map[string]interface{}{ | ||
805 | - "transactionContext": transactionContext, | ||
806 | - }) | ||
807 | - assessContentRepo := factory.CreateStaffAssessContentRepository(map[string]interface{}{ | ||
808 | - "transactionContext": transactionContext, | ||
809 | - }) | 804 | + taskRecordRepo := factory.CreateTaskRecordRepository(map[string]interface{}{"transactionContext": transactionContext}) |
805 | + //assessContentRepo := factory.CreateStaffAssessContentRepository(map[string]interface{}{ | ||
806 | + // "transactionContext": transactionContext, | ||
807 | + //}) | ||
810 | cnt, taskRecordList, err := taskRecordRepo.Find(map[string]interface{}{ | 808 | cnt, taskRecordList, err := taskRecordRepo.Find(map[string]interface{}{ |
811 | "companyId": param.CompanyId, | 809 | "companyId": param.CompanyId, |
812 | "taskId": param.TaskId, | 810 | "taskId": param.TaskId, |
@@ -814,6 +812,9 @@ func (srv TaskService) ListTaskRecord(param *command.ListTaskRecordCommand) (map | @@ -814,6 +812,9 @@ func (srv TaskService) ListTaskRecord(param *command.ListTaskRecordCommand) (map | ||
814 | if err != nil { | 812 | if err != nil { |
815 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取任务反馈数据"+err.Error()) | 813 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取任务反馈数据"+err.Error()) |
816 | } | 814 | } |
815 | + if err := transactionContext.CommitTransaction(); err != nil { | ||
816 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
817 | + } | ||
817 | 818 | ||
818 | resultList := []adapter.TaskRecordAdapter{} | 819 | resultList := []adapter.TaskRecordAdapter{} |
819 | nowDay := time.Now().Format("2006-01-02") | 820 | nowDay := time.Now().Format("2006-01-02") |
@@ -831,7 +832,9 @@ func (srv TaskService) ListTaskRecord(param *command.ListTaskRecordCommand) (map | @@ -831,7 +832,9 @@ func (srv TaskService) ListTaskRecord(param *command.ListTaskRecordCommand) (map | ||
831 | TaskName: val.TaskName, | 832 | TaskName: val.TaskName, |
832 | TaskAlias: val.TaskAlias, | 833 | TaskAlias: val.TaskAlias, |
833 | TaskLeader: val.TaskLeader.Name, | 834 | TaskLeader: val.TaskLeader.Name, |
834 | - AssistContent: "", | 835 | + RemarkContent: val.RemarkContent, // 填写反馈内容 |
836 | + AssistLevel: val.AssistLevel, // 上级辅助等级 | ||
837 | + AssistContent: val.AssistContent, // 上级辅助内容 | ||
835 | AnomalyState: val.AnomalyState, | 838 | AnomalyState: val.AnomalyState, |
836 | TaskStageCheck: adapter.TaskStage{ | 839 | TaskStageCheck: adapter.TaskStage{ |
837 | Id: val.Id, | 840 | Id: val.Id, |
@@ -852,24 +855,24 @@ func (srv TaskService) ListTaskRecord(param *command.ListTaskRecordCommand) (map | @@ -852,24 +855,24 @@ func (srv TaskService) ListTaskRecord(param *command.ListTaskRecordCommand) (map | ||
852 | t2 := time.Unix(val.TaskStageCheck.RealCompletedAt, 0).Local().Format("2006-01-02") | 855 | t2 := time.Unix(val.TaskStageCheck.RealCompletedAt, 0).Local().Format("2006-01-02") |
853 | item.TaskStageCheck.RealCompletedAt = t2 | 856 | item.TaskStageCheck.RealCompletedAt = t2 |
854 | } | 857 | } |
855 | - _, contentList, err := assessContentRepo.Find(map[string]interface{}{ | ||
856 | - "staffAssessId": val.StaffAssessId, | ||
857 | - "category": val.TaskCategory, | ||
858 | - "name": val.TaskName, | ||
859 | - }) | ||
860 | - if err != nil { | ||
861 | - return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取评估反馈数据"+err.Error()) | ||
862 | - } | ||
863 | - if len(contentList) > 0 { | ||
864 | - for _, val2 := range contentList[0].Remark { | ||
865 | - item.AssistContent += val2.RemarkText + "\n" | ||
866 | - } | ||
867 | - } | 858 | + //_, contentList, err := assessContentRepo.Find(map[string]interface{}{ |
859 | + // "staffAssessId": val.StaffAssessId, | ||
860 | + // "category": val.TaskCategory, | ||
861 | + // "name": val.TaskName, | ||
862 | + //}) | ||
863 | + //if err != nil { | ||
864 | + // return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取评估反馈数据"+err.Error()) | ||
865 | + //} | ||
866 | + //if len(contentList) > 0 { | ||
867 | + // for _, val2 := range contentList[0].Remark { | ||
868 | + // item.AssistContent += val2.RemarkText + "\n" | ||
869 | + // } | ||
870 | + //} | ||
868 | resultList = append(resultList, item) | 871 | resultList = append(resultList, item) |
869 | } | 872 | } |
870 | - if err := transactionContext.CommitTransaction(); err != nil { | ||
871 | - return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
872 | - } | 873 | + //if err := transactionContext.CommitTransaction(); err != nil { |
874 | + // return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
875 | + //} | ||
873 | result := tool_funs.SimpleWrapGridMap(int64(cnt), resultList) | 876 | result := tool_funs.SimpleWrapGridMap(int64(cnt), resultList) |
874 | return result, nil | 877 | return result, nil |
875 | } | 878 | } |
@@ -29,6 +29,7 @@ type TaskRecord struct { | @@ -29,6 +29,7 @@ type TaskRecord struct { | ||
29 | TaskLeader TaskLeader `json:"taskLeader" comment:"任务负责人"` | 29 | TaskLeader TaskLeader `json:"taskLeader" comment:"任务负责人"` |
30 | AssistLevel int `json:"assistLevel" comment:"上级辅导情况"` | 30 | AssistLevel int `json:"assistLevel" comment:"上级辅导情况"` |
31 | AssistContent string `json:"assistContent" comment:"上级辅导内容"` | 31 | AssistContent string `json:"assistContent" comment:"上级辅导内容"` |
32 | + RemarkContent []RemarkText `json:"remarkContent" comment:"填写反馈"` | ||
32 | AnomalyState int `json:"anomalyState" comment:"异常是否反馈状态(-1初始状态、0异常、1正常)"` | 33 | AnomalyState int `json:"anomalyState" comment:"异常是否反馈状态(-1初始状态、0异常、1正常)"` |
33 | TaskStages []TaskStage `json:"taskStages" comment:"里程碑列表"` | 34 | TaskStages []TaskStage `json:"taskStages" comment:"里程碑列表"` |
34 | TaskStageCheck TaskStage `json:"taskStageCheck" comment:"提交的里程碑"` | 35 | TaskStageCheck TaskStage `json:"taskStageCheck" comment:"提交的里程碑"` |
@@ -18,6 +18,7 @@ type TaskRecord struct { | @@ -18,6 +18,7 @@ type TaskRecord struct { | ||
18 | TaskLeader domain.TaskLeader `comment:"任务负责人"` | 18 | TaskLeader domain.TaskLeader `comment:"任务负责人"` |
19 | AssistLevel int `comment:"上级辅导情况" pg:",use_zero"` | 19 | AssistLevel int `comment:"上级辅导情况" pg:",use_zero"` |
20 | AssistContent string `comment:"上级辅导内容"` | 20 | AssistContent string `comment:"上级辅导内容"` |
21 | + RemarkContent []domain.RemarkText `comment:"填写反馈进度"` | ||
21 | AnomalyState int `comment:"异常反馈状态" pg:",use_zero"` | 22 | AnomalyState int `comment:"异常反馈状态" pg:",use_zero"` |
22 | TaskStages []domain.TaskStage `comment:"里程碑列表"` | 23 | TaskStages []domain.TaskStage `comment:"里程碑列表"` |
23 | TaskStageCheck domain.TaskStage `comment:"提交的里程碑"` | 24 | TaskStageCheck domain.TaskStage `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 | + RemarkContent: m.RemarkContent, | ||
35 | AnomalyState: m.AnomalyState, | 36 | AnomalyState: m.AnomalyState, |
36 | TaskStages: m.TaskStages, | 37 | TaskStages: m.TaskStages, |
37 | TaskStageCheck: m.TaskStageCheck, | 38 | TaskStageCheck: m.TaskStageCheck, |
@@ -53,6 +54,7 @@ func (repo *TaskRecordRepository) TransformToModel(d *domain.TaskRecord) models. | @@ -53,6 +54,7 @@ func (repo *TaskRecordRepository) TransformToModel(d *domain.TaskRecord) models. | ||
53 | TaskLeader: d.TaskLeader, | 54 | TaskLeader: d.TaskLeader, |
54 | AssistLevel: d.AssistLevel, | 55 | AssistLevel: d.AssistLevel, |
55 | AssistContent: d.AssistContent, | 56 | AssistContent: d.AssistContent, |
57 | + RemarkContent: d.RemarkContent, | ||
56 | AnomalyState: d.AnomalyState, | 58 | AnomalyState: d.AnomalyState, |
57 | TaskStages: d.TaskStages, | 59 | TaskStages: d.TaskStages, |
58 | TaskStageCheck: d.TaskStageCheck, | 60 | TaskStageCheck: d.TaskStageCheck, |
-
请 注册 或 登录 后发表评论