From 4a620557ffb98adfb0d3dbea16cf4bdb9bfd916f Mon Sep 17 00:00:00 2001
From: kongdeqiang <123456>
Date: 星期二, 09 四月 2024 08:13:08 +0800
Subject: [PATCH] fix: 修改前端过滤验证码

---
 xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/OrderTaskController.java |   23 +++++++++++++++--------
 xboot-core/src/main/java/cn/exrick/xboot/core/config/security/WebSecurityConfig.java            |    2 +-
 2 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/xboot-core/src/main/java/cn/exrick/xboot/core/config/security/WebSecurityConfig.java b/xboot-core/src/main/java/cn/exrick/xboot/core/config/security/WebSecurityConfig.java
index efe320c..fabd594 100644
--- a/xboot-core/src/main/java/cn/exrick/xboot/core/config/security/WebSecurityConfig.java
+++ b/xboot-core/src/main/java/cn/exrick/xboot/core/config/security/WebSecurityConfig.java
@@ -133,7 +133,7 @@
                 .exceptionHandling().accessDeniedHandler(accessDeniedHandler)
                 .and()
                 //鍥惧舰楠岃瘉鐮佽繃婊ゅ櫒
-                .addFilterBefore(imageValidateFilter, UsernamePasswordAuthenticationFilter.class)
+                //.addFilterBefore(imageValidateFilter, UsernamePasswordAuthenticationFilter.class)
                 // 鐭俊楠岃瘉鐮佽繃婊ゅ櫒
                 //.addFilterBefore(smsValidateFilter, UsernamePasswordAuthenticationFilter.class)
                 // vaptcha楠岃瘉鐮佽繃婊ゅ櫒
diff --git a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/OrderTaskController.java b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/OrderTaskController.java
index ad1ec24..9da4636 100644
--- a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/OrderTaskController.java
+++ b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/OrderTaskController.java
@@ -33,6 +33,7 @@
 import java.text.SimpleDateFormat;
 import java.time.LocalDateTime;
 import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  * @author whj
@@ -199,14 +200,20 @@
         Map<String, Object> map = new HashMap<String, Object>();
         map.put("count", list.size());
         map.put("sum", sum);
-        map.put("name", "");
-        if (list.size() > 0) {
-            OrderTask orderTask = list.get(0);
-            String areaSectionId = orderTask.getAreaSectionId();
-            AreaSection a = iAreaSectionService.getById(areaSectionId);
-            Area area2 = iAreaService.getById(orderTask.getAreaId());
-            map.put("name", area2.getName() + a.getName());
-            list.clear();
+        String name = area.getName();
+        Map<String, List<OrderTask>> collect = list.stream().collect(Collectors.groupingBy(OrderTask::getAreaSectionId));
+        for (Map.Entry<String, List<OrderTask>> stringListEntry : collect.entrySet()) {
+            String key = stringListEntry.getKey();
+            List<OrderTask> value = stringListEntry.getValue();
+            if(value.size()>0){
+                AreaSection a = iAreaSectionService.getById(key);
+                name+=a.getName();
+            }
+        }
+        if(name.equals(area.getName())){
+            map.put("name", "");
+        }else {
+            map.put("name", name);
         }
         return new ResultUtil<Object>().setData(map);
     }

--
Gitblit v1.9.1