Merge remote-tracking branch 'origin/div' into div
| | |
| | | }
|
| | | }
|
| | | data.put("vip", inner);
|
| | | //平台规则
|
| | | String platformRuleLink = configService.get(ConfigKeyEnum.platformRule.getKey());
|
| | | data.put("platformRule", platformRuleLink);
|
| | | |
| | | |
| | | } |
| | |
|
| | | if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion()) && uid != null) {
|
| | |
| | | public class UserVIPPreInfo {
|
| | | public static int PROCESS_1 = 3;// 超级会员第一阶段
|
| | | public static int PROCESS_2 = 7;// 超级会员第二阶段
|
| | | public static int PROCESS_4 = 11;// 超级会员第四阶段
|
| | |
|
| | | @Column(name = "vpi_id")
|
| | | private Long id;
|
| | |
| | | shareRuleLinkJD("share_rule_link_jd", "京东分享规则(帮助中心)"), |
| | | shareRuleLinkPDD("share_rule_link_pdd", "拼多多分享规则(帮助中心)"), |
| | | shareSingleGoodsRule("share_single_goods_rule", "单品分享规则"), |
| | | shareGoodsTemplateRules("share_goods_template_rules", "分享模板规则"), // 存在2个相同 内容不同、版本但一样 |
| | | shareGoodsTemplateRules("share_goods_template_rules", "分享模板规则"), // 存在2个相同 |
| | | // 内容不同、版本但一样 |
| | | shareGoodsTemplateRulesJD("share_goods_template_rules_jd", "京东模板规则"), |
| | | shareGoodsTemplateRulesPDD("share_goods_template_rules_pdd", "拼多多模板规则"), |
| | | goodsShareNotifyImgs("goods_share_notify_imgs", "单个商品分享的券提示图片"), |
| | |
| | | taobaoProxyIP("taobao_proxy_ip", "淘宝商品详情代理IP"), |
| | | taobaoCartJS("taobao_cart_js", "淘宝购物车脚本"), |
| | | taobaoCartLink("taobao_cart_link", "购物车链接"), |
| | | taobaoCartJumpDetail("taobao_cart_jump_detail", "我的购物车跳转方式"), // 存在2个相同 存在版本区分 |
| | | taobaoCartJumpDetail("taobao_cart_jump_detail", "我的购物车跳转方式"), // 存在2个相同 |
| | | // 存在版本区分 |
| | | taobaoCouponHelp("taobao_coupon_help", "券帮助"), |
| | | convertTaoBaoLinkInServer("convert_taobao_link_in_server", "是否在服务端转链"), |
| | | showTaobaoCartConvert("show_taobao_cart_convert", "购物车是否转链"), |
| | |
| | | inviteRules("invite_rules", "动态-学院文章热搜词"), |
| | | vipLink("vip_link", "超级会员升级链接"), // 转移至VIPConfig 已废弃 |
| | | helpLinkVipInfo("help_link_vip_info", "超级会员详情页帮助链接"), // 已废弃 |
| | | //文案转链 |
| | | convertDocWebLink("convert_doc_web_link","文案转链网页"), |
| | | convertDocHelpLink("convert_doc_help_link","文案转链帮助网页"), |
| | | convertDocTip("convert_doc_tip","文案转链温馨提示"), |
| | | newerGonglue("newer_gonglue_url","新手攻略链接"), |
| | | tearcherLink("tearcher_link","导师链接"), |
| | | // 文案转链 |
| | | convertDocWebLink("convert_doc_web_link", "文案转链网页"), |
| | | convertDocHelpLink("convert_doc_help_link", "文案转链帮助网页"), |
| | | convertDocTip("convert_doc_tip", "文案转链温馨提示"), |
| | | newerGonglue("newer_gonglue_url", "新手攻略链接"), |
| | | tearcherLink("tearcher_link", "导师链接"), |
| | | quickShareGoodsText("quick_share_goods_text", "快捷分享商品文本"), |
| | | quickShareTBCommentText("quick_share_tb_comment_text", "快捷分享商品文本"), |
| | | quickShareJDCommentText("quick_share_jd_comment_text", "快捷分享商品文本"), |
| | | quickSharePDDCommentText("quick_share_pdd_comment_text", "快捷分享商品文本"), |
| | | |
| | | |
| | | shareCommentTextTB("share_comment_text_tb", "淘宝单图多图分享商品文本"), |
| | | shareCommentTextJD("share_comment_text_jd", "京东单图多图分享商品文本"), |
| | | shareCommentTextPDD("share_comment_text_pdd", "拼多多单图多图分享商品文本"), |
| | | |
| | | |
| | | evaluateEmojis("evaluate_emojis", "发圈评论Emojis"), |
| | | evaluateText("evaluate_text", "发圈评论文本"), |
| | | |
| | | |
| | | vipUpgradeLink("vip_upgrade_link", "我的界面-会员升级链接"), |
| | | |
| | | |
| | | orderRebateDescLink("order_rebate_desc_link", "订单返利计算说明链接"), |
| | | bonusCountLinkFanli("bonus_count_link_fanli", "自购返利统计页面问号"), |
| | | bonusCountLinkShare("bonus_count_link_share", "分享奖金统计页面问号"), |
| | | bonusCountLinkTeam("bonus_count_link_team", "团队奖励统计页面问号"), |
| | | ; |
| | | |
| | | // 平台规则 |
| | | platformRule("platform_rule_link", "平台规则"); |
| | | |
| | | private final String key; |
| | | private final String desc; |
| | |
| | | BigDecimal rate = hongBaoManageService.getBaseFanliRate(order.getThirdCreateTime().getTime())
|
| | | .add(getOfficialSubsidyRate(order.getThirdCreateTime(),
|
| | | getCommonUserLevel(order.getThirdCreateTime(), userLevel), false));
|
| | | if (userLevel == UserLevelEnum.normalVIP) {
|
| | | rate = new BigDecimal("61");
|
| | | }
|
| | |
|
| | | 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)
|
| | |
| | | BigDecimal rate = hongBaoManageService.getBaseFanliRate(order.getThirdCreateTime().getTime())
|
| | | .add(getOfficialSubsidyRate(order.getThirdCreateTime(),
|
| | | getCommonUserLevel(order.getThirdCreateTime(), userLevel), true));
|
| | |
|
| | | if (userLevel == UserLevelEnum.normalVIP) {
|
| | | rate = new BigDecimal("61");
|
| | | }
|
| | |
|
| | | 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)
|
| | |
| | | else {
|
| | | rate = null;
|
| | | }
|
| | | } else if (buyerLevel == UserLevelEnum.daRen && firstBoss.getLevel() == UserLevelEnum.normalVIP) {
|
| | | if (boss.getLevel() == UserLevelEnum.normalVIP)
|
| | | rate = hongBaoManageService.getByKeyAndMaxTime("new_invite_daren_7", date.getTime());
|
| | | else {
|
| | | rate = null;
|
| | | }
|
| | | }
|
| | | // 极差计算法
|
| | | if (rate == null) {
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public void setUserLevel(Long uid, UserLevelEnum level) {
|
| | |
|
| | | TeamUserLevelStatistic old = selectByUid(uid);
|
| | | if (old == null) {
|
| | | initData(uid);
|
| | | old = selectByUid(uid);
|
| | | }
|
| | |
|
| | | TeamUserLevelStatistic update = new TeamUserLevelStatistic();
|
| | | update.setId(old.getId());
|
| | | update.setLevel(level);
|
| | | update.setUpdateTime(new Date());
|
| | | teamUserLevelStatisticMapper.updateByPrimaryKeySelective(update);
|
| | |
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void add(TeamUserLevelStatistic statistic) {
|
| | | TeamUserLevelStatistic old = selectByUid(statistic.getId());
|
| | | if (old == null) {
|
| | |
| | | import com.yeshi.fanli.entity.bus.user.vip.UserVIPInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserVIPPreInfo;
|
| | | import com.yeshi.fanli.exception.user.vip.UserVIPInfoException;
|
| | | import com.yeshi.fanli.exception.user.vip.UserVIPPreInfoException;
|
| | | import com.yeshi.fanli.service.inter.count.HongBaoV2CountService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce;
|
| | |
| | | @Resource
|
| | | private HongBaoV2CountService hongBaoV2CountService;
|
| | |
|
| | |
|
| | | @Resource
|
| | | private ThreeSaleSerivce threeSaleSerivce;
|
| | |
|
| | |
|
| | | @Resource
|
| | | private UserVIPPreInfoService userVIPPreInfoService;
|
| | |
|
| | | @Resource
|
| | | private UserAccountMsgNotificationService userAccountMsgNotificationService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private UserInviteValidNumService userInviteValidNumService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private UserLevelUpgradedNotifyService userLevelUpgradedNotifyService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private UserInviteMsgNotificationService userInviteMsgNotificationService;
|
| | | |
| | |
|
| | | @Resource(name = "producer")
|
| | | private Producer producer;
|
| | | |
| | | |
| | |
|
| | | @Override
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | |
| | | info.setCreateTime(new Date());
|
| | | userVIPInfoMapper.insert(info);
|
| | | }
|
| | |
|
| | |
|
| | | @Override
|
| | | public boolean isVIP(Long uid) {
|
| | |
| | | return map;
|
| | | }
|
| | |
|
| | |
|
| | | @Override
|
| | | public List<UserVIPInfo> listQuery(int page, int count, String key, Integer state) {
|
| | | return userVIPInfoMapper.listQuery((page - 1) * count, count, key, state);
|
| | |
| | | public long countQuery(String key, Integer state) {
|
| | | return userVIPInfoMapper.countQuery(key, state);
|
| | | }
|
| | |
|
| | |
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | |
| | |
|
| | | if (!verifyVip(uid))
|
| | | throw new UserVIPInfoException(1, "系统验证:不满足升级条件");
|
| | | |
| | |
|
| | | Date upgradeTime = new Date();
|
| | | // 通过超级会员
|
| | | UserVIPInfo info = new UserVIPInfo();
|
| | |
| | | info.setUpdateTime(upgradeTime);
|
| | | userVIPInfoMapper.updateByPrimaryKeySelective(info);
|
| | |
|
| | | UserVIPPreInfo preInfo = new UserVIPPreInfo();
|
| | | preInfo.setCreateTime(new Date());
|
| | | preInfo.setProcess(UserLevelEnum.superVIP.getLevel());
|
| | | preInfo.setUid(uid);
|
| | |
|
| | | try {
|
| | | userVIPPreInfoService.addUserVIPPreInfo(preInfo);
|
| | | } catch (UserVIPPreInfoException e1) {
|
| | | throw new UserVIPInfoException(100, "升级失败");
|
| | | }
|
| | |
|
| | | // 升级弹框提示
|
| | | UserLevelUpgradedNotify notify = new UserLevelUpgradedNotify();
|
| | | notify.setUid(uid);
|
| | |
| | | notify.setValid(true);
|
| | | notify.setCreateTime(new Date());
|
| | | userLevelUpgradedNotifyService.addUserLevelUpgradedNotify(notify);
|
| | | |
| | |
|
| | | try {
|
| | | // 升级消息
|
| | | UserVIPPreInfo pre1 = userVIPPreInfoService.getVipByProcess(uid, UserVIPPreInfo.PROCESS_2);
|
| | | userAccountMsgNotificationService.vipUpgradeSuccess(uid, TimeUtil.getDayDifferenceCount(pre1.getCreateTime(), new Date()));
|
| | | |
| | | userAccountMsgNotificationService.vipUpgradeSuccess(uid,
|
| | | TimeUtil.getDayDifferenceCount(pre1.getCreateTime(), new Date()));
|
| | |
|
| | | // 直接粉丝升级提醒
|
| | | ThreeSale threeSale = threeSaleSerivce.getMyBoss(uid);
|
| | | if (threeSale != null) {
|
| | | Long bossId = threeSale.getBoss().getId();
|
| | | UserInfo userInfo = userInfoService.selectByPKey(uid);
|
| | | userInviteMsgNotificationService.fansUpgrade(bossId, "超级会员", userInfo.getNickName(), getPassItem(uid), upgradeTime);
|
| | | userInviteMsgNotificationService.fansUpgrade(bossId, "超级会员", userInfo.getNickName(), getPassItem(uid),
|
| | | upgradeTime);
|
| | | }
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | |
| | |
|
| | | if (!Constant.IS_TEST) {
|
| | | UserLevelChangedMQMsg msg = new UserLevelChangedMQMsg(uid, UserLevelEnum.highVIP,UserLevelEnum.superVIP, new Date());
|
| | | UserLevelChangedMQMsg msg = new UserLevelChangedMQMsg(uid, UserLevelEnum.highVIP, UserLevelEnum.superVIP,
|
| | | new Date());
|
| | | Message message = MQMsgBodyFactory.create(MQTopicName.TOPIC_USER, UserTopicTagEnum.userLevelChanged, msg);
|
| | | producer.send(message);
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | | * 验证是否符合VIP
|
| | |
| | | if (!StringUtil.isNullOrEmpty(zigou)) {
|
| | | limitOrder = Long.parseLong(zigou);
|
| | | }
|
| | | |
| | |
|
| | | long limitFirst = 0;
|
| | | String first = userVipConfigService.getValueByKey("vip_pre_10_first_level_team_count");
|
| | | if (!StringUtil.isNullOrEmpty(first)) {
|
| | | limitFirst = Long.parseLong(first);
|
| | | }
|
| | | |
| | |
|
| | | long limitSecond = 0;
|
| | | String second = userVipConfigService.getValueByKey("vip_pre_10_second_level_team_count");
|
| | | if (!StringUtil.isNullOrEmpty(second)) {
|
| | | limitSecond = Long.parseLong(second);
|
| | | }
|
| | | |
| | |
|
| | | String item = "";
|
| | | if (doneOrder >= limitOrder) {
|
| | | item = "返利+分享订单";
|
| | |
| | | }
|
| | | return item;
|
| | | }
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 验证是否符合VIP
|
| | | * @param uid
|
| | |
| | | if (!StringUtil.isNullOrEmpty(zigou)) {
|
| | | limitOrder = Long.parseLong(zigou);
|
| | | }
|
| | | |
| | |
|
| | | long limitFirst = 0;
|
| | | String first = userVipConfigService.getValueByKey("vip_pre_10_first_level_team_count");
|
| | | if (!StringUtil.isNullOrEmpty(first)) {
|
| | | limitFirst = Long.parseLong(first);
|
| | | }
|
| | | |
| | |
|
| | | long limitSecond = 0;
|
| | | String second = userVipConfigService.getValueByKey("vip_pre_10_second_level_team_count");
|
| | | if (!StringUtil.isNullOrEmpty(second)) {
|
| | | limitSecond = Long.parseLong(second);
|
| | | }
|
| | | |
| | | if (doneOrder >= limitOrder || (doneFirst >= limitFirst && doneSecond >= limitSecond)) {
|
| | |
|
| | | if (doneOrder >= limitOrder || (doneFirst >= limitFirst && doneSecond >= limitSecond)) {
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | |
| | | userAccountMsgNotificationService.vipUpgradeFail(uid, reason);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void deleteByPrimaryKey(Long id) {
|
| | | userVIPInfoMapper.deleteByPrimaryKey(id);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | @Resource
|
| | | private UserInfoExtraService userInfoExtraService;
|
| | |
|
| | |
|
| | | @Resource
|
| | | private UserInfoService userInfoService;
|
| | |
|
| | |
| | | try {
|
| | | twoProcess(uid, limitZiGou7, null);
|
| | | } catch (UserVIPPreInfoException e) {
|
| | | |
| | |
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | try {
|
| | | twoProcess(bossId, limitFirst7, limitSecond7);
|
| | | } catch (UserVIPPreInfoException e) {
|
| | | |
| | |
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | * @param secondTeam
|
| | | */
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | private void twoProcess(Long uid, long limit1, Long limit2) throws UserVIPPreInfoException{
|
| | | private void twoProcess(Long uid, long limit1, Long limit2) throws UserVIPPreInfoException {
|
| | | String item = null;
|
| | | if (limit2 == null) {
|
| | | item = "返利+分享订单";
|
| | |
| | | return userVIPPreInfoMapper.selectByUidAndProcess(uid, process);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void deleteByPrimaryKey(Long id) {
|
| | | userVIPPreInfoMapper.deleteByPrimaryKey(id);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.user.vip.TeamUserLevelStatistic;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
|
| | |
|
| | | /**
|
| | | * 团队用户
|
| | |
| | | * @throws
|
| | | */
|
| | | public void updateUserLevel(Long uid);
|
| | |
|
| | | /**
|
| | | * 设置用户等级
|
| | | * @Title: setUserLevel
|
| | | * @Description: |
| | | * @param uid
|
| | | * @param level |
| | | * void 返回类型
|
| | | * @throws
|
| | | */
|
| | | public void setUserLevel(Long uid, UserLevelEnum level);
|
| | | }
|
| | |
| | | */
|
| | | public void addUserVIPInfo(UserVIPInfo info) throws UserVIPInfoException;
|
| | |
|
| | |
|
| | | /**
|
| | | * 是否为VIP
|
| | | *
|
| | |
| | | * @return
|
| | | */
|
| | | public boolean isVIP(Long uid);
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 在某个时间是否为VIP
|
| | | * @Title: isVIP
|
| | |
| | | * boolean 返回类型
|
| | | * @throws
|
| | | */
|
| | | public boolean isVIP(Long uid,Long time);
|
| | | public boolean isVIP(Long uid, Long time);
|
| | |
|
| | | /**
|
| | | * 根据UID检索
|
| | |
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public Map<Long,Boolean> listByUids(List<Long> uid);
|
| | |
|
| | | public Map<Long, Boolean> listByUids(List<Long> uid);
|
| | |
|
| | | /**
|
| | | * 待审核列表
|
| | |
| | | public List<UserVIPInfo> listQuery(int page, int count, String key, Integer state);
|
| | |
|
| | | public long countQuery(String key, Integer state);
|
| | |
|
| | |
|
| | | /**
|
| | | * 超级会员申请通过
|
| | |
| | | */
|
| | | public void applyVIP(Long uid) throws UserVIPInfoException;
|
| | |
|
| | | /**
|
| | | * 根据主键删除
|
| | | * @Title: deleteByPrimaryKey
|
| | | * @Description: |
| | | * @param id |
| | | * void 返回类型
|
| | | * @throws
|
| | | */
|
| | | public void deleteByPrimaryKey(Long id);
|
| | |
|
| | | }
|
| | |
| | | * @param uid 粉丝id
|
| | | */
|
| | | public void upgradeVipByTeamNum(Long uid);
|
| | | |
| | | |
| | | /**
|
| | | * 根据主键删除
|
| | | * @Title: deleteByPrimaryKey
|
| | | * @Description: |
| | | * @param id |
| | | * void 返回类型
|
| | | * @throws
|
| | | */
|
| | | public void deleteByPrimaryKey(Long id);
|
| | |
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | int state = getOrderState(stateSet);
|
| | |
|
| | | /**
|
| | |
| | | case HongBaoV2.TYPE_ERJI:
|
| | |
|
| | | userOrderMsgNotificationService.orderInviteStatistic(uid, orderId, orderType,
|
| | | commonOrder.getPayment(), money, new BigDecimal(0), goodsCount, state,
|
| | | commonOrder.getPayment(), money, new BigDecimal(0), goodsCount, state,
|
| | | commonOrder.getThirdCreateTime());
|
| | |
|
| | | break;
|
| | |
|
| | | case HongBaoV2.TYPE_SHARE_YIJI:
|
| | | userOrderMsgNotificationService.orderInviteStatistic(uid, orderId, orderType,
|
| | | commonOrder.getPayment(), money, new BigDecimal(0), goodsCount, state,
|
| | | commonOrder.getPayment(), money, new BigDecimal(0), goodsCount, state,
|
| | | commonOrder.getThirdCreateTime());
|
| | | break;
|
| | | case HongBaoV2.TYPE_SHARE_ERJI:
|
| | |
|
| | | userOrderMsgNotificationService.orderInviteStatistic(uid, orderId, orderType,
|
| | | commonOrder.getPayment(), money, new BigDecimal(0), goodsCount, state,
|
| | | commonOrder.getPayment(), money, new BigDecimal(0), goodsCount, state,
|
| | | commonOrder.getThirdCreateTime());
|
| | |
|
| | | break;
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | return resultList;
|
| | | }
|
| | |
|
| | | private List<UserTeamLevel> getBossList(List<HongBaoV2> children) {
|
| | | List<UserTeamLevel> resultList = new ArrayList<>();
|
| | | for (HongBaoV2 v2 : children) {
|
| | |
|
| | | UserLevelEnum level = UserLevelUtil.getByOrderRank(v2.getUrank());
|
| | | if (level == null)
|
| | | level = UserLevelEnum.daRen;
|
| | | UserTeamLevel teamLevel = new UserTeamLevel(v2.getUserInfo().getId(), level);
|
| | |
|
| | | if (v2.getType() == HongBaoV2.TYPE_YIJI || v2.getType() == HongBaoV2.TYPE_SHARE_YIJI) {
|
| | | resultList.add(0, teamLevel);
|
| | | } else {
|
| | | resultList.add(teamLevel);
|
| | | }
|
| | | }
|
| | | return resultList;
|
| | | }
|
| | |
|
| | |
| | | // 获取子红包
|
| | | List<HongBaoV2> children = hongBaoV2Mapper.listChildrenById(hongBao.getId());
|
| | | if (children != null && children.size() > 0) {
|
| | | List<UserTeamLevel> bossList = getBossList(oldHongBao.getUserInfo().getId(), 2);
|
| | | List<UserTeamLevel> bossList =getBossList(children);
|
| | |
|
| | | for (HongBaoV2 child : children) {
|
| | | if (child.getState() == HongBaoV2.STATE_YILINGQU)
|
| | |
| | | // 获取子红包
|
| | | List<HongBaoV2> children = hongBaoV2Mapper.listChildrenById(hongBao.getId());
|
| | | if (children != null && children.size() > 0) {
|
| | | List<UserTeamLevel> bossList = getBossList(oldHongBao.getUserInfo().getId(), 2);
|
| | | List<UserTeamLevel> bossList =getBossList(children);
|
| | | for (HongBaoV2 child : children) {
|
| | | if (child.getState() == HongBaoV2.STATE_YILINGQU)
|
| | | continue;
|
| | |
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Component;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserVIPInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserVIPPreInfo;
|
| | | import com.yeshi.fanli.exception.user.vip.UserVIPInfoException;
|
| | | import com.yeshi.fanli.exception.user.vip.UserVIPPreInfoException;
|
| | | import com.yeshi.fanli.service.inter.user.vip.UserVIPInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.vip.UserVIPPreInfoService;
|
| | |
|
| | |
| | | * @throws
|
| | | */
|
| | | public UserLevelEnum getUserLevel(Long uid) {
|
| | | if (userVIPInfoService.isVIP(uid))
|
| | | return UserLevelEnum.superVIP;
|
| | | UserVIPPreInfo info = userVIPPreInfoService.getLatestProcessInfo(uid);
|
| | | if (info != null)
|
| | | for (UserLevelEnum level : UserLevelEnum.values())
|
| | |
| | | * @throws
|
| | | */
|
| | | public UserLevelEnum getUserLevel(Long uid, Date date) {
|
| | | if (userVIPInfoService.isVIP(uid, date.getTime()))
|
| | | return UserLevelEnum.superVIP;
|
| | | UserVIPPreInfo info = userVIPPreInfoService.getProcessInfo(uid, date);
|
| | | if (info != null)
|
| | | for (UserLevelEnum level : UserLevelEnum.values())
|
| | |
| | | return UserLevelEnum.daRen;
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | public void setUserLevel(Long uid, UserLevelEnum level, Date date) {
|
| | |
|
| | | // 删除原有等级
|
| | |
|
| | | for (UserLevelEnum le : UserLevelEnum.values()) {
|
| | | UserVIPPreInfo info = userVIPPreInfoService.getVipByProcess(uid, le.getLevel());
|
| | | if (info != null)
|
| | | userVIPPreInfoService.deleteByPrimaryKey(info.getId());
|
| | | }
|
| | |
|
| | | // 添加新的等级
|
| | | if (level == UserLevelEnum.daRen)
|
| | | return;
|
| | |
|
| | | UserVIPPreInfo info = new UserVIPPreInfo();
|
| | | info.setCreateTime(date);
|
| | | info.setProcess(level.getLevel());
|
| | | info.setUid(uid);
|
| | | try {
|
| | | userVIPPreInfoService.addUserVIPPreInfo(info);
|
| | | } catch (UserVIPPreInfoException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | import com.yeshi.fanli.service.inter.user.vip.TeamUserLevelStatisticService;
|
| | | import com.yeshi.fanli.service.manger.order.TeamDividentsManager;
|
| | | import com.yeshi.fanli.service.manger.order.TeamDividentsSourceManager;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.order.CommonOrderUtil;
|
| | | import com.yeshi.fanli.util.rocketmq.MQTopicName;
|
| | |
|
| | |
| | | }
|
| | | } else if (MQTopicName.TOPIC_ORDER.name().equalsIgnoreCase(message.getTopic())) {
|
| | | if (tag.equalsIgnoreCase(OrderTopicTagEnum.orderStatistic.name())) {
|
| | |
|
| | | OrderMQMsg dto = new Gson().fromJson(new String(message.getBody()), OrderMQMsg.class);
|
| | | if (dto == null || dto.getStaticticDate().getTime() < Constant.NEW_ORDER_FANLI_RULE_TIME)
|
| | | return Action.CommitMessage;
|
| | |
|
| | | if (dto.isMiandan())// 免单的商品不参与分红
|
| | | return Action.CommitMessage;
|
| | |
|
| | | if (dto.getHandleType() == OrderMQMsg.HANDLE_TYPE_ADD) {
|
| | | List<CommonOrder> commonOrderList = commonOrderService.listBySourceTypeAndOrderId(dto.getType(),
|
| | | dto.getOrderId());
|
| | |
| | | }
|
| | |
|
| | | } else if (tag.equalsIgnoreCase(OrderTopicTagEnum.orderConfirm.name())) {// 订单确认收货
|
| | | // 插入分红
|
| | | OrderConfirmMQMsg dto = new Gson().fromJson(new String(message.getBody()), OrderConfirmMQMsg.class);
|
| | | teamDividentsSourceManager.orderSettle(dto.getOrderNo(), dto.getSourceType());
|
| | | } else if (tag.equalsIgnoreCase(OrderTopicTagEnum.taoBaoOrderWeiQuan.name())) {
|