From 37db2b025903d3c7023604f3f10bc393da20af64 Mon Sep 17 00:00:00 2001
From: skyouc <creaycat@gmail.com>
Date: 星期三, 10 十二月 2025 13:12:22 +0800
Subject: [PATCH] no message

---
 src/main/java/com/zy/api/service/impl/KopenApiServiceImpl.java |    2 
 src/main/java/com/zy/asrs/entity/param/CompleteParam.java      |    2 +
 src/main/java/com/zy/asrs/service/impl/TaskServiceImpl.java    |    9 ++++
 src/main/java/com/zy/asrs/entity/param/AgvCallParams.java      |    3 +
 src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java  |   73 ++++++++++++++++++++++--------------
 src/main/java/com/zy/asrs/entity/BasStationDetl.java           |    4 +-
 src/main/java/com/zy/asrs/controller/MobileController.java     |    4 +-
 7 files changed, 63 insertions(+), 34 deletions(-)

diff --git a/src/main/java/com/zy/api/service/impl/KopenApiServiceImpl.java b/src/main/java/com/zy/api/service/impl/KopenApiServiceImpl.java
index 2fe7ea8..a3de122 100644
--- a/src/main/java/com/zy/api/service/impl/KopenApiServiceImpl.java
+++ b/src/main/java/com/zy/api/service/impl/KopenApiServiceImpl.java
@@ -131,7 +131,7 @@
         newOrder.setNumber(params.getDispatch_no());
         // 绠卞彿
         newOrder.setItemName(params.getPm_tktid());
-        newOrder.setSettle(OrderSettle.ORDER_SETTLE_INIT.type);
+        newOrder.setSettle(OrderSettle.ORDER_SETTLE_HOLDING.type);
         newOrder.setStatus(CommonEnum.COMMON_ENUM_Y.type);
         // 璁㈠崟鏃堕棿
         newOrder.setOrderTime(DateUtils.convert(new Date(), "yyyy-MM-dd HH:mm:ss"));
diff --git a/src/main/java/com/zy/asrs/controller/MobileController.java b/src/main/java/com/zy/asrs/controller/MobileController.java
index 8f9c84c..a36dc7f 100644
--- a/src/main/java/com/zy/asrs/controller/MobileController.java
+++ b/src/main/java/com/zy/asrs/controller/MobileController.java
@@ -337,7 +337,7 @@
         if (Objects.isNull(combParam)) {
             return R.error("鍙傛暟涓嶈兘涓虹┖!!");
         }
-        mobileService.combInPub(combParam, getUserId());
+        mobileService.combInPub(combParam, 10031L);
         return R.ok("涓婃灦鎴愬姛");
     }
 
@@ -358,7 +358,7 @@
     @RequestMapping("/pack/comb/auth")
     @ManagerAuth(memo = "涓嬬嚎缁勬墭")
     public R packComb(@RequestBody CombParam combParam){
-        mobileService.packComb(combParam, getUserId());
+        mobileService.packComb(combParam, 10031L);
         return R.ok("缁勬墭鎴愬姛");
     }
 
diff --git a/src/main/java/com/zy/asrs/entity/BasStationDetl.java b/src/main/java/com/zy/asrs/entity/BasStationDetl.java
index 6227d0d..b8be23d 100644
--- a/src/main/java/com/zy/asrs/entity/BasStationDetl.java
+++ b/src/main/java/com/zy/asrs/entity/BasStationDetl.java
@@ -35,7 +35,7 @@
      */
     @ApiModelProperty(value= "绔欑偣缂栫爜")
     @TableField("dev_no")
-    private Integer devNo;
+    private String devNo;
 
     /**
      * 鏁伴噺
@@ -302,7 +302,7 @@
 
     public BasStationDetl() {}
 
-    public BasStationDetl(Long id,Integer devNo,Double anfme,String zpallet,String matnr,String maktx,String batch,String orderNo,String specs,String model,String color,String brand,String unit,Double price,String sku,Double units,String barcode,String origin,String manu,String manuDate,String itemNum,Double safeQty,Double weight,Double manLength,Double volume,String threeCode,String supp,String suppCode,Integer beBatch,String deadTime,Integer deadWarn,Integer source,Integer inspect,Integer danger,Long modiUser,Date modiTime,Long appeUser,Date appeTime,String memo,Long lineNumber,String standby1,String standby2,String standby3,String boxType1,String boxType2,String boxType3) {
+    public BasStationDetl(Long id,String devNo,Double anfme,String zpallet,String matnr,String maktx,String batch,String orderNo,String specs,String model,String color,String brand,String unit,Double price,String sku,Double units,String barcode,String origin,String manu,String manuDate,String itemNum,Double safeQty,Double weight,Double manLength,Double volume,String threeCode,String supp,String suppCode,Integer beBatch,String deadTime,Integer deadWarn,Integer source,Integer inspect,Integer danger,Long modiUser,Date modiTime,Long appeUser,Date appeTime,String memo,Long lineNumber,String standby1,String standby2,String standby3,String boxType1,String boxType2,String boxType3) {
         this.id = id;
         this.devNo = devNo;
         this.anfme = anfme;
diff --git a/src/main/java/com/zy/asrs/entity/param/AgvCallParams.java b/src/main/java/com/zy/asrs/entity/param/AgvCallParams.java
index afdc5e2..3809a04 100644
--- a/src/main/java/com/zy/asrs/entity/param/AgvCallParams.java
+++ b/src/main/java/com/zy/asrs/entity/param/AgvCallParams.java
@@ -23,6 +23,9 @@
     @ApiModelProperty("鎵樼洏鐮�")
     private String barcode;
 
+    @ApiModelProperty("鍙拌溅鎵樼洏")
+    private String carBarcode;
+
     @ApiModelProperty("BS缂栫爜")
     private String bsCode;
 
diff --git a/src/main/java/com/zy/asrs/entity/param/CompleteParam.java b/src/main/java/com/zy/asrs/entity/param/CompleteParam.java
index 6de2e8d..427e3e4 100644
--- a/src/main/java/com/zy/asrs/entity/param/CompleteParam.java
+++ b/src/main/java/com/zy/asrs/entity/param/CompleteParam.java
@@ -14,6 +14,8 @@
 
     private String station;
 
+    private String carBarcode;
+
     private Integer IoType;
 
 }
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 f703d75..e85151a 100644
--- a/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
@@ -593,9 +593,14 @@
             throw new CoolException("鏉$爜闀垮害涓嶆槸8浣�===>>" + param.getBarcode());
         }
 
+        if (Objects.isNull(param.getType())) {
+            param.setType("0");
+        }
         int countLoc = locDetlService.selectCount(new EntityWrapper<LocDetl>().eq("zpallet", param.getBarcode()));
         int countWrk = wrkDetlService.selectCount(new EntityWrapper<WrkDetl>().eq("zpallet", param.getBarcode()));
-        int countwait = waitPakinService.selectCount(new EntityWrapper<WaitPakin>().eq("zpallet", param.getBarcode()));
+        int countwait = waitPakinService.selectCount(new EntityWrapper<WaitPakin>()
+                        .eq(!Objects.isNull(param.getType()), "type", param.getType())
+                .eq("zpallet", param.getBarcode()));
         if (countLoc > 0 || countWrk > 0 || countwait > 0) {
             throw new CoolException("缁勬墭妗�/宸ヤ綔妗�/搴撳瓨鏉$爜鏁版嵁宸插瓨鍦�===>>" + param.getBarcode());
         }
@@ -726,6 +731,8 @@
                 waitPakin.setOrderId(detlDto.getOrderId());
                 waitPakin.setBatch(detlDto.getBatch());     // 搴忓垪鐮�
                 waitPakin.setZpallet(param.getBarcode());   // 鎵樼洏鐮�
+                waitPakin.setThreeCode(detlDto.getThreeCode());
+                waitPakin.setSuppCode(detlDto.getStandby1());
                 waitPakin.setIoStatus("N");     // 鍏ュ嚭鐘舵��
                 waitPakin.setAnfme(detlDto.getAnfme());  // 鏁伴噺
                 waitPakin.setStatus("Y");    // 鐘舵��
@@ -1272,6 +1279,7 @@
      * @version 1.0
      */
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public R OutCallAgv(AgvCallParams params, Long userId) {
         /**鑾峰彇鍏ュ簱鏈�鏃╃殑涓�鏉℃暟鎹�**/
         LocCache locCaches = locCacheService.selectOne(new EntityWrapper<LocCache>()
@@ -1344,7 +1352,6 @@
         if (Objects.isNull(params.getOrgSite())) {
             throw new CoolException("婧愮珯鐐逛笉鑳戒负绌猴紒锛�");
         }
-
         List<Task> tasks = taskService.selectList(new EntityWrapper<Task>().eq("barcode", params.getBarcode()));
         if (!tasks.isEmpty()) {
             throw new CoolException("鎵樼洏鐮佸凡鐢熸垚浠诲姟");
@@ -1388,8 +1395,8 @@
      */
     @Override
     public R combCacehList(AgvCallParams params) {
-        if (Objects.isNull(params.getBarcode())) {
-            throw new CoolException("鎵樼洏鐮佷笉鑳戒负绌猴紒锛�");
+        if (Objects.isNull(params.getCarBarcode())) {
+            throw new CoolException("鍙拌溅鎵樼洏鐮佷笉鑳戒负绌猴紒锛�");
         }
         if (Objects.isNull(params.getBsCode())) {
             throw new CoolException("BS鐮佷笉鑳戒负绌猴紒锛�");
@@ -1397,14 +1404,15 @@
         Task task = taskService.selectOne(new EntityWrapper<Task>()
                 .eq("io_type", TaskIOType.PICK_OUT.type)
                 .eq("wrk_sts", 14)
-                .eq("barcode", params.getBarcode()));
+                .eq("barcode", params.getCarBarcode()));
         if (Objects.isNull(task)) {
             throw new CoolException("鏁版嵁閿欒锛氫换鍔′俊鎭瓨鍦紒锛�");
         }
 
         List<TaskDetl> taskDetl = taskDetlService.selectList(new EntityWrapper<TaskDetl>()
                 .eq("three_code", params.getBsCode())
-                .eq("zpallet", params.getBarcode()));
+                .eq("wrk_no", task.getWrkNo())
+                .eq("zpallet", params.getCarBarcode()));
 
         if (Objects.isNull(taskDetl) || taskDetl.isEmpty()) {
             throw new CoolException("褰撳墠BS缂栫爜涓嶅瓨鍦紒锛�");
@@ -1472,7 +1480,7 @@
             waitPakin.setBatch(detlDto.getBatch());
             waitPakin.setZpallet(param.getBarcode());
             //璁剧疆缁勬墭绫诲瀷
-            waitPakin.setType(CommonEnum.COMMON_ENUM_Y.type + "");
+            waitPakin.setType(param.getType());
             waitPakin.setIoStatus("N");
             waitPakin.setAnfme(detlDto.getAnfme());
             waitPakin.setThreeCode(detlDto.getThreeCode());
@@ -1511,7 +1519,9 @@
             throw new CoolException("绔欑偣涓嶈兘涓虹┖!!");
         }
         //TODO 淇敼缂撳瓨绔欑偣鐘舵�佸強鏁版嵁
-        Task task = taskService.selectOne(new EntityWrapper<Task>().eq("barcode", param.getBarcode()));
+        Task task = taskService.selectOne(new EntityWrapper<Task>()
+                .eq("wrk_sts", 14L)
+                .eq("barcode", param.getCarBarcode()));
         if (Objects.isNull(task)) {
             throw new CoolException("鏁版嵁閿欒,浠诲姟涓嶅瓨鍦�!!");
         }
@@ -1530,10 +1540,7 @@
         if (!basStationService.updateById(station)) {
             throw new CoolException("绔欑偣鐘舵�佷慨鏀瑰け璐�!");
         }
-
-        if (!basStationDetlService.delete(new EntityWrapper<BasStationDetl>().eq("dev_no", station.getDevNo()))) {
-            throw new CoolException("绔欑偣鍒犻櫎澶辫触!");
-        }
+        basStationDetlService.delete(new EntityWrapper<BasStationDetl>().eq("dev_no", station.getDevNo()));
 
         //浠诲姟瀹屾垚
         task.setWrkSts(15L);
@@ -1542,7 +1549,7 @@
             throw new CoolException("AGV浠诲姟瀹屾垚澶辫触!!");
         }
 
-        List<WaitPakin> waitPakins = waitPakinService.selectList(new EntityWrapper<WaitPakin>().eq("barcodee", param.getBarcode()));
+        List<WaitPakin> waitPakins = waitPakinService.selectList(new EntityWrapper<WaitPakin>().eq("zpallet", param.getBarcode()));
         if (Objects.isNull(waitPakins) || waitPakins.isEmpty()) {
             throw new CoolException("鏁版嵁閿欒,缁勬嫋妗e凡涓嶅瓨鍦�!!");
         }
@@ -1561,7 +1568,8 @@
     public void generateCrnInTask(List<WaitPakin> waitPakins, BasStation station, Short locType,  Long userId) {
         Date now = new Date();
         StationRela rela = stationRelaService.selectOne(new EntityWrapper<StationRela>()
-                .eq("dev_no", station.getDevNo())
+                .eq("agv_sta", station.getDevNo())
+                .orderAsc(Arrays.asList("crn_sta"))
                 .last("OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY"));
 
         if (Objects.isNull(rela)) {
@@ -1617,7 +1625,7 @@
         });
         // 鏇存柊鍏ュ簱閫氱煡妗� ioStatus ===>> Y
         Wrapper<WaitPakin> wrapper = new EntityWrapper<WaitPakin>()
-                .eq("zpallet", pakin.getBarcode());
+                .eq("zpallet", pakin.getZpallet());
         WaitPakin setParam = new WaitPakin();
         setParam.setLocNo(dto.getLocNo());
         setParam.setIoStatus("Y");
@@ -1666,7 +1674,7 @@
         }
         List<LocDetl> locDetls = locDetlService.selectList(new EntityWrapper<LocDetl>()
                 .eq("area_id", basAreas.getId())
-                .eq("loc_id", locCaches.getId()));
+                .eq("loc_no", locCaches.getLocNo()));
         if (Objects.isNull(locDetls) || locDetls.isEmpty()) {
             throw new CoolException("搴撳瓨鏄庣粏涓嶅瓨鍦紒锛�");
         }
@@ -1756,15 +1764,14 @@
                     .orderAsc(Arrays.asList("row1", "bay1", "lev1"))
                     .last("OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY"));
             locMasts.add(locMast);
-
             //绌烘澘鍑哄簱
             generateTask(locMasts, TaskIOType.EMPTY_OUT.type, basDevp, userId);
-
         } else {
-            if (!locMasts.isEmpty()) {
-                //鐢熸垚鍫嗗灈鏈哄嚭搴撲换鍔�
-                generateTask(locMasts, TaskIOType.MERGE_OUT.type, basDevp, userId);
-            }
+            //鐢熸垚鍫嗗灈鏈哄嚭搴撲换鍔�
+            generateTask(locMasts, TaskIOType.MERGE_OUT.type, basDevp, userId);
+//            if (!locMasts.isEmpty()) {
+//
+//            }
         }
     }
 
@@ -1832,7 +1839,7 @@
             }
             // 淇敼搴撲綅鐘舵��:   F.鍦ㄥ簱 ====>>> R.鍑哄簱棰勭害/P.鎷f枡/鐩樼偣/骞舵澘鍑哄簱涓�
             locMast = locMastService.selectById(locMast.getLocNo());
-            if (locMast.getLocSts().equals(LocStsType.LOC_STS_TYPE_F.type)) {
+            if (locMast.getLocSts().equals(LocStsType.LOC_STS_TYPE_F.type) || locMast.getLocSts().equals(LocStsType.LOC_STS_TYPE_D.type)) {
                 locMast.setLocSts(ioType == 101 ? "R" : "P");
                 locMast.setModiUser(userId);
                 locMast.setModiTime(now);
@@ -1900,12 +1907,11 @@
                         .setModel(pakin.getModel())
                         .setAppeTime(new Date())
                         .setModiUser(userId);
-                taskDetls.add(wrkDetl);
+                //淇濆瓨宸ヤ綔妗f槑缁�
+                if (!taskDetlService.insert(wrkDetl)) {
+                    throw new CoolException("淇濆瓨宸ヤ綔妗f槑缁嗗け璐�");
+                }
             });
-            //淇濆瓨宸ヤ綔妗f槑缁�
-            if (!taskDetlService.insertBatch(taskDetls)) {
-                throw new CoolException("淇濆瓨宸ヤ綔妗f槑缁嗗け璐�");
-            }
         }
 
         loc.setLocSts(LocStsType.LOC_STS_TYPE_R.type);
@@ -1940,6 +1946,11 @@
         List<WaitPakin> pakins = waitPakinService.selectList(new EntityWrapper<WaitPakin>().eq("zpallet", barcode));
         if (Objects.isNull(pakins) || pakins.isEmpty()) {
             throw new CoolException("缁勬墭淇℃伅涓嶅瓨鍦紒锛�");
+        }
+
+        List<Task> tasks = taskService.selectList(new EntityWrapper<Task>().eq("barcode", barcode));
+        if (!tasks.isEmpty()) {
+            throw new CoolException("鎵樼洏宸插湪浠诲姟鎵ц涓�..");
         }
         // 鑾峰彇宸ヤ綔鍙�
         int workNo = commonService.getWorkNo(WorkNoType.PICK.type);
@@ -2014,7 +2025,11 @@
 
         // 淇敼鐩爣绔欑偣淇℃伅
         BasStation station = basStationService.selectOne(new EntityWrapper<BasStation>().eq("dev_no", orgSite));
-        if (station.getLocSts().equals("O")) {
+        if (Objects.isNull(station)) {
+            throw new CoolException("绔欑偣涓嶅瓨鍦�!!");
+        }
+
+        if (station.getLocSts().equals(LocStsType.LOC_STS_TYPE_O.type)) {
             station.setLocSts("R"); // S.鍏ュ簱棰勭害
             station.setBarcode(barcode);
             station.setModiTime(new Date());
diff --git a/src/main/java/com/zy/asrs/service/impl/TaskServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/TaskServiceImpl.java
index 396a1ae..ab7b198 100644
--- a/src/main/java/com/zy/asrs/service/impl/TaskServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/TaskServiceImpl.java
@@ -6,6 +6,7 @@
 import com.core.common.DateUtils;
 import com.core.exception.CoolException;
 import com.zy.asrs.entity.*;
+import com.zy.asrs.enums.LocStsType;
 import com.zy.asrs.mapper.TaskMapper;
 import com.zy.asrs.service.*;
 import com.baomidou.mybatisplus.service.impl.ServiceImpl;
@@ -52,8 +53,16 @@
         if (wrkMast.getWrkSts() == 4 || wrkMast.getWrkSts() == 14) {
             throw new CoolException("褰撳墠宸ヤ綔妗e凡瀹屾垚");
         }
+
         // 鍏ュ簱 + 搴撲綅杞Щ
         if (wrkMast.getWrkSts() < 4 || (wrkMast.getWrkSts() > 10 && wrkMast.getIoType() == 11)) {
+            BasStation station = basStationService.selectOne(new EntityWrapper<BasStation>().eq("dev_no", wrkMast.getSourceStaNo()));
+            if (!Objects.isNull(station)) {
+                station.setLocSts(LocStsType.LOC_STS_TYPE_O.type);
+                if (!basStationService.updateById(station)) {
+                    throw new CoolException("绔欑偣鐘舵�佷慨鏀瑰け璐�!!");
+                }
+            }
             wrkMast.setWrkSts(4L);
             // 鍑哄簱
         } else if (wrkMast.getWrkSts() > 10) {

--
Gitblit v1.9.1