修改限购问题

dev
袁野 1 month ago
parent 4779cbaf7d
commit e07a48391a
  1. 2
      service/src/main/java/com/hfkj/service/order/impl/BsOrderChildServiceImpl.java
  2. 12
      service/src/main/java/com/hfkj/service/order/impl/BsOrderServiceImpl.java

@ -131,7 +131,7 @@ public class BsOrderChildServiceImpl implements BsOrderChildService {
if (!childModel.getProductSpecId().equals(999999L)) { if (!childModel.getProductSpecId().equals(999999L)) {
GoodsVpd goodsVpd = goodsVpdService.queryDetailBySpecsId(childModel.getProductSpecId()); 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()); BsOrderMember orderMember = orderMemberService.findGoodsOrderByChildNo(childModel.getChildOrderNo());
if (orderMember != null) { if (orderMember != null) {
goodsVpd.setExt1(orderMember.getUserPhone()); goodsVpd.setExt1(orderMember.getUserPhone());

@ -20,6 +20,7 @@ import com.hfkj.service.BsProductConfigService;
import com.hfkj.service.discount.CouponDiscountService; import com.hfkj.service.discount.CouponDiscountService;
import com.hfkj.service.discount.CouponDiscountUserRelService; import com.hfkj.service.discount.CouponDiscountUserRelService;
import com.hfkj.service.goods.BsOrderCinemaService; import com.hfkj.service.goods.BsOrderCinemaService;
import com.hfkj.service.goods.GoodsMsgService;
import com.hfkj.service.goods.GoodsSpecsService; import com.hfkj.service.goods.GoodsSpecsService;
import com.hfkj.service.goods.GoodsUserAddressService; import com.hfkj.service.goods.GoodsUserAddressService;
import com.hfkj.service.order.*; import com.hfkj.service.order.*;
@ -104,6 +105,8 @@ public class BsOrderServiceImpl implements BsOrderService {
private BsMerPayConfigService bsMerPayConfigService; private BsMerPayConfigService bsMerPayConfigService;
@Resource @Resource
private BsOrderMapper bsOrderMapper; private BsOrderMapper bsOrderMapper;
@Resource
private GoodsMsgService goodsMsgService;
@Override @Override
public BsOrder editData(BsOrder order) { public BsOrder editData(BsOrder order) {
@ -196,6 +199,15 @@ public class BsOrderServiceImpl implements BsOrderService {
skuInfo.setSkuNum(child.getProductCount()); skuInfo.setSkuNum(child.getProductCount());
skuInfoList.add(skuInfo); 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阶段暂时需要返回收货地址使用 // todo 1.0阶段暂时需要返回收货地址使用
order.setBusiness(child.getBusiness()); order.setBusiness(child.getBusiness());
} else if (child.getProductType().equals(OrderChildProductTypeEnum.type2.getCode())) { } else if (child.getProductType().equals(OrderChildProductTypeEnum.type2.getCode())) {

Loading…
Cancel
Save