Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzdict
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzdict
提交
a099554f
提交
a099554f
编写于
7月 02, 2020
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ibiz4j 发布系统代码
上级
8c39dcbc
变更
10
显示空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
175 行增加
和
105 行删除
+175
-105
filter-mode.vue
app_web/src/components/filter-tree/filter-mode.vue
+30
-17
filter-tree.less
app_web/src/components/filter-tree/filter-tree.less
+12
-24
filter-tree.vue
app_web/src/components/filter-tree/filter-tree.vue
+80
-22
dict-catalog-service-base.ts
...web/src/service/dict-catalog/dict-catalog-service-base.ts
+8
-12
dict-option-service-base.ts
app_web/src/service/dict-option/dict-option-service-base.ts
+17
-15
IDictCatalogService.java
...ava/cn/ibizlab/core/dict/service/IDictCatalogService.java
+0
-2
IDictOptionService.java
...java/cn/ibizlab/core/dict/service/IDictOptionService.java
+0
-2
DEFieldDefaultValueAspect.java
...ava/cn/ibizlab/util/aspect/DEFieldDefaultValueAspect.java
+1
-1
VersionCheckAspect.java
.../main/java/cn/ibizlab/util/aspect/VersionCheckAspect.java
+23
-6
DEFieldCacheMap.java
...src/main/java/cn/ibizlab/util/helper/DEFieldCacheMap.java
+4
-4
未找到文件。
app_web/src/components/filter-tree/filter-mode.vue
浏览文件 @
a099554f
<
template
>
<
template
>
<el-select
size=
"small"
class=
"filter-mode"
placeholder=
"条件逻辑"
clearable
v-model=
"curVal"
@
change=
"onChange"
>
<el-select
size=
"small"
class=
"filter-mode"
placeholder=
"条件逻辑"
v-model=
"curVal"
@
change=
"onChange"
>
<el-option
<el-option
v-for=
"mode in filterMode"
v-for=
"mode in filterMode"
:key=
"mode.value"
:key=
"mode.value"
:label=
"
mode.en
"
:label=
"
getLabel(mode)
"
:value=
"mode.value"
:value=
"mode.value"
>
>
</el-option>
</el-option>
...
@@ -43,23 +43,36 @@ export default class FilterMode extends Vue {
...
@@ -43,23 +43,36 @@ export default class FilterMode extends Vue {
public
filterMode
:
any
[]
=
[
public
filterMode
:
any
[]
=
[
// { name: 'AND', value: '$and' },
// { name: 'AND', value: '$and' },
// { name: 'OR', value: '$or' },
// { name: 'OR', value: '$or' },
{
zh
:
'等于(=)'
,
en
:
'EQ'
,
value
:
'$eq'
},
{
'zh-CN'
:
'等于(=)'
,
'en-US'
:
'EQ'
,
value
:
'$eq'
},
{
zh
:
''
,
en
:
'NE'
,
value
:
'$ne'
},
{
'zh-CN'
:
'不等于(<>)'
,
'en-US'
:
'NE'
,
value
:
'$ne'
},
{
zh
:
''
,
en
:
'GT'
,
value
:
'$gt'
},
{
'zh-CN'
:
'大于(>)'
,
'en-US'
:
'GT'
,
value
:
'$gt'
},
{
zh
:
''
,
en
:
'GE'
,
value
:
'$gte'
},
{
'zh-CN'
:
'大于等于(>=)'
,
'en-US'
:
'GE'
,
value
:
'$gte'
},
{
zh
:
''
,
en
:
'LT'
,
value
:
'$lt'
},
{
'zh-CN'
:
'小于(<)'
,
'en-US'
:
'LT'
,
value
:
'$lt'
},
{
zh
:
''
,
en
:
'LE'
,
value
:
'$lte'
},
{
'zh-CN'
:
'小于(<=)'
,
'en-US'
:
'LE'
,
value
:
'$lte'
},
{
zh
:
''
,
en
:
'IS_NULL'
,
value
:
'$null'
},
{
'zh-CN'
:
'值为空(Nil)'
,
'en-US'
:
'IS_NULL'
,
value
:
'$null'
},
{
zh
:
''
,
en
:
'IS_NOT_NULL'
,
value
:
'$notNull'
},
{
'zh-CN'
:
'值不为空(NotNil)'
,
'en-US'
:
'IS_NOT_NULL'
,
value
:
'$notNull'
},
{
zh
:
''
,
en
:
'IN'
,
value
:
'$in'
},
{
'zh-CN'
:
'值在范围中(In)'
,
'en-US'
:
'IN'
,
value
:
'$in'
},
{
zh
:
''
,
en
:
'NOTIN'
,
value
:
'$notIn'
},
{
'zh-CN'
:
'值不在范围中(NotIn)'
,
'en-US'
:
'NOTIN'
,
value
:
'$notIn'
},
{
zh
:
''
,
en
:
'LIKE'
,
value
:
'$like'
},
{
'zh-CN'
:
'文本包含(%)'
,
'en-US'
:
'LIKE'
,
value
:
'$like'
},
{
zh
:
''
,
en
:
'LIFTLIKE'
,
value
:
'$startsWith'
},
{
'zh-CN'
:
'文本左包含(%#)'
,
'en-US'
:
'LIFTLIKE'
,
value
:
'$startsWith'
},
{
zh
:
''
,
en
:
'RIGHTLIKE'
,
value
:
'$endsWith'
},
{
'zh-CN'
:
'文本右包含(#%)'
,
'en-US'
:
'RIGHTLIKE'
,
value
:
'$endsWith'
},
{
zh
:
''
,
en
:
'EXISTS'
,
value
:
'$exists'
},
// { 'zh-CN'
: '', en: 'EXISTS', value: '$exists' },
{
zh
:
''
,
en
:
'NOTEXISTS'
,
value
:
'$notExists'
}
// { 'zh-CN'
: '', en: 'NOTEXISTS', value: '$notExists' }
];
];
/**
* 获取语言文本
*
* @return {string}
* @memberof FilterMode
*/
getLabel
(
mode
:
any
):
string
{
if
(
this
.
$i18n
.
locale
)
{
return
mode
[
this
.
$i18n
.
locale
];
}
return
mode
[
'zh-CN'
];
}
/**
/**
* 值改变
* 值改变
*
*
...
...
app_web/src/components/filter-tree/filter-tree.less
浏览文件 @
a099554f
.filter-item {
display: flex;
// margin-top: 10px;
.fa-trash-o {
color: red;
}
.filter-item-group {
width: 100px;
margin-left: 5px;
}
.filter-item-field {
width: 200px;
margin-left: 5px;
}
.filter-item-mode {
width: 200px;
margin-left: 5px;
}
.filter-item-value {
margin-left: 5px;
flex-grow: 1;
}
}
.filter-tree {
.filter-tree {
.el-tree-node__content {
.el-tree-node__content {
height: 40px;
height: 40px;
.filter-tree-item {
.filter-tree-item {
display: flex;
display: flex;
width: 100%;
>div {
>div {
margin-right: 10px;
margin-right: 10px;
}
}
...
@@ -33,10 +11,20 @@
...
@@ -33,10 +11,20 @@
margin-right: 0;
margin-right: 0;
}
}
.filter-tree-action {
.filter-tree-action {
margin-left: 20px;
display: none;
align-items: center;
.ivu-btn {
.ivu-btn {
margin-right: 5px;
margin-right: 5px;
}
}
.ivu-icon-md-close {
color: red;
font-size: 24px;
}
}
}
.filter-tree-item:hover {
.filter-tree-action {
display: flex;
}
}
}
}
}
}
...
...
app_web/src/components/filter-tree/filter-tree.vue
浏览文件 @
a099554f
<
template
>
<
template
>
<el-tree
class=
"filter-tree"
:data=
"treeItems"
:
props=
"defaultProps"
:
expand-on-click-node=
"false"
default-expand-all
>
<el-tree
class=
"filter-tree"
:data=
"treeItems"
:expand-on-click-node=
"false"
default-expand-all
>
<template
slot-scope=
"
{ node, data }">
<template
slot-scope=
"
{ node, data }">
<template
v-if=
"Object.is(data.
name, '$and') || Object.is(data.name
, '$or')"
>
<template
v-if=
"Object.is(data.
label, '$and') || Object.is(data.label
, '$or')"
>
<div
class=
"filter-tree-item"
>
<div
class=
"filter-tree-item"
>
<el-select
size=
"small"
v-model=
"data.
name
"
>
<el-select
size=
"small"
v-model=
"data.
label"
:disabled=
"data.isroot
"
>
<el-option
v-for=
"mode in relationModes"
:key=
"mode.value"
:label=
"
mode.zh
"
:value=
"mode.value"
></el-option>
<el-option
v-for=
"mode in relationModes"
:key=
"mode.value"
:label=
"
getLabel(mode)
"
:value=
"mode.value"
></el-option>
</el-select>
</el-select>
<div
class=
"filter-tree-action"
>
<div
class=
"filter-tree-action"
>
<i-button
title=
"添加条件"
@
click=
"onAddItem(data)"
><i
class=
"fa fa-plus"
aria-hidden=
"true"
></i>
添加条件
</i-button>
<i-button
title=
"添加条件"
@
click=
"onAddItem(data)"
><i
class=
"fa fa-plus"
aria-hidden=
"true"
></i>
添加条件
</i-button>
<i-button
title=
"添加组"
@
click=
"onAddGroup(data)"
><i
class=
"fa fa-plus"
aria-hidden=
"true"
></i>
添加组
</i-button>
<i-button
title=
"添加组"
@
click=
"onAddGroup(data)"
><i
class=
"fa fa-plus"
aria-hidden=
"true"
></i>
添加组
</i-button>
<icon
v-if=
"!data.isroot"
type=
"md-close"
@
click=
"onRemoveItem(node, data)"
/>
</div>
</div>
</div>
</div>
</
template
>
</
template
>
...
@@ -28,7 +29,7 @@
...
@@ -28,7 +29,7 @@
<slot
v-else
:data=
"data"
></slot>
<slot
v-else
:data=
"data"
></slot>
</div>
</div>
<div
class=
"filter-tree-action"
>
<div
class=
"filter-tree-action"
>
<i
-button
@
click=
"onRemoveItem(node, data)"
title=
"删除"
><i
class=
"fa fa-trash-o"
aria-hidden=
"true"
></i></i-button
>
<i
con
type=
"md-close"
@
click=
"onRemoveItem(node, data)"
/
>
</div>
</div>
</div>
</div>
</
template
>
</
template
>
...
@@ -47,24 +48,44 @@ import FilterMode from './filter-mode.vue';
...
@@ -47,24 +48,44 @@ import FilterMode from './filter-mode.vue';
})
})
export
default
class
FilterTree
extends
Vue
{
export
default
class
FilterTree
extends
Vue
{
/**
* 数据集
*
* @type {*}
* @memberof FilterTree
*/
@
Prop
()
datas
:
any
;
@
Prop
()
datas
:
any
;
/**
* 过滤项集合
*
* @type {*}
* @memberof FilterTree
*/
@
Prop
()
fields
:
any
;
@
Prop
()
fields
:
any
;
protected
defaultProps
:
any
=
{
/**
children
:
'items'
,
* 组条件集合
label
:
'name'
*
};
* @type {*}
* @memberof FilterTree
*/
protected
relationModes
:
any
[]
=
[
protected
relationModes
:
any
[]
=
[
{
zh
:
'并且'
,
en
:
'AND'
,
value
:
'$and'
},
{
'zh-CN'
:
'并且'
,
'en-US'
:
'AND'
,
value
:
'$and'
},
{
zh
:
'或'
,
en
:
'OR'
,
value
:
'$or'
}
{
'zh-CN'
:
'或'
,
'en-US'
:
'OR'
,
value
:
'$or'
}
];
];
/**
* 树数据集合
*
* @type {*}
* @memberof FilterTree
*/
get
treeItems
()
{
get
treeItems
()
{
let
root
:
any
=
{
let
root
:
any
=
{
name
:
'$and'
,
label
:
'$and'
,
items
:
this
.
datas
isroot
:
true
,
children
:
this
.
datas
};
};
if
(
this
.
datas
.
length
==
0
)
{
if
(
this
.
datas
.
length
==
0
)
{
this
.
onAddItem
(
root
);
this
.
onAddItem
(
root
);
...
@@ -73,35 +94,72 @@ export default class FilterTree extends Vue {
...
@@ -73,35 +94,72 @@ export default class FilterTree extends Vue {
return
[
root
];
return
[
root
];
}
}
/**
* 获取语言文本
*
* @return {string}
* @memberof FilterTree
*/
getLabel
(
mode
:
any
):
string
{
if
(
this
.
$i18n
.
locale
)
{
return
mode
[
this
.
$i18n
.
locale
];
}
return
mode
[
'zh-CN'
];
}
/**
* 属性变化
*
* @return {*}
* @memberof FilterTree
*/
public
onFieldChange
(
data
:
any
)
{
public
onFieldChange
(
data
:
any
)
{
if
(
!
data
.
mode
)
{
if
(
!
data
.
mode
)
{
data
.
mode
=
'$eq'
;
data
.
mode
=
'$eq'
;
}
}
}
}
/**
* 添加条件
*
* @return {*}
* @memberof FilterTree
*/
public
onAddItem
(
data
:
any
)
{
public
onAddItem
(
data
:
any
)
{
if
(
data
&&
data
.
items
)
{
if
(
data
&&
data
.
children
)
{
data
.
items
.
push
({
data
.
children
.
push
({
field
:
null
,
field
:
null
,
mode
:
null
mode
:
null
});
});
}
}
}
}
/**
* 添加组
*
* @return {*}
* @memberof FilterTree
*/
public
onAddGroup
(
data
:
any
)
{
public
onAddGroup
(
data
:
any
)
{
if
(
data
&&
data
.
items
)
{
if
(
data
&&
data
.
children
)
{
data
.
items
.
push
({
data
.
children
.
push
({
name
:
'$and'
,
label
:
'$and'
,
items
:
[]
children
:
[]
})
})
}
}
}
}
/**
* 删除条件/组
*
* @return {*}
* @memberof FilterTree
*/
public
onRemoveItem
(
node
:
any
,
data
:
any
)
{
public
onRemoveItem
(
node
:
any
,
data
:
any
)
{
if
(
node
&&
node
.
parent
)
{
if
(
node
&&
node
.
parent
)
{
let
pData
:
any
=
node
.
parent
.
data
;
let
pData
:
any
=
node
.
parent
.
data
;
if
(
pData
.
items
.
indexOf
(
data
)
>=
0
)
{
if
(
pData
.
children
.
indexOf
(
data
)
>=
0
)
{
pData
.
items
.
splice
(
pData
.
items
.
indexOf
(
data
),
1
)
pData
.
children
.
splice
(
pData
.
children
.
indexOf
(
data
),
1
)
}
}
}
}
}
}
...
...
app_web/src/service/dict-catalog/dict-catalog-service-base.ts
浏览文件 @
a099554f
...
@@ -48,8 +48,7 @@ export default class DictCatalogServiceBase extends EntityService {
...
@@ -48,8 +48,7 @@ export default class DictCatalogServiceBase extends EntityService {
* @memberof DictCatalogServiceBase
* @memberof DictCatalogServiceBase
*/
*/
public
async
Select
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
Select
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/dictcatalogs/
${
context
.
dictcatalog
}
/select`
,
isloading
);
return
Http
.
getInstance
().
get
(
`/dictcatalogs/
${
context
.
dictcatalog
}
/select`
,
isloading
);
return
res
;
}
}
/**
/**
...
@@ -133,8 +132,7 @@ export default class DictCatalogServiceBase extends EntityService {
...
@@ -133,8 +132,7 @@ export default class DictCatalogServiceBase extends EntityService {
* @memberof DictCatalogServiceBase
* @memberof DictCatalogServiceBase
*/
*/
public
async
Remove
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
Remove
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
await
Http
.
getInstance
().
delete
(
`/dictcatalogs/
${
context
.
dictcatalog
}
`
,
isloading
);
return
Http
.
getInstance
().
delete
(
`/dictcatalogs/
${
context
.
dictcatalog
}
`
,
isloading
);
return
res
;
}
}
/**
/**
...
@@ -178,8 +176,7 @@ export default class DictCatalogServiceBase extends EntityService {
...
@@ -178,8 +176,7 @@ export default class DictCatalogServiceBase extends EntityService {
* @memberof DictCatalogServiceBase
* @memberof DictCatalogServiceBase
*/
*/
public
async
CheckKey
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
CheckKey
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/dictcatalogs/
${
context
.
dictcatalog
}
/checkkey`
,
data
,
isloading
);
return
Http
.
getInstance
().
post
(
`/dictcatalogs/
${
context
.
dictcatalog
}
/checkkey`
,
data
,
isloading
);
return
res
;
}
}
/**
/**
...
@@ -225,7 +222,6 @@ export default class DictCatalogServiceBase extends EntityService {
...
@@ -225,7 +222,6 @@ export default class DictCatalogServiceBase extends EntityService {
*/
*/
public
async
FetchDefault
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
FetchDefault
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
tempData
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
let
tempData
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/dictcatalogs/fetchdefault`
,
tempData
,
isloading
);
return
Http
.
getInstance
().
get
(
`/dictcatalogs/fetchdefault`
,
tempData
,
isloading
);
return
res
;
}
}
}
}
\ No newline at end of file
app_web/src/service/dict-option/dict-option-service-base.ts
浏览文件 @
a099554f
...
@@ -49,10 +49,9 @@ export default class DictOptionServiceBase extends EntityService {
...
@@ -49,10 +49,9 @@ export default class DictOptionServiceBase extends EntityService {
*/
*/
public
async
Select
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
Select
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
dictcatalog
&&
context
.
dictoption
){
if
(
context
.
dictcatalog
&&
context
.
dictoption
){
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/dictcatalogs/
${
context
.
dictcatalog
}
/dictoptions/
${
context
.
dictoption
}
/select`
,
isloading
);
return
Http
.
getInstance
().
get
(
`/dictcatalogs/
${
context
.
dictcatalog
}
/dictoptions/
${
context
.
dictoption
}
/select`
,
isloading
);
}
}
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/dictoptions/
${
context
.
dictoption
}
/select`
,
isloading
);
return
Http
.
getInstance
().
get
(
`/dictoptions/
${
context
.
dictoption
}
/select`
,
isloading
);
return
res
;
}
}
/**
/**
...
@@ -76,6 +75,7 @@ export default class DictOptionServiceBase extends EntityService {
...
@@ -76,6 +75,7 @@ export default class DictOptionServiceBase extends EntityService {
}
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/dictcatalogs/
${
context
.
dictcatalog
}
/dictoptions`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/dictcatalogs/
${
context
.
dictcatalog
}
/dictoptions`
,
data
,
isloading
);
return
res
;
}
}
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
...
@@ -104,6 +104,7 @@ export default class DictOptionServiceBase extends EntityService {
...
@@ -104,6 +104,7 @@ export default class DictOptionServiceBase extends EntityService {
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/dictcatalogs/
${
context
.
dictcatalog
}
/dictoptions/
${
context
.
dictoption
}
`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/dictcatalogs/
${
context
.
dictcatalog
}
/dictoptions/
${
context
.
dictoption
}
`
,
data
,
isloading
);
return
res
;
}
}
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
...
@@ -122,10 +123,9 @@ export default class DictOptionServiceBase extends EntityService {
...
@@ -122,10 +123,9 @@ export default class DictOptionServiceBase extends EntityService {
*/
*/
public
async
Remove
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
Remove
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
dictcatalog
&&
context
.
dictoption
){
if
(
context
.
dictcatalog
&&
context
.
dictoption
){
let
res
:
any
=
await
Http
.
getInstance
().
delete
(
`/dictcatalogs/
${
context
.
dictcatalog
}
/dictoptions/
${
context
.
dictoption
}
`
,
isloading
);
return
Http
.
getInstance
().
delete
(
`/dictcatalogs/
${
context
.
dictcatalog
}
/dictoptions/
${
context
.
dictoption
}
`
,
isloading
);
}
}
let
res
:
any
=
await
Http
.
getInstance
().
delete
(
`/dictoptions/
${
context
.
dictoption
}
`
,
isloading
);
return
Http
.
getInstance
().
delete
(
`/dictoptions/
${
context
.
dictoption
}
`
,
isloading
);
return
res
;
}
}
/**
/**
...
@@ -140,6 +140,7 @@ export default class DictOptionServiceBase extends EntityService {
...
@@ -140,6 +140,7 @@ export default class DictOptionServiceBase extends EntityService {
public
async
Get
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
Get
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
dictcatalog
&&
context
.
dictoption
){
if
(
context
.
dictcatalog
&&
context
.
dictoption
){
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/dictcatalogs/
${
context
.
dictcatalog
}
/dictoptions/
${
context
.
dictoption
}
`
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/dictcatalogs/
${
context
.
dictcatalog
}
/dictoptions/
${
context
.
dictoption
}
`
,
isloading
);
return
res
;
}
}
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/dictoptions/
${
context
.
dictoption
}
`
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/dictoptions/
${
context
.
dictoption
}
`
,
isloading
);
return
res
;
return
res
;
...
@@ -158,6 +159,7 @@ export default class DictOptionServiceBase extends EntityService {
...
@@ -158,6 +159,7 @@ export default class DictOptionServiceBase extends EntityService {
if
(
context
.
dictcatalog
&&
true
){
if
(
context
.
dictcatalog
&&
true
){
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/dictcatalogs/
${
context
.
dictcatalog
}
/dictoptions/getdraft`
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/dictcatalogs/
${
context
.
dictcatalog
}
/dictoptions/getdraft`
,
isloading
);
res
.
data
.
dictoption
=
data
.
dictoption
;
res
.
data
.
dictoption
=
data
.
dictoption
;
return
res
;
}
}
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/dictoptions/getdraft`
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/dictoptions/getdraft`
,
isloading
);
res
.
data
.
dictoption
=
data
.
dictoption
;
res
.
data
.
dictoption
=
data
.
dictoption
;
...
@@ -178,10 +180,10 @@ export default class DictOptionServiceBase extends EntityService {
...
@@ -178,10 +180,10 @@ export default class DictOptionServiceBase extends EntityService {
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/dictcatalogs/
${
context
.
dictcatalog
}
/dictoptions/
${
context
.
dictoption
}
/checkkey`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/dictcatalogs/
${
context
.
dictcatalog
}
/dictoptions/
${
context
.
dictoption
}
/checkkey`
,
data
,
isloading
);
}
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/dictoptions/
${
context
.
dictoption
}
/checkkey`
,
data
,
isloading
);
return
res
;
return
res
;
}
}
return
Http
.
getInstance
().
post
(
`/dictoptions/
${
context
.
dictoption
}
/checkkey`
,
data
,
isloading
);
}
/**
/**
* Save接口方法
* Save接口方法
...
@@ -197,6 +199,7 @@ export default class DictOptionServiceBase extends EntityService {
...
@@ -197,6 +199,7 @@ export default class DictOptionServiceBase extends EntityService {
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/dictcatalogs/
${
context
.
dictcatalog
}
/dictoptions/
${
context
.
dictoption
}
/save`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/dictcatalogs/
${
context
.
dictcatalog
}
/dictoptions/
${
context
.
dictoption
}
/save`
,
data
,
isloading
);
return
res
;
}
}
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
...
@@ -216,10 +219,9 @@ export default class DictOptionServiceBase extends EntityService {
...
@@ -216,10 +219,9 @@ export default class DictOptionServiceBase extends EntityService {
public
async
FetchDefault
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
FetchDefault
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
dictcatalog
&&
true
){
if
(
context
.
dictcatalog
&&
true
){
let
tempData
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
let
tempData
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/dictcatalogs/
${
context
.
dictcatalog
}
/dictoptions/fetchdefault`
,
tempData
,
isloading
);
return
Http
.
getInstance
().
get
(
`/dictcatalogs/
${
context
.
dictcatalog
}
/dictoptions/fetchdefault`
,
tempData
,
isloading
);
}
}
let
tempData
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
let
tempData
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/dictoptions/fetchdefault`
,
tempData
,
isloading
);
return
Http
.
getInstance
().
get
(
`/dictoptions/fetchdefault`
,
tempData
,
isloading
);
return
res
;
}
}
}
}
\ No newline at end of file
ibzdict-core/src/main/java/cn/ibizlab/core/dict/service/IDictCatalogService.java
浏览文件 @
a099554f
...
@@ -52,8 +52,6 @@ public interface IDictCatalogService extends IService<DictCatalog>{
...
@@ -52,8 +52,6 @@ public interface IDictCatalogService extends IService<DictCatalog>{
*/
*/
boolean
execute
(
String
sql
,
Map
param
);
boolean
execute
(
String
sql
,
Map
param
);
}
}
ibzdict-core/src/main/java/cn/ibizlab/core/dict/service/IDictOptionService.java
浏览文件 @
a099554f
...
@@ -54,8 +54,6 @@ public interface IDictOptionService extends IService<DictOption>{
...
@@ -54,8 +54,6 @@ public interface IDictOptionService extends IService<DictOption>{
*/
*/
boolean
execute
(
String
sql
,
Map
param
);
boolean
execute
(
String
sql
,
Map
param
);
}
}
ibzdict-util/src/main/java/cn/ibizlab/util/aspect/DEFieldDefaultValueAspect.java
浏览文件 @
a099554f
...
@@ -23,7 +23,7 @@ import java.util.Map;
...
@@ -23,7 +23,7 @@ import java.util.Map;
* 实体属性默认值切面,只有新建(Create)时才会填充默认值
* 实体属性默认值切面,只有新建(Create)时才会填充默认值
*/
*/
@Aspect
@Aspect
@Order
(
0
)
@Order
(
5
0
)
@Component
@Component
public
class
DEFieldDefaultValueAspect
public
class
DEFieldDefaultValueAspect
{
{
...
...
ibzdict-util/src/main/java/cn/ibizlab/util/aspect/VersionCheckAspect.java
浏览文件 @
a099554f
package
cn
.
ibizlab
.
util
.
aspect
;
package
cn
.
ibizlab
.
util
.
aspect
;
import
lombok.SneakyThrows
;
import
lombok.SneakyThrows
;
import
lombok.extern.slf4j.Slf4j
;
import
cn.ibizlab.util.annotation.VersionCheck
;
import
cn.ibizlab.util.annotation.VersionCheck
;
import
cn.ibizlab.util.domain.EntityBase
;
import
cn.ibizlab.util.domain.EntityBase
;
import
cn.ibizlab.util.errors.BadRequestAlertException
;
import
cn.ibizlab.util.errors.BadRequestAlertException
;
...
@@ -24,7 +23,7 @@ import java.lang.reflect.Field;
...
@@ -24,7 +23,7 @@ import java.lang.reflect.Field;
* 数据库版本检查
* 数据库版本检查
*/
*/
@Aspect
@Aspect
@Order
(
0
)
@Order
(
5
0
)
@Component
@Component
public
class
VersionCheckAspect
public
class
VersionCheckAspect
{
{
...
@@ -33,22 +32,40 @@ public class VersionCheckAspect
...
@@ -33,22 +32,40 @@ public class VersionCheckAspect
@SneakyThrows
@SneakyThrows
@Before
(
"execution(* cn.ibizlab.*.rest.*.update(..)) && @annotation(versionCheck)"
)
@Before
(
"execution(* cn.ibizlab.*.rest.*.update(..)) && @annotation(versionCheck)"
)
public
void
BeforeUpdate
(
JoinPoint
point
,
VersionCheck
versionCheck
){
public
void
BeforeUpdate
(
JoinPoint
point
,
VersionCheck
versionCheck
){
EvaluationContext
context
=
new
StandardEvaluationContext
();
Object
[]
args
=
point
.
getArgs
();
Object
[]
args
=
point
.
getArgs
();
Object
id
=
args
[
0
];
Object
id
=
args
[
0
];
Object
dto
=
args
[
1
];
Object
dto
=
args
[
1
];
if
(
ObjectUtils
.
isEmpty
(
id
)
||
ObjectUtils
.
isEmpty
(
dto
))
if
(
ObjectUtils
.
isEmpty
(
id
)
||
ObjectUtils
.
isEmpty
(
dto
))
return
;
return
;
String
versionField
=
versionCheck
.
versionfield
();
String
versionField
=
versionCheck
.
versionfield
();
if
(
StringUtils
.
isEmpty
(
versionCheck
))
if
(
StringUtils
.
isEmpty
(
versionField
))
return
;
versionCheck
(
versionCheck
,
point
.
getTarget
(),
dto
,
id
);
}
@SneakyThrows
@Before
(
"execution(* cn.ibizlab.*.rest.*.updateBy*(..)) && @annotation(versionCheck)"
)
public
void
BeforeUpdateBy
(
JoinPoint
point
,
VersionCheck
versionCheck
){
Object
[]
args
=
point
.
getArgs
();
Object
id
=
args
[
1
];
Object
dto
=
args
[
2
];
if
(
ObjectUtils
.
isEmpty
(
id
)
||
ObjectUtils
.
isEmpty
(
dto
))
return
;
String
versionField
=
versionCheck
.
versionfield
();
if
(
StringUtils
.
isEmpty
(
versionField
))
return
;
return
;
versionCheck
(
versionCheck
,
point
.
getTarget
(),
dto
,
id
);
}
private
void
versionCheck
(
VersionCheck
versionCheck
,
Object
resource
,
Object
dto
,
Object
id
){
EvaluationContext
context
=
new
StandardEvaluationContext
();
context
.
setVariable
(
"dto"
,
dto
);
context
.
setVariable
(
"dto"
,
dto
);
Expression
newExp
=
parser
.
parseExpression
(
String
.
format
(
"#dto.%s"
,
version
Field
));
Expression
newExp
=
parser
.
parseExpression
(
String
.
format
(
"#dto.%s"
,
version
Check
.
versionfield
()
));
Object
newVersion
=
newExp
.
getValue
(
context
);
Object
newVersion
=
newExp
.
getValue
(
context
);
if
(
ObjectUtils
.
isEmpty
(
newVersion
))
if
(
ObjectUtils
.
isEmpty
(
newVersion
))
return
;
return
;
//进行版本检查
//进行版本检查
Object
oldVersion
=
getDBVersion
(
versionCheck
,
getService
(
point
.
getTarget
()
,
versionCheck
.
entity
()),
id
);
Object
oldVersion
=
getDBVersion
(
versionCheck
,
getService
(
resource
,
versionCheck
.
entity
()),
id
);
if
(!
ObjectUtils
.
isEmpty
(
oldVersion
)){
if
(!
ObjectUtils
.
isEmpty
(
oldVersion
)){
if
(
RuleUtils
.
gt
(
newVersion
,
oldVersion
))
if
(
RuleUtils
.
gt
(
newVersion
,
oldVersion
))
throw
new
BadRequestAlertException
(
"数据已变更,可能后台数据已被修改,请重新加载数据"
,
"VersionCheckAspect"
,
"versionCheck"
);
throw
new
BadRequestAlertException
(
"数据已变更,可能后台数据已被修改,请重新加载数据"
,
"VersionCheckAspect"
,
"versionCheck"
);
...
...
ibzdict-util/src/main/java/cn/ibizlab/util/helper/DEFieldCacheMap.java
浏览文件 @
a099554f
...
@@ -92,7 +92,7 @@ public class DEFieldCacheMap {
...
@@ -92,7 +92,7 @@ public class DEFieldCacheMap {
if
(
cacheDEField
.
containsKey
(
className
))
if
(
cacheDEField
.
containsKey
(
className
))
return
cacheDEField
.
get
(
className
);
return
cacheDEField
.
get
(
className
);
else
{
else
{
DEFieldCacheMap
.
getFieldMap
(
cla
zz
);
DEFieldCacheMap
.
getFieldMap
(
cla
ssName
);
return
cacheDEField
.
get
(
className
);
return
cacheDEField
.
get
(
className
);
}
}
}
}
...
@@ -109,7 +109,7 @@ public class DEFieldCacheMap {
...
@@ -109,7 +109,7 @@ public class DEFieldCacheMap {
if
(
cacheDEKeyField
.
containsKey
(
className
))
if
(
cacheDEKeyField
.
containsKey
(
className
))
return
cacheDEKeyField
.
get
(
className
);
return
cacheDEKeyField
.
get
(
className
);
else
{
else
{
DEFieldCacheMap
.
getFieldMap
(
cla
zz
);
DEFieldCacheMap
.
getFieldMap
(
cla
ssName
);
return
cacheDEKeyField
.
get
(
className
);
return
cacheDEKeyField
.
get
(
className
);
}
}
}
}
...
@@ -127,7 +127,7 @@ public class DEFieldCacheMap {
...
@@ -127,7 +127,7 @@ public class DEFieldCacheMap {
if
(
cacheList
.
containsKey
(
className
))
if
(
cacheList
.
containsKey
(
className
))
return
cacheList
.
get
(
className
);
return
cacheList
.
get
(
className
);
else
{
else
{
DEFieldCacheMap
.
getFieldMap
(
cla
zz
);
DEFieldCacheMap
.
getFieldMap
(
cla
ssName
);
return
cacheList
.
get
(
className
);
return
cacheList
.
get
(
className
);
}
}
}
}
...
@@ -155,7 +155,7 @@ public class DEFieldCacheMap {
...
@@ -155,7 +155,7 @@ public class DEFieldCacheMap {
if
(
cacheKey
.
containsKey
(
className
))
if
(
cacheKey
.
containsKey
(
className
))
return
cacheKey
.
get
(
className
);
return
cacheKey
.
get
(
className
);
else
{
else
{
DEFieldCacheMap
.
getFieldMap
(
cla
zz
);
DEFieldCacheMap
.
getFieldMap
(
cla
ssName
);
return
cacheKey
.
get
(
className
);
return
cacheKey
.
get
(
className
);
}
}
}
}
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录