mirror of
				https://github.com/YunaiV/ruoyi-vue-pro.git
				synced 2025-10-31 02:28:03 +08:00 
			
		
		
		
	【功能优化】商城:KdNiaoExpressClient 增加 requestType 配置,使用免费版,还是增值版
This commit is contained in:
		| @ -56,6 +56,15 @@ public class TradeExpressProperties { | |||||||
|         @NotEmpty(message = "快递鸟 Api Key 配置项不能为空") |         @NotEmpty(message = "快递鸟 Api Key 配置项不能为空") | ||||||
|         private String apiKey; |         private String apiKey; | ||||||
|  |  | ||||||
|  |         /** | ||||||
|  |          * 接口指令 | ||||||
|  |          * | ||||||
|  |          * 1. 1002:免费版(只能查询申通、圆通快递) | ||||||
|  |          * 2. 8001:付费版 | ||||||
|  |          */ | ||||||
|  |         @NotEmpty(message = "RequestType 配置项不能为空") | ||||||
|  |         private String requestType = "1002"; | ||||||
|  |  | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     /** |     /** | ||||||
|  | |||||||
| @ -39,11 +39,6 @@ public class KdNiaoExpressClient implements ExpressClient { | |||||||
|  |  | ||||||
|     private static final String REAL_TIME_QUERY_URL = "https://api.kdniao.com/Ebusiness/EbusinessOrderHandle.aspx"; |     private static final String REAL_TIME_QUERY_URL = "https://api.kdniao.com/Ebusiness/EbusinessOrderHandle.aspx"; | ||||||
|  |  | ||||||
|     /** |  | ||||||
|      * 快递鸟即时查询免费版 RequestType |  | ||||||
|      */ |  | ||||||
|     private static final String REAL_TIME_FREE_REQ_TYPE = "1002"; |  | ||||||
|  |  | ||||||
|     private final RestTemplate restTemplate; |     private final RestTemplate restTemplate; | ||||||
|     private final TradeExpressProperties.KdNiaoConfig config; |     private final TradeExpressProperties.KdNiaoConfig config; | ||||||
|  |  | ||||||
| @ -67,7 +62,7 @@ public class KdNiaoExpressClient implements ExpressClient { | |||||||
|                 && StrUtil.length(reqDTO.getPhone()) >= 4) { |                 && StrUtil.length(reqDTO.getPhone()) >= 4) { | ||||||
|             requestDTO.setCustomerName(StrUtil.subSufByLength(reqDTO.getPhone(), 4)); |             requestDTO.setCustomerName(StrUtil.subSufByLength(reqDTO.getPhone(), 4)); | ||||||
|         } |         } | ||||||
|         KdNiaoExpressQueryRespDTO respDTO = httpRequest(REAL_TIME_QUERY_URL, REAL_TIME_FREE_REQ_TYPE, |         KdNiaoExpressQueryRespDTO respDTO = httpRequest(REAL_TIME_QUERY_URL, config.getRequestType(), | ||||||
|                 requestDTO, KdNiaoExpressQueryRespDTO.class); |                 requestDTO, KdNiaoExpressQueryRespDTO.class); | ||||||
|  |  | ||||||
|         // 处理结果 |         // 处理结果 | ||||||
|  | |||||||
| @ -340,10 +340,11 @@ yudao: | |||||||
|       receive-expire-time: 14d # 收货的过期时间 |       receive-expire-time: 14d # 收货的过期时间 | ||||||
|       comment-expire-time: 7d # 评论的过期时间 |       comment-expire-time: 7d # 评论的过期时间 | ||||||
|     express: |     express: | ||||||
|       client: kd_niao |       client: KD_NIAO | ||||||
|       kd-niao: |       kd-niao: | ||||||
|         api-key: cb022f1e-48f1-4c4a-a723-9001ac9676b8 |         api-key: cb022f1e-48f1-4c4a-a723-9001ac9676b8 | ||||||
|         business-id: 1809751 |         business-id: 1809751 | ||||||
|  |         request-type: 1002 # 免费版 1002;付费版 8001 | ||||||
|       kd100: |       kd100: | ||||||
|         key: pLXUGAwK5305 |         key: pLXUGAwK5305 | ||||||
|         customer: E77DF18BE109F454A5CD319E44BF5177 |         customer: E77DF18BE109F454A5CD319E44BF5177 | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	 YunaiV
					YunaiV