| | |
| | | Date now = new Date(); |
| | | List<InventoryReserve> expiredList = inventoryReserveService.selectList( |
| | | new EntityWrapper<InventoryReserve>() |
| | | .isNotNull("expice_time") |
| | | .lt("expice_time", now)); |
| | | .isNotNull("expire_time") |
| | | .lt("expire_time", now)); |
| | | |
| | | if (expiredList.isEmpty()) { |
| | | return SUCCESS; |
| | |
| | | for (InventoryReserve reserve : expiredList) { |
| | | try { |
| | | // 转移到日志表 |
| | | InventoryReserveLog logRecord = new InventoryReserveLog(); |
| | | logRecord.setMatnr(reserve.getMatnr()); |
| | | logRecord.setMaktx(reserve.getMaktx()); |
| | | logRecord.setOrderNo(reserve.getOrderNo()); |
| | | logRecord.setBatch(reserve.getBatch()); |
| | | logRecord.setQuantity(reserve.getQuantity()); |
| | | logRecord.setExpiceTime(reserve.getExpiceTime()); |
| | | logRecord.setDeptId(reserve.getDeptId()); |
| | | logRecord.setCreateTime(reserve.getCreateTime()); |
| | | logRecord.setCreateBy(reserve.getCreateBy()); |
| | | logRecord.setUpdateTime(new Date()); |
| | | InventoryReserveLog logRecord = getInventoryReserveLog(reserve); |
| | | |
| | | inventoryReserveLogService.insert(logRecord); |
| | | |
| | |
| | | return SUCCESS; |
| | | } |
| | | |
| | | private static InventoryReserveLog getInventoryReserveLog(InventoryReserve reserve) { |
| | | InventoryReserveLog logRecord = new InventoryReserveLog(); |
| | | logRecord.setMatnr(reserve.getMatnr()); |
| | | logRecord.setMaktx(reserve.getMaktx()); |
| | | logRecord.setOrderNo(reserve.getOrderNo()); |
| | | logRecord.setBatch(reserve.getBatch()); |
| | | logRecord.setQuantity(reserve.getQuantity()); |
| | | logRecord.setExpireTime(reserve.getExpireTime()); |
| | | logRecord.setDeptId(reserve.getDeptId()); |
| | | logRecord.setCreateTime(reserve.getCreateTime()); |
| | | logRecord.setCreateBy(reserve.getCreateBy()); |
| | | logRecord.setUpdateTime(new Date()); |
| | | return logRecord; |
| | | } |
| | | |
| | | } |