Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzdict
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzdict
提交
80c28d6e
提交
80c28d6e
编写于
4月 16, 2020
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ibizdev提交
上级
00037c66
变更
5
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
38 行增加
和
15 行删除
+38
-15
ibzdict-edit-view-base.vue
...c/pages/dict/ibzdict-edit-view/ibzdict-edit-view-base.vue
+2
-2
ibzdict-item-edit-view-base.vue
...ct/ibzdict-item-edit-view/ibzdict-item-edit-view-base.vue
+2
-2
IBZDictItemServiceImpl.java
...bizlab/core/dict/service/impl/IBZDictItemServiceImpl.java
+7
-4
IBZDictServiceImpl.java
...cn/ibizlab/core/dict/service/impl/IBZDictServiceImpl.java
+21
-7
EntityBase.java
...util/src/main/java/cn/ibizlab/util/domain/EntityBase.java
+6
-0
未找到文件。
app_web/src/pages/dict/ibzdict-edit-view/ibzdict-edit-view-base.vue
浏览文件 @
80c28d6e
...
...
@@ -1073,10 +1073,10 @@ export default class IBZDictEditViewBase extends Vue {
if
(
xData
&&
xData
.
saveAndExit
instanceof
Function
)
{
xData
.
saveAndExit
().
then
((
response
:
any
)
=>
{
if
(
!
response
||
response
.
status
!==
200
)
{
_this
.
$emit
(
'viewdataschange'
,
JSON
.
stringify
({
status
:
'error'
,
action
:
'saveAndExit'
})
);
_this
.
$emit
(
'viewdataschange'
,
null
);
return
;
}
_this
.
$emit
(
'viewdataschange'
,
JSON
.
stringify
({
status
:
'success'
,
action
:
'saveAndExit'
,
data
:
response
.
data
})
);
_this
.
$emit
(
'viewdataschange'
,
[{
...
response
.
data
}]
);
if
(
window
.
parent
){
window
.
parent
.
postMessage
([{
...
response
.
data
}],
'*'
);
}
...
...
app_web/src/pages/dict/ibzdict-item-edit-view/ibzdict-item-edit-view-base.vue
浏览文件 @
80c28d6e
...
...
@@ -1073,10 +1073,10 @@ export default class IBZDictItemEditViewBase extends Vue {
if
(
xData
&&
xData
.
saveAndExit
instanceof
Function
)
{
xData
.
saveAndExit
().
then
((
response
:
any
)
=>
{
if
(
!
response
||
response
.
status
!==
200
)
{
_this
.
$emit
(
'viewdataschange'
,
JSON
.
stringify
({
status
:
'error'
,
action
:
'saveAndExit'
})
);
_this
.
$emit
(
'viewdataschange'
,
null
);
return
;
}
_this
.
$emit
(
'viewdataschange'
,
JSON
.
stringify
({
status
:
'success'
,
action
:
'saveAndExit'
,
data
:
response
.
data
})
);
_this
.
$emit
(
'viewdataschange'
,
[{
...
response
.
data
}]
);
if
(
window
.
parent
){
window
.
parent
.
postMessage
([{
...
response
.
data
}],
'*'
);
}
...
...
ibzdict-core/src/main/java/cn/ibizlab/core/dict/service/impl/IBZDictItemServiceImpl.java
浏览文件 @
80c28d6e
...
...
@@ -80,7 +80,7 @@ public class IBZDictItemServiceImpl extends ServiceImpl<IBZDictItemMapper, IBZDi
@Override
public
boolean
checkKey
(
IBZDictItem
et
)
{
return
true
;
return
(!
ObjectUtils
.
isEmpty
(
et
.
getItemid
()))&&(!
Objects
.
isNull
(
this
.
getById
(
et
.
getItemid
())))
;
}
@Override
@Transactional
...
...
@@ -103,7 +103,10 @@ public class IBZDictItemServiceImpl extends ServiceImpl<IBZDictItemMapper, IBZDi
public
boolean
update
(
IBZDictItem
et
)
{
boolean
ret
=
update
(
et
,
et
.
getUpdateWrapper
(
true
).
eq
(
"ibzdictitemid"
,
et
.
getItemid
()));
if
(!
ret
)
return
ret
;
CachedBeanCopier
.
copy
(
get
(
et
.
getItemid
()),
et
);
IBZDictItem
newet
=
get
(
et
.
getItemid
());
CachedBeanCopier
.
copy
(
newet
,
et
);
return
ret
;
}
...
...
@@ -112,8 +115,8 @@ public class IBZDictItemServiceImpl extends ServiceImpl<IBZDictItemMapper, IBZDi
*/
@Override
public
Page
<
IBZDictItem
>
searchDefault
(
IBZDictItemSearchContext
context
)
{
com
.
baomidou
.
mybatisplus
.
extension
.
plugins
.
pagination
.
Page
<
IBZDictItem
>
iBZDictItem
s
=
baseMapper
.
searchDefault
(
context
.
getPage
(),
context
,
context
.
getSelectCond
());
return
new
PageImpl
<
IBZDictItem
>(
iBZDictItems
.
getRecords
(),
context
.
getPageable
(),
iBZDictItem
s
.
getTotal
());
com
.
baomidou
.
mybatisplus
.
extension
.
plugins
.
pagination
.
Page
<
IBZDictItem
>
page
s
=
baseMapper
.
searchDefault
(
context
.
getPage
(),
context
,
context
.
getSelectCond
());
return
new
PageImpl
<
IBZDictItem
>(
pages
.
getRecords
(),
context
.
getPageable
(),
page
s
.
getTotal
());
}
...
...
ibzdict-core/src/main/java/cn/ibizlab/core/dict/service/impl/IBZDictServiceImpl.java
浏览文件 @
80c28d6e
...
...
@@ -76,7 +76,7 @@ public class IBZDictServiceImpl extends ServiceImpl<IBZDictMapper, IBZDict> impl
@Override
public
boolean
checkKey
(
IBZDict
et
)
{
return
true
;
return
(!
ObjectUtils
.
isEmpty
(
et
.
getDictid
()))&&(!
Objects
.
isNull
(
this
.
getById
(
et
.
getDictid
())))
;
}
@Override
public
IBZDict
getDraft
(
IBZDict
et
)
{
...
...
@@ -88,27 +88,41 @@ public class IBZDictServiceImpl extends ServiceImpl<IBZDictMapper, IBZDict> impl
public
boolean
update
(
IBZDict
et
)
{
boolean
ret
=
update
(
et
,
et
.
getUpdateWrapper
(
true
).
eq
(
"ibzdictid"
,
et
.
getDictid
()));
if
(!
ret
)
return
ret
;
//嵌套[字典项目]
Set
_items
=
new
HashSet
();
if
(!
ObjectUtils
.
isEmpty
(
et
.
getItems
())){
for
(
cn
.
ibizlab
.
core
.
dict
.
domain
.
IBZDictItem
sub:
et
.
getItems
())
{
sub
.
setDictid
(
et
.
getDictid
());
if
(
ObjectUtils
.
isEmpty
(
sub
.
getItemid
()))
sub
.
setItemid
((
String
)
sub
.
getDefaultKey
(
true
));
_items
.
add
(
sub
.
getItemid
());
}
ibzdictitemService
.
saveBatch
(
et
.
getItems
(),
500
)
;
}
CachedBeanCopier
.
copy
(
get
(
et
.
getDictid
()),
et
);
IBZDict
newet
=
get
(
et
.
getDictid
());
//删除多余的嵌套[字典项目]
if
(
_items
.
size
()>
0
&&(!
ObjectUtils
.
isEmpty
(
et
.
getItems
()))){
List
<
String
>
ids
=
new
ArrayList
<
String
>();
for
(
cn
.
ibizlab
.
core
.
dict
.
domain
.
IBZDictItem
sub:
et
.
getItems
())
{
if
(!
_items
.
contains
(
sub
.
getItemid
()))
ids
.
add
(
sub
.
getItemid
());
}
ibzdictitemService
.
removeBatch
(
ids
,
500
)
;
}
CachedBeanCopier
.
copy
(
newet
,
et
);
return
ret
;
}
@Override
@Transactional
public
remove
(
String
key
)
{
IBZDict
et
=
get
(
key
);
//嵌套[字典项目]
if
(!
ObjectUtils
.
isEmpty
(
et
.
getItems
())){
List
<
String
>
ids
=
new
ArrayList
<
String
>();
for
(
cn
.
ibizlab
.
core
.
dict
.
domain
.
IBZDictItem
sub:
et
.
getItems
())
{
ids
.
add
(
sub
.
get
Dict
id
());
ids
.
add
(
sub
.
get
Item
id
());
}
ibzdictitemService
.
removeBatch
(
ids
,
500
)
;
}
...
...
@@ -140,8 +154,8 @@ public class IBZDictServiceImpl extends ServiceImpl<IBZDictMapper, IBZDict> impl
*/
@Override
public
Page
<
IBZDict
>
searchDefault
(
IBZDictSearchContext
context
)
{
com
.
baomidou
.
mybatisplus
.
extension
.
plugins
.
pagination
.
Page
<
IBZDict
>
iBZDict
s
=
baseMapper
.
searchDefault
(
context
.
getPage
(),
context
,
context
.
getSelectCond
());
return
new
PageImpl
<
IBZDict
>(
iBZDicts
.
getRecords
(),
context
.
getPageable
(),
iBZDict
s
.
getTotal
());
com
.
baomidou
.
mybatisplus
.
extension
.
plugins
.
pagination
.
Page
<
IBZDict
>
page
s
=
baseMapper
.
searchDefault
(
context
.
getPage
(),
context
,
context
.
getSelectCond
());
return
new
PageImpl
<
IBZDict
>(
pages
.
getRecords
(),
context
.
getPageable
(),
page
s
.
getTotal
());
}
...
...
ibzdict-util/src/main/java/cn/ibizlab/util/domain/EntityBase.java
浏览文件 @
80c28d6e
...
...
@@ -3,6 +3,7 @@ package cn.ibizlab.util.domain;
import
com.alibaba.fastjson.annotation.JSONField
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.IdWorker
;
import
com.fasterxml.jackson.annotation.JsonIgnore
;
import
lombok.Data
;
import
java.io.Serializable
;
...
...
@@ -43,6 +44,11 @@ public class EntityBase implements Serializable {
return
wrapper
;
}
public
Serializable
getDefaultKey
(
boolean
gen
)
{
return
IdWorker
.
get32UUID
();
}
}
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录