From e046dba174365eb8934ee1e4206f09821145e876 Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期四, 21 八月 2025 13:23:22 +0800
Subject: [PATCH] no message

---
 zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/LocMapController.java |   60 ++++++++++++++++++++++++++++++++++++++++++++----------------
 1 files changed, 44 insertions(+), 16 deletions(-)

diff --git a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/LocMapController.java b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/LocMapController.java
index 39d8811..d1c3c19 100644
--- a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/LocMapController.java
+++ b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/LocMapController.java
@@ -8,6 +8,7 @@
 import com.zy.asrs.framework.common.R;
 import com.zy.asrs.wms.asrs.entity.Loc;
 import com.zy.asrs.wms.asrs.entity.enums.LocStsType;
+import com.zy.asrs.wms.asrs.entity.param.LocMastInitParam;
 import com.zy.asrs.wms.asrs.service.LocService;
 import com.zy.asrs.wms.common.annotation.OperationLog;
 import com.zy.asrs.wms.common.domain.BaseParam;
@@ -112,6 +113,9 @@
     @GetMapping("/locMap/getData/{lev}/auth")
     public R getMapData(@PathVariable("lev") Integer lev) {
         LocMap locMap = locMapService.getOne(new LambdaQueryWrapper<LocMap>().eq(LocMap::getMapLev, lev));
+        if (locMap == null) {
+            return R.ok();
+        }
         //瑙f瀽json鍦板浘鏁版嵁
         List<ArrayList> arrayLists = JSON.parseArray(locMap.getData(), ArrayList.class);
 
@@ -150,32 +154,56 @@
     @OperationLog("鍒濆鍖栧簱浣�")
     @PostMapping("/locMap/init")
     @Transactional
-    public R init(@RequestBody LocMap locMap) {
-        Integer mapLev = locMap.getMapLev();
+    public R init(@RequestBody LocMastInitParam param) {
+//        Integer mapLev = locMap.getMapLev();
 
-        locService.remove(new LambdaQueryWrapper<Loc>().eq(Loc::getLev1, mapLev));
+//        locService.remove(new LambdaQueryWrapper<Loc>().eq(Loc::getLev1, mapLev));
 
         //瑙f瀽json鍦板浘鏁版嵁
-        List<ArrayList> arrayLists = JSON.parseArray(locMap.getData(), ArrayList.class);
-        int rowIdx = 0;
-        for (ArrayList row : arrayLists) {
-            int bayIdx = 0;
-            for (Object bay : row) {
-                JSONObject data = JSON.parseObject(JSON.toJSONString(bay));
-                if (data.getInteger("value") == 0) {
+//        List<ArrayList> arrayLists = JSON.parseArray(locMap.getData(), ArrayList.class);
+//        int rowIdx = 0;
+//        for (ArrayList row : arrayLists) {
+//            int bayIdx = 0;
+//            for (Object bay : row) {
+//                JSONObject data = JSON.parseObject(JSON.toJSONString(bay));
+//                if (data.getInteger("value") == 0) {
+//                    Loc loc = new Loc();
+//                    loc.setRow1(rowIdx);
+//                    loc.setBay1(bayIdx);
+//                    loc.setLev1(mapLev);
+//                    loc.setLocStsId(LocStsType.O.val());
+//                    loc.setLocNo(Utils.getPlatLocNo(rowIdx, bayIdx, mapLev));
+//                    locService.save(loc);
+//                }
+//                bayIdx++;
+//            }
+//            rowIdx++;
+//        }
+
+        List<Loc> list = new ArrayList<>();
+        Integer chanl = 0; //榛樿绗竴宸烽亾
+        for (int r = param.getStartRow(); r <= param.getEndRow(); r++) {
+//            if (r % param.getChannel() == 1) {
+//                chanl ++;
+//            }
+            for (int b = param.getStartBay(); b <= param.getEndBay(); b++) {
+                for (int l = param.getStartLev(); l <= param.getEndLev(); l++) {
+                    // 鑾峰彇搴撲綅鍙�
+                    String locNo = Utils.getPlatLocNo(r, b, l);
                     Loc loc = new Loc();
-                    loc.setRow1(rowIdx);
-                    loc.setBay1(bayIdx);
-                    loc.setLev1(mapLev);
+                    loc.setRow1(r);
+                    loc.setBay1(b);
+                    loc.setLev1(l);
                     loc.setLocStsId(LocStsType.O.val());
-                    loc.setLocNo(Utils.getLocNo(rowIdx, bayIdx, mapLev));
+                    loc.setLocNo(locNo);
                     locService.save(loc);
+                    list.add(loc);
                 }
-                bayIdx++;
             }
-            rowIdx++;
         }
 
+
+
         return R.ok("娣诲姞鎴愬姛");
     }
 

--
Gitblit v1.9.1