Răsfoiți Sursa

万盛计量 从首页至本页

cr 1 lună în urmă
părinte
comite
423e6a7c90

+ 33 - 14
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/FormulaServiceImpl.java

@@ -4441,19 +4441,32 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
                 groupedMeter.computeIfAbsent(firstChar, k -> new ArrayList<>()).add(vo1);
             }
             //原合同金额 首页至本页
-            BigDecimal totalCurrentMeterMoney = BigDecimal.ZERO;
+            BigDecimal totalCurrentMeterMoney1 = BigDecimal.ZERO;
             //工程变更金额 首页至本页
-            BigDecimal totalChangeMeterMoney = BigDecimal.ZERO;
+            BigDecimal totalChangeMeterMoney1 = BigDecimal.ZERO;
             //变更后合同金额 首页至本页
-            BigDecimal totalAfterCurrentMeterMoney = BigDecimal.ZERO;
+            BigDecimal totalAfterCurrentMeterMoney1 = BigDecimal.ZERO;
             //到上期末完成金额 首页至本页
-            BigDecimal totalBeforeEndMoney = BigDecimal.ZERO;
+            BigDecimal totalBeforeEndMoney1 = BigDecimal.ZERO;
             //本期完成金额 首页至本页
-            BigDecimal totalNowMoney = BigDecimal.ZERO;
+            BigDecimal totalNowMoney1 = BigDecimal.ZERO;
             //到本期末完成金额 首页至本页
-            BigDecimal totalNowEndMoney = BigDecimal.ZERO;
+            BigDecimal totalNowEndMoney1 = BigDecimal.ZERO;
+
             //根据编号的不同建立不同的excel
             for (Map.Entry<String, List<MeterInventoryVO1>> listEntry : groupedMeter.entrySet()) {
+                //原合同金额 首页至本页
+                BigDecimal totalCurrentMeterMoney = BigDecimal.ZERO;
+                //工程变更金额 首页至本页
+                BigDecimal totalChangeMeterMoney = BigDecimal.ZERO;
+                //变更后合同金额 首页至本页
+                BigDecimal totalAfterCurrentMeterMoney = BigDecimal.ZERO;
+                //到上期末完成金额 首页至本页
+                BigDecimal totalBeforeEndMoney = BigDecimal.ZERO;
+                //本期完成金额 首页至本页
+                BigDecimal totalNowMoney = BigDecimal.ZERO;
+                //到本期末完成金额 首页至本页
+                BigDecimal totalNowEndMoney = BigDecimal.ZERO;
                 List<MeterInventoryVO1> value = listEntry.getValue();
                 //编号来划分
                 for (int i = 0; i < value.size(); i += 11) {
@@ -4462,21 +4475,27 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
                     //原合同金额 本页
                     BigDecimal CurrentMeterMoney = subList.stream().map(MeterInventoryVO1::getCurrentMeterMoney).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
                     totalCurrentMeterMoney = totalCurrentMeterMoney.add(CurrentMeterMoney);
+                    totalCurrentMeterMoney1 = totalCurrentMeterMoney1.add(CurrentMeterMoney);
                     //工程变更金额 本页
                     BigDecimal ChangeMeterMoney = subList.stream().map(MeterInventoryVO1::getChangeMeterMoney).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
                     totalChangeMeterMoney = totalChangeMeterMoney.add(ChangeMeterMoney);
+                    totalChangeMeterMoney1 = totalChangeMeterMoney1.add(ChangeMeterMoney);
                     //变更后合同金额 本页
                     BigDecimal AfterCurrentMeterMoney = subList.stream().map(MeterInventoryVO1::getAfterCurrentMeterMoney).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
                     totalAfterCurrentMeterMoney = totalAfterCurrentMeterMoney.add(AfterCurrentMeterMoney);
+                    totalAfterCurrentMeterMoney1 = totalAfterCurrentMeterMoney1.add(AfterCurrentMeterMoney);
                     //到上期末完成金额 本页
                     BigDecimal BeforeEndMoney = subList.stream().map(MeterInventoryVO1::getBeforeEndMoney).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
                     totalBeforeEndMoney = totalBeforeEndMoney.add(BeforeEndMoney);
+                    totalBeforeEndMoney1 = totalBeforeEndMoney1.add(BeforeEndMoney);
                     //本期完成金额 本页
                     BigDecimal NowMoney = subList.stream().map(MeterInventoryVO1::getNowMoney).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
                     totalNowMoney = totalNowMoney.add(NowMoney);
+                    totalNowMoney1 = totalNowMoney1.add(NowMoney);
                     //到本期末完成金额 本页
                     BigDecimal NowEndMoney = subList.stream().map(MeterInventoryVO1::getNowEndMoney).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
                     totalNowEndMoney = totalNowEndMoney.add(NowEndMoney);
+                    totalNowEndMoney1 = totalNowEndMoney1.add(NowEndMoney);
                     InputStream modInput = null;
                     FileInputStream excelFileInput = null;
                     FileOutputStream outputStream = null;
@@ -4544,21 +4563,21 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
                         Cell a23 = getCellByAddress(sheet, "A20");
                         a23.setCellValue("从首页至本页合计");
                         Cell g23 = getCellByAddress(sheet, "G20");
-                        g23.setCellValue(totalCurrentMeterMoney.toString());
-                        if (!totalChangeMeterMoney.equals(BigDecimal.ZERO)) {
+                        g23.setCellValue(totalCurrentMeterMoney1.toString());
+                        if (!totalChangeMeterMoney1.equals(BigDecimal.ZERO)) {
                             Cell j23 = getCellByAddress(sheet, "J20");
-                            j23.setCellValue(totalChangeMeterMoney.toString());
+                            j23.setCellValue(totalChangeMeterMoney1.toString());
                         }
                         Cell l23 = getCellByAddress(sheet, "L20");
-                        l23.setCellValue(totalAfterCurrentMeterMoney.toString());
-                        if (!totalBeforeEndMoney.equals(BigDecimal.ZERO)) {
+                        l23.setCellValue(totalAfterCurrentMeterMoney1.toString());
+                        if (!totalBeforeEndMoney1.equals(BigDecimal.ZERO)) {
                             Cell n23 = getCellByAddress(sheet, "N20");
-                            n23.setCellValue(totalBeforeEndMoney.toString());
+                            n23.setCellValue(totalBeforeEndMoney1.toString());
                         }
                         Cell q23 = getCellByAddress(sheet, "Q20");
-                        q23.setCellValue(totalNowMoney.toString());
+                        q23.setCellValue(totalNowMoney1.toString());
                         Cell s23 = getCellByAddress(sheet, "S20");
-                        s23.setCellValue(totalNowEndMoney.toString());
+                        s23.setCellValue(totalNowEndMoney1.toString());
                         if (ObjectUtil.isNotEmpty(contractId)) {
                             ContractInfo contractInfo = getContractInfo(contractId);
                             String projectName = getProjectName(contractInfo.getPId());