@yunzhanghu/sdk-nodejs 1.0.14 → 1.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -223,3 +223,64 @@ dataService
223
223
  // 发生异常
224
224
  console.log(err.toString())
225
225
  })
226
+
227
+ // 查询日订单汇总数据
228
+ dataService
229
+ .ListDailyOrderSummary({
230
+
231
+ /**
232
+ * @param {string} request-id:请求 ID,请求的唯一标识
233
+ * 建议平台企业自定义 request-id,并记录在日志中,便于问题发现及排查
234
+ * 如未自定义 request-id,将使用 SDK 中的 UUID 方法自动生成。注意:UUID 方法生成的 request-id 不能保证全局唯一,推荐自定义 request-id
235
+ */
236
+ request_id: 'requestIdExample123456789',
237
+ dealer_id: config.dealer_id,
238
+ broker_id: config.broker_id,
239
+ channel: "支付宝",
240
+ begin_at: "2025-02-01",
241
+ end_at: "2025-02-07",
242
+ filter_type: "apply"
243
+ })
244
+ .then((data) => {
245
+ if (data.code === '0000') {
246
+ // 操作成功
247
+ console.log('操作成功 ', JSON.stringify(data, null, 2))
248
+ } else {
249
+ // 失败返回
250
+ console.log('失败返回 ', 'code:' + data.code + ' message:' + data.message + ' request_id:' + data.request_id)
251
+ }
252
+ })
253
+ .catch((err) => {
254
+ // 发生异常
255
+ console.log(err.toString())
256
+ })
257
+
258
+ // 查询月订单汇总数据
259
+ dataService
260
+ .ListMonthlyOrderSummary({
261
+
262
+ /**
263
+ * @param {string} request-id:请求 ID,请求的唯一标识
264
+ * 建议平台企业自定义 request-id,并记录在日志中,便于问题发现及排查
265
+ * 如未自定义 request-id,将使用 SDK 中的 UUID 方法自动生成。注意:UUID 方法生成的 request-id 不能保证全局唯一,推荐自定义 request-id
266
+ */
267
+ request_id: 'requestIdExample123456789',
268
+ dealer_id: config.dealer_id,
269
+ broker_id: config.broker_id,
270
+ channel: "银行卡",
271
+ month: "2025-01",
272
+ filter_type: "apply"
273
+ })
274
+ .then((data) => {
275
+ if (data.code === '0000') {
276
+ // 操作成功
277
+ console.log('操作成功 ', JSON.stringify(data, null, 2))
278
+ } else {
279
+ // 失败返回
280
+ console.log('失败返回 ', 'code:' + data.code + ' message:' + data.message + ' request_id:' + data.request_id)
281
+ }
282
+ })
283
+ .catch((err) => {
284
+ // 发生异常
285
+ console.log(err.toString())
286
+ })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yunzhanghu/sdk-nodejs",
3
- "version": "1.0.14",
3
+ "version": "1.0.15",
4
4
  "description": "云账户 SDK for Node.js",
5
5
  "main": "yzh/index.js",
6
6
  "scripts": {
@@ -318,6 +318,102 @@ interface StatementDetail {
318
318
  project_name: string;
319
319
  }
320
320
 
321
+ /** ListDailyOrderSummaryRequest 查询日订单汇总数据请求 */
322
+ interface ListDailyOrderSummaryRequest {
323
+ /** 综合服务主体 ID */
324
+ broker_id: string;
325
+ /** 平台企业 ID */
326
+ dealer_id: string;
327
+ /** 支付路径,银行卡、支付宝、微信 */
328
+ channel: string;
329
+ /** 订单查询开始日期,格式:yyyy-MM-dd */
330
+ begin_at: string;
331
+ /** 订单查询结束日期,格式:yyyy-MM-dd */
332
+ end_at: string;
333
+ /** 筛选类型,apply:按订单创建时间汇总 complete:按订单完成时间汇总 */
334
+ filter_type: string;
335
+ }
336
+
337
+ /** ListDailyOrderSummaryResponse 查询日订单汇总数据返回 */
338
+ interface ListDailyOrderSummaryResponse {
339
+ /** 汇总数据列表 */
340
+ summary_list: ListDailyOrderSummary[];
341
+ }
342
+
343
+ /** ListDailyOrderSummary 日订单汇总数据详情 */
344
+ interface ListDailyOrderSummary {
345
+ /** 订单查询日期,格式:yyyy-MM-dd */
346
+ date: string;
347
+ /** 成功订单汇总 */
348
+ success: DailyOrderSummary;
349
+ /** 处理中订单汇总 */
350
+ processing: DailyOrderSummary;
351
+ /** 失败订单汇总 */
352
+ failed: DailyOrderSummary;
353
+ }
354
+
355
+ /** DailyOrderSummary 日订单汇总详情 */
356
+ interface DailyOrderSummary {
357
+ /** 订单数量 */
358
+ order_num: number;
359
+ /** 订单金额 */
360
+ pay: string;
361
+ /** 加成服务费金额 */
362
+ broker_fee: string;
363
+ /** 加成服务费实收金额 */
364
+ broker_real_fee: string;
365
+ /** 已抵扣加成服务费金额 */
366
+ broker_rebate_fee: string;
367
+ /** 用户加成服务费金额 */
368
+ user_fee: string;
369
+ }
370
+
371
+ /** ListMonthlyOrderSummaryRequest 查询月订单汇总数据请求 */
372
+ interface ListMonthlyOrderSummaryRequest {
373
+ /** 综合服务主体 ID */
374
+ broker_id: string;
375
+ /** 平台企业 ID */
376
+ dealer_id: string;
377
+ /** 支付路径,银行卡、支付宝、微信 */
378
+ channel: string;
379
+ /** 汇总月份,格式:yyyy-MM */
380
+ month: string;
381
+ /** 筛选类型,apply:按订单创建时间汇总 complete:按订单完成时间汇总 */
382
+ filter_type: string;
383
+ }
384
+
385
+ /** ListMonthlyOrderSummaryResponse 查询月订单汇总数据返回 */
386
+ interface ListMonthlyOrderSummaryResponse {
387
+ /** 汇总数据列表 */
388
+ summary: ListMonthlyOrderSummary;
389
+ }
390
+
391
+ /** ListMonthlyOrderSummary 月订单汇总数据详情 */
392
+ interface ListMonthlyOrderSummary {
393
+ /** 成功订单汇总 */
394
+ success: MonthlyOrderSummary;
395
+ /** 处理中订单汇总 */
396
+ processing: MonthlyOrderSummary;
397
+ /** 失败订单汇总 */
398
+ failed: MonthlyOrderSummary;
399
+ }
400
+
401
+ /** MonthlyOrderSummary 月订单汇总详情 */
402
+ interface MonthlyOrderSummary {
403
+ /** 订单数量 */
404
+ order_num: number;
405
+ /** 订单金额 */
406
+ pay: string;
407
+ /** 加成服务费金额 */
408
+ broker_fee: string;
409
+ /** 加成服务费实收金额 */
410
+ broker_real_fee: string;
411
+ /** 已抵扣加成服务费金额 */
412
+ broker_rebate_fee: string;
413
+ /** 用户加成服务费金额 */
414
+ user_fee: string;
415
+ }
416
+
321
417
  export class DataServiceClient extends YZHclient {
322
418
  // eslint-disable-next-line no-useless-constructor
323
419
  constructor(conf: {
@@ -415,4 +511,20 @@ export class DataServiceClient extends YZHclient {
415
511
  ): Promise<ListBalanceDailyStatementResponse> {
416
512
  return this.request('get', '/api/dataservice/v1/statements-daily', req, { encryption: false }, cb);
417
513
  }
514
+
515
+ // ListDailyOrderSummary 查询日订单汇总数据
516
+ async ListDailyOrderSummary(
517
+ req: ListDailyOrderSummaryRequest,
518
+ cb?: (error: null | string, rep: ListDailyOrderSummaryResponse) => void
519
+ ): Promise<ListDailyOrderSummaryResponse> {
520
+ return this.request('get', '/api/dataservice/v2/order/daily-summary', req, { encryption: false }, cb);
521
+ }
522
+
523
+ // ListMonthlyOrderSummary 查询月订单汇总数据
524
+ async ListMonthlyOrderSummary(
525
+ req: ListMonthlyOrderSummaryRequest,
526
+ cb?: (error: null | string, rep: ListMonthlyOrderSummaryResponse) => void
527
+ ): Promise<ListMonthlyOrderSummaryResponse> {
528
+ return this.request('get', '/api/dataservice/v2/order/monthly-summary', req, { encryption: false }, cb);
529
+ }
418
530
  }
@@ -317,6 +317,102 @@ interface StatementDetail {
317
317
  project_name: string;
318
318
  }
319
319
 
320
+ /** ListDailyOrderSummaryRequest 查询日订单汇总数据请求 */
321
+ interface ListDailyOrderSummaryRequest {
322
+ /** 综合服务主体 ID */
323
+ broker_id: string;
324
+ /** 平台企业 ID */
325
+ dealer_id: string;
326
+ /** 支付路径,银行卡、支付宝、微信 */
327
+ channel: string;
328
+ /** 订单查询开始日期,格式:yyyy-MM-dd */
329
+ begin_at: string;
330
+ /** 订单查询结束日期,格式:yyyy-MM-dd */
331
+ end_at: string;
332
+ /** 筛选类型,apply:按订单创建时间汇总 complete:按订单完成时间汇总 */
333
+ filter_type: string;
334
+ }
335
+
336
+ /** ListDailyOrderSummaryResponse 查询日订单汇总数据返回 */
337
+ interface ListDailyOrderSummaryResponse {
338
+ /** 汇总数据列表 */
339
+ summary_list: ListDailyOrderSummary[];
340
+ }
341
+
342
+ /** ListDailyOrderSummary 日订单汇总数据详情 */
343
+ interface ListDailyOrderSummary {
344
+ /** 订单查询日期,格式:yyyy-MM-dd */
345
+ date: string;
346
+ /** 成功订单汇总 */
347
+ success: DailyOrderSummary;
348
+ /** 处理中订单汇总 */
349
+ processing: DailyOrderSummary;
350
+ /** 失败订单汇总 */
351
+ failed: DailyOrderSummary;
352
+ }
353
+
354
+ /** DailyOrderSummary 日订单汇总详情 */
355
+ interface DailyOrderSummary {
356
+ /** 订单数量 */
357
+ order_num: number;
358
+ /** 订单金额 */
359
+ pay: string;
360
+ /** 加成服务费金额 */
361
+ broker_fee: string;
362
+ /** 加成服务费实收金额 */
363
+ broker_real_fee: string;
364
+ /** 已抵扣加成服务费金额 */
365
+ broker_rebate_fee: string;
366
+ /** 用户加成服务费金额 */
367
+ user_fee: string;
368
+ }
369
+
370
+ /** ListMonthlyOrderSummaryRequest 查询月订单汇总数据请求 */
371
+ interface ListMonthlyOrderSummaryRequest {
372
+ /** 综合服务主体 ID */
373
+ broker_id: string;
374
+ /** 平台企业 ID */
375
+ dealer_id: string;
376
+ /** 支付路径,银行卡、支付宝、微信 */
377
+ channel: string;
378
+ /** 汇总月份,格式:yyyy-MM */
379
+ month: string;
380
+ /** 筛选类型,apply:按订单创建时间汇总 complete:按订单完成时间汇总 */
381
+ filter_type: string;
382
+ }
383
+
384
+ /** ListMonthlyOrderSummaryResponse 查询月订单汇总数据返回 */
385
+ interface ListMonthlyOrderSummaryResponse {
386
+ /** 汇总数据列表 */
387
+ summary: ListMonthlyOrderSummary;
388
+ }
389
+
390
+ /** ListMonthlyOrderSummary 月订单汇总数据详情 */
391
+ interface ListMonthlyOrderSummary {
392
+ /** 成功订单汇总 */
393
+ success: MonthlyOrderSummary;
394
+ /** 处理中订单汇总 */
395
+ processing: MonthlyOrderSummary;
396
+ /** 失败订单汇总 */
397
+ failed: MonthlyOrderSummary;
398
+ }
399
+
400
+ /** MonthlyOrderSummary 月订单汇总详情 */
401
+ interface MonthlyOrderSummary {
402
+ /** 订单数量 */
403
+ order_num: number;
404
+ /** 订单金额 */
405
+ pay: string;
406
+ /** 加成服务费金额 */
407
+ broker_fee: string;
408
+ /** 加成服务费实收金额 */
409
+ broker_real_fee: string;
410
+ /** 已抵扣加成服务费金额 */
411
+ broker_rebate_fee: string;
412
+ /** 用户加成服务费金额 */
413
+ user_fee: string;
414
+ }
415
+
320
416
  export declare class DataServiceClient extends YZHclient {
321
417
  constructor(conf: {
322
418
  dealer_id: string;
@@ -361,6 +457,14 @@ export declare class DataServiceClient extends YZHclient {
361
457
  req: ListBalanceDailyStatementRequest,
362
458
  cb?: (error: null | string, rep: ListBalanceDailyStatementResponse) => void
363
459
  ): Promise<ListBalanceDailyStatementResponse>;
460
+ ListDailyOrderSummary(
461
+ req: ListDailyOrderSummaryRequest,
462
+ cb?: (error: null | string, rep: ListDailyOrderSummaryResponse) => void
463
+ ): Promise<ListDailyOrderSummaryResponse>;
464
+ ListMonthlyOrderSummary(
465
+ req: ListMonthlyOrderSummaryRequest,
466
+ cb?: (error: null | string, rep: ListMonthlyOrderSummaryResponse) => void
467
+ ): Promise<ListMonthlyOrderSummaryResponse>;
364
468
  }
365
469
 
366
470
  export {};
@@ -57,5 +57,13 @@ class DataServiceClient extends client_1.default {
57
57
  async ListBalanceDailyStatement(req, cb) {
58
58
  return this.request('get', '/api/dataservice/v1/statements-daily', req, { encryption: false }, cb);
59
59
  }
60
+ // ListDailyOrderSummary 查询日订单汇总数据
61
+ async ListDailyOrderSummary(req, cb) {
62
+ return this.request('get', '/api/dataservice/v2/order/daily-summary', req, { encryption: false }, cb);
63
+ }
64
+ // ListMonthlyOrderSummary 查询月订单汇总数据
65
+ async ListMonthlyOrderSummary(req, cb) {
66
+ return this.request('get', '/api/dataservice/v2/order/monthly-summary', req, { encryption: false }, cb);
67
+ }
60
68
  }
61
69
  exports.DataServiceClient = DataServiceClient;