提交 6ffd9ce5 authored 作者: gongwenjie's avatar gongwenjie

代码修改

上级 67fbc28e
......@@ -29,7 +29,6 @@ public class Department {
@NotNull(message = "部门名称不可为空")
String name;
@ApiModelProperty(value = "部门等级",example = "1")
@NotNull(message = "部门等级不可为空")
String level;
@ApiModelProperty(value = "部门描述",example = "1")
......
......@@ -38,13 +38,6 @@ public class PageResponse<T> implements Serializable {
*/
private List<T> rows;
public void setTotalCount(int totalCount) {
//设置了totalCount就可以计算出总totalPage
this.totalCount = totalCount;
int countRecords = this.getTotalCount();
int totalPages = countRecords % pageSize == 0 ? countRecords / pageSize : (countRecords / pageSize + 1);
setTotalPage(totalPages);
}
/**
* 设置结果 及总页数
......
......@@ -38,6 +38,9 @@ public class DepartmentServiceImpl implements IDepartmentService {
@Override
public Department addDepartments(Department department) {
if(department.getLevel()!=null&&department.getLevel().equals("1")){
return departmentDao.save(department);
}
Optional<Department> optional = departmentDao.findById(department.getParentId());
if(optional.isPresent()){
Department department1 = optional.get();
......
......@@ -98,6 +98,7 @@ public class RoleServiceImpl implements IRoleService {
try {
userRoleDao.deleteAllByRoleId(id);
roleAuthorityDao.deleteAllByRoleId(id);
roleDao.deleteById(id);
return true;
} catch (Exception e) {
logger.error("mongodb删除角色时出错");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论