1
0

2 Revīzijas 54a54cff7a ... f036d3fbda

Autors SHA1 Ziņojums Datums
  yangyj f036d3fbda 2-16 2 mēneši atpakaļ
  yangyj c0e0d17769 2-7 2 mēneši atpakaļ

+ 3 - 0
blade-common/src/main/java/org/springblade/common/utils/BaseUtils.java

@@ -162,6 +162,9 @@ public class BaseUtils {
     public static String bigDecimalScale(Object s,int scale){
              return str2BigDecimal(s).setScale(scale,RoundingMode.HALF_UP).stripTrailingZeros().toPlainString();
     }
+    public static String stripTrailingZeros(Object s){
+        return str2BigDecimal(s).stripTrailingZeros().toPlainString();
+    }
 
     /*默认返回零*/
     public static Double obj2DoubleZero(Object obj) {

+ 1 - 1
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/MeterInfo.java

@@ -101,7 +101,7 @@ public class MeterInfo {
         return Collections.emptyList();
     }
 
-    /*中期支付证书里的*/
+    /**中期支付证书里的*/
     private List<InterimPayCertificateItem> interimPayCertificateItems =new ArrayList<>();
 
     public Map<Long,LinkedHashMap<String,InterimPayCertificateItem>> getInterimPayCertificateItemGroup(){

+ 6 - 1
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/SubprojectInterimPaymentSummary.java

@@ -107,11 +107,16 @@ public class SubprojectInterimPaymentSummary  implements  DataModel{
 
     public void calculate(List<SubprojectInterimPaymentSummary> data,Integer scale){
         if(data!=null&&data.size()>0){
-
+            /*合同金额*/
+            count(this::setContractMoney,data,SubprojectInterimPaymentSummary::getContractMoney,scale);
             /*本次支付*/
             count(this::setCurrentPeriodPay,data,SubprojectInterimPaymentSummary::getCurrentPeriodPay,scale);
             /*本次累计支付*/
             count(this::setCurrentPeriodEndPay,data,SubprojectInterimPaymentSummary::getCurrentPeriodEndPay,scale);
+            BigDecimal ra=BaseUtils.str2BigDecimal(this.currentPeriodPay).multiply(new BigDecimal(100)).divide(BaseUtils.str2BigDecimal(this.contractMoney),2,RoundingMode.HALF_UP);
+            if(BigDecimal.ZERO.compareTo(ra)<0) {
+                setPayRatio(ra.stripTrailingZeros().toPlainString()+"%");
+            }
         }
     }
 

+ 3 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/formula/impl/ExecutorFormat.java

@@ -19,7 +19,7 @@ import java.util.stream.IntStream;
 /**
  * @author yangyj
  * @Date 2023/12/18 14:24
- * @description TODO
+ * @description 格式化
  */
 @EqualsAndHashCode(callSuper = true)
 @Data
@@ -65,6 +65,8 @@ public class ExecutorFormat extends FormulaExecutor {
                     fd.getValues().forEach(ed -> {
                         if (BaseUtils.isZero(ed.getValue())) {
                             ed.setValue(StringPool.EMPTY);
+                        }else  if(BaseUtils.isNumber(ed.getValue())&&ed.stringValue().endsWith("0")){
+                            ed.setValue(BaseUtils.stripTrailingZeros(ed.getValue()));
                         }
                     });
                 }

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

@@ -2493,7 +2493,10 @@ public class ExecutorMeter extends FormulaExecutor {
 
         /*删除没有计量的章节*/
         public LinkedHashMap<String,NodeTable> removeNodeTable(LinkedHashMap<String,List<MeterApply>> meterApplyGroup){
-            List<NodeTable> table2E16= tec.getTableAll().stream().filter(e-> Pattern.matches("【2-16】工程计量表\\(\\d+章\\)",e.getNodeName().replaceAll("\\s+",""))).collect(Collectors.toList());
+            List<NodeTable> table2E16= tec.getTableAll().stream().filter(e-> Pattern.matches("【2-16】工程计量表(\\(\\d+章\\))?",e.getNodeName().replaceAll("\\s+",""))).collect(Collectors.toList());
+            table2E16.stream().filter(e->e.getNodeName().equals("【2-16】工程计量表")).findAny().ifPresent(t->{
+                t.setNodeName(t.getNodeName()+"(100章)");
+            });
             List<String>chapters =new ArrayList<>(meterApplyGroup.keySet());
             List<Long> removeIds=table2E16.stream().filter(t->!BaseUtils.inChain(chapters,t.getNodeName())).map(NodeTable::getPKeyId).collect(Collectors.toList());
             /*删除没有计量的章节*/