Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
ghsby
o2oa
提交
869197d8
o2oa
项目概览
ghsby
/
o2oa
落后 Fork 源项目 2880 个版本
Fork自
浙江兰德纵横网络技术股份有限公司 / o2oa
通知
1
Star
1
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,发现更多精彩内容 >>
提交
869197d8
编写于
7月 22, 2021
作者:
O
o2sword
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
流程起草权限增加群组设置
上级
ab233483
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
273 addition
and
100 deletion
+273
-100
o2server/x_organization_assemble_control/src/main/java/com/x/organization/assemble/control/jaxrs/identity/ActionDelete.java
...ization/assemble/control/jaxrs/identity/ActionDelete.java
+16
-8
o2server/x_organization_assemble_express/src/main/java/com/x/organization/assemble/express/jaxrs/unit/ActionListObject.java
...ization/assemble/express/jaxrs/unit/ActionListObject.java
+1
-1
o2server/x_organization_core_express/src/main/java/com/x/organization/core/express/group/ActionListWithIdentity.java
...ganization/core/express/group/ActionListWithIdentity.java
+75
-0
o2server/x_organization_core_express/src/main/java/com/x/organization/core/express/group/GroupFactory.java
...a/com/x/organization/core/express/group/GroupFactory.java
+24
-0
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/factory/element/ProcessFactory.java
...form/assemble/surface/factory/element/ProcessFactory.java
+14
-4
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/application/ActionListWithPerson.java
...emble/surface/jaxrs/application/ActionListWithPerson.java
+30
-16
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/application/ActionListWithPersonComplex.java
...urface/jaxrs/application/ActionListWithPersonComplex.java
+35
-21
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/application/ActionListWithPersonLike.java
...e/surface/jaxrs/application/ActionListWithPersonLike.java
+10
-5
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/application/ActionManageListWithPersonComplex.java
.../jaxrs/application/ActionManageListWithPersonComplex.java
+14
-33
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/application/BaseAction.java
...atform/assemble/surface/jaxrs/application/BaseAction.java
+4
-1
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/draft/ActionSave.java
...cessplatform/assemble/surface/jaxrs/draft/ActionSave.java
+2
-1
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/process/ActionListAvailableIdentityWithProcess.java
...jaxrs/process/ActionListAvailableIdentityWithProcess.java
+19
-4
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/process/ActionListWithPersonWithApplication.java
...ce/jaxrs/process/ActionListWithPersonWithApplication.java
+2
-2
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/process/ActionListWithPersonWithApplicationFilter.java
...rs/process/ActionListWithPersonWithApplicationFilter.java
+8
-4
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/element/Process.java
...va/com/x/processplatform/core/entity/element/Process.java
+19
-0
未找到文件。
o2server/x_organization_assemble_control/src/main/java/com/x/organization/assemble/control/jaxrs/identity/ActionDelete.java
浏览文件 @
869197d8
...
...
@@ -12,6 +12,7 @@ import javax.persistence.criteria.Predicate;
import
javax.persistence.criteria.Root
;
import
com.x.base.core.project.cache.CacheManager
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.organization.core.entity.*
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -45,14 +46,11 @@ public class ActionDelete extends BaseAction {
throw
new
ExceptionAccessDenied
(
effectivePerson
,
unit
);
}
/** 由于有关联所以要分段提交,提交UnitDuty的成员删除。 */
emc
.
beginTransaction
(
UnitDuty
.
class
);
this
.
removeMemberOfUnitDuty
(
business
,
identity
);
emc
.
commit
();
}
/** group的身份成员删除。*/
emc
.
beginTransaction
(
Group
.
class
);
this
.
removeMemberOfGroup
(
business
,
identity
);
emc
.
commit
();
/** 由于前面pick出来的需要重新取出 */
identity
=
emc
.
find
(
identity
.
getId
(),
Identity
.
class
);
// /** 删除下属身份 */
...
...
@@ -100,15 +98,25 @@ public class ActionDelete extends BaseAction {
Root
<
UnitDuty
>
root
=
cq
.
from
(
UnitDuty
.
class
);
Predicate
p
=
cb
.
isMember
(
identity
.
getId
(),
root
.
get
(
UnitDuty_
.
identityList
));
List
<
UnitDuty
>
os
=
em
.
createQuery
(
cq
.
select
(
root
).
where
(
p
)).
getResultList
().
stream
().
distinct
().
collect
(
Collectors
.
toList
());
for
(
UnitDuty
o
:
os
)
{
o
.
getIdentityList
().
remove
(
identity
.
getId
());
if
(
ListTools
.
isNotEmpty
(
os
))
{
business
.
entityManagerContainer
().
beginTransaction
(
UnitDuty
.
class
);
for
(
UnitDuty
o
:
os
)
{
o
.
getIdentityList
().
remove
(
identity
.
getId
());
}
business
.
entityManagerContainer
().
commit
();
CacheManager
.
notify
(
UnitDuty
.
class
);
}
}
private
void
removeMemberOfGroup
(
Business
business
,
Identity
identity
)
throws
Exception
{
List
<
Group
>
groups
=
business
.
group
().
listSupDirectWithIdentityObject
(
identity
.
getId
());
for
(
Group
g
:
groups
){
g
.
getIdentityList
().
remove
(
identity
.
getId
());
if
(
ListTools
.
isNotEmpty
(
groups
))
{
business
.
entityManagerContainer
().
beginTransaction
(
Group
.
class
);
for
(
Group
g
:
groups
)
{
g
.
getIdentityList
().
remove
(
identity
.
getId
());
}
business
.
entityManagerContainer
().
commit
();
CacheManager
.
notify
(
Group
.
class
);
}
}
}
\ No newline at end of file
o2server/x_organization_assemble_express/src/main/java/com/x/organization/assemble/express/jaxrs/unit/ActionListObject.java
浏览文件 @
869197d8
...
...
@@ -143,7 +143,7 @@ class ActionListObject extends BaseAction {
for
(
CompletableFuture
<
Wo
>
future
:
futures
)
{
wos
.
add
(
future
.
get
());
}
return
wos
;
return
ListTools
.
trim
(
wos
,
true
,
false
)
;
}
private
CompletableFuture
<
Wo
>
future
(
String
name
)
{
...
...
o2server/x_organization_core_express/src/main/java/com/x/organization/core/express/group/ActionListWithIdentity.java
0 → 100644
浏览文件 @
869197d8
package
com.x.organization.core.express.group
;
import
com.x.base.core.project.AbstractContext
;
import
com.x.base.core.project.annotation.FieldDescribe
;
import
com.x.base.core.project.gson.GsonPropertyObject
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.List
;
class
ActionListWithIdentity
extends
BaseAction
{
public
static
List
<
String
>
execute
(
AbstractContext
context
,
Collection
<
String
>
collection
,
boolean
recursiveGroupFlag
,
boolean
referenceFlag
,
boolean
recursiveOrgFlag
)
throws
Exception
{
Wi
wi
=
new
Wi
();
if
(
null
!=
collection
)
{
wi
.
getIdentityList
().
addAll
(
collection
);
wi
.
setRecursiveGroupFlag
(
recursiveGroupFlag
);
wi
.
setReferenceFlag
(
referenceFlag
);
wi
.
setRecursiveOrgFlag
(
recursiveOrgFlag
);
}
Wo
wo
=
context
.
applications
().
postQuery
(
applicationClass
,
"group/list/identity"
,
wi
).
getData
(
Wo
.
class
);
return
wo
.
getGroupList
();
}
public
static
class
Wi
extends
GsonPropertyObject
{
@FieldDescribe
(
"个人"
)
private
List
<
String
>
identityList
=
new
ArrayList
<>();
@FieldDescribe
(
"是否递归查询上级群组,默认true"
)
private
Boolean
recursiveGroupFlag
=
true
;
@FieldDescribe
(
"是否包含查找人员身份成员、人员归属组织成员的所属群组,默认false"
)
private
Boolean
referenceFlag
=
false
;
@FieldDescribe
(
"是否递归人员归属组织的上级组织所属群组,前提referenceFlag为true,默认false"
)
private
Boolean
recursiveOrgFlag
=
false
;
public
List
<
String
>
getIdentityList
()
{
return
identityList
;
}
public
void
setIdentityList
(
List
<
String
>
identityList
)
{
this
.
identityList
=
identityList
;
}
public
Boolean
getReferenceFlag
()
{
return
referenceFlag
;
}
public
void
setReferenceFlag
(
Boolean
referenceFlag
)
{
this
.
referenceFlag
=
referenceFlag
;
}
public
Boolean
getRecursiveGroupFlag
()
{
return
recursiveGroupFlag
;
}
public
void
setRecursiveGroupFlag
(
Boolean
recursiveGroupFlag
)
{
this
.
recursiveGroupFlag
=
recursiveGroupFlag
;
}
public
Boolean
getRecursiveOrgFlag
()
{
return
recursiveOrgFlag
;
}
public
void
setRecursiveOrgFlag
(
Boolean
recursiveOrgFlag
)
{
this
.
recursiveOrgFlag
=
recursiveOrgFlag
;
}
}
public
static
class
Wo
extends
WoGroupAbstract
{
}
}
o2server/x_organization_core_express/src/main/java/com/x/organization/core/express/group/GroupFactory.java
浏览文件 @
869197d8
...
...
@@ -138,4 +138,28 @@ public class GroupFactory {
return
ActionListWithPerson
.
execute
(
context
,
values
,
recursiveGroupFlag
,
referenceFlag
,
recursiveOrgFlag
);
}
/** 查询身份所在的群组 */
public
List
<
String
>
listWithIdentity
(
Collection
<
String
>
values
)
throws
Exception
{
return
listWithIdentityReference
(
values
,
true
,
true
,
true
);
}
/** 查询身份所在的群组 */
public
List
<
String
>
listWithIdentity
(
String
...
values
)
throws
Exception
{
return
listWithIdentityReference
(
Arrays
.
asList
(
values
),
true
,
true
,
true
);
}
/**
* 查询身份及关联组织所在的群组
* @param values 身份
* @param recursiveGroupFlag 是否递归查询上级群组
* @param referenceFlag 是否包含查找人员身份成员、人员归属组织成员的所属群组
* @param recursiveOrgFlag 是否递归人员归属组织的上级组织所属群组,前提referenceFlag为true
* @return
* @throws Exception
*/
public
List
<
String
>
listWithIdentityReference
(
Collection
<
String
>
values
,
boolean
recursiveGroupFlag
,
boolean
referenceFlag
,
boolean
recursiveOrgFlag
)
throws
Exception
{
return
ActionListWithIdentity
.
execute
(
context
,
values
,
recursiveGroupFlag
,
referenceFlag
,
recursiveOrgFlag
);
}
}
\ No newline at end of file
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/factory/element/ProcessFactory.java
浏览文件 @
869197d8
...
...
@@ -79,7 +79,7 @@ public class ProcessFactory extends ElementFactory {
/* 获取用户可启动的流程,如果applicationId 为空则取到所有可启动流程 */
public
List
<
String
>
listStartableWithApplication
(
EffectivePerson
effectivePerson
,
List
<
String
>
identities
,
List
<
String
>
units
,
Application
application
)
throws
Exception
{
List
<
String
>
units
,
List
<
String
>
groups
,
Application
application
)
throws
Exception
{
EntityManager
em
=
this
.
entityManagerContainer
().
get
(
Process
.
class
);
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
...
...
@@ -88,7 +88,8 @@ public class ProcessFactory extends ElementFactory {
if
(
effectivePerson
.
isNotManager
()
&&
(!
this
.
business
().
organization
().
person
().
hasRole
(
effectivePerson
,
OrganizationDefinition
.
Manager
,
OrganizationDefinition
.
ProcessPlatformManager
)))
{
p
=
cb
.
and
(
cb
.
isEmpty
(
root
.
get
(
Process_
.
startableIdentityList
)),
cb
.
isEmpty
(
root
.
get
(
Process_
.
startableUnitList
)));
cb
.
isEmpty
(
root
.
get
(
Process_
.
startableUnitList
)),
cb
.
isEmpty
(
root
.
get
(
Process_
.
startableGroupList
)));
p
=
cb
.
or
(
p
,
cb
.
equal
(
root
.
get
(
Process_
.
creatorPerson
),
effectivePerson
.
getDistinguishedName
()));
if
(
ListTools
.
isNotEmpty
(
identities
))
{
p
=
cb
.
or
(
p
,
root
.
get
(
Process_
.
startableIdentityList
).
in
(
identities
));
...
...
@@ -96,6 +97,9 @@ public class ProcessFactory extends ElementFactory {
if
(
ListTools
.
isNotEmpty
(
units
))
{
p
=
cb
.
or
(
p
,
root
.
get
(
Process_
.
startableUnitList
).
in
(
units
));
}
if
(
ListTools
.
isNotEmpty
(
groups
))
{
p
=
cb
.
or
(
p
,
root
.
get
(
Process_
.
startableGroupList
).
in
(
groups
));
}
}
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Process_
.
application
),
application
.
getId
()));
p
=
cb
.
and
(
p
,
cb
.
or
(
cb
.
isTrue
(
root
.
get
(
Process_
.
editionEnable
)),
cb
.
isNull
(
root
.
get
(
Process_
.
editionEnable
))));
...
...
@@ -105,14 +109,15 @@ public class ProcessFactory extends ElementFactory {
/* 获取用户可启动的流程,如果applicationId 为空则取到所有可启动流程 */
public
boolean
startable
(
EffectivePerson
effectivePerson
,
List
<
String
>
identities
,
List
<
String
>
units
,
Process
process
)
throws
Exception
{
List
<
String
>
groups
,
Process
process
)
throws
Exception
{
if
(
effectivePerson
.
isManager
()
||
(
BooleanUtils
.
isTrue
(
this
.
business
().
organization
().
person
().
hasRole
(
effectivePerson
,
OrganizationDefinition
.
Manager
,
OrganizationDefinition
.
ProcessPlatformManager
))))
{
return
true
;
}
if
(
ListTools
.
isEmpty
(
process
.
getStartableIdentityList
())
&&
ListTools
.
isEmpty
(
process
.
getStartableUnitList
()))
{
&&
ListTools
.
isEmpty
(
process
.
getStartableUnitList
())
&&
ListTools
.
isEmpty
(
process
.
getStartableGroupList
()))
{
return
true
;
}
if
(
ListTools
.
isNotEmpty
(
process
.
getStartableIdentityList
())
...
...
@@ -122,6 +127,11 @@ public class ProcessFactory extends ElementFactory {
if
(
ListTools
.
isNotEmpty
(
process
.
getStartableUnitList
())
&&
ListTools
.
containsAny
(
units
,
process
.
getStartableUnitList
()))
{
return
true
;
}
else
{
if
(
ListTools
.
isNotEmpty
(
process
.
getStartableGroupList
())
&&
ListTools
.
containsAny
(
groups
,
process
.
getStartableGroupList
()))
{
return
true
;
}
}
}
return
false
;
...
...
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/application/ActionListWithPerson.java
浏览文件 @
869197d8
...
...
@@ -2,6 +2,7 @@ package com.x.processplatform.assemble.surface.jaxrs.application;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Optional
;
import
java.util.stream.Collectors
;
import
javax.persistence.EntityManager
;
...
...
@@ -15,6 +16,8 @@ import com.x.base.core.container.factory.EntityManagerContainerFactory;
import
com.x.base.core.entity.JpaObject
;
import
com.x.base.core.project.bean.WrapCopier
;
import
com.x.base.core.project.bean.WrapCopierFactory
;
import
com.x.base.core.project.cache.Cache
;
import
com.x.base.core.project.cache.CacheManager
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.organization.OrganizationDefinition
;
...
...
@@ -39,20 +42,27 @@ class ActionListWithPerson extends BaseAction {
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Business
business
=
new
Business
(
emc
);
ActionResult
<
List
<
Wo
>>
result
=
new
ActionResult
<>();
List
<
Wo
>
wos
=
new
ArrayList
<>();
List
<
String
>
identities
=
business
.
organization
().
identity
().
listWithPerson
(
effectivePerson
);
/** 去除部门以及上级部门,如果设置了一级部门可用,那么一级部门下属的二级部门也可用 */
List
<
String
>
units
=
business
.
organization
().
unit
().
listWithPersonSupNested
(
effectivePerson
);
List
<
String
>
roles
=
business
.
organization
().
role
().
listWithPerson
(
effectivePerson
);
List
<
String
>
ids
=
this
.
list
(
business
,
effectivePerson
,
roles
,
identities
,
units
);
for
(
String
id
:
ids
)
{
Application
o
=
business
.
application
().
pick
(
id
);
if
(
null
!=
o
)
{
wos
.
add
(
Wo
.
copier
.
copy
(
o
));
Cache
.
CacheKey
cacheKey
=
new
Cache
.
CacheKey
(
this
.
getClass
(),
effectivePerson
.
getDistinguishedName
());
Optional
<?>
optional
=
CacheManager
.
get
(
cacheCategory
,
cacheKey
);
if
(
optional
.
isPresent
())
{
result
.
setData
((
List
<
Wo
>)
optional
.
get
());
}
else
{
List
<
Wo
>
wos
=
new
ArrayList
<>();
List
<
String
>
identities
=
business
.
organization
().
identity
().
listWithPerson
(
effectivePerson
);
/** 去除部门以及上级部门,如果设置了一级部门可用,那么一级部门下属的二级部门也可用 */
List
<
String
>
units
=
business
.
organization
().
unit
().
listWithPersonSupNested
(
effectivePerson
);
List
<
String
>
roles
=
business
.
organization
().
role
().
listWithPerson
(
effectivePerson
);
List
<
String
>
groups
=
business
.
organization
().
group
().
listWithIdentity
(
identities
);
List
<
String
>
ids
=
this
.
list
(
business
,
effectivePerson
,
roles
,
identities
,
units
,
groups
);
for
(
String
id
:
ids
)
{
Application
o
=
business
.
application
().
pick
(
id
);
if
(
null
!=
o
)
{
wos
.
add
(
Wo
.
copier
.
copy
(
o
));
}
}
wos
=
business
.
application
().
sort
(
wos
);
result
.
setData
(
wos
);
}
wos
=
business
.
application
().
sort
(
wos
);
result
.
setData
(
wos
);
return
result
;
}
}
...
...
@@ -72,10 +82,10 @@ class ActionListWithPerson extends BaseAction {
* 两份ids的交集,这样避免列示只有application没有可以启动process的应用
*/
private
List
<
String
>
list
(
Business
business
,
EffectivePerson
effectivePerson
,
List
<
String
>
roles
,
List
<
String
>
identities
,
List
<
String
>
units
)
throws
Exception
{
List
<
String
>
identities
,
List
<
String
>
units
,
List
<
String
>
groups
)
throws
Exception
{
// List<String> ids = this.listFromApplication(business, effectivePerson, roles, identities, units);
// return ids;
List
<
String
>
fromProcessIds
=
this
.
listFromProcess
(
business
,
effectivePerson
,
roles
,
identities
,
units
);
List
<
String
>
fromProcessIds
=
this
.
listFromProcess
(
business
,
effectivePerson
,
roles
,
identities
,
units
,
groups
);
return
fromProcessIds
;
// return ListUtils.intersection(ids, fromProcessIds);
}
...
...
@@ -110,7 +120,7 @@ class ActionListWithPerson extends BaseAction {
* 从Process中获取可以启动的Process的application.
*/
private
List
<
String
>
listFromProcess
(
Business
business
,
EffectivePerson
effectivePerson
,
List
<
String
>
roles
,
List
<
String
>
identities
,
List
<
String
>
units
)
throws
Exception
{
List
<
String
>
identities
,
List
<
String
>
units
,
List
<
String
>
groups
)
throws
Exception
{
EntityManager
em
=
business
.
entityManagerContainer
().
get
(
Process
.
class
);
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
...
...
@@ -119,7 +129,8 @@ class ActionListWithPerson extends BaseAction {
if
(
effectivePerson
.
isNotManager
()
&&
(!
business
.
organization
().
person
().
hasRole
(
effectivePerson
,
OrganizationDefinition
.
Manager
,
OrganizationDefinition
.
ProcessPlatformManager
)))
{
p
=
cb
.
and
(
cb
.
isEmpty
(
root
.
get
(
Process_
.
startableIdentityList
)),
cb
.
isEmpty
(
root
.
get
(
Process_
.
startableUnitList
)));
cb
.
isEmpty
(
root
.
get
(
Process_
.
startableUnitList
)),
cb
.
isEmpty
(
root
.
get
(
Process_
.
startableGroupList
)));
p
=
cb
.
or
(
p
,
cb
.
isMember
(
effectivePerson
.
getDistinguishedName
(),
root
.
get
(
Process_
.
controllerList
)));
p
=
cb
.
or
(
p
,
cb
.
equal
(
root
.
get
(
Process_
.
creatorPerson
),
effectivePerson
.
getDistinguishedName
()));
if
(
ListTools
.
isNotEmpty
(
identities
))
{
...
...
@@ -128,6 +139,9 @@ class ActionListWithPerson extends BaseAction {
if
(
ListTools
.
isNotEmpty
(
units
))
{
p
=
cb
.
or
(
p
,
root
.
get
(
Process_
.
startableUnitList
).
in
(
units
));
}
if
(
ListTools
.
isNotEmpty
(
groups
))
{
p
=
cb
.
or
(
p
,
root
.
get
(
Process_
.
startableGroupList
).
in
(
groups
));
}
}
cq
.
select
(
root
.
get
(
Process_
.
application
)).
where
(
p
);
return
em
.
createQuery
(
cq
).
getResultList
().
stream
().
distinct
().
collect
(
Collectors
.
toList
());
...
...
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/application/ActionListWithPersonComplex.java
浏览文件 @
869197d8
...
...
@@ -2,6 +2,7 @@ package com.x.processplatform.assemble.surface.jaxrs.application;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Optional
;
import
java.util.stream.Collectors
;
import
javax.persistence.EntityManager
;
...
...
@@ -10,6 +11,8 @@ import javax.persistence.criteria.CriteriaQuery;
import
javax.persistence.criteria.Predicate
;
import
javax.persistence.criteria.Root
;
import
com.x.base.core.project.cache.Cache
;
import
com.x.base.core.project.cache.CacheManager
;
import
org.apache.commons.collections4.ListUtils
;
import
com.x.base.core.container.EntityManagerContainer
;
...
...
@@ -33,23 +36,30 @@ class ActionListWithPersonComplex extends BaseAction {
ActionResult
<
List
<
Wo
>>
execute
(
EffectivePerson
effectivePerson
)
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
ActionResult
<
List
<
Wo
>>
result
=
new
ActionResult
<>();
List
<
Wo
>
wos
=
new
ArrayList
<>();
Business
business
=
new
Business
(
emc
);
List
<
String
>
identities
=
business
.
organization
().
identity
().
listWithPerson
(
effectivePerson
);
/** 去除部门以及上级部门,如果设置了一级部门可用,那么一级部门下属的二级部门也可用 */
List
<
String
>
units
=
business
.
organization
().
unit
().
listWithPersonSupNested
(
effectivePerson
);
List
<
String
>
roles
=
business
.
organization
().
role
().
listWithPerson
(
effectivePerson
);
List
<
String
>
ids
=
this
.
list
(
business
,
effectivePerson
,
roles
,
identities
,
units
);
for
(
String
id
:
ids
)
{
Application
o
=
business
.
application
().
pick
(
id
);
if
(
null
!=
o
)
{
Wo
wo
=
Wo
.
copier
.
copy
(
o
);
wo
.
setProcessList
(
this
.
referenceProcess
(
business
,
effectivePerson
,
identities
,
units
,
o
));
wos
.
add
(
wo
);
Cache
.
CacheKey
cacheKey
=
new
Cache
.
CacheKey
(
this
.
getClass
(),
effectivePerson
.
getDistinguishedName
());
Optional
<?>
optional
=
CacheManager
.
get
(
cacheCategory
,
cacheKey
);
if
(
optional
.
isPresent
())
{
result
.
setData
((
List
<
Wo
>)
optional
.
get
());
}
else
{
List
<
Wo
>
wos
=
new
ArrayList
<>();
Business
business
=
new
Business
(
emc
);
List
<
String
>
identities
=
business
.
organization
().
identity
().
listWithPerson
(
effectivePerson
);
/** 去除部门以及上级部门,如果设置了一级部门可用,那么一级部门下属的二级部门也可用 */
List
<
String
>
units
=
business
.
organization
().
unit
().
listWithPersonSupNested
(
effectivePerson
);
List
<
String
>
roles
=
business
.
organization
().
role
().
listWithPerson
(
effectivePerson
);
List
<
String
>
groups
=
business
.
organization
().
group
().
listWithIdentity
(
identities
);
List
<
String
>
ids
=
this
.
list
(
business
,
effectivePerson
,
roles
,
identities
,
units
,
groups
);
for
(
String
id
:
ids
)
{
Application
o
=
business
.
application
().
pick
(
id
);
if
(
null
!=
o
)
{
Wo
wo
=
Wo
.
copier
.
copy
(
o
);
wo
.
setProcessList
(
this
.
referenceProcess
(
business
,
effectivePerson
,
identities
,
units
,
groups
,
o
));
wos
.
add
(
wo
);
}
}
wos
=
business
.
application
().
sort
(
wos
);
result
.
setData
(
wos
);
}
wos
=
business
.
application
().
sort
(
wos
);
result
.
setData
(
wos
);
return
result
;
}
}
...
...
@@ -101,9 +111,9 @@ class ActionListWithPersonComplex extends BaseAction {
* 两份ids的交集,这样避免列示只有application没有可以启动process的应用
*/
private
List
<
String
>
list
(
Business
business
,
EffectivePerson
effectivePerson
,
List
<
String
>
roles
,
List
<
String
>
identities
,
List
<
String
>
units
)
throws
Exception
{
List
<
String
>
identities
,
List
<
String
>
units
,
List
<
String
>
groups
)
throws
Exception
{
List
<
String
>
ids
=
this
.
listFromApplication
(
business
,
effectivePerson
,
roles
,
identities
,
units
);
List
<
String
>
fromProcessIds
=
this
.
listFromProcess
(
business
,
effectivePerson
,
roles
,
identities
,
units
);
List
<
String
>
fromProcessIds
=
this
.
listFromProcess
(
business
,
effectivePerson
,
roles
,
identities
,
units
,
groups
);
return
ListUtils
.
intersection
(
ids
,
fromProcessIds
);
}
...
...
@@ -136,7 +146,7 @@ class ActionListWithPersonComplex extends BaseAction {
* 从Process中获取可以启动的Process的application.
*/
private
List
<
String
>
listFromProcess
(
Business
business
,
EffectivePerson
effectivePerson
,
List
<
String
>
roles
,
List
<
String
>
identities
,
List
<
String
>
units
)
throws
Exception
{
List
<
String
>
identities
,
List
<
String
>
units
,
List
<
String
>
groups
)
throws
Exception
{
EntityManager
em
=
business
.
entityManagerContainer
().
get
(
Process
.
class
);
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
...
...
@@ -145,7 +155,8 @@ class ActionListWithPersonComplex extends BaseAction {
if
(
effectivePerson
.
isNotManager
()
&&
(!
business
.
organization
().
person
().
hasRole
(
effectivePerson
,
OrganizationDefinition
.
Manager
,
OrganizationDefinition
.
ProcessPlatformManager
)))
{
p
=
cb
.
and
(
cb
.
isEmpty
(
root
.
get
(
Process_
.
startableIdentityList
)),
cb
.
isEmpty
(
root
.
get
(
Process_
.
startableUnitList
)));
cb
.
isEmpty
(
root
.
get
(
Process_
.
startableUnitList
)),
cb
.
isEmpty
(
root
.
get
(
Process_
.
startableGroupList
)));
p
=
cb
.
or
(
p
,
cb
.
isMember
(
effectivePerson
.
getDistinguishedName
(),
root
.
get
(
Process_
.
controllerList
)));
p
=
cb
.
or
(
p
,
cb
.
equal
(
root
.
get
(
Process_
.
creatorPerson
),
effectivePerson
.
getDistinguishedName
()));
if
(
ListTools
.
isNotEmpty
(
identities
))
{
...
...
@@ -154,15 +165,18 @@ class ActionListWithPersonComplex extends BaseAction {
if
(
ListTools
.
isNotEmpty
(
units
))
{
p
=
cb
.
or
(
p
,
root
.
get
(
Process_
.
startableUnitList
).
in
(
units
));
}
if
(
ListTools
.
isNotEmpty
(
groups
))
{
p
=
cb
.
or
(
p
,
root
.
get
(
Process_
.
startableGroupList
).
in
(
groups
));
}
}
cq
.
select
(
root
.
get
(
Process_
.
application
)).
where
(
p
);
return
em
.
createQuery
(
cq
).
getResultList
().
stream
().
distinct
().
collect
(
Collectors
.
toList
());
}
private
List
<
WoProcess
>
referenceProcess
(
Business
business
,
EffectivePerson
effectivePerson
,
List
<
String
>
identities
,
List
<
String
>
units
,
Application
application
)
throws
Exception
{
List
<
String
>
identities
,
List
<
String
>
units
,
List
<
String
>
groups
,
Application
application
)
throws
Exception
{
List
<
String
>
ids
=
business
.
process
().
listStartableWithApplication
(
effectivePerson
,
identities
,
units
,
application
);
groups
,
application
);
List
<
WoProcess
>
wos
=
new
ArrayList
<>();
for
(
String
id
:
ids
)
{
WoProcess
o
=
WoProcess
.
copier
.
copy
(
business
.
process
().
pick
(
id
));
...
...
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/application/ActionListWithPersonLike.java
浏览文件 @
869197d8
...
...
@@ -38,7 +38,8 @@ class ActionListWithPersonLike extends BaseAction {
/** 去除部门以及上级部门,如果设置了一级部门可用,那么一级部门下属的二级部门也可用 */
List
<
String
>
units
=
business
.
organization
().
unit
().
listWithPersonSupNested
(
effectivePerson
);
List
<
String
>
roles
=
business
.
organization
().
role
().
listWithPerson
(
effectivePerson
);
List
<
String
>
ids
=
this
.
list
(
business
,
effectivePerson
,
roles
,
identities
,
units
,
key
);
List
<
String
>
groups
=
business
.
organization
().
group
().
listWithIdentity
(
identities
);
List
<
String
>
ids
=
this
.
list
(
business
,
effectivePerson
,
roles
,
identities
,
units
,
groups
,
key
);
for
(
String
id
:
ids
)
{
Application
o
=
business
.
application
().
pick
(
id
);
wos
.
add
(
Wo
.
copier
.
copy
(
o
));
...
...
@@ -59,9 +60,9 @@ class ActionListWithPersonLike extends BaseAction {
}
private
List
<
String
>
list
(
Business
business
,
EffectivePerson
effectivePerson
,
List
<
String
>
roles
,
List
<
String
>
identities
,
List
<
String
>
units
,
String
key
)
throws
Exception
{
List
<
String
>
identities
,
List
<
String
>
units
,
List
<
String
>
groups
,
String
key
)
throws
Exception
{
List
<
String
>
ids
=
this
.
listFromApplication
(
business
,
effectivePerson
,
roles
,
identities
,
units
);
List
<
String
>
fromProcessIds
=
this
.
listFromProcess
(
business
,
effectivePerson
,
roles
,
identities
,
units
,
key
);
List
<
String
>
fromProcessIds
=
this
.
listFromProcess
(
business
,
effectivePerson
,
roles
,
identities
,
units
,
groups
,
key
);
return
ListUtils
.
intersection
(
ids
,
fromProcessIds
);
}
...
...
@@ -94,7 +95,7 @@ class ActionListWithPersonLike extends BaseAction {
* 从Process中获取可以启动的Process的application.
*/
private
List
<
String
>
listFromProcess
(
Business
business
,
EffectivePerson
effectivePerson
,
List
<
String
>
roles
,
List
<
String
>
identities
,
List
<
String
>
units
,
String
key
)
throws
Exception
{
List
<
String
>
identities
,
List
<
String
>
units
,
List
<
String
>
groups
,
String
key
)
throws
Exception
{
EntityManager
em
=
business
.
entityManagerContainer
().
get
(
Process
.
class
);
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
...
...
@@ -106,7 +107,8 @@ class ActionListWithPersonLike extends BaseAction {
if
(
effectivePerson
.
isNotManager
()
&&
(!
business
.
organization
().
person
().
hasRole
(
effectivePerson
,
OrganizationDefinition
.
Manager
,
OrganizationDefinition
.
ProcessPlatformManager
)))
{
p
=
cb
.
and
(
cb
.
isEmpty
(
root
.
get
(
Process_
.
startableIdentityList
)),
cb
.
isEmpty
(
root
.
get
(
Process_
.
startableUnitList
)));
cb
.
isEmpty
(
root
.
get
(
Process_
.
startableUnitList
)),
cb
.
isEmpty
(
root
.
get
(
Process_
.
startableGroupList
)));
p
=
cb
.
or
(
p
,
cb
.
isMember
(
effectivePerson
.
getDistinguishedName
(),
root
.
get
(
Process_
.
controllerList
)));
p
=
cb
.
or
(
p
,
cb
.
equal
(
root
.
get
(
Process_
.
creatorPerson
),
effectivePerson
.
getDistinguishedName
()));
if
(
ListTools
.
isNotEmpty
(
identities
))
{
...
...
@@ -115,6 +117,9 @@ class ActionListWithPersonLike extends BaseAction {
if
(
ListTools
.
isNotEmpty
(
units
))
{
p
=
cb
.
or
(
p
,
root
.
get
(
Process_
.
startableUnitList
).
in
(
units
));
}
if
(
ListTools
.
isNotEmpty
(
groups
))
{
p
=
cb
.
or
(
p
,
root
.
get
(
Process_
.
startableGroupList
).
in
(
groups
));
}
}
cq
.
select
(
root
.
get
(
Process_
.
application
)).
where
(
p
);
return
em
.
createQuery
(
cq
).
getResultList
().
stream
().
distinct
().
collect
(
Collectors
.
toList
());
...
...
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/application/ActionManageListWithPersonComplex.java
浏览文件 @
869197d8
...
...
@@ -39,12 +39,13 @@ class ActionManageListWithPersonComplex extends BaseAction {
/** 去除部门以及上级部门,如果设置了一级部门可用,那么一级部门下属的二级部门也可用 */
List
<
String
>
units
=
business
.
organization
().
unit
().
listWithPersonSupNested
(
person
);
List
<
String
>
roles
=
business
.
organization
().
role
().
listWithPerson
(
person
);
List
<
String
>
ids
=
this
.
list
(
business
,
effectivePerson
,
roles
,
identities
,
units
);
List
<
String
>
groups
=
business
.
organization
().
group
().
listWithIdentity
(
identities
);
List
<
String
>
ids
=
this
.
list
(
business
,
effectivePerson
,
roles
,
identities
,
units
,
groups
);
for
(
String
id
:
ids
)
{
Application
o
=
business
.
application
().
pick
(
id
);
if
(
null
!=
o
)
{
Wo
wo
=
Wo
.
copier
.
copy
(
o
);
wo
.
setProcessList
(
this
.
referenceProcess
(
business
,
effectivePerson
,
identities
,
units
,
o
));
wo
.
setProcessList
(
this
.
referenceProcess
(
business
,
effectivePerson
,
identities
,
units
,
groups
,
o
));
wos
.
add
(
wo
);
}
}
...
...
@@ -103,9 +104,9 @@ class ActionManageListWithPersonComplex extends BaseAction {
* 两份ids的交集,这样避免列示只有application没有可以启动process的应用
*/
private
List
<
String
>
list
(
Business
business
,
EffectivePerson
effectivePerson
,
List
<
String
>
roles
,
List
<
String
>
identities
,
List
<
String
>
units
)
throws
Exception
{
List
<
String
>
identities
,
List
<
String
>
units
,
List
<
String
>
groups
)
throws
Exception
{
List
<
String
>
ids
=
this
.
listFromApplication
(
business
,
effectivePerson
,
roles
,
identities
,
units
);
List
<
String
>
fromProcessIds
=
this
.
listFromProcess
(
business
,
effectivePerson
,
roles
,
identities
,
units
);
List
<
String
>
fromProcessIds
=
this
.
listFromProcess
(
business
,
effectivePerson
,
roles
,
identities
,
units
,
groups
);
return
ListUtils
.
intersection
(
ids
,
fromProcessIds
);
}
...
...
@@ -138,7 +139,7 @@ class ActionManageListWithPersonComplex extends BaseAction {
* 从Process中获取可以启动的Process的application.
*/
private
List
<
String
>
listFromProcess
(
Business
business
,
EffectivePerson
effectivePerson
,
List
<
String
>
roles
,
List
<
String
>
identities
,
List
<
String
>
units
)
throws
Exception
{
List
<
String
>
identities
,
List
<
String
>
units
,
List
<
String
>
groups
)
throws
Exception
{
EntityManager
em
=
business
.
entityManagerContainer
().
get
(
Process
.
class
);
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
...
...
@@ -146,7 +147,8 @@ class ActionManageListWithPersonComplex extends BaseAction {
Predicate
p
=
cb
.
conjunction
();
p
=
cb
.
and
(
cb
.
isEmpty
(
root
.
get
(
Process_
.
startableIdentityList
)),
cb
.
isEmpty
(
root
.
get
(
Process_
.
startableUnitList
)));
cb
.
isEmpty
(
root
.
get
(
Process_
.
startableUnitList
)),
cb
.
isEmpty
(
root
.
get
(
Process_
.
startableGroupList
)));
if
(
ListTools
.
isNotEmpty
(
identities
))
{
p
=
cb
.
or
(
p
,
root
.
get
(
Process_
.
startableIdentityList
).
in
(
identities
));
...
...
@@ -154,14 +156,18 @@ class ActionManageListWithPersonComplex extends BaseAction {
if
(
ListTools
.
isNotEmpty
(
units
))
{
p
=
cb
.
or
(
p
,
root
.
get
(
Process_
.
startableUnitList
).
in
(
units
));
}
if
(
ListTools
.
isNotEmpty
(
groups
))
{
p
=
cb
.
or
(
p
,
root
.
get
(
Process_
.
startableGroupList
).
in
(
groups
));
}
cq
.
select
(
root
.
get
(
Process_
.
application
)).
where
(
p
);
return
em
.
createQuery
(
cq
).
getResultList
().
stream
().
distinct
().
collect
(
Collectors
.
toList
());
}
private
List
<
WoProcess
>
referenceProcess
(
Business
business
,
EffectivePerson
effectivePerson
,
List
<
String
>
identities
,
List
<
String
>
units
,
Application
application
)
throws
Exception
{
List
<
String
>
ids
=
this
.
listStartableWithApplication
(
business
,
effectivePerson
,
identities
,
units
,
application
);
List
<
String
>
identities
,
List
<
String
>
units
,
List
<
String
>
groups
,
Application
application
)
throws
Exception
{
List
<
String
>
ids
=
business
.
process
().
listStartableWithApplication
(
effectivePerson
,
identities
,
units
,
groups
,
application
);
List
<
WoProcess
>
wos
=
new
ArrayList
<>();
for
(
String
id
:
ids
)
{
WoProcess
o
=
WoProcess
.
copier
.
copy
(
business
.
process
().
pick
(
id
));
...
...
@@ -170,29 +176,4 @@ class ActionManageListWithPersonComplex extends BaseAction {
wos
=
business
.
process
().
sort
(
wos
);
return
wos
;
}
/* 获取用户可启动的流程,如果applicationId 为空则取到所有可启动流程 */
private
List
<
String
>
listStartableWithApplication
(
Business
business
,
EffectivePerson
effectivePerson
,
List
<
String
>
identities
,
List
<
String
>
units
,
Application
application
)
throws
Exception
{
EntityManager
em
=
business
.
entityManagerContainer
().
get
(
Process
.
class
);
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
Root
<
Process
>
root
=
cq
.
from
(
Process
.
class
);
Predicate
p
=
cb
.
conjunction
();
p
=
cb
.
and
(
cb
.
isEmpty
(
root
.
get
(
Process_
.
startableIdentityList
)),
cb
.
isEmpty
(
root
.
get
(
Process_
.
startableUnitList
)));
if
(
ListTools
.
isNotEmpty
(
identities
))
{
p
=
cb
.
or
(
p
,
root
.
get
(
Process_
.
startableIdentityList
).
in
(
identities
));
}
if
(
ListTools
.
isNotEmpty
(
units
))
{
p
=
cb
.
or
(
p
,
root
.
get
(
Process_
.
startableUnitList
).
in
(
units
));
}
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Process_
.
application
),
application
.
getId
()));
p
=
cb
.
and
(
p
,
cb
.
or
(
cb
.
isTrue
(
root
.
get
(
Process_
.
editionEnable
)),
cb
.
isNull
(
root
.
get
(
Process_
.
editionEnable
))));
cq
.
select
(
root
.
get
(
Process_
.
id
)).
where
(
p
);
return
em
.
createQuery
(
cq
).
getResultList
().
stream
().
distinct
().
collect
(
Collectors
.
toList
());
}
}
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/application/BaseAction.java
浏览文件 @
869197d8
package
com.x.processplatform.assemble.surface.jaxrs.application
;
import
com.x.base.core.project.cache.Cache
;
import
com.x.base.core.project.jaxrs.StandardJaxrsAction
;
import
com.x.processplatform.core.entity.element.Application
;
import
com.x.processplatform.core.entity.element.Process
;
abstract
class
BaseAction
extends
StandardJaxrsAction
{
Cache
.
CacheCategory
cacheCategory
=
new
Cache
.
CacheCategory
(
Application
.
class
,
Process
.
class
);
}
\ No newline at end of file
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/draft/ActionSave.java
浏览文件 @
869197d8
...
...
@@ -48,7 +48,8 @@ class ActionSave extends BaseAction {
if
(!
business
.
application
().
allowRead
(
effectivePerson
,
roles
,
identities
,
units
,
application
))
{
throw
new
ExceptionAccessDenied
(
effectivePerson
,
application
);
}
if
(!
business
.
process
().
startable
(
effectivePerson
,
identities
,
units
,
process
))
{
List
<
String
>
groups
=
business
.
organization
().
group
().
listWithIdentity
(
identities
);
if
(!
business
.
process
().
startable
(
effectivePerson
,
identities
,
units
,
groups
,
process
))
{
throw
new
ExceptionAccessDenied
(
effectivePerson
,
process
);
}
emc
.
beginTransaction
(
Draft
.
class
);
...
...
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/process/ActionListAvailableIdentityWithProcess.java
浏览文件 @
869197d8
...
...
@@ -30,7 +30,8 @@ public class ActionListAvailableIdentityWithProcess extends BaseAction {
List
<
String
>
identities
=
business
.
organization
().
identity
().
listWithPerson
(
effectivePerson
);
List
<
String
>
dns
=
new
ArrayList
<>();
if
((
ListTools
.
isEmpty
(
process
.
getStartableIdentityList
()))
&&
(
ListTools
.
isEmpty
(
process
.
getStartableUnitList
())))
{
&&
(
ListTools
.
isEmpty
(
process
.
getStartableUnitList
()))
&&
(
ListTools
.
isEmpty
(
process
.
getStartableGroupList
())))
{
/** 没有设置可启动人员,所有人都可以启动 */
dns
.
addAll
(
identities
);
}
else
{
...
...
@@ -39,12 +40,26 @@ public class ActionListAvailableIdentityWithProcess extends BaseAction {
dns
.
addAll
(
identities
);
}
else
{
for
(
String
str
:
identities
)
{
List
<
String
>
units
=
business
.
organization
().
unit
().
listWithIdentitySupNested
(
str
);
if
(
ListTools
.
containsAny
(
units
,
process
.
getStartableUnitList
())
||
process
.
getStartableIdentityList
().
contains
(
str
))
{
if
(
ListTools
.
isNotEmpty
(
process
.
getStartableIdentityList
())
&&
process
.
getStartableIdentityList
().
contains
(
str
)){
dns
.
add
(
str
);
}
else
{
if
(
ListTools
.
isNotEmpty
(
process
.
getStartableUnitList
()))
{
List
<
String
>
units
=
business
.
organization
().
unit
().
listWithIdentitySupNested
(
str
);
if
(
ListTools
.
containsAny
(
units
,
process
.
getStartableUnitList
()))
{
dns
.
add
(
str
);
continue
;
}
}
if
(
ListTools
.
isNotEmpty
(
process
.
getStartableGroupList
()))
{
List
<
String
>
groups
=
business
.
organization
().
group
().
listWithIdentity
(
str
);
if
(
ListTools
.
containsAny
(
groups
,
process
.
getStartableGroupList
()))
{
dns
.
add
(
str
);
continue
;
}
}
}
}
}
}
List
<
Identity
>
os
=
business
.
organization
().
identity
().
listObject
(
dns
);
...
...
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/process/ActionListWithPersonWithApplication.java
浏览文件 @
869197d8
...
...
@@ -34,8 +34,8 @@ class ActionListWithPersonWithApplication extends BaseAction {
if
(!
business
.
application
().
allowRead
(
effectivePerson
,
roles
,
identities
,
units
,
application
))
{
throw
new
ExceptionAccessDenied
(
effectivePerson
);
}
List
<
String
>
ids
=
business
.
process
().
listStartableWithApplication
(
effectivePerson
,
identities
,
units
,
List
<
String
>
groups
=
business
.
organization
().
group
().
listWithIdentity
(
identities
);
List
<
String
>
ids
=
business
.
process
().
listStartableWithApplication
(
effectivePerson
,
identities
,
units
,
groups
,
application
);
for
(
String
id
:
ids
)
{
wos
.
add
(
Wo
.
copier
.
copy
(
business
.
process
().
pick
(
id
)));
...
...
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/process/ActionListWithPersonWithApplicationFilter.java
浏览文件 @
869197d8
...
...
@@ -52,8 +52,8 @@ class ActionListWithPersonWithApplicationFilter extends BaseAction {
if
(!
business
.
application
().
allowRead
(
effectivePerson
,
roles
,
identities
,
units
,
application
))
{
throw
new
ExceptionAccessDenied
(
effectivePerson
);
}
List
<
String
>
ids
=
list
(
business
,
effectivePerson
,
identities
,
units
,
application
,
wi
);
List
<
String
>
groups
=
business
.
organization
().
group
().
listWithIdentity
(
identities
);
List
<
String
>
ids
=
list
(
business
,
effectivePerson
,
identities
,
units
,
groups
,
application
,
wi
);
for
(
String
id
:
ids
)
{
wos
.
add
(
Wo
.
copier
.
copy
(
business
.
process
().
pick
(
id
)));
}
...
...
@@ -64,7 +64,7 @@ class ActionListWithPersonWithApplicationFilter extends BaseAction {
}
public
List
<
String
>
list
(
Business
business
,
EffectivePerson
effectivePerson
,
List
<
String
>
identities
,
List
<
String
>
units
,
Application
application
,
Wi
wi
)
throws
Exception
{
List
<
String
>
units
,
List
<
String
>
groups
,
Application
application
,
Wi
wi
)
throws
Exception
{
EntityManager
em
=
business
.
entityManagerContainer
().
get
(
Process
.
class
);
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
...
...
@@ -74,7 +74,8 @@ class ActionListWithPersonWithApplicationFilter extends BaseAction {
&&
(!
BooleanUtils
.
isTrue
(
business
.
organization
().
person
().
hasRole
(
effectivePerson
,
OrganizationDefinition
.
Manager
,
OrganizationDefinition
.
ProcessPlatformManager
))))
{
p
=
cb
.
and
(
cb
.
isEmpty
(
root
.
get
(
Process_
.
startableIdentityList
)),
cb
.
isEmpty
(
root
.
get
(
Process_
.
startableUnitList
)));
cb
.
isEmpty
(
root
.
get
(
Process_
.
startableUnitList
)),
cb
.
isEmpty
(
root
.
get
(
Process_
.
startableGroupList
)));
p
=
cb
.
or
(
p
,
cb
.
equal
(
root
.
get
(
Process_
.
creatorPerson
),
effectivePerson
.
getDistinguishedName
()));
if
(
ListTools
.
isNotEmpty
(
identities
))
{
p
=
cb
.
or
(
p
,
root
.
get
(
Process_
.
startableIdentityList
).
in
(
identities
));
...
...
@@ -82,6 +83,9 @@ class ActionListWithPersonWithApplicationFilter extends BaseAction {
if
(
ListTools
.
isNotEmpty
(
units
))
{
p
=
cb
.
or
(
p
,
root
.
get
(
Process_
.
startableUnitList
).
in
(
units
));
}
if
(
ListTools
.
isNotEmpty
(
groups
))
{
p
=
cb
.
or
(
p
,
root
.
get
(
Process_
.
startableGroupList
).
in
(
groups
));
}
}
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Process_
.
application
),
application
.
getId
()));
p
=
cb
.
and
(
p
,
cb
.
or
(
cb
.
isTrue
(
root
.
get
(
Process_
.
editionEnable
)),
cb
.
isNull
(
root
.
get
(
Process_
.
editionEnable
))));
...
...
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/element/Process.java
浏览文件 @
869197d8
...
...
@@ -295,6 +295,18 @@ public class Process extends SliceJpaObject {
@CheckPersist
(
allowEmpty
=
true
)
private
List
<
String
>
startableUnitList
;
public
static
final
String
startableGroupList_FIELDNAME
=
"startableGroupList"
;
@FieldDescribe
(
"在指定启动时候,允许新建Work的群组."
)
@PersistentCollection
(
fetch
=
FetchType
.
EAGER
)
@ContainerTable
(
name
=
TABLE
+
ContainerTableNameMiddle
+
startableGroupList_FIELDNAME
,
joinIndex
=
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
startableGroupList_FIELDNAME
+
JoinIndexNameSuffix
))
@OrderColumn
(
name
=
ORDERCOLUMNCOLUMN
)
@ElementColumn
(
length
=
length_255B
,
name
=
ColumnNamePrefix
+
startableGroupList_FIELDNAME
)
@ElementIndex
(
name
=
TABLE
+
IndexNameMiddle
+
startableGroupList_FIELDNAME
+
ElementIndexNameSuffix
)
@CheckPersist
(
allowEmpty
=
true
)
private
List
<
String
>
startableGroupList
;
public
static
final
String
serialTexture_FIELDNAME
=
"serialTexture"
;
@FieldDescribe
(
"编号定义."
)
@Lob
...
...
@@ -866,4 +878,11 @@ public class Process extends SliceJpaObject {
this
.
startableTerminal
=
startableTerminal
;
}
public
List
<
String
>
getStartableGroupList
()
{
return
startableGroupList
;
}
public
void
setStartableGroupList
(
List
<
String
>
startableGroupList
)
{
this
.
startableGroupList
=
startableGroupList
;
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录