控制绑定优惠券方法的日志打印频率, 5分钟打印一次

This commit is contained in:
Guoqs
2025-04-03 09:28:24 +08:00
parent 0f1220a057
commit 082c49649b
4 changed files with 47 additions and 16 deletions

View File

@@ -1,14 +1,3 @@
002212025030318504410742587967625068544
002212025030321240810742626574550953984
002212025030321241910742626617827614720
002212025030322294810742643097998999552
002212025030322342310742644253637820416
002212025030323103010742653342577102848
002212025030400084210742667988435709952
002212025030401021610742681470429048832
002212025030401023610742681553490128896
002212025030401195410742685906368516096
002212025030404503610742738929335156736
002212025030408090510742788880547475456
002212025030408191810742791453324865536
002212025030408374110742796077146398720
@@ -820,15 +809,40 @@
002212025033108350310752579886561435648
002212025033108562410752585261125820416
002212025033109495710752598738047119360
002212025033117274710752713955192123392
002212025033117464510752718728628367360
002212025033118110210752724837602922496
002212025033118404310752732306817892352
002212025033118422610752732741928464384
002212025033118464310752733818026450944
002212025033119015610752737649296662528
002212025033119021310752737718688264192
002212025033119160410752741206763810816
002212025033119304310752744890395447296
002212025033120040110752753269922779136
002212025033120110810752755062083776512
002212025033120120210752755290479861760
002212025033120383810752761981837598720
002212025033120390910752762114244702208
002212025033120434810752763283883397120
002212025033120542510752765955370741760
002212025033121215910752772892904202240
002212025033122163910752786648282091520
002212025033122495910752795040641966080
002212025033123230610752803372298878976
002212025033123244910752803804190679040
002212025040100571610752827070026067968
002212025040113074010753010881405480960
002212025040113184310753013663873675264
002212025040114110510753026842248273920
002212025040114412210753034461343567872
002212025040115433810753050131207385088
002212025040116263510753060940963999744
002212025040117162910753073497191690240
002212025040117455110753080889329733632
002212025040118211110753089782029668352
002212025040119581410753114202818686976
002212025040120220010753120185756561408
002212025040120455610753126209105285120
002212025040120520710753127763042316288
002212025040121323710753137956335812608

View File

@@ -389,4 +389,9 @@ public class CacheConstants {
* 根据站点id查询分账配置
*/
public static final String QUERY_STATION_SPLIT_CONFIG = "query_station_split_config:";
/**
* 优惠券绑定
*/
public static final String BIND_PARKING_COUPON = "bindParkingCoupon_";
}

View File

@@ -814,6 +814,7 @@ public class AdapayService {
// 提现金额为昨日金额 withdrawalAmount
BigDecimal withdrawalAmount = adapayAccountBalanceVO.getLastAvlBalance();
// 提现手续费 每笔固定5元 2025年2月13日11点47分手续费改为参数传入
// BigDecimal feeAmt = new BigDecimal("5");
BigDecimal feeAmt = new BigDecimal(dto.getFeeAmt());

View File

@@ -682,9 +682,14 @@ public class CommonService {
* @return
*/
public void bindParkingCoupon(RealTimeMonitorData realTimeMonitorData, OrderBasicInfo orderBasicInfo) throws UnsupportedEncodingException {
// 每15秒就会调用这个方法, 使用redis控制日志打印
String redisKey = CacheConstants.BIND_PARKING_COUPON + orderBasicInfo.getOrderCode();
Boolean setnx = redisCache.setnx(redisKey, Constants.ONE, 60 * 5);
// 是否绑定车牌
if (StringUtils.isBlank(orderBasicInfo.getPlateNumber())) {
log.info("订单{}未绑定车牌", orderBasicInfo.getOrderCode());
if (setnx) {
log.info("订单{}未绑定车牌", orderBasicInfo.getOrderCode());
}
return;
}
// 判断该订单的站点是否有停车优惠
@@ -706,7 +711,9 @@ public class CommonService {
if (!DateUtils.isInDiscountPeriod(startTime, endTime, createLocalTime)) {
// 不在优惠时间段内
log.info("{}该订单不在优惠时间段({}-{})内", orderBasicInfo.getOrderCode(), startTime, endTime);
if (setnx) {
log.info("{}该订单不在优惠时间段({}-{})内", orderBasicInfo.getOrderCode(), startTime, endTime);
}
return;
}
@@ -726,14 +733,18 @@ public class CommonService {
}
if (!flag) {
// 不满足发券条件
log.info("{}该订单不满足发券条件, 门槛类型(1电量,2时长):{}, 门槛值:{}, 充电度数:{}, 充电时长:{}",
orderBasicInfo.getOrderCode(), conditionType, chargeParkingDiscount.getConditionValue(), chargingDegree, sumChargingTime);
if (setnx) {
log.info("{}该订单不满足发券条件, 门槛类型(1电量,2时长):{}, 门槛值:{}, 充电度数:{}, 充电时长:{}",
orderBasicInfo.getOrderCode(), conditionType, chargeParkingDiscount.getConditionValue(), chargingDegree, sumChargingTime);
}
return;
}
// 是否已经发券
CarCouponRecord carCouponRecord = carCouponRecordService.selectCarCouponRecord(orderBasicInfo.getOrderCode());
if (carCouponRecord != null) {
log.info("{}该订单已经发券", orderBasicInfo.getOrderCode());
if (setnx) {
log.info("{}该订单已经发券", orderBasicInfo.getOrderCode());
}
return;
}
// 绑定停车券