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
6c2fad8b
Commit
6c2fad8b
authored
Oct 09, 2018
by
neo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[DEL] delete role service interface
parent
2778073a
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
54 additions
and
248 deletions
+54
-248
RoleController.java
...main/java/pwc/taxtech/atms/controller/RoleController.java
+49
-29
UserController.java
...main/java/pwc/taxtech/atms/controller/UserController.java
+2
-2
RoleService.java
...i/src/main/java/pwc/taxtech/atms/service/RoleService.java
+0
-182
OrganizationServiceImpl.java
...wc/taxtech/atms/service/impl/OrganizationServiceImpl.java
+1
-2
RoleServiceImpl.java
...n/java/pwc/taxtech/atms/service/impl/RoleServiceImpl.java
+1
-31
UserServiceImpl.java
...n/java/pwc/taxtech/atms/service/impl/UserServiceImpl.java
+1
-2
No files found.
atms-api/src/main/java/pwc/taxtech/atms/controller/RoleController.java
View file @
6c2fad8b
package
pwc
.
taxtech
.
atms
.
controller
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
io.swagger.annotations.ApiOperation
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -13,8 +10,6 @@ import org.springframework.web.bind.annotation.RequestMethod;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.RestController
;
import
io.swagger.annotations.ApiOperation
;
import
pwc.taxtech.atms.dpo.UserRoleInfo
;
import
pwc.taxtech.atms.dto.OperationResultDto
;
import
pwc.taxtech.atms.dto.dimension.DimensionValueUpdateDto
;
...
...
@@ -29,9 +24,15 @@ import pwc.taxtech.atms.dto.user.DimensionUser;
import
pwc.taxtech.atms.dto.user.UserRoleDimensionValueDto
;
import
pwc.taxtech.atms.dto.user.UserRoleDto
;
import
pwc.taxtech.atms.dto.user.UserRoleUpdateDto
;
import
pwc.taxtech.atms.service.RoleService
;
import
pwc.taxtech.atms.service.impl.RoleServiceImpl
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/** @see PwC.Tax.Tech.Atms.WebApi\Controllers\RoleController.cs */
/**
* @see PwC.Tax.Tech.Atms.WebApi\Controllers\RoleController.cs
*/
@RestController
@RequestMapping
(
"/api/v1/role/"
)
public
class
RoleController
{
...
...
@@ -39,32 +40,36 @@ public class RoleController {
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
RoleController
.
class
);
@Autowired
private
RoleService
roleService
;
private
RoleService
Impl
roleService
;
@ApiOperation
(
value
=
"获取用户树形列表"
,
notes
=
"返回所有用户的树形列表"
)
@RequestMapping
(
value
=
"getRoleTreeList"
,
method
=
RequestMethod
.
GET
)
public
@ResponseBody
List
<
NavTreeDto
>
getRoleTreeList
()
{
public
@ResponseBody
List
<
NavTreeDto
>
getRoleTreeList
()
{
logger
.
debug
(
"RoleController getRoleTreeList"
);
return
roleService
.
getRoleTreeList
();
}
@ApiOperation
(
value
=
"获取所有用户角色"
,
notes
=
"返回所有用户的角色"
)
@RequestMapping
(
value
=
"getAllOwnUserRoleList"
,
method
=
RequestMethod
.
GET
)
public
@ResponseBody
List
<
UserRoleInfo
>
getAllOwnUserRoleList
()
{
public
@ResponseBody
List
<
UserRoleInfo
>
getAllOwnUserRoleList
()
{
logger
.
debug
(
"RoleController getAllOwnUserRoleList"
);
return
roleService
.
getAllOwnUserRoleList
();
}
@ApiOperation
(
value
=
"获取可访问的所有机构"
,
notes
=
"返回可访问的所有机构"
)
@RequestMapping
(
value
=
"getAllUserRoleList"
,
method
=
RequestMethod
.
GET
)
public
@ResponseBody
List
<
UserRoleInfo
>
getAllUserRoleList
()
{
public
@ResponseBody
List
<
UserRoleInfo
>
getAllUserRoleList
()
{
logger
.
debug
(
"RoleController getAllUserRoleList"
);
return
roleService
.
getAllUserRoleList
();
}
@ApiOperation
(
value
=
"通过传入的用户Id获取该用户的所有角色"
)
@RequestMapping
(
value
=
"getAllRoleListByUserID"
,
method
=
RequestMethod
.
GET
)
public
@ResponseBody
List
<
UserRoleDto
>
getAllRoleListByUserId
(
@RequestParam
(
"userID"
)
String
userId
,
public
@ResponseBody
List
<
UserRoleDto
>
getAllRoleListByUserId
(
@RequestParam
(
"userID"
)
String
userId
,
@RequestParam
(
"serviceTypeID"
)
String
serviceTypeId
)
{
logger
.
debug
(
"RoleController getAllRoleListByUserId"
);
return
roleService
.
getAllRoleListByUserId
(
userId
,
serviceTypeId
);
...
...
@@ -72,26 +77,30 @@ public class RoleController {
@ApiOperation
(
value
=
"获取所有角色"
)
@RequestMapping
(
value
=
"displayByServiceGroup"
,
method
=
RequestMethod
.
GET
)
public
@ResponseBody
List
<
RoleDtoTree
>
getRoleList
()
{
public
@ResponseBody
List
<
RoleDtoTree
>
getRoleList
()
{
logger
.
debug
(
"RoleController getRoleList"
);
return
roleService
.
getRoleList
();
}
@ApiOperation
(
value
=
"获取角色下用户列表"
)
@RequestMapping
(
value
=
"getUsersByRoleID"
,
method
=
RequestMethod
.
GET
)
public
@ResponseBody
List
<
UserRoleDto
>
getUsersByRoleId
(
@RequestParam
(
"roleId"
)
String
roleId
)
{
public
@ResponseBody
List
<
UserRoleDto
>
getUsersByRoleId
(
@RequestParam
(
"roleId"
)
String
roleId
)
{
return
roleService
.
getUsersByRoleId
(
roleId
);
}
@ApiOperation
(
value
=
"获取角色下额外用户列表"
)
@RequestMapping
(
value
=
"getExtraUsersByRoleID"
,
method
=
RequestMethod
.
GET
)
public
@ResponseBody
List
<
UserRoleDto
>
getExtraUsersByRoleId
(
@RequestParam
(
"roleId"
)
String
roleId
)
{
public
@ResponseBody
List
<
UserRoleDto
>
getExtraUsersByRoleId
(
@RequestParam
(
"roleId"
)
String
roleId
)
{
return
roleService
.
getExtraUsersByRoleId
(
roleId
);
}
@ApiOperation
(
value
=
"删除角色下用户"
)
@RequestMapping
(
value
=
"removeUserRole"
,
method
=
RequestMethod
.
POST
)
public
@ResponseBody
Boolean
removeUserRole
(
@RequestParam
(
"userID"
)
String
userId
,
public
@ResponseBody
Boolean
removeUserRole
(
@RequestParam
(
"userID"
)
String
userId
,
@RequestBody
List
<
String
>
roleIdList
,
@RequestParam
(
"serviceTypeID"
)
String
serviceTypeId
)
{
roleService
.
removeUserRole
(
userId
,
roleIdList
,
serviceTypeId
);
return
true
;
...
...
@@ -99,13 +108,15 @@ public class RoleController {
@ApiOperation
(
value
=
"Get role list by role type"
)
@RequestMapping
(
value
=
"displayByRoleType"
,
method
=
RequestMethod
.
GET
)
public
@ResponseBody
List
<
RoleDto
>
getRoleListByRoleType
(
@RequestParam
(
"roleTypeId"
)
String
roleTypeId
)
{
public
@ResponseBody
List
<
RoleDto
>
getRoleListByRoleType
(
@RequestParam
(
"roleTypeId"
)
String
roleTypeId
)
{
return
roleService
.
getRoleListByRoleType
(
roleTypeId
);
}
@ApiOperation
(
value
=
"增加角色分类"
)
@RequestMapping
(
value
=
"addRoleCategory"
,
method
=
RequestMethod
.
GET
)
public
@ResponseBody
Boolean
addRoleCategory
(
@RequestParam
(
"name"
)
String
roleCategoryName
,
public
@ResponseBody
Boolean
addRoleCategory
(
@RequestParam
(
"name"
)
String
roleCategoryName
,
@RequestParam
(
"roleCategoryID"
)
String
roleCategoryId
)
{
roleService
.
addRoleCategory
(
roleCategoryName
,
roleCategoryId
);
return
true
;
...
...
@@ -113,7 +124,8 @@ public class RoleController {
@ApiOperation
(
value
=
"更新角色分类名称"
)
@RequestMapping
(
value
=
"updateRoleCategory"
,
method
=
RequestMethod
.
GET
)
public
@ResponseBody
Boolean
updateRoleCategory
(
@RequestParam
(
"updateName"
)
String
roleCategoryName
,
public
@ResponseBody
Boolean
updateRoleCategory
(
@RequestParam
(
"updateName"
)
String
roleCategoryName
,
@RequestParam
(
"id"
)
String
roleCategoryId
)
{
roleService
.
updateRoleCategory
(
roleCategoryName
,
roleCategoryId
);
return
true
;
...
...
@@ -122,14 +134,16 @@ public class RoleController {
@SuppressWarnings
(
"rawtypes"
)
@ApiOperation
(
value
=
"删除角色分类"
)
@RequestMapping
(
value
=
"deleteRoleCategory"
,
method
=
RequestMethod
.
GET
)
public
@ResponseBody
OperationResultDto
deleteRoleCategory
(
@RequestParam
(
"id"
)
String
roleCategoryId
)
{
public
@ResponseBody
OperationResultDto
deleteRoleCategory
(
@RequestParam
(
"id"
)
String
roleCategoryId
)
{
return
roleService
.
deleteRoleCategory
(
roleCategoryId
);
}
@SuppressWarnings
({
"unchecked"
,
"rawtypes"
})
@SuppressWarnings
({
"unchecked"
,
"rawtypes"
})
@ApiOperation
(
value
=
"Add a role info"
)
@RequestMapping
(
value
=
"add"
,
method
=
RequestMethod
.
POST
)
public
@ResponseBody
Map
addRole
(
@RequestBody
RoleDisplayDto
roleDisplayDto
)
{
public
@ResponseBody
Map
addRole
(
@RequestBody
RoleDisplayDto
roleDisplayDto
)
{
Map
result
=
new
HashMap
<>();
if
(
"-1"
.
equals
(
roleService
.
addRole
(
roleDisplayDto
)))
{
...
...
@@ -164,7 +178,8 @@ public class RoleController {
@ApiOperation
(
value
=
"Delete a role info"
)
@RequestMapping
(
value
=
"delete"
,
method
=
RequestMethod
.
POST
)
public
@ResponseBody
List
<
RoleDtoTree
>
deleteRole
(
@RequestBody
RoleDto
roleDto
)
{
public
@ResponseBody
List
<
RoleDtoTree
>
deleteRole
(
@RequestBody
RoleDto
roleDto
)
{
roleService
.
deleteRole
(
roleDto
);
return
roleService
.
getRoleList
();
...
...
@@ -172,7 +187,8 @@ public class RoleController {
@ApiOperation
(
value
=
"Get user role list by organizationId, dimensionId and dimensionValueId"
)
@RequestMapping
(
value
=
"getUserRoleList"
,
method
=
RequestMethod
.
GET
)
public
@ResponseBody
List
<
UserRoleInfo
>
getUserRoleList
(
@RequestParam
(
"organizationID"
)
String
organizationId
,
public
@ResponseBody
List
<
UserRoleInfo
>
getUserRoleList
(
@RequestParam
(
"organizationID"
)
String
organizationId
,
@RequestParam
(
"dimensionID"
)
String
dimensionId
,
@RequestParam
(
"dimensionValueID"
)
String
dimensionValueId
)
{
...
...
@@ -185,7 +201,8 @@ public class RoleController {
@ApiOperation
(
value
=
"Get all role permission list by serviceType"
)
@RequestMapping
(
value
=
"getAllRolePermission"
,
method
=
RequestMethod
.
GET
)
public
@ResponseBody
List
<
RolePermissionDto
>
getAllRolePermission
(
public
@ResponseBody
List
<
RolePermissionDto
>
getAllRolePermission
(
@RequestParam
(
"serviceTypeID"
)
String
serviceTypeId
)
{
return
roleService
.
getAllRolePermission
(
serviceTypeId
);
...
...
@@ -217,21 +234,24 @@ public class RoleController {
@ApiOperation
(
value
=
"获取维度,角色,用户列表"
,
notes
=
"机构/卡片/机构卡片/点击用户数"
)
@RequestMapping
(
value
=
"getDimensionRoleUserList"
,
method
=
RequestMethod
.
GET
)
public
@ResponseBody
List
<
DimensionRole
>
getDimensionRoleUserList
(
@RequestParam
(
"dimensionId"
)
String
dimensionId
,
public
@ResponseBody
List
<
DimensionRole
>
getDimensionRoleUserList
(
@RequestParam
(
"dimensionId"
)
String
dimensionId
,
@RequestParam
(
"dimensionValueId"
)
String
dimensionValueId
)
{
return
roleService
.
getDimensionRoleUserList
(
dimensionId
,
dimensionValueId
);
}
@ApiOperation
(
value
=
"获取某一个维度的 用户 和 机构列表,角色列表"
,
notes
=
"机构/卡片/机构卡片/点击用户数"
)
@RequestMapping
(
value
=
"getDimensionUserRoleList"
,
method
=
RequestMethod
.
GET
)
public
@ResponseBody
List
<
DimensionUser
>
getDimensionUserRoleList
(
@RequestParam
(
"dimensionId"
)
String
dimensionId
,
public
@ResponseBody
List
<
DimensionUser
>
getDimensionUserRoleList
(
@RequestParam
(
"dimensionId"
)
String
dimensionId
,
@RequestParam
(
"dimensionValueId"
)
String
dimensionValueId
)
{
return
roleService
.
getDimensionUserRoleList
(
dimensionId
,
dimensionValueId
);
}
@ApiOperation
(
value
=
"根据区域Id,获取区域用户角色信息"
,
notes
=
"机构/卡片/区域卡片/选择区域/点击用户数"
)
@RequestMapping
(
value
=
"getActiveUserRoleListByAreaId"
,
method
=
RequestMethod
.
GET
)
public
@ResponseBody
List
<
UserRoleInfo
>
getActiveUserRoleListByAreaId
(
@RequestParam
(
"areaId"
)
String
areaId
)
{
public
@ResponseBody
List
<
UserRoleInfo
>
getActiveUserRoleListByAreaId
(
@RequestParam
(
"areaId"
)
String
areaId
)
{
return
roleService
.
getActiveUserRoleListByAreaId
(
areaId
);
}
}
atms-api/src/main/java/pwc/taxtech/atms/controller/UserController.java
View file @
6c2fad8b
...
...
@@ -28,7 +28,7 @@ import pwc.taxtech.atms.dto.user.UserRoleDimensionValueDto;
import
pwc.taxtech.atms.dto.user.UserRoleDisplayInfo
;
import
pwc.taxtech.atms.dto.user.UserRoleSaveDto
;
import
pwc.taxtech.atms.entity.User
;
import
pwc.taxtech.atms.service.
RoleService
;
import
pwc.taxtech.atms.service.
impl.RoleServiceImpl
;
import
pwc.taxtech.atms.service.impl.UserAccountServiceImpl
;
import
pwc.taxtech.atms.service.impl.UserRoleServiceImpl
;
import
pwc.taxtech.atms.service.impl.UserServiceImpl
;
...
...
@@ -44,7 +44,7 @@ public class UserController {
@Autowired
private
UserRoleServiceImpl
userRoleService
;
@Autowired
private
RoleService
roleService
;
private
RoleService
Impl
roleService
;
@Autowired
private
UserAccountServiceImpl
userAccountService
;
...
...
atms-api/src/main/java/pwc/taxtech/atms/service/RoleService.java
deleted
100644 → 0
View file @
2778073a
package
pwc
.
taxtech
.
atms
.
service
;
import
java.util.List
;
import
java.util.Map
;
import
pwc.taxtech.atms.dpo.UserOrgRoleDto
;
import
pwc.taxtech.atms.dpo.UserRoleInfo
;
import
pwc.taxtech.atms.dpo.DimensionValueOrgDto
;
import
pwc.taxtech.atms.dto.OperationResultDto
;
import
pwc.taxtech.atms.dto.dimension.DimensionValueUpdateDto
;
import
pwc.taxtech.atms.dto.navtree.NavTreeDto
;
import
pwc.taxtech.atms.dpo.OrganizationDto
;
import
pwc.taxtech.atms.dto.role.RoleDisplayDto
;
import
pwc.taxtech.atms.dto.role.RoleDto
;
import
pwc.taxtech.atms.dto.role.RoleDtoTree
;
import
pwc.taxtech.atms.dto.role.RolePermissionDto
;
import
pwc.taxtech.atms.dto.role.UpdateRoleInfo
;
import
pwc.taxtech.atms.dto.user.DimensionRole
;
import
pwc.taxtech.atms.dto.user.DimensionUser
;
import
pwc.taxtech.atms.dpo.UserOrgDto
;
import
pwc.taxtech.atms.dto.user.UserRoleDimensionValueDto
;
import
pwc.taxtech.atms.dto.user.UserRoleDto
;
import
pwc.taxtech.atms.dto.user.UserRoleUpdateDto
;
import
pwc.taxtech.atms.dto.user.VMUser
;
import
pwc.taxtech.atms.entity.UserDimensionValue
;
import
pwc.taxtech.atms.entity.UserDimensionValueOrg
;
import
pwc.taxtech.atms.entity.UserOrganization
;
public
interface
RoleService
{
List
<
NavTreeDto
>
getRoleTreeList
();
List
<
UserRoleInfo
>
getUserRoleByUser
(
VMUser
vmUser
);
List
<
UserRoleInfo
>
getAllOwnUserRoleList
();
List
<
UserRoleInfo
>
getAllUserRoleList
();
List
<
UserRoleDto
>
getAllRoleListByUserId
(
String
userId
,
String
serviceTypeId
);
List
<
UserOrgDto
>
getUserByDimensionValue
(
List
<
OrganizationDto
>
orgList
,
List
<
UserDimensionValue
>
userDimensionValueList
,
List
<
UserDimensionValueOrg
>
userDimensionValueOrgList
,
List
<
UserOrganization
>
userOrganizationList
,
List
<
UserOrgRoleDto
>
originalRoleList
,
List
<
UserOrgRoleDto
>
userDimensionValueRoleList
,
List
<
UserOrgRoleDto
>
userOrganizationRoleList
,
String
dimensionId
,
String
dimensionValueId
);
List
<
RoleDtoTree
>
getRoleList
();
List
<
UserRoleDto
>
getUsersByRoleId
(
String
roleId
);
/**
* 查询某角色额外用户
* @param roleId
* @return
*/
List
<
UserRoleDto
>
getExtraUsersByRoleId
(
String
roleId
);
/**
* 为角色添加用户
* @param roleId
* @param serviceTypeId
* @param userIdList
*/
void
addUsersToRole
(
String
roleId
,
String
serviceTypeId
,
List
<
String
>
userIdList
);
void
removeUserRole
(
String
userId
,
List
<
String
>
roleIdList
,
String
serviceTypeId
);
/**
* Get role list by roleTypeId
* @param roleTypeId
* @return List<RoleDto>
*/
List
<
RoleDto
>
getRoleListByRoleType
(
String
roleTypeId
);
/**
* 增加角色分类
* @param roleCategoryName
* @param roleCategoryId
*/
void
addRoleCategory
(
String
roleCategoryName
,
String
roleCategoryId
);
/**
* 更新角色分类名称
* @param roleCategoryName
* @param roleCategoryId
*/
void
updateRoleCategory
(
String
roleCategoryName
,
String
roleCategoryId
);
/**
* 删除角色分类
* @param roleCategoryId
* @return OperationResultDto
*/
@SuppressWarnings
(
"rawtypes"
)
OperationResultDto
deleteRoleCategory
(
String
roleCategoryId
);
/**
* Add a new role info
* @param RoleDisplayDto roleDto
* @return roleId
*/
String
addRole
(
RoleDisplayDto
roleDto
);
/**
* Update a role info
* @param updateRole
* @param roleId
*/
void
updateRole
(
UpdateRoleInfo
updateRole
,
String
roleId
);
/**
* validate if the rolename exists
* @param roleName
* @param oldRoleName
* @return true - not exist; false - exist
*/
boolean
validateRoleNameUnique
(
String
roleName
,
String
oldRoleName
);
/**
* Delete a role info
* @param roleDto
*/
void
deleteRole
(
RoleDto
roleDto
);
/**
* check mapping between user and role
* @param roleId
* @return
*/
boolean
checkUserRole
(
String
roleId
);
/**
* @param model
* @return
*/
List
<
UserRoleInfo
>
getUserRoleList
(
UserRoleDimensionValueDto
userRoleDimensionValueDto
);
/**
* 根据serviceType获取所有角色权限list
* @param serviceTypeId
* @return List<RolePermissionDto>
*/
List
<
RolePermissionDto
>
getAllRolePermission
(
String
serviceTypeId
);
/**
* 更新用户角色列表
* @param userRoleUpdateDto
*/
void
updateUserRole
(
UserRoleUpdateDto
userRoleUpdateDto
);
/**
* 用户详情页面,增加范围
* @param dimensionValueUpdateDto
*/
void
updateDimensionValues
(
DimensionValueUpdateDto
dimensionValueUpdateDto
);
/**
* 用户详情页面, 增加机构
* @param orgIdList
* @param userId
*/
void
updateUserOrg
(
List
<
String
>
orgIdList
,
String
userId
);
/**
* 获取维度,角色,用户列表
* @param dimensionId
* @param dimensionValueId
*/
List
<
DimensionRole
>
getDimensionRoleUserList
(
String
dimensionId
,
String
dimensionValueId
);
/**
* 获取某一个维度的 用户 和 机构列表,角色列表
* @param dimensionId
* @param dimensionValueId
*/
List
<
DimensionUser
>
getDimensionUserRoleList
(
String
dimensionId
,
String
dimensionValueId
);
Map
<
String
,
Integer
>
getActiveUserRoleList
(
List
<
OrganizationDto
>
orgDtoList
,
List
<
DimensionValueOrgDto
>
dimensionValueOrgList
,
String
areaid
);
List
<
UserRoleInfo
>
getActiveUserRoleListByAreaId
(
String
areaId
);
}
atms-api/src/main/java/pwc/taxtech/atms/service/impl/OrganizationServiceImpl.java
View file @
6c2fad8b
...
...
@@ -60,7 +60,6 @@ import pwc.taxtech.atms.service.CommonService;
import
pwc.taxtech.atms.service.DimensionService
;
import
pwc.taxtech.atms.service.OperationLogService
;
import
pwc.taxtech.atms.service.OrganizationService
;
import
pwc.taxtech.atms.service.RoleService
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
...
...
@@ -106,7 +105,7 @@ public class OrganizationServiceImpl implements OrganizationService {
private
CommonService
commonService
;
@Autowired
private
RoleService
roleService
;
private
RoleService
Impl
roleService
;
@Autowired
private
BusinessUnitMapper
businessUnitMapper
;
...
...
atms-api/src/main/java/pwc/taxtech/atms/service/impl/RoleServiceImpl.java
View file @
6c2fad8b
...
...
@@ -39,7 +39,6 @@ import pwc.taxtech.atms.dto.user.*;
import
pwc.taxtech.atms.entity.*
;
import
pwc.taxtech.atms.entity.UserRoleExample.Criteria
;
import
pwc.taxtech.atms.service.OrganizationService
;
import
pwc.taxtech.atms.service.RoleService
;
import
java.util.ArrayList
;
import
java.util.Date
;
...
...
@@ -55,7 +54,7 @@ import java.util.stream.Collectors;
import
static
java
.
util
.
stream
.
Collectors
.
toList
;
@Service
public
class
RoleServiceImpl
extends
AbstractService
implements
RoleService
{
public
class
RoleServiceImpl
extends
AbstractService
{
@Autowired
private
UserServiceImpl
userService
;
...
...
@@ -66,7 +65,6 @@ public class RoleServiceImpl extends AbstractService implements RoleService {
@Autowired
private
OrganizationService
organizationService
;
@Override
public
List
<
NavTreeDto
>
getRoleTreeList
()
{
logger
.
debug
(
"RoleServiceImpl getRoleTreeList"
);
RoleCategoryExample
roleCategoryExample
=
new
RoleCategoryExample
();
...
...
@@ -99,7 +97,6 @@ public class RoleServiceImpl extends AbstractService implements RoleService {
return
retList
;
}
@Override
public
List
<
UserRoleInfo
>
getUserRoleByUser
(
VMUser
vmUser
)
{
List
<
VMUser
>
list
=
new
ArrayList
<>();
list
.
add
(
vmUser
);
...
...
@@ -534,7 +531,6 @@ public class RoleServiceImpl extends AbstractService implements RoleService {
return
retList
;
}
@Override
public
List
<
UserRoleInfo
>
getAllOwnUserRoleList
()
{
logger
.
debug
(
"Start to get all own user roles"
);
List
<
User
>
userList
=
userService
.
findAllUsers
();
...
...
@@ -590,7 +586,6 @@ public class RoleServiceImpl extends AbstractService implements RoleService {
return
retList
;
}
@Override
public
List
<
UserRoleInfo
>
getAllUserRoleList
()
{
List
<
VMUser
>
userList
=
userService
.
findAllUsers
().
stream
().
map
(
this
::
rotateUserToVMUser
)
.
collect
(
Collectors
.
toList
());
...
...
@@ -603,7 +598,6 @@ public class RoleServiceImpl extends AbstractService implements RoleService {
return
vmUser
;
}
@Override
public
List
<
UserRoleDto
>
getAllRoleListByUserId
(
String
userId
,
String
serviceTypeId
)
{
UserRoleExample
userRoleExample
=
new
UserRoleExample
();
Criteria
criteria
=
userRoleExample
.
createCriteria
();
...
...
@@ -639,7 +633,6 @@ public class RoleServiceImpl extends AbstractService implements RoleService {
/**
* 事业部,获取用户数统计,包括维度上的和机构上的(统计可访问,不管有无角色)
*/
@Override
public
List
<
UserOrgDto
>
getUserByDimensionValue
(
List
<
OrganizationDto
>
orgList
,
List
<
UserDimensionValue
>
userDimensionValueList
,
List
<
UserDimensionValueOrg
>
userDimensionValueOrgList
,
List
<
UserOrganization
>
userOrganizationList
,
List
<
UserOrgRoleDto
>
originalRoleList
,
...
...
@@ -769,7 +762,6 @@ public class RoleServiceImpl extends AbstractService implements RoleService {
return
userOrgDtoList
;
}
@Override
public
List
<
RoleDtoTree
>
getRoleList
()
{
Integer
serviceType
=
ServiceTypeEnum
.
VAT
.
value
();
...
...
@@ -822,7 +814,6 @@ public class RoleServiceImpl extends AbstractService implements RoleService {
*
* @see pwc.taxtech.atms.service.RoleService#getUsersByRoleId(java.lang.String)
*/
@Override
public
List
<
UserRoleDto
>
getUsersByRoleId
(
String
roleId
)
{
ServiceTypeEnum
serviceType
=
ServiceTypeEnum
.
VAT
;
...
...
@@ -858,7 +849,6 @@ public class RoleServiceImpl extends AbstractService implements RoleService {
return
userList
;
}
@Override
public
Map
<
String
,
Integer
>
getActiveUserRoleList
(
List
<
OrganizationDto
>
orgList
,
List
<
DimensionValueOrgDto
>
dimensionValueOrgList
,
String
dimensionId
)
{
UserExample
userExample
=
new
UserExample
();
...
...
@@ -932,7 +922,6 @@ public class RoleServiceImpl extends AbstractService implements RoleService {
* @see
* pwc.taxtech.atms.service.RoleService#getExtraUsersByRoleId(java.lang.String)
*/
@Override
public
List
<
UserRoleDto
>
getExtraUsersByRoleId
(
String
roleId
)
{
List
<
String
>
userRoleDimension
=
userDimensionValueRoleMapper
.
getUserIdByUserDimensionValueRole
(
roleId
);
...
...
@@ -976,7 +965,6 @@ public class RoleServiceImpl extends AbstractService implements RoleService {
* pwc.taxtech.atms.service.UserRoleService#addUsersToRole(java.lang.String,
* java.lang.String, java.util.List)
*/
@Override
public
void
addUsersToRole
(
String
roleId
,
String
serviceTypeId
,
List
<
String
>
userIdList
)
{
Role
role
=
roleMapper
.
selectByPrimaryKey
(
roleId
);
...
...
@@ -1018,7 +1006,6 @@ public class RoleServiceImpl extends AbstractService implements RoleService {
* @see pwc.taxtech.atms.service.RoleService#removeUserRole(java.lang.String,
* java.util.List, java.lang.String)
*/
@Override
public
void
removeUserRole
(
String
userId
,
List
<
String
>
roleIdList
,
String
serviceTypeId
)
{
UserRoleExample
example
=
new
UserRoleExample
();
...
...
@@ -1050,7 +1037,6 @@ public class RoleServiceImpl extends AbstractService implements RoleService {
*
* @see pwc.taxtech.atms.service.RoleService#getRoleListByRoleType(int)
*/
@Override
public
List
<
RoleDto
>
getRoleListByRoleType
(
String
roleTypeId
)
{
RoleExample
example
=
new
RoleExample
();
...
...
@@ -1073,7 +1059,6 @@ public class RoleServiceImpl extends AbstractService implements RoleService {
* @see pwc.taxtech.atms.service.RoleService#addRoleCategory(java.lang.String,
* java.lang.String)
*/
@Override
public
void
addRoleCategory
(
String
roleCategoryName
,
String
roleCategoryId
)
{
// check name duplication
...
...
@@ -1110,7 +1095,6 @@ public class RoleServiceImpl extends AbstractService implements RoleService {
* pwc.taxtech.atms.service.RoleService#updateRoleCategory(java.lang.String,
* java.lang.String)
*/
@Override
public
void
updateRoleCategory
(
String
roleCategoryName
,
String
roleCategoryId
)
{
RoleCategory
roleCategoryToUpdate
=
roleCategoryMapper
.
selectByPrimaryKey
(
roleCategoryId
);
...
...
@@ -1145,7 +1129,6 @@ public class RoleServiceImpl extends AbstractService implements RoleService {
* @see
* pwc.taxtech.atms.service.RoleService#deleteRoleCategory(java.lang.String)
*/
@Override
public
OperationResultDto
<?>
deleteRoleCategory
(
String
roleCategoryId
)
{
RoleCategory
roleCategoryToDelete
=
roleCategoryMapper
.
selectByPrimaryKey
(
roleCategoryId
);
...
...
@@ -1183,7 +1166,6 @@ public class RoleServiceImpl extends AbstractService implements RoleService {
* @see pwc.taxtech.atms.service.RoleService#addRole(pwc.taxtech.atms.dto.role.
* RoleDisplayDto)
*/
@Override
public
String
addRole
(
RoleDisplayDto
roleDisplayDto
)
{
// check role exist by roleId
...
...
@@ -1251,7 +1233,6 @@ public class RoleServiceImpl extends AbstractService implements RoleService {
* pwc.taxtech.atms.service.RoleService#updateRole(pwc.taxtech.atms.dto.role.
* UpdateRoleInfo, java.lang.String)
*/
@Override
public
void
updateRole
(
UpdateRoleInfo
updateRole
,
String
roleId
)
{
if
(
updateRole
==
null
||
updateRole
.
getUpdateRolePermissionDtoList
()
==
null
...
...
@@ -1353,7 +1334,6 @@ public class RoleServiceImpl extends AbstractService implements RoleService {
* pwc.taxtech.atms.service.RoleService#validateRoleNameUnique(java.lang.String,
* java.lang.String)
*/
@Override
public
boolean
validateRoleNameUnique
(
String
roleName
,
String
oldRoleName
)
{
if
(
roleName
.
trim
().
equals
(
oldRoleName
.
trim
()))
{
...
...
@@ -1375,7 +1355,6 @@ public class RoleServiceImpl extends AbstractService implements RoleService {
* pwc.taxtech.atms.service.RoleService#deleteRole(pwc.taxtech.atms.dto.role.
* RoleDto)
*/
@Override
public
void
deleteRole
(
RoleDto
roleDto
)
{
if
(
roleDto
==
null
||
roleDto
.
getId
()
==
null
||
roleDto
.
getId
().
isEmpty
())
{
...
...
@@ -1407,7 +1386,6 @@ public class RoleServiceImpl extends AbstractService implements RoleService {
*
* @see pwc.taxtech.atms.service.RoleService#checkUserRole(java.lang.String)
*/
@Override
public
boolean
checkUserRole
(
String
roleId
)
{
if
(
roleId
!=
null
)
{
...
...
@@ -1438,7 +1416,6 @@ public class RoleServiceImpl extends AbstractService implements RoleService {
* pwc.taxtech.atms.service.RoleService#getUserRoleList(pwc.taxtech.atms.dto.
* user.UserRoleDimensionValueDto)
*/
@Override
public
List
<
UserRoleInfo
>
getUserRoleList
(
UserRoleDimensionValueDto
userRoleDimensionValueDto
)
{
if
(
userRoleDimensionValueDto
.
getOrganizationId
()
==
null
...
...
@@ -1759,7 +1736,6 @@ public class RoleServiceImpl extends AbstractService implements RoleService {
* @see
* pwc.taxtech.atms.service.RoleService#getAllRolePermission(java.lang.String)
*/
@Override
public
List
<
RolePermissionDto
>
getAllRolePermission
(
String
serviceTypeId
)
{
List
<
RolePermissionDto
>
rolePermissionDtoList
=
new
ArrayList
<>();
...
...
@@ -1800,7 +1776,6 @@ public class RoleServiceImpl extends AbstractService implements RoleService {
* pwc.taxtech.atms.service.RoleService#updateUserRole(pwc.taxtech.atms.dto.user
* .UserRoleUpdateDto)
*/
@Override
public
void
updateUserRole
(
UserRoleUpdateDto
userRoleUpdateDto
)
{
// remove user role
...
...
@@ -1832,7 +1807,6 @@ public class RoleServiceImpl extends AbstractService implements RoleService {
* pwc.taxtech.atms.service.RoleService#updateDimensionValues(pwc.taxtech.atms.
* dto.dimension.DimensionValueUpdateDto)
*/
@Override
public
void
updateDimensionValues
(
DimensionValueUpdateDto
dimensionValueUpdateDto
)
{
if
(
dimensionValueUpdateDto
.
getAddedDimensions
()
!=
null
...
...
@@ -1858,7 +1832,6 @@ public class RoleServiceImpl extends AbstractService implements RoleService {
* @see pwc.taxtech.atms.service.RoleService#updateUserOrg(java.util.List,
* java.lang.String)
*/
@Override
public
void
updateUserOrg
(
List
<
String
>
orgIdList
,
String
userId
)
{
if
(
orgIdList
!=
null
&&
!
orgIdList
.
isEmpty
())
{
...
...
@@ -1877,7 +1850,6 @@ public class RoleServiceImpl extends AbstractService implements RoleService {
}
@Override
public
List
<
DimensionRole
>
getDimensionRoleUserList
(
String
dimensionId
,
String
dimensionValueId
)
{
List
<
DimensionRole
>
retList
=
new
ArrayList
<>();
if
(
DimensionConstant
.
OrgSubChildrenId
.
equals
(
dimensionId
))
{
...
...
@@ -2035,7 +2007,6 @@ public class RoleServiceImpl extends AbstractService implements RoleService {
return
userDimensionValueMapper
.
selectByExample
(
userDimensionValueExample
);
}
@Override
public
List
<
DimensionUser
>
getDimensionUserRoleList
(
String
dimensionId
,
String
dimensionValueId
)
{
List
<
DimensionUser
>
retList
=
new
ArrayList
<>();
if
(!
DimensionConstant
.
OrgSubChildrenId
.
equals
(
dimensionId
))
{
...
...
@@ -2113,7 +2084,6 @@ public class RoleServiceImpl extends AbstractService implements RoleService {
return
nameDto
;
}
@Override
public
List
<
UserRoleInfo
>
getActiveUserRoleListByAreaId
(
String
areaId
)
{
// 用户列表
UserExample
userExample
=
new
UserExample
();
...
...
atms-api/src/main/java/pwc/taxtech/atms/service/impl/UserServiceImpl.java
View file @
6c2fad8b
...
...
@@ -57,7 +57,6 @@ import pwc.taxtech.atms.security.LdapAuthenticationProvider;
import
pwc.taxtech.atms.service.MenuService
;
import
pwc.taxtech.atms.service.OperationLogService
;
import
pwc.taxtech.atms.service.OrganizationService
;
import
pwc.taxtech.atms.service.RoleService
;
import
java.util.ArrayList
;
import
java.util.Date
;
...
...
@@ -85,7 +84,7 @@ public class UserServiceImpl extends AbstractService {
@Autowired
private
JwtUtil
jwtUtil
;
@Autowired
private
RoleService
roleService
;
private
RoleService
Impl
roleService
;
@Autowired
private
MenuService
menuService
;
@Autowired
...
...
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