|
@@ -381,6 +381,7 @@ public class AfterSaleServiceImpl implements AfterSaleService {
|
|
|
//退积分 add by Ben
|
|
|
//1. 退购物使用的积分
|
|
|
Long tradeOrderId = afterSale.getOrderId();//购物单ID
|
|
|
+ Long orderUserId = afterSale.getUserId();
|
|
|
TradeOrderDO tradeOrderDO = tradeOrderMapper.selectById(tradeOrderId);
|
|
|
String tradeOrderNum = tradeOrderDO.getNo();
|
|
|
|
|
@@ -395,12 +396,12 @@ public class AfterSaleServiceImpl implements AfterSaleService {
|
|
|
toid.setRefundIntegral(payIntegral);
|
|
|
tradeOrderItemMapper.updateById(toid);
|
|
|
//返回退款订单项对应的积分
|
|
|
- integralService.updateUserIntegral(userId, CaclEnum.ORDER_REFUND_INTEGRAL, payIntegral,0l,tradeOrderId,tradeOrderNum);
|
|
|
+ integralService.updateUserIntegral(orderUserId, CaclEnum.ORDER_REFUND_INTEGRAL, payIntegral,0l,tradeOrderId,tradeOrderNum);
|
|
|
|
|
|
|
|
|
//2. 减少退货物品对应的冻结积分
|
|
|
Long increaseIntegral = tradeOrderItemDO.getIncreaseIntegral();
|
|
|
- integralService.updateUserIntegral(userId, CaclEnum.ORDER_REFUND_CANCEL_INTEGRAL, 0l,increaseIntegral,tradeOrderId,tradeOrderNum);
|
|
|
+ integralService.updateUserIntegral(orderUserId, CaclEnum.ORDER_REFUND_CANCEL_INTEGRAL, 0l,increaseIntegral*(-1),tradeOrderId,tradeOrderNum);
|
|
|
|
|
|
// 发起退款单。注意,需要在事务提交后,再进行发起,避免重复发起
|
|
|
createPayRefund(userIp, afterSale);
|