From 0a6532305b842185c85afd4e8c670f64700f2a6d Mon Sep 17 00:00:00 2001 From: zjj <3272660260@qq.com> Date: 星期三, 28 八月 2024 17:03:54 +0800 Subject: [PATCH] # --- zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/kernel/AnalyzeService.java | 83 +++++++++++++++++++++++++++-------------- 1 files changed, 54 insertions(+), 29 deletions(-) diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/kernel/AnalyzeService.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/kernel/AnalyzeService.java index edde4cb..bfa0d2c 100644 --- a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/kernel/AnalyzeService.java +++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/kernel/AnalyzeService.java @@ -24,7 +24,9 @@ import org.springframework.stereotype.Service; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; /** * 1.鍏呯數浠诲姟锛�2.搴撲綅绉昏浆锛�3.灏忚溅杩佺Щ锛�4.鎵嬪姩浠诲姟 @@ -57,6 +59,15 @@ private BasConveyorService basConveyorService; @Autowired private TaskCtgService taskCtgService; + + public Integer getStaByLev(Integer lev) { + HashMap<Integer, Integer> map = new HashMap<>(); + map.put(1, 31006); + map.put(2, 31007); + map.put(3, 31008); + + return map.get(lev); + } public List<Motion> generateMotion(Task task) { List<Motion> motionList = new ArrayList<>(); @@ -103,6 +114,11 @@ LiftProtocol liftProtocol = liftThread.getStatus(); if (liftProtocol == null || liftProtocol.getLiftNo() == null) { + return motionList; + } + + BasConveyorSta basConveyorStaDest = basConveyorStaService.selectBySiteNo(task.getDestSite()); + if (basConveyorStaDest == null) { return motionList; } @@ -153,8 +169,9 @@ , MotionDto.build((dto -> { dto.setLiftNo(transferLiftDevice.getId().intValue()); dto.setLev(Utils.getLev(task.getDestLoc())); - dto.setStaNo(Integer.parseInt(task.getDestSite())); - dto.setSync(0);//寮傛鎵ц + dto.setStaNo(getStaByLev(Utils.getLev(task.getDestLoc()))); + dto.setDevpNo(basConveyorStaDest.getConveyorDeviceId().intValue()); +// dto.setSync();//寮傛鎵ц })) )); @@ -218,7 +235,8 @@ , MotionDto.build((dto -> { dto.setLiftNo(transferLiftDevice.getId().intValue()); dto.setLev(Utils.getLev(task.getDestLoc())); - dto.setStaNo(Integer.parseInt(task.getDestSite())); + dto.setStaNo(getStaByLev(Utils.getLev(task.getDestLoc()))); + dto.setDevpNo(basConveyorStaDest.getConveyorDeviceId().intValue()); })) )); @@ -402,6 +420,11 @@ return motionList; } + BasConveyorSta basConveyorStaOrigin = basConveyorStaService.selectBySiteNo(task.getOriginSite()); + if (basConveyorStaOrigin == null) { + return motionList; + } + //妫�娴嬬┛姊溅鏄惁鏈変换鍔$粦瀹� boolean shuttleResult = Utils.checkShuttleHasBinding(shuttleDevice, task.getTaskNo()); if (shuttleResult) { @@ -513,12 +536,13 @@ MotionDto.build((dto -> { dto.setLiftNo(transferLiftDevice.getId().intValue()); dto.setLev(Utils.getLev(task.getOriginLoc())); - dto.setStaNo(Integer.parseInt(task.getOriginSite()));//璧峰绔欑偣 + dto.setStaNo(getStaByLev(Utils.getLev(task.getOriginLoc())));//璧峰绔欑偣 })) , MotionDto.build((dto -> { dto.setLiftNo(transferLiftDevice.getId().intValue()); dto.setLev(1);//鍏夋嘲1灞傛槸杈撻�佺嚎灞� - dto.setStaNo(31004);//鍑哄簱绔欑偣 + dto.setStaNo(31001);//鍑哄簱绔欑偣 + dto.setDevpNo(basConveyorStaOrigin.getConveyorDeviceId().intValue()); dto.setSync(0);//寮傛鎵ц dto.setReleaseLift(1);//鎵ц瀹屾垚鍚庨噴鏀炬彁鍗囨満 })) @@ -538,17 +562,17 @@ )); // 杈撻�佺嚎杩愯緭鑷冲嚭搴撳彛 - motionList.addAll(kernelService.conveyorOutbound( - MotionDto.build((dto -> { - dto.setDevpNo(basConveyorPath.getDeviceId().intValue()); - dto.setStaNo(basConveyorPath.getDeviceStn()); - })), - MotionDto.build((dto -> { - dto.setDevpNo(basConveyorPath.getDeviceId().intValue()); - dto.setStaNo(basConveyorPath.getStnNo()); - })), - MotionCtgType.CONVEYOR_OUTBOUND - )); +// motionList.addAll(kernelService.conveyorOutbound( +// MotionDto.build((dto -> { +// dto.setDevpNo(basConveyorPath.getDeviceId().intValue()); +// dto.setStaNo(basConveyorPath.getDeviceStn()); +// })), +// MotionDto.build((dto -> { +// dto.setDevpNo(basConveyorPath.getDeviceId().intValue()); +// dto.setStaNo(basConveyorPath.getStnNo()); +// })), +// MotionCtgType.CONVEYOR_OUTBOUND +// )); /** * 浜屻�佸嚭搴撹捣濮嬪眰娌℃湁绌挎杞� @@ -711,13 +735,14 @@ MotionDto.build((dto -> { dto.setLiftNo(transferLiftDevice.getId().intValue()); dto.setLev(Utils.getLev(task.getOriginLoc())); - dto.setStaNo(Integer.parseInt(task.getOriginSite()));//璧峰绔欑偣 + dto.setStaNo(getStaByLev(Utils.getLev(task.getOriginLoc())));//璧峰绔欑偣 })) , MotionDto.build((dto -> { dto.setLiftNo(transferLiftDevice.getId().intValue()); dto.setLev(1);//鍏夋嘲1灞傛槸杈撻�佺嚎灞� - dto.setStaNo(31004);//鍑哄簱绔欑偣 + dto.setStaNo(31001);//鍑哄簱绔欑偣 dto.setSync(0);//寮傛鎵ц + dto.setDevpNo(basConveyorStaOrigin.getConveyorDeviceId().intValue()); dto.setReleaseLift(1);//鎵ц瀹屾垚鍚庨噴鏀炬彁鍗囨満 })) )); @@ -736,17 +761,17 @@ )); // 杈撻�佺嚎杩愯緭鑷冲嚭搴撳彛 - motionList.addAll(kernelService.conveyorOutbound( - MotionDto.build((dto -> { - dto.setDevpNo(basConveyorPath.getDeviceId().intValue()); - dto.setStaNo(basConveyorPath.getDeviceStn()); - })), - MotionDto.build((dto -> { - dto.setDevpNo(basConveyorPath.getDeviceId().intValue()); - dto.setStaNo(basConveyorPath.getStnNo()); - })), - MotionCtgType.CONVEYOR_OUTBOUND - )); +// motionList.addAll(kernelService.conveyorOutbound( +// MotionDto.build((dto -> { +// dto.setDevpNo(basConveyorPath.getDeviceId().intValue()); +// dto.setStaNo(basConveyorPath.getDeviceStn()); +// })), +// MotionDto.build((dto -> { +// dto.setDevpNo(basConveyorPath.getDeviceId().intValue()); +// dto.setStaNo(basConveyorPath.getStnNo()); +// })), +// MotionCtgType.CONVEYOR_OUTBOUND +// )); } -- Gitblit v1.9.1