From 3a129dc7cbc261d6d73521875f94ff75ba88aa84 Mon Sep 17 00:00:00 2001 From: gt-fuwuqi <3272660260@qq.com> Date: 星期二, 11 二月 2025 13:05:54 +0800 Subject: [PATCH] # --- src/main/java/com/zy/asrs/controller/MobileController.java | 146 ++++++++++++++++++++++++++++++------------------ 1 files changed, 92 insertions(+), 54 deletions(-) diff --git a/src/main/java/com/zy/asrs/controller/MobileController.java b/src/main/java/com/zy/asrs/controller/MobileController.java index cc313b9..361f7e6 100644 --- a/src/main/java/com/zy/asrs/controller/MobileController.java +++ b/src/main/java/com/zy/asrs/controller/MobileController.java @@ -13,7 +13,6 @@ import com.zy.asrs.entity.result.MobileAdjustResult; import com.zy.asrs.mapper.ManLocDetlMapper; import com.zy.asrs.service.*; -import com.zy.common.constant.ApiInterfaceConstant; import com.zy.common.model.WrkDto; import com.zy.common.service.CommonService; import com.zy.common.utils.HttpHandler; @@ -63,9 +62,25 @@ @Autowired private CommonService commonService; + +// @PostMapping("/agv/start") +// @ManagerAuth +// public R pdaStockCheck(@RequestBody StockCheckParam param){ +// +// +// +// } + + @PostMapping("/agv/start") @ManagerAuth public R pdaAgvStart(@RequestBody Map<String,Object> map){ + + if (Cools.isEmpty(map.get("sta"))) { + return R.parse("鏆傚瓨浣嶄笉鑳戒负绌�"); + } else if (Cools.isEmpty(map.get("inSta"))) { + return R.parse("鍏ュ簱绔欑偣涓嶈兘涓虹┖"); + } // HashMap<String, String> map1 = new HashMap<>(); // map1.put("agv0001","sta0001"); // String sta = map.get("sta").toString(); @@ -77,52 +92,23 @@ // return R.ok(); // } String sta = (String) map.get("sta"); // 鏆傚瓨浣� - String inSts = "1040"; // 鍏ュ簱绔欑偣 + String inSta = String.valueOf(map.get("inSta")); // 鍏ュ簱绔欑偣 - ForwardAGVTaskParam forwardAGVTaskParam = new ForwardAGVTaskParam(); - forwardAGVTaskParam.setReqCode("test"); - forwardAGVTaskParam.setTaskTyp("GT3"); - forwardAGVTaskParam.setCtnrTyp("2"); - forwardAGVTaskParam.setPriority("1"); - List<ForwardAGVTaskParam.PositionCodePaths> positionCodePathsList = new ArrayList<>(); - positionCodePathsList.add(new ForwardAGVTaskParam.PositionCodePaths(sta,"05")); - positionCodePathsList.add(new ForwardAGVTaskParam.PositionCodePaths(inSts,"05")); - forwardAGVTaskParam.setPositionCodePath(positionCodePathsList); + return mobileService.inLocCallAgv(sta, inSta); - String body = JSON.toJSONString(forwardAGVTaskParam); - String response = ""; - boolean success = false; - try { - response = new HttpHandler.Builder() - .setUri(ApiInterfaceConstant.AGV_IP) - .setPath(ApiInterfaceConstant.AGV_CALL_IN_PATH) - .setJson(body) - .build() - .doPost(); - JSONObject jsonObject = JSON.parseObject(response); - if (jsonObject.getInteger("code").equals(0)) { - success = true; - } else { - log.error("鍏ュ簱鍛煎彨agv澶辫触锛侊紒锛乽rl锛歿}锛況equest锛歿}锛況esponse锛歿}", ApiInterfaceConstant.AGV_IP+ApiInterfaceConstant.AGV_CALL_IN_PATH, body, response); - } - } catch (Exception e) { - log.error("鍏ュ簱鍛煎彨agv寮傚父", e); - } finally { - try { - // 淇濆瓨鎺ュ彛鏃ュ織 -// apiLogService.save( -// "璇锋眰浠撳偍MES鐩樼偣鍗曚笂鎶ユ帴鍙�", -// MesConstant.MES_CC_IP_PORT + MesConstant.MES_CC_SB_URL, -// null, -// "127.0.0.1", -// JSON.toJSONString(collect), -// response, -// success -// ); - } catch (Exception e) { log.error("", e); } + } + + @PostMapping("/agv/unbind") + @ManagerAuth + public R pdaAgvUnbind(@RequestBody Map<String,Object> map){ + + String site = (String) map.get("site"); // 鏆傚瓨浣� + + if (Cools.isEmpty(site)) { + return R.parse("鏆傚瓨浣嶄笉鑳戒负绌�"); } - return R.error(); + return mobileService.unbind(site); } private void getAgvTaskParam(ForwardAGVTaskParam agvTaskCreateParam,String agv,String sta){ @@ -293,8 +279,44 @@ @RequestMapping("/comb/auth") @ManagerAuth(memo = "缁勬墭") public R comb(@RequestBody CombParam combParam){ - mobileService.comb(combParam, getUserId()); - return R.ok("缁勬墭鎴愬姛"); + if (Cools.isEmpty(combParam.getBarcode(), combParam.getCombMats())) { + throw new CoolException(BaseRes.PARAM); + } + WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>() + .eq("barcode", combParam.getBarcode()) + .eq("io_type", 104) + .in("wrk_sts", 14,105)); + if (Cools.isEmpty(wrkMast)) { + mobileService.comb(combParam, getUserId()); + return R.ok("缁勬墭鎴愬姛"); + }else { + mobileService.mergeComb(combParam, getUserId()); + return R.ok("骞舵澘鎴愬姛"); + } + + + } + + @RequestMapping("/pingKu/Shelves/auth") + @ManagerAuth(memo = "骞冲簱涓婃灦") + public R pingKuShelves(@RequestBody CombParam combParam){ + if (Cools.isEmpty(combParam.getLocno(), combParam.getCombMats())) { + throw new CoolException(BaseRes.PARAM); + } + mobileService.pingKuShelves(combParam, getUserId()); + + return R.ok(); + } + + @RequestMapping("/pingKu/unShelves/auth") + @ManagerAuth(memo = "骞冲簱涓嬫灦") + public R pingKuUnShelves(@RequestBody CombParam combParam){ + if (Cools.isEmpty(combParam.getLocno(), combParam.getCombMats())) { + throw new CoolException(BaseRes.PARAM); + } + mobileService.pingKuUnShelves(combParam, getUserId()); + + return R.ok(); } @RequestMapping("/pack/get/auth") @@ -544,6 +566,13 @@ return R.ok("鐩樼偣鎴愬姛"); } + @RequestMapping("/pda/adjust/auth") + @ManagerAuth(memo = "pda鐩樼偣") + public R pdaAdjust(@RequestBody pdaAdjustParam param){ + mobileService.pdaAdjust(param,getUserId()); + return R.ok("鐩樼偣鎴愬姛"); + } + @PostMapping("/order/out/pakout/auth") @ManagerAuth(memo = "璁㈠崟鍑哄簱") public synchronized R pakoutByOrder(@RequestBody JSONObject param) { @@ -554,22 +583,31 @@ return R.ok("鍑哄簱鎴愬姛"); } + @GetMapping("/checkOut/submit/auth") + @ManagerAuth(memo = "鐩樼偣涓婁紶") + public R CheckOutUploadERP(@RequestParam String orderId){ + mobileService.inventoryUpload(orderId); + return R.ok("鐩樼偣鎴愬姛"); + } + + @RequestMapping("/ddd/ddd") @ManagerAuth() public R ddd() { int w = 64; for (int i = 17; i <= 37; i++) { - for (int j = 1;j<=14;j++){ - LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("row1", i).eq("bay1", j).eq("lev1", 1)); - LocMast locMast2 = locMastService.selectOne(new EntityWrapper<LocMast>().eq("row1", i).eq("bay1", j).eq("lev1", 2)); - LocMast locMast3 = locMastService.selectOne(new EntityWrapper<LocMast>().eq("row1", i).eq("bay1", j).eq("lev1", 3)); + for (int j = 1;j<=3;j++){ +// LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("row1", i).eq("bay1", 7).eq("lev1", j)); + LocMast locMast2 = locMastService.selectOne(new EntityWrapper<LocMast>().eq("row1", i).eq("bay1", 12).eq("lev1", j)); + LocMast locMast3 = locMastService.selectOne(new EntityWrapper<LocMast>().eq("row1", i).eq("bay1", 14).eq("lev1", j)); // LocMast locMast4 = locMastService.selectOne(new EntityWrapper<LocMast>().eq("row1", 26).eq("bay1", i).eq("lev1", 1)); - if (locMast.getGro1() == 999){ - continue; - } +// if (locMast.getGro1() == 999){ +// continue; +// } // locMast.setGro1(w); - locMast2.setGro1(locMast.getGro1()+100); - locMast3.setGro1(locMast.getGro1()+200); +// locMast.setGro1(locMast.getGro1()+1000); + locMast2.setGro1(locMast2.getGro1()+10000); + locMast3.setGro1(locMast3.getGro1()+2000); // locMast4.setGro1(w); // locMastService.updateById(locMast); locMastService.updateById(locMast2); -- Gitblit v1.9.1