|
@@ -9,10 +9,13 @@ import com.ruoyi.logistics.domain.BizWaybillOrder;
|
|
|
import com.ruoyi.logistics.domain.LogisticsOrder;
|
|
import com.ruoyi.logistics.domain.LogisticsOrder;
|
|
|
import com.ruoyi.logistics.service.LogisticsService;
|
|
import com.ruoyi.logistics.service.LogisticsService;
|
|
|
import com.ruoyi.logistics.util.SFExpressHttpUtil;
|
|
import com.ruoyi.logistics.util.SFExpressHttpUtil;
|
|
|
|
|
+import com.ruoyi.system.controller.SysUserController;
|
|
|
import com.sf.csim.express.service.CallExpressServiceTools;
|
|
import com.sf.csim.express.service.CallExpressServiceTools;
|
|
|
import com.sf.csim.express.service.HttpClientUtil;
|
|
import com.sf.csim.express.service.HttpClientUtil;
|
|
|
import com.sf.csim.express.service.IServiceCodeStandard;
|
|
import com.sf.csim.express.service.IServiceCodeStandard;
|
|
|
import com.sf.csim.express.service.code.ExpressServiceCodeEnum;
|
|
import com.sf.csim.express.service.code.ExpressServiceCodeEnum;
|
|
|
|
|
+import org.slf4j.Logger;
|
|
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
@@ -28,11 +31,11 @@ import java.util.*;
|
|
|
*/
|
|
*/
|
|
|
@Service
|
|
@Service
|
|
|
public class SFLogisticsService implements LogisticsService {
|
|
public class SFLogisticsService implements LogisticsService {
|
|
|
|
|
+ private static final Logger log = LoggerFactory.getLogger(SFLogisticsService.class);
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private SFExpressConfig sfExpressConfig;
|
|
private SFExpressConfig sfExpressConfig;
|
|
|
- @Autowired
|
|
|
|
|
- private RedisIdGenerator redisIdGenerator;
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 顺丰物流预下单接口
|
|
* 顺丰物流预下单接口
|
|
@@ -48,8 +51,7 @@ public class SFLogisticsService implements LogisticsService {
|
|
|
JSONObject msgData = new JSONObject();
|
|
JSONObject msgData = new JSONObject();
|
|
|
//预下单接口已拿到订单id 下单需要用到这个id
|
|
//预下单接口已拿到订单id 下单需要用到这个id
|
|
|
|
|
|
|
|
- String orderId = redisIdGenerator.generateUniqueId("RJSD");
|
|
|
|
|
- msgData.put("orderId", orderId);
|
|
|
|
|
|
|
+ msgData.put("orderId", bizWaybillOrder.getWaybillNo());
|
|
|
msgData.put("cargoName", bizWaybillOrder.getGoodsName());
|
|
msgData.put("cargoName", bizWaybillOrder.getGoodsName());
|
|
|
msgData.put("monthlyCard", sfExpressConfig.getMonthlyCord());
|
|
msgData.put("monthlyCard", sfExpressConfig.getMonthlyCord());
|
|
|
msgData.put("totalWeight", bizWaybillOrder.getGoodsWeight());
|
|
msgData.put("totalWeight", bizWaybillOrder.getGoodsWeight());
|
|
@@ -83,14 +85,11 @@ public class SFLogisticsService implements LogisticsService {
|
|
|
JSONObject jsonObject = JSON.parseObject(result).getJSONObject("apiResultData");
|
|
JSONObject jsonObject = JSON.parseObject(result).getJSONObject("apiResultData");
|
|
|
JSONObject resultInfo = new JSONObject();
|
|
JSONObject resultInfo = new JSONObject();
|
|
|
if (jsonObject != null && jsonObject.containsKey("success") && jsonObject.getBooleanValue("success")) {
|
|
if (jsonObject != null && jsonObject.containsKey("success") && jsonObject.getBooleanValue("success")) {
|
|
|
- bizWaybillOrder.setWaybillNo(orderId);
|
|
|
|
|
resultInfo.put("success", true);
|
|
resultInfo.put("success", true);
|
|
|
- resultInfo.put("data", bizWaybillOrder);
|
|
|
|
|
resultInfo.put("msg", "预下单校验成功!");
|
|
resultInfo.put("msg", "预下单校验成功!");
|
|
|
return resultInfo;
|
|
return resultInfo;
|
|
|
} else {
|
|
} else {
|
|
|
resultInfo.put("success", false);
|
|
resultInfo.put("success", false);
|
|
|
- resultInfo.put("data", null);
|
|
|
|
|
resultInfo.put("msg", "预下单校验失败!失败原因:"+jsonObject.get("errorMsg"));
|
|
resultInfo.put("msg", "预下单校验失败!失败原因:"+jsonObject.get("errorMsg"));
|
|
|
return resultInfo;
|
|
return resultInfo;
|
|
|
}
|
|
}
|