From ea9b2ddb6c523088b4800337478ffa0bac880766 Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期四, 26 十月 2023 15:50:03 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java | 74 +++++++++++++++++++++++++++++++++++--
1 files changed, 70 insertions(+), 4 deletions(-)
diff --git a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
index c54ab87..e6dcfca 100644
--- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -108,6 +108,8 @@
private BasLiftOptService basLiftOptService;
@Autowired
private ConfigService configService;
+ @Autowired
+ private NavigateMapUtils navigateMapUtils;
/**
@@ -861,6 +863,12 @@
return false;//鍑哄簱绔欑偣涓嶅彲鍑�
}
+ Integer liftNo = basDevp.getLiftNo();//鎼滅储鍑哄簱鎻愬崌鏈烘槸鍚﹀瓨鍦ㄥ叆搴撲换鍔★紝濡傚瓨鍦ㄧ姝㈠嚭搴�
+ List<WrkMast> liftWrkMasts = wrkMastMapper.selectInWrkMastByLiftNo(liftNo);
+ if (!liftWrkMasts.isEmpty()) {
+ return false;//瀛樺湪鍏ュ簱浠诲姟锛岀姝㈠嚭搴�
+ }
+
//鑾峰彇婧愮珯
LiftStaProtocol liftStaProtocol = NyLiftUtils.getLiftStaByLev(basDevp.getLiftNo(), Utils.getLev(wrkMast.getSourceLocNo()));
if (liftStaProtocol == null) {
@@ -1107,6 +1115,18 @@
return false;//绔欑偣涓嶅彲鍏�
}
+ //鍒ゆ柇鎻愬崌鏈烘暣涓笁妤兼槸鍚﹂兘澶勪簬鍏ュ簱妯″紡
+ Integer outInModel1 = Utils.getOutInModelByLift(sourceBasDevp.getLiftNo(), 1);
+ Integer outInModel2 = Utils.getOutInModelByLift(sourceBasDevp.getLiftNo(), 5);
+ Integer outInModel3 = Utils.getOutInModelByLift(sourceBasDevp.getLiftNo(), 8);
+ if (outInModel1 == null || outInModel2 == null || outInModel3 == null) {
+ return false;//涓嶅瓨鍦ㄥ嚭鍏ュ簱妯″紡
+ }
+
+ if (outInModel1 == 2 || outInModel2 == 2 && outInModel3 == 2) {
+ return false;//鍙鏈変竴涓浜庡嚭搴撴ā寮忥紝绂佹鍏ュ簱
+ }
+
LiftThread liftThread = (LiftThread) SlaveConnection.get(SlaveType.Lift, sourceBasDevp.getLiftNo());
if (liftThread == null) {
return false;
@@ -1328,6 +1348,8 @@
if (wrkMast.getMk() == null || !wrkMast.getMk().equals("Y")) {
//涓嶉渶瑕佺敤鍒版満姊拌噦锛岀洿鎺ヨ浆29.鍑哄簱瀹屾垚
wrkMast.setWrkSts(29L);
+ wrkMast.setShuttleNo(null);//閲婃斁灏忚溅
+ wrkMast.setLiftNo(null);//閲婃斁鎻愬崌鏈�
}
}
@@ -2065,6 +2087,7 @@
//瑕嗙洊宸ヤ綔妗g洰鏍囩珯
wrkMast.setStaNo(targetSta.intValue());
wrkMast.setShuttleNo(null);//閲婃斁灏忚溅
+ wrkMast.setLiftNo(null);//閲婃斁鎻愬崌鏈�
if (wrkMastMapper.updateById(wrkMast) > 0) {
//鍚�300绔欏啓鍏ョ洰鏍囩珯
staProtocol = staProtocol.clone();
@@ -2086,6 +2109,7 @@
// //瑕嗙洊宸ヤ綔妗g洰鏍囩珯
// wrkMast.setStaNo(targetSta.intValue());
// wrkMast.setShuttleNo(null);//閲婃斁灏忚溅
+// wrkMast.setLiftNo(null);//閲婃斁鎻愬崌鏈�
// if (wrkMastMapper.updateById(wrkMast) > 0) {
// //鍚�300绔欏啓鍏ョ洰鏍囩珯
// staProtocol = staProtocol.clone();
@@ -2157,9 +2181,9 @@
continue;
}
- if (staProtocol309.isAutoing() && staProtocol309.isLoading()) {
+ if (staProtocol309.isAutoing() && staProtocol309.isLoading() && staProtocol309.isInEnable()) {
// 鑾峰彇鏉$爜鎵弿浠俊鎭�
- BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, 11);//308绔欐潯鐮佸櫒
+ BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, 9);//308绔欐潯鐮佸櫒
if (barcodeThread == null) {
continue;
}
@@ -2167,10 +2191,13 @@
if(!Cools.isEmpty(barcode)) {
//閫氱煡AGV鍙栬揣
agvRestockCall("CS-301-001-01@3", barcode);
+ log.info("閫氱煡AGV鍙栬揣锛屾潯鐮佸彿锛�" + barcode);
}
- } else if (staProtocol312.isAutoing() && staProtocol312.isLoading()) {
+ }
+
+ if (staProtocol312.isAutoing() && staProtocol312.isLoading() && staProtocol312.isInEnable()) {
// 鑾峰彇鏉$爜鎵弿浠俊鎭�
- BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, 12);//311绔欐潯鐮佸櫒
+ BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, 10);//311绔欐潯鐮佸櫒
if (barcodeThread == null) {
continue;
}
@@ -2178,6 +2205,7 @@
if(!Cools.isEmpty(barcode)) {
//閫氱煡AGV鍙栬揣
agvRestockCall("CS-302-001-01@3", barcode);
+ log.info("閫氱煡AGV鍙栬揣锛屾潯鐮佸彿锛�" + barcode);
}
}
}
@@ -2684,6 +2712,22 @@
return false;
}
+ //*************灏濊瘯閿佸畾鐩爣绔欒矾寰�***************
+ List<NavigateNode> targetNodes = NyLiftUtils.getLiftStaNodes(wrkMast.getStaNo());
+ if (targetNodes == null) {
+ return false;//鏈幏鍙栧埌鑺傜偣
+ }
+ boolean checkPathIsAvailable = NavigateUtils.checkPathIsAvailable(targetNodes, shuttleProtocol.getShuttleNo().intValue(), Utils.getLev(wrkMast.getLocNo()), null);
+ if (!checkPathIsAvailable) {
+ return false;//妫�娴嬬洰鏍囩珯鐐硅矾寰勬槸鍚︽湭琚崰鐢�
+ }
+ //灏濊瘯閿佸畾鐩爣绔欒矾寰�
+ boolean result2 = navigateMapUtils.writeNavigateNodeToRedisMap(Utils.getLev(wrkMast.getLocNo()), targetNodes, true);//鎵�浣跨敤鐨勮矾寰勮繘琛岄攣瀹氱鐢�
+ if (!result2) {
+ return false;//璺緞閿佸畾澶辫触
+ }
+ //*************灏濊瘯閿佸畾鐩爣绔欒矾寰�***************
+
//鑾峰彇婧愯緭閫佺珯
LiftStaProtocol liftSta = NyLiftUtils.getLiftStaByStaNo(wrkMast.getSourceStaNo());
if (liftSta == null) {
@@ -3051,6 +3095,7 @@
if (basLift.getPoint() == null) {
return false;//娌℃湁璁剧疆鎻愬崌鏈虹偣浣嶅潗鏍�
}
+
NavigateNode liftNode = new NavigateNode(basLift.getPoint$().getX(), basLift.getPoint$().getY());
liftNode.setZ(liftSta.getLev());
@@ -3115,6 +3160,27 @@
return false;
}
+ //璺ㄦゼ灞傜Щ鍔ㄤ换鍔�
+ if (Utils.getLev(wrkMast.getSourceLocNo()) != Utils.getLev(wrkMast.getLocNo())) {
+ //鑾峰彇鐩爣绔�
+ LiftStaProtocol liftSta = NyLiftUtils.getLiftStaByStaNo(wrkMast.getStaNo());
+ if (liftSta == null) {
+ return false;//鎵句笉鍒扮珯鐐�
+ }
+
+ //*************灏濊瘯瑙i攣鐩爣绔欒矾寰�***************
+ List<NavigateNode> targetNodes = NyLiftUtils.getLiftStaNodes(liftSta.getStaNo());
+ if (targetNodes == null) {
+ return false;//鏈幏鍙栧埌鑺傜偣
+ }
+ //灏濊瘯瑙i攣鐩爣绔欒矾寰�
+ boolean result = navigateMapUtils.writeNavigateNodeToRedisMap(Utils.getLev(wrkMast.getLocNo()), targetNodes, false);//鎵�浣跨敤鐨勮矾寰勮繘琛岃В閿�
+ if (!result) {
+ return false;//璺緞瑙i攣澶辫触
+ }
+ //*************灏濊瘯瑙i攣鐩爣绔欒矾寰�***************
+ }
+
// //鑾峰彇鐩爣绔欏搴旂殑杈撻�佺珯鐐�
// BasDevp targetBasDevp = basDevpService.selectByLevAndLiftNo(Utils.getLev(wrkMast.getLocNo()), wrkMast.getLiftNo());
// if (targetBasDevp == null) {
--
Gitblit v1.9.1