Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzdisk
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzdisk
提交
f5e275fe
提交
f5e275fe
编写于
6月 30, 2020
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ibiz4j 发布系统代码
上级
32dc0933
变更
44
显示空白字符变更
内嵌
并排
正在显示
44 个修改的文件
包含
1056 行增加
和
208 行删除
+1056
-208
app-form-group.vue
app_web/src/components/app-form-group/app-form-group.vue
+31
-0
app-mpicker.vue
app_web/src/components/app-mpicker/app-mpicker.vue
+32
-7
context-menu-drag.vue
...eb/src/components/context-menu-drag/context-menu-drag.vue
+2
-2
filter-mode.vue
app_web/src/components/filter-tree/filter-mode.vue
+73
-0
filter-tree.less
app_web/src/components/filter-tree/filter-tree.less
+43
-0
filter-tree.vue
app_web/src/components/filter-tree/filter-tree.vue
+113
-0
tab-page-exp.less
app_web/src/components/tab-page-exp/tab-page-exp.less
+3
-1
md-view-engine.ts
app_web/src/engine/view/md-view-engine.ts
+3
-0
components_en_US.ts
app_web/src/locale/lanres/components/components_en_US.ts
+4
-0
components_zh_CN.ts
app_web/src/locale/lanres/components/components_zh_CN.ts
+4
-0
form-detail.ts
app_web/src/model/form-detail/form-detail.ts
+19
-0
form-group-panel.ts
app_web/src/model/form-detail/form-group-panel.ts
+36
-0
sdfile-edit-view-base.vue
...src/pages/disk/sdfile-edit-view/sdfile-edit-view-base.vue
+4
-4
sdfile-grid-view-base.vue
...src/pages/disk/sdfile-grid-view/sdfile-grid-view-base.vue
+11
-4
sdindex-view-base.vue
app_web/src/pages/disk/sdindex-view/sdindex-view-base.vue
+14
-6
sdindex-view.less
app_web/src/pages/disk/sdindex-view/sdindex-view.less
+1
-0
app-center-service.ts
app_web/src/service/app/app-center-service.ts
+105
-0
sdfile-service-base.ts
app_web/src/service/sdfile/sdfile-service-base.ts
+1
-1
getters.ts
app_web/src/store/modules/auth-resource/getters.ts
+6
-4
view-tool.ts
app_web/src/utils/view-tool/view-tool.ts
+3
-4
sdindex-view-appmenu-base.vue
...ts/app/sdindex-view-appmenu/sdindex-view-appmenu-base.vue
+1
-0
default-searchform-base.vue
...ets/sdfile/default-searchform/default-searchform-base.vue
+1
-0
default-searchform-service.ts
...s/sdfile/default-searchform/default-searchform-service.ts
+2
-0
main-form-base.vue
app_web/src/widgets/sdfile/main-form/main-form-base.vue
+1
-1
main-form-model.ts
app_web/src/widgets/sdfile/main-form/main-form-model.ts
+6
-6
main-form-service.ts
app_web/src/widgets/sdfile/main-form/main-form-service.ts
+1
-1
main-grid-base.vue
app_web/src/widgets/sdfile/main-grid/main-grid-base.vue
+1
-1
main-grid-model.ts
app_web/src/widgets/sdfile/main-grid/main-grid-model.ts
+5
-5
main-grid-service.ts
app_web/src/widgets/sdfile/main-grid/main-grid-service.ts
+1
-1
DevBootApplication.java
...isk-boot/src/main/java/cn/ibizlab/DevBootApplication.java
+1
-0
SDFile.java
...ore/src/main/java/cn/ibizlab/core/disk/domain/SDFile.java
+116
-55
SDFileSearchContext.java
...java/cn/ibizlab/core/disk/filter/SDFileSearchContext.java
+9
-10
SDFileMapper.java
...c/main/java/cn/ibizlab/core/disk/mapper/SDFileMapper.java
+65
-0
ISDFileService.java
...ain/java/cn/ibizlab/core/disk/service/ISDFileService.java
+19
-2
SDFileServiceImpl.java
.../cn/ibizlab/core/disk/service/impl/SDFileServiceImpl.java
+83
-54
MybatisConfiguration.java
...ava/cn/ibizlab/core/util/config/MybatisConfiguration.java
+9
-1
SDFileMapper.xml
...re/src/main/resources/mapper/disk/sdfile/SDFileMapper.xml
+67
-0
SDFileDTO.java
...vider-api/src/main/java/cn/ibizlab/api/dto/SDFileDTO.java
+36
-36
ibzdiskapiApplication.java
...i/src/main/java/cn/ibizlab/api/ibzdiskapiApplication.java
+1
-0
SDFileResource.java
...api/src/main/java/cn/ibizlab/api/rest/SDFileResource.java
+2
-0
VersionCheck.java
...rc/main/java/cn/ibizlab/util/annotation/VersionCheck.java
+15
-0
VersionCheckAspect.java
.../main/java/cn/ibizlab/util/aspect/VersionCheckAspect.java
+98
-0
LayeringCache.java
.../main/java/cn/ibizlab/util/cache/cache/LayeringCache.java
+4
-2
AppController.java
...til/src/main/java/cn/ibizlab/util/rest/AppController.java
+4
-0
未找到文件。
app_web/src/components/app-form-group/app-form-group.vue
浏览文件 @
f5e275fe
...
...
@@ -93,6 +93,11 @@
<
template
v
-
if
=
"!Object.is(layoutType, 'FLEX')"
>
<
row
:
gutter
=
"10"
><
slot
><
/slot></
row
>
<
/template
>
<
template
v
-
if
=
"isManageContainer"
>
<
i
-
button
type
=
"primary"
:
icon
=
"manageContainerStatus?'ios-repeat':'ios-more'"
@
click
=
"doManageContainer"
>
{{
manageContainerStatus
?
$t
(
'components.appFormGroup.hide'
):
$t
(
'components.appFormGroup.showMore'
)
}}
<
/i-button
>
<
/template
>
<
/card
>
<
template
v
-
if
=
"isShowCaption === false"
>
<
slot
><
/slot
>
...
...
@@ -115,6 +120,22 @@ export default class AppFormGroup extends Vue {
*/
@
Prop
()
public
caption
?:
string
;
/**
* 是否为管理容器
*
* @type {string
}
* @memberof AppFormGroup
*/
@
Prop
({
default
:
false
}
)
public
isManageContainer
?:
boolean
;
/**
* 管理容器状态
*
* @type {string
}
* @memberof AppFormGroup
*/
@
Prop
({
default
:
false
}
)
public
manageContainerStatus
?:
boolean
;
/**
* 内置界面样式
*
...
...
@@ -244,6 +265,16 @@ export default class AppFormGroup extends Vue {
public
doUIAction
(
$event
:
any
,
item
:
any
):
void
{
this
.
$emit
(
'groupuiactionclick'
,
{
event
:
$event
,
item
:
item
}
);
}
/**
* 操作管理容器
*
* @param {*
}
$event
* @memberof AppFormGroup
*/
public
doManageContainer
(){
this
.
$emit
(
'managecontainerclick'
);
}
}
<
/script
>
<
style
lang
=
'less'
>
...
...
app_web/src/components/app-mpicker/app-mpicker.vue
浏览文件 @
f5e275fe
...
...
@@ -44,6 +44,11 @@ export default class AppMpicker extends Vue {
*/
@
Prop
()
curvalue
?:
any
;
/**
* 值项
*/
@
Prop
()
valueitem
?:
any
;
/**
* 局部上下文导航参数
*
...
...
@@ -144,6 +149,7 @@ export default class AppMpicker extends Vue {
this
.
value
=
[];
this
.
selectItems
=
[];
if
(
newVal
)
{
try
{
this
.
selectItems
=
this
.
parseValue
(
JSON
.
parse
(
newVal
));
this
.
selectItems
.
forEach
((
item
:
any
)
=>
{
this
.
value
.
push
(
item
[
this
.
deKeyField
]);
...
...
@@ -152,6 +158,25 @@ export default class AppMpicker extends Vue {
this
.
items
.
push
({
[
this
.
deMajorField
]:
item
[
this
.
deMajorField
],
[
this
.
deKeyField
]:
item
[
this
.
deKeyField
]
});
}
});
}
catch
(
error
)
{
if
(
error
.
name
===
'SyntaxError'
){
let
srfkeys
:
any
=
newVal
.
split
(
','
);
let
srfmajortexts
:
any
=
null
;
if
(
this
.
valueitem
&&
this
.
activeData
[
this
.
valueitem
]){
srfmajortexts
=
this
.
activeData
[
this
.
valueitem
].
split
(
','
);
}
if
(
srfkeys
.
length
&&
srfkeys
.
length
>
0
&&
srfmajortexts
.
length
&&
srfmajortexts
.
length
>
0
&&
srfkeys
.
length
==
srfmajortexts
.
length
){
srfkeys
.
forEach
((
id
:
any
,
index
:
number
)
=>
{
this
.
value
.
push
(
id
);
this
.
selectItems
.
push
({[
this
.
deKeyField
]:
id
,
[
this
.
deMajorField
]:
srfmajortexts
[
index
]});
let
_index
=
this
.
items
.
findIndex
((
i
)
=>
Object
.
is
(
i
[
this
.
deKeyField
],
id
));
if
(
_index
<
0
)
{
this
.
items
.
push
({[
this
.
deKeyField
]:
id
,
[
this
.
deMajorField
]:
srfmajortexts
[
index
]});
}
});
}
}
}
}
this
.
$forceUpdate
();
}
...
...
app_web/src/components/context-menu-drag/context-menu-drag.vue
浏览文件 @
f5e275fe
...
...
@@ -25,7 +25,7 @@
</span>
</el-col>
<el-col
:span=
"14"
>
<span>
{{
item
.
label
}}
</span>
<span>
{{
item
.
fullName
?
item
.
fullName
:
item
.
label
}}
</span>
</el-col>
<el-col
:span=
"6"
>
<div
class=
"bar"
>
...
...
@@ -46,7 +46,7 @@
<Drawer
class-name=
"menu-drawer"
width=
"60"
:closable=
"true"
:mask=
"false"
placement=
"left"
v-model=
"rightDrawerVisiable"
>
<div
class=
"menuItems"
>
<div
@
click=
"skipTo(item)"
class=
"item"
v-for=
"(item) in list"
:key=
"item.id"
>
<span
class=
"title"
>
{{
item
.
label
}}
</span>
<span
class=
"title"
>
{{
item
.
fullName
?
item
.
fullName
:
item
.
label
}}
</span>
<span
v-if=
"isStar(item.id)"
class=
"star"
@
click
.
stop=
"outStar(item)"
>
<Icon
type=
"ios-star"
/>
</span>
...
...
app_web/src/components/filter-tree/filter-mode.vue
0 → 100644
浏览文件 @
f5e275fe
<
template
>
<el-select
size=
"small"
class=
"filter-mode"
placeholder=
"条件逻辑"
clearable
v-model=
"curVal"
@
change=
"onChange"
>
<el-option
v-for=
"mode in filterMode"
:key=
"mode.value"
:label=
"mode.en"
:value=
"mode.value"
>
</el-option>
</el-select>
</
template
>
<
script
lang=
"ts"
>
import
{
Vue
,
Component
,
Model
}
from
"vue-property-decorator"
;
@
Component
({})
export
default
class
FilterMode
extends
Vue
{
/**
* 值属性
*
* @type {*}
* @memberof FilterMode
*/
@
Model
(
'change'
)
readonly
value
:
any
;
get
curVal
()
{
return
this
.
value
;
}
set
curVal
(
val
:
any
)
{
const
type
:
string
=
this
.
$util
.
typeOf
(
val
);
val
=
Object
.
is
(
type
,
'null'
)
||
Object
.
is
(
type
,
'undefined'
)
?
undefined
:
val
;
this
.
$emit
(
'change'
,
val
);
}
/**
* 过滤模式
*
* @type {*}
* @memberof FilterMode
*/
public
filterMode
:
any
[]
=
[
// { name: 'AND', value: '$and' },
// { name: 'OR', value: '$or' },
{
zh
:
'等于(=)'
,
en
:
'EQ'
,
value
:
'$eq'
},
{
zh
:
''
,
en
:
'NE'
,
value
:
'$ne'
},
{
zh
:
''
,
en
:
'GT'
,
value
:
'$gt'
},
{
zh
:
''
,
en
:
'GE'
,
value
:
'$gte'
},
{
zh
:
''
,
en
:
'LT'
,
value
:
'$lt'
},
{
zh
:
''
,
en
:
'LE'
,
value
:
'$lte'
},
{
zh
:
''
,
en
:
'IS_NULL'
,
value
:
'$null'
},
{
zh
:
''
,
en
:
'IS_NOT_NULL'
,
value
:
'$notNull'
},
{
zh
:
''
,
en
:
'IN'
,
value
:
'$in'
},
{
zh
:
''
,
en
:
'NOTIN'
,
value
:
'$notIn'
},
{
zh
:
''
,
en
:
'LIKE'
,
value
:
'$like'
},
{
zh
:
''
,
en
:
'LIFTLIKE'
,
value
:
'$startsWith'
},
{
zh
:
''
,
en
:
'RIGHTLIKE'
,
value
:
'$endsWith'
},
{
zh
:
''
,
en
:
'EXISTS'
,
value
:
'$exists'
},
{
zh
:
''
,
en
:
'NOTEXISTS'
,
value
:
'$notExists'
}
];
/**
* 值改变
*
* @memberof FilterMode
*/
public
onChange
()
{
this
.
$emit
(
'mode-change'
,
this
.
value
);
}
}
</
script
>
\ No newline at end of file
app_web/src/components/filter-tree/filter-tree.less
0 → 100644
浏览文件 @
f5e275fe
.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 {
.el-tree-node__content {
height: 40px;
.filter-tree-item {
display: flex;
>div {
margin-right: 10px;
}
>div:nth-last-child(1) {
margin-right: 0;
}
.filter-tree-action {
margin-left: 20px;
.ivu-btn {
margin-right: 5px;
}
}
}
}
}
\ No newline at end of file
app_web/src/components/filter-tree/filter-tree.vue
0 → 100644
浏览文件 @
f5e275fe
<
template
>
<el-tree
class=
"filter-tree"
:data=
"treeItems"
:props=
"defaultProps"
:expand-on-click-node=
"false"
default-expand-all
>
<template
slot-scope=
"
{ node, data }">
<template
v-if=
"Object.is(data.name, '$and') || Object.is(data.name, '$or')"
>
<div
class=
"filter-tree-item"
>
<el-select
size=
"small"
v-model=
"data.name"
>
<el-option
v-for=
"mode in relationModes"
:key=
"mode.value"
:label=
"mode.zh"
:value=
"mode.value"
></el-option>
</el-select>
<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=
"onAddGroup(data)"
><i
class=
"fa fa-plus"
aria-hidden=
"true"
></i>
添加组
</i-button>
</div>
</div>
</
template
>
<
template
v-else
>
<div
class=
"filter-tree-item"
>
<el-select
size=
"small"
class=
"filter-item-field"
v-model=
"data.field"
clearable
placeholder=
"属性"
@
change=
"onFieldChange(data)"
>
<el-option
v-for=
"item in fields"
:key=
"item.prop"
:label=
"item.label"
:value=
"item.name"
>
</el-option>
</el-select>
<filter-mode
class=
"filter-item-mode"
v-model=
"data.mode"
></filter-mode>
<div
class=
"filter-item-value"
>
<i-input
v-if=
"!data.field"
></i-input>
<slot
v-else
:data=
"data"
></slot>
</div>
<div
class=
"filter-tree-action"
>
<i-button
@
click=
"onRemoveItem(node, data)"
title=
"删除"
><i
class=
"fa fa-trash-o"
aria-hidden=
"true"
></i></i-button>
</div>
</div>
</
template
>
</template>
</el-tree>
</template>
<
script
lang=
"ts"
>
import
{
Vue
,
Component
,
Prop
}
from
'vue-property-decorator'
;
import
FilterMode
from
'./filter-mode.vue'
;
@
Component
({
components
:
{
FilterMode
}
})
export
default
class
FilterTree
extends
Vue
{
@
Prop
()
datas
:
any
;
@
Prop
()
fields
:
any
;
protected
defaultProps
:
any
=
{
children
:
'items'
,
label
:
'name'
};
protected
relationModes
:
any
[]
=
[
{
zh
:
'并且'
,
en
:
'AND'
,
value
:
'$and'
},
{
zh
:
'或'
,
en
:
'OR'
,
value
:
'$or'
}
];
get
treeItems
()
{
let
root
:
any
=
{
name
:
'$and'
,
items
:
this
.
datas
};
if
(
this
.
datas
.
length
==
0
)
{
this
.
onAddItem
(
root
);
this
.
onAddItem
(
root
);
}
return
[
root
];
}
public
onFieldChange
(
data
:
any
)
{
if
(
!
data
.
mode
)
{
data
.
mode
=
'$eq'
;
}
}
public
onAddItem
(
data
:
any
)
{
if
(
data
&&
data
.
items
)
{
data
.
items
.
push
({
field
:
null
,
mode
:
null
});
}
}
public
onAddGroup
(
data
:
any
)
{
if
(
data
&&
data
.
items
)
{
data
.
items
.
push
({
name
:
'$and'
,
items
:
[]
})
}
}
public
onRemoveItem
(
node
:
any
,
data
:
any
)
{
if
(
node
&&
node
.
parent
)
{
let
pData
:
any
=
node
.
parent
.
data
;
if
(
pData
.
items
.
indexOf
(
data
)
>=
0
)
{
pData
.
items
.
splice
(
pData
.
items
.
indexOf
(
data
),
1
)
}
}
}
}
</
script
>
<
style
lang=
"less"
>
@import './filter-tree.less';
</
style
>
\ No newline at end of file
app_web/src/components/tab-page-exp/tab-page-exp.less
浏览文件 @
f5e275fe
.ibiz-page-tag {
position: relative;
margin: 8px 0;
.left{
.el-tabs__header{
padding-right:120px;
...
...
@@ -60,7 +61,8 @@
border-bottom:2px solid transparent !important;
}
.el-tabs__header{
margin:0 0 1 0;
margin:0;
border-bottom: none;
}
}
}
...
...
app_web/src/engine/view/md-view-engine.ts
浏览文件 @
f5e275fe
...
...
@@ -395,6 +395,9 @@ export default class MDViewEngine extends ViewEngine {
if
(
this
.
getSearchForm
()
&&
this
.
view
.
isExpandSearchForm
)
{
Object
.
assign
(
arg
,
this
.
getSearchForm
().
getData
());
}
if
(
this
.
view
&&
this
.
view
.
searchbar
)
{
Object
.
assign
(
arg
,
this
.
view
.
searchbar
.
getData
());
}
if
(
this
.
view
&&
!
this
.
view
.
isExpandSearchForm
)
{
Object
.
assign
(
arg
,
{
query
:
this
.
view
.
query
});
}
...
...
app_web/src/locale/lanres/components/components_en_US.ts
浏览文件 @
f5e275fe
...
...
@@ -169,4 +169,8 @@ export default {
YouYuan
:
'YouYuan'
,
},
},
appFormGroup
:
{
hide
:
'hide'
,
showMore
:
'show more'
,
},
};
\ No newline at end of file
app_web/src/locale/lanres/components/components_zh_CN.ts
浏览文件 @
f5e275fe
...
...
@@ -170,4 +170,8 @@ export default {
YouYuan
:
'幼圆'
,
},
},
appFormGroup
:
{
hide
:
'隐藏字段'
,
showMore
:
'显示更多字段'
,
},
};
\ No newline at end of file
app_web/src/model/form-detail/form-detail.ts
浏览文件 @
f5e275fe
...
...
@@ -46,6 +46,22 @@ export class FormDetailModel {
*/
public
visible
:
boolean
=
true
;
/**
* 成员是否显示(旧)
*
* @type {boolean}
* @memberof FormDetailModel
*/
public
oldVisible
:
boolean
=
true
;
/**
* 成员是否为受控内容
*
* @type {boolean}
* @memberof FormDetailModel
*/
public
isControlledContent
:
boolean
=
false
;
/**
* 成员是否显示标题
*
...
...
@@ -54,6 +70,7 @@ export class FormDetailModel {
*/
public
isShowCaption
:
boolean
=
true
;
/**
* Creates an instance of FormDetailModel.
* FormDetailModel 实例
...
...
@@ -67,7 +84,9 @@ export class FormDetailModel {
this
.
form
=
opts
.
form
?
opts
.
form
:
{};
this
.
name
=
!
Object
.
is
(
opts
.
name
,
''
)
?
opts
.
name
:
''
;
this
.
visible
=
opts
.
visible
?
true
:
false
;
this
.
oldVisible
=
opts
.
visible
?
true
:
false
;
this
.
isShowCaption
=
opts
.
isShowCaption
?
true
:
false
;
this
.
isControlledContent
=
opts
.
isControlledContent
?
true
:
false
;
}
/**
...
...
app_web/src/model/form-detail/form-group-panel.ts
浏览文件 @
f5e275fe
...
...
@@ -17,6 +17,30 @@ export class FormGroupPanelModel extends FormDetailModel {
*/
public
uiActionGroup
:
any
=
{};
/**
* 受控内容组
*
* @type {*}
* @memberof FormGroupPanelModel
*/
public
showMoreModeItems
:
any
=
[];
/**
* 是否为管理容器
*
* @type {*}
* @memberof FormGroupPanelModel
*/
public
isManageContainer
:
boolean
=
false
;
/**
* 管理容器状态 true显示 false隐藏
*
* @type {*}
* @memberof FormGroupPanelModel
*/
public
manageContainerStatus
:
boolean
=
true
;
/**
* Creates an instance of FormGroupPanelModel.
* 创建 FormGroupPanelModel 实例
...
...
@@ -27,5 +51,17 @@ export class FormGroupPanelModel extends FormDetailModel {
constructor
(
opts
:
any
=
{})
{
super
(
opts
);
Object
.
assign
(
this
.
uiActionGroup
,
opts
.
uiActionGroup
);
this
.
showMoreModeItems
=
opts
.
showMoreModeItems
;
this
.
isManageContainer
=
opts
.
isManageContainer
?
true
:
false
;
}
/**
* 设置管理容器状态
*
* @param {boolean} state
* @memberof FormGroupPanelModel
*/
public
setManageContainerStatus
(
state
:
boolean
):
void
{
this
.
manageContainerStatus
=
state
;
}
}
\ No newline at end of file
app_web/src/pages/disk/sdfile-edit-view/sdfile-edit-view-base.vue
浏览文件 @
f5e275fe
...
...
@@ -543,8 +543,8 @@ export default class SDFileEditViewBase extends Vue {
*
* @memberof SDFileEditViewBase
*/
public
initNavDataWithRoute
(
data
:
any
=
null
,
isNew
:
boolean
=
false
){
if
(
this
.
viewDefaultUsage
&&
Object
.
is
(
this
.
navModel
,
"route"
)
){
public
initNavDataWithRoute
(
data
:
any
=
null
,
isNew
:
boolean
=
false
,
isAlways
:
boolean
=
false
){
if
(
isAlways
||
(
this
.
viewDefaultUsage
&&
Object
.
is
(
this
.
navModel
,
"route"
))
){
this
.
navDataService
.
addNavData
({
id
:
'sdfile-edit-view'
,
tag
:
this
.
viewtag
,
srfkey
:
isNew
?
null
:
this
.
context
.
sdfile
,
title
:
this
.
$t
(
this
.
model
.
srfTitle
),
data
:
data
,
context
:
this
.
context
,
viewparams
:
this
.
viewparams
,
path
:
this
.
$route
.
fullPath
});
}
}
...
...
@@ -554,8 +554,8 @@ export default class SDFileEditViewBase extends Vue {
*
* @memberof SDFileEditViewBase
*/
public
initNavDataWithTab
(
data
:
any
=
null
,
isOnlyAdd
:
boolean
=
true
){
if
(
this
.
viewDefaultUsage
&&
!
Object
.
is
(
this
.
navModel
,
"route"
)
){
public
initNavDataWithTab
(
data
:
any
=
null
,
isOnlyAdd
:
boolean
=
true
,
isAlways
:
boolean
=
false
){
if
(
isAlways
||
(
this
.
viewDefaultUsage
&&
!
Object
.
is
(
this
.
navModel
,
"route"
))
){
this
.
navDataService
.
addNavDataByOnly
({
id
:
'sdfile-edit-view'
,
tag
:
this
.
viewtag
,
srfkey
:
this
.
context
.
sdfile
,
title
:
this
.
$t
(
this
.
model
.
srfTitle
),
data
:
data
,
context
:
this
.
context
,
viewparams
:
this
.
viewparams
,
path
:
this
.
$route
.
fullPath
},
isOnlyAdd
);
}
}
...
...
app_web/src/pages/disk/sdfile-grid-view/sdfile-grid-view-base.vue
浏览文件 @
f5e275fe
...
...
@@ -577,8 +577,8 @@ export default class SDFileGridViewBase extends Vue {
*
* @memberof SDFileGridViewBase
*/
public
initNavDataWithRoute
(
data
:
any
=
null
,
isNew
:
boolean
=
false
){
if
(
this
.
viewDefaultUsage
&&
Object
.
is
(
this
.
navModel
,
"route"
)
){
public
initNavDataWithRoute
(
data
:
any
=
null
,
isNew
:
boolean
=
false
,
isAlways
:
boolean
=
false
){
if
(
isAlways
||
(
this
.
viewDefaultUsage
&&
Object
.
is
(
this
.
navModel
,
"route"
))
){
this
.
navDataService
.
addNavData
({
id
:
'sdfile-grid-view'
,
tag
:
this
.
viewtag
,
srfkey
:
isNew
?
null
:
this
.
context
.
sdfile
,
title
:
this
.
$t
(
this
.
model
.
srfTitle
),
data
:
data
,
context
:
this
.
context
,
viewparams
:
this
.
viewparams
,
path
:
this
.
$route
.
fullPath
});
}
}
...
...
@@ -588,8 +588,8 @@ export default class SDFileGridViewBase extends Vue {
*
* @memberof SDFileGridViewBase
*/
public
initNavDataWithTab
(
data
:
any
=
null
,
isOnlyAdd
:
boolean
=
true
){
if
(
this
.
viewDefaultUsage
&&
!
Object
.
is
(
this
.
navModel
,
"route"
)
){
public
initNavDataWithTab
(
data
:
any
=
null
,
isOnlyAdd
:
boolean
=
true
,
isAlways
:
boolean
=
false
){
if
(
isAlways
||
(
this
.
viewDefaultUsage
&&
!
Object
.
is
(
this
.
navModel
,
"route"
))
){
this
.
navDataService
.
addNavDataByOnly
({
id
:
'sdfile-grid-view'
,
tag
:
this
.
viewtag
,
srfkey
:
this
.
context
.
sdfile
,
title
:
this
.
$t
(
this
.
model
.
srfTitle
),
data
:
data
,
context
:
this
.
context
,
viewparams
:
this
.
viewparams
,
path
:
this
.
$route
.
fullPath
},
isOnlyAdd
);
}
}
...
...
@@ -1248,6 +1248,13 @@ export default class SDFileGridViewBase extends Vue {
* @memberof SDFileGridView
*/
public
opendata
(
args
:
any
[],
fullargs
?:
any
[],
params
?:
any
,
$event
?:
any
,
xData
?:
any
)
{
if
(
!
this
.
viewDefaultUsage
){
if
(
Object
.
is
(
this
.
navModel
,
"route"
)){
this
.
initNavDataWithRoute
(
this
.
viewCacheData
,
false
,
true
);
}
else
{
this
.
initNavDataWithTab
(
this
.
viewCacheData
,
false
,
true
);
}
}
let
localContext
:
any
=
null
;
let
localViewParam
:
any
=
null
;
const
data
:
any
=
{};
...
...
app_web/src/pages/disk/sdindex-view/sdindex-view-base.vue
浏览文件 @
f5e275fe
...
...
@@ -6,7 +6,7 @@
<sider
:width=
"collapseChange ? 64 : 200"
hide-trigger
v-model=
"collapseChange"
>
<div
class=
"sider-top"
>
<div
class=
"page-logo"
>
<span
class=
"menuicon"
@
click=
"contextMenuDragVisiable=!contextMenuDragVisiable"
><Icon
type=
"md-menu"
/></span>
<span
class=
"menuicon"
v-if=
"isEnableAppSwitch"
@
click=
"contextMenuDragVisiable=!contextMenuDragVisiable"
><Icon
type=
"md-menu"
/></span>
<span
v-show=
"!collapseChange"
style=
"overflow-x: hidden;text-overflow: ellipsis;white-space: nowrap;display: block;text-align: center;font-weight: 300;font-size: 20px;"
>
{{
$t
(
model
.
srfCaption
)
}}
</span>
</div>
</div>
...
...
@@ -26,7 +26,7 @@
ref=
'appmenu'
@
closeview=
"closeView($event)"
>
</view
_appmenu
>
<context-menu-drag
:contextMenuDragVisiable=
"contextMenuDragVisiable"
></context-menu-drag>
<context-menu-drag
v-if=
"isEnableAppSwitch"
:contextMenuDragVisiable=
"contextMenuDragVisiable"
></context-menu-drag>
</sider>
<layout>
<header
class=
"index_header"
>
...
...
@@ -408,8 +408,8 @@ export default class SDIndexViewBase extends Vue {
*
* @memberof SDIndexViewBase
*/
public
initNavDataWithRoute
(
data
:
any
=
null
,
isNew
:
boolean
=
false
){
if
(
this
.
viewDefaultUsage
&&
Object
.
is
(
this
.
navModel
,
"route"
)
){
public
initNavDataWithRoute
(
data
:
any
=
null
,
isNew
:
boolean
=
false
,
isAlways
:
boolean
=
false
){
if
(
isAlways
||
(
this
.
viewDefaultUsage
&&
Object
.
is
(
this
.
navModel
,
"route"
))
){
this
.
navDataService
.
addNavData
({
id
:
'sdindex-view'
,
tag
:
this
.
viewtag
,
srfkey
:
isNew
?
null
:
null
,
title
:
this
.
$t
(
this
.
model
.
srfTitle
),
data
:
data
,
context
:
this
.
context
,
viewparams
:
this
.
viewparams
,
path
:
this
.
$route
.
fullPath
});
}
}
...
...
@@ -419,8 +419,8 @@ export default class SDIndexViewBase extends Vue {
*
* @memberof SDIndexViewBase
*/
public
initNavDataWithTab
(
data
:
any
=
null
,
isOnlyAdd
:
boolean
=
true
){
if
(
this
.
viewDefaultUsage
&&
!
Object
.
is
(
this
.
navModel
,
"route"
)
){
public
initNavDataWithTab
(
data
:
any
=
null
,
isOnlyAdd
:
boolean
=
true
,
isAlways
:
boolean
=
false
){
if
(
isAlways
||
(
this
.
viewDefaultUsage
&&
!
Object
.
is
(
this
.
navModel
,
"route"
))
){
this
.
navDataService
.
addNavDataByOnly
({
id
:
'sdindex-view'
,
tag
:
this
.
viewtag
,
srfkey
:
null
,
title
:
this
.
$t
(
this
.
model
.
srfTitle
),
data
:
data
,
context
:
this
.
context
,
viewparams
:
this
.
viewparams
,
path
:
this
.
$route
.
fullPath
},
isOnlyAdd
);
}
}
...
...
@@ -542,6 +542,14 @@ export default class SDIndexViewBase extends Vue {
*/
public
contextMenuDragVisiable
:
boolean
=
false
;
/**
* 是否支持应用切换
*
* @type {boolean}
* @memberof SDIndexViewBase
*/
public
isEnableAppSwitch
:
boolean
=
false
;
/**
* 初始化之前
*
...
...
app_web/src/pages/disk/sdindex-view/sdindex-view.less
浏览文件 @
f5e275fe
...
...
@@ -91,6 +91,7 @@
display: flex;
align-items: center;
height: 100%;
justify-content: center;
>.menuicon{
display: block;
text-align: center;
...
...
app_web/src/service/app/app-center-service.ts
0 → 100644
浏览文件 @
f5e275fe
import
{
Subject
}
from
'rxjs'
;
export
interface
Message
{
/**
* 名称(通常是应用实体名称)
*
* @memberof Message
*/
name
:
string
;
/**
* 行为(操作数据行为)
*
* @memberof Message
*/
action
:
string
;
/**
* 数据(操作数据)
*
* @memberof Message
*/
data
:
any
;
}
/**
* 应用中心服务类
*
* @export
* @class AppCenterService
*/
export
default
class
AppCenterService
{
/**
* Vue 状态管理器
*
* @private
* @type {*}
* @memberof AppCenterService
*/
private
static
store
:
any
;
/**
* 应用数据状态管理对象
*
* @private
* @type {Subject<any>}
* @memberof AppCenterService
*/
private
static
subject
:
Subject
<
any
>
=
new
Subject
<
any
>
();
/**
* 单例变量声明
*
* @private
* @static
* @type {AppCenterService}
* @memberof AppCenterService
*/
private
static
appCenterService
:
AppCenterService
;
/**
* 初始化实例
*
* @memberof AppCenterService
*/
constructor
()
{}
/**
* 获取 AppCenterService 单例对象
*
* @static
* @returns {AppCenterService}
* @memberof AppCenterService
*/
public
static
getInstance
(
store
:
any
):
AppCenterService
{
if
(
!
AppCenterService
.
appCenterService
)
{
AppCenterService
.
appCenterService
=
new
AppCenterService
();
}
this
.
store
=
store
;
return
this
.
appCenterService
;
}
/**
* 通知消息
*
* @static
* @memberof AppCenterService
*/
public
static
notifyMessage
(
message
:
Message
){
this
.
subject
.
next
(
message
);
}
/**
* 获取消息中心
*
* @static
* @memberof AppCenterService
*/
public
static
getMessageCenter
():
Subject
<
any
>
{
return
this
.
subject
;
}
}
\ No newline at end of file
app_web/src/service/sdfile/sdfile-service-base.ts
浏览文件 @
f5e275fe
...
...
@@ -4,5 +4,5 @@ Tip: If the failing expression is known to be legally refer to something that's
----
FTL stack trace ("~" means nesting-related):
- Failed at: ${item.getKeyPSAppDEField().getCodeNa... [in template "TEMPLCODE_zh_CN" at line 46
7
, column 26]
- Failed at: ${item.getKeyPSAppDEField().getCodeNa... [in template "TEMPLCODE_zh_CN" at line 46
6
, column 26]
----
\ No newline at end of file
app_web/src/store/modules/auth-resource/getters.ts
浏览文件 @
f5e275fe
...
...
@@ -44,9 +44,11 @@ export const getAuthMenu = (state: any) => (menu:any) =>{
resourceIndex
=
state
.
resourceData
.
findIndex
((
resourcetag
:
any
,
objIndex
:
any
,
objs
:
any
)
=>
{
return
Object
.
is
(
menu
.
resourcetag
,
resourcetag
);
})
}
menuIndex
=
state
.
menuData
.
findIndex
((
menutag
:
any
,
objIndex
:
any
,
objs
:
any
)
=>
{
return
Object
.
is
(
menu
.
authtag
,
menutag
);
})
return
(
resourceIndex
!==
-
1
||
menuIndex
!==
-
1
)?
true
:
false
;
}
else
{
return
true
;
}
}
\ No newline at end of file
app_web/src/utils/view-tool/view-tool.ts
浏览文件 @
f5e275fe
...
...
@@ -63,7 +63,7 @@ export class ViewTool {
public
static
buildUpRoutePath
(
route
:
Route
,
viewParam
:
any
=
{},
deResParameters
:
any
[],
parameters
:
any
[],
args
:
any
[],
data
:
any
):
string
{
const
indexRoutePath
=
this
.
getIndexRoutePath
(
route
);
const
deResRoutePath
=
this
.
getDeResRoutePath
(
viewParam
,
deResParameters
,
args
);
const
deRoutePath
=
this
.
getActiveRoutePath
(
parameters
,
args
,
data
);
const
deRoutePath
=
this
.
getActiveRoutePath
(
parameters
,
args
,
data
,
viewParam
);
return
`
${
indexRoutePath
}${
deResRoutePath
}${
deRoutePath
}
`
;
}
...
...
@@ -123,7 +123,7 @@ export class ViewTool {
* @returns {string}
* @memberof ViewTool
*/
public
static
getActiveRoutePath
(
parameters
:
any
[],
args
:
any
[],
data
:
any
):
string
{
public
static
getActiveRoutePath
(
parameters
:
any
[],
args
:
any
[],
data
:
any
,
viewParam
:
any
=
{}
):
string
{
let
routePath
:
string
=
''
;
// 不存在应用实体
if
(
parameters
&&
parameters
.
length
>
0
){
...
...
@@ -137,8 +137,7 @@ export class ViewTool {
let
[
arg
]
=
args
;
arg
=
arg
?
arg
:
{};
const
[{
pathName
:
_pathName
,
parameterName
:
_parameterName
},
{
pathName
:
_pathName2
,
parameterName
:
_parameterName2
}]
=
parameters
;
const
_value
:
any
=
arg
[
_parameterName
]
&&
!
Object
.
is
(
arg
[
_parameterName
],
''
)
?
arg
[
_parameterName
]
:
null
;
const
_value
:
any
=
arg
[
_parameterName
]
||
viewParam
[
_parameterName
]
||
null
;
routePath
=
`/
${
_pathName
}
/
${
_value
}
/
${
_pathName2
}
`
;
if
(
Object
.
keys
(
data
).
length
>
0
)
{
routePath
=
`
${
routePath
}
?
${
qs
.
stringify
(
data
,
{
delimiter
:
';'
})}
`
;
...
...
app_web/src/widgets/app/sdindex-view-appmenu/sdindex-view-appmenu-base.vue
浏览文件 @
f5e275fe
...
...
@@ -124,6 +124,7 @@ import { Subject, Subscription } from 'rxjs';
import
{
ControlInterface
}
from
'@/interface/control'
;
import
{
UIActionTool
,
Util
}
from
'@/utils'
;
import
NavDataService
from
'@/service/app/navdata-service'
;
import
AppCenterService
from
"@service/app/app-center-service"
;
import
SDIndexViewService
from
'./sdindex-view-appmenu-service'
;
import
SDIndexViewModel
from
'./sdindex-view-appmenu-model'
;
...
...
app_web/src/widgets/sdfile/default-searchform/default-searchform-base.vue
浏览文件 @
f5e275fe
...
...
@@ -28,6 +28,7 @@ import { Subject, Subscription } from 'rxjs';
import
{
ControlInterface
}
from
'@/interface/control'
;
import
{
UIActionTool
,
Util
}
from
'@/utils'
;
import
NavDataService
from
'@/service/app/navdata-service'
;
import
AppCenterService
from
"@service/app/app-center-service"
;
import
SDFileService
from
'@/service/sdfile/sdfile-service'
;
import
DefaultService
from
'./default-searchform-service'
;
...
...
app_web/src/widgets/sdfile/default-searchform/default-searchform-service.ts
浏览文件 @
f5e275fe
...
...
@@ -80,6 +80,8 @@ export default class DefaultService extends ControlService {
*/
@
Errorlog
public
getItems
(
serviceName
:
string
,
interfaceName
:
string
,
context
:
any
=
{},
data
:
any
,
isloading
?:
boolean
):
Promise
<
any
[]
>
{
data
.
page
=
data
.
page
?
data
.
page
:
0
;
data
.
size
=
data
.
size
?
data
.
size
:
1000
;
return
Promise
.
reject
([])
}
...
...
app_web/src/widgets/sdfile/main-form/main-form-base.vue
浏览文件 @
f5e275fe
...
...
@@ -4,5 +4,5 @@ Tip: If the failing expression is known to be legally refer to something that's
----
FTL stack trace ("~" means nesting-related):
- Failed at: ${appde.getKeyPSAppDEField().getCodeN... [in template "TEMPLCODE_zh_CN" at line 10
38
, column 18]
- Failed at: ${appde.getKeyPSAppDEField().getCodeN... [in template "TEMPLCODE_zh_CN" at line 10
57
, column 18]
----
\ No newline at end of file
app_web/src/widgets/sdfile/main-form/main-form-model.ts
浏览文件 @
f5e275fe
...
...
@@ -62,17 +62,17 @@ export default class MainModel {
},
{
name
:
'filepath'
,
prop
:
'filepath'
,
prop
:
'file
_
path'
,
dataType
:
'TEXT'
,
},
{
name
:
'filesize'
,
prop
:
'filesize'
,
prop
:
'file
_
size'
,
dataType
:
'INT'
,
},
{
name
:
'fileext'
,
prop
:
'
fileext
'
,
prop
:
'
extension
'
,
dataType
:
'TEXT'
,
},
{
...
...
@@ -82,17 +82,17 @@ export default class MainModel {
},
{
name
:
'digestcode'
,
prop
:
'digestcode'
,
prop
:
'digest
_
code'
,
dataType
:
'TEXT'
,
},
{
name
:
'ownerid'
,
prop
:
'ownerid'
,
prop
:
'owner
_
id'
,
dataType
:
'TEXT'
,
},
{
name
:
'ownertype'
,
prop
:
'ownertype'
,
prop
:
'owner
_
type'
,
dataType
:
'TEXT'
,
},
{
...
...
app_web/src/widgets/sdfile/main-form/main-form-service.ts
浏览文件 @
f5e275fe
...
...
@@ -4,5 +4,5 @@ Tip: If the failing expression is known to be legally refer to something that's
----
FTL stack trace ("~" means nesting-related):
- Failed at: ${appde.getKeyPSAppDEField().getCodeN... [in template "TEMPLCODE_zh_CN" at line 35
0
, column 14]
- Failed at: ${appde.getKeyPSAppDEField().getCodeN... [in template "TEMPLCODE_zh_CN" at line 35
2
, column 14]
----
\ No newline at end of file
app_web/src/widgets/sdfile/main-grid/main-grid-base.vue
浏览文件 @
f5e275fe
...
...
@@ -4,5 +4,5 @@ Tip: If the failing expression is known to be legally refer to something that's
----
FTL stack trace ("~" means nesting-related):
- Failed at: ${ctrl.getPSAppDataEntity().getMajorP... [in template "TEMPLCODE_zh_CN" at line
886
, column 39]
- Failed at: ${ctrl.getPSAppDataEntity().getMajorP... [in template "TEMPLCODE_zh_CN" at line
903
, column 39]
----
\ No newline at end of file
app_web/src/widgets/sdfile/main-grid/main-grid-model.ts
浏览文件 @
f5e275fe
...
...
@@ -28,12 +28,12 @@ export default class MainModel {
return
[
{
name
:
'fileext'
,
prop
:
'
fileext
'
,
prop
:
'
extension
'
,
dataType
:
'TEXT'
,
},
{
name
:
'filepath'
,
prop
:
'filepath'
,
prop
:
'file
_
path'
,
dataType
:
'TEXT'
,
},
{
...
...
@@ -48,7 +48,7 @@ export default class MainModel {
},
{
name
:
'ownerid'
,
prop
:
'ownerid'
,
prop
:
'owner
_
id'
,
dataType
:
'TEXT'
,
},
{
...
...
@@ -73,7 +73,7 @@ export default class MainModel {
},
{
name
:
'filesize'
,
prop
:
'filesize'
,
prop
:
'file
_
size'
,
dataType
:
'INT'
,
},
{
...
...
@@ -83,7 +83,7 @@ export default class MainModel {
},
{
name
:
'ownertype'
,
prop
:
'ownertype'
,
prop
:
'owner
_
type'
,
dataType
:
'TEXT'
,
},
{
...
...
app_web/src/widgets/sdfile/main-grid/main-grid-service.ts
浏览文件 @
f5e275fe
...
...
@@ -4,5 +4,5 @@ Tip: If the failing expression is known to be legally refer to something that's
----
FTL stack trace ("~" means nesting-related):
- Failed at: ${appde.getKeyPSAppDEField().getCodeN... [in template "TEMPLCODE_zh_CN" at line 35
7
, column 35]
- Failed at: ${appde.getKeyPSAppDEField().getCodeN... [in template "TEMPLCODE_zh_CN" at line 35
9
, column 35]
----
\ No newline at end of file
ibzdisk-boot/src/main/java/cn/ibizlab/DevBootApplication.java
浏览文件 @
f5e275fe
...
...
@@ -19,6 +19,7 @@ import java.util.List;
@EnableTransactionManagement
@EnableFeignClients
(
basePackages
=
{
"cn.ibizlab"
})
@SpringBootApplication
(
exclude
=
{
org
.
springframework
.
boot
.
autoconfigure
.
mongo
.
MongoAutoConfiguration
.
class
,
})
@ComponentScan
(
basePackages
=
{
"cn.ibizlab"
}
// ,excludeFilters={
...
...
ibzdisk-core/src/main/java/cn/ibizlab/core/disk/domain/SDFile.java
浏览文件 @
f5e275fe
...
...
@@ -23,142 +23,203 @@ import lombok.*;
import
org.springframework.data.annotation.Transient
;
import
org.springframework.data.mongodb.core.mapping.Document
;
import
org.springframework.data.annotation.Id
;
import
org.springframework.data.mongodb.core.mapping.Document
;
import
org.springframework.data.mongodb.core.mapping.Field
;
import
org.springframework.data.mongodb.core.mapping.FieldType
;
import
cn.ibizlab.util.domain.EntityMongo
;
import
com.fasterxml.jackson.annotation.JsonIgnoreProperties
;
import
com.baomidou.mybatisplus.annotation.*
;
import
cn.ibizlab.util.domain.EntityMP
;
/**
*
大数据 [文件] 对象
*
实体[文件]
*/
@Data
@Document
(
collection
=
"sdfile"
)
public
class
SDFile
extends
EntityMongo
implements
Serializable
{
@Getter
@Setter
@NoArgsConstructor
@JsonIgnoreProperties
(
value
=
"handler"
)
@TableName
(
value
=
"IBZFILE"
,
resultMap
=
"SDFileResultMap"
)
public
class
SDFile
extends
EntityMP
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 标识
*/
@Id
()
@DEField
(
name
=
"fileid"
,
isKeyField
=
true
)
@TableId
(
value
=
"fileid"
,
type
=
IdType
.
ASSIGN_UUID
)
@JSONField
(
name
=
"id"
)
@JsonProperty
(
"id"
)
private
String
id
;
/**
* 名称
*/
@DEField
(
name
=
"filename"
)
@TableField
(
value
=
"filename"
)
@JSONField
(
name
=
"name"
)
@JsonProperty
(
"name"
)
@Field
(
name
=
"filename"
)
private
String
name
;
/**
* 路径
*/
@JSONField
(
name
=
"filepath"
)
@JsonProperty
(
"filepath"
)
@Field
(
name
=
"filepath"
)
private
String
filepath
;
@TableField
(
value
=
"filepath"
)
@JSONField
(
name
=
"file_path"
)
@JsonProperty
(
"file_path"
)
private
String
filePath
;
/**
* 特定目录
*/
@TableField
(
value
=
"folder"
)
@JSONField
(
name
=
"folder"
)
@JsonProperty
(
"folder"
)
@Field
(
name
=
"folder"
)
private
String
folder
;
/**
* 文件大小
*/
@JSONField
(
name
=
"filesize"
)
@JsonProperty
(
"filesize"
)
@Field
(
name
=
"filesize"
)
private
Integer
filesize
;
@TableField
(
value
=
"filesize"
)
@JSONField
(
name
=
"file_size"
)
@JsonProperty
(
"file_size"
)
private
Integer
fileSize
;
/**
* 扩展名
*/
@
JSON
Field
(
name
=
"fileext"
)
@
JsonProperty
(
"fileext"
)
@
Field
(
name
=
"fileext
"
)
private
String
fileext
;
@
DE
Field
(
name
=
"fileext"
)
@
TableField
(
value
=
"fileext"
)
@
JSONField
(
name
=
"extension
"
)
@JsonProperty
(
"extension"
)
private
String
extension
;
/**
* 所属类型
*/
@JSONField
(
name
=
"ownertype"
)
@JsonProperty
(
"ownertype"
)
@Field
(
name
=
"ownertype"
)
private
String
ownertype
;
@TableField
(
value
=
"ownertype"
)
@JSONField
(
name
=
"owner_type"
)
@JsonProperty
(
"owner_type"
)
private
String
ownerType
;
/**
* 所属主体
*/
@JSONField
(
name
=
"ownerid"
)
@JsonProperty
(
"ownerid"
)
@Field
(
name
=
"ownerid"
)
private
String
ownerid
;
@TableField
(
value
=
"ownerid"
)
@JSONField
(
name
=
"owner_id"
)
@JsonProperty
(
"owner_id"
)
private
String
ownerId
;
/**
* 备注
*/
@TableField
(
value
=
"memo"
)
@JSONField
(
name
=
"memo"
)
@JsonProperty
(
"memo"
)
@Field
(
name
=
"memo"
)
private
String
memo
;
/**
* 签名
*/
@JSONField
(
name
=
"digestcode"
)
@JsonProperty
(
"digestcode"
)
@Field
(
name
=
"digestcode"
)
private
String
digestcode
;
@TableField
(
value
=
"digestcode"
)
@JSONField
(
name
=
"digest_code"
)
@JsonProperty
(
"digest_code"
)
private
String
digestCode
;
/**
* 创建人
*/
@DEField
(
preType
=
DEPredefinedFieldType
.
CREATEMAN
)
@TableField
(
value
=
"createman"
,
fill
=
FieldFill
.
INSERT
)
@JSONField
(
name
=
"createman"
)
@JsonProperty
(
"createman"
)
@Field
(
name
=
"createman"
)
private
String
createman
;
/**
* 创建日期
*/
@DEField
(
preType
=
DEPredefinedFieldType
.
CREATEDATE
)
@TableField
(
value
=
"createdate"
,
fill
=
FieldFill
.
INSERT
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
locale
=
"zh"
,
timezone
=
"GMT+8"
)
@JSONField
(
name
=
"createdate"
,
format
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonProperty
(
"createdate"
)
@Field
(
name
=
"createdate"
)
private
Timestamp
createdate
;
/**
* 更新人
*/
@DEField
(
preType
=
DEPredefinedFieldType
.
UPDATEMAN
)
@TableField
(
value
=
"updateman"
)
@JSONField
(
name
=
"updateman"
)
@JsonProperty
(
"updateman"
)
@Field
(
name
=
"updateman"
)
private
String
updateman
;
/**
* 更新时间
*/
@DEField
(
preType
=
DEPredefinedFieldType
.
UPDATEDATE
)
@TableField
(
value
=
"updatedate"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
locale
=
"zh"
,
timezone
=
"GMT+8"
)
@JSONField
(
name
=
"updatedate"
,
format
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonProperty
(
"updatedate"
)
@Field
(
name
=
"updatedate"
)
private
Timestamp
updatedate
;
/**
* 设置 [名称]
*/
public
void
setName
(
String
name
){
this
.
name
=
name
;
this
.
modify
(
"filename"
,
name
);
}
/**
* 设置 [路径]
*/
public
void
setFilePath
(
String
filePath
){
this
.
filePath
=
filePath
;
this
.
modify
(
"filepath"
,
filePath
);
}
/**
* 设置 [特定目录]
*/
public
void
setFolder
(
String
folder
){
this
.
folder
=
folder
;
this
.
modify
(
"folder"
,
folder
);
}
/**
* 设置 [文件大小]
*/
public
void
setFileSize
(
Integer
fileSize
){
this
.
fileSize
=
fileSize
;
this
.
modify
(
"filesize"
,
fileSize
);
}
/**
* 设置 [扩展名]
*/
public
void
setExtension
(
String
extension
){
this
.
extension
=
extension
;
this
.
modify
(
"fileext"
,
extension
);
}
/**
* 设置 [所属类型]
*/
public
void
setOwnerType
(
String
ownerType
){
this
.
ownerType
=
ownerType
;
this
.
modify
(
"ownertype"
,
ownerType
);
}
/**
* 设置 [所属主体]
*/
public
void
setOwnerId
(
String
ownerId
){
this
.
ownerId
=
ownerId
;
this
.
modify
(
"ownerid"
,
ownerId
);
}
/**
* 设置 [备注]
*/
public
void
setMemo
(
String
memo
){
this
.
memo
=
memo
;
this
.
modify
(
"memo"
,
memo
);
}
/**
* 设置 [签名]
*/
public
void
setDigestCode
(
String
digestCode
){
this
.
digestCode
=
digestCode
;
this
.
modify
(
"digestcode"
,
digestCode
);
}
}
...
...
ibzdisk-core/src/main/java/cn/ibizlab/core/disk/filter/SDFileSearchContext.java
浏览文件 @
f5e275fe
...
...
@@ -17,24 +17,21 @@ import org.springframework.util.ObjectUtils;
import
org.springframework.util.StringUtils
;
import
cn.ibizlab.util.filter.QueryBuildContext
;
import
cn.ibizlab.util.filter.QueryWrapperContext
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
cn.ibizlab.core.disk.domain.SDFile
;
import
java.util.regex.Pattern
;
import
com.mongodb.BasicDBObject
;
/**
*
NoSQL
数据实体[SDFile] 查询条件对象
*
关系型
数据实体[SDFile] 查询条件对象
*/
@Slf4j
@Data
public
class
SDFileSearchContext
extends
Query
BuildContext
{
public
class
SDFileSearchContext
extends
Query
WrapperContext
<
SDFile
>
{
private
String
n_filename_like
;
//[名称]
public
void
setN_filename_like
(
String
n_filename_like
)
{
this
.
n_filename_like
=
n_filename_like
;
if
(!
ObjectUtils
.
isEmpty
(
this
.
n_filename_like
)){
Pattern
pattern
=
Pattern
.
compile
(
"^.*"
+
n_filename_like
+
".*$"
,
Pattern
.
CASE_INSENSITIVE
);
this
.
getSearchCond
().
and
(
"filename"
).
regex
(
pattern
);
this
.
getSearchCond
().
like
(
"filename"
,
n_filename_like
);
}
}
...
...
@@ -45,11 +42,13 @@ public class SDFileSearchContext extends QueryBuildContext {
{
this
.
query
=
query
;
if
(!
StringUtils
.
isEmpty
(
query
)){
Pattern
pattern
=
Pattern
.
compile
(
"^.*"
+
query
+
".*$"
,
Pattern
.
CASE_INSENSITIVE
);
this
.
getSearchCond
().
or
(
new
BasicDBObject
(
"filename"
,
pattern
));
this
.
getSearchCond
().
and
(
wrapper
->
wrapper
.
like
(
"filename"
,
query
)
);
}
}
}
ibzdisk-core/src/main/java/cn/ibizlab/core/disk/mapper/SDFileMapper.java
0 → 100644
浏览文件 @
f5e275fe
package
cn
.
ibizlab
.
core
.
disk
.
mapper
;
import
java.util.List
;
import
org.apache.ibatis.annotations.*
;
import
java.util.Map
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.conditions.Wrapper
;
import
java.util.HashMap
;
import
org.apache.ibatis.annotations.Select
;
import
cn.ibizlab.core.disk.domain.SDFile
;
import
cn.ibizlab.core.disk.filter.SDFileSearchContext
;
import
org.springframework.cache.annotation.CacheEvict
;
import
org.springframework.cache.annotation.Cacheable
;
import
java.io.Serializable
;
import
com.baomidou.mybatisplus.core.toolkit.Constants
;
import
com.alibaba.fastjson.JSONObject
;
public
interface
SDFileMapper
extends
BaseMapper
<
SDFile
>{
Page
<
SDFile
>
searchDefault
(
IPage
page
,
@Param
(
"srf"
)
SDFileSearchContext
context
,
@Param
(
"ew"
)
Wrapper
<
SDFile
>
wrapper
)
;
@Override
SDFile
selectById
(
Serializable
id
);
@Override
int
insert
(
SDFile
entity
);
@Override
int
updateById
(
@Param
(
Constants
.
ENTITY
)
SDFile
entity
);
@Override
int
update
(
@Param
(
Constants
.
ENTITY
)
SDFile
entity
,
@Param
(
"ew"
)
Wrapper
<
SDFile
>
updateWrapper
);
@Override
int
deleteById
(
Serializable
id
);
/**
* 自定义查询SQL
* @param sql
* @return
*/
@Select
(
"${sql}"
)
List
<
JSONObject
>
selectBySQL
(
@Param
(
"sql"
)
String
sql
,
@Param
(
"et"
)
Map
param
);
/**
* 自定义更新SQL
* @param sql
* @return
*/
@Update
(
"${sql}"
)
boolean
updateBySQL
(
@Param
(
"sql"
)
String
sql
,
@Param
(
"et"
)
Map
param
);
/**
* 自定义插入SQL
* @param sql
* @return
*/
@Insert
(
"${sql}"
)
boolean
insertBySQL
(
@Param
(
"sql"
)
String
sql
,
@Param
(
"et"
)
Map
param
);
/**
* 自定义删除SQL
* @param sql
* @return
*/
@Delete
(
"${sql}"
)
boolean
deleteBySQL
(
@Param
(
"sql"
)
String
sql
,
@Param
(
"et"
)
Map
param
);
}
ibzdisk-core/src/main/java/cn/ibizlab/core/disk/service/ISDFileService.java
浏览文件 @
f5e275fe
...
...
@@ -18,10 +18,12 @@ import cn.ibizlab.core.disk.domain.SDFile;
import
cn.ibizlab.core.disk.filter.SDFileSearchContext
;
import
com.baomidou.mybatisplus.extension.service.IService
;
/**
* 实体[SDFile] 服务对象接口
*/
public
interface
ISDFileService
{
public
interface
ISDFileService
extends
IService
<
SDFile
>
{
boolean
update
(
SDFile
et
)
;
void
updateBatch
(
List
<
SDFile
>
list
)
;
...
...
@@ -35,10 +37,25 @@ public interface ISDFileService{
boolean
save
(
SDFile
et
)
;
void
saveBatch
(
List
<
SDFile
>
list
)
;
Page
<
SDFile
>
searchDefault
(
SDFileSearchContext
context
)
;
/**
*自定义查询SQL
* @param sql select * from table where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return select * from table where id = '1'
*/
List
<
JSONObject
>
select
(
String
sql
,
Map
param
);
/**
*自定义SQL
* @param sql update table set name ='test' where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return update table set name ='test' where id = '1'
*/
boolean
execute
(
String
sql
,
Map
param
);
List
<
SDFile
>
getSdfileByIds
(
List
<
String
>
ids
)
;
List
<
SDFile
>
getSdfileByEntities
(
List
<
SDFile
>
entities
)
;
}
}
ibzdisk-core/src/main/java/cn/ibizlab/core/disk/service/impl/SDFileServiceImpl.java
浏览文件 @
f5e275fe
...
...
@@ -30,53 +30,55 @@ import cn.ibizlab.core.disk.service.ISDFileService;
import
cn.ibizlab.util.helper.CachedBeanCopier
;
import
cn.ibizlab.core.disk.repository.SDFileRepository
;
import
org.springframework.data.mongodb.core.MongoTemplate
;
import
org.springframework.data.mongodb.core.query.BasicQuery
;
import
org.springframework.data.mongodb.core.query.Query
;
import
javax.annotation.Resource
;
import
com.mongodb.QueryBuilder
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
cn.ibizlab.core.disk.mapper.SDFileMapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.Wrapper
;
import
com.alibaba.fastjson.JSONObject
;
import
org.springframework.util.StringUtils
;
/**
* 实体[文件] 服务对象接口实现
*/
@Slf4j
@Service
public
class
SDFileServiceImpl
implements
ISDFileService
{
@Service
(
"SDFileServiceImpl"
)
public
class
SDFileServiceImpl
extends
ServiceImpl
<
SDFileMapper
,
SDFile
>
implements
ISDFileService
{
@Autowired
private
SDFileRepository
repository
;
protected
int
batchSize
=
500
;
@Override
@Transactional
public
boolean
update
(
SDFile
et
)
{
repository
.
save
(
et
);
if
(!
update
(
et
,(
Wrapper
)
et
.
getUpdateWrapper
(
true
).
eq
(
"fileid"
,
et
.
getId
())))
return
false
;
CachedBeanCopier
.
copy
(
get
(
et
.
getId
()),
et
);
return
true
;
return
true
;
}
@Override
public
void
updateBatch
(
List
<
SDFile
>
list
)
{
repository
.
saveAll
(
list
);
updateBatchById
(
list
,
batchSize
);
}
@Override
@Transactional
public
boolean
create
(
SDFile
et
)
{
repository
.
insert
(
et
);
if
(!
this
.
retBool
(
this
.
baseMapper
.
insert
(
et
)))
return
false
;
CachedBeanCopier
.
copy
(
get
(
et
.
getId
()),
et
);
return
true
;
return
true
;
}
@Override
public
void
createBatch
(
List
<
SDFile
>
list
)
{
repository
.
insert
(
list
);
this
.
saveBatch
(
list
,
batchSize
);
}
@Override
public
boolean
checkKey
(
SDFile
et
)
{
return
repository
.
findById
(
et
.
getId
()).
isPresent
(
);
return
(!
ObjectUtils
.
isEmpty
(
et
.
getId
()))&&(!
Objects
.
isNull
(
this
.
getById
(
et
.
getId
()))
);
}
@Override
public
SDFile
getDraft
(
SDFile
et
)
{
return
et
;
...
...
@@ -85,74 +87,107 @@ public class SDFileServiceImpl implements ISDFileService {
@Override
@Transactional
public
SDFile
get
(
String
key
)
{
Optional
<
SDFile
>
result
=
repository
.
find
ById
(
key
);
if
(
!
result
.
isPresent
()
){
SDFile
et
=
new
SDFile
();
SDFile
et
=
get
ById
(
key
);
if
(
et
==
null
){
et
=
new
SDFile
();
et
.
setId
(
key
);
return
et
;
}
else
{
SDFile
et
=
result
.
get
();
return
et
;
}
return
et
;
}
@Override
@Transactional
public
boolean
remove
(
String
key
)
{
repository
.
delet
eById
(
key
);
return
true
;
boolean
result
=
remov
eById
(
key
);
return
result
;
}
@Override
public
void
removeBatch
(
Collection
<
String
>
idList
)
{
re
pository
.
deleteAll
(
repository
.
findAllById
(
idList
)
);
re
moveByIds
(
idList
);
}
@Override
@Transactional
public
boolean
save
(
SDFile
et
)
{
repository
.
save
(
et
);
CachedBeanCopier
.
copy
(
get
(
et
.
getId
()),
et
)
;
return
true
;
if
(!
saveOrUpdate
(
et
))
return
false
;
return
true
;
}
@Override
public
void
saveBatch
(
List
<
SDFile
>
list
)
{
repository
.
saveAll
(
list
);
@Transactional
(
rollbackFor
=
{
Exception
.
class
}
)
public
boolean
saveOrUpdate
(
SDFile
et
)
{
if
(
null
==
et
)
{
return
false
;
}
else
{
return
checkKey
(
et
)
?
this
.
update
(
et
)
:
this
.
create
(
et
);
}
}
@Override
public
boolean
saveBatch
(
Collection
<
SDFile
>
list
)
{
saveOrUpdateBatch
(
list
,
batchSize
);
return
true
;
}
@Override
public
void
saveBatch
(
List
<
SDFile
>
list
)
{
saveOrUpdateBatch
(
list
,
batchSize
);
}
@Resource
private
MongoTemplate
mongoTemplate
;
/**
* 查询集合 DEFAULT
*/
@Override
public
Page
<
SDFile
>
searchDefault
(
SDFileSearchContext
context
)
{
Query
query
=
new
BasicQuery
(
context
.
getSelectCond
().
get
().
toString
());
long
total
=
mongoTemplate
.
count
(
query
,
SDFile
.
class
);
List
<
SDFile
>
list
=
mongoTemplate
.
find
(
query
.
with
(
context
.
getPageable
()),
SDFile
.
class
);
return
new
PageImpl
<
SDFile
>(
list
,
context
.
getPageable
(),
total
);
com
.
baomidou
.
mybatisplus
.
extension
.
plugins
.
pagination
.
Page
<
SDFile
>
pages
=
baseMapper
.
searchDefault
(
context
.
getPages
(),
context
,
context
.
getSelectCond
());
return
new
PageImpl
<
SDFile
>(
pages
.
getRecords
(),
context
.
getPageable
(),
pages
.
getTotal
());
}
@Override
public
List
<
JSONObject
>
select
(
String
sql
,
Map
param
){
return
this
.
baseMapper
.
selectBySQL
(
sql
,
param
);
}
@Override
@Transactional
public
boolean
execute
(
String
sql
,
Map
param
){
if
(
sql
==
null
||
sql
.
isEmpty
())
{
return
false
;
}
if
(
sql
.
toLowerCase
().
trim
().
startsWith
(
"insert"
))
{
return
this
.
baseMapper
.
insertBySQL
(
sql
,
param
);
}
if
(
sql
.
toLowerCase
().
trim
().
startsWith
(
"update"
))
{
return
this
.
baseMapper
.
updateBySQL
(
sql
,
param
);
}
if
(
sql
.
toLowerCase
().
trim
().
startsWith
(
"delete"
))
{
return
this
.
baseMapper
.
deleteBySQL
(
sql
,
param
);
}
log
.
warn
(
"暂未支持的SQL语法"
);
return
true
;
}
@Override
public
List
<
SDFile
>
getSdfileByIds
(
List
<
String
>
ids
)
{
QueryBuilder
permissionCond
=
new
QueryBuilder
();
permissionCond
.
and
(
"id"
).
in
(
ids
);
Query
query
=
new
BasicQuery
(
permissionCond
.
get
().
toString
());
return
mongoTemplate
.
find
(
query
,
SDFile
.
class
);
return
this
.
listByIds
(
ids
);
}
@Override
public
List
<
SDFile
>
getSdfileByEntities
(
List
<
SDFile
>
entities
)
{
List
ids
=
new
ArrayList
();
for
(
SDFile
entity
:
entities
){
Serializable
id
=
entity
.
getId
();
...
...
@@ -160,12 +195,8 @@ public class SDFileServiceImpl implements ISDFileService {
ids
.
add
(
id
);
}
}
if
(
ids
.
size
()>
0
){
QueryBuilder
permissionCond
=
new
QueryBuilder
();
permissionCond
.
and
(
"id"
).
in
(
ids
);
Query
query
=
new
BasicQuery
(
permissionCond
.
get
().
toString
());
return
mongoTemplate
.
find
(
query
,
SDFile
.
class
);
}
if
(
ids
.
size
()>
0
)
return
this
.
listByIds
(
ids
);
else
return
entities
;
}
...
...
@@ -173,5 +204,3 @@ public class SDFileServiceImpl implements ISDFileService {
}
ibzdisk-core/src/main/java/cn/ibizlab/core/util/config/MybatisConfiguration.java
浏览文件 @
f5e275fe
...
...
@@ -5,6 +5,7 @@ import cn.ibizlab.util.helper.UniqueNameGenerator;
import
com.baomidou.mybatisplus.core.injector.ISqlInjector
;
import
com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.optimize.JsqlParserCountOptimize
;
import
org.apache.ibatis.mapping.DatabaseIdProvider
;
import
org.apache.ibatis.mapping.VendorDatabaseIdProvider
;
import
org.springframework.context.annotation.Bean
;
...
...
@@ -42,7 +43,14 @@ public class MybatisConfiguration {
*/
@Bean
public
PaginationInterceptor
paginationInterceptor
()
{
return
new
PaginationInterceptor
();
PaginationInterceptor
paginationInterceptor
=
new
PaginationInterceptor
();
// 设置请求的页面大于最大页后操作, true调回到首页,false 继续请求 默认false
// paginationInterceptor.setOverflow(false);
// 设置最大单页限制数量,默认 500 条,-1 不受限制
paginationInterceptor
.
setLimit
(-
1
);
// 开启 count 的 join 优化,只针对部分 left join
paginationInterceptor
.
setCountSqlParser
(
new
JsqlParserCountOptimize
(
true
));
return
paginationInterceptor
;
}
}
\ No newline at end of file
ibzdisk-core/src/main/resources/mapper/disk/sdfile/SDFileMapper.xml
0 → 100644
浏览文件 @
f5e275fe
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"cn.ibizlab.core.disk.mapper.SDFileMapper"
>
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select
id=
"selectById"
resultMap=
"SDFileResultMap"
databaseId=
"mysql"
>
<![CDATA[select t1.* from (SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`DIGESTCODE`, t1.`FILEEXT`, t1.`FILEID`, t1.`FILENAME`, t1.`FILEPATH`, t1.`FILESIZE`, t1.`FOLDER`, t1.`MEMO`, t1.`OWNERID`, t1.`OWNERTYPE`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `IBZFILE` t1 ) t1 where fileid=#{id}]]>
</select>
<select
id=
"selectById"
resultMap=
"SDFileResultMap"
databaseId=
"oracle"
>
<![CDATA[select t1.* from (SELECT t1.CREATEDATE, t1.CREATEMAN, t1.DIGESTCODE, t1.FILEEXT, t1.FILEID, t1.FILENAME, t1.FILEPATH, t1.FILESIZE, t1.FOLDER, t1.MEMO, t1.OWNERID, t1.OWNERTYPE, t1.UPDATEDATE, t1.UPDATEMAN FROM IBZFILE t1 ) t1 where fileid=#{id}]]>
</select>
<select
id=
"selectById"
resultMap=
"SDFileResultMap"
databaseId=
"postgresql"
>
<![CDATA[select t1.* from (SELECT t1.CREATEDATE, t1.CREATEMAN, t1.DIGESTCODE, t1.FILEEXT, t1.FILEID, t1.FILENAME, t1.FILEPATH, t1.FILESIZE, t1.FOLDER, t1.MEMO, t1.OWNERID, t1.OWNERTYPE, t1.UPDATEDATE, t1.UPDATEMAN FROM IBZFILE t1 ) t1 where fileid=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap
id=
"SDFileResultMap"
type=
"cn.ibizlab.core.disk.domain.SDFile"
autoMapping=
"true"
>
<id
property=
"id"
column=
"fileid"
/>
<!--主键字段映射-->
<result
property=
"name"
column=
"filename"
/>
<result
property=
"extension"
column=
"fileext"
/>
</resultMap>
<!--数据集合[Default]-->
<select
id=
"searchDefault"
parameterType=
"cn.ibizlab.core.disk.filter.SDFileSearchContext"
resultMap=
"SDFileResultMap"
>
select t1.* from (
<include
refid=
"Default"
/>
)t1
<where><if
test=
"ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere"
>
${ew.sqlSegment}
</if></where>
<if
test=
"ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere"
>
${ew.sqlSegment}
</if>
</select>
<!--数据查询[Default]-->
<sql
id=
"Default"
databaseId=
"mysql"
>
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`DIGESTCODE`, t1.`FILEEXT`, t1.`FILEID`, t1.`FILENAME`, t1.`FILEPATH`, t1.`FILESIZE`, t1.`FOLDER`, t1.`MEMO`, t1.`OWNERID`, t1.`OWNERTYPE`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `IBZFILE` t1
]]>
</sql>
<!--数据查询[Default]-->
<sql
id=
"Default"
databaseId=
"oracle"
>
<![CDATA[ SELECT t1.CREATEDATE, t1.CREATEMAN, t1.DIGESTCODE, t1.FILEEXT, t1.FILEID, t1.FILENAME, t1.FILEPATH, t1.FILESIZE, t1.FOLDER, t1.MEMO, t1.OWNERID, t1.OWNERTYPE, t1.UPDATEDATE, t1.UPDATEMAN FROM IBZFILE t1
]]>
</sql>
<!--数据查询[Default]-->
<sql
id=
"Default"
databaseId=
"postgresql"
>
<![CDATA[ SELECT t1.CREATEDATE, t1.CREATEMAN, t1.DIGESTCODE, t1.FILEEXT, t1.FILEID, t1.FILENAME, t1.FILEPATH, t1.FILESIZE, t1.FOLDER, t1.MEMO, t1.OWNERID, t1.OWNERTYPE, t1.UPDATEDATE, t1.UPDATEMAN FROM IBZFILE t1
]]>
</sql>
<!--数据查询[View]-->
<sql
id=
"View"
databaseId=
"mysql"
>
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`DIGESTCODE`, t1.`FILEEXT`, t1.`FILEID`, t1.`FILENAME`, t1.`FILEPATH`, t1.`FILESIZE`, t1.`FOLDER`, t1.`MEMO`, t1.`OWNERID`, t1.`OWNERTYPE`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `IBZFILE` t1
]]>
</sql>
<!--数据查询[View]-->
<sql
id=
"View"
databaseId=
"oracle"
>
<![CDATA[ SELECT t1.CREATEDATE, t1.CREATEMAN, t1.DIGESTCODE, t1.FILEEXT, t1.FILEID, t1.FILENAME, t1.FILEPATH, t1.FILESIZE, t1.FOLDER, t1.MEMO, t1.OWNERID, t1.OWNERTYPE, t1.UPDATEDATE, t1.UPDATEMAN FROM IBZFILE t1
]]>
</sql>
<!--数据查询[View]-->
<sql
id=
"View"
databaseId=
"postgresql"
>
<![CDATA[ SELECT t1.CREATEDATE, t1.CREATEMAN, t1.DIGESTCODE, t1.FILEEXT, t1.FILEID, t1.FILENAME, t1.FILEPATH, t1.FILESIZE, t1.FOLDER, t1.MEMO, t1.OWNERID, t1.OWNERTYPE, t1.UPDATEDATE, t1.UPDATEMAN FROM IBZFILE t1
]]>
</sql>
</mapper>
ibzdisk-provider/ibzdisk-provider-api/src/main/java/cn/ibizlab/api/dto/SDFileDTO.java
浏览文件 @
f5e275fe
...
...
@@ -43,9 +43,9 @@ public class SDFileDTO extends DTOBase implements Serializable {
* 属性 [FILEPATH]
*
*/
@JSONField
(
name
=
"filepath"
)
@JsonProperty
(
"filepath"
)
private
String
file
p
ath
;
@JSONField
(
name
=
"file
_
path"
)
@JsonProperty
(
"file
_
path"
)
private
String
file
P
ath
;
/**
* 属性 [FOLDER]
...
...
@@ -59,33 +59,33 @@ public class SDFileDTO extends DTOBase implements Serializable {
* 属性 [FILESIZE]
*
*/
@JSONField
(
name
=
"filesize"
)
@JsonProperty
(
"filesize"
)
private
Integer
file
s
ize
;
@JSONField
(
name
=
"file
_
size"
)
@JsonProperty
(
"file
_
size"
)
private
Integer
file
S
ize
;
/**
* 属性 [FILEEXT]
*
*/
@JSONField
(
name
=
"
fileext
"
)
@JsonProperty
(
"
fileext
"
)
private
String
fileext
;
@JSONField
(
name
=
"
extension
"
)
@JsonProperty
(
"
extension
"
)
private
String
extension
;
/**
* 属性 [OWNERTYPE]
*
*/
@JSONField
(
name
=
"ownertype"
)
@JsonProperty
(
"ownertype"
)
private
String
owner
t
ype
;
@JSONField
(
name
=
"owner
_
type"
)
@JsonProperty
(
"owner
_
type"
)
private
String
owner
T
ype
;
/**
* 属性 [OWNERID]
*
*/
@JSONField
(
name
=
"ownerid"
)
@JsonProperty
(
"ownerid"
)
private
String
owner
i
d
;
@JSONField
(
name
=
"owner
_
id"
)
@JsonProperty
(
"owner
_
id"
)
private
String
owner
I
d
;
/**
* 属性 [MEMO]
...
...
@@ -99,9 +99,9 @@ public class SDFileDTO extends DTOBase implements Serializable {
* 属性 [DIGESTCODE]
*
*/
@JSONField
(
name
=
"digestcode"
)
@JsonProperty
(
"digestcode"
)
private
String
digest
c
ode
;
@JSONField
(
name
=
"digest
_
code"
)
@JsonProperty
(
"digest
_
code"
)
private
String
digest
C
ode
;
/**
* 属性 [CREATEMAN]
...
...
@@ -149,9 +149,9 @@ public class SDFileDTO extends DTOBase implements Serializable {
/**
* 设置 [FILEPATH]
*/
public
void
setFile
path
(
String
filep
ath
){
this
.
file
path
=
filep
ath
;
this
.
modify
(
"filepath"
,
file
p
ath
);
public
void
setFile
Path
(
String
fileP
ath
){
this
.
file
Path
=
fileP
ath
;
this
.
modify
(
"filepath"
,
file
P
ath
);
}
/**
...
...
@@ -165,33 +165,33 @@ public class SDFileDTO extends DTOBase implements Serializable {
/**
* 设置 [FILESIZE]
*/
public
void
setFile
size
(
Integer
files
ize
){
this
.
file
size
=
files
ize
;
this
.
modify
(
"filesize"
,
file
s
ize
);
public
void
setFile
Size
(
Integer
fileS
ize
){
this
.
file
Size
=
fileS
ize
;
this
.
modify
(
"filesize"
,
file
S
ize
);
}
/**
* 设置 [FILEEXT]
*/
public
void
set
Fileext
(
String
fileext
){
this
.
fileext
=
fileext
;
this
.
modify
(
"fileext"
,
fileext
);
public
void
set
Extension
(
String
extension
){
this
.
extension
=
extension
;
this
.
modify
(
"fileext"
,
extension
);
}
/**
* 设置 [OWNERTYPE]
*/
public
void
setOwner
type
(
String
ownert
ype
){
this
.
owner
type
=
ownert
ype
;
this
.
modify
(
"ownertype"
,
owner
t
ype
);
public
void
setOwner
Type
(
String
ownerT
ype
){
this
.
owner
Type
=
ownerT
ype
;
this
.
modify
(
"ownertype"
,
owner
T
ype
);
}
/**
* 设置 [OWNERID]
*/
public
void
setOwner
id
(
String
owneri
d
){
this
.
owner
id
=
owneri
d
;
this
.
modify
(
"ownerid"
,
owner
i
d
);
public
void
setOwner
Id
(
String
ownerI
d
){
this
.
owner
Id
=
ownerI
d
;
this
.
modify
(
"ownerid"
,
owner
I
d
);
}
/**
...
...
@@ -205,9 +205,9 @@ public class SDFileDTO extends DTOBase implements Serializable {
/**
* 设置 [DIGESTCODE]
*/
public
void
setDigest
code
(
String
digestc
ode
){
this
.
digest
code
=
digestc
ode
;
this
.
modify
(
"digestcode"
,
digest
c
ode
);
public
void
setDigest
Code
(
String
digestC
ode
){
this
.
digest
Code
=
digestC
ode
;
this
.
modify
(
"digestcode"
,
digest
C
ode
);
}
...
...
ibzdisk-provider/ibzdisk-provider-api/src/main/java/cn/ibizlab/api/ibzdiskapiApplication.java
浏览文件 @
f5e275fe
...
...
@@ -28,6 +28,7 @@ import java.util.List;
@MapperScan
(
"cn.ibizlab.*.mapper"
)
@SpringBootApplication
(
exclude
=
{
org
.
springframework
.
boot
.
autoconfigure
.
security
.
servlet
.
SecurityAutoConfiguration
.
class
,
org
.
springframework
.
boot
.
autoconfigure
.
mongo
.
MongoAutoConfiguration
.
class
,
})
@Import
({
org
.
springframework
.
cloud
.
openfeign
.
FeignClientsConfiguration
.
class
...
...
ibzdisk-provider/ibzdisk-provider-api/src/main/java/cn/ibizlab/api/rest/SDFileResource.java
浏览文件 @
f5e275fe
...
...
@@ -32,6 +32,7 @@ import cn.ibizlab.api.mapping.*;
import
cn.ibizlab.core.disk.domain.SDFile
;
import
cn.ibizlab.core.disk.service.ISDFileService
;
import
cn.ibizlab.core.disk.filter.SDFileSearchContext
;
import
cn.ibizlab.util.annotation.VersionCheck
;
@Slf4j
@Api
(
tags
=
{
"文件"
})
...
...
@@ -46,6 +47,7 @@ public class SDFileResource {
@Lazy
public
SDFileMapping
sdfileMapping
;
@VersionCheck
(
entity
=
"sdfile"
,
versionfield
=
"updatedate"
)
@PreAuthorize
(
"hasPermission(this.sdfileService.get(#sdfile_id),'ibzdisk-SDFile-Update')"
)
@ApiOperation
(
value
=
"更新文件"
,
tags
=
{
"文件"
},
notes
=
"更新文件"
)
@RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/sdfiles/{sdfile_id}"
)
...
...
ibzdisk-util/src/main/java/cn/ibizlab/util/annotation/VersionCheck.java
0 → 100644
浏览文件 @
f5e275fe
package
cn
.
ibizlab
.
util
.
annotation
;
import
java.lang.annotation.ElementType
;
import
java.lang.annotation.Retention
;
import
java.lang.annotation.RetentionPolicy
;
import
java.lang.annotation.Target
;
@Retention
(
RetentionPolicy
.
RUNTIME
)
@Target
({
ElementType
.
METHOD
})
public
@interface
VersionCheck
{
String
entity
();
String
versionfield
();
}
ibzdisk-util/src/main/java/cn/ibizlab/util/aspect/VersionCheckAspect.java
0 → 100644
浏览文件 @
f5e275fe
package
cn
.
ibizlab
.
util
.
aspect
;
import
lombok.SneakyThrows
;
import
lombok.extern.slf4j.Slf4j
;
import
cn.ibizlab.util.annotation.VersionCheck
;
import
cn.ibizlab.util.domain.EntityBase
;
import
cn.ibizlab.util.errors.BadRequestAlertException
;
import
cn.ibizlab.util.helper.RuleUtils
;
import
org.aspectj.lang.JoinPoint
;
import
org.aspectj.lang.annotation.Aspect
;
import
org.aspectj.lang.annotation.Before
;
import
org.springframework.core.annotation.Order
;
import
org.springframework.expression.EvaluationContext
;
import
org.springframework.expression.Expression
;
import
org.springframework.expression.ExpressionParser
;
import
org.springframework.expression.spel.standard.SpelExpressionParser
;
import
org.springframework.expression.spel.support.StandardEvaluationContext
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.StringUtils
;
import
java.lang.reflect.Field
;
/**
* 数据库版本检查
*/
@Aspect
@Order
(
0
)
@Component
public
class
VersionCheckAspect
{
private
final
ExpressionParser
parser
=
new
SpelExpressionParser
();
@SneakyThrows
@Before
(
"execution(* cn.ibizlab.*.rest.*.update(..)) && @annotation(versionCheck)"
)
public
void
BeforeUpdate
(
JoinPoint
point
,
VersionCheck
versionCheck
){
EvaluationContext
context
=
new
StandardEvaluationContext
();
Object
[]
args
=
point
.
getArgs
();
Object
id
=
args
[
0
];
Object
dto
=
args
[
1
];
if
(
ObjectUtils
.
isEmpty
(
id
)
||
ObjectUtils
.
isEmpty
(
dto
))
return
;
String
versionField
=
versionCheck
.
versionfield
();
if
(
StringUtils
.
isEmpty
(
versionCheck
))
return
;
context
.
setVariable
(
"dto"
,
dto
);
Expression
newExp
=
parser
.
parseExpression
(
String
.
format
(
"#dto.%s"
,
versionField
));
Object
newVersion
=
newExp
.
getValue
(
context
);
if
(
ObjectUtils
.
isEmpty
(
newVersion
))
return
;
//进行版本检查
Object
oldVersion
=
getDBVersion
(
versionCheck
,
getService
(
point
.
getTarget
(),
versionCheck
.
entity
()),
id
);
if
(!
ObjectUtils
.
isEmpty
(
oldVersion
)){
if
(
RuleUtils
.
gt
(
newVersion
,
oldVersion
))
throw
new
BadRequestAlertException
(
"数据已变更,可能后台数据已被修改,请重新加载数据"
,
"VersionCheckAspect"
,
"versionCheck"
);
}
}
/**
* 获取实体服务对象
* @param resource
* @param entity
* @return
*/
@SneakyThrows
private
Object
getService
(
Object
resource
,
String
entity
){
Object
service
=
null
;
Field
[]
fields
=
resource
.
getClass
().
getDeclaredFields
();
for
(
Field
field
:
fields
){
if
(
field
.
getModifiers
()==
1
&&
field
.
getName
().
equalsIgnoreCase
(
String
.
format
(
"%sService"
,
entity
))){
service
=
field
.
get
(
resource
);
break
;
}
}
return
service
;
}
/**
* 获取数据库版本
* @param versionCheck
* @param service
* @param id
* @return
*/
@SneakyThrows
private
Object
getDBVersion
(
VersionCheck
versionCheck
,
Object
service
,
Object
id
){
Object
dbVersion
=
null
;
String
versionField
=
versionCheck
.
versionfield
();
if
(!
ObjectUtils
.
isEmpty
(
service
)){
EvaluationContext
oldContext
=
new
StandardEvaluationContext
();
oldContext
.
setVariable
(
"service"
,
service
);
oldContext
.
setVariable
(
"id"
,
id
);
Expression
oldExp
=
parser
.
parseExpression
(
"#service.get(#id)"
);
EntityBase
oldEntity
=
oldExp
.
getValue
(
oldContext
,
EntityBase
.
class
);
return
oldEntity
.
get
(
versionField
);
}
return
dbVersion
;
}
}
ibzdisk-util/src/main/java/cn/ibizlab/util/cache/cache/LayeringCache.java
浏览文件 @
f5e275fe
...
...
@@ -94,9 +94,11 @@ public class LayeringCache extends AbstractValueAdaptingCache {
@Override
public
void
put
(
Object
key
,
Object
value
)
{
if
(
value
!=
null
)
{
caffeineCache
.
put
(
key
,
value
);
redisCache
.
put
(
key
,
value
);
}
}
@Override
public
ValueWrapper
putIfAbsent
(
Object
key
,
Object
value
)
{
...
...
ibzdisk-util/src/main/java/cn/ibizlab/util/rest/AppController.java
浏览文件 @
f5e275fe
...
...
@@ -55,6 +55,10 @@ public class AppController {
appData
.
put
(
"unires"
,
uniRes
);
appData
.
put
(
"appmenu"
,
appMenu
);
appData
.
put
(
"enablepermissionvalid"
,
enablePermissionValid
);
if
(
curUser
.
getSuperuser
()==
1
)
appData
.
put
(
"enablepermissionvalid"
,
false
);
else
appData
.
put
(
"enablepermissionvalid"
,
enablePermissionValid
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
appData
);
}
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录