admin
2024-10-16 62a447d89331aee1feae7724c7616aa1bb2cfe79
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoBaoUtil.java
@@ -208,7 +208,7 @@
            for (String c : filter.getCateIds().split(","))
                cateList.add(Long.parseLong(c));
        }
        return TaoKeApiUtil.searchWuLiao(filter, specialId, relationId);
        return TaoKeApiUtil.searchWuLiaoNew(filter, specialId, relationId);
    }
    /**
@@ -496,7 +496,7 @@
        }
        if (1 > 0)
            return TaoKeApiUtil.searchWuLiao(filter, null, null);
            return TaoKeApiUtil.searchWuLiaoNew(filter, null, null);
        Map<String, String> params = new HashMap<String, String>();
        String key = filter.getKey();
@@ -1731,7 +1731,11 @@
     */
    public static TaoBaoGoodsBrief convert(CommonGoods commonGoods) {
        TaoBaoGoodsBrief taoBaoGoods = new TaoBaoGoodsBrief();
        taoBaoGoods.setAuctionId(commonGoods.getGoodsId());
        if(!StringUtil.isNullOrEmpty(commonGoods.getGoodsSign())) {
            taoBaoGoods.setAuctionId(commonGoods.getGoodsSign());
        }else{
            taoBaoGoods.setAuctionId(commonGoods.getGoodsId());
        }
        taoBaoGoods.setBiz30day(commonGoods.getSales());
        taoBaoGoods.setCouponAmount(commonGoods.getCouponAmount());
        taoBaoGoods.setCouponInfo(commonGoods.getCouponInfo());
@@ -2362,18 +2366,18 @@
    }
    /**
     * @author hxh
     * @return org.springframework.data.mongodb.core.query.Criteria
     * @author hxh
     * @description 获取mongodb商品ID相同的条件
     * @date 16:05 2022/8/24
     * @param: key
     * @param: auctionId
     * @return org.springframework.data.mongodb.core.query.Criteria
     **/
    public static Criteria getAuctionIdEqualCriteria(String key, String auctionId) {
        if (!isNewAuctionId(auctionId)) {
            return Criteria.where(key).is(auctionId);
        } else {
            return Criteria.where(key).regex("*-" + getAuctionId(auctionId));
            return Criteria.where(key).regex("-" + getAuctionId(auctionId));
        }
    }
@@ -2390,9 +2394,35 @@
        return false;
    }
    /**
     * @return java.lang.String
     * @author hxh
     * @description 获取淘宝的商品标题
     * @date 11:36 2022/9/9
     **/
    public static String getGoodsTitleFromTokenText(String text) {
        String reg = "「.*」";
        Pattern p = Pattern.compile(reg);
        Matcher matcher = p.matcher(text);
        if (matcher.find()) {
            String title = matcher.group();
            if(title!=null&&title.length()>0) {
              return title.replace("「","").replace("」","");
            }
        }
        return null;
    }
    public static void main(String[] args) {
        System.out.println(isHaveNewVersionTaoBaoToken("復至\uD83D\uDC8B9.0₪sDO0X7l3Twm₪/ 去táo寶抢"));
        String reg = "「.*」";
        Pattern p = Pattern.compile(reg);
        Matcher matcher = p.matcher("【淘宝】https://m.tb.cn/h.Ub3d7Kb?tk=g2Az2EmdcIX CZ3457 「造梦【蔷薇少女】复古碎花牛奶绒羊羔绒毛毯秋冬保暖休闲毯沙发毯」\n" +
                "点击链接直接打开");
        if (matcher.find()) {
            String title = matcher.group();
            System.out.println(title);
        }
    }
}