admin
2019-08-26 37d6133c476453827cefc38e4bdeb2c5246d9ce9
分享爆款返利比例修改
2个文件已修改
100 ■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/RecommendController.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/TaoLiJinControllerV2.java 94 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/RecommendController.java
@@ -2185,6 +2185,8 @@
        // 红包
        if (hongBao == null) {
            BigDecimal proportion = manageService.getFanLiRate();
            if ("taolijin".equalsIgnoreCase(from))
                proportion = manageService.getTLJShareRate(System.currentTimeMillis());
            hongBao = TaoBaoUtil.getGoodsHongBaoInfo(tb, proportion);
        }
        goodsJson.put("hongBao", hongBao);
@@ -2273,7 +2275,7 @@
        // 推广红包
        if (from != null && from.equals("taolijin")) {
            // 计算推广红包
            String warningRate = configTaoLiJinService.getValueByKey("warning_value",null);
            String warningRate = configTaoLiJinService.getValueByKey("warning_value", null);
            BigDecimal spreadMoney = TaoLiJinUtil.getSpreadMoney(warningRate, goods);
            // 推广红包 不能小于1
@@ -2332,7 +2334,7 @@
                data.put("userHongbao", userMoneyExtra.getTlj().setScale(2).toString());
            }
            noRebateHelpLink = configTaoLiJinService.getValueByKey("share_goods_help_link",null);
            noRebateHelpLink = configTaoLiJinService.getValueByKey("share_goods_help_link", null);
            if (Constant.IS_TEST) {
                fanliValid = true;
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/TaoLiJinControllerV2.java
@@ -239,7 +239,7 @@
        if (todayUse == null || todayUse.compareTo(zero) > 0) {
            todayUse = zero;
        }
        BigDecimal yesterdayUse = userTaoLiJinDetailService.countUseMoneyByDate(uid, 2);
        if (yesterdayUse == null || yesterdayUse.compareTo(zero) > 0) {
            yesterdayUse = zero;
@@ -252,10 +252,9 @@
        if (lastMonthUse == null || lastMonthUse.compareTo(zero) > 0) {
            lastMonthUse = zero;
        }
        // 问号链接
        String helpLink = configTaoLiJinService.getValueByKey("hongbao_help_link",null);
        String helpLink = configTaoLiJinService.getValueByKey("hongbao_help_link", null);
        JSONObject data = new JSONObject();
        data.put("tlj", tlj.setScale(2).toString());
@@ -398,7 +397,7 @@
                // 已领取
                money = deviceRecord.getMoney();
            } else {
                String value = configTaoLiJinService.getValueByKey("hongbao_newbies",null);
                String value = configTaoLiJinService.getValueByKey("hongbao_newbies", null);
                if (StringUtil.isNullOrEmpty(value)) {
                    out.print(JsonUtil.loadFalseResult(1, "系统红包不存在"));
                    return;
@@ -408,7 +407,7 @@
            }
            JSONObject data = new JSONObject();
            data.put("icon", configTaoLiJinService.getValueByKey("taolijin_system_icon",null));
            data.put("icon", configTaoLiJinService.getValueByKey("taolijin_system_icon", null));
            data.put("title", "新人红包");
            data.put("content", "自购直接抵现,优惠真实可见!");
            data.put("type", 1);
@@ -416,8 +415,8 @@
            data.put("usage", "领取成功,已存入“我的-推广红包”");
            data.put("jumpName", "去使用");
            data.put("jumpDetail", jumpDetailV2Service.getByTypeCache("share_goods_hot"));
            data.put("tip", configTaoLiJinService.getValueByKey("hongbao_newbies_tip",null));
            data.put("rules", configTaoLiJinService.getValueByKey("newbies_rules_link",null));
            data.put("tip", configTaoLiJinService.getValueByKey("hongbao_newbies_tip", null));
            data.put("rules", configTaoLiJinService.getValueByKey("newbies_rules_link", null));
            out.print(JsonUtil.loadTrueResult(data));
            return;
@@ -426,7 +425,7 @@
        // 登录用户
        boolean isReceive = false;
        JSONObject data = new JSONObject();
        data.put("icon", configTaoLiJinService.getValueByKey("taolijin_system_icon",null));
        data.put("icon", configTaoLiJinService.getValueByKey("taolijin_system_icon", null));
        if (type.equals(TaoLiJinOriginEnum.newbiesWin.name())) {
            BigDecimal hasMoney = null;
@@ -450,8 +449,8 @@
            data.put("usage", "领取成功,已存入“我的-推广红包”");
            data.put("jumpName", "去使用");
            data.put("jumpDetail", jumpDetailV2Service.getByTypeCache("share_goods_hot"));
            data.put("tip", configTaoLiJinService.getValueByKey("hongbao_newbies_tip",null));
            data.put("rules", configTaoLiJinService.getValueByKey("newbies_rules_link",null));
            data.put("tip", configTaoLiJinService.getValueByKey("hongbao_newbies_tip", null));
            data.put("rules", configTaoLiJinService.getValueByKey("newbies_rules_link", null));
        } else if (type.equals(TaoLiJinOriginEnum.rankWin.name())) {
            boolean isRank = false;
@@ -487,8 +486,8 @@
                data.put("money", "本月账户等级未达到\r\n继续加油");
                data.put("jumpName", "去查看");
                data.put("jumpDetail", jumpDetailV2Service.getByTypeCache("user_rank"));
                data.put("tip", configTaoLiJinService.getValueByKey("hongbao_rank_not_enough_tip",null));
                data.put("rules", configTaoLiJinService.getValueByKey("rank_rules_link",null));
                data.put("tip", configTaoLiJinService.getValueByKey("hongbao_rank_not_enough_tip", null));
                data.put("rules", configTaoLiJinService.getValueByKey("rank_rules_link", null));
                out.print(JsonUtil.loadTrueResult(data));
                return;
            } else {
@@ -503,8 +502,8 @@
                }
                data.put("jumpName", "去使用");
                data.put("jumpDetail", jumpDetailV2Service.getByTypeCache("share_goods_hot"));
                data.put("tip", configTaoLiJinService.getValueByKey("hongbao_rank_tip",null));
                data.put("rules", configTaoLiJinService.getValueByKey("rank_rules_link",null));
                data.put("tip", configTaoLiJinService.getValueByKey("hongbao_rank_tip", null));
                data.put("rules", configTaoLiJinService.getValueByKey("rank_rules_link", null));
            }
        } else {
@@ -548,7 +547,7 @@
            }
        }
        BigDecimal proportion = hongBaoManageService.getFanLiRate();
        BigDecimal proportion = hongBaoManageService.getTLJShareRate(System.currentTimeMillis());
        for (ShareHotGoods hotGoods : listHot) {
            TaoBaoGoodsBrief taoBaoGoodsBrief = hotGoods.getGoods();
            if (taoBaoGoodsBrief == null) {
@@ -556,7 +555,7 @@
            }
            // 计算推广红包
            String warningRate = configTaoLiJinService.getValueByKey("warning_value",new Date());
            String warningRate = configTaoLiJinService.getValueByKey("warning_value", new Date());
            BigDecimal spreadMoney = TaoLiJinUtil.getSpreadMoney(warningRate, taoBaoGoodsBrief);
            // 推广红包 不能小于1
@@ -580,8 +579,8 @@
            array.add(gson.toJson(extra));
        }
        /*// 过期 -取消收回
         * executor.execute(new Runnable() {
        /*
         * // 过期 -取消收回 executor.execute(new Runnable() {
         * 
         * @Override public void run() {
         * userTaoLiJinOriginService.overdueHongBao(uid); } });
@@ -592,10 +591,10 @@
        data.put("list", array);
        out.print(JsonUtil.loadTrueResult(data));
    }
    /**
     * 分享爆款商品-限于淘礼金
     *
     * @param acceptData
     * @param uid
     * @param out
@@ -606,20 +605,19 @@
            out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
            return;
        }
        String day = TimeUtil.getGernalTime(java.lang.System.currentTimeMillis());
        List<ShareHotGoods> listHot = shareHotGoodsService.listByDay(day);
        if (listHot == null) {
            listHot = new ArrayList<ShareHotGoods>();
            listHot = new ArrayList<ShareHotGoods>();
        }
        JSONArray array = new JSONArray();
        Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
                .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
        //取消新人自购
        boolean isNewUser = false;//userInfoExtraService.isNewUser(uid);
        // 取消新人自购
        boolean isNewUser = false;// userInfoExtraService.isNewUser(uid);
        if (isNewUser) {
            // 判定为老用户: 新人只要使用了新人红包,也就是那1块钱,那么,他看到的分享爆款中的商品-就只能分享。
            long countRecord = userTaoLiJinRecordService.countRecordByUid(uid);
@@ -627,8 +625,7 @@
                isNewUser = false;
            }
        }
        BigDecimal fanLiRate = hongBaoManageService.getTLJShareRate(System.currentTimeMillis());
        BigDecimal shareRate = hongBaoManageService.getTLJShareRate(System.currentTimeMillis());
        for (ShareHotGoods hotGoods : listHot) {
@@ -636,24 +633,24 @@
            if (taoBaoGoodsBrief == null) {
                continue;
            }
            // 计算推广红包
            String warningRate = configTaoLiJinService.getValueByKey("warning_value",new Date());
            String warningRate = configTaoLiJinService.getValueByKey("warning_value", new Date());
            BigDecimal spreadMoney = TaoLiJinUtil.getSpreadMoney(warningRate, taoBaoGoodsBrief);
            // 推广红包 不能小于1
            if (spreadMoney.compareTo(new BigDecimal(1.1)) < 0) {
                continue;
            }
            GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, null, fanLiRate, shareRate);
            // 去掉标签
            detailVO.setLabels(null);
            MoneyInfoVO moneyInfo = detailVO.getMoneyInfo();
            OtherInfo otherInfo = new OtherInfo();
            SpreadHongBao spreadHongBao = new SpreadHongBao();
            // 显示类型
            if (isNewUser) {
                moneyInfo.setMoneyType(1);
@@ -667,25 +664,23 @@
            detailVO.setMoneyInfo(moneyInfo);
            otherInfo.setSpreadHongBao(spreadHongBao);
            detailVO.setOtherInfo(otherInfo);
            array.add(gson.toJson(detailVO));
        }
        /*
         * executor.execute(new Runnable() {
         * 
         * @Override public void run() { // 过期
         * userTaoLiJinOriginService.overdueHongBao(uid); } });
         */
        JSONObject data = new JSONObject();
        data.put("count", array.size());
        data.put("list", array);
        out.print(JsonUtil.loadTrueResult(data));
    }
    /**
     * 分享爆款商品-限于淘礼金
     * 
@@ -749,18 +744,17 @@
        data.put("list", array);
        if (page == 1) {
            List<SwiperPicture> bannerList = swiperPictureService.getByBannerCard("zigoulijian_banner");
            if (bannerList != null && bannerList.size() > 0)
                data.put("topPicture", bannerList.get(0).getSrc());
            else
                data.put("topPicture", "");
            data.put("ruleUrl", configService.get("zigoulijian_rule"));
        }
        out.print(JsonUtil.loadTrueResult(data));
    }
    /**
     * 分享爆款商品-限于淘礼金
     * 
@@ -796,16 +790,14 @@
                continue;
            }
            GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, null, proportion, proportion);
            // 去掉标签
            detailVO.setLabels(null);
            MoneyInfoVO moneyInfo = detailVO.getMoneyInfo();
            moneyInfo.setMoneyType(2);
            detailVO.setMoneyInfo(moneyInfo);
            String hongBao = spreadMoney.toString();
            ReduceHongBao vo = new ReduceHongBao();
            vo.setLeft(hotGoods.getLeftHongBaoCount());
@@ -813,11 +805,11 @@
            vo.setName("付款立减 ");
            vo.setTip("");
            vo.setTotal(hotGoods.getTotalHongBaoCount());
            OtherInfo otherInfo = new OtherInfo();
            otherInfo.setReduceHongBao(vo);
            detailVO.setOtherInfo(otherInfo);
            array.add(gson.toJson(detailVO));
        }
@@ -829,12 +821,12 @@
        data.put("list", array);
        if (page == 1) {
            List<SwiperPicture> bannerList = swiperPictureService.getByBannerCard("zigoulijian_banner");
            if (bannerList != null && bannerList.size() > 0)
                data.put("topPicture", bannerList.get(0).getSrc());
            else
                data.put("topPicture", "");
            data.put("ruleUrl", configService.get("zigoulijian_rule"));
        }
        out.print(JsonUtil.loadTrueResult(data));