|
|
|
@ -698,21 +698,38 @@ public class CRollinfoServiceImpl extends ServiceImpl<CRollinfoDao, CRollinfoEnt |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// 管控物料有效期 getExpireddate 存在 维护过有效期 |
|
|
|
if (cRollInfo.getExpireddate()!=null){ |
|
|
|
if (cRollInfo.getExpireddate().compareTo(new Date())<0){ |
|
|
|
return R.error("该卷已超过有效期"); |
|
|
|
} |
|
|
|
}else { |
|
|
|
// 没有维护过有效期 需要去无物料检测有效期 |
|
|
|
Part part = partService.getPart(cRollInfo.getPartno()); |
|
|
|
if ("Y".equals(part.getExpiredatecontrolflag())){ |
|
|
|
|
|
|
|
// 没有维护过有效期 需要去物料检测有效期 |
|
|
|
Part part = partService.getPart(cRollInfo.getPartno()); |
|
|
|
if ("Y".equals(part.getExpiredatecontrolflag())){ |
|
|
|
// 管控物料有效期 getExpireddate 存在 维护过有效期 |
|
|
|
if (cRollInfo.getExpireddate()!=null){ |
|
|
|
if (cRollInfo.getExpireddate().compareTo(new Date())<0){ |
|
|
|
return R.error("该卷已超过有效期"); |
|
|
|
} |
|
|
|
}else { |
|
|
|
Date expDate = DateUtils.addDateDays(cRollInfo.getRolldate(), part.getToexpiredays().intValue()); |
|
|
|
if (expDate.compareTo(new Date())<0){ |
|
|
|
return R.error("该卷已超过有效期"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// 管控物料有效期 getExpireddate 存在 维护过有效期 |
|
|
|
// if (cRollInfo.getExpireddate()!=null){ |
|
|
|
// if (cRollInfo.getExpireddate().compareTo(new Date())<0){ |
|
|
|
// return R.error("该卷已超过有效期"); |
|
|
|
// } |
|
|
|
// } |
|
|
|
// else { |
|
|
|
// // 没有维护过有效期 需要去无物料检测有效期 |
|
|
|
// Part part = partService.getPart(cRollInfo.getPartno()); |
|
|
|
// if ("Y".equals(part.getExpiredatecontrolflag())){ |
|
|
|
// Date expDate = DateUtils.addDateDays(cRollInfo.getRolldate(), part.getToexpiredays().intValue()); |
|
|
|
// if (expDate.compareTo(new Date())<0){ |
|
|
|
// return R.error("该卷已超过有效期"); |
|
|
|
// } |
|
|
|
// } |
|
|
|
// } |
|
|
|
if (rollOutboundControl(cRollInfo)) { |
|
|
|
return R.error("该卷入库时间较新,请先使用较晚的卷"); |
|
|
|
} |
|
|
|
|