From eaa2d3e21cc21e2f385e11d2f0ae3413fd1f7e61 Mon Sep 17 00:00:00 2001 From: Junjie <xjj@123> Date: 星期日, 13 十月 2024 09:46:56 +0800 Subject: [PATCH] # --- zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/kernel/AnalyzeService.java | 109 ++++++++++++++++++++++++++++++++++++++++-------------- 1 files changed, 80 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..059562b 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,6 +24,7 @@ import org.springframework.stereotype.Service; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; /** @@ -57,6 +58,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 +113,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 +168,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 +234,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()); })) )); @@ -234,6 +251,15 @@ dto.setLocNo(standbyLocNoTo); })), MotionCtgType.SHUTTLE_MOVE + )); + + // 閿佸畾鐩爣妤煎眰绌挎杞﹀緟鏈轰綅璺緞 + motionList.addAll(kernelService.mapLockPath( + null, + MotionDto.build((dto -> { + dto.setShuttleNo(shuttleDevice.getId().intValue()); + dto.setLocNo(standbyLocNoFrom); + })) )); // 鎻愬崌鏈虹┖杞界Щ鍔ㄥ埌绌挎杞﹀眰 @@ -402,6 +428,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 +544,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 +570,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 +// )); /** * 浜屻�佸嚭搴撹捣濮嬪眰娌℃湁绌挎杞� @@ -567,6 +599,15 @@ dto.setLocNo(standbyLocNoTo); })), MotionCtgType.SHUTTLE_MOVE + )); + + // 閿佸畾鐩爣妤煎眰绌挎杞﹀緟鏈轰綅璺緞 + motionList.addAll(kernelService.mapLockPath( + null, + MotionDto.build((dto -> { + dto.setShuttleNo(shuttleDevice.getId().intValue()); + dto.setLocNo(standbyLocNoFrom); + })) )); // 鎻愬崌鏈虹┖杞界Щ鍔ㄥ埌绌挎杞﹀眰 @@ -711,13 +752,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 +778,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 +// )); } @@ -1128,6 +1170,15 @@ MotionCtgType.SHUTTLE_MOVE )); + // 閿佸畾鐩爣妤煎眰绌挎杞﹀緟鏈轰綅璺緞 + motionList.addAll(kernelService.mapLockPath( + null, + MotionDto.build((dto -> { + dto.setShuttleNo(shuttleDevice.getId().intValue()); + dto.setLocNo(standbyLocNoFrom); + })) + )); + // 鎻愬崌鏈虹┖杞界Щ鍔ㄥ埌绌挎杞﹀眰 motionList.addAll(kernelService.liftMove( null -- Gitblit v1.9.1