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