yangyj hace 2 meses
padre
commit
f036d3fbda

+ 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(){

+ 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());
             /*删除没有计量的章节*/