admin
2019-07-19 ca856b5520666be490c9a738e117712e2fe39208
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
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
package com.yeshi.fanli.service.impl.goods;
 
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
 
import javax.annotation.Resource;
 
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
 
import com.yeshi.fanli.dto.common.CommonContentNav;
import com.yeshi.fanli.dto.common.CommonContentResult;
import com.yeshi.fanli.dto.common.CommonContentTypeEnum;
import com.yeshi.fanli.dto.dataoke.DaTaoKeGoodsResult;
import com.yeshi.fanli.entity.bus.clazz.GoodsClass;
import com.yeshi.fanli.entity.bus.lable.QualityFactory;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
import com.yeshi.fanli.entity.taobao.TaobaoMeterial;
import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetailV2;
import com.yeshi.fanli.service.inter.goods.CommonTemplateContentService;
import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
import com.yeshi.fanli.service.inter.lable.QualityGoodsService;
import com.yeshi.fanli.service.inter.lable.TaoKeGoodsService;
import com.yeshi.fanli.service.inter.taobao.TaobaoMeterialService;
import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.dataoke.DaTaoKeApiUtil;
import com.yeshi.fanli.util.taobao.DaTaoKeUtil;
import com.yeshi.fanli.util.taobao.TaoBaoUtil;
 
@Service
public class CommonTemplateContentServiceImpl implements CommonTemplateContentService {
 
    @Resource
    private DaTaoKeGoodsDetailService daTaoKeGoodsDetailService;
 
    @Resource
    private TaobaoMeterialService taobaoMeterialService;
 
    @Resource
    private TaoKeGoodsService taoKeGoodsService;
 
    @Resource
    private HongBaoManageService hongBaoManageService;
 
    @Resource
    private QualityGoodsService qualityGoodsService;
 
    private static List<CommonContentNav> getCommonNav() {
        List<CommonContentNav> navList = new ArrayList<>();
        navList.add(new CommonContentNav("1", "综合"));
        navList.add(new CommonContentNav("2", "最新"));
        navList.add(new CommonContentNav("3", "热卖"));
        navList.add(new CommonContentNav("4", "销量"));
        navList.add(new CommonContentNav("5", "返利比"));
        return navList;
    }
 
    private static int getCommonSort(String cid) {
        int sort = DaTaoKeApiUtil.SORT_DEFAULT;
        if ("1".equalsIgnoreCase(cid))
            sort = DaTaoKeApiUtil.SORT_DEFAULT;
        else if ("2".equalsIgnoreCase(cid))
            sort = DaTaoKeApiUtil.SORT_CREATETIME;
        else if ("3".equalsIgnoreCase(cid))
            sort = DaTaoKeApiUtil.SORT_COUPON_NUM;
        else if ("4".equalsIgnoreCase(cid))
            sort = DaTaoKeApiUtil.SORT_SALES;
        else if ("5".equalsIgnoreCase(cid))
            sort = DaTaoKeApiUtil.SORT_COMMISSION;
 
        return sort;
    }
 
    @Override
    public List<CommonContentNav> getNavList(CommonContentTypeEnum type) {
        List<CommonContentNav> navList = new ArrayList<>();
        if (type == CommonContentTypeEnum._9k9) {
            navList.add(new CommonContentNav("-1", "综合"));
            navList.add(new CommonContentNav("0", "最新"));
            for (GoodsClass gc : DaTaoKeUtil.goodsClasses) {
                navList.add(new CommonContentNav(gc.getId() + "", gc.getName()));
            }
        } else if (type == CommonContentTypeEnum.chaoSheng) {
            navList.add(new CommonContentNav("1", "1-5元返利"));
            navList.add(new CommonContentNav("2", "5-10元返利 "));
            navList.add(new CommonContentNav("3", "10-15元返利"));
            navList.add(new CommonContentNav("4", "15-20元返利"));
            navList.add(new CommonContentNav("5", "20元以上返利"));
        } else if (type == CommonContentTypeEnum.haoQuan) {
            navList.add(new CommonContentNav("1", "1-5元券"));
            navList.add(new CommonContentNav("2", "5-10元券"));
            navList.add(new CommonContentNav("3", "10-20元券"));
            navList.add(new CommonContentNav("4", "20-30元券"));
            navList.add(new CommonContentNav("5", "30-50元券"));
            navList.add(new CommonContentNav("6", "50元以上券"));
        } else if (type == CommonContentTypeEnum.juJia) {
            navList = getCommonNav();
        } else if (type == CommonContentTypeEnum.meiShi) {
            navList = getCommonNav();
        } else if (type == CommonContentTypeEnum.muYin) {
            navList.add(new CommonContentNav("1", "精选"));
            navList.add(new CommonContentNav("备孕", "备孕"));
            navList.add(new CommonContentNav("0至6个月", "0~6月"));
            navList.add(new CommonContentNav("7至12个月", "7~12月"));
            navList.add(new CommonContentNav("1至3岁", "1~3岁"));
            navList.add(new CommonContentNav("4至6岁", "4~6岁"));
            navList.add(new CommonContentNav("7至12岁", "7~12岁"));
        } else if (type == CommonContentTypeEnum.reMai) {
            navList = getCommonNav();
        } else if (type == CommonContentTypeEnum.chuanYiDaPei) {
            navList = getCommonNav();
        } else if (type == CommonContentTypeEnum.meiZhuangGehu) {
            navList = getCommonNav();
        } else if (type == CommonContentTypeEnum.jingPinXieBao) {
            navList = getCommonNav();
        } else if (type == CommonContentTypeEnum.chaoNanReMai) {
            navList = getCommonNav();
        } else if (type == CommonContentTypeEnum.shuMaShouJi) {
            navList = getCommonNav();
        } else if (type == CommonContentTypeEnum.yunDongKuXie) {
            navList = getCommonNav();
        } else if (type == CommonContentTypeEnum.qiCheHuWai) {
            navList = getCommonNav();
        } else if (type == CommonContentTypeEnum.chaoPinReMai) {
            navList = getCommonNav();
        }
 
        return navList;
    }
 
    @Cacheable(value = "commonContentCache", key = "#type+'-'+#cid+'-'+#page+'-'+#pageSize")
    @Override
    public CommonContentResult getContentList(CommonContentTypeEnum type, String cid, int page, int pageSize) {
        if (type == CommonContentTypeEnum._9k9) {
            return get9K9Content(cid, page, pageSize);
        } else if (type == CommonContentTypeEnum.juJia) {
            return getJuJiaShengHuoContent(cid, page, pageSize);
        } else if (type == CommonContentTypeEnum.muYin) {
            return getMuYinJingXuanContent(cid, page, pageSize);
        } else if (type == CommonContentTypeEnum.meiShi) {
            return getYouXuanMeiShiContent(cid, page, pageSize);
        } else if (type == CommonContentTypeEnum.chuanYiDaPei) {
            return getChuanYiDaPeiContent(cid, page, pageSize);
        } else if (type == CommonContentTypeEnum.meiZhuangGehu) {
            return getMeiZhuangGeHuContent(cid, page, pageSize);
        } else if (type == CommonContentTypeEnum.jingPinXieBao) {
            return getJingPinXieBaoContent(cid, page, pageSize);
        } else if (type == CommonContentTypeEnum.chaoNanReMai) {
            return getChaoNanReMaiContent(cid, page, pageSize);
        } else if (type == CommonContentTypeEnum.shuMaShouJi) {
            return getShuMaShouJiContent(cid, page, pageSize);
        } else if (type == CommonContentTypeEnum.yunDongKuXie) {
            return getYunDongKuXieContent(cid, page, pageSize);
        } else if (type == CommonContentTypeEnum.qiCheHuWai) {
            return getQiCheHuWaiContent(cid, page, pageSize);
        } else if (type == CommonContentTypeEnum.chaoPinReMai) {
            return getChaoPinReMaiContent(cid, page, pageSize);
        } else if (type == CommonContentTypeEnum.chaoSheng) {
            return getCaoShengContent(cid, page, pageSize);
        } else if (type == CommonContentTypeEnum.haoQuan) {
            return getHaoQuanContent(cid, page, pageSize);
        }
        return null;
    }
 
    /**
     * 9快9包邮
     * 
     * @param cid
     * @param page
     * @param pageSize
     * @return
     */
    private CommonContentResult get9K9Content(String cid, int page, int pageSize) {
        if (pageSize == 20)
            pageSize = 50;
 
        DaTaoKeGoodsResult result = null;
        if ("-1".equalsIgnoreCase(cid)) {
            result = DaTaoKeApiUtil.search("", null, null, new BigDecimal("10"), page, pageSize,
                    DaTaoKeApiUtil.SORT_DEFAULT);
 
        } else if ("0".equalsIgnoreCase(cid)) {
            result = DaTaoKeApiUtil.search("", null, null, new BigDecimal("10"), page, pageSize,
                    DaTaoKeApiUtil.SORT_CREATETIME);
        } else {
            List<Integer> cidList = new ArrayList<>();
            cidList.add(Integer.parseInt(cid));
            result = DaTaoKeApiUtil.search("", cidList, null, new BigDecimal("10"), page, pageSize,
                    DaTaoKeApiUtil.SORT_DEFAULT);
        }
 
        List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
        long count = 0;
        if (result != null) {
            count = result.getTotalCount();
            if (result.getGoodsList() != null)
                for (DaTaoKeDetailV2 detail : result.getGoodsList())
                    goodsList.add(TaoBaoUtil.convert(detail));
        }
        return new CommonContentResult(goodsList, count);
    }
 
    /**
     * 超级省钱
     * 
     * @param cid
     * @param page
     * @param pageSize
     * @return
     */
    private CommonContentResult getCaoShengContent(String cid, int page, int pageSize) {
        pageSize = Constant.PAGE_SIZE;
        Integer startAmount = null;
        Integer endAmount = null;
 
        if (cid.equalsIgnoreCase(1 + "")) {
            startAmount = 1;
            endAmount = 5;
        } else if (cid.equalsIgnoreCase(2 + "")) {
            startAmount = 5;
            endAmount = 10;
        } else if (cid.equalsIgnoreCase(3 + "")) {
            startAmount = 10;
            endAmount = 15;
        } else if (cid.equalsIgnoreCase(4 + "")) {
            startAmount = 15;
            endAmount = 20;
        } else if (cid.equalsIgnoreCase(5 + "")) {
            startAmount = 20;
            endAmount = 10000;
        }
 
        double tkRate = 20.00;
 
        BigDecimal proportion = hongBaoManageService.getFanLiRate();
        List<QualityFactory> listQuery = qualityGoodsService.listQueryByRebateAmount((page - 1) * pageSize, pageSize,
                proportion.toString(), startAmount, endAmount, tkRate);
 
        long count = qualityGoodsService.countQueryByRebateAmount(proportion.toString(), startAmount, endAmount,
                tkRate);
 
        List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
        // 遍历列表数据
        if (listQuery != null)
            for (QualityFactory quality : listQuery) {
                TaoBaoGoodsBrief taoBaoGoodsBrief = quality.getTaoBaoGoodsBrief();
                if (taoBaoGoodsBrief == null) {
                    continue;
                }
 
                int biz30day = taoBaoGoodsBrief.getBiz30day();
                if (biz30day >= 10000) {
                    double sales = biz30day;
                    String salesCountMidea = String.format("%.1f", sales / 10000);
                    taoBaoGoodsBrief.setSalesCount(salesCountMidea + "万");
                } else {
                    taoBaoGoodsBrief.setSalesCount(biz30day + "");
                }
                goodsList.add(taoBaoGoodsBrief);
            }
        return new CommonContentResult(goodsList, count);
    }
 
    /**
     * 高额好券
     * 
     * @param cid
     * @param page
     * @param pageSize
     * @return
     */
    private CommonContentResult getHaoQuanContent(String cid, int page, int pageSize) {
        pageSize = Constant.PAGE_SIZE;
 
        Integer startAmount = null;
        Integer endAmount = null;
 
        if (cid.equalsIgnoreCase(1 + "")) {
            startAmount = 1;
            endAmount = 5;
        } else if (cid.equalsIgnoreCase(2 + "")) {
            startAmount = 5;
            endAmount = 10;
        } else if (cid.equalsIgnoreCase(3 + "")) {
            startAmount = 10;
            endAmount = 20;
        } else if (cid.equalsIgnoreCase(4 + "")) {
            startAmount = 20;
            endAmount = 30;
        } else if (cid.equalsIgnoreCase(5 + "")) {
            startAmount = 30;
            endAmount = 50;
        } else if (cid.equalsIgnoreCase(6 + "")) {
            startAmount = 50;
            endAmount = 10000;
        }
 
        Integer startPropor = 20;
 
        List<QualityFactory> listQuery = qualityGoodsService.listQueryByCouponAmount((page - 1) * pageSize, pageSize,
                startAmount, endAmount, startPropor);
 
        long count = qualityGoodsService.countQueryByCouponAmount(startAmount, endAmount, startPropor);
 
        List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
 
        // 遍历列表数据
 
        for (QualityFactory selectionGoods : listQuery) {
 
            TaoBaoGoodsBrief taoBaoGoodsBrief = selectionGoods.getTaoBaoGoodsBrief();
 
            if (taoBaoGoodsBrief == null) {
                continue;
            }
 
            int biz30day = taoBaoGoodsBrief.getBiz30day();
            if (biz30day >= 10000) {
                double sales = biz30day;
                String salesCountMidea = String.format("%.1f", sales / 10000);
                taoBaoGoodsBrief.setSalesCount(salesCountMidea + "万");
            } else {
                taoBaoGoodsBrief.setSalesCount(biz30day + "");
            }
            goodsList.add(taoBaoGoodsBrief);
        }
        return new CommonContentResult(goodsList, count);
    }
 
    /**
     * 居家生活
     * 
     * @param cid
     * @param page
     * @param pageSize
     * @return
     */
    private CommonContentResult getJuJiaShengHuoContent(String cid, int page, int pageSize) {
        DaTaoKeGoodsResult result = null;
        List<Integer> cidList = new ArrayList<>();
        cidList.add(4);// 居家生活
        int sort = getCommonSort(cid);
        result = DaTaoKeApiUtil.search("", cidList, null, null, page, pageSize, sort);
        List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
        long count = 0;
        if (result != null) {
            count = result.getTotalCount();
            if (result.getGoodsList() != null)
                for (DaTaoKeDetailV2 detail : result.getGoodsList())
                    goodsList.add(TaoBaoUtil.convert(detail));
        }
        return new CommonContentResult(goodsList, count);
    }
 
    /**
     * 优选美食
     * 
     * @param cid
     * @param page
     * @param pageSize
     * @return
     */
    private CommonContentResult getYouXuanMeiShiContent(String cid, int page, int pageSize) {
        DaTaoKeGoodsResult result = null;
        List<Integer> cidList = new ArrayList<>();
        cidList.add(6);// 美食
        int sort = getCommonSort(cid);
        result = DaTaoKeApiUtil.search("", cidList, null, null, page, pageSize, sort);
        List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
        long count = 0;
        if (result != null) {
            count = result.getTotalCount();
            if (result.getGoodsList() != null)
                for (DaTaoKeDetailV2 detail : result.getGoodsList())
                    goodsList.add(TaoBaoUtil.convert(detail));
        }
        return new CommonContentResult(goodsList, count);
    }
 
    /**
     * 潮品热卖
     * 
     * @param cid
     * @param page
     * @param pageSize
     * @return
     */
    private CommonContentResult getChaoPinReMaiContent(String cid, int page, int pageSize) {
        DaTaoKeGoodsResult result = null;
 
        int sort = getCommonSort(cid);
        result = DaTaoKeApiUtil.search("潮", null, null, null, page, pageSize, sort);
        List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
        long count = 0;
        if (result != null) {
            count = result.getTotalCount();
            if (result.getGoodsList() != null)
                for (DaTaoKeDetailV2 detail : result.getGoodsList())
                    goodsList.add(TaoBaoUtil.convert(detail));
        }
        return new CommonContentResult(goodsList, count);
    }
 
    /**
     * 获取母婴精选
     * 
     * @param cid
     * @param page
     * @param pageSize
     * @return
     */
    private CommonContentResult getMuYinJingXuanContent(String cid, int page, int pageSize) {
        DaTaoKeGoodsResult result = null;
        if ("1".equalsIgnoreCase(cid)) {// 大淘客数据
            List<Integer> cidList = new ArrayList<>();
            cidList.add(2);// 母婴
            result = DaTaoKeApiUtil.search("", cidList, null, null, page, pageSize, DaTaoKeApiUtil.SORT_DEFAULT);
            List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
            long count = 0;
            if (result != null) {
                count = result.getTotalCount();
                if (result.getGoodsList() != null)
                    for (DaTaoKeDetailV2 detail : result.getGoodsList())
                        goodsList.add(TaoBaoUtil.convert(detail));
            }
            return new CommonContentResult(goodsList, count);
 
        } else {//
            List<TaobaoMeterial> taobaoMeterials = taobaoMeterialService.selectByClassNameAndSuperNameCache("母婴_" + cid,
                    "母婴主题");
 
            if (taobaoMeterials == null || taobaoMeterials.size() == 0) {
                return null;
            }
 
            TaobaoMeterial meterial = taobaoMeterials.get(0);
            Integer materialId = meterial.getMaterialId();
            if (materialId != null) {
                List<TaoBaoGoodsBrief> listBrands = new ArrayList<>();
                try {
                    listBrands = taoKeGoodsService.listByMaterial(materialId, page, pageSize);
                } catch (Exception e) {
                    e.printStackTrace();
                }
                return new CommonContentResult(listBrands, 1000);
            }
            return new CommonContentResult(new ArrayList<>(), 0);
        }
 
    }
 
    /**
     * 穿衣搭配
     * 
     * @param cid
     * @param page
     * @param pageSize
     * @return
     */
    private CommonContentResult getChuanYiDaPeiContent(String cid, int page, int pageSize) {
        DaTaoKeGoodsResult result = null;
        List<Integer> cidList = new ArrayList<>();
        cidList.add(1);// 女装
        int sort = getCommonSort(cid);
        result = DaTaoKeApiUtil.search("内衣 女", cidList, null, null, page, pageSize, sort);
        List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
        long count = 0;
        if (result != null) {
            count = result.getTotalCount();
            if (result.getGoodsList() != null)
                for (DaTaoKeDetailV2 detail : result.getGoodsList())
                    goodsList.add(TaoBaoUtil.convert(detail));
        }
        return new CommonContentResult(goodsList, count);
    }
 
    /**
     * 美妆个护
     * 
     * @param cid
     * @param page
     * @param pageSize
     * @return
     */
    private CommonContentResult getMeiZhuangGeHuContent(String cid, int page, int pageSize) {
        DaTaoKeGoodsResult result = null;
        List<Integer> cidList = new ArrayList<>();
        cidList.add(3);// 美妆
        int sort = getCommonSort(cid);
        result = DaTaoKeApiUtil.search("洗护", cidList, null, null, page, pageSize, sort);
        List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
        long count = 0;
        if (result != null) {
            count = result.getTotalCount();
            if (result.getGoodsList() != null)
                for (DaTaoKeDetailV2 detail : result.getGoodsList())
                    goodsList.add(TaoBaoUtil.convert(detail));
        }
        return new CommonContentResult(goodsList, count);
    }
 
    /**
     * 精品鞋包
     * 
     * @param cid
     * @param page
     * @param pageSize
     * @return
     */
 
    private CommonContentResult getJingPinXieBaoContent(String cid, int page, int pageSize) {
        DaTaoKeGoodsResult result = null;
        int sort = getCommonSort(cid);
        result = DaTaoKeApiUtil.search("鞋 女", null, null, null, page, pageSize, sort);
        DaTaoKeGoodsResult result1 = DaTaoKeApiUtil.search("包 女", null, null, null, page, pageSize, sort);
        List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
        long count = 0;
        if (result != null) {
            count = result.getTotalCount() + result1.getTotalCount();
            if (result.getGoodsList() != null)
                for (DaTaoKeDetailV2 detail : result.getGoodsList())
                    goodsList.add(TaoBaoUtil.convert(detail));
            if (result1.getGoodsList() != null)
                for (DaTaoKeDetailV2 detail : result1.getGoodsList())
                    goodsList.add(TaoBaoUtil.convert(detail));
        }
        Collections.shuffle(goodsList);
        return new CommonContentResult(goodsList, count);
    }
 
    /**
     * 潮男热卖
     * 
     * @param cid
     * @param page
     * @param pageSize
     * @return
     */
    private CommonContentResult getChaoNanReMaiContent(String cid, int page, int pageSize) {
        DaTaoKeGoodsResult result = null;
        int sort = getCommonSort(cid);
        result = DaTaoKeApiUtil.search("潮 男", null, null, null, page, pageSize, sort);
        List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
        long count = 0;
        if (result != null) {
            count = result.getTotalCount();
            if (result.getGoodsList() != null)
                for (DaTaoKeDetailV2 detail : result.getGoodsList())
                    goodsList.add(TaoBaoUtil.convert(detail));
        }
        Collections.shuffle(goodsList);
        return new CommonContentResult(goodsList, count);
    }
 
    /**
     * 数码手机
     * 
     * @param cid
     * @param page
     * @param pageSize
     * @return
     */
    private CommonContentResult getShuMaShouJiContent(String cid, int page, int pageSize) {
        DaTaoKeGoodsResult result = null;
        int sort = getCommonSort(cid);
        result = DaTaoKeApiUtil.search("电", null, null, null, page, pageSize, sort);
        DaTaoKeGoodsResult result1 = DaTaoKeApiUtil.search("手机", null, null, null, page, pageSize, sort);
        List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
        long count = 0;
        if (result != null) {
            count = result.getTotalCount() + result1.getTotalCount();
            if (result.getGoodsList() != null)
                for (DaTaoKeDetailV2 detail : result.getGoodsList())
                    goodsList.add(TaoBaoUtil.convert(detail));
            if (result1.getGoodsList() != null)
                for (DaTaoKeDetailV2 detail : result1.getGoodsList())
                    goodsList.add(TaoBaoUtil.convert(detail));
        }
        Collections.shuffle(goodsList);
        return new CommonContentResult(goodsList, count);
    }
 
    /**
     * 运动酷鞋
     * 
     * @param cid
     * @param page
     * @param pageSize
     * @return
     */
    private CommonContentResult getYunDongKuXieContent(String cid, int page, int pageSize) {
        DaTaoKeGoodsResult result = null;
        int sort = getCommonSort(cid);
        result = DaTaoKeApiUtil.search("鞋 男", null, null, null, page, pageSize, sort);
        DaTaoKeGoodsResult result1 = DaTaoKeApiUtil.search("运动 男", null, null, null, page, pageSize, sort);
        List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
        long count = 0;
        if (result != null) {
            count = result.getTotalCount() + result1.getTotalCount();
            if (result.getGoodsList() != null)
                for (DaTaoKeDetailV2 detail : result.getGoodsList())
                    goodsList.add(TaoBaoUtil.convert(detail));
            if (result1.getGoodsList() != null)
                for (DaTaoKeDetailV2 detail : result1.getGoodsList())
                    goodsList.add(TaoBaoUtil.convert(detail));
        }
        Collections.shuffle(goodsList);
        return new CommonContentResult(goodsList, count);
    }
 
    /**
     * 汽车户外
     * 
     * @param cid
     * @param page
     * @param pageSize
     * @return
     */
    private CommonContentResult getQiCheHuWaiContent(String cid, int page, int pageSize) {
        DaTaoKeGoodsResult result = null;
        List<Integer> cidList = new ArrayList<>();
        cidList.add(7);
        cidList.add(13);
        int sort = getCommonSort(cid);
        result = DaTaoKeApiUtil.search("", cidList, null, null, page, pageSize, sort);
        DaTaoKeGoodsResult result1 = DaTaoKeApiUtil.search("运动 男", cidList, null, null, page, pageSize, sort);
        List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
        long count = 0;
        if (result != null) {
            count = result.getTotalCount() + result1.getTotalCount();
            if (result.getGoodsList() != null)
                for (DaTaoKeDetailV2 detail : result.getGoodsList())
                    goodsList.add(TaoBaoUtil.convert(detail));
            if (result1.getGoodsList() != null)
                for (DaTaoKeDetailV2 detail : result1.getGoodsList())
                    goodsList.add(TaoBaoUtil.convert(detail));
        }
        Collections.shuffle(goodsList);
        return new CommonContentResult(goodsList, count);
    }
 
}