فهرست منبع

因为预测 + 工业库挂掉 导致预测的一直是工业库的下条日期 临时加个判断

wangmiaomiao 9 ماه پیش
والد
کامیت
ac1041643e
1فایلهای تغییر یافته به همراه21 افزوده شده و 8 حذف شده
  1. 21 8
      slibra-quartz/src/main/java/com/slibra/quartz/task/RyTask.java

+ 21 - 8
slibra-quartz/src/main/java/com/slibra/quartz/task/RyTask.java

@@ -1339,7 +1339,7 @@ public class RyTask
             } catch (Exception e) {
                 log.error("调用跃渊的预测接口出现异常,异常信息为{}", e.getMessage());
             }
-            this.xinyiForecastComparisonService.insertTXinyiForecastComparison(tXinyiForecastComparison);
+            // this.xinyiForecastComparisonService.insertTXinyiForecastComparison(tXinyiForecastComparison);
             BigDecimal cscodBzz = normConfig.getCscodBzz();
             BigDecimal cscodGkz = normConfig.getCscodGkz();
             //处理展示数据
@@ -1371,7 +1371,7 @@ public class RyTask
             } catch (Exception e) {
                 log.error("调用跃渊的预测接口出现异常,异常信息为{}", e.getMessage());
             }
-            this.xinyiForecastComparisonService.insertTXinyiForecastComparison(tXinyiForecastComparison);
+            // this.xinyiForecastComparisonService.insertTXinyiForecastComparison(tXinyiForecastComparison);
             BigDecimal csSSBzz = normConfig.getCsssBzz();
             BigDecimal csssGkz = normConfig.getCsssGkz();
             //处理展示数据
@@ -1403,7 +1403,7 @@ public class RyTask
             } catch (Exception e) {
                 log.error("调用跃渊的预测接口出现异常,异常信息为{}", e.getMessage());
             }
-            this.xinyiForecastComparisonService.insertTXinyiForecastComparison(tXinyiForecastComparison);
+            // this.xinyiForecastComparisonService.insertTXinyiForecastComparison(tXinyiForecastComparison);
             BigDecimal cszzBzz = normConfig.getCszzBzz();
             BigDecimal cszzGkz = normConfig.getCszzGkz();
             //处理展示数据
@@ -1435,7 +1435,7 @@ public class RyTask
             } catch (Exception e) {
                 log.error("调用跃渊的预测接口出现异常,异常信息为{}", e.getMessage());
             }
-            this.xinyiForecastComparisonService.insertTXinyiForecastComparison(tXinyiForecastComparison);
+            // this.xinyiForecastComparisonService.insertTXinyiForecastComparison(tXinyiForecastComparison);
             BigDecimal cszlBzz = normConfig.getCszlBzz();
             BigDecimal cszlGkz = normConfig.getCszlGkz();
             //处理展示数据
@@ -1467,7 +1467,7 @@ public class RyTask
             } catch (Exception e) {
                 log.error("调用跃渊的预测接口出现异常,异常信息为{}", e.getMessage());
             }
-            this.xinyiForecastComparisonService.insertTXinyiForecastComparison(tXinyiForecastComparison);
+            // this.xinyiForecastComparisonService.insertTXinyiForecastComparison(tXinyiForecastComparison);
             BigDecimal csadBzz = normConfig.getCsadBzz();
             BigDecimal csadGkz = normConfig.getCsadGkz();
             //处理展示数据
@@ -1487,7 +1487,7 @@ public class RyTask
             }
             handleXinYiWarningsYC(csadBzz, split, csadGkz, BusinessEnum.WarningCategoryEnum.CS_AD_YC.getCode(), hour, normConfig,tXinyiIndustry.getCsCod(), tXinyiIndustry, chartsDataList, date);
         }else if("xsy1".equals(task)){
-            this.xinyiForecastComparisonService.insertTXinyiForecastComparison(tXinyiForecastComparison);
+            // this.xinyiForecastComparisonService.insertTXinyiForecastComparison(tXinyiForecastComparison);
             BigDecimal cscodBzz = new BigDecimal(XIAOSUANYAN_BZK);
             BigDecimal cscodGkz = new BigDecimal(XIAOSUANYAN_GKZ);
             //处理展示数据
@@ -1507,7 +1507,7 @@ public class RyTask
             }
             handleXinYiWarningsYC(cscodBzz, split, cscodGkz, BusinessEnum.WarningCategoryEnum.CS_XSY_1_YC.getCode(), hour, normConfig,tXinyiIndustry.getCsCod(), tXinyiIndustry, chartsDataList, date);
         }else if("xsy2".equals(task)){
-            this.xinyiForecastComparisonService.insertTXinyiForecastComparison(tXinyiForecastComparison);
+            // this.xinyiForecastComparisonService.insertTXinyiForecastComparison(tXinyiForecastComparison);
             BigDecimal cscodBzz = new BigDecimal(XIAOSUANYAN_BZK);
             BigDecimal cscodGkz = new BigDecimal(XIAOSUANYAN_GKZ);
             //处理展示数据
@@ -1529,6 +1529,18 @@ public class RyTask
         }else {
             log.error("暂未支持的类型{}", task);
         }
+        //插入到数据库
+        //2024年6月20日14:59:23 因为预测bug 判断是否生成过了否则不生成
+        String remark = tXinyiForecastComparison.getRemark();
+        String category = tXinyiForecastComparison.getCategory();
+        TXinyiForecastComparison tXinyiForecastComparisonReq = new TXinyiForecastComparison();
+        tXinyiForecastComparisonReq.setRemark(remark);
+        tXinyiForecastComparisonReq.setCategory(category);
+        List<TXinyiForecastComparison> tXinyiForecastComparisons = this.xinyiForecastComparisonService.selectTXinyiForecastComparisonList(tXinyiForecastComparisonReq);
+        if(CollectionUtils.isEmpty(tXinyiForecastComparisons))
+            this.xinyiForecastComparisonService.insertTXinyiForecastComparison(tXinyiForecastComparison);
+        else
+            log.error("预测已经进行过了,无需重复运行~~~~~~~~~~~@@@@@@@,时间为{}\n类型为{}", remark, category);
 
     }
 
@@ -1538,7 +1550,8 @@ public class RyTask
         String yjHour = null;
         for (int i = 0, splitLength = split.length; i < splitLength; i++) {
             String forecast = split[i];
-            BigDecimal forecastVal = new BigDecimal("10000");
+            /*BigDecimal forecastVal = new BigDecimal("10000");*/
+            BigDecimal forecastVal = new BigDecimal(forecast);
             tXinyiWarningRecord = new TXinyiWarningRecord();
             /*String category = BusinessEnum.WarningCategoryEnum.CS_AD.getCode();*/
             tXinyiWarningRecord.setStatus(0);