|
|
??????????????
2014
?????????????????
???????????????????? ?????? ????????? ?????? ??????????? ????????? ??????????? ??????????? ??????
???????????????33??????? ?????????
???2014???????????????????
????????????????????
???????
?????????????????????????1?????????2?????????3??????????????????????
?????????????
???????
???????????????1????2????3??????????????????????????????????????????
?????????
??????
???????????????????
1????????????????
2?????????????????????????????????????
3??????????????????????
4????????????????????????????????????????????????????????????????????????????????????????????????2015??
?????????????????????2015????????????????????????????????????????
5????????????????????????
?1??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
?2?????????????????????????????????
?3??????????????????????????????????????
?4??????????????????????
???????????????????????????????????????????????????????????????????????????
?????????
1??????????????????????????????
2????????????????????????????????
?????????
3?????????????????????????????????????????
4?????????????????????????????????????????
?????????????????????????????
?????????????????????????????????????????????????????????????
???????????????????????????????????????
?????????
???????
2014????????????????????????????????????
????????8?25?9?5?
???????9?10?9?14?
???????
1?????
?1????????????????http?//.cn?????????????????????http://crbm.ahzsks.cn???????????????2014?????????????????????????????????
?2?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
?3??????????????????????????????
?4?????????????????????????????????????????????
?5?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
????????????????????????????????????????????????????????????????????????????????
????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
2??????????
?1???????????????????????????????????????????????????????????????????????????????????????????????
?2
????????????
????????????????????????
???????????????????????????????????????????????????????? 2015??????????????????????????????
?????????????25??????????????????????????????????????????????????????????????????????????2014?????????????????????????????
??????????????????????????????????????
?3??????
?4????????????????????????????????
?5?????????????????????????????
?6???????????????????????????????????????????????????????????????????????????????
??????
??????????????????????????????????
???????????
????????????????????????????????
???????????????????????????????
????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
??????????????
??????????????????????????????????????????? ?????????????????????
?????????????????????????????????
?????????
??????????????
??????????????????????
???????????????????
???????????????????????????????????????????????????????????2015?????????????????????????????????????????????????????
??????
??????
??????
???????????????????????(?????????MD5???)?
??????????????????MD5?????????????????URL???
????????????????????MD5??????????
?????????????????????????????????????
??????????????????? ??????????????????
??????????????????????????????URL???
??????????????????/Web???/?????????????
?????? 1. ????
URL???http://ahdata.ahzsks.cn/api.html 2. ???????
??3x????????????XX?????????????????????????????????? 3. ????
Json?????{"status":"1000001","result":{"ksh":"x","xm":"a"?}}
4. ????
5. ??????Java??? ?1?????
???UID?postVersion?postData?postTime?signData?merCert UID?????
postVersion?????1.0.0.1??????????
postData?????????????????json??????BASE64???
??"{"sfzh":"34xxxx19xxxxxx0001","xm":"??"}";
postTime??????????yyyymmddhh24miss?
??(new SimpleDateFormat("yyyyMMddHHmmss")).format(new Date())?
signData???????postData??AES????BASE64??? merCert???????uuid+postTime??md5???
??ukey????uuid?????????????????????? ?????????????
postData=UID=uid&postVersion=1.0.0.1&postData=BASE64.encrypt({"sfzh":"34xxxx19xxxxxx0001","xm":"??
"})&postTime=(new SimpleDateFormat("yyyyMMddHHmmss")).format(new Date())&signData= BASE64.encrypt(AES.encrypt(postData,ukey))&merCert=md5.encrypt(uuid+postTime)?
?????
<form action="api.html" method="post">
UID:<input type="text" name="UID" value="ADMINTEST" /><br />
postVersion:<input type="text" name="postVersion" value="1.0.0.1" /><br />
postData:<input type="text" name="postData" value="xxx" /><br /> postTime:<input type="text" name="postTime" value="xxx" /><br /> signData:<input type="text" name="signData" value="xxx"/><br /> merCert:<input type="text" name="merCert" value="xxx"/><br />
<input type="submit" value="??" />
</form>
?2??????
???????json??? ??????????????????? ?1.0.0.1???
String url= ; String
param=UID=uid&postVersion=1.0.0.1&postData=BASE64.encrypt({"sfzh":"34xxxx19xxxxxx0001","xm":"??
"})&postTime=(new SimpleDateFormat("yyyyMMddHHmmss")).format(new Date())&signData= BASE64.encrypt(AES.encrypt(postData,ukey))&merCert=md5.encrypt(uuid+postTime)? String result=getAhdata(URL,param);
if (!result.equals("error")){//?????? JSONObject dataJson=JSONObject.fromObject(result); result=dataJson.getString("status");
if (result.equals(1000001)){ //????????
JSONObject Json=listJson.getJSONObject(dataJson.getString(result)); //?????? Json.getString("KSH"); //??? Json.getString("XM"); //??
Json.getString("SFZH"); //???? Json.getString("XBDM");//??
Json.getString("CSNY"); //???? Json.getString("ZZMMDM");//???? Json.getString("MZDM");//??
Json.getString("KLDM"); //??
Json.getString("BYLBDM"); //???? Json.getString("KSLBDM"); //???? Json.getString("WYYZDM"); //???? Json.getString("KSLXDM"); //???? Json.getString("ZXMC"); //???? Json.getString("JTDZ"); //???? Json.getString("YZBM"); //???? Json.getString("JTDH"); //???? Json.getString("LXDH"); //???? }}else{
//?????}
getAhdata?????
private static String getAhdata(String url, String params) {String result="";StringBuffer responseMessage = null;java.net.URLConnection connection = null;java.net.URL reqUrl = null;OutputStreamWriter reqOut = null;InputStream in = null;BufferedReader br = null;try { responseMessage = new StringBuffer(); reqUrl = new java.net.URL(url); connection = reqUrl.openConnection(); connection.setDoOutput(true); reqOut = new OutputStreamWriter(connection.getOutputStream()); reqOut.write(params); reqOut.flush(); int charCount = -1; in = connection.getInputStream(); br = new BufferedReader(new InputStreamReader(in, "Utf-8")); while ((charCount = br.read()) != -1) { responseMessage.append((char) charCount); }
result=responseMessage.toString(); } catch (Exception ex) { result="error"; } finally { try {in.close();
???2013???????????????
2013???????????????
??????????????????????????????51.1????????????85%?
????????????????51.1????????1%?????????21.4????????29.7??;????40.7???????10.4???????????????????1.3???????????1.8?????????1.4?????????0.9???
????????????????40.9??????????80.8%?????80%??2011???4.1????????????2.6????(??)???????????????????????????????43.5???
???????????????????????44?????????(??)???????????????????85%?????????????????????????
???????????????
?????http://www.850500.com/news/60764.html
?????,??! |
|