From 870bbe6cb445bda71a16e019546d926dbd89cab1 Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期二, 25 七月 2023 10:40:58 +0800
Subject: [PATCH] 捡料

---
 src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java |   53 ++++++++++++++++++++++++++---------------------------
 1 files changed, 26 insertions(+), 27 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 595fa55..cd12c60 100644
--- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -3,6 +3,7 @@
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.baomidou.mybatisplus.mapper.Wrapper;
 import com.core.common.Cools;
 import com.core.common.SpringUtils;
 import com.core.exception.CoolException;
@@ -202,25 +203,15 @@
                     // 杩囨护鐩樼偣/鎷f枡/骞舵澘浠诲姟
                     WrkMast wrkMast1 = wrkMastMapper.selectPickStepByBarcode(barcode);
                     if (null != wrkMast1) {
-                        // plc 澶勭悊
-                        barcodeThread.setBarcode("");
-                        staProtocol.setWorkNo(wrkMast1.getWrkNo().shortValue());
-                        staProtocol.setStaNo(wrkMast1.getStaNo().shortValue());
-                        devpThread.setPakMk(staProtocol.getSiteId(), false);
-
-                        boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
-                        if (!result) {
-                            throw new CoolException("鏇存柊plc绔欑偣淇℃伅澶辫触");
-                        }
                         continue;
                     }
 
                     // 鍒ゆ柇閲嶅宸ヤ綔妗�
-//                    WrkMast wrkMast = wrkMastMapper.selectPakInStep1(inSta.getStaNo(), barcode);
-//                    if (wrkMast != null) {
-//                        News.error("宸ヤ綔妗d腑宸插瓨鍦ㄨ绔欑姸鎬佷负锛� 2.璁惧涓婅蛋 锛夌殑鏁版嵁,宸ヤ綔鍙�={}", wrkMast.getWrkNo());
-//                        continue;
-//                    }
+                    WrkMast wrkMast2 = wrkMastMapper.selectPakInStep1(inSta.getStaNo(), barcode);
+                    if (wrkMast2 != null) {
+                        News.error("宸ヤ綔妗d腑宸插瓨鍦ㄨ绔欑姸鎬佷负锛� 2.璁惧涓婅蛋 锛夌殑鏁版嵁,宸ヤ綔鍙�={}", wrkMast2.getWrkNo());
+                        continue;
+                    }
 
                     try {
                         LocTypeDto locTypeDto = new LocTypeDto(staProtocol);
@@ -490,18 +481,18 @@
                         if (code.equals(200)) {
                             StartupDto dto = jsonObject.getObject("data", StartupDto.class);
 
-//                            // 鑾峰彇鐩爣绔�
-//                            Wrapper<StaDesc> wrapper = new EntityWrapper<StaDesc>()
-//                                    .eq("type_no", wrkMast.getIoType() - 50)
-//                                    .eq("stn_no", pickSta.getStaNo()) // 浣滀笟绔欑偣 = 鎷f枡鍑哄簱鐨勭洰鏍囩珯
-//                                    .eq("crn_no", dto.getCrnNo()); // 鍫嗗灈鏈哄彿
-//                            StaDesc staDesc = staDescService.selectOne(wrapper);
-//                            if (Cools.isEmpty(staDesc)) {
-//                                News.error("鍏ュ簱璺緞涓嶅瓨鍦紒type_no={},stn_no={},crn_no={}", wrkMast.getIoType(), pickSta.getStaNo(), wrkMast.getCrnNo());
-//                                continue;
-//                            }
-//                            // 鍫嗗灈鏈虹珯鐐�(鐩爣绔�)
-//                            Integer staNo = staDesc.getCrnStn();
+                            // 鑾峰彇鐩爣绔�
+                            Wrapper<StaDesc> wrapper = new EntityWrapper<StaDesc>()
+                                    .eq("type_no", wrkMast.getIoType() - 50)
+                                    .eq("stn_no", pickSta.getStaNo()) // 浣滀笟绔欑偣 = 鎷f枡鍑哄簱鐨勭洰鏍囩珯
+                                    .eq("crn_no", dto.getCrnNo()); // 鍫嗗灈鏈哄彿
+                            StaDesc staDesc = staDescService.selectOne(wrapper);
+                            if (Cools.isEmpty(staDesc)) {
+                                News.error("鍏ュ簱璺緞涓嶅瓨鍦紒type_no={},stn_no={},crn_no={}", wrkMast.getIoType(), pickSta.getStaNo(), wrkMast.getCrnNo());
+                                continue;
+                            }
+                            // 鍫嗗灈鏈虹珯鐐�(鐩爣绔�)
+                            Integer staNo = staDesc.getCrnStn();
 
                             // 淇濆瓨宸ヤ綔鏄庣粏妗e巻鍙叉。
 //                        if (wrkMastMapper.saveWrkDetlLog(wrkMast.getWrkNo()) == 0) {
@@ -530,6 +521,14 @@
                                 throw new CoolException(wrkMast.getWrkNo() + "鏇存柊宸ヤ綔妗f暟鎹姸鎬佸け璐�");
                             }
 
+                            // 淇敼搴撲綅鐘舵�� Q.鎷f枡/鐩樼偣/骞舵澘鍐嶅叆搴�
+                            LocMast locMast = locMastService.selectById(wrkMast.getLocNo());
+                            locMast.setLocSts("Q");
+                            locMast.setModiTime(new Date());
+                            if (!locMastService.updateById(locMast)) {
+                                throw new CoolException("淇敼搴撲綅鐘舵�佸け璐�");
+                            }
+
                             // 鏇存柊绔欑偣淇℃伅 涓� 涓嬪彂plc鍛戒护
                             staProtocol.setWorkNo(wrkMast.getWrkNo().shortValue());
                             staProtocol.setStaNo(wrkMast.getStaNo().shortValue());

--
Gitblit v1.9.1