This commit is contained in:
张良(004796)
2024-03-08 16:15:16 +08:00
parent 42814d5564
commit 00e5cfb288
6 changed files with 63 additions and 6 deletions

View File

@@ -1,8 +1,8 @@
package com.ruoyi.cai.manager;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.cai.cache.AnchorCountTotalCache;
import com.ruoyi.cai.cache.RechargeTotalCache;
import com.ruoyi.cai.cache.WithdrawTotalCache;
import com.ruoyi.cai.cache.bean.RechargeTotalCacheBean;
@@ -53,6 +53,8 @@ public class AdminHomeManager {
private RankManager rankManager;
@Autowired
private UserService userService;
@Autowired
private AnchorCountTotalCache anchorCountTotalCache;
/**
* @param rankType 1-魅力榜 2-邀请榜 3-充值榜 4-提现榜
@@ -140,7 +142,10 @@ public class AdminHomeManager {
HomeStaticIndexVo vo = new HomeStaticIndexVo();
vo.setTodayLoginNum(onlineTodayNum);
vo.setTodayLoginDiffLast(CaiNumUtil.diffRate(onlineTodayNum,onlineLastNum));
vo.setAnchorNum(anchorService.count(Wrappers.emptyWrapper()));
long anchorNum = anchorService.count(Wrappers.emptyWrapper());
Long lastAnchorNum = anchorCountTotalCache.get(LocalDate.now().plusDays(-1));
vo.setAnchorNum(anchorNum);
vo.setAnchorNumDiffLast(CaiNumUtil.diffRate(anchorNum,lastAnchorNum));
RechargeTotalCacheBean todayRecharge = rechargeTotalCache.getToday();
RechargeTotalCacheBean lastTodayRecharge = rechargeTotalCache.getLastToday();
vo.setTodayRechargeAmountNum(todayRecharge.getAmount());