| | |
| | | |
| | | @Resource |
| | | private ConvertLinkManager convertLinkManager; |
| | | |
| | | |
| | | @Resource |
| | | private ShareGoodsService shareGoodsService; |
| | | |
| | | |
| | | |
| | | private final static long TYPE_REXIAO = 1;// 热销 |
| | | private final static long TYPE_TUIJIAN = 2;// 推荐 |
| | |
| | | // 2.0.7返回发圈+活动+学院+素材 |
| | | list.add(map.get(TYPE_FAQUAN)); |
| | | list.add(map.get(TYPE_HUODONG)); |
| | | // list.add(map.get(TYPE_XUEYUAN)); |
| | | // list.add(map.get(TYPE_XUEYUAN)); |
| | | list.add(map.get(TYPE_SUCAI)); |
| | | |
| | | } else if (VersionUtil.greaterThan_2_0_6(acceptData.getPlatform(), acceptData.getVersion())) { |
| | |
| | | |
| | | try { |
| | | int type = 1; |
| | | if (cid == TYPE_FAQUAN){ |
| | | if (cid == TYPE_FAQUAN) { |
| | | type = 1; |
| | | } else if (cid == TYPE_SUCAI) { |
| | | type = 2; |
| | |
| | | if (list == null) { |
| | | list = new ArrayList<>(); |
| | | } |
| | | |
| | | |
| | | GsonBuilder gsonBuilder = new GsonBuilder().excludeFieldsWithoutExposeAnnotation(); |
| | | gsonBuilder.registerTypeAdapter(ImgEnum.class, new JsonSerializer<ImgEnum>() { |
| | | @Override |
| | |
| | | }); |
| | | Gson gson = gsonBuilder.create(); |
| | | long count = goodsEvaluateService.countValidMaterials(type); |
| | | |
| | | |
| | | JSONArray jsonArray = new JSONArray(); |
| | | |
| | | |
| | | String listStr = gson.toJson(list); |
| | | JSONArray array = JSONArray.fromObject(listStr); |
| | | for (int i = 0; i< array.size() ; i++) { |
| | | for (int i = 0; i < array.size(); i++) { |
| | | Object object = array.get(i); |
| | | JSONObject json = JSONObject.fromObject(object); |
| | | Object shareNum = json.get("shareNum"); |
| | | if (shareNum != null) { |
| | | int num = Integer.parseInt(shareNum.toString()); |
| | | if (num >= 10000) { |
| | | |
| | | if (num >= 100000000) { |
| | | double sales = num; |
| | | String salesCountMidea = String.format("%.1f", sales / 100000000); |
| | | json.put("shareNum", salesCountMidea + "亿"); |
| | | } else if (num >= 10000) { |
| | | double sales = num; |
| | | String salesCountMidea = String.format("%.1f", sales / 10000); |
| | | json.put("shareNum", salesCountMidea + "万"); |
| | | } |
| | | } |
| | | } |
| | | jsonArray.add(json); |
| | | } |
| | | |
| | | |
| | | |
| | | JSONObject data = new JSONObject(); |
| | | data.put("count", count); |
| | | data.put("list", jsonArray); |
| | |
| | | out.print(JsonUtil.loadFalseResult(1, "查询信息失败")); |
| | | LogHelper.errorDetailInfo(e); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | // 单品 |
| | | if (goodsEvaluate.getType() == EvaluateEnum.single) { |
| | | for (ImgInfo imgInfo : imgs) { |
| | | if ( type == 3 && imgInfo.getType() == ImgEnum.video) |
| | | if (type == 3 && imgInfo.getType() == ImgEnum.video) |
| | | continue; |
| | | |
| | | |
| | | GoodsDetailVO goodsVO = imgInfo.getGoodsVO(); |
| | | if (goodsVO == null) { |
| | | list.add(StringUtil.isNullOrEmpty(imgInfo.getUrlHD()) ? imgInfo.getUrl() : imgInfo.getUrlHD()); |
| | | list.add(StringUtil.isNullOrEmpty(imgInfo.getUrlHD()) ? imgInfo.getUrl() |
| | | : imgInfo.getUrlHD()); |
| | | continue; |
| | | } |
| | | |
| | |
| | | if (imgInfo.getType() == ImgEnum.goods || imgInfo.getType() == ImgEnum.video) |
| | | continue; |
| | | if (imgInfo.getType() == ImgEnum.img) |
| | | list.add(StringUtil.isNullOrEmpty(imgInfo.getUrlHD()) ? imgInfo.getUrl() : imgInfo.getUrlHD()); |
| | | list.add(StringUtil.isNullOrEmpty(imgInfo.getUrlHD()) ? imgInfo.getUrl() |
| | | : imgInfo.getUrlHD()); |
| | | else if (imgInfo.getType() == ImgEnum.activity) |
| | | if (!StringUtil.isNullOrEmpty(imgInfo.getActivityPic())) { |
| | | list.add(imgInfo.getActivityPic()); |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | private String getJumpLink(GoodsDetailVO goodsVO, UserInfo user, String relationId, String inviteCode) { |
| | | String jumpLink = null; |
| | | if (goodsVO.getGoodsType() == Constant.SOURCE_TYPE_TAOBAO) { |
| | |
| | | } catch (ShareGoodsException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | jumpLink = ShareControllerV2.getERCodeContentNew(configService.get(ConfigKeyEnum.quickShareTBCommentText.getKey()), |
| | | taoBaoLink.getGoods(), TaoBaoUtil.filterTaoToken(taoBaoLink.getTaoToken())); |
| | | jumpLink = ShareControllerV2.getERCodeContentNew( |
| | | configService.get(ConfigKeyEnum.quickShareTBCommentText.getKey()), taoBaoLink.getGoods(), |
| | | TaoBaoUtil.filterTaoToken(taoBaoLink.getTaoToken())); |
| | | } else if (goodsVO.getGoodsType() == Constant.SOURCE_TYPE_JD) { |
| | | JDGoods jdGoods = jdGoodsCacheUtil.getGoodsInfo(goodsVO.getGoodsId()); |
| | | if (jdGoods == null) { |
| | |
| | | return null; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 评论复制 |
| | | * |