提交 7e80525d 作者: 张小凤

DynamicMappe(update)

上级 3fabc994
...@@ -2,6 +2,7 @@ package com.mmc.csf.release.dao; ...@@ -2,6 +2,7 @@ package com.mmc.csf.release.dao;
import com.mmc.csf.release.entity.forum.*; import com.mmc.csf.release.entity.forum.*;
import com.mmc.csf.release.entity.gambit.ForumGambitDO; import com.mmc.csf.release.entity.gambit.ForumGambitDO;
import com.mmc.csf.release.gambit.dto.ForumGambitDTO;
import com.mmc.csf.release.gambit.dto.PostingLeaderboardDTO; import com.mmc.csf.release.gambit.dto.PostingLeaderboardDTO;
import com.mmc.csf.release.gambit.qo.ForumGambitQO; import com.mmc.csf.release.gambit.qo.ForumGambitQO;
import com.mmc.csf.release.gambit.qo.PostingLeaderboardQO; import com.mmc.csf.release.gambit.qo.PostingLeaderboardQO;
...@@ -195,4 +196,6 @@ public interface DynamicDao { ...@@ -195,4 +196,6 @@ public interface DynamicDao {
void deleteReview(Integer id, Integer userAccountId); void deleteReview(Integer id, Integer userAccountId);
List<PostingLeaderboardDTO> postingLeaderboardCount(PostingLeaderboardQO postingLeaderboardQO); List<PostingLeaderboardDTO> postingLeaderboardCount(PostingLeaderboardQO postingLeaderboardQO);
List<ForumGambitDTO> selectGambitDTO(Integer id);
} }
...@@ -4,6 +4,7 @@ import com.mmc.csf.release.entity.common.BaseDO; ...@@ -4,6 +4,7 @@ import com.mmc.csf.release.entity.common.BaseDO;
import com.mmc.csf.release.forum.dto.DynamicInfoDTO; import com.mmc.csf.release.forum.dto.DynamicInfoDTO;
import com.mmc.csf.release.forum.vo.DynamicVO; import com.mmc.csf.release.forum.vo.DynamicVO;
import com.mmc.csf.release.forum.vo.ForumReviewVO; import com.mmc.csf.release.forum.vo.ForumReviewVO;
import com.mmc.csf.release.gambit.dto.ForumGambitDTO;
import com.mmc.csf.release.model.group.Create; import com.mmc.csf.release.model.group.Create;
import com.mmc.csf.release.model.group.Update; import com.mmc.csf.release.model.group.Update;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -87,6 +88,9 @@ public class ForumDynamicDO extends BaseDO implements Serializable { ...@@ -87,6 +88,9 @@ public class ForumDynamicDO extends BaseDO implements Serializable {
@ApiModelProperty("评论") @ApiModelProperty("评论")
private ForumReviewVO forumReviewVO; private ForumReviewVO forumReviewVO;
@ApiModelProperty("话题列表")
private List<ForumGambitDTO> gambitDTOList;
...@@ -116,6 +120,7 @@ public class ForumDynamicDO extends BaseDO implements Serializable { ...@@ -116,6 +120,7 @@ public class ForumDynamicDO extends BaseDO implements Serializable {
.dynamicPublishTime(this.getCreateTime()) .dynamicPublishTime(this.getCreateTime())
.gambitName(this.gambitName) .gambitName(this.gambitName)
.forumReviewVO(this.forumReviewVO) .forumReviewVO(this.forumReviewVO)
.forumGambitDTOList(this.gambitDTOList)
.build(); .build();
} }
......
...@@ -14,6 +14,7 @@ import com.mmc.csf.release.entity.gambit.ForumAttentionDO; ...@@ -14,6 +14,7 @@ import com.mmc.csf.release.entity.gambit.ForumAttentionDO;
import com.mmc.csf.release.entity.gambit.ForumGambitDO; import com.mmc.csf.release.entity.gambit.ForumGambitDO;
import com.mmc.csf.release.feign.UserAppApi; import com.mmc.csf.release.feign.UserAppApi;
import com.mmc.csf.release.forum.vo.DynamicVO; import com.mmc.csf.release.forum.vo.DynamicVO;
import com.mmc.csf.release.forum.vo.ForumReviewVO;
import com.mmc.csf.release.forum.vo.UserBaseInfoVO; import com.mmc.csf.release.forum.vo.UserBaseInfoVO;
import com.mmc.csf.release.gambit.dto.ForumDynamicGambitDTO; import com.mmc.csf.release.gambit.dto.ForumDynamicGambitDTO;
import com.mmc.csf.release.gambit.dto.ForumGambitDTO; import com.mmc.csf.release.gambit.dto.ForumGambitDTO;
...@@ -243,6 +244,14 @@ public class GambitServiceImpl implements GambitService { ...@@ -243,6 +244,14 @@ public class GambitServiceImpl implements GambitService {
} }
} }
} }
for (DynamicVO dynamicVO : collect) {
ForumReviewVO forumReviewVO = dynamicVO.getForumReviewVO();
Integer userAccountId = forumReviewVO.getUserAccountId();
UserAccountVO info = info(userAccountId);
forumReviewVO.setUserAccountVO(info);
}
return PageResult.buildPage(pageNo, userTopicDynamicsQO.getPageSize(),count,collect); return PageResult.buildPage(pageNo, userTopicDynamicsQO.getPageSize(),count,collect);
} }
@Override @Override
......
...@@ -307,17 +307,22 @@ public class DynamicServiceImpl implements DynamicService { ...@@ -307,17 +307,22 @@ public class DynamicServiceImpl implements DynamicService {
for (ForumDynamicDO forumDynamicDO : forumDynamicList) { for (ForumDynamicDO forumDynamicDO : forumDynamicList) {
Integer id = forumDynamicDO.getDynamicId(); Integer id = forumDynamicDO.getDynamicId();
ArrayList<String> list = new ArrayList<>(); ArrayList<String> list = new ArrayList<>();
List<ForumGambitDO> gambitDOS = dynamicDao.selectGambit(id); // List<ForumGambitDO> gambitDOS = dynamicDao.selectGambit(id);
for (ForumGambitDO gambitDO : gambitDOS) { List<ForumGambitDTO> gambitDOS= dynamicDao.selectGambitDTO(id);
ArrayList<ForumGambitDTO> list1 = new ArrayList<>();
for (ForumGambitDTO gambitDO : gambitDOS) {
if (gambitId!=null){ if (gambitId!=null){
if (gambitDO.getId().equals(gambitId)){ if (gambitDO.getId().equals(gambitId)){
list.add(gambitDO.getGambitName()); list.add(gambitDO.getGambitName());
list1.add(gambitDO);
} }
}else{ }else{
list.add(gambitDO.getGambitName()); list.add(gambitDO.getGambitName());
list1.add(gambitDO);
} }
} }
forumDynamicDO.setGambitName(list); forumDynamicDO.setGambitName(list);
forumDynamicDO.setGambitDTOList(list1);
} }
// 动态id集合 // 动态id集合
......
...@@ -233,6 +233,29 @@ ...@@ -233,6 +233,29 @@
AND fdg.dynamic_id = #{id} AND fdg.dynamic_id = #{id}
</select> </select>
<select id="selectGambitDTO" resultType="com.mmc.csf.release.gambit.dto.ForumGambitDTO">
SELECT DISTINCT
gf.id,
gf.gambit_name,
gf.gambit_icon,
gf.gambit_cover,
gf.post_count,
gf.gambit_property,
gf.user_account_id,
gf.discussion_count
FROM
forum_dynamic_gambit fdg
INNER JOIN forum_gambit gf
WHERE
fdg.gambit_id = gf.id
AND fdg.check_status = 1
AND fdg.dynamic_id = #{id}
</select>
<insert id="insertforumFirstLevelReview" parameterType="com.mmc.csf.release.entity.forum.ForumFirstLevelReviewDO"> <insert id="insertforumFirstLevelReview" parameterType="com.mmc.csf.release.entity.forum.ForumFirstLevelReviewDO">
insert into forum_review(user_account_id,dynamic_id,content,review_id,pid,create_time,update_time) insert into forum_review(user_account_id,dynamic_id,content,review_id,pid,create_time,update_time)
values(#{userAccountId},#{dynamicId},#{content},#{reviewId},#{pid},NOW(),NOW()) values(#{userAccountId},#{dynamicId},#{content},#{reviewId},#{pid},NOW(),NOW())
......
...@@ -219,7 +219,7 @@ ...@@ -219,7 +219,7 @@
<select id="selectGambitListsVO" resultType="com.mmc.csf.release.gambit.dto.ForumGambitDTO"> <select id="selectGambitListsVO" resultType="com.mmc.csf.release.gambit.dto.ForumGambitDTO">
SELECT SELECT
fdg.dynamic_id, fdg.dynamic_id,
fdg.gambit_id, fdg.gambit_id AS id,
fg.gambit_name fg.gambit_name
FROM FROM
forum_dynamic_gambit fdg forum_dynamic_gambit fdg
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论