Pārlūkot izejas kodu

修改退款程序:购物有用积分的,才记返还积分日志

Ben 5 mēneši atpakaļ
vecāks
revīzija
07d24ad119

+ 8 - 7
feifan-module-mall/feifan-module-trade-biz/src/main/java/cn/newfeifan/mall/module/trade/service/aftersale/AfterSaleServiceImpl.java

@@ -399,13 +399,14 @@ public class AfterSaleServiceImpl implements AfterSaleService {
         Long payIntegral = tradeOrderItemDO.getPayIntegral();//支付积分
 
         //记录退还积分
-        TradeOrderItemDO toid = new TradeOrderItemDO();
-        toid.setId(tradeOrderItemDO.getId());
-        toid.setRefundIntegral(payIntegral);
-        tradeOrderItemMapper.updateById(toid);
-        //退回退款订单项,购物者支付的积分
-        integralService.updateUserIntegral(orderUserId, CaclEnum.ORDER_REFUND_INTEGRAL, payIntegral,0l,tradeOrderId,tradeOrderNum);
-
+        if(payIntegral>0) {
+            TradeOrderItemDO toid = new TradeOrderItemDO();
+            toid.setId(tradeOrderItemDO.getId());
+            toid.setRefundIntegral(payIntegral);
+            tradeOrderItemMapper.updateById(toid);
+            //退回退款订单项,购物者支付的积分
+            integralService.updateUserIntegral(orderUserId, CaclEnum.ORDER_REFUND_INTEGRAL, payIntegral, 0l, tradeOrderId, tradeOrderNum);
+        }
 
         //2. 减少退货物品对应的冻结积分
         Long increaseIntegral = tradeOrderItemDO.getIncreaseIntegral();//消费者自得冻结积分