用户管理

角色管理
功能管理
组织管理
部门管理
岗位管理
功能优化
yun-zuoyi
wei.peng 7 years ago
parent fcc72d46eb
commit 4b31fac721

@ -50,6 +50,13 @@ public interface ISysMenuService {
void deleteSysMenuById(String id); void deleteSysMenuById(String id);
/** /**
* id
* @param ids id
* @return
*/
void deleteSysMenuByIds(String[] ids);
/**
* *
* *
* @param sysMenu * @param sysMenu

@ -50,6 +50,13 @@ public interface ISysRoleService {
void deleteSysRoleById(String id); void deleteSysRoleById(String id);
/** /**
* id
* @param ids id
* @return
*/
void deleteSysRoleByIds(String[] ids);
/**
* *
* *
* @param sysRole * @param sysRole

@ -177,6 +177,7 @@ public class DepartmentController {
@ApiOperation(value = "根据id批量删除", notes = "根据id批量删除") @ApiOperation(value = "根据id批量删除", notes = "根据id批量删除")
public ResultBean deleteDepartmentByIds(String[] ids){ public ResultBean deleteDepartmentByIds(String[] ids){
try{ try{
ids = ConvertBean.modelSafeArrayNumber(ids,true);
if(ids.length == 0){ if(ids.length == 0){
throw ImppExceptionBuilder.newInstance() throw ImppExceptionBuilder.newInstance()
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode()) .setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())

@ -46,6 +46,7 @@ public class OrganizeController {
//条件验证 //条件验证
ValidatorBean.beginValid(organize) ValidatorBean.beginValid(organize)
.notNull("name", organize.getName()) .notNull("name", organize.getName())
.notNull("organizeCode", organize.getOrganizeCode())
.notNull("organizeTypeId", organize.getOrganizeTypeId()); .notNull("organizeTypeId", organize.getOrganizeTypeId());
//新增初始化 //新增初始化
@ -72,6 +73,7 @@ public class OrganizeController {
ValidatorBean.beginValid(organize) ValidatorBean.beginValid(organize)
.notNull("id", organize.getId()) .notNull("id", organize.getId())
.notNull("name", organize.getName()) .notNull("name", organize.getName())
.notNull("organizeCode", organize.getOrganizeCode())
.notNull("organizeTypeId", organize.getOrganizeTypeId()); .notNull("organizeTypeId", organize.getOrganizeTypeId());
ConvertBean.modelUpdate(organize, AuthUtil.getSessionUser()); ConvertBean.modelUpdate(organize, AuthUtil.getSessionUser());
@ -185,6 +187,7 @@ public class OrganizeController {
@ApiOperation(value = "根据id批量删除", notes = "根据id批量删除") @ApiOperation(value = "根据id批量删除", notes = "根据id批量删除")
public ResultBean deleteOrganizeByIds(String[] ids){ public ResultBean deleteOrganizeByIds(String[] ids){
try{ try{
ids = ConvertBean.modelSafeArrayNumber(ids,true);
if(ids.length == 0){ if(ids.length == 0){
throw ImppExceptionBuilder.newInstance() throw ImppExceptionBuilder.newInstance()
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode()) .setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())

@ -56,8 +56,9 @@ public class PositionController {
position.setParentId(CommonEnumUtil.PARENT.DEFAULT.getValue()); position.setParentId(CommonEnumUtil.PARENT.DEFAULT.getValue());
} }
positionService.insertPosition(position); Position pos = positionService.insertPosition(position);
return ResultBean.success("添加成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode()); return ResultBean.success("添加成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode())
.setResultObject(pos);
} catch (ImppBusiException busExcep) { } catch (ImppBusiException busExcep) {
LOGGER.error(busExcep.getErrorMsg() + "{}", busExcep.getErrorDetail(), busExcep); LOGGER.error(busExcep.getErrorMsg() + "{}", busExcep.getErrorDetail(), busExcep);
return ResultBean.fail(busExcep.getErrorShow()); return ResultBean.fail(busExcep.getErrorShow());
@ -77,7 +78,7 @@ public class PositionController {
//条件验证 //条件验证
ValidatorBean.beginValid(position) ValidatorBean.beginValid(position)
.notNull("id",position.getId()) .notNull("id",position.getId())
.notNull("positionName",position.getName()) .notNull("name",position.getName())
.notNull("positionCode",position.getPositionCode()); .notNull("positionCode",position.getPositionCode());
//修改初始化 //修改初始化
@ -173,6 +174,7 @@ public class PositionController {
@ApiOperation(value = "根据id批量删除", notes = "根据id批量删除") @ApiOperation(value = "根据id批量删除", notes = "根据id批量删除")
public ResultBean deletePositionByIds(String[] ids){ public ResultBean deletePositionByIds(String[] ids){
try{ try{
ids = ConvertBean.modelSafeArrayNumber(ids,true);
if(ids.length == 0){ if(ids.length == 0){
throw ImppExceptionBuilder.newInstance() throw ImppExceptionBuilder.newInstance()
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode()) .setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())

@ -10,6 +10,7 @@
import cn.estsh.i3plus.pojo.platform.bean.SysMenu; import cn.estsh.i3plus.pojo.platform.bean.SysMenu;
import cn.estsh.impp.framework.boot.auth.AuthUtil; import cn.estsh.impp.framework.boot.auth.AuthUtil;
import cn.estsh.impp.framework.boot.exception.ImppBusiException; import cn.estsh.impp.framework.boot.exception.ImppBusiException;
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
import cn.estsh.impp.framework.boot.exception.ImppExceptionEnum; import cn.estsh.impp.framework.boot.exception.ImppExceptionEnum;
import cn.estsh.impp.framework.boot.util.ResultBean; import cn.estsh.impp.framework.boot.util.ResultBean;
import cn.estsh.impp.framework.boot.util.ValidatorBean; import cn.estsh.impp.framework.boot.util.ValidatorBean;
@ -126,7 +127,7 @@ public class SysMenuController {
@GetMapping(value="/query") @GetMapping(value="/query")
@ApiOperation(value="查询权限",notes="组合查询权限,外带分页功能") @ApiOperation(value="查询权限",notes="组合查询权限,外带分页功能")
public ResultBean queryPosition(SysMenu menu, Pager pager){ public ResultBean querySysMenu(SysMenu menu, Pager pager){
try{ try{
ListPager<SysMenu> listPager = sysMenuService.querySysMenu(menu, pager); ListPager<SysMenu> listPager = sysMenuService.querySysMenu(menu, pager);
@ -187,6 +188,7 @@ public class SysMenuController {
public ResultBean updateBatchStatus(String[] ids,int status) { public ResultBean updateBatchStatus(String[] ids,int status) {
try { try {
// 数据校验 // 数据校验
ids = ConvertBean.modelSafeArrayNumber(ids,true);
ValidatorBean.checkNotNull(ids, "功能id 不能为空"); ValidatorBean.checkNotNull(ids, "功能id 不能为空");
ValidatorBean.checkNotZero(status, "功能状态不能为空"); ValidatorBean.checkNotZero(status, "功能状态不能为空");
@ -202,7 +204,28 @@ public class SysMenuController {
} }
} }
@DeleteMapping(value = "/batch-delete")
@ApiOperation(value = "根据id批量删除", notes = "根据id批量删除")
public ResultBean deleteSysMenuByIds(String[] ids){
try{
ids = ConvertBean.modelSafeArrayNumber(ids,true);
if(ids.length == 0){
throw ImppExceptionBuilder.newInstance()
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
.setErrorDetail("请选择需要删除的资源。")
.build();
}
sysMenuService.deleteSysMenuByIds(ids);
return ResultBean.success("删除成功")
.setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
}catch(ImppBusiException busExcep){
LOGGER.error(busExcep.getErrorMsg() + "{}",busExcep.getErrorDetail(),busExcep);
return ResultBean.fail(busExcep.getErrorShow());
}catch(Exception e){
LOGGER.error(ImppExceptionEnum.SYSTEM_EXCEPTION.getDescription() + "{}",e.getMessage(),e);
return ResultBean.fail().setCode(ImppExceptionEnum.SYSTEM_EXCEPTION.getCode());
}
}
} }

@ -243,11 +243,12 @@ public class SysRoleController {
@ApiOperation(value = "批量新增角色权限关系", notes = "批量新增角色权限关系") @ApiOperation(value = "批量新增角色权限关系", notes = "批量新增角色权限关系")
public ResultBean insertBatchRefMenu(String[] roleIds,String[] menuIds) { public ResultBean insertBatchRefMenu(String[] roleIds,String[] menuIds) {
try { try {
roleIds = ConvertBean.modelSafeArrayNumber(roleIds,true);
menuIds = ConvertBean.modelSafeArrayNumber(menuIds,true);
// 数据校验 // 数据校验
ValidatorBean.checkNotNull(roleIds, "角色roleIds 不能为空"); ValidatorBean.checkNotNull(roleIds, "角色roleIds 不能为空");
roleIds = ConvertBean.modelSafeArrayNumber(roleIds,true);
if(roleIds.length == 0){ if(roleIds.length == 0){
throw ImppExceptionBuilder.newInstance() throw ImppExceptionBuilder.newInstance()
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode()) .setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
@ -267,4 +268,28 @@ public class SysRoleController {
return ResultBean.fail().setCode(ImppExceptionEnum.BUSINESS_EXCEPTION_DATA_ERROR.getCode()); return ResultBean.fail().setCode(ImppExceptionEnum.BUSINESS_EXCEPTION_DATA_ERROR.getCode());
} }
} }
@DeleteMapping(value = "/batch-delete")
@ApiOperation(value = "根据id批量删除", notes = "根据id批量删除")
public ResultBean deleteSysRoleByIds(String[] ids){
try{
ids = ConvertBean.modelSafeArrayNumber(ids,true);
if(ids.length == 0){
throw ImppExceptionBuilder.newInstance()
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
.setErrorDetail("请选择需要删除的资源。")
.build();
}
sysRoleService.deleteSysRoleByIds(ids);
return ResultBean.success("删除成功")
.setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
}catch(ImppBusiException busExcep){
LOGGER.error(busExcep.getErrorMsg() + "{}",busExcep.getErrorDetail(),busExcep);
return ResultBean.fail(busExcep.getErrorShow());
}catch(Exception e){
LOGGER.error(ImppExceptionEnum.SYSTEM_EXCEPTION.getDescription() + "{}",e.getMessage(),e);
return ResultBean.fail().setCode(ImppExceptionEnum.SYSTEM_EXCEPTION.getCode());
}
}
} }

@ -217,6 +217,7 @@ public class SysUserController {
@ApiOperation(value = "根据id批量删除", notes = "根据id批量删除") @ApiOperation(value = "根据id批量删除", notes = "根据id批量删除")
public ResultBean deleteBatchSysUserByIds(String[] ids){ public ResultBean deleteBatchSysUserByIds(String[] ids){
try{ try{
ids = ConvertBean.modelSafeArrayNumber(ids,true);
if(ids.length == 0){ if(ids.length == 0){
throw ImppExceptionBuilder.newInstance() throw ImppExceptionBuilder.newInstance()
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode()) .setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
@ -241,6 +242,8 @@ public class SysUserController {
@ApiOperation(value = "批量修改系统功能状态", notes = "根据ID修改系统功能状态") @ApiOperation(value = "批量修改系统功能状态", notes = "根据ID修改系统功能状态")
public ResultBean updateBatchStatus(String[] ids,int status) { public ResultBean updateBatchStatus(String[] ids,int status) {
try { try {
ids = ConvertBean.modelSafeArrayNumber(ids,true);
// 数据校验 // 数据校验
ValidatorBean.checkNotNull(ids, "功能id 不能为空"); ValidatorBean.checkNotNull(ids, "功能id 不能为空");
ValidatorBean.checkNotZero(status, "功能状态不能为空"); ValidatorBean.checkNotZero(status, "功能状态不能为空");

@ -5,6 +5,7 @@ import cn.estsh.i3plus.pojo.base.bean.ListPager;
import cn.estsh.i3plus.pojo.base.common.Pager; import cn.estsh.i3plus.pojo.base.common.Pager;
import cn.estsh.i3plus.pojo.base.common.PagerHelper; import cn.estsh.i3plus.pojo.base.common.PagerHelper;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil; import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import cn.estsh.i3plus.pojo.base.tool.HqlPack;
import cn.estsh.i3plus.pojo.platform.bean.Department; import cn.estsh.i3plus.pojo.platform.bean.Department;
import cn.estsh.i3plus.pojo.platform.bean.Organize; import cn.estsh.i3plus.pojo.platform.bean.Organize;
import cn.estsh.i3plus.pojo.platform.repository.DepartmentRepository; import cn.estsh.i3plus.pojo.platform.repository.DepartmentRepository;
@ -48,10 +49,10 @@ public class DepartmentService implements IDepartmentService {
if(count <= 0){ if(count <= 0){
//冗余父节点信息 //冗余父节点信息
if (department.getParentId() != null && department.getParentId().intValue() > 0) { if (department.getParentId() != null && department.getParentId() > 0) {
LOGGER.info("部门信息 DEPARTMENT :{}", department.getParentId()); LOGGER.info("部门信息 DEPARTMENT :{}", department.getParentId());
Department parentPosition = departmentRDao.getById(department.getParentId()); Department parentPosition = departmentRDao.getById(department.getParentId());
ValidatorBean.checkNotNull(parentPosition); ValidatorBean.checkNotNull(parentPosition,"上级部门信息不存在");
department.setRedParentName(parentPosition.getName()); department.setRedParentName(parentPosition.getName());
} }
@ -138,7 +139,7 @@ public class DepartmentService implements IDepartmentService {
if (department.getParentId() != null && department.getParentId() > 0) { if (department.getParentId() != null && department.getParentId() > 0) {
LOGGER.info("部门信息 DEPARTMENT :{}", department.getParentId()); LOGGER.info("部门信息 DEPARTMENT :{}", department.getParentId());
Department parentPosition = departmentRDao.getById(department.getParentId()); Department parentPosition = departmentRDao.getById(department.getParentId());
ValidatorBean.checkNotNull(parentPosition); ValidatorBean.checkNotNull(parentPosition,"上级部门信息不存在");
department.setRedParentName(parentPosition.getName()); department.setRedParentName(parentPosition.getName());
} }

@ -61,9 +61,9 @@ public class OrganizeService implements IOrganizeService {
coreTreeService.doValidatorOrganizeParentId(organize); coreTreeService.doValidatorOrganizeParentId(organize);
// 冗余父节点 // 冗余父节点
if(organize.getParentId() != null){ if(organize.getParentId() != null && organize.getParentId() > 0){
Organize org = getOrganizeById(organize.getParentId().toString()); Organize org = getOrganizeById(organize.getParentId().toString());
ValidatorBean.checkNotNull(org); ValidatorBean.checkNotNull(org,"上级组织信息不存在");
organize.setRedParentName(org.getName()); organize.setRedParentName(org.getName());
} }
@ -126,9 +126,9 @@ public class OrganizeService implements IOrganizeService {
long count = organizeRDao.findByPropertyCount("organizeCode", organize.getOrganizeCode()); long count = organizeRDao.findByPropertyCount("organizeCode", organize.getOrganizeCode());
if(count <= 0){ if(count <= 0){
// 冗余信息 // 冗余信息
if(organize.getParentId() != null && organize.getParentId().intValue() > 0){ if(organize.getParentId() != null && organize.getParentId() > 0){
Organize org = getOrganizeById(organize.getParentId().toString()); Organize org = getOrganizeById(organize.getParentId().toString());
ValidatorBean.checkNotNull(org); ValidatorBean.checkNotNull(org,"上级组织信息不存在");
organize.setRedParentName(org.getName()); organize.setRedParentName(org.getName());
} }

@ -51,7 +51,7 @@ public class PositionService implements IPositionService {
LOGGER.info("岗位信息 POSITION parentId:{}", position.getParentId()); LOGGER.info("岗位信息 POSITION parentId:{}", position.getParentId());
Position parentPosition = positionRDao.getById(position.getParentId()); Position parentPosition = positionRDao.getById(position.getParentId());
ValidatorBean.checkNotNull(parentPosition); ValidatorBean.checkNotNull(parentPosition,"上级岗位信息不存在");
position.setRedParentName(parentPosition.getName()); position.setRedParentName(parentPosition.getName());
} }
@ -94,7 +94,7 @@ public class PositionService implements IPositionService {
if (position.getParentId() != null && position.getParentId() > 0) { if (position.getParentId() != null && position.getParentId() > 0) {
LOGGER.info("岗位信息 POSITION parentId:{}", position.getParentId()); LOGGER.info("岗位信息 POSITION parentId:{}", position.getParentId());
Position parentPosition = positionRDao.getById(position.getParentId()); Position parentPosition = positionRDao.getById(position.getParentId());
ValidatorBean.checkNotNull(parentPosition); ValidatorBean.checkNotNull(parentPosition,"上级岗位信息不存在");
position.setRedParentName(parentPosition.getName()); position.setRedParentName(parentPosition.getName());
} }

@ -6,13 +6,14 @@ import cn.estsh.i3plus.pojo.base.common.Pager;
import cn.estsh.i3plus.pojo.base.common.PagerHelper; import cn.estsh.i3plus.pojo.base.common.PagerHelper;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil; import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import cn.estsh.i3plus.pojo.base.tool.HqlPack; import cn.estsh.i3plus.pojo.base.tool.HqlPack;
import cn.estsh.i3plus.pojo.platform.bean.Organize;
import cn.estsh.i3plus.pojo.platform.bean.SessionUser; import cn.estsh.i3plus.pojo.platform.bean.SessionUser;
import cn.estsh.i3plus.pojo.platform.bean.SysMenu; import cn.estsh.i3plus.pojo.platform.bean.SysMenu;
import cn.estsh.i3plus.pojo.platform.repository.RefRoleMenuRepository;
import cn.estsh.i3plus.pojo.platform.repository.SysMenuRepository; import cn.estsh.i3plus.pojo.platform.repository.SysMenuRepository;
import cn.estsh.i3plus.pojo.platform.sqlpack.CoreHqlPack; import cn.estsh.i3plus.pojo.platform.sqlpack.CoreHqlPack;
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder; import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
import cn.estsh.impp.framework.boot.exception.ImppExceptionEnum; import cn.estsh.impp.framework.boot.exception.ImppExceptionEnum;
import cn.estsh.impp.framework.boot.util.ValidatorBean;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -38,6 +39,9 @@ public class SysMenuService implements ISysMenuService {
@Autowired @Autowired
private CoreTreeService coreTreeService; private CoreTreeService coreTreeService;
@Autowired
private RefRoleMenuRepository refRoleMenuRDao;
@Override @Override
public void updateSysMenu(SysMenu sysMenu) { public void updateSysMenu(SysMenu sysMenu) {
LOGGER.info("系统功能 SYS_MENU :{}", sysMenu); LOGGER.info("系统功能 SYS_MENU :{}", sysMenu);
@ -60,6 +64,12 @@ public class SysMenuService implements ISysMenuService {
// 父节点检查 // 父节点检查
coreTreeService.doValidatorSysMenuParentId(sysMenu); coreTreeService.doValidatorSysMenuParentId(sysMenu);
if (sysMenu.getParentId() != null && sysMenu.getParentId() > 0) {
SysMenu parent = sysMenuRDao.getById(sysMenu.getParentId());
ValidatorBean.checkNotNull(parent,"上级权限信息不存在");
sysMenu.setRedParentName(parent.getName());
}
sysMenuRDao.update(sysMenu); sysMenuRDao.update(sysMenu);
sysMenuRDao.updateByProperties("parentId",sysMenu.getId(), sysMenuRDao.updateByProperties("parentId",sysMenu.getId(),
"redParentName",sysMenu.getName()); "redParentName",sysMenu.getName());
@ -105,21 +115,44 @@ public class SysMenuService implements ISysMenuService {
.build(); .build();
} }
refRoleMenuRDao.deleteByProperties("menuId",id);
sysMenuRDao.deleteById(Long.parseLong(id)); sysMenuRDao.deleteById(Long.parseLong(id));
} }
@Override @Override
public void deleteSysMenuByIds(String[] ids) {
LOGGER.info("系统功能 SYS_MENU ids :{}", ids);
long positionCount = sysMenuRDao.findByHqlWhereCount(CoreHqlPack.packHqlIds("parentId",ids));
if (positionCount >= 1) {
throw ImppExceptionBuilder.newInstance()
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
.setErrorDetail("存在相关系统功能信息无法删除!")
.setErrorSolution("请先删除子集信息在操作")
.build();
}else {
Long[] array = new Long[ids.length];
for (int i = 0; i < ids.length; i++) {
array[i] = Long.parseLong(ids[i]);
}
refRoleMenuRDao.deleteByTypeLong("menuId",array);
sysMenuRDao.deleteByIds(array);
}
}
@Override
public SysMenu insertSysMenu(SysMenu sysMenu) { public SysMenu insertSysMenu(SysMenu sysMenu) {
LOGGER.info("系统功能 SYS_MENU :{}", sysMenu); LOGGER.info("系统功能 SYS_MENU :{}", sysMenu);
// 代码唯一校验 // 代码唯一校验
long count = sysMenuRDao.findByPropertyCount("menuCode", sysMenu.getMenuCode()); long count = sysMenuRDao.findByPropertyCount("menuCode", sysMenu.getMenuCode());
if(count <= 0){ if(count <= 0){
if (sysMenu.getParentId() != null && sysMenu.getParentId().intValue() > 0) { if (sysMenu.getParentId() != null && sysMenu.getParentId() > 0) {
SysMenu parent = sysMenuRDao.getById(sysMenu.getParentId()); SysMenu parent = sysMenuRDao.getById(sysMenu.getParentId());
if(null != parent){ ValidatorBean.checkNotNull(parent,"上级权限信息不存在");
sysMenu.setRedParentName(parent.getName()); sysMenu.setRedParentName(parent.getName());
}
} }
return sysMenuRDao.insert(sysMenu); return sysMenuRDao.insert(sysMenu);
}else { }else {

@ -74,9 +74,30 @@ public class SysRoleService implements ISysRoleService {
@Override @Override
public void deleteSysRoleById(String id) { public void deleteSysRoleById(String id) {
LOGGER.info("系统角色 SYS_ROLE Key:{}", id); LOGGER.info("系统角色 SYS_ROLE Key:{}", id);
refRoleMenuRDao.deleteByProperties("roleId",id);
sysRoleRDao.deleteById(Long.parseLong(id)); sysRoleRDao.deleteById(Long.parseLong(id));
} }
@Override
public void deleteSysRoleByIds(String[] ids) {
LOGGER.info("系统角色 SYS_ROLE ids :{}", ids);
long positionCount = sysRoleRDao.findByHqlWhereCount(CoreHqlPack.packHqlIds("parentId",ids));
if (positionCount >= 1) {
throw ImppExceptionBuilder.newInstance()
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
.setErrorDetail("存在相关系统功能信息无法删除!")
.setErrorSolution("请先删除子集信息在操作")
.build();
}else {
Long[] array = new Long[ids.length];
for (int i = 0; i < ids.length; i++) {
array[i] = Long.parseLong(ids[i]);
}
refRoleMenuRDao.deleteByTypeLong("roleId",array);
sysRoleRDao.deleteByIds(array);
}
}
@Override @Override
public SysRole insertSysRole(SysRole sysRole) { public SysRole insertSysRole(SysRole sysRole) {
@ -132,7 +153,7 @@ public class SysRoleService implements ISysRoleService {
if(CommonEnumUtil.METHOD_LEVEL.MODULE.getValue() == menu.getMenuTypeId().intValue()){ if(CommonEnumUtil.METHOD_LEVEL.MODULE.getValue() == menu.getMenuTypeId().intValue()){
moduleListRdd.add(menu.getName()); moduleListRdd.add(menu.getName());
} }
if(CommonEnumUtil.METHOD_LEVEL.BUTTON.getValue() == menu.getMenuTypeId().intValue()){ if(CommonEnumUtil.METHOD_LEVEL.METHOD.getValue() == menu.getMenuTypeId().intValue()){
featuresListRdd.add(menu.getName()); featuresListRdd.add(menu.getName());
} }
} }

@ -117,13 +117,12 @@ public class SysUserService implements ISysUserService {
public void updateBatchSysUserStatus(String[] ids, int status, SessionUser user) { public void updateBatchSysUserStatus(String[] ids, int status, SessionUser user) {
LOGGER.info("平台用户 SYS_USER DELETE By ids :{} status:{}, SessionUser :{}", ids,status,user); LOGGER.info("平台用户 SYS_USER DELETE By ids :{} status:{}, SessionUser :{}", ids,status,user);
// 标记用户已删除
String where = CoreHqlPack.packHqlIds("id", ids); String where = CoreHqlPack.packHqlIds("id", ids);
List<SysUser> list = sysUserRDao.findByHqlWhere(where); List<SysUser> list = sysUserRDao.findByHqlWhere(where);
if(null != list && list.size() > 0){ if(null != list && list.size() > 0){
for (SysUser sysUser : list) { for (SysUser sysUser : list) {
sysUser.setUserStatusId(status); sysUser.setUserStatusId(status);
sysUser.setIsValid(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()); sysUser.setIsValid(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue());
ConvertBean.modelUpdate(sysUser,user); ConvertBean.modelUpdate(sysUser,user);
} }
sysUserRDao.saveAll(list); sysUserRDao.saveAll(list);

Loading…
Cancel
Save