From d1cab4b2f2690d1331f12f0d9de78bbbf926f390 Mon Sep 17 00:00:00 2001 From: 无关风月 <443237572@qq.com> Date: 星期四, 16 一月 2025 14:27:51 +0800 Subject: [PATCH] Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/qijisheng --- ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TechnicianSubscribeServiceImpl.java | 25 ++++++++++++++++++++++++- 1 files changed, 24 insertions(+), 1 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 bf62382..68827d0 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,6 +108,20 @@ 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()); @@ -115,7 +131,14 @@ } @Override public IPage<TechnicianSubscribeVO> getTechnicianSubscribeByUser(Page<TechnicianSubscribe> page, Long userId, Integer status) { - return technicianSubscribeMapper.getTechnicianSubscribeByUser(page, userId, status); + IPage<TechnicianSubscribeVO> technicianSubscribeByUser = technicianSubscribeMapper.getTechnicianSubscribeByUser(page, userId, status); + technicianSubscribeByUser.getRecords().forEach(technicianSubscribeVO -> { + UserAddress userAddress = JSON.parseObject(technicianSubscribeVO.getUserAddress(), UserAddress.class); + if (userAddress != null){ + technicianSubscribeVO.setUserAddress(userAddress.getProvince() + userAddress.getCity() + userAddress.getDistrict() + userAddress.getRecieveAddress()); + } + }); + return technicianSubscribeByUser; } @Override -- Gitblit v1.7.1