| | |
| | | if (vipInfo != null && vipInfo.getState() == UserVIPInfo.STATE_SUCCESS)
|
| | | time = vipInfo.getSuccessTime();
|
| | |
|
| | | } else if (level == UserLevelEnum.highVIP || level == UserLevelEnum.normalVIP) {
|
| | | } else if (level == UserLevelEnum.highVIP) {
|
| | | UserVIPPreInfo info = userVIPPreInfoService.selectByUidAndProcess(uid, level.getLevel());
|
| | | if (info != null)
|
| | | time = info.getCreateTime();
|
| | |
| | |
|
| | | public enum UserLevelEnum {
|
| | | daRen(0, 0, "快省达人", "actived", "http://apph5.banliapp.com/AppInside/vipNew/supvip.html"),
|
| | | normalVIP(3, 30, "普通会员", "vipPre1", "http://apph5.banliapp.com/AppInside/vipNew/supvip.html"),
|
| | | highVIP(7, 70, "高级会员", "vipPre2", "http://apph5.banliapp.com/AppInside/vipNew/supvip.html"),
|
| | | superVIP(10, 100, "超级会员", "vip", "http://apph5.banliapp.com/AppInside/vipNew/supvip.html"),
|
| | | tearcher(11, 101, "资深导师", "tearcher", "http://apph5.banliapp.com/AppInside/vipNew/supvip.html");
|
| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.scheduling.annotation.Scheduled;
|
| | | import org.springframework.stereotype.Component;
|
| | |
|
| | | import com.xxl.job.core.biz.model.ReturnT;
|
| | |
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.order.tb.TaoBaoOrderService;
|
| | | import com.yeshi.fanli.util.CMQManager;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.RedisKeyEnum;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public void invalidHongBaoV2AndGiveGodenCorn(Long hongBaoId, Long uid, String orderId, int sourceType,
|
| | | String beiZhu) throws Exception {
|
| | | HongBaoOrder hongbaoOrder = hongBaoOrderMapper.selectByHongBaoId(hongBaoId);
|
| | | if (hongbaoOrder != null) {
|
| | | CommonOrder commonOrder = commonOrderService.selectByPrimaryKey(hongbaoOrder.getCommonOrder().getId());
|
| | | if (commonOrder != null) {
|
| | | if (commonOrder.getState() == CommonOrder.STATE_FK) {
|
| | | CommonOrder updateOrder = new CommonOrder(commonOrder.getId());
|
| | | updateOrder.setState(CommonOrder.STATE_SX);
|
| | | updateOrder.setUpdateTime(new Date());
|
| | | commonOrderService.updateByPrimaryKeySelective(updateOrder);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | HongBaoV2 hongBao = hongBaoV2Service.selectByPrimaryKey(hongBaoId);
|
| | | if (hongBao == null || hongBao.getState() == HongBaoV2.STATE_SHIXIAO)
|
| | | return;
|
| | |
|
| | | HongBaoV2 v2 = new HongBaoV2(hongBaoId);
|
| | | v2.setState(HongBaoV2.STATE_SHIXIAO);
|
| | | v2.setBeizhu(beiZhu);
|
| | |
| | | hongBaoV2Service.updateByPrimaryKeySelective(update);
|
| | | }
|
| | | // TODO 商家关店跑路需要赠送金币
|
| | | // userSystemCouponService.rewardCouponWin(uid,
|
| | | // UserSystemCoupon.SOURCE_SYSTEM_PUSH, 1, true, new BigDecimal("31"));
|
| | | // userSystemCouponService.rewardCouponWin(uid,
|
| | | // UserSystemCoupon.SOURCE_SYSTEM_PUSH, 1, true, new BigDecimal("31"));
|
| | | }
|
| | |
|
| | | @Transactional
|
| | |
| | |
|
| | | // 直接粉丝统计
|
| | | int daRenFirstCount = 0;
|
| | | int normalFirstCount = 0;
|
| | | int highFirstCount = 0;
|
| | | int superFirstCount = 0;
|
| | | int tearcherFirstCount = 0;
|
| | |
| | | UserLevelEnum level = userLevelManager.getUserLevel(ts.getWorkerId());
|
| | | if (level == UserLevelEnum.daRen) {
|
| | | daRenFirstCount++;
|
| | | } else if (level == UserLevelEnum.normalVIP) {
|
| | | normalFirstCount++;
|
| | | } else if (level == UserLevelEnum.highVIP) {
|
| | | } else if (level == UserLevelEnum.highVIP) {
|
| | | highFirstCount++;
|
| | | } else if (level == UserLevelEnum.superVIP) {
|
| | | superFirstCount++;
|
| | |
| | |
|
| | | // 间接粉丝统计
|
| | | int daRenSecondCount = 0;
|
| | | int normalSecondCount = 0;
|
| | | int highSecondCount = 0;
|
| | | int superSecondCount = 0;
|
| | | int tearcherSecondCount = 0;
|
| | |
| | | UserLevelEnum level = userLevelManager.getUserLevel(ts.getWorkerId());
|
| | | if (level == UserLevelEnum.daRen) {
|
| | | daRenSecondCount++;
|
| | | } else if (level == UserLevelEnum.normalVIP) {
|
| | | normalSecondCount++;
|
| | | } else if (level == UserLevelEnum.highVIP) {
|
| | | highSecondCount++;
|
| | | } else if (level == UserLevelEnum.superVIP) {
|
| | |
| | | TeamUserLevelStatistic statistic = new TeamUserLevelStatistic();
|
| | | statistic.setDaRenFirstCount(daRenFirstCount);
|
| | | statistic.setDaRenSecondCount(daRenSecondCount);
|
| | | statistic.setNormalFirstCount(normalFirstCount);
|
| | | statistic.setNormalSecondCount(normalSecondCount);
|
| | | statistic.setHighFirstCount(highFirstCount);
|
| | | statistic.setHighSecondCount(highSecondCount);
|
| | | statistic.setSuperFirstCount(superFirstCount);
|
| | |
| | | // 查询低等级的是否已读,如若未读则设为已读
|
| | | if (notify.getToLevel() == UserLevelEnum.highVIP || notify.getToLevel() == UserLevelEnum.superVIP) {
|
| | | List<UserLevelEnum> levels = new ArrayList<>();
|
| | | if (notify.getToLevel() == UserLevelEnum.highVIP) {
|
| | | levels.add(UserLevelEnum.normalVIP);
|
| | | } else {
|
| | | levels.add(UserLevelEnum.normalVIP);
|
| | | if (notify.getToLevel() == UserLevelEnum.superVIP) {
|
| | | levels.add(UserLevelEnum.highVIP);
|
| | | }
|
| | |
|
| | |
| | | return UserLevelEnum.daRen.getName();
|
| | | }
|
| | |
|
| | | if (orderRank == UserLevelEnum.normalVIP.getOrderRank()) {
|
| | | return UserLevelEnum.normalVIP.getName();
|
| | | }
|
| | |
|
| | | if (orderRank == UserLevelEnum.highVIP.getOrderRank()) {
|
| | | return UserLevelEnum.highVIP.getName();
|
| | | }
|
| | |
| | | }
|
| | | return null;
|
| | | }
|
| | | |
| | |
|
| | | /**
|
| | | * 根据订单rank获取用户的等级
|
| | | * @Title: getByOrderRank
|
| | |
| | | return null;
|
| | |
|
| | | if (level == UserLevelEnum.daRen) {
|
| | | return UserLevelEnum.normalVIP;
|
| | | } else if (level == UserLevelEnum.normalVIP) {
|
| | | return UserLevelEnum.highVIP;
|
| | | } else if (level == UserLevelEnum.highVIP) {
|
| | | return UserLevelEnum.superVIP;
|
| | |
| | | return null;
|
| | | if (level == UserLevelEnum.daRen) {
|
| | | return null;
|
| | | } else if (level == UserLevelEnum.normalVIP) {
|
| | | return UserLevelEnum.daRen;
|
| | | } else if (level == UserLevelEnum.highVIP) {
|
| | | return UserLevelEnum.normalVIP;
|
| | | return UserLevelEnum.daRen;
|
| | | } else if (level == UserLevelEnum.superVIP) {
|
| | | return UserLevelEnum.highVIP;
|
| | | }
|
| | |
| | | */
|
| | |
|
| | | public static UserLevelEnum getOldLevel(UserLevelEnum userLevel) {
|
| | | if (userLevel == null || userLevel == UserLevelEnum.normalVIP || userLevel == UserLevelEnum.highVIP) {
|
| | | if (userLevel == null || userLevel == UserLevelEnum.highVIP) {
|
| | | return UserLevelEnum.daRen;
|
| | | } else if (userLevel == UserLevelEnum.tearcher)
|
| | | return UserLevelEnum.superVIP;
|