From ab9d69b6166ed7301aaad8b4ccf96319f71c168b Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期一, 10 八月 2020 14:44:57 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java |   50 +++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 43 insertions(+), 7 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 ea4177b..4f0f320 100644
--- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -290,11 +290,10 @@
         }
     }
 
-
     /**
-     * 鍏ュ簱  ===>>  鍫嗗灈鏈虹珯鍒板簱浣�
+     * 鍏ュ嚭搴�  ===>>  鍫嗗灈鏈虹珯鍒板簱浣� 鍫嗗灈鏈哄叆鍑哄簱浣滀笟涓嬪彂
      */
-    public void crnStnToLoc(){
+    public void crnIoExecute(){
         for (Slave crn : slaveProperties.getCrn()) {
             // 鑾峰彇鍫嗗灈鏈轰俊鎭�
             CrnThread crnThread = (CrnThread) SlaveConnection.get(SlaveType.Crn, crn.getId());
@@ -305,16 +304,53 @@
             }
             // 鍙湁褰撳爢鍨涙満绌洪棽 鎴栬�� 鏃犱换鍔℃椂鎵嶇户缁墽琛�
             if (crnProtocol.getStatusType() == CrnStatusType.IDLE || crnProtocol.getTaskNo() == 0) {
-
+                // 濡傛灉鏈�杩戜竴娆℃槸鍏ュ簱妯″紡
+                if (crnProtocol.getLastIo().equals("I")) {
+                    if (basCrnp.getInEnable().equals("Y")) {
+                        this.crnStnToLoc(); //  鍏ュ簱
+                        crnProtocol.setLastIo("O");
+                    } else if (basCrnp.getOutEnable().equals("Y")) {
+                        this.locToCrnStn(); //  鍑哄簱
+                        crnProtocol.setLastIo("I");
+                    }
+                }
+                // 濡傛灉鏈�杩戜竴娆℃槸鍑哄簱妯″紡
+                else if (crnProtocol.getLastIo().equals("O")) {
+                    if (basCrnp.getOutEnable().equals("Y")) {
+                        this.locToCrnStn(); //  鍑哄簱
+                        crnProtocol.setLastIo("I");
+                    } else if (basCrnp.getInEnable().equals("Y")) {
+                        this.crnStnToLoc(); //  鍏ュ簱
+                        crnProtocol.setLastIo("O");
+                    }
+                }
             }
-
-
-
+            // 搴撲綅绉昏浆
+            this.locToLoc();
 
         }
     }
 
+    /**
+     * 鍏ュ簱  ===>>  鍫嗗灈鏈虹珯鍒板簱浣�
+     */
+    private void crnStnToLoc(){
 
+    }
+
+    /**
+     * 鍑哄簱  ===>>  搴撲綅鍒板爢鍨涙満绔�
+     */
+    private void locToCrnStn(){
+
+    }
+
+    /**
+     * 搴撲綅绉昏浆
+     */
+    private void locToLoc(){
+
+    }
 
     /**
      * 鎵ц瀵瑰伐浣滄。鐨勫叆搴撳畬鎴�

--
Gitblit v1.9.1