Commit 4e9acb03 by 梅存智

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

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