MrShi
2026-03-06 cdca21c0c12fa79ad4e85321d0f0960c0c4c3f33
server/dmmall_service/src/main/java/com/doumee/service/business/impl/ShopcartServiceImpl.java
@@ -238,6 +238,10 @@
        if(Objects.isNull(goodsSku)){
            throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"未查询到商品SKU信息");
        }
        Goods goods = goodsMapper.selectById(goodsSku.getGoodsId());
        if(Objects.isNull(goods)||!Constants.equalsInteger(goods.getStatus(),Constants.ZERO)||!Constants.equalsInteger(goods.getIsdeleted(),Constants.ZERO)){
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,商品已下架,无法加入购物车!");
        }
        if(!Objects.isNull(shopcart)){
            shopcart.setNum(shopcart.getNum() + addCartGoodsRequest.getNum());
            shopcart.setEditDate(new Date());