|
|
|
@ -91,14 +91,14 @@ public class InvRemindMsgServiceImpl implements InvRemindMsgService {
|
|
|
|
|
invRemindMsgRequest.setSupId(invProductEntity.getSupId());
|
|
|
|
|
|
|
|
|
|
//根据预警设置,添加类型参数
|
|
|
|
|
if (invRemindSetEntity.getLowStock() && null != udiRelevanceEntity.getLowStockNum()) {
|
|
|
|
|
if (invRemindSetEntity.getLowStock() && null != invRemindSetEntity.getLowStockNum()) {
|
|
|
|
|
//开启低库存预警
|
|
|
|
|
invRemindMsgRequest.setType("1"); //库存不足预警
|
|
|
|
|
InvRemindMsgEntity msgEntity = getInvRemindMsgEntity(invRemindMsgRequest, invProductEntity);
|
|
|
|
|
//判断是否需要生成/刷新库存预警
|
|
|
|
|
if ((null == msgEntity.getNextRemindTime() || msgEntity.getNextRemindTime().getTime() <= new Date().getTime()) && udiRelevanceEntity.getLowStockNum() > invProductEntity.getReCount()) {
|
|
|
|
|
if ((null == msgEntity.getNextRemindTime() || msgEntity.getNextRemindTime().getTime() <= new Date().getTime()) && invRemindSetEntity.getLowStockNum() > invProductEntity.getReCount()) {
|
|
|
|
|
//设置预警消息
|
|
|
|
|
msgEntity.setMsg(StrUtil.format("库存数量已不足:{},当前库存数量:{} ", udiRelevanceEntity.getLowStockNum(), invProductEntity.getReCount()));
|
|
|
|
|
msgEntity.setMsg(StrUtil.format("库存数量已不足:{},当前库存数量:{} ", invRemindSetEntity.getLowStockNum(), invProductEntity.getReCount()));
|
|
|
|
|
saveMsg(msgEntity);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
@ -119,12 +119,12 @@ public class InvRemindMsgServiceImpl implements InvRemindMsgService {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (invRemindSetEntity.getOverStock() && null != udiRelevanceEntity.getOverStockNum()) {
|
|
|
|
|
if (invRemindSetEntity.getOverStock() && null != invRemindSetEntity.getOverStockNum()) {
|
|
|
|
|
//开启库存积压预警
|
|
|
|
|
invRemindMsgRequest.setType("3"); //库存积压预警
|
|
|
|
|
InvRemindMsgEntity msgEntity = getInvRemindMsgEntity(invRemindMsgRequest, invProductEntity);
|
|
|
|
|
//判断是否需要生成/刷新库存预警
|
|
|
|
|
if ((null == msgEntity.getNextRemindTime() || msgEntity.getNextRemindTime().getTime() <= new Date().getTime()) && invProductEntity.getReCount() > udiRelevanceEntity.getOverStockNum()) {
|
|
|
|
|
if ((null == msgEntity.getNextRemindTime() || msgEntity.getNextRemindTime().getTime() <= new Date().getTime()) && invProductEntity.getReCount() > invRemindSetEntity.getOverStockNum()) {
|
|
|
|
|
//设置预警消息
|
|
|
|
|
msgEntity.setMsg(StrUtil.format("库存积压,当前库存数量:{}", invProductEntity.getReCount()));
|
|
|
|
|
saveMsg(msgEntity);
|
|
|
|
|