|
|
|
@ -2,13 +2,17 @@ package com.logpm.factory.snm.service.impl;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.http.HttpRequest; |
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
|
import com.alibaba.nacos.shaded.com.google.gson.Gson; |
|
|
|
|
import com.alibaba.nacos.shaded.com.google.gson.GsonBuilder; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
|
import com.logpm.factory.props.PanFactoryProperties; |
|
|
|
|
import com.logpm.factory.snm.dto.OrderInfoDTO; |
|
|
|
|
import com.logpm.factory.snm.dto.OrderStatusDTO; |
|
|
|
|
import com.logpm.factory.snm.entity.PanFactoryOrder; |
|
|
|
|
import com.logpm.factory.snm.entity.PanOrderStatusLog; |
|
|
|
|
import com.logpm.factory.snm.service.*; |
|
|
|
|
import com.logpm.factory.snm.service.IPanFactoryDataService; |
|
|
|
|
import com.logpm.factory.snm.service.IPanFactoryOrderService; |
|
|
|
|
import com.logpm.factory.snm.service.IPanOrderStatusLogService; |
|
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
|
import org.slf4j.Logger; |
|
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
@ -105,20 +109,24 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
|
|
|
|
|
|
|
|
|
|
//拼接参数
|
|
|
|
|
Map<String,Object> map = new HashMap<>(); |
|
|
|
|
map.put("payload",JSONObject.toJSONString(orderStatusDTO)); |
|
|
|
|
// map.put("payload",JSONObject.toJSONString(orderStatusDTO));
|
|
|
|
|
// map.put("payload", CommonUtil.formatJson(orderStatusDTO));
|
|
|
|
|
map.put("payload", JSONObject.toJSONString(orderStatusDTO)); |
|
|
|
|
|
|
|
|
|
Gson gson = new GsonBuilder().setPrettyPrinting().create(); |
|
|
|
|
String s = gson.toJson(map); |
|
|
|
|
|
|
|
|
|
//先获取token
|
|
|
|
|
String panToken = getPanToken(); |
|
|
|
|
|
|
|
|
|
//请求参数
|
|
|
|
|
logger.info("##############handleStatusData: 推送包件状态请求参数 {}",map); |
|
|
|
|
logger.info("##############handleStatusData: 推送包件状态请求参数 {}",s); |
|
|
|
|
//处理逻辑
|
|
|
|
|
String result = HttpRequest.post(panFactoryProperties.getUrl()+"/hitf/v1/rest/invoke?namespace=HZERO&serverCode=OPEN&interfaceCode=HUITONG_RECEIVE") |
|
|
|
|
.header("Authorization","Bearer "+panToken) |
|
|
|
|
// .header("Content-Type","application/json")
|
|
|
|
|
.form(map).timeout(5 * 1000) |
|
|
|
|
.execute() |
|
|
|
|
.body(); |
|
|
|
|
.header("Content-Type","application/json") |
|
|
|
|
.body(s).timeout(5 * 1000) |
|
|
|
|
.execute().body(); |
|
|
|
|
|
|
|
|
|
logger.info("##############handleStatusData: 推送包件状态返回参数 {}",result); |
|
|
|
|
|
|
|
|
|