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;
}
Aggregations