| | |
| | | if (!agvLockMastService.updateById(locMast)) { |
| | | throw new CoolException("主库位修改失败"); |
| | | } else { |
| | | try { |
| | | if (locMast.getLocSts().equals("O")) { |
| | | HashMap<String, String> data = new HashMap<>(); |
| | | data.put("reqCode", System.currentTimeMillis() + ""); |
| | | data.put("podCode", barcode); |
| | | data.put("positionCode", locMast.getLocNo()); |
| | | data.put("indBind", "0"); |
| | | String response = ""; |
| | | boolean success = false; |
| | | int code = 0; |
| | | try { |
| | | response = new HttpHandler.Builder() |
| | | .setUri(url) |
| | | .setPath(locStsUrl) |
| | | .setTimeout(30, TimeUnit.SECONDS) |
| | | .setJson(JSONObject.toJSONString(data)) |
| | | .build() |
| | | .doPost(); |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | code = Integer.parseInt(jsonObject.get("code").toString()); |
| | | if (code != 0) { |
| | | log.info("库位解绑AGV接口调用失败,返回信息:" + response); |
| | | } else { |
| | | success = true; |
| | | } |
| | | } catch (Exception e) { |
| | | throw new CoolException("调用AGV响应错误"); |
| | | } finally { |
| | | apiLogService.save( |
| | | "货架与位置解绑", |
| | | url + locStsUrl, |
| | | null, |
| | | "127.0.0.1", |
| | | JSON.toJSONString(data), |
| | | response, |
| | | success |
| | | ); |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | |
| | | } |
| | | // try { |
| | | // if (locMast.getLocSts().equals("O")) { |
| | | // HashMap<String, String> data = new HashMap<>(); |
| | | // data.put("reqCode", System.currentTimeMillis() + ""); |
| | | // data.put("podCode", barcode); |
| | | // data.put("positionCode", locMast.getLocNo()); |
| | | // data.put("indBind", "0"); |
| | | // String response = ""; |
| | | // boolean success = false; |
| | | // int code = 0; |
| | | // try { |
| | | // response = new HttpHandler.Builder() |
| | | // .setUri(url) |
| | | // .setPath(locStsUrl) |
| | | // .setTimeout(30, TimeUnit.SECONDS) |
| | | // .setJson(JSONObject.toJSONString(data)) |
| | | // .build() |
| | | // .doPost(); |
| | | // JSONObject jsonObject = JSON.parseObject(response); |
| | | // code = Integer.parseInt(jsonObject.get("code").toString()); |
| | | // if (code != 0) { |
| | | // log.info("库位解绑AGV接口调用失败,返回信息:" + response); |
| | | // } else { |
| | | // success = true; |
| | | // } |
| | | // } catch (Exception e) { |
| | | // throw new CoolException("调用AGV响应错误"); |
| | | // } finally { |
| | | // apiLogService.save( |
| | | // "货架与位置解绑", |
| | | // url + locStsUrl, |
| | | // null, |
| | | // "127.0.0.1", |
| | | // JSON.toJSONString(data), |
| | | // response, |
| | | // success |
| | | // ); |
| | | // } |
| | | // } |
| | | // } catch (Exception e) { |
| | | // |
| | | // } |
| | | } |
| | | return R.ok(); |
| | | } |
| | |
| | | |
| | | private void executeLocType6() { |
| | | // 查询 二厂的的半成品箱壳类型的空货架 |
| | | List<AgvLocMast> agvLocMasts = agvLocMastService.selectList(new EntityWrapper<AgvLocMast>().eq("loc_sts", "D").eq("loc_type1", 6).eq("floor", 2).orderBy("bay1",false)); |
| | | List<AgvLocMast> agvLocMasts = agvLocMastService.selectList(new EntityWrapper<AgvLocMast>().eq("loc_sts", "D").eq("loc_type1", 6).in("floor", 2,3).orderBy("bay1",false)); |
| | | if (agvLocMasts.isEmpty()) { |
| | | return; |
| | | } |
| | |
| | | AgvLocMast locMast; |
| | | if (Integer.parseInt(barcode.substring(0, 2)) == 31) { |
| | | //检索库位,选择合适的库位 |
| | | locMast = agvCommonService.getLocByLocRule(6, 2, 1); |
| | | locMast = agvCommonService.getLocByLocRule(6, agvWrkMast.getCrnNo(), 1); |
| | | } else { |
| | | //检索库位,选择合适的库位 |
| | | locMast = agvCommonService.getLocNo(3, agvWrkMast.getCrnNo(), false, true); |
| | |
| | | |
| | | /** |
| | | * 查询库位 |
| | | * |
| | | * @param type |
| | | * @param factory |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 查询库位 |
| | | * |
| | | * @param type |
| | | * @param floor |
| | | * @return |
| | |
| | | } |
| | | List<AgvLocMast> agvLocMasts = agvLocMastService.selectList(wrapper); |
| | | for (AgvLocMast agvLocMast : agvLocMasts) { |
| | | if (floor == 2) { |
| | | if (agvLocMast.getFloor() == 3) { |
| | | continue; |
| | | } |
| | | } else if (floor == 3) { |
| | | if (agvLocMast.getFloor() == 2) { |
| | | continue; |
| | | } |
| | | } |
| | | AgvLocMast agvLocMast1 = agvLocMastService.selectOne(new EntityWrapper<AgvLocMast>().eq("loc_no", agvLocMast.getLocNo())); |
| | | if (agvLocMast1.getLocSts().equals("O")) { |
| | | return agvLocMast1; |