| | |
| | | if (todayUse == null || todayUse.compareTo(zero) > 0) {
|
| | | todayUse = zero;
|
| | | }
|
| | | |
| | |
|
| | | BigDecimal yesterdayUse = userTaoLiJinDetailService.countUseMoneyByDate(uid, 2);
|
| | | if (yesterdayUse == null || yesterdayUse.compareTo(zero) > 0) {
|
| | | yesterdayUse = zero;
|
| | |
| | | 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());
|
| | |
| | | // 已领取
|
| | | 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;
|
| | |
| | | }
|
| | |
|
| | | 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);
|
| | |
| | | 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;
|
| | |
| | | // 登录用户
|
| | | 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;
|
| | |
| | | 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;
|
| | |
| | | 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 {
|
| | |
| | | }
|
| | | 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 {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | BigDecimal proportion = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal proportion = hongBaoManageService.getTLJShareRate(System.currentTimeMillis());
|
| | | for (ShareHotGoods hotGoods : listHot) {
|
| | | TaoBaoGoodsBrief taoBaoGoodsBrief = hotGoods.getGoods();
|
| | | if (taoBaoGoodsBrief == null) {
|
| | |
| | | }
|
| | |
|
| | | // 计算推广红包
|
| | | String warningRate = configTaoLiJinService.getValueByKey("warning_value",new Date());
|
| | | String warningRate = configTaoLiJinService.getValueByKey("warning_value", new Date());
|
| | | BigDecimal spreadMoney = TaoLiJinUtil.getSpreadMoney(warningRate, taoBaoGoodsBrief);
|
| | |
|
| | | // 推广红包 不能小于1
|
| | |
| | | array.add(gson.toJson(extra));
|
| | | }
|
| | |
|
| | | /*// 过期 -取消收回
|
| | | * executor.execute(new Runnable() {
|
| | | /*
|
| | | * // 过期 -取消收回 executor.execute(new Runnable() {
|
| | | *
|
| | | * @Override public void run() {
|
| | | * userTaoLiJinOriginService.overdueHongBao(uid); } });
|
| | |
| | | data.put("list", array);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 分享爆款商品-限于淘礼金
|
| | | * |
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param out
|
| | |
| | | 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);
|
| | |
| | | isNewUser = false;
|
| | | }
|
| | | }
|
| | | |
| | | |
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getTLJShareRate(System.currentTimeMillis());
|
| | | BigDecimal shareRate = hongBaoManageService.getTLJShareRate(System.currentTimeMillis());
|
| | | for (ShareHotGoods hotGoods : listHot) {
|
| | |
| | | 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);
|
| | |
| | | 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));
|
| | | }
|
| | |
|
| | | |
| | | |
| | | /**
|
| | | * 分享爆款商品-限于淘礼金
|
| | | *
|
| | |
| | | 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));
|
| | | }
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 分享爆款商品-限于淘礼金
|
| | | *
|
| | |
| | | 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());
|
| | |
| | | vo.setName("付款立减 ");
|
| | | vo.setTip("");
|
| | | vo.setTotal(hotGoods.getTotalHongBaoCount());
|
| | | |
| | |
|
| | | OtherInfo otherInfo = new OtherInfo();
|
| | | otherInfo.setReduceHongBao(vo);
|
| | | detailVO.setOtherInfo(otherInfo);
|
| | | |
| | |
|
| | | array.add(gson.toJson(detailVO));
|
| | | }
|
| | |
|
| | |
| | | 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));
|