diff --git a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java index 61e46a4b..aa96d1e7 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java @@ -44,6 +44,7 @@ import io.renren.modules.security.user.SecurityUser; import io.renren.modules.sys.dao.SysDeptDao; import io.renren.modules.sys.dao.SysRegionDao; import io.renren.modules.sys.dto.SysUserDTO; +import io.renren.modules.sys.entity.SysDeptEntity; import io.renren.modules.sys.service.SysDeptService; import io.renren.modules.sys.service.SysUserService; import lombok.SneakyThrows; @@ -695,8 +696,24 @@ public class ResourceServiceImpl extends CrudServiceImpl resourceEntityIPage = resourceDao.selectPage(page, queryWrapper); + IPage resourceDTOIPage = new Page<>(); + resourceDTOIPage.setPages(resourceEntityIPage.getPages()); + resourceDTOIPage.setTotal(resourceEntityIPage.getTotal()); + resourceDTOIPage.setCurrent(resourceEntityIPage.getCurrent()); + resourceDTOIPage.setSize(resourceEntityIPage.getSize()); + ArrayList arrayList = new ArrayList<>(); + resourceDTOIPage.setRecords(arrayList); + resourceEntityIPage.getRecords().forEach(item -> { + ResourceDTO resourceDTO = new ResourceDTO(); + BeanUtils.copyProperties(item, resourceDTO); + SysDeptEntity dept = sysDeptDao.getById(resourceDTO.getDeptId()); + resourceDTO.setDeptName(dept == null ? "" : dept.getName()); + arrayList.add(resourceDTO); + }); + return resourceDTOIPage; }