| | |
| | | import javax.xml.parsers.DocumentBuilderFactory; |
| | | |
| | | import com.yeshi.fanli.entity.SystemEnum; |
| | | import com.yeshi.fanli.util.*; |
| | | import org.apache.commons.httpclient.HttpClient; |
| | | import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager; |
| | | import org.apache.commons.httpclient.methods.GetMethod; |
| | |
| | | import com.yeshi.fanli.service.inter.goods.TaoBaoLinkService; |
| | | import com.yeshi.fanli.service.inter.order.config.HongBaoManageService; |
| | | import com.yeshi.common.entity.PageEntity; |
| | | import com.yeshi.fanli.util.AESUtil; |
| | | import com.yeshi.fanli.util.Constant; |
| | | import org.yeshi.utils.MoneyBigDecimalUtil; |
| | | import com.yeshi.fanli.util.StringUtil; |
| | | import com.yeshi.fanli.util.TaoBaoConstant; |
| | | import com.yeshi.fanli.util.TaoBaoHttpUtil; |
| | | import org.yeshi.utils.TimeUtil; |
| | | import com.yeshi.common.vo.ClientTextStyleVO; |
| | | |
| | |
| | | taoBaoGoods.setTkRate(commonGoods.getRate()); |
| | | taoBaoGoods.setTkCommFee(new BigDecimal("0")); |
| | | taoBaoGoods.setState(commonGoods.getState()); |
| | | taoBaoGoods.setCreatetime(commonGoods.getCreateTime()); |
| | | return taoBaoGoods; |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | public static String concatRelationId(String url, String relationId) { |
| | | if (StringUtil.isNullOrEmpty(url)) { |
| | | return url; |
| | | } |
| | | if (StringUtil.isNullOrEmpty(relationId)) |
| | | return url; |
| | | return url + "&relationId=" + relationId; |
| | | if (!url.contains("&relationId=")) |
| | | return url + "&relationId=" + relationId; |
| | | else |
| | | return url; |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | /** |
| | | * 获取淘宝授权链接 |
| | | * |
| | | * @param uid |
| | | * @param source |
| | | * @return |
| | |
| | | "http://api.flqapp.com/fanli/client/v1/auth/callback/tb", uid, source); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 是否为淘宝系的链接 |
| | | * |
| | | * @param link |
| | | * @return |
| | | */ |
| | | public static boolean isTaoBaoLink(String link) { |
| | | TaoBaoGoodsBrief tb = null; |
| | | String auctionId = null; |
| | | if (link.startsWith("https://a.m.taobao.com/i"))// 淘宝账号未登录状态 |
| | | { |
| | | return true; |
| | | } else if (link.contains("ju.taobao.com") || link.contains(".juhuasuan.com")) {// 聚划算 |
| | | return true; |
| | | } else if (link.contains("http://zmnxbc.com")) { // 手机端天猫APP分享 |
| | | return true; |
| | | } else if (link.contains("m.tb.cn") || link.contains("h5.m.taobao") || link.contains("detail.m.tmall") || link.contains("item.taobao") |
| | | || link.contains("detail.tmall")) { // 手机页面和电脑页面 |
| | | return true; |
| | | } else if (link.contains("//s.click.taobao.com")) { |
| | | return true; |
| | | } |
| | | |
| | | return false; |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 是否有新版淘口令 |
| | | * |
| | | * @param text |
| | | * @return |
| | | */ |
| | | public static boolean isHaveNewVersionTaoBaoToken(String text) { |
| | | if (text == null) |
| | | return false; |
| | | |
| | | int count = 0; |
| | | for (int i = 0; i < text.length(); i++) { |
| | | //大小写字母+数字 |
| | | if ((text.charAt(i) >= 65 && text.charAt(i) <= 90) || (text.charAt(i) >= 97 && text.charAt(i) <= 122) || (text.charAt(i) >= 48 && text.charAt(i) <= 57)) { |
| | | count++; |
| | | if (count >= 10) |
| | | return true; |
| | | } else { |
| | | count = 0; |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | System.out.println(isHaveNewVersionTaoBaoToken("復至\uD83D\uDC8B9.0₪sDO0X7l3Twm₪/ 去táo寶抢")); |
| | | } |
| | | |
| | | } |