|
@@ -83,10 +83,6 @@ public class CommodityProcureServiceImpl implements CommodityProcureService {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private KafkaProducer kafkaProducer;
|
|
private KafkaProducer kafkaProducer;
|
|
|
|
|
|
|
|
- @Lazy
|
|
|
|
|
- @Autowired
|
|
|
|
|
- private CommodityProcureService self;
|
|
|
|
|
-
|
|
|
|
|
private static final BigDecimal HUNDRED = new BigDecimal("100");
|
|
private static final BigDecimal HUNDRED = new BigDecimal("100");
|
|
|
private static final BigDecimal COMMISSION_DEFAULT_RATE = new BigDecimal("0.01");
|
|
private static final BigDecimal COMMISSION_DEFAULT_RATE = new BigDecimal("0.01");
|
|
|
private static final Integer JD_SHOP_ID = 11507;
|
|
private static final Integer JD_SHOP_ID = 11507;
|
|
@@ -707,7 +703,6 @@ public class CommodityProcureServiceImpl implements CommodityProcureService {
|
|
|
Integer uniacid = req.getUniacid();
|
|
Integer uniacid = req.getUniacid();
|
|
|
Integer issupply = req.getIssupply();
|
|
Integer issupply = req.getIssupply();
|
|
|
Integer cate = req.getCate();
|
|
Integer cate = req.getCate();
|
|
|
- List<Long> goodsIds = req.getGoodsIds();
|
|
|
|
|
|
|
|
|
|
// 1. 查询在云商城中的店铺id(需要supplystatus=1)
|
|
// 1. 查询在云商城中的店铺id(需要supplystatus=1)
|
|
|
ImsEweiShopApply apply = applyMapper.selectOne(new LambdaQueryWrapper<ImsEweiShopApply>()
|
|
ImsEweiShopApply apply = applyMapper.selectOne(new LambdaQueryWrapper<ImsEweiShopApply>()
|
|
@@ -746,8 +741,28 @@ public class CommodityProcureServiceImpl implements CommodityProcureService {
|
|
|
throw new ApiException("请选择品类!");
|
|
throw new ApiException("请选择品类!");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // 4. 查询商品列表
|
|
|
|
|
- List<ImsEweiShopGoods> items = new ArrayList<>(goodsService.listByIds(goodsIds));
|
|
|
|
|
|
|
+ // 4. 从数据库按条件查询供货商品列表(参考sale接口逻辑)
|
|
|
|
|
+ // 基础条件:type=1, commoditytype=0, status=1, merchid=0, deleted=0, costprice>0, catch_source!='xinglian'
|
|
|
|
|
+ LambdaQueryWrapper<ImsEweiShopGoods> goodsQuery = new LambdaQueryWrapper<ImsEweiShopGoods>()
|
|
|
|
|
+ .eq(ImsEweiShopGoods::getUniacid, uniacid)
|
|
|
|
|
+ .eq(ImsEweiShopGoods::getType, 1)
|
|
|
|
|
+ .eq(ImsEweiShopGoods::getCommoditytype, 0)
|
|
|
|
|
+ .eq(ImsEweiShopGoods::getStatus, 1)
|
|
|
|
|
+ .eq(ImsEweiShopGoods::getMerchid, 0)
|
|
|
|
|
+ .eq(ImsEweiShopGoods::getDeleted, 0)
|
|
|
|
|
+ .gt(ImsEweiShopGoods::getCostprice, 0)
|
|
|
|
|
+ .ne(ImsEweiShopGoods::getCatch_source, "xinglian");
|
|
|
|
|
+ // 关键字过滤(商品ID或标题模糊匹配)
|
|
|
|
|
+ if (req.getKeyword() != null && !req.getKeyword().trim().isEmpty()) {
|
|
|
|
|
+ String kw = req.getKeyword().trim();
|
|
|
|
|
+ goodsQuery.and(w -> w.eq(ImsEweiShopGoods::getId, kw)
|
|
|
|
|
+ .or().like(ImsEweiShopGoods::getTitle, kw));
|
|
|
|
|
+ }
|
|
|
|
|
+ // 分类过滤(FIND_IN_SET)
|
|
|
|
|
+ if (req.getCate() != null && req.getCate() != 0) {
|
|
|
|
|
+ goodsQuery.apply("FIND_IN_SET({0}, cates) <> 0", req.getCate());
|
|
|
|
|
+ }
|
|
|
|
|
+ List<ImsEweiShopGoods> items = goodsService.list(goodsQuery);
|
|
|
|
|
|
|
|
for (ImsEweiShopGoods item : items) {
|
|
for (ImsEweiShopGoods item : items) {
|
|
|
if (!issupply.equals(item.getIssupply())) {
|
|
if (!issupply.equals(item.getIssupply())) {
|