| | |
| | |
|
| | | }
|
| | |
|
| | | /**
|
| | | * 淘口令转商品ID
|
| | | * |
| | | * @param token
|
| | | * @return
|
| | | */
|
| | | public static Long tokenConvertAuctionId(String token) {
|
| | | Map<String, String> map = new HashMap<>();
|
| | | map.put("method", "taobao.tbk.tpwd.convert");
|
| | | map.put("password_content", token);
|
| | | map.put("adzone_id", TaoBaoConstant.TAOBAO_SPECIAL_PID_DEFAULT.split("_")[3]);
|
| | | TaoKeAppInfo app = new TaoKeAppInfo();
|
| | | app.setAppKey(TaoBaoConstant.TAOBAO_AUTH_APPKEY);
|
| | | app.setAppSecret(TaoBaoConstant.TAOBAO_AUTH_APPSECRET);
|
| | | try {
|
| | | JSONObject json = TaoKeBaseUtil.baseRequest(map, app);
|
| | | try {
|
| | | return json.optJSONObject("tbk_tpwd_convert_response").optJSONObject("data").optLong("num_iid");
|
| | | } catch (Exception e) {
|
| | | return null;
|
| | | }
|
| | |
|
| | | } catch (TaoKeApiException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | return null;
|
| | | }
|
| | |
|
| | | // 淘礼金创建
|
| | | public static TaoLiJinDTO createTaoLiJin(Long auctionId, String name, BigDecimal perface, int totalNum,
|
| | | Date sendStartTime, Date sendEndTime, Date useStartTime, Date useEndTime,TaoKeAppInfo app) throws TaoKeApiException{
|
| | | Date sendStartTime, Date sendEndTime, Date useStartTime, Date useEndTime, TaoKeAppInfo app)
|
| | | throws TaoKeApiException {
|
| | | Map<String, String> map = new HashMap<>();
|
| | | map.put("method", "taobao.tbk.dg.vegas.tlj.create");
|
| | | map.put("adzone_id", app.getPid().split("_")[3]);
|
| | |
| | | map.put("security_switch", "false");
|
| | | map.put("per_face", perface.toString());
|
| | | map.put("send_start_time", TimeUtil.getGernalTime(sendStartTime.getTime(), "yyyy-MM-dd HH:mm:ss"));
|
| | | |
| | |
|
| | | if(sendEndTime != null)
|
| | | map.put("send_end_time", TimeUtil.getGernalTime(sendEndTime.getTime(), "yyyy-MM-dd HH:mm:ss"));
|
| | |
| | | return null;
|
| | | }
|
| | |
|
| | |
|
| | | // 淘礼金报告
|
| | | public static UserTaoLiJinReport getTaoLiJinEffective(String rightsId) {
|
| | | Map<String, String> map = new HashMap<>();
|
| | |
| | | System.out.println(json);
|
| | |
|
| | | JSONObject root = json.optJSONObject("tbk_dg_vegas_tlj_instance_report_response");
|
| | | |
| | |
|
| | | if (root != null && root.optJSONObject("result") != null) {
|
| | | if (root.optJSONObject("result").optBoolean("success")) {
|