1.完成库存预警功能

master
x_z 2 years ago
parent 261f7212f4
commit 1bb83857a9

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

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

@ -554,7 +554,6 @@ public class DateUtil extends DateUtils {
long time = actDate.getTime(); long time = actDate.getTime();
long move = hour * 1000 * 60 * 60; long move = hour * 1000 * 60 * 60;
time = time - move; time = time - move;
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return new Date(time); return new Date(time);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
@ -621,4 +620,23 @@ public class DateUtil extends DateUtils {
long t2 = Long.parseLong(time); long t2 = Long.parseLong(time);
return t2 > t1; 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.invCode,
irs.invSpaceCode, irs.invSpaceCode,
irs.lowStock, irs.lowStock,
irs.lowStockNum,
irs.lackStock, irs.lackStock,
irs.overStock, irs.overStock,
irs.overStockNum,
irs.expireDate, irs.expireDate,
irs.recentDate, irs.recentDate,
irs.recentDateDay,
irs.remark, irs.remark,
bp.cpmctymc productName, bp.cpmctymc productName,
bp.ggxh, bp.ggxh,

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

Loading…
Cancel
Save