12-18-人员管理大屏-修复循环注入版-修复timeType版-消息回复-完善-修复版-优化分包公司查询版-修复数据-优化查询-完善-修改版
This commit is contained in:
@ -2806,7 +2806,6 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B
|
||||
for (SubConstructionUser constructionUser : list) {
|
||||
if (onlineUserList.contains(constructionUser.getSysUserId().toString())){
|
||||
//如果是此项目的在线人员 没有缓存信息 应该是还没来得及发送坐标信息进行缓存
|
||||
zx++;
|
||||
//此项目 在线的 userId 去获取缓存的坐标信息 GpsEquipmentServiceImpl.setData()
|
||||
String key = "rydw_userId_:" + constructionUser.getSysUserId();
|
||||
org.dromara.gps.domain.bo.GpsEquipmentSonBo cache = RedisUtils.getCacheObject(key);
|
||||
@ -2828,18 +2827,6 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B
|
||||
cacheSysUserVo.setZhdwsj(cache.getCreateTime());
|
||||
cacheSysUserVo.setAvatarUrl(cache.getAvatar());
|
||||
cacheSysUserVo.setGz(constructionUser.getTypeOfWork());
|
||||
//去判断是什么种类的用户
|
||||
// list.stream().filter(item -> item.getSysUserId().equals(constructionUser.getSysUserId()))
|
||||
// .findFirst().ifPresent(item -> {
|
||||
// //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);
|
||||
// }
|
||||
// });
|
||||
//app用户类型 0-施工人员 1-管理人员 2-分包人员
|
||||
if (cacheSysUserVo.getAppUserType().equals("0")){
|
||||
cacheSysUserVo.setJslx("施工");
|
||||
@ -2848,6 +2835,7 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B
|
||||
cacheSysUserVo.setJslx("分包");
|
||||
fb.set(fb.getAndIncrement()+1);
|
||||
}
|
||||
zx++;
|
||||
info.add(cacheSysUserVo);
|
||||
}else {
|
||||
lx++;
|
||||
@ -3002,12 +2990,17 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B
|
||||
ryglWebSocketVo.setZzId(info.getContractorId());
|
||||
//分包组织名称
|
||||
if (info.getContractorId() != null) {
|
||||
boolean flag = false;
|
||||
for (SubContractor subContractor : SubContractors) {
|
||||
if (subContractor.getId().equals(info.getContractorId())) {
|
||||
flag = true;
|
||||
ryglWebSocketVo.setZzmc(subContractor.getName());
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (!flag){
|
||||
ryglWebSocketVo.setZzmc("暂无名称");
|
||||
}
|
||||
}
|
||||
//总人数 先设置1
|
||||
ryglWebSocketVo.setZrs(finalTime);
|
||||
@ -3027,7 +3020,11 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B
|
||||
//班组组织id
|
||||
ryglWebSocketVo.setZzId(info.getTeamId());
|
||||
//班组组织名称
|
||||
ryglWebSocketVo.setZzmc(info.getTeamName());
|
||||
if (info.getTeamName() != null) {
|
||||
ryglWebSocketVo.setZzmc(info.getTeamName());
|
||||
}else {
|
||||
ryglWebSocketVo.setZzmc("暂无班组名称");
|
||||
}
|
||||
//总人数
|
||||
ryglWebSocketVo.setZrs(finalTime);
|
||||
ryglWebSocketVo.setDgrs(getDgrs(info.getSysUserId(),finalTime,projectId,attendanceList));
|
||||
@ -3045,28 +3042,9 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B
|
||||
* 获取到岗人数 根据时间类型 返回到岗次数
|
||||
*/
|
||||
private Long getDgrs(Long userId,Long time,Long projectId,List<BusAttendance> attendanceList) {
|
||||
// 今天所有用户的打卡记录
|
||||
// 过滤出该用户的打卡记录
|
||||
List<BusAttendance> busAttendances = attendanceList.stream().filter(item -> Objects.equals(item.getUserId(), userId)).toList();
|
||||
// List<BusAttendance> attendanceList;
|
||||
// LambdaQueryWrapper<BusAttendance> lqw = new LambdaQueryWrapper<BusAttendance>()
|
||||
// .eq(BusAttendance::getProjectId, projectId)
|
||||
// .eq(BusAttendance::getUserId, userId);
|
||||
// if (time == 1L) {
|
||||
// lqw.eq(BusAttendance::getClockDate, LocalDate.now());
|
||||
// } else if (time == 2L) {
|
||||
// // 获取本周一到今天的日期
|
||||
// LocalDate today = LocalDate.now();
|
||||
// LocalDate monday = today.with(DayOfWeek.MONDAY);
|
||||
// lqw.between(BusAttendance::getClockDate, monday, today);
|
||||
// }else if (time == 3L){
|
||||
// // 获取本月1号到今天的日期
|
||||
// LocalDate today = LocalDate.now();
|
||||
// LocalDate firstDayOfMonth = today.with(TemporalAdjusters.firstDayOfMonth());
|
||||
// lqw.between(BusAttendance::getClockDate, firstDayOfMonth, today);
|
||||
// }
|
||||
// lqw.in(BusAttendance::getClockStatus, ATTENDANCE_STATUS)
|
||||
// .apply(" user_id not in (select sys_user_id from sub_construction_user where project_id = {0} and user_role != '0' )", projectId);
|
||||
// attendanceList = this.list(lqw);
|
||||
|
||||
if (busAttendances.isEmpty()){
|
||||
return 0L;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user