| | |
| | | |
| | | @Autowired |
| | | private SystemDictDataBiz systemDictDataBiz; |
| | | @Autowired |
| | | private ShopMapper shopMapper; |
| | | |
| | | @Autowired |
| | | private GoodsSkuAttrJoinMapper goodsSkuAttrJoinMapper; |
| | |
| | | || goods.getDeductRata() == null |
| | | || goods.getPrice() == null |
| | | || goods.getSkuPrice() == null |
| | | || StringUtils.isBlank(goods.getImgurl()) |
| | | || org.apache.commons.collections.CollectionUtils.isEmpty(goods.getFileList())) { |
| | | // || StringUtils.isBlank(goods.getImgurl()) |
| | | // || org.apache.commons.collections.CollectionUtils.isEmpty(goods.getFileList()) |
| | | ) { |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), ResponseStatus.BAD_REQUEST.getMessage()); |
| | | } |
| | | |
| | |
| | | queryWrapper.leftJoin(Labels.class,Labels::getId,Goods::getParentCategoryId); |
| | | //库存量 |
| | | queryWrapper.select("(select sum(STOCK) from goods_sku where ISDELETED=0 and GOODS_ID=t.id) as stockNum "); |
| | | queryWrapper.select("(select count(id) from shop_goods_relation s where s.ISDELETED=0 and s.GOODS_ID=t.id) as pricedShopNum "); |
| | | //实际销量 |
| | | queryWrapper.select("(select sum(gd.GOODS_NUM) from goodsorder_detail gd" + |
| | | " inner join goods_sku gs on gs.id=gd.GOODS_SKU_ID" + |
| | |
| | | if (list == null || list.size() == 0) { |
| | | return; |
| | | } |
| | | long shopNum = shopMapper.selectCount(new QueryWrapper<Shop>().lambda() |
| | | .eq(Shop::getIsdeleted,Constants.ZERO)); |
| | | String path = systemDictDataBiz.queryByCode(Constants.OSS, Constants.RESOURCE_PATH).getCode() |
| | | + systemDictDataBiz.queryByCode(Constants.OSS, Constants.GOODS_FILE).getCode(); |
| | | for (Goods goods : list) { |
| | | goods.setShopNum(shopNum); |
| | | goods.setResourcePath(path); |
| | | //查询sku |
| | | MPJLambdaWrapper<GoodsSku> queryWrapper = new MPJLambdaWrapper<GoodsSku>() |