| | |
| | | OpenBusSubmitParam openBusSubmitParam = new OpenBusSubmitParam(); |
| | | openBusSubmitParam.setBatch(DateUtils.convert(new Date())); |
| | | List<TaskDto> taskList = new ArrayList<>(); |
| | | TaskDto taskDto = new TaskDto(); |
| | | Random rand = new Random(); |
| | | TaskDto taskDto = new TaskDto(); |
| | | taskDto.setSeqNum("SSX-CK" + rand.nextInt() * 10000); |
| | | taskDto.setOriLoc(getFLoc("1001", "16")); |
| | | taskDto.setDestSta("1001"); |
| | | taskDto.setPriority(123); |
| | | taskList.add(taskDto); |
| | | String fLoc = getFLoc("1001", "16"); |
| | | if (fLoc == taskDto.getOriLoc()) { |
| | | fLoc = getFLoc("1001", "16"); |
| | | } |
| | | taskDto = new TaskDto(); |
| | | taskDto.setSeqNum("SSX-CK" + rand.nextInt() * 10000); |
| | | taskDto.setOriLoc(fLoc); |
| | | taskDto.setDestSta("1001"); |
| | | taskDto.setPriority(123); |
| | | taskList.add(taskDto); |
| | |
| | | log.info("下发任务返回数据:{}", response); |
| | | return true; |
| | | } else { |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", ctuUrl + sendTask, JSON.toJSONString(openBusSubmitParam), response); |
| | | //log.error("请求接口失败!!!url:{};request:{};response:{}", ctuUrl + sendTask, JSON.toJSONString(openBusSubmitParam), response); |
| | | throw new CoolException("调用下发任务接口报错"); |
| | | } |
| | | } catch (Exception e) { |
| | |
| | | JSONObject loc = JSON.parseObject(jsonObject.getString("data")); |
| | | return loc.getString("locNo"); |
| | | } else { |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", ctuUrl + sendTask, JSON.toJSONString(data), response); |
| | | //log.error("请求接口失败!!!url:{};request:{};response:{}", ctuUrl + sendTask, JSON.toJSONString(data), response); |
| | | throw new CoolException("调用下发任务接口报错"); |
| | | } |
| | | } catch (Exception e) { |