Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
fuyue82
o2oa
提交
b93fd39f
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,发现更多精彩内容 >>
提交
b93fd39f
编写于
1月 21, 2022
作者:
O
o2null
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'fix/jsonNull' into 'develop'
Fix/json null See merge request o2oa/o2oa!51
上级
b4e7df0d
765f6fdb
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
37 addition
and
55 deletion
+37
-55
o2server/pom.xml
o2server/pom.xml
+16
-27
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/pom.xml
浏览文件 @
b93fd39f
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
o2oa
</groupId>
<artifactId>
o2server
</artifactId>
...
...
@@ -118,10 +116,6 @@
<groupId>
org.apache.commons
</groupId>
<artifactId>
commons-pool2
</artifactId>
</dependency>
<dependency>
<groupId>
org.apache.commons
</groupId>
<artifactId>
commons-dbcp2
</artifactId>
</dependency>
<dependency>
<groupId>
org.apache.commons
</groupId>
<artifactId>
commons-text
</artifactId>
...
...
@@ -505,7 +499,7 @@
<dependency>
<groupId>
com.google.code.gson
</groupId>
<artifactId>
gson
</artifactId>
<version>
2.8.
5
</version>
<version>
2.8.
9
</version>
</dependency>
<dependency>
<groupId>
org.apache.openjpa
</groupId>
...
...
@@ -560,12 +554,7 @@
<dependency>
<groupId>
org.apache.commons
</groupId>
<artifactId>
commons-pool2
</artifactId>
<version>
2.7.0
</version>
</dependency>
<dependency>
<groupId>
org.apache.commons
</groupId>
<artifactId>
commons-dbcp2
</artifactId>
<version>
2.7.0
</version>
<version>
2.9.0
</version>
</dependency>
<dependency>
<groupId>
org.apache.commons
</groupId>
...
...
@@ -575,7 +564,7 @@
<dependency>
<groupId>
org.apache.maven
</groupId>
<artifactId>
maven-model
</artifactId>
<version>
3.
0
</version>
<version>
3.
6.3
</version>
</dependency>
<dependency>
<groupId>
org.apache.commons
</groupId>
...
...
@@ -585,27 +574,27 @@
<dependency>
<groupId>
org.eclipse.jetty
</groupId>
<artifactId>
jetty-server
</artifactId>
<version>
9.4.
20.v20190813
</version>
<version>
9.4.
33.v20201020
</version>
</dependency>
<dependency>
<groupId>
org.eclipse.jetty
</groupId>
<artifactId>
jetty-deploy
</artifactId>
<version>
9.4.
20.v20190813
</version>
<version>
9.4.
33.v20201020
</version>
</dependency>
<dependency>
<groupId>
org.eclipse.jetty
</groupId>
<artifactId>
jetty-annotations
</artifactId>
<version>
9.4.
20.v20190813
</version>
<version>
9.4.
33.v20201020
</version>
</dependency>
<dependency>
<groupId>
org.eclipse.jetty
</groupId>
<artifactId>
jetty-quickstart
</artifactId>
<version>
9.4.
20.v20190813
</version>
<version>
9.4.
33.v20201020
</version>
</dependency>
<dependency>
<groupId>
org.eclipse.jetty
</groupId>
<artifactId>
jetty-proxy
</artifactId>
<version>
9.4.3
1.v20200723
</version>
<version>
9.4.3
3.v20201020
</version>
</dependency>
<dependency>
<groupId>
com.google.zxing
</groupId>
...
...
@@ -774,17 +763,17 @@
<dependency>
<groupId>
io.github.classgraph
</groupId>
<artifactId>
classgraph
</artifactId>
<version>
4.8.
47
</version>
<version>
4.8.
89
</version>
</dependency>
<dependency>
<groupId>
org.glassfish.jersey.core
</groupId>
<artifactId>
jersey-server
</artifactId>
<version>
2.
27
</version>
<version>
2.
35
</version>
</dependency>
<dependency>
<groupId>
org.glassfish.jersey.media
</groupId>
<artifactId>
jersey-media-multipart
</artifactId>
<version>
2.
27
</version>
<version>
2.
35
</version>
</dependency>
<dependency>
<groupId>
org.dom4j
</groupId>
...
...
@@ -794,7 +783,7 @@
<dependency>
<groupId>
net.sf.ehcache
</groupId>
<artifactId>
ehcache
</artifactId>
<version>
2.10.
6
</version>
<version>
2.10.
5
</version>
</dependency>
<dependency>
<groupId>
org.quartz-scheduler
</groupId>
...
...
@@ -824,7 +813,7 @@
<dependency>
<groupId>
com.h2database
</groupId>
<artifactId>
h2
</artifactId>
<version>
1.4.
199
</version>
<version>
1.4.
200
</version>
</dependency>
<dependency>
<groupId>
org.mnode.ical4j
</groupId>
...
...
@@ -930,7 +919,7 @@
<dependency>
<groupId>
org.apache.logging.log4j
</groupId>
<artifactId>
log4j-slf4j-impl
</artifactId>
<version>
2.1
4.1
</version>
<version>
2.1
5
</version>
</dependency>
<dependency>
<groupId>
o2oa
</groupId>
...
...
@@ -1113,4 +1102,4 @@
<url>
http://maven.o2oa.net/repository/o2oa-release/
</url>
</repository>
</distributionManagement>
</project>
</project>
\ No newline at end of file
o2server/x_base_core_project/src/main/java/com/x/base/core/project/scripting/ScriptingFactory.java
浏览文件 @
b93fd39f
...
...
@@ -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
浏览文件 @
b93fd39f
...
...
@@ -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
浏览文件 @
b93fd39f
...
...
@@ -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
浏览文件 @
b93fd39f
...
...
@@ -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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录