Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_42566577
o2oa
提交
448413dc
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,发现更多精彩内容 >>
提交
448413dc
编写于
8月 12, 2022
作者:
O
o2null
浏览文件
操作
浏览文件
下载
差异文件
Merge branch '新版应用管理运维功能接口' into 'develop'
新版应用管理运维功能接口 See merge request o2oa/o2oa!863
上级
ad7db331
51b7b917
变更
22
隐藏空白更改
内联
并排
Showing
22 changed file
with
1494 addition
and
47 deletion
+1494
-47
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/factory/CategoryInfoFactory.java
...m/x/cms/assemble/control/factory/CategoryInfoFactory.java
+3
-3
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/appinfo/ActionListPublishWithProcess.java
...e/control/jaxrs/appinfo/ActionListPublishWithProcess.java
+2
-2
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/appinfo/BaseAction.java
.../com/x/cms/assemble/control/jaxrs/appinfo/BaseAction.java
+1
-1
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
+21
-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/ActionListWithPersonAndTerminal.java
...ce/jaxrs/application/ActionListWithPersonAndTerminal.java
+199
-0
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/application/ApplicationAction.java
...assemble/surface/jaxrs/application/ApplicationAction.java
+47
-5
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/snap/ActionManageListWithApplicationPaging.java
...ace/jaxrs/snap/ActionManageListWithApplicationPaging.java
+235
-0
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/snap/SnapAction.java
...ocessplatform/assemble/surface/jaxrs/snap/SnapAction.java
+21
-0
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/work/ActionManageListWithApplicationPaging.java
...ace/jaxrs/work/ActionManageListWithApplicationPaging.java
+429
-0
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/WorkAction.java
...ocessplatform/assemble/surface/jaxrs/work/WorkAction.java
+21
-0
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_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/workcompleted/ActionManageListWithApplicationPaging.java
.../workcompleted/ActionManageListWithApplicationPaging.java
+368
-0
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/workcompleted/WorkCompletedAction.java
...mble/surface/jaxrs/workcompleted/WorkCompletedAction.java
+21
-0
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/content/Snap.java
.../java/com/x/processplatform/core/entity/content/Snap.java
+2
-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
+2
-17
未找到文件。
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/factory/CategoryInfoFactory.java
浏览文件 @
448413dc
...
...
@@ -241,7 +241,7 @@ public class CategoryInfoFactory extends ElementFactory {
Predicate
p
=
cb
.
conjunction
();
if
(
ListTools
.
isNotEmpty
(
inAppInfoIds
))
{
p
=
root
.
get
(
CategoryInfo_
.
appId
).
in
(
p
);
p
=
root
.
get
(
CategoryInfo_
.
appId
).
in
(
inAppInfoIds
);
}
if
(
BooleanUtils
.
isTrue
(
hasProcess
)){
p
=
cb
.
and
(
p
,
cb
.
isNotNull
(
root
.
get
(
CategoryInfo_
.
workflowFlag
)));
...
...
@@ -262,8 +262,8 @@ public class CategoryInfoFactory extends ElementFactory {
}
p
=
cb
.
and
(
p
,
p_permission
);
cq
.
select
(
root
.
get
(
CategoryInfo_
.
id
));
return
em
.
createQuery
(
cq
.
where
(
p
)
).
getResultList
().
stream
().
distinct
().
collect
(
Collectors
.
toList
());
cq
.
select
(
root
.
get
(
CategoryInfo_
.
id
))
.
where
(
p
)
;
return
em
.
createQuery
(
cq
).
getResultList
().
stream
().
distinct
().
collect
(
Collectors
.
toList
());
}
/**
...
...
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/appinfo/ActionListPublishWithProcess.java
浏览文件 @
448413dc
...
...
@@ -26,7 +26,7 @@ import java.util.stream.Collectors;
*/
public
class
ActionListPublishWithProcess
extends
BaseAction
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
ActionListPublishWithProcess
.
class
);
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
ActionListPublishWithProcess
.
class
);
protected
ActionResult
<
List
<
Wo
>>
execute
(
EffectivePerson
effectivePerson
)
throws
Exception
{
ActionResult
<
List
<
Wo
>>
result
=
new
ActionResult
<>();
...
...
@@ -64,7 +64,7 @@ public class ActionListPublishWithProcess extends BaseAction {
try
{
wo
.
setConfig
(
appInfoServiceAdv
.
getConfigJson
(
wo
.
getId
()
)
);
}
catch
(
Exception
e
)
{
logger
.
debug
(
e
.
getMessage
());
LOGGER
.
debug
(
e
.
getMessage
());
}
wo
.
setWrapOutCategoryList
(
map
.
get
(
wo
.
getId
()));
});
...
...
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/appinfo/BaseAction.java
浏览文件 @
448413dc
...
...
@@ -34,7 +34,7 @@ import com.x.cms.core.entity.element.ViewFieldConfig;
public
class
BaseAction
extends
StandardJaxrsAction
{
protected
Cache
.
CacheCategory
cacheCategory
=
new
Cache
.
CacheCategory
(
AppInfo
.
class
,
AppDict
.
class
,
AppDictItem
.
class
,
View
.
class
,
protected
Cache
.
CacheCategory
cacheCategory
=
new
Cache
.
CacheCategory
(
AppInfo
.
class
,
CategoryInfo
.
class
,
AppDict
.
class
,
AppDictItem
.
class
,
View
.
class
,
ViewCategory
.
class
,
ViewFieldConfig
.
class
);
protected
AppInfoServiceAdv
appInfoServiceAdv
=
new
AppInfoServiceAdv
();
...
...
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/application/ActionCreate.java
浏览文件 @
448413dc
...
...
@@ -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
);
...
...
@@ -60,4 +62,4 @@ class ActionCreate extends BaseAction {
}
}
\ No newline at end of file
}
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/factory/element/ProcessFactory.java
浏览文件 @
448413dc
...
...
@@ -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,30 @@ 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
=
isManager
||
effectivePerson
.
isPerson
(
o
.
getControllerList
());
if
(
flag
)
{
list
.
add
(
str
);
}
}
return
list
;
}
public
List
<
String
>
listControllableAndEnabledProcess
(
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
);
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
浏览文件 @
448413dc
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/ActionListWithPersonAndTerminal.java
0 → 100644
浏览文件 @
448413dc
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.entity.JpaObject
;
import
com.x.base.core.project.annotation.FieldDescribe
;
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.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.processplatform.assemble.surface.Business
;
import
com.x.processplatform.core.entity.element.Application
;
import
com.x.processplatform.core.entity.element.Application_
;
import
com.x.processplatform.core.entity.element.Process
;
import
com.x.processplatform.core.entity.element.Process_
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
org.apache.commons.collections4.ListUtils
;
import
org.eclipse.jetty.util.StringUtil
;
import
javax.persistence.EntityManager
;
import
javax.persistence.criteria.CriteriaBuilder
;
import
javax.persistence.criteria.CriteriaQuery
;
import
javax.persistence.criteria.Predicate
;
import
javax.persistence.criteria.Root
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Optional
;
import
java.util.stream.Collectors
;
class
ActionListWithPersonAndTerminal
extends
BaseAction
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
ActionListWithPersonAndTerminal
.
class
);
@SuppressWarnings
(
"unchecked"
)
ActionResult
<
List
<
Wo
>>
execute
(
EffectivePerson
effectivePerson
,
String
terminal
)
throws
Exception
{
LOGGER
.
debug
(
"execute:{}."
,
effectivePerson:
:
getDistinguishedName
);
ActionResult
<
List
<
Wo
>>
result
=
new
ActionResult
<>();
List
<
Wo
>
wos
=
new
ArrayList
<>();
Cache
.
CacheKey
cacheKey
=
new
Cache
.
CacheKey
(
this
.
getClass
(),
effectivePerson
.
getDistinguishedName
());
Optional
<?>
optional
=
CacheManager
.
get
(
cacheCategory
,
cacheKey
);
if
(
optional
.
isPresent
())
{
wos
=
(
List
<
Wo
>)
optional
.
get
();
}
else
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
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
,
terminal
));
wos
.
add
(
wo
);
}
}
wos
=
business
.
application
().
sort
(
wos
);
CacheManager
.
put
(
cacheCategory
,
cacheKey
,
wos
);
}
}
result
.
setData
(
wos
);
return
result
;
}
@Schema
(
name
=
"com.x.processplatform.assemble.surface.jaxrs.application.ActionListWithPersonTerminal$Wo"
)
public
static
class
Wo
extends
Application
{
private
static
final
long
serialVersionUID
=
-
4862564047240738097L
;
static
WrapCopier
<
Application
,
Wo
>
copier
=
WrapCopierFactory
.
wo
(
Application
.
class
,
Wo
.
class
,
null
,
JpaObject
.
FieldsInvisible
);
@FieldDescribe
(
"流程对象."
)
@Schema
(
description
=
"流程对象."
)
private
List
<
WoProcess
>
processList
;
@FieldDescribe
(
"是否可编辑."
)
@Schema
(
description
=
"是否可编辑."
)
private
Boolean
allowControl
;
public
Boolean
getAllowControl
()
{
return
allowControl
;
}
public
void
setAllowControl
(
Boolean
allowControl
)
{
this
.
allowControl
=
allowControl
;
}
public
List
<
WoProcess
>
getProcessList
()
{
return
processList
;
}
public
void
setProcessList
(
List
<
WoProcess
>
processList
)
{
this
.
processList
=
processList
;
}
}
public
static
class
WoProcess
extends
Process
{
private
static
final
long
serialVersionUID
=
1521228691441978462L
;
static
WrapCopier
<
Process
,
WoProcess
>
copier
=
WrapCopierFactory
.
wo
(
Process
.
class
,
WoProcess
.
class
,
null
,
JpaObject
.
FieldsInvisible
);
}
/**
* 从可见的application中获取一份ids<br/>
* 从可启动的process中获取一份ids <br/>
* 两份ids的交集,这样避免列示只有application没有可以启动process的应用
*/
private
List
<
String
>
list
(
Business
business
,
EffectivePerson
effectivePerson
,
List
<
String
>
roles
,
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
,
groups
);
return
ListUtils
.
intersection
(
ids
,
fromProcessIds
);
}
private
List
<
String
>
listFromApplication
(
Business
business
,
EffectivePerson
effectivePerson
,
List
<
String
>
roles
,
List
<
String
>
identities
,
List
<
String
>
units
)
throws
Exception
{
EntityManager
em
=
business
.
entityManagerContainer
().
get
(
Application
.
class
);
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
Root
<
Application
>
root
=
cq
.
from
(
Application
.
class
);
if
(!
business
.
canManageApplication
(
effectivePerson
,
null
))
{
Predicate
p
=
cb
.
and
(
cb
.
isEmpty
(
root
.
get
(
Application_
.
availableIdentityList
)),
cb
.
isEmpty
(
root
.
get
(
Application_
.
availableUnitList
)));
p
=
cb
.
or
(
p
,
cb
.
isMember
(
effectivePerson
.
getDistinguishedName
(),
root
.
get
(
Application_
.
controllerList
)));
p
=
cb
.
or
(
p
,
cb
.
equal
(
root
.
get
(
Application_
.
creatorPerson
),
effectivePerson
.
getDistinguishedName
()));
if
(
ListTools
.
isNotEmpty
(
identities
))
{
p
=
cb
.
or
(
p
,
root
.
get
(
Application_
.
availableIdentityList
).
in
(
identities
));
}
if
(
ListTools
.
isNotEmpty
(
units
))
{
p
=
cb
.
or
(
p
,
root
.
get
(
Application_
.
availableUnitList
).
in
(
units
));
}
cq
.
where
(
p
);
}
return
em
.
createQuery
(
cq
.
select
(
root
.
get
(
Application_
.
id
))).
getResultList
().
stream
().
distinct
()
.
collect
(
Collectors
.
toList
());
}
/**
*
* 从Process中获取可以启动的Process的application.
*/
private
List
<
String
>
listFromProcess
(
Business
business
,
EffectivePerson
effectivePerson
,
List
<
String
>
roles
,
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
);
Root
<
Process
>
root
=
cq
.
from
(
Process
.
class
);
Predicate
p
=
cb
.
conjunction
();
if
(!
business
.
canManageApplication
(
effectivePerson
,
null
))
{
p
=
cb
.
and
(
cb
.
isEmpty
(
root
.
get
(
Process_
.
startableIdentityList
)),
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
))
{
p
=
cb
.
or
(
p
,
root
.
get
(
Process_
.
startableIdentityList
).
in
(
identities
));
}
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
,
List
<
String
>
groups
,
Application
application
,
String
terminal
)
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
));
boolean
flag
=
StringUtil
.
isBlank
(
o
.
getStartableTerminal
())
||
o
.
getStartableTerminal
().
equals
(
terminal
)
||
o
.
getStartableTerminal
().
equals
(
Process
.
STARTABLETERMINAL_ALL
);
if
(
flag
)
{
wos
.
add
(
o
);
}
}
wos
=
business
.
process
().
sort
(
wos
);
return
wos
;
}
}
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/application/ApplicationAction.java
浏览文件 @
448413dc
...
...
@@ -100,10 +100,10 @@ public class ApplicationAction extends StandardJaxrsAction {
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
@Operation
(
summary
=
"根据当前用户所有可见的Application,并绑定其启动的P
or
cess."
,
operationId
=
OPERATIONID_PREFIX
@Operation
(
summary
=
"根据当前用户所有可见的Application,并绑定其启动的P
ro
cess."
,
operationId
=
OPERATIONID_PREFIX
+
"listWithPersonComplex"
,
responses
=
{
@ApiResponse
(
content
=
{
@Content
(
array
=
@ArraySchema
(
schema
=
@Schema
(
implementation
=
ActionListWithPersonComplex
.
Wo
.
class
)))
})
})
@JaxrsMethodDescribe
(
value
=
"根据当前用户所有可见的Application,并绑定其启动的P
or
cess."
,
action
=
ActionListWithPersonComplex
.
class
)
@JaxrsMethodDescribe
(
value
=
"根据当前用户所有可见的Application,并绑定其启动的P
ro
cess."
,
action
=
ActionListWithPersonComplex
.
class
)
@GET
@Path
(
"list/complex"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
...
...
@@ -121,10 +121,31 @@ public class ApplicationAction extends StandardJaxrsAction {
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
@Operation
(
summary
=
"根据传入用户,获取可见的Application,并绑定其启动的Porcess."
,
operationId
=
OPERATIONID_PREFIX
@Operation
(
summary
=
"根据当前用户所有可见的Application,并绑定其可启动终端的Process."
,
operationId
=
OPERATIONID_PREFIX
+
"listWithPersonAndTerminal"
,
responses
=
{
@ApiResponse
(
content
=
{
@Content
(
array
=
@ArraySchema
(
schema
=
@Schema
(
implementation
=
ActionListWithPersonAndTerminal
.
Wo
.
class
)))
})
})
@JaxrsMethodDescribe
(
value
=
"根据当前用户所有可见的Application,并绑定其可启动终端的Process."
,
action
=
ActionListWithPersonAndTerminal
.
class
)
@GET
@Path
(
"list/terminal/{terminal}"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
listWithPersonAndTerminal
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
@JaxrsParameterDescribe
(
"流程启动终端:client(pc端可启动)、mobile(手机端可启动)"
)
@PathParam
(
"terminal"
)
String
terminal
)
{
ActionResult
<
List
<
ActionListWithPersonAndTerminal
.
Wo
>>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
try
{
result
=
new
ActionListWithPersonAndTerminal
().
execute
(
effectivePerson
,
terminal
);
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
e
,
effectivePerson
,
request
,
null
);
result
.
error
(
e
);
}
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
@Operation
(
summary
=
"根据传入用户,获取可见的Application,并绑定其启动的Process."
,
operationId
=
OPERATIONID_PREFIX
+
"manageListWithPersonComplex"
,
responses
=
{
@ApiResponse
(
content
=
{
@Content
(
array
=
@ArraySchema
(
schema
=
@Schema
(
implementation
=
ActionManageListWithPersonComplex
.
Wo
.
class
)))
})
})
@JaxrsMethodDescribe
(
value
=
"根据传入用户,获取可见的Application,并绑定其启动的P
or
cess."
,
action
=
ActionManageListWithPersonComplex
.
class
)
@JaxrsMethodDescribe
(
value
=
"根据传入用户,获取可见的Application,并绑定其启动的P
ro
cess."
,
action
=
ActionManageListWithPersonComplex
.
class
)
@GET
@Path
(
"list/complex/manage/{person}"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
...
...
@@ -162,4 +183,25 @@ public class ApplicationAction extends StandardJaxrsAction {
}
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
}
\ No newline at end of file
@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
浏览文件 @
448413dc
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
浏览文件 @
448413dc
...
...
@@ -235,4 +235,26 @@ public class ProcessAction extends StandardJaxrsAction {
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
}
\ No newline at end of file
@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/snap/ActionManageListWithApplicationPaging.java
0 → 100644
浏览文件 @
448413dc
package
com.x.processplatform.assemble.surface.jaxrs.snap
;
import
com.google.gson.JsonElement
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.entity.JpaObject
;
import
com.x.base.core.project.annotation.FieldDescribe
;
import
com.x.base.core.project.bean.WrapCopier
;
import
com.x.base.core.project.bean.WrapCopierFactory
;
import
com.x.base.core.project.exception.ExceptionEntityNotExist
;
import
com.x.base.core.project.gson.GsonPropertyObject
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.tools.DateTools
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.base.core.project.tools.StringTools
;
import
com.x.processplatform.assemble.surface.Business
;
import
com.x.processplatform.core.entity.content.Snap
;
import
com.x.processplatform.core.entity.content.Snap_
;
import
com.x.processplatform.core.entity.element.Application
;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
javax.persistence.EntityManager
;
import
javax.persistence.criteria.CriteriaBuilder
;
import
javax.persistence.criteria.CriteriaQuery
;
import
javax.persistence.criteria.Predicate
;
import
javax.persistence.criteria.Root
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.List
;
class
ActionManageListWithApplicationPaging
extends
BaseAction
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
ActionManageListWithApplicationPaging
.
class
);
ActionResult
<
List
<
Wo
>>
execute
(
EffectivePerson
effectivePerson
,
Integer
page
,
Integer
size
,
String
applicationFlag
,
JsonElement
jsonElement
)
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Business
business
=
new
Business
(
emc
);
ActionResult
<
List
<
Wo
>>
result
=
new
ActionResult
<>();
Application
application
=
business
.
application
().
pick
(
applicationFlag
);
if
(
null
==
application
)
{
throw
new
ExceptionEntityNotExist
(
applicationFlag
,
Application
.
class
);
}
Wi
wi
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
Predicate
p
=
this
.
bindFilterPredicate
(
effectivePerson
,
business
,
application
,
wi
);
if
(
p
!=
null
){
List
<
Wo
>
wos
=
emc
.
fetchDescPaging
(
Snap
.
class
,
Wo
.
copier
,
p
,
page
,
size
,
Snap
.
startTime_FIELDNAME
);
result
.
setData
(
wos
);
result
.
setCount
(
emc
.
count
(
Snap
.
class
,
p
));
}
else
{
result
.
setData
(
new
ArrayList
<>());
result
.
setCount
(
0L
);
}
return
result
;
}
}
private
Predicate
bindFilterPredicate
(
EffectivePerson
effectivePerson
,
Business
business
,
Application
application
,
Wi
wi
)
throws
Exception
{
Predicate
p
=
null
;
if
(
business
.
canManageApplication
(
effectivePerson
,
application
))
{
p
=
this
.
toFilterPredicate
(
business
,
application
.
getId
(),
wi
);
}
else
{
List
<
String
>
processList
=
business
.
process
().
listControllableProcess
(
effectivePerson
,
application
);
if
(
ListTools
.
isNotEmpty
(
processList
)){
if
(
ListTools
.
isEmpty
(
wi
.
getProcessList
())){
wi
.
setProcessList
(
processList
);
}
else
{
wi
.
getProcessList
().
retainAll
(
processList
);
if
(
ListTools
.
isEmpty
(
wi
.
getProcessList
())){
return
null
;
}
}
p
=
this
.
toFilterPredicate
(
business
,
application
.
getId
(),
wi
);
}
}
return
p
;
}
private
Predicate
toFilterPredicate
(
Business
business
,
String
appId
,
Wi
wi
)
throws
Exception
{
EntityManager
em
=
business
.
entityManagerContainer
().
get
(
Snap
.
class
);
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
Snap
>
cq
=
cb
.
createQuery
(
Snap
.
class
);
Root
<
Snap
>
root
=
cq
.
from
(
Snap
.
class
);
Predicate
p
=
cb
.
equal
(
root
.
get
(
Snap_
.
application
),
appId
);
if
(
ListTools
.
isNotEmpty
(
wi
.
getProcessList
()))
{
if
(
BooleanUtils
.
isNotTrue
(
wi
.
getRelateEditionProcess
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Snap_
.
process
).
in
(
wi
.
getProcessList
()));
}
else
{
p
=
cb
.
and
(
p
,
root
.
get
(
Snap_
.
process
).
in
(
business
.
process
().
listEditionProcess
(
wi
.
getProcessList
())));
}
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getWorkList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Snap_
.
id
).
in
(
wi
.
getWorkList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getJobList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Snap_
.
job
).
in
(
wi
.
getJobList
()));
}
if
(
DateTools
.
isDateTimeOrDate
(
wi
.
getStartTime
())){
p
=
cb
.
and
(
p
,
cb
.
greaterThan
(
root
.
get
(
Snap_
.
startTime
),
DateTools
.
parse
(
wi
.
getStartTime
())));
}
if
(
DateTools
.
isDateTimeOrDate
(
wi
.
getEndTime
())){
p
=
cb
.
and
(
p
,
cb
.
lessThan
(
root
.
get
(
Snap_
.
startTime
),
DateTools
.
parse
(
wi
.
getEndTime
())));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getCredentialList
()))
{
List
<
String
>
person_ids
=
business
.
organization
().
person
().
list
(
wi
.
getCredentialList
());
person_ids
=
ListTools
.
isEmpty
(
person_ids
)
?
wi
.
getCredentialList
()
:
person_ids
;
p
=
cb
.
and
(
p
,
root
.
get
(
Snap_
.
creatorPerson
).
in
(
person_ids
));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getCreatorUnitList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Snap_
.
creatorUnit
).
in
(
wi
.
getCreatorUnitList
()));
}
if
(
StringUtils
.
isNoneBlank
(
wi
.
getKey
()))
{
String
key
=
StringTools
.
escapeSqlLikeKey
(
wi
.
getKey
());
p
=
cb
.
and
(
p
,
cb
.
like
(
root
.
get
(
Snap_
.
title
),
"%"
+
key
+
"%"
,
StringTools
.
SQL_ESCAPE_CHAR
));
}
return
p
;
}
public
class
Wi
extends
GsonPropertyObject
{
private
static
final
long
serialVersionUID
=
4580079997611330119L
;
@FieldDescribe
(
"流程"
)
private
List
<
String
>
processList
;
@FieldDescribe
(
"是否查找同版本流程数据:true|false(默认不查找)"
)
private
Boolean
relateEditionProcess
=
false
;
@FieldDescribe
(
"开始时间yyyy-MM-dd HH:mm:ss"
)
private
String
startTime
;
@FieldDescribe
(
"结束时间yyyy-MM-dd HH:mm:ss"
)
private
String
endTime
;
@FieldDescribe
(
"创建组织"
)
private
List
<
String
>
creatorUnitList
;
@FieldDescribe
(
"创建用户"
)
private
List
<
String
>
credentialList
;
@FieldDescribe
(
"work工作"
)
private
List
<
String
>
workList
;
@FieldDescribe
(
"job工作实例"
)
private
List
<
String
>
jobList
;
@FieldDescribe
(
"关键字"
)
private
String
key
;
public
List
<
String
>
getProcessList
()
{
return
processList
==
null
?
Collections
.
emptyList
()
:
processList
;
}
public
void
setProcessList
(
List
<
String
>
processList
)
{
this
.
processList
=
processList
;
}
public
Boolean
getRelateEditionProcess
()
{
return
relateEditionProcess
;
}
public
void
setRelateEditionProcess
(
Boolean
relateEditionProcess
)
{
this
.
relateEditionProcess
=
relateEditionProcess
;
}
public
String
getStartTime
()
{
return
startTime
;
}
public
void
setStartTime
(
String
startTime
)
{
this
.
startTime
=
startTime
;
}
public
String
getEndTime
()
{
return
endTime
;
}
public
void
setEndTime
(
String
endTime
)
{
this
.
endTime
=
endTime
;
}
public
List
<
String
>
getCreatorUnitList
()
{
return
creatorUnitList
;
}
public
void
setCreatorUnitList
(
List
<
String
>
creatorUnitList
)
{
this
.
creatorUnitList
=
creatorUnitList
;
}
public
List
<
String
>
getCredentialList
()
{
return
credentialList
;
}
public
void
setCredentialList
(
List
<
String
>
credentialList
)
{
this
.
credentialList
=
credentialList
;
}
public
List
<
String
>
getWorkList
()
{
return
workList
;
}
public
void
setWorkList
(
List
<
String
>
workList
)
{
this
.
workList
=
workList
;
}
public
List
<
String
>
getJobList
()
{
return
jobList
;
}
public
void
setJobList
(
List
<
String
>
jobList
)
{
this
.
jobList
=
jobList
;
}
public
String
getKey
()
{
return
key
;
}
public
void
setKey
(
String
key
)
{
this
.
key
=
key
;
}
}
public
static
class
Wo
extends
RankWo
{
private
static
final
long
serialVersionUID
=
5296834486898115680L
;
static
WrapCopier
<
Snap
,
Wo
>
copier
=
WrapCopierFactory
.
wo
(
Snap
.
class
,
Wo
.
class
,
JpaObject
.
singularAttributeField
(
Snap
.
class
,
true
,
true
),
null
);
}
}
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/snap/SnapAction.java
浏览文件 @
448413dc
...
...
@@ -490,4 +490,25 @@ public class SnapAction extends StandardJaxrsAction {
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
,
jsonElement
));
}
@JaxrsMethodDescribe
(
value
=
"分页列示指定应用下根据过滤条件的snap."
,
action
=
ActionManageListWithApplicationPaging
.
class
)
@POST
@Path
(
"list/paging/{page}/size/{size}/application/{applicationFlag}/filter/manage"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
manageListWithApplicationPaging
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
@JaxrsParameterDescribe
(
"分页"
)
@PathParam
(
"page"
)
Integer
page
,
@JaxrsParameterDescribe
(
"每页数量"
)
@PathParam
(
"size"
)
Integer
size
,
@JaxrsParameterDescribe
(
"应用标识"
)
@PathParam
(
"applicationFlag"
)
String
applicationFlag
,
JsonElement
jsonElement
)
{
ActionResult
<
List
<
ActionManageListWithApplicationPaging
.
Wo
>>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
try
{
result
=
new
ActionManageListWithApplicationPaging
().
execute
(
effectivePerson
,
page
,
size
,
applicationFlag
,
jsonElement
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
,
effectivePerson
,
request
,
jsonElement
);
result
.
error
(
e
);
}
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
,
jsonElement
));
}
}
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/ActionManageListNext.java
浏览文件 @
448413dc
...
...
@@ -25,7 +25,7 @@ import com.x.processplatform.core.entity.content.Work;
import
com.x.processplatform.core.entity.element.Application
;
class
ActionManageListNext
extends
BaseAction
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
ActionManageListNext
.
class
);
ActionResult
<
List
<
Wo
>>
execute
(
EffectivePerson
effectivePerson
,
String
id
,
Integer
count
,
String
applicationFlag
)
...
...
@@ -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
浏览文件 @
448413dc
...
...
@@ -23,7 +23,7 @@ import com.x.processplatform.core.entity.content.Work;
import
com.x.processplatform.core.entity.element.Application
;
class
ActionManageListPrev
extends
BaseAction
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
ActionManageListPrev
.
class
);
ActionResult
<
List
<
Wo
>>
execute
(
EffectivePerson
effectivePerson
,
String
id
,
Integer
count
,
String
applicationFlag
)
...
...
@@ -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/work/ActionManageListWithApplicationPaging.java
0 → 100644
浏览文件 @
448413dc
package
com.x.processplatform.assemble.surface.jaxrs.work
;
import
com.google.gson.JsonElement
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.entity.JpaObject
;
import
com.x.base.core.project.annotation.FieldDescribe
;
import
com.x.base.core.project.bean.WrapCopier
;
import
com.x.base.core.project.bean.WrapCopierFactory
;
import
com.x.base.core.project.gson.GsonPropertyObject
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.tools.DateTools
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.base.core.project.tools.StringTools
;
import
com.x.processplatform.assemble.surface.Business
;
import
com.x.processplatform.core.entity.content.Work
;
import
com.x.processplatform.core.entity.content.WorkStatus
;
import
com.x.processplatform.core.entity.content.Work_
;
import
com.x.processplatform.core.entity.element.Application
;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
javax.persistence.EntityManager
;
import
javax.persistence.criteria.CriteriaBuilder
;
import
javax.persistence.criteria.CriteriaQuery
;
import
javax.persistence.criteria.Predicate
;
import
javax.persistence.criteria.Root
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.List
;
class
ActionManageListWithApplicationPaging
extends
BaseAction
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
ActionManageListWithApplicationPaging
.
class
);
ActionResult
<
List
<
Wo
>>
execute
(
EffectivePerson
effectivePerson
,
Integer
page
,
Integer
size
,
String
applicationFlag
,
JsonElement
jsonElement
)
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Business
business
=
new
Business
(
emc
);
ActionResult
<
List
<
Wo
>>
result
=
new
ActionResult
<>();
Application
application
=
business
.
application
().
pick
(
applicationFlag
);
if
(
null
==
application
)
{
throw
new
ExceptionApplicationNotExist
(
applicationFlag
);
}
Wi
wi
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
Predicate
p
=
this
.
bindFilterPredicate
(
effectivePerson
,
business
,
application
,
wi
);
if
(
p
!=
null
){
List
<
Wo
>
wos
=
emc
.
fetchDescPaging
(
Work
.
class
,
Wo
.
copier
,
p
,
page
,
size
,
Work
.
startTime_FIELDNAME
);
result
.
setData
(
wos
);
result
.
setCount
(
emc
.
count
(
Work
.
class
,
p
));
}
else
{
result
.
setData
(
new
ArrayList
<>());
result
.
setCount
(
0L
);
}
return
result
;
}
}
private
Predicate
bindFilterPredicate
(
EffectivePerson
effectivePerson
,
Business
business
,
Application
application
,
Wi
wi
)
throws
Exception
{
Predicate
p
=
null
;
if
(
business
.
canManageApplication
(
effectivePerson
,
application
))
{
p
=
this
.
toFilterPredicate
(
business
,
application
.
getId
(),
wi
);
}
else
{
List
<
String
>
processList
=
business
.
process
().
listControllableProcess
(
effectivePerson
,
application
);
if
(
ListTools
.
isNotEmpty
(
processList
)){
if
(
ListTools
.
isEmpty
(
wi
.
getProcessList
())){
wi
.
setProcessList
(
processList
);
}
else
{
wi
.
getProcessList
().
retainAll
(
processList
);
if
(
ListTools
.
isEmpty
(
wi
.
getProcessList
())){
return
null
;
}
}
p
=
this
.
toFilterPredicate
(
business
,
application
.
getId
(),
wi
);
}
}
return
p
;
}
private
Predicate
toFilterPredicate
(
Business
business
,
String
appId
,
Wi
wi
)
throws
Exception
{
EntityManager
em
=
business
.
entityManagerContainer
().
get
(
Work
.
class
);
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
Work
>
cq
=
cb
.
createQuery
(
Work
.
class
);
Root
<
Work
>
root
=
cq
.
from
(
Work
.
class
);
Predicate
p
=
cb
.
equal
(
root
.
get
(
Work_
.
application
),
appId
);
if
(
null
!=
wi
.
getWorkThroughManual
()){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Work_
.
workThroughManual
),
wi
.
getWorkThroughManual
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getWorkCreateType
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Work_
.
workCreateType
),
wi
.
getWorkCreateType
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue01
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Work_
.
stringValue01
),
wi
.
getStringValue01
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue02
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Work_
.
stringValue02
),
wi
.
getStringValue02
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue03
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Work_
.
stringValue03
),
wi
.
getStringValue03
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue04
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Work_
.
stringValue04
),
wi
.
getStringValue04
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue05
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Work_
.
stringValue05
),
wi
.
getStringValue05
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue06
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Work_
.
stringValue06
),
wi
.
getStringValue06
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue07
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Work_
.
stringValue07
),
wi
.
getStringValue07
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue08
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Work_
.
stringValue08
),
wi
.
getStringValue08
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue09
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Work_
.
stringValue09
),
wi
.
getStringValue09
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue10
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Work_
.
stringValue10
),
wi
.
getStringValue10
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getProcessList
()))
{
if
(
BooleanUtils
.
isNotTrue
(
wi
.
getRelateEditionProcess
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Work_
.
process
).
in
(
wi
.
getProcessList
()));
}
else
{
p
=
cb
.
and
(
p
,
root
.
get
(
Work_
.
process
).
in
(
business
.
process
().
listEditionProcess
(
wi
.
getProcessList
())));
}
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getWorkList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Work_
.
id
).
in
(
wi
.
getWorkList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getJobList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Work_
.
job
).
in
(
wi
.
getJobList
()));
}
if
(
DateTools
.
isDateTimeOrDate
(
wi
.
getStartTime
())){
p
=
cb
.
and
(
p
,
cb
.
greaterThan
(
root
.
get
(
Work_
.
startTime
),
DateTools
.
parse
(
wi
.
getStartTime
())));
}
if
(
DateTools
.
isDateTimeOrDate
(
wi
.
getEndTime
())){
p
=
cb
.
and
(
p
,
cb
.
lessThan
(
root
.
get
(
Work_
.
startTime
),
DateTools
.
parse
(
wi
.
getEndTime
())));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getCredentialList
()))
{
List
<
String
>
person_ids
=
business
.
organization
().
person
().
list
(
wi
.
getCredentialList
());
person_ids
=
ListTools
.
isEmpty
(
person_ids
)
?
wi
.
getCredentialList
()
:
person_ids
;
p
=
cb
.
and
(
p
,
root
.
get
(
Work_
.
creatorPerson
).
in
(
person_ids
));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getCreatorUnitList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Work_
.
creatorUnit
).
in
(
wi
.
getCreatorUnitList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getActivityNameList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
Work_
.
activityName
).
in
(
wi
.
getActivityNameList
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getWorkStatus
()))
{
if
(
wi
.
getWorkStatus
().
equalsIgnoreCase
(
WorkStatus
.
start
.
name
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Work_
.
workStatus
),
WorkStatus
.
start
));
}
else
if
(
wi
.
getWorkStatus
().
equalsIgnoreCase
(
WorkStatus
.
processing
.
name
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Work_
.
workStatus
),
WorkStatus
.
processing
));
}
else
if
(
wi
.
getWorkStatus
().
equalsIgnoreCase
(
WorkStatus
.
hanging
.
name
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Work_
.
workStatus
),
WorkStatus
.
hanging
));
}
}
if
(
StringUtils
.
isNoneBlank
(
wi
.
getKey
()))
{
String
key
=
StringTools
.
escapeSqlLikeKey
(
wi
.
getKey
());
p
=
cb
.
and
(
p
,
cb
.
like
(
root
.
get
(
Work_
.
title
),
"%"
+
key
+
"%"
,
StringTools
.
SQL_ESCAPE_CHAR
));
}
return
p
;
}
public
class
Wi
extends
GsonPropertyObject
{
private
static
final
long
serialVersionUID
=
295303391325992112L
;
@FieldDescribe
(
"流程"
)
private
List
<
String
>
processList
;
@FieldDescribe
(
"是否查找同版本流程数据:true|false(默认不查找)"
)
private
Boolean
relateEditionProcess
=
false
;
@FieldDescribe
(
"开始时间yyyy-MM-dd HH:mm:ss"
)
private
String
startTime
;
@FieldDescribe
(
"结束时间yyyy-MM-dd HH:mm:ss"
)
private
String
endTime
;
@FieldDescribe
(
"创建组织"
)
private
List
<
String
>
creatorUnitList
;
@FieldDescribe
(
"创建用户"
)
private
List
<
String
>
credentialList
;
@FieldDescribe
(
"活动名称"
)
private
List
<
String
>
activityNameList
;
@FieldDescribe
(
"work工作"
)
private
List
<
String
>
workList
;
@FieldDescribe
(
"job工作实例"
)
private
List
<
String
>
jobList
;
@FieldDescribe
(
"工作状态:start|processing|hanging"
)
private
String
workStatus
;
@FieldDescribe
(
"关键字"
)
private
String
key
;
@FieldDescribe
(
"是否已经经过人工节点,"
)
private
Boolean
workThroughManual
;
@FieldDescribe
(
"工作创建类型,"
)
private
String
workCreateType
;
@FieldDescribe
(
"业务数据String值01"
)
private
String
stringValue01
;
@FieldDescribe
(
"业务数据String值02"
)
private
String
stringValue02
;
@FieldDescribe
(
"业务数据String值03"
)
private
String
stringValue03
;
@FieldDescribe
(
"业务数据String值04"
)
private
String
stringValue04
;
@FieldDescribe
(
"业务数据String值05"
)
private
String
stringValue05
;
@FieldDescribe
(
"业务数据String值06"
)
private
String
stringValue06
;
@FieldDescribe
(
"业务数据String值07"
)
private
String
stringValue07
;
@FieldDescribe
(
"业务数据String值08"
)
private
String
stringValue08
;
@FieldDescribe
(
"业务数据String值09"
)
private
String
stringValue09
;
@FieldDescribe
(
"业务数据String值10"
)
private
String
stringValue10
;
public
List
<
String
>
getProcessList
()
{
return
processList
==
null
?
Collections
.
emptyList
()
:
processList
;
}
public
void
setProcessList
(
List
<
String
>
processList
)
{
this
.
processList
=
processList
;
}
public
Boolean
getRelateEditionProcess
()
{
return
relateEditionProcess
;
}
public
void
setRelateEditionProcess
(
Boolean
relateEditionProcess
)
{
this
.
relateEditionProcess
=
relateEditionProcess
;
}
public
String
getStartTime
()
{
return
startTime
;
}
public
void
setStartTime
(
String
startTime
)
{
this
.
startTime
=
startTime
;
}
public
String
getEndTime
()
{
return
endTime
;
}
public
void
setEndTime
(
String
endTime
)
{
this
.
endTime
=
endTime
;
}
public
List
<
String
>
getCreatorUnitList
()
{
return
creatorUnitList
;
}
public
void
setCreatorUnitList
(
List
<
String
>
creatorUnitList
)
{
this
.
creatorUnitList
=
creatorUnitList
;
}
public
List
<
String
>
getCredentialList
()
{
return
credentialList
;
}
public
void
setCredentialList
(
List
<
String
>
credentialList
)
{
this
.
credentialList
=
credentialList
;
}
public
List
<
String
>
getActivityNameList
()
{
return
activityNameList
;
}
public
void
setActivityNameList
(
List
<
String
>
activityNameList
)
{
this
.
activityNameList
=
activityNameList
;
}
public
List
<
String
>
getWorkList
()
{
return
workList
;
}
public
void
setWorkList
(
List
<
String
>
workList
)
{
this
.
workList
=
workList
;
}
public
List
<
String
>
getJobList
()
{
return
jobList
;
}
public
void
setJobList
(
List
<
String
>
jobList
)
{
this
.
jobList
=
jobList
;
}
public
String
getWorkStatus
()
{
return
workStatus
;
}
public
void
setWorkStatus
(
String
workStatus
)
{
this
.
workStatus
=
workStatus
;
}
public
String
getKey
()
{
return
key
;
}
public
void
setKey
(
String
key
)
{
this
.
key
=
key
;
}
public
Boolean
getWorkThroughManual
()
{
return
workThroughManual
;
}
public
void
setWorkThroughManual
(
Boolean
workThroughManual
)
{
this
.
workThroughManual
=
workThroughManual
;
}
public
String
getWorkCreateType
()
{
return
workCreateType
;
}
public
void
setWorkCreateType
(
String
workCreateType
)
{
this
.
workCreateType
=
workCreateType
;
}
public
String
getStringValue01
()
{
return
stringValue01
;
}
public
void
setStringValue01
(
String
stringValue01
)
{
this
.
stringValue01
=
stringValue01
;
}
public
String
getStringValue02
()
{
return
stringValue02
;
}
public
void
setStringValue02
(
String
stringValue02
)
{
this
.
stringValue02
=
stringValue02
;
}
public
String
getStringValue03
()
{
return
stringValue03
;
}
public
void
setStringValue03
(
String
stringValue03
)
{
this
.
stringValue03
=
stringValue03
;
}
public
String
getStringValue04
()
{
return
stringValue04
;
}
public
void
setStringValue04
(
String
stringValue04
)
{
this
.
stringValue04
=
stringValue04
;
}
public
String
getStringValue05
()
{
return
stringValue05
;
}
public
void
setStringValue05
(
String
stringValue05
)
{
this
.
stringValue05
=
stringValue05
;
}
public
String
getStringValue06
()
{
return
stringValue06
;
}
public
void
setStringValue06
(
String
stringValue06
)
{
this
.
stringValue06
=
stringValue06
;
}
public
String
getStringValue07
()
{
return
stringValue07
;
}
public
void
setStringValue07
(
String
stringValue07
)
{
this
.
stringValue07
=
stringValue07
;
}
public
String
getStringValue08
()
{
return
stringValue08
;
}
public
void
setStringValue08
(
String
stringValue08
)
{
this
.
stringValue08
=
stringValue08
;
}
public
String
getStringValue09
()
{
return
stringValue09
;
}
public
void
setStringValue09
(
String
stringValue09
)
{
this
.
stringValue09
=
stringValue09
;
}
public
String
getStringValue10
()
{
return
stringValue10
;
}
public
void
setStringValue10
(
String
stringValue10
)
{
this
.
stringValue10
=
stringValue10
;
}
}
public
static
class
Wo
extends
Work
{
private
static
final
long
serialVersionUID
=
-
5637247609290741273L
;
static
WrapCopier
<
Work
,
Wo
>
copier
=
WrapCopierFactory
.
wo
(
Work
.
class
,
Wo
.
class
,
JpaObject
.
singularAttributeField
(
Work
.
class
,
true
,
true
),
null
);
}
}
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/WorkAction.java
浏览文件 @
448413dc
...
...
@@ -1323,4 +1323,25 @@ public class WorkAction extends StandardJaxrsAction {
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
,
jsonElement
));
}
@JaxrsMethodDescribe
(
value
=
"分页列示指定应用下根据过滤条件的Work."
,
action
=
ActionManageListWithApplicationPaging
.
class
)
@POST
@Path
(
"list/paging/{page}/size/{size}/application/{applicationFlag}/filter/manage"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
manageListWithApplicationPaging
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
@JaxrsParameterDescribe
(
"分页"
)
@PathParam
(
"page"
)
Integer
page
,
@JaxrsParameterDescribe
(
"每页数量"
)
@PathParam
(
"size"
)
Integer
size
,
@JaxrsParameterDescribe
(
"应用标识"
)
@PathParam
(
"applicationFlag"
)
String
applicationFlag
,
JsonElement
jsonElement
)
{
ActionResult
<
List
<
ActionManageListWithApplicationPaging
.
Wo
>>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
try
{
result
=
new
ActionManageListWithApplicationPaging
().
execute
(
effectivePerson
,
page
,
size
,
applicationFlag
,
jsonElement
);
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
e
,
effectivePerson
,
request
,
jsonElement
);
result
.
error
(
e
);
}
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
,
jsonElement
));
}
}
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/workcompleted/ActionManageListNext.java
浏览文件 @
448413dc
...
...
@@ -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
浏览文件 @
448413dc
...
...
@@ -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
);
...
...
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/workcompleted/ActionManageListWithApplicationPaging.java
0 → 100644
浏览文件 @
448413dc
package
com.x.processplatform.assemble.surface.jaxrs.workcompleted
;
import
com.google.gson.JsonElement
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.entity.JpaObject
;
import
com.x.base.core.project.annotation.FieldDescribe
;
import
com.x.base.core.project.bean.WrapCopier
;
import
com.x.base.core.project.bean.WrapCopierFactory
;
import
com.x.base.core.project.exception.ExceptionEntityNotExist
;
import
com.x.base.core.project.gson.GsonPropertyObject
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.tools.DateTools
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.base.core.project.tools.StringTools
;
import
com.x.processplatform.assemble.surface.Business
;
import
com.x.processplatform.core.entity.content.WorkCompleted
;
import
com.x.processplatform.core.entity.content.WorkCompleted_
;
import
com.x.processplatform.core.entity.element.Application
;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
javax.persistence.EntityManager
;
import
javax.persistence.criteria.CriteriaBuilder
;
import
javax.persistence.criteria.CriteriaQuery
;
import
javax.persistence.criteria.Predicate
;
import
javax.persistence.criteria.Root
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.List
;
class
ActionManageListWithApplicationPaging
extends
BaseAction
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
ActionManageListWithApplicationPaging
.
class
);
ActionResult
<
List
<
Wo
>>
execute
(
EffectivePerson
effectivePerson
,
Integer
page
,
Integer
size
,
String
applicationFlag
,
JsonElement
jsonElement
)
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Business
business
=
new
Business
(
emc
);
ActionResult
<
List
<
Wo
>>
result
=
new
ActionResult
<>();
Application
application
=
business
.
application
().
pick
(
applicationFlag
);
if
(
null
==
application
)
{
throw
new
ExceptionEntityNotExist
(
applicationFlag
,
Application
.
class
);
}
Wi
wi
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
Predicate
p
=
this
.
bindFilterPredicate
(
effectivePerson
,
business
,
application
,
wi
);
if
(
p
!=
null
){
List
<
Wo
>
wos
=
emc
.
fetchDescPaging
(
WorkCompleted
.
class
,
Wo
.
copier
,
p
,
page
,
size
,
WorkCompleted
.
startTime_FIELDNAME
);
result
.
setData
(
wos
);
result
.
setCount
(
emc
.
count
(
WorkCompleted
.
class
,
p
));
}
else
{
result
.
setData
(
new
ArrayList
<>());
result
.
setCount
(
0L
);
}
return
result
;
}
}
private
Predicate
bindFilterPredicate
(
EffectivePerson
effectivePerson
,
Business
business
,
Application
application
,
Wi
wi
)
throws
Exception
{
Predicate
p
=
null
;
if
(
business
.
canManageApplication
(
effectivePerson
,
application
))
{
p
=
this
.
toFilterPredicate
(
business
,
application
.
getId
(),
wi
);
}
else
{
List
<
String
>
processList
=
business
.
process
().
listControllableProcess
(
effectivePerson
,
application
);
if
(
ListTools
.
isNotEmpty
(
processList
)){
if
(
ListTools
.
isEmpty
(
wi
.
getProcessList
())){
wi
.
setProcessList
(
processList
);
}
else
{
wi
.
getProcessList
().
retainAll
(
processList
);
if
(
ListTools
.
isEmpty
(
wi
.
getProcessList
())){
return
null
;
}
}
p
=
this
.
toFilterPredicate
(
business
,
application
.
getId
(),
wi
);
}
}
return
p
;
}
private
Predicate
toFilterPredicate
(
Business
business
,
String
appId
,
Wi
wi
)
throws
Exception
{
EntityManager
em
=
business
.
entityManagerContainer
().
get
(
WorkCompleted
.
class
);
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
WorkCompleted
>
cq
=
cb
.
createQuery
(
WorkCompleted
.
class
);
Root
<
WorkCompleted
>
root
=
cq
.
from
(
WorkCompleted
.
class
);
Predicate
p
=
cb
.
equal
(
root
.
get
(
WorkCompleted_
.
application
),
appId
);
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue01
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
WorkCompleted_
.
stringValue01
),
wi
.
getStringValue01
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue02
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
WorkCompleted_
.
stringValue02
),
wi
.
getStringValue02
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue03
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
WorkCompleted_
.
stringValue03
),
wi
.
getStringValue03
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue04
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
WorkCompleted_
.
stringValue04
),
wi
.
getStringValue04
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue05
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
WorkCompleted_
.
stringValue05
),
wi
.
getStringValue05
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue06
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
WorkCompleted_
.
stringValue06
),
wi
.
getStringValue06
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue07
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
WorkCompleted_
.
stringValue07
),
wi
.
getStringValue07
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue08
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
WorkCompleted_
.
stringValue08
),
wi
.
getStringValue08
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue09
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
WorkCompleted_
.
stringValue09
),
wi
.
getStringValue09
()));
}
if
(
StringUtils
.
isNotBlank
(
wi
.
getStringValue10
())){
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
WorkCompleted_
.
stringValue10
),
wi
.
getStringValue10
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getProcessList
()))
{
if
(
BooleanUtils
.
isNotTrue
(
wi
.
getRelateEditionProcess
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
WorkCompleted_
.
process
).
in
(
wi
.
getProcessList
()));
}
else
{
p
=
cb
.
and
(
p
,
root
.
get
(
WorkCompleted_
.
process
).
in
(
business
.
process
().
listEditionProcess
(
wi
.
getProcessList
())));
}
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getWorkList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
WorkCompleted_
.
id
).
in
(
wi
.
getWorkList
()));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getJobList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
WorkCompleted_
.
job
).
in
(
wi
.
getJobList
()));
}
if
(
DateTools
.
isDateTimeOrDate
(
wi
.
getStartTime
())){
p
=
cb
.
and
(
p
,
cb
.
greaterThan
(
root
.
get
(
WorkCompleted_
.
startTime
),
DateTools
.
parse
(
wi
.
getStartTime
())));
}
if
(
DateTools
.
isDateTimeOrDate
(
wi
.
getEndTime
())){
p
=
cb
.
and
(
p
,
cb
.
lessThan
(
root
.
get
(
WorkCompleted_
.
startTime
),
DateTools
.
parse
(
wi
.
getEndTime
())));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getCredentialList
()))
{
List
<
String
>
person_ids
=
business
.
organization
().
person
().
list
(
wi
.
getCredentialList
());
person_ids
=
ListTools
.
isEmpty
(
person_ids
)
?
wi
.
getCredentialList
()
:
person_ids
;
p
=
cb
.
and
(
p
,
root
.
get
(
WorkCompleted_
.
creatorPerson
).
in
(
person_ids
));
}
if
(
ListTools
.
isNotEmpty
(
wi
.
getCreatorUnitList
()))
{
p
=
cb
.
and
(
p
,
root
.
get
(
WorkCompleted_
.
creatorUnit
).
in
(
wi
.
getCreatorUnitList
()));
}
if
(
StringUtils
.
isNoneBlank
(
wi
.
getKey
()))
{
String
key
=
StringTools
.
escapeSqlLikeKey
(
wi
.
getKey
());
p
=
cb
.
and
(
p
,
cb
.
like
(
root
.
get
(
WorkCompleted_
.
title
),
"%"
+
key
+
"%"
,
StringTools
.
SQL_ESCAPE_CHAR
));
}
return
p
;
}
public
class
Wi
extends
GsonPropertyObject
{
private
static
final
long
serialVersionUID
=
-
405470028265367591L
;
@FieldDescribe
(
"流程"
)
private
List
<
String
>
processList
;
@FieldDescribe
(
"是否查找同版本流程数据:true|false(默认不查找)"
)
private
Boolean
relateEditionProcess
=
false
;
@FieldDescribe
(
"开始时间yyyy-MM-dd HH:mm:ss"
)
private
String
startTime
;
@FieldDescribe
(
"结束时间yyyy-MM-dd HH:mm:ss"
)
private
String
endTime
;
@FieldDescribe
(
"创建组织"
)
private
List
<
String
>
creatorUnitList
;
@FieldDescribe
(
"创建用户"
)
private
List
<
String
>
credentialList
;
@FieldDescribe
(
"work工作"
)
private
List
<
String
>
workList
;
@FieldDescribe
(
"job工作实例"
)
private
List
<
String
>
jobList
;
@FieldDescribe
(
"关键字"
)
private
String
key
;
@FieldDescribe
(
"业务数据String值01"
)
private
String
stringValue01
;
@FieldDescribe
(
"业务数据String值02"
)
private
String
stringValue02
;
@FieldDescribe
(
"业务数据String值03"
)
private
String
stringValue03
;
@FieldDescribe
(
"业务数据String值04"
)
private
String
stringValue04
;
@FieldDescribe
(
"业务数据String值05"
)
private
String
stringValue05
;
@FieldDescribe
(
"业务数据String值06"
)
private
String
stringValue06
;
@FieldDescribe
(
"业务数据String值07"
)
private
String
stringValue07
;
@FieldDescribe
(
"业务数据String值08"
)
private
String
stringValue08
;
@FieldDescribe
(
"业务数据String值09"
)
private
String
stringValue09
;
@FieldDescribe
(
"业务数据String值10"
)
private
String
stringValue10
;
public
List
<
String
>
getProcessList
()
{
return
processList
==
null
?
Collections
.
emptyList
()
:
processList
;
}
public
void
setProcessList
(
List
<
String
>
processList
)
{
this
.
processList
=
processList
;
}
public
Boolean
getRelateEditionProcess
()
{
return
relateEditionProcess
;
}
public
void
setRelateEditionProcess
(
Boolean
relateEditionProcess
)
{
this
.
relateEditionProcess
=
relateEditionProcess
;
}
public
String
getStartTime
()
{
return
startTime
;
}
public
void
setStartTime
(
String
startTime
)
{
this
.
startTime
=
startTime
;
}
public
String
getEndTime
()
{
return
endTime
;
}
public
void
setEndTime
(
String
endTime
)
{
this
.
endTime
=
endTime
;
}
public
List
<
String
>
getCreatorUnitList
()
{
return
creatorUnitList
;
}
public
void
setCreatorUnitList
(
List
<
String
>
creatorUnitList
)
{
this
.
creatorUnitList
=
creatorUnitList
;
}
public
List
<
String
>
getCredentialList
()
{
return
credentialList
;
}
public
void
setCredentialList
(
List
<
String
>
credentialList
)
{
this
.
credentialList
=
credentialList
;
}
public
List
<
String
>
getWorkList
()
{
return
workList
;
}
public
void
setWorkList
(
List
<
String
>
workList
)
{
this
.
workList
=
workList
;
}
public
List
<
String
>
getJobList
()
{
return
jobList
;
}
public
void
setJobList
(
List
<
String
>
jobList
)
{
this
.
jobList
=
jobList
;
}
public
String
getKey
()
{
return
key
;
}
public
void
setKey
(
String
key
)
{
this
.
key
=
key
;
}
public
String
getStringValue01
()
{
return
stringValue01
;
}
public
void
setStringValue01
(
String
stringValue01
)
{
this
.
stringValue01
=
stringValue01
;
}
public
String
getStringValue02
()
{
return
stringValue02
;
}
public
void
setStringValue02
(
String
stringValue02
)
{
this
.
stringValue02
=
stringValue02
;
}
public
String
getStringValue03
()
{
return
stringValue03
;
}
public
void
setStringValue03
(
String
stringValue03
)
{
this
.
stringValue03
=
stringValue03
;
}
public
String
getStringValue04
()
{
return
stringValue04
;
}
public
void
setStringValue04
(
String
stringValue04
)
{
this
.
stringValue04
=
stringValue04
;
}
public
String
getStringValue05
()
{
return
stringValue05
;
}
public
void
setStringValue05
(
String
stringValue05
)
{
this
.
stringValue05
=
stringValue05
;
}
public
String
getStringValue06
()
{
return
stringValue06
;
}
public
void
setStringValue06
(
String
stringValue06
)
{
this
.
stringValue06
=
stringValue06
;
}
public
String
getStringValue07
()
{
return
stringValue07
;
}
public
void
setStringValue07
(
String
stringValue07
)
{
this
.
stringValue07
=
stringValue07
;
}
public
String
getStringValue08
()
{
return
stringValue08
;
}
public
void
setStringValue08
(
String
stringValue08
)
{
this
.
stringValue08
=
stringValue08
;
}
public
String
getStringValue09
()
{
return
stringValue09
;
}
public
void
setStringValue09
(
String
stringValue09
)
{
this
.
stringValue09
=
stringValue09
;
}
public
String
getStringValue10
()
{
return
stringValue10
;
}
public
void
setStringValue10
(
String
stringValue10
)
{
this
.
stringValue10
=
stringValue10
;
}
}
public
static
class
Wo
extends
WorkCompleted
{
private
static
final
long
serialVersionUID
=
3201055405092803987L
;
static
WrapCopier
<
WorkCompleted
,
Wo
>
copier
=
WrapCopierFactory
.
wo
(
WorkCompleted
.
class
,
Wo
.
class
,
JpaObject
.
singularAttributeField
(
WorkCompleted
.
class
,
true
,
true
),
null
);
}
}
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/workcompleted/WorkCompletedAction.java
浏览文件 @
448413dc
...
...
@@ -461,4 +461,25 @@ public class WorkCompletedAction extends StandardJaxrsAction {
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
,
jsonElement
));
}
@JaxrsMethodDescribe
(
value
=
"分页列示指定应用下根据过滤条件的WorkCompleted."
,
action
=
ActionManageListWithApplicationPaging
.
class
)
@POST
@Path
(
"list/paging/{page}/size/{size}/application/{applicationFlag}/filter/manage"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
manageListWithApplicationPaging
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
@JaxrsParameterDescribe
(
"分页"
)
@PathParam
(
"page"
)
Integer
page
,
@JaxrsParameterDescribe
(
"每页数量"
)
@PathParam
(
"size"
)
Integer
size
,
@JaxrsParameterDescribe
(
"应用标识"
)
@PathParam
(
"applicationFlag"
)
String
applicationFlag
,
JsonElement
jsonElement
)
{
ActionResult
<
List
<
ActionManageListWithApplicationPaging
.
Wo
>>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
try
{
result
=
new
ActionManageListWithApplicationPaging
().
execute
(
effectivePerson
,
page
,
size
,
applicationFlag
,
jsonElement
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
,
effectivePerson
,
request
,
jsonElement
);
result
.
error
(
e
);
}
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
,
jsonElement
));
}
}
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/content/Snap.java
浏览文件 @
448413dc
...
...
@@ -247,14 +247,12 @@ public class Snap extends SliceJpaObject {
public
static
final
String
activityAlias_FIELDNAME
=
"activityAlias"
;
@FieldDescribe
(
"活动别名,针对已完成工作添加待阅字段为空."
)
@Column
(
length
=
length_255B
,
name
=
ColumnNamePrefix
+
activityAlias_FIELDNAME
)
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
activityAlias_FIELDNAME
)
@CheckPersist
(
allowEmpty
=
true
)
private
String
activityAlias
;
public
static
final
String
activityDescription_FIELDNAME
=
"activityDescription"
;
@FieldDescribe
(
"活动说明,针对已完成工作添加待阅字段为空."
)
@Column
(
length
=
length_255B
,
name
=
ColumnNamePrefix
+
activityDescription_FIELDNAME
)
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
activityDescription_FIELDNAME
)
@CheckPersist
(
allowEmpty
=
true
)
private
String
activityDescription
;
...
...
@@ -269,13 +267,13 @@ public class Snap extends SliceJpaObject {
public
static
final
String
activityToken_FIELDNAME
=
"activityToken"
;
@FieldDescribe
(
"活动Token,针对已完成工作添加待阅字段为空."
)
@Column
(
length
=
JpaObject
.
length_id
,
name
=
ColumnNamePrefix
+
activityToken_FIELDNAME
)
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
activityToken_FIELDNAME
)
@CheckPersist
(
allowEmpty
=
true
)
private
String
activityToken
;
public
static
final
String
startTime_FIELDNAME
=
"startTime"
;
@FieldDescribe
(
"流程启动时间."
)
@Column
(
name
=
ColumnNamePrefix
+
startTime_FIELDNAME
)
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
startTime_FIELDNAME
)
private
Date
startTime
;
public
static
final
String
properties_FIELDNAME
=
"properties"
;
...
...
@@ -438,4 +436,4 @@ public class Snap extends SliceJpaObject {
this
.
startTime
=
startTime
;
}
}
\ No newline at end of file
}
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/element/Process.java
浏览文件 @
448413dc
...
...
@@ -64,6 +64,7 @@ public class Process extends SliceJpaObject {
public
static
final
String
STARTABLETERMINAL_CLIENT
=
"client"
;
public
static
final
String
STARTABLETERMINAL_MOBILE
=
"mobile"
;
public
static
final
String
STARTABLETERMINAL_ALL
=
"all"
;
public
static
final
String
STARTABLETERMINAL_NONE
=
"none"
;
@Override
public
String
getId
()
{
...
...
@@ -408,22 +409,6 @@ public class Process extends SliceJpaObject {
@CheckPersist
(
allowEmpty
=
true
)
private
Boolean
expireWorkTime
;
// public static final String expireScript_FIELDNAME = "expireScript";
// @IdReference(Script.class)
// /** 脚本可能使用名称,所以长度为255 */
// @FieldDescribe("过期时间设定脚本.")
// @Column(length = length_255B, name = ColumnNamePrefix + expireScript_FIELDNAME)
// @CheckPersist(allowEmpty = true)
// private String expireScript;
// public static final String expireScriptText_FIELDNAME = "expireScriptText";
// @FieldDescribe("过期时间设定脚本文本.")
// @Lob
// @Basic(fetch = FetchType.EAGER)
// @Column(length = JpaObject.length_1M, name = ColumnNamePrefix + expireScriptText_FIELDNAME)
// @CheckPersist(allowEmpty = true)
// private String expireScriptText;
public
static
final
String
checkDraft_FIELDNAME
=
"checkDraft"
;
@FieldDescribe
(
"是否进行无内容的草稿删除校验."
)
@Column
(
name
=
ColumnNamePrefix
+
checkDraft_FIELDNAME
)
...
...
@@ -431,7 +416,7 @@ public class Process extends SliceJpaObject {
private
Boolean
checkDraft
;
public
static
final
String
startableTerminal_FIELDNAME
=
"startableTerminal"
;
@FieldDescribe
(
"可启动流程终端类型,可选值 client,mobile,all"
)
@FieldDescribe
(
"可启动流程终端类型,可选值 client,mobile,all
,none
"
)
@Column
(
length
=
JpaObject
.
length_32B
,
name
=
ColumnNamePrefix
+
startableTerminal_FIELDNAME
)
@CheckPersist
(
allowEmpty
=
true
)
private
String
startableTerminal
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录