From e07a48391aceac4e9cd7c46adc5c2116d4d51462 Mon Sep 17 00:00:00 2001 From: yuanye <418471657@qq.com> Date: Mon, 27 Oct 2025 13:34:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=99=90=E8=B4=AD=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/order/impl/BsOrderChildServiceImpl.java | 2 +- .../hfkj/service/order/impl/BsOrderServiceImpl.java | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/service/src/main/java/com/hfkj/service/order/impl/BsOrderChildServiceImpl.java b/service/src/main/java/com/hfkj/service/order/impl/BsOrderChildServiceImpl.java index 63c750f..b3c62b1 100644 --- a/service/src/main/java/com/hfkj/service/order/impl/BsOrderChildServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/order/impl/BsOrderChildServiceImpl.java @@ -131,7 +131,7 @@ public class BsOrderChildServiceImpl implements BsOrderChildService { if (!childModel.getProductSpecId().equals(999999L)) { GoodsVpd goodsVpd = goodsVpdService.queryDetailBySpecsId(childModel.getProductSpecId()); - if (goodsVpd.getSource() == 2) { + if (goodsVpd != null && goodsVpd.getSource() != null && goodsVpd.getSource() == 2) { BsOrderMember orderMember = orderMemberService.findGoodsOrderByChildNo(childModel.getChildOrderNo()); if (orderMember != null) { goodsVpd.setExt1(orderMember.getUserPhone()); diff --git a/service/src/main/java/com/hfkj/service/order/impl/BsOrderServiceImpl.java b/service/src/main/java/com/hfkj/service/order/impl/BsOrderServiceImpl.java index 4ec7121..fa6dfe2 100644 --- a/service/src/main/java/com/hfkj/service/order/impl/BsOrderServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/order/impl/BsOrderServiceImpl.java @@ -20,6 +20,7 @@ import com.hfkj.service.BsProductConfigService; import com.hfkj.service.discount.CouponDiscountService; import com.hfkj.service.discount.CouponDiscountUserRelService; import com.hfkj.service.goods.BsOrderCinemaService; +import com.hfkj.service.goods.GoodsMsgService; import com.hfkj.service.goods.GoodsSpecsService; import com.hfkj.service.goods.GoodsUserAddressService; import com.hfkj.service.order.*; @@ -104,6 +105,8 @@ public class BsOrderServiceImpl implements BsOrderService { private BsMerPayConfigService bsMerPayConfigService; @Resource private BsOrderMapper bsOrderMapper; + @Resource + private GoodsMsgService goodsMsgService; @Override public BsOrder editData(BsOrder order) { @@ -196,6 +199,15 @@ public class BsOrderServiceImpl implements BsOrderService { skuInfo.setSkuNum(child.getProductCount()); skuInfoList.add(skuInfo); } + + // 查询商品 + GoodsMsg goodsMsg = goodsMsgService.queryDetail(specs.getGoodsId()); + if (goodsMsg == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "商品不可购买!"); + } + if (goodsMsg.getStatus() != 1) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "商品不可购买!"); + } // todo 1.0阶段暂时需要返回收货地址使用 order.setBusiness(child.getBusiness()); } else if (child.getProductType().equals(OrderChildProductTypeEnum.type2.getCode())) {