Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_42566577
o2oa
提交
e13e3c87
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,发现更多精彩内容 >>
提交
e13e3c87
编写于
3月 24, 2020
作者:
Z
Zhou Rui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改embed调用线程错误.
上级
9bb26053
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
77 addition
and
105 deletion
+77
-105
o2server/x_organization_assemble_authentication/src/main/java/com/x/organization/assemble/authentication/factory/PersonFactory.java
...zation/assemble/authentication/factory/PersonFactory.java
+0
-1
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/work/ActionAssignCreate.java
...orm/service/processing/jaxrs/work/ActionAssignCreate.java
+58
-75
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/work/ActionCreate.java
...splatform/service/processing/jaxrs/work/ActionCreate.java
+19
-29
未找到文件。
o2server/x_organization_assemble_authentication/src/main/java/com/x/organization/assemble/authentication/factory/PersonFactory.java
浏览文件 @
e13e3c87
...
@@ -120,7 +120,6 @@ public class PersonFactory extends AbstractFactory {
...
@@ -120,7 +120,6 @@ public class PersonFactory extends AbstractFactory {
p
=
cb
.
or
(
p
,
cb
.
equal
(
root
.
get
(
Person_
.
open4Id
),
credential
));
p
=
cb
.
or
(
p
,
cb
.
equal
(
root
.
get
(
Person_
.
open4Id
),
credential
));
p
=
cb
.
or
(
p
,
cb
.
equal
(
root
.
get
(
Person_
.
open5Id
),
credential
));
p
=
cb
.
or
(
p
,
cb
.
equal
(
root
.
get
(
Person_
.
open5Id
),
credential
));
cq
.
select
(
root
.
get
(
Person_
.
id
));
cq
.
select
(
root
.
get
(
Person_
.
id
));
Query
query
=
em
.
createQuery
(
cq
.
where
(
p
));
List
<
String
>
list
=
em
.
createQuery
(
cq
.
where
(
p
).
distinct
(
true
)).
getResultList
();
List
<
String
>
list
=
em
.
createQuery
(
cq
.
where
(
p
).
distinct
(
true
)).
getResultList
();
if
(
list
.
size
()
==
1
)
{
if
(
list
.
size
()
==
1
)
{
return
list
.
get
(
0
);
return
list
.
get
(
0
);
...
...
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/work/ActionAssignCreate.java
浏览文件 @
e13e3c87
...
@@ -3,7 +3,6 @@ package com.x.processplatform.service.processing.jaxrs.work;
...
@@ -3,7 +3,6 @@ package com.x.processplatform.service.processing.jaxrs.work;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
java.util.concurrent.Callable
;
import
javax.persistence.EntityManager
;
import
javax.persistence.EntityManager
;
import
javax.persistence.criteria.CriteriaBuilder
;
import
javax.persistence.criteria.CriteriaBuilder
;
...
@@ -11,9 +10,6 @@ import javax.persistence.criteria.CriteriaQuery;
...
@@ -11,9 +10,6 @@ import javax.persistence.criteria.CriteriaQuery;
import
javax.persistence.criteria.Predicate
;
import
javax.persistence.criteria.Predicate
;
import
javax.persistence.criteria.Root
;
import
javax.persistence.criteria.Root
;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
com.google.gson.JsonElement
;
import
com.google.gson.JsonElement
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
...
@@ -27,7 +23,6 @@ import com.x.base.core.project.bean.WrapCopier;
...
@@ -27,7 +23,6 @@ import com.x.base.core.project.bean.WrapCopier;
import
com.x.base.core.project.bean.WrapCopierFactory
;
import
com.x.base.core.project.bean.WrapCopierFactory
;
import
com.x.base.core.project.config.StorageMapping
;
import
com.x.base.core.project.config.StorageMapping
;
import
com.x.base.core.project.exception.ExceptionEntityNotExist
;
import
com.x.base.core.project.exception.ExceptionEntityNotExist
;
import
com.x.base.core.project.executor.ProcessPlatformExecutorFactory
;
import
com.x.base.core.project.gson.GsonPropertyObject
;
import
com.x.base.core.project.gson.GsonPropertyObject
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.http.EffectivePerson
;
...
@@ -51,11 +46,15 @@ import com.x.processplatform.service.processing.MessageFactory;
...
@@ -51,11 +46,15 @@ import com.x.processplatform.service.processing.MessageFactory;
import
com.x.processplatform.service.processing.ThisApplication
;
import
com.x.processplatform.service.processing.ThisApplication
;
import
com.x.processplatform.service.processing.WorkDataHelper
;
import
com.x.processplatform.service.processing.WorkDataHelper
;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.apache.commons.lang3.StringUtils
;
/**
/**
* 创建处于start状态的work
* 创建处于start状态的work
*
*
* @author Rui
* @author Rui
*
*
* 此方法不需要推入线程池运行
*/
*/
class
ActionAssignCreate
extends
BaseAction
{
class
ActionAssignCreate
extends
BaseAction
{
...
@@ -67,86 +66,70 @@ class ActionAssignCreate extends BaseAction {
...
@@ -67,86 +66,70 @@ class ActionAssignCreate extends BaseAction {
Wo
wo
=
new
Wo
();
Wo
wo
=
new
Wo
();
Wi
wi
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
Wi
wi
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
Boolean
processing
=
wi
.
getProcessing
();
Boolean
processing
=
wi
.
getProcessing
();
CallWrapObject
callWrapObject
=
new
CallWrapObject
();
Work
work
=
null
;
Callable
<
String
>
callable
=
new
Callable
<
String
>()
{
public
String
call
()
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Business
business
=
new
Business
(
emc
);
Business
business
=
new
Business
(
emc
);
List
<
String
>
applicationIds
=
listApplication
(
business
,
wi
.
getApplication
());
List
<
String
>
applicationIds
=
listApplication
(
business
,
wi
.
getApplication
());
if
(
ListTools
.
isEmpty
(
applicationIds
))
{
if
(
ListTools
.
isEmpty
(
applicationIds
))
{
throw
new
ExceptionEntityNotExist
(
wi
.
getApplication
(),
Application
.
class
);
throw
new
ExceptionEntityNotExist
(
wi
.
getApplication
(),
Application
.
class
);
}
}
Process
process
=
getProcess
(
business
,
applicationIds
,
wi
.
getProcess
());
Process
process
=
getProcess
(
business
,
applicationIds
,
wi
.
getProcess
());
Application
application
=
business
.
element
().
get
(
process
.
getApplication
(),
Application
.
class
);
Application
application
=
business
.
element
().
get
(
process
.
getApplication
(),
Application
.
class
);
Begin
begin
=
business
.
element
().
getBeginWithProcess
(
process
.
getId
());
Begin
begin
=
business
.
element
().
getBeginWithProcess
(
process
.
getId
());
work
=
create
(
application
,
process
,
begin
);
Work
work
=
create
(
application
,
process
,
begin
);
String
identityDn
=
business
.
organization
().
identity
().
get
(
wi
.
getIdentity
());
callWrapObject
.
job
=
work
.
getJob
();
if
(
StringUtils
.
isEmpty
(
identityDn
))
{
callWrapObject
.
id
=
work
.
getId
();
throw
new
ExceptionIdentityNotExist
(
wi
.
getIdentity
());
String
identityDn
=
business
.
organization
().
identity
().
get
(
wi
.
getIdentity
());
}
if
(
StringUtils
.
isEmpty
(
identityDn
))
{
work
.
setTitle
(
wi
.
getTitle
());
throw
new
ExceptionIdentityNotExist
(
wi
.
getIdentity
());
work
.
setCreatorIdentity
(
identityDn
);
}
work
.
setCreatorPerson
(
business
.
organization
().
person
().
getWithIdentity
(
identityDn
));
work
.
setTitle
(
wi
.
getTitle
());
work
.
setCreatorUnit
(
business
.
organization
().
unit
().
getWithIdentity
(
identityDn
));
work
.
setCreatorIdentity
(
identityDn
);
/* 通过赋值调用的是不能被作为草稿删除的 */
work
.
setCreatorPerson
(
business
.
organization
().
person
().
getWithIdentity
(
identityDn
));
work
.
setDataChanged
(
true
);
work
.
setCreatorUnit
(
business
.
organization
().
unit
().
getWithIdentity
(
identityDn
));
if
(
ListTools
.
isNotEmpty
(
wi
.
getAttachmentList
()))
{
/* 通过赋值调用的是不能被作为草稿删除的 */
emc
.
beginTransaction
(
Attachment
.
class
);
work
.
setDataChanged
(
true
);
/** 这个attachmentList要手动初始化 */
if
(
ListTools
.
isNotEmpty
(
wi
.
getAttachmentList
()))
{
// work.setAttachmentList(new ArrayList<String>());
emc
.
beginTransaction
(
Attachment
.
class
);
for
(
WiAttachment
o
:
wi
.
getAttachmentList
())
{
/** 这个attachmentList要手动初始化 */
StorageMapping
fromMapping
=
ThisApplication
.
context
().
storageMappings
().
get
(
Attachment
.
class
,
// work.setAttachmentList(new ArrayList<String>());
o
.
getStorage
());
for
(
WiAttachment
o
:
wi
.
getAttachmentList
())
{
if
(
null
==
fromMapping
)
{
StorageMapping
fromMapping
=
ThisApplication
.
context
().
storageMappings
()
throw
new
ExceptionFromMappingNotExist
(
o
.
getStorage
());
.
get
(
Attachment
.
class
,
o
.
getStorage
());
if
(
null
==
fromMapping
)
{
throw
new
ExceptionFromMappingNotExist
(
o
.
getStorage
());
}
StorageMapping
toMapping
=
ThisApplication
.
context
().
storageMappings
()
.
random
(
Attachment
.
class
);
if
(
null
==
toMapping
)
{
throw
new
ExceptionToMappingNotExist
(
Attachment
.
class
);
}
Attachment
attachment
=
new
Attachment
(
work
,
effectivePerson
.
getDistinguishedName
(),
o
.
getSite
());
attachment
.
setActivity
(
begin
.
getId
());
attachment
.
setActivityName
(
begin
.
getName
());
attachment
.
setActivityType
(
ActivityType
.
begin
);
attachment
.
setActivityToken
(
work
.
getActivityToken
());
attachment
.
saveContent
(
toMapping
,
o
.
readContent
(
fromMapping
),
o
.
getName
());
emc
.
persist
(
attachment
,
CheckPersistType
.
all
);
}
}
}
emc
.
beginTransaction
(
Work
.
class
);
StorageMapping
toMapping
=
ThisApplication
.
context
().
storageMappings
().
random
(
Attachment
.
class
);
emc
.
persist
(
work
,
CheckPersistType
.
all
);
if
(
null
==
toMapping
)
{
if
(
null
!=
wi
.
getData
())
{
throw
new
ExceptionToMappingNotExist
(
Attachment
.
class
);
WorkDataHelper
workDataHelper
=
new
WorkDataHelper
(
emc
,
work
);
workDataHelper
.
update
(
wi
.
getData
());
}
}
emc
.
commit
();
Attachment
attachment
=
new
Attachment
(
work
,
effectivePerson
.
getDistinguishedName
(),
o
.
getSite
());
MessageFactory
.
work_create
(
work
);
attachment
.
setActivity
(
begin
.
getId
());
attachment
.
setActivityName
(
begin
.
getName
());
attachment
.
setActivityType
(
ActivityType
.
begin
);
attachment
.
setActivityToken
(
work
.
getActivityToken
());
attachment
.
saveContent
(
toMapping
,
o
.
readContent
(
fromMapping
),
o
.
getName
());
emc
.
persist
(
attachment
,
CheckPersistType
.
all
);
}
}
return
""
;
}
}
};
emc
.
beginTransaction
(
Work
.
class
);
emc
.
persist
(
work
,
CheckPersistType
.
all
);
ProcessPlatformExecutorFactory
.
get
(
wi
.
getProcess
()).
submit
(
callable
).
get
();
if
(
null
!=
wi
.
getData
())
{
WorkDataHelper
workDataHelper
=
new
WorkDataHelper
(
emc
,
work
);
workDataHelper
.
update
(
wi
.
getData
());
}
emc
.
commit
();
}
MessageFactory
.
work_create
(
work
);
if
(
BooleanUtils
.
isTrue
(
processing
))
{
if
(
BooleanUtils
.
isTrue
(
processing
))
{
ThisApplication
.
context
().
applications
().
putQuery
(
x_processplatform_service_processing
.
class
,
ThisApplication
.
context
().
applications
().
putQuery
(
x_processplatform_service_processing
.
class
,
Applications
.
joinQueryUri
(
"work"
,
callWrapObject
.
id
,
"processing"
),
null
,
callWrapObject
.
job
);
Applications
.
joinQueryUri
(
"work"
,
work
.
getId
(),
"processing"
),
null
,
work
.
getJob
()
);
}
}
wo
.
setId
(
callWrapObject
.
id
);
wo
.
setId
(
work
.
getId
()
);
result
.
setData
(
wo
);
result
.
setData
(
wo
);
return
result
;
return
result
;
}
}
public
static
class
CallWrapObject
{
private
String
job
;
private
String
id
;
}
public
static
class
Wi
extends
GsonPropertyObject
{
public
static
class
Wi
extends
GsonPropertyObject
{
@FieldDescribe
(
"应用标识"
)
@FieldDescribe
(
"应用标识"
)
...
@@ -282,7 +265,7 @@ class ActionAssignCreate extends BaseAction {
...
@@ -282,7 +265,7 @@ class ActionAssignCreate extends BaseAction {
work
.
setProcessAlias
(
process
.
getAlias
());
work
.
setProcessAlias
(
process
.
getAlias
());
work
.
setJob
(
StringTools
.
uniqueToken
());
work
.
setJob
(
StringTools
.
uniqueToken
());
work
.
setStartTime
(
now
);
work
.
setStartTime
(
now
);
//
work.setErrorRetry(0);
//
work.setErrorRetry(0);
work
.
setWorkStatus
(
WorkStatus
.
start
);
work
.
setWorkStatus
(
WorkStatus
.
start
);
work
.
setDestinationActivity
(
begin
.
getId
());
work
.
setDestinationActivity
(
begin
.
getId
());
work
.
setDestinationActivityType
(
ActivityType
.
begin
);
work
.
setDestinationActivityType
(
ActivityType
.
begin
);
...
...
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/work/ActionCreate.java
浏览文件 @
e13e3c87
package
com.x.processplatform.service.processing.jaxrs.work
;
package
com.x.processplatform.service.processing.jaxrs.work
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.concurrent.Callable
;
import
com.google.gson.JsonElement
;
import
com.google.gson.JsonElement
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.entity.annotation.CheckPersistType
;
import
com.x.base.core.entity.annotation.CheckPersistType
;
import
com.x.base.core.project.executor.ProcessPlatformExecutorFactory
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.jaxrs.WoId
;
import
com.x.base.core.project.jaxrs.WoId
;
...
@@ -26,7 +24,8 @@ import com.x.processplatform.service.processing.WorkDataHelper;
...
@@ -26,7 +24,8 @@ import com.x.processplatform.service.processing.WorkDataHelper;
* 创建处于start状态的work
* 创建处于start状态的work
*
*
* @author Rui
* @author Rui
*
*
* 此方法不需要推入线程池运行
*/
*/
class
ActionCreate
extends
BaseAction
{
class
ActionCreate
extends
BaseAction
{
...
@@ -35,33 +34,24 @@ class ActionCreate extends BaseAction {
...
@@ -35,33 +34,24 @@ class ActionCreate extends BaseAction {
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
Wo
wo
=
new
Wo
();
Wo
wo
=
new
Wo
();
Work
work
=
null
;
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Business
business
=
new
Business
(
emc
);
Process
process
=
business
.
element
().
get
(
processId
,
Process
.
class
);
Application
application
=
business
.
element
().
get
(
process
.
getApplication
(),
Application
.
class
);
Begin
begin
=
business
.
element
().
getBeginWithProcess
(
process
.
getId
());
Callable
<
String
>
callable
=
new
Callable
<
String
>()
{
work
=
create
(
application
,
process
,
begin
);
public
String
call
()
throws
Exception
{
emc
.
beginTransaction
(
Work
.
class
);
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
if
((
null
!=
jsonElement
)
&&
jsonElement
.
isJsonObject
())
{
Business
business
=
new
Business
(
emc
);
WorkDataHelper
workDataHelper
=
new
WorkDataHelper
(
emc
,
work
);
Process
process
=
business
.
element
().
get
(
processId
,
Process
.
class
);
workDataHelper
.
update
(
jsonElement
);
Application
application
=
business
.
element
().
get
(
process
.
getApplication
(),
Application
.
class
);
Begin
begin
=
business
.
element
().
getBeginWithProcess
(
process
.
getId
());
Work
work
=
create
(
application
,
process
,
begin
);
emc
.
beginTransaction
(
Work
.
class
);
if
((
null
!=
jsonElement
)
&&
jsonElement
.
isJsonObject
())
{
WorkDataHelper
workDataHelper
=
new
WorkDataHelper
(
emc
,
work
);
workDataHelper
.
update
(
jsonElement
);
}
emc
.
persist
(
work
,
CheckPersistType
.
all
);
emc
.
commit
();
wo
.
setId
(
work
.
getId
());
MessageFactory
.
work_create
(
work
);
}
return
""
;
}
}
}
;
emc
.
persist
(
work
,
CheckPersistType
.
all
)
;
emc
.
commit
();
/* 根据流程应用id分派进程号. */
wo
.
setId
(
work
.
getId
());
ProcessPlatformExecutorFactory
.
get
(
processId
).
submit
(
callable
).
get
();
}
MessageFactory
.
work_create
(
work
);
result
.
setData
(
wo
);
result
.
setData
(
wo
);
return
result
;
return
result
;
}
}
...
@@ -85,7 +75,7 @@ class ActionCreate extends BaseAction {
...
@@ -85,7 +75,7 @@ class ActionCreate extends BaseAction {
work
.
setProcessAlias
(
process
.
getAlias
());
work
.
setProcessAlias
(
process
.
getAlias
());
work
.
setJob
(
StringTools
.
uniqueToken
());
work
.
setJob
(
StringTools
.
uniqueToken
());
work
.
setStartTime
(
now
);
work
.
setStartTime
(
now
);
//
work.setErrorRetry(0);
//
work.setErrorRetry(0);
work
.
setWorkStatus
(
WorkStatus
.
start
);
work
.
setWorkStatus
(
WorkStatus
.
start
);
work
.
setDestinationActivity
(
begin
.
getId
());
work
.
setDestinationActivity
(
begin
.
getId
());
work
.
setDestinationActivityType
(
ActivityType
.
begin
);
work
.
setDestinationActivityType
(
ActivityType
.
begin
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录