| | |
| | | @Resource |
| | | private PIDManager pidManager; |
| | | |
| | | |
| | | @RequestMapping(value = "getHonestList") |
| | | public void getHonestList(AcceptData acceptData, PrintWriter out) { |
| | | List<Honest> honestList = null; |
| | |
| | | honestList = new ArrayList<>(); |
| | | JumpDetail detail = new JumpDetail(); |
| | | detail.setActivity(String.format("%s.ui.invite.ShareBrowserActivity", |
| | | Constant.systemCommonConfig.getAndroidBaseactivityName())); |
| | | systemConfigService.getValueCache(SystemConfigKeyEnum.androidBaseActivityName,acceptData.getSystem()))); |
| | | detail.setName("网页"); |
| | | detail.setController("ShonpingShareViewController"); |
| | | |
| | |
| | | honestList = new ArrayList<>(); |
| | | JumpDetail detail = new JumpDetail(); |
| | | detail.setActivity( |
| | | String.format("%s.ui.BrowserActivity", Constant.systemCommonConfig.getAndroidBaseactivityName())); |
| | | String.format("%s.ui.BrowserActivity", systemConfigService.getValueCache(SystemConfigKeyEnum.androidBaseActivityName,acceptData.getSystem()))); |
| | | detail.setName("网页"); |
| | | // GoodsDetailController |
| | | detail.setController("BrowserController"); |
| | |
| | | |
| | | TaoBaoGoodsBrief simpleGoods = null; |
| | | try { |
| | | simpleGoods = redisManager.getTaoBaoGoodsBrief(Long.parseLong(id)); |
| | | simpleGoods = redisManager.getTaoBaoGoodsBrief(id); |
| | | } catch (NumberFormatException e2) { |
| | | e2.printStackTrace(); |
| | | } catch (TaobaoGoodsDownException e2) { |
| | |
| | | app.setAppKey(clientTBPid.getAppKey()); |
| | | app.setAppSecret(config.getAppSecret()); |
| | | app.setPid(clientTBPid.getPid()); |
| | | tb = TaoKeApiUtil.searchGoodsDetail(Long.parseLong(id), app); |
| | | tb = TaoKeApiUtil.searchGoodsDetail(id, app); |
| | | } catch (NumberFormatException e1) { |
| | | e1.printStackTrace(); |
| | | } catch (TaobaoGoodsDownException e1) { |
| | |
| | | taoBaoGoodsBriefExtra.setAuctionUrl(tb.getAuctionUrl()); |
| | | if (uid != null && !"".equals(uid.trim())) { |
| | | CollectionGoodsV2 collectionGoods = collectionGoodsV2Service.findByUidAndAuctionId(Long.parseLong(uid), |
| | | Long.parseLong(id), Constant.SOURCE_TYPE_TAOBAO); |
| | | id, Constant.SOURCE_TYPE_TAOBAO); |
| | | data.put("collection", collectionGoods != null ? true : false); |
| | | } |
| | | |
| | |
| | | app.setAppSecret(config.getAppSecret()); |
| | | app.setPid(clientPid); |
| | | try { |
| | | goods = TaoKeApiUtil.searchGoodsDetail(Long.parseLong(id), app); |
| | | goods = TaoKeApiUtil.searchGoodsDetail(id, app); |
| | | if (goods != null) { |
| | | ticket.put("clickUrl", goods.getAuctionUrl()); |
| | | // 测试使用 |
| | |
| | | } |
| | | } else { |
| | | try { |
| | | goods = redisManager.getTaoBaoGoodsBrief(Long.parseLong(id)); |
| | | goods = redisManager.getTaoBaoGoodsBrief(id); |
| | | } catch (TaobaoGoodsDownException e) { |
| | | try { |
| | | monitorService.addClientAPIMonitor(MonitorFactory.createClientAPI(request, 0, 0, "商品下架")); |
| | |
| | | // 商品下架 |
| | | ThreadUtil.run(new Runnable() { |
| | | public void run() { |
| | | taoBaoGoodsUpdateService.deleteTaoBaoGoods(Long.parseLong(id)); |
| | | taoBaoGoodsUpdateService.deleteTaoBaoGoods(id); |
| | | } |
| | | }); |
| | | |
| | |
| | | }); |
| | | } |
| | | } else if (task.equalsIgnoreCase("imgs")) {// 获取图文详情 |
| | | List<ImageInfo> imgs = redisManager.getTaoBaoGoodsDetailImgs(Long.parseLong(id), acceptData.getSystem()); |
| | | List<ImageInfo> imgs = redisManager.getTaoBaoGoodsDetailImgs(id, acceptData.getSystem()); |
| | | if (imgs != null && imgs.size() > 0) { |
| | | detailImgs.clear(); |
| | | detailImgsSize.clear(); |
| | |
| | | // 判断收藏 |
| | | if (!StringUtil.isNullOrEmpty(uid)) { |
| | | CollectionGoodsV2 collectionGoods = collectionGoodsV2Service.findByUidAndAuctionId(Long.parseLong(uid), |
| | | Long.parseLong(id), Constant.SOURCE_TYPE_TAOBAO); |
| | | id, Constant.SOURCE_TYPE_TAOBAO); |
| | | data.put("collected", collectionGoods != null ? true : false); |
| | | } else |
| | | data.put("collected", false); |
| | |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "gettaobaolink") |
| | | public void getTaobaoLink(AcceptData acceptData, String uid, Long id, PrintWriter out) { |
| | | public void getTaobaoLink(AcceptData acceptData, String uid, String id, PrintWriter out) { |
| | | ClientTBPid clientTBPid = null; |
| | | // 用户已经登录 |
| | | if (!StringUtil.isNullOrEmpty(uid)) { |
| | |
| | | |
| | | // 根据商品获取推荐 |
| | | @RequestMapping(value = "getgoodsrecommend", method = RequestMethod.POST) |
| | | public void getGoodsRecommend(final AcceptData acceptData, long id, PrintWriter out) { |
| | | public void getGoodsRecommend(final AcceptData acceptData, String id, PrintWriter out) { |
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(), |
| | | acceptData.getPackages(), acceptData.getSystem()); |
| | | if (system == null) { |
| | |
| | | for (String auctionIdStr : idStr) { |
| | | scanHistoryV2Service.deleteByAuctionIdAndDeviceOrUid( |
| | | StringUtil.isNullOrEmpty(uid) ? null : Long.parseLong(uid), acceptData.getDevice(), |
| | | Long.parseLong(auctionIdStr)); |
| | | auctionIdStr); |
| | | } |
| | | } else { |
| | | scanHistoryV2Service.deleteByDeviceOrUid(StringUtil.isNullOrEmpty(uid) ? null : Long.parseLong(uid), |
| | |
| | | // } |
| | | TaoBaoGoodsBrief goods = null; |
| | | try { |
| | | goods = redisManager.getTaoBaoGoodsBrief(Long.parseLong(id)); |
| | | goods = redisManager.getTaoBaoGoodsBrief(id); |
| | | } catch (NumberFormatException e) { |
| | | e.printStackTrace(); |
| | | } catch (TaobaoGoodsDownException e) { |
| | |
| | | array = JSONArray.fromObject(cacheValue); |
| | | } |
| | | } |
| | | JumpDetailV2 jumpDetail = jumpDetailV2Service.getByTypeCache("web"); |
| | | JumpDetailV2 jumpDetail = jumpDetailV2Service.getByTypeCache("web",acceptData.getSystem()); |
| | | if (array == null) { |
| | | array = new JSONArray(); |
| | | |
| | |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getgoodsinfo", method = RequestMethod.POST) |
| | | public void getGoodsInfo(AcceptData acceptData, Long id, Long uid, String from, PrintWriter out) { |
| | | public void getGoodsInfo(AcceptData acceptData, String id, Long uid, String from, PrintWriter out) { |
| | | |
| | | if (id == null) { |
| | | out.print(JsonUtil.loadFalseResult(1, "请上传id")); |
| | |
| | | } |
| | | |
| | | if (goods.getTkRate() == null || new BigDecimal(0).compareTo(goods.getTkRate()) == 0) { |
| | | TaoBaoGoodsBrief linkInfo = TaoKeApiUtil.specialConvertCoupon(goods.getAuctionId(), app, null, null); |
| | | TaoBaoGoodsBrief linkInfo = TaoKeApiUtil.specialConvertCouponV2(goods.getAuctionId(), app, null, null); |
| | | if (linkInfo != null) { |
| | | goods.setAuctionUrl(linkInfo.getAuctionUrl()); |
| | | goods.setCouponLink(linkInfo.getCouponLink()); |
| | |
| | | List<String> detailImgs = new ArrayList<>(); |
| | | JSONArray detailImgsSize = new JSONArray(); |
| | | |
| | | List<ImageInfo> imgs = redisManager.getTaoBaoGoodsDetailImgs(Long.parseLong(id), acceptData.getSystem()); |
| | | List<ImageInfo> imgs = redisManager.getTaoBaoGoodsDetailImgs(id, acceptData.getSystem()); |
| | | |
| | | if (imgs != null && imgs.size() > 0) { |
| | | |
| | |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getgoodsderivation", method = RequestMethod.POST) |
| | | public void getRecommendGoods(AcceptData acceptData, long id, PrintWriter out) { |
| | | public void getRecommendGoods(AcceptData acceptData, String id, PrintWriter out) { |
| | | |
| | | try { |
| | | |
| | |
| | | app.setPid(pidManager.getPidCache(acceptData.getSystem(), Constant.SOURCE_TYPE_TAOBAO, SystemPIDInfo.PidType.fanli)); |
| | | app.setAdzoneId(app.getPid().split("_")[3]); |
| | | |
| | | List<Long> ids = new ArrayList<>(); |
| | | List<String> ids = new ArrayList<>(); |
| | | for (TaoBaoGoodsBrief goods : goodsList) |
| | | ids.add(goods.getAuctionId()); |
| | | |
| | |
| | | } |
| | | |
| | | if (taoBaoGoodsBrief == null) { |
| | | TaoBaoGoodsBrief newGoods = TaoKeApiUtil.specialConvertCoupon(goods.getAuctionId(), app, null, null); |
| | | TaoBaoGoodsBrief newGoods = TaoKeApiUtil.specialConvertCouponV2(goods.getAuctionId(), app, null, null); |
| | | goods.setCouponInfo(newGoods.getCouponInfo()); |
| | | goods.setCouponLink(newGoods.getCouponLink()); |
| | | goods.setTkRate(newGoods.getTkRate()); |
| | |
| | | } |
| | | }); |
| | | |
| | | List<TaoBaoGoodsBrief> listQuality = new ArrayList<TaoBaoGoodsBrief>(); |
| | | List<TaoBaoGoodsBrief> listQuality = new ArrayList<>(); |
| | | |
| | | // 取偶数个数据 |
| | | if (listExtra.size() % 2 != 0) { |