Search in sources :

Example 1 with HomeChargeVo

use of com.code.server.login.vo.HomeChargeVo in project summer by foxsugar.

the class HomeServiceImpl method showHomePage.

@Override
public HomePageVo showHomePage(long agentId) {
    AgentBean agentBean = RedisManager.getAgentRedisService().getAgentBean(agentId);
    HomePageVo homePageVo = new HomePageVo();
    homePageVo.setRebate(agentBean.getRebate());
    homePageVo.setInvitationCode("" + agentId);
    HomeChargeVo homeChargeVo = todayChargeService.showCharge(agentId);
    String total = homeChargeVo.getTotal();
    homePageVo.setTotalMoney((Double.parseDouble(total)));
    // 收益
    AgentInfo agentInfo = agentBean.getAgentInfo();
    String today = DateUtil.convert2DayString(new Date());
    Map<String, ChildCost> everyDayCos = agentInfo.getEveryDayCost();
    ChildCost childCost = everyDayCos.get(today);
    if (childCost != null) {
        homePageVo.setFirstLevel(childCost.getFirstLevel() * 0.01 * 0.2);
        homePageVo.setSecondLevel(childCost.getSecondLevel() * 0.01 * 0.1);
        homePageVo.setThirdLevel(childCost.getThirdLevel() * 0.01 * 0.1);
        // homePageVo.setAllCost(childCost.getFirstLevel() * 0.01 * 0.2 + childCost.getSecondLevel()* 0.01 * 0.1 + childCost.getThirdLevel() * 0.01 * 0.1);
        double allCost = (childCost.getFirstLevel() + childCost.getSecondLevel() + childCost.getThirdLevel()) * 0.01;
        homePageVo.setAllCost(allCost);
    }
    return homePageVo;
}
Also used : AgentBean(com.code.server.constant.game.AgentBean) HomePageVo(com.code.server.login.vo.HomePageVo) HomeChargeVo(com.code.server.login.vo.HomeChargeVo) ChildCost(com.code.server.constant.db.ChildCost) AgentInfo(com.code.server.constant.db.AgentInfo)

Aggregations

AgentInfo (com.code.server.constant.db.AgentInfo)1 ChildCost (com.code.server.constant.db.ChildCost)1 AgentBean (com.code.server.constant.game.AgentBean)1 HomeChargeVo (com.code.server.login.vo.HomeChargeVo)1 HomePageVo (com.code.server.login.vo.HomePageVo)1