10 files modified
16 files renamed
3 files deleted
12 files added
| | |
| | | <module>skjcmanager-plugin-api</module> |
| | | <module>skjcmanager-service</module> |
| | | <module>skjcmanager-service-api</module> |
| | | <module>skjcmanager-xxljob-api</module> |
| | | </modules> |
| | | |
| | | <dependencyManagement> |
| | |
| | | <module>skjcmanager-report</module> |
| | | <module>skjcmanager-resource</module> |
| | | <module>skjcmanager-swagger</module> |
| | | <module>skjcmanager-xxljob</module> |
| | | <module>skjcmanager-xxljob-admin</module> |
| | | </modules> |
| | | |
| | |
| | | <module>skjcmanager-user-api</module> |
| | | <module>skjcmanager-sm-api</module> |
| | | <module>skjcmanager-alerts-api</module> |
| | | <module>skjcmanager-xxljob-api</module> |
| | | </modules> |
| | | |
| | | <dependencies> |
| | |
| | | private String reservoirNumber; |
| | | |
| | | /** |
| | | * 告警人员电话 |
| | | */ |
| | | private String phone; |
| | | |
| | | /** |
| | | * 告警内容 |
| | | */ |
| | | private String alarmContent; |
| New file |
| | |
| | | package cn.gistack.sm.intelligentCall.feign; |
| | | |
| | | import cn.gistack.sm.sjztmd.feign.IAttResManagePersonClientFallback; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 智能外呼任务 feign |
| | | * @author zhongrj |
| | | */ |
| | | @FeignClient( |
| | | value = "blade-sm", |
| | | fallback = IAttResManagePersonClientFallback.class |
| | | ) |
| | | public interface OutCallClient { |
| | | |
| | | String API_PREFIX = "/client"; |
| | | String CREATE_OUT_CALL_TASK_JOB_HANDLER = API_PREFIX + "/createOutCallTaskJobHandler"; |
| | | String TEST_OUT_CALL = API_PREFIX + "/testOutCall"; |
| | | |
| | | /** |
| | | * 智能外呼定时创建任务执行器 |
| | | * @param isOver |
| | | * @param taskScheduleTime |
| | | * @param personNumber |
| | | * @param day |
| | | * @return |
| | | */ |
| | | @GetMapping(CREATE_OUT_CALL_TASK_JOB_HANDLER) |
| | | Object createOutCallTaskJobHandler(@RequestParam("isOver") String isOver, |
| | | @RequestParam("taskScheduleTime") String taskScheduleTime, |
| | | @RequestParam("personNumber") String personNumber, |
| | | @RequestParam("day") String day); |
| | | |
| | | /** |
| | | * 测试 |
| | | * @param isOver |
| | | * @param taskScheduleTime |
| | | * @param personNumber |
| | | * @param day |
| | | * @return |
| | | */ |
| | | @GetMapping(TEST_OUT_CALL) |
| | | Object testOutCall(@RequestParam("isOver") String isOver, |
| | | @RequestParam("taskScheduleTime") String taskScheduleTime, |
| | | @RequestParam("personNumber") String personNumber, |
| | | @RequestParam("day") String day); |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.intelligentCall.feign; |
| | | |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * 智能外呼Feign失败配置 |
| | | * @author zhongrj |
| | | * @date 2023/6/3 |
| | | */ |
| | | @Component |
| | | public class OutCallClientFallback implements OutCallClient { |
| | | @Override |
| | | public Object createOutCallTaskJobHandler(String isOver, String taskScheduleTime, String personNumber, String day) { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public Object testOutCall(String isOver, String taskScheduleTime, String personNumber, String day) { |
| | | return null; |
| | | } |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.patrol.feign; |
| | | |
| | | import cn.gistack.sm.sjztmd.feign.IAttResManagePersonClientFallback; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 巡查任务 feign |
| | | * @author zhongrj |
| | | */ |
| | | @FeignClient( |
| | | value = "blade-sm", |
| | | fallback = IAttResManagePersonClientFallback.class |
| | | ) |
| | | public interface PatrolTaskClient { |
| | | |
| | | String API_PREFIX = "/client"; |
| | | String CREATE_TASK_JOB_HANDLER = API_PREFIX + "/createTaskJobHandler"; |
| | | |
| | | /** |
| | | * 给巡查责任人定时创建任务执行器 |
| | | * @param processDefinitionId |
| | | * @param taskType |
| | | * @param title |
| | | * @param content |
| | | * @return |
| | | */ |
| | | @GetMapping(CREATE_TASK_JOB_HANDLER) |
| | | List<Integer> createTaskJobHandler(@RequestParam("processDefinitionId") String processDefinitionId, |
| | | @RequestParam("taskType") String taskType, |
| | | @RequestParam("title") String title, |
| | | @RequestParam("content") String content); |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.patrol.feign; |
| | | |
| | | import org.springframework.stereotype.Component; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @ClassName Feign失败配置 |
| | | * @Author zhongrj |
| | | * @Date 2023/6/3 |
| | | * @Version 1.0 |
| | | */ |
| | | @Component |
| | | public class PatrolTaskClientFallback implements PatrolTaskClient { |
| | | |
| | | @Override |
| | | public List<Integer> createTaskJobHandler(String processDefinitionId, String taskType, String title, String content) { |
| | | return null; |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <project xmlns="http://maven.apache.org/POM/4.0.0" |
| | | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| | | xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| | | <parent> |
| | | <artifactId>skjcmanager-service-api</artifactId> |
| | | <groupId>cn.gistack</groupId> |
| | | <version>3.0.1.RELEASE</version> |
| | | </parent> |
| | | <modelVersion>4.0.0</modelVersion> |
| | | |
| | | <artifactId>skjcmanager-xxljob-api</artifactId> |
| | | <name>${project.artifactId}</name> |
| | | <version>${bladex.project.version}</version> |
| | | <packaging>jar</packaging> |
| | | |
| | | </project> |
| | |
| | | <module>skjcmanager-user</module> |
| | | <module>skjcmanager-sm</module> |
| | | <module>skjcmanager-alerts</module> |
| | | <module>skjcmanager-xxljob</module> |
| | | </modules> |
| | | |
| | | <dependencies> |
| | |
| | | <!--通过id查询--> |
| | | <select id="getAlarmRuleDetailList" resultType="cn.gistack.alerts.alarmRule.vo.AlarmRuleDetailVO"> |
| | | select sard.*,sst.content as alarmContent |
| | | from sm_alarm_rule_detail sard left join sm_sms_template sst on sard.template_id = sst.template_id |
| | | from sm_alarm_rule_detail sard left join sm_sms_template sst on sard.template_id = sst.id |
| | | where sard.alarm_rule_id = #{id} |
| | | </select> |
| | | |
| | |
| | | |
| | | SmsRecord smsRecord = new SmsRecord(); |
| | | if (null != smsResult){ |
| | | alarmRecordDetail.setPhone(list.get(0)); |
| | | // 设置手机号 |
| | | request.setUserNumber(list.get(0)); |
| | | // 内容处理 |
| | |
| | | <artifactId>skjcmanager-alerts-api</artifactId> |
| | | <version>3.0.1.RELEASE</version> |
| | | </dependency> |
| | | <!--Job--> |
| | | <dependency> |
| | | <groupId>com.xuxueli</groupId> |
| | | <artifactId>xxl-job-core</artifactId> |
| | | <version>2.1.2</version> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
| New file |
| | |
| | | package cn.gistack.sm.intelligentCall.feign; |
| | | |
| | | import cn.gistack.sm.intelligentCall.service.CallService; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * Feign实现类 |
| | | * @author zhongrj |
| | | * @date 2023-06-03 |
| | | */ |
| | | @NonDS |
| | | @ApiIgnore |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @Slf4j |
| | | public class OutCallImplImplClient implements OutCallClient { |
| | | |
| | | private final CallService callService; |
| | | |
| | | @Override |
| | | @GetMapping(CREATE_OUT_CALL_TASK_JOB_HANDLER) |
| | | public Object createOutCallTaskJobHandler(String isOver, String taskScheduleTime, String personNumber, String day) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("isOver",isOver); |
| | | map.put("taskScheduleTime",taskScheduleTime); |
| | | map.put("personNumber",personNumber); |
| | | map.put("day",day); |
| | | // 创建定时任务并返回 |
| | | return callService.createCallTaskByParam(map); |
| | | } |
| | | |
| | | /** |
| | | * 测试 |
| | | * @param isOver |
| | | * @param taskScheduleTime |
| | | * @param personNumber |
| | | * @param day |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Object testOutCall(String isOver, String taskScheduleTime, String personNumber, String day) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("isOver",isOver); |
| | | map.put("taskScheduleTime",taskScheduleTime); |
| | | map.put("personNumber",personNumber); |
| | | map.put("day",day); |
| | | // 创建定时任务并返回 |
| | | return "测试返回成功"; |
| | | } |
| | | } |
| New file |
| | |
| | | package cn.gistack.sm.patrol.feign; |
| | | |
| | | import cn.gistack.sm.intelligentCall.service.CallService; |
| | | import cn.gistack.sm.patrol.entity.PatrolTask; |
| | | import cn.gistack.sm.patrol.service.IPatrolTaskService; |
| | | import cn.gistack.sm.sjztmd.entity.PatrolResponsiblePerson; |
| | | import cn.gistack.sm.sjztmd.service.IAttResManagePersonService; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.concurrent.atomic.AtomicInteger; |
| | | |
| | | /** |
| | | * @ClassName SM服务Feign实现类 |
| | | * @Description TODO |
| | | * @Author zhongrj |
| | | * @Date 2023-06-03 |
| | | */ |
| | | @NonDS |
| | | @ApiIgnore |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @Slf4j |
| | | public class PatrolTaskImplClient implements PatrolTaskClient { |
| | | |
| | | private final IPatrolTaskService patrolTaskService; |
| | | |
| | | private final IAttResManagePersonService attResManagePersonService; |
| | | |
| | | /** |
| | | * 给巡查责任人定时创建任务执行器 |
| | | * @param processDefinitionId |
| | | * @param taskType |
| | | * @param title |
| | | * @param content |
| | | * @return |
| | | */ |
| | | @Override |
| | | @GetMapping(CREATE_TASK_JOB_HANDLER) |
| | | public List<Integer> createTaskJobHandler(String processDefinitionId, |
| | | String taskType, |
| | | String title, |
| | | String content) { |
| | | List<PatrolResponsiblePerson> patrolResponsiblePersonList = attResManagePersonService.getPatrolResponsiblePersonAll(); |
| | | AtomicInteger failureCount = new AtomicInteger(); |
| | | patrolResponsiblePersonList.forEach(item -> { |
| | | log.info("当前创建任务对象:" + JSON.toJSONString(item)); |
| | | try { |
| | | PatrolTask patrolTask = new PatrolTask(); |
| | | patrolTask.setProcessDefinitionId(processDefinitionId); |
| | | patrolTask.setToUserId(item.getUserId()); |
| | | patrolTask.setProjectId(item.getResGuid()); |
| | | patrolTask.setReservoirName(item.getName()); |
| | | // 开始时间-结束时间 |
| | | patrolTask.setStartTime(DateUtil.format(new Date(),"yyyy-MM-dd 00:00:00")); |
| | | patrolTask.setEndTime(DateUtil.format(new Date(),"yyyy-MM-dd 23:59:59")); |
| | | // 标题格式 月-日 水库名称 每日巡检任务 |
| | | patrolTask.setTitle(DateUtil.format(new Date(),"MM-dd") + item.getName() + "-" + title); |
| | | patrolTask.setContent(DateUtil.format(new Date(),"yyyyMMdd") +content); |
| | | patrolTask.setTaskType(taskType); |
| | | // 创建任务 |
| | | patrolTaskService.startProcess(patrolTask); |
| | | } catch (Exception e) { |
| | | log.error("创建任务失败对象:" + JSON.toJSONString(item)); |
| | | failureCount.getAndIncrement(); |
| | | } |
| | | |
| | | }); |
| | | List<Integer> list = new ArrayList<>(); |
| | | list.add(patrolResponsiblePersonList.size()); |
| | | list.add(failureCount.get()); |
| | | // 返回 |
| | | return list; |
| | | } |
| | | } |
| | |
| | | password: ${blade.datasource.dev.xxljob.password} |
| | | main: |
| | | allow-circular-references: true |
| | | xxl: |
| | | job: |
| | | accessToken: '' |
| | | admin: |
| | | ### 调度中心部署根地址 [选填]:如调度中心集群部署存在多个地址则用逗号分隔。执行器将会使用该地址进行"执行器心跳注册"和"任务结果回调";为空则关闭自动注册; |
| | | addresses: http://127.0.0.1:7009/xxl-job-admin |
| | | executor: |
| | | ### 执行器AppName [选填]:执行器心跳注册分组依据;为空则关闭自动注册 |
| | | appname: blade-xxljob |
| | | ### 执行器IP [选填]:默认为空表示自动获取IP,多网卡时可手动设置指定IP,该IP不会绑定Host仅作为通讯实用;地址信息用于 "执行器注册" 和 "调度中心请求并触发任务"; |
| | | ip: 127.0.0.1 |
| | | ### 执行器运行日志文件存储磁盘路径 [选填] :需要对该路径拥有读写权限;为空则使用默认路径; |
| | | logpath: ../data/applogs/xxl-job/jobhandler |
| | | ### 执行器日志文件保存天数 [选填] : 过期日志自动清理, 限制值大于等于3时生效; 否则, 如-1, 关闭自动清理功能; |
| | | logretentiondays: -1 |
| | | ### 执行器端口号 [选填]:小于等于0则自动获取;默认端口为9999,单机部署多个执行器时,注意要配置不同执行器端口; |
| | | port: 7018 |
| | | #xxl: |
| | | # job: |
| | | # accessToken: '' |
| | | # admin: |
| | | # ### 调度中心部署根地址 [选填]:如调度中心集群部署存在多个地址则用逗号分隔。执行器将会使用该地址进行"执行器心跳注册"和"任务结果回调";为空则关闭自动注册; |
| | | # addresses: http://127.0.0.1:7009/xxl-job-admin |
| | | # executor: |
| | | # ### 执行器AppName [选填]:执行器心跳注册分组依据;为空则关闭自动注册 |
| | | # appname: blade-xxljob |
| | | # ### 执行器IP [选填]:默认为空表示自动获取IP,多网卡时可手动设置指定IP,该IP不会绑定Host仅作为通讯实用;地址信息用于 "执行器注册" 和 "调度中心请求并触发任务"; |
| | | # ip: 127.0.0.1 |
| | | # ### 执行器运行日志文件存储磁盘路径 [选填] :需要对该路径拥有读写权限;为空则使用默认路径; |
| | | # logpath: ../data/applogs/xxl-job/jobhandler |
| | | # ### 执行器日志文件保存天数 [选填] : 过期日志自动清理, 限制值大于等于3时生效; 否则, 如-1, 关闭自动清理功能; |
| | | # logretentiondays: -1 |
| | | # ### 执行器端口号 [选填]:小于等于0则自动获取;默认端口为9999,单机部署多个执行器时,注意要配置不同执行器端口; |
| | | # port: 7018 |
| | |
| | | password: ${blade.datasource.prod.xxljob.password} |
| | | main: |
| | | allow-circular-references: true |
| | | xxl: |
| | | job: |
| | | accessToken: '' |
| | | admin: |
| | | ### 调度中心部署根地址 [选填]:如调度中心集群部署存在多个地址则用逗号分隔。执行器将会使用该地址进行"执行器心跳注册"和"任务结果回调";为空则关闭自动注册; |
| | | addresses: http://127.0.0.1:7009/xxl-job-admin |
| | | executor: |
| | | ### 执行器AppName [选填]:执行器心跳注册分组依据;为空则关闭自动注册 |
| | | appname: blade-xxljob |
| | | ### 执行器IP [选填]:默认为空表示自动获取IP,多网卡时可手动设置指定IP,该IP不会绑定Host仅作为通讯实用;地址信息用于 "执行器注册" 和 "调度中心请求并触发任务"; |
| | | ip: 127.0.0.1 |
| | | ### 执行器运行日志文件存储磁盘路径 [选填] :需要对该路径拥有读写权限;为空则使用默认路径; |
| | | logpath: ../data/applogs/xxl-job/jobhandler |
| | | ### 执行器日志文件保存天数 [选填] : 过期日志自动清理, 限制值大于等于3时生效; 否则, 如-1, 关闭自动清理功能; |
| | | logretentiondays: -1 |
| | | ### 执行器端口号 [选填]:小于等于0则自动获取;默认端口为9999,单机部署多个执行器时,注意要配置不同执行器端口; |
| | | port: 7018 |
| | | #xxl: |
| | | # job: |
| | | # accessToken: '' |
| | | # admin: |
| | | # ### 调度中心部署根地址 [选填]:如调度中心集群部署存在多个地址则用逗号分隔。执行器将会使用该地址进行"执行器心跳注册"和"任务结果回调";为空则关闭自动注册; |
| | | # addresses: http://127.0.0.1:7009/xxl-job-admin |
| | | # executor: |
| | | # ### 执行器AppName [选填]:执行器心跳注册分组依据;为空则关闭自动注册 |
| | | # appname: blade-xxljob |
| | | # ### 执行器IP [选填]:默认为空表示自动获取IP,多网卡时可手动设置指定IP,该IP不会绑定Host仅作为通讯实用;地址信息用于 "执行器注册" 和 "调度中心请求并触发任务"; |
| | | # ip: 127.0.0.1 |
| | | # ### 执行器运行日志文件存储磁盘路径 [选填] :需要对该路径拥有读写权限;为空则使用默认路径; |
| | | # logpath: ../data/applogs/xxl-job/jobhandler |
| | | # ### 执行器日志文件保存天数 [选填] : 过期日志自动清理, 限制值大于等于3时生效; 否则, 如-1, 关闭自动清理功能; |
| | | # logretentiondays: -1 |
| | | # ### 执行器端口号 [选填]:小于等于0则自动获取;默认端口为9999,单机部署多个执行器时,注意要配置不同执行器端口; |
| | | # port: 7018 |
| File was renamed from skjcmanager/skjcmanager-ops/skjcmanager-xxljob/pom.xml |
| | |
| | | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| | | xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| | | <parent> |
| | | <artifactId>skjcmanager-ops</artifactId> |
| | | <artifactId>skjcmanager-service</artifactId> |
| | | <groupId>cn.gistack</groupId> |
| | | <version>3.0.1.RELEASE</version> |
| | | </parent> |
| | |
| | | <artifactId>skjcmanager-common</artifactId> |
| | | <version>${bladex.project.version}</version> |
| | | </dependency> |
| | | <!--开启多数据源--> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>blade-core-auto</artifactId> |
| | | <scope>compile</scope> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>blade-core-boot</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>blade-core-cloud</artifactId> |
| | |
| | | <groupId>com.xuxueli</groupId> |
| | | <artifactId>xxl-job-core</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>cn.gistack</groupId> |
| | | <artifactId>skjcmanager-sm-api</artifactId> |
| | | <version>3.0.1.RELEASE</version> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
| File was renamed from skjcmanager/skjcmanager-ops/skjcmanager-xxljob/src/main/java/cn/gistack/job/executor/JobApplication.java |
| | |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package cn.gistack.job.executor; |
| | | package cn.gistack.job; |
| | | |
| | | import cn.gistack.common.constant.LauncherConstant; |
| | | import org.mybatis.spring.annotation.MapperScan; |
| | | import org.springblade.core.cloud.client.BladeCloudApplication; |
| | | import org.springblade.core.launch.BladeApplication; |
| | | import org.springframework.cloud.openfeign.EnableFeignClients; |
| | | |
| | | /** |
| | | * Job启动器 |
| | |
| | | * @author Chill |
| | | */ |
| | | @BladeCloudApplication |
| | | @EnableFeignClients({"cn.gistack"}) |
| | | @MapperScan({"org.springblade.**.mapper.**","cn.gistack.job.**.mapper.**"}) |
| | | public class JobApplication { |
| | | |
| | | public static void main(String[] args) { |
| File was renamed from skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/xxljob/config/XxlJobConfig.java |
| | |
| | | package cn.gistack.sm.xxljob.config; |
| | | package cn.gistack.job.executor.config; |
| | | |
| | | import com.xxl.job.core.executor.impl.XxlJobSpringExecutor; |
| | | import org.slf4j.Logger; |
| File was renamed from skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/xxljob/controller/TaskXxlJobController.java |
| | |
| | | package cn.gistack.sm.xxljob.controller; |
| | | package cn.gistack.job.executor.controller; |
| | | |
| | | import cn.gistack.sm.xxljob.entity.XxlJobInfo; |
| | | import cn.gistack.sm.xxljob.service.IXxlJobInfoService; |
| | | import cn.gistack.sm.xxljob.vo.XxlJobInfoVO; |
| | | import cn.gistack.job.executor.entity.XxlJobInfo; |
| | | import cn.gistack.job.executor.service.IXxlJobInfoService; |
| | | import cn.gistack.job.executor.vo.XxlJobInfoVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| File was renamed from skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/xxljob/entity/XxlJobInfo.java |
| | |
| | | package cn.gistack.sm.xxljob.entity; |
| | | package cn.gistack.job.executor.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler; |
| File was renamed from skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/xxljob/entity/XxlJobInfoType.java |
| | |
| | | package cn.gistack.sm.xxljob.entity; |
| | | package cn.gistack.job.executor.entity; |
| | | |
| | | import lombok.Data; |
| | | |
| New file |
| | |
| | | package cn.gistack.job.executor.jobhandler; |
| | | |
| | | import cn.gistack.sm.intelligentCall.feign.OutCallClient; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.xxl.job.core.biz.model.ReturnT; |
| | | import com.xxl.job.core.handler.annotation.XxlJob; |
| | | import com.xxl.job.core.log.XxlJobLogger; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * 智能外呼定时任务执行器 |
| | | * @author zhongrj |
| | | * @date 2023-06-03 |
| | | */ |
| | | @Component |
| | | public class OutCallXxlJob { |
| | | |
| | | @Autowired |
| | | private OutCallClient outCallClient; |
| | | |
| | | /** |
| | | * 智能外呼定时创建任务执行器 |
| | | * @param param |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @XxlJob("createOutCallTaskJobHandler") |
| | | public ReturnT<String> createOutCallTaskJobHandler(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | JSONObject jsonParam = JSON.parseObject(param); |
| | | String isOver = jsonParam.getString("isOver"); |
| | | String taskScheduleTime = jsonParam.getString("taskScheduleTime"); |
| | | String personNumber = jsonParam.getString("personNumber"); |
| | | String day = jsonParam.getString("day"); |
| | | // 创建外呼任务 |
| | | Object result = outCallClient.createOutCallTaskJobHandler(isOver,taskScheduleTime,personNumber, day); |
| | | XxlJobLogger.log("任务响应结果:" + result); |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | /** |
| | | * 测试 |
| | | * @param param |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @XxlJob("testOutCall") |
| | | public ReturnT<String> testOutCall(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | JSONObject jsonParam = JSON.parseObject(param); |
| | | String isOver = jsonParam.getString("isOver"); |
| | | String taskScheduleTime = jsonParam.getString("taskScheduleTime"); |
| | | String personNumber = jsonParam.getString("personNumber"); |
| | | String day = jsonParam.getString("day"); |
| | | // 创建外呼任务 |
| | | Object result = outCallClient.testOutCall(isOver,taskScheduleTime,personNumber, day); |
| | | XxlJobLogger.log("任务响应结果:" + result); |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | } |
| New file |
| | |
| | | package cn.gistack.job.executor.jobhandler; |
| | | |
| | | import cn.gistack.sm.patrol.feign.PatrolTaskClient; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.xxl.job.core.biz.model.ReturnT; |
| | | import com.xxl.job.core.handler.annotation.XxlJob; |
| | | import com.xxl.job.core.log.XxlJobLogger; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 巡查任务定时任务执行器 |
| | | * @author zhongrj |
| | | * @date 2023-06-03 |
| | | */ |
| | | @Component |
| | | public class PatrolXxlJob { |
| | | |
| | | @Autowired |
| | | private PatrolTaskClient patrolTasClient; |
| | | |
| | | /** |
| | | * 给巡查责任人定时创建任务执行器 |
| | | * @param param |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @XxlJob("createTaskJobHandler") |
| | | public ReturnT<String> createTaskJobHandler(String param){ |
| | | XxlJobLogger.log("开始自动创建任务..."); |
| | | JSONObject jsonParam = JSON.parseObject(param); |
| | | String processDefinitionId = jsonParam.getString("processDefinitionId"); |
| | | String taskType = jsonParam.getString("taskType"); |
| | | String title = jsonParam.getString("title"); |
| | | String content = jsonParam.getString("content"); |
| | | // 远程调用 |
| | | List<Integer> taskJobHandler = patrolTasClient.createTaskJobHandler(processDefinitionId, taskType, title, content); |
| | | // 打印响应数据 |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | XxlJobLogger.log("总数量:<span style='color:red'>" + taskJobHandler.get(0) + "</span> ... 失败数量:<span style='color:red'>" + taskJobHandler.get(1) + "</span> "); |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | } |
| New file |
| | |
| | | package cn.gistack.job.executor.launch; |
| | | |
| | | import cn.gistack.common.constant.LauncherConstant; |
| | | import org.springblade.core.auto.service.AutoService; |
| | | import org.springblade.core.launch.service.LauncherService; |
| | | import org.springblade.core.launch.utils.PropsUtil; |
| | | import org.springframework.boot.builder.SpringApplicationBuilder; |
| | | |
| | | import java.util.Properties; |
| | | |
| | | /** |
| | | * 启动参数拓展 |
| | | * |
| | | * @author smallchil |
| | | */ |
| | | @AutoService(LauncherService.class) |
| | | public class SmLauncherServiceImpl implements LauncherService { |
| | | |
| | | @Override |
| | | public void launcher(SpringApplicationBuilder builder, String appName, String profile, boolean isLocalDev) { |
| | | Properties props = System.getProperties(); |
| | | // 通用注册 |
| | | PropsUtil.setProperty(props, "spring.cloud.nacos.discovery.server-addr", LauncherConstant.nacosAddr(profile)); |
| | | PropsUtil.setProperty(props, "spring.cloud.nacos.config.server-addr", LauncherConstant.nacosAddr(profile)); |
| | | |
| | | |
| | | PropsUtil.setProperty(props, "spring.cloud.sentinel.transport.dashboard", LauncherConstant.sentinelAddr(profile)); |
| | | PropsUtil.setProperty(props, "spring.zipkin.base-url", LauncherConstant.zipkinAddr(profile)); |
| | | //开启多数据源 |
| | | PropsUtil.setProperty(props, "spring.datasource.dynamic.enabled", "true"); |
| | | |
| | | // 开启elk日志 |
| | | // PropsUtil.setProperty(props, "blade.log.elk.destination", LauncherConstant.elkAddr(profile)); |
| | | |
| | | // seata注册地址 |
| | | // PropsUtil.setProperty(props, "seata.service.grouplist.default", LauncherConstant.seataAddr(profile)); |
| | | // seata注册group格式 |
| | | // PropsUtil.setProperty(props, "seata.tx-service-group", LauncherConstant.seataServiceGroup(appName)); |
| | | // seata配置服务group |
| | | // PropsUtil.setProperty(props, "seata.service.vgroup-mapping.".concat(LauncherConstant.seataServiceGroup(appName)), LauncherConstant.DEFAULT_MODE); |
| | | // seata注册模式配置 |
| | | // PropsUtil.setProperty(props, "seata.registry.type", LauncherConstant.NACOS_MODE); |
| | | // PropsUtil.setProperty(props, "seata.registry.nacos.server-addr", LauncherConstant.nacosAddr(profile)); |
| | | // PropsUtil.setProperty(props, "seata.config.type", LauncherConstant.NACOS_MODE); |
| | | // PropsUtil.setProperty(props, "seata.config.nacos.server-addr", LauncherConstant.nacosAddr(profile)); |
| | | } |
| | | |
| | | } |
| File was renamed from skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/xxljob/mapper/XxlJobInfoMapper.java |
| | |
| | | package cn.gistack.sm.xxljob.mapper; |
| | | package cn.gistack.job.executor.mapper; |
| | | |
| | | import cn.gistack.sm.xxljob.entity.XxlJobInfo; |
| | | import cn.gistack.sm.xxljob.entity.XxlJobInfoType; |
| | | import cn.gistack.sm.xxljob.vo.XxlJobInfoVO; |
| | | import cn.gistack.job.executor.entity.XxlJobInfo; |
| | | import cn.gistack.job.executor.entity.XxlJobInfoType; |
| | | import cn.gistack.job.executor.vo.XxlJobInfoVO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.apache.ibatis.annotations.Param; |
| File was renamed from skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/xxljob/mapper/XxlJobInfoMapper.xml |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="cn.gistack.sm.xxljob.mapper.XxlJobInfoMapper"> |
| | | <mapper namespace="cn.gistack.job.executor.mapper.XxlJobInfoMapper"> |
| | | |
| | | <!--自定义分页查询定时任务列表信息--> |
| | | <select id="selectXxlJobPage" resultType="cn.gistack.sm.xxljob.vo.XxlJobInfoVO"> |
| | | <select id="selectXxlJobPage" resultType="cn.gistack.job.executor.vo.XxlJobInfoVO"> |
| | | select xji.* from YWXT_JOB.xxl_job_info xji |
| | | left join YWXT.xxl_job_info_type xjit on xji.id = xjit.xxl_job_info_id |
| | | where 1=1 |
| File was renamed from skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/xxljob/service/IXxlJobInfoService.java |
| | |
| | | package cn.gistack.sm.xxljob.service; |
| | | package cn.gistack.job.executor.service; |
| | | |
| | | import cn.gistack.sm.xxljob.entity.XxlJobInfo; |
| | | import cn.gistack.sm.xxljob.vo.XxlJobInfoVO; |
| | | import cn.gistack.job.executor.entity.XxlJobInfo; |
| | | import cn.gistack.job.executor.vo.XxlJobInfoVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| File was renamed from skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/xxljob/service/impl/XxlJobInfoServiceImpl.java |
| | |
| | | package cn.gistack.sm.xxljob.service.impl; |
| | | package cn.gistack.job.executor.service.impl; |
| | | |
| | | import cn.gistack.sm.xxljob.entity.XxlJobInfo; |
| | | import cn.gistack.sm.xxljob.entity.XxlJobInfoType; |
| | | import cn.gistack.sm.xxljob.mapper.XxlJobInfoMapper; |
| | | import cn.gistack.sm.xxljob.service.IXxlJobInfoService; |
| | | import cn.gistack.sm.xxljob.vo.XxlJobInfoVO; |
| | | import cn.gistack.job.executor.entity.XxlJobInfo; |
| | | import cn.gistack.job.executor.entity.XxlJobInfoType; |
| | | import cn.gistack.job.executor.mapper.XxlJobInfoMapper; |
| | | import cn.gistack.job.executor.service.IXxlJobInfoService; |
| | | import cn.gistack.job.executor.vo.XxlJobInfoVO; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| File was renamed from skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/xxljob/vo/XxlJobInfoVO.java |
| | |
| | | package cn.gistack.sm.xxljob.vo; |
| | | package cn.gistack.job.executor.vo; |
| | | |
| | | import cn.gistack.sm.xxljob.entity.XxlJobInfo; |
| | | import cn.gistack.job.executor.entity.XxlJobInfo; |
| | | import lombok.Data; |
| | | |
| | | /** |
| New file |
| | |
| | | #多数据源配置 |
| | | spring: |
| | | #排除DruidDataSourceAutoConfigure |
| | | autoconfigure: |
| | | exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure |
| | | datasource: |
| | | dynamic: |
| | | #设置默认的数据源或者数据源组,默认值即为master |
| | | primary: master |
| | | datasource: |
| | | ## 业务默认数据源 |
| | | master: |
| | | url: ${blade.datasource.dev.url} |
| | | username: ${blade.datasource.dev.username} |
| | | password: ${blade.datasource.dev.password} |
| | | ##中台数据源 |
| | | zt: |
| | | url: ${blade.datasource.dev.zt.url} |
| | | username: ${blade.datasource.dev.zt.username} |
| | | password: ${blade.datasource.dev.zt.password} |
| | | # 智能外呼数据库 |
| | | ztznwh: |
| | | url: ${blade.datasource.dev.ztznwh.url} |
| | | username: ${blade.datasource.dev.ztznwh.username} |
| | | password: ${blade.datasource.dev.ztznwh.password} |
| | | ## 定时器数据源 |
| | | xxljob: |
| | | url: ${blade.datasource.dev.xxljob.url} |
| | | username: ${blade.datasource.dev.xxljob.username} |
| | | password: ${blade.datasource.dev.xxljob.password} |
| | | main: |
| | | allow-circular-references: true |
| | | |
| New file |
| | |
| | | #多数据源配置 |
| | | spring: |
| | | #排除DruidDataSourceAutoConfigure |
| | | autoconfigure: |
| | | exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure |
| | | datasource: |
| | | dynamic: |
| | | #设置默认的数据源或者数据源组,默认值即为master |
| | | primary: master |
| | | datasource: |
| | | master: |
| | | url: ${blade.datasource.prod.url} |
| | | username: ${blade.datasource.prod.username} |
| | | password: ${blade.datasource.prod.password} |
| | | zt: |
| | | url: ${blade.datasource.prod.zt.url} |
| | | username: ${blade.datasource.prod.zt.username} |
| | | password: ${blade.datasource.prod.zt.password} |
| | | # 智能外呼数据库 |
| | | ztznwh: |
| | | url: ${blade.datasource.prod.ztznwh.url} |
| | | username: ${blade.datasource.prod.ztznwh.username} |
| | | password: ${blade.datasource.prod.ztznwh.password} |
| | | ## 定时器数据源 |
| | | xxljob: |
| | | url: ${blade.datasource.prod.xxljob.url} |
| | | username: ${blade.datasource.prod.xxljob.username} |
| | | password: ${blade.datasource.prod.xxljob.password} |
| | | main: |
| | | allow-circular-references: true |
| | | |