skyouc
5 天以前 563ffc29857acd93c7298ddfca700c1fb01b18e0
rsf-open-api/src/main/java/com/vincent/rsf/openApi/service/impl/WmsErpServiceImpl.java
@@ -237,23 +237,17 @@
        log.info("已完成订单上传:{}, 请求参数: {}", rcsUrl, httpEntity.getBody());
        ResponseEntity<String> exchange = restTemplate.exchange(rcsUrl, HttpMethod.POST, httpEntity, String.class);
        log.info("已完成订单上传,请求结果: {}", exchange);
        log.info("已完成订单上传,请求结果: {}", exchange.getBody());
        if (Objects.isNull(exchange.getBody())) {
            throw new CoolException("上传失败!!");
        } else {
            ObjectMapper objectMapper = new ObjectMapper();
            objectMapper.coercionConfigDefaults().setCoercion(CoercionInputShape.EmptyString, CoercionAction.AsEmpty);
            try {
                CommonResponse commonResponse = new CommonResponse();
                ErpCommonResponse result = objectMapper.readValue(exchange.getBody(), ErpCommonResponse.class);
                if (!result.getIsError()) {
                    commonResponse.setCode(200).setMsg(result.getMessage()).setData(result.getData());
                    return commonResponse;
                } else {
                    throw new CoolException("上传失败!!");
                }
            } catch (JsonProcessingException e) {
                throw new CoolException(e.getMessage());
            CommonResponse commonResponse = new CommonResponse();
            ErpCommonResponse result = JSONObject.parseObject(exchange.getBody(), ErpCommonResponse.class);
            if (!result.getIsError()) {
                commonResponse.setCode(200).setMsg(result.getMessage()).setData(result.getData());
                return commonResponse;
            } else {
                throw new CoolException("上传失败!!");
            }
        }
    }
@@ -276,7 +270,6 @@
        headers.add("Content-Type", "application/json");
        headers.add("api-version", "v2.0");
        params.put("", "");
        HttpEntity httpEntity = new HttpEntity(params, headers);
        ResponseEntity<String> exchange = restTemplate.exchange(rcsUrl, HttpMethod.POST, httpEntity, String.class);
        log.info("修改结果: {}", exchange);