设置挡板, PRE环境不执行定时任务

This commit is contained in:
Guoqs
2025-03-25 14:50:11 +08:00
parent aa92d49d17
commit 2c43d2ea1f

View File

@@ -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<OrderBasicInfo> 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<String> 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<StationInfoVO> 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<PileMerchantInfo> 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<PileMerchantInfo> 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<PileMerchantInfo> pileMerchantInfos = pileMerchantInfoService.selectPileMerchantInfoList(null);
List<PileMerchantInfo> pileMerchantInfos = pileMerchantInfoService.selectAutoWithdrawalMerchantInfoList();
if (CollectionUtils.isEmpty(pileMerchantInfos)) {