yurk před 2 roky
rodič
revize
d55dc1bd0c

+ 3 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java

@@ -4937,8 +4937,10 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
             sheetTwoList.add(item);
         }
         String fileName = "任务分组工时统计_"+System.currentTimeMillis();
+        String sheetOneName="任务分组工时统计";
+        String sheetTwoName="项目任务分组工时统计";
         /*ExcelUtil.exportGeneralExcelByTitleAndList(fileName, sheetOneList, path);*/
-        ExcelUtil.exportTwoSheetGeneralExcelByTitleAndList(fileName,sheetOneList,sheetTwoList,path);
+        ExcelUtil.exportTwoSheetGeneralExcelByTitleAndList(fileName,sheetOneList,sheetTwoList,path,sheetOneName,sheetTwoName);
         httpRespMsg.data =  pathPrefix + fileName+".xls";
         return httpRespMsg;
     }

+ 3 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/util/ExcelUtil.java

@@ -150,7 +150,7 @@ public class ExcelUtil {
 //        return "";
     }
 
-    public static String exportTwoSheetGeneralExcelByTitleAndList(String title, List<List<String>> sheetOneList,List<List<String>> sheetTwoList, String downloadPath) {
+    public static String exportTwoSheetGeneralExcelByTitleAndList(String title, List<List<String>> sheetOneList,List<List<String>> sheetTwoList, String downloadPath,String sheetOneName,String sheetTwoName) {
         String result="系统提示:Excel文件导出成功!";
         String fileName= title+".xls";
         try {
@@ -165,7 +165,9 @@ public class ExcelUtil {
             HSSFWorkbook workBook = new HSSFWorkbook();
             // 创建工作类
             HSSFSheet sheetOne = workBook.createSheet();
+            workBook.setSheetName(0,sheetOneName);
             HSSFSheet sheetTwo = workBook.createSheet();
+            workBook.setSheetName(1,sheetTwoName);
             sheetOne.setDefaultColumnWidth(16);
             sheetTwo.setDefaultColumnWidth(16);
             //设置字体样式