Commit 2b681f90ca2cf4a06cc97234f7c20d6d2a80175c

Authored by YunaiV
1 parent e6afd28f

【代码评审】商城:拼团失败的取消支付逻辑

yudao-module-mall/yudao-module-trade-api/src/main/java/cn/iocoder/yudao/module/trade/api/order/TradeOrderApi.java
@@ -28,7 +28,6 @@ public interface TradeOrderApi { @@ -28,7 +28,6 @@ public interface TradeOrderApi {
28 */ 28 */
29 TradeOrderRespDTO getOrder(Long id); 29 TradeOrderRespDTO getOrder(Long id);
30 30
31 - // TODO 芋艿:需要优化下;  
32 /** 31 /**
33 * 取消支付订单 32 * 取消支付订单
34 * 33 *
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/order/TradeOrderUpdateServiceImpl.java
@@ -859,6 +859,7 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService { @@ -859,6 +859,7 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService {
859 @Override 859 @Override
860 @Transactional(rollbackFor = Exception.class) 860 @Transactional(rollbackFor = Exception.class)
861 public void cancelPaidOrder(Long userId, Long orderId) { 861 public void cancelPaidOrder(Long userId, Long orderId) {
  862 + // TODO @puhui999:可能要加一个拼团取消;TradeOrderCancelTypeEnum.AFTER_SALE_CLOSE;然后参数传入下;
862 // 1.1 检验订单存在 863 // 1.1 检验订单存在
863 TradeOrderDO order = tradeOrderMapper.selectOrderByIdAndUserId(orderId, userId); 864 TradeOrderDO order = tradeOrderMapper.selectOrderByIdAndUserId(orderId, userId);
864 if (order == null) { 865 if (order == null) {
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/price/calculator/TradeDeliveryPriceCalculator.java
@@ -60,6 +60,7 @@ public class TradeDeliveryPriceCalculator implements TradePriceCalculator { @@ -60,6 +60,7 @@ public class TradeDeliveryPriceCalculator implements TradePriceCalculator {
60 if (param.getDeliveryType() == null) { 60 if (param.getDeliveryType() == null) {
61 return; 61 return;
62 } 62 }
  63 + // TODO @puhui999:1)TradePriceCalculateRespBO 传递进来 delveryType 配送方式,减少读取;2)如果不匹配,抛出业务异常; = = 不然就不扣钱啦。
63 // 校验是不是存在商品不能门店自提,或者不能快递发货的情况。就是说,配送方式不匹配哈 64 // 校验是不是存在商品不能门店自提,或者不能快递发货的情况。就是说,配送方式不匹配哈
64 List<ProductSpuRespDTO> spuList = productSpuApi.getSpuList(convertSet(result.getItems(), OrderItem::getSpuId)); 65 List<ProductSpuRespDTO> spuList = productSpuApi.getSpuList(convertSet(result.getItems(), OrderItem::getSpuId));
65 if (anyMatch(spuList, item -> !item.getDeliveryTypes().contains(param.getDeliveryType()))) { 66 if (anyMatch(spuList, item -> !item.getDeliveryTypes().contains(param.getDeliveryType()))) {