Browse Source

Merge remote-tracking branch 'origin/master' into master

yangyj 8 months ago
parent
commit
9bae7eda0e

+ 4 - 4
blade-service/blade-manager/src/main/java/org/springblade/manager/formula/impl/ExecutorMeter.java

@@ -407,10 +407,10 @@ public class ExecutorMeter extends FormulaExecutor {
                 InterimPaymentSummary summary = new InterimPaymentSummary();
                 summary.setSummary(true);
                 summary.setItemName("合计");
-                summary.setContractAmount(bfc.apply(dataList,InterimPaymentSummary::getContractAmount));
-                summary.setRevisedAmount(bfc.apply(dataList,InterimPaymentSummary::getRevisedAmount));
-                summary.setCurrentPeriodPay(bfc.apply(dataList,InterimPaymentSummary::getCurrentPeriodPay));
-                summary.setCurrentPeriodEndPay(bfc.apply(dataList,InterimPaymentSummary::getCurrentPeriodEndPay));
+                summary.setContractAmount(StringUtils.number2StringZero(bfc.apply(dataList,InterimPaymentSummary::getContractAmount),tec.getScale()));
+                summary.setRevisedAmount(StringUtils.number2StringZero(bfc.apply(dataList,InterimPaymentSummary::getRevisedAmount),tec.getScale()));
+                summary.setCurrentPeriodPay(StringUtils.number2StringZero(bfc.apply(dataList,InterimPaymentSummary::getCurrentPeriodPay),tec.getScale()));
+                summary.setCurrentPeriodEndPay(StringUtils.number2StringZero(bfc.apply(dataList,InterimPaymentSummary::getCurrentPeriodEndPay),tec.getScale()));
                 summary.setPayRatioA(ratioFc.apply(summary.getCurrentPeriodEndPay(),summary.getContractAmount()));
                 summary.setPayRatioA(ratioFc.apply(summary.getCurrentPeriodEndPay(),summary.getRevisedAmount()));
                 dataList.add(summary);

+ 25 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/formula/impl/TableElementConverter.java

@@ -41,6 +41,7 @@ public class TableElementConverter implements ITableElementConverter {
     public static String JOIN_REG = "__\\d+_\\d+,?";
     public static Pattern RP = Pattern.compile("(?<=E\\[)[^]]+(?=])");
 
+
     private List<TableInfo> tableInfoList;
     private Long contractId;
     private Long projectId;
@@ -121,6 +122,11 @@ public class TableElementConverter implements ITableElementConverter {
     public CompletableFuture<Map<Long, TreeNode<MeterTree>>> meterTreeMap;
     /*存放计量计算结果*/
     public List<ReportResult> reportResults ;
+
+    /*取小数*/
+    public Integer scale = 0;
+
+    public Integer payRadicScale = 2;
     /*计量属性*/
     /**根据表名获取对应表页对象*/
     public LinkedList<NodeTable> getTableByName(String initTableName){
@@ -550,4 +556,23 @@ public class TableElementConverter implements ITableElementConverter {
 
 
 
+    public Integer getScale() {
+        return scale;
+    }
+
+    public void setScale(Integer scale) {
+        this.scale = scale;
+    }
+
+    public Integer getPayRadicScale() {
+        return payRadicScale;
+    }
+
+    public void setPayRadicScale(Integer payRadicScale) {
+        this.payRadicScale = payRadicScale;
+    }
+
+
+
+
 }

+ 2 - 2
blade-service/blade-meter/src/main/java/org/springblade/meter/controller/MeterTreeController.java

@@ -514,7 +514,7 @@ public class MeterTreeController extends BladeController {
                             "   WHERE b.parent_id = a.id AND b.is_deleted = 0 AND b.status = 1 AND b.project_id = " + projectId + ") AS notExsitChild" +
                             " FROM s_meter_tree_project a WHERE a.project_id = " + projectId +
                             " AND a.is_deleted = 0 AND a.status = 1 AND a.parent_id = " + id +
-                            " ORDER BY a.sort,a.create_time",
+                            " ORDER BY -a.sort desc,a.create_time",
                     new BeanPropertyRowMapper<>(MeterTreeProjectTreeVO.class));
             return R.data(query);
         }
@@ -739,7 +739,7 @@ public class MeterTreeController extends BladeController {
                     " WHERE c.is_deleted = 0 AND c.contract_meter_id = a.id) AS isDecompositionData" +
                     " FROM s_meter_tree_contract a WHERE a.contract_id = " + contractId +
                     " AND a.is_deleted = 0 AND a.status = 1 AND a.parent_id = " + id +
-                    " ORDER BY a.sort,a.create_time";
+                    " ORDER BY -a.sort desc,a.create_time";
             List<MeterTreeContractTreeVO> query = jdbcTemplate.query(sql,
                     new BeanPropertyRowMapper<>(MeterTreeContractTreeVO.class));
             return R.data(query);

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

@@ -1558,6 +1558,8 @@ public class MeterTreeContractServiceImpl extends BaseServiceImpl<MeterTreeContr
         parseExcelFileToList = parseExcelFileToList.stream().filter(l->StringUtils.isNotBlank(l.get("桩号支付编号")) && !l.get("桩号支付编号").contains("清单编号需手动填写")).collect(Collectors.toList());
         /*节点新增*/
         List<MeterTreeContract> resultNodeListAdd = new LinkedList<>();
+        /*节点修改*/
+        List<MeterTreeContract> resultNodeListUpdate = new ArrayList<>();
         /*节点金额修改Ids*/
         Set<Long> updateNodeSet = new HashSet<>();
         /*清单中间新增*/
@@ -1609,7 +1611,20 @@ public class MeterTreeContractServiceImpl extends BaseServiceImpl<MeterTreeContr
                     .map(l->l.getKey()).collect(Collectors.toList());
             // 查询当前节点下是否存在
             if (hasChild && nameMap.get(name) != null){
+                //添加进修改集合,重新计算金额
                 updateNodeSet.add(nameMap.get(name));
+                //获取出图号和备注单独修改
+                if (StringUtils.isNotBlank(stringMap.get("图号")) || StringUtils.isNotBlank(stringMap.get("备注"))){
+                    MeterTreeContract contract = new MeterTreeContract();
+                    contract.setId(nameMap.get(name));
+                    if (StringUtils.isNotBlank(stringMap.get("图号"))) {
+                        contract.setContractPicture(stringMap.get("图号"));
+                    }
+                    if (StringUtils.isNotBlank(stringMap.get("备注"))){
+                        contract.setRemarks(stringMap.get("备注"));
+                    }
+                    resultNodeListUpdate.add(contract);
+                }
                 // 循环需要挂载的清单
                 for (String fo : allForm) {
                     //获取清单信息
@@ -1666,6 +1681,7 @@ public class MeterTreeContractServiceImpl extends BaseServiceImpl<MeterTreeContr
                 obj.setDataSourceType(4);
                 obj.setUpdateStatus(0);
                 obj.setRemarks(stringMap.get("备注"));
+                obj.setContractPicture(stringMap.get("图号"));
                 obj.setTenantId(AuthUtil.getTenantId());
                 obj.setIsSupplement(0);
                 obj.setIsResolveForm(1);
@@ -1733,7 +1749,6 @@ public class MeterTreeContractServiceImpl extends BaseServiceImpl<MeterTreeContr
                         BigDecimal buildPictureTotal = contractFromVO.getBuildPictureTotal(); //变更前数量
                         BigDecimal changeBuildPictureTotal = contractFromVO.getChangeBuildPictureTotal(); //变更后数量
                         BigDecimal currentPrice = contractFromVO.getCurrentPrice(); //单价
-
                         BigDecimal buildPictureMoney = buildPictureTotal.multiply(currentPrice); //变更前金额
                         BigDecimal changeBuildPictureMoney = changeBuildPictureTotal.multiply(currentPrice); //变更后金额
 
@@ -1758,6 +1773,10 @@ public class MeterTreeContractServiceImpl extends BaseServiceImpl<MeterTreeContr
                             Collectors.mapping(ContractInventoryForm::getChangeTotal, Collectors.reducing(BigDecimal.ZERO, BigDecimal::add))));
             baseMapper.batchUpdateFormByNumber(meterTreeContract.getContractId(), map);
         }
+        //修改图号或者备注
+        if (resultNodeListUpdate.size() > 0){
+            this.updateBatchById(resultNodeListUpdate);
+        }
         return R.success("成功导入:节点("+addNode+")个,"+"新增清单("+addForm+")条,"+"修改清单("+updateForm+")条.");
     }