Commit fddbf6b9 authored by neo's avatar neo

[DEL] delete user service interface

parent 13792da2
...@@ -27,7 +27,7 @@ import pwc.taxtech.atms.dto.organization.OrgGeneralInfoDto; ...@@ -27,7 +27,7 @@ import pwc.taxtech.atms.dto.organization.OrgGeneralInfoDto;
import pwc.taxtech.atms.dto.organization.UpdateOrgDimensionDto; import pwc.taxtech.atms.dto.organization.UpdateOrgDimensionDto;
import pwc.taxtech.atms.service.OrganizationService; import pwc.taxtech.atms.service.OrganizationService;
import pwc.taxtech.atms.service.UserRoleService; import pwc.taxtech.atms.service.UserRoleService;
import pwc.taxtech.atms.service.UserService; import pwc.taxtech.atms.service.impl.UserServiceImpl;
import java.util.List; import java.util.List;
...@@ -42,7 +42,7 @@ public class OrganizationController { ...@@ -42,7 +42,7 @@ public class OrganizationController {
@Autowired @Autowired
UserRoleService userRoleService; UserRoleService userRoleService;
@Autowired @Autowired
UserService userService; UserServiceImpl userService;
@ApiOperation(value = "根据使用的方式获取机构的列表") @ApiOperation(value = "根据使用的方式获取机构的列表")
@RequestMapping(value = "getjson", method = RequestMethod.GET) @RequestMapping(value = "getjson", method = RequestMethod.GET)
......
...@@ -31,7 +31,7 @@ import pwc.taxtech.atms.entity.User; ...@@ -31,7 +31,7 @@ import pwc.taxtech.atms.entity.User;
import pwc.taxtech.atms.service.RoleService; import pwc.taxtech.atms.service.RoleService;
import pwc.taxtech.atms.service.UserAccountService; import pwc.taxtech.atms.service.UserAccountService;
import pwc.taxtech.atms.service.UserRoleService; import pwc.taxtech.atms.service.UserRoleService;
import pwc.taxtech.atms.service.UserService; import pwc.taxtech.atms.service.impl.UserServiceImpl;
import java.util.List; import java.util.List;
...@@ -40,7 +40,7 @@ import java.util.List; ...@@ -40,7 +40,7 @@ import java.util.List;
public class UserController { public class UserController {
private static final Logger logger = LoggerFactory.getLogger(UserController.class); private static final Logger logger = LoggerFactory.getLogger(UserController.class);
@Autowired @Autowired
private UserService userService; private UserServiceImpl userService;
@Autowired @Autowired
private UserRoleService userRoleService; private UserRoleService userRoleService;
@Autowired @Autowired
...@@ -107,13 +107,14 @@ public class UserController { ...@@ -107,13 +107,14 @@ public class UserController {
@ApiOperation(value = "通过机构Id和用户Id获取该用户的默认角色") @ApiOperation(value = "通过机构Id和用户Id获取该用户的默认角色")
@RequestMapping(value = "getUserRoleByOrgIdUserId", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @RequestMapping(value = "getUserRoleByOrgIdUserId", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public UserOrganizationDto getUserRoleByOrgIdUserId(@RequestParam("userId") String userId, public UserOrganizationDto getUserRoleByOrgIdUserId(@RequestParam("userId") String userId,
@RequestParam("orgId") String orgId) { @RequestParam("orgId") String orgId) {
return userRoleService.getUserRoleByOrgId(userId, orgId); return userRoleService.getUserRoleByOrgId(userId, orgId);
} }
@ApiOperation(value = "为角色添加用户") @ApiOperation(value = "为角色添加用户")
@RequestMapping(value = "addUsersToRole", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @RequestMapping(value = "addUsersToRole", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public @ResponseBody Boolean addUsersToRole(@RequestBody UserRoleSaveDto userRoleSaveDto) { public @ResponseBody
Boolean addUsersToRole(@RequestBody UserRoleSaveDto userRoleSaveDto) {
roleService.addUsersToRole(userRoleSaveDto.getRoleId(), userRoleSaveDto.getServiceTypeId(), roleService.addUsersToRole(userRoleSaveDto.getRoleId(), userRoleSaveDto.getServiceTypeId(),
userRoleSaveDto.getUserIdList()); userRoleSaveDto.getUserIdList());
return true; return true;
...@@ -122,22 +123,25 @@ public class UserController { ...@@ -122,22 +123,25 @@ public class UserController {
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
@ApiOperation(value = "为角色添加用户") @ApiOperation(value = "为角色添加用户")
@RequestMapping(value = "enableordisableuser", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @RequestMapping(value = "enableordisableuser", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public @ResponseBody OperationResultDto enableOrDisableUser(@RequestBody UpdateParam updateParam) { public @ResponseBody
OperationResultDto enableOrDisableUser(@RequestBody UpdateParam updateParam) {
return userRoleService.enableOrDisableUser(updateParam); return userRoleService.enableOrDisableUser(updateParam);
} }
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
@ApiOperation(value = "为机构删除用户角色") @ApiOperation(value = "为机构删除用户角色")
@RequestMapping(value = "deleteUserRoleForOrg", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @RequestMapping(value = "deleteUserRoleForOrg", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public @ResponseBody OperationResultDto deleteUserRoleForOrg(@RequestBody UserOrgDto userDto) { public @ResponseBody
OperationResultDto deleteUserRoleForOrg(@RequestBody UserOrgDto userDto) {
logger.debug("enter deleteUserRoleForOrg"); logger.debug("enter deleteUserRoleForOrg");
return userRoleService.deleteUserRoleByOrgId(userDto); return userRoleService.deleteUserRoleByOrgId(userDto);
} }
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
@ApiOperation(value = "机构删除,包括维度上的继承删除") @ApiOperation(value = "机构删除,包括维度上的继承删除")
@RequestMapping(value = "deleteUserRoleOrg", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @RequestMapping(value = "deleteUserRoleOrg", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public @ResponseBody OperationResultDto deleteUserRoleOrg( public @ResponseBody
OperationResultDto deleteUserRoleOrg(
@RequestBody List<UserRoleDimensionValueDto> userRoleList) { @RequestBody List<UserRoleDimensionValueDto> userRoleList) {
return userRoleService.deleteUserRoleOrg(userRoleList); return userRoleService.deleteUserRoleOrg(userRoleList);
} }
...@@ -174,7 +178,8 @@ public class UserController { ...@@ -174,7 +178,8 @@ public class UserController {
@ApiOperation(value = "为维度添加用户") @ApiOperation(value = "为维度添加用户")
@RequestMapping(value = "updateUserRoleForDimension", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @RequestMapping(value = "updateUserRoleForDimension", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public @ResponseBody OperationResultDto<?> updateUserRoleForDimension( public @ResponseBody
OperationResultDto<?> updateUserRoleForDimension(
@RequestBody List<UserRoleDimensionValueDto> userRoleList) { @RequestBody List<UserRoleDimensionValueDto> userRoleList) {
return userRoleService.updateUserRoleForDimension(userRoleList); return userRoleService.updateUserRoleForDimension(userRoleList);
} }
...@@ -182,42 +187,48 @@ public class UserController { ...@@ -182,42 +187,48 @@ public class UserController {
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
@ApiOperation(value = "添加事业部的值的权限") @ApiOperation(value = "添加事业部的值的权限")
@RequestMapping(value = "updateUserRoleDimension", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @RequestMapping(value = "updateUserRoleDimension", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public @ResponseBody OperationResultDto updateUserRoleDimension( public @ResponseBody
OperationResultDto updateUserRoleDimension(
@RequestBody List<UserRoleDimensionValueDto> userRoleList) { @RequestBody List<UserRoleDimensionValueDto> userRoleList) {
return userRoleService.updateUserRoleDimension(userRoleList); return userRoleService.updateUserRoleDimension(userRoleList);
} }
@ApiOperation(value = "更新一个用户的信息") @ApiOperation(value = "更新一个用户的信息")
@RequestMapping(value = "update", method = RequestMethod.PUT, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @RequestMapping(value = "update", method = RequestMethod.PUT, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public @ResponseBody OperationResultDto<User> updateUser(@RequestBody UserAndUserRoleSaveDto userDto) { public @ResponseBody
OperationResultDto<User> updateUser(@RequestBody UserAndUserRoleSaveDto userDto) {
return userService.updateUser(userDto); return userService.updateUser(userDto);
} }
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
@ApiOperation(value = "机构用户权限编辑") @ApiOperation(value = "机构用户权限编辑")
@RequestMapping(value = "updateUserRoleOrganization", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @RequestMapping(value = "updateUserRoleOrganization", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public @ResponseBody OperationResultDto updateUserRoleOrganization( public @ResponseBody
OperationResultDto updateUserRoleOrganization(
@RequestBody List<UserRoleDimensionValueDto> userRoleList) { @RequestBody List<UserRoleDimensionValueDto> userRoleList) {
return userRoleService.updateUserRoleOrganization(userRoleList); return userRoleService.updateUserRoleOrganization(userRoleList);
} }
@ApiOperation(value = "添加一个新的用户") @ApiOperation(value = "添加一个新的用户")
@RequestMapping(value = "add", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @RequestMapping(value = "add", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public @ResponseBody OperationResultDto<User> addUser(@RequestBody UserAndUserRoleSaveDto userAndUserRoleSaveDto) { public @ResponseBody
OperationResultDto<User> addUser(@RequestBody UserAndUserRoleSaveDto userAndUserRoleSaveDto) {
return userAccountService.addNewUser(userAndUserRoleSaveDto); return userAccountService.addNewUser(userAndUserRoleSaveDto);
} }
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
@ApiOperation(value = "删除可继承权限", notes = "用户管理>点击用户卡片>点击各机构设置数据的修改按钮>点击角色>取消设置下的允许继承>确定") @ApiOperation(value = "删除可继承权限", notes = "用户管理>点击用户卡片>点击各机构设置数据的修改按钮>点击角色>取消设置下的允许继承>确定")
@RequestMapping(value = "deleteUserOrg", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @RequestMapping(value = "deleteUserOrg", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public @ResponseBody OperationResultDto deleteUserOrg(@RequestBody List<UserRoleDimensionValueDto> userRoleList) { public @ResponseBody
OperationResultDto deleteUserOrg(@RequestBody List<UserRoleDimensionValueDto> userRoleList) {
return userService.deleteUserOrg(userRoleList); return userService.deleteUserOrg(userRoleList);
} }
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
@ApiOperation(value = "给机构添加用户", notes = "机构管理>点击机构>用户>添加用户>选中用户并提交") @ApiOperation(value = "给机构添加用户", notes = "机构管理>点击机构>用户>添加用户>选中用户并提交")
@RequestMapping(value = "updateUserRoleForOrg", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @RequestMapping(value = "updateUserRoleForOrg", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public @ResponseBody OperationResultDto updateUserRoleForOrg( public @ResponseBody
OperationResultDto updateUserRoleForOrg(
@RequestBody List<UserRoleDimensionValueDto> userRoleList) { @RequestBody List<UserRoleDimensionValueDto> userRoleList) {
return userRoleService.updateUserRoleForOrg(userRoleList); return userRoleService.updateUserRoleForOrg(userRoleList);
} }
...@@ -225,7 +236,8 @@ public class UserController { ...@@ -225,7 +236,8 @@ public class UserController {
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
@ApiOperation(value = "查询用户信息", notes = "税务运营管理平台>增值税申报") @ApiOperation(value = "查询用户信息", notes = "税务运营管理平台>增值税申报")
@RequestMapping(value = "getUserByName", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @RequestMapping(value = "getUserByName", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public @ResponseBody UserDto getUserByName( public @ResponseBody
UserDto getUserByName(
@RequestBody UserDto userParam) { @RequestBody UserDto userParam) {
return userRoleService.GetUserByUserName(userParam); return userRoleService.GetUserByUserName(userParam);
} }
......
package pwc.taxtech.atms.service;
import java.util.List;
import pwc.taxtech.atms.dpo.UserDto;
import pwc.taxtech.atms.dto.LogOnDto;
import pwc.taxtech.atms.dto.LoginInputDto;
import pwc.taxtech.atms.dto.LoginOutputDto;
import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.dto.organization.DimensionRoleDto;
import pwc.taxtech.atms.dto.permission.UserPermissionDto;
import pwc.taxtech.atms.dto.permission.UserPermissionKeyDto;
import pwc.taxtech.atms.dto.user.UserAndUserRoleSaveDto;
import pwc.taxtech.atms.dto.user.UserPasswordDto;
import pwc.taxtech.atms.dto.user.UserRoleDimensionValueDto;
import pwc.taxtech.atms.entity.User;
import pwc.taxtech.atms.entity.UserOrganization;
public interface UserService {
UserPermissionDto getUserPermission(String userName);
UserPermissionKeyDto getUserPermissionKey(String userName);
User getUser(String id);
OperationResultDto<LoginOutputDto> login(LoginInputDto input);
OperationResultDto<LogOnDto> changeExternalUserPassword(UserPasswordDto userPasswordDto);
OperationResultDto<LoginOutputDto> activeCheck(User tempUser);
OperationResultDto<LoginOutputDto> externalUserLogin(User tempUser, String email, String password);
UserDto getUserById(String userId);
List<User> findAllUsers();
OperationResultDto<User> updateUser(UserAndUserRoleSaveDto userDto);
OperationResultDto<User> checkEmailExist(String email, String userId);
OperationResultDto<User> checkUserExist(String userName, String userId);
void deleteUserDimensionValue(DimensionRoleDto dto, String userId);
@SuppressWarnings("rawtypes")
OperationResultDto deleteUserOrg(List<UserRoleDimensionValueDto> userRoleList);
List<UserOrganization> findUserOrganizationByUserIdAndOrganizationId(String userId, String organizationId);
UserDto getUserByDto(UserDto userParam);
}
package pwc.taxtech.atms.service.impl; package pwc.taxtech.atms.service.impl;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.BooleanUtils;
import org.apache.ibatis.session.RowBounds; import org.apache.ibatis.session.RowBounds;
import org.slf4j.Logger; import org.slf4j.Logger;
...@@ -13,18 +8,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -13,18 +8,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.Assert; import org.springframework.util.Assert;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import pwc.taxtech.atms.common.*;
import pwc.taxtech.atms.common.AtmsApiSettings;
import pwc.taxtech.atms.common.AuthUserHelper;
import pwc.taxtech.atms.common.CheckState;
import pwc.taxtech.atms.common.CommonConstants;
import pwc.taxtech.atms.common.CommonUtils;
import pwc.taxtech.atms.common.OperateLogType;
import pwc.taxtech.atms.common.OperationAction;
import pwc.taxtech.atms.common.OperationModule;
import pwc.taxtech.atms.common.StringHelper;
import pwc.taxtech.atms.common.UserLoginType;
import pwc.taxtech.atms.common.UserStatus;
import pwc.taxtech.atms.common.message.UserMessage; import pwc.taxtech.atms.common.message.UserMessage;
import pwc.taxtech.atms.dao.UserHistoricalPasswordMapper; import pwc.taxtech.atms.dao.UserHistoricalPasswordMapper;
import pwc.taxtech.atms.dao.UserMapper; import pwc.taxtech.atms.dao.UserMapper;
...@@ -46,7 +30,11 @@ import pwc.taxtech.atms.entity.UserRole; ...@@ -46,7 +30,11 @@ import pwc.taxtech.atms.entity.UserRole;
import pwc.taxtech.atms.security.AtmsPasswordEncoder; import pwc.taxtech.atms.security.AtmsPasswordEncoder;
import pwc.taxtech.atms.service.CommonService; import pwc.taxtech.atms.service.CommonService;
import pwc.taxtech.atms.service.UserAccountService; import pwc.taxtech.atms.service.UserAccountService;
import pwc.taxtech.atms.service.UserService;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Objects;
@Service @Service
public class UserAccountServiceImpl extends AbstractService implements UserAccountService { public class UserAccountServiceImpl extends AbstractService implements UserAccountService {
...@@ -62,7 +50,7 @@ public class UserAccountServiceImpl extends AbstractService implements UserAccou ...@@ -62,7 +50,7 @@ public class UserAccountServiceImpl extends AbstractService implements UserAccou
@Autowired @Autowired
private UserHistoricalPasswordMapper userHistoricalPasswordMapper; private UserHistoricalPasswordMapper userHistoricalPasswordMapper;
@Autowired @Autowired
private UserService userService; private UserServiceImpl userService;
@Autowired @Autowired
private CommonService commonService; private CommonService commonService;
...@@ -373,7 +361,7 @@ public class UserAccountServiceImpl extends AbstractService implements UserAccou ...@@ -373,7 +361,7 @@ public class UserAccountServiceImpl extends AbstractService implements UserAccou
} }
private UpdateLogParams generateUpdateLogParams(Integer module, String operationContent, String operateObject, private UpdateLogParams generateUpdateLogParams(Integer module, String operationContent, String operateObject,
Integer action) { Integer action) {
UpdateLogParams updateLogParams = new UpdateLogParams(); UpdateLogParams updateLogParams = new UpdateLogParams();
updateLogParams.setOperationModule(module); updateLogParams.setOperationModule(module);
updateLogParams.setOperationContent(operationContent); updateLogParams.setOperationContent(operationContent);
......
...@@ -32,14 +32,21 @@ import pwc.taxtech.atms.dto.organization.OrgRoleDto; ...@@ -32,14 +32,21 @@ import pwc.taxtech.atms.dto.organization.OrgRoleDto;
import pwc.taxtech.atms.dto.organization.OrgRoleDtoList; import pwc.taxtech.atms.dto.organization.OrgRoleDtoList;
import pwc.taxtech.atms.dto.organization.SimpleRoleDto; import pwc.taxtech.atms.dto.organization.SimpleRoleDto;
import pwc.taxtech.atms.dto.role.RoleDto; import pwc.taxtech.atms.dto.role.RoleDto;
import pwc.taxtech.atms.dto.user.*; import pwc.taxtech.atms.dto.user.DimensionUser;
import pwc.taxtech.atms.dto.user.NameDto;
import pwc.taxtech.atms.dto.user.OrganizationRoleInfo;
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.dto.user.UserRoleQueryDto;
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.exception.ApplicationException; import pwc.taxtech.atms.exception.ApplicationException;
import pwc.taxtech.atms.service.OrganizationService; import pwc.taxtech.atms.service.OrganizationService;
import pwc.taxtech.atms.service.PermissionService; import pwc.taxtech.atms.service.PermissionService;
import pwc.taxtech.atms.service.UserRoleService; import pwc.taxtech.atms.service.UserRoleService;
import pwc.taxtech.atms.service.UserService;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
...@@ -58,7 +65,7 @@ public class UserRoleServiceImpl extends AbstractService implements UserRoleServ ...@@ -58,7 +65,7 @@ public class UserRoleServiceImpl extends AbstractService implements UserRoleServ
private OrganizationService organizationService; private OrganizationService organizationService;
@Autowired @Autowired
private UserService userService; private UserServiceImpl userService;
@Override @Override
public OrgRoleDtoList getUserRoleByUserId(String userId) { public OrgRoleDtoList getUserRoleByUserId(String userId) {
...@@ -533,8 +540,8 @@ public class UserRoleServiceImpl extends AbstractService implements UserRoleServ ...@@ -533,8 +540,8 @@ public class UserRoleServiceImpl extends AbstractService implements UserRoleServ
} }
private OrganizationRoleInfo generateOrganizationRoleInfo(String organizationId, String organizationName, private OrganizationRoleInfo generateOrganizationRoleInfo(String organizationId, String organizationName,
String dimensionValueId, String dimensionValueName, Boolean hasOriginalRole, Boolean isAccessible, String dimensionValueId, String dimensionValueName, Boolean hasOriginalRole, Boolean isAccessible,
List<RoleInfo> roleInfoList, String userId) { List<RoleInfo> roleInfoList, String userId) {
OrganizationRoleInfo orgRoleInfo = new OrganizationRoleInfo(); OrganizationRoleInfo orgRoleInfo = new OrganizationRoleInfo();
orgRoleInfo.setId(CommonUtils.getUUID()); orgRoleInfo.setId(CommonUtils.getUUID());
orgRoleInfo.setOrganizationId(organizationId); orgRoleInfo.setOrganizationId(organizationId);
...@@ -551,7 +558,7 @@ public class UserRoleServiceImpl extends AbstractService implements UserRoleServ ...@@ -551,7 +558,7 @@ public class UserRoleServiceImpl extends AbstractService implements UserRoleServ
} }
private DimensionUser generateDimensionUser(String dimensionValueId, String dimensionValueName, private DimensionUser generateDimensionUser(String dimensionValueId, String dimensionValueName,
Boolean hasOriginalRole, Boolean isAccessible, List<NameDto> roleInfoList, String userId, String userName) { Boolean hasOriginalRole, Boolean isAccessible, List<NameDto> roleInfoList, String userId, String userName) {
DimensionUser dimensionUser = new DimensionUser(); DimensionUser dimensionUser = new DimensionUser();
dimensionUser.setId(CommonUtils.getUUID()); dimensionUser.setId(CommonUtils.getUUID());
dimensionUser.setDimensionId(DimensionConstant.ExtraOrgDimensionId); dimensionUser.setDimensionId(DimensionConstant.ExtraOrgDimensionId);
...@@ -761,7 +768,7 @@ public class UserRoleServiceImpl extends AbstractService implements UserRoleServ ...@@ -761,7 +768,7 @@ public class UserRoleServiceImpl extends AbstractService implements UserRoleServ
} }
private void updateDataAddLog(Object originalObj, Object updateObj, Integer operationModule, String comment, private void updateDataAddLog(Object originalObj, Object updateObj, Integer operationModule, String comment,
String operationObject, String operationContent, Integer logType) { String operationObject, String operationContent, Integer logType) {
UpdateLogParams updateLogParams = new UpdateLogParams(); UpdateLogParams updateLogParams = new UpdateLogParams();
updateLogParams.setOperationObject(operationObject); updateLogParams.setOperationObject(operationObject);
updateLogParams.setOriginalState(originalObj); updateLogParams.setOriginalState(originalObj);
...@@ -825,7 +832,7 @@ public class UserRoleServiceImpl extends AbstractService implements UserRoleServ ...@@ -825,7 +832,7 @@ public class UserRoleServiceImpl extends AbstractService implements UserRoleServ
} }
private void addOrDeleteDataAddLog(String orgName, String operateUserName, Integer module, Integer action, private void addOrDeleteDataAddLog(String orgName, String operateUserName, Integer module, Integer action,
String comment) { String comment) {
UpdateLogParams updateLogParams = new UpdateLogParams(); UpdateLogParams updateLogParams = new UpdateLogParams();
updateLogParams.setComment(comment); updateLogParams.setComment(comment);
updateLogParams.setOperateLogType(OperateLogType.OperationLogUser.value()); updateLogParams.setOperateLogType(OperateLogType.OperationLogUser.value());
...@@ -950,7 +957,7 @@ public class UserRoleServiceImpl extends AbstractService implements UserRoleServ ...@@ -950,7 +957,7 @@ public class UserRoleServiceImpl extends AbstractService implements UserRoleServ
@Override @Override
public List<UserRoleDisplayInfo> getSpecialUserRoleByDimensionValueId(String parentDimensionId, public List<UserRoleDisplayInfo> getSpecialUserRoleByDimensionValueId(String parentDimensionId,
String dimensionValueId) { String dimensionValueId) {
List<UserRoleDisplayInfo> retlist = new ArrayList<>(); List<UserRoleDisplayInfo> retlist = new ArrayList<>();
// 获取特殊角色基本数据 // 获取特殊角色基本数据
List<UserRoleDimensionValueDto> basicQuery = getOrgSpecialUserRoleList(); List<UserRoleDimensionValueDto> basicQuery = getOrgSpecialUserRoleList();
...@@ -1081,7 +1088,7 @@ public class UserRoleServiceImpl extends AbstractService implements UserRoleServ ...@@ -1081,7 +1088,7 @@ public class UserRoleServiceImpl extends AbstractService implements UserRoleServ
// 用户继承了不可访问的,则这个机构不可访问 // 用户继承了不可访问的,则这个机构不可访问
if (isHeritable && !BooleanUtils.isTrue(d.getIsAccessible()) if (isHeritable && !BooleanUtils.isTrue(d.getIsAccessible())
&& orgNoAccessList.stream().noneMatch(s -> Objects.equals(s.getOrgId(), d.getOrganizationId()) && orgNoAccessList.stream().noneMatch(s -> Objects.equals(s.getOrgId(), d.getOrganizationId())
&& Objects.equals(s.getUserId(), d.getUserId()))) { && Objects.equals(s.getUserId(), d.getUserId()))) {
UserOrgDto orgRoleInfo = new UserOrgDto(); UserOrgDto orgRoleInfo = new UserOrgDto();
orgRoleInfo.setOrgId(d.getOrganizationId()); orgRoleInfo.setOrgId(d.getOrganizationId());
orgRoleInfo.setUserId(d.getUserId()); orgRoleInfo.setUserId(d.getUserId());
...@@ -1127,7 +1134,7 @@ public class UserRoleServiceImpl extends AbstractService implements UserRoleServ ...@@ -1127,7 +1134,7 @@ public class UserRoleServiceImpl extends AbstractService implements UserRoleServ
for (UserOrganization q : userOrganizationList) { for (UserOrganization q : userOrganizationList) {
if (p.getOrganizationId().equals(q.getOrganizationId()) if (p.getOrganizationId().equals(q.getOrganizationId())
&& orgNoAccessList.stream().noneMatch(es -> Objects.equals(es.getOrgId(), p.getId()) && orgNoAccessList.stream().noneMatch(es -> Objects.equals(es.getOrgId(), p.getId())
&& Objects.equals(es.getUserId(), q.getUserId()))) { && Objects.equals(es.getUserId(), q.getUserId()))) {
User u = findUserByStatusAndId(UserStatus.Active.value(), q.getUserId()); User u = findUserByStatusAndId(UserStatus.Active.value(), q.getUserId());
UserRoleDimensionValueDto userRoleDimensionValueDto = new UserRoleDimensionValueDto(); UserRoleDimensionValueDto userRoleDimensionValueDto = new UserRoleDimensionValueDto();
if (u != null) { if (u != null) {
...@@ -1187,7 +1194,7 @@ public class UserRoleServiceImpl extends AbstractService implements UserRoleServ ...@@ -1187,7 +1194,7 @@ public class UserRoleServiceImpl extends AbstractService implements UserRoleServ
} }
private List<UserDimensionValue> findUserDimensionValueByDimensionRelatedId(String parentDimensionId, private List<UserDimensionValue> findUserDimensionValueByDimensionRelatedId(String parentDimensionId,
String dimensionValueId, String userId) { String dimensionValueId, String userId) {
UserDimensionValueExample userDimensionValueExample = new UserDimensionValueExample(); UserDimensionValueExample userDimensionValueExample = new UserDimensionValueExample();
pwc.taxtech.atms.entity.UserDimensionValueExample.Criteria criteria = userDimensionValueExample pwc.taxtech.atms.entity.UserDimensionValueExample.Criteria criteria = userDimensionValueExample
.createCriteria(); .createCriteria();
......
...@@ -32,7 +32,6 @@ import pwc.taxtech.atms.dpo.RoleInfo; ...@@ -32,7 +32,6 @@ import pwc.taxtech.atms.dpo.RoleInfo;
import pwc.taxtech.atms.dpo.UserDto; import pwc.taxtech.atms.dpo.UserDto;
import pwc.taxtech.atms.dpo.UserRoleInfo; import pwc.taxtech.atms.dpo.UserRoleInfo;
import pwc.taxtech.atms.dto.AtmsTokenDto; import pwc.taxtech.atms.dto.AtmsTokenDto;
import pwc.taxtech.atms.dto.LogOnDto;
import pwc.taxtech.atms.dto.LoginInputDto; import pwc.taxtech.atms.dto.LoginInputDto;
import pwc.taxtech.atms.dto.LoginOutputDto; import pwc.taxtech.atms.dto.LoginOutputDto;
import pwc.taxtech.atms.dto.OperationResultDto; import pwc.taxtech.atms.dto.OperationResultDto;
...@@ -46,7 +45,6 @@ import pwc.taxtech.atms.dto.permission.PermissionKeyDto; ...@@ -46,7 +45,6 @@ import pwc.taxtech.atms.dto.permission.PermissionKeyDto;
import pwc.taxtech.atms.dto.permission.UserPermissionDto; import pwc.taxtech.atms.dto.permission.UserPermissionDto;
import pwc.taxtech.atms.dto.permission.UserPermissionKeyDto; import pwc.taxtech.atms.dto.permission.UserPermissionKeyDto;
import pwc.taxtech.atms.dto.user.UserAndUserRoleSaveDto; import pwc.taxtech.atms.dto.user.UserAndUserRoleSaveDto;
import pwc.taxtech.atms.dto.user.UserPasswordDto;
import pwc.taxtech.atms.dto.user.UserRoleDimensionValueDto; import pwc.taxtech.atms.dto.user.UserRoleDimensionValueDto;
import pwc.taxtech.atms.dto.user.VMUser; import pwc.taxtech.atms.dto.user.VMUser;
import pwc.taxtech.atms.dto.user.WebUserDto; import pwc.taxtech.atms.dto.user.WebUserDto;
...@@ -62,7 +60,6 @@ import pwc.taxtech.atms.service.OrganizationService; ...@@ -62,7 +60,6 @@ import pwc.taxtech.atms.service.OrganizationService;
import pwc.taxtech.atms.service.RoleService; import pwc.taxtech.atms.service.RoleService;
import pwc.taxtech.atms.service.UserAccountService; import pwc.taxtech.atms.service.UserAccountService;
import pwc.taxtech.atms.service.UserRoleService; import pwc.taxtech.atms.service.UserRoleService;
import pwc.taxtech.atms.service.UserService;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
...@@ -75,7 +72,7 @@ import static java.util.stream.Collectors.toList; ...@@ -75,7 +72,7 @@ import static java.util.stream.Collectors.toList;
/** /**
*/ */
@Service @Service
public class UserServiceImpl extends AbstractService implements UserService { public class UserServiceImpl extends AbstractService {
private static final Logger logger = LoggerFactory.getLogger(UserServiceImpl.class); private static final Logger logger = LoggerFactory.getLogger(UserServiceImpl.class);
@Autowired @Autowired
private UserMapper userMapper; private UserMapper userMapper;
...@@ -113,7 +110,6 @@ public class UserServiceImpl extends AbstractService implements UserService { ...@@ -113,7 +110,6 @@ public class UserServiceImpl extends AbstractService implements UserService {
@Value("${api.url}") @Value("${api.url}")
private String apiUrl; private String apiUrl;
@Override
public UserPermissionDto getUserPermission(String userName) { public UserPermissionDto getUserPermission(String userName) {
User user = userMapper.selectByUserNameIgnoreCase(userName); User user = userMapper.selectByUserNameIgnoreCase(userName);
if (user == null) { if (user == null) {
...@@ -366,12 +362,10 @@ public class UserServiceImpl extends AbstractService implements UserService { ...@@ -366,12 +362,10 @@ public class UserServiceImpl extends AbstractService implements UserService {
return organizationPermissionDto; return organizationPermissionDto;
} }
@Override
public User getUser(String id) { public User getUser(String id) {
return userMapper.selectByPrimaryKey(id); return userMapper.selectByPrimaryKey(id);
} }
@Override
public OperationResultDto<LoginOutputDto> login(LoginInputDto input) { public OperationResultDto<LoginOutputDto> login(LoginInputDto input) {
// return dummyLogin(input); // return dummyLogin(input);
return doLogin(input); return doLogin(input);
...@@ -513,7 +507,6 @@ public class UserServiceImpl extends AbstractService implements UserService { ...@@ -513,7 +507,6 @@ public class UserServiceImpl extends AbstractService implements UserService {
} }
@Override
public OperationResultDto<LoginOutputDto> externalUserLogin(User tempUser, String email, String password) { public OperationResultDto<LoginOutputDto> externalUserLogin(User tempUser, String email, String password) {
return passwordLoginCheck(tempUser, password); return passwordLoginCheck(tempUser, password);
} }
...@@ -539,7 +532,6 @@ public class UserServiceImpl extends AbstractService implements UserService { ...@@ -539,7 +532,6 @@ public class UserServiceImpl extends AbstractService implements UserService {
return result; return result;
} }
@Override
public OperationResultDto<LoginOutputDto> activeCheck(User tempUser) { public OperationResultDto<LoginOutputDto> activeCheck(User tempUser) {
if (tempUser == null) { if (tempUser == null) {
OperationResultDto<LoginOutputDto> result = new OperationResultDto<>(); OperationResultDto<LoginOutputDto> result = new OperationResultDto<>();
...@@ -581,13 +573,7 @@ public class UserServiceImpl extends AbstractService implements UserService { ...@@ -581,13 +573,7 @@ public class UserServiceImpl extends AbstractService implements UserService {
return operationResultDto; return operationResultDto;
} }
@Override
public OperationResultDto<LogOnDto> changeExternalUserPassword(UserPasswordDto userPasswordDto) {
// TODO Auto-generated method stub
return null;
}
@Override
public UserPermissionKeyDto getUserPermissionKey(String userName) { public UserPermissionKeyDto getUserPermissionKey(String userName) {
User user = userMapper.selectByUserNameIgnoreCase(userName); User user = userMapper.selectByUserNameIgnoreCase(userName);
if (user == null) { if (user == null) {
...@@ -672,13 +658,11 @@ public class UserServiceImpl extends AbstractService implements UserService { ...@@ -672,13 +658,11 @@ public class UserServiceImpl extends AbstractService implements UserService {
return userPermission; return userPermission;
} }
@Override
public List<User> findAllUsers() { public List<User> findAllUsers() {
UserExample userExample = new UserExample(); UserExample userExample = new UserExample();
return userMapper.selectByExample(userExample); return userMapper.selectByExample(userExample);
} }
@Override
public UserDto getUserById(String userId) { public UserDto getUserById(String userId) {
List<UserDto> userDtos = userMapper.selectUserWithOrgInfoById(userId); List<UserDto> userDtos = userMapper.selectUserWithOrgInfoById(userId);
if (userDtos != null && !userDtos.isEmpty()) { if (userDtos != null && !userDtos.isEmpty()) {
...@@ -687,7 +671,6 @@ public class UserServiceImpl extends AbstractService implements UserService { ...@@ -687,7 +671,6 @@ public class UserServiceImpl extends AbstractService implements UserService {
return null; return null;
} }
@Override
public OperationResultDto<User> updateUser(UserAndUserRoleSaveDto userDto) { public OperationResultDto<User> updateUser(UserAndUserRoleSaveDto userDto) {
OperationResultDto<User> result = checkUserExist(userDto.getUserName(), userDto.getId()); OperationResultDto<User> result = checkUserExist(userDto.getUserName(), userDto.getId());
OperationResultDto<User> operationResultDto = new OperationResultDto<>(); OperationResultDto<User> operationResultDto = new OperationResultDto<>();
...@@ -803,7 +786,6 @@ public class UserServiceImpl extends AbstractService implements UserService { ...@@ -803,7 +786,6 @@ public class UserServiceImpl extends AbstractService implements UserService {
return updateLogParams; return updateLogParams;
} }
@Override
public List<UserOrganization> findUserOrganizationByUserIdAndOrganizationId(String userId, String organizationId) { public List<UserOrganization> findUserOrganizationByUserIdAndOrganizationId(String userId, String organizationId) {
UserOrganizationExample userOrganizationExample = new UserOrganizationExample(); UserOrganizationExample userOrganizationExample = new UserOrganizationExample();
pwc.taxtech.atms.entity.UserOrganizationExample.Criteria criteria = userOrganizationExample.createCriteria(); pwc.taxtech.atms.entity.UserOrganizationExample.Criteria criteria = userOrganizationExample.createCriteria();
...@@ -812,7 +794,6 @@ public class UserServiceImpl extends AbstractService implements UserService { ...@@ -812,7 +794,6 @@ public class UserServiceImpl extends AbstractService implements UserService {
return userOrganizationMapper.selectByExample(userOrganizationExample); return userOrganizationMapper.selectByExample(userOrganizationExample);
} }
@Override
public UserDto getUserByDto(UserDto userParam) { public UserDto getUserByDto(UserDto userParam) {
User user = userMapper.selectByUserName(userParam.getUserName()); User user = userMapper.selectByUserName(userParam.getUserName());
UserDto dto = null; UserDto dto = null;
...@@ -831,7 +812,6 @@ public class UserServiceImpl extends AbstractService implements UserService { ...@@ -831,7 +812,6 @@ public class UserServiceImpl extends AbstractService implements UserService {
return userRoleMapper.selectByExample(userRoleExample); return userRoleMapper.selectByExample(userRoleExample);
} }
@Override
public OperationResultDto<User> checkUserExist(String userName, String userId) { public OperationResultDto<User> checkUserExist(String userName, String userId) {
User user = null; User user = null;
OperationResultDto<User> operationResultDto = new OperationResultDto<>(); OperationResultDto<User> operationResultDto = new OperationResultDto<>();
...@@ -852,7 +832,6 @@ public class UserServiceImpl extends AbstractService implements UserService { ...@@ -852,7 +832,6 @@ public class UserServiceImpl extends AbstractService implements UserService {
return operationResultDto; return operationResultDto;
} }
@Override
public OperationResultDto<User> checkEmailExist(String email, String userId) { public OperationResultDto<User> checkEmailExist(String email, String userId) {
User user = null; User user = null;
OperationResultDto<User> operationResultDto = new OperationResultDto<>(); OperationResultDto<User> operationResultDto = new OperationResultDto<>();
...@@ -873,7 +852,6 @@ public class UserServiceImpl extends AbstractService implements UserService { ...@@ -873,7 +852,6 @@ public class UserServiceImpl extends AbstractService implements UserService {
return operationResultDto; return operationResultDto;
} }
@Override
public void deleteUserDimensionValue(DimensionRoleDto dto, String userId) { public void deleteUserDimensionValue(DimensionRoleDto dto, String userId) {
if (dto == null || userId == null) { if (dto == null || userId == null) {
throw new ApplicationException(CommonConstants.JSONNULLOBJECT); throw new ApplicationException(CommonConstants.JSONNULLOBJECT);
...@@ -903,7 +881,6 @@ public class UserServiceImpl extends AbstractService implements UserService { ...@@ -903,7 +881,6 @@ public class UserServiceImpl extends AbstractService implements UserService {
* 0 删除,如果是附加附加角色,则删除 * 0 删除,如果是附加附加角色,则删除
*/ */
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
@Override
public OperationResultDto deleteUserOrg(List<UserRoleDimensionValueDto> userRoleList) { public OperationResultDto deleteUserOrg(List<UserRoleDimensionValueDto> userRoleList) {
if (userRoleList == null) { if (userRoleList == null) {
throw new ApplicationException(CommonConstants.JSONNULLOBJECT); throw new ApplicationException(CommonConstants.JSONNULLOBJECT);
......
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