admin
2019-08-05 c6d25a24869db9cd4532c2b79c1356939249c634
Merge remote-tracking branch 'origin/div' into div
1个文件已修改
53 ■■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/service/impl/dynamic/DynamicInfoServiceImpl.java 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/dynamic/DynamicInfoServiceImpl.java
@@ -909,7 +909,7 @@
    
    
    @Override
//    @Cacheable(value = "dynamicCache", key = "'queryV2-'+#platform+'-'+#version+'-'+#start+'-'+#count+'-'+#cid+'-'+#subId")
    @Cacheable(value = "dynamicCache", key = "'queryV2-'+#platform+'-'+#version+'-'+#start+'-'+#count+'-'+#cid+'-'+#subId")
    public List<DynamicInfo> queryV2(int platform, int version, int start, int count, Long cid, Long subId) {
        List<DynamicInfo> listNew = new ArrayList<DynamicInfo>();
        List<DynamicInfo> list = dynamicInfoDao.query(start, count, cid, subId);
@@ -925,43 +925,62 @@
                    continue;
                }
                
                // 店铺信息
                TaoBaoShop shop = dynamicNew.getShop();
                if (shop != null) {
                    Integer userType = shop.getUserType();
                    TaoBaoShop shopNew = new TaoBaoShop();
                    try {
                        PropertyUtils.copyProperties(shopNew, shop);
                    } catch (Exception e) {
                        e.printStackTrace();
                        continue;
                    }
                    Integer userType = shopNew.getUserType();
                    if (userType == null || userType == 0) {
                        shop.setUserType(10);
                        shopNew.setUserType(10);
                    } else {
                        shop.setUserType(11);
                        shopNew.setUserType(11);
                    }
                    dynamicNew.setShop(shop);
                    dynamicNew.setShop(shopNew);
                }
                
                List<GoodsPicture> imgsNew = new ArrayList<GoodsPicture>();
                List<GoodsPicture> imgs = dynamicNew.getImgs();
                if (imgs != null && imgs.size() > 0) {
                    for (GoodsPicture goodsPicture: imgs) {
                        TaoBaoGoodsBriefExtra goods = goodsPicture.getGoods();
                        if (goods == null) {
                            imgsNew.add(goodsPicture);
                            continue;
                        }
                        GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBaoGoodsBriefExtra(goods, fanLiRate, shareRate);
                        goodsPicture.setGoodsVO(detailVO);
                        goodsPicture.setGoods(null);
                        
                        JumpDetailV2 jumpDetail = goodsPicture.getJumpDetail();
                        GoodsPicture goodsNew = new GoodsPicture();
                        try {
                            PropertyUtils.copyProperties(goodsNew, goodsPicture);
                        } catch (Exception e) {
                            e.printStackTrace();
                            continue;
                        }
                        GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBaoGoodsBriefExtra(goods, fanLiRate, shareRate);
                        goodsNew.setGoodsVO(detailVO);
                        goodsNew.setGoods(null);
                        JumpDetailV2 jumpDetail = goodsNew.getJumpDetail();
                        if (jumpDetail != null) {
                            JumpDetailV2 jumpDetailV2 = jumpDetailV2Service.getByTypeCache(jumpDetail.getType(), platform, version);
                            if (jumpDetailV2 != null) {
                                goodsPicture.setJumpDetail(jumpDetailV2);
                            }
                        }
                    }
                }
                dynamicNew.setImgs(imgs);
                listNew.add(dynamicNew);
                                goodsNew.setJumpDetail(jumpDetailV2);
            }
        }
        
                        imgsNew.add(goodsNew);
                    }
                    dynamicNew.setImgs(imgsNew);
                }
                listNew.add(dynamicNew);
            }
        }
        
        // 更新商品信息
        executor.execute(new Runnable() {