admin
2019-07-23 496c2842240eae09bb56e98e1fae71540a85befa
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
package com.yeshi.fanli.util.taobao;
 
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.math.BigDecimal;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
 
import javax.script.Invocable;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
 
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
 
import com.yeshi.fanli.dto.dataoke.DingDongQiangDTO;
import com.yeshi.fanli.entity.bus.clazz.GoodsClass;
import com.yeshi.fanli.entity.taobao.TaoBaoCoupon;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
import com.yeshi.fanli.entity.taobao.TaoBaoHead;
import com.yeshi.fanli.entity.taobao.TaoBaoSearchResult;
import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetail;
import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetailV2;
import com.yeshi.fanli.tag.PageEntity;
import com.yeshi.fanli.util.MoneyBigDecimalUtil;
import com.yeshi.fanli.util.StringUtil;
 
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
 
/**
 * 大淘客api接口
 * 
 * @author Administrator
 *
 */
public class DaTaoKeUtil {
 
    static final String[] commonEmojis = new String[] { "😀", // 笑嘻嘻
            "😁", // 笑嘻嘻的脸,含笑的眼睛
            "😃", // 开口笑脸
            "😄", // 开口笑脸和微笑的眼睛
            "😆", // 开口笑紧闭的眼睛
            "😉", // 眨眼表情
            "😊", // 面带微笑的眼睛
            "😋", // 品尝美味食物表情
            "😎", // 太阳镜笑脸
            "😍", // 面带心形眼睛
            "😘", // 飞吻表情
            "😗", // 亲吻表情
            "😙", // 含笑亲吻表情
            "😚", // 闭眼亲吻表情
            "☺", // 笑脸
            "😇", // 光环笑脸
            "😐", // 中性面
            "😏", // 傻笑
            "😮", // 张着嘴
            "😛", // 吐舌头
            "😜", // 吐舌头,眨眼眼
            "😝", // 闭眼吐舌头
            "👅", // 舌头
            "👄", // 口
            "👀", // 眼睛
            "❤", // 心
            "💓", // 跳动的心
            "💕", // 两颗心
            "💗", // 成长的心
            "💝", // 扎丝带的心形礼盒
            "💞", // 旋转心
            "💐", // 花束
            "🌸", // 樱花
            "🌹", // 玫瑰
            "🌺", // 槿
            "🌻", // 向日葵
            "🌼", // 开花
            "🌷", // 郁金香
            "🍇", // 葡萄
            "🍈", // 瓜
            "🍉", // 西瓜
            "🍊", // 柑橘
            "🍋", // 柠檬
            "🍌", // 香蕉
            "🍍", // 菠萝
            "🍎", // 红苹果
            "🍏", // 青苹果
            "🍐", // 梨
            "🍑", // 桃子
            "🍒", // 樱桃
            "🍓", // 草莓
            "🌿", // 枝叶
            "🍀", // 四叶草
            "🍁", // 枫叶
            "🍂", // 落叶
            "🍃", // 叶子在风中飘落
            "☘", // 三叶草(酢浆草)
            "☀", // 太阳光芒四射
            "🌞", // 太阳人脸
            "⭐", // 星星,五角星
            "🌟",// 发光的星星
    };
 
    static final String[] timeEmojis = new String[] { "🕛", // 十二点
            "🕧", // 十二点半
            "🕐", // 一点钟
            "🕜", // 一点半
            "🕑", // 两点
            "🕝", // 两点半
            "🕒", // 三点钟
            "🕞", // 三点半
            "🕓", // 四点钟
            "🕟", // 四点半
            "🕔", // 五时
            "🕠", // 五点半
            "🕕", // 六点
            "🕡", // 六点半
            "🕖", // 七点
            "🕢", // 七点半
            "🕗", // 八点
            "🕣", // 八点半
            "🕘", // 九点钟
            "🕤", // 九点半
            "🕙", // 的十点
            "🕥", // 十点半
            "🕚", // 十一点
            "🕦",// 十一点半
    };
 
    public static List<GoodsClass> goodsClasses;
    static {
        goodsClasses = new ArrayList<>();
        goodsClasses.add(new GoodsClass(4L, "居家日用"));
        goodsClasses.add(new GoodsClass(6L, "美食"));
        goodsClasses.add(new GoodsClass(2L, "母婴"));
        goodsClasses.add(new GoodsClass(3L, "美妆"));
        goodsClasses.add(new GoodsClass(1L, "女装"));
        goodsClasses.add(new GoodsClass(8L, "数码家电"));
        goodsClasses.add(new GoodsClass(7L, "文娱车品"));
        goodsClasses.add(new GoodsClass(10L, "内衣"));
        goodsClasses.add(new GoodsClass(14L, "家装家纺"));
        goodsClasses.add(new GoodsClass(5L, "鞋品"));
        goodsClasses.add(new GoodsClass(9L, "男装"));
        goodsClasses.add(new GoodsClass(12L, "配饰"));
        goodsClasses.add(new GoodsClass(13L, "户外运动"));
        goodsClasses.add(new GoodsClass(11L, "箱包"));
    }
 
    public static final String HOST = "http://dataoke.yeshitv.com";
 
    public static void search(String key) {
        String header = "Mozilla/5.0 (Linux; Android 6.0; M5 Note Build/MRA58K; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/53.0.2785.49 Mobile MQQBrowser/6.2 TBS/043024 Safari/537.36 MicroMessenger/6.5.4.1000 NetType/WIFI Language/zh_CN";
        try {
            String searchUrl = String.format("http://dataoke.yeshitv.com/index.php?r=%s&kw=%s",
                    URLEncoder.encode("index/search", "UTF-8"));
            Document root = Jsoup.connect(searchUrl).header("User-Agent", header).timeout(60000).get();
            Elements items = root.getElementsByAttributeValue("class", "goods-list").get(0)
                    .getElementsByAttributeValue("class", "goods-item");
            if (items.size() > 0) {
                String code = getTKL(HOST + items.get(0).getElementsByTag("a").attr("href"));
                int count = 1;
                while (com.yeshi.fanli.util.StringUtil.isNullOrEmpty(code) && count < items.size() && count < 5) {
                    code = getTKL(HOST + items.get(count).getElementsByTag("a").attr("href"));
                    count++;
                }
            }
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
 
    // 获取淘口�?
    public static String getTKL(String url) {
        String header = "Mozilla/5.0 (Linux; Android 6.0; M5 Note Build/MRA58K; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/53.0.2785.49 Mobile MQQBrowser/6.2 TBS/043024 Safari/537.36 MicroMessenger/6.5.4.1000 NetType/WIFI Language/zh_CN";
        try {
            Document root = Jsoup.connect(url).header("User-Agent", header).timeout(60000).get();
            return root.getElementsByAttributeValue("class", "tuwen-tkl").get(0)
                    .getElementsByAttributeValue("class", "tkl").get(0).getElementById("code1_ios").text().trim();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
 
    public static List<GoodsClass> getGoodsType() {
        List<GoodsClass> list = new ArrayList<>();
        String[] names = new String[] { "女装", "男装", "内衣", "母婴", "化妆品", "居家", "鞋包配饰", "美食", "文体车品", "数码家电" };
        int[] ids = new int[] { 1, 9, 10, 2, 3, 4, 5, 6, 7, 8 };
        for (int i = 0; i < names.length; i++) {
            GoodsClass gc = new GoodsClass();
            gc.setId(Long.parseLong(ids[i] + ""));
            gc.setName(names[i]);
            list.add(gc);
        }
        return list;
    }
 
    public static TaoBaoSearchResult getGoodsByType(int type) {
        TaoBaoSearchResult result = new TaoBaoSearchResult();
        result.setNavList(null);
        List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
        JSONArray array = getGoods("http://dataoke.yeshitv.com/index.php?r=index/cat&cid=" + type);
        for (int i = 0; i < array.size(); i++) {
            JSONObject data = array.optJSONObject(i);
            TaoBaoGoodsBrief goods = new TaoBaoGoodsBrief();
            goods.setAuctionId(data.optLong("url"));
            goods.setBiz30day(data.optInt("nums"));
            goods.setPictUrl(data.optString("img").split(".jpg")[0] + ".jpg");
            goods.setCouponAmount(new BigDecimal(data.optString("quan")));
            goods.setZkPrice(new BigDecimal(data.optString("beforPrice")));
            goods.setCouponStartFee(new BigDecimal(0));
            goods.setTitle(data.optString("title"));
            goods.setTkCommFee(new BigDecimal(0));
            goods.setTkRate(new BigDecimal(0));
            goodsList.add(goods);
        }
        PageEntity pe = new PageEntity(1, 20, 1000);
        result.setPageEntity(pe);
        result.setTaoBaoGoodsBriefs(goodsList);
        TaoBaoHead head = new TaoBaoHead();
        head.setDocsfound(1000);
        result.setTaoBaoHead(head);
 
        return result;
    }
 
    public static TaoBaoSearchResult searchByKey(String kw) {
        TaoBaoSearchResult result = new TaoBaoSearchResult();
        result.setNavList(null);
        List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
        JSONArray array = null;
        try {
            array = getGoods("http://dataoke.yeshitv.com/index.php?r=l&kw=" + URLEncoder.encode(kw, "UTF-8"));
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
 
        for (int i = 0; i < array.size(); i++) {
            JSONObject data = array.optJSONObject(i);
            TaoBaoGoodsBrief goods = new TaoBaoGoodsBrief();
            goods.setAuctionId(data.optLong("url"));
            goods.setBiz30day(data.optInt("nums"));
            goods.setPictUrl(data.optString("img").split(".jpg")[0] + ".jpg");
            goods.setCouponAmount(new BigDecimal(data.optString("quan")));
            goods.setZkPrice(new BigDecimal(data.optString("beforPrice")));
            goods.setCouponStartFee(new BigDecimal(0));
            goods.setTitle(data.optString("title"));
            goods.setTkCommFee(new BigDecimal(0));
            goods.setTkRate(new BigDecimal(0));
            goodsList.add(goods);
        }
        PageEntity pe = new PageEntity(1, 20, 1000);
        result.setPageEntity(pe);
        result.setTaoBaoGoodsBriefs(goodsList);
        TaoBaoHead head = new TaoBaoHead();
        head.setDocsfound(1000);
        result.setTaoBaoHead(head);
 
        return result;
    }
 
    public static JSONArray getGoods(String pageUrl) {
        if (pageUrl == null)
            return null;
 
        Document doc = null;
        try {
            doc = Jsoup.connect(pageUrl)
                    .userAgent(
                            "Mozilla/5.0 (iPhone; CPU iPhone OS 10_3 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) CriOS/56.0.2924.75 Mobile/14E5239e Safari/602.1")
                    .get();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        if (null == doc) {
            return null;
        }
 
        Elements elements = doc.getElementsByClass("goods-item");
        JSONArray jsa = new JSONArray();
 
        for (int i = 0; i < elements.size(); i++) {
            JSONObject obj = new JSONObject();
            Element element = elements.get(i);
 
            String img = element.getElementsByAttributeValue("class", "img").get(0).getElementsByTag("img").get(0)
                    .attr("data-original");
            if (StringUtil.isNullOrEmpty(img))
                img = element.getElementsByAttributeValue("class", "img").get(0).getElementsByTag("img").get(0)
                        .attr("src");
            if (img.startsWith("//")) {
                img = "http:" + img;
            }
            String title = element.getElementsByAttributeValue("class", "title").get(0)
                    .getElementsByAttributeValue("class", "text").get(0).text();
            String price = element.getElementsByAttributeValue("class", "price-wrapper").get(0)
                    .getElementsByAttributeValue("class", "price").get(0).text().replace("¥", "");
            String coupon = element.getElementsByClass("img").get(0).getElementsByClass("coupon-wrapper").get(0)
                    .getElementsByTag("b").get(0).text().replace("元", "");
            String afterPrice = price + "";
            String beforePrice = Float.parseFloat(price) + Float.parseFloat(coupon) + "";
            String nums = element.getElementsByAttributeValue("class", "sold-num").get(0).text();
            String[] chars = element.getElementsByAttributeValue("class", "img").get(0).attr("href").split("id=");
            String id = chars[1].split("&u=")[0];
 
            String quanMoney = element.getElementsByClass("coupon-wrapper").get(0).getElementsByTag("b").get(0).text();
 
            obj.put("img", img);
            obj.put("title", title);
            obj.put("afterPrice", afterPrice);
            obj.put("beforPrice", beforePrice);
            obj.put("nums", nums);
            obj.put("url", id);
            obj.put("quan", quanMoney);
            jsa.add(obj);
        }
        return jsa;
    }
 
    public static long getAuctionId(long id) {
        Document doc = null;
        try {
            doc = Jsoup.connect("http://dataoke.yeshitv.com/index.php?r=p/dnew&id=" + id + "&type=0&version=2")
                    .userAgent(
                            "Mozilla/5.0 (iPhone; CPU iPhone OS 10_3 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) CriOS/56.0.2924.75 Mobile/14E5239e Safari/602.1")
                    .get();
        } catch (IOException e) {
            e.printStackTrace();
        }
 
        String href = "";
        Elements as = doc.getElementsByClass("goods_shop_cart").get(0).getElementsByTag("a");
        if (as != null)
            for (int i = 0; i < as.size(); i++) {
                if (as.get(i).attr("href").contains("uland.taobao.com/coupon/edetail")) {
                    href = as.get(i).attr("href");
                    break;
                }
            }
 
        String[] sts = href.split("&");
        for (String st : sts) {
            if (st.contains("itemId="))
                return Long.parseLong(st.replace("itemId=", ""));
        }
        return 0;
    }
 
    public static List<Long> get9K9List(int page) {
 
        String url = "";
 
        Document doc = null;
 
        // for (String st : sts) {
        // if (st.contains("itemId="))
        // return Long.parseLong(st.replace("itemId=", ""));
        // }
        // return 0;
        return null;
    }
 
    /**
     * 大淘客叮咚抢数据
     * 
     * @return
     */
    public static List<DingDongQiangDTO> getDingDongQiang() {
        List<DingDongQiangDTO> list = new ArrayList<>();
        Document doc = null;
        try {
            doc = Jsoup.connect("http://www.dataoke.com/ddq").get();
        } catch (IOException e1) {
            e1.printStackTrace();
        }
        Elements els = doc.getElementsByTag("script");
        for (int i = 0; i < els.size(); i++) {
            String content = els.get(i).html();
            if (content.indexOf("var dataDef") > -1) {
                ScriptEngineManager manager = new ScriptEngineManager();
                ScriptEngine engine = manager.getEngineByName("javascript");
                try {
                    String js = "function getData(){return  JSON.stringify(dataDef);}" + content;
                    engine.eval(js);
                    if (engine instanceof Invocable) {
                        Invocable in = (Invocable) engine;
                        String data = in.invokeFunction("getData").toString();
                        System.out.println(data);
                        JSONObject dataJson = JSONObject.fromObject(data);
                        for (Iterator<String> its = dataJson.keys(); its.hasNext();) {
                            String key = its.next();
                            JSONArray array = dataJson.optJSONArray(key);
                            List<DaTaoKeDetail> detailList = new ArrayList<>();
                            for (int n = 0; n < array.size(); n++) {
                                detailList.add(new DaTaoKeDetail(array.optJSONObject(n).optLong("id")));
                            }
                            list.add(new DingDongQiangDTO(key, detailList));
                        }
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }
        return list;
    }
 
    public static List<TaoBaoCoupon> getRecommendCouple() {
        List<TaoBaoCoupon> couponList = new ArrayList<>();
 
        TaoBaoSearchResult result = new TaoBaoSearchResult();
        result.setNavList(null);
        JSONArray array = getGoods("http://dataoke.yeshitv.com/index.php?r=index/wap&u=487704");
        for (int i = 0; i < array.size(); i++) {
            JSONObject data = array.optJSONObject(i);
            TaoBaoCoupon coupon = new TaoBaoCoupon();
            coupon.setAuctionId(data.optString("url"));
            coupon.setAuctionUrl("");
            coupon.setCouponAmount(new BigDecimal(data.optString("quan")));
            coupon.setCouponCount(data.optInt("nums"));
            coupon.setCouponinfo("");
            coupon.setHongbao(new BigDecimal(0));
            coupon.setPictUrl(data.optString("img").split(".jpg")[0] + ".jpg");
            coupon.setTitle(data.optString("title"));
            coupon.setZkPrice(new BigDecimal(data.optString("beforPrice")));
            coupon.setCouponStartFee(new BigDecimal(0));
            coupon.setQuanPrice(new BigDecimal(data.optString("afterPrice")));
            couponList.add(coupon);
        }
 
        return couponList;
    }
 
    private static List<DaTaoKeDetail> parseCurrent(String url) {
 
        List<DaTaoKeDetail> list = new ArrayList<>();
        try {
            Document doc = Jsoup.connect(url)
                    .userAgent(
                            "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36")
                    .get();
            Elements items = doc.getElementsByClass("goods-list").get(0).getElementsByClass("goods-item");
            for (int i = 0; i < items.size(); i++) {
                Long id = Long.parseLong(items.get(i).attr("id").replace("goods-items_", ""));
                String currentSale = items.get(i).getElementsByClass("goods-item-content").get(0)
                        .getElementsByClass("goods-info").get(0).getElementsByClass("tg-show").get(0)
                        .getElementsByTag("b").get(0).text();
 
                System.out.println(id + "-" + currentSale);
                DaTaoKeDetail detail = new DaTaoKeDetail();
                detail.setId(id);
                detail.setSalesNum(Integer.parseInt(currentSale));
                list.add(detail);
 
            }
 
        } catch (IOException e) {
            e.printStackTrace();
        }
 
        // TODO 需要返回值
        return list;
    }
 
    // 获取实时榜单
    /**
     * 获取实时销量榜
     * 
     * @param cid
     * @return
     */
    public static List<DaTaoKeDetail> getCurrentSalesRank(Integer cid) {
        String url = null;
        if (cid == null)
            url = "http://www.dataoke.com/top_sell";
        else
            url = String.format("http://www.dataoke.com/top_sell?cid=%s&type=1", cid);
        return parseCurrent(url);
    }
 
    /**
     * 全天销量榜
     * 
     * @param cid
     * @return
     */
    public static List<DaTaoKeDetail> getCurrentDaySalesRank(Integer cid) {
        String url = null;
        if (cid == null)
            url = "http://www.dataoke.com/top_all";
        else
            url = String.format("http://www.dataoke.com/top_all?cid=%s", cid);
        return parseCurrent(url);
    }
 
    /**
     * 获取热推榜
     * 
     * @param cid
     * @return
     */
    public static List<DaTaoKeDetail> getCurrentHotSalesRank() {
        String url = "http://www.dataoke.com/top_tui";
        return parseCurrent(url);
    }
 
    private static String getRandomCommonEmoji() {
        return commonEmojis[(int) (Math.random() * commonEmojis.length)];
    }
 
    public static String getDesc(DaTaoKeDetail detail) {
 
        // 标题+券后价+包邮+描述
        String desc = detail.getdTitle();
        desc += "\n";
        desc += String.format("券后价%s【%s元】包邮秒杀 ", Math.random() > 0.5 ? "💰" : "",
                MoneyBigDecimalUtil.getWithNoZera(detail.getPrice()).toString())
                + (Math.random() > 0.5 ? getRandomCommonEmoji() : "");
        desc += "\n";
        // desc += detail.getIntroduce();
        String introduce = detail.getIntroduce().replace(",", ",").replace("。", ",").replace("!", ",").replace(",",
                ",");
        introduce = introduce.replace(",,,", ",").replace(",,", ",");
 
        String[] sts = introduce.split(",");
        introduce = "";
        for (int i = 0; i < sts.length; i++) {
            if (i % 2 == 1) {// 需要换行
                introduce += sts[i] + (Math.random() > 0.5 ? getRandomCommonEmoji() : i == sts.length - 1 ? "" : ",")
                        + "\n";
            } else
                introduce += sts[i] + (Math.random() > 0.5 ? getRandomCommonEmoji() : i == sts.length - 1 ? "" : ",");
        }
        desc += introduce;
        return desc;
    }
 
    public static TaoBaoGoodsBrief filterTaoBaoGoods(TaoBaoGoodsBrief goods, DaTaoKeDetail detail) {
        if (detail != null && goods != null) {
            // 重新设置标题与券价格
            goods.setTitle(detail.getdTitle());
            if (!StringUtil.isNullOrEmpty(detail.getPic()))
                goods.setPictUrlWhite(detail.getPic());
        }
        return goods;
    }
 
    public static TaoBaoGoodsBrief filterTaoBaoGoods(TaoBaoGoodsBrief goods, DaTaoKeDetailV2 detail) {
        if (detail != null && goods != null) {
            // 重新设置标题与券价格
            goods.setTitle(detail.getDtitle());
            if (!StringUtil.isNullOrEmpty(detail.getMainPic()))
                goods.setPictUrlWhite(detail.getMainPic());
        }
        return goods;
    }
 
}