Browse Source

Merge branch 'dev' into test

test
zhenghaoyu 2 years ago
parent
commit
e0f95c7f71
  1. 2
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/IMtFactoryDataService.java
  2. 10
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/impl/MtFactoryDataServiceImpl.java

2
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;
}

10
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<ReceiveBodyDTO> 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);

Loading…
Cancel
Save