Merge branch 'feature/BETERAN-BACKEND-APP-BROWSER-init' of https://gitlab.loafle.net/bet/beteran-backend-app-browser into feature/BETERAN-BACKEND-APP-BROWSER-init

This commit is contained in:
병준 박 2022-08-30 08:35:41 +00:00
commit 55315ee131

View File

@ -129,7 +129,7 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
memberSettleForm!: FormGroup; memberSettleForm!: FormGroup;
memberGameSettingForm!: FormGroup; memberGameSettingForm!: FormGroup;
passwordConfirmConfigForm!: FormGroup; fuseAlertConfirmConfigForm!: FormGroup;
/* currentMember?: User; */ /* currentMember?: User; */
currentMember?: MemberModel; currentMember?: MemberModel;
@ -150,6 +150,9 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
}; };
changePasswordResultShowAlert: boolean = false; changePasswordResultShowAlert: boolean = false;
alertTitle = '알림';
alertChangePasswordMessage = '비밀번호를 변경 하시겠습니까?';
alertUpdateMemberMessage = '회원을 수정 하시겠습니까?';
private _unsubscribeAll: Subject<any> = new Subject<any>(); private _unsubscribeAll: Subject<any> = new Subject<any>();
@ -223,7 +226,7 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
canBetSlot: [], canBetSlot: [],
}); });
this.passwordConfirmConfigForm = this._formBuilder.group({ this.fuseAlertConfirmConfigForm = this._formBuilder.group({
title: '알림', title: '알림',
message: '비밀번호를 변경 하시겠습니까?', message: '비밀번호를 변경 하시겠습니까?',
icon: this._formBuilder.group({ icon: this._formBuilder.group({
@ -407,6 +410,8 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
return; return;
} }
/* const dialogRef; */
const req = new UpdateMemberRequest(); const req = new UpdateMemberRequest();
req.setId(this.currentMember?.getId()); req.setId(this.currentMember?.getId());
@ -434,10 +439,9 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
} }
private modifyMemberDefaultInfo(): void { private modifyMemberDefaultInfo(): void {
if (!this.currentMember?.getId()) { this.showConfirmAlert(this.alertTitle, this.alertUpdateMemberMessage).then(
return; (result) => {
} if (!!result && !!this.currentMember?.getId()) {
const req = new UpdateMemberRequest(); const req = new UpdateMemberRequest();
req.setId(this.currentMember?.getId()); req.setId(this.currentMember?.getId());
@ -457,7 +461,9 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
} = this.memberDefaultForm.value; } = this.memberDefaultForm.value;
if (!!levelName && levelName !== '') { if (!!levelName && levelName !== '') {
const level = this.memberLevels.find((v) => v.getName() === levelName); const level = this.memberLevels.find(
(v) => v.getName() === levelName
);
if (!!level) req.setMemberLevelId(level?.getId()); if (!!level) req.setMemberLevelId(level?.getId());
} }
if (!!mobilePhoneNumber && mobilePhoneNumber !== '') { if (!!mobilePhoneNumber && mobilePhoneNumber !== '') {
@ -479,11 +485,18 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
}) })
.finally(() => this.closeChangePasswordAlert()); .finally(() => this.closeChangePasswordAlert());
} }
}
);
}
private modifyMemberBankAccountInfo(): void { private modifyMemberBankAccountInfo(): void {
if (!this.memberBankForm.valid) { if (!this.memberBankForm.valid) {
return; return;
} }
this.showConfirmAlert(this.alertTitle, this.alertUpdateMemberMessage).then(
(result) => {
if (!!result) {
const { const {
exchangePw, exchangePw,
exchangePwConfirm, exchangePwConfirm,
@ -518,12 +531,18 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
}) })
.finally(() => this.closeChangePasswordAlert()); .finally(() => this.closeChangePasswordAlert());
} }
}
);
}
private modifyMemberSttlemtSettingInfo(): void { private modifyMemberSttlemtSettingInfo(): void {
if (!this.memberSettleForm.valid) { if (!this.memberSettleForm.valid) {
return; return;
} }
this.showConfirmAlert(this.alertTitle, this.alertUpdateMemberMessage).then(
(result) => {
if (!!result) {
const { const {
rateCasinoBacara, rateCasinoBacara,
rateCasinoRoulette, rateCasinoRoulette,
@ -553,7 +572,9 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
updateSSReq.setCanFirstChargeComp(canFirstChargeComp); updateSSReq.setCanFirstChargeComp(canFirstChargeComp);
updateSSReq.setCanPerChargeComp(canPerChargeComp); updateSSReq.setCanPerChargeComp(canPerChargeComp);
updateSSReq.setCanExchange(canExchange); updateSSReq.setCanExchange(canExchange);
updateSSReq.setManualPaymentTypeForPartner(manualPaymentTypeForPartner); updateSSReq.setManualPaymentTypeForPartner(
manualPaymentTypeForPartner
);
this._memberSettlementSettingService this._memberSettlementSettingService
.updateMemberSettlementSetting(updateSSReq) .updateMemberSettlementSetting(updateSSReq)
@ -565,13 +586,21 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
}) })
.finally(() => this.closeChangePasswordAlert()); .finally(() => this.closeChangePasswordAlert());
} }
}
);
}
private modifyMemberGameSettingInfo(): void { private modifyMemberGameSettingInfo(): void {
this.showConfirmAlert(this.alertTitle, this.alertUpdateMemberMessage).then(
(result) => {
if (!!result) {
const { canBetPowerball, canBetCasino, canBetSlot } = const { canBetPowerball, canBetCasino, canBetSlot } =
this.memberGameSettingForm.value; this.memberGameSettingForm.value;
const updateGSReq = new UpdateMemberGameSettingRequest(); const updateGSReq = new UpdateMemberGameSettingRequest();
updateGSReq.setId(this.currentMember?.getMemberGameSetting()?.getId()!); updateGSReq.setId(
this.currentMember?.getMemberGameSetting()?.getId()!
);
updateGSReq.setCanBetPowerball(canBetPowerball); updateGSReq.setCanBetPowerball(canBetPowerball);
updateGSReq.setCanBetCasino(canBetCasino); updateGSReq.setCanBetCasino(canBetCasino);
updateGSReq.setCanBetSlot(canBetSlot); updateGSReq.setCanBetSlot(canBetSlot);
@ -586,6 +615,9 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
}) })
.finally(() => this.closeChangePasswordAlert()); .finally(() => this.closeChangePasswordAlert());
} }
}
);
}
/** /**
* Navigate to the panel * Navigate to the panel
* *
@ -637,14 +669,11 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
return; return;
} }
const dialogRef = this._fuseConfirmationService.open( this.showConfirmAlert(
this.passwordConfirmConfigForm.value this.alertTitle,
); this.alertChangePasswordMessage
).then((result) => {
/* const dialogRef = this._matDialog.open(AddComposeComponent); */ if (!!result) {
dialogRef.afterClosed().subscribe((result) => {
if (result === 'confirmed') {
const req = new UpdateMemberForPasswordRequest(); const req = new UpdateMemberForPasswordRequest();
req.setPassword(password); req.setPassword(password);
req.setId(this.currentMember!.getId()); req.setId(this.currentMember!.getId());
@ -682,14 +711,11 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
return; return;
} }
const dialogRef = this._fuseConfirmationService.open( this.showConfirmAlert(
this.passwordConfirmConfigForm.value this.alertTitle,
); this.alertChangePasswordMessage
).then((result) => {
/* const dialogRef = this._matDialog.open(AddComposeComponent); */ if (!!result) {
dialogRef.afterClosed().subscribe((result) => {
if (result === 'confirmed') {
const req = new UpdateMemberBankAccountForExchangePasswordRequest(); const req = new UpdateMemberBankAccountForExchangePasswordRequest();
req.setExchangePassword(password); req.setExchangePassword(password);
req.setId(this.currentMember!.getId()); req.setId(this.currentMember!.getId());
@ -717,6 +743,11 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
return; return;
} }
this.showConfirmAlert(
this.alertTitle,
'회원 상태를 수정하시겠습니까?'
).then((result) => {
if (!!result) {
const req = new UpdateMemberForStateRequest(); const req = new UpdateMemberForStateRequest();
req.setId(this.currentMember!.getId()); req.setId(this.currentMember!.getId());
req.setState(state); req.setState(state);
@ -731,9 +762,7 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
}) })
.finally(() => this.closeChangePasswordAlert()); .finally(() => this.closeChangePasswordAlert());
} }
});
__changeMemberState(): void {
const state = this.memberDefaultForm.get('state')?.value;
} }
private showAlert(type: FuseAlertType, message: string): void { private showAlert(type: FuseAlertType, message: string): void {
@ -752,4 +781,26 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
this._changeDetectorRef.markForCheck(); this._changeDetectorRef.markForCheck();
}, 5000); }, 5000);
} }
private async showConfirmAlert(
title: string,
message: string
): Promise<boolean> {
this.fuseAlertConfirmConfigForm.get('title')?.setValue(title);
this.fuseAlertConfirmConfigForm.get('message')?.setValue(message);
return new Promise<boolean>((resolve, reject) => {
const dialogRef = this._fuseConfirmationService.open(
this.fuseAlertConfirmConfigForm.value
);
dialogRef.afterClosed().subscribe((result) => {
if (result === 'confirmed') {
resolve(true);
} else {
resolve(false);
}
});
});
}
} }