From 7a75ac7484d9d025aea7be4ac7e238494c8f42b4 Mon Sep 17 00:00:00 2001
From: whycq <123456>
Date: 星期一, 08 八月 2022 22:06:09 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/core/thread/LedThread.java             |    4 ++--
 src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java |   16 +++++++++++++---
 src/main/java/com/zy/core/model/command/LedCommand.java     |    1 +
 src/main/resources/application.yml                          |    2 +-
 4 files changed, 17 insertions(+), 6 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 6d9409d..ddc2be4 100644
--- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -1377,13 +1377,21 @@
                 }
                 // 鑾峰彇宸ヤ綔妗f暟鎹�
                 WrkMast wrkMast = wrkMastMapper.selectById(staProtocol.getWorkNo());
-                if (null == wrkMast || wrkMast.getWrkSts() < 14 || wrkMast.getIoType() < 100) { continue; }
+//                if (null == wrkMast || wrkMast.getWrkSts() < 14 || wrkMast.getIoType() < 100) { continue; }
+                if (null == wrkMast) { continue; }
                 wrkMasts.add(wrkMast);
                 // 缁勮鍛戒护
                 LedCommand ledCommand = new LedCommand();
                 ledCommand.setWorkNo(wrkMast.getWrkNo());
+                ledCommand.setIoType(wrkMast.getIoType());
                 // 鍑哄簱妯″紡
                 switch (wrkMast.getIoType()) {
+                    case 1:
+                        ledCommand.setTitle("鍏ㄦ澘鍏ュ簱");
+                        break;
+                    case 10:
+                        ledCommand.setTitle("绌烘澘鍏ュ簱");
+                        break;
                     case 101:
                         ledCommand.setTitle("鍏ㄦ澘鍑哄簱");
                         break;
@@ -1405,8 +1413,10 @@
                         break;
                 }
                 ledCommand.setSourceLocNo(wrkMast.getSourceLocNo());
+                ledCommand.setLocNo(wrkMast.getLocNo());
                 ledCommand.setStaNo(wrkMast.getStaNo());
-                if (wrkMast.getIoType() != 110) {
+//                ledCommand.setSourceStaNo(wrkMast.getSourceStaNo());
+                if (wrkMast.getIoType() != 110 && wrkMast.getIoType() != 10 ) {
                     List<WrkDetl> wrkDetls = wrkDetlService.findByWorkNo(wrkMast.getWrkNo());
                     wrkDetls.forEach(wrkDetl -> ledCommand.getMatDtos().add(new MatDto(wrkDetl.getMatnr(), wrkDetl.getMaktx(), wrkDetl.getAnfme())));
                 }
@@ -1493,7 +1503,7 @@
                 if (staProtocol == null) {
                     continue;
                 }
-                if (staProtocol.getWorkNo() != 0) {
+                if (staProtocol.getWorkNo() != 0 && staProtocol.isLoading()) {
                     reset = false;
                     break;
                 }
diff --git a/src/main/java/com/zy/core/model/command/LedCommand.java b/src/main/java/com/zy/core/model/command/LedCommand.java
index 536a9c0..36685e8 100644
--- a/src/main/java/com/zy/core/model/command/LedCommand.java
+++ b/src/main/java/com/zy/core/model/command/LedCommand.java
@@ -29,4 +29,5 @@
 
     private boolean emptyMk = false;
 
+    private Integer ioType;
 }
diff --git a/src/main/java/com/zy/core/thread/LedThread.java b/src/main/java/com/zy/core/thread/LedThread.java
index cdc583a..fecbd49 100644
--- a/src/main/java/com/zy/core/thread/LedThread.java
+++ b/src/main/java/com/zy/core/thread/LedThread.java
@@ -96,7 +96,7 @@
         TextBxPage page = new TextBxPage();
         for (LedCommand command : list) {
             page.newLine(command.getTitle() +"锛�"+command.getWorkNo()+")");
-            page.newLine("婧愬簱浣嶏細"+command.getSourceLocNo());
+            page.newLine("搴撲綅锛�"+ (command.getIoType() < 100 ? command.getLocNo() : command.getSourceLocNo()));
             page.newLine("鐩爣绔欙細"+command.getStaNo());
             if (!command.isEmptyMk()) {
                 for (MatDto matDto : command.getMatDtos()) {
@@ -160,7 +160,7 @@
 //            page.newLine("鑷姩鍖栫珛浣撲粨搴�");
 //            page.newLine("瑗挎牸杩堣偂浠芥湁闄愬叕鍙�");
 //        }
-        page.newLine("");
+        page.newLine("鍔涙簮鏅鸿兘浠撳偍");
 
         // 璁剧疆瀛椾綋
         page.setFont(new Font("瀹嬩綋",Font.PLAIN,13));
diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml
index 45ee0c8..00a51f8 100644
--- a/src/main/resources/application.yml
+++ b/src/main/resources/application.yml
@@ -216,7 +216,7 @@
     staArr: 303
   # LED6
   led[5]:
-    id: 5
+    id: 6
     ip: 10.10.10.206
     port: 5005
     devpPlcId: ${wcs-slave.devp[0].id}

--
Gitblit v1.9.1