|
|
@@ -1428,10 +1428,13 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
|
|
|
return null;
|
|
|
}
|
|
|
FsStoreProduct fsStoreProduct = fsStoreProductService.selectFsStoreProductById(param.getProductId());
|
|
|
+ BigDecimal totalPrice = BigDecimal.ZERO;
|
|
|
BigDecimal payPrice = fsStoreProduct.getPrice().multiply(new BigDecimal(param.getTotalNum()));
|
|
|
+ totalPrice = totalPrice.add(payPrice);
|
|
|
BigDecimal payDelivery = BigDecimal.ZERO;
|
|
|
if (param.getCityId() == null) {
|
|
|
payDelivery = handleDeliveryMoney(param.getCityId(), fsStoreProduct, param.getTotalNum());
|
|
|
+ totalPrice = totalPrice.add(payDelivery);
|
|
|
}
|
|
|
|
|
|
if(param.getCouponUserId()!=null){
|
|
|
@@ -1446,7 +1449,7 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
|
|
|
|
|
|
return LiveOrderComputeDTO.builder().payPrice(payPrice)
|
|
|
.payDelivery(payDelivery)
|
|
|
- .totalPrice(payPrice.add(payDelivery))
|
|
|
+ .totalPrice(totalPrice)
|
|
|
.build();
|
|
|
}
|
|
|
|
|
|
@@ -2232,6 +2235,7 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
|
|
|
fsStoreProductService.updateFsStoreProduct(fsStoreProduct);
|
|
|
goods.setStock(goods.getStock()+Long.parseLong(liveOrder.getTotalNum()));
|
|
|
liveGoodsMapper.updateLiveGoods(goods);
|
|
|
+ this.refundCoupon(order);
|
|
|
|
|
|
return R.ok("操作成功");
|
|
|
}else {
|
|
|
@@ -2239,7 +2243,16 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ private void refundCoupon(LiveOrder order) {
|
|
|
+ if(order.getCouponUserId()!=null){
|
|
|
+ LiveCouponUser couponUser=liveCouponUserService.selectLiveCouponUserById(order.getCouponUserId());
|
|
|
+ if(couponUser!=null){
|
|
|
+ couponUser.setStatus(0);
|
|
|
+ couponUser.setUseTime(null);
|
|
|
+ liveCouponUserService.updateLiveCouponUser(couponUser);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
|
|
|
/**
|