...
|
...
|
@@ -127,26 +127,26 @@ func (srv *SummaryEvaluationService) ExportAllEvaluationFinish(param *command.Qu |
|
|
if err := transactionContext.CommitTransaction(); err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
ratingHeader := []string{} //动态列,评级内容
|
|
|
ratingMap := map[string]struct{}{} //过滤重复code
|
|
|
evaluationRatingMap := map[int]map[string]int{}
|
|
|
for _, v := range evaluationList {
|
|
|
evaluationRatingMap[v.Id] = map[string]int{}
|
|
|
for _, v2 := range v.TotalRating {
|
|
|
if _, ok := ratingMap[v2.Code]; !ok {
|
|
|
ratingMap[v2.Code] = struct{}{}
|
|
|
ratingHeader = append(ratingHeader, v2.Code)
|
|
|
}
|
|
|
evaluationRatingMap[v.Id][v2.Code] = v2.Number
|
|
|
}
|
|
|
}
|
|
|
// ratingHeader := []string{} //动态列,评级内容
|
|
|
// ratingMap := map[string]struct{}{} //过滤重复code
|
|
|
// evaluationRatingMap := map[int]map[string]int{}
|
|
|
// for _, v := range evaluationList {
|
|
|
// evaluationRatingMap[v.Id] = map[string]int{}
|
|
|
// for _, v2 := range v.TotalRating {
|
|
|
// if _, ok := ratingMap[v2.Code]; !ok {
|
|
|
// ratingMap[v2.Code] = struct{}{}
|
|
|
// ratingHeader = append(ratingHeader, v2.Code)
|
|
|
// }
|
|
|
// evaluationRatingMap[v.Id][v2.Code] = v2.Number
|
|
|
// }
|
|
|
// }
|
|
|
|
|
|
xlsxFile := excelize.NewFile()
|
|
|
//设置默认的第一个sheet
|
|
|
sheetIndex := xlsxFile.GetActiveSheetIndex()
|
|
|
firstSheetName := xlsxFile.GetSheetName(sheetIndex)
|
|
|
tableHead := []string{"姓名", "部门", "职位", "最终绩效得分"}
|
|
|
tableHead = append(tableHead, ratingHeader...)
|
|
|
// tableHead = append(tableHead, ratingHeader...)
|
|
|
// 最后一列
|
|
|
tableHead = append(tableHead, "备注")
|
|
|
if len(evaluationList) > 0 {
|
...
|
...
|
@@ -179,13 +179,13 @@ func (srv *SummaryEvaluationService) ExportAllEvaluationFinish(param *command.Qu |
|
|
positinName,
|
|
|
v.TotalScore,
|
|
|
}
|
|
|
for _, v2 := range ratingHeader {
|
|
|
if num, ok := evaluationRatingMap[v.Id][v2]; ok {
|
|
|
dataRow = append(dataRow, fmt.Sprintf("%d", num))
|
|
|
} else {
|
|
|
dataRow = append(dataRow, "0")
|
|
|
}
|
|
|
}
|
|
|
// for _, v2 := range ratingHeader {
|
|
|
// if num, ok := evaluationRatingMap[v.Id][v2]; ok {
|
|
|
// dataRow = append(dataRow, fmt.Sprintf("%d", num))
|
|
|
// } else {
|
|
|
// dataRow = append(dataRow, "0")
|
|
|
// }
|
|
|
// }
|
|
|
if v.CheckResult == domain.EvaluationCheckCompleted {
|
|
|
dataRow = append(dataRow, "已确认")
|
|
|
} else {
|
...
|
...
|
|