提交 c5350372 作者: zhenjie

Merge branch 'develop'

......@@ -18,4 +18,4 @@ patches:
images:
- name: REGISTRY/NAMESPACE/IMAGE:TAG
newName: mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly-dev/ims
newTag: 3b66b1c259021cdfab3b75cb9dd8f0c4489bf08b
newTag: 8e2c74f9ab42367c4683e5bb15ab799b5e3cb71a
......@@ -4,6 +4,7 @@ import com.mmc.csf.common.util.page.PageResult;
import com.mmc.csf.common.util.web.ResultBody;
import com.mmc.csf.release.dao.gambit.GambitDao;
import com.mmc.csf.release.entity.forum.ForumDynamicUserDO;
import com.mmc.csf.release.entity.gambit.ForumAttentionDO;
import com.mmc.csf.release.forum.vo.CommentVO;
import com.mmc.csf.release.forum.vo.DynamicVO;
import com.mmc.csf.release.forum.vo.ReplyToAReviewVO;
......@@ -112,5 +113,13 @@ public class DynamicController extends BaseController {
}
@ApiOperation(value = "new飞手列表是否关注")
@GetMapping("/getPilot")
public ResultBody<ForumAttentionDO> getPilot(@RequestParam Integer userAccountId){
return ResultBody.success(dynamicService.getPilot(userAccountId));
}
}
......@@ -3,6 +3,7 @@ package com.mmc.csf.release.dao;
import java.util.List;
import com.mmc.csf.release.entity.forum.*;
import com.mmc.csf.release.entity.gambit.ForumAttentionDO;
import com.mmc.csf.release.entity.gambit.ForumGambitDO;
import com.mmc.csf.release.gambit.dto.ForumGambitDTO;
import com.mmc.csf.release.gambit.dto.PostingLeaderboardDTO;
......@@ -208,4 +209,8 @@ public interface DynamicDao {
void updateDiscussionCounts(Integer id);
Integer gambitName(String gambitName);
List<ForumAttentionDO> getPilot(Integer userAccountId);
List<ForumAttentionDO> getPilots(Integer userAccountId);
}
......@@ -151,4 +151,6 @@ public interface GambitDao {
List<MyFansDO> myFansLists(UserTopicDynamicsQO userTopicDynamicsQO);
List<ForumAttentionDO> selectAttentionCount(Integer userAccountId, Integer userId);
void insertCount(Integer userAccountId);
}
......@@ -4,6 +4,7 @@ import javax.servlet.http.HttpServletRequest;
import com.mmc.csf.common.util.page.PageResult;
import com.mmc.csf.common.util.web.ResultBody;
import com.mmc.csf.release.entity.gambit.ForumAttentionDO;
import com.mmc.csf.release.forum.vo.CommentVO;
import com.mmc.csf.release.forum.vo.DynamicVO;
import com.mmc.csf.release.gambit.qo.ForumGambitQO;
......@@ -66,4 +67,6 @@ public interface DynamicService {
ResultBody reviewLikes(Integer id, Integer userAccountId, Boolean status);
PageResult postingLeaderboard(PostingLeaderboardQO postingLeaderboardQO);
List<ForumAttentionDO> getPilot(Integer userAccountId);
}
......@@ -442,11 +442,14 @@ public class GambitServiceImpl implements GambitService {
@Override
public ResultBody userMessage(Integer userAccountId,Integer userId) {
ForumCountDO forumCountDO= gambitDao.userMessage(userAccountId);
if (forumCountDO==null){
gambitDao.insertCount(userAccountId);
forumCountDO= gambitDao.userMessage(userAccountId);
}
int i= gambitDao.selectCountAttentions(userAccountId,userId);
int i1 = gambitDao.selectCountAttentionMutualAttention(userId, userAccountId);
UserAccountMessageVo userAccountMessageVo = infoMessage(userAccountId);
forumCountDO.setUserAccountMessageVo(userAccountMessageVo);
// int i = gambitDao.selectCountAttention(userId);
if (i!=0){
forumCountDO.setStatus(true);
}
......
......@@ -296,6 +296,7 @@ public class DynamicServiceImpl implements DynamicService {
Integer pageNo, Integer pageSize, Integer userId, HttpServletRequest request, Integer gambitId,Integer dynId,Integer userAccountIds,
String description,List<String> gambitName) {
Integer tokenUserId =userId;
Integer inUserId =userAccountIds;
int count = dynamicDao.countDynamicList(dynId,userAccountIds,description);
if (count == 0) {
return PageResult.buildPage(pageNo, pageSize, 0);
......@@ -448,15 +449,15 @@ public class DynamicServiceImpl implements DynamicService {
Integer userAccountId = dynamicVO.getUserAccountId();
int countAttention= gambitDao.selectCountAttentions(userAccountId,userId);
// int countA=gambitDao.selectCountAttentions(userId,userAccountId);
List<ForumAttentionDO> forumAttentionDOS = gambitDao.selectAttentionCount(userAccountId, userId);
List<ForumAttentionDO> forumAttentionDOS=null;
if(inUserId==null){
forumAttentionDOS= gambitDao.selectAttentionCount(inUserId, userId);
}else if (inUserId!=null){
forumAttentionDOS= gambitDao.selectAttentionCount(userAccountId, userId);
}
if (countAttention!=0){
dynamicVO.setStatus(true);
}
// if (countA!=0){
// dynamicVO.setStatus(true);
// }
System.out.println(userId);
for (ForumAttentionDO forumAttentionDO : forumAttentionDOS) {
if (forumAttentionDO!=null){
Integer userAccountId1 = dynamicVO.getUserAccountId();
......@@ -479,6 +480,9 @@ public class DynamicServiceImpl implements DynamicService {
if (tokenUserId.equals(dynamicVO.getUserAccountId())){
dynamicVO.setStatus(null);
}
if (inUserId!=null && inUserId.equals(dynamicVO.getUserAccountId())){
dynamicVO.setStatus(null);
}
}
return PageResult.buildPage(pageNo, pageSize, count, dynamicVOList);
}
......@@ -535,6 +539,21 @@ public class DynamicServiceImpl implements DynamicService {
return PageResult.buildPage(pageNo, postingLeaderboardQO.getPageSize(),postingLeaderboardDTOS.size(),postingLeaderboardDTOS);
}
@Override
public List<ForumAttentionDO> getPilot(Integer userAccountId) {
List<ForumAttentionDO> list = new ArrayList<>();
List<ForumAttentionDO> forumAttentionDOS=dynamicDao.getPilot(userAccountId);
for (ForumAttentionDO forumAttentionDO : forumAttentionDOS) {
list.add(forumAttentionDO);
}
List<ForumAttentionDO> forumAttentionList=dynamicDao.getPilots(userAccountId);
for (ForumAttentionDO forumAttentionDO : forumAttentionList) {
list.add(forumAttentionDO);
}
List<ForumAttentionDO> collect = list.stream().distinct().collect(Collectors.toList());
return collect;
}
public UserAccountVO info( Integer userAccountId) {
String token = null;
......
......@@ -104,6 +104,30 @@
</if>
</select>
<select id="getPilot" resultType="com.mmc.csf.release.entity.gambit.ForumAttentionDO">
select id,user_account_id,create_time,update_time,attention_user_account_id,`status`,mutual_attention
from forum_attention where attention_user_account_id=#{userAccountId}
</select>
<select id="getPilots" resultType="com.mmc.csf.release.entity.gambit.ForumAttentionDO">
SELECT
id,
user_account_id,
create_time,
update_time,
attention_user_account_id,
`status`,
mutual_attention
FROM
forum_attention
WHERE
mutual_attention = 1
AND attention_user_account_id IN ( #{userAccountId} )
OR user_account_id IN (
#{userAccountId}
)
</select>
<update id="updateDiscussionCount">
update forum_gambit
set discussion_count=#{count},
......@@ -421,7 +445,8 @@
fd.comments_count,
fd.create_time,
fd.id AS dynamicId,
fdg.gambit_id
fdg.gambit_id,
fd.transpond
FROM
forum_dynamic fd
INNER JOIN forum_dynamic_gambit fdg ON fd.id = fdg.dynamic_id
......
......@@ -208,6 +208,10 @@
select user_account_id,attention_user_account_id,mutual_attention from forum_attention where attention_user_account_id=#{userId} or user_account_id=#{userAccountId} or attention_user_account_id=#{userAccountId} or user_account_id=#{userId} and mutual_attention=1
</select>
<insert id="insertCount">
insert into forum_count(user_account_id,create_time,update_time) values(#{userAccountId},now(),NOW())
</insert>
<select id="selectGambitAndDynamic" resultType="java.lang.Integer">
select count(*) from forum_dynamic_gambit where gambit_id=#{id}
</select>
......
......@@ -41,3 +41,4 @@ data-filter:
- /release/dynamic/recentNews
- /release/curriculum/getCurriculumCount
- /release/report/getReleaseReportData
- /release/dynamic/getPilot
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论