| | |
| | | package com.yeshi.fanli.service.impl.user.vip;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Collections;
|
| | | import java.util.Comparator;
|
| | | import java.util.Date;
|
| | |
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.user.vip.UserVIPPreInfoMapper;
|
| | | import com.yeshi.fanli.dto.msg.MsgAccountVipDTO;
|
| | | import com.yeshi.fanli.dto.msg.MsgOtherSystemGiveDTO;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgOtherDetail.MsgTypeOtherTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2;
|
| | | import com.yeshi.fanli.entity.bus.user.ThreeSale;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | |
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.annotation.RequestSerializableByKeyService;
|
| | | import com.yeshi.fanli.vo.msg.ClientTextStyleVO;
|
| | | import com.yeshi.fanli.vo.msg.CommonMsgItemVO;
|
| | | import com.yeshi.fanli.vo.msg.CommonMsgItemVOFactory;
|
| | |
|
| | | @Service
|
| | | public class UserVIPPreInfoServiceImpl implements UserVIPPreInfoService {
|
| | |
| | | */
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | private boolean oneProcess(Long uid, long countZiGou, long countShare, long firstTeam, long secondTeam) {
|
| | | UserVIPPreInfo oldInfo = userVIPPreInfoMapper.selectByUidAndProcess(uid, UserVIPPreInfo.PROCESS_1);
|
| | | if (oldInfo != null) {
|
| | | return true;
|
| | | }
|
| | | |
| | | boolean process = false;
|
| | | String msg = "";
|
| | |
|
| | |
| | | userInfoExtraService.addGoldCoinByUid(uid, Integer.parseInt(goldcoin));
|
| | |
|
| | | // 消息
|
| | | MsgOtherSystemGiveDTO dto = new MsgOtherSystemGiveDTO();
|
| | | dto.setName("系统赠送 ");
|
| | | dto.setReason("恭喜你!成功升级为普通会员");
|
| | | dto.setDesc("获得金币" + goldcoinNum+"枚");
|
| | | userOtherMsgNotificationService.vipUpgradeReward(uid, "详情查看,对应会员权益", dto);
|
| | | List<CommonMsgItemVO> listMsg = new ArrayList<>();
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("状 态", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO("恭喜你!成功升级为普通会员", ClientTextStyleVO.COLOR_CONTENT)));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("奖 励", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO("获得金币" + goldcoinNum+"枚", ClientTextStyleVO.COLOR_CONTENT)));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("备 注", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO("详情查看,对应会员权益", ClientTextStyleVO.COLOR_CONTENT)));
|
| | | userOtherMsgNotificationService.createMsgOtherDetail(uid, listMsg, MsgTypeOtherTypeEnum.vipUpgradeReward);
|
| | | }
|
| | |
|
| | | // 是否存在下级脱离期限 -更新不脱离
|
| | |
| | | boolean process = false;
|
| | | String msg = "";
|
| | |
|
| | | long limitZiGou = 0;
|
| | | String zigou = userVipConfigService.getValueByKey("vip_pre_7_zigou_order_count");
|
| | | if (!StringUtil.isNullOrEmpty(zigou)) {
|
| | | limitZiGou = Long.parseLong(zigou);
|
| | | }
|
| | | long limitZiGou = 10;
|
| | | // String zigou = userVipConfigService.getValueByKey("vip_pre_7_zigou_order_count");
|
| | | // if (!StringUtil.isNullOrEmpty(zigou)) {
|
| | | // limitZiGou = Long.parseLong(zigou);
|
| | | // }
|
| | |
|
| | | long limitShare = 0;
|
| | | String share = userVipConfigService.getValueByKey("vip_pre_7_share_order_count");
|
| | |
| | | UserSystemCoupon.SOURCE_SYSTEM_PUSH, percent, false);
|
| | | }
|
| | |
|
| | | // 消息
|
| | | MsgOtherSystemGiveDTO dto = new MsgOtherSystemGiveDTO();
|
| | | dto.setName("系统赠送 ");
|
| | | dto.setReason("恭喜你!成功升级为高级会员");
|
| | | dto.setDesc("获得返利奖励券" + num +"张");
|
| | | userOtherMsgNotificationService.vipUpgradeReward(uid, "详情查看,对应会员权益", dto);
|
| | | List<CommonMsgItemVO> listMsg = new ArrayList<>();
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("状 态", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO("恭喜你!成功升级为高级会员", ClientTextStyleVO.COLOR_CONTENT)));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("奖 励", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO("获得返利奖励券" + num +"张", ClientTextStyleVO.COLOR_CONTENT)));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("备 注", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO("详情查看,对应会员权益", ClientTextStyleVO.COLOR_CONTENT)));
|
| | | userOtherMsgNotificationService.createMsgOtherDetail(uid, listMsg, MsgTypeOtherTypeEnum.vipUpgradeReward);
|
| | | }
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|