From 361baf186c76ba0ce1ad809eeef7ff23ed971312 Mon Sep 17 00:00:00 2001
From: whycq <123456>
Date: 星期三, 10 八月 2022 07:55:45 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java |   26 ++++++++++++++++++--------
 1 files changed, 18 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 9ff900e..5056bba 100644
--- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -130,7 +130,7 @@
                 // 鍒ゆ柇鏄惁婊¤冻鍏ュ簱鏉′欢
                 if (staProtocol.isAutoing() && staProtocol.isLoading()
                         && staProtocol.isInEnable()
-                        && !staProtocol.isEmptyMk() && (staProtocol.getWorkNo() == 0 || staProtocol.getWorkNo() == 9999)
+                        && !staProtocol.isEmptyMk() && (staProtocol.getWorkNo() == 0 || staProtocol.getWorkNo() > 9990)
                         && staProtocol.isPakMk()){// && !Cools.isEmpty(barcode)) {
 
 //                    if(Cools.isEmpty(barcode) || "NG".endsWith(barcode) || "NoRead".equals(barcode)) {
@@ -1364,13 +1364,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;
@@ -1392,10 +1400,12 @@
                         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.getMatNo(), wrkDetl.getMatName(), wrkDetl.getQty())));
+                    wrkDetls.forEach(wrkDetl -> ledCommand.getMatDtos().add(new MatDto(wrkDetl.getMatnr(), wrkDetl.getMaktx(), wrkDetl.getAnfme())));
                 }
                 commands.add(ledCommand);
             }
@@ -1480,13 +1490,13 @@
                 if (staProtocol == null) {
                     continue;
                 }
-                if (staProtocol.getWorkNo() != 0) {
+                if (staProtocol.getWorkNo() != 0 && staProtocol.isLoading()) {
                     reset = false;
                     break;
                 }
             }
             // 鑾峰彇led绾跨▼
-            LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, led.getDevpPlcId());
+            LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, led.getId());
             // led鏄剧ず榛樿鍐呭
             if (reset && !ledThread.isLedMk()) {
                 ledThread.setLedMk(true);
@@ -1540,7 +1550,7 @@
                 WrkDetl wrkDetl = new WrkDetl();
                 wrkDetl.setWrkNo(workNo);
                 wrkDetl.setIoTime(now);
-                wrkDetl.setQty(locDetl.getQty());
+                wrkDetl.setAnfme(locDetl.getAnfme());
                 VersionUtils.setWrkDetl(wrkDetl, locDetl); // 鐗堟湰鎺у埗
                 wrkDetl.setAppeTime(now);
                 wrkDetl.setModiTime(now);
@@ -1657,7 +1667,7 @@
                     WrkDetl wrkDetl = new WrkDetl();
                     wrkDetl.setWrkNo(workNo);
                     wrkDetl.setIoTime(new Date());
-                    wrkDetl.setQty(locDetl.getQty());
+                    wrkDetl.setAnfme(locDetl.getAnfme());
                     VersionUtils.setWrkDetl(wrkDetl, locDetl); // 鐗堟湰鎺у埗
                     wrkDetl.setAppeTime(new Date());
                     wrkDetl.setModiTime(new Date());

--
Gitblit v1.9.1