Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzdst
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzdst
提交
21ab1409
提交
21ab1409
编写于
12月 13, 2020
作者:
sq3536
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
reset
上级
019d0297
变更
15
展开全部
隐藏空白字符变更
内嵌
并排
正在显示
15 个修改的文件
包含
55 行增加
和
1347 行删除
+55
-1347
BaseEntity.java
...in/java/cn/ibizlab/core/extensions/domain/BaseEntity.java
+0
-600
BaseEntityList.java
...ava/cn/ibizlab/core/extensions/domain/BaseEntityList.java
+0
-140
BaseField.java
...ain/java/cn/ibizlab/core/extensions/domain/BaseField.java
+0
-207
BaseFieldList.java
...java/cn/ibizlab/core/extensions/domain/BaseFieldList.java
+0
-245
DSTEntityModel.java
...ava/cn/ibizlab/core/extensions/domain/DSTEntityModel.java
+0
-23
DSTLookupModel.java
...ava/cn/ibizlab/core/extensions/domain/DSTLookupModel.java
+0
-15
IEntity.java
.../main/java/cn/ibizlab/core/extensions/domain/IEntity.java
+0
-42
IField.java
...c/main/java/cn/ibizlab/core/extensions/domain/IField.java
+0
-35
BaseEntityService.java
...cn/ibizlab/core/extensions/service/BaseEntityService.java
+7
-10
RuleItemExService.java
...cn/ibizlab/core/extensions/service/RuleItemExService.java
+2
-2
IEntityActionHelper.java
.../cn/ibizlab/core/extensions/util/IEntityActionHelper.java
+0
-13
EntityObj.java
...ava/cn/ibizlab/core/lite/extensions/domain/EntityObj.java
+5
-1
ModelObj.java
...java/cn/ibizlab/core/lite/extensions/domain/ModelObj.java
+28
-0
DataModel.java
...java/cn/ibizlab/core/lite/extensions/model/DataModel.java
+3
-3
DSTRule.drl.ftl
ibzdst-core/src/main/resources/ftl/DSTRule.drl.ftl
+10
-11
未找到文件。
ibzdst-core/src/main/java/cn/ibizlab/core/extensions/domain/BaseEntity.java
已删除
100644 → 0
浏览文件 @
019d0297
此差异已折叠。
点击以展开。
ibzdst-core/src/main/java/cn/ibizlab/core/extensions/domain/BaseEntityList.java
已删除
100644 → 0
浏览文件 @
019d0297
package
cn
.
ibizlab
.
core
.
extensions
.
domain
;
import
cn.ibizlab.core.extensions.util.IEntityActionHelper
;
import
com.fasterxml.jackson.annotation.JsonIgnoreProperties
;
import
lombok.Data
;
import
org.springframework.util.StringUtils
;
import
java.math.BigDecimal
;
import
java.math.BigInteger
;
import
java.util.ArrayList
;
import
java.util.List
;
@JsonIgnoreProperties
(
ignoreUnknown
=
true
)
@Data
public
class
BaseEntityList
extends
ArrayList
<
BaseEntity
>
implements
IEntity
{
public
String
KEY
;
public
String
ENTITYNAME
;
private
BaseField
nullFiled
=
new
BaseField
();
private
BaseEntity
root
;
public
void
regesitAttr
(
String
key
,
BaseEntity
val
)
{
if
(
key
.
equalsIgnoreCase
(
"root"
)&&
root
==
null
)
root
=
val
;
}
@Override
public
IEntity
$E
(
String
key
)
{
return
new
BaseEntity
();
}
@Override
public
Object
get
(
Object
key
)
{
if
(
key
instanceof
Integer
)
return
super
.
get
((
int
)
key
);
BaseFieldList
list
=
new
BaseFieldList
();
for
(
BaseEntity
item:
this
)
{
Object
val
=
item
.
get
(
key
);
if
(
val
instanceof
BaseField
)
list
.
add
((
BaseField
)
val
);
}
if
(
list
.
size
()==
1
)
return
list
.
get
(
0
);
else
if
(
list
.
size
()==
0
)
return
nullFiled
;
else
return
list
;
}
@Override
public
IField
$
(
String
key
)
{
if
(
StringUtils
.
isEmpty
(
key
))
return
nullFiled
;
Object
obj
=
this
.
get
(
key
);
if
(
obj
instanceof
IField
)
{
IField
f
=
(
IField
)
obj
;
if
(
f
.
getValue
()!=
null
&&
key
.
indexOf
(
"."
)>
0
)
{
String
[]
arr
=
key
.
split
(
"[.]"
);
if
(
arr
.
length
>=
2
)
{
if
((!
StringUtils
.
isEmpty
(
arr
[
0
]))&&(!
StringUtils
.
isEmpty
(
arr
[
1
])))
{
f
.
setEntity
(
arr
[
0
]);
f
.
setField
(
arr
[
1
]);
}
}
}
return
f
;
}
else
return
nullFiled
;
}
@Override
public
Double
$D
(
String
key
)
{
IField
field
=
this
.
$
(
key
);
Object
val
=
field
.
getValue
();
if
(
field
instanceof
BaseFieldList
)
val
=((
BaseFieldList
)
field
).
get
(
0
);
if
(
val
==
null
)
return
0
d
;
else
if
((
val
instanceof
Integer
)||(
val
instanceof
Double
)||(
val
instanceof
Long
)||(
val
instanceof
BigDecimal
)||(
val
instanceof
BigInteger
)||(
val
instanceof
Float
))
return
(
double
)
val
;
return
1
d
;
}
@Override
public
boolean
IF
(
String
cond
)
{
return
test
(
cond
);
}
@Override
public
boolean
test
(
String
cond
)
{
{
for
(
BaseEntity
obj:
this
)
{
obj
.
setENTITYNAME
(
this
.
ENTITYNAME
);
if
(
obj
.
test
(
cond
))
return
true
;
}
return
false
;
}
}
private
IEntityActionHelper
iEntityActionHelper
=
null
;
@Override
public
void
setActionHelper
(
IEntityActionHelper
iEntityActionHelper
)
{
this
.
iEntityActionHelper
=
iEntityActionHelper
;
}
@Override
public
IEntityActionHelper
getActionHelper
()
{
if
(
this
.
iEntityActionHelper
==
null
)
{
return
null
;
}
return
this
.
iEntityActionHelper
;
}
@Override
public
List
<
BaseEntity
>
selectRow
(
String
dblink
,
String
sql
)
{
return
(
BaseEntityList
)
this
.
getActionHelper
().
select
(
dblink
,
sql
);
}
}
\ No newline at end of file
ibzdst-core/src/main/java/cn/ibizlab/core/extensions/domain/BaseField.java
已删除
100644 → 0
浏览文件 @
019d0297
package
cn
.
ibizlab
.
core
.
extensions
.
domain
;
import
cn.ibizlab.util.helper.RuleUtils
;
import
com.fasterxml.jackson.annotation.JsonIgnoreProperties
;
import
lombok.Data
;
import
org.springframework.util.ObjectUtils
;
import
java.io.BufferedReader
;
import
java.io.Reader
;
import
java.math.BigDecimal
;
import
java.math.BigInteger
;
@JsonIgnoreProperties
(
ignoreUnknown
=
true
)
@Data
public
class
BaseField
implements
IField
{
private
String
field
;
private
String
entity
;
private
Object
value
=
null
;
public
void
setValue
(
Object
value
)
{
if
(
value
instanceof
java
.
sql
.
Clob
)
{
// Clob类型 转String
BufferedReader
br
=
null
;
Reader
is
=
null
;
try
{
String
reString
=
""
;
is
=
((
java
.
sql
.
Clob
)
value
).
getCharacterStream
();
br
=
new
BufferedReader
(
is
);
String
s
=
br
.
readLine
();
StringBuffer
sb
=
new
StringBuffer
();
while
(
s
!=
null
)
{
sb
.
append
(
s
);
s
=
br
.
readLine
();
}
reString
=
sb
.
toString
();
this
.
value
=
reString
;
}
catch
(
Exception
ex
)
{
}
finally
{
try
{
if
(
br
!=
null
){
br
.
close
();
}
}
catch
(
Exception
ex
)
{}
try
{
if
(
is
!=
null
){
is
.
close
();
}
}
catch
(
Exception
ex
)
{}
}
}
else
this
.
value
=
value
;
}
public
Object
getValue
()
{
return
this
.
value
;
}
@Override
public
String
getCondValue
()
{
Object
val
=
getValue
();
if
(
ObjectUtils
.
isEmpty
(
val
))
return
"null"
;
String
str
=
""
;
if
((
val
instanceof
Integer
)||(
val
instanceof
Double
)||(
val
instanceof
Long
)||(
val
instanceof
BigDecimal
)||(
val
instanceof
BigInteger
)||(
val
instanceof
Float
))
str
=
val
.
toString
();
else
str
=
"'"
+
val
.
toString
()+
"'"
;
return
str
;
}
@Override
public
Object
getFecthValue
()
{
return
getValue
();
}
public
static
BaseField
from
(
Object
value
)
{
BaseField
field
=
new
BaseField
();
field
.
setValue
(
value
);
return
field
;
}
@Override
public
boolean
EQ
(
Object
val
)
{
return
RuleUtils
.
equal
(
val
,
this
.
value
);
}
@Override
public
boolean
NOTEQ
(
Object
val
)
{
return
!
RuleUtils
.
equal
(
val
,
this
.
value
);
}
@Override
public
boolean
GTANDEQ
(
Object
val
)
{
return
RuleUtils
.
ge
(
val
,
this
.
value
);
}
@Override
public
boolean
GT
(
Object
val
)
{
return
RuleUtils
.
gt
(
val
,
this
.
value
);
}
@Override
public
boolean
LTANDEQ
(
Object
val
)
{
return
RuleUtils
.
le
(
val
,
this
.
value
);
}
@Override
public
boolean
LT
(
Object
val
)
{
return
RuleUtils
.
lt
(
val
,
this
.
value
);
}
@Override
public
boolean
ISNULL
(
Object
val
)
{
return
RuleUtils
.
isNull
(
this
.
value
);
}
@Override
public
boolean
ISNOTNULL
(
Object
val
)
{
return
RuleUtils
.
isNotNull
(
this
.
value
);
}
@Override
public
boolean
LIKE
(
String
val
)
{
return
RuleUtils
.
matchor
(
val
,
this
.
value
);
}
@Override
public
boolean
LEFTLIKE
(
String
val
)
{
return
RuleUtils
.
leftmatchor
(
val
,
this
.
value
);
}
@Override
public
boolean
RIGHTLIKE
(
String
val
)
{
return
RuleUtils
.
rightmatchor
(
val
,
this
.
value
);
}
@Override
public
boolean
IN
(
String
val
)
{
return
RuleUtils
.
in
(
val
,
this
.
value
);
}
@Override
public
boolean
NOTIN
(
String
val
)
{
return
RuleUtils
.
notin
(
val
,
this
.
value
);
}
@Override
public
boolean
INC2S
(
String
val
)
{
return
RuleUtils
.
inc2s
(
val
,
this
.
value
);
}
@Override
public
boolean
NOTINC2S
(
String
val
)
{
return
RuleUtils
.
notinc2s
(
val
,
this
.
value
);
}
@Override
public
boolean
MATCHES
(
String
val
)
{
return
RuleUtils
.
matchand
(
val
,
this
.
value
);
}
@Override
public
String
toString
()
{
if
(
ObjectUtils
.
isEmpty
(
this
.
getValue
()))
return
""
;
else
return
this
.
getValue
().
toString
();
}
@Override
public
boolean
NOTLIKE
(
String
val
)
{
return
!
LIKE
(
val
);
}
@Override
public
boolean
LEFTNOTLIKE
(
String
val
)
{
return
!
LEFTLIKE
(
val
);
}
@Override
public
boolean
RIGHTNOTLIKE
(
String
val
)
{
return
!
RIGHTLIKE
(
val
);
}
@Override
public
boolean
NOTMATCHES
(
String
val
)
{
return
!
MATCHES
(
val
);
}
}
\ No newline at end of file
ibzdst-core/src/main/java/cn/ibizlab/core/extensions/domain/BaseFieldList.java
已删除
100644 → 0
浏览文件 @
019d0297
package
cn
.
ibizlab
.
core
.
extensions
.
domain
;
import
com.fasterxml.jackson.annotation.JsonIgnoreProperties
;
import
lombok.Data
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.StringUtils
;
import
java.math.BigDecimal
;
import
java.math.BigInteger
;
import
java.util.ArrayList
;
import
java.util.Hashtable
;
@JsonIgnoreProperties
(
ignoreUnknown
=
true
)
@Data
public
class
BaseFieldList
extends
ArrayList
<
BaseField
>
implements
IField
{
private
String
field
;
private
String
entity
;
public
Object
getValue
()
{
String
rt
=
""
;
Hashtable
<
Object
,
Integer
>
setcheck
=
new
Hashtable
<
Object
,
Integer
>();
if
(
this
.
size
()==
0
)
return
null
;
if
(
this
.
size
()==
1
)
return
this
.
get
(
0
).
getValue
();
Object
sObj
=
null
;
for
(
BaseField
obj:
this
)
{
Object
val
=
obj
.
getValue
();
if
(
ObjectUtils
.
isEmpty
(
val
))
continue
;
if
(
setcheck
.
containsKey
(
val
))
continue
;
else
setcheck
.
put
(
val
,
1
);
String
str
=
val
.
toString
();
sObj
=
val
;
if
(!
StringUtils
.
isEmpty
(
rt
))
rt
=
rt
+
","
;
rt
=
rt
+
str
;
}
if
(
StringUtils
.
isEmpty
(
rt
))
rt
=
null
;
if
(
setcheck
.
size
()==
1
)
return
sObj
;
return
rt
;
}
@Override
public
String
getCondValue
()
{
String
rt
=
""
;
Hashtable
<
Object
,
Integer
>
setcheck
=
new
Hashtable
<
Object
,
Integer
>();
for
(
BaseField
obj:
this
)
{
Object
val
=
obj
.
getValue
();
if
(
ObjectUtils
.
isEmpty
(
val
))
continue
;
if
(
setcheck
.
containsKey
(
val
))
continue
;
else
setcheck
.
put
(
val
,
1
);
String
str
=
""
;
if
((
val
instanceof
Integer
)||(
val
instanceof
Double
)||(
val
instanceof
Long
)||(
val
instanceof
BigDecimal
)||(
val
instanceof
BigInteger
)||(
val
instanceof
Float
))
str
=
val
.
toString
();
else
str
=
"'"
+
val
.
toString
()+
"'"
;
if
(!
StringUtils
.
isEmpty
(
rt
))
rt
=
rt
+
","
;
rt
=
rt
+
str
;
}
if
(
StringUtils
.
isEmpty
(
rt
))
rt
=
"null"
;
return
rt
;
}
@Override
public
Object
getFecthValue
()
{
return
null
;
}
@Override
public
boolean
EQ
(
Object
val
)
{
for
(
BaseField
obj:
this
)
if
(
obj
.
EQ
(
val
))
return
true
;
return
false
;
}
@Override
public
boolean
NOTEQ
(
Object
val
)
{
return
!
EQ
(
val
);
}
@Override
public
boolean
GTANDEQ
(
Object
val
)
{
for
(
BaseField
obj:
this
)
if
(
obj
.
GTANDEQ
(
val
))
return
true
;
return
false
;
}
@Override
public
boolean
GT
(
Object
val
)
{
for
(
BaseField
obj:
this
)
if
(
obj
.
GT
(
val
))
return
true
;
return
false
;
}
@Override
public
boolean
LTANDEQ
(
Object
val
)
{
for
(
BaseField
obj:
this
)
if
(
obj
.
LTANDEQ
(
val
))
return
true
;
return
false
;
}
@Override
public
boolean
LT
(
Object
val
)
{
for
(
BaseField
obj:
this
)
if
(
obj
.
LT
(
val
))
return
true
;
return
false
;
}
@Override
public
boolean
ISNULL
(
Object
val
)
{
for
(
BaseField
obj:
this
)
if
(
obj
.
ISNULL
(
val
))
return
true
;
return
false
;
}
@Override
public
boolean
ISNOTNULL
(
Object
val
)
{
return
!
ISNULL
(
val
);
}
@Override
public
boolean
LIKE
(
String
val
)
{
for
(
BaseField
obj:
this
)
if
(
obj
.
LIKE
(
val
))
return
true
;
return
false
;
}
@Override
public
boolean
LEFTLIKE
(
String
val
)
{
for
(
BaseField
obj:
this
)
if
(
obj
.
LEFTLIKE
(
val
))
return
true
;
return
false
;
}
@Override
public
boolean
RIGHTLIKE
(
String
val
)
{
for
(
BaseField
obj:
this
)
if
(
obj
.
RIGHTLIKE
(
val
))
return
true
;
return
false
;
}
@Override
public
boolean
IN
(
String
val
)
{
for
(
BaseField
obj:
this
)
if
(
obj
.
IN
(
val
))
return
true
;
return
false
;
}
@Override
public
boolean
NOTIN
(
String
val
)
{
return
!
IN
(
val
);
}
@Override
public
boolean
INC2S
(
String
val
)
{
for
(
BaseField
obj:
this
)
if
(
obj
.
INC2S
(
val
))
return
true
;
return
false
;
}
@Override
public
boolean
NOTINC2S
(
String
val
)
{
return
!
INC2S
(
val
);
}
@Override
public
boolean
MATCHES
(
String
val
)
{
for
(
BaseField
obj:
this
)
if
(
obj
.
MATCHES
(
val
))
return
true
;
return
false
;
}
@Override
public
String
toString
()
{
if
(
ObjectUtils
.
isEmpty
(
this
.
getValue
()))
return
""
;
else
{
String
rt
=
""
;
for
(
BaseField
obj:
this
)
{
Object
val
=
obj
.
getValue
();
if
(
ObjectUtils
.
isEmpty
(
val
))
continue
;
String
str
=
val
.
toString
();
if
(!
StringUtils
.
isEmpty
(
rt
))
rt
=
rt
+
","
;
rt
=
rt
+
str
;
}
if
(
StringUtils
.
isEmpty
(
rt
))
rt
=
""
;
return
rt
;
}
}
@Override
public
boolean
NOTLIKE
(
String
val
)
{
return
!
LIKE
(
val
);
}
@Override
public
boolean
LEFTNOTLIKE
(
String
val
)
{
return
!
LEFTLIKE
(
val
);
}
@Override
public
boolean
RIGHTNOTLIKE
(
String
val
)
{
return
!
RIGHTLIKE
(
val
);
}
@Override
public
boolean
NOTMATCHES
(
String
val
)
{
return
!
MATCHES
(
val
);
}
}
\ No newline at end of file
ibzdst-core/src/main/java/cn/ibizlab/core/extensions/domain/DSTEntityModel.java
已删除
100644 → 0
浏览文件 @
019d0297
package
cn
.
ibizlab
.
core
.
extensions
.
domain
;
import
cn.ibizlab.core.lite.domain.MetaField
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.List
;
import
java.util.Map
;
@Data
public
class
DSTEntityModel
implements
Serializable
{
private
String
dblink
;
private
String
sqltable
;
private
String
sqlKeyField
;
private
String
getCondition
;
private
Map
<
String
,
DSTLookupModel
>
lookups
;
private
List
<
String
>
releations
;
private
List
<
String
>
subentity
;
private
List
<
MetaField
>
keyFields
;
private
List
<
MetaField
>
f1nFields
;
private
List
<
MetaField
>
fn1Fields
;
private
String
lastUpdateField
;
}
ibzdst-core/src/main/java/cn/ibizlab/core/extensions/domain/DSTLookupModel.java
已删除
100644 → 0
浏览文件 @
019d0297
package
cn
.
ibizlab
.
core
.
extensions
.
domain
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.List
;
@Data
public
class
DSTLookupModel
implements
Serializable
{
private
String
refentity
;
private
String
selectCondition
;
private
List
<
String
>
reffieldsCondition
;
private
String
entity
;
private
List
<
String
>
paramsCondition
;
}
ibzdst-core/src/main/java/cn/ibizlab/core/extensions/domain/IEntity.java
已删除
100644 → 0
浏览文件 @
019d0297
package
cn
.
ibizlab
.
core
.
extensions
.
domain
;
import
cn.ibizlab.core.extensions.util.IEntityActionHelper
;
import
java.io.Serializable
;
import
java.util.List
;
public
interface
IEntity
extends
Serializable
{
Object
get
(
Object
key
);
String
getENTITYNAME
();
void
setENTITYNAME
(
String
name
);
void
regesitAttr
(
String
key
,
BaseEntity
val
);
String
getKEY
();
void
setKEY
(
String
KEY
);
IField
$
(
String
key
);
Double
$D
(
String
key
);
IEntity
$E
(
String
key
);
boolean
IF
(
String
cond
);
boolean
test
(
String
cond
);
void
setActionHelper
(
IEntityActionHelper
iEntityActionHelper
);
/**
* 获取操作辅助对象
*
* @return
*/
IEntityActionHelper
getActionHelper
();
List
<
BaseEntity
>
selectRow
(
String
dblink
,
String
sql
);
}
ibzdst-core/src/main/java/cn/ibizlab/core/extensions/domain/IField.java
已删除
100644 → 0
浏览文件 @
019d0297
package
cn
.
ibizlab
.
core
.
extensions
.
domain
;
import
java.io.Serializable
;
public
interface
IField
extends
Serializable
{
String
getField
();
void
setField
(
String
field
);
String
getEntity
();
void
setEntity
(
String
entity
);
Object
getValue
();
String
getCondValue
();
Object
getFecthValue
();
boolean
EQ
(
Object
val
);
boolean
NOTEQ
(
Object
val
);
boolean
GTANDEQ
(
Object
val
);
boolean
GT
(
Object
val
);
boolean
LTANDEQ
(
Object
val
);
boolean
LT
(
Object
val
);
boolean
ISNULL
(
Object
val
);
boolean
ISNOTNULL
(
Object
val
);
boolean
LIKE
(
String
val
);
boolean
LEFTLIKE
(
String
val
);
boolean
RIGHTLIKE
(
String
val
);
boolean
NOTLIKE
(
String
val
);
boolean
LEFTNOTLIKE
(
String
val
);
boolean
RIGHTNOTLIKE
(
String
val
);
boolean
IN
(
String
val
);
boolean
NOTIN
(
String
val
);
boolean
INC2S
(
String
val
);
boolean
NOTINC2S
(
String
val
);
boolean
MATCHES
(
String
val
);
boolean
NOTMATCHES
(
String
val
);
}
ibzdst-core/src/main/java/cn/ibizlab/core/extensions/service/BaseEntityService.java
浏览文件 @
21ab1409
package
cn
.
ibizlab
.
core
.
extensions
.
service
;
import
cn.ibizlab.core.extensions.domain.BaseEntity
;
import
cn.ibizlab.core.extensions.domain.IEntity
;
import
cn.ibizlab.core.extensions.domain.IField
;
import
cn.ibizlab.core.lite.extensions.domain.ModelObj
;
import
cn.ibizlab.core.rule.domain.ExecLog
;
import
cn.ibizlab.util.errors.BadRequestAlertException
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
java.
util.List
;
import
java.
sql.Timestamp
;
/**
*
实体[DSTEntity]
服务对象接口
*
规则
服务对象接口
*/
public
interface
BaseEntityService
extends
IService
<
BaseEntity
>
{
public
interface
BaseEntityService
{
void
resetKC
(
String
keyC
);
List
<
BaseEntity
>
selectRow
(
String
dblink
,
String
sql
);
void
reset
(
String
keyContainer
);
ExecLog
processAll
(
BadRequestAlertException
msg
);
void
saveResult
(
IEntity
param
,
String
RULEID
,
String
RULENAME
,
String
RU_EXECRESULTNAME
,
String
BUSINESSCAT
,
Integer
RETVALUE
,
Object
KEYVALUEFIELD
,
IField
DOMAINSFIELD
,
IField
METRICFIELD
,
IField
TIMEFIELD
,
IField
EXT1FIELD
,
IField
EXT2FIELD
);
void
saveResult
(
ModelObj
param
,
String
RULECODE
,
String
RULENAME
,
String
RU_EXECRESULTNAME
,
String
BUSINESSCAT
,
Integer
RETVALUE
,
String
KEYVALUEFIELD
,
String
DOMAINSFIELD
,
Double
METRICFIELD
,
Timestamp
TIMEFIELD
,
String
EXT1FIELD
,
String
EXT2FIELD
);
}
\ No newline at end of file
ibzdst-core/src/main/java/cn/ibizlab/core/extensions/service/RuleItemExService.java
浏览文件 @
21ab1409
...
...
@@ -319,10 +319,10 @@ public class RuleItemExService extends RuleItemServiceImpl {
if
(!
StringUtils
.
isEmpty
(
strGroupCond
)){
if
(
relaConn
.
equals
(
"exists"
))
{
strRelationResult
=
String
.
format
(
"%s:
BaseEntity %s from item.$E
(\"%s\")"
,
relaEntity
,
strGroupCond
,
relaEntity
);
strRelationResult
=
String
.
format
(
"%s:
ModelObj %s from item.getNested
(\"%s\")"
,
relaEntity
,
strGroupCond
,
relaEntity
);
}
else
if
(
relaConn
.
equals
(
"not exists"
)){
strRelationResult
=
String
.
format
(
"not(exists
IEntity %s from item.$E
(\"%s\"))"
,
strGroupCond
,
relaEntity
);
strRelationResult
=
String
.
format
(
"not(exists
ModelObj %s from item.getNested
(\"%s\"))"
,
strGroupCond
,
relaEntity
);
}
}
if
(!
StringUtils
.
isEmpty
(
strRelationResult
))
...
...
ibzdst-core/src/main/java/cn/ibizlab/core/extensions/util/IEntityActionHelper.java
已删除
100644 → 0
浏览文件 @
019d0297
package
cn
.
ibizlab
.
core
.
extensions
.
util
;
import
cn.ibizlab.core.extensions.domain.BaseEntity
;
import
cn.ibizlab.core.extensions.domain.DSTEntityModel
;
import
java.util.List
;
public
interface
IEntityActionHelper
{
List
<
BaseEntity
>
select
(
String
dblink
,
String
sql
);
DSTEntityModel
getModel
(
String
etname
);
}
ibzdst-core/src/main/java/cn/ibizlab/core/lite/extensions/domain/EntityObj.java
浏览文件 @
21ab1409
...
...
@@ -169,6 +169,10 @@ public class EntityObj extends DataObj<String,Object> {
public
boolean
isDelete
()
{
return
false
;
if
(!
this
.
getEntityModel
().
isLogicValid
())
return
false
;
if
(
this
.
getEntityModel
().
getLogicVal
().
equals
(
this
.
get
(
this
.
getEntityModel
().
getLogicValidField
().
getColumnName
())))
return
false
;
return
true
;
}
}
ibzdst-core/src/main/java/cn/ibizlab/core/lite/extensions/domain/ModelObj.java
浏览文件 @
21ab1409
...
...
@@ -274,6 +274,34 @@ public class ModelObj extends DataObj<String,Object> {
public
Object
$
(
String
key
)
{
if
(
key
.
toString
().
indexOf
(
"."
)>
0
)
{
String
[]
epair
=
key
.
toString
().
split
(
"[.]"
);
if
(
epair
.
length
>=
2
)
{
String
name
=
epair
[
0
];
String
column
=
epair
[
1
];
//if(this.get(key))
return
this
.
getEntity
(
name
).
get
(
column
);
}
}
return
get
(
key
);
}
public
Double
$D
(
String
key
)
{
Object
val
=
this
.
get
(
key
);
if
(
val
==
null
)
return
0
d
;
else
if
((
val
instanceof
Integer
)||(
val
instanceof
Double
)||(
val
instanceof
Long
)||(
val
instanceof
BigDecimal
)||(
val
instanceof
BigInteger
)||(
val
instanceof
Float
))
return
(
double
)
val
;
return
1
d
;
}
...
...
ibzdst-core/src/main/java/cn/ibizlab/core/lite/extensions/model/DataModel.java
浏览文件 @
21ab1409
...
...
@@ -138,9 +138,9 @@ public class DataModel {
for
(
Property
property:
this
.
getObjectProperties
())
if
(
name
.
equalsIgnoreCase
(
property
.
getPropertyName
()))
return
property
;
for
(
Property
property:
this
.
getObjectProperties
())
if
(
name
.
equalsIgnoreCase
(
property
.
getPropertyEntity
()))
return
property
;
//
for (Property property:this.getObjectProperties())
//
if(name.equalsIgnoreCase(property.getPropertyEntity()))
//
return property;
}
return
null
;
}
...
...
ibzdst-core/src/main/resources/ftl/DSTRule.drl.ftl
浏览文件 @
21ab1409
package
com
.
engineer
;
import
net
.
ibizsys
.
dst
.
common
.
domain
.
BaseEntity
;
import
net
.
ibizsys
.
dst
.
common
.
domain
.
IEntity
;
import
net
.
ibizsys
.
dst
.
common
.
service
.
BaseEntityService
;
import
cn
.
ibizlab
.
core
.
lite
.
extensions
.
ModelObj
;
import
cn
.
ibizlab
.
core
.
extensions
.
service
.
BaseEntityService
;
global
BaseEntityService
BaseService
;
rule
"<#if rule
id??>${ruleid
}_1</#if>"
rule
"<#if rule
code??>${rulecode
}_1</#if>"
salience
100
activation
-
group
"<#if rule
id??>${ruleid
}</#if>"
activation
-
group
"<#if rule
code??>${rulecode
}</#if>"
when
item
:
BaseEntity
(
<#
if
rulecond
??>${
rulecond
}</#
if
>
)
item
:
ModelObj
(
<#
if
rulecond
??>${
rulecond
}</#
if
>
)
<#
if
(
releationcond
??)>${
releationcond
}</#
if
>
then
BaseService
.
saveResult
(
item
,
"<#if rule
id??>${ruleid}</#if>"
,
"<#if rulename??>${rulename}</#if>"
,
"<#if memo??>${memo}</#if>"
,
"<#if businesscat??>${businesscat}</#if>"
,
1
,${
keyvaluefield
},${
domains
field
},${
metricfield
},${
timefield
},${
ext1field
},${
ext2field
});
BaseService
.
saveResult
(
item
,
"<#if rule
code??>${rulecode}</#if>"
,
"<#if rulename??>${rulename}</#if>"
,
"<#if memo??>${memo}</#if>"
,<#
if
businesscat
??>${
businesscat
}</#
if
>,
1
,${
keyvaluefield
},${
domainsfield
},${
dim
field
},${
metricfield
},${
timefield
},${
ext1field
},${
ext2field
});
end
rule
"<#if rule
id??>${ruleid
}_d</#if>"
rule
"<#if rule
code??>${rulecode
}_d</#if>"
salience
0
activation
-
group
"<#if rule
id??>${ruleid
}</#if>"
activation
-
group
"<#if rule
code??>${rulecode
}</#if>"
when
item
:
BaseEntity
(
)
item
:
ModelObj
(
)
<#
if
(
releationcond
??)>${
releationcond
}</#
if
>
then
BaseService
.
saveResult
(
item
,
"<#if rule
id??>${ruleid}</#if>"
,
"<#if rulename??>${rulename}</#if>"
,
null
,
"<#if businesscat??>${businesscat}</#if>"
,
0
,
item
.
KEY
,${
domains
field
},${
metricfield
},${
timefield
},
null
,
null
);
BaseService
.
saveResult
(
item
,
"<#if rule
code??>${rulecode}</#if>"
,
null
,
null
,
null
,
0
,${
keyvaluefield
},${
domainsfield
},${
dim
field
},${
metricfield
},${
timefield
},
null
,
null
);
end
\ No newline at end of file
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录