后台-myApi-reloadUserLevelExperience

This commit is contained in:
khalil
2025-02-24 15:29:45 +08:00
parent ce09bfbe2d
commit 8261385488
4 changed files with 27 additions and 2 deletions

View File

@@ -468,7 +468,7 @@ public class MyApiService {
}
public void reloadUserLevel() {
List<GiftSendRecord> a = giftSendRecordMapperExpand.listUserTotalGoldNum();
List<GiftSendRecord> a = giftSendRecordMapperExpand.listUserTotalGoldNum(null);
a.parallelStream().forEach(gsr->{
jedisService.hset(RedisKey.user_level_exper.getKey(), gsr.getUid().toString(), gsr.getTotalGoldNum().toString());
log.info("[reloadUserLevel] level uid {} amount {}", gsr.getUid(), gsr.getTotalGoldNum());
@@ -483,6 +483,18 @@ public class MyApiService {
jedisService.del(RedisKey.user_summary.getKey());
}
public void reloadUserExperienceLevel(Long erbanNo) {
Users u = usersService.getUserByErbanNo(erbanNo);
if (null == u){
throw new AdminServiceException(BusiStatus.USERNOTEXISTS);
}
List<GiftSendRecord> a = giftSendRecordMapperExpand.listUserTotalGoldNum(u.getUid());
a.parallelStream().forEach(gsr->{
jedisService.hset(RedisKey.user_level_exper.getKey(), gsr.getUid().toString(), gsr.getTotalGoldNum().toString());
log.info("[reloadUserLevel] level uid {} amount {}", gsr.getUid(), gsr.getTotalGoldNum());
});
}
@Autowired
private WeekStarService weekStarService;
@@ -577,4 +589,5 @@ public class MyApiService {
String yesterdayStr = DateTimeUtil.convertDate(monday);
weekGuildStatService.stat(yesterdayStr);
}
}

View File

@@ -131,6 +131,15 @@ public class MyApiController {
return BusiResult.success();
}
@GetMapping("/reloadUserLevelExperience")
public BusiResult<Void> reloadUserLevel(Long roomId, Long erbanNo) {
if (null == roomId || !roomId.equals(603L)) {
throw new AdminServiceException(BusiStatus.PARAMERROR);
}
myApiService.reloadUserExperienceLevel(erbanNo);
return BusiResult.success();
}
@GetMapping("/lucky24Stat")
public BusiResult<Void> lucky24Stat(Long roomId, String startDate) {
if (null == roomId || !roomId.equals(603L)) {

View File

@@ -52,7 +52,7 @@ public interface GiftSendRecordMapperExpand {
@Param("endDate") Date endDate,
@Param("partitionId") Integer partitionId);
List<GiftSendRecord> listUserTotalGoldNum();
List<GiftSendRecord> listUserTotalGoldNum(@Param("uid")Long uid);
List<GiftSendRecord> listReceiverUserTotalGoldNum();
}

View File

@@ -223,6 +223,9 @@
<select id="listUserTotalGoldNum" resultType="com.accompany.sharding.model.GiftSendRecord">
select uid, sum(total_gold_num) `total_gold_num` from gift_send_record gsr
where gsr.create_time >= '2024-04-23 00:00:00'
<if test="uid != null">
and gsr.uid = #{uid}
</if>
group by uid
</select>