浏览代码

水量调度对接预测调用逻辑变更

1037015548@qq.com 7 月之前
父节点
当前提交
0e45ddfc41

+ 273 - 56
src/main/java/com/shkpr/service/aimodelpower/bizmgr/KprAimWaterCollecationBizFun.java

@@ -551,7 +551,218 @@ public class KprAimWaterCollecationBizFun {
         }
     }
 
-    //TODO 定时任务 定时添加预测数据
+    //TODO 定时任务 定时调用水力模型预测接口,截止今天
+    public static void insertYuceDayData(String monthNow){
+        System.out.println("添加预测日数据正在进行"+ TimeTool.convertUTC2DateStr(TimeTool.getCurMsUTC(),TimeTool.TIMESTAMP_FORMAT));
+        try {
+            String yearStr = "";
+            String monthStr = "";
+            if(!StringUtils.isEmpty(monthNow)){
+                yearStr = monthNow.split("-")[0];
+                monthStr = monthNow.split("-")[1];
+            }
+            LocalDateTime startDate = LocalDateTime.now().withYear(Integer.valueOf(yearStr))
+                    .withMonth(Integer.valueOf(monthStr)).withDayOfMonth(1).withHour(0).withMinute(0).withSecond(0).withNano(0);
+            int days = LocalDateTime.now().getDayOfMonth();//获取月份天数
+            for (int i = 1;i<=days;i++) {
+                LocalDateTime dateNow = startDate.withDayOfMonth(i);//当前循环时间
+                if (dateNow.isAfter(LocalDateTime.now())) {
+                    break;
+                }
+                //TODO 数据库操作 A 调用对应时间预测接口 B 在修改实际值
+
+                DateTimeFormatter formatter2 = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+                String dateStr = dateNow.withYear(LocalDateTime.now().getYear()).toLocalDate().format(formatter2);
+
+                //TODO A
+                JP3TPDay tpDay = new JP3TPDay();
+                tpDay.setOrgId("");
+                tpDay.setSdate(dateStr);
+                tpDay.setEndate(dateStr);
+
+                try {
+                    LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_INFO
+                            , mStrClassName
+                            , mStrClassName
+                            , String.format("执行预测日数据" + FastJsonUtil.toJSON(tpDay) + "调用"));
+                    ResponseRes<String> tpRes = ServiceMgrProxy.getInstance()
+                            .applyCloud3tpServiceApi().dayDataPredictSupply(tpDay);
+                    if (ResponseCode.RESULT_BAD.toStrCode().equals(tpRes.getRescode())) {
+                        LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_ERROR
+                                , mStrClassName
+                                , mStrClassName
+                                , String.format("预测日数据" + dateStr + "调用失败 ERROR:{%s} ",
+                                        tpRes.getResdata()));
+                    }
+                } catch (Exception ex) {
+                    LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_ERROR
+                            , mStrClassName
+                            , mStrClassName
+                            , String.format("预测日数据" + dateStr + "调用异常 ERROR:{%s} ",
+                                    ex.getLocalizedMessage()));
+                }
+            }
+            System.out.println("添加预测日数据结束"+ TimeTool.convertUTC2DateStr(TimeTool.getCurMsUTC(),TimeTool.TIMESTAMP_FORMAT));
+        }catch(Exception ex){
+            ex.printStackTrace();
+        }
+    }
+    //TODO 截止到未来的今天+3
+    public static void insertYuceDayAddData(String monthNow){
+        System.out.println("添加预测日数据正在进行"+ TimeTool.convertUTC2DateStr(TimeTool.getCurMsUTC(),TimeTool.TIMESTAMP_FORMAT));
+        try {
+            String yearStr = "";
+            String monthStr = "";
+            if(!StringUtils.isEmpty(monthNow)){
+                yearStr = monthNow.split("-")[0];
+                monthStr = monthNow.split("-")[1];
+            }
+            LocalDateTime startDate = LocalDateTime.now().withYear(Integer.valueOf(yearStr))
+                    .withMonth(Integer.valueOf(monthStr)).withHour(0).withMinute(0).withSecond(0).withNano(0);
+                LocalDateTime dateNow = startDate;
+                //TODO 数据库操作 A 调用对应时间预测接口 B 在修改实际值
+
+                DateTimeFormatter formatter2 = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+                String dateStr = dateNow.withYear(LocalDateTime.now().getYear()).toLocalDate().format(formatter2);
+
+                //TODO A
+                JP3TPDay tpDay = new JP3TPDay();
+                tpDay.setOrgId("");
+                tpDay.setSdate(dateStr);
+                tpDay.setEndate(dateNow.minusDays(-3).toLocalDate().format(formatter2));
+                try {
+                    LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_INFO
+                            , mStrClassName
+                            , mStrClassName
+                            , String.format("执行预测未来日数据" + FastJsonUtil.toJSON(tpDay) + "调用"));
+                    ResponseRes<String> tpRes = ServiceMgrProxy.getInstance()
+                            .applyCloud3tpServiceApi().dayDataPredictSupply(tpDay);
+                    if (ResponseCode.RESULT_BAD.toStrCode().equals(tpRes.getRescode())) {
+                        LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_ERROR
+                                , mStrClassName
+                                , mStrClassName
+                                , String.format("预测日数据" + dateStr + "调用失败 ERROR:{%s} ",
+                                        tpRes.getResdata()));
+                    }
+                } catch (Exception ex) {
+                    LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_ERROR
+                            , mStrClassName
+                            , mStrClassName
+                            , String.format("预测日数据" + dateStr + "调用异常 ERROR:{%s} ",
+                                    ex.getLocalizedMessage()));
+                }
+            System.out.println("添加预测日数据结束"+ TimeTool.convertUTC2DateStr(TimeTool.getCurMsUTC(),TimeTool.TIMESTAMP_FORMAT));
+        }catch(Exception ex){
+            ex.printStackTrace();
+        }
+    }
+
+    //TODO 定时任务 定时调用水力模型小时预测接口,截止今天
+    public static void insertYuceHourData(String monthNow){
+        System.out.println("添加预测小时数据正在进行"+ TimeTool.convertUTC2DateStr(TimeTool.getCurMsUTC(),TimeTool.TIMESTAMP_FORMAT));
+        try {
+            //先获取配置项 根据配置项来进行逻辑添加
+            String yearStr = "";
+            String monthStr ="";
+            if(!StringUtils.isEmpty(monthNow)){
+                yearStr = monthNow.split("-")[0];
+                monthStr = monthNow.split("-")[1];
+            }
+            LocalDateTime startDate = LocalDateTime.now().withYear(Integer.valueOf(yearStr))
+                    .withMonth(Integer.valueOf(monthStr)).withDayOfMonth(1).withHour(0).withMinute(0).withSecond(0).withNano(0);
+            //TODO 总体逻辑: 先查询指定月上一年的每日平均值,再按平均值的上下啊百分比去插入指定的浮动百分比数据
+            int days = LocalDateTime.now().getDayOfMonth();//获取月份天数
+            for (int i = 1;i<=days;i++){
+                LocalDateTime dateNow = startDate.withDayOfMonth(i);//当前循环时间
+                if(dateNow.toLocalDate().isAfter(LocalDateTime.now().toLocalDate())){
+                    break;
+                }
+                 //TODO 数据库操作 A 调用对应时间预测接口 B 在修改实际值
+                 DateTimeFormatter formatter2 = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+                 String dateStr = dateNow.withYear(LocalDateTime.now().getYear()).toLocalDate().format(formatter2);
+                 //TODO A
+                 JP3TPHour tpHour = new JP3TPHour();
+                 tpHour.setOrgId("");
+                 tpHour.setDate(dateStr);
+                 LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_INFO
+                        , mStrClassName
+                        , mStrClassName
+                        , String.format("执行预测小时数据" + FastJsonUtil.toJSON(tpHour) + "调用"));
+                 try {
+                     ResponseRes<String> tpRes = ServiceMgrProxy.getInstance()
+                             .applyCloud3tpServiceApi().dayHourPredictSupply(tpHour);
+                     if(ResponseCode.RESULT_BAD.toStrCode().equals(tpRes.getRescode())){
+                         LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_ERROR
+                                 , mStrClassName
+                                 , mStrClassName
+                                 , String.format("预测小时数据"+dateStr+"调用失败 ERROR:{%s} ",
+                                         tpRes.getResdata()));
+                     }
+                 }catch(Exception ex){
+                     LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_ERROR
+                             , mStrClassName
+                             , mStrClassName
+                             , String.format("预测小时数据"+dateStr+"调用异常 ERROR:{%s} ",
+                                     ex.getLocalizedMessage()));
+                 }
+            }
+            System.out.println("调用预测模型小时数据结束"+ TimeTool.convertUTC2DateStr(TimeTool.getCurMsUTC(),TimeTool.TIMESTAMP_FORMAT));
+        }catch(Exception ex){
+            ex.printStackTrace();
+        }
+    }
+    //TODO 截止到未来的今天+3
+    public static void insertYuceHourAddData(String monthNow){
+        System.out.println("添加预测小时数据正在进行"+ TimeTool.convertUTC2DateStr(TimeTool.getCurMsUTC(),TimeTool.TIMESTAMP_FORMAT));
+        try {
+            //先获取配置项 根据配置项来进行逻辑添加
+            String yearStr = "";
+            String monthStr ="";
+            if(!StringUtils.isEmpty(monthNow)){
+                yearStr = monthNow.split("-")[0];
+                monthStr = monthNow.split("-")[1];
+            }
+            LocalDateTime startDate = LocalDateTime.now().withYear(Integer.valueOf(yearStr))
+                    .withMonth(Integer.valueOf(monthStr)).withHour(0).withMinute(0).withSecond(0).withNano(0);
+            //TODO 总体逻辑: 先查询指定月上一年的每日平均值,再按平均值的上下啊百分比去插入指定的浮动百分比数据
+            for (int i = 1;i<=3;i++){
+                LocalDateTime dateNow = startDate.minusDays(-i);//当前循环时间
+                 //TODO 数据库操作 A 调用对应时间预测接口 B 在修改实际值
+                 DateTimeFormatter formatter2 = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+                 String dateStr = dateNow.withYear(LocalDateTime.now().getYear()).toLocalDate().format(formatter2);
+                 //TODO A
+                 JP3TPHour tpHour = new JP3TPHour();
+                 tpHour.setOrgId("");
+                 tpHour.setDate(dateStr);
+                 LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_INFO
+                        , mStrClassName
+                        , mStrClassName
+                        , String.format("执行未来预测小时数据" + FastJsonUtil.toJSON(tpHour) + "调用"));
+                 try {
+                     ResponseRes<String> tpRes = ServiceMgrProxy.getInstance()
+                             .applyCloud3tpServiceApi().dayHourPredictSupply(tpHour);
+                     if(ResponseCode.RESULT_BAD.toStrCode().equals(tpRes.getRescode())){
+                         LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_ERROR
+                                 , mStrClassName
+                                 , mStrClassName
+                                 , String.format("预测小时数据"+dateStr+"调用失败 ERROR:{%s} ",
+                                         tpRes.getResdata()));
+                     }
+                 }catch(Exception ex){
+                     LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_ERROR
+                             , mStrClassName
+                             , mStrClassName
+                             , String.format("预测小时数据"+dateStr+"调用异常 ERROR:{%s} ",
+                                     ex.getLocalizedMessage()));
+                 }
+            }
+            System.out.println("调用预测模型小时数据结束"+ TimeTool.convertUTC2DateStr(TimeTool.getCurMsUTC(),TimeTool.TIMESTAMP_FORMAT));
+        }catch(Exception ex){
+            ex.printStackTrace();
+        }
+    }
+
+    //TODO 定时任务 定时添加预测数据 废弃
     public static void insertYuceDataScheduled(String monthNow){
         System.out.println("添加预测日数据正在进行"+ TimeTool.convertUTC2DateStr(TimeTool.getCurMsUTC(),TimeTool.TIMESTAMP_FORMAT));
         try {
@@ -629,6 +840,9 @@ public class KprAimWaterCollecationBizFun {
                                                 //预测比对时间如果不是今年,则变为今年的时间
                                                 for (int i = 1;i<=days;i++) {
                                                     LocalDateTime dateNow = startDate.withDayOfMonth(i);//当前循环时间
+                                                    if(dateNow.isAfter(LocalDateTime.now())){
+                                                        break;
+                                                    }
                                                     Double numAll = null;//日总值
                                                     //TODO 筛选成当前循环时间的集合
                                                     List<Map<String,Object>> daysRecord = recordAllRes.stream().filter(item ->
@@ -646,29 +860,29 @@ public class KprAimWaterCollecationBizFun {
                                                     DateTimeFormatter formatter2 = DateTimeFormatter.ofPattern("yyyy-MM-dd");
                                                     String dateStr = dateNow.withYear(LocalDateTime.now().getYear()).toLocalDate().format(formatter2);
 
-                                                    //TODO A
-                                                    JP3TPDay tpDay = new JP3TPDay();
-                                                    tpDay.setOrgId(orgId);
-                                                    tpDay.setSdate(dateStr);
-                                                    tpDay.setEndate(dateStr);
-                                                    try {
-                                                        ResponseRes<String> tpRes = ServiceMgrProxy.getInstance()
-                                                                .applyCloud3tpServiceApi().dayDataPredictSupply(tpDay);
-                                                        if(ResponseCode.RESULT_BAD.toStrCode().equals(tpRes.getRescode())){
-                                                            LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_ERROR
-                                                                    , mStrClassName
-                                                                    , mStrClassName
-                                                                    , String.format("预测日数据"+dateStr+"调用失败 ERROR:{%s} ",
-                                                                            tpRes.getResdata()));
-                                                            break;
-                                                        }
-                                                    }catch(Exception ex){
-                                                        LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_ERROR
-                                                                , mStrClassName
-                                                                , mStrClassName
-                                                                , String.format("预测日数据"+dateStr+"调用异常 ERROR:{%s} ",
-                                                                        ex.getLocalizedMessage()));
-                                                    }
+//                                                    //TODO A
+//                                                    JP3TPDay tpDay = new JP3TPDay();
+//                                                    tpDay.setOrgId(orgId);
+//                                                    tpDay.setSdate(dateStr);
+//                                                    tpDay.setEndate(dateStr);
+//                                                    try {
+//                                                        ResponseRes<String> tpRes = ServiceMgrProxy.getInstance()
+//                                                                .applyCloud3tpServiceApi().dayDataPredictSupply(tpDay);
+//                                                        if(ResponseCode.RESULT_BAD.toStrCode().equals(tpRes.getRescode())){
+//                                                            LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_ERROR
+//                                                                    , mStrClassName
+//                                                                    , mStrClassName
+//                                                                    , String.format("预测日数据"+dateStr+"调用失败 ERROR:{%s} ",
+//                                                                            tpRes.getResdata()));
+//                                                            break;
+//                                                        }
+//                                                    }catch(Exception ex){
+//                                                        LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_ERROR
+//                                                                , mStrClassName
+//                                                                , mStrClassName
+//                                                                , String.format("预测日数据"+dateStr+"调用异常 ERROR:{%s} ",
+//                                                                        ex.getLocalizedMessage()));
+//                                                    }
                                                     //TODO B
                                                     Map<String, Object> recordAllEntity = new LinkedHashMap<>();//需要添加的实体数据,此处要用有序map
                                                     recordAllEntity.put("Date", dateStr);
@@ -753,7 +967,7 @@ public class KprAimWaterCollecationBizFun {
         }
     }
 
-    //TODO 定时任务 定时添加小时预测数据
+    //TODO 定时任务 定时添加小时预测数据 转变为之做假泵数据
     public static void insertYuceHourDataScheduled(String monthNow){
         System.out.println("添加预测小时数据正在进行"+ TimeTool.convertUTC2DateStr(TimeTool.getCurMsUTC(),TimeTool.TIMESTAMP_FORMAT));
         try {
@@ -797,6 +1011,9 @@ public class KprAimWaterCollecationBizFun {
                                             int days = YearMonth.from(startDate).lengthOfMonth();//获取月份天数
                                             for (int i = 1;i<=days;i++){
                                                 LocalDateTime dateNow = startDate.withDayOfMonth(i);//当前循环时间
+                                                if(dateNow.isAfter(LocalDateTime.now().minusDays(-4))){
+                                                    break;
+                                                }
                                                 Double numAll = null;//日总值
                                                 Double numAge = 0.0;//日小时平均值
                                                 //TODO 筛选成当前循环时间的集合
@@ -836,28 +1053,28 @@ public class KprAimWaterCollecationBizFun {
                                                         // 创建一个DateTimeFormatter用于格式化时间
                                                         String timeStr = time.format(formatter3);
 
-                                                        //TODO A
-                                                        JP3TPHour tpHour = new JP3TPHour();
-                                                        tpHour.setOrgId(orgId);
-                                                        tpHour.setDate(dateStr);
-                                                        try {
-                                                            ResponseRes<String> tpRes = ServiceMgrProxy.getInstance()
-                                                                    .applyCloud3tpServiceApi().dayHourPredictSupply(tpHour);
-                                                            if(ResponseCode.RESULT_BAD.toStrCode().equals(tpRes.getRescode())){
-                                                                LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_ERROR
-                                                                        , mStrClassName
-                                                                        , mStrClassName
-                                                                        , String.format("预测小时数据"+dateStr+"调用失败 ERROR:{%s} ",
-                                                                                tpRes.getResdata()));
-                                                                break;
-                                                            }
-                                                        }catch(Exception ex){
-                                                            LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_ERROR
-                                                                    , mStrClassName
-                                                                    , mStrClassName
-                                                                    , String.format("预测小时数据"+dateStr+"调用异常 ERROR:{%s} ",
-                                                                            ex.getLocalizedMessage()));
-                                                        }
+//                                                        //TODO A
+//                                                        JP3TPHour tpHour = new JP3TPHour();
+//                                                        tpHour.setOrgId(orgId);
+//                                                        tpHour.setDate(dateStr);
+//                                                        try {
+//                                                            ResponseRes<String> tpRes = ServiceMgrProxy.getInstance()
+//                                                                    .applyCloud3tpServiceApi().dayHourPredictSupply(tpHour);
+//                                                            if(ResponseCode.RESULT_BAD.toStrCode().equals(tpRes.getRescode())){
+//                                                                LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_ERROR
+//                                                                        , mStrClassName
+//                                                                        , mStrClassName
+//                                                                        , String.format("预测小时数据"+dateStr+"调用失败 ERROR:{%s} ",
+//                                                                                tpRes.getResdata()));
+//                                                                break;
+//                                                            }
+//                                                        }catch(Exception ex){
+//                                                            LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_ERROR
+//                                                                    , mStrClassName
+//                                                                    , mStrClassName
+//                                                                    , String.format("预测小时数据"+dateStr+"调用异常 ERROR:{%s} ",
+//                                                                            ex.getLocalizedMessage()));
+//                                                        }
 
                                                         //TODO B
                                                         Map<String, Object> recordAllEntity = new LinkedHashMap<>();//需要添加的实体数据,此处要用有序map
@@ -886,15 +1103,15 @@ public class KprAimWaterCollecationBizFun {
                                                         // 如果找到了org_id,就将其赋值给orgId,否则orgId为null
                                                         recordAllEntity.put("orgId", orgId);
 
-                                                        //TODO 添加or修改
-                                                        Integer insertRes = getWaterTapApi().insertOrUpdateTbmHourWater(recordAllEntity);
-                                                        if (insertRes < 1) {
-                                                            LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_ERROR
-                                                                    , mStrClassName
-                                                                    , mStrClassName
-                                                                    , String.format("Batch insertYuceDataScheduled ERROR:{%s} ",
-                                                                            "新增或修改失败"));
-                                                        }
+//                                                        //TODO 添加or修改
+//                                                        Integer insertRes = getWaterTapApi().insertOrUpdateTbmHourWater(recordAllEntity);
+//                                                        if (insertRes < 1) {
+//                                                            LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_ERROR
+//                                                                    , mStrClassName
+//                                                                    , mStrClassName
+//                                                                    , String.format("Batch insertYuceDataScheduled ERROR:{%s} ",
+//                                                                            "新增或修改失败"));
+//                                                        }
 
                                                         //TODO ③ 泵集合数据添加或修改
                                                         // 生成[1, pumpArray.size()]范围内的随机数

+ 1 - 1
src/main/java/com/shkpr/service/aimodelpower/configuration/RestTemplateConfig.java

@@ -23,7 +23,7 @@ public class RestTemplateConfig {
         //SimpleClientHttpRequestFactory factory1 = new SimpleClientHttpRequestFactory();
         SslClientHttpRequestFactory factory = new SslClientHttpRequestFactory();
         factory.setReadTimeout(30000);
-        factory.setConnectTimeout(30000);
+        factory.setConnectTimeout(180000);
         return factory;
     }
 

+ 22 - 18
src/main/java/com/shkpr/service/aimodelpower/globalmgr/ScheduleTaskMgr.java

@@ -114,31 +114,32 @@ public class ScheduleTaskMgr {
         KprAimTapWaterBizFun.checkRecordData();
     }
 
-    //TODO 每天整点的15分执行配置月预测日数据(目前实际上是先调对应日期的实际预测接口在去调修改实际数据的逻辑)
-    @Scheduled(cron = "0 15 * * * *")
-//    @Scheduled(cron = "0 0/1 * * * ?")
-    public void executeTbMWater() {
-        KprAimWaterCollecationBizFun.insertYuceDataScheduled(null);
-    }
-
-    //TODO 每天每小时的16分执行配置月预测日小时数据(目前实际上是先调对应日期的实际预测接口在去调修改实际数据的逻辑)
-    @Scheduled(cron = "0 16 * * * *")
-    public void executeTbMHourWater() {
-        KprAimWaterCollecationBizFun.insertYuceHourDataScheduled(null);
-    }
+//    //TODO 每天整点的15分执行配置月预测日数据(目前实际上是先调对应日期的实际预测接口在去调修改实际数据的逻辑)
+//    @Scheduled(cron = "0 15 * * * *")
+////    @Scheduled(cron = "0 0/1 * * * ?")
+//    public void executeTbMWater() {
+//        KprAimWaterCollecationBizFun.insertYuceDataScheduled(null);
+//    }
+//
+//    //TODO 每天每小时的16分执行配置月预测日小时数据(目前实际上是先调对应日期的实际预测接口在去调修改实际数据的逻辑)
+//    @Scheduled(cron = "0 16 * * * *")
+//    public void executeTbMHourWater() {
+//        KprAimWaterCollecationBizFun.insertYuceHourDataScheduled(null);
+//    }
 
     //TODO 每天每小时的20分执行当前月预测日数据
     @Scheduled(cron = "0 20 * * * *")
 //    @Scheduled(cron = "0 0/1 * * * ?")
     public void executeTbMWaterNow() {
-        String time = LocalDateTime.now().minusYears(1).format(DateTimeFormatter.ofPattern("yyyy-MM"));
-        KprAimWaterCollecationBizFun.insertYuceDataScheduled(time);
+        String time = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM"));
+        KprAimWaterCollecationBizFun.insertYuceDayAddData(time);
     }
 
     //TODO 每天每小时的21分执行预测当前月日小时数据
     @Scheduled(cron = "0 21 * * * *")
     public void executeTbMHourWaterNow() {
-        String time = LocalDateTime.now().minusYears(1).format(DateTimeFormatter.ofPattern("yyyy-MM"));
+        String time = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM"));
+        KprAimWaterCollecationBizFun.insertYuceHourAddData(time);
         KprAimWaterCollecationBizFun.insertYuceHourDataScheduled(time);
     }
 
@@ -205,8 +206,9 @@ public class ScheduleTaskMgr {
         TimerTask timerTask1 = new TimerTask() {
             @Override
             public void run() {
-                String time = LocalDateTime.now().minusYears(1).format(DateTimeFormatter.ofPattern("yyyy-MM"));
-                KprAimWaterCollecationBizFun.insertYuceDataScheduled(time);
+                String time = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM"));
+                KprAimWaterCollecationBizFun.insertYuceDayData(time);
+                KprAimWaterCollecationBizFun.insertYuceDayAddData(time);
             }
         };
         timer.schedule(timerTask1,8000);//8秒后执行一次
@@ -218,7 +220,9 @@ public class ScheduleTaskMgr {
         TimerTask timerTask1 = new TimerTask() {
             @Override
             public void run() {
-                String time = LocalDateTime.now().minusYears(1).format(DateTimeFormatter.ofPattern("yyyy-MM"));
+                String time = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM"));
+                KprAimWaterCollecationBizFun.insertYuceHourData(time);
+                KprAimWaterCollecationBizFun.insertYuceHourAddData(time);
                 KprAimWaterCollecationBizFun.insertYuceHourDataScheduled(time);
             }
         };

+ 6 - 2
src/main/java/com/shkpr/service/aimodelpower/services/Cloud3tpService.java

@@ -64,7 +64,9 @@ public class Cloud3tpService {
         headers.add(ApiURI.HEADER_CLIENT_TYPE, GlobalData.getInstance().getServerId());
     }
 
-    @Retryable(value = {RemoteAccessException.class}, maxAttempts = 3, backoff = @Backoff(delay = 200L, multiplier = 1))
+//    @Retryable(value = {RemoteAccessException.class},
+//            maxAttempts = 0, // 首次尝试加上3次重试
+//            backoff = @Backoff(delay = 200))
     public ResponseRes<String> dayDataPredictSupply(final JP3TPDay jsonParam) throws Exception{
         ResponseRes<String> resResult = new ResponseRes<String>();
         resResult.setRescode(ResponseCode.RESULT_BAD.toStrCode());
@@ -86,7 +88,9 @@ public class Cloud3tpService {
         return resResult;
     }
 
-    @Retryable(value = {RemoteAccessException.class}, maxAttempts = 3, backoff = @Backoff(delay = 200L, multiplier = 1))
+//    @Retryable(value = {RemoteAccessException.class},
+//            maxAttempts = 0, // 首次尝试加上3次重试
+//            backoff = @Backoff(delay = 200))
     public ResponseRes<String> dayHourPredictSupply(final JP3TPHour jsonParam) throws Exception{
         ResponseRes<String> resResult = new ResponseRes<String>();
         resResult.setRescode(ResponseCode.RESULT_BAD.toStrCode());