|
@@ -167,7 +167,14 @@ public class TPMatrixServiceImpl extends ServiceImpl<TPMatrixMapper, TPMatrix> i
|
|
|
for (TPMatrix tpMatrix : entry.getValue()) {
|
|
|
requirementMap.add(tpMatrix.getRequirementId(), tpMatrix);
|
|
|
}
|
|
|
- requirementMap.entrySet().stream().forEach(requirementEntry -> requirementEntry.getValue().stream().forEach(tpMatrix -> content.add(tpMatrix.getContent() == null ? "" : String.valueOf(tpMatrix.getContent()))));
|
|
|
+ for (Map.Entry<Long, List<TPMatrix>> requirementEntry : requirementMap.entrySet()) {
|
|
|
+ List<TPMatrix> requirementList = requirementEntry.getValue();
|
|
|
+ // 排序,解决字符串1和10排序问题
|
|
|
+ if (requirementList.size() > 1) {
|
|
|
+ requirementList.sort(Comparator.comparingInt(o -> Integer.parseInt(o.getSubName())));
|
|
|
+ }
|
|
|
+ requirementList.stream().forEach(tpMatrix -> content.add(tpMatrix.getContent() == null ? "" : String.valueOf(tpMatrix.getContent())));
|
|
|
+ }
|
|
|
contentList.add(content);
|
|
|
});
|
|
|
|
|
@@ -178,7 +185,7 @@ public class TPMatrixServiceImpl extends ServiceImpl<TPMatrixMapper, TPMatrix> i
|
|
|
|
|
|
private void exportExcel(HttpServletResponse response, List<ProfessionalExportHead> professionalExportHeadList, List<List<String>> contentList, String professionalName) {
|
|
|
XSSFWorkbook wb = new XSSFWorkbook();
|
|
|
- XSSFSheet sheet = wb.createSheet(professionalName);
|
|
|
+ XSSFSheet sheet = wb.createSheet("sheet1");
|
|
|
|
|
|
// 表对样式
|
|
|
XSSFCellStyle styleHead = wb.createCellStyle(); // 样式对象
|