Przeglądaj źródła

多文件导入修改

wangqiang 1 rok temu
rodzic
commit
89261feee5
27 zmienionych plików z 667 dodań i 267 usunięć
  1. 20 15
      pom.xml
  2. 26 23
      src/main/java/com/jeeplus/common/utils/excel/ExportExcel.java
  3. 3 1
      src/main/java/com/jeeplus/modules/cg/infrastructure/util/InfrastructureExcelExportUtil.java
  4. 3 1
      src/main/java/com/jeeplus/modules/cg/reservemanagementcenter/distribution/util/DistributionExportUtil.java
  5. 3 1
      src/main/java/com/jeeplus/modules/cg/reservemanagementcenter/policyProcess/util/PolicyProcessExportUtil.java
  6. 131 65
      src/main/java/com/jeeplus/modules/cg/reservemanagementcenter/reserveManage/service/ReserveSummaryProcessService.java
  7. 11 12
      src/main/java/com/jeeplus/modules/cg/reservemanagementcenter/reserveManage/utils/ReserveProcessProjectExportUtil.java
  8. 2 1
      src/main/java/com/jeeplus/modules/cg/reservemanagementcenter/statisticalTable/util/ExcelExportUtil.java
  9. 4 4
      src/main/java/com/jeeplus/modules/sg/balancedlibrary/materialReportDetails/utils/ExportUtil.java
  10. 17 17
      src/main/java/com/jeeplus/modules/sg/balancedlibrary/transitMaterialGoods/util/CreateSheetUtil.java
  11. 15 17
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/util/ExportUtil.java
  12. 14 14
      src/main/java/com/jeeplus/modules/sg/financial/settlement/service/DataMaintenanceService.java
  13. 14 14
      src/main/java/com/jeeplus/modules/sg/financial/settlement/service/ProjectBudgetService.java
  14. 19 19
      src/main/java/com/jeeplus/modules/sg/financial/settlement/util/ExcelWriter.java
  15. 3 5
      src/main/java/com/jeeplus/modules/sg/financial/settlement/util/MyExportUtil.java
  16. 2 1
      src/main/java/com/jeeplus/modules/sg/managementcenter/project/util/ExportUtil.java
  17. 2 1
      src/main/java/com/jeeplus/modules/sg/managementcenter/reserveManagement/utils/ReserveExportUtil.java
  18. 15 17
      src/main/java/com/jeeplus/modules/sg/raiseCapital/utils/RaiseExportUtil.java
  19. 31 33
      src/main/java/com/jeeplus/modules/sg/raiseCapitalDesign/utils/RaiseCapitalDesignExportUtil.java
  20. 2 1
      src/main/java/com/jeeplus/modules/sg/scheduleView/util/ExportUtil.java
  21. 55 0
      src/main/java/com/jeeplus/modules/sys/listener/CableFourListener.java
  22. 54 0
      src/main/java/com/jeeplus/modules/sys/listener/CableSevenListener.java
  23. 54 0
      src/main/java/com/jeeplus/modules/sys/listener/CableThreeListener.java
  24. 54 0
      src/main/java/com/jeeplus/modules/sys/listener/CableTwoListener.java
  25. 40 0
      src/main/java/com/jeeplus/modules/sys/listener/ExcelDataListener.java
  26. 65 0
      src/main/java/com/jeeplus/modules/sys/listener/ExcelMaterialInfoListener.java
  27. 8 5
      src/main/webapp/webpage/modules/cg/reservemanagementcenter/reserveManage/summaryStatistics/designUnit.jsp

+ 20 - 15
pom.xml

@@ -180,6 +180,11 @@
     </build>
     <!-- 依赖项定义 -->
     <dependencies>
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>easyexcel</artifactId>
+            <version>2.2.6</version>
+        </dependency>
         <!-- SPRING begin -->
         <dependency>
             <groupId>org.springframework</groupId>
@@ -653,21 +658,21 @@
         </dependency>
 
         <!-- poi office -->
-        <dependency>
-            <groupId>org.apache.poi</groupId>
-            <artifactId>poi</artifactId>
-            <version>${poi.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.poi</groupId>
-            <artifactId>poi-ooxml</artifactId>
-            <version>${poi.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.poi</groupId>
-            <artifactId>poi-ooxml-schemas</artifactId>
-            <version>${poi.version}</version>
-        </dependency>
+<!--        <dependency>-->
+<!--            <groupId>org.apache.poi</groupId>-->
+<!--            <artifactId>poi</artifactId>-->
+<!--            <version>${poi.version}</version>-->
+<!--        </dependency>-->
+<!--        <dependency>-->
+<!--            <groupId>org.apache.poi</groupId>-->
+<!--            <artifactId>poi-ooxml</artifactId>-->
+<!--            <version>${poi.version}</version>-->
+<!--        </dependency>-->
+<!--        <dependency>-->
+<!--            <groupId>org.apache.poi</groupId>-->
+<!--            <artifactId>poi-ooxml-schemas</artifactId>-->
+<!--            <version>${poi.version}</version>-->
+<!--        </dependency>-->
 
         <!-- image util -->
         <dependency>

+ 26 - 23
src/main/java/com/jeeplus/common/utils/excel/ExportExcel.java

@@ -19,15 +19,7 @@ import java.util.Map;
 import javax.servlet.http.HttpServletResponse;
 
 import org.apache.commons.lang3.StringUtils;
-import org.apache.poi.ss.usermodel.Cell;
-import org.apache.poi.ss.usermodel.CellStyle;
-import org.apache.poi.ss.usermodel.Comment;
-import org.apache.poi.ss.usermodel.DataFormat;
-import org.apache.poi.ss.usermodel.Font;
-import org.apache.poi.ss.usermodel.IndexedColors;
-import org.apache.poi.ss.usermodel.Row;
-import org.apache.poi.ss.usermodel.Sheet;
-import org.apache.poi.ss.usermodel.Workbook;
+import org.apache.poi.ss.usermodel.*;
 import org.apache.poi.ss.util.CellRangeAddress;
 import org.apache.poi.xssf.streaming.SXSSFWorkbook;
 import org.apache.poi.xssf.usermodel.XSSFClientAnchor;
@@ -237,24 +229,29 @@ public class ExportExcel {
 		Map<String, CellStyle> styles = new HashMap<String, CellStyle>();
 		
 		CellStyle style = wb.createCellStyle();
-		style.setAlignment(CellStyle.ALIGN_CENTER);
-		style.setVerticalAlignment(CellStyle.VERTICAL_CENTER);
+//		style.setAlignment(CellStyle.ALIGN_CENTER);
+		style.setAlignment(HorizontalAlignment.CENTER);
+//		style.setVerticalAlignment(CellStyle.VERTICAL_CENTER);
+		style.setVerticalAlignment(VerticalAlignment.CENTER);
 		Font titleFont = wb.createFont();
 		titleFont.setFontName("Arial");
 		titleFont.setFontHeightInPoints((short) 16);
-		titleFont.setBoldweight(Font.BOLDWEIGHT_BOLD);
+//		titleFont.setBoldweight(Font.BOLDWEIGHT_BOLD);
+		titleFont.setBold(true);
 		style.setFont(titleFont);
 		styles.put("title", style);
 
 		style = wb.createCellStyle();
-		style.setVerticalAlignment(CellStyle.VERTICAL_CENTER);
-		style.setBorderRight(CellStyle.BORDER_THIN);
+//		style.setVerticalAlignment(CellStyle.VERTICAL_CENTER);
+		style.setVerticalAlignment(VerticalAlignment.CENTER);
+//		style.setBorderRight(CellStyle.BORDER_THIN);
+		style.setBorderRight(BorderStyle.THIN);
 		style.setRightBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
-		style.setBorderLeft(CellStyle.BORDER_THIN);
+		style.setBorderLeft(BorderStyle.THIN);
 		style.setLeftBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
-		style.setBorderTop(CellStyle.BORDER_THIN);
+		style.setBorderTop(BorderStyle.THIN);
 		style.setTopBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
-		style.setBorderBottom(CellStyle.BORDER_THIN);
+		style.setBorderBottom(BorderStyle.THIN);
 		style.setBottomBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
 		Font dataFont = wb.createFont();
 		dataFont.setFontName("Arial");
@@ -264,29 +261,35 @@ public class ExportExcel {
 		
 		style = wb.createCellStyle();
 		style.cloneStyleFrom(styles.get("data"));
-		style.setAlignment(CellStyle.ALIGN_LEFT);
+//		style.setAlignment(CellStyle.ALIGN_LEFT);
+		style.setAlignment(HorizontalAlignment.LEFT);
 		styles.put("data1", style);
 
 		style = wb.createCellStyle();
 		style.cloneStyleFrom(styles.get("data"));
-		style.setAlignment(CellStyle.ALIGN_CENTER);
+//		style.setAlignment(CellStyle.ALIGN_CENTER);
+		style.setAlignment(HorizontalAlignment.CENTER);
 		styles.put("data2", style);
 
 		style = wb.createCellStyle();
 		style.cloneStyleFrom(styles.get("data"));
-		style.setAlignment(CellStyle.ALIGN_RIGHT);
+//		style.setAlignment(CellStyle.ALIGN_RIGHT);
+		style.setAlignment(HorizontalAlignment.RIGHT);
 		styles.put("data3", style);
 		
 		style = wb.createCellStyle();
 		style.cloneStyleFrom(styles.get("data"));
 //		style.setWrapText(true);
-		style.setAlignment(CellStyle.ALIGN_CENTER);
+//		style.setAlignment(CellStyle.ALIGN_CENTER);
+		style.setAlignment(HorizontalAlignment.CENTER);
 		style.setFillForegroundColor(IndexedColors.GREY_50_PERCENT.getIndex());
-		style.setFillPattern(CellStyle.SOLID_FOREGROUND);
+//		style.setFillPattern(CellStyle.SOLID_FOREGROUND);
+		style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
 		Font headerFont = wb.createFont();
 		headerFont.setFontName("Arial");
 		headerFont.setFontHeightInPoints((short) 10);
-		headerFont.setBoldweight(Font.BOLDWEIGHT_BOLD);
+//		headerFont.setBoldweight(Font.BOLDWEIGHT_BOLD);
+		headerFont.setBold(true);
 		headerFont.setColor(IndexedColors.WHITE.getIndex());
 		style.setFont(headerFont);
 		styles.put("header", style);

+ 3 - 1
src/main/java/com/jeeplus/modules/cg/infrastructure/util/InfrastructureExcelExportUtil.java

@@ -5,6 +5,7 @@ import com.jeeplus.modules.cg.infrastructure.entity.InfrastructureBasicInfo;
 import org.apache.poi.ss.usermodel.Cell;
 import org.apache.poi.ss.usermodel.Row;
 import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.VerticalAlignment;
 import org.apache.poi.xssf.usermodel.XSSFCellStyle;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 
@@ -148,7 +149,8 @@ public class InfrastructureExcelExportUtil {
         if(style == null){
             style =workbook.createCellStyle();
             style.setWrapText(true);
-            style.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER);
+//            style.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER);
+            style.setVerticalAlignment(VerticalAlignment.CENTER);
         }
         cell.setCellStyle(style);
         return cell;

+ 3 - 1
src/main/java/com/jeeplus/modules/cg/reservemanagementcenter/distribution/util/DistributionExportUtil.java

@@ -6,6 +6,7 @@ import org.apache.commons.lang3.StringUtils;
 import org.apache.poi.ss.usermodel.Cell;
 import org.apache.poi.ss.usermodel.Row;
 import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.VerticalAlignment;
 import org.apache.poi.xssf.usermodel.XSSFCellStyle;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 
@@ -328,7 +329,8 @@ public class DistributionExportUtil {
         if(style == null){
             style =workbook.createCellStyle();
             style.setWrapText(true);
-            style.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER);
+//            style.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER);
+            style.setVerticalAlignment(VerticalAlignment.CENTER);
         }
         cell.setCellStyle(style);
         return cell;

+ 3 - 1
src/main/java/com/jeeplus/modules/cg/reservemanagementcenter/policyProcess/util/PolicyProcessExportUtil.java

@@ -8,6 +8,7 @@ import org.apache.commons.lang3.StringUtils;
 import org.apache.poi.ss.usermodel.Cell;
 import org.apache.poi.ss.usermodel.Row;
 import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.VerticalAlignment;
 import org.apache.poi.xssf.usermodel.XSSFCellStyle;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 
@@ -509,7 +510,8 @@ public class PolicyProcessExportUtil {
         if(style == null){
             style =workbook.createCellStyle();
             style.setWrapText(true);
-            style.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER);
+//            style.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER);
+            style.setVerticalAlignment(VerticalAlignment.CENTER);
         }
         cell.setCellStyle(style);
         return cell;

+ 131 - 65
src/main/java/com/jeeplus/modules/cg/reservemanagementcenter/reserveManage/service/ReserveSummaryProcessService.java

@@ -1,5 +1,8 @@
 package com.jeeplus.modules.cg.reservemanagementcenter.reserveManage.service;
 
+import com.alibaba.excel.EasyExcel;
+import com.alibaba.excel.read.builder.ExcelReaderBuilder;
+import com.alibaba.excel.read.builder.ExcelReaderSheetBuilder;
 import com.google.common.collect.Maps;
 import com.jeeplus.common.utils.DateUtils;
 import com.jeeplus.common.utils.StringUtils;
@@ -18,6 +21,7 @@ import com.jeeplus.modules.sg.managementcenter.materialinfo.util.MaterialInfoUti
 import com.jeeplus.modules.sg.raiseCapitalDesign.entity.CableSectionData;
 import com.jeeplus.modules.sg.raiseCapitalDesign.entity.CableSectionInfo;
 import com.jeeplus.modules.sg.raiseCapitalDesign.service.RaiseCapitalDesignService;
+import com.jeeplus.modules.sys.listener.*;
 import org.activiti.engine.TaskService;
 import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
 import org.apache.poi.ss.usermodel.Row;
@@ -146,25 +150,54 @@ public class ReserveSummaryProcessService extends CrudService<ReserveSummaryProc
      */
     @Transactional(readOnly = false)
     public void saveData(MultipartFile file,String projectReserveId,String proName) throws IOException, InvalidFormatException {
-        ImportExcel module = new ImportExcel(file,1,"模块表");
-        Row row = module.getRow(0);
-        Object obj = module.getCellValue(row, 1);
-        if(obj==null){
-            throw new RuntimeException("找不到项目名称!");
-        }
-
-        String projectName = ((String) obj).trim();
+//        ImportExcel module = new ImportExcel(file,1,"模块表");
+//        Row row = module.getRow(0);
+//        Object obj = module.getCellValue(row, 1);
+//        if(obj==null){
+//            throw new RuntimeException("找不到项目名称!");
+//        }
+
+        // 获取上传的MultipartFile文件
+        MultipartFile excelFile = file;
+        //使用EasyExcel创建ExcelReaderBuilder
+        ExcelReaderBuilder excelReaderBuilder = EasyExcel.read(excelFile.getInputStream());
+        excelReaderBuilder.headRowNumber(0); // 指定标题行的索引为0
+        // 获取第一个工作表(通常索引为0)的ExcelReaderSheetBuilder
+        ExcelReaderSheetBuilder sheetBuilder = excelReaderBuilder.sheet("模块表");
+        // 设置自定义的读取监听器,用于处理Excel数据
+        ExcelDataListener listener = new ExcelDataListener();
+        sheetBuilder.registerReadListener(listener);
+
+        // 启动读取操作
+        sheetBuilder.doRead();
+        // 读取到的项目名称
+        String projectName = listener.getProjectName();
         if (!proName.equals(projectName)){
             throw new RuntimeException("上传文件的项目名称与改流程的项目名称不匹配!");
         }
+
         //删除对应项目名称的甲供材信息
         mapper.deleteMaterial(projectName);
         //清空redis中的在线开甲供材信息
         Jedis jedis = ReserveRedisUtils.getJedis();
         jedis.del(projectReserveId);
 
-        ImportExcel pick = new ImportExcel(file,7,"领料清单");
-        List<MaterialInfo> materialInfos = MaterialInfoUtil.getCbData(pick,projectName);   //获取领料清单数据
+        // 获取领料清单工作表
+        ExcelReaderBuilder materialReaderBuilder = EasyExcel.read(excelFile.getInputStream());
+        ExcelReaderSheetBuilder materialBuilder = materialReaderBuilder.sheet("领料清单");
+        ExcelMaterialInfoListener infoListener = new ExcelMaterialInfoListener();
+        materialBuilder.registerReadListener(infoListener);
+        // 启动读取操作
+        materialBuilder.doRead();
+        // 获取从第7行开始的B到J列的值
+        List<MaterialInfo> materialInfos = infoListener.getData();
+        materialInfos.forEach(ma->{
+            ma.setProjectName(projectName);
+        });
+
+
+//        ImportExcel pick = new ImportExcel(file,7,"领料清单");
+//        List<MaterialInfo> materialInfos = MaterialInfoUtil.getCbData(pick,projectName);   //获取领料清单数据
         List<MaterialInfo> materialInfoList = new ArrayList<>();
         for (MaterialInfo materialInfo : materialInfos) {
             if (materialInfo.getTotalCount()>0){
@@ -176,62 +209,95 @@ public class ReserveSummaryProcessService extends CrudService<ReserveSummaryProc
         saveList(list);
         //获取电缆分段表的数据,将数据存入到redis中
 //        ImportUtil importUtil = new ImportUtil(file, 0, 5);
-        ImportExcel importUtil = new ImportExcel(file,3,"电缆分段表");
-        int lastRow = importUtil.getLastDataRowNum();
-        //获取指定的列数据  YJV22-3×400mm²单元格下的行数据
-        List<CableSectionInfo> cableFourHundredList = new ArrayList<>();
-        List<CableSectionInfo> cableThreeHundredList = new ArrayList<>();   //YJV22-3×300mm²
-        List<CableSectionInfo> cableTwoHundredFortyList = new ArrayList<>();    //YJV22-3×240mm²
-        List<CableSectionInfo> cableSeventyList = new ArrayList<>();       //YJV22-3×70mm²
-        for (int i=2;i<=lastRow;i++){
-            Row infoRow = importUtil.getRow(i);
-            CableSectionInfo hundredInfo = new CableSectionInfo();
-            if (StringUtils.isNotBlank(importUtil.getCellValue(infoRow,0).toString()) && !importUtil.getCellValue(infoRow,0).toString().equals("总长(km):")){
-                hundredInfo.setDestination(importUtil.getCellValue(infoRow,0).toString());
-                hundredInfo.setPathLength(importUtil.getCellValue(infoRow,1).toString());
-                hundredInfo.setUpperRod(importUtil.getCellValue(infoRow,2).toString());
-                hundredInfo.setArrival(importUtil.getCellValue(infoRow,3).toString());
-                hundredInfo.setIncomingEquipment(importUtil.getCellValue(infoRow,4).toString());
-                hundredInfo.setCoefficient(importUtil.getCellValue(infoRow,5).toString());
-                hundredInfo.setElectricalChief(importUtil.getCellValue(infoRow,6).toString());
-                cableFourHundredList.add(hundredInfo);
-            }
 
-            if (StringUtils.isNotBlank(importUtil.getCellValue(infoRow,8).toString())&& !importUtil.getCellValue(infoRow,0).toString().equals("总长(km):")){
-                CableSectionInfo hundredAndTwenty = new CableSectionInfo();
-                hundredAndTwenty.setDestination(importUtil.getCellValue(infoRow,8).toString());
-                hundredAndTwenty.setPathLength(importUtil.getCellValue(infoRow,9).toString());
-                hundredAndTwenty.setUpperRod(importUtil.getCellValue(infoRow,10).toString());
-                hundredAndTwenty.setArrival(importUtil.getCellValue(infoRow,11).toString());
-                hundredAndTwenty.setIncomingEquipment(importUtil.getCellValue(infoRow,12).toString());
-                hundredAndTwenty.setCoefficient(importUtil.getCellValue(infoRow,13).toString());
-                hundredAndTwenty.setElectricalChief(importUtil.getCellValue(infoRow,14).toString());
-                cableThreeHundredList.add(hundredAndTwenty);
-            }
-
-            if (StringUtils.isNotBlank(importUtil.getCellValue(infoRow,16).toString())&& !importUtil.getCellValue(infoRow,0).toString().equals("总长(km):")){
-                CableSectionInfo hundredAndTwenty = new CableSectionInfo();
-                hundredAndTwenty.setDestination(importUtil.getCellValue(infoRow,16).toString());
-                hundredAndTwenty.setPathLength(importUtil.getCellValue(infoRow,17).toString());
-                hundredAndTwenty.setUpperRod(importUtil.getCellValue(infoRow,18).toString());
-                hundredAndTwenty.setArrival(importUtil.getCellValue(infoRow,19).toString());
-                hundredAndTwenty.setIncomingEquipment(importUtil.getCellValue(infoRow,20).toString());
-                hundredAndTwenty.setCoefficient(importUtil.getCellValue(infoRow,21).toString());
-                hundredAndTwenty.setElectricalChief(importUtil.getCellValue(infoRow,22).toString());
-                cableTwoHundredFortyList.add(hundredAndTwenty);
-            }
-            if (StringUtils.isNotBlank(importUtil.getCellValue(infoRow,24).toString())&& !importUtil.getCellValue(infoRow,0).toString().equals("总长(km):")){
-                CableSectionInfo hundredAndTwenty = new CableSectionInfo();
-                hundredAndTwenty.setDestination(importUtil.getCellValue(infoRow,24).toString());
-                hundredAndTwenty.setPathLength(importUtil.getCellValue(infoRow,25).toString());
-                hundredAndTwenty.setUpperRod(importUtil.getCellValue(infoRow,26).toString());
-                hundredAndTwenty.setArrival(importUtil.getCellValue(infoRow,27).toString());
-                hundredAndTwenty.setIncomingEquipment( importUtil.getCellValue(infoRow,28).toString());
-                hundredAndTwenty.setCoefficient(importUtil.getCellValue(infoRow,29).toString());
-                hundredAndTwenty.setElectricalChief(importUtil.getCellValue(infoRow,30).toString());
-                cableSeventyList.add(hundredAndTwenty);
-            }
-        }
+        ExcelReaderBuilder cableFourReaderBuilder = EasyExcel.read(excelFile.getInputStream());
+        ExcelReaderSheetBuilder cableFourBuilder = cableFourReaderBuilder.sheet("电缆分段表");
+        CableFourListener cableFourListener = new CableFourListener();
+        cableFourBuilder.registerReadListener(cableFourListener);
+        // 启动读取操作
+        cableFourBuilder.doRead();
+        List<CableSectionInfo> cableFourHundredList = cableFourListener.getData();
+
+        ExcelReaderBuilder cableThreeReaderBuilder = EasyExcel.read(excelFile.getInputStream());
+        ExcelReaderSheetBuilder cableThreeBuilder = cableThreeReaderBuilder.sheet("电缆分段表");
+        CableThreeListener cableThreeListener = new CableThreeListener();
+        cableThreeBuilder.registerReadListener(cableThreeListener);
+        // 启动读取操作
+        cableThreeBuilder.doRead();
+        List<CableSectionInfo> cableThreeHundredList = cableThreeListener.getData(); //YJV22-3×300mm²
+
+        ExcelReaderBuilder cableTwoReaderBuilder = EasyExcel.read(excelFile.getInputStream());
+        ExcelReaderSheetBuilder cableTwoBuilder = cableTwoReaderBuilder.sheet("电缆分段表");
+        CableTwoListener cableTwoListener = new CableTwoListener();
+        cableTwoBuilder.registerReadListener(cableTwoListener);
+        // 启动读取操作
+        cableTwoBuilder.doRead();
+        List<CableSectionInfo> cableTwoHundredFortyList = cableTwoListener.getData(); //YJV22-3×240mm²
+
+        ExcelReaderBuilder cableSevenReaderBuilder = EasyExcel.read(excelFile.getInputStream());
+        ExcelReaderSheetBuilder cableSevenBuilder = cableSevenReaderBuilder.sheet("电缆分段表");
+        CableSevenListener cableSevenListener = new CableSevenListener();
+        cableSevenBuilder.registerReadListener(cableSevenListener);
+        // 启动读取操作
+        cableSevenBuilder.doRead();
+        List<CableSectionInfo> cableSeventyList = cableSevenListener.getData(); ////YJV22-3×70mm²
+
+//        ImportExcel importUtil = new ImportExcel(file,3,"电缆分段表");
+//        int lastRow = importUtil.getLastDataRowNum();
+        //获取指定的列数据  YJV22-3×400mm²单元格下的行数据
+//        List<CableSectionInfo> cableFourHundredList = new ArrayList<>();
+//        List<CableSectionInfo> cableThreeHundredList = new ArrayList<>();   //YJV22-3×300mm²
+//        List<CableSectionInfo> cableTwoHundredFortyList = new ArrayList<>();    //YJV22-3×240mm²
+//        List<CableSectionInfo> cableSeventyList = new ArrayList<>();       //YJV22-3×70mm²
+//        for (int i=2;i<=lastRow;i++){
+//            Row infoRow = importUtil.getRow(i);
+//            CableSectionInfo hundredInfo = new CableSectionInfo();
+//            if (StringUtils.isNotBlank(importUtil.getCellValue(infoRow,0).toString()) && !importUtil.getCellValue(infoRow,0).toString().equals("总长(km):")){
+//                hundredInfo.setDestination(importUtil.getCellValue(infoRow,0).toString());
+//                hundredInfo.setPathLength(importUtil.getCellValue(infoRow,1).toString());
+//                hundredInfo.setUpperRod(importUtil.getCellValue(infoRow,2).toString());
+//                hundredInfo.setArrival(importUtil.getCellValue(infoRow,3).toString());
+//                hundredInfo.setIncomingEquipment(importUtil.getCellValue(infoRow,4).toString());
+//                hundredInfo.setCoefficient(importUtil.getCellValue(infoRow,5).toString());
+//                hundredInfo.setElectricalChief(importUtil.getCellValue(infoRow,6).toString());
+//                cableFourHundredList.add(hundredInfo);
+//            }
+//
+//            if (StringUtils.isNotBlank(importUtil.getCellValue(infoRow,8).toString())&& !importUtil.getCellValue(infoRow,0).toString().equals("总长(km):")){
+//                CableSectionInfo hundredAndTwenty = new CableSectionInfo();
+//                hundredAndTwenty.setDestination(importUtil.getCellValue(infoRow,8).toString());
+//                hundredAndTwenty.setPathLength(importUtil.getCellValue(infoRow,9).toString());
+//                hundredAndTwenty.setUpperRod(importUtil.getCellValue(infoRow,10).toString());
+//                hundredAndTwenty.setArrival(importUtil.getCellValue(infoRow,11).toString());
+//                hundredAndTwenty.setIncomingEquipment(importUtil.getCellValue(infoRow,12).toString());
+//                hundredAndTwenty.setCoefficient(importUtil.getCellValue(infoRow,13).toString());
+//                hundredAndTwenty.setElectricalChief(importUtil.getCellValue(infoRow,14).toString());
+//                cableThreeHundredList.add(hundredAndTwenty);
+//            }
+//
+//            if (StringUtils.isNotBlank(importUtil.getCellValue(infoRow,16).toString())&& !importUtil.getCellValue(infoRow,0).toString().equals("总长(km):")){
+//                CableSectionInfo hundredAndTwenty = new CableSectionInfo();
+//                hundredAndTwenty.setDestination(importUtil.getCellValue(infoRow,16).toString());
+//                hundredAndTwenty.setPathLength(importUtil.getCellValue(infoRow,17).toString());
+//                hundredAndTwenty.setUpperRod(importUtil.getCellValue(infoRow,18).toString());
+//                hundredAndTwenty.setArrival(importUtil.getCellValue(infoRow,19).toString());
+//                hundredAndTwenty.setIncomingEquipment(importUtil.getCellValue(infoRow,20).toString());
+//                hundredAndTwenty.setCoefficient(importUtil.getCellValue(infoRow,21).toString());
+//                hundredAndTwenty.setElectricalChief(importUtil.getCellValue(infoRow,22).toString());
+//                cableTwoHundredFortyList.add(hundredAndTwenty);
+//            }
+//            if (StringUtils.isNotBlank(importUtil.getCellValue(infoRow,24).toString())&& !importUtil.getCellValue(infoRow,0).toString().equals("总长(km):")){
+//                CableSectionInfo hundredAndTwenty = new CableSectionInfo();
+//                hundredAndTwenty.setDestination(importUtil.getCellValue(infoRow,24).toString());
+//                hundredAndTwenty.setPathLength(importUtil.getCellValue(infoRow,25).toString());
+//                hundredAndTwenty.setUpperRod(importUtil.getCellValue(infoRow,26).toString());
+//                hundredAndTwenty.setArrival(importUtil.getCellValue(infoRow,27).toString());
+//                hundredAndTwenty.setIncomingEquipment( importUtil.getCellValue(infoRow,28).toString());
+//                hundredAndTwenty.setCoefficient(importUtil.getCellValue(infoRow,29).toString());
+//                hundredAndTwenty.setElectricalChief(importUtil.getCellValue(infoRow,30).toString());
+//                cableSeventyList.add(hundredAndTwenty);
+//            }
+//        }
         CableSectionData cableSectionData = new CableSectionData();
         cableSectionData.setCableFourHundredList(cableFourHundredList);
         cableSectionData.setCableThreeHundredList(cableThreeHundredList);

+ 11 - 12
src/main/java/com/jeeplus/modules/cg/reservemanagementcenter/reserveManage/utils/ReserveProcessProjectExportUtil.java

@@ -2,10 +2,7 @@ package com.jeeplus.modules.cg.reservemanagementcenter.reserveManage.utils;
 
 import com.jeeplus.modules.cg.reservemanagementcenter.reserveManage.entity.*;
 import org.apache.commons.lang3.StringUtils;
-import org.apache.poi.ss.usermodel.Cell;
-import org.apache.poi.ss.usermodel.CellStyle;
-import org.apache.poi.ss.usermodel.Row;
-import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.*;
 import org.apache.poi.xssf.usermodel.XSSFCellStyle;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 
@@ -1367,7 +1364,8 @@ public class ReserveProcessProjectExportUtil {
         if(style == null){
             style =workbook.createCellStyle();
             style.setWrapText(true);
-            style.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER);
+//            style.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER);
+            style.setVerticalAlignment(VerticalAlignment.CENTER);
         }
         cell.setCellStyle(style);
         return cell;
@@ -1384,20 +1382,21 @@ public class ReserveProcessProjectExportUtil {
         Cell cell = row.createCell(num);
         //设置样式
         XSSFCellStyle style = workbook.createCellStyle();
-        style.setAlignment(XSSFCellStyle.ALIGN_CENTER); //水平居中
-        style.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER);  //垂直居中
+        style.setAlignment(HorizontalAlignment.CENTER); //水平居中
+//        style.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER);  //垂直居中
+        style.setVerticalAlignment(VerticalAlignment.CENTER);  //垂直居中
         style.setWrapText(true);//自动换行
-        style.setBorderLeft(XSSFCellStyle.BORDER_THIN); // 左边框细线
-        style.setBorderRight(XSSFCellStyle.BORDER_THIN); // 右边框细线
-        style.setBorderBottom(XSSFCellStyle.BORDER_THIN); // 下边框细线
+        style.setBorderLeft(BorderStyle.THIN); // 左边框细线
+        style.setBorderRight(BorderStyle.THIN); // 右边框细线
+        style.setBorderBottom(BorderStyle.THIN); // 下边框细线
         cell.setCellStyle(style);
         return cell;
     }
 
     public void setCellStyle(XSSFWorkbook workbook,int startRow,int endRow,Sheet sheet,int endColumn ){
         XSSFCellStyle newStyle = workbook.createCellStyle();
-        newStyle.setBorderRight(XSSFCellStyle.BORDER_THIN); // 右边框细线
-        newStyle.setBorderBottom(XSSFCellStyle.BORDER_THIN); // 下边框细线
+        newStyle.setBorderRight(BorderStyle.THIN); // 右边框细线
+        newStyle.setBorderBottom(BorderStyle.THIN); // 下边框细线
         // 循环遍历指定的行和列范围,为每个单元格应用边框样式
         for (int rowIndex = startRow; rowIndex <= endRow; rowIndex++) {
             Row row = sheet.getRow(rowIndex);

+ 2 - 1
src/main/java/com/jeeplus/modules/cg/reservemanagementcenter/statisticalTable/util/ExcelExportUtil.java

@@ -5,6 +5,7 @@ import org.apache.commons.lang3.StringUtils;
 import org.apache.poi.ss.usermodel.Cell;
 import org.apache.poi.ss.usermodel.Row;
 import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.VerticalAlignment;
 import org.apache.poi.xssf.usermodel.XSSFCellStyle;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 
@@ -56,7 +57,7 @@ public class ExcelExportUtil {
         if(style == null){
             style =workbook.createCellStyle();
             style.setWrapText(true);
-            style.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER);
+            style.setVerticalAlignment(VerticalAlignment.CENTER);
         }
         cell.setCellStyle(style);
         return cell;

+ 4 - 4
src/main/java/com/jeeplus/modules/sg/balancedlibrary/materialReportDetails/utils/ExportUtil.java

@@ -452,14 +452,14 @@ public class ExportUtil {
         if(style == null){
             style = workbook.createCellStyle();
             style.setWrapText(true);
-            style.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER);
-            style.setAlignment(XSSFCellStyle.ALIGN_CENTER);
+            style.setVerticalAlignment(VerticalAlignment.CENTER);
+            style.setAlignment(HorizontalAlignment.CENTER);
         }
         if(redStyle == null){
             redStyle = workbook.createCellStyle();
             redStyle.setWrapText(true);
-            redStyle.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER);
-            redStyle.setAlignment(XSSFCellStyle.ALIGN_CENTER);
+            redStyle.setVerticalAlignment(VerticalAlignment.CENTER);
+            redStyle.setAlignment(HorizontalAlignment.CENTER);
             XSSFFont font = workbook.createFont();
             font.setColor(Font.COLOR_RED);
             redStyle.setFont(font);

+ 17 - 17
src/main/java/com/jeeplus/modules/sg/balancedlibrary/transitMaterialGoods/util/CreateSheetUtil.java

@@ -31,39 +31,39 @@ public class CreateSheetUtil {
         Sheet sheet3 = workbook.createSheet(sheetName);
         //大标题样式
         XSSFCellStyle headStyle = workbook.createCellStyle();   //创建样式
-        headStyle.setAlignment(CellStyle.ALIGN_CENTER);    //居中
-        headStyle.setVerticalAlignment(CellStyle.VERTICAL_CENTER);
+        headStyle.setAlignment(HorizontalAlignment.CENTER);    //居中
+        headStyle.setVerticalAlignment(VerticalAlignment.CENTER);
         Font titleFont = workbook.createFont(); //创建字体样式
         titleFont.setFontName("Arial");     //设置字体
         titleFont.setFontHeightInPoints((short)16); //字体大小
-        titleFont.setBoldweight(Font.BOLDWEIGHT_BOLD);  //粗体
+        titleFont.setBold(true);  //粗体
         headStyle.setFont(titleFont);
 
         //设置标题样式 -- title
         XSSFCellStyle cellStyle = workbook.createCellStyle();
-        cellStyle.setAlignment(XSSFCellStyle.ALIGN_CENTER);
+        cellStyle.setAlignment(HorizontalAlignment.CENTER);
         cellStyle.setFillForegroundColor(IndexedColors.GREY_50_PERCENT.getIndex());     //背景颜色
-        cellStyle.setFillPattern(XSSFCellStyle.SOLID_FOREGROUND);
+        cellStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
 
-        cellStyle.setBorderBottom(XSSFCellStyle.BORDER_THIN);       //边框
-        cellStyle.setBorderLeft(XSSFCellStyle.BORDER_THIN);
-        cellStyle.setBorderTop(XSSFCellStyle.BORDER_THIN);
-        cellStyle.setBorderRight(HSSFCellStyle.BORDER_THIN);
+        cellStyle.setBorderBottom(BorderStyle.THIN);       //边框
+        cellStyle.setBorderLeft(BorderStyle.THIN);
+        cellStyle.setBorderTop(BorderStyle.THIN);
+        cellStyle.setBorderRight(BorderStyle.THIN);
 
         XSSFFont font = workbook.createFont();
         font.setFontName("Arial");
         font.setFontHeightInPoints((short)12);
-        font.setBoldweight(Font.BOLDWEIGHT_BOLD);
+        font.setBold(true);
         font.setColor(IndexedColors.WHITE.getIndex());      //字体颜色
         cellStyle.setFont(font);
 
         //设置内容样式
         XSSFCellStyle contentStyle = workbook.createCellStyle();
-        contentStyle.setAlignment(XSSFCellStyle.ALIGN_CENTER);
-        contentStyle.setBorderBottom(XSSFCellStyle.BORDER_THIN);
-        contentStyle.setBorderLeft(XSSFCellStyle.BORDER_THIN);
-        contentStyle.setBorderTop(XSSFCellStyle.BORDER_THIN);
-        contentStyle.setBorderRight(XSSFCellStyle.BORDER_THIN);
+        contentStyle.setAlignment(HorizontalAlignment.CENTER);
+        contentStyle.setBorderBottom(BorderStyle.THIN);
+        contentStyle.setBorderLeft(BorderStyle.THIN);
+        contentStyle.setBorderTop(BorderStyle.THIN);
+        contentStyle.setBorderRight(BorderStyle.THIN);
 
         XSSFFont contentFont = workbook.createFont();
         contentFont.setFontName("Calibri");
@@ -71,8 +71,8 @@ public class CreateSheetUtil {
         contentFont.setColor(IndexedColors.BLACK.getIndex());   //字体颜色
         contentStyle.setFont(contentFont);
         contentStyle.setWrapText(true);     //设置单元格内容自动换行
-        contentStyle.setAlignment(CellStyle.ALIGN_CENTER);    //居中
-        contentStyle.setVerticalAlignment(CellStyle.VERTICAL_CENTER);
+        contentStyle.setAlignment(HorizontalAlignment.CENTER);    //居中
+        contentStyle.setVerticalAlignment(VerticalAlignment.CENTER);
 
         //在sheet中添加表头第0行,
         Row row = sheet3.createRow(0);

+ 15 - 17
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/util/ExportUtil.java

@@ -5,9 +5,7 @@ import com.jeeplus.modules.sg.financial.erpcredit.entity.*;
 import com.jeeplus.modules.sg.financial.settlement.entity.MaintainData;
 import org.apache.poi.hssf.usermodel.HSSFCellStyle;
 import org.apache.poi.hssf.usermodel.HSSFFont;
-import org.apache.poi.ss.usermodel.CellStyle;
-import org.apache.poi.ss.usermodel.Sheet;
-import org.apache.poi.ss.usermodel.Workbook;
+import org.apache.poi.ss.usermodel.*;
 import org.apache.poi.xssf.usermodel.XSSFCell;
 import org.apache.poi.xssf.usermodel.XSSFFont;
 import org.apache.poi.xssf.usermodel.XSSFRow;
@@ -1037,32 +1035,32 @@ public class ExportUtil {
     public static CellStyle getCellStyleFont(Workbook workbook){
         XSSFFont font = (XSSFFont) workbook.createFont();
         font.setFontHeightInPoints((short) 12);//设置字体大小
-        font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);//粗体显示
+        font.setBold(true);//粗体显示
         CellStyle style=workbook.createCellStyle();
-        style.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框
-        style.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框
-        style.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框
-        style.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框
+        style.setBorderBottom(BorderStyle.THIN); //下边框
+        style.setBorderLeft(BorderStyle.THIN);//左边框
+        style.setBorderTop(BorderStyle.THIN);//上边框
+        style.setBorderRight(BorderStyle.THIN);//右边框
         style.setFont(font);
         return style;
     }
     //单元格样式
     public static CellStyle getCellStyle(Workbook workbook){
         CellStyle style = workbook.createCellStyle();
-        style.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框
-        style.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框
-        style.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框
-        style.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框
+        style.setBorderBottom(BorderStyle.THIN); //下边框
+        style.setBorderLeft(BorderStyle.THIN);//左边框
+        style.setBorderTop(BorderStyle.THIN);//上边框
+        style.setBorderRight(BorderStyle.THIN);//右边框
         return style;
     }
     //设置边框
     public static CellStyle getCellStyleAlign(Workbook workbook){
         CellStyle style = workbook.createCellStyle();
-        style.setAlignment(HSSFCellStyle.ALIGN_CENTER); // 居中
-        style.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框
-        style.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框
-        style.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框
-        style.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框
+        style.setAlignment(HorizontalAlignment.CENTER); // 居中
+        style.setBorderBottom(BorderStyle.THIN); //下边框
+        style.setBorderLeft(BorderStyle.THIN);//左边框
+        style.setBorderTop(BorderStyle.THIN);//上边框
+        style.setBorderRight(BorderStyle.THIN);//右边框
         return style;
     }
 

+ 14 - 14
src/main/java/com/jeeplus/modules/sg/financial/settlement/service/DataMaintenanceService.java

@@ -300,24 +300,24 @@ public class DataMaintenanceService extends CrudService<DataMaintenanceMapper, M
 		Map<String, CellStyle> styles = new HashMap<String, CellStyle>();
 
 		CellStyle style = wb.createCellStyle();
-		style.setAlignment(CellStyle.ALIGN_CENTER);
-		style.setVerticalAlignment(CellStyle.VERTICAL_CENTER);
+		style.setAlignment(HorizontalAlignment.CENTER);
+		style.setVerticalAlignment(VerticalAlignment.CENTER);
 		Font titleFont = wb.createFont();
 		titleFont.setFontName("Arial");
 		titleFont.setFontHeightInPoints((short) 16);
-		titleFont.setBoldweight(Font.BOLDWEIGHT_BOLD);
+		titleFont.setBold(true);
 		style.setFont(titleFont);
 		styles.put("title", style);
 
 		style = wb.createCellStyle();
-		style.setVerticalAlignment(CellStyle.VERTICAL_CENTER);
-		style.setBorderRight(CellStyle.BORDER_THIN);
+		style.setVerticalAlignment(VerticalAlignment.CENTER);
+		style.setBorderRight(BorderStyle.THIN);
 		style.setRightBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
-		style.setBorderLeft(CellStyle.BORDER_THIN);
+		style.setBorderLeft(BorderStyle.THIN);
 		style.setLeftBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
-		style.setBorderTop(CellStyle.BORDER_THIN);
+		style.setBorderTop(BorderStyle.THIN);
 		style.setTopBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
-		style.setBorderBottom(CellStyle.BORDER_THIN);
+		style.setBorderBottom(BorderStyle.THIN);
 		style.setBottomBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
 		Font dataFont = wb.createFont();
 		dataFont.setFontName("Arial");
@@ -327,29 +327,29 @@ public class DataMaintenanceService extends CrudService<DataMaintenanceMapper, M
 
 		style = wb.createCellStyle();
 		style.cloneStyleFrom(styles.get("data"));
-		style.setAlignment(CellStyle.ALIGN_LEFT);
+		style.setAlignment(HorizontalAlignment.LEFT);
 		styles.put("data1", style);
 
 		style = wb.createCellStyle();
 		style.cloneStyleFrom(styles.get("data"));
-		style.setAlignment(CellStyle.ALIGN_CENTER);
+		style.setAlignment(HorizontalAlignment.CENTER);
 		styles.put("data2", style);
 
 		style = wb.createCellStyle();
 		style.cloneStyleFrom(styles.get("data"));
-		style.setAlignment(CellStyle.ALIGN_RIGHT);
+		style.setAlignment(HorizontalAlignment.RIGHT);
 		styles.put("data3", style);
 
 		style = wb.createCellStyle();
 		style.cloneStyleFrom(styles.get("data"));
 //		style.setWrapText(true);
-		style.setAlignment(CellStyle.ALIGN_CENTER);
+		style.setAlignment(HorizontalAlignment.CENTER);
 		style.setFillForegroundColor(IndexedColors.GREY_50_PERCENT.getIndex());
-		style.setFillPattern(CellStyle.SOLID_FOREGROUND);
+		style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
 		Font headerFont = wb.createFont();
 		headerFont.setFontName("Arial");
 		headerFont.setFontHeightInPoints((short) 10);
-		headerFont.setBoldweight(Font.BOLDWEIGHT_BOLD);
+		headerFont.setBold(true);
 		headerFont.setColor(IndexedColors.BLACK.getIndex());
 		style.setFont(headerFont);
 		style.setFillForegroundColor(HSSFColor.WHITE.index);

+ 14 - 14
src/main/java/com/jeeplus/modules/sg/financial/settlement/service/ProjectBudgetService.java

@@ -300,24 +300,24 @@ public class ProjectBudgetService extends CrudService<ProjectBudgetMapper, Proje
 		Map<String, CellStyle> styles = new HashMap<String, CellStyle>();
 
 		CellStyle style = wb.createCellStyle();
-		style.setAlignment(CellStyle.ALIGN_CENTER);
-		style.setVerticalAlignment(CellStyle.VERTICAL_CENTER);
+		style.setAlignment(HorizontalAlignment.CENTER);
+		style.setVerticalAlignment(VerticalAlignment.CENTER);
 		Font titleFont = wb.createFont();
 		titleFont.setFontName("Arial");
 		titleFont.setFontHeightInPoints((short) 16);
-		titleFont.setBoldweight(Font.BOLDWEIGHT_BOLD);
+		titleFont.setBold(true);
 		style.setFont(titleFont);
 		styles.put("title", style);
 
 		style = wb.createCellStyle();
-		style.setVerticalAlignment(CellStyle.VERTICAL_CENTER);
-		style.setBorderRight(CellStyle.BORDER_THIN);
+		style.setVerticalAlignment(VerticalAlignment.CENTER);
+		style.setBorderRight(BorderStyle.THIN);
 		style.setRightBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
-		style.setBorderLeft(CellStyle.BORDER_THIN);
+		style.setBorderLeft(BorderStyle.THIN);
 		style.setLeftBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
-		style.setBorderTop(CellStyle.BORDER_THIN);
+		style.setBorderTop(BorderStyle.THIN);
 		style.setTopBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
-		style.setBorderBottom(CellStyle.BORDER_THIN);
+		style.setBorderBottom(BorderStyle.THIN);
 		style.setBottomBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
 		Font dataFont = wb.createFont();
 		dataFont.setFontName("Arial");
@@ -327,29 +327,29 @@ public class ProjectBudgetService extends CrudService<ProjectBudgetMapper, Proje
 
 		style = wb.createCellStyle();
 		style.cloneStyleFrom(styles.get("data"));
-		style.setAlignment(CellStyle.ALIGN_LEFT);
+		style.setAlignment(HorizontalAlignment.LEFT);
 		styles.put("data1", style);
 
 		style = wb.createCellStyle();
 		style.cloneStyleFrom(styles.get("data"));
-		style.setAlignment(CellStyle.ALIGN_CENTER);
+		style.setAlignment(HorizontalAlignment.CENTER);
 		styles.put("data2", style);
 
 		style = wb.createCellStyle();
 		style.cloneStyleFrom(styles.get("data"));
-		style.setAlignment(CellStyle.ALIGN_RIGHT);
+		style.setAlignment(HorizontalAlignment.RIGHT);
 		styles.put("data3", style);
 
 		style = wb.createCellStyle();
 		style.cloneStyleFrom(styles.get("data"));
 //		style.setWrapText(true);
-		style.setAlignment(CellStyle.ALIGN_CENTER);
+		style.setAlignment(HorizontalAlignment.CENTER);
 		style.setFillForegroundColor(IndexedColors.GREY_50_PERCENT.getIndex());
-		style.setFillPattern(CellStyle.SOLID_FOREGROUND);
+		style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
 		Font headerFont = wb.createFont();
 		headerFont.setFontName("Arial");
 		headerFont.setFontHeightInPoints((short) 10);
-		headerFont.setBoldweight(Font.BOLDWEIGHT_BOLD);
+		headerFont.setBold(true);
 		headerFont.setColor(IndexedColors.BLACK.getIndex());
 		style.setFont(headerFont);
 		style.setFillForegroundColor(HSSFColor.WHITE.index);

+ 19 - 19
src/main/java/com/jeeplus/modules/sg/financial/settlement/util/ExcelWriter.java

@@ -273,15 +273,15 @@ public class ExcelWriter {
     private static CellStyle buildHeadCellStyle(Workbook workbook) {
         CellStyle style = workbook.createCellStyle();
         //对齐方式设置
-        style.setAlignment(CellStyle.ALIGN_CENTER);
+        style.setAlignment(HorizontalAlignment.CENTER);
         //边框颜色和宽度设置
 //        style.setBorderBottom(CellStyle.THIN);
         style.setBottomBorderColor(IndexedColors.BLACK.getIndex()); // 下边框
-        style.setBorderLeft(CellStyle.BORDER_THIN);
+        style.setBorderLeft(BorderStyle.THIN);
         style.setLeftBorderColor(IndexedColors.BLACK.getIndex()); // 左边框
-        style.setBorderRight(CellStyle.BORDER_THIN);
+        style.setBorderRight(BorderStyle.THIN);
         style.setRightBorderColor(IndexedColors.BLACK.getIndex()); // 右边框
-        style.setBorderTop(CellStyle.BORDER_THIN);
+        style.setBorderTop(BorderStyle.THIN);
         style.setTopBorderColor(IndexedColors.BLACK.getIndex()); // 上边框
         //设置背景颜色
 //        style.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex());
@@ -298,24 +298,24 @@ public class ExcelWriter {
         Map<String, CellStyle> styles = new HashMap<String, CellStyle>();
 
         CellStyle style = wb.createCellStyle();
-        style.setAlignment(CellStyle.ALIGN_CENTER);
-        style.setVerticalAlignment(CellStyle.VERTICAL_CENTER);
+        style.setAlignment(HorizontalAlignment.CENTER);
+        style.setVerticalAlignment(VerticalAlignment.CENTER);
         Font titleFont = wb.createFont();
         titleFont.setFontName("Arial");
         titleFont.setFontHeightInPoints((short) 16);
-        titleFont.setBoldweight(Font.BOLDWEIGHT_BOLD);
+        titleFont.setBold(true);
         style.setFont(titleFont);
         styles.put("title", style);
 
         style = wb.createCellStyle();
-        style.setVerticalAlignment(CellStyle.VERTICAL_CENTER);
-        style.setBorderRight(CellStyle.BORDER_THIN);
+        style.setVerticalAlignment(VerticalAlignment.CENTER);
+        style.setBorderRight(BorderStyle.THIN);
         style.setRightBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
-        style.setBorderLeft(CellStyle.BORDER_THIN);
+        style.setBorderLeft(BorderStyle.THIN);
         style.setLeftBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
-        style.setBorderTop(CellStyle.BORDER_THIN);
+        style.setBorderTop(BorderStyle.THIN);
         style.setTopBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
-        style.setBorderBottom(CellStyle.BORDER_THIN);
+        style.setBorderBottom(BorderStyle.THIN);
         style.setBottomBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
         Font dataFont = wb.createFont();
         dataFont.setFontName("Arial");
@@ -325,29 +325,29 @@ public class ExcelWriter {
 
         style = wb.createCellStyle();
         style.cloneStyleFrom(styles.get("data"));
-        style.setAlignment(CellStyle.ALIGN_LEFT);
+        style.setAlignment(HorizontalAlignment.LEFT);
         styles.put("data1", style);
 
         style = wb.createCellStyle();
         style.cloneStyleFrom(styles.get("data"));
-        style.setAlignment(CellStyle.ALIGN_CENTER);
+        style.setAlignment(HorizontalAlignment.CENTER);
         styles.put("data2", style);
 
         style = wb.createCellStyle();
         style.cloneStyleFrom(styles.get("data"));
-        style.setAlignment(CellStyle.ALIGN_RIGHT);
+        style.setAlignment(HorizontalAlignment.RIGHT);
         styles.put("data3", style);
 
         style = wb.createCellStyle();
         style.cloneStyleFrom(styles.get("data"));
 //		style.setWrapText(true);
-        style.setAlignment(CellStyle.ALIGN_CENTER);
+        style.setAlignment(HorizontalAlignment.CENTER);
         style.setFillForegroundColor(IndexedColors.GREY_50_PERCENT.getIndex());
-        style.setFillPattern(CellStyle.SOLID_FOREGROUND);
+        style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
         Font headerFont = wb.createFont();
         headerFont.setFontName("Arial");
         headerFont.setFontHeightInPoints((short) 10);
-        headerFont.setBoldweight(Font.BOLDWEIGHT_BOLD);
+        headerFont.setBold(true);
         headerFont.setColor(IndexedColors.BLACK.getIndex());
         style.setFont(headerFont);
         style.setFillForegroundColor(HSSFColor.WHITE.index);
@@ -507,7 +507,7 @@ public class ExcelWriter {
 
     private static Sheet buildHerd(Workbook workbook) {
         CellStyle style = workbook.createCellStyle();
-        style.setBorderLeft(CellStyle.BORDER_THIN);
+        style.setBorderLeft(BorderStyle.THIN);
         style.setLeftBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
         Sheet sheet = workbook.createSheet();
         // 设置列头宽度

+ 3 - 5
src/main/java/com/jeeplus/modules/sg/financial/settlement/util/MyExportUtil.java

@@ -3,9 +3,7 @@ package com.jeeplus.modules.sg.financial.settlement.util;
 import com.jeeplus.modules.sg.financial.settlement.entity.CostCheck;
 import com.jeeplus.modules.sg.financial.settlement.entity.ProjectBudget;
 import org.apache.poi.hssf.usermodel.HSSFCellStyle;
-import org.apache.poi.ss.usermodel.Cell;
-import org.apache.poi.ss.usermodel.Row;
-import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.*;
 import org.apache.poi.xssf.usermodel.XSSFCellStyle;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 
@@ -238,8 +236,8 @@ public class MyExportUtil {
         if(style == null){
             style = workbook.createCellStyle();
             style.setWrapText(true);
-            style.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER);
-            style.setAlignment(XSSFCellStyle.ALIGN_CENTER);
+            style.setVerticalAlignment(VerticalAlignment.CENTER);
+            style.setAlignment(HorizontalAlignment.CENTER);
         }
         cell.setCellStyle(style);
         return cell;

+ 2 - 1
src/main/java/com/jeeplus/modules/sg/managementcenter/project/util/ExportUtil.java

@@ -7,6 +7,7 @@ import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 import org.apache.poi.ss.usermodel.Cell;
 import org.apache.poi.ss.usermodel.Row;
 import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.VerticalAlignment;
 import org.apache.poi.xssf.usermodel.XSSFCellStyle;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 
@@ -279,7 +280,7 @@ public class ExportUtil {
         if(style == null){
             style =workbook.createCellStyle();
             style.setWrapText(true);
-            style.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER);
+            style.setVerticalAlignment(VerticalAlignment.CENTER);
         }
         cell.setCellStyle(style);
         return cell;

+ 2 - 1
src/main/java/com/jeeplus/modules/sg/managementcenter/reserveManagement/utils/ReserveExportUtil.java

@@ -6,6 +6,7 @@ import org.apache.commons.lang3.StringUtils;
 import org.apache.poi.ss.usermodel.Cell;
 import org.apache.poi.ss.usermodel.Row;
 import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.VerticalAlignment;
 import org.apache.poi.xssf.usermodel.XSSFCellStyle;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 
@@ -375,7 +376,7 @@ public class ReserveExportUtil {
         if(style == null){
             style =workbook.createCellStyle();
             style.setWrapText(true);
-            style.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER);
+            style.setVerticalAlignment(VerticalAlignment.CENTER);
         }
         cell.setCellStyle(style);
         return cell;

+ 15 - 17
src/main/java/com/jeeplus/modules/sg/raiseCapital/utils/RaiseExportUtil.java

@@ -10,9 +10,7 @@ import com.jeeplus.modules.sg.picking.activiti.entity.ShowList;
 import com.jeeplus.modules.sg.raiseCapital.entity.RaiseCapital;
 import org.apache.poi.hssf.usermodel.HSSFCellStyle;
 import org.apache.poi.hssf.usermodel.HSSFFont;
-import org.apache.poi.ss.usermodel.CellStyle;
-import org.apache.poi.ss.usermodel.Sheet;
-import org.apache.poi.ss.usermodel.Workbook;
+import org.apache.poi.ss.usermodel.*;
 import org.apache.poi.xssf.usermodel.XSSFCell;
 import org.apache.poi.xssf.usermodel.XSSFFont;
 import org.apache.poi.xssf.usermodel.XSSFRow;
@@ -370,12 +368,12 @@ public class RaiseExportUtil {
     public static CellStyle getCellStyleFont(Workbook workbook) {
         XSSFFont font = (XSSFFont) workbook.createFont();
         font.setFontHeightInPoints((short) 12);//设置字体大小
-        font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);//粗体显示
+        font.setBold(true);//粗体显示
         CellStyle style = workbook.createCellStyle();
-        style.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框
-        style.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框
-        style.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框
-        style.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框
+        style.setBorderBottom(BorderStyle.THIN); //下边框
+        style.setBorderLeft(BorderStyle.THIN);//左边框
+        style.setBorderTop(BorderStyle.THIN);//上边框
+        style.setBorderRight(BorderStyle.THIN);//右边框
         style.setFont(font);
         return style;
     }
@@ -383,21 +381,21 @@ public class RaiseExportUtil {
     //设置边框
     public static CellStyle getCellStyle(Workbook workbook) {
         CellStyle style = workbook.createCellStyle();
-        style.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框
-        style.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框
-        style.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框
-        style.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框
+        style.setBorderBottom(BorderStyle.THIN); //下边框
+        style.setBorderLeft(BorderStyle.THIN);//左边框
+        style.setBorderTop(BorderStyle.THIN);//上边框
+        style.setBorderRight(BorderStyle.THIN);//右边框
         return style;
     }
 
     //设置边框
     public static CellStyle getCellStyleAlign(Workbook workbook) {
         CellStyle style = workbook.createCellStyle();
-        style.setAlignment(HSSFCellStyle.ALIGN_CENTER); // 居中
-        style.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框
-        style.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框
-        style.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框
-        style.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框
+        style.setAlignment(HorizontalAlignment.CENTER); // 居中
+        style.setBorderBottom(BorderStyle.THIN); //下边框
+        style.setBorderLeft(BorderStyle.THIN);//左边框
+        style.setBorderTop(BorderStyle.THIN);//上边框
+        style.setBorderRight(BorderStyle.THIN);//右边框
         return style;
     }
 

+ 31 - 33
src/main/java/com/jeeplus/modules/sg/raiseCapitalDesign/utils/RaiseCapitalDesignExportUtil.java

@@ -18,9 +18,7 @@ import com.jeeplus.modules.sg.raiseCapitalDesign.entity.VoltageInfo;
 import com.jeeplus.modules.sys.utils.DictUtils;
 import org.apache.poi.hssf.usermodel.HSSFCellStyle;
 import org.apache.poi.hssf.usermodel.HSSFFont;
-import org.apache.poi.ss.usermodel.CellStyle;
-import org.apache.poi.ss.usermodel.Sheet;
-import org.apache.poi.ss.usermodel.Workbook;
+import org.apache.poi.ss.usermodel.*;
 import org.apache.poi.ss.util.CellRangeAddress;
 import org.apache.poi.xssf.usermodel.XSSFCell;
 import org.apache.poi.xssf.usermodel.XSSFFont;
@@ -995,12 +993,12 @@ public class RaiseCapitalDesignExportUtil {
     public static CellStyle getCellStyleFont(Workbook workbook) {
         XSSFFont font = (XSSFFont) workbook.createFont();
         font.setFontHeightInPoints((short) 12);//设置字体大小
-        font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);//粗体显示
+        font.setBold(true);//粗体显示
         CellStyle style = workbook.createCellStyle();
-        style.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框
-        style.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框
-        style.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框
-        style.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框
+        style.setBorderBottom(BorderStyle.THIN); //下边框
+        style.setBorderLeft(BorderStyle.THIN);//左边框
+        style.setBorderTop(BorderStyle.THIN);//上边框
+        style.setBorderRight(BorderStyle.THIN);//右边框
         style.setFont(font);
         return style;
     }
@@ -1008,21 +1006,21 @@ public class RaiseCapitalDesignExportUtil {
     //设置边框
     public static CellStyle getCellStyle(Workbook workbook) {
         CellStyle style = workbook.createCellStyle();
-        style.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框
-        style.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框
-        style.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框
-        style.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框
+        style.setBorderBottom(BorderStyle.THIN); //下边框
+        style.setBorderLeft(BorderStyle.THIN);//左边框
+        style.setBorderTop(BorderStyle.THIN);//上边框
+        style.setBorderRight(BorderStyle.THIN);//右边框
         return style;
     }
 
     //设置边框
     public static CellStyle getCellStyleAlign(Workbook workbook) {
         CellStyle style = workbook.createCellStyle();
-        style.setAlignment(HSSFCellStyle.ALIGN_CENTER); // 居中
-        style.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框
-        style.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框
-        style.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框
-        style.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框
+        style.setAlignment(HorizontalAlignment.CENTER); // 居中
+        style.setBorderBottom(BorderStyle.THIN); //下边框
+        style.setBorderLeft(BorderStyle.THIN);//左边框
+        style.setBorderTop(BorderStyle.THIN);//上边框
+        style.setBorderRight(BorderStyle.THIN);//右边框
         return style;
     }
 
@@ -1031,13 +1029,13 @@ public class RaiseCapitalDesignExportUtil {
         XSSFFont font = (XSSFFont) workbook.createFont();
         font.setFontHeightInPoints((short) 11);//设置字体大小
         font.setFontName("仿宋_GB2312");
-        font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);//粗体显示
+        font.setBold(true);//粗体显示
         CellStyle style = workbook.createCellStyle();
-        style.setAlignment(HSSFCellStyle.ALIGN_CENTER); // 居中
-        style.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框
-        style.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框
-        style.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框
-        style.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框
+        style.setAlignment(HorizontalAlignment.CENTER); // 居中
+        style.setBorderBottom(BorderStyle.THIN); //下边框
+        style.setBorderLeft(BorderStyle.THIN);//左边框
+        style.setBorderTop(BorderStyle.THIN);//上边框
+        style.setBorderRight(BorderStyle.THIN);//右边框
         style.setFont(font);
         return style;
     }
@@ -1047,12 +1045,12 @@ public class RaiseCapitalDesignExportUtil {
         XSSFFont font = (XSSFFont) workbook.createFont();
         font.setFontHeightInPoints((short) 11);//设置字体大小
         font.setFontName("仿宋_GB2312");
-        font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);//粗体显示
+        font.setBold(true);//粗体显示
         CellStyle style = workbook.createCellStyle();
-        style.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框
-        style.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框
-        style.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框
-        style.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框
+        style.setBorderBottom(BorderStyle.THIN); //下边框
+        style.setBorderLeft(BorderStyle.THIN);//左边框
+        style.setBorderTop(BorderStyle.THIN);//上边框
+        style.setBorderRight(BorderStyle.THIN);//右边框
         style.setFont(font);
         return style;
     }
@@ -1063,11 +1061,11 @@ public class RaiseCapitalDesignExportUtil {
         font.setFontHeightInPoints((short) 11);//设置字体大小
         font.setFontName("仿宋_GB2312");
         CellStyle style = workbook.createCellStyle();
-        style.setAlignment(HSSFCellStyle.ALIGN_CENTER); // 居中
-        style.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框
-        style.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框
-        style.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框
-        style.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框
+        style.setAlignment(HorizontalAlignment.CENTER); // 居中
+        style.setBorderBottom(BorderStyle.THIN); //下边框
+        style.setBorderLeft(BorderStyle.THIN);//左边框
+        style.setBorderTop(BorderStyle.THIN);//上边框
+        style.setBorderRight(BorderStyle.THIN);//右边框
         style.setFont(font);
         return style;
     }

+ 2 - 1
src/main/java/com/jeeplus/modules/sg/scheduleView/util/ExportUtil.java

@@ -10,6 +10,7 @@ import com.jeeplus.modules.sg.scheduleView.entity.ScheduleView;
 import org.apache.poi.ss.usermodel.Cell;
 import org.apache.poi.ss.usermodel.Row;
 import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.VerticalAlignment;
 import org.apache.poi.xssf.usermodel.XSSFCellStyle;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 
@@ -173,7 +174,7 @@ public class ExportUtil {
         if(style == null){
             style =workbook.createCellStyle();
             style.setWrapText(true);
-            style.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER);
+            style.setVerticalAlignment(VerticalAlignment.CENTER);
         }
         cell.setCellStyle(style);
         return cell;

+ 55 - 0
src/main/java/com/jeeplus/modules/sys/listener/CableFourListener.java

@@ -0,0 +1,55 @@
+package com.jeeplus.modules.sys.listener;
+
+import com.alibaba.excel.context.AnalysisContext;
+import com.alibaba.excel.event.AnalysisEventListener;
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.modules.sg.managementcenter.materialinfo.entity.MaterialInfo;
+import com.jeeplus.modules.sg.raiseCapitalDesign.entity.CableSectionInfo;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author 王强
+ * @version 1.0
+ * @date 2023-11-02 11:46
+ */
+public class CableFourListener extends AnalysisEventListener<Map<Integer, String>> {
+
+    private List<CableSectionInfo> data = new ArrayList<>();
+
+    @Override
+    public void invoke(Map<Integer, String> rowData, AnalysisContext context) {
+        int rowIndex = context.readRowHolder().getRowIndex();
+
+        if (rowIndex >= 2) { // 从第7行开始
+
+            if (null != rowData.get(0)){
+                if (StringUtils.isNotBlank(rowData.get(0)) & rowData.get(0).equals("总长(km):")){
+                    CableSectionInfo sectionInfo = new CableSectionInfo();
+                    sectionInfo.setDestination(rowData.get(0));
+                    sectionInfo.setPathLength(rowData.get(1));
+                    sectionInfo.setUpperRod(rowData.get(2));
+                    sectionInfo.setArrival(rowData.get(3));
+                    sectionInfo.setIncomingEquipment(rowData.get(4));
+                    sectionInfo.setCoefficient(rowData.get(5));
+                    sectionInfo.setElectricalChief(rowData.get(6));
+                    data.add(sectionInfo);
+                }
+            }
+
+
+        }
+    }
+
+    @Override
+    public void doAfterAllAnalysed(AnalysisContext analysisContext) {
+
+    }
+
+    public List<CableSectionInfo> getData() {
+        return data;
+    }
+
+}

+ 54 - 0
src/main/java/com/jeeplus/modules/sys/listener/CableSevenListener.java

@@ -0,0 +1,54 @@
+package com.jeeplus.modules.sys.listener;
+
+import com.alibaba.excel.context.AnalysisContext;
+import com.alibaba.excel.event.AnalysisEventListener;
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.modules.sg.raiseCapitalDesign.entity.CableSectionInfo;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author 王强
+ * @version 1.0
+ * @date 2023-11-02 11:46
+ */
+public class CableSevenListener extends AnalysisEventListener<Map<Integer, String>> {
+
+    private List<CableSectionInfo> data = new ArrayList<>();
+
+    @Override
+    public void invoke(Map<Integer, String> rowData, AnalysisContext context) {
+        int rowIndex = context.readRowHolder().getRowIndex();
+
+        if (rowIndex >= 2) { // 从第7行开始
+
+            if (null != rowData.get(24)) {
+                if (StringUtils.isNotBlank(rowData.get(24)) & rowData.get(0).equals("总长(km):")){
+                    CableSectionInfo sectionInfo = new CableSectionInfo();
+                    sectionInfo.setDestination(rowData.get(24));
+                    sectionInfo.setPathLength(rowData.get(25));
+                    sectionInfo.setUpperRod(rowData.get(26));
+                    sectionInfo.setArrival(rowData.get(27));
+                    sectionInfo.setIncomingEquipment(rowData.get(28));
+                    sectionInfo.setCoefficient(rowData.get(29));
+                    sectionInfo.setElectricalChief(rowData.get(30));
+                    data.add(sectionInfo);
+                }
+            }
+
+
+        }
+    }
+
+    @Override
+    public void doAfterAllAnalysed(AnalysisContext analysisContext) {
+
+    }
+
+    public List<CableSectionInfo> getData() {
+        return data;
+    }
+
+}

+ 54 - 0
src/main/java/com/jeeplus/modules/sys/listener/CableThreeListener.java

@@ -0,0 +1,54 @@
+package com.jeeplus.modules.sys.listener;
+
+import com.alibaba.excel.context.AnalysisContext;
+import com.alibaba.excel.event.AnalysisEventListener;
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.modules.sg.raiseCapitalDesign.entity.CableSectionInfo;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author 王强
+ * @version 1.0
+ * @date 2023-11-02 11:46
+ */
+public class CableThreeListener extends AnalysisEventListener<Map<Integer, String>> {
+
+    private List<CableSectionInfo> data = new ArrayList<>();
+
+    @Override
+    public void invoke(Map<Integer, String> rowData, AnalysisContext context) {
+        int rowIndex = context.readRowHolder().getRowIndex();
+
+        if (rowIndex >= 2) { // 从第7行开始
+
+            if (null != rowData.get(8)) {
+                if (StringUtils.isNotBlank(rowData.get(8)) & rowData.get(0).equals("总长(km):")){
+                    CableSectionInfo sectionInfo = new CableSectionInfo();
+                    sectionInfo.setDestination(rowData.get(8));
+                    sectionInfo.setPathLength(rowData.get(9));
+                    sectionInfo.setUpperRod(rowData.get(10));
+                    sectionInfo.setArrival(rowData.get(11));
+                    sectionInfo.setIncomingEquipment(rowData.get(12));
+                    sectionInfo.setCoefficient(rowData.get(13));
+                    sectionInfo.setElectricalChief(rowData.get(14));
+                    data.add(sectionInfo);
+                }
+            }
+
+
+        }
+    }
+
+    @Override
+    public void doAfterAllAnalysed(AnalysisContext analysisContext) {
+
+    }
+
+    public List<CableSectionInfo> getData() {
+        return data;
+    }
+
+}

+ 54 - 0
src/main/java/com/jeeplus/modules/sys/listener/CableTwoListener.java

@@ -0,0 +1,54 @@
+package com.jeeplus.modules.sys.listener;
+
+import com.alibaba.excel.context.AnalysisContext;
+import com.alibaba.excel.event.AnalysisEventListener;
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.modules.sg.raiseCapitalDesign.entity.CableSectionInfo;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author 王强
+ * @version 1.0
+ * @date 2023-11-02 11:46
+ */
+public class CableTwoListener extends AnalysisEventListener<Map<Integer, String>> {
+
+    private List<CableSectionInfo> data = new ArrayList<>();
+
+    @Override
+    public void invoke(Map<Integer, String> rowData, AnalysisContext context) {
+        int rowIndex = context.readRowHolder().getRowIndex();
+
+        if (rowIndex >= 2) { // 从第7行开始
+
+            if (null != rowData.get(16)) {
+                if (StringUtils.isNotBlank(rowData.get(16)) & rowData.get(0).equals("总长(km):")){
+                    CableSectionInfo sectionInfo = new CableSectionInfo();
+                    sectionInfo.setDestination(rowData.get(16));
+                    sectionInfo.setPathLength(rowData.get(17));
+                    sectionInfo.setUpperRod(rowData.get(18));
+                    sectionInfo.setArrival(rowData.get(19));
+                    sectionInfo.setIncomingEquipment(rowData.get(20));
+                    sectionInfo.setCoefficient(rowData.get(21));
+                    sectionInfo.setElectricalChief(rowData.get(22));
+                    data.add(sectionInfo);
+                }
+            }
+
+
+        }
+    }
+
+    @Override
+    public void doAfterAllAnalysed(AnalysisContext analysisContext) {
+
+    }
+
+    public List<CableSectionInfo> getData() {
+        return data;
+    }
+
+}

+ 40 - 0
src/main/java/com/jeeplus/modules/sys/listener/ExcelDataListener.java

@@ -0,0 +1,40 @@
+package com.jeeplus.modules.sys.listener;
+
+import com.alibaba.excel.context.AnalysisContext;
+import com.alibaba.excel.event.AnalysisEventListener;
+import com.alibaba.excel.metadata.CellData;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author 王强
+ * @version 1.0
+ * @date 2023-11-02 11:39
+ */
+public class ExcelDataListener extends AnalysisEventListener<Object> {
+    private String projectName;
+    @Override
+    public void invoke(Object data, AnalysisContext context) {
+        int targetRowIndex = 0; // 目标行索引
+        int targetColumnIndex = 1; // 目标列索引
+
+        if (context.readRowHolder().getRowIndex() == targetRowIndex) {
+            if (data instanceof Map) {
+                Map<Integer, Object> rowDataMap = (Map<Integer, Object>) data;
+                if (rowDataMap.containsKey(targetColumnIndex)) {
+                    projectName = rowDataMap.get(targetColumnIndex).toString();
+                }
+            }
+        }
+    }
+
+    @Override
+    public void doAfterAllAnalysed(AnalysisContext analysisContext) {
+
+    }
+
+    public String getProjectName() {
+        return projectName;
+    }
+}

+ 65 - 0
src/main/java/com/jeeplus/modules/sys/listener/ExcelMaterialInfoListener.java

@@ -0,0 +1,65 @@
+package com.jeeplus.modules.sys.listener;
+
+import com.alibaba.excel.context.AnalysisContext;
+import com.alibaba.excel.event.AnalysisEventListener;
+import com.jeeplus.common.utils.excel.ImportExcel;
+import com.jeeplus.modules.sg.managementcenter.materialinfo.entity.MaterialInfo;
+import org.apache.poi.ss.usermodel.Row;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author 王强
+ * @version 1.0
+ * @date 2023-11-02 11:46
+ */
+public class ExcelMaterialInfoListener extends AnalysisEventListener<Map<Integer, String>> {
+
+    private List<MaterialInfo> data = new ArrayList<>();
+
+    @Override
+    public void invoke(Map<Integer, String> rowData, AnalysisContext context) {
+        int rowIndex = context.readRowHolder().getRowIndex();
+
+        if (rowIndex >= 6) { // 从第7行开始
+            MaterialInfo materialInfo = new MaterialInfo();
+            materialInfo.setMaterialCode(rowData.get(1));
+            materialInfo.setMaterialName(rowData.get(2));
+            materialInfo.setExtendDescription(rowData.get(3));
+            materialInfo.setUnit(rowData.get(4));
+            String column5Value = rowData.get(5);
+            if (column5Value != null) {
+                materialInfo.setTotalCount(Double.parseDouble(column5Value));
+            } else {
+                materialInfo.setTotalCount(0.00);
+            }
+            String column6Value = rowData.get(6);
+            if (column6Value != null) {
+                materialInfo.setWeightKg(Double.parseDouble(column6Value));
+            } else {
+                materialInfo.setWeightKg(0.00);
+            }
+            String column7Value = rowData.get(7);
+            if (column7Value != null) {
+                materialInfo.setWeightTon(Double.parseDouble(column7Value));
+            } else {
+                materialInfo.setWeightTon(0.00);
+            }
+            materialInfo.setSupplyType(rowData.get(8));
+            materialInfo.setNote(rowData.get(9));
+            data.add(materialInfo);
+        }
+    }
+
+    @Override
+    public void doAfterAllAnalysed(AnalysisContext analysisContext) {
+
+    }
+
+    public List<MaterialInfo> getData() {
+        return data;
+    }
+
+}

+ 8 - 5
src/main/webapp/webpage/modules/cg/reservemanagementcenter/reserveManage/summaryStatistics/designUnit.jsp

@@ -164,14 +164,17 @@
 						allConditionsPassed = false;
 						jp.error("不停电审批单/停电审批单不能为空");
 					}
-					var values = approvalForm.split('|');
-					for (var i = 0; i < values.length; i++) {
-						if (!isDocOrDocxFilename(values[i])){
-							allConditionsPassed = false;
-							jp.error("上传的土建现浇审批单的格式应该为:.doc,.docx");
+					if (approvalForm !== '' & approvalForm !== undefined & approvalForm !== null){
+						var values = approvalForm.split('|');
+						for (var i = 0; i < values.length; i++) {
+							if (!isDocOrDocxFilename(values[i])){
+								allConditionsPassed = false;
+								jp.error("上传的土建现浇审批单的格式应该为:.doc,.docx");
+							}
 						}
 					}
 
+
 					var values2 = demolition.split('|');
 					for (var i = 0; i < values2.length; i++) {
 						if (!isXlsOrXlsxFilename(values2[i])){