12-22-大屏-人员管理
This commit is contained in:
@ -2781,16 +2781,12 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B
|
||||
@Override
|
||||
public Map<String, String> getRyglOnlineUserInfoData(Long projectId){
|
||||
//获取该项目的在线人员 再分辨出种类
|
||||
//先获取该项目所有人员
|
||||
//先获取该项目所有人员 走现有方法
|
||||
LambdaQueryWrapper<SubConstructionUser> lqw = new LambdaQueryWrapper<>();
|
||||
lqw.eq(SubConstructionUser::getProjectId, projectId);
|
||||
lqw.eq(SubConstructionUser::getStatus,"0");
|
||||
//未入场人员也要统计坐标 打卡不统计(存疑)
|
||||
// lqw.and(lqw1 ->
|
||||
// lqw1.isNotNull(SubConstructionUser::getTeamId)
|
||||
// .or()
|
||||
// .isNotNull(SubConstructionUser::getContractorId));
|
||||
List<SubConstructionUser> list = constructionUserService.list(lqw);
|
||||
|
||||
//再去从聊天服务中获取在线的ID
|
||||
List<String> onlineUserList = ChatServerHandler.getOnlineUserList();
|
||||
//先查询出用户列表
|
||||
@ -2804,49 +2800,47 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B
|
||||
AtomicLong sg = new AtomicLong(); //施工
|
||||
sg.set(0);
|
||||
//将属于该项目的在线ID过滤出来
|
||||
Long zs = 0L;
|
||||
for (SubConstructionUser constructionUser : list) {
|
||||
if (onlineUserList.contains(constructionUser.getSysUserId().toString())){
|
||||
//如果是此项目的在线人员 没有缓存信息 应该是还没来得及发送坐标信息进行缓存
|
||||
//此项目 在线的 userId 去获取缓存的坐标信息 GpsEquipmentServiceImpl.setData()
|
||||
String key = "rydw_userId_:" + constructionUser.getSysUserId();
|
||||
org.dromara.gps.domain.bo.GpsEquipmentSonBo cache = RedisUtils.getCacheObject(key);
|
||||
if (cache == null){
|
||||
continue;
|
||||
}
|
||||
SysUserVo cacheSysUserVo = null;
|
||||
for (SysUserVo user : users) {
|
||||
if (user.getUserId().equals(constructionUser.getSysUserId())){
|
||||
cacheSysUserVo = user;
|
||||
break;
|
||||
//先过滤人种
|
||||
for (SysUserVo user : users) {
|
||||
if (user.getUserId().equals(constructionUser.getSysUserId())){
|
||||
if (user.getAppUserType().equals("0") || user.getAppUserType().equals("2")){
|
||||
//再进行在线判断和人种分类
|
||||
if (onlineUserList.contains(constructionUser.getSysUserId().toString())){
|
||||
//此项目 在线的 userId 去获取缓存的坐标信息 GpsEquipmentServiceImpl.setData()
|
||||
String key = "rydw_userId_:" + constructionUser.getSysUserId();
|
||||
org.dromara.gps.domain.bo.GpsEquipmentSonBo cache = RedisUtils.getCacheObject(key);
|
||||
if (cache == null){
|
||||
continue;
|
||||
}
|
||||
user.setJd(cache.getLocLongitude());
|
||||
user.setWd(cache.getLocLatitude());
|
||||
user.setZhdwsj(cache.getCreateTime());
|
||||
user.setAvatarUrl(cache.getAvatar());
|
||||
user.setGz(constructionUser.getTypeOfWork());
|
||||
//app用户类型 0-施工人员 1-管理人员 2-分包人员
|
||||
if (user.getAppUserType().equals("0")){
|
||||
user.setJslx("施工");
|
||||
sg.set(sg.getAndIncrement()+1);
|
||||
}else if (user.getAppUserType().equals("2")){
|
||||
user.setJslx("分包");
|
||||
fb.set(fb.getAndIncrement()+1);
|
||||
}
|
||||
zx++;
|
||||
info.add(user);
|
||||
}else {
|
||||
lx++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (cacheSysUserVo == null){
|
||||
continue;
|
||||
}
|
||||
cacheSysUserVo.setJd(cache.getLocLongitude());
|
||||
cacheSysUserVo.setWd(cache.getLocLatitude());
|
||||
cacheSysUserVo.setZhdwsj(cache.getCreateTime());
|
||||
cacheSysUserVo.setAvatarUrl(cache.getAvatar());
|
||||
cacheSysUserVo.setGz(constructionUser.getTypeOfWork());
|
||||
//app用户类型 0-施工人员 1-管理人员 2-分包人员
|
||||
if (cacheSysUserVo.getAppUserType().equals("0")){
|
||||
cacheSysUserVo.setJslx("施工");
|
||||
sg.set(sg.getAndIncrement()+1);
|
||||
}else if (cacheSysUserVo.getAppUserType().equals("2")){
|
||||
cacheSysUserVo.setJslx("分包");
|
||||
fb.set(fb.getAndIncrement()+1);
|
||||
}
|
||||
zx++;
|
||||
info.add(cacheSysUserVo);
|
||||
}else {
|
||||
lx++;
|
||||
}
|
||||
}
|
||||
//将数据返回
|
||||
Map<String, String> map = new HashMap<>();
|
||||
map.put("zs",String.valueOf(zx+lx)); //总数
|
||||
map.put("zx", String.valueOf(zx)); //在线
|
||||
map.put("lx", String.valueOf(lx)); //离线
|
||||
map.put("zs",String.valueOf(zx + lx)); //总数
|
||||
map.put("zx", String.valueOf(zx));
|
||||
map.put("lx", String.valueOf(lx));
|
||||
map.put("fbsl", String.valueOf(fb.get())); //分包
|
||||
map.put("sg", String.valueOf(sg.get())); //施工
|
||||
map.put("info", JSONUtil.toJsonStr(info)); //jd经度 wd维度 jslx角色类型
|
||||
|
||||
Reference in New Issue
Block a user