Commit ccbb4e3a authored by 张辰's avatar 张辰
parents 4dccb4b9 b52b6de8
...@@ -2,6 +2,7 @@ package com.tanpu.community.dao.mapper.community; ...@@ -2,6 +2,7 @@ package com.tanpu.community.dao.mapper.community;
import com.tanpu.community.dao.entity.community.RankLogEntity; import com.tanpu.community.dao.entity.community.RankLogEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
/** /**
...@@ -14,6 +15,6 @@ import org.apache.ibatis.annotations.Select; ...@@ -14,6 +15,6 @@ import org.apache.ibatis.annotations.Select;
*/ */
public interface RankLogMapper extends BaseMapper<RankLogEntity> { public interface RankLogMapper extends BaseMapper<RankLogEntity> {
@Select("select max(round) from rank_log") @Select("select max(round) from rank_log where type = #{type}")
Long selectMaxRound(); Long selectMaxRound(@Param("type") Integer type);
} }
\ No newline at end of file
...@@ -30,7 +30,7 @@ public class RankLogService { ...@@ -30,7 +30,7 @@ public class RankLogService {
return; return;
} }
Long round = rankLogMapper.selectMaxRound(); Long round = rankLogMapper.selectMaxRound(RankLogTypeEnum.TOPIC.getCode());
round = round == null ? 0L : round + 1; round = round == null ? 0L : round + 1;
//分页插入 //分页插入
...@@ -55,6 +55,10 @@ public class RankLogService { ...@@ -55,6 +55,10 @@ public class RankLogService {
if (CollectionUtils.isEmpty(themeList)) { if (CollectionUtils.isEmpty(themeList)) {
return; return;
} }
Long round = rankLogMapper.selectMaxRound(RankLogTypeEnum.THEME.getCode());
round = round == null ? 0L : round + 1;
//分页插入 //分页插入
for (int i = 0; i * pageSize < themeList.size(); i++) { for (int i = 0; i * pageSize < themeList.size(); i++) {
int pageStart = i * pageSize; int pageStart = i * pageSize;
...@@ -66,8 +70,10 @@ public class RankLogService { ...@@ -66,8 +70,10 @@ public class RankLogService {
.content(JsonUtil.toJson(sublist)) .content(JsonUtil.toJson(sublist))
.pageNumber(i + 1) .pageNumber(i + 1)
.pageSize(sublist.size()) .pageSize(sublist.size())
.round(round)
.build(); .build();
rankLogMapper.insert(entity); rankLogMapper.insert(entity);
} }
} }
} }
...@@ -101,16 +101,16 @@ recommend: ...@@ -101,16 +101,16 @@ recommend:
rank: rank:
theme: theme:
viewRate: 0.11 viewRate: 0.1
forwardRate: 31 forwardRate: 3
commentRate: 21 commentRate: 2
likeRaten: 11 likeRaten: 1
collectRate: 31 collectRate: 3
userWeightRate: 0.91 userWeightRate: 0.9
initialWeight: 1.011 initialWeight: 1.0
timeRate: 0.21 timeRate: 0.2
topic: topic:
viewRate: 21 viewRate: 2
discussRate: 31 discussRate: 3
themeRate: 31 themeRate: 3
timeRate: 11 timeRate: 1
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