admin
2020-04-02 e8e2e233af733ca3ba625223e2fd2255165e6b70
Merge remote-tracking branch 'origin/div' into div

Conflicts:
fanli/src/main/java/com/yeshi/fanli/service/impl/dynamic/GoodsEvaluateServiceImpl.java

订单加入urank属性
17个文件已修改
1个文件已添加
452 ■■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/DynamicControllerV2.java 46 ●●●● 补丁 | 查看 | 原始文档 | 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 10 ●●●● 补丁 | 查看 | 原始文档 | 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/order/CommonOrderServiceImpl.java 39 ●●●● 补丁 | 查看 | 原始文档 | 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/service/manger/order/HongBaoV2AddManager.java 19 ●●●● 补丁 | 查看 | 原始文档 | 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/vo/msg/CommonMsgItemVOFactory.java 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/resource/env-dev/mongo.properties 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/resource/env-dev/redis.properties 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/resource/rocket/consumer.xml 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/test/java/org/fanli/MyBatisProduce.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/test/java/org/fanli/TaoKeTest.java 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/DynamicControllerV2.java
@@ -49,7 +49,6 @@
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
import com.yeshi.fanli.service.inter.config.ConfigService;
import com.yeshi.fanli.service.inter.count.DailyCountMomentsService;
import com.yeshi.fanli.service.inter.dynamic.ArticleOfficialService;
import com.yeshi.fanli.service.inter.dynamic.DynamicInfoService;
import com.yeshi.fanli.service.inter.dynamic.GoodsEvaluateService;
@@ -136,13 +135,12 @@
    @Resource
    private ShareGoodsService shareGoodsService;
    @Resource
    private DailyCountMomentsService dailyCountMomentsService;
    // @Resource
    // private DailyCountMomentsService dailyCountMomentsService;
    @Resource(name = "taskExecutor")
    private TaskExecutor executor;
    private final static long TYPE_REXIAO = 1;// 热销
    private final static long TYPE_TUIJIAN = 2;// 推荐
@@ -638,7 +636,7 @@
                        return new JsonPrimitive("");
                    } else {
                        // 保留2位小数
                        return new JsonPrimitive(MoneyBigDecimalUtil.getWithNoZera(value)+"");
                        return new JsonPrimitive(MoneyBigDecimalUtil.getWithNoZera(value) + "");
                    }
                }
            }).registerTypeAdapter(Date.class, new JsonSerializer<Date>() {
@@ -842,7 +840,8 @@
                            if (imgInfo.getGoodsVO() != null)
                                if (imgInfo.getGoodsVO().getGoodsId().longValue() == goodsId.longValue()
                                        && imgInfo.getGoodsVO().getGoodsType() == goodsType.intValue()) {
                                    String jumpLink = getJumpLink(imgInfo.getGoodsVO(), user, relationId, inviteCode, imgInfo.getUrl());
                                    String jumpLink = getJumpLink(imgInfo.getGoodsVO(), user, relationId, inviteCode,
                                            imgInfo.getUrl());
                                    if (!StringUtil.isNullOrEmpty(jumpLink)) {
                                        list.add(jumpLink);
                                    }
@@ -852,7 +851,8 @@
                    } else if (type == 2 || type == 3) {
                        for (ImgInfo imgInfo : imgs) {
                            if (imgInfo.getGoodsVO() != null) {
                                String jumpLink = getJumpLink(imgInfo.getGoodsVO(), user, relationId, inviteCode, imgInfo.getUrl() );
                                String jumpLink = getJumpLink(imgInfo.getGoodsVO(), user, relationId, inviteCode,
                                        imgInfo.getUrl());
                                if (!StringUtil.isNullOrEmpty(jumpLink)) {
                                    list.add(jumpLink);
                                }
@@ -870,7 +870,7 @@
                        else if (imgInfo.getType() == ImgEnum.activity)
                            if (!StringUtil.isNullOrEmpty(imgInfo.getActivityPic())) {
                                list.add(imgInfo.getActivityPic());
                            }else if(!StringUtil.isNullOrEmpty(imgInfo.getUrl())){
                            } else if (!StringUtil.isNullOrEmpty(imgInfo.getUrl())) {
                                list.add(imgInfo.getUrl());
                            }
                    }
@@ -885,11 +885,12 @@
            if (type == 3) {
                shareCount++;
                goodsEvaluateService.addShareNum(id);
                executor.execute(new Runnable() {
                    @Override
                    public void run() { // 添加每日统计
                        dailyCountMomentsService.addShareClick();
                        // TODO
                        // dailyCountMomentsService.addShareClick();
                    }
                });
            }
@@ -909,7 +910,8 @@
        }
    }
    private String getJumpLink(GoodsDetailVO goodsVO, UserInfo user, String relationId, String inviteCode, String mainPic) {
    private String getJumpLink(GoodsDetailVO goodsVO, UserInfo user, String relationId, String inviteCode,
            String mainPic) {
        String jumpLink = null;
        if (goodsVO.getGoodsType() == Constant.SOURCE_TYPE_TAOBAO) {
            TaoBaoLink taoBaoLink = null;
@@ -1006,7 +1008,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) {
@@ -1020,30 +1023,29 @@
                return;
            }
        }
        // 替换价格
        if (goodsEvaluate.getType() == EvaluateEnum.single) {
            GoodsDetailVO goods = goodsEvaluate.getGoods();
            newText = newText.replace("[原价]", MoneyBigDecimalUtil.getWithNoZera(goods.getZkPrice()) +"");
            newText = newText.replace("[原价]", MoneyBigDecimalUtil.getWithNoZera(goods.getZkPrice()) + "");
            if (!goods.isHasCoupon()) {
                newText = newText.replace("领券抢购", "抢购");
                newText = newText.replace("【券后价】[券后价]元", "");
            } else {
                newText = newText.replace("[券后价]", MoneyBigDecimalUtil.getWithNoZera(goods.getCouponPrice())+"");
                newText = newText.replace("[券后价]", MoneyBigDecimalUtil.getWithNoZera(goods.getCouponPrice()) + "");
            }
            newText.replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n");
        }
        JSONObject data = new JSONObject();
        data.put("text", newText);
        out.print(JsonUtil.loadTrueResult(data));
        executor.execute(new Runnable() {
            @Override
            public void run() { // 添加每日统计
                dailyCountMomentsService.addCopyComment();
                // TODO
                // dailyCountMomentsService.addCopyComment();
            }
        });
    }
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
@@ -34,10 +34,8 @@
import com.yeshi.fanli.entity.bus.clazz.GoodsClass;
import com.yeshi.fanli.entity.dynamic.CommentInfo;
import com.yeshi.fanli.entity.dynamic.CommentInfo.CommentInfoEnum;
import com.yeshi.fanli.entity.dynamic.DynamicInfo;
import com.yeshi.fanli.entity.dynamic.GoodsEvaluate;
import com.yeshi.fanli.entity.dynamic.GoodsEvaluate.EvaluateEnum;
import com.yeshi.fanli.entity.dynamic.GoodsPicture;
import com.yeshi.fanli.entity.dynamic.ImgInfo;
import com.yeshi.fanli.entity.dynamic.ImgInfo.ImgEnum;
import com.yeshi.fanli.entity.dynamic.SimpleGoods;
@@ -48,7 +46,6 @@
import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetailV2;
import com.yeshi.fanli.exception.dynamic.ActivityUserException;
import com.yeshi.fanli.exception.dynamic.GoodsEvaluateException;
import com.yeshi.fanli.exception.goods.ConvertLinkExceptionException;
import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.activity.ActivityUserService;
@@ -1565,13 +1562,10 @@
                e.printStackTrace();
                continue;
            }
            // 按照发布显示时间段起始时间为准。
            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/order/CommonOrderServiceImpl.java
@@ -31,6 +31,7 @@
import com.yeshi.fanli.entity.bus.user.HongBaoV2;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.bus.user.UserSystemCouponRecord;
import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
import com.yeshi.fanli.entity.goods.CommonGoods;
import com.yeshi.fanli.entity.jd.JDGoods;
import com.yeshi.fanli.entity.jd.JDOrder;
@@ -65,6 +66,7 @@
import com.yeshi.fanli.service.inter.user.UserSystemCouponService;
import com.yeshi.fanli.service.inter.user.invite.UserInviteService;
import com.yeshi.fanli.service.inter.user.vip.UserVIPInfoService;
import com.yeshi.fanli.service.manger.user.UserLevelManager;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.MoneyBigDecimalUtil;
import com.yeshi.fanli.util.StringUtil;
@@ -136,9 +138,12 @@
    @Resource
    private UserInfoService userInfoService;
    @Resource
    private UserInviteService userInviteService;
    @Resource
    private UserLevelManager userLevelManager;
    @Resource(name = "producer")
    private Producer orderProducer;
@@ -285,7 +290,6 @@
        }
        Map<Long, Boolean> vipUserMap = userVIPInfoService.listByUids(needSelectVIPUidList);
        // 设置是否为vip订单
        for (CommonOrderVO order : listOrder) {
            if (order.getHongBaoType() == HongBaoV2.TYPE_YIJI || order.getHongBaoType() == HongBaoV2.TYPE_ERJI
@@ -345,7 +349,6 @@
                        totalSettlement = commonOrder.getTotalPayment();
                    }
                    commonGoodsVO.setActualPay("付款金额:¥" + totalSettlement);
                    // 邀请订单信息保护
                    if (HongBaoV2.TYPE_YAOQING == hongBaoType || HongBaoV2.TYPE_YIJI == hongBaoType
@@ -1181,10 +1184,11 @@
        if (oldCommonOrder == null)// 新增
        {
            commonOrder.setCreateTime(new Date());
            UserLevelEnum userLevel = userLevelManager.getUserLevel(commonOrder.getUserInfo().getId(),
                    commonOrder.getThirdCreateTime());
            // 查询是否为vip
            boolean isVIP = userVIPInfoService.isVIP(commonOrder.getUserInfo().getId());
            if (isVIP)
                commonOrder.setUrank(100);// VIP订单
            if (userLevel != null)
                commonOrder.setUrank(userLevel.getOrderRank());// VIP订单
            else {
                UserInfo user = userInfoService.selectAvailableByPrimaryKey(commonOrder.getUserInfo().getId());
                if (user != null)
@@ -1748,14 +1752,11 @@
        return commonOrderMapper.countSearchOrderByUid(uid, list);
    }
    @Override
    public List<CommonOrder> getMinSettleTimeAndUid() {
        return commonOrderMapper.getMinSettleTimeAndUid();
    }
    @Override
    public List<CommonOrderVO> searchOrderByUid(AcceptData acceptData, int page, int size, Long uid, List<ESOrder> list)
            throws Exception {
@@ -1910,7 +1911,7 @@
                    } else if (CommonOrderGoodsVO.TYPE_TMALL.equalsIgnoreCase(shopType)) {
                        order.setOrderType(2);
                    }
                    Integer goodsType = commonGoodsVO.getGoodsType();
                    if (goodsType != null & goodsType == Constant.SOURCE_TYPE_ELME) {
                        order.setOrderType(Constant.SOURCE_TYPE_ELME); // 饿了么订单
@@ -1919,8 +1920,7 @@
                    order.getListOrderGoods().add(commonGoodsVO);
                }
            }
            // 订单类型
            if (sourceType == Constant.SOURCE_TYPE_TAOBAO) {
                Integer orderType = order.getOrderType();
@@ -1932,7 +1932,6 @@
            } else if (sourceType == Constant.SOURCE_TYPE_PDD) {
                order.setOrderType(4);
            }
            Date thirdCreateTime = order.getThirdCreateTime();
            if (thirdCreateTime != null) {
@@ -1944,7 +1943,6 @@
            if (settleTime != null) {
                order.setReceiveTime("收货时间:" + format.format(settleTime));
            }
            /* 订单状态 转换处理 */
            String orderStateContent = "";
@@ -1966,16 +1964,17 @@
                }
            }
            // 2.1显示返利说明连接>  未失效-自购-分享
            // 2.1显示返利说明连接> 未失效-自购-分享
            if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) {
                if (CommonOrder.STATE_SX != orderState && thirdCreateTime.getTime() > TimeUtil.convertDateToTemp(Constant.ORDER_SHOW_BRACE_TIME)
                        && ((HongBaoV2.TYPE_ZIGOU == hongBaoType || 2 == hongBaoType) || HongBaoV2.TYPE_SHARE_GOODS == hongBaoType) ) {
                if (CommonOrder.STATE_SX != orderState
                        && thirdCreateTime.getTime() > TimeUtil.convertDateToTemp(Constant.ORDER_SHOW_BRACE_TIME)
                        && ((HongBaoV2.TYPE_ZIGOU == hongBaoType || 2 == hongBaoType)
                                || HongBaoV2.TYPE_SHARE_GOODS == hongBaoType)) {
                    String rebateLink = configService.get(ConfigKeyEnum.orderRebateDescLink.getKey());
                    order.setRebateLink(rebateLink + "?orderNo=" + orderNo +"&sourceType=" + sourceType);
                    order.setRebateLink(rebateLink + "?orderNo=" + orderNo + "&sourceType=" + sourceType);
                }
            }
            BigDecimal hongBao = order.getHongBao();
            if (hongBao == null) {
                hongBao = new BigDecimal(0);
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/service/manger/order/HongBaoV2AddManager.java
@@ -23,6 +23,7 @@
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.entity.bus.user.vip.UserLevelEnum;
import com.yeshi.fanli.entity.order.CommonOrder;
import com.yeshi.fanli.entity.order.CommonOrderGoods;
import com.yeshi.fanli.entity.order.HongBaoOrder;
@@ -36,6 +37,7 @@
import com.yeshi.fanli.service.inter.user.UserSystemCouponService;
import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce;
import com.yeshi.fanli.service.inter.user.vip.UserVIPInfoService;
import com.yeshi.fanli.service.manger.user.UserLevelManager;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.MoneyBigDecimalUtil;
import com.yeshi.fanli.util.TaoBaoConstant;
@@ -76,6 +78,9 @@
    @Resource
    private UserVIPInfoService userVIPInfoService;
    @Resource
    private UserLevelManager userLevelManager;
    /**
     * 添加红包信息
@@ -704,9 +709,11 @@
        UserInfo user = userInfoService.getUserById(commonOrder.getUserInfo().getId());
        if (user == null)
            throw new UserAccountException(1001, "用户不存在/被封禁");
        if (isVIP) {
            hongBao.setUrank(HongBaoV2.RANK_VIP);// VIP的等级设置为100
        } else {
        UserLevelEnum userLevel = userLevelManager.getUserLevel(commonOrder.getUserInfo().getId(),
                commonOrder.getThirdCreateTime());
        if (userLevel != null)
            hongBao.setUrank(userLevel.getOrderRank());
        else {
            hongBao.setUrank(user.getRank());
        }
        hongBao.setOrderType(commonOrder.getSourceType());
@@ -850,8 +857,10 @@
        UserInfo user = userInfoService.getUserById(commonOrder.getUserInfo().getId());
        if (user == null)
            throw new UserAccountException(1001, "用户不存在/被封禁");
        if (isVip)
            hongBao.setUrank(HongBaoV2.RANK_VIP);
        UserLevelEnum userLevel = userLevelManager.getUserLevel(commonOrder.getUserInfo().getId(),
                commonOrder.getThirdCreateTime());
        if (userLevel != null)
            hongBao.setUrank(userLevel.getOrderRank());
        else
            hongBao.setUrank(user.getRank());
        hongBao.setUserInfo(user);
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";
    /**
     * 
     */
fanli/src/main/java/com/yeshi/fanli/vo/msg/CommonMsgItemVOFactory.java
New file
@@ -0,0 +1,53 @@
package com.yeshi.fanli.vo.msg;
import java.util.ArrayList;
import java.util.List;
public class CommonMsgItemVOFactory {
    public static CommonMsgItemVO createMsgItemVO(ClientTextStyleVO title, ClientTextStyleVO content) {
        List<ClientTextStyleVO> list = new ArrayList<>();
        list.add(content);
        CommonMsgItemVO itemVO = new CommonMsgItemVO();
        itemVO.setTitle(title);
        itemVO.setContent(list);
        return itemVO;
    }
    public static CommonMsgItemVO createMsgItemVO(ClientTextStyleVO title, ClientTextStyleVO content, boolean click) {
        List<ClientTextStyleVO> list = new ArrayList<>();
        list.add(content);
        CommonMsgItemVO itemVO = new CommonMsgItemVO();
        itemVO.setTitle(title);
        itemVO.setContent(list);
        itemVO.setClick(click);
        return itemVO;
    }
    public static CommonMsgItemVO createMsgItemVO(ClientTextStyleVO title, ClientTextStyleVO content1,
            ClientTextStyleVO content2) {
        List<ClientTextStyleVO> list = new ArrayList<>();
        list.add(content1);
        list.add(content2);
        CommonMsgItemVO itemVO = new CommonMsgItemVO();
        itemVO.setTitle(title);
        itemVO.setContent(list);
        return itemVO;
    }
    public static CommonMsgItemVO createMsgItemVO(ClientTextStyleVO title, ClientTextStyleVO content1,
            ClientTextStyleVO content2, boolean click) {
        List<ClientTextStyleVO> list = new ArrayList<>();
        list.add(content1);
        list.add(content2);
        CommonMsgItemVO itemVO = new CommonMsgItemVO();
        itemVO.setTitle(title);
        itemVO.setContent(list);
        itemVO.setClick(click);
        return itemVO;
    }
}
fanli/src/main/resource/env-dev/mongo.properties
@@ -1,21 +1,21 @@
mongo.dbname=flq-wxmp
mongo.port=27016
mongo.dbname=flq
mongo.port=27017
#开发环境
#mongo.host=192.168.1.253
#mongo.username=admin
#mongo.password=123456
mongo.host=192.168.1.253
mongo.username=admin
mongo.password=123456
mongo.host=193.112.35.168
mongo.username=yeshi
mongo.password=Yeshi2016@
#mongo.host=193.112.35.168
#mongo.username=yeshi
#mongo.password=Yeshi2016@
mongo.connectionsPerHost=8
mongo.threadsAllowedToBlockForConnectionMultiplier=4
mongo.connectTimeout=10000
mongo.maxWaitTime=1500
mongo.maxWaitTime=15000
mongo.autoConnectRetry=true
mongo.socketKeepAlive=true
mongo.socketTimeout=1500
mongo.socketTimeout=15000
mongo.slaveOk=true
mongo.writeNumber=1
mongo.riteTimeout=0
fanli/src/main/resource/env-dev/redis.properties
@@ -1,9 +1,9 @@
#redis.addr=192.168.1.253
#redis.port=6379
#redis.auth=123456
redis.addr=193.112.34.40
redis.port=6379
redis.auth=weikou2014
redis.addr=192.168.1.253
redis.port=6379
redis.auth=123456
#redis.addr=193.112.34.40
#redis.port=6379
#redis.auth=weikou2014
redis.max_total=1024
redis.max_idle=200
redis.max_wait=10000
fanli/src/main/resource/rocket/consumer.xml
@@ -254,5 +254,36 @@
    </bean>
    <!-- 产生有效队员 -->
    <bean id="inviteValidTeamMessageListener"
        class="com.yeshi.fanli.util.rocketmq.consumer.user.InviteValidTeamMessageListener"></bean>
    <!-- Group ID 订阅同一个 Topic,可以创建多个 ConsumerBean -->
    <bean id="inviteValidTeamConsumer" class="com.aliyun.openservices.ons.api.bean.ConsumerBean"
        init-method="start" destroy-method="shutdown">
        <property name="properties"> <!--消费者配置信息 -->
            <props>
                <prop key="AccessKey">${rocketmq.AccessKey}</prop>
                <prop key="SecretKey">${rocketmq.SecretKey}</prop>
                <prop key="GROUP_ID">GID_INVITE_VALID_TEAM</prop>
                <prop key="NAMESRV_ADDR">${rocketmq.NAMESRV_ADDR}</prop>
                <prop key="ConsumeThreadNums">50</prop>
            </props>
        </property>
        <property name="subscriptionTable">
            <map>
                <!-- 订单收货 -->
                <entry value-ref="inviteValidTeamMessageListener">
                    <key>
                        <bean class="com.aliyun.openservices.ons.api.bean.Subscription">
                            <property name="topic" value="TOPIC_ORDER" />
                            <property name="expression" value="orderConfirm" />
                        </bean>
                    </key>
                </entry>
            </map>
        </property>
    </bean>
</beans>
fanli/src/test/java/org/fanli/MyBatisProduce.java
@@ -15,8 +15,9 @@
    @Test
    public void test1() {
        ColumnParseUtil.parseColumn(OrderTeamReward.class,
                "D:/workspace/fanli/fanli-server/fanli/src/main/java/com/yeshi/fanli/mapping/order/OrderTeamRewardMapper.xml");
        ColumnParseUtil.parseColumn(InviteOrderSubsidy.class,
                "D:/workspace/fanli/fanli-server/fanli/src/main/java/com/yeshi/fanli/mapping/order/InviteOrderSubsidyMapper.xml");
    }
}
fanli/src/test/java/org/fanli/TaoKeTest.java
@@ -97,11 +97,19 @@
    @Test
    public void test2() {
        String[] marks = new String[] { "\\(-\\)"};
        // String result = TaoKeApiUtil.officialActivityConvert("19507100253",
        // "1584519810786", "20211660");
        // System.out.println(result);
        List<String> textList = TaoBaoUtil.getTokenListFromText("復製这条(VzUl1fzQWMT)进入【Tao宝】即可抢购", Arrays.asList(marks));
        // TaoKeApiUtil.getQuanInfo(579875678934L,
        // "91b8984019e24fe1b1e3d6bd15479785");
        String result = TaoKeApiUtil.getActivityInfo("1583739244161", TaoBaoConstant.TAOBAO_RELATION_PID_DEFAULT,
                "511374878");
        System.out.println(result);
        System.out.println(textList);
        String token = TaoKeApiUtil.getTKToken("http://", "口碑外卖红包", result);
        System.out.println(token);
    }
    @Test
@@ -400,9 +408,11 @@
        }
    }
    @Test
    public void test13(){
    public void test13() {
        TaoKeApiUtil.specialConvertCoupon(579875678934L, new TaoKeAppInfo(TaoBaoConstant.TAOBAO_AUTH_APPKEY,
                TaoBaoConstant.TAOBAO_AUTH_APPSECRET, TaoBaoConstant.TAOBAO_SPECIAL_PID_DEFAULT));
        try {
            TaoKeApiUtil.getSimpleGoodsInfo(573867930843L);
        } catch (TaobaoGoodsDownException e) {
@@ -410,4 +420,9 @@
        }
    }
    @Test
    public void test14() {
        TaoKeApiUtil.getCouponListByItemId(614089154947L);
    }
}