luodangjia
2025-01-24 c90a8ac772937f8f084356ea1f04c5dba1d9e5d5
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/RefundPassServiceImpl.java
@@ -31,6 +31,7 @@
import com.ruoyi.system.api.feignClient.SysUserClient;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.time.LocalDateTime;
@@ -130,23 +131,30 @@
         shopId = sysUser.getObjectId();
      }
      List<Long> appUserIds = new ArrayList<>();
      //搜索条件,用户姓名
      if(StringUtils.isNotEmpty(refundPassListVo.getUserName())){
      //搜索条件,用户姓名和电话
      if(StringUtils.isNotEmpty(refundPassListVo.getUserName()) || StringUtils.isNotEmpty(refundPassListVo.getPhone())){
         List<AppUser> data = appUserClient.getAppUserByName(refundPassListVo.getUserName()).getData();
         List<Long> collect = data.stream().map(AppUser::getId).collect(Collectors.toList());
         if (collect.isEmpty()){
            appUserIds.add(-1L);
         }
         appUserIds.addAll(collect);
      }
      //搜索条件,用户电话
      if(StringUtils.isNotEmpty(refundPassListVo.getPhone())){
         List<AppUser> data = appUserClient.getAppUserByPhone(refundPassListVo.getPhone()).getData();
         List<Long> collect = data.stream().map(AppUser::getId).collect(Collectors.toList());
         if (collect.isEmpty()){
         List<AppUser> data2 = appUserClient.getAppUserByPhone(refundPassListVo.getPhone()).getData();
         List<Long> collect2 = data2.stream().map(AppUser::getId).collect(Collectors.toList());
         if (!CollectionUtils.isEmpty(data)){
            for (AppUser datum : data) {
               for (AppUser appUser : data2) {
                  if (!datum.getId().equals(appUser.getId())){
                     collect2.remove(appUser.getId());
                  }
               }
            }
         }
         if (collect2.isEmpty()){
            appUserIds.add(-1L);
         }
         appUserIds.addAll(collect);
         appUserIds.addAll(collect2);
      }
      PageInfo<OrderRefundPassList> pageInfo = new PageInfo(refundPassListVo.getPageCurr(), refundPassListVo.getPageSize());