Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
此号慢热型
o2oa
提交
e468ff2f
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,发现更多精彩内容 >>
提交
e468ff2f
编写于
5月 16, 2019
作者:
R
roo00
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修正神经网络无法删除的bug
上级
8637873e
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
325 addition
and
100 deletion
+325
-100
o2server/x_program_center/src/main/java/com/x/program/center/WrapModule.java
...center/src/main/java/com/x/program/center/WrapModule.java
+11
-0
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/jaxrs/neural/ActionDeleteModel.java
...ery/assemble/designer/jaxrs/neural/ActionDeleteModel.java
+2
-0
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/jaxrs/neural/BaseAction.java
...om/x/query/assemble/designer/jaxrs/neural/BaseAction.java
+26
-0
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/jaxrs/statement/ActionEdit.java
...x/query/assemble/designer/jaxrs/statement/ActionEdit.java
+7
-2
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/jaxrs/statement/ActionExecute.java
...uery/assemble/designer/jaxrs/statement/ActionExecute.java
+15
-2
o2server/x_query_assemble_designer/src/main/webapp/jest/describe.js
..._query_assemble_designer/src/main/webapp/jest/describe.js
+17
-5
o2server/x_query_assemble_surface/src/main/webapp/jest/describe.js
...x_query_assemble_surface/src/main/webapp/jest/describe.js
+17
-5
o2server/x_query_core_express/src/main/java/com/x/query/core/express/plan/FilterEntry.java
.../main/java/com/x/query/core/express/plan/FilterEntry.java
+212
-74
o2server/x_query_service_processing/src/main/java/com/x/query/service/processing/jaxrs/neural/Learn.java
...va/com/x/query/service/processing/jaxrs/neural/Learn.java
+1
-7
o2server/x_query_service_processing/src/main/webapp/jest/describe.js
...query_service_processing/src/main/webapp/jest/describe.js
+17
-5
未找到文件。
o2server/x_program_center/src/main/java/com/x/program/center/WrapModule.java
浏览文件 @
e468ff2f
...
...
@@ -29,6 +29,9 @@ public class WrapModule extends GsonPropertyObject {
@FieldDescribe
(
"说明"
)
private
String
description
;
@FieldDescribe
(
"下载次数"
)
private
Integer
downloadCount
;
@FieldDescribe
(
"流程"
)
private
List
<
WrapProcessPlatform
>
processPlatformList
=
new
ArrayList
<>();
...
...
@@ -150,4 +153,12 @@ public class WrapModule extends GsonPropertyObject {
this
.
icon
=
icon
;
}
public
Integer
getDownloadCount
()
{
return
downloadCount
;
}
public
void
setDownloadCount
(
Integer
downloadCount
)
{
this
.
downloadCount
=
downloadCount
;
}
}
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/jaxrs/neural/ActionDeleteModel.java
浏览文件 @
e468ff2f
...
...
@@ -32,6 +32,8 @@ class ActionDeleteModel extends BaseAction {
}
this
.
cleanOutValue
(
business
,
model
);
this
.
cleanInValue
(
business
,
model
);
this
.
cleanInText
(
business
,
model
);
this
.
cleanOutText
(
business
,
model
);
this
.
cleanEntry
(
business
,
model
);
emc
.
beginTransaction
(
Model
.
class
);
emc
.
remove
(
model
,
CheckRemoveType
.
all
);
...
...
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/jaxrs/neural/BaseAction.java
浏览文件 @
e468ff2f
...
...
@@ -8,8 +8,10 @@ import com.x.base.core.project.logger.LoggerFactory;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.query.assemble.designer.Business
;
import
com.x.query.core.entity.neural.Entry
;
import
com.x.query.core.entity.neural.InText
;
import
com.x.query.core.entity.neural.InValue
;
import
com.x.query.core.entity.neural.Model
;
import
com.x.query.core.entity.neural.OutText
;
import
com.x.query.core.entity.neural.OutValue
;
abstract
class
BaseAction
extends
StandardJaxrsAction
{
...
...
@@ -40,6 +42,30 @@ abstract class BaseAction extends StandardJaxrsAction {
return
count
;
}
protected
Long
cleanInText
(
Business
business
,
Model
project
)
throws
Exception
{
List
<
String
>
ids
=
business
.
entityManagerContainer
().
idsEqual
(
InText
.
class
,
InText
.
model_FIELDNAME
,
project
.
getId
());
Long
count
=
0L
;
for
(
List
<
String
>
os
:
ListTools
.
batch
(
ids
,
2000
))
{
business
.
entityManagerContainer
().
beginTransaction
(
InText
.
class
);
count
=
count
+
business
.
entityManagerContainer
().
delete
(
InText
.
class
,
os
);
business
.
entityManagerContainer
().
commit
();
}
return
count
;
}
protected
Long
cleanOutText
(
Business
business
,
Model
project
)
throws
Exception
{
List
<
String
>
ids
=
business
.
entityManagerContainer
().
idsEqual
(
OutText
.
class
,
OutText
.
model_FIELDNAME
,
project
.
getId
());
Long
count
=
0L
;
for
(
List
<
String
>
os
:
ListTools
.
batch
(
ids
,
2000
))
{
business
.
entityManagerContainer
().
beginTransaction
(
OutText
.
class
);
count
=
count
+
business
.
entityManagerContainer
().
delete
(
OutText
.
class
,
os
);
business
.
entityManagerContainer
().
commit
();
}
return
count
;
}
protected
Long
cleanEntry
(
Business
business
,
Model
project
)
throws
Exception
{
List
<
String
>
ids
=
business
.
entityManagerContainer
().
idsEqual
(
Entry
.
class
,
Entry
.
model_FIELDNAME
,
project
.
getId
());
...
...
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/jaxrs/statement/ActionEdit.java
浏览文件 @
e468ff2f
...
...
@@ -19,6 +19,8 @@ import com.x.base.core.project.exception.ExceptionEntityNotExist;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
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.tools.ListTools
;
import
com.x.query.assemble.designer.Business
;
import
com.x.query.core.entity.Query
;
...
...
@@ -26,15 +28,19 @@ import com.x.query.core.entity.schema.Statement;
import
com.x.query.core.entity.schema.Table
;
class
ActionEdit
extends
BaseAction
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
ActionEdit
.
class
);
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
String
flag
,
JsonElement
jsonElement
)
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
Business
business
=
new
Business
(
emc
);
Wi
wi
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
Statement
statement
=
emc
.
flag
(
flag
,
Statement
.
class
);
if
(
null
==
statement
)
{
throw
new
ExceptionEntityNotExist
(
flag
,
Statement
.
class
);
}
Table
table
=
emc
.
flag
(
statement
.
getTable
(),
Table
.
class
);
Table
table
=
emc
.
flag
(
wi
.
getTable
(),
Table
.
class
);
if
(
null
==
table
)
{
throw
new
ExceptionEntityNotExist
(
statement
.
getTable
(),
Table
.
class
);
}
...
...
@@ -45,7 +51,6 @@ class ActionEdit extends BaseAction {
if
(!
business
.
editable
(
effectivePerson
,
query
))
{
throw
new
ExceptionAccessDenied
(
effectivePerson
,
query
);
}
Wi
wi
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
Wi
.
copier
.
copy
(
wi
,
statement
);
if
(
StringUtils
.
isEmpty
(
statement
.
getName
()))
{
throw
new
ExceptionEntityFieldEmpty
(
Statement
.
class
,
Statement
.
name_FIELDNAME
);
...
...
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/jaxrs/statement/ActionExecute.java
浏览文件 @
e468ff2f
...
...
@@ -7,6 +7,7 @@ import javax.persistence.EntityManager;
import
javax.persistence.Query
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.math.NumberUtils
;
import
com.google.gson.JsonElement
;
import
com.google.gson.reflect.TypeToken
;
...
...
@@ -14,8 +15,8 @@ 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.entity.dynamic.DynamicEntity
;
import
com.x.base.core.project.exception.ExceptionAccessDenied
;
import
com.x.base.core.project.exception.ExceptionEntityNotExist
;
import
com.x.base.core.project.gson.GsonPropertyObject
;
import
com.x.base.core.project.gson.XGsonBuilder
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
...
...
@@ -55,7 +56,19 @@ class ActionExecute extends BaseAction {
EntityManager
em
=
emc
.
get
(
cls
);
Query
query
=
em
.
createQuery
(
statement
.
getData
());
for
(
Entry
<
String
,
Object
>
en
:
parameter
.
entrySet
())
{
query
.
setParameter
(
en
.
getKey
(),
en
.
getValue
());
if
(
StringUtils
.
equals
(
en
.
getKey
(),
"firstResult"
)
&&
(
en
.
getValue
()
!=
null
))
{
int
firstResult
=
NumberUtils
.
toInt
(
en
.
getValue
().
toString
(),
-
1
);
if
(
firstResult
>
0
)
{
query
.
setFirstResult
(
firstResult
);
}
}
else
if
(
StringUtils
.
equals
(
en
.
getKey
(),
"maxResults"
)
&&
(
en
.
getValue
()
!=
null
))
{
int
maxResults
=
NumberUtils
.
toInt
(
en
.
getValue
().
toString
(),
-
1
);
if
(
maxResults
>
0
)
{
query
.
setMaxResults
(
maxResults
);
}
}
else
{
query
.
setParameter
(
en
.
getKey
(),
en
.
getValue
());
}
}
Object
data
=
null
;
if
(
StringUtils
.
equalsIgnoreCase
(
statement
.
getType
(),
Statement
.
TYPE_SELECT
))
{
...
...
o2server/x_query_assemble_designer/src/main/webapp/jest/describe.js
浏览文件 @
e468ff2f
var
Describe
=
function
()
{
//
20180730
//
20180730
}
Describe
.
splitValue
=
function
(
str
)
{
...
...
@@ -38,7 +38,7 @@ Describe.doPost = function(address, m, data) {
xhrFields
:
{
'
withCredentials
'
:
true
},
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
?
JSON
.
stringify
(
data
)
:
data
)
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
&&
(
!
m
.
useStringParameter
)
?
JSON
.
stringify
(
data
)
:
data
)
}).
always
(
function
(
resultJson
)
{
$
(
'
#result
'
).
html
(
JSON
.
stringify
(
resultJson
,
null
,
4
));
Describe
.
writeOut
(
m
.
outs
,
resultJson
);
...
...
@@ -55,7 +55,7 @@ Describe.doPost = function(address, m, data) {
xhrFields
:
{
'
withCredentials
'
:
true
},
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
?
JSON
.
stringify
(
data
)
:
data
)
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
&&
(
!
m
.
useStringParameter
)
?
JSON
.
stringify
(
data
)
:
data
)
});
}
}
...
...
@@ -74,7 +74,7 @@ Describe.doPut = function(address, m, data) {
xhrFields
:
{
'
withCredentials
'
:
true
},
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
?
JSON
.
stringify
(
data
)
:
data
)
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
&&
(
!
m
.
useStringParameter
)
?
JSON
.
stringify
(
data
)
:
data
)
}).
always
(
function
(
resultJson
)
{
$
(
'
#result
'
).
html
(
JSON
.
stringify
(
resultJson
,
null
,
4
));
Describe
.
writeOut
(
m
.
outs
,
resultJson
);
...
...
@@ -91,7 +91,7 @@ Describe.doPut = function(address, m, data) {
xhrFields
:
{
'
withCredentials
'
:
true
},
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
?
JSON
.
stringify
(
data
)
:
data
)
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
&&
(
!
m
.
useStringParameter
)
?
JSON
.
stringify
(
data
)
:
data
)
});
}
}
...
...
@@ -269,6 +269,14 @@ Describe.prototype = {
txt
+=
'
</table>
'
;
txt
+=
'
</fieldset>
'
;
}
if
(
m
.
useStringParameter
)
{
txt
+=
'
<fieldset><legend>String</legend>
'
;
txt
+=
'
<table><tr><td>
'
;
txt
+=
'
<textarea id="string" style="height:300px; width:600px; padding:1px; border:1px #000000 solid"/>
'
;
txt
+=
'
</td><td>string</td></tr>
'
;
txt
+=
'
</table>
'
;
txt
+=
'
</fieldset>
'
;
}
if
(
m
.
outs
&&
m
.
outs
.
length
>
0
)
{
txt
+=
'
<fieldset id="outs"><legend>Out</legend>
'
;
txt
+=
'
<table>
'
;
...
...
@@ -318,6 +326,8 @@ Describe.prototype = {
});
}
else
if
(
m
.
useJsonElementParameter
)
{
data
=
$
.
parseJSON
(
$
(
'
#jsonElement
'
).
val
());
}
else
if
(
m
.
useStringParameter
)
{
data
=
$
(
'
#string
'
).
val
();
}
Describe
.
doPost
(
address
,
m
,
data
);
break
;
...
...
@@ -340,6 +350,8 @@ Describe.prototype = {
});
}
else
if
(
m
.
useJsonElementParameter
)
{
data
=
$
.
parseJSON
(
$
(
'
#jsonElement
'
).
val
());
}
else
if
(
m
.
useStringParameter
)
{
data
=
$
(
'
#string
'
).
val
();
}
Describe
.
doPut
(
address
,
m
,
data
);
break
;
...
...
o2server/x_query_assemble_surface/src/main/webapp/jest/describe.js
浏览文件 @
e468ff2f
var
Describe
=
function
()
{
//
20180730
//
20180730
}
Describe
.
splitValue
=
function
(
str
)
{
...
...
@@ -38,7 +38,7 @@ Describe.doPost = function(address, m, data) {
xhrFields
:
{
'
withCredentials
'
:
true
},
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
?
JSON
.
stringify
(
data
)
:
data
)
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
&&
(
!
m
.
useStringParameter
)
?
JSON
.
stringify
(
data
)
:
data
)
}).
always
(
function
(
resultJson
)
{
$
(
'
#result
'
).
html
(
JSON
.
stringify
(
resultJson
,
null
,
4
));
Describe
.
writeOut
(
m
.
outs
,
resultJson
);
...
...
@@ -55,7 +55,7 @@ Describe.doPost = function(address, m, data) {
xhrFields
:
{
'
withCredentials
'
:
true
},
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
?
JSON
.
stringify
(
data
)
:
data
)
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
&&
(
!
m
.
useStringParameter
)
?
JSON
.
stringify
(
data
)
:
data
)
});
}
}
...
...
@@ -74,7 +74,7 @@ Describe.doPut = function(address, m, data) {
xhrFields
:
{
'
withCredentials
'
:
true
},
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
?
JSON
.
stringify
(
data
)
:
data
)
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
&&
(
!
m
.
useStringParameter
)
?
JSON
.
stringify
(
data
)
:
data
)
}).
always
(
function
(
resultJson
)
{
$
(
'
#result
'
).
html
(
JSON
.
stringify
(
resultJson
,
null
,
4
));
Describe
.
writeOut
(
m
.
outs
,
resultJson
);
...
...
@@ -91,7 +91,7 @@ Describe.doPut = function(address, m, data) {
xhrFields
:
{
'
withCredentials
'
:
true
},
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
?
JSON
.
stringify
(
data
)
:
data
)
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
&&
(
!
m
.
useStringParameter
)
?
JSON
.
stringify
(
data
)
:
data
)
});
}
}
...
...
@@ -269,6 +269,14 @@ Describe.prototype = {
txt
+=
'
</table>
'
;
txt
+=
'
</fieldset>
'
;
}
if
(
m
.
useStringParameter
)
{
txt
+=
'
<fieldset><legend>String</legend>
'
;
txt
+=
'
<table><tr><td>
'
;
txt
+=
'
<textarea id="string" style="height:300px; width:600px; padding:1px; border:1px #000000 solid"/>
'
;
txt
+=
'
</td><td>string</td></tr>
'
;
txt
+=
'
</table>
'
;
txt
+=
'
</fieldset>
'
;
}
if
(
m
.
outs
&&
m
.
outs
.
length
>
0
)
{
txt
+=
'
<fieldset id="outs"><legend>Out</legend>
'
;
txt
+=
'
<table>
'
;
...
...
@@ -318,6 +326,8 @@ Describe.prototype = {
});
}
else
if
(
m
.
useJsonElementParameter
)
{
data
=
$
.
parseJSON
(
$
(
'
#jsonElement
'
).
val
());
}
else
if
(
m
.
useStringParameter
)
{
data
=
$
(
'
#string
'
).
val
();
}
Describe
.
doPost
(
address
,
m
,
data
);
break
;
...
...
@@ -340,6 +350,8 @@ Describe.prototype = {
});
}
else
if
(
m
.
useJsonElementParameter
)
{
data
=
$
.
parseJSON
(
$
(
'
#jsonElement
'
).
val
());
}
else
if
(
m
.
useStringParameter
)
{
data
=
$
(
'
#string
'
).
val
();
}
Describe
.
doPut
(
address
,
m
,
data
);
break
;
...
...
o2server/x_query_core_express/src/main/java/com/x/query/core/express/plan/FilterEntry.java
浏览文件 @
e468ff2f
...
...
@@ -27,6 +27,10 @@ public class FilterEntry extends GsonPropertyObject {
public
static
final
String
FORMAT_DATETIMEVALUE
=
"dateTimeValue"
;
public
static
final
String
FORMAT_DATEVALUE
=
"dateValue"
;
public
static
final
String
FORMAT_TIMEVALUE
=
"timeValue"
;
public
static
final
String
DEFINE_TIME
=
"@time"
;
public
static
final
String
DEFINE_DATE
=
"@date"
;
...
...
@@ -83,13 +87,37 @@ public class FilterEntry extends GsonPropertyObject {
return
true
;
}
case
FORMAT_DATETIMEVALUE:
if
(
DateTools
.
isDateTimeOrDateOrTime
(
value
))
{
if
(
DateTools
.
isDateTimeOrDateOrTime
(
value
)
||
StringUtils
.
equalsIgnoreCase
(
DEFINE_TIME
,
value
)
||
StringUtils
.
equalsIgnoreCase
(
DEFINE_DATE
,
value
)
||
StringUtils
.
equalsIgnoreCase
(
DEFINE_MONTH
,
value
)
||
StringUtils
.
equalsIgnoreCase
(
DEFINE_SEASON
,
value
)
||
StringUtils
.
equalsIgnoreCase
(
DEFINE_YEAR
,
value
))
{
return
true
;
}
else
{
return
false
;
}
case
FORMAT_DATEVALUE:
if
(
DateTools
.
isDateTimeOrDateOrTime
(
value
)
||
StringUtils
.
equalsIgnoreCase
(
DEFINE_TIME
,
value
)
||
StringUtils
.
equalsIgnoreCase
(
DEFINE_DATE
,
value
)
||
StringUtils
.
equalsIgnoreCase
(
DEFINE_MONTH
,
value
)
||
StringUtils
.
equalsIgnoreCase
(
DEFINE_SEASON
,
value
)
||
StringUtils
.
equalsIgnoreCase
(
DEFINE_YEAR
,
value
))
{
return
true
;
}
else
{
return
false
;
}
case
FORMAT_TIMEVALUE:
if
(
DateTools
.
isDateTimeOrDateOrTime
(
value
)
||
StringUtils
.
equalsIgnoreCase
(
DEFINE_TIME
,
value
)
||
StringUtils
.
equalsIgnoreCase
(
DEFINE_DATE
,
value
)
||
StringUtils
.
equalsIgnoreCase
(
DEFINE_MONTH
,
value
)
||
StringUtils
.
equalsIgnoreCase
(
DEFINE_SEASON
,
value
)
||
StringUtils
.
equalsIgnoreCase
(
DEFINE_YEAR
,
value
))
{
return
true
;
}
else
{
return
false
;
}
case
FORMAT_NUMBERVALUE:
if
(
NumberUtils
.
is
Number
(
value
))
{
if
(
NumberUtils
.
is
Creatable
(
value
))
{
return
true
;
}
else
{
return
false
;
...
...
@@ -179,82 +207,47 @@ public class FilterEntry extends GsonPropertyObject {
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Item_
.
numberValue
),
doubleValue
));
}
}
}
else
if
(
StringUtils
.
equals
(
this
.
formatType
,
FORMAT_DATE
TIME
VALUE
))
{
/*
时间
值比较 */
}
else
if
(
StringUtils
.
equals
(
this
.
formatType
,
FORMAT_DATEVALUE
))
{
/*
日期
值比较 */
if
(
StringUtils
.
isNotEmpty
(
compareValue
))
{
Date
value
=
null
;
Date
otherValue
=
null
;
if
(
DateTools
.
isDateTime
(
compareValue
))
{
Date
dateTimeValue
=
DateTools
.
parseDateTime
(
compareValue
);
if
(
Comparison
.
isNotEquals
(
this
.
comparison
))
{
/** 不等于返回等于值,在外部运算 */
p
=
cb
.
and
(
p
,
cb
.
or
(
cb
.
isNull
(
root
.
get
(
Item_
.
dateTimeValue
)),
cb
.
equal
(
root
.
get
(
Item_
.
dateTimeValue
),
dateTimeValue
)));
}
else
if
(
Comparison
.
isGreaterThan
(
this
.
comparison
))
{
p
=
cb
.
and
(
p
,
cb
.
greaterThan
(
root
.
get
(
Item_
.
dateTimeValue
),
dateTimeValue
));
}
else
if
(
Comparison
.
isGreaterThanOrEqualTo
(
this
.
comparison
))
{
p
=
cb
.
and
(
p
,
cb
.
greaterThanOrEqualTo
(
root
.
get
(
Item_
.
dateTimeValue
),
dateTimeValue
));
}
else
if
(
Comparison
.
isLessThan
(
this
.
comparison
))
{
p
=
cb
.
and
(
p
,
cb
.
lessThan
(
root
.
get
(
Item_
.
dateTimeValue
),
dateTimeValue
));
}
else
if
(
Comparison
.
isLessThanOrEqualTo
(
this
.
comparison
))
{
p
=
cb
.
and
(
p
,
cb
.
lessThanOrEqualTo
(
root
.
get
(
Item_
.
dateTimeValue
),
dateTimeValue
));
}
else
if
(
Comparison
.
isBetween
(
this
.
comparison
))
{
if
(
StringUtils
.
isNotEmpty
(
compareOtherValue
)
&&
DateTools
.
isDateTime
(
compareOtherValue
))
{
Date
dateTimeOtherValue
=
DateTools
.
parseDateTime
(
compareOtherValue
);
if
(
null
!=
dateTimeOtherValue
)
{
p
=
cb
.
and
(
p
,
cb
.
between
(
root
.
get
(
Item_
.
dateTimeValue
),
dateTimeValue
,
dateTimeOtherValue
));
}
}
}
else
{
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Item_
.
dateTimeValue
),
dateTimeValue
));
}
value
=
DateTools
.
parseDateTime
(
compareValue
);
}
else
if
(
DateTools
.
isDate
(
compareValue
))
{
Date
dateValue
=
DateTools
.
parseDate
(
compareValue
);
value
=
DateTools
.
parseDate
(
compareValue
);
}
if
(
DateTools
.
isDateTime
(
compareOtherValue
))
{
otherValue
=
DateTools
.
parseDateTime
(
compareOtherValue
);
}
else
if
(
DateTools
.
isDate
(
compareOtherValue
))
{
otherValue
=
DateTools
.
parseDate
(
compareOtherValue
);
}
if
(
null
!=
otherValue
)
{
otherValue
=
DateTools
.
ceilDate
(
otherValue
,
0
);
}
if
(
null
!=
value
)
{
value
=
DateTools
.
ceilDate
(
value
,
0
);
if
(
Comparison
.
isNotEquals
(
this
.
comparison
))
{
/** 不等于返回等于值,在外部运算 */
p
=
cb
.
and
(
p
,
cb
.
or
(
cb
.
isNull
(
root
.
get
(
Item_
.
dateValue
)),
cb
.
equal
(
root
.
get
(
Item_
.
dateValue
),
dateV
alue
)));
cb
.
equal
(
root
.
get
(
Item_
.
dateValue
),
v
alue
)));
}
else
if
(
Comparison
.
isGreaterThan
(
this
.
comparison
))
{
p
=
cb
.
and
(
p
,
cb
.
greaterThan
(
root
.
get
(
Item_
.
dateValue
),
dateV
alue
));
p
=
cb
.
and
(
p
,
cb
.
greaterThan
(
root
.
get
(
Item_
.
dateValue
),
v
alue
));
}
else
if
(
Comparison
.
isGreaterThanOrEqualTo
(
this
.
comparison
))
{
p
=
cb
.
and
(
p
,
cb
.
greaterThanOrEqualTo
(
root
.
get
(
Item_
.
dateValue
),
dateV
alue
));
p
=
cb
.
and
(
p
,
cb
.
greaterThanOrEqualTo
(
root
.
get
(
Item_
.
dateValue
),
v
alue
));
}
else
if
(
Comparison
.
isLessThan
(
this
.
comparison
))
{
p
=
cb
.
and
(
p
,
cb
.
lessThan
(
root
.
get
(
Item_
.
dateValue
),
dateV
alue
));
p
=
cb
.
and
(
p
,
cb
.
lessThan
(
root
.
get
(
Item_
.
dateValue
),
v
alue
));
}
else
if
(
Comparison
.
isLessThanOrEqualTo
(
this
.
comparison
))
{
p
=
cb
.
and
(
p
,
cb
.
lessThanOrEqualTo
(
root
.
get
(
Item_
.
dateValue
),
dateV
alue
));
p
=
cb
.
and
(
p
,
cb
.
lessThanOrEqualTo
(
root
.
get
(
Item_
.
dateValue
),
v
alue
));
}
else
if
(
Comparison
.
isBetween
(
this
.
comparison
))
{
if
(
StringUtils
.
isNotEmpty
(
compareOtherValue
)
&&
DateTools
.
isDate
(
compareOtherValue
))
{
Date
dateOtherValue
=
DateTools
.
parseDate
(
compareOtherValue
);
if
(
null
!=
dateOtherValue
)
{
p
=
cb
.
and
(
p
,
cb
.
between
(
root
.
get
(
Item_
.
dateTimeValue
),
dateValue
,
dateOtherValue
));
}
if
(
null
!=
otherValue
)
{
p
=
cb
.
and
(
p
,
cb
.
between
(
root
.
get
(
Item_
.
dateValue
),
value
,
otherValue
));
}
else
{
throw
new
Exception
(
"unkown comparison:"
+
this
.
comparison
);
}
}
else
{
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Item_
.
dateValue
),
value
));
}
}
else
if
(
DateTools
.
isTime
(
compareValue
))
{
Date
timeValue
=
DateTools
.
parseTime
(
compareValue
);
if
(
Comparison
.
isNotEquals
(
this
.
comparison
))
{
/** 不等于返回等于值,在外部运算 */
p
=
cb
.
and
(
p
,
cb
.
or
(
cb
.
isNull
(
root
.
get
(
Item_
.
timeValue
)),
cb
.
equal
(
root
.
get
(
Item_
.
timeValue
),
timeValue
)));
}
else
if
(
Comparison
.
isGreaterThan
(
this
.
comparison
))
{
p
=
cb
.
and
(
p
,
cb
.
greaterThan
(
root
.
get
(
Item_
.
timeValue
),
timeValue
));
}
else
if
(
Comparison
.
isGreaterThanOrEqualTo
(
this
.
comparison
))
{
p
=
cb
.
and
(
p
,
cb
.
greaterThanOrEqualTo
(
root
.
get
(
Item_
.
timeValue
),
timeValue
));
}
else
if
(
Comparison
.
isLessThan
(
this
.
comparison
))
{
p
=
cb
.
and
(
p
,
cb
.
lessThan
(
root
.
get
(
Item_
.
timeValue
),
timeValue
));
}
else
if
(
Comparison
.
isLessThanOrEqualTo
(
this
.
comparison
))
{
p
=
cb
.
and
(
p
,
cb
.
lessThanOrEqualTo
(
root
.
get
(
Item_
.
timeValue
),
timeValue
));
}
else
if
(
Comparison
.
isBetween
(
this
.
comparison
))
{
if
(
StringUtils
.
isNotEmpty
(
compareOtherValue
)
&&
DateTools
.
isTime
(
compareOtherValue
))
{
Date
timeOtherValue
=
DateTools
.
parseTime
(
compareOtherValue
);
if
(
null
!=
timeOtherValue
)
{
p
=
cb
.
and
(
p
,
cb
.
between
(
root
.
get
(
Item_
.
dateTimeValue
),
timeValue
,
timeOtherValue
));
}
}
}
else
{
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Item_
.
timeValue
),
value
));
}
}
else
if
(
StringUtils
.
equals
(
compareValue
,
DEFINE_DATE
)
||
StringUtils
.
equals
(
compareValue
,
DEFINE_MONTH
)
||
StringUtils
.
equals
(
compareValue
,
DEFINE_SEASON
)
...
...
@@ -276,33 +269,89 @@ public class FilterEntry extends GsonPropertyObject {
}
if
(
Comparison
.
isNotEquals
(
this
.
comparison
))
{
/** 不等于返回等于值,在外部运算 */
p
=
cb
.
and
(
p
,
cb
.
or
(
cb
.
isNull
(
root
.
get
(
Item_
.
date
Time
Value
)),
cb
.
between
(
root
.
get
(
Item_
.
date
Time
Value
),
floor
,
ceil
)));
p
=
cb
.
and
(
p
,
cb
.
or
(
cb
.
isNull
(
root
.
get
(
Item_
.
dateValue
)),
cb
.
between
(
root
.
get
(
Item_
.
dateValue
),
floor
,
ceil
)));
}
else
if
(
Comparison
.
isGreaterThan
(
this
.
comparison
))
{
p
=
cb
.
and
(
p
,
cb
.
greaterThan
(
root
.
get
(
Item_
.
date
Time
Value
),
ceil
));
p
=
cb
.
and
(
p
,
cb
.
greaterThan
(
root
.
get
(
Item_
.
dateValue
),
ceil
));
}
else
if
(
Comparison
.
isGreaterThanOrEqualTo
(
this
.
comparison
))
{
p
=
cb
.
and
(
p
,
cb
.
greaterThanOrEqualTo
(
root
.
get
(
Item_
.
date
Time
Value
),
floor
));
p
=
cb
.
and
(
p
,
cb
.
greaterThanOrEqualTo
(
root
.
get
(
Item_
.
dateValue
),
floor
));
}
else
if
(
Comparison
.
isLessThan
(
this
.
comparison
))
{
p
=
cb
.
and
(
p
,
cb
.
lessThan
(
root
.
get
(
Item_
.
date
Time
Value
),
floor
));
p
=
cb
.
and
(
p
,
cb
.
lessThan
(
root
.
get
(
Item_
.
dateValue
),
floor
));
}
else
if
(
Comparison
.
isLessThanOrEqualTo
(
this
.
comparison
))
{
p
=
cb
.
and
(
p
,
cb
.
lessThanOrEqualTo
(
root
.
get
(
Item_
.
date
Time
Value
),
ceil
));
p
=
cb
.
and
(
p
,
cb
.
lessThanOrEqualTo
(
root
.
get
(
Item_
.
dateValue
),
ceil
));
}
else
if
(
Comparison
.
isBetween
(
this
.
comparison
))
{
p
=
cb
.
and
(
p
,
cb
.
between
(
root
.
get
(
Item_
.
dateTimeValue
),
floor
,
ceil
)
);
// throw new Exception("unkown comparison:" + this.comparison
);
}
else
{
throw
new
Exception
(
"unkown comparison:"
+
this
.
comparison
);
}
}
else
if
(
StringUtils
.
equals
(
compareValue
,
DEFINE_TIME
))
{
if
(
Comparison
.
isNotEquals
(
this
.
comparison
))
{
/** 不等于返回等于值,在外部运算 */
p
=
cb
.
and
(
p
,
cb
.
or
(
cb
.
isNull
(
root
.
get
(
Item_
.
dateValue
)),
cb
.
equal
(
root
.
get
(
Item_
.
dateValue
),
new
Date
())));
}
else
if
(
Comparison
.
isGreaterThan
(
this
.
comparison
))
{
p
=
cb
.
and
(
p
,
cb
.
greaterThan
(
root
.
get
(
Item_
.
dateValue
),
new
Date
()));
}
else
if
(
Comparison
.
isGreaterThanOrEqualTo
(
this
.
comparison
))
{
p
=
cb
.
and
(
p
,
cb
.
greaterThanOrEqualTo
(
root
.
get
(
Item_
.
dateValue
),
new
Date
()));
}
else
if
(
Comparison
.
isLessThan
(
this
.
comparison
))
{
p
=
cb
.
and
(
p
,
cb
.
lessThan
(
root
.
get
(
Item_
.
dateValue
),
new
Date
()));
}
else
if
(
Comparison
.
isLessThanOrEqualTo
(
this
.
comparison
))
{
p
=
cb
.
and
(
p
,
cb
.
lessThanOrEqualTo
(
root
.
get
(
Item_
.
dateValue
),
new
Date
()));
}
else
if
(
Comparison
.
isBetween
(
this
.
comparison
))
{
// throw new Exception("unkown comparison:" + this.comparison);
}
else
{
throw
new
Exception
(
"unkown comparison:"
+
this
.
comparison
);
}
}
}
}
else
if
(
StringUtils
.
equals
(
this
.
formatType
,
FORMAT_TIMEVALUE
))
{
/* 时间值比较 */
if
(
StringUtils
.
isNotEmpty
(
compareValue
))
{
Date
value
=
null
;
Date
otherValue
=
null
;
if
(
DateTools
.
isDateTime
(
compareValue
))
{
value
=
DateTools
.
parseDateTime
(
compareValue
);
}
else
if
(
DateTools
.
isTime
(
compareValue
))
{
value
=
DateTools
.
parseTime
(
compareValue
);
}
if
(
DateTools
.
isDateTime
(
compareOtherValue
))
{
otherValue
=
DateTools
.
parseDateTime
(
compareOtherValue
);
}
else
if
(
DateTools
.
isTime
(
compareOtherValue
))
{
otherValue
=
DateTools
.
parseTime
(
compareOtherValue
);
}
if
(
null
!=
value
)
{
if
(
Comparison
.
isNotEquals
(
this
.
comparison
))
{
/** 不等于返回等于值,在外部运算 */
p
=
cb
.
and
(
p
,
cb
.
or
(
cb
.
isNull
(
root
.
get
(
Item_
.
timeValue
)),
cb
.
equal
(
root
.
get
(
Item_
.
timeValue
),
value
)));
}
else
if
(
Comparison
.
isGreaterThan
(
this
.
comparison
))
{
p
=
cb
.
and
(
p
,
cb
.
greaterThan
(
root
.
get
(
Item_
.
timeValue
),
value
));
}
else
if
(
Comparison
.
isGreaterThanOrEqualTo
(
this
.
comparison
))
{
p
=
cb
.
and
(
p
,
cb
.
greaterThanOrEqualTo
(
root
.
get
(
Item_
.
timeValue
),
value
));
}
else
if
(
Comparison
.
isLessThan
(
this
.
comparison
))
{
p
=
cb
.
and
(
p
,
cb
.
lessThan
(
root
.
get
(
Item_
.
timeValue
),
value
));
}
else
if
(
Comparison
.
isLessThanOrEqualTo
(
this
.
comparison
))
{
p
=
cb
.
and
(
p
,
cb
.
lessThanOrEqualTo
(
root
.
get
(
Item_
.
timeValue
),
value
));
}
else
if
(
Comparison
.
isBetween
(
this
.
comparison
))
{
if
(
null
!=
otherValue
)
{
p
=
cb
.
and
(
p
,
cb
.
between
(
root
.
get
(
Item_
.
timeValue
),
value
,
otherValue
));
}
}
else
{
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Item_
.
timeValue
),
value
));
}
}
else
if
(
StringUtils
.
equals
(
compareValue
,
DEFINE_TIME
))
{
if
(
Comparison
.
isNotEquals
(
this
.
comparison
))
{
/** 不等于返回等于值,在外部运算 */
p
=
cb
.
and
(
p
,
cb
.
or
(
cb
.
isNull
(
root
.
get
(
Item_
.
timeValue
)),
cb
.
equal
(
root
.
get
(
Item_
.
timeValue
),
new
Date
())));
}
else
if
(
Comparison
.
isGreaterThan
(
this
.
comparison
))
{
p
=
cb
.
and
(
p
,
cb
.
greaterThan
(
root
.
get
(
Item_
.
dateT
imeValue
),
new
Date
()));
p
=
cb
.
and
(
p
,
cb
.
greaterThan
(
root
.
get
(
Item_
.
t
imeValue
),
new
Date
()));
}
else
if
(
Comparison
.
isGreaterThanOrEqualTo
(
this
.
comparison
))
{
p
=
cb
.
and
(
p
,
cb
.
greaterThanOrEqualTo
(
root
.
get
(
Item_
.
dateT
imeValue
),
new
Date
()));
p
=
cb
.
and
(
p
,
cb
.
greaterThanOrEqualTo
(
root
.
get
(
Item_
.
t
imeValue
),
new
Date
()));
}
else
if
(
Comparison
.
isLessThan
(
this
.
comparison
))
{
p
=
cb
.
and
(
p
,
cb
.
lessThan
(
root
.
get
(
Item_
.
dateT
imeValue
),
new
Date
()));
p
=
cb
.
and
(
p
,
cb
.
lessThan
(
root
.
get
(
Item_
.
t
imeValue
),
new
Date
()));
}
else
if
(
Comparison
.
isLessThanOrEqualTo
(
this
.
comparison
))
{
p
=
cb
.
and
(
p
,
cb
.
lessThanOrEqualTo
(
root
.
get
(
Item_
.
dateT
imeValue
),
new
Date
()));
p
=
cb
.
and
(
p
,
cb
.
lessThanOrEqualTo
(
root
.
get
(
Item_
.
t
imeValue
),
new
Date
()));
}
else
if
(
Comparison
.
isBetween
(
this
.
comparison
))
{
throw
new
Exception
(
"unkown comparison:"
+
this
.
comparison
);
}
else
{
...
...
@@ -310,6 +359,95 @@ public class FilterEntry extends GsonPropertyObject {
}
}
}
}
else
if
(
StringUtils
.
equals
(
this
.
formatType
,
FORMAT_DATETIMEVALUE
))
{
Date
value
=
null
;
Date
otherValue
=
null
;
if
(
DateTools
.
isDateTime
(
compareValue
))
{
value
=
DateTools
.
parseDateTime
(
compareValue
);
}
else
if
(
DateTools
.
isDate
(
compareValue
))
{
value
=
DateTools
.
parseDate
(
compareValue
);
}
if
(
DateTools
.
isDateTime
(
compareOtherValue
))
{
otherValue
=
DateTools
.
parseDateTime
(
compareOtherValue
);
}
else
if
(
DateTools
.
isDate
(
compareOtherValue
))
{
otherValue
=
DateTools
.
parseDate
(
compareOtherValue
);
}
if
(
null
!=
value
)
{
if
(
Comparison
.
isNotEquals
(
this
.
comparison
))
{
/** 不等于返回等于值,在外部运算 */
p
=
cb
.
and
(
p
,
cb
.
or
(
cb
.
isNull
(
root
.
get
(
Item_
.
dateTimeValue
)),
cb
.
equal
(
root
.
get
(
Item_
.
dateTimeValue
),
value
)));
}
else
if
(
Comparison
.
isGreaterThan
(
this
.
comparison
))
{
p
=
cb
.
and
(
p
,
cb
.
greaterThan
(
root
.
get
(
Item_
.
dateTimeValue
),
value
));
}
else
if
(
Comparison
.
isGreaterThanOrEqualTo
(
this
.
comparison
))
{
p
=
cb
.
and
(
p
,
cb
.
greaterThanOrEqualTo
(
root
.
get
(
Item_
.
dateTimeValue
),
value
));
}
else
if
(
Comparison
.
isLessThan
(
this
.
comparison
))
{
p
=
cb
.
and
(
p
,
cb
.
lessThan
(
root
.
get
(
Item_
.
dateTimeValue
),
value
));
}
else
if
(
Comparison
.
isLessThanOrEqualTo
(
this
.
comparison
))
{
p
=
cb
.
and
(
p
,
cb
.
lessThanOrEqualTo
(
root
.
get
(
Item_
.
dateTimeValue
),
value
));
}
else
if
(
Comparison
.
isBetween
(
this
.
comparison
))
{
if
(
null
!=
otherValue
)
{
p
=
cb
.
and
(
p
,
cb
.
between
(
root
.
get
(
Item_
.
dateTimeValue
),
value
,
otherValue
));
}
else
{
throw
new
Exception
(
"unkown comparison:"
+
this
.
comparison
);
}
}
else
{
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Item_
.
dateTimeValue
),
value
));
}
}
else
if
(
StringUtils
.
equals
(
compareValue
,
DEFINE_DATE
)
||
StringUtils
.
equals
(
compareValue
,
DEFINE_MONTH
)
||
StringUtils
.
equals
(
compareValue
,
DEFINE_SEASON
)
||
StringUtils
.
equals
(
compareValue
,
DEFINE_YEAR
))
{
Date
floor
=
null
;
Date
ceil
=
null
;
if
(
StringUtils
.
equals
(
compareValue
,
DEFINE_DATE
))
{
floor
=
DateTools
.
floorDate
(
new
Date
(),
0
);
ceil
=
DateTools
.
ceilDate
(
new
Date
(),
0
);
}
else
if
(
StringUtils
.
equals
(
compareValue
,
DEFINE_MONTH
))
{
floor
=
DateTools
.
floorMonth
(
new
Date
(),
0
);
ceil
=
DateTools
.
ceilMonth
(
new
Date
(),
0
);
}
else
if
(
StringUtils
.
equals
(
compareValue
,
DEFINE_SEASON
))
{
floor
=
DateTools
.
floorSeason
(
new
Date
(),
0
);
ceil
=
DateTools
.
ceilSeason
(
new
Date
(),
0
);
}
else
{
floor
=
DateTools
.
floorYear
(
new
Date
(),
0
);
ceil
=
DateTools
.
ceilYear
(
new
Date
(),
0
);
}
if
(
Comparison
.
isNotEquals
(
this
.
comparison
))
{
/** 不等于返回等于值,在外部运算 */
p
=
cb
.
and
(
p
,
cb
.
or
(
cb
.
isNull
(
root
.
get
(
Item_
.
dateTimeValue
)),
cb
.
between
(
root
.
get
(
Item_
.
dateTimeValue
),
floor
,
ceil
)));
}
else
if
(
Comparison
.
isGreaterThan
(
this
.
comparison
))
{
p
=
cb
.
and
(
p
,
cb
.
greaterThan
(
root
.
get
(
Item_
.
dateTimeValue
),
ceil
));
}
else
if
(
Comparison
.
isGreaterThanOrEqualTo
(
this
.
comparison
))
{
p
=
cb
.
and
(
p
,
cb
.
greaterThanOrEqualTo
(
root
.
get
(
Item_
.
dateTimeValue
),
floor
));
}
else
if
(
Comparison
.
isLessThan
(
this
.
comparison
))
{
p
=
cb
.
and
(
p
,
cb
.
lessThan
(
root
.
get
(
Item_
.
dateTimeValue
),
floor
));
}
else
if
(
Comparison
.
isLessThanOrEqualTo
(
this
.
comparison
))
{
p
=
cb
.
and
(
p
,
cb
.
lessThanOrEqualTo
(
root
.
get
(
Item_
.
dateTimeValue
),
ceil
));
}
else
if
(
Comparison
.
isBetween
(
this
.
comparison
))
{
// p = cb.and(p, cb.between(root.get(Item_.dateTimeValue), floor, ceil));
}
else
{
throw
new
Exception
(
"unkown comparison:"
+
this
.
comparison
);
}
}
else
if
(
StringUtils
.
equals
(
compareValue
,
DEFINE_TIME
))
{
if
(
Comparison
.
isNotEquals
(
this
.
comparison
))
{
/** 不等于返回等于值,在外部运算 */
p
=
cb
.
and
(
p
,
cb
.
or
(
cb
.
isNull
(
root
.
get
(
Item_
.
dateTimeValue
)),
cb
.
equal
(
root
.
get
(
Item_
.
dateTimeValue
),
new
Date
())));
}
else
if
(
Comparison
.
isGreaterThan
(
this
.
comparison
))
{
p
=
cb
.
and
(
p
,
cb
.
greaterThan
(
root
.
get
(
Item_
.
dateTimeValue
),
new
Date
()));
}
else
if
(
Comparison
.
isGreaterThanOrEqualTo
(
this
.
comparison
))
{
p
=
cb
.
and
(
p
,
cb
.
greaterThanOrEqualTo
(
root
.
get
(
Item_
.
dateTimeValue
),
new
Date
()));
}
else
if
(
Comparison
.
isLessThan
(
this
.
comparison
))
{
p
=
cb
.
and
(
p
,
cb
.
lessThan
(
root
.
get
(
Item_
.
dateTimeValue
),
new
Date
()));
}
else
if
(
Comparison
.
isLessThanOrEqualTo
(
this
.
comparison
))
{
p
=
cb
.
and
(
p
,
cb
.
lessThanOrEqualTo
(
root
.
get
(
Item_
.
dateTimeValue
),
new
Date
()));
}
else
if
(
Comparison
.
isBetween
(
this
.
comparison
))
{
throw
new
Exception
(
"unkown comparison:"
+
this
.
comparison
);
}
else
{
throw
new
Exception
(
"unkown comparison:"
+
this
.
comparison
);
}
}
}
else
{
/* TEXT 内容值 */
if
(
StringUtils
.
equals
(
compareValue
,
DEFINE_PERSON
))
{
...
...
o2server/x_query_service_processing/src/main/java/com/x/query/service/processing/jaxrs/neural/Learn.java
浏览文件 @
e468ff2f
...
...
@@ -307,13 +307,7 @@ public class Learn {
}
return
count
;
}
// private void saveNeuralNetwork(NeuralNetwork<MomentumBackpropagation> neuralNetwork, model model,
// String surffix) throws Exception {
// File file = new File(Config.base(), "local/temp/" + model.getName() + "_" + surffix + ".nnet");
// neuralNetwork.save(file.getAbsolutePath());
// }
private
void
saveDataSet
(
DataSet
dataSet
,
Model
model
,
String
surffix
)
throws
Exception
{
File
file
=
new
File
(
Config
.
base
(),
"local/temp/"
+
model
.
getName
()
+
"_"
+
surffix
+
".txt"
);
dataSet
.
save
(
file
.
getAbsolutePath
());
...
...
o2server/x_query_service_processing/src/main/webapp/jest/describe.js
浏览文件 @
e468ff2f
var
Describe
=
function
()
{
//
20180730
//
20180730
}
Describe
.
splitValue
=
function
(
str
)
{
...
...
@@ -38,7 +38,7 @@ Describe.doPost = function(address, m, data) {
xhrFields
:
{
'
withCredentials
'
:
true
},
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
?
JSON
.
stringify
(
data
)
:
data
)
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
&&
(
!
m
.
useStringParameter
)
?
JSON
.
stringify
(
data
)
:
data
)
}).
always
(
function
(
resultJson
)
{
$
(
'
#result
'
).
html
(
JSON
.
stringify
(
resultJson
,
null
,
4
));
Describe
.
writeOut
(
m
.
outs
,
resultJson
);
...
...
@@ -55,7 +55,7 @@ Describe.doPost = function(address, m, data) {
xhrFields
:
{
'
withCredentials
'
:
true
},
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
?
JSON
.
stringify
(
data
)
:
data
)
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
&&
(
!
m
.
useStringParameter
)
?
JSON
.
stringify
(
data
)
:
data
)
});
}
}
...
...
@@ -74,7 +74,7 @@ Describe.doPut = function(address, m, data) {
xhrFields
:
{
'
withCredentials
'
:
true
},
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
?
JSON
.
stringify
(
data
)
:
data
)
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
&&
(
!
m
.
useStringParameter
)
?
JSON
.
stringify
(
data
)
:
data
)
}).
always
(
function
(
resultJson
)
{
$
(
'
#result
'
).
html
(
JSON
.
stringify
(
resultJson
,
null
,
4
));
Describe
.
writeOut
(
m
.
outs
,
resultJson
);
...
...
@@ -91,7 +91,7 @@ Describe.doPut = function(address, m, data) {
xhrFields
:
{
'
withCredentials
'
:
true
},
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
?
JSON
.
stringify
(
data
)
:
data
)
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
&&
(
!
m
.
useStringParameter
)
?
JSON
.
stringify
(
data
)
:
data
)
});
}
}
...
...
@@ -269,6 +269,14 @@ Describe.prototype = {
txt
+=
'
</table>
'
;
txt
+=
'
</fieldset>
'
;
}
if
(
m
.
useStringParameter
)
{
txt
+=
'
<fieldset><legend>String</legend>
'
;
txt
+=
'
<table><tr><td>
'
;
txt
+=
'
<textarea id="string" style="height:300px; width:600px; padding:1px; border:1px #000000 solid"/>
'
;
txt
+=
'
</td><td>string</td></tr>
'
;
txt
+=
'
</table>
'
;
txt
+=
'
</fieldset>
'
;
}
if
(
m
.
outs
&&
m
.
outs
.
length
>
0
)
{
txt
+=
'
<fieldset id="outs"><legend>Out</legend>
'
;
txt
+=
'
<table>
'
;
...
...
@@ -318,6 +326,8 @@ Describe.prototype = {
});
}
else
if
(
m
.
useJsonElementParameter
)
{
data
=
$
.
parseJSON
(
$
(
'
#jsonElement
'
).
val
());
}
else
if
(
m
.
useStringParameter
)
{
data
=
$
(
'
#string
'
).
val
();
}
Describe
.
doPost
(
address
,
m
,
data
);
break
;
...
...
@@ -340,6 +350,8 @@ Describe.prototype = {
});
}
else
if
(
m
.
useJsonElementParameter
)
{
data
=
$
.
parseJSON
(
$
(
'
#jsonElement
'
).
val
());
}
else
if
(
m
.
useStringParameter
)
{
data
=
$
(
'
#string
'
).
val
();
}
Describe
.
doPut
(
address
,
m
,
data
);
break
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录