From 29c9ada64cee7adf3399e92ee3a62f2b9ed338ed Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期二, 14 一月 2025 10:19:38 +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/controller/ShareController.java |   46 +++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 43 insertions(+), 3 deletions(-)

diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShareController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShareController.java
index 096aac0..4d0d141 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShareController.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShareController.java
@@ -25,11 +25,14 @@
 import com.ruoyi.system.api.feignClient.SysUserClient;
 import com.ruoyi.system.api.model.LoginUser;
 import io.swagger.annotations.*;
+import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
 import java.time.LocalDateTime;
+import java.util.ArrayList;
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * <p>
@@ -99,6 +102,7 @@
         }
         share.setDelFlag(0);
         share.setAppletShare(1);
+        share.setCreateTime(LocalDateTime.now());
         shareService.save(share);
         return R.ok();
     }
@@ -207,9 +211,45 @@
 
     @ApiOperation(value = "广告管理-分享管理-审核列表", tags = {"管理后台"})
     @GetMapping("/manage/auth/list")
-    public R<Page<Share>> authmanagelist(String name, Integer addType, @RequestParam Integer pageNum, Integer pageSize) {
-        Page<Share> page = shareService.lambdaQuery().ne(Share::getAuditStatus, 1).like(name != null, Share::getName, name)
-                .eq(addType != null, Share::getAddType, addType).eq(Share::getDelFlag, 0).orderByAsc(Share::getAuditStatus).page(Page.of(pageNum, pageSize));
+    public R<Page<Share>> authmanagelist(String name,
+                                         Integer addType,
+                                         String authName,
+                                         String authPhone,
+                                         Integer auditStatus,
+                                         @RequestParam Integer pageNum,
+                                         Integer pageSize) {
+
+        List<Long> userIds = new ArrayList<>();
+        if (StringUtils.isNotEmpty(authName)){
+            R<List<AppUser>> uR = appUserClient.getAppUserByName(authName);
+            List<AppUser> userList = uR.getData();
+            if (CollectionUtils.isEmpty(userList)){
+                return R.ok(Page.of(pageNum, pageSize));
+            }
+            userIds.addAll(userList.stream().map(AppUser::getId).collect(Collectors.toList()));
+
+        }
+        if (StringUtils.isNotEmpty(authPhone)){
+            R<List<AppUser>> uR = appUserClient.getAppUserByPhone(authPhone);
+            List<AppUser> userList = uR.getData();
+            if (CollectionUtils.isEmpty(userList)){
+                return R.ok(Page.of(pageNum, pageSize));
+            }
+            userIds.addAll(userList.stream().map(AppUser::getId).collect(Collectors.toList()));
+        }
+
+
+
+        Page<Share> page = shareService.lambdaQuery()
+                .ne(Share::getAuditStatus, 1)
+                .like(name != null, Share::getName, name)
+                .eq(addType != null, Share::getAddType, addType)
+                .eq(auditStatus != null, Share::getAuditStatus, auditStatus)
+                .in(!CollectionUtils.isEmpty(userIds),Share::getObjectId, userIds)
+                .eq(Share::getDelFlag, 0)
+                .orderByAsc(Share::getAuditStatus)
+                .orderByDesc(Share::getCreateTime)
+                .page(Page.of(pageNum, pageSize));
         for (Share record : page.getRecords()) {
             if (record.getAddType() == 2) {
                 AppUser appUserById = appUserClient.getAppUserById(Long.valueOf(record.getObjectId()));

--
Gitblit v1.7.1