PC端/收银机商品查询增加缓存

This commit is contained in:
Tankaikai 2025-03-27 14:35:19 +08:00
parent 5d6907c5d2
commit 2738ca6827
1 changed files with 1 additions and 1 deletions

View File

@ -149,7 +149,7 @@ public class UProductServiceImpl extends ServiceImpl<ProductMapper, Product> imp
@Override
public Map<Long, Integer> findShopProductStock(Long shopId) {
List<Product> list = productMapper.selectListByQuery(query().select(Product::getId, Product::getStockNumber).eq(Product::getShopId, shopId));
if (CollUtil.isNotEmpty(list)) {
if (CollUtil.isEmpty(list)) {
return null;
}
return list.stream().collect(Collectors.toMap(Product::getId, Product::getStockNumber));