Commit 84bf53fe authored by liqin's avatar liqin 💬

bug fixed

parent 691e614d
...@@ -54,6 +54,9 @@ public abstract class BasePageOrderParam extends BasePageParam { ...@@ -54,6 +54,9 @@ public abstract class BasePageOrderParam extends BasePageParam {
@ApiModelProperty("展板版权方ID") @ApiModelProperty("展板版权方ID")
private String boardCopyrightOwnerId; private String boardCopyrightOwnerId;
@ApiModelProperty(value = "禁用/启用")
private Boolean isPublished;
public void defaultPageSort(OrderItem orderItem) { public void defaultPageSort(OrderItem orderItem) {
this.defaultPageSorts(Collections.singletonList(orderItem)); this.defaultPageSorts(Collections.singletonList(orderItem));
} }
......
...@@ -121,4 +121,12 @@ public class LearningContent implements Serializable { ...@@ -121,4 +121,12 @@ public class LearningContent implements Serializable {
@TableField(exist = false) @TableField(exist = false)
private Integer exhibitionBoardCount; private Integer exhibitionBoardCount;
@ApiModelProperty("展板分类名称集合(列表使用)")
@TableField(exist = false)
private String exhibitionBoardCatNames;
@ApiModelProperty("版权方名称集合(列表使用)")
@TableField(exist = false)
private String copyrightOwnerNames;
} }
...@@ -244,6 +244,16 @@ public class ExhibitionBoardController extends BaseController { ...@@ -244,6 +244,16 @@ public class ExhibitionBoardController extends BaseController {
lambdaQueryWrapper.in(ExhibitionBoard::getBoardCopyrightOwnerId, boardCopyrightOwnerIdList); lambdaQueryWrapper.in(ExhibitionBoard::getBoardCopyrightOwnerId, boardCopyrightOwnerIdList);
} }
List<ExhibitionBoard> exhibitionBoardList = exhibitionBoardService.list(); List<ExhibitionBoard> exhibitionBoardList = exhibitionBoardService.list();
for (ExhibitionBoard exhibitionBoard : exhibitionBoardList) {
if (exhibitionBoard.getAssetCopyrightOwnerId() != null) {
String name = this.copyrightOwnerService.getById(exhibitionBoard.getAssetCopyrightOwnerId()).getName();
exhibitionBoard.setBoardCopyrightOwnerName(name);
}
if (exhibitionBoard.getExhibitionBoardCatId() != null) {
String name = this.exhibitionBoardCatService.getById(exhibitionBoard.getExhibitionBoardCatId()).getName();
exhibitionBoard.setExhibitionBoardCatName(name);
}
}
return getResult(exhibitionBoardList); return getResult(exhibitionBoardList);
} }
......
...@@ -42,6 +42,12 @@ import java.util.Map; ...@@ -42,6 +42,12 @@ import java.util.Map;
@Api(tags = {"学习内容操作接口"}) @Api(tags = {"学习内容操作接口"})
public class LearningContentController extends BaseController { public class LearningContentController extends BaseController {
@Resource
private ExhibitionBoardCatService exhibitionBoardCatService;
@Resource
private AssetTypeService assetTypeService;
@Resource
private CopyrightOwnerService copyrightOwnerService;
@Resource @Resource
private LearningContentService learningContentService; private LearningContentService learningContentService;
@Resource @Resource
...@@ -203,6 +209,7 @@ public class LearningContentController extends BaseController { ...@@ -203,6 +209,7 @@ public class LearningContentController extends BaseController {
@ApiImplicitParams(value = { @ApiImplicitParams(value = {
@ApiImplicitParam(name = "_index", value = "分页起始偏移量", paramType = "query", dataType = "Integer"), @ApiImplicitParam(name = "_index", value = "分页起始偏移量", paramType = "query", dataType = "Integer"),
@ApiImplicitParam(name = "_size", value = "返回条数", paramType = "query", dataType = "Integer"), @ApiImplicitParam(name = "_size", value = "返回条数", paramType = "query", dataType = "Integer"),
@ApiImplicitParam(name = "learningProjectId", value = "学习项目ID", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "nameOrCode", value = "名称或编码", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "nameOrCode", value = "名称或编码", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "startDate", value = "创建时间-开始", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "startDate", value = "创建时间-开始", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "endDate", value = "创建时间-结束", paramType = "query", dataType = "String") @ApiImplicitParam(name = "endDate", value = "创建时间-结束", paramType = "query", dataType = "String")
...@@ -210,9 +217,17 @@ public class LearningContentController extends BaseController { ...@@ -210,9 +217,17 @@ public class LearningContentController extends BaseController {
@PostMapping("/getPageList") @PostMapping("/getPageList")
@RequiresPermissions("learning:content:page") @RequiresPermissions("learning:content:page")
@ApiOperation(value = "获取学习内容分页列表", notes = "获取学习内容分页列表") @ApiOperation(value = "获取学习内容分页列表", notes = "获取学习内容分页列表")
public Map<String, Object> getLearningContentPageList(GenericPageParam genericPageParam) { public Map<String, Object> getLearningContentPageList(GenericPageParam genericPageParam, @RequestParam(value = "learningProjectId", required = false) String learningProjectId) {
LambdaQueryWrapper<LearningContent> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<LearningContent> queryWrapper = new LambdaQueryWrapper<>();
// 对名称或编码模糊查询 // 对名称或编码模糊查询
if (StringUtils.isNotBlank(learningProjectId)) {
queryWrapper.like(LearningContent::getLearningProjectId, learningProjectId);
}
// 根据创建时间区间检索
if (genericPageParam.getIsPublished() != null) {
queryWrapper.like(LearningContent::getIsPublished, genericPageParam.getIsPublished());
}
// 对名称或编码模糊查询
if (StringUtils.isNotBlank(genericPageParam.getNameOrCode())) { if (StringUtils.isNotBlank(genericPageParam.getNameOrCode())) {
queryWrapper.like(LearningContent::getName, genericPageParam.getNameOrCode()); queryWrapper.like(LearningContent::getName, genericPageParam.getNameOrCode());
} }
...@@ -228,6 +243,7 @@ public class LearningContentController extends BaseController { ...@@ -228,6 +243,7 @@ public class LearningContentController extends BaseController {
LearningContent::getId, LearningContent::getId,
LearningContent::getName, LearningContent::getName,
LearningContent::getAuditStatus, LearningContent::getAuditStatus,
LearningContent::getIsPublished,
LearningContent::getCreateTime, LearningContent::getCreateTime,
LearningContent::getUpdateTime); LearningContent::getUpdateTime);
Page<LearningContent> page = this.learningContentService.page(getPage(), queryWrapper); Page<LearningContent> page = this.learningContentService.page(getPage(), queryWrapper);
...@@ -235,6 +251,22 @@ public class LearningContentController extends BaseController { ...@@ -235,6 +251,22 @@ public class LearningContentController extends BaseController {
LambdaQueryWrapper<LearningContentBoard> lambdaQueryWrapper = Wrappers.<LearningContentBoard>lambdaQuery().eq(LearningContentBoard::getLearningContentId, learningContent.getId()); LambdaQueryWrapper<LearningContentBoard> lambdaQueryWrapper = Wrappers.<LearningContentBoard>lambdaQuery().eq(LearningContentBoard::getLearningContentId, learningContent.getId());
int exhibitionBoardCount = this.learningContentBoardService.count(lambdaQueryWrapper); int exhibitionBoardCount = this.learningContentBoardService.count(lambdaQueryWrapper);
learningContent.setExhibitionBoardCount(exhibitionBoardCount); learningContent.setExhibitionBoardCount(exhibitionBoardCount);
// LambdaQueryWrapper<LearningContentBoardCat> boardCatLambdaQueryWrapper = Wrappers.<LearningContentBoardCat>lambdaQuery().eq(LearningContentBoardCat::getLearningContentId, learningContent.getId());
// boardCatLambdaQueryWrapper.select(LearningContentBoardCat::getExhibitionBoardCatId);
// List<String> exhibitionBoardCatIdList = this.learningContentBoardCatService.listObjs(boardCatLambdaQueryWrapper, Object::toString);
// List<ExhibitionBoardCat> exhibitionBoardCatList = this.exhibitionBoardCatService.listByIds(exhibitionBoardCatIdList);
// String exhibitionBoardCatNames = exhibitionBoardCatList.stream().map(ExhibitionBoardCat::getName).collect(Collectors.joining("、"));
// learningContent.setExhibitionBoardCatNames(exhibitionBoardCatNames);
//
// LambdaQueryWrapper<LearningContentCopyrightOwner> copyrightOwnerLambdaQueryWrapper = Wrappers.<LearningContentCopyrightOwner>lambdaQuery().eq(LearningContentCopyrightOwner::getLearningContentId, learningContent.getId());
// copyrightOwnerLambdaQueryWrapper.select(LearningContentCopyrightOwner::getCopyrightOwnerId);
// List<String> copyrightOwnerIdList = this.learningContentCopyrightOwnerService.listObjs(copyrightOwnerLambdaQueryWrapper, Object::toString);
// List<CopyrightOwner> copyrightOwnerList = this.copyrightOwnerService.listByIds(copyrightOwnerIdList);
// String copyrightOwnerNames = copyrightOwnerList.stream().map(CopyrightOwner::getName).collect(Collectors.joining("、"));
// learningContent.setCopyrightOwnerNames(copyrightOwnerNames);
learningContent.setExhibitionBoardCount(exhibitionBoardCount);
} }
return getResult(page); return getResult(page);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment