정산설정 수정 완료

This commit is contained in:
Park Byung Eun 2022-08-26 06:22:29 +00:00
parent 85f53c5d7d
commit 33c6cc553e
4 changed files with 134 additions and 52 deletions

View File

@ -245,7 +245,7 @@
<mat-select <mat-select
id="state" id="state"
[formControlName]="'state'" [formControlName]="'state'"
(selectionChange)="onSelectionChangeLanguage($event)" (selectionChange)="onSelectionChangeState($event)"
> >
<ng-container *ngFor="let info of memberStateOptions"> <ng-container *ngFor="let info of memberStateOptions">
<mat-option [value]="info.value"> <mat-option [value]="info.value">
@ -254,14 +254,6 @@
</ng-container> </ng-container>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field class="w-1/3 pr-2">
<mat-label>환전금지</mat-label>
<mat-select [formControlName]="'isExcahngeMoney'">
<!-- <ng-container *ngFor="let vendor of vendors"> -->
<mat-option value="vendor.id"> vendor option </mat-option>
<!-- </ng-container> -->
</mat-select>
</mat-form-field>
</div> </div>
<div class="flex"> <div class="flex">
@ -445,8 +437,9 @@
<mat-label>바카라 요율</mat-label> <mat-label>바카라 요율</mat-label>
<input <input
type="text" type="text"
maxlength="3"
matInput matInput
[formControlName]="'bacaraRate'" [formControlName]="'rateCasinoBacara'"
style="width: 40%" style="width: 40%"
/> />
<div class="mt-1 text-md text-hint"> <div class="mt-1 text-md text-hint">
@ -458,7 +451,7 @@
<input <input
type="text" type="text"
matInput matInput
[formControlName]="'rulletRate'" [formControlName]="'rateCasinoRoulette'"
style="width: 40%" style="width: 40%"
/> />
<div class="mt-1 text-md text-hint"> <div class="mt-1 text-md text-hint">
@ -470,7 +463,7 @@
<input <input
type="text" type="text"
matInput matInput
[formControlName]="'dragonRate'" [formControlName]="'rateCasinoDragonTiger'"
style="width: 40%" style="width: 40%"
/> />
<div class="mt-1 text-md text-hint"> <div class="mt-1 text-md text-hint">
@ -485,7 +478,7 @@
<input <input
type="text" type="text"
matInput matInput
[formControlName]="'etcRate'" [formControlName]="'rateCasino'"
style="width: 40%" style="width: 40%"
/> />
<div class="mt-1 text-md text-hint"> <div class="mt-1 text-md text-hint">
@ -497,7 +490,7 @@
<input <input
type="text" type="text"
matInput matInput
[formControlName]="'slotRate'" [formControlName]="'rateSlot'"
style="width: 40%" style="width: 40%"
/> />
<div class="mt-1 text-md text-hint"> <div class="mt-1 text-md text-hint">
@ -509,7 +502,7 @@
<input <input
type="text" type="text"
matInput matInput
[formControlName]="'casinoRusingRate'" [formControlName]="'rateCasinoLoosing'"
style="width: 40%" style="width: 40%"
/> />
<div class="mt-1 text-md text-hint"> <div class="mt-1 text-md text-hint">
@ -523,38 +516,64 @@
<input <input
type="text" type="text"
matInput matInput
[formControlName]="'slotRusingRate'" [formControlName]="'rateSlotLoosing'"
style="width: 40%" style="width: 40%"
/> />
<div class="mt-1 text-md text-hint"> <div class="mt-1 text-md text-hint">
%(최소 0 ~ 최대 0.2) %(최소 0 ~ 최대 0.2)
</div> </div>
</mat-form-field> </mat-form-field>
</div>
<div class="flex flex-col mt-8 gt-sm:mt-0 gt-sm:ml-16">
<mat-form-field class="w-1/3 pr-2">
<mat-label>환전금지설정</mat-label>
<mat-select [formControlName]="'canExchange'">
<mat-option value="true"></mat-option>
<mat-option value="false"> 아니오 </mat-option>
<!-- </ng-container> -->
</mat-select>
</mat-form-field>
</div>
<div class="flex flex-col mt-8 gt-sm:mt-0 gt-sm:ml-16">
<span class="font-semibold mb-2">콤프설정</span>
<span class="w-1/3 pr-2"> <span class="w-1/3 pr-2">
<mat-slide-toggle [color]="'primary'"> <mat-slide-toggle
[formControlName]="'canFirstChargeComp'"
[color]="'primary'"
>
첫충콤프 첫충콤프
</mat-slide-toggle> </mat-slide-toggle>
</span> </span>
<span class="w-1/3 pr-2"> <span class="w-1/3 pr-2">
<mat-slide-toggle [color]="'primary'"> <mat-slide-toggle
[formControlName]="'canPerChargeComp'"
[color]="'primary'"
>
매충콤프 매충콤프
</mat-slide-toggle> </mat-slide-toggle>
</span> </span>
</div> </div>
<div class="flex"> <div class="flex flex-col mt-8 gt-sm:mt-0 gt-sm:ml-16">
<span class="font-semibold mb-2">파트너수동지급</span> <span class="font-semibold mb-2">파트너수동지급설정</span>
<mat-radio-group <mat-radio-group
class="flex flex-col w-1/3 pr-2" class="flex flex-col w-1/3 pr-2"
[color]="'primary'" [color]="'primary'"
[value]="'just-good'" [value]="'just-good'"
[formControlName]="'manualPaymentTypeForPartner'"
> >
<mat-radio-button class="mb-2" [value]="'everything'"> <mat-radio-button
class="mb-2"
[value]="ManualPaymentType.ALL_CHILD_PARTNER"
>
하부파트너전체 하부파트너전체
</mat-radio-button> </mat-radio-button>
<mat-radio-button class="mb-2" [value]="'just-good'"> <mat-radio-button
class="mb-2"
[value]="ManualPaymentType.ONLY_DIRECT_PARTNER"
>
직속파트너만 직속파트너만
</mat-radio-button> </mat-radio-button>
<mat-radio-button [value]="'no-push'"> <mat-radio-button [value]="ManualPaymentType.DISABLE">
사용안함 사용안함
</mat-radio-button> </mat-radio-button>
</mat-radio-group> </mat-radio-group>
@ -652,7 +671,7 @@
</div> </div>
<ng-template #commonButton> <ng-template #commonButton>
<div class="flex items-center w-full border-t divide-x"> <div class="flex items-center w-full border-t divide-x mt-8">
<button <button
class="-ml-4" class="-ml-4"
mat-flat-button mat-flat-button

View File

@ -65,8 +65,13 @@ import { ListSitesResponse } from 'app/modules/proto/c2se/site_pb';
import { import {
GetMemberSettlementSettingResponse, GetMemberSettlementSettingResponse,
ListMemberSettlementSettingsResponse, ListMemberSettlementSettingsResponse,
UpdateMemberSettlementSettingRequest,
} from 'app/modules/proto/c2se/member_settlement_setting_pb'; } from 'app/modules/proto/c2se/member_settlement_setting_pb';
import { MemberSettlementSetting } from 'app/modules/proto/models/member_settlement_setting_pb'; import {
ManualPaymentType,
MemberSettlementSetting,
} from 'app/modules/proto/models/member_settlement_setting_pb';
import { MemberSettlementSettingService } from 'app/modules/polyglot/member_settlement_setting/services/member_settlement_setting.service';
@Component({ @Component({
selector: 'user-view', selector: 'user-view',
@ -151,6 +156,7 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
banks!: Bank[]; banks!: Bank[];
sites!: Site[]; sites!: Site[];
ManualPaymentType = ManualPaymentType;
alertConfig: { type: FuseAlertType; message: string } = { alertConfig: { type: FuseAlertType; message: string } = {
type: 'success', type: 'success',
@ -170,12 +176,9 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
private _fuseConfirmationService: FuseConfirmationService, private _fuseConfirmationService: FuseConfirmationService,
private _fuseMediaWatcherService: FuseMediaWatcherService, private _fuseMediaWatcherService: FuseMediaWatcherService,
private _formBuilder: FormBuilder, private _formBuilder: FormBuilder,
private _userService: UserService,
private _memberService: MemberService, private _memberService: MemberService,
private _memberLevelService: MemberLevelService, private _memberBankAccountService: MemberBankAccountService,
private _bankService: BankService, private _memberSettlementSettingService: MemberSettlementSettingService
private _siteService: SiteService,
private _memberBankAccountService: MemberBankAccountService
) {} ) {}
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
@ -196,7 +199,6 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
mobilePhoneNumber: [''], mobilePhoneNumber: [''],
levelName: [''], levelName: [''],
state: [''], state: [''],
isExcahngeMoney: [''],
comp: [''], comp: [''],
coupon: [''], coupon: [''],
recommender: [{ value: '', disabled: true }], recommender: [{ value: '', disabled: true }],
@ -215,13 +217,17 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
}); });
this.memberSettleForm = this._formBuilder.group({ this.memberSettleForm = this._formBuilder.group({
bacaraRate: [], rateCasinoBacara: ['', [Validators.required]],
rulletRate: [], rateCasinoRoulette: ['', [Validators.required]],
dragonRate: [], rateCasinoDragonTiger: ['', [Validators.required]],
etcRate: [], rateCasino: ['', [Validators.required]],
slotRate: [], rateSlot: ['', [Validators.required]],
casinoRusingRate: [], rateCasinoLoosing: ['', [Validators.required]],
slotRusingRate: [], rateSlotLoosing: ['', [Validators.required]],
canFirstChargeComp: [],
canPerChargeComp: [],
canExchange: [],
manualPaymentTypeForPartner: ['', [Validators.required]],
}); });
this.memberGameSettingForm = this._formBuilder.group({}); this.memberGameSettingForm = this._formBuilder.group({});
@ -314,14 +320,7 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
let listSitesResult: ListSitesResponse.Result = data['listSites']; let listSitesResult: ListSitesResponse.Result = data['listSites'];
this.sites = listSitesResult.getSitesList(); this.sites = listSitesResult.getSitesList();
let memberSettlementResult: GetMemberSettlementSettingResponse.Result = const memberSettlement = this.currentMember?.getMemberSettlementSetting();
data['memberSettlement'];
const memberSettlement =
memberSettlementResult.getMemberSettlementSetting();
if (!!memberSettlement) {
this.memberSettlement = memberSettlement;
}
this.memberDefaultForm.patchValue({ this.memberDefaultForm.patchValue({
username: this.currentMember?.getUsername(), username: this.currentMember?.getUsername(),
@ -341,6 +340,23 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
description: this.currentMember?.getBankAccount()?.getMemo(), description: this.currentMember?.getBankAccount()?.getMemo(),
}); });
console.log('canExchange: ', memberSettlement?.getCanExchange());
this.memberSettleForm.patchValue({
rateCasinoBacara: memberSettlement?.getRateCasinoBacara(),
rateCasinoRoulette: memberSettlement?.getRateCasinoRoulette(),
rateCasinoDragonTiger: memberSettlement?.getRateCasinoDragonTiger(),
rateCasino: memberSettlement?.getRateCasino(),
rateSlot: memberSettlement?.getRateSlot(),
rateCasinoLoosing: memberSettlement?.getRateCasinoLoosing(),
rateSlotLoosing: memberSettlement?.getRateSlotLoosing(),
canFirstChargeComp: memberSettlement?.getCanFirstChargeComp(),
canPerChargeComp: memberSettlement?.getCanPerChargeComp(),
canExchange: !!memberSettlement?.getCanExchange() ? 'true' : 'false',
manualPaymentTypeForPartner:
memberSettlement?.getManualPaymentTypeForPartner(),
});
// Mark for check // Mark for check
this._changeDetectorRef.markForCheck(); this._changeDetectorRef.markForCheck();
}); });
@ -408,6 +424,8 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
break; break;
case 'settleInfo': case 'settleInfo':
this.modifyMemberSttlemtSettingInfo();
break; break;
case 'gameInfo': case 'gameInfo':
break; break;
@ -503,6 +521,53 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
}) })
.finally(() => this.closeChangePasswordAlert()); .finally(() => this.closeChangePasswordAlert());
} }
private modifyMemberSttlemtSettingInfo(): void {
if (!this.memberSettleForm.valid) {
return;
}
const {
rateCasinoBacara,
rateCasinoRoulette,
rateCasinoDragonTiger,
rateCasino,
rateSlot,
rateCasinoLoosing,
rateSlotLoosing,
canFirstChargeComp,
canPerChargeComp,
canExchange,
manualPaymentTypeForPartner,
} = this.memberSettleForm.value;
const updateSSReq = new UpdateMemberSettlementSettingRequest();
updateSSReq.setId(
this.currentMember?.getMemberSettlementSetting()?.getId()!
);
updateSSReq.setRateCasinoBacara(rateCasinoBacara);
updateSSReq.setRateCasinoRoulette(rateCasinoRoulette);
updateSSReq.setRateCasinoDragonTiger(rateCasinoDragonTiger);
updateSSReq.setRateCasino(rateCasino);
updateSSReq.setRateSlot(rateSlot);
updateSSReq.setRateCasinoLoosing(rateCasinoLoosing);
updateSSReq.setRateSlotLoosing(rateSlotLoosing);
updateSSReq.setCanFirstChargeComp(canFirstChargeComp);
updateSSReq.setCanPerChargeComp(canPerChargeComp);
updateSSReq.setCanExchange(canExchange);
updateSSReq.setManualPaymentTypeForPartner(manualPaymentTypeForPartner);
this._memberSettlementSettingService
.updateMemberSettlementSetting(updateSSReq)
.then((result) => {
this.showAlert('success', '수정이 완료되었습니다.');
})
.catch((reson) => {
this.showAlert('error', '수정 실패 잠시 후 다시 시도하세요.');
})
.finally(() => this.closeChangePasswordAlert());
}
/** /**
* Navigate to the panel * Navigate to the panel
* *
@ -624,7 +689,7 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
}); });
} }
onSelectionChangeLanguage(event: MatSelectChange) { onSelectionChangeState(event: MatSelectChange) {
const state = event.value; const state = event.value;
if (!state) { if (!state) {

View File

@ -29,8 +29,6 @@ export const userRoutes: Route[] = [
listMemberLevels: ListMemberLevelsResolver, listMemberLevels: ListMemberLevelsResolver,
listMemberBanks: ListMemberBanksResolver, listMemberBanks: ListMemberBanksResolver,
listSites: SiteResolver, listSites: SiteResolver,
memberSettlement: MemberSettlementResolver,
// memberGame: MemberGameSettingResolver,
}, },
}, },
]; ];

View File

@ -117,11 +117,11 @@ export class MemberSettlementSettingService {
); );
} }
updateMemberSettlementSetting(): Promise<UpdateMemberSettlementSettingResponse.Result> { updateMemberSettlementSetting(
req: UpdateMemberSettlementSettingRequest
): Promise<UpdateMemberSettlementSettingResponse.Result> {
return new Promise<UpdateMemberSettlementSettingResponse.Result>( return new Promise<UpdateMemberSettlementSettingResponse.Result>(
(resolve, reject) => { (resolve, reject) => {
let req = new UpdateMemberSettlementSettingRequest();
this.__natsService this.__natsService
.request<UpdateMemberSettlementSettingResponse.Result>( .request<UpdateMemberSettlementSettingResponse.Result>(
SUBJECT_UPDATE_MEMBER_SETTLEMENT_SETTING, SUBJECT_UPDATE_MEMBER_SETTLEMENT_SETTING,