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