From 9c4da646aaefcd8476eb7a23a889b6af6cffab4e Mon Sep 17 00:00:00 2001
From: zjj <3272660260@qq.com>
Date: 星期三, 09 十月 2024 10:45:06 +0800
Subject: [PATCH] #
---
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/kernel/AnalyzeService.java | 110 ++++++++++++++++++++++++++++++++++++++++--------------
1 files changed, 81 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..d81b555 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());
}))
));
@@ -234,6 +252,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 +429,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 +545,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 +571,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 +600,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 +753,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 +779,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 +1171,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