From 9fde9f917552f659d41fcfce5094f429a29b8ead Mon Sep 17 00:00:00 2001
From: xuhy <3313886187@qq.com>
Date: 星期四, 16 一月 2025 16:26:54 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TechnicianSubscribeServiceImpl.java |   22 ++++++++++++++++++++--
 1 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TechnicianSubscribeServiceImpl.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TechnicianSubscribeServiceImpl.java
index 93a1013..3b4d4f5 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TechnicianSubscribeServiceImpl.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TechnicianSubscribeServiceImpl.java
@@ -30,9 +30,11 @@
 import java.time.LocalDateTime;
 import java.time.ZoneId;
 import java.time.ZoneOffset;
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Optional;
 import java.util.Set;
+import java.util.stream.Collectors;
 
 /**
  * <p>
@@ -106,10 +108,26 @@
                                                                                 Integer serviceMode, Integer pageCurr, Integer pageSize) {
         PageInfo<TechnicianSubscribeVO> pageInfo = new PageInfo(pageCurr, pageSize);
         List<TechnicianSubscribeVO> technicianSubscribeByUserAndShop1 = technicianSubscribeMapper.getTechnicianSubscribeByUserAndShop1(pageInfo, shopId, status, phone, name, serviceMode);
+        if (StringUtils.isNotEmpty(name)){
+            List<AppUser> nameIds = appUserClient.getAppUserByName(name).getData();
+            List<Long> collect = nameIds.stream().map(AppUser::getId).collect(Collectors.toList());
+            if (collect.isEmpty())collect.add(-1L);
+            technicianSubscribeByUserAndShop1 = technicianSubscribeByUserAndShop1.stream().filter(e -> collect.contains(e.getAppUserId()))
+                    .collect(Collectors.toList());
+        }
+        if (StringUtils.isNotEmpty(phone)){
+            List<AppUser> phoneIds = appUserClient.getAppUserByPhone(phone).getData();
+            List<Long> collect = phoneIds.stream().map(AppUser::getId).collect(Collectors.toList());
+            if (collect.isEmpty())collect.add(-1L);
+             technicianSubscribeByUserAndShop1 = technicianSubscribeByUserAndShop1.stream().filter(e -> collect.contains(e.getAppUserId()))
+                    .collect(Collectors.toList());
+        }
         for (TechnicianSubscribeVO technicianSubscribeVO : technicianSubscribeByUserAndShop1) {
             AppUser appUser = appUserClient.getAppUserById(technicianSubscribeVO.getAppUserId());
-            technicianSubscribeVO.setUserName(appUser.getName());
-            technicianSubscribeVO.setPhone(appUser.getPhone());
+            if(appUser!=null){
+                technicianSubscribeVO.setUserName(appUser.getName());
+                technicianSubscribeVO.setPhone(appUser.getPhone());
+            }
         }
         return pageInfo.setRecords(technicianSubscribeByUserAndShop1);
     }

--
Gitblit v1.7.1