From e597fc1db67c560adecbd8d1e37d13c8f5a50fe3 Mon Sep 17 00:00:00 2001
From: yxFwq <1>
Date: 星期四, 24 十月 2024 12:48:47 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java | 103 +++++++++++++++++++++++++++++++++++++++++----------
1 files changed, 82 insertions(+), 21 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 2c4ee46..2e74e09 100644
--- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -59,7 +59,8 @@
// private static final int[][] execute = new int[][]{{1,4},{2,4},{3,4},{4,4},{5,6},{6,6},{7,4},{8,4},{9,3},{10,4},{11,4}};
private static final int[][] execute = new int[][]{{1,4},{2,4},{3,4},{4,4},{5,6},{6,6},{7,4},{8,4},{9,3},{10,4},{11,4}};
- private static final Integer jarMaxLoc = 7;
+// private static final Integer jarMaxLoc1 = 7;
+ private static Integer jarMaxLoc = 0;
private static final Float jarTemperature = 50F;
@Autowired
private CommonService commonService;
@@ -5107,12 +5108,16 @@
break;
}
BasJar basJar = basJarMapper.selectById(jarSlave.getId());
+ jarMaxLoc = basJar.getJarCount();
+ if (jarMaxLoc == 0) {
+ break;
+ }
int count = basJarMastService.selectCount(new EntityWrapper<BasJarMast>().eq("jar_regin", basJar.getRegion()).lt("status", 17).gt("status", 11));
if (count>0){
break;
}
if (basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(),3)!=0){
- if (basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(),3)==7){
+ if (basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(), 3).equals(jarMaxLoc)){
JarThread jarOtherThread = (JarThread) SlaveConnection.get(SlaveType.Jar, jarSlave.getJarOtherId());
JarProtocol jarOtherProtocol = jarOtherThread.getJarProtocol();
if (jarOtherProtocol == null) {
@@ -5653,7 +5658,7 @@
List<BasJarMast> basJarMastList = basJarMastService.getJarMastByJarIdAndStatusList(jarSlave.getId(), new ArrayList<Integer>() {{
add(4);
}});
- if (basJarMastList.size() != jarMaxLoc){
+ if (basJarMastList.isEmpty()){
return false;
}
@@ -5696,8 +5701,15 @@
log.error("{}鍙风~鍖栫綈鏌ヨ璁惧妗f鏃犱俊鎭紒锛侊紒",jarProtocol.getJarNo());
return false;
}
- if (!basJar.getJarCount().equals(jarMaxLoc)){
- log.error("{}鍙风~鍖栫綈鏌ヨ璁惧搴撳瓨鏁板紓甯革紒锛侊紒搴撳瓨寰呭叆鏁帮細{}",jarProtocol.getJarNo(),basJar.getJarCount());
+ jarMaxLoc = basJar.getJarCount();
+ if (jarMaxLoc == 0) {
+ return false;
+ }
+// if (!basJar.getJarCount().equals(jarMaxLoc)){
+// log.error("{}鍙风~鍖栫綈鏌ヨ璁惧搴撳瓨鏁板紓甯革紒锛侊紒搴撳瓨寰呭叆鏁帮細{}",jarProtocol.getJarNo(),basJar.getJarCount());
+// return false;
+// }
+ if (basJarMastList.size() != jarMaxLoc){
return false;
}
@@ -5734,14 +5746,14 @@
List<BasJarMast> basJarMastList = basJarMastService.getJarMastByJarIdAndStatusList(jarSlave.getId(), new ArrayList<Integer>() {{
add(6);
}});
- if (basJarMastList.size() != jarMaxLoc){
- return false;
- }
// if (basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(),5)!=0
-// && basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(),5)!=7
-// && basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(),5)!=14){
+// && basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(),5)!=jarMaxLoc
+// && basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(),5)!=jarMaxLoc*2){
// return false;
// }
+ if (basJarMastList.isEmpty()){
+ return false;
+ }
BasJarMast basJarMastSign = basJarMastList.get(0);
if (Cools.isEmpty(basJarMastSign)){
@@ -5783,6 +5795,13 @@
log.error("{}鍙风~鍖栫綈鏌ヨ璁惧妗f鏃犱俊鎭紒锛侊紒",jarProtocol.getJarNo());
return false;
}
+ jarMaxLoc = basJar.getJarCount();
+ if (jarMaxLoc == 0) {
+ return false;
+ }
+ if (basJarMastList.size() != jarMaxLoc){
+ return false;
+ }
//闂ㄤ綔涓� 鏃�
if (jarProtocol.isAutoing() && jarProtocol.statusType == JarStatusType.WAITING2 && jarProtocol.jarErr==0
@@ -5814,6 +5833,12 @@
if (wrkMastExecuteService.getWrkMastExecuteByJarIdCount(jarSlave.getId())!=0){
return false;
}
+ List<BasJarMast> basJarMastList1 = basJarMastService.getJarMastByJarIdAndStatusList(jarSlave.getJarOtherId(), new ArrayList<Integer>() {{
+ add(0);add(1);add(2);add(3);
+ }});
+ if (!basJarMastList1.isEmpty()){
+ return false;
+ }
List<BasJarMast> basJarMastList = basJarMastService.getJarMastByJarIdAndStatusList(jarSlave.getId(), new ArrayList<Integer>() {{
add(8);
}});
@@ -5823,12 +5848,6 @@
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 && basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(),4)!=7){
- return false;
- }
BasJarMast jarMastByJarIdMin = basJarMastService.getJarMastByJarIdMin(jarSlave.getId(),8,8);
if (Cools.isEmpty(jarMastByJarIdMin)){
@@ -5869,6 +5888,17 @@
BasJar basJar = basJarMapper.selectById(jarProtocol.getJarNo());
if (Cools.isEmpty(basJar)){
log.error("{}鍙风~鍖栫綈鏌ヨ璁惧妗f鏃犱俊鎭紒锛侊紒",jarProtocol.getJarNo());
+ return false;
+ }
+
+ jarMaxLoc = basJar.getJarCount();
+ if (jarMaxLoc == 0) {
+ return false;
+ }
+ if (basJarMastList10.size()==jarMaxLoc){
+ return false;
+ }
+ if (basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(),4)!=0 && !basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(), 4).equals(jarMaxLoc)){
return false;
}
@@ -8365,7 +8395,14 @@
continue;
}
SteProtocol steProtocol = steThread.getSteProtocol();
- if (steProtocol == null || steProtocol.getChargeStatus()!=0) {
+ if (steProtocol == null) {
+ continue;
+ }
+ if (Cools.isEmpty(steProtocol.getChargeStatus())) {
+ log.error("{}鍙峰皬杞︼紝鍏呯數鐘舵�佷俊鎭紓甯革紝灏忚溅淇℃伅锛歿}",steProtocol.getSteNo(),steProtocol.toString());
+ continue;
+ }
+ if (steProtocol.getChargeStatus()!=0) {
continue;
}
WrkMastExecute wrkMastExecuteByCharge = wrkMastExecuteService.getWrkMastExecuteByCharge(steSlave.getId());
@@ -8479,7 +8516,14 @@
continue;
}
SteProtocol steProtocol = steThread.getSteProtocol();
- if (steProtocol == null || steProtocol.getChargeStatus()!=1) {
+ if (steProtocol == null) {
+ continue;
+ }
+ if (Cools.isEmpty(steProtocol.getChargeStatus())) {
+ log.error("{}鍙峰皬杞︼紝鍏呯數鐘舵�佷俊鎭紓甯革紝灏忚溅淇℃伅锛歿}",steProtocol.getSteNo(),steProtocol.toString());
+ continue;
+ }
+ if (steProtocol.getChargeStatus()!=1) {
continue;
}
@@ -8640,6 +8684,16 @@
if (basJarMastList.isEmpty()){
continue;
}
+ BasJar basJar = basJarMapper.selectById(jarNo);
+ if (Cools.isEmpty(basJar)){
+ log.error("{}鍙风~鍖栫綈鏌ヨ璁惧妗f鏃犱俊鎭紒锛侊紒",jarNo);
+ continue;
+ }
+
+ jarMaxLoc = basJar.getJarCount();
+ if (jarMaxLoc == 0) {
+ continue;
+ }
if (basJarMastList.size()>0 && basJarMastList.size()<jarMaxLoc){
jarNoList.add(jarNo);
}
@@ -8702,6 +8756,10 @@
log.error("{}鍙风~鍖栫綈鏌ヨ璁惧妗f鏃犱俊鎭紒锛侊紒",jarProtocol.getJarNo());
continue;
}
+ jarMaxLoc = basJar.getJarCount();
+ if (jarMaxLoc == 0) {
+ continue;
+ }
List<BasJarMast> basJarMastList = basJarMastService.getJarMastByJarIdAndStatusList(jarNo, new ArrayList<Integer>() {{
add(0);
add(1);
@@ -8709,13 +8767,16 @@
add(3);
add(4);
}});
- DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, 2);
+
Integer count = basJarMastList.size();
ArrayList<Integer> wrkNoList = new ArrayList<>();
-
for (Integer staNoEnt : staNos){
+ DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, 2);
StaProtocol staProtocolEnt = devpThread.getStation().get(staNoEnt);
- if (staProtocolEnt != null && staProtocolEnt.getWorkNo()!=0 && !wrkNoList.contains(staProtocolEnt.getWorkNo())){
+ if (staProtocolEnt == null || (staProtocolEnt.isLoading() && staProtocolEnt.getWorkNo()==0)){
+ log.error("绔欑偣寮傚父,璁℃暟鍔犱竴锛岀珯鐐瑰彿锛�"+staNoEnt);
+ count++;
+ } else if (staProtocolEnt != null && staProtocolEnt.getWorkNo()!=0 && !wrkNoList.contains(staProtocolEnt.getWorkNo())){
if (staProtocolEnt.getStaNo().equals(basJar.getEntStaNo$())){
count++;
wrkNoList.add(staProtocolEnt.getWorkNo());
--
Gitblit v1.9.1