| | |
| | | import com.yeshi.fanli.entity.dynamic.ImgInfo.ImgEnum; |
| | | import com.yeshi.fanli.entity.jd.JDGoods; |
| | | import com.yeshi.fanli.entity.system.ConfigKeyEnum; |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief; |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoLink; |
| | | import com.yeshi.fanli.exception.share.ShareGoodsException; |
| | | import com.yeshi.fanli.log.LogHelper; |
| | |
| | | import com.yeshi.fanli.util.jd.JDUtil; |
| | | import com.yeshi.fanli.util.pinduoduo.PinDuoDuoApiUtil; |
| | | import com.yeshi.fanli.util.taobao.DaTaoKeUtil; |
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil; |
| | | import com.yeshi.fanli.vo.dynamic.ArticleVO; |
| | | import com.yeshi.fanli.vo.goods.GoodsDetailVO; |
| | | import com.yeshi.fanli.vo.msg.ClientTextStyleVO; |
| | | |
| | | import net.sf.json.JSONArray; |
| | | import net.sf.json.JSONObject; |
| | | |
| | | /** |
| | |
| | | }); |
| | | 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++) { |
| | | 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) { |
| | | 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", gson.toJson(list)); |
| | | data.put("list", jsonArray); |
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | out.print(JsonUtil.loadFalseResult(1, "查询信息失败")); |
| | | LogHelper.errorDetailInfo(e); |
| | | } |
| | |
| | | } catch (ShareGoodsException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | jumpLink = configService.get(ConfigKeyEnum.taobaoShareQrcodeText.getKey()).replace("[淘口令]", |
| | | 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; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 评论复制 |
| | | * |