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

This commit is contained in:
YunaiV 2024-08-20 21:18:56 +08:00
parent e6afd28f01
commit 2b681f90ca
3 changed files with 2 additions and 1 deletions

View File

@ -28,7 +28,6 @@ public interface TradeOrderApi {
*/
TradeOrderRespDTO getOrder(Long id);
// TODO 芋艿需要优化下
/**
* 取消支付订单
*

View File

@ -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) {

View File

@ -60,6 +60,7 @@ public class TradeDeliveryPriceCalculator implements TradePriceCalculator {
if (param.getDeliveryType() == null) {
return;
}
// TODO @puhui9991TradePriceCalculateRespBO 传递进来 delveryType 配送方式减少读取2如果不匹配抛出业务异常 = = 不然就不扣钱啦
// 校验是不是存在商品不能门店自提或者不能快递发货的情况就是说配送方式不匹配哈
List<ProductSpuRespDTO> spuList = productSpuApi.getSpuList(convertSet(result.getItems(), OrderItem::getSpuId));
if (anyMatch(spuList, item -> !item.getDeliveryTypes().contains(param.getDeliveryType()))) {