南京银行涉农优化
This commit is contained in:
+37
-26
@@ -16,6 +16,7 @@ import com.fangjia.service.datastore.DistrictService;
|
|||||||
import com.fangjia.service.district.DistrictStatService;
|
import com.fangjia.service.district.DistrictStatService;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.JsonArray;
|
import com.google.gson.JsonArray;
|
||||||
|
import com.google.gson.JsonElement;
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
import net.sf.json.JSONObject;
|
import net.sf.json.JSONObject;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
@@ -412,8 +413,8 @@ public class AddrSvcController {
|
|||||||
params.put("address", address);
|
params.put("address", address);
|
||||||
String type = StringUtils.isNotBlank(model.getType()) ? model.getType() : null;
|
String type = StringUtils.isNotBlank(model.getType()) ? model.getType() : null;
|
||||||
params.put("type", type);
|
params.put("type", type);
|
||||||
params.put("showFullValue", StringUtils.isNotBlank(model.getShowFullValue()) ? model.getShowFullValue() : null);
|
params.put("showFullValue", "2");
|
||||||
params.put("showTestValue", StringUtils.isNotBlank(model.getShowTestValue()) ? model.getShowTestValue() : null);
|
params.put("showTestValue", "2");
|
||||||
Integer radius = model.getRadius();
|
Integer radius = model.getRadius();
|
||||||
params.put("radius", (radius != null && radius != 0) ? radius.toString() : null);
|
params.put("radius", (radius != null && radius != 0) ? radius.toString() : null);
|
||||||
try {
|
try {
|
||||||
@@ -442,11 +443,16 @@ public class AddrSvcController {
|
|||||||
//我们 type :1 对私 2 对共
|
//我们 type :1 对私 2 对共
|
||||||
String qltype = "2".equals(type) ? "1" : "0";
|
String qltype = "2".equals(type) ? "1" : "0";
|
||||||
Map<String, String> map = senRequest(address, qltype);
|
Map<String, String> map = senRequest(address, qltype);
|
||||||
// 如果涉农结果不一样,用齐梁结果
|
// 涉农结果不一样
|
||||||
if (!map.get("verifyFlag").equals(result.get("verifyFlag"))) {
|
if (!map.get("verifyFlag").equals(result.get("verifyFlag"))) {
|
||||||
map.put("addrVerify", result.getString("addrVerify"));
|
//有市辖建制镇,用我们
|
||||||
map.put("typeName", areaMap.get(map.get("typeCode")));
|
if ("是".equals(result.get("administrativeTowns"))) {
|
||||||
basicModel.setResult(map);
|
basicModel.setResult(result);
|
||||||
|
} else {
|
||||||
|
map.put("addrVerify", result.getString("addrVerify"));
|
||||||
|
map.put("typeName", areaMap.get(map.get("typeCode")));
|
||||||
|
basicModel.setResult(map);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
basicModel.setResult(result);
|
basicModel.setResult(result);
|
||||||
}
|
}
|
||||||
@@ -529,30 +535,35 @@ public class AddrSvcController {
|
|||||||
// 获取各个值并放入 Map
|
// 获取各个值并放入 Map
|
||||||
// dataMap.put("code", jsonObject.get("code").getAsString());
|
// dataMap.put("code", jsonObject.get("code").getAsString());
|
||||||
// dataMap.put("msg", jsonObject.get("msg").getAsString());
|
// dataMap.put("msg", jsonObject.get("msg").getAsString());
|
||||||
JsonObject data = jsonObject.getAsJsonObject("data");
|
JsonElement dataElement = jsonObject.get("data");
|
||||||
if (data != null && !data.isJsonNull()) {
|
if (dataElement != null && !dataElement.isJsonNull() && dataElement.isJsonObject()) {
|
||||||
|
JsonObject data = dataElement.getAsJsonObject();
|
||||||
|
// 在这里继续处理 data 对象
|
||||||
|
|
||||||
|
if (data != null && !data.isJsonNull()) {
|
||||||
|
|
||||||
// dataMap.put("version", data.get("version").getAsString());
|
// dataMap.put("version", data.get("version").getAsString());
|
||||||
dataMap.put("province", data.get("province").getAsString());
|
dataMap.put("province", data.get("province").getAsString());
|
||||||
dataMap.put("city", data.get("city").getAsString());
|
dataMap.put("city", data.get("city").getAsString());
|
||||||
dataMap.put("district", data.get("district").getAsString());
|
dataMap.put("district", data.get("district").getAsString());
|
||||||
dataMap.put("town", data.get("town").getAsString());
|
dataMap.put("town", data.get("town").getAsString());
|
||||||
dataMap.put("committee", data.get("village").getAsString());
|
dataMap.put("committee", data.get("village").getAsString());
|
||||||
dataMap.put("provinceCode", data.get("provinceCode").getAsString());
|
dataMap.put("provinceCode", data.get("provinceCode").getAsString());
|
||||||
dataMap.put("cityCode", data.get("cityCode").getAsString());
|
dataMap.put("cityCode", data.get("cityCode").getAsString());
|
||||||
dataMap.put("districtCode", data.get("districtCode").getAsString());
|
dataMap.put("districtCode", data.get("districtCode").getAsString());
|
||||||
dataMap.put("townCode", data.get("townCode").getAsString());
|
dataMap.put("townCode", data.get("townCode").getAsString());
|
||||||
dataMap.put("committeeCode", data.get("villageCode").getAsString());
|
dataMap.put("committeeCode", data.get("villageCode").getAsString());
|
||||||
dataMap.put("typeCode", data.get("areaCode").getAsString());
|
dataMap.put("typeCode", data.get("areaCode").getAsString());
|
||||||
dataMap.put("verifyFlag", "0".equals(data.get("farmer").getAsString()) ? "非农" : "农");
|
dataMap.put("verifyFlag", "0".equals(data.get("farmer").getAsString()) ? "非农" : "农");
|
||||||
dataMap.put("countyGov", "0".equals(data.get("isGovt").getAsString()) ? "否" : "是");
|
dataMap.put("countyGov", "0".equals(data.get("isGovt").getAsString()) ? "否" : "是");
|
||||||
// dataMap.put("govtAddr", data.get("govtAddr").isJsonNull() ? null : data.get("govtAddr").getAsString()); // 对于可能为 null 的值,需要判断是否为空
|
// dataMap.put("govtAddr", data.get("govtAddr").isJsonNull() ? null : data.get("govtAddr").getAsString()); // 对于可能为 null 的值,需要判断是否为空
|
||||||
JsonArray indusParkList = data.get("indusParkList").isJsonNull() ? null : data.get("indusParkList").getAsJsonArray();
|
JsonArray indusParkList = data.get("indusParkList").isJsonNull() ? null : data.get("indusParkList").getAsJsonArray();
|
||||||
|
|
||||||
if (indusParkList != null) {
|
if (indusParkList != null) {
|
||||||
JsonObject jsonObject1 = gson.fromJson(indusParkList.get(0), JsonObject.class);
|
JsonObject jsonObject1 = gson.fromJson(indusParkList.get(0), JsonObject.class);
|
||||||
dataMap.put("devDistrictName", jsonObject1.get("indusParkName").getAsString());
|
dataMap.put("devDistrictName", jsonObject1.get("indusParkName").getAsString());
|
||||||
dataMap.put("devDistrict", "是");
|
dataMap.put("devDistrict", "是");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user