| | |
| | | private static Map<String, Integer> invalidMap = new HashMap<>(); |
| | | |
| | | // 淘礼金创建 |
| | | public static TaoLiJinDTO createTaoLiJin(Long auctionId, String name, BigDecimal perface, int totalNum, |
| | | public static TaoLiJinDTO createTaoLiJin(String auctionId, String name, BigDecimal perface, int totalNum, |
| | | Date sendStartTime, Date sendEndTime, Date useStartTime, Date useEndTime, TaoKeAppInfo app) |
| | | throws LiJinAccountException, LiJinAmountException, LiJinException, LiJinGoodsException { |
| | | Map<String, String> map = new HashMap<>(); |
| | |
| | | |
| | | |
| | | // 裂淘礼金创建 |
| | | public static TaoLiJinDTO createLieBianTaoLiJin(Long auctionId, String name, BigDecimal perface, int totalNum, |
| | | public static TaoLiJinDTO createLieBianTaoLiJin(String auctionId, String name, BigDecimal perface, int totalNum, |
| | | Date sendStartTime, Date sendEndTime, Date useStartTime, Date useEndTime, TaoKeAppInfo app) |
| | | throws LiJinAccountException, LiJinAmountException, LiJinException, LiJinGoodsException { |
| | | Map<String, String> map = new HashMap<>(); |
| | |
| | | } |
| | | |
| | | |
| | | public static TaoBaoGoodsBrief searchGoodsDetail(Long id) throws TaoBaoGoodsDownException { |
| | | public static TaoBaoGoodsBrief searchGoodsDetail(String id) throws TaoBaoGoodsDownException { |
| | | return searchGoodsDetail(id, null, null); |
| | | } |
| | | |
| | |
| | | * @return |
| | | * @throws |
| | | */ |
| | | public static TaoBaoGoodsBrief searchGoodsDetail(Long id, String specialId, String relationId) throws TaoBaoGoodsDownException { |
| | | public static TaoBaoGoodsBrief searchGoodsDetail(String id, String specialId, String relationId) throws TaoBaoGoodsDownException { |
| | | TaoBaoGoodsBrief goods = getSimpleGoodsInfo(id); |
| | | if (goods == null) |
| | | return null; |
| | |
| | | if (result != null && result.getTaoBaoGoodsBriefs() != null) |
| | | for (TaoBaoGoodsBrief g : result.getTaoBaoGoodsBriefs()) { |
| | | System.out.println(goods.getAuctionId() + ":" + g.getAuctionId()); |
| | | if (goods.getAuctionId().longValue() == g.getAuctionId()) { |
| | | g.setId(goods.getAuctionId()); |
| | | if (TaoBaoUtil.isEqual(goods.getAuctionId(), g.getAuctionId())) { |
| | | //g.setId(goods.getAuctionId()); |
| | | g.setCreatetime(new Date()); |
| | | g.setMaterialLibType(goods.getMaterialLibType()); |
| | | g.setProvcity(goods.getProvcity()); |
| | |
| | | * @param id -商品AuctionId |
| | | * @return |
| | | */ |
| | | public static TaoBaoGoodsBrief getSimpleGoodsInfo(Long id) throws TaoBaoGoodsDownException { |
| | | public static TaoBaoGoodsBrief getSimpleGoodsInfo(String id) throws TaoBaoGoodsDownException { |
| | | Map<String, String> map = new HashMap<>(); |
| | | map.put("method", "taobao.tbk.item.info.get"); |
| | | map.put("num_iids", id + ""); |
| | |
| | | |
| | | private static TaoBaoGoodsBrief parseSimpleGoodsInfo(JSONObject item) { |
| | | TaoBaoGoodsBrief goods = new TaoBaoGoodsBrief(); |
| | | goods.setAuctionId(item.optLong("num_iid")); |
| | | goods.setAuctionId(item.optString("num_iid")); |
| | | goods.setAuctionUrl(item.optString("item_url")); |
| | | goods.setBiz30day(item.optInt("volume")); |
| | | if (item.optJSONObject("small_images") != null) { |
| | |
| | | goods.setPictUrlWhite(item.optString("white_image")); |
| | | } |
| | | |
| | | goods.setAuctionId(item.optLong("num_iid")); |
| | | goods.setAuctionId(item.optString("num_iid")); |
| | | goods.setAuctionUrl("https:" + item.optString("url")); |
| | | goods.setBiz30day(item.optInt("volume")); |
| | | goods.setCouponInfo(item.optString("coupon_info")); |
| | |
| | | Date useEndTime = sendEndTime; |
| | | |
| | | try { |
| | | createLieBianTaoLiJin(auctionId, name, perface, totalNum, |
| | | createLieBianTaoLiJin(auctionId+"", name, perface, totalNum, |
| | | sendStartTime, sendEndTime, useStartTime, useEndTime, app); |
| | | } catch (LiJinAccountException e) { |
| | | e.printStackTrace(); |