From e4162b166cfa332ac643cd139da00a3df4727987 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Tue, 15 Aug 2023 11:16:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../trade-checking-detail.component.html | 218 ++++++++++-------- .../trade-checking-detail.component.ts | 44 +++- .../trade-checking.component.html | 190 ++++++++------- .../trade-checking.component.ts | 34 ++- src/app/app-common.module.ts | 4 +- src/app/pipes/trade-order/settle-type.pipe.ts | 17 ++ src/app/services/trade-checking.service.ts | 32 +++ src/environments/environment.ts | 4 +- 8 files changed, 349 insertions(+), 194 deletions(-) create mode 100644 src/app/pipes/trade-order/settle-type.pipe.ts diff --git a/src/app/admin/trade-checking/trade-checking-detail/trade-checking-detail.component.html b/src/app/admin/trade-checking/trade-checking-detail/trade-checking-detail.component.html index 6323992..e7cd1b2 100644 --- a/src/app/admin/trade-checking/trade-checking-detail/trade-checking-detail.component.html +++ b/src/app/admin/trade-checking/trade-checking-detail/trade-checking-detail.component.html @@ -2,98 +2,134 @@ + +
+
+
+
+ + 商户号 + + + + + + +
-
- -
-
- - 商户号 - - - - - - -
+
+ + 清算起始日期 + + + + +
-
- - 清算起始日期 - - - - -
+
+ + 清算终止日期 + + + + +
-
- - 清算终止日期 - - - - -
-
+
+ + 商户交易号 + + + + +
-
-
- - +
+ + 渠道交易号 + + + + +
-
- -
-
-
-

- 汇总: - 笔数 {{dataObject.totalTradeNum}}、 - 交易金额 {{dataObject.totalTradeAmount}} 元、 - 手续费 {{dataObject.totalShdFeeAmount}} 元、 - 应结算金额 {{dataObject.totalSettleAmount}} 元 - -

-
- - - - - 清算日期 - 商户号 - 商户名称 - 交易金额 - 清算金额 - 手续费 - 交易笔数 - - - - - - {{data.settleDay}} - {{data.merNo}} - {{data.merName}} - {{data.tradeAmount}} - {{data.settleAmount}} - {{data.shdFeeAmount}} - {{data.tradeNum}} - - - - -
+
+
+ + +
+
+ +
+
+
+

+ 汇总: + 笔数 {{dataObject.totalTradeNum}}、 + 交易金额 {{dataObject.totalTradeAmount}} 元、 + 手续费 {{dataObject.totalShdFeeAmount}} 元、 + 应结算金额 {{dataObject.totalSettleAmount}} 元 + +

+
+ + + + + 序号 + 商户号 + 商户名称 + 交易时间 + 交易金额 + 交易手续费 + 应结算金额 + 交易类型 + 支付渠道 + 商户交易号 + 渠道交易号 + 清算日期 + 手续费率 + 原商户交易号 + + + + + + {{i + 1}} + {{data.merNo}} + {{data.merName}} + {{data.tradeTime | date:'yyyy-MM-dd HH:mm:ss'}} + {{data.tradeType == 2?'-'+data.tradeAmount : data.tradeAmount}} + {{data.tradeType == 2?'-'+data.shdFeeAmt : data.shdFeeAmt}} + {{data.tradeType == 2?'-'+data.settleAmount : data.settleAmount}} + {{data.tradeType | settleType }} + {{data.payMode | payMode}} + {{data.outTradeNo}} + {{data.accTradeNo}} + {{data.settleDate | date:'yyyy-MM-dd'}} + {{data.feeRate + '%'}} + {{data.orgOutTradeNo}} + + + + +
+ @@ -121,7 +157,7 @@ - +
--> diff --git a/src/app/admin/trade-checking/trade-checking-detail/trade-checking-detail.component.ts b/src/app/admin/trade-checking/trade-checking-detail/trade-checking-detail.component.ts index 6665d1b..a23b967 100644 --- a/src/app/admin/trade-checking/trade-checking-detail/trade-checking-detail.component.ts +++ b/src/app/admin/trade-checking/trade-checking-detail/trade-checking-detail.component.ts @@ -5,6 +5,7 @@ import {PlatformService} from '../../../services/platform.service'; import {MerService} from '../../../services/mer.service'; import {TradeCheckingService} from '../../../services/trade-checking.service'; import differenceInCalendarDays from 'date-fns/differenceInCalendarDays'; +import {environment} from '../../../../environments/environment'; @Component({ selector: 'app-trade-checking-detail', @@ -14,20 +15,25 @@ import differenceInCalendarDays from 'date-fns/differenceInCalendarDays'; export class TradeCheckingDetailComponent implements OnInit { tableLoading = true; searchForm: FormGroup; - pageNum: number; + pageNum = 1; + pageSize = 10; whereObject: any = {}; - merArray = []; - + loadingObject = { + spinning: false, + msg: '处理中' + }; dataObject = { totalTradeNum: 0, totalTradeAmount: 0, totalSettleAmount: 0, totalShdFeeAmount: 0, - settleDetailList: [] + settleDetailList: { + total: 0, + list: [] + } }; dataDetailModal = false; - dataDetailObject = false; currentDate = new Date(); constructor(private modal: NzModalService, private message: NzMessageService, @@ -41,6 +47,8 @@ export class TradeCheckingDetailComponent implements OnInit { this.currentDate.setDate(this.currentDate.getDate() - 1); this.searchForm = this.form.group({ merNo: [null], + outTradeNo: [null], + accTradeNo: [null], settleTimeS: [ this.currentDate.getTime() ], settleTimeE: [ this.currentDate.getTime() ], }); @@ -49,7 +57,7 @@ export class TradeCheckingDetailComponent implements OnInit { this.merArray = data['return_data']['list']; if (this.merArray.length > 0) { this.searchForm.controls['merNo'].setValue(this.merArray[0]['merNo']); - this.requestData(); + this.requestData(this.pageNum, this.pageSize); } }); } @@ -57,8 +65,12 @@ export class TradeCheckingDetailComponent implements OnInit { /** * 请求数据 */ - requestData() { + requestData(pageNum: number, pageSize: number) { this.tableLoading = true; + this.pageNum = pageNum; + this.pageSize = pageSize; + this.searchForm.value['pageNum'] = pageNum; + this.searchForm.value['pageSize'] = pageSize; this.tradeCheckingService.queryCheckingDetail(this.searchForm.value, data => { if (data['return_code'] === '000000') { this.dataObject = data['return_data']; @@ -80,7 +92,7 @@ export class TradeCheckingDetailComponent implements OnInit { whereObject['settleTimeS'] = new Date(whereObject['settleTimeS']).getTime(); whereObject['settleTimeE'] = new Date(whereObject['settleTimeE']).getTime(); this.whereObject = whereObject; - this.requestData(); + this.requestData(1, 10); } /** @@ -93,6 +105,22 @@ export class TradeCheckingDetailComponent implements OnInit { this.searchForm.controls['settleTimeE'].setValue(this.currentDate.getTime()); } + download() { + this.loadingObject.spinning = true; + this.loadingObject.msg = '处理中...'; + this.tradeCheckingService.exportCheckingDetail(this.searchForm.value, data => { + if (data['return_code'] === '000000') { + window.location.href = environment.imageUrl + data['return_data']; + } else { + this.modal.error({ + nzTitle: '提示', + nzContent: data['return_msg'] + }); + } + this.loadingObject.spinning = false; + }); + } + showDetailModal(settleDay: string) { this.dataDetailModal = true; } diff --git a/src/app/admin/trade-checking/trade-checking/trade-checking.component.html b/src/app/admin/trade-checking/trade-checking/trade-checking.component.html index f791352..aec920a 100644 --- a/src/app/admin/trade-checking/trade-checking/trade-checking.component.html +++ b/src/app/admin/trade-checking/trade-checking/trade-checking.component.html @@ -2,90 +2,96 @@ + +
+
+
+
+ + 商户号 + + + + + + +
-
- -
-
- - 商户号 - - - - - - -
- -
- - 清算起始日期 - - - - -
+
+ + 清算起始日期 + + + + +
-
- - 清算终止日期 - - - - +
+ + 清算终止日期 + + + + +
-
-
-
- - +
+
+ + +
-
- -
- -
-
-

- 清算日期: {{this.searchForm.value.settleTimeS | date: 'yyyy-MM-dd'}} 至 {{this.searchForm.value.settleTimeE | date: 'yyyy-MM-dd'}} - - -

-
- - - - - 商户号 - 商户名称 - 交易金额 - 清算金额 - 手续费 - 交易笔数 - - - - - {{data.merNo}} - {{data.merName}} - {{data.totalTradeAmount}} - {{data.totalSettleAmount}} - {{data.totalShdFeeAmount}} - {{data.totalTradeNum}} - - - -
+ +
+
+
+

+ 清算日期: {{this.searchForm.value.settleTimeS | date: 'yyyy-MM-dd'}} 至 {{this.searchForm.value.settleTimeE | date: 'yyyy-MM-dd'}}, + 汇总: + 笔数 {{dataObject.totalTradeNum}}、 + 交易金额 {{dataObject.totalTradeAmount}} 元、 + 手续费 {{dataObject.totalShdFeeAmount}} 元、 + 应结算金额 {{dataObject.totalSettleAmount}} 元 + + +

+
+ + + + + 清算日期 + 商户号 + 商户名称 + 交易笔数 + 交易金额 + 手续费 + 应结算金额 + + + + + {{data.settleDay}} + {{data.merNo}} + {{data.merName}} + {{data.tradeNum}} + {{data.tradeAmount}} + {{data.shdFeeAmount}} + {{data.settleAmount}} + + + +
+ @@ -97,35 +103,44 @@

清算日期: {{this.searchForm.value.settleTimeS | date: 'yyyy-MM-dd'}} 至 {{this.searchForm.value.settleTimeE | date: 'yyyy-MM-dd'}}

+

+ 汇总: + 笔数 {{dataObject.totalTradeNum}}、 + 交易金额 {{dataObject.totalTradeAmount}} 元、 + 手续费 {{dataObject.totalShdFeeAmount}} 元、 + 应结算金额 {{dataObject.totalSettleAmount}} 元 +

+ 清算日期 商户号 商户名称 + 交易笔数 交易金额 - 清算金额 手续费 - 交易笔数 + 应结算金额 - + + {{data.settleDay}} {{data.merNo}} {{data.merName}} - {{data.totalTradeAmount}} - {{data.totalSettleAmount}} - {{data.totalShdFeeAmount}} - {{data.totalTradeNum}} + {{data.tradeNum}} + {{data.tradeAmount}} + {{data.shdFeeAmount}} + {{data.settleAmount}} @@ -134,4 +149,5 @@
+ diff --git a/src/app/admin/trade-checking/trade-checking/trade-checking.component.ts b/src/app/admin/trade-checking/trade-checking/trade-checking.component.ts index 35b3fe7..043cad2 100644 --- a/src/app/admin/trade-checking/trade-checking/trade-checking.component.ts +++ b/src/app/admin/trade-checking/trade-checking/trade-checking.component.ts @@ -5,6 +5,7 @@ import {PlatformService} from '../../../services/platform.service'; import {TradeCheckingService} from '../../../services/trade-checking.service'; import {MerService} from '../../../services/mer.service'; import differenceInCalendarDays from 'date-fns/differenceInCalendarDays'; +import {environment} from '../../../../environments/environment'; @Component({ selector: 'app-trade-checking', templateUrl: './trade-checking.component.html', @@ -15,11 +16,18 @@ export class TradeCheckingComponent implements OnInit { searchForm: FormGroup; pageNum: number; whereObject: any = {}; - + loadingObject = { + spinning: false, + msg: '处理中' + }; merArray = []; - - dataObjectArray = []; - dataObject = {}; + dataObject = { + totalTradeNum: 0, + totalTradeAmount: 0, + totalSettleAmount: 0, + totalShdFeeAmount: 0, + settleList: [] + }; currentDate = new Date(); constructor(private modal: NzModalService, private message: NzMessageService, @@ -53,7 +61,7 @@ export class TradeCheckingComponent implements OnInit { this.tableLoading = true; this.tradeCheckingService.queryChecking(this.searchForm.value, data => { if (data['return_code'] === '000000') { - this.dataObjectArray = Array(data['return_data']); + this.dataObject = data['return_data']; } else { this.modal.error({ nzTitle: '提示', @@ -112,6 +120,22 @@ export class TradeCheckingComponent implements OnInit { } } + download() { + this.loadingObject.spinning = true; + this.loadingObject.msg = '处理中...'; + this.tradeCheckingService.exportChecking(this.searchForm.value, data => { + if (data['return_code'] === '000000') { + window.location.href = environment.imageUrl + data['return_data']; + } else { + this.modal.error({ + nzTitle: '提示', + nzContent: data['return_msg'] + }); + } + this.loadingObject.spinning = false; + }); + } + showPrint() { console.log(document.getElementById('print-content').innerHTML); const oblHtml = window.document.body.innerHTML; diff --git a/src/app/app-common.module.ts b/src/app/app-common.module.ts index 1164743..bc6e81a 100644 --- a/src/app/app-common.module.ts +++ b/src/app/app-common.module.ts @@ -26,6 +26,7 @@ import { } from './pipes'; import {DeviceOrderStatusPipe} from './pipes/device/device-order-status.pipe'; import {DeviceOrderPayTypePipe} from './pipes/device/device-order-pay-type.pipe'; +import {SettleTypePipe} from './pipes/trade-order/settle-type.pipe'; const PIPES = [ TimesPipe, @@ -47,7 +48,8 @@ const PIPES = [ DeviceOrderStatusPipe, DeviceOrderPayTypePipe, PlatformTypePipe, - CreateTypePipe + CreateTypePipe, + SettleTypePipe ]; @NgModule({ diff --git a/src/app/pipes/trade-order/settle-type.pipe.ts b/src/app/pipes/trade-order/settle-type.pipe.ts new file mode 100644 index 0000000..c351a53 --- /dev/null +++ b/src/app/pipes/trade-order/settle-type.pipe.ts @@ -0,0 +1,17 @@ +import { Pipe, PipeTransform } from '@angular/core'; + +@Pipe({ + name: 'settleType' +}) +export class SettleTypePipe implements PipeTransform { + + transform(code: number): string { + switch (code) { + case 1: + return '交易支付'; + case 2: + return '交易退款'; + } + } + +} diff --git a/src/app/services/trade-checking.service.ts b/src/app/services/trade-checking.service.ts index dce8c58..e8f136b 100644 --- a/src/app/services/trade-checking.service.ts +++ b/src/app/services/trade-checking.service.ts @@ -13,15 +13,47 @@ export class TradeCheckingService { private commonsService: CommonsService ) { } + /** + * 查询汇总 + * @param paramObject + * @param callBack + */ queryChecking(paramObject: object, callBack) { this.http.get(environment.baseUrl + 'tradeOrder/queryChecking?' + this.commonsService.getWhereCondition(paramObject)).subscribe(data => { callBack(data); }); } + /** + * 查询汇总明细 + * @param paramObject + * @param callBack + */ queryCheckingDetail(paramObject: object, callBack) { this.http.get(environment.baseUrl + 'tradeOrder/queryCheckingDetail?' + this.commonsService.getWhereCondition(paramObject)).subscribe(data => { callBack(data); }); } + + /** + * 导出交易结算汇总 + * @param paramObject + * @param callBack + */ + exportChecking(paramObject: object, callBack) { + this.http.get(environment.baseUrl + 'tradeOrder/exportChecking?' + this.commonsService.getWhereCondition(paramObject)).subscribe(data => { + callBack(data); + }); + } + + /** + * 导出汇总明细 + * @param paramObject + * @param callBack + */ + exportCheckingDetail(paramObject: object, callBack) { + this.http.get(environment.baseUrl + 'tradeOrder/exportCheckingDetail?' + this.commonsService.getWhereCondition(paramObject)).subscribe(data => { + callBack(data); + }); + } } diff --git a/src/environments/environment.ts b/src/environments/environment.ts index 27d9c15..a03520f 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -5,10 +5,10 @@ export const environment = { production: false, // baseUrl: 'https://gratia-pay.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址) - baseUrl: 'https://gratia-pay.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址) + // baseUrl: 'https://gratia-pay.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址) imageUrl: 'https://gratia-pay.dctpay.com/filesystem/', obsUrl: 'https://gratia-pay-test.obs.cn-southwest-2.myhuaweicloud.com', - // baseUrl: 'http://localhost:9602/brest/', // 测试环境服务器地址(请求数据地址) + baseUrl: 'http://localhost:9602/brest/', // 测试环境服务器地址(请求数据地址) // imageUrl: 'http://localhost:9602/filesystem/', // obsUrl: 'https://gratia-pay-test.obs.cn-southwest-2.myhuaweicloud.com', };