Merge branch 'master' into docker_package

This commit is contained in:
wangliwen 2022-09-05 10:03:26 +08:00
commit 72aaa294b5
1 changed files with 18 additions and 1 deletions

View File

@ -44,6 +44,7 @@ import io.renren.modules.security.user.SecurityUser;
import io.renren.modules.sys.dao.SysDeptDao; import io.renren.modules.sys.dao.SysDeptDao;
import io.renren.modules.sys.dao.SysRegionDao; import io.renren.modules.sys.dao.SysRegionDao;
import io.renren.modules.sys.dto.SysUserDTO; 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.SysDeptService;
import io.renren.modules.sys.service.SysUserService; import io.renren.modules.sys.service.SysUserService;
import lombok.SneakyThrows; import lombok.SneakyThrows;
@ -695,8 +696,24 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
queryWrapper.eq(StringUtils.isNotBlank(jsonObject.getString("type")), "type", jsonObject.getString("type")) queryWrapper.eq(StringUtils.isNotBlank(jsonObject.getString("type")), "type", jsonObject.getString("type"))
.eq("del_flag", ResourceEntityDelFlag.NORMAL.getFlag()) .eq("del_flag", ResourceEntityDelFlag.NORMAL.getFlag())
.ne("type", "知识库") .ne("type", "知识库")
.ne("type", "赋能案例")
.orderByDesc("create_date"); .orderByDesc("create_date");
return resourceDao.selectPage(page, queryWrapper); IPage<ResourceEntity> resourceEntityIPage = resourceDao.selectPage(page, queryWrapper);
IPage<ResourceDTO> resourceDTOIPage = new Page<>();
resourceDTOIPage.setPages(resourceEntityIPage.getPages());
resourceDTOIPage.setTotal(resourceEntityIPage.getTotal());
resourceDTOIPage.setCurrent(resourceEntityIPage.getCurrent());
resourceDTOIPage.setSize(resourceEntityIPage.getSize());
ArrayList<ResourceDTO> 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;
} }