From 05645eca6c58b2a9c0bd3d388b6b2349cb0bd346 Mon Sep 17 00:00:00 2001
From: lsh <1>
Date: 星期四, 18 七月 2024 11:01:19 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java | 54 +++++++++++++++++++++++++++++++++++-------------------
1 files changed, 35 insertions(+), 19 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 f27f5b2..477671c 100644
--- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -4903,10 +4903,25 @@
List<WrkMastExecute> wrkMastExecuteList = wrkMastExecuteService.selectWrkMastExecuteByWrk(wrkMastExecuteSou);
for (WrkMastExecute wrkMastExecute : wrkMastExecuteList){
log.error("Jar浠诲姟瀹屾垚===>琛�={}",4564);
- BasJarMast jarMastByWrkNo = basJarMastService.getJarMastByWrkNo(wrkMastExecute.getWrkNo());
- jarMastByWrkNo.setStatus(jarMastByWrkNo.getStatusComplete());
- if (!basJarMastService.updateById(jarMastByWrkNo)){
- log.error("纭寲鍖哄煙鍒嗘浠诲姟瀹屾垚寮傚父,BasJarMast={},寮傚父淇℃伅={}",JSON.toJSONString(jarMastByWrkNo),"鏇存柊basJarMast澶辫触");
+ if (wrkMastExecute.getIoType()<7 || wrkMastExecute.getIoType()==9){
+ BasJarMast jarMastByWrkNo = basJarMastService.getJarMastByWrkNo(wrkMastExecute.getWrkNo());
+ jarMastByWrkNo.setStatus(jarMastByWrkNo.getStatusComplete(wrkMastExecute.getIoType()));
+ if (wrkMastExecute.getIoType()==3 && jarMastByWrkNo.getStatus()==8){
+ List<BasJarMast> basJarMastList = basJarMastService.getJarMastByJarIdAndStatusList(jarMastByWrkNo.getJarId(), new ArrayList<Integer>() {{
+ add(6);//纭寲瀹屾垚
+ }});
+ if (basJarMastList.isEmpty()){
+ continue;
+ }
+ Integer integer = basJarMastService.updateStatus(jarMastByWrkNo.getJarId(), 5, 6);
+ if (basJarMastList.size()!=integer){
+ log.error("{}鍙风~鍖栫綈纭寲瀹屾垚鍚庡紑闂ㄥ畬鎴愪慨鏀圭~鍖栨。妗堢姸鎬佺粨鏋滄暟閲忎笉涓�鑷达紒锛侊紒鏌ヨ璧勬枡鏁伴噺={}锛屾洿鏂拌繑鍥炴暟閲�={}",jarMastByWrkNo.getJarId(),basJarMastList.size(),integer);
+ }
+ } else {
+ if (!basJarMastService.updateById(jarMastByWrkNo)){
+ log.error("纭寲鍖哄煙鍒嗘浠诲姟瀹屾垚寮傚父,BasJarMast={},寮傚父淇℃伅={}",JSON.toJSONString(jarMastByWrkNo),"鏇存柊basJarMast澶辫触");
+ }
+ }
}
wrkMastExecute.setWrkSts(wrkMastExecute.getWrkStsComplete());
wrkMastExecute.setWrkType(2);
@@ -5303,7 +5318,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){
//鍏宠繘鏂欓棬
@@ -7476,7 +7491,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>() {{
@@ -7524,7 +7539,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)){
@@ -7687,10 +7702,11 @@
try{
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> wrkMastExecutes = wrkMastExecuteService.selectWrkMastExecuteByTypeAndIoTyperAndWrkType(null, 5, null,steProtocol.getSteNo().intValue());
+ List<WrkMastExecute> wrkMastExecutes100 = wrkMastExecuteService.selectWrkMastExecuteByTypeAndIoTyperAndWrkType(null, 100, null,steProtocol.getSteNo().intValue());
+ if (wrkMastExecutes.isEmpty() && wrkMastExecutes100.isEmpty()){
+ 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);
@@ -7708,11 +7724,11 @@
}
}
} else if (jarWrkMastExecuteGenerateSteStatus(steSlave.getId(),2,SteStatusType.IDLE,false)){
- List<WrkMastExecute> wrkMastExecutes = wrkMastExecuteService.selectWrkMastExecuteByTypeAndIoTyperAndWrkType(null, 6, null);
+ List<WrkMastExecute> wrkMastExecutes = wrkMastExecuteService.selectWrkMastExecuteByTypeAndIoTyperAndWrkType(null, 6, null,steProtocol.getSteNo().intValue());
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());
@@ -7763,11 +7779,11 @@
}
}
} else if (jarWrkMastExecuteGenerateSteStatus(steSlave.getId(),3,SteStatusType.IDLE,false)){
- List<WrkMastExecute> wrkMastExecutes = wrkMastExecuteService.selectWrkMastExecuteByTypeAndIoTyperAndWrkType(null, 9, null);
+ List<WrkMastExecute> wrkMastExecutes = wrkMastExecuteService.selectWrkMastExecuteByTypeAndIoTyperAndWrkType(null, 9, null,steProtocol.getSteNo().intValue());
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());
--
Gitblit v1.9.1