库存预警功能,预警为0不进行预警

This commit is contained in:
chc 2024-01-24 11:32:28 +08:00
parent a962939db8
commit 56d9dbee5b
3 changed files with 7 additions and 1 deletions

View File

@ -132,7 +132,7 @@ public class GoodsSearchParams extends PageVO {
queryWrapper.le("quantity", leQuantity);
}
if (geQuantity != null) {
queryWrapper.ge("quantity", geQuantity);
queryWrapper.gt("quantity", geQuantity);
}
if (recommend != null) {
queryWrapper.le("recommend", recommend);
@ -145,6 +145,7 @@ public class GoodsSearchParams extends PageVO {
}
if(alertQuantity != null && alertQuantity){
queryWrapper.apply("quantity <= alert_quantity");
queryWrapper.ge("alert_quantity", 0);
}
queryWrapper.in(CollUtil.isNotEmpty(ids), "id", ids);

View File

@ -28,6 +28,10 @@ public interface GoodsStatisticsService extends IService<Goods> {
*/
long todayUpperNum();
/**
* 预警库存数
* @return
*/
long alertQuantityNum();
}

View File

@ -68,6 +68,7 @@ public class GoodsStatisticsServiceImpl extends ServiceImpl<GoodsStatisticsMappe
"store_id", currentUser.getStoreId());
queryWrapper.eq("market_enable",GoodsStatusEnum.UPPER.name());
queryWrapper.apply("quantity < alert_quantity");
queryWrapper.gt("alert_quantity",0);
return goodsSkuService.count(queryWrapper);
}
}