From 072ea383bec76a6cb1a23119a2420d0bd7ec7cb6 Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Fri, 30 Jun 2023 15:17:27 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E5=A4=8D=E6=8E=A8=E9=80=81=E6=A2=A6?= =?UTF-8?q?=E5=A4=A9=E6=95=B0=E6=8D=AEbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../factory/mt/service/IMtFactoryDataService.java | 2 +- .../mt/service/impl/MtFactoryDataServiceImpl.java | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/IMtFactoryDataService.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/IMtFactoryDataService.java index c6a0255ef..96ee00b7e 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/IMtFactoryDataService.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/IMtFactoryDataService.java @@ -18,5 +18,5 @@ public interface IMtFactoryDataService { R handleStatusData(OrderStatusDTO orderStatusDTO) throws JsonProcessingException; - R sendReceiveInfo(ReceiveInfoDTO receiveInfoDTO); + R sendReceiveInfo(ReceiveInfoDTO receiveInfoDTO) throws JsonProcessingException; } diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/impl/MtFactoryDataServiceImpl.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/impl/MtFactoryDataServiceImpl.java index 312a7215a..17927a9e6 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/impl/MtFactoryDataServiceImpl.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/impl/MtFactoryDataServiceImpl.java @@ -324,7 +324,7 @@ public class MtFactoryDataServiceImpl implements IMtFactoryDataService { @Transactional @Override - public R sendReceiveInfo(ReceiveInfoDTO receiveInfoDTO) { + public R sendReceiveInfo(ReceiveInfoDTO receiveInfoDTO) throws JsonProcessingException { log.info("###########sendReceiveInfo: 处理签收图片数据开始"); Integer newDistributionContactId = receiveInfoDTO.getNewDistributionContactId(); List receiveBodyList = receiveInfoDTO.getReceiveBodyList(); @@ -387,12 +387,16 @@ public class MtFactoryDataServiceImpl implements IMtFactoryDataService { //签收图片数据存入头部数据 mtReceiveDTO.setReceiveImagesList(mtReceiveImagesDTOList); + ObjectMapper objectMapper = new ObjectMapper(); + + String s = objectMapper.writeValueAsString(mtReceiveDTO); + //推送数据到梦天 //先获取token String token = getMtToken(); //请求参数 - logger.info("##############sendReceiveInfo: 推送包件状态请求参数 {}",mtReceiveDTO); + logger.info("##############sendReceiveInfo: 推送包件状态请求参数 {}",s); //处理逻辑 String result = HttpRequest.post(mtFactoryProperties.getUrl()+"/Auth/text2") @@ -401,7 +405,7 @@ public class MtFactoryDataServiceImpl implements IMtFactoryDataService { .header("USERID",mtFactoryProperties.getUserid()) .header("USERPWD",mtFactoryProperties.getUserpwd()) .header("Content-Type","application/json") - .body(JSONObject.toJSONString(mtReceiveDTO)).timeout(5 * 1000) + .body(s).timeout(5 * 1000) .execute().body(); logger.info("##############sendReceiveInfo: 推送包件状态返回参数 {}",result);