bug
This commit is contained in:
		| @ -14,6 +14,7 @@ import org.dromara.common.mybatis.core.page.PageQuery; | |||||||
| import org.dromara.common.mybatis.core.page.TableDataInfo; | import org.dromara.common.mybatis.core.page.TableDataInfo; | ||||||
| import org.dromara.contractor.domain.SubConstructionUser; | import org.dromara.contractor.domain.SubConstructionUser; | ||||||
| import org.dromara.contractor.domain.SubUserSalaryDetail; | import org.dromara.contractor.domain.SubUserSalaryDetail; | ||||||
|  | import org.dromara.contractor.domain.SubUserSalaryPeriod; | ||||||
| import org.dromara.contractor.domain.dto.usersalarydetail.SubUserSalaryDetailQueryReq; | import org.dromara.contractor.domain.dto.usersalarydetail.SubUserSalaryDetailQueryReq; | ||||||
| import org.dromara.contractor.domain.vo.usersalarydetail.SubUserSalaryDetailVo; | import org.dromara.contractor.domain.vo.usersalarydetail.SubUserSalaryDetailVo; | ||||||
| import org.dromara.contractor.mapper.SubUserSalaryDetailMapper; | import org.dromara.contractor.mapper.SubUserSalaryDetailMapper; | ||||||
| @ -22,6 +23,7 @@ import org.dromara.contractor.service.ISubUserSalaryDetailService; | |||||||
| import org.dromara.project.domain.BusWorkWage; | import org.dromara.project.domain.BusWorkWage; | ||||||
| import org.dromara.project.service.IBusWorkWageService; | import org.dromara.project.service.IBusWorkWageService; | ||||||
| import org.springframework.beans.BeanUtils; | import org.springframework.beans.BeanUtils; | ||||||
|  | import org.springframework.scheduling.annotation.Async; | ||||||
| import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||||
|  |  | ||||||
| import java.math.BigDecimal; | import java.math.BigDecimal; | ||||||
| @ -93,8 +95,17 @@ public class SubUserSalaryDetailServiceImpl extends ServiceImpl<SubUserSalaryDet | |||||||
|      * @param reportDate 日报日期 |      * @param reportDate 日报日期 | ||||||
|      * @return 是否新增成功 |      * @return 是否新增成功 | ||||||
|      */ |      */ | ||||||
|  |     @Async | ||||||
|     @Override |     @Override | ||||||
|     public Boolean insertByAttendance(Long userId, LocalDate reportDate) { |     public Boolean insertByAttendance(Long userId, LocalDate reportDate) { | ||||||
|  |         //查询当天工资,已存在则跳过 | ||||||
|  |         List<SubUserSalaryDetail> list = this.list(new LambdaQueryWrapper<SubUserSalaryDetail>() | ||||||
|  |             .eq(SubUserSalaryDetail::getUserId, userId) | ||||||
|  |             .eq(SubUserSalaryDetail::getReportDate, reportDate)); | ||||||
|  |         if (CollUtil.isNotEmpty(list)) { | ||||||
|  |             return true; | ||||||
|  |         } | ||||||
|  |  | ||||||
|         SubConstructionUser constructionUser = constructionUserService.getBySysUserId(userId); |         SubConstructionUser constructionUser = constructionUserService.getBySysUserId(userId); | ||||||
|         // 获取工资 |         // 获取工资 | ||||||
|         BigDecimal salary = constructionUser.getSalary(); |         BigDecimal salary = constructionUser.getSalary(); | ||||||
|  | |||||||
| @ -212,10 +212,9 @@ public class AttendanceJob { | |||||||
|  |  | ||||||
|                 //计算考勤日期 |                 //计算考勤日期 | ||||||
|                 if (start.isAfter(end)) {  // 跨天情况 |                 if (start.isAfter(end)) {  // 跨天情况 | ||||||
|                     if (!clockOutResultTime.isBefore(start)) { //在前半段 23:55-00:00 |                     if (!clockOutResultTime.isBefore(start)) { // 前半段(23:55 - 00:00) | ||||||
|                         date = date.minusDays(1); |                         date = date.minusDays(1); | ||||||
|                     } |                     } else if (clockOutResultTime.isBefore(end)) { // 后半段(00:00 - 00:05) | ||||||
|                     if (clockOutResultTime.isBefore(end)) { //在后半段 00:00-05:00 |  | ||||||
|                         if (clockOutTime.isAfter(clockOutResultTime)) { |                         if (clockOutTime.isAfter(clockOutResultTime)) { | ||||||
|                             date = date.minusDays(1); |                             date = date.minusDays(1); | ||||||
|                         } |                         } | ||||||
|  | |||||||
| @ -25,6 +25,7 @@ import org.dromara.common.utils.JSTUtil; | |||||||
| import org.dromara.contractor.domain.SubConstructionUser; | import org.dromara.contractor.domain.SubConstructionUser; | ||||||
| import org.dromara.contractor.domain.vo.constructionuser.SubConstructionUserVo; | import org.dromara.contractor.domain.vo.constructionuser.SubConstructionUserVo; | ||||||
| import org.dromara.contractor.service.ISubConstructionUserService; | import org.dromara.contractor.service.ISubConstructionUserService; | ||||||
|  | import org.dromara.contractor.service.ISubUserSalaryDetailService; | ||||||
| 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.AttendanceCountDto; | import org.dromara.project.domain.dto.attendance.AttendanceCountDto; | ||||||
| @ -95,6 +96,10 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B | |||||||
|  |  | ||||||
|     private final ChatServerHandler chatServerHandler; |     private final ChatServerHandler chatServerHandler; | ||||||
|  |  | ||||||
|  |     private final ISubUserSalaryDetailService userSalaryDetailService; | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|     // 出勤状态(正常、迟到、早退) |     // 出勤状态(正常、迟到、早退) | ||||||
|     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(BusAttendanceClockStatusEnum.NORMAL.getValue(), | ||||||
|         BusAttendanceClockStatusEnum.LATE.getValue(), BusAttendanceClockStatusEnum.LEAVEEARLY.getValue())); |         BusAttendanceClockStatusEnum.LATE.getValue(), BusAttendanceClockStatusEnum.LEAVEEARLY.getValue())); | ||||||
| @ -308,9 +313,10 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B | |||||||
|             SysOssVo upload = ossService.upload(file); |             SysOssVo upload = ossService.upload(file); | ||||||
|             attendance.setFacePic(upload.getOssId().toString()); |             attendance.setFacePic(upload.getOssId().toString()); | ||||||
|             chatServerHandler.sendSystemMessageToUser(userId, "打卡成功"); |             chatServerHandler.sendSystemMessageToUser(userId, "打卡成功"); | ||||||
|             return this.save(attendance); |             boolean save = this.save(attendance); | ||||||
|  |             //插入工资 | ||||||
|  |             userSalaryDetailService.insertByAttendance(userId, attendance.getClockDate()); | ||||||
|  |             return save; | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  | |||||||
| @ -21,6 +21,7 @@ import org.dromara.common.core.utils.ObjectUtils; | |||||||
| import org.dromara.common.core.utils.StringUtils; | import org.dromara.common.core.utils.StringUtils; | ||||||
| import org.dromara.common.mybatis.core.page.PageQuery; | import org.dromara.common.mybatis.core.page.PageQuery; | ||||||
| import org.dromara.common.mybatis.core.page.TableDataInfo; | import org.dromara.common.mybatis.core.page.TableDataInfo; | ||||||
|  | import org.dromara.contractor.service.ISubUserSalaryDetailService; | ||||||
| import org.dromara.project.domain.*; | import org.dromara.project.domain.*; | ||||||
| import org.dromara.project.domain.dto.reissuecard.BusReissueCardAddReq; | import org.dromara.project.domain.dto.reissuecard.BusReissueCardAddReq; | ||||||
| import org.dromara.project.domain.dto.reissuecard.BusReissueCardUpdateReq; | import org.dromara.project.domain.dto.reissuecard.BusReissueCardUpdateReq; | ||||||
| @ -37,6 +38,7 @@ import org.dromara.system.domain.vo.SysOssVo; | |||||||
| import org.dromara.system.domain.vo.SysUserVo; | import org.dromara.system.domain.vo.SysUserVo; | ||||||
| import org.dromara.system.service.ISysOssService; | import org.dromara.system.service.ISysOssService; | ||||||
| import org.dromara.system.service.ISysUserService; | import org.dromara.system.service.ISysUserService; | ||||||
|  | import org.dromara.websocket.ChatServerHandler; | ||||||
| import org.springframework.beans.BeanUtils; | import org.springframework.beans.BeanUtils; | ||||||
| import org.springframework.context.event.EventListener; | import org.springframework.context.event.EventListener; | ||||||
| import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||||
| @ -75,6 +77,11 @@ public class BusReissueCardServiceImpl extends ServiceImpl<BusReissueCardMapper, | |||||||
|     @Resource |     @Resource | ||||||
|     private ISysOssService ossService; |     private ISysOssService ossService; | ||||||
|  |  | ||||||
|  |     @Resource | ||||||
|  |     private  ISubUserSalaryDetailService userSalaryDetailService; | ||||||
|  |     @Resource | ||||||
|  |     private ChatServerHandler chatServerHandler; | ||||||
|  |  | ||||||
|     /** |     /** | ||||||
|      * 查询施工人员补卡申请 |      * 查询施工人员补卡申请 | ||||||
|      * |      * | ||||||
| @ -364,6 +371,8 @@ public class BusReissueCardServiceImpl extends ServiceImpl<BusReissueCardMapper, | |||||||
|         attendanceService.update(Wrappers.<BusAttendance>lambdaUpdate() |         attendanceService.update(Wrappers.<BusAttendance>lambdaUpdate() | ||||||
|             .eq(BusAttendance::getId, bean.getAttendanceId()) |             .eq(BusAttendance::getId, bean.getAttendanceId()) | ||||||
|             .set(BusAttendance::getHandle, "1")); |             .set(BusAttendance::getHandle, "1")); | ||||||
|  |         //发送通知 | ||||||
|  |         chatServerHandler.sendSystemMessageToUser(bean.getGangerId(),"["+bean.getUserName()+ "]"+"提交了新的补卡申请"); | ||||||
|         return bean.getId(); |         return bean.getId(); | ||||||
|     } |     } | ||||||
|  |  | ||||||
| @ -380,11 +389,18 @@ public class BusReissueCardServiceImpl extends ServiceImpl<BusReissueCardMapper, | |||||||
|         boolean b = updateById(bean); |         boolean b = updateById(bean); | ||||||
|         if("2".equals(bean.getGangerOpinion())){ |         if("2".equals(bean.getGangerOpinion())){ | ||||||
|             BusAttendance byId = attendanceService.getById(attendanceId); |             BusAttendance byId = attendanceService.getById(attendanceId); | ||||||
|  |             String clockStatus = byId.getClockStatus(); | ||||||
|             byId.setClockStatus(BusAttendanceClockStatusEnum.REISSUE.getValue()); |             byId.setClockStatus(BusAttendanceClockStatusEnum.REISSUE.getValue()); | ||||||
|  |             attendanceService.updateById(byId); | ||||||
|  |             //缺卡补充当天的工资表 | ||||||
|  |             if(BusAttendanceClockStatusEnum.UNCLOCK.getValue().equals(clockStatus)){ | ||||||
|  |                 userSalaryDetailService.insertByAttendance(byId.getUserId(),byId.getClockDate()); | ||||||
|  |             } | ||||||
|         } |         } | ||||||
|         if("3".equals(bean.getManagerOpinion())){ |         if("3".equals(bean.getManagerOpinion())){ | ||||||
|             BusAttendance byId = attendanceService.getById(attendanceId); |             BusAttendance byId = attendanceService.getById(attendanceId); | ||||||
|             byId.setHandle("0"); |             byId.setHandle("0"); | ||||||
|  |             attendanceService.updateById(byId); | ||||||
|         } |         } | ||||||
|         return b; |         return b; | ||||||
|     } |     } | ||||||
|  | |||||||
| @ -34,6 +34,11 @@ public class QltQualityConstructionLog extends BaseEntity { | |||||||
|      */ |      */ | ||||||
|     private Long projectId; |     private Long projectId; | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 标题 | ||||||
|  |      */ | ||||||
|  |     private  String title; | ||||||
|  |  | ||||||
|     /** |     /** | ||||||
|      * 发生日期 |      * 发生日期 | ||||||
|      */ |      */ | ||||||
|  | |||||||
| @ -48,4 +48,10 @@ public class QltQualityConstructionLogCreateReq implements Serializable { | |||||||
|      */ |      */ | ||||||
|     private String remark; |     private String remark; | ||||||
|  |  | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 标题 | ||||||
|  |      */ | ||||||
|  |     private  String title; | ||||||
|  |  | ||||||
| } | } | ||||||
|  | |||||||
| @ -28,4 +28,9 @@ public class QltQualityConstructionLogQueryReq implements Serializable { | |||||||
|     @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd") |     @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd") | ||||||
|     private Date happenDate; |     private Date happenDate; | ||||||
|  |  | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 标题 | ||||||
|  |      */ | ||||||
|  |     private  String title; | ||||||
| } | } | ||||||
|  | |||||||
| @ -45,4 +45,10 @@ public class QltQualityConstructionLogUpdateReq implements Serializable { | |||||||
|      */ |      */ | ||||||
|     private String remark; |     private String remark; | ||||||
|  |  | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 标题 | ||||||
|  |      */ | ||||||
|  |     private  String title; | ||||||
|  |  | ||||||
| } | } | ||||||
|  | |||||||
| @ -82,4 +82,10 @@ public class QltQualityConstructionLogVo implements Serializable { | |||||||
|      */ |      */ | ||||||
|     private Date createTime; |     private Date createTime; | ||||||
|  |  | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 标题 | ||||||
|  |      */ | ||||||
|  |     private  String title; | ||||||
|  |  | ||||||
| } | } | ||||||
|  | |||||||
| @ -243,6 +243,7 @@ public class QltQualityConstructionLogServiceImpl extends ServiceImpl<QltQuality | |||||||
|         // 精准查询 |         // 精准查询 | ||||||
|         lqw.eq(ObjectUtils.isNotEmpty(projectId), QltQualityConstructionLog::getProjectId, projectId); |         lqw.eq(ObjectUtils.isNotEmpty(projectId), QltQualityConstructionLog::getProjectId, projectId); | ||||||
|         lqw.eq(ObjectUtils.isNotEmpty(happenDate), QltQualityConstructionLog::getHappenDate, happenDate); |         lqw.eq(ObjectUtils.isNotEmpty(happenDate), QltQualityConstructionLog::getHappenDate, happenDate); | ||||||
|  |         lqw.like(StringUtils.isNotBlank(req.getTitle()), QltQualityConstructionLog::getTitle, req.getTitle()); | ||||||
|         return lqw; |         return lqw; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  | |||||||
| @ -69,6 +69,7 @@ public class TransferDataController { | |||||||
|                 .eq(BusAttendance::getUserId, constructionUserCopy.getSysUserId()) |                 .eq(BusAttendance::getUserId, constructionUserCopy.getSysUserId()) | ||||||
|                 .eq(BusAttendance::getProjectId, constructionUserCopy.getProjectId()) |                 .eq(BusAttendance::getProjectId, constructionUserCopy.getProjectId()) | ||||||
|                 .eq(BusAttendance::getClockDate, clockDate) |                 .eq(BusAttendance::getClockDate, clockDate) | ||||||
|  |                 .eq(BusAttendance::getClockType, oldAttendance.getCommuter()) | ||||||
|             ); |             ); | ||||||
|             if(CollectionUtil.isNotEmpty(list)){ |             if(CollectionUtil.isNotEmpty(list)){ | ||||||
|                 continue; |                 continue; | ||||||
|  | |||||||
| @ -20,7 +20,10 @@ import org.dromara.common.json.utils.JsonUtils; | |||||||
| import org.dromara.common.redis.utils.RedisUtils; | import org.dromara.common.redis.utils.RedisUtils; | ||||||
| import org.dromara.common.satoken.utils.LoginHelper; | import org.dromara.common.satoken.utils.LoginHelper; | ||||||
| import org.dromara.system.domain.bo.SysUserBo; | import org.dromara.system.domain.bo.SysUserBo; | ||||||
|  | import org.dromara.system.domain.vo.SysOssVo; | ||||||
| import org.dromara.system.domain.vo.SysUserVo; | import org.dromara.system.domain.vo.SysUserVo; | ||||||
|  | import org.dromara.system.service.ISysOssService; | ||||||
|  | import org.dromara.system.service.impl.SysOssServiceImpl; | ||||||
| import org.dromara.system.service.impl.SysUserServiceImpl; | import org.dromara.system.service.impl.SysUserServiceImpl; | ||||||
| import org.dromara.websocket.domain.ChatGroup; | import org.dromara.websocket.domain.ChatGroup; | ||||||
| import org.dromara.websocket.domain.ChatHistory; | import org.dromara.websocket.domain.ChatHistory; | ||||||
| @ -46,6 +49,7 @@ public class ChatServerHandler extends SimpleChannelInboundHandler<TextWebSocket | |||||||
|     private static ChatHistoryServiceImpl chatHistoryService; |     private static ChatHistoryServiceImpl chatHistoryService; | ||||||
|     private static ChatGroupServiceImpl chatGroupService; |     private static ChatGroupServiceImpl chatGroupService; | ||||||
|     private static SysUserServiceImpl sysUserService; |     private static SysUserServiceImpl sysUserService; | ||||||
|  |     private static SysOssServiceImpl sysOssService; | ||||||
|     @Autowired |     @Autowired | ||||||
|     public void setChatHistoryService(ChatHistoryServiceImpl service) { |     public void setChatHistoryService(ChatHistoryServiceImpl service) { | ||||||
|         chatHistoryService = service; |         chatHistoryService = service; | ||||||
| @ -58,6 +62,10 @@ public class ChatServerHandler extends SimpleChannelInboundHandler<TextWebSocket | |||||||
|     public void setSysUserService(SysUserServiceImpl service){ |     public void setSysUserService(SysUserServiceImpl service){ | ||||||
|         sysUserService = service; |         sysUserService = service; | ||||||
|     } |     } | ||||||
|  |     @Autowired | ||||||
|  |     public void setSysOssService(SysOssServiceImpl service){ | ||||||
|  |         sysOssService = service; | ||||||
|  |     } | ||||||
|  |  | ||||||
|     // 存储所有连接的客户端Channel |     // 存储所有连接的客户端Channel | ||||||
|     private static ChannelGroup channelGroup = new DefaultChannelGroup(GlobalEventExecutor.INSTANCE); |     private static ChannelGroup channelGroup = new DefaultChannelGroup(GlobalEventExecutor.INSTANCE); | ||||||
| @ -251,7 +259,16 @@ public class ChatServerHandler extends SimpleChannelInboundHandler<TextWebSocket | |||||||
|             //来自哪个用户 |             //来自哪个用户 | ||||||
|             jsonObject.put("from", sysUserVo.getUserId().toString()); |             jsonObject.put("from", sysUserVo.getUserId().toString()); | ||||||
|             jsonObject.put("nickName", sysUserVo.getNickName()); |             jsonObject.put("nickName", sysUserVo.getNickName()); | ||||||
|             jsonObject.put("avatar", sysUserVo.getAvatar()); |             if(sysUserVo.getAvatar() != null){ | ||||||
|  |                 SysOssVo byId = sysOssService.getById(sysUserVo.getAvatar()); | ||||||
|  |                 if(byId != null){ | ||||||
|  |                     jsonObject.put("avatar", byId.getUrl()); | ||||||
|  |                 }else { | ||||||
|  |                     jsonObject.put("avatar", "http://xny.yj-3d.com:9000/xinnengyuan/2025/09/13/d10d60315d6e41718bfaaab4df53c84e.png"); | ||||||
|  |                 } | ||||||
|  |             }else { | ||||||
|  |                 jsonObject.put("avatar", "http://xny.yj-3d.com:9000/xinnengyuan/2025/09/13/d10d60315d6e41718bfaaab4df53c84e.png"); | ||||||
|  |             } | ||||||
|             log.info("收到客户端消息:{}", jsonObject); |             log.info("收到客户端消息:{}", jsonObject); | ||||||
|             String RoomId = jsonObject.get("roomId").toString(); |             String RoomId = jsonObject.get("roomId").toString(); | ||||||
|             //根据ID拿到房间实例 |             //根据ID拿到房间实例 | ||||||
| @ -378,7 +395,13 @@ public class ChatServerHandler extends SimpleChannelInboundHandler<TextWebSocket | |||||||
|             groupServiceOne = new ChatGroup(); |             groupServiceOne = new ChatGroup(); | ||||||
|             groupServiceOne.setType(String.valueOf(2)); |             groupServiceOne.setType(String.valueOf(2)); | ||||||
|             groupServiceOne.setMembers("[99, "+userId+"]"); |             groupServiceOne.setMembers("[99, "+userId+"]"); | ||||||
|  |             groupServiceOne.setLastMessage(message); | ||||||
|  |             groupServiceOne.setLastMessageTime(new Date()); | ||||||
|             chatGroupService.save(groupServiceOne); |             chatGroupService.save(groupServiceOne); | ||||||
|  |         }else { | ||||||
|  |             groupServiceOne.setLastMessage(message); | ||||||
|  |             groupServiceOne.setLastMessageTime(new Date()); | ||||||
|  |             chatGroupService.updateById(groupServiceOne); | ||||||
|         } |         } | ||||||
|         ChatHistory chatHistory = new ChatHistory(); |         ChatHistory chatHistory = new ChatHistory(); | ||||||
|         //发送方设置为99 表示系统消息 |         //发送方设置为99 表示系统消息 | ||||||
| @ -389,6 +412,7 @@ public class ChatServerHandler extends SimpleChannelInboundHandler<TextWebSocket | |||||||
|         chatHistory.setIsRead("1");//未读 |         chatHistory.setIsRead("1");//未读 | ||||||
|         chatHistoryService.save(chatHistory); |         chatHistoryService.save(chatHistory); | ||||||
|  |  | ||||||
|  |  | ||||||
|         //发送消息后 将该房间未读消息数加1 |         //发送消息后 将该房间未读消息数加1 | ||||||
|         if (userRoomCountMap.containsKey(userId+"+"+groupServiceOne.getId())){ |         if (userRoomCountMap.containsKey(userId+"+"+groupServiceOne.getId())){ | ||||||
|             //该房间未读消息数加1 |             //该房间未读消息数加1 | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	 zt
					zt