From 2a24c69b830d9dc97a8673f5f69418e9f95f3e1b Mon Sep 17 00:00:00 2001 From: skyouc Date: 星期一, 07 七月 2025 10:43:33 +0800 Subject: [PATCH] no message --- zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/MobileController.java | 73 ++++++++++++++++++++++++++++++------ 1 files changed, 60 insertions(+), 13 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 8401402..db6218b 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,32 +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.*; @@ -72,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()); @@ -117,6 +119,13 @@ if (StringUtil.isNullOrEmpty(code)) { return R.error("鎵樼洏鐮佷笉鑳戒负绌猴紒锛�"); } + + 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); @@ -145,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); @@ -168,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())) { @@ -180,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("缁勬墭鎴愬姛锛侊紒"); @@ -240,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("璁㈠崟缂栧彿涓嶈兘涓虹┖锛侊紒"); @@ -272,6 +297,31 @@ 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 @@ -283,7 +333,4 @@ } return mobileService.confirmShippingDetl(params); } - - - } -- Gitblit v1.9.1