From c6d25a24869db9cd4532c2b79c1356939249c634 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期一, 05 八月 2019 11:04:48 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/div' into div --- fanli/src/main/java/com/yeshi/fanli/service/impl/dynamic/DynamicInfoServiceImpl.java | 49 ++++++++++++++++++++++++++++++++++--------------- 1 files changed, 34 insertions(+), 15 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/dynamic/DynamicInfoServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/dynamic/DynamicInfoServiceImpl.java index e17efea..c876f43 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/impl/dynamic/DynamicInfoServiceImpl.java +++ b/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(); - if (userType == null || userType == 0) { - shop.setUserType(10); - } else { - shop.setUserType(11); + TaoBaoShop shopNew = new TaoBaoShop(); + try { + PropertyUtils.copyProperties(shopNew, shop); + } catch (Exception e) { + e.printStackTrace(); + continue; } - dynamicNew.setShop(shop); + Integer userType = shopNew.getUserType(); + if (userType == null || userType == 0) { + shopNew.setUserType(10); + } else { + shopNew.setUserType(11); + } + 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); + goodsNew.setJumpDetail(jumpDetailV2); } } + + imgsNew.add(goodsNew); } + dynamicNew.setImgs(imgsNew); } - dynamicNew.setImgs(imgs); listNew.add(dynamicNew); } } - // 鏇存柊鍟嗗搧淇℃伅 executor.execute(new Runnable() { -- Gitblit v1.8.0