From dcdb2b8cf1b0c5d05900acec72c80caf3bb5616c Mon Sep 17 00:00:00 2001 From: pang.jiabao <pang_jiabao@163.com> Date: 星期五, 07 三月 2025 10:14:34 +0800 Subject: [PATCH] 兼容ctu库容器条码 --- zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/MobileController.java | 184 ++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 178 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 cb1c1dc..7d1fd6f 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,12 +6,20 @@ 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.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.param.BatchMergeOrdersParam; +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.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.UserLoginService; @@ -30,7 +38,6 @@ @Value("${super.pwd}") private String superPwd; - @Autowired private UserService userService; @Autowired @@ -39,7 +46,18 @@ private OrderService orderService; @Autowired private MobileService mobileService; + @Autowired + private WaitPakinService waitPakinService; + /** + * 鑾峰彇鐢ㄦ埛鏈烘瀯 + * @return + */ + @GetMapping("/current/host") + public R getUserHost() { + List<Host> hosts = mobileService.getHosts(); + return R.ok(hosts); + } /** * 鍏ュ簱鍗曟嵁--鎵爜鑾峰彇璁㈠崟鏄庣粏鍒楄〃 @@ -48,21 +66,68 @@ */ @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 (!(order.getOrderType() == 1)) { - return R.error("闈炲叆搴撹鍗曪紝 涓嶅彲鎿嶄綔锛侊紒"); + if (Objects.isNull(order)) { + 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("鎵樼洏鐮佷笉鑳戒负绌猴紒锛�"); + } + + String str = code.trim(); + // 纭繚瀛楃涓查暱搴﹁嚦灏戜负8 + if (str.length() >= 8) { + code = str.substring(str.length() - 8); + } else { + return R.error("瀛楃涓查暱搴﹀皬浜�8锛屾棤娉曡幏鍙栧悗8浣�"); + } + + List<WaitPakin> waitPakins = waitPakinService.list(new LambdaQueryWrapper<WaitPakin>().eq(WaitPakin::getBarcode, code)); + + return R.ok(waitPakins); } @@ -123,6 +188,14 @@ return R.error("璁㈠崟鏄庣粏涓嶈兘涓虹┖锛侊紒"); } + String str = ordersParam.getMergeNo().trim(); + // 纭繚瀛楃涓查暱搴﹁嚦灏戜负8 + if (str.length() >= 8) { + ordersParam.setMergeNo(str.substring(str.length() - 8)); + } else { + return R.error("瀛楃涓查暱搴﹀皬浜�8锛屾棤娉曡幏鍙栧悗8浣�"); + } + boolean result = mobileService.batchMergeOrders(ordersParam); if (result) { return R.ok("缁勬墭鎴愬姛锛侊紒"); @@ -130,4 +203,103 @@ return R.ok("缁勬墭澶辫触锛侊紒"); } } + + /** + * 鑾峰彇鎷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("缁戝畾澶辫触锛侊紒"); + } + } + + + /** + * 鑾峰彇鍙戣揣璁㈠崟鏄庣粏 + * @return + */ + @PostMapping("/shipping/order/detl") + public R getOrderDetl(@RequestBody Map<String, Object> params) { + if (Objects.isNull(params)) { + throw new CoolException("鍙傛暟涓嶈兘涓虹┖锛侊紒"); + } + return mobileService.selectShippingDetl(params); + } + + /** + * 纭鍙戣揣鍗曟槑缁� + * @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