Browse Source

报警优化

wangmiaomiao 11 months ago
parent
commit
a88718362d

+ 22 - 12
slibra-admin/src/main/java/com/slibra/web/controller/business/WarningController.java

@@ -75,7 +75,7 @@ public class WarningController extends BaseController {
         Date currentDate = Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant());
         //获取对个格式日期字符串
         String currentDateStr = DateUtil.format(currentDate, DateUtils.YYYYMMDD_TS);
-        currentDateStr = "2024/03/12";
+        currentDateStr = "2024/03/01T ";
         String currentHourStr = DateUtil.format(currentDate, DateUtils.YYYYMMDDHH_TS);
         currentHourStr = "2024/05/05 11";
         //查询工业库 日报库 机器人化验库
@@ -253,28 +253,38 @@ public class WarningController extends BaseController {
                 System.out.println("--------------12");
             }
             //13 内回流比报警
-            BigDecimal nhlR = tXinyiDaily.getNhlR();
+//            BigDecimal nhlR = tXinyiDaily.getNhlR();
             BigDecimal nhlbSjz = normConfig.getNhlbSjz();
             BigDecimal nhlbnkSxz = normConfig.getNhlbnkSxz();
-            if(!Objects.isNull(nhlR) && !Objects.isNull(nhlbSjz) && !Objects.isNull(nhlbnkSxz)){
-                if(nhlR.compareTo(nhlbnkSxz) > 0 && nhlR.compareTo(nhlbSjz) <=0)
+            BigDecimal nhlbqdsl = normConfig.getNHLBQDSL();
+            BigDecimal nhlbdsjll = normConfig.getNHLBDSJLL();
+            BigDecimal nhlbgzxl = normConfig.getNHLBGZXL();
+            BigDecimal jsl = tXinyiDaily.getJSL();
+            if(!Objects.isNull(jsl) && !Objects.isNull(nhlbSjz) && !Objects.isNull(nhlbnkSxz) && !Objects.isNull(nhlbqdsl)
+                && !Objects.isNull(nhlbdsjll) && !Objects.isNull(nhlbgzxl)){
+                BigDecimal divide = nhlbqdsl.multiply(nhlbdsjll).multiply(nhlbgzxl).divide(jsl, 4, RoundingMode.HALF_UP);
+                if(divide.compareTo(nhlbnkSxz) > 0 && divide.compareTo(nhlbSjz) <=0)
                     System.out.println("内回流比报警级别为 二级");
-                if(nhlR.compareTo(nhlbSjz) > 0)
+                if(divide.compareTo(nhlbSjz) > 0)
                     System.out.println("内回流比报警级别为 一级");
                 BigDecimal nhlbnkXxz = normConfig.getNhlbnkXxz();
-                if(!Objects.isNull(nhlbnkXxz) && nhlR.compareTo(nhlbnkXxz) < 0)
+                if(!Objects.isNull(nhlbnkXxz) && divide.compareTo(nhlbnkXxz) < 0)
                     System.out.println("内回流比报警级别为 一级");
                 System.out.println("内回流比报警数据正常~~~");
                 System.out.println("--------------13");
             }
             //14 外回流比报警
-            BigDecimal whlR = tXinyiDaily.getWhlR();
+//            BigDecimal whlR = tXinyiDaily.getWhlR();
+            BigDecimal whlbqdsl = normConfig.getWHLBQDSL();
+            BigDecimal whlbdsjll = normConfig.getWHLBDSJLL();
+            BigDecimal whlbgzxl = normConfig.getWHLBGZXL();
             BigDecimal whlbnkXxz = normConfig.getWhlbnkXxz();
             BigDecimal whlbSjz = normConfig.getWhlbSjz();
-            if(!Objects.isNull(whlR)){
-                if(!Objects.isNull(whlbnkXxz) && whlR.compareTo(whlbnkXxz) < 0)
+            if(!Objects.isNull(whlbqdsl) && !Objects.isNull(whlbdsjll) && !Objects.isNull(whlbgzxl)){
+                BigDecimal divide = whlbqdsl.multiply(whlbdsjll).multiply(whlbgzxl).divide(jsl, 4, RoundingMode.HALF_UP);
+                if(!Objects.isNull(whlbnkXxz) && divide.compareTo(whlbnkXxz) < 0)
                     System.out.println("外回流比报警级别为 一级");
-                if(!Objects.isNull(whlbSjz) && whlR.compareTo(whlbSjz) > 0)
+                if(!Objects.isNull(whlbSjz) && divide.compareTo(whlbSjz) > 0)
                     System.out.println("外回流比报警级别为 一级");
                 System.out.println("外回流比报警数据正常~~~");
                 System.out.println("--------------14");
@@ -420,7 +430,7 @@ public class WarningController extends BaseController {
             //21 进水碳磷比报警 进水碳磷比=[c]=[BOD_in]/[TP_in]
             BigDecimal jsTp = tXinyiDaily.getJsTp();
             if(!Objects.isNull(jsBod5) && !Objects.isNull(jsTp)){
-                BigDecimal divide = jsTp.divide(jsTp, 4, RoundingMode.HALF_UP);
+                BigDecimal divide = jsBod5.divide(jsTp, 4, RoundingMode.HALF_UP);
                 BigDecimal jstlbNkz = normConfig.getJstlbNkz();
                 if(!Objects.isNull(jstlbNkz)){
                     if(divide.compareTo(jstlbNkz) < 0)
@@ -582,7 +592,6 @@ public class WarningController extends BaseController {
 
             //下面的有疑问  R是计算出来的   单位怎么算
             //29 二沉池表面负荷报警 二沉池表面负荷=[e]=[Q_in]/([n_er]*[A_er])m³/(m²·h)
-            BigDecimal jsl = tXinyiDaily.getJSL();
             BigDecimal eccsl = normConfig.getECCSL();
             BigDecimal eccsjzzj = normConfig.getECCSJZZJ();
             BigDecimal eccbmfhznkzSxz = normConfig.getEccbmfhznkzSxz();
@@ -598,6 +607,7 @@ public class WarningController extends BaseController {
 
             //30 二沉池固体负荷报警
             //   二沉池固体负荷=[f]=(1+[R])*[Q_in]*24*[MLSS]/[n_er]/[A_er]/1000kg/(㎡·d)
+            BigDecimal whlR = tXinyiDaily.getWhlR();
             BigDecimal eccglfhnkzSxz = normConfig.getEccglfhnkzSxz();
             if(!Objects.isNull(whlR) && !Objects.isNull(eccglfhnkzSxz) && !Objects.isNull(jsl)
                 && !Objects.isNull(shcHyOneMlss) && !Objects.isNull(shcHyTwoMlss) && !Objects.isNull(eccsl) && !Objects.isNull(eccsjzzj)){