| | |
| | | } |
| | | |
| | | } |
| | | // 小车入库搬运命令 ---------------------------------------------------- |
| | | if (!Cools.isEmpty(param.getCombMats()) && !Cools.isEmpty(param.getAgvSite())) { |
| | | BasAgv idleAgv = basAgvService.selectIdleAgv(); |
| | | AgvCommand command = new AgvCommand(); |
| | | command.setAgvId(idleAgv.getAgvId()); |
| | | command.setInterCode(basAgvService.getAgvWorkNo()); |
| | | command.setBeginLoc(String.valueOf(param.getAgvSite())); |
| | | command.setEndLoc("1088"); |
| | | log.info(JSON.toJSONString(command)); |
| | | String result; |
| | | try { |
| | | result = new HttpHandler.Builder() |
| | | .setUri(agvUrl + "/api/interfaceTask/SendTaskByThirdParty") |
| | | .setJson(JSON.toJSONString(command)) |
| | | .build() |
| | | .doPost(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | throw new CoolException("访问AGV接口失败"); |
| | | } |
| | | AgvResult agvResult = JSON.parseObject(result, AgvResult.class); |
| | | log.info(JSON.toJSONString(agvResult)); |
| | | if (!agvResult.getResult()) { |
| | | log.error("agv命令发送失败[agvId={}],错误信息={}", command.getAgvId(), agvResult.getExplain()); |
| | | throw new CoolException("agv命令发送失败[agvId=" + command.getAgvId() + "],错误信息=" + agvResult.getExplain()); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | oninput="if(value.length>8)value=value.slice(0,8)" placeholder="扫码 / 输入" autocomplete="off"> |
| | | </div> |
| | | <div class="layui-form"> |
| | | <div style="margin: 5px 1px 5px 5px; display: inline-block"> |
| | | <div style="margin: 5px 1px 5px 5px; display: none"> |
| | | <button id="mat-btn" type="button" class="layui-btn layui-btn-normal" onclick="getMat()"><i class="layui-icon">+</i>提取</button> |
| | | </div> |
| | | <div style="display: inline-block"> |
| | | 工作区 |
| | | <!-- 工作区 --> |
| | | <div class="layui-inline" style="width: 100px; margin-left: 10px"> |
| | | <select id="devpSelect"> |
| | |
| | | // 获取工作区 |
| | | function getDevp(){ |
| | | $.ajax({ |
| | | url: baseUrl+"/available/put/site", |
| | | url: baseUrl+"/agv/put/site", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'POST', |
| | | async: false, |
| | |
| | | tips("请选择工作区", true); |
| | | return; |
| | | } |
| | | alert("小车关联组托完成(功能还未实现)"); |
| | | // $.ajax({ |
| | | // url: baseUrl + "/mobile/comb/auth/batch", |
| | | // headers: {'token': localStorage.getItem('token')}, |
| | | // data: JSON.stringify({ |
| | | // barcode: barcode, |
| | | // combMats: matData, |
| | | // }), |
| | | // contentType: 'application/json;charset=UTF-8', |
| | | // method: 'POST', |
| | | // async: false, |
| | | // success: function (res) { |
| | | // if (res.code === 200) { |
| | | // reset(); |
| | | // tips("组托成功") |
| | | // } else if (res.code === 403) { |
| | | // top.location.href = baseUrl + "/pda"; |
| | | // } else { |
| | | // tips(res.msg, true) |
| | | // } |
| | | // } |
| | | // }) |
| | | $.ajax({ |
| | | url: baseUrl + "/mobile/comb/auth/batch", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify({ |
| | | barcode: barcode, |
| | | combMats: matData, |
| | | agvSite: devp |
| | | }), |
| | | contentType: 'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | reset(); |
| | | tips("组托成功") |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/pda"; |
| | | } else { |
| | | tips(res.msg, true) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | /** |