优化管理模块页面的校验

This commit is contained in:
季圣华
2020-06-07 22:37:44 +08:00
parent 1c74faab7c
commit 6f039191bb
9 changed files with 50 additions and 26 deletions

View File

@@ -65,7 +65,7 @@ public class RoleComponent implements ICommonQuery {
@Override
public int checkIsNameExist(Long id, String name)throws Exception {
return 0;
return roleService.checkIsNameExist(id, name);
}
}

View File

@@ -136,6 +136,18 @@ public class RoleService {
return result;
}
public int checkIsNameExist(Long id, String name) throws Exception{
RoleExample example = new RoleExample();
example.createCriteria().andIdNotEqualTo(id).andNameEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
List<Role> list =null;
try{
list=roleMapper.selectByExample(example);
}catch(Exception e){
JshException.readFail(logger, e);
}
return list==null?0:list.size();
}
public List<Role> findUserRole()throws Exception{
RoleExample example = new RoleExample();
example.setOrderByClause("Id");