| | |
| | |
|
| | | @Resource
|
| | | private ThreeSaleSerivce threeSaleSerivce;
|
| | | |
| | |
|
| | | @Resource
|
| | | private MsgAccountDetailService msgAccountDetailService;
|
| | | |
| | | |
| | |
|
| | | @Override
|
| | | public void addUserVIPPreInfo(UserVIPPreInfo info) throws UserVIPPreInfoException {
|
| | |
| | | return infoList.get(0);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public UserVIPPreInfo getProcessInfo(Long uid, Date time) {
|
| | | List<UserVIPPreInfo> infoList = userVIPPreInfoMapper.listByUid(uid);
|
| | | if (infoList == null || infoList.size() == 0)
|
| | | return null;
|
| | | Comparator<UserVIPPreInfo> cm = new Comparator<UserVIPPreInfo>() {
|
| | |
|
| | | @Override
|
| | | public int compare(UserVIPPreInfo o1, UserVIPPreInfo o2) {
|
| | | return o2.getProcess() - o1.getProcess();
|
| | | }
|
| | | };
|
| | | Collections.sort(infoList, cm);
|
| | |
|
| | | for (UserVIPPreInfo info : infoList) {
|
| | | if (time.getTime() >= info.getCreateTime().getTime())
|
| | | return info;
|
| | | }
|
| | | return null;
|
| | | }
|
| | |
|
| | | @RequestSerializableByKeyService(key = "#uid")
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public void verifyVipPreInfo(Long uid, boolean inviteSuccess) {
|
| | | if (uid == null || uid <= 0)
|
| | | return;
|
| | | |
| | |
|
| | | verifyCondition(uid);
|
| | | |
| | |
|
| | | // 验证上级
|
| | | if (inviteSuccess) {
|
| | | UserInfo boss = threeSaleSerivce.getBoss(uid);
|
| | |
| | | }
|
| | |
|
| | | // 邀请订单
|
| | | long countZiGou =hongBaoV2CountService.counOrderByUidAndOrderType(uid, Constant.VIP_ORDER_PAY,
|
| | | long countZiGou = hongBaoV2CountService.counOrderByUidAndOrderType(uid, Constant.VIP_ORDER_PAY,
|
| | | HongBaoV2.TYPE_ZIGOU);
|
| | | // 邀请订单
|
| | | long countShare = hongBaoV2CountService.counOrderByUidAndOrderType(uid, Constant.VIP_ORDER_PAY,
|
| | |
| | | String msg = "";
|
| | | if (countZiGou >= Constant.VIP_PROCESS_1_ZIGOU) {
|
| | | process = true;
|
| | | msg = "恭喜你!返利订单达到 "+ Constant.VIP_PROCESS_1_ZIGOU +"笔";
|
| | | msg = "恭喜你!返利订单达到 " + Constant.VIP_PROCESS_1_ZIGOU + "笔";
|
| | | } else if (countShare >= Constant.VIP_PROCESS_1_SHARE) {
|
| | | process = true;
|
| | | msg = "恭喜你!分享订单达到 "+ Constant.VIP_PROCESS_1_SHARE +"笔";
|
| | | msg = "恭喜你!分享订单达到 " + Constant.VIP_PROCESS_1_SHARE + "笔";
|
| | | } else if (firstTeam >= Constant.VIP_PROCESS_1_TEAM && secondTeam >= Constant.VIP_PROCESS_1_TEAM_SECOND) {
|
| | | process = true;
|
| | | msg = "直接粉丝达到"+ Constant.VIP_PROCESS_1_TEAM +"人,间接粉丝达到 "+ Constant.VIP_PROCESS_1_TEAM_SECOND +"人";
|
| | | msg = "直接粉丝达到" + Constant.VIP_PROCESS_1_TEAM + "人,间接粉丝达到 " + Constant.VIP_PROCESS_1_TEAM_SECOND + "人";
|
| | | }
|
| | | |
| | |
|
| | | if (process) {
|
| | | try {
|
| | | UserVIPPreInfo info = new UserVIPPreInfo();
|
| | |
| | | info.setCreateTime(new Date());
|
| | | info.setUpdateTime(new Date());
|
| | | addUserVIPPreInfo(info);
|
| | | |
| | |
|
| | | // 消息
|
| | | MsgAccountVipDTO msgDto = new MsgAccountVipDTO();
|
| | | msgDto.setStatus("系统已将你的账户由快省达人升级为普通会员");
|
| | |
| | | } catch (UserVIPPreInfoException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | } |
| | | }
|
| | | return process;
|
| | | }
|
| | |
|
| | |
| | | String msg = "";
|
| | | if (countZiGou >= Constant.VIP_PROCESS_2_ZIGOU) {
|
| | | process = true;
|
| | | msg = "恭喜你!返利订单达到 "+ Constant.VIP_PROCESS_2_ZIGOU +"笔";
|
| | | msg = "恭喜你!返利订单达到 " + Constant.VIP_PROCESS_2_ZIGOU + "笔";
|
| | | } else if (countShare >= Constant.VIP_PROCESS_2_SHARE) {
|
| | | process = true;
|
| | | msg = "恭喜你!分享订单达到 "+ Constant.VIP_PROCESS_2_SHARE +"笔";
|
| | | msg = "恭喜你!分享订单达到 " + Constant.VIP_PROCESS_2_SHARE + "笔";
|
| | | } else if (firstTeam >= Constant.VIP_PROCESS_2_TEAM && secondTeam >= Constant.VIP_PROCESS_2_TEAM_SECOND) {
|
| | | process = true;
|
| | | msg = "直接粉丝达到"+ Constant.VIP_PROCESS_2_TEAM +"人,间接粉丝达到 "+ Constant.VIP_PROCESS_2_TEAM_SECOND +"人";
|
| | | msg = "直接粉丝达到" + Constant.VIP_PROCESS_2_TEAM + "人,间接粉丝达到 " + Constant.VIP_PROCESS_2_TEAM_SECOND + "人";
|
| | | }
|
| | | |
| | |
|
| | | if (process) {
|
| | | try {
|
| | | UserVIPPreInfo info = new UserVIPPreInfo();
|
| | |
| | | info.setCreateTime(new Date());
|
| | | info.setUpdateTime(new Date());
|
| | | addUserVIPPreInfo(info);
|
| | | |
| | |
|
| | | // 消息
|
| | | MsgAccountVipDTO msgDto = new MsgAccountVipDTO();
|
| | | msgDto.setStatus("系统已将你的账户由普通会员升级为高级会员");
|
| | |
| | | } catch (UserVIPPreInfoException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | } |
| | | }
|
| | | return process;
|
| | | }
|
| | |
|