人员定位信息接口BUG修改
正在显示
1 个修改的文件
包含
14 行增加
和
12 行删除
... | @@ -108,29 +108,31 @@ public class YwLocationServiceImpl implements ILocationService { | ... | @@ -108,29 +108,31 @@ public class YwLocationServiceImpl implements ILocationService { |
108 | String post = HttpUtil.get(url+"open/information/getEmp.do",pmap); | 108 | String post = HttpUtil.get(url+"open/information/getEmp.do",pmap); |
109 | JSONObject json = JSONObject.parseObject(JSONObject.parseObject(post).get("data").toString()); | 109 | JSONObject json = JSONObject.parseObject(JSONObject.parseObject(post).get("data").toString()); |
110 | List<UserBaseInfoYwResult> userList = JSONObject.parseArray(json.get("rows").toString(), UserBaseInfoYwResult.class); | 110 | List<UserBaseInfoYwResult> userList = JSONObject.parseArray(json.get("rows").toString(), UserBaseInfoYwResult.class); |
111 | List<Map> onlineList = getOnLineList(); | 111 | Map<String,Object> onlineMap = getOnLineList(); |
112 | map.put("onlineCount",onlineMap.size()); | ||
112 | for (UserBaseInfoYwResult userBaseInfoYwResult : userList) { | 113 | for (UserBaseInfoYwResult userBaseInfoYwResult : userList) { |
113 | UserBaseInfo userBaseInfo = new UserBaseInfo(); | 114 | UserBaseInfo userBaseInfo = new UserBaseInfo(); |
114 | userBaseInfo.setDeviceCode(userBaseInfoYwResult.getDeviceno()); | 115 | userBaseInfo.setDeviceCode(userBaseInfoYwResult.getDeviceno()); |
115 | userBaseInfo.setUserName(userBaseInfoYwResult.getEmpname()); | 116 | userBaseInfo.setUserName(userBaseInfoYwResult.getEmpname()); |
116 | userBaseInfo.setUserNo(userBaseInfoYwResult.getEmpno()); | 117 | userBaseInfo.setUserNo(userBaseInfoYwResult.getEmpno()); |
117 | userBaseInfo.setUserType("员工"); | 118 | userBaseInfo.setUserType("员工"); |
118 | userBaseInfo.setUserStatus("0"); | 119 | if(onlineMap.get(userBaseInfoYwResult.getDeviceno())!=null){ |
120 | userBaseInfo.setUserStatus("1"); | ||
121 | }else{ | ||
122 | userBaseInfo.setUserStatus("0"); | ||
123 | } | ||
119 | list.add(userBaseInfo); | 124 | list.add(userBaseInfo); |
120 | } | 125 | } |
121 | map.put("list",list); | 126 | map.put("list",list); |
122 | map.put("onlineCount",onlineList.size()); | ||
123 | return map; | 127 | return map; |
124 | } | 128 | } |
125 | 129 | ||
126 | public List<Map> getOnLineList(){ | 130 | public Map<String,Object> getOnLineList(){ |
127 | List<Map> list = new ArrayList<>(); | 131 | Map<String,Object> map = new HashMap(); |
128 | HashMap<String,Object> map = new HashMap<>(); | 132 | List<UserLocation> list = getAllUserGPS(); |
129 | map.put("username", username); | 133 | for (UserLocation userLocation : list) { |
130 | map.put("password", password); | 134 | map.put(userLocation.getDeviceCode(),"1"); |
131 | String post = HttpUtil.get(url+"/open/information/getRealInformation.do",map); | 135 | } |
132 | JSONObject json = JSONObject.parseObject(JSONObject.parseObject(post).get("data").toString()); | 136 | return map; |
133 | list = JSONObject.parseArray(json.get("list").toString(), Map.class); | ||
134 | return list; | ||
135 | } | 137 | } |
136 | } | 138 | } | ... | ... |
-
请 注册 或 登录 后发表评论