瀏覽代碼

历史计算服务修改

shilin 2 年之前
父節點
當前提交
ac9a86aa24

+ 27 - 27
realtime/generationXK-service/src/main/java/com/gyee/generation/config/XxlJobConfig.java

@@ -19,7 +19,7 @@ import org.springframework.core.env.Environment;
 
 @Configuration
 @PropertySource("classpath:xxl-job-executor.properties")
-//@PropertySource("classpath:xxl-job-executorWPLY.properties")
+//@PropertySource("classpath:xxl-job-executorWPXNY.properties")
 //@PropertySource("classpath:xxl-job-executorRG.properties")
 public class XxlJobConfig implements EnvironmentAware {
     private Environment env;
@@ -36,35 +36,35 @@ public class XxlJobConfig implements EnvironmentAware {
 
     @Bean
     public XxlJobSpringExecutor xxlJobExecutor() {
-    logger.info(">>>>>>>>>>> xxl-job config init.");
-    XxlJobSpringExecutor xxlJobSpringExecutor = new XxlJobSpringExecutor();
-    xxlJobSpringExecutor.setAdminAddresses(env.getProperty("xxl.job.admin.addresses"));
-    xxlJobSpringExecutor.setAppname(env.getProperty("xxl.job.executor.appname"));
-    xxlJobSpringExecutor.setAddress(env.getProperty("xxl.job.executor.address"));
-    xxlJobSpringExecutor.setIp(env.getProperty("xxl.job.executor.ip"));
-    xxlJobSpringExecutor.setPort(Integer.parseInt(env.getProperty("xxl.job.executor.port")));
-    xxlJobSpringExecutor.setAccessToken(env.getProperty("xxl.job.accessToken"));
-    xxlJobSpringExecutor.setLogPath(env.getProperty("xxl.job.executor.logpath"));
-    xxlJobSpringExecutor.setLogRetentionDays(Integer.parseInt(env.getProperty("xxl.job.executor.logretentiondays")));
-    return xxlJobSpringExecutor;
+        logger.info(">>>>>>>>>>> xxl-job config init.");
+        XxlJobSpringExecutor xxlJobSpringExecutor = new XxlJobSpringExecutor();
+        xxlJobSpringExecutor.setAdminAddresses(env.getProperty("xxl.job.admin.addresses"));
+        xxlJobSpringExecutor.setAppname(env.getProperty("xxl.job.executor.appname"));
+        xxlJobSpringExecutor.setAddress(env.getProperty("xxl.job.executor.address"));
+        xxlJobSpringExecutor.setIp(env.getProperty("xxl.job.executor.ip"));
+        xxlJobSpringExecutor.setPort(Integer.parseInt(env.getProperty("xxl.job.executor.port")));
+        xxlJobSpringExecutor.setAccessToken(env.getProperty("xxl.job.accessToken"));
+        xxlJobSpringExecutor.setLogPath(env.getProperty("xxl.job.executor.logpath"));
+        xxlJobSpringExecutor.setLogRetentionDays(Integer.parseInt(env.getProperty("xxl.job.executor.logretentiondays")));
+        return xxlJobSpringExecutor;
     }
 
     /**
-    * 针对多网卡、容器内部署等情况,可借助 "spring-cloud-commons" 提供的 "InetUtils" 组件灵活定制注册IP;
-    *
-    *      1、引入依赖:
-    *          <dependency>
-    *             <groupId>org.springframework.cloud</groupId>
-    *             <artifactId>spring-cloud-commons</artifactId>
-    *             <version>${version}</version>
-    *         </dependency>
-    *
-    *      2、配置文件,或者容器启动变量
-    *          spring.cloud.inetutils.preferred-networks: 'xxx.xxx.xxx.'
-    *
-    *      3、获取IP
-    *          String ip_ = inetUtils.findFirstNonLoopbackHostInfo().getIpAddress();
-    */
+     * 针对多网卡、容器内部署等情况,可借助 "spring-cloud-commons" 提供的 "InetUtils" 组件灵活定制注册IP;
+     *
+     *      1、引入依赖:
+     *          <dependency>
+     *             <groupId>org.springframework.cloud</groupId>
+     *             <artifactId>spring-cloud-commons</artifactId>
+     *             <version>${version}</version>
+     *         </dependency>
+     *
+     *      2、配置文件,或者容器启动变量
+     *          spring.cloud.inetutils.preferred-networks: 'xxx.xxx.xxx.'
+     *
+     *      3、获取IP
+     *          String ip_ = inetUtils.findFirstNonLoopbackHostInfo().getIpAddress();
+     */
 
 
 }

+ 8 - 5
realtime/generationXK-service/src/main/java/com/gyee/generation/task/SaticSchedulePgTask.java

@@ -193,14 +193,16 @@ public class SaticSchedulePgTask {
      * 日、月、年功率曲线拟合
      * 每天执行一次
      */
-    @XxlJob("powerCurveFitting_PG")
-    public void powerCurveFitting_PG()  {
+    @XxlJob("powerCurveFittingnew_PG")
+    public void powerCurveFittingnew_PG()  {
 
         XxlJobHelper.log("日、月、年功率曲线拟合调度程序执行开始!........");
 
         Date date=new Date();
         try {
+            XxlJobHelper.log("日序执行开始!........");
             powerCurveFittingByTimeService.cureFittingDay(date);
+            XxlJobHelper.log("日处理完成!........");
             powerCurveFittingByTimeService.cureFittingMonth(date,"0");
             powerCurveFittingByTimeService.cureFittingYear(date);
 
@@ -212,6 +214,7 @@ public class SaticSchedulePgTask {
 
         } catch (Exception e) {
             e.printStackTrace();
+            XxlJobHelper.log(e.getMessage());
         }
 
         XxlJobHelper.log("日、月、年功率曲线拟合调度任务处理完成!........");
@@ -226,9 +229,9 @@ public class SaticSchedulePgTask {
     @XxlJob("windPowerInfo1_PG")
     public void windPowerInfo1_PG() throws Exception {
 
-            XxlJobHelper.log("场站指标1调度程序执行开始!........");
+        XxlJobHelper.log("场站指标1调度程序执行开始!........");
 
-            Date date=new Date();
+        Date date=new Date();
 
         windPowerInfo1Service.calLineInfoDay(date);
         windPowerInfo1Service.calProjectInfoDay(date);
@@ -236,7 +239,7 @@ public class SaticSchedulePgTask {
         windPowerInfo1Service.calCompanyInfoDay(date);
         windPowerInfo1Service.calRegionInfoDay(date);
 
-          XxlJobHelper.log("场站指标1指标调度程序执行完成!........");
+        XxlJobHelper.log("场站指标1指标调度程序执行完成!........");
 
     }