Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_42566577
o2oa
提交
49668e47
o2oa
项目概览
weixin_42566577
/
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,发现更多精彩内容 >>
提交
49668e47
编写于
8月 09, 2022
作者:
O
o2sword
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
流程和应用管理角色权限判断
上级
5edb89bc
变更
10
显示空白变更内容
内联
并排
Showing
10 changed file
with
150 addition
and
16 deletion
+150
-16
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/application/ActionCreate.java
...orm/assemble/designer/jaxrs/application/ActionCreate.java
+3
-1
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/factory/element/ProcessFactory.java
...form/assemble/surface/factory/element/ProcessFactory.java
+6
-7
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/application/ActionIsManager.java
...m/assemble/surface/jaxrs/application/ActionIsManager.java
+49
-0
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/application/ApplicationAction.java
...assemble/surface/jaxrs/application/ApplicationAction.java
+22
-1
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/process/ActionListControllableWithApplication.java
.../jaxrs/process/ActionListControllableWithApplication.java
+41
-0
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/process/ProcessAction.java
...latform/assemble/surface/jaxrs/process/ProcessAction.java
+23
-1
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/ActionManageListNext.java
...orm/assemble/surface/jaxrs/work/ActionManageListNext.java
+2
-2
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/ActionManageListPrev.java
...orm/assemble/surface/jaxrs/work/ActionManageListPrev.java
+2
-2
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/workcompleted/ActionManageListNext.java
...ble/surface/jaxrs/workcompleted/ActionManageListNext.java
+1
-1
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/workcompleted/ActionManageListPrev.java
...ble/surface/jaxrs/workcompleted/ActionManageListPrev.java
+1
-1
未找到文件。
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/application/ActionCreate.java
浏览文件 @
49668e47
...
...
@@ -13,6 +13,7 @@ import com.x.base.core.project.http.ActionResult;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.jaxrs.WoId
;
import
com.x.base.core.project.organization.OrganizationDefinition
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.processplatform.assemble.designer.Business
;
import
com.x.processplatform.assemble.designer.MessageFactory
;
import
com.x.processplatform.core.entity.element.Application
;
...
...
@@ -36,6 +37,7 @@ class ActionCreate extends BaseAction {
application
.
setCreatorPerson
(
effectivePerson
.
getDistinguishedName
());
application
.
setLastUpdatePerson
(
effectivePerson
.
getDistinguishedName
());
application
.
setLastUpdateTime
(
new
Date
());
application
.
setControllerList
(
ListTools
.
add
(
application
.
getControllerList
(),
true
,
true
,
effectivePerson
.
getDistinguishedName
()));
emc
.
persist
(
application
,
CheckPersistType
.
all
);
emc
.
commit
();
CacheManager
.
notify
(
Application
.
class
);
...
...
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/factory/element/ProcessFactory.java
浏览文件 @
49668e47
...
...
@@ -85,8 +85,7 @@ public class ProcessFactory extends ElementFactory {
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
Root
<
Process
>
root
=
cq
.
from
(
Process
.
class
);
Predicate
p
=
cb
.
conjunction
();
if
(
effectivePerson
.
isNotManager
()
&&
(!
this
.
business
().
organization
().
person
().
hasRole
(
effectivePerson
,
OrganizationDefinition
.
Manager
,
OrganizationDefinition
.
ProcessPlatformManager
)))
{
if
(!
this
.
business
().
canManageApplication
(
effectivePerson
,
application
))
{
p
=
cb
.
and
(
cb
.
isEmpty
(
root
.
get
(
Process_
.
startableIdentityList
)),
cb
.
isEmpty
(
root
.
get
(
Process_
.
startableUnitList
)),
cb
.
isEmpty
(
root
.
get
(
Process_
.
startableGroupList
)));
...
...
@@ -110,9 +109,7 @@ public class ProcessFactory extends ElementFactory {
/* 获取用户可启动的流程,如果applicationId 为空则取到所有可启动流程 */
public
boolean
startable
(
EffectivePerson
effectivePerson
,
List
<
String
>
identities
,
List
<
String
>
units
,
List
<
String
>
groups
,
Process
process
)
throws
Exception
{
if
(
effectivePerson
.
isManager
()
||
(
BooleanUtils
.
isTrue
(
this
.
business
().
organization
().
person
().
hasRole
(
effectivePerson
,
OrganizationDefinition
.
Manager
,
OrganizationDefinition
.
ProcessPlatformManager
))))
{
if
(
this
.
business
().
canManageApplication
(
effectivePerson
,
null
))
{
return
true
;
}
if
(
ListTools
.
isEmpty
(
process
.
getStartableIdentityList
())
...
...
@@ -137,13 +134,15 @@ public class ProcessFactory extends ElementFactory {
return
false
;
}
public
List
<
String
>
listControlableProcess
(
EffectivePerson
effectivePerson
,
Application
application
)
public
List
<
String
>
listControl
l
ableProcess
(
EffectivePerson
effectivePerson
,
Application
application
)
throws
Exception
{
List
<
String
>
ids
=
this
.
listWithApplication
(
application
);
boolean
isManager
=
this
.
business
().
canManageApplication
(
effectivePerson
,
application
);
List
<
String
>
list
=
new
ArrayList
<>();
for
(
String
str
:
ids
)
{
Process
o
=
this
.
pick
(
str
);
if
((
null
!=
o
)
&&
(
effectivePerson
.
isPerson
(
o
.
getControllerList
())))
{
boolean
flag
=
(!
BooleanUtils
.
isFalse
(
o
.
getEditionEnable
()))
&&
(
isManager
||
effectivePerson
.
isPerson
(
o
.
getControllerList
()));
if
(
flag
)
{
list
.
add
(
str
);
}
}
...
...
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/application/ActionIsManager.java
0 → 100644
浏览文件 @
49668e47
package
com.x.processplatform.assemble.surface.jaxrs.application
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.project.cache.Cache.CacheKey
;
import
com.x.base.core.project.cache.CacheManager
;
import
com.x.base.core.project.exception.ExceptionEntityNotExist
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.jaxrs.WrapBoolean
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.processplatform.assemble.surface.Business
;
import
com.x.processplatform.core.entity.element.Application
;
import
com.x.processplatform.core.express.assemble.surface.jaxrs.application.ActionGetIconWo
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
java.util.Optional
;
class
ActionIsManager
extends
BaseAction
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
ActionIsManager
.
class
);
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
String
flag
)
throws
Exception
{
LOGGER
.
debug
(
"execute:{}, flag:{}."
,
effectivePerson:
:
getDistinguishedName
,
()
->
flag
);
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
Wo
wo
=
new
Wo
();
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Business
business
=
new
Business
(
emc
);
Application
application
=
business
.
application
().
pick
(
flag
);
if
(
null
==
application
)
{
throw
new
ExceptionEntityNotExist
(
flag
);
}
wo
.
setValue
(
business
.
canManageApplication
(
effectivePerson
,
application
));
}
result
.
setData
(
wo
);
return
result
;
}
@Schema
(
name
=
"com.x.processplatform.assemble.surface.jaxrs.application.ActionIsManager$Wo"
)
public
static
class
Wo
extends
WrapBoolean
{
}
}
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/application/ApplicationAction.java
浏览文件 @
49668e47
...
...
@@ -162,4 +162,25 @@ public class ApplicationAction extends StandardJaxrsAction {
}
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
@Operation
(
summary
=
"校验当前用户是否是指定应用的管理员."
,
operationId
=
OPERATIONID_PREFIX
+
"isManager"
,
responses
=
{
@ApiResponse
(
content
=
{
@Content
(
schema
=
@Schema
(
implementation
=
ActionIsManager
.
Wo
.
class
))
})
})
@JaxrsMethodDescribe
(
value
=
"校验当前用户是否是指定应用的管理员."
,
action
=
ActionIsManager
.
class
)
@GET
@Path
(
"{flag}/is/manager"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
isManager
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
@JaxrsParameterDescribe
(
"应用标识"
)
@PathParam
(
"flag"
)
String
flag
)
{
ActionResult
<
ActionIsManager
.
Wo
>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
try
{
result
=
new
ActionIsManager
().
execute
(
effectivePerson
,
flag
);
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
e
,
effectivePerson
,
request
,
null
);
result
.
error
(
e
);
}
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
}
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/process/ActionListControllableWithApplication.java
0 → 100644
浏览文件 @
49668e47
package
com.x.processplatform.assemble.surface.jaxrs.process
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.project.exception.ExceptionEntityNotExist
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.jaxrs.WrapStringList
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.processplatform.assemble.surface.Business
;
import
com.x.processplatform.core.entity.element.Application
;
import
io.swagger.v3.oas.annotations.media.Schema
;
class
ActionListControllableWithApplication
extends
BaseAction
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
ActionListControllableWithApplication
.
class
);
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
String
applicationFlag
)
throws
Exception
{
LOGGER
.
debug
(
"execute:{}, applicationFlag:{}."
,
effectivePerson:
:
getDistinguishedName
,
()
->
applicationFlag
);
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
Business
business
=
new
Business
(
emc
);
Wo
wo
=
new
Wo
();
Application
application
=
business
.
application
().
pick
(
applicationFlag
);
if
(
null
==
application
)
{
throw
new
ExceptionEntityNotExist
(
applicationFlag
,
Application
.
class
);
}
wo
.
setValueList
(
business
.
process
().
listControllableProcess
(
effectivePerson
,
application
));
result
.
setData
(
wo
);
return
result
;
}
}
@Schema
(
name
=
"com.x.processplatform.assemble.surface.jaxrs.process.ActionListControllableWithApplication$Wo"
)
public
static
class
Wo
extends
WrapStringList
{
}
}
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/process/ProcessAction.java
浏览文件 @
49668e47
...
...
@@ -235,4 +235,26 @@ public class ProcessAction extends StandardJaxrsAction {
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
@Operation
(
summary
=
"根据指定应用标识获取可管理的流程."
,
operationId
=
OPERATIONID_PREFIX
+
"listControllableWithApplication"
,
responses
=
{
@ApiResponse
(
content
=
{
@Content
(
schema
=
@Schema
(
implementation
=
ActionListControllableWithApplication
.
Wo
.
class
))
})
})
@JaxrsMethodDescribe
(
value
=
"根据指定应用标识获取可管理的流程."
,
action
=
ActionListControllableWithApplication
.
class
)
@GET
@Path
(
"list/controllable/application/{applicationFlag}"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
listControllableWithApplication
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
@JaxrsParameterDescribe
(
"应用标识"
)
@PathParam
(
"applicationFlag"
)
String
applicationFlag
)
{
ActionResult
<
ActionListControllableWithApplication
.
Wo
>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
try
{
result
=
new
ActionListControllableWithApplication
().
execute
(
effectivePerson
,
applicationFlag
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
result
.
error
(
e
);
}
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
}
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/ActionManageListNext.java
浏览文件 @
49668e47
...
...
@@ -47,7 +47,7 @@ class ActionManageListNext extends BaseAction {
result
=
this
.
standardListNext
(
Wo
.
copier
,
id
,
count
,
JpaObject
.
sequence_FIELDNAME
,
equalsTerms
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
true
,
DESC
);
}
else
{
List
<
String
>
ids
=
business
.
process
().
listControlableProcess
(
effectivePerson
,
application
);
List
<
String
>
ids
=
business
.
process
().
listControl
l
ableProcess
(
effectivePerson
,
application
);
if
(
ListTools
.
isNotEmpty
(
ids
))
{
InTerms
inTerms
=
new
InTerms
();
inTerms
.
put
(
"process"
,
ids
);
...
...
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/ActionManageListPrev.java
浏览文件 @
49668e47
...
...
@@ -45,7 +45,7 @@ class ActionManageListPrev extends BaseAction {
result
=
this
.
standardListPrev
(
Wo
.
copier
,
id
,
count
,
JpaObject
.
sequence_FIELDNAME
,
equalsTerms
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
true
,
DESC
);
}
else
{
List
<
String
>
ids
=
business
.
process
().
listControlableProcess
(
effectivePerson
,
application
);
List
<
String
>
ids
=
business
.
process
().
listControl
l
ableProcess
(
effectivePerson
,
application
);
if
(
ListTools
.
isNotEmpty
(
ids
))
{
InTerms
inTerms
=
new
InTerms
();
inTerms
.
put
(
"process"
,
ids
);
...
...
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/workcompleted/ActionManageListNext.java
浏览文件 @
49668e47
...
...
@@ -42,7 +42,7 @@ class ActionManageListNext extends BaseAction {
result
=
this
.
standardListNext
(
Wo
.
copier
,
id
,
count
,
JpaObject
.
sequence_FIELDNAME
,
equalsTerms
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
true
,
DESC
);
}
else
{
List
<
String
>
ids
=
business
.
process
().
listControlableProcess
(
effectivePerson
,
application
);
List
<
String
>
ids
=
business
.
process
().
listControl
l
ableProcess
(
effectivePerson
,
application
);
if
(
ListTools
.
isNotEmpty
(
ids
))
{
InTerms
inTerms
=
new
InTerms
();
inTerms
.
put
(
"process"
,
ids
);
...
...
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/workcompleted/ActionManageListPrev.java
浏览文件 @
49668e47
...
...
@@ -42,7 +42,7 @@ class ActionManageListPrev extends BaseAction {
result
=
this
.
standardListPrev
(
Wo
.
copier
,
id
,
count
,
JpaObject
.
sequence_FIELDNAME
,
equalsTerms
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
true
,
DESC
);
}
else
{
List
<
String
>
ids
=
business
.
process
().
listControlableProcess
(
effectivePerson
,
application
);
List
<
String
>
ids
=
business
.
process
().
listControl
l
ableProcess
(
effectivePerson
,
application
);
if
(
ListTools
.
isNotEmpty
(
ids
))
{
InTerms
inTerms
=
new
InTerms
();
inTerms
.
put
(
"process"
,
ids
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录