| | |
| | | import com.yeshi.fanli.util.account.UserUtil;
|
| | | import com.yeshi.fanli.util.user.UserLevelUtil;
|
| | | import com.yeshi.fanli.vo.order.CommonOrderVO;
|
| | | import com.yeshi.fanli.vo.order.CurrentBonusVO;
|
| | | import com.yeshi.fanli.vo.order.GoodsRebateVO;
|
| | | import com.yeshi.fanli.vo.order.HongBaoCountVO;
|
| | | import com.yeshi.fanli.vo.order.OrderCountVO;
|
| | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 数据统计
|
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param type 1自购 2分享 3团队
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getCurrentBonus", method = RequestMethod.POST)
|
| | | public void getCurrentBonus(AcceptData acceptData, Long uid, Integer type, PrintWriter out) {
|
| | | if (uid == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | | return;
|
| | | }
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | if (type == 1 || type == 2) {
|
| | | CurrentBonusVO bonus = new CurrentBonusVO();
|
| | | bonus.setToday(hongBaoV2CountService.geBonusByuid(uid, 1, type, 2).setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | bonus.setYesterday(hongBaoV2CountService.geBonusByuid(uid, 2, type, 2).setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | bonus.setThisMonth(hongBaoV2CountService.geBonusByuid(uid, 3, type, 2).setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | bonus.setLastMonth(hongBaoV2CountService.geBonusByuid(uid, 4, type, 2).setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | |
|
| | | CurrentBonusVO bonusNot = new CurrentBonusVO();
|
| | | bonusNot.setToday(hongBaoV2CountService.geBonusByuid(uid, 1, type, 1).setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | bonusNot.setYesterday(hongBaoV2CountService.geBonusByuid(uid, 2, type, 1).setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | bonusNot.setThisMonth(hongBaoV2CountService.geBonusByuid(uid, 3, type, 1).setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | bonusNot.setLastMonth(hongBaoV2CountService.geBonusByuid(uid, 4, type, 1).setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | |
| | | |
| | | data.put("bonus",bonus);
|
| | | data.put("bonusNot",bonusNot);
|
| | | data.put("total", hongBaoV2CountService.geBonusByuid(uid, null, type, 2).setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | data.put("totalNot", hongBaoV2CountService.geBonusByuid(uid, null, type, 1).setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | } else {
|
| | | CurrentBonusVO bonus = new CurrentBonusVO();
|
| | | bonus.setToday(hongBaoV2CountService.geBonusByuid(uid, 1, type, 4).setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | bonus.setYesterday(hongBaoV2CountService.geBonusByuid(uid, 2, type, 4).setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | bonus.setThisMonth(hongBaoV2CountService.geBonusByuid(uid, 3, type, 4).setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | bonus.setLastMonth(hongBaoV2CountService.geBonusByuid(uid, 4, type, 2).setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | |
| | |
|
| | | CurrentBonusVO subsidy = new CurrentBonusVO();
|
| | | subsidy.setToday(inviteOrderSubsidyServiceV2.sumValidMoneyByUidAndDate(uid,1,null).setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | subsidy.setYesterday(inviteOrderSubsidyServiceV2.sumValidMoneyByUidAndDate(uid,2,null).setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | subsidy.setThisMonth(inviteOrderSubsidyServiceV2.sumValidMoneyByUidAndDate(uid,3,null).setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | subsidy.setLastMonth(inviteOrderSubsidyServiceV2.sumMoneyByUidAndDateAndState(uid,4,null,3).setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | |
| | | // TODO 分红统计
|
| | | CurrentBonusVO dividend = new CurrentBonusVO();
|
| | | dividend.setThisMonth("0.00");
|
| | | dividend.setLastMonth("0.00");
|
| | | |
| | | BigDecimal totalBonus = hongBaoV2CountService.geBonusByuid(uid, null, type, 2);
|
| | | BigDecimal totalubsidy = inviteOrderSubsidyServiceV2.sumRecievedMoneyByUid(uid,null);
|
| | | BigDecimal totalDividend = new BigDecimal(0);
|
| | | |
| | | BigDecimal total = totalDividend.add(totalBonus).add(totalubsidy);
|
| | | |
| | | |
| | | data.put("bonus",bonus);
|
| | | data.put("subsidy",subsidy);
|
| | | data.put("dividend",dividend);
|
| | | data.put("subsidy",subsidy);
|
| | | data.put("total", total.setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | data.put("totalBonus", totalBonus.setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | data.put("totalubsidy", totalubsidy.setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | data.put("totalDividend", totalDividend.setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | }
|
| | | |
| | | String key = null;
|
| | | if (type == 1) {
|
| | | key = ConfigKeyEnum.bonusCountLinkFanli.getKey();
|
| | | } else if (type == 2) {
|
| | | key = ConfigKeyEnum.bonusCountLinkShare.getKey();
|
| | | } else {
|
| | | key = ConfigKeyEnum.bonusCountLinkTeam.getKey();
|
| | | }
|
| | | |
| | | data.put("link",configService.get(key));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | }
|