Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
fuyue82
o2oa
提交
765f6fdb
o2oa
项目概览
fuyue82
/
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,发现更多精彩内容 >>
提交
765f6fdb
编写于
1月 21, 2022
作者:
R
Ray
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
WorkContext中getTaskOrTaskCompleted方法中使用字符串null表示返回jsonNull
上级
d541f922
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
21 addition
and
28 deletion
+21
-28
o2server/x_base_core_project/src/main/java/com/x/base/core/project/scripting/ScriptingFactory.java
...a/com/x/base/core/project/scripting/ScriptingFactory.java
+2
-2
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/WorkContext.java
...com/x/processplatform/service/processing/WorkContext.java
+9
-2
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/factory/ElementFactory.java
...ssplatform/service/processing/factory/ElementFactory.java
+7
-7
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/test/TestAction.java
...essplatform/service/processing/jaxrs/test/TestAction.java
+3
-17
未找到文件。
o2server/x_base_core_project/src/main/java/com/x/base/core/project/scripting/ScriptingFactory.java
浏览文件 @
765f6fdb
...
...
@@ -87,10 +87,10 @@ public class ScriptingFactory {
public
static
String
functionalization
(
String
text
)
{
StringBuilder
sb
=
new
StringBuilder
();
sb
.
append
(
"var o = (function(){"
).
append
(
System
.
lineSeparator
());
sb
.
append
(
Objects
.
toString
(
text
,
""
)).
append
(
System
.
lineSeparator
())
.
append
(
System
.
lineSeparator
())
;
sb
.
append
(
Objects
.
toString
(
text
,
""
)).
append
(
System
.
lineSeparator
());
sb
.
append
(
"}.apply(this));"
).
append
(
System
.
lineSeparator
());
sb
.
append
(
"(o && (o !== false) && o.getClass && (typeof o
=='object')) ? Java.type('com.x.base.core.project.gson.XGsonBuilder').toJson(o) : JSON.stringify(o)
"
);
"(o && (o !== false) && o.getClass && (typeof o
== 'object')) ? Java.type('com.x.base.core.project.gson.XGsonBuilder').toJson(o) : JSON.stringify(o);
"
);
return
sb
.
toString
();
// StringBuilder sb = new StringBuilder();
// sb.append("JSON.stringify((function(){").append(System.lineSeparator());
...
...
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/WorkContext.java
浏览文件 @
765f6fdb
...
...
@@ -9,6 +9,7 @@ import java.util.stream.Collectors;
import
org.apache.commons.lang3.StringUtils
;
import
com.google.gson.Gson
;
import
com.google.gson.JsonNull
;
import
com.x.base.core.entity.annotation.CheckPersistType
;
import
com.x.base.core.project.gson.XGsonBuilder
;
import
com.x.processplatform.core.entity.content.Attachment
;
...
...
@@ -123,7 +124,7 @@ public class WorkContext {
if
(
null
!=
route
)
{
return
gson
.
toJson
(
route
);
}
return
""
;
return
JsonNull
.
INSTANCE
.
toString
()
;
}
public
void
setTitle
(
String
title
)
throws
Exception
{
...
...
@@ -268,6 +269,12 @@ public class WorkContext {
}
}
/**
* 为脚本运行准备的Json对象,如果为空那么返回字符串null
*
* @return
* @throws Exception
*/
public
String
getTaskOrTaskCompleted
()
throws
Exception
{
if
(
null
!=
task
)
{
return
gson
.
toJson
(
task
);
...
...
@@ -287,7 +294,7 @@ public class WorkContext {
if
(
null
!=
o
)
{
return
gson
.
toJson
(
o
);
}
return
""
;
return
JsonNull
.
INSTANCE
.
toString
()
;
}
public
String
getReadList
()
throws
Exception
{
...
...
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/factory/ElementFactory.java
浏览文件 @
765f6fdb
...
...
@@ -195,7 +195,7 @@ public class ElementFactory extends AbstractFactory {
begin
=
(
Begin
)
optional
.
get
();
}
else
{
begin
=
this
.
entityManagerContainer
().
firstEqual
(
Begin
.
class
,
Activity
.
process_FIELDNAME
,
id
);
if
(
begin
!=
null
)
{
if
(
begin
!=
null
)
{
this
.
entityManagerContainer
().
get
(
Begin
.
class
).
detach
(
begin
);
CacheManager
.
put
(
cacheCategory
,
cacheKey
,
begin
);
}
...
...
@@ -220,7 +220,7 @@ public class ElementFactory extends AbstractFactory {
Root
<
Route
>
root
=
cq
.
from
(
Route
.
class
);
Predicate
p
=
root
.
get
(
Route_
.
id
).
in
(
choice
.
getRouteList
());
list
=
em
.
createQuery
(
cq
.
where
(
p
).
orderBy
(
cb
.
asc
(
root
.
get
(
Route_
.
orderNumber
)))).
getResultList
();
for
(
Route
route
:
list
){
for
(
Route
route
:
list
)
{
em
.
detach
(
route
);
}
CacheManager
.
put
(
cacheCategory
,
cacheKey
,
list
);
...
...
@@ -246,7 +246,7 @@ public class ElementFactory extends AbstractFactory {
Root
<
Route
>
root
=
cq
.
from
(
Route
.
class
);
Predicate
p
=
root
.
get
(
Route_
.
id
).
in
(
manual
.
getRouteList
());
list
=
em
.
createQuery
(
cq
.
where
(
p
).
orderBy
(
cb
.
asc
(
root
.
get
(
Route_
.
orderNumber
)))).
getResultList
();
for
(
Route
route
:
list
){
for
(
Route
route
:
list
)
{
em
.
detach
(
route
);
}
CacheManager
.
put
(
cacheCategory
,
cacheKey
,
list
);
...
...
@@ -272,7 +272,7 @@ public class ElementFactory extends AbstractFactory {
Root
<
Route
>
root
=
cq
.
from
(
Route
.
class
);
Predicate
p
=
root
.
get
(
Route_
.
id
).
in
(
parallel
.
getRouteList
());
list
=
em
.
createQuery
(
cq
.
where
(
p
).
orderBy
(
cb
.
asc
(
root
.
get
(
Route_
.
orderNumber
)))).
getResultList
();
for
(
Route
route
:
list
){
for
(
Route
route
:
list
)
{
em
.
detach
(
route
);
}
CacheManager
.
put
(
cacheCategory
,
cacheKey
,
list
);
...
...
@@ -297,9 +297,9 @@ public class ElementFactory extends AbstractFactory {
List
<
String
>
loops
=
new
ArrayList
<>();
for
(
String
name
:
names
)
{
Script
o
=
this
.
getScriptWithApplicationWithUniqueName
(
applicationId
,
name
);
if
(
null
!=
o
)
{
if
(
null
!=
o
)
{
this
.
entityManagerContainer
().
get
(
Script
.
class
).
detach
(
o
);
if
(!
list
.
contains
(
o
))
{
if
(!
list
.
contains
(
o
))
{
list
.
add
(
o
);
loops
.
addAll
(
o
.
getDependScriptList
());
}
...
...
@@ -434,7 +434,7 @@ public class ElementFactory extends AbstractFactory {
p
=
cb
.
and
(
p
,
cb
.
or
(
cb
.
equal
(
root
.
get
(
Mapping_
.
process
),
process
),
cb
.
equal
(
root
.
get
(
Mapping_
.
process
),
""
),
cb
.
isNull
(
root
.
get
(
Mapping_
.
process
))));
List
<
Mapping
>
os
=
em
.
createQuery
(
cq
.
where
(
p
)).
getResultList
();
for
(
Mapping
mapping
:
os
){
for
(
Mapping
mapping
:
os
)
{
em
.
detach
(
mapping
);
}
os
.
stream
().
collect
(
Collectors
.
groupingBy
(
o
->
o
.
getApplication
()
+
o
.
getTableName
()))
...
...
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/test/TestAction.java
浏览文件 @
765f6fdb
...
...
@@ -10,6 +10,9 @@ import javax.ws.rs.container.AsyncResponse;
import
javax.ws.rs.container.Suspended
;
import
javax.ws.rs.core.Context
;
import
javax.ws.rs.core.MediaType
;
import
javax.ws.rs.sse.OutboundSseEvent
;
import
javax.ws.rs.sse.Sse
;
import
javax.ws.rs.sse.SseEventSink
;
import
com.x.base.core.project.annotation.JaxrsDescribe
;
import
com.x.base.core.project.annotation.JaxrsMethodDescribe
;
...
...
@@ -164,21 +167,4 @@ public class TestAction extends StandardJaxrsAction {
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
@JaxrsMethodDescribe
(
value
=
"测试test."
,
action
=
ActionTest
.
class
)
@GET
@Path
(
"test/{sleep}"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
test
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
@JaxrsParameterDescribe
(
"sleep秒"
)
@PathParam
(
"sleep"
)
Long
sleep
)
{
ActionResult
<
ActionTest
.
Wo
>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
try
{
result
=
new
ActionTest
().
execute
(
effectivePerson
,
sleep
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
result
.
error
(
e
);
}
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录