Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzou
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzou
提交
6fe837f8
提交
6fe837f8
编写于
5月 02, 2020
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ibizdev提交
上级
a2dc6297
变更
20
显示空白字符变更
内嵌
并排
正在显示
20 个修改的文件
包含
156 行增加
和
148 行删除
+156
-148
ibzdepartment_en_US.ts
...eb/src/locale/lanres/ibzdepartment/ibzdepartment_en_US.ts
+2
-2
ibzdepartment_zh_CN.ts
...eb/src/locale/lanres/ibzdepartment/ibzdepartment_zh_CN.ts
+2
-2
ibzorganization_en_US.ts
...rc/locale/lanres/ibzorganization/ibzorganization_en_US.ts
+1
-1
ibzorganization_zh_CN.ts
...rc/locale/lanres/ibzorganization/ibzorganization_zh_CN.ts
+1
-1
main-form-model.ts
...eb/src/widgets/ibzdepartment/main-form/main-form-model.ts
+1
-1
pickup-viewpickupviewpanel-pickupviewpanel-model.ts
...panel/pickup-viewpickupviewpanel-pickupviewpanel-model.ts
+6
-6
main-form-model.ts
.../src/widgets/ibzorganization/main-form/main-form-model.ts
+1
-1
new-form-form-model.ts
...gets/ibzorganization/new-form-form/new-form-form-model.ts
+1
-1
pickup-viewpickupviewpanel-pickupviewpanel-model.ts
...panel/pickup-viewpickupviewpanel-pickupviewpanel-model.ts
+3
-3
IBZDepartment.java
...rc/main/java/cn/ibizlab/core/ou/domain/IBZDepartment.java
+14
-15
IBZOrganization.java
.../main/java/cn/ibizlab/core/ou/domain/IBZOrganization.java
+7
-7
IBZDepartmentSearchContext.java
...cn/ibizlab/core/ou/filter/IBZDepartmentSearchContext.java
+14
-14
IBZOrganizationSearchContext.java
.../ibizlab/core/ou/filter/IBZOrganizationSearchContext.java
+14
-14
h2_table.xml
ibzou-core/src/main/resources/liquibase/h2_table.xml
+5
-7
IBZDepartmentMapper.xml
...resources/mapper/ou/ibzdepartment/IBZDepartmentMapper.xml
+4
-3
IBZOrganizationMapper.xml
...urces/mapper/ou/ibzorganization/IBZOrganizationMapper.xml
+1
-0
IBZDepartmentDTO.java
...pi/src/main/java/cn/ibizlab/api/dto/IBZDepartmentDTO.java
+16
-16
IBZOrganizationDTO.java
.../src/main/java/cn/ibizlab/api/dto/IBZOrganizationDTO.java
+8
-8
PermissionSyncJob.java
.../src/main/java/cn/ibizlab/util/job/PermissionSyncJob.java
+3
-4
AuthPermissionEvaluator.java
...ava/cn/ibizlab/util/security/AuthPermissionEvaluator.java
+52
-42
未找到文件。
app_web/src/locale/lanres/ibzdepartment/ibzdepartment_en_US.ts
浏览文件 @
6fe837f8
...
...
@@ -6,15 +6,15 @@ export default {
deptname
:
'部门名称'
,
orgid
:
'单位'
,
parentdeptid
:
'上级部门'
,
pdeptname
:
'上级部门'
,
shortname
:
'部门简称'
,
deptlevel
:
'部门级别'
,
showorder
:
'排序'
,
bcode
:
'业务编码'
,
enable
:
'逻辑有效'
,
orgname
:
'单位'
,
parentdeptname
:
'上级部门'
,
createdate
:
'创建时间'
,
updatedate
:
'最后修改时间'
,
orgname
:
'单位'
,
},
views
:
{
editview
:
{
...
...
app_web/src/locale/lanres/ibzdepartment/ibzdepartment_zh_CN.ts
浏览文件 @
6fe837f8
...
...
@@ -5,15 +5,15 @@ export default {
deptname
:
'部门名称'
,
orgid
:
'单位'
,
parentdeptid
:
'上级部门'
,
pdeptname
:
'上级部门'
,
shortname
:
'部门简称'
,
deptlevel
:
'部门级别'
,
showorder
:
'排序'
,
bcode
:
'业务编码'
,
enable
:
'逻辑有效'
,
orgname
:
'单位'
,
parentdeptname
:
'上级部门'
,
createdate
:
'创建时间'
,
updatedate
:
'最后修改时间'
,
orgname
:
'单位'
,
},
views
:
{
editview
:
{
...
...
app_web/src/locale/lanres/ibzorganization/ibzorganization_en_US.ts
浏览文件 @
6fe837f8
...
...
@@ -5,10 +5,10 @@ export default {
orgcode
:
'单位代码'
,
orgname
:
'名称'
,
parentorgid
:
'上级单位'
,
porgname
:
'上级单位'
,
shortname
:
'单位简称'
,
orglevel
:
'单位级别'
,
showorder
:
'排序'
,
parentorgname
:
'上级单位'
,
enable
:
'逻辑有效'
,
createdate
:
'创建时间'
,
updatedate
:
'最后修改时间'
,
...
...
app_web/src/locale/lanres/ibzorganization/ibzorganization_zh_CN.ts
浏览文件 @
6fe837f8
...
...
@@ -4,10 +4,10 @@ export default {
orgcode
:
'单位代码'
,
orgname
:
'名称'
,
parentorgid
:
'上级单位'
,
porgname
:
'上级单位'
,
shortname
:
'单位简称'
,
orglevel
:
'单位级别'
,
showorder
:
'排序'
,
parentorgname
:
'上级单位'
,
enable
:
'逻辑有效'
,
createdate
:
'创建时间'
,
updatedate
:
'最后修改时间'
,
...
...
app_web/src/widgets/ibzdepartment/main-form/main-form-model.ts
浏览文件 @
6fe837f8
...
...
@@ -72,7 +72,7 @@ export default class MainModel {
},
{
name
:
'pdeptname'
,
prop
:
'pdeptname'
,
prop
:
'p
arent
deptname'
,
dataType
:
'PICKUPTEXT'
,
},
{
...
...
app_web/src/widgets/ibzdepartment/pickup-viewpickupviewpanel-pickupviewpanel/pickup-viewpickupviewpanel-pickupviewpanel-model.ts
浏览文件 @
6fe837f8
...
...
@@ -30,9 +30,6 @@ export default class PickupViewpickupviewpanelModel {
{
name
:
'parentdeptid'
,
},
{
name
:
'pdeptname'
,
},
{
name
:
'shortname'
,
},
...
...
@@ -49,13 +46,16 @@ export default class PickupViewpickupviewpanelModel {
name
:
'enable'
,
},
{
name
:
'
createdat
e'
,
name
:
'
orgnam
e'
,
},
{
name
:
'
updatedat
e'
,
name
:
'
parentdeptnam
e'
,
},
{
name
:
'orgname'
,
name
:
'createdate'
,
},
{
name
:
'updatedate'
,
},
]
}
...
...
app_web/src/widgets/ibzorganization/main-form/main-form-model.ts
浏览文件 @
6fe837f8
...
...
@@ -72,7 +72,7 @@ export default class MainModel {
},
{
name
:
'porgname'
,
prop
:
'porgname'
,
prop
:
'p
arent
orgname'
,
dataType
:
'PICKUPTEXT'
,
},
{
...
...
app_web/src/widgets/ibzorganization/new-form-form/new-form-form-model.ts
浏览文件 @
6fe837f8
...
...
@@ -67,7 +67,7 @@ export default class NewFormModel {
},
{
name
:
'porgname'
,
prop
:
'porgname'
,
prop
:
'p
arent
orgname'
,
dataType
:
'PICKUPTEXT'
,
},
{
...
...
app_web/src/widgets/ibzorganization/pickup-viewpickupviewpanel-pickupviewpanel/pickup-viewpickupviewpanel-pickupviewpanel-model.ts
浏览文件 @
6fe837f8
...
...
@@ -27,9 +27,6 @@ export default class PickupViewpickupviewpanelModel {
{
name
:
'parentorgid'
,
},
{
name
:
'porgname'
,
},
{
name
:
'shortname'
,
},
...
...
@@ -39,6 +36,9 @@ export default class PickupViewpickupviewpanelModel {
{
name
:
'showorder'
,
},
{
name
:
'parentorgname'
,
},
{
name
:
'enable'
,
},
...
...
ibzou-core/src/main/java/cn/ibizlab/core/ou/domain/IBZDepartment.java
浏览文件 @
6fe837f8
...
...
@@ -69,13 +69,6 @@ public class IBZDepartment extends EntityMP implements Serializable {
@JSONField
(
name
=
"parentdeptid"
)
@JsonProperty
(
"parentdeptid"
)
private
String
parentdeptid
;
/**
* 上级部门
*/
@TableField
(
exist
=
false
)
@JSONField
(
name
=
"pdeptname"
)
@JsonProperty
(
"pdeptname"
)
private
String
pdeptname
;
/**
* 部门简称
*/
...
...
@@ -113,6 +106,20 @@ public class IBZDepartment extends EntityMP implements Serializable {
@JSONField
(
name
=
"enable"
)
@JsonProperty
(
"enable"
)
private
Integer
enable
;
/**
* 单位
*/
@TableField
(
exist
=
false
)
@JSONField
(
name
=
"orgname"
)
@JsonProperty
(
"orgname"
)
private
String
orgname
;
/**
* 上级部门
*/
@TableField
(
exist
=
false
)
@JSONField
(
name
=
"parentdeptname"
)
@JsonProperty
(
"parentdeptname"
)
private
String
parentdeptname
;
/**
* 创建时间
*/
...
...
@@ -131,14 +138,6 @@ public class IBZDepartment extends EntityMP implements Serializable {
@JSONField
(
name
=
"updatedate"
,
format
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonProperty
(
"updatedate"
)
private
Timestamp
updatedate
;
/**
* 单位
*/
@DEField
(
preType
=
DEPredefinedFieldType
.
ORGNAME
)
@TableField
(
value
=
"orgname"
)
@JSONField
(
name
=
"orgname"
)
@JsonProperty
(
"orgname"
)
private
String
orgname
;
/**
*
...
...
ibzou-core/src/main/java/cn/ibizlab/core/ou/domain/IBZOrganization.java
浏览文件 @
6fe837f8
...
...
@@ -62,13 +62,6 @@ public class IBZOrganization extends EntityMP implements Serializable {
@JSONField
(
name
=
"parentorgid"
)
@JsonProperty
(
"parentorgid"
)
private
String
parentorgid
;
/**
* 上级单位
*/
@TableField
(
exist
=
false
)
@JSONField
(
name
=
"porgname"
)
@JsonProperty
(
"porgname"
)
private
String
porgname
;
/**
* 单位简称
*/
...
...
@@ -90,6 +83,13 @@ public class IBZOrganization extends EntityMP implements Serializable {
@JSONField
(
name
=
"showorder"
)
@JsonProperty
(
"showorder"
)
private
Integer
showorder
;
/**
* 上级单位
*/
@TableField
(
exist
=
false
)
@JSONField
(
name
=
"parentorgname"
)
@JsonProperty
(
"parentorgname"
)
private
String
parentorgname
;
/**
* 逻辑有效
*/
...
...
ibzou-core/src/main/java/cn/ibizlab/core/ou/filter/IBZDepartmentSearchContext.java
浏览文件 @
6fe837f8
...
...
@@ -53,20 +53,6 @@ public class IBZDepartmentSearchContext extends QueryWrapperContext<IBZDepartmen
if
(!
ObjectUtils
.
isEmpty
(
this
.
n_pdeptid_eq
)){
this
.
getSelectCond
().
eq
(
"pdeptid"
,
n_pdeptid_eq
);
}
}
private
String
n_pdeptname_eq
;
//[上级部门]
public
void
setN_pdeptname_eq
(
String
n_pdeptname_eq
)
{
this
.
n_pdeptname_eq
=
n_pdeptname_eq
;
if
(!
ObjectUtils
.
isEmpty
(
this
.
n_pdeptname_eq
)){
this
.
getSelectCond
().
eq
(
"pdeptname"
,
n_pdeptname_eq
);
}
}
private
String
n_pdeptname_like
;
//[上级部门]
public
void
setN_pdeptname_like
(
String
n_pdeptname_like
)
{
this
.
n_pdeptname_like
=
n_pdeptname_like
;
if
(!
ObjectUtils
.
isEmpty
(
this
.
n_pdeptname_like
)){
this
.
getSelectCond
().
like
(
"pdeptname"
,
n_pdeptname_like
);
}
}
private
String
n_bcode_like
;
//[业务编码]
public
void
setN_bcode_like
(
String
n_bcode_like
)
{
...
...
@@ -89,6 +75,20 @@ public class IBZDepartmentSearchContext extends QueryWrapperContext<IBZDepartmen
this
.
getSelectCond
().
like
(
"orgname"
,
n_orgname_like
);
}
}
private
String
n_pdeptname_eq
;
//[上级部门]
public
void
setN_pdeptname_eq
(
String
n_pdeptname_eq
)
{
this
.
n_pdeptname_eq
=
n_pdeptname_eq
;
if
(!
ObjectUtils
.
isEmpty
(
this
.
n_pdeptname_eq
)){
this
.
getSelectCond
().
eq
(
"pdeptname"
,
n_pdeptname_eq
);
}
}
private
String
n_pdeptname_like
;
//[上级部门]
public
void
setN_pdeptname_like
(
String
n_pdeptname_like
)
{
this
.
n_pdeptname_like
=
n_pdeptname_like
;
if
(!
ObjectUtils
.
isEmpty
(
this
.
n_pdeptname_like
)){
this
.
getSelectCond
().
like
(
"pdeptname"
,
n_pdeptname_like
);
}
}
/**
* 启用快速搜索
...
...
ibzou-core/src/main/java/cn/ibizlab/core/ou/filter/IBZOrganizationSearchContext.java
浏览文件 @
6fe837f8
...
...
@@ -53,20 +53,6 @@ public class IBZOrganizationSearchContext extends QueryWrapperContext<IBZOrganiz
if
(!
ObjectUtils
.
isEmpty
(
this
.
n_porgid_eq
)){
this
.
getSelectCond
().
eq
(
"porgid"
,
n_porgid_eq
);
}
}
private
String
n_porgname_eq
;
//[上级单位]
public
void
setN_porgname_eq
(
String
n_porgname_eq
)
{
this
.
n_porgname_eq
=
n_porgname_eq
;
if
(!
ObjectUtils
.
isEmpty
(
this
.
n_porgname_eq
)){
this
.
getSelectCond
().
eq
(
"porgname"
,
n_porgname_eq
);
}
}
private
String
n_porgname_like
;
//[上级单位]
public
void
setN_porgname_like
(
String
n_porgname_like
)
{
this
.
n_porgname_like
=
n_porgname_like
;
if
(!
ObjectUtils
.
isEmpty
(
this
.
n_porgname_like
)){
this
.
getSelectCond
().
like
(
"porgname"
,
n_porgname_like
);
}
}
private
String
n_shortname_like
;
//[单位简称]
public
void
setN_shortname_like
(
String
n_shortname_like
)
{
...
...
@@ -89,6 +75,20 @@ public class IBZOrganizationSearchContext extends QueryWrapperContext<IBZOrganiz
this
.
getSelectCond
().
le
(
"orglevel"
,
n_orglevel_ltandeq
);
}
}
private
String
n_porgname_eq
;
//[上级单位]
public
void
setN_porgname_eq
(
String
n_porgname_eq
)
{
this
.
n_porgname_eq
=
n_porgname_eq
;
if
(!
ObjectUtils
.
isEmpty
(
this
.
n_porgname_eq
)){
this
.
getSelectCond
().
eq
(
"porgname"
,
n_porgname_eq
);
}
}
private
String
n_porgname_like
;
//[上级单位]
public
void
setN_porgname_like
(
String
n_porgname_like
)
{
this
.
n_porgname_like
=
n_porgname_like
;
if
(!
ObjectUtils
.
isEmpty
(
this
.
n_porgname_like
)){
this
.
getSelectCond
().
like
(
"porgname"
,
n_porgname_like
);
}
}
/**
* 启用快速搜索
...
...
ibzou-core/src/main/resources/liquibase/h2_table.xml
浏览文件 @
6fe837f8
...
...
@@ -2,7 +2,7 @@
<databaseChangeLog
xmlns=
"http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext=
"http://www.liquibase.org/xml/ns/dbchangelog-ext"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd"
>
<!--输出实体[IBZORG]数据结构 -->
<changeSet
author=
"a_A_5d9d78509"
id=
"tab-ibzorg-
397
-1"
>
<changeSet
author=
"a_A_5d9d78509"
id=
"tab-ibzorg-
401
-1"
>
<createTable
tableName=
"IBZORG"
>
<column
name=
"ORGID"
remarks=
""
type=
"VARCHAR(100)"
>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_IBZORG_ORGID"
/>
...
...
@@ -106,7 +106,7 @@
</createTable>
</changeSet>
<!--输出实体[IBZDEPT]数据结构 -->
<changeSet
author=
"a_A_5d9d78509"
id=
"tab-ibzdept-5
08
-3"
>
<changeSet
author=
"a_A_5d9d78509"
id=
"tab-ibzdept-5
12
-3"
>
<createTable
tableName=
"IBZDEPT"
>
<column
name=
"DEPTID"
remarks=
""
type=
"VARCHAR(100)"
>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_IBZDEPT_DEPTID"
/>
...
...
@@ -133,13 +133,11 @@
</column>
<column
name=
"UPDATEDATE"
remarks=
""
type=
"DATETIME"
>
</column>
<column
name=
"ORGNAME"
remarks=
""
type=
"VARCHAR(100)"
>
</column>
</createTable>
</changeSet>
<!--输出实体[IBZORG]外键关系 -->
<changeSet
author=
"a_A_5d9d78509"
id=
"fk-ibzorg-
397
-4"
>
<changeSet
author=
"a_A_5d9d78509"
id=
"fk-ibzorg-
401
-4"
>
<addForeignKeyConstraint
baseColumnNames=
"PORGID"
baseTableName=
"IBZORG"
constraintName=
"DER1N_IBZORG_IBZORG_PORGID"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"ORGID"
referencedTableName=
"IBZORG"
validate=
"true"
/>
</changeSet>
<!--输出实体[IBZEMP]外键关系 -->
...
...
@@ -150,10 +148,10 @@
<addForeignKeyConstraint
baseColumnNames=
"ORGID"
baseTableName=
"IBZEMP"
constraintName=
"DER1N_IBZEMP_IBZORG_ORGID"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"ORGID"
referencedTableName=
"IBZORG"
validate=
"true"
/>
</changeSet>
<!--输出实体[IBZDEPT]外键关系 -->
<changeSet
author=
"a_A_5d9d78509"
id=
"fk-ibzdept-5
08
-7"
>
<changeSet
author=
"a_A_5d9d78509"
id=
"fk-ibzdept-5
12
-7"
>
<addForeignKeyConstraint
baseColumnNames=
"PDEPTID"
baseTableName=
"IBZDEPT"
constraintName=
"DER1N_IBZDEPT_IBZDEPT_PDEPTID"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"DEPTID"
referencedTableName=
"IBZDEPT"
validate=
"true"
/>
</changeSet>
<changeSet
author=
"a_A_5d9d78509"
id=
"fk-ibzdept-5
08
-8"
>
<changeSet
author=
"a_A_5d9d78509"
id=
"fk-ibzdept-5
12
-8"
>
<addForeignKeyConstraint
baseColumnNames=
"ORGID"
baseTableName=
"IBZDEPT"
constraintName=
"DER1N_IBZDEPT_IBZORG_ORGID"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"ORGID"
referencedTableName=
"IBZORG"
validate=
"true"
/>
</changeSet>
...
...
ibzou-core/src/main/resources/mapper/ou/ibzdepartment/IBZDepartmentMapper.xml
浏览文件 @
6fe837f8
...
...
@@ -5,7 +5,7 @@
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select
id=
"selectById"
resultMap=
"IBZDepartmentResultMap"
databaseId=
"mysql"
>
<![CDATA[select t1.* from (SELECT t1.`BCODE`, t1.`CREATEDATE`, t1.`DEPTCODE`, t1.`DEPTID`, t1.`DEPTLEVEL`, t1.`DEPTNAME`, t1.`ENABLE`, t1.`ORGID`, t1
.`ORGNAME`, t1.`PDEPTID`, t11.`DEPTNAME` AS `PDEPTNAME`, t1.`SHORTNAME`, t1.`SHOWORDER`, t1.`UPDATEDATE` FROM `IBZDEPT` t1 LEFT JOIN IBZDEPT t11 ON t1.PDEPTID = t1
1.DEPTID ) t1 where deptid=#{id}]]>
<![CDATA[select t1.* from (SELECT t1.`BCODE`, t1.`CREATEDATE`, t1.`DEPTCODE`, t1.`DEPTID`, t1.`DEPTLEVEL`, t1.`DEPTNAME`, t1.`ENABLE`, t1.`ORGID`, t1
1.`ORGNAME`, t1.`PDEPTID`, t21.`DEPTNAME` AS `PDEPTNAME`, t1.`SHORTNAME`, t1.`SHOWORDER`, t1.`UPDATEDATE` FROM `IBZDEPT` t1 LEFT JOIN IBZORG t11 ON t1.ORGID = t11.ORGID LEFT JOIN IBZDEPT t21 ON t1.PDEPTID = t2
1.DEPTID ) t1 where deptid=#{id}]]>
</select>
<select
id=
"selectById"
resultMap=
"IBZDepartmentResultMap"
databaseId=
"postgresql"
>
<![CDATA[select t1.* from (SELECT t1.BCODE, t1.CREATEDATE, t1.DEPTCODE, t1.DEPTID, t1.DEPTLEVEL, t1.DEPTNAME, t1.ENABLE, t1.ORGID, t1.PDEPTID, t1.SHORTNAME, t1.SHOWORDER, t1.UPDATEDATE FROM IBZDEPT t1 ) t1 where deptid=#{id}]]>
...
...
@@ -16,6 +16,7 @@
<id
property=
"deptid"
column=
"deptid"
/>
<!--主键字段映射-->
<result
property=
"orgid"
column=
"orgid"
/>
<result
property=
"parentdeptid"
column=
"pdeptid"
/>
<result
property=
"parentdeptname"
column=
"pdeptname"
/>
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
...
...
@@ -50,7 +51,7 @@
<!--数据查询[Default]-->
<sql
id=
"Default"
databaseId=
"mysql"
>
<![CDATA[ SELECT t1.`BCODE`, t1.`CREATEDATE`, t1.`DEPTCODE`, t1.`DEPTID`, t1.`DEPTLEVEL`, t1.`DEPTNAME`, t1.`ENABLE`, t1.`ORGID`, t1
.`ORGNAME`, t1.`PDEPTID`, t11.`DEPTNAME` AS `PDEPTNAME`, t1.`SHORTNAME`, t1.`SHOWORDER`, t1.`UPDATEDATE` FROM `IBZDEPT` t1 LEFT JOIN IBZDEPT t11 ON t1.PDEPTID = t1
1.DEPTID
<![CDATA[ SELECT t1.`BCODE`, t1.`CREATEDATE`, t1.`DEPTCODE`, t1.`DEPTID`, t1.`DEPTLEVEL`, t1.`DEPTNAME`, t1.`ENABLE`, t1.`ORGID`, t1
1.`ORGNAME`, t1.`PDEPTID`, t21.`DEPTNAME` AS `PDEPTNAME`, t1.`SHORTNAME`, t1.`SHOWORDER`, t1.`UPDATEDATE` FROM `IBZDEPT` t1 LEFT JOIN IBZORG t11 ON t1.ORGID = t11.ORGID LEFT JOIN IBZDEPT t21 ON t1.PDEPTID = t2
1.DEPTID
WHERE t1.ENABLE = 1
]]>
</sql>
...
...
@@ -64,7 +65,7 @@
<!--数据查询[View]-->
<sql
id=
"View"
databaseId=
"mysql"
>
<![CDATA[ SELECT t1.`BCODE`, t1.`CREATEDATE`, t1.`DEPTCODE`, t1.`DEPTID`, t1.`DEPTLEVEL`, t1.`DEPTNAME`, t1.`ENABLE`, t1.`ORGID`, t1
.`ORGNAME`, t1.`PDEPTID`, t11.`DEPTNAME` AS `PDEPTNAME`, t1.`SHORTNAME`, t1.`SHOWORDER`, t1.`UPDATEDATE` FROM `IBZDEPT` t1 LEFT JOIN IBZDEPT t11 ON t1.PDEPTID = t1
1.DEPTID
<![CDATA[ SELECT t1.`BCODE`, t1.`CREATEDATE`, t1.`DEPTCODE`, t1.`DEPTID`, t1.`DEPTLEVEL`, t1.`DEPTNAME`, t1.`ENABLE`, t1.`ORGID`, t1
1.`ORGNAME`, t1.`PDEPTID`, t21.`DEPTNAME` AS `PDEPTNAME`, t1.`SHORTNAME`, t1.`SHOWORDER`, t1.`UPDATEDATE` FROM `IBZDEPT` t1 LEFT JOIN IBZORG t11 ON t1.ORGID = t11.ORGID LEFT JOIN IBZDEPT t21 ON t1.PDEPTID = t2
1.DEPTID
WHERE t1.ENABLE = 1
]]>
</sql>
...
...
ibzou-core/src/main/resources/mapper/ou/ibzorganization/IBZOrganizationMapper.xml
浏览文件 @
6fe837f8
...
...
@@ -15,6 +15,7 @@
<resultMap
id=
"IBZOrganizationResultMap"
type=
"cn.ibizlab.core.ou.domain.IBZOrganization"
autoMapping=
"true"
>
<id
property=
"orgid"
column=
"orgid"
/>
<!--主键字段映射-->
<result
property=
"parentorgid"
column=
"porgid"
/>
<result
property=
"parentorgname"
column=
"porgname"
/>
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
...
...
ibzou-provider/ibzou-provider-api/src/main/java/cn/ibizlab/api/dto/IBZDepartmentDTO.java
浏览文件 @
6fe837f8
...
...
@@ -63,14 +63,6 @@ public class IBZDepartmentDTO extends DTOBase implements Serializable {
@JsonProperty
(
"parentdeptid"
)
private
String
parentdeptid
;
/**
* 属性 [PDEPTNAME]
*
*/
@JSONField
(
name
=
"pdeptname"
)
@JsonProperty
(
"pdeptname"
)
private
String
pdeptname
;
/**
* 属性 [SHORTNAME]
*
...
...
@@ -111,6 +103,22 @@ public class IBZDepartmentDTO extends DTOBase implements Serializable {
@JsonProperty
(
"enable"
)
private
Integer
enable
;
/**
* 属性 [ORGNAME]
*
*/
@JSONField
(
name
=
"orgname"
)
@JsonProperty
(
"orgname"
)
private
String
orgname
;
/**
* 属性 [PDEPTNAME]
*
*/
@JSONField
(
name
=
"parentdeptname"
)
@JsonProperty
(
"parentdeptname"
)
private
String
parentdeptname
;
/**
* 属性 [CREATEDATE]
*
...
...
@@ -129,14 +137,6 @@ public class IBZDepartmentDTO extends DTOBase implements Serializable {
@JsonProperty
(
"updatedate"
)
private
Timestamp
updatedate
;
/**
* 属性 [ORGNAME]
*
*/
@JSONField
(
name
=
"orgname"
)
@JsonProperty
(
"orgname"
)
private
String
orgname
;
/**
* 设置 [DEPTCODE]
...
...
ibzou-provider/ibzou-provider-api/src/main/java/cn/ibizlab/api/dto/IBZOrganizationDTO.java
浏览文件 @
6fe837f8
...
...
@@ -55,14 +55,6 @@ public class IBZOrganizationDTO extends DTOBase implements Serializable {
@JsonProperty
(
"parentorgid"
)
private
String
parentorgid
;
/**
* 属性 [PORGNAME]
*
*/
@JSONField
(
name
=
"porgname"
)
@JsonProperty
(
"porgname"
)
private
String
porgname
;
/**
* 属性 [SHORTNAME]
*
...
...
@@ -87,6 +79,14 @@ public class IBZOrganizationDTO extends DTOBase implements Serializable {
@JsonProperty
(
"showorder"
)
private
Integer
showorder
;
/**
* 属性 [PORGNAME]
*
*/
@JSONField
(
name
=
"parentorgname"
)
@JsonProperty
(
"parentorgname"
)
private
String
parentorgname
;
/**
* 属性 [ENABLE]
*
...
...
ibzou-util/src/main/java/cn/ibizlab/util/job/PermissionSyncJob.java
浏览文件 @
6fe837f8
...
...
@@ -36,14 +36,13 @@ public class PermissionSyncJob implements ApplicationRunner {
private
String
systemId
;
@Override
public
void
run
(
ApplicationArguments
args
)
throws
Exception
{
public
void
run
(
ApplicationArguments
args
)
{
if
(
enablePermissionValid
){
try
{
InputStream
permission
=
this
.
getClass
().
getResourceAsStream
(
"/deprivs/DEPrivs.json"
);
//获取当前系统所有实体资源能力
String
permissionResult
=
IOUtils
.
toString
(
permission
,
"UTF-8"
);
JSONArray
jsonNodePermission
=
JSONArray
.
parseArray
(
permissionResult
);
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
map
.
put
(
"menu"
,
new
JSONArray
());
JSONObject
jsonNodePermission
=
JSONObject
.
parseObject
(
permissionResult
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"permission"
,
jsonNodePermission
);
client
.
pushSystemPermissionData
(
map
,
systemId
);
}
...
...
ibzou-util/src/main/java/cn/ibizlab/util/security/AuthPermissionEvaluator.java
浏览文件 @
6fe837f8
...
...
@@ -31,6 +31,14 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
@Value
(
"${ibiz.enablePermissionValid:false}"
)
boolean
enablePermissionValid
;
//是否开启权限校验
/**
* 实体行为操作标识
*/
private
String
DEActionType
=
"DEACTION"
;
/**
* 实体数据集操作标识
*/
private
String
DataSetTag
=
"DATASET"
;
/**
* 表格权限检查 :用于检查当前用户是否拥有表格数据的读取、删除权限
...
...
@@ -68,10 +76,10 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
String
entityName
=
entity
.
getClass
().
getSimpleName
();
//获取实体行为权限信息
JSONObject
permissionList
=
userPermission
.
getJSONObject
(
"
deActionPermission
"
);
JSONObject
permissionList
=
userPermission
.
getJSONObject
(
"
userPermissionList
"
);
//检查是否有操作权限[create.update.delete.read]
if
(!
validHasPermission
(
permissionList
,
entityName
,
action
)){
if
(!
valid
DEAction
HasPermission
(
permissionList
,
entityName
,
action
)){
return
false
;
}
//检查是否有数据权限[单行删除]
...
...
@@ -86,23 +94,23 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
else
{
//grid fetch
//准备参数
Object
searchContext
=
gridParamList
.
get
(
0
);
String
dataSet
=
String
.
valueOf
(
gridParamList
.
get
(
1
));
String
dataSet
Name
=
String
.
valueOf
(
gridParamList
.
get
(
1
));
EntityBase
entity
=
(
EntityBase
)
gridParamList
.
get
(
2
);
String
entityName
=
entity
.
getClass
().
getSimpleName
();
//获取数据集权限信息
JSONObject
permissionList
=
userPermission
.
getJSONObject
(
"
deDataSetPermission
"
);
JSONObject
permissionList
=
userPermission
.
getJSONObject
(
"
userPermissionList
"
);
if
(
StringUtils
.
isEmpty
(
entityName
)||
StringUtils
.
isEmpty
(
dataSet
)||
StringUtils
.
isEmpty
(
action
))
if
(
StringUtils
.
isEmpty
(
entityName
)||
StringUtils
.
isEmpty
(
dataSet
Name
)||
StringUtils
.
isEmpty
(
action
))
return
false
;
//检查是否有
操作权限[create.update.delete.read]
if
(!
valid
HasPermission
(
permissionList
,
entityName
,
dataSet
,
action
)){
//检查是否有
访问数据集的权限
if
(!
valid
DataSetHasPermission
(
permissionList
,
entityName
,
dataSetName
)){
return
false
;
}
Map
<
String
,
String
>
permissionField
=
getPermissionField
(
entity
);
//获取组织、部门预置属性
String
permissionSQL
=
getPermissionSQLByList
(
permissionList
,
entityName
,
action
,
dataSet
,
permissionField
);
//获取权限SQL
String
permissionSQL
=
getPermissionSQLByList
(
permissionList
,
entityName
,
action
,
dataSet
Name
,
permissionField
);
//获取权限SQL
if
(
StringUtils
.
isEmpty
(
permissionSQL
))
return
false
;
fillPermissionSQL
(
searchContext
,
permissionSQL
);
//将权限SQL添加到searchContext中,过滤出权限内数据
...
...
@@ -134,11 +142,11 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
return
false
;
JSONObject
userPermission
=
AuthenticationUser
.
getAuthenticationUser
().
getPermisionList
();
JSONObject
permissionList
=
userPermission
.
getJSONObject
(
"
deActionPermission
"
);
JSONObject
permissionList
=
userPermission
.
getJSONObject
(
"
userPermissionList
"
);
String
entityName
=
entity
.
getClass
().
getSimpleName
();
if
(
action
.
equals
(
"CREATE"
)){
return
validHasPermission
(
permissionList
,
entityName
,
action
);
return
valid
DEAction
HasPermission
(
permissionList
,
entityName
,
action
);
}
else
{
//拥有全部数据访问权限时,则跳过权限检查
...
...
@@ -146,7 +154,7 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
return
true
;
}
//检查是否有操作权限[create.update.delete.read]
if
(!
validHasPermission
(
permissionList
,
entityName
,
action
)){
if
(!
valid
DEAction
HasPermission
(
permissionList
,
entityName
,
action
)){
return
false
;
}
//检查是否有数据权限
...
...
@@ -155,7 +163,6 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
String
permissionSQL
=
getPermissionSQLById
(
permissionList
,
entityName
,
action
,
srfKey
,
permissionField
);
//获取权限SQL
if
(
StringUtils
.
isEmpty
(
permissionSQL
))
return
false
;
QueryWrapper
permissionWrapper
=
getPermissionWrapper
(
permissionSQL
);
//构造权限条件
return
testDataAccess
(
service
,
permissionWrapper
);
//执行权限检查
}
...
...
@@ -193,11 +200,11 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
private
String
getPermissionSQLByList
(
JSONObject
gridDataAbility
,
String
entityName
,
String
action
,
String
dataSetName
,
Map
<
String
,
String
>
permissionField
){
JSONObject
entity
=
gridDataAbility
.
getJSONObject
(
entityName
);
//获取实体
JSONObject
dataSet
=
entity
.
getJSONObject
(
dataSetName
);
//获取实体数据集
JSONArray
opprivList
=
dataSet
.
getJSONArray
(
action
);
//行为:read;insert...
if
(
opprivList
.
size
()==
0
)
JSONObject
permissionType
=
entity
.
getJSONObject
(
DataSetTag
);
JSONArray
dataRange
=
permissionType
.
getJSONArray
(
dataSetName
);
//获取实体数据集
if
(
dataRange
.
size
()==
0
)
return
null
;
return
getPermissionSQL
(
opprivList
,
permissionField
);
//拼接权限条件-查询
return
getPermissionSQL
(
dataRange
,
permissionField
);
//拼接权限条件-查询
}
/**
...
...
@@ -215,21 +222,25 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
}
/**
* 校验是否有访问实体行为能力
* @param permissionList 权限列表
* @param entityName 实体名称
* @param action 操作行为
* 实体行为权限校验
* @param userPermission
* @param entityName
* @param action
* userPermission:{"ENTITY":{"DEACTION":{"READ":["CURORG"]},"DATASET":{"Default":["CURORG"]}}}
* @return
*/
private
boolean
valid
HasPermission
(
JSONObject
permissionList
,
String
entityName
,
String
action
){
private
boolean
valid
DEActionHasPermission
(
JSONObject
userPermission
,
String
entityName
,
String
action
){
boolean
hasPermission
=
false
;
if
(
permissionList
==
null
)
if
(
userPermission
==
null
)
return
false
;
if
(!
permissionList
.
containsKey
(
entityName
))
if
(!
userPermission
.
containsKey
(
entityName
))
return
false
;
JSONObject
entity
=
permissionList
.
getJSONObject
(
entityName
);
if
(
entity
.
containsKey
(
action
)){
JSONObject
entity
=
userPermission
.
getJSONObject
(
entityName
);
//获取实体
if
(!
entity
.
containsKey
(
DEActionType
))
return
false
;
JSONObject
dataRange
=
entity
.
getJSONObject
(
DEActionType
);
//获取实体行为对应的数据范围
if
(
dataRange
.
containsKey
(
action
)){
hasPermission
=
true
;
}
return
hasPermission
;
...
...
@@ -237,31 +248,33 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
/**
*
校验是否有访问数据集能力
* @param
permissionList
*
数据集合权限校验
* @param
userPermission
* @param entityName
* @param dataSetName
*
@param action
*
userPermission:{"ENTITY":{"DEACTION":{"READ":["CURORG"]},"DATASET":{"Default":["CURORG"]}}}
* @return
*/
private
boolean
valid
HasPermission
(
JSONObject
permissionList
,
String
entityName
,
String
dataSetName
,
String
action
){
private
boolean
valid
DataSetHasPermission
(
JSONObject
userPermission
,
String
entityName
,
String
dataSetName
){
boolean
hasPermission
=
false
;
if
(
permissionList
==
null
)
if
(
userPermission
==
null
)
return
false
;
if
(!
permissionList
.
containsKey
(
entityName
))
if
(!
userPermission
.
containsKey
(
entityName
))
return
false
;
JSONObject
entity
=
permissionList
.
getJSONObject
(
entityName
);
if
(!
entity
.
containsKey
(
dataSetName
))
JSONObject
entity
=
userPermission
.
getJSONObject
(
entityName
);
//获取实体
if
(!
entity
.
containsKey
(
DataSetTag
))
return
false
;
JSONObject
dataSet
=
entity
.
getJSONObject
(
dataSetName
);
//获取实体数据集
if
(
dataSet
.
containsKey
(
action
)){
JSONObject
dataSetList
=
entity
.
getJSONObject
(
DataSetTag
);
//获取数据集
if
(!
dataSetList
.
containsKey
(
dataSetName
))
return
false
;
JSONArray
dataRange
=
dataSetList
.
getJSONArray
(
dataSetName
);
//获取数据范围
if
(
dataRange
!=
null
&&
dataRange
.
size
()>
0
){
hasPermission
=
true
;
}
return
hasPermission
;
}
/**
* 获取单条权限数据SQL
* @param formDataAbility
...
...
@@ -274,7 +287,8 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
private
String
getPermissionSQLById
(
JSONObject
formDataAbility
,
String
entityName
,
String
action
,
Object
srfKey
,
Map
<
String
,
String
>
permissionField
){
JSONObject
entity
=
formDataAbility
.
getJSONObject
(
entityName
);
//获取实体
JSONArray
opprivList
=
entity
.
getJSONArray
(
action
);
//行为:read;insert...
JSONObject
permissionType
=
entity
.
getJSONObject
(
DEActionType
);
JSONArray
opprivList
=
permissionType
.
getJSONArray
(
action
);
//行为:read;insert...
if
(
opprivList
.
size
()==
0
)
return
null
;
String
permissionSQL
=
getPermissionSQL
(
opprivList
,
permissionField
);
...
...
@@ -286,7 +300,6 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
return
String
.
format
(
" (%s) AND (%s='%s')"
,
permissionSQL
,
keyField
,
srfKey
);
//拼接权限条件-编辑
}
/**
* 表单权限检查
* @param service
...
...
@@ -302,7 +315,6 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
return
isPermission
;
}
/**
* 获取权限SQL
* @param oppriList
...
...
@@ -430,7 +442,6 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
/**
* 转换[a,b]格式字符串到 'a','b'格式
*
* @return
*/
private
String
formatStringArr
(
JSONArray
array
)
{
...
...
@@ -441,7 +452,6 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
/**
* 格式转换
*
* @param cond
* @param operator
* @return
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录