입금 관리 화면 수정

This commit is contained in:
Park Byung Eun 2022-08-28 08:18:17 +00:00
parent b63dd4f5be
commit dd4a871a4c
7 changed files with 243 additions and 112 deletions

View File

@ -131,7 +131,7 @@
<div class="flex flex-auto overflow-hidden">
<!-- Products list -->
<div
class="flex flex-col flex-auto sm:mb-18 overflow-hidden sm:overflow-y-auto"
class="flex flex-col flex-auto sm:mb-18 overflow-hidden sm:overflow-y-auto overflow-x-auto"
>
<ng-container *ngIf="bankDeposit$ | async as bankDeposit">
<ng-container *ngIf="bankDeposit.length > 0; else noDeposit">
@ -143,32 +143,45 @@
<div>
<mat-checkbox></mat-checkbox>
</div>
<div>상부</div>
<div>구분</div>
<div>
등급
<hr style="margin: 7px 0px" />
아이디
<hr style="margin: 7px 0px" />
닉네임
</div>
<div>
등급
입금예정금액
<hr style="margin: 7px 0px" />
레벨
은행
<hr style="margin: 7px 0px" />
상태
예금주
</div>
<div class="hidden sm:block">예금주</div>
<div>정산종류</div>
<div>비고</div>
<div>입금예정금액</div>
<div>
정산종류
<hr style="margin: 7px 0px" />
비고
</div>
<div class="hidden md:block">
등록날짜
<hr style="margin: 7px 0px" />
처리날짜
<hr style="margin: 7px 0px" />
상태
</div>
<div class="hidden md:block">
입금
<hr style="margin: 7px 0px" />
출금
<hr style="margin: 7px 0px" />
보유금
</div>
<div class="hidden md:block">입금출금</div>
<div class="hidden md:block">게임중머니</div>
<div class="hidden lg:block">카지노->캐쉬</div>
<div class="hidden lg:block">회원정보</div>
<div class="hidden lg:block">상위</div>
<div class="hidden lg:block">배팅정보</div>
<div class="hidden lg:block">삭제</div>
</div>
@ -187,44 +200,50 @@
<div>
<mat-checkbox></mat-checkbox>
</div>
<!-- 상부 -->
<div>test {{ idx }}</div>
<!-- 아이디, 닉네임 -->
<!-- 구분 -->
<div>
{{ __getMemberClassesByMemberId(deposit.getMemberId()) }}
</div>
<!-- 등급, 아이디, 닉네임 -->
<div
(click)="viewUserDetail(deposit.getMemberId())"
style="cursor: pointer"
>
test {{ idx }}
</div>
{{ __getMemberLevelByMemberId(deposit.getMemberId()) }}
<hr style="margin: 7px 0px" />
test {{ idx }}
</div>
<!-- 등급, 레벨, 상태 -->
<div>
test {{ idx }}
<hr style="margin: 7px 0px" />
test {{ idx }}
<hr style="margin: 7px 0px" />
test {{ idx }}
{{
__getMemberById(deposit.getMemberId())?.getUsername()
}}
</div>
<!-- 예금주 -->
<div class="hidden sm:block">
<hr style="margin: 7px 0px" />
{{ __getMemberById(deposit.getMemberId())?.getNickname() }}
</div>
<!-- 입금예정금액, 은행, 예금주 -->
<div>
{{ deposit.getAmount() }}
<hr style="margin: 7px 0px" />
{{ __getMemberBankByMemberId(deposit.getMemberId()) }}
<hr style="margin: 7px 0px" />
{{ deposit.getName() }}
</div>
<!-- 정산종류 -->
<div>{{ idx % 2 === 0 ? "롤링" : "콤프" }}</div>
<!-- 비고 -->
<div>test {{ idx }}</div>
<!-- 입금예정금액 -->
<div>test {{ idx }}</div>
<!-- 등록날짜, 처리날짜 -->
<!-- 정산종류, 비고 -->
<div>
{{ __getMemberSettlementByMemberId(deposit.getMemberId()) }}
<hr style="margin: 7px 0px" />
{{ deposit.getMemo() }}
</div>
<!-- 등록날짜, 처리날짜, 상태 -->
<div class="hidden md:block">
{{ deposit.getCreatedAt() | date: "yyyy-MM-dd HH:mm" }}
<hr style="margin: 7px 0px" />
{{ deposit.getStateChangedAt() | date: "yyyy-MM-dd HH:mm" }}
<hr style="margin: 7px 0px" />
{{ __getDepositState(deposit) }}
</div>
<!-- 입금, 출금 -->
<!-- 입금, 출금, 보유금 -->
<div class="hidden md:block">
<span>41,200,000원</span>
@ -235,7 +254,7 @@
<span>22,200,000원</span>
</div>
<!-- 게임중머니 -->
<div class="hidden md:block">test {{ idx }}</div>
<div class="hidden md:block">22,200,000원</div>
<div class="hidden lg:block">
<button
mat-flat-button
@ -253,13 +272,14 @@
게임머니회수
</button>
</div>
<!-- 상위 -->
<div class="hidden lg:block">
<button
mat-flat-button
class="bet-mat-small-8"
[color]="'primary'"
>
회원정보
{{ __getMemberRefferByMemberId(deposit.getMemberId()) }}
</button>
</div>
<div class="hidden lg:block">

View File

@ -35,7 +35,14 @@ import { DepositPagination } from '../models/deposit-pagination';
import { DepositService } from '../services/deposit.service';
import { ActivatedRoute, Router } from '@angular/router';
import { ListMemberBankDepositsResponse } from 'app/modules/proto/c2se/member_bank_deposit_pb';
import { MemberBankDeposit } from 'app/modules/proto/models/member_bank_deposit_pb';
import {
MemberBankDeposit,
MemberBankDepositState,
} from 'app/modules/proto/models/member_bank_deposit_pb';
import { MemberModel } from 'app/modules/proto/models/member_pb';
import { ListMembersResponse } from 'app/modules/proto/c2se/member_pb';
import { ListMemberClassesResponse } from 'app/modules/proto/c2se/member_class_pb';
import { MemberClass } from 'app/modules/proto/models/member_class_pb';
@Component({
selector: 'deposit-list',
@ -45,21 +52,21 @@ import { MemberBankDeposit } from 'app/modules/proto/models/member_bank_deposit_
`
.deposit-grid {
/* CB 상부 아이디 등급 예금주 정산종류 */
grid-template-columns: 20px 100px 100px 80px auto 40px;
grid-template-columns: 20px 80px 100px auto 60px 140px;
@screen sm {
/* CB 상부 아이디 등급 예금주 정산종류 비고 예정 등록*/
grid-template-columns: 20px 100px 100px 80px auto 40px 20px 140px 140px;
grid-template-columns: 20px 80px 100px auto 60px 140px 120px;
}
@screen md {
/* CB 상부 아이디 등급 예금주 정산종류 비고 예정 등록 입금출금 */
grid-template-columns: 20px 100px 100px 80px auto 40px 20px 100px 100px 100px;
grid-template-columns: 20px 80px 100px auto 60px 140px 120px 140px;
}
@screen lg {
/* CB 상부 아이디 등급 예금주 정산종류 비고 예정 등록 입금출금 게임중 카지노 회원 배팅 삭제*/
grid-template-columns: 20px 100px 100px 80px auto 40px 20px 140px 140px 140px 100px 100px 100px 100px 100px;
/* CB 구분 아이디 입금정보 정산종류 등록날짜 입금출금 게임중머니 카지노 상위 배팅 삭제*/
grid-template-columns: 20px 80px 100px auto 60px 140px 120px 140px 80px 120px 80px 60px;
}
}
`,
@ -72,6 +79,8 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
@ViewChild(MatPaginator) private _paginator!: MatPaginator;
@ViewChild(MatSort) private _sort!: MatSort;
listMember!: MemberModel[];
memberClasses!: MemberClass[];
bankDeposit$!: Observable<MemberBankDeposit[] | undefined>;
__isSearchOpened = false;
@ -116,9 +125,15 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
// Get the products
this._activatedRoute.data.subscribe((data) => {
let listMemberResult: ListMembersResponse.Result = data['listMember'];
let listBankDepositResult: ListMemberBankDepositsResponse.Result =
data['bankDeposit'];
let listMemberClasses: ListMemberClassesResponse.Result =
data['listMemberClasses'];
this.listMember = listMemberResult.getMembersList();
this.bankDeposit$ = of(listBankDepositResult.getMemberBankDepositsList());
this.memberClasses = listMemberClasses.getMemberClassesList();
console.log(
'bankDeposit: ',
@ -223,4 +238,82 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
__trackByFn(index: number, item: any): any {
return item.id || index;
}
__getMemberRefferByMemberId(memberId: string): string | undefined {
const member = this.__getMemberById(memberId);
if (!!member) {
const parentUserName = member.getParentMember()?.getUsername();
const parentClassesId = member.getParentMember()?.getMemberClassId();
const parentClass = this.memberClasses.find(
(v) => v.getId() === parentClassesId
);
const parentClassName = parentClass?.getName();
return `[${parentClassName}]${parentUserName}`;
}
return undefined;
}
__getDepositState(deposit: MemberBankDeposit): string | undefined {
const state = deposit.getState();
let result: string = '';
switch (state) {
case MemberBankDepositState.APPLICATION:
result = '신청';
break;
case MemberBankDepositState.COMPLETE:
result = '완료';
break;
default:
break;
}
return result;
}
__getMemberSettlementByMemberId(memberId: string): string | undefined {
const member = this.__getMemberById(memberId);
if (!!member) {
const type = member.getMemberSettlementSetting()?.getSettlementType();
return type === 1 ? '롤링' : '';
}
return undefined;
}
__getMemberLevelByMemberId(memberId: string): string | undefined {
const member = this.__getMemberById(memberId);
if (!!member) {
return member.getMemberLevel()?.getName();
}
return undefined;
}
__getMemberBankByMemberId(memberId: string): string | undefined {
const member = this.__getMemberById(memberId);
if (!!member) {
return member.getBankAccount()?.getBank()?.getName();
}
return undefined;
}
__getMemberClassesByMemberId(memberId: string): string | undefined {
const member = this.__getMemberById(memberId);
if (!!member) {
return member.getMemberClass()?.getName();
}
return undefined;
}
__getMemberById(memberId: string): MemberModel | undefined {
return this.listMember.find((v) => v.getId() === memberId);
}
}

View File

@ -8,13 +8,17 @@ import {
DepositsResolver,
} from './resolvers/deposit.resolver';
import { UserResolver } from '../../dashboards/user/user.resolvers';
import { ListMemberResolver } from 'app/shared/resolvers/member.resolver';
import { ListMemberClassesResolver } from 'app/shared/resolvers/member-class.resolver';
export const depositRoutes: Route[] = [
{
path: '',
component: ListComponent,
resolve: {
listMember: ListMemberResolver,
bankDeposit: BankDepositResolver,
listMemberClasses: ListMemberClassesResolver,
},
},
{

View File

@ -95,69 +95,3 @@ export class UsersResolver implements Resolve<any> {
return this._userService.getUsers();
}
}
@Injectable({
providedIn: 'root',
})
export class ListMemberResolver implements Resolve<any> {
/**
* Constructor
*/
constructor(private _router: Router, private _memberService: MemberService) {}
// -----------------------------------------------------------------------------------------------------
// @ Public methods
// -----------------------------------------------------------------------------------------------------
/**
* Resolver
*
* @param route
* @param state
*/
resolve(
route: ActivatedRouteSnapshot,
state: RouterStateSnapshot
):
| Observable<ListMembersResponse.Result>
| Promise<ListMembersResponse.Result>
| ListMembersResponse.Result {
return this._memberService.listMembers();
}
}
@Injectable({
providedIn: 'root',
})
export class MemberResolver implements Resolve<any> {
/**
* Constructor
*/
constructor(private _router: Router, private _memberService: MemberService) {}
// -----------------------------------------------------------------------------------------------------
// @ Public methods
// -----------------------------------------------------------------------------------------------------
/**
* Resolver
*
* @param route
* @param state
*/
resolve(
route: ActivatedRouteSnapshot,
state: RouterStateSnapshot
):
| Observable<GetMemberResponse.Result>
| Promise<GetMemberResponse.Result>
| GetMemberResponse.Result {
let memberId = route.paramMap.get('id');
if (!memberId) {
console.error('user.resolver memberId is null');
}
return this._memberService.getMember(memberId!);
}
}

View File

@ -2,15 +2,17 @@ import { Route } from '@angular/router';
import { ListComponent } from 'app/modules/admin/member/user/components/list.component';
import { ViewComponent } from 'app/modules/admin/member/user/components/view.component';
import {
ListMemberResolver,
MemberResolver,
} from 'app/shared/resolvers/member.resolver';
import { SiteResolver } from 'app/shared/resolvers/site.resolver';
import { ListMemberBanksResolver } from './resolvers/member-bank.resolver';
import { ListMemberClassesResolver } from './resolvers/member-class.resolver';
import { ListMemberClassesResolver } from 'app/shared/resolvers/member-class.resolver';
import { MemberGameSettingResolver } from './resolvers/member-game-setting.resolver';
import { ListMemberLevelsResolver } from './resolvers/member-level.resolver';
import { MemberSettlementResolver } from './resolvers/member-settlement-setting.resolver';
import { MemberResolver, ListMemberResolver } from './resolvers/user.resolver';
export const userRoutes: Route[] = [
{
path: '',

View File

@ -0,0 +1,78 @@
import { Injectable } from '@angular/core';
import {
ActivatedRouteSnapshot,
Resolve,
Router,
RouterStateSnapshot,
} from '@angular/router';
import { MemberService } from 'app/modules/polyglot/member/services/member.service';
import { ListMembersResponse } from 'app/modules/proto/c2se/member_pb';
import { GetMemberResponse } from 'app/modules/proto/c2se/member_pb';
import { Observable } from 'rxjs';
@Injectable({
providedIn: 'root',
})
export class ListMemberResolver implements Resolve<any> {
/**
* Constructor
*/
constructor(private _router: Router, private _memberService: MemberService) {}
// -----------------------------------------------------------------------------------------------------
// @ Public methods
// -----------------------------------------------------------------------------------------------------
/**
* Resolver
*
* @param route
* @param state
*/
resolve(
route: ActivatedRouteSnapshot,
state: RouterStateSnapshot
):
| Observable<ListMembersResponse.Result>
| Promise<ListMembersResponse.Result>
| ListMembersResponse.Result {
return this._memberService.listMembers();
}
}
@Injectable({
providedIn: 'root',
})
export class MemberResolver implements Resolve<any> {
/**
* Constructor
*/
constructor(private _router: Router, private _memberService: MemberService) {}
// -----------------------------------------------------------------------------------------------------
// @ Public methods
// -----------------------------------------------------------------------------------------------------
/**
* Resolver
*
* @param route
* @param state
*/
resolve(
route: ActivatedRouteSnapshot,
state: RouterStateSnapshot
):
| Observable<GetMemberResponse.Result>
| Promise<GetMemberResponse.Result>
| GetMemberResponse.Result {
let memberId = route.paramMap.get('id');
if (!memberId) {
console.error('user.resolver memberId is null');
}
return this._memberService.getMember(memberId!);
}
}