| | |
| | | @Lazy
|
| | | @Resource
|
| | | private UserSystemCouponService userSystemCouponService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private UserVIPPreInfoService userVIPPreInfoService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private MsgAccountDetailService msgAccountDetailService;
|
| | | |
| | | |
| | |
|
| | | @Override
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | |
| | |
|
| | | @Override
|
| | | public boolean isVIP(Long uid) {
|
| | | return isVIP(uid, System.currentTimeMillis());
|
| | | }
|
| | |
|
| | | @Override
|
| | | public boolean isVIP(Long uid, Long time) {
|
| | | UserVIPInfo userInfo = userVIPInfoMapper.selectByPrimaryKey(uid);
|
| | | if (userInfo != null && userInfo.getState() == UserVIPInfo.STATE_SUCCESS)
|
| | | if (userInfo != null && userInfo.getState() == UserVIPInfo.STATE_SUCCESS
|
| | | && userInfo.getSuccessTime().getTime() < time)
|
| | | return true;
|
| | | else
|
| | | return false;
|
| | |
| | |
|
| | | // 1、直接粉丝(从 2020 年 1 月 1 日起直接粉丝产生有效订单)
|
| | | BigDecimal payMoney = new BigDecimal(userVipConfigService.getValueByKey("require_order_pay"));
|
| | | // long teamNum = hongBaoV2CountService.countValidOrderTeamUserByUid(uid,
|
| | | // TimeUtil.convertDateToTemp(Constant.VIP_ONLINE_TIME), payMoney);
|
| | | // long teamNum =
|
| | | // hongBaoV2CountService.countValidOrderTeamUserByUid(uid,
|
| | | // TimeUtil.convertDateToTemp(Constant.VIP_ONLINE_TIME), payMoney);
|
| | | long teamNum = 0L;
|
| | | long vipBegin = TimeUtil.convertDateToTemp(Constant.VIP_ONLINE_TIME);
|
| | | List<ThreeSale> listThreeSale = threeSaleSerivce.getValidWorkerIdsByTime(uid, vipBegin);
|
| | | if (listThreeSale != null && listThreeSale.size() > 0) {
|
| | | for (ThreeSale three: listThreeSale) {
|
| | | for (ThreeSale three : listThreeSale) {
|
| | | UserInfo worker = three.getWorker();
|
| | | if (worker == null || worker.getId() == null) {
|
| | | continue;
|
| | | }
|
| | | // 1、邀请关系成功后;2、单(分享 + 自购)实付款大于1元
|
| | | long countValid = hongBaoV2CountService.countValidOrderByUidAndTime(worker.getId(), three.getSucceedTime(), payMoney);
|
| | | long countValid = hongBaoV2CountService.countValidOrderByUidAndTime(worker.getId(),
|
| | | three.getSucceedTime(), payMoney);
|
| | | if (countValid > 0) {
|
| | | teamNum ++;
|
| | | teamNum++;
|
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | |
|
| | | // 区分老用户和新用户
|
| | | String limtDate = userVipConfigService.getValueByKey("vip_execute_time");
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public void applyVIPNew(Long uid) throws UserVIPInfoException {
|
| | | UserVIPPreInfo latestProcess = userVIPPreInfoService.getLatestProcessInfo(uid);
|
| | | if (latestProcess == null || latestProcess.getProcess() != UserVIPPreInfo.PROCESS_2) {
|
| | | throw new UserVIPInfoException(1, "该用户还不是高级会员");
|
| | | } |
| | | |
| | | }
|
| | |
|
| | | if (!verifyVipNew(uid))
|
| | | throw new UserVIPInfoException(1, "系统验证:不满足升级条件");
|
| | | |
| | |
|
| | | UserVIPInfo userInfo = userVIPInfoMapper.selectByPrimaryKeyForUpdate(uid);
|
| | | if (userInfo == null) {
|
| | | userInfo = new UserVIPInfo();
|
| | |
| | | info.setState(UserVIPInfo.STATE_VERIFING);
|
| | | info.setUpdateTime(new Date());
|
| | | userVIPInfoMapper.updateByPrimaryKeySelective(info);
|
| | | |
| | | |
| | |
|
| | | MsgAccountDetail detail = new MsgAccountDetail();
|
| | | detail.setTitle("尊敬的高级会员,系统已收到你的超级会员升级申请,正在受理中");
|
| | | detail.setBeiZhu("如有疑问请联系我的-人工客服");
|
| | |
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | |
| | |
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public void passVIPApplyNew(Long uid) throws UserVIPInfoException {
|
| | |
| | | if (userVIPInfo.getState() != UserVIPInfo.STATE_VERIFING) {
|
| | | throw new UserVIPInfoException(2, "申请未处于审核状态");
|
| | | }
|
| | | |
| | |
|
| | | UserVIPPreInfo latestProcess = userVIPPreInfoService.getLatestProcessInfo(uid);
|
| | | if (latestProcess == null || latestProcess.getProcess() != UserVIPPreInfo.PROCESS_2) {
|
| | | throw new UserVIPInfoException(1, "该用户还不是高级会员");
|
| | | } |
| | | |
| | | }
|
| | |
|
| | | if (!verifyVipNew(uid))
|
| | | throw new UserVIPInfoException(1, "系统验证:不满足升级条件");
|
| | | |
| | |
|
| | | // 额外信息
|
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getByUidForUpdate(uid);
|
| | | if (userInfoExtra == null)
|
| | |
| | | detail.setCreateTime(new Date());
|
| | | detail.setUniqueKey("VIP-" + uid);
|
| | | integralDetailService.insertSelective(detail);
|
| | | |
| | |
|
| | | try {
|
| | | // 奖励券
|
| | | BigDecimal percent = new BigDecimal(configService.get(ConfigKeyEnum.exchangeRebatePercent.getKey()));
|
| | |
| | | throw new UserVIPInfoException(1, "券赠送失败");
|
| | | }
|
| | |
|
| | | |
| | | // 消息
|
| | | MsgAccountVipDTO msgDto = new MsgAccountVipDTO();
|
| | | msgDto.setStatus("已将你的账户由高级会员升级为超级会员");
|
| | | msgDto.setEquity("从收到本消息起,你将获得全部超级会员权益");
|
| | | msgAccountDetailService.addMsgVIP(uid, "恭喜你!经人工审核你满足升级超级会员条件", "如有疑问请联系我的-人工客服", msgDto);
|
| | | }
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 验证是否符合VIP
|
| | | * @param uid
|
| | |
| | | // 队员
|
| | | long firstTeam = threeSaleSerivce.countFirstTeam(uid, 1);
|
| | | long secondTeam = threeSaleSerivce.countSecondTeam(uid, 1);
|
| | | |
| | |
|
| | | if (countZiGou >= Constant.VIP_PROCESS_3_ZIGOU || countShare >= Constant.VIP_PROCESS_3_SHARE
|
| | | || (firstTeam >= Constant.VIP_PROCESS_3_TEAM && secondTeam >= Constant.VIP_PROCESS_3_TEAM_SECOND)) {
|
| | | return true;
|
| | | } |
| | | }
|
| | | return false;
|
| | | }
|
| | | |
| | | |
| | |
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public void rejectVIPApplyNew(Long uid, String reason) throws UserVIPInfoException {
|
| | |
| | | info.setState(UserVIPInfo.STATE_INVALID);
|
| | | info.setUpdateTime(new Date());
|
| | | userVIPInfoMapper.updateByPrimaryKeySelective(info);
|
| | | |
| | |
|
| | | // 消息
|
| | | MsgAccountVipDTO msgDto = new MsgAccountVipDTO();
|
| | | msgDto.setStatus("你的账号仍是高级会员");
|
| | | msgDto.setReason(reason);
|
| | | msgAccountDetailService.addMsgVIP(uid, "很抱歉!经人工审核你未满足或不符合升级超级会员的条件", "如有疑问请联系我的-人工客服", msgDto);
|
| | | }
|
| | |
|
| | | }
|