luodangjia
2025-01-14 e9d5d32c7ee67eec2f47ed80fe9aae92a0ce7ec1
12.18
1个文件已修改
38 ■■■■■ 已修改文件
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShareController.java 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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>
@@ -208,10 +211,41 @@
    @ApiOperation(value = "广告管理-分享管理-审核列表", tags = {"管理后台"})
    @GetMapping("/manage/auth/list")
    public R<Page<Share>> authmanagelist(String name, Integer addType, @RequestParam Integer pageNum, Integer 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)
                .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)