|
|
@@ -94,6 +94,9 @@ public class WorkContactEmployeeServiceImpl extends ServiceImpl<WorkContactEmplo
|
|
|
|
|
|
for (int i = 0; i < j; i++) {
|
|
|
Map<String, Object> map = new HashMap<String,Object>(); //数据采用的哈希表结构
|
|
|
+ if(list.get(i).getOpenId() == null || list.get(i).getOpenId().isEmpty()){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
map.put("openid", list.get(i).getOpenId());
|
|
|
map.put("appid", list.get(i).getAppId());
|
|
|
map.put("private_domain", 1);
|
|
|
@@ -101,8 +104,6 @@ public class WorkContactEmployeeServiceImpl extends ServiceImpl<WorkContactEmplo
|
|
|
resList.add(map);
|
|
|
}
|
|
|
|
|
|
- System.out.println(resList);
|
|
|
-
|
|
|
/*请求typer*/
|
|
|
HttpPost post = new HttpPost("http://yitian.mokagm.com/v1/external/fans/info");
|
|
|
// (2) 使用HttpClient发送get请求,获得返回结果HttpResponse
|
|
|
@@ -122,11 +123,9 @@ public class WorkContactEmployeeServiceImpl extends ServiceImpl<WorkContactEmplo
|
|
|
if (response.getStatusLine().getStatusCode() == 200) {
|
|
|
HttpEntity resEntity = response.getEntity();
|
|
|
String message = EntityUtils.toString(resEntity, "utf-8");
|
|
|
- //System.out.println(message);
|
|
|
JSONObject jsonObject = JSON.parseObject(message);
|
|
|
Object resMap;
|
|
|
if (jsonObject.get("data") != null) {
|
|
|
- System.out.println(jsonObject.get("data"));
|
|
|
responseList = jsonObject.getJSONArray("data");
|
|
|
|
|
|
}
|
|
|
@@ -136,12 +135,13 @@ public class WorkContactEmployeeServiceImpl extends ServiceImpl<WorkContactEmplo
|
|
|
return list;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
int resLen = responseList.size();
|
|
|
for (int i = 0; i < j; i++) {
|
|
|
for(t=0;t<resLen;t++) {
|
|
|
//匹配成功的
|
|
|
- if(list.get(i).getOpenId() != null && responseList.getJSONObject(i).get("openid").equals(list.get(i).getOpenId())){
|
|
|
- list.get(i).setTyperTag(responseList.getJSONObject(i).get("label").toString());
|
|
|
+ if(list.get(i).getOpenId() != null && responseList.getJSONObject(t).get("openid").equals(list.get(i).getOpenId())){
|
|
|
+ list.get(i).setTyperTag(responseList.getJSONObject(t).get("label").toString());
|
|
|
}
|
|
|
}
|
|
|
}
|