From df764430467f0a8639c23a1a48839c51a5f12e01 Mon Sep 17 00:00:00 2001 From: tuyp Date: Wed, 19 Jul 2023 18:10:12 +0800 Subject: [PATCH] 活跃度检测bug修复 --- src/main/java/com/subsidy/common/interceptor/AuthenticationInterceptor.java | 10 +++++++++- src/main/resources/application.properties | 2 +- src/main/resources/mapper/ActivityDetectionMapper.xml | 3 ++- src/main/resources/mapper/AdministerMapper.xml | 6 ++---- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/subsidy/common/interceptor/AuthenticationInterceptor.java b/src/main/java/com/subsidy/common/interceptor/AuthenticationInterceptor.java index 7ac9569..09bce70 100644 --- a/src/main/java/com/subsidy/common/interceptor/AuthenticationInterceptor.java +++ b/src/main/java/com/subsidy/common/interceptor/AuthenticationInterceptor.java @@ -69,6 +69,14 @@ public class AuthenticationInterceptor implements HandlerInterceptor { Method method = handlerMethod.getMethod(); TimeRequired timeRequired = method.getAnnotation(TimeRequired.class); + if (timeRequired != null) { + Calendar calendar = Calendar.getInstance(); + + int hour = calendar.get(Calendar.HOUR_OF_DAY); + if (hour < 6 || hour >= 23 ) { + throw new HttpException(17001); + } + } LoginRequired methodAnnotation = method.getAnnotation(LoginRequired.class); if (methodAnnotation != null) { @@ -100,7 +108,7 @@ public class AuthenticationInterceptor implements HandlerInterceptor { int hour = calendar.get(Calendar.HOUR_OF_DAY); int minute = calendar.get(Calendar.MINUTE); - if (hour < 6 || (hour >= 23 && minute >= 30)) { + if (hour < 6 || hour >= 23 ) { throw new HttpException(17001); } } diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 71c7dba..cc0c047 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,5 +1,5 @@ # 环境配置 -spring.profiles.active=dev +spring.profiles.active=prod #和CPU数 spring.server.acceptorThreadCount=600 spring.server.minSpareThreads=100 diff --git a/src/main/resources/mapper/ActivityDetectionMapper.xml b/src/main/resources/mapper/ActivityDetectionMapper.xml index b140a5c..94a5d50 100644 --- a/src/main/resources/mapper/ActivityDetectionMapper.xml +++ b/src/main/resources/mapper/ActivityDetectionMapper.xml @@ -40,7 +40,8 @@ FROM activity_detection t WHERE - t.class_id = #{classId} + t.delete_date IS NULL + and t.class_id = #{classId} AND t.member_id = #{memberId} AND t.check_type = #{checkType} AND t.`status` = #{status} diff --git a/src/main/resources/mapper/AdministerMapper.xml b/src/main/resources/mapper/AdministerMapper.xml index fbb939d..5ee1d28 100644 --- a/src/main/resources/mapper/AdministerMapper.xml +++ b/src/main/resources/mapper/AdministerMapper.xml @@ -142,11 +142,10 @@ class_member_mapping t LEFT JOIN member t2 ON t.member_id = t2.id LEFT JOIN activity_detection t3 ON t.class_id = t3.class_id - AND t.member_id = t3.member_id + AND t.member_id = t3.member_id and t3.delete_date IS NULL left join company_dict t4 on t2.company_id = t4.id where t.delete_date IS NULL AND t2.delete_date IS NULL - and t3.delete_date IS NULL AND t.class_id = #{classId} and t2.user_name like concat('%',#{userName} ,'%') @@ -180,12 +179,11 @@ class_member_mapping t LEFT JOIN member t2 ON t.member_id = t2.id LEFT JOIN image_check_record t3 ON t.class_id = t3.class_id - AND t.member_id = t3.member_id + AND t.member_id = t3.member_id and t3.delete_date IS NULL left join company_dict t4 on t2.company_id = t4.id WHERE t.delete_date IS NULL AND t2.delete_date IS NULL - and t3.delete_date IS NULL and t2.user_name like concat('%',#{userName} ,'%') -- libgit2 0.25.0