Merge remote-tracking branch 'origin/div' into div
| | |
| | | return;
|
| | | }
|
| | |
|
| | | if (!canClose && StringUtil.isNullOrEmpty(contentUrl)) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("跳转链接不能为空"));
|
| | | return;
|
| | | }
|
| | |
|
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
| | |
|
| | |
| | |
|
| | | if (canClose && !StringUtil.isNullOrEmpty(appPageNotification.getContentUrl())) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("跳转链接和允许关闭不可同时存在"));
|
| | | return;
|
| | | }
|
| | | |
| | | if (!canClose && StringUtil.isNullOrEmpty(appPageNotification.getContentUrl())) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("跳转链接不能为空"));
|
| | | return;
|
| | | }
|
| | |
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | if (!canClose && StringUtil.isNullOrEmpty(resultObj.getContentUrl())) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("跳转链接不能为空"));
|
| | | return;
|
| | | }
|
| | | |
| | | AppPageNotification newOBj = new AppPageNotification();
|
| | | newOBj.setId(resultObj.getId());
|
| | | newOBj.setCanClose(canClose);
|
| | |
| | | * @throws NotExistObjectException
|
| | | * @throws IOException
|
| | | */
|
| | | @RequestSerializableByKey(key = "'listInviteFriendImg-'+#uid")
|
| | | @RequestMapping(value = "/listInviteFriendImg", method = RequestMethod.POST)
|
| | | public void listInviteFriendImg(AcceptData acceptData, Long uid, PrintWriter out, HttpServletRequest request)
|
| | | throws NotExistObjectException, IOException {
|
| | |
| | | }
|
| | |
|
| | |
|
| | | |
| | | @RequestSerializableByKey(key = "'getInviteImgs-'+#uid")
|
| | | @RequestMapping(value = "/getInviteImgs", method = RequestMethod.POST)
|
| | | public void getInviteImgs(AcceptData acceptData, Long uid, Integer page, PrintWriter out, HttpServletRequest request) {
|
| | | if (uid == null || uid <= 0) {
|
| | |
| | | if (tb == null)// 淘宝是空值
|
| | | {
|
| | | String jdId = JDUtil.getJDGoodsId(text);
|
| | | |
| | | // 微信链接
|
| | | if (StringUtil.isNullOrEmpty(jdId)) {
|
| | | jdId = JDUtil.getJDGoodsIdByWeiXin(text);
|
| | | }
|
| | |
|
| | | // 领券短连接
|
| | | if (StringUtil.isNullOrEmpty(jdId) && text.contains("u.jd.com")) {
|
| | | jdId = JDUtil.getJDGoodsIdByUJD(text);
|
| | | }
|
| | | |
| | | if (!StringUtil.isNullOrEmpty(jdId)) {
|
| | | JDGoods goods = JDApiUtil.getGoodsDetail(Long.parseLong(jdId));
|
| | | if (goods != null) {
|
| | |
| | | return null;
|
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | | * 根据 u.jd短连接获取真实的商品id
|
| | | * @param url
|
| | | * @return
|
| | | */
|
| | | public static String getJDGoodsIdByUJD(String url) {
|
| | | try {
|
| | | String body = HttpUtil.get(url);
|
| | | Document doc = Jsoup.parse(body);
|
| | | Elements els = doc.getElementsByTag("script");
|
| | | for (int i = 0; i < els.size(); i++) {
|
| | | String content = els.get(i).html();
|
| | | if (content.indexOf("var hrl") > -1) {
|
| | | ScriptEngineManager manager = new ScriptEngineManager();
|
| | | ScriptEngine engine = manager.getEngineByName("javascript");
|
| | | |
| | | int indexOf = content.indexOf("var hrl");
|
| | | content = content.substring(indexOf, content.length());
|
| | | |
| | | int indexOf2 = content.indexOf(";");
|
| | | content = content.substring(0, indexOf2+1);
|
| | | |
| | | String js = "function getData(){return JSON.stringify(hrl);}" + content;
|
| | | |
| | | engine.eval(js);
|
| | | if (engine instanceof Invocable) {
|
| | | Invocable in = (Invocable) engine;
|
| | | String data = in.invokeFunction("getData").toString();
|
| | | String link = data.substring(1, data.length()-1);
|
| | | |
| | | String realLink = HttpUtil.getLocation(link);
|
| | | realLink = realLink.substring(realLink.indexOf("sku=") + 4, realLink.length());
|
| | | return realLink.substring(0, realLink.indexOf("&"));
|
| | | }
|
| | | }
|
| | | }
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | return null;
|
| | | }
|
| | | |
| | | |
| | | |
| | | /**
|
| | | * 查询天猫商品图片、标题
|
| | | *
|
| | |
| | | }
|
| | | return getShowCouponInfo(goods.getCouponInfoList(), price);
|
| | | }
|
| | | |
| | | |
| | | |
| | | |
| | |
|
| | | }
|