| | |
| | | @Resource
|
| | | private TeamEincomeRecordService teamEincomeRecordService;
|
| | |
|
| | | |
| | | private Gson getGson() {
|
| | | GsonBuilder builder = new GsonBuilder();
|
| | | builder.registerTypeAdapter(BigDecimal.class, new JsonSerializer<BigDecimal>() {
|
| | |
| | | vo.setLink(configService.get(ConfigKeyEnum.autoExtractHelpUrl.getKey()));
|
| | | vo.setBalanceMoney(user.getMyHongBao());
|
| | | vo.setExtractDesc("提现金额就是已成功转账到提现支付宝的资金。");
|
| | | vo.setMoneyArrivalDesc("资金已到账后提现时间不受限制、金额受限制。");
|
| | | vo.setMoneyArrivalDesc("资金已到账后提现时间不受限制、金额不受限制。");
|
| | |
|
| | | // 获取提现中的信息
|
| | | BigDecimal extractingMoney = extractService.sumVerifyingMoney(uid);
|
| | |
| | | out.print(JsonUtil.loadTrueResult(gson.toJson(vo)));
|
| | | }
|
| | |
|
| | | @RequestMapping(value = "getUserMoneyInfo")
|
| | | public void getUserMoneyInfo(AcceptData acceptData, Long uid, PrintWriter out) {
|
| | | if (uid == null || uid == 0) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | | return;
|
| | | }
|
| | | UserInfo user = userInfoService.getUserById(uid);
|
| | |
|
| | | |
| | | MoneyStatisticVO vo = new MoneyStatisticVO();
|
| | | vo.setLink(configService.get(ConfigKeyEnum.autoExtractHelpUrl.getKey()));
|
| | | vo.setBalanceMoney(user.getMyHongBao());
|
| | | // 获取提现中的信息
|
| | | BigDecimal extractingMoney = extractService.sumVerifyingMoney(uid);
|
| | | if (extractingMoney.compareTo(new BigDecimal(0)) > 0)
|
| | | vo.setExtractingMoneyInfo("提现中:¥" + extractingMoney.setScale(2, RoundingMode.HALF_UP));
|
| | | Gson gson = getGson();
|
| | | out.print(JsonUtil.loadTrueResult(gson.toJson(vo)));
|
| | | }
|
| | |
|
| | | private MoneyPredictVO cratePredictVO(List<OrderMoneyDailyCount> list) {
|
| | | MoneyPredictVO predictVO = new MoneyPredictVO();
|
| | |
| | | if (dailyCount.getOrderNumTeam() != null)
|
| | | predictVO.setTeamNum(predictVO.getTeamNum() + dailyCount.getOrderNumTeam());
|
| | | if (dailyCount.getIncome() != null)
|
| | | predictVO.setMineMoney(predictVO.getMineMoney().add(MoneyBigDecimalUtil.div(BigDecimal.valueOf(dailyCount.getIncome()), hundred)));
|
| | | predictVO.setMineMoney(predictVO.getMineMoney()
|
| | | .add(MoneyBigDecimalUtil.div(BigDecimal.valueOf(dailyCount.getIncome()), hundred)));
|
| | | if (dailyCount.getIncomeTeam() != null)
|
| | | predictVO.setTeamMoney(predictVO.getTeamMoney().add(MoneyBigDecimalUtil.div(BigDecimal.valueOf(dailyCount.getIncomeTeam()), hundred)));
|
| | | predictVO.setTeamMoney(predictVO.getTeamMoney()
|
| | | .add(MoneyBigDecimalUtil.div(BigDecimal.valueOf(dailyCount.getIncomeTeam()), hundred)));
|
| | | }
|
| | | }
|
| | | predictVO.setTotalNum(predictVO.getTeamNum() + predictVO.getMineNum());
|
| | |
| | | json.put("list", JSONArray);
|
| | | out.print(JsonUtil.loadTrueResult(json));
|
| | | }
|
| | |
|
| | | |
| | |
|
| | | /**
|
| | | * 历史详情
|
| | |
| | | Date countDay = dailyCount.getCountDay();
|
| | | if (datetype == 1 && countDay != null && countDate.equals(formatDay.format(countDay))) {
|
| | | predictVO.setMineNum(dailyCount.getOrderNum());
|
| | | predictVO.setMineMoney(MoneyBigDecimalUtil.div(BigDecimal.valueOf(dailyCount.getIncome()), hundred));
|
| | | predictVO.setMineMoney(
|
| | | MoneyBigDecimalUtil.div(BigDecimal.valueOf(dailyCount.getIncome()), hundred));
|
| | | predictVO.setTeamNum(dailyCount.getOrderNumTeam());
|
| | | predictVO.setTeamMoney(MoneyBigDecimalUtil.div(BigDecimal.valueOf(dailyCount.getIncomeTeam()), hundred));
|
| | | predictVO.setTeamMoney(
|
| | | MoneyBigDecimalUtil.div(BigDecimal.valueOf(dailyCount.getIncomeTeam()), hundred));
|
| | | break;
|
| | | }
|
| | |
|
| | | String yearMonth = dailyCount.getYearMonth();
|
| | | if (datetype == 2 && !StringUtil.isNullOrEmpty(yearMonth)
|
| | | && countDate.equals(formatMonth.format(TimeUtil.parseYYYYMMDD(DateUtil.getFirstDayOfMonth(yearMonth))))) {
|
| | | if (datetype == 2 && !StringUtil.isNullOrEmpty(yearMonth) && countDate.equals(
|
| | | formatMonth.format(TimeUtil.parseYYYYMMDD(DateUtil.getFirstDayOfMonth(yearMonth))))) {
|
| | | predictVO.setMineNum(dailyCount.getOrderNum());
|
| | | predictVO.setMineMoney(MoneyBigDecimalUtil.div(BigDecimal.valueOf(dailyCount.getIncome()), hundred));
|
| | | predictVO.setMineMoney(
|
| | | MoneyBigDecimalUtil.div(BigDecimal.valueOf(dailyCount.getIncome()), hundred));
|
| | | predictVO.setTeamNum(dailyCount.getOrderNumTeam());
|
| | | predictVO.setTeamMoney(MoneyBigDecimalUtil.div(BigDecimal.valueOf(dailyCount.getIncomeTeam()), hundred));
|
| | | predictVO.setTeamMoney(
|
| | | MoneyBigDecimalUtil.div(BigDecimal.valueOf(dailyCount.getIncomeTeam()), hundred));
|
| | | break;
|
| | | }
|
| | | }
|
| | |
| | | for (OrderMoneyDailyCount dailyCount : listDailyCount) {
|
| | | if (dailyCount.getSourceType() == typeEnum) {
|
| | | detail.setNum(detail.getNum() + dailyCount.getOrderNum());
|
| | | detail.setMoney(detail.getMoney().add(MoneyBigDecimalUtil.div(BigDecimal.valueOf(dailyCount.getIncome()), hundred)));
|
| | | detail.setMoney(detail.getMoney()
|
| | | .add(MoneyBigDecimalUtil.div(BigDecimal.valueOf(dailyCount.getIncome()), hundred)));
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | object.put("list", gson.toJson(list));
|
| | | out.print(JsonUtil.loadTrueResult(object));
|
| | | }
|
| | |
|
| | | |
| | |
|
| | | /**
|
| | | * 团队分红
|
| | |
| | | BigDecimal subsidy = teamEincomeRecordService.sumRecieveByType(uid, TeamEincomeRecord.TYPE_TEAM_SUBSIDY);
|
| | | BigDecimal reward = teamEincomeRecordService.sumRecieveByType(uid, TeamEincomeRecord.TYPE_TEAM_DIVIDENTS);
|
| | |
|
| | | |
| | | Gson gson = getGson();
|
| | | JSONObject object = new JSONObject();
|
| | | object.put("total", subsidy.add(reward).setScale(2).toString());
|
| | |
| | | object.put("month", gson.toJson(monthVO));
|
| | | out.print(JsonUtil.loadTrueResult(object));
|
| | | }
|
| | | |
| | |
|
| | | private TeamPredictVO crateTeamPredictVO(List<OrderMoneyDailyCount> list) {
|
| | | TeamPredictVO predictVO = new TeamPredictVO(BigDecimal.ZERO,0,BigDecimal.ZERO,0);
|
| | |
| | | if (dailyCount.getTeamSubsidyNum() != null)
|
| | | predictVO.setSubsidyNum(predictVO.getSubsidyNum() + dailyCount.getTeamSubsidyNum());
|
| | | if (dailyCount.getTeamReward() != null)
|
| | | predictVO.setReward(predictVO.getReward().add(MoneyBigDecimalUtil.div(BigDecimal.valueOf(dailyCount.getTeamReward()), hundred)));
|
| | | predictVO.setReward(predictVO.getReward()
|
| | | .add(MoneyBigDecimalUtil.div(BigDecimal.valueOf(dailyCount.getTeamReward()), hundred)));
|
| | | if (dailyCount.getTeamSubsidy() != null)
|
| | | predictVO.setSubsidy(predictVO.getSubsidy().add(MoneyBigDecimalUtil.div(BigDecimal.valueOf(dailyCount.getTeamSubsidy()), hundred)));
|
| | | |
| | | predictVO.setSubsidy(predictVO.getSubsidy()
|
| | | .add(MoneyBigDecimalUtil.div(BigDecimal.valueOf(dailyCount.getTeamSubsidy()), hundred)));
|
| | |
|
| | | }
|
| | | }
|
| | |
| | | predictVO.setTotalMoney(predictVO.getReward().add(predictVO.getSubsidy()));
|
| | | return predictVO;
|
| | | }
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 历史详情
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getTeamDividendHistory")
|
| | | public void getTeamDividendHistory(AcceptData acceptData, Long uid, String date, Integer datetype, PrintWriter out) {
|
| | | public void getTeamDividendHistory(AcceptData acceptData, Long uid, String date, Integer datetype,
|
| | | PrintWriter out) {
|
| | | if (uid == null || uid == 0) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | | return;
|
| | |
| | | Date countDay = dailyCount.getCountDay();
|
| | | if (datetype == 1 && countDay != null && countDate.equals(formatDay.format(countDay))) {
|
| | | predictVO.setRewardNum(dailyCount.getTeamRewardNum());
|
| | | predictVO.setReward(MoneyBigDecimalUtil.div(BigDecimal.valueOf(dailyCount.getTeamReward()), hundred));
|
| | | predictVO.setReward(
|
| | | MoneyBigDecimalUtil.div(BigDecimal.valueOf(dailyCount.getTeamReward()), hundred));
|
| | | predictVO.setSubsidyNum(dailyCount.getTeamSubsidyNum());
|
| | | predictVO.setSubsidy(MoneyBigDecimalUtil.div(BigDecimal.valueOf(dailyCount.getTeamSubsidy()), hundred));
|
| | | predictVO.setSubsidy(
|
| | | MoneyBigDecimalUtil.div(BigDecimal.valueOf(dailyCount.getTeamSubsidy()), hundred));
|
| | | break;
|
| | | }
|
| | |
|
| | | String yearMonth = dailyCount.getYearMonth();
|
| | | if (datetype == 2 && !StringUtil.isNullOrEmpty(yearMonth)
|
| | | && countDate.equals(formatMonth.format(TimeUtil.parseYYYYMMDD(DateUtil.getFirstDayOfMonth(yearMonth))))) {
|
| | | if (datetype == 2 && !StringUtil.isNullOrEmpty(yearMonth) && countDate.equals(
|
| | | formatMonth.format(TimeUtil.parseYYYYMMDD(DateUtil.getFirstDayOfMonth(yearMonth))))) {
|
| | | predictVO.setRewardNum(dailyCount.getTeamRewardNum());
|
| | | predictVO.setReward(MoneyBigDecimalUtil.div(BigDecimal.valueOf(dailyCount.getTeamReward()), hundred));
|
| | | predictVO.setReward(
|
| | | MoneyBigDecimalUtil.div(BigDecimal.valueOf(dailyCount.getTeamReward()), hundred));
|
| | | predictVO.setSubsidyNum(dailyCount.getTeamSubsidyNum());
|
| | | predictVO.setSubsidy(MoneyBigDecimalUtil.div(BigDecimal.valueOf(dailyCount.getTeamSubsidy()), hundred));
|
| | | predictVO.setSubsidy(
|
| | | MoneyBigDecimalUtil.div(BigDecimal.valueOf(dailyCount.getTeamSubsidy()), hundred));
|
| | | break;
|
| | | }
|
| | | }
|
| | |
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | }
|