Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzdict
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzdict
提交
86286777
提交
86286777
编写于
8月 30, 2021
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
hebao1234 发布系统代码 [ibz-dict,字典]
上级
6d240618
变更
43
隐藏空白字符变更
内嵌
并排
正在显示
43 个修改的文件
包含
902 行增加
和
434 行删除
+902
-434
app-menu-item.vue
app_web/src/components/app-menu-item/app-menu-item.vue
+5
-5
app-quick-menus.vue
app_web/src/components/app-quick-menus/app-quick-menus.vue
+2
-2
BO-CN-base.ts
app_web/src/locale/lang/BO-CN-base.ts
+2
-0
en-US-base.ts
app_web/src/locale/lang/en-US-base.ts
+2
-0
zh-CN-base.ts
app_web/src/locale/lang/zh-CN-base.ts
+2
-0
dict-catalogs.ts
app_web/src/mock/entity/dict-catalogs/dict-catalogs.ts
+61
-61
dict-options.ts
app_web/src/mock/entity/dict-options/dict-options.ts
+112
-112
dict-catalog-service-base.ts
...web/src/service/dict-catalog/dict-catalog-service-base.ts
+38
-38
dict-option-service-base.ts
app_web/src/service/dict-option/dict-option-service-base.ts
+54
-54
app-index-view-appmenu-base.vue
...pp/app-index-view-appmenu/app-index-view-appmenu-base.vue
+5
-5
default-searchform-base.vue
...ct-catalog/default-searchform/default-searchform-base.vue
+2
-2
main-grid-base.vue
...web/src/widgets/dict-catalog/main-grid/main-grid-base.vue
+9
-6
default-searchform-base.vue
...ict-option/default-searchform/default-searchform-base.vue
+2
-2
main-grid-base.vue
app_web/src/widgets/dict-option/main-grid/main-grid-base.vue
+9
-6
options-grid-base.vue
...rc/widgets/dict-option/options-grid/options-grid-base.vue
+9
-6
pom.xml
ibzdict-app/ibzdict-app-web/pom.xml
+27
-1
Dockerfile
ibzdict-app/ibzdict-app-web/src/main/docker/Dockerfile
+1
-1
application-web-prod.yml
...zdict-app-web/src/main/resources/application-web-prod.yml
+8
-8
DictCatalogMapper.java
...n/java/cn/ibizlab/core/dict/mapper/DictCatalogMapper.java
+1
-1
CommonAutoConfig.java
...in/java/cn/ibizlab/core/util/config/CommonAutoConfig.java
+29
-0
h2_table.xml
ibzdict-core/src/main/resources/liquibase/h2_table.xml
+3
-3
pom.xml
ibzdict-provider/ibzdict-provider-api/pom.xml
+35
-1
Dockerfile
...-provider/ibzdict-provider-api/src/main/docker/Dockerfile
+1
-1
DictCatalogResource.java
...rc/main/java/cn/ibizlab/api/rest/DictCatalogResource.java
+28
-28
DictOptionResource.java
...src/main/java/cn/ibizlab/api/rest/DictOptionResource.java
+56
-56
DELogicAspect.java
...l/src/main/java/cn/ibizlab/util/aspect/DELogicAspect.java
+21
-9
CusCaffeineCache.java
...in/java/cn/ibizlab/util/cache/cache/CusCaffeineCache.java
+42
-0
CusRedisCache.java
.../main/java/cn/ibizlab/util/cache/cache/CusRedisCache.java
+16
-0
LayeringCacheManager.java
...ibizlab/util/cache/cacheManager/LayeringCacheManager.java
+2
-1
IBZWFFallback.java
...l/src/main/java/cn/ibizlab/util/client/IBZWFFallback.java
+17
-0
IBZWFFeignClient.java
...rc/main/java/cn/ibizlab/util/client/IBZWFFeignClient.java
+12
-0
DELogic.java
...ct-util/src/main/java/cn/ibizlab/util/domain/DELogic.java
+2
-0
DEFieldDefaultValueType.java
...n/java/cn/ibizlab/util/enums/DEFieldDefaultValueType.java
+17
-1
DEPredefinedFieldType.java
...ain/java/cn/ibizlab/util/enums/DEPredefinedFieldType.java
+13
-1
Globs.java
ibzdict-util/src/main/java/cn/ibizlab/util/helper/Globs.java
+195
-0
RuleUtils.java
...-util/src/main/java/cn/ibizlab/util/helper/RuleUtils.java
+20
-16
AppController.java
...til/src/main/java/cn/ibizlab/util/rest/AppController.java
+21
-0
AuthenticationInfo.java
...ain/java/cn/ibizlab/util/security/AuthenticationInfo.java
+6
-2
AuthenticationUser.java
...ain/java/cn/ibizlab/util/security/AuthenticationUser.java
+0
-1
AuthenticationUserService.java
...va/cn/ibizlab/util/service/AuthenticationUserService.java
+1
-1
IBZConfigService.java
...c/main/java/cn/ibizlab/util/service/IBZConfigService.java
+10
-0
SearchContextHandlerMethodArgumentResolver.java
.../util/web/SearchContextHandlerMethodArgumentResolver.java
+3
-2
application-sys.yml
ibzdict-util/src/main/resources/application-sys.yml
+1
-1
未找到文件。
app_web/src/components/app-menu-item/app-menu-item.vue
浏览文件 @
86286777
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
<
template
v-else
>
<
template
v-else
>
<i
v-if=
"isFirst"
class=
'fa fa-cogs app-menu-icon'
></i>
<i
v-if=
"isFirst"
class=
'fa fa-cogs app-menu-icon'
></i>
</
template
>
</
template
>
<span
ref=
"circleText"
:class=
"{'app-menu-circle' : appMenuCollapseFlag, 'text' : true}"
:title=
"$t(`app.menus.${ctrlName}.${item.name
}`)"
>
{{$t(`app.menus.${ctrlName}.${item.name
}`)}}
</span>
<span
ref=
"circleText"
:class=
"{'app-menu-circle' : appMenuCollapseFlag, 'text' : true}"
:title=
"$t(`app.menus.${ctrlName}.${item.name
.toLowerCase()}`)"
>
{{$t(`app.menus.${ctrlName}.${item.name.toLowerCase()
}`)}}
</span>
</template>
</template>
<app-menu-item
:isCollapse=
"isCollapse"
:menus=
"item.items"
:ctrlName=
"ctrlName"
:isFirst=
"false"
:counterdata=
"counterdata"
:popper-class=
"popperClass"
></app-menu-item>
<app-menu-item
:isCollapse=
"isCollapse"
:menus=
"item.items"
:ctrlName=
"ctrlName"
:isFirst=
"false"
:counterdata=
"counterdata"
:popper-class=
"popperClass"
></app-menu-item>
</el-submenu>
</el-submenu>
...
@@ -23,18 +23,18 @@
...
@@ -23,18 +23,18 @@
<el-menu-item
:class=
"[
{'isFirst' : isFirst},item.textcls]" v-show="!item.hidden" :index="item.name" :key="item.id">
<el-menu-item
:class=
"[
{'isFirst' : isFirst},item.textcls]" v-show="!item.hidden" :index="item.name" :key="item.id">
<template
v-if=
"item.icon && item.icon != ''"
>
<template
v-if=
"item.icon && item.icon != ''"
>
<img
:src=
"item.icon"
class=
'app-menu-icon'
/>
<img
:src=
"item.icon"
class=
'app-menu-icon'
/>
<span
v-if=
"(isFirst && isCollapse) ? true : false"
ref=
"circleText"
:class=
"
{'app-menu-circle' : appMenuCollapseFlag, 'text' : true}" :title="$t(`app.menus.${ctrlName}.${item.name
}`)">
{{
$t
(
`app.menus.${ctrlName
}
.${item.name
}
`
)
}}
<
/span
>
<span
v-if=
"(isFirst && isCollapse) ? true : false"
ref=
"circleText"
:class=
"
{'app-menu-circle' : appMenuCollapseFlag, 'text' : true}" :title="$t(`app.menus.${ctrlName}.${item.name
.toLowerCase()}`)">
{{
$t
(
`app.menus.${ctrlName
}
.${item.name.toLowerCase()
}
`
)
}}
<
/span
>
<
/template
>
<
/template
>
<
template
v
-
else
-
if
=
"item.iconcls && item.iconcls != ''"
>
<
template
v
-
else
-
if
=
"item.iconcls && item.iconcls != ''"
>
<
i
:
class
=
"[item.iconcls, 'app-menu-icon']"
><
/i
>
<
i
:
class
=
"[item.iconcls, 'app-menu-icon']"
><
/i
>
<
span
v
-
if
=
"(isFirst && isCollapse) ? true : false"
ref
=
"circleText"
:
class
=
"{'app-menu-circle' : appMenuCollapseFlag, 'text' : true
}
"
:
title
=
"$t(`app.menus.${ctrlName
}
.${item.name
}
`)"
>
{{
$t
(
`app.menus.${ctrlName
}
.${item.name
}
`
)
}}
<
/span
>
<
span
v
-
if
=
"(isFirst && isCollapse) ? true : false"
ref
=
"circleText"
:
class
=
"{'app-menu-circle' : appMenuCollapseFlag, 'text' : true
}
"
:
title
=
"$t(`app.menus.${ctrlName
}
.${item.name
.toLowerCase()
}
`)"
>
{{
$t
(
`app.menus.${ctrlName
}
.${item.name.toLowerCase()
}
`
)
}}
<
/span
>
<
/template
>
<
/template
>
<
template
v
-
else
>
<
template
v
-
else
>
<
i
v
-
if
=
"isFirst"
class
=
'fa fa-cogs app-menu-icon'
><
/i
>
<
i
v
-
if
=
"isFirst"
class
=
'fa fa-cogs app-menu-icon'
><
/i
>
<
span
v
-
if
=
"(isFirst && isCollapse) ? true : false"
ref
=
"circleText"
:
class
=
"{'app-menu-circle' : appMenuCollapseFlag, 'text' : true
}
"
:
title
=
"$t(`app.menus.${ctrlName
}
.${item.name
}
`)"
>
{{
$t
(
`app.menus.${ctrlName
}
.${item.name
}
`
)
}}
<
/span
>
<
span
v
-
if
=
"(isFirst && isCollapse) ? true : false"
ref
=
"circleText"
:
class
=
"{'app-menu-circle' : appMenuCollapseFlag, 'text' : true
}
"
:
title
=
"$t(`app.menus.${ctrlName
}
.${item.name
.toLowerCase()
}
`)"
>
{{
$t
(
`app.menus.${ctrlName
}
.${item.name.toLowerCase()
}
`
)
}}
<
/span
>
<
/template
>
<
/template
>
<
template
slot
=
"title"
>
<
template
slot
=
"title"
>
<
span
:
class
=
"{'app-menu-circle' : appMenuCollapseFlag, 'text' : true
}
"
:
title
=
"$t(`app.menus.${ctrlName
}
.${item.name
}
`)"
>
{{
$t
(
`app.menus.${ctrlName
}
.${item.name
}
`
)
}}
<
/span
>
<
span
:
class
=
"{'app-menu-circle' : appMenuCollapseFlag, 'text' : true
}
"
:
title
=
"$t(`app.menus.${ctrlName
}
.${item.name
.toLowerCase()
}
`)"
>
{{
$t
(
`app.menus.${ctrlName
}
.${item.name.toLowerCase()
}
`
)
}}
<
/span
>
<
template
v
-
if
=
"counterdata && counterdata[item.counterid] && counterdata[item.counterid] > 0"
>
<
template
v
-
if
=
"counterdata && counterdata[item.counterid] && counterdata[item.counterid] > 0"
>
<
span
class
=
"pull-right"
>
<
span
class
=
"pull-right"
>
<
badge
:
count
=
"counterdata[item.counterid]"
:
overflow
-
count
=
"9999"
><
/badge
>
<
badge
:
count
=
"counterdata[item.counterid]"
:
overflow
-
count
=
"9999"
><
/badge
>
...
...
app_web/src/components/app-quick-menus/app-quick-menus.vue
浏览文件 @
86286777
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
<img
:src=
"item.iconcls"
v-else-if=
"!Object.is(item.iconcls, '')"
/>
<img
:src=
"item.iconcls"
v-else-if=
"!Object.is(item.iconcls, '')"
/>
<i
class=
"fa fa-cogs"
v-else
></i>
<i
class=
"fa fa-cogs"
v-else
></i>
</span>
</span>
<span>
{{
$t
(
`app.menus.${ctrlName
}
.${item.name
}
`
)
}}
<
/span
>
<span>
{{
$t
(
`app.menus.${ctrlName
}
.${item.name
.toLowerCase()
}
`
)
}}
<
/span
>
<
span
class
=
"line"
><
/span
>
<
span
class
=
"line"
><
/span
>
<
/p
>
<
/p
>
<
p
style
=
" display: 'flex' "
>
<
p
style
=
" display: 'flex' "
>
...
@@ -37,7 +37,7 @@
...
@@ -37,7 +37,7 @@
<
img
:
src
=
"item.iconcls"
v
-
else
-
if
=
"!Object.is(item.iconcls, '')"
/>
<
img
:
src
=
"item.iconcls"
v
-
else
-
if
=
"!Object.is(item.iconcls, '')"
/>
<
i
class
=
"fa fa-cogs"
v
-
else
><
/i
>
<
i
class
=
"fa fa-cogs"
v
-
else
><
/i
>
<
/span
>
<
/span
>
<
h4
>
{{
$t
(
`app.menus.${ctrlName
}
.${item.name
}
`
)
}}
<
/h4
>
<
h4
>
{{
$t
(
`app.menus.${ctrlName
}
.${item.name
.toLowerCase()
}
`
)
}}
<
/h4
>
<
/div
>
<
/div
>
<
/card
>
<
/card
>
<
/template
>
<
/template
>
...
...
app_web/src/locale/lang/BO-CN-base.ts
浏览文件 @
86286777
...
@@ -31,6 +31,8 @@ function getAppLocale(){
...
@@ -31,6 +31,8 @@ function getAppLocale(){
nomore
:
"དེ་ལས་མང་བ་མི་འདུག"
,
nomore
:
"དེ་ལས་མང་བ་མི་འདུག"
,
other
:
"གཞན་དག"
,
other
:
"གཞན་དག"
,
valueNotEmpty
:
"སྟོང་མི་ཆོག"
,
valueNotEmpty
:
"སྟོང་མི་ཆོག"
,
createFailed
:
"གསར་འཛུགས་ཕམ་པ།"
,
isExist
:
"གནས་པ་"
,
},
},
local
:{
local
:{
new
:
"གསར་འཛུགས།"
,
new
:
"གསར་འཛུགས།"
,
...
...
app_web/src/locale/lang/en-US-base.ts
浏览文件 @
86286777
...
@@ -31,6 +31,8 @@ function getAppLocale(){
...
@@ -31,6 +31,8 @@ function getAppLocale(){
nomore
:
"No more"
,
nomore
:
"No more"
,
other
:
"other"
,
other
:
"other"
,
valueNotEmpty
:
"The value cannot be null"
,
valueNotEmpty
:
"The value cannot be null"
,
createFailed
:
"Create Failed"
,
isExist
:
"Exist"
,
},
},
local
:{
local
:{
new
:
"New"
,
new
:
"New"
,
...
...
app_web/src/locale/lang/zh-CN-base.ts
浏览文件 @
86286777
...
@@ -31,6 +31,8 @@ function getAppLocale(){
...
@@ -31,6 +31,8 @@ function getAppLocale(){
nomore
:
"没有更多了"
,
nomore
:
"没有更多了"
,
other
:
"其他"
,
other
:
"其他"
,
valueNotEmpty
:
"值不能为空"
,
valueNotEmpty
:
"值不能为空"
,
createFailed
:
"创建失败"
,
isExist
:
"已存在"
,
},
},
local
:{
local
:{
new
:
"新建"
,
new
:
"新建"
,
...
...
app_web/src/mock/entity/dict-catalogs/dict-catalogs.ts
浏览文件 @
86286777
...
@@ -86,17 +86,17 @@ mock.onDelete(new RegExp(/^\/dictcatalogs\/batch$/)).reply((config: any) => {
...
@@ -86,17 +86,17 @@ mock.onDelete(new RegExp(/^\/dictcatalogs\/batch$/)).reply((config: any) => {
return
[
status
,
{}];
return
[
status
,
{}];
});
});
//
Select
//
CheckKey
mock
.
on
Get
(
new
RegExp
(
/^
\/
dictcatalogs
\/([
a-zA-Z0-9
\-\;]{1,35})\/
select
$/
)).
reply
((
config
:
any
)
=>
{
mock
.
on
Post
(
new
RegExp
(
/^
\/
dictcatalogs
\/?([
a-zA-Z0-9
\-\;]{0,35})\/
checkkey
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:dictcatalog 方法:
Select
"
);
console
.
groupCollapsed
(
"实体:dictcatalog 方法:
CheckKey
"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
if
(
status
!==
200
)
{
return
[
status
,
null
];
return
[
status
,
null
];
}
}
const
paramArray
:
Array
<
any
>
=
[
'id'
];
const
paramArray
:
Array
<
any
>
=
[
'id'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
dictcatalogs
\/([
a-zA-Z0-9
\-\;]{1,35})\/
select
$/
).
exec
(
config
.
url
);
const
matchArray
:
any
=
new
RegExp
(
/^
\/
dictcatalogs
\/([
a-zA-Z0-9
\-\;]{1,35})\/
checkkey
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
...
@@ -106,13 +106,23 @@ mock.onGet(new RegExp(/^\/dictcatalogs\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).repl
...
@@ -106,13 +106,23 @@ mock.onGet(new RegExp(/^\/dictcatalogs\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).repl
});
});
});
});
}
}
let
items
=
mockDatas
?
mockDatas
:
[];
//let items = mockDatas ? mockDatas : [];
let
_items
=
items
.
find
((
item
:
any
)
=>
Object
.
is
(
item
.
id
,
tempValue
.
id
));
//let _items = items.find((item: any) => Object.is(item.id, tempValue.id));
let
data
=
JSON
.
parse
(
config
.
data
);
mockDatas
.
forEach
((
item
)
=>
{
if
(
item
[
'id'
]
==
tempValue
[
'id'
]
){
for
(
let
value
in
data
){
if
(
item
.
hasOwnProperty
(
value
)){
item
[
value
]
=
data
[
value
];
}
}
}
})
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
_items
);
console
.
table
(
data
);
console
.
groupEnd
();
console
.
groupEnd
();
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
_items
];
return
[
status
,
data
];
});
});
// Create
// Create
...
@@ -140,44 +150,6 @@ mock.onPost(new RegExp(/^\/dictcatalogs\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((con
...
@@ -140,44 +150,6 @@ mock.onPost(new RegExp(/^\/dictcatalogs\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((con
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
mockDatas
[
0
]];
return
[
status
,
mockDatas
[
0
]];
});
});
// Update
mock
.
onPut
(
new
RegExp
(
/^
\/
dictcatalogs
\/?([
a-zA-Z0-9
\-\;]{0,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:dictcatalog 方法: Update"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'id'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
dictcatalogs
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.id, tempValue.id));
let
data
=
JSON
.
parse
(
config
.
data
);
mockDatas
.
forEach
((
item
)
=>
{
if
(
item
[
'id'
]
==
tempValue
[
'id'
]
){
for
(
let
value
in
data
){
if
(
item
.
hasOwnProperty
(
value
)){
item
[
value
]
=
data
[
value
];
}
}
}
})
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
data
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
data
];
});
// GetDraft
// GetDraft
mock
.
onGet
(
new
RegExp
(
/^
\/
dictcatalogs
\/
getdraft$/
)).
reply
((
config
:
any
)
=>
{
mock
.
onGet
(
new
RegExp
(
/^
\/
dictcatalogs
\/
getdraft$/
)).
reply
((
config
:
any
)
=>
{
...
@@ -195,16 +167,16 @@ mock.onGet(new RegExp(/^\/dictcatalogs\/getdraft$/)).reply((config: any) => {
...
@@ -195,16 +167,16 @@ mock.onGet(new RegExp(/^\/dictcatalogs\/getdraft$/)).reply((config: any) => {
return
[
status
,
{}];
return
[
status
,
{}];
});
});
//
CheckKey
//
Save
mock
.
onPost
(
new
RegExp
(
/^
\/
dictcatalogs
\/?([
a-zA-Z0-9
\-\;]{0,35})\/
checkkey
$/
)).
reply
((
config
:
any
)
=>
{
mock
.
onPost
(
new
RegExp
(
/^
\/
dictcatalogs
\/?([
a-zA-Z0-9
\-\;]{0,35})\/
save
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:dictcatalog 方法:
CheckKey
"
);
console
.
groupCollapsed
(
"实体:dictcatalog 方法:
Save
"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
if
(
status
!==
200
)
{
return
[
status
,
null
];
return
[
status
,
null
];
}
}
const
paramArray
:
Array
<
any
>
=
[
'id'
];
const
paramArray
:
Array
<
any
>
=
[
'id'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
dictcatalogs
\/([
a-zA-Z0-9
\-\;]{1,35})\/
checkkey
$/
).
exec
(
config
.
url
);
const
matchArray
:
any
=
new
RegExp
(
/^
\/
dictcatalogs
\/([
a-zA-Z0-9
\-\;]{1,35})\/
save
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
...
@@ -233,16 +205,16 @@ mock.onPost(new RegExp(/^\/dictcatalogs\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).
...
@@ -233,16 +205,16 @@ mock.onPost(new RegExp(/^\/dictcatalogs\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).
return
[
status
,
data
];
return
[
status
,
data
];
});
});
//
Sav
e
//
Updat
e
mock
.
onP
ost
(
new
RegExp
(
/^
\/
dictcatalogs
\/?([
a-zA-Z0-9
\-\;]{0,35})\/
save
$/
)).
reply
((
config
:
any
)
=>
{
mock
.
onP
ut
(
new
RegExp
(
/^
\/
dictcatalogs
\/?([
a-zA-Z0-9
\-\;]{0,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:dictcatalog 方法:
Sav
e"
);
console
.
groupCollapsed
(
"实体:dictcatalog 方法:
Updat
e"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
if
(
status
!==
200
)
{
return
[
status
,
null
];
return
[
status
,
null
];
}
}
const
paramArray
:
Array
<
any
>
=
[
'id'
];
const
paramArray
:
Array
<
any
>
=
[
'id'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
dictcatalogs
\/([
a-zA-Z0-9
\-\;]{1,35})
\/
save
$/
).
exec
(
config
.
url
);
const
matchArray
:
any
=
new
RegExp
(
/^
\/
dictcatalogs
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
...
@@ -322,10 +294,38 @@ mock.onGet(new RegExp(/^\/dictcatalogs\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply
...
@@ -322,10 +294,38 @@ mock.onGet(new RegExp(/^\/dictcatalogs\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// Select
mock
.
onGet
(
new
RegExp
(
/^
\/
dictcatalogs
\/([
a-zA-Z0-9
\-\;]{1,35})\/
select$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:dictcatalog 方法: Select"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'id'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
dictcatalogs
\/([
a-zA-Z0-9
\-\;]{1,35})\/
select$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
let
items
=
mockDatas
?
mockDatas
:
[];
let
_items
=
items
.
find
((
item
:
any
)
=>
Object
.
is
(
item
.
id
,
tempValue
.
id
));
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
_items
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
_items
];
});
// Remove
mock
.
onDelete
(
new
RegExp
(
/^
\/
dictcatalogs
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
)).
reply
((
config
:
any
)
=>
{
// Get
console
.
groupCollapsed
(
"实体:dictcatalog 方法: Remove"
);
mock
.
onGet
(
new
RegExp
(
/^
\/
dictcatalogs
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:dictcatalog 方法: Get"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
if
(
status
!==
200
)
{
...
@@ -351,9 +351,9 @@ mock.onDelete(new RegExp(/^\/dictcatalogs\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((co
...
@@ -351,9 +351,9 @@ mock.onDelete(new RegExp(/^\/dictcatalogs\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((co
return
[
status
,
_items
?
_items
:{}];
return
[
status
,
_items
?
_items
:{}];
});
});
//
Get
//
Remove
mock
.
on
Get
(
new
RegExp
(
/^
\/
dictcatalogs
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
)).
reply
((
config
:
any
)
=>
{
mock
.
on
Delete
(
new
RegExp
(
/^
\/
dictcatalogs
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:dictcatalog 方法:
Get
"
);
console
.
groupCollapsed
(
"实体:dictcatalog 方法:
Remove
"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
if
(
status
!==
200
)
{
...
...
app_web/src/mock/entity/dict-options/dict-options.ts
浏览文件 @
86286777
...
@@ -87,17 +87,17 @@ mock.onDelete(new RegExp(/^\/dictoptions\/batch$/)).reply((config: any) => {
...
@@ -87,17 +87,17 @@ mock.onDelete(new RegExp(/^\/dictoptions\/batch$/)).reply((config: any) => {
});
});
//
Select
//
CheckKey
mock
.
on
Get
(
new
RegExp
(
/^
\/
dictcatalogs
\/([
a-zA-Z0-9
\-\;]{1,35})\/
dictoptions
\/([
a-zA-Z0-9
\-\;]{1,35})\/
select
$/
)).
reply
((
config
:
any
)
=>
{
mock
.
on
Post
(
new
RegExp
(
/^
\/
dictcatalogs
\/([
a-zA-Z0-9
\-\;]{1,35})\/
dictoptions
\/([
a-zA-Z0-9
\-\;]{1,35})\/
checkkey
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:dictoption 方法:
Select
"
);
console
.
groupCollapsed
(
"实体:dictoption 方法:
CheckKey
"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
if
(
status
!==
200
)
{
return
[
status
,
null
];
return
[
status
,
null
];
}
}
const
paramArray
:
Array
<
any
>
=
[
'id'
,
'value_key'
];
const
paramArray
:
Array
<
any
>
=
[
'id'
,
'value_key'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
dictcatalogs
\/([
a-zA-Z0-9
\-\;]{1,35})\/
dictoptions
\/([
a-zA-Z0-9
\-\;]{1,35})\/
select
$/
).
exec
(
config
.
url
);
const
matchArray
:
any
=
new
RegExp
(
/^
\/
dictcatalogs
\/([
a-zA-Z0-9
\-\;]{1,35})\/
dictoptions
\/([
a-zA-Z0-9
\-\;]{1,35})\/
checkkey
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
...
@@ -107,25 +107,23 @@ mock.onGet(new RegExp(/^\/dictcatalogs\/([a-zA-Z0-9\-\;]{1,35})\/dictoptions\/([
...
@@ -107,25 +107,23 @@ mock.onGet(new RegExp(/^\/dictcatalogs\/([a-zA-Z0-9\-\;]{1,35})\/dictoptions\/([
});
});
});
});
}
}
let
items
=
mockDatas
?
mockDatas
:
[];
let
_items
=
items
.
find
((
item
:
any
)
=>
Object
.
is
(
item
.
value_key
,
tempValue
.
value_key
));
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
_items
);
console
.
table
(
{}
);
console
.
groupEnd
();
console
.
groupEnd
();
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
_items
];
return
[
status
,
{}
];
});
});
//
Select
//
CheckKey
mock
.
on
Get
(
new
RegExp
(
/^
\/
dictoptions
\/([
a-zA-Z0-9
\-\;]{1,35})\/
select
$/
)).
reply
((
config
:
any
)
=>
{
mock
.
on
Post
(
new
RegExp
(
/^
\/
dictoptions
\/?([
a-zA-Z0-9
\-\;]{0,35})\/
checkkey
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:dictoption 方法:
Select
"
);
console
.
groupCollapsed
(
"实体:dictoption 方法:
CheckKey
"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
if
(
status
!==
200
)
{
return
[
status
,
null
];
return
[
status
,
null
];
}
}
const
paramArray
:
Array
<
any
>
=
[
'value_key'
];
const
paramArray
:
Array
<
any
>
=
[
'value_key'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
dictoptions
\/([
a-zA-Z0-9
\-\;]{1,35})\/
select
$/
).
exec
(
config
.
url
);
const
matchArray
:
any
=
new
RegExp
(
/^
\/
dictoptions
\/([
a-zA-Z0-9
\-\;]{1,35})\/
checkkey
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
...
@@ -135,13 +133,23 @@ mock.onGet(new RegExp(/^\/dictoptions\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply
...
@@ -135,13 +133,23 @@ mock.onGet(new RegExp(/^\/dictoptions\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply
});
});
});
});
}
}
let
items
=
mockDatas
?
mockDatas
:
[];
//let items = mockDatas ? mockDatas : [];
let
_items
=
items
.
find
((
item
:
any
)
=>
Object
.
is
(
item
.
value_key
,
tempValue
.
value_key
));
//let _items = items.find((item: any) => Object.is(item.value_key, tempValue.value_key));
let
data
=
JSON
.
parse
(
config
.
data
);
mockDatas
.
forEach
((
item
)
=>
{
if
(
item
[
'value_key'
]
==
tempValue
[
'value_key'
]
){
for
(
let
value
in
data
){
if
(
item
.
hasOwnProperty
(
value
)){
item
[
value
]
=
data
[
value
];
}
}
}
})
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
_items
);
console
.
table
(
data
);
console
.
groupEnd
();
console
.
groupEnd
();
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
_items
];
return
[
status
,
data
];
});
});
...
@@ -197,72 +205,6 @@ mock.onPost(new RegExp(/^\/dictoptions\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((conf
...
@@ -197,72 +205,6 @@ mock.onPost(new RegExp(/^\/dictoptions\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((conf
return
[
status
,
mockDatas
[
0
]];
return
[
status
,
mockDatas
[
0
]];
});
});
// Update
mock
.
onPut
(
new
RegExp
(
/^
\/
dictcatalogs
\/([
a-zA-Z0-9
\-\;]{1,35})\/
dictoptions
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:dictoption 方法: Update"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'id'
,
'value_key'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
dictcatalogs
\/([
a-zA-Z0-9
\-\;]{1,35})\/
dictoptions
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
({});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
{}];
});
// Update
mock
.
onPut
(
new
RegExp
(
/^
\/
dictoptions
\/?([
a-zA-Z0-9
\-\;]{0,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:dictoption 方法: Update"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'value_key'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
dictoptions
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.value_key, tempValue.value_key));
let
data
=
JSON
.
parse
(
config
.
data
);
mockDatas
.
forEach
((
item
)
=>
{
if
(
item
[
'value_key'
]
==
tempValue
[
'value_key'
]
){
for
(
let
value
in
data
){
if
(
item
.
hasOwnProperty
(
value
)){
item
[
value
]
=
data
[
value
];
}
}
}
})
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
data
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
data
];
});
// GetDraft
// GetDraft
...
@@ -297,17 +239,18 @@ mock.onGet(new RegExp(/^\/dictoptions\/getdraft$/)).reply((config: any) => {
...
@@ -297,17 +239,18 @@ mock.onGet(new RegExp(/^\/dictoptions\/getdraft$/)).reply((config: any) => {
return
[
status
,
{}];
return
[
status
,
{}];
});
});
//
CheckKey
//
Save
mock
.
onPost
(
new
RegExp
(
/^
\/
dictcatalogs
\/([
a-zA-Z0-9
\-\;]{1,35})\/
dictoptions
\/([
a-zA-Z0-9
\-\;]{1,35})\/
checkkey
$/
)).
reply
((
config
:
any
)
=>
{
mock
.
onPost
(
new
RegExp
(
/^
\/
dictcatalogs
\/([
a-zA-Z0-9
\-\;]{1,35})\/
dictoptions
\/([
a-zA-Z0-9
\-\;]{1,35})\/
save
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:dictoption 方法:
CheckKey
"
);
console
.
groupCollapsed
(
"实体:dictoption 方法:
Save
"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
if
(
status
!==
200
)
{
return
[
status
,
null
];
return
[
status
,
null
];
}
}
const
paramArray
:
Array
<
any
>
=
[
'id'
,
'value_key'
];
const
paramArray
:
Array
<
any
>
=
[
'id'
,
'value_key'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
dictcatalogs
\/([
a-zA-Z0-9
\-\;]{1,35})\/
dictoptions
\/([
a-zA-Z0-9
\-\;]{1,35})\/
checkkey
$/
).
exec
(
config
.
url
);
const
matchArray
:
any
=
new
RegExp
(
/^
\/
dictcatalogs
\/([
a-zA-Z0-9
\-\;]{1,35})\/
dictoptions
\/([
a-zA-Z0-9
\-\;]{1,35})\/
save
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
...
@@ -324,16 +267,16 @@ mock.onPost(new RegExp(/^\/dictcatalogs\/([a-zA-Z0-9\-\;]{1,35})\/dictoptions\/(
...
@@ -324,16 +267,16 @@ mock.onPost(new RegExp(/^\/dictcatalogs\/([a-zA-Z0-9\-\;]{1,35})\/dictoptions\/(
return
[
status
,
{}];
return
[
status
,
{}];
});
});
//
CheckKey
//
Save
mock
.
onPost
(
new
RegExp
(
/^
\/
dictoptions
\/?([
a-zA-Z0-9
\-\;]{0,35})\/
checkkey
$/
)).
reply
((
config
:
any
)
=>
{
mock
.
onPost
(
new
RegExp
(
/^
\/
dictoptions
\/?([
a-zA-Z0-9
\-\;]{0,35})\/
save
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:dictoption 方法:
CheckKey
"
);
console
.
groupCollapsed
(
"实体:dictoption 方法:
Save
"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
if
(
status
!==
200
)
{
return
[
status
,
null
];
return
[
status
,
null
];
}
}
const
paramArray
:
Array
<
any
>
=
[
'value_key'
];
const
paramArray
:
Array
<
any
>
=
[
'value_key'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
dictoptions
\/([
a-zA-Z0-9
\-\;]{1,35})\/
checkkey
$/
).
exec
(
config
.
url
);
const
matchArray
:
any
=
new
RegExp
(
/^
\/
dictoptions
\/([
a-zA-Z0-9
\-\;]{1,35})\/
save
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
...
@@ -363,16 +306,16 @@ mock.onPost(new RegExp(/^\/dictoptions\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).r
...
@@ -363,16 +306,16 @@ mock.onPost(new RegExp(/^\/dictoptions\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).r
});
});
//
Sav
e
//
Updat
e
mock
.
onP
ost
(
new
RegExp
(
/^
\/
dictcatalogs
\/([
a-zA-Z0-9
\-\;]{1,35})\/
dictoptions
\/([
a-zA-Z0-9
\-\;]{1,35})\/
save
$/
)).
reply
((
config
:
any
)
=>
{
mock
.
onP
ut
(
new
RegExp
(
/^
\/
dictcatalogs
\/([
a-zA-Z0-9
\-\;]{1,35})\/
dictoptions
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:dictoption 方法:
Sav
e"
);
console
.
groupCollapsed
(
"实体:dictoption 方法:
Updat
e"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
if
(
status
!==
200
)
{
return
[
status
,
null
];
return
[
status
,
null
];
}
}
const
paramArray
:
Array
<
any
>
=
[
'id'
,
'value_key'
];
const
paramArray
:
Array
<
any
>
=
[
'id'
,
'value_key'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
dictcatalogs
\/([
a-zA-Z0-9
\-\;]{1,35})\/
dictoptions
\/([
a-zA-Z0-9
\-\;]{1,35})
\/
save
$/
).
exec
(
config
.
url
);
const
matchArray
:
any
=
new
RegExp
(
/^
\/
dictcatalogs
\/([
a-zA-Z0-9
\-\;]{1,35})\/
dictoptions
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
...
@@ -389,16 +332,16 @@ mock.onPost(new RegExp(/^\/dictcatalogs\/([a-zA-Z0-9\-\;]{1,35})\/dictoptions\/(
...
@@ -389,16 +332,16 @@ mock.onPost(new RegExp(/^\/dictcatalogs\/([a-zA-Z0-9\-\;]{1,35})\/dictoptions\/(
return
[
status
,
{}];
return
[
status
,
{}];
});
});
//
Sav
e
//
Updat
e
mock
.
onP
ost
(
new
RegExp
(
/^
\/
dictoptions
\/?([
a-zA-Z0-9
\-\;]{0,35})\/
save
$/
)).
reply
((
config
:
any
)
=>
{
mock
.
onP
ut
(
new
RegExp
(
/^
\/
dictoptions
\/?([
a-zA-Z0-9
\-\;]{0,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:dictoption 方法:
Sav
e"
);
console
.
groupCollapsed
(
"实体:dictoption 方法:
Updat
e"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
if
(
status
!==
200
)
{
return
[
status
,
null
];
return
[
status
,
null
];
}
}
const
paramArray
:
Array
<
any
>
=
[
'value_key'
];
const
paramArray
:
Array
<
any
>
=
[
'value_key'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
dictoptions
\/([
a-zA-Z0-9
\-\;]{1,35})
\/
save
$/
).
exec
(
config
.
url
);
const
matchArray
:
any
=
new
RegExp
(
/^
\/
dictoptions
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
...
@@ -538,9 +481,66 @@ mock.onGet(new RegExp(/^\/dictoptions\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply(
...
@@ -538,9 +481,66 @@ mock.onGet(new RegExp(/^\/dictoptions\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply(
// URI参数传递情况未实现
// URI参数传递情况未实现
// Remove
// Select
mock
.
onDelete
(
new
RegExp
(
/^
\/
dictcatalogs
\/([
a-zA-Z0-9
\-\;]{1,35})\/
dictoptions
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
)).
reply
((
config
:
any
)
=>
{
mock
.
onGet
(
new
RegExp
(
/^
\/
dictcatalogs
\/([
a-zA-Z0-9
\-\;]{1,35})\/
dictoptions
\/([
a-zA-Z0-9
\-\;]{1,35})\/
select$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:dictoption 方法: Remove"
);
console
.
groupCollapsed
(
"实体:dictoption 方法: Select"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'id'
,
'value_key'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
dictcatalogs
\/([
a-zA-Z0-9
\-\;]{1,35})\/
dictoptions
\/([
a-zA-Z0-9
\-\;]{1,35})\/
select$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
let
items
=
mockDatas
?
mockDatas
:
[];
let
_items
=
items
.
find
((
item
:
any
)
=>
Object
.
is
(
item
.
value_key
,
tempValue
.
value_key
));
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
_items
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
_items
];
});
// Select
mock
.
onGet
(
new
RegExp
(
/^
\/
dictoptions
\/([
a-zA-Z0-9
\-\;]{1,35})\/
select$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:dictoption 方法: Select"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'value_key'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
dictoptions
\/([
a-zA-Z0-9
\-\;]{1,35})\/
select$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
let
items
=
mockDatas
?
mockDatas
:
[];
let
_items
=
items
.
find
((
item
:
any
)
=>
Object
.
is
(
item
.
value_key
,
tempValue
.
value_key
));
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
_items
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
_items
];
});
// Get
mock
.
onGet
(
new
RegExp
(
/^
\/
dictcatalogs
\/([
a-zA-Z0-9
\-\;]{1,35})\/
dictoptions
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:dictoption 方法: Get"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
if
(
status
!==
200
)
{
...
@@ -566,9 +566,9 @@ mock.onDelete(new RegExp(/^\/dictcatalogs\/([a-zA-Z0-9\-\;]{1,35})\/dictoptions\
...
@@ -566,9 +566,9 @@ mock.onDelete(new RegExp(/^\/dictcatalogs\/([a-zA-Z0-9\-\;]{1,35})\/dictoptions\
return
[
status
,
_items
?
_items
:{}];
return
[
status
,
_items
?
_items
:{}];
});
});
//
Remove
//
Get
mock
.
on
Delete
(
new
RegExp
(
/^
\/
dictoptions
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
)).
reply
((
config
:
any
)
=>
{
mock
.
on
Get
(
new
RegExp
(
/^
\/
dictoptions
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:dictoption 方法:
Remove
"
);
console
.
groupCollapsed
(
"实体:dictoption 方法:
Get
"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
if
(
status
!==
200
)
{
...
@@ -594,9 +594,9 @@ mock.onDelete(new RegExp(/^\/dictoptions\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((con
...
@@ -594,9 +594,9 @@ mock.onDelete(new RegExp(/^\/dictoptions\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((con
return
[
status
,
_items
?
_items
:{}];
return
[
status
,
_items
?
_items
:{}];
});
});
//
Get
//
Remove
mock
.
on
Get
(
new
RegExp
(
/^
\/
dictcatalogs
\/([
a-zA-Z0-9
\-\;]{1,35})\/
dictoptions
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
)).
reply
((
config
:
any
)
=>
{
mock
.
on
Delete
(
new
RegExp
(
/^
\/
dictcatalogs
\/([
a-zA-Z0-9
\-\;]{1,35})\/
dictoptions
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:dictoption 方法:
Get
"
);
console
.
groupCollapsed
(
"实体:dictoption 方法:
Remove
"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
if
(
status
!==
200
)
{
...
@@ -622,9 +622,9 @@ mock.onGet(new RegExp(/^\/dictcatalogs\/([a-zA-Z0-9\-\;]{1,35})\/dictoptions\/([
...
@@ -622,9 +622,9 @@ mock.onGet(new RegExp(/^\/dictcatalogs\/([a-zA-Z0-9\-\;]{1,35})\/dictoptions\/([
return
[
status
,
_items
?
_items
:{}];
return
[
status
,
_items
?
_items
:{}];
});
});
//
Get
//
Remove
mock
.
on
Get
(
new
RegExp
(
/^
\/
dictoptions
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
)).
reply
((
config
:
any
)
=>
{
mock
.
on
Delete
(
new
RegExp
(
/^
\/
dictoptions
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:dictoption 方法:
Get
"
);
console
.
groupCollapsed
(
"实体:dictoption 方法:
Remove
"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
if
(
status
!==
200
)
{
...
...
app_web/src/service/dict-catalog/dict-catalog-service-base.ts
浏览文件 @
86286777
...
@@ -39,7 +39,7 @@ export default class DictCatalogServiceBase extends EntityService {
...
@@ -39,7 +39,7 @@ export default class DictCatalogServiceBase extends EntityService {
// 实体接口
// 实体接口
/**
/**
*
Select
接口方法
*
CheckKey
接口方法
*
*
* @param {*} [context={}]
* @param {*} [context={}]
* @param {*} [data={}]
* @param {*} [data={}]
...
@@ -47,9 +47,8 @@ export default class DictCatalogServiceBase extends EntityService {
...
@@ -47,9 +47,8 @@ export default class DictCatalogServiceBase extends EntityService {
* @returns {Promise<any>}
* @returns {Promise<any>}
* @memberof DictCatalogServiceBase
* @memberof DictCatalogServiceBase
*/
*/
public
async
Select
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
CheckKey
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
Http
.
getInstance
().
get
(
`/dictcatalogs/
${
context
.
dictcatalog
}
/select`
,
isloading
);
let
res
:
any
=
Http
.
getInstance
().
post
(
`/dictcatalogs/
${
context
.
dictcatalog
}
/checkkey`
,
data
,
isloading
);
return
res
;
return
res
;
}
}
...
@@ -78,37 +77,6 @@ export default class DictCatalogServiceBase extends EntityService {
...
@@ -78,37 +77,6 @@ export default class DictCatalogServiceBase extends EntityService {
return
res
;
return
res
;
}
}
/**
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof DictCatalogServiceBase
*/
public
async
Update
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/dictcatalogs/
${
context
.
dictcatalog
}
`
,
data
,
isloading
);
return
res
;
}
/**
* Remove接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof DictCatalogServiceBase
*/
public
async
Remove
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
Http
.
getInstance
().
delete
(
`/dictcatalogs/
${
context
.
dictcatalog
}
`
,
isloading
);
return
res
;
}
/**
/**
* Get接口方法
* Get接口方法
*
*
...
@@ -141,7 +109,7 @@ export default class DictCatalogServiceBase extends EntityService {
...
@@ -141,7 +109,7 @@ export default class DictCatalogServiceBase extends EntityService {
}
}
/**
/**
*
CheckKey
接口方法
*
Remove
接口方法
*
*
* @param {*} [context={}]
* @param {*} [context={}]
* @param {*} [data={}]
* @param {*} [data={}]
...
@@ -149,8 +117,8 @@ export default class DictCatalogServiceBase extends EntityService {
...
@@ -149,8 +117,8 @@ export default class DictCatalogServiceBase extends EntityService {
* @returns {Promise<any>}
* @returns {Promise<any>}
* @memberof DictCatalogServiceBase
* @memberof DictCatalogServiceBase
*/
*/
public
async
CheckKey
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
Remove
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
Http
.
getInstance
().
post
(
`/dictcatalogs/
${
context
.
dictcatalog
}
/checkkey`
,
data
,
isloading
);
let
res
:
any
=
Http
.
getInstance
().
delete
(
`/dictcatalogs/
${
context
.
dictcatalog
}
`
,
isloading
);
return
res
;
return
res
;
}
}
...
@@ -171,6 +139,23 @@ export default class DictCatalogServiceBase extends EntityService {
...
@@ -171,6 +139,23 @@ export default class DictCatalogServiceBase extends EntityService {
return
res
;
return
res
;
}
}
/**
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof DictCatalogServiceBase
*/
public
async
Update
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/dictcatalogs/
${
context
.
dictcatalog
}
`
,
data
,
isloading
);
return
res
;
}
/**
/**
* FetchDefault接口方法
* FetchDefault接口方法
*
*
...
@@ -199,4 +184,19 @@ export default class DictCatalogServiceBase extends EntityService {
...
@@ -199,4 +184,19 @@ export default class DictCatalogServiceBase extends EntityService {
let
tempData
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
let
tempData
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
return
await
Http
.
getInstance
().
post
(
`/dictcatalogs/searchdefault`
,
tempData
,
isloading
);
return
await
Http
.
getInstance
().
post
(
`/dictcatalogs/searchdefault`
,
tempData
,
isloading
);
}
}
/**
* Select接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof DictCatalogServiceBase
*/
public
async
Select
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
Http
.
getInstance
().
get
(
`/dictcatalogs/
${
context
.
dictcatalog
}
/select`
,
isloading
);
return
res
;
}
}
}
\ No newline at end of file
app_web/src/service/dict-option/dict-option-service-base.ts
浏览文件 @
86286777
...
@@ -39,7 +39,7 @@ export default class DictOptionServiceBase extends EntityService {
...
@@ -39,7 +39,7 @@ export default class DictOptionServiceBase extends EntityService {
// 实体接口
// 实体接口
/**
/**
*
Select
接口方法
*
CheckKey
接口方法
*
*
* @param {*} [context={}]
* @param {*} [context={}]
* @param {*} [data={}]
* @param {*} [data={}]
...
@@ -47,14 +47,15 @@ export default class DictOptionServiceBase extends EntityService {
...
@@ -47,14 +47,15 @@ export default class DictOptionServiceBase extends EntityService {
* @returns {Promise<any>}
* @returns {Promise<any>}
* @memberof DictOptionServiceBase
* @memberof DictOptionServiceBase
*/
*/
public
async
Select
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
CheckKey
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
dictcatalog
&&
context
.
dictoption
){
if
(
context
.
dictcatalog
&&
context
.
dictoption
){
let
res
:
any
=
Http
.
getInstance
().
get
(
`/dictcatalogs/
${
context
.
dictcatalog
}
/dictoptions/
${
context
.
dictoption
}
/select`
,
isloading
);
let
masterData
:
any
=
{};
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/dictcatalogs/
${
context
.
dictcatalog
}
/dictoptions/
${
context
.
dictoption
}
/checkkey`
,
data
,
isloading
);
return
res
;
return
res
;
}
}
let
res
:
any
=
Http
.
getInstance
().
get
(
`/dictoptions/
${
context
.
dictoption
}
/select`
,
isloading
);
let
res
:
any
=
Http
.
getInstance
().
post
(
`/dictoptions/
${
context
.
dictoption
}
/checkkey`
,
data
,
isloading
);
return
res
;
return
res
;
}
}
...
@@ -96,48 +97,6 @@ export default class DictOptionServiceBase extends EntityService {
...
@@ -96,48 +97,6 @@ export default class DictOptionServiceBase extends EntityService {
return
res
;
return
res
;
}
}
/**
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof DictOptionServiceBase
*/
public
async
Update
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
dictcatalog
&&
context
.
dictoption
){
let
masterData
:
any
=
{};
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/dictcatalogs/
${
context
.
dictcatalog
}
/dictoptions/
${
context
.
dictoption
}
`
,
data
,
isloading
);
return
res
;
}
let
masterData
:
any
=
{};
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/dictoptions/
${
context
.
dictoption
}
`
,
data
,
isloading
);
return
res
;
}
/**
* Remove接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof DictOptionServiceBase
*/
public
async
Remove
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
dictcatalog
&&
context
.
dictoption
){
let
res
:
any
=
Http
.
getInstance
().
delete
(
`/dictcatalogs/
${
context
.
dictcatalog
}
/dictoptions/
${
context
.
dictoption
}
`
,
isloading
);
return
res
;
}
let
res
:
any
=
Http
.
getInstance
().
delete
(
`/dictoptions/
${
context
.
dictoption
}
`
,
isloading
);
return
res
;
}
/**
/**
* Get接口方法
* Get接口方法
*
*
...
@@ -181,7 +140,7 @@ export default class DictOptionServiceBase extends EntityService {
...
@@ -181,7 +140,7 @@ export default class DictOptionServiceBase extends EntityService {
}
}
/**
/**
*
CheckKey
接口方法
*
Remove
接口方法
*
*
* @param {*} [context={}]
* @param {*} [context={}]
* @param {*} [data={}]
* @param {*} [data={}]
...
@@ -189,15 +148,12 @@ export default class DictOptionServiceBase extends EntityService {
...
@@ -189,15 +148,12 @@ export default class DictOptionServiceBase extends EntityService {
* @returns {Promise<any>}
* @returns {Promise<any>}
* @memberof DictOptionServiceBase
* @memberof DictOptionServiceBase
*/
*/
public
async
CheckKey
(
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
masterData
:
any
=
{};
let
res
:
any
=
Http
.
getInstance
().
delete
(
`/dictcatalogs/
${
context
.
dictcatalog
}
/dictoptions/
${
context
.
dictoption
}
`
,
isloading
);
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/dictcatalogs/
${
context
.
dictcatalog
}
/dictoptions/
${
context
.
dictoption
}
/checkkey`
,
data
,
isloading
);
return
res
;
return
res
;
}
}
let
res
:
any
=
Http
.
getInstance
().
post
(
`/dictoptions/
${
context
.
dictoption
}
/checkkey`
,
data
,
isloading
);
let
res
:
any
=
Http
.
getInstance
().
delete
(
`/dictoptions/
${
context
.
dictoption
}
`
,
isloading
);
return
res
;
return
res
;
}
}
...
@@ -225,6 +181,30 @@ export default class DictOptionServiceBase extends EntityService {
...
@@ -225,6 +181,30 @@ export default class DictOptionServiceBase extends EntityService {
return
res
;
return
res
;
}
}
/**
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof DictOptionServiceBase
*/
public
async
Update
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
dictcatalog
&&
context
.
dictoption
){
let
masterData
:
any
=
{};
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/dictcatalogs/
${
context
.
dictcatalog
}
/dictoptions/
${
context
.
dictoption
}
`
,
data
,
isloading
);
return
res
;
}
let
masterData
:
any
=
{};
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/dictoptions/
${
context
.
dictoption
}
`
,
data
,
isloading
);
return
res
;
}
/**
/**
* FetchDefault接口方法
* FetchDefault接口方法
*
*
...
@@ -262,4 +242,24 @@ export default class DictOptionServiceBase extends EntityService {
...
@@ -262,4 +242,24 @@ export default class DictOptionServiceBase extends EntityService {
let
tempData
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
let
tempData
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
return
await
Http
.
getInstance
().
post
(
`/dictoptions/searchdefault`
,
tempData
,
isloading
);
return
await
Http
.
getInstance
().
post
(
`/dictoptions/searchdefault`
,
tempData
,
isloading
);
}
}
/**
* Select接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof DictOptionServiceBase
*/
public
async
Select
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
dictcatalog
&&
context
.
dictoption
){
let
res
:
any
=
Http
.
getInstance
().
get
(
`/dictcatalogs/
${
context
.
dictcatalog
}
/dictoptions/
${
context
.
dictoption
}
/select`
,
isloading
);
return
res
;
}
let
res
:
any
=
Http
.
getInstance
().
get
(
`/dictoptions/
${
context
.
dictoption
}
/select`
,
isloading
);
return
res
;
}
}
}
\ No newline at end of file
app_web/src/widgets/app/app-index-view-appmenu/app-index-view-appmenu-base.vue
浏览文件 @
86286777
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
<
template
v-else
>
<
template
v-else
>
<i
class=
'fa fa-cogs app-menu-icon'
></i>
<i
class=
'fa fa-cogs app-menu-icon'
></i>
</
template
>
</
template
>
<span
class=
'text'
:title=
"$t('app.menus.appindexview.' + item0.name
)"
>
{{$t('app.menus.appindexview.' + item0.name
)}}
</span>
<span
class=
'text'
:title=
"$t('app.menus.appindexview.' + item0.name
.toLowerCase())"
>
{{$t('app.menus.appindexview.' + item0.name.toLowerCase()
)}}
</span>
</template>
</template>
<
template
v-for=
"item1 in item0.items"
>
<
template
v-for=
"item1 in item0.items"
>
<template
v-if=
"item1.items && Array.isArray(item1.items) && item1.items.length > 0"
>
<template
v-if=
"item1.items && Array.isArray(item1.items) && item1.items.length > 0"
>
...
@@ -35,7 +35,7 @@
...
@@ -35,7 +35,7 @@
<
template
v-else-if=
"item1.iconcls && item1.iconcls != ''"
>
<
template
v-else-if=
"item1.iconcls && item1.iconcls != ''"
>
<i
:class=
"[item1.iconcls, 'app-menu-icon']"
></i>
<i
:class=
"[item1.iconcls, 'app-menu-icon']"
></i>
</
template
>
</
template
>
<span
class=
'text'
:title=
"$t('app.menus.appindexview.' + item1.name
)"
>
{{$t('app.menus.appindexview.' + item1.name
)}}
</span>
<span
class=
'text'
:title=
"$t('app.menus.appindexview.' + item1.name
.toLowerCase())"
>
{{$t('app.menus.appindexview.' + item1.name.toLowerCase()
)}}
</span>
</template>
</template>
<
template
v-for=
"item2 in item1.items"
>
<
template
v-for=
"item2 in item1.items"
>
<template
v-if=
"item2.type =='MENUITEM'"
>
<template
v-if=
"item2.type =='MENUITEM'"
>
...
@@ -47,7 +47,7 @@
...
@@ -47,7 +47,7 @@
<i
:class=
"[item2.iconcls, 'app-menu-icon']"
></i>
<i
:class=
"[item2.iconcls, 'app-menu-icon']"
></i>
</
template
>
</
template
>
<
template
slot=
"title"
>
<
template
slot=
"title"
>
<span
class=
"text"
:title=
"$t('app.menus.appindexview.' + item2.name
)"
>
{{
$t
(
'app.menus.appindexview.'
+
item2
.
name
)
}}
</span>
<span
class=
"text"
:title=
"$t('app.menus.appindexview.' + item2.name
.toLowerCase())"
>
{{
$t
(
'app.menus.appindexview.'
+
item2
.
name
.
toLowerCase
()
)
}}
</span>
<template
v-if=
"counterdata && counterdata[item2.counterid] && counterdata[item2.counterid] > 0"
>
<template
v-if=
"counterdata && counterdata[item2.counterid] && counterdata[item2.counterid] > 0"
>
<span
class=
"pull-right"
>
<span
class=
"pull-right"
>
<badge
:count=
"counterdata[item2.counterid]"
:overflow-count=
"9999"
></badge>
<badge
:count=
"counterdata[item2.counterid]"
:overflow-count=
"9999"
></badge>
...
@@ -69,7 +69,7 @@
...
@@ -69,7 +69,7 @@
<i
:class=
"[item1.iconcls, 'app-menu-icon']"
></i>
<i
:class=
"[item1.iconcls, 'app-menu-icon']"
></i>
</
template
>
</
template
>
<
template
slot=
"title"
>
<
template
slot=
"title"
>
<span
class=
"text"
:title=
"$t('app.menus.appindexview.' + item1.name
)"
>
{{
$t
(
'app.menus.appindexview.'
+
item1
.
name
)
}}
</span>
<span
class=
"text"
:title=
"$t('app.menus.appindexview.' + item1.name
.toLowerCase())"
>
{{
$t
(
'app.menus.appindexview.'
+
item1
.
name
.
toLowerCase
()
)
}}
</span>
<template
v-if=
"counterdata && counterdata[item1.counterid] && counterdata[item1.counterid] > 0"
>
<template
v-if=
"counterdata && counterdata[item1.counterid] && counterdata[item1.counterid] > 0"
>
<span
class=
"pull-right"
>
<span
class=
"pull-right"
>
<badge
:count=
"counterdata[item1.counterid]"
:overflow-count=
"9999"
></badge>
<badge
:count=
"counterdata[item1.counterid]"
:overflow-count=
"9999"
></badge>
...
@@ -95,7 +95,7 @@
...
@@ -95,7 +95,7 @@
<i
class=
'fa fa-cogs app-menu-icon'
></i>
<i
class=
'fa fa-cogs app-menu-icon'
></i>
</
template
>
</
template
>
<
template
slot=
"title"
>
<
template
slot=
"title"
>
<span
class=
"text"
:title=
"$t('app.menus.appindexview.' + item0.name
)"
>
{{
$t
(
'app.menus.appindexview.'
+
item0
.
name
)
}}
</span>
<span
class=
"text"
:title=
"$t('app.menus.appindexview.' + item0.name
.toLowerCase())"
>
{{
$t
(
'app.menus.appindexview.'
+
item0
.
name
.
toLowerCase
()
)
}}
</span>
<template
v-if=
"counterdata && counterdata[item0.counterid] && counterdata[item0.counterid] > 0"
>
<template
v-if=
"counterdata && counterdata[item0.counterid] && counterdata[item0.counterid] > 0"
>
<span
class=
"pull-right"
>
<span
class=
"pull-right"
>
<badge
:count=
"counterdata[item0.counterid]"
:overflow-count=
"9999"
></badge>
<badge
:count=
"counterdata[item0.counterid]"
:overflow-count=
"9999"
></badge>
...
...
app_web/src/widgets/dict-catalog/default-searchform/default-searchform-base.vue
浏览文件 @
86286777
...
@@ -742,8 +742,8 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -742,8 +742,8 @@ export default class DefaultBase extends Vue implements ControlInterface {
let
post
:
Promise
<
any
>
=
this
.
service
.
loadDraft
(
this
.
loaddraftAction
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)),
arg
,
this
.
showBusyIndicator
);
let
post
:
Promise
<
any
>
=
this
.
service
.
loadDraft
(
this
.
loaddraftAction
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)),
arg
,
this
.
showBusyIndicator
);
post
.
then
((
response
:
any
)
=>
{
post
.
then
((
response
:
any
)
=>
{
if
(
!
response
.
status
||
response
.
status
!==
200
)
{
if
(
!
response
.
status
||
response
.
status
!==
200
)
{
if
(
response
.
errorM
essage
)
{
if
(
response
.
data
&&
response
.
data
.
m
essage
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
errorM
essage
});
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
data
.
m
essage
});
}
}
return
;
return
;
}
}
...
...
app_web/src/widgets/dict-catalog/main-grid/main-grid-base.vue
浏览文件 @
86286777
...
@@ -873,8 +873,8 @@ export default class MainBase extends Vue implements ControlInterface {
...
@@ -873,8 +873,8 @@ export default class MainBase extends Vue implements ControlInterface {
const
post
:
Promise
<
any
>
=
this
.
service
.
search
(
this
.
fetchAction
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)),
arg
,
this
.
showBusyIndicator
);
const
post
:
Promise
<
any
>
=
this
.
service
.
search
(
this
.
fetchAction
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)),
arg
,
this
.
showBusyIndicator
);
post
.
then
((
response
:
any
)
=>
{
post
.
then
((
response
:
any
)
=>
{
if
(
!
response
.
status
||
response
.
status
!==
200
)
{
if
(
!
response
.
status
||
response
.
status
!==
200
)
{
if
(
response
.
errorM
essage
)
{
if
(
response
.
data
&&
response
.
data
.
m
essage
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
errorM
essage
});
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
data
.
m
essage
});
}
}
return
;
return
;
}
}
...
@@ -924,7 +924,7 @@ export default class MainBase extends Vue implements ControlInterface {
...
@@ -924,7 +924,7 @@ export default class MainBase extends Vue implements ControlInterface {
if
(
response
&&
response
.
status
===
401
)
{
if
(
response
&&
response
.
status
===
401
)
{
return
;
return
;
}
}
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
errorMessage
});
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
data
&&
response
.
data
.
message
?
response
.
data
.
message
:
""
});
});
});
}
}
...
@@ -1009,7 +1009,7 @@ export default class MainBase extends Vue implements ControlInterface {
...
@@ -1009,7 +1009,7 @@ export default class MainBase extends Vue implements ControlInterface {
resolve
(
response
);
resolve
(
response
);
}).
catch
((
response
:
any
)
=>
{
}).
catch
((
response
:
any
)
=>
{
if
(
response
&&
response
.
status
!=
200
)
{
if
(
response
&&
response
.
status
!=
200
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
message
});
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
data
&&
response
.
data
.
message
?
response
.
data
.
message
:
""
});
return
;
return
;
}
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
...
@@ -1130,6 +1130,9 @@ export default class MainBase extends Vue implements ControlInterface {
...
@@ -1130,6 +1130,9 @@ export default class MainBase extends Vue implements ControlInterface {
const
parentdata
:
any
=
{};
const
parentdata
:
any
=
{};
this
.
$emit
(
'beforeload'
,
parentdata
);
this
.
$emit
(
'beforeload'
,
parentdata
);
Object
.
assign
(
arg
,
parentdata
);
Object
.
assign
(
arg
,
parentdata
);
let
tempViewParams
:
any
=
parentdata
.
viewparams
?
parentdata
.
viewparams
:{};
Object
.
assign
(
tempViewParams
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
viewparams
)));
Object
.
assign
(
arg
,{
viewparams
:
tempViewParams
});
const
post
:
Promise
<
any
>
=
this
.
service
.
search
(
this
.
fetchAction
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)),
arg
,
this
.
showBusyIndicator
);
const
post
:
Promise
<
any
>
=
this
.
service
.
search
(
this
.
fetchAction
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)),
arg
,
this
.
showBusyIndicator
);
post
.
then
((
response
:
any
)
=>
{
post
.
then
((
response
:
any
)
=>
{
if
(
!
response
||
response
.
status
!==
200
)
{
if
(
!
response
||
response
.
status
!==
200
)
{
...
@@ -1997,8 +2000,8 @@ export default class MainBase extends Vue implements ControlInterface {
...
@@ -1997,8 +2000,8 @@ export default class MainBase extends Vue implements ControlInterface {
let
post
:
Promise
<
any
>
=
this
.
service
.
loadDraft
(
this
.
loaddraftAction
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)),
args
[
0
],
this
.
showBusyIndicator
);
let
post
:
Promise
<
any
>
=
this
.
service
.
loadDraft
(
this
.
loaddraftAction
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)),
args
[
0
],
this
.
showBusyIndicator
);
post
.
then
((
response
:
any
)
=>
{
post
.
then
((
response
:
any
)
=>
{
if
(
!
response
.
status
||
response
.
status
!==
200
)
{
if
(
!
response
.
status
||
response
.
status
!==
200
)
{
if
(
response
.
errorM
essage
)
{
if
(
response
.
data
&&
response
.
data
.
m
essage
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
errorM
essage
});
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
data
.
m
essage
});
}
}
return
;
return
;
}
}
...
...
app_web/src/widgets/dict-option/default-searchform/default-searchform-base.vue
浏览文件 @
86286777
...
@@ -742,8 +742,8 @@ export default class DefaultBase extends Vue implements ControlInterface {
...
@@ -742,8 +742,8 @@ export default class DefaultBase extends Vue implements ControlInterface {
let
post
:
Promise
<
any
>
=
this
.
service
.
loadDraft
(
this
.
loaddraftAction
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)),
arg
,
this
.
showBusyIndicator
);
let
post
:
Promise
<
any
>
=
this
.
service
.
loadDraft
(
this
.
loaddraftAction
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)),
arg
,
this
.
showBusyIndicator
);
post
.
then
((
response
:
any
)
=>
{
post
.
then
((
response
:
any
)
=>
{
if
(
!
response
.
status
||
response
.
status
!==
200
)
{
if
(
!
response
.
status
||
response
.
status
!==
200
)
{
if
(
response
.
errorM
essage
)
{
if
(
response
.
data
&&
response
.
data
.
m
essage
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
errorM
essage
});
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
data
.
m
essage
});
}
}
return
;
return
;
}
}
...
...
app_web/src/widgets/dict-option/main-grid/main-grid-base.vue
浏览文件 @
86286777
...
@@ -1332,8 +1332,8 @@ export default class MainBase extends Vue implements ControlInterface {
...
@@ -1332,8 +1332,8 @@ export default class MainBase extends Vue implements ControlInterface {
const
post
:
Promise
<
any
>
=
this
.
service
.
search
(
this
.
fetchAction
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)),
arg
,
this
.
showBusyIndicator
);
const
post
:
Promise
<
any
>
=
this
.
service
.
search
(
this
.
fetchAction
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)),
arg
,
this
.
showBusyIndicator
);
post
.
then
((
response
:
any
)
=>
{
post
.
then
((
response
:
any
)
=>
{
if
(
!
response
.
status
||
response
.
status
!==
200
)
{
if
(
!
response
.
status
||
response
.
status
!==
200
)
{
if
(
response
.
errorM
essage
)
{
if
(
response
.
data
&&
response
.
data
.
m
essage
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
errorM
essage
});
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
data
.
m
essage
});
}
}
return
;
return
;
}
}
...
@@ -1383,7 +1383,7 @@ export default class MainBase extends Vue implements ControlInterface {
...
@@ -1383,7 +1383,7 @@ export default class MainBase extends Vue implements ControlInterface {
if
(
response
&&
response
.
status
===
401
)
{
if
(
response
&&
response
.
status
===
401
)
{
return
;
return
;
}
}
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
errorMessage
});
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
data
&&
response
.
data
.
message
?
response
.
data
.
message
:
""
});
});
});
}
}
...
@@ -1468,7 +1468,7 @@ export default class MainBase extends Vue implements ControlInterface {
...
@@ -1468,7 +1468,7 @@ export default class MainBase extends Vue implements ControlInterface {
resolve
(
response
);
resolve
(
response
);
}).
catch
((
response
:
any
)
=>
{
}).
catch
((
response
:
any
)
=>
{
if
(
response
&&
response
.
status
!=
200
)
{
if
(
response
&&
response
.
status
!=
200
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
message
});
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
data
&&
response
.
data
.
message
?
response
.
data
.
message
:
""
});
return
;
return
;
}
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
...
@@ -1589,6 +1589,9 @@ export default class MainBase extends Vue implements ControlInterface {
...
@@ -1589,6 +1589,9 @@ export default class MainBase extends Vue implements ControlInterface {
const
parentdata
:
any
=
{};
const
parentdata
:
any
=
{};
this
.
$emit
(
'beforeload'
,
parentdata
);
this
.
$emit
(
'beforeload'
,
parentdata
);
Object
.
assign
(
arg
,
parentdata
);
Object
.
assign
(
arg
,
parentdata
);
let
tempViewParams
:
any
=
parentdata
.
viewparams
?
parentdata
.
viewparams
:{};
Object
.
assign
(
tempViewParams
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
viewparams
)));
Object
.
assign
(
arg
,{
viewparams
:
tempViewParams
});
const
post
:
Promise
<
any
>
=
this
.
service
.
search
(
this
.
fetchAction
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)),
arg
,
this
.
showBusyIndicator
);
const
post
:
Promise
<
any
>
=
this
.
service
.
search
(
this
.
fetchAction
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)),
arg
,
this
.
showBusyIndicator
);
post
.
then
((
response
:
any
)
=>
{
post
.
then
((
response
:
any
)
=>
{
if
(
!
response
||
response
.
status
!==
200
)
{
if
(
!
response
||
response
.
status
!==
200
)
{
...
@@ -2496,8 +2499,8 @@ export default class MainBase extends Vue implements ControlInterface {
...
@@ -2496,8 +2499,8 @@ export default class MainBase extends Vue implements ControlInterface {
let
post
:
Promise
<
any
>
=
this
.
service
.
loadDraft
(
this
.
loaddraftAction
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)),
args
[
0
],
this
.
showBusyIndicator
);
let
post
:
Promise
<
any
>
=
this
.
service
.
loadDraft
(
this
.
loaddraftAction
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)),
args
[
0
],
this
.
showBusyIndicator
);
post
.
then
((
response
:
any
)
=>
{
post
.
then
((
response
:
any
)
=>
{
if
(
!
response
.
status
||
response
.
status
!==
200
)
{
if
(
!
response
.
status
||
response
.
status
!==
200
)
{
if
(
response
.
errorM
essage
)
{
if
(
response
.
data
&&
response
.
data
.
m
essage
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
errorM
essage
});
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
data
.
m
essage
});
}
}
return
;
return
;
}
}
...
...
app_web/src/widgets/dict-option/options-grid/options-grid-base.vue
浏览文件 @
86286777
...
@@ -1311,8 +1311,8 @@ export default class OptionsBase extends Vue implements ControlInterface {
...
@@ -1311,8 +1311,8 @@ export default class OptionsBase extends Vue implements ControlInterface {
const
post
:
Promise
<
any
>
=
this
.
service
.
search
(
this
.
fetchAction
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)),
arg
,
this
.
showBusyIndicator
);
const
post
:
Promise
<
any
>
=
this
.
service
.
search
(
this
.
fetchAction
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)),
arg
,
this
.
showBusyIndicator
);
post
.
then
((
response
:
any
)
=>
{
post
.
then
((
response
:
any
)
=>
{
if
(
!
response
.
status
||
response
.
status
!==
200
)
{
if
(
!
response
.
status
||
response
.
status
!==
200
)
{
if
(
response
.
errorM
essage
)
{
if
(
response
.
data
&&
response
.
data
.
m
essage
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
errorM
essage
});
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
data
.
m
essage
});
}
}
return
;
return
;
}
}
...
@@ -1362,7 +1362,7 @@ export default class OptionsBase extends Vue implements ControlInterface {
...
@@ -1362,7 +1362,7 @@ export default class OptionsBase extends Vue implements ControlInterface {
if
(
response
&&
response
.
status
===
401
)
{
if
(
response
&&
response
.
status
===
401
)
{
return
;
return
;
}
}
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
errorMessage
});
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
data
&&
response
.
data
.
message
?
response
.
data
.
message
:
""
});
});
});
}
}
...
@@ -1447,7 +1447,7 @@ export default class OptionsBase extends Vue implements ControlInterface {
...
@@ -1447,7 +1447,7 @@ export default class OptionsBase extends Vue implements ControlInterface {
resolve
(
response
);
resolve
(
response
);
}).
catch
((
response
:
any
)
=>
{
}).
catch
((
response
:
any
)
=>
{
if
(
response
&&
response
.
status
!=
200
)
{
if
(
response
&&
response
.
status
!=
200
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
message
});
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
data
&&
response
.
data
.
message
?
response
.
data
.
message
:
""
});
return
;
return
;
}
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
...
@@ -1568,6 +1568,9 @@ export default class OptionsBase extends Vue implements ControlInterface {
...
@@ -1568,6 +1568,9 @@ export default class OptionsBase extends Vue implements ControlInterface {
const
parentdata
:
any
=
{};
const
parentdata
:
any
=
{};
this
.
$emit
(
'beforeload'
,
parentdata
);
this
.
$emit
(
'beforeload'
,
parentdata
);
Object
.
assign
(
arg
,
parentdata
);
Object
.
assign
(
arg
,
parentdata
);
let
tempViewParams
:
any
=
parentdata
.
viewparams
?
parentdata
.
viewparams
:{};
Object
.
assign
(
tempViewParams
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
viewparams
)));
Object
.
assign
(
arg
,{
viewparams
:
tempViewParams
});
const
post
:
Promise
<
any
>
=
this
.
service
.
search
(
this
.
fetchAction
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)),
arg
,
this
.
showBusyIndicator
);
const
post
:
Promise
<
any
>
=
this
.
service
.
search
(
this
.
fetchAction
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)),
arg
,
this
.
showBusyIndicator
);
post
.
then
((
response
:
any
)
=>
{
post
.
then
((
response
:
any
)
=>
{
if
(
!
response
||
response
.
status
!==
200
)
{
if
(
!
response
||
response
.
status
!==
200
)
{
...
@@ -2472,8 +2475,8 @@ export default class OptionsBase extends Vue implements ControlInterface {
...
@@ -2472,8 +2475,8 @@ export default class OptionsBase extends Vue implements ControlInterface {
let
post
:
Promise
<
any
>
=
this
.
service
.
loadDraft
(
this
.
loaddraftAction
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)),
args
[
0
],
this
.
showBusyIndicator
);
let
post
:
Promise
<
any
>
=
this
.
service
.
loadDraft
(
this
.
loaddraftAction
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
context
)),
args
[
0
],
this
.
showBusyIndicator
);
post
.
then
((
response
:
any
)
=>
{
post
.
then
((
response
:
any
)
=>
{
if
(
!
response
.
status
||
response
.
status
!==
200
)
{
if
(
!
response
.
status
||
response
.
status
!==
200
)
{
if
(
response
.
errorM
essage
)
{
if
(
response
.
data
&&
response
.
data
.
m
essage
)
{
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
errorM
essage
});
this
.
$Notice
.
error
({
title
:
(
this
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
data
.
m
essage
});
}
}
return
;
return
;
}
}
...
...
ibzdict-app/ibzdict-app-web/pom.xml
浏览文件 @
86286777
...
@@ -77,6 +77,32 @@
...
@@ -77,6 +77,32 @@
<workingDirectory>
../../app_web
</workingDirectory>
<workingDirectory>
../../app_web
</workingDirectory>
</configuration>
</configuration>
</execution>
</execution>
<execution>
<id>
prepare
</id>
<configuration>
<executable>
cp
</executable>
<arguments>
<argument>
../../${project.artifactId}.jar
</argument>
<argument>
${project.basedir}/src/main/docker/
</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>
buildpush
</id>
<configuration>
<executable>
docker
</executable>
<arguments>
<argument>
buildx
</argument>
<argument>
build
</argument>
<argument>
--platform
</argument>
<argument>
linux/amd64,linux/arm64
</argument>
<argument>
-t
</argument>
<argument>
${docker.image.prefix}/${project.artifactId}:latest
</argument>
<argument>
${project.basedir}/src/main/docker
</argument>
<argument>
--push
</argument>
</arguments>
</configuration>
</execution>
</executions>
</executions>
</plugin>
</plugin>
...
@@ -114,7 +140,7 @@
...
@@ -114,7 +140,7 @@
</resource>
</resource>
</resources>
</resources>
</configuration>
</configuration>
</plugin>
</plugin>
</plugins>
</plugins>
</build>
</build>
</profile>
</profile>
...
...
ibzdict-app/ibzdict-app-web/src/main/docker/Dockerfile
浏览文件 @
86286777
FROM
openjdk:8-jre-alpine
FROM
adoptopenjdk/openjdk8:jdk8u242-b08-centos
ENV
TZ=Asia/Shanghai \
ENV
TZ=Asia/Shanghai \
SPRING_OUTPUT_ANSI_ENABLED=ALWAYS \
SPRING_OUTPUT_ANSI_ENABLED=ALWAYS \
...
...
ibzdict-app/ibzdict-app-web/src/main/resources/application-web-prod.yml
浏览文件 @
86286777
...
@@ -7,14 +7,6 @@ logging:
...
@@ -7,14 +7,6 @@ logging:
#zuul网关路由设置
#zuul网关路由设置
zuul
:
zuul
:
routes
:
routes
:
dict_catalog
:
path
:
/dictcatalogs/**
serviceId
:
${ibiz.ref.service.ibzdict-api:ibzdict-api}
stripPrefix
:
false
dict_option
:
path
:
/dictoptions/**
serviceId
:
${ibiz.ref.service.ibzdict-api:ibzdict-api}
stripPrefix
:
false
loginv7
:
loginv7
:
path
:
/v7/login
path
:
/v7/login
serviceId
:
${ibiz.ref.service.uaa:ibzuaa-api}
serviceId
:
${ibiz.ref.service.uaa:ibzuaa-api}
...
@@ -71,5 +63,13 @@ zuul:
...
@@ -71,5 +63,13 @@ zuul:
path
:
/sysauthlogs
path
:
/sysauthlogs
serviceId
:
${ibiz.ref.service.uaa:ibzuaa-api}
serviceId
:
${ibiz.ref.service.uaa:ibzuaa-api}
stripPrefix
:
false
stripPrefix
:
false
dict_catalog
:
path
:
/dictcatalogs/**
serviceId
:
${ibiz.ref.service.ibzdict-api:ibzdict-api}
stripPrefix
:
false
dict_option
:
path
:
/dictoptions/**
serviceId
:
${ibiz.ref.service.ibzdict-api:ibzdict-api}
stripPrefix
:
false
sensitive-headers
:
sensitive-headers
:
-
Cookie,Set-Cookie,Authorization
-
Cookie,Set-Cookie,Authorization
ibzdict-core/src/main/java/cn/ibizlab/core/dict/mapper/DictCatalogMapper.java
浏览文件 @
86286777
...
@@ -30,7 +30,7 @@ public interface DictCatalogMapper extends BaseMapper<DictCatalog> {
...
@@ -30,7 +30,7 @@ public interface DictCatalogMapper extends BaseMapper<DictCatalog> {
@CacheEvict
(
value
=
"dictcatalog"
,
key
=
"'row:'+#p0.id"
)
@CacheEvict
(
value
=
"dictcatalog"
,
key
=
"'row:'+#p0.id"
)
int
updateById
(
@Param
(
Constants
.
ENTITY
)
DictCatalog
entity
);
int
updateById
(
@Param
(
Constants
.
ENTITY
)
DictCatalog
entity
);
@Override
@Override
@CacheEvict
(
value
=
"dictcatalog"
,
key
=
"'row:'+#p0.id"
)
@CacheEvict
(
value
=
"dictcatalog"
,
key
=
"'row:'+#p0.id"
,
condition
=
"#p0 != null"
)
int
update
(
@Param
(
Constants
.
ENTITY
)
DictCatalog
entity
,
@Param
(
"ew"
)
Wrapper
<
DictCatalog
>
updateWrapper
);
int
update
(
@Param
(
Constants
.
ENTITY
)
DictCatalog
entity
,
@Param
(
"ew"
)
Wrapper
<
DictCatalog
>
updateWrapper
);
@Override
@Override
@CacheEvict
(
value
=
"dictcatalog"
,
key
=
"'row:'+#p0"
)
@CacheEvict
(
value
=
"dictcatalog"
,
key
=
"'row:'+#p0"
)
...
...
ibzdict-core/src/main/java/cn/ibizlab/core/util/config/CommonAutoConfig.java
0 → 100644
浏览文件 @
86286777
package
cn
.
ibizlab
.
core
.
util
.
config
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.CommandLineRunner
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.stereotype.Component
;
/**
* 通用配置类
*/
@Configuration
public
class
CommonAutoConfig
{
@Value
(
"${jbpm.enable.multi.con:true}"
)
private
String
flag
;
/**
* 处理逻辑节点支持多来源配置
*/
@Component
public
class
InstallSystemParamsCommandLineRunner
implements
CommandLineRunner
{
@Override
public
void
run
(
String
...
var1
){
System
.
setProperty
(
"jbpm.enable.multi.con"
,
flag
);
}
}
}
ibzdict-core/src/main/resources/liquibase/h2_table.xml
浏览文件 @
86286777
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<!--输出实体[DICT_CATALOG]数据结构 -->
<!--输出实体[DICT_CATALOG]数据结构 -->
<changeSet
author=
"
a_A_5d9d78509
"
id=
"tab-dict_catalog-4-1"
>
<changeSet
author=
"
root
"
id=
"tab-dict_catalog-4-1"
>
<createTable
tableName=
"IBZDICTCATALOG"
>
<createTable
tableName=
"IBZDICTCATALOG"
>
<column
name=
"CID"
remarks=
""
type=
"VARCHAR(100)"
>
<column
name=
"CID"
remarks=
""
type=
"VARCHAR(100)"
>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_DICT_CATALOG_CID"
/>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_DICT_CATALOG_CID"
/>
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
<!--输出实体[DICT_OPTION]数据结构 -->
<!--输出实体[DICT_OPTION]数据结构 -->
<changeSet
author=
"
a_A_5d9d78509
"
id=
"tab-dict_option-17-2"
>
<changeSet
author=
"
root
"
id=
"tab-dict_option-17-2"
>
<createTable
tableName=
"IBZDICTOPTION"
>
<createTable
tableName=
"IBZDICTOPTION"
>
<column
name=
"VKEY"
remarks=
""
type=
"VARCHAR(100)"
>
<column
name=
"VKEY"
remarks=
""
type=
"VARCHAR(100)"
>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_DICT_OPTION_VKEY"
/>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_DICT_OPTION_VKEY"
/>
...
@@ -66,7 +66,7 @@
...
@@ -66,7 +66,7 @@
<!--输出实体[DICT_CATALOG]外键关系 -->
<!--输出实体[DICT_CATALOG]外键关系 -->
<!--输出实体[DICT_OPTION]外键关系 -->
<!--输出实体[DICT_OPTION]外键关系 -->
<changeSet
author=
"
a_A_5d9d78509
"
id=
"fk-dict_option-17-3"
>
<changeSet
author=
"
root
"
id=
"fk-dict_option-17-3"
>
<addForeignKeyConstraint
baseColumnNames=
"CID"
baseTableName=
"IBZDICTOPTION"
constraintName=
"DER1N_DICT_OPTION_DICT_CATALOG"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"CID"
referencedTableName=
"IBZDICTCATALOG"
validate=
"true"
/>
<addForeignKeyConstraint
baseColumnNames=
"CID"
baseTableName=
"IBZDICTOPTION"
constraintName=
"DER1N_DICT_OPTION_DICT_CATALOG"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"CID"
referencedTableName=
"IBZDICTCATALOG"
validate=
"true"
/>
</changeSet>
</changeSet>
...
...
ibzdict-provider/ibzdict-provider-api/pom.xml
浏览文件 @
86286777
...
@@ -73,7 +73,41 @@
...
@@ -73,7 +73,41 @@
</resource>
</resource>
</resources>
</resources>
</configuration>
</configuration>
</plugin>
</plugin>
<plugin>
<groupId>
org.codehaus.mojo
</groupId>
<artifactId>
exec-maven-plugin
</artifactId>
<version>
3.0.0
</version>
<executions>
<execution>
<id>
prepare
</id>
<configuration>
<executable>
cp
</executable>
<arguments>
<argument>
../../${project.artifactId}.jar
</argument>
<argument>
${project.basedir}/src/main/docker/
</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>
buildpush
</id>
<configuration>
<executable>
docker
</executable>
<arguments>
<argument>
buildx
</argument>
<argument>
build
</argument>
<argument>
--platform
</argument>
<argument>
linux/amd64,linux/arm64
</argument>
<argument>
-t
</argument>
<argument>
${docker.image.prefix}/${project.artifactId}:latest
</argument>
<argument>
${project.basedir}/src/main/docker
</argument>
<argument>
--push
</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</plugins>
</build>
</build>
</profile>
</profile>
...
...
ibzdict-provider/ibzdict-provider-api/src/main/docker/Dockerfile
浏览文件 @
86286777
FROM
openjdk:8-jre-alpine
FROM
adoptopenjdk/openjdk8:jdk8u242-b08-centos
ENV
TZ=Asia/Shanghai \
ENV
TZ=Asia/Shanghai \
SPRING_OUTPUT_ANSI_ENABLED=ALWAYS \
SPRING_OUTPUT_ANSI_ENABLED=ALWAYS \
...
...
ibzdict-provider/ibzdict-provider-api/src/main/java/cn/ibizlab/api/rest/DictCatalogResource.java
浏览文件 @
86286777
...
@@ -65,26 +65,15 @@ public class DictCatalogResource {
...
@@ -65,26 +65,15 @@ public class DictCatalogResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
}
@VersionCheck
(
entity
=
"dictcatalog"
,
versionfield
=
"updatedate"
)
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibzdict-DictCatalog-Get-all')"
)
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibzdict-DictCatalog-Update-all')"
)
@ApiOperation
(
value
=
"获取字典"
,
tags
=
{
"字典"
},
notes
=
"获取字典"
)
@ApiOperation
(
value
=
"更新字典"
,
tags
=
{
"字典"
},
notes
=
"更新字典"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/dictcatalogs/{dictcatalog_id}"
)
@RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/dictcatalogs/{dictcatalog_id}"
)
public
ResponseEntity
<
DictCatalogDTO
>
get
(
@PathVariable
(
"dictcatalog_id"
)
String
dictcatalog_id
)
{
public
ResponseEntity
<
DictCatalogDTO
>
update
(
@PathVariable
(
"dictcatalog_id"
)
String
dictcatalog_id
,
@RequestBody
DictCatalogDTO
dictcatalogdto
)
{
DictCatalog
domain
=
dictcatalogService
.
get
(
dictcatalog_id
);
DictCatalog
domain
=
dictcatalogMapping
.
toDomain
(
dictcatalogdto
);
DictCatalogDTO
dto
=
dictcatalogMapping
.
toDto
(
domain
);
domain
.
setId
(
dictcatalog_id
);
dictcatalogService
.
update
(
domain
);
DictCatalogDTO
dto
=
dictcatalogMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
}
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibzdict-DictCatalog-Update-all')"
)
@ApiOperation
(
value
=
"批量更新字典"
,
tags
=
{
"字典"
},
notes
=
"批量更新字典"
)
@RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/dictcatalogs/batch"
)
public
ResponseEntity
<
Boolean
>
updateBatch
(
@RequestBody
List
<
DictCatalogDTO
>
dictcatalogdtos
)
{
dictcatalogService
.
updateBatch
(
dictcatalogMapping
.
toDomain
(
dictcatalogdtos
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibzdict-DictCatalog-Remove-all')"
)
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibzdict-DictCatalog-Remove-all')"
)
@ApiOperation
(
value
=
"删除字典"
,
tags
=
{
"字典"
},
notes
=
"删除字典"
)
@ApiOperation
(
value
=
"删除字典"
,
tags
=
{
"字典"
},
notes
=
"删除字典"
)
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/dictcatalogs/{dictcatalog_id}"
)
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/dictcatalogs/{dictcatalog_id}"
)
...
@@ -100,20 +89,24 @@ public class DictCatalogResource {
...
@@ -100,20 +89,24 @@ public class DictCatalogResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
}
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibzdict-DictCatalog-Get-all')"
)
@VersionCheck
(
entity
=
"dictcatalog"
,
versionfield
=
"updatedate"
)
@ApiOperation
(
value
=
"获取字典"
,
tags
=
{
"字典"
},
notes
=
"获取字典"
)
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibzdict-DictCatalog-Update-all')"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/dictcatalogs/{dictcatalog_id}"
)
@ApiOperation
(
value
=
"更新字典"
,
tags
=
{
"字典"
},
notes
=
"更新字典"
)
public
ResponseEntity
<
DictCatalogDTO
>
get
(
@PathVariable
(
"dictcatalog_id"
)
String
dictcatalog_id
)
{
@RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/dictcatalogs/{dictcatalog_id}"
)
DictCatalog
domain
=
dictcatalogService
.
get
(
dictcatalog_id
);
public
ResponseEntity
<
DictCatalogDTO
>
update
(
@PathVariable
(
"dictcatalog_id"
)
String
dictcatalog_id
,
@RequestBody
DictCatalogDTO
dictcatalogdto
)
{
DictCatalogDTO
dto
=
dictcatalogMapping
.
toDto
(
domain
);
DictCatalog
domain
=
dictcatalogMapping
.
toDomain
(
dictcatalogdto
);
domain
.
setId
(
dictcatalog_id
);
dictcatalogService
.
update
(
domain
);
DictCatalogDTO
dto
=
dictcatalogMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
}
@ApiOperation
(
value
=
"获取字典草稿"
,
tags
=
{
"字典"
},
notes
=
"获取字典草稿"
)
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibzdict-DictCatalog-Update-all')"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/dictcatalogs/getdraft"
)
@ApiOperation
(
value
=
"批量更新字典"
,
tags
=
{
"字典"
},
notes
=
"批量更新字典"
)
public
ResponseEntity
<
DictCatalogDTO
>
getDraft
(
DictCatalogDTO
dto
)
{
@RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/dictcatalogs/batch"
)
DictCatalog
domain
=
dictcatalogMapping
.
toDomain
(
dto
);
public
ResponseEntity
<
Boolean
>
updateBatch
(
@RequestBody
List
<
DictCatalogDTO
>
dictcatalogdtos
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dictcatalogMapping
.
toDto
(
dictcatalogService
.
getDraft
(
domain
)));
dictcatalogService
.
updateBatch
(
dictcatalogMapping
.
toDomain
(
dictcatalogdtos
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
}
@ApiOperation
(
value
=
"检查字典"
,
tags
=
{
"字典"
},
notes
=
"检查字典"
)
@ApiOperation
(
value
=
"检查字典"
,
tags
=
{
"字典"
},
notes
=
"检查字典"
)
...
@@ -122,6 +115,13 @@ public class DictCatalogResource {
...
@@ -122,6 +115,13 @@ public class DictCatalogResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dictcatalogService
.
checkKey
(
dictcatalogMapping
.
toDomain
(
dictcatalogdto
)));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dictcatalogService
.
checkKey
(
dictcatalogMapping
.
toDomain
(
dictcatalogdto
)));
}
}
@ApiOperation
(
value
=
"获取字典草稿"
,
tags
=
{
"字典"
},
notes
=
"获取字典草稿"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/dictcatalogs/getdraft"
)
public
ResponseEntity
<
DictCatalogDTO
>
getDraft
(
DictCatalogDTO
dto
)
{
DictCatalog
domain
=
dictcatalogMapping
.
toDomain
(
dto
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dictcatalogMapping
.
toDto
(
dictcatalogService
.
getDraft
(
domain
)));
}
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibzdict-DictCatalog-Save-all')"
)
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibzdict-DictCatalog-Save-all')"
)
@ApiOperation
(
value
=
"保存字典"
,
tags
=
{
"字典"
},
notes
=
"保存字典"
)
@ApiOperation
(
value
=
"保存字典"
,
tags
=
{
"字典"
},
notes
=
"保存字典"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/dictcatalogs/save"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/dictcatalogs/save"
)
...
...
ibzdict-provider/ibzdict-provider-api/src/main/java/cn/ibizlab/api/rest/DictOptionResource.java
浏览文件 @
86286777
...
@@ -65,26 +65,15 @@ public class DictOptionResource {
...
@@ -65,26 +65,15 @@ public class DictOptionResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
}
@VersionCheck
(
entity
=
"dictoption"
,
versionfield
=
"updatedate"
)
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibzdict-DictOption-Get-all')"
)
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibzdict-DictOption-Update-all')"
)
@ApiOperation
(
value
=
"获取字典项"
,
tags
=
{
"字典项"
},
notes
=
"获取字典项"
)
@ApiOperation
(
value
=
"更新字典项"
,
tags
=
{
"字典项"
},
notes
=
"更新字典项"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/dictoptions/{dictoption_id}"
)
@RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/dictoptions/{dictoption_id}"
)
public
ResponseEntity
<
DictOptionDTO
>
get
(
@PathVariable
(
"dictoption_id"
)
String
dictoption_id
)
{
public
ResponseEntity
<
DictOptionDTO
>
update
(
@PathVariable
(
"dictoption_id"
)
String
dictoption_id
,
@RequestBody
DictOptionDTO
dictoptiondto
)
{
DictOption
domain
=
dictoptionService
.
get
(
dictoption_id
);
DictOption
domain
=
dictoptionMapping
.
toDomain
(
dictoptiondto
);
DictOptionDTO
dto
=
dictoptionMapping
.
toDto
(
domain
);
domain
.
setValueKey
(
dictoption_id
);
dictoptionService
.
update
(
domain
);
DictOptionDTO
dto
=
dictoptionMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
}
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibzdict-DictOption-Update-all')"
)
@ApiOperation
(
value
=
"批量更新字典项"
,
tags
=
{
"字典项"
},
notes
=
"批量更新字典项"
)
@RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/dictoptions/batch"
)
public
ResponseEntity
<
Boolean
>
updateBatch
(
@RequestBody
List
<
DictOptionDTO
>
dictoptiondtos
)
{
dictoptionService
.
updateBatch
(
dictoptionMapping
.
toDomain
(
dictoptiondtos
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibzdict-DictOption-Remove-all')"
)
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibzdict-DictOption-Remove-all')"
)
@ApiOperation
(
value
=
"删除字典项"
,
tags
=
{
"字典项"
},
notes
=
"删除字典项"
)
@ApiOperation
(
value
=
"删除字典项"
,
tags
=
{
"字典项"
},
notes
=
"删除字典项"
)
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/dictoptions/{dictoption_id}"
)
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/dictoptions/{dictoption_id}"
)
...
@@ -100,20 +89,24 @@ public class DictOptionResource {
...
@@ -100,20 +89,24 @@ public class DictOptionResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
}
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibzdict-DictOption-Get-all')"
)
@VersionCheck
(
entity
=
"dictoption"
,
versionfield
=
"updatedate"
)
@ApiOperation
(
value
=
"获取字典项"
,
tags
=
{
"字典项"
},
notes
=
"获取字典项"
)
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibzdict-DictOption-Update-all')"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/dictoptions/{dictoption_id}"
)
@ApiOperation
(
value
=
"更新字典项"
,
tags
=
{
"字典项"
},
notes
=
"更新字典项"
)
public
ResponseEntity
<
DictOptionDTO
>
get
(
@PathVariable
(
"dictoption_id"
)
String
dictoption_id
)
{
@RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/dictoptions/{dictoption_id}"
)
DictOption
domain
=
dictoptionService
.
get
(
dictoption_id
);
public
ResponseEntity
<
DictOptionDTO
>
update
(
@PathVariable
(
"dictoption_id"
)
String
dictoption_id
,
@RequestBody
DictOptionDTO
dictoptiondto
)
{
DictOptionDTO
dto
=
dictoptionMapping
.
toDto
(
domain
);
DictOption
domain
=
dictoptionMapping
.
toDomain
(
dictoptiondto
);
domain
.
setValueKey
(
dictoption_id
);
dictoptionService
.
update
(
domain
);
DictOptionDTO
dto
=
dictoptionMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
}
@ApiOperation
(
value
=
"获取字典项草稿"
,
tags
=
{
"字典项"
},
notes
=
"获取字典项草稿"
)
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibzdict-DictOption-Update-all')"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/dictoptions/getdraft"
)
@ApiOperation
(
value
=
"批量更新字典项"
,
tags
=
{
"字典项"
},
notes
=
"批量更新字典项"
)
public
ResponseEntity
<
DictOptionDTO
>
getDraft
(
DictOptionDTO
dto
)
{
@RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/dictoptions/batch"
)
DictOption
domain
=
dictoptionMapping
.
toDomain
(
dto
);
public
ResponseEntity
<
Boolean
>
updateBatch
(
@RequestBody
List
<
DictOptionDTO
>
dictoptiondtos
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dictoptionMapping
.
toDto
(
dictoptionService
.
getDraft
(
domain
)));
dictoptionService
.
updateBatch
(
dictoptionMapping
.
toDomain
(
dictoptiondtos
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
}
@ApiOperation
(
value
=
"检查字典项"
,
tags
=
{
"字典项"
},
notes
=
"检查字典项"
)
@ApiOperation
(
value
=
"检查字典项"
,
tags
=
{
"字典项"
},
notes
=
"检查字典项"
)
...
@@ -122,6 +115,13 @@ public class DictOptionResource {
...
@@ -122,6 +115,13 @@ public class DictOptionResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dictoptionService
.
checkKey
(
dictoptionMapping
.
toDomain
(
dictoptiondto
)));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dictoptionService
.
checkKey
(
dictoptionMapping
.
toDomain
(
dictoptiondto
)));
}
}
@ApiOperation
(
value
=
"获取字典项草稿"
,
tags
=
{
"字典项"
},
notes
=
"获取字典项草稿"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/dictoptions/getdraft"
)
public
ResponseEntity
<
DictOptionDTO
>
getDraft
(
DictOptionDTO
dto
)
{
DictOption
domain
=
dictoptionMapping
.
toDomain
(
dto
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dictoptionMapping
.
toDto
(
dictoptionService
.
getDraft
(
domain
)));
}
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibzdict-DictOption-Save-all')"
)
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibzdict-DictOption-Save-all')"
)
@ApiOperation
(
value
=
"保存字典项"
,
tags
=
{
"字典项"
},
notes
=
"保存字典项"
)
@ApiOperation
(
value
=
"保存字典项"
,
tags
=
{
"字典项"
},
notes
=
"保存字典项"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/dictoptions/save"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/dictoptions/save"
)
...
@@ -184,6 +184,30 @@ public class DictOptionResource {
...
@@ -184,6 +184,30 @@ public class DictOptionResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
}
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibzdict-DictOption-Get-all')"
)
@ApiOperation
(
value
=
"根据字典获取字典项"
,
tags
=
{
"字典项"
},
notes
=
"根据字典获取字典项"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/dictcatalogs/{dictcatalog_id}/dictoptions/{dictoption_id}"
)
public
ResponseEntity
<
DictOptionDTO
>
getByDictCatalog
(
@PathVariable
(
"dictcatalog_id"
)
String
dictcatalog_id
,
@PathVariable
(
"dictoption_id"
)
String
dictoption_id
)
{
DictOption
domain
=
dictoptionService
.
get
(
dictoption_id
);
DictOptionDTO
dto
=
dictoptionMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibzdict-DictOption-Remove-all')"
)
@ApiOperation
(
value
=
"根据字典删除字典项"
,
tags
=
{
"字典项"
},
notes
=
"根据字典删除字典项"
)
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/dictcatalogs/{dictcatalog_id}/dictoptions/{dictoption_id}"
)
public
ResponseEntity
<
Boolean
>
removeByDictCatalog
(
@PathVariable
(
"dictcatalog_id"
)
String
dictcatalog_id
,
@PathVariable
(
"dictoption_id"
)
String
dictoption_id
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dictoptionService
.
remove
(
dictoption_id
));
}
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibzdict-DictOption-Remove-all')"
)
@ApiOperation
(
value
=
"根据字典批量删除字典项"
,
tags
=
{
"字典项"
},
notes
=
"根据字典批量删除字典项"
)
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/dictcatalogs/{dictcatalog_id}/dictoptions/batch"
)
public
ResponseEntity
<
Boolean
>
removeBatchByDictCatalog
(
@RequestBody
List
<
String
>
ids
)
{
dictoptionService
.
removeBatch
(
ids
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@VersionCheck
(
entity
=
"dictoption"
,
versionfield
=
"updatedate"
)
@VersionCheck
(
entity
=
"dictoption"
,
versionfield
=
"updatedate"
)
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibzdict-DictOption-Update-all')"
)
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibzdict-DictOption-Update-all')"
)
@ApiOperation
(
value
=
"根据字典更新字典项"
,
tags
=
{
"字典项"
},
notes
=
"根据字典更新字典项"
)
@ApiOperation
(
value
=
"根据字典更新字典项"
,
tags
=
{
"字典项"
},
notes
=
"根据字典更新字典项"
)
...
@@ -209,28 +233,10 @@ public class DictOptionResource {
...
@@ -209,28 +233,10 @@ public class DictOptionResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
}
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibzdict-DictOption-Remove-all')"
)
@ApiOperation
(
value
=
"根据字典检查字典项"
,
tags
=
{
"字典项"
},
notes
=
"根据字典检查字典项"
)
@ApiOperation
(
value
=
"根据字典删除字典项"
,
tags
=
{
"字典项"
},
notes
=
"根据字典删除字典项"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/dictcatalogs/{dictcatalog_id}/dictoptions/checkkey"
)
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/dictcatalogs/{dictcatalog_id}/dictoptions/{dictoption_id}"
)
public
ResponseEntity
<
Boolean
>
checkKeyByDictCatalog
(
@PathVariable
(
"dictcatalog_id"
)
String
dictcatalog_id
,
@RequestBody
DictOptionDTO
dictoptiondto
)
{
public
ResponseEntity
<
Boolean
>
removeByDictCatalog
(
@PathVariable
(
"dictcatalog_id"
)
String
dictcatalog_id
,
@PathVariable
(
"dictoption_id"
)
String
dictoption_id
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dictoptionService
.
checkKey
(
dictoptionMapping
.
toDomain
(
dictoptiondto
)));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dictoptionService
.
remove
(
dictoption_id
));
}
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibzdict-DictOption-Remove-all')"
)
@ApiOperation
(
value
=
"根据字典批量删除字典项"
,
tags
=
{
"字典项"
},
notes
=
"根据字典批量删除字典项"
)
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/dictcatalogs/{dictcatalog_id}/dictoptions/batch"
)
public
ResponseEntity
<
Boolean
>
removeBatchByDictCatalog
(
@RequestBody
List
<
String
>
ids
)
{
dictoptionService
.
removeBatch
(
ids
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibzdict-DictOption-Get-all')"
)
@ApiOperation
(
value
=
"根据字典获取字典项"
,
tags
=
{
"字典项"
},
notes
=
"根据字典获取字典项"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/dictcatalogs/{dictcatalog_id}/dictoptions/{dictoption_id}"
)
public
ResponseEntity
<
DictOptionDTO
>
getByDictCatalog
(
@PathVariable
(
"dictcatalog_id"
)
String
dictcatalog_id
,
@PathVariable
(
"dictoption_id"
)
String
dictoption_id
)
{
DictOption
domain
=
dictoptionService
.
get
(
dictoption_id
);
DictOptionDTO
dto
=
dictoptionMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
}
@ApiOperation
(
value
=
"根据字典获取字典项草稿"
,
tags
=
{
"字典项"
},
notes
=
"根据字典获取字典项草稿"
)
@ApiOperation
(
value
=
"根据字典获取字典项草稿"
,
tags
=
{
"字典项"
},
notes
=
"根据字典获取字典项草稿"
)
...
@@ -241,12 +247,6 @@ public class DictOptionResource {
...
@@ -241,12 +247,6 @@ public class DictOptionResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dictoptionMapping
.
toDto
(
dictoptionService
.
getDraft
(
domain
)));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dictoptionMapping
.
toDto
(
dictoptionService
.
getDraft
(
domain
)));
}
}
@ApiOperation
(
value
=
"根据字典检查字典项"
,
tags
=
{
"字典项"
},
notes
=
"根据字典检查字典项"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/dictcatalogs/{dictcatalog_id}/dictoptions/checkkey"
)
public
ResponseEntity
<
Boolean
>
checkKeyByDictCatalog
(
@PathVariable
(
"dictcatalog_id"
)
String
dictcatalog_id
,
@RequestBody
DictOptionDTO
dictoptiondto
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dictoptionService
.
checkKey
(
dictoptionMapping
.
toDomain
(
dictoptiondto
)));
}
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibzdict-DictOption-Save-all')"
)
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibzdict-DictOption-Save-all')"
)
@ApiOperation
(
value
=
"根据字典保存字典项"
,
tags
=
{
"字典项"
},
notes
=
"根据字典保存字典项"
)
@ApiOperation
(
value
=
"根据字典保存字典项"
,
tags
=
{
"字典项"
},
notes
=
"根据字典保存字典项"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/dictcatalogs/{dictcatalog_id}/dictoptions/save"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/dictcatalogs/{dictcatalog_id}/dictoptions/save"
)
...
...
ibzdict-util/src/main/java/cn/ibizlab/util/aspect/DELogicAspect.java
浏览文件 @
86286777
...
@@ -28,6 +28,7 @@ import org.springframework.expression.ExpressionParser;
...
@@ -28,6 +28,7 @@ import org.springframework.expression.ExpressionParser;
import
org.springframework.expression.spel.standard.SpelExpressionParser
;
import
org.springframework.expression.spel.standard.SpelExpressionParser
;
import
org.springframework.expression.spel.support.StandardEvaluationContext
;
import
org.springframework.expression.spel.support.StandardEvaluationContext
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.ClassUtils
;
import
org.springframework.util.DigestUtils
;
import
org.springframework.util.DigestUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
...
@@ -80,7 +81,7 @@ public class DELogicAspect {
...
@@ -80,7 +81,7 @@ public class DELogicAspect {
if
(!
ObjectUtils
.
isEmpty
(
entity
))
{
if
(!
ObjectUtils
.
isEmpty
(
entity
))
{
String
id
=
DEFieldCacheMap
.
getDEKeyField
(
entity
.
getClass
());
String
id
=
DEFieldCacheMap
.
getDEKeyField
(
entity
.
getClass
());
if
(
StringUtils
.
isEmpty
(
id
))
{
if
(
StringUtils
.
isEmpty
(
id
))
{
log
.
debug
(
"无法获取实体主键属性[{}]"
,
entity
.
getClass
().
getSimpleName
(
));
log
.
debug
(
"无法获取实体主键属性[{}]"
,
getEntityName
(
entity
));
return
point
.
proceed
();
return
point
.
proceed
();
}
}
entity
.
set
(
id
,
arg
);
entity
.
set
(
id
,
arg
);
...
@@ -101,6 +102,17 @@ public class DELogicAspect {
...
@@ -101,6 +102,17 @@ public class DELogicAspect {
return
point
.
proceed
();
return
point
.
proceed
();
}
}
/**
* 判断类是否被代理类代理
*/
private
String
getEntityName
(
Object
entity
){
String
entityName
=
entity
.
getClass
().
getSimpleName
();
if
(
entityName
.
contains
(
"$$"
)){
entityName
=
ClassUtils
.
getUserClass
(
entity
.
getClass
()).
getSimpleName
();
}
return
entityName
;
}
/**
/**
* 前附加逻辑
* 前附加逻辑
*
*
...
@@ -108,7 +120,7 @@ public class DELogicAspect {
...
@@ -108,7 +120,7 @@ public class DELogicAspect {
* @param action
* @param action
*/
*/
private
void
executeBeforeLogic
(
EntityBase
entity
,
String
action
)
{
private
void
executeBeforeLogic
(
EntityBase
entity
,
String
action
)
{
Resource
bpmnFile
=
getLocalModel
(
entity
.
getClass
().
getSimpleName
(
),
action
,
LogicExecMode
.
BEFORE
);
Resource
bpmnFile
=
getLocalModel
(
getEntityName
(
entity
),
action
,
LogicExecMode
.
BEFORE
);
if
(
bpmnFile
!=
null
&&
bpmnFile
.
exists
()
&&
isValid
(
bpmnFile
,
entity
,
action
))
{
if
(
bpmnFile
!=
null
&&
bpmnFile
.
exists
()
&&
isValid
(
bpmnFile
,
entity
,
action
))
{
executeLogic
(
bpmnFile
,
entity
,
action
);
executeLogic
(
bpmnFile
,
entity
,
action
);
}
}
...
@@ -121,7 +133,7 @@ public class DELogicAspect {
...
@@ -121,7 +133,7 @@ public class DELogicAspect {
* @param action
* @param action
*/
*/
private
void
executeAfterLogic
(
EntityBase
entity
,
String
action
)
{
private
void
executeAfterLogic
(
EntityBase
entity
,
String
action
)
{
Resource
bpmnFile
=
getLocalModel
(
entity
.
getClass
().
getSimpleName
(
),
action
,
LogicExecMode
.
AFTER
);
Resource
bpmnFile
=
getLocalModel
(
getEntityName
(
entity
),
action
,
LogicExecMode
.
AFTER
);
if
(
bpmnFile
!=
null
&&
bpmnFile
.
exists
()
&&
isValid
(
bpmnFile
,
entity
,
action
))
{
if
(
bpmnFile
!=
null
&&
bpmnFile
.
exists
()
&&
isValid
(
bpmnFile
,
entity
,
action
))
{
executeLogic
(
bpmnFile
,
entity
,
action
);
executeLogic
(
bpmnFile
,
entity
,
action
);
}
}
...
@@ -134,7 +146,7 @@ public class DELogicAspect {
...
@@ -134,7 +146,7 @@ public class DELogicAspect {
* @param action
* @param action
*/
*/
private
void
executeLogic
(
EntityBase
entity
,
String
action
)
{
private
void
executeLogic
(
EntityBase
entity
,
String
action
)
{
Resource
bpmnFile
=
getLocalModel
(
entity
.
getClass
().
getSimpleName
(
),
action
,
LogicExecMode
.
EXEC
);
Resource
bpmnFile
=
getLocalModel
(
getEntityName
(
entity
),
action
,
LogicExecMode
.
EXEC
);
if
(
bpmnFile
!=
null
&&
bpmnFile
.
exists
()
&&
isValid
(
bpmnFile
,
entity
,
action
))
{
if
(
bpmnFile
!=
null
&&
bpmnFile
.
exists
()
&&
isValid
(
bpmnFile
,
entity
,
action
))
{
executeLogic
(
bpmnFile
,
entity
,
action
);
executeLogic
(
bpmnFile
,
entity
,
action
);
}
}
...
@@ -148,7 +160,7 @@ public class DELogicAspect {
...
@@ -148,7 +160,7 @@ public class DELogicAspect {
*/
*/
private
void
executeLogic
(
Resource
bpmnFile
,
Object
entity
,
String
action
)
{
private
void
executeLogic
(
Resource
bpmnFile
,
Object
entity
,
String
action
)
{
try
{
try
{
log
.
debug
(
"开始执行实体处理逻辑[{}:{}:{}:本地模式]"
,
entity
.
getClass
().
getSimpleName
(
),
action
,
bpmnFile
.
getFilename
());
log
.
debug
(
"开始执行实体处理逻辑[{}:{}:{}:本地模式]"
,
getEntityName
(
entity
),
action
,
bpmnFile
.
getFilename
());
String
bpmnId
=
DigestUtils
.
md5DigestAsHex
(
bpmnFile
.
getURL
().
getPath
().
getBytes
());
String
bpmnId
=
DigestUtils
.
md5DigestAsHex
(
bpmnFile
.
getURL
().
getPath
().
getBytes
());
DELogic
logic
=
getDELogic
(
bpmnFile
);
DELogic
logic
=
getDELogic
(
bpmnFile
);
if
(
logic
==
null
)
{
if
(
logic
==
null
)
{
...
@@ -172,9 +184,9 @@ public class DELogicAspect {
...
@@ -172,9 +184,9 @@ public class DELogicAspect {
}
}
}
}
kieSession
.
startProcess
(
mainProcess
.
getId
());
kieSession
.
startProcess
(
mainProcess
.
getId
());
log
.
debug
(
"实体处理逻辑[{}:{}:{}:本地模式]执行结束"
,
entity
.
getClass
().
getSimpleName
(
),
action
,
bpmnFile
.
getFilename
());
log
.
debug
(
"实体处理逻辑[{}:{}:{}:本地模式]执行结束"
,
getEntityName
(
entity
),
action
,
bpmnFile
.
getFilename
());
}
catch
(
IO
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"实体处理逻辑[{}:{}:{}:本地模式]发生异常"
,
entity
.
getClass
().
getSimpleName
(
),
action
,
bpmnFile
.
getFilename
());
log
.
error
(
"实体处理逻辑[{}:{}:{}:本地模式]发生异常"
,
getEntityName
(
entity
),
action
,
bpmnFile
.
getFilename
());
throw
new
BadRequestAlertException
(
"执行实体处理逻辑发生异常"
+
e
.
getMessage
(),
"DELogicAspect"
,
"executeLogic"
);
throw
new
BadRequestAlertException
(
"执行实体处理逻辑发生异常"
+
e
.
getMessage
(),
"DELogicAspect"
,
"executeLogic"
);
}
}
}
}
...
@@ -414,7 +426,7 @@ public class DELogicAspect {
...
@@ -414,7 +426,7 @@ public class DELogicAspect {
* @return
* @return
*/
*/
private
boolean
isValid
(
Resource
bpmn
,
Object
entity
,
Object
action
)
{
private
boolean
isValid
(
Resource
bpmn
,
Object
entity
,
Object
action
)
{
String
logicId
=
String
.
format
(
"%s%s%s"
,
entity
.
getClass
().
getSimpleName
(
),
action
,
bpmn
.
getFilename
()).
toLowerCase
();
String
logicId
=
String
.
format
(
"%s%s%s"
,
getEntityName
(
entity
),
action
,
bpmn
.
getFilename
()).
toLowerCase
();
if
(
validLogic
.
containsKey
(
logicId
))
{
if
(
validLogic
.
containsKey
(
logicId
))
{
return
true
;
return
true
;
}
else
{
}
else
{
...
...
ibzdict-util/src/main/java/cn/ibizlab/util/cache/cache/CusCaffeineCache.java
0 → 100644
浏览文件 @
86286777
package
cn
.
ibizlab
.
util
.
cache
.
cache
;
import
cn.ibizlab.util.helper.Globs
;
import
org.springframework.cache.caffeine.CaffeineCache
;
import
com.github.benmanes.caffeine.cache.Cache
;
import
javax.validation.constraints.NotNull
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
/**
* 自定义的Caffeine缓存
*/
public
class
CusCaffeineCache
extends
CaffeineCache
{
public
CusCaffeineCache
(
String
name
,
Cache
<
Object
,
Object
>
cache
)
{
super
(
name
,
cache
);
}
public
CusCaffeineCache
(
String
name
,
Cache
<
Object
,
Object
>
cache
,
boolean
allowNullValues
)
{
super
(
name
,
cache
,
allowNullValues
);
}
@Override
public
void
evict
(
@NotNull
Object
key
)
{
if
(
key
instanceof
String
&&
((
String
)
key
).
startsWith
(
"glob:"
))
{
String
globPattern
=
((
String
)
key
).
split
(
"glob:"
)[
1
];
// 将Glob匹配转换成正则匹配
String
regexPattern
=
Globs
.
toUnixRegexPattern
(
globPattern
);
// String regexPattern = Globs.toWindowsRegexPattern(globPattern);
Cache
<
Object
,
Object
>
cache
=
super
.
getNativeCache
();
Set
<
Object
>
keySet
=
cache
.
asMap
().
keySet
();
keySet
=
keySet
.
stream
().
filter
(
o
->
o
.
toString
().
matches
(
regexPattern
)).
collect
(
Collectors
.
toSet
());
cache
.
invalidateAll
(
keySet
);
}
else
{
super
.
evict
(
key
);
}
}
}
ibzdict-util/src/main/java/cn/ibizlab/util/cache/cache/CusRedisCache.java
浏览文件 @
86286777
...
@@ -4,6 +4,8 @@ import org.springframework.data.redis.cache.RedisCache;
...
@@ -4,6 +4,8 @@ import org.springframework.data.redis.cache.RedisCache;
import
org.springframework.data.redis.cache.RedisCacheConfiguration
;
import
org.springframework.data.redis.cache.RedisCacheConfiguration
;
import
org.springframework.data.redis.cache.RedisCacheWriter
;
import
org.springframework.data.redis.cache.RedisCacheWriter
;
import
javax.validation.constraints.NotNull
;
/**
/**
* 自定义的redis缓存
* 自定义的redis缓存
*/
*/
...
@@ -12,4 +14,18 @@ public class CusRedisCache extends RedisCache {
...
@@ -12,4 +14,18 @@ public class CusRedisCache extends RedisCache {
public
CusRedisCache
(
String
name
,
RedisCacheWriter
redisCacheWriter
,
RedisCacheConfiguration
configuration
)
{
public
CusRedisCache
(
String
name
,
RedisCacheWriter
redisCacheWriter
,
RedisCacheConfiguration
configuration
)
{
super
(
name
,
redisCacheWriter
,
configuration
);
super
(
name
,
redisCacheWriter
,
configuration
);
}
}
@Override
public
void
evict
(
@NotNull
Object
key
)
{
if
(
key
instanceof
String
&&
((
String
)
key
).
startsWith
(
"glob:"
))
{
String
globPattern
=
((
String
)
key
).
split
(
"glob:"
)[
1
];
byte
[]
globPatternBytes
=
super
.
getCacheConfiguration
().
getConversionService
().
convert
(
globPattern
,
byte
[].
class
);
if
(
globPatternBytes
!=
null
){
super
.
getNativeCache
().
clean
(
super
.
getName
(),
globPatternBytes
);
}
}
else
{
super
.
evict
(
key
);
}
}
}
}
ibzdict-util/src/main/java/cn/ibizlab/util/cache/cacheManager/LayeringCacheManager.java
浏览文件 @
86286777
...
@@ -15,6 +15,7 @@ import java.util.Collections;
...
@@ -15,6 +15,7 @@ import java.util.Collections;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.concurrent.ConcurrentMap
;
import
java.util.concurrent.ConcurrentMap
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.TimeUnit
;
import
cn.ibizlab.util.cache.cache.CusCaffeineCache
;
import
cn.ibizlab.util.cache.cache.CusRedisCache
;
import
cn.ibizlab.util.cache.cache.CusRedisCache
;
import
cn.ibizlab.util.cache.cache.LayeringCache
;
import
cn.ibizlab.util.cache.cache.LayeringCache
;
...
@@ -80,7 +81,7 @@ public class LayeringCacheManager implements CacheManager {
...
@@ -80,7 +81,7 @@ public class LayeringCacheManager implements CacheManager {
* @return
* @return
*/
*/
protected
Cache
createCache
(
String
cacheName
)
{
protected
Cache
createCache
(
String
cacheName
)
{
return
new
LayeringCache
(
cacheName
,
new
CaffeineCache
(
cacheName
,
this
.
cacheBuilder
.
build
(),
true
),
new
CusRedisCache
(
cacheName
,
redisCacheWriter
,
redisConfiguration
),
redisTemplate
);
return
new
LayeringCache
(
cacheName
,
new
C
usC
affeineCache
(
cacheName
,
this
.
cacheBuilder
.
build
(),
true
),
new
CusRedisCache
(
cacheName
,
redisCacheWriter
,
redisConfiguration
),
redisTemplate
);
}
}
/**
/**
...
...
ibzdict-util/src/main/java/cn/ibizlab/util/client/IBZWFFallback.java
浏览文件 @
86286777
...
@@ -3,6 +3,7 @@ package cn.ibizlab.util.client;
...
@@ -3,6 +3,7 @@ package cn.ibizlab.util.client;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
java.util.*
;
import
java.util.*
;
import
java.io.Serializable
;
@Component
@Component
public
class
IBZWFFallback
implements
IBZWFFeignClient
{
public
class
IBZWFFallback
implements
IBZWFFeignClient
{
...
@@ -26,4 +27,20 @@ public class IBZWFFallback implements IBZWFFeignClient {
...
@@ -26,4 +27,20 @@ public class IBZWFFallback implements IBZWFFeignClient {
public
JSONObject
wfstart
(
String
system
,
String
appname
,
String
entity
,
String
businessKey
,
JSONObject
instance
)
{
public
JSONObject
wfstart
(
String
system
,
String
appname
,
String
entity
,
String
businessKey
,
JSONObject
instance
)
{
return
null
;
return
null
;
}
}
@Override
public
Map
<
String
,
Map
<
String
,
Object
>>
getTask
(
String
system
,
String
userId
,
String
entity
,
String
instTag
,
String
instTag2
,
String
taskType
)
{
return
null
;
}
@Override
public
Map
<
String
,
Map
<
String
,
Object
>>
getTaskByStep
(
String
system
,
String
userId
,
String
entity
,
String
instTag
,
String
instTag2
,
String
taskType
,
String
srfwfstep
)
{
return
null
;
}
@Override
public
Integer
getDataAccessMode
(
String
system
,
String
entity
,
Serializable
businessKey
)
{
return
null
;
}
}
}
ibzdict-util/src/main/java/cn/ibizlab/util/client/IBZWFFeignClient.java
浏览文件 @
86286777
...
@@ -4,6 +4,7 @@ import org.springframework.cloud.openfeign.FeignClient;
...
@@ -4,6 +4,7 @@ import org.springframework.cloud.openfeign.FeignClient;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
java.util.*
;
import
java.util.*
;
import
java.io.Serializable
;
@FeignClient
(
value
=
"${ibiz.ref.service.wf:ibzwf-api}"
,
contextId
=
"wf"
,
fallback
=
IBZWFFallback
.
class
)
@FeignClient
(
value
=
"${ibiz.ref.service.wf:ibzwf-api}"
,
contextId
=
"wf"
,
fallback
=
IBZWFFallback
.
class
)
public
interface
IBZWFFeignClient
public
interface
IBZWFFeignClient
...
@@ -25,4 +26,15 @@ public interface IBZWFFeignClient
...
@@ -25,4 +26,15 @@ public interface IBZWFFeignClient
@PathVariable
(
"entity"
)
String
entity
,
@PathVariable
(
"entity"
)
String
entity
,
@PathVariable
(
"businessKey"
)
String
businessKey
,
@RequestBody
JSONObject
instance
);
@PathVariable
(
"businessKey"
)
String
businessKey
,
@RequestBody
JSONObject
instance
);
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/{system}-user-{userId}/{insttag}/{insttag2}/{entity}/tasks"
)
Map
<
String
,
Map
<
String
,
Object
>>
getTask
(
@PathVariable
(
"system"
)
String
system
,
@PathVariable
(
"userId"
)
String
userId
,
@PathVariable
(
"entity"
)
String
entity
,
@PathVariable
(
"insttag"
)
String
instTag
,
@PathVariable
(
"insttag2"
)
String
instTag2
,
@RequestParam
(
"srfwf"
)
String
taskType
);
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/{system}-user-{userId}/{insttag}/{insttag2}/{entity}/tasks"
)
Map
<
String
,
Map
<
String
,
Object
>>
getTaskByStep
(
@PathVariable
(
"system"
)
String
system
,
@PathVariable
(
"userId"
)
String
userId
,
@PathVariable
(
"entity"
)
String
entity
,
@PathVariable
(
"insttag"
)
String
instTag
,
@PathVariable
(
"insttag2"
)
String
instTag2
,
@RequestParam
(
"srfwf"
)
String
taskType
,
@RequestParam
(
"n_taskdefinitionkey_eq"
)
String
srfwfstep
);
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/{system}/{entity}/{businessKey}/dataaccessmode"
)
Integer
getDataAccessMode
(
@PathVariable
(
"system"
)
String
system
,
@PathVariable
(
"entity"
)
String
entity
,
@PathVariable
(
"businessKey"
)
Serializable
businessKey
);
}
}
ibzdict-util/src/main/java/cn/ibizlab/util/domain/DELogic.java
浏览文件 @
86286777
...
@@ -17,4 +17,6 @@ public class DELogic implements Serializable {
...
@@ -17,4 +17,6 @@ public class DELogic implements Serializable {
List
<
DELogic
>
refLogic
;
List
<
DELogic
>
refLogic
;
List
<
Resource
>
refRuleFiles
;
List
<
Resource
>
refRuleFiles
;
String
md5
;
String
md5
;
int
logicMode
;
long
loadedTime
;
}
}
ibzdict-util/src/main/java/cn/ibizlab/util/enums/DEFieldDefaultValueType.java
浏览文件 @
86286777
...
@@ -43,5 +43,21 @@ public enum DEFieldDefaultValueType {
...
@@ -43,5 +43,21 @@ public enum DEFieldDefaultValueType {
/**
/**
* 默认值
* 默认值
*/
*/
NONE
NONE
,
/**
* 用户自定义
*/
USER
,
/**
* 用户自定义2
*/
USER2
,
/**
* 用户自定义3
*/
USER3
,
/**
* 用户自定义4
*/
USER4
}
}
ibzdict-util/src/main/java/cn/ibizlab/util/enums/DEPredefinedFieldType.java
浏览文件 @
86286777
...
@@ -55,5 +55,17 @@ public enum DEPredefinedFieldType {
...
@@ -55,5 +55,17 @@ public enum DEPredefinedFieldType {
/**
/**
* 不处理
* 不处理
*/
*/
NONE
NONE
,
/**
* 动态父类型
*/
PARENTTYPE
,
/**
* 动态父标识
*/
PARENTID
,
/**
* 动态父名称
*/
PARENTNAME
}
}
ibzdict-util/src/main/java/cn/ibizlab/util/helper/Globs.java
0 → 100644
浏览文件 @
86286777
package
cn
.
ibizlab
.
util
.
helper
;
import
java.util.regex.PatternSyntaxException
;
/**
* Copy from class sun.nio.fs.Globs
*/
public
class
Globs
{
private
Globs
()
{
}
private
static
final
String
regexMetaChars
=
".^$+{[]|()"
;
private
static
final
String
globMetaChars
=
"\\*?[{"
;
private
static
boolean
isRegexMeta
(
char
c
)
{
return
regexMetaChars
.
indexOf
(
c
)
!=
-
1
;
}
private
static
boolean
isGlobMeta
(
char
c
)
{
return
globMetaChars
.
indexOf
(
c
)
!=
-
1
;
}
private
static
char
EOL
=
0
;
//TBD
private
static
char
next
(
String
glob
,
int
i
)
{
if
(
i
<
glob
.
length
())
{
return
glob
.
charAt
(
i
);
}
return
EOL
;
}
/**
* Creates a regex pattern from the given glob expression.
*
* @throws PatternSyntaxException
*/
private
static
String
toRegexPattern
(
String
globPattern
,
boolean
isDos
)
{
boolean
inGroup
=
false
;
StringBuilder
regex
=
new
StringBuilder
(
"^"
);
int
i
=
0
;
while
(
i
<
globPattern
.
length
())
{
char
c
=
globPattern
.
charAt
(
i
++);
switch
(
c
)
{
case
'\\'
:
// escape special characters
if
(
i
==
globPattern
.
length
())
{
throw
new
PatternSyntaxException
(
"No character to escape"
,
globPattern
,
i
-
1
);
}
char
next
=
globPattern
.
charAt
(
i
++);
if
(
isGlobMeta
(
next
)
||
isRegexMeta
(
next
))
{
regex
.
append
(
'\\'
);
}
regex
.
append
(
next
);
break
;
case
'/'
:
if
(
isDos
)
{
regex
.
append
(
"\\\\"
);
}
else
{
regex
.
append
(
c
);
}
break
;
case
'['
:
// don't match name separator in class
if
(
isDos
)
{
regex
.
append
(
"[[^\\\\]&&["
);
}
else
{
regex
.
append
(
"[[^/]&&["
);
}
if
(
next
(
globPattern
,
i
)
==
'^'
)
{
// escape the regex negation char if it appears
regex
.
append
(
"\\^"
);
i
++;
}
else
{
// negation
if
(
next
(
globPattern
,
i
)
==
'!'
)
{
regex
.
append
(
'^'
);
i
++;
}
// hyphen allowed at start
if
(
next
(
globPattern
,
i
)
==
'-'
)
{
regex
.
append
(
'-'
);
i
++;
}
}
boolean
hasRangeStart
=
false
;
char
last
=
0
;
while
(
i
<
globPattern
.
length
())
{
c
=
globPattern
.
charAt
(
i
++);
if
(
c
==
']'
)
{
break
;
}
if
(
c
==
'/'
||
(
isDos
&&
c
==
'\\'
))
{
throw
new
PatternSyntaxException
(
"Explicit 'name separator' in class"
,
globPattern
,
i
-
1
);
}
// TBD: how to specify ']' in a class?
if
(
c
==
'\\'
||
c
==
'['
||
c
==
'&'
&&
next
(
globPattern
,
i
)
==
'&'
)
{
// escape '\', '[' or "&&" for regex class
regex
.
append
(
'\\'
);
}
regex
.
append
(
c
);
if
(
c
==
'-'
)
{
if
(!
hasRangeStart
)
{
throw
new
PatternSyntaxException
(
"Invalid range"
,
globPattern
,
i
-
1
);
}
if
((
c
=
next
(
globPattern
,
i
++))
==
EOL
||
c
==
']'
)
{
break
;
}
if
(
c
<
last
)
{
throw
new
PatternSyntaxException
(
"Invalid range"
,
globPattern
,
i
-
3
);
}
regex
.
append
(
c
);
hasRangeStart
=
false
;
}
else
{
hasRangeStart
=
true
;
last
=
c
;
}
}
if
(
c
!=
']'
)
{
throw
new
PatternSyntaxException
(
"Missing ']"
,
globPattern
,
i
-
1
);
}
regex
.
append
(
"]]"
);
break
;
case
'{'
:
if
(
inGroup
)
{
throw
new
PatternSyntaxException
(
"Cannot nest groups"
,
globPattern
,
i
-
1
);
}
regex
.
append
(
"(?:(?:"
);
inGroup
=
true
;
break
;
case
'}'
:
if
(
inGroup
)
{
regex
.
append
(
"))"
);
inGroup
=
false
;
}
else
{
regex
.
append
(
'}'
);
}
break
;
case
','
:
if
(
inGroup
)
{
regex
.
append
(
")|(?:"
);
}
else
{
regex
.
append
(
','
);
}
break
;
case
'*'
:
if
(
next
(
globPattern
,
i
)
==
'*'
)
{
// crosses directory boundaries
regex
.
append
(
".*"
);
i
++;
}
else
{
// within directory boundary
if
(
isDos
)
{
regex
.
append
(
"[^\\\\]*"
);
}
else
{
regex
.
append
(
"[^/]*"
);
}
}
break
;
case
'?'
:
if
(
isDos
)
{
regex
.
append
(
"[^\\\\]"
);
}
else
{
regex
.
append
(
"[^/]"
);
}
break
;
default
:
if
(
isRegexMeta
(
c
))
{
regex
.
append
(
'\\'
);
}
regex
.
append
(
c
);
}
}
if
(
inGroup
)
{
throw
new
PatternSyntaxException
(
"Missing '}"
,
globPattern
,
i
-
1
);
}
return
regex
.
append
(
'$'
).
toString
();
}
public
static
String
toUnixRegexPattern
(
String
globPattern
)
{
return
toRegexPattern
(
globPattern
,
false
);
}
public
static
String
toWindowsRegexPattern
(
String
globPattern
)
{
return
toRegexPattern
(
globPattern
,
true
);
}
}
ibzdict-util/src/main/java/cn/ibizlab/util/helper/RuleUtils.java
浏览文件 @
86286777
...
@@ -280,22 +280,26 @@ public class RuleUtils
...
@@ -280,22 +280,26 @@ public class RuleUtils
}
}
return
finalTime
.
getTime
()<
tm
.
getTime
();
return
finalTime
.
getTime
()<
tm
.
getTime
();
}
}
else
if
(
finalObject
instanceof
Integer
)
else
if
(
finalObject
instanceof
Integer
)
{
{
return
(((
Integer
)
finalObject
).
intValue
()
<
((
Integer
)
exp
).
intValue
());
return
Integer
.
parseInt
(
finalObject
.
toString
())
<
Integer
.
parseInt
(
exp
.
toString
());
}
}
else
if
(
finalObject
instanceof
Double
)
else
if
(
finalObject
instanceof
Double
)
{
{
return
(((
Double
)
finalObject
).
doubleValue
()
<
((
Double
)
exp
).
doubleValue
());
return
Double
.
parseDouble
(
finalObject
.
toString
())
<
Double
.
parseDouble
(
exp
.
toString
());
}
}
else
if
(
finalObject
instanceof
Float
)
else
if
(
finalObject
instanceof
Float
)
{
{
return
(((
Float
)
finalObject
).
floatValue
()
<
((
Float
)
exp
).
floatValue
());
return
Float
.
parseFloat
(
finalObject
.
toString
())
<
Float
.
parseFloat
(
exp
.
toString
());
}
}
else
if
(
finalObject
instanceof
String
)
else
if
(
finalObject
instanceof
String
)
{
{
return
finalObject
.
toString
().
compareToIgnoreCase
(
exp
.
toString
())<
0
;
return
finalObject
.
toString
().
compareToIgnoreCase
(
exp
.
toString
())<
0
;
}
}
else
if
(
finalObject
instanceof
Long
)
{
return
Long
.
parseLong
(
finalObject
.
toString
())
<
Long
.
parseLong
(
exp
.
toString
());
}
else
else
return
false
;
return
false
;
}
}
...
...
ibzdict-util/src/main/java/cn/ibizlab/util/rest/AppController.java
浏览文件 @
86286777
...
@@ -12,6 +12,7 @@ import org.springframework.http.ResponseEntity;
...
@@ -12,6 +12,7 @@ import org.springframework.http.ResponseEntity;
import
org.springframework.security.core.GrantedAuthority
;
import
org.springframework.security.core.GrantedAuthority
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
com.baomidou.mybatisplus.core.toolkit.IdWorker
;
import
java.util.*
;
import
java.util.*
;
@RestController
@RestController
...
@@ -95,6 +96,26 @@ public class AppController {
...
@@ -95,6 +96,26 @@ public class AppController {
return
ResponseEntity
.
ok
(
ibzConfigService
.
getConfig
(
configType
,
targetType
,
userId
));
return
ResponseEntity
.
ok
(
ibzConfigService
.
getConfig
(
configType
,
targetType
,
userId
));
}
}
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/configs/share/{id}"
)
public
ResponseEntity
<
JSONObject
>
getShareConfig
(
@PathVariable
(
"id"
)
String
id
)
{
JSONObject
jo
=
ibzConfigService
.
getShareConfig
(
id
);
if
(
jo
==
null
)
{
throw
new
BadRequestAlertException
(
"无效的共享配置数据"
,
"IBZConfig"
,
id
);
}
return
ResponseEntity
.
ok
(
jo
);
}
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/configs/share/{configType}/{targetType}"
)
public
ResponseEntity
<
String
>
shareConfig
(
@PathVariable
(
"configType"
)
String
configType
,
@PathVariable
(
"targetType"
)
String
targetType
)
{
String
userId
=
AuthenticationUser
.
getAuthenticationUser
().
getUserid
();
if
(
StringUtils
.
isEmpty
(
userId
))
{
throw
new
BadRequestAlertException
(
"分享配置失败,参数缺失"
,
"IBZConfig"
,
configType
);
}
String
id
=
IdWorker
.
get32UUID
();
ibzConfigService
.
saveShareConfig
(
id
,
configType
,
targetType
,
userId
);
return
ResponseEntity
.
ok
(
id
);
}
/**
/**
* 应用参数扩展
* 应用参数扩展
* @param appData
* @param appData
...
...
ibzdict-util/src/main/java/cn/ibizlab/util/security/AuthenticationInfo.java
浏览文件 @
86286777
...
@@ -9,6 +9,10 @@ import java.io.Serializable;
...
@@ -9,6 +9,10 @@ import java.io.Serializable;
@AllArgsConstructor
@AllArgsConstructor
@JsonIgnoreProperties
(
ignoreUnknown
=
true
)
@JsonIgnoreProperties
(
ignoreUnknown
=
true
)
public
class
AuthenticationInfo
implements
Serializable
{
public
class
AuthenticationInfo
implements
Serializable
{
private
final
String
token
;
private
String
token
;
private
final
AuthenticationUser
user
;
private
AuthenticationUser
user
;
public
AuthenticationInfo
()
{
}
}
}
ibzdict-util/src/main/java/cn/ibizlab/util/security/AuthenticationUser.java
浏览文件 @
86286777
...
@@ -260,7 +260,6 @@ public class AuthenticationUser implements UserDetails
...
@@ -260,7 +260,6 @@ public class AuthenticationUser implements UserDetails
{
{
sessionParams
=
getUserSessionParam
();
sessionParams
=
getUserSessionParam
();
sessionParams
.
put
(
"srfsystemid"
,
this
.
getSrfsystemid
());
sessionParams
.
put
(
"srfsystemid"
,
this
.
getSrfsystemid
());
sessionParams
.
put
(
"srfdynainstid"
,
this
.
getSrfdynainstid
());
sessionParams
.
put
(
"srfpersonid"
,
this
.
getUserid
());
sessionParams
.
put
(
"srfpersonid"
,
this
.
getUserid
());
sessionParams
.
put
(
"srfpersonname"
,
this
.
getPersonname
());
sessionParams
.
put
(
"srfpersonname"
,
this
.
getPersonname
());
sessionParams
.
put
(
"srforgsectorid"
,
this
.
getMdeptid
());
sessionParams
.
put
(
"srforgsectorid"
,
this
.
getMdeptid
());
...
...
ibzdict-util/src/main/java/cn/ibizlab/util/service/AuthenticationUserService.java
浏览文件 @
86286777
...
@@ -24,7 +24,7 @@ public interface AuthenticationUserService extends UserDetailsService {
...
@@ -24,7 +24,7 @@ public interface AuthenticationUserService extends UserDetailsService {
@Cacheable
(
value
=
"ibzuaa_users"
,
key
=
"'getByUsername:'+#p0"
)
@Cacheable
(
value
=
"ibzuaa_users"
,
key
=
"'getByUsername:'+#p0"
)
AuthenticationUser
loadUserByLogin
(
String
username
,
String
password
);
AuthenticationUser
loadUserByLogin
(
String
username
,
String
password
);
@CacheEvict
(
value
=
"ibzuaa_users"
,
key
=
"'getByUsername:'+#p0"
)
@CacheEvict
(
value
=
"ibzuaa_users"
,
key
=
"'g
lob:*g
etByUsername:'+#p0"
)
default
void
resetByUsername
(
String
username
){}
default
void
resetByUsername
(
String
username
){}
...
...
ibzdict-util/src/main/java/cn/ibizlab/util/service/IBZConfigService.java
浏览文件 @
86286777
...
@@ -64,4 +64,14 @@ public class IBZConfigService extends ServiceImpl<IBZConfigMapper, IBZConfig> im
...
@@ -64,4 +64,14 @@ public class IBZConfigService extends ServiceImpl<IBZConfigMapper, IBZConfig> im
this
.
remove
(
Wrappers
.
query
(
IBZConfig
.
builder
().
systemId
(
systemId
).
cfgType
(
cfgType
).
targetType
(
targetType
).
userId
(
userId
).
build
()));
this
.
remove
(
Wrappers
.
query
(
IBZConfig
.
builder
().
systemId
(
systemId
).
cfgType
(
cfgType
).
targetType
(
targetType
).
userId
(
userId
).
build
()));
}
}
@Cacheable
(
value
=
"ibzrt_shareconfigs"
,
key
=
"'cfgid:'+#p0"
)
public
JSONObject
saveShareConfig
(
String
id
,
String
cfgType
,
String
targetType
,
String
userId
){
return
this
.
getConfig
(
cfgType
,
targetType
,
userId
);
}
@Cacheable
(
value
=
"ibzrt_shareconfigs"
,
key
=
"'cfgid:'+#p0"
)
public
JSONObject
getShareConfig
(
String
id
){
return
null
;
}
}
}
\ No newline at end of file
ibzdict-util/src/main/java/cn/ibizlab/util/web/SearchContextHandlerMethodArgumentResolver.java
浏览文件 @
86286777
package
cn
.
ibizlab
.
util
.
web
;
package
cn
.
ibizlab
.
util
.
web
;
import
cn.ibizlab.util.filter.SearchContextBase
;
import
cn.ibizlab.util.filter.SearchContextBase
;
import
cn.ibizlab.util.domain.DTOBase
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.core.MethodParameter
;
import
org.springframework.core.MethodParameter
;
...
@@ -24,7 +25,7 @@ public class SearchContextHandlerMethodArgumentResolver implements HandlerMethod
...
@@ -24,7 +25,7 @@ public class SearchContextHandlerMethodArgumentResolver implements HandlerMethod
@Override
@Override
public
boolean
supportsParameter
(
MethodParameter
parameter
)
{
public
boolean
supportsParameter
(
MethodParameter
parameter
)
{
return
SearchContextBase
.
class
.
isAssignableFrom
(
parameter
.
getParameterType
());
return
SearchContextBase
.
class
.
isAssignableFrom
(
parameter
.
getParameterType
())
||
DTOBase
.
class
.
isAssignableFrom
(
parameter
.
getParameterType
())
;
}
}
@Override
@Override
...
@@ -35,7 +36,7 @@ public class SearchContextHandlerMethodArgumentResolver implements HandlerMethod
...
@@ -35,7 +36,7 @@ public class SearchContextHandlerMethodArgumentResolver implements HandlerMethod
for
(
String
key
:
params
.
keySet
())
{
for
(
String
key
:
params
.
keySet
())
{
set
.
put
(
key
,
params
.
get
(
key
)[
0
]);
set
.
put
(
key
,
params
.
get
(
key
)[
0
]);
}
}
if
(
(!
set
.
containsKey
(
"size"
))
){
if
(
SearchContextBase
.
class
.
isAssignableFrom
(
parameter
.
getParameterType
())
&&
(!
set
.
containsKey
(
"size"
))
){
set
.
put
(
"size"
,
pageLimit
);
set
.
put
(
"size"
,
pageLimit
);
}
}
String
json
=
objectMapper
.
writeValueAsString
(
set
);
String
json
=
objectMapper
.
writeValueAsString
(
set
);
...
...
ibzdict-util/src/main/resources/application-sys.yml
浏览文件 @
86286777
...
@@ -23,7 +23,7 @@ spring:
...
@@ -23,7 +23,7 @@ spring:
datasource
:
datasource
:
username
:
a_A_5d9d78509
username
:
a_A_5d9d78509
password
:
'
@6dEfb3@'
password
:
'
@6dEfb3@'
url
:
jdbc:mysql://172.16.180.232:3306/a_A_5d9d78509?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true&allowMultiQueries=true
url
:
jdbc:mysql://172.16.180.232:3306/a_A_5d9d78509?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true&allowMultiQueries=true
&serverTimezone=GMT%2B8
driver-class-name
:
com.mysql.jdbc.Driver
driver-class-name
:
com.mysql.jdbc.Driver
filters
:
stat,wall,log4j2
filters
:
stat,wall,log4j2
#配置初始化大小/最小/最大
#配置初始化大小/最小/最大
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录