| | |
| | | } |
| | | |
| | | String newText = text; // 非通用券需要验证 |
| | | if (comment != null && comment.getTypeEnum() != CommentInfoEnum.currencyCoupon) { |
| | | if ((comment != null && comment.getTypeEnum() != CommentInfoEnum.currencyCoupon) |
| | | || goodsEvaluate.getType() == EvaluateEnum.activity) { |
| | | try { |
| | | newText = convertLinkManager.convertLinkFromText(text, uid, true); |
| | | } catch (ConvertLinkExceptionException e) { |
| | |
| | | @Table("yeshi_ec_msg_other")
|
| | | public class MsgOtherDetail {
|
| | | public enum MsgTypeOtherTypeEnum {
|
| | | couponMianDan("免单券"),
|
| | | couponWelfareMianDan("福利免单券"),
|
| | | freeCouponBuy("自购免单券"),
|
| | | freeCouponGive("赠送免单券"),
|
| | | couponReward("奖励券"),
|
| | | taoLiJin("推广红包"),
|
| | | taoLiJinExchange("推广红包兑换金币"),
|
| | | give("赠送"),
|
| | | exchange("金币兑换"),
|
| | | couponActivate("免单券激活"),
|
| | | firstOrderReward("粉丝首单奖励邀请人金币"),
|
| | | systemGive("系统赠送"),
|
| | | passVIPApply("超级会员"),
|
| | | rejectVIPApply("超级会员"),
|
| | | teamVIPCallBoss ("温馨提醒"),
|
| | | teamSplitCallBoss ("邀请脱离"),
|
| | | vipUpgradeReward("vip升级奖励");
|
| | | couponMianDan("免单券",""),
|
| | | couponWelfareMianDan("福利免单券",""),
|
| | | freeCouponBuy("自购免单券",""),
|
| | | freeCouponGive("赠送免单券",""),
|
| | | couponReward("奖励券",""),
|
| | | taoLiJin("推广红包",""),
|
| | | taoLiJinExchange("推广红包兑换金币",""),
|
| | | give("赠送",""),
|
| | | exchange("金币兑换",""),
|
| | | couponActivate("免单券激活",""),
|
| | | firstOrderReward("粉丝首单奖励邀请人金币",""),
|
| | | systemGive("系统赠送",""),
|
| | | passVIPApply("超级会员",""),
|
| | | rejectVIPApply("超级会员",""),
|
| | | teamVIPCallBoss ("温馨提醒",""),
|
| | | teamSplitCallBoss ("邀请脱离",""),
|
| | | vipUpgradeReward("系统赠送","http://img.flqapp.com/resource/msg/icon_msg_vip.png");
|
| | |
|
| | | private final String desc;
|
| | | private final String icon;
|
| | |
|
| | | private MsgTypeOtherTypeEnum(String desc) {
|
| | | private MsgTypeOtherTypeEnum(String desc, String icon) {
|
| | | this.desc = desc;
|
| | | this.icon = icon;
|
| | | }
|
| | |
|
| | | public String getDesc() {
|
| | | return desc;
|
| | | }
|
| | | |
| | | public String getIcon() {
|
| | | return icon;
|
| | | }
|
| | | }
|
| | |
|
| | | @Column(name = "mo_id")
|
| | |
| | | // 按照发布显示时间段起始时间为准。 |
| | | goodsEvaluate.setPublishTime(goodsEvaluate.getStartTime()); |
| | | |
| | | |
| | | // 按照发布显示时间段起始时间为准。 |
| | | goodsEvaluate.setPublishTime(goodsEvaluate.getStartTime()); |
| | | |
| | | List<CommentInfo> comments = evaluateNew.getComments(); |
| | | if (comments != null && comments.size() > 0) { |
| | | EvaluateEnum typeEnum = evaluateNew.getType(); |
| | |
| | | detail.setCreateTime(new Date());
|
| | | msgOtherDetailMapper.insertSelective(detail);
|
| | | userMsgReadStateService.addOtherMsgUnReadCount(detail.getUser().getId(), 1);
|
| | | } else if (detail.getType() == MsgTypeOtherTypeEnum.taoLiJin) {
|
| | | msgOtherDetailMapper.insertSelective(detail);
|
| | | userMsgReadStateService.addOtherMsgUnReadCount(detail.getUser().getId(), 1);
|
| | | } else if (detail.getType() == MsgTypeOtherTypeEnum.give) {
|
| | | msgOtherDetailMapper.insertSelective(detail);
|
| | | userMsgReadStateService.addOtherMsgUnReadCount(detail.getUser().getId(), 1);
|
| | | } else if (detail.getType() == MsgTypeOtherTypeEnum.exchange) {
|
| | | msgOtherDetailMapper.insertSelective(detail);
|
| | | userMsgReadStateService.addOtherMsgUnReadCount(detail.getUser().getId(), 1);
|
| | | } else if (detail.getType() == MsgTypeOtherTypeEnum.couponActivate) {
|
| | | msgOtherDetailMapper.insertSelective(detail);
|
| | | userMsgReadStateService.addOtherMsgUnReadCount(detail.getUser().getId(), 1);
|
| | | } else if (detail.getType() == MsgTypeOtherTypeEnum.firstOrderReward) {
|
| | | msgOtherDetailMapper.insertSelective(detail);
|
| | | userMsgReadStateService.addOtherMsgUnReadCount(detail.getUser().getId(), 1);
|
| | | }else if (detail.getType() == MsgTypeOtherTypeEnum.systemGive) {
|
| | | msgOtherDetailMapper.insertSelective(detail);
|
| | | userMsgReadStateService.addOtherMsgUnReadCount(detail.getUser().getId(), 1);
|
| | | } else if (detail.getType() == MsgTypeOtherTypeEnum.taoLiJinExchange) {
|
| | | msgOtherDetailMapper.insertSelective(detail);
|
| | | userMsgReadStateService.addOtherMsgUnReadCount(detail.getUser().getId(), 1);
|
| | | } else if (detail.getType() == MsgTypeOtherTypeEnum.passVIPApply |
| | | || detail.getType() == MsgTypeOtherTypeEnum.rejectVIPApply |
| | | || detail.getType() == MsgTypeOtherTypeEnum.teamVIPCallBoss
|
| | | || detail.getType() == MsgTypeOtherTypeEnum.teamSplitCallBoss) {
|
| | | msgOtherDetailMapper.insertSelective(detail);
|
| | | userMsgReadStateService.addOtherMsgUnReadCount(detail.getUser().getId(), 1);
|
| | | }else if (detail.getType() == MsgTypeOtherTypeEnum.vipUpgradeReward) {
|
| | | } else {
|
| | | msgOtherDetailMapper.insertSelective(detail);
|
| | | userMsgReadStateService.addOtherMsgUnReadCount(detail.getUser().getId(), 1);
|
| | | }
|
| | |
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | |
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.factory.msg.MsgOtherCouponContentDTOFactory;
|
| | | import com.yeshi.fanli.util.factory.msg.MsgOtherDetailFactory;
|
| | | import com.yeshi.fanli.vo.msg.CommonMsgItemVO;
|
| | |
|
| | | @Service
|
| | | public class UserOtherMsgNotificationServiceImpl implements UserOtherMsgNotificationService {
|
| | |
| | |
|
| | |
|
| | | @Override
|
| | | public void vipUpgradeReward(Long uid, String beiZhu, MsgOtherSystemGiveDTO dto) {
|
| | | public void createMsgOtherDetail(Long uid, List<CommonMsgItemVO> listMsg, MsgTypeOtherTypeEnum type) {
|
| | | try {
|
| | | if (listMsg == null || listMsg.size() == 0) {
|
| | | return;
|
| | | }
|
| | | MsgOtherDetail detail = new MsgOtherDetail();
|
| | | detail.setBeiZhu(beiZhu);
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setRead(false);
|
| | | detail.setType(type);
|
| | | detail.setUser(new UserInfo(uid));
|
| | | detail.setContent(new Gson().toJson(dto));
|
| | | detail.setType(MsgTypeOtherTypeEnum.vipUpgradeReward);
|
| | | detail.setContent(new Gson().toJson(listMsg));
|
| | | detail.setCreateTime(new Date());
|
| | | msgOtherDetailService.addMsgOtherDetail(detail);
|
| | | } catch (MsgOtherDetailException e) {
|
| | | e.printStackTrace();
|
| | |
| | | package com.yeshi.fanli.service.impl.user.vip;
|
| | |
|
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.HashMap;
|
| | | import java.util.List;
|
| | |
| | | import com.yeshi.fanli.dto.msg.MsgOtherSystemGiveDTO;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgAccountDetail;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgAccountDetail.MsgTypeAccountTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgOtherDetail.MsgTypeOtherTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
|
| | |
| | | import com.yeshi.fanli.service.inter.user.vip.UserVipConfigService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.vo.msg.ClientTextStyleVO;
|
| | | import com.yeshi.fanli.vo.msg.CommonMsgItemVO;
|
| | | import com.yeshi.fanli.vo.msg.CommonMsgItemVOFactory;
|
| | |
|
| | | @Service
|
| | | public class UserVIPInfoServiceImpl implements UserVIPInfoService {
|
| | |
| | | }
|
| | |
|
| | | // 消息
|
| | | 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) {
|
| | | throw new UserVIPInfoException(1, "券赠送失败");
|
| | |
| | | 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();
|
| | |
| | | package com.yeshi.fanli.service.inter.msg;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.dto.msg.MsgOtherCouponActivateDTO;
|
| | | import com.yeshi.fanli.dto.msg.MsgOtherExchangeContentDTO;
|
| | |
| | | import com.yeshi.fanli.entity.bus.msg.MsgOtherDetail.MsgTypeOtherTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserSystemCoupon;
|
| | | import com.yeshi.fanli.vo.msg.CommonMsgItemVO;
|
| | |
|
| | | /**
|
| | | * 用户订单消息通知
|
| | |
| | | */
|
| | | public void teamSplitCallBoss(Long uid, String beiZhu, MsgOtherVIPDTO dto);
|
| | |
|
| | |
|
| | | /**
|
| | | * vip升级奖励
|
| | | * 创建消息明细
|
| | | * @param uid
|
| | | * @param beiZhu
|
| | | * @param dto
|
| | | * @param type
|
| | | * @param listMsg
|
| | | */
|
| | | public void vipUpgradeReward(Long uid, String beiZhu, MsgOtherSystemGiveDTO dto);
|
| | | public void createMsgOtherDetail(Long uid, List<CommonMsgItemVO> listMsg, MsgTypeOtherTypeEnum type);
|
| | |
|
| | | }
|
| | |
| | | import java.util.List;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.reflect.TypeToken;
|
| | | import com.yeshi.fanli.dto.msg.MsgAccountVipDTO;
|
| | | import com.yeshi.fanli.dto.msg.MsgInviteContentDTO;
|
| | | import com.yeshi.fanli.dto.msg.MsgOtherCouponActivateDTO;
|
| | |
| | | if (StringUtil.isNullOrEmpty(msg.getContent()))
|
| | | return null;
|
| | |
|
| | | MsgOtherSystemGiveDTO dto = new Gson().fromJson(msg.getContent(), MsgOtherSystemGiveDTO.class);
|
| | | if (dto == null)
|
| | | return null;
|
| | |
|
| | | List<ClientTextStyleVO> contentList = new ArrayList<>();
|
| | |
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(dto.getReason(), COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("状 态", COLOR_TITLE), contentList));
|
| | |
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(dto.getDesc() + "", COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("奖 励", COLOR_TITLE), contentList));
|
| | |
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(StringUtil.isNullOrEmpty(msg.getBeiZhu()) ? "无" : msg.getBeiZhu(),
|
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备 注", COLOR_TITLE), contentList));
|
| | | Gson gson = new Gson();
|
| | | items.addAll(gson.fromJson(msg.getContent(), new TypeToken<ArrayList<CommonMsgItemVO>>() {}.getType()));
|
| | |
|
| | | UserMsgVO userMsgVO = new UserMsgVO();
|
| | | userMsgVO.setIcon("http://img.flqapp.com/resource/msg/icon_msg_vip.png");
|
| | | userMsgVO.setTitle(dto.getName());
|
| | | userMsgVO.setIcon(msg.getType().getIcon());
|
| | | userMsgVO.setTitle(msg.getType().getDesc());
|
| | | userMsgVO.setTime(msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime());
|
| | | userMsgVO.setContentItems(items);
|
| | | return userMsgVO;
|
| | |
| | | import com.google.gson.annotations.Expose;
|
| | |
|
| | | public class ClientTextStyleVO implements Serializable{
|
| | | |
| | | public final static String COLOR_TITLE = "#888888";
|
| | | public final static String COLOR_CONTENT = "#000000";
|
| | | public final static String COLOR_HIGHLIGHT_CONTENT = "#E5005C";
|
| | | |
| | | /**
|
| | | *
|
| | | */
|