yujian
2020-04-02 0ec22dcf4fd9c4496e6f681e7fab89f56c6e4e8a
vip 消息
10个文件已修改
199 ■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/DynamicControllerV2.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/msg/MsgOtherDetail.java 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/dynamic/GoodsEvaluateServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/msg/MsgOtherDetailServiceImpl.java 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/msg/UserOtherMsgNotificationServiceImpl.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/vip/UserVIPInfoServiceImpl.java 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/vip/UserVIPPreInfoServiceImpl.java 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/msg/UserOtherMsgNotificationService.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/factory/msg/UserMsgVOFactory.java 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/vo/msg/ClientTextStyleVO.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/DynamicControllerV2.java
@@ -1006,7 +1006,8 @@
        }
        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) {
fanli/src/main/java/com/yeshi/fanli/entity/bus/msg/MsgOtherDetail.java
@@ -20,33 +20,39 @@
@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")
fanli/src/main/java/com/yeshi/fanli/service/impl/dynamic/GoodsEvaluateServiceImpl.java
@@ -1571,10 +1571,6 @@
            // 按照发布显示时间段起始时间为准。
            goodsEvaluate.setPublishTime(goodsEvaluate.getStartTime());
            
            // 按照发布显示时间段起始时间为准。
            goodsEvaluate.setPublishTime(goodsEvaluate.getStartTime());
            List<CommentInfo> comments = evaluateNew.getComments();
            if (comments != null && comments.size() > 0) {
                EvaluateEnum typeEnum = evaluateNew.getType();
fanli/src/main/java/com/yeshi/fanli/service/impl/msg/MsgOtherDetailServiceImpl.java
@@ -37,34 +37,7 @@
                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);
        }
fanli/src/main/java/com/yeshi/fanli/service/impl/msg/UserOtherMsgNotificationServiceImpl.java
@@ -2,6 +2,7 @@
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
@@ -26,6 +27,7 @@
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 {
@@ -538,15 +540,17 @@
    
    
    @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();
fanli/src/main/java/com/yeshi/fanli/service/impl/user/vip/UserVIPInfoServiceImpl.java
@@ -1,5 +1,6 @@
package com.yeshi.fanli.service.impl.user.vip;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
@@ -16,6 +17,7 @@
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;
@@ -43,6 +45,9 @@
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 {
@@ -251,11 +256,14 @@
                }
                
                // 消息
                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, "券赠送失败");
fanli/src/main/java/com/yeshi/fanli/service/impl/user/vip/UserVIPPreInfoServiceImpl.java
@@ -1,6 +1,7 @@
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;
@@ -14,7 +15,7 @@
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;
@@ -42,6 +43,9 @@
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 {
@@ -219,6 +223,11 @@
     */
    @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 = "";
        
@@ -291,11 +300,14 @@
                    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);
                }
                
                // 是否存在下级脱离期限 -更新不脱离
@@ -351,11 +363,11 @@
        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");
@@ -411,12 +423,14 @@
                                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();
fanli/src/main/java/com/yeshi/fanli/service/inter/msg/UserOtherMsgNotificationService.java
@@ -1,6 +1,7 @@
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;
@@ -12,6 +13,7 @@
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;
/**
 * 用户订单消息通知
@@ -301,12 +303,13 @@
     */
    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);
}
fanli/src/main/java/com/yeshi/fanli/util/factory/msg/UserMsgVOFactory.java
@@ -6,6 +6,7 @@
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;
@@ -1750,28 +1751,12 @@
            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;
fanli/src/main/java/com/yeshi/fanli/vo/msg/ClientTextStyleVO.java
@@ -5,6 +5,11 @@
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";
    /**
     * 
     */