From 83894247616a45ad4201b0aa5956282936f1b18a Mon Sep 17 00:00:00 2001
From: yxFwq <1>
Date: 星期二, 29 十月 2024 10:51:47 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java |  136 +++++++++++++++++++++++----------------------
 1 files changed, 70 insertions(+), 66 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..9e2a822 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){
@@ -5329,11 +5333,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 +5462,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 +5477,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浠诲姟鍒涘缓   //瀹屾垚
@@ -8784,7 +8788,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