Commit fbe63088 authored by 罗林杰's avatar 罗林杰

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/main/java/org/rcisoft/business/memInfo/dao/MemInfoRepository.java
#	src/main/resources/mapper/business/memInfo/mapper/MemInfoMapper.xml
parents 3aba73e5 42ee46f4
......@@ -118,6 +118,11 @@ public interface MemInfoRepository extends CyBaseMapper<MemInfo> {
*/
Integer addLike(@Param("entity") MemLikeDTO likeDTO);
/**
* 查询关注的id集合
*/
List<Integer> queryFollowIdById(String authenBusinessId);
/**
* 排行榜
*/
......
......@@ -201,5 +201,16 @@ public class OpmArticle extends CyIdIncreEntity<OpmArticle> {
*/
@TableField(exist = false)
private Integer parentId;
/**
* 动态查询类型 1:个人 0:关注 2:最近 3:话题
*/
@TableField(exist = false)
private String articleType;
/**
* 关注的数组
*/
private List<Integer> followList;
}
......@@ -9,6 +9,7 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.rcisoft.baidu.censor.dto.CensorResult;
import org.rcisoft.baidu.censor.service.ContentCensorService;
import org.rcisoft.business.memInfo.dao.MemInfoRepository;
import org.rcisoft.business.opmArticle.dao.OpmArticleRepository;
import org.rcisoft.business.opmArticle.entity.ArticleCommentDTO;
import org.rcisoft.business.opmArticle.entity.ArticleCommentVO;
......@@ -46,6 +47,8 @@ public class OpmArticleServiceImpl extends ServiceImpl<OpmArticleRepository, Opm
private ContentCensorService contentCensorService;
@Autowired
private CyFileStorageService cyFileStorageService;
@Autowired
private MemInfoRepository memInfoRepository;
/**
* 保存 opmArticle管理
* @param opmArticle
......@@ -160,15 +163,24 @@ public class OpmArticleServiceImpl extends ServiceImpl<OpmArticleRepository, Opm
@Override
public IPage<OpmArticle> findAllByPagination(CyPageInfo<OpmArticle> paginationUtility,
OpmArticle opmArticle){
IPage<OpmArticle> result = null;
if (opmArticle.getArticleType().equals("0")){
//关注
//查询该用户关注对象的id集合
List<Integer> list = memInfoRepository.queryFollowIdById(CyUserUtil.getAuthenBusinessId());
opmArticle.setFollowList(list);
result = baseMapper.queryOpmArticlePaged(paginationUtility,opmArticle);
} else {
if (StringUtils.isNotEmpty(opmArticle.getUserId())){
//设置查询用户 查询某个人的动态列表
opmArticle.setUserId(opmArticle.getUserId());
}
if (StringUtils.isNotEmpty(CyUserUtil.getAuthenBusinessId())){
//设置当前登录人id
//设置当前登录人id 用来查询该用户对文章是否已点赞
opmArticle.setLoginUserId(CyUserUtil.getAuthenBusinessId());
}
IPage<OpmArticle> result = baseMapper.queryOpmArticlePaged(paginationUtility,opmArticle);
result = baseMapper.queryOpmArticlePaged(paginationUtility,opmArticle);
}
return result;
}
......
......@@ -542,6 +542,10 @@
</if>
order by m.mem_liked_count desc
</select>
<select id="queryFollowIdById" resultType="java.lang.Integer">
select ouf.target_id from opm_user_follow ouf WHERE ouf.user_id = #{userId}
</select>
<delete id="deleteFollow" parameterType="org.rcisoft.business.memInfo.entity.MemFollowDTO">
delete from opm_user_follow
where user_id = #{entity.userId} and target_id = #{entity.targetId}
......
......@@ -173,6 +173,13 @@
<if test="entity.commentCount !=null and entity.commentCount != '' ">
and opa.comment_count &gt;= #{entity.commentCount}
</if>
<if test="entity.followList != null and entity.followList.size > 0">
and opa.create_by IN
<foreach item="item" index="index" collection="entity.followList"
open="(" separator="," close=")">
#{item}
</foreach>
</if>
GROUP BY
opa.business_id
ORDER BY
......
......@@ -30,7 +30,9 @@
su.nick_name as nickName
FROM opm_topic cn
LEFT JOIN sys_user su on su.business_id = cn.create_by
where cn.del_flag='0'
where 1=1
and cn.del_flag = '0'
and cn.flag = '1'
<if test="entity.flag!=null and entity.flag != '' ">
and cn.flag = #{entity.flag}
</if>
......
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