| | |
| | | import org.springframework.web.bind.annotation.RequestMethod;
|
| | | import org.yeshi.utils.IPUtil;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | | import org.yeshi.utils.NumberUtil; |
| | | import org.yeshi.utils.NumberUtil;
|
| | | import org.yeshi.utils.taobao.TbImgUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | |
| | |
|
| | | @Resource
|
| | | private ShamUserService shamUserService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private SpecialService specialService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private SwiperPictureService swiperPictureService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private MonitorService monitorService;
|
| | |
| | | out.print(JsonUtil.loadFalseResult(1, "系统不存在"));
|
| | | return;
|
| | | }
|
| | | // TaoBaoGoodsBrief alimama = TaoBaoUtil.isAlimama(id);
|
| | | // 获取淘客参数
|
| | | ClientTBPid clientTBPid = null;
|
| | | // 用户已经登录
|
| | | if (!StringUtil.isNullOrEmpty(uid) && Long.parseLong(uid) > 0) {
|
| | | TBPid tbPid = null;
|
| | | if (acceptData.getPlatform().equalsIgnoreCase("android")) {
|
| | | tbPid = tbPidService.getTBPid(Long.parseLong(uid), PidUser.TYPE_FANLI_ANDROID);
|
| | | if (tbPid != null) {
|
| | | String siteId = tbPid.getPid().split("_")[2];
|
| | | String adzoneId = tbPid.getPid().split("_")[3];
|
| | | TaoBaoUnionConfig config = taoBaoUnionConfigService.getConfigByAppIdCache(siteId);
|
| | | clientTBPid = new ClientTBPid(config.getAppKey(), tbPid.getPid(), siteId, adzoneId);
|
| | | } else {
|
| | | clientTBPid = tbPidService.getAndroidDefault();
|
| | | }
|
| | |
|
| | | } else {
|
| | | tbPid = tbPidService.getTBPid(Long.parseLong(uid), PidUser.TYPE_FANLI_IOS);
|
| | | if (tbPid != null) {
|
| | | String siteId = tbPid.getPid().split("_")[2];
|
| | | String adzoneId = tbPid.getPid().split("_")[3];
|
| | | TaoBaoUnionConfig config = taoBaoUnionConfigService.getConfigByAppIdCache(siteId);
|
| | | clientTBPid = new ClientTBPid(config.getAppKey(), tbPid.getPid(), siteId, adzoneId);
|
| | | } else {
|
| | | clientTBPid = tbPidService.getIOSDefault();
|
| | | }
|
| | | }
|
| | | } else {
|
| | | if (acceptData.getPlatform().equalsIgnoreCase("android"))
|
| | | clientTBPid = tbPidService.getAndroidDefault();
|
| | | else
|
| | | clientTBPid = tbPidService.getIOSDefault();
|
| | | }
|
| | |
|
| | | TaoBaoGoodsBrief tb = null;
|
| | | try {
|
| | | tb = redisManager.getTaoBaoGoodsBrief(Long.parseLong(id));
|
| | | TaoKeAppInfo app = new TaoKeAppInfo();
|
| | | TaoBaoUnionConfig config = taoBaoUnionConfigService.getConfigByAppIdCache(clientTBPid.getSiteId());
|
| | | app.setAdzoneId(clientTBPid.getAdZoneId());
|
| | | app.setAppKey(clientTBPid.getAppKey());
|
| | | app.setAppSecret(config.getAppSecret());
|
| | | app.setPid(clientTBPid.getPid());
|
| | | tb = TaoKeApiUtil.searchGoodsDetail(Long.parseLong(id), app);
|
| | | } catch (NumberFormatException e1) {
|
| | | e1.printStackTrace();
|
| | | } catch (TaobaoGoodsDownException e1) {
|
| | | e1.printStackTrace();
|
| | | out.print(JsonUtil.loadFalseResult(2, "商品已下架"));
|
| | | return;
|
| | | }
|
| | |
|
| | | if (tb != null) {
|
| | | tb.setAuctionUrl(null);
|
| | | // tb.setAuctionUrl(null);
|
| | | tb.setId(null);
|
| | | int type = 0;
|
| | | if ("android".equalsIgnoreCase(acceptData.getPlatform()))
|
| | |
| | | Gson gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create();
|
| | | JSONObject data = new JSONObject();
|
| | | TaoBaoGoodsBriefExtra taoBaoGoodsBriefExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(tb, configList.get(0));
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(tb.getCouponLink()) && taoBaoGoodsBriefExtra.getTaoBaoQuanInfo() != null)
|
| | | taoBaoGoodsBriefExtra.getTaoBaoQuanInfo().setCouponLink(tb.getCouponLink());
|
| | | taoBaoGoodsBriefExtra.setAuctionUrl(tb.getAuctionUrl());
|
| | | if (uid != null && !"".equals(uid.trim())) {
|
| | | CollectionGoods collectionGoods = collectionGoodsService.findByUidAndAuctionId(Long.parseLong(uid),
|
| | | Long.parseLong(id));
|
| | | data.put("collection", collectionGoods != null ? true : false);
|
| | | }
|
| | |
|
| | | // 获取淘客参数
|
| | | ClientTBPid clientTBPid = null;
|
| | | // 用户已经登录
|
| | | if (!StringUtil.isNullOrEmpty(uid) && Long.parseLong(uid) > 0) {
|
| | | TBPid tbPid = null;
|
| | | if (acceptData.getPlatform().equalsIgnoreCase("android")) {
|
| | | tbPid = tbPidService.getTBPid(Long.parseLong(uid), PidUser.TYPE_FANLI_ANDROID);
|
| | | if (tbPid != null) {
|
| | | String siteId = tbPid.getPid().split("_")[2];
|
| | | String adzoneId = tbPid.getPid().split("_")[3];
|
| | | TaoBaoUnionConfig config = taoBaoUnionConfigService.getConfigByAppIdCache(siteId);
|
| | | clientTBPid = new ClientTBPid(config.getAppKey(), tbPid.getPid(), siteId, adzoneId);
|
| | | } else {
|
| | | clientTBPid = tbPidService.getAndroidDefault();
|
| | | }
|
| | |
|
| | | } else {
|
| | | tbPid = tbPidService.getTBPid(Long.parseLong(uid), PidUser.TYPE_FANLI_IOS);
|
| | | if (tbPid != null) {
|
| | |
|
| | | String siteId = tbPid.getPid().split("_")[2];
|
| | | String adzoneId = tbPid.getPid().split("_")[3];
|
| | | TaoBaoUnionConfig config = taoBaoUnionConfigService.getConfigByAppIdCache(siteId);
|
| | | clientTBPid = new ClientTBPid(config.getAppKey(), tbPid.getPid(), siteId, adzoneId);
|
| | | } else {
|
| | | clientTBPid = tbPidService.getIOSDefault();
|
| | | }
|
| | | }
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(tb.getCouponLink()) && taoBaoGoodsBriefExtra.getTaoBaoQuanInfo() != null)
|
| | | taoBaoGoodsBriefExtra.getTaoBaoQuanInfo().setCouponLink(TaoBaoCouponUtil
|
| | | .getCoupleUrl(tb.getCouponActivityId(), tbPid.getPid(), tb.getAuctionId() + ""));
|
| | |
|
| | | } else {
|
| | | if (acceptData.getPlatform().equalsIgnoreCase("android"))
|
| | | clientTBPid = tbPidService.getAndroidDefault();
|
| | | else
|
| | | clientTBPid = tbPidService.getIOSDefault();
|
| | | }
|
| | |
|
| | | data.put("tbPidInfo", clientTBPid);
|
| | |
|
| | | taoBaoGoodsBriefExtra.setAuctionUrl(null);
|
| | | // taoBaoGoodsBriefExtra.setAuctionUrl(null);
|
| | | data.put("taobao", gson.toJson(taoBaoGoodsBriefExtra));
|
| | | String info = configService.get("detail_prompt");
|
| | | data.put("info", info);
|
| | |
| | | */
|
| | | @RequestMapping(value = "getRecommendInfo")
|
| | | public void getRecommendHomeInfo(AcceptData acceptData, PrintWriter out) {
|
| | | |
| | |
|
| | | System system = systemService.getSystemCache(acceptData.getPlatform(), acceptData.getPackages());
|
| | | if (system == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "系统不存在"));
|
| | |
| | | out.print(JsonUtil.loadTrueResult(root));
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 新版推荐专题管理(1.4.0)
|
| | | *
|
| | |
| | | out.print(JsonUtil.loadFalseResult(1, "系统不存在"));
|
| | | return;
|
| | | }
|
| | | |
| | | List<SwiperPicture> listswiper = null;
|
| | |
|
| | | List<SwiperPicture> listswiper = null;
|
| | | if (!StringUtil.isNullOrEmpty(specialCard)) {
|
| | | try {
|
| | | |
| | |
|
| | | listswiper = swiperPictureService.getByBannerCard(swiperCard);
|
| | | |
| | |
|
| | | if (listswiper != null && listswiper.size() > 0) {
|
| | | for (SwiperPicture swiperPicture: listswiper) {
|
| | | for (SwiperPicture swiperPicture : listswiper) {
|
| | | swiperPicture.setBannerId(null);
|
| | | swiperPicture.setCreatetime(null);
|
| | | swiperPicture.setUpdatetime(null);
|
| | |
| | | swiperPicture.setRemark(null);
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | Special miaoShaSpecial = null;
|
| | | List<Special> honestList = new ArrayList<Special>();
|
| | | List<Special> honestList = new ArrayList<Special>();
|
| | | List<Special> specialList = new ArrayList<Special>();
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(specialCard)) {
|
| | | try {
|
| | | List<Special> listSpecial = specialService.listBySystemAndCard(specialCard, system.getId());
|
| | | |
| | |
|
| | | if (listSpecial != null && listSpecial.size() > 0) {
|
| | | for (Special special: listSpecial) {
|
| | | for (Special special : listSpecial) {
|
| | | special.setCreatetime(null);
|
| | | special.setUpdatetime(null);
|
| | | special.setState(null);
|
| | | special.setRemark(null);
|
| | | special.setCard(null);
|
| | | special.setCardId(null);
|
| | | |
| | |
|
| | | if ("限时秒杀".equals(special.getName())) {
|
| | | miaoShaSpecial = special;
|
| | | continue;
|
| | | }
|
| | | |
| | |
|
| | | if ("arc".equals(special.getShowType())) {
|
| | | // 同一行专题
|
| | | honestList.add(special);
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | |
| | |
|
| | | }
|
| | |
|
| | | /* 限时秒杀 - 时间处理 */
|
| | |
| | | break;
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | if (hour < 0)
|
| | | hour = 24;
|
| | | long time = TimeUtil.convertToTimeTemp(TimeUtil.getGernalTime(calendar.getTimeInMillis(), "yyyy-MM-dd"),
|
| | |
| | | root.put("miaoSha", msJSON);
|
| | |
|
| | | out.print(JsonUtil.loadTrueResult(root));
|
| | | |
| | |
|
| | | }
|
| | | |
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 商品基本详情 (1.4.0)
|
| | | *
|