Procházet zdrojové kódy

修改计量单元导入不增加清单数量

qianxb před 8 měsíci
rodič
revize
6a324502d4

+ 2 - 2
blade-service/blade-meter/src/main/java/org/springblade/meter/service/impl/ContractInventoryFormServiceImpl.java

@@ -74,8 +74,8 @@ public class ContractInventoryFormServiceImpl extends BaseServiceImpl<ContractIn
         Integer nodes = 0;
         Integer endTotal = 0;
         try {
-            if (!"xls,xlsx".contains(fileSuffix)){
-                throw new ServiceException("请传入excel文件");
+            if (!"xlsx".contains(fileSuffix)){
+                throw new ServiceException("请传入excel文件,或者先转换为xlsx");
             }
             List<ContractInventoryForm> excels = ExcelUtil.read(file, ContractInventoryForm.class);
             excels = excels.stream()

+ 18 - 18
blade-service/blade-meter/src/main/java/org/springblade/meter/service/impl/MeterTreeContractServiceImpl.java

@@ -1560,12 +1560,12 @@ public class MeterTreeContractServiceImpl extends BaseServiceImpl<MeterTreeContr
             }
         }
         //修改合同工程清单的变更后数量
-        if (InventoryFormListUpdate.size() > 0) {
-            Map<String, BigDecimal> map = InventoryFormListUpdate.stream()
-                    .collect(Collectors.groupingBy(l -> l.getFormNumber(),
-                            Collectors.mapping(ContractInventoryForm::getChangeTotal, Collectors.reducing(BigDecimal.ZERO, BigDecimal::add))));
-            baseMapper.batchUpdateFormByNumber(meterTreeContract.getContractId(), map);
-        }
+//        if (InventoryFormListUpdate.size() > 0) {
+//            Map<String, BigDecimal> map = InventoryFormListUpdate.stream()
+//                    .collect(Collectors.groupingBy(l -> l.getFormNumber(),
+//                            Collectors.mapping(ContractInventoryForm::getChangeTotal, Collectors.reducing(BigDecimal.ZERO, BigDecimal::add))));
+//            baseMapper.batchUpdateFormByNumber(meterTreeContract.getContractId(), map);
+//        }
         return R.success("成功导入:节点("+addNode+")个,"+"新增清单("+addForm+")条,"+"修改清单("+updateForm+")条.");
     }
 
@@ -1785,12 +1785,12 @@ public class MeterTreeContractServiceImpl extends BaseServiceImpl<MeterTreeContr
             this.asyncCalculateNodeMoney2(updateNodeSet);
         }
         //修改合同工程清单的变更后数量
-        if (InventoryFormListUpdate.size() > 0) {
-            Map<String, BigDecimal> map = InventoryFormListUpdate.stream()
-                    .collect(Collectors.groupingBy(l -> l.getFormNumber(),
-                            Collectors.mapping(ContractInventoryForm::getChangeTotal, Collectors.reducing(BigDecimal.ZERO, BigDecimal::add))));
-            baseMapper.batchUpdateFormByNumber(meterTreeContract.getContractId(), map);
-        }
+//        if (InventoryFormListUpdate.size() > 0) {
+//            Map<String, BigDecimal> map = InventoryFormListUpdate.stream()
+//                    .collect(Collectors.groupingBy(l -> l.getFormNumber(),
+//                            Collectors.mapping(ContractInventoryForm::getChangeTotal, Collectors.reducing(BigDecimal.ZERO, BigDecimal::add))));
+//            baseMapper.batchUpdateFormByNumber(meterTreeContract.getContractId(), map);
+//        }
         //修改图号或者备注
         if (resultNodeListUpdate.size() > 0){
             List<List<MeterTreeContract>> lists = CommonUtil.splitList(resultNodeListUpdate, 1000);
@@ -2144,12 +2144,12 @@ public class MeterTreeContractServiceImpl extends BaseServiceImpl<MeterTreeContr
             }
 
             //修改合同工程清单的变更后数量
-            if (InventoryFormListUpdate.size() > 0) {
-                Map<String, BigDecimal> map = InventoryFormListUpdate.stream()
-                        .collect(Collectors.groupingBy(l -> l.getFormNumber(),
-                                Collectors.mapping(ContractInventoryForm::getChangeTotal, Collectors.reducing(BigDecimal.ZERO, BigDecimal::add))));
-                baseMapper.batchUpdateFormByNumber(meterTreeContract.getContractId(), map);
-            }
+//            if (InventoryFormListUpdate.size() > 0) {
+//                Map<String, BigDecimal> map = InventoryFormListUpdate.stream()
+//                        .collect(Collectors.groupingBy(l -> l.getFormNumber(),
+//                                Collectors.mapping(ContractInventoryForm::getChangeTotal, Collectors.reducing(BigDecimal.ZERO, BigDecimal::add))));
+//                baseMapper.batchUpdateFormByNumber(meterTreeContract.getContractId(), map);
+//            }
 
             //修改节点金额放最后,等中间表数据保存完成之后,再去统计
             if (updateNodeSet.size() > 0){