Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
T
test
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
邬友楠
test
Commits
90193e5d
Commit
90193e5d
authored
May 08, 2020
by
雍欢
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复:MySQL数据库下面可以正常使用数据管理权限
parent
ecaee512
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
164 additions
and
44 deletions
+164
-44
pom.xml
huigou-common/pom.xml
+1
-1
pom.xml
huigou-core-api/pom.xml
+1
-1
ProcessStatus.java
...-api/src/main/java/com/huigou/uasp/bpm/ProcessStatus.java
+4
-1
pom.xml
huigou-core-impl/pom.xml
+1
-1
pom.xml
huigou-core-proxy/pom.xml
+1
-1
pom.xml
huigou-data/pom.xml
+1
-1
QueryPermissionBuilderImpl.java
...ava/com/huigou/data/query/QueryPermissionBuilderImpl.java
+4
-11
pom.xml
huigou-loader/pom.xml
+1
-1
pom.xml
huigou-system-common/pom.xml
+1
-1
pom.xml
huigou-uasp/pom.xml
+2
-2
dataManagement.xml
...c/main/resources/config/uasp/query/bmp/dataManagement.xml
+0
-19
dataManagement.xml
.../resources/config/uasp/query/bmp/mysql/dataManagement.xml
+143
-0
pom.xml
huigou-xt/pom.xml
+1
-1
pom.xml
pom.xml
+2
-2
pom.xml
query-spring/pom.xml
+1
-1
No files found.
huigou-common/pom.xml
View file @
90193e5d
...
...
@@ -6,7 +6,7 @@
<parent>
<groupId>
com.huigou
</groupId>
<artifactId>
root
</artifactId>
<version>
1.2.
5
</version>
<version>
1.2.
6
</version>
</parent>
<artifactId>
huigou-common
</artifactId>
<name>
huigou-common
</name>
...
...
huigou-core-api/pom.xml
View file @
90193e5d
...
...
@@ -6,7 +6,7 @@
<parent>
<groupId>
com.huigou
</groupId>
<artifactId>
root
</artifactId>
<version>
1.2.
5
</version>
<version>
1.2.
6
</version>
</parent>
<artifactId>
huigou-core-api
</artifactId>
<name>
huigou-core-api
</name>
...
...
huigou-core-api/src/main/java/com/huigou/uasp/bpm/ProcessStatus.java
View file @
90193e5d
...
...
@@ -9,7 +9,10 @@ import com.huigou.util.StringUtil;
* @author gongmm
*/
public
enum
ProcessStatus
{
EXECUTING
(
"executing"
,
"正在处理"
),
COMPLETED
(
"completed"
,
"已完成"
),
ABORTED
(
"aborted"
,
"已终止"
),
DELETED
(
"deleted"
,
"已删除"
);
EXECUTING
(
"executing"
,
"正在处理"
),
COMPLETED
(
"completed"
,
"已完成"
),
ABORTED
(
"aborted"
,
"已终止"
),
DELETED
(
"deleted"
,
"已删除"
);
private
final
String
id
;
...
...
huigou-core-impl/pom.xml
View file @
90193e5d
...
...
@@ -6,7 +6,7 @@
<parent>
<groupId>
com.huigou
</groupId>
<artifactId>
root
</artifactId>
<version>
1.2.
5
</version>
<version>
1.2.
6
</version>
</parent>
<artifactId>
huigou-core-impl
</artifactId>
<name>
huigou-core-impl
</name>
...
...
huigou-core-proxy/pom.xml
View file @
90193e5d
...
...
@@ -6,7 +6,7 @@
<parent>
<groupId>
com.huigou
</groupId>
<artifactId>
root
</artifactId>
<version>
1.2.
5
</version>
<version>
1.2.
6
</version>
</parent>
<artifactId>
huigou-core-proxy
</artifactId>
<name>
huigou-core-proxy
</name>
...
...
huigou-data/pom.xml
View file @
90193e5d
...
...
@@ -6,7 +6,7 @@
<parent>
<groupId>
com.huigou
</groupId>
<artifactId>
root
</artifactId>
<version>
1.2.
5
</version>
<version>
1.2.
6
</version>
</parent>
<artifactId>
huigou-data
</artifactId>
<name>
huigou-data
</name>
...
...
huigou-data/src/main/java/com/huigou/data/query/QueryPermissionBuilderImpl.java
View file @
90193e5d
...
...
@@ -400,19 +400,12 @@ public class QueryPermissionBuilderImpl implements QueryPermissionBuilder {
private
List
<
DataManageResourceGroup
>
doQueryDataManagement
(
String
code
,
String
personId
)
{
QueryDescriptor
queryDescriptor
=
this
.
sqlExecutorDao
.
getQuery
(
DATA_MANAGEMENT_XML_FILE_PATH
,
"dataManagement"
);
// 查询包含的数据角色ID
String
sql
=
queryDescriptor
.
getSqlByName
(
"queryPersonDataManageDetailByCode"
);
List
<
String
>
managedetalIds
;
if
(!
"oracle"
.
equals
(
sqlDialect
))
{
String
sql
=
queryDescriptor
.
getSqlByName
(
"queryByManagetypeCodeAndPersonId"
);
managedetalIds
=
this
.
sqlExecutorDao
.
queryToList
(
sql
,
HashMap
.
class
,
code
,
personId
).
stream
()
.
collect
(
Collectors
.
groupingBy
(
m
->
m
.
get
(
"managetypeCode"
)))
.
values
()
.
stream
()
.
flatMap
(
ms
->
ms
.
stream
().
sorted
(
Comparator
.<
Map
,
String
>
comparing
(
m
->
(
String
)
m
.
get
(
"managerFullId"
)).
reversed
()).
limit
(
1
))
.
map
(
m
->
(
String
)
m
.
get
(
"dataManagedetalId"
))
.
collect
(
Collectors
.
toList
());
}
else
{
String
sql
=
queryDescriptor
.
getSqlByName
(
"queryPersonDataManageDetailByCode"
);
if
(
"oracle"
.
equals
(
sqlDialect
))
{
managedetalIds
=
this
.
sqlExecutorDao
.
queryToList
(
sql
,
String
.
class
,
code
,
personId
);
}
else
{
managedetalIds
=
this
.
sqlExecutorDao
.
queryToList
(
sql
,
String
.
class
,
code
,
personId
,
code
,
personId
);
}
if
(
managedetalIds
==
null
||
managedetalIds
.
size
()
==
0
)
{
return
Collections
.
emptyList
();
...
...
huigou-loader/pom.xml
View file @
90193e5d
...
...
@@ -5,7 +5,7 @@
<parent>
<groupId>
com.huigou
</groupId>
<artifactId>
root
</artifactId>
<version>
1.2.
5
</version>
<version>
1.2.
6
</version>
</parent>
<artifactId>
huigou-loader
</artifactId>
<packaging>
jar
</packaging>
...
...
huigou-system-common/pom.xml
View file @
90193e5d
...
...
@@ -5,7 +5,7 @@
<parent>
<groupId>
com.huigou
</groupId>
<artifactId>
root
</artifactId>
<version>
1.2.
5
</version>
<version>
1.2.
6
</version>
</parent>
<artifactId>
huigou-system-common
</artifactId>
...
...
huigou-uasp/pom.xml
View file @
90193e5d
...
...
@@ -4,7 +4,7 @@
<parent>
<groupId>
com.huigou
</groupId>
<artifactId>
root
</artifactId>
<version>
1.2.
5
</version>
<version>
1.2.
6
</version>
</parent>
<artifactId>
huigou-uasp
</artifactId>
<name>
huigou-uasp
</name>
...
...
@@ -348,7 +348,7 @@
<dependency>
<groupId>
com.topsunit
</groupId>
<artifactId>
query-spring
</artifactId>
<version>
1.2.
5
</version>
<version>
1.2.
6
</version>
</dependency>
</dependencies>
<build>
...
...
huigou-uasp/src/main/resources/config/uasp/query/bmp/dataManagement.xml
View file @
90193e5d
...
...
@@ -166,25 +166,6 @@
</query>
<query
name=
"dataManagement"
label=
"数据管理权限授权"
table=
"SA_OPDATAMANAGEMENT"
>
<sql
name=
"queryByManagetypeCodeAndPersonId"
>
select m.data_managedetal_id,
t.code managetype_code,
o.full_id manager_full_id
from sa_opdatamanagement m,
sa_opdatamanagetype t,
sa_oporg o,
sa_opperson s,
sa_oporg p
where m.data_manage_id = t.id
and m.manager_id = o.id
and p.person_id = s.id
and p.full_id like concat(o.full_id, '%')
and p.status = 1
and o.status = 1
and t.status = 1
and t.code = ?
and s.id = ?
</sql>
<!-- 根据权限类别编码及人员ID查询数据权限资源定义ID 查询最近的授权记录-->
<sql
name=
"queryPersonDataManageDetailByCode"
>
select distinct b.data_managedetal_id
...
...
huigou-uasp/src/main/resources/config/uasp/query/bmp/mysql/dataManagement.xml
View file @
90193e5d
...
...
@@ -2,6 +2,46 @@
<query-mappings>
<query
name=
"dataManagement"
label=
"数据管理权限授权"
table=
"SA_OPDATAMANAGEMENT"
>
<sql
name=
"queryPersonDataManageDetailByCode"
>
select distinct b.data_managedetal_id
from (select m.data_managedetal_id,
t.code,
o.full_id org_full_id
from sa_opdatamanagement m,
sa_opdatamanagetype t,
sa_oporg o,
sa_opperson s,
sa_oporg p
where m.data_manage_id = t.id
and m.manager_id = o.id
and p.person_id = s.id
and p.full_id like concat(o.full_id, '%')
and p.status = 1
and o.status = 1
and t.status = 1
and t.code = ?
and s.id = ?) b
left join (select m.data_managedetal_id,
t.code,
o.full_id org_full_id
from sa_opdatamanagement m,
sa_opdatamanagetype t,
sa_oporg o,
sa_opperson s,
sa_oporg p
where m.data_manage_id = t.id
and m.manager_id = o.id
and p.person_id = s.id
and p.full_id like concat(o.full_id, '%')
and p.status = 1
and o.status = 1
and t.status = 1
and t.code = ?
and s.id = ?) r
on b.data_managedetal_id=r.data_managedetal_id and b.code=r.code and strcmp(b.org_full_id,r.org_full_id)
<![CDATA[<=]]>
0
group by b.data_managedetal_id having count(*)=1
</sql>
<!-- 根据资源定义ID查询资源明细 -->
<sql
name=
"queryDataManageDetailResource"
>
select k.code as data_kind_code,
...
...
@@ -17,4 +57,107 @@
</sql>
</query>
<query
name=
"queryDataManagementByOrgFullId"
label=
"查询数据管理权限继承数据"
>
<sql-query>
select b.*
from (select t.id,
t.data_manage_id,
t.data_managedetal_id,
d.name,
p.code,
p.name as manage_name,
p.full_name,
p.full_id,
o.name as org_name,
o.full_name as org_full_name,
o.full_id as org_full_id
from sa_opdatamanagement t,
sa_opdatamanagedetail d,
sa_opdatamanagetype p,
sa_oporg o
where t.data_managedetal_id = d.id
and t.data_manage_id = p.id
and o.id = t.manager_id
and o.status = 1
and :orgFullId like concat(o.full_id, '%')) b
left join (select t.id,
t.data_manage_id,
t.data_managedetal_id,
d.name,
p.code,
p.name as manage_name,
p.full_name,
p.full_id,
o.name as org_name,
o.full_name as org_full_name,
o.full_id as org_full_id
from sa_opdatamanagement t,
sa_opdatamanagedetail d,
sa_opdatamanagetype p,
sa_oporg o
where t.data_managedetal_id = d.id
and t.data_manage_id = p.id
and o.id = t.manager_id
and o.status = 1
and :orgFullId like concat(o.full_id, '%')) r
on b.data_managedetal_id=r.data_managedetal_id and b.code=r.code and strcmp(b.org_full_id,r.org_full_id)
<![CDATA[<=]]>
0
group by b.data_managedetal_id having count(*)=1
</sql-query>
<condition
column=
"orgFullId"
name=
"orgFullId"
symbol=
"="
alias=
"b"
append=
"false"
/>
<condition
column=
"code"
name=
"code"
type=
"java.lang.String"
symbol=
"like"
alias=
"b"
>
(b.name like :code or b.code like :code)
</condition>
<condition
column=
"full_id"
name=
"fullId"
type=
"java.lang.String"
symbol=
"half_like"
alias=
"b"
/>
<condition
column=
"org_name"
name=
"orgName"
type=
"java.lang.String"
symbol=
"like"
alias=
"b"
/>
</query>
<query
name=
"queryDataManageResourceByOrgFullId"
label=
"查询数据管理权限数据"
>
<sql-query>
select t.id,
t.resource_key,
t.resource_value,
t.full_id,
t.full_name,
t.data_kind_id,
d.name,
p.code,
p.name as manage_name,
p.sequence,
d.id as detail_id
from sa_opdatamanagedetailresource t,
sa_opdatamanagedetail d,
sa_opdatamanagetype p
where t.data_managedetal_id in
(select b.data_managedetal_id
from (select t.data_managedetal_id,
p.code,
o.full_id org_full_id
from sa_opdatamanagement t,
sa_opdatamanagetype p,
sa_oporg o
where t.data_manage_id = p.id
and o.id = t.manager_id
and o.status = 1
and :orgFullId like concat(o.full_id, '%')) b
left join (select t.data_managedetal_id,
p.code,
o.full_id org_full_id
from sa_opdatamanagement t,
sa_opdatamanagetype p,
sa_oporg o
where t.data_manage_id = p.id
and o.id = t.manager_id
and o.status = 1
and :orgFullId like concat(o.full_id, '%')) r
on b.data_managedetal_id=r.data_managedetal_id and b.code=r.code and strcmp(b.org_full_id,r.org_full_id)
<![CDATA[<=]]>
0
group by b.data_managedetal_id having count(*)=1)
and t.data_managedetal_id = d.id
and d.data_manage_id = p.id
</sql-query>
<condition
column=
"orgFullId"
name=
"orgFullId"
symbol=
"="
alias=
"t"
append=
"false"
/>
<condition
column=
"NAME"
name=
"name"
type=
"java.lang.String"
symbol=
"like"
alias=
"d"
/>
<condition
column=
"code"
name=
"code"
type=
"java.lang.String"
symbol=
"like"
alias=
"p"
/>
<condition
column=
"resource_value"
name=
"resourceValue"
type=
"java.lang.String"
symbol=
"like"
alias=
"t"
/>
</query>
</query-mappings>
\ No newline at end of file
huigou-xt/pom.xml
View file @
90193e5d
...
...
@@ -4,7 +4,7 @@
<parent>
<groupId>
com.huigou
</groupId>
<artifactId>
root
</artifactId>
<version>
1.2.
5
</version>
<version>
1.2.
6
</version>
</parent>
<artifactId>
huigou-xt
</artifactId>
<name>
huigou-xt
</name>
...
...
pom.xml
View file @
90193e5d
...
...
@@ -6,7 +6,7 @@
<groupId>
com.huigou
</groupId>
<artifactId>
root
</artifactId>
<version>
1.2.
5
</version>
<version>
1.2.
6
</version>
<packaging>
pom
</packaging>
<modules>
...
...
@@ -158,7 +158,7 @@
<!-- test -->
<junit.version>
4.9
</junit.version>
<spring-data-mongodb.version>
1.9.3.RELEASE
</spring-data-mongodb.version>
<huigou.uasp.version>
1.2.
5
</huigou.uasp.version>
<huigou.uasp.version>
1.2.
6
</huigou.uasp.version>
<classgraph.version>
4.8.43
</classgraph.version>
<fastjson.version>
1.2.59
</fastjson.version>
</properties>
...
...
query-spring/pom.xml
View file @
90193e5d
...
...
@@ -7,7 +7,7 @@
<parent>
<groupId>
com.huigou
</groupId>
<artifactId>
root
</artifactId>
<version>
1.2.
5
</version>
<version>
1.2.
6
</version>
</parent>
<groupId>
com.topsunit
</groupId>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment