上海银行涉农
This commit is contained in:
+95
-21
@@ -44,10 +44,7 @@ import java.io.IOException;
|
|||||||
import java.net.Authenticator;
|
import java.net.Authenticator;
|
||||||
import java.net.PasswordAuthentication;
|
import java.net.PasswordAuthentication;
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.Charset;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 地址治理
|
* 地址治理
|
||||||
@@ -752,9 +749,89 @@ public class AddrSvcController {
|
|||||||
int code = json.getInt("msgCode");
|
int code = json.getInt("msgCode");
|
||||||
String msg = json.getString("msg");
|
String msg = json.getString("msg");
|
||||||
BasicModel basicModel = new BasicModel(code, msg);
|
BasicModel basicModel = new BasicModel(code, msg);
|
||||||
HashMap<String, String> map = new HashMap<String, String>();
|
HashMap<String, String> map = new LinkedHashMap<String, String>();
|
||||||
//我们的结果
|
//我们的结果
|
||||||
|
// "province": "江苏省",
|
||||||
|
// "city": "苏州市",
|
||||||
|
// "district": "昆山市",
|
||||||
|
// "town": "玉山镇",
|
||||||
|
// "committee": "南星渎村委会",
|
||||||
|
// "provinceCode": "320000000000",
|
||||||
|
// "cityCode": "320500000000",
|
||||||
|
// "districtCode": "320583000000",
|
||||||
|
// "townCode": "320583100000",
|
||||||
|
// "committeeCode": "320583100222",
|
||||||
|
// "typeCode": "220",
|
||||||
|
// "typeName": "村庄",
|
||||||
|
// "verifyFlag": "非农",
|
||||||
|
// "addrVerify": "地址有效",
|
||||||
|
// "countyLevelCity": "是",
|
||||||
|
// "administrativeTowns": "否",
|
||||||
|
// "countyGov": "否",
|
||||||
|
// "devDistrict": "是",
|
||||||
|
// "devDistrictName": "昆山高新技术产业开发区",
|
||||||
|
// "devLevel": "国家级",
|
||||||
|
// "addrArea": "开发区",
|
||||||
|
// "countyGovTown": "昆山开发区"
|
||||||
JSONObject result = json.getJSONObject("result");
|
JSONObject result = json.getJSONObject("result");
|
||||||
|
if (result.containsKey("province")) {
|
||||||
|
map.put("province", result.getString("province"));
|
||||||
|
}
|
||||||
|
if (result.containsKey("city")) {
|
||||||
|
map.put("city", result.getString("city"));
|
||||||
|
}
|
||||||
|
if (result.containsKey("district")) {
|
||||||
|
map.put("district", result.getString("district"));
|
||||||
|
}
|
||||||
|
if (result.containsKey("town")) {
|
||||||
|
map.put("town", result.getString("town"));
|
||||||
|
}
|
||||||
|
if (result.containsKey("committee")) {
|
||||||
|
map.put("committee", result.getString("committee"));
|
||||||
|
}
|
||||||
|
if (result.containsKey("provinceCode")) {
|
||||||
|
map.put("provinceCode", result.getString("provinceCode"));
|
||||||
|
}
|
||||||
|
if (result.containsKey("cityCode")) {
|
||||||
|
map.put("cityCode", result.getString("cityCode"));
|
||||||
|
}
|
||||||
|
if (result.containsKey("districtCode")) {
|
||||||
|
map.put("districtCode", result.getString("districtCode"));
|
||||||
|
}
|
||||||
|
if (result.containsKey("townCode")) {
|
||||||
|
map.put("townCode", result.getString("townCode"));
|
||||||
|
}
|
||||||
|
if (result.containsKey("committeeCode")) {
|
||||||
|
map.put("committeeCode", result.getString("committeeCode"));
|
||||||
|
}
|
||||||
|
if (result.containsKey("typeCode")) {
|
||||||
|
map.put("typeCode", result.getString("typeCode"));
|
||||||
|
}
|
||||||
|
if (result.containsKey("typeName")) {
|
||||||
|
map.put("typeName", result.getString("typeName"));
|
||||||
|
}
|
||||||
|
if (result.containsKey("verifyFlag")) {
|
||||||
|
map.put("verifyFlag", result.getString("verifyFlag"));
|
||||||
|
}
|
||||||
|
if (result.containsKey("addrVerify")) {
|
||||||
|
map.put("addrVerify", result.getString("addrVerify"));
|
||||||
|
}
|
||||||
|
if (result.containsKey("countyLevelCity")) {
|
||||||
|
map.put("countyLevelCity", result.getString("countyLevelCity"));
|
||||||
|
}
|
||||||
|
if (result.containsKey("administrativeTowns")) {
|
||||||
|
map.put("administrativeTowns", result.getString("administrativeTowns"));
|
||||||
|
}
|
||||||
|
if (result.containsKey("countyGov")) {
|
||||||
|
map.put("countyGov", result.getString("countyGov"));
|
||||||
|
}
|
||||||
|
if (result.containsKey("devDistrict")) {
|
||||||
|
map.put("devDistrict", result.getString("devDistrict"));
|
||||||
|
}
|
||||||
|
if (result.containsKey("devLevel")) {
|
||||||
|
map.put("devLevel", result.getString("devLevel"));
|
||||||
|
}
|
||||||
|
|
||||||
if (result.containsKey("addrArea")) {
|
if (result.containsKey("addrArea")) {
|
||||||
map.put("addrArea", result.getString("addrArea"));
|
map.put("addrArea", result.getString("addrArea"));
|
||||||
}
|
}
|
||||||
@@ -764,9 +841,6 @@ public class AddrSvcController {
|
|||||||
if (result.containsKey("countyGovTown")) {
|
if (result.containsKey("countyGovTown")) {
|
||||||
map.put("countyGovTown", result.getString("countyGovTown"));
|
map.put("countyGovTown", result.getString("countyGovTown"));
|
||||||
}
|
}
|
||||||
if (result.containsKey("town")) {
|
|
||||||
map.put("town", result.getString("town"));
|
|
||||||
}
|
|
||||||
basicModel.setResult(map);
|
basicModel.setResult(map);
|
||||||
mav.setModel(basicModel);
|
mav.setModel(basicModel);
|
||||||
} else {
|
} else {
|
||||||
@@ -1004,7 +1078,7 @@ public class AddrSvcController {
|
|||||||
* @param model
|
* @param model
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Object villageIdentifyAction(AddressModel model){
|
public Object villageIdentifyAction(AddressModel model) {
|
||||||
|
|
||||||
RestfulModelAndView mav = new RestfulModelAndView();
|
RestfulModelAndView mav = new RestfulModelAndView();
|
||||||
if (StringUtils.isBlank(model.getAddress())) {
|
if (StringUtils.isBlank(model.getAddress())) {
|
||||||
@@ -1140,7 +1214,7 @@ public class AddrSvcController {
|
|||||||
return mav;
|
return mav;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Map<String, String> senRequest (String address, String type) throws IOException {
|
private static Map<String, String> senRequest(String address, String type) throws IOException {
|
||||||
String targetURL = "http://146.56.217.44:9010/uams/farmer/all/v3/sign";
|
String targetURL = "http://146.56.217.44:9010/uams/farmer/all/v3/sign";
|
||||||
String proxyHost = "tunnel2.qg.net";
|
String proxyHost = "tunnel2.qg.net";
|
||||||
int proxyPort = 14186;
|
int proxyPort = 14186;
|
||||||
@@ -1253,7 +1327,7 @@ public class AddrSvcController {
|
|||||||
* @param model
|
* @param model
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Object villageIdentifyStandardAction (AddressModel model){
|
public Object villageIdentifyStandardAction(AddressModel model) {
|
||||||
|
|
||||||
RestfulModelAndView mav = new RestfulModelAndView();
|
RestfulModelAndView mav = new RestfulModelAndView();
|
||||||
if (StringUtils.isBlank(model.getAddress())) {
|
if (StringUtils.isBlank(model.getAddress())) {
|
||||||
@@ -1303,7 +1377,7 @@ public class AddrSvcController {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Object addressAssociationAction (AddressModel model){
|
public Object addressAssociationAction(AddressModel model) {
|
||||||
|
|
||||||
RestfulModelAndView mav = new RestfulModelAndView();
|
RestfulModelAndView mav = new RestfulModelAndView();
|
||||||
if (StringUtils.isBlank(model.getKeywords()) && (StringUtils.isBlank(model.getLat()) && StringUtils.isBlank(model.getLng()))) {
|
if (StringUtils.isBlank(model.getKeywords()) && (StringUtils.isBlank(model.getLat()) && StringUtils.isBlank(model.getLng()))) {
|
||||||
@@ -1353,7 +1427,7 @@ public class AddrSvcController {
|
|||||||
* @param model
|
* @param model
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Object listCityAction (AddressModel model){
|
public Object listCityAction(AddressModel model) {
|
||||||
RestfulModelAndView mav = new RestfulModelAndView();
|
RestfulModelAndView mav = new RestfulModelAndView();
|
||||||
HttpRequest request = new HttpRequest();
|
HttpRequest request = new HttpRequest();
|
||||||
JSONObject json = null;
|
JSONObject json = null;
|
||||||
@@ -1413,7 +1487,7 @@ public class AddrSvcController {
|
|||||||
* @param model
|
* @param model
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Object listProvinceAction (AddressModel model){
|
public Object listProvinceAction(AddressModel model) {
|
||||||
RestfulModelAndView mav = new RestfulModelAndView();
|
RestfulModelAndView mav = new RestfulModelAndView();
|
||||||
HttpRequest request = new HttpRequest();
|
HttpRequest request = new HttpRequest();
|
||||||
JSONObject json = null;
|
JSONObject json = null;
|
||||||
@@ -1465,7 +1539,7 @@ public class AddrSvcController {
|
|||||||
* @param model
|
* @param model
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Object listDistrictAction (AddressModel model){
|
public Object listDistrictAction(AddressModel model) {
|
||||||
RestfulModelAndView mav = new RestfulModelAndView();
|
RestfulModelAndView mav = new RestfulModelAndView();
|
||||||
HttpRequest request = new HttpRequest();
|
HttpRequest request = new HttpRequest();
|
||||||
JSONObject json = null;
|
JSONObject json = null;
|
||||||
@@ -1526,7 +1600,7 @@ public class AddrSvcController {
|
|||||||
return mav;
|
return mav;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object listTownshipAction (AddressModel model){
|
public Object listTownshipAction(AddressModel model) {
|
||||||
RestfulModelAndView mav = new RestfulModelAndView();
|
RestfulModelAndView mav = new RestfulModelAndView();
|
||||||
HttpRequest request = new HttpRequest();
|
HttpRequest request = new HttpRequest();
|
||||||
JSONObject json = null;
|
JSONObject json = null;
|
||||||
@@ -1594,7 +1668,7 @@ public class AddrSvcController {
|
|||||||
return mav;
|
return mav;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object levelAction (AddressModel model){
|
public Object levelAction(AddressModel model) {
|
||||||
RestfulModelAndView mav = new RestfulModelAndView();
|
RestfulModelAndView mav = new RestfulModelAndView();
|
||||||
HttpRequest request = new HttpRequest();
|
HttpRequest request = new HttpRequest();
|
||||||
JSONObject json = null;
|
JSONObject json = null;
|
||||||
@@ -1627,15 +1701,15 @@ public class AddrSvcController {
|
|||||||
return mav;
|
return mav;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDistrictStatService (DistrictStatService districtStatService){
|
public void setDistrictStatService(DistrictStatService districtStatService) {
|
||||||
this.districtStatService = districtStatService;
|
this.districtStatService = districtStatService;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDistrictService (DistrictService districtService){
|
public void setDistrictService(DistrictService districtService) {
|
||||||
this.districtService = districtService;
|
this.districtService = districtService;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setVillageIdentifyService (VillageIdentifyService villageIdentifyService){
|
public void setVillageIdentifyService(VillageIdentifyService villageIdentifyService) {
|
||||||
this.villageIdentifyService = villageIdentifyService;
|
this.villageIdentifyService = villageIdentifyService;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user