正在显示
3 个修改的文件
包含
23 行增加
和
6 行删除
@@ -242,11 +242,23 @@ func (srv StaffAssessServeice) CreateStaffAssessTask(transactionContext applicat | @@ -242,11 +242,23 @@ func (srv StaffAssessServeice) CreateStaffAssessTask(transactionContext applicat | ||
242 | assassessTaskList[0].ExecutorId = executorIds | 242 | assassessTaskList[0].ExecutorId = executorIds |
243 | //更新步骤 | 243 | //更新步骤 |
244 | assassessTaskList[0].StepList = append(assassessTaskList[0].StepList, assessTaskData.StepList...) | 244 | assassessTaskList[0].StepList = append(assassessTaskList[0].StepList, assessTaskData.StepList...) |
245 | + for _, val := range assessTaskData.StepList { | ||
246 | + hasFound := false | ||
247 | + for _, val2 := range assassessTaskList[0].StepList { | ||
248 | + if val.LinkNodeType == val2.LinkNodeType { | ||
249 | + hasFound = true | ||
250 | + break | ||
251 | + } | ||
252 | + } | ||
253 | + if !hasFound { | ||
254 | + assassessTaskList[0].StepList = append(assassessTaskList[0].StepList, val) | ||
255 | + } | ||
256 | + } | ||
245 | assessTaskData = assassessTaskList[0] | 257 | assessTaskData = assassessTaskList[0] |
246 | //排序流程环节 | 258 | //排序流程环节 |
247 | - stepList := domain.SortTaskStep(assessTaskData.StepList) | ||
248 | - sort.Sort(stepList) | ||
249 | } | 259 | } |
260 | + stepList := domain.SortTaskStep(assessTaskData.StepList) | ||
261 | + sort.Sort(stepList) | ||
250 | _, err = assessTaskRepo.Save(assessTaskData) | 262 | _, err = assessTaskRepo.Save(assessTaskData) |
251 | if err != nil { | 263 | if err != nil { |
252 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "保存评估任务"+err.Error()) | 264 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "保存评估任务"+err.Error()) |
@@ -2,6 +2,7 @@ package service | @@ -2,6 +2,7 @@ package service | ||
2 | 2 | ||
3 | import ( | 3 | import ( |
4 | "fmt" | 4 | "fmt" |
5 | + "sort" | ||
5 | "strconv" | 6 | "strconv" |
6 | 7 | ||
7 | "github.com/linmadan/egglib-go/core/application" | 8 | "github.com/linmadan/egglib-go/core/application" |
@@ -223,6 +224,10 @@ func (srv StaffAssessServeice) AssessTaskDescV2(param *query.AssessTaskDescV2Que | @@ -223,6 +224,10 @@ func (srv StaffAssessServeice) AssessTaskDescV2(param *query.AssessTaskDescV2Que | ||
223 | } | 224 | } |
224 | result.StepList = append(result.StepList, stepItem) | 225 | result.StepList = append(result.StepList, stepItem) |
225 | } | 226 | } |
227 | + //排序评估阶段 | ||
228 | + sort.Slice(result.StepList, func(i, j int) bool { | ||
229 | + return result.StepList[i].SortBy < result.StepList[j].SortBy | ||
230 | + }) | ||
226 | if err := transactionContext.CommitTransaction(); err != nil { | 231 | if err := transactionContext.CommitTransaction(); err != nil { |
227 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | 232 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) |
228 | } | 233 | } |
@@ -149,10 +149,10 @@ func (srv *SummaryEvaluationService) ExportAllEvaluationFinish(param *command.Qu | @@ -149,10 +149,10 @@ func (srv *SummaryEvaluationService) ExportAllEvaluationFinish(param *command.Qu | ||
149 | tableHead = append(tableHead, ratingHeader...) | 149 | tableHead = append(tableHead, ratingHeader...) |
150 | if len(evaluationList) > 0 { | 150 | if len(evaluationList) > 0 { |
151 | xlsxFile.SetSheetRow(firstSheetName, "A1", &[]string{evaluationList[0].CycleName + "最终成绩"}) | 151 | xlsxFile.SetSheetRow(firstSheetName, "A1", &[]string{evaluationList[0].CycleName + "最终成绩"}) |
152 | - // if len(tableHead) > 1 { | ||
153 | - // cellCode, _ := excelize.ColumnNumberToName(len(tableHead)) | ||
154 | - // xlsxFile.MergeCell(firstSheetName, "A1", cellCode+"1") | ||
155 | - // } | 152 | + if len(tableHead) > 1 { |
153 | + cellCode, _ := excelize.ColumnNumberToName(len(tableHead)) | ||
154 | + xlsxFile.MergeCell(firstSheetName, "A1", cellCode+"1") | ||
155 | + } | ||
156 | } | 156 | } |
157 | xlsxFile.SetSheetRow(firstSheetName, "A2", &tableHead) | 157 | xlsxFile.SetSheetRow(firstSheetName, "A2", &tableHead) |
158 | firstDataRow := 3 | 158 | firstDataRow := 3 |
-
请 注册 或 登录 后发表评论