Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
此号慢热型
o2oa
提交
d7615c32
o2oa
项目概览
此号慢热型
/
o2oa
与 Fork 源项目一致
Fork自
浙江兰德纵横网络技术股份有限公司 / o2oa
通知
5
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,发现更多精彩内容 >>
提交
d7615c32
编写于
4月 13, 2020
作者:
O
o2sword
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1、增加版本描述字段;2、增加列示未启用版本流程接口
上级
90d39de2
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
196 addition
and
4 deletion
+196
-4
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/element/factory/ProcessFactory.java
...orm/assemble/designer/element/factory/ProcessFactory.java
+22
-4
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/process/ActionDisable.java
...atform/assemble/designer/jaxrs/process/ActionDisable.java
+73
-0
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/process/ActionListDisableEdition.java
...mble/designer/jaxrs/process/ActionListDisableEdition.java
+52
-0
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/process/ProcessAction.java
...atform/assemble/designer/jaxrs/process/ProcessAction.java
+36
-0
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
+13
-0
未找到文件。
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/element/factory/ProcessFactory.java
浏览文件 @
d7615c32
...
...
@@ -5,10 +5,7 @@ import java.util.List;
import
java.util.stream.Collectors
;
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
javax.persistence.criteria.*
;
import
com.x.processplatform.assemble.designer.AbstractFactory
;
import
com.x.processplatform.assemble.designer.Business
;
...
...
@@ -69,6 +66,27 @@ public class ProcessFactory extends AbstractFactory {
return
em
.
createQuery
(
cq
).
getResultList
();
}
public
List
<
String
>
listProcessDisableEdition
(
String
application
)
throws
Exception
{
EntityManager
em
=
this
.
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
.
equal
(
root
.
get
(
Process_
.
application
),
application
);
p
=
cb
.
and
(
p
,
cb
.
isNotNull
(
root
.
get
(
Process_
.
edition
)));
p
=
cb
.
and
(
p
,
cb
.
notEqual
(
root
.
get
(
Process_
.
edition
),
""
));
Subquery
<
Process
>
subquery
=
cq
.
subquery
(
Process
.
class
);
Root
<
Process
>
subRoot
=
subquery
.
from
(
Process
.
class
);
Predicate
subP
=
cb
.
conjunction
();
subP
=
cb
.
and
(
subP
,
cb
.
equal
(
root
.
get
(
Process_
.
edition
),
subRoot
.
get
(
Process_
.
edition
)));
subP
=
cb
.
and
(
subP
,
cb
.
isTrue
(
subRoot
.
get
(
Process_
.
editionEnable
)));
subquery
.
select
(
subRoot
).
where
(
subP
);
p
=
cb
.
and
(
p
,
cb
.
not
(
cb
.
exists
(
subquery
)));
cq
.
distinct
(
true
).
select
(
root
.
get
(
Process_
.
edition
)).
where
(
p
);
return
em
.
createQuery
(
cq
).
getResultList
();
}
public
Process
getEnabledProcess
(
String
application
,
String
edition
)
throws
Exception
{
EntityManager
em
=
this
.
entityManagerContainer
().
get
(
Process
.
class
);
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
...
...
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/process/ActionDisable.java
0 → 100644
浏览文件 @
d7615c32
package
com.x.processplatform.assemble.designer.jaxrs.process
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
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.processplatform.assemble.designer.Business
;
import
com.x.processplatform.core.entity.element.Application
;
import
com.x.processplatform.core.entity.element.Process
;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
java.util.Date
;
class
ActionDisable
extends
BaseAction
{
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
String
id
)
throws
Exception
{
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Business
business
=
new
Business
(
emc
);
Process
process
=
emc
.
find
(
id
,
Process
.
class
);
if
(
null
==
process
)
{
throw
new
ExceptionProcessNotExisted
(
id
);
}
Application
application
=
emc
.
find
(
process
.
getApplication
(),
Application
.
class
);
if
(
null
==
application
)
{
throw
new
ExceptionApplicationNotExist
(
process
.
getApplication
());
}
if
(!
business
.
editable
(
effectivePerson
,
application
))
{
throw
new
ExceptionApplicationAccessDenied
(
effectivePerson
.
getDistinguishedName
(),
application
.
getName
(),
application
.
getId
());
}
emc
.
beginTransaction
(
Process
.
class
);
if
(
StringUtils
.
isEmpty
(
process
.
getEdition
())){
process
.
setLastUpdateTime
(
new
Date
());
process
.
setEdition
(
process
.
getId
());
process
.
setEditionEnable
(
false
);
process
.
setEditionNumber
(
1.0
);
process
.
setEditionName
(
process
.
getName
()
+
"_V"
+
process
.
getEditionNumber
());
this
.
updateCreatePersonLastUpdatePerson
(
effectivePerson
,
business
,
process
);
}
else
{
if
(
BooleanUtils
.
isTrue
(
process
.
getEditionEnable
())){
process
.
setLastUpdateTime
(
new
Date
());
process
.
setEditionEnable
(
false
);
this
.
updateCreatePersonLastUpdatePerson
(
effectivePerson
,
business
,
process
);
}
}
emc
.
commit
();
cacheNotify
();
Wo
wo
=
new
Wo
();
wo
.
setValue
(
true
);
result
.
setData
(
wo
);
return
result
;
}
}
public
static
class
Wo
extends
WrapBoolean
{
}
private
void
updateCreatePersonLastUpdatePerson
(
EffectivePerson
effectivePerson
,
Business
business
,
Process
process
)
throws
Exception
{
process
.
setLastUpdatePerson
(
effectivePerson
.
getDistinguishedName
());
String
name
=
business
.
organization
().
person
().
get
(
process
.
getCreatorPerson
());
if
(
StringUtils
.
isEmpty
(
name
))
{
process
.
setCreatorPerson
(
effectivePerson
.
getDistinguishedName
());
}
else
{
process
.
setCreatorPerson
(
name
);
}
}
}
\ No newline at end of file
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/process/ActionListDisableEdition.java
0 → 100644
浏览文件 @
d7615c32
package
com.x.processplatform.assemble.designer.jaxrs.process
;
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.bean.WrapCopier
;
import
com.x.base.core.project.bean.WrapCopierFactory
;
import
com.x.base.core.project.exception.ExceptionWhen
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.processplatform.assemble.designer.Business
;
import
com.x.processplatform.core.entity.element.Application
;
import
com.x.processplatform.core.entity.element.Process
;
import
java.util.ArrayList
;
import
java.util.List
;
class
ActionListDisableEdition
extends
BaseAction
{
ActionResult
<
List
<
Wo
>>
execute
(
EffectivePerson
effectivePerson
,
String
applicationId
)
throws
Exception
{
ActionResult
<
List
<
Wo
>>
result
=
new
ActionResult
<>();
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Business
business
=
new
Business
(
emc
);
Application
application
=
emc
.
find
(
applicationId
,
Application
.
class
,
ExceptionWhen
.
not_found
);
if
(
null
==
application
)
{
throw
new
ExceptionApplicationNotExist
(
applicationId
);
}
if
(!
business
.
editable
(
effectivePerson
,
application
))
{
throw
new
ExceptionApplicationAccessDenied
(
effectivePerson
.
getDistinguishedName
(),
application
.
getName
(),
application
.
getId
());
}
List
<
Process
>
listProcess
=
new
ArrayList
<>();
List
<
String
>
editions
=
business
.
process
().
listProcessDisableEdition
(
applicationId
);
for
(
String
edition
:
editions
){
listProcess
.
add
(
business
.
process
().
listProcessEditionObject
(
applicationId
,
edition
).
get
(
0
));
}
List
<
Wo
>
wos
=
Wo
.
copier
.
copy
(
listProcess
);
wos
=
business
.
process
().
sort
(
wos
);
result
.
setData
(
wos
);
return
result
;
}
}
public
static
class
Wo
extends
Process
{
private
static
final
long
serialVersionUID
=
1439909268641168987L
;
static
WrapCopier
<
Process
,
Wo
>
copier
=
WrapCopierFactory
.
wo
(
Process
.
class
,
Wo
.
class
,
null
,
JpaObject
.
FieldsInvisible
);
}
}
\ No newline at end of file
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/process/ProcessAction.java
浏览文件 @
d7615c32
...
...
@@ -269,4 +269,40 @@ public class ProcessAction extends StandardJaxrsAction {
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
@JaxrsMethodDescribe
(
value
=
"列示未启用的流程版本."
,
action
=
ActionListDisableEdition
.
class
)
@GET
@Path
(
"application/{applicationId}/disable/edition"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
listDisableEdition
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
@JaxrsParameterDescribe
(
"应用标识"
)
@PathParam
(
"applicationId"
)
String
applicationId
)
{
ActionResult
<
List
<
ActionListDisableEdition
.
Wo
>>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
try
{
result
=
new
ActionListDisableEdition
().
execute
(
effectivePerson
,
applicationId
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
result
.
error
(
e
);
}
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
@JaxrsMethodDescribe
(
value
=
"停用当前版本流程."
,
action
=
ActionDisable
.
class
)
@GET
@Path
(
"{id}/disable"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
disableProcess
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
@JaxrsParameterDescribe
(
"标识"
)
@PathParam
(
"id"
)
String
id
)
{
ActionResult
<
ActionDisable
.
Wo
>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
try
{
result
=
new
ActionDisable
().
execute
(
effectivePerson
,
id
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
result
.
error
(
e
);
}
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
}
\ No newline at end of file
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/element/Process.java
浏览文件 @
d7615c32
...
...
@@ -490,6 +490,12 @@ public class Process extends SliceJpaObject {
@Column
(
name
=
ColumnNamePrefix
+
editionNumber_FIELDNAME
)
private
Double
editionNumber
;
public
static
final
String
editionDes_FIELDNAME
=
"editionDes"
;
@FieldDescribe
(
"版本描述."
)
@Column
(
length
=
length_255B
,
name
=
ColumnNamePrefix
+
editionDes_FIELDNAME
)
@CheckPersist
(
allowEmpty
=
true
)
private
String
editionDes
;
/* flag标志位 */
public
String
getName
()
{
...
...
@@ -820,4 +826,11 @@ public class Process extends SliceJpaObject {
this
.
editionNumber
=
editionNumber
;
}
public
String
getEditionDes
()
{
return
editionDes
;
}
public
void
setEditionDes
(
String
editionDes
)
{
this
.
editionDes
=
editionDes
;
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录