12-17-人员管理大屏-修复循环注入版-修复timeType版-消息回复-完善-修复版-优化分包公司查询版-修复数据

This commit is contained in:
2025-12-17 20:35:29 +08:00
parent 61c2cdd56a
commit a4b0ec835e

View File

@ -2868,7 +2868,7 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B
public void getAttendanceInfo(Long projectId,Long timeType,Map<String, String> map){
//构建数据
//timeType 1:今天 2:本周 3:本月
Long zrs; //总人数
Long zrs = 0L; //总人数
Long cqr = 0L; //出勤人数
BigDecimal cql = BigDecimal.ZERO; //出勤率
//查询此项目的所有人员
@ -2918,7 +2918,7 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B
vo.setDgl(BigDecimal.ZERO);
}
fbcqr = fbcqr + vo.getDgrs();
// zrs = zrs + vo.getZrs();
zrs = zrs + vo.getZrs();
}
for (RyglWebSocketVo vo : bzList) {
if (vo.getZrs()>0){
@ -2930,22 +2930,22 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B
vo.setDgl(BigDecimal.ZERO);
}
bzcqr = bzcqr + vo.getDgrs();
// zrs = zrs + vo.getZrs();
zrs = zrs + vo.getZrs();
}
//总人数
if (timeType == 2L) {
// 获取本周一到今天的天数
LocalDate today = LocalDate.now();
LocalDate monday = today.with(DayOfWeek.MONDAY);
timeType = ChronoUnit.DAYS.between(monday, today) + 1;
} else if (timeType == 3L) {
// 获取本月1日到今天的天数
LocalDate today = LocalDate.now();
LocalDate firstDay = today.withDayOfMonth(1);
timeType = ChronoUnit.DAYS.between(firstDay, today) + 1;
}
zrs = (long) list.size() * timeType;
// if (timeType == 2L) {
// // 获取本周一到今天的天数
// LocalDate today = LocalDate.now();
// LocalDate monday = today.with(DayOfWeek.MONDAY);
// timeType = ChronoUnit.DAYS.between(monday, today) + 1;
// } else if (timeType == 3L) {
// // 获取本月1日到今天的天数
// LocalDate today = LocalDate.now();
// LocalDate firstDay = today.withDayOfMonth(1);
// timeType = ChronoUnit.DAYS.between(firstDay, today) + 1;
// }
// zrs = (long) list.size() * timeType;
//总出勤人
cqr = fbcqr + bzcqr;
//出勤率
@ -3044,17 +3044,15 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B
if (time == 1L) {
lqw.eq(BusAttendance::getClockDate, LocalDate.now());
} else if (time == 2L) {
// 获取本周一和周日的日期
// 获取本周一到今天的日期
LocalDate today = LocalDate.now();
LocalDate monday = today.with(DayOfWeek.MONDAY);
LocalDate sunday = today.with(DayOfWeek.SUNDAY);
lqw.between(BusAttendance::getClockDate, monday, sunday);
lqw.between(BusAttendance::getClockDate, monday, today);
}else if (time == 3L){
// 获取本月第一天和最后一天
// 获取本月1号到今天的日期
LocalDate today = LocalDate.now();
LocalDate firstDayOfMonth = today.with(TemporalAdjusters.firstDayOfMonth());
LocalDate lastDayOfMonth = today.with(TemporalAdjusters.lastDayOfMonth());
lqw.between(BusAttendance::getClockDate, firstDayOfMonth, lastDayOfMonth);
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);