Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_42566577
o2oa
提交
61f9c9eb
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,发现更多精彩内容 >>
提交
61f9c9eb
编写于
1月 19, 2022
作者:
R
Ray
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update eval
上级
3ae00039
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
16 addition
and
14 deletion
+16
-14
.gitignore
.gitignore
+1
-0
o2server/x_program_center/src/main/java/com/x/program/center/jaxrs/agent/ActionExecute.java
.../java/com/x/program/center/jaxrs/agent/ActionExecute.java
+2
-1
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/jaxrs/statement/ActionExecute.java
...uery/assemble/designer/jaxrs/statement/ActionExecute.java
+0
-3
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/jaxrs/statement/ActionExecuteV2.java
...ry/assemble/designer/jaxrs/statement/ActionExecuteV2.java
+0
-2
o2server/x_query_core_express/src/main/java/com/x/query/core/express/plan/Plan.java
...ess/src/main/java/com/x/query/core/express/plan/Plan.java
+12
-7
o2server/x_query_service_processing/src/main/java/com/x/query/service/processing/jaxrs/neural/Generate.java
...com/x/query/service/processing/jaxrs/neural/Generate.java
+1
-1
未找到文件。
.gitignore
浏览文件 @
61f9c9eb
...
...
@@ -170,3 +170,4 @@ typings/
**/nbproject/
*.lock
*.checkstyle
o2server/test.sh
o2server/x_program_center/src/main/java/com/x/program/center/jaxrs/agent/ActionExecute.java
浏览文件 @
61f9c9eb
...
...
@@ -20,6 +20,7 @@ import com.x.base.core.project.jaxrs.WoId;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.script.AbstractResources
;
import
com.x.base.core.project.scripting.JsonScriptingExecutor
;
import
com.x.base.core.project.scripting.ScriptingFactory
;
import
com.x.base.core.project.tools.DateTools
;
import
com.x.base.core.project.webservices.WebservicesClient
;
...
...
@@ -76,7 +77,7 @@ class ActionExecute extends BaseAction {
}
try
{
compiledScript
.
eval
(
scriptContext
);
JsonScriptingExecutor
.
eval
(
compiledScript
,
scriptContext
);
}
catch
(
Exception
e
)
{
throw
new
ExceptionAgentEval
(
e
,
e
.
getMessage
(),
agent
.
getId
(),
agent
.
getName
(),
agent
.
getAlias
(),
agent
.
getText
());
...
...
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/jaxrs/statement/ActionExecute.java
浏览文件 @
61f9c9eb
...
...
@@ -69,9 +69,6 @@ class ActionExecute extends BaseAction {
ScriptContext
scriptContext
=
this
.
scriptContext
(
effectivePerson
,
runtime
);
CompiledScript
cs
=
ScriptingFactory
.
functionalizationCompile
(
statement
.
getScriptText
());
String
text
=
JsonScriptingExecutor
.
evalString
(
cs
,
scriptContext
);
// Object o = ScriptFactory.scriptEngine.eval(ScriptFactory.functionalization(statement.getScriptText()),
// scriptContext);
// String text = ScriptFactory.asString(o);
Class
<?
extends
JpaObject
>
cls
=
this
.
clazz
(
business
,
statement
);
EntityManager
em
;
if
(
StringUtils
.
equalsIgnoreCase
(
statement
.
getEntityCategory
(),
Statement
.
ENTITYCATEGORY_DYNAMIC
)
...
...
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/jaxrs/statement/ActionExecuteV2.java
浏览文件 @
61f9c9eb
...
...
@@ -114,8 +114,6 @@ class ActionExecuteV2 extends BaseAction {
}
CompiledScript
cs
=
ScriptingFactory
.
functionalizationCompile
(
scriptText
);
String
jpql
=
JsonScriptingExecutor
.
evalString
(
cs
,
scriptContext
);
// Object o = ScriptFactory.scriptEngine.eval(ScriptFactory.functionalization(scriptText), scriptContext);
// String jpql = ScriptFactory.asString(o);
Class
<?
extends
JpaObject
>
cls
=
this
.
clazz
(
business
,
statement
);
EntityManager
em
;
if
(
StringUtils
.
equalsIgnoreCase
(
statement
.
getEntityCategory
(),
Statement
.
ENTITYCATEGORY_DYNAMIC
)
...
...
o2server/x_query_core_express/src/main/java/com/x/query/core/express/plan/Plan.java
浏览文件 @
61f9c9eb
...
...
@@ -20,6 +20,8 @@ import javax.persistence.criteria.CriteriaQuery;
import
javax.persistence.criteria.Order
;
import
javax.persistence.criteria.Predicate
;
import
javax.persistence.criteria.Root
;
import
javax.script.CompiledScript
;
import
javax.script.ScriptContext
;
import
javax.script.ScriptEngine
;
import
javax.script.ScriptException
;
...
...
@@ -35,6 +37,7 @@ import com.x.base.core.entity.tools.JpaObjectTools;
import
com.x.base.core.project.config.Config
;
import
com.x.base.core.project.gson.GsonPropertyObject
;
import
com.x.base.core.project.organization.OrganizationDefinition
;
import
com.x.base.core.project.scripting.JsonScriptingExecutor
;
import
com.x.base.core.project.scripting.ScriptingFactory
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.query.core.entity.Item
;
...
...
@@ -256,9 +259,10 @@ public abstract class Plan extends GsonPropertyObject {
}
Table
table
=
this
.
order
(
fillTable
);
/* 新增测试 */
if
(!
this
.
selectList
.
emptyColumnCode
())
{
ScriptEngine
engine
=
this
.
getScriptEngine
();
engine
.
put
(
"gird"
,
table
);
if
(
BooleanUtils
.
isFalse
(
this
.
selectList
.
emptyColumnCode
()))
{
// ScriptEngine engine = this.getScriptEngine();
ScriptContext
scriptContext
=
ScriptingFactory
.
scriptContextEvalInitialScript
();
scriptContext
.
getBindings
(
ScriptContext
.
ENGINE_SCOPE
).
put
(
"gird"
,
table
);
for
(
SelectEntry
selectEntry
:
this
.
selectList
)
{
if
(
StringUtils
.
isNotBlank
(
selectEntry
.
code
))
{
List
<
ExtractObject
>
extractObjects
=
new
TreeList
<>();
...
...
@@ -270,8 +274,8 @@ public abstract class Plan extends GsonPropertyObject {
extractObject
.
setEntry
(
r
);
extractObjects
.
add
(
extractObject
);
});
engine
.
put
(
"extractObjects"
,
extractObjects
);
StringBu
ffer
text
=
new
StringBuff
er
();
scriptContext
.
getBindings
(
ScriptContext
.
ENGINE_SCOPE
)
.
put
(
"extractObjects"
,
extractObjects
);
StringBu
ilder
text
=
new
StringBuild
er
();
text
.
append
(
"function executeScript(o){\n"
);
text
.
append
(
selectEntry
.
code
);
text
.
append
(
"\n"
);
...
...
@@ -284,7 +288,9 @@ public abstract class Plan extends GsonPropertyObject {
text
.
append
(
"}\n"
);
text
.
append
(
"extractObject.setValue(executeScript.apply(o));\n"
);
text
.
append
(
"}"
);
engine
.
eval
(
text
.
toString
());
// engine.eval(text.toString());
CompiledScript
cs
=
ScriptingFactory
.
compile
(
text
.
toString
());
JsonScriptingExecutor
.
eval
(
cs
,
scriptContext
);
for
(
ExtractObject
extractObject
:
extractObjects
)
{
table
.
get
(
extractObject
.
getBundle
()).
put
(
extractObject
.
getColumn
(),
extractObject
.
getValue
());
}
...
...
@@ -595,7 +601,6 @@ public abstract class Plan extends GsonPropertyObject {
private
ScriptEngine
getScriptEngine
()
throws
ScriptException
,
Exception
{
if
(
null
==
this
.
scriptEngine
)
{
scriptEngine
=
ScriptingFactory
.
newScriptEngine
();
// scriptEngine.eval(Config.mooToolsScriptText());
}
return
scriptEngine
;
}
...
...
o2server/x_query_service_processing/src/main/java/com/x/query/service/processing/jaxrs/neural/Generate.java
浏览文件 @
61f9c9eb
...
...
@@ -434,7 +434,7 @@ public class Generate {
List
<
String
>
attachments
=
ListTools
.
extractProperty
(
attachmentObjects
,
Attachment
.
name_FIELDNAME
,
String
.
class
,
true
,
true
);
scriptContext
.
getBindings
(
ScriptContext
.
ENGINE_SCOPE
).
put
(
BaseAction
.
PROPERTY_ATTACHMENTS
,
attachments
);
attachmentCompiledScript
.
eval
(
scriptContext
);
JsonScriptingExecutor
.
eval
(
attachmentCompiledScript
,
scriptContext
);
attachmentObjects
=
ListTools
.
removePropertyNotIn
(
attachmentObjects
,
Attachment
.
name_FIELDNAME
,
attachments
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录