修改thirdparty中停车平台代码位置

This commit is contained in:
Guoqs
2025-02-10 14:26:32 +08:00
parent 679cca6b98
commit 5e66ca653d
10 changed files with 33 additions and 34 deletions

View File

@@ -322,28 +322,28 @@ public class UploadRealTimeMonitorHandler extends AbstractYkcHandler {
}
// 判断该订单是否需要下发优惠券
String redisKey = CacheConstants.CAR_BIND_COUPON_BY_ORDER_CODE + orderInfo.getOrderCode();
Object cacheObject = redisCache.getCacheObject(redisKey);
if (cacheObject == null && sumChargingTime >= 10) {
// 异步绑定优惠券并设置缓存
CompletableFuture.runAsync(() -> {
try {
commonService.bindCoupon(orderInfo);
redisCache.setCacheObject(redisKey, Boolean.TRUE, 24, TimeUnit.HOURS);
} catch (Exception e) {
log.error("异步绑定车辆优惠券 error,", e);
}
}, executor);
}
// String redisKey = CacheConstants.CAR_BIND_COUPON_BY_ORDER_CODE + orderInfo.getOrderCode();
// Object cacheObject = redisCache.getCacheObject(redisKey);
// if (cacheObject == null && sumChargingTime >= 10) {
// // 异步绑定优惠券并设置缓存
// CompletableFuture.runAsync(() -> {
// try {
// commonService.bindCoupon(orderInfo);
// redisCache.setCacheObject(redisKey, Boolean.TRUE, 24, TimeUnit.HOURS);
// } catch (Exception e) {
// log.error("异步绑定车辆优惠券 error,", e);
// }
// }, executor);
// }
// 异步绑定优惠券
// CompletableFuture.runAsync(() -> {
// try {
// commonService.bindParkingCoupon(realTimeMonitorData, orderInfo);
// } catch (Exception e) {
// log.error("异步绑定车辆停车优惠券error", e);
// }
// }, executor);
CompletableFuture.runAsync(() -> {
try {
commonService.bindParkingCoupon(realTimeMonitorData, orderInfo);
} catch (Exception e) {
log.error("异步绑定车辆停车优惠券error", e);
}
}, executor);
}
// 充电时保存实时数据到redis