Browse Source

新增3个计算指标 并修改生化报警的取值逻辑

wangmiaomiao 9 months ago
parent
commit
b2cbfe6f62

+ 1 - 0
slibra-common/src/main/java/com/slibra/common/enums/BusinessEnum.java

@@ -47,6 +47,7 @@ public class BusinessEnum {
 
         ECC_BMFH("二沉池表面负荷", "二沉池表面负荷"),
         ECC_GTFH("二沉池固体负荷", "二沉池固体负荷"),
+        FCXSL("反冲洗水量", "反冲洗水量"),
 
         ;
 

+ 48 - 16
slibra-quartz/src/main/java/com/slibra/quartz/task/AsyncTask.java

@@ -440,6 +440,20 @@ public class AsyncTask {
     }
 
     private TXinyiCalculate addCalculateByIndustry(TXinyiIndustry tXinyiIndustry, TXinyiNormConfig normConfig) {
+        //获取的一些配置信息
+        BigDecimal nhlbqdsl = normConfig.getNHLBQDSL();
+        BigDecimal nhlbdsjll = normConfig.getNHLBDSJLL();
+        BigDecimal nhlbgzxl = normConfig.getNHLBGZXL();
+        BigDecimal whlbqdsl = normConfig.getWHLBQDSL();
+        BigDecimal whlbdsjll = normConfig.getWHLBDSJLL();
+        BigDecimal whlbgzxl = normConfig.getWHLBGZXL();
+        BigDecimal gfjgzts = normConfig.getGFJGZTS();
+        BigDecimal gfjckll = normConfig.getGFJCKLL();
+        BigDecimal fcxbsjll = normConfig.getFCXBSJLL();
+        BigDecimal fclbsl = normConfig.getFCLBSL();
+        BigDecimal fcxbgzxl = normConfig.getFCXBGZXL();
+
+        //结算结果
         TXinyiCalculate tXinyiCalculate = new TXinyiCalculate();
         //时间相关
         tXinyiCalculate.setTestDate(tXinyiIndustry.getTestDate());
@@ -503,35 +517,45 @@ public class AsyncTask {
             tXinyiCalculate.setEccGtfh((new BigDecimal(1).add(whlR)).multiply(jsSlq).multiply(new BigDecimal(NUMBER_24)).multiply(avgMlss).divide(ECCGTFH_LAST, NUMBER_SCALE_4, RoundingMode.HALF_UP));
             tXinyiCalculate.setClsnJcsj(CLSNJCSJ_LAST.divide(jsSlq, NUMBER_SCALE_4, RoundingMode.HALF_UP));
             tXinyiCalculate.setXgcdcQsqSsls(jsSlq.multiply(XGCDCQSQSSLS_LAST));
+            //2024年6月29日15:18:01 增加几个新的计算指标
+            if(!Objects.isNull(nhlbqdsl) && !Objects.isNull(nhlbdsjll) && !Objects.isNull(nhlbgzxl))
+                tXinyiCalculate.setNHLB(nhlbqdsl.multiply(nhlbdsjll).multiply(nhlbgzxl).divide(jsSlq, 4, RoundingMode.HALF_UP));
+            if(!Objects.isNull(whlbqdsl) && !Objects.isNull(whlbdsjll) && !Objects.isNull(whlbgzxl))
+                tXinyiCalculate.setWHLB(whlbqdsl.multiply(whlbdsjll).multiply(whlbgzxl).divide(jsSlq, 4, RoundingMode.HALF_UP));
+            if(!Objects.isNull(gfjgzts) && !Objects.isNull(gfjckll))
+                tXinyiCalculate.setQSB(gfjgzts.multiply(gfjckll).divide(jsSlq, NUMBER_SCALE_4, RoundingMode.HALF_UP));
+            if(!Objects.isNull(fcxbsjll) && !Objects.isNull(fclbsl) && !Objects.isNull(fcxbgzxl))
+                tXinyiCalculate.setFCXSL(fcxbsjll.multiply(fclbsl).multiply(fcxbgzxl));
+
         }
         return tXinyiCalculate;
     }
 
     private void handleSHWarning(TXinyiIndustry tXinyiIndustry, TXinyiNormConfig normConfig, TXinyiCalculate xinyiCalculate) {
         //判断对应指标是否报警  然后调研大模型获取决策信息
-        BigDecimal jsSlq = tXinyiIndustry.getJsSlq();
+//        BigDecimal jsSlq = tXinyiIndustry.getJsSlq();
         //内回流比报警
 //        BigDecimal nhlbSjz = normConfig.getNhlbSjz();//400
 //        BigDecimal nhlbnkSxz = normConfig.getNhlbnkSxz();//360
         BigDecimal nhlbnkXxz = normConfig.getNhlbnkXxz();//270
-        BigDecimal nhlbqdsl = normConfig.getNHLBQDSL();
-        BigDecimal nhlbdsjll = normConfig.getNHLBDSJLL();
-        BigDecimal nhlbgzxl = normConfig.getNHLBGZXL();
-        if(!Objects.isNull(jsSlq) && !Objects.isNull(nhlbnkXxz) && !Objects.isNull(nhlbqdsl)
-                && !Objects.isNull(nhlbdsjll) && !Objects.isNull(nhlbgzxl)){
-            BigDecimal divide = nhlbqdsl.multiply(nhlbdsjll).multiply(nhlbgzxl).divide(jsSlq, 4, RoundingMode.HALF_UP);
-            handleXinYiWarningsSH(nhlbnkXxz, divide, BusinessEnum.WarningCategoryEnum.NHLB.getCode(), tXinyiIndustry, normConfig, true);
+//        BigDecimal nhlbqdsl = normConfig.getNHLBQDSL();
+//        BigDecimal nhlbdsjll = normConfig.getNHLBDSJLL();
+//        BigDecimal nhlbgzxl = normConfig.getNHLBGZXL();
+        BigDecimal nhlb = xinyiCalculate.getNHLB();
+        if(!Objects.isNull(nhlb) && !Objects.isNull(nhlbnkXxz)){
+//            BigDecimal divide = nhlbqdsl.multiply(nhlbdsjll).multiply(nhlbgzxl).divide(jsSlq, 4, RoundingMode.HALF_UP);
+            handleXinYiWarningsSH(nhlbnkXxz, nhlb, BusinessEnum.WarningCategoryEnum.NHLB.getCode(), tXinyiIndustry, normConfig, true);
         }
 
         //外回流比报警
-        BigDecimal whlbqdsl = normConfig.getWHLBQDSL();
-        BigDecimal whlbdsjll = normConfig.getWHLBDSJLL();
-        BigDecimal whlbgzxl = normConfig.getWHLBGZXL();
+//        BigDecimal whlbqdsl = normConfig.getWHLBQDSL();
+//        BigDecimal whlbdsjll = normConfig.getWHLBDSJLL();
+//        BigDecimal whlbgzxl = normConfig.getWHLBGZXL();
         BigDecimal whlbnkXxz = normConfig.getWhlbnkXxz();//75
 //        BigDecimal whlbSjz = normConfig.getWhlbSjz();
-        if(!Objects.isNull(whlbqdsl) && !Objects.isNull(whlbdsjll) && !Objects.isNull(whlbgzxl)){
-            BigDecimal divide = whlbqdsl.multiply(whlbdsjll).multiply(whlbgzxl).divide(jsSlq, 4, RoundingMode.HALF_UP);
-            handleXinYiWarningsSH(whlbnkXxz, divide, BusinessEnum.WarningCategoryEnum.WHLB.getCode(), tXinyiIndustry, normConfig, true);
+        BigDecimal whlb = xinyiCalculate.getWHLB();
+        if(!Objects.isNull(whlb) && !Objects.isNull(whlbnkXxz)){
+            handleXinYiWarningsSH(whlbnkXxz, whlb, BusinessEnum.WarningCategoryEnum.WHLB.getCode(), tXinyiIndustry, normConfig, true);
         }
 
 
@@ -626,7 +650,11 @@ public class AsyncTask {
             handleXinYiWarningsSH(hycrjyNkz, shcHyTwoDo, BusinessEnum.WarningCategoryEnum.HYQDO_TWO.getCode(), tXinyiIndustry, normConfig, true);
         }
 
-        //气水比(暂时没有计算)todo
+        //气水比
+        BigDecimal qsb = xinyiCalculate.getQSB();
+        BigDecimal shcqbNkz = normConfig.getShcqbNkz();
+        if(!Objects.isNull(qsb) && !Objects.isNull(shcqbNkz))
+            handleXinYiWarningsSH(shcqbNkz, qsb, BusinessEnum.WarningCategoryEnum.QSB.getCode(), tXinyiIndustry, normConfig, true);
 
         //二沉池表面负荷
         BigDecimal eccBmfh = xinyiCalculate.getEccBmfh();
@@ -642,7 +670,11 @@ public class AsyncTask {
             handleXinYiWarningsSH(eccgtfhnkxxz, eccGtfh, BusinessEnum.WarningCategoryEnum.ECC_GTFH.getCode(), tXinyiIndustry, normConfig, true);
         }
 
-        //反冲洗水量(暂时没有计算)todo
+        //反冲洗水量
+        BigDecimal fcxsl = xinyiCalculate.getFCXSL();
+        BigDecimal fcxslblsjzXxz = normConfig.getFcxslblsjzXxz();
+        if(!Objects.isNull(fcxsl) && !Objects.isNull(fcxslblsjzXxz))
+            handleXinYiWarningsSH(fcxslblsjzXxz, fcxsl, BusinessEnum.WarningCategoryEnum.FCXSL.getCode(), tXinyiIndustry, normConfig, true);
     }