|
|
@ -110,6 +110,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, ProjectEntity |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public ProjectVO getProjectAndContentByEmCode(String emCode, ContentDTO content, Query query) { |
|
|
|
public ProjectVO getProjectAndContentByEmCode(String emCode, ContentDTO content, Query query) { |
|
|
|
|
|
|
|
|
|
|
|
LambdaQueryWrapper<ProjectEntity> queryWrapper = Wrappers.<ProjectEntity>lambdaQuery() |
|
|
|
LambdaQueryWrapper<ProjectEntity> queryWrapper = Wrappers.<ProjectEntity>lambdaQuery() |
|
|
|
.eq(ProjectEntity::getEmCode, emCode) |
|
|
|
.eq(ProjectEntity::getEmCode, emCode) |
|
|
|
.eq(ProjectEntity::getStatus, ObjectConstants.ProjectEnableEnum.YES.getEnableType()); |
|
|
|
.eq(ProjectEntity::getStatus, ObjectConstants.ProjectEnableEnum.YES.getEnableType()); |
|
|
@ -127,8 +128,13 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, ProjectEntity |
|
|
|
List<Long> contentIdList = projectContentList.stream().map(ProjectContentEntity::getContentId).collect(Collectors.toList()); |
|
|
|
List<Long> contentIdList = projectContentList.stream().map(ProjectContentEntity::getContentId).collect(Collectors.toList()); |
|
|
|
LambdaQueryWrapper<ContentEntity> wrapper = Condition.getQueryWrapper(BeanUtil.copy(content,ContentEntity.class)).lambda(); |
|
|
|
LambdaQueryWrapper<ContentEntity> wrapper = Condition.getQueryWrapper(BeanUtil.copy(content,ContentEntity.class)).lambda(); |
|
|
|
wrapper.in(CollectionUtil.isNotEmpty(contentIdList),ContentEntity::getId, contentIdList); |
|
|
|
wrapper.in(CollectionUtil.isNotEmpty(contentIdList),ContentEntity::getId, contentIdList); |
|
|
|
IPage page = contentService.page(Condition.getPage(query), wrapper); |
|
|
|
if(-1 == query.getSize()) { |
|
|
|
projectVO.setContentList(ContentWrapper.build().listVO(page.getRecords())); |
|
|
|
List<ContentEntity> contents = contentService.list(wrapper); |
|
|
|
|
|
|
|
projectVO.setContentList(ContentWrapper.build().listVO(contents)); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
IPage page = contentService.page(Condition.getPage(query), wrapper); |
|
|
|
|
|
|
|
projectVO.setContentList(ContentWrapper.build().listVO(page.getRecords())); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return projectVO; |
|
|
|
return projectVO; |
|
|
|
} |
|
|
|
} |
|
|
|