Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzou
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzou
提交
746f17a1
提交
746f17a1
编写于
4年前
作者:
sq3536
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
数据字典局部刷新
上级
6a958772
变更
1
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
44 行增加
和
7 行删除
+44
-7
OUCoreResource.java
...n/java/cn/ibizlab/api/rest/extensions/OUCoreResource.java
+44
-7
未找到文件。
ibzou-provider/ibzou-provider-api/src/main/java/cn/ibizlab/api/rest/extensions/OUCoreResource.java
浏览文件 @
746f17a1
...
...
@@ -8,12 +8,15 @@ import cn.ibizlab.core.ou.domain.IBZEmployee;
import
cn.ibizlab.core.ou.service.IIBZDepartmentService
;
import
cn.ibizlab.core.ou.service.IIBZEmployeeService
;
import
cn.ibizlab.core.ou.service.IIBZOrganizationService
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.cache.annotation.Cacheable
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.StringUtils
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -190,17 +193,39 @@ public class OUCoreResource
@Cacheable
(
value
=
"ibzou-model"
,
key
=
"'catalog:'+#p0"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/dictionarys/catalogs/Ibzou{catalog}"
)
public
ResponseEntity
<
JSONObject
>
getCatalog
(
@PathVariable
(
"catalog"
)
String
catalog
)
{
return
getOptions
(
"ibzou"
+
catalog
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
getItems
(
"Ibzou"
+
catalog
)
);
}
@Cacheable
(
value
=
"ibzou-model"
,
key
=
"'codelist:'+#p0"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/dictionarys/codelist/Ibzou{catalog}"
)
public
ResponseEntity
<
JSONObject
>
getCodeList
(
@PathVariable
(
"catalog"
)
String
catalog
)
{
return
getOptions
(
"ibzou"
+
catalog
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
getItems
(
"Ibzou"
+
catalog
)
);
}
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/dictionarys/catalogs/Ibzou{code}/options"
)
public
ResponseEntity
<
List
>
getOptions
(
@PathVariable
(
"code"
)
String
code
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
((
List
)
getItems
(
"Ibzou"
+
code
).
get
(
"items"
));
}
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/dictionarys/codelist/Ibzou{code}/items"
)
public
ResponseEntity
<
List
>
getCodeItems
(
@PathVariable
(
"code"
)
String
code
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
((
List
)
getItems
(
"Ibzou"
+
code
).
get
(
"items"
));
}
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/dictionarys/catalogs/Ibzou{code}/options"
)
public
ResponseEntity
<
List
>
getOptions
(
@PathVariable
(
"code"
)
String
code
,
@RequestBody
List
<
String
>
values
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
((
List
)
getItems
(
"Ibzou"
+
code
,
values
).
get
(
"items"
));
}
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/dictionarys/codelist/Ibzou{code}/items"
)
public
ResponseEntity
<
List
>
getCodeItems
(
@PathVariable
(
"code"
)
String
code
,
@RequestBody
List
<
String
>
values
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
((
List
)
getItems
(
"Ibzou"
+
code
,
values
).
get
(
"items"
));
}
public
ResponseEntity
<
JSONObject
>
getOptions
(
String
catalog
)
{
public
JSONObject
getItems
(
String
catalog
)
{
return
getItems
(
catalog
,
null
);
}
public
JSONObject
getItems
(
String
catalog
,
List
<
String
>
values
)
{
JSONObject
jo
=
new
JSONObject
();
jo
.
put
(
"srfkey"
,
catalog
);
jo
.
put
(
"emptytext"
,
""
);
...
...
@@ -208,7 +233,11 @@ public class OUCoreResource
if
(
"IbzouOrg"
.
equalsIgnoreCase
(
catalog
))
{
iibzOrganizationService
.
list
(
Wrappers
.<
IBZOrganization
>
query
().
orderByAsc
(
"showorder"
)).
forEach
(
item
->
{
LambdaQueryWrapper
<
IBZOrganization
>
queryWrapper
=
Wrappers
.<
IBZOrganization
>
lambdaQuery
();
if
(!
ObjectUtils
.
isEmpty
(
values
))
queryWrapper
.
in
(
IBZOrganization:
:
getOrgid
,
values
);
queryWrapper
.
orderByAsc
(
IBZOrganization:
:
getShoworder
);
iibzOrganizationService
.
list
(
queryWrapper
).
forEach
(
item
->
{
JSONObject
option
=
new
JSONObject
();
option
.
put
(
"id"
,
item
.
getOrgid
());
option
.
put
(
"value"
,
item
.
getOrgid
());
...
...
@@ -219,7 +248,11 @@ public class OUCoreResource
}
else
if
(
"IbzouDept"
.
equalsIgnoreCase
(
catalog
)||
"IbzouOrgSector"
.
equalsIgnoreCase
(
catalog
))
{
iibzDepartmentService
.
list
(
Wrappers
.<
IBZDepartment
>
query
().
orderByAsc
(
"showorder"
)).
forEach
(
item
->
{
LambdaQueryWrapper
<
IBZDepartment
>
queryWrapper
=
Wrappers
.<
IBZDepartment
>
lambdaQuery
();
if
(!
ObjectUtils
.
isEmpty
(
values
))
queryWrapper
.
in
(
IBZDepartment:
:
getDeptid
,
values
);
queryWrapper
.
orderByAsc
(
IBZDepartment:
:
getShoworder
);
iibzDepartmentService
.
list
(
queryWrapper
).
forEach
(
item
->
{
JSONObject
option
=
new
JSONObject
();
option
.
put
(
"id"
,
item
.
getDeptid
());
option
.
put
(
"value"
,
item
.
getDeptid
());
...
...
@@ -230,7 +263,11 @@ public class OUCoreResource
}
else
if
(
"IbzouUser"
.
equalsIgnoreCase
(
catalog
)||
"IbzouOperator"
.
equalsIgnoreCase
(
catalog
)||
"IbzouEmp"
.
equalsIgnoreCase
(
catalog
)||
"IbzouPerson"
.
equalsIgnoreCase
(
catalog
))
{
iibzEmployeeService
.
list
(
Wrappers
.<
IBZEmployee
>
query
().
orderByAsc
(
"showorder"
)).
forEach
(
item
->
{
LambdaQueryWrapper
<
IBZEmployee
>
queryWrapper
=
Wrappers
.<
IBZEmployee
>
lambdaQuery
();
if
(!
ObjectUtils
.
isEmpty
(
values
))
queryWrapper
.
in
(
IBZEmployee:
:
getUserid
,
values
);
queryWrapper
.
orderByAsc
(
IBZEmployee:
:
getShoworder
);
iibzEmployeeService
.
list
(
queryWrapper
).
forEach
(
item
->
{
JSONObject
option
=
new
JSONObject
();
option
.
put
(
"id"
,
item
.
getUserid
());
option
.
put
(
"value"
,
item
.
getUserid
());
...
...
@@ -243,7 +280,7 @@ public class OUCoreResource
jo
.
put
(
"items"
,
list
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
jo
)
;
return
jo
;
}
...
...
This diff is collapsed.
Click to expand it.
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录