From 541cf632855fb991e400df21a64522d56d9f477d Mon Sep 17 00:00:00 2001
From: yxFwq <1>
Date: 星期三, 30 十月 2024 09:36:27 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java | 160 ++++++++++++++++++++++++++++-------------------------
1 files changed, 85 insertions(+), 75 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 e3743a4..b56a323 100644
--- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -3112,7 +3112,11 @@
continue;
}
- if (wrkMast.getStaNo()>300){
+ if (wrkMast.getStaNo()>309){
+ int wrkCount = wrkMastMapper.selectCount(new EntityWrapper<WrkMast>().eq("io_type", 110).gt("sta_no", 309).lt("sta_no", 314).gt("wrk_sts",11L));
+ if (wrkCount>=12){
+ continue;
+ }
DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, 1);
StaProtocol staProtocolEnt = devpThread.getStation().get(212);
if (staProtocolEnt.isLoading() || staProtocolEnt.getWorkNo()!=0){
@@ -5116,8 +5120,9 @@
break;
}
BasJar basJar = basJarMapper.selectById(jarSlave.getId());
+ BasJar basJarOther = basJarMapper.selectById(jarSlave.getJarOtherId());
jarMaxLoc = basJar.getJarCount();
- if (jarMaxLoc == 0) {
+ if (jarMaxLoc == 0 || basJarOther.getJarCount() != 0) {
break;
}
int count = basJarMastService.selectCount(new EntityWrapper<BasJarMast>().eq("jar_regin", basJar.getRegion()).lt("status", 17).gt("status", 11));
@@ -5125,7 +5130,7 @@
break;
}
if (basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(),3)!=0){
- if (basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(), 3).equals(jarMaxLoc)){
+ if (basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(), 3).equals(basJarOther.getJarCount())){
JarThread jarOtherThread = (JarThread) SlaveConnection.get(SlaveType.Jar, jarSlave.getJarOtherId());
JarProtocol jarOtherProtocol = jarOtherThread.getJarProtocol();
if (jarOtherProtocol == null) {
@@ -5329,11 +5334,11 @@
case 3:
case 4:
signExecute = jarWrkMastExecuteGenerateJar(signExecute,sign);//纭寲缃愪换鍔�
-// case 5:
-// signExecute = jarWrkMastExecuteGenerateBurial(signExecute, sign);//鍐峰嵈妲藉彇杈撻�佺嚎
- default:
-// jarWrkMastExecuteGenerateSte(signExecute,sign);//灏忚溅绉诲姩
+ case 5:
signExecute = jarWrkMastExecuteGenerateBurial(signExecute, sign);//鍐峰嵈妲藉彇杈撻�佺嚎
+ default:
+ jarWrkMastExecuteGenerateSte(signExecute,sign);//灏忚溅绉诲姩
+// signExecute = jarWrkMastExecuteGenerateBurial(signExecute, sign);//鍐峰嵈妲藉彇杈撻�佺嚎
}
if (!signExecute[0] && !signExecute[1]){
@@ -5458,13 +5463,13 @@
}
//闂ㄤ綔涓� 鏃�
//鑷姩銆佺┖闂层�佸彸闂ㄥ叧闂�� Other宸﹂棬鍏抽棴
- if (jarProtocol.isAutoing() && jarProtocol.jarErr==0
- && jarProtocol.leftDoorOpen==0 && jarProtocol.leftDoorClose==0 && jarProtocol.rightDoorOpen==0 && jarProtocol.rightDoorClose==0){
+ if (jarProtocol.isAutoing() && jarProtocol.jarErr==0){
if (jarWrkMastExecuteGenerate5(jarSlave,sign)){
signExecute[jarSlave.getId()-5] = true;
return signExecute;
//鍐峰嵈瀹屾垚涓婅緭閫佺嚎
}
+ continue;
}
} catch (Exception e){
log.error("{}鍙风~鍖栫綈JarWrkMastExecute浠诲姟鍒涘缓寮傚父,寮傚父鍘熷洜={}",jarSlave.getId(),e.getMessage());
@@ -5473,65 +5478,65 @@
return signExecute;
}
-// public synchronized boolean[] jarWrkMastExecuteGenerateSte(boolean[] signExecute,Integer sign) {
-// for (JarSlave jarSlave : slaveProperties.getJar()) {
-// if (jarSlave.getId()<5){
-// continue;
-// }
-// try{
-// if (signExecute[jarSlave.getId()-5]){
-// continue;
-// }
-// if (wrkMastExecuteService.getWrkMastExecuteByJarIdCount(jarSlave.getId())!=0){
-// continue;
-// }
-//
-// // 鑾峰彇纭寲缃愪俊鎭�
-// JarThread jarThread = (JarThread) SlaveConnection.get(SlaveType.Jar, jarSlave.getId());
-// JarProtocol jarProtocol = jarThread.getJarProtocol();
-// if (jarProtocol == null) {
-// continue;
-// }
-// if (jarProtocol.modeType != JarModeType.AUTO){
-// continue;
-// }
-// if (jarProtocol.getJarTemperature()>jarTemperature){
-// log.error("{}鍙风~鍖栫綈鏌ヨ璁惧娓╁害杩囬珮锛岀瓑寰呴檷娓�....锛侊紒锛�",jarProtocol.getJarNo());
-// continue;
-// }
-//
-// JarThread jarOtherThread = (JarThread) SlaveConnection.get(SlaveType.Jar, jarSlave.getJarOtherId());
-// JarProtocol jarOtherProtocol = jarOtherThread.getJarProtocol();
-// if (jarOtherProtocol == null) {
-// continue;
-// }
-//// if (jarOtherProtocol.modeType != JarModeType.AUTO){
-//// continue;
-//// }
-//
-// BasJar basJar = basJarMapper.selectById(jarProtocol.getJarNo());
-// if (Cools.isEmpty(basJar)){
-// log.error("{}鍙风~鍖栫綈鏌ヨ璁惧妗f鏃犱俊鎭紒锛侊紒",jarProtocol.getJarNo());
-// continue;
-// }
-// //闂ㄤ綔涓� 鏃�
-// //鑷姩銆佺┖闂层�佸彸闂ㄥ叧闂�� Other宸﹂棬鍏抽棴
-// if (jarProtocol.isAutoing() && jarProtocol.jarErr==0
-// && jarProtocol.leftDoorOpen==0 && jarProtocol.leftDoorClose==0 && jarProtocol.rightDoorOpen==0 && jarProtocol.rightDoorClose==0){
-// switch (sign){
-// case 5:
-// if (jarWrkMastExecuteGenerate5(jarSlave,sign)){
-// signExecute[jarSlave.getId()-5] = true;
-// break;
-// }
+ public synchronized boolean[] jarWrkMastExecuteGenerateSte(boolean[] signExecute,Integer sign) {
+ for (JarSlave jarSlave : slaveProperties.getJar()) {
+ if (jarSlave.getId()<5){
+ continue;
+ }
+ try{
+ if (signExecute[jarSlave.getId()-5]){
+ continue;
+ }
+ if (wrkMastExecuteService.getWrkMastExecuteByJarIdCount(jarSlave.getId())!=0){
+ continue;
+ }
+
+ // 鑾峰彇纭寲缃愪俊鎭�
+ JarThread jarThread = (JarThread) SlaveConnection.get(SlaveType.Jar, jarSlave.getId());
+ JarProtocol jarProtocol = jarThread.getJarProtocol();
+ if (jarProtocol == null) {
+ continue;
+ }
+ if (jarProtocol.modeType != JarModeType.AUTO){
+ continue;
+ }
+ if (jarProtocol.getJarTemperature()>jarTemperature){
+ log.error("{}鍙风~鍖栫綈鏌ヨ璁惧娓╁害杩囬珮锛岀瓑寰呴檷娓�....锛侊紒锛�",jarProtocol.getJarNo());
+ continue;
+ }
+
+ JarThread jarOtherThread = (JarThread) SlaveConnection.get(SlaveType.Jar, jarSlave.getJarOtherId());
+ JarProtocol jarOtherProtocol = jarOtherThread.getJarProtocol();
+ if (jarOtherProtocol == null) {
+ continue;
+ }
+// if (jarOtherProtocol.modeType != JarModeType.AUTO){
+// continue;
// }
-// }
-// } catch (Exception e){
-// log.error("{}鍙风~鍖栫綈JarWrkMastExecute浠诲姟鍒涘缓寮傚父,寮傚父鍘熷洜={}",jarSlave.getId(),e.getMessage());
-// }
-// }
-// return signExecute;
-// }
+
+ BasJar basJar = basJarMapper.selectById(jarProtocol.getJarNo());
+ if (Cools.isEmpty(basJar)){
+ log.error("{}鍙风~鍖栫綈鏌ヨ璁惧妗f鏃犱俊鎭紒锛侊紒",jarProtocol.getJarNo());
+ continue;
+ }
+ //闂ㄤ綔涓� 鏃�
+ //鑷姩銆佺┖闂层�佸彸闂ㄥ叧闂�� Other宸﹂棬鍏抽棴
+ if (jarProtocol.isAutoing() && jarProtocol.jarErr==0
+ && jarProtocol.leftDoorOpen==0 && jarProtocol.leftDoorClose==0 && jarProtocol.rightDoorOpen==0 && jarProtocol.rightDoorClose==0){
+ switch (sign){
+ case 5:
+ if (jarWrkMastExecuteGenerate5(jarSlave,sign)){
+ signExecute[jarSlave.getId()-5] = true;
+ break;//鍑虹~鍖栫綈 ===銆� 鍏ュ喎鍗存Ы
+ }
+ }
+ }
+ } catch (Exception e){
+ log.error("{}鍙风~鍖栫綈JarWrkMastExecute浠诲姟鍒涘缓寮傚父,寮傚父鍘熷洜={}",jarSlave.getId(),e.getMessage());
+ }
+ }
+ return signExecute;
+ }
/**
* JarWrkMastExecute浠诲姟鍒涘缓 //瀹屾垚
@@ -5756,11 +5761,6 @@
List<BasJarMast> basJarMastList = basJarMastService.getJarMastByJarIdAndStatusList(jarSlave.getId(), new ArrayList<Integer>() {{
add(6);
}});
-// if (basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(),5)!=0
-// && basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(),5)!=jarMaxLoc
-// && basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(),5)!=jarMaxLoc*2){
-// return false;
-// }
if (basJarMastList.isEmpty()){
return false;
}
@@ -5908,7 +5908,17 @@
if (basJarMastList10.size()==jarMaxLoc){
return false;
}
- if (basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(),4)!=0 && !basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(), 4).equals(jarMaxLoc)){
+
+ BasJar basJarOther = basJarMapper.selectById(jarSlave.getJarOtherId());
+ if (Cools.isEmpty(basJarOther)){
+ log.error("{}鍙风~鍖栫綈鏌ヨ璁惧妗f鏃犱俊鎭紒锛侊紒",jarSlave.getJarOtherId());
+ return false;
+ }
+
+ if (basJarOther.getJarCount() == 0) {
+ return false;
+ }
+ if (basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(),4)!=0 && !basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(), 4).equals(basJarOther.getJarCount() )){
return false;
}
@@ -8676,7 +8686,7 @@
try {
int[] jarNos=new int[]{3,1,4,2};//(607鍒嗛厤纭寲缃�)
ArrayList<Integer> staNos = new ArrayList<Integer>() {{
- add(607);add(608);add(609);add(610);add(611);add(612);
+ add(608);add(609);add(610);add(611);add(612);
add(613);add(614);add(615);add(616);add(617);add(618);
add(619);add(620);add(621);add(622);
}};
@@ -8784,7 +8794,7 @@
DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, 2);
StaProtocol staProtocolEnt = devpThread.getStation().get(staNoEnt);
if (staProtocolEnt == null || (staProtocolEnt.isLoading() && staProtocolEnt.getWorkNo()==0)){
- log.error("绔欑偣寮傚父,璁℃暟鍔犱竴锛岀珯鐐瑰彿锛�"+staNoEnt);
+// log.error("绔欑偣寮傚父,璁℃暟鍔犱竴锛岀珯鐐瑰彿锛�"+staNoEnt);
count++;
} else if (staProtocolEnt != null && staProtocolEnt.getWorkNo()!=0 && !wrkNoList.contains(staProtocolEnt.getWorkNo())){
if (staProtocolEnt.getStaNo().equals(basJar.getEntStaNo$())){
--
Gitblit v1.9.1