Commit 4a5f8fa3 by 阳浪

文章咨询三级分类

parent 8c7d0d35
...@@ -19,6 +19,9 @@ public class PublicationParamVO extends ContextVO { ...@@ -19,6 +19,9 @@ public class PublicationParamVO extends ContextVO {
@ApiModelProperty(value="标题") @ApiModelProperty(value="标题")
private String fileName; private String fileName;
@ApiModelProperty(value = "编号")
private String number;
@ApiModelProperty(value="当前页") @ApiModelProperty(value="当前页")
private Integer pageNo; private Integer pageNo;
...@@ -28,6 +31,9 @@ public class PublicationParamVO extends ContextVO { ...@@ -28,6 +31,9 @@ public class PublicationParamVO extends ContextVO {
@ApiModelProperty(value="类型") @ApiModelProperty(value="类型")
private Long typeId; private Long typeId;
@ApiModelProperty(value="类型级别")
private Long level;
@ApiModelProperty(value="发布时间的起点") @ApiModelProperty(value="发布时间的起点")
private Date start; private Date start;
......
...@@ -104,17 +104,22 @@ public class PublicationServiceImpl extends ServiceImpl<PublicationMapper, Publi ...@@ -104,17 +104,22 @@ public class PublicationServiceImpl extends ServiceImpl<PublicationMapper, Publi
Page<Publication> page = new Page<Publication>(vo.getPageNo(), vo.getPageSize()); Page<Publication> page = new Page<Publication>(vo.getPageNo(), vo.getPageSize());
List<Publication> list = null; List<Publication> list = null;
if(vo.getTypeId()!=null) {
DataClassification selectById = dataClassificationService.selectById(vo.getTypeId()); DataClassification selectById = dataClassificationService.selectById(vo.getTypeId());
if (selectById == null) { if (selectById != null) {
return null; if (selectById.getParentId() == 0) {
} vo.setLevel(1L);
if (selectById.getName().equals(SiteConstant.ANNOUNCEMENT) && selectById.getParentId() == 0) { //公告
list = publicationMapper.publicationFirstList(vo, page);
} else if (selectById.getParentId() == 0) {//新闻所有列表
list = publicationMapper.publicationFirstList(vo, page);
} else { } else {
list = publicationMapper.publicationFirstList(vo, page);//新闻分类列表 selectById = dataClassificationService.selectById(selectById.getParentId());
if (selectById.getParentId() == 0) {
vo.setLevel(2L);
} else {
vo.setLevel(3L);
}
} }
}
}
list = publicationMapper.publicationFirstList(vo, page);//新闻分类列表
if (list.size() > 0 && list != null) { if (list.size() > 0 && list != null) {
for (Publication info : list) { for (Publication info : list) {
if (info.getTypeOne() != null && info.getTypeOne() != 0) { if (info.getTypeOne() != null && info.getTypeOne() != 0) {
...@@ -421,15 +426,27 @@ public class PublicationServiceImpl extends ServiceImpl<PublicationMapper, Publi ...@@ -421,15 +426,27 @@ public class PublicationServiceImpl extends ServiceImpl<PublicationMapper, Publi
} }
} }
vo.setTypeId(typeOne); vo.setTypeId(typeOne);
DataClassification selectById = dataClassificationService.selectById(vo.getTypeId());
if (selectById == null) {
return null;
}
//获取所有上架新闻列表 //获取所有上架新闻列表
PublicationParamVO publicationParamVO = new PublicationParamVO(); PublicationParamVO publicationParamVO = new PublicationParamVO();
BeanUtils.copyProperties(vo,publicationParamVO); BeanUtils.copyProperties(vo,publicationParamVO);
publicationParamVO.setState(4); publicationParamVO.setState(4);
Page<Publication> page = new Page<Publication>(vo.getPageNo(), vo.getPageSize()); Page<Publication> page = new Page<Publication>(vo.getPageNo(), vo.getPageSize());
if(vo.getTypeId()!=null) {
DataClassification selectById = dataClassificationService.selectById(vo.getTypeId());
if (selectById != null) {
if (selectById.getParentId() == 0) {
publicationParamVO.setLevel(1L);
} else {
selectById = dataClassificationService.selectById(selectById.getParentId());
if (selectById.getParentId() == 0) {
publicationParamVO.setLevel(2L);
} else {
publicationParamVO.setLevel(3L);
}
}
}
}
List<Publication> list = publicationMapper.publicationFirstList(publicationParamVO, page); List<Publication> list = publicationMapper.publicationFirstList(publicationParamVO, page);
if (list.size() > 0 && list != null) { if (list.size() > 0 && list != null) {
......
...@@ -52,6 +52,18 @@ ...@@ -52,6 +52,18 @@
<if test="start != null"> <if test="start != null">
and a.release_time >= #{start} and a.release_time >= #{start}
</if> </if>
<if test="number != null">
and a.number >= #{number}
</if>
<if test="level == null or level == 1">
and a.type_one=#{typeId}
</if>
<if test="level != null and level == 2">
and a.type_two=#{typeId}
</if>
<if test="level != null and level == 3">
and a.type_three=#{typeId}
</if>
<if test="end != null"> <if test="end != null">
and #{end} >= a.release_time and #{end} >= a.release_time
</if> </if>
......
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