From be0653a6f2f7801c7e3e6692bf392cf4a524cf55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BD=98=E6=99=93=E4=BA=91?= Date: Sat, 2 Apr 2022 17:53:59 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=AF=B9=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../upload-setting.component.ts | 37 ++++++++++--------- .../reporting/services/reporting.service.ts | 4 +- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/src/app/routes/datatable/reporting/components/upload-setting/upload-setting.component.ts b/src/app/routes/datatable/reporting/components/upload-setting/upload-setting.component.ts index b9f2d909..0258f230 100644 --- a/src/app/routes/datatable/reporting/components/upload-setting/upload-setting.component.ts +++ b/src/app/routes/datatable/reporting/components/upload-setting/upload-setting.component.ts @@ -1,5 +1,5 @@ -import { Component, OnInit } from '@angular/core'; -import { SFSchema, SFUISchema } from '@delon/form'; +import { Component, OnInit, ViewChild } from '@angular/core'; +import { SFComponent, SFSchema, SFUISchema } from '@delon/form'; import { NzModalRef } from 'ng-zorro-antd/modal'; import { ReportingService } from '../../services/reporting.service'; @@ -8,8 +8,9 @@ import { ReportingService } from '../../services/reporting.service'; templateUrl: './upload-setting.component.html', }) export class DatatableReportingUploadSettingComponent implements OnInit { + @ViewChild('sf', { static: false }) sf!: SFComponent; record: any = {}; - i: any = {}; + i: any; schema!: SFSchema; ui!: SFUISchema; @@ -20,7 +21,7 @@ export class DatatableReportingUploadSettingComponent implements OnInit { ngOnInit(): void { this.initSF(); - // this.loadData(); + this.loadData(); } /** @@ -29,17 +30,17 @@ export class DatatableReportingUploadSettingComponent implements OnInit { initSF() { this.schema = { properties: { - no: { + orderPushType: { type: 'string', title: '订单数据', enum: [ { label: '手动上传', - value: '1' + value: 1 }, { label: '自动上传', - value: '2' + value: 2 } ], description: '开启自动上传后,订单将在支付完成且风险单校验通过后自动上传', @@ -48,17 +49,17 @@ export class DatatableReportingUploadSettingComponent implements OnInit { } }, - owner: { + capitalPushType: { type: 'string', title: '资金数据', enum: [ { label: '手动上传', - value: '1' + value: 1 }, { label: '自动上传', - value: '2' + value: 2 } ], description: '开启自动上传后,订单将在支付完成且风险单校验通过后自动上传', @@ -68,7 +69,7 @@ export class DatatableReportingUploadSettingComponent implements OnInit { } }, }, - required: ['owner', 'no'], + required: ['orderPushType', 'capitalPushType'], } this.ui = { '*': { @@ -85,7 +86,6 @@ export class DatatableReportingUploadSettingComponent implements OnInit { this.service.request(this.service.$api_get_upload_setting, {}).subscribe(res => { if (res) { this.i = res; - } }) } @@ -95,12 +95,13 @@ export class DatatableReportingUploadSettingComponent implements OnInit { * @param value */ save(value: any): void { - this.service.request(this.service.$api_upload_setting_save, { ...value }).subscribe(res => { - if (res) { - this.service.msgSrv.success('保存成功'); - this.modal.close(true); - } - }) + if (this.sf?.valid) + this.service.request(this.service.$api_upload_setting_save, { ...value }).subscribe(res => { + if (res) { + this.service.msgSrv.success('保存成功'); + this.modal.close(true); + } + }) } close(): void { diff --git a/src/app/routes/datatable/reporting/services/reporting.service.ts b/src/app/routes/datatable/reporting/services/reporting.service.ts index 4f0ebcd3..d01c6812 100644 --- a/src/app/routes/datatable/reporting/services/reporting.service.ts +++ b/src/app/routes/datatable/reporting/services/reporting.service.ts @@ -9,8 +9,8 @@ export class ReportingService extends BaseService { $api_get_order_reporting_page = `/api/sdc/regulation/list/page`; // 订单上报列表 $api_recall_reporting = ``; // 撤回 $api_async_export_order_reporting_list = ``; // 导出订单上报 - $api_get_upload_setting = ``; // 修改上传设置 - $api_upload_setting_save = ``; // 修改上传设置 + $api_get_upload_setting = `/api/sdc/regulation/getPushConfig`; // 获取上传设置 + $api_upload_setting_save = `/api/sdc/regulation/setPushConfig`; // 保存上传设置 $api_get_fund_reporting_page = `/api/fcc/fundUploadHead/list/page`; // 资金上报列表 $api_fund_reporting_upload = `/api/fcc/fundUploadHead/uploadFundNumber`; // 资金批量上传 From ddd3b7167b4ecee1b453eef04e13edd9ba0f44d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BD=98=E6=99=93=E4=BA=91?= Date: Sat, 2 Apr 2022 17:59:38 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/order-reporting/order-reporting.component.ts | 6 ++++-- .../datatable/reporting/services/reporting.service.ts | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/app/routes/datatable/reporting/components/order-reporting/order-reporting.component.ts b/src/app/routes/datatable/reporting/components/order-reporting/order-reporting.component.ts index 43cc4b2a..54ab6360 100644 --- a/src/app/routes/datatable/reporting/components/order-reporting/order-reporting.component.ts +++ b/src/app/routes/datatable/reporting/components/order-reporting/order-reporting.component.ts @@ -352,7 +352,8 @@ export class DatatableOrderReportingComponent implements OnInit { nzOkText: '确定', nzCancelText: '取消', nzOnOk: () => { - this.service.request(this.service.$api_recall_reporting, { rows: this.selectedRows }).subscribe((res: any) => { + const ids = this.selectedRows.map(i => i?.id); + this.service.request(this.service.$api_recall_order_reporting, ids).subscribe((res: any) => { if (res) { this.service.msgSrv.success('撤销成功'); this.search(); @@ -409,7 +410,8 @@ export class DatatableOrderReportingComponent implements OnInit { this.openWainingModal('请选择需要上传的数据'); return; } - this.service.request(this.service.$api_recall_reporting, { rows: this.selectedRows }).subscribe((res: any) => { + const ids = this.selectedRows.map(i => i?.id); + this.service.request(this.service.$api_upload_order_reporting, ids).subscribe((res: any) => { if (res) { this.service.msgSrv.success('上传成功'); this.search(); diff --git a/src/app/routes/datatable/reporting/services/reporting.service.ts b/src/app/routes/datatable/reporting/services/reporting.service.ts index d01c6812..1cf31e76 100644 --- a/src/app/routes/datatable/reporting/services/reporting.service.ts +++ b/src/app/routes/datatable/reporting/services/reporting.service.ts @@ -7,7 +7,8 @@ import { BaseService } from '@shared'; export class ReportingService extends BaseService { $api_get_order_reporting_page = `/api/sdc/regulation/list/page`; // 订单上报列表 - $api_recall_reporting = ``; // 撤回 + $api_upload_order_reporting = `/api/sdc/regulation/push`; // 上传订单上报 + $api_recall_order_reporting = `/api/sdc/regulation/withdraw`; // 撤回上传订单上报 $api_async_export_order_reporting_list = ``; // 导出订单上报 $api_get_upload_setting = `/api/sdc/regulation/getPushConfig`; // 获取上传设置 $api_upload_setting_save = `/api/sdc/regulation/setPushConfig`; // 保存上传设置