Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzou
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzou
提交
3a33137d
提交
3a33137d
编写于
8月 05, 2020
作者:
sq3536
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
codelist接管
上级
bd400a19
变更
4
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
84 行增加
和
4 行删除
+84
-4
DevBootSecurityConfig.java
...rc/main/java/cn/ibizlab/config/DevBootSecurityConfig.java
+1
-0
OUModelService.java
...cn/ibizlab/core/ou/extensions/service/OUModelService.java
+2
-1
apiSecurityConfig.java
...rc/main/java/cn/ibizlab/api/config/apiSecurityConfig.java
+1
-0
OUCoreResource.java
...n/java/cn/ibizlab/api/rest/extensions/OUCoreResource.java
+80
-3
未找到文件。
ibzou-boot/src/main/java/cn/ibizlab/config/DevBootSecurityConfig.java
浏览文件 @
3a33137d
...
@@ -92,6 +92,7 @@ public class DevBootSecurityConfig extends WebSecurityConfigurerAdapter {
...
@@ -92,6 +92,7 @@ public class DevBootSecurityConfig extends WebSecurityConfigurerAdapter {
).
permitAll
()
).
permitAll
()
.
antMatchers
(
"/ibzou/org/**"
).
permitAll
()
.
antMatchers
(
"/ibzou/org/**"
).
permitAll
()
.
antMatchers
(
"/ibzemployees/**/oumaps"
).
permitAll
()
.
antMatchers
(
"/ibzemployees/**/oumaps"
).
permitAll
()
.
antMatchers
(
"/dictionarys/**"
).
permitAll
()
//放行登录请求
//放行登录请求
.
antMatchers
(
HttpMethod
.
POST
,
"/"
+
loginPath
).
permitAll
()
.
antMatchers
(
HttpMethod
.
POST
,
"/"
+
loginPath
).
permitAll
()
.
anyRequest
().
authenticated
()
.
anyRequest
().
authenticated
()
...
...
ibzou-core/src/main/java/cn/ibizlab/core/ou/extensions/service/OUModelService.java
浏览文件 @
3a33137d
...
@@ -8,6 +8,7 @@ import cn.ibizlab.core.ou.service.IIBZDepartmentService;
...
@@ -8,6 +8,7 @@ import cn.ibizlab.core.ou.service.IIBZDepartmentService;
import
cn.ibizlab.core.ou.service.IIBZOrganizationService
;
import
cn.ibizlab.core.ou.service.IIBZOrganizationService
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.cache.annotation.CacheEvict
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
...
@@ -218,7 +219,7 @@ public class OUModelService
...
@@ -218,7 +219,7 @@ public class OUModelService
}
}
//
@CacheEvict( value="ibzou-model",allEntries = true)
@CacheEvict
(
value
=
"ibzou-model"
,
allEntries
=
true
)
public
synchronized
void
refreshModel
()
public
synchronized
void
refreshModel
()
{
{
...
...
ibzou-provider/ibzou-provider-api/src/main/java/cn/ibizlab/api/config/apiSecurityConfig.java
浏览文件 @
3a33137d
...
@@ -120,6 +120,7 @@ public class apiSecurityConfig extends WebSecurityConfigurerAdapter {
...
@@ -120,6 +120,7 @@ public class apiSecurityConfig extends WebSecurityConfigurerAdapter {
//开放组织机构关系查询
//开放组织机构关系查询
.
antMatchers
(
"/ibzemployees/**/oumaps"
).
permitAll
()
.
antMatchers
(
"/ibzemployees/**/oumaps"
).
permitAll
()
.
antMatchers
(
"/ibzorganizations/**/suborg/picker"
).
permitAll
()
.
antMatchers
(
"/ibzorganizations/**/suborg/picker"
).
permitAll
()
.
antMatchers
(
"/dictionarys/**"
).
permitAll
()
// 所有请求都需要认证
// 所有请求都需要认证
.
anyRequest
().
authenticated
()
.
anyRequest
().
authenticated
()
// 防止iframe 造成跨域
// 防止iframe 造成跨域
...
...
ibzou-provider/ibzou-provider-api/src/main/java/cn/ibizlab/api/rest/extensions/OUCoreResource.java
浏览文件 @
3a33137d
package
cn
.
ibizlab
.
api
.
rest
.
extensions
;
package
cn
.
ibizlab
.
api
.
rest
.
extensions
;
import
cn.ibizlab.core.ou.domain.IBZDepartment
;
import
cn.ibizlab.core.ou.domain.IBZOrganization
;
import
cn.ibizlab.core.ou.extensions.domain.*
;
import
cn.ibizlab.core.ou.extensions.domain.*
;
import
cn.ibizlab.core.ou.extensions.service.OUCoreService
;
import
cn.ibizlab.core.ou.extensions.service.OUCoreService
;
import
cn.ibizlab.core.ou.domain.IBZEmployee
;
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.IIBZEmployeeService
;
import
cn.ibizlab.core.ou.service.IIBZOrganizationService
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
org.springframework.beans.factory.annotation.Autowired
;
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.http.ResponseEntity
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.sql.Wrapper
;
import
java.util.*
;
import
java.util.*
;
@RestController
@RestController
...
@@ -24,6 +31,14 @@ public class OUCoreResource
...
@@ -24,6 +31,14 @@ public class OUCoreResource
@Autowired
@Autowired
private
IIBZEmployeeService
iibzEmployeeService
;
private
IIBZEmployeeService
iibzEmployeeService
;
@Autowired
private
IIBZOrganizationService
iibzOrganizationService
;
@Autowired
private
IIBZDepartmentService
iibzDepartmentService
;
@GetMapping
(
"/ibzemployees/{userId}/oumaps"
)
@GetMapping
(
"/ibzemployees/{userId}/oumaps"
)
public
ResponseEntity
<
Map
<
String
,
Set
<
String
>>>
getOUMapsByUserId
(
@PathVariable
(
"userId"
)
String
userId
)
public
ResponseEntity
<
Map
<
String
,
Set
<
String
>>>
getOUMapsByUserId
(
@PathVariable
(
"userId"
)
String
userId
)
{
{
...
@@ -171,4 +186,66 @@ public class OUCoreResource
...
@@ -171,4 +186,66 @@ public class OUCoreResource
}
}
@Cacheable
(
value
=
"ibzou-model"
,
key
=
"'catalog:'+#p0"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/dictionarys/catalogs/{catalog}"
)
public
ResponseEntity
<
JSONObject
>
getCatalog
(
@PathVariable
(
"catalog"
)
String
catalog
)
{
return
getOptions
(
catalog
);
}
@Cacheable
(
value
=
"ibzou-model"
,
key
=
"'codelist:'+#p0"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/dictionarys/codelist/{catalog}"
)
public
ResponseEntity
<
JSONObject
>
getCodeList
(
@PathVariable
(
"catalog"
)
String
catalog
)
{
return
getOptions
(
catalog
);
}
public
ResponseEntity
<
JSONObject
>
getOptions
(
String
catalog
)
{
JSONObject
jo
=
new
JSONObject
();
jo
.
put
(
"srfkey"
,
catalog
);
jo
.
put
(
"emptytext"
,
""
);
List
<
JSONObject
>
list
=
new
ArrayList
<>();
if
(
"IbzouOrg"
.
equalsIgnoreCase
(
catalog
))
{
iibzOrganizationService
.
list
(
Wrappers
.<
IBZOrganization
>
query
().
orderByAsc
(
"showorder"
)).
forEach
(
item
->
{
JSONObject
option
=
new
JSONObject
();
option
.
put
(
"id"
,
item
.
getOrgid
());
option
.
put
(
"value"
,
item
.
getOrgid
());
option
.
put
(
"label"
,
item
.
getOrgname
());
option
.
put
(
"text"
,
item
.
getOrgname
());
list
.
add
(
option
);
});
}
else
if
(
"IbzouDept"
.
equalsIgnoreCase
(
catalog
)||
"IbzouOrgSector"
.
equalsIgnoreCase
(
catalog
))
{
iibzDepartmentService
.
list
(
Wrappers
.<
IBZDepartment
>
query
().
orderByAsc
(
"showorder"
)).
forEach
(
item
->
{
JSONObject
option
=
new
JSONObject
();
option
.
put
(
"id"
,
item
.
getDeptid
());
option
.
put
(
"value"
,
item
.
getDeptid
());
option
.
put
(
"label"
,
item
.
getDeptname
());
option
.
put
(
"text"
,
item
.
getDeptname
());
list
.
add
(
option
);
});
}
else
if
(
"IbzouUser"
.
equalsIgnoreCase
(
catalog
)||
"IbzouOperator"
.
equalsIgnoreCase
(
catalog
)||
"IbzouEmp"
.
equalsIgnoreCase
(
catalog
)||
"IbzouPerson"
.
equalsIgnoreCase
(
catalog
))
{
iibzEmployeeService
.
list
(
Wrappers
.<
IBZEmployee
>
query
().
orderByAsc
(
"showorder"
)).
forEach
(
item
->
{
JSONObject
option
=
new
JSONObject
();
option
.
put
(
"id"
,
item
.
getUserid
());
option
.
put
(
"value"
,
item
.
getUserid
());
option
.
put
(
"label"
,
item
.
getPersonname
());
option
.
put
(
"text"
,
item
.
getPersonname
());
list
.
add
(
option
);
});
}
jo
.
put
(
"items"
,
list
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
jo
);
}
}
}
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录