Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzou
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzou
提交
a31915b3
提交
a31915b3
编写于
5月 09, 2020
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ibizdev提交
上级
c8011d91
变更
65
隐藏空白字符变更
内嵌
并排
正在显示
65 个修改的文件
包含
2242 行增加
和
578 行删除
+2242
-578
app-mpicker.vue
app_web/src/components/app-mpicker/app-mpicker.vue
+43
-6
app-rich-text-editor.vue
.../components/app-rich-text-editor/app-rich-text-editor.vue
+140
-68
app-span.vue
app_web/src/components/app-span/app-span.vue
+5
-0
ibzdepartment-edit-view-base.vue
.../ibzdepartment-edit-view/ibzdepartment-edit-view-base.vue
+5
-5
ibzdepartment-grid-view-base.vue
.../ibzdepartment-grid-view/ibzdepartment-grid-view-base.vue
+6
-6
ibzdepartment-pickup-grid-view-base.vue
...-pickup-grid-view/ibzdepartment-pickup-grid-view-base.vue
+4
-4
ibzdepartment-pickup-view-base.vue
...department-pickup-view/ibzdepartment-pickup-view-base.vue
+5
-5
ibzemployee-change-pwd-view-base.vue
...oyee-change-pwd-view/ibzemployee-change-pwd-view-base.vue
+4
-4
ibzemployee-edit-view-base.vue
...s/ou/ibzemployee-edit-view/ibzemployee-edit-view-base.vue
+5
-5
ibzemployee-grid-view-base.vue
...s/ou/ibzemployee-grid-view/ibzemployee-grid-view-base.vue
+6
-6
ibzorganization-edit-view-base.vue
...organization-edit-view/ibzorganization-edit-view-base.vue
+5
-5
ibzorganization-grid-view-base.vue
...organization-grid-view/ibzorganization-grid-view-base.vue
+6
-6
ibzorganization-option-view-base.vue
...nization-option-view/ibzorganization-option-view-base.vue
+4
-4
ibzorganization-pickup-grid-view-base.vue
...ickup-grid-view/ibzorganization-pickup-grid-view-base.vue
+4
-4
ibzorganization-pickup-view-base.vue
...nization-pickup-view/ibzorganization-pickup-view-base.vue
+5
-5
ouindex-view-base.vue
app_web/src/pages/ou/ouindex-view/ouindex-view-base.vue
+4
-4
entity-service.ts
app_web/src/service/entity-service.ts
+6
-6
http.ts
app_web/src/utils/http/http.ts
+1
-1
default-searchform-base.vue
...department/default-searchform/default-searchform-base.vue
+2
-2
default-searchform.less
.../ibzdepartment/default-searchform/default-searchform.less
+3
-0
main-form-base.vue
...eb/src/widgets/ibzdepartment/main-form/main-form-base.vue
+1
-1
main-grid-base.vue
...eb/src/widgets/ibzdepartment/main-grid/main-grid-base.vue
+1
-1
default-searchform-base.vue
...bzemployee/default-searchform/default-searchform-base.vue
+2
-2
default-searchform.less
...ts/ibzemployee/default-searchform/default-searchform.less
+3
-0
main-form-base.vue
app_web/src/widgets/ibzemployee/main-form/main-form-base.vue
+1
-1
main-grid-base.vue
app_web/src/widgets/ibzemployee/main-grid/main-grid-base.vue
+1
-1
default-searchform-base.vue
...ganization/default-searchform/default-searchform-base.vue
+2
-2
default-searchform.less
...bzorganization/default-searchform/default-searchform.less
+3
-0
main-form-base.vue
.../src/widgets/ibzorganization/main-form/main-form-base.vue
+1
-1
main-grid-base.vue
.../src/widgets/ibzorganization/main-grid/main-grid-base.vue
+1
-1
config.xml
config.xml
+0
-6
Dockerfile
ibzou-app/ibzou-app-web/src/main/docker/Dockerfile
+1
-1
ibzou-app-web.yaml
ibzou-app/ibzou-app-web/src/main/docker/ibzou-app-web.yaml
+1
-3
application-web-dev.yml
.../ibzou-app-web/src/main/resources/application-web-dev.yml
+1
-1
application-web-prod.yml
...ibzou-app-web/src/main/resources/application-web-prod.yml
+1
-1
IBZDepartment.java
...rc/main/java/cn/ibizlab/core/ou/domain/IBZDepartment.java
+1
-0
IBZOrganization.java
.../main/java/cn/ibizlab/core/ou/domain/IBZOrganization.java
+1
-0
DEPrivs.json
ibzou-core/src/main/resources/deprivs/DEPrivs.json
+2
-2
pom.xml
ibzou-provider/ibzou-provider-api/pom.xml
+0
-10
apiSecurityConfig.java
...rc/main/java/cn/ibizlab/api/config/apiSecurityConfig.java
+4
-1
IBZDepartmentResource.java
.../main/java/cn/ibizlab/api/rest/IBZDepartmentResource.java
+25
-25
IBZEmployeeResource.java
...rc/main/java/cn/ibizlab/api/rest/IBZEmployeeResource.java
+58
-58
IBZOrganizationResource.java
...ain/java/cn/ibizlab/api/rest/IBZOrganizationResource.java
+7
-7
SwaggerConfiguration.java
...rc/main/java/cn/ibizlab/swagger/SwaggerConfiguration.java
+91
-0
pom.xml
ibzou-util/pom.xml
+10
-0
DEField.java
...til/src/main/java/cn/ibizlab/util/annotation/DEField.java
+5
-0
DEFieldDefaultValueAspect.java
...ava/cn/ibizlab/util/aspect/DEFieldDefaultValueAspect.java
+118
-218
CaffeineCacheConfig.java
.../main/java/cn/ibizlab/util/cache/CaffeineCacheConfig.java
+40
-0
RedisCacheConfig.java
...src/main/java/cn/ibizlab/util/cache/RedisCacheConfig.java
+121
-0
CusRedisCache.java
.../main/java/cn/ibizlab/util/cache/cache/CusRedisCache.java
+16
-0
LayeringCache.java
.../main/java/cn/ibizlab/util/cache/cache/LayeringCache.java
+169
-0
CaffeineCacheManager.java
...ibizlab/util/cache/cacheManager/CaffeineCacheManager.java
+99
-0
LayeringCacheManager.java
...ibizlab/util/cache/cacheManager/LayeringCacheManager.java
+96
-0
RedisMessageListener.java
.../cn/ibizlab/util/cache/listener/RedisMessageListener.java
+7
-4
EntityBase.java
...util/src/main/java/cn/ibizlab/util/domain/EntityBase.java
+13
-13
QueryWrapperContext.java
...main/java/cn/ibizlab/util/filter/QueryWrapperContext.java
+7
-2
DEFieldCacheMap.java
...src/main/java/cn/ibizlab/util/helper/DEFieldCacheMap.java
+142
-56
DataObject.java
...util/src/main/java/cn/ibizlab/util/helper/DataObject.java
+594
-0
PermissionSyncJob.java
.../src/main/java/cn/ibizlab/util/job/PermissionSyncJob.java
+1
-1
AppController.java
...til/src/main/java/cn/ibizlab/util/rest/AppController.java
+10
-6
AuthPermissionEvaluator.java
...ava/cn/ibizlab/util/security/AuthPermissionEvaluator.java
+5
-5
AuthenticationUser.java
...ain/java/cn/ibizlab/util/security/AuthenticationUser.java
+1
-1
RemoteService.java
.../src/main/java/cn/ibizlab/util/service/RemoteService.java
+165
-0
IBZOperationParameterReader.java
...java/cn/ibizlab/util/web/IBZOperationParameterReader.java
+148
-0
application-sys.yml
ibzou-util/src/main/resources/application-sys.yml
+3
-1
未找到文件。
app_web/src/components/app-mpicker/app-mpicker.vue
浏览文件 @
a31915b3
...
@@ -123,12 +123,12 @@ export default class AppMpicker extends Vue {
...
@@ -123,12 +123,12 @@ export default class AppMpicker extends Vue {
* @param newVal
* @param newVal
* @param val
* @param val
*/
*/
@
Watch
(
'curvalue'
,
{
deep
:
true
})
@
Watch
(
'curvalue'
,
{
immediate
:
true
,
deep
:
true
})
oncurvalueChange
(
newVal
:
any
,
val
:
any
)
{
oncurvalueChange
(
newVal
:
any
,
val
:
any
)
{
this
.
value
=
[];
this
.
value
=
[];
this
.
selectItems
=
[];
this
.
selectItems
=
[];
if
(
newVal
)
{
if
(
newVal
)
{
this
.
selectItems
=
JSON
.
parse
(
newVal
);
this
.
selectItems
=
this
.
parseValue
(
JSON
.
parse
(
newVal
)
);
this
.
selectItems
.
forEach
((
item
:
any
)
=>
{
this
.
selectItems
.
forEach
((
item
:
any
)
=>
{
this
.
value
.
push
(
item
[
this
.
deKeyField
]);
this
.
value
.
push
(
item
[
this
.
deKeyField
]);
let
index
=
this
.
items
.
findIndex
((
i
)
=>
Object
.
is
(
i
[
this
.
deKeyField
],
item
[
this
.
deKeyField
]));
let
index
=
this
.
items
.
findIndex
((
i
)
=>
Object
.
is
(
i
[
this
.
deKeyField
],
item
[
this
.
deKeyField
]));
...
@@ -187,7 +187,7 @@ export default class AppMpicker extends Vue {
...
@@ -187,7 +187,7 @@ export default class AppMpicker extends Vue {
let
index
=
this
.
items
.
findIndex
((
item
)
=>
Object
.
is
(
item
[
this
.
deKeyField
],
select
));
let
index
=
this
.
items
.
findIndex
((
item
)
=>
Object
.
is
(
item
[
this
.
deKeyField
],
select
));
if
(
index
>=
0
)
{
if
(
index
>=
0
)
{
let
item
=
this
.
items
[
index
];
let
item
=
this
.
items
[
index
];
val
.
push
({
[
this
.
deKeyField
]:
item
[
this
.
deKeyField
],
[
this
.
deMajorField
]:
item
.
text
});
val
.
push
({
[
this
.
deKeyField
]:
item
[
this
.
deKeyField
],
[
this
.
deMajorField
]:
item
[
this
.
deMajorField
]
});
}
else
{
}
else
{
index
=
this
.
selectItems
.
findIndex
((
item
:
any
)
=>
Object
.
is
(
item
[
this
.
deKeyField
],
select
));
index
=
this
.
selectItems
.
findIndex
((
item
:
any
)
=>
Object
.
is
(
item
[
this
.
deKeyField
],
select
));
if
(
index
>=
0
)
{
if
(
index
>=
0
)
{
...
@@ -196,7 +196,7 @@ export default class AppMpicker extends Vue {
...
@@ -196,7 +196,7 @@ export default class AppMpicker extends Vue {
}
}
}
}
});
});
let
value
=
val
.
length
>
0
?
JSON
.
stringify
(
val
)
:
''
;
let
value
=
val
.
length
>
0
?
JSON
.
stringify
(
this
.
formatValue
(
val
)
)
:
''
;
this
.
$emit
(
'formitemvaluechange'
,
{
name
:
this
.
name
,
value
:
value
});
this
.
$emit
(
'formitemvaluechange'
,
{
name
:
this
.
name
,
value
:
value
});
}
}
}
}
...
@@ -211,7 +211,7 @@ export default class AppMpicker extends Vue {
...
@@ -211,7 +211,7 @@ export default class AppMpicker extends Vue {
let
index
=
this
.
selectItems
.
findIndex
((
item
:
any
)
=>
Object
.
is
(
item
[
this
.
deKeyField
],
tag
));
let
index
=
this
.
selectItems
.
findIndex
((
item
:
any
)
=>
Object
.
is
(
item
[
this
.
deKeyField
],
tag
));
if
(
index
>=
0
)
{
if
(
index
>=
0
)
{
this
.
selectItems
.
splice
(
index
,
1
);
this
.
selectItems
.
splice
(
index
,
1
);
let
value
=
this
.
selectItems
.
length
>
0
?
JSON
.
stringify
(
this
.
selectItems
)
:
''
;
let
value
=
this
.
selectItems
.
length
>
0
?
JSON
.
stringify
(
this
.
formatValue
(
this
.
selectItems
)
)
:
''
;
this
.
$emit
(
'formitemvaluechange'
,
{
name
:
this
.
name
,
value
:
value
});
this
.
$emit
(
'formitemvaluechange'
,
{
name
:
this
.
name
,
value
:
value
});
}
}
}
}
...
@@ -256,13 +256,50 @@ export default class AppMpicker extends Vue {
...
@@ -256,13 +256,50 @@ export default class AppMpicker extends Vue {
});
});
}
}
if
(
this
.
name
&&
this
.
activeData
)
{
if
(
this
.
name
&&
this
.
activeData
)
{
let
value
=
selects
.
length
>
0
?
JSON
.
stringify
(
selects
)
:
''
;
let
value
=
selects
.
length
>
0
?
JSON
.
stringify
(
this
.
formatValue
(
selects
)
)
:
''
;
this
.
$emit
(
'formitemvaluechange'
,
{
name
:
this
.
name
,
value
:
value
});
this
.
$emit
(
'formitemvaluechange'
,
{
name
:
this
.
name
,
value
:
value
});
}
}
})
})
}
}
}
}
/**
* 解析值,把srfkey和srfmajortext解析成实体属性名
*
* @param {any[]} value 需要转换的数组
* @memberof AppMpicker
*/
public
parseValue
(
value
:
any
[]){
let
result
=
[];
if
(
this
.
deKeyField
!==
"srfkey"
||
this
.
deMajorField
!==
"srfmajortext"
){
value
.
forEach
((
item
:
any
)
=>
{
result
.
push
({[
this
.
deMajorField
]:
item
.
srfmajortext
,
[
this
.
deKeyField
]:
item
.
srfkey
});
});
}
else
{
result
=
value
;
}
return
result
;
}
/**
* 格式化值,把实体属性名格式化成srfkey和srfmajortext
*
* @param {any[]} value 需要转换的数组
* @memberof AppMpicker
*/
public
formatValue
(
value
:
any
[]){
let
result
=
[];
if
(
this
.
deKeyField
!==
"srfkey"
||
this
.
deMajorField
!==
"srfmajortext"
){
value
.
forEach
((
item
:
any
)
=>
{
result
.
push
({
srfmajortext
:
item
[
this
.
deMajorField
],
srfkey
:
item
[
this
.
deKeyField
]});
});
}
else
{
result
=
value
;
}
return
result
;
}
}
}
</
script
>
</
script
>
<
style
lang=
"less"
>
<
style
lang=
"less"
>
...
...
app_web/src/components/app-rich-text-editor/app-rich-text-editor.vue
浏览文件 @
a31915b3
...
@@ -26,94 +26,112 @@ const tinymceCode:any = tinymce;
...
@@ -26,94 +26,112 @@ const tinymceCode:any = tinymce;
@
Component
({})
@
Component
({})
export
default
class
AppRichTextEditor
extends
Vue
{
export
default
class
AppRichTextEditor
extends
Vue
{
/**
/**
* 传入值
* 传入值
*
* @type {*}
* @memberof AppRichTextEditor
*/
*/
@
Prop
()
value
?:
any
;
@
Prop
()
value
?:
any
;
/**
* 监听value值
*/
@
Watch
(
'value'
,
{
immediate
:
true
,
deep
:
true
})
oncurrentContent
(
newval
:
any
,
val
:
any
)
{
if
(
newval
)
{
if
(
this
.
editor
){
tinymceCode
.
remove
(
'#'
+
this
.
id
);
}
this
.
init
(
newval
);
}
}
/**
/**
* 输入name
* 输入name
*
* @type {string}
* @memberof AppRichTextEditor
*/
*/
@
Prop
()
name
?:
string
;
@
Prop
()
name
?:
string
;
/**
/**
* 输入高度
* 输入高度
*
* @type {*}
* @memberof AppRichTextEditor
*/
*/
@
Prop
()
height
?:
any
;
@
Prop
()
height
?:
any
;
/**
/**
* 是否禁用
* 是否禁用
*
* @type {boolean}
* @memberof AppRichTextEditor
*/
*/
@
Prop
()
disabled
?:
any
;
@
Prop
()
disabled
?:
boolean
;
/**
* 当前语言,默认中文
*/
public
langu
:
any
=
localStorage
.
getItem
(
'local'
)
?
localStorage
.
getItem
(
'local'
)
:
'zh_CN'
;
/**
/**
* 监听语言变化
* 表单状态
*/
*
@
Watch
(
'$i18n.locale'
)
* @type {Subject<any>}
onLocaleChange
(
newval
:
any
,
val
:
any
)
{
* @memberof AppRichTextEditor
console
.
log
(
"语言变更"
+
newval
)
this
.
langu
=
newval
;
if
(
this
.
editor
){
tinymceCode
.
remove
(
'#'
+
this
.
id
);
}
this
.
init
(
''
);
}
/**
* 语言映射文件
*/
*/
public
languMap
:
any
=
{
@
Prop
()
public
formState
?:
Subject
<
any
>
;
'zh-CN'
:
'zh_CN'
,
'en-US'
:
'en_US'
,
};
/**
/**
* 上传文件路径
* 上传文件路径
*
* @type {string}
* @memberof AppRichTextEditor
*/
*/
public
uploadUrl
=
Environment
.
BaseUrl
+
Environment
.
UploadFile
;
public
uploadUrl
=
Environment
.
BaseUrl
+
Environment
.
UploadFile
;
/**
/**
* 下载路径
* 下载路径
*
* @type {string}
* @memberof AppRichTextEditor
*/
*/
public
downloadUrl
=
Environment
.
BaseUrl
+
Environment
.
ExportFile
;
public
downloadUrl
=
Environment
.
BaseUrl
+
Environment
.
ExportFile
;
/**
/**
* 当前富文本
* 当前富文本
*
* @type {*}
* @memberof AppRichTextEditor
*/
*/
public
editor
:
any
=
null
;
public
editor
:
any
=
null
;
/**
/**
* 当前富文本id
* 当前富文本id
*
* @type {string}
* @memberof AppRichTextEditor
*/
*/
id
:
string
=
this
.
$util
.
createUUID
();
public
id
:
string
=
this
.
$util
.
createUUID
();
/**
/**
*
表单状态
*
当前语言,默认中文
*
*
* @type {
Subject<any>
}
* @type {
*
}
* @memberof AppRichTextEditor
* @memberof AppRichTextEditor
*/
*/
@
Prop
()
public
formState
?:
Subject
<
any
>
;
public
langu
:
any
=
localStorage
.
getItem
(
'local'
)
?
localStorage
.
getItem
(
'local'
)
:
'zh_CN'
;
/**
* 语言映射文件
*
* @type {*}
* @memberof AppRichTextEditor
*/
public
languMap
:
any
=
{
'zh-CN'
:
'zh_CN'
,
'en-US'
:
'en_US'
,
};
/**
* 是否处于激活状态
*
* @type {boolean}
* @memberof AppRichTextEditor
*/
public
isActived
:
boolean
=
true
;
/**
* 是否需要初始化
*
* @type {boolean}
* @memberof AppRichTextEditor
*/
public
isNeedInit
:
boolean
=
false
;
/**
/**
* 生命周期
* 生命周期
...
@@ -125,40 +143,92 @@ export default class AppRichTextEditor extends Vue {
...
@@ -125,40 +143,92 @@ export default class AppRichTextEditor extends Vue {
this
.
formState
.
subscribe
(({
type
,
data
})
=>
{
this
.
formState
.
subscribe
(({
type
,
data
})
=>
{
if
(
Object
.
is
(
'load'
,
type
))
{
if
(
Object
.
is
(
'load'
,
type
))
{
if
(
!
this
.
value
)
{
if
(
!
this
.
value
)
{
if
(
this
.
editor
){
this
.
init
();
tinymceCode
.
remove
(
'#'
+
this
.
id
);
}
this
.
init
(
this
.
value
);
}
}
}
}
});
});
}
}
}
}
/**
* 生命周期:激活
*
* @memberof AppRichTextEditor
*/
public
activated
(){
this
.
isActived
=
true
;
if
(
this
.
isNeedInit
){
this
.
init
();
this
.
isNeedInit
=
false
;
}
}
/**
/**
* 初始化富文本
* 生命周期:缓存
*
* @memberof AppRichTextEditor
*/
public
deactivated
(){
this
.
isActived
=
false
;
}
/**
* 生命周期:初始化富文本
*
* @memberof AppRichTextEditor
*/
*/
public
mounted
()
{
public
mounted
()
{
this
.
init
(
''
);
this
.
init
();
}
}
/**
/**
* 销毁富文本
* 生命周期:销毁富文本
*
* @memberof AppRichTextEditor
*/
*/
public
destoryed
(){
public
destoryed
(){
tinymceCode
.
remove
(
this
.
editor
);
if
(
this
.
editor
){
tinymceCode
.
remove
(
'#'
+
this
.
id
);
}
}
/**
* 监听value值
*
* @memberof AppRichTextEditor
*/
@
Watch
(
'value'
,
{
immediate
:
true
,
deep
:
true
})
oncurrentContent
(
newval
:
any
,
val
:
any
)
{
if
(
newval
)
{
this
.
init
();
}
}
/**
* 监听语言变化
*/
@
Watch
(
'$i18n.locale'
)
onLocaleChange
(
newval
:
any
,
val
:
any
)
{
this
.
langu
=
newval
;
if
(
this
.
isActived
){
this
.
init
();
}
else
{
this
.
isNeedInit
=
true
;
}
}
}
/**
/**
* 初始化富文本
* 初始化富文本
* @param val
*
* @memberof AppRichTextEditor
*/
*/
public
init
(
val
:
any
)
{
public
init
()
{
this
.
destoryed
();
let
richtexteditor
=
this
;
let
richtexteditor
=
this
;
tinymceCode
.
init
({
tinymceCode
.
init
({
selector
:
'#'
+
this
.
id
,
selector
:
'#'
+
richtexteditor
.
id
,
width
:
'calc( 100% - 2px )'
,
width
:
'calc( 100% - 2px )'
,
height
:
this
.
height
,
height
:
richtexteditor
.
height
,
min_height
:
400
,
min_height
:
400
,
branding
:
false
,
branding
:
false
,
plugins
:
[
'link'
,
'paste'
,
'table'
,
'image'
,
'codesample'
,
'code'
,
'fullscreen'
,
'preview'
],
plugins
:
[
'link'
,
'paste'
,
'table'
,
'image'
,
'codesample'
,
'code'
,
'fullscreen'
,
'preview'
],
...
@@ -177,13 +247,13 @@ export default class AppRichTextEditor extends Vue {
...
@@ -177,13 +247,13 @@ export default class AppRichTextEditor extends Vue {
paste_data_images
:
true
,
paste_data_images
:
true
,
codesample_content_css
:
'assets/tinymce/prism.css'
,
codesample_content_css
:
'assets/tinymce/prism.css'
,
skin_url
:
'./assets/tinymce/skins/lightgray'
,
skin_url
:
'./assets/tinymce/skins/lightgray'
,
language_url
:
'./assets/tinymce/langs/'
+
this
.
languMap
[
this
.
langu
]
+
'.js'
,
language_url
:
'./assets/tinymce/langs/'
+
richtexteditor
.
languMap
[
richtexteditor
.
langu
]
+
'.js'
,
language
:
this
.
languMap
[
this
.
langu
],
language
:
richtexteditor
.
languMap
[
richtexteditor
.
langu
],
setup
:
(
editor
:
any
)
=>
{
setup
:
(
editor
:
any
)
=>
{
this
.
editor
=
editor
;
richtexteditor
.
editor
=
editor
;
editor
.
on
(
'blur'
,
()
=>
{
editor
.
on
(
'blur'
,
()
=>
{
const
content
=
editor
.
getContent
();
const
content
=
editor
.
getContent
();
this
.
$emit
(
'change'
,
content
);
richtexteditor
.
$emit
(
'change'
,
content
);
});
});
},
},
images_upload_handler
:
(
bolbinfo
:
any
,
success
:
any
,
failure
:
any
)
=>
{
images_upload_handler
:
(
bolbinfo
:
any
,
success
:
any
,
failure
:
any
)
=>
{
...
@@ -202,13 +272,13 @@ export default class AppRichTextEditor extends Vue {
...
@@ -202,13 +272,13 @@ export default class AppRichTextEditor extends Vue {
});
});
},
},
init_instance_callback
:
(
editor
:
any
)
=>
{
init_instance_callback
:
(
editor
:
any
)
=>
{
this
.
editor
=
editor
;
richtexteditor
.
editor
=
editor
;
let
value
=
(
this
.
value
&&
this
.
value
.
length
>
0
)
?
this
.
value
:
''
;
let
value
=
(
richtexteditor
.
value
&&
richtexteditor
.
value
.
length
>
0
)
?
richtexteditor
.
value
:
''
;
if
(
this
.
editor
)
{
if
(
richtexteditor
.
editor
)
{
this
.
editor
.
setContent
(
value
);
richtexteditor
.
editor
.
setContent
(
value
);
}
}
if
(
this
.
disabled
)
{
if
(
richtexteditor
.
disabled
)
{
this
.
editor
.
setMode
(
'readonly'
);
richtexteditor
.
editor
.
setMode
(
'readonly'
);
}
}
}
}
});
});
...
@@ -216,8 +286,10 @@ export default class AppRichTextEditor extends Vue {
...
@@ -216,8 +286,10 @@ export default class AppRichTextEditor extends Vue {
/**
/**
* 上传文件
* 上传文件
* @param url
*
* @param formData
* @param url 路径
* @param formData 文件对象
* @memberof AppRichTextEditor
*/
*/
public
uploadFile
(
url
:
string
,
formData
:
any
)
{
public
uploadFile
(
url
:
string
,
formData
:
any
)
{
let
_this
=
this
;
let
_this
=
this
;
...
...
app_web/src/components/app-span/app-span.vue
浏览文件 @
a31915b3
...
@@ -108,6 +108,11 @@ export default class AppSpan extends Vue {
...
@@ -108,6 +108,11 @@ export default class AppSpan extends Vue {
public
load
(){
public
load
(){
if
(
!
this
.
value
||
this
.
tag
){
if
(
!
this
.
value
||
this
.
tag
){
return
;
//代码表走codelist组件
return
;
//代码表走codelist组件
}
else
if
(
this
.
editorType
===
"ADDRESSPICKUP"
){
JSON
.
parse
(
this
.
value
).
forEach
((
item
:
any
,
index
:
number
)
=>
{
this
.
text
+=
index
===
0
?
item
.
srfmajortext
:
","
+
item
.
srfmajortext
;
});
}
else
{
}
else
{
this
.
text
=
this
.
value
;
this
.
text
=
this
.
value
;
}
}
...
...
app_web/src/pages/ou/ibzdepartment-edit-view/ibzdepartment-edit-view-base.vue
浏览文件 @
a31915b3
...
@@ -396,17 +396,17 @@ export default class IBZDepartmentEditViewBase extends Vue {
...
@@ -396,17 +396,17 @@ export default class IBZDepartmentEditViewBase extends Vue {
}
}
}
else
{
}
else
{
// 先从导航上下文取数,没有再从导航参数(URL)取数,如果导航上下文和导航参数都没有则为null
// 先从导航上下文取数,没有再从导航参数(URL)取数,如果导航上下文和导航参数都没有则为null
if
(
this
.
context
[
curNavData
.
value
]){
if
(
this
.
context
[
(
curNavData
.
value
).
toLowerCase
()
]){
Object
.
defineProperty
(
tempData
,
item
,
{
Object
.
defineProperty
(
tempData
,
item
,
{
value
:
this
.
context
[
curNavData
.
value
],
value
:
this
.
context
[
(
curNavData
.
value
).
toLowerCase
()
],
writable
:
true
,
writable
:
true
,
enumerable
:
true
,
enumerable
:
true
,
configurable
:
true
configurable
:
true
});
});
}
else
{
}
else
{
if
(
this
.
viewparams
[
curNavData
.
value
]){
if
(
this
.
viewparams
[
(
curNavData
.
value
).
toLowerCase
()
]){
Object
.
defineProperty
(
tempData
,
item
,
{
Object
.
defineProperty
(
tempData
,
item
,
{
value
:
this
.
viewparams
[
curNavData
.
value
],
value
:
this
.
viewparams
[
(
curNavData
.
value
).
toLowerCase
()
],
writable
:
true
,
writable
:
true
,
enumerable
:
true
,
enumerable
:
true
,
configurable
:
true
configurable
:
true
...
@@ -814,7 +814,7 @@ export default class IBZDepartmentEditViewBase extends Vue {
...
@@ -814,7 +814,7 @@ export default class IBZDepartmentEditViewBase extends Vue {
if
(
args
.
length
>
0
)
{
if
(
args
.
length
>
0
)
{
Object
.
assign
(
data
,
{
srfsourcekey
:
args
[
0
].
srfkey
})
Object
.
assign
(
data
,
{
srfsourcekey
:
args
[
0
].
srfkey
})
}
}
_this
.
newdata
([{
...
data
}],
params
,
$event
,
xData
);
_this
.
newdata
([{
...
data
}],
[{
...
data
}],
params
,
$event
,
xData
);
}
else
if
(
xData
&&
xData
.
copy
instanceof
Function
)
{
}
else
if
(
xData
&&
xData
.
copy
instanceof
Function
)
{
const
data2
:
any
=
{};
const
data2
:
any
=
{};
if
(
args
.
length
>
0
)
{
if
(
args
.
length
>
0
)
{
...
...
app_web/src/pages/ou/ibzdepartment-grid-view/ibzdepartment-grid-view-base.vue
浏览文件 @
a31915b3
...
@@ -497,17 +497,17 @@ export default class IBZDepartmentGridViewBase extends Vue {
...
@@ -497,17 +497,17 @@ export default class IBZDepartmentGridViewBase extends Vue {
}
}
}
else
{
}
else
{
// 先从导航上下文取数,没有再从导航参数(URL)取数,如果导航上下文和导航参数都没有则为null
// 先从导航上下文取数,没有再从导航参数(URL)取数,如果导航上下文和导航参数都没有则为null
if
(
this
.
context
[
curNavData
.
value
]){
if
(
this
.
context
[
(
curNavData
.
value
).
toLowerCase
()
]){
Object
.
defineProperty
(
tempData
,
item
,
{
Object
.
defineProperty
(
tempData
,
item
,
{
value
:
this
.
context
[
curNavData
.
value
],
value
:
this
.
context
[
(
curNavData
.
value
).
toLowerCase
()
],
writable
:
true
,
writable
:
true
,
enumerable
:
true
,
enumerable
:
true
,
configurable
:
true
configurable
:
true
});
});
}
else
{
}
else
{
if
(
this
.
viewparams
[
curNavData
.
value
]){
if
(
this
.
viewparams
[
(
curNavData
.
value
).
toLowerCase
()
]){
Object
.
defineProperty
(
tempData
,
item
,
{
Object
.
defineProperty
(
tempData
,
item
,
{
value
:
this
.
viewparams
[
curNavData
.
value
],
value
:
this
.
viewparams
[
(
curNavData
.
value
).
toLowerCase
()
],
writable
:
true
,
writable
:
true
,
enumerable
:
true
,
enumerable
:
true
,
configurable
:
true
configurable
:
true
...
@@ -1189,7 +1189,7 @@ export default class IBZDepartmentGridViewBase extends Vue {
...
@@ -1189,7 +1189,7 @@ export default class IBZDepartmentGridViewBase extends Vue {
const
_this
:
any
=
this
;
const
_this
:
any
=
this
;
if
(
_this
.
newdata
&&
_this
.
newdata
instanceof
Function
)
{
if
(
_this
.
newdata
&&
_this
.
newdata
instanceof
Function
)
{
const
data
:
any
=
{};
const
data
:
any
=
{};
_this
.
newdata
([{
...
data
}],
params
,
$event
,
xData
);
_this
.
newdata
([{
...
data
}],
[{
...
data
}],
params
,
$event
,
xData
);
}
else
{
}
else
{
_this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'newdata 视图处理逻辑不存在,请添加!'
});
_this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'newdata 视图处理逻辑不存在,请添加!'
});
}
}
...
@@ -1267,7 +1267,7 @@ export default class IBZDepartmentGridViewBase extends Vue {
...
@@ -1267,7 +1267,7 @@ export default class IBZDepartmentGridViewBase extends Vue {
if
(
args
.
length
>
0
)
{
if
(
args
.
length
>
0
)
{
Object
.
assign
(
data
,
{
srfsourcekey
:
args
[
0
].
srfkey
})
Object
.
assign
(
data
,
{
srfsourcekey
:
args
[
0
].
srfkey
})
}
}
_this
.
newdata
([{
...
data
}],
params
,
$event
,
xData
);
_this
.
newdata
([{
...
data
}],
[{
...
data
}],
params
,
$event
,
xData
);
}
else
if
(
xData
&&
xData
.
copy
instanceof
Function
)
{
}
else
if
(
xData
&&
xData
.
copy
instanceof
Function
)
{
const
data2
:
any
=
{};
const
data2
:
any
=
{};
if
(
args
.
length
>
0
)
{
if
(
args
.
length
>
0
)
{
...
...
app_web/src/pages/ou/ibzdepartment-pickup-grid-view/ibzdepartment-pickup-grid-view-base.vue
浏览文件 @
a31915b3
...
@@ -356,17 +356,17 @@ export default class IBZDepartmentPickupGridViewBase extends Vue {
...
@@ -356,17 +356,17 @@ export default class IBZDepartmentPickupGridViewBase extends Vue {
}
}
}
else
{
}
else
{
// 先从导航上下文取数,没有再从导航参数(URL)取数,如果导航上下文和导航参数都没有则为null
// 先从导航上下文取数,没有再从导航参数(URL)取数,如果导航上下文和导航参数都没有则为null
if
(
this
.
context
[
curNavData
.
value
]){
if
(
this
.
context
[
(
curNavData
.
value
).
toLowerCase
()
]){
Object
.
defineProperty
(
tempData
,
item
,
{
Object
.
defineProperty
(
tempData
,
item
,
{
value
:
this
.
context
[
curNavData
.
value
],
value
:
this
.
context
[
(
curNavData
.
value
).
toLowerCase
()
],
writable
:
true
,
writable
:
true
,
enumerable
:
true
,
enumerable
:
true
,
configurable
:
true
configurable
:
true
});
});
}
else
{
}
else
{
if
(
this
.
viewparams
[
curNavData
.
value
]){
if
(
this
.
viewparams
[
(
curNavData
.
value
).
toLowerCase
()
]){
Object
.
defineProperty
(
tempData
,
item
,
{
Object
.
defineProperty
(
tempData
,
item
,
{
value
:
this
.
viewparams
[
curNavData
.
value
],
value
:
this
.
viewparams
[
(
curNavData
.
value
).
toLowerCase
()
],
writable
:
true
,
writable
:
true
,
enumerable
:
true
,
enumerable
:
true
,
configurable
:
true
configurable
:
true
...
...
app_web/src/pages/ou/ibzdepartment-pickup-view/ibzdepartment-pickup-view-base.vue
浏览文件 @
a31915b3
<
template
>
<
template
>
<div
class=
"view-container depickupview ibzdepartment-pickup-view"
>
<div
class=
"view-container depickupview ibzdepartment-pickup-view"
>
<app-studioaction
:viewTitle=
"$t(model.srfTitle)"
viewName=
"ibzdepartmentpickupview"
></app-studioaction>
<app-studioaction
:viewTitle=
"$t(model.srfTitle)"
viewName=
"ibzdepartmentpickupview"
></app-studioaction>
<card
class=
'view-card'
:dis-hover=
"true"
:padding=
"0"
:bordered=
"false"
>
<card
class=
'view-card
view-no-caption
'
:dis-hover=
"true"
:padding=
"0"
:bordered=
"false"
>
<div
class=
"content-container pickup-view"
>
<div
class=
"content-container pickup-view"
>
<view
_pickupviewpanel
<view
_pickupviewpanel
:viewState=
"viewState"
:viewState=
"viewState"
...
@@ -350,17 +350,17 @@ export default class IBZDepartmentPickupViewBase extends Vue {
...
@@ -350,17 +350,17 @@ export default class IBZDepartmentPickupViewBase extends Vue {
}
}
}
else
{
}
else
{
// 先从导航上下文取数,没有再从导航参数(URL)取数,如果导航上下文和导航参数都没有则为null
// 先从导航上下文取数,没有再从导航参数(URL)取数,如果导航上下文和导航参数都没有则为null
if
(
this
.
context
[
curNavData
.
value
]){
if
(
this
.
context
[
(
curNavData
.
value
).
toLowerCase
()
]){
Object
.
defineProperty
(
tempData
,
item
,
{
Object
.
defineProperty
(
tempData
,
item
,
{
value
:
this
.
context
[
curNavData
.
value
],
value
:
this
.
context
[
(
curNavData
.
value
).
toLowerCase
()
],
writable
:
true
,
writable
:
true
,
enumerable
:
true
,
enumerable
:
true
,
configurable
:
true
configurable
:
true
});
});
}
else
{
}
else
{
if
(
this
.
viewparams
[
curNavData
.
value
]){
if
(
this
.
viewparams
[
(
curNavData
.
value
).
toLowerCase
()
]){
Object
.
defineProperty
(
tempData
,
item
,
{
Object
.
defineProperty
(
tempData
,
item
,
{
value
:
this
.
viewparams
[
curNavData
.
value
],
value
:
this
.
viewparams
[
(
curNavData
.
value
).
toLowerCase
()
],
writable
:
true
,
writable
:
true
,
enumerable
:
true
,
enumerable
:
true
,
configurable
:
true
configurable
:
true
...
...
app_web/src/pages/ou/ibzemployee-change-pwd-view/ibzemployee-change-pwd-view-base.vue
浏览文件 @
a31915b3
...
@@ -376,17 +376,17 @@ export default class IBZEmployeeChangePwdViewBase extends Vue {
...
@@ -376,17 +376,17 @@ export default class IBZEmployeeChangePwdViewBase extends Vue {
}
}
}
else
{
}
else
{
// 先从导航上下文取数,没有再从导航参数(URL)取数,如果导航上下文和导航参数都没有则为null
// 先从导航上下文取数,没有再从导航参数(URL)取数,如果导航上下文和导航参数都没有则为null
if
(
this
.
context
[
curNavData
.
value
]){
if
(
this
.
context
[
(
curNavData
.
value
).
toLowerCase
()
]){
Object
.
defineProperty
(
tempData
,
item
,
{
Object
.
defineProperty
(
tempData
,
item
,
{
value
:
this
.
context
[
curNavData
.
value
],
value
:
this
.
context
[
(
curNavData
.
value
).
toLowerCase
()
],
writable
:
true
,
writable
:
true
,
enumerable
:
true
,
enumerable
:
true
,
configurable
:
true
configurable
:
true
});
});
}
else
{
}
else
{
if
(
this
.
viewparams
[
curNavData
.
value
]){
if
(
this
.
viewparams
[
(
curNavData
.
value
).
toLowerCase
()
]){
Object
.
defineProperty
(
tempData
,
item
,
{
Object
.
defineProperty
(
tempData
,
item
,
{
value
:
this
.
viewparams
[
curNavData
.
value
],
value
:
this
.
viewparams
[
(
curNavData
.
value
).
toLowerCase
()
],
writable
:
true
,
writable
:
true
,
enumerable
:
true
,
enumerable
:
true
,
configurable
:
true
configurable
:
true
...
...
app_web/src/pages/ou/ibzemployee-edit-view/ibzemployee-edit-view-base.vue
浏览文件 @
a31915b3
...
@@ -396,17 +396,17 @@ export default class IBZEmployeeEditViewBase extends Vue {
...
@@ -396,17 +396,17 @@ export default class IBZEmployeeEditViewBase extends Vue {
}
}
}
else
{
}
else
{
// 先从导航上下文取数,没有再从导航参数(URL)取数,如果导航上下文和导航参数都没有则为null
// 先从导航上下文取数,没有再从导航参数(URL)取数,如果导航上下文和导航参数都没有则为null
if
(
this
.
context
[
curNavData
.
value
]){
if
(
this
.
context
[
(
curNavData
.
value
).
toLowerCase
()
]){
Object
.
defineProperty
(
tempData
,
item
,
{
Object
.
defineProperty
(
tempData
,
item
,
{
value
:
this
.
context
[
curNavData
.
value
],
value
:
this
.
context
[
(
curNavData
.
value
).
toLowerCase
()
],
writable
:
true
,
writable
:
true
,
enumerable
:
true
,
enumerable
:
true
,
configurable
:
true
configurable
:
true
});
});
}
else
{
}
else
{
if
(
this
.
viewparams
[
curNavData
.
value
]){
if
(
this
.
viewparams
[
(
curNavData
.
value
).
toLowerCase
()
]){
Object
.
defineProperty
(
tempData
,
item
,
{
Object
.
defineProperty
(
tempData
,
item
,
{
value
:
this
.
viewparams
[
curNavData
.
value
],
value
:
this
.
viewparams
[
(
curNavData
.
value
).
toLowerCase
()
],
writable
:
true
,
writable
:
true
,
enumerable
:
true
,
enumerable
:
true
,
configurable
:
true
configurable
:
true
...
@@ -814,7 +814,7 @@ export default class IBZEmployeeEditViewBase extends Vue {
...
@@ -814,7 +814,7 @@ export default class IBZEmployeeEditViewBase extends Vue {
if
(
args
.
length
>
0
)
{
if
(
args
.
length
>
0
)
{
Object
.
assign
(
data
,
{
srfsourcekey
:
args
[
0
].
srfkey
})
Object
.
assign
(
data
,
{
srfsourcekey
:
args
[
0
].
srfkey
})
}
}
_this
.
newdata
([{
...
data
}],
params
,
$event
,
xData
);
_this
.
newdata
([{
...
data
}],
[{
...
data
}],
params
,
$event
,
xData
);
}
else
if
(
xData
&&
xData
.
copy
instanceof
Function
)
{
}
else
if
(
xData
&&
xData
.
copy
instanceof
Function
)
{
const
data2
:
any
=
{};
const
data2
:
any
=
{};
if
(
args
.
length
>
0
)
{
if
(
args
.
length
>
0
)
{
...
...
app_web/src/pages/ou/ibzemployee-grid-view/ibzemployee-grid-view-base.vue
浏览文件 @
a31915b3
...
@@ -508,17 +508,17 @@ export default class IBZEmployeeGridViewBase extends Vue {
...
@@ -508,17 +508,17 @@ export default class IBZEmployeeGridViewBase extends Vue {
}
}
}
else
{
}
else
{
// 先从导航上下文取数,没有再从导航参数(URL)取数,如果导航上下文和导航参数都没有则为null
// 先从导航上下文取数,没有再从导航参数(URL)取数,如果导航上下文和导航参数都没有则为null
if
(
this
.
context
[
curNavData
.
value
]){
if
(
this
.
context
[
(
curNavData
.
value
).
toLowerCase
()
]){
Object
.
defineProperty
(
tempData
,
item
,
{
Object
.
defineProperty
(
tempData
,
item
,
{
value
:
this
.
context
[
curNavData
.
value
],
value
:
this
.
context
[
(
curNavData
.
value
).
toLowerCase
()
],
writable
:
true
,
writable
:
true
,
enumerable
:
true
,
enumerable
:
true
,
configurable
:
true
configurable
:
true
});
});
}
else
{
}
else
{
if
(
this
.
viewparams
[
curNavData
.
value
]){
if
(
this
.
viewparams
[
(
curNavData
.
value
).
toLowerCase
()
]){
Object
.
defineProperty
(
tempData
,
item
,
{
Object
.
defineProperty
(
tempData
,
item
,
{
value
:
this
.
viewparams
[
curNavData
.
value
],
value
:
this
.
viewparams
[
(
curNavData
.
value
).
toLowerCase
()
],
writable
:
true
,
writable
:
true
,
enumerable
:
true
,
enumerable
:
true
,
configurable
:
true
configurable
:
true
...
@@ -1230,7 +1230,7 @@ export default class IBZEmployeeGridViewBase extends Vue {
...
@@ -1230,7 +1230,7 @@ export default class IBZEmployeeGridViewBase extends Vue {
const
_this
:
any
=
this
;
const
_this
:
any
=
this
;
if
(
_this
.
newdata
&&
_this
.
newdata
instanceof
Function
)
{
if
(
_this
.
newdata
&&
_this
.
newdata
instanceof
Function
)
{
const
data
:
any
=
{};
const
data
:
any
=
{};
_this
.
newdata
([{
...
data
}],
params
,
$event
,
xData
);
_this
.
newdata
([{
...
data
}],
[{
...
data
}],
params
,
$event
,
xData
);
}
else
{
}
else
{
_this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'newdata 视图处理逻辑不存在,请添加!'
});
_this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'newdata 视图处理逻辑不存在,请添加!'
});
}
}
...
@@ -1308,7 +1308,7 @@ export default class IBZEmployeeGridViewBase extends Vue {
...
@@ -1308,7 +1308,7 @@ export default class IBZEmployeeGridViewBase extends Vue {
if
(
args
.
length
>
0
)
{
if
(
args
.
length
>
0
)
{
Object
.
assign
(
data
,
{
srfsourcekey
:
args
[
0
].
srfkey
})
Object
.
assign
(
data
,
{
srfsourcekey
:
args
[
0
].
srfkey
})
}
}
_this
.
newdata
([{
...
data
}],
params
,
$event
,
xData
);
_this
.
newdata
([{
...
data
}],
[{
...
data
}],
params
,
$event
,
xData
);
}
else
if
(
xData
&&
xData
.
copy
instanceof
Function
)
{
}
else
if
(
xData
&&
xData
.
copy
instanceof
Function
)
{
const
data2
:
any
=
{};
const
data2
:
any
=
{};
if
(
args
.
length
>
0
)
{
if
(
args
.
length
>
0
)
{
...
...
app_web/src/pages/ou/ibzorganization-edit-view/ibzorganization-edit-view-base.vue
浏览文件 @
a31915b3
...
@@ -396,17 +396,17 @@ export default class IBZOrganizationEditViewBase extends Vue {
...
@@ -396,17 +396,17 @@ export default class IBZOrganizationEditViewBase extends Vue {
}
}
}
else
{
}
else
{
// 先从导航上下文取数,没有再从导航参数(URL)取数,如果导航上下文和导航参数都没有则为null
// 先从导航上下文取数,没有再从导航参数(URL)取数,如果导航上下文和导航参数都没有则为null
if
(
this
.
context
[
curNavData
.
value
]){
if
(
this
.
context
[
(
curNavData
.
value
).
toLowerCase
()
]){
Object
.
defineProperty
(
tempData
,
item
,
{
Object
.
defineProperty
(
tempData
,
item
,
{
value
:
this
.
context
[
curNavData
.
value
],
value
:
this
.
context
[
(
curNavData
.
value
).
toLowerCase
()
],
writable
:
true
,
writable
:
true
,
enumerable
:
true
,
enumerable
:
true
,
configurable
:
true
configurable
:
true
});
});
}
else
{
}
else
{
if
(
this
.
viewparams
[
curNavData
.
value
]){
if
(
this
.
viewparams
[
(
curNavData
.
value
).
toLowerCase
()
]){
Object
.
defineProperty
(
tempData
,
item
,
{
Object
.
defineProperty
(
tempData
,
item
,
{
value
:
this
.
viewparams
[
curNavData
.
value
],
value
:
this
.
viewparams
[
(
curNavData
.
value
).
toLowerCase
()
],
writable
:
true
,
writable
:
true
,
enumerable
:
true
,
enumerable
:
true
,
configurable
:
true
configurable
:
true
...
@@ -814,7 +814,7 @@ export default class IBZOrganizationEditViewBase extends Vue {
...
@@ -814,7 +814,7 @@ export default class IBZOrganizationEditViewBase extends Vue {
if
(
args
.
length
>
0
)
{
if
(
args
.
length
>
0
)
{
Object
.
assign
(
data
,
{
srfsourcekey
:
args
[
0
].
srfkey
})
Object
.
assign
(
data
,
{
srfsourcekey
:
args
[
0
].
srfkey
})
}
}
_this
.
newdata
([{
...
data
}],
params
,
$event
,
xData
);
_this
.
newdata
([{
...
data
}],
[{
...
data
}],
params
,
$event
,
xData
);
}
else
if
(
xData
&&
xData
.
copy
instanceof
Function
)
{
}
else
if
(
xData
&&
xData
.
copy
instanceof
Function
)
{
const
data2
:
any
=
{};
const
data2
:
any
=
{};
if
(
args
.
length
>
0
)
{
if
(
args
.
length
>
0
)
{
...
...
app_web/src/pages/ou/ibzorganization-grid-view/ibzorganization-grid-view-base.vue
浏览文件 @
a31915b3
...
@@ -497,17 +497,17 @@ export default class IBZOrganizationGridViewBase extends Vue {
...
@@ -497,17 +497,17 @@ export default class IBZOrganizationGridViewBase extends Vue {
}
}
}
else
{
}
else
{
// 先从导航上下文取数,没有再从导航参数(URL)取数,如果导航上下文和导航参数都没有则为null
// 先从导航上下文取数,没有再从导航参数(URL)取数,如果导航上下文和导航参数都没有则为null
if
(
this
.
context
[
curNavData
.
value
]){
if
(
this
.
context
[
(
curNavData
.
value
).
toLowerCase
()
]){
Object
.
defineProperty
(
tempData
,
item
,
{
Object
.
defineProperty
(
tempData
,
item
,
{
value
:
this
.
context
[
curNavData
.
value
],
value
:
this
.
context
[
(
curNavData
.
value
).
toLowerCase
()
],
writable
:
true
,
writable
:
true
,
enumerable
:
true
,
enumerable
:
true
,
configurable
:
true
configurable
:
true
});
});
}
else
{
}
else
{
if
(
this
.
viewparams
[
curNavData
.
value
]){
if
(
this
.
viewparams
[
(
curNavData
.
value
).
toLowerCase
()
]){
Object
.
defineProperty
(
tempData
,
item
,
{
Object
.
defineProperty
(
tempData
,
item
,
{
value
:
this
.
viewparams
[
curNavData
.
value
],
value
:
this
.
viewparams
[
(
curNavData
.
value
).
toLowerCase
()
],
writable
:
true
,
writable
:
true
,
enumerable
:
true
,
enumerable
:
true
,
configurable
:
true
configurable
:
true
...
@@ -1179,7 +1179,7 @@ export default class IBZOrganizationGridViewBase extends Vue {
...
@@ -1179,7 +1179,7 @@ export default class IBZOrganizationGridViewBase extends Vue {
const
_this
:
any
=
this
;
const
_this
:
any
=
this
;
if
(
_this
.
newdata
&&
_this
.
newdata
instanceof
Function
)
{
if
(
_this
.
newdata
&&
_this
.
newdata
instanceof
Function
)
{
const
data
:
any
=
{};
const
data
:
any
=
{};
_this
.
newdata
([{
...
data
}],
params
,
$event
,
xData
);
_this
.
newdata
([{
...
data
}],
[{
...
data
}],
params
,
$event
,
xData
);
}
else
{
}
else
{
_this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'newdata 视图处理逻辑不存在,请添加!'
});
_this
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'newdata 视图处理逻辑不存在,请添加!'
});
}
}
...
@@ -1257,7 +1257,7 @@ export default class IBZOrganizationGridViewBase extends Vue {
...
@@ -1257,7 +1257,7 @@ export default class IBZOrganizationGridViewBase extends Vue {
if
(
args
.
length
>
0
)
{
if
(
args
.
length
>
0
)
{
Object
.
assign
(
data
,
{
srfsourcekey
:
args
[
0
].
srfkey
})
Object
.
assign
(
data
,
{
srfsourcekey
:
args
[
0
].
srfkey
})
}
}
_this
.
newdata
([{
...
data
}],
params
,
$event
,
xData
);
_this
.
newdata
([{
...
data
}],
[{
...
data
}],
params
,
$event
,
xData
);
}
else
if
(
xData
&&
xData
.
copy
instanceof
Function
)
{
}
else
if
(
xData
&&
xData
.
copy
instanceof
Function
)
{
const
data2
:
any
=
{};
const
data2
:
any
=
{};
if
(
args
.
length
>
0
)
{
if
(
args
.
length
>
0
)
{
...
...
app_web/src/pages/ou/ibzorganization-option-view/ibzorganization-option-view-base.vue
浏览文件 @
a31915b3
...
@@ -358,17 +358,17 @@ export default class IBZOrganizationOptionViewBase extends Vue {
...
@@ -358,17 +358,17 @@ export default class IBZOrganizationOptionViewBase extends Vue {
}
}
}
else
{
}
else
{
// 先从导航上下文取数,没有再从导航参数(URL)取数,如果导航上下文和导航参数都没有则为null
// 先从导航上下文取数,没有再从导航参数(URL)取数,如果导航上下文和导航参数都没有则为null
if
(
this
.
context
[
curNavData
.
value
]){
if
(
this
.
context
[
(
curNavData
.
value
).
toLowerCase
()
]){
Object
.
defineProperty
(
tempData
,
item
,
{
Object
.
defineProperty
(
tempData
,
item
,
{
value
:
this
.
context
[
curNavData
.
value
],
value
:
this
.
context
[
(
curNavData
.
value
).
toLowerCase
()
],
writable
:
true
,
writable
:
true
,
enumerable
:
true
,
enumerable
:
true
,
configurable
:
true
configurable
:
true
});
});
}
else
{
}
else
{
if
(
this
.
viewparams
[
curNavData
.
value
]){
if
(
this
.
viewparams
[
(
curNavData
.
value
).
toLowerCase
()
]){
Object
.
defineProperty
(
tempData
,
item
,
{
Object
.
defineProperty
(
tempData
,
item
,
{
value
:
this
.
viewparams
[
curNavData
.
value
],
value
:
this
.
viewparams
[
(
curNavData
.
value
).
toLowerCase
()
],
writable
:
true
,
writable
:
true
,
enumerable
:
true
,
enumerable
:
true
,
configurable
:
true
configurable
:
true
...
...
app_web/src/pages/ou/ibzorganization-pickup-grid-view/ibzorganization-pickup-grid-view-base.vue
浏览文件 @
a31915b3
...
@@ -356,17 +356,17 @@ export default class IBZOrganizationPickupGridViewBase extends Vue {
...
@@ -356,17 +356,17 @@ export default class IBZOrganizationPickupGridViewBase extends Vue {
}
}
}
else
{
}
else
{
// 先从导航上下文取数,没有再从导航参数(URL)取数,如果导航上下文和导航参数都没有则为null
// 先从导航上下文取数,没有再从导航参数(URL)取数,如果导航上下文和导航参数都没有则为null
if
(
this
.
context
[
curNavData
.
value
]){
if
(
this
.
context
[
(
curNavData
.
value
).
toLowerCase
()
]){
Object
.
defineProperty
(
tempData
,
item
,
{
Object
.
defineProperty
(
tempData
,
item
,
{
value
:
this
.
context
[
curNavData
.
value
],
value
:
this
.
context
[
(
curNavData
.
value
).
toLowerCase
()
],
writable
:
true
,
writable
:
true
,
enumerable
:
true
,
enumerable
:
true
,
configurable
:
true
configurable
:
true
});
});
}
else
{
}
else
{
if
(
this
.
viewparams
[
curNavData
.
value
]){
if
(
this
.
viewparams
[
(
curNavData
.
value
).
toLowerCase
()
]){
Object
.
defineProperty
(
tempData
,
item
,
{
Object
.
defineProperty
(
tempData
,
item
,
{
value
:
this
.
viewparams
[
curNavData
.
value
],
value
:
this
.
viewparams
[
(
curNavData
.
value
).
toLowerCase
()
],
writable
:
true
,
writable
:
true
,
enumerable
:
true
,
enumerable
:
true
,
configurable
:
true
configurable
:
true
...
...
app_web/src/pages/ou/ibzorganization-pickup-view/ibzorganization-pickup-view-base.vue
浏览文件 @
a31915b3
<
template
>
<
template
>
<div
class=
"view-container depickupview ibzorganization-pickup-view"
>
<div
class=
"view-container depickupview ibzorganization-pickup-view"
>
<app-studioaction
:viewTitle=
"$t(model.srfTitle)"
viewName=
"ibzorganizationpickupview"
></app-studioaction>
<app-studioaction
:viewTitle=
"$t(model.srfTitle)"
viewName=
"ibzorganizationpickupview"
></app-studioaction>
<card
class=
'view-card'
:dis-hover=
"true"
:padding=
"0"
:bordered=
"false"
>
<card
class=
'view-card
view-no-caption
'
:dis-hover=
"true"
:padding=
"0"
:bordered=
"false"
>
<div
class=
"content-container pickup-view"
>
<div
class=
"content-container pickup-view"
>
<view
_pickupviewpanel
<view
_pickupviewpanel
:viewState=
"viewState"
:viewState=
"viewState"
...
@@ -350,17 +350,17 @@ export default class IBZOrganizationPickupViewBase extends Vue {
...
@@ -350,17 +350,17 @@ export default class IBZOrganizationPickupViewBase extends Vue {
}
}
}
else
{
}
else
{
// 先从导航上下文取数,没有再从导航参数(URL)取数,如果导航上下文和导航参数都没有则为null
// 先从导航上下文取数,没有再从导航参数(URL)取数,如果导航上下文和导航参数都没有则为null
if
(
this
.
context
[
curNavData
.
value
]){
if
(
this
.
context
[
(
curNavData
.
value
).
toLowerCase
()
]){
Object
.
defineProperty
(
tempData
,
item
,
{
Object
.
defineProperty
(
tempData
,
item
,
{
value
:
this
.
context
[
curNavData
.
value
],
value
:
this
.
context
[
(
curNavData
.
value
).
toLowerCase
()
],
writable
:
true
,
writable
:
true
,
enumerable
:
true
,
enumerable
:
true
,
configurable
:
true
configurable
:
true
});
});
}
else
{
}
else
{
if
(
this
.
viewparams
[
curNavData
.
value
]){
if
(
this
.
viewparams
[
(
curNavData
.
value
).
toLowerCase
()
]){
Object
.
defineProperty
(
tempData
,
item
,
{
Object
.
defineProperty
(
tempData
,
item
,
{
value
:
this
.
viewparams
[
curNavData
.
value
],
value
:
this
.
viewparams
[
(
curNavData
.
value
).
toLowerCase
()
],
writable
:
true
,
writable
:
true
,
enumerable
:
true
,
enumerable
:
true
,
configurable
:
true
configurable
:
true
...
...
app_web/src/pages/ou/ouindex-view/ouindex-view-base.vue
浏览文件 @
a31915b3
...
@@ -333,17 +333,17 @@ export default class OUIndexViewBase extends Vue {
...
@@ -333,17 +333,17 @@ export default class OUIndexViewBase extends Vue {
}
}
}
else
{
}
else
{
// 先从导航上下文取数,没有再从导航参数(URL)取数,如果导航上下文和导航参数都没有则为null
// 先从导航上下文取数,没有再从导航参数(URL)取数,如果导航上下文和导航参数都没有则为null
if
(
this
.
context
[
curNavData
.
value
]){
if
(
this
.
context
[
(
curNavData
.
value
).
toLowerCase
()
]){
Object
.
defineProperty
(
tempData
,
item
,
{
Object
.
defineProperty
(
tempData
,
item
,
{
value
:
this
.
context
[
curNavData
.
value
],
value
:
this
.
context
[
(
curNavData
.
value
).
toLowerCase
()
],
writable
:
true
,
writable
:
true
,
enumerable
:
true
,
enumerable
:
true
,
configurable
:
true
configurable
:
true
});
});
}
else
{
}
else
{
if
(
this
.
viewparams
[
curNavData
.
value
]){
if
(
this
.
viewparams
[
(
curNavData
.
value
).
toLowerCase
()
]){
Object
.
defineProperty
(
tempData
,
item
,
{
Object
.
defineProperty
(
tempData
,
item
,
{
value
:
this
.
viewparams
[
curNavData
.
value
],
value
:
this
.
viewparams
[
(
curNavData
.
value
).
toLowerCase
()
],
writable
:
true
,
writable
:
true
,
enumerable
:
true
,
enumerable
:
true
,
configurable
:
true
configurable
:
true
...
...
app_web/src/service/entity-service.ts
浏览文件 @
a31915b3
...
@@ -587,12 +587,12 @@ export default class EntityService {
...
@@ -587,12 +587,12 @@ export default class EntityService {
* createBatch接口方法
* createBatch接口方法
*
*
* @param {*} [context={}]
* @param {*} [context={}]
* @param {*} [data
={}
]
* @param {*} [data]
* @param {boolean} [isloading]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @returns {Promise<any>}
* @memberof EntityService
* @memberof EntityService
*/
*/
public
async
createBatch
(
context
:
any
=
{},
data
:
any
=
{}
,
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
createBatch
(
context
:
any
=
{},
data
:
any
,
isloading
?:
boolean
):
Promise
<
any
>
{
return
Http
.
getInstance
().
post
(
`/
${
this
.
APPDENAME
}
/batch`
,
data
,
isloading
);
return
Http
.
getInstance
().
post
(
`/
${
this
.
APPDENAME
}
/batch`
,
data
,
isloading
);
}
}
...
@@ -600,12 +600,12 @@ export default class EntityService {
...
@@ -600,12 +600,12 @@ export default class EntityService {
* updateBatch接口方法
* updateBatch接口方法
*
*
* @param {*} [context={}]
* @param {*} [context={}]
* @param {*} [data
={}
]
* @param {*} [data]
* @param {boolean} [isloading]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @returns {Promise<any>}
* @memberof EntityService
* @memberof EntityService
*/
*/
public
async
updateBatch
(
context
:
any
=
{},
data
:
any
=
{}
,
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
updateBatch
(
context
:
any
=
{},
data
:
any
,
isloading
?:
boolean
):
Promise
<
any
>
{
return
Http
.
getInstance
().
put
(
`/
${
this
.
APPDENAME
}
/batch`
,
data
,
isloading
);
return
Http
.
getInstance
().
put
(
`/
${
this
.
APPDENAME
}
/batch`
,
data
,
isloading
);
}
}
...
@@ -613,12 +613,12 @@ export default class EntityService {
...
@@ -613,12 +613,12 @@ export default class EntityService {
* removeBatch接口方法
* removeBatch接口方法
*
*
* @param {*} [context={}]
* @param {*} [context={}]
* @param {*} [data
={}
]
* @param {*} [data]
* @param {boolean} [isloading]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @returns {Promise<any>}
* @memberof EntityService
* @memberof EntityService
*/
*/
public
async
removeBatch
(
context
:
any
=
{},
data
:
any
=
{}
,
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
removeBatch
(
context
:
any
=
{},
data
:
any
,
isloading
?:
boolean
):
Promise
<
any
>
{
return
Http
.
getInstance
().
delete
(
`/
${
this
.
APPDENAME
}
/batch`
,
isloading
,
data
);
return
Http
.
getInstance
().
delete
(
`/
${
this
.
APPDENAME
}
/batch`
,
isloading
,
data
);
}
}
...
...
app_web/src/utils/http/http.ts
浏览文件 @
a31915b3
...
@@ -78,7 +78,7 @@ export class Http {
...
@@ -78,7 +78,7 @@ export class Http {
axios
({
axios
({
method
:
'post'
,
method
:
'post'
,
url
:
url
,
url
:
url
,
data
:
{
...
params
}
,
data
:
params
,
headers
:
{
'Content-Type'
:
'application/json;charset=UTF-8'
,
'Accept'
:
'application/json'
},
headers
:
{
'Content-Type'
:
'application/json;charset=UTF-8'
,
'Accept'
:
'application/json'
},
// transformResponse: [(data: any) => {
// transformResponse: [(data: any) => {
// let _data: any = null;
// let _data: any = null;
...
...
app_web/src/widgets/ibzdepartment/default-searchform/default-searchform-base.vue
浏览文件 @
a31915b3
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<i-form
:model=
"this.data"
class=
'app-search-form'
ref=
'searchform'
style=
""
>
<i-form
:model=
"this.data"
class=
'app-search-form'
ref=
'searchform'
style=
""
>
<input
style=
"display:none;"
/>
<input
style=
"display:none;"
/>
<row>
<row>
<i-col
span=
"20"
>
<i-col
span=
"20"
class=
"form-content"
>
<row>
<row>
<i-col
v-show=
"detailsModel.n_deptcode_like.visible"
:style=
"
{}" :sm="{ span: 12, offset: 0 }" :md="{ span: 12, offset: 0 }" :lg="{ span: 12, offset: 0 }" :xl="{ span: 8, offset: 0 }">
<i-col
v-show=
"detailsModel.n_deptcode_like.visible"
:style=
"
{}" :sm="{ span: 12, offset: 0 }" :md="{ span: 12, offset: 0 }" :lg="{ span: 12, offset: 0 }" :xl="{ span: 8, offset: 0 }">
<app-form-item
name=
'n_deptcode_like'
:itemRules=
"this.rules.n_deptcode_like"
class=
''
:caption=
"$t('entities.ibzdepartment.default_searchform.details.n_deptcode_like')"
uiStyle=
"DEFAULT"
:labelWidth=
"130"
:isShowCaption=
"true"
:error=
"detailsModel.n_deptcode_like.error"
:isEmptyCaption=
"false"
labelPos=
"LEFT"
>
<app-form-item
name=
'n_deptcode_like'
:itemRules=
"this.rules.n_deptcode_like"
class=
''
:caption=
"$t('entities.ibzdepartment.default_searchform.details.n_deptcode_like')"
uiStyle=
"DEFAULT"
:labelWidth=
"130"
:isShowCaption=
"true"
:error=
"detailsModel.n_deptcode_like.error"
:isEmptyCaption=
"false"
labelPos=
"LEFT"
>
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
</i-col>
</i-col>
</row>
</row>
</i-col>
</i-col>
<i-col
span=
"4"
>
<i-col
span=
"4"
class=
"search-button"
>
<row
v-show=
"Object.keys(data).length>0"
>
<row
v-show=
"Object.keys(data).length>0"
>
<i-button
class=
'search_reset'
size=
"default"
type=
"primary"
@
click=
"onSearch"
>
{{
$t
(
'app.searchButton.search'
)
}}
</i-button>
<i-button
class=
'search_reset'
size=
"default"
type=
"primary"
@
click=
"onSearch"
>
{{
$t
(
'app.searchButton.search'
)
}}
</i-button>
<i-button
class=
'search_reset'
size=
"default"
@
click=
"onReset"
>
{{
this
.
$t
(
'app.searchButton.reset'
)
}}
</i-button>
<i-button
class=
'search_reset'
size=
"default"
@
click=
"onReset"
>
{{
this
.
$t
(
'app.searchButton.reset'
)
}}
</i-button>
...
...
app_web/src/widgets/ibzdepartment/default-searchform/default-searchform.less
浏览文件 @
a31915b3
...
@@ -13,6 +13,9 @@
...
@@ -13,6 +13,9 @@
margin-right: 12px;
margin-right: 12px;
margin-bottom: 8px;
margin-bottom: 8px;
}
}
.search-button{
text-align: right;
}
}
}
.app-search-form-flex {
.app-search-form-flex {
height: 100%;
height: 100%;
...
...
app_web/src/widgets/ibzdepartment/main-form/main-form-base.vue
浏览文件 @
a31915b3
...
@@ -1830,7 +1830,7 @@ export default class MainBase extends Vue implements ControlInterface {
...
@@ -1830,7 +1830,7 @@ export default class MainBase extends Vue implements ControlInterface {
*/
*/
public
createDefault
(){
public
createDefault
(){
if
(
this
.
data
.
hasOwnProperty
(
'showorder'
))
{
if
(
this
.
data
.
hasOwnProperty
(
'showorder'
))
{
this
.
data
[
'showorder'
]
=
'1'
;
this
.
data
[
'showorder'
]
=
1
;
}
}
}
}
...
...
app_web/src/widgets/ibzdepartment/main-grid/main-grid-base.vue
浏览文件 @
a31915b3
...
@@ -533,7 +533,7 @@ export default class MainBase extends Vue implements ControlInterface {
...
@@ -533,7 +533,7 @@ export default class MainBase extends Vue implements ControlInterface {
* @type {number}
* @type {number}
* @memberof AppIndex
* @memberof AppIndex
*/
*/
protected
checkboxColWidth
:
number
=
8
0
;
protected
checkboxColWidth
:
number
=
5
0
;
/**
/**
* 是否允许拖动列宽
* 是否允许拖动列宽
...
...
app_web/src/widgets/ibzemployee/default-searchform/default-searchform-base.vue
浏览文件 @
a31915b3
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<i-form
:model=
"this.data"
class=
'app-search-form'
ref=
'searchform'
style=
""
>
<i-form
:model=
"this.data"
class=
'app-search-form'
ref=
'searchform'
style=
""
>
<input
style=
"display:none;"
/>
<input
style=
"display:none;"
/>
<row>
<row>
<i-col
span=
"20"
>
<i-col
span=
"20"
class=
"form-content"
>
<row>
<row>
<i-col
v-show=
"detailsModel.n_usercode_like.visible"
:style=
"
{}" :sm="{ span: 12, offset: 0 }" :md="{ span: 12, offset: 0 }" :lg="{ span: 12, offset: 0 }" :xl="{ span: 8, offset: 0 }">
<i-col
v-show=
"detailsModel.n_usercode_like.visible"
:style=
"
{}" :sm="{ span: 12, offset: 0 }" :md="{ span: 12, offset: 0 }" :lg="{ span: 12, offset: 0 }" :xl="{ span: 8, offset: 0 }">
<app-form-item
name=
'n_usercode_like'
:itemRules=
"this.rules.n_usercode_like"
class=
''
:caption=
"$t('entities.ibzemployee.default_searchform.details.n_usercode_like')"
uiStyle=
"DEFAULT"
:labelWidth=
"130"
:isShowCaption=
"true"
:error=
"detailsModel.n_usercode_like.error"
:isEmptyCaption=
"false"
labelPos=
"LEFT"
>
<app-form-item
name=
'n_usercode_like'
:itemRules=
"this.rules.n_usercode_like"
class=
''
:caption=
"$t('entities.ibzemployee.default_searchform.details.n_usercode_like')"
uiStyle=
"DEFAULT"
:labelWidth=
"130"
:isShowCaption=
"true"
:error=
"detailsModel.n_usercode_like.error"
:isEmptyCaption=
"false"
labelPos=
"LEFT"
>
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
</i-col>
</i-col>
</row>
</row>
</i-col>
</i-col>
<i-col
span=
"4"
>
<i-col
span=
"4"
class=
"search-button"
>
<row
v-show=
"Object.keys(data).length>0"
>
<row
v-show=
"Object.keys(data).length>0"
>
<i-button
class=
'search_reset'
size=
"default"
type=
"primary"
@
click=
"onSearch"
>
{{
$t
(
'app.searchButton.search'
)
}}
</i-button>
<i-button
class=
'search_reset'
size=
"default"
type=
"primary"
@
click=
"onSearch"
>
{{
$t
(
'app.searchButton.search'
)
}}
</i-button>
<i-button
class=
'search_reset'
size=
"default"
@
click=
"onReset"
>
{{
this
.
$t
(
'app.searchButton.reset'
)
}}
</i-button>
<i-button
class=
'search_reset'
size=
"default"
@
click=
"onReset"
>
{{
this
.
$t
(
'app.searchButton.reset'
)
}}
</i-button>
...
...
app_web/src/widgets/ibzemployee/default-searchform/default-searchform.less
浏览文件 @
a31915b3
...
@@ -13,6 +13,9 @@
...
@@ -13,6 +13,9 @@
margin-right: 12px;
margin-right: 12px;
margin-bottom: 8px;
margin-bottom: 8px;
}
}
.search-button{
text-align: right;
}
}
}
.app-search-form-flex {
.app-search-form-flex {
height: 100%;
height: 100%;
...
...
app_web/src/widgets/ibzemployee/main-form/main-form-base.vue
浏览文件 @
a31915b3
...
@@ -2169,7 +2169,7 @@ export default class MainBase extends Vue implements ControlInterface {
...
@@ -2169,7 +2169,7 @@ export default class MainBase extends Vue implements ControlInterface {
*/
*/
public
createDefault
(){
public
createDefault
(){
if
(
this
.
data
.
hasOwnProperty
(
'showorder'
))
{
if
(
this
.
data
.
hasOwnProperty
(
'showorder'
))
{
this
.
data
[
'showorder'
]
=
'1'
;
this
.
data
[
'showorder'
]
=
1
;
}
}
}
}
...
...
app_web/src/widgets/ibzemployee/main-grid/main-grid-base.vue
浏览文件 @
a31915b3
...
@@ -549,7 +549,7 @@ export default class MainBase extends Vue implements ControlInterface {
...
@@ -549,7 +549,7 @@ export default class MainBase extends Vue implements ControlInterface {
* @type {number}
* @type {number}
* @memberof AppIndex
* @memberof AppIndex
*/
*/
protected
checkboxColWidth
:
number
=
8
0
;
protected
checkboxColWidth
:
number
=
5
0
;
/**
/**
* 是否允许拖动列宽
* 是否允许拖动列宽
...
...
app_web/src/widgets/ibzorganization/default-searchform/default-searchform-base.vue
浏览文件 @
a31915b3
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<i-form
:model=
"this.data"
class=
'app-search-form'
ref=
'searchform'
style=
""
>
<i-form
:model=
"this.data"
class=
'app-search-form'
ref=
'searchform'
style=
""
>
<input
style=
"display:none;"
/>
<input
style=
"display:none;"
/>
<row>
<row>
<i-col
span=
"20"
>
<i-col
span=
"20"
class=
"form-content"
>
<row>
<row>
<i-col
v-show=
"detailsModel.n_orgid_like.visible"
:style=
"
{}" :sm="{ span: 12, offset: 0 }" :md="{ span: 12, offset: 0 }" :lg="{ span: 12, offset: 0 }" :xl="{ span: 8, offset: 0 }">
<i-col
v-show=
"detailsModel.n_orgid_like.visible"
:style=
"
{}" :sm="{ span: 12, offset: 0 }" :md="{ span: 12, offset: 0 }" :lg="{ span: 12, offset: 0 }" :xl="{ span: 8, offset: 0 }">
<app-form-item
name=
'n_orgid_like'
:itemRules=
"this.rules.n_orgid_like"
class=
''
:caption=
"$t('entities.ibzorganization.default_searchform.details.n_orgid_like')"
uiStyle=
"DEFAULT"
:labelWidth=
"130"
:isShowCaption=
"true"
:error=
"detailsModel.n_orgid_like.error"
:isEmptyCaption=
"false"
labelPos=
"LEFT"
>
<app-form-item
name=
'n_orgid_like'
:itemRules=
"this.rules.n_orgid_like"
class=
''
:caption=
"$t('entities.ibzorganization.default_searchform.details.n_orgid_like')"
uiStyle=
"DEFAULT"
:labelWidth=
"130"
:isShowCaption=
"true"
:error=
"detailsModel.n_orgid_like.error"
:isEmptyCaption=
"false"
labelPos=
"LEFT"
>
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
</i-col>
</i-col>
</row>
</row>
</i-col>
</i-col>
<i-col
span=
"4"
>
<i-col
span=
"4"
class=
"search-button"
>
<row
v-show=
"Object.keys(data).length>0"
>
<row
v-show=
"Object.keys(data).length>0"
>
<i-button
class=
'search_reset'
size=
"default"
type=
"primary"
@
click=
"onSearch"
>
{{
$t
(
'app.searchButton.search'
)
}}
</i-button>
<i-button
class=
'search_reset'
size=
"default"
type=
"primary"
@
click=
"onSearch"
>
{{
$t
(
'app.searchButton.search'
)
}}
</i-button>
<i-button
class=
'search_reset'
size=
"default"
@
click=
"onReset"
>
{{
this
.
$t
(
'app.searchButton.reset'
)
}}
</i-button>
<i-button
class=
'search_reset'
size=
"default"
@
click=
"onReset"
>
{{
this
.
$t
(
'app.searchButton.reset'
)
}}
</i-button>
...
...
app_web/src/widgets/ibzorganization/default-searchform/default-searchform.less
浏览文件 @
a31915b3
...
@@ -13,6 +13,9 @@
...
@@ -13,6 +13,9 @@
margin-right: 12px;
margin-right: 12px;
margin-bottom: 8px;
margin-bottom: 8px;
}
}
.search-button{
text-align: right;
}
}
}
.app-search-form-flex {
.app-search-form-flex {
height: 100%;
height: 100%;
...
...
app_web/src/widgets/ibzorganization/main-form/main-form-base.vue
浏览文件 @
a31915b3
...
@@ -1733,7 +1733,7 @@ export default class MainBase extends Vue implements ControlInterface {
...
@@ -1733,7 +1733,7 @@ export default class MainBase extends Vue implements ControlInterface {
*/
*/
public
createDefault
(){
public
createDefault
(){
if
(
this
.
data
.
hasOwnProperty
(
'showorder'
))
{
if
(
this
.
data
.
hasOwnProperty
(
'showorder'
))
{
this
.
data
[
'showorder'
]
=
'1'
;
this
.
data
[
'showorder'
]
=
1
;
}
}
}
}
...
...
app_web/src/widgets/ibzorganization/main-grid/main-grid-base.vue
浏览文件 @
a31915b3
...
@@ -526,7 +526,7 @@ export default class MainBase extends Vue implements ControlInterface {
...
@@ -526,7 +526,7 @@ export default class MainBase extends Vue implements ControlInterface {
* @type {number}
* @type {number}
* @memberof AppIndex
* @memberof AppIndex
*/
*/
protected
checkboxColWidth
:
number
=
8
0
;
protected
checkboxColWidth
:
number
=
5
0
;
/**
/**
* 是否允许拖动列宽
* 是否允许拖动列宽
...
...
config.xml
浏览文件 @
a31915b3
...
@@ -32,17 +32,11 @@
...
@@ -32,17 +32,11 @@
<hudson.tasks.Shell>
<hudson.tasks.Shell>
<command>
<command>
BUILD_ID=DONTKILLME
BUILD_ID=DONTKILLME
echo "registry.cn-shanghai.aliyuncs.com/ibizsys"
source /etc/profile
source /etc/profile
rm -rf ibzou
rm -rf ibzou
git clone -b master $para2 ibzou/
git clone -b master $para2 ibzou/
export NODE_OPTIONS=--max-old-space-size=4096
export NODE_OPTIONS=--max-old-space-size=4096
cd ibzou/
cd ibzou/
mvn clean package -Pweb
cd ibzou-app/ibzou-app-web
mvn -Pweb docker:build
mvn -Pweb docker:push
docker -H $para1 stack deploy --compose-file=src/main/docker/ibzou-app-web.yaml ibzlab-rt --with-registry-auth
</command>
</command>
</hudson.tasks.Shell>
</hudson.tasks.Shell>
</builders>
</builders>
...
...
ibzou-app/ibzou-app-web/src/main/docker/Dockerfile
浏览文件 @
a31915b3
...
@@ -9,6 +9,6 @@ CMD echo "The application will start in ${IBZ_SLEEP}s..." && \
...
@@ -9,6 +9,6 @@ CMD echo "The application will start in ${IBZ_SLEEP}s..." && \
sleep ${IBZ_SLEEP} && \
sleep ${IBZ_SLEEP} && \
java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /ibzou-app-web.jar
java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /ibzou-app-web.jar
EXPOSE
30001
EXPOSE
8080
ADD
ibzou-app-web.jar /ibzou-app-web.jar
ADD
ibzou-app-web.jar /ibzou-app-web.jar
ibzou-app/ibzou-app-web/src/main/docker/ibzou-app-web.yaml
浏览文件 @
a31915b3
...
@@ -3,11 +3,9 @@ services:
...
@@ -3,11 +3,9 @@ services:
ibzou-app-web
:
ibzou-app-web
:
image
:
registry.cn-shanghai.aliyuncs.com/ibizsys/ibzou-app-web:latest
image
:
registry.cn-shanghai.aliyuncs.com/ibizsys/ibzou-app-web:latest
ports
:
ports
:
-
"
30001:30001
"
-
"
8080:8080
"
networks
:
networks
:
-
agent_network
-
agent_network
environment
:
SPRING_CLOUD_NACOS_DISCOVERY_IP
:
172.16.180.237
deploy
:
deploy
:
mode
:
replicated
mode
:
replicated
replicas
:
1
replicas
:
1
...
...
ibzou-app/ibzou-app-web/src/main/resources/application-web-dev.yml
浏览文件 @
a31915b3
server
:
server
:
port
:
30001
port
:
8080
\ No newline at end of file
\ No newline at end of file
ibzou-app/ibzou-app-web/src/main/resources/application-web-prod.yml
浏览文件 @
a31915b3
server
:
server
:
port
:
30001
port
:
8080
#zuul网关路由设置
#zuul网关路由设置
zuul
:
zuul
:
...
...
ibzou-core/src/main/java/cn/ibizlab/core/ou/domain/IBZDepartment.java
浏览文件 @
a31915b3
...
@@ -65,6 +65,7 @@ public class IBZDepartment extends EntityMP implements Serializable {
...
@@ -65,6 +65,7 @@ public class IBZDepartment extends EntityMP implements Serializable {
/**
/**
* 上级部门
* 上级部门
*/
*/
@DEField
(
name
=
"pdeptid"
)
@TableField
(
value
=
"pdeptid"
)
@TableField
(
value
=
"pdeptid"
)
@JSONField
(
name
=
"parentdeptid"
)
@JSONField
(
name
=
"parentdeptid"
)
@JsonProperty
(
"parentdeptid"
)
@JsonProperty
(
"parentdeptid"
)
...
...
ibzou-core/src/main/java/cn/ibizlab/core/ou/domain/IBZOrganization.java
浏览文件 @
a31915b3
...
@@ -58,6 +58,7 @@ public class IBZOrganization extends EntityMP implements Serializable {
...
@@ -58,6 +58,7 @@ public class IBZOrganization extends EntityMP implements Serializable {
/**
/**
* 上级单位
* 上级单位
*/
*/
@DEField
(
name
=
"porgid"
)
@TableField
(
value
=
"porgid"
)
@TableField
(
value
=
"porgid"
)
@JSONField
(
name
=
"parentorgid"
)
@JSONField
(
name
=
"parentorgid"
)
@JsonProperty
(
"parentorgid"
)
@JsonProperty
(
"parentorgid"
)
...
...
ibzou-core/src/main/resources/deprivs/DEPrivs.json
浏览文件 @
a31915b3
{
{
"unires"
:[
],
"predefineddatarange"
:[{
"id"
:
"ALL"
,
"name"
:
"全部数据"
},{
"id"
:
"CURORG"
,
"name"
:
"当前单位"
},{
"id"
:
"PORG"
,
"name"
:
"上级单位"
},{
"id"
:
"SORG"
,
"name"
:
"下级单位"
},{
"id"
:
"CURORGDEPT"
,
"name"
:
"当前部门"
},{
"id"
:
"PORGDEPT"
,
"name"
:
"上级部门"
},{
"id"
:
"SORGDEPT"
,
"name"
:
"下级部门"
}],
"predefineddatarange"
:[{
"id"
:
"ALL"
,
"name"
:
"全部数据"
},{
"id"
:
"CURORG"
,
"name"
:
"当前单位"
},{
"id"
:
"PORG"
,
"name"
:
"上级单位"
},{
"id"
:
"SORG"
,
"name"
:
"下级单位"
},{
"id"
:
"CURORGDEPT"
,
"name"
:
"当前部门"
},{
"id"
:
"PORGDEPT"
,
"name"
:
"上级部门"
},{
"id"
:
"SORGDEPT"
,
"name"
:
"下级部门"
}],
"entities"
:[
"entities"
:[
{
{
...
@@ -26,4 +27,3 @@
...
@@ -26,4 +27,3 @@
]
]
}
}
ibzou-provider/ibzou-provider-api/pom.xml
浏览文件 @
a31915b3
...
@@ -19,16 +19,6 @@
...
@@ -19,16 +19,6 @@
<artifactId>
ibzou-core
</artifactId>
<artifactId>
ibzou-core
</artifactId>
<version>
${project.version}
</version>
<version>
${project.version}
</version>
</dependency>
</dependency>
<!-- Swagger2 -->
<dependency>
<groupId>
io.springfox
</groupId>
<artifactId>
springfox-swagger2
</artifactId>
</dependency>
<dependency>
<groupId>
io.springfox
</groupId>
<artifactId>
springfox-swagger-ui
</artifactId>
</dependency>
</dependencies>
</dependencies>
<properties>
<properties>
...
...
ibzou-provider/ibzou-provider-api/src/main/java/cn/ibizlab/api/config/apiSecurityConfig.java
浏览文件 @
a31915b3
...
@@ -88,7 +88,10 @@ public class apiSecurityConfig extends WebSecurityConfigurerAdapter {
...
@@ -88,7 +88,10 @@ public class apiSecurityConfig extends WebSecurityConfigurerAdapter {
"/**/fonts/**"
,
"/**/fonts/**"
,
"/**/js/**"
,
"/**/js/**"
,
"/**/img/**"
,
"/**/img/**"
,
"/"
"/"
,
"/webjars/**"
,
"/swagger-resources/**"
,
"/v2/**"
).
permitAll
()
).
permitAll
()
// 服务中暂时只为重构用户身份,不进行身份认证
// 服务中暂时只为重构用户身份,不进行身份认证
.
anyRequest
().
permitAll
()
.
anyRequest
().
permitAll
()
...
...
ibzou-provider/ibzou-provider-api/src/main/java/cn/ibizlab/api/rest/IBZDepartmentResource.java
浏览文件 @
a31915b3
...
@@ -67,8 +67,8 @@ public class IBZDepartmentResource {
...
@@ -67,8 +67,8 @@ public class IBZDepartmentResource {
}
}
@PreAuthorize
(
"hasPermission('','Create',{this.getEntity(),'Sql'})"
)
@PreAuthorize
(
"hasPermission('','Create',{this.getEntity(),'Sql'})"
)
@ApiOperation
(
value
=
"createBatch"
,
tags
=
{
"
createBatch
"
},
notes
=
"createBatch"
)
@ApiOperation
(
value
=
"createBatch"
,
tags
=
{
"
IBZDepartment
"
},
notes
=
"createBatch"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzdepartments/
create
batch"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzdepartments/batch"
)
public
ResponseEntity
<
Boolean
>
createBatch
(
@RequestBody
List
<
IBZDepartmentDTO
>
ibzdepartmentdtos
)
{
public
ResponseEntity
<
Boolean
>
createBatch
(
@RequestBody
List
<
IBZDepartmentDTO
>
ibzdepartmentdtos
)
{
ibzdepartmentService
.
createBatch
(
ibzdepartmentMapping
.
toDomain
(
ibzdepartmentdtos
));
ibzdepartmentService
.
createBatch
(
ibzdepartmentMapping
.
toDomain
(
ibzdepartmentdtos
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
...
@@ -95,7 +95,7 @@ public class IBZDepartmentResource {
...
@@ -95,7 +95,7 @@ public class IBZDepartmentResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ibzdepartmentService
.
save
(
ibzdepartmentMapping
.
toDomain
(
ibzdepartmentdto
)));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ibzdepartmentService
.
save
(
ibzdepartmentMapping
.
toDomain
(
ibzdepartmentdto
)));
}
}
@ApiOperation
(
value
=
"SaveBatch"
,
tags
=
{
"
SaveBatch
"
},
notes
=
"SaveBatch"
)
@ApiOperation
(
value
=
"SaveBatch"
,
tags
=
{
"
IBZDepartment
"
},
notes
=
"SaveBatch"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzdepartments/savebatch"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzdepartments/savebatch"
)
public
ResponseEntity
<
Boolean
>
saveBatch
(
@RequestBody
List
<
IBZDepartmentDTO
>
ibzdepartmentdtos
)
{
public
ResponseEntity
<
Boolean
>
saveBatch
(
@RequestBody
List
<
IBZDepartmentDTO
>
ibzdepartmentdtos
)
{
ibzdepartmentService
.
saveBatch
(
ibzdepartmentMapping
.
toDomain
(
ibzdepartmentdtos
));
ibzdepartmentService
.
saveBatch
(
ibzdepartmentMapping
.
toDomain
(
ibzdepartmentdtos
));
...
@@ -131,8 +131,8 @@ public class IBZDepartmentResource {
...
@@ -131,8 +131,8 @@ public class IBZDepartmentResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ibzdepartmentService
.
remove
(
ibzdepartment_id
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ibzdepartmentService
.
remove
(
ibzdepartment_id
));
}
}
@ApiOperation
(
value
=
"RemoveBatch"
,
tags
=
{
"
RemoveBatch
"
},
notes
=
"RemoveBatch"
)
@ApiOperation
(
value
=
"RemoveBatch"
,
tags
=
{
"
IBZDepartment
"
},
notes
=
"RemoveBatch"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzdepartments/remove
batch"
)
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/ibzdepartments/
batch"
)
public
ResponseEntity
<
Boolean
>
removeBatch
(
@RequestBody
List
<
String
>
ids
)
{
public
ResponseEntity
<
Boolean
>
removeBatch
(
@RequestBody
List
<
String
>
ids
)
{
ibzdepartmentService
.
removeBatch
(
ids
);
ibzdepartmentService
.
removeBatch
(
ids
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
...
@@ -154,8 +154,8 @@ public class IBZDepartmentResource {
...
@@ -154,8 +154,8 @@ public class IBZDepartmentResource {
}
}
@PreAuthorize
(
"hasPermission(#ibzdepartment_id,'Update',{this.getEntity(),'Sql'})"
)
@PreAuthorize
(
"hasPermission(#ibzdepartment_id,'Update',{this.getEntity(),'Sql'})"
)
@ApiOperation
(
value
=
"UpdateBatch"
,
tags
=
{
"
UpdateBatch
"
},
notes
=
"UpdateBatch"
)
@ApiOperation
(
value
=
"UpdateBatch"
,
tags
=
{
"
IBZDepartment
"
},
notes
=
"UpdateBatch"
)
@RequestMapping
(
method
=
RequestMethod
.
P
OST
,
value
=
"/ibzdepartments/update
batch"
)
@RequestMapping
(
method
=
RequestMethod
.
P
UT
,
value
=
"/ibzdepartments/
batch"
)
public
ResponseEntity
<
Boolean
>
updateBatch
(
@RequestBody
List
<
IBZDepartmentDTO
>
ibzdepartmentdtos
)
{
public
ResponseEntity
<
Boolean
>
updateBatch
(
@RequestBody
List
<
IBZDepartmentDTO
>
ibzdepartmentdtos
)
{
ibzdepartmentService
.
updateBatch
(
ibzdepartmentMapping
.
toDomain
(
ibzdepartmentdtos
));
ibzdepartmentService
.
updateBatch
(
ibzdepartmentMapping
.
toDomain
(
ibzdepartmentdtos
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
...
@@ -207,7 +207,7 @@ public class IBZDepartmentResource {
...
@@ -207,7 +207,7 @@ public class IBZDepartmentResource {
@ApiOperation
(
value
=
"CreateByIBZOrganization"
,
tags
=
{
"IBZDepartment
ByIBZOrganization
"
},
notes
=
"CreateByIBZOrganization"
)
@ApiOperation
(
value
=
"CreateByIBZOrganization"
,
tags
=
{
"IBZDepartment"
},
notes
=
"CreateByIBZOrganization"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzdepartments"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzdepartments"
)
@Transactional
@Transactional
public
ResponseEntity
<
IBZDepartmentDTO
>
createByIBZOrganization
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@RequestBody
IBZDepartmentDTO
ibzdepartmentdto
)
{
public
ResponseEntity
<
IBZDepartmentDTO
>
createByIBZOrganization
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@RequestBody
IBZDepartmentDTO
ibzdepartmentdto
)
{
...
@@ -218,8 +218,8 @@ public class IBZDepartmentResource {
...
@@ -218,8 +218,8 @@ public class IBZDepartmentResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
}
@ApiOperation
(
value
=
"createBatchByIBZOrganization"
,
tags
=
{
"
createBatchByIBZOrganization
"
},
notes
=
"createBatchByIBZOrganization"
)
@ApiOperation
(
value
=
"createBatchByIBZOrganization"
,
tags
=
{
"
IBZDepartment
"
},
notes
=
"createBatchByIBZOrganization"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzdepartments/
create
batch"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzdepartments/batch"
)
public
ResponseEntity
<
Boolean
>
createBatchByIBZOrganization
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@RequestBody
List
<
IBZDepartmentDTO
>
ibzdepartmentdtos
)
{
public
ResponseEntity
<
Boolean
>
createBatchByIBZOrganization
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@RequestBody
List
<
IBZDepartmentDTO
>
ibzdepartmentdtos
)
{
List
<
IBZDepartment
>
domainlist
=
ibzdepartmentMapping
.
toDomain
(
ibzdepartmentdtos
);
List
<
IBZDepartment
>
domainlist
=
ibzdepartmentMapping
.
toDomain
(
ibzdepartmentdtos
);
for
(
IBZDepartment
domain:
domainlist
){
for
(
IBZDepartment
domain:
domainlist
){
...
@@ -229,7 +229,7 @@ public class IBZDepartmentResource {
...
@@ -229,7 +229,7 @@ public class IBZDepartmentResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
}
@ApiOperation
(
value
=
"GetByIBZOrganization"
,
tags
=
{
"IBZDepartment
ByIBZOrganization
"
},
notes
=
"GetByIBZOrganization"
)
@ApiOperation
(
value
=
"GetByIBZOrganization"
,
tags
=
{
"IBZDepartment"
},
notes
=
"GetByIBZOrganization"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}"
)
public
ResponseEntity
<
IBZDepartmentDTO
>
getByIBZOrganization
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@PathVariable
(
"ibzdepartment_id"
)
String
ibzdepartment_id
)
{
public
ResponseEntity
<
IBZDepartmentDTO
>
getByIBZOrganization
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@PathVariable
(
"ibzdepartment_id"
)
String
ibzdepartment_id
)
{
IBZDepartment
domain
=
ibzdepartmentService
.
get
(
ibzdepartment_id
);
IBZDepartment
domain
=
ibzdepartmentService
.
get
(
ibzdepartment_id
);
...
@@ -237,7 +237,7 @@ public class IBZDepartmentResource {
...
@@ -237,7 +237,7 @@ public class IBZDepartmentResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
}
@ApiOperation
(
value
=
"SaveByIBZOrganization"
,
tags
=
{
"IBZDepartment
ByIBZOrganization
"
},
notes
=
"SaveByIBZOrganization"
)
@ApiOperation
(
value
=
"SaveByIBZOrganization"
,
tags
=
{
"IBZDepartment"
},
notes
=
"SaveByIBZOrganization"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzdepartments/save"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzdepartments/save"
)
public
ResponseEntity
<
Boolean
>
saveByIBZOrganization
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@RequestBody
IBZDepartmentDTO
ibzdepartmentdto
)
{
public
ResponseEntity
<
Boolean
>
saveByIBZOrganization
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@RequestBody
IBZDepartmentDTO
ibzdepartmentdto
)
{
IBZDepartment
domain
=
ibzdepartmentMapping
.
toDomain
(
ibzdepartmentdto
);
IBZDepartment
domain
=
ibzdepartmentMapping
.
toDomain
(
ibzdepartmentdto
);
...
@@ -245,7 +245,7 @@ public class IBZDepartmentResource {
...
@@ -245,7 +245,7 @@ public class IBZDepartmentResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ibzdepartmentService
.
save
(
domain
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ibzdepartmentService
.
save
(
domain
));
}
}
@ApiOperation
(
value
=
"SaveBatchByIBZOrganization"
,
tags
=
{
"
SaveBatchByIBZOrganization
"
},
notes
=
"SaveBatchByIBZOrganization"
)
@ApiOperation
(
value
=
"SaveBatchByIBZOrganization"
,
tags
=
{
"
IBZDepartment
"
},
notes
=
"SaveBatchByIBZOrganization"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzdepartments/savebatch"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzdepartments/savebatch"
)
public
ResponseEntity
<
Boolean
>
saveBatchByIBZOrganization
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@RequestBody
List
<
IBZDepartmentDTO
>
ibzdepartmentdtos
)
{
public
ResponseEntity
<
Boolean
>
saveBatchByIBZOrganization
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@RequestBody
List
<
IBZDepartmentDTO
>
ibzdepartmentdtos
)
{
List
<
IBZDepartment
>
domainlist
=
ibzdepartmentMapping
.
toDomain
(
ibzdepartmentdtos
);
List
<
IBZDepartment
>
domainlist
=
ibzdepartmentMapping
.
toDomain
(
ibzdepartmentdtos
);
...
@@ -256,13 +256,13 @@ public class IBZDepartmentResource {
...
@@ -256,13 +256,13 @@ public class IBZDepartmentResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
}
@ApiOperation
(
value
=
"CheckKeyByIBZOrganization"
,
tags
=
{
"IBZDepartment
ByIBZOrganization
"
},
notes
=
"CheckKeyByIBZOrganization"
)
@ApiOperation
(
value
=
"CheckKeyByIBZOrganization"
,
tags
=
{
"IBZDepartment"
},
notes
=
"CheckKeyByIBZOrganization"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzdepartments/checkkey"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzdepartments/checkkey"
)
public
ResponseEntity
<
Boolean
>
checkKeyByIBZOrganization
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@RequestBody
IBZDepartmentDTO
ibzdepartmentdto
)
{
public
ResponseEntity
<
Boolean
>
checkKeyByIBZOrganization
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@RequestBody
IBZDepartmentDTO
ibzdepartmentdto
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ibzdepartmentService
.
checkKey
(
ibzdepartmentMapping
.
toDomain
(
ibzdepartmentdto
)));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ibzdepartmentService
.
checkKey
(
ibzdepartmentMapping
.
toDomain
(
ibzdepartmentdto
)));
}
}
@ApiOperation
(
value
=
"GetDraftByIBZOrganization"
,
tags
=
{
"IBZDepartment
ByIBZOrganization
"
},
notes
=
"GetDraftByIBZOrganization"
)
@ApiOperation
(
value
=
"GetDraftByIBZOrganization"
,
tags
=
{
"IBZDepartment"
},
notes
=
"GetDraftByIBZOrganization"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzdepartments/getdraft"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzdepartments/getdraft"
)
public
ResponseEntity
<
IBZDepartmentDTO
>
getDraftByIBZOrganization
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
)
{
public
ResponseEntity
<
IBZDepartmentDTO
>
getDraftByIBZOrganization
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
)
{
IBZDepartment
domain
=
new
IBZDepartment
();
IBZDepartment
domain
=
new
IBZDepartment
();
...
@@ -270,21 +270,21 @@ public class IBZDepartmentResource {
...
@@ -270,21 +270,21 @@ public class IBZDepartmentResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ibzdepartmentMapping
.
toDto
(
ibzdepartmentService
.
getDraft
(
domain
)));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ibzdepartmentMapping
.
toDto
(
ibzdepartmentService
.
getDraft
(
domain
)));
}
}
@ApiOperation
(
value
=
"RemoveByIBZOrganization"
,
tags
=
{
"IBZDepartment
ByIBZOrganization
"
},
notes
=
"RemoveByIBZOrganization"
)
@ApiOperation
(
value
=
"RemoveByIBZOrganization"
,
tags
=
{
"IBZDepartment"
},
notes
=
"RemoveByIBZOrganization"
)
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}"
)
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}"
)
@Transactional
@Transactional
public
ResponseEntity
<
Boolean
>
removeByIBZOrganization
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@PathVariable
(
"ibzdepartment_id"
)
String
ibzdepartment_id
)
{
public
ResponseEntity
<
Boolean
>
removeByIBZOrganization
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@PathVariable
(
"ibzdepartment_id"
)
String
ibzdepartment_id
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ibzdepartmentService
.
remove
(
ibzdepartment_id
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ibzdepartmentService
.
remove
(
ibzdepartment_id
));
}
}
@ApiOperation
(
value
=
"RemoveBatchByIBZOrganization"
,
tags
=
{
"
RemoveBatchByIBZOrganization
"
},
notes
=
"RemoveBatchByIBZOrganization"
)
@ApiOperation
(
value
=
"RemoveBatchByIBZOrganization"
,
tags
=
{
"
IBZDepartment
"
},
notes
=
"RemoveBatchByIBZOrganization"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzdepartments/remove
batch"
)
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzdepartments/
batch"
)
public
ResponseEntity
<
Boolean
>
removeBatchByIBZOrganization
(
@RequestBody
List
<
String
>
ids
)
{
public
ResponseEntity
<
Boolean
>
removeBatchByIBZOrganization
(
@RequestBody
List
<
String
>
ids
)
{
ibzdepartmentService
.
removeBatch
(
ids
);
ibzdepartmentService
.
removeBatch
(
ids
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
}
@ApiOperation
(
value
=
"UpdateByIBZOrganization"
,
tags
=
{
"IBZDepartment
ByIBZOrganization
"
},
notes
=
"UpdateByIBZOrganization"
)
@ApiOperation
(
value
=
"UpdateByIBZOrganization"
,
tags
=
{
"IBZDepartment"
},
notes
=
"UpdateByIBZOrganization"
)
@RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}"
)
@RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}"
)
@Transactional
@Transactional
public
ResponseEntity
<
IBZDepartmentDTO
>
updateByIBZOrganization
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@PathVariable
(
"ibzdepartment_id"
)
String
ibzdepartment_id
,
@RequestBody
IBZDepartmentDTO
ibzdepartmentdto
)
{
public
ResponseEntity
<
IBZDepartmentDTO
>
updateByIBZOrganization
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@PathVariable
(
"ibzdepartment_id"
)
String
ibzdepartment_id
,
@RequestBody
IBZDepartmentDTO
ibzdepartmentdto
)
{
...
@@ -296,8 +296,8 @@ public class IBZDepartmentResource {
...
@@ -296,8 +296,8 @@ public class IBZDepartmentResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
}
@ApiOperation
(
value
=
"UpdateBatchByIBZOrganization"
,
tags
=
{
"
UpdateBatchByIBZOrganization
"
},
notes
=
"UpdateBatchByIBZOrganization"
)
@ApiOperation
(
value
=
"UpdateBatchByIBZOrganization"
,
tags
=
{
"
IBZDepartment
"
},
notes
=
"UpdateBatchByIBZOrganization"
)
@RequestMapping
(
method
=
RequestMethod
.
P
OST
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzdepartments/update
batch"
)
@RequestMapping
(
method
=
RequestMethod
.
P
UT
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzdepartments/
batch"
)
public
ResponseEntity
<
Boolean
>
updateBatchByIBZOrganization
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@RequestBody
List
<
IBZDepartmentDTO
>
ibzdepartmentdtos
)
{
public
ResponseEntity
<
Boolean
>
updateBatchByIBZOrganization
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@RequestBody
List
<
IBZDepartmentDTO
>
ibzdepartmentdtos
)
{
List
<
IBZDepartment
>
domainlist
=
ibzdepartmentMapping
.
toDomain
(
ibzdepartmentdtos
);
List
<
IBZDepartment
>
domainlist
=
ibzdepartmentMapping
.
toDomain
(
ibzdepartmentdtos
);
for
(
IBZDepartment
domain:
domainlist
){
for
(
IBZDepartment
domain:
domainlist
){
...
@@ -307,7 +307,7 @@ public class IBZDepartmentResource {
...
@@ -307,7 +307,7 @@ public class IBZDepartmentResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
}
@ApiOperation
(
value
=
"fetchCurDeptByIBZOrganization"
,
tags
=
{
"IBZDepartment
ByIBZOrganization
"
}
,
notes
=
"fetchCurDeptByIBZOrganization"
)
@ApiOperation
(
value
=
"fetchCurDeptByIBZOrganization"
,
tags
=
{
"IBZDepartment"
}
,
notes
=
"fetchCurDeptByIBZOrganization"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzdepartments/fetchcurdept"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzdepartments/fetchcurdept"
)
public
ResponseEntity
<
List
<
IBZDepartmentDTO
>>
fetchIBZDepartmentCurDeptByIBZOrganization
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
IBZDepartmentSearchContext
context
)
{
public
ResponseEntity
<
List
<
IBZDepartmentDTO
>>
fetchIBZDepartmentCurDeptByIBZOrganization
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
IBZDepartmentSearchContext
context
)
{
context
.
setN_orgid_eq
(
ibzorganization_id
);
context
.
setN_orgid_eq
(
ibzorganization_id
);
...
@@ -320,7 +320,7 @@ public class IBZDepartmentResource {
...
@@ -320,7 +320,7 @@ public class IBZDepartmentResource {
.
body
(
list
);
.
body
(
list
);
}
}
@ApiOperation
(
value
=
"searchCurDeptByIBZOrganization"
,
tags
=
{
"IBZDepartment
ByIBZOrganization
"
}
,
notes
=
"searchCurDeptByIBZOrganization"
)
@ApiOperation
(
value
=
"searchCurDeptByIBZOrganization"
,
tags
=
{
"IBZDepartment"
}
,
notes
=
"searchCurDeptByIBZOrganization"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzdepartments/searchcurdept"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzdepartments/searchcurdept"
)
public
ResponseEntity
<
Page
<
IBZDepartmentDTO
>>
searchIBZDepartmentCurDeptByIBZOrganization
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
IBZDepartmentSearchContext
context
)
{
public
ResponseEntity
<
Page
<
IBZDepartmentDTO
>>
searchIBZDepartmentCurDeptByIBZOrganization
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
IBZDepartmentSearchContext
context
)
{
context
.
setN_orgid_eq
(
ibzorganization_id
);
context
.
setN_orgid_eq
(
ibzorganization_id
);
...
@@ -329,7 +329,7 @@ public class IBZDepartmentResource {
...
@@ -329,7 +329,7 @@ public class IBZDepartmentResource {
.
body
(
new
PageImpl
(
ibzdepartmentMapping
.
toDto
(
domains
.
getContent
()),
context
.
getPageable
(),
domains
.
getTotalElements
()));
.
body
(
new
PageImpl
(
ibzdepartmentMapping
.
toDto
(
domains
.
getContent
()),
context
.
getPageable
(),
domains
.
getTotalElements
()));
}
}
@ApiOperation
(
value
=
"fetchDEFAULTByIBZOrganization"
,
tags
=
{
"IBZDepartment
ByIBZOrganization
"
}
,
notes
=
"fetchDEFAULTByIBZOrganization"
)
@ApiOperation
(
value
=
"fetchDEFAULTByIBZOrganization"
,
tags
=
{
"IBZDepartment"
}
,
notes
=
"fetchDEFAULTByIBZOrganization"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzdepartments/fetchdefault"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzdepartments/fetchdefault"
)
public
ResponseEntity
<
List
<
IBZDepartmentDTO
>>
fetchIBZDepartmentDefaultByIBZOrganization
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
IBZDepartmentSearchContext
context
)
{
public
ResponseEntity
<
List
<
IBZDepartmentDTO
>>
fetchIBZDepartmentDefaultByIBZOrganization
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
IBZDepartmentSearchContext
context
)
{
context
.
setN_orgid_eq
(
ibzorganization_id
);
context
.
setN_orgid_eq
(
ibzorganization_id
);
...
@@ -342,7 +342,7 @@ public class IBZDepartmentResource {
...
@@ -342,7 +342,7 @@ public class IBZDepartmentResource {
.
body
(
list
);
.
body
(
list
);
}
}
@ApiOperation
(
value
=
"searchDEFAULTByIBZOrganization"
,
tags
=
{
"IBZDepartment
ByIBZOrganization
"
}
,
notes
=
"searchDEFAULTByIBZOrganization"
)
@ApiOperation
(
value
=
"searchDEFAULTByIBZOrganization"
,
tags
=
{
"IBZDepartment"
}
,
notes
=
"searchDEFAULTByIBZOrganization"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzdepartments/searchdefault"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzdepartments/searchdefault"
)
public
ResponseEntity
<
Page
<
IBZDepartmentDTO
>>
searchIBZDepartmentDefaultByIBZOrganization
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
IBZDepartmentSearchContext
context
)
{
public
ResponseEntity
<
Page
<
IBZDepartmentDTO
>>
searchIBZDepartmentDefaultByIBZOrganization
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
IBZDepartmentSearchContext
context
)
{
context
.
setN_orgid_eq
(
ibzorganization_id
);
context
.
setN_orgid_eq
(
ibzorganization_id
);
...
...
ibzou-provider/ibzou-provider-api/src/main/java/cn/ibizlab/api/rest/IBZEmployeeResource.java
浏览文件 @
a31915b3
...
@@ -63,8 +63,8 @@ public class IBZEmployeeResource {
...
@@ -63,8 +63,8 @@ public class IBZEmployeeResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ibzemployeeService
.
remove
(
ibzemployee_id
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ibzemployeeService
.
remove
(
ibzemployee_id
));
}
}
@ApiOperation
(
value
=
"RemoveBatch"
,
tags
=
{
"
RemoveBatch
"
},
notes
=
"RemoveBatch"
)
@ApiOperation
(
value
=
"RemoveBatch"
,
tags
=
{
"
IBZEmployee
"
},
notes
=
"RemoveBatch"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzemployees/remove
batch"
)
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/ibzemployees/
batch"
)
public
ResponseEntity
<
Boolean
>
removeBatch
(
@RequestBody
List
<
String
>
ids
)
{
public
ResponseEntity
<
Boolean
>
removeBatch
(
@RequestBody
List
<
String
>
ids
)
{
ibzemployeeService
.
removeBatch
(
ids
);
ibzemployeeService
.
removeBatch
(
ids
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
...
@@ -98,8 +98,8 @@ public class IBZEmployeeResource {
...
@@ -98,8 +98,8 @@ public class IBZEmployeeResource {
}
}
@PreAuthorize
(
"hasPermission('','Create',{this.getEntity(),'Sql'})"
)
@PreAuthorize
(
"hasPermission('','Create',{this.getEntity(),'Sql'})"
)
@ApiOperation
(
value
=
"createBatch"
,
tags
=
{
"
createBatch
"
},
notes
=
"createBatch"
)
@ApiOperation
(
value
=
"createBatch"
,
tags
=
{
"
IBZEmployee
"
},
notes
=
"createBatch"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzemployees/
create
batch"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzemployees/batch"
)
public
ResponseEntity
<
Boolean
>
createBatch
(
@RequestBody
List
<
IBZEmployeeDTO
>
ibzemployeedtos
)
{
public
ResponseEntity
<
Boolean
>
createBatch
(
@RequestBody
List
<
IBZEmployeeDTO
>
ibzemployeedtos
)
{
ibzemployeeService
.
createBatch
(
ibzemployeeMapping
.
toDomain
(
ibzemployeedtos
));
ibzemployeeService
.
createBatch
(
ibzemployeeMapping
.
toDomain
(
ibzemployeedtos
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
...
@@ -130,8 +130,8 @@ public class IBZEmployeeResource {
...
@@ -130,8 +130,8 @@ public class IBZEmployeeResource {
}
}
@PreAuthorize
(
"hasPermission(#ibzemployee_id,'Update',{this.getEntity(),'Sql'})"
)
@PreAuthorize
(
"hasPermission(#ibzemployee_id,'Update',{this.getEntity(),'Sql'})"
)
@ApiOperation
(
value
=
"UpdateBatch"
,
tags
=
{
"
UpdateBatch
"
},
notes
=
"UpdateBatch"
)
@ApiOperation
(
value
=
"UpdateBatch"
,
tags
=
{
"
IBZEmployee
"
},
notes
=
"UpdateBatch"
)
@RequestMapping
(
method
=
RequestMethod
.
P
OST
,
value
=
"/ibzemployees/update
batch"
)
@RequestMapping
(
method
=
RequestMethod
.
P
UT
,
value
=
"/ibzemployees/
batch"
)
public
ResponseEntity
<
Boolean
>
updateBatch
(
@RequestBody
List
<
IBZEmployeeDTO
>
ibzemployeedtos
)
{
public
ResponseEntity
<
Boolean
>
updateBatch
(
@RequestBody
List
<
IBZEmployeeDTO
>
ibzemployeedtos
)
{
ibzemployeeService
.
updateBatch
(
ibzemployeeMapping
.
toDomain
(
ibzemployeedtos
));
ibzemployeeService
.
updateBatch
(
ibzemployeeMapping
.
toDomain
(
ibzemployeedtos
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
...
@@ -146,7 +146,7 @@ public class IBZEmployeeResource {
...
@@ -146,7 +146,7 @@ public class IBZEmployeeResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ibzemployeeService
.
save
(
ibzemployeeMapping
.
toDomain
(
ibzemployeedto
)));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ibzemployeeService
.
save
(
ibzemployeeMapping
.
toDomain
(
ibzemployeedto
)));
}
}
@ApiOperation
(
value
=
"SaveBatch"
,
tags
=
{
"
SaveBatch
"
},
notes
=
"SaveBatch"
)
@ApiOperation
(
value
=
"SaveBatch"
,
tags
=
{
"
IBZEmployee
"
},
notes
=
"SaveBatch"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzemployees/savebatch"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzemployees/savebatch"
)
public
ResponseEntity
<
Boolean
>
saveBatch
(
@RequestBody
List
<
IBZEmployeeDTO
>
ibzemployeedtos
)
{
public
ResponseEntity
<
Boolean
>
saveBatch
(
@RequestBody
List
<
IBZEmployeeDTO
>
ibzemployeedtos
)
{
ibzemployeeService
.
saveBatch
(
ibzemployeeMapping
.
toDomain
(
ibzemployeedtos
));
ibzemployeeService
.
saveBatch
(
ibzemployeeMapping
.
toDomain
(
ibzemployeedtos
));
...
@@ -198,21 +198,21 @@ public class IBZEmployeeResource {
...
@@ -198,21 +198,21 @@ public class IBZEmployeeResource {
@ApiOperation
(
value
=
"RemoveByIBZDepartment"
,
tags
=
{
"IBZEmployee
ByIBZDepartment
"
},
notes
=
"RemoveByIBZDepartment"
)
@ApiOperation
(
value
=
"RemoveByIBZDepartment"
,
tags
=
{
"IBZEmployee"
},
notes
=
"RemoveByIBZDepartment"
)
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/ibzdepartments/{ibzdepartment_id}/ibzemployees/{ibzemployee_id}"
)
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/ibzdepartments/{ibzdepartment_id}/ibzemployees/{ibzemployee_id}"
)
@Transactional
@Transactional
public
ResponseEntity
<
Boolean
>
removeByIBZDepartment
(
@PathVariable
(
"ibzdepartment_id"
)
String
ibzdepartment_id
,
@PathVariable
(
"ibzemployee_id"
)
String
ibzemployee_id
)
{
public
ResponseEntity
<
Boolean
>
removeByIBZDepartment
(
@PathVariable
(
"ibzdepartment_id"
)
String
ibzdepartment_id
,
@PathVariable
(
"ibzemployee_id"
)
String
ibzemployee_id
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ibzemployeeService
.
remove
(
ibzemployee_id
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ibzemployeeService
.
remove
(
ibzemployee_id
));
}
}
@ApiOperation
(
value
=
"RemoveBatchByIBZDepartment"
,
tags
=
{
"
RemoveBatchByIBZDepartment
"
},
notes
=
"RemoveBatchByIBZDepartment"
)
@ApiOperation
(
value
=
"RemoveBatchByIBZDepartment"
,
tags
=
{
"
IBZEmployee
"
},
notes
=
"RemoveBatchByIBZDepartment"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzdepartments/{ibzdepartment_id}/ibzemployees/remove
batch"
)
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/ibzdepartments/{ibzdepartment_id}/ibzemployees/
batch"
)
public
ResponseEntity
<
Boolean
>
removeBatchByIBZDepartment
(
@RequestBody
List
<
String
>
ids
)
{
public
ResponseEntity
<
Boolean
>
removeBatchByIBZDepartment
(
@RequestBody
List
<
String
>
ids
)
{
ibzemployeeService
.
removeBatch
(
ids
);
ibzemployeeService
.
removeBatch
(
ids
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
}
@ApiOperation
(
value
=
"初始化密码ByIBZDepartment"
,
tags
=
{
"IBZEmployee
ByIBZDepartment
"
},
notes
=
"初始化密码ByIBZDepartment"
)
@ApiOperation
(
value
=
"初始化密码ByIBZDepartment"
,
tags
=
{
"IBZEmployee"
},
notes
=
"初始化密码ByIBZDepartment"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzdepartments/{ibzdepartment_id}/ibzemployees/{ibzemployeeuserid}/initpwd"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzdepartments/{ibzdepartment_id}/ibzemployees/{ibzemployeeuserid}/initpwd"
)
@Transactional
@Transactional
public
ResponseEntity
<
IBZEmployeeDTO
>
initPwdByIBZDepartment
(
@PathVariable
(
"ibzdepartment_id"
)
String
ibzdepartment_id
,
@PathVariable
(
"ibzemployee_id"
)
String
ibzemployee_id
,
@RequestBody
IBZEmployeeDTO
ibzemployeedto
)
{
public
ResponseEntity
<
IBZEmployeeDTO
>
initPwdByIBZDepartment
(
@PathVariable
(
"ibzdepartment_id"
)
String
ibzdepartment_id
,
@PathVariable
(
"ibzemployee_id"
)
String
ibzemployee_id
,
@RequestBody
IBZEmployeeDTO
ibzemployeedto
)
{
...
@@ -223,7 +223,7 @@ public class IBZEmployeeResource {
...
@@ -223,7 +223,7 @@ public class IBZEmployeeResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ibzemployeedto
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ibzemployeedto
);
}
}
@ApiOperation
(
value
=
"CreateByIBZDepartment"
,
tags
=
{
"IBZEmployee
ByIBZDepartment
"
},
notes
=
"CreateByIBZDepartment"
)
@ApiOperation
(
value
=
"CreateByIBZDepartment"
,
tags
=
{
"IBZEmployee"
},
notes
=
"CreateByIBZDepartment"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzdepartments/{ibzdepartment_id}/ibzemployees"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzdepartments/{ibzdepartment_id}/ibzemployees"
)
@Transactional
@Transactional
public
ResponseEntity
<
IBZEmployeeDTO
>
createByIBZDepartment
(
@PathVariable
(
"ibzdepartment_id"
)
String
ibzdepartment_id
,
@RequestBody
IBZEmployeeDTO
ibzemployeedto
)
{
public
ResponseEntity
<
IBZEmployeeDTO
>
createByIBZDepartment
(
@PathVariable
(
"ibzdepartment_id"
)
String
ibzdepartment_id
,
@RequestBody
IBZEmployeeDTO
ibzemployeedto
)
{
...
@@ -234,8 +234,8 @@ public class IBZEmployeeResource {
...
@@ -234,8 +234,8 @@ public class IBZEmployeeResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
}
@ApiOperation
(
value
=
"createBatchByIBZDepartment"
,
tags
=
{
"
createBatchByIBZDepartment
"
},
notes
=
"createBatchByIBZDepartment"
)
@ApiOperation
(
value
=
"createBatchByIBZDepartment"
,
tags
=
{
"
IBZEmployee
"
},
notes
=
"createBatchByIBZDepartment"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzdepartments/{ibzdepartment_id}/ibzemployees/
create
batch"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzdepartments/{ibzdepartment_id}/ibzemployees/batch"
)
public
ResponseEntity
<
Boolean
>
createBatchByIBZDepartment
(
@PathVariable
(
"ibzdepartment_id"
)
String
ibzdepartment_id
,
@RequestBody
List
<
IBZEmployeeDTO
>
ibzemployeedtos
)
{
public
ResponseEntity
<
Boolean
>
createBatchByIBZDepartment
(
@PathVariable
(
"ibzdepartment_id"
)
String
ibzdepartment_id
,
@RequestBody
List
<
IBZEmployeeDTO
>
ibzemployeedtos
)
{
List
<
IBZEmployee
>
domainlist
=
ibzemployeeMapping
.
toDomain
(
ibzemployeedtos
);
List
<
IBZEmployee
>
domainlist
=
ibzemployeeMapping
.
toDomain
(
ibzemployeedtos
);
for
(
IBZEmployee
domain:
domainlist
){
for
(
IBZEmployee
domain:
domainlist
){
...
@@ -245,13 +245,13 @@ public class IBZEmployeeResource {
...
@@ -245,13 +245,13 @@ public class IBZEmployeeResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
}
@ApiOperation
(
value
=
"CheckKeyByIBZDepartment"
,
tags
=
{
"IBZEmployee
ByIBZDepartment
"
},
notes
=
"CheckKeyByIBZDepartment"
)
@ApiOperation
(
value
=
"CheckKeyByIBZDepartment"
,
tags
=
{
"IBZEmployee"
},
notes
=
"CheckKeyByIBZDepartment"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzdepartments/{ibzdepartment_id}/ibzemployees/checkkey"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzdepartments/{ibzdepartment_id}/ibzemployees/checkkey"
)
public
ResponseEntity
<
Boolean
>
checkKeyByIBZDepartment
(
@PathVariable
(
"ibzdepartment_id"
)
String
ibzdepartment_id
,
@RequestBody
IBZEmployeeDTO
ibzemployeedto
)
{
public
ResponseEntity
<
Boolean
>
checkKeyByIBZDepartment
(
@PathVariable
(
"ibzdepartment_id"
)
String
ibzdepartment_id
,
@RequestBody
IBZEmployeeDTO
ibzemployeedto
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ibzemployeeService
.
checkKey
(
ibzemployeeMapping
.
toDomain
(
ibzemployeedto
)));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ibzemployeeService
.
checkKey
(
ibzemployeeMapping
.
toDomain
(
ibzemployeedto
)));
}
}
@ApiOperation
(
value
=
"UpdateByIBZDepartment"
,
tags
=
{
"IBZEmployee
ByIBZDepartment
"
},
notes
=
"UpdateByIBZDepartment"
)
@ApiOperation
(
value
=
"UpdateByIBZDepartment"
,
tags
=
{
"IBZEmployee"
},
notes
=
"UpdateByIBZDepartment"
)
@RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/ibzdepartments/{ibzdepartment_id}/ibzemployees/{ibzemployee_id}"
)
@RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/ibzdepartments/{ibzdepartment_id}/ibzemployees/{ibzemployee_id}"
)
@Transactional
@Transactional
public
ResponseEntity
<
IBZEmployeeDTO
>
updateByIBZDepartment
(
@PathVariable
(
"ibzdepartment_id"
)
String
ibzdepartment_id
,
@PathVariable
(
"ibzemployee_id"
)
String
ibzemployee_id
,
@RequestBody
IBZEmployeeDTO
ibzemployeedto
)
{
public
ResponseEntity
<
IBZEmployeeDTO
>
updateByIBZDepartment
(
@PathVariable
(
"ibzdepartment_id"
)
String
ibzdepartment_id
,
@PathVariable
(
"ibzemployee_id"
)
String
ibzemployee_id
,
@RequestBody
IBZEmployeeDTO
ibzemployeedto
)
{
...
@@ -263,8 +263,8 @@ public class IBZEmployeeResource {
...
@@ -263,8 +263,8 @@ public class IBZEmployeeResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
}
@ApiOperation
(
value
=
"UpdateBatchByIBZDepartment"
,
tags
=
{
"
UpdateBatchByIBZDepartment
"
},
notes
=
"UpdateBatchByIBZDepartment"
)
@ApiOperation
(
value
=
"UpdateBatchByIBZDepartment"
,
tags
=
{
"
IBZEmployee
"
},
notes
=
"UpdateBatchByIBZDepartment"
)
@RequestMapping
(
method
=
RequestMethod
.
P
OST
,
value
=
"/ibzdepartments/{ibzdepartment_id}/ibzemployees/update
batch"
)
@RequestMapping
(
method
=
RequestMethod
.
P
UT
,
value
=
"/ibzdepartments/{ibzdepartment_id}/ibzemployees/
batch"
)
public
ResponseEntity
<
Boolean
>
updateBatchByIBZDepartment
(
@PathVariable
(
"ibzdepartment_id"
)
String
ibzdepartment_id
,
@RequestBody
List
<
IBZEmployeeDTO
>
ibzemployeedtos
)
{
public
ResponseEntity
<
Boolean
>
updateBatchByIBZDepartment
(
@PathVariable
(
"ibzdepartment_id"
)
String
ibzdepartment_id
,
@RequestBody
List
<
IBZEmployeeDTO
>
ibzemployeedtos
)
{
List
<
IBZEmployee
>
domainlist
=
ibzemployeeMapping
.
toDomain
(
ibzemployeedtos
);
List
<
IBZEmployee
>
domainlist
=
ibzemployeeMapping
.
toDomain
(
ibzemployeedtos
);
for
(
IBZEmployee
domain:
domainlist
){
for
(
IBZEmployee
domain:
domainlist
){
...
@@ -274,7 +274,7 @@ public class IBZEmployeeResource {
...
@@ -274,7 +274,7 @@ public class IBZEmployeeResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
}
@ApiOperation
(
value
=
"SaveByIBZDepartment"
,
tags
=
{
"IBZEmployee
ByIBZDepartment
"
},
notes
=
"SaveByIBZDepartment"
)
@ApiOperation
(
value
=
"SaveByIBZDepartment"
,
tags
=
{
"IBZEmployee"
},
notes
=
"SaveByIBZDepartment"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzdepartments/{ibzdepartment_id}/ibzemployees/save"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzdepartments/{ibzdepartment_id}/ibzemployees/save"
)
public
ResponseEntity
<
Boolean
>
saveByIBZDepartment
(
@PathVariable
(
"ibzdepartment_id"
)
String
ibzdepartment_id
,
@RequestBody
IBZEmployeeDTO
ibzemployeedto
)
{
public
ResponseEntity
<
Boolean
>
saveByIBZDepartment
(
@PathVariable
(
"ibzdepartment_id"
)
String
ibzdepartment_id
,
@RequestBody
IBZEmployeeDTO
ibzemployeedto
)
{
IBZEmployee
domain
=
ibzemployeeMapping
.
toDomain
(
ibzemployeedto
);
IBZEmployee
domain
=
ibzemployeeMapping
.
toDomain
(
ibzemployeedto
);
...
@@ -282,7 +282,7 @@ public class IBZEmployeeResource {
...
@@ -282,7 +282,7 @@ public class IBZEmployeeResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ibzemployeeService
.
save
(
domain
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ibzemployeeService
.
save
(
domain
));
}
}
@ApiOperation
(
value
=
"SaveBatchByIBZDepartment"
,
tags
=
{
"
SaveBatchByIBZDepartment
"
},
notes
=
"SaveBatchByIBZDepartment"
)
@ApiOperation
(
value
=
"SaveBatchByIBZDepartment"
,
tags
=
{
"
IBZEmployee
"
},
notes
=
"SaveBatchByIBZDepartment"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzdepartments/{ibzdepartment_id}/ibzemployees/savebatch"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzdepartments/{ibzdepartment_id}/ibzemployees/savebatch"
)
public
ResponseEntity
<
Boolean
>
saveBatchByIBZDepartment
(
@PathVariable
(
"ibzdepartment_id"
)
String
ibzdepartment_id
,
@RequestBody
List
<
IBZEmployeeDTO
>
ibzemployeedtos
)
{
public
ResponseEntity
<
Boolean
>
saveBatchByIBZDepartment
(
@PathVariable
(
"ibzdepartment_id"
)
String
ibzdepartment_id
,
@RequestBody
List
<
IBZEmployeeDTO
>
ibzemployeedtos
)
{
List
<
IBZEmployee
>
domainlist
=
ibzemployeeMapping
.
toDomain
(
ibzemployeedtos
);
List
<
IBZEmployee
>
domainlist
=
ibzemployeeMapping
.
toDomain
(
ibzemployeedtos
);
...
@@ -293,7 +293,7 @@ public class IBZEmployeeResource {
...
@@ -293,7 +293,7 @@ public class IBZEmployeeResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
}
@ApiOperation
(
value
=
"GetByIBZDepartment"
,
tags
=
{
"IBZEmployee
ByIBZDepartment
"
},
notes
=
"GetByIBZDepartment"
)
@ApiOperation
(
value
=
"GetByIBZDepartment"
,
tags
=
{
"IBZEmployee"
},
notes
=
"GetByIBZDepartment"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/ibzdepartments/{ibzdepartment_id}/ibzemployees/{ibzemployee_id}"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/ibzdepartments/{ibzdepartment_id}/ibzemployees/{ibzemployee_id}"
)
public
ResponseEntity
<
IBZEmployeeDTO
>
getByIBZDepartment
(
@PathVariable
(
"ibzdepartment_id"
)
String
ibzdepartment_id
,
@PathVariable
(
"ibzemployee_id"
)
String
ibzemployee_id
)
{
public
ResponseEntity
<
IBZEmployeeDTO
>
getByIBZDepartment
(
@PathVariable
(
"ibzdepartment_id"
)
String
ibzdepartment_id
,
@PathVariable
(
"ibzemployee_id"
)
String
ibzemployee_id
)
{
IBZEmployee
domain
=
ibzemployeeService
.
get
(
ibzemployee_id
);
IBZEmployee
domain
=
ibzemployeeService
.
get
(
ibzemployee_id
);
...
@@ -301,7 +301,7 @@ public class IBZEmployeeResource {
...
@@ -301,7 +301,7 @@ public class IBZEmployeeResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
}
@ApiOperation
(
value
=
"GetDraftByIBZDepartment"
,
tags
=
{
"IBZEmployee
ByIBZDepartment
"
},
notes
=
"GetDraftByIBZDepartment"
)
@ApiOperation
(
value
=
"GetDraftByIBZDepartment"
,
tags
=
{
"IBZEmployee"
},
notes
=
"GetDraftByIBZDepartment"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/ibzdepartments/{ibzdepartment_id}/ibzemployees/getdraft"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/ibzdepartments/{ibzdepartment_id}/ibzemployees/getdraft"
)
public
ResponseEntity
<
IBZEmployeeDTO
>
getDraftByIBZDepartment
(
@PathVariable
(
"ibzdepartment_id"
)
String
ibzdepartment_id
)
{
public
ResponseEntity
<
IBZEmployeeDTO
>
getDraftByIBZDepartment
(
@PathVariable
(
"ibzdepartment_id"
)
String
ibzdepartment_id
)
{
IBZEmployee
domain
=
new
IBZEmployee
();
IBZEmployee
domain
=
new
IBZEmployee
();
...
@@ -309,7 +309,7 @@ public class IBZEmployeeResource {
...
@@ -309,7 +309,7 @@ public class IBZEmployeeResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ibzemployeeMapping
.
toDto
(
ibzemployeeService
.
getDraft
(
domain
)));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ibzemployeeMapping
.
toDto
(
ibzemployeeService
.
getDraft
(
domain
)));
}
}
@ApiOperation
(
value
=
"fetchDEFAULTByIBZDepartment"
,
tags
=
{
"IBZEmployee
ByIBZDepartment
"
}
,
notes
=
"fetchDEFAULTByIBZDepartment"
)
@ApiOperation
(
value
=
"fetchDEFAULTByIBZDepartment"
,
tags
=
{
"IBZEmployee"
}
,
notes
=
"fetchDEFAULTByIBZDepartment"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/ibzdepartments/{ibzdepartment_id}/ibzemployees/fetchdefault"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/ibzdepartments/{ibzdepartment_id}/ibzemployees/fetchdefault"
)
public
ResponseEntity
<
List
<
IBZEmployeeDTO
>>
fetchIBZEmployeeDefaultByIBZDepartment
(
@PathVariable
(
"ibzdepartment_id"
)
String
ibzdepartment_id
,
IBZEmployeeSearchContext
context
)
{
public
ResponseEntity
<
List
<
IBZEmployeeDTO
>>
fetchIBZEmployeeDefaultByIBZDepartment
(
@PathVariable
(
"ibzdepartment_id"
)
String
ibzdepartment_id
,
IBZEmployeeSearchContext
context
)
{
context
.
setN_mdeptid_eq
(
ibzdepartment_id
);
context
.
setN_mdeptid_eq
(
ibzdepartment_id
);
...
@@ -322,7 +322,7 @@ public class IBZEmployeeResource {
...
@@ -322,7 +322,7 @@ public class IBZEmployeeResource {
.
body
(
list
);
.
body
(
list
);
}
}
@ApiOperation
(
value
=
"searchDEFAULTByIBZDepartment"
,
tags
=
{
"IBZEmployee
ByIBZDepartment
"
}
,
notes
=
"searchDEFAULTByIBZDepartment"
)
@ApiOperation
(
value
=
"searchDEFAULTByIBZDepartment"
,
tags
=
{
"IBZEmployee"
}
,
notes
=
"searchDEFAULTByIBZDepartment"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/ibzdepartments/{ibzdepartment_id}/ibzemployees/searchdefault"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/ibzdepartments/{ibzdepartment_id}/ibzemployees/searchdefault"
)
public
ResponseEntity
<
Page
<
IBZEmployeeDTO
>>
searchIBZEmployeeDefaultByIBZDepartment
(
@PathVariable
(
"ibzdepartment_id"
)
String
ibzdepartment_id
,
IBZEmployeeSearchContext
context
)
{
public
ResponseEntity
<
Page
<
IBZEmployeeDTO
>>
searchIBZEmployeeDefaultByIBZDepartment
(
@PathVariable
(
"ibzdepartment_id"
)
String
ibzdepartment_id
,
IBZEmployeeSearchContext
context
)
{
context
.
setN_mdeptid_eq
(
ibzdepartment_id
);
context
.
setN_mdeptid_eq
(
ibzdepartment_id
);
...
@@ -333,21 +333,21 @@ public class IBZEmployeeResource {
...
@@ -333,21 +333,21 @@ public class IBZEmployeeResource {
@ApiOperation
(
value
=
"RemoveByIBZOrganization"
,
tags
=
{
"IBZEmployee
ByIBZOrganization
"
},
notes
=
"RemoveByIBZOrganization"
)
@ApiOperation
(
value
=
"RemoveByIBZOrganization"
,
tags
=
{
"IBZEmployee"
},
notes
=
"RemoveByIBZOrganization"
)
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzemployees/{ibzemployee_id}"
)
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzemployees/{ibzemployee_id}"
)
@Transactional
@Transactional
public
ResponseEntity
<
Boolean
>
removeByIBZOrganization
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@PathVariable
(
"ibzemployee_id"
)
String
ibzemployee_id
)
{
public
ResponseEntity
<
Boolean
>
removeByIBZOrganization
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@PathVariable
(
"ibzemployee_id"
)
String
ibzemployee_id
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ibzemployeeService
.
remove
(
ibzemployee_id
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ibzemployeeService
.
remove
(
ibzemployee_id
));
}
}
@ApiOperation
(
value
=
"RemoveBatchByIBZOrganization"
,
tags
=
{
"
RemoveBatchByIBZOrganization
"
},
notes
=
"RemoveBatchByIBZOrganization"
)
@ApiOperation
(
value
=
"RemoveBatchByIBZOrganization"
,
tags
=
{
"
IBZEmployee
"
},
notes
=
"RemoveBatchByIBZOrganization"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzemployees/remove
batch"
)
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzemployees/
batch"
)
public
ResponseEntity
<
Boolean
>
removeBatchByIBZOrganization
(
@RequestBody
List
<
String
>
ids
)
{
public
ResponseEntity
<
Boolean
>
removeBatchByIBZOrganization
(
@RequestBody
List
<
String
>
ids
)
{
ibzemployeeService
.
removeBatch
(
ids
);
ibzemployeeService
.
removeBatch
(
ids
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
}
@ApiOperation
(
value
=
"初始化密码ByIBZOrganization"
,
tags
=
{
"IBZEmployee
ByIBZOrganization
"
},
notes
=
"初始化密码ByIBZOrganization"
)
@ApiOperation
(
value
=
"初始化密码ByIBZOrganization"
,
tags
=
{
"IBZEmployee"
},
notes
=
"初始化密码ByIBZOrganization"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzemployees/{ibzemployeeuserid}/initpwd"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzemployees/{ibzemployeeuserid}/initpwd"
)
@Transactional
@Transactional
public
ResponseEntity
<
IBZEmployeeDTO
>
initPwdByIBZOrganization
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@PathVariable
(
"ibzemployee_id"
)
String
ibzemployee_id
,
@RequestBody
IBZEmployeeDTO
ibzemployeedto
)
{
public
ResponseEntity
<
IBZEmployeeDTO
>
initPwdByIBZOrganization
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@PathVariable
(
"ibzemployee_id"
)
String
ibzemployee_id
,
@RequestBody
IBZEmployeeDTO
ibzemployeedto
)
{
...
@@ -358,7 +358,7 @@ public class IBZEmployeeResource {
...
@@ -358,7 +358,7 @@ public class IBZEmployeeResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ibzemployeedto
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ibzemployeedto
);
}
}
@ApiOperation
(
value
=
"CreateByIBZOrganization"
,
tags
=
{
"IBZEmployee
ByIBZOrganization
"
},
notes
=
"CreateByIBZOrganization"
)
@ApiOperation
(
value
=
"CreateByIBZOrganization"
,
tags
=
{
"IBZEmployee"
},
notes
=
"CreateByIBZOrganization"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzemployees"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzemployees"
)
@Transactional
@Transactional
public
ResponseEntity
<
IBZEmployeeDTO
>
createByIBZOrganization
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@RequestBody
IBZEmployeeDTO
ibzemployeedto
)
{
public
ResponseEntity
<
IBZEmployeeDTO
>
createByIBZOrganization
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@RequestBody
IBZEmployeeDTO
ibzemployeedto
)
{
...
@@ -369,8 +369,8 @@ public class IBZEmployeeResource {
...
@@ -369,8 +369,8 @@ public class IBZEmployeeResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
}
@ApiOperation
(
value
=
"createBatchByIBZOrganization"
,
tags
=
{
"
createBatchByIBZOrganization
"
},
notes
=
"createBatchByIBZOrganization"
)
@ApiOperation
(
value
=
"createBatchByIBZOrganization"
,
tags
=
{
"
IBZEmployee
"
},
notes
=
"createBatchByIBZOrganization"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzemployees/
create
batch"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzemployees/batch"
)
public
ResponseEntity
<
Boolean
>
createBatchByIBZOrganization
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@RequestBody
List
<
IBZEmployeeDTO
>
ibzemployeedtos
)
{
public
ResponseEntity
<
Boolean
>
createBatchByIBZOrganization
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@RequestBody
List
<
IBZEmployeeDTO
>
ibzemployeedtos
)
{
List
<
IBZEmployee
>
domainlist
=
ibzemployeeMapping
.
toDomain
(
ibzemployeedtos
);
List
<
IBZEmployee
>
domainlist
=
ibzemployeeMapping
.
toDomain
(
ibzemployeedtos
);
for
(
IBZEmployee
domain:
domainlist
){
for
(
IBZEmployee
domain:
domainlist
){
...
@@ -380,13 +380,13 @@ public class IBZEmployeeResource {
...
@@ -380,13 +380,13 @@ public class IBZEmployeeResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
}
@ApiOperation
(
value
=
"CheckKeyByIBZOrganization"
,
tags
=
{
"IBZEmployee
ByIBZOrganization
"
},
notes
=
"CheckKeyByIBZOrganization"
)
@ApiOperation
(
value
=
"CheckKeyByIBZOrganization"
,
tags
=
{
"IBZEmployee"
},
notes
=
"CheckKeyByIBZOrganization"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzemployees/checkkey"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzemployees/checkkey"
)
public
ResponseEntity
<
Boolean
>
checkKeyByIBZOrganization
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@RequestBody
IBZEmployeeDTO
ibzemployeedto
)
{
public
ResponseEntity
<
Boolean
>
checkKeyByIBZOrganization
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@RequestBody
IBZEmployeeDTO
ibzemployeedto
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ibzemployeeService
.
checkKey
(
ibzemployeeMapping
.
toDomain
(
ibzemployeedto
)));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ibzemployeeService
.
checkKey
(
ibzemployeeMapping
.
toDomain
(
ibzemployeedto
)));
}
}
@ApiOperation
(
value
=
"UpdateByIBZOrganization"
,
tags
=
{
"IBZEmployee
ByIBZOrganization
"
},
notes
=
"UpdateByIBZOrganization"
)
@ApiOperation
(
value
=
"UpdateByIBZOrganization"
,
tags
=
{
"IBZEmployee"
},
notes
=
"UpdateByIBZOrganization"
)
@RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzemployees/{ibzemployee_id}"
)
@RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzemployees/{ibzemployee_id}"
)
@Transactional
@Transactional
public
ResponseEntity
<
IBZEmployeeDTO
>
updateByIBZOrganization
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@PathVariable
(
"ibzemployee_id"
)
String
ibzemployee_id
,
@RequestBody
IBZEmployeeDTO
ibzemployeedto
)
{
public
ResponseEntity
<
IBZEmployeeDTO
>
updateByIBZOrganization
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@PathVariable
(
"ibzemployee_id"
)
String
ibzemployee_id
,
@RequestBody
IBZEmployeeDTO
ibzemployeedto
)
{
...
@@ -398,8 +398,8 @@ public class IBZEmployeeResource {
...
@@ -398,8 +398,8 @@ public class IBZEmployeeResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
}
@ApiOperation
(
value
=
"UpdateBatchByIBZOrganization"
,
tags
=
{
"
UpdateBatchByIBZOrganization
"
},
notes
=
"UpdateBatchByIBZOrganization"
)
@ApiOperation
(
value
=
"UpdateBatchByIBZOrganization"
,
tags
=
{
"
IBZEmployee
"
},
notes
=
"UpdateBatchByIBZOrganization"
)
@RequestMapping
(
method
=
RequestMethod
.
P
OST
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzemployees/update
batch"
)
@RequestMapping
(
method
=
RequestMethod
.
P
UT
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzemployees/
batch"
)
public
ResponseEntity
<
Boolean
>
updateBatchByIBZOrganization
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@RequestBody
List
<
IBZEmployeeDTO
>
ibzemployeedtos
)
{
public
ResponseEntity
<
Boolean
>
updateBatchByIBZOrganization
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@RequestBody
List
<
IBZEmployeeDTO
>
ibzemployeedtos
)
{
List
<
IBZEmployee
>
domainlist
=
ibzemployeeMapping
.
toDomain
(
ibzemployeedtos
);
List
<
IBZEmployee
>
domainlist
=
ibzemployeeMapping
.
toDomain
(
ibzemployeedtos
);
for
(
IBZEmployee
domain:
domainlist
){
for
(
IBZEmployee
domain:
domainlist
){
...
@@ -409,7 +409,7 @@ public class IBZEmployeeResource {
...
@@ -409,7 +409,7 @@ public class IBZEmployeeResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
}
@ApiOperation
(
value
=
"SaveByIBZOrganization"
,
tags
=
{
"IBZEmployee
ByIBZOrganization
"
},
notes
=
"SaveByIBZOrganization"
)
@ApiOperation
(
value
=
"SaveByIBZOrganization"
,
tags
=
{
"IBZEmployee"
},
notes
=
"SaveByIBZOrganization"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzemployees/save"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzemployees/save"
)
public
ResponseEntity
<
Boolean
>
saveByIBZOrganization
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@RequestBody
IBZEmployeeDTO
ibzemployeedto
)
{
public
ResponseEntity
<
Boolean
>
saveByIBZOrganization
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@RequestBody
IBZEmployeeDTO
ibzemployeedto
)
{
IBZEmployee
domain
=
ibzemployeeMapping
.
toDomain
(
ibzemployeedto
);
IBZEmployee
domain
=
ibzemployeeMapping
.
toDomain
(
ibzemployeedto
);
...
@@ -417,7 +417,7 @@ public class IBZEmployeeResource {
...
@@ -417,7 +417,7 @@ public class IBZEmployeeResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ibzemployeeService
.
save
(
domain
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ibzemployeeService
.
save
(
domain
));
}
}
@ApiOperation
(
value
=
"SaveBatchByIBZOrganization"
,
tags
=
{
"
SaveBatchByIBZOrganization
"
},
notes
=
"SaveBatchByIBZOrganization"
)
@ApiOperation
(
value
=
"SaveBatchByIBZOrganization"
,
tags
=
{
"
IBZEmployee
"
},
notes
=
"SaveBatchByIBZOrganization"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzemployees/savebatch"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzemployees/savebatch"
)
public
ResponseEntity
<
Boolean
>
saveBatchByIBZOrganization
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@RequestBody
List
<
IBZEmployeeDTO
>
ibzemployeedtos
)
{
public
ResponseEntity
<
Boolean
>
saveBatchByIBZOrganization
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@RequestBody
List
<
IBZEmployeeDTO
>
ibzemployeedtos
)
{
List
<
IBZEmployee
>
domainlist
=
ibzemployeeMapping
.
toDomain
(
ibzemployeedtos
);
List
<
IBZEmployee
>
domainlist
=
ibzemployeeMapping
.
toDomain
(
ibzemployeedtos
);
...
@@ -428,7 +428,7 @@ public class IBZEmployeeResource {
...
@@ -428,7 +428,7 @@ public class IBZEmployeeResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
}
@ApiOperation
(
value
=
"GetByIBZOrganization"
,
tags
=
{
"IBZEmployee
ByIBZOrganization
"
},
notes
=
"GetByIBZOrganization"
)
@ApiOperation
(
value
=
"GetByIBZOrganization"
,
tags
=
{
"IBZEmployee"
},
notes
=
"GetByIBZOrganization"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzemployees/{ibzemployee_id}"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzemployees/{ibzemployee_id}"
)
public
ResponseEntity
<
IBZEmployeeDTO
>
getByIBZOrganization
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@PathVariable
(
"ibzemployee_id"
)
String
ibzemployee_id
)
{
public
ResponseEntity
<
IBZEmployeeDTO
>
getByIBZOrganization
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@PathVariable
(
"ibzemployee_id"
)
String
ibzemployee_id
)
{
IBZEmployee
domain
=
ibzemployeeService
.
get
(
ibzemployee_id
);
IBZEmployee
domain
=
ibzemployeeService
.
get
(
ibzemployee_id
);
...
@@ -436,7 +436,7 @@ public class IBZEmployeeResource {
...
@@ -436,7 +436,7 @@ public class IBZEmployeeResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
}
@ApiOperation
(
value
=
"GetDraftByIBZOrganization"
,
tags
=
{
"IBZEmployee
ByIBZOrganization
"
},
notes
=
"GetDraftByIBZOrganization"
)
@ApiOperation
(
value
=
"GetDraftByIBZOrganization"
,
tags
=
{
"IBZEmployee"
},
notes
=
"GetDraftByIBZOrganization"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzemployees/getdraft"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzemployees/getdraft"
)
public
ResponseEntity
<
IBZEmployeeDTO
>
getDraftByIBZOrganization
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
)
{
public
ResponseEntity
<
IBZEmployeeDTO
>
getDraftByIBZOrganization
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
)
{
IBZEmployee
domain
=
new
IBZEmployee
();
IBZEmployee
domain
=
new
IBZEmployee
();
...
@@ -444,7 +444,7 @@ public class IBZEmployeeResource {
...
@@ -444,7 +444,7 @@ public class IBZEmployeeResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ibzemployeeMapping
.
toDto
(
ibzemployeeService
.
getDraft
(
domain
)));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ibzemployeeMapping
.
toDto
(
ibzemployeeService
.
getDraft
(
domain
)));
}
}
@ApiOperation
(
value
=
"fetchDEFAULTByIBZOrganization"
,
tags
=
{
"IBZEmployee
ByIBZOrganization
"
}
,
notes
=
"fetchDEFAULTByIBZOrganization"
)
@ApiOperation
(
value
=
"fetchDEFAULTByIBZOrganization"
,
tags
=
{
"IBZEmployee"
}
,
notes
=
"fetchDEFAULTByIBZOrganization"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzemployees/fetchdefault"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzemployees/fetchdefault"
)
public
ResponseEntity
<
List
<
IBZEmployeeDTO
>>
fetchIBZEmployeeDefaultByIBZOrganization
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
IBZEmployeeSearchContext
context
)
{
public
ResponseEntity
<
List
<
IBZEmployeeDTO
>>
fetchIBZEmployeeDefaultByIBZOrganization
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
IBZEmployeeSearchContext
context
)
{
context
.
setN_orgid_eq
(
ibzorganization_id
);
context
.
setN_orgid_eq
(
ibzorganization_id
);
...
@@ -457,7 +457,7 @@ public class IBZEmployeeResource {
...
@@ -457,7 +457,7 @@ public class IBZEmployeeResource {
.
body
(
list
);
.
body
(
list
);
}
}
@ApiOperation
(
value
=
"searchDEFAULTByIBZOrganization"
,
tags
=
{
"IBZEmployee
ByIBZOrganization
"
}
,
notes
=
"searchDEFAULTByIBZOrganization"
)
@ApiOperation
(
value
=
"searchDEFAULTByIBZOrganization"
,
tags
=
{
"IBZEmployee"
}
,
notes
=
"searchDEFAULTByIBZOrganization"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzemployees/searchdefault"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzemployees/searchdefault"
)
public
ResponseEntity
<
Page
<
IBZEmployeeDTO
>>
searchIBZEmployeeDefaultByIBZOrganization
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
IBZEmployeeSearchContext
context
)
{
public
ResponseEntity
<
Page
<
IBZEmployeeDTO
>>
searchIBZEmployeeDefaultByIBZOrganization
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
IBZEmployeeSearchContext
context
)
{
context
.
setN_orgid_eq
(
ibzorganization_id
);
context
.
setN_orgid_eq
(
ibzorganization_id
);
...
@@ -469,21 +469,21 @@ public class IBZEmployeeResource {
...
@@ -469,21 +469,21 @@ public class IBZEmployeeResource {
@ApiOperation
(
value
=
"RemoveByIBZOrganizationIBZDepartment"
,
tags
=
{
"IBZEmployee
ByIBZOrganizationIBZDepartment
"
},
notes
=
"RemoveByIBZOrganizationIBZDepartment"
)
@ApiOperation
(
value
=
"RemoveByIBZOrganizationIBZDepartment"
,
tags
=
{
"IBZEmployee"
},
notes
=
"RemoveByIBZOrganizationIBZDepartment"
)
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/{ibzemployee_id}"
)
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/{ibzemployee_id}"
)
@Transactional
@Transactional
public
ResponseEntity
<
Boolean
>
removeByIBZOrganizationIBZDepartment
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@PathVariable
(
"ibzdepartment_id"
)
String
ibzdepartment_id
,
@PathVariable
(
"ibzemployee_id"
)
String
ibzemployee_id
)
{
public
ResponseEntity
<
Boolean
>
removeByIBZOrganizationIBZDepartment
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@PathVariable
(
"ibzdepartment_id"
)
String
ibzdepartment_id
,
@PathVariable
(
"ibzemployee_id"
)
String
ibzemployee_id
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ibzemployeeService
.
remove
(
ibzemployee_id
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ibzemployeeService
.
remove
(
ibzemployee_id
));
}
}
@ApiOperation
(
value
=
"RemoveBatchByIBZOrganizationIBZDepartment"
,
tags
=
{
"
RemoveBatchByIBZOrganizationIBZDepartment
"
},
notes
=
"RemoveBatchByIBZOrganizationIBZDepartment"
)
@ApiOperation
(
value
=
"RemoveBatchByIBZOrganizationIBZDepartment"
,
tags
=
{
"
IBZEmployee
"
},
notes
=
"RemoveBatchByIBZOrganizationIBZDepartment"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/remove
batch"
)
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/
batch"
)
public
ResponseEntity
<
Boolean
>
removeBatchByIBZOrganizationIBZDepartment
(
@RequestBody
List
<
String
>
ids
)
{
public
ResponseEntity
<
Boolean
>
removeBatchByIBZOrganizationIBZDepartment
(
@RequestBody
List
<
String
>
ids
)
{
ibzemployeeService
.
removeBatch
(
ids
);
ibzemployeeService
.
removeBatch
(
ids
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
}
@ApiOperation
(
value
=
"初始化密码ByIBZOrganizationIBZDepartment"
,
tags
=
{
"IBZEmployee
ByIBZOrganizationIBZDepartment
"
},
notes
=
"初始化密码ByIBZOrganizationIBZDepartment"
)
@ApiOperation
(
value
=
"初始化密码ByIBZOrganizationIBZDepartment"
,
tags
=
{
"IBZEmployee"
},
notes
=
"初始化密码ByIBZOrganizationIBZDepartment"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/{ibzemployeeuserid}/initpwd"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/{ibzemployeeuserid}/initpwd"
)
@Transactional
@Transactional
public
ResponseEntity
<
IBZEmployeeDTO
>
initPwdByIBZOrganizationIBZDepartment
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@PathVariable
(
"ibzdepartment_id"
)
String
ibzdepartment_id
,
@PathVariable
(
"ibzemployee_id"
)
String
ibzemployee_id
,
@RequestBody
IBZEmployeeDTO
ibzemployeedto
)
{
public
ResponseEntity
<
IBZEmployeeDTO
>
initPwdByIBZOrganizationIBZDepartment
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@PathVariable
(
"ibzdepartment_id"
)
String
ibzdepartment_id
,
@PathVariable
(
"ibzemployee_id"
)
String
ibzemployee_id
,
@RequestBody
IBZEmployeeDTO
ibzemployeedto
)
{
...
@@ -494,7 +494,7 @@ public class IBZEmployeeResource {
...
@@ -494,7 +494,7 @@ public class IBZEmployeeResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ibzemployeedto
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ibzemployeedto
);
}
}
@ApiOperation
(
value
=
"CreateByIBZOrganizationIBZDepartment"
,
tags
=
{
"IBZEmployee
ByIBZOrganizationIBZDepartment
"
},
notes
=
"CreateByIBZOrganizationIBZDepartment"
)
@ApiOperation
(
value
=
"CreateByIBZOrganizationIBZDepartment"
,
tags
=
{
"IBZEmployee"
},
notes
=
"CreateByIBZOrganizationIBZDepartment"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees"
)
@Transactional
@Transactional
public
ResponseEntity
<
IBZEmployeeDTO
>
createByIBZOrganizationIBZDepartment
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@PathVariable
(
"ibzdepartment_id"
)
String
ibzdepartment_id
,
@RequestBody
IBZEmployeeDTO
ibzemployeedto
)
{
public
ResponseEntity
<
IBZEmployeeDTO
>
createByIBZOrganizationIBZDepartment
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@PathVariable
(
"ibzdepartment_id"
)
String
ibzdepartment_id
,
@RequestBody
IBZEmployeeDTO
ibzemployeedto
)
{
...
@@ -505,8 +505,8 @@ public class IBZEmployeeResource {
...
@@ -505,8 +505,8 @@ public class IBZEmployeeResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
}
@ApiOperation
(
value
=
"createBatchByIBZOrganizationIBZDepartment"
,
tags
=
{
"
createBatchByIBZOrganizationIBZDepartment
"
},
notes
=
"createBatchByIBZOrganizationIBZDepartment"
)
@ApiOperation
(
value
=
"createBatchByIBZOrganizationIBZDepartment"
,
tags
=
{
"
IBZEmployee
"
},
notes
=
"createBatchByIBZOrganizationIBZDepartment"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/
create
batch"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/batch"
)
public
ResponseEntity
<
Boolean
>
createBatchByIBZOrganizationIBZDepartment
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@PathVariable
(
"ibzdepartment_id"
)
String
ibzdepartment_id
,
@RequestBody
List
<
IBZEmployeeDTO
>
ibzemployeedtos
)
{
public
ResponseEntity
<
Boolean
>
createBatchByIBZOrganizationIBZDepartment
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@PathVariable
(
"ibzdepartment_id"
)
String
ibzdepartment_id
,
@RequestBody
List
<
IBZEmployeeDTO
>
ibzemployeedtos
)
{
List
<
IBZEmployee
>
domainlist
=
ibzemployeeMapping
.
toDomain
(
ibzemployeedtos
);
List
<
IBZEmployee
>
domainlist
=
ibzemployeeMapping
.
toDomain
(
ibzemployeedtos
);
for
(
IBZEmployee
domain:
domainlist
){
for
(
IBZEmployee
domain:
domainlist
){
...
@@ -516,13 +516,13 @@ public class IBZEmployeeResource {
...
@@ -516,13 +516,13 @@ public class IBZEmployeeResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
}
@ApiOperation
(
value
=
"CheckKeyByIBZOrganizationIBZDepartment"
,
tags
=
{
"IBZEmployee
ByIBZOrganizationIBZDepartment
"
},
notes
=
"CheckKeyByIBZOrganizationIBZDepartment"
)
@ApiOperation
(
value
=
"CheckKeyByIBZOrganizationIBZDepartment"
,
tags
=
{
"IBZEmployee"
},
notes
=
"CheckKeyByIBZOrganizationIBZDepartment"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/checkkey"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/checkkey"
)
public
ResponseEntity
<
Boolean
>
checkKeyByIBZOrganizationIBZDepartment
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@PathVariable
(
"ibzdepartment_id"
)
String
ibzdepartment_id
,
@RequestBody
IBZEmployeeDTO
ibzemployeedto
)
{
public
ResponseEntity
<
Boolean
>
checkKeyByIBZOrganizationIBZDepartment
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@PathVariable
(
"ibzdepartment_id"
)
String
ibzdepartment_id
,
@RequestBody
IBZEmployeeDTO
ibzemployeedto
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ibzemployeeService
.
checkKey
(
ibzemployeeMapping
.
toDomain
(
ibzemployeedto
)));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ibzemployeeService
.
checkKey
(
ibzemployeeMapping
.
toDomain
(
ibzemployeedto
)));
}
}
@ApiOperation
(
value
=
"UpdateByIBZOrganizationIBZDepartment"
,
tags
=
{
"IBZEmployee
ByIBZOrganizationIBZDepartment
"
},
notes
=
"UpdateByIBZOrganizationIBZDepartment"
)
@ApiOperation
(
value
=
"UpdateByIBZOrganizationIBZDepartment"
,
tags
=
{
"IBZEmployee"
},
notes
=
"UpdateByIBZOrganizationIBZDepartment"
)
@RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/{ibzemployee_id}"
)
@RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/{ibzemployee_id}"
)
@Transactional
@Transactional
public
ResponseEntity
<
IBZEmployeeDTO
>
updateByIBZOrganizationIBZDepartment
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@PathVariable
(
"ibzdepartment_id"
)
String
ibzdepartment_id
,
@PathVariable
(
"ibzemployee_id"
)
String
ibzemployee_id
,
@RequestBody
IBZEmployeeDTO
ibzemployeedto
)
{
public
ResponseEntity
<
IBZEmployeeDTO
>
updateByIBZOrganizationIBZDepartment
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@PathVariable
(
"ibzdepartment_id"
)
String
ibzdepartment_id
,
@PathVariable
(
"ibzemployee_id"
)
String
ibzemployee_id
,
@RequestBody
IBZEmployeeDTO
ibzemployeedto
)
{
...
@@ -534,8 +534,8 @@ public class IBZEmployeeResource {
...
@@ -534,8 +534,8 @@ public class IBZEmployeeResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
}
@ApiOperation
(
value
=
"UpdateBatchByIBZOrganizationIBZDepartment"
,
tags
=
{
"
UpdateBatchByIBZOrganizationIBZDepartment
"
},
notes
=
"UpdateBatchByIBZOrganizationIBZDepartment"
)
@ApiOperation
(
value
=
"UpdateBatchByIBZOrganizationIBZDepartment"
,
tags
=
{
"
IBZEmployee
"
},
notes
=
"UpdateBatchByIBZOrganizationIBZDepartment"
)
@RequestMapping
(
method
=
RequestMethod
.
P
OST
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/update
batch"
)
@RequestMapping
(
method
=
RequestMethod
.
P
UT
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/
batch"
)
public
ResponseEntity
<
Boolean
>
updateBatchByIBZOrganizationIBZDepartment
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@PathVariable
(
"ibzdepartment_id"
)
String
ibzdepartment_id
,
@RequestBody
List
<
IBZEmployeeDTO
>
ibzemployeedtos
)
{
public
ResponseEntity
<
Boolean
>
updateBatchByIBZOrganizationIBZDepartment
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@PathVariable
(
"ibzdepartment_id"
)
String
ibzdepartment_id
,
@RequestBody
List
<
IBZEmployeeDTO
>
ibzemployeedtos
)
{
List
<
IBZEmployee
>
domainlist
=
ibzemployeeMapping
.
toDomain
(
ibzemployeedtos
);
List
<
IBZEmployee
>
domainlist
=
ibzemployeeMapping
.
toDomain
(
ibzemployeedtos
);
for
(
IBZEmployee
domain:
domainlist
){
for
(
IBZEmployee
domain:
domainlist
){
...
@@ -545,7 +545,7 @@ public class IBZEmployeeResource {
...
@@ -545,7 +545,7 @@ public class IBZEmployeeResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
}
@ApiOperation
(
value
=
"SaveByIBZOrganizationIBZDepartment"
,
tags
=
{
"IBZEmployee
ByIBZOrganizationIBZDepartment
"
},
notes
=
"SaveByIBZOrganizationIBZDepartment"
)
@ApiOperation
(
value
=
"SaveByIBZOrganizationIBZDepartment"
,
tags
=
{
"IBZEmployee"
},
notes
=
"SaveByIBZOrganizationIBZDepartment"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/save"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/save"
)
public
ResponseEntity
<
Boolean
>
saveByIBZOrganizationIBZDepartment
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@PathVariable
(
"ibzdepartment_id"
)
String
ibzdepartment_id
,
@RequestBody
IBZEmployeeDTO
ibzemployeedto
)
{
public
ResponseEntity
<
Boolean
>
saveByIBZOrganizationIBZDepartment
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@PathVariable
(
"ibzdepartment_id"
)
String
ibzdepartment_id
,
@RequestBody
IBZEmployeeDTO
ibzemployeedto
)
{
IBZEmployee
domain
=
ibzemployeeMapping
.
toDomain
(
ibzemployeedto
);
IBZEmployee
domain
=
ibzemployeeMapping
.
toDomain
(
ibzemployeedto
);
...
@@ -553,7 +553,7 @@ public class IBZEmployeeResource {
...
@@ -553,7 +553,7 @@ public class IBZEmployeeResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ibzemployeeService
.
save
(
domain
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ibzemployeeService
.
save
(
domain
));
}
}
@ApiOperation
(
value
=
"SaveBatchByIBZOrganizationIBZDepartment"
,
tags
=
{
"
SaveBatchByIBZOrganizationIBZDepartment
"
},
notes
=
"SaveBatchByIBZOrganizationIBZDepartment"
)
@ApiOperation
(
value
=
"SaveBatchByIBZOrganizationIBZDepartment"
,
tags
=
{
"
IBZEmployee
"
},
notes
=
"SaveBatchByIBZOrganizationIBZDepartment"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/savebatch"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/savebatch"
)
public
ResponseEntity
<
Boolean
>
saveBatchByIBZOrganizationIBZDepartment
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@PathVariable
(
"ibzdepartment_id"
)
String
ibzdepartment_id
,
@RequestBody
List
<
IBZEmployeeDTO
>
ibzemployeedtos
)
{
public
ResponseEntity
<
Boolean
>
saveBatchByIBZOrganizationIBZDepartment
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@PathVariable
(
"ibzdepartment_id"
)
String
ibzdepartment_id
,
@RequestBody
List
<
IBZEmployeeDTO
>
ibzemployeedtos
)
{
List
<
IBZEmployee
>
domainlist
=
ibzemployeeMapping
.
toDomain
(
ibzemployeedtos
);
List
<
IBZEmployee
>
domainlist
=
ibzemployeeMapping
.
toDomain
(
ibzemployeedtos
);
...
@@ -564,7 +564,7 @@ public class IBZEmployeeResource {
...
@@ -564,7 +564,7 @@ public class IBZEmployeeResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
}
@ApiOperation
(
value
=
"GetByIBZOrganizationIBZDepartment"
,
tags
=
{
"IBZEmployee
ByIBZOrganizationIBZDepartment
"
},
notes
=
"GetByIBZOrganizationIBZDepartment"
)
@ApiOperation
(
value
=
"GetByIBZOrganizationIBZDepartment"
,
tags
=
{
"IBZEmployee"
},
notes
=
"GetByIBZOrganizationIBZDepartment"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/{ibzemployee_id}"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/{ibzemployee_id}"
)
public
ResponseEntity
<
IBZEmployeeDTO
>
getByIBZOrganizationIBZDepartment
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@PathVariable
(
"ibzdepartment_id"
)
String
ibzdepartment_id
,
@PathVariable
(
"ibzemployee_id"
)
String
ibzemployee_id
)
{
public
ResponseEntity
<
IBZEmployeeDTO
>
getByIBZOrganizationIBZDepartment
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@PathVariable
(
"ibzdepartment_id"
)
String
ibzdepartment_id
,
@PathVariable
(
"ibzemployee_id"
)
String
ibzemployee_id
)
{
IBZEmployee
domain
=
ibzemployeeService
.
get
(
ibzemployee_id
);
IBZEmployee
domain
=
ibzemployeeService
.
get
(
ibzemployee_id
);
...
@@ -572,7 +572,7 @@ public class IBZEmployeeResource {
...
@@ -572,7 +572,7 @@ public class IBZEmployeeResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
}
@ApiOperation
(
value
=
"GetDraftByIBZOrganizationIBZDepartment"
,
tags
=
{
"IBZEmployee
ByIBZOrganizationIBZDepartment
"
},
notes
=
"GetDraftByIBZOrganizationIBZDepartment"
)
@ApiOperation
(
value
=
"GetDraftByIBZOrganizationIBZDepartment"
,
tags
=
{
"IBZEmployee"
},
notes
=
"GetDraftByIBZOrganizationIBZDepartment"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/getdraft"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/getdraft"
)
public
ResponseEntity
<
IBZEmployeeDTO
>
getDraftByIBZOrganizationIBZDepartment
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@PathVariable
(
"ibzdepartment_id"
)
String
ibzdepartment_id
)
{
public
ResponseEntity
<
IBZEmployeeDTO
>
getDraftByIBZOrganizationIBZDepartment
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@PathVariable
(
"ibzdepartment_id"
)
String
ibzdepartment_id
)
{
IBZEmployee
domain
=
new
IBZEmployee
();
IBZEmployee
domain
=
new
IBZEmployee
();
...
@@ -580,7 +580,7 @@ public class IBZEmployeeResource {
...
@@ -580,7 +580,7 @@ public class IBZEmployeeResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ibzemployeeMapping
.
toDto
(
ibzemployeeService
.
getDraft
(
domain
)));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ibzemployeeMapping
.
toDto
(
ibzemployeeService
.
getDraft
(
domain
)));
}
}
@ApiOperation
(
value
=
"fetchDEFAULTByIBZOrganizationIBZDepartment"
,
tags
=
{
"IBZEmployee
ByIBZOrganizationIBZDepartment
"
}
,
notes
=
"fetchDEFAULTByIBZOrganizationIBZDepartment"
)
@ApiOperation
(
value
=
"fetchDEFAULTByIBZOrganizationIBZDepartment"
,
tags
=
{
"IBZEmployee"
}
,
notes
=
"fetchDEFAULTByIBZOrganizationIBZDepartment"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/fetchdefault"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/fetchdefault"
)
public
ResponseEntity
<
List
<
IBZEmployeeDTO
>>
fetchIBZEmployeeDefaultByIBZOrganizationIBZDepartment
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@PathVariable
(
"ibzdepartment_id"
)
String
ibzdepartment_id
,
IBZEmployeeSearchContext
context
)
{
public
ResponseEntity
<
List
<
IBZEmployeeDTO
>>
fetchIBZEmployeeDefaultByIBZOrganizationIBZDepartment
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@PathVariable
(
"ibzdepartment_id"
)
String
ibzdepartment_id
,
IBZEmployeeSearchContext
context
)
{
context
.
setN_mdeptid_eq
(
ibzdepartment_id
);
context
.
setN_mdeptid_eq
(
ibzdepartment_id
);
...
@@ -593,7 +593,7 @@ public class IBZEmployeeResource {
...
@@ -593,7 +593,7 @@ public class IBZEmployeeResource {
.
body
(
list
);
.
body
(
list
);
}
}
@ApiOperation
(
value
=
"searchDEFAULTByIBZOrganizationIBZDepartment"
,
tags
=
{
"IBZEmployee
ByIBZOrganizationIBZDepartment
"
}
,
notes
=
"searchDEFAULTByIBZOrganizationIBZDepartment"
)
@ApiOperation
(
value
=
"searchDEFAULTByIBZOrganizationIBZDepartment"
,
tags
=
{
"IBZEmployee"
}
,
notes
=
"searchDEFAULTByIBZOrganizationIBZDepartment"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/searchdefault"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/searchdefault"
)
public
ResponseEntity
<
Page
<
IBZEmployeeDTO
>>
searchIBZEmployeeDefaultByIBZOrganizationIBZDepartment
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@PathVariable
(
"ibzdepartment_id"
)
String
ibzdepartment_id
,
IBZEmployeeSearchContext
context
)
{
public
ResponseEntity
<
Page
<
IBZEmployeeDTO
>>
searchIBZEmployeeDefaultByIBZOrganizationIBZDepartment
(
@PathVariable
(
"ibzorganization_id"
)
String
ibzorganization_id
,
@PathVariable
(
"ibzdepartment_id"
)
String
ibzdepartment_id
,
IBZEmployeeSearchContext
context
)
{
context
.
setN_mdeptid_eq
(
ibzdepartment_id
);
context
.
setN_mdeptid_eq
(
ibzdepartment_id
);
...
...
ibzou-provider/ibzou-provider-api/src/main/java/cn/ibizlab/api/rest/IBZOrganizationResource.java
浏览文件 @
a31915b3
...
@@ -77,8 +77,8 @@ public class IBZOrganizationResource {
...
@@ -77,8 +77,8 @@ public class IBZOrganizationResource {
}
}
@PreAuthorize
(
"hasPermission(#ibzorganization_id,'Update',{this.getEntity(),'Sql'})"
)
@PreAuthorize
(
"hasPermission(#ibzorganization_id,'Update',{this.getEntity(),'Sql'})"
)
@ApiOperation
(
value
=
"UpdateBatch"
,
tags
=
{
"
UpdateBatch
"
},
notes
=
"UpdateBatch"
)
@ApiOperation
(
value
=
"UpdateBatch"
,
tags
=
{
"
IBZOrganization
"
},
notes
=
"UpdateBatch"
)
@RequestMapping
(
method
=
RequestMethod
.
P
OST
,
value
=
"/ibzorganizations/update
batch"
)
@RequestMapping
(
method
=
RequestMethod
.
P
UT
,
value
=
"/ibzorganizations/
batch"
)
public
ResponseEntity
<
Boolean
>
updateBatch
(
@RequestBody
List
<
IBZOrganizationDTO
>
ibzorganizationdtos
)
{
public
ResponseEntity
<
Boolean
>
updateBatch
(
@RequestBody
List
<
IBZOrganizationDTO
>
ibzorganizationdtos
)
{
ibzorganizationService
.
updateBatch
(
ibzorganizationMapping
.
toDomain
(
ibzorganizationdtos
));
ibzorganizationService
.
updateBatch
(
ibzorganizationMapping
.
toDomain
(
ibzorganizationdtos
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
...
@@ -99,8 +99,8 @@ public class IBZOrganizationResource {
...
@@ -99,8 +99,8 @@ public class IBZOrganizationResource {
}
}
@PreAuthorize
(
"hasPermission('','Create',{this.getEntity(),'Sql'})"
)
@PreAuthorize
(
"hasPermission('','Create',{this.getEntity(),'Sql'})"
)
@ApiOperation
(
value
=
"createBatch"
,
tags
=
{
"
createBatch
"
},
notes
=
"createBatch"
)
@ApiOperation
(
value
=
"createBatch"
,
tags
=
{
"
IBZOrganization
"
},
notes
=
"createBatch"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzorganizations/
create
batch"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzorganizations/batch"
)
public
ResponseEntity
<
Boolean
>
createBatch
(
@RequestBody
List
<
IBZOrganizationDTO
>
ibzorganizationdtos
)
{
public
ResponseEntity
<
Boolean
>
createBatch
(
@RequestBody
List
<
IBZOrganizationDTO
>
ibzorganizationdtos
)
{
ibzorganizationService
.
createBatch
(
ibzorganizationMapping
.
toDomain
(
ibzorganizationdtos
));
ibzorganizationService
.
createBatch
(
ibzorganizationMapping
.
toDomain
(
ibzorganizationdtos
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
...
@@ -115,7 +115,7 @@ public class IBZOrganizationResource {
...
@@ -115,7 +115,7 @@ public class IBZOrganizationResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ibzorganizationService
.
save
(
ibzorganizationMapping
.
toDomain
(
ibzorganizationdto
)));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ibzorganizationService
.
save
(
ibzorganizationMapping
.
toDomain
(
ibzorganizationdto
)));
}
}
@ApiOperation
(
value
=
"SaveBatch"
,
tags
=
{
"
SaveBatch
"
},
notes
=
"SaveBatch"
)
@ApiOperation
(
value
=
"SaveBatch"
,
tags
=
{
"
IBZOrganization
"
},
notes
=
"SaveBatch"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzorganizations/savebatch"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzorganizations/savebatch"
)
public
ResponseEntity
<
Boolean
>
saveBatch
(
@RequestBody
List
<
IBZOrganizationDTO
>
ibzorganizationdtos
)
{
public
ResponseEntity
<
Boolean
>
saveBatch
(
@RequestBody
List
<
IBZOrganizationDTO
>
ibzorganizationdtos
)
{
ibzorganizationService
.
saveBatch
(
ibzorganizationMapping
.
toDomain
(
ibzorganizationdtos
));
ibzorganizationService
.
saveBatch
(
ibzorganizationMapping
.
toDomain
(
ibzorganizationdtos
));
...
@@ -133,8 +133,8 @@ public class IBZOrganizationResource {
...
@@ -133,8 +133,8 @@ public class IBZOrganizationResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ibzorganizationService
.
remove
(
ibzorganization_id
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ibzorganizationService
.
remove
(
ibzorganization_id
));
}
}
@ApiOperation
(
value
=
"RemoveBatch"
,
tags
=
{
"
RemoveBatch
"
},
notes
=
"RemoveBatch"
)
@ApiOperation
(
value
=
"RemoveBatch"
,
tags
=
{
"
IBZOrganization
"
},
notes
=
"RemoveBatch"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ibzorganizations/remove
batch"
)
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/ibzorganizations/
batch"
)
public
ResponseEntity
<
Boolean
>
removeBatch
(
@RequestBody
List
<
String
>
ids
)
{
public
ResponseEntity
<
Boolean
>
removeBatch
(
@RequestBody
List
<
String
>
ids
)
{
ibzorganizationService
.
removeBatch
(
ids
);
ibzorganizationService
.
removeBatch
(
ids
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
...
...
ibzou-provider/ibzou-provider-api/src/main/java/cn/ibizlab/swagger/SwaggerConfiguration.java
0 → 100644
浏览文件 @
a31915b3
package
cn
.
ibizlab
.
swagger
;
import
cn.ibizlab.util.security.SpringContextHolder
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
static
com
.
google
.
common
.
base
.
Predicates
.
or
;
import
static
springfox
.
documentation
.
builders
.
PathSelectors
.
regex
;
import
org.springframework.plugin.core.PluginRegistry
;
import
org.springframework.plugin.core.PluginRegistrySupport
;
import
springfox.documentation.builders.ApiInfoBuilder
;
import
springfox.documentation.builders.PathSelectors
;
import
springfox.documentation.builders.RequestHandlerSelectors
;
import
springfox.documentation.spi.DocumentationType
;
import
springfox.documentation.spi.service.OperationBuilderPlugin
;
import
springfox.documentation.spring.web.plugins.Docket
;
import
springfox.documentation.spring.web.readers.operation.OperationParameterReader
;
import
springfox.documentation.swagger2.annotations.EnableSwagger2
;
import
java.lang.reflect.Field
;
import
java.util.ArrayList
;
import
java.util.List
;
@Configuration
@EnableSwagger2
public
class
SwaggerConfiguration
{
@Bean
public
Docket
docket
()
{
Docket
docket
=
new
Docket
(
DocumentationType
.
SWAGGER_2
)
.
groupName
(
"DEFAULT"
)
.
pathMapping
(
"/"
)
.
apiInfo
(
new
ApiInfoBuilder
()
.
title
(
"DEFAULT"
)
.
build
()
)
.
select
()
.
apis
(
RequestHandlerSelectors
.
basePackage
(
"cn.ibizlab"
))
//.paths(or(regex("/rest/.*")))
.
paths
(
PathSelectors
.
any
())
.
build
()
;
removeDefaultPlugin
();
return
docket
;
}
@Bean
public
Docket
apiDocket
()
{
return
new
Docket
(
DocumentationType
.
SWAGGER_2
)
.
groupName
(
"microservice"
)
.
pathMapping
(
"/"
)
.
apiInfo
(
new
ApiInfoBuilder
()
.
title
(
"microservice"
)
.
version
(
"1"
)
.
build
()
)
.
select
()
.
apis
(
RequestHandlerSelectors
.
basePackage
(
"cn.ibizlab.api"
))
//.paths(or(regex("/rest/api/.*")))
.
paths
(
PathSelectors
.
any
())
.
build
()
;
}
private
void
removeDefaultPlugin
()
{
// 从spring容器中获取swagger插件注册表
PluginRegistry
<
OperationBuilderPlugin
,
DocumentationType
>
pluginRegistry
=
SpringContextHolder
.
getBean
(
"operationBuilderPluginRegistry"
);
// 插件集合
List
<
OperationBuilderPlugin
>
plugins
=
pluginRegistry
.
getPlugins
();
// 从spring容器中获取需要删除的插件
OperationParameterReader
operationParameterReader
=
SpringContextHolder
.
getBean
(
OperationParameterReader
.
class
);
if
(
operationParameterReader
==
null
)
return
;
// 原plugins集合不能修改,创建新集合,通过反射替换
if
(
pluginRegistry
.
contains
(
operationParameterReader
))
{
List
<
OperationBuilderPlugin
>
plugins_new
=
new
ArrayList
<
OperationBuilderPlugin
>(
plugins
);
plugins_new
.
remove
(
operationParameterReader
);
try
{
Field
field
=
PluginRegistrySupport
.
class
.
getDeclaredField
(
"plugins"
);
field
.
setAccessible
(
true
);
field
.
set
(
pluginRegistry
,
plugins_new
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
}
ibzou-util/pom.xml
浏览文件 @
a31915b3
...
@@ -75,5 +75,15 @@
...
@@ -75,5 +75,15 @@
<artifactId>
commons-pool2
</artifactId>
<artifactId>
commons-pool2
</artifactId>
</dependency>
</dependency>
<!-- Swagger2 -->
<dependency>
<groupId>
io.springfox
</groupId>
<artifactId>
springfox-swagger2
</artifactId>
</dependency>
<dependency>
<groupId>
io.springfox
</groupId>
<artifactId>
springfox-swagger-ui
</artifactId>
</dependency>
</dependencies>
</dependencies>
</project>
</project>
ibzou-util/src/main/java/cn/ibizlab/util/annotation/DEField.java
浏览文件 @
a31915b3
...
@@ -11,6 +11,11 @@ import java.lang.annotation.Target;
...
@@ -11,6 +11,11 @@ import java.lang.annotation.Target;
@Target
({
ElementType
.
FIELD
})
@Target
({
ElementType
.
FIELD
})
public
@interface
DEField
public
@interface
DEField
{
{
/**
* 属性名称
* @return
*/
String
name
()
default
""
;
/**
/**
* 是否为数据主键
* 是否为数据主键
* @return
* @return
...
...
ibzou-util/src/main/java/cn/ibizlab/util/aspect/DEFieldDefaultValueAspect.java
浏览文件 @
a31915b3
package
cn
.
ibizlab
.
util
.
aspect
;
package
cn
.
ibizlab
.
util
.
aspect
;
import
cn.ibizlab.util.annotation.DEField
;
import
cn.ibizlab.util.annotation.DEField
;
import
cn.ibizlab.util.domain.EntityBase
;
import
cn.ibizlab.util.enums.DEFieldDefaultValueType
;
import
cn.ibizlab.util.enums.DEFieldDefaultValueType
;
import
cn.ibizlab.util.enums.DEPredefinedFieldType
;
import
cn.ibizlab.util.enums.DEPredefinedFieldType
;
import
cn.ibizlab.util.helper.DEFieldCacheMap
;
import
cn.ibizlab.util.helper.DEFieldCacheMap
;
...
@@ -8,18 +9,13 @@ import cn.ibizlab.util.security.AuthenticationUser;
...
@@ -8,18 +9,13 @@ import cn.ibizlab.util.security.AuthenticationUser;
import
org.aspectj.lang.JoinPoint
;
import
org.aspectj.lang.JoinPoint
;
import
org.aspectj.lang.annotation.Aspect
;
import
org.aspectj.lang.annotation.Aspect
;
import
org.aspectj.lang.annotation.Before
;
import
org.aspectj.lang.annotation.Before
;
import
org.springframework.cglib.beans.BeanMap
;
import
org.springframework.core.annotation.Order
;
import
org.springframework.core.annotation.Order
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.AlternativeJdkIdGenerator
;
import
org.springframework.util.AlternativeJdkIdGenerator
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
import
java.beans.PropertyDescriptor
;
import
java.lang.reflect.Field
;
import
java.lang.reflect.Method
;
import
java.sql.Timestamp
;
import
java.sql.Timestamp
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -36,80 +32,41 @@ public class DEFieldDefaultValueAspect
...
@@ -36,80 +32,41 @@ public class DEFieldDefaultValueAspect
* @param point
* @param point
* @throws Exception
* @throws Exception
*/
*/
@Before
(
value
=
"execution(* c
n.ibizlab
.core.*.service.*.create(..))"
)
@Before
(
value
=
"execution(* c
om.cntmtech.support
.core.*.service.*.create(..))"
)
public
void
BeforeCreate
(
JoinPoint
point
)
throws
Exception
{
public
void
BeforeCreate
(
JoinPoint
point
)
throws
Exception
{
fillDEFieldDefaultValue
(
point
);
fillDEFieldDefaultValue
(
point
);
}
}
@Before
(
value
=
"execution(* com.cntmtech.support.core.*.service.*.createBatch(..))"
)
public
void
BeforeCreateBatch
(
JoinPoint
point
)
throws
Exception
{
fillDEFieldDefaultValue
(
point
);
}
/**
/**
* 更新数据切入点
* 更新数据切入点
* @param point
* @param point
* @throws Exception
* @throws Exception
*/
*/
@Before
(
value
=
"execution(* c
n.ibizlab
.core.*.service.*.update(..))"
)
@Before
(
value
=
"execution(* c
om.cntmtech.support
.core.*.service.*.update(..))"
)
public
void
BeforeUpdate
(
JoinPoint
point
)
throws
Exception
{
public
void
BeforeUpdate
(
JoinPoint
point
)
throws
Exception
{
fillDEFieldDefaultValue
(
point
);
fillDEFieldDefaultValue
(
point
);
}
}
@Before
(
value
=
"execution(* com.cntmtech.support.core.*.service.*.updateBatch(..))"
)
public
void
BeforeUpdateBatch
(
JoinPoint
point
)
throws
Exception
{
fillDEFieldDefaultValue
(
point
);
}
/**
/**
* 保存数据切入点
* 保存数据切入点
* @param point
* @param point
* @throws Exception
* @throws Exception
*/
*/
@Before
(
value
=
"execution(* c
n.ibizlab
.core.*.service.*.save(..))"
)
@Before
(
value
=
"execution(* c
om.cntmtech.support
.core.*.service.*.save(..))"
)
public
void
BeforeSave
(
JoinPoint
point
)
throws
Exception
{
public
void
BeforeSave
(
JoinPoint
point
)
throws
Exception
{
checkAction
(
point
);
fillDEFieldDefaultValue
(
point
);
}
/**
* 判断当前是否为新建操作,若为新建,则填充属性默认值
* @param joinPoint
* @throws Exception
*/
private
void
checkAction
(
JoinPoint
joinPoint
)
throws
Exception
{
Object
[]
args
=
joinPoint
.
getArgs
();
if
(
args
.
length
>
0
)
{
Object
obj
=
args
[
0
];
String
className
=
obj
.
getClass
().
getName
();
//获取当前do对象中的属性
DEFieldCacheMap
.
getFieldMap
(
className
);
//从属性列表中过滤出主键属性
Field
keyPSDEField
=
this
.
getKeyPSDEField
(
className
);
if
(
ObjectUtils
.
isEmpty
(
keyPSDEField
))
return
;
String
filename
=
keyPSDEField
.
getName
();
PropertyDescriptor
field
=
new
PropertyDescriptor
(
filename
,
obj
.
getClass
());
Method
fieldGetMethod
=
field
.
getReadMethod
();
//获取主键值
Object
fieldValue
=
fieldGetMethod
.
invoke
(
obj
);
//实体数据主键为空,则为新建操作,填充属性默认值
if
(
ObjectUtils
.
isEmpty
(
fieldValue
)){
fillDEFieldDefaultValue
(
joinPoint
);
}
}
}
}
@Before
(
value
=
"execution(* com.cntmtech.support.core.*.service.*.saveBatch(..))"
)
/**
public
void
BeforeSaveBatch
(
JoinPoint
point
)
throws
Exception
{
* 获取主键属性
fillDEFieldDefaultValue
(
point
);
* @param className 实体类名
* @return 主键属性
*/
private
Field
getKeyPSDEField
(
String
className
){
Field
keyField
=
null
;
List
<
Field
>
fields
=
DEFieldCacheMap
.
getFields
(
className
);
for
(
Field
field:
fields
){
DEField
deField
=
field
.
getAnnotation
(
DEField
.
class
);
if
(!
ObjectUtils
.
isEmpty
(
deField
)
&&
deField
.
isKeyField
())
{
return
field
;
}
}
return
keyField
;
}
}
/**
/**
...
@@ -119,53 +76,56 @@ public class DEFieldDefaultValueAspect
...
@@ -119,53 +76,56 @@ public class DEFieldDefaultValueAspect
* @throws Exception
* @throws Exception
*/
*/
public
Object
fillDEFieldDefaultValue
(
JoinPoint
joinPoint
)
throws
Exception
{
public
Object
fillDEFieldDefaultValue
(
JoinPoint
joinPoint
)
throws
Exception
{
Object
[]
args
=
joinPoint
.
getArgs
();
Object
[]
args
=
joinPoint
.
getArgs
();
if
(
args
.
length
>
0
)
{
if
(
args
.
length
>
0
)
{
Object
obj
=
args
[
0
];
Object
obj
=
args
[
0
];
String
className
=
obj
.
getClass
().
getName
();
String
actionName
=
joinPoint
.
getSignature
().
getName
();
//获取当前po对象中的属性
if
(
obj
instanceof
EntityBase
)
{
DEFieldCacheMap
.
getFieldMap
(
className
);
Map
<
String
,
DEField
>
deFields
=
DEFieldCacheMap
.
getDEFields
(
obj
.
getClass
());
//从属性列表中过滤出预置属性
AuthenticationUser
curUser
=
AuthenticationUser
.
getAuthenticationUser
();
Map
<
Field
,
DEField
>
deFields
=
this
.
SearchDEField
(
className
);
String
keyField
=
DEFieldCacheMap
.
getDEKeyField
(
obj
.
getClass
());
//填充预置属性
if
(
StringUtils
.
isEmpty
(
keyField
))
fillDEField
(
obj
,
deFields
,
joinPoint
);
return
true
;
return
true
;
fillDEField
((
EntityBase
)
obj
,
deFields
,
actionName
,
curUser
,
keyField
);
}
else
if
(
obj
instanceof
List
)
{
Map
<
String
,
DEField
>
deFields
=
null
;
AuthenticationUser
curUser
=
null
;
String
keyField
=
""
;
for
(
Object
item:
(
List
)
obj
)
{
if
(
item
instanceof
EntityBase
)
{
if
(
deFields
==
null
)
{
deFields
=
DEFieldCacheMap
.
getDEFields
(
obj
.
getClass
());
curUser
=
AuthenticationUser
.
getAuthenticationUser
();
keyField
=
DEFieldCacheMap
.
getDEKeyField
(
obj
.
getClass
());
if
(
StringUtils
.
isEmpty
(
keyField
))
return
true
;
}
fillDEField
((
EntityBase
)
item
,
deFields
,
actionName
,
curUser
,
keyField
);
}
}
}
}
}
return
true
;
return
true
;
}
}
/**
*获取含有@DEField注解的实体属性
* @param className do对象类名
* @return
*/
private
Map
<
Field
,
DEField
>
SearchDEField
(
String
className
){
List
<
Field
>
fields
=
DEFieldCacheMap
.
getFields
(
className
);
Map
<
Field
,
DEField
>
deFieldMap
=
new
HashMap
<>();
for
(
Field
field:
fields
){
DEField
deField
=
field
.
getAnnotation
(
DEField
.
class
);
if
(!
ObjectUtils
.
isEmpty
(
deField
))
{
deFieldMap
.
put
(
field
,
deField
);
}
}
return
deFieldMap
;
}
/**
/**
* 填充系统预置属性
* 填充系统预置属性
* @param et 当前实体对象
* @param et 当前实体对象
*/
*/
private
void
fillDEField
(
Object
et
,
Map
<
Field
,
DEField
>
deFields
,
JoinPoint
joinPoint
)
throws
Exception
{
private
void
fillDEField
(
EntityBase
et
,
Map
<
String
,
DEField
>
deFields
,
String
actionName
,
AuthenticationUser
curUser
,
String
keyField
)
throws
Exception
{
if
(
deFields
.
size
()==
0
)
if
(
deFields
.
size
()==
0
)
return
;
return
;
for
(
Map
.
Entry
<
Field
,
DEField
>
entry
:
deFields
.
entrySet
())
{
if
(
actionName
.
toLowerCase
().
startsWith
(
"save"
))
{
if
(
ObjectUtils
.
isEmpty
(
et
.
get
(
keyField
)))
actionName
=
"create"
;
}
Field
deField
=
entry
.
getKey
();
for
(
Map
.
Entry
<
String
,
DEField
>
entry
:
deFields
.
entrySet
())
{
String
fi
leName
=
deField
.
getName
();
String
fi
eldname
=
entry
.
getKey
();
//获取注解
//获取注解
DEField
fieldAnnotation
=
entry
.
getValue
();
DEField
fieldAnnotation
=
entry
.
getValue
();
//获取默认值类型
//获取默认值类型
...
@@ -176,43 +136,35 @@ public class DEFieldDefaultValueAspect
...
@@ -176,43 +136,35 @@ public class DEFieldDefaultValueAspect
DEPredefinedFieldType
predefinedFieldType
=
fieldAnnotation
.
preType
();
DEPredefinedFieldType
predefinedFieldType
=
fieldAnnotation
.
preType
();
//填充系统默认值
//填充系统默认值
if
(
deFieldType
!=
DEFieldDefaultValueType
.
NONE
||
(!
StringUtils
.
isEmpty
(
deFieldDefaultValue
))
){
if
(
actionName
.
toLowerCase
().
startsWith
(
"create"
)
&&
(
deFieldType
!=
DEFieldDefaultValueType
.
NONE
||
(!
StringUtils
.
isEmpty
(
deFieldDefaultValue
))
)
){
fillFieldDefaultValue
(
fi
leName
,
deFieldType
,
deFieldDefaultValue
,
et
,
fieldAnnotation
)
;
fillFieldDefaultValue
(
fi
eldname
,
deFieldType
,
deFieldDefaultValue
,
et
,
curUser
)
;
}
}
//填充系统预置属性
//填充系统预置属性
if
(
predefinedFieldType
!=
DEPredefinedFieldType
.
NONE
){
if
(
predefinedFieldType
!=
DEPredefinedFieldType
.
NONE
){
fillPreFieldValue
(
fi
leName
,
predefinedFieldType
,
et
,
joinPoint
,
fieldAnnotation
);
fillPreFieldValue
(
fi
eldname
,
predefinedFieldType
,
et
,
actionName
,
fieldAnnotation
.
logicval
(),
curUser
);
}
}
}
}
}
}
/**
/**
* 填充属性默认值
* 填充属性默认值
* @param fi
leN
ame 实体属性名
* @param fi
eldn
ame 实体属性名
* @param deFieldType 默认值类型
* @param deFieldType 默认值类型
* @param deFieldDefaultValue 默认值
* @param deFieldDefaultValue 默认值
* @param et 当前实体对象
* @param et 当前实体对象
* @throws Exception
* @throws Exception
*/
*/
private
void
fillFieldDefaultValue
(
String
fileName
,
DEFieldDefaultValueType
deFieldType
,
String
deFieldDefaultValue
,
Object
et
,
DEField
fieldAnnotation
)
throws
Exception
{
private
void
fillFieldDefaultValue
(
String
fieldname
,
DEFieldDefaultValueType
deFieldType
,
String
deFieldDefaultValue
,
EntityBase
et
,
AuthenticationUser
curUser
)
throws
Exception
{
Object
fieldValue
=
et
.
get
(
fieldname
);
AuthenticationUser
curUser
=
AuthenticationUser
.
getAuthenticationUser
();
if
(
org
.
springframework
.
util
.
ObjectUtils
.
isEmpty
(
fieldValue
)){
BeanMap
beanMap
=
BeanMap
.
create
(
et
);
Object
fieldValue
=
beanMap
.
get
(
fileName
);
//获取当前所需填充属性的get、set方法及字段值
PropertyDescriptor
field
=
new
PropertyDescriptor
(
fileName
,
et
.
getClass
());
if
(
org
.
springframework
.
util
.
StringUtils
.
isEmpty
(
fieldValue
)){
//填充直接值及其余默认值类型
//填充直接值及其余默认值类型
if
(
(
deFieldType
==
DEFieldDefaultValueType
.
NONE
&&
!
StringUtils
.
isEmpty
(
deFieldDefaultValue
))
||
(
deFieldType
!=
DEFieldDefaultValueType
.
NONE
)
){
if
(
(
deFieldType
==
DEFieldDefaultValueType
.
NONE
&&
!
StringUtils
.
isEmpty
(
deFieldDefaultValue
))
||
(
deFieldType
!=
DEFieldDefaultValueType
.
NONE
)
){
switch
(
deFieldType
){
switch
(
deFieldType
){
case
SESSION:
case
SESSION:
String
sessionField
=
fieldAnnotation
.
defaultValue
();
if
(!
StringUtils
.
isEmpty
(
deFieldDefaultValue
)){
if
(!
StringUtils
.
isEmpty
(
sessionField
)){
Object
sessionFieldValue
=
curUser
.
getSessionParams
().
get
(
deFieldDefaultValue
.
toLowerCase
());
Object
sessionFieldValue
=
curUser
.
getSessionParams
().
get
(
sessionField
);
if
(!
ObjectUtils
.
isEmpty
(
sessionFieldValue
)){
if
(!
ObjectUtils
.
isEmpty
(
sessionFieldValue
)){
beanMap
.
put
(
fileN
ame
,
sessionFieldValue
);
et
.
set
(
fieldn
ame
,
sessionFieldValue
);
}
}
}
}
break
;
break
;
...
@@ -220,146 +172,94 @@ public class DEFieldDefaultValueAspect
...
@@ -220,146 +172,94 @@ public class DEFieldDefaultValueAspect
//暂未实现
//暂未实现
break
;
break
;
case
UNIQUEID:
case
UNIQUEID:
String
uuid
=(
new
AlternativeJdkIdGenerator
()).
generateId
().
toString
();
et
.
set
(
fieldname
,(
new
AlternativeJdkIdGenerator
()).
generateId
().
toString
().
replace
(
"-"
,
""
));
Object
objUuId
=
fieldValueConvert
(
uuid
,
field
);
beanMap
.
put
(
fileName
,
objUuId
);
break
;
break
;
case
CONTEXT:
case
CONTEXT:
//暂未实现
if
(!
StringUtils
.
isEmpty
(
deFieldDefaultValue
)){
Object
paramFieldValue
=
et
.
get
(
deFieldDefaultValue
);
if
(!
ObjectUtils
.
isEmpty
(
paramFieldValue
)){
et
.
set
(
fieldname
,
paramFieldValue
);
}
}
break
;
break
;
case
PARAM:
case
PARAM:
String
paramField
=
fieldAnnotation
.
defaultValue
();
if
(!
StringUtils
.
isEmpty
(
deFieldDefaultValue
)){
if
(!
StringUtils
.
isEmpty
(
paramField
)){
Object
paramFieldValue
=
et
.
get
(
deFieldDefaultValue
);
Object
paramFieldValue
=
beanMap
.
get
(
paramField
);
if
(!
ObjectUtils
.
isEmpty
(
paramFieldValue
)){
if
(!
ObjectUtils
.
isEmpty
(
paramFieldValue
)){
beanMap
.
put
(
fileN
ame
,
paramFieldValue
);
et
.
set
(
fieldn
ame
,
paramFieldValue
);
}
}
}
}
break
;
break
;
case
OPERATOR:
case
OPERATOR:
beanMap
.
put
(
fileN
ame
,
curUser
.
getUserid
());
et
.
set
(
fieldn
ame
,
curUser
.
getUserid
());
break
;
break
;
case
OPERATORNAME:
case
OPERATORNAME:
beanMap
.
put
(
fileN
ame
,
curUser
.
getPersonname
());
et
.
set
(
fieldn
ame
,
curUser
.
getPersonname
());
break
;
break
;
case
CURTIME:
case
CURTIME:
beanMap
.
put
(
fileN
ame
,
new
Timestamp
(
new
Date
().
getTime
()));
et
.
set
(
fieldn
ame
,
new
Timestamp
(
new
Date
().
getTime
()));
break
;
break
;
case
APPDATA:
case
APPDATA:
//暂未实现
//暂未实现
break
;
break
;
case
NONE:
case
NONE:
Object
deFieldDefaultValueObj
=
fieldValueConvert
(
deFieldDefaultValue
,
field
);
et
.
set
(
fieldname
,
deFieldDefaultValue
);
beanMap
.
put
(
fileName
,
deFieldDefaultValueObj
);
break
;
break
;
}
}
}
}
}
}
}
}
/**
private
void
fillPreFieldValue
(
String
fieldname
,
DEPredefinedFieldType
preFieldType
,
EntityBase
et
,
String
actionName
,
String
logicValue
,
AuthenticationUser
curUser
)
throws
Exception
{
* 填充系统预置属性
Object
fieldValue
=
et
.
get
(
fieldname
);
* @param fileName 实体属性名
* @param preFieldType 预置类型
* @param et 当前实体对象
* @param joinPoint 切点
* @param fieldAnnotation 属性注解
* @throws Exception
*/
private
void
fillPreFieldValue
(
String
fileName
,
DEPredefinedFieldType
preFieldType
,
Object
et
,
JoinPoint
joinPoint
,
DEField
fieldAnnotation
)
throws
Exception
{
AuthenticationUser
curUser
=
AuthenticationUser
.
getAuthenticationUser
();
BeanMap
beanMap
=
BeanMap
.
create
(
et
);
//当前操作行为
String
actionName
=
joinPoint
.
getSignature
().
getName
();
Object
fieldValue
=
beanMap
.
get
(
fileName
);
//获取当前所需填充属性的get、set方法及字段值
PropertyDescriptor
field
=
new
PropertyDescriptor
(
fileName
,
et
.
getClass
());
//为预置属性进行赋值
//为预置属性进行赋值
if
(
(
actionName
.
equalsIgnoreCase
(
"create"
)
&&
org
.
springframework
.
util
.
StringUtils
.
isEmpty
(
fieldValue
)
)||
if
(
actionName
.
equalsIgnoreCase
(
"create"
)||
preFieldType
==
DEPredefinedFieldType
.
UPDATEDATE
||
preFieldType
==
DEPredefinedFieldType
.
UPDATEMAN
||
preFieldType
==
DEPredefinedFieldType
.
UPDATEDATE
||
preFieldType
==
DEPredefinedFieldType
.
UPDATEMAN
||
preFieldType
==
DEPredefinedFieldType
.
UPDATEMANNAME
){
preFieldType
==
DEPredefinedFieldType
.
UPDATEMANNAME
){
switch
(
preFieldType
){
//根据注解给预置属性填充值
switch
(
preFieldType
){
//根据注解给预置属性填充值
case
CREATEMAN:
case
CREATEMAN:
beanMap
.
put
(
fileName
,
curUser
.
getUserid
());
et
.
set
(
fieldname
,
curUser
.
getUserid
());
break
;
break
;
case
CREATEMANNAME:
case
CREATEMANNAME:
beanMap
.
put
(
fileName
,
curUser
.
getPersonname
());
et
.
set
(
fieldname
,
curUser
.
getPersonname
());
break
;
break
;
case
UPDATEMAN:
case
UPDATEMAN:
beanMap
.
put
(
fileName
,
curUser
.
getUserid
());
et
.
set
(
fieldname
,
curUser
.
getUserid
());
break
;
break
;
case
UPDATEMANNAME:
case
UPDATEMANNAME:
beanMap
.
put
(
fileName
,
curUser
.
getPersonname
());
et
.
set
(
fieldname
,
curUser
.
getPersonname
());
break
;
break
;
case
CREATEDATE:
case
CREATEDATE:
beanMap
.
put
(
fileName
,
new
Timestamp
(
new
Date
().
getTime
()));
et
.
set
(
fieldname
,
new
Timestamp
(
new
Date
().
getTime
()));
break
;
break
;
case
UPDATEDATE:
case
UPDATEDATE:
beanMap
.
put
(
fileName
,
new
Timestamp
(
new
Date
().
getTime
()));
et
.
set
(
fieldname
,
new
Timestamp
(
new
Date
().
getTime
()));
break
;
break
;
case
ORGID:
case
ORGID:
beanMap
.
put
(
fileName
,
curUser
.
getOrgid
());
if
(
org
.
springframework
.
util
.
StringUtils
.
isEmpty
(
fieldValue
))
break
;
et
.
set
(
fieldname
,
curUser
.
getOrgid
());
case
ORGNAME:
break
;
beanMap
.
put
(
fileName
,
curUser
.
getOrgname
());
case
ORGNAME:
break
;
if
(
org
.
springframework
.
util
.
StringUtils
.
isEmpty
(
fieldValue
))
case
ORGSECTORID:
et
.
set
(
fieldname
,
curUser
.
getOrgname
());
beanMap
.
put
(
fileName
,
curUser
.
getMdeptid
());
break
;
break
;
case
ORGSECTORID:
case
ORGSECTORNAME:
if
(
org
.
springframework
.
util
.
StringUtils
.
isEmpty
(
fieldValue
))
beanMap
.
put
(
fileName
,
curUser
.
getMdeptname
());
et
.
set
(
fieldname
,
curUser
.
getMdeptid
());
break
;
break
;
case
LOGICVALID:
case
ORGSECTORNAME:
String
logicValue
=
fieldAnnotation
.
logicval
();
if
(
org
.
springframework
.
util
.
StringUtils
.
isEmpty
(
fieldValue
))
Object
objLogicValue
=
fieldValueConvert
(
logicValue
,
field
);
et
.
set
(
fieldname
,
curUser
.
getMdeptname
());
if
(!
StringUtils
.
isEmpty
(
objLogicValue
)){
break
;
beanMap
.
put
(
fileName
,
objLogicValue
);
case
LOGICVALID:
}
if
(!
StringUtils
.
isEmpty
(
logicValue
)){
break
;
logicValue
=
"1"
;
}
}
et
.
set
(
fieldname
,
logicValue
);
break
;
}
}
}
}
}
/**
* 值类型转换
* @param fieldValue
* @param field
*/
private
Object
fieldValueConvert
(
String
fieldValue
,
PropertyDescriptor
field
){
Object
resultValue
=
fieldValue
;
String
targetType
=
field
.
getPropertyType
().
getSimpleName
();
if
(
targetType
.
equals
(
"Boolean"
)){
resultValue
=
Boolean
.
valueOf
(
fieldValue
);
}
else
if
(
targetType
.
equals
(
"Character"
)){
resultValue
=
fieldValue
.
toCharArray
();
}
else
if
(
targetType
.
equals
(
"Byte"
)){
resultValue
=
Byte
.
valueOf
(
fieldValue
);
}
else
if
(
targetType
.
equals
(
"Short"
)){
resultValue
=
Short
.
valueOf
(
fieldValue
);
}
else
if
(
targetType
.
equals
(
"Integer"
)){
resultValue
=
Integer
.
valueOf
(
fieldValue
);
}
else
if
(
targetType
.
equals
(
"Long"
)){
resultValue
=
Long
.
valueOf
(
fieldValue
);
}
else
if
(
targetType
.
equals
(
"Float"
)){
resultValue
=
Float
.
valueOf
(
fieldValue
);
}
else
if
(
targetType
.
equals
(
"Double"
)){
resultValue
=
Double
.
valueOf
(
fieldValue
);
}
return
resultValue
;
}
}
}
ibzou-util/src/main/java/cn/ibizlab/util/cache/CaffeineCacheConfig.java
0 → 100644
浏览文件 @
a31915b3
package
cn
.
ibizlab
.
util
.
cache
;
import
com.github.benmanes.caffeine.cache.CaffeineSpec
;
import
cn.ibizlab.util.cache.cacheManager.CaffeineCacheManager
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.autoconfigure.cache.CacheProperties
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.cache.CacheManager
;
import
org.springframework.cache.annotation.EnableCaching
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Primary
;
import
org.springframework.util.StringUtils
;
/**
* Caffeine缓存配置类
*/
@EnableCaching
@Configuration
@EnableConfigurationProperties
(
CacheProperties
.
class
)
@ConditionalOnProperty
(
"ibiz.enableCaffeineCache"
)
public
class
CaffeineCacheConfig
{
@Autowired
private
CacheProperties
cacheProperties
;
@Autowired
private
CaffeineCacheManager
caffeineCacheManager
;
@Bean
@Primary
public
CacheManager
cacheManager
()
{
String
specification
=
cacheProperties
.
getCaffeine
().
getSpec
();
if
(
StringUtils
.
hasText
(
specification
))
{
caffeineCacheManager
.
setCaffeineSpec
(
CaffeineSpec
.
parse
(
specification
));
}
return
caffeineCacheManager
;
}
}
\ No newline at end of file
ibzou-util/src/main/java/cn/ibizlab/util/cache/RedisCacheConfig.java
0 → 100644
浏览文件 @
a31915b3
package
cn
.
ibizlab
.
util
.
cache
;
import
com.alibaba.fastjson.parser.ParserConfig
;
import
com.fasterxml.jackson.annotation.JsonAutoDetect
;
import
com.fasterxml.jackson.annotation.PropertyAccessor
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.github.benmanes.caffeine.cache.CaffeineSpec
;
import
cn.ibizlab.util.cache.cacheManager.LayeringCacheManager
;
import
cn.ibizlab.util.cache.redis.KryoRedisSerializer
;
import
cn.ibizlab.util.cache.redis.StringRedisSerializer
;
import
cn.ibizlab.util.enums.RedisChannelTopic
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.autoconfigure.cache.CacheProperties
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.cache.CacheManager
;
import
org.springframework.cache.annotation.EnableCaching
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Primary
;
import
org.springframework.data.redis.cache.RedisCacheConfiguration
;
import
org.springframework.data.redis.cache.RedisCacheManager
;
import
org.springframework.data.redis.cache.RedisCacheWriter
;
import
org.springframework.data.redis.connection.RedisConnectionFactory
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.listener.RedisMessageListenerContainer
;
import
org.springframework.data.redis.listener.adapter.MessageListenerAdapter
;
import
org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer
;
import
org.springframework.util.StringUtils
;
/**
* 缓存配置类
* 1级缓存为caffeine
* 2级缓存为redis
*/
@EnableCaching
@Configuration
@EnableConfigurationProperties
(
CacheProperties
.
class
)
@ConditionalOnProperty
(
"ibiz.enableRedisCache"
)
public
class
RedisCacheConfig
{
@Autowired
private
RedisCacheWriter
redisCacheWriter
;
@Autowired
private
RedisCacheConfiguration
configuration
;
@Autowired
LayeringCacheManager
layeringCacheManager
;
@Autowired
private
CacheProperties
cacheProperties
;
@Bean
public
RedisCacheManager
redisCacheManager
(
RedisConnectionFactory
connectionFactory
)
{
return
RedisCacheManager
.
create
(
connectionFactory
);
}
@Bean
public
RedisCacheWriter
redisCacheWriter
(
RedisConnectionFactory
connectionFactory
){
RedisCacheWriter
redisCacheWriter
=
RedisCacheWriter
.
nonLockingRedisCacheWriter
(
connectionFactory
);
return
redisCacheWriter
;
}
/**
* 重写Redis序列化方式,使用Json方式:
* 当我们的数据存储到Redis的时候,我们的键(key)和值(value)都是通过Spring提供的Serializer序列化到数据库的。RedisTemplate默认使用的是JdkSerializationRedisSerializer,StringRedisTemplate默认使用的是StringRedisSerializer。
* Spring Data JPA为我们提供了下面的Serializer:
* GenericToStringSerializer、Jackson2JsonRedisSerializer、JacksonJsonRedisSerializer、JdkSerializationRedisSerializer、OxmSerializer、StringRedisSerializer。
* 在此我们将自己配置RedisTemplate并定义Serializer。
*
* @param redisConnectionFactory
* @return
*/
@Bean
public
RedisTemplate
<
String
,
Object
>
redisTemplate
(
RedisConnectionFactory
redisConnectionFactory
)
{
RedisTemplate
<
String
,
Object
>
redisTemplate
=
new
RedisTemplate
<>();
redisTemplate
.
setConnectionFactory
(
redisConnectionFactory
);
Jackson2JsonRedisSerializer
<
Object
>
jackson2JsonRedisSerializer
=
new
Jackson2JsonRedisSerializer
<
Object
>(
Object
.
class
);
ObjectMapper
om
=
new
ObjectMapper
();
om
.
setVisibility
(
PropertyAccessor
.
ALL
,
JsonAutoDetect
.
Visibility
.
ANY
);
om
.
enableDefaultTyping
(
ObjectMapper
.
DefaultTyping
.
NON_FINAL
);
jackson2JsonRedisSerializer
.
setObjectMapper
(
om
);
ParserConfig
.
getGlobalInstance
().
setAutoTypeSupport
(
true
);
KryoRedisSerializer
<
Object
>
kryoRedisSerializer
=
new
KryoRedisSerializer
<>(
Object
.
class
);
redisTemplate
.
setValueSerializer
(
kryoRedisSerializer
);
// 设置值(value)的序列化采用KryoRedisSerializer。
redisTemplate
.
setHashValueSerializer
(
kryoRedisSerializer
);
redisTemplate
.
setKeySerializer
(
new
StringRedisSerializer
());
// 设置键(key)的序列化采用StringRedisSerializer。
redisTemplate
.
setHashKeySerializer
(
new
StringRedisSerializer
());
redisTemplate
.
afterPropertiesSet
();
return
redisTemplate
;
}
@Bean
@Primary
public
CacheManager
cacheManager
()
{
setCaffeineCacheConfig
(
layeringCacheManager
);
//Caffeine缓存设置
layeringCacheManager
.
setRedisCacheWriter
(
redisCacheWriter
);
layeringCacheManager
.
setRedisConfiguration
(
configuration
);
return
layeringCacheManager
;
}
private
void
setCaffeineCacheConfig
(
LayeringCacheManager
layeringCacheManager
)
{
String
specification
=
cacheProperties
.
getCaffeine
().
getSpec
();
if
(
StringUtils
.
hasText
(
specification
))
{
layeringCacheManager
.
setCaffeineSpec
(
CaffeineSpec
.
parse
(
specification
));
}
}
/**
* 监听redis指定频道
* @param redisConnectionFactory
* @param messageListener
* @return
*/
@Bean
RedisMessageListenerContainer
redisContainer
(
RedisConnectionFactory
redisConnectionFactory
,
MessageListenerAdapter
messageListener
)
{
final
RedisMessageListenerContainer
container
=
new
RedisMessageListenerContainer
();
container
.
setConnectionFactory
(
redisConnectionFactory
);
container
.
addMessageListener
(
messageListener
,
RedisChannelTopic
.
REDIS_CACHE_DELETE_TOPIC
.
getChannelTopic
());
container
.
addMessageListener
(
messageListener
,
RedisChannelTopic
.
REDIS_CACHE_CLEAR_TOPIC
.
getChannelTopic
());
return
container
;
}
}
\ No newline at end of file
ibzou-util/src/main/java/cn/ibizlab/util/cache/cache/CusRedisCache.java
0 → 100644
浏览文件 @
a31915b3
package
cn
.
ibizlab
.
util
.
cache
.
cache
;
import
org.springframework.data.redis.cache.RedisCache
;
import
org.springframework.data.redis.cache.RedisCacheConfiguration
;
import
org.springframework.data.redis.cache.RedisCacheWriter
;
/**
* 自定义的redis缓存
*/
public
class
CusRedisCache
extends
RedisCache
{
public
CusRedisCache
(
String
name
,
RedisCacheWriter
redisCacheWriter
,
RedisCacheConfiguration
configuration
)
{
super
(
name
,
redisCacheWriter
,
configuration
);
}
}
ibzou-util/src/main/java/cn/ibizlab/util/cache/cache/LayeringCache.java
0 → 100644
浏览文件 @
a31915b3
package
cn
.
ibizlab
.
util
.
cache
.
cache
;
import
cn.ibizlab.util.cache.listener.RedisPublisher
;
import
cn.ibizlab.util.enums.RedisChannelTopic
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.cache.caffeine.CaffeineCache
;
import
org.springframework.cache.support.AbstractValueAdaptingCache
;
import
org.springframework.cache.support.NullValue
;
import
org.springframework.data.redis.cache.RedisCache
;
import
org.springframework.data.redis.cache.RedisCacheConfiguration
;
import
org.springframework.data.redis.cache.RedisCacheWriter
;
import
org.springframework.data.redis.core.RedisOperations
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.concurrent.Callable
;
/**
* 缓存分层类
* 1级缓存为caffeine
* 2级缓存为redis
*/
public
class
LayeringCache
extends
AbstractValueAdaptingCache
{
Logger
logger
=
LoggerFactory
.
getLogger
(
LayeringCache
.
class
);
/**
* 缓存的名称
*/
private
final
String
name
;
/**
* redis缓存
*/
private
RedisCache
redisCache
;
/**
* Caffeine缓存
*/
private
final
CaffeineCache
caffeineCache
;
/**
* redis消息发布
*/
RedisOperations
<?
extends
Object
,
?
extends
Object
>
redisOperations
;
public
LayeringCache
(
String
name
,
RedisOperations
redisOperations
,
com
.
github
.
benmanes
.
caffeine
.
cache
.
Cache
<
Object
,
Object
>
caffeineCache
,
RedisCacheWriter
redisCacheWriter
,
RedisCacheConfiguration
configuration
)
{
super
(
true
);
this
.
name
=
name
;
this
.
redisCache
=
new
CusRedisCache
(
name
,
redisCacheWriter
,
configuration
);
this
.
caffeineCache
=
new
CaffeineCache
(
name
,
caffeineCache
,
true
);
this
.
redisOperations
=
redisOperations
;
}
@Override
public
String
getName
()
{
return
this
.
name
;
}
@Override
public
Object
getNativeCache
()
{
return
this
;
}
@Override
public
ValueWrapper
get
(
Object
key
)
{
// 查询一级缓存
ValueWrapper
wrapper
=
caffeineCache
.
get
(
key
);
logger
.
debug
(
"查询一级缓存 key:{},value:{}"
,
key
,
wrapper
);
if
(
wrapper
==
null
)
{
// 查询二级缓存
wrapper
=
redisCache
.
get
(
key
);
caffeineCache
.
put
(
key
,
wrapper
==
null
?
null
:
wrapper
.
get
());
logger
.
debug
(
"查询二级缓存,并将数据放到一级缓存。 key:{}"
,
key
);
}
return
wrapper
;
}
@Override
public
<
T
>
T
get
(
Object
key
,
Class
<
T
>
type
)
{
// 查询一级缓存
T
value
=
caffeineCache
.
get
(
key
,
type
);
logger
.
debug
(
"查询一级缓存 key:{}"
,
key
);
if
(
value
==
null
)
{
// 查询二级缓存
value
=
redisCache
.
get
(
key
,
type
);
caffeineCache
.
put
(
key
,
value
);
logger
.
debug
(
"查询二级缓存,并将数据放到一级缓存。 key:{}"
,
key
);
}
return
value
;
}
@SuppressWarnings
(
"unchecked"
)
@Override
public
<
T
>
T
get
(
Object
key
,
Callable
<
T
>
valueLoader
)
{
// 查询一级缓存,如果一级缓存没有值则调用getForSecondaryCache(k, valueLoader)查询二级缓存
T
value
=
(
T
)
caffeineCache
.
getNativeCache
().
get
(
key
,
k
->
getSecondCache
(
k
,
valueLoader
));
if
(
value
==
null
)
{
// 直接查询二级缓存
value
=
(
T
)
getSecondCache
(
key
,
valueLoader
);
}
if
(
value
instanceof
NullValue
)
{
return
null
;
}
return
value
;
}
@Override
public
void
put
(
Object
key
,
Object
value
)
{
caffeineCache
.
put
(
key
,
value
);
redisCache
.
put
(
key
,
value
);
}
@Override
public
ValueWrapper
putIfAbsent
(
Object
key
,
Object
value
)
{
caffeineCache
.
putIfAbsent
(
key
,
value
);
return
redisCache
.
putIfAbsent
(
key
,
value
);
}
@Override
public
void
evict
(
Object
key
)
{
redisCache
.
evict
(
key
);
//清除redis中的二级缓存
caffeineCache
.
evict
(
key
);
//清除本机一级缓存
Map
<
String
,
Object
>
message
=
new
HashMap
<>();
message
.
put
(
"cacheName"
,
name
);
message
.
put
(
"key"
,
key
);
RedisPublisher
redisPublisher
=
new
RedisPublisher
(
redisOperations
,
RedisChannelTopic
.
REDIS_CACHE_DELETE_TOPIC
.
getChannelTopic
());
// 创建redis发布者
redisPublisher
.
publisher
(
message
);
//发布消息,清除其它集群机器中的一级缓存
logger
.
debug
(
String
.
format
(
"清除二级缓存数据[%s]"
,
key
));
}
@Override
public
void
clear
()
{
redisCache
.
clear
();
//清除redis中的二级缓存
caffeineCache
.
clear
();
//清除本机一级缓存
Map
<
String
,
Object
>
message
=
new
HashMap
<>();
message
.
put
(
"cacheName"
,
name
);
RedisPublisher
redisPublisher
=
new
RedisPublisher
(
redisOperations
,
RedisChannelTopic
.
REDIS_CACHE_CLEAR_TOPIC
.
getChannelTopic
());
// 创建redis发布者
redisPublisher
.
publisher
(
message
);
//发布消息,清除其它集群机器中的一级缓存
}
@Override
protected
Object
lookup
(
Object
key
)
{
Object
value
=
caffeineCache
.
get
(
key
);
logger
.
debug
(
"查询一级缓存 key:{}"
,
key
);
if
(
value
==
null
)
{
value
=
redisCache
.
get
(
key
);
logger
.
debug
(
"查询二级缓存 key:{}"
,
key
);
}
return
value
;
}
/**
* 查询二级缓存
* @param key
* @param valueLoader
* @return
*/
private
<
T
>
Object
getSecondCache
(
Object
key
,
Callable
<
T
>
valueLoader
)
{
T
value
=
redisCache
.
get
(
key
,
valueLoader
);
logger
.
debug
(
"查询二级缓存 key:{}"
,
key
);
return
toStoreValue
(
value
);
}
/**
* 获取caffeine缓存
* @return
*/
public
CaffeineCache
getFirstCache
()
{
return
this
.
caffeineCache
;
}
}
ibzou-util/src/main/java/cn/ibizlab/util/cache/cacheManager/CaffeineCacheManager.java
0 → 100644
浏览文件 @
a31915b3
package
cn
.
ibizlab
.
util
.
cache
.
cacheManager
;
import
com.github.benmanes.caffeine.cache.Caffeine
;
import
com.github.benmanes.caffeine.cache.CaffeineSpec
;
import
lombok.Data
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
;
import
org.springframework.cache.Cache
;
import
org.springframework.cache.CacheManager
;
import
org.springframework.cache.caffeine.CaffeineCache
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.ObjectUtils
;
import
java.util.Collection
;
import
java.util.Collections
;
import
java.util.Map
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.concurrent.ConcurrentMap
;
import
java.util.concurrent.TimeUnit
;
/**
* Caffeine本地缓存
*/
@Data
@Component
@ConditionalOnProperty
(
"ibiz.enableCaffeineCache"
)
public
class
CaffeineCacheManager
implements
CacheManager
{
private
static
final
int
DEFAULT_EXPIRE_AFTER_WRITE
=
1
;
private
static
final
int
DEFAULT_INITIAL_CAPACITY
=
5
;
private
static
final
int
DEFAULT_MAXIMUM_SIZE
=
1_000
;
private
final
ConcurrentMap
<
String
,
Cache
>
cacheMap
=
new
ConcurrentHashMap
<
String
,
Cache
>(
16
);
/**
* 缓存默认设置
*/
private
Caffeine
<
Object
,
Object
>
cacheBuilder
=
Caffeine
.
newBuilder
()
.
expireAfterAccess
(
DEFAULT_EXPIRE_AFTER_WRITE
,
TimeUnit
.
HOURS
)
.
initialCapacity
(
DEFAULT_INITIAL_CAPACITY
)
.
maximumSize
(
DEFAULT_MAXIMUM_SIZE
);
/**
* 获取缓存对象
* @param name
* @return
*/
@Override
public
Cache
getCache
(
String
name
)
{
Cache
cache
=
this
.
cacheMap
.
get
(
name
);
if
(
cache
==
null
)
{
synchronized
(
this
.
cacheMap
)
{
cache
=
this
.
cacheMap
.
get
(
name
);
if
(
cache
==
null
)
{
cache
=
createCache
(
name
);
this
.
cacheMap
.
put
(
name
,
cache
);
}
}
}
return
cache
;
}
/**
* 获取缓存名
* @return
*/
@Override
public
Collection
<
String
>
getCacheNames
()
{
return
Collections
.
unmodifiableSet
(
this
.
cacheMap
.
keySet
());
}
/**
* 创建缓存
* @param name
* @return
*/
protected
Cache
createCache
(
String
name
)
{
return
new
CaffeineCache
(
name
,
this
.
cacheBuilder
.
build
(),
true
);
}
/**
* 缓存配置[缓存容量大小、时长等]
* @param caffeineSpec
*/
public
void
setCaffeineSpec
(
CaffeineSpec
caffeineSpec
)
{
Caffeine
<
Object
,
Object
>
cacheBuilder
=
Caffeine
.
from
(
caffeineSpec
);
if
(!
ObjectUtils
.
nullSafeEquals
(
this
.
cacheBuilder
,
cacheBuilder
))
{
this
.
cacheBuilder
=
cacheBuilder
;
refreshKnownCaches
();
}
}
/**
* 使用该CacheManager的当前状态重新创建已知的缓存。
*/
private
void
refreshKnownCaches
()
{
for
(
Map
.
Entry
<
String
,
Cache
>
entry
:
this
.
cacheMap
.
entrySet
())
{
entry
.
setValue
(
createCache
(
entry
.
getKey
()));
}
}
}
ibzou-util/src/main/java/cn/ibizlab/util/cache/cacheManager/LayeringCacheManager.java
0 → 100644
浏览文件 @
a31915b3
package
cn
.
ibizlab
.
util
.
cache
.
cacheManager
;
import
com.github.benmanes.caffeine.cache.Caffeine
;
import
com.github.benmanes.caffeine.cache.CaffeineSpec
;
import
lombok.Data
;
import
cn.ibizlab.util.cache.cache.LayeringCache
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
;
import
org.springframework.cache.Cache
;
import
org.springframework.cache.CacheManager
;
import
org.springframework.data.redis.cache.RedisCacheConfiguration
;
import
org.springframework.data.redis.cache.RedisCacheWriter
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.ObjectUtils
;
import
java.util.Collection
;
import
java.util.Collections
;
import
java.util.Map
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.concurrent.ConcurrentMap
;
import
java.util.concurrent.TimeUnit
;
/**
* 缓存分层类
* 1级缓存为caffeine
* 2级缓存为redis
*/
@Data
@Component
@ConditionalOnProperty
(
"ibiz.enableRedisCache"
)
public
class
LayeringCacheManager
implements
CacheManager
{
private
static
final
int
DEFAULT_EXPIRE_AFTER_WRITE
=
1
;
private
static
final
int
DEFAULT_INITIAL_CAPACITY
=
5
;
private
static
final
int
DEFAULT_MAXIMUM_SIZE
=
1_000
;
private
final
ConcurrentMap
<
String
,
Cache
>
cacheMap
=
new
ConcurrentHashMap
<
String
,
Cache
>(
16
);
public
RedisCacheWriter
redisCacheWriter
;
public
RedisCacheConfiguration
redisConfiguration
;
@Autowired
public
RedisTemplate
<
String
,
Object
>
redisTemplate
;
/**
* 缓存默认设置
*/
private
Caffeine
<
Object
,
Object
>
cacheBuilder
=
Caffeine
.
newBuilder
()
.
expireAfterAccess
(
DEFAULT_EXPIRE_AFTER_WRITE
,
TimeUnit
.
HOURS
)
.
initialCapacity
(
DEFAULT_INITIAL_CAPACITY
)
.
maximumSize
(
DEFAULT_MAXIMUM_SIZE
);
/**
* 获取缓存对象
* @param name
* @return
*/
@Override
public
Cache
getCache
(
String
name
)
{
Cache
cache
=
this
.
cacheMap
.
get
(
name
);
if
(
cache
==
null
)
{
synchronized
(
this
.
cacheMap
)
{
cache
=
this
.
cacheMap
.
get
(
name
);
if
(
cache
==
null
)
{
cache
=
createCache
(
name
);
this
.
cacheMap
.
put
(
name
,
cache
);
}
}
}
return
cache
;
}
@Override
public
Collection
<
String
>
getCacheNames
()
{
return
Collections
.
unmodifiableSet
(
this
.
cacheMap
.
keySet
());
}
protected
Cache
createCache
(
String
name
)
{
return
new
LayeringCache
(
name
,
redisTemplate
,
this
.
cacheBuilder
.
build
(),
redisCacheWriter
,
redisConfiguration
);
}
/**
* 使用该CacheManager的当前状态重新创建已知的缓存
*/
private
void
refreshKnownCaches
()
{
for
(
Map
.
Entry
<
String
,
Cache
>
entry
:
this
.
cacheMap
.
entrySet
())
{
entry
.
setValue
(
createCache
(
entry
.
getKey
()));
}
}
public
void
setCaffeineSpec
(
CaffeineSpec
caffeineSpec
)
{
Caffeine
<
Object
,
Object
>
cacheBuilder
=
Caffeine
.
from
(
caffeineSpec
);
if
(!
ObjectUtils
.
nullSafeEquals
(
this
.
cacheBuilder
,
cacheBuilder
))
{
this
.
cacheBuilder
=
cacheBuilder
;
refreshKnownCaches
();
}
}
}
ibzou-util/src/main/java/cn/ibizlab/util/cache/listener/RedisMessageListener.java
浏览文件 @
a31915b3
package
cn
.
ibizlab
.
util
.
cache
.
listener
;
package
cn
.
ibizlab
.
util
.
cache
.
listener
;
import
cn.ibizlab.util.cache.cache.LayeringCache
;
import
cn.ibizlab.util.enums.RedisChannelTopic
;
import
cn.ibizlab.util.enums.RedisChannelTopic
;
import
cn.ibizlab.util.cache.layering.LayeringCache
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
;
import
org.springframework.cache.Cache
;
import
org.springframework.cache.Cache
;
import
org.springframework.cache.CacheManager
;
import
org.springframework.cache.CacheManager
;
import
org.springframework.context.annotation.Profile
;
import
org.springframework.data.redis.connection.Message
;
import
org.springframework.data.redis.connection.Message
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.listener.adapter.MessageListenerAdapter
;
import
org.springframework.data.redis.listener.adapter.MessageListenerAdapter
;
import
org.springframework.data.redis.serializer.RedisSerializer
;
import
org.springframework.data.redis.serializer.RedisSerializer
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
import
java.util.Map
;
import
java.util.Map
;
/**
/**
* redis消息的订阅者
* redis消息的订阅者
*/
*/
@Profile
(
"prod"
)
@Component
@Component
@ConditionalOnProperty
(
"ibiz.enableRedisCache"
)
public
class
RedisMessageListener
extends
MessageListenerAdapter
{
public
class
RedisMessageListener
extends
MessageListenerAdapter
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
RedisPublisher
.
class
);
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
RedisPublisher
.
class
);
@Autowired
@Autowired
...
@@ -38,7 +41,7 @@ public class RedisMessageListener extends MessageListenerAdapter {
...
@@ -38,7 +41,7 @@ public class RedisMessageListener extends MessageListenerAdapter {
map
=
(
Map
<
String
,
Object
>)
result
;
map
=
(
Map
<
String
,
Object
>)
result
;
}
}
if
(
StringUtils
.
isEmpty
(
map
)||
(!
map
.
containsKey
(
"cacheName"
))||
(!
map
.
containsKey
(
"key"
))){
if
(
StringUtils
.
isEmpty
(
map
)||
(!
map
.
containsKey
(
"cacheName"
))||
(!
map
.
containsKey
(
"key"
))){
logger
.
info
(
"解析缓存数据失败,无法获取指定值!"
);
logger
.
debug
(
"解析缓存数据失败,无法获取指定值!"
);
return
;
return
;
}
}
logger
.
debug
(
"redis消息订阅者接收到频道【{}】发布的消息。消息内容:{}"
,
channelTopic
.
getChannelTopicStr
(),
result
.
toString
());
logger
.
debug
(
"redis消息订阅者接收到频道【{}】发布的消息。消息内容:{}"
,
channelTopic
.
getChannelTopicStr
(),
result
.
toString
());
...
...
ibzou-util/src/main/java/cn/ibizlab/util/domain/EntityBase.java
浏览文件 @
a31915b3
...
@@ -10,6 +10,7 @@ import org.springframework.cglib.beans.BeanMap;
...
@@ -10,6 +10,7 @@ import org.springframework.cglib.beans.BeanMap;
import
org.springframework.data.annotation.Transient
;
import
org.springframework.data.annotation.Transient
;
import
org.springframework.util.AlternativeJdkIdGenerator
;
import
org.springframework.util.AlternativeJdkIdGenerator
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
org.springframework.util.StringUtils
;
import
java.util.*
;
import
java.util.*
;
public
class
EntityBase
implements
Serializable
{
public
class
EntityBase
implements
Serializable
{
...
@@ -68,14 +69,11 @@ public class EntityBase implements Serializable {
...
@@ -68,14 +69,11 @@ public class EntityBase implements Serializable {
public
Object
get
(
String
field
)
{
public
Object
get
(
String
field
)
{
field
=
field
.
toLowerCase
();
String
fieldRealName
=
DEFieldCacheMap
.
getFieldRealName
(
this
.
getClass
(),
field
);
Hashtable
<
String
,
String
>
keys
=
DEFieldCacheMap
.
getFieldKeys
(
this
.
getClass
().
getName
());
if
(!
StringUtils
.
isEmpty
(
fieldRealName
))
if
(
keys
.
containsKey
(
field
))
return
getMap
().
get
(
fieldRealName
);
return
getMap
().
get
(
keys
.
get
(
field
));
else
if
(
keys
.
containsKey
(
field
.
replace
(
"_"
,
""
)))
return
getMap
().
get
(
keys
.
get
(
field
.
replace
(
"_"
,
""
)));
else
else
return
this
.
extensionparams
.
get
(
field
);
return
this
.
extensionparams
.
get
(
field
.
toLowerCase
()
);
}
}
...
@@ -87,13 +85,15 @@ public class EntityBase implements Serializable {
...
@@ -87,13 +85,15 @@ public class EntityBase implements Serializable {
@JsonAnySetter
@JsonAnySetter
public
void
set
(
String
field
,
Object
value
)
{
public
void
set
(
String
field
,
Object
value
)
{
field
=
field
.
toLowerCase
();
field
=
field
.
toLowerCase
();
Hashtable
<
String
,
String
>
keys
=
DEFieldCacheMap
.
getFieldKeys
(
this
.
getClass
().
getName
());
String
fieldRealName
=
DEFieldCacheMap
.
getFieldRealName
(
this
.
getClass
(),
field
);
if
(
keys
.
containsKey
(
field
))
if
(!
StringUtils
.
isEmpty
(
fieldRealName
))
{
getMap
().
put
(
keys
.
get
(
field
),
value
);
if
(
value
==
null
)
else
if
(
keys
.
containsKey
(
field
.
replace
(
"_"
,
""
)))
getMap
().
put
(
fieldRealName
,
null
);
getMap
().
put
(
keys
.
get
(
field
.
replace
(
"_"
,
""
)),
value
);
else
getMap
().
put
(
fieldRealName
,
DEFieldCacheMap
.
fieldValueOf
(
this
.
getClass
(),
fieldRealName
,
value
));
}
else
else
this
.
extensionparams
.
put
(
field
,
value
);
this
.
extensionparams
.
put
(
field
.
toLowerCase
()
,
value
);
}
}
}
}
\ No newline at end of file
ibzou-util/src/main/java/cn/ibizlab/util/filter/QueryWrapperContext.java
浏览文件 @
a31915b3
package
cn
.
ibizlab
.
util
.
filter
;
package
cn
.
ibizlab
.
util
.
filter
;
import
cn.ibizlab.util.helper.DEFieldCacheMap
;
import
com.alibaba.fastjson.annotation.JSONField
;
import
com.alibaba.fastjson.annotation.JSONField
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
...
@@ -9,6 +10,8 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -9,6 +10,8 @@ import lombok.extern.slf4j.Slf4j;
import
org.springframework.data.domain.Sort
;
import
org.springframework.data.domain.Sort
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
import
java.lang.reflect.ParameterizedType
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Iterator
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.List
;
...
@@ -48,13 +51,15 @@ public class QueryWrapperContext<T> extends SearchContextBase implements ISearch
...
@@ -48,13 +51,15 @@ public class QueryWrapperContext<T> extends SearchContextBase implements ISearch
if
(
ObjectUtils
.
isEmpty
(
it_sort
))
if
(
ObjectUtils
.
isEmpty
(
it_sort
))
return
page
;
return
page
;
ParameterizedType
parameterizedType
=
(
ParameterizedType
)
getClass
().
getGenericSuperclass
();
Class
<
T
>
type
=
(
Class
<
T
>)
parameterizedType
.
getActualTypeArguments
()[
0
];
while
(
it_sort
.
hasNext
())
{
while
(
it_sort
.
hasNext
())
{
Sort
.
Order
sort_order
=
it_sort
.
next
();
Sort
.
Order
sort_order
=
it_sort
.
next
();
if
(
sort_order
.
getDirection
()==
Sort
.
Direction
.
ASC
){
if
(
sort_order
.
getDirection
()==
Sort
.
Direction
.
ASC
){
asc_fieldList
.
add
(
sort_order
.
getProperty
(
));
asc_fieldList
.
add
(
DEFieldCacheMap
.
getFieldColumnName
(
type
,
sort_order
.
getProperty
()
));
}
}
else
if
(
sort_order
.
getDirection
()==
Sort
.
Direction
.
DESC
){
else
if
(
sort_order
.
getDirection
()==
Sort
.
Direction
.
DESC
){
desc_fieldList
.
add
(
sort_order
.
getProperty
(
));
desc_fieldList
.
add
(
DEFieldCacheMap
.
getFieldColumnName
(
type
,
sort_order
.
getProperty
()
));
}
}
}
}
...
...
ibzou-util/src/main/java/cn/ibizlab/util/helper/DEFieldCacheMap.java
浏览文件 @
a31915b3
package
cn
.
ibizlab
.
util
.
helper
;
package
cn
.
ibizlab
.
util
.
helper
;
import
cn.ibizlab.util.annotation.DEField
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.StringUtils
;
import
java.lang.reflect.Field
;
import
java.lang.reflect.Field
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Hashtable
;
import
java.util.Hashtable
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -17,103 +20,186 @@ public class DEFieldCacheMap {
...
@@ -17,103 +20,186 @@ public class DEFieldCacheMap {
private
static
Hashtable
<
String
,
Hashtable
<
String
,
String
>>
cacheKey
=
new
Hashtable
<>();
private
static
Hashtable
<
String
,
Hashtable
<
String
,
String
>>
cacheKey
=
new
Hashtable
<>();
private
static
Hashtable
<
String
,
Hashtable
<
String
,
DEField
>>
cacheDEField
=
new
Hashtable
<>();
private
static
Hashtable
<
String
,
String
>
cacheDEKeyField
=
new
Hashtable
<>();
private
static
Object
objLock1
=
new
Object
();
private
static
Object
objLock1
=
new
Object
();
private
static
Object
objLock2
=
new
Object
();
private
static
Object
objLock3
=
new
Object
();
/**
/**
* 将实体对象中的属性存入缓存中
* 将实体对象中的属性存入缓存中
* @param
className
* @param
* @return
* @return
*/
*/
public
static
Hashtable
<
String
,
Field
>
getFieldMap
(
String
className
)
{
public
static
<
T
>
Hashtable
<
String
,
Field
>
getFieldMap
(
Class
<
T
>
clazz
)
{
String
className
=
clazz
.
getName
();
if
(
className
.
indexOf
(
"_$"
)>
0
)
if
(
className
.
indexOf
(
"_$"
)>
0
)
className
=
className
.
substring
(
0
,
className
.
lastIndexOf
(
"_$"
));
className
=
className
.
substring
(
0
,
className
.
lastIndexOf
(
"_$"
));
if
(
cacheMap
.
containsKey
(
className
))
if
(
cacheMap
.
containsKey
(
className
))
return
cacheMap
.
get
(
className
);
return
cacheMap
.
get
(
className
);
synchronized
(
objLock1
)
{
synchronized
(
objLock1
)
{
if
(
cacheMap
.
containsKey
(
className
))
if
(
cacheMap
.
containsKey
(
className
))
return
cacheMap
.
get
(
className
);
return
cacheMap
.
get
(
className
);
Hashtable
<
String
,
Field
>
result
=
new
Hashtable
<
String
,
Field
>();
Class
clazz
=
null
;
List
<
Field
>
list
=
new
ArrayList
<
Field
>();
try
{
Hashtable
<
String
,
String
>
keys
=
new
Hashtable
<
String
,
String
>();
clazz
=
Class
.
forName
(
className
);
Hashtable
<
String
,
DEField
>
defields
=
new
Hashtable
<>();
}
Hashtable
<
String
,
String
>
dekeyfields
=
new
Hashtable
<>();
catch
(
Exception
ex
)
{
Field
[]
fields
=
clazz
.
getDeclaredFields
();
cacheMap
.
put
(
className
,
new
Hashtable
<
String
,
Field
>());
for
(
Field
field:
fields
){
return
cacheMap
.
get
(
className
);
result
.
put
(
field
.
getName
(),
field
);
}
list
.
add
(
field
);
keys
.
put
(
field
.
getName
().
toLowerCase
(),
field
.
getName
());
Hashtable
<
String
,
Field
>
result
=
cacheMap
.
get
(
className
);
DEField
deField
=
field
.
getAnnotation
(
DEField
.
class
);
if
(
result
==
null
)
{
if
(!
ObjectUtils
.
isEmpty
(
deField
))
{
result
=
new
Hashtable
<
String
,
Field
>();
defields
.
put
(
field
.
getName
(),
deField
);
Field
[]
fields
=
clazz
.
getDeclaredFields
();
if
(
deField
.
isKeyField
())
for
(
Field
field:
fields
){
cacheDEKeyField
.
put
(
className
,
field
.
getName
());
result
.
put
(
field
.
getName
(),
field
);
}
}
cacheMap
.
put
(
className
,
result
);
}
}
cacheMap
.
put
(
className
,
result
);
cacheList
.
put
(
className
,
list
);
cacheKey
.
put
(
className
,
keys
);
cacheDEField
.
put
(
className
,
defields
);
return
result
;
return
result
;
}
}
}
}
public
static
Hashtable
<
String
,
Field
>
getFieldMap
(
String
className
)
{
if
(
className
.
indexOf
(
"_$"
)>
0
)
className
=
className
.
substring
(
0
,
className
.
lastIndexOf
(
"_$"
));
if
(
cacheMap
.
containsKey
(
className
))
return
cacheMap
.
get
(
className
);
Class
clazz
=
null
;
try
{
clazz
=
Class
.
forName
(
className
);
return
getFieldMap
(
clazz
);
}
catch
(
Exception
ex
)
{
cacheMap
.
put
(
className
,
new
Hashtable
<
String
,
Field
>());
return
cacheMap
.
get
(
className
);
}
}
/**
/**
* 从缓存中查询实体对象属性
列表
* 从缓存中查询实体对象属性
集合
* @param
className
* @param
* @return
* @return
*/
*/
public
static
List
<
Field
>
getFields
(
String
className
)
{
public
static
<
T
>
Hashtable
<
String
,
DEField
>
getDEFields
(
Class
<
T
>
clazz
)
{
String
className
=
clazz
.
getName
();
if
(
className
.
indexOf
(
"_$"
)>
0
)
className
=
className
.
substring
(
0
,
className
.
lastIndexOf
(
"_$"
));
if
(
cacheDEField
.
containsKey
(
className
))
return
cacheDEField
.
get
(
className
);
else
{
DEFieldCacheMap
.
getFieldMap
(
clazz
);
return
cacheDEField
.
get
(
className
);
}
}
/**
* 从缓存中查询实体对象主键
* @param
* @return
*/
public
static
<
T
>
String
getDEKeyField
(
Class
<
T
>
clazz
)
{
String
className
=
clazz
.
getName
();
if
(
className
.
indexOf
(
"_$"
)>
0
)
if
(
className
.
indexOf
(
"_$"
)>
0
)
className
=
className
.
substring
(
0
,
className
.
lastIndexOf
(
"_$"
));
className
=
className
.
substring
(
0
,
className
.
lastIndexOf
(
"_$"
));
if
(
cacheDEKeyField
.
containsKey
(
className
))
return
cacheDEKeyField
.
get
(
className
);
else
{
DEFieldCacheMap
.
getFieldMap
(
clazz
);
return
cacheDEKeyField
.
get
(
className
);
}
}
/**
* 从缓存中查询实体对象属性列表
* @param
* @return
*/
public
static
<
T
>
List
<
Field
>
getFields
(
Class
<
T
>
clazz
)
{
String
className
=
clazz
.
getName
();
if
(
className
.
indexOf
(
"_$"
)>
0
)
className
=
className
.
substring
(
0
,
className
.
lastIndexOf
(
"_$"
));
if
(
cacheList
.
containsKey
(
className
))
if
(
cacheList
.
containsKey
(
className
))
return
cacheList
.
get
(
className
);
return
cacheList
.
get
(
className
);
else
{
DEFieldCacheMap
.
getFieldMap
(
clazz
);
return
cacheList
.
get
(
className
);
}
}
synchronized
(
objLock2
)
{
public
static
List
<
Field
>
getFields
(
String
className
)
{
if
(
cacheList
.
containsKey
(
className
))
if
(
className
.
indexOf
(
"_$"
)>
0
)
return
cacheList
.
get
(
className
);
className
=
className
.
substring
(
0
,
className
.
lastIndexOf
(
"_$"
));
Hashtable
<
String
,
Field
>
fieldmap
=
DEFieldCacheMap
.
getFieldMap
(
className
);
if
(
cacheList
.
containsKey
(
className
))
Iterator
it
=
fieldmap
.
keySet
().
iterator
();
return
cacheList
.
get
(
className
);
List
<
Field
>
list
=
new
ArrayList
<
Field
>();
else
{
while
(
it
.
hasNext
())
{
DEFieldCacheMap
.
getFieldMap
(
className
);
Object
key
=
it
.
next
();
return
cacheList
.
get
(
className
);
if
(
fieldmap
.
get
(
key
.
toString
())!=
null
)
list
.
add
(
fieldmap
.
get
(
key
.
toString
()));
}
cacheList
.
put
(
className
,
list
);
return
list
;
}
}
}
}
/**
/**
* 从缓存中查询实体对象属性列表
* 从缓存中查询实体对象属性列表
* @param
className
* @param
* @return
* @return
*/
*/
public
static
Hashtable
<
String
,
String
>
getFieldKeys
(
String
className
)
{
public
static
<
T
>
Hashtable
<
String
,
String
>
getFieldKeys
(
Class
<
T
>
clazz
)
{
String
className
=
clazz
.
getName
();
if
(
className
.
indexOf
(
"_$"
)>
0
)
if
(
className
.
indexOf
(
"_$"
)>
0
)
className
=
className
.
substring
(
0
,
className
.
lastIndexOf
(
"_$"
));
className
=
className
.
substring
(
0
,
className
.
lastIndexOf
(
"_$"
));
if
(
cacheKey
.
containsKey
(
className
))
if
(
cacheKey
.
containsKey
(
className
))
return
cacheKey
.
get
(
className
);
return
cacheKey
.
get
(
className
);
else
{
DEFieldCacheMap
.
getFieldMap
(
clazz
);
return
cacheKey
.
get
(
className
);
}
}
synchronized
(
objLock3
)
{
public
static
<
T
>
String
getFieldRealName
(
Class
<
T
>
clazz
,
String
fieldname
)
{
if
(
cacheKey
.
containsKey
(
className
))
fieldname
=
fieldname
.
toLowerCase
();
return
cacheKey
.
get
(
className
);
Hashtable
<
String
,
String
>
keys
=
DEFieldCacheMap
.
getFieldKeys
(
clazz
);
Hashtable
<
String
,
Field
>
fieldmap
=
DEFieldCacheMap
.
getFieldMap
(
className
);
if
(
keys
.
containsKey
(
fieldname
))
Iterator
it
=
fieldmap
.
keySet
().
iterator
();
return
keys
.
get
(
fieldname
);
Hashtable
<
String
,
String
>
list
=
new
Hashtable
<
String
,
String
>();
else
if
(
keys
.
containsKey
(
fieldname
.
replace
(
"_"
,
""
)))
while
(
it
.
hasNext
())
{
return
keys
.
get
(
fieldname
.
replace
(
"_"
,
""
));
Object
key
=
it
.
next
();
else
list
.
put
(
key
.
toString
().
toLowerCase
(),
key
.
toString
());
return
""
;
}
}
cacheKey
.
put
(
className
,
list
);
return
list
;
public
static
<
T
>
Field
getField
(
Class
<
T
>
clazz
,
String
fieldname
)
{
String
fieldRealName
=
DEFieldCacheMap
.
getFieldRealName
(
clazz
,
fieldname
);
if
(!
StringUtils
.
isEmpty
(
fieldRealName
))
return
DEFieldCacheMap
.
getFieldMap
(
clazz
).
get
(
fieldRealName
);
else
return
null
;
}
public
static
<
T
>
String
getFieldColumnName
(
Class
<
T
>
clazz
,
String
fieldname
)
{
Field
field
=
DEFieldCacheMap
.
getField
(
clazz
,
fieldname
);
if
(
field
!=
null
)
{
DEField
deField
=
field
.
getAnnotation
(
DEField
.
class
);
if
(
deField
!=
null
&&
deField
.
name
()!=
null
)
return
deField
.
name
();
}
}
return
fieldname
;
}
}
public
static
<
T
>
Object
fieldValueOf
(
Class
<
T
>
clazz
,
String
fieldname
,
Object
fieldValue
)
{
if
(
fieldValue
==
null
)
return
null
;
Object
resultValue
=
fieldValue
;
Field
field
=
DEFieldCacheMap
.
getField
(
clazz
,
fieldname
);
if
(
field
!=
null
)
{
Class
<?>
type
=
field
.
getType
();
resultValue
=
DataObject
.
objectValueOf
(
type
,
fieldValue
);
}
return
resultValue
;
}
}
}
\ No newline at end of file
ibzou-util/src/main/java/cn/ibizlab/util/helper/DataObject.java
0 → 100644
浏览文件 @
a31915b3
package
cn
.
ibizlab
.
util
.
helper
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
org.springframework.util.StringUtils
;
import
java.math.BigDecimal
;
import
java.math.BigInteger
;
import
java.sql.Timestamp
;
import
java.text.DateFormat
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
public
class
DataObject
{
final
static
public
DateFormat
datetimeFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
final
static
public
DateFormat
datetimeFormat2
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
);
final
static
public
DateFormat
dayFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
final
static
public
String
getStringValue
(
Object
objValue
,
String
strDefault
)
{
if
(
objValue
==
null
)
return
strDefault
;
if
(
objValue
instanceof
String
)
return
(
String
)
objValue
;
if
(
objValue
instanceof
java
.
sql
.
Timestamp
||
objValue
instanceof
java
.
sql
.
Date
||
objValue
instanceof
java
.
util
.
Date
)
{
String
rt
=
datetimeFormat
.
format
(
objValue
);
if
(
rt
.
endsWith
(
" 00:00:00"
))
rt
=
dayFormat
.
format
(
objValue
);
else
if
(
rt
.
endsWith
(
":00"
))
rt
=
datetimeFormat2
.
format
(
objValue
);
return
rt
;
}
return
objValue
.
toString
();
}
public
static
<
T
>
Object
objectValueOf
(
Class
<
T
>
type
,
Object
fieldValue
)
{
if
(
fieldValue
==
null
)
return
null
;
Object
resultValue
=
fieldValue
;
String
targetType
=
type
.
getSimpleName
();
if
(
targetType
.
equalsIgnoreCase
(
fieldValue
.
getClass
().
getSimpleName
()))
return
resultValue
;
if
(
targetType
.
equals
(
"Boolean"
)){
resultValue
=
getBooleanValue
(
fieldValue
,
false
);
}
else
if
(
targetType
.
equals
(
"Character"
)){
resultValue
=
getCharacterValue
(
fieldValue
,
null
);
}
else
if
(
targetType
.
equals
(
"Byte"
)){
resultValue
=
getBinaryValue
(
fieldValue
,
null
);
}
else
if
(
targetType
.
equals
(
"Short"
)){
resultValue
=
Short
.
valueOf
(
fieldValue
.
toString
());
}
else
if
(
targetType
.
equals
(
"Integer"
)){
resultValue
=
getIntegerValue
(
fieldValue
,
null
);
}
else
if
(
targetType
.
equals
(
"Long"
)){
resultValue
=
getLongValue
(
fieldValue
,
null
);
}
else
if
(
targetType
.
equals
(
"Float"
)){
resultValue
=
getFloatValue
(
fieldValue
,
null
);
}
else
if
(
targetType
.
equals
(
"Double"
)){
resultValue
=
getDoubleValue
(
fieldValue
,
null
);
}
else
if
(
targetType
.
equals
(
"BigDecimal"
)){
resultValue
=
getBigDecimalValue
(
fieldValue
,
null
);
}
else
if
(
targetType
.
equals
(
"BigInteger"
)){
resultValue
=
getBigIntegerValue
(
fieldValue
,
null
);
}
else
if
(
targetType
.
equals
(
"Timestamp"
)){
resultValue
=
getTimestampValue
(
fieldValue
,
null
);
}
else
if
(
targetType
.
equals
(
"String"
))
{
resultValue
=
getStringValue
(
fieldValue
,
null
);
}
if
(
resultValue
==
null
)
return
null
;
return
resultValue
;
}
public
static
<
T
>
T
valueOf
(
Class
<
T
>
type
,
Object
fieldValue
)
{
return
(
T
)
objectValueOf
(
type
,
fieldValue
);
}
final
static
public
JSONObject
getJSONObjectValue
(
Object
objValue
,
JSONObject
jDefault
)
{
if
(
objValue
==
null
)
{
return
jDefault
;
}
if
(
objValue
instanceof
JSONObject
)
return
(
JSONObject
)
objValue
;
String
strValue
=
objValue
.
toString
();
try
{
return
JSONObject
.
parseObject
(
strValue
);
}
catch
(
Exception
ex
)
{
return
jDefault
;
}
}
final
static
public
JSONArray
getJSONArrayValue
(
Object
objValue
,
JSONArray
jDefault
)
{
if
(
objValue
==
null
)
{
return
jDefault
;
}
if
(
objValue
instanceof
JSONArray
)
return
(
JSONArray
)
objValue
;
String
strValue
=
objValue
.
toString
();
try
{
return
JSONArray
.
parseArray
(
strValue
);
}
catch
(
Exception
ex
)
{
return
jDefault
;
}
}
final
static
public
List
<
String
>
getListValue
(
Object
objValue
)
{
if
(
objValue
==
null
)
{
return
new
ArrayList
<
String
>();
}
JSONArray
arr
=(
getJSONArrayValue
(
objValue
,
null
));
if
(
arr
!=
null
)
{
List
<
String
>
chk1
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
arr
.
size
();
i
++)
{
if
(
arr
.
get
(
i
)
instanceof
String
)
chk1
.
add
(
arr
.
getString
(
i
));
}
return
chk1
;
}
else
{
return
new
ArrayList
<
String
>();
}
}
final
static
public
Boolean
getBooleanValue
(
Object
objValue
,
Boolean
bDefault
)
{
if
(
objValue
==
null
)
return
bDefault
;
if
(
objValue
instanceof
Boolean
)
{
return
(
Boolean
)
objValue
;
}
return
objValue
.
toString
().
equalsIgnoreCase
(
"true"
)||
objValue
.
toString
().
equals
(
"1"
)||
objValue
.
toString
().
equals
(
"y"
);
}
final
static
public
char
[]
getCharacterValue
(
Object
objValue
,
char
[]
cDefault
)
{
if
(
objValue
==
null
)
return
cDefault
;
return
objValue
.
toString
().
toCharArray
();
}
final
static
public
Double
getDoubleValue
(
Object
objValue
,
Double
dDefault
)
{
if
(
objValue
==
null
)
return
dDefault
;
if
(
objValue
instanceof
Double
)
{
return
(
Double
)
objValue
;
}
String
strValue
=
objValue
.
toString
();
if
(
StringUtils
.
isEmpty
(
strValue
))
return
null
;
strValue
=
strValue
.
replace
(
","
,
""
);
return
Double
.
parseDouble
(
strValue
);
}
final
static
public
int
getIntegerValue
(
Object
objValue
,
Integer
nDefault
)
{
if
(
objValue
==
null
)
{
return
nDefault
;
}
if
(
objValue
instanceof
Integer
)
return
(
Integer
)
objValue
;
if
(
objValue
instanceof
Double
)
{
return
((
Double
)
objValue
).
intValue
();
}
if
(
objValue
instanceof
BigDecimal
)
{
return
((
BigDecimal
)
objValue
).
intValue
();
}
String
strValue
=
objValue
.
toString
();
if
(
StringUtils
.
isEmpty
(
strValue
))
return
nDefault
;
strValue
=
strValue
.
replace
(
","
,
""
);
return
Integer
.
parseInt
(
strValue
);
}
final
static
public
Float
getFloatValue
(
Object
objValue
,
Float
fDefault
)
{
if
(
objValue
==
null
)
{
return
fDefault
;
}
try
{
if
(
objValue
instanceof
Float
)
return
(
Float
)
objValue
;
String
strValue
=
objValue
.
toString
();
if
(
StringUtils
.
isEmpty
(
strValue
))
return
fDefault
;
strValue
=
strValue
.
replace
(
","
,
""
);
return
Float
.
parseFloat
(
strValue
);
}
catch
(
Exception
ex
)
{
return
fDefault
;
}
}
final
static
public
BigDecimal
getBigDecimalValue
(
Object
objValue
,
BigDecimal
fDefault
)
{
if
(
objValue
==
null
)
{
return
fDefault
;
}
try
{
if
(
objValue
instanceof
BigDecimal
){
return
(
BigDecimal
)(
objValue
);
}
if
(
objValue
instanceof
Double
){
return
BigDecimal
.
valueOf
((
Double
)
objValue
);
}
if
(
objValue
instanceof
Long
){
return
BigDecimal
.
valueOf
((
Long
)
objValue
);
}
String
strValue
=
objValue
.
toString
();
if
(
StringUtils
.
isEmpty
(
strValue
))
return
fDefault
;
strValue
=
strValue
.
replace
(
","
,
""
);
return
BigDecimal
.
valueOf
(
Double
.
parseDouble
(
strValue
));
}
catch
(
Exception
ex
)
{
return
fDefault
;
}
}
final
static
public
BigInteger
getBigIntegerValue
(
Object
objValue
,
BigInteger
fDefault
)
{
if
(
objValue
==
null
)
{
return
fDefault
;
}
try
{
if
(
objValue
instanceof
BigInteger
){
return
(
BigInteger
)(
objValue
);
}
else
{
Long
l
=
getLongValue
(
objValue
,
null
);
if
(
l
!=
null
)
return
BigInteger
.
valueOf
(
l
);
}
}
catch
(
Exception
ex
)
{
}
return
fDefault
;
}
final
static
public
Long
getLongValue
(
Object
objValue
,
Long
nDefault
)
{
if
(
objValue
==
null
)
{
return
nDefault
;
}
try
{
if
(
objValue
instanceof
Long
)
return
(
Long
)
objValue
;
if
(
objValue
instanceof
Integer
)
{
return
((
Integer
)
objValue
).
longValue
();
}
if
(
objValue
instanceof
Double
)
{
return
((
Double
)
objValue
).
longValue
();
}
if
(
objValue
instanceof
BigDecimal
)
{
return
((
BigDecimal
)
objValue
).
longValue
();
}
String
strValue
=
objValue
.
toString
();
if
(
StringUtils
.
isEmpty
(
strValue
))
return
nDefault
;
strValue
=
strValue
.
replace
(
","
,
""
);
return
Long
.
parseLong
(
strValue
);
}
catch
(
Exception
ex
)
{
return
nDefault
;
}
}
final
static
public
byte
[]
getBinaryValue
(
Object
objValue
,
byte
[]
def
)
{
if
(
objValue
==
null
)
return
def
;
if
(
objValue
instanceof
byte
[]){
return
(
byte
[])
objValue
;
}
if
(
objValue
instanceof
String
){
return
Base64
.
getDecoder
().
decode
((
String
)
objValue
);
}
return
def
;
}
/**
* 转换对象值到时间值
*
* @param objValue
* @return
* @
*/
final
static
public
java
.
sql
.
Timestamp
getTimestampValue
(
Object
objValue
,
java
.
sql
.
Timestamp
tDefault
)
{
if
(
objValue
==
null
)
return
tDefault
;
if
(
objValue
instanceof
java
.
sql
.
Timestamp
)
{
java
.
sql
.
Timestamp
ti
=
(
java
.
sql
.
Timestamp
)
objValue
;
return
ti
;
}
if
(
objValue
instanceof
java
.
sql
.
Date
)
{
java
.
sql
.
Date
date
=
(
java
.
sql
.
Date
)
objValue
;
return
new
java
.
sql
.
Timestamp
(
date
.
getTime
());
}
if
(
objValue
instanceof
java
.
util
.
Date
)
{
java
.
util
.
Date
date
=
(
java
.
util
.
Date
)
objValue
;
return
new
java
.
sql
.
Timestamp
(
date
.
getTime
());
}
if
(
objValue
instanceof
String
)
{
String
strValue
=
(
String
)
objValue
;
strValue
=
strValue
.
trim
();
if
(
StringUtils
.
isEmpty
(
strValue
))
return
null
;
try
{
java
.
util
.
Date
date
=
parse
((
String
)
objValue
);
return
new
java
.
sql
.
Timestamp
(
date
.
getTime
());
}
catch
(
Exception
ex
)
{
return
tDefault
;
}
}
if
(
objValue
instanceof
Long
)
{
Long
lValue
=
(
Long
)
objValue
;
return
new
java
.
sql
.
Timestamp
(
lValue
);
}
if
(
objValue
instanceof
Integer
)
{
int
lValue
=
(
int
)
objValue
;
return
new
java
.
sql
.
Timestamp
(
lValue
);
}
return
tDefault
;
}
public
static
Object
testDateTime
(
String
strInput
)
throws
Exception
{
return
testDateTime
(
strInput
,
null
);
}
/**
* 转换文本值到日期时间
*
* @param strInput
* @param timeZone
* @return
* @
*/
public
static
Object
testDateTime
(
String
strInput
,
TimeZone
timeZone
)
throws
Exception
{
if
(
StringUtils
.
isEmpty
(
strInput
))
return
null
;
Date
dtDate
=
parse
(
strInput
,
timeZone
);
java
.
sql
.
Timestamp
retDate
=
new
java
.
sql
.
Timestamp
(
dtDate
.
getTime
());
return
retDate
;
}
/**
* 转换字符串到时间对象
*
* @param strTimeString
* @return
* @throws ParseException
* @
*/
public
static
Date
parse
(
String
strTimeString
)
throws
ParseException
,
Exception
{
return
parse
(
strTimeString
,
null
);
}
/**
* 分析时间串
*
* @param strTimeString MM/dd/yy yy-MM-dd HH:mm:ss 格式
* @param timeZone
* @return
* @throws ParseException
* @
*/
public
static
Date
parse
(
String
strTimeString
,
TimeZone
timeZone
)
throws
ParseException
,
Exception
{
strTimeString
=
strTimeString
.
trim
();
if
(
StringUtils
.
isEmpty
(
strTimeString
)){
throw
new
Exception
(
"unknown date(time) string"
);
}
if
(
strTimeString
.
indexOf
(
"Z"
)!=-
1
){
//有时区
String
[]
parts
=
strTimeString
.
split
(
"[Z]"
);
if
(
parts
.
length
>=
1
){
strTimeString
=
parts
[
0
];
}
if
(
parts
.
length
>=
2
){
if
(
timeZone
==
null
){
if
(!
StringUtils
.
isEmpty
(
parts
[
1
])){
timeZone
=
TimeZone
.
getTimeZone
(
parts
[
1
]);
}
}
}
}
// 判断是长数据还是短数据
String
strPart
[]
=
null
;
if
(
strTimeString
.
indexOf
(
"T"
)!=-
1
){
strPart
=
strTimeString
.
split
(
"[T]"
);
}
else
strPart
=
strTimeString
.
split
(
" "
);
if
(
strPart
.
length
==
2
)
{
// 两个部分
String
strDate
=
""
;
String
strTime
=
""
;
if
(
strPart
[
0
].
indexOf
(
":"
)
!=
-
1
)
{
strTime
=
strPart
[
0
];
strDate
=
strPart
[
1
];
}
else
{
strTime
=
strPart
[
1
];
strDate
=
strPart
[
0
];
}
strDate
=
strDate
.
trim
();
strTime
=
strTime
.
trim
();
strDate
=
getFormatDateString
(
strDate
);
strTime
=
getFormatTimeString
(
strTime
);
DateFormat
dtFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
if
(
timeZone
!=
null
)
{
dtFormat
.
setTimeZone
(
timeZone
);
}
return
dtFormat
.
parse
(
strDate
+
" "
+
strTime
);
}
else
{
// 一个部分
if
(
strTimeString
.
indexOf
(
":"
)
!=
-
1
)
{
// 时间
strTimeString
=
getFormatTimeString
(
strTimeString
);
DateFormat
dtFormat
=
new
SimpleDateFormat
(
"HH:mm:ss"
);
if
(
timeZone
!=
null
)
{
dtFormat
.
setTimeZone
(
timeZone
);
}
return
dtFormat
.
parse
(
strTimeString
);
}
else
{
// 作为日期处理
strTimeString
=
getFormatDateString
(
strTimeString
);
DateFormat
dtFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
if
(
timeZone
!=
null
)
{
dtFormat
.
setTimeZone
(
timeZone
);
}
return
dtFormat
.
parse
(
strTimeString
);
}
}
}
/**
* 获取时间格式化串
*
* @param strOrigin
* @return
*/
private
static
String
getFormatTimeString
(
String
strOrigin
)
{
int
nDotPos
=
strOrigin
.
indexOf
(
"."
);
if
(
nDotPos
!=
-
1
)
{
strOrigin
=
strOrigin
.
substring
(
0
,
nDotPos
);
}
Object
Time
[]
=
new
Object
[
3
];
Time
[
0
]
=
0
;
Time
[
1
]
=
0
;
Time
[
2
]
=
0
;
String
timepart
[]
=
strOrigin
.
split
(
":"
);
int
nTimePartLength
=
timepart
.
length
;
if
(
nTimePartLength
>
3
)
{
nTimePartLength
=
3
;
}
for
(
int
i
=
0
;
i
<
nTimePartLength
;
i
++)
{
Time
[
i
]
=
Integer
.
parseInt
(
timepart
[
i
]);
}
return
String
.
format
(
"%1$02d:%2$02d:%3$02d"
,
Time
);
}
/**
* 获取时日期格式化串
*
* @param strOrigin
* @return
* @
*/
private
static
String
getFormatDateString
(
String
strOrigin
)
throws
Exception
{
return
getFormatDateString
(
strOrigin
,
true
);
}
/**
* 获取时日期格式化串
*
* @param strOrigin
* @param bAdv
* @return
* @
*/
private
static
String
getFormatDateString
(
String
strOrigin
,
boolean
bAdv
)
throws
Exception
{
Object
Date
[]
=
new
Object
[
3
];
Date
[
0
]
=
1970
;
Date
[
1
]
=
1
;
Date
[
2
]
=
1
;
if
(
strOrigin
.
indexOf
(
"-"
)
!=
-
1
)
{
String
datePart
[]
=
strOrigin
.
split
(
"-"
);
if
(
datePart
.
length
>=
1
)
{
Date
[
0
]
=
Integer
.
parseInt
(
datePart
[
0
]);
}
if
(
datePart
.
length
>=
2
)
{
Date
[
1
]
=
Integer
.
parseInt
(
datePart
[
1
]);
}
if
(
datePart
.
length
>=
3
)
{
Date
[
2
]
=
Integer
.
parseInt
(
datePart
[
2
]);
}
}
else
if
(
strOrigin
.
indexOf
(
"/"
)
!=
-
1
)
{
String
datePart
[]
=
strOrigin
.
split
(
"/"
);
if
(
datePart
.
length
>=
1
)
{
Date
[
1
]
=
Integer
.
parseInt
(
datePart
[
0
]);
}
if
(
datePart
.
length
>=
2
)
{
Date
[
2
]
=
Integer
.
parseInt
(
datePart
[
1
]);
}
if
(
datePart
.
length
>=
3
)
{
Date
[
0
]
=
Integer
.
parseInt
(
datePart
[
2
]);
}
}
else
{
if
(
bAdv
)
{
strOrigin
=
strOrigin
.
replace
(
"."
,
"-"
);
strOrigin
=
strOrigin
.
replace
(
"日"
,
""
);
strOrigin
=
strOrigin
.
replace
(
"天"
,
""
);
strOrigin
=
strOrigin
.
replace
(
"年"
,
"-"
);
strOrigin
=
strOrigin
.
replace
(
"月"
,
"-"
);
return
getFormatDateString
(
strOrigin
,
false
);
}
else
throw
new
Exception
(
"无法识别的时间字符串,"
+
strOrigin
);
}
return
String
.
format
(
"%1$04d-%2$02d-%3$02d"
,
Date
);
}
public
static
Timestamp
getBeginDate
()
{
Calendar
cl
=
Calendar
.
getInstance
(
TimeZone
.
getTimeZone
(
"GMT+8"
));
cl
.
set
(
1900
,
1
,
1
);
return
new
Timestamp
(
cl
.
getTime
().
getTime
());
}
public
static
Timestamp
getEndDate
()
{
Calendar
cl
=
Calendar
.
getInstance
(
TimeZone
.
getTimeZone
(
"GMT+8"
));
cl
.
set
(
2100
,
12
,
31
,
23
,
59
,
59
);
return
new
Timestamp
(
cl
.
getTime
().
getTime
());
}
public
static
Timestamp
getNow
()
{
Calendar
cl
=
Calendar
.
getInstance
(
TimeZone
.
getTimeZone
(
"GMT+8"
));
return
new
Timestamp
(
cl
.
getTime
().
getTime
());
}
}
ibzou-util/src/main/java/cn/ibizlab/util/job/PermissionSyncJob.java
浏览文件 @
a31915b3
...
@@ -32,7 +32,7 @@ public class PermissionSyncJob implements ApplicationRunner {
...
@@ -32,7 +32,7 @@ public class PermissionSyncJob implements ApplicationRunner {
@Value
(
"${ibiz.enablePermissionValid:false}"
)
@Value
(
"${ibiz.enablePermissionValid:false}"
)
boolean
enablePermissionValid
;
//是否开启权限校验
boolean
enablePermissionValid
;
//是否开启权限校验
@Value
(
"${ibiz.systemid:
110B1A3E-4944-47C8-B4C4-EC15FB8982F3
}"
)
@Value
(
"${ibiz.systemid:
2C40DFCD-0DF5-47BF-91A5-C45F810B0001
}"
)
private
String
systemId
;
private
String
systemId
;
@Override
@Override
...
...
ibzou-util/src/main/java/cn/ibizlab/util/rest/AppController.java
浏览文件 @
a31915b3
package
cn
.
ibizlab
.
util
.
rest
;
package
cn
.
ibizlab
.
util
.
rest
;
import
java.util.ArrayList
;
import
com.alibaba.fastjson.JSONArray
;
import
java.util.List
;
import
java.util.Map
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
cn.ibizlab.util.security.AuthenticationUser
;
@RestController
@RestController
@RequestMapping
(
value
=
""
)
@RequestMapping
(
value
=
""
)
...
@@ -19,7 +16,14 @@ public class AppController {
...
@@ -19,7 +16,14 @@ public class AppController {
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/appdata"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/appdata"
)
public
ResponseEntity
<
JSONObject
>
getAppData
()
{
public
ResponseEntity
<
JSONObject
>
getAppData
()
{
JSONObject
appData
=
new
JSONObject
()
;
JSONObject
appData
=
new
JSONObject
()
;
JSONArray
uniRes
=
new
JSONArray
();
JSONObject
userPermission
=
AuthenticationUser
.
getAuthenticationUser
().
getPermissionList
();
if
(!
ObjectUtils
.
isEmpty
(
userPermission
)){
uniRes
=
userPermission
.
getJSONArray
(
"unires"
);
}
appData
.
put
(
"unires"
,
uniRes
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
appData
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
appData
);
}
}
...
...
ibzou-util/src/main/java/cn/ibizlab/util/security/AuthPermissionEvaluator.java
浏览文件 @
a31915b3
...
@@ -74,7 +74,7 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
...
@@ -74,7 +74,7 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
return
false
;
return
false
;
//获取当前用户权限列表
//获取当前用户权限列表
JSONObject
userPermission
=
AuthenticationUser
.
getAuthenticationUser
().
getPermisionList
();
JSONObject
userPermission
=
AuthenticationUser
.
getAuthenticationUser
().
getPermis
s
ionList
();
if
(
userPermission
==
null
)
if
(
userPermission
==
null
)
return
false
;
return
false
;
...
@@ -88,7 +88,7 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
...
@@ -88,7 +88,7 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
String
entityName
=
entity
.
getClass
().
getSimpleName
();
String
entityName
=
entity
.
getClass
().
getSimpleName
();
//获取实体行为权限信息
//获取实体行为权限信息
JSONObject
permissionList
=
userPermission
.
getJSONObject
(
"
userPermissionList
"
);
JSONObject
permissionList
=
userPermission
.
getJSONObject
(
"
entities
"
);
//检查是否有操作权限[create.update.delete.read]
//检查是否有操作权限[create.update.delete.read]
if
(!
validDEActionHasPermission
(
permissionList
,
entityName
,
action
)){
if
(!
validDEActionHasPermission
(
permissionList
,
entityName
,
action
)){
...
@@ -106,7 +106,7 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
...
@@ -106,7 +106,7 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
String
entityName
=
entity
.
getClass
().
getSimpleName
();
String
entityName
=
entity
.
getClass
().
getSimpleName
();
//获取数据集权限信息
//获取数据集权限信息
JSONObject
permissionList
=
userPermission
.
getJSONObject
(
"
userPermissionList
"
);
JSONObject
permissionList
=
userPermission
.
getJSONObject
(
"
entities
"
);
if
(
StringUtils
.
isEmpty
(
entityName
)||
StringUtils
.
isEmpty
(
dataSetName
))
if
(
StringUtils
.
isEmpty
(
entityName
)||
StringUtils
.
isEmpty
(
dataSetName
))
return
false
;
return
false
;
...
@@ -145,8 +145,8 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
...
@@ -145,8 +145,8 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
if
(
StringUtils
.
isEmpty
(
entity
))
if
(
StringUtils
.
isEmpty
(
entity
))
return
false
;
return
false
;
JSONObject
userPermission
=
AuthenticationUser
.
getAuthenticationUser
().
getPermisionList
();
JSONObject
userPermission
=
AuthenticationUser
.
getAuthenticationUser
().
getPermis
s
ionList
();
JSONObject
permissionList
=
userPermission
.
getJSONObject
(
"
userPermissionList
"
);
JSONObject
permissionList
=
userPermission
.
getJSONObject
(
"
entities
"
);
String
entityName
=
entity
.
getClass
().
getSimpleName
();
String
entityName
=
entity
.
getClass
().
getSimpleName
();
if
(
action
.
equalsIgnoreCase
(
"create"
)){
if
(
action
.
equalsIgnoreCase
(
"create"
)){
...
...
ibzou-util/src/main/java/cn/ibizlab/util/security/AuthenticationUser.java
浏览文件 @
a31915b3
...
@@ -61,7 +61,7 @@ public class AuthenticationUser implements UserDetails
...
@@ -61,7 +61,7 @@ public class AuthenticationUser implements UserDetails
private
Collection
<
GrantedAuthority
>
authorities
;
private
Collection
<
GrantedAuthority
>
authorities
;
@JsonIgnore
@JsonIgnore
private
int
superuser
;
private
int
superuser
;
private
JSONObject
permisionList
;
private
JSONObject
permis
s
ionList
;
private
String
orglevel
;
//单位级别
private
String
orglevel
;
//单位级别
private
String
deptlevel
;
//部门级别
private
String
deptlevel
;
//部门级别
@JsonIgnore
@JsonIgnore
...
...
ibzou-util/src/main/java/cn/ibizlab/util/service/RemoteService.java
0 → 100644
浏览文件 @
a31915b3
package
cn
.
ibizlab
.
util
.
service
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.serializer.SerializerFeature
;
import
com.alibaba.fastjson.support.config.FastJsonConfig
;
import
com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter
;
import
com.alibaba.fastjson.support.springfox.SwaggerJsonSerializer
;
import
feign.*
;
import
feign.codec.Decoder
;
import
org.springframework.beans.factory.ObjectFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.autoconfigure.http.HttpMessageConverters
;
import
org.springframework.cloud.openfeign.FeignContext
;
import
org.springframework.cloud.openfeign.support.SpringDecoder
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.http.MediaType
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.context.request.RequestContextHolder
;
import
org.springframework.web.context.request.ServletRequestAttributes
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Objects
;
import
java.util.concurrent.ConcurrentHashMap
;
/**
* 自定义feigen客户端配置
*
* @author
*/
@Service
public
class
RemoteService
{
/**
* FeignClientFactoryBean
*/
@Autowired
protected
FeignContext
feignContext
;
/**
* FeignClient 默认LoadBalancerFeignClient
*/
@Autowired
private
Client
feignClient
;
private
static
final
Map
<
String
,
Object
>
FEIGN_CLIENTS
=
new
ConcurrentHashMap
<>();
/**
* 定义远程通用接口
*/
public
interface
RemoteFeignClient
{
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/{path}"
)
JSONObject
post
(
@PathVariable
(
"path"
)
String
path
,
@RequestHeader
(
"Authorization"
)
String
token
,
@RequestBody
Map
param
);
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/{path}"
)
JSONObject
request
(
@PathVariable
(
"path"
)
String
path
,
@RequestHeader
(
"Authorization"
)
String
token
,
Map
param
);
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/{path}"
)
JSONObject
get
(
@PathVariable
(
"path"
)
String
path
,
@RequestHeader
(
"Authorization"
)
String
token
);
@RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/{path}"
)
JSONObject
put
(
@PathVariable
(
"path"
)
String
path
,
@RequestHeader
(
"Authorization"
)
String
token
,
@RequestBody
Map
param
);
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/{path}"
)
JSONObject
delete
(
@PathVariable
(
"path"
)
String
path
,
@RequestHeader
(
"Authorization"
)
String
token
);
}
/**
* @param serverId
* @return
*/
public
RemoteFeignClient
getClient
(
String
serverId
)
{
return
this
.
create
(
RemoteFeignClient
.
class
,
serverId
);
}
/**
* 设置编码解码器为FastJson
*
* @param clazz
* @param serviceId
* @param <T>
* @return
*/
private
<
T
>
T
create
(
Class
<
T
>
clazz
,
String
serviceId
)
{
Object
object
=
FEIGN_CLIENTS
.
get
(
serviceId
);
if
(
Objects
.
isNull
(
object
))
{
object
=
Feign
.
builder
()
//decoder指定对象解码方式
.
decoder
(
this
.
feignDecoder
())
.
client
(
feignClient
)
//options方法指定连接超时时长及响应超时时长
.
options
(
new
Request
.
Options
(
5000
,
5000
))
//retryer方法指定重试策略
//.retryer(new Retryer.Default(5000, 5000, 3))
.
contract
(
feignContext
.
getInstance
(
serviceId
,
Contract
.
class
))
//target方法绑定接口与服务端地址。返回类型为绑定的接口类型。
.
target
(
clazz
,
"http://"
+
serviceId
);
FEIGN_CLIENTS
.
put
(
serviceId
,
object
);
}
return
(
T
)
object
;
}
private
Decoder
feignDecoder
()
{
return
new
SpringDecoder
(
feignHttpMessageConverter
());
}
/**
* 设置解码器为fastjson
*
* @return
*/
private
ObjectFactory
<
HttpMessageConverters
>
feignHttpMessageConverter
()
{
final
HttpMessageConverters
httpMessageConverters
=
new
HttpMessageConverters
(
this
.
getFastJsonConverter
());
return
()
->
httpMessageConverters
;
}
private
FastJsonHttpMessageConverter
getFastJsonConverter
()
{
FastJsonHttpMessageConverter
converter
=
new
FastJsonHttpMessageConverter
();
List
<
MediaType
>
supportedMediaTypes
=
new
ArrayList
<>();
MediaType
mediaTypeJson
=
MediaType
.
valueOf
(
MediaType
.
APPLICATION_JSON_UTF8_VALUE
);
supportedMediaTypes
.
add
(
mediaTypeJson
);
converter
.
setSupportedMediaTypes
(
supportedMediaTypes
);
FastJsonConfig
config
=
new
FastJsonConfig
();
config
.
getSerializeConfig
().
put
(
JSON
.
class
,
new
SwaggerJsonSerializer
());
config
.
setSerializerFeatures
(
SerializerFeature
.
DisableCircularReferenceDetect
);
converter
.
setFastJsonConfig
(
config
);
return
converter
;
}
@Configuration
public
class
FeignTokenInterceptor
implements
RequestInterceptor
{
@Override
public
void
apply
(
RequestTemplate
template
)
{
HttpServletRequest
request
=
getServletRequest
();
if
(
null
==
request
){
return
;
}
template
.
header
(
"uid"
,
getHeaders
(
request
));
}
private
HttpServletRequest
getServletRequest
()
{
return
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
();
}
private
String
getHeaders
(
HttpServletRequest
request
){
return
request
.
getHeader
(
"uid"
);
}
}
}
\ No newline at end of file
ibzou-util/src/main/java/cn/ibizlab/util/web/IBZOperationParameterReader.java
0 → 100644
浏览文件 @
a31915b3
package
cn
.
ibizlab
.
util
.
web
;
import
cn.ibizlab.util.filter.SearchContextBase
;
import
com.fasterxml.classmate.ResolvedType
;
import
com.google.common.base.Predicate
;
import
com.google.common.collect.FluentIterable
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Primary
;
import
org.springframework.core.Ordered
;
import
org.springframework.core.annotation.Order
;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RequestPart
;
import
springfox.documentation.builders.ParameterBuilder
;
import
springfox.documentation.service.Parameter
;
import
springfox.documentation.service.ResolvedMethodParameter
;
import
springfox.documentation.spi.DocumentationType
;
import
springfox.documentation.spi.schema.EnumTypeDeterminer
;
import
springfox.documentation.spi.service.OperationBuilderPlugin
;
import
springfox.documentation.spi.service.contexts.OperationContext
;
import
springfox.documentation.spi.service.contexts.ParameterContext
;
import
springfox.documentation.spring.web.plugins.DocumentationPluginsManager
;
import
springfox.documentation.spring.web.readers.parameter.ExpansionContext
;
import
springfox.documentation.spring.web.readers.parameter.ModelAttributeParameterExpander
;
import
java.lang.annotation.Annotation
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
static
com
.
google
.
common
.
base
.
Predicates
.*;
import
static
com
.
google
.
common
.
collect
.
Lists
.*;
import
static
springfox
.
documentation
.
schema
.
Collections
.*;
import
static
springfox
.
documentation
.
schema
.
Maps
.*;
import
static
springfox
.
documentation
.
schema
.
Types
.*;
@Component
@Order
(
Ordered
.
HIGHEST_PRECEDENCE
)
public
class
IBZOperationParameterReader
implements
OperationBuilderPlugin
{
private
final
ModelAttributeParameterExpander
expander
;
private
final
EnumTypeDeterminer
enumTypeDeterminer
;
@Autowired
private
DocumentationPluginsManager
pluginsManager
;
@Autowired
public
IBZOperationParameterReader
(
ModelAttributeParameterExpander
expander
,
EnumTypeDeterminer
enumTypeDeterminer
)
{
this
.
expander
=
expander
;
this
.
enumTypeDeterminer
=
enumTypeDeterminer
;
}
@Override
public
void
apply
(
OperationContext
context
)
{
context
.
operationBuilder
().
parameters
(
context
.
getGlobalOperationParameters
());
context
.
operationBuilder
().
parameters
(
readParameters
(
context
));
}
@Override
public
boolean
supports
(
DocumentationType
delimiter
)
{
return
true
;
}
private
List
<
Parameter
>
readParameters
(
final
OperationContext
context
)
{
List
<
ResolvedMethodParameter
>
methodParameters
=
context
.
getParameters
();
List
<
Parameter
>
parameters
=
newArrayList
();
for
(
ResolvedMethodParameter
methodParameter
:
methodParameters
)
{
ResolvedType
alternate
=
context
.
alternateFor
(
methodParameter
.
getParameterType
());
if
(!
shouldIgnore
(
methodParameter
,
alternate
,
context
.
getIgnorableParameterTypes
()))
{
ParameterContext
parameterContext
=
new
ParameterContext
(
methodParameter
,
new
ParameterBuilder
(),
context
.
getDocumentationContext
(),
context
.
getGenericsNamingStrategy
(),
context
);
if
(
shouldExpand
(
methodParameter
,
alternate
))
{
parameters
.
addAll
(
expander
.
expand
(
new
ExpansionContext
(
""
,
alternate
,
context
)));
}
else
{
parameters
.
add
(
pluginsManager
.
parameter
(
parameterContext
));
}
}
}
return
FluentIterable
.
from
(
parameters
).
filter
(
not
(
hiddenParams
())).
toList
();
}
private
Predicate
<
Parameter
>
hiddenParams
()
{
return
new
Predicate
<
Parameter
>()
{
@Override
public
boolean
apply
(
Parameter
input
)
{
return
input
.
isHidden
();
}
};
}
private
boolean
shouldIgnore
(
final
ResolvedMethodParameter
parameter
,
ResolvedType
resolvedParameterType
,
final
Set
<
Class
>
ignorableParamTypes
)
{
if
(
ignorableParamTypes
.
contains
(
resolvedParameterType
.
getErasedType
()))
{
return
true
;
}
return
FluentIterable
.
from
(
ignorableParamTypes
)
.
filter
(
isAnnotation
())
.
filter
(
parameterIsAnnotatedWithIt
(
parameter
)).
size
()
>
0
;
}
private
Predicate
<
Class
>
parameterIsAnnotatedWithIt
(
final
ResolvedMethodParameter
parameter
)
{
return
new
Predicate
<
Class
>()
{
@Override
public
boolean
apply
(
Class
input
)
{
return
parameter
.
hasParameterAnnotation
(
input
);
}
};
}
private
Predicate
<
Class
>
isAnnotation
()
{
return
new
Predicate
<
Class
>()
{
@Override
public
boolean
apply
(
Class
input
)
{
return
Annotation
.
class
.
isAssignableFrom
(
input
);
}
};
}
private
boolean
shouldExpand
(
final
ResolvedMethodParameter
parameter
,
ResolvedType
resolvedParamType
)
{
return
!
parameter
.
hasParameterAnnotation
(
RequestBody
.
class
)
&&
!
parameter
.
hasParameterAnnotation
(
RequestPart
.
class
)
&&
!
parameter
.
hasParameterAnnotation
(
RequestParam
.
class
)
&&
!
parameter
.
hasParameterAnnotation
(
PathVariable
.
class
)
&&
!
isBaseType
(
typeNameFor
(
resolvedParamType
.
getErasedType
()))
&&
!
enumTypeDeterminer
.
isEnum
(
resolvedParamType
.
getErasedType
())
&&
!
isContainerType
(
resolvedParamType
)
&&
!
isMapType
(
resolvedParamType
)
&&
!
SearchContextBase
.
class
.
isAssignableFrom
(
resolvedParamType
.
getErasedType
());
}
}
ibzou-util/src/main/resources/application-sys.yml
浏览文件 @
a31915b3
...
@@ -78,7 +78,9 @@ ribbon:
...
@@ -78,7 +78,9 @@ ribbon:
ConnectTimeout
:
60000
ConnectTimeout
:
60000
#系统是否开启权限验证、是否开启缓存
#系统是否开启权限验证、是否开启缓存
#缓存模式:关闭缓存(无配置项)、本地缓存(enableCaffeineCache=true-默认)、caffeine+redis两级缓存(enableRedisCache=true)
ibiz
:
ibiz
:
enablePermissionValid
:
false
enablePermissionValid
:
false
enableCache
:
true
enableCaffeineCache
:
true
#enableRedisCache: true
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录