Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
T
traffic-front
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangxiaoming
traffic-front
Commits
f72fcce9
Commit
f72fcce9
authored
Jul 24, 2019
by
frank.xa.zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed role module -- frank
parent
a5aa64e4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
125 additions
and
1 deletion
+125
-1
RoleServiceImpl.java
...n/java/pwc/taxtech/atms/service/impl/RoleServiceImpl.java
+6
-1
RolePermissionExtendsMapper.xml
.../taxtech/atms/dao/extends/RolePermissionExtendsMapper.xml
+119
-0
No files found.
atms-api/src/main/java/pwc/taxtech/atms/service/impl/RoleServiceImpl.java
View file @
f72fcce9
...
@@ -19,10 +19,12 @@ import pwc.taxtech.atms.dto.role.*;
...
@@ -19,10 +19,12 @@ import pwc.taxtech.atms.dto.role.*;
import
pwc.taxtech.atms.dto.user.*
;
import
pwc.taxtech.atms.dto.user.*
;
import
pwc.taxtech.atms.entity.*
;
import
pwc.taxtech.atms.entity.*
;
import
pwc.taxtech.atms.entity.UserRoleExample.Criteria
;
import
pwc.taxtech.atms.entity.UserRoleExample.Criteria
;
import
pwc.taxtech.atms.organization.dao.OrganizationHKMapper
;
import
pwc.taxtech.atms.organization.dpo.UserRoleHKInfo
;
import
pwc.taxtech.atms.organization.dpo.UserRoleHKInfo
;
import
pwc.taxtech.atms.organization.entity.OrganizationHK
;
import
pwc.taxtech.atms.organization.entity.OrganizationHK
;
import
pwc.taxtech.atms.security.JwtAuthenticationService
;
import
pwc.taxtech.atms.security.JwtAuthenticationService
;
import
javax.annotation.Resource
;
import
java.util.*
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -806,6 +808,9 @@ public class RoleServiceImpl extends AbstractService {
...
@@ -806,6 +808,9 @@ public class RoleServiceImpl extends AbstractService {
return
one
;
return
one
;
}
}
@Resource
private
OrganizationHKMapper
organizationHKMapper
;
/*
/*
* (non-Javadoc)
* (non-Javadoc)
*
*
...
@@ -835,7 +840,7 @@ public class RoleServiceImpl extends AbstractService {
...
@@ -835,7 +840,7 @@ public class RoleServiceImpl extends AbstractService {
if
(
user
!=
null
)
{
if
(
user
!=
null
)
{
userRole
.
setUserName
(
user
.
getUserName
());
userRole
.
setUserName
(
user
.
getUserName
());
if
(
user
.
getOrganizationId
()
!=
null
&&
!
user
.
getOrganizationId
().
isEmpty
())
{
if
(
user
.
getOrganizationId
()
!=
null
&&
!
user
.
getOrganizationId
().
isEmpty
())
{
Organization
organization
=
organizationMapper
.
selectByPrimaryKey
(
user
.
getOrganizationId
(
));
Organization
HK
organization
=
organizationHKMapper
.
selectByPrimaryKey
(
Long
.
valueOf
(
user
.
getOrganizationId
()
));
userRole
.
setOrgId
(
user
.
getOrganizationId
());
userRole
.
setOrgId
(
user
.
getOrganizationId
());
userRole
.
setOrgName
(
organization
==
null
?
""
:
organization
.
getName
());
userRole
.
setOrgName
(
organization
==
null
?
""
:
organization
.
getName
());
}
}
...
...
atms-dao/src/main/resources/pwc/taxtech/atms/dao/extends/RolePermissionExtendsMapper.xml
0 → 100644
View file @
f72fcce9
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"pwc.taxtech.atms.dao.RolePermissionMapper"
>
<select
id=
"selectByRoleId"
parameterType=
"java.lang.String"
resultMap=
"BaseResultMap"
>
SELECT
<include
refid=
"Base_Column_List"
/>
FROM
role_permission
WHERE
role_id = #{roleId,jdbcType=VARCHAR}
</select>
<resultMap
extends=
"BaseResultMap"
id=
"ResultMapWithAssociation"
type=
"pwc.taxtech.atms.entity.RolePermission"
>
<association
column=
"ROLE_ID"
javaType=
"pwc.taxtech.atms.entity.Role"
property=
"role"
>
<id
column=
"ROLE_ID"
property=
"id"
/>
<result
column=
"ROLE_NAME"
property=
"name"
/>
<result
column=
"ROLE_DESCRIPTION"
property=
"description"
/>
<result
column=
"ROLE_CATEGORY_ID"
property=
"roleCategoryId"
/>
<result
column=
"ROLE_SERVICE_TYPE"
property=
"serviceTypeId"
/>
<result
column=
"ROLE_CREATE_TIME"
property=
"createTime"
/>
<result
column=
"ROLE_UPDATE_TIME"
property=
"updateTime"
/>
</association>
<association
column=
"PERMISSION_ID"
javaType=
"pwc.taxtech.atms.entity.Permission"
property=
"permission"
>
<id
column=
"PERMISSION_ID"
property=
"id"
/>
<result
column=
"PERMISSION_NAME"
property=
"name"
/>
<result
column=
"PERMISSION_CODE"
property=
"code"
/>
<result
column=
"PERMISSION_PARENT_ID"
property=
"parentId"
/>
<result
column=
"PERMISSION_IS_ACTIVE"
property=
"isActive"
/>
<result
column=
"PERMISSION_P_LEVEL"
property=
"pLevel"
/>
<result
column=
"PERMISSION_RELY_ON_CODES"
property=
"relyOnCodes"
/>
<result
column=
"PERMISSION_MENU_ID"
property=
"menuId"
/>
<result
column=
"PERMISSION_SERVICE_TYPE_ID"
property=
"serviceTypeId"
/>
<result
column=
"PERMISSION_CREATE_TIME"
property=
"createTime"
/>
<result
column=
"PERMISSION_UPDATE_TIME"
property=
"updateTime"
/>
</association>
</resultMap>
<select
id=
"selectByRoleAndServiceTypeWithAssociation"
resultMap=
"ResultMapWithAssociation"
>
SELECT
rp.id AS ID,
rp.role_id AS ROLE_ID,
rp.permission_id AS PERMISSION_ID,
r.id AS ROLE_ID,
r.name AS ROLE_NAME,
r.description AS ROLE_DESCRIPTION,
r.role_category_id AS ROLE_CATEGORY_ID,
r.service_type_id AS ROLE_SERVICE_TYPE,
r.create_time AS ROLE_CREATE_TIME,
r.update_time AS ROLE_UPDATE_TIME,
p.id AS PERMISSION_ID,
p.name AS PERMISSION_NAME,
p.code AS PERMISSION_CODE,
p.parent_id AS PERMISSION_PARENT_ID,
p.is_active AS PERMISSION_IS_ACTIVE,
p.p_level AS PERMISSION_P_LEVEL,
p.rely_on_codes AS PERMISSION_RELY_ON_CODES,
p.menu_id AS PERMISSION_MENU_ID,
p.service_type_id AS PERMISSION_SERVICE_TYPE_ID,
p.create_time AS PERMISSION_CREATE_TIME,
p.update_time AS PERMISSION_UPDATE_TIME
FROM
role_permission rp
JOIN
role r
on
r.id = rp.role_id
JOIN
permission p
on
p.id = rp.permission_id
where
rp.role_id= #{roleId,jdbcType=VARCHAR}
AND r.service_type_id= #{serviceTypeId,jdbcType=VARCHAR}
</select>
<select
id=
"selectByRoleListAndServiceTypeWithAssociation"
resultMap=
"ResultMapWithAssociation"
>
SELECT
rp.id AS ID,
rp.role_id as ROLE_ID,
rp.permission_id as PERMISSION_ID,
r.id AS ROLE_ID,
r.name AS ROLE_NAME,
r.description AS ROLE_DESCRIPTION,
r.role_category_id AS ROLE_CATEGORY_ID,
r.service_type_id AS ROLE_SERVICE_TYPE,
r.create_time AS ROLE_CREATE_TIME,
r.update_time AS ROLE_UPDATE_TIME,
p.id AS PERMISSION_ID,
p.name AS PERMISSION_NAME,
p.code AS PERMISSION_CODE,
p.parent_id AS PERMISSION_PARENT_ID,
p.is_active AS PERMISSION_IS_ACTIVE,
p.p_level AS PERMISSION_P_LEVEL,
p.rely_on_codes AS PERMISSION_RELY_ON_CODES,
p.menu_id AS PERMISSION_MENU_ID,
p.service_type_id AS PERMISSION_SERVICE_TYPE_ID,
p.create_time AS PERMISSION_CREATE_TIME,
p.update_time AS PERMISSION_UPDATE_TIME
FROM
role_permission rp
JOIN
role r
on
r.id = rp.role_id
JOIN
permission p
on
p.id = rp.permission_id
where
r.service_type_id= #{serviceTypeId,jdbcType=VARCHAR}
AND rp.role_id in
<foreach
close=
")"
collection=
"roleList"
index=
"index"
item=
"roleID"
open=
"("
separator=
","
>
#{roleID}
</foreach>
</select>
</mapper>
\ No newline at end of file
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