diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/ScheduledApplication.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/ScheduledApplication.java index d2772ca..63fb110 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/ScheduledApplication.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/ScheduledApplication.java @@ -18,7 +18,7 @@ import javax.annotation.Resource; @EnableBladeFeign @SpringCloudApplication @MapperScan("com.hnac.hzims.scheduled.**.mapper.**") -@ComponentScan(basePackages = {"com.hnac.*","org.springblade.core.*"}) +@ComponentScan(basePackages = {"com.hnac.*","org.springblade.core"}) @Resource public class ScheduledApplication { public static void main(String[] args) { diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/config/XxlJobConfig.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/config/XxlJobConfig.java index b587329..6b473a9 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/config/XxlJobConfig.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/config/XxlJobConfig.java @@ -1,59 +1,59 @@ -package com.hnac.hzims.scheduled.config; - -import com.xxl.job.core.executor.impl.XxlJobSpringExecutor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; - -/** - * @Author WL - * @Version v1.0 - * @Serial 1.0 - * @Date 2022/1/8 10:23 - */ -@Slf4j -@Configuration -//指定任务Handler所在包路径 -public class XxlJobConfig { - - - @Value("${xxl.job.admin.addresses}") - private String adminAddresses; - - @Value("${xxl.job.executor.appname}") - private String appName; - - @Value("${xxl.job.executor.ip}") - private String ip; - - @Value("${xxl.job.executor.port}") - private int port; - - @Value("${xxl.job.accessToken}") - private String accessToken; - - @Value("${xxl.job.executor.logpath}") - private String logPath; - - @Value("${xxl.job.executor.logretentiondays}") - private int logRetentionDays; - - - @Bean(initMethod = "start", destroyMethod = "destroy") - public XxlJobSpringExecutor xxlJobExecutor() { - log.info("====xxl-job config init===="); - XxlJobSpringExecutor xxlJobSpringExecutor = new XxlJobSpringExecutor(); - xxlJobSpringExecutor.setAdminAddresses(adminAddresses); - xxlJobSpringExecutor.setAppName(appName); - xxlJobSpringExecutor.setIp(ip); - xxlJobSpringExecutor.setPort(port); - xxlJobSpringExecutor.setAccessToken(accessToken); - xxlJobSpringExecutor.setLogPath(logPath); - xxlJobSpringExecutor.setLogRetentionDays(logRetentionDays); - return xxlJobSpringExecutor; - } - -} - +// package com.hnac.hzims.scheduled.config; +// +// import com.xxl.job.core.executor.impl.XxlJobSpringExecutor; +// import lombok.extern.slf4j.Slf4j; +// import org.springframework.beans.factory.annotation.Value; +// import org.springframework.context.annotation.Bean; +// import org.springframework.context.annotation.ComponentScan; +// import org.springframework.context.annotation.Configuration; +// +// /** +// * @Author WL +// * @Version v1.0 +// * @Serial 1.0 +// * @Date 2022/1/8 10:23 +// */ +// @Slf4j +// @Configuration +// //指定任务Handler所在包路径 +// public class XxlJobConfig { +// +// +// @Value("${xxl.job.admin.addresses}") +// private String adminAddresses; +// +// @Value("${xxl.job.executor.appname}") +// private String appName; +// +// @Value("${xxl.job.executor.ip}") +// private String ip; +// +// @Value("${xxl.job.executor.port}") +// private int port; +// +// @Value("${xxl.job.accessToken}") +// private String accessToken; +// +// @Value("${xxl.job.executor.logpath}") +// private String logPath; +// +// @Value("${xxl.job.executor.logretentiondays}") +// private int logRetentionDays; +// +// +// @Bean(initMethod = "start", destroyMethod = "destroy") +// public XxlJobSpringExecutor xxlJobExecutor() { +// log.info("====xxl-job config init===="); +// XxlJobSpringExecutor xxlJobSpringExecutor = new XxlJobSpringExecutor(); +// xxlJobSpringExecutor.setAdminAddresses(adminAddresses); +// xxlJobSpringExecutor.setAppName(appName); +// xxlJobSpringExecutor.setIp(ip); +// xxlJobSpringExecutor.setPort(port); +// xxlJobSpringExecutor.setAccessToken(accessToken); +// xxlJobSpringExecutor.setLogPath(logPath); +// xxlJobSpringExecutor.setLogRetentionDays(logRetentionDays); +// return xxlJobSpringExecutor; +// } +// +// } +// diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/HistoryAbnormalAlarmMapper.xml b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/HistoryAbnormalAlarmMapper.xml deleted file mode 100644 index fdbd02b..0000000 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/HistoryAbnormalAlarmMapper.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - \ No newline at end of file diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/StationMapper.xml b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/StationMapper.xml deleted file mode 100644 index e5e9daf..0000000 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/StationMapper.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/ScheduledCreateTask.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/ScheduledCreateTask.java index 280ab7e..81cb979 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/ScheduledCreateTask.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/ScheduledCreateTask.java @@ -31,7 +31,6 @@ public class ScheduledCreateTask { * @return ReturnT */ @XxlJob(LOAD_WATER_LEVEL) - //@Scheduled(cron = "0/40 * * * * ? ") public ReturnT loadWaterLevel(String param) throws Exception { if (Func.isBlank(param)) { param = DateUtil.format(new Date(), "yyyy-MM"); @@ -42,5 +41,14 @@ public class ScheduledCreateTask { + /** + * 水利-站点水位数据 + * @return ReturnT + */ + @XxlJob("cheshi") + public ReturnT cheshi(String param) throws Exception { + System.out.println("执行呢方法"); + return new ReturnT<>("SUCCESS"); + } } diff --git a/hzims-service/hzims-scheduled/src/main/resources/application.yml b/hzims-service/hzims-scheduled/src/main/resources/application.yml index 2f8c38f..e738d56 100644 --- a/hzims-service/hzims-scheduled/src/main/resources/application.yml +++ b/hzims-service/hzims-scheduled/src/main/resources/application.yml @@ -36,23 +36,38 @@ spring: # redis访问密码(默认为空) password: 1qaz2WSX@redis +#xxl: +# job: +# accessToken: '' +# admin: +# addresses: http://192.168.1.3:7009/xxl-job-admin +# executor: +# appname: hzims-operational +# ip: 192.168.1.3 +# logpath: /data/applogs/xxl-job/jobhandler +# logretentiondays: -1 +# port: 28501 + xxl: job: accessToken: '' admin: - addresses: http://192.168.1.3:7009/xxl-job-admin + addresses: http://192.168.5.128:9080/xxl-job-admin executor: appname: hzims-operational - ip: 192.168.1.3 + ip: 192.168.18.232 logpath: /data/applogs/xxl-job/jobhandler logretentiondays: -1 port: 28501 + #mybatis-plus配置 mybatis-plus: - mapper-locations: classpath:com/hnac/hzims/**/mapper/*Mapper.xml + mapper-locations: classpath*:/mapper/**/*.xml #实体扫描,多个package用逗号或者分号分隔 - typeAliasesPackage: com.hnac.hzims.**.entity +# typeAliasesPackage: com.hnac.hzims.**.entity + configuration: + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl #swagger扫描路径配置 swagger: diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/AbnormalAlarmMapper.xml b/hzims-service/hzims-scheduled/src/main/resources/mapper/operation/AbnormalAlarmMapper.xml similarity index 100% rename from hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/AbnormalAlarmMapper.xml rename to hzims-service/hzims-scheduled/src/main/resources/mapper/operation/AbnormalAlarmMapper.xml diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/StAlarmRecordMapper.xml b/hzims-service/hzims-scheduled/src/main/resources/mapper/operation/StAlarmRecordMapper.xml similarity index 100% rename from hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/operation/StAlarmRecordMapper.xml rename to hzims-service/hzims-scheduled/src/main/resources/mapper/operation/StAlarmRecordMapper.xml