From 039abee6b27058ca46b1e1e82aa0b5407a5dad44 Mon Sep 17 00:00:00 2001
From: liujie <1793218484@qq.com>
Date: 星期一, 28 七月 2025 15:25:26 +0800
Subject: [PATCH] 优化 和修改bug

---
 springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/scheduled/ComplaintTasks.java |   32 +++++++++++++++++++-------------
 1 files changed, 19 insertions(+), 13 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/scheduled/ComplaintTasks.java b/springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/scheduled/ComplaintTasks.java
index 6234d5d..0e02cf1 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/scheduled/ComplaintTasks.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/scheduled/ComplaintTasks.java
@@ -104,6 +104,11 @@
                 config.getCommunityHandlingTime()
               );
 
+        if(!complaintTimeoutList.isEmpty()) {
+            // 当前不在发送
+            complaintService.update(new LambdaUpdateWrapper<Complaint>().in(Complaint::getId, complaintTimeoutList.stream().map(ComplaintTimeout::getComplaintId).collect(Collectors.toList())).set(Complaint::getNowLevelSms, 1));
+
+        }
 
         Map<Integer, List<ComplaintTimeout>> timeOutMap = complaintTimeoutList.stream()
                 .collect(Collectors.groupingBy(ComplaintTimeout::getNowLevel));
@@ -122,7 +127,7 @@
             List<String> districtPhoneList1 = districtUserList.stream().filter(e->e.getSystemRoleId()==2).map(SystemUser::getPhone).collect(Collectors.toList());
             collect.forEach(complaintTimeout -> {
                 // 发送短信
-                if(!districtPhoneList.isEmpty()){
+                if(!districtPhoneList.isEmpty() && !complaintTimeout.getProblemType().equals("检举控告")){
                     AliSmsUtil.sendTimeoutMessageAdmin(districtPhoneList,complaintTimeout.getSerialNumber());
                 }
                 if(!districtPhoneList1.isEmpty()){
@@ -146,7 +151,7 @@
                         List<String> districtPhoneList2 = systemUsers.stream().filter(e->e.getSystemRoleId()==1).map(SystemUser::getPhone).collect(Collectors.toList());
                         List<String> districtPhoneList3 = systemUsers.stream().filter(e->e.getSystemRoleId()==2).map(SystemUser::getPhone).collect(Collectors.toList());
                         // 发送短信
-                        if(!districtPhoneList2.isEmpty()){
+                        if(!districtPhoneList2.isEmpty() && !complaintTimeout.getProblemType().equals("检举控告")){
                             AliSmsUtil.sendTimeoutMessageAdmin(districtPhoneList2,complaintTimeout.getSerialNumber());
                         }
                         if(!districtPhoneList3.isEmpty()){
@@ -154,7 +159,7 @@
                         }
                     }else {
                         // 发送短信
-                        if(!districtPhoneList.isEmpty()){
+                        if(!districtPhoneList.isEmpty() && !complaintTimeout.getProblemType().equals("检举控告")){
                             AliSmsUtil.sendTimeoutMessageAdmin(districtPhoneList,complaintTimeout.getSerialNumber());
                         }
                         if(!districtPhoneList1.isEmpty()){
@@ -181,7 +186,7 @@
                List<String> streetPhoneList = streetUserList.stream().filter(e->e.getSystemRoleId()==1 && e.getStreetId().equals(complaintTimeout.getSuperiorId().toString())).map(SystemUser::getPhone).collect(Collectors.toList());
                List<String> streetPhoneList1 = streetUserList.stream().filter(e->e.getSystemRoleId()==2 && e.getStreetId().equals(complaintTimeout.getSuperiorId().toString())).map(SystemUser::getPhone).collect(Collectors.toList());
                // 发送短信
-                if(!streetPhoneList.isEmpty()){
+                if(!streetPhoneList.isEmpty() && !complaintTimeout.getProblemType().equals("检举控告")){
                     AliSmsUtil.sendTimeoutMessageAdmin(streetPhoneList,complaintTimeout.getSerialNumber());
                 }
                 if(!streetPhoneList1.isEmpty()){
@@ -201,7 +206,7 @@
                         List<String> streetPhoneList2 = systemUsers.stream().filter(e->e.getSystemRoleId()==1).map(SystemUser::getPhone).collect(Collectors.toList());
                         List<String> streetPhoneList3 = systemUsers.stream().filter(e->e.getSystemRoleId()==2).map(SystemUser::getPhone).collect(Collectors.toList());
                         // 发送短信
-                        if(!streetPhoneList2.isEmpty()){
+                        if(!streetPhoneList2.isEmpty() && !complaintTimeout.getProblemType().equals("检举控告")){
                             AliSmsUtil.sendTimeoutMessageAdmin(streetPhoneList2,complaintTimeout.getSerialNumber());
                         }
                         if(!streetPhoneList3.isEmpty()){
@@ -211,7 +216,7 @@
                         List<String> streetPhoneList = streetUserList.stream().filter(e->e.getSystemRoleId()==1 && e.getStreetId().equals(complaintTimeout.getSuperiorId().toString())).map(SystemUser::getPhone).collect(Collectors.toList());
                         List<String> streetPhoneList1 = streetUserList.stream().filter(e->e.getSystemRoleId()==2 && e.getStreetId().equals(complaintTimeout.getSuperiorId().toString())).map(SystemUser::getPhone).collect(Collectors.toList());
                         // 发送短信
-                        if(!streetPhoneList.isEmpty()){
+                        if(!streetPhoneList.isEmpty() && !complaintTimeout.getProblemType().equals("检举控告")){
                             AliSmsUtil.sendTimeoutMessageAdmin(streetPhoneList,complaintTimeout.getSerialNumber());
                         }
                         if(!streetPhoneList1.isEmpty()){
@@ -241,7 +246,7 @@
                 List<String> communityPhoneList1 = communityUserList.stream().filter(e->e.getSystemRoleId()==2 && e.getCommunityId().equals(complaintTimeout.getSuperiorId())).map(SystemUser::getPhone).collect(Collectors.toList());
 
                 // 发送短信
-                if(!communityPhoneList.isEmpty()){
+                if(!communityPhoneList.isEmpty() && !complaintTimeout.getProblemType().equals("检举控告")){
                     AliSmsUtil.sendTimeoutMessageAdmin(communityPhoneList, complaintTimeout.getSerialNumber());
                 }
                 if(!communityPhoneList1.isEmpty()){
@@ -261,7 +266,7 @@
                         List<String> communityPhoneList2 = systemUsers.stream().filter(e->e.getSystemRoleId()==1).map(SystemUser::getPhone).collect(Collectors.toList());
                         List<String> communityPhoneList3 = systemUsers.stream().filter(e->e.getSystemRoleId()==2).map(SystemUser::getPhone).collect(Collectors.toList());
                         // 发送短信
-                        if(!communityPhoneList2.isEmpty()){
+                        if(!communityPhoneList2.isEmpty() && !complaintTimeout.getProblemType().equals("检举控告")){
                             AliSmsUtil.sendTimeoutMessageAdmin(communityPhoneList2, complaintTimeout.getSerialNumber());
                         }
                         if(!communityPhoneList3.isEmpty()){
@@ -271,7 +276,7 @@
                         List<String> communityPhoneList = communityUserList.stream().filter(e->e.getSystemRoleId()==1 && e.getCommunityId().equals(complaintTimeout.getSuperiorId())).map(SystemUser::getPhone).collect(Collectors.toList());
                         List<String> communityPhoneList1 = communityUserList.stream().filter(e->e.getSystemRoleId()==2 && e.getCommunityId().equals(complaintTimeout.getSuperiorId())).map(SystemUser::getPhone).collect(Collectors.toList());
                         // 发送短信
-                        if(!communityPhoneList.isEmpty()){
+                        if(!communityPhoneList.isEmpty() && !complaintTimeout.getProblemType().equals("检举控告")){
                             AliSmsUtil.sendTimeoutMessageAdmin(communityPhoneList, complaintTimeout.getSerialNumber());
                         }
                         if(!communityPhoneList1.isEmpty()){
@@ -283,10 +288,11 @@
         }
 
 
-        if(!complaintTimeoutList.isEmpty()) {
-            // 短信发送完成 当前不在发送
-            complaintService.update(new LambdaUpdateWrapper<Complaint>().in(Complaint::getId, complaintTimeoutList.stream().map(ComplaintTimeout::getComplaintId).collect(Collectors.toList())).set(Complaint::getNowLevelSms, 1));
-        }
+
+
+
+
+
     }
 
 }

--
Gitblit v1.7.1