ce9a7aea 张雷

人员定位信息接口BUG修改

1 个父辈 3783a0ef
......@@ -108,29 +108,31 @@ public class YwLocationServiceImpl implements ILocationService {
String post = HttpUtil.get(url+"open/information/getEmp.do",pmap);
JSONObject json = JSONObject.parseObject(JSONObject.parseObject(post).get("data").toString());
List<UserBaseInfoYwResult> userList = JSONObject.parseArray(json.get("rows").toString(), UserBaseInfoYwResult.class);
List<Map> onlineList = getOnLineList();
Map<String,Object> onlineMap = getOnLineList();
map.put("onlineCount",onlineMap.size());
for (UserBaseInfoYwResult userBaseInfoYwResult : userList) {
UserBaseInfo userBaseInfo = new UserBaseInfo();
userBaseInfo.setDeviceCode(userBaseInfoYwResult.getDeviceno());
userBaseInfo.setUserName(userBaseInfoYwResult.getEmpname());
userBaseInfo.setUserNo(userBaseInfoYwResult.getEmpno());
userBaseInfo.setUserType("员工");
userBaseInfo.setUserStatus("0");
if(onlineMap.get(userBaseInfoYwResult.getDeviceno())!=null){
userBaseInfo.setUserStatus("1");
}else{
userBaseInfo.setUserStatus("0");
}
list.add(userBaseInfo);
}
map.put("list",list);
map.put("onlineCount",onlineList.size());
return map;
}
public List<Map> getOnLineList(){
List<Map> list = new ArrayList<>();
HashMap<String,Object> map = new HashMap<>();
map.put("username", username);
map.put("password", password);
String post = HttpUtil.get(url+"/open/information/getRealInformation.do",map);
JSONObject json = JSONObject.parseObject(JSONObject.parseObject(post).get("data").toString());
list = JSONObject.parseArray(json.get("list").toString(), Map.class);
return list;
public Map<String,Object> getOnLineList(){
Map<String,Object> map = new HashMap();
List<UserLocation> list = getAllUserGPS();
for (UserLocation userLocation : list) {
map.put(userLocation.getDeviceCode(),"1");
}
return map;
}
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!