use of com.code.server.login.vo.HomePageVo in project summer by foxsugar.
the class HomeAction method showHomePage.
@AuthChecker
@RequestMapping("/show")
public AgentResponse showHomePage() {
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
HttpServletRequest request = attributes.getRequest();
long agentId = AgentUtil.getAgentByRequest(request);
HomePageVo homePageVo = homeService.showHomePage(agentId);
Map<String, Object> rs = new HashMap<>();
rs.put("result", homePageVo);
AgentResponse agentResponse = new AgentResponse(200, rs);
return agentResponse;
}
use of com.code.server.login.vo.HomePageVo 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