|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 删除单据 | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * @param params | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 物料信息修改 | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * @param params | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public CommonResponse syncMatnrs(ErpMatnrParms params) { | 
|---|
|  |  |  | if (Objects.isNull(params.getMatnr()) ) { | 
|---|
|  |  |  | if (Objects.isNull(params.getMatnr())) { | 
|---|
|  |  |  | throw new CoolException("物料编码不能为空!!"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (Objects.isNull(params.getMaktx())) { | 
|---|
|  |  |  | 
|---|
|  |  |  | * @version 1.0 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public CommonResponse reportCheck(ErpOpParams params) { | 
|---|
|  |  |  | return null; | 
|---|
|  |  |  | public CommonResponse reportCheck(Map<String, Object> params) { | 
|---|
|  |  |  | if (Objects.isNull(params)) { | 
|---|
|  |  |  | throw new CoolException("参数不能为空!!"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | /**WMS基础配置链接*/ | 
|---|
|  |  |  | String rcsUrl = erpApi.getHost() + ":" + erpApi.getPort() + WmsConstant.REPORT_ORDER_CALLBACK; | 
|---|
|  |  |  | log.info("物料修改:{}, 请求参数: {}", rcsUrl, JSONObject.toJSONString(params)); | 
|---|
|  |  |  | HttpHeaders headers = new HttpHeaders(); | 
|---|
|  |  |  | 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); | 
|---|
|  |  |  | if (Objects.isNull(exchange.getBody())) { | 
|---|
|  |  |  | throw new CoolException("修改失败!!"); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | ObjectMapper objectMapper = new ObjectMapper(); | 
|---|
|  |  |  | objectMapper.coercionConfigDefaults().setCoercion(CoercionInputShape.EmptyString, CoercionAction.AsEmpty); | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | CommonResponse result = objectMapper.readValue(exchange.getBody(), CommonResponse.class); | 
|---|
|  |  |  | if (result.getCode() == 200) { | 
|---|
|  |  |  | return result; | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | throw new CoolException("修改失败!!"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } catch (JsonProcessingException e) { | 
|---|
|  |  |  | throw new CoolException(e.getMessage()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|