rk
21 小时以前 f9e4883831956328e73f4df77c8d6887a0f8d70b
server/dmmall_service/src/main/java/com/doumee/service/business/impl/GoodsServiceImpl.java
@@ -372,17 +372,9 @@
                    .eq(GoodsSku::getIsdeleted,Constants.ZERO)
                    .in(GoodsSku::getGoodsId,idList));
        }
        long shopNum   = shopMapper.selectCount(new QueryWrapper<Shop>().lambda()
                .eq(Shop::getIsdeleted,Constants.ZERO)
                .eq(Shop::getStatus,Constants.ZERO));
        MPJLambdaWrapper<Goods> queryWrapper = new MPJLambdaWrapper<>();
        queryWrapper.selectAll(Goods.class);
        queryWrapper.select("(select count(s.id) from shop_goods_relation s  " +
                "left join shop g on s.SHOP_ID =g.id " +
                "where g.status=0 and s.ISDELETED=0 and s.GOODS_ID=t.id) as pricedShopNum ");
        queryWrapper.eq(GoodsSku::getIsdeleted,Constants.ZERO);
        queryWrapper.in(Goods::getId,idList);
        List<Goods> goodsList= goodsAdminJoinMapper.selectJoinList(Goods.class,queryWrapper);
        List<Goods> goodsList= goodsMapper.selectList(new QueryWrapper<Goods>().lambda()
                .eq(Goods::getIsdeleted,Constants.ZERO)
                .in(Goods::getId,idList));
        if(goodsList==null || goodsList.size() == 0){
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "商品信息查询无效 ");
        }
@@ -409,14 +401,6 @@
                 throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), goods.getName()+":商品商品尚未设置零售价,无法上架");
                }
            }
            if(Constants.formatLongNum(goods.getPricedShopNum()) < shopNum){
                //默认sku信息
                s =false;
                if(idList.size()==1){
                  throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), goods.getName()+":有未设置供货价的经销商,无法上架");
                }
            }
            if(s){
                idList2.add(param.getId());
            }
@@ -432,7 +416,7 @@
        if(successNum != idList.size()){
            if( idList.size()>1){
                throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "成功上架商品数:【"+successNum+"】,上架失败:【"+(idList.size()-successNum)+"】个商品,请确保待上架商品的均销售价和供货价已设置");
                throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "成功上架商品数:【"+successNum+"】,上架失败:【"+(idList.size()-successNum)+"】个商品,请确保待上架商品的销售价已设置");
            }else {
                throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode()," 上架失败");
            }