|
|
@@ -242,7 +242,7 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
//记录优惠券使用状态
|
|
|
couponUser = couponStatusRecord(payRequest.getCouponExCode(), payRequest.getCouponId(), payRequest.getUserId(), couponPopularizeDto);
|
|
|
}
|
|
|
- GoodsDonSku sku = adjustGoodsDonSku(yhsId, payRequest.getSkuId());
|
|
|
+ GoodsDonSku sku = adjustGoodsDonSku(yhsId, payRequest.getIsPayReal(), payRequest.getSkuId());
|
|
|
GoodsDon goodsDon = goodsDonMapper.selectById(sku.getGoodsId());
|
|
|
if (goodsDon == null || !goodsDon.getStatus()) {
|
|
|
throw new BusinessRuntimeException("商品已下架");
|
|
|
@@ -696,7 +696,7 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
String customId = payRequest.getCustomId();
|
|
|
//若存在店铺id,校验店铺状态
|
|
|
Long yhsId = yhShopFrontService.checkShopCustomIdAndReturnShopId(customId);
|
|
|
- GoodsDonSku sku = adjustGoodsDonSku(yhsId, renewSkuId);
|
|
|
+ GoodsDonSku sku = adjustGoodsDonSku(yhsId, false, renewSkuId);
|
|
|
|
|
|
GroupsRelation relation = groupsRelationMapper.selectById(relationId);
|
|
|
if (relation == null) {
|
|
|
@@ -2210,9 +2210,10 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public GoodsDonSku adjustGoodsDonSku(Long yhsId, Long skuId) {
|
|
|
+ public GoodsDonSku adjustGoodsDonSku(Long yhsId, Boolean isPayReal, Long skuId) {
|
|
|
GoodsDonSku sku;
|
|
|
- if (yhsId != null) {
|
|
|
+ isPayReal = Optional.ofNullable(isPayReal).orElse(false);
|
|
|
+ if (yhsId != null && !isPayReal) {
|
|
|
sku = yhShopGoodsSkuMapper.selectGoodsDonSkuBySkuIdAndYhsId(yhsId, skuId);
|
|
|
} else {
|
|
|
sku = goodsDonSkuMapper.selectById(skuId);
|