瀏覽代碼

化验室多个池子的也改成保留两位

王苗苗 7 月之前
父節點
當前提交
365a2db343

+ 0 - 3
slibra-common/src/main/java/com/slibra/common/DecimalUtils.java

@@ -25,9 +25,6 @@ public class DecimalUtils {
     public static BigDecimal getAbsAndScale(BigDecimal req, int length){
     public static BigDecimal getAbsAndScale(BigDecimal req, int length){
         if(Objects.isNull(req))
         if(Objects.isNull(req))
             return null;
             return null;
-
-
-
         return req.abs().setScale(length, RoundingMode.DOWN);
         return req.abs().setScale(length, RoundingMode.DOWN);
     }
     }
 
 

+ 6 - 4
slibra-common/src/main/java/com/slibra/common/utils/format/WaterFormat.java

@@ -77,14 +77,15 @@ public class WaterFormat {
         decisionReq.setTpLv(DecimalUtils.getAbsAndScale(decisionReq.getTpLv(), INT_0));
         decisionReq.setTpLv(DecimalUtils.getAbsAndScale(decisionReq.getTpLv(), INT_0));
         decisionReq.setTpLvContinuity(DecimalUtils.getAbsAndScale(decisionReq.getTpLvContinuity(), INT_0));
         decisionReq.setTpLvContinuity(DecimalUtils.getAbsAndScale(decisionReq.getTpLvContinuity(), INT_0));
         // 碳源投加量 2位
         // 碳源投加量 2位
+        //2024年08月27日20:10:49 化验室多个池子的也改成保留两位
         decisionReq.setTyjyl(DecimalUtils.getAbsAndScaleStr(decisionReq.getTyjyl(), INT_2));
         decisionReq.setTyjyl(DecimalUtils.getAbsAndScaleStr(decisionReq.getTyjyl(), INT_2));
         decisionReq.setCltjl(DecimalUtils.getAbsAndScaleStr(decisionReq.getCltjl(), INT_0));
         decisionReq.setCltjl(DecimalUtils.getAbsAndScaleStr(decisionReq.getCltjl(), INT_0));
-        decisionReq.setHycxsyAll(DecimalUtils.getAbsForArray(decisionReq.getHycxsyAll(), INT_0));
-        decisionReq.setQyanAll(DecimalUtils.getAbsForArray(decisionReq.getQyanAll(), INT_0));
-        decisionReq.setQyckxsyAll(DecimalUtils.getAbsForArray(decisionReq.getQyckxsyAll(), INT_0));
+        decisionReq.setHycxsyAll(DecimalUtils.getAbsForArray(decisionReq.getHycxsyAll(), INT_2));
+        decisionReq.setQyanAll(DecimalUtils.getAbsForArray(decisionReq.getQyanAll(), INT_2));
+        decisionReq.setQyckxsyAll(DecimalUtils.getAbsForArray(decisionReq.getQyckxsyAll(), INT_2));
         decisionReq.setGwnl(DecimalUtils.getAbsAndScale(daily.getGWNL(), INT_0));
         decisionReq.setGwnl(DecimalUtils.getAbsAndScale(daily.getGWNL(), INT_0));
         decisionReq.setEccZl(DecimalUtils.getAbsAndScaleStr(decisionReq.getEccZl(), INT_2));//这里要保留2为小数,否则数据太小,全都是0  示例:0.411195  0.372263
         decisionReq.setEccZl(DecimalUtils.getAbsAndScaleStr(decisionReq.getEccZl(), INT_2));//这里要保留2为小数,否则数据太小,全都是0  示例:0.411195  0.372263
-        decisionReq.setHyzlsyAll(DecimalUtils.getAbsForArray(decisionReq.getHyzlsyAll(), INT_0));
+        decisionReq.setHyzlsyAll(DecimalUtils.getAbsForArray(decisionReq.getHyzlsyAll(), INT_2));
         decisionReq.setR(DecimalUtils.getAbsAndScale(daily.getNhlR(), INT_0));
         decisionReq.setR(DecimalUtils.getAbsAndScale(daily.getNhlR(), INT_0));
         decisionReq.setRR(DecimalUtils.getAbsAndScale(daily.getWhlR(), INT_0));
         decisionReq.setRR(DecimalUtils.getAbsAndScale(daily.getWhlR(), INT_0));
         BigDecimal jsBod5 = daily.getJsBod5();
         BigDecimal jsBod5 = daily.getJsBod5();
@@ -178,6 +179,7 @@ public class WaterFormat {
         List<BigDecimal> strings = JSON.parseArray("[11.898019,12.96599]", BigDecimal.class);
         List<BigDecimal> strings = JSON.parseArray("[11.898019,12.96599]", BigDecimal.class);
         System.out.println(strings.get(0));
         System.out.println(strings.get(0));
         System.out.println(strings.get(1));
         System.out.println(strings.get(1));
+        System.out.println(DecimalUtils.getAbsAndScaleStr("12.819", INT_2));
     }
     }
 
 
 }
 }