| | |
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoShopService;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.db.MongoDBManager;
|
| | | import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoShopUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | | import com.yeshi.fanli.vo.brand.TaoBaoShopVO;
|
| | | import com.yeshi.fanli.vo.goods.GoodsDetailVO;
|
| | |
|
| | | @Service
|
| | | public class TaoBaoShopServiceImpl implements TaoBaoShopService {
|
| | |
| | | }
|
| | | return list;
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | @Cacheable(value = "brandCache", key = "'getShopByKeyV2-'+#key")
|
| | | public List<TaoBaoShopVO> getShopByKeyV2(String key) {
|
| | | List<TaoBaoShopVO> list = taoBaoShopMapper.getShopByKey(key);
|
| | | if (list == null || list.size() == 0) {
|
| | | return null;
|
| | | }
|
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | for (TaoBaoShopVO taoBaoShopVO : list) {
|
| | | |
| | | Integer userType = taoBaoShopVO.getUserType();
|
| | | if (userType == null || userType == 0) {
|
| | | taoBaoShopVO.setUserType(10);
|
| | | } else {
|
| | | taoBaoShopVO.setUserType(11);
|
| | | }
|
| | |
|
| | | String shopLink = taoBaoShopVO.getShopLink();
|
| | | if (StringUtil.isNullOrEmpty(shopLink)) {
|
| | | taoBaoShopVO.setShopLink(TaoBaoUtil.getShopLink(taoBaoShopVO.getId()));
|
| | | }
|
| | |
|
| | | String shopNameCustom = taoBaoShopVO.getShopNameCustom();
|
| | | if (!StringUtil.isNullOrEmpty(shopNameCustom)) {
|
| | | taoBaoShopVO.setShopName(shopNameCustom);
|
| | | }
|
| | |
|
| | | String shopIconCustom = taoBaoShopVO.getShopIconCustom();
|
| | | if (!StringUtil.isNullOrEmpty(shopIconCustom)) {
|
| | | taoBaoShopVO.setShopIcon(shopIconCustom);
|
| | | }
|
| | |
|
| | | List<GoodsDetailVO> listGoods = new ArrayList<GoodsDetailVO>();
|
| | | List<TaoBaoGoodsBrief> listGoodsBrief = taoBaoShopVO.getListGoodsBrief();
|
| | | for (TaoBaoGoodsBrief taoBaoGoodsBrief : listGoodsBrief) {
|
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, null, fanLiRate, shareRate);
|
| | | listGoods.add(goodsDetailVO);
|
| | | }
|
| | | taoBaoShopVO.setListGoodsVO(listGoods);
|
| | | }
|
| | | return list;
|
| | | }
|
| | | }
|