| | |
| | | import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;
|
| | | import org.apache.commons.httpclient.methods.GetMethod;
|
| | | import org.apache.commons.httpclient.params.HttpMethodParams;
|
| | | import org.hibernate.cache.spi.NaturalIdCacheKey;
|
| | | import org.jsoup.Connection;
|
| | | import org.jsoup.Jsoup;
|
| | | import org.jsoup.nodes.Document;
|
| | |
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | | import com.google.gson.reflect.TypeToken;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
|
| | | import com.yeshi.fanli.entity.common.ImageInfo;
|
| | | import com.yeshi.fanli.entity.goods.CommonGoods;
|
| | | import com.yeshi.fanli.entity.taobao.SearchFilter;
|
| | |
| | | tg.setTaoBaoQuanInfo(quanInfo);
|
| | | }
|
| | |
|
| | | BigDecimal proportion = taoBaoUtil.manageService.getFanLiRate();
|
| | | BigDecimal proportion = taoBaoUtil.manageService.getFanLiRate(UserLevelEnum.daRen);
|
| | | TaoBaoHongBaoInfo hongBaoInfo = new TaoBaoHongBaoInfo();
|
| | | String tkMktStatus = tb.getTkMktStatus();
|
| | | if ("1".equals(tkMktStatus)) {
|
| | |
| | | }
|
| | |
|
| | | /**
|
| | | * 获取未参与推广的淘宝商品详情
|
| | | * @Title: getTaoBaoGoodsBrief
|
| | | * @Description: |
| | | * @param id
|
| | | * @return |
| | | * TaoBaoGoodsBrief 包含(标题与图片)
|
| | | * @throws
|
| | | * 获取未参与推广的淘宝商品详情 @Title: getTaoBaoGoodsBrief @Description: @param
|
| | | * id @return TaoBaoGoodsBrief 包含(标题与图片) @throws
|
| | | */
|
| | | public static TaoBaoGoodsBrief getTaoBaoGoodsBriefNotInPub(Long id) {
|
| | | TaoBaoGoodsBrief tb = TaoBaoUtil.getTmallGoodsInfo(id+"");
|
| | | TaoBaoGoodsBrief tb = TaoBaoUtil.getTmallGoodsInfo(id + "");
|
| | | return tb;
|
| | | }
|
| | |
|
| | |
| | | TaoBaoGoodsBrief taoBaoGoods = new TaoBaoGoodsBrief();
|
| | | taoBaoGoods.setAuctionId(detail.getGoodsId());
|
| | | taoBaoGoods.setBiz30day(detail.getMonthSales());
|
| | | // 券相关转换
|
| | | taoBaoGoods.setCouponAmount(detail.getCouponPrice());
|
| | | taoBaoGoods.setCouponInfo(String.format("满%s元减%s元", detail.getCouponConditions(),
|
| | | taoBaoGoods.setCouponInfo(String.format("满%s元减%s元", detail.getOriginalPrice(),
|
| | | MoneyBigDecimalUtil.getWithNoZera(detail.getCouponPrice())));
|
| | | if (detail.getCouponTotalNum() != null && detail.getCouponReceiveNum() != null)
|
| | | taoBaoGoods.setCouponLeftCount(detail.getCouponTotalNum() - detail.getCouponReceiveNum());
|
| | | else
|
| | | taoBaoGoods.setCouponLeftCount(0);
|
| | | taoBaoGoods.setCouponStartFee(detail.getOriginalPrice());
|
| | | try {
|
| | | taoBaoGoods.setCouponStartFee(detail.getOriginalPrice());
|
| | | } catch (Exception e) {
|
| | | }
|
| | |
|
| | | taoBaoGoods.setCouponTotalCount(detail.getCouponTotalNum());
|
| | | taoBaoGoods.setCouponLink(detail.getCouponLink());
|
| | | taoBaoGoods.setCouponEffectiveStartTime(TimeUtil.getGernalTime(
|
| | | TimeUtil.convertToTimeTemp(detail.getCouponStartTime(), "yyyy-MM-dd HH:mm:ss"), "yyyy-MM-dd"));
|
| | | taoBaoGoods.setCouponEffectiveEndTime(TimeUtil.getGernalTime(
|
| | | TimeUtil.convertToTimeTemp(detail.getCouponEndTime(), "yyyy-MM-dd HH:mm:ss"), "yyyy-MM-dd"));
|
| | |
|
| | | taoBaoGoods.setPictUrl(detail.getMainPic());
|
| | | taoBaoGoods.setPictUrlWhite(detail.getMainPic());
|
| | | if (taoBaoGoods.getPictUrl() != null && !taoBaoGoods.getPictUrl().startsWith("http"))
|
| | |
| | | if (elements.size() >= 0) {
|
| | | for (int i = 0; i < elements.size(); i++) {
|
| | | String content = elements.get(i).toString();
|
| | | if (content.contains("var _DATA_Mdskip")) {
|
| | | if (content.contains("var _DATA_Detail")) {
|
| | | content = content.replace("<script>", "");
|
| | | content = content.replace("</script>", "");
|
| | |
|
| | | if (content.contains("videoDetail")) {
|
| | | content += ";function getData(){ var json={title:_DATA_Mdskip.item.title,pictUrl:_DATA_Mdskip.item.videoDetail.videoThumbnailURL}; return JSON.stringify(json);}";
|
| | | content += ";function getData(){ var json={title:_DATA_Detail.item.title,pictUrl:_DATA_Detail.item.images[0]}; return JSON.stringify(json);}";
|
| | | } else {
|
| | | content += ";function getData(){ var json={title:_DATA_Mdskip.item.title,pictUrl:_DATA_Mdskip.item.videos[0].videoThumbnailURL}; return JSON.stringify(json);}";
|
| | | content += ";function getData(){ var json={title:_DATA_Detail.item.title,pictUrl:_DATA_Detail.item.images[0]}; return JSON.stringify(json);}";
|
| | | }
|
| | |
|
| | | ScriptEngineManager manager = new ScriptEngineManager();
|
| | |
| | | taoBaoGoodsBrief = new TaoBaoGoodsBrief();
|
| | | taoBaoGoodsBrief.setTitle(title.toString());
|
| | | taoBaoGoodsBrief.setPictUrl(pictUrl.toString());
|
| | | if (!pictUrl.toString().startsWith("http")) {
|
| | | taoBaoGoodsBrief.setPictUrl(TbImgUtil.getTBSize220Img("http:" + pictUrl.toString()));
|
| | | }
|
| | | }
|
| | |
|
| | | break;
|
| | |
| | | return false;
|
| | | }
|
| | |
|
| | | private final static String[] taoTokenSymbols = new String[] { "₳-₳", "¥-¥", "¥-¥", "€-€", "\\$-\\$", "₴-₴", "¢-¢",
|
| | | "₤-₤" };
|
| | |
|
| | | /**
|
| | | * 从文本中提取淘口令
|
| | | * @Title: getTokenListFromText
|
| | | * @Description: |
| | | * @param str
|
| | | * @return |
| | | * List<String> 返回类型
|
| | | * @throws
|
| | | * 从文本中提取淘口令 @Title: getTokenListFromText @Description: @param str @return
|
| | | * List<String> 返回类型 @throws
|
| | | */
|
| | | public static List<String> getTokenListFromText(String str) {
|
| | | String[] marks = new String[] { "₳", "¥", "¥", "€", "\\$", "₴", "¢", "₤" };
|
| | | String[] marks = taoTokenSymbols;
|
| | |
|
| | | return getTokenListFromText(str, Arrays.asList(marks));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 从文本中提取淘口令(括号的口令也算)
|
| | | * |
| | | * @param str
|
| | | * @return
|
| | | */
|
| | | public static List<String> getTokenListFromTextWithKuoHao(String str) {
|
| | | String[] marks = taoTokenSymbols;
|
| | | List<String> list = new ArrayList<>();
|
| | | for (String st : marks)
|
| | | list.add(st);
|
| | | list.add("\\(-\\)");
|
| | | list.add("(-)");
|
| | | return getTokenListFromText(str, list);
|
| | | }
|
| | |
|
| | | public static List<String> getTokenListFromText(String str, List<String> markList) {
|
| | | List<String> expressList = new ArrayList<>();
|
| | | for (String st : markList) {
|
| | | expressList.add(String.format("(%s{1}[A-Za-z0-9]{11,13}+%s{1})", st, st));
|
| | | expressList.add(String.format("(%s{1}[A-Za-z0-9]{11,13}+%s{1})", st.split("-")[0], st.split("-")[1]));
|
| | | }
|
| | | String pattern = StringUtil.concat(expressList, "|");
|
| | | Pattern r = Pattern.compile(pattern);
|