Commit fe31a606 authored by neo's avatar neo

[DEL] delete user role service interface

parent fddbf6b9
......@@ -26,7 +26,7 @@ import pwc.taxtech.atms.dto.organization.OrgDto;
import pwc.taxtech.atms.dto.organization.OrgGeneralInfoDto;
import pwc.taxtech.atms.dto.organization.UpdateOrgDimensionDto;
import pwc.taxtech.atms.service.OrganizationService;
import pwc.taxtech.atms.service.UserRoleService;
import pwc.taxtech.atms.service.impl.UserRoleServiceImpl;
import pwc.taxtech.atms.service.impl.UserServiceImpl;
import java.util.List;
......@@ -40,7 +40,7 @@ public class OrganizationController {
@Autowired
OrganizationService organizationService;
@Autowired
UserRoleService userRoleService;
UserRoleServiceImpl userRoleService;
@Autowired
UserServiceImpl userService;
......
......@@ -30,7 +30,7 @@ import pwc.taxtech.atms.dto.user.UserRoleSaveDto;
import pwc.taxtech.atms.entity.User;
import pwc.taxtech.atms.service.RoleService;
import pwc.taxtech.atms.service.UserAccountService;
import pwc.taxtech.atms.service.UserRoleService;
import pwc.taxtech.atms.service.impl.UserRoleServiceImpl;
import pwc.taxtech.atms.service.impl.UserServiceImpl;
import java.util.List;
......@@ -42,7 +42,7 @@ public class UserController {
@Autowired
private UserServiceImpl userService;
@Autowired
private UserRoleService userRoleService;
private UserRoleServiceImpl userRoleService;
@Autowired
private RoleService roleService;
@Autowired
......
package pwc.taxtech.atms.service;
import pwc.taxtech.atms.dpo.OrganizationDto;
import pwc.taxtech.atms.dpo.UserDto;
import pwc.taxtech.atms.dpo.UserOrgDto;
import pwc.taxtech.atms.dpo.UserOrgRoleDto;
import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.dto.organization.DimensionRoleDto;
import pwc.taxtech.atms.dto.organization.OrgRoleDtoList;
import pwc.taxtech.atms.dto.user.UpdateParam;
import pwc.taxtech.atms.dto.user.UserAndUserRoleSaveDto;
import pwc.taxtech.atms.dto.user.UserOrganizationDto;
import pwc.taxtech.atms.dto.user.UserRoleDimensionValueDto;
import pwc.taxtech.atms.dto.user.UserRoleDisplayInfo;
import pwc.taxtech.atms.entity.UserRole;
import java.util.List;
public interface UserRoleService {
OrgRoleDtoList getUserRoleByUserId(String userId);
UserAndUserRoleSaveDto getSingleUserByUserId(String userId);
List<UserRoleDisplayInfo> getAllUserRoleList(String serviceTypeId);
List<UserRole> findAllUserRoles();
UserRoleDisplayInfo getUserRoleListByUserId(String userId);
UserOrganizationDto getUserRoleByOrgId(String userId, String orgId);
List<DimensionRoleDto> getOrgBuAreaIndustryUser(String userId);
@SuppressWarnings("rawtypes")
OperationResultDto enableOrDisableUser(UpdateParam updateParam);
@SuppressWarnings("rawtypes")
OperationResultDto deleteUserRoleOrg(List<UserRoleDimensionValueDto> list);
List<UserRoleDisplayInfo> getUserRoleByDimensionValueId(String parentDimensionId, String dimensionValueId);
List<UserRoleDisplayInfo> getSpecialUserRoleByDimensionValueId(String parentDimensionId, String dimensionValueId);
List<UserOrgRoleDto> getDimensionUserRoleList(String parentDimensionId, String dimensionValueId);
@SuppressWarnings("rawtypes")
OperationResultDto updateUserRoleDimension(List<UserRoleDimensionValueDto> userRoleList);
@SuppressWarnings("rawtypes")
OperationResultDto updateUserRoleOrganization(List<UserRoleDimensionValueDto> userRoleList);
@SuppressWarnings("rawtypes")
OperationResultDto deleteUserRoleDimension(List<UserRoleDimensionValueDto> userRoleList);
OperationResultDto<?> updateUserRoleForDimension(List<UserRoleDimensionValueDto> userRoleList);
UserDto getUserDtoById(String userId);
OrganizationDto getOrgDtoById(String orgId);
@SuppressWarnings("rawtypes")
OperationResultDto updateUserDimensionNonAccess(UserRoleDimensionValueDto r);
@SuppressWarnings("rawtypes")
OperationResultDto updateUserRoleForOrg(List<UserRoleDimensionValueDto> userRoleList);
@SuppressWarnings("rawtypes")
OperationResultDto deleteUserRoleByOrgId(UserOrgDto userDto);
UserDto GetUserByUserName(UserDto userParam);
}
......@@ -40,7 +40,6 @@ 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 pwc.taxtech.atms.service.UserRoleService;
import java.util.ArrayList;
import java.util.Date;
......@@ -62,7 +61,7 @@ public class RoleServiceImpl extends AbstractService implements RoleService {
private UserServiceImpl userService;
@Autowired
private UserRoleService userRoleService;
private UserRoleServiceImpl userRoleService;
@Autowired
private OrganizationService organizationService;
......
......@@ -46,7 +46,6 @@ import pwc.taxtech.atms.entity.UserRoleExample.Criteria;
import pwc.taxtech.atms.exception.ApplicationException;
import pwc.taxtech.atms.service.OrganizationService;
import pwc.taxtech.atms.service.PermissionService;
import pwc.taxtech.atms.service.UserRoleService;
import java.util.ArrayList;
import java.util.HashMap;
......@@ -56,7 +55,7 @@ import java.util.Objects;
import java.util.stream.Collectors;
@Service
public class UserRoleServiceImpl extends AbstractService implements UserRoleService {
public class UserRoleServiceImpl extends AbstractService {
@Autowired
private PermissionService permissionService;
......@@ -67,7 +66,6 @@ public class UserRoleServiceImpl extends AbstractService implements UserRoleServ
@Autowired
private UserServiceImpl userService;
@Override
public OrgRoleDtoList getUserRoleByUserId(String userId) {
logger.debug("UserRoleServiceImpl getUserRoleByUserId [ userId: {} ]", userId);
OrgRoleDtoList result = new OrgRoleDtoList();
......@@ -290,7 +288,6 @@ public class UserRoleServiceImpl extends AbstractService implements UserRoleServ
return organizationService.getDimensionValueOrgDtoList();
}
@Override
public UserAndUserRoleSaveDto getSingleUserByUserId(String userId) {
UserAndUserRoleSaveDto userDto = new UserAndUserRoleSaveDto();
User user = userMapper.selectByPrimaryKey(userId);
......@@ -318,7 +315,6 @@ public class UserRoleServiceImpl extends AbstractService implements UserRoleServ
return userDto;
}
@Override
public List<UserRoleDisplayInfo> getAllUserRoleList(String serviceTypeId) {
List<UserRoleQuery> query = userRoleMapper.selectUserRoleQueryByServiceTypeId(serviceTypeId);
List<UserRoleDisplayInfo> userRoleDtoList = new ArrayList<>();
......@@ -355,13 +351,11 @@ public class UserRoleServiceImpl extends AbstractService implements UserRoleServ
return userRoleDtoList;
}
@Override
public List<UserRole> findAllUserRoles() {
UserRoleExample userRoleExample = new UserRoleExample();
return userRoleMapper.selectByExample(userRoleExample);
}
@Override
public UserRoleDisplayInfo getUserRoleListByUserId(String userId) {
List<UserRoleDisplayInfo> allUserList = getAllUserRoleList("2");
return allUserList.stream().filter(s -> s.getUserId() != null && s.getUserId().equals(userId)).findFirst()
......@@ -371,7 +365,6 @@ public class UserRoleServiceImpl extends AbstractService implements UserRoleServ
/**
* 某个机构下的所有权限 任何一个不可访问,就不可访问,任何的维度,和附加
*/
@Override
public UserOrganizationDto getUserRoleByOrgId(String userId, String orgId) {
logger.debug("UserRoleServiceImpl getUserRoleByOrgId [ userId: {}, orgId: {} ]", userId, orgId);
UserOrganizationDto userOrganizationDto = new UserOrganizationDto();
......@@ -589,7 +582,6 @@ public class UserRoleServiceImpl extends AbstractService implements UserRoleServ
return roleInfo;
}
@Override
public List<DimensionRoleDto> getOrgBuAreaIndustryUser(String userId) {
List<DimensionUser> list = getUserDimensionValueRole(userId);
return list.stream().map(this::rotateDimensionUserToDimensionRoleDto).collect(Collectors.toList());
......@@ -724,7 +716,6 @@ public class UserRoleServiceImpl extends AbstractService implements UserRoleServ
}
@SuppressWarnings("rawtypes")
@Override
public OperationResultDto enableOrDisableUser(UpdateParam updateParam) {
logger.debug("UserRoleServiceImpl enableOrDisableUser");
OperationResultDto operationResultDto = new OperationResultDto();
......@@ -783,7 +774,6 @@ public class UserRoleServiceImpl extends AbstractService implements UserRoleServ
}
@SuppressWarnings("rawtypes")
@Override
public OperationResultDto deleteUserRoleOrg(List<UserRoleDimensionValueDto> list) {
logger.debug("UserRoleServiceImpl deleteUserRoleOrg");
if (list == null) {
......@@ -819,13 +809,11 @@ public class UserRoleServiceImpl extends AbstractService implements UserRoleServ
return operationResultDto;
}
@Override
public UserDto getUserDtoById(String userId) {
User query = userMapper.selectByPrimaryKey(userId);
return query == null ? new UserDto() : CommonUtils.copyProperties(query, new UserDto());
}
@Override
public OrganizationDto getOrgDtoById(String orgId) {
Organization query = organizationMapper.selectByPrimaryKey(orgId);
return query == null ? new OrganizationDto() : CommonUtils.copyProperties(query, new OrganizationDto());
......@@ -849,7 +837,6 @@ public class UserRoleServiceImpl extends AbstractService implements UserRoleServ
* 机构在维度上的,设置可继承或者不可继承
*/
@SuppressWarnings("rawtypes")
@Override
public OperationResultDto updateUserDimensionNonAccess(UserRoleDimensionValueDto r) {
OperationResultDto operationResultDto = new OperationResultDto<>();
if (r == null) {
......@@ -912,7 +899,6 @@ public class UserRoleServiceImpl extends AbstractService implements UserRoleServ
return operationResultDto;
}
@Override
public List<UserRoleDisplayInfo> getUserRoleByDimensionValueId(String parentDimensionId, String dimensionValueId) {
List<UserRoleDisplayInfo> retlist = new ArrayList<>();
// 用户在维度可以添加原始角色,或者附加角色
......@@ -955,7 +941,6 @@ public class UserRoleServiceImpl extends AbstractService implements UserRoleServ
return retlist;
}
@Override
public List<UserRoleDisplayInfo> getSpecialUserRoleByDimensionValueId(String parentDimensionId,
String dimensionValueId) {
List<UserRoleDisplayInfo> retlist = new ArrayList<>();
......@@ -1024,7 +1009,6 @@ public class UserRoleServiceImpl extends AbstractService implements UserRoleServ
return query;
}
@Override
public List<UserOrgRoleDto> getDimensionUserRoleList(String parentDimensionId, String dimensionValueId) {
List<DimensionValueOrgDto> orgList = getDimensionValueOrgDtoList().stream()
.filter(s -> Objects.equals(parentDimensionId, s.getDimensionId())
......@@ -1224,7 +1208,6 @@ public class UserRoleServiceImpl extends AbstractService implements UserRoleServ
* 附加角色写在角色关联表UserDimensionValueRole
*/
@SuppressWarnings("rawtypes")
@Override
public OperationResultDto updateUserRoleDimension(List<UserRoleDimensionValueDto> userRoleList) {
logger.debug("UserRoleServiceImpl updateUserRoleDimension");
if (userRoleList == null) {
......@@ -1318,7 +1301,6 @@ public class UserRoleServiceImpl extends AbstractService implements UserRoleServ
* 机构用户权限编辑 添加删除原始角色 添加删除额外角色 机构上,修改可访问还是不可访问
*/
@SuppressWarnings("rawtypes")
@Override
public OperationResultDto updateUserRoleOrganization(List<UserRoleDimensionValueDto> userRoleList) {
UserRoleDimensionValueDto first = userRoleList.stream().findFirst().orElse(null);
OperationResultDto operationResultDto = new OperationResultDto();
......@@ -1407,7 +1389,6 @@ public class UserRoleServiceImpl extends AbstractService implements UserRoleServ
* 为维度删除权限用户
*/
@SuppressWarnings("rawtypes")
@Override
public OperationResultDto deleteUserRoleDimension(List<UserRoleDimensionValueDto> userRoleList) {
logger.debug("UserRoleServiceImpl deleteUserRoleDimension");
if (userRoleList.isEmpty()) {
......@@ -1500,7 +1481,6 @@ public class UserRoleServiceImpl extends AbstractService implements UserRoleServ
}
// 给维度(事业部)添加用户
@Override
public OperationResultDto<?> updateUserRoleForDimension(List<UserRoleDimensionValueDto> userRoleList) {
logger.debug("UserRoleServiceImpl updateUserRoleForDimension");
if (userRoleList.isEmpty()) {
......@@ -1552,7 +1532,6 @@ public class UserRoleServiceImpl extends AbstractService implements UserRoleServ
}
@SuppressWarnings("rawtypes")
@Override
public OperationResultDto updateUserRoleForOrg(List<UserRoleDimensionValueDto> userRoleList) {
if (userRoleList == null) {
throw new ApplicationException(CommonConstants.JSONNULLOBJECT);
......@@ -1605,7 +1584,6 @@ public class UserRoleServiceImpl extends AbstractService implements UserRoleServ
* 在某个机构下面,删除用户(特殊权限和继承的权限),如果是特殊权限,直接删除权限机构的数据, 如果是继承维度的权限,将继承的维度设置为不可继承
*/
@SuppressWarnings("rawtypes")
@Override
public OperationResultDto deleteUserRoleByOrgId(UserOrgDto userDto) {
logger.debug("enter UserRoleServiceImpl");
if (userDto == null) {
......@@ -1663,7 +1641,6 @@ public class UserRoleServiceImpl extends AbstractService implements UserRoleServ
return result;
}
@Override
public UserDto GetUserByUserName(UserDto userParam) {
return userService.getUserByDto(userParam);
}
......
......@@ -59,7 +59,6 @@ import pwc.taxtech.atms.service.OperationLogService;
import pwc.taxtech.atms.service.OrganizationService;
import pwc.taxtech.atms.service.RoleService;
import pwc.taxtech.atms.service.UserAccountService;
import pwc.taxtech.atms.service.UserRoleService;
import java.util.ArrayList;
import java.util.Date;
......@@ -105,7 +104,7 @@ public class UserServiceImpl extends AbstractService {
@Autowired
private OrganizationService organizationService;
@Autowired
private UserRoleService userRoleService;
private UserRoleServiceImpl userRoleService;
@Value("${api.url}")
private String apiUrl;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment