From 836cf73ab90eef11e920a634d4888598de79a248 Mon Sep 17 00:00:00 2001
From: tqs <56479841@qq.com>
Date: 星期一, 04 九月 2023 18:06:12 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java | 79 +++++++++++++++++++++------------------
1 files changed, 43 insertions(+), 36 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 53fae38..6c310b8 100644
--- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -45,10 +45,7 @@
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Set;
+import java.util.*;
import java.util.stream.Collectors;
/**
@@ -151,6 +148,12 @@
// 鍒ゆ柇閲嶅宸ヤ綔妗�
WrkMast wrkMast = wrkMastMapper.selectPakInStep1(inSta.getStaNo(), barcode);
+ WrkMast wrkMast1 = wrkMastMapper.selectPakInStepBarcode(barcode);
+ if (wrkMast1 !=null){
+ if (wrkMast1.getIoType()==103 || wrkMast1.getIoType()==107 || wrkMast1.getIoType()==104){
+ continue;
+ }
+ }
if (wrkMast != null) {
log.error("宸ヤ綔妗d腑宸插瓨鍦ㄨ绔欑姸鎬佷负锛� 2.璁惧涓婅蛋 锛夌殑鏁版嵁,宸ヤ綔鍙�={}", wrkMast.getWrkNo());
continue;
@@ -199,11 +202,7 @@
if(!Cools.isEmpty(ledThread)){
String errorMsg = jsonObject.getString("msg");
- if(!Cools.isEmpty(errorMsg)){
- LedCommand ledCommand = new LedCommand();
- ledCommand.setTitle(errorMsg);
- MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(9, ledCommand));
- }
+ MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errorMsg));
}
log.error("璇锋眰鎺ュ彛澶辫触锛侊紒锛乽rl锛歿}锛況equest锛歿}锛況esponse锛歿}", wmsUrl+"/rpc/pakin/loc/v1", JSON.toJSONString(param), response);
}
@@ -298,8 +297,12 @@
}
// // 鍏ュ嚭搴撴ā寮忓垽鏂�
- if ( inSta.getStaNo()==203 && devpThread.ioModeOf2F != IoModeType.PAKIN_MODE) { continue; }
-
+ // if ( inSta.getStaNo()==203 && devpThread.ioModeOf2F != IoModeType.PAKIN_MODE) { continue; }
+ if ( inSta.getStaNo()==101 && devpThread.ioModeOf1F == IoModeType.PAKOUT_MODE) { continue; }
+ if ( inSta.getStaNo()==103 && devpThread.ioModeOf2F == IoModeType.PAKOUT_MODE) { continue; }
+ if ( inSta.getStaNo()==105 && devpThread.ioModeOf3F == IoModeType.PAKOUT_MODE) { continue; }
+ if ( inSta.getStaNo()==107 && devpThread.ioModeOf4F == IoModeType.PAKOUT_MODE) { continue; }
+// staProtocol.setPakMk(true);
// 鍒ゆ柇鏄惁婊¤冻鍏ュ簱鏉′欢
if (staProtocol.isAutoing() && staProtocol.isLoading() && staProtocol.isInEnable()
&& !staProtocol.isEmptyMk() && (staProtocol.getWorkNo() == 0 || staProtocol.getWorkNo() > 9990)
@@ -365,6 +368,8 @@
staProtocol = staProtocol.clone();
}
+
+// staProtocol.setPakMk(true);
// // 鍏ュ嚭搴撴ā寮忓垽鏂�
// if (devpThread.ioMode != IoModeType.PAKIN_MODE) { continue; }
if (staProtocol.isAutoing() && staProtocol.isLoading() && staProtocol.isInEnable() && staProtocol.isPakMk()){
@@ -632,6 +637,7 @@
* 鍏ュ簱 ===>> 鍫嗗灈鏈虹珯鍒板簱浣�
*/
public synchronized void crnStnToLoc(CrnSlave slave, CrnProtocol crnProtocol){
+ Collections.shuffle(slave.getCrnInStn());
for (CrnSlave.CrnStn crnStn : slave.getCrnInStn()) {
boolean flag = false;
// 鑾峰彇鍫嗗灈鏈哄叆搴撶珯淇℃伅
@@ -769,6 +775,11 @@
// 鑾峰彇宸ヤ綔鐘舵�佷负11锛堢敓鎴愬嚭搴揑D锛夌殑鍑哄簱宸ヤ綔妗�
// WrkMast wrkMast = wrkMastMapper.selectPakOutStep1(slave.getId(), crnStn.getStaNo());
List<WrkMast> wrkMasts = wrkMastMapper.selectPakOutStep11(slave.getId(), crnStn.getStaNo());
+ // 鑾峰彇宸ヤ綔鐘舵�佷负14鐨勫伐浣滄。 涓� 鍑哄簱浠诲姟涓虹洏鐐�/鎷f枡鍑哄簱鐨勪换鍔�
+ WrkMast wrkMast1 = wrkMastMapper.selectPakOutStep14(slave.getId(), crnStn.getStaNo());
+ if ( wrkMast1 !=null) {
+ continue;
+ }
for (WrkMast wrkMast : wrkMasts){
if (wrkMast == null) {
continue;
@@ -1264,9 +1275,12 @@
// // 鍏ュ嚭搴撴ā寮忓垽鏂�
// if ( emptyInSta.getStaNo()==203 && devpThread.ioModeOf2F != IoModeType.PAKIN_MODE) { continue; }
- if ( emptyInSta.getStaNo()==203 && devpThread.ioModeOf2F == IoModeType.PAKOUT_MODE) { continue; }
- if ( emptyInSta.getStaNo()==402 && devpThread.ioModeOf4F == IoModeType.PAKOUT_MODE) { continue; }
-
+// if ( emptyInSta.getStaNo()==203 && devpThread.ioModeOf2F == IoModeType.PAKOUT_MODE) { continue; }
+// if ( emptyInSta.getStaNo()==402 && devpThread.ioModeOf4F == IoModeType.PAKOUT_MODE) { continue; }
+ if ( emptyInSta.getStaNo()==101 && devpThread.ioModeOf1F == IoModeType.PAKOUT_MODE) { continue; }
+ if ( emptyInSta.getStaNo()==103 && devpThread.ioModeOf2F == IoModeType.PAKOUT_MODE) { continue; }
+ if ( emptyInSta.getStaNo()==105 && devpThread.ioModeOf3F == IoModeType.PAKOUT_MODE) { continue; }
+ if ( emptyInSta.getStaNo()==107 && devpThread.ioModeOf4F == IoModeType.PAKOUT_MODE) { continue; }
// 绔欑偣鏉′欢鍒ゆ柇
if (staProtocol.isAutoing() && staProtocol.isLoading() && staProtocol.isInEnable()
&& staProtocol.isEmptyMk() && (staProtocol.getWorkNo() > 9990 && staProtocol.getWorkNo() <= 9999) && staProtocol.isPakMk()) {
@@ -1429,7 +1443,7 @@
// ledCommand.setSourceStaNo(wrkMast.getSourceStaNo());
if (wrkMast.getIoType() != 110 && wrkMast.getIoType() != 10 ) {
List<WrkDetl> wrkDetls = wrkDetlService.findByWorkNo(wrkMast.getWrkNo());
- wrkDetls.forEach(wrkDetl -> ledCommand.getMatDtos().add(new MatDto(wrkDetl.getMatnr(), wrkDetl.getMaktx(), wrkDetl.getAnfme())));
+ wrkDetls.forEach(wrkDetl -> ledCommand.getMatDtos().add(new MatDto(wrkDetl.getMatnr(), wrkDetl.getMaktx(), wrkDetl.getAnfme(),wrkDetl.getSpecs())));
}
commands.add(ledCommand);
}
@@ -1442,15 +1456,15 @@
}
// 鍛戒护涓嬪彂 -------------------------------------------------------------------------------
if (!commands.isEmpty()) {
- if (led.getId() == 7) {
- if (!MessageQueue.offer(SlaveType.Led, led.getId(), new Task(3, commands))) {
+ if (led.getId()>4){
+ if (!MessageQueue.offer(SlaveType.Led, led.getId()-4, new Task(3, commands))) {
log.error("{}鍙稬ED鍛戒护涓嬪彂澶辫触锛侊紒锛乕ip锛歿}] [port锛歿}]", led.getId(), led.getIp(), led.getPort());
continue;
} else {
ledThread.setLedMk(false);
}
- } else {
- if (!MessageQueue.offer(SlaveType.Led, led.getId(), new Task(1, commands))) {
+ }else {
+ if (!MessageQueue.offer(SlaveType.Led, led.getId(), new Task(3, commands))) {
log.error("{}鍙稬ED鍛戒护涓嬪彂澶辫触锛侊紒锛乕ip锛歿}] [port锛歿}]", led.getId(), led.getIp(), led.getPort());
continue;
} else {
@@ -1532,20 +1546,10 @@
LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, led.getId());
// led鏄剧ず榛樿鍐呭
if (reset && !ledThread.isLedMk()) {
- if (led.getId() == 7) {
- ledThread.setLedMk(true);
- if (!MessageQueue.offer(SlaveType.Led, led.getId(), new Task(4, new ArrayList<>()))) {
- log.error("{}鍙稬ED鍛戒护涓嬪彂澶辫触锛侊紒锛乕ip锛歿}] [port锛歿}]", led.getId(), led.getIp(), led.getPort());
- } else {
-
- }
+ ledThread.setLedMk(true);
+ if (!MessageQueue.offer(SlaveType.Led, led.getId(), new Task(2, new ArrayList<>()))) {
+ log.error("{}鍙稬ED鍛戒护涓嬪彂澶辫触锛侊紒锛乕ip锛歿}] [port锛歿}]", led.getId(), led.getIp(), led.getPort());
} else {
- ledThread.setLedMk(true);
- if (!MessageQueue.offer(SlaveType.Led, led.getId(), new Task(2, new ArrayList<>()))) {
- log.error("{}鍙稬ED鍛戒护涓嬪彂澶辫触锛侊紒锛乕ip锛歿}] [port锛歿}]", led.getId(), led.getIp(), led.getPort());
- } else {
-
- }
}
}
}
@@ -1769,7 +1773,10 @@
continue;
}
- LocMast sourceLoc = locMastService.queryDemoSourceLoc(crn.getId());
+ LocMast sourceLoc = locMastService.queryDemoSourceLoc0(crn.getId());
+ if(sourceLoc == null){
+ locMastService.queryDemoSourceLoc(crn.getId());
+ }
LocMast loc = locMastService.queryDemoLoc(crn.getId());
if (null == sourceLoc || null == loc) {
continue;
@@ -1927,7 +1934,7 @@
devpThread.ioModeOf1F = IoModeType.PAKIN_MODE;
}
break;
- case 103://1F
+ case 103://2F
if (pakout != null) {
if (devpThread.ioModeOf2F != IoModeType.PAKOUT_MODE) {
// 鍑哄簱鍒囨崲涓�
@@ -1945,7 +1952,7 @@
devpThread.ioModeOf2F = IoModeType.PAKIN_MODE;
}
break;
- case 105://1F
+ case 105://3F
if (pakout != null) {
if (devpThread.ioModeOf3F != IoModeType.PAKOUT_MODE) {
// 鍑哄簱鍒囨崲涓�
@@ -1963,7 +1970,7 @@
devpThread.ioModeOf3F = IoModeType.PAKIN_MODE;
}
break;
- case 107://1F
+ case 107://4F
if (pakout != null) {
if (devpThread.ioModeOf4F != IoModeType.PAKOUT_MODE) {
// 鍑哄簱鍒囨崲涓�
--
Gitblit v1.9.1