分店获取自己的商品
This commit is contained in:
parent
2123606bf5
commit
5bb1e28310
|
|
@ -92,7 +92,22 @@ public class MkLimitTimeDiscountServiceImpl extends ServiceImpl<MkLimitTimeDisco
|
|||
@Override
|
||||
public MkLimitTimeDiscount getLimitTimeDiscountByShopId(Long shopId) {
|
||||
Long mainShopId = shopInfoService.getMainIdByShopId(shopId);
|
||||
return mapper.selectOneByShopId(mainShopId, shopId, CzgStrUtils.getStrWeek());
|
||||
MkLimitTimeDiscount limitTimeDiscount = mapper.selectOneByShopId(mainShopId, shopId, CzgStrUtils.getStrWeek());
|
||||
if (limitTimeDiscount != null && limitTimeDiscount.getFoodType() == 2 && StrUtil.isNotBlank(limitTimeDiscount.getFoods())) {
|
||||
List<String> foodIds = Arrays.stream(limitTimeDiscount.getFoods().split(","))
|
||||
.map(String::trim)
|
||||
.filter(StrUtil::isNotBlank)
|
||||
.distinct()
|
||||
.toList();
|
||||
List<String> ids = productService.listAs(QueryWrapper.create().select(Product::getId)
|
||||
.eq(Product::getShopId, shopId).in(Product::getSyncId, foodIds), String.class);
|
||||
if (CollUtil.isEmpty(ids)) {
|
||||
limitTimeDiscount.setFoods("");
|
||||
} else {
|
||||
limitTimeDiscount.setFoods(String.join(",", ids));
|
||||
}
|
||||
}
|
||||
return limitTimeDiscount;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Reference in New Issue