diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/job/AutoCreateWaveConfigTask.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/job/AutoCreateWaveConfigTask.java index 12390cb..d19adc6 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/job/AutoCreateWaveConfigTask.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/job/AutoCreateWaveConfigTask.java @@ -58,16 +58,16 @@ public class AutoCreateWaveConfigTask implements Job { shipmentHeaderLambdaQueryWrapper.eq(ShipmentHeader::getWaveConfigId, waveConfig.getId()).orderByDesc(ShipmentHeader::getId); List<ShipmentHeader> shipmentHeaderList = shipmentHeaderService.list(shipmentHeaderLambdaQueryWrapper); if (!shipmentHeaderList.isEmpty()) { - List<ShipmentHeader> uncompleteShipmentHeader = + List<ShipmentHeader> uncompleteShipmentHeaderList = shipmentHeaderList.stream().filter(t -> t.getLastStatus() < QuantityConstant.SHIPMENT_HEADER_COMPLETED).collect(Collectors.toList()); - if (!CollectionUtils.isEmpty(uncompleteShipmentHeader)) { + if (!CollectionUtils.isEmpty(uncompleteShipmentHeaderList)) { log.info("波次ID:{} 波次任务正在进行中,结束波次生成", waveConfig.getId()); continue; } ShipmentHeader lastShipmentHeader = shipmentHeaderList.get(0); - Long betweenSecond = DateUtil.between(lastShipmentHeader.getCreateTime(), new Date(), DateUnit.SECOND); - if (betweenSecond < waveConfig.getWaveCycle()) { - log.info("波次ID:{} 波次周期:{}(秒),当前周期:{}(秒),结束波次生成", waveConfig.getId(), waveConfig.getWaveCycle(), betweenSecond); + Long currentCycle = DateUtil.between(lastShipmentHeader.getCreateTime(), new Date(), DateUnit.SECOND); + if (currentCycle < waveConfig.getWaveCycle()) { + log.info("波次ID:{} 波次周期:{}(秒),当前周期:{}(秒),结束波次生成", waveConfig.getId(), waveConfig.getWaveCycle(), currentCycle); continue; } } @@ -80,7 +80,6 @@ public class AutoCreateWaveConfigTask implements Job { } try { shipmentHeaderService.createShipment(waveConfig, waveConfigDetailList); - } catch (Exception e) { log.error("波次ID:{} 下发任务异常,waveConfig:{}", waveConfig.getId(), JSON.toJSONString(waveConfig), e); }