mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-06-30 20:17:59 +08:00
update 设置挡板
This commit is contained in:
@@ -83,17 +83,32 @@ public class JsowellTask {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private AdapayUnsplitRecordHandleService adapayUnsplitRecordHandleService;
|
private AdapayUnsplitRecordHandleService adapayUnsplitRecordHandleService;
|
||||||
|
|
||||||
|
private static final String PRE_PROFILE = "pre";
|
||||||
|
|
||||||
private static final long YKC_DAILY_TIMECHECK_INTERVAL_MILLIS = 200L;
|
private static final long YKC_DAILY_TIMECHECK_INTERVAL_MILLIS = 200L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置挡板, PRE环境不执行
|
* 设置挡板, PRE环境不执行
|
||||||
*/
|
*/
|
||||||
public void setBarrier() {
|
public void setBarrier() {
|
||||||
String env = SpringUtils.getActiveProfile();
|
skipInPre("设置挡板");
|
||||||
if (StringUtils.equalsIgnoreCase(env, "pre")) {
|
|
||||||
log.info("PRE环境不执行");
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean skipInPre(String taskName) {
|
||||||
|
if (!isPreProfile()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
log.info("PRE环境不执行,{}", taskName);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isPreProfile() {
|
||||||
|
String[] activeProfiles = SpringUtils.getActiveProfiles();
|
||||||
|
if (activeProfiles == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return Arrays.stream(activeProfiles)
|
||||||
|
.anyMatch(profile -> StringUtils.equalsIgnoreCase(profile, PRE_PROFILE));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -101,9 +116,7 @@ public class JsowellTask {
|
|||||||
* close15MinutesOfUnpaidOrders
|
* close15MinutesOfUnpaidOrders
|
||||||
*/
|
*/
|
||||||
public void close15MinutesOfUnpaidOrders() {
|
public void close15MinutesOfUnpaidOrders() {
|
||||||
String env = SpringUtils.getActiveProfile();
|
if (skipInPre("关闭15分钟未支付的订单")) {
|
||||||
if (StringUtils.equalsIgnoreCase(env, "pre")) {
|
|
||||||
log.info("PRE环境不执行,关闭15分钟未支付的订单");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// log.info("关闭15分钟未支付的订单");
|
// log.info("关闭15分钟未支付的订单");
|
||||||
@@ -115,9 +128,7 @@ public class JsowellTask {
|
|||||||
* 订单支付成功,在15分钟内未启动,
|
* 订单支付成功,在15分钟内未启动,
|
||||||
*/
|
*/
|
||||||
public void closeStartFailedOrder() {
|
public void closeStartFailedOrder() {
|
||||||
String env = SpringUtils.getActiveProfile();
|
if (skipInPre("关闭启动失败的订单")) {
|
||||||
if (StringUtils.equalsIgnoreCase(env, "pre")) {
|
|
||||||
log.info("PRE环境不执行,关闭启动失败的订单");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 查询出最近2天支付成功,并且订单状态为未启动的订单
|
// 查询出最近2天支付成功,并且订单状态为未启动的订单
|
||||||
@@ -130,9 +141,7 @@ public class JsowellTask {
|
|||||||
* 查询预约充电的订单并启动
|
* 查询预约充电的订单并启动
|
||||||
*/
|
*/
|
||||||
public void appointmentOrderStart() {
|
public void appointmentOrderStart() {
|
||||||
String env = SpringUtils.getActiveProfile();
|
if (skipInPre("查询预约充电的订单并启动")) {
|
||||||
if (StringUtils.equalsIgnoreCase(env, "pre")) {
|
|
||||||
log.info("PRE环境不执行,查询预约充电的订单并启动");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 查询出 已支付 设置预约充电 未启动 的订单
|
// 查询出 已支付 设置预约充电 未启动 的订单
|
||||||
@@ -187,9 +196,7 @@ public class JsowellTask {
|
|||||||
* jsowellTask.dailyProofreadTimeForYkcV160(200)
|
* jsowellTask.dailyProofreadTimeForYkcV160(200)
|
||||||
*/
|
*/
|
||||||
public void dailyProofreadTimeForYkcV160(Long intervalMillis) {
|
public void dailyProofreadTimeForYkcV160(Long intervalMillis) {
|
||||||
String env = SpringUtils.getActiveProfile();
|
if (skipInPre("云快充1.6每日自动对时")) {
|
||||||
if (StringUtils.equalsIgnoreCase(env, "pre")) {
|
|
||||||
log.info("PRE环境不执行,云快充1.6每日自动对时");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -250,9 +257,7 @@ public class JsowellTask {
|
|||||||
* jsowellTask.calculateTheSiteOrdersReport()
|
* jsowellTask.calculateTheSiteOrdersReport()
|
||||||
*/
|
*/
|
||||||
public void calculateTheSiteOrdersReport() {
|
public void calculateTheSiteOrdersReport() {
|
||||||
String env = SpringUtils.getActiveProfile();
|
if (skipInPre("计算站点订单报表")) {
|
||||||
if (StringUtils.equalsIgnoreCase(env, "pre")) {
|
|
||||||
log.info("PRE环境不执行,计算站点订单报表");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 查询出所有站点
|
// 查询出所有站点
|
||||||
@@ -279,9 +284,7 @@ public class JsowellTask {
|
|||||||
* jsowellTask.pushToAMap()
|
* jsowellTask.pushToAMap()
|
||||||
*/
|
*/
|
||||||
public void pushToAMap() {
|
public void pushToAMap() {
|
||||||
String env = SpringUtils.getActiveProfile();
|
if (skipInPre("站点的枪口数据推送到高德")) {
|
||||||
if (StringUtils.equalsIgnoreCase(env, "pre")) {
|
|
||||||
log.info("PRE环境不执行,站点的枪口数据推送到高德");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Set<String> stationIds = redisCache.getCacheSet(CacheConstants.PUSH_STATION_CONNECTOR);
|
Set<String> stationIds = redisCache.getCacheSet(CacheConstants.PUSH_STATION_CONNECTOR);
|
||||||
@@ -304,9 +307,7 @@ public class JsowellTask {
|
|||||||
* 贵州省平台推送充电站实时功率 15分钟执行一次
|
* 贵州省平台推送充电站实时功率 15分钟执行一次
|
||||||
*/
|
*/
|
||||||
public void pushStationRealTimePowerInfo() {
|
public void pushStationRealTimePowerInfo() {
|
||||||
String env = SpringUtils.getActiveProfile();
|
if (skipInPre("贵州省平台推送充电站实时功率")) {
|
||||||
if (StringUtils.equalsIgnoreCase(env, "pre")) {
|
|
||||||
log.info("PRE环境不执行,贵州省平台推送充电站实时功率");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -344,9 +345,7 @@ public class JsowellTask {
|
|||||||
* 推送统计信息 24小时执行一次
|
* 推送统计信息 24小时执行一次
|
||||||
*/
|
*/
|
||||||
public void pushStatisticsInfo() {
|
public void pushStatisticsInfo() {
|
||||||
String env = SpringUtils.getActiveProfile();
|
if (skipInPre("推送统计信息 24小时执行一次")) {
|
||||||
if (StringUtils.equalsIgnoreCase(env, "pre")) {
|
|
||||||
log.info("PRE环境不执行,推送统计信息 24小时执行一次");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -385,9 +384,7 @@ public class JsowellTask {
|
|||||||
* jsowellTask.processOrderSplitting()
|
* jsowellTask.processOrderSplitting()
|
||||||
*/
|
*/
|
||||||
public void processOrderSplitting() {
|
public void processOrderSplitting() {
|
||||||
String env = SpringUtils.getActiveProfile();
|
if (skipInPre("定时任务, 订单分账")) {
|
||||||
if (StringUtils.equalsIgnoreCase(env, "pre")) {
|
|
||||||
log.info("PRE环境不执行,定时任务, 订单分账");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 查询运营商列表
|
// 查询运营商列表
|
||||||
@@ -424,9 +421,7 @@ public class JsowellTask {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public void generateMerchantBill() {
|
public void generateMerchantBill() {
|
||||||
String env = SpringUtils.getActiveProfile();
|
if (skipInPre("生成运营商日报表")) {
|
||||||
if (StringUtils.equalsIgnoreCase(env, "pre")) {
|
|
||||||
log.info("PRE环境不执行,生成运营商日报表");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 查询运营商列表
|
// 查询运营商列表
|
||||||
@@ -453,9 +448,7 @@ public class JsowellTask {
|
|||||||
* jsowellTask.automaticPayouts()
|
* jsowellTask.automaticPayouts()
|
||||||
*/
|
*/
|
||||||
public void automaticPayouts() {
|
public void automaticPayouts() {
|
||||||
String env = SpringUtils.getActiveProfile();
|
if (skipInPre("定时任务,自动提现")) {
|
||||||
if (StringUtils.equalsIgnoreCase(env, "pre")) {
|
|
||||||
log.info("PRE环境不执行,定时任务,自动提现");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 查询开启自动提现运营商列表
|
// 查询开启自动提现运营商列表
|
||||||
@@ -484,6 +477,9 @@ public class JsowellTask {
|
|||||||
* jsowellTask.processUnSettledOrder()
|
* jsowellTask.processUnSettledOrder()
|
||||||
*/
|
*/
|
||||||
public void processUnSettledOrder() {
|
public void processUnSettledOrder() {
|
||||||
|
if (skipInPre("处理未分帐订单")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
adapayUnsplitRecordHandleService.processUnSettledOrder();
|
adapayUnsplitRecordHandleService.processUnSettledOrder();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -493,6 +489,9 @@ public class JsowellTask {
|
|||||||
* jsowellTask.processUnsplitRecordToDefaultMember()
|
* jsowellTask.processUnsplitRecordToDefaultMember()
|
||||||
*/
|
*/
|
||||||
public void processUnsplitRecordToDefaultMember() {
|
public void processUnsplitRecordToDefaultMember() {
|
||||||
|
if (skipInPre("处理adapay_unsplit_record待分账数据")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
adapayUnsplitRecordHandleService.processUnsplitRecordToDefaultMember();
|
adapayUnsplitRecordHandleService.processUnsplitRecordToDefaultMember();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -501,6 +500,9 @@ public class JsowellTask {
|
|||||||
* jsowellTask.processUnsplitRecordToDefaultMember(wechatAppId, pageSize)
|
* jsowellTask.processUnsplitRecordToDefaultMember(wechatAppId, pageSize)
|
||||||
*/
|
*/
|
||||||
public void processUnsplitRecordToDefaultMember(String wechatAppId, Integer pageSize) {
|
public void processUnsplitRecordToDefaultMember(String wechatAppId, Integer pageSize) {
|
||||||
|
if (skipInPre("处理adapay_unsplit_record待分账数据")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
adapayUnsplitRecordHandleService.processUnsplitRecordToDefaultMember(wechatAppId, pageSize);
|
adapayUnsplitRecordHandleService.processUnsplitRecordToDefaultMember(wechatAppId, pageSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -515,6 +517,9 @@ public class JsowellTask {
|
|||||||
* jsowellTask.importAdapayUnsplitRecordAndCompleteFields()
|
* jsowellTask.importAdapayUnsplitRecordAndCompleteFields()
|
||||||
*/
|
*/
|
||||||
public void importAdapayUnsplitRecordAndCompleteFields() {
|
public void importAdapayUnsplitRecordAndCompleteFields() {
|
||||||
|
if (skipInPre("从Excel导入adapay_unsplit_record并补齐缺失字段")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
adapayUnsplitRecordHandleService.importAdapayUnsplitRecordAndCompleteFields();
|
adapayUnsplitRecordHandleService.importAdapayUnsplitRecordAndCompleteFields();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -525,6 +530,9 @@ public class JsowellTask {
|
|||||||
* 示例:jsowellTask.completeAdapayUnsplitRecordFields('2024-01-01 00:00:00', '2025-12-31 23:59:59')
|
* 示例:jsowellTask.completeAdapayUnsplitRecordFields('2024-01-01 00:00:00', '2025-12-31 23:59:59')
|
||||||
*/
|
*/
|
||||||
public void completeAdapayUnsplitRecordFields(String startTime, String endTime) {
|
public void completeAdapayUnsplitRecordFields(String startTime, String endTime) {
|
||||||
|
if (skipInPre("补齐adapay_unsplit_record表中缺失字段")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
adapayUnsplitRecordHandleService.completeAdapayUnsplitRecordFields(startTime, endTime);
|
adapayUnsplitRecordHandleService.completeAdapayUnsplitRecordFields(startTime, endTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -533,6 +541,9 @@ public class JsowellTask {
|
|||||||
* jsowellTask.syncAndRefreshFlagsFromAdapay(paymentId, wechatAppId)
|
* jsowellTask.syncAndRefreshFlagsFromAdapay(paymentId, wechatAppId)
|
||||||
*/
|
*/
|
||||||
public void syncAndRefreshFlagsFromAdapay(String paymentId, String wechatAppId) {
|
public void syncAndRefreshFlagsFromAdapay(String paymentId, String wechatAppId) {
|
||||||
|
if (skipInPre("按paymentId从汇付同步并刷新adapay_unsplit_record标识")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
adapayUnsplitRecordHandleService.syncAndRefreshFlagsFromAdapay(paymentId, wechatAppId);
|
adapayUnsplitRecordHandleService.syncAndRefreshFlagsFromAdapay(paymentId, wechatAppId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -542,6 +553,9 @@ public class JsowellTask {
|
|||||||
* 示例:jsowellTask.syncAndRefreshFlagsFromAdapay('2024-01-01 00:00:00', '2025-12-31 23:59:59', 'app_id', 500)
|
* 示例:jsowellTask.syncAndRefreshFlagsFromAdapay('2024-01-01 00:00:00', '2025-12-31 23:59:59', 'app_id', 500)
|
||||||
*/
|
*/
|
||||||
public void syncAndRefreshFlagsFromAdapay(String startTime, String endTime, String wechatAppId, Integer pageSize) {
|
public void syncAndRefreshFlagsFromAdapay(String startTime, String endTime, String wechatAppId, Integer pageSize) {
|
||||||
|
if (skipInPre("批量从汇付同步并刷新adapay_unsplit_record标识")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
adapayUnsplitRecordHandleService.syncAndRefreshFlagsFromAdapay(startTime, endTime, wechatAppId, pageSize);
|
adapayUnsplitRecordHandleService.syncAndRefreshFlagsFromAdapay(startTime, endTime, wechatAppId, pageSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -555,10 +569,16 @@ public class JsowellTask {
|
|||||||
* jsowellTask.importAdapayUnsplitRecordAndCompleteFields(文件路径)
|
* jsowellTask.importAdapayUnsplitRecordAndCompleteFields(文件路径)
|
||||||
*/
|
*/
|
||||||
public void importAdapayUnsplitRecordAndCompleteFields(String filePath) {
|
public void importAdapayUnsplitRecordAndCompleteFields(String filePath) {
|
||||||
|
if (skipInPre("从Excel导入adapay_unsplit_record并补齐缺失字段")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
adapayUnsplitRecordHandleService.importAdapayUnsplitRecordAndCompleteFields(filePath);
|
adapayUnsplitRecordHandleService.importAdapayUnsplitRecordAndCompleteFields(filePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateOrderReview() {
|
public void updateOrderReview() {
|
||||||
|
if (skipInPre("更新订单评价标识")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
LocalDate yesterday = DateUtils.getYesterday();
|
LocalDate yesterday = DateUtils.getYesterday();
|
||||||
LocalDateTime start = yesterday.atStartOfDay();
|
LocalDateTime start = yesterday.atStartOfDay();
|
||||||
LocalDateTime end = yesterday.atTime(23, 59, 59);
|
LocalDateTime end = yesterday.atTime(23, 59, 59);
|
||||||
|
|||||||
Reference in New Issue
Block a user