| | |
| | | try { |
| | | CommonResponse result = objectMapper.readValue(exchange.getBody(), CommonResponse.class); |
| | | if (result.getCode() == 200) { |
| | | return R.ok(); |
| | | return R.ok(result.getMsg()).add(result.getData()); |
| | | } else { |
| | | return R.error(result.getMsg()); |
| | | // throw new CoolException("任务执行状态上报失败!!"); |
| | |
| | | try { |
| | | CommonResponse result = objectMapper.readValue(exchange.getBody(), CommonResponse.class); |
| | | if (result.getCode() == 200) { |
| | | return R.ok(); |
| | | return R.ok(result.getMsg()).add(result.getData()); |
| | | } else { |
| | | return R.error(result.getMsg()); |
| | | // throw new CoolException("任务执行状态上报失败!!"); |
| | |
| | | public R wcsReassignLoc(WcsReassignLocParam params) { |
| | | String createInTask = wmsApi.getHost() + ":" + wmsApi.getPort() + WmsConstant.WCS_REASSIGN_LOC; |
| | | /**WMS基础配置链接*/ |
| | | log.info("WCS任务上报通知,请求地址: {}, 请求参数: {}", createInTask , JSONObject.toJSONString(params)); |
| | | log.info("WCS申请任务重新分配入库,请求地址: {}, 请求参数: {}", createInTask , JSONObject.toJSONString(params)); |
| | | HttpHeaders headers = new HttpHeaders(); |
| | | headers.add("Content-Type", "application/json"); |
| | | headers.add("api-version", "v2.0"); |
| | | HttpEntity httpEntity = new HttpEntity(params, headers); |
| | | ResponseEntity<String> exchange = restTemplate.exchange(createInTask, HttpMethod.POST, httpEntity, String.class); |
| | | log.info("WCS任务上报通知,响应结果: {}", exchange); |
| | | log.info("WCS申请任务重新分配入库,响应结果: {}", exchange); |
| | | if (Objects.isNull(exchange.getBody())) { |
| | | return R.error().add("WCS任务上报通知告知wms返回参数为空!!!"); |
| | | return R.error().add("WCS申请任务重新分配入库告知wms返回参数为空!!!"); |
| | | } else { |
| | | ObjectMapper objectMapper = new ObjectMapper(); |
| | | objectMapper.coercionConfigDefaults() |
| | |
| | | try { |
| | | CommonResponse result = objectMapper.readValue(exchange.getBody(), CommonResponse.class); |
| | | if (result.getCode() == 200) { |
| | | return R.ok(); |
| | | return R.ok(result.getMsg()).add(result.getData()); |
| | | } else { |
| | | return R.error(result.getMsg()); |
| | | // throw new CoolException("任务执行状态上报失败!!"); |
| | |
| | | public R wcsChangeLoc(WcsChangeLocParam params) { |
| | | String createInTask = wmsApi.getHost() + ":" + wmsApi.getPort() + WmsConstant.WCS_CHANGE_LOC; |
| | | /**WMS基础配置链接*/ |
| | | log.info("WCS任务上报通知,请求地址: {}, 请求参数: {}", createInTask , JSONObject.toJSONString(params)); |
| | | log.info("WCS申请在库库位更换库位,请求地址: {}, 请求参数: {}", createInTask , JSONObject.toJSONString(params)); |
| | | HttpHeaders headers = new HttpHeaders(); |
| | | headers.add("Content-Type", "application/json"); |
| | | headers.add("api-version", "v2.0"); |
| | | HttpEntity httpEntity = new HttpEntity(params, headers); |
| | | ResponseEntity<String> exchange = restTemplate.exchange(createInTask, HttpMethod.POST, httpEntity, String.class); |
| | | log.info("WCS任务上报通知,响应结果: {}", exchange); |
| | | log.info("WCS申请在库库位更换库位,响应结果: {}", exchange); |
| | | if (Objects.isNull(exchange.getBody())) { |
| | | return R.error().add("WCS任务上报通知告知wms返回参数为空!!!"); |
| | | return R.error().add("WCS申请在库库位更换库位告知wms返回参数为空!!!"); |
| | | } else { |
| | | ObjectMapper objectMapper = new ObjectMapper(); |
| | | objectMapper.coercionConfigDefaults() |
| | |
| | | try { |
| | | CommonResponse result = objectMapper.readValue(exchange.getBody(), CommonResponse.class); |
| | | if (result.getCode() == 200) { |
| | | return R.ok(); |
| | | return R.ok(result.getMsg()).add(result.getData()); |
| | | } else { |
| | | return R.error(result.getMsg()); |
| | | // throw new CoolException("任务执行状态上报失败!!"); |