Przeglądaj źródła

Merge branch 'master' of ssh://gitlab.fuxicarbon.com:1111/hongshan/big-model-java

sunxiao 8 miesięcy temu
rodzic
commit
942162446d

+ 1 - 0
slibra-common/src/main/java/com/slibra/common/constant/MyConstants.java

@@ -267,6 +267,7 @@ public class MyConstants {
 
     public static void main(String[] args) {
         System.out.println(DecimalUtils.getAbsAndScale(new BigDecimal("2.211"), MyConstants.INT_0));
+        System.out.println(DecimalUtils.getAbsAndScaleStr("2.211", MyConstants.INT_0));
     }
 
 }

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

@@ -39,13 +39,13 @@ public class BusinessEnum {
         HYQDO_ONE("好氧区DO#1", "好氧区DO#1"),
         HYQDO_TWO("好氧区DO#2", "好氧区DO#2"),
         QSB("气水比", "气水比"),
-        CS_COD_YC("cod", "cod"),
-        CS_SS_YC("ss", "ss"),
+        CS_COD_YC("出水COD", "出水COD"),
+        CS_SS_YC("出水SS", "出水SS"),
         CS_TN_YC("出水总氮", "出水总氮"),
         CS_TP_YC("二沉池正磷酸盐", "二沉池正磷酸盐 "),
-        CS_AD_YC("氨氮", "氨氮"),
-        CS_XSY_1_YC("#1好氧硝酸盐", "#1好氧硝酸盐"),
-        CS_XSY_2_YC("#2好氧硝酸盐", "#2好氧硝酸盐"),
+        CS_AD_YC("出水氨氮", "出水氨氮"),
+        CS_XSY_1_YC("1好氧硝酸盐", "1好氧硝酸盐"),
+        CS_XSY_2_YC("2好氧硝酸盐", "2好氧硝酸盐"),
         WNND_MLSS_1("污泥浓度MLSS#1", "污泥浓度MLSS#1"),
         WNND_MLSS_2("污泥浓度MLSS#2", "污泥浓度MLSS#2"),
         HFXWNNDZB("挥发性污泥浓度占比(MLVSS/MLSS)", "挥发性污泥浓度占比(MLVSS/MLSS)"),

+ 33 - 2
slibra-quartz/src/main/java/com/slibra/quartz/task/AsyncTask.java

@@ -1046,8 +1046,11 @@ public class AsyncTask {
                 }
             }
         }else{//有新的告警信息
+            Date nowDate = DateUtils.getNowDate();
             if(CollectionUtils.isEmpty(tXinyiWarningRecords)){//之前没有告警记录
                 //保存到数据库中
+                //2024年7月15日11:06:16 因为只有一个告警记录,但是如果一直报警,现在报警时间取的是更新时间,兼容第一次报警处理
+                tXinyiWarningRecord.setUpdateTime(nowDate);
                 this.xinyiWarningRecordMapper.insertTXinyiWarningRecord(tXinyiWarningRecord);
                 if(WARNING_LEVEL_NO_DATE.equals(tXinyiWarningRecord.getLevel())){
                     //只保存一个普通的问答记录 不需要调用决策信息,但是实时数据还是要记录的
@@ -1063,6 +1066,17 @@ public class AsyncTask {
                         //只保存一个普通的问答记录 不需要调用决策信息,但是实时数据还是要记录的
                         this.addChatRecordByDeviceErr(tXinyiWarningRecord, tXinyiIndustry, normConfig);
                     }else {
+                        //2024年7月5日10:45:24 逻辑调整:更新一直报警的那条记录的显示值
+                        xinyiWarningRecord.setWarningVal(tXinyiWarningRecord.getWarningVal());
+//                        xinyiWarningRecord.setDesignVal(tXinyiWarningRecord.getDesignVal());
+//                        tXinyiWarningRecord.setControlVal(tXinyiWarningRecord.getControlVal());
+                        xinyiWarningRecord.setTime(tXinyiWarningRecord.getTime());
+                        xinyiWarningRecord.setUpdateTime(nowDate);
+                        xinyiWarningRecord.setUpdateBy(WARNING_DEFAULT_CREATE);
+                        //2024年7月15日11:07:33 报警的级别也要重新计算并更新
+                        xinyiWarningRecord.setLevel(tXinyiWarningRecord.getLevel());
+                        //更新数据库
+                        this.xinyiWarningRecordMapper.updateTXinyiWarningRecord(xinyiWarningRecord);
                         //继续调用决策(普通问答)
                         this.askBigModelForSHWarning(xinyiWarningRecord, tXinyiIndustry, normConfig, unit);
                     }
@@ -1486,6 +1500,7 @@ public class AsyncTask {
         Date warningTime = tXinyiWarningRecord.getTime();
         String remark = tXinyiWarningRecord.getRemark();
         int count = DateUtils.differentHoursByMillisecond(warningTime, DateUtils.getNowDate()) + 1;
+        String category = tXinyiWarningRecord.getCategory();
         /*basic.put("title", tXinyiWarningRecord.getReason());
         basic.put("报警时间", DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM ,warningTime));
         basic.put("报警值", tXinyiWarningRecord.getWarningVal());
@@ -1500,7 +1515,11 @@ public class AsyncTask {
 //        basic.put("管控值", tXinyiWarningRecord.getControlVal());
         basic.put("告警级别", tXinyiWarningRecord.getLevel());*/
         //2024年6月25日16:00:18 进出水展示的不一样
-        if(tXinyiWarningRecord.getCategory().contains("出水")){//出水的展示
+        //2024年7月15日10:57:31 因为新增了化验室的3个指标,也是出水数据
+        if(category.contains("出水")
+            || ROBOT_ECCZLSY.getCode().equalsIgnoreCase(category)
+                || ROBOT_XSY_2.getCode().equalsIgnoreCase(category)
+                    || ROBOT_XSY_1.getCode().equalsIgnoreCase(category)){//出水的展示
             ShowValueCSBasic showValueCSBasic = new ShowValueCSBasic();
             if("0".equals(remark)){//水质报警
                 showValueCSBasic.setH("在线仪表");
@@ -1692,6 +1711,8 @@ public class AsyncTask {
             Date nowDate = DateUtils.getNowDate();
             if(CollectionUtils.isEmpty(tXinyiWarningRecords)){//之前没有告警记录
                 //保存到数据库中
+                //2024年7月15日11:06:16 因为只有一个告警记录,但是如果一直报警,现在报警时间取的是更新时间,兼容第一次报警处理
+                tXinyiWarningRecord.setUpdateTime(nowDate);
                 this.xinyiWarningRecordMapper.insertTXinyiWarningRecord(tXinyiWarningRecord);
                 if(WARNING_LEVEL_NO_DATE.equals(tXinyiWarningRecord.getLevel())){
                     //只保存一个普通的问答记录 不需要调用决策信息,但是实时数据还是要记录的
@@ -1714,6 +1735,8 @@ public class AsyncTask {
                         xinyiWarningRecord.setTime(tXinyiWarningRecord.getTime());
                         xinyiWarningRecord.setUpdateTime(nowDate);
                         xinyiWarningRecord.setUpdateBy(WARNING_DEFAULT_CREATE);
+                        //2024年7月15日11:07:33 报警的级别也要重新计算并更新
+                        xinyiWarningRecord.setLevel(tXinyiWarningRecord.getLevel());
                         //更新数据库
                         this.xinyiWarningRecordMapper.updateTXinyiWarningRecord(xinyiWarningRecord);
                         //继续调用决策
@@ -1786,6 +1809,8 @@ public class AsyncTask {
             Date nowDate = DateUtils.getNowDate();
             if(CollectionUtils.isEmpty(tXinyiWarningRecords)){//之前没有告警记录
                 //保存到数据库中
+                //2024年7月15日11:06:16 因为只有一个告警记录,但是如果一直报警,现在报警时间取的是更新时间,兼容第一次报警处理
+                tXinyiWarningRecord.setUpdateTime(nowDate);
                 this.xinyiWarningRecordMapper.insertTXinyiWarningRecord(tXinyiWarningRecord);
                 if(WARNING_LEVEL_NO_DATE.equals(tXinyiWarningRecord.getLevel())){
                     //只保存一个普通的问答记录 不需要调用决策信息,但是实时数据还是要记录的
@@ -1808,6 +1833,8 @@ public class AsyncTask {
                         xinyiWarningRecord.setTime(tXinyiWarningRecord.getTime());
                         xinyiWarningRecord.setUpdateTime(nowDate);
                         xinyiWarningRecord.setUpdateBy(WARNING_DEFAULT_CREATE);
+                        //2024年7月15日11:07:33 报警的级别也要重新计算并更新
+                        xinyiWarningRecord.setLevel(tXinyiWarningRecord.getLevel());
                         //更新数据库
                         this.xinyiWarningRecordMapper.updateTXinyiWarningRecord(xinyiWarningRecord);
                         //继续调用决策
@@ -1905,7 +1932,7 @@ public class AsyncTask {
                 BigDecimal cszlBzz = normConfig.getCszlBzz();
                 BigDecimal cszlGkz = normConfig.getCszlGkz();
                 if(!Objects.isNull(cszlBzz)){
-                    handleXinYiWarningsRobot(cszlBzz, csTp, cszlGkz, BusinessEnum.WarningCategoryEnum.ROBOT_ECCZLSY.getCode(), tXinyiIndustry, normConfig);
+                    handleXinYiWarningsRobot(cszlBzz, csTp, cszlGkz, ROBOT_ECCZLSY.getCode(), tXinyiIndustry, normConfig);
                 }
             }
 
@@ -1974,6 +2001,8 @@ public class AsyncTask {
             Date nowDate = DateUtils.getNowDate();
             if(CollectionUtils.isEmpty(tXinyiWarningRecords)){//之前没有告警记录
                 //保存到数据库中
+                //2024年7月15日11:06:16 因为只有一个告警记录,但是如果一直报警,现在报警时间取的是更新时间,兼容第一次报警处理
+                tXinyiWarningRecord.setUpdateTime(nowDate);
                 this.xinyiWarningRecordMapper.insertTXinyiWarningRecord(tXinyiWarningRecord);
                 if(WARNING_LEVEL_NO_DATE.equals(tXinyiWarningRecord.getLevel())){
                     //只保存一个普通的问答记录 不需要调用决策信息,但是实时数据还是要记录的
@@ -1996,6 +2025,8 @@ public class AsyncTask {
                         xinyiWarningRecord.setTime(tXinyiWarningRecord.getTime());
                         xinyiWarningRecord.setUpdateTime(nowDate);
                         xinyiWarningRecord.setUpdateBy(WARNING_DEFAULT_CREATE);
+                        //2024年7月15日11:07:33 报警的级别也要重新计算并更新
+                        xinyiWarningRecord.setLevel(tXinyiWarningRecord.getLevel());
                         //更新数据库
                         this.xinyiWarningRecordMapper.updateTXinyiWarningRecord(xinyiWarningRecord);
                         //继续调用决策

+ 28 - 37
slibra-quartz/src/main/java/com/slibra/quartz/task/RyTask.java

@@ -940,7 +940,7 @@ public class RyTask
         //获取最新的工业库的数据
         TXinyiIndustry tXinyiIndustry = this.xinyiIndustryMapper.selectTXinyiIndustryNewest();
         List<ChartBasic> chartsDataList = new ArrayList<>(9);
-        if("cod".equals(task)){
+        if(BusinessEnum.BigModelForecastEnum.COD.getCode().equals(task)){
             //同时调用跃渊的预测接口 保存记录值
             try {
                 String result = HttpUtil.get("http://10.0.3.52:10003/system/forecast?type=2&time=" + DateUtil.format(DateUtils.getNowDate(), DateUtils.YYYY_MM_DD_HH), INT_10000);
@@ -961,31 +961,18 @@ public class RyTask
                 TXinyiIndustry tXinyiIndustryTemp = tXinyiIndustries6.get(5 - i);
                 ChartBasic chartBasic = new ChartBasic();
                 chartBasic.setTime(tXinyiIndustryTemp.getTestHour().substring(11));
-                //2024年6月25日10:10:38 bug修改,需要判断类型赋不同的值
-                if(BusinessEnum.BigModelForecastEnum.TN.getCode().equalsIgnoreCase(category)
-                    || BusinessEnum.BigModelForecastEnum.XSY1.getCode().equalsIgnoreCase(category)
-                        || BusinessEnum.BigModelForecastEnum.XSY2.getCode().equalsIgnoreCase(category))
-                    chartBasic.setVal(DecimalUtils.getAbsAndScale(tXinyiIndustryTemp.getCsTn(), INT_2));
-                if(BusinessEnum.BigModelForecastEnum.COD.getCode().equalsIgnoreCase(category))
-                    chartBasic.setVal(DecimalUtils.getAbsAndScale(tXinyiIndustryTemp.getCsCod(), INT_2));
-                if(BusinessEnum.BigModelForecastEnum.SS.getCode().equalsIgnoreCase(category))
-                    chartBasic.setVal(DecimalUtils.getAbsAndScale(tXinyiIndustryTemp.getCsSs(), INT_2));
-                if(BusinessEnum.BigModelForecastEnum.TP.getCode().equalsIgnoreCase(category)
-                    || BusinessEnum.BigModelForecastEnum.ZLSY.getCode().equalsIgnoreCase(category))
-                    chartBasic.setVal(DecimalUtils.getAbsAndScale(tXinyiIndustryTemp.getCsTp(), INT_2));
-                if(BusinessEnum.BigModelForecastEnum.NH3.getCode().equalsIgnoreCase(category))
-                    chartBasic.setVal(DecimalUtils.getAbsAndScale(tXinyiIndustryTemp.getCsNh3(), INT_2));
+                chartBasic.setVal(DecimalUtils.getAbsAndScale(tXinyiIndustryTemp.getCsCod(), INT_2));
                 chartsDataList.add(chartBasic);
             }
             for (int i = 0; i < split.length; i++) {
                 String val = split[i];
                 ChartBasic chartBasic = new ChartBasic();
                 chartBasic.setTime(hours[i]);
-                chartBasic.setVal(new BigDecimal(val));
+                chartBasic.setVal(DecimalUtils.getAbsAndScale(new BigDecimal(val), INT_2));
                 chartsDataList.add(chartBasic);
             }
             handleXinYiWarningsYC(cscodBzz, split, cscodGkz, BusinessEnum.WarningCategoryEnum.CS_COD_YC.getCode(), hour, normConfig,tXinyiIndustry.getCsCod(), tXinyiIndustry, chartsDataList, date);
-        }else if("ss".equals(task)){
+        }else if(BusinessEnum.BigModelForecastEnum.SS.getCode().equals(task)){
             //同时调用跃渊的预测接口 保存记录值
             try {
                 String result = HttpUtil.get("http://10.0.3.52:10003/system/forecast?type=5&time=" + DateUtil.format(DateUtils.getNowDate(), DateUtils.YYYY_MM_DD_HH), INT_10000);
@@ -1006,18 +993,18 @@ public class RyTask
                 TXinyiIndustry tXinyiIndustryTemp = tXinyiIndustries6.get(5 - i);
                 ChartBasic chartBasic = new ChartBasic();
                 chartBasic.setTime(tXinyiIndustryTemp.getTestHour().substring(11));
-                chartBasic.setVal(tXinyiIndustryTemp.getCsSs());
+                chartBasic.setVal(DecimalUtils.getAbsAndScale(tXinyiIndustryTemp.getCsSs(), INT_2));
                 chartsDataList.add(chartBasic);
             }
             for (int i = 0; i < split.length; i++) {
                 String val = split[i];
                 ChartBasic chartBasic = new ChartBasic();
                 chartBasic.setTime(hours[i]);
-                chartBasic.setVal(new BigDecimal(val));
+                chartBasic.setVal(DecimalUtils.getAbsAndScale(new BigDecimal(val), INT_2));
                 chartsDataList.add(chartBasic);
             }
             handleXinYiWarningsYC(csSSBzz, split, csssGkz, BusinessEnum.WarningCategoryEnum.CS_SS_YC.getCode(), hour, normConfig,tXinyiIndustry.getCsSs(), tXinyiIndustry, chartsDataList, date);
-        }/*else if("tn".equals(task)){
+        }/*else if(BusinessEnum.BigModelForecastEnum.TN.getCode().equals(task)){
             //同时调用跃渊的预测接口 保存记录值
             try {
                 String result = HttpUtil.get("http://10.0.3.52:10003/system/forecast?type=3&time=" + DateUtil.format(DateUtils.getNowDate(), DateUtils.YYYY_MM_DD_HH), INT_10);
@@ -1038,18 +1025,18 @@ public class RyTask
                 TXinyiIndustry tXinyiIndustryTemp = tXinyiIndustries6.get(5 - i);
                 ChartBasic chartBasic = new ChartBasic();
                 chartBasic.setTime(tXinyiIndustryTemp.getTestHour().substring(11));
-                chartBasic.setVal(tXinyiIndustryTemp.getCsTn());
+                chartBasic.setVal(DecimalUtils.getAbsAndScale(tXinyiIndustryTemp.getCsTn(), INT_2));
                 chartsDataList.add(chartBasic);
             }
             for (int i = 0; i < split.length; i++) {
                 String val = split[i];
                 ChartBasic chartBasic = new ChartBasic();
                 chartBasic.setTime(hours[i]);
-                chartBasic.setVal(new BigDecimal(val));
+                chartBasic.setVal(DecimalUtils.getAbsAndScale(new BigDecimal(val), INT_2));
                 chartsDataList.add(chartBasic);
             }
             handleXinYiWarningsYC(cszzBzz, split, cszzGkz, BusinessEnum.WarningCategoryEnum.CS_TN_YC.getCode(), hour, normConfig,tXinyiIndustry.getCsCod(), tXinyiIndustry, chartsDataList, date);
-        }*/else if("tp".equals(task)){
+        }*/else if(BusinessEnum.BigModelForecastEnum.TP.getCode().equals(task)){
             //同时调用跃渊的预测接口 保存记录值
             try {
                 String result = HttpUtil.get("http://10.0.3.52:10003/system/forecast?type=1&time=" + DateUtil.format(DateUtils.getNowDate(), DateUtils.YYYY_MM_DD_HH), INT_10000);
@@ -1066,22 +1053,22 @@ public class RyTask
             BigDecimal cszlBzz = normConfig.getCszlBzz();
             BigDecimal cszlGkz = normConfig.getCszlGkz();
             //处理展示数据
-            for (int i = 0; i < tXinyiIndustries6.size(); i++) {
-                TXinyiIndustry tXinyiIndustryTemp = tXinyiIndustries6.get(5 - i);
+            for (int i = 0; i < tXinyiRobots6.size(); i++) {
+                TXinyiRobot tXinyiRobotTemp = tXinyiRobots6.get(5 - i);
                 ChartBasic chartBasic = new ChartBasic();
-                chartBasic.setTime(tXinyiIndustryTemp.getTestHour().substring(11));
-                chartBasic.setVal(tXinyiIndustryTemp.getCsTp());
+                chartBasic.setTime(tXinyiRobotTemp.getTestHour().substring(11));
+                chartBasic.setVal(DecimalUtils.getAbsAndScale(tXinyiRobotTemp.getTpRccJqr(), INT_2));
                 chartsDataList.add(chartBasic);
             }
             for (int i = 0; i < split.length; i++) {
                 String val = split[i];
                 ChartBasic chartBasic = new ChartBasic();
                 chartBasic.setTime(hours[i]);
-                chartBasic.setVal(new BigDecimal(val));
+                chartBasic.setVal(DecimalUtils.getAbsAndScale(new BigDecimal(val), INT_2));
                 chartsDataList.add(chartBasic);
             }
             handleXinYiWarningsYC(cszlBzz, split, cszlGkz, BusinessEnum.WarningCategoryEnum.CS_TP_YC.getCode(), hour, normConfig,tXinyiIndustry.getCsTp(), tXinyiIndustry, chartsDataList, date);
-        }else if("nh3".equals(task)){
+        }else if(BusinessEnum.BigModelForecastEnum.NH3.getCode().equals(task)){
             //同时调用跃渊的预测接口 保存记录值
             try {
                 String result = HttpUtil.get("http://10.0.3.52:10003/system/forecast?type=4&time=" + DateUtil.format(DateUtils.getNowDate(), DateUtils.YYYY_MM_DD_HH), INT_10000);
@@ -1102,18 +1089,18 @@ public class RyTask
                 TXinyiIndustry tXinyiIndustryTemp = tXinyiIndustries6.get(5 - i);
                 ChartBasic chartBasic = new ChartBasic();
                 chartBasic.setTime(tXinyiIndustryTemp.getTestHour().substring(11));
-                chartBasic.setVal(tXinyiIndustryTemp.getCsNh3());
+                chartBasic.setVal(DecimalUtils.getAbsAndScale(tXinyiIndustryTemp.getCsNh3(), INT_2));
                 chartsDataList.add(chartBasic);
             }
             for (int i = 0; i < split.length; i++) {
                 String val = split[i];
                 ChartBasic chartBasic = new ChartBasic();
                 chartBasic.setTime(hours[i]);
-                chartBasic.setVal(new BigDecimal(val));
+                chartBasic.setVal(DecimalUtils.getAbsAndScale(new BigDecimal(val), INT_2));
                 chartsDataList.add(chartBasic);
             }
             handleXinYiWarningsYC(csadBzz, split, csadGkz, BusinessEnum.WarningCategoryEnum.CS_AD_YC.getCode(), hour, normConfig,tXinyiIndustry.getCsNh3(), tXinyiIndustry, chartsDataList, date);
-        }else if("xsy1".equals(task)){
+        }else if(BusinessEnum.BigModelForecastEnum.XSY1.getCode().equals(task)){
             //2024年6月21日14:57:02 红杉的出水总氮预测改成 不用工业库的,用化验科的两个xsy 相关指标
             //同时调用跃渊的预测接口 保存记录值
             try {
@@ -1138,18 +1125,18 @@ public class RyTask
                 TXinyiRobot tXinyiRobotTemp = tXinyiRobots6.get(5 - i);
                 ChartBasic chartBasic = new ChartBasic();
                 chartBasic.setTime(tXinyiRobotTemp.getTestHour().substring(11));
-                chartBasic.setVal(tXinyiRobotTemp.getNo3Hlj1Jqr());
+                chartBasic.setVal(DecimalUtils.getAbsAndScale(tXinyiRobotTemp.getNo3Hlj1Jqr(), INT_2));
                 chartsDataList.add(chartBasic);
             }
             for (int i = 0; i < split.length; i++) {
                 String val = split[i];
                 ChartBasic chartBasic = new ChartBasic();
                 chartBasic.setTime(hours[i]);
-                chartBasic.setVal(new BigDecimal(val));
+                chartBasic.setVal(DecimalUtils.getAbsAndScale(new BigDecimal(val), INT_2));
                 chartsDataList.add(chartBasic);
             }
             handleXinYiWarningsYC(cszzBzz, split, cszzGkz, BusinessEnum.WarningCategoryEnum.CS_XSY_1_YC.getCode(), hour, normConfig,tXinyiIndustry.getCsCod(), tXinyiIndustry, chartsDataList, date);
-        }else if("xsy2".equals(task)){
+        }else if(BusinessEnum.BigModelForecastEnum.XSY2.getCode().equals(task)){
             //同时调用跃渊的预测接口 保存记录值
             try {
                 String result = HttpUtil.get("http://10.0.3.52:10003/system/forecast?type=3&time=" + DateUtil.format(DateUtils.getNowDate(), DateUtils.YYYY_MM_DD_HH), INT_10000);
@@ -1173,14 +1160,14 @@ public class RyTask
                 TXinyiRobot tXinyiRobotTemp = tXinyiRobots6.get(5 - i);
                 ChartBasic chartBasic = new ChartBasic();
                 chartBasic.setTime(tXinyiRobotTemp.getTestHour().substring(11));
-                chartBasic.setVal(tXinyiRobotTemp.getNo3Hlj2Jqr());
+                chartBasic.setVal(DecimalUtils.getAbsAndScale(tXinyiRobotTemp.getNo3Hlj2Jqr(), INT_2));
                 chartsDataList.add(chartBasic);
             }
             for (int i = 0; i < split.length; i++) {
                 String val = split[i];
                 ChartBasic chartBasic = new ChartBasic();
                 chartBasic.setTime(hours[i]);
-                chartBasic.setVal(new BigDecimal(val));
+                chartBasic.setVal(DecimalUtils.getAbsAndScale(new BigDecimal(val), INT_2));
                 chartsDataList.add(chartBasic);
             }
             handleXinYiWarningsYC(cszzBzz, split, cszzGkz, BusinessEnum.WarningCategoryEnum.CS_XSY_2_YC.getCode(), hour, normConfig,tXinyiIndustry.getCsCod(), tXinyiIndustry, chartsDataList, date);
@@ -1265,6 +1252,8 @@ public class RyTask
             //2024年6月27日10:45:49  列表的预警时间和showval里的预警时间保持一致(用同一个,否则可能有一分钟左右的误差)
             Date nowDate = DateUtils.getNowDate();
             if(CollectionUtils.isEmpty(tXinyiWarningRecords)){//之前没有告警记录
+                //2024年7月15日11:06:16 因为只有一个告警记录,但是如果一直报警,现在报警时间取的是更新时间,兼容第一次报警处理
+                tXinyiWarningRecord.setUpdateTime(nowDate);
                 //保存到数据库中
                 this.xinyiWarningRecordMapper.insertTXinyiWarningRecord(tXinyiWarningRecord);
                 if(WARNING_LEVEL_NO_DATE.equals(tXinyiWarningRecord.getLevel())){
@@ -1291,6 +1280,8 @@ public class RyTask
                         xinyiWarningRecord.setTime(tXinyiWarningRecord.getTime());
                         xinyiWarningRecord.setUpdateTime(nowDate);
                         xinyiWarningRecord.setUpdateBy(WARNING_DEFAULT_CREATE);
+                        //2024年7月15日11:07:33 报警的级别也要重新计算并更新
+                        xinyiWarningRecord.setLevel(tXinyiWarningRecord.getLevel());
                         //更新数据库
                         this.xinyiWarningRecordMapper.updateTXinyiWarningRecord(xinyiWarningRecord);
                         //继续调用决策