jiaosong
2023-09-20 d7e6b515aa68e9d17d8cec9dd3e93d77bc9b2b6e
server/service/src/main/java/com/doumee/service/business/impl/GoodsServiceImpl.java
@@ -509,7 +509,7 @@
            throw new BusinessException(ResponseStatus.DATA_EMPTY);
        }
        //拉式商品 且 上架时,需要限制 平台商品是否已下架
        if(dbGoods.getType().equals(Constants.goodsType.PULL)&&goods.getStatus().equals(Constants.ZERO)){
        if(dbGoods.getType().equals(Constants.goodsType.PULL.getValue())&&goods.getStatus().equals(Constants.ZERO)){
            BaseGoods baseGoods = baseGoodsMapper.selectById(dbGoods.getGoodsId());
            if(Objects.isNull(baseGoods)){
                throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"未查询到平台商品信息");
@@ -547,7 +547,7 @@
                continue;
            }
            //拉式商品 且 上架时,需要限制 平台商品是否已下架
            if(dbGoods.getType().equals(Constants.goodsType.PULL)&&batchDisableDTO.getStatus().equals(Constants.ZERO)){
            if(dbGoods.getType().equals(Constants.goodsType.PULL.getValue())&&batchDisableDTO.getStatus().equals(Constants.ZERO)){
                BaseGoods baseGoods = baseGoodsMapper.selectById(dbGoods.getGoodsId());
                if(Objects.isNull(baseGoods)||!baseGoods.getStatus().equals(Constants.ZERO)){
                    errNum++;
@@ -1067,7 +1067,6 @@
            i.setMultifileList(multifileMapper.selectList(new QueryWrapper<Multifile>().eq("OBJ_ID",i.getId()).orderByAsc(" SORTNUM ")));
            i.setGoodsParamList(goodsParamMapper.selectList(new QueryWrapper<GoodsParam>()
                    .eq("GOODS_ID",i.getId())
                            .apply(" name in ( select cp.NAME from cate_param cp where cp.CATEGORY_ID = "+i.getCategoryId()+" and cp.ISSHOW = 1 and cp.ISDELETED = 0 and cp.STATUS = 0 ) ")
                    .orderByAsc(" SORTNUM ")));
        });
        return PageData.from(goodsIPage);
@@ -1110,7 +1109,10 @@
        goodsList.forEach(i->{
            i.setPrefixUrl(prefixUrl);
            i.setMultifileList(multifileMapper.selectList(new QueryWrapper<Multifile>().eq("OBJ_ID",i.getId()).orderByAsc(" SORTNUM ")));
            i.setGoodsParamList(goodsParamMapper.selectList(new QueryWrapper<GoodsParam>().eq("GOODS_ID",i.getId()).orderByAsc(" SORTNUM ")));
            i.setGoodsParamList(goodsParamMapper.selectList(
                    new QueryWrapper<GoodsParam>().eq("GOODS_ID",i.getId())
                            .apply(" name in ( select cp.NAME from cate_param cp where cp.CATEGORY_ID = "+i.getCategoryId()+" and cp.ISSHOW = 1 and cp.ISDELETED = 0 and cp.STATUS = 0 ) ")
                            .orderByAsc(" SORTNUM ")));
        });
        return goodsList;
    }