From d1511d2d12b4223882fcfdabd3ba6b59c038edc4 Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期三, 08 一月 2025 21:29:46 +0800
Subject: [PATCH] #拣货单功能开发

---
 zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/MobileController.java |   88 +++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 82 insertions(+), 6 deletions(-)

diff --git a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/MobileController.java b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/MobileController.java
index afc4f30..00bfa11 100644
--- a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/MobileController.java
+++ b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/MobileController.java
@@ -1,16 +1,26 @@
 package com.zy.asrs.wms.asrs.controller;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.zy.asrs.common.domain.CodeRes;
 import com.zy.asrs.common.domain.enums.LoginSystemType;
 import com.zy.asrs.framework.annotations.ManagerAuth;
 import com.zy.asrs.framework.common.Cools;
 import com.zy.asrs.framework.common.R;
+import com.zy.asrs.wms.asrs.entity.Loc;
 import com.zy.asrs.wms.asrs.entity.Order;
+import com.zy.asrs.wms.asrs.entity.WaitPakin;
 import com.zy.asrs.wms.asrs.entity.dto.OrderInfoDto;
+import com.zy.asrs.wms.asrs.entity.dto.PickSheetDetlDto;
 import com.zy.asrs.wms.asrs.entity.param.BatchMergeOrdersParam;
+import com.zy.asrs.wms.asrs.entity.param.PageRequest;
+import com.zy.asrs.wms.asrs.entity.param.PakinOnShelvesParams;
 import com.zy.asrs.wms.asrs.service.MobileService;
 import com.zy.asrs.wms.asrs.service.OrderService;
+import com.zy.asrs.wms.asrs.service.WaitPakinService;
+import com.zy.asrs.wms.common.domain.BaseParam;
 import com.zy.asrs.wms.system.controller.BaseController;
 import com.zy.asrs.wms.system.entity.Host;
 import com.zy.asrs.wms.system.entity.User;
@@ -23,6 +33,7 @@
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.web.bind.annotation.*;
+import sun.nio.ch.IOStatus;
 
 import java.util.*;
 
@@ -40,6 +51,8 @@
     private OrderService orderService;
     @Autowired
     private MobileService mobileService;
+    @Autowired
+    private WaitPakinService waitPakinService;
 
     /**
      * 鑾峰彇鐢ㄦ埛鏈烘瀯
@@ -63,16 +76,46 @@
         }
         Order order =  orderService.selectByBarcode(barcode.get("barcode"));
 
-        if (!(order.getOrderType() == 1)) {
-            return R.error("闈炲叆搴撹鍗曪紝 涓嶅彲鎿嶄綔锛侊紒");
-        }
-//        if (order.getOrderSettle() > 2) {
-//            return R.error("鍗曟嵁褰撳墠鐘舵�佷笉鍙仛鍏ュ簱鎿嶄綔锛侊紒");
-//        }
         List<OrderInfoDto> orders = orderService.getDetlForOrderId(order.getId());
 
         return R.ok(orders);
+    }
 
+    /**
+     * PDA鎵爜鍏ュ簱
+     * 1. 缁戝畾搴撲綅鍙蜂笌鎷栫洏鐮�
+     * 2. 搴撲綅缃负鍦ㄥ簱鐘舵��
+     * @return
+     */
+    @PostMapping("/matnr/in/barcode")
+    public R pakinToStock(@RequestBody PakinOnShelvesParams shelvesParams) {
+        if (StringUtil.isNullOrEmpty(shelvesParams.getBarcode())) {
+            return R.error("鎷栫洏鐮佷笉鑳戒负绌猴紒锛�");
+        }
+        if (StringUtil.isNullOrEmpty(shelvesParams.getLoc())) {
+            return R.error("搴撲綅涓嶈兘涓虹┖锛侊紒");
+        }
+        //TODO 缁戝畾搴撲綅锛屾坊鍔犲簱浣嶆槑缁�
+        if (mobileService.pakinToStock(shelvesParams)) {
+            return R.ok("鍏ュ簱鎴愬姛锛侊紒");
+        } else {
+            return R.error("鍏ュ簱澶辫触锛侊紒");
+        }
+
+    }
+
+    /**
+     * 鑾峰彇鎷栫爜鐩樼粦瀹氬晢鍝�
+     * @return
+     */
+    @GetMapping("/barcode/matnr/{code}")
+    public R getAllGoods(@PathVariable String code) {
+        if (StringUtil.isNullOrEmpty(code)) {
+            return R.error("鎵樼洏鐮佷笉鑳戒负绌猴紒锛�");
+        }
+        List<WaitPakin> waitPakins = waitPakinService.list(new LambdaQueryWrapper<WaitPakin>().eq(WaitPakin::getBarcode, code).eq(WaitPakin::getIoStatus, 0));
+
+        return R.ok(waitPakins);
     }
 
 
@@ -141,4 +184,37 @@
         }
     }
 
+    /**
+     * 鑾峰彇鎷h揣鏄庣粏
+     * @return
+     */
+    @GetMapping("/pick/detl/{code}")
+    public R pickDetlByPickNo(@PathVariable String code) {
+        if (StringUtil.isNullOrEmpty(code)) {
+            return R.error("鎷h揣鍗曟嵁缂栫爜涓嶈兘涓虹┖锛侊紒");
+        }
+        PickSheetDetlDto pickSheetDetls =  mobileService.outFlatSheet(code);
+
+        return R.ok(pickSheetDetls);
+    }
+
+    /**
+     * 鎷h揣鍗曠‘璁ゅ嚭搴�
+     * @param code
+     * @return
+     */
+    @GetMapping("/pick/confirm/{code}")
+    public R confirmOutFlatSheet(@PathVariable String code) {
+        if (StringUtil.isNullOrEmpty(code)) {
+            return R.error("鎷h揣鍗曟嵁缂栫爜涓嶈兘涓虹┖锛侊紒");
+        }
+        if (!mobileService.confirmFlatSheet(code)) {
+            return R.error("鍑哄簱澶辫触锛侊紒");
+        }
+        return R.ok("鍑哄簱鎴愬姛锛侊紒");
+    }
+
+
+
+
 }

--
Gitblit v1.9.1