|
@@ -133,6 +133,9 @@ public class RyTask
|
|
@Autowired
|
|
@Autowired
|
|
private TXinyiCalculateMapper xinyiCalculateMapper;
|
|
private TXinyiCalculateMapper xinyiCalculateMapper;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private TPredictConfMapper tpredictConfMapper;
|
|
|
|
+
|
|
/** 使用的是哪个环境 */
|
|
/** 使用的是哪个环境 */
|
|
@Value("${spring.profiles.active}")
|
|
@Value("${spring.profiles.active}")
|
|
private String environment;
|
|
private String environment;
|
|
@@ -1359,6 +1362,12 @@ public class RyTask
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
log.error("调用跃渊的预测接口出现异常,异常信息为{}", e.getMessage());
|
|
log.error("调用跃渊的预测接口出现异常,异常信息为{}", e.getMessage());
|
|
}
|
|
}
|
|
|
|
+ //2025年02月11日15:48:07 额外记录基地模型预测的值
|
|
|
|
+ try {
|
|
|
|
+ this.updateJDModelPredict(tXinyiForecastComparison);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ log.error("处理 基地模型预测的值的时候出现异常,异常信息为{}", e.getMessage());
|
|
|
|
+ }
|
|
// this.xinyiForecastComparisonService.insertTXinyiForecastComparison(tXinyiForecastComparison);
|
|
// this.xinyiForecastComparisonService.insertTXinyiForecastComparison(tXinyiForecastComparison);
|
|
BigDecimal cscodBzz = normConfig.getCscodBzz();
|
|
BigDecimal cscodBzz = normConfig.getCscodBzz();
|
|
BigDecimal cscodGkz = normConfig.getCscodGkz();
|
|
BigDecimal cscodGkz = normConfig.getCscodGkz();
|
|
@@ -1730,6 +1739,66 @@ public class RyTask
|
|
this.xinyiForecastComparisonService.insertTXinyiForecastComparison(tXinyiForecastComparison);
|
|
this.xinyiForecastComparisonService.insertTXinyiForecastComparison(tXinyiForecastComparison);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private void updateJDModelPredict(TXinyiForecastComparison tXinyiForecastComparison) {
|
|
|
|
+ //现获取基地模型的配置 如果没有执行返回
|
|
|
|
+ TPredictConf tPredictConfReq = new TPredictConf();
|
|
|
|
+ tPredictConfReq.setType(BusinessEnum.JLModelPredictEnum.COD.getCode());
|
|
|
|
+ List<TPredictConf> tPredictConfs = this.tpredictConfMapper.selectTPredictConfList(tPredictConfReq);
|
|
|
|
+ if(CollectionUtils.isEmpty(tPredictConfs)){
|
|
|
|
+ log.error("获取cod机理模型预测参数配置失败,无法处理");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ if(tPredictConfs.size() > 1){
|
|
|
|
+ log.error("获取cod机理模型预测参数配置查询多条配置信息,无法处理");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ //配置的值
|
|
|
|
+ TPredictConf tPredictConf = tPredictConfs.get(0);
|
|
|
|
+ BigDecimal a = Objects.isNull(tPredictConf.getA()) ? BigDecimal.valueOf(30) : tPredictConf.getA();
|
|
|
|
+ BigDecimal b = Objects.isNull(tPredictConf.getB()) ? BigDecimal.valueOf(55.14) : tPredictConf.getB();
|
|
|
|
+ Integer xMin = Objects.isNull(tPredictConf.getxMin()) ? 12 : tPredictConf.getxMin();
|
|
|
|
+ Integer xMax = Objects.isNull(tPredictConf.getxMax()) ? 18 : tPredictConf.getxMax();
|
|
|
|
+ Integer y1Min = Objects.isNull(tPredictConf.getY1Min()) ? 6 : tPredictConf.getY1Min();
|
|
|
|
+ Integer y1Max = Objects.isNull(tPredictConf.getY1Max()) ? 12 : tPredictConf.getY1Max();
|
|
|
|
+ BigDecimal x1 = Objects.isNull(tPredictConf.getX1()) ? BigDecimal.valueOf(91.85) : tPredictConf.getX1();
|
|
|
|
+ //计算第一个值逻辑处理
|
|
|
|
+ //计算X的值
|
|
|
|
+ Date nowDate = DateUtils.getNowDate();
|
|
|
|
+ BigDecimal x = this.xinyiIndustryMapper.getAvgJSCodByDate(DateUtil.format(DateUtils.plusDate(-xMax, nowDate), DateUtils.YYYYMMDDHH_TS), DateUtil.format(DateUtils.plusDate(-xMin, nowDate), DateUtils.YYYYMMDDHH_TS));
|
|
|
|
+ //计算y1
|
|
|
|
+ BigDecimal y1 = this.xinyiIndustryMapper.getAvgCSCodByDate(DateUtil.format(DateUtils.plusDate(-y1Max, nowDate), DateUtils.YYYYMMDDHH_TS), DateUtil.format(DateUtils.plusDate(-y1Min, nowDate), DateUtils.YYYYMMDDHH_TS));
|
|
|
|
+ if(x.compareTo(x1) <= 0){//直接用 当前时间前12小时-6小时的出水COD均值 (时间段位配置的值)
|
|
|
|
+ tXinyiForecastComparison.setJlForecastOne(y1);
|
|
|
|
+ }else{//按照公式计算
|
|
|
|
+ tXinyiForecastComparison.setJlForecastOne(y1.add(a.multiply(x.subtract(x1).divide(b,NUMBER_SCALE_2, RoundingMode.HALF_UP))));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //计算第二个值逻辑处理
|
|
|
|
+ //计算X的值
|
|
|
|
+ nowDate = DateUtils.plusHour(1, nowDate);
|
|
|
|
+ x = this.xinyiIndustryMapper.getAvgJSCodByDate(DateUtil.format(DateUtils.plusDate(-xMax, nowDate), DateUtils.YYYYMMDDHH_TS), DateUtil.format(DateUtils.plusDate(-xMin, nowDate), DateUtils.YYYYMMDDHH_TS));
|
|
|
|
+ //计算y1
|
|
|
|
+ y1 = this.xinyiIndustryMapper.getAvgCSCodByDate(DateUtil.format(DateUtils.plusDate(-y1Max, nowDate), DateUtils.YYYYMMDDHH_TS), DateUtil.format(DateUtils.plusDate(-y1Min, nowDate), DateUtils.YYYYMMDDHH_TS));
|
|
|
|
+ if(x.compareTo(x1) <= 0){//直接用 当前时间前12小时-6小时的出水COD均值 (时间段位配置的值)
|
|
|
|
+ tXinyiForecastComparison.setJlForecastTwo(y1);
|
|
|
|
+ }else{//按照公式计算
|
|
|
|
+ tXinyiForecastComparison.setJlForecastTwo(y1.add(a.multiply(x.subtract(x1).divide(b,NUMBER_SCALE_2, RoundingMode.HALF_UP))));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ //计算第三个值逻辑处理
|
|
|
|
+ //计算X的值
|
|
|
|
+ nowDate = DateUtils.plusHour(1, nowDate);
|
|
|
|
+ x = this.xinyiIndustryMapper.getAvgJSCodByDate(DateUtil.format(DateUtils.plusDate(-xMax, nowDate), DateUtils.YYYYMMDDHH_TS), DateUtil.format(DateUtils.plusDate(-xMin, nowDate), DateUtils.YYYYMMDDHH_TS));
|
|
|
|
+ //计算y1
|
|
|
|
+ y1 = this.xinyiIndustryMapper.getAvgCSCodByDate(DateUtil.format(DateUtils.plusDate(-y1Max, nowDate), DateUtils.YYYYMMDDHH_TS), DateUtil.format(DateUtils.plusDate(-y1Min, nowDate), DateUtils.YYYYMMDDHH_TS));
|
|
|
|
+ if(x.compareTo(x1) <= 0){//直接用 当前时间前12小时-6小时的出水COD均值 (时间段位配置的值)
|
|
|
|
+ tXinyiForecastComparison.setJlForecastThree(y1);
|
|
|
|
+ }else{//按照公式计算
|
|
|
|
+ tXinyiForecastComparison.setJlForecastThree(y1.add(a.multiply(x.subtract(x1).divide(b,NUMBER_SCALE_2, RoundingMode.HALF_UP))));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
public void handleXinYiWarningsYC(BigDecimal csBzz, String[] split, BigDecimal csGkz, String category, String hour, TXinyiNormConfig normConfig, BigDecimal currentVal, TXinyiIndustry tXinyiIndustry, List<ChartBasic> chartsDataList, String date) {
|
|
public void handleXinYiWarningsYC(BigDecimal csBzz, String[] split, BigDecimal csGkz, String category, String hour, TXinyiNormConfig normConfig, BigDecimal currentVal, TXinyiIndustry tXinyiIndustry, List<ChartBasic> chartsDataList, String date) {
|
|
BigDecimal multiply = csBzz.multiply(new BigDecimal(MyConstants.SCALE_VALUE));
|
|
BigDecimal multiply = csBzz.multiply(new BigDecimal(MyConstants.SCALE_VALUE));
|
|
TXinyiWarningRecord tXinyiWarningRecord = null;
|
|
TXinyiWarningRecord tXinyiWarningRecord = null;
|