12-17-人员管理大屏-修复循环注入版-修复timeType版-消息回复
This commit is contained in:
@ -38,7 +38,6 @@ import org.dromara.contractor.service.ISubConstructionUserService;
|
|||||||
import org.dromara.project.domain.*;
|
import org.dromara.project.domain.*;
|
||||||
import org.dromara.project.domain.bo.BusAttendanceBo;
|
import org.dromara.project.domain.bo.BusAttendanceBo;
|
||||||
import org.dromara.project.domain.dto.attendance.*;
|
import org.dromara.project.domain.dto.attendance.*;
|
||||||
import org.dromara.project.domain.enums.BusAttendanceClockStatusEnum;
|
|
||||||
import org.dromara.project.domain.enums.BusAttendanceCommuterEnum;
|
import org.dromara.project.domain.enums.BusAttendanceCommuterEnum;
|
||||||
import org.dromara.project.domain.enums.BusAttendanceStatusEnum;
|
import org.dromara.project.domain.enums.BusAttendanceStatusEnum;
|
||||||
import org.dromara.project.domain.vo.BusAttendanceRuleVo;
|
import org.dromara.project.domain.vo.BusAttendanceRuleVo;
|
||||||
@ -125,9 +124,9 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B
|
|||||||
|
|
||||||
|
|
||||||
// 出勤状态(正常、迟到、早退)
|
// 出勤状态(正常、迟到、早退)
|
||||||
private static final Set<String> ATTENDANCE_STATUS = new HashSet<>(Arrays.asList(BusAttendanceClockStatusEnum.NORMAL.getValue(),
|
private static final Set<String> ATTENDANCE_STATUS = new HashSet<>(Arrays.asList(NORMAL.getValue(),
|
||||||
LATE.getValue(), LEAVEEARLY.getValue()
|
LATE.getValue(), LEAVEEARLY.getValue()
|
||||||
, BusAttendanceClockStatusEnum.REISSUE.getValue()));
|
, REISSUE.getValue()));
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -203,7 +202,7 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.filter(java.util.Objects::nonNull) // 过滤转换失败的null
|
.filter(Objects::nonNull) // 过滤转换失败的null
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
List<SysOssVo> sysOssVos = ossService.listByIds(longList);
|
List<SysOssVo> sysOssVos = ossService.listByIds(longList);
|
||||||
Map<Long, String> ossMap = sysOssVos.stream().collect(Collectors.toMap(SysOssVo::getOssId, SysOssVo::getUrl));
|
Map<Long, String> ossMap = sysOssVos.stream().collect(Collectors.toMap(SysOssVo::getOssId, SysOssVo::getUrl));
|
||||||
@ -244,13 +243,13 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 统计当天考勤状态
|
// 统计当天考勤状态
|
||||||
if (BusAttendanceClockStatusEnum.LEAVE.getValue().equals(clockAllDayStatus)) {
|
if (LEAVE.getValue().equals(clockAllDayStatus)) {
|
||||||
return;
|
return;
|
||||||
} else if (BusAttendanceClockStatusEnum.NORMAL.getValue().equals(clockInStatus)
|
} else if (NORMAL.getValue().equals(clockInStatus)
|
||||||
&& BusAttendanceClockStatusEnum.NORMAL.getValue().equals(clockOutStatus)) {
|
&& NORMAL.getValue().equals(clockOutStatus)) {
|
||||||
status = BusAttendanceStatusEnum.NORMAL.getValue();
|
status = BusAttendanceStatusEnum.NORMAL.getValue();
|
||||||
} else if (BusAttendanceClockStatusEnum.REISSUE.getValue().equals(clockInStatus)
|
} else if (REISSUE.getValue().equals(clockInStatus)
|
||||||
|| BusAttendanceClockStatusEnum.REISSUE.getValue().equals(clockOutStatus)) {
|
|| REISSUE.getValue().equals(clockOutStatus)) {
|
||||||
status = BusAttendanceStatusEnum.REISSUE.getValue();
|
status = BusAttendanceStatusEnum.REISSUE.getValue();
|
||||||
} else {
|
} else {
|
||||||
status = BusAttendanceStatusEnum.ERROR.getValue();
|
status = BusAttendanceStatusEnum.ERROR.getValue();
|
||||||
@ -355,13 +354,13 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 统计当天考勤状态
|
// 统计当天考勤状态
|
||||||
if (BusAttendanceClockStatusEnum.LEAVE.getValue().equals(clockAllDayStatus)) {
|
if (LEAVE.getValue().equals(clockAllDayStatus)) {
|
||||||
return;
|
return;
|
||||||
} else if (BusAttendanceClockStatusEnum.NORMAL.getValue().equals(clockInStatus)
|
} else if (NORMAL.getValue().equals(clockInStatus)
|
||||||
&& BusAttendanceClockStatusEnum.NORMAL.getValue().equals(clockOutStatus)) {
|
&& NORMAL.getValue().equals(clockOutStatus)) {
|
||||||
status = BusAttendanceStatusEnum.NORMAL.getValue();
|
status = BusAttendanceStatusEnum.NORMAL.getValue();
|
||||||
} else if (BusAttendanceClockStatusEnum.REISSUE.getValue().equals(clockInStatus)
|
} else if (REISSUE.getValue().equals(clockInStatus)
|
||||||
|| BusAttendanceClockStatusEnum.REISSUE.getValue().equals(clockOutStatus)) {
|
|| REISSUE.getValue().equals(clockOutStatus)) {
|
||||||
status = BusAttendanceStatusEnum.REISSUE.getValue();
|
status = BusAttendanceStatusEnum.REISSUE.getValue();
|
||||||
} else {
|
} else {
|
||||||
status = BusAttendanceStatusEnum.ERROR.getValue();
|
status = BusAttendanceStatusEnum.ERROR.getValue();
|
||||||
@ -553,7 +552,7 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B
|
|||||||
attendance.setClockStatus(LATE.getValue());
|
attendance.setClockStatus(LATE.getValue());
|
||||||
attendance.setMinuteCount(getMinutesDifference(now, busAttendanceRuleVo.getClockInTime()));
|
attendance.setMinuteCount(getMinutesDifference(now, busAttendanceRuleVo.getClockInTime()));
|
||||||
} else {
|
} else {
|
||||||
attendance.setClockStatus(BusAttendanceClockStatusEnum.NORMAL.getValue());
|
attendance.setClockStatus(NORMAL.getValue());
|
||||||
}
|
}
|
||||||
//只要请假,直接归为请假
|
//只要请假,直接归为请假
|
||||||
//LocalDateTime localDateTime = localDate.atTime(busAttendanceRuleVo.getClockInTime());
|
//LocalDateTime localDateTime = localDate.atTime(busAttendanceRuleVo.getClockInTime());
|
||||||
@ -607,7 +606,7 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B
|
|||||||
busAttendance.setClockStatus(LATE.getValue());
|
busAttendance.setClockStatus(LATE.getValue());
|
||||||
busAttendance.setMinuteCount(getMinutesDifference(now, busAttendanceRuleVo.getClockInTime()));
|
busAttendance.setMinuteCount(getMinutesDifference(now, busAttendanceRuleVo.getClockInTime()));
|
||||||
} else {
|
} else {
|
||||||
busAttendance.setClockStatus(BusAttendanceClockStatusEnum.NORMAL.getValue());
|
busAttendance.setClockStatus(NORMAL.getValue());
|
||||||
}
|
}
|
||||||
//只要请假,直接归为请假
|
//只要请假,直接归为请假
|
||||||
//LocalDateTime localDateTime = localDate.atTime(busAttendanceRuleVo.getClockInTime());
|
//LocalDateTime localDateTime = localDate.atTime(busAttendanceRuleVo.getClockInTime());
|
||||||
@ -618,7 +617,7 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B
|
|||||||
busAttendance.setSource(req.getSource());
|
busAttendance.setSource(req.getSource());
|
||||||
busAttendance.setSn(req.getSn());
|
busAttendance.setSn(req.getSn());
|
||||||
//如果是缺卡需要上传人脸
|
//如果是缺卡需要上传人脸
|
||||||
if (oldStatus.equals(BusAttendanceClockStatusEnum.UNCLOCK.getValue())) {
|
if (oldStatus.equals(UNCLOCK.getValue())) {
|
||||||
SysOssVo upload = ossService.upload(file);
|
SysOssVo upload = ossService.upload(file);
|
||||||
busAttendance.setFacePic(upload.getOssId().toString());
|
busAttendance.setFacePic(upload.getOssId().toString());
|
||||||
}
|
}
|
||||||
@ -633,12 +632,12 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B
|
|||||||
if ("1".equals(req.getSource())) {
|
if ("1".equals(req.getSource())) {
|
||||||
busAttendance.setSource(req.getSource());
|
busAttendance.setSource(req.getSource());
|
||||||
busAttendance.setSn(req.getSn());
|
busAttendance.setSn(req.getSn());
|
||||||
if (busAttendance.getClockStatus().equals(BusAttendanceClockStatusEnum.UNCLOCK.getValue())) {
|
if (busAttendance.getClockStatus().equals(UNCLOCK.getValue())) {
|
||||||
SysOssVo upload = ossService.upload(file);
|
SysOssVo upload = ossService.upload(file);
|
||||||
busAttendance.setFacePic(upload.getOssId().toString());
|
busAttendance.setFacePic(upload.getOssId().toString());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (busAttendance.getClockStatus().equals(BusAttendanceClockStatusEnum.UNCLOCK.getValue())) {
|
if (busAttendance.getClockStatus().equals(UNCLOCK.getValue())) {
|
||||||
throw new ServiceException("下班缺卡记录已生成,不能更新");
|
throw new ServiceException("下班缺卡记录已生成,不能更新");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -650,7 +649,7 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B
|
|||||||
busAttendance.setClockStatus(LEAVEEARLY.getValue());
|
busAttendance.setClockStatus(LEAVEEARLY.getValue());
|
||||||
busAttendance.setMinuteCount(getMinutesDifference(now, busAttendanceRuleVo.getClockOutTime()));
|
busAttendance.setMinuteCount(getMinutesDifference(now, busAttendanceRuleVo.getClockOutTime()));
|
||||||
} else {
|
} else {
|
||||||
busAttendance.setClockStatus(BusAttendanceClockStatusEnum.NORMAL.getValue());
|
busAttendance.setClockStatus(NORMAL.getValue());
|
||||||
busAttendance.setMinuteCount(0);
|
busAttendance.setMinuteCount(0);
|
||||||
}
|
}
|
||||||
//只要请假,直接归为请假
|
//只要请假,直接归为请假
|
||||||
@ -669,7 +668,7 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B
|
|||||||
attendance.setClockStatus(LEAVEEARLY.getValue());
|
attendance.setClockStatus(LEAVEEARLY.getValue());
|
||||||
attendance.setMinuteCount(getMinutesDifference(now, busAttendanceRuleVo.getClockOutTime()));
|
attendance.setMinuteCount(getMinutesDifference(now, busAttendanceRuleVo.getClockOutTime()));
|
||||||
} else {
|
} else {
|
||||||
attendance.setClockStatus(BusAttendanceClockStatusEnum.NORMAL.getValue());
|
attendance.setClockStatus(NORMAL.getValue());
|
||||||
}
|
}
|
||||||
//只要请假,直接归为请假
|
//只要请假,直接归为请假
|
||||||
//LocalDateTime localDateTime = localDate.atTime(busAttendanceRuleVo.getClockInTime());
|
//LocalDateTime localDateTime = localDate.atTime(busAttendanceRuleVo.getClockInTime());
|
||||||
@ -804,12 +803,12 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B
|
|||||||
attendance.setClockStatus(LATE.getValue());
|
attendance.setClockStatus(LATE.getValue());
|
||||||
attendance.setMinuteCount(getMinutesDifference(now, busAttendanceRuleVo.getClockInTime()));
|
attendance.setMinuteCount(getMinutesDifference(now, busAttendanceRuleVo.getClockInTime()));
|
||||||
} else {
|
} else {
|
||||||
attendance.setClockStatus(BusAttendanceClockStatusEnum.NORMAL.getValue());
|
attendance.setClockStatus(NORMAL.getValue());
|
||||||
}
|
}
|
||||||
//只要请假,直接归为请假
|
//只要请假,直接归为请假
|
||||||
LocalDateTime localDateTime = localDate.atTime(busAttendanceRuleVo.getClockInTime());
|
LocalDateTime localDateTime = localDate.atTime(busAttendanceRuleVo.getClockInTime());
|
||||||
if (leaveService.isLeave(localDateTime, userId)) {
|
if (leaveService.isLeave(localDateTime, userId)) {
|
||||||
attendance.setClockStatus(BusAttendanceClockStatusEnum.LEAVE.getValue());
|
attendance.setClockStatus(LEAVE.getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
// 填充信息
|
// 填充信息
|
||||||
@ -858,18 +857,18 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B
|
|||||||
busAttendance.setClockStatus(LATE.getValue());
|
busAttendance.setClockStatus(LATE.getValue());
|
||||||
busAttendance.setMinuteCount(getMinutesDifference(now, busAttendanceRuleVo.getClockInTime()));
|
busAttendance.setMinuteCount(getMinutesDifference(now, busAttendanceRuleVo.getClockInTime()));
|
||||||
} else {
|
} else {
|
||||||
busAttendance.setClockStatus(BusAttendanceClockStatusEnum.NORMAL.getValue());
|
busAttendance.setClockStatus(NORMAL.getValue());
|
||||||
}
|
}
|
||||||
//只要请假,直接归为请假
|
//只要请假,直接归为请假
|
||||||
LocalDateTime localDateTime = localDate.atTime(busAttendanceRuleVo.getClockInTime());
|
LocalDateTime localDateTime = localDate.atTime(busAttendanceRuleVo.getClockInTime());
|
||||||
if (leaveService.isLeave(localDateTime, userId)) {
|
if (leaveService.isLeave(localDateTime, userId)) {
|
||||||
busAttendance.setClockStatus(BusAttendanceClockStatusEnum.LEAVE.getValue());
|
busAttendance.setClockStatus(LEAVE.getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
busAttendance.setSource(req.getSource());
|
busAttendance.setSource(req.getSource());
|
||||||
busAttendance.setSn(req.getSn());
|
busAttendance.setSn(req.getSn());
|
||||||
//如果是缺卡需要上传人脸
|
//如果是缺卡需要上传人脸
|
||||||
if (oldStatus.equals(BusAttendanceClockStatusEnum.UNCLOCK.getValue())) {
|
if (oldStatus.equals(UNCLOCK.getValue())) {
|
||||||
SysOssVo upload = ossService.upload(file);
|
SysOssVo upload = ossService.upload(file);
|
||||||
busAttendance.setFacePic(upload.getOssId().toString());
|
busAttendance.setFacePic(upload.getOssId().toString());
|
||||||
}
|
}
|
||||||
@ -884,12 +883,12 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B
|
|||||||
if ("1".equals(req.getSource())) {
|
if ("1".equals(req.getSource())) {
|
||||||
busAttendance.setSource(req.getSource());
|
busAttendance.setSource(req.getSource());
|
||||||
busAttendance.setSn(req.getSn());
|
busAttendance.setSn(req.getSn());
|
||||||
if (busAttendance.getClockStatus().equals(BusAttendanceClockStatusEnum.UNCLOCK.getValue())) {
|
if (busAttendance.getClockStatus().equals(UNCLOCK.getValue())) {
|
||||||
SysOssVo upload = ossService.upload(file);
|
SysOssVo upload = ossService.upload(file);
|
||||||
busAttendance.setFacePic(upload.getOssId().toString());
|
busAttendance.setFacePic(upload.getOssId().toString());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (busAttendance.getClockStatus().equals(BusAttendanceClockStatusEnum.UNCLOCK.getValue())) {
|
if (busAttendance.getClockStatus().equals(UNCLOCK.getValue())) {
|
||||||
throw new ServiceException("下班缺卡记录已生成,不能更新");
|
throw new ServiceException("下班缺卡记录已生成,不能更新");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -901,13 +900,13 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B
|
|||||||
busAttendance.setClockStatus(LEAVEEARLY.getValue());
|
busAttendance.setClockStatus(LEAVEEARLY.getValue());
|
||||||
busAttendance.setMinuteCount(getMinutesDifference(now, busAttendanceRuleVo.getClockOutTime()));
|
busAttendance.setMinuteCount(getMinutesDifference(now, busAttendanceRuleVo.getClockOutTime()));
|
||||||
} else {
|
} else {
|
||||||
busAttendance.setClockStatus(BusAttendanceClockStatusEnum.NORMAL.getValue());
|
busAttendance.setClockStatus(NORMAL.getValue());
|
||||||
busAttendance.setMinuteCount(0);
|
busAttendance.setMinuteCount(0);
|
||||||
}
|
}
|
||||||
//只要请假,直接归为请假
|
//只要请假,直接归为请假
|
||||||
LocalDateTime localDateTime = localDate.atTime(busAttendanceRuleVo.getClockInTime());
|
LocalDateTime localDateTime = localDate.atTime(busAttendanceRuleVo.getClockInTime());
|
||||||
if (leaveService.isLeave(localDateTime, userId)) {
|
if (leaveService.isLeave(localDateTime, userId)) {
|
||||||
busAttendance.setClockStatus(BusAttendanceClockStatusEnum.LEAVE.getValue());
|
busAttendance.setClockStatus(LEAVE.getValue());
|
||||||
}
|
}
|
||||||
updateById(busAttendance);
|
updateById(busAttendance);
|
||||||
} else {
|
} else {
|
||||||
@ -920,12 +919,12 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B
|
|||||||
attendance.setClockStatus(LEAVEEARLY.getValue());
|
attendance.setClockStatus(LEAVEEARLY.getValue());
|
||||||
attendance.setMinuteCount(getMinutesDifference(now, busAttendanceRuleVo.getClockOutTime()));
|
attendance.setMinuteCount(getMinutesDifference(now, busAttendanceRuleVo.getClockOutTime()));
|
||||||
} else {
|
} else {
|
||||||
attendance.setClockStatus(BusAttendanceClockStatusEnum.NORMAL.getValue());
|
attendance.setClockStatus(NORMAL.getValue());
|
||||||
}
|
}
|
||||||
//只要请假,直接归为请假
|
//只要请假,直接归为请假
|
||||||
LocalDateTime localDateTime = localDate.atTime(busAttendanceRuleVo.getClockInTime());
|
LocalDateTime localDateTime = localDate.atTime(busAttendanceRuleVo.getClockInTime());
|
||||||
if (leaveService.isLeave(localDateTime, userId)) {
|
if (leaveService.isLeave(localDateTime, userId)) {
|
||||||
attendance.setClockStatus(BusAttendanceClockStatusEnum.LEAVE.getValue());
|
attendance.setClockStatus(LEAVE.getValue());
|
||||||
}
|
}
|
||||||
// 填充信息
|
// 填充信息
|
||||||
attendance.setUserId(userId);
|
attendance.setUserId(userId);
|
||||||
@ -1290,7 +1289,7 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B
|
|||||||
|
|
||||||
List<String> abnormalList = Arrays.asList(LATE.getValue(),
|
List<String> abnormalList = Arrays.asList(LATE.getValue(),
|
||||||
LEAVEEARLY.getValue(),
|
LEAVEEARLY.getValue(),
|
||||||
BusAttendanceClockStatusEnum.UNCLOCK.getValue());
|
UNCLOCK.getValue());
|
||||||
|
|
||||||
// 获取当前用户ID
|
// 获取当前用户ID
|
||||||
Long userId = LoginHelper.getUserId();
|
Long userId = LoginHelper.getUserId();
|
||||||
@ -1957,7 +1956,7 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B
|
|||||||
List<BusAttendance> unlocks = list(Wrappers.<BusAttendance>lambdaQuery()
|
List<BusAttendance> unlocks = list(Wrappers.<BusAttendance>lambdaQuery()
|
||||||
.eq(BusAttendance::getClockDate, date)
|
.eq(BusAttendance::getClockDate, date)
|
||||||
.eq(BusAttendance::getProjectId, dto.getProjectId())
|
.eq(BusAttendance::getProjectId, dto.getProjectId())
|
||||||
.eq(BusAttendance::getClockStatus, BusAttendanceClockStatusEnum.UNCLOCK.getValue())
|
.eq(BusAttendance::getClockStatus, UNCLOCK.getValue())
|
||||||
);
|
);
|
||||||
List<Long> list11 = new ArrayList<>(unlocks.stream().map(BusAttendance::getUserId).distinct().toList());
|
List<Long> list11 = new ArrayList<>(unlocks.stream().map(BusAttendance::getUserId).distinct().toList());
|
||||||
list11.removeAll(list1);
|
list11.removeAll(list1);
|
||||||
@ -2031,7 +2030,7 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B
|
|||||||
List<BusAttendance> unlocks = list(Wrappers.<BusAttendance>lambdaQuery()
|
List<BusAttendance> unlocks = list(Wrappers.<BusAttendance>lambdaQuery()
|
||||||
.eq(BusAttendance::getClockDate, date)
|
.eq(BusAttendance::getClockDate, date)
|
||||||
.eq(BusAttendance::getProjectId, dto.getProjectId())
|
.eq(BusAttendance::getProjectId, dto.getProjectId())
|
||||||
.eq(BusAttendance::getClockStatus, BusAttendanceClockStatusEnum.UNCLOCK.getValue())
|
.eq(BusAttendance::getClockStatus, UNCLOCK.getValue())
|
||||||
);
|
);
|
||||||
List<Long> list11 = new ArrayList<>(unlocks.stream().map(BusAttendance::getUserId).distinct().toList());
|
List<Long> list11 = new ArrayList<>(unlocks.stream().map(BusAttendance::getUserId).distinct().toList());
|
||||||
list11.removeAll(list1);
|
list11.removeAll(list1);
|
||||||
@ -2721,7 +2720,7 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B
|
|||||||
List<BusAttendance> unlocks = list(Wrappers.<BusAttendance>lambdaQuery()
|
List<BusAttendance> unlocks = list(Wrappers.<BusAttendance>lambdaQuery()
|
||||||
.eq(BusAttendance::getClockDate, date)
|
.eq(BusAttendance::getClockDate, date)
|
||||||
.eq(BusAttendance::getProjectId, dto.getProjectId())
|
.eq(BusAttendance::getProjectId, dto.getProjectId())
|
||||||
.eq(BusAttendance::getClockStatus, BusAttendanceClockStatusEnum.UNCLOCK.getValue())
|
.eq(BusAttendance::getClockStatus, UNCLOCK.getValue())
|
||||||
);
|
);
|
||||||
List<Long> list11 = new ArrayList<>(unlocks.stream().map(BusAttendance::getUserId).distinct().toList());
|
List<Long> list11 = new ArrayList<>(unlocks.stream().map(BusAttendance::getUserId).distinct().toList());
|
||||||
list11.removeAll(list1);
|
list11.removeAll(list1);
|
||||||
@ -2794,7 +2793,9 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B
|
|||||||
long zx = 0; //在线
|
long zx = 0; //在线
|
||||||
long lx = 0; //离线
|
long lx = 0; //离线
|
||||||
AtomicLong fb = new AtomicLong(); //分包
|
AtomicLong fb = new AtomicLong(); //分包
|
||||||
|
fb.set(0);
|
||||||
AtomicLong sg = new AtomicLong(); //施工
|
AtomicLong sg = new AtomicLong(); //施工
|
||||||
|
sg.set(0);
|
||||||
//将属于该项目的在线ID过滤出来
|
//将属于该项目的在线ID过滤出来
|
||||||
for (SubConstructionUser constructionUser : list) {
|
for (SubConstructionUser constructionUser : list) {
|
||||||
if (onlineUserList.contains(constructionUser.getSysUserId().toString())){
|
if (onlineUserList.contains(constructionUser.getSysUserId().toString())){
|
||||||
@ -2809,12 +2810,16 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B
|
|||||||
//去判断是什么种类的用户
|
//去判断是什么种类的用户
|
||||||
list.stream().filter(item -> item.getSysUserId().equals(constructionUser.getSysUserId()))
|
list.stream().filter(item -> item.getSysUserId().equals(constructionUser.getSysUserId()))
|
||||||
.findFirst().ifPresent(item -> {
|
.findFirst().ifPresent(item -> {
|
||||||
if (item.getUserRole().equals("0")){
|
SysUserVo sysUserVo = userService.queryById(item.getSysUserId());
|
||||||
cacheUserVo.setJslx("施工");
|
if (sysUserVo != null){
|
||||||
sg.getAndIncrement();
|
//app用户类型 0-施工人员 1-管理人员 2-分包人员
|
||||||
} else if (item.getUserRole().equals("2")) {
|
if (sysUserVo.getAppUserType().equals("0")){
|
||||||
cacheUserVo.setJslx("分包");
|
cacheUserVo.setJslx("施工");
|
||||||
fb.getAndIncrement();
|
sg.set(sg.getAndIncrement()+1);
|
||||||
|
}else if (sysUserVo.getAppUserType().equals("2")){
|
||||||
|
cacheUserVo.setJslx("分包");
|
||||||
|
fb.set(fb.getAndIncrement()+1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
info.add(cacheUserVo);
|
info.add(cacheUserVo);
|
||||||
@ -2824,11 +2829,12 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B
|
|||||||
}
|
}
|
||||||
//将数据返回
|
//将数据返回
|
||||||
Map<String, String> map = new HashMap<>();
|
Map<String, String> map = new HashMap<>();
|
||||||
map.put("zx", String.valueOf(zx));
|
map.put("zs",String.valueOf(zx+lx)); //总数
|
||||||
map.put("lx", String.valueOf(lx));
|
map.put("zx", String.valueOf(zx)); //在线
|
||||||
map.put("fb", String.valueOf(fb.get()));
|
map.put("lx", String.valueOf(lx)); //离线
|
||||||
map.put("sg", String.valueOf(sg.get()));
|
map.put("fbsl", String.valueOf(fb.get())); //分包
|
||||||
map.put("info", info.toString());
|
map.put("sg", String.valueOf(sg.get())); //施工
|
||||||
|
map.put("info", JSONUtil.toJsonStr(info)); //jd经度 wd维度 jslx角色类型
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2846,27 +2852,22 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B
|
|||||||
//根据分包和班组的id进行分类 统计都有多少人 未入场人员没有两项数据 无法统计 仅能计算为总数
|
//根据分包和班组的id进行分类 统计都有多少人 未入场人员没有两项数据 无法统计 仅能计算为总数
|
||||||
List<RyglWebSocketVo> fbList = new ArrayList<>();
|
List<RyglWebSocketVo> fbList = new ArrayList<>();
|
||||||
List<RyglWebSocketVo> bzList = new ArrayList<>();
|
List<RyglWebSocketVo> bzList = new ArrayList<>();
|
||||||
|
|
||||||
for (SubConstructionUser constructionUser : list) {
|
for (SubConstructionUser constructionUser : list) {
|
||||||
//统计该项目下的分包和班组各应有多少人
|
//统计该项目下的分包和班组各应有多少人
|
||||||
if (constructionUser.getTeamId() != null && constructionUser.getContractorId() != null){
|
SysUserVo sysUserVo = userService.queryById(constructionUser.getSysUserId());
|
||||||
//两个都有的情况
|
if (sysUserVo == null){
|
||||||
//根据其角色来区分 0-施工人员 1-管理人员 2-分包管理人员
|
continue;
|
||||||
if (constructionUser.getUserRole().equals("2")){
|
}
|
||||||
checkAndSetValue(fbList,constructionUser,2,timeType,projectId);
|
//判断userType app用户类型 0-施工人员 1-管理人员 2-分包人员
|
||||||
} else if (constructionUser.getUserRole().equals("0")) {
|
if (sysUserVo.getAppUserType().equals("0")){
|
||||||
checkAndSetValue(bzList,constructionUser,0,timeType,projectId);
|
checkAndSetValue(bzList,constructionUser,0,timeType,projectId);
|
||||||
}
|
}else if (sysUserVo.getAppUserType().equals("2")){
|
||||||
}else if (constructionUser.getTeamId() == null && constructionUser.getContractorId() != null){
|
checkAndSetValue(fbList,constructionUser,2,timeType,projectId);
|
||||||
//班组为空,分包不为空的情况 两个都为空不统计 班组不空分包空 不存在这种情况
|
|
||||||
//根据其角色来区分 0-施工人员 1-管理人员 2-分包管理人员
|
|
||||||
if (constructionUser.getUserRole().equals("2")){
|
|
||||||
checkAndSetValue(fbList,constructionUser,2,timeType,projectId);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//总人数
|
|
||||||
zrs = (long) fbList.size() + bzList.size();
|
|
||||||
//总出勤人
|
//总出勤人
|
||||||
long fbcqr = 0L;
|
long fbcqr = 0L;
|
||||||
long bzcqr = 0L;
|
long bzcqr = 0L;
|
||||||
@ -2881,8 +2882,8 @@ 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();
|
||||||
}
|
}
|
||||||
|
|
||||||
for (RyglWebSocketVo vo : bzList) {
|
for (RyglWebSocketVo vo : bzList) {
|
||||||
if (vo.getZrs()>0){
|
if (vo.getZrs()>0){
|
||||||
vo.setDgl(
|
vo.setDgl(
|
||||||
@ -2893,17 +2894,20 @@ 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 = (long) list.size();
|
||||||
if (zrs != 0L){
|
if (zrs != 0L){
|
||||||
cql = (BigDecimal.valueOf(fbcqr).add(BigDecimal.valueOf(bzcqr))).divide(BigDecimal.valueOf(zrs),1,RoundingMode.HALF_UP);
|
cql = (BigDecimal.valueOf(fbcqr).add(BigDecimal.valueOf(bzcqr))).divide(BigDecimal.valueOf(zrs),1,RoundingMode.HALF_UP);
|
||||||
}
|
}
|
||||||
|
|
||||||
map.put("zrs", zrs.toString());
|
map.put("zrs", zrs.toString()); //总人数
|
||||||
map.put("cqr", cqr.toString());
|
map.put("cqr", cqr.toString()); //出勤人数
|
||||||
map.put("cql", cql.toString());
|
map.put("cql", cql.toString()); //出勤率
|
||||||
map.put("fb", fbList.toString());
|
map.put("fb", JSONUtil.toJsonStr(fbList)); //分包列表
|
||||||
map.put("bz", bzList.toString());
|
map.put("bz", JSONUtil.toJsonStr(bzList)); //班组列表
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -2919,10 +2923,10 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B
|
|||||||
|
|
||||||
Long finalTime = time;
|
Long finalTime = time;
|
||||||
switch (type){
|
switch (type){
|
||||||
case 2 -> {
|
case 2 ->
|
||||||
//分包
|
//分包
|
||||||
//首先判断传入的列表中是否存在该条数据
|
//首先判断传入的列表中是否存在该条数据
|
||||||
ryglWebSocketVoList.stream().filter(item -> item.getZzId().equals(info.getContractorId())).findFirst().ifPresentOrElse(
|
ryglWebSocketVoList.stream().filter(item -> Objects.equals(item.getZzId(), info.getContractorId())).findFirst().ifPresentOrElse(
|
||||||
item -> {
|
item -> {
|
||||||
item.setZrs(item.getZrs() + finalTime);
|
item.setZrs(item.getZrs() + finalTime);
|
||||||
item.setDgrs(item.getDgrs() + getDgrs(info.getSysUserId(),finalTime,projectId));
|
item.setDgrs(item.getDgrs() + getDgrs(info.getSysUserId(),finalTime,projectId));
|
||||||
@ -2932,7 +2936,6 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B
|
|||||||
ryglWebSocketVo.setZzId(info.getContractorId());
|
ryglWebSocketVo.setZzId(info.getContractorId());
|
||||||
//分包组织名称
|
//分包组织名称
|
||||||
if (info.getContractorId() != null) {
|
if (info.getContractorId() != null) {
|
||||||
// SubContractor byId = subContractorService.getById(info.getContractorId());
|
|
||||||
SubContractor byId = baseMapper.getSubContractor(info.getContractorId());
|
SubContractor byId = baseMapper.getSubContractor(info.getContractorId());
|
||||||
if (byId != null) {
|
if (byId != null) {
|
||||||
ryglWebSocketVo.setZzmc(byId.getName());
|
ryglWebSocketVo.setZzmc(byId.getName());
|
||||||
@ -2943,22 +2946,21 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B
|
|||||||
ryglWebSocketVo.setDgrs(getDgrs(info.getSysUserId(),finalTime,projectId));
|
ryglWebSocketVo.setDgrs(getDgrs(info.getSysUserId(),finalTime,projectId));
|
||||||
ryglWebSocketVoList.add(ryglWebSocketVo);
|
ryglWebSocketVoList.add(ryglWebSocketVo);
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
case 0 ->
|
case 0 ->
|
||||||
//班组
|
//班组
|
||||||
//首先判断传入的列表中是否存在该条数据
|
//首先判断传入的列表中是否存在该条数据
|
||||||
ryglWebSocketVoList.stream().filter(item -> item.getZzId().equals(info.getTeamId())).findFirst().ifPresentOrElse(
|
ryglWebSocketVoList.stream().filter(item -> Objects.equals(item.getZzId(), info.getTeamId())).findFirst().ifPresentOrElse(
|
||||||
item -> {
|
item -> {
|
||||||
item.setZrs(item.getZrs() + finalTime);
|
item.setZrs(item.getZrs() + finalTime);
|
||||||
item.setDgrs(item.getDgrs() + getDgrs(info.getSysUserId(),finalTime,projectId));
|
item.setDgrs(item.getDgrs() + getDgrs(info.getSysUserId(),finalTime,projectId));
|
||||||
}, () -> {
|
}, () -> {
|
||||||
RyglWebSocketVo ryglWebSocketVo = new RyglWebSocketVo();
|
RyglWebSocketVo ryglWebSocketVo = new RyglWebSocketVo();
|
||||||
//分包组织id
|
//班组组织id
|
||||||
ryglWebSocketVo.setZzId(info.getContractorId());
|
ryglWebSocketVo.setZzId(info.getTeamId());
|
||||||
//分包组织名称
|
//班组组织名称
|
||||||
ryglWebSocketVo.setZzmc(info.getTeamName());
|
ryglWebSocketVo.setZzmc(info.getTeamName());
|
||||||
//总人数 先设置1
|
//总人数
|
||||||
ryglWebSocketVo.setZrs(finalTime);
|
ryglWebSocketVo.setZrs(finalTime);
|
||||||
ryglWebSocketVo.setDgrs(getDgrs(info.getSysUserId(),finalTime,projectId));
|
ryglWebSocketVo.setDgrs(getDgrs(info.getSysUserId(),finalTime,projectId));
|
||||||
ryglWebSocketVoList.add(ryglWebSocketVo);
|
ryglWebSocketVoList.add(ryglWebSocketVo);
|
||||||
|
|||||||
@ -15,7 +15,6 @@ import org.dromara.bigscreen.service.ProgressBigScreenService;
|
|||||||
import org.dromara.cailiaoshebei.domain.vo.BusPurchaseDocVo;
|
import org.dromara.cailiaoshebei.domain.vo.BusPurchaseDocVo;
|
||||||
import org.dromara.cailiaoshebei.service.IBusMrpBaseService;
|
import org.dromara.cailiaoshebei.service.IBusMrpBaseService;
|
||||||
import org.dromara.cailiaoshebei.service.IBusPurchaseDocService;
|
import org.dromara.cailiaoshebei.service.IBusPurchaseDocService;
|
||||||
import org.dromara.common.core.utils.DateUtils;
|
|
||||||
import org.dromara.common.core.utils.SpringUtils;
|
import org.dromara.common.core.utils.SpringUtils;
|
||||||
import org.dromara.materials.domain.vo.materials.MatMaterialsUseDetailVo;
|
import org.dromara.materials.domain.vo.materials.MatMaterialsUseDetailVo;
|
||||||
import org.dromara.materials.service.IMatMaterialsService;
|
import org.dromara.materials.service.IMatMaterialsService;
|
||||||
@ -24,7 +23,6 @@ import org.springframework.stereotype.Component;
|
|||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
@ -230,10 +228,25 @@ public class BigScreenWebSocketServer {
|
|||||||
String[] split = subscriptionId.split("-");
|
String[] split = subscriptionId.split("-");
|
||||||
Long projectId = Long.parseLong(split[0]);
|
Long projectId = Long.parseLong(split[0]);
|
||||||
long type = Long.parseLong(split[1]);
|
long type = Long.parseLong(split[1]);
|
||||||
|
List<Map<String, String>> maps = new ArrayList<>();
|
||||||
|
//所需service
|
||||||
|
BusAttendanceServiceImpl busAttendanceService = SpringUtils.getBean(BusAttendanceServiceImpl.class);
|
||||||
switch ((int) type) {
|
switch ((int) type) {
|
||||||
case 1:
|
case 1:
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
|
int timeType = Math.toIntExact((Long) JSONUtil.parseObj(message).get("timeType"));
|
||||||
|
//判断参数
|
||||||
|
if (timeType != 1L && timeType != 2L && timeType != 3L) {
|
||||||
|
throw new RuntimeException("时间类型参数错误");
|
||||||
|
}
|
||||||
|
//先获取左边坐标得到map
|
||||||
|
Map<String, String> infoData = busAttendanceService.getRyglOnlineUserInfoData(projectId);
|
||||||
|
//获取右边数据
|
||||||
|
busAttendanceService.getAttendanceInfo(projectId, (long) timeType, infoData);
|
||||||
|
//返回数据
|
||||||
|
maps.add(infoData);
|
||||||
|
message = JSONUtil.toJsonStr(maps);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user