diff --git a/src/app/modules/admin/member/partner/components/list.component.html b/src/app/modules/admin/member/partner/components/list.component.html
index 5402d34..2e8335c 100644
--- a/src/app/modules/admin/member/partner/components/list.component.html
+++ b/src/app/modules/admin/member/partner/components/list.component.html
@@ -12,6 +12,18 @@
+
@@ -43,12 +56,12 @@
상태 변경
-
-
-
-
-
-
+
+
+
+
+
+
-
요율
+
요율
2 3 2 1 5
@@ -202,14 +215,16 @@
LV
{{ partner.getMemberLevel()?.getName()?.substring(5, 6) }}
- {{ __getStateString(partner) }}
+ {{ __getMemberState(partner) }}
{{ partner.getBankAccount()?.getName() }}
-
정산종류
+
+ {{ __getMemberSettlementType(partner) }}
+
캐쉬: 2,900
diff --git a/src/app/modules/admin/member/partner/components/list.component.ts b/src/app/modules/admin/member/partner/components/list.component.ts
index 38fb32d..f34e416 100644
--- a/src/app/modules/admin/member/partner/components/list.component.ts
+++ b/src/app/modules/admin/member/partner/components/list.component.ts
@@ -53,13 +53,19 @@ import { MemberModel, MemberState } from 'app/modules/proto/models/member_pb';
import {
ListMembersRequest,
ListMembersResponse,
+ UpdateMemberForStateRequest,
+ UpdateMemberRequest,
} from 'app/modules/proto/c2se/member_pb';
import { MatCheckbox, MatCheckboxChange } from '@angular/material/checkbox';
-import { ListMemberLevelsResponse } from 'app/modules/proto/c2se/member_level_pb';
+import {
+ ListMemberLevelsResponse,
+ UpdateMemberLevelRequest,
+} from 'app/modules/proto/c2se/member_level_pb';
import { MemberLevel } from 'app/modules/proto/models/member_level_pb';
import { Pagination } from 'app/modules/proto/protobuf/pagination_pb';
import { VendorService } from 'app/modules/polyglot/api/services/vendor.service';
import { environment } from 'environments/environment';
+import { FuseAlertType } from '@fuse/components/alert';
@Component({
selector: 'partner-list',
@@ -101,6 +107,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
@ViewChildren('chkUsers') chkUsers!: QueryList
;
+ listMember!: MemberModel[];
listPartner$!: Observable;
listMemberLevels$!: Observable;
@@ -114,11 +121,21 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
__members: MemberModel[] = [];
__checkedUsers: string[] = [];
+ alertTitle = '알림';
+
title: string = '';
btnTitle: string = '';
memberClassId = '';
signoutBlockConfigForm!: FormGroup;
+ fuseAlertConfirmConfigForm!: FormGroup;
+
+ changeResultShowAlert: boolean = false;
+
+ alertConfig: { type: FuseAlertType; message: string } = {
+ type: 'success',
+ message: '회원 정보가 수정 되었습니다.',
+ };
private _unsubscribeAll: Subject = new Subject();
@@ -173,6 +190,28 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
console.log(this.router.url);
break;
}
+
+ this.fuseAlertConfirmConfigForm = this._formBuilder.group({
+ title: '알림',
+ message: '비밀번호를 변경 하시겠습니까?',
+ icon: this._formBuilder.group({
+ show: true,
+ name: 'heroicons_outline:exclamation',
+ color: 'warn',
+ }),
+ actions: this._formBuilder.group({
+ confirm: this._formBuilder.group({
+ show: true,
+ label: '확인',
+ color: 'warn',
+ }),
+ cancel: this._formBuilder.group({
+ show: true,
+ label: '취소',
+ }),
+ }),
+ dismissible: true,
+ });
}
// -----------------------------------------------------------------------------------------------------
@@ -199,9 +238,11 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
this._activatedRoute.data.subscribe((data) => {
let listMemberResult: ListMembersResponse.Result = data['listPartner'];
this.listPartner$ = of(listMemberResult.getMembersList());
+ this.listMember = listMemberResult.getMembersList();
let listMemberLevelsResult: ListMemberLevelsResponse.Result =
data['listMemberLevels'];
+
this.listMemberLevels$ = of(listMemberLevelsResult.getMemberLevelsList());
// Mark for check
@@ -380,19 +421,98 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
});
}
- __getRateTooltop(): string {
+ private showAlert(type: FuseAlertType, message: string): void {
+ // Set the alert
+ this.changeResultShowAlert = true;
+ this.alertConfig = {
+ type,
+ message,
+ };
+ this._changeDetectorRef.markForCheck();
+ }
+
+ private async showConfirmAlert(
+ title: string,
+ message: string
+ ): Promise {
+ this.fuseAlertConfirmConfigForm.get('title')?.setValue(title);
+ this.fuseAlertConfirmConfigForm.get('message')?.setValue(message);
+
+ return new Promise((resolve, reject) => {
+ const dialogRef = this._fuseConfirmationService.open(
+ this.fuseAlertConfirmConfigForm.value
+ );
+
+ dialogRef.afterClosed().subscribe((result) => {
+ if (result === 'confirmed') {
+ resolve(true);
+ } else {
+ resolve(false);
+ }
+ });
+ });
+ }
+
+ private closeChangeAlert(): void {
+ setTimeout(() => {
+ this.changeResultShowAlert = false;
+ this._changeDetectorRef.markForCheck();
+ }, 5000);
+ }
+
+ __onChangeState(type: number): void {
+ let count = 0;
+ const totalCount = this.chkUsers.length;
+
+ this.showConfirmAlert(
+ this.alertTitle,
+ '선택된 회원 상태를 모두 수정하시겠습니까?'
+ ).then((result) => {
+ if (!!result) {
+ this.__checkedUsers.forEach((memberId: string) => {
+ const req = new UpdateMemberForStateRequest();
+ const findMember = this.listMember.find(
+ (m) => m.getId() === memberId
+ );
+ req.setId(findMember!.getId());
+ req.setState(type as any);
+
+ this.__memberService
+ .updateMemberForState(req)
+ .then((result) => {
+ count++;
+ })
+ .catch((reson) => {
+ this.showAlert('error', '회원 상태 변경이 실패하였습니다.');
+ })
+ .finally(() => {
+ if (count === totalCount) {
+ this.showAlert('success', '회원 상태가 수정 되었습니다.');
+ this.closeChangeAlert();
+ }
+ });
+ });
+ }
+ });
+ }
+
+ __getRateTooltop(partner: MemberModel): string {
const tempRate = 0;
+ const memberSettlement = partner.getMemberSettlementSetting();
+
const resultTooltip = `
- 요율확인 \n 카지노-바카라: ${tempRate}% \n 카지노-룰렛: ${tempRate}% \n 카지노-드레곤타이거: ${tempRate}% \n 카지노-그외:${tempRate}% \n 슬롯:${tempRate}% \n 카지노루징: ${tempRate}% \n 슬롯루징: ${tempRate}%
+ 요율확인 \n
+ 카지노-바카라: ${memberSettlement?.getRateCasinoBacara()}% \n
+ 카지노-룰렛: ${memberSettlement?.getRateCasinoRoulette()}% \n
+ 카지노-드레곤타이거: ${memberSettlement?.getRateCasinoDragonTiger()}% \n
+ 카지노-그외:${memberSettlement?.getRateCasino()}% \n
+ 슬롯:${memberSettlement?.getRateSlot()}% \n
+ 카지노루징: ${memberSettlement?.getRateCasinoLoosing()}% \n
+ 슬롯루징: ${memberSettlement?.getRateSlotLoosing()}%
`;
return resultTooltip;
}
- __getStateString(state: any): string {
- console.log(state.getState());
-
- return '정상';
- }
__signoutBlockConfirmConfig(): void {
this.signoutBlockConfigForm = this._formBuilder.group({
title: '알림',
@@ -446,6 +566,45 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
__onClickChangeLevel(member_level_id: string): void {
console.log('member_level_id', member_level_id);
+ let count = 0;
+ const totalCount = this.chkUsers.length;
+
+ this.showConfirmAlert(
+ this.alertTitle,
+ '선택된 회원 레벨을 모두 수정하시겠습니까?'
+ ).then((result) => {
+ if (!!result) {
+ this.__checkedUsers.forEach((memberId: string) => {
+ const req = new UpdateMemberRequest();
+ const findMember = this.listMember.find(
+ (m) => m.getId() === memberId
+ );
+ req.setId(findMember!.getId());
+ req.setMemberLevelId(member_level_id);
+
+ this.__memberService
+ .updateMember(req)
+ .then((result) => {
+ count++;
+ })
+ .catch((reson) => {
+ this.showAlert('error', '회원 레벨 수정이 실패하였습니다.');
+ })
+ .finally(() => {
+ if (count === totalCount) {
+ this.showAlert('success', '회원 레벨이 수정 되었습니다.');
+ this.closeChangeAlert();
+ }
+ });
+ });
+ }
+ });
+ }
+
+ __getMemberSettlementType(member: MemberModel): string | undefined {
+ const type = member.getMemberSettlementSetting()?.getSettlementType();
+
+ return type === 1 ? '롤링' : '';
}
__getMemberState(member: MemberModel): string {
diff --git a/src/app/modules/admin/member/partner/partner.routing.ts b/src/app/modules/admin/member/partner/partner.routing.ts
index 95ccaee..e2371b6 100644
--- a/src/app/modules/admin/member/partner/partner.routing.ts
+++ b/src/app/modules/admin/member/partner/partner.routing.ts
@@ -32,6 +32,7 @@ export const partnerRoutes: Route[] = [
component: ListComponent,
resolve: {
listPartner: PartnerListForMainOfficeResolver,
+ listMemberLevels: ListMemberLevelsResolver,
},
},
{
@@ -39,6 +40,7 @@ export const partnerRoutes: Route[] = [
component: ListComponent,
resolve: {
listPartner: PartnerListForBranchResolver,
+ listMemberLevels: ListMemberLevelsResolver,
},
},
{
@@ -46,6 +48,7 @@ export const partnerRoutes: Route[] = [
component: ListComponent,
resolve: {
listPartner: PartnerListForDivisionResolver,
+ listMemberLevels: ListMemberLevelsResolver,
},
},
{
@@ -53,6 +56,7 @@ export const partnerRoutes: Route[] = [
component: ListComponent,
resolve: {
listPartner: PartnerListForOfficeResolver,
+ listMemberLevels: ListMemberLevelsResolver,
},
},
{
@@ -60,6 +64,7 @@ export const partnerRoutes: Route[] = [
component: ListComponent,
resolve: {
listPartner: PartnerListForStoreResolver,
+ listMemberLevels: ListMemberLevelsResolver,
},
},
];
diff --git a/src/app/modules/admin/member/user/components/view.component.ts b/src/app/modules/admin/member/user/components/view.component.ts
index 35b9170..c407c17 100644
--- a/src/app/modules/admin/member/user/components/view.component.ts
+++ b/src/app/modules/admin/member/user/components/view.component.ts
@@ -425,9 +425,6 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
/* const dialogRef; */
- const req = new UpdateMemberRequest();
- req.setId(this.currentMember?.getId());
-
switch (this.selectedPanel) {
case 'accountInfo':
this.modifyMemberDefaultInfo();