Commit 4e9acb03 by 梅存智

项目评论增加关联业务类型:1活动服务;2新闻资讯;3培训测试;4培训资讯

parent 3fa8e1ed
......@@ -22,6 +22,7 @@ public interface TpCommentClient {
@GetMapping("/tpComment/list")
Page<PageCommentVo> list(
@RequestParam(name = "trainingProjectId")Long trainingProjectId,
@RequestParam(name = "bizType", required = false) Integer bizType,
@RequestParam(name = "accountId")Long accountId,
@RequestParam(name = "pageNo")Integer pageNo,
@RequestParam(name = "pageSize")Integer pageSize,
......
......@@ -10,6 +10,9 @@ public class TrCommentVo {
@ApiModelProperty(value = "培训项目Id 必传",required = true)
Long trainingProjectId;
@ApiModelProperty(value = "关联业务类型:1活动服务;2新闻资讯;3培训测试;4培训资讯")
Integer bizType;
@ApiModelProperty(value = "评论分页参数")
Integer pageNo = 1;
......
......@@ -65,6 +65,8 @@ public class TpCommentVo extends Model<TpCommentVo> {
@ApiModelProperty(value = "用户头像")
private String userAvatar;
@ApiModelProperty(value = "业务类型:1活动服务;2新闻资讯;3培训测试;4培训资讯")
private Integer bizType;
@Override
protected Serializable pkVal() {
......
......@@ -85,13 +85,14 @@ public class TpCommentController {
@GetMapping("/list")
public Page<PageCommentVo> list(
@RequestParam(name = "trainingProjectId") Long trainingProjectId,
@RequestParam(name = "bizType", required = false) Integer bizType,
@RequestParam(name = "accountId") Long accountId,
@RequestParam(name = "pageNo") Integer pageNo,
@RequestParam(name = "pageSize") Integer pageSize,
@RequestParam(name = "type") Integer type
) {
Page<PageCommentVo> page = iTpCommentService.getCommentPage(trainingProjectId, accountId, pageNo, pageSize, type);
Page<PageCommentVo> page = iTpCommentService.getCommentPage(trainingProjectId, bizType, accountId, pageNo, pageSize, type);
String fullName;
String name;
TpCommentReply reply = new TpCommentReply();
......
......@@ -83,6 +83,8 @@ public class TpComment extends Model<TpComment> {
@TableField("user_avatar")
private String userAvatar;
@ApiModelProperty(value = "关联业务类型:1活动服务;2新闻资讯;3培训测试;4培训资讯")
private Integer bizType;
@Override
protected Serializable pkVal() {
......
......@@ -21,12 +21,13 @@ public interface TpCommentMapper extends BaseMapper<TpComment> {
/**
* 培训项目列表分页查询 RowBounds
* @param trainingProjectId
* @param bizType 关联业务类型:1活动服务;2新闻资讯;3培训测试;4培训资讯
* @param rowBounds
* @return
*/
List<PageCommentVo> searchPage(@Param("trainingProjectId") Long trainingProjectId,@Param("accountId") Long accountId, RowBounds rowBounds,@Param("type") Integer type);
List<PageCommentVo> searchPage(@Param("trainingProjectId") Long trainingProjectId, @Param("bizType") Integer bizType, @Param("accountId") Long accountId, RowBounds rowBounds,@Param("type") Integer type);
Integer searchPageCount(@Param("trainingProjectId") Long trainingProjectId,@Param("accountId") Long accountId,@Param("type") Integer type);
Integer searchPageCount(@Param("trainingProjectId") Long trainingProjectId, @Param("bizType") Integer bizType, @Param("accountId") Long accountId,@Param("type") Integer type);
List<PageCommentVo> getList(@Param("trainingProjectId") Long trainingProjectId,@Param("accountId") Long accountId);
List<PageCommentVo> getList(@Param("trainingProjectId") Long trainingProjectId, @Param("bizType") Integer bizType, @Param("accountId") Long accountId);
}
......@@ -98,6 +98,12 @@
AND tuu.`account_id` = #{accountId}
WHERE
c.`training_project_id` = #{trainingProjectId}
<if test="bizType == null">
AND c.biz_type=1
</if>
<if test="bizType != null">
AND c.biz_type=#{bizType}
</if>
AND c.`audit_status` = 0
<if test="type != 0 ">
and c.state=0
......@@ -157,6 +163,12 @@
AND tuu.`account_id` = #{accountId}
WHERE
c.`training_project_id` = #{trainingProjectId}
<if test="bizType == null">
AND c.biz_type=1
</if>
<if test="bizType != null">
AND c.biz_type=#{bizType}
</if>
AND c.`audit_status` = 0
<if test="type != 0 ">
and c.state=0
......@@ -220,6 +232,12 @@
AND tuu.`account_id` = #{accountId}
WHERE
c.`training_project_id` = #{trainingProjectId}
<if test="bizType == null">
AND c.biz_type=1
</if>
<if test="bizType != null">
AND c.biz_type=#{bizType}
</if>
AND c.`audit_status` = 0
GROUP BY
c.`id`
......
......@@ -17,7 +17,7 @@ import com.yizhi.training.application.vo.manage.PageCommentVo;
*/
public interface ITpCommentService extends IService<TpComment> {
Page<PageCommentVo> getCommentPage(Long trainingProjectId,Long accountId, int pageNo, int pageSize,int type);
Page<PageCommentVo> getCommentPage(Long trainingProjectId, Integer bizType, Long accountId, int pageNo, int pageSize,int type);
List<PageCommentVo> getList(Long trainingProjectId,Long accountId);
List<PageCommentVo> getList(Long trainingProjectId, Integer bizType, Long accountId);
}
......@@ -24,17 +24,17 @@ import org.springframework.stereotype.Service;
public class TpCommentServiceImpl extends ServiceImpl<TpCommentMapper, TpComment> implements ITpCommentService {
@Override
public Page<PageCommentVo> getCommentPage(Long trainingProjectId, Long accountId, int pageNo, int pageSize, int type) {
public Page<PageCommentVo> getCommentPage(Long trainingProjectId, Integer bizType, Long accountId, int pageNo, int pageSize, int type) {
Page<PageCommentVo> page = new Page<PageCommentVo>(pageNo, pageSize);
page.setRecords(this.baseMapper.searchPage(trainingProjectId,accountId, new RowBounds(page.getOffset(), page.getLimit()),type));
Integer count = this.baseMapper.searchPageCount(trainingProjectId,accountId,type);
page.setRecords(this.baseMapper.searchPage(trainingProjectId, bizType, accountId, new RowBounds(page.getOffset(), page.getLimit()),type));
Integer count = this.baseMapper.searchPageCount(trainingProjectId, bizType, accountId,type);
page.setTotal(count);
return page;
}
@Override
public List<PageCommentVo> getList(Long trainingProjectId,Long accountId){
List<PageCommentVo> list = this.baseMapper.getList(trainingProjectId, accountId);
public List<PageCommentVo> getList(Long trainingProjectId, Integer bizType, Long accountId){
List<PageCommentVo> list = this.baseMapper.getList(trainingProjectId, bizType, accountId);
return list;
}
}
......@@ -72,7 +72,7 @@ public class CommentListExportAsync extends
fileDir.mkdir();
}
//项目评论开始组装
List<PageCommentVo> list = tpCommentService.getList(trainingProjectId, accountId);
List<PageCommentVo> list = tpCommentService.getList(trainingProjectId, null, accountId);
List<PageCommentVo> listVO = new ArrayList<PageCommentVo>();
TpCommentReply reply=new TpCommentReply();
PageCommentVo vo = new PageCommentVo();
......
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