forked from github/dataease
Merge pull request #2086 from dataease/pr@dev@fix_task_report_auth
fix: 定时报告权限设置
This commit is contained in:
commit
0b1066b7eb
@ -2,11 +2,13 @@ package io.dataease.plugins.server;
|
|||||||
|
|
||||||
import com.github.pagehelper.Page;
|
import com.github.pagehelper.Page;
|
||||||
import com.github.pagehelper.PageHelper;
|
import com.github.pagehelper.PageHelper;
|
||||||
|
import io.dataease.auth.api.dto.CurrentUserDto;
|
||||||
import io.dataease.commons.exception.DEException;
|
import io.dataease.commons.exception.DEException;
|
||||||
import io.dataease.commons.pool.PriorityThreadPoolExecutor;
|
import io.dataease.commons.pool.PriorityThreadPoolExecutor;
|
||||||
import io.dataease.commons.utils.*;
|
import io.dataease.commons.utils.*;
|
||||||
import io.dataease.plugins.common.entity.GlobalTaskEntity;
|
import io.dataease.plugins.common.entity.GlobalTaskEntity;
|
||||||
import io.dataease.plugins.common.entity.GlobalTaskInstance;
|
import io.dataease.plugins.common.entity.GlobalTaskInstance;
|
||||||
|
import io.dataease.plugins.common.entity.XpackConditionEntity;
|
||||||
import io.dataease.plugins.common.entity.XpackGridRequest;
|
import io.dataease.plugins.common.entity.XpackGridRequest;
|
||||||
import io.dataease.plugins.config.SpringContextUtil;
|
import io.dataease.plugins.config.SpringContextUtil;
|
||||||
import io.dataease.plugins.xpack.email.dto.request.XpackEmailCreate;
|
import io.dataease.plugins.xpack.email.dto.request.XpackEmailCreate;
|
||||||
@ -25,6 +27,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import springfox.documentation.annotations.ApiIgnore;
|
import springfox.documentation.annotations.ApiIgnore;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.Future;
|
import java.util.concurrent.Future;
|
||||||
|
|
||||||
@ -47,6 +50,18 @@ public class XEmailTaskServer {
|
|||||||
@RequestBody XpackGridRequest request) {
|
@RequestBody XpackGridRequest request) {
|
||||||
EmailXpackService emailXpackService = SpringContextUtil.getBean(EmailXpackService.class);
|
EmailXpackService emailXpackService = SpringContextUtil.getBean(EmailXpackService.class);
|
||||||
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
|
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
|
||||||
|
CurrentUserDto user = AuthUtils.getUser();
|
||||||
|
if (!user.getIsAdmin()) {
|
||||||
|
Long userId = user.getUserId();
|
||||||
|
XpackConditionEntity condition = new XpackConditionEntity();
|
||||||
|
condition.setField("u.user_id");
|
||||||
|
condition.setOperator("eq");
|
||||||
|
condition.setValue(userId);
|
||||||
|
List<XpackConditionEntity> conditions = CollectionUtils.isEmpty(request.getConditions()) ? new ArrayList<>() : request.getConditions();
|
||||||
|
conditions.add(condition);
|
||||||
|
request.setConditions(conditions);
|
||||||
|
}
|
||||||
|
|
||||||
List<XpackTaskGridDTO> tasks = emailXpackService.taskGrid(request);
|
List<XpackTaskGridDTO> tasks = emailXpackService.taskGrid(request);
|
||||||
if (CollectionUtils.isNotEmpty(tasks)) {
|
if (CollectionUtils.isNotEmpty(tasks)) {
|
||||||
tasks.forEach(item -> {
|
tasks.forEach(item -> {
|
||||||
|
Loading…
Reference in New Issue
Block a user