|
|
|
@ -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();
|
|
|
|
|
}
|
|
|
|
|