mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-09 02:46:50 +08:00
提交到修改
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
package com.xboe;
|
||||
|
||||
/**
|
||||
* 临时常量,用于控制与用户同步的一些实现的处理控制,是否启动控制过滤
|
||||
*
|
||||
*/
|
||||
public class TempFilterConfig {
|
||||
|
||||
/**
|
||||
* 课件管理查询,启动按机构查询过滤
|
||||
*/
|
||||
public static final boolean Manager_CourseFile_ByOrgIds=true;
|
||||
|
||||
/**
|
||||
* 课程管理热裤机构id过滤
|
||||
*/
|
||||
public static final boolean Manager_Course_ByOrgIds=true;
|
||||
}
|
||||
@@ -22,6 +22,6 @@ public interface IOutSideDataService {
|
||||
/**
|
||||
* 获取用户有权限的机构id
|
||||
* */
|
||||
List<String> getOrgId();
|
||||
List<String> getOrgIds();
|
||||
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ public class OutSideDataServiceImpl implements IOutSideDataService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getOrgId() {
|
||||
public List<String> getOrgIds() {
|
||||
List<String> orgIds = new ArrayList<>();
|
||||
String token = TokenProxy.getToken(request);
|
||||
String type="application/json";
|
||||
|
||||
@@ -15,7 +15,6 @@ import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.xboe.common.utils.StringUtil;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.orm.ObjectOptimisticLockingFailureException;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@@ -25,9 +24,11 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.xboe.TempFilterConfig;
|
||||
import com.xboe.common.OrderCondition;
|
||||
import com.xboe.common.PageList;
|
||||
import com.xboe.common.Pagination;
|
||||
import com.xboe.common.utils.StringUtil;
|
||||
import com.xboe.core.JsonResponse;
|
||||
import com.xboe.core.JsonResponseStatus;
|
||||
import com.xboe.core.SysConstant;
|
||||
@@ -36,6 +37,7 @@ import com.xboe.core.orm.FieldFilters;
|
||||
import com.xboe.core.orm.IFieldFilter;
|
||||
import com.xboe.core.orm.LikeMatchMode;
|
||||
import com.xboe.core.upload.XFileUploader;
|
||||
import com.xboe.data.outside.IOutSideDataService;
|
||||
import com.xboe.module.course.entity.CourseFile;
|
||||
import com.xboe.module.course.service.ICourseFileService;
|
||||
import com.xboe.module.course.service.impl.FileConverterProvider;
|
||||
@@ -64,6 +66,9 @@ public class CourseFileApi extends ApiBaseController {
|
||||
@Resource
|
||||
XFileUploader fileUploader;
|
||||
|
||||
@Resource
|
||||
IOutSideDataService outSideDataService;
|
||||
|
||||
/**
|
||||
* 管理文件,查询的是全部
|
||||
* @param pager
|
||||
@@ -99,6 +104,17 @@ public class CourseFileApi extends ApiBaseController {
|
||||
if (cfile.getResType() != null) {
|
||||
filters.add(FieldFilters.eq("resType", cfile.getResType()));
|
||||
}
|
||||
//增加权限的过滤,只要看到自己或有权限的机构的
|
||||
if(TempFilterConfig.Manager_CourseFile_ByOrgIds) {
|
||||
List<String> orgIds = outSideDataService.getOrgIds();
|
||||
String aid=getCurrent().getAccountId();
|
||||
if(!orgIds.isEmpty()){
|
||||
//filters.add(FieldFilters.in("orgId", orgIds));
|
||||
filters.add(FieldFilters.or(FieldFilters.eq("sysCreateAid", aid),FieldFilters.in("orgId", orgIds)));
|
||||
}else {
|
||||
filters.add(FieldFilters.eq("sysCreateAid", aid));
|
||||
}
|
||||
}
|
||||
|
||||
//默认是查询自己的课件。
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user