批量删除 提示信息优化

用户登录 登录次数修复
yun-zuoyi
wei.peng 6 years ago
parent a47249a925
commit f9d88b6a93

@ -98,7 +98,8 @@ public class SystemLoginService implements ISystemLoginService {
@Override
@ApiOperation(value = "登录密码错误",notes = "登录密码错误记录错误次数功能")
public Integer doLoginPasswordError(String loginName,String sessionId) {
SysUser user = sysUserRDao.getByProperty("userLoginName",loginName);
SysUser user = sysUserRDao.getByProperty(new String[]{"userLoginName", "isValid"},
new Object[]{loginName, CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()});
if(user != null){
String redisKey = CommonConstWords.USER_LOGIN_ERROR + "_" + sessionId + "_" + user.getId();
Object redisValue = redisCore.getObject(redisKey);

@ -399,12 +399,12 @@ public class PersonnelServiceService implements IPersonnelService {
LOGGER.debug("平台岗位 SysPosition positionId:{}", positionId);
if(positionId != null){
long positionCount = positionRDao.findByPropertyCount("parentId",positionId);
if (positionCount >= 1) {
List<SysPosition> positionList = positionRDao.findByProperty("parentId", positionId);
if (positionList!= null && positionList.size() >= 1) {
throw ImppExceptionBuilder.newInstance()
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
.setErrorDetail("存在相关岗位信息无法删除!")
.setErrorDetail("["+positionList.get(0).getName()+"]存在相关岗位信息无法删除!")
.setErrorSolution("请先删除子集信息在操作")
.build();
}
@ -417,12 +417,12 @@ public class PersonnelServiceService implements IPersonnelService {
// .setErrorSolution("请先删除用户关系信息再操作")
// .build();
// }
long refUserInfoCount = userInfoRDao.findByPropertyCount("positionId",positionId);
if (refUserInfoCount >= 1) {
List<SysUserInfo> userInfoList = userInfoRDao.findByProperty("positionId", positionId);
if (userInfoList != null && userInfoList.size() >= 1) {
throw ImppExceptionBuilder.newInstance()
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
.setErrorDetail("存在用户信息无法删除!")
.setErrorDetail("["+userInfoList.get(0).getName()+"]存在用户信息无法删除!")
.setErrorSolution("请先删除用户引用信息再操作")
.build();
}
@ -434,12 +434,12 @@ public class PersonnelServiceService implements IPersonnelService {
LOGGER.debug("平台部门 SysDepartment departmentId:{}", departmentId);
if(departmentId != null){
long departmentCount = departmentRDao.findByPropertyCount("parentId",departmentId);
if (departmentCount >= 1) {
List<SysDepartment> departmentList = departmentRDao.findByProperty("parentId", departmentId);
if (departmentList != null && departmentList.size() >= 1) {
throw ImppExceptionBuilder.newInstance()
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
.setErrorDetail("存在相关部门信息无法删除!")
.setErrorDetail("["+departmentList.get(0).getName()+"]存在相关部门信息无法删除!")
.setErrorSolution("请先删除子集信息在操作")
.build();
}
@ -452,22 +452,22 @@ public class PersonnelServiceService implements IPersonnelService {
// .setErrorSolution("请先删除用户关系信息再操作")
// .build();
// }
long userInfoCount = userInfoRDao.findByPropertyCount("departmentId",departmentId);
if (userInfoCount >= 1) {
List<SysUserInfo> userInfoList = userInfoRDao.findByProperty("departmentId", departmentId);
if (userInfoList != null && userInfoList.size() >= 1) {
throw ImppExceptionBuilder.newInstance()
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
.setErrorDetail("存在用户信息无法删除!")
.setErrorDetail("["+userInfoList.get(0).getName()+"]存在用户信息无法删除!")
.setErrorSolution("请先删除用户引用信息再操作")
.build();
}
long userCount = userRDao.findByPropertyCount("departmentId",departmentId);
if (userCount >= 1) {
List<SysUser> userList = userRDao.findByProperty("departmentId", departmentId);
if (userList != null && userList.size() >= 1) {
throw ImppExceptionBuilder.newInstance()
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
.setErrorDetail("存在账号信息无法删除!")
.setErrorDetail("["+userList.get(0).getUserLoginName()+"]存在账号信息无法删除!")
.setErrorSolution("请先删除账号引用信息再操作")
.build();
}
@ -479,12 +479,12 @@ public class PersonnelServiceService implements IPersonnelService {
LOGGER.debug("平台部门 SysOrganize organizeId:{}", organizeId);
if(organizeId != null){
long organizeCount = organizeRDao.findByPropertyCount("parentId",organizeId);
if (organizeCount >= 1) {
List<SysOrganize> organizeList = organizeRDao.findByProperty("parentId", organizeId);
if (organizeList != null && organizeList.size() >= 1) {
throw ImppExceptionBuilder.newInstance()
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
.setErrorDetail("存在相关组织信息无法删除!")
.setErrorDetail("["+organizeList.get(0).getName()+"]存在相关组织信息无法删除!")
.setErrorSolution("请先删除子集信息在操作")
.build();
}
@ -499,32 +499,32 @@ public class PersonnelServiceService implements IPersonnelService {
// .build();
// }
long departmentCount = departmentRDao.findByPropertyCount("organizeId",organizeId);
if (departmentCount >= 1) {
List<SysDepartment> departmentList = departmentRDao.findByProperty("organizeId", organizeId);
if (departmentList != null && departmentList.size() >= 1) {
throw ImppExceptionBuilder.newInstance()
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
.setErrorDetail("存在部门信息无法删除!")
.setErrorDetail("["+departmentList.get(0).getName()+"]存在部门信息无法删除!")
.setErrorSolution("请先删除部门引用信息再操作")
.build();
}
long userInfoCount = userInfoRDao.findByPropertyCount("organizeId",organizeId);
if (userInfoCount >= 1) {
List<SysUserInfo> userInfoList = userInfoRDao.findByProperty("organizeId", organizeId);
if (userInfoList != null && userInfoList.size() >= 1) {
throw ImppExceptionBuilder.newInstance()
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
.setErrorDetail("存在用户信息无法删除!")
.setErrorDetail("["+userInfoList.get(0).getName()+"]存在用户信息无法删除!")
.setErrorSolution("请先删除用户引用信息再操作")
.build();
}
long userCount = userRDao.findByPropertyCount("organizeId",organizeId);
if (userCount >= 1) {
List<SysUser> userList = userRDao.findByProperty("organizeId", organizeId);
if (userList != null && userList.size() >= 1) {
throw ImppExceptionBuilder.newInstance()
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
.setErrorDetail("存在账号信息无法删除!")
.setErrorDetail("["+userList.get(0).getUserLoginName()+"]存在账号信息无法删除!")
.setErrorSolution("请先删除账号引用信息再操作")
.build();
}

@ -105,12 +105,12 @@ public class SysDepartmentService implements ISysDepartmentService {
@ApiOperation(value = "删除部门信息",notes = "根据ID 批量删除部门信息")
public void deleteSysDepartmentByIds(Long[] ids) {
LOGGER.info("部门信息 DEPARTMENT ids :{}", ids);
long positionCount = departmentRDao.findByHqlWhereCount(CoreHqlPack.packHqlIds("parentId",ids));
if (positionCount >= 1) {
List<SysDepartment> list = departmentRDao.findByHqlWhere(CoreHqlPack.packHqlIds("parentId", ids));
if (list != null && list.size() >= 1) {
throw ImppExceptionBuilder.newInstance()
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
.setErrorDetail("存在相关部门信息无法删除!")
.setErrorDetail("["+list.get(0).getName()+"]存在相关部门信息无法删除!")
.setErrorSolution("请先删除子集信息在操作")
.build();
}else {

@ -111,12 +111,12 @@ public class SysOrganizeService implements ISysOrganizeService {
@Override
@ApiOperation(value = "删除组织信息",notes = "根据 ID 批量删除组织信息")
public void deleteSysOrganizeByIds(Long[] ids) {
long positionCount = organizeRDao.findByHqlWhereCount(CoreHqlPack.packHqlIds("parentId",ids));
if (positionCount >= 1) {
List<SysOrganize> list = organizeRDao.findByHqlWhere(CoreHqlPack.packHqlIds("parentId", ids));
if (list != null && list.size() >= 1) {
throw ImppExceptionBuilder.newInstance()
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
.setErrorDetail("存在相关组织信息无法删除!")
.setErrorDetail("["+list.get(0).getName()+"]存在相关组织信息无法删除!")
.setErrorSolution("请先删除子集信息在操作")
.build();
}else {

Loading…
Cancel
Save