Browse Source

中期计量计算bug处理

yangyj 8 months ago
parent
commit
17c28c1d67

+ 5 - 5
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/InterimPaymentCertificate.java

@@ -19,7 +19,7 @@ public class InterimPaymentCertificate {
     public static final String TBN_CH="中期支付证书";
     /**项目名称*/
     @JSONField(name = "key_1",label="项目名称",ordinal = 1)
-    private String itemName;
+    private String chapterSeq;
     /**合同金额*/
     @JSONField(name = "key_2",label="合同金额",ordinal = 2)
     private String contractAmount;
@@ -52,11 +52,11 @@ public class InterimPaymentCertificate {
     private String constructionTotal;
     /**是否是汇总小结数据,输出的时候显示,计算的时候不参与*/
     private Boolean isSummary=false;
-    /**章次*/
-    private String chapterSeq;
+    /**清单名称*/
+    private String formName;
 
-    public InterimPaymentCertificate(String itemName) {
-        this.itemName = itemName;
+    public InterimPaymentCertificate(String chapterSeq) {
+        this.chapterSeq = chapterSeq;
     }
 
     public void calculate(){

+ 15 - 4
blade-service/blade-manager/src/main/java/com/mixsmart/utils/FormulaUtils.java

@@ -853,10 +853,21 @@ public class FormulaUtils {
         if(document!=null) {
             Elements list = document.getElementsByAttribute("dqid");
             if (list != null && !list.isEmpty()) {
-                list.forEach(element -> {
-                    int y1 = Func.toInt(element.attr("y1"));
-                    int x1 = Func.toInt(element.attr("x1"));
-                    result.put(y1+"_"+x1,element.attr("dqid"));
+                list.stream().map(e-> {
+                            if (!e.hasAttr("y1") && !e.hasAttr("x1")&&e.children().size()>0) {
+                                  return e.children().get(0);
+                            } else {
+                                  return e;
+                            }
+                        }
+                ).filter(Objects::nonNull).forEach(element -> {
+                    try {
+                        int y1 = Func.toInt(element.attr("y1"));
+                        int x1 = Func.toInt(element.attr("x1"));
+                        result.put(y1+"_"+x1,element.attr("dqid"));
+                    }catch (Exception e){
+                        e.printStackTrace();
+                    }
                 });
             }
         }

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

@@ -348,7 +348,7 @@ public class ExecutorMeter extends FormulaExecutor {
                          /*中期支付汇总的章次*/
                          String ch = inventoryForm.getFormNumber();
                          InterimPaymentCertificate ipc = new InterimPaymentCertificate(ch + (BaseUtils.isNumber(ch) ? "章" : ""));
-                         ipc.setChapterSeq(ipc.getItemName());
+                         ipc.setFormName(inventoryForm.getFormName());
                          BigDecimal[] bmMoney = cm.getValue();
                          ipc.setContractAmount(bmMoney[0].toString());
                          ipc.setRevisedAmount(bmMoney[1].toString());
@@ -412,6 +412,7 @@ public class ExecutorMeter extends FormulaExecutor {
             for(InterimPaymentCertificate ipc:interimPaymentCertificates){
                 InterimPaymentSummary ips = new InterimPaymentSummary();
                 BeanUtils.copyProperties(ipc,ips);
+                ips.setItemName(ipc.getFormName());
                 ips.calculate();
                 dataList.add(ips);
             }
@@ -767,7 +768,6 @@ public class ExecutorMeter extends FormulaExecutor {
                     /*不存在则新增*/
                     ss = new SubInterimMeterPaySummary();
                     ss.setItemName(tmpTree.getNodeName());
-                    ss.currentPeriodPayAdd(meterTree.peer.getCurrentPeriodPay());
                     tmpTree.peer=ss;
                 }
                 /*已存在则相加*/
@@ -901,6 +901,8 @@ public class ExecutorMeter extends FormulaExecutor {
             fieldDataFcMap.put(InterimMeter.TBN+":key_11",interimMeters2oListFc.apply(InterimMeter::getItemNameList));
             fieldDataFcMap.put(InterimMeter.TBN+":key_12",interimMeters2oListFc.apply(InterimMeter::getUnitList));
             fieldDataFcMap.put(InterimMeter.TBN+":key_13",interimMeters2oListFc.apply(InterimMeter::getCompletedList));
+           /*每条记录一页*/
+            capacity=1;
            putOut(InterimMeter.class);
         }
     }