| | |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 1007入库 |
| | | * |
| | | * @param mark |
| | | */ |
| | | public synchronized void autoIn(Integer mark) { |
| | | SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, 1); |
| | | StaProtocol staProtocol = devpThread.getStation().get(1007); |
| | |
| | | taskDto.setPriority(123); |
| | | taskList.add(taskDto); |
| | | openBusSubmitParam.setTaskList(taskList); |
| | | sendTask(openBusSubmitParam, staProtocol); |
| | | if (sendTask(openBusSubmitParam, staProtocol)) { |
| | | staProtocol.setWorkNo(0); |
| | | staProtocol.setStaNo((short) 0); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, 1, new Task(3, staProtocol)); |
| | | log.info("下发给rcs成功:{},{}", 0, 0); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | @Transactional |
| | | public void sendTask(OpenBusSubmitParam openBusSubmitParam, StaProtocol staProtocol) { |
| | | public boolean sendTask(OpenBusSubmitParam openBusSubmitParam, StaProtocol staProtocol) { |
| | | String response = ""; |
| | | try { |
| | | response = new HttpHandler.Builder() |
| | |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | if (jsonObject.getInteger("code").equals(200)) { |
| | | log.info("下发任务返回数据:{}", response); |
| | | return true; |
| | | } else { |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", ctuUrl + sendTask, JSON.toJSONString(openBusSubmitParam), response); |
| | | throw new CoolException("调用下发任务接口报错"); |
| | |
| | | } catch (Exception e) { |
| | | log.error("fail", e); |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | @Transactional |