|
@@ -442,7 +442,6 @@ public class AsyncTask {
|
|
|
/**
|
|
|
* 额外计算一下预测的准确度
|
|
|
* @param tXinyiRobot
|
|
|
- * todo xxxxx
|
|
|
*/
|
|
|
public void updateForecastComparisonByRobot(TXinyiRobot tXinyiRobot) {
|
|
|
BigDecimal no3Hlj1Jqr = tXinyiRobot.getNo3Hlj1Jqr();
|
|
@@ -451,15 +450,16 @@ public class AsyncTask {
|
|
|
|
|
|
BigDecimal tpRccJqr = tXinyiRobot.getTpRccJqr();
|
|
|
BigDecimal csTp = null;
|
|
|
- BigDecimal csTn = null;
|
|
|
+// BigDecimal csTn = null;
|
|
|
if(!Objects.isNull(tpRccJqr)){
|
|
|
csTp = tpRccJqr.divide(ROBOT_HY_DIVIDE, NUMBER_SCALE_4, RoundingMode.HALF_UP);
|
|
|
//2024年6月20日13:44:26 先不计算,结果会更准确
|
|
|
//2024年6月21日14:23:14 就是要 除以0.8
|
|
|
// csTp = tpRccJqr;
|
|
|
}
|
|
|
- if(!Objects.isNull(no3Hlj1Jqr) && !Objects.isNull(no3Hlj2Jqr))
|
|
|
- csTn = (no3Hlj1Jqr.add(no3Hlj2Jqr)).divide(DECIMAL_2, NUMBER_SCALE_4, RoundingMode.HALF_UP).divide(ROBOT_HY_DIVIDE, NUMBER_SCALE_4, RoundingMode.HALF_UP);
|
|
|
+ //2024年7月12日16:29:00 需要单独计算了 csTn不再合并,分别从两个池子获取。。。
|
|
|
+// if(!Objects.isNull(no3Hlj1Jqr) && !Objects.isNull(no3Hlj2Jqr))
|
|
|
+// csTn = (no3Hlj1Jqr.add(no3Hlj2Jqr)).divide(DECIMAL_2, NUMBER_SCALE_4, RoundingMode.HALF_UP).divide(ROBOT_HY_DIVIDE, NUMBER_SCALE_4, RoundingMode.HALF_UP);
|
|
|
|
|
|
//时间段1
|
|
|
List<TXinyiForecastComparison> tXinyiForecastComparisons1 = this.xinyiForecastComparisonMapper.selectTXinyiForecastComparisonList(TXinyiForecastComparison.builder().forecastTimeOne(testHour).build());
|
|
@@ -488,18 +488,34 @@ public class AsyncTask {
|
|
|
//2024年6月21日17:04:01 总氮的真实值也从化验室获取
|
|
|
//2024年7月12日10:31:29 tn又改成xsy1和xsy2了。。。
|
|
|
if(BusinessEnum.BigModelForecastEnum.TN.getCode().equalsIgnoreCase(tXinyiForecastComparison.getCategory())
|
|
|
- || BusinessEnum.BigModelForecastEnum.XSY1.getCode().equalsIgnoreCase(tXinyiForecastComparison.getCategory())
|
|
|
+ || BusinessEnum.BigModelForecastEnum.XSY1.getCode().equalsIgnoreCase(tXinyiForecastComparison.getCategory())){
|
|
|
+ tXinyiForecastComparison.setRealOne(no3Hlj1Jqr);
|
|
|
+ if(!Objects.isNull(no3Hlj1Jqr) && no3Hlj1Jqr.compareTo(BigDecimal.ZERO) > 0){
|
|
|
+ if(!Objects.isNull(hsForecastOne)){
|
|
|
+ BigDecimal subtract = no3Hlj1Jqr.subtract(hsForecastOne);
|
|
|
+ tXinyiForecastComparison.setHsErrorRateOne((subtract).divide(no3Hlj1Jqr, NUMBER_SCALE_4, RoundingMode.HALF_UP));
|
|
|
+ tXinyiForecastComparison.setHsOneSubtract(DecimalUtils.getAbsAndScale(subtract, INT_2));
|
|
|
+ }
|
|
|
+ if(!Objects.isNull(yyForecastOne)){
|
|
|
+ BigDecimal subtract = no3Hlj1Jqr.subtract(yyForecastOne);
|
|
|
+ tXinyiForecastComparison.setYyErrorRateOne((subtract).divide(no3Hlj1Jqr, NUMBER_SCALE_4, RoundingMode.HALF_UP));
|
|
|
+ tXinyiForecastComparison.setYyOneSubtract(DecimalUtils.getAbsAndScale(subtract, INT_2));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(BusinessEnum.BigModelForecastEnum.TN.getCode().equalsIgnoreCase(tXinyiForecastComparison.getCategory())
|
|
|
|| BusinessEnum.BigModelForecastEnum.XSY2.getCode().equalsIgnoreCase(tXinyiForecastComparison.getCategory())){
|
|
|
- tXinyiForecastComparison.setRealOne(csTn);
|
|
|
- if(!Objects.isNull(csTn) && csTn.compareTo(BigDecimal.ZERO) > 0){
|
|
|
+ tXinyiForecastComparison.setRealOne(no3Hlj2Jqr);
|
|
|
+ if(!Objects.isNull(no3Hlj2Jqr) && no3Hlj2Jqr.compareTo(BigDecimal.ZERO) > 0){
|
|
|
if(!Objects.isNull(hsForecastOne)){
|
|
|
- BigDecimal subtract = csTn.subtract(hsForecastOne);
|
|
|
- tXinyiForecastComparison.setHsErrorRateOne((subtract).divide(csTn, NUMBER_SCALE_4, RoundingMode.HALF_UP));
|
|
|
+ BigDecimal subtract = no3Hlj2Jqr.subtract(hsForecastOne);
|
|
|
+ tXinyiForecastComparison.setHsErrorRateOne((subtract).divide(no3Hlj2Jqr, NUMBER_SCALE_4, RoundingMode.HALF_UP));
|
|
|
tXinyiForecastComparison.setHsOneSubtract(DecimalUtils.getAbsAndScale(subtract, INT_2));
|
|
|
}
|
|
|
if(!Objects.isNull(yyForecastOne)){
|
|
|
- BigDecimal subtract = csTn.subtract(yyForecastOne);
|
|
|
- tXinyiForecastComparison.setYyErrorRateOne((subtract).divide(csTn, NUMBER_SCALE_4, RoundingMode.HALF_UP));
|
|
|
+ BigDecimal subtract = no3Hlj2Jqr.subtract(yyForecastOne);
|
|
|
+ tXinyiForecastComparison.setYyErrorRateOne((subtract).divide(no3Hlj2Jqr, NUMBER_SCALE_4, RoundingMode.HALF_UP));
|
|
|
tXinyiForecastComparison.setYyOneSubtract(DecimalUtils.getAbsAndScale(subtract, INT_2));
|
|
|
}
|
|
|
}
|
|
@@ -553,18 +569,34 @@ public class AsyncTask {
|
|
|
//2024年6月21日17:04:01 总氮的真实值也从化验室获取
|
|
|
//2024年7月12日10:31:29 tn又改成xsy1和xsy2了。。。
|
|
|
if(BusinessEnum.BigModelForecastEnum.TN.getCode().equalsIgnoreCase(tXinyiForecastComparison.getCategory())
|
|
|
- || BusinessEnum.BigModelForecastEnum.XSY1.getCode().equalsIgnoreCase(tXinyiForecastComparison.getCategory())
|
|
|
+ || BusinessEnum.BigModelForecastEnum.XSY1.getCode().equalsIgnoreCase(tXinyiForecastComparison.getCategory())){
|
|
|
+ tXinyiForecastComparison.setRealTwo(no3Hlj1Jqr);
|
|
|
+ if(!Objects.isNull(no3Hlj1Jqr) && no3Hlj1Jqr.compareTo(BigDecimal.ZERO) > 0){
|
|
|
+ if(!Objects.isNull(hsForecastTwo)){
|
|
|
+ BigDecimal subtract = no3Hlj1Jqr.subtract(hsForecastTwo);
|
|
|
+ tXinyiForecastComparison.setHsErrorRateTwo((subtract).divide(no3Hlj1Jqr, NUMBER_SCALE_4, RoundingMode.HALF_UP));
|
|
|
+ tXinyiForecastComparison.setHsTwoSubtract(DecimalUtils.getAbsAndScale(subtract, INT_2));
|
|
|
+ }
|
|
|
+ if(!Objects.isNull(yyForecastTwo)){
|
|
|
+ BigDecimal subtract = no3Hlj1Jqr.subtract(yyForecastTwo);
|
|
|
+ tXinyiForecastComparison.setYyErrorRateTwo((subtract).divide(no3Hlj1Jqr, NUMBER_SCALE_4, RoundingMode.HALF_UP));
|
|
|
+ tXinyiForecastComparison.setYyTwoSubtract(DecimalUtils.getAbsAndScale(subtract, INT_2));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(BusinessEnum.BigModelForecastEnum.TN.getCode().equalsIgnoreCase(tXinyiForecastComparison.getCategory())
|
|
|
|| BusinessEnum.BigModelForecastEnum.XSY2.getCode().equalsIgnoreCase(tXinyiForecastComparison.getCategory())){
|
|
|
- tXinyiForecastComparison.setRealTwo(csTn);
|
|
|
- if(!Objects.isNull(csTn) && csTn.compareTo(BigDecimal.ZERO) > 0){
|
|
|
+ tXinyiForecastComparison.setRealTwo(no3Hlj2Jqr);
|
|
|
+ if(!Objects.isNull(no3Hlj2Jqr) && no3Hlj2Jqr.compareTo(BigDecimal.ZERO) > 0){
|
|
|
if(!Objects.isNull(hsForecastTwo)){
|
|
|
- BigDecimal subtract = csTn.subtract(hsForecastTwo);
|
|
|
- tXinyiForecastComparison.setHsErrorRateTwo((subtract).divide(csTn, NUMBER_SCALE_4, RoundingMode.HALF_UP));
|
|
|
+ BigDecimal subtract = no3Hlj2Jqr.subtract(hsForecastTwo);
|
|
|
+ tXinyiForecastComparison.setHsErrorRateTwo((subtract).divide(no3Hlj2Jqr, NUMBER_SCALE_4, RoundingMode.HALF_UP));
|
|
|
tXinyiForecastComparison.setHsTwoSubtract(DecimalUtils.getAbsAndScale(subtract, INT_2));
|
|
|
}
|
|
|
if(!Objects.isNull(yyForecastTwo)){
|
|
|
- BigDecimal subtract = csTn.subtract(yyForecastTwo);
|
|
|
- tXinyiForecastComparison.setYyErrorRateTwo((subtract).divide(csTn, NUMBER_SCALE_4, RoundingMode.HALF_UP));
|
|
|
+ BigDecimal subtract = no3Hlj2Jqr.subtract(yyForecastTwo);
|
|
|
+ tXinyiForecastComparison.setYyErrorRateTwo((subtract).divide(no3Hlj2Jqr, NUMBER_SCALE_4, RoundingMode.HALF_UP));
|
|
|
tXinyiForecastComparison.setYyTwoSubtract(DecimalUtils.getAbsAndScale(subtract, INT_2));
|
|
|
}
|
|
|
}
|
|
@@ -618,18 +650,34 @@ public class AsyncTask {
|
|
|
//2024年6月21日17:04:01 总氮的真实值也从化验室获取
|
|
|
//2024年7月12日10:31:29 tn又改成xsy1和xsy2了。。。
|
|
|
if(BusinessEnum.BigModelForecastEnum.TN.getCode().equalsIgnoreCase(tXinyiForecastComparison.getCategory())
|
|
|
- || BusinessEnum.BigModelForecastEnum.XSY1.getCode().equalsIgnoreCase(tXinyiForecastComparison.getCategory())
|
|
|
+ || BusinessEnum.BigModelForecastEnum.XSY1.getCode().equalsIgnoreCase(tXinyiForecastComparison.getCategory())){
|
|
|
+ tXinyiForecastComparison.setRealThree(no3Hlj1Jqr);
|
|
|
+ if(!Objects.isNull(no3Hlj1Jqr) && no3Hlj1Jqr.compareTo(BigDecimal.ZERO) > 0){
|
|
|
+ if(!Objects.isNull(hsForecastThree)){
|
|
|
+ BigDecimal subtract = no3Hlj1Jqr.subtract(hsForecastThree);
|
|
|
+ tXinyiForecastComparison.setHsErrorRateThree((subtract).divide(no3Hlj1Jqr, NUMBER_SCALE_4, RoundingMode.HALF_UP));
|
|
|
+ tXinyiForecastComparison.setHsThreeSubtract(DecimalUtils.getAbsAndScale(subtract, INT_2));
|
|
|
+ }
|
|
|
+ if(!Objects.isNull(yyForecastThree)){
|
|
|
+ BigDecimal subtract = no3Hlj1Jqr.subtract(yyForecastThree);
|
|
|
+ tXinyiForecastComparison.setYyErrorRateThree((subtract).divide(no3Hlj1Jqr, NUMBER_SCALE_4, RoundingMode.HALF_UP));
|
|
|
+ tXinyiForecastComparison.setYyThreeSubtract(DecimalUtils.getAbsAndScale(subtract, INT_2));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(BusinessEnum.BigModelForecastEnum.TN.getCode().equalsIgnoreCase(tXinyiForecastComparison.getCategory())
|
|
|
|| BusinessEnum.BigModelForecastEnum.XSY2.getCode().equalsIgnoreCase(tXinyiForecastComparison.getCategory())){
|
|
|
- tXinyiForecastComparison.setRealThree(csTn);
|
|
|
- if(!Objects.isNull(csTn) && csTn.compareTo(BigDecimal.ZERO) > 0){
|
|
|
+ tXinyiForecastComparison.setRealThree(no3Hlj2Jqr);
|
|
|
+ if(!Objects.isNull(no3Hlj2Jqr) && no3Hlj2Jqr.compareTo(BigDecimal.ZERO) > 0){
|
|
|
if(!Objects.isNull(hsForecastThree)){
|
|
|
- BigDecimal subtract = csTn.subtract(hsForecastThree);
|
|
|
- tXinyiForecastComparison.setHsErrorRateThree((subtract).divide(csTn, NUMBER_SCALE_4, RoundingMode.HALF_UP));
|
|
|
+ BigDecimal subtract = no3Hlj2Jqr.subtract(hsForecastThree);
|
|
|
+ tXinyiForecastComparison.setHsErrorRateThree((subtract).divide(no3Hlj2Jqr, NUMBER_SCALE_4, RoundingMode.HALF_UP));
|
|
|
tXinyiForecastComparison.setHsThreeSubtract(DecimalUtils.getAbsAndScale(subtract, INT_2));
|
|
|
}
|
|
|
if(!Objects.isNull(yyForecastThree)){
|
|
|
- BigDecimal subtract = csTn.subtract(yyForecastThree);
|
|
|
- tXinyiForecastComparison.setYyErrorRateThree((subtract).divide(csTn, NUMBER_SCALE_4, RoundingMode.HALF_UP));
|
|
|
+ BigDecimal subtract = no3Hlj2Jqr.subtract(yyForecastThree);
|
|
|
+ tXinyiForecastComparison.setYyErrorRateThree((subtract).divide(no3Hlj2Jqr, NUMBER_SCALE_4, RoundingMode.HALF_UP));
|
|
|
tXinyiForecastComparison.setYyThreeSubtract(DecimalUtils.getAbsAndScale(subtract, INT_2));
|
|
|
}
|
|
|
}
|