南京银行涉农优化
This commit is contained in:
+15
-4
@@ -16,6 +16,7 @@ import com.fangjia.service.datastore.DistrictService;
|
||||
import com.fangjia.service.district.DistrictStatService;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import net.sf.json.JSONObject;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
@@ -412,8 +413,8 @@ public class AddrSvcController {
|
||||
params.put("address", address);
|
||||
String type = StringUtils.isNotBlank(model.getType()) ? model.getType() : null;
|
||||
params.put("type", type);
|
||||
params.put("showFullValue", StringUtils.isNotBlank(model.getShowFullValue()) ? model.getShowFullValue() : null);
|
||||
params.put("showTestValue", StringUtils.isNotBlank(model.getShowTestValue()) ? model.getShowTestValue() : null);
|
||||
params.put("showFullValue", "2");
|
||||
params.put("showTestValue", "2");
|
||||
Integer radius = model.getRadius();
|
||||
params.put("radius", (radius != null && radius != 0) ? radius.toString() : null);
|
||||
try {
|
||||
@@ -442,11 +443,16 @@ public class AddrSvcController {
|
||||
//我们 type :1 对私 2 对共
|
||||
String qltype = "2".equals(type) ? "1" : "0";
|
||||
Map<String, String> map = senRequest(address, qltype);
|
||||
// 如果涉农结果不一样,用齐梁结果
|
||||
// 涉农结果不一样
|
||||
if (!map.get("verifyFlag").equals(result.get("verifyFlag"))) {
|
||||
//有市辖建制镇,用我们
|
||||
if ("是".equals(result.get("administrativeTowns"))) {
|
||||
basicModel.setResult(result);
|
||||
} else {
|
||||
map.put("addrVerify", result.getString("addrVerify"));
|
||||
map.put("typeName", areaMap.get(map.get("typeCode")));
|
||||
basicModel.setResult(map);
|
||||
}
|
||||
} else {
|
||||
basicModel.setResult(result);
|
||||
}
|
||||
@@ -529,7 +535,11 @@ public class AddrSvcController {
|
||||
// 获取各个值并放入 Map
|
||||
// dataMap.put("code", jsonObject.get("code").getAsString());
|
||||
// dataMap.put("msg", jsonObject.get("msg").getAsString());
|
||||
JsonObject data = jsonObject.getAsJsonObject("data");
|
||||
JsonElement dataElement = jsonObject.get("data");
|
||||
if (dataElement != null && !dataElement.isJsonNull() && dataElement.isJsonObject()) {
|
||||
JsonObject data = dataElement.getAsJsonObject();
|
||||
// 在这里继续处理 data 对象
|
||||
|
||||
if (data != null && !data.isJsonNull()) {
|
||||
|
||||
// dataMap.put("version", data.get("version").getAsString());
|
||||
@@ -555,6 +565,7 @@ public class AddrSvcController {
|
||||
dataMap.put("devDistrict", "是");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
httpResponse.close();
|
||||
return dataMap;
|
||||
|
||||
Reference in New Issue
Block a user