| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.zy.acs.common.utils.News; |
| | | import com.zy.acs.conveyor.common.utils.HttpHandler; |
| | | import com.zy.acs.conveyor.controller.requestParam.StationRequestParam; |
| | | import com.zy.acs.conveyor.controller.vo.OpenBusSubmitParam; |
| | |
| | | @Value("${ctu.station}") |
| | | private String station; |
| | | |
| | | @Value("${ctu.checkTakeComplete}") |
| | | private String checkTakeComplete; |
| | | |
| | | @Value("${ctu.sendTask}") |
| | | private String sendTask; |
| | | |
| | |
| | | |
| | | private Integer codeValue = 200; |
| | | |
| | | private Integer timeout = 1200; |
| | | private Integer timeout = 10; |
| | | |
| | | |
| | | @Transactional |
| | |
| | | try { |
| | | response = new HttpHandler.Builder() |
| | | .setUri(ctuUrl) |
| | | .setPath(station) |
| | | .setPath(checkTakeComplete) |
| | | .setTimeout(timeout, TimeUnit.SECONDS) |
| | | .setJson(JSON.toJSONString(stationRequestParam)) |
| | | .build() |
| | | .doPost(); |
| | | News.info("RCS返回数据:{}", response); |
| | | 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); |
| | | log.error("调用下发任务接口报错,参数:{},响应内容:{}", seqNum, response); |
| | | //throw new CoolException("调用下发任务接口报错,响应码:" + jsonObject.getInteger(code)); |
| | | } |
| | | } catch (CoolException e) { |
| | | log.error("调用站点状态接口异常", e); |
| | | //throw e; |
| | | } catch (Exception e) { |
| | | //log.error("检查站点状态失败,站点编号:{}", staNo, e); |
| | | log.error("检查站点状态失败,任务编号:{},{}", seqNum,e.getMessage()); |
| | | } |
| | | return false; |
| | | } |