#
vincentlu
7 天以前 e9e8c6915e0f46d4ee9d4b0c8e0d7da77e35bba5
zy-acs-manager/src/main/java/com/zy/acs/manager/core/integrate/conveyor/SiemensConveyorStationService.java
@@ -33,20 +33,22 @@
    @PostConstruct
    public void init() {
        int timeoutSeconds = conveyorProperties.getTimeout() / 1000;
        this.http = HttpGo.builder()
                .connectTimeout(Duration.ofSeconds(8))
                .readTimeout(Duration.ofSeconds(15))
                .connectTimeout(Duration.ofSeconds(timeoutSeconds))
                .readTimeout(Duration.ofSeconds(timeoutSeconds))
//                .defaultHeader("User-Agent", "HttpGo/1.0")
                // .trustAllSsl(true) // ONLY if you really need it (self-signed internal)
//                .trustAllSsl(true) // ONLY if you really need it (self-signed internal)
                .build();
    }
    @Override
    public boolean allowAgvWork(Sta sta, Task task, Segment seg, StaReserveType type) {
        final String staNo = sta.getStaNo();
        // url
        String url = this.buildUrl("/station/query");
        String url = this.http.buildUrl(conveyorProperties.getHost(), conveyorProperties.getPort(), "/cv/station/query");
        // headers
        Map<String, String> headers = new HashMap<>();
        // params
@@ -104,14 +106,6 @@
        }
        // ok
        return true;
    }
    private String buildUrl(String path) {
        String host = conveyorProperties.getHost();
        Integer port = conveyorProperties.getPort();
        String p = (path == null) ? "" : (path.startsWith("/") ? path : ("/" + path));
        return "http://" + host + ":" + port + p;
    }
    private HttpResult<List<ConveyorStaDto>> postForResult(String url