|
|
@ -130,9 +130,9 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void updateSysUserOrganize(Long userId, Long organizeId) {
|
|
|
|
public void updateSysUserOrganize(Long userId, Long organizeId) {
|
|
|
|
LOGGER.info("平台账号 SysUser userId:{} organizeId",userId, organizeId);
|
|
|
|
LOGGER.info("平台账号 SysUser userId:{} organizeId", userId, organizeId);
|
|
|
|
SysUser user = userRDao.getById(userId);
|
|
|
|
SysUser user = userRDao.getById(userId);
|
|
|
|
if(user != null){
|
|
|
|
if (user != null) {
|
|
|
|
user.setOrganizeId(organizeId);
|
|
|
|
user.setOrganizeId(organizeId);
|
|
|
|
userRDao.save(user);
|
|
|
|
userRDao.save(user);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -140,26 +140,26 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
@ApiOperation(value = "删除账号信息")
|
|
|
|
@ApiOperation(value = "删除账号信息")
|
|
|
|
public void deleteSysUser(Long[] userIdList,String userName) {
|
|
|
|
public void deleteSysUser(Long[] userIdList, String userName) {
|
|
|
|
LOGGER.info("平台账号 SysUser userIdList:{}", userIdList);
|
|
|
|
LOGGER.info("平台账号 SysUser userIdList:{}", userIdList);
|
|
|
|
// 删除账号信息
|
|
|
|
// 删除账号信息
|
|
|
|
userRDao.updateValidStatusByPropertyIn("id", userIdList,CommonEnumUtil.IS_VAILD.INVAILD.getValue(), userName);
|
|
|
|
userRDao.updateValidStatusByPropertyIn("id", userIdList, CommonEnumUtil.IS_VAILD.INVAILD.getValue(), userName);
|
|
|
|
|
|
|
|
|
|
|
|
// 删除账号关系
|
|
|
|
// 删除账号关系
|
|
|
|
refUserDepartmentRDao.deleteByPropertyIn("userId",userIdList);
|
|
|
|
refUserDepartmentRDao.deleteByPropertyIn("userId", userIdList);
|
|
|
|
refUserRoleRDao.deleteByPropertyIn("userId", userIdList);
|
|
|
|
refUserRoleRDao.deleteByPropertyIn("userId", userIdList);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
@ApiOperation(value = "删除用户信息")
|
|
|
|
@ApiOperation(value = "删除用户信息")
|
|
|
|
public void deleteSysUserInfo(Long[] infoIdList,String userName) {
|
|
|
|
public void deleteSysUserInfo(Long[] infoIdList, String userName) {
|
|
|
|
LOGGER.info("平台用户 SysUserInfo infoIdList:{}", infoIdList);
|
|
|
|
LOGGER.info("平台用户 SysUserInfo infoIdList:{}", infoIdList);
|
|
|
|
// 删除用户信息
|
|
|
|
// 删除用户信息
|
|
|
|
userInfoRDao.updateValidStatusByPropertyIn("id", infoIdList,CommonEnumUtil.IS_VAILD.INVAILD.getValue(), userName);
|
|
|
|
userInfoRDao.updateValidStatusByPropertyIn("id", infoIdList, CommonEnumUtil.IS_VAILD.INVAILD.getValue(), userName);
|
|
|
|
|
|
|
|
|
|
|
|
// 删除用户关系
|
|
|
|
// 删除用户关系
|
|
|
|
refUserInfoDepartmentRDao.deleteByPropertyIn("userId",infoIdList);
|
|
|
|
refUserInfoDepartmentRDao.deleteByPropertyIn("userId", infoIdList);
|
|
|
|
refUserPositionRDao.deleteByPropertyIn("userId",infoIdList);
|
|
|
|
refUserPositionRDao.deleteByPropertyIn("userId", infoIdList);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
@ -170,9 +170,9 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public List<Long> findSysUserIdByDepartmentId(Long... departmentId) {
|
|
|
|
public List<Long> findSysUserIdByDepartmentId(Long... departmentId) {
|
|
|
|
List<Long> result = new ArrayList<>();
|
|
|
|
List<Long> result = new ArrayList<>();
|
|
|
|
if(departmentId != null && departmentId.length > 0){
|
|
|
|
if (departmentId != null && departmentId.length > 0) {
|
|
|
|
List<SysRefUserDepartment> departmentList = refUserDepartmentRDao.findByHqlWhere(CoreHqlPack.packHqlIds("departmentId", departmentId));
|
|
|
|
List<SysRefUserDepartment> departmentList = refUserDepartmentRDao.findByHqlWhere(CoreHqlPack.packHqlIds("departmentId", departmentId));
|
|
|
|
if(departmentList != null && departmentList.size() > 0){
|
|
|
|
if (departmentList != null && departmentList.size() > 0) {
|
|
|
|
departmentList.forEach(department -> result.add(department.getUserId()));
|
|
|
|
departmentList.forEach(department -> result.add(department.getUserId()));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -208,14 +208,14 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public ListPager<SysUser> querySysUser(UserDetailModel model, Pager pager) {
|
|
|
|
public ListPager<SysUser> querySysUser(UserDetailModel model, Pager pager) {
|
|
|
|
Set<Long> idList = new HashSet<>();
|
|
|
|
Set<Long> idList = new HashSet<>();
|
|
|
|
if(model.getSysUser() != null && model.getSysUser().getDepartmentId() != null){
|
|
|
|
if (model.getSysUser() != null && model.getSysUser().getDepartmentId() != null) {
|
|
|
|
idList.addAll(findSysUserIdByDepartmentId(model.getSysUser().getDepartmentId()));
|
|
|
|
idList.addAll(findSysUserIdByDepartmentId(model.getSysUser().getDepartmentId()));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// if(model.getSysUser() != null && model.getSysUser().getOrganizeCode() != null){
|
|
|
|
// if(model.getSysUser() != null && model.getSysUser().getOrganizeCode() != null){
|
|
|
|
// idList.addAll(findSysUserIdByOrganizeCode(model.getSysUser().getOrganizeCode()));
|
|
|
|
// idList.addAll(findSysUserIdByOrganizeCode(model.getSysUser().getOrganizeCode()));
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
if(model.getUserIdList() != null){
|
|
|
|
if (model.getUserIdList() != null) {
|
|
|
|
model.getUserIdList().forEach(idStr -> idList.add(Long.parseLong(idStr)));
|
|
|
|
model.getUserIdList().forEach(idStr -> idList.add(Long.parseLong(idStr)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -234,7 +234,7 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
@ApiOperation(value = "查询账号信息")
|
|
|
|
@ApiOperation(value = "查询账号信息")
|
|
|
|
public ListPager<SysUser> querySysUserPagerByUserDetailModelOrIds(UserDetailModel model,Pager pager, List<Long> ids) {
|
|
|
|
public ListPager<SysUser> querySysUserPagerByUserDetailModelOrIds(UserDetailModel model, Pager pager, List<Long> ids) {
|
|
|
|
LOGGER.info("平台用户 SysUser model:{} ids:{}", model, ids);
|
|
|
|
LOGGER.info("平台用户 SysUser model:{} ids:{}", model, ids);
|
|
|
|
String modeWhere = HqlModelPack.packHqlSysUserByModelOrIds(model, ids);
|
|
|
|
String modeWhere = HqlModelPack.packHqlSysUserByModelOrIds(model, ids);
|
|
|
|
|
|
|
|
|
|
|
@ -250,9 +250,9 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public List<Long> findSysUserInfoIdByDepartmentId(Long... departmentId) {
|
|
|
|
public List<Long> findSysUserInfoIdByDepartmentId(Long... departmentId) {
|
|
|
|
List<Long> result = new ArrayList<>();
|
|
|
|
List<Long> result = new ArrayList<>();
|
|
|
|
if(departmentId != null && departmentId.length > 0){
|
|
|
|
if (departmentId != null && departmentId.length > 0) {
|
|
|
|
List<SysRefUserInfoDepartment> departmentList = refUserInfoDepartmentRDao.findByHqlWhere(CoreHqlPack.packHqlIds("departmentId", departmentId));
|
|
|
|
List<SysRefUserInfoDepartment> departmentList = refUserInfoDepartmentRDao.findByHqlWhere(CoreHqlPack.packHqlIds("departmentId", departmentId));
|
|
|
|
if(departmentList != null && departmentList.size() > 0){
|
|
|
|
if (departmentList != null && departmentList.size() > 0) {
|
|
|
|
departmentList.forEach(department -> result.add(department.getUserId()));
|
|
|
|
departmentList.forEach(department -> result.add(department.getUserId()));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -286,7 +286,7 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public SessionUser queryUserLogin(String userName, String password, String languageCode) {
|
|
|
|
public SessionUser queryUserLogin(String userName, String password, String languageCode) {
|
|
|
|
LOGGER.info("平台用户 SYS_USER loginName:{} \t password:{} \t languageCode:{}", userName, password, languageCode);
|
|
|
|
LOGGER.info("平台用户 SYS_USER loginName:{} \t password:{} \t languageCode:{}", userName, password, languageCode);
|
|
|
|
UserToken token = new UserToken(userName,password,languageCode);
|
|
|
|
UserToken token = new UserToken(userName, password, languageCode);
|
|
|
|
SessionUser sessionUser = AuthUtil.login(token);
|
|
|
|
SessionUser sessionUser = AuthUtil.login(token);
|
|
|
|
AuthUtil.setSessionUser(sessionUser);
|
|
|
|
AuthUtil.setSessionUser(sessionUser);
|
|
|
|
return sessionUser;
|
|
|
|
return sessionUser;
|
|
|
@ -296,7 +296,6 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
public ListPager<SysUserInfo> querySysUserInfo(UserDetailModel model, Pager pager) {
|
|
|
|
public ListPager<SysUserInfo> querySysUserInfo(UserDetailModel model, Pager pager) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DdlPackBean packBean = CoreHqlPack.packDdlBeanSysUserInfo(model.getSysUserInfo(), StringTool.getListLong(model.getUserInfoIdList()));
|
|
|
|
DdlPackBean packBean = CoreHqlPack.packDdlBeanSysUserInfo(model.getSysUserInfo(), StringTool.getListLong(model.getUserInfoIdList()));
|
|
|
|
|
|
|
|
|
|
|
|
pager = PagerHelper.getPager(pager, userInfoRDao.findByHqlWhereCount(packBean));
|
|
|
|
pager = PagerHelper.getPager(pager, userInfoRDao.findByHqlWhereCount(packBean));
|
|
|
@ -317,7 +316,7 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
LOGGER.debug("平台账号角色 SysRole userId:{}", userId);
|
|
|
|
LOGGER.debug("平台账号角色 SysRole userId:{}", userId);
|
|
|
|
|
|
|
|
|
|
|
|
List<SysRefUserRole> refList = findSysRefUserRole(userId);
|
|
|
|
List<SysRefUserRole> refList = findSysRefUserRole(userId);
|
|
|
|
if(refList != null && refList.size() > 0){
|
|
|
|
if (refList != null && refList.size() > 0) {
|
|
|
|
List<Long> idList = new ArrayList<>();
|
|
|
|
List<Long> idList = new ArrayList<>();
|
|
|
|
refList.forEach(ref -> idList.add(ref.getRoleId()));
|
|
|
|
refList.forEach(ref -> idList.add(ref.getRoleId()));
|
|
|
|
|
|
|
|
|
|
|
@ -351,7 +350,7 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public List<SysMenu> findSysMenuByUserId(Long userId) {
|
|
|
|
public List<SysMenu> findSysMenuByUserId(Long userId) {
|
|
|
|
LOGGER.info("平台账号权限 SysMenu userId:{}",userId);
|
|
|
|
LOGGER.info("平台账号权限 SysMenu userId:{}", userId);
|
|
|
|
List<SysRefUserRole> refUserRoleList = findSysRefUserRole(userId);
|
|
|
|
List<SysRefUserRole> refUserRoleList = findSysRefUserRole(userId);
|
|
|
|
List<SysRefRoleMenu> refRoleMenuList = findSysRefRoleMenuByRefUserRole(refUserRoleList);
|
|
|
|
List<SysRefRoleMenu> refRoleMenuList = findSysRefRoleMenuByRefUserRole(refUserRoleList);
|
|
|
|
return findSysMenuByRefRoleMenu(refRoleMenuList);
|
|
|
|
return findSysMenuByRefRoleMenu(refRoleMenuList);
|
|
|
@ -369,7 +368,7 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public List<SysMenu> findSysMenuByRefRoleMenu(List<SysRefRoleMenu> refList) {
|
|
|
|
public List<SysMenu> findSysMenuByRefRoleMenu(List<SysRefRoleMenu> refList) {
|
|
|
|
LOGGER.info("平台账号角色 SysRefRoleMenu refList:{}", refList);
|
|
|
|
LOGGER.info("平台账号角色 SysRefRoleMenu refList:{}", refList);
|
|
|
|
if(refList != null && refList.size() > 0){
|
|
|
|
if (refList != null && refList.size() > 0) {
|
|
|
|
List<Long> idList = new ArrayList<>(refList.size());
|
|
|
|
List<Long> idList = new ArrayList<>(refList.size());
|
|
|
|
refList.forEach(ref -> idList.add(ref.getMenuId()));
|
|
|
|
refList.forEach(ref -> idList.add(ref.getMenuId()));
|
|
|
|
return menuService.findByIdList(idList);
|
|
|
|
return menuService.findByIdList(idList);
|
|
|
@ -389,44 +388,53 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public List<SysRefUserRole> findSysRefUserRole(Long userId, Long roleId, String organizeCode) {
|
|
|
|
public List<SysRefUserRole> findSysRefUserRole(Long userId, Long roleId, String organizeCode) {
|
|
|
|
LOGGER.info("平台账号角色 SysRefUserRole userId:{} roleId:{} organizeCode:{}",userId, roleId,organizeCode);
|
|
|
|
LOGGER.info("平台账号角色 SysRefUserRole userId:{} roleId:{} organizeCode:{}", userId, roleId, organizeCode);
|
|
|
|
return refUserRoleRDao.findByHqlWhere(CoreHqlPack.packDdlBeanSysRefUserRole(userId, roleId, organizeCode));
|
|
|
|
return refUserRoleRDao.findByHqlWhere(CoreHqlPack.packDdlBeanSysRefUserRole(userId, roleId, organizeCode));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public List<SysRefRoleMenu> findSysRefRoleMenuByUserId(Long userId) {
|
|
|
|
public List<SysRefRoleMenu> findSysRefRoleMenuByUserId(Long userId) {
|
|
|
|
LOGGER.info("平台账号角色 SysRefRoleMenu userId:{}", userId);
|
|
|
|
LOGGER.info("平台账号角色 SysRefRoleMenu userId:{}", userId);
|
|
|
|
if(userId != null){
|
|
|
|
if (userId != null) {
|
|
|
|
List<SysRefUserRole> refRoleList = findSysRefUserRole(userId);
|
|
|
|
List<SysRefUserRole> refRoleList = findSysRefUserRole(userId);
|
|
|
|
if(refRoleList != null && refRoleList.size() > 0){
|
|
|
|
if (refRoleList != null && refRoleList.size() > 0) {
|
|
|
|
List<Long> idList = new ArrayList<>(refRoleList.size());
|
|
|
|
List<Long> idList = new ArrayList<>(refRoleList.size());
|
|
|
|
refRoleList.forEach(ref -> idList.add(ref.getRoleId()));
|
|
|
|
refRoleList.forEach(ref -> idList.add(ref.getRoleId()));
|
|
|
|
|
|
|
|
|
|
|
|
return findSysRefRoleMenuByRoleIds( idList);
|
|
|
|
return findSysRefRoleMenuByRoleIds(idList);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public ListPager<SysRefUserRole> findSysRefUserRoleByRoleIds(List<Long> roleIdList,Pager pager) {
|
|
|
|
public ListPager<SysRefUserRole> findSysRefUserRoleByRoleIds(List<Long> roleIdList, Pager pager) {
|
|
|
|
if (ObjectUtils.isEmpty(roleIdList)){
|
|
|
|
if (ObjectUtils.isEmpty(roleIdList)) {
|
|
|
|
return null;
|
|
|
|
return new ListPager();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
DdlPackBean packBean = DdlPackBean.getDdlPackBean();
|
|
|
|
DdlPackBean packBean = DdlPackBean.getDdlPackBean();
|
|
|
|
DdlPreparedPack.getInPackList(roleIdList,"roleId",packBean);
|
|
|
|
DdlPreparedPack.getInPackList(roleIdList, "roleId", packBean);
|
|
|
|
pager = PagerHelper.getPager(pager,refUserRoleRDao.findByHqlWhereCount(packBean));
|
|
|
|
pager = PagerHelper.getPager(pager, refUserRoleRDao.findByHqlWhereCount(packBean));
|
|
|
|
return new ListPager<>(refUserRoleRDao.findByHqlWherePage(packBean, pager), pager);
|
|
|
|
return new ListPager<>(refUserRoleRDao.findByHqlWherePage(packBean, pager), pager);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public List<SysRefUserRole> findSysRefUserRoleByRoleNameAndUserID(String roleName, Long userId) {
|
|
|
|
|
|
|
|
DdlPackBean packBean = DdlPackBean.getDdlPackBean();
|
|
|
|
|
|
|
|
DdlPreparedPack.getStringLikerPack(roleName, "roleNameRdd", packBean);
|
|
|
|
|
|
|
|
DdlPreparedPack.getNumEqualPack(userId, "userId", packBean);
|
|
|
|
|
|
|
|
return refUserRoleRDao.findByHqlWhere(packBean);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public List<SysRefRoleMenu> findSysRefRoleMenuByRoleIds(List<Long> roleIdList) {
|
|
|
|
public List<SysRefRoleMenu> findSysRefRoleMenuByRoleIds(List<Long> roleIdList) {
|
|
|
|
LOGGER.info("平台账号角色 SysRefRoleMenu roleIdList:{}", roleIdList);
|
|
|
|
LOGGER.info("平台账号角色 SysRefRoleMenu roleIdList:{}", roleIdList);
|
|
|
|
if(roleIdList != null){
|
|
|
|
if (roleIdList != null) {
|
|
|
|
StringBuffer findWhere = new StringBuffer();
|
|
|
|
StringBuffer findWhere = new StringBuffer();
|
|
|
|
HqlPack.getInPack(StringUtils.join(roleIdList,","),"roleId",findWhere);
|
|
|
|
HqlPack.getInPack(StringUtils.join(roleIdList, ","), "roleId", findWhere);
|
|
|
|
HqlPack.getNumEqualPack(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(),"isDeleted",findWhere);
|
|
|
|
HqlPack.getNumEqualPack(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), "isDeleted", findWhere);
|
|
|
|
HqlPack.getNumEqualPack(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue(),"isValid",findWhere);
|
|
|
|
HqlPack.getNumEqualPack(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue(), "isValid", findWhere);
|
|
|
|
|
|
|
|
|
|
|
|
return refRoleMenuRDao.findByHqlWhere(findWhere.toString());
|
|
|
|
return refRoleMenuRDao.findByHqlWhere(findWhere.toString());
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -436,7 +444,7 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public List<SysRefRoleMenu> findSysRefRoleMenuByRole(List<SysRole> roleList) {
|
|
|
|
public List<SysRefRoleMenu> findSysRefRoleMenuByRole(List<SysRole> roleList) {
|
|
|
|
LOGGER.info("平台账号角色 SysRefRoleMenu roleList:{}", roleList);
|
|
|
|
LOGGER.info("平台账号角色 SysRefRoleMenu roleList:{}", roleList);
|
|
|
|
if(roleList != null && roleList.size() > 0){
|
|
|
|
if (roleList != null && roleList.size() > 0) {
|
|
|
|
List<Long> idList = new ArrayList<>(roleList.size());
|
|
|
|
List<Long> idList = new ArrayList<>(roleList.size());
|
|
|
|
roleList.forEach(ref -> idList.add(ref.getId()));
|
|
|
|
roleList.forEach(ref -> idList.add(ref.getId()));
|
|
|
|
return findSysRefRoleMenuByRoleIds(idList);
|
|
|
|
return findSysRefRoleMenuByRoleIds(idList);
|
|
|
@ -447,7 +455,7 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public List<SysRefRoleMenu> findSysRefRoleMenuByRefUserRole(List<SysRefUserRole> refList) {
|
|
|
|
public List<SysRefRoleMenu> findSysRefRoleMenuByRefUserRole(List<SysRefUserRole> refList) {
|
|
|
|
LOGGER.info("平台账号角色 SysRefRoleMenu refList:{}", refList);
|
|
|
|
LOGGER.info("平台账号角色 SysRefRoleMenu refList:{}", refList);
|
|
|
|
if(refList != null && refList.size() > 0){
|
|
|
|
if (refList != null && refList.size() > 0) {
|
|
|
|
List<Long> idList = new ArrayList<>(refList.size());
|
|
|
|
List<Long> idList = new ArrayList<>(refList.size());
|
|
|
|
refList.forEach(ref -> idList.add(ref.getRoleId()));
|
|
|
|
refList.forEach(ref -> idList.add(ref.getRoleId()));
|
|
|
|
return findSysRefRoleMenuByRoleIds(idList);
|
|
|
|
return findSysRefRoleMenuByRoleIds(idList);
|
|
|
@ -458,7 +466,7 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public List<SysRefUserDepartment> findSysRefUserDepartmentByUserId(Long userId) {
|
|
|
|
public List<SysRefUserDepartment> findSysRefUserDepartmentByUserId(Long userId) {
|
|
|
|
LOGGER.info("平台账号部门 SysRefUserDepartment userId:{}", userId);
|
|
|
|
LOGGER.info("平台账号部门 SysRefUserDepartment userId:{}", userId);
|
|
|
|
return refUserDepartmentRDao.findByProperty("userId",userId);
|
|
|
|
return refUserDepartmentRDao.findByProperty("userId", userId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
@ -466,7 +474,7 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
LOGGER.info("平台账号部门 SysRefUserDepartment organizeIdList:{}", organizeIdList);
|
|
|
|
LOGGER.info("平台账号部门 SysRefUserDepartment organizeIdList:{}", organizeIdList);
|
|
|
|
|
|
|
|
|
|
|
|
DdlPackBean packBean = DdlPackBean.getDdlPackBean();
|
|
|
|
DdlPackBean packBean = DdlPackBean.getDdlPackBean();
|
|
|
|
DdlPreparedPack.getInPackList(organizeIdList,"organizeId",packBean);
|
|
|
|
DdlPreparedPack.getInPackList(organizeIdList, "organizeId", packBean);
|
|
|
|
|
|
|
|
|
|
|
|
return refUserDepartmentRDao.findByHqlWhere(packBean);
|
|
|
|
return refUserDepartmentRDao.findByHqlWhere(packBean);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -476,7 +484,7 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
LOGGER.info("平台账号部门 SysRefUserDepartment organizeCode:{}", organizeCode);
|
|
|
|
LOGGER.info("平台账号部门 SysRefUserDepartment organizeCode:{}", organizeCode);
|
|
|
|
|
|
|
|
|
|
|
|
DdlPackBean packBean = DdlPackBean.getDdlPackBean();
|
|
|
|
DdlPackBean packBean = DdlPackBean.getDdlPackBean();
|
|
|
|
DdlPreparedPack.getStringEqualPack(organizeCode,"organizeCode",packBean);
|
|
|
|
DdlPreparedPack.getStringEqualPack(organizeCode, "organizeCode", packBean);
|
|
|
|
|
|
|
|
|
|
|
|
return refUserDepartmentRDao.findByHqlWhere(packBean);
|
|
|
|
return refUserDepartmentRDao.findByHqlWhere(packBean);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -486,25 +494,25 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
LOGGER.info("平台账号部门 SysRefUserDepartment departmentIdList:{}", departmentIdList);
|
|
|
|
LOGGER.info("平台账号部门 SysRefUserDepartment departmentIdList:{}", departmentIdList);
|
|
|
|
|
|
|
|
|
|
|
|
DdlPackBean packBean = DdlPackBean.getDdlPackBean();
|
|
|
|
DdlPackBean packBean = DdlPackBean.getDdlPackBean();
|
|
|
|
DdlPreparedPack.getInPackList(departmentIdList,"departmentId",packBean);
|
|
|
|
DdlPreparedPack.getInPackList(departmentIdList, "departmentId", packBean);
|
|
|
|
|
|
|
|
|
|
|
|
return refUserDepartmentRDao.findByHqlWhere(packBean);
|
|
|
|
return refUserDepartmentRDao.findByHqlWhere(packBean);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public List<SysRefUserDepartment> querySysRefUserDepartmentByUserDetailModel(UserDetailModel model) {
|
|
|
|
public List<SysRefUserDepartment> querySysRefUserDepartmentByUserDetailModel(UserDetailModel model) {
|
|
|
|
if(model != null){
|
|
|
|
if (model != null) {
|
|
|
|
StringBuffer userIdWhere = new StringBuffer();
|
|
|
|
StringBuffer userIdWhere = new StringBuffer();
|
|
|
|
|
|
|
|
|
|
|
|
if(model.getUserDepartmentIdList() != null){
|
|
|
|
if (model.getUserDepartmentIdList() != null) {
|
|
|
|
HqlPack.getInPack(StringUtils.join(model.getInfoDepartmentIdList(),","),"departmentId", userIdWhere);
|
|
|
|
HqlPack.getInPack(StringUtils.join(model.getInfoDepartmentIdList(), ","), "departmentId", userIdWhere);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(model.getUserOrganizeIdList() != null){
|
|
|
|
if (model.getUserOrganizeIdList() != null) {
|
|
|
|
HqlPack.getInPack( StringUtils.join(model.getUserOrganizeIdList(),","),"organizeId",userIdWhere);
|
|
|
|
HqlPack.getInPack(StringUtils.join(model.getUserOrganizeIdList(), ","), "organizeId", userIdWhere);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return refUserDepartmentRDao.findByHqlWhere(userIdWhere.toString());
|
|
|
|
return refUserDepartmentRDao.findByHqlWhere(userIdWhere.toString());
|
|
|
|
}else {
|
|
|
|
} else {
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -512,7 +520,7 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public List<SysRefUserInfoDepartment> findSysRefUserInfoDepartmentById(Long infoId) {
|
|
|
|
public List<SysRefUserInfoDepartment> findSysRefUserInfoDepartmentById(Long infoId) {
|
|
|
|
LOGGER.info("平台用户部门关系 SysRefUserInfoDepartment infoId:{}", infoId);
|
|
|
|
LOGGER.info("平台用户部门关系 SysRefUserInfoDepartment infoId:{}", infoId);
|
|
|
|
return refUserInfoDepartmentRDao.findByProperty("userId",infoId);
|
|
|
|
return refUserInfoDepartmentRDao.findByProperty("userId", infoId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
@ -520,7 +528,7 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
LOGGER.info("平台账号部门 SysRefUserDepartment organizeIdList:{}", organizeIdList);
|
|
|
|
LOGGER.info("平台账号部门 SysRefUserDepartment organizeIdList:{}", organizeIdList);
|
|
|
|
|
|
|
|
|
|
|
|
DdlPackBean packBean = DdlPackBean.getDdlPackBean();
|
|
|
|
DdlPackBean packBean = DdlPackBean.getDdlPackBean();
|
|
|
|
DdlPreparedPack.getInPackList(organizeIdList,"organizeId",packBean);
|
|
|
|
DdlPreparedPack.getInPackList(organizeIdList, "organizeId", packBean);
|
|
|
|
|
|
|
|
|
|
|
|
return refUserInfoDepartmentRDao.findByHqlWhere(packBean);
|
|
|
|
return refUserInfoDepartmentRDao.findByHqlWhere(packBean);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -530,7 +538,7 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
LOGGER.info("平台账号部门 SysRefUserInfoDepartment departmentIdList:{}", departmentIdList);
|
|
|
|
LOGGER.info("平台账号部门 SysRefUserInfoDepartment departmentIdList:{}", departmentIdList);
|
|
|
|
|
|
|
|
|
|
|
|
DdlPackBean packBean = DdlPackBean.getDdlPackBean();
|
|
|
|
DdlPackBean packBean = DdlPackBean.getDdlPackBean();
|
|
|
|
DdlPreparedPack.getInPackList(departmentIdList,"departmentId",packBean);
|
|
|
|
DdlPreparedPack.getInPackList(departmentIdList, "departmentId", packBean);
|
|
|
|
|
|
|
|
|
|
|
|
return refUserInfoDepartmentRDao.findByHqlWhere(packBean);
|
|
|
|
return refUserInfoDepartmentRDao.findByHqlWhere(packBean);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -548,7 +556,7 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
List<SysDepartment> result = new ArrayList<>();
|
|
|
|
List<SysDepartment> result = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
|
|
List<SysRefUserInfoDepartment> refs = findSysRefUserInfoDepartmentById(infoId);
|
|
|
|
List<SysRefUserInfoDepartment> refs = findSysRefUserInfoDepartmentById(infoId);
|
|
|
|
if(refs != null && refs.size() > 0){
|
|
|
|
if (refs != null && refs.size() > 0) {
|
|
|
|
List<Long> ids = new ArrayList<>();
|
|
|
|
List<Long> ids = new ArrayList<>();
|
|
|
|
refs.forEach(ref -> ids.add(ref.getDepartmentId()));
|
|
|
|
refs.forEach(ref -> ids.add(ref.getDepartmentId()));
|
|
|
|
|
|
|
|
|
|
|
@ -564,7 +572,7 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
List<SysDepartment> result = new ArrayList<>();
|
|
|
|
List<SysDepartment> result = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
|
|
List<SysRefUserDepartment> refs = findSysRefUserDepartmentByUserId(infoId);
|
|
|
|
List<SysRefUserDepartment> refs = findSysRefUserDepartmentByUserId(infoId);
|
|
|
|
if(refs != null && refs.size() > 0){
|
|
|
|
if (refs != null && refs.size() > 0) {
|
|
|
|
List<Long> ids = new ArrayList<>();
|
|
|
|
List<Long> ids = new ArrayList<>();
|
|
|
|
refs.forEach(ref -> ids.add(ref.getDepartmentId()));
|
|
|
|
refs.forEach(ref -> ids.add(ref.getDepartmentId()));
|
|
|
|
|
|
|
|
|
|
|
@ -587,7 +595,7 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
List<SysOrganize> result = new ArrayList<>();
|
|
|
|
List<SysOrganize> result = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
|
|
List<SysRefUserInfoDepartment> refs = findSysRefUserInfoDepartmentById(infoId);
|
|
|
|
List<SysRefUserInfoDepartment> refs = findSysRefUserInfoDepartmentById(infoId);
|
|
|
|
if(refs != null && refs.size() > 0){
|
|
|
|
if (refs != null && refs.size() > 0) {
|
|
|
|
List<Long> ids = new ArrayList<>();
|
|
|
|
List<Long> ids = new ArrayList<>();
|
|
|
|
refs.forEach(ref -> ids.add(ref.getOrganizeId()));
|
|
|
|
refs.forEach(ref -> ids.add(ref.getOrganizeId()));
|
|
|
|
|
|
|
|
|
|
|
@ -602,7 +610,7 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
List<SysOrganize> result = new ArrayList<>();
|
|
|
|
List<SysOrganize> result = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
|
|
List<SysRefUserDepartment> refs = findSysRefUserDepartmentByUserId(infoId);
|
|
|
|
List<SysRefUserDepartment> refs = findSysRefUserDepartmentByUserId(infoId);
|
|
|
|
if(refs != null && refs.size() > 0){
|
|
|
|
if (refs != null && refs.size() > 0) {
|
|
|
|
List<Long> ids = new ArrayList<>();
|
|
|
|
List<Long> ids = new ArrayList<>();
|
|
|
|
refs.forEach(ref -> ids.add(ref.getOrganizeId()));
|
|
|
|
refs.forEach(ref -> ids.add(ref.getOrganizeId()));
|
|
|
|
|
|
|
|
|
|
|
@ -630,14 +638,14 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public List<SysRefUserPosition> findSysRefUserPositionByUserInfoId(Long infoId) {
|
|
|
|
public List<SysRefUserPosition> findSysRefUserPositionByUserInfoId(Long infoId) {
|
|
|
|
LOGGER.info("平台用户岗位 SysRefUserPosition infoId:{}", infoId);
|
|
|
|
LOGGER.info("平台用户岗位 SysRefUserPosition infoId:{}", infoId);
|
|
|
|
return refUserPositionRDao.findByProperty("userId",infoId);
|
|
|
|
return refUserPositionRDao.findByProperty("userId", infoId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public List<SysRefUserPosition> findSysRefUserPositionByIdList(List<Long> idList) {
|
|
|
|
public List<SysRefUserPosition> findSysRefUserPositionByIdList(List<Long> idList) {
|
|
|
|
if(idList != null && idList.size() > 0){
|
|
|
|
if (idList != null && idList.size() > 0) {
|
|
|
|
DdlPackBean packBean = DdlPackBean.getDdlPackBean();
|
|
|
|
DdlPackBean packBean = DdlPackBean.getDdlPackBean();
|
|
|
|
DdlPreparedPack.getInPackList(idList,"positionId",packBean);
|
|
|
|
DdlPreparedPack.getInPackList(idList, "positionId", packBean);
|
|
|
|
return refUserPositionRDao.findByHqlWhere(packBean);
|
|
|
|
return refUserPositionRDao.findByHqlWhere(packBean);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
@ -645,9 +653,9 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void checkSysUserOnly(SysUser user) {
|
|
|
|
public void checkSysUserOnly(SysUser user) {
|
|
|
|
if(user != null){
|
|
|
|
if (user != null) {
|
|
|
|
// 登录名唯一教研
|
|
|
|
// 登录名唯一教研
|
|
|
|
if(!checkSysUserLoginName(user.getUserLoginName(), user.getId() == null ? 0 : user.getId())){
|
|
|
|
if (!checkSysUserLoginName(user.getUserLoginName(), user.getId() == null ? 0 : user.getId())) {
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION_DATA_EXIT.getCode())
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION_DATA_EXIT.getCode())
|
|
|
@ -679,7 +687,7 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
// 工号唯一教研
|
|
|
|
// 工号唯一教研
|
|
|
|
if(!checkSysUserEmpNo(user.getUserEmpNo(),user.getUserInfoId() == null ? 0 : user.getUserInfoId())){
|
|
|
|
if (!checkSysUserEmpNo(user.getUserEmpNo(), user.getUserInfoId() == null ? 0 : user.getUserInfoId())) {
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION_DATA_EXIT.getCode())
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION_DATA_EXIT.getCode())
|
|
|
@ -695,13 +703,13 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
public Integer checkSysUserResetPassword(SysUser user) {
|
|
|
|
public Integer checkSysUserResetPassword(SysUser user) {
|
|
|
|
LOGGER.info("平台用户岗位 SysUser user:{}", user);
|
|
|
|
LOGGER.info("平台用户岗位 SysUser user:{}", user);
|
|
|
|
Integer num = 0;
|
|
|
|
Integer num = 0;
|
|
|
|
if(user != null){
|
|
|
|
if (user != null) {
|
|
|
|
String redisKey = CommonConstWords.REDIS_PREFIX_USER_RESET_PASSWORD + ":" + TimeTool.getToday() + ":" + user.getId();
|
|
|
|
String redisKey = CommonConstWords.REDIS_PREFIX_USER_RESET_PASSWORD + ":" + TimeTool.getToday() + ":" + user.getId();
|
|
|
|
Object redisValue = redisCore.getObject(redisKey);
|
|
|
|
Object redisValue = redisCore.getObject(redisKey);
|
|
|
|
num = redisValue == null ? 1 : Integer.parseInt(redisValue.toString()) + 1;
|
|
|
|
num = redisValue == null ? 1 : Integer.parseInt(redisValue.toString()) + 1;
|
|
|
|
|
|
|
|
|
|
|
|
int numMax = RedisCacheTool.getSysConfigIntVal(CommonConstWords.CONFIG_PWD_RESET_PASSWORD, CommonConstWords.CONFIG_PWD_RESET_PASSWORD_DEFAULT);
|
|
|
|
int numMax = RedisCacheTool.getSysConfigIntVal(CommonConstWords.CONFIG_PWD_RESET_PASSWORD, CommonConstWords.CONFIG_PWD_RESET_PASSWORD_DEFAULT);
|
|
|
|
if(num > numMax){
|
|
|
|
if (num > numMax) {
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
|
|
|
|
.setErrorCode(ImppExceptionEnum.USER_PERMISSION_RUN_OUT.getCode())
|
|
|
|
.setErrorCode(ImppExceptionEnum.USER_PERMISSION_RUN_OUT.getCode())
|
|
|
@ -709,7 +717,7 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
.setErrorSolution("请明日再次使用")
|
|
|
|
.setErrorSolution("请明日再次使用")
|
|
|
|
.build();
|
|
|
|
.build();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
redisCore.putObject(redisKey,num,CommonConstWords.REDIS_TIME_DAY_ONE);
|
|
|
|
redisCore.putObject(redisKey, num, CommonConstWords.REDIS_TIME_DAY_ONE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return num;
|
|
|
|
return num;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -718,16 +726,16 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
public void checkSysPositionRef(Long positionId) {
|
|
|
|
public void checkSysPositionRef(Long positionId) {
|
|
|
|
LOGGER.info("平台岗位 SysPosition positionId:{}", positionId);
|
|
|
|
LOGGER.info("平台岗位 SysPosition positionId:{}", positionId);
|
|
|
|
|
|
|
|
|
|
|
|
if(positionId != null){
|
|
|
|
if (positionId != null) {
|
|
|
|
SysPosition sp = new SysPosition();
|
|
|
|
SysPosition sp = new SysPosition();
|
|
|
|
sp.setParentId(positionId);
|
|
|
|
sp.setParentId(positionId);
|
|
|
|
|
|
|
|
|
|
|
|
List<SysPosition> positionList = positionService.findAllByBean(sp);
|
|
|
|
List<SysPosition> positionList = positionService.findAllByBean(sp);
|
|
|
|
if (positionList!= null && positionList.size() >= 1) {
|
|
|
|
if (positionList != null && positionList.size() >= 1) {
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
|
|
|
.setErrorDetail("存在岗位信息["+positionList.get(0).getName()+"]无法删除!")
|
|
|
|
.setErrorDetail("存在岗位信息[" + positionList.get(0).getName() + "]无法删除!")
|
|
|
|
.setErrorSolution("请先删除子集信息在操作")
|
|
|
|
.setErrorSolution("请先删除子集信息在操作")
|
|
|
|
.build();
|
|
|
|
.build();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -745,7 +753,7 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
|
|
|
.setErrorDetail("存在用户信息["+userInfoList.get(0).getName()+"]无法删除!")
|
|
|
|
.setErrorDetail("存在用户信息[" + userInfoList.get(0).getName() + "]无法删除!")
|
|
|
|
.setErrorSolution("请先删除用户引用信息再操作")
|
|
|
|
.setErrorSolution("请先删除用户引用信息再操作")
|
|
|
|
.build();
|
|
|
|
.build();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -756,13 +764,13 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
public void checkSysDepartmentRef(Long departmentId) {
|
|
|
|
public void checkSysDepartmentRef(Long departmentId) {
|
|
|
|
LOGGER.info("平台部门 SysDepartment departmentId:{}", departmentId);
|
|
|
|
LOGGER.info("平台部门 SysDepartment departmentId:{}", departmentId);
|
|
|
|
|
|
|
|
|
|
|
|
if(departmentId != null){
|
|
|
|
if (departmentId != null) {
|
|
|
|
List<SysDepartment> departmentList = departmentService.findAllByBean(new SysDepartment(null,departmentId,null));
|
|
|
|
List<SysDepartment> departmentList = departmentService.findAllByBean(new SysDepartment(null, departmentId, null));
|
|
|
|
if (departmentList != null && departmentList.size() >= 1) {
|
|
|
|
if (departmentList != null && departmentList.size() >= 1) {
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
|
|
|
.setErrorDetail("存在相关部门信息["+departmentList.get(0).getName()+"]无法删除!")
|
|
|
|
.setErrorDetail("存在相关部门信息[" + departmentList.get(0).getName() + "]无法删除!")
|
|
|
|
.setErrorSolution("请先删除子集信息在操作")
|
|
|
|
.setErrorSolution("请先删除子集信息在操作")
|
|
|
|
.build();
|
|
|
|
.build();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -772,7 +780,7 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
|
|
|
.setErrorDetail("存在用户信息["+userInfoList.get(0).getName()+"]无法删除!")
|
|
|
|
.setErrorDetail("存在用户信息[" + userInfoList.get(0).getName() + "]无法删除!")
|
|
|
|
.setErrorSolution("请先删除用户引用信息再操作")
|
|
|
|
.setErrorSolution("请先删除用户引用信息再操作")
|
|
|
|
.build();
|
|
|
|
.build();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -782,7 +790,7 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
|
|
|
.setErrorDetail("存在账号信息["+userList.get(0).getUserLoginName()+"]无法删除!")
|
|
|
|
.setErrorDetail("存在账号信息[" + userList.get(0).getUserLoginName() + "]无法删除!")
|
|
|
|
.setErrorSolution("请先删除账号引用信息再操作")
|
|
|
|
.setErrorSolution("请先删除账号引用信息再操作")
|
|
|
|
.build();
|
|
|
|
.build();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -793,7 +801,7 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
public void checkSysOrganizeRef(Long organizeId) {
|
|
|
|
public void checkSysOrganizeRef(Long organizeId) {
|
|
|
|
LOGGER.info("平台部门 SysOrganize organizeId:{}", organizeId);
|
|
|
|
LOGGER.info("平台部门 SysOrganize organizeId:{}", organizeId);
|
|
|
|
|
|
|
|
|
|
|
|
if(organizeId != null){
|
|
|
|
if (organizeId != null) {
|
|
|
|
SysOrganize org = new SysOrganize();
|
|
|
|
SysOrganize org = new SysOrganize();
|
|
|
|
org.setParentId(organizeId);
|
|
|
|
org.setParentId(organizeId);
|
|
|
|
List<SysOrganize> organizeList = organizeService.findAllByBean(org);
|
|
|
|
List<SysOrganize> organizeList = organizeService.findAllByBean(org);
|
|
|
@ -801,7 +809,7 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
|
|
|
.setErrorDetail("存在相关组织信息["+organizeList.get(0).getName()+"]无法删除!")
|
|
|
|
.setErrorDetail("存在相关组织信息[" + organizeList.get(0).getName() + "]无法删除!")
|
|
|
|
.setErrorSolution("请先删除子集信息在操作")
|
|
|
|
.setErrorSolution("请先删除子集信息在操作")
|
|
|
|
.build();
|
|
|
|
.build();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -816,12 +824,12 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
// .buildSearch();
|
|
|
|
// .buildSearch();
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
List<SysDepartment> departmentList = departmentService.findAllByBean(new SysDepartment(null,null,organizeId));
|
|
|
|
List<SysDepartment> departmentList = departmentService.findAllByBean(new SysDepartment(null, null, organizeId));
|
|
|
|
if (departmentList != null && departmentList.size() >= 1) {
|
|
|
|
if (departmentList != null && departmentList.size() >= 1) {
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
|
|
|
.setErrorDetail("存在部门信息["+departmentList.get(0).getName()+"]无法删除!")
|
|
|
|
.setErrorDetail("存在部门信息[" + departmentList.get(0).getName() + "]无法删除!")
|
|
|
|
.setErrorSolution("请先删除部门引用信息再操作")
|
|
|
|
.setErrorSolution("请先删除部门引用信息再操作")
|
|
|
|
.build();
|
|
|
|
.build();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -831,7 +839,7 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
|
|
|
.setErrorDetail("存在用户信息["+userInfoList.get(0).getName()+"]无法删除!")
|
|
|
|
.setErrorDetail("存在用户信息[" + userInfoList.get(0).getName() + "]无法删除!")
|
|
|
|
.setErrorSolution("请先删除用户引用信息再操作")
|
|
|
|
.setErrorSolution("请先删除用户引用信息再操作")
|
|
|
|
.build();
|
|
|
|
.build();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -841,7 +849,7 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
|
|
|
.setErrorDetail("存在账号信息["+userList.get(0).getUserLoginName()+"]无法删除!")
|
|
|
|
.setErrorDetail("存在账号信息[" + userList.get(0).getUserLoginName() + "]无法删除!")
|
|
|
|
.setErrorSolution("请先删除账号引用信息再操作")
|
|
|
|
.setErrorSolution("请先删除账号引用信息再操作")
|
|
|
|
.build();
|
|
|
|
.build();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -954,18 +962,18 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void refreshRefSysUserDepartment(Long userId, Long[] departmentIds) {
|
|
|
|
public void refreshRefSysUserDepartment(Long userId, Long[] departmentIds) {
|
|
|
|
LOGGER.info("账号部门信息 SysUser userInfoId:{} departmentIds:{}",userId,departmentIds);
|
|
|
|
LOGGER.info("账号部门信息 SysUser userInfoId:{} departmentIds:{}", userId, departmentIds);
|
|
|
|
|
|
|
|
|
|
|
|
SysUser user = userRDao.getById(userId);
|
|
|
|
SysUser user = userRDao.getById(userId);
|
|
|
|
if(user != null ){
|
|
|
|
if (user != null) {
|
|
|
|
// 删除用户部门关系
|
|
|
|
// 删除用户部门关系
|
|
|
|
refUserDepartmentRDao.deleteByProperty("userId",user.getId());
|
|
|
|
refUserDepartmentRDao.deleteByProperty("userId", user.getId());
|
|
|
|
|
|
|
|
|
|
|
|
if(departmentIds.length > 0){
|
|
|
|
if (departmentIds.length > 0) {
|
|
|
|
// 查询部门信息
|
|
|
|
// 查询部门信息
|
|
|
|
List<SysDepartment> departmentList = departmentService.findByIdList(Arrays.asList(departmentIds));
|
|
|
|
List<SysDepartment> departmentList = departmentService.findByIdList(Arrays.asList(departmentIds));
|
|
|
|
|
|
|
|
|
|
|
|
if(departmentList != null && departmentList.size() >0){
|
|
|
|
if (departmentList != null && departmentList.size() > 0) {
|
|
|
|
List<SysRefUserDepartment> list = new ArrayList<>();
|
|
|
|
List<SysRefUserDepartment> list = new ArrayList<>();
|
|
|
|
SysRefUserDepartment ref = null;
|
|
|
|
SysRefUserDepartment ref = null;
|
|
|
|
for (SysDepartment department : departmentList) {
|
|
|
|
for (SysDepartment department : departmentList) {
|
|
|
@ -986,7 +994,7 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
refUserDepartmentRDao.saveAll(list);
|
|
|
|
refUserDepartmentRDao.saveAll(list);
|
|
|
|
userRDao.save(user);
|
|
|
|
userRDao.save(user);
|
|
|
|
|
|
|
|
|
|
|
|
LOGGER.info("账号部门信息 SysUserInfo RefUserDepartmentRDao Insert Size :{}",list.size());
|
|
|
|
LOGGER.info("账号部门信息 SysUserInfo RefUserDepartmentRDao Insert Size :{}", list.size());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1028,12 +1036,12 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
List<String> roleRdds = refUserRoles.stream().map(SysRefUserRole::getRoleNameRdd).collect(Collectors.toList());
|
|
|
|
List<String> roleRdds = refUserRoles.stream().map(SysRefUserRole::getRoleNameRdd).collect(Collectors.toList());
|
|
|
|
currentRole = StringUtils.join(roleRdds, ",");
|
|
|
|
currentRole = StringUtils.join(roleRdds, ",");
|
|
|
|
SysLogRoleChange logRoleChange=new SysLogRoleChange();
|
|
|
|
SysLogRoleChange logRoleChange = new SysLogRoleChange();
|
|
|
|
logRoleChange.setUserName(user.getUserName());
|
|
|
|
logRoleChange.setUserName(user.getUserName());
|
|
|
|
logRoleChange.setUserId(userId);
|
|
|
|
logRoleChange.setUserId(userId);
|
|
|
|
logRoleChange.setPreviousRoles(previousRole);
|
|
|
|
logRoleChange.setPreviousRoles(previousRole);
|
|
|
|
logRoleChange.setCurrentRoles(currentRole);
|
|
|
|
logRoleChange.setCurrentRoles(currentRole);
|
|
|
|
ConvertBean.serviceModelInitialize(logRoleChange,AuthUtil.getSessionUser().getUserName());
|
|
|
|
ConvertBean.serviceModelInitialize(logRoleChange, AuthUtil.getSessionUser().getUserName());
|
|
|
|
logRoleChangeRepository.save(logRoleChange);
|
|
|
|
logRoleChangeRepository.save(logRoleChange);
|
|
|
|
|
|
|
|
|
|
|
|
refUserRoleRDao.saveAll(refUserRoles);
|
|
|
|
refUserRoleRDao.saveAll(refUserRoles);
|
|
|
@ -1044,18 +1052,18 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void refreshUpdateRefSysUserInfoDepartment(Long userInfoId, Long[] departmentIds) {
|
|
|
|
public void refreshUpdateRefSysUserInfoDepartment(Long userInfoId, Long[] departmentIds) {
|
|
|
|
LOGGER.info("用户部门关系信息 SysUser userInfoId:{} departmentIds:{}",userInfoId,departmentIds);
|
|
|
|
LOGGER.info("用户部门关系信息 SysUser userInfoId:{} departmentIds:{}", userInfoId, departmentIds);
|
|
|
|
|
|
|
|
|
|
|
|
SysUserInfo info = userInfoRDao.getById(userInfoId);
|
|
|
|
SysUserInfo info = userInfoRDao.getById(userInfoId);
|
|
|
|
if(info != null ){
|
|
|
|
if (info != null) {
|
|
|
|
// 删除用户部门关系
|
|
|
|
// 删除用户部门关系
|
|
|
|
refUserInfoDepartmentRDao.deleteByProperty("userId",info.getId());
|
|
|
|
refUserInfoDepartmentRDao.deleteByProperty("userId", info.getId());
|
|
|
|
|
|
|
|
|
|
|
|
if(departmentIds.length > 0){
|
|
|
|
if (departmentIds.length > 0) {
|
|
|
|
// 查询部门信息
|
|
|
|
// 查询部门信息
|
|
|
|
List<SysDepartment> departmentList = departmentService.findByIdList(Arrays.asList(departmentIds));
|
|
|
|
List<SysDepartment> departmentList = departmentService.findByIdList(Arrays.asList(departmentIds));
|
|
|
|
|
|
|
|
|
|
|
|
if(departmentList != null && departmentList.size() >0){
|
|
|
|
if (departmentList != null && departmentList.size() > 0) {
|
|
|
|
List<SysRefUserInfoDepartment> list = new ArrayList<>();
|
|
|
|
List<SysRefUserInfoDepartment> list = new ArrayList<>();
|
|
|
|
SysRefUserInfoDepartment ref = null;
|
|
|
|
SysRefUserInfoDepartment ref = null;
|
|
|
|
for (SysDepartment department : departmentList) {
|
|
|
|
for (SysDepartment department : departmentList) {
|
|
|
@ -1076,10 +1084,10 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
refUserInfoDepartmentRDao.saveAll(list);
|
|
|
|
refUserInfoDepartmentRDao.saveAll(list);
|
|
|
|
userInfoRDao.save(info);
|
|
|
|
userInfoRDao.save(info);
|
|
|
|
|
|
|
|
|
|
|
|
LOGGER.info("用户部门关系信息 SysUserInfo RefUserDepartmentRDao Insert Size :{}",list.size());
|
|
|
|
LOGGER.info("用户部门关系信息 SysUserInfo RefUserDepartmentRDao Insert Size :{}", list.size());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}else {
|
|
|
|
} else {
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
|
|
|
|
.setErrorCode(cn.estsh.impp.framework.boot.exception.ImppExceptionEnum.VARIFY_EXCEPTION_DATA_NOT_EXIT.getCode())
|
|
|
|
.setErrorCode(cn.estsh.impp.framework.boot.exception.ImppExceptionEnum.VARIFY_EXCEPTION_DATA_NOT_EXIT.getCode())
|
|
|
@ -1131,19 +1139,19 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void refreshRefSysUserInfoPosition(Long userInfoId, Long[] positionIds) {
|
|
|
|
public void refreshRefSysUserInfoPosition(Long userInfoId, Long[] positionIds) {
|
|
|
|
LOGGER.info("用户岗位关系信息 RefSysUserInfoPosition userInfoId:{} positionIds:{} ",userInfoId,positionIds);
|
|
|
|
LOGGER.info("用户岗位关系信息 RefSysUserInfoPosition userInfoId:{} positionIds:{} ", userInfoId, positionIds);
|
|
|
|
|
|
|
|
|
|
|
|
SysUserInfo userInfo = userInfoRDao.getById(userInfoId);
|
|
|
|
SysUserInfo userInfo = userInfoRDao.getById(userInfoId);
|
|
|
|
if(userInfo != null ){
|
|
|
|
if (userInfo != null) {
|
|
|
|
// 删除用户岗位关系
|
|
|
|
// 删除用户岗位关系
|
|
|
|
refUserPositionRDao.deleteByProperty("userId",userInfo.getId());
|
|
|
|
refUserPositionRDao.deleteByProperty("userId", userInfo.getId());
|
|
|
|
|
|
|
|
|
|
|
|
if(positionIds.length > 0){
|
|
|
|
if (positionIds.length > 0) {
|
|
|
|
List<SysPosition> positionList = positionService.findByIdList(Arrays.asList(positionIds));
|
|
|
|
List<SysPosition> positionList = positionService.findByIdList(Arrays.asList(positionIds));
|
|
|
|
|
|
|
|
|
|
|
|
if(positionList != null && positionList.size() >0){
|
|
|
|
if (positionList != null && positionList.size() > 0) {
|
|
|
|
List<SysRefUserPosition> list = new ArrayList<>();
|
|
|
|
List<SysRefUserPosition> list = new ArrayList<>();
|
|
|
|
SysRefUserPosition ref = null;
|
|
|
|
SysRefUserPosition ref = null;
|
|
|
|
for (SysPosition position : positionList) {
|
|
|
|
for (SysPosition position : positionList) {
|
|
|
@ -1161,10 +1169,10 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
refUserPositionRDao.saveAll(list);
|
|
|
|
refUserPositionRDao.saveAll(list);
|
|
|
|
userInfoRDao.save(userInfo);
|
|
|
|
userInfoRDao.save(userInfo);
|
|
|
|
|
|
|
|
|
|
|
|
LOGGER.info("用户岗位关系信息 SysUserInfo RefUserPositionRDao Insert Size :{}",list.size());
|
|
|
|
LOGGER.info("用户岗位关系信息 SysUserInfo RefUserPositionRDao Insert Size :{}", list.size());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}else {
|
|
|
|
} else {
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION_DATA_NOT_EXIT.getCode())
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION_DATA_NOT_EXIT.getCode())
|
|
|
@ -1183,18 +1191,19 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 校验密码长度
|
|
|
|
* 校验密码长度
|
|
|
|
|
|
|
|
*
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private boolean checkPasswordLength(SysConfig config,String password){
|
|
|
|
private boolean checkPasswordLength(SysConfig config, String password) {
|
|
|
|
if(config != null){
|
|
|
|
if (config != null) {
|
|
|
|
if(config.getConfigValue() == null || config.getConfigType().equals(ImppEnumUtil.SYS_VALUE_TYPE.NUMBER.getValue())){
|
|
|
|
if (config.getConfigValue() == null || config.getConfigType().equals(ImppEnumUtil.SYS_VALUE_TYPE.NUMBER.getValue())) {
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
|
|
|
|
.setErrorCode(ImppExceptionEnum.NOT_CONFIG_EXCEPTION.getCode())
|
|
|
|
.setErrorCode(ImppExceptionEnum.NOT_CONFIG_EXCEPTION.getCode())
|
|
|
|
.setErrorDetail("系统配置格式错误(密码长度)")
|
|
|
|
.setErrorDetail("系统配置格式错误(密码长度)")
|
|
|
|
.setErrorSolution("请先配置系统参数")
|
|
|
|
.setErrorSolution("请先配置系统参数")
|
|
|
|
.build();
|
|
|
|
.build();
|
|
|
|
}else {
|
|
|
|
} else {
|
|
|
|
int length = Integer.parseInt(config.getConfigValue());
|
|
|
|
int length = Integer.parseInt(config.getConfigValue());
|
|
|
|
return password.trim().length() >= length;
|
|
|
|
return password.trim().length() >= length;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1204,20 +1213,21 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 校验密码小写
|
|
|
|
* 校验密码小写
|
|
|
|
|
|
|
|
*
|
|
|
|
* @param password
|
|
|
|
* @param password
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private boolean checkPasswordLowerEnglish(SysConfig config,String password){
|
|
|
|
private boolean checkPasswordLowerEnglish(SysConfig config, String password) {
|
|
|
|
if(config != null){
|
|
|
|
if (config != null) {
|
|
|
|
if(config.getConfigValue() == null || config.getConfigType().equals(ImppEnumUtil.SYS_VALUE_TYPE.SWITCH.getValue())){
|
|
|
|
if (config.getConfigValue() == null || config.getConfigType().equals(ImppEnumUtil.SYS_VALUE_TYPE.SWITCH.getValue())) {
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
|
|
|
|
.setErrorCode(ImppExceptionEnum.NOT_CONFIG_EXCEPTION.getCode())
|
|
|
|
.setErrorCode(ImppExceptionEnum.NOT_CONFIG_EXCEPTION.getCode())
|
|
|
|
.setErrorDetail("系统配置格式错误(密码英文小写配置)")
|
|
|
|
.setErrorDetail("系统配置格式错误(密码英文小写配置)")
|
|
|
|
.setErrorSolution("请先配置系统参数")
|
|
|
|
.setErrorSolution("请先配置系统参数")
|
|
|
|
.build();
|
|
|
|
.build();
|
|
|
|
}else {
|
|
|
|
} else {
|
|
|
|
if(config.getConfigValue().equals(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValueStr())){
|
|
|
|
if (config.getConfigValue().equals(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValueStr())) {
|
|
|
|
return StringTool.isContainLowerCase(password);
|
|
|
|
return StringTool.isContainLowerCase(password);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1227,20 +1237,21 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 校验密码大写
|
|
|
|
* 校验密码大写
|
|
|
|
|
|
|
|
*
|
|
|
|
* @param password
|
|
|
|
* @param password
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private boolean checkPasswordUpperEnglish(SysConfig config,String password){
|
|
|
|
private boolean checkPasswordUpperEnglish(SysConfig config, String password) {
|
|
|
|
if(config != null){
|
|
|
|
if (config != null) {
|
|
|
|
if(config.getConfigValue() == null || config.getConfigType().equals(ImppEnumUtil.SYS_VALUE_TYPE.SWITCH.getValue())){
|
|
|
|
if (config.getConfigValue() == null || config.getConfigType().equals(ImppEnumUtil.SYS_VALUE_TYPE.SWITCH.getValue())) {
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
|
|
|
|
.setErrorCode(ImppExceptionEnum.NOT_CONFIG_EXCEPTION.getCode())
|
|
|
|
.setErrorCode(ImppExceptionEnum.NOT_CONFIG_EXCEPTION.getCode())
|
|
|
|
.setErrorDetail("系统配置格式错误(密码英文大写配置)")
|
|
|
|
.setErrorDetail("系统配置格式错误(密码英文大写配置)")
|
|
|
|
.setErrorSolution("请先配置系统参数")
|
|
|
|
.setErrorSolution("请先配置系统参数")
|
|
|
|
.build();
|
|
|
|
.build();
|
|
|
|
}else {
|
|
|
|
} else {
|
|
|
|
if(config.getConfigValue().equals(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValueStr())){
|
|
|
|
if (config.getConfigValue().equals(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValueStr())) {
|
|
|
|
return StringTool.isContainUpperCase(password);
|
|
|
|
return StringTool.isContainUpperCase(password);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1250,20 +1261,21 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 校验密码大写
|
|
|
|
* 校验密码大写
|
|
|
|
|
|
|
|
*
|
|
|
|
* @param password
|
|
|
|
* @param password
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private boolean checkPasswordNumber(SysConfig config,String password){
|
|
|
|
private boolean checkPasswordNumber(SysConfig config, String password) {
|
|
|
|
if(config != null){
|
|
|
|
if (config != null) {
|
|
|
|
if(config.getConfigValue() == null || config.getConfigType().equals(ImppEnumUtil.SYS_VALUE_TYPE.SWITCH.getValue())){
|
|
|
|
if (config.getConfigValue() == null || config.getConfigType().equals(ImppEnumUtil.SYS_VALUE_TYPE.SWITCH.getValue())) {
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
|
|
|
|
.setErrorCode(ImppExceptionEnum.NOT_CONFIG_EXCEPTION.getCode())
|
|
|
|
.setErrorCode(ImppExceptionEnum.NOT_CONFIG_EXCEPTION.getCode())
|
|
|
|
.setErrorDetail("系统配置格式错误(密码数字配置)")
|
|
|
|
.setErrorDetail("系统配置格式错误(密码数字配置)")
|
|
|
|
.setErrorSolution("请先配置系统参数")
|
|
|
|
.setErrorSolution("请先配置系统参数")
|
|
|
|
.build();
|
|
|
|
.build();
|
|
|
|
}else {
|
|
|
|
} else {
|
|
|
|
if(config.getConfigValue().equals(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValueStr())){
|
|
|
|
if (config.getConfigValue().equals(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValueStr())) {
|
|
|
|
return StringTool.isContainNumber(password);
|
|
|
|
return StringTool.isContainNumber(password);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1273,20 +1285,21 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 校验密码特殊字符
|
|
|
|
* 校验密码特殊字符
|
|
|
|
|
|
|
|
*
|
|
|
|
* @param password
|
|
|
|
* @param password
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private boolean checkPasswordSpecialChar(SysConfig config,String password){
|
|
|
|
private boolean checkPasswordSpecialChar(SysConfig config, String password) {
|
|
|
|
if(config != null){
|
|
|
|
if (config != null) {
|
|
|
|
if(config.getConfigValue() == null || config.getConfigType().equals(ImppEnumUtil.SYS_VALUE_TYPE.SWITCH.getValue())){
|
|
|
|
if (config.getConfigValue() == null || config.getConfigType().equals(ImppEnumUtil.SYS_VALUE_TYPE.SWITCH.getValue())) {
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
|
|
|
|
.setErrorCode(ImppExceptionEnum.NOT_CONFIG_EXCEPTION.getCode())
|
|
|
|
.setErrorCode(ImppExceptionEnum.NOT_CONFIG_EXCEPTION.getCode())
|
|
|
|
.setErrorDetail("系统配置格式错误(密码特殊字符配置)")
|
|
|
|
.setErrorDetail("系统配置格式错误(密码特殊字符配置)")
|
|
|
|
.setErrorSolution("请先配置系统参数")
|
|
|
|
.setErrorSolution("请先配置系统参数")
|
|
|
|
.build();
|
|
|
|
.build();
|
|
|
|
}else {
|
|
|
|
} else {
|
|
|
|
if(config.getConfigValue().equals(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValueStr())){
|
|
|
|
if (config.getConfigValue().equals(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValueStr())) {
|
|
|
|
return StringTool.isConSpeCharacters(password);
|
|
|
|
return StringTool.isConSpeCharacters(password);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1303,88 +1316,91 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private boolean checkSysUserLoginName(String userLoginName, long userId) {
|
|
|
|
private boolean checkSysUserLoginName(String userLoginName, long userId) {
|
|
|
|
int count = 0;
|
|
|
|
int count = 0;
|
|
|
|
if(userId > 0){
|
|
|
|
if (userId > 0) {
|
|
|
|
StringBuffer sw = new StringBuffer();
|
|
|
|
StringBuffer sw = new StringBuffer();
|
|
|
|
HqlPack.getNumEqualPack(CommonEnumUtil.IS_VAILD.VAILD.getValue(),"isValid",sw);
|
|
|
|
HqlPack.getNumEqualPack(CommonEnumUtil.IS_VAILD.VAILD.getValue(), "isValid", sw);
|
|
|
|
HqlPack.getStringEqualPack(userLoginName,"userLoginName",sw);
|
|
|
|
HqlPack.getStringEqualPack(userLoginName, "userLoginName", sw);
|
|
|
|
HqlPack.getNumNOEqualPack(userId,"id",sw);
|
|
|
|
HqlPack.getNumNOEqualPack(userId, "id", sw);
|
|
|
|
count = userRDao.findByHqlWhereCount(sw.toString());
|
|
|
|
count = userRDao.findByHqlWhereCount(sw.toString());
|
|
|
|
|
|
|
|
|
|
|
|
}else{
|
|
|
|
} else {
|
|
|
|
count = userRDao.findByPropertyCount(
|
|
|
|
count = userRDao.findByPropertyCount(
|
|
|
|
new String[]{"userLoginName","isValid"},
|
|
|
|
new String[]{"userLoginName", "isValid"},
|
|
|
|
new Object[]{userLoginName,CommonEnumUtil.IS_VAILD.VAILD.getValue()});
|
|
|
|
new Object[]{userLoginName, CommonEnumUtil.IS_VAILD.VAILD.getValue()});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return count <= 0 ;
|
|
|
|
return count <= 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 用户邮箱唯一检查
|
|
|
|
* 用户邮箱唯一检查
|
|
|
|
|
|
|
|
*
|
|
|
|
* @param email
|
|
|
|
* @param email
|
|
|
|
* @param infoId
|
|
|
|
* @param infoId
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private boolean checkSysUserEmail(String email, long infoId) {
|
|
|
|
private boolean checkSysUserEmail(String email, long infoId) {
|
|
|
|
int count;
|
|
|
|
int count;
|
|
|
|
if(infoId > 0){
|
|
|
|
if (infoId > 0) {
|
|
|
|
StringBuffer sw = new StringBuffer();
|
|
|
|
StringBuffer sw = new StringBuffer();
|
|
|
|
HqlPack.getNumEqualPack(CommonEnumUtil.IS_VAILD.VAILD.getValue(),"isValid",sw);
|
|
|
|
HqlPack.getNumEqualPack(CommonEnumUtil.IS_VAILD.VAILD.getValue(), "isValid", sw);
|
|
|
|
HqlPack.getStringEqualPack(email,"userEmail",sw);
|
|
|
|
HqlPack.getStringEqualPack(email, "userEmail", sw);
|
|
|
|
HqlPack.getNumNOEqualPack(infoId,"userInfoId",sw);
|
|
|
|
HqlPack.getNumNOEqualPack(infoId, "userInfoId", sw);
|
|
|
|
count = userRDao.findByHqlWhereCount(sw.toString());
|
|
|
|
count = userRDao.findByHqlWhereCount(sw.toString());
|
|
|
|
|
|
|
|
|
|
|
|
}else{
|
|
|
|
} else {
|
|
|
|
count = userRDao.findByPropertyCount(
|
|
|
|
count = userRDao.findByPropertyCount(
|
|
|
|
new String[]{"userEmail","isValid"},
|
|
|
|
new String[]{"userEmail", "isValid"},
|
|
|
|
new Object[]{email,CommonEnumUtil.IS_VAILD.VAILD.getValue()});
|
|
|
|
new Object[]{email, CommonEnumUtil.IS_VAILD.VAILD.getValue()});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return count <= 0 ;
|
|
|
|
return count <= 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 手机号码 唯一校验
|
|
|
|
* 手机号码 唯一校验
|
|
|
|
|
|
|
|
*
|
|
|
|
* @param phone
|
|
|
|
* @param phone
|
|
|
|
* @param infoId
|
|
|
|
* @param infoId
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private boolean checkSysUserPhone(String phone, long infoId) {
|
|
|
|
private boolean checkSysUserPhone(String phone, long infoId) {
|
|
|
|
int count;
|
|
|
|
int count;
|
|
|
|
if(infoId > 0){
|
|
|
|
if (infoId > 0) {
|
|
|
|
StringBuffer sw = new StringBuffer();
|
|
|
|
StringBuffer sw = new StringBuffer();
|
|
|
|
HqlPack.getNumEqualPack(CommonEnumUtil.IS_VAILD.VAILD.getValue(),"isValid",sw);
|
|
|
|
HqlPack.getNumEqualPack(CommonEnumUtil.IS_VAILD.VAILD.getValue(), "isValid", sw);
|
|
|
|
HqlPack.getStringEqualPack(phone,"userPhone",sw);
|
|
|
|
HqlPack.getStringEqualPack(phone, "userPhone", sw);
|
|
|
|
HqlPack.getNumNOEqualPack(infoId,"userInfoId",sw);
|
|
|
|
HqlPack.getNumNOEqualPack(infoId, "userInfoId", sw);
|
|
|
|
count = userRDao.findByHqlWhereCount(sw.toString());
|
|
|
|
count = userRDao.findByHqlWhereCount(sw.toString());
|
|
|
|
|
|
|
|
|
|
|
|
}else{
|
|
|
|
} else {
|
|
|
|
count = userRDao.findByPropertyCount(
|
|
|
|
count = userRDao.findByPropertyCount(
|
|
|
|
new String[]{"userPhone","isValid"},
|
|
|
|
new String[]{"userPhone", "isValid"},
|
|
|
|
new Object[]{phone,CommonEnumUtil.IS_VAILD.VAILD.getValue()});
|
|
|
|
new Object[]{phone, CommonEnumUtil.IS_VAILD.VAILD.getValue()});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return count <= 0 ;
|
|
|
|
return count <= 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 工号唯一检查
|
|
|
|
* 工号唯一检查
|
|
|
|
|
|
|
|
*
|
|
|
|
* @param empNo
|
|
|
|
* @param empNo
|
|
|
|
* @param infoId
|
|
|
|
* @param infoId
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private boolean checkSysUserEmpNo(String empNo, long infoId) {
|
|
|
|
private boolean checkSysUserEmpNo(String empNo, long infoId) {
|
|
|
|
int count;
|
|
|
|
int count;
|
|
|
|
if(infoId > 0){
|
|
|
|
if (infoId > 0) {
|
|
|
|
StringBuffer sw = new StringBuffer();
|
|
|
|
StringBuffer sw = new StringBuffer();
|
|
|
|
HqlPack.getNumEqualPack(CommonEnumUtil.IS_VAILD.VAILD.getValue(),"isValid",sw);
|
|
|
|
HqlPack.getNumEqualPack(CommonEnumUtil.IS_VAILD.VAILD.getValue(), "isValid", sw);
|
|
|
|
HqlPack.getStringEqualPack(empNo,"userEmpNo",sw);
|
|
|
|
HqlPack.getStringEqualPack(empNo, "userEmpNo", sw);
|
|
|
|
HqlPack.getNumNOEqualPack(infoId,"userInfoId",sw);
|
|
|
|
HqlPack.getNumNOEqualPack(infoId, "userInfoId", sw);
|
|
|
|
count = userRDao.findByHqlWhereCount(sw.toString());
|
|
|
|
count = userRDao.findByHqlWhereCount(sw.toString());
|
|
|
|
|
|
|
|
|
|
|
|
}else{
|
|
|
|
} else {
|
|
|
|
count = userRDao.findByPropertyCount(
|
|
|
|
count = userRDao.findByPropertyCount(
|
|
|
|
new String[]{"userEmpNo","isValid"},
|
|
|
|
new String[]{"userEmpNo", "isValid"},
|
|
|
|
new Object[]{empNo,CommonEnumUtil.IS_VAILD.VAILD.getValue()});
|
|
|
|
new Object[]{empNo, CommonEnumUtil.IS_VAILD.VAILD.getValue()});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return count <= 0 ;
|
|
|
|
return count <= 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|