Commit 1a4dd573 by 裴大威

Merge branch 'zyj-appletnews' into 'master'

1002791资讯新增筛选

See merge request rays/pcloud-book!672
parents 6dcdfbac 167c02fe
......@@ -68,7 +68,9 @@ public interface AppletNewsBiz {
* @param name
* @return
*/
PageBeanNew<AppletNewsDTO> listAppletNews(Integer currentPage, Integer numPerPage, String name);
PageBeanNew<AppletNewsDTO> listAppletNews(Integer currentPage, Integer numPerPage, String name,
Long firstClassify,Long secondClassify,Long gradeLabelId,
Long subjectLabelId,Long rightsClassifyId);
/**
* 获取所有资讯栏目
......
......@@ -5,7 +5,6 @@ import com.pcloud.book.applet.biz.AppletNewsBiz;
import com.pcloud.book.applet.dao.AppletNewsClassifyDao;
import com.pcloud.book.applet.dao.AppletNewsCommentDao;
import com.pcloud.book.applet.dao.AppletNewsDao;
import com.pcloud.book.applet.dto.AppletBooklistClassifyDTO;
import com.pcloud.book.applet.dto.AppletNewsClassifyDTO;
import com.pcloud.book.applet.dto.AppletNewsCommentDTO;
import com.pcloud.book.applet.dto.AppletNewsDTO;
......@@ -24,6 +23,7 @@ import com.pcloud.common.page.PageBeanNew;
import com.pcloud.common.page.PageParam;
import com.pcloud.common.utils.ListUtils;
import com.pcloud.readercenter.wechat.entity.WechatUser;
import org.apache.commons.collections.MapUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -117,9 +117,28 @@ public class AppletNewsBizImpl implements AppletNewsBiz {
}
@Override
public PageBeanNew<AppletNewsDTO> listAppletNews(Integer currentPage, Integer numPerPage, String name) {
Map<String,Object> paramMap = new HashMap<>();
public PageBeanNew<AppletNewsDTO> listAppletNews(Integer currentPage, Integer numPerPage, String name,
Long firstClassify,Long secondClassify,Long gradeLabelId,
Long subjectLabelId,Long rightsClassifyId) {
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("name", name);
paramMap.put("rightsClassifyId", rightsClassifyId);
//处理分类
if (null!=firstClassify){
BaseTempletClassify classify = new BaseTempletClassify();
classify.setFirstClassify(firstClassify);
classify.setSecondClassify(secondClassify);
classify.setGradeLabelId(gradeLabelId);
classify.setSubjectLabelId(subjectLabelId);
rightsSettingBiz.setClassifyAndLabel(classify);
paramMap.put("firstClassify", classify.getFirstClassify());
paramMap.put("secondClassify", classify.getSecondClassify());
paramMap.put("gradeLabelId", classify.getGradeLabelId());
paramMap.put("subjectLabelId", classify.getSubjectLabelId());
}else {
paramMap.put("gradeLabelId", gradeLabelId);
paramMap.put("subjectLabelId", subjectLabelId);
}
PageBeanNew<AppletNewsDTO> pageBeanNew = appletNewsDao.listPageNew(
new PageParam(currentPage,numPerPage) ,paramMap,"listAppletNews");
if (null == pageBeanNew || ListUtils.isEmpty(pageBeanNew.getRecordList())){
......
......@@ -436,12 +436,19 @@ public class AppletHomeFacade {
@RequestHeader("token") String token,
@RequestParam("currentPage") @ApiParam("当前页") Integer currentPage,
@RequestParam("numPerPage") @ApiParam("每页数量") Integer numPerPage,
@RequestParam(value = "name", required = false) @ApiParam("名称查询") String name) throws PermissionException {
@RequestParam(value = "name", required = false) @ApiParam("名称查询") String name,
@RequestParam(value = "firstClassify", required = false) @ApiParam("一级书刊分类") Long firstClassify,
@RequestParam(value = "secondClassify", required = false) @ApiParam("二级书刊分类")Long secondClassify,
@RequestParam(value = "gradeLabelId", required = false) @ApiParam("年级标签")Long gradeLabelId,
@RequestParam(value = "subjectLabelId", required = false) @ApiParam("科目标签")Long subjectLabelId,
@RequestParam(value = "rightsClassifyId", required = false) @ApiParam("权益分类") Long rightsClassifyId
) throws PermissionException {
SessionUtil.getInfoToken4Redis(token);
if (null==currentPage || null == numPerPage){
throw new BookBizException(BookBizException.PARAM_IS_NULL,"缺少分页参数");
}
return new ResponseDto<>(appletNewsBiz.listAppletNews(currentPage, numPerPage, name));
return new ResponseDto<>(appletNewsBiz.listAppletNews(currentPage, numPerPage, name, firstClassify,secondClassify,gradeLabelId,
subjectLabelId,rightsClassifyId));
}
@ApiOperation("客户端资讯列表")
......
......@@ -51,24 +51,13 @@
<if test="source != null">
source = #{source},
</if>
<if test="newsClassifyId != null">
news_classify_id = #{newsClassifyId},
</if>
<if test="proLabelId != null">
pro_label_id = #{proLabelId},
</if>
<if test="depLabelId != null">
dep_label_id = #{depLabelId},
</if>
<if test="purLabelId != null">
pur_label_id = #{purLabelId},
</if>
<if test="type != null">
type = #{type},
</if>
<if test="source != null">
source = #{source},
</if>
digest = #{digest},
pic1 = #{pic1},
pic2 = #{pic2},
......@@ -143,6 +132,21 @@
<if test="showState != null">
AND n.show_state = #{showState}
</if>
<if test="firstClassify!=null">
AND n.first_classify =#{firstClassify}
</if>
<if test="secondClassify!=null">
AND n.second_classify =#{secondClassify}
</if>
<if test="gradeLabelId != null">
AND n.grade_label_id = #{gradeLabelId}
</if>
<if test="subjectLabelId != null">
AND n.subject_label_id = #{subjectLabelId}
</if>
<if test="rightsClassifyId!=null">
AND n.rights_classify_id =#{rightsClassifyId}
</if>
ORDER BY n.create_time DESC
</select>
......
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