| | |
| | | import com.google.gson.reflect.TypeToken; |
| | | import com.yeshi.fanli.dto.ConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail; |
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum; |
| | | import com.yeshi.fanli.entity.dynamic.CommentInfo; |
| | | import com.yeshi.fanli.entity.dynamic.CommentInfo.CommentInfoEnum; |
| | | import com.yeshi.fanli.entity.dynamic.GoodsEvaluate; |
| | |
| | | GoodsDetailVO goodsDetail = null; |
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate(); |
| | | BigDecimal shareRate = hongBaoManageService.getShareRate(); |
| | | BigDecimal vipFanLiRate = hongBaoManageService.getVIPFanLiRate(); |
| | | BigDecimal vipFanLiRate = hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP); |
| | | ConfigParamsDTO params = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE, vipFanLiRate); |
| | | |
| | | if (commonGoods.getGoodsType() == Constant.SOURCE_TYPE_TAOBAO) { |
| | |
| | | import com.yeshi.fanli.dto.pdd.PDDSearchFilter;
|
| | | import com.yeshi.fanli.entity.bus.share.UserShareGoodsGroup;
|
| | | import com.yeshi.fanli.entity.bus.share.UserShareGoodsRecord;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
|
| | | import com.yeshi.fanli.entity.goods.CommonGoods;
|
| | | import com.yeshi.fanli.entity.jd.JDGoods;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | |
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO configParamsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,
|
| | | hongBaoManageService.getVIPFanLiRate());
|
| | | hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP));
|
| | |
|
| | |
|
| | | for (UserShareGoodsGroup goodsGroup : list) {
|
| | |
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.brand.BrandClass;
|
| | | import com.yeshi.fanli.entity.brand.TaoBaoShopHistory;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
|
| | | import com.yeshi.fanli.entity.system.ConfigKeyEnum;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoShop;
|
| | |
| | |
|
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|
| | | BigDecimal proportion = manageService.getFanLiRate();
|
| | | BigDecimal proportion = manageService.getFanLiRate(UserLevelEnum.daRen);
|
| | |
|
| | | for (TaoBaoGoodsBrief taoBaoGoodsBrief : listGoodsBrief) {
|
| | | if (listTaoKeGoods != null && listTaoKeGoods.size() > 0) {
|
| | |
| | |
|
| | | @RequestMapping(value = "updateApp")
|
| | | public void updateApp(AcceptData acceptData, PrintWriter out) {
|
| | | if (Constant.IS_TEST)
|
| | | acceptData.setVersion("20");
|
| | | String result = appUpdateManager.getUpdateInfoCache(acceptData);
|
| | | try {
|
| | | out.print(new String(result.getBytes("ISO-8859-1"), "UTF-8"));
|
| | |
| | | import com.yeshi.fanli.entity.bus.lable.QualityFactory;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.exception.taobao.TaoKeApiException;
|
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
|
| | |
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|
| | |
|
| | | ConfigParamsDTO configParamsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
|
| | | acceptData.getVersion());
|
| | | acceptData.getVersion(),UserLevelEnum.daRen);
|
| | | /* 遍历列表数据 */
|
| | | for (QualityFactory selectionGoods : listQuery) {
|
| | |
|
| | |
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.user.ShamUser;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
|
| | | import com.yeshi.fanli.entity.goods.CollectionGoodsV2;
|
| | | import com.yeshi.fanli.entity.goods.CommonGoods;
|
| | | import com.yeshi.fanli.entity.jd.JDGoods;
|
| | |
| | | import com.yeshi.fanli.service.inter.user.integral.IntegralGetService;
|
| | | import com.yeshi.fanli.service.inter.user.vip.UserVIPInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.vip.UserVipConfigService;
|
| | | import com.yeshi.fanli.util.BeanUtil;
|
| | | import com.yeshi.fanli.service.manger.user.UserLevelManager;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | |
| | | import com.yeshi.fanli.util.pinduoduo.PinDuoDuoUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | | import com.yeshi.fanli.util.user.UserLevelUtil;
|
| | | import com.yeshi.fanli.vo.goods.CouponInfoVO;
|
| | | import com.yeshi.fanli.vo.goods.GoodsDetailExtraVO;
|
| | | import com.yeshi.fanli.vo.goods.GoodsDetailVO;
|
| | |
| | |
|
| | | @Resource
|
| | | private GoodsEvaluateService goodsEvaluateService;
|
| | |
|
| | | @Resource
|
| | | private UserLevelManager userLevelManager;
|
| | |
|
| | | private ConfigParamsDTO getParamsDTO(String platform, String version, Long uid) {
|
| | | UserLevelEnum level = UserLevelEnum.daRen;
|
| | | if (uid != null && uid > 0) {
|
| | | level = userLevelManager.getUserLevel(uid);
|
| | | if (level != null) {
|
| | | if (System.currentTimeMillis() < Constant.NEW_ORDER_FANLI_RULE_TIME)
|
| | | level = UserLevelUtil.getOldLevel(level);
|
| | | }
|
| | | }
|
| | | if (level == null)
|
| | | level = UserLevelEnum.daRen;
|
| | | return hongBaoManageService.getShowComputeRate(platform, version, level);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 淘宝商品详情
|
| | |
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | |
|
| | | ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
|
| | | acceptData.getVersion());
|
| | | ConfigParamsDTO paramsDTO = getParamsDTO(acceptData.getPlatform(), acceptData.getVersion(), uid);
|
| | | paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate());
|
| | |
|
| | | GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertTaoBao(goods, paramsDTO);
|
| | | if (goodsDetail != null && goodsDetail.getMoneyInfo() != null && userVIPInfoService.isVIP(uid)) {
|
| | | goodsDetail.getMoneyInfo().setFanliMoney(goodsDetail.getMoneyInfo().getMaxMoney());
|
| | | goodsDetail.getMoneyInfo().setShareMoney(
|
| | | "¥" + TaoBaoUtil.getGoodsHongBaoMoney(goods, hongBaoManageService.getVIPShareRate()));
|
| | | goodsDetail.getMoneyInfo().setShareMoney("¥" + TaoBaoUtil.getGoodsHongBaoMoney(goods,
|
| | | hongBaoManageService.getShareRate(UserLevelEnum.superVIP)));
|
| | | goodsDetail.getMoneyInfo().setRateInfo(goodsDetail.getMoneyInfo().getMaxRateInfo());
|
| | | goodsDetail.getMoneyInfo().setCompositionInfo(goodsDetail.getMoneyInfo().getMaxCompositionInfo());
|
| | | }
|
| | |
| | | e.printStackTrace();
|
| | | }
|
| | | coupon.setShopCoupon(true);
|
| | | coupon.setLink("https://uland.taobao.com/quan/detail?sellerId=725677994&activityId=d03aa6d23a5a4040afb3942e7ea9a007");
|
| | | coupon.setLink(
|
| | | "https://uland.taobao.com/quan/detail?sellerId=725677994&activityId=d03aa6d23a5a4040afb3942e7ea9a007");
|
| | | couponInfoList.add(coupon);
|
| | | }
|
| | | goodsDetail.setCouponInfoList(couponInfoList);
|
| | |
| | | // 保存缓存
|
| | | jdGoodsCacheUtil.saveGoodsInfo(jdGoods);
|
| | |
|
| | | ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
|
| | | acceptData.getVersion());
|
| | | ConfigParamsDTO paramsDTO = getParamsDTO(acceptData.getPlatform(), acceptData.getVersion(), uid);
|
| | | paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate());
|
| | | GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertJDGoods(jdGoods, paramsDTO);
|
| | | if (goodsDetail != null && goodsDetail.getMoneyInfo() != null && userVIPInfoService.isVIP(uid)) {
|
| | | goodsDetail.getMoneyInfo().setFanliMoney(goodsDetail.getMoneyInfo().getMaxMoney());
|
| | | goodsDetail.getMoneyInfo()
|
| | | .setShareMoney("¥" + JDUtil.getGoodsFanLiMoney(jdGoods, hongBaoManageService.getVIPShareRate()));
|
| | | goodsDetail.getMoneyInfo().setShareMoney("¥"
|
| | | + JDUtil.getGoodsFanLiMoney(jdGoods, hongBaoManageService.getShareRate(UserLevelEnum.superVIP)));
|
| | | goodsDetail.getMoneyInfo().setRateInfo(goodsDetail.getMoneyInfo().getMaxRateInfo());
|
| | | goodsDetail.getMoneyInfo().setCompositionInfo(goodsDetail.getMoneyInfo().getMaxCompositionInfo());
|
| | | }
|
| | |
| | | otherInfo.setFanliMoneyPlus("京东plus返¥" + fanliMoneyPlus);
|
| | | // 使用奖励券最高返
|
| | | if (VersionUtil.greaterThan_2_0_5(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | maxMoneyPlus = "(京东plus返¥"
|
| | | + JDUtil.getGoodsFanLiMoneyPlus(jdGoods, hongBaoManageService.getVIPFanLiRate()) + ")";
|
| | | maxMoneyPlus = "(京东plus返¥" + JDUtil.getGoodsFanLiMoneyPlus(jdGoods,
|
| | | hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP)) + ")";
|
| | | } else
|
| | | maxMoneyPlus = "(京东plus最高返¥"
|
| | | + fanliMoneyPlus.add(MoneyBigDecimalUtil.mul(fanliMoneyPlus, Constant.MAX_REWARD_RATE))
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
|
| | | acceptData.getVersion());
|
| | | ConfigParamsDTO paramsDTO = getParamsDTO(acceptData.getPlatform(), acceptData.getVersion(), uid);
|
| | | paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate());
|
| | |
|
| | | GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertPDDGoods(pddGoods, paramsDTO);
|
| | | if (goodsDetail != null && goodsDetail.getMoneyInfo() != null && userVIPInfoService.isVIP(uid)) {
|
| | | goodsDetail.getMoneyInfo().setFanliMoney(goodsDetail.getMoneyInfo().getMaxMoney());
|
| | | goodsDetail.getMoneyInfo().setShareMoney(
|
| | | "¥" + PinDuoDuoUtil.getGoodsFanLiMoney(pddGoods, hongBaoManageService.getVIPShareRate()));
|
| | | goodsDetail.getMoneyInfo().setShareMoney("¥" + PinDuoDuoUtil.getGoodsFanLiMoney(pddGoods,
|
| | | hongBaoManageService.getShareRate(UserLevelEnum.superVIP)));
|
| | | goodsDetail.getMoneyInfo().setRateInfo(goodsDetail.getMoneyInfo().getMaxRateInfo());
|
| | | goodsDetail.getMoneyInfo().setCompositionInfo(goodsDetail.getMoneyInfo().getMaxCompositionInfo());
|
| | | }
|
| | |
| | | list = list.subList(0, 10);
|
| | | }
|
| | |
|
| | | ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
|
| | | acceptData.getVersion());
|
| | | ConfigParamsDTO paramsDTO = getParamsDTO(acceptData.getPlatform(), acceptData.getVersion(), null);
|
| | | List<GoodsDetailVO> listDetailVO = new ArrayList<GoodsDetailVO>();
|
| | |
|
| | | for (JDGoods goods : list) {
|
| | |
| | | goodsList = goodsList.subList(0, 10);
|
| | | }
|
| | |
|
| | | ConfigParamsDTO paramsDTO = hongBaoManageService
|
| | | .getShowComputeRate(acceptData.getPlatform(), acceptData.getVersion());
|
| | | ConfigParamsDTO paramsDTO = getParamsDTO(acceptData.getPlatform(), acceptData.getVersion(),
|
| | | null);
|
| | | for (PDDGoodsDetail goods : goodsList) {
|
| | | listDetailVO.add(GoodsDetailVOFactory.convertPDDGoods(goods, paramsDTO));
|
| | | }
|
| | |
| | |
|
| | | if (goodsList != null && goodsList.size() > 0) {
|
| | |
|
| | | ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
|
| | | acceptData.getVersion());
|
| | | ConfigParamsDTO paramsDTO = getParamsDTO(acceptData.getPlatform(), acceptData.getVersion(), null);
|
| | |
|
| | | goodsList.parallelStream().forEach(goods -> {
|
| | | if (goods != null) {
|
| | |
| | | Map<String, GoodsDetailVO> tempGoodsList = new HashMap<>();
|
| | |
|
| | | ConfigParamsDTO params = new ConfigParamsDTO(hongBaoManageService.getFanLiRate(),
|
| | | hongBaoManageService.getShareRate(), new BigDecimal(80), hongBaoManageService.getVIPFanLiRate());
|
| | | hongBaoManageService.getShowComputeRate(acceptData.getPlatform(), acceptData.getVersion());
|
| | | hongBaoManageService.getShareRate(), new BigDecimal(80),
|
| | | hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP));
|
| | |
|
| | | if (tbGoodsList.size() > 0) {
|
| | | List<TaoBaoGoodsBrief> goodsList = null;
|
| | |
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.Special;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
|
| | | import com.yeshi.fanli.entity.common.JumpDetailV2;
|
| | | import com.yeshi.fanli.entity.jd.JDGoods;
|
| | | import com.yeshi.fanli.entity.system.ConfigKeyEnum;
|
| | |
| | | if (list != null && list.size() > 0) {
|
| | | BigDecimal rateBuy = TaoBaoConstant.OWN_BUY_WITHOUT_FANLI_RATE;
|
| | | ConfigParamsDTO paramsBuy = new ConfigParamsDTO(rateBuy, rateBuy, Constant.MAX_REWARD_RATE,
|
| | | hongBaoManageService.getVIPFanLiRate());
|
| | | hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP));
|
| | | for (int i = list.size() - 1; i >= 0; i--) {
|
| | | TLJBuyGoods goods = list.get(i);
|
| | | GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(goods.getGoods(), paramsBuy);
|
| | |
| | | import com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo; |
| | | import com.yeshi.fanli.entity.bus.user.UserInfo; |
| | | import com.yeshi.fanli.entity.bus.user.UserInfoExtra; |
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum; |
| | | import com.yeshi.fanli.entity.goods.CommonGoods; |
| | | import com.yeshi.fanli.entity.jd.JDGoods; |
| | | import com.yeshi.fanli.entity.system.ConfigKeyEnum; |
| | |
| | | |
| | | // 设置评论文本选项 |
| | | shareInfo.setCommentTextChoiceList(getCommentChoiceList(shareInfo.getCommentText(), null, inviteCode, |
| | | TaoBaoUtil.getGoodsHongBaoMoney(taoBaoLink.getGoods(), hongBaoManageService.getVIPFanLiRate()))); |
| | | TaoBaoUtil.getGoodsHongBaoMoney(taoBaoLink.getGoods(), hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP)))); |
| | | |
| | | out.print(JsonUtil.loadTrueResult( |
| | | JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()).create().toJson(shareInfo))); |
| | |
| | | |
| | | // 设置评论文本选项 |
| | | shareInfo.setCommentTextChoiceList(getCommentChoiceList(null, shareInfo.getCommentText(), inviteCode, |
| | | JDUtil.getGoodsFanLiMoney(jdGoods, hongBaoManageService.getVIPFanLiRate()))); |
| | | JDUtil.getGoodsFanLiMoney(jdGoods, hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP)))); |
| | | |
| | | out.print(JsonUtil.loadTrueResult( |
| | | JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()).create().toJson(shareInfo))); |
| | |
| | | .setGoodsInfo(GoodsDetailVOFactory.convertPDDGoods(goods, |
| | | new ConfigParamsDTO(hongBaoManageService.getFanLiRate(), |
| | | hongBaoManageService.getShareRate(), Constant.MAX_REWARD_RATE, |
| | | hongBaoManageService.getVIPFanLiRate()))); |
| | | hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP)))); |
| | | } |
| | | |
| | | // 创建口令 |
| | |
| | | |
| | | // 设置评论文本选项 |
| | | shareInfo.setCommentTextChoiceList(getCommentChoiceList(null, shareInfo.getCommentText(), inviteCode, |
| | | PinDuoDuoUtil.getGoodsFanLiMoney(goods, hongBaoManageService.getVIPFanLiRate()))); |
| | | PinDuoDuoUtil.getGoodsFanLiMoney(goods, hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP)))); |
| | | |
| | | out.print(JsonUtil.loadTrueResult( |
| | | JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()).create().toJson(shareInfo))); |
| | |
| | | import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinDetail.TaoLiJinDetailTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinNewbies;
|
| | | import com.yeshi.fanli.entity.bus.user.UserMoneyExtra;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
|
| | | import com.yeshi.fanli.entity.system.ConfigKeyEnum;
|
| | | import com.yeshi.fanli.entity.taobao.ShareHotGoods;
|
| | | import com.yeshi.fanli.entity.taobao.TLJBuyGoods;
|
| | |
| | |
|
| | | @Resource
|
| | | private TLJFreeBuyGoodsService tljFreeBuyGoodsService;
|
| | | |
| | |
|
| | | /**
|
| | | * 获取淘礼金分享记录
|
| | |
| | | data.put("data", gson.toJson(list));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | |
| | |
|
| | | /**
|
| | | * 分享爆款商品-限于淘礼金
|
| | |
| | | data.put("count", array.size());
|
| | | data.put("list", array);
|
| | | if (page == 1) {
|
| | | List<SwiperPicture> bannerList = swiperPictureService.getByBannerCardAndVersion("zigoulijian_banner",acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
|
| | | List<SwiperPicture> bannerList = swiperPictureService.getByBannerCardAndVersion("zigoulijian_banner",
|
| | | acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
|
| | |
|
| | | if (bannerList != null && bannerList.size() > 0)
|
| | | data.put("topPicture", bannerList.get(0).getSrc());
|
| | |
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|
| | |
|
| | | BigDecimal proportion = TaoBaoConstant.OWN_BUY_WITHOUT_FANLI_RATE;
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(proportion, proportion, Constant.MAX_REWARD_RATE,hongBaoManageService.getVIPFanLiRate());
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(proportion, proportion, Constant.MAX_REWARD_RATE,
|
| | | hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP));
|
| | | for (TLJBuyGoods hotGoods : listHot) {
|
| | | TaoBaoGoodsBrief taoBaoGoodsBrief = hotGoods.getGoods();
|
| | | if (taoBaoGoodsBrief == null) {
|
| | |
| | | data.put("count", array.size());
|
| | | data.put("list", array);
|
| | | if (page == 1) {
|
| | | List<SwiperPicture> bannerList = swiperPictureService.getByBannerCardAndVersion("zigoulijian_banner",acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
|
| | | List<SwiperPicture> bannerList = swiperPictureService.getByBannerCardAndVersion("zigoulijian_banner",
|
| | | acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
|
| | |
|
| | | if (bannerList != null && bannerList.size() > 0)
|
| | | data.put("topPicture", bannerList.get(0).getSrc());
|
| | |
| | | out.print(JsonUtil.loadFalseResult(1, "抱歉,推广红包相关功能已下线!"));
|
| | | }
|
| | |
|
| | | |
| | | |
| | | /**
|
| | | * 新人红包详情
|
| | | *
|
| | |
| | | }
|
| | |
|
| | | // 2、顶部轮播图
|
| | | List<SwiperPicture> oldtopPicList = swiperPictureService.getByBannerCardAndVersion("redpack_win_detail_banner",acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
|
| | | List<SwiperPicture> oldtopPicList = swiperPictureService.getByBannerCardAndVersion(
|
| | | "redpack_win_detail_banner", acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
|
| | | List<SwiperPicture> topPicList = new ArrayList<>();
|
| | | if (oldtopPicList != null && oldtopPicList.size() > 0)
|
| | | topPicList.addAll(oldtopPicList);
|
| | |
| | | out.print(JsonUtil.loadFalseResult(1, "红包已被抢光啦"));
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | /**
|
| | | * 新人免单列表
|
| | |
| | | import com.yeshi.fanli.entity.bus.share.UserShareGoodsHistory;
|
| | | import com.yeshi.fanli.entity.bus.user.ShamUser;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
|
| | | import com.yeshi.fanli.entity.goods.CollectionGoodsV2;
|
| | | import com.yeshi.fanli.entity.jd.JDGoods;
|
| | | import com.yeshi.fanli.entity.jd.JDGoodsClass;
|
| | |
| | | if (goodsDetail != null && goodsDetail.getMoneyInfo() != null && userVIPInfoService.isVIP(uid)) {
|
| | | goodsDetail.getMoneyInfo().setFanliMoney(goodsDetail.getMoneyInfo().getMaxMoney());
|
| | | goodsDetail.getMoneyInfo()
|
| | | .setShareMoney("¥" + JDUtil.getGoodsFanLiMoney(jdGoods, hongBaoManageService.getVIPShareRate()));
|
| | | .setShareMoney("¥" + JDUtil.getGoodsFanLiMoney(jdGoods, hongBaoManageService.getShareRate(UserLevelEnum.superVIP)));
|
| | | goodsDetail.getMoneyInfo().setRateInfo(goodsDetail.getMoneyInfo().getMaxRateInfo());
|
| | | goodsDetail.getMoneyInfo().setCompositionInfo(goodsDetail.getMoneyInfo().getMaxCompositionInfo());
|
| | | }
|
| | |
| | | // 使用奖励券最高返
|
| | |
|
| | | maxMoneyPlus = "(京东plus返¥"
|
| | | + JDUtil.getGoodsFanLiMoneyPlus(jdGoods, hongBaoManageService.getVIPFanLiRate()) + ")";
|
| | | + JDUtil.getGoodsFanLiMoneyPlus(jdGoods, hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP)) + ")";
|
| | |
|
| | | }
|
| | | }
|
| | |
| | | if (goodsDetail != null && goodsDetail.getMoneyInfo() != null && userVIPInfoService.isVIP(uid)) {
|
| | | goodsDetail.getMoneyInfo().setFanliMoney(goodsDetail.getMoneyInfo().getMaxMoney());
|
| | | goodsDetail.getMoneyInfo().setShareMoney(
|
| | | "¥" + PinDuoDuoUtil.getGoodsFanLiMoney(pddGoods, hongBaoManageService.getVIPShareRate()));
|
| | | "¥" + PinDuoDuoUtil.getGoodsFanLiMoney(pddGoods, hongBaoManageService.getShareRate(UserLevelEnum.superVIP)));
|
| | | }
|
| | |
|
| | | if (goodsDetail.getCouponInfo() != null) {
|
| | |
| | | import com.yeshi.fanli.dto.ConfigParamsDTO;
|
| | | import com.yeshi.fanli.entity.bus.activity.RecommendActivity;
|
| | | import com.yeshi.fanli.entity.bus.activity.RecommendActivityInviteInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
|
| | | import com.yeshi.fanli.entity.dynamic.GoodsPicture;
|
| | | import com.yeshi.fanli.entity.dynamic.WXMPDynamicInfo;
|
| | | import com.yeshi.fanli.entity.goods.jd.NYouHuiGoods;
|
| | |
| | | GoodsDetailVOFactory.convertJDGoods(jdGoods,
|
| | | new ConfigParamsDTO(hongBaoManageService.getFanLiRate(),
|
| | | hongBaoManageService.getShareRate(), null,
|
| | | hongBaoManageService.getVIPFanLiRate())));
|
| | | hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP))));
|
| | | picture.setGoodState(0);
|
| | | picture.setJumpDetail(jumpDetailV2Service.getByTypeCache("goodsdetail"));
|
| | | picture.setParams(null);
|
| | |
| | | import com.yeshi.fanli.entity.bus.activity.RecommendActivityInviteInfo; |
| | | import com.yeshi.fanli.entity.bus.activity.RecommendActivityTaoBaoGoods; |
| | | import com.yeshi.fanli.entity.bus.clazz.GoodsClass; |
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum; |
| | | import com.yeshi.fanli.entity.common.JumpDetailV2; |
| | | import com.yeshi.fanli.entity.dynamic.DynamicInfo; |
| | | import com.yeshi.fanli.entity.dynamic.GoodsPicture; |
| | |
| | | |
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate(); |
| | | BigDecimal shareRate = hongBaoManageService.getShareRate(); |
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,hongBaoManageService.getVIPFanLiRate()); |
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP)); |
| | | |
| | | for (DynamicInfo dynamicInfo : list) { |
| | | DynamicInfo dynamicNew = new DynamicInfo(); |
| | |
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2;
|
| | | import com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
|
| | | import com.yeshi.fanli.entity.elme.ElmeHongBaoOrderMap;
|
| | | import com.yeshi.fanli.entity.elme.ElmeOrder;
|
| | | import com.yeshi.fanli.exception.elme.ElmeHongBaoOrderMapException;
|
| | |
| | | }
|
| | |
|
| | | private HongBaoV2 createHongBao(ElmeOrder elmeOrder, UserInfo userInfo) {
|
| | | BigDecimal fanliRate = hongBaoManageService.getFanLiRate(elmeOrder.getOrderDate().getTime());
|
| | | BigDecimal fanliRate = hongBaoManageService.getFanLiRate(UserLevelEnum.daRen,
|
| | | elmeOrder.getOrderDate().getTime());
|
| | | HongBaoV2 hongBao = new HongBaoV2();
|
| | | hongBao.setCreateTime(new Date());
|
| | | hongBao.setGetTime(null);
|
| | |
| | | new BigDecimal(100)));
|
| | | if (elmeOrder.getIsSettle() == true)
|
| | | hongBao.setPreGetTime(new Date(elmeOrder.getOrderDate().getTime() + 1000 * 60 * 60 * 24 * 15L));
|
| | | if (elmeOrder.getPayMoney().compareTo(new BigDecimal(0)) <= 0||(elmeOrder.getState()!=null&&elmeOrder.getState()==0))
|
| | | if (elmeOrder.getPayMoney().compareTo(new BigDecimal(0)) <= 0
|
| | | || (elmeOrder.getState() != null && elmeOrder.getState() == 0))
|
| | | hongBao.setState(HongBaoV2.STATE_SHIXIAO);
|
| | | else {
|
| | | if (elmeOrder.getIsSettle() == true) {
|
| | |
| | | import com.yeshi.fanli.entity.bus.user.ThreeSale;
|
| | | import com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
|
| | | import com.yeshi.fanli.entity.order.CommonOrder;
|
| | | import com.yeshi.fanli.entity.order.CommonOrderGoods;
|
| | | import com.yeshi.fanli.entity.order.HongBaoOrder;
|
| | |
| | | return false;
|
| | |
|
| | | if (type == HongBaoV2.TYPE_ZIGOU) {// 获取自购的返利比例
|
| | | BigDecimal fanliRate = hongBaoManageService.getFanLiRate(commonOrder.getCreateTime().getTime());
|
| | | BigDecimal fanliRate = hongBaoManageService.getFanLiRate(UserLevelEnum.daRen,commonOrder.getCreateTime().getTime());
|
| | | // 免单处理
|
| | | boolean mianDan = false;
|
| | | List<CommonOrder> orderList = commonOrderService.listBySourceTypeAndOrderId(Constant.SOURCE_TYPE_TAOBAO,
|
| | |
| | | && commonOrder.getSourcePosition().equalsIgnoreCase(TaoBaoConstant.TAOBAO_TLJ_RELATION_PID_DEFAULT))
|
| | | fanliRate = hongBaoManageService.getTLJShareRate(commonOrder.getCreateTime().getTime());
|
| | | else
|
| | | fanliRate = hongBaoManageService.getShareRate(commonOrder.getCreateTime().getTime());
|
| | | fanliRate = hongBaoManageService.getShareRate(UserLevelEnum.daRen,commonOrder.getCreateTime().getTime());
|
| | |
|
| | | List<ShareGoodsActivityOrder> list = shareGoodsActivityOrderService
|
| | | .listByOrderIdAndUid(commonOrder.getUserInfo().getId(), commonOrder.getOrderNo());
|
| | |
| | | private void saveHongBao(CommonOrder commonOrder, int type, Map<Integer, HongBaoOrder> notificationMap)
|
| | | throws HongBaoException, UserAccountException {
|
| | | if (type == HongBaoV2.TYPE_ZIGOU) {// 获取自购的返利比例
|
| | | BigDecimal fanliRate = hongBaoManageService.getFanLiRate(commonOrder.getCreateTime().getTime());
|
| | | BigDecimal fanliRate = hongBaoManageService.getFanLiRate(UserLevelEnum.daRen,commonOrder.getCreateTime().getTime());
|
| | | // 查询是否有免单计划
|
| | | BigDecimal mianDanMoney = null;
|
| | | if (commonOrder.getState() == CommonOrder.STATE_JS || commonOrder.getState() == CommonOrder.STATE_FK) {
|
| | |
| | | && commonOrder.getSourcePosition().equalsIgnoreCase(TaoBaoConstant.TAOBAO_TLJ_RELATION_PID_DEFAULT))// 来自于淘礼金的分享
|
| | | shareRate = hongBaoManageService.getTLJShareRate(commonOrder.getCreateTime().getTime());
|
| | | else
|
| | | shareRate = hongBaoManageService.getShareRate(commonOrder.getCreateTime().getTime());
|
| | | shareRate = hongBaoManageService.getShareRate(UserLevelEnum.daRen,commonOrder.getCreateTime().getTime());
|
| | |
|
| | | // 判断订单分享活动是否开启
|
| | | if ("1".equalsIgnoreCase(configService.get(ConfigKeyEnum.shareGoodsActivityOpen.getKey()))) {
|
| | |
| | | else
|
| | | return null;
|
| | | } else {
|
| | | BigDecimal rate = hongBaoManageService.getFanLiRate(order.getThirdCreateTime().getTime());
|
| | | BigDecimal rate = hongBaoManageService.getFanLiRate(UserLevelEnum.daRen,
|
| | | order.getThirdCreateTime().getTime());
|
| | | if (order.getState() == CommonOrder.STATE_JS || order.getState() == CommonOrder.STATE_WQ)
|
| | | return MoneyBigDecimalUtil.div(MoneyBigDecimalUtil.mul(rate, order.geteIncome()), new BigDecimal(100));
|
| | | else if (order.getEstimate() != null)
|
| | |
| | | import com.yeshi.fanli.dao.mybatis.order.OrderRepairHistoryMapper;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
|
| | | import com.yeshi.fanli.entity.goods.CommonGoods;
|
| | | import com.yeshi.fanli.entity.money.ExtractCheckCompensate;
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDetail;
|
| | |
| | | CommonOrder commonOrder = commonOrderService.selectByPrimaryKey(newCommonOrder.getId());
|
| | |
|
| | | if (hongBaoOrder.getHongBaoV2().getType() == HongBaoV2.TYPE_ZIGOU) {
|
| | | BigDecimal fanliRate = hongBaoManageService.getFanLiRate(commonOrder.getCreateTime().getTime());
|
| | | BigDecimal fanliRate = hongBaoManageService.getFanLiRate(UserLevelEnum.daRen,
|
| | | commonOrder.getCreateTime().getTime());
|
| | | // 免单处理
|
| | | boolean mianDan = false;
|
| | | List<CommonOrder> orderList = commonOrderService.listBySourceTypeAndOrderId(Constant.SOURCE_TYPE_TAOBAO,
|
| | |
| | | if (commonOrder.getState() == CommonOrder.STATE_JS)
|
| | | payMent = commonOrder.getSettlement();
|
| | | if (payMent.compareTo(new BigDecimal(10)) < 0) {
|
| | | mianDan = userSystemCouponRecordService.isSuccessMianDan(commonOrder.getSourceType(),commonOrder.getOrderNo());
|
| | | mianDan = userSystemCouponRecordService.isSuccessMianDan(commonOrder.getSourceType(),
|
| | | commonOrder.getOrderNo());
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | } else if (hongBaoOrder.getHongBaoV2().getType() == HongBaoV2.TYPE_SHARE_GOODS) {
|
| | |
|
| | | BigDecimal fanliRate = hongBaoManageService.getShareRate(commonOrder.getCreateTime().getTime());
|
| | | BigDecimal fanliRate = hongBaoManageService.getShareRate(UserLevelEnum.daRen,
|
| | | commonOrder.getCreateTime().getTime());
|
| | | List<ShareGoodsActivityOrder> list = shareGoodsActivityOrderService
|
| | | .listByOrderIdAndUid(commonOrder.getUserInfo().getId(), commonOrder.getOrderNo());
|
| | | if (list != null && list.size() > 0) {
|
| | |
| | |
|
| | | // 添加红包
|
| | | if (type == HongBaoV2.TYPE_ZIGOU) {// 获取自购的返利比例
|
| | | BigDecimal fanliRate = hongBaoManageService.getFanLiRate(commonOrder.getCreateTime().getTime());
|
| | | BigDecimal fanliRate = hongBaoManageService.getFanLiRate(UserLevelEnum.daRen,
|
| | | commonOrder.getCreateTime().getTime());
|
| | | // 查询是否有免单计划
|
| | | BigDecimal mianDanMoney = null;
|
| | | if (commonOrder.getState() == CommonOrder.STATE_JS || commonOrder.getState() == CommonOrder.STATE_FK) {
|
| | |
| | | if (commonOrder.getState() == CommonOrder.STATE_SX || commonOrder.getState() == CommonOrder.STATE_WQ)
|
| | | return;
|
| | | // 分享赚
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate(commonOrder.getCreateTime().getTime());
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate(UserLevelEnum.daRen,
|
| | | commonOrder.getCreateTime().getTime());
|
| | |
|
| | | HongBaoV2 hongBao = new HongBaoV2();
|
| | | hongBao.setBeizhu("2019年7月批量修改");
|
| | |
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.HongBaoManageMapper;
|
| | | import com.yeshi.fanli.dto.ConfigParamsDTO;
|
| | | import com.yeshi.fanli.dto.order.OrderHongBaoRateParams;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoManage;
|
| | | import com.yeshi.fanli.entity.order.CommonOrder;
|
| | | import com.yeshi.fanli.exception.order.HongBaoException;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public BigDecimal getFanLiRate(long time) {
|
| | | String key = "hongbao_goods_proportion";
|
| | | public BigDecimal getFanLiRate(UserLevelEnum level, long time) {
|
| | |
|
| | | HongBaoManage hongBaoManage = hongBaoManageMapper.selectByKeyAndMaxValidTime(key, time);
|
| | | if (hongBaoManage == null)
|
| | | hongBaoManage = hongBaoManageMapper.selectByKey(key);
|
| | | if (hongBaoManage != null)
|
| | | return new BigDecimal(hongBaoManage.getValue());
|
| | | LogHelper.error("获取返利分成比例出错");
|
| | | return null;
|
| | | return getBaseFanliRate(time).add(new BigDecimal(get("official_subsidy_zigou_" + level.getLevel())));
|
| | | }
|
| | |
|
| | | @Override
|
| | | public BigDecimal getShareRate(long time) {
|
| | | String key = "share_proportion";
|
| | | HongBaoManage hongBaoManage = hongBaoManageMapper.selectByKeyAndMaxValidTime(key, time);
|
| | | if (hongBaoManage == null)
|
| | | hongBaoManage = hongBaoManageMapper.selectByKey(key);
|
| | | if (hongBaoManage != null)
|
| | | return new BigDecimal(hongBaoManage.getValue());
|
| | | LogHelper.error("获取分享赚分成比例出错");
|
| | | return null;
|
| | | public BigDecimal getShareRate(UserLevelEnum level, long time) {
|
| | | return getBaseFanliRate(time).add(new BigDecimal(get("official_subsidy_share_" + level.getLevel())));
|
| | | }
|
| | |
|
| | | @Override
|
| | | public BigDecimal getFanLiRate(UserLevelEnum level) {
|
| | | return getFanLiRate(level, System.currentTimeMillis());
|
| | | }
|
| | |
|
| | | @Override
|
| | | public BigDecimal getFanLiRate() {
|
| | | return getFanLiRate(System.currentTimeMillis());
|
| | | return getFanLiRate(UserLevelEnum.daRen);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public BigDecimal getShareRate(UserLevelEnum level) {
|
| | | return getShareRate(level, System.currentTimeMillis());
|
| | | }
|
| | |
|
| | | @Override
|
| | | public BigDecimal getShareRate() {
|
| | | return getShareRate(System.currentTimeMillis());
|
| | | return getShareRate(UserLevelEnum.daRen);
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public BigDecimal getVIPFanLiRate(long time) {
|
| | | String key = "hongbao_goods_proportion_vip";
|
| | | HongBaoManage hongBaoManage = hongBaoManageMapper.selectByKeyAndMaxValidTime(key, time);
|
| | | if (hongBaoManage == null)
|
| | | hongBaoManage = hongBaoManageMapper.selectByKey(key);
|
| | | if (hongBaoManage != null)
|
| | | return new BigDecimal(hongBaoManage.getValue());
|
| | | LogHelper.error("获取返利分成比例出错");
|
| | | return null;
|
| | | }
|
| | | public ConfigParamsDTO getShowComputeRate(String platform, String version, UserLevelEnum userLevel) {
|
| | |
|
| | | @Override
|
| | | public BigDecimal getVIPShareRate(long time) {
|
| | | String key = "share_proportion_vip";
|
| | | HongBaoManage hongBaoManage = hongBaoManageMapper.selectByKeyAndMaxValidTime(key, time);
|
| | | if (hongBaoManage == null)
|
| | | hongBaoManage = hongBaoManageMapper.selectByKey(key);
|
| | | if (hongBaoManage != null)
|
| | | return new BigDecimal(hongBaoManage.getValue());
|
| | | LogHelper.error("获取返利分成比例出错");
|
| | | return null;
|
| | | BigDecimal fanLiRate = getFanLiRate(userLevel);
|
| | | BigDecimal shareRate = getShareRate(userLevel);
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,
|
| | | getFanLiRate(UserLevelEnum.superVIP));
|
| | | if (VersionUtil.greaterThan_2_0_5(platform, version)) {
|
| | | paramsDTO.setMaxRewardRate(null);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public BigDecimal getVIPFanLiRate() {
|
| | | return getVIPFanLiRate(System.currentTimeMillis());
|
| | | }
|
| | |
|
| | | @Override
|
| | | public BigDecimal getVIPShareRate() {
|
| | | return getVIPShareRate(System.currentTimeMillis());
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取比例
|
| | | * |
| | | * @param level
|
| | | * 0-本级 1-下级 2-下下级
|
| | | * @param orderType
|
| | | * @param isVip本级是否为VIP
|
| | | * @param isWorkerVip下级是否为VIP
|
| | | * @return
|
| | | */
|
| | | public BigDecimal getRate(OrderHongBaoRateParams params) throws HongBaoException {
|
| | | if (params == null)
|
| | | throw new HongBaoException(1, "比例参数错误");
|
| | |
|
| | | long time = params.getOrderCreateTime().getTime();
|
| | |
|
| | | if (params.getLevel() == 0) {// 本级
|
| | |
|
| | | if (params.getOrderType() == CommonOrder.ORDER_TYPE_ZIGOU) {
|
| | | if (params.isVip())
|
| | | return getVIPFanLiRate(time);
|
| | | else
|
| | | return getFanLiRate(time);
|
| | | } else {
|
| | | if (params.isVip())
|
| | | return getVIPShareRate(time);
|
| | | else
|
| | | return getShareRate(time);
|
| | | }
|
| | |
|
| | | } else if (params.getLevel() == 1) {// 上级
|
| | | if (params.getOrderType() == CommonOrder.ORDER_TYPE_ZIGOU) {// 自购
|
| | | if (params.isSubsidy()) {// 补贴比例
|
| | | if (params.isVip()) {// 下级为会员不补贴
|
| | | return new BigDecimal("0");
|
| | | } else {
|
| | | return getInviteFirstLevelSubsidyRate(time);
|
| | | }
|
| | | } else {// 奖金比例
|
| | | if (params.isVip()) {
|
| | | return getByKeyAndMaxTime("new_invite_vip_6", time);
|
| | | } else {
|
| | | return getByKeyAndMaxTime("new_invite_6", time);
|
| | | }
|
| | | }
|
| | | } else {// 分享
|
| | | if (params.isVip()) {
|
| | | return getByKeyAndMaxTime("new_share_vip_21", time);
|
| | | } else {
|
| | | return getByKeyAndMaxTime("new_share_21", time);
|
| | | }
|
| | | }
|
| | | } else if (params.getLevel() == 2) {// 上上级
|
| | | if (params.getOrderType() == CommonOrder.ORDER_TYPE_ZIGOU) {// 自购
|
| | | if (params.isSubsidy()) {// 补贴比例
|
| | | if (params.isVip()) {// 下下级为会员不补贴
|
| | | return new BigDecimal("0");
|
| | | } else {
|
| | | return getInviteSecondLevelSubsidyRate(time);
|
| | | }
|
| | | } else {// 奖金比例
|
| | | if (params.isVip())
|
| | | return new BigDecimal("0");
|
| | | else
|
| | | return getByKeyAndMaxTime("new_invite_7", time);
|
| | | }
|
| | | } else {// 分享
|
| | | if (params.isVip())
|
| | | return new BigDecimal("0");
|
| | | else
|
| | | return getByKeyAndMaxTime("new_share_22", time);
|
| | | }
|
| | | }
|
| | | throw new HongBaoException(2, "未匹配到比例参数");
|
| | | return paramsDTO;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public ConfigParamsDTO getShowComputeRate(String platform, String version) {
|
| | |
|
| | | BigDecimal fanLiRate = getFanLiRate();
|
| | | BigDecimal shareRate = getShareRate();
|
| | | BigDecimal fanLiRate = getFanLiRate(UserLevelEnum.daRen);
|
| | | BigDecimal shareRate = getShareRate(UserLevelEnum.daRen);
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,
|
| | | getVIPFanLiRate());
|
| | | getFanLiRate(UserLevelEnum.superVIP));
|
| | | if (VersionUtil.greaterThan_2_0_5(platform, version)) {
|
| | | paramsDTO.setMaxRewardRate(null);
|
| | | }
|
| | |
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.taobao.TaoBaoShopMapper;
|
| | | import com.yeshi.fanli.dto.ConfigParamsDTO;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBriefExtra;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoShop;
|
| | |
| | | return null;
|
| | | }
|
| | |
|
| | | BigDecimal proportion = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal proportion = hongBaoManageService.getFanLiRate(UserLevelEnum.daRen);
|
| | | for (TaoBaoShopVO taoBaoShopVO : list) {
|
| | |
|
| | | String shopLink = taoBaoShopVO.getShopLink();
|
| | |
| | | return null;
|
| | | }
|
| | |
|
| | | ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(platform, version);
|
| | | ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(platform, version,UserLevelEnum.daRen);
|
| | |
|
| | | for (TaoBaoShopVO taoBaoShopVO : list) {
|
| | |
|
| | |
| | | import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinRecord;
|
| | | import com.yeshi.fanli.entity.bus.user.TokenRecord;
|
| | | import com.yeshi.fanli.entity.bus.user.TokenRecord.TokenTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.UserMoneyExtra;
|
| | | import com.yeshi.fanli.entity.goods.CommonGoods;
|
| | | import com.yeshi.fanli.entity.system.ConfigKeyEnum;
|
| | |
| | | BigDecimal shareMoney = new BigDecimal(0);
|
| | | BigDecimal commission = userTaoLiJinRecordVO.getCommission();
|
| | | if (commission != null && commission.compareTo(shareMoney) > 0) {
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate(UserLevelEnum.daRen);
|
| | | shareMoney = MoneyBigDecimalUtil.mul(commission,
|
| | | MoneyBigDecimalUtil.div(shareRate, new BigDecimal(100)));
|
| | | shareMoney = BigDecimalUtil.getWithNoZera(shareMoney);
|
| | |
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
|
| | | import com.yeshi.fanli.dto.share.ShareGoodsRecordDTO;
|
| | | import com.yeshi.fanli.entity.bus.user.UserGoodsStorage;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
|
| | | import com.yeshi.fanli.entity.goods.CommonGoods;
|
| | | import com.yeshi.fanli.entity.jd.JDGoods;
|
| | | import com.yeshi.fanli.entity.system.ConfigKeyEnum;
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | BigDecimal rate = manageService.getFanLiRate();
|
| | | BigDecimal rate = manageService.getFanLiRate(UserLevelEnum.daRen);
|
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|
| | |
|
| | |
| | | BigDecimal totalMoney = new BigDecimal(0.00);
|
| | | List<TaoBaoGoodsBrief> listGoodsBrief = new ArrayList<TaoBaoGoodsBrief>();
|
| | |
|
| | | BigDecimal rate = hongBaoManageService.getShareRate();
|
| | | BigDecimal rate = hongBaoManageService.getShareRate(UserLevelEnum.daRen);
|
| | | for (UserGoodsStorage userGoodsStorage : listResult) {
|
| | | CommonGoods commonGoods = userGoodsStorage.getCommonGoods();
|
| | | TaoBaoGoodsBrief goodsBrief = TaoBaoUtil.convert(commonGoods);
|
| | |
| | | List<CommonGoods> listCommonGoods = new ArrayList<CommonGoods>();
|
| | |
|
| | | Integer goodsType = null;
|
| | | BigDecimal rate = hongBaoManageService.getShareRate();
|
| | | BigDecimal rate = hongBaoManageService.getShareRate(UserLevelEnum.daRen);
|
| | | for (UserGoodsStorage userGoodsStorage : listResult) {
|
| | | CommonGoods commonGoods = userGoodsStorage.getCommonGoods();
|
| | | BigDecimal money = CommonGoodsUtil.getCommission(commonGoods, rate);
|
| | |
| | | import com.yeshi.fanli.entity.bus.share.UserShareGoodsRecord.ShareSourceTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.UserGoodsStorage;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
|
| | | import com.yeshi.fanli.entity.goods.CommonGoods;
|
| | | import com.yeshi.fanli.entity.jd.JDGoods;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | |
| | |
|
| | | @Resource
|
| | | private IntegralGetService integralGetService;
|
| | | |
| | |
|
| | | @Override
|
| | | public int insert(UserShareGoodsRecord record) {
|
| | |
| | | InputStream inputStream = ImageUtil.drawGoodsShareBigImg(erCodeInputStream, portrait, listGoods);
|
| | |
|
| | | FileUploadResult shareImg = COSManager.getInstance().uploadInputStream(inputStream,
|
| | | FilePathEnum.shareGoods.getPath() + "share_" + uid + "_" + shareId + "_" + System.currentTimeMillis() + ".png");
|
| | | FilePathEnum.shareGoods.getPath() + "share_" + uid + "_" + shareId + "_" + System.currentTimeMillis()
|
| | | + ".png");
|
| | |
|
| | | return shareImg;
|
| | | }
|
| | |
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|
| | |
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate(java.lang.System.currentTimeMillis());
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate(UserLevelEnum.daRen,
|
| | | java.lang.System.currentTimeMillis());
|
| | |
|
| | | for (UserShareGoodsGroup goodsGroup : list) {
|
| | | CommonGoods commonGoods = goodsGroup.getCommonGoods();
|
| | |
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|
| | |
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate(java.lang.System.currentTimeMillis());
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate(UserLevelEnum.daRen,
|
| | | java.lang.System.currentTimeMillis());
|
| | |
|
| | | for (UserShareGoodsGroup goodsGroup : list) {
|
| | | CommonGoods commonGoods = goodsGroup.getCommonGoods();
|
| | |
| | | recordDTO.setSource(ShareSourceTypeEnum.goodsDetail);
|
| | |
|
| | | // 分享id
|
| | | String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.emptyKey, StringUtil.Md5(uid + "#GoodsDetail#" + auctionId + "#Type#" + goodsType));
|
| | | String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.emptyKey,
|
| | | StringUtil.Md5(uid + "#GoodsDetail#" + auctionId + "#Type#" + goodsType));
|
| | | redisManager.cacheCommonString(key, JsonUtil.getSimpleGson().toJson(recordDTO), 60 * 20);
|
| | | recordDTO.setRedisKey(key);
|
| | |
|
| | |
| | |
|
| | | InputStream inputStream = ImageUtil.drawGoodsSharePicture(erCodeInputStream, portrait, listGoods);
|
| | | FileUploadResult shareImg = COSManager.getInstance().uploadInputStream(inputStream,
|
| | | FilePathEnum.shareGoods.getPath() + "share_" + uid + "_" + shareId + "_" + System.currentTimeMillis() + ".png");
|
| | | FilePathEnum.shareGoods.getPath() + "share_" + uid + "_" + shareId + "_" + System.currentTimeMillis()
|
| | | + ".png");
|
| | |
|
| | | return shareImg;
|
| | | }
|
| | |
| | | userShareGoodsGroupService.insertSelective(singleGoods);
|
| | | }
|
| | | }
|
| | | |
| | | |
| | |
|
| | | }
|
| | |
| | | import org.springframework.cache.annotation.CacheEvict;
|
| | |
|
| | | import com.yeshi.fanli.dto.ConfigParamsDTO;
|
| | | import com.yeshi.fanli.dto.order.OrderHongBaoRateParams;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoManage;
|
| | | import com.yeshi.fanli.exception.order.HongBaoException;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
|
| | |
|
| | | public interface HongBaoManageService {
|
| | |
|
| | |
| | | * @param time
|
| | | * @return
|
| | | */
|
| | | public BigDecimal getFanLiRate(long time);
|
| | |
|
| | | /**
|
| | | * VIP用户返利比例
|
| | | * |
| | | * @param time
|
| | | * @return
|
| | | */
|
| | | public BigDecimal getVIPFanLiRate(long time);
|
| | | public BigDecimal getFanLiRate(UserLevelEnum level, long time);
|
| | |
|
| | | /**
|
| | | * 获取分享订单返利比例
|
| | |
| | | * @param time
|
| | | * @return
|
| | | */
|
| | | public BigDecimal getShareRate(long time);
|
| | |
|
| | | /**
|
| | | * 获取VIP用户的分享比例
|
| | | * |
| | | * @param time
|
| | | * @return
|
| | | */
|
| | | public BigDecimal getVIPShareRate(long time);
|
| | | public BigDecimal getShareRate(UserLevelEnum level, long time);
|
| | |
|
| | | /**
|
| | | * 获取返利订单返利比例
|
| | | *
|
| | | * @return
|
| | | */
|
| | | public BigDecimal getFanLiRate(UserLevelEnum level);
|
| | | |
| | | |
| | | public BigDecimal getFanLiRate();
|
| | |
|
| | | /**
|
| | |
| | | *
|
| | | * @return
|
| | | */
|
| | | public BigDecimal getShareRate(UserLevelEnum level);
|
| | | |
| | | public BigDecimal getShareRate();
|
| | |
|
| | | /**
|
| | | * 获取VIP返利订单返利比例
|
| | | * |
| | | * @return
|
| | | */
|
| | | public BigDecimal getVIPFanLiRate();
|
| | |
|
| | | /**
|
| | | * 获取VIP分享订单返利比例
|
| | | * |
| | | * @return
|
| | | */
|
| | | public BigDecimal getVIPShareRate();
|
| | |
|
| | | /**
|
| | | * 获取第一级的邀请赚比例
|
| | |
| | | public BigDecimal getInviteSecondLevelSubsidyRate(Long time);
|
| | |
|
| | | /**
|
| | | * 获取返利比例(订单处理时使用)
|
| | | * |
| | | * @param params
|
| | | * @return
|
| | | * @throws HongBaoException
|
| | | */
|
| | | public BigDecimal getRate(OrderHongBaoRateParams params) throws HongBaoException;
|
| | |
|
| | | /**
|
| | | * 获取需要显示计算的比例实体
|
| | | *
|
| | | * @param platform
|
| | | * @param version
|
| | | * @return
|
| | | */
|
| | | public ConfigParamsDTO getShowComputeRate(String platform, String version,UserLevelEnum userLevel);
|
| | | |
| | | |
| | | public ConfigParamsDTO getShowComputeRate(String platform, String version);
|
| | |
|
| | | /**
|
| | |
| | | "4c7b166fecb6d9f53837e993f2214673", "", "");
|
| | |
|
| | | // 新的规则生效时间
|
| | | public static final long NEW_ORDER_FANLI_RULE_TIME = TimeUtil.convertToTimeTemp("2020-04-14", "yyyy-MM-dd");
|
| | | public static final long NEW_ORDER_FANLI_RULE_TIME = TimeUtil.convertToTimeTemp("2020-04-18", "yyyy-MM-dd");
|
| | |
|
| | | // 新人抽奖-最大次数
|
| | | public static final int MAX_COUNT_LOTTERY_NEWBIES = 5;
|
| | |
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | | import com.google.gson.reflect.TypeToken;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
|
| | | import com.yeshi.fanli.entity.common.ImageInfo;
|
| | | import com.yeshi.fanli.entity.goods.CommonGoods;
|
| | | import com.yeshi.fanli.entity.taobao.SearchFilter;
|
| | |
| | | tg.setTaoBaoQuanInfo(quanInfo);
|
| | | }
|
| | |
|
| | | BigDecimal proportion = taoBaoUtil.manageService.getFanLiRate();
|
| | | BigDecimal proportion = taoBaoUtil.manageService.getFanLiRate(UserLevelEnum.daRen);
|
| | | TaoBaoHongBaoInfo hongBaoInfo = new TaoBaoHongBaoInfo();
|
| | | String tkMktStatus = tb.getTkMktStatus();
|
| | | if ("1".equals(tkMktStatus)) {
|