mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-06 17:36:47 +08:00
10/18 添加工号配置 受众权限
This commit is contained in:
@@ -126,4 +126,19 @@ public class CourseFullText {
|
||||
*/
|
||||
private List<String> keywordsList;
|
||||
|
||||
|
||||
/**
|
||||
* 课程创建人id
|
||||
*/
|
||||
private String sysCreateAid;
|
||||
|
||||
/**
|
||||
* 课程创建人id
|
||||
*/
|
||||
private String[] sysCreateAids;
|
||||
|
||||
/**
|
||||
* 受众
|
||||
*/
|
||||
private String audience;
|
||||
}
|
||||
|
||||
@@ -354,14 +354,14 @@ public class CourseElasticsearchImpl implements ICourseFullTextSearch{
|
||||
}
|
||||
|
||||
|
||||
/* 2023-08-08 不管是否是此课程受众 ,都可以搜索到 但点进课程详情提示无权限
|
||||
/* 2023-08-08 不管是否是此课程受众 ,都可以搜索到 但点进课程详情提示无权限*/
|
||||
//加上Source判断,是为了应对后台查询,后台查询时,不需要权限,但是需要指定数据来源
|
||||
if(params.getSource()==null || params.getSource()==0 ) {
|
||||
//受众权限条件,必须是有受众的课程并且受众条件不为空
|
||||
if(params.getAudiences()!=null && params.getAudiences().length>0) {
|
||||
//if(StringUtils.isNotBlank(params.getAudience())) {
|
||||
BoolQueryBuilder audience= QueryBuilders.boolQuery();
|
||||
audience.should(QueryBuilders.termQuery("isSetAudience",0));
|
||||
// audience.should(QueryBuilders.termQuery("isSetAudience",0));
|
||||
|
||||
BoolQueryBuilder has= QueryBuilders.boolQuery();
|
||||
//String[] ids=params.getAudience().split(",");
|
||||
@@ -376,9 +376,9 @@ public class CourseElasticsearchImpl implements ICourseFullTextSearch{
|
||||
//log.error("audience="+audience.toString());
|
||||
}else {
|
||||
//如果当前用户无受众,只能查询未设置受众的课程
|
||||
boolQuery.must(QueryBuilders.termQuery("isSetAudience",0));
|
||||
// boolQuery.must(QueryBuilders.termQuery("isSetAudience",0));
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
//在哪端显示
|
||||
if(params.getDevice()!=null) {
|
||||
@@ -611,6 +611,11 @@ public class CourseElasticsearchImpl implements ICourseFullTextSearch{
|
||||
if(boolQuery.hasClauses()) {
|
||||
sourceBuilder.query(boolQuery);
|
||||
}
|
||||
// 查出例外人员
|
||||
BoolQueryBuilder builder= QueryBuilders.boolQuery();
|
||||
builder.should(QueryBuilders.termsQuery("sysCreateAid",paras.getSysCreateAids()));
|
||||
sourceBuilder.query(builder);
|
||||
|
||||
|
||||
//排序
|
||||
if(StringUtils.isBlank(paras.getKeywords()) && paras.getOrderType()!=3) {
|
||||
|
||||
@@ -51,7 +51,7 @@ public class ThirdApi {
|
||||
public List<String> getUserId(){
|
||||
log.info("正在获取例外人员工号");
|
||||
// String s ="{\"show\":false,\"version\":\"1.1.0\",\"code\":200,\"msg\":\"请求成功!\",\"data\":{\"records\":[{\"id\":129,\"deleted\":null,\"createTime\":\"2023-10-16T10:03:25\",\"createId\":0,\"createName\":\"管理员\",\"updateTime\":\"2023-10-16T10:03:25\",\"updateId\":0,\"updateName\":\"管理员\",\"name\":\"李玉冰\",\"pid\":128,\"code\":\"00004409\",\"description\":null,\"value\":\"00004409\",\"img\":null,\"type\":1,\"level\":0,\"status\":0,\"sort\":0,\"children\":[]}],\"total\":0,\"size\":10,\"current\":1,\"orders\":[],\"id\":null,\"pid\":128,\"type\":1,\"status\":null,\"code\":null,\"name\":null,\"searchCount\":true,\"pages\":0},\"success\":true}";
|
||||
String s = Optional.ofNullable(HttpRequest.get("localhost:53323/dict/getCourseException").execute() //"current",1,"type",1,"pid",128)
|
||||
String s = Optional.ofNullable(HttpRequest.get(infarasApiUrl).execute() //"current",1,"type",1,"pid",128)
|
||||
.body()).orElseThrow(() -> new RuntimeException("token校验失败"));
|
||||
List<DictDto> dictDtos = Opt.ofBlankAble(s).map(t -> JSONUtil.toBean(t, DictResult.class)).map(DictResult::getData).orElseThrow();
|
||||
List<String>userNo=new ArrayList<>();
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
spring.profiles.active=@profileActive@
|
||||
spring.profiles.active= test
|
||||
#@profileActive@
|
||||
spring.application.name=boe-server-all
|
||||
server.port=9090
|
||||
server.servlet.session.timeout=30m
|
||||
@@ -64,3 +65,7 @@ userBasic.searchUserList=${boe.domain}/userbasic/user/list
|
||||
audience.usersByAudienceList=${boe.domain}/userbasic/audience/memberList
|
||||
#获取用户学习课程数据
|
||||
statApi.userdynamicList=${boe.domain}/statApi/xboe/m/stat/userdynamic/list
|
||||
#用户中心根据组织id查询用户信息接口(递归子组织)
|
||||
audience.getOrgUsers=${boe.domain}/userbasic/user/getOrgUsers
|
||||
#获取工号
|
||||
infrasApi.dict=${boe.domain}/infrasApi/dict/getCourseException
|
||||
Reference in New Issue
Block a user