| | |
| | | import com.google.gson.JsonSerializer;
|
| | | import com.yeshi.fanli.dto.user.UserInviteLevelEnum;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2;
|
| | | import com.yeshi.fanli.entity.bus.user.SMSHistory;
|
| | | import com.yeshi.fanli.entity.bus.user.ThreeSale;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | |
| | | UserInviteLevelEnum level = userInviteService.getUserInviteLevelNew(uid);
|
| | |
|
| | | // 达人
|
| | | long limitZiGou = 0;
|
| | | long limitShare = 0;
|
| | | long limitOrder = 0;
|
| | | long limitFirst = 0;
|
| | | long limitSecond = 0;
|
| | | if (level == UserInviteLevelEnum.actived || level == UserInviteLevelEnum.noActive) {
|
| | | String zigou = userVipConfigService.getValueByKey("vip_pre_3_zigou_order_count");
|
| | | if (!StringUtil.isNullOrEmpty(zigou)) {
|
| | | limitZiGou = Long.parseLong(zigou);
|
| | | }
|
| | | String share = userVipConfigService.getValueByKey("vip_pre_3_share_order_count");
|
| | | if (!StringUtil.isNullOrEmpty(share)) {
|
| | | limitShare = Long.parseLong(share);
|
| | | }
|
| | | String first = userVipConfigService.getValueByKey("vip_pre_3_first_level_team_count");
|
| | | if (!StringUtil.isNullOrEmpty(first)) {
|
| | | limitFirst = Long.parseLong(first);
|
| | | }
|
| | | String second = userVipConfigService.getValueByKey("vip_pre_3_second_level_team_count");
|
| | | if (!StringUtil.isNullOrEmpty(second)) {
|
| | | limitSecond = Long.parseLong(second);
|
| | | }
|
| | | } else if (level == UserInviteLevelEnum.vipPre1) {
|
| | | String zigou = userVipConfigService.getValueByKey("vip_pre_7_zigou_order_count");
|
| | | if (!StringUtil.isNullOrEmpty(zigou)) {
|
| | | limitZiGou = Long.parseLong(zigou);
|
| | | }
|
| | | String share = userVipConfigService.getValueByKey("vip_pre_7_share_order_count");
|
| | | if (!StringUtil.isNullOrEmpty(share)) {
|
| | | limitShare = Long.parseLong(share);
|
| | | String orderCount = userVipConfigService.getValueByKey("vip_pre_7_order_count");
|
| | | if (!StringUtil.isNullOrEmpty(orderCount)) {
|
| | | limitOrder = Long.parseLong(orderCount);
|
| | | }
|
| | | String first = userVipConfigService.getValueByKey("vip_pre_7_first_level_team_count");
|
| | | if (!StringUtil.isNullOrEmpty(first)) {
|
| | |
| | | if (!StringUtil.isNullOrEmpty(second)) {
|
| | | limitSecond = Long.parseLong(second);
|
| | | }
|
| | | } else if (level == UserInviteLevelEnum.vipPre2 || level == UserInviteLevelEnum.vipApply) {
|
| | | String zigou = userVipConfigService.getValueByKey("vip_pre_10_zigou_order_count");
|
| | | if (!StringUtil.isNullOrEmpty(zigou)) {
|
| | | limitZiGou = Long.parseLong(zigou);
|
| | | }
|
| | | String share = userVipConfigService.getValueByKey("vip_pre_10_share_order_count");
|
| | | if (!StringUtil.isNullOrEmpty(share)) {
|
| | | limitShare = Long.parseLong(share);
|
| | | } else if (level == UserInviteLevelEnum.highVIP || level == UserInviteLevelEnum.vipApply) {
|
| | | String orderCount = userVipConfigService.getValueByKey("vip_pre_10_order_count");
|
| | | if (!StringUtil.isNullOrEmpty(orderCount)) {
|
| | | limitOrder = Long.parseLong(orderCount);
|
| | | }
|
| | | String first = userVipConfigService.getValueByKey("vip_pre_10_first_level_team_count");
|
| | | if (!StringUtil.isNullOrEmpty(first)) {
|
| | |
| | | }
|
| | |
|
| | | // 自购订单
|
| | | long doneZiGou = hongBaoV2CountService.counOrderByUidAndOrderType(uid, Constant.VIP_ORDER_PAY,
|
| | | HongBaoV2.TYPE_ZIGOU);
|
| | | // 分享订单
|
| | | long doneShare = hongBaoV2CountService.counOrderByUidAndOrderType(uid, Constant.VIP_ORDER_PAY,
|
| | | HongBaoV2.TYPE_SHARE_GOODS);
|
| | | |
| | | |
| | | Date now = new Date();
|
| | | Date start = new Date(0);
|
| | | |
| | | long doneOrder = hongBaoV2CountService.countMyDirectOrderByCashArrival(uid, Constant.VIP_ORDER_PAY);
|
| | | // 有效粉丝
|
| | | int doneFirst = 0;
|
| | | int doneSecond = 0;
|
| | |
| | | doneSecond = userInviteValidNum.getNumSecond() == null ? 0 : userInviteValidNum.getNumSecond();
|
| | | }
|
| | |
|
| | | Date now = new Date();
|
| | | Date start = new Date(0);
|
| | | // 省钱: ---返利订单、奖励券提成
|
| | | List<UserMoneyDetailTypeEnum> typeFanli = new ArrayList<>();
|
| | | typeFanli.add(UserMoneyDetailTypeEnum.fanli);
|
| | |
| | | earnMoney = MoneyBigDecimalUtil.mul2(earnMoney, rate);
|
| | | }
|
| | |
|
| | | String school = "板栗学院";
|
| | | String platformSubsidy = "补贴返佣 ";
|
| | | String teamSubsidy = "会员专属";
|
| | | String teamReward = "超级会员专属";
|
| | | |
| | | String shareRate = "可享佣金的<label style=\"color:#E5005C;\">%s</label>";
|
| | | String teamRate = "最高佣金的<label style=\"color:#E5005C;\">%s</label>";
|
| | | // 达人版
|
| | | JSONObject jsonrRed1 = new JSONObject();
|
| | | jsonrRed1.put("platformSubsidy", platformSubsidy + "<label style=\"color:#E5005C;\">52.5%</label>");
|
| | | jsonrRed1.put("school", school + "<label style=\"color:#E5005C;\">达人班</label>");
|
| | | jsonrRed1.put("teamSubsidy", teamSubsidy);
|
| | | jsonrRed1.put("teamReward", teamReward);
|
| | | jsonrRed1.put("enjoyRate", String.format(shareRate, "145%"));
|
| | | jsonrRed1.put("teamRate", String.format(teamRate, "25%"));
|
| | | jsonrRed1.put("teamIncome", "高级会员以上专属");
|
| | |
|
| | | |
| | | // 高级会员
|
| | | JSONObject jsonrRed2 = new JSONObject();
|
| | | jsonrRed2.put("platformSubsidy", platformSubsidy + "<label style=\"color:#E5005C;\">60%</label>");
|
| | | jsonrRed2.put("school", school + "<label style=\"color:#E5005C;\">普通班</label>");
|
| | | jsonrRed2.put("teamSubsidy", teamSubsidy + "最高<label style=\"color:#E5005C;\">7.5%</label>");
|
| | | jsonrRed2.put("teamReward", teamReward);
|
| | | jsonrRed2.put("enjoyRate", String.format(shareRate, "195%"));
|
| | | jsonrRed2.put("teamRate", String.format(teamRate, "50%"));
|
| | | jsonrRed2.put("teamIncome", "享高级团队收益");
|
| | |
|
| | |
|
| | | // 超级会员
|
| | | JSONObject jsonrRed3 = new JSONObject();
|
| | | jsonrRed3.put("platformSubsidy", platformSubsidy + "<label style=\"color:#E5005C;\">70%</label>");
|
| | | jsonrRed3.put("school", school + "<label style=\"color:#E5005C;\">高级班</label>");
|
| | | jsonrRed3.put("teamSubsidy", teamSubsidy + "最高<label style=\"color:#E5005C;\">15%</label>");
|
| | | jsonrRed3.put("teamReward", teamReward);
|
| | | |
| | |
|
| | | JSONObject jsonrRed4 = new JSONObject();
|
| | | jsonrRed4.put("platformSubsidy", platformSubsidy + "<label style=\"color:#E5005C;\">115%</label>");
|
| | | jsonrRed4.put("school", school + "<label style=\"color:#E5005C;\">超级班</label>");
|
| | | jsonrRed4.put("teamSubsidy", teamSubsidy + "最高<label style=\"color:#E5005C;\">22.5%</label>");
|
| | | jsonrRed4.put("teamReward", teamReward + "最高<label style=\"color:#E5005C;\">40%</label>");
|
| | | jsonrRed3.put("enjoyRate", String.format(shareRate, "210%"));
|
| | | jsonrRed3.put("teamRate", String.format(teamRate, "110%"));
|
| | | jsonrRed3.put("teamIncome", "享超级团队收益");
|
| | |
|
| | |
|
| | | JSONObject json = new JSONObject();
|
| | |
| | | json.put("newerGongLue", configService.get(ConfigKeyEnum.newerGonglue.getKey()));
|
| | |
|
| | | // 已完成
|
| | | json.put("doneZiGou", doneZiGou);
|
| | | json.put("doneShare", doneShare);
|
| | | json.put("doneOrder", doneOrder);
|
| | | json.put("doneFirst", doneFirst);
|
| | | json.put("doneSecond", doneSecond);
|
| | |
|
| | | // 标准
|
| | | json.put("limitZiGou", limitZiGou);
|
| | | json.put("limitShare", limitShare);
|
| | | json.put("limitOrder", limitOrder);
|
| | | json.put("limitFirst", limitFirst);
|
| | | json.put("limitSecond", limitSecond);
|
| | |
|
| | | // 已完成
|
| | | json.put("master", jsonrRed1);
|
| | | json.put("vip1", jsonrRed2);
|
| | | json.put("vip2", jsonrRed3);
|
| | | json.put("vip3", jsonrRed4);
|
| | | json.put("daRen", jsonrRed1);
|
| | | json.put("highVIP", jsonrRed2);
|
| | | json.put("superVIP", jsonrRed3);
|
| | |
|
| | | // 人工客服链接
|
| | | json.put("csdLink", configService.get(ConfigKeyEnum.customerServiceLink.getKey()));
|