1
zhang
1 天以前 10ac21082bbbe92dabecdda1a98fe4539f746037
zy-asc-conveyor/src/main/java/com/zy/acs/conveyor/service/impl/CtuMainServiceImpl.java
@@ -119,5 +119,40 @@
        return null;
    }
    /**
     * 检查站点状态
     *
     * @param seqNum 任务号
     * @return 站点是否可通行
     */
    public Boolean checkComplete(String seqNum) {
        StationRequestParam stationRequestParam = new StationRequestParam();
        stationRequestParam.setSeqNum(seqNum);
        String response = "";
        try {
            response = new HttpHandler.Builder()
                    .setUri(ctuUrl)
                    .setPath(station)
                    .setTimeout(timeout, TimeUnit.SECONDS)
                    .setJson(JSON.toJSONString(stationRequestParam))
                    .build()
                    .doPost();
            JSONObject jsonObject = JSON.parseObject(response);
            if (jsonObject.getInteger(code).equals(codeValue)) {
                log.info("RCS返回数据:{}", response);
                if (jsonObject.getBoolean(dataCode)) {
                    return true;
                }
            } else {
                log.error("调用下发任务接口报错,响应码:{},响应内容:{}", jsonObject.getInteger(code), response);
                //throw new CoolException("调用下发任务接口报错,响应码:" + jsonObject.getInteger(code));
            }
        } catch (CoolException e) {
            log.error("调用站点状态接口异常", e);
            //throw e;
        } catch (Exception e) {
            //log.error("检查站点状态失败,站点编号:{}", staNo, e);
        }
        return false;
    }
}