use of com.easy.cloud.core.operator.sysresource.pojo.query.SysResourceQuery in project dq-easy-cloud by dq-open-cloud.
the class SysResourceServiceImpl method findByRoleNos.
@Override
public List<SysResourceDTO> findByRoleNos(List<Integer> roleNos) {
if (EcCollectionsUtils.isEmpty(roleNos)) {
return new ArrayList<>();
}
SysResourceQuery query = new SysResourceQuery();
query.setRoleNos(roleNos);
List<SysResourceEntity> sysRoleEntities = sysResourceDAO.listRoleResourceByQuery(query);
if (EcCollectionsUtils.isEmpty(sysRoleEntities)) {
return new ArrayList<>();
}
return EcJSONUtils.parseArray(sysRoleEntities, SysResourceDTO.class);
}
use of com.easy.cloud.core.operator.sysresource.pojo.query.SysResourceQuery in project dq-easy-cloud by dq-open-cloud.
the class SysResourceServiceImpl method getPermissionTree.
@Override
public EcBaseServiceResult getPermissionTree() {
SysResourceQuery query = new SysResourceQuery();
query.setAvailable(EcBaseConstant.EcAvailableEnum.YES.type());
List<SysResourceEntity> resourceEntities = sysResourceDAO.listByQuery(query);
List<SysResourceDTO> resourceDTOS = EcJSONUtils.parseArray(resourceEntities, SysResourceDTO.class);
for (SysResourceDTO sysResourceDTO : resourceDTOS) {
for (SysResourceDTO sysResourceDTOTemp : resourceDTOS) {
if (EcBaseUtils.equals(sysResourceDTOTemp.getParentNo(), sysResourceDTO.getResourceNo())) {
sysResourceDTO.getChildren().add(sysResourceDTOTemp);
}
}
}
for (SysResourceDTO sysResourceDTO : resourceDTOS) {
if (sysResourceDTO.getParentNo() == 0) {
return EcBaseServiceResult.newInstanceOfSucResult(sysResourceDTO);
}
}
return EcBaseServiceResult.newInstanceOfSuccess();
}
Aggregations