| | |
| | |
|
| | | package org.fanli;
|
| | |
|
| | | import java.io.BufferedReader;
|
| | | import java.io.File;
|
| | | import java.io.FileInputStream;
|
| | | import java.io.FileNotFoundException;
|
| | | import java.io.InputStreamReader;
|
| | | import java.math.BigDecimal;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Arrays;
|
| | | import java.util.Date;
|
| | | import java.util.HashMap;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | | import java.util.Scanner;
|
| | |
|
| | | import org.junit.Ignore;
|
| | | import org.junit.Test;
|
| | | import org.yeshi.utils.HttpUtil;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.taobao.TBPidMapper;
|
| | | import com.yeshi.fanli.dto.taobao.TaoLiJinDTO;
|
| | | import com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.taobao.PidUser;
|
| | |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoOrder;
|
| | | import com.yeshi.fanli.entity.taobao.TaoKeAppInfo;
|
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
|
| | | import com.yeshi.fanli.job.UpdateRelationAndSpecialOrderJob;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.goods.ShareGoodsService;
|
| | | import com.yeshi.fanli.service.inter.order.tb.TaoBaoOrderService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoBuyRelationMapService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoOrderService;
|
| | | import com.yeshi.fanli.service.inter.user.TBPidService;
|
| | | import com.yeshi.fanli.service.inter.user.UserExtraTaoBaoInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.tb.UserExtraTaoBaoInfoService;
|
| | | import com.yeshi.fanli.service.manger.goods.ConvertLinkManager;
|
| | | import com.yeshi.fanli.util.BeanUtil;
|
| | | import com.yeshi.fanli.util.SpringContext;
|
| | | import com.yeshi.fanli.util.FileUtil;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TaoBaoConstant;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoOrderUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeOrderApiUtil;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import net.sf.json.JSONObject;
|
| | |
| | |
|
| | | @Test
|
| | | public void test1() {
|
| | | UpdateRelationAndSpecialOrderJob updateRelationAndSpecialOrderJob= BeanUtil.getBean(UpdateRelationAndSpecialOrderJob.class);
|
| | | SpringContext.initCOS();
|
| | | updateRelationAndSpecialOrderJob.doJob2();
|
| | | // List<TaoBaoGoodsBrief> list=
|
| | | // TaoKeApiUtil.guessLikeByAuctionId(550439753563L,6);
|
| | | // System.out.println(list);
|
| | | // TaoBaoUtil.getTBDetailImageWithSize(597016140493L);
|
| | | // System.out.println(goods);
|
| | | // DaTaoKeApiUtil.getGoodsDetailByGoodsId(558195316187L);
|
| | | // try {
|
| | | // TaoKeApiUtil.specialConvertCoupon(608512721647L, new
|
| | | // TaoKeAppInfo(TaoBaoConstant.TAOBAO_AUTH_APPKEY,
|
| | | // TaoBaoConstant.TAOBAO_AUTH_APPSECRET,
|
| | | // TaoBaoConstant.TAOBAO_SPECIAL_PID_DEFAULT));
|
| | | // } catch (Exception e) {
|
| | | // // TODO Auto-generated catch block
|
| | | // e.printStackTrace();
|
| | | // }
|
| | |
|
| | | // String link = TaoKeApiUtil.officialActivityConvert(87140050199L + "",
|
| | | // "1571715733668", "513796574");
|
| | | // System.out.println(link);
|
| | |
|
| | | // String link =
|
| | | // TaoBaoUtil.getTaoBaoUnionAuthUrl(TaoBaoConstant.TAOBAO_AUTH_APPKEY,
|
| | | // "http://api.flqapp.com/fanli/client/v1/auth/callback/tb", 6396582L,
|
| | | // "share");
|
| | | // System.out.println(link);
|
| | |
|
| | | // try {
|
| | | // TaoKeApiUtil.searchGoodsDetail(608512721647L);
|
| | | // } catch (TaobaoGoodsDownException e) {
|
| | | // e.printStackTrace();
|
| | | // }
|
| | |
|
| | | List<TaoBaoOrder> list = TaoKeOrderApiUtil.getTaoBaoRelationOrderList(
|
| | | TimeUtil.convertToTimeTemp("2019-12-09 10:13:52", "yyyy-MM-dd HH:mm:ss"),
|
| | | TimeUtil.convertToTimeTemp("2019-12-09 10:14:53", "yyyy-MM-dd HH:mm:ss"), 1);
|
| | | System.out.println(list);
|
| | | }
|
| | |
|
| | | @Test
|
| | | public void test2() {
|
| | | TaoKeAppInfo app = new TaoKeAppInfo();
|
| | | app.setAdzoneId("44841750025");
|
| | | app.setAppKey("25070111");
|
| | | app.setAppSecret("c7809ad9cd926fc45199d1d3ab7fe2eb");
|
| | | app.setPid("mm_124933865_113050446_44841750025");
|
| | | // String result = TaoKeApiUtil.officialActivityConvert("19507100253",
|
| | | // "1584519810786", "20211660");
|
| | | // System.out.println(result);
|
| | |
|
| | | // TaoKeApiUtil.getQuanInfo(579875678934L,
|
| | | // "91b8984019e24fe1b1e3d6bd15479785");
|
| | | String result = TaoKeApiUtil.getActivityInfo("1583739244161", TaoBaoConstant.TAOBAO_RELATION_PID_DEFAULT,
|
| | | "511374878");
|
| | | System.out.println(result);
|
| | |
|
| | | String token = TaoKeApiUtil.getTKToken("http://", "口碑外卖红包", result);
|
| | | |
| | | System.out.println(token);
|
| | | }
|
| | |
|
| | | @Test
|
| | | public void test3() {
|
| | | Long auctionId = 598165623087L;
|
| | | String appKey = "27965236";
|
| | | String appSecret = "2be7a216bee767dc3a6388aa24f11140";
|
| | | String pid = "mm_502940004_754900291_109486750166";
|
| | | TaoKeAppInfo app = new TaoKeAppInfo(appKey, appSecret, pid);
|
| | |
|
| | | try {
|
| | | TaoBaoGoodsBrief goods = TaoKeApiUtil.searchGoodsDetail(527893773636L, app);
|
| | | System.out.println(goods.getId());
|
| | | } catch (TaobaoGoodsDownException e) {
|
| | | TaoLiJinDTO dto = TaoKeApiUtil.createTaoLiJin(auctionId, "淘礼金", new BigDecimal(1), 1, new Date(),
|
| | | new Date(System.currentTimeMillis() + 1000 * 60 * 60 * 12L), new Date(),
|
| | | new Date(System.currentTimeMillis() + 1000 * 60 * 60 * 12L), app);
|
| | | System.out.println(dto);
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | @Test
|
| | | public void test3() {
|
| | | // try {
|
| | | // EmergencyUtil.baoJin("monitor-error-tb-app-limit-24980167",
|
| | | // "淘宝APPKey请求限制【24980167】", new String[] { "18581318252" });
|
| | | // } catch (Exception e1) {
|
| | | //
|
| | | // }
|
| | | // 0K6TBHS%2F84vpYy%2FzKPWwH6J7%2BkHL3AEW
|
| | | // 2PlyMHAEtzjJX3K6R73L5KJ7%2BkHL3AEW
|
| | | Long[] auctionIds = new Long[] { 528561708277L, 563689377074L, 570752677800L, 569281626446L, 567165767332L,
|
| | | 555437572417L, 534857332052L, 565233575889L, 565536124572L };
|
| | |
|
| | | for (Long auctionId : auctionIds)
|
| | | TaoKeApiUtil.createTaoLiJin(auctionId, "返利券新人淘礼金红包", new BigDecimal("1.00"), 1, 1, new Date(),
|
| | | new Date(System.currentTimeMillis() + 1000 * 60 * 60 * 24L), new Date());
|
| | | // TaoKeApiUtil.getLiJinXG();
|
| | | // String
|
| | | // url="https://uland.taobao.com/taolijin/edetail?eh=aIrBfHZGd4iZuQF0XRz0iAXoB+DaBK5LQS0Flu/fbSp4QsdWMikAalrisGmre1Id0BFAqRODu114yl7QZ1qFyc7LbOC0oAuo+MUwzxYlSKECGml30RY8PBx5jSVkulpmRQIlrKaDNziGVmobyGguP+jgTFwOoHsRe9593cvcC9QGQASttHIRqdGO5qxVOPQ2buEoHk5wx6hxhsv5QYr1rbcOQrCzclRfPTIk7Z0myMWxZvcNeMU+E+L71lQF+6uZp7DLcYmoygrjfjYOW9fVleIg09jheaZgonv6QcvcARY=&union_lens=lensId:0b0b4505_0c2a_16af789993f_0880;traffic_flag=lm";
|
| | | // String token=
|
| | | // TaoKeApiUtil.getTKToken("https://img.alicdn.com/imgextra/i4/2256112408/O1CN01EKNifJ1TeuF9x4it9_!!2256112408.jpg_400x400.jpg",
|
| | | // "旗睿电风扇台式家用12寸16寸静音学生宿舍摇头定时节能台扇落地扇", url);
|
| | | // System.out.println(token);
|
| | | }
|
| | |
|
| | | @Test
|
| | | public void test4() {
|
| | |
|
| | | TaoBaoOrderService taoBaoOrderService = BeanUtil.getBean(TaoBaoOrderService.class);
|
| | | try {
|
| | | List<TaoBaoOrder> list = TaoBaoOrderUtil.parseOrder(
|
| | |
| | |
|
| | | @Test
|
| | | public void test6() {
|
| | | String token = TaoKeApiUtil.getTKToken(
|
| | | "https://img.alicdn.com/bao/uploaded/i4/1951405497/O1CN01pSRKwW1qTfhFOL6ID_!!0-item_pic.jpg",
|
| | | "进门门垫卧室地毯厨房脚垫卫浴室防滑垫子家用门口卫生间吸水地垫",
|
| | | "https://uland.taobao.com/coupon/edetail?e=ALb9e%2B%2F%2BWuEGQASttHIRqWG9PQkvBWgpe2xKTDmY89k3iJ6QLtrZTaw1YqztnqtTrnLz2cLaP4IorCkhghE4lRktOfsF9p14gPp7zT6kOnRnXdWpB0IN0xemP0hpIIPvjDppvlX%2Bob8NlNJBuapvQ2MDg9t1zp0R8pjV3C9qcwTlnMqBDl4yuer2wO%2Fohke1&traceId=0b83456615579010794213275ee3b8&union_lens=lensId:0b1832c2_0bdc_16aba23f39d_07b3&xId=hu3LxjUFR7nb3uT9e97Uy74tDuNpUuisuzrh7K8WAro72oLHXY1N6hSpx7bzQWpJ3rMAKcQf6fA0iBNYmL0GOA");
|
| | | System.out.println(token);
|
| | | String text = "[玫瑰]各位亲友好,记得领券哦[愉快]" + "【京东1月3日领券精选】\n" + "[红包]抢红包 最高888\n" + "https://u.jd.com/8xeCfl\n"
|
| | | + "🚅火车票神券50元\n" + "https://u.jd.com/cMReZz\n" + "🌟居家好物9.9包邮\n" + "https://u.jd.com/AG2z4A\n"
|
| | | + "👔男装3件7折\n" + "https://u.jd.com/kgMslr\n" + "👗女装清仓5折起\n" + "https://u.jd.com/kgMslr\n" + "🛍有礼有年货\n"
|
| | | + "https://u.jd.com/qdvIiG\n" + "💋SK-II大促\n" + "https://u.jd.com/7XybkD\n" + "💰超级百亿补贴\n"
|
| | | + "https://u.jd.com/qVFjDL\n" + "🍼母婴券年货节\n" + "https://u.jd.com/kA0scy\n" + "🛍超市满199-100\n"
|
| | | + "https://u.jd.com/eQSwNn\n" + "[發]内购券大全\n" + "https://u.jd.com/zIHmUy\n" + "[福]Plus全品券\n"
|
| | | + "https://u.jd.com/d9fcGr\n" + "⚡京东秒杀\n" + "https://u.jd.com/WSIi1z\n" + "【记得与更多好友分享[愉快]】";
|
| | | ConvertLinkManager convertLinkManager = BeanUtil.getBean(ConvertLinkManager.class);
|
| | | try {
|
| | | System.out.println(convertLinkManager.convertLinkFromText(text, 437032L, true));
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | @Test
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @Test
|
| | | public void test12() {
|
| | |
|
| | | try {
|
| | |
|
| | | BufferedReader br = new BufferedReader(new InputStreamReader(
|
| | | new FileInputStream(new File("C:/Users/Administrator/Desktop/新建文本文档 (2).txt"))));
|
| | | String text = "";
|
| | | String lineTxt = null;
|
| | | while ((lineTxt = br.readLine()) != null) {// 数据以逗号分隔
|
| | | text += new String(lineTxt.getBytes("unicode"), "UTF-8");
|
| | | }
|
| | | System.out.println(text);
|
| | | br.close();
|
| | | } catch (Exception e) {
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | @Test
|
| | | 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) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | @Test
|
| | | public void test14() {
|
| | | TaoKeApiUtil.getCouponListByItemId(614089154947L);
|
| | | }
|
| | |
|
| | | }
|