Selaa lähdekoodia

试验关联表单,万盛电签ID

chenr 8 kuukautta sitten
vanhempi
commit
8ab5acc8a5

+ 27 - 5
blade-service-api/blade-meter-api/src/main/java/org/springblade/meter/vo/MeterInventoryVO1.java

@@ -67,14 +67,36 @@ public class MeterInventoryVO1 {
     @ApiModelProperty(value = "排序")
     private Integer sort;
 
+    @ApiModelProperty(value = "导入编号")
+    private String importNumber;
+
 
    public static int getFirstThreeCharsAsInt(MeterInventoryVO1 vo1) {
-        String name = vo1.getFormNumber();
-        if (name.length() < 3) {
-            throw new IllegalArgumentException("Name must be at least 3 characters long");
+       String name = vo1.getFormNumber();
+        if (!name.isEmpty() && name.length() < 3 ) {
+            String num1 = name.substring(0, 1);
+            if(isNumeric(num1)){
+                return Integer.parseInt(num1);
+            }
+        }
+       if (!name.isEmpty() && name.length() >3) {
+           String num2 = name.substring(0, 3);
+           if(isNumeric(num2)){
+               return Integer.parseInt(num2);
+           }
+       }
+       return 0;
+    }
+    private static boolean isNumeric(String str) {
+        if (str == null || str.length() == 0) {
+            return false;
+        }
+        for (char c : str.toCharArray()) {
+            if (!Character.isDigit(c)) {
+                return false;
+            }
         }
-        String firstThreeChars = name.substring(0, 3);
-        return Integer.parseInt(firstThreeChars);
+        return true;
     }
 
 }

+ 3 - 3
blade-service-api/blade-meter-api/src/main/java/org/springblade/meter/vo/MonthlyReportVo.java

@@ -27,19 +27,19 @@ public class MonthlyReportVo {
     private BigDecimal beforeEndMoney;
 
       @ApiModelProperty(value = "到上期末占C的%")
-    private BigDecimal beforeEndC;
+    private String beforeEndC;
 
       @ApiModelProperty(value = "本期完成金额")
     private BigDecimal nowMoney;
 
       @ApiModelProperty(value = "本期占C的%")
-    private BigDecimal nowC;
+    private String nowC;
 
       @ApiModelProperty(value = "到本期末完成金额")
      private BigDecimal nowEndMoney;
 
        @ApiModelProperty(value = "到本期末完成占C的%")
-      private BigDecimal nowEndC;
+      private String nowEndC;
 
 
 

+ 2 - 2
blade-service/blade-business/src/main/java/org/springblade/business/controller/TrialSummaryController.java

@@ -441,6 +441,7 @@ public class TrialSummaryController {
             cell.setCellValue(value);
 
             CellStyle style = sheet.getWorkbook().createCellStyle();
+            style.setWrapText(true);
             style.setAlignment(HorizontalAlignment.CENTER);
             style.setVerticalAlignment(VerticalAlignment.CENTER);
 
@@ -460,7 +461,6 @@ public class TrialSummaryController {
                 CellRangeAddress mergedRegion = new CellRangeAddress(y1, y2, x1, x2);
                 sheet.addMergedRegion(mergedRegion);
             }
-
             Row row = sheet.getRow(y1);
             if (row == null) {
                 row = sheet.createRow(y1);
@@ -470,9 +470,9 @@ public class TrialSummaryController {
             cell.setCellValue(value);
 
             CellStyle style = sheet.getWorkbook().createCellStyle();
+            style.setWrapText(true);
             style.setAlignment(HorizontalAlignment.CENTER);
             style.setVerticalAlignment(VerticalAlignment.CENTER);
-
             style.setBorderBottom(BorderStyle.THIN);
             style.setBottomBorderColor(IndexedColors.BLACK.getIndex());
             style.setBorderTop(BorderStyle.THIN);

+ 101 - 41
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/FormulaServiceImpl.java

@@ -2191,19 +2191,36 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
                    if (row != null) {
                        Cell cell = row.getCell(x1 - 1);
                        if (cell != null || Func.isNotEmpty(cell)) {
-                           short fontIndex = cell.getCellStyle().getFontIndex();
-                           Font oldfontAt = workbook.getFontAt(fontIndex);
-                           Font redFont = workbook.createFont();
-                           redFont.setColor(IndexedColors.WHITE.getIndex()); //设置字体颜色
-                           redFont.setFontHeightInPoints(Short.valueOf("1"));//设置字体大小
-                           redFont.setFontName(oldfontAt.getFontName());//设置字体
-                           String CellValue = cell.getStringCellValue().trim();
-                           CellStyle newStyle = workbook.createCellStyle(); //创建单元格样式
-                           newStyle.cloneStyleFrom(cell.getCellStyle());
-                           newStyle.setFont(redFont);
-                           newStyle.setShrinkToFit(true);
-                           cell.setCellStyle(newStyle);
-                           cell.setCellValue(dqid);
+//                           short fontIndex = cell.getCellStyle().getFontIndex();
+//                           Font oldfontAt = workbook.getFontAt(fontIndex);
+//                           Font redFont = workbook.createFont();
+//                           redFont.setColor(IndexedColors.WHITE.getIndex()); //设置字体颜色
+//                           redFont.setFontHeightInPoints(Short.valueOf("1"));//设置字体大小
+//                           redFont.setFontName(oldfontAt.getFontName());//设置字体
+//                           String CellValue = cell.getStringCellValue().trim();
+//                           CellStyle newStyle = workbook.createCellStyle(); //创建单元格样式
+//                           newStyle.cloneStyleFrom(cell.getCellStyle());
+//                           newStyle.setFont(redFont);
+//                           newStyle.setShrinkToFit(true);
+//                           cell.setCellStyle(newStyle);
+//                           String value=CellValue+dqid;
+//                           cell.setCellValue(value);
+
+                           // 获取单元格的现有值
+                           String existingValue = cell.getStringCellValue();
+                           // 创建一个新的副文本字符串
+                           RichTextString richTextString = workbook.getCreationHelper().createRichTextString(existingValue + dqid);
+                           // 设置原有部分的字体
+                           Font originalFont = workbook.createFont();
+                           originalFont.setColor(IndexedColors.BLACK.getIndex());
+                           richTextString.applyFont(0, existingValue.length(), originalFont);
+                           // 设置新增部分的字体
+                           Font newFont = workbook.createFont();
+                           newFont.setColor(IndexedColors.WHITE.getIndex());
+                           newFont.setFontHeightInPoints(Short.valueOf("1"));
+                           richTextString.applyFont(existingValue.length(), existingValue.length() + dqid.length(), newFont);
+                           // 将副文本字符串设置到单元格
+                           cell.setCellValue(richTextString);
                        }
                    }
                }
@@ -2219,7 +2236,6 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
         BigDecimal blReserveFundsRatio = jdbcTemplate.queryForObject(sqlForRatio, BigDecimal.class);
         BigDecimal blReserveFundsRatioNew = (new BigDecimal(100).subtract(blReserveFundsRatio).divide(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_HALF_UP));
 
-
         Long redisId = SnowFlakeUtil.getId();
         //判断计算的是哪一期。
         String sql="Select * from s_contract_meter_period where contract_id="+contractId+" and is_deleted=0"+" order by start_date";
@@ -2314,7 +2330,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
             modInput = CommonUtil.getOSSInputStream(url);
             workbook = WorkbookFactory.create(modInput);
             Sheet sheet = workbook.getSheetAt(0);
-            dianqian(htmlUrl,sheet,workbook);
+
             //期号
             String periodNumber = contractMeterPeriodNow.getPeriodNumber();
             if(ObjectUtil.isNotEmpty(periodNumber) && periodNumber.contains("第")){
@@ -2342,6 +2358,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
                 c10.setCellStyle(cellStyle);
                 c10.setCellValue(contractInfo.getContractorUnitName());
             }
+               dianqian(htmlUrl,sheet,workbook);
 
 
             for (Sheet sheet1 : workbook) {
@@ -2411,7 +2428,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
             modInput = CommonUtil.getOSSInputStream(url3);
             workbook = WorkbookFactory.create(modInput);
             Sheet sheet = workbook.getSheetAt(0);
-            dianqian(htmlUrl,sheet,workbook);
+
             //------------------------------------------------------------上期末累计计量金额------------------------------------------------------------
             BigDecimal allMoney = new BigDecimal(0);
             //顺便计算上期末累计支付
@@ -2465,6 +2482,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
                 Cell c3 = getCellByAddress(sheet, "C3");
                 c3.setCellValue(projectName);
             }
+            dianqian(htmlUrl,sheet,workbook);
             for (Sheet sheet1 : workbook) {
                 for (Row row : sheet1) {
                     // 遍历所有单元格
@@ -2532,7 +2550,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
             modInput = CommonUtil.getOSSInputStream(url2);
             workbook = WorkbookFactory.create(modInput);
             Sheet sheet = workbook.getSheetAt(0);
-            dianqian(htmlUrl,sheet,workbook);
+
             //***************************************************************建安费*************************************************************************
             Cell a6 = getCellByAddress(sheet, "A6");
             a6.setCellValue("建安费");
@@ -2681,6 +2699,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
                 Cell d4 = getCellByAddress(sheet, "D4");
                 d4.setCellValue(contractInfo.getContractorUnitName());
             }
+            dianqian(htmlUrl,sheet,workbook);
             for (Sheet sheet1 : workbook) {
                 for (Row row : sheet1) {
                     // 遍历所有单元格
@@ -2742,7 +2761,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
             modInput = CommonUtil.getOSSInputStream(url);
             workbook = WorkbookFactory.create(modInput);
             Sheet sheet = workbook.getSheetAt(0);
-            dianqian(htmlUrl,sheet,workbook);
+
             //------------------------------------------------------------签约合同价------------------------------------------------------------
             String sql1 = "SELECT SUM(contract_money) FROM `s_contract_inventory_form` WHERE contract_id="+contractId+" and is_deleted = 0 ";
             BigDecimal totalMoney = jdbcTemplate.queryForObject(sql1, BigDecimal.class);
@@ -2906,7 +2925,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
                 Cell b3 = getCellByAddress(sheet, "B3");
                 b3.setCellValue(contractInfo.getConstructionUnitName());
             }
-
+            dianqian(htmlUrl,sheet,workbook);
             for (Sheet sheet1 : workbook) {
                 for (Row row : sheet1) {
                     // 遍历所有单元格
@@ -3069,6 +3088,8 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
             dianqian(htmlUrl,sheet,workbook);
             Cell c3=getCellByAddress(sheet,"C3");
             c3.setCellValue(projectName);
+            Cell d5=getCellByAddress(sheet,"D5");
+            d5.setCellValue(projectName);
             //根据坐标获取单元格
             Cell c = getCellByAddress(sheet, "E6");
             //本期计量
@@ -3129,7 +3150,6 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
         String sqlForMeterPeriodById = "SELECT id,period_number,start_date,end_date FROM s_contract_meter_period WHERE id="+periodId+" and is_deleted = 0 ";
         ContractMeterPeriod contractMeterPeriodNow = jdbcTemplate.queryForObject(sqlForMeterPeriodById, new BeanPropertyRowMapper<>(ContractMeterPeriod.class));
         LocalDate endDate = contractMeterPeriodNow.getEndDate();
-
         String sql="SELECT id from s_contract_inventory_form where contract_id="+contractId+" and parent_id=0";
         Long id = jdbcTemplate.queryForObject(sql, Long.class);
         InventoryFormDetailVO detail = iContractInventoryFormClient.detail(id);
@@ -3142,7 +3162,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
             monthlyReport.setCurrentMeterMoney(vo.getContractMoney().setScale(0,RoundingMode.HALF_UP));
             monthlyReport.setAfterCurrentMeterMoney(vo.getChangeMoney().setScale(0,RoundingMode.HALF_UP));
             monthlyReport.setChangeMeterMoney(monthlyReport.getAfterCurrentMeterMoney().subtract(monthlyReport.getCurrentMeterMoney()));
-            String key=monthlyReport.getFormNumber().substring(0,1);
+            String key=vo.getChapterNumber();
             if(list.size()>0){
                OptionalInt index=IntStream.range(0, list.size())
                 .filter(i -> list.get(i).getId().equals(periodId))
@@ -3154,16 +3174,19 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
                 int j = index.getAsInt();
                 if(j>0){
                         //期数ID,章节号
-                        Object o = bladeRedis.get("periodId:"+list.get(j-1).getId()+"formNumber:"+monthlyReport.getFormNumber()+"nowEndMoney");
+                        Object o = bladeRedis.get("periodId:"+list.get(j-1).getId()+"formNumber:"+key+"nowEndMoney");
                         if(ObjectUtil.isNotEmpty(o)){
                             beforeEndMoney=beforeEndMoney.add ((BigDecimal) o);
                         }
                   if(!beforeEndMoney.equals(BigDecimal.ZERO)){
                       //到上期末完成
                       monthlyReport.setBeforeEndMoney(beforeEndMoney);
-                      BigDecimal percentage = monthlyReport.getBeforeEndMoney().divide(monthlyReport.getCurrentMeterMoney(), 10, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100"));
+                      BigDecimal percentage = monthlyReport.getBeforeEndMoney().divide(monthlyReport.getAfterCurrentMeterMoney(), 10, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100"));
                       percentage = percentage.setScale(2, BigDecimal.ROUND_HALF_UP); // 设置
-                      monthlyReport.setBeforeEndC(percentage);
+                      if(!percentage.equals(0.00)){
+                          monthlyReport.setBeforeEndC(percentage+"%");
+                      }
+
                   }
                 }
             }
@@ -3172,9 +3195,12 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
             Object o = bladeRedis.get("periodId:"+periodId+"formNumber:"+key+"nowMoney");
             if(ObjectUtil.isNotEmpty(o)){
              monthlyReport.setNowMoney((BigDecimal)o);
-              BigDecimal percentage = monthlyReport.getNowMoney().divide(monthlyReport.getCurrentMeterMoney(), 10, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100"));
+              BigDecimal percentage = monthlyReport.getNowMoney().divide(monthlyReport.getAfterCurrentMeterMoney(), 10, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100"));
               percentage = percentage.setScale(2, BigDecimal.ROUND_HALF_UP); // 设置小数位数为2
-              monthlyReport.setNowC(percentage);
+              if(!percentage.equals(0.00)){
+                  monthlyReport.setNowC(percentage+"%");
+              }
+
            }
             //到本期末完成
             //如果有到上期末完成金额,和本期完成金额  则到本期末完成金额=到上期末完成金额+本期完成金额
@@ -3190,12 +3216,15 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
                 monthlyReport.setNowEndMoney(BigDecimal.ZERO);
             }
             if(ObjectUtil.isNotEmpty(monthlyReport.getNowEndMoney())){
-                BigDecimal percentage = monthlyReport.getNowEndMoney().divide(monthlyReport.getCurrentMeterMoney(), 10, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100"));
+                BigDecimal percentage = monthlyReport.getNowEndMoney().divide(monthlyReport.getAfterCurrentMeterMoney(), 10, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100"));
                 percentage = percentage.setScale(2, BigDecimal.ROUND_HALF_UP); // 设置
-                monthlyReport.setNowEndC(percentage);
+                if(!percentage.equals(0.00)){
+                    monthlyReport.setNowEndC(percentage+"%");
+                }
+
             }
             //到本期末完成 本期ID+章节号
-            bladeRedis.set("periodId:"+periodId+"formNumber:"+monthlyReport.getFormNumber()+"nowEndMoney",monthlyReport.getNowEndMoney());
+            bladeRedis.set("periodId:"+periodId+"formNumber:"+key+"nowEndMoney",monthlyReport.getNowEndMoney());
             values.add(monthlyReport);
         }
         MonthlyReportVo m1 = new MonthlyReportVo();
@@ -3231,16 +3260,25 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
              m3.setBeforeEndMoney(beforeEndMoney);
              BigDecimal percentage1 = m3.getBeforeEndMoney().divide(m3.getAfterCurrentMeterMoney(), 10, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100"));
              percentage1 = percentage1.setScale(2, BigDecimal.ROUND_HALF_UP);
-             m3.setBeforeEndC(percentage1);
+            if(!percentage1.equals(0.00)){
+                m3.setBeforeEndC(percentage1+"%");
+            }
+
         }
         m3.setNowMoney(nowMoney);
         BigDecimal percentage2 = m3.getNowMoney().divide(m3.getAfterCurrentMeterMoney(), 10, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100"));
         percentage2 = percentage2.setScale(2, BigDecimal.ROUND_HALF_UP);
-        m3.setNowC(percentage2);
+        if(!percentage2.equals(0.00)){
+            m3.setNowC(percentage2+"%");
+        }
+
         m3.setNowEndMoney(nowEndMoney);
         BigDecimal percentage3 = m3.getNowEndMoney().divide(m3.getAfterCurrentMeterMoney(), 10, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100"));
         percentage3 = percentage3.setScale(2, BigDecimal.ROUND_HALF_UP);
-        m3.setNowEndC(percentage3);
+        if(!percentage3.equals(0.00)){
+            m3.setNowEndC(percentage3+"%");
+        }
+
         values.add(m3);
 
         MonthlyReportVo m4 = new MonthlyReportVo();
@@ -3285,7 +3323,10 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
         m11.setNowMoney(m3.getNowMoney());
         BigDecimal percentage7 = m11.getNowMoney().divide(m11.getAfterCurrentMeterMoney(), 10, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100"));
         percentage7 = percentage7.setScale(2, BigDecimal.ROUND_HALF_UP);
-        m11.setNowC(percentage7);
+        if(!percentage7.equals(0.00)){
+            m11.setNowC(percentage7+"%");
+        }
+
 
         if(ObjectUtil.isNotEmpty(m3.getNowEndMoney())){
             m11.setNowEndMoney(m3.getNowEndMoney());
@@ -3339,16 +3380,25 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
             m19.setBeforeEndMoney(m11.getBeforeEndMoney().subtract(m18.getBeforeEndMoney()));
             BigDecimal percentage4 = m19.getBeforeEndMoney().divide(m11.getAfterCurrentMeterMoney(), 10, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100"));
             percentage4 = percentage4.setScale(2, BigDecimal.ROUND_HALF_UP);
-            m19.setBeforeEndC(percentage4);
+            if(!percentage4.equals(0.00)){
+                m19.setBeforeEndC(percentage4+"%");
+            }
+
         }
         m19.setNowMoney(m11.getNowMoney().subtract(m18.getNowMoney()));
         BigDecimal percentage5 = m19.getNowMoney().divide(m11.getAfterCurrentMeterMoney(), 10, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100"));
         percentage5 = percentage5.setScale(2, BigDecimal.ROUND_HALF_UP);
-        m19.setNowC(percentage5);
+        if(!percentage5.equals(0.00)){
+            m19.setNowC(percentage5+"%");
+        }
+
         m19.setNowEndMoney(m11.getNowEndMoney().subtract(m18.getNowEndMoney()));
         BigDecimal percentage6 = m19.getNowEndMoney().divide(m11.getAfterCurrentMeterMoney(), 10, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100"));
         percentage6 = percentage6.setScale(2, BigDecimal.ROUND_HALF_UP);
-        m19.setNowEndC(percentage6);
+        if(!percentage6.equals(0.00)){
+            m19.setNowEndC(percentage6+"%");
+        }
+
         bladeRedis.set("periodId:"+periodId+"nowMoney",m19.getNowMoney());
         values.add(m19);
         setZeroBigDecimalFieldsToNullInList(values);
@@ -3362,7 +3412,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
             modInput = CommonUtil.getOSSInputStream(url);
             workbook = WorkbookFactory.create(modInput);
             Sheet sheet = workbook.getSheetAt(0);
-            dianqian(htmlUrl,sheet,workbook);
+
             //根据坐标获取单元格
                             // 起始行号
                             int startRow =9;
@@ -3409,6 +3459,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
                 m_3.setCellValue(endDate.toString());
 
             }
+            dianqian(htmlUrl,sheet,workbook);
             String file_path = FileUtils.getSysLocalFileUrl();
             String locationFile = file_path + SnowFlakeUtil.getId() + ".xlsx";
             outputStream = new FileOutputStream(locationFile);
@@ -3483,6 +3534,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
         String sql="SELECT * FROM s_contract_inventory_form WHERE project_id="+projectId+" and contract_id="+contractId+" and is_deleted=0";
         //合同清单的对应明细
         List<ContractInventoryForm> query = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(ContractInventoryForm.class));
+
         for (MeterInventoryDetailVO detailVO : formDetail) {
            //清单支付报表对象
             MeterInventoryVO1  vo=new MeterInventoryVO1();
@@ -3576,18 +3628,25 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
           String suffix=SnowFlakeUtil.getId()+".pdf";
         String sysLocalFileUrl = FileUtils.getSysLocalFileUrl();
         String localImgUrl=sysLocalFileUrl+suffix;
+        for (MeterInventoryVO1 vo1 : list1) {
+            for (ContractInventoryForm form : query) {
+                if(vo1.getFormName().equals(form.getFormName())){
+                    vo1.setImportNumber(form.getChapterNumber()!=null?form.getChapterNumber():vo1.getFormNumber());
+                }
+            }
+        }
         if(list1.size()>0){
             //先根据根据前三个字符排序
              list1.sort(Comparator.comparingInt(MeterInventoryVO1::getFirstThreeCharsAsInt));
              //根据编号的第一个字符,分类
-         Map<Character, List<MeterInventoryVO1>> groupedMeter = new HashMap<>();
+         Map<String, List<MeterInventoryVO1>> groupedMeter = new HashMap<>();
          List<String>listUrl=new ArrayList<>();
            for (MeterInventoryVO1 vo1 : list1) {
-           char firstChar = vo1.getFormNumber().charAt(0);
+           String firstChar = vo1.getImportNumber().substring(0,3);
            groupedMeter.computeIfAbsent(firstChar, k -> new ArrayList<>()).add(vo1);
           }
            //根据编号的不同建立不同的excel
-            for (Map.Entry<Character, List<MeterInventoryVO1>> listEntry : groupedMeter.entrySet()) {
+            for (Map.Entry<String, List<MeterInventoryVO1>> listEntry : groupedMeter.entrySet()) {
                 List<MeterInventoryVO1> value = listEntry.getValue();
                 //原合同金额 首页至本页
                 BigDecimal totalCurrentMeterMoney=BigDecimal.ZERO;
@@ -3632,7 +3691,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
                         modInput = CommonUtil.getOSSInputStream(url);
                         workbook = WorkbookFactory.create(modInput);
                         Sheet sheet = workbook.getSheetAt(0);
-                        dianqian(htmlUrl,sheet,workbook);
+
                             // 起始行号
                             int startRow =8;
                             int endRow = 21;
@@ -3710,6 +3769,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
                                     l4.setCellStyle(cellStyle);
                                     l4.setCellValue(contractInfo.getSupervisionUnitName());
                                 }
+                                  dianqian(htmlUrl,sheet,workbook);
 
                         String file_path = FileUtils.getSysLocalFileUrl();
                         String locationFile = file_path + SnowFlakeUtil.getId() + ".xlsx";

+ 1 - 1
blade-service/blade-meter/src/main/java/org/springblade/meter/mapper/ContractInventoryFormMapper.xml

@@ -68,7 +68,7 @@
         from s_contract_inventory_form scif where id = #{id}
     </select>
     <select id="getChildList" resultType="org.springblade.meter.vo.ContractInventoryFormVO">
-        select form_number,unit,current_price,contract_total,change_price,change_total,if(is_supplement=0,'否','是') as isSupplementName,
+        select chapter_number,form_number,unit,current_price,contract_total,change_price,change_total,if(is_supplement=0,'否','是') as isSupplementName,
                if(is_supplement=0,form_name,concat(form_name,'[增补]')) as form_name,
                (select sum(contract_money) from s_contract_inventory_form sci where sci.is_deleted=0 and sci.contract_id = #{contractId}
                         and (sci.id = scif.id or FIND_IN_SET(scif.id,ancestors) > 0)) as contract_money,