1
zhang
4 天以前 1b6c512c4b251e7131a9b78e6f4ecb3a7d0a31a3
1
1个文件已修改
18 ■■■■ 已修改文件
zy-acs-cv/src/main/java/com/zy/asrs/service/impl/CtuMainServiceImpl.java 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-cv/src/main/java/com/zy/asrs/service/impl/CtuMainServiceImpl.java
@@ -39,6 +39,14 @@
    @Value("${ctu.sendTask}")
    private String sendTask;
    private String code ="code";
    private String dataCode ="data";
    private Integer codeValue =200;
    private Integer timeout = 1200;
    @Transactional
    public boolean sendTask(OpenBusSubmitParam openBusSubmitParam) {
@@ -47,12 +55,12 @@
            response = new HttpHandler.Builder()
                    .setUri(ctuUrl)
                    .setPath(sendTask)
                    .setTimeout(1200, TimeUnit.SECONDS)
                    .setTimeout(timeout, TimeUnit.SECONDS)
                    .setJson(JSON.toJSONString(openBusSubmitParam))
                    .build()
                    .doPost();
            JSONObject jsonObject = JSON.parseObject(response);
            if (jsonObject.getInteger("code").equals(200)) {
            if (jsonObject.getInteger(code).equals(codeValue)) {
                log.info("下发任务返回数据:{}", response);
                return true;
            }
@@ -78,14 +86,14 @@
            response = new HttpHandler.Builder()
                    .setUri(ctuUrl)
                    .setPath(station)
                    .setTimeout(1200, TimeUnit.SECONDS)
                    .setTimeout(timeout, TimeUnit.SECONDS)
                    .setJson(JSON.toJSONString(stationRequestParam))
                    .build()
                    .doPost();
            JSONObject jsonObject = JSON.parseObject(response);
            if (jsonObject.getInteger("code").equals(200)) {
            if (jsonObject.getInteger(code).equals(codeValue)) {
                log.info("RCS返回数据:{}", response);
                JSONArray data = jsonObject.getJSONArray("data");
                JSONArray data = jsonObject.getJSONArray(dataCode);
                List<StationStatus> stationStatuses = JSONArray.parseArray(data.toString(), StationStatus.class);
                for (StationStatus object : stationStatuses) {
                    if (object.getStaNo().equals(staNo + "")) {