Commit b3c5c7e5 by yangyang

内蒙时空相关接口对接(内蒙)

parent fc9caf2b
...@@ -163,49 +163,54 @@ public class PeopleServiceImpl implements PeopleService { ...@@ -163,49 +163,54 @@ public class PeopleServiceImpl implements PeopleService {
public List getXnXxInfo(String objectType, String objectValue) { public List getXnXxInfo(String objectType, String objectValue) {
/*手机信息目录*/ /*手机信息目录*/
List childrenList = new ArrayList(); List childrenList = new ArrayList();
// qq 微信等
HttpEntity<JSONObject> jsonObject = restTemplate.getForEntity("http://26.3.13.120:8501/nmsj/getMyWxQqZcXxFw?xnhm=" + objectValue, JSONObject.class); /* HttpEntity<JSONObject> jsonObject = restTemplate.getForEntity("http://26.3.13.120:8501/nmsj/getMyWxQqZcXxFw?xnhm=" + objectValue, JSONObject.class);
if (StringUtils.isNotEmpty(String.valueOf(jsonObject.getBody()))) { if (StringUtils.isNotEmpty(String.valueOf(jsonObject.getBody()))) {
if (jsonObject.getBody().containsKey("data")) { if (jsonObject.getBody().containsKey("data")) {
LinkedHashMap resultJson = (LinkedHashMap) jsonObject.getBody().get("data");//获取返回的数据结果 LinkedHashMap resultJson = (LinkedHashMap) jsonObject.getBody().get("data");//获取返回的数据结果
List<LinkedHashMap> array = (List<LinkedHashMap>) resultJson.get("rows"); List<LinkedHashMap> array = (List<LinkedHashMap>) resultJson.get("rows");
for (int i = 0; i < array.size(); i++) { if(null!=array){
LinkedHashMap object = array.get(i); for (int i = 0; i < array.size(); i++) {
String bshxx = (String) object.get("bshxx"); LinkedHashMap object = array.get(i);
String bshlx = (String) object.get("bshlx"); String bshxx = (String) object.get("bshxx");
PeopleInfo peopleInfo1 = new PeopleInfo(); String bshlx = (String) object.get("bshlx");
if ("06".equals(bshlx)) { PeopleInfo peopleInfo1 = new PeopleInfo();
peopleInfo1.setObjectType("06"); if ("06".equals(bshlx)) {
peopleInfo1.setObjectValue(bshxx); peopleInfo1.setObjectType("06");
childrenList.add(peopleInfo1); peopleInfo1.setObjectValue(bshxx);
} else if ("07".equals(bshlx)) { childrenList.add(peopleInfo1);
peopleInfo1.setObjectType("07"); } else if ("07".equals(bshlx)) {
peopleInfo1.setObjectValue(bshxx); peopleInfo1.setObjectType("07");
childrenList.add(peopleInfo1); peopleInfo1.setObjectValue(bshxx);
childrenList.add(peopleInfo1);
}
} }
} }
} }
} }*/
// 四码信息
HttpEntity<JSONObject> jsonObject2 = restTemplate.getForEntity("http://26.3.13.120:8501/nmsj/getSjXx?sjhm=" + objectValue, JSONObject.class); HttpEntity<JSONObject> jsonObject2 = restTemplate.getForEntity("http://26.3.13.120:8501/nmsj/getSjXx?sjhm=" + objectValue, JSONObject.class);
if (StringUtils.isNotEmpty(String.valueOf(jsonObject2.getBody()))) { if (StringUtils.isNotEmpty(String.valueOf(jsonObject2.getBody()))) {
if (jsonObject2.getBody().containsKey("data")) { if (jsonObject2.getBody().containsKey("data")) {
JSONObject resultJson = jsonObject2.getBody().getJSONObject("data");//获取返回的数据结果 JSONObject resultJson = jsonObject2.getBody().getJSONObject("data");//获取返回的数据结果
JSONArray array = resultJson.getJSONObject("rows").getJSONArray("bshxx"); JSONArray array = resultJson.getJSONObject("rows").getJSONArray("bshxx");
System.out.println(array); System.out.println(array);
for (int i = 0; i < resultJson.size(); i++) { if(array.size()>0){
JSONObject object = array.getJSONObject(i); for (int i = 0; i < resultJson.size(); i++) {
String bshxx = (String) object.get("bshxx"); JSONObject object = array.getJSONObject(i);
String bshlx = (String) object.get("bshlx"); String bshxx = (String) object.get("bshxx");
PeopleInfo peopleInfo1 = new PeopleInfo(); String bshlx = (String) object.get("bshlx");
if ("04".equals(bshlx)) { PeopleInfo peopleInfo1 = new PeopleInfo();
peopleInfo1.setObjectType("08"); if ("04".equals(bshlx)) {
peopleInfo1.setObjectValue(bshxx); peopleInfo1.setObjectType("08");
childrenList.add(peopleInfo1); peopleInfo1.setObjectValue(bshxx);
} else if ("05".equals(bshlx)) { childrenList.add(peopleInfo1);
peopleInfo1.setObjectType("05"); } else if ("05".equals(bshlx)) {
peopleInfo1.setObjectValue(bshxx); peopleInfo1.setObjectType("05");
childrenList.add(peopleInfo1); peopleInfo1.setObjectValue(bshxx);
childrenList.add(peopleInfo1);
}
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment