From 904c3bf52d9861330c0ca47748c8202db6ad7e98 Mon Sep 17 00:00:00 2001
From: yxFwq <1>
Date: 星期日, 21 七月 2024 10:18:20 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java | 116 +++++++++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 107 insertions(+), 9 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 97c0c6d..8a5b9c7 100644
--- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -4958,6 +4958,17 @@
if (basJarMastList.size()!=integer){
log.error("{}鍙风~鍖栫綈纭寲瀹屾垚鍚庡紑闂ㄥ畬鎴愪慨鏀圭~鍖栨。妗堢姸鎬佺粨鏋滄暟閲忎笉涓�鑷达紒锛侊紒鏌ヨ璧勬枡鏁伴噺={}锛屾洿鏂拌繑鍥炴暟閲�={}",jarMastByWrkNo.getJarId(),basJarMastList.size(),integer);
}
+ } else if (wrkMastExecute.getIoType()==2 && jarMastByWrkNo.getStatus()==5){
+ List<BasJarMast> basJarMastList = basJarMastService.getJarMastByJarIdAndStatusList(jarMastByWrkNo.getJarId(), new ArrayList<Integer>() {{
+ add(4);//纭寲瀹屾垚
+ }});
+ if (basJarMastList.isEmpty()){
+ continue;
+ }
+ Integer integer = basJarMastService.updateStatus(jarMastByWrkNo.getJarId(), 4, 5);
+ if (basJarMastList.size()!=integer){
+ log.error("{}鍙风~鍖栫綈纭寲瀹屾垚鍚庡紑闂ㄥ畬鎴愪慨鏀圭~鍖栨。妗堢姸鎬佺粨鏋滄暟閲忎笉涓�鑷达紒锛侊紒鏌ヨ璧勬枡鏁伴噺={}锛屾洿鏂拌繑鍥炴暟閲�={}",jarMastByWrkNo.getJarId(),basJarMastList.size(),integer);
+ }
} else {
if (!basJarMastService.updateById(jarMastByWrkNo)){
log.error("纭寲鍖哄煙鍒嗘浠诲姟瀹屾垚寮傚父,BasJarMast={},寮傚父淇℃伅={}",JSON.toJSONString(jarMastByWrkNo),"鏇存柊basJarMast澶辫触");
@@ -5267,6 +5278,10 @@
return false;
}
+ if (wrkMastExecuteService.getWrkMastExecuteByjarReginCount(basJar.getRegion())!=0){
+ return false;
+ }
+
//闂ㄤ綔涓� 鏃�
//鑷姩銆佺┖闂层�佸彸闂ㄥ叧闂�� Other宸﹂棬鍏抽棴
if (jarProtocol.isAutoing() && jarProtocol.jarErr==0
@@ -5314,12 +5329,16 @@
List<BasJarMast> basJarMastList = basJarMastService.getJarMastByJarIdAndStatusList(jarSlave.getId(), new ArrayList<Integer>() {{
add(4);
}});
- if (basJarMastList.size() != 7){
+ if (basJarMastList.size() != jarMaxLoc){
return false;
}
BasJarMast basJarMastSign = basJarMastList.get(0);
if (Cools.isEmpty(basJarMastSign)){
+ return false;
+ }
+
+ if (wrkMastExecuteService.getWrkMastExecuteByjarReginCount(basJarMastSign.getJarRegin())!=0){
return false;
}
// //鍒ゆ柇灏忚溅鐘舵��
@@ -5353,7 +5372,7 @@
log.error("{}鍙风~鍖栫綈鏌ヨ璁惧妗f鏃犱俊鎭紒锛侊紒",jarProtocol.getJarNo());
return false;
}
- if (basJar.getJarCount()!=7){
+ if (!basJar.getJarCount().equals(jarMaxLoc)){
log.error("{}鍙风~鍖栫綈鏌ヨ璁惧搴撳瓨鏁板紓甯革紒锛侊紒搴撳瓨寰呭叆鏁帮細{}",jarProtocol.getJarNo(),basJar.getJarCount());
return false;
}
@@ -5391,7 +5410,7 @@
List<BasJarMast> basJarMastList = basJarMastService.getJarMastByJarIdAndStatusList(jarSlave.getId(), new ArrayList<Integer>() {{
add(6);
}});
- if (basJarMastList.size() != 7){
+ if (basJarMastList.size() != jarMaxLoc){
return false;
}
if (basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(),5)!=0){
@@ -5400,6 +5419,10 @@
BasJarMast basJarMastSign = basJarMastList.get(0);
if (Cools.isEmpty(basJarMastSign)){
+ return false;
+ }
+
+ if (wrkMastExecuteService.getWrkMastExecuteByjarReginCount(basJarMastSign.getJarRegin())!=0){
return false;
}
// //鍒ゆ柇灏忚溅鐘舵��
@@ -5471,13 +5494,26 @@
if (basJarMastList.isEmpty()){
return false;
}
-
+ List<BasJarMast> basJarMastList10 = basJarMastService.getJarMastByJarIdAndStatusList(jarSlave.getId(), new ArrayList<Integer>() {{
+ add(10);
+ }});
+ if (basJarMastList10.size()==jarMaxLoc){
+ return false;
+ }
if (basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(),4)!=0){
return false;
}
BasJarMast jarMastByJarIdMin = basJarMastService.getJarMastByJarIdMin(jarSlave.getId(),8,8);
if (Cools.isEmpty(jarMastByJarIdMin)){
+ return false;
+ }
+ if (wrkMastExecuteService.getWrkMastExecuteByjarReginCount(jarMastByJarIdMin.getJarRegin())!=0){
+ return false;
+ }
+
+ int count = basJarMastService.selectCount(new EntityWrapper<BasJarMast>().eq("jar_regin", jarMastByJarIdMin.getJarRegin()).lt("status", 17).gt("status", 10));
+ if (count>0){
return false;
}
// //鍒ゆ柇灏忚溅鐘舵��
@@ -5561,6 +5597,10 @@
if (Cools.isEmpty(jarMastByJarIdMin)){
return false;
}
+
+ if (wrkMastExecuteService.getWrkMastExecuteByjarReginCount(jarMastByJarIdMin.getJarRegin())!=0){
+ return false;
+ }
//
// //鍒ゆ柇灏忚溅鐘舵��
// if (!jarWrkMastExecuteGenerateSteStatus(jarSlave.getJarOutSte().get(0).getSteNo(),3,SteStatusType.IDLE)){
@@ -5587,6 +5627,26 @@
BasJar basJar = basJarMapper.selectById(jarProtocol.getJarNo());
if (Cools.isEmpty(basJar)){
log.error("{}鍙风~鍖栫綈鏌ヨ璁惧妗f鏃犱俊鎭紒锛侊紒",jarProtocol.getJarNo());
+ return false;
+ }
+
+ // 鑾峰彇纭寲缃愪俊鎭�
+ JarThread jarThreadOther = (JarThread) SlaveConnection.get(SlaveType.Jar, SteAndJarUtil.getRgvJarNo(jarProtocol.getJarNo()));
+ JarProtocol jarProtocolOther = jarThreadOther.getJarProtocol();
+ if (jarProtocolOther == null) {
+ return false;
+ }
+ if (jarProtocolOther.modeType != JarModeType.AUTO){
+ return false;
+ }
+
+ BasJar basJarOther = basJarMapper.selectById(jarProtocolOther.getJarNo());
+ if (Cools.isEmpty(basJarOther)){
+ log.error("{}鍙风~鍖栫綈鏌ヨ璁惧妗f鏃犱俊鎭紒锛侊紒",jarProtocolOther.getJarNo());
+ return false;
+ }
+
+ if (!jarProtocolOther.isRightDoor()){
return false;
}
@@ -6501,6 +6561,26 @@
return false;
}
+ // 鑾峰彇纭寲缃愪俊鎭�
+ JarThread jarThreadOther = (JarThread) SlaveConnection.get(SlaveType.Jar, SteAndJarUtil.getRgvJarNo(wrkMastExecute.getJarId()));
+ JarProtocol jarProtocolOther = jarThreadOther.getJarProtocol();
+ if (jarProtocolOther == null) {
+ return false;
+ }
+ if (jarProtocolOther.modeType != JarModeType.AUTO){
+ return false;
+ }
+
+ BasJar basJarOther = basJarMapper.selectById(jarProtocolOther.getJarNo());
+ if (Cools.isEmpty(basJarOther)){
+ log.error("{}鍙风~鍖栫綈鏌ヨ璁惧妗f鏃犱俊鎭紒锛侊紒",jarProtocolOther.getJarNo());
+ return false;
+ }
+
+ if (!jarProtocolOther.isRightDoor()){
+ return false;
+ }
+
DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, 2);
StaProtocol staProtocolRGV = devpThread.getStation().get(basJar.getEnterRgvNo());
if (staProtocolRGV == null) {
@@ -6617,6 +6697,22 @@
return false;
}
+ // 鑾峰彇纭寲缃愪俊鎭�
+ JarThread jarThreadOther = (JarThread) SlaveConnection.get(SlaveType.Jar, SteAndJarUtil.getRgvJarNo(wrkMastExecute.getJarId()));
+ JarProtocol jarProtocolOther = jarThreadOther.getJarProtocol();
+ if (jarProtocolOther == null) {
+ return false;
+ }
+ if (jarProtocolOther.modeType != JarModeType.AUTO){
+ return false;
+ }
+
+ BasJar basJarOther = basJarMapper.selectById(jarProtocolOther.getJarNo());
+ if (Cools.isEmpty(basJarOther)){
+ log.error("{}鍙风~鍖栫綈鏌ヨ璁惧妗f鏃犱俊鎭紒锛侊紒",jarProtocolOther.getJarNo());
+ return false;
+ }
+
// //鍒ゆ柇灏忚溅鐘舵��
// if (!jarWrkMastExecuteGenerateSteStatus(basJar.getEnterSteNo(),1)){
// return false;
@@ -6659,7 +6755,7 @@
&& jarProtocol.leftDoorOpen==0 && jarProtocol.leftDoorClose==0 && jarProtocol.rightDoorOpen==0 && jarProtocol.rightDoorClose==0){
log.error("6:鍏ュ喎鍗存Ы Three==>浠诲姟涓嬪彂===>琛�={}",6115);
- if (SteAndJarUtil.steAndJarNowRow(staProtocolRGV.getNowRow() , jarProtocol.getJarNo())){
+ if (SteAndJarUtil.steAndJarNowRow(staProtocolRGV.getNowRow() , jarProtocolOther.getJarNo())){
//鍒ゆ柇灏忚溅鐘舵��
if (!jarWrkMastExecuteGenerateSteStatus(basJar.getEnterSteNo(),2,SteStatusType.WAITING2,false)){
return false;
@@ -6677,7 +6773,7 @@
}
} else {
//璋冭溅 == > endRow
- if (!jarRgvMoveTake(wrkMastExecute,1)){
+ if (!jarRgvMoveTake(wrkMastExecute,SteAndJarUtil.getJarNoEndRow(basJar.getBurial()))){
log.error("骞宠 杞GV鍛戒护涓嬪彂澶辫触锛宺gv鍙�={},浠诲姟鏁版嵁={},纭寲缃愭暟鎹�={},sign={}",
wrkMastExecute.getJarId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(jarProtocol),sign);
}
@@ -7709,6 +7805,8 @@
return true;
}
return true;
+ } else {
+ log.error("{}鍙峰钩琛¤溅褰撳墠鐘舵�佷笉婊¤冻鍏ョ~鍖栫綈鏉′欢锛屽綋鍓嶄换鍔★紝骞宠 杞︿粠鍙栬揣");
}
}
return true;
@@ -8080,7 +8178,7 @@
}
public synchronized Integer jarGetStartStaNo(Integer staNo) {
try {
- int[] jarNos=new int[]{1,2,3,4};//(607鍒嗛厤纭寲缃�)
+ int[] jarNos=new int[]{4,2,3,1};//(607鍒嗛厤纭寲缃�)
ArrayList<Integer> staNos = new ArrayList<Integer>() {{
add(607);add(608);add(609);add(610);add(611);add(612);
add(613);add(614);add(615);add(616);add(617);add(618);
@@ -8099,7 +8197,7 @@
if (basJarMastList.isEmpty()){
continue;
}
- if (basJarMastList.size()>0 && basJarMastList.size()<7){
+ if (basJarMastList.size()>0 && basJarMastList.size()<jarMaxLoc){
jarNoList.add(jarNo);
}
}
@@ -8153,7 +8251,7 @@
}
}
}
- if (count<7){
+ if (count<jarMaxLoc){
return basJar.getEntStaNo$();
}
}
--
Gitblit v1.9.1