From c8559a2186ac04ef3e0760f7d48ab3d74fbcb105 Mon Sep 17 00:00:00 2001
From: skyouc <creaycat@gmail.com>
Date: 星期五, 12 十二月 2025 16:24:00 +0800
Subject: [PATCH] no message

---
 src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java |   50 ++++++++++++++++++--------------------------------
 1 files changed, 18 insertions(+), 32 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 3e1ca03..afefe07 100644
--- a/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
@@ -1332,23 +1332,15 @@
     @Override
     @Transactional(rollbackFor = Exception.class)
     public R OutCallAgv(AgvCallParams params, Long userId) {
-
-        BasStation station = basStationService.selectOne(new EntityWrapper<BasStation>()
-                .eq("loc_sts", LocStsType.LOC_STS_TYPE_O.type)
-                .eq("dev_no", params.getTarSite()));
-        if (Objects.isNull(station)) {
-            throw new CoolException("璇锋鏌ョ珯鐐逛俊鎭紒");
+        BasAreas basAreas = basAreasService.selectOne(new EntityWrapper<BasAreas>().eq("whs_type_id", LocAreaType.LOC_AREA_TYPE_IN_CACHE.type));
+        if (Objects.isNull(basAreas)) {
+            throw new CoolException("搴撳尯涓嶅瓨鍦紒锛�");
         }
-
-        /** 鑾峰彇鍏ュ簱鏈�鏃╃殑涓�鏉℃暟鎹� **/
+        /**鑾峰彇鍏ュ簱鏈�鏃╃殑涓�鏉℃暟鎹�**/
         List<LocCache> locCaches = locCacheService.selectList(new EntityWrapper<LocCache>()
                 .eq("loc_sts", LocStsType.LOC_STS_TYPE_F.type)
+                .eq("area_id", basAreas.getId())
                 .eq("frozen", 0)
-                .in("loc_no", new EntityWrapper<LocDetl>()
-                        .setSqlSelect("DISTINCT loc_no")
-                        .in("matnr", new EntityWrapper<Mat>()
-                                .setSqlSelect("matnr")
-                                .eq("tag_id", station.getCtnType())))
                 .orderDesc(Arrays.asList("sort", "first_time")));
 
         if (locCaches.isEmpty()) {
@@ -1356,13 +1348,8 @@
         }
 
         for (LocCache locCache : locCaches) {
-            // 鑾峰彇缂撳瓨鍖轰俊鎭�
-            BasAreas basAreas = basAreasService.selectOne(
-                    new EntityWrapper<BasAreas>().eq("whs_type_id", LocAreaType.LOC_AREA_TYPE_IN_CACHE.type));
-            if (Objects.isNull(basAreas)) {
-                throw new CoolException("搴撳尯涓嶅瓨鍦紒锛�");
-            }
-
+            //鑾峰彇缂撳瓨鍖轰俊鎭�
+//            BasAreas basAreas = basAreasService.selectOne(new EntityWrapper<BasAreas>().eq("whs_type_id", LocAreaType.LOC_AREA_TYPE_IN_CACHE.type));
             List<LocDetl> locDetls = locDetlService.selectList(new EntityWrapper<LocDetl>()
                     .eq("area_id", basAreas.getId())
                     .eq("loc_no", locCache.getLocNo()));
@@ -1382,19 +1369,18 @@
 
             Mat mat = matList.stream().findFirst().get();
 
-//            BasStation station = basStationService.selectOne(new EntityWrapper<BasStation>()
-//                    .eq("loc_sts", LocStsType.LOC_STS_TYPE_O.type)
-//                    .eq("ctn_type", mat.getTagId())
-//                    .eq("dev_no", params.getTarSite()));
-
-            if (mat.getTagId() != station.getCtnType().longValue()){
+            BasStation station = basStationService.selectOne(new EntityWrapper<BasStation>()
+                    .eq("loc_sts", LocStsType.LOC_STS_TYPE_O.type)
+                    .eq("ctn_type", mat.getTagId())
+                    .eq("dev_no", params.getTarSite()));
+            if (Objects.isNull(station)) {
                 continue;
             }
 
-            /** 鐢熸垚缂撳瓨鍖哄嚭搴撲换鍔� */
+            /**鐢熸垚缂撳瓨鍖哄嚭搴撲换鍔�*/
             generateCacheOutTask(station, locCache, userId);
 
-            /** 鐢熸垚绔嬪簱鍑哄簱浠诲姟 */
+            /**鐢熸垚绔嬪簱鍑哄簱浠诲姟*/
             generateCRNOutTask(station, locCache, userId);
 
             return R.ok();
@@ -1695,7 +1681,7 @@
                 throw new CoolException("鏄庣粏鍐呭涓嶅瓨鍦紒锛�");
             }
 
-            Double v = stationDetl.getAnfme() - stationDetl.getWorkQty();
+            Double v = Math.round((stationDetl.getAnfme() - stationDetl.getWorkQty()) * 10000) / 10000.0;
             if (detlDto.getAnfme().compareTo(v) > 0) {
                 throw new CoolException("缁勬墭涓婇檺涓猴細" + stationDetl.getAnfme() + ", 宸茬粍鎵橈細" + stationDetl.getWorkQty() + ", 杩樺彲缁勬墭锛�" + v);
             }
@@ -1726,7 +1712,7 @@
                 throw new CoolException("淇濆瓨鍏ュ簱閫氱煡妗eけ璐�");
             }
 
-            Double v1 = stationDetl.getWorkQty() + detlDto.getAnfme();
+            Double v1 = Math.round((stationDetl.getWorkQty() + detlDto.getAnfme()) * 10000) / 10000.0;
             stationDetl.setWorkQty(v1);
 
             if (!basStationDetlService.updateById(stationDetl)) {
@@ -1738,7 +1724,6 @@
                     throw new CoolException("鍘熷鏁版嵁绉婚櫎澶辫触锛�");
                 }
             }
-
         }
     }
 
@@ -1839,11 +1824,13 @@
                 Mat mat = matService.selectByMatnr(combMat.getMatnr());
                 BeanUtils.copyProperties(mat, basStationDetl);
                 basStationDetl
+                        .setId(null)
                         .setOrderNo(orderPakin.getOrderNo())
                         .setDevNo(basStation.getDevNo())
                         .setBarcode(params.getTarBarcode())
                         .setZpallet(params.getTarBarcode())
                         .setBatch(combMat.getBatch())
+                        .setSuppCode(combMat.getStandby1())
                         .setStandby1(combMat.getStandby1())
                         .setAnfme(combMat.getWorkQty().doubleValue());
                 if (!basStationDetlService.insert(basStationDetl)) {
@@ -1856,7 +1843,6 @@
                 if (!basStationDetlService.updateById(basStationDetl)) {
                     throw new CoolException("鏇存柊鏄庣粏鏁版嵁澶辫触");
                 }
-
             }
         }
         if (basStation.getLocSts().equals(LocStsType.LOC_STS_TYPE_D.type)

--
Gitblit v1.9.1