Commit 32bf0af5 authored by 王亚雷's avatar 王亚雷

Merge remote-tracking branch 'origin/v2.3.1'

parents 26e9ab3e 3c34fb02
......@@ -41,6 +41,9 @@ public class TopicFollowRelEntity implements Serializable {
@ApiModelProperty(value = "取消关注时间")
private LocalDateTime unfollowTime;
@ApiModelProperty(value = "是否为管理员 1是 0不是")
private Integer manager;
private LocalDateTime createTime;
private LocalDateTime updateTime;
......@@ -88,6 +91,14 @@ public class TopicFollowRelEntity implements Serializable {
this.unfollowTime = unfollowTime;
}
public Integer getManager() {
return manager;
}
public void setManager(Integer manager) {
this.manager = manager;
}
public LocalDateTime getCreateTime() {
return createTime;
}
......
......@@ -74,6 +74,9 @@ public class CommentService {
}
public Integer getCommentCountByThemeIds(List<String> themeIds) {
if (CollectionUtils.isEmpty(themeIds)) {
return 0;
}
return commentMapper.selectCount((new LambdaQueryWrapper<CommentEntity>()
.in(CommentEntity::getThemeId, themeIds))
.eq(CommentEntity::getDeleteTag, DeleteTagEnum.NOT_DELETED));
......
......@@ -127,6 +127,7 @@ public class TopicService {
public Integer countTotalFollow(String topicId) {
return topicFollowRelMapper.selectCount(new LambdaQueryWrapper<TopicFollowRelEntity>()
.eq(TopicFollowRelEntity::getTopicId, topicId)
.eq(TopicFollowRelEntity::getManager, 0)
.eq(TopicFollowRelEntity::getDeleteTag, DeleteTagEnum.NOT_DELETED.getCode()));
}
......
package com.tanpu.community.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.google.common.collect.Lists;
import com.tanpu.biz.common.enums.clue.PageEnum;
import com.tanpu.community.api.enums.DeleteTagEnum;
import com.tanpu.community.cache.RedisCache;
......@@ -22,7 +23,7 @@ import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import static com.tanpu.biz.common.enums.clue.PageEnum.COMM_VISIT_TOPIC_DETAIL;
import static com.tanpu.biz.common.enums.clue.PageEnum.*;
@Slf4j
@Service
......@@ -104,7 +105,7 @@ public class VisitLogService {
public Integer queryTopicDetailVisit(String topicId) {
return visitLogMapper.selectCount(new LambdaQueryWrapper<VisitLogEntity>()
.eq(VisitLogEntity::getRefId, topicId)
.eq(VisitLogEntity::getRefType, COMM_VISIT_TOPIC_DETAIL.getId()));
.in(VisitLogEntity::getRefType, Lists.newArrayList(COMM_VISIT_TOPIC_DETAIL_HOT.getId(), COMM_VISIT_TOPIC_DETAIL_NEW.getId())));
}
// 查询主题 浏览量
......
......@@ -77,7 +77,7 @@ public class TopicReportService {
// 每个工作日早上09:30汇报
public static String content_report_topic_weekday = "话题(%s) 当前总成员: %s, 当前总阅读: %s, 当前总讨论: %s, 昨日新增成员: %s, 昨日新增讨论";
public static String content_report_topic_weekday = "话题(%s) 当前总成员: %s, 当前总阅读: %s, 当前总讨论: %s, 昨日新增成员: %s, 昨日新增讨论: %s";
public void reportTopicWeekday() {
// 跳过双休日
Date now = new Date();
......@@ -128,7 +128,7 @@ public class TopicReportService {
}
// 每周六早上09:00汇报
public static String content_report_topic_saturday = "话题(%s) 当前总成员: %s, 当前总阅读: %s, 当前总讨论: %s, 截至本周五新增成员: %s, 昨日新增讨论";
public static String content_report_topic_saturday = "话题(%s) 当前总成员: %s, 当前总阅读: %s, 当前总讨论: %s, 截至本周五新增成员: %s, 昨日新增讨论: %s";
public void reportTopicSaturday() {
List<TopicEntity> topics = topicService.queryTopicNeedReport();
for (TopicEntity topic : topics) {
......
......@@ -104,7 +104,7 @@ tmpfile:
wxcp:
topicreport:
agentId: 1000025
corpId: IC6Hpbct4OrYzacDnzXqSRC17vrpNwDZ1HZvFef1QQc
corpId: ww08675a3a48c9e8a2
logging.level.com.tanpu: debug
......@@ -131,6 +131,8 @@ tanpu:
svc: https://testtamper.tanpuyun.com
fundpublic:
svc: https://testtamper.tanpuyun.com
wxcp:
svc: https://testtamper.tanpuyun.com
#打印SQL语句
logging:
......@@ -146,4 +148,4 @@ pagehelper:
msg:
kefu:
telephone: 021-65681889
\ No newline at end of file
telephone: 021-65681889
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.tanpu.community.dao.mapper.community.TopicFollowRelMapper">
<!-- 通用查询映射结果 -->
<sql id="Base_Column_List">
id,
topic_id,
user_id,
follow_time,
unfollow_time,
create_time,
update_time,
delete_tag
</sql>
<resultMap id="BaseResultMap" type="com.tanpu.community.dao.entity.community.TopicFollowRelEntity">
<id column="id" property="id" />
<result column="topic_id" property="topicId" />
<result column="user_id" property="userId" />
<result column="follow_time" property="followTime" />
<result column="unfollow_time" property="unfollowTime" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
<result column="delete_tag" property="deleteTag" />
</resultMap>
<resultMap id="BaseResultMap" type="com.tanpu.community.dao.entity.community.TopicFollowRelEntity">
<!--@mbg.generated-->
<!--@Table topic_follow_rel-->
<id column="id" jdbcType="BIGINT" property="id" />
<result column="topic_id" jdbcType="VARCHAR" property="topicId" />
<result column="user_id" jdbcType="VARCHAR" property="userId" />
<result column="follow_time" jdbcType="TIMESTAMP" property="followTime" />
<result column="unfollow_time" jdbcType="TIMESTAMP" property="unfollowTime" />
<result column="manager" jdbcType="INTEGER" property="manager" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="delete_tag" jdbcType="INTEGER" property="deleteTag" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, topic_id, user_id, follow_time, unfollow_time, manager, create_time, update_time,
delete_tag
</sql>
<!--auto generated by MybatisCodeHelper on 2022-02-17-->
<select id="selectTopicIdByUserId" resultType="java.lang.String">
......@@ -35,7 +31,7 @@
<!--auto generated by MybatisCodeHelper on 2022-02-17-->
<select id="queryOneByTopicIdAndUserId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
<include refid="Base_Column_List" />
from topic_follow_rel
where topic_id=#{topicId} and user_id=#{userId} and delete_tag = 0
</select>
......
package com.tanpu.community.service.quartz;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringRunner;
import javax.annotation.Resource;
import static org.junit.Assert.*;
@RunWith(SpringRunner.class)
@SpringBootTest
@ActiveProfiles("test")
@Slf4j
public class TopicReportServiceTest {
@Resource
private TopicReportService topicReportService;
@Test
public void reportTopicWeekday() {
topicReportService.reportTopicWeekday();
}
@Test
public void reportTopicSaturday() {
topicReportService.reportTopicSaturday();
}
}
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