From b3a41c6e7161a3271856605a3940bc27534efbc1 Mon Sep 17 00:00:00 2001 From: yxFwq <1> Date: 星期日, 21 七月 2024 11:04:40 +0800 Subject: [PATCH] # --- src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java | 117 ++++++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 109 insertions(+), 8 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 22150b9..6bea44b 100644 --- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java +++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java @@ -5128,9 +5128,10 @@ if (jarProtocol.isAutoing() && jarProtocol.jarErr==0){ if (jarWrkMastExecuteGenerate5(jarSlave,sign)){ signExecute[jarSlave.getId()-5] = true; + return signExecute; //鍑虹~鍖栫綈 ===銆� 鍏ュ喎鍗存Ы } - return signExecute; + continue; } } catch (Exception e){ log.error("{}鍙风~鍖栫綈JarWrkMastExecute浠诲姟鍒涘缓寮傚父,寮傚父鍘熷洜={}",jarSlave.getId(),e.getMessage()); @@ -5278,6 +5279,10 @@ return false; } + if (wrkMastExecuteService.getWrkMastExecuteByjarReginCount(basJar.getRegion())!=0){ + return false; + } + //闂ㄤ綔涓� 鏃� //鑷姩銆佺┖闂层�佸彸闂ㄥ叧闂�� Other宸﹂棬鍏抽棴 if (jarProtocol.isAutoing() && jarProtocol.jarErr==0 @@ -5331,6 +5336,10 @@ BasJarMast basJarMastSign = basJarMastList.get(0); if (Cools.isEmpty(basJarMastSign)){ + return false; + } + + if (wrkMastExecuteService.getWrkMastExecuteByjarReginCount(basJarMastSign.getJarRegin())!=0){ return false; } // //鍒ゆ柇灏忚溅鐘舵�� @@ -5413,6 +5422,10 @@ if (Cools.isEmpty(basJarMastSign)){ return false; } + + if (wrkMastExecuteService.getWrkMastExecuteByjarReginCount(basJarMastSign.getJarRegin())!=0){ + return false; + } // //鍒ゆ柇灏忚溅鐘舵�� // if (!jarWrkMastExecuteGenerateSteStatus(jarSlave.getJarInSte().get(0).getSteNo(),2,SteStatusType.IDLE)){ // return false; @@ -5482,13 +5495,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; } // //鍒ゆ柇灏忚溅鐘舵�� @@ -5572,6 +5598,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)){ @@ -5598,6 +5628,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; } @@ -6512,6 +6562,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) { @@ -6704,7 +6774,7 @@ } } else { //璋冭溅 == > endRow - if (!jarRgvMoveTake(wrkMastExecute,SteAndJarUtil.getJarNoEndRow(jarProtocolOther.getJarNo()))){ + if (!jarRgvMoveTake(wrkMastExecute,SteAndJarUtil.getJarNoEndRow(basJar.getBurial()))){ log.error("骞宠 杞GV鍛戒护涓嬪彂澶辫触锛宺gv鍙�={},浠诲姟鏁版嵁={},纭寲缃愭暟鎹�={},sign={}", wrkMastExecute.getJarId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(jarProtocol),sign); } @@ -7736,6 +7806,8 @@ return true; } return true; + } else { + log.error("{}鍙峰钩琛¤溅褰撳墠鐘舵�佷笉婊¤冻鍏ョ~鍖栫綈鏉′欢锛屽綋鍓嶄换鍔★紝骞宠 杞︿粠鍙栬揣"); } } return true; @@ -8107,13 +8179,14 @@ } public synchronized Integer jarGetStartStaNo(Integer staNo) { try { - int[] jarNos=new int[]{4,2,3,1};//(607鍒嗛厤纭寲缃�) + 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(613);add(614);add(615);add(616);add(617);add(618); add(619);add(620);add(621);add(622); }}; ArrayList<Integer> jarNoList = new ArrayList<>(); + ArrayList<Integer> jarNoList1 = new ArrayList<>(); ArrayList<Integer> jarNoListNow = new ArrayList<>(); for (int jarNo : jarNos) { List<BasJarMast> basJarMastList = basJarMastService.getJarMastByJarIdAndStatusList(jarNo, new ArrayList<Integer>() {{ @@ -8130,10 +8203,38 @@ jarNoList.add(jarNo); } } - jarNoList.add(4); - jarNoList.add(2); - jarNoList.add(3); - jarNoList.add(1); + for (int jarNo : jarNos) { + if (!jarNoList.contains(jarNo)){ + jarNoList1.add(jarNo); + } + } + for (int jarNo : jarNoList1) { + List<BasJarMast> jarMastByJarIdAndStatusList = basJarMastService.getJarMastByJarIdAndStatusList(8, jarNo); + if (jarMastByJarIdAndStatusList.isEmpty()){ + jarNoList.add(jarNo); + } + } + jarNoList1 = new ArrayList<Integer>(); + for (int jarNo : jarNos) { + if (!jarNoList.contains(jarNo)){ + jarNoList1.add(jarNo); + } + } + for (int jarNo : jarNoList1) { + List<BasJarMast> basJarMastList = basJarMastService.getJarMastByJarIdAndStatusList(jarNo, new ArrayList<Integer>() {{ + add(5); + add(6); + add(7); + add(8); + add(9); + add(13); + add(14); + add(15); + }}); + if (basJarMastList.isEmpty()){ + jarNoList.add(jarNo); + } + } for (int jarNo : jarNoList) { if (jarNoListNow.contains(jarNo)){ continue; -- Gitblit v1.9.1