From 4813572232f1962d893a57d72f595aa4b3035961 Mon Sep 17 00:00:00 2001 From: Park Byung Eun Date: Wed, 31 Aug 2022 05:59:25 +0000 Subject: [PATCH] bug fix --- .../withdraw/resolvers/withdraw.resolver.ts | 8 +- .../components/deposit-history.component.ts | 2 +- .../partner-sign-in-history.component.html | 109 ++++++++++-------- .../web-sign-in-history.component.html | 92 ++++++++------- .../withdraw-history.component.html | 107 +++++++++-------- .../components/withdraw-history.component.ts | 70 +++++++---- .../services/member_bank_withdraw.service.ts | 6 +- 7 files changed, 238 insertions(+), 156 deletions(-) diff --git a/src/app/modules/admin/bank/withdraw/resolvers/withdraw.resolver.ts b/src/app/modules/admin/bank/withdraw/resolvers/withdraw.resolver.ts index daaba39..2786b06 100644 --- a/src/app/modules/admin/bank/withdraw/resolvers/withdraw.resolver.ts +++ b/src/app/modules/admin/bank/withdraw/resolvers/withdraw.resolver.ts @@ -6,7 +6,10 @@ import { RouterStateSnapshot, } from '@angular/router'; import { MemberBankWithdrawService } from 'app/modules/polyglot/member_bank_withdraw/services/member_bank_withdraw.service'; -import { ListMemberBankWithdrawsResponse } from 'app/modules/proto/c2se/member_bank_withdraw_pb'; +import { + ListMemberBankWithdrawsRequest, + ListMemberBankWithdrawsResponse, +} from 'app/modules/proto/c2se/member_bank_withdraw_pb'; import { catchError, Observable, throwError } from 'rxjs'; import { Withdraw } from '../models/withdraw'; @@ -114,6 +117,7 @@ export class BankWithdrawResolver implements Resolve { | Observable | Promise | ListMemberBankWithdrawsResponse.Result { - return this._bankWithdrawService.listMemberBankWithdraws(); + const req = new ListMemberBankWithdrawsRequest(); + return this._bankWithdrawService.listMemberBankWithdraws(req); } } diff --git a/src/app/modules/admin/member/user/components/deposit-history.component.ts b/src/app/modules/admin/member/user/components/deposit-history.component.ts index 8b26134..6c73bfb 100644 --- a/src/app/modules/admin/member/user/components/deposit-history.component.ts +++ b/src/app/modules/admin/member/user/components/deposit-history.component.ts @@ -82,8 +82,8 @@ export class DepositHistoryComponent */ ngOnInit(): void { const req = new ListMemberBankDepositsRequest(); - req.setSearch(); const search = new ListMemberBankDepositsRequest.Search(); + search.setMemberId(this.member!.getId()); req.setSearch(search); diff --git a/src/app/modules/admin/member/user/components/partner-sign-in-history.component.html b/src/app/modules/admin/member/user/components/partner-sign-in-history.component.html index 8415341..1204e78 100644 --- a/src/app/modules/admin/member/user/components/partner-sign-in-history.component.html +++ b/src/app/modules/admin/member/user/components/partner-sign-in-history.component.html @@ -54,53 +54,70 @@ -
- +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
번호 + + {{ idx + 1 }} + + 접속아이피 + {{ info.signInIp }} + 접속일자{{ info.signInAt }}비고{{ info.note }}
+ +
+ + +
- - - 번호 - - - {{ idx + 1 }} - - - - - - 접속아이피 - - {{ info.signInIp }} - - - - - 접속일자 - {{ info.signInAt }} - - - - 비고 - {{ info.note }} - - - - - - -
+ There are no data! + +
diff --git a/src/app/modules/admin/member/user/components/web-sign-in-history.component.html b/src/app/modules/admin/member/user/components/web-sign-in-history.component.html index 2d79c2f..4db61c5 100644 --- a/src/app/modules/admin/member/user/components/web-sign-in-history.component.html +++ b/src/app/modules/admin/member/user/components/web-sign-in-history.component.html @@ -52,46 +52,60 @@ -
- +
+
+ + + + + + + + + + + + + + + + + + +
번호 + + {{ idx + 1 }} + + 접속아이피{{ info.signInIp }}접속일자{{ info.signInAt }}
+ +
+ + +
- - - 번호 - - - {{ idx + 1 }} - - - - - - 접속아이피 - {{ info.signInIp }} - - - - 접속일자 - {{ info.signInAt }} - - - - - - -
+ There are no data! + +
diff --git a/src/app/modules/admin/member/user/components/withdraw-history.component.html b/src/app/modules/admin/member/user/components/withdraw-history.component.html index 4061417..8adc87e 100644 --- a/src/app/modules/admin/member/user/components/withdraw-history.component.html +++ b/src/app/modules/admin/member/user/components/withdraw-history.component.html @@ -50,52 +50,69 @@ -
- +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
번호 + {{ idx + 1 }} + 충전금액 + {{ info.getAmount() }} + 신청일자 + {{ info.getCreatedAt() | date: "yyyy/MM/dd HH:mm" }} + 결과 + {{ __getWithdrawState(info) }} +
+ + +
+ + +
- - - 번호 - - {{ idx + 1 }} - - - - - - 충전금액 - {{ info.amount }} - - - - - 신청일자 - {{ info.createAt }} - - - - 결과 - {{ info.state }} - - - - - - - -
+ There are no data! + +
diff --git a/src/app/modules/admin/member/user/components/withdraw-history.component.ts b/src/app/modules/admin/member/user/components/withdraw-history.component.ts index c118d7c..1d77f4a 100644 --- a/src/app/modules/admin/member/user/components/withdraw-history.component.ts +++ b/src/app/modules/admin/member/user/components/withdraw-history.component.ts @@ -7,10 +7,18 @@ import { OnInit, ViewChild, ViewEncapsulation, + Input, } from '@angular/core'; import { MatPaginator } from '@angular/material/paginator'; import { MatTableDataSource } from '@angular/material/table'; import { fuseAnimations } from '@fuse/animations'; +import { MemberBankWithdrawService } from 'app/modules/polyglot/member_bank_withdraw/services/member_bank_withdraw.service'; +import { ListMemberBankWithdrawsRequest } from 'app/modules/proto/c2se/member_bank_withdraw_pb'; +import { + MemberBankWithdrawModel, + MemberBankWithdrawState, +} from 'app/modules/proto/models/member_bank_withdraw_pb'; +import { MemberModel } from 'app/modules/proto/models/member_pb'; import { Subject } from 'rxjs'; @Component({ @@ -43,21 +51,25 @@ import { Subject } from 'rxjs'; export class WithdrawHistoryComponent implements OnInit, AfterViewInit, OnDestroy { + @Input() + member!: MemberModel | undefined; + @ViewChild(MatPaginator) private _paginator!: MatPaginator; private _unsubscribeAll: Subject = new Subject(); withdrawHistoryTableColumns: string[] = ['no', 'amount', 'createAt', 'state']; - withdrawHistoryDataSource: MatTableDataSource = + withdrawHistoryDataSource: MatTableDataSource = new MatTableDataSource(); /** * Constructor */ - constructor(private _changeDetectorRef: ChangeDetectorRef) { - this.withdrawHistoryDataSource.data = WITHDRAW_HISTORY_DATA; - } + constructor( + private _changeDetectorRef: ChangeDetectorRef, + private _memberBankWithdrawService: MemberBankWithdrawService + ) {} // ----------------------------------------------------------------------------------------------------- // @ Lifecycle hooks @@ -66,7 +78,20 @@ export class WithdrawHistoryComponent /** * On init */ - ngOnInit(): void {} + ngOnInit(): void { + const req = new ListMemberBankWithdrawsRequest(); + const search = new ListMemberBankWithdrawsRequest.Search(); + search.setMemberId(this.member!.getId()); + req.setSearch(search); + this._memberBankWithdrawService + .listMemberBankWithdraws(req) + .then((result) => { + const mbwdl = result.getMemberBankWithdrawsList(); + this.withdrawHistoryDataSource.data = mbwdl; + + this._changeDetectorRef.markForCheck(); + }); + } /** * After view init @@ -111,20 +136,25 @@ export class WithdrawHistoryComponent __trackByFn(index: number, item: any): any { return item.id || index; } -} -export interface TempWithdraw { - amount: string; - createAt: string; - state: string; -} + __getWithdrawState(withdraw: MemberBankWithdrawModel): string | undefined { + const state = withdraw.getState(); + let result: string = ''; -const WITHDRAW_HISTORY_DATA: TempWithdraw[] = [ - { amount: '100,000', createAt: '2022-08-20 13:13', state: '완료' }, - { amount: '100,000', createAt: '2022-08-20 13:13', state: '완료' }, - { amount: '100,000', createAt: '2022-08-20 13:13', state: '완료' }, - { amount: '100,000', createAt: '2022-08-20 13:13', state: '완료' }, - { amount: '100,000', createAt: '2022-08-20 13:13', state: '완료' }, - { amount: '100,000', createAt: '2022-08-20 13:13', state: '완료' }, - { amount: '100,000', createAt: '2022-08-20 13:13', state: '완료' }, -]; + switch (state) { + case MemberBankWithdrawState.APPLICATION: + result = '신청'; + break; + case MemberBankWithdrawState.PENDING: + result = '대기'; + break; + case MemberBankWithdrawState.COMPLETE: + result = '완료'; + break; + default: + break; + } + + return result; + } +} diff --git a/src/app/modules/polyglot/member_bank_withdraw/services/member_bank_withdraw.service.ts b/src/app/modules/polyglot/member_bank_withdraw/services/member_bank_withdraw.service.ts index 0e8ea38..93bd59e 100644 --- a/src/app/modules/polyglot/member_bank_withdraw/services/member_bank_withdraw.service.ts +++ b/src/app/modules/polyglot/member_bank_withdraw/services/member_bank_withdraw.service.ts @@ -67,11 +67,11 @@ export class MemberBankWithdrawService { ); } - listMemberBankWithdraws(): Promise { + listMemberBankWithdraws( + req: ListMemberBankWithdrawsRequest + ): Promise { return new Promise( (resolve, reject) => { - let req = new ListMemberBankWithdrawsRequest(); - this.__natsService .request( SUBJECT_LIST_MEMBER_BANK_WITHDRAWS,