From 7125d7c2be53db25b8a11d42abc8730b36ef61bc Mon Sep 17 00:00:00 2001 From: yangyang Date: 星期二, 15 七月 2025 13:23:30 +0800 Subject: [PATCH] 任务工作档生成播种明细 --- zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/MobileController.java | 127 ++++++++++++++++++++++++++++++++++++++---- 1 files changed, 115 insertions(+), 12 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 2e8116c..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 @@ -1,9 +1,6 @@ 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; @@ -11,31 +8,29 @@ import com.zy.asrs.framework.common.R; import com.zy.asrs.framework.exception.CoolException; import com.zy.asrs.wms.asrs.entity.CacheSite; -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.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.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; 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.*; @@ -71,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()); @@ -84,6 +87,7 @@ } /** + * 骞冲簱涓婃灦 * PDA鎵爜鍏ュ簱 * 1. 缁戝畾搴撲綅鍙蜂笌鎷栫洏鐮� * 2. 搴撲綅缃负鍦ㄥ簱鐘舵�� @@ -107,7 +111,7 @@ } /** - * 鑾峰彇鎷栫爜鐩樼粦瀹氬晢鍝� + * 鑾峰彇鎷栫洏鐮佺粦瀹氬晢鍝� * @return */ @GetMapping("/barcode/matnr/{code}") @@ -115,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); } @@ -143,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); @@ -166,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())) { @@ -178,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("缁勬墭鎴愬姛锛侊紒"); @@ -238,7 +265,7 @@ throw new CoolException("璇锋眰鍙傛暟涓嶈兘涓虹┖锛侊紒"); } if (Objects.isNull(param.get("barcode"))) { - throw new CoolException("瀹瑰櫒缂栫爜涓嶈兘涓虹┖"); + throw new CoolException("鎾澧欏鍣ㄧ紪鐮佷笉鑳戒负绌�"); } if (Objects.isNull(param.get("orderNo"))) { throw new CoolException("璁㈠崟缂栧彿涓嶈兘涓虹┖锛侊紒"); @@ -257,4 +284,80 @@ } } + + @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