|
@@ -106,7 +106,8 @@ public class BuyerOrderCancelService { |
|
@@ -106,7 +106,8 @@ public class BuyerOrderCancelService { |
106
|
BuyerPenaltyCalResult bpcr = buyerCancelCompensateComputeHandler.calBuyerPenaltyCalResult(buyerOrder, targetOrderStatus);
|
106
|
BuyerPenaltyCalResult bpcr = buyerCancelCompensateComputeHandler.calBuyerPenaltyCalResult(buyerOrder, targetOrderStatus);
|
107
|
logger.info("in buyer cancel BeforeSellerDeliver, event {} BuyerPenaltyCalResult {}", bsdEvent, bpcr);
|
107
|
logger.info("in buyer cancel BeforeSellerDeliver, event {} BuyerPenaltyCalResult {}", bsdEvent, bpcr);
|
108
|
//买家实付金额(货款+运费)小于赔偿金的额度,不够赔偿的,则不允许取消
|
108
|
//买家实付金额(货款+运费)小于赔偿金的额度,不够赔偿的,则不允许取消
|
109
|
- if(bsdEvent.getAmount()==null||bsdEvent.getAmount().compareTo(bpcr.getPenaltyAmount()) < 0){
|
109
|
+ BigDecimal penaltyAmount;
|
|
|
110
|
+ if(bsdEvent.getAmount()==null||bsdEvent.getAmount().compareTo(penaltyAmount=bpcr.getPenaltyAmount()) < 0){
|
110
|
logger.warn("in buyer cancel BeforeSellerDeliver not allow cancel cause of buyer amount lower than BuyerCompensateMoney, event {} compensate {}", bsdEvent, bpcr);
|
111
|
logger.warn("in buyer cancel BeforeSellerDeliver not allow cancel cause of buyer amount lower than BuyerCompensateMoney, event {} compensate {}", bsdEvent, bpcr);
|
111
|
throw new com.yohoufo.common.exception.UfoServiceException(400,"买家赔偿金低于商品售价,不允许取消");
|
112
|
throw new com.yohoufo.common.exception.UfoServiceException(400,"买家赔偿金低于商品售价,不允许取消");
|
112
|
}
|
113
|
}
|
|
@@ -116,8 +117,8 @@ public class BuyerOrderCancelService { |
|
@@ -116,8 +117,8 @@ public class BuyerOrderCancelService { |
116
|
int currentTime = DateUtil.getCurrentTimeSecond();
|
117
|
int currentTime = DateUtil.getCurrentTimeSecond();
|
117
|
int rows = buyerOrderMapper.updateStatusByOrderCode(orderCode, buyerUid, expected.getCode(), targetOrderStatus.getCode(), currentTime);
|
118
|
int rows = buyerOrderMapper.updateStatusByOrderCode(orderCode, buyerUid, expected.getCode(), targetOrderStatus.getCode(), currentTime);
|
118
|
if (rows>0) {
|
119
|
if (rows>0) {
|
119
|
- boolean noResponsibility = Objects.isNull(bpcr.getPenaltyAmount())
|
|
|
120
|
- || BigDecimal.ZERO.compareTo(bpcr.getPenaltyAmount()) == 0;
|
120
|
+ boolean noResponsibility = Objects.isNull(penaltyAmount)
|
|
|
121
|
+ || BigDecimal.ZERO.compareTo(penaltyAmount) == 0;
|
121
|
//退还优惠券
|
122
|
//退还优惠券
|
122
|
refundCouponIfNeed(buyerUid, orderCode);
|
123
|
refundCouponIfNeed(buyerUid, orderCode);
|
123
|
int skup = bsdEvent.getSkup();
|
124
|
int skup = bsdEvent.getSkup();
|
|
@@ -136,7 +137,7 @@ public class BuyerOrderCancelService { |
|
@@ -136,7 +137,7 @@ public class BuyerOrderCancelService { |
136
|
inBoxFacade.noticeSellerWhenBuyerCancelNoResponsibility(psog, orderCode);
|
137
|
inBoxFacade.noticeSellerWhenBuyerCancelNoResponsibility(psog, orderCode);
|
137
|
}else {
|
138
|
}else {
|
138
|
inBoxFacade.buyerCancelBeforeSellerDeliver(buyerUid, orderCode,
|
139
|
inBoxFacade.buyerCancelBeforeSellerDeliver(buyerUid, orderCode,
|
139
|
- bpcr.getPenaltyAmount().toPlainString(), psog);
|
140
|
+ penaltyAmount.toPlainString(), psog);
|
140
|
}
|
141
|
}
|
141
|
//TODO 整个过程异步去执行(考虑退费依赖订单状态)
|
142
|
//TODO 整个过程异步去执行(考虑退费依赖订单状态)
|
142
|
//(退费)退保证金给卖家
|
143
|
//(退费)退保证金给卖家
|
|
@@ -222,7 +223,8 @@ public class BuyerOrderCancelService { |
|
@@ -222,7 +223,8 @@ public class BuyerOrderCancelService { |
222
|
BuyerPenaltyCalResult bpcr = buyerCancelCompensateComputeHandler.calBuyerPenaltyCalResult(buyerOrder, targetOrderStatus);
|
223
|
BuyerPenaltyCalResult bpcr = buyerCancelCompensateComputeHandler.calBuyerPenaltyCalResult(buyerOrder, targetOrderStatus);
|
223
|
logger.info("in buyer cancel BeforeDepotReceive, event {} compensate {}", bdrEvent, bpcr);
|
224
|
logger.info("in buyer cancel BeforeDepotReceive, event {} compensate {}", bdrEvent, bpcr);
|
224
|
//买家实付金额(货款+运费)小于赔偿金的额度,不够赔偿的,则不允许取消
|
225
|
//买家实付金额(货款+运费)小于赔偿金的额度,不够赔偿的,则不允许取消
|
225
|
- if(bdrEvent.getAmount()==null||bdrEvent.getAmount().compareTo(bpcr.getPenaltyAmount()) < 0){
|
226
|
+ BigDecimal penaltyAmount;
|
|
|
227
|
+ if(bdrEvent.getAmount()==null||bdrEvent.getAmount().compareTo(penaltyAmount=bpcr.getPenaltyAmount()) < 0){
|
226
|
logger.warn("in buyer cancel BeforeDepotReceive not allow cancel cause of buyer amount lower than BuyerCompensateMoney, event {} compensate {}", bdrEvent, bpcr);
|
228
|
logger.warn("in buyer cancel BeforeDepotReceive not allow cancel cause of buyer amount lower than BuyerCompensateMoney, event {} compensate {}", bdrEvent, bpcr);
|
227
|
throw new com.yohoufo.common.exception.UfoServiceException(400,"买家赔偿金低于商品售价,不允许取消");
|
229
|
throw new com.yohoufo.common.exception.UfoServiceException(400,"买家赔偿金低于商品售价,不允许取消");
|
228
|
}
|
230
|
}
|
|
@@ -231,8 +233,8 @@ public class BuyerOrderCancelService { |
|
@@ -231,8 +233,8 @@ public class BuyerOrderCancelService { |
231
|
int currentTime = DateUtil.getCurrentTimeSecond();
|
233
|
int currentTime = DateUtil.getCurrentTimeSecond();
|
232
|
int rows = buyerOrderMapper.updateStatusByOrderCode(orderCode, buyerUid, expected.getCode(), targetOrderStatus.getCode(), currentTime);
|
234
|
int rows = buyerOrderMapper.updateStatusByOrderCode(orderCode, buyerUid, expected.getCode(), targetOrderStatus.getCode(), currentTime);
|
233
|
if (rows>0) {
|
235
|
if (rows>0) {
|
234
|
- boolean noResponsibility = Objects.isNull(bpcr.getPenaltyAmount())
|
|
|
235
|
- || BigDecimal.ZERO.compareTo(bpcr.getPenaltyAmount()) == 0;
|
236
|
+ boolean noResponsibility = Objects.isNull(penaltyAmount)
|
|
|
237
|
+ || BigDecimal.ZERO.compareTo(penaltyAmount) == 0;
|
236
|
//退还优惠券
|
238
|
//退还优惠券
|
237
|
refundCouponIfNeed(buyerUid, orderCode);
|
239
|
refundCouponIfNeed(buyerUid, orderCode);
|
238
|
|
240
|
|
|
@@ -252,7 +254,7 @@ public class BuyerOrderCancelService { |
|
@@ -252,7 +254,7 @@ public class BuyerOrderCancelService { |
252
|
inBoxFacade.noticeSellerWhenBuyerCancelNoResponsibility(psog, orderCode);
|
254
|
inBoxFacade.noticeSellerWhenBuyerCancelNoResponsibility(psog, orderCode);
|
253
|
}else {
|
255
|
}else {
|
254
|
inBoxFacade.buyerCancelBeforeDepotReceive(buyerUid, orderCode,
|
256
|
inBoxFacade.buyerCancelBeforeDepotReceive(buyerUid, orderCode,
|
255
|
- bpcr.getPenaltyAmount().toPlainString(), psog);
|
257
|
+ penaltyAmount.toPlainString(), psog);
|
256
|
}
|
258
|
}
|
257
|
//整个过程异步去执行(考虑退费依赖订单状态)
|
259
|
//整个过程异步去执行(考虑退费依赖订单状态)
|
258
|
//(退费)退保证金给卖家
|
260
|
//(退费)退保证金给卖家
|