| | |
| | | .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(), "商品信息查询无效 "); |
| | | } |
| | |
| | | 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()); |
| | | } |
| | |
| | | |
| | | 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()," 上架失败"); |
| | | } |