作者 tangxvhui

调整 excel 表头

... ... @@ -147,7 +147,15 @@ func (srv *SummaryEvaluationService) ExportAllEvaluationFinish(param *command.Qu
firstSheetName := xlsxFile.GetSheetName(sheetIndex)
tableHead := []string{"姓名", "部门", "职位", "最终绩效得分"}
tableHead = append(tableHead, ratingHeader...)
xlsxFile.SetSheetRow(firstSheetName, "A1", &tableHead)
if len(evaluationList) > 0 {
xlsxFile.SetSheetRow(firstSheetName, "A1", []string{evaluationList[0].CycleName + "最终成绩"})
// if len(tableHead) > 1 {
// cellCode, _ := excelize.ColumnNumberToName(len(tableHead))
// xlsxFile.MergeCell(firstSheetName, "A1", cellCode+"1")
// }
}
xlsxFile.SetSheetRow(firstSheetName, "A2", &tableHead)
firstDataRow := 3
for i, v := range evaluationList {
departmentName := ""
for _, dep := range v.TargetDepartment {
... ... @@ -176,7 +184,7 @@ func (srv *SummaryEvaluationService) ExportAllEvaluationFinish(param *command.Qu
dataRaw = append(dataRaw, "0")
}
}
xlsxFile.SetSheetRow(firstSheetName, fmt.Sprintf("A%d", i+2), &dataRaw)
xlsxFile.SetSheetRow(firstSheetName, fmt.Sprintf("A%d", i+firstDataRow), &dataRaw)
}
return xlsxFile, nil
}
... ...