| | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.supersavedriving.driver.core.util.MD5Util; |
| | | import com.supersavedriving.driver.modular.system.util.httpClinet.HttpClientUtil; |
| | | import com.supersavedriving.driver.modular.system.util.httpClinet.HttpResult; |
| | | import org.apache.commons.codec.binary.Base64; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | |
| | | private String APIKey = "zj42494b1bdd416b9762229af6b5cbbd"; |
| | | |
| | | private String SecretKey = "30323561316534653735613230316339"; |
| | | |
| | | @Autowired |
| | | private HttpClientUtil httpClientUtil; |
| | | |
| | | |
| | | /** |
| | |
| | | Map<String, String> header = new HashMap<String, String>(3); |
| | | header.put("Authorization", "Basic " + new String(Base64.encodeBase64((APIKey + ":" + SecretKey).getBytes()))); |
| | | header.put("Content-Type", "application/json;charset=utf-8"); |
| | | String post = httpClientUtil.pushHttpRequset("POST", "https://ct.open.10086.cn/ordernumber/v1/binding", request, header, "json"); |
| | | HttpResult httpResult = HttpClientUtil.pushHttpRequset("POST", "https://ct.open.10086.cn/ordernumber/v1/binding", request, header, "json"); |
| | | String post = httpResult.getData(); |
| | | Map<String, String> map1 = new HashMap<>(); |
| | | if(post.indexOf("0000") != -1){ |
| | | JSONObject jsonObject = JSONObject.parseObject(post); |
| | |
| | | Map<String, String> header = new HashMap<String, String>(3); |
| | | header.put("Authorization", "Basic " + new String(Base64.encodeBase64((APIKey + ":" + SecretKey).getBytes()))); |
| | | header.put("Content-Type", "application/json;charset=utf-8"); |
| | | String post = httpClientUtil.pushHttpRequset("POST", "https://ct.open.10086.cn/ordernumber/v1/unbinding", request, header, "json"); |
| | | HttpResult httpResult = HttpClientUtil.pushHttpRequset("POST", "https://ct.open.10086.cn/ordernumber/v1/unbinding", request, header, "json"); |
| | | String post = httpResult.getData(); |
| | | JSONObject jsonObject = JSONObject.parseObject(post); |
| | | Map<String, String> map1 = new HashMap<>(); |
| | | if(jsonObject.getString("code").equals("0000")){ |