|
@@ -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);
|
|
|
//继续调用决策
|