File tree Expand file tree Collapse file tree 15 files changed +361
-18
lines changed Expand file tree Collapse file tree 15 files changed +361
-18
lines changed Original file line number Diff line number Diff line change 1+ package com .kuaidi100 .sdk .cloud ;
2+
3+ import com .google .gson .Gson ;
4+ import com .google .gson .reflect .TypeToken ;
5+ import com .kuaidi100 .sdk .contant .ApiInfoConstant ;
6+ import com .kuaidi100 .sdk .pojo .HttpResult ;
7+ import com .kuaidi100 .sdk .request .cloud .CloudBaseReq ;
8+ import com .kuaidi100 .sdk .response .cloud .CloudBaseResp ;
9+ import com .kuaidi100 .sdk .utils .HttpUtils ;
10+ import org .apache .commons .lang3 .StringUtils ;
11+
12+ /**
13+ * @Author: api.kuaidi100.com
14+ * @Date: 2020-11-20 10:36
15+ */
16+ public class CloudBase <T > {
17+ public CloudBaseResp <T > execute (CloudBaseReq param ) throws Exception {
18+ HttpResult httpResult = HttpUtils .doPost (ApiInfoConstant .CLOUD_NORMAL_URL , param );
19+ if (httpResult .getStatus () == 200 && StringUtils .isNotBlank (httpResult .getBody ())){
20+ return new Gson ().fromJson (httpResult .getBody (),new TypeToken <CloudBaseResp <T >>(){}.getType ());
21+ }
22+ return null ;
23+ }
24+ }
Original file line number Diff line number Diff line change @@ -89,4 +89,8 @@ public class ApiInfoConstant {
8989 * 商家寄件取消
9090 */
9191 public static final String B_ORDER_CANCEL_METHOD = "cancelBest" ;
92+ /**
93+ * 云平台通用请求url
94+ */
95+ public static final String CLOUD_NORMAL_URL = "http://cloud.kuaidi100.com/api" ;
9296}
Original file line number Diff line number Diff line change @@ -137,9 +137,28 @@ public class PrintCloudParam {
137137 */
138138 private String resultv2 ;
139139 /**
140- * 该字段为申通专用,其他公司勿传;申通的需要传 44
140+ * 扩展字段,不同快递公司具体详情看参数字典
141+ * https://api.kuaidi100.com/help/doc/?code=5f0ff6e82977d50a94e10237&openKey=%E7%94%B5%E5%AD%90%E9%9D%A2%E5%8D%95
141142 */
142143 private String code ;
144+ /**
145+ * 扩展字段,具体详情看参数字典
146+ * https://api.kuaidi100.com/help/doc/?code=5f0ff6e82977d50a94e10237&openKey=%E7%94%B5%E5%AD%90%E9%9D%A2%E5%8D%95
147+ */
148+ private String partnerSecret ;
149+ /**
150+ * 扩展字段,具体详情看参数字典
151+ * https://api.kuaidi100.com/help/doc/?code=5f0ff6e82977d50a94e10237&openKey=%E7%94%B5%E5%AD%90%E9%9D%A2%E5%8D%95
152+ */
153+ private String partnerName ;
154+ /**
155+ * 扩展字段,具体详情看参数字典
156+ * https://api.kuaidi100.com/help/doc/?code=5f0ff6e82977d50a94e10237&openKey=%E7%94%B5%E5%AD%90%E9%9D%A2%E5%8D%95
157+ */
158+ private String checkMan ;
143159
144- private String orgSortingName ;
160+ /**
161+ * 打印方向(默认0) 0-正方向 1-反方向
162+ */
163+ private String direction ;
145164}
Original file line number Diff line number Diff line change @@ -123,7 +123,23 @@ public class PrintHtmlParam {
123123 */
124124 private String resultv2 ;
125125 /**
126- * 该字段为申通专用,其他公司勿传;申通的需要传 44
126+ * 扩展字段,不同快递公司具体详情看参数字典
127+ * https://api.kuaidi100.com/help/doc/?code=5f0ff6e82977d50a94e10237&openKey=%E7%94%B5%E5%AD%90%E9%9D%A2%E5%8D%95
127128 */
128129 private String code ;
130+ /**
131+ * 扩展字段,具体详情看参数字典
132+ * https://api.kuaidi100.com/help/doc/?code=5f0ff6e82977d50a94e10237&openKey=%E7%94%B5%E5%AD%90%E9%9D%A2%E5%8D%95
133+ */
134+ private String partnerSecret ;
135+ /**
136+ * 扩展字段,具体详情看参数字典
137+ * https://api.kuaidi100.com/help/doc/?code=5f0ff6e82977d50a94e10237&openKey=%E7%94%B5%E5%AD%90%E9%9D%A2%E5%8D%95
138+ */
139+ private String partnerName ;
140+ /**
141+ * 扩展字段,具体详情看参数字典
142+ * https://api.kuaidi100.com/help/doc/?code=5f0ff6e82977d50a94e10237&openKey=%E7%94%B5%E5%AD%90%E9%9D%A2%E5%8D%95
143+ */
144+ private String checkMan ;
129145}
Original file line number Diff line number Diff line change @@ -152,11 +152,28 @@ public class PrintImgParam {
152152 */
153153 private String resultv2 ;
154154 /**
155- * 该字段为申通专用,其他公司勿传;申通的需要传 44
155+ * 打印时间
156+ */
157+ private String printTime ;
158+
159+ /**
160+ * 扩展字段,不同快递公司具体详情看参数字典
161+ * https://api.kuaidi100.com/help/doc/?code=5f0ff6e82977d50a94e10237&openKey=%E7%94%B5%E5%AD%90%E9%9D%A2%E5%8D%95
156162 */
157163 private String code ;
158164 /**
159- * 打印时间
165+ * 扩展字段,具体详情看参数字典
166+ * https://api.kuaidi100.com/help/doc/?code=5f0ff6e82977d50a94e10237&openKey=%E7%94%B5%E5%AD%90%E9%9D%A2%E5%8D%95
160167 */
161- private String printTime ;
168+ private String partnerSecret ;
169+ /**
170+ * 扩展字段,具体详情看参数字典
171+ * https://api.kuaidi100.com/help/doc/?code=5f0ff6e82977d50a94e10237&openKey=%E7%94%B5%E5%AD%90%E9%9D%A2%E5%8D%95
172+ */
173+ private String partnerName ;
174+ /**
175+ * 扩展字段,具体详情看参数字典
176+ * https://api.kuaidi100.com/help/doc/?code=5f0ff6e82977d50a94e10237&openKey=%E7%94%B5%E5%AD%90%E9%9D%A2%E5%8D%95
177+ */
178+ private String checkMan ;
162179}
Original file line number Diff line number Diff line change 1+ package com .kuaidi100 .sdk .request .cloud ;
2+
3+ import lombok .Data ;
4+
5+ /**
6+ * @Author: api.kuaidi100.com
7+ * @Date: 2020-11-25 15:47
8+ */
9+ @ Data
10+ public class COrderCancelReq extends CloudBaseReq {
11+ /**
12+ * 任务ID
13+ */
14+ private String taskId ;
15+ /**
16+ * 订单ID
17+ */
18+ private String orderId ;
19+ /**
20+ * 取消原因,例:暂时不寄件了
21+ */
22+ private String cancelMsg ;
23+ }
Original file line number Diff line number Diff line change 1+ package com .kuaidi100 .sdk .request .cloud ;
2+
3+ import lombok .Data ;
4+
5+ /**
6+ * @Author: api.kuaidi100.com
7+ * @Date: 2020-11-20 11:09
8+ */
9+ @ Data
10+ public class COrderQueryReq extends CloudBaseReq {
11+ /**
12+ *
13+ */
14+ private String sendManPrintAddr ;
15+
16+ private String recManPrintAddr ;
17+
18+ private String address ;
19+ }
Original file line number Diff line number Diff line change 1+ package com .kuaidi100 .sdk .request .cloud ;
2+
3+ import lombok .Data ;
4+
5+ /**
6+ * @Author: api.kuaidi100.com
7+ * @Date: 2020-10-27 15:47
8+ */
9+ @ Data
10+ public class COrderReq extends CloudBaseReq {
11+ /**
12+ * 快递公司的编码,一律用小写字母,见《快递公司编码》
13+ */
14+ private String com ;
15+ /**
16+ * 收件人姓名
17+ */
18+ private String recManName ;
19+ /**
20+ * 收件人的手机号,手机号和电话号二者其一必填
21+ */
22+ private String recManMobile ;
23+ /**
24+ * 收件人所在完整地址,如广东深圳市深圳市南山区科技南十二路2号金蝶软件园
25+ */
26+ private String recManPrintAddr ;
27+ /**
28+ * 寄件人姓名
29+ */
30+ private String sendManName ;
31+ /**
32+ * 寄件人的手机号,手机号和电话号二者其一必填
33+ */
34+ private String sendManMobile ;
35+ /**
36+ * 寄件人所在的完整地址,如广东深圳市深圳市南山区科技南十二路2号金蝶软件园B10
37+ */
38+ private String sendManPrintAddr ;
39+ /**
40+ * 物品名称,例:文件
41+ */
42+ private String cargo ;
43+ /**
44+ * 物品总重量KG,例:1.5,单位kg
45+ */
46+ private String weight ;
47+ /**
48+ * 备注
49+ */
50+ private String remark ;
51+ /**
52+ * 签名用随机字符串
53+ */
54+ private String salt ;
55+ /**
56+ * callBackUrl订单信息回调
57+ */
58+ private String callBackUrl ;
59+ /**
60+ * 预约日期,例如:今天/明天/后天
61+ */
62+ private String dayType ;
63+ /**
64+ * 预约起始时间(HH:mm),例如:09:00
65+ */
66+ private String pickupStartTime ;
67+ /**
68+ * 预约截止时间(HH:mm),例如:10:00
69+ */
70+ private String pickupEndTime ;
71+ /**
72+ * 支付方式,SHIPPER: 寄付(默认),CONSIGNEE: 到付
73+ */
74+ private String payment ;
75+ }
Original file line number Diff line number Diff line change 1+ package com .kuaidi100 .sdk .request .cloud ;
2+
3+ import com .kuaidi100 .sdk .utils .SignUtils ;
4+ import lombok .Data ;
5+
6+ /**
7+ * @Author: api.kuaidi100.com
8+ * @Date: 2020-10-27 15:45
9+ */
10+ @ Data
11+ public class CloudBaseReq {
12+ /**
13+ * 用户授权key
14+ */
15+ private String secret_key ;
16+ /**
17+ * 接口编号
18+ */
19+ private String secret_code ;
20+ /**
21+ * 加密签名:md5(secret_key+secret_secret)转大写
22+ */
23+ private String secret_sign ;
24+
25+ private String secret_secret ;
26+
27+ public String getSecret_sign () {
28+ return SignUtils .sign (secret_key +secret_secret );
29+ }
30+ }
Original file line number Diff line number Diff line change @@ -26,4 +26,8 @@ public class PrintHtmlData {
2626 * 电子面单链接
2727 */
2828 private List <String > templateurl ;
29+ /**
30+ * 子单号
31+ */
32+ private String childNum ;
2933}
You can’t perform that action at this time.
0 commit comments