admin
2024-01-23 81da61b828e29b7745e1382dfbbaeb685dc083ef
抖音转链修改
26个文件已修改
620 ■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/admin/TaoBaoGoodsBriefAdminController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/GoodsClassController.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserCouponController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsClassControllerV2.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/h5/BuWanH5Controller.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/UserSystemCouponRecord.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/job/QualityFactoryJob.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/brand/BrandClassShopServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/brand/BrandGoodsCaheServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/lable/TaoKeGoodsServiceImpl.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/push/PushInfoServiceImpl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/special/S11ServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserSystemCouponService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/manger/ClipboardAnalysisManager.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/manger/goods/ConvertLinkManager.java 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/VerifyCodeUtil.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/goods/GoodsJumpUtil.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/goods/douyin/CSJCPSApiUtil.java 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/goods/douyin/DYUtil.java 63 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/goods/douyin/vo/DYConvertResult.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/jd/JDUtil.java 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/push/IOSPushUtil.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoBaoUtil.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoKeApiUtil.java 321 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/resource/mapping/user/UserSystemCouponRecordMapper.xml 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
utils/src/main/java/org/yeshi/utils/HttpUtil.java 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/TaoBaoGoodsBriefAdminController.java
@@ -456,7 +456,7 @@
        if (!islink) {
            /* 淘宝物料搜索 */
            result = TaoKeApiUtil.searchWuLiao(filter,null,null);
            result = TaoKeApiUtil.searchWuLiaoNew(filter,null,null);
        } else {
            /* 商品链接搜索 */
            TaoBaoGoodsBrief searchGoodsDetail = TaoKeApiUtil.searchGoodsDetail(auctionId);
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/GoodsClassController.java
@@ -437,7 +437,7 @@
                    searchfilter.setMaterialId("6707");
                taoKeGoodsService.setSearchFilter(searchfilter, filter, order, startprice, endprice, fastFilter,
                        totalSales);
                TaoBaoSearchResult searchResult = TaoKeApiUtil.searchWuLiao(searchfilter,null,null);
                TaoBaoSearchResult searchResult = TaoKeApiUtil.searchWuLiaoNew(searchfilter,null,null);
                long count = searchResult.getPageEntity().getTotalCount();
                JSONObject result = new JSONObject();
@@ -456,7 +456,7 @@
                    searchfilter.setPage((int) (count % 20 == 0 ? count / 20 - 1 : count / 20));
                    searchfilter.setPageSize(20);
                    searchfilter.setKey(goodsSubClass.getKey());
                    TaoBaoSearchResult searchResult2 = TaoKeApiUtil.searchWuLiao(searchfilter,null,null);
                    TaoBaoSearchResult searchResult2 = TaoKeApiUtil.searchWuLiaoNew(searchfilter,null,null);
                    if (searchResult2 != null) {
                        List<TaoBaoGoodsBrief> resultListTemp = searchResult2.getTaoBaoGoodsBriefs();
                        if (resultListTemp != null)
@@ -825,7 +825,7 @@
            sf.setQuan(1);
            sf.setKey(goodsClassService.getKeysById(id));
            result = TaoKeApiUtil.searchWuLiao(sf,null,null);
            result = TaoKeApiUtil.searchWuLiaoNew(sf,null,null);
        }
        List<TaoBaoSearchNav> navList = TaoBaoUtil.getBaseNav();
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserCouponController.java
@@ -230,7 +230,7 @@
     * @param out
     */
    @RequestMapping(value = "useFreeCoupon", method = RequestMethod.POST)
    public void useFreeCoupon(AcceptData acceptData, Long uid, Long cid, Long goodId, Integer goodsType, PrintWriter out) {
    public void useFreeCoupon(AcceptData acceptData, Long uid, Long cid, String goodId, Integer goodsType, PrintWriter out) {
        if (uid == null) {
            out.print(JsonUtil.loadFalseResult("用户未登录"));
            return;
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsClassControllerV2.java
@@ -265,7 +265,7 @@
                    searchfilter.setMaterialId("6707");
                taoKeGoodsService.setSearchFilter(searchfilter, filter, order, startprice, endprice, fastFilter,
                        totalSales);
                TaoBaoSearchResult searchResult = TaoKeApiUtil.searchWuLiao(searchfilter, null, null);
                TaoBaoSearchResult searchResult = TaoKeApiUtil.searchWuLiaoNew(searchfilter, null, null);
                long count = searchResult.getPageEntity().getTotalCount();
                List<TaoBaoGoodsBrief> resultGoodsList = searchResult.getTaoBaoGoodsBriefs();
@@ -280,7 +280,7 @@
                    searchfilter.setPage((int) (count % 20 == 0 ? count / 20 - 1 : count / 20));
                    searchfilter.setPageSize(20);
                    searchfilter.setKey(goodsSubClass.getKey());
                    TaoBaoSearchResult searchResult2 = TaoKeApiUtil.searchWuLiao(searchfilter, null, null);
                    TaoBaoSearchResult searchResult2 = TaoKeApiUtil.searchWuLiaoNew(searchfilter, null, null);
                    if (searchResult2 != null) {
                        List<TaoBaoGoodsBrief> resultListTemp = searchResult2.getTaoBaoGoodsBriefs();
                        if (resultListTemp != null)
fanli/src/main/java/com/yeshi/fanli/controller/h5/BuWanH5Controller.java
@@ -80,7 +80,7 @@
        List<GoodsDetailVO> goodsList = new ArrayList<>();
        TaoBaoSearchResult result = taoBaoGoodsCacheUtil.getSearchResult(sf);
        if (result == null) {
            result = TaoKeApiUtil.searchWuLiao(sf, null, null);
            result = TaoKeApiUtil.searchWuLiaoNew(sf, null, null);
            taoBaoGoodsCacheUtil.saveSearchResult(sf, result);
        }
        if (result != null) {
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/UserSystemCouponRecord.java
@@ -31,7 +31,7 @@
    // 商品id
    @Column(name = "ucr_good_id")
    private Long goodId;
    private String goodId;
    // 商品来源
    @Column(name = "ucr_good_source")
@@ -69,11 +69,11 @@
        this.id = id;
    }
    public Long getGoodId() {
    public String getGoodId() {
        return goodId;
    }
    public void setGoodId(Long goodId) {
    public void setGoodId(String goodId) {
        this.goodId = goodId;
    }
fanli/src/main/java/com/yeshi/fanli/job/QualityFactoryJob.java
@@ -145,7 +145,7 @@
            for (int page = 1; page <= pageMax; page++) {
                filter.setPage(page);
                TaoBaoSearchResult result = TaoKeApiUtil.searchWuLiao(filter,null,null);
                TaoBaoSearchResult result = TaoKeApiUtil.searchWuLiaoNew(filter,null,null);
                // 结果为空 结束请求
                if (result == null) {
fanli/src/main/java/com/yeshi/fanli/service/impl/brand/BrandClassShopServiceImpl.java
@@ -509,7 +509,7 @@
                sf.setKey(shop.getShop().getShopName().replace("官方旗舰店", "").replace("旗舰店", ""));
                sf.setPage(1);
                sf.setPageSize(100);
                TaoBaoSearchResult result = TaoKeApiUtil.searchWuLiao(sf,null,null);
                TaoBaoSearchResult result = TaoKeApiUtil.searchWuLiaoNew(sf,null,null);
                List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
                if (result != null && result.getTaoBaoGoodsBriefs() != null)
                    for (TaoBaoGoodsBrief goods : result.getTaoBaoGoodsBriefs()) {
fanli/src/main/java/com/yeshi/fanli/service/impl/brand/BrandGoodsCaheServiceImpl.java
@@ -99,7 +99,7 @@
            filter.setPageSize(100);
            filter.setTmall(true);
            filter.setSort(TaoBaoUtil.SORT_SALE_HIGH_TO_LOW);
            TaoBaoSearchResult searchResult = TaoKeApiUtil.searchWuLiao(filter,null,null);
            TaoBaoSearchResult searchResult = TaoKeApiUtil.searchWuLiaoNew(filter,null,null);
            // 删除店铺
            brandShopCaheService.removeByDateAndType(brandInfo.getId(), 11, date);
fanli/src/main/java/com/yeshi/fanli/service/impl/lable/TaoKeGoodsServiceImpl.java
@@ -200,7 +200,7 @@
    public JSONObject searchWuLiao(SearchFilter sf, SystemEnum system) {
        // 淘宝物料接口查询
        TaoBaoSearchResult result = TaoKeApiUtil.searchWuLiao(sf, null, null);
        TaoBaoSearchResult result = TaoKeApiUtil.searchWuLiaoNew(sf, null, null);
        List<TaoBaoSearchNav> navList = TaoBaoUtil.getBaseNav();
        if (result.getNavList() != null)
@@ -288,7 +288,7 @@
    public JSONObject searchWuLiaoV2(SearchFilter sf, String platform, String version, SystemEnum system) {
        // 淘宝物料接口查询
        TaoBaoSearchResult result = TaoKeApiUtil.searchWuLiao(sf, null, null);
        TaoBaoSearchResult result = TaoKeApiUtil.searchWuLiaoNew(sf, null, null);
        List<TaoBaoSearchNav> navList = TaoBaoUtil.getBaseNav();
        if (result.getNavList() != null)
@@ -358,7 +358,7 @@
    @Cacheable(value = "searchWuLiaoCache", key = "'searchWuLiaoList-'+#sf+'-'+system")
    public List<TaoBaoGoodsBrief> searchWuLiaoList(SearchFilter sf, SystemEnum system) {
        // 淘宝物料接口查询
        TaoBaoSearchResult result = TaoKeApiUtil.searchWuLiao(sf, null, null);
        TaoBaoSearchResult result = TaoKeApiUtil.searchWuLiaoNew(sf, null, null);
        if (result == null)
            return null;
@@ -478,7 +478,7 @@
        }
        // 淘宝物料接口查询
        TaoBaoSearchResult result = TaoKeApiUtil.searchWuLiao(sf, null, null);
        TaoBaoSearchResult result = TaoKeApiUtil.searchWuLiaoNew(sf, null, null);
        List<TaoBaoSearchNav> navList = TaoBaoUtil.getBaseNav();
        if (result.getNavList() != null)
fanli/src/main/java/com/yeshi/fanli/service/impl/push/PushInfoServiceImpl.java
@@ -9,6 +9,8 @@
import javax.annotation.Resource;
import com.yeshi.fanli.entity.SystemEnum;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -40,6 +42,8 @@
    @Resource
    private PushInfoMapper pushInfoMapper;
    private Logger logger = LoggerFactory.getLogger("debugLog");
    @Override
    public void save(PushInfo record) throws PushInfoException, Exception {
@@ -246,6 +250,7 @@
            msg = e.getMsg();
        } catch (Exception e) {
            msg = "系统推送失败";
            logger.error("系统推送失败",e);
        }
        record.setState(state);
        record.setPushTime(new Date());
fanli/src/main/java/com/yeshi/fanli/service/impl/special/S11ServiceImpl.java
@@ -166,7 +166,7 @@
        } catch (Exception e) {
        }
        TaoBaoSearchResult result = TaoKeApiUtil.searchWuLiao(sf,null,null);
        TaoBaoSearchResult result = TaoKeApiUtil.searchWuLiaoNew(sf,null,null);
        if (result != null && result.getTaoBaoGoodsBriefs() != null && result.getTaoBaoGoodsBriefs().size() > 0) {
            try {
                redisManager.cacheCommonString(key, new Gson().toJson(result.getTaoBaoGoodsBriefs()), 60 * 60);// 缓存1小时
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserSystemCouponService.java
@@ -75,7 +75,7 @@
     * @throws UserSystemCouponException
     * @throws Exception
     */
    public void useGoodsCoupon(Long uid, Long id, Long goodId, Integer sourceType) throws UserSystemCouponException, Exception;
    public void useGoodsCoupon(Long uid, Long id, String goodId, Integer sourceType) throws UserSystemCouponException, Exception;
    
    
    /**
fanli/src/main/java/com/yeshi/fanli/service/manger/ClipboardAnalysisManager.java
@@ -447,7 +447,7 @@
            } else {
                SearchFilter sf=new SearchFilter();
                sf.setKey("https://item.taobao.com/item.htm?id="+simpleGoods.getGoodsId());
                TaoBaoSearchResult searchResult = TaoKeApiUtil.searchWuLiao(sf,null,null);
                TaoBaoSearchResult searchResult = TaoKeApiUtil.searchWuLiaoNew(sf,null,null);
                if(searchResult!=null&&searchResult.getTaoBaoGoodsBriefs()!=null&&searchResult.getTaoBaoGoodsBriefs().size()>0){
                    TaoBaoGoodsBrief tempGoods =   searchResult.getTaoBaoGoodsBriefs().get(0);
                    commonGoods = new CommonGoods();
@@ -579,7 +579,7 @@
        }
        // 领券短连接
        if (StringUtil.isNullOrEmpty(jdId) && link.contains("u.jd.com")) {
        if (StringUtil.isNullOrEmpty(jdId) && (link.contains("u.jd.com")||link.contains("//3.cn/"))) {
            jdId = jdGoodsLinkParseManager.parseGoodsIdByJDShortUrl(link);
        }
@@ -728,9 +728,8 @@
    public static void main(String[] args) {
//String originText, String platform, String version
        Set<ClipboardContentType> sets = parseContentType("【淘宝】https://m.tb.cn/h.5bfPu3j?tk=r6fUdGRXH5y CZ0001 「宜恩斯指纹锁家用入户防盗门电子密码锁人脸识别可视智能门锁智选」\n" +
                "点击链接直接打开 或者 淘宝搜索直接打开", "android", "100");
        System.out.println(sets);
        new ClipboardAnalysisManager(). parseJDSkuIdFromLink("https://3.cn/1-U6tjhC");
    }
}
fanli/src/main/java/com/yeshi/fanli/service/manger/goods/ConvertLinkManager.java
@@ -367,4 +367,33 @@
        return dto;
    }
    public static void main(String[] args){
       String newText = "【天猫】双11-预售玩法会场!做任务,赢最高16元红包!\n" +
               "復製本条{淘宝活动:20150318020016625},进入【Ta0宝】立即抢购!";
        // 解析淘宝官方活动ID
        List<String> list = new ConvertLinkManager(). getTaoBaoOfficialActivityId(newText);
        if (list.size() > 0) {
            String relationId = null;
            for (String st : list) {
                String activityid = st.replace("{淘宝活动:", "").replace("}", "");
                if (!StringUtil.isNullOrEmpty(activityid)) {
                    String adzoneId = "mm_124933865_56750082_89555600043".split("_")[3];
                    TaoKeOfficialActivityConvertResultDTO dto = TaoKeApiUtil.officialActivityConvert(adzoneId,
                            activityid, relationId);
                    String link = dto.getShort_click_url();
                    if (StringUtil.isNullOrEmpty(link)) {
                        link = dto.getClick_url();
                    }
                    String token = TaoKeApiUtil.getTKToken("http://", "淘宝官方活动", link, true);
                    newText = newText.replace(st, TaoBaoUtil.filterTaoToken(token));
                }
            }
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/util/VerifyCodeUtil.java
@@ -286,12 +286,8 @@
    }
    public static void main(String[] args) throws IOException {
        File dir = new File("F:/verifies");
        int w = 200, h = 80;
        for (int i = 0; i < 50; i++) {
            String verifyCode = generateVerifyCode(4);
            File file = new File(dir, verifyCode + ".jpg");
            outputImage(w, h, file, verifyCode);
        }
    }
        for(int i=0;i<100;i++) {
            File f = new File("F:/verifies/"+i+".png");
            outputImage(300, 150, f, "long");
        }    }
}
fanli/src/main/java/com/yeshi/fanli/util/goods/GoodsJumpUtil.java
@@ -153,6 +153,7 @@
        } catch (Exception e) {
            e.printStackTrace();
        }
        vo.setJumpLink(link.getZlink());
        return vo;
    }
fanli/src/main/java/com/yeshi/fanli/util/goods/douyin/CSJCPSApiUtil.java
@@ -270,7 +270,7 @@
        //转链类型:1、抖⾳ deep link;2、抖
        //⾳⼆维码;3、抖⾳⼝令。
        //默认返回抖⾳deeplink
        data.put("share_type", "[1,2,3]");
        data.put("share_type", "[1,3,4]");
        String result = baseRequest("/product/link", data);
        System.out.println(result);
        JSONObject resultJson = JSONObject.fromObject(result);
@@ -281,6 +281,7 @@
        DYConvertResult bean = new DYConvertResult();
        bean.setDeeplink(dataJson.optString("dy_deeplink"));
        bean.setPassword(dataJson.optString("dy_password"));
        bean.setZlink(dataJson.optString("dy_zlink"));
        if (dataJson.optJSONObject("dy_qr_code") != null) {
            bean.setQrCode(dataJson.optJSONObject("dy_qr_code").optString("url"));
@@ -386,11 +387,33 @@
    }
    public static JSONObject parseCommand(String command) {
        JSONObject data = new JSONObject();
        data.put("command", command);
        String result = baseRequest("/command_parse", data);
        System.out.println(result);
        JSONObject resultJson = JSONObject.fromObject(result);
        if (resultJson.optInt("code") != 0) {
            return null;
        }
        JSONObject dataJson = resultJson.optJSONObject("data");
        return dataJson;
    }
    public static String parseProductId(String command) {
        JSONObject result = parseCommand(command);
        if (result != null) {
            if (result.optInt("command_type") == 1) {
                return result.optJSONObject("product_info").optString("product_id");
            }
        }
        return null;
    }
    public static void main(String[] args) throws Exception {
        DYGoodsDetail goods = CSJCPSApiUtil.goodsDetail(Long.parseLong("3629012100619309031"));
        DYConvertResult link = CSJCPSApiUtil.goodsConvert(goods.getDetail_url(), DYUtil.createFanLiExtraInfo(437032L),
                "");
        System.out.println(link);
     String id =   parseProductId("https://v.douyin.com/iLQybbqP/");
     System.out.printf(id);
    }
fanli/src/main/java/com/yeshi/fanli/util/goods/douyin/DYUtil.java
@@ -131,35 +131,40 @@
            return null;
        }
        HttpClient client = new HttpClient();
        client.getHttpConnectionManager().getParams().setConnectionTimeout(5000);
        PostMethod pm = new PostMethod(url);
        try {
            client.executeMethod(pm);
            Header header = pm.getResponseHeader("location");
            if (header == null) {
                return null;
            }
            if (header.getValue() == null) {
                return null;
            }
            if (!header.getValue().contains("detail/index.html")) {
                return null;
            }
            String value = URLDecoder.decode(header.getValue(), "UTF-8");
            String[] results = value.split("&");
            for (String r : results) {
                if (!r.contains("product_id=")) {
                    continue;
                }
                return r.split("=")[1].trim();
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
        return null;
        String id = CSJCPSApiUtil.parseProductId(url);
        return id;
//
//        HttpClient client = new HttpClient();
//        client.getHttpConnectionManager().getParams().setConnectionTimeout(5000);
//        PostMethod pm = new PostMethod(url);
//        try {
//            client.executeMethod(pm);
//            Header header = pm.getResponseHeader("location");
//            if (header == null) {
//                return null;
//            }
//            if (header.getValue() == null) {
//                return null;
//            }
//            if (!header.getValue().contains("detail/index.html")) {
//                return null;
//            }
//            String value = URLDecoder.decode(header.getValue(), "UTF-8");
//            value = value.split("\\?")[1];
//            String[] results = value.split("&");
//            for (String r : results) {
//                String key = r.split("=")[0].trim();
//                String val = r.split("=")[1];
//                if (!key.equalsIgnoreCase("product_id") && !key.equalsIgnoreCase("id")) {
//                    continue;
//                }
//                return val.trim();
//            }
//        } catch (IOException e) {
//            e.printStackTrace();
//        }
//
//        return null;
    }
    public static BigDecimal getPrice(int money) {
fanli/src/main/java/com/yeshi/fanli/util/goods/douyin/vo/DYConvertResult.java
@@ -7,10 +7,10 @@
 * @date 2022/9/26 16:56
 */
public class DYConvertResult {
    private String password;
    private String qrCode;
    private String deeplink;
    private String zlink;
    public String getPassword() {
        return password;
@@ -35,4 +35,13 @@
    public void setDeeplink(String deeplink) {
        this.deeplink = deeplink;
    }
    public String getZlink() {
        return zlink;
    }
    public void setZlink(String zlink) {
        this.zlink = zlink;
    }
}
fanli/src/main/java/com/yeshi/fanli/util/jd/JDUtil.java
@@ -222,7 +222,7 @@
    /**
     * 搜索网页
     *
     * @param searchFilter
     * @param skuId
     * @return
     */
    @SuppressWarnings("deprecation")
@@ -450,7 +450,7 @@
    /**
     * 计算商品券后价,没有券则返回原价
     *
     * @param goodsBrief
     * @param jdGoods
     * @return
     */
    public static BigDecimal getCouponPrice(JDGoods jdGoods) {
@@ -532,7 +532,7 @@
    public static boolean isJDLink(String url) {
        return url.startsWith("https://item.m.jd.com/product/") || url.startsWith("http://item.m.jd.com/product/")
                || url.startsWith("https://item.jd.com/") || url.startsWith("http://item.jd.com/")||url.startsWith("https://u.jd.com/");
                || url.startsWith("https://item.jd.com/") || url.startsWith("http://item.jd.com/")||url.startsWith("https://u.jd.com/")||url.startsWith("https://3.cn/");
    }
    /**
@@ -673,6 +673,23 @@
     * @return
     */
    public static String getJDGoodsIdByUJD(String url) {
        if(url.startsWith("https://3.cn/")){
            try {
                Document doc = Jsoup.connect(url).get();
                String location = doc.location();
                if (location.startsWith("https://cfe.m.jd.com/privatedomain/")) {
                    Map<String, String> params = HttpUtil.getPramsFromUrl(location);
                    String returnurl = params.get("returnurl");
                    returnurl = URLDecoder.decode(returnurl, "UTF-8");
                  return parseJDSkuIdByUrl(returnurl);
                } else {
                    return parseJDSkuIdByUrl(location);
                }
            }catch(Exception e){
            }
        }
        try {
            String body = HttpUtil.get(url);
            Document doc = Jsoup.parse(body);
@@ -755,7 +772,7 @@
    /**
     * 查询天猫商品图片、标题
     *
     * @param auctionId
     * @param goodsId
     * @return
     */
    public static JDGoods getSimpleGoodsInfo(String goodsId) {
@@ -953,4 +970,8 @@
        return urlList;
    }
    public static void main(String[] args) throws IOException {
        System.out.printf(getJDGoodsIdByUJD("https://3.cn/1-U6tjhC"));
    }
}
fanli/src/main/java/com/yeshi/fanli/util/push/IOSPushUtil.java
@@ -216,7 +216,7 @@
     */
    public static void executePushIOS(List<String> tokenList, JSONObject json, String pwd) throws Exception {
        InputStream certificate = IOSPushUtil.class.getClassLoader()
                .getResourceAsStream("certificate/pushCertificate.p12"); // 读取.p12文件
                .getResourceAsStream("certificate/push_certification_2025216.p12"); // 读取.p12文件
        String certificatePassword = pwd;
        pushIOS(tokenList, json, certificate, certificatePassword);
    }
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();
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoKeApiUtil.java
@@ -225,7 +225,10 @@
    }
    private static TaoBaoGoodsBrief loadYuShouInfo(TaoBaoGoodsBrief goods, JSONObject item) {
        if (goods != null && item != null) {
            JSONObject preSaleInfo = item.optJSONObject("presale_info");
            if (preSaleInfo != null) {
            // 预售相关解析
            goods.setYsylClickUrl(item.optString("ysyl_click_url"));
            if (!StringUtil.isNullOrEmpty(item.optString("ysyl_commission_rate")))
@@ -235,14 +238,14 @@
            goods.setYsylTljUseEndTime(item.optString("ysyl_tlj_use_end_time"));
            goods.setYsylTljUseStartTime(item.optString("ysyl_tlj_use_start_time"));
            goods.setPresaleDeposit(item.optString("presale_deposit"));
            goods.setPresaleDiscountFeeText(item.optString("presale_discount_fee_text"));
            goods.setPresaleEndTime(item.optString("presale_end_time"));
            goods.setPresaleStartTime(item.optString("presale_start_time"));
            goods.setPresaleTailEndTime(item.optString("presale_tail_end_time"));
            goods.setPresaleTailStartTime(item.optString("presale_tail_start_time"));
                goods.setPresaleDeposit(preSaleInfo.optString("presale_deposit"));
                goods.setPresaleDiscountFeeText(preSaleInfo.optString("presale_discount_fee_text"));
                goods.setPresaleEndTime(preSaleInfo.optString("presale_end_time"));
                goods.setPresaleStartTime(preSaleInfo.optString("presale_start_time"));
                goods.setPresaleTailEndTime(preSaleInfo.optString("presale_tail_end_time"));
                goods.setPresaleTailStartTime(preSaleInfo.optString("presale_tail_start_time"));
            return goods;
            }
        }
        return goods;
    }
@@ -836,6 +839,195 @@
        return taoBaoSearchResult;
    }
    public static TaoBaoSearchResult searchWuLiaoNew(SearchFilter filter, String specialId, String relationId) {
        if (filter.getKey() != null && filter.getKey().trim().equalsIgnoreCase(""))
            return null;
        PageEntity pageEntity = new PageEntity();
        TaoBaoSearchResult taoBaoSearchResult = new TaoBaoSearchResult();
        Map<String, String> map = new HashMap<>();
        map.put("method", "taobao.tbk.dg.material.optional.upgrade");
        map.put("page_size", filter.getPageSize() == 0 ? "20" : filter.getPageSize() + "");
        map.put("page_no", (filter.getPage() <= 0 ? 1 : filter.getPage()) + "");
        //1-动态ID转链场景,2-消费者比价场景(不填默认为1)
//        map.put("biz_scene_id","2");
//        map.put("promotion_type","1");
        if (!StringUtil.isNullOrEmpty(specialId) && !StringUtil.isNullOrEmpty(relationId)) {
            map.put("special_id", specialId);
        } else if (!StringUtil.isNullOrEmpty(specialId)) {
            map.put("special_id", specialId);
        } else if (!StringUtil.isNullOrEmpty(relationId)) {
            map.put("relation_id", relationId);
        }
        // map.put("material_id", "3756");
        pageEntity.setPageIndex(filter.getPage());
        pageEntity.setPageSize(filter.getPageSize() == 0 ? 20 : filter.getPageSize());
        // 包含了地区筛选
        if (filter.getProvinceId() > 0) {
            List<TaoBaoProvince> provinceList = TaoBaoUtil.getTaoBaoProvinceList();
            for (TaoBaoProvince province : provinceList) {
                if (Integer.parseInt(province.getId()) == filter.getProvinceId()) {
                    map.put("itemloc", province.getName());
                    break;
                }
            }
        }
        if (filter.getMaterialId() != null)
            map.put("material_id", filter.getMaterialId());
        if (filter.getStartPrice() != null)
            map.put("start_price", filter.getStartPrice() + "");
        if (filter.getEndPrice() != null)
            map.put("end_price", filter.getEndPrice() + "");
        if (filter.getStartTkRate() > 0)
            map.put("start_tk_rate", filter.getStartTkRate() + "");
        if (filter.getEndTkRate() > 0)
            map.put("end_tk_rate", filter.getEndTkRate() + "");
        if (filter.getStartKaTkRate() > 0)
            map.put("start_ka_tk_rate", filter.getStartKaTkRate() + "");
        if (filter.getEndKaTkRate() > 0)
            map.put("end_ka_tk_rate", filter.getEndKaTkRate() + "");
        if (filter.isTmall())
            map.put("is_tmall", filter.isTmall() + "");
        if (filter.isOverseas())
            map.put("is_overseas", filter.isOverseas() + "");
        if (filter.isBaoYou())
            map.put("need_free_shipment", filter.isBaoYou() + "");
        if (filter.isNeedPrepay())
            map.put("need_prepay", filter.isNeedPrepay() + "");
        if (filter.isIncludePayRate30())
            map.put("include_pay_rate_30", filter.isIncludePayRate30() + "");
        if (filter.isIncludeGoodRate())
            map.put("include_good_rate", filter.isIncludeGoodRate() + "");
        if (filter.isIncludeRfdRate())
            map.put("include_rfd_rate", filter.isIncludeRfdRate() + "");
        if (filter.getStartDsr() > 0)
            map.put("start_dsr", filter.getStartDsr() + "");
        if (filter.getNpxLevel() > 0)
            map.put("npx_level", filter.getNpxLevel() + "");
        if (!StringUtil.isNullOrEmpty(filter.getCateIds()))
            map.put("cat", filter.getCateIds());
        if (!StringUtil.isNullOrEmpty(filter.getKey()))
            map.put("q", filter.getKey());
        if (filter.getQuan() > 0)
            map.put("has_coupon", true + "");
        if (!StringUtil.isNullOrEmpty(filter.getIp()))
            map.put("ip", filter.getIp());
        if (filter.getSort() > 0) {
            if (filter.getSort() == TaoBaoUtil.SORT_SALE_HIGH_TO_LOW) {
                map.put("sort", "total_sales_des"); // 销量从高到低
            } else if (filter.getSort() == TaoBaoUtil.SORT_SALE_LOW_TO_HIGH) {
                map.put("sort", "total_sales_asc"); // 销量从低到高
            } else if (filter.getSort() == TaoBaoUtil.SORT_PRICE_HIGH_TO_LOW) {
                map.put("sort", "price_des"); // 价格从高到低
            } else if (filter.getSort() == TaoBaoUtil.SORT_PRICE_LOW_TO_HIGH) {
                map.put("sort", "price_asc"); // 价格从低到高
            } else if (filter.getSort() == TaoBaoUtil.SORT_TKRATE_HIGH_TO_LOW) {
                map.put("sort", "tk_rate_des"); // 淘客佣金比率高到低
            } else if (filter.getSort() == TaoBaoUtil.SORT_TKRATE_LOW_TO_HIGH) {
                map.put("sort", "tk_rate_asc"); // 淘客佣金比率低到高
            } else if (filter.getSort() == TaoBaoUtil.SORT_TOTAL_COMMI_HIGH_TO_LOW) {
                map.put("sort", "tk_total_commi_des"); // 总支出佣金高到低
            } else if (filter.getSort() == TaoBaoUtil.SORT_TOTAL_COMMI_LOW_TO_HIGH) {
                map.put("sort", "tk_total_commi_asc"); // 总支出佣金低到高
            } else if (filter.getSort() == TaoBaoUtil.SORT_TOTAL_SALES_HIGH_TO_LOW) {
                map.put("sort", "tk_total_sales_des"); // 累计推广量高到低
            } else if (filter.getSort() == TaoBaoUtil.SORT_TOTAL_SALES_LOW_TO_HIGH) {
                map.put("sort", "tk_total_sales_asc"); // 累计推广量低到高
            }
        }
        String resultStr = TaoKeBaseUtil.baseRequestForThreeTimes(map, true);
        System.out.println("resultStr" + resultStr);
        JSONObject data = JSONObject.fromObject(resultStr);
        JSONObject rootData = data.optJSONObject("tbk_dg_material_optional_upgrade_response");
        if ( rootData!= null
                &&rootData.optJSONObject("result_list") != null) {
            JSONArray array = rootData.optJSONObject("result_list")
                    .optJSONArray("map_data");
            List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
            if (array != null) {
                for (int i = 0; i < array.size(); i++) {
                    TaoBaoGoodsBrief goods = parseWuLiaoItemNew(array.optJSONObject(i));
                    if (goods != null)
                        goodsList.add(goods);
                }
            }
            taoBaoSearchResult.setTaoBaoGoodsBriefs(goodsList);
            int totalResults = rootData.getInt("total_results");
            int totalPage = totalResults % pageEntity.getPageSize() == 0 ? totalResults / pageEntity.getPageSize()
                    : totalResults / pageEntity.getPageSize() + 1;
            pageEntity.setTotalCount(totalResults);
            pageEntity.setTotalPage(totalPage);
        }
        List<TaoBaoSearchNav> navList = new ArrayList<>();
        TaoBaoHead taoBaoHead = new TaoBaoHead();
        taoBaoHead.setDocsfound((int) pageEntity.getTotalCount());
        taoBaoSearchResult.setTaoBaoHead(taoBaoHead);
        taoBaoSearchResult.setPageEntity(pageEntity);
        // filter.get
        // 设置发货地址
        TaoBaoSearchNav nav = new TaoBaoSearchNav();
        nav.setName("发货地选择");
        nav.setFlag("address");
        nav.setId(11110);
        nav.setType("fahuodi");
        List<TaoBaoSearchNav> childNavList = new ArrayList<>();
        List<TaoBaoProvince> provinceList = TaoBaoUtil.getTaoBaoProvinceList();
        for (TaoBaoProvince province : provinceList) {
            TaoBaoSearchNav childNav = new TaoBaoSearchNav();
            childNav.setName(province.getName());
            childNav.setId(Integer.parseInt(province.getId()));
            childNav.setType("fahuodi-child");
            if (Integer.parseInt(province.getId()) == filter.getProvinceId())
                childNav.setSelector(1);
            childNavList.add(childNav);
        }
        nav.setSubIds(childNavList);
        navList.add(nav);
        // 测试
        taoBaoSearchResult.setNavList(navList);
        return taoBaoSearchResult;
    }
    /**
     * 商品物料搜索
     *
@@ -1065,6 +1257,109 @@
        goods = loadYuShouInfo(goods, item);
        return goods;
    }
    public static TaoBaoGoodsBrief parseWuLiaoItemNew(JSONObject item) {
        JSONObject basicInfo = item.optJSONObject("item_basic_info");
        JSONObject pricePromotionInfo = item.optJSONObject("price_promotion_info");
        JSONObject publishInfo = item.optJSONObject("publish_info");
        // 线报内容
        JSONObject mgcInfo = item.optJSONObject("mgc_info");
        TaoBaoGoodsBrief goods = new TaoBaoGoodsBrief();
        goods.setPictUrl(basicInfo.optString("pict_url"));
        if (!StringUtil.isNullOrEmpty(basicInfo.optString("white_image"))) {
            goods.setPictUrlWhite(basicInfo.optString("white_image"));
        }
        goods.setAuctionId(item.optString("item_id"));
        goods.setAuctionUrl("https:" + item.optString("url"));
        goods.setBiz30day(basicInfo.optInt("volume"));
        if(pricePromotionInfo.optJSONObject("final_promotion_path_list")!=null&&pricePromotionInfo.optJSONObject("final_promotion_path_list").optJSONArray("final_promotion_path_map_data").size()>0) {
            JSONArray array = pricePromotionInfo.optJSONObject("final_promotion_path_list").optJSONArray("final_promotion_path_map_data");
            JSONObject couponInfo = array.optJSONObject(0);
            goods.setCouponInfo(couponInfo.optString("promotion_desc").replace(".00", ""));
            List<BigDecimal> quanInfo = TaoBaoCouponUtil.getCouponInfo(goods.getCouponInfo());
            goods.setCouponAmount(new BigDecimal(couponInfo.optString("promotion_fee")));
            goods.setCouponEffectiveEndTime(couponInfo.optString("promotion_end_time"));
            goods.setCouponEffectiveStartTime(couponInfo.optString("promotion_start_time"));
            goods.setCouponStartFee(quanInfo.get(0));
            goods.setCouponLeftCount(100);
            goods.setCouponLink(publishInfo.optString("coupon_share_url"));
            goods.setCouponTotalCount(100);
            goods.setCouponActivityId(couponInfo.optString("promotion_id"));
        }else{
            goods.setCouponAmount(new BigDecimal(0));
        }
        goods.setDayLeft(-1);
        if (basicInfo.optJSONObject("small_images") != null) {
            JSONArray imgArray = basicInfo.optJSONObject("small_images").optJSONArray("string");
            if (imgArray != null) {
                List<String> imgList = new ArrayList<>();
                for (int n = 0; n < imgArray.size(); n++) {
                    imgList.add(imgArray.optString(n));
                }
                goods.setImgList(imgList);
            }
        }
        if (publishInfo.optString("commission_type").contains("MKT"))
            goods.setTkMktStatus("1");
        else
            goods.setTkMktStatus("0");
        if (publishInfo.optString("commission_type").contains("SP"))
            goods.setIncludeDxjh(1);
        goods.setSellerId(basicInfo.optLong("seller_id"));
        goods.setShopTitle(basicInfo.optString("shop_title"));
        goods.setTitle(basicInfo.optString("title"));
        goods.setProvcity(basicInfo.optString("provcity"));
        if (!StringUtil.isNullOrEmpty(basicInfo.optString("level_one_category_id"))) {
            goods.setRootCatId(basicInfo.optInt("level_one_category_id"));
        }
        goods.setRootCategoryName(basicInfo.optString("level_one_category_name"));
        if (!StringUtil.isNullOrEmpty(basicInfo.optString("category_id"))) {
            goods.setLeafCatId(basicInfo.optInt("category_id"));
        }
        goods.setLeafName(basicInfo.optString("category_name"));
        goods.setTkRate(new BigDecimal(publishInfo.optString("income_rate")));
        goods.setTotalNum(1000);
        goods.setUserType(basicInfo.optInt("user_type"));
        goods.setUserTypeName("");
        goods.setZkPrice(new BigDecimal(pricePromotionInfo.optString("zk_final_price")));
        if (publishInfo.optJSONArray("sp_campaign_list")!=null&&publishInfo.optJSONArray("sp_campaign_list").size()>0) {
            goods.setDxjhInfo(publishInfo.optJSONArray("sp_campaign_list").optJSONObject(0).optString("sp_name"));
        }
        if (StringUtil.isNullOrEmpty(goods.getCouponInfo())) {// 无券
            goods.setTkCommFee(goods.getZkPrice().multiply(goods.getTkRate()).divide(new BigDecimal(100)));
        } else if (goods.getZkPrice().compareTo(goods.getCouponStartFee()) >= 0// 有券
                && goods.getZkPrice().compareTo(goods.getCouponAmount()) >= 0) {
            BigDecimal finalPrice = goods.getZkPrice().subtract(goods.getCouponAmount());
            goods.setTkCommFee(finalPrice.multiply(goods.getTkRate()).divide(new BigDecimal(100)));
        } else {
            goods.setTkCommFee(new BigDecimal(0));
        }
        if (!StringUtil.isNullOrEmpty(pricePromotionInfo.optString("reserve_price")))
            goods.setReservePrice(new BigDecimal(pricePromotionInfo.optString("reserve_price")));
        goods.setTotalFee(new BigDecimal("0"));
        // 推荐语
        if(mgcInfo!=null) {
            goods.setDescription(mgcInfo.optString("item_description"));
        }
        goods = loadYuShouInfo(goods, item);
        return goods;
    }
    /**
     * 获取淘口令
@@ -2307,9 +2602,9 @@
//        searchWuLiao(sf,null,null);
//        tokenConvert("【淘宝】https://m.tb.cn/h.5YFsc7F?tk=A8wSdGRxsjm CZ0001 「俄罗斯风味迷你提拉米苏蜂蜜奶油千层甜品蛋糕早餐整箱3000克零食」\n" +
//                "点击链接直接打开 或者 淘宝搜索直接打开");
     TaoBaoGoodsBrief goods =  getSimpleGoodsInfo("kNWkWZuYt28BaNcG9ycPtJ-aRG5QXwIdOXvv5bNcNq");
     System.out.println(goods);
//
//     TaoBaoGoodsBrief goods =  getSimpleGoodsInfo("kNWkWZuYt28BaNcG9ycPtJ-aRG5QXwIdOXvv5bNcNq");
//     System.out.println(goods);
//     System.out.println(goods.getAuctionId());
//        Map<String, String> map = new HashMap<>();
//        map.put("method", "taobao.tbk.item.info.get");
@@ -2317,6 +2612,12 @@
//        map.put("num_iids",  "708395859317");
//        String resultStr = TaoKeBaseUtil.baseRequestForThreeTimes(map, true);
//        System.out.println(resultStr);
        SearchFilter sf=new SearchFilter();
        sf.setKey("鞋");
        sf.setPage(1);
        sf.setPageSize(20);
        TaoBaoSearchResult result =  searchWuLiaoNew(sf,null,null);
        System.out.printf(result.toString());
    }
}
fanli/src/main/resource/mapping/user/UserSystemCouponRecordMapper.xml
@@ -4,7 +4,7 @@
<mapper namespace="com.yeshi.fanli.dao.mybatis.user.UserSystemCouponRecordMapper">
  <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.user.UserSystemCouponRecord">
    <id column="ucr_id" property="id" jdbcType="BIGINT"/>
    <result column="ucr_good_id" property="goodId" jdbcType="BIGINT"/>
    <result column="ucr_good_id" property="goodId" jdbcType="VARCHAR"/>
    <result column="ucr_good_source" property="goodSource" jdbcType="VARCHAR"/>
    <result column="ucr_coupon_type" property="couponType" jdbcType="VARCHAR"/>
    <result column="ucr_order_no" property="orderNo" jdbcType="VARCHAR"/>
@@ -21,7 +21,7 @@
    <include refid="Base_Column_List"/>from yeshi_ec_user_system_coupon_record where ucr_id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_user_system_coupon_record where ucr_id = #{id,jdbcType=BIGINT}</delete>
  <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.user.UserSystemCouponRecord" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_system_coupon_record (ucr_id,ucr_good_id,ucr_good_source,ucr_user_coupon_id,ucr_coupon_type,ucr_order_no,ucr_state,ucr_create_time,ucr_update_time) values (#{id,jdbcType=BIGINT},#{goodId,jdbcType=BIGINT},#{goodSource,jdbcType=VARCHAR},#{userSystemCoupon.id,jdbcType=BIGINT},#{couponType,jdbcType=VARCHAR},#{orderNo,jdbcType=VARCHAR},#{state,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert>
  <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.user.UserSystemCouponRecord" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_system_coupon_record (ucr_id,ucr_good_id,ucr_good_source,ucr_user_coupon_id,ucr_coupon_type,ucr_order_no,ucr_state,ucr_create_time,ucr_update_time) values (#{id,jdbcType=BIGINT},#{goodId,jdbcType=VARCHAR},#{goodSource,jdbcType=VARCHAR},#{userSystemCoupon.id,jdbcType=BIGINT},#{couponType,jdbcType=VARCHAR},#{orderNo,jdbcType=VARCHAR},#{state,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert>
  <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.user.UserSystemCouponRecord" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_system_coupon_record
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">ucr_id,</if>
@@ -36,7 +36,7 @@
    </trim>values
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">#{id,jdbcType=BIGINT},</if>
      <if test="goodId != null">#{goodId,jdbcType=BIGINT},</if>
      <if test="goodId != null">#{goodId,jdbcType=VARCHAR},</if>
      <if test="goodSource != null">#{goodSource,jdbcType=VARCHAR},</if>
      <if test="userSystemCoupon != null">#{userSystemCoupon.id,jdbcType=BIGINT},</if>
      <if test="couponType != null">#{couponType,jdbcType=VARCHAR},</if>
@@ -46,10 +46,10 @@
      <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
    </trim>
  </insert>
  <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.user.UserSystemCouponRecord">update yeshi_ec_user_system_coupon_record set ucr_good_id = #{goodId,jdbcType=BIGINT},ucr_good_source = #{goodSource,jdbcType=VARCHAR},ucr_user_coupon_id = #{userSystemCoupon.id,jdbcType=BIGINT},ucr_coupon_type = #{couponType,jdbcType=VARCHAR},ucr_order_no = #{orderNo,jdbcType=VARCHAR},ucr_state = #{state,jdbcType=INTEGER},ucr_create_time = #{createTime,jdbcType=TIMESTAMP},ucr_update_time = #{updateTime,jdbcType=TIMESTAMP} where ucr_id = #{id,jdbcType=BIGINT}</update>
  <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.user.UserSystemCouponRecord">update yeshi_ec_user_system_coupon_record set ucr_good_id = #{goodId,jdbcType=VARCHAR},ucr_good_source = #{goodSource,jdbcType=VARCHAR},ucr_user_coupon_id = #{userSystemCoupon.id,jdbcType=BIGINT},ucr_coupon_type = #{couponType,jdbcType=VARCHAR},ucr_order_no = #{orderNo,jdbcType=VARCHAR},ucr_state = #{state,jdbcType=INTEGER},ucr_create_time = #{createTime,jdbcType=TIMESTAMP},ucr_update_time = #{updateTime,jdbcType=TIMESTAMP} where ucr_id = #{id,jdbcType=BIGINT}</update>
  <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.user.UserSystemCouponRecord">update yeshi_ec_user_system_coupon_record
    <set>
      <if test="goodId != null">ucr_good_id=#{goodId,jdbcType=BIGINT},</if>
      <if test="goodId != null">ucr_good_id=#{goodId,jdbcType=VARCHAR},</if>
      <if test="goodSource != null">ucr_good_source=#{goodSource,jdbcType=VARCHAR},</if>
      <if test="userSystemCoupon != null">ucr_user_coupon_id=#{userSystemCoupon.id,jdbcType=BIGINT},</if>
      <if test="couponType != null">ucr_coupon_type=#{couponType,jdbcType=VARCHAR},</if>
utils/src/main/java/org/yeshi/utils/HttpUtil.java
@@ -46,7 +46,7 @@
import org.yeshi.utils.entity.ProxyIP;
import net.sf.json.JSONObject;
import java.net.HttpURLConnection;
public class HttpUtil {
    public static List<String> getUrlListFromText(String text) {
@@ -657,4 +657,53 @@
        }
        return null;
    }
    public static String getLocation(String url,Map<String,String> headers, String method) {
        HttpClient client = new HttpClient();
        if ("GET".equalsIgnoreCase(method)) {
            try {
                URL uri = new URL(url);
                // 打开连接
                HttpURLConnection connection = (HttpURLConnection) uri.openConnection();
                // 设置HTTP请求方法为GET
                connection.setRequestMethod("GET");
                // 获取响应码
                int responseCode = connection.getResponseCode();
                if (responseCode == HttpURLConnection.HTTP_OK) {
                    // 获取Location字段
                    String location = connection.getHeaderField("Location");
                    System.out.println("Location: " + location);
                } else {
                    System.out.println("Request failed with response code: " + responseCode);
                }
                // 关闭连接
                connection.disconnect();
            }catch(Exception e){
                e.printStackTrace();
            }
            return null;
        } else {
            PostMethod md = new PostMethod(url);
            if (headers != null) {
                Iterator<String> keys = headers.keySet().iterator();
                while (keys.hasNext()) {
                    String key = keys.next();
                    md.addRequestHeader(key, headers.get(key));
                }
            }
            try {
                client.executeMethod(md);
                Header[] responseHeaders = md.getResponseHeaders();
                return md.getResponseHeader("location").getValue();
            } catch (HttpException e) {
                e.printStackTrace();
            } catch (IOException e) {
                e.printStackTrace();
            }
//        }
            return null;
        }
    }
}