From f2fba165f5a8de71729a1ed9546eac971507b257 Mon Sep 17 00:00:00 2001
From: yxFwq <1>
Date: 星期四, 18 七月 2024 09:21:03 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java | 40 ++++++++++++++++++++++++++--------------
1 files changed, 26 insertions(+), 14 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 faa0281..7a99380 100644
--- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -1233,7 +1233,7 @@
} else {
staProtocol = staProtocol.clone();
}
- if (staProtocol.isAutoing() && staProtocol.isLoading() && (staProtocol.getWorkNo() == 0 || staProtocol.getStaNo() == null)) {
+ if (staProtocol.isAutoing() && staProtocol.isLoading() && (staProtocol.getWorkNo() == null || staProtocol.getWorkNo() == 0)) {
// 鍒ゆ柇鍚婅溅鏄惁瀹為檯宸插畬鎴愶紝涓旂數鑴戠姸鎬佸湪move涓紝浠ュ鐢佃剳杩涜鏇存柊宸ヤ綔妗�
CrnThread crnThread = (CrnThread) SlaveConnection.get(SlaveType.Crn,crnNo);
@@ -1959,6 +1959,10 @@
crnCommandParam.setDestinationPosX((short)0); // 鐩爣搴撲綅鎺�
crnCommandParam.setDestinationPosY((short)0); // 鐩爣搴撲綅鍒�
crnCommandParam.setDestinationPosZ((short)0); // 鐩爣搴撲綅灞�
+ if (!MessageQueue.offer(SlaveType.Devp, crnStn.getDevpPlcId(), new Task(99, crnCommandParam.getCrnNo()-2))) {
+ log.error("杈撻�佺嚎閿佸畾鍛戒护涓嬪彂澶辫触锛屽爢鍨涙満鍙�={}锛屼换鍔℃暟鎹�={}", wrkMast.getCrnNo(), crnCommandParam.getCrnNo()-2);
+ continue;
+ }
if (!MessageQueue.offer(SlaveType.Crn, crnCommandParam.getCrnNo(), new Task(9, crnCommandParam))) {
log.error("鍫嗗灈鏈哄懡浠や笅鍙戝け璐ワ紝鍫嗗灈鏈哄彿={}锛屼换鍔℃暟鎹�={}", wrkMast.getCrnNo(), JSON.toJSONString(crnCommandParam));
} else {
@@ -4561,7 +4565,7 @@
sign[0] = 2;
sign[1] = 1;
}
- return false;
+ break;
case 3:
if (crnProtocol.getStatusTypeTwo() == CrnStatusType.IDLE
&& crnProtocol.getTaskNoTwo() == 0
@@ -4579,7 +4583,7 @@
sign[0] = 2;
sign[1] = 2;
}
- return false;
+ break;
default:
}
}
@@ -5299,7 +5303,7 @@
}
//闂ㄤ綔涓� 鏃�
- if (jarProtocol.isAutoing() && jarProtocol.statusType == JarStatusType.WAITING3 && jarProtocol.jarErr==0
+ if (jarProtocol.isAutoing() && jarProtocol.statusType != JarStatusType.SOS && jarProtocol.jarErr==0
&& jarProtocol.isRightDoor() && jarProtocol.isLeftDoor()
&& jarProtocol.leftDoorOpen==0 && jarProtocol.leftDoorClose==0 && jarProtocol.rightDoorOpen==0 && jarProtocol.rightDoorClose==0){
//鍏宠繘鏂欓棬
@@ -7472,7 +7476,7 @@
}
//WAITING2(4, "纭寲瀹屾垚"),
if (jarProtocol.getJarErr()==0 && jarProtocol.getStatusType().equals(JarStatusType.WAITING2)
- && jarProtocol.isRightDoor() && jarProtocol.isLeftDoor()
+ && !jarProtocol.isRightDoor() && !jarProtocol.isLeftDoor()
&& jarProtocol.leftDoorOpen==0 && jarProtocol.leftDoorClose==0 && jarProtocol.rightDoorOpen==0 && jarProtocol.rightDoorClose==0
){
List<BasJarMast> basJarMastList = basJarMastService.getJarMastByJarIdAndStatusList(jarSlave.getId(), new ArrayList<Integer>() {{
@@ -7520,7 +7524,7 @@
}
}
} else if (jarProtocol.getJarErr()==0
- && jarProtocol.isRightDoor() && jarProtocol.isLeftDoor()
+ && !jarProtocol.isRightDoor() && !jarProtocol.isLeftDoor()
&& jarProtocol.leftDoorClose!=1 && jarProtocol.leftDoorClose!=3
&& jarProtocol.rightDoorClose!=1 && jarProtocol.rightDoorClose!=3
&& (jarProtocol.leftDoorClose==2 || jarProtocol.rightDoorClose==2)){
@@ -7685,8 +7689,8 @@
if (jarWrkMastExecuteGenerateSteStatus(steSlave.getId(),1,SteStatusType.IDLE,false)){
List<WrkMastExecute> wrkMastExecutes = wrkMastExecuteService.selectWrkMastExecuteByTypeAndIoTyperAndWrkType(null, 5, null);
if (wrkMastExecutes.isEmpty()){
- List<WrkMastExecute> wrkMastExecutesB = wrkMastExecuteService.selectWrkMastExecuteByTypeAndIoTyperAndWrkType(null, 6, null);
- List<WrkMastExecute> wrkMastExecutesC = wrkMastExecuteService.selectWrkMastExecuteByTypeAndIoTyperAndWrkType(null, 9, null);
+ List<WrkMastExecute> wrkMastExecutesB = wrkMastExecuteService.selectWrkMastExecuteByTypeAndIoTyperAndWrkType(null, 6, null,steProtocol.getSteNo().intValue());
+ List<WrkMastExecute> wrkMastExecutesC = wrkMastExecuteService.selectWrkMastExecuteByTypeAndIoTyperAndWrkType(null, 9, null,steProtocol.getSteNo().intValue());
if (!wrkMastExecutesB.isEmpty() || !wrkMastExecutesC.isEmpty()){
WrkMastExecute wrkMastExecute = !wrkMastExecutesB.isEmpty() ? wrkMastExecutesB.get(0) : wrkMastExecutesC.get(0);
@@ -7706,9 +7710,9 @@
} else if (jarWrkMastExecuteGenerateSteStatus(steSlave.getId(),2,SteStatusType.IDLE,false)){
List<WrkMastExecute> wrkMastExecutes = wrkMastExecuteService.selectWrkMastExecuteByTypeAndIoTyperAndWrkType(null, 6, null);
if (wrkMastExecutes.isEmpty()){
- List<WrkMastExecute> wrkMastExecutesA = wrkMastExecuteService.selectWrkMastExecuteByTypeAndIoTyperAndWrkType(null, 5, null);
- List<WrkMastExecute> wrkMastExecutesC = wrkMastExecuteService.selectWrkMastExecuteByTypeAndIoTyperAndWrkType(null, 9, null);
- List<WrkMastExecute> wrkMastExecutes100 = wrkMastExecuteService.selectWrkMastExecuteByTypeAndIoTyperAndWrkType(null, 100, null);
+ List<WrkMastExecute> wrkMastExecutesA = wrkMastExecuteService.selectWrkMastExecuteByTypeAndIoTyperAndWrkType(null, 5, null,steProtocol.getSteNo().intValue());
+ List<WrkMastExecute> wrkMastExecutesC = wrkMastExecuteService.selectWrkMastExecuteByTypeAndIoTyperAndWrkType(null, 9, null,steProtocol.getSteNo().intValue());
+ List<WrkMastExecute> wrkMastExecutes100 = wrkMastExecuteService.selectWrkMastExecuteByTypeAndIoTyperAndWrkType(null, 100, null,steProtocol.getSteNo().intValue());
if (!wrkMastExecutes100.isEmpty()){
WrkMastExecute wrkMastExecute = wrkMastExecutes100.get(0);
BasJar basJar = basJarMapper.selectById(wrkMastExecute.getJarId());
@@ -7761,9 +7765,9 @@
} else if (jarWrkMastExecuteGenerateSteStatus(steSlave.getId(),3,SteStatusType.IDLE,false)){
List<WrkMastExecute> wrkMastExecutes = wrkMastExecuteService.selectWrkMastExecuteByTypeAndIoTyperAndWrkType(null, 9, null);
if (wrkMastExecutes.isEmpty()){
- List<WrkMastExecute> wrkMastExecutesB = wrkMastExecuteService.selectWrkMastExecuteByTypeAndIoTyperAndWrkType(null, 6, null);
- List<WrkMastExecute> wrkMastExecutesA = wrkMastExecuteService.selectWrkMastExecuteByTypeAndIoTyperAndWrkType(null, 5, null);
- List<WrkMastExecute> wrkMastExecutes100 = wrkMastExecuteService.selectWrkMastExecuteByTypeAndIoTyperAndWrkType(null, 100, null);
+ List<WrkMastExecute> wrkMastExecutesB = wrkMastExecuteService.selectWrkMastExecuteByTypeAndIoTyperAndWrkType(null, 6, null,steProtocol.getSteNo().intValue());
+ List<WrkMastExecute> wrkMastExecutesA = wrkMastExecuteService.selectWrkMastExecuteByTypeAndIoTyperAndWrkType(null, 5, null,steProtocol.getSteNo().intValue());
+ List<WrkMastExecute> wrkMastExecutes100 = wrkMastExecuteService.selectWrkMastExecuteByTypeAndIoTyperAndWrkType(null, 100, null,steProtocol.getSteNo().intValue());
if (!wrkMastExecutes100.isEmpty()){
WrkMastExecute wrkMastExecute = wrkMastExecutes100.get(0);
BasJar basJar = basJarMapper.selectById(wrkMastExecute.getJarId());
@@ -7838,6 +7842,14 @@
continue;
}
} else if (steProtocol.getCharge()<80.0F){
+ List<BasJarMast> basJarMastList = basJarMastService.getJarMastByJarIdAndStatusListCharge(steSlave.getId(), new ArrayList<Integer>() {{
+ add(5);
+ add(11);
+ add(16);
+ }});
+ if(!basJarMastList.isEmpty()){
+ continue;
+ }
if (wrkMastExecuteService.selectNoStart(steSlave.getId())!=0){
continue;
}
--
Gitblit v1.9.1