From 84454635aebd1c81e943a4e5b73cca33779d460c Mon Sep 17 00:00:00 2001
From: skyouc <958836976@qq.com>
Date: 星期一, 02 二月 2026 15:56:18 +0800
Subject: [PATCH] no message

---
 src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java |   98 +++++++++++++++++++++++++++++-------------------
 1 files changed, 59 insertions(+), 39 deletions(-)

diff --git a/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
index 2943288..5731507 100644
--- a/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
@@ -131,6 +131,8 @@
     private StationRelaService stationRelaService;
     @Autowired
     private BasStationDetlService basStationDetlService;
+    @Autowired
+    private WorkService workService;
 
     @Override
     @Transactional
@@ -589,9 +591,6 @@
     @Override
     @Transactional(rollbackFor = Exception.class)
     public void comb(CombParam param, Long userId) {
-//        if (Cools.isEmpty(param.getBarcode(), param.getCombMats())) {
-//            throw new CoolException(BaseRes.PARAM);
-//        }
         if (Objects.isNull(param.getBarcode())) {
             throw new CoolException(BaseRes.PARAM);
         }
@@ -627,6 +626,7 @@
         Date now = new Date();
         // 鏃犲崟缁勬墭
         if (Cools.isEmpty(param.getOrderNo())) {
+            //绌烘澘缁勬墭
             if (param.getPakinType().equals("3")) {
                 WaitPakin waitPakin = new WaitPakin();
                 waitPakin.setZpallet(param.getBarcode());
@@ -1207,15 +1207,15 @@
         // 鑾峰彇搴撲綅
         LocMast locMast = locMastService.selectById(locDetl.getLocNo());
         // 鑾峰彇璺緞
-        Wrapper<StaDesc> wrapper = new EntityWrapper<StaDesc>()
-                .eq("type_no", ioType)
-                .eq("stn_no", staNo.getDevNo())
-                .eq("crn_no", locMast.getCrnNo());
-
-        StaDesc staDesc = staDescService.selectOne(wrapper);
-        if (Cools.isEmpty(staDesc)) {
-            throw new CoolException("鍑哄簱璺緞涓嶅瓨鍦�");
-        }
+//        Wrapper<StaDesc> wrapper = new EntityWrapper<StaDesc>()
+//                .eq("type_no", ioType)
+//                .eq("stn_no", staNo.getDevNo())
+//                .eq("crn_no", locMast.getCrnNo());
+//
+//        StaDesc staDesc = staDescService.selectOne(wrapper);
+//        if (Cools.isEmpty(staDesc)) {
+//            throw new CoolException("鍑哄簱璺緞涓嶅瓨鍦�");
+//        }
         // 鐢熸垚宸ヤ綔鍙�
         int workNo = commonService.getWorkNo(2);
         // 鐢熸垚宸ヤ綔妗�
@@ -1226,8 +1226,8 @@
         wrkMast.setIoType(ioType); // 鍏ュ嚭搴撶姸鎬�
         wrkMast.setIoPri(13D); // 浼樺厛绾э細13
         wrkMast.setCrnNo(locMast.getCrnNo());
-        wrkMast.setSourceStaNo(staDesc.getCrnStn() + ""); // 婧愮珯
-        wrkMast.setStaNo(staDesc.getStnNo() + ""); // 鐩爣绔�
+//        wrkMast.setSourceStaNo(staDesc.getCrnStn() + ""); // 婧愮珯
+//        wrkMast.setStaNo(staDesc.getStnNo() + ""); // 鐩爣绔�
         wrkMast.setSourceLocNo(locDetl.getLocNo()); // 婧愬簱浣�
         wrkMast.setFullPlt("Y"); // 婊℃澘锛歒
         wrkMast.setPicking("N"); // 鎷f枡
@@ -1380,7 +1380,8 @@
                     .eq("area_id", basAreas.getId())
                     .eq("loc_no", locCache.getLocNo()));
             if (Objects.isNull(locDetls) || locDetls.isEmpty()) {
-                throw new CoolException("搴撳瓨鏄庣粏涓嶅瓨鍦紒锛�");
+                continue;
+//                throw new CoolException("搴撳瓨鏄庣粏涓嶅瓨鍦紒锛�");
             }
 
             Set<String> set = locDetls.stream().map(LocDetl::getMatnr).collect(Collectors.toSet());
@@ -1808,31 +1809,49 @@
             whsType = 2;
         }
 
-        log.info("WCS浠诲姟鐢熸垚璇锋眰鍙傛暟锛歿}", JSONObject.toJSONString(param));
+        WrkMast barcode = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("barcode", param.getBarcode()));
+        if (!Objects.isNull(barcode) && (barcode.getIoType() == 104 || barcode.getIoType() == 103 || barcode.getIoType() == 107) && barcode.getWrkSts() == 14L) {
+            //
+            workService.pickWrkMast(barcode.getWrkNo() + "", userId);
 
-        BasDevp station = basDevpService.selectOne(new EntityWrapper<BasDevp>()
-                .eq("dev_no", param.getSourceStaNo()));
-        if (Objects.isNull(station)) {
-            throw new CoolException("绔欑偣涓嶅瓨鍦�!!");
+            Map<String, Object> response = new HashMap<>();
+            response.put("taskNo", barcode.getWrkNo());
+            response.put("locNo", barcode.getLocNo());
+            response.put("taskPri", barcode.getIoPri());
+
+            return R.ok("浠诲姟鐢熸垚鎴愬姛").add(response);
+        } else {
+            log.info("WCS浠诲姟鐢熸垚璇锋眰鍙傛暟锛歿}", JSONObject.toJSONString(param));
+
+            BasDevp station = basDevpService.selectOne(new EntityWrapper<BasDevp>()
+                    .eq("dev_no", param.getSourceStaNo()));
+            if (Objects.isNull(station)) {
+                throw new CoolException("绔欑偣涓嶅瓨鍦�!!");
+            }
+            Map<String, Object> response = new HashMap<>();
+
+            if (Objects.isNull(barcode)) {
+                List<WaitPakin> waitPakins = waitPakinService
+                        .selectList(new EntityWrapper<WaitPakin>()
+                                .eq("io_status", "N")
+                                .eq("zpallet", param.getBarcode()));
+                if (Objects.isNull(waitPakins) || waitPakins.isEmpty()) {
+                    throw new CoolException("鏁版嵁閿欒,缁勬嫋妗e凡涓嶅瓨鍦�!!");
+                }
+
+                WrkMast wrkMast = generateCrnInTask(waitPakins, whsType, station, param.getLocType1(), userId);
+
+                response.put("taskNo", wrkMast.getWrkNo());
+                response.put("locNo", wrkMast.getLocNo());
+                response.put("taskPri", wrkMast.getIoPri());
+            } else {
+                response.put("taskNo", barcode.getWrkNo());
+                response.put("locNo", barcode.getLocNo());
+                response.put("taskPri", barcode.getIoPri());
+            }
+
+            return R.ok("浠诲姟鐢熸垚鎴愬姛").add(response);
         }
-
-        List<WaitPakin> waitPakins = waitPakinService
-                .selectList(new EntityWrapper<WaitPakin>()
-                        .eq("io_status", "N")
-                        .eq("zpallet", param.getBarcode()));
-        if (Objects.isNull(waitPakins) || waitPakins.isEmpty()) {
-            throw new CoolException("鏁版嵁閿欒,缁勬嫋妗e凡涓嶅瓨鍦�!!");
-        }
-
-        WrkMast wrkMast = generateCrnInTask(waitPakins,whsType, station, param.getLocType1(), userId);
-
-        Map<String, Object> response = new HashMap<>();
-        response.put("taskNo", wrkMast.getWrkNo());
-        response.put("locNo", wrkMast.getLocNo());
-        response.put("taskPri", wrkMast.getIoPri());
-
-        return R.ok("浠诲姟鐢熸垚鎴愬姛").add(response);
-
     }
 
     /**
@@ -2029,7 +2048,7 @@
             }
 
         } else {
-            StartupDto dto = commonService.getLocNo(1, sourceStaNo.getDevNo(), whsType,  findLocNoAttributeVo, locTypeDto);
+            StartupDto dto = commonService.getLocNo(1, sourceStaNo.getDevNo(), whsType, findLocNoAttributeVo, locTypeDto);
 
             int workNo = dto.getWorkNo();
             // 鐢熸垚宸ヤ綔妗�
@@ -2687,6 +2706,7 @@
 
     /**
      * 6.15WCS鐢宠鍦ㄥ簱搴撲綅鏇存崲搴撲綅
+     *
      * @param combParam
      * @param l
      * @return

--
Gitblit v1.9.1