From c6c9b7d3baa822765768c110304d27623f946286 Mon Sep 17 00:00:00 2001
From: pjb <123456>
Date: 星期二, 15 七月 2025 14:29:09 +0800
Subject: [PATCH] `1`
---
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/MobileController.java | 194 +++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 188 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 cc07a96..bfa9762 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
@@ -6,10 +6,14 @@
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.framework.exception.CoolException;
+import com.zy.asrs.wms.asrs.entity.CacheSite;
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.dto.ShippingOrderDetlDto;
+import com.zy.asrs.wms.asrs.entity.enums.OrderType;
import com.zy.asrs.wms.asrs.entity.param.BatchMergeOrdersParam;
import com.zy.asrs.wms.asrs.entity.param.PakinOnShelvesParams;
import com.zy.asrs.wms.asrs.service.MobileService;
@@ -19,15 +23,14 @@
import com.zy.asrs.wms.system.entity.Host;
import com.zy.asrs.wms.system.entity.User;
import com.zy.asrs.wms.system.entity.UserLogin;
-import com.zy.asrs.wms.system.service.HostService;
import com.zy.asrs.wms.system.service.UserLoginService;
import com.zy.asrs.wms.system.service.UserService;
import io.jsonwebtoken.lang.Collections;
import io.netty.util.internal.StringUtil;
+import io.swagger.annotations.ApiOperation;
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.*;
@@ -63,12 +66,20 @@
* @param barcode
* @return
*/
+ @ApiOperation("鍏ュ簱鍗曟嵁--鎵爜鑾峰彇璁㈠崟鏄庣粏鍒楄〃")
@PostMapping("/mat/auth")
public R getProductForBarcode(@RequestBody Map<String, String> barcode) {
+ if (Objects.isNull(barcode)) {
+ return R.error("鍙傛暟涓嶈兘涓虹┖锛侊紒");
+ }
if (StringUtil.isNullOrEmpty(barcode.get("barcode"))) {
return R.error("鏉$爜涓嶈兘涓虹┖锛侊紒");
}
Order order = orderService.selectByBarcode(barcode.get("barcode"));
+
+ if (Objects.isNull(order)) {
+ return R.error("璁㈠崟涓嶅瓨鍦紒");
+ }
List<OrderInfoDto> orders = orderService.getDetlForOrderId(order.getId());
@@ -76,6 +87,7 @@
}
/**
+ * 骞冲簱涓婃灦
* PDA鎵爜鍏ュ簱
* 1. 缁戝畾搴撲綅鍙蜂笌鎷栫洏鐮�
* 2. 搴撲綅缃负鍦ㄥ簱鐘舵��
@@ -99,7 +111,7 @@
}
/**
- * 鑾峰彇鎷栫爜鐩樼粦瀹氬晢鍝�
+ * 鑾峰彇鎷栫洏鐮佺粦瀹氬晢鍝�
* @return
*/
@GetMapping("/barcode/matnr/{code}")
@@ -107,7 +119,14 @@
if (StringUtil.isNullOrEmpty(code)) {
return R.error("鎵樼洏鐮佷笉鑳戒负绌猴紒锛�");
}
- List<WaitPakin> waitPakins = waitPakinService.list(new LambdaQueryWrapper<WaitPakin>().eq(WaitPakin::getBarcode, code).eq(WaitPakin::getIoStatus, 0));
+
+ String str = code.trim();
+ // CUT搴撴潯鐮乀寮�澶达紝鎴彇鍚�10浣�
+ if (str.charAt(0) == 'T') {
+ code = str.substring(str.length() - 10);
+ }
+
+ List<WaitPakin> waitPakins = waitPakinService.list(new LambdaQueryWrapper<WaitPakin>().eq(WaitPakin::getBarcode, code));
return R.ok(waitPakins);
}
@@ -135,7 +154,7 @@
return R.parse(CodeRes.USER_10003);
}
String system = null;//鐧婚檰绯荤粺
- if (wms) {
+ if (Objects.isNull(wms) || wms) {
system = String.valueOf(LoginSystemType.WMS);
}else {
system = String.valueOf(LoginSystemType.WCS);
@@ -158,6 +177,12 @@
}
+ /**
+ * @author Ryan
+ * @date 2025/6/25
+ * @description: 缁勬墭
+ * @version 1.0
+ */
@PostMapping("/comb/auth")
public R combMats(@RequestBody BatchMergeOrdersParam ordersParam) {
if (StringUtil.isNullOrEmpty(ordersParam.getOrderNo())) {
@@ -170,6 +195,16 @@
return R.error("璁㈠崟鏄庣粏涓嶈兘涓虹┖锛侊紒");
}
+ String str = ordersParam.getMergeNo().trim();
+ // CTU搴撴潯鐮乀寮�澶达紝鎴彇鍚�10浣�
+ if (str.charAt(0) == 'T') {
+ ordersParam.setMergeNo(str.substring(str.length() - 10));
+ }
+ if (str.startsWith("PK")) {
+ ordersParam.setInType(OrderType.PK_IN_ORDER.id);
+ } else {
+ ordersParam.setInType(OrderType.UTC_OUT_ORDER.id);
+ }
boolean result = mobileService.batchMergeOrders(ordersParam);
if (result) {
return R.ok("缁勬墭鎴愬姛锛侊紒");
@@ -178,4 +213,151 @@
}
}
+ /**
+ * 鑾峰彇鎷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("鍑哄簱鎴愬姛锛侊紒");
+ }
+
+
+ /**
+ * 鑾峰彇鎾浣�
+ * @return
+ */
+ @GetMapping("/pick/seed/locs")
+ public R seedLocs() {
+ List<CacheSite> sites = mobileService.getSeedLocs();
+ return R.ok(sites);
+ }
+
+ /**
+ * 璁㈠崟缁戝畾绔欑偣
+ * @param param
+ * @return
+ */
+ @PostMapping("/pick/seed/bind")
+ public R bindLoc(@RequestBody Map<String, Object> param) {
+ if (Objects.isNull(param)) {
+ throw new CoolException("璇锋眰鍙傛暟涓嶈兘涓虹┖锛侊紒");
+ }
+ if (Objects.isNull(param.get("barcode"))) {
+ throw new CoolException("鎾澧欏鍣ㄧ紪鐮佷笉鑳戒负绌�");
+ }
+ if (Objects.isNull(param.get("orderNo"))) {
+ throw new CoolException("璁㈠崟缂栧彿涓嶈兘涓虹┖锛侊紒");
+ }
+ if (Objects.isNull(param.get("siteNo"))) {
+ throw new CoolException("鎾绔欑偣涓嶈兘涓虹┖锛侊紒");
+ }
+ if (Objects.isNull(param.get("type"))) {
+ throw new CoolException("鍙傛暟绫诲瀷涓嶈兘涓虹┖锛侊紒");
+ }
+ boolean result = mobileService.bindOrderBySite(param);
+ if (result) {
+ return R.ok("缁戝畾鎴愬姛锛侊紒");
+ } else {
+ return R.error("缁戝畾澶辫触锛侊紒");
+ }
+ }
+
+
+ @ApiOperation("鑾峰彇搴撲綅璇︾粏")
+ @GetMapping("/flat/transfer/{barcode}")
+ public R getDetlsBycode(@PathVariable String barcode) {
+ if (Objects.isNull(barcode)) {
+ return R.error("鍙傛暟涓嶈兘涓虹┖锛侊紒");
+ }
+ return R.ok().add(mobileService.getDetlsByCode(barcode));
+ }
+
+
+ @ApiOperation("骞虫澘杞Щ")
+ @PostMapping("/locs/transfer")
+ public R changeFlatBarcode(@RequestBody Map<String, String> param) {
+ if (Objects.isNull(param)) {
+ return R.error("鍙傛暟涓嶈兘涓虹┖锛侊紒");
+ }
+ if (Objects.isNull(param.get("barcode"))) {
+ return R.error("婧愬簱浣嶄笉鑳戒负绌猴紒锛�");
+ }
+ if (Objects.isNull(param.get("tarCode"))) {
+ return R.error("鐩爣搴撲綅涓嶈兘涓虹┖锛侊紒");
+ }
+
+ return mobileService.transferLocs(param);
+ }
+
+ /**
+ * 鑾峰彇鍙戣揣璁㈠崟鏄庣粏
+ * @return
+ */
+ @PostMapping("/shipping/order/detl")
+ public R getOrderDetl(@RequestBody Map<String, Object> params) {
+ if (Objects.isNull(params)) {
+ throw new CoolException("鍙傛暟涓嶈兘涓虹┖锛侊紒");
+ }
+ return mobileService.selectShippingDetl(params);
+ }
+
+
+ /**
+ * @author Ryan
+ * @date 2025/6/28
+ * @description: 鑾峰彇鎺ㄨ崘搴撲綅
+ * @version 1.0
+ */
+ @GetMapping("/recommend/locs")
+ public R getRecommend() {
+ return mobileService.getRecommendLocs();
+ }
+
+
+ /**
+ * @author Ryan
+ * @date 2025/6/28
+ * @description: 鏌ヨ鐗╂枡淇℃伅
+ * @version 1.0
+ */
+ @GetMapping("/mats/search/{matnr}")
+ public R getMats(@PathVariable String matnr) {
+ return mobileService.getMatsByCode(matnr);
+ }
+
+
+ /**
+ * 纭鍙戣揣鍗曟槑缁�
+ * @return
+ */
+ @PostMapping("/shipping/confirm")
+ public R confirmShipping(@RequestBody List<ShippingOrderDetlDto> params) {
+ if (params.isEmpty()) {
+ throw new CoolException("鍙戣揣鍗曟槑缁嗕笉鑳戒负绌猴紒锛�");
+ }
+
+ return mobileService.confirmShippingDetl(params);
+ }
}
--
Gitblit v1.9.1