|  |  | 
 |  |  |      * @author Ryan | 
 |  |  |      * @description 上报质检列表 | 
 |  |  |      * @params [items 列表] | 
 |  |  |      * | 
 |  |  |      * @return boolean | 
 |  |  |      * @time 2025/3/7 09:12 | 
 |  |  |      * 11 | 
 |  |  |      */ | 
 |  |  |     @Override | 
 |  |  |     @Transactional(rollbackFor = Exception.class) | 
 |  |  | 
 |  |  |      * @return com.vincent.rsf.framework.common.R | 
 |  |  |      */ | 
 |  |  |     @Override | 
 |  |  |     public R reportOrders(ReportParams params) { | 
 |  |  |     public R uploadReportOrders(ReportParams params) { | 
 |  |  |         if (Objects.isNull(params)) { | 
 |  |  |             throw new CoolException("参数不能为空!!"); | 
 |  |  |         } | 
 |  |  | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 盘点库存数据修改 | 
 |  |  |      * @param params | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     @Override | 
 |  |  |     @Transactional(rollbackFor = Exception.class) | 
 |  |  |     public R uploadCheckOrder(ReportParams params) { | 
 |  |  |         if (Objects.isNull(params)) { | 
 |  |  |             throw new CoolException("参数不能为空!!"); | 
 |  |  |         } | 
 |  |  |         /**WMS基础配置链接*/ | 
 |  |  |         String rcsUrl = rcsApi.getHost() + ":" + rcsApi.getPort() + RcsConstant.CHECK_LOCITEM_UPDATE; | 
 |  |  |         log.info("盘点库存修改:{}, 请求参数: {}", rcsUrl, JSONObject.toJSONString(params)); | 
 |  |  |         HttpHeaders headers = new HttpHeaders(); | 
 |  |  |         headers.add("Content-Type", "application/json"); | 
 |  |  |         headers.add("api-version", "v2.0"); | 
 |  |  |  | 
 |  |  |         params.setAction("Update").setOrderType("PD_stock"); | 
 |  |  |  | 
 |  |  |         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 R.ok().add(result.getData()); | 
 |  |  |                 } else { | 
 |  |  |                     throw new CoolException("修改失败!!"); | 
 |  |  |                 } | 
 |  |  |             } catch (JsonProcessingException e) { | 
 |  |  |                 throw new CoolException(e.getMessage()); | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  | } |