From 659f3089e44da110e21ee5fdd1c3dd3bee575cb7 Mon Sep 17 00:00:00 2001 From: yuyongle <1150359267@qq.com> Date: Fri, 29 Aug 2025 17:19:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E6=B4=BE=E5=8D=95=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/ServiceWorkOrdersServiceImpl.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/ServiceWorkOrdersServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/ServiceWorkOrdersServiceImpl.java index 870b515d..4acdfb3f 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/ServiceWorkOrdersServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/ServiceWorkOrdersServiceImpl.java @@ -239,14 +239,15 @@ public class ServiceWorkOrdersServiceImpl implements IServiceWorkOrdersService { LocalDate today = LocalDate.now(); // 1. 获取今日排班人员(优先查缓存,未命中则查询数据库并缓存) List attendanceUserGroups = RedisUtils.getCacheList(DateUtil.today()); - if (CollUtil.isEmpty(attendanceUserGroups)) { - attendanceUserGroups = attendanceUserGroupMapper.selectList( - new LambdaQueryWrapper() - .le(AttendanceUserGroup::getStartDate, today) - .ge(AttendanceUserGroup::getEndDate, today) - .eq(AttendanceUserGroup::getDeptId, serviceWorkOrders.getCreateDept()) - .orderByAsc(AttendanceUserGroup::getStartDate) - ); + List attendanceUserGroupList = attendanceUserGroupMapper.selectList( + new LambdaQueryWrapper() + .le(AttendanceUserGroup::getStartDate, today) + .ge(AttendanceUserGroup::getEndDate, today) + .eq(AttendanceUserGroup::getDeptId, serviceWorkOrders.getCreateDept()) + .orderByAsc(AttendanceUserGroup::getStartDate) + ); + if (CollUtil.isEmpty(attendanceUserGroups)|| attendanceUserGroups.size() != attendanceUserGroupList.size()) { + attendanceUserGroups=attendanceUserGroupList; Assert.isTrue(CollUtil.isNotEmpty(attendanceUserGroups), "暂无排班人员"); // 缓存当天排班数据(假设当天不会变) RedisUtils.setCacheList(DateUtil.today(), attendanceUserGroups);