|
|
|
@@ -49,6 +49,9 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { |
|
|
|
@Autowired |
|
|
|
WxOrderMapper wxOrderMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
WxCouponOrderMapper wxCouponOrderMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
WxProfitSharingOrderService profitSharingOrderService; |
|
|
|
|
|
|
|
@@ -141,6 +144,21 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { |
|
|
|
logger.error("card info update error"); |
|
|
|
return new ResultData(ErrorCode.DB_FAIL.getCode(), "card info 更新出错!"); |
|
|
|
} |
|
|
|
// 7.1 update coupon card status |
|
|
|
if(cardInfo.getRemainingAmount().equals(0)) { |
|
|
|
WxCouponOrder couponOrder = new WxCouponOrder(); |
|
|
|
couponOrder.setId(cardInfo.getId()); |
|
|
|
couponOrder.setCouponId(cardInfo.getCouponId()); |
|
|
|
couponOrder.setOrderId(order.getId()); |
|
|
|
couponOrder.setCouponOrderStatus(EnumCouponOrderStatus.CARD_COMPLETE.getCode()); |
|
|
|
couponOrder.setUpdateDate(curDate); |
|
|
|
try { |
|
|
|
wxCouponOrderMapper.updateByPrimaryKeySelective(couponOrder); |
|
|
|
} catch (Exception e) { |
|
|
|
logger.error("couponOrder status update error"); |
|
|
|
return new ResultData(ErrorCode.DB_FAIL.getCode(), "couponOrder status 更新出错!"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 8. 补贴 |
|
|
|
Integer subsidyFee = (record.getDeductionAmount() - payment)* subsidyRate / 10000; |
|
|
|
|