|
@@ -1,6 +1,7 @@
|
|
package com.fs.express.impl;
|
|
package com.fs.express.impl;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
import com.fs.express.IExpressService;
|
|
import com.fs.express.IExpressService;
|
|
import com.fs.express.dto.ExpressPushRespDTO;
|
|
import com.fs.express.dto.ExpressPushRespDTO;
|
|
import com.fs.express.enums.TaskStatusEnum;
|
|
import com.fs.express.enums.TaskStatusEnum;
|
|
@@ -10,6 +11,7 @@ import com.fs.store.domain.FsOrderExpressPush;
|
|
import com.fs.store.mapper.FsOrderExpressPushMapper;
|
|
import com.fs.store.mapper.FsOrderExpressPushMapper;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.net.URLDecoder;
|
|
import java.net.URLDecoder;
|
|
@@ -27,6 +29,8 @@ public class ExpressServiceImpl implements IExpressService {
|
|
@Autowired
|
|
@Autowired
|
|
private KdniaoSubscribeHttp kdniaoSubscribeHttp;
|
|
private KdniaoSubscribeHttp kdniaoSubscribeHttp;
|
|
|
|
|
|
|
|
+ @Value("${fsConfig.notifyUrl}")
|
|
|
|
+ private String kdnNotifyUrl;
|
|
/**
|
|
/**
|
|
* 推送物流信息到快递鸟
|
|
* 推送物流信息到快递鸟
|
|
*/
|
|
*/
|
|
@@ -43,9 +47,12 @@ public class ExpressServiceImpl implements IExpressService {
|
|
ExpressPushRespDTO expressPushRespDTO = null;
|
|
ExpressPushRespDTO expressPushRespDTO = null;
|
|
try {
|
|
try {
|
|
params = URLDecoder.decode(params, "UTF-8");
|
|
params = URLDecoder.decode(params, "UTF-8");
|
|
- LogisticsInfoDTO payload = JSON.parseObject(params, LogisticsInfoDTO.class);
|
|
|
|
|
|
+ JSONObject jsonObject = JSON.parseObject(params);
|
|
|
|
+ String requestData = jsonObject.getString("RequestData");
|
|
|
|
+ LogisticsInfoDTO payload = JSON.parseObject(requestData, LogisticsInfoDTO.class);
|
|
|
|
+ payload.setCallback(kdnNotifyUrl);
|
|
expressPushRespDTO = kdniaoSubscribeHttp.subscribeLogistic(payload);
|
|
expressPushRespDTO = kdniaoSubscribeHttp.subscribeLogistic(payload);
|
|
- } catch (Throwable e) {
|
|
|
|
|
|
+ } catch (Exception e) {
|
|
log.error("物流订阅发生异常 - 单号: {}, 错误信息: {}", fsOrderExpressPush.getOrderId(), JSON.toJSONString(e));
|
|
log.error("物流订阅发生异常 - 单号: {}, 错误信息: {}", fsOrderExpressPush.getOrderId(), JSON.toJSONString(e));
|
|
expressPushRespDTO = new ExpressPushRespDTO();
|
|
expressPushRespDTO = new ExpressPushRespDTO();
|
|
expressPushRespDTO.setSuccess(false);
|
|
expressPushRespDTO.setSuccess(false);
|