Ver Fonte

快递鸟解析错误处理

yjwang há 6 dias atrás
pai
commit
1f18db17d6

+ 13 - 3
fs-service/src/main/java/com/fs/hisStore/service/impl/FsExpressScrmServiceImpl.java

@@ -10,18 +10,21 @@ import java.util.Map;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.http.HttpUtil;
 import cn.hutool.json.JSONUtil;
+import com.alibaba.fastjson.JSON;
 import com.fs.api.param.ExpressParam;
 import com.fs.api.vo.ExpressVO;
 import com.fs.common.config.FSSysConfig;
 import com.fs.common.core.domain.R;
 import com.fs.common.exception.CustomException;
 import com.fs.common.utils.DateUtils;
+import com.fs.hisStore.config.StoreConfig;
 import com.fs.hisStore.domain.FsStoreOrderScrm;
 import com.fs.hisStore.dto.ExpressAddressDTO;
 import com.fs.hisStore.dto.ExpressInfoDTO;
 import com.fs.hisStore.dto.TracesDTO;
 import com.fs.hisStore.enums.ShipperCodeEnum;
 import com.fs.hisStore.mapper.FsStoreOrderScrmMapper;
+import com.fs.system.service.ISysConfigService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -40,15 +43,14 @@ import org.springframework.util.Base64Utils;
 @Service
 public class FsExpressScrmServiceImpl implements IFsExpressScrmService 
 {
-
     Logger logger = LoggerFactory.getLogger(FsExpressScrmServiceImpl.class);
-
     @Autowired
     private FsExpressScrmMapper fsExpressMapper;
     @Autowired
     private FsStoreOrderScrmMapper fsStoreOrderMapper;
     @Autowired
-    private FSSysConfig sysConfig;
+    private ISysConfigService configService;
+
     /**
      * 查询快递公司
      * 
@@ -136,6 +138,8 @@ public class FsExpressScrmServiceImpl implements IFsExpressScrmService
 
         Map<String, Object> params = new HashMap<>();
         try {
+            String json = this.configService.selectConfigByKey("his.config");
+            FSSysConfig sysConfig= JSON.parseObject(json,FSSysConfig.class);
             params.put("RequestData", URLEncoder.encode(requestData, "UTF-8"));
             params.put("EBusinessID",sysConfig.getKdnId().trim());
             params.put("RequestType", "8001");
@@ -181,6 +185,8 @@ public class FsExpressScrmServiceImpl implements IFsExpressScrmService
 
         Map<String, Object> params = new HashMap<>();
         try {
+            String json = this.configService.selectConfigByKey("his.config");
+            FSSysConfig sysConfig= JSON.parseObject(json,FSSysConfig.class);
             params.put("RequestData", URLEncoder.encode(requestData, "UTF-8"));
             params.put("EBusinessID",sysConfig.getKdnId().trim());
             params.put("RequestType", "8008");
@@ -202,6 +208,8 @@ public class FsExpressScrmServiceImpl implements IFsExpressScrmService
 
         Map<String, Object> params = new HashMap<>();
         try {
+            String json = this.configService.selectConfigByKey("his.config");
+            FSSysConfig sysConfig= JSON.parseObject(json,FSSysConfig.class);
             params.put("RequestData", URLEncoder.encode(requestData, "UTF-8"));
             params.put("EBusinessID",sysConfig.getKdnId().trim());
             params.put("RequestType", "6001");
@@ -244,6 +252,8 @@ public class FsExpressScrmServiceImpl implements IFsExpressScrmService
 
             Map<String, Object> params = new HashMap<>();
             try {
+                String json = this.configService.selectConfigByKey("his.config");
+                FSSysConfig sysConfig= JSON.parseObject(json,FSSysConfig.class);
                 params.put("RequestData", URLEncoder.encode(requestData, "UTF-8"));
                 params.put("EBusinessID",sysConfig.getKdnId().trim());
                 params.put("RequestType", "8001");