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