mirror of
				https://gitee.com/hhyykk/ipms-sjy.git
				synced 2025-11-04 20:28:44 +08:00 
			
		
		
		
	【代码评审】商城:拼团失败的取消支付逻辑
This commit is contained in:
		@@ -28,7 +28,6 @@ public interface TradeOrderApi {
 | 
			
		||||
     */
 | 
			
		||||
    TradeOrderRespDTO getOrder(Long id);
 | 
			
		||||
 | 
			
		||||
    // TODO 芋艿:需要优化下;
 | 
			
		||||
    /**
 | 
			
		||||
     * 取消支付订单
 | 
			
		||||
     *
 | 
			
		||||
 
 | 
			
		||||
@@ -859,6 +859,7 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService {
 | 
			
		||||
    @Override
 | 
			
		||||
    @Transactional(rollbackFor = Exception.class)
 | 
			
		||||
    public void cancelPaidOrder(Long userId, Long orderId) {
 | 
			
		||||
        // TODO @puhui999:可能要加一个拼团取消;TradeOrderCancelTypeEnum.AFTER_SALE_CLOSE;然后参数传入下;
 | 
			
		||||
        // 1.1 检验订单存在
 | 
			
		||||
        TradeOrderDO order = tradeOrderMapper.selectOrderByIdAndUserId(orderId, userId);
 | 
			
		||||
        if (order == null) {
 | 
			
		||||
 
 | 
			
		||||
@@ -60,6 +60,7 @@ public class TradeDeliveryPriceCalculator implements TradePriceCalculator {
 | 
			
		||||
        if (param.getDeliveryType() == null) {
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
        // TODO @puhui999:1)TradePriceCalculateRespBO 传递进来 delveryType 配送方式,减少读取;2)如果不匹配,抛出业务异常; = = 不然就不扣钱啦。
 | 
			
		||||
        // 校验是不是存在商品不能门店自提,或者不能快递发货的情况。就是说,配送方式不匹配哈
 | 
			
		||||
        List<ProductSpuRespDTO> spuList = productSpuApi.getSpuList(convertSet(result.getItems(), OrderItem::getSpuId));
 | 
			
		||||
        if (anyMatch(spuList, item -> !item.getDeliveryTypes().contains(param.getDeliveryType()))) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user