From 2c43d2ea1fd4c83719253f5a745b9da898571cce Mon Sep 17 00:00:00 2001 From: Guoqs <123@jsowell.com> Date: Tue, 25 Mar 2025 14:50:11 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E6=8C=A1=E6=9D=BF,=20PRE?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E4=B8=8D=E6=89=A7=E8=A1=8C=E5=AE=9A=E6=97=B6?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/jsowell/quartz/task/JsowellTask.java | 60 +++++++++++++++---- 1 file changed, 48 insertions(+), 12 deletions(-) diff --git a/jsowell-quartz/src/main/java/com/jsowell/quartz/task/JsowellTask.java b/jsowell-quartz/src/main/java/com/jsowell/quartz/task/JsowellTask.java index fd6792167..7661416ad 100644 --- a/jsowell-quartz/src/main/java/com/jsowell/quartz/task/JsowellTask.java +++ b/jsowell-quartz/src/main/java/com/jsowell/quartz/task/JsowellTask.java @@ -73,8 +73,8 @@ public class JsowellTask { */ public void setBarrier() { String env = SpringUtils.getActiveProfile(); - if (!StringUtils.equalsIgnoreCase(env, "prd")) { - log.info("非PRD环境不执行"); + if (StringUtils.equalsIgnoreCase(env, "pre")) { + log.info("PRE环境不执行"); return; } } @@ -84,7 +84,11 @@ public class JsowellTask { * close15MinutesOfUnpaidOrders */ public void close15MinutesOfUnpaidOrders() { - setBarrier(); + String env = SpringUtils.getActiveProfile(); + if (StringUtils.equalsIgnoreCase(env, "pre")) { + log.info("PRE环境不执行"); + return; + } // log.info("关闭15分钟未支付的订单"); orderBasicInfoService.close15MinutesOfUnpaidOrders(); } @@ -94,7 +98,11 @@ public class JsowellTask { * 订单支付成功,在15分钟内未启动, */ public void closeStartFailedOrder() { - setBarrier(); + String env = SpringUtils.getActiveProfile(); + if (StringUtils.equalsIgnoreCase(env, "pre")) { + log.info("PRE环境不执行"); + return; + } // 查询出最近2天支付成功,并且订单状态为未启动的订单 String startTime = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, DateUtils.addDays(new Date(), -2)); String endTime = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, new Date()); @@ -105,7 +113,11 @@ public class JsowellTask { * 查询预约充电的订单并启动 */ public void appointmentOrderStart() { - setBarrier(); + String env = SpringUtils.getActiveProfile(); + if (StringUtils.equalsIgnoreCase(env, "pre")) { + log.info("PRE环境不执行"); + return; + } // 查询出 已支付 设置预约充电 未启动 的订单 LocalDateTime now = LocalDateTime.now(); List list = orderBasicInfoService.getReservedOrder(now); @@ -150,7 +162,11 @@ public class JsowellTask { * jsowellTask.calculateTheSiteOrdersReport() */ public void calculateTheSiteOrdersReport() { - setBarrier(); + String env = SpringUtils.getActiveProfile(); + if (StringUtils.equalsIgnoreCase(env, "pre")) { + log.info("PRE环境不执行"); + return; + } // 查询出所有站点 PileStationInfo pileStationInfo = new PileStationInfo(); pileStationInfo.setDelFlag(Constants.ZERO); @@ -175,7 +191,11 @@ public class JsowellTask { * jsowellTask.pushToAMap() */ public void pushToAMap() { - setBarrier(); + String env = SpringUtils.getActiveProfile(); + if (StringUtils.equalsIgnoreCase(env, "pre")) { + log.info("PRE环境不执行"); + return; + } Set stationIds = redisCache.getCacheSet(CacheConstants.PUSH_STATION_CONNECTOR); if (CollectionUtils.isEmpty(stationIds)) { return; @@ -196,7 +216,11 @@ public class JsowellTask { * 贵州省平台推送充电站实时功率 */ public void pushStationRealTimePowerInfo() { - setBarrier(); + String env = SpringUtils.getActiveProfile(); + if (StringUtils.equalsIgnoreCase(env, "pre")) { + log.info("PRE环境不执行"); + return; + } // 查询出要推送的站点(贵州、) String thirdPartyType = ThirdPlatformTypeEnum.GUI_ZHOU_PLATFORM.getTypeCode(); List stationInfoVOS = thirdPartyStationRelationService.selectStationList(thirdPartyType); @@ -214,7 +238,11 @@ public class JsowellTask { * jsowellTask.processOrderSplitting() */ public void processOrderSplitting() { - setBarrier(); + String env = SpringUtils.getActiveProfile(); + if (StringUtils.equalsIgnoreCase(env, "pre")) { + log.info("PRE环境不执行"); + return; + } // 查询运营商列表 List pileMerchantInfos = pileMerchantInfoService.selectPileMerchantInfoList(null); if (CollectionUtils.isEmpty(pileMerchantInfos)) { @@ -249,7 +277,11 @@ public class JsowellTask { * */ public void generateMerchantBill() { - setBarrier(); + String env = SpringUtils.getActiveProfile(); + if (StringUtils.equalsIgnoreCase(env, "pre")) { + log.info("PRE环境不执行"); + return; + } // 查询运营商列表 List pileMerchantInfos = pileMerchantInfoService.selectPileMerchantInfoList(null); if (CollectionUtils.isEmpty(pileMerchantInfos)) { @@ -274,8 +306,12 @@ public class JsowellTask { * jsowellTask.automaticPayouts() */ public void automaticPayouts() { - setBarrier(); - // TODO 查询开启自动提现运营商列表 + String env = SpringUtils.getActiveProfile(); + if (StringUtils.equalsIgnoreCase(env, "pre")) { + log.info("PRE环境不执行"); + return; + } + // 查询开启自动提现运营商列表 // List pileMerchantInfos = pileMerchantInfoService.selectPileMerchantInfoList(null); List pileMerchantInfos = pileMerchantInfoService.selectAutoWithdrawalMerchantInfoList(); if (CollectionUtils.isEmpty(pileMerchantInfos)) {