Commit ea681d11d5cec5a940ab72ae6d27e7638f63d206
1 parent
60c6096b
Exists in
master
中石化接口文档更新
Showing
1 changed file
with
64 additions
and
1 deletions
Show diff stats
order/truck/zsh/2022121401/订单接口.md
| ... | ... | @@ -176,7 +176,7 @@ public class Sample { |
| 176 | 176 | public static void main(String[] args_) { |
| 177 | 177 | String appKey = "appkey"; |
| 178 | 178 | String appSecret = "appSecret"; |
| 179 | - String jsonData = "订单下单Body参数JSON数据"; | |
| 179 | + String jsonData = "委托单Body参数JSON数据"; | |
| 180 | 180 | ZYClient zyClient = new ZYClient(appKey, appSecret); |
| 181 | 181 | HttpResponseData httpResponseData = |
| 182 | 182 | zyClient.doPost(Constants.TEST_HOST + "/oms-service-api/zshOrder/add", "accessToken", jsonData); |
| ... | ... | @@ -192,6 +192,69 @@ zyClient.doPost(Constants.TEST_HOST + "/oms-service-api/zshOrder/add", "accessTo |
| 192 | 192 | } |
| 193 | 193 | ``` |
| 194 | 194 | |
| 195 | +## 拒单集成接口 | |
| 196 | + | |
| 197 | +### 简要描述 | |
| 198 | + | |
| 199 | +拒单集成接口 | |
| 200 | + | |
| 201 | +### 请求URL | |
| 202 | + | |
| 203 | +· 测试环境:https://test.shjiuze.cn/oms-service-api/zshOrder/cancelOrder | |
| 204 | + | |
| 205 | +· 生产环境:https://gw.shjiuze.cn/oms-service-api/zshOrder/cancelOrder | |
| 206 | + | |
| 207 | +### 请求方式 | |
| 208 | + | |
| 209 | +POST | |
| 210 | + | |
| 211 | +### Headers参数 | |
| 212 | + | |
| 213 | +| 名称 | 类型 | 必填 | 示例值 | 描述 | | |
| 214 | +| ------------- | ------ | -------------------------- | -------------------------------- | ------------------------------------------------------------ | | |
| 215 | +| Authorization | String | 是 | Bearer a2c5680001 | 调用服务端API的应用凭证accessToken,通过调用获取访问凭证接口获取。 | | |
| 216 | +| appKey | String | 是 | 0867ef5f23ef446483749e19e1692b40 | 则一提供 | | |
| 217 | +| timestamp | String | 是 | 1643251533306 | 当前时间戳毫秒值 | | |
| 218 | +| nonce | String | 是 | gdst9t | 6位小写字母数字组合随机串 | | |
| 219 | +| sign | String | 是 | fa3ed338d6dfe18e7273c8692234ee70 | 签名:appKey(则一提供) + appSecret(则一提供) + timestamp + nonce(6位随机码) + data(body参数)通过md5(32位小写)算法生成 | | |
| 220 | + | |
| 221 | +### Body参数 | |
| 222 | + | |
| 223 | +参数Json. | |
| 224 | + | |
| 225 | +### 返回结果正常示例 | |
| 226 | + | |
| 227 | + { "success": true, "businessException": false} | |
| 228 | + | |
| 229 | +### 返回结果异常示例 | |
| 230 | + | |
| 231 | + { "success": false, "businessException": true, "errorCode": "500", "message": "XXX异常!"} | |
| 232 | + | |
| 233 | +### 请求示例 | |
| 234 | + | |
| 235 | +##### Java-sdk方式 [下载SDK](https://zeyi-tms-product.oss-cn-hangzhou.aliyuncs.com/file/jar/java-sdk/zy-java-sdk-1.0.0.jar) | |
| 236 | + | |
| 237 | +```java | |
| 238 | +public class Sample { | |
| 239 | + public static void main(String[] args_) { | |
| 240 | + String appKey = "appkey"; | |
| 241 | + String appSecret = "appSecret"; | |
| 242 | + String jsonData = "拒单Body参数JSON数据"; | |
| 243 | + ZYClient zyClient = new ZYClient(appKey, appSecret); | |
| 244 | + HttpResponseData httpResponseData = | |
| 245 | +zyClient.doPost(Constants.TEST_HOST + "/oms-service-api/zshOrder/cancelOrder", "accessToken", jsonData); | |
| 246 | + if(httpResponseData == null) { | |
| 247 | + throw new BusinessException("则一请求失败,返回结果为空!"); | |
| 248 | + } | |
| 249 | + if(httpResponseData.getStatus() == HttpURLConnection.HTTP_UNAUTHORIZED) { | |
| 250 | + //重新获取token再次请求 | |
| 251 | + httpResponseData = zyClient.doPost(Constants.TEST_HOST + | |
| 252 | + "/oms-service-api/zshOrder/cancelOrder", "accessToken", jsonData); | |
| 253 | + } | |
| 254 | + } | |
| 255 | +} | |
| 256 | +``` | |
| 257 | + | |
| 195 | 258 | |
| 196 | 259 | |
| 197 | 260 | ------------------------------------------------------------------------------------------ | ... | ... |