admin
2020-03-24 885c66fcc29c3b1b4d1cc94883aaff0ed64e435c
发圈活动支持淘宝活动,团队补贴/团队奖励增加生效/失效时间
6个文件已修改
106 ■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/DynamicControllerV2.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/dynamic/GoodsEvaluateServiceImpl.java 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/order/InviteOrderSubsidyServiceImpl.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/order/InviteOrderSubsidyServiceImplV2.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderTeamRewardServiceImpl.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/manger/goods/ConvertLinkManager.java 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/DynamicControllerV2.java
@@ -861,6 +861,8 @@
                        else if (imgInfo.getType() == ImgEnum.activity)
                            if (!StringUtil.isNullOrEmpty(imgInfo.getActivityPic())) {
                                list.add(imgInfo.getActivityPic());
                            }else if(!StringUtil.isNullOrEmpty(imgInfo.getUrl())){
                                list.add(imgInfo.getUrl());
                            }
                    }
                }
fanli/src/main/java/com/yeshi/fanli/service/impl/dynamic/GoodsEvaluateServiceImpl.java
@@ -340,7 +340,6 @@
            }
        }
        
        // 上传文件替换
        if (fileRequest != null) {
            for (int i = 0; i < 9; i++) {
@@ -476,8 +475,9 @@
        }
        /*
         * // 无券不能自动 生成评论 CouponInfoVO couponInfo1 = goodsDetailVO.getCouponInfo(); if
         * (couponInfo1 == null) { addComment = false; }
         * // 无券不能自动 生成评论 CouponInfoVO couponInfo1 =
         * goodsDetailVO.getCouponInfo(); if (couponInfo1 == null) { addComment
         * = false; }
         */
        String commentText = "";
@@ -509,15 +509,18 @@
                commentText = template.replace("[链接]", jumpLink);
            }
//            commentText = commentText.replace("[原价]", MoneyBigDecimalUtil.getWithNoZera(goodsDetailVO.getZkPrice())+"");
            // commentText = commentText.replace("[原价]",
            // MoneyBigDecimalUtil.getWithNoZera(goodsDetailVO.getZkPrice())+"");
//            if (!goodsDetailVO.isHasCoupon()) {
//                commentText = commentText.replace("领券抢购", "抢购");
//                commentText = commentText.replace("【券后价】[券后价]元", "");
//            } else {
//                commentText = commentText.replace("[券后价]",  MoneyBigDecimalUtil.getWithNoZera(goodsDetailVO.getCouponPrice())+"");
            // commentText = commentText.replace("[券后价]",
            // MoneyBigDecimalUtil.getWithNoZera(goodsDetailVO.getCouponPrice())+"");
//            }
//
//            commentText = commentText.replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n").replace("\r\n\r\n",
            // commentText = commentText.replace("\r\n\r\n",
            // "\r\n").replace("\r\n\r\n", "\r\n").replace("\r\n\r\n",
//                    "\r\n");
            CommentInfo commentInfo = new CommentInfo();
@@ -1482,7 +1485,6 @@
        return goodsEvaluateDao.count(key, state, dynamicType);
    }
    @Override
    public void addRanDomShareCount() {
        // 发圈
@@ -1519,7 +1521,6 @@
            LogHelper.errorDetailInfo(e);
        }
    }
    
    @Override
    @Cacheable(value = "dynamicCache", key = "'queryValidEvaluateCache-'+#start")
@@ -1592,18 +1593,33 @@
                        if (goods != null) {
                            String content = commentInfoNew.getContent();
                            if (!StringUtil.isNullOrEmpty(content)) {
                                content = content.replace("[原价]", MoneyBigDecimalUtil.getWithNoZera(goods.getZkPrice())+"");
                                content = content.replace("[原价]",
                                        MoneyBigDecimalUtil.getWithNoZera(goods.getZkPrice()) + "");
                                if (goods.isHasCoupon()) {
                                    content = content.replace("[券后价]",MoneyBigDecimalUtil.getWithNoZera(goods.getCouponPrice())+"");
                                    content = content.replace("[券后价]",
                                            MoneyBigDecimalUtil.getWithNoZera(goods.getCouponPrice()) + "");
                                } else {
                                    singleCoupn = false;
                                    content = content.replace("领券抢购", "抢购");
                                    content = content.replace("【券后价】[券后价]元", "");
                                }
                                content = content.replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n");
                                // 替换淘宝官方活动
                                List<String> activityIdList = convertLinkManager.getTaoBaoOfficialActivityId(content);
                                for (String st : activityIdList)
                                    content = content.replace(st, "");
                                commentInfoNew.setContent(content);
                            }
                        }
                    }
                    if (typeEnum != null && typeEnum == EvaluateEnum.activity) {
                        // 替换淘宝官方活动
                        String content = commentInfoNew.getContent();
                        List<String> activityIdList = convertLinkManager.getTaoBaoOfficialActivityId(content);
                        for (String st : activityIdList)
                            content = content.replace(st, "");
                        commentInfoNew.setContent(content);
                    }
                    
                    CommentInfoEnum typeComment = commentInfoNew.getTypeEnum();
@@ -1896,7 +1912,9 @@
                    TaoBaoLink taoBaoLink = shareGoodsService.getTaoBaoLinkForShare(1L, goodsVO.getGoodsId(), "0");
//                    TaoBaoLink taoBaoLink = shareGoodsService.getTaoBaoLinkForShare(Constant.LINK_TOKEN_VERIFY_UID, goodsVO.getGoodsId(), null);
                    // TaoBaoLink taoBaoLink =
                    // shareGoodsService.getTaoBaoLinkForShare(Constant.LINK_TOKEN_VERIFY_UID,
                    // goodsVO.getGoodsId(), null);
                    String template = configService.get(ConfigKeyEnum.quickShareTBCommentText.getKey());
                    String commentText = template.replace("[淘口令]", TaoBaoUtil.filterTaoToken(taoBaoLink.getTaoToken()));
@@ -2089,12 +2107,14 @@
                    String template = configService.get(ConfigKeyEnum.quickShareTBCommentText.getKey());
                    String commentText = template.replace("[淘口令]", TaoBaoUtil.filterTaoToken(token));
                    commentText = commentText.replace("[原价]", MoneyBigDecimalUtil.getWithNoZera(goodsVO.getZkPrice())+"");
                    commentText = commentText.replace("[原价]",
                            MoneyBigDecimalUtil.getWithNoZera(goodsVO.getZkPrice()) + "");
                    if (!goodsVO.isHasCoupon()) {
                        commentText = commentText.replace("领券抢购", "抢购");
                        commentText = commentText.replace("【券后价】[券后价]元", "");
                    } else {
                        commentText = commentText.replace("[券后价]", MoneyBigDecimalUtil.getWithNoZera(goodsVO.getCouponPrice())+"");
                        commentText = commentText.replace("[券后价]",
                                MoneyBigDecimalUtil.getWithNoZera(goodsVO.getCouponPrice()) + "");
                    }
                    commentText = commentText.replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n")
                            .replace("\r\n\r\n", "\r\n");
@@ -2129,7 +2149,6 @@
                    commentInfo2.setContent(text2);
                    commentInfo2.setTypeEnum(CommentInfoEnum.goodsCoupon);
                    commentInfo2.setType("");
                    
                    List<CommentInfo> commentsNew = new ArrayList<>();
                    commentsNew.add(commentInfo);
@@ -2252,7 +2271,8 @@
            if (goods == null) {
                return;
            }
            List<GoodsEvaluate> queryExist = goodsEvaluateDao.queryExist(Constant.SOURCE_TYPE_TAOBAO, goods.getAuctionId());
            List<GoodsEvaluate> queryExist = goodsEvaluateDao.queryExist(Constant.SOURCE_TYPE_TAOBAO,
                    goods.getAuctionId());
            if (queryExist == null || queryExist.size() == 0) {
                return;
            }
@@ -2305,8 +2325,8 @@
        int goodsType = goodsNew.getGoodsType();
        for (GoodsEvaluate goodsEvaluate: listExist) {
            GoodsDetailVO goodsDetailVO = goodsEvaluate.getGoods();
            if (goodsDetailVO != null && goodsDetailVO.getGoodsId() != null
                && goodsDetailVO.getGoodsId() == goodsId && goodsDetailVO.getGoodsType() == goodsType) {
            if (goodsDetailVO != null && goodsDetailVO.getGoodsId() != null && goodsDetailVO.getGoodsId() == goodsId
                    && goodsDetailVO.getGoodsType() == goodsType) {
                goodsEvaluate.setGoods(goodsNew);
            }
            
@@ -2322,7 +2342,6 @@
                        || goodsType != simpleGoods.getGoodsType()) {
                    continue;
                }
                
                simpleGoods.setState(0);
                simpleGoods.setPrice(goodsNew.getCouponPrice());
fanli/src/main/java/com/yeshi/fanli/service/impl/order/InviteOrderSubsidyServiceImpl.java
@@ -223,6 +223,7 @@
                    InviteOrderSubsidy update = new InviteOrderSubsidy(subsidy.getId());
                    update.setState(InviteOrderSubsidy.STATE_INVALID);
                    update.setUpdateTime(new Date());
                    update.setInValidTime(new Date());
                    inviteOrderSubsidyMapper.updateByPrimaryKeySelective(update);
                }
            }
@@ -239,6 +240,7 @@
                    InviteOrderSubsidy update = new InviteOrderSubsidy(subsidy.getId());
                    update.setState(InviteOrderSubsidy.STATE_VALID);
                    update.setUpdateTime(new Date());
                    update.setValidTime(new Date());
                    inviteOrderSubsidyMapper.updateByPrimaryKeySelective(update);
                }
            }
fanli/src/main/java/com/yeshi/fanli/service/impl/order/InviteOrderSubsidyServiceImplV2.java
@@ -344,6 +344,7 @@
                    InviteOrderSubsidy update = new InviteOrderSubsidy(subsidy.getId());
                    update.setState(InviteOrderSubsidy.STATE_INVALID);
                    update.setUpdateTime(new Date());
                    update.setInValidTime(new Date());
                    inviteOrderSubsidyMapper.updateByPrimaryKeySelective(update);
                    orderTeamRewardService.invalidByOrderIdAndSourceType(subsidy.getId());
                }
@@ -375,6 +376,7 @@
                    InviteOrderSubsidy update = new InviteOrderSubsidy(subsidy.getId());
                    update.setState(InviteOrderSubsidy.STATE_VALID);
                    update.setUpdateTime(new Date());
                    update.setValidTime(new Date());
                    update.setPreGetTime(preGetTime);
                    inviteOrderSubsidyMapper.updateByPrimaryKeySelective(update);
                    orderTeamRewardService.validByOrderIdAndSourceType(subsidy.getId(), preGetTime);
fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderTeamRewardServiceImpl.java
@@ -115,7 +115,7 @@
                    OrderTeamReward update = new OrderTeamReward(subsidy.getId());
                    update.setState(OrderTeamReward.STATE_INVALID);
                    update.setUpdateTime(new Date());
                    update.setInValidTime(new Date());
                    orderTeamRewardMapper.updateByPrimaryKeySelective(update);
                }
            }
@@ -132,6 +132,7 @@
                    update.setState(OrderTeamReward.STATE_VALID);
                    update.setUpdateTime(new Date());
                    update.setPreGetTime(preGetTime);
                    update.setValidTime(new Date());
                    orderTeamRewardMapper.updateByPrimaryKeySelective(update);
                }
            }
fanli/src/main/java/com/yeshi/fanli/service/manger/goods/ConvertLinkManager.java
@@ -1,10 +1,13 @@
package com.yeshi.fanli.service.manger.goods;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.annotation.Resource;
@@ -122,6 +125,22 @@
        return newText;
    }
    // 获取淘宝官方活动ID内容
    public List<String> getTaoBaoOfficialActivityId(String text) {
        // {淘宝活动:13123123}
        String regex = "(\\{\u6dd8\u5b9d\u6d3b\u52a8\\:){1}+[0-9]{5,20}\\}{1}";
        Pattern pattern = Pattern.compile(regex);
        Matcher m = pattern.matcher(text);
        List<String> urlList = new ArrayList<>();
        while (m.find()) {
            urlList.add(m.group());
        }
        return urlList;
    }
    /**
     * 
     * @Title: convertTBLinkFromText @Description: 转链文本中的淘口令 @param text @param
@@ -131,6 +150,8 @@
        StringBuilder builder = new StringBuilder(text);
        String newText = builder.toString();
        // 解析淘口令
        List<String> tokenList = TaoBaoUtil.getTokenListFromTextWithKuoHao(newText);
        if (tokenList != null && tokenList.size() > 0) {
@@ -215,6 +236,27 @@
                newText = newText.replace(token, tokenMap.get(token));
            }
        }
        // 解析淘宝官方活动ID
        List<String> list = getTaoBaoOfficialActivityId(newText);
        if (list.size() > 0) {
            String relationId = null;
            if (share) {
                relationId = userExtraTaoBaoInfoService.getRelationIdByUid(uid);
                if (StringUtil.isNullOrEmpty(relationId))
                    throw new Exception("淘宝未授权");
            }
            for (String st : list) {
                String activityid = st.replace("{淘宝活动:", "").replace("}", "");
                if (!StringUtil.isNullOrEmpty(activityid)) {
                    String adzoneId = TaoBaoConstant.TAOBAO_RELATION_PID_DEFAULT.split("_")[3];
                    String link = TaoKeApiUtil.officialActivityConvert(adzoneId, activityid, relationId);
                    String token = TaoKeApiUtil.getTKToken("http://", "淘宝官方活动", link);
                    newText = newText.replace(st, TaoBaoUtil.filterTaoToken(token));
                }
            }
        }
        return newText;
    }