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