1.完成库存预警功能

master
x_z 2 years ago
parent 261f7212f4
commit 1bb83857a9

@ -35,11 +35,6 @@ public class InvRemindSetResponse {
*/
private Boolean lowStock;
/**
*
*/
private Integer lowStockNum;
/**
*
*/
@ -50,11 +45,6 @@ public class InvRemindSetResponse {
*/
private Boolean overStock;
/**
*
*/
private Integer overStockNum;
/**
*
*/
@ -65,11 +55,6 @@ public class InvRemindSetResponse {
*/
private Boolean recentDate;
/**
*
*/
private Integer recentDateDay;
/**
*
*/

@ -62,6 +62,7 @@ public class InvRemindMsgServiceImpl implements InvRemindMsgService {
invRemindMsgEntity.setIgnoreStatus(0); //重置成为不忽略
invRemindMsgEntity.setHandleMsg(handleMsg); //处理方式
invRemindMsgEntity.setUpdateTime(new Date());
invRemindMsgEntity.setNextRemindTime(new Date());
invRemindMsgDao.updateById(invRemindMsgEntity);
return ResultVOUtils.success("已确认");
}
@ -87,6 +88,7 @@ public class InvRemindMsgServiceImpl implements InvRemindMsgService {
invRemindMsgRequest.setDeptCode(invProductEntity.getDeptCode());
invRemindMsgRequest.setInvCode(invProductEntity.getInvCode());
invRemindMsgRequest.setInvSpaceCode(invProductEntity.getInvSpaceCode());
invRemindMsgRequest.setSupId(invProductEntity.getSupId());
//根据预警设置,添加类型参数
if (invRemindSetEntity.getLowStock() && null != udiRelevanceEntity.getLowStockNum()) {
@ -177,13 +179,13 @@ public class InvRemindMsgServiceImpl implements InvRemindMsgService {
Date updateTime = msgEntity.getUpdateTime();
switch (ignoreStatus) {
case 1: //忽略7天
msgEntity.setNextRemindTime(DateUtil.getBeforeDay(updateTime, 7 * 24));
msgEntity.setNextRemindTime(DateUtil.getAfterDay(updateTime, 7 * 24));
break;
case 2: //忽略15天
msgEntity.setNextRemindTime(DateUtil.getBeforeDay(updateTime, 15 * 24));
msgEntity.setNextRemindTime(DateUtil.getAfterDay(updateTime, 15 * 24));
break;
case 3: //忽略30天
msgEntity.setNextRemindTime(DateUtil.getBeforeDay(updateTime, 30 * 24));
msgEntity.setNextRemindTime(DateUtil.getAfterDay(updateTime, 30 * 24));
break;
default:
break;

@ -554,7 +554,6 @@ public class DateUtil extends DateUtils {
long time = actDate.getTime();
long move = hour * 1000 * 60 * 60;
time = time - move;
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return new Date(time);
} catch (Exception e) {
e.printStackTrace();
@ -621,4 +620,23 @@ public class DateUtil extends DateUtils {
long t2 = Long.parseLong(time);
return t2 > t1;
}
/**
*
*
* @param time
* @param hour
* @return
*/
public static Date getAfterDay(Date date, int hour) {
try {
long time = date.getTime();
long move = hour * 1000 * 60 * 60;
time = time + move;
return new Date(time);
} catch (Exception e) {
log.error("向后推迟时间异常", e);
}
return null;
}
}

@ -8,13 +8,10 @@
irs.invCode,
irs.invSpaceCode,
irs.lowStock,
irs.lowStockNum,
irs.lackStock,
irs.overStock,
irs.overStockNum,
irs.expireDate,
irs.recentDate,
irs.recentDateDay,
irs.remark,
bp.cpmctymc productName,
bp.ggxh,

@ -245,9 +245,10 @@
ip.batchNo,
ip.productionDate,
ip.expireDate,
sum(ip.inCount),
sum(ip.outCount),
sum(ip.reCount)
ip.supId,
sum(ip.inCount) incount,
sum(ip.outCount) outCount,
sum(ip.reCount) reCount
from inv_product ip
left join inv_product_detail ipd
on ip.relIdFk = ipd.relId and ifnull(ip.batchNo, 'empty') = ifnull(ipd.batchNo, 'empty')
@ -262,7 +263,7 @@
AND ip.relIdFk = #{relId}
</if>
</where>
group by ip.relIdFk, ip.batchNo, ip.invCode, ipd.invSpaceCode
group by ip.relIdFk, ip.batchNo
</select>
<select id="filterProductNames" resultType="com.glxp.api.res.inv.InvProductResponse">

Loading…
Cancel
Save