feat:优化权限和角色

This commit is contained in:
wangyu 2022-03-08 22:26:40 +08:00
parent 8e058eb5c3
commit 4c518d423f
3 changed files with 17 additions and 1 deletions

View File

@ -4,6 +4,7 @@ import com.flyfish.framework.domain.po.Department;
import com.flyfish.framework.domain.tree.TreeQo;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.StringUtils;
/**
* 部门校区查询实体
@ -18,4 +19,9 @@ public class DepartmentQo extends TreeQo<Department> {
* 额外的参数仅针对getList指定一般用于回显父级部门
*/
private String additional;
@Override
public boolean isEmpty() {
return super.isEmpty() && StringUtils.isBlank(additional);
}
}

View File

@ -36,4 +36,14 @@ public class RoleQo extends NameLikeQo<Role> {
public CriteriaBuilder<Role> criteriaBuilder() {
return super.criteriaBuilder().with("admin", "system");
}
/**
* 因存在不稳定因素永不为空
*
* @return 结果
*/
@Override
public boolean isEmpty() {
return false;
}
}

View File

@ -90,7 +90,7 @@ public class RoleService extends BaseReactiveServiceImpl<Role> {
.flatMapMany(ids -> {
RoleQo qo = (RoleQo) query;
qo.setIds(ids);
if (CollectionUtils.isEmpty(qo.getAdditions())) {
if (CollectionUtils.isNotEmpty(qo.getAdditions())) {
qo.getIds().addAll(qo.getAdditions());
}
return super.getList(qo);