有赞新零售社区

发帖
API使用问题»急急急,报错es查询服务化请求异常

急急急,报错es查询服务化请求异常

adnap7 2019-06-05 3126 浏览 17 评论 | 只看楼主 [打印]

我调用有赞sdk订单管理api里面的youzan.trades.sold.get做测试时,发生了上图异常com.youzan.open.sdk.exception.kdtexception:errorresponse{code="106100118",msg="es查询服务化请求异常‘}。错误地方在124行,class resultmodelclass=api.getresultmodelClass();


我封装的youzan接口
  1. //订单列表4.0接口
  2.         public List<YouzanTradesSoldGetResult.StructurizationTrade> getTrades(YouzanTradesSoldGetParams youzanTradesSoldGetParams,YZClient client) {
  3.                 long pageNo=1;
  4.                 long pageSize=100L;
  5.                 long totalPage=0L;
  6.                 List list=new ArrayList<>();
  7.                 YouzanTradesSoldGetResult result =null;
  8.                 do {
  9.                         youzanTradesSoldGetParams.setPageNo(Long.valueOf(pageNo));
  10.                         youzanTradesSoldGetParams.setPageSize(Long.valueOf(pageSize));
  11.                         YouzanTradesSoldGet youzanTradesSoldGet = new YouzanTradesSoldGet();
  12.                         youzanTradesSoldGet.setAPIParams(youzanTradesSoldGetParams);
  13.                         result=client.invoke(youzanTradesSoldGet);
  14.                         list.addAll(Arrays.asList(result.getFullOrderInfoList()));
  15.                         totalPage=(result.getTotalResults().longValue()+pageSize -1L)/pageSize;
  16.                         pageNo+=1L;
  17.                 }while(pageNo <= totalPage&&pageNo<=100);
  18.                
  19. //                StructurizationTrade[] array=result.getFullOrderInfoList();
  20. //                for(StructurizationTrade item:array) {
  21. //                        list.add(item);
  22. //                }
  23.                 return list;
  24.         }
复制代码
测试的方法:
  1. public static void youzanTradesSoldGet(){
  2.                 YouZanOrderClient yzTClient=new YouZanOrderClient();
  3.                 YouZanClient yzClient = new YouZanClient("***********此处是token");
  4.                 YZClient client = yzClient.getClient();
  5.                
  6.                 YouzanTradesSoldGetParams youzanTradesSoldGetParams=new YouzanTradesSoldGetParams();
  7. //                youzanTradesSoldGetParams.setBuyerId(21345564332545L);
  8.                 List<YouzanTradesSoldGetResult.StructurizationTrade> list=yzTClient.getTrades(youzanTradesSoldGetParams, client);
  9.                 for(YouzanTradesSoldGetResult.StructurizationTrade item:list){
  10.                         System.out.println(item.getFullOrderInfo().getOrderInfo().getTid());
  11. //                        System.out.println("自提地址:"+item.getFullOrderInfo().getAddressInfo().getSelfFetchInfo()+"\n");
  12.                 }
  13.         }
复制代码


用手机打开
收藏 ··· 回复
    您是什么类型的应用?
    自用型应用,如果token过期了(7天有效期),过期要重新刷新新的token;
    工具型应用,如果token过期了(7天有效期),需要用refreash_token重新换取新的token
    注意:
    需要自己程序对token的过期时间做判断
    有赞-技术支持

      adnap7 青铜   2019-06-07 | 只看该作者
      有赞-妮子 发表于 2019-6-6 14:08
      您是什么类型的应用?
      自用型应用,如果token过期了(7天有效期),过期要重新刷新新的token;
      工具型应用 ...


      重新获取token了。之前调用订单api还好好地, 现在报异常com.youzan.open.sdk.exception.KDTException: ErrorResponse{code='5000', msg='订单列表查询失败,错误信息:订单状态查询参数错误'},问题应该不是我参数弄错了,因为上午调还没事

        有赞-技术支持

          adnap7 青铜   2019-06-07 | 只看该作者
          有赞-妮子 发表于 2019-6-6 18:09
          该报错,建议您仔细检查入参
          https://doc.youzanyun.com/doc#/content/API/1-305/detail/api/0/157 ...


          我想问一下,订单状态有没有ALL_WAIT_PAY 全部这样查询所有类型的选项呢,一次只能查一种状态的吗,

            如果您想查询全部的话,可以不要选择状态,就会默认拉取全部状态的订单
            有赞-技术支持

              adnap7 青铜   2019-06-11 | 只看该作者
              有赞-妮子 发表于 2019-6-10 10:14
              如果您想查询全部的话,可以不要选择状态,就会默认拉取全部状态的订单


              tradessoldget api里面,full_order_info->buyer_info->fans_nick_name和full_order_info->order_info->order_extra->buyer_name哪个适合当作买家昵称字段?

                买家昵称也就是下单人昵称,buyer_name
                有赞-技术支持

                  12跳至
                  您需要登录后才可以回帖 登录 | 立即注册

                  本版积分规则

                  复制链接
                  新浪微博
                  QQ空间
                  微信扫码
                  • 回复

                  • 评分

                  客服工作时间是9:00-18:00,客服妹子当前不在线,若不能及时回复请谅解。试试右上角的搜索吧,论坛有丰富的经验贴、公告贴,相信一定能够帮到您~

                  复制成功