From 0b57cfd62e842b309d03467b96a331c673ecad7c Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期二, 21 四月 2020 14:08:18 +0800 Subject: [PATCH] 删除普通会员等级 --- fanli/src/main/java/com/yeshi/fanli/controller/client/v2/UserOrderControllerV2.java | 119 +++++++++-------------------------------------------------- 1 files changed, 19 insertions(+), 100 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/UserOrderControllerV2.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/UserOrderControllerV2.java index 5f42f04..745188c 100644 --- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/UserOrderControllerV2.java +++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/UserOrderControllerV2.java @@ -59,7 +59,6 @@ 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; @@ -581,6 +580,15 @@ userLevel = UserLevelEnum.daRen; UserLevelEnum upperLevel = UserLevelEnum.superVIP; + CommonOrder commonOrder1 = hoList.get(0).getCommonOrder(); + Date downTime = commonOrder1.getThirdCreateTime(); + Integer urank = commonOrder1.getUrank(); + UserLevelEnum buyerUserLevel = UserLevelUtil.getByOrderRank(urank); + boolean direct = false; + if (hongBaoV2.getType() == HongBaoV2.TYPE_YIJI || hongBaoV2.getType() == HongBaoV2.TYPE_SHARE_YIJI) { + direct = true; + } + BigDecimal upperTotalMoney = new BigDecimal(0); List<GoodsRebateVO> voList = new ArrayList<>(); for (HongBaoOrder hongBaoOrder : hoList) { @@ -626,11 +634,11 @@ upperTotalMoney = upperTotalMoney.add(orderHongBaoMoneyComputeService.computeFanliMoney(commonOrder, upperLevel)); } else if (type == 2) { upperTotalMoney = upperTotalMoney.add(orderHongBaoMoneyComputeService.computeShareMoney(commonOrder, upperLevel)); + } else if (type == 3) { + upperTotalMoney = upperTotalMoney.add(hongBao); } } - CommonOrder commonOrder = hoList.get(0).getCommonOrder(); - Date downTime = commonOrder.getThirdCreateTime(); // 鍥㈤槦琛ヨ创 if (type == 3) { @@ -639,13 +647,7 @@ InviteOrderSubsidy inviteOrderSubsidy = inviteOrderSubsidyServiceV2.getByOrderNoAndType(uid, orderNo, sourceType); if (inviteOrderSubsidy != null) { teamSubsidy = inviteOrderSubsidy.getMoney(); - Integer urank = commonOrder.getUrank(); - UserLevelEnum buyerUserLevel = UserLevelUtil.getByOrderRank(urank); - boolean direct = false; - if (hongBaoV2.getType() == HongBaoV2.TYPE_YIJI || hongBaoV2.getType() == HongBaoV2.TYPE_SHARE_YIJI) { - direct = true; - } - + // 璁$畻鍘熸瘮渚� BigDecimal originRate = orderHongBaoMoneyComputeService.getTeamSubsidyRate(downTime,buyerUserLevel, userLevel, direct); // 璁$畻杈句汉琛ヨ创 @@ -655,12 +657,13 @@ lowerSubsidy = MoneyBigDecimalUtil.div(teamSubsidy.multiply(daRenRate), originRate); } - if (userLevel != UserLevelEnum.superVIP && userLevel != UserLevelEnum.superVIP) { + // 璁$畻瓒呯骇浼氬憳琛ヨ创 + if (userLevel != UserLevelEnum.superVIP && userLevel != UserLevelEnum.tearcher) { BigDecimal vipRate = orderHongBaoMoneyComputeService.getTeamSubsidyRate(downTime, buyerUserLevel, UserLevelEnum.superVIP, direct); upperTotalMoney = upperTotalMoney.add(MoneyBigDecimalUtil.div(teamSubsidy.multiply(vipRate), originRate)); - System.out.println(upperTotalMoney); } + } else { teamSubsidy = BigDecimal.valueOf(0.00); lowerSubsidy = BigDecimal.valueOf(0.00); @@ -687,9 +690,8 @@ orderRebateVO.setUserLevel(userLevel.name()); } - // 涓婄骇杩斿埄 + // 瓒呯骇浼氬憳杩斿埄 if (upperLevel != null) { - upperTotalMoney = upperTotalMoney.add(hongBao); orderRebateVO.setUpperFanLi("楼" + upperTotalMoney); orderRebateVO.setJumpLink(upperLevel.getDetailLink()); } @@ -746,14 +748,14 @@ } } else { Date accountTime = hongBaoV2.getGetTime(); - if (accountTime != null) { + // 鍒拌处鏃堕棿 -绾㈠寘閲戦闄愬埗 + if (accountTime != null && hongBao.compareTo(Constant.REWARD_COUPON_LIMIT_MONEY) <= 0) { boolean vip = userInviteService.verifyVIP(uid); Date endDay = DateUtil.plusDayDate(Constant.COUPON_REWARD_LIMIT_DAY, accountTime); long currentTime = java.lang.System.currentTimeMillis(); if (endDay.getTime() > currentTime && !vip) { UserSystemCouponRecord couponRecord = userSystemCouponRecordService.getRecordByOrderNo(orderNo, null); - if (couponRecord == null - || (couponRecord.getCouponType() == CouponTypeEnum.rebatePercentCoupon.name() && couponRecord.getState() != UserSystemCouponRecord.STATE_SUCCESS)) { + if (couponRecord == null) { orderRebateVO.setCoupon(true); orderRebateVO.setCouponType(1); orderRebateVO.setCouponText("绔嬪嵆浣跨敤"); @@ -768,87 +770,4 @@ 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)); - } - } -- Gitblit v1.8.0