Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
fuyue82
o2oa
提交
bb904658
o2oa
项目概览
fuyue82
/
o2oa
与 Fork 源项目一致
Fork自
浙江兰德纵横网络技术股份有限公司 / o2oa
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
o2oa
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
bb904658
编写于
4月 15, 2020
作者:
Z
Zhou Rui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
角色解析不包含群组
上级
74dba392
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
69 addition
and
64 deletion
+69
-64
o2server/x_base_core_project/src/main/java/com/x/base/core/project/script/ScriptFactory.java
...in/java/com/x/base/core/project/script/ScriptFactory.java
+4
-1
o2server/x_organization_assemble_authentication/src/main/java/com/x/organization/assemble/authentication/jaxrs/authentication/BaseAction.java
...emble/authentication/jaxrs/authentication/BaseAction.java
+19
-18
o2server/x_query_core_express/src/main/java/com/x/query/core/express/plan/Plan.java
...ess/src/main/java/com/x/query/core/express/plan/Plan.java
+46
-45
未找到文件。
o2server/x_base_core_project/src/main/java/com/x/base/core/project/script/ScriptFactory.java
浏览文件 @
bb904658
...
...
@@ -23,6 +23,10 @@ import jdk.nashorn.api.scripting.ScriptObjectMirror;
public
class
ScriptFactory
{
private
ScriptFactory
(){
}
public
static
final
ScriptEngine
scriptEngine
=
(
new
ScriptEngineManager
())
.
getEngineByName
(
Config
.
SCRIPTING_ENGINE_NAME
);
...
...
@@ -253,7 +257,6 @@ public class ScriptFactory {
}
}
return
list
;
}
}
\ No newline at end of file
o2server/x_organization_assemble_authentication/src/main/java/com/x/organization/assemble/authentication/jaxrs/authentication/BaseAction.java
浏览文件 @
bb904658
package
com.x.organization.assemble.authentication.jaxrs.authentication
;
import
java.util.ArrayList
;
import
java.util.Comparator
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
com.x.base.core.entity.JpaObject
;
import
com.x.base.core.project.annotation.FieldDescribe
;
import
com.x.base.core.project.bean.NameValuePair
;
...
...
@@ -21,18 +30,10 @@ import com.x.organization.assemble.authentication.Business;
import
com.x.organization.assemble.authentication.wrapout.WrapOutAuthentication
;
import
com.x.organization.core.entity.Identity
;
import
com.x.organization.core.entity.Person
;
import
com.x.organization.core.entity.Role
;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.ArrayList
;
import
java.util.Comparator
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.stream.Collectors
;
abstract
class
BaseAction
extends
StandardJaxrsAction
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
BaseAction
.
class
);
...
...
@@ -76,7 +77,7 @@ abstract class BaseAction extends StandardJaxrsAction {
t
.
setToken
(
effectivePerson
.
getToken
());
t
.
setTokenType
(
tokenType
);
/** 添加角色 */
t
.
setRoleList
(
listRole
(
business
,
person
.
getId
()));
t
.
setRoleList
(
business
.
organization
().
role
().
listWithPerson
(
effectivePerson
.
getDistinguishedName
()));
/** 添加身份 */
t
.
setIdentityList
(
listIdentity
(
business
,
person
.
getId
()));
/** 判断密码是否过期需要修改密码 */
...
...
@@ -157,14 +158,14 @@ abstract class BaseAction extends StandardJaxrsAction {
}
}
private
List
<
String
>
listRole
(
Business
business
,
String
personId
)
throws
Exception
{
List
<
String
>
roles
=
new
ArrayList
<>();
for
(
Role
o
:
business
.
entityManagerContainer
().
fetch
(
business
.
role
().
listWithPerson
(
personId
),
Role
.
class
,
ListTools
.
toList
(
Role
.
DISTINGUISHEDNAME
)))
{
roles
.
add
(
o
.
getDistinguishedName
());
}
return
roles
;
}
//
private List<String> listRole(Business business, String personId) throws Exception {
//
List<String> roles = new ArrayList<>();
//
for (Role o : business.entityManagerContainer().fetch(business.role().listWithPerson(personId), Role.class,
//
ListTools.toList(Role.DISTINGUISHEDNAME))) {
//
roles.add(o.getDistinguishedName());
//
}
//
return roles;
//
}
private
List
<
WoIdentity
>
listIdentity
(
Business
business
,
String
personId
)
throws
Exception
{
List
<
String
>
ids
=
business
.
identity
().
listWithPerson
(
personId
);
...
...
o2server/x_query_core_express/src/main/java/com/x/query/core/express/plan/Plan.java
浏览文件 @
bb904658
...
...
@@ -32,6 +32,8 @@ import com.x.base.core.entity.dataitem.ItemStringValueType;
import
com.x.base.core.entity.tools.JpaObjectTools
;
import
com.x.base.core.project.config.Config
;
import
com.x.base.core.project.gson.GsonPropertyObject
;
import
com.x.base.core.project.organization.OrganizationDefinition
;
import
com.x.base.core.project.script.ScriptFactory
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.query.core.entity.Item
;
import
com.x.query.core.entity.Item_
;
...
...
@@ -50,8 +52,6 @@ public abstract class Plan extends GsonPropertyObject {
public
static
final
String
CALCULATE_AVERAGE
=
"average"
;
public
static
final
String
CALCULATE_COUNT
=
"count"
;
protected
static
Pattern
DISTINGUISHEDNAME_PATTERN
=
Pattern
.
compile
(
"^(\\S+)\\@(\\S+)\\@(P|PA|G|R|I|U|UA|UD)$"
);
protected
static
final
int
SQL_STATEMENT_IN_BATCH
=
3000
;
public
Runtime
runtime
;
...
...
@@ -196,12 +196,12 @@ public abstract class Plan extends GsonPropertyObject {
}
else
{
bundles
=
this
.
listBundle
(
emc
);
}
//
if ((null != this.count) && (this.count > 0)) {
//
/* 默认限制了数量 */
//
if (this.count < bundles.size()) {
//
bundles = bundles.subList(0, this.count);
//
}
//
}
//
if ((null != this.count) && (this.count > 0)) {
//
/* 默认限制了数量 */
//
if (this.count < bundles.size()) {
//
bundles = bundles.subList(0, this.count);
//
}
//
}
if
((
null
!=
this
.
runtime
.
count
)
&&
(
this
.
runtime
.
count
>
0
))
{
/* runtime限制了数量 */
if
(
this
.
runtime
.
count
<
bundles
.
size
())
{
...
...
@@ -382,7 +382,7 @@ public abstract class Plan extends GsonPropertyObject {
}
private
String
name
(
String
str
)
{
Matcher
m
=
DISTINGUISHEDNAME_PATTERN
.
matcher
(
str
);
Matcher
m
=
OrganizationDefinition
.
distinguishedName_pattern
.
matcher
(
str
);
if
(
m
.
find
())
{
return
m
.
group
(
1
);
}
...
...
@@ -537,9 +537,10 @@ public abstract class Plan extends GsonPropertyObject {
/* 有两个地方用到了 */
private
ScriptEngine
getScriptEngine
()
{
ScriptEngineManager
manager
=
new
ScriptEngineManager
();
ScriptEngine
scriptEngine
=
manager
.
getEngineByName
(
"JavaScript"
);
return
scriptEngine
;
// ScriptEngineManager manager = new ScriptEngineManager();
// ScriptEngine scriptEngine = manager.getEngineByName("JavaScript");
// return scriptEngine;
return
ScriptFactory
.
scriptEngine
;
}
public
static
class
ExtractObject
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录