From afa83268af051903b4a30dc5ab670405b1321e18 Mon Sep 17 00:00:00 2001 From: wu Date: Thu, 6 Jun 2024 09:27:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/mudu/quartz/AcheckTaskQuartz.java | 56 +++++++++++------ src/main/resources/application-prod.yml | 6 +- src/main/resources/application-test.yml | 60 +++++++++++++++++++ 3 files changed, 98 insertions(+), 24 deletions(-) create mode 100644 src/main/resources/application-test.yml diff --git a/src/main/java/com/mudu/quartz/AcheckTaskQuartz.java b/src/main/java/com/mudu/quartz/AcheckTaskQuartz.java index 2347c07..41af08b 100644 --- a/src/main/java/com/mudu/quartz/AcheckTaskQuartz.java +++ b/src/main/java/com/mudu/quartz/AcheckTaskQuartz.java @@ -5,13 +5,36 @@ import cn.hutool.core.util.StrUtil; import cn.hutool.http.HttpRequest; import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.JSONObject; -import com.mudu.base.domain.AjaxResult; -import com.mudu.entity.*; +import com.mudu.entity.ACheckQuatzEntity; +import com.mudu.entity.ACheckQuatzZichaEntity; +import com.mudu.entity.ASafeQyjcxx; +import com.mudu.entity.ASafeRwfj; +import com.mudu.entity.ASafeRwzq; +import com.mudu.entity.ASafeXcrw; +import com.mudu.entity.ASafeXcrwjcx; +import com.mudu.entity.ASafeXcrwjcxzgxx; +import com.mudu.entity.ASafeXcrwwz; +import com.mudu.entity.ASafeYhzgxx; +import com.mudu.entity.ASafeZcrw; +import com.mudu.entity.ASafeZcrwjl; +import com.mudu.entity.ASafeZcrwwz; +import com.mudu.entity.SzsASafeZcyhxx; import com.mudu.entity.dto.request.ACheckQuatzRequest; import com.mudu.entity.dto.request.ACheckQuatzZichaRequest; import com.mudu.entity.dto.response.ACheckXcTpResponse; import com.mudu.entity.dto.response.RwzqUuidResponse; -import com.mudu.service.*; +import com.mudu.service.ASafeQyjcxxService; +import com.mudu.service.ASafeRwfjService; +import com.mudu.service.ASafeRwzqService; +import com.mudu.service.ASafeXcrwService; +import com.mudu.service.ASafeXcrwjcxService; +import com.mudu.service.ASafeXcrwjcxzgxxService; +import com.mudu.service.ASafeXcrwwzService; +import com.mudu.service.ASafeYhzgxxService; +import com.mudu.service.ASafeZcrwService; +import com.mudu.service.ASafeZcrwjlService; +import com.mudu.service.ASafeZcrwwzService; +import com.mudu.service.SzsASafeZcyhxxService; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Configuration; import org.springframework.scheduling.annotation.EnableScheduling; @@ -25,8 +48,6 @@ import java.util.Date; import java.util.List; import java.util.UUID; -import static com.mudu.base.domain.AjaxResult.success; - /** * @author dong * @since 2024/3/12 16:37 @@ -109,21 +130,21 @@ public class AcheckTaskQuartz { @Value("${xczqUrl}") private String xczqUrl; + /** * 新增创建时间为昨天且处于审批通过的工单数据 * * @Param qymc 企业名称 */ // @Scheduled(cron = "0 0 4 * * ? ") - @Scheduled(cron = "0 0/5 * * * ?") // @PostMapping("/insert") // @ApiOperation(value = "新增创建时间为昨天且处于审批通过的工单数据") - public AjaxResult selectAll() throws ParseException { + public void selectAll() throws ParseException { // todo 查询巡查任务主表2月是否有记录就不推 Integer xcrwNum = aSafeXcrwService.xcrwNum(); if (xcrwNum > 0) { - throw new IllegalArgumentException("已存在数据"); + return; } //巡查任务周期id RwzqUuidResponse rwzqUuidResponse = aSafeRwzqService.getXcUuid(); @@ -132,11 +153,11 @@ public class AcheckTaskQuartz { JSONObject jsonResponseList = JSON.parseObject(responseList); String dataList = jsonResponseList.getString("data"); if (StrUtil.isEmpty(dataList)) { - return null; + return; } List list = JSON.parseArray(dataList, ACheckQuatzRequest.class); if (CollectionUtil.isEmpty(list)) { - return null; + return; } for (ACheckQuatzRequest a : list) { //获取企业编号 @@ -219,8 +240,6 @@ public class AcheckTaskQuartz { } } - - return success(); } /** @@ -582,16 +601,16 @@ public class AcheckTaskQuartz { } -// @Scheduled(cron = "0 0 4 * * ? ") -@Scheduled(cron = "0 0/5 * * * ?") + // @Scheduled(cron = "0 0 4 * * ? ") + @Scheduled(cron = "0 0/5 * * * ?") //@Scheduled(cron = "0 58 18 * * ?") // @PostMapping("/zicha") // @ApiOperation(value = "自查") - public AjaxResult zicha() throws ParseException { + public void zicha() throws ParseException { // todo 查询自查任务主表本月是否有记录 有就不推 Integer zcrwNum = aSafeZcrwService.zcrwNum(); if (zcrwNum > 0) { - throw new IllegalArgumentException("已存在数据"); + return; } //自己查任务周期id RwzqUuidResponse rwzqUuidResponse = aSafeRwzqService.getZcUuid(); @@ -600,11 +619,11 @@ public class AcheckTaskQuartz { JSONObject jsonResponseList = JSON.parseObject(responseList); String dataList = jsonResponseList.getString("data"); if (StrUtil.isEmpty(dataList)) { - return null; + return; } List list = JSON.parseArray(dataList, ACheckQuatzZichaRequest.class); if (CollectionUtil.isEmpty(list)) { - return null; + return; } for (ACheckQuatzZichaRequest a : list) { JSONObject zcjsonObject = new JSONObject(); @@ -666,7 +685,6 @@ public class AcheckTaskQuartz { saveZihaYhzgxx(list, a, b, yhzgxxUuid, zcrwUuid, rwzqUuid, zcrwUuid); } } - return success(); } /** diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml index b2ba250..8494f6b 100644 --- a/src/main/resources/application-prod.yml +++ b/src/main/resources/application-prod.yml @@ -37,9 +37,7 @@ improveUrl: http://221.229.220.83:9028/mudu/quatz/xctp zcUrl: http://221.229.220.83:9028/mudu/quatz/zctp #图片路径 -#api: http://221.229.220.83:8007/api/ -api: http://39.101.188.84:9028/api/ - +api: http://221.229.220.83:8007/api/ #获取工单信息 imUrl: http://221.229.220.83:9028/mudu/quatz/get @@ -53,10 +51,8 @@ bqbhUrl: http://221.229.220.83:9028/mudu/aSafeBqbhpx/findAll # 特殊作业 tszyUrl: http://221.229.220.83:9028/mudu/aSafeQyzypgl/findAll - #自查周期url zczqUrl: http://221.229.220.83:9028/mudu/aSafeZcrwRead - #巡查周期url xczqUrl: http://221.229.220.83:9028/mudu/aSafeXcrwRead \ No newline at end of file diff --git a/src/main/resources/application-test.yml b/src/main/resources/application-test.yml new file mode 100644 index 0000000..e575958 --- /dev/null +++ b/src/main/resources/application-test.yml @@ -0,0 +1,60 @@ +# DataSource Config +spring: + datasource: + url: jdbc:mysql://2.38.12.18:23306/wzawb?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 + username: wzawb + password: wzawbpassword + driverClassName: com.mysql.cj.jdbc.Driver + + + +# 日志配置 +logging: + level: + com.mudu: debug + org.springframework: warn + +# MyBatis配置 +mybatis-plus: + # 指定实体类所在包的路径,MyBatis-Plus 会自动扫描该路径下的实体类 + typeAliasesPackage: com.mudu.entity + # 指定 Mapper 接口所在包的路径,MyBatis-Plus 会自动扫描该路径下的 Mapper 接口 + mapperLocations: classpath*:mapper/mudu/*Mapper.xml + +knife4j: + enable: true + openapi: + group: + test1: + group-name: 木渎 + +url: http://localhost:9028 + +#工单url +improveUrl: http://39.101.188.84:9028/mudu/quatz/xctp + +#自查url +zcUrl: http://39.101.188.84:9028/mudu/quatz/zctp + +#图片路径 +api: http://mdapi.junln.net/api/ + +#获取工单信息 +imUrl: http://39.101.188.84:9028/mudu/quatz/get + +#获取自查信息 +zcXxUrl: http://39.101.188.84:9028/mudu/quatz/zicha + +# 班前班后 +bqbhUrl: http://39.101.188.84:9028/mudu/aSafeBqbhpx/findAll + +# 特殊作业 +tszyUrl: http://39.101.188.84:9028/mudu/aSafeQyzypgl/findAll + + +#自查周期url +zczqUrl: http://39.101.188.84:9028/mudu/aSafeZcrwRead + + +#巡查周期url +xczqUrl: http://39.101.188.84:9028/mudu/aSafeXcrwRead \ No newline at end of file