파트너 폴더 정리
This commit is contained in:
parent
581d94ae0e
commit
0090cc5c65
|
@ -178,48 +178,48 @@ export const appRoutes: Route[] = [
|
|||
(m: any) => m.PartnerModule
|
||||
),
|
||||
},
|
||||
{
|
||||
path: 'partner-mainoffice',
|
||||
loadChildren: () =>
|
||||
import(
|
||||
'app/modules/admin/member/partner-mainoffice/partner-mainoffice.module'
|
||||
).then((m: any) => m.PartnerMainofficeModule),
|
||||
},
|
||||
{
|
||||
path: 'partner-branch',
|
||||
loadChildren: () =>
|
||||
import(
|
||||
'app/modules/admin/member/partner-branch/partner-branch.module'
|
||||
).then((m: any) => m.PartnerBranchModule),
|
||||
},
|
||||
{
|
||||
path: 'partner-division',
|
||||
loadChildren: () =>
|
||||
import(
|
||||
'app/modules/admin/member/partner-division/partner-division.module'
|
||||
).then((m: any) => m.PartnerDivisionModule),
|
||||
},
|
||||
{
|
||||
path: 'partner-office',
|
||||
loadChildren: () =>
|
||||
import(
|
||||
'app/modules/admin/member/partner-office/partner-office.module'
|
||||
).then((m: any) => m.PartnerOfficeModule),
|
||||
},
|
||||
{
|
||||
path: 'partner-store',
|
||||
loadChildren: () =>
|
||||
import(
|
||||
'app/modules/admin/member/partner-store/partner-store.module'
|
||||
).then((m: any) => m.PartnerStoreModule),
|
||||
},
|
||||
{
|
||||
path: 'partner-recommendation',
|
||||
loadChildren: () =>
|
||||
import(
|
||||
'app/modules/admin/member/partner-recommendation/partner-recommendation.module'
|
||||
).then((m: any) => m.PartnerRecommendationModule),
|
||||
},
|
||||
// {
|
||||
// path: 'partner-mainoffice',
|
||||
// loadChildren: () =>
|
||||
// import(
|
||||
// 'app/modules/admin/member/partner-mainoffice/partner-mainoffice.module'
|
||||
// ).then((m: any) => m.PartnerMainofficeModule),
|
||||
// },
|
||||
// {
|
||||
// path: 'partner-branch',
|
||||
// loadChildren: () =>
|
||||
// import(
|
||||
// 'app/modules/admin/member/partner-branch/partner-branch.module'
|
||||
// ).then((m: any) => m.PartnerBranchModule),
|
||||
// },
|
||||
// {
|
||||
// path: 'partner-division',
|
||||
// loadChildren: () =>
|
||||
// import(
|
||||
// 'app/modules/admin/member/partner-division/partner-division.module'
|
||||
// ).then((m: any) => m.PartnerDivisionModule),
|
||||
// },
|
||||
// {
|
||||
// path: 'partner-office',
|
||||
// loadChildren: () =>
|
||||
// import(
|
||||
// 'app/modules/admin/member/partner-office/partner-office.module'
|
||||
// ).then((m: any) => m.PartnerOfficeModule),
|
||||
// },
|
||||
// {
|
||||
// path: 'partner-store',
|
||||
// loadChildren: () =>
|
||||
// import(
|
||||
// 'app/modules/admin/member/partner-store/partner-store.module'
|
||||
// ).then((m: any) => m.PartnerStoreModule),
|
||||
// },
|
||||
// {
|
||||
// path: 'partner-recommendation',
|
||||
// loadChildren: () =>
|
||||
// import(
|
||||
// 'app/modules/admin/member/partner-recommendation/partner-recommendation.module'
|
||||
// ).then((m: any) => m.PartnerRecommendationModule),
|
||||
// },
|
||||
{
|
||||
path: 'coupon',
|
||||
loadChildren: () =>
|
||||
|
|
|
@ -67,55 +67,64 @@ export const defaultNavigation: FuseNavigationItem[] = [
|
|||
icon: 'heroicons_outline:academic-cap',
|
||||
link: '/member/current-user',
|
||||
},
|
||||
{
|
||||
id: 'apps.ecommerce',
|
||||
title: 'partner-management',
|
||||
type: 'collapsable',
|
||||
icon: 'heroicons_outline:shopping-cart',
|
||||
children: [
|
||||
{
|
||||
id: 'member.partner',
|
||||
title: 'All Partner',
|
||||
type: 'basic',
|
||||
icon: 'heroicons_outline:academic-cap',
|
||||
link: '/member/partner',
|
||||
link: '/member/partner/all',
|
||||
},
|
||||
{
|
||||
id: 'member.partner-mainoffice',
|
||||
title: 'Partner Mainoffice',
|
||||
type: 'basic',
|
||||
icon: 'heroicons_outline:academic-cap',
|
||||
link: '/member/partner-mainoffice',
|
||||
link: '/member/partner/main-office',
|
||||
},
|
||||
{
|
||||
id: 'member.partner-branch',
|
||||
title: 'Partner Branch',
|
||||
type: 'basic',
|
||||
icon: 'heroicons_outline:academic-cap',
|
||||
link: '/member/partner-branch',
|
||||
link: '/member/partner/branch',
|
||||
},
|
||||
{
|
||||
id: 'member.partner-division',
|
||||
title: 'Partner Division',
|
||||
type: 'basic',
|
||||
icon: 'heroicons_outline:academic-cap',
|
||||
link: '/member/partner-division',
|
||||
link: '/member/partner/division',
|
||||
},
|
||||
{
|
||||
id: 'member.partner-office',
|
||||
title: 'Partner Office',
|
||||
type: 'basic',
|
||||
icon: 'heroicons_outline:academic-cap',
|
||||
link: '/member/partner-office',
|
||||
link: '/member/partner/office',
|
||||
},
|
||||
{
|
||||
id: 'member.partner-store',
|
||||
title: 'Partner Store',
|
||||
type: 'basic',
|
||||
icon: 'heroicons_outline:academic-cap',
|
||||
link: '/member/partner-store',
|
||||
link: '/member/partner/store',
|
||||
},
|
||||
{
|
||||
id: 'member.partner-recommendation',
|
||||
title: 'Partner Recommendation',
|
||||
type: 'basic',
|
||||
icon: 'heroicons_outline:academic-cap',
|
||||
link: '/member/partner-recommendation',
|
||||
link: '/member/partner/recommendation',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
{
|
||||
id: 'member.coupon',
|
||||
title: 'Coupon',
|
||||
|
|
123
src/app/modules/admin/member/compose/compose.component.html
Normal file
123
src/app/modules/admin/member/compose/compose.component.html
Normal file
|
@ -0,0 +1,123 @@
|
|||
<div class="flex flex-col max-w-240 md:min-w-160 max-h-screen -m-6">
|
||||
<!-- Header -->
|
||||
<div
|
||||
class="flex flex-0 items-center justify-between h-16 pr-3 sm:pr-5 pl-6 sm:pl-8 bg-primary text-on-primary"
|
||||
>
|
||||
<div class="text-lg font-medium">New Message</div>
|
||||
<button mat-icon-button (click)="saveAndClose()" [tabIndex]="-1">
|
||||
<mat-icon
|
||||
class="text-current"
|
||||
[svgIcon]="'heroicons_outline:x'"
|
||||
></mat-icon>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- Compose form -->
|
||||
<form
|
||||
class="flex flex-col flex-auto p-6 sm:p-8 overflow-y-auto"
|
||||
[formGroup]="composeForm"
|
||||
>
|
||||
<!-- To -->
|
||||
<mat-form-field>
|
||||
<mat-label>To</mat-label>
|
||||
<input matInput [formControlName]="'to'" />
|
||||
<div class="copy-fields-toggles" matSuffix>
|
||||
<span
|
||||
class="text-sm font-medium cursor-pointer select-none hover:underline"
|
||||
*ngIf="!copyFields.cc"
|
||||
(click)="showCopyField('cc')"
|
||||
>
|
||||
Cc
|
||||
</span>
|
||||
<span
|
||||
class="ml-2 text-sm font-medium cursor-pointer select-none hover:underline"
|
||||
*ngIf="!copyFields.bcc"
|
||||
(click)="showCopyField('bcc')"
|
||||
>
|
||||
Bcc
|
||||
</span>
|
||||
</div>
|
||||
</mat-form-field>
|
||||
|
||||
<!-- Cc -->
|
||||
<mat-form-field *ngIf="copyFields.cc">
|
||||
<mat-label>Cc</mat-label>
|
||||
<input matInput [formControlName]="'cc'" />
|
||||
</mat-form-field>
|
||||
|
||||
<!-- Bcc -->
|
||||
<mat-form-field *ngIf="copyFields.bcc">
|
||||
<mat-label>Bcc</mat-label>
|
||||
<input matInput [formControlName]="'bcc'" />
|
||||
</mat-form-field>
|
||||
|
||||
<!-- Subject -->
|
||||
<mat-form-field>
|
||||
<mat-label>Subject</mat-label>
|
||||
<input matInput [formControlName]="'subject'" />
|
||||
</mat-form-field>
|
||||
|
||||
<!-- Body -->
|
||||
<quill-editor
|
||||
class="mt-2"
|
||||
[formControlName]="'body'"
|
||||
[modules]="quillModules"
|
||||
></quill-editor>
|
||||
|
||||
<!-- Actions -->
|
||||
<div
|
||||
class="flex flex-col sm:flex-row sm:items-center justify-between mt-4 sm:mt-6"
|
||||
>
|
||||
<div class="-ml-2">
|
||||
<!-- Attach file -->
|
||||
<button mat-icon-button>
|
||||
<mat-icon
|
||||
class="icon-size-5"
|
||||
[svgIcon]="'heroicons_solid:paper-clip'"
|
||||
></mat-icon>
|
||||
</button>
|
||||
<!-- Insert link -->
|
||||
<button mat-icon-button>
|
||||
<mat-icon
|
||||
class="icon-size-5"
|
||||
[svgIcon]="'heroicons_solid:link'"
|
||||
></mat-icon>
|
||||
</button>
|
||||
<!-- Insert emoji -->
|
||||
<button mat-icon-button>
|
||||
<mat-icon
|
||||
class="icon-size-5"
|
||||
[svgIcon]="'heroicons_solid:emoji-happy'"
|
||||
></mat-icon>
|
||||
</button>
|
||||
<!-- Insert image -->
|
||||
<button mat-icon-button>
|
||||
<mat-icon
|
||||
class="icon-size-5"
|
||||
[svgIcon]="'heroicons_solid:photograph'"
|
||||
></mat-icon>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center mt-4 sm:mt-0">
|
||||
<!-- Discard -->
|
||||
<button class="ml-auto sm:ml-0" mat-stroked-button (click)="discard()">
|
||||
Discard
|
||||
</button>
|
||||
<!-- Save as draft -->
|
||||
<button class="sm:mx-3" mat-stroked-button (click)="saveAsDraft()">
|
||||
<span>Save as draft</span>
|
||||
</button>
|
||||
<!-- Send -->
|
||||
<button
|
||||
class="order-first sm:order-last"
|
||||
mat-flat-button
|
||||
[color]="'primary'"
|
||||
(click)="send()"
|
||||
>
|
||||
Send
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
100
src/app/modules/admin/member/compose/compose.component.ts
Normal file
100
src/app/modules/admin/member/compose/compose.component.ts
Normal file
|
@ -0,0 +1,100 @@
|
|||
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
import { MatDialogRef } from '@angular/material/dialog';
|
||||
|
||||
@Component({
|
||||
selector: 'member-regist-compose',
|
||||
templateUrl: './compose.component.html',
|
||||
encapsulation: ViewEncapsulation.None,
|
||||
})
|
||||
export class RegistComposeComponent implements OnInit {
|
||||
composeForm!: FormGroup;
|
||||
copyFields: { cc: boolean; bcc: boolean } = {
|
||||
cc: false,
|
||||
bcc: false,
|
||||
};
|
||||
quillModules: any = {
|
||||
toolbar: [
|
||||
['bold', 'italic', 'underline'],
|
||||
[{ align: [] }, { list: 'ordered' }, { list: 'bullet' }],
|
||||
['clean'],
|
||||
],
|
||||
};
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
constructor(
|
||||
public matDialogRef: MatDialogRef<RegistComposeComponent>,
|
||||
private _formBuilder: FormBuilder
|
||||
) {}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
// @ Lifecycle hooks
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* On init
|
||||
*/
|
||||
ngOnInit(): void {
|
||||
// Create the form
|
||||
this.composeForm = this._formBuilder.group({
|
||||
partnerId: [{ value: 'kgon4', disabled: true }],
|
||||
siteName: [''],
|
||||
signinId: [''],
|
||||
password: [''],
|
||||
exchangePw: [''],
|
||||
nickname: [''],
|
||||
calculateType: [''],
|
||||
phoneNumber: [''],
|
||||
bankName: [''],
|
||||
accountNumber: [''],
|
||||
accountHolder: [''],
|
||||
});
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
// @ Public methods
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Show the copy field with the given field name
|
||||
*
|
||||
* @param name
|
||||
*/
|
||||
showCopyField(name: string): void {
|
||||
// Return if the name is not one of the available names
|
||||
if (name !== 'cc' && name !== 'bcc') {
|
||||
return;
|
||||
}
|
||||
|
||||
// Show the field
|
||||
this.copyFields[name] = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Save and close
|
||||
*/
|
||||
saveAndClose(): void {
|
||||
// Save the message as a draft
|
||||
this.saveAsDraft();
|
||||
|
||||
// Close the dialog
|
||||
this.matDialogRef.close();
|
||||
}
|
||||
|
||||
/**
|
||||
* Discard the message
|
||||
*/
|
||||
discard(): void {}
|
||||
|
||||
/**
|
||||
* Save the message as a draft
|
||||
*/
|
||||
saveAsDraft(): void {}
|
||||
|
||||
/**
|
||||
* Send the message
|
||||
*/
|
||||
send(): void {}
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
import { ListComponent } from './list.component';
|
||||
|
||||
export const COMPONENTS = [ListComponent];
|
|
@ -1,8 +0,0 @@
|
|||
export interface PartnerBranchPagination {
|
||||
length: number;
|
||||
size: number;
|
||||
page: number;
|
||||
lastPage: number;
|
||||
startIndex: number;
|
||||
endIndex: number;
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
export interface PartnerBranch {
|
||||
id?: string;
|
||||
totalPartnerCount?: number;
|
||||
totalHoldingMoney?: number;
|
||||
totalComp?: number;
|
||||
total?: number;
|
||||
branchCount?: number;
|
||||
divisionCount?: number;
|
||||
officeCount?: number;
|
||||
storeCount?: number;
|
||||
memberCount?: number;
|
||||
nickname?: string;
|
||||
accountHolder?: string;
|
||||
phoneNumber?: string;
|
||||
calculateType?: string;
|
||||
ownCash?: number;
|
||||
ownComp?: number;
|
||||
ownCoupon?: number;
|
||||
gameMoney?: number;
|
||||
todayComp?: number;
|
||||
totalDeposit?: number;
|
||||
totalWithdraw?: number;
|
||||
balance?: number;
|
||||
registDate?: string;
|
||||
finalSigninDate?: string;
|
||||
ip?: string;
|
||||
state?: string;
|
||||
note?: string;
|
||||
}
|
|
@ -1,50 +0,0 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule } from '@angular/router';
|
||||
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatFormFieldModule } from '@angular/material/form-field';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { MatInputModule } from '@angular/material/input';
|
||||
import { MatPaginatorModule } from '@angular/material/paginator';
|
||||
import { MatProgressBarModule } from '@angular/material/progress-bar';
|
||||
import { MatRippleModule } from '@angular/material/core';
|
||||
import { MatSortModule } from '@angular/material/sort';
|
||||
import { MatSelectModule } from '@angular/material/select';
|
||||
import { MatTooltipModule } from '@angular/material/tooltip';
|
||||
import { MatGridListModule } from '@angular/material/grid-list';
|
||||
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
|
||||
import { MatRadioModule } from '@angular/material/radio';
|
||||
import { MatCheckboxModule } from '@angular/material/checkbox';
|
||||
|
||||
import { TranslocoModule } from '@ngneat/transloco';
|
||||
|
||||
import { SharedModule } from 'app/shared/shared.module';
|
||||
|
||||
import { COMPONENTS } from './components';
|
||||
|
||||
import { partnerBranchRoutes } from './partner-branch.routing';
|
||||
|
||||
@NgModule({
|
||||
declarations: [COMPONENTS],
|
||||
imports: [
|
||||
TranslocoModule,
|
||||
SharedModule,
|
||||
RouterModule.forChild(partnerBranchRoutes),
|
||||
|
||||
MatButtonModule,
|
||||
MatFormFieldModule,
|
||||
MatIconModule,
|
||||
MatInputModule,
|
||||
MatPaginatorModule,
|
||||
MatProgressBarModule,
|
||||
MatRippleModule,
|
||||
MatSortModule,
|
||||
MatSelectModule,
|
||||
MatTooltipModule,
|
||||
MatGridListModule,
|
||||
MatSlideToggleModule,
|
||||
MatRadioModule,
|
||||
MatCheckboxModule,
|
||||
],
|
||||
})
|
||||
export class PartnerBranchModule {}
|
|
@ -1,24 +0,0 @@
|
|||
import { Route } from '@angular/router';
|
||||
|
||||
import { ListComponent } from './components/list.component';
|
||||
import { ViewComponent } from '../user/components/view.component';
|
||||
|
||||
import { PartnerBranchsResolver } from './resolvers/partner-branch.resolver';
|
||||
import { UserResolver } from '../user/resolvers/user.resolver';
|
||||
|
||||
export const partnerBranchRoutes: Route[] = [
|
||||
{
|
||||
path: '',
|
||||
component: ListComponent,
|
||||
resolve: {
|
||||
partnerBranchs: PartnerBranchsResolver,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: ':id',
|
||||
component: ViewComponent,
|
||||
resolve: {
|
||||
users: UserResolver,
|
||||
},
|
||||
},
|
||||
];
|
|
@ -1,89 +0,0 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import {
|
||||
ActivatedRouteSnapshot,
|
||||
Resolve,
|
||||
Router,
|
||||
RouterStateSnapshot,
|
||||
} from '@angular/router';
|
||||
import { catchError, Observable, throwError } from 'rxjs';
|
||||
|
||||
import { PartnerBranch } from '../models/partner-branch';
|
||||
import { PartnerBranchPagination } from '../models/partner-branch-pagination';
|
||||
import { PartnerBranchService } from '../services/partner-branch.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class PartnerBranchResolver implements Resolve<any> {
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
constructor(
|
||||
private _partnerBranchService: PartnerBranchService,
|
||||
private _router: Router
|
||||
) {}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
// @ Public methods
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Resolver
|
||||
*
|
||||
* @param route
|
||||
* @param state
|
||||
*/
|
||||
resolve(
|
||||
route: ActivatedRouteSnapshot,
|
||||
state: RouterStateSnapshot
|
||||
): Observable<PartnerBranch | undefined> {
|
||||
return this._partnerBranchService
|
||||
.getPartnerBranchById(route.paramMap.get('id'))
|
||||
.pipe(
|
||||
// Error here means the requested product is not available
|
||||
catchError((error) => {
|
||||
// Log the error
|
||||
console.error(error);
|
||||
|
||||
// Get the parent url
|
||||
const parentUrl = state.url.split('/').slice(0, -1).join('/');
|
||||
|
||||
// Navigate to there
|
||||
this._router.navigateByUrl(parentUrl);
|
||||
|
||||
// Throw an error
|
||||
return throwError(error);
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class PartnerBranchsResolver implements Resolve<any> {
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
constructor(private _partnerBranchService: PartnerBranchService) {}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
// @ Public methods
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Resolver
|
||||
*
|
||||
* @param route
|
||||
* @param state
|
||||
*/
|
||||
resolve(
|
||||
route: ActivatedRouteSnapshot,
|
||||
state: RouterStateSnapshot
|
||||
): Observable<{
|
||||
pagination: PartnerBranchPagination;
|
||||
partnerBranchs: PartnerBranch[];
|
||||
}> {
|
||||
return this._partnerBranchService.getPartnerBranchs();
|
||||
}
|
||||
}
|
|
@ -1,161 +0,0 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import {
|
||||
BehaviorSubject,
|
||||
filter,
|
||||
map,
|
||||
Observable,
|
||||
of,
|
||||
switchMap,
|
||||
take,
|
||||
tap,
|
||||
throwError,
|
||||
} from 'rxjs';
|
||||
|
||||
import { PartnerBranch } from '../models/partner-branch';
|
||||
import { PartnerBranchPagination } from '../models/partner-branch-pagination';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class PartnerBranchService {
|
||||
// Private
|
||||
private __pagination = new BehaviorSubject<
|
||||
PartnerBranchPagination | undefined
|
||||
>(undefined);
|
||||
private __partnerBranch = new BehaviorSubject<PartnerBranch | undefined>(
|
||||
undefined
|
||||
);
|
||||
private __partnerBranchs = new BehaviorSubject<PartnerBranch[] | undefined>(
|
||||
undefined
|
||||
);
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
constructor(private _httpClient: HttpClient) {}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
// @ Accessors
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Getter for pagination
|
||||
*/
|
||||
get pagination$(): Observable<PartnerBranchPagination | undefined> {
|
||||
return this.__pagination.asObservable();
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for partnerBranch
|
||||
*/
|
||||
get partnerBranch$(): Observable<PartnerBranch | undefined> {
|
||||
return this.__partnerBranch.asObservable();
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for partnerBranchs
|
||||
*/
|
||||
get partnerBranchs$(): Observable<PartnerBranch[] | undefined> {
|
||||
return this.__partnerBranchs.asObservable();
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
// @ Public methods
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Get partnerBranchs
|
||||
*
|
||||
*
|
||||
* @param page
|
||||
* @param size
|
||||
* @param sort
|
||||
* @param order
|
||||
* @param search
|
||||
*/
|
||||
getPartnerBranchs(
|
||||
page: number = 0,
|
||||
size: number = 10,
|
||||
sort: string = 'name',
|
||||
order: 'asc' | 'desc' | '' = 'asc',
|
||||
search: string = ''
|
||||
): Observable<{
|
||||
pagination: PartnerBranchPagination;
|
||||
partnerBranchs: PartnerBranch[];
|
||||
}> {
|
||||
return this._httpClient
|
||||
.get<{
|
||||
pagination: PartnerBranchPagination;
|
||||
partnerBranchs: PartnerBranch[];
|
||||
}>('api/apps/member/partner-branch/partner-branchs', {
|
||||
params: {
|
||||
page: '' + page,
|
||||
size: '' + size,
|
||||
sort,
|
||||
order,
|
||||
search,
|
||||
},
|
||||
})
|
||||
.pipe(
|
||||
tap((response) => {
|
||||
this.__pagination.next(response.pagination);
|
||||
this.__partnerBranchs.next(response.partnerBranchs);
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get product by id
|
||||
*/
|
||||
getPartnerBranchById(id: string | null): Observable<PartnerBranch> {
|
||||
return this.__partnerBranchs.pipe(
|
||||
take(1),
|
||||
map((partnerBranchs) => {
|
||||
// Find the product
|
||||
const partnerBranch =
|
||||
partnerBranchs?.find((item) => item.id === id) || undefined;
|
||||
|
||||
// Update the product
|
||||
this.__partnerBranch.next(partnerBranch);
|
||||
|
||||
// Return the product
|
||||
return partnerBranch;
|
||||
}),
|
||||
switchMap((product) => {
|
||||
if (!product) {
|
||||
return throwError('Could not found product with id of ' + id + '!');
|
||||
}
|
||||
|
||||
return of(product);
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create product
|
||||
*/
|
||||
createPartnerBranch(): Observable<PartnerBranch> {
|
||||
return this.partnerBranchs$.pipe(
|
||||
take(1),
|
||||
switchMap((partnerBranchs) =>
|
||||
this._httpClient
|
||||
.post<PartnerBranch>('api/apps/member/partner-branch/product', {})
|
||||
.pipe(
|
||||
map((newPartnerBranch) => {
|
||||
// Update the partnerBranchs with the new product
|
||||
if (!!partnerBranchs) {
|
||||
this.__partnerBranchs.next([
|
||||
newPartnerBranch,
|
||||
...partnerBranchs,
|
||||
]);
|
||||
}
|
||||
|
||||
// Return the new product
|
||||
return newPartnerBranch;
|
||||
})
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
import { ListComponent } from './list.component';
|
||||
|
||||
export const COMPONENTS = [ListComponent];
|
|
@ -1,8 +0,0 @@
|
|||
export interface PartnerDivisionPagination {
|
||||
length: number;
|
||||
size: number;
|
||||
page: number;
|
||||
lastPage: number;
|
||||
startIndex: number;
|
||||
endIndex: number;
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
export interface PartnerDivision {
|
||||
id?: string;
|
||||
totalPartnerCount?: number;
|
||||
totalHoldingMoney?: number;
|
||||
totalComp?: number;
|
||||
total?: number;
|
||||
branchCount?: number;
|
||||
divisionCount?: number;
|
||||
officeCount?: number;
|
||||
storeCount?: number;
|
||||
memberCount?: number;
|
||||
nickname?: string;
|
||||
accountHolder?: string;
|
||||
phoneNumber?: string;
|
||||
calculateType?: string;
|
||||
ownCash?: number;
|
||||
ownComp?: number;
|
||||
ownCoupon?: number;
|
||||
gameMoney?: number;
|
||||
todayComp?: number;
|
||||
totalDeposit?: number;
|
||||
totalWithdraw?: number;
|
||||
balance?: number;
|
||||
registDate?: string;
|
||||
finalSigninDate?: string;
|
||||
ip?: string;
|
||||
state?: string;
|
||||
note?: string;
|
||||
}
|
|
@ -1,50 +0,0 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule } from '@angular/router';
|
||||
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatFormFieldModule } from '@angular/material/form-field';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { MatInputModule } from '@angular/material/input';
|
||||
import { MatPaginatorModule } from '@angular/material/paginator';
|
||||
import { MatProgressBarModule } from '@angular/material/progress-bar';
|
||||
import { MatRippleModule } from '@angular/material/core';
|
||||
import { MatSortModule } from '@angular/material/sort';
|
||||
import { MatSelectModule } from '@angular/material/select';
|
||||
import { MatTooltipModule } from '@angular/material/tooltip';
|
||||
import { MatGridListModule } from '@angular/material/grid-list';
|
||||
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
|
||||
import { MatRadioModule } from '@angular/material/radio';
|
||||
import { MatCheckboxModule } from '@angular/material/checkbox';
|
||||
|
||||
import { TranslocoModule } from '@ngneat/transloco';
|
||||
|
||||
import { SharedModule } from 'app/shared/shared.module';
|
||||
|
||||
import { COMPONENTS } from './components';
|
||||
|
||||
import { partnerDivisionRoutes } from './partner-division.routing';
|
||||
|
||||
@NgModule({
|
||||
declarations: [COMPONENTS],
|
||||
imports: [
|
||||
TranslocoModule,
|
||||
SharedModule,
|
||||
RouterModule.forChild(partnerDivisionRoutes),
|
||||
|
||||
MatButtonModule,
|
||||
MatFormFieldModule,
|
||||
MatIconModule,
|
||||
MatInputModule,
|
||||
MatPaginatorModule,
|
||||
MatProgressBarModule,
|
||||
MatRippleModule,
|
||||
MatSortModule,
|
||||
MatSelectModule,
|
||||
MatTooltipModule,
|
||||
MatGridListModule,
|
||||
MatSlideToggleModule,
|
||||
MatRadioModule,
|
||||
MatCheckboxModule,
|
||||
],
|
||||
})
|
||||
export class PartnerDivisionModule {}
|
|
@ -1,24 +0,0 @@
|
|||
import { Route } from '@angular/router';
|
||||
|
||||
import { ListComponent } from './components/list.component';
|
||||
import { ViewComponent } from '../user/components/view.component';
|
||||
|
||||
import { PartnerDivisionsResolver } from './resolvers/partner-division.resolver';
|
||||
import { UserResolver } from '../user/resolvers/user.resolver';
|
||||
|
||||
export const partnerDivisionRoutes: Route[] = [
|
||||
{
|
||||
path: '',
|
||||
component: ListComponent,
|
||||
resolve: {
|
||||
partnerBranchs: PartnerDivisionsResolver,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: ':id',
|
||||
component: ViewComponent,
|
||||
resolve: {
|
||||
users: UserResolver,
|
||||
},
|
||||
},
|
||||
];
|
|
@ -1,89 +0,0 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import {
|
||||
ActivatedRouteSnapshot,
|
||||
Resolve,
|
||||
Router,
|
||||
RouterStateSnapshot,
|
||||
} from '@angular/router';
|
||||
import { catchError, Observable, throwError } from 'rxjs';
|
||||
|
||||
import { PartnerDivision } from '../models/partner-division';
|
||||
import { PartnerDivisionPagination } from '../models/partner-division-pagination';
|
||||
import { PartnerDivisionService } from '../services/partner-division.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class PartnerDivisionResolver implements Resolve<any> {
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
constructor(
|
||||
private _partnerDivisionService: PartnerDivisionService,
|
||||
private _router: Router
|
||||
) {}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
// @ Public methods
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Resolver
|
||||
*
|
||||
* @param route
|
||||
* @param state
|
||||
*/
|
||||
resolve(
|
||||
route: ActivatedRouteSnapshot,
|
||||
state: RouterStateSnapshot
|
||||
): Observable<PartnerDivision | undefined> {
|
||||
return this._partnerDivisionService
|
||||
.getPartnerDivisionById(route.paramMap.get('id'))
|
||||
.pipe(
|
||||
// Error here means the requested product is not available
|
||||
catchError((error) => {
|
||||
// Log the error
|
||||
console.error(error);
|
||||
|
||||
// Get the parent url
|
||||
const parentUrl = state.url.split('/').slice(0, -1).join('/');
|
||||
|
||||
// Navigate to there
|
||||
this._router.navigateByUrl(parentUrl);
|
||||
|
||||
// Throw an error
|
||||
return throwError(error);
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class PartnerDivisionsResolver implements Resolve<any> {
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
constructor(private _partnerDivisionService: PartnerDivisionService) {}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
// @ Public methods
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Resolver
|
||||
*
|
||||
* @param route
|
||||
* @param state
|
||||
*/
|
||||
resolve(
|
||||
route: ActivatedRouteSnapshot,
|
||||
state: RouterStateSnapshot
|
||||
): Observable<{
|
||||
pagination: PartnerDivisionPagination;
|
||||
partnerDivisions: PartnerDivision[];
|
||||
}> {
|
||||
return this._partnerDivisionService.getPartnerDivisions();
|
||||
}
|
||||
}
|
|
@ -1,161 +0,0 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import {
|
||||
BehaviorSubject,
|
||||
filter,
|
||||
map,
|
||||
Observable,
|
||||
of,
|
||||
switchMap,
|
||||
take,
|
||||
tap,
|
||||
throwError,
|
||||
} from 'rxjs';
|
||||
|
||||
import { PartnerDivision } from '../models/partner-division';
|
||||
import { PartnerDivisionPagination } from '../models/partner-division-pagination';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class PartnerDivisionService {
|
||||
// Private
|
||||
private __pagination = new BehaviorSubject<
|
||||
PartnerDivisionPagination | undefined
|
||||
>(undefined);
|
||||
private __partnerDivision = new BehaviorSubject<PartnerDivision | undefined>(
|
||||
undefined
|
||||
);
|
||||
private __partnerDivisions = new BehaviorSubject<
|
||||
PartnerDivision[] | undefined
|
||||
>(undefined);
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
constructor(private _httpClient: HttpClient) {}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
// @ Accessors
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Getter for pagination
|
||||
*/
|
||||
get pagination$(): Observable<PartnerDivisionPagination | undefined> {
|
||||
return this.__pagination.asObservable();
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for partnerDivision
|
||||
*/
|
||||
get partnerDivision$(): Observable<PartnerDivision | undefined> {
|
||||
return this.__partnerDivision.asObservable();
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for partnerDivisions
|
||||
*/
|
||||
get partnerDivisions$(): Observable<PartnerDivision[] | undefined> {
|
||||
return this.__partnerDivisions.asObservable();
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
// @ Public methods
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Get partnerDivisions
|
||||
*
|
||||
*
|
||||
* @param page
|
||||
* @param size
|
||||
* @param sort
|
||||
* @param order
|
||||
* @param search
|
||||
*/
|
||||
getPartnerDivisions(
|
||||
page: number = 0,
|
||||
size: number = 10,
|
||||
sort: string = 'name',
|
||||
order: 'asc' | 'desc' | '' = 'asc',
|
||||
search: string = ''
|
||||
): Observable<{
|
||||
pagination: PartnerDivisionPagination;
|
||||
partnerDivisions: PartnerDivision[];
|
||||
}> {
|
||||
return this._httpClient
|
||||
.get<{
|
||||
pagination: PartnerDivisionPagination;
|
||||
partnerDivisions: PartnerDivision[];
|
||||
}>('api/apps/member/partner-division/partner-divisions', {
|
||||
params: {
|
||||
page: '' + page,
|
||||
size: '' + size,
|
||||
sort,
|
||||
order,
|
||||
search,
|
||||
},
|
||||
})
|
||||
.pipe(
|
||||
tap((response) => {
|
||||
this.__pagination.next(response.pagination);
|
||||
this.__partnerDivisions.next(response.partnerDivisions);
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get product by id
|
||||
*/
|
||||
getPartnerDivisionById(id: string | null): Observable<PartnerDivision> {
|
||||
return this.__partnerDivisions.pipe(
|
||||
take(1),
|
||||
map((partnerDivisions) => {
|
||||
// Find the product
|
||||
const partnerDivision =
|
||||
partnerDivisions?.find((item) => item.id === id) || undefined;
|
||||
|
||||
// Update the product
|
||||
this.__partnerDivision.next(partnerDivision);
|
||||
|
||||
// Return the product
|
||||
return partnerDivision;
|
||||
}),
|
||||
switchMap((product) => {
|
||||
if (!product) {
|
||||
return throwError('Could not found product with id of ' + id + '!');
|
||||
}
|
||||
|
||||
return of(product);
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create product
|
||||
*/
|
||||
createPartnerDivision(): Observable<PartnerDivision> {
|
||||
return this.partnerDivisions$.pipe(
|
||||
take(1),
|
||||
switchMap((partnerDivisions) =>
|
||||
this._httpClient
|
||||
.post<PartnerDivision>('api/apps/member/partner-division/product', {})
|
||||
.pipe(
|
||||
map((newPartnerDivision) => {
|
||||
// Update the partnerDivisions with the new product
|
||||
if (!!partnerDivisions) {
|
||||
this.__partnerDivisions.next([
|
||||
newPartnerDivision,
|
||||
...partnerDivisions,
|
||||
]);
|
||||
}
|
||||
|
||||
// Return the new product
|
||||
return newPartnerDivision;
|
||||
})
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
import { ListComponent } from './list.component';
|
||||
|
||||
export const COMPONENTS = [ListComponent];
|
|
@ -1,8 +0,0 @@
|
|||
export interface PartnerMainofficePagination {
|
||||
length: number;
|
||||
size: number;
|
||||
page: number;
|
||||
lastPage: number;
|
||||
startIndex: number;
|
||||
endIndex: number;
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
export interface PartnerMainoffice {
|
||||
id?: string;
|
||||
totalPartnerCount?: number;
|
||||
totalHoldingMoney?: number;
|
||||
totalComp?: number;
|
||||
total?: number;
|
||||
branchCount?: number;
|
||||
divisionCount?: number;
|
||||
officeCount?: number;
|
||||
storeCount?: number;
|
||||
memberCount?: number;
|
||||
nickname?: string;
|
||||
accountHolder?: string;
|
||||
phoneNumber?: string;
|
||||
calculateType?: string;
|
||||
ownCash?: number;
|
||||
ownComp?: number;
|
||||
ownCoupon?: number;
|
||||
gameMoney?: number;
|
||||
todayComp?: number;
|
||||
totalDeposit?: number;
|
||||
totalWithdraw?: number;
|
||||
balance?: number;
|
||||
registDate?: string;
|
||||
finalSigninDate?: string;
|
||||
ip?: string;
|
||||
state?: string;
|
||||
note?: string;
|
||||
}
|
|
@ -1,50 +0,0 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule } from '@angular/router';
|
||||
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatFormFieldModule } from '@angular/material/form-field';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { MatInputModule } from '@angular/material/input';
|
||||
import { MatPaginatorModule } from '@angular/material/paginator';
|
||||
import { MatProgressBarModule } from '@angular/material/progress-bar';
|
||||
import { MatRippleModule } from '@angular/material/core';
|
||||
import { MatSortModule } from '@angular/material/sort';
|
||||
import { MatSelectModule } from '@angular/material/select';
|
||||
import { MatTooltipModule } from '@angular/material/tooltip';
|
||||
import { MatGridListModule } from '@angular/material/grid-list';
|
||||
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
|
||||
import { MatRadioModule } from '@angular/material/radio';
|
||||
import { MatCheckboxModule } from '@angular/material/checkbox';
|
||||
|
||||
import { TranslocoModule } from '@ngneat/transloco';
|
||||
|
||||
import { SharedModule } from 'app/shared/shared.module';
|
||||
|
||||
import { COMPONENTS } from './components';
|
||||
|
||||
import { partnerMainofficeRoutes } from './partner-mainoffice.routing';
|
||||
|
||||
@NgModule({
|
||||
declarations: [COMPONENTS],
|
||||
imports: [
|
||||
TranslocoModule,
|
||||
SharedModule,
|
||||
RouterModule.forChild(partnerMainofficeRoutes),
|
||||
|
||||
MatButtonModule,
|
||||
MatFormFieldModule,
|
||||
MatIconModule,
|
||||
MatInputModule,
|
||||
MatPaginatorModule,
|
||||
MatProgressBarModule,
|
||||
MatRippleModule,
|
||||
MatSortModule,
|
||||
MatSelectModule,
|
||||
MatTooltipModule,
|
||||
MatGridListModule,
|
||||
MatSlideToggleModule,
|
||||
MatRadioModule,
|
||||
MatCheckboxModule,
|
||||
],
|
||||
})
|
||||
export class PartnerMainofficeModule {}
|
|
@ -1,24 +0,0 @@
|
|||
import { Route } from '@angular/router';
|
||||
|
||||
import { ListComponent } from './components/list.component';
|
||||
import { ViewComponent } from '../user/components/view.component';
|
||||
|
||||
import { PartnerMainofficesResolver } from './resolvers/partner-mainoffice.resolver';
|
||||
import { UserResolver } from '../user/resolvers/user.resolver';
|
||||
|
||||
export const partnerMainofficeRoutes: Route[] = [
|
||||
{
|
||||
path: '',
|
||||
component: ListComponent,
|
||||
resolve: {
|
||||
partnerMainoffices: PartnerMainofficesResolver,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: ':id',
|
||||
component: ViewComponent,
|
||||
resolve: {
|
||||
users: UserResolver,
|
||||
},
|
||||
},
|
||||
];
|
|
@ -1,89 +0,0 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import {
|
||||
ActivatedRouteSnapshot,
|
||||
Resolve,
|
||||
Router,
|
||||
RouterStateSnapshot,
|
||||
} from '@angular/router';
|
||||
import { catchError, Observable, throwError } from 'rxjs';
|
||||
|
||||
import { PartnerMainoffice } from '../models/partner-mainoffice';
|
||||
import { PartnerMainofficePagination } from '../models/partner-mainoffice-pagination';
|
||||
import { PartnerMainofficeService } from '../services/partner-mainoffice.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class PartnerMainofficeResolver implements Resolve<any> {
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
constructor(
|
||||
private _partnerMainofficeService: PartnerMainofficeService,
|
||||
private _router: Router
|
||||
) {}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
// @ Public methods
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Resolver
|
||||
*
|
||||
* @param route
|
||||
* @param state
|
||||
*/
|
||||
resolve(
|
||||
route: ActivatedRouteSnapshot,
|
||||
state: RouterStateSnapshot
|
||||
): Observable<PartnerMainoffice | undefined> {
|
||||
return this._partnerMainofficeService
|
||||
.getPartnerMainofficeById(route.paramMap.get('id'))
|
||||
.pipe(
|
||||
// Error here means the requested product is not available
|
||||
catchError((error) => {
|
||||
// Log the error
|
||||
console.error(error);
|
||||
|
||||
// Get the parent url
|
||||
const parentUrl = state.url.split('/').slice(0, -1).join('/');
|
||||
|
||||
// Navigate to there
|
||||
this._router.navigateByUrl(parentUrl);
|
||||
|
||||
// Throw an error
|
||||
return throwError(error);
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class PartnerMainofficesResolver implements Resolve<any> {
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
constructor(private _partnerMainofficeService: PartnerMainofficeService) {}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
// @ Public methods
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Resolver
|
||||
*
|
||||
* @param route
|
||||
* @param state
|
||||
*/
|
||||
resolve(
|
||||
route: ActivatedRouteSnapshot,
|
||||
state: RouterStateSnapshot
|
||||
): Observable<{
|
||||
pagination: PartnerMainofficePagination;
|
||||
partnerMainoffices: PartnerMainoffice[];
|
||||
}> {
|
||||
return this._partnerMainofficeService.getPartnerMainoffices();
|
||||
}
|
||||
}
|
|
@ -1,164 +0,0 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import {
|
||||
BehaviorSubject,
|
||||
filter,
|
||||
map,
|
||||
Observable,
|
||||
of,
|
||||
switchMap,
|
||||
take,
|
||||
tap,
|
||||
throwError,
|
||||
} from 'rxjs';
|
||||
|
||||
import { PartnerMainoffice } from '../models/partner-mainoffice';
|
||||
import { PartnerMainofficePagination } from '../models/partner-mainoffice-pagination';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class PartnerMainofficeService {
|
||||
// Private
|
||||
private __pagination = new BehaviorSubject<
|
||||
PartnerMainofficePagination | undefined
|
||||
>(undefined);
|
||||
private __partnerMainoffice = new BehaviorSubject<
|
||||
PartnerMainoffice | undefined
|
||||
>(undefined);
|
||||
private __partnerMainoffices = new BehaviorSubject<
|
||||
PartnerMainoffice[] | undefined
|
||||
>(undefined);
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
constructor(private _httpClient: HttpClient) {}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
// @ Accessors
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Getter for pagination
|
||||
*/
|
||||
get pagination$(): Observable<PartnerMainofficePagination | undefined> {
|
||||
return this.__pagination.asObservable();
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for partnerMainoffice
|
||||
*/
|
||||
get partnerMainoffice$(): Observable<PartnerMainoffice | undefined> {
|
||||
return this.__partnerMainoffice.asObservable();
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for partnerMainoffices
|
||||
*/
|
||||
get partnerMainoffices$(): Observable<PartnerMainoffice[] | undefined> {
|
||||
return this.__partnerMainoffices.asObservable();
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
// @ Public methods
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Get partnerMainoffices
|
||||
*
|
||||
*
|
||||
* @param page
|
||||
* @param size
|
||||
* @param sort
|
||||
* @param order
|
||||
* @param search
|
||||
*/
|
||||
getPartnerMainoffices(
|
||||
page: number = 0,
|
||||
size: number = 10,
|
||||
sort: string = 'name',
|
||||
order: 'asc' | 'desc' | '' = 'asc',
|
||||
search: string = ''
|
||||
): Observable<{
|
||||
pagination: PartnerMainofficePagination;
|
||||
partnerMainoffices: PartnerMainoffice[];
|
||||
}> {
|
||||
return this._httpClient
|
||||
.get<{
|
||||
pagination: PartnerMainofficePagination;
|
||||
partnerMainoffices: PartnerMainoffice[];
|
||||
}>('api/apps/member/partner-mainoffice/partner-mainoffices', {
|
||||
params: {
|
||||
page: '' + page,
|
||||
size: '' + size,
|
||||
sort,
|
||||
order,
|
||||
search,
|
||||
},
|
||||
})
|
||||
.pipe(
|
||||
tap((response) => {
|
||||
this.__pagination.next(response.pagination);
|
||||
this.__partnerMainoffices.next(response.partnerMainoffices);
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get product by id
|
||||
*/
|
||||
getPartnerMainofficeById(id: string | null): Observable<PartnerMainoffice> {
|
||||
return this.__partnerMainoffices.pipe(
|
||||
take(1),
|
||||
map((partnerMainoffices) => {
|
||||
// Find the product
|
||||
const partnerMainoffice =
|
||||
partnerMainoffices?.find((item) => item.id === id) || undefined;
|
||||
|
||||
// Update the product
|
||||
this.__partnerMainoffice.next(partnerMainoffice);
|
||||
|
||||
// Return the product
|
||||
return partnerMainoffice;
|
||||
}),
|
||||
switchMap((product) => {
|
||||
if (!product) {
|
||||
return throwError('Could not found product with id of ' + id + '!');
|
||||
}
|
||||
|
||||
return of(product);
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create product
|
||||
*/
|
||||
createPartnerMainoffice(): Observable<PartnerMainoffice> {
|
||||
return this.partnerMainoffices$.pipe(
|
||||
take(1),
|
||||
switchMap((partnerMainoffices) =>
|
||||
this._httpClient
|
||||
.post<PartnerMainoffice>(
|
||||
'api/apps/member/partner-mainoffice/product',
|
||||
{}
|
||||
)
|
||||
.pipe(
|
||||
map((newPartnerMainoffice) => {
|
||||
// Update the partnerMainoffices with the new product
|
||||
if (!!partnerMainoffices) {
|
||||
this.__partnerMainoffices.next([
|
||||
newPartnerMainoffice,
|
||||
...partnerMainoffices,
|
||||
]);
|
||||
}
|
||||
|
||||
// Return the new product
|
||||
return newPartnerMainoffice;
|
||||
})
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
import { ListComponent } from './list.component';
|
||||
|
||||
export const COMPONENTS = [ListComponent];
|
|
@ -1,8 +0,0 @@
|
|||
export interface PartnerOfficePagination {
|
||||
length: number;
|
||||
size: number;
|
||||
page: number;
|
||||
lastPage: number;
|
||||
startIndex: number;
|
||||
endIndex: number;
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
export interface PartnerOffice {
|
||||
id?: string;
|
||||
totalPartnerCount?: number;
|
||||
totalHoldingMoney?: number;
|
||||
totalComp?: number;
|
||||
total?: number;
|
||||
branchCount?: number;
|
||||
divisionCount?: number;
|
||||
officeCount?: number;
|
||||
storeCount?: number;
|
||||
memberCount?: number;
|
||||
nickname?: string;
|
||||
accountHolder?: string;
|
||||
phoneNumber?: string;
|
||||
calculateType?: string;
|
||||
ownCash?: number;
|
||||
ownComp?: number;
|
||||
ownCoupon?: number;
|
||||
gameMoney?: number;
|
||||
todayComp?: number;
|
||||
totalDeposit?: number;
|
||||
totalWithdraw?: number;
|
||||
balance?: number;
|
||||
registDate?: string;
|
||||
finalSigninDate?: string;
|
||||
ip?: string;
|
||||
state?: string;
|
||||
note?: string;
|
||||
}
|
|
@ -1,50 +0,0 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule } from '@angular/router';
|
||||
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatFormFieldModule } from '@angular/material/form-field';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { MatInputModule } from '@angular/material/input';
|
||||
import { MatPaginatorModule } from '@angular/material/paginator';
|
||||
import { MatProgressBarModule } from '@angular/material/progress-bar';
|
||||
import { MatRippleModule } from '@angular/material/core';
|
||||
import { MatSortModule } from '@angular/material/sort';
|
||||
import { MatSelectModule } from '@angular/material/select';
|
||||
import { MatTooltipModule } from '@angular/material/tooltip';
|
||||
import { MatGridListModule } from '@angular/material/grid-list';
|
||||
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
|
||||
import { MatRadioModule } from '@angular/material/radio';
|
||||
import { MatCheckboxModule } from '@angular/material/checkbox';
|
||||
|
||||
import { TranslocoModule } from '@ngneat/transloco';
|
||||
|
||||
import { SharedModule } from 'app/shared/shared.module';
|
||||
|
||||
import { COMPONENTS } from './components';
|
||||
|
||||
import { partnerOfficeRoutes } from './partner-office.routing';
|
||||
|
||||
@NgModule({
|
||||
declarations: [COMPONENTS],
|
||||
imports: [
|
||||
TranslocoModule,
|
||||
SharedModule,
|
||||
RouterModule.forChild(partnerOfficeRoutes),
|
||||
|
||||
MatButtonModule,
|
||||
MatFormFieldModule,
|
||||
MatIconModule,
|
||||
MatInputModule,
|
||||
MatPaginatorModule,
|
||||
MatProgressBarModule,
|
||||
MatRippleModule,
|
||||
MatSortModule,
|
||||
MatSelectModule,
|
||||
MatTooltipModule,
|
||||
MatGridListModule,
|
||||
MatSlideToggleModule,
|
||||
MatRadioModule,
|
||||
MatCheckboxModule,
|
||||
],
|
||||
})
|
||||
export class PartnerOfficeModule {}
|
|
@ -1,24 +0,0 @@
|
|||
import { Route } from '@angular/router';
|
||||
|
||||
import { ListComponent } from './components/list.component';
|
||||
import { ViewComponent } from '../user/components/view.component';
|
||||
|
||||
import { PartnerOfficesResolver } from './resolvers/partner-office.resolver';
|
||||
import { UserResolver } from '../user/resolvers/user.resolver';
|
||||
|
||||
export const partnerOfficeRoutes: Route[] = [
|
||||
{
|
||||
path: '',
|
||||
component: ListComponent,
|
||||
resolve: {
|
||||
partnerOffices: PartnerOfficesResolver,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: ':id',
|
||||
component: ViewComponent,
|
||||
resolve: {
|
||||
users: UserResolver,
|
||||
},
|
||||
},
|
||||
];
|
|
@ -1,89 +0,0 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import {
|
||||
ActivatedRouteSnapshot,
|
||||
Resolve,
|
||||
Router,
|
||||
RouterStateSnapshot,
|
||||
} from '@angular/router';
|
||||
import { catchError, Observable, throwError } from 'rxjs';
|
||||
|
||||
import { PartnerOffice } from '../models/partner-office';
|
||||
import { PartnerOfficePagination } from '../models/partner-office-pagination';
|
||||
import { PartnerOfficeService } from '../services/partner-office.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class PartnerOfficeResolver implements Resolve<any> {
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
constructor(
|
||||
private _partnerOfficeService: PartnerOfficeService,
|
||||
private _router: Router
|
||||
) {}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
// @ Public methods
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Resolver
|
||||
*
|
||||
* @param route
|
||||
* @param state
|
||||
*/
|
||||
resolve(
|
||||
route: ActivatedRouteSnapshot,
|
||||
state: RouterStateSnapshot
|
||||
): Observable<PartnerOffice | undefined> {
|
||||
return this._partnerOfficeService
|
||||
.getPartnerOfficeById(route.paramMap.get('id'))
|
||||
.pipe(
|
||||
// Error here means the requested product is not available
|
||||
catchError((error) => {
|
||||
// Log the error
|
||||
console.error(error);
|
||||
|
||||
// Get the parent url
|
||||
const parentUrl = state.url.split('/').slice(0, -1).join('/');
|
||||
|
||||
// Navigate to there
|
||||
this._router.navigateByUrl(parentUrl);
|
||||
|
||||
// Throw an error
|
||||
return throwError(error);
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class PartnerOfficesResolver implements Resolve<any> {
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
constructor(private _partnerOfficeService: PartnerOfficeService) {}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
// @ Public methods
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Resolver
|
||||
*
|
||||
* @param route
|
||||
* @param state
|
||||
*/
|
||||
resolve(
|
||||
route: ActivatedRouteSnapshot,
|
||||
state: RouterStateSnapshot
|
||||
): Observable<{
|
||||
pagination: PartnerOfficePagination;
|
||||
partnerOffices: PartnerOffice[];
|
||||
}> {
|
||||
return this._partnerOfficeService.getPartnerOffices();
|
||||
}
|
||||
}
|
|
@ -1,161 +0,0 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import {
|
||||
BehaviorSubject,
|
||||
filter,
|
||||
map,
|
||||
Observable,
|
||||
of,
|
||||
switchMap,
|
||||
take,
|
||||
tap,
|
||||
throwError,
|
||||
} from 'rxjs';
|
||||
|
||||
import { PartnerOffice } from '../models/partner-office';
|
||||
import { PartnerOfficePagination } from '../models/partner-office-pagination';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class PartnerOfficeService {
|
||||
// Private
|
||||
private __pagination = new BehaviorSubject<
|
||||
PartnerOfficePagination | undefined
|
||||
>(undefined);
|
||||
private __partnerOffice = new BehaviorSubject<PartnerOffice | undefined>(
|
||||
undefined
|
||||
);
|
||||
private __partnerOffices = new BehaviorSubject<PartnerOffice[] | undefined>(
|
||||
undefined
|
||||
);
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
constructor(private _httpClient: HttpClient) {}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
// @ Accessors
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Getter for pagination
|
||||
*/
|
||||
get pagination$(): Observable<PartnerOfficePagination | undefined> {
|
||||
return this.__pagination.asObservable();
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for partnerOffice
|
||||
*/
|
||||
get partnerOffice$(): Observable<PartnerOffice | undefined> {
|
||||
return this.__partnerOffice.asObservable();
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for partnerOffices
|
||||
*/
|
||||
get partnerOffices$(): Observable<PartnerOffice[] | undefined> {
|
||||
return this.__partnerOffices.asObservable();
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
// @ Public methods
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Get partnerOffices
|
||||
*
|
||||
*
|
||||
* @param page
|
||||
* @param size
|
||||
* @param sort
|
||||
* @param order
|
||||
* @param search
|
||||
*/
|
||||
getPartnerOffices(
|
||||
page: number = 0,
|
||||
size: number = 10,
|
||||
sort: string = 'name',
|
||||
order: 'asc' | 'desc' | '' = 'asc',
|
||||
search: string = ''
|
||||
): Observable<{
|
||||
pagination: PartnerOfficePagination;
|
||||
partnerOffices: PartnerOffice[];
|
||||
}> {
|
||||
return this._httpClient
|
||||
.get<{
|
||||
pagination: PartnerOfficePagination;
|
||||
partnerOffices: PartnerOffice[];
|
||||
}>('api/apps/member/partner-office/partner-offices', {
|
||||
params: {
|
||||
page: '' + page,
|
||||
size: '' + size,
|
||||
sort,
|
||||
order,
|
||||
search,
|
||||
},
|
||||
})
|
||||
.pipe(
|
||||
tap((response) => {
|
||||
this.__pagination.next(response.pagination);
|
||||
this.__partnerOffices.next(response.partnerOffices);
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get product by id
|
||||
*/
|
||||
getPartnerOfficeById(id: string | null): Observable<PartnerOffice> {
|
||||
return this.__partnerOffices.pipe(
|
||||
take(1),
|
||||
map((partnerOffices) => {
|
||||
// Find the product
|
||||
const partnerOffice =
|
||||
partnerOffices?.find((item) => item.id === id) || undefined;
|
||||
|
||||
// Update the product
|
||||
this.__partnerOffice.next(partnerOffice);
|
||||
|
||||
// Return the product
|
||||
return partnerOffice;
|
||||
}),
|
||||
switchMap((product) => {
|
||||
if (!product) {
|
||||
return throwError('Could not found product with id of ' + id + '!');
|
||||
}
|
||||
|
||||
return of(product);
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create product
|
||||
*/
|
||||
createPartnerOffice(): Observable<PartnerOffice> {
|
||||
return this.partnerOffices$.pipe(
|
||||
take(1),
|
||||
switchMap((partnerOffices) =>
|
||||
this._httpClient
|
||||
.post<PartnerOffice>('api/apps/member/partner-office/product', {})
|
||||
.pipe(
|
||||
map((newPartnerOffice) => {
|
||||
// Update the partnerOffices with the new product
|
||||
if (!!partnerOffices) {
|
||||
this.__partnerOffices.next([
|
||||
newPartnerOffice,
|
||||
...partnerOffices,
|
||||
]);
|
||||
}
|
||||
|
||||
// Return the new product
|
||||
return newPartnerOffice;
|
||||
})
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
import { ListComponent } from './list.component';
|
||||
|
||||
export const COMPONENTS = [ListComponent];
|
|
@ -1,8 +0,0 @@
|
|||
export interface PartnerRecommendationPagination {
|
||||
length: number;
|
||||
size: number;
|
||||
page: number;
|
||||
lastPage: number;
|
||||
startIndex: number;
|
||||
endIndex: number;
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
export interface PartnerRecommendation {
|
||||
id?: string;
|
||||
totalPartnerCount?: number;
|
||||
totalHoldingMoney?: number;
|
||||
totalComp?: number;
|
||||
total?: number;
|
||||
branchCount?: number;
|
||||
divisionCount?: number;
|
||||
officeCount?: number;
|
||||
storeCount?: number;
|
||||
memberCount?: number;
|
||||
nickname?: string;
|
||||
accountHolder?: string;
|
||||
phoneNumber?: string;
|
||||
calculateType?: string;
|
||||
ownCash?: number;
|
||||
ownComp?: number;
|
||||
ownCoupon?: number;
|
||||
gameMoney?: number;
|
||||
todayComp?: number;
|
||||
totalDeposit?: number;
|
||||
totalWithdraw?: number;
|
||||
balance?: number;
|
||||
registDate?: string;
|
||||
finalSigninDate?: string;
|
||||
ip?: string;
|
||||
state?: string;
|
||||
note?: string;
|
||||
}
|
|
@ -1,50 +0,0 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule } from '@angular/router';
|
||||
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatFormFieldModule } from '@angular/material/form-field';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { MatInputModule } from '@angular/material/input';
|
||||
import { MatPaginatorModule } from '@angular/material/paginator';
|
||||
import { MatProgressBarModule } from '@angular/material/progress-bar';
|
||||
import { MatRippleModule } from '@angular/material/core';
|
||||
import { MatSortModule } from '@angular/material/sort';
|
||||
import { MatSelectModule } from '@angular/material/select';
|
||||
import { MatTooltipModule } from '@angular/material/tooltip';
|
||||
import { MatGridListModule } from '@angular/material/grid-list';
|
||||
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
|
||||
import { MatRadioModule } from '@angular/material/radio';
|
||||
import { MatCheckboxModule } from '@angular/material/checkbox';
|
||||
|
||||
import { TranslocoModule } from '@ngneat/transloco';
|
||||
|
||||
import { SharedModule } from 'app/shared/shared.module';
|
||||
|
||||
import { COMPONENTS } from './components';
|
||||
|
||||
import { partnerRecommendationRoutes } from './partner-recommendation.routing';
|
||||
|
||||
@NgModule({
|
||||
declarations: [COMPONENTS],
|
||||
imports: [
|
||||
TranslocoModule,
|
||||
SharedModule,
|
||||
RouterModule.forChild(partnerRecommendationRoutes),
|
||||
|
||||
MatButtonModule,
|
||||
MatFormFieldModule,
|
||||
MatIconModule,
|
||||
MatInputModule,
|
||||
MatPaginatorModule,
|
||||
MatProgressBarModule,
|
||||
MatRippleModule,
|
||||
MatSortModule,
|
||||
MatSelectModule,
|
||||
MatTooltipModule,
|
||||
MatGridListModule,
|
||||
MatSlideToggleModule,
|
||||
MatRadioModule,
|
||||
MatCheckboxModule,
|
||||
],
|
||||
})
|
||||
export class PartnerRecommendationModule {}
|
|
@ -1,24 +0,0 @@
|
|||
import { Route } from '@angular/router';
|
||||
|
||||
import { ListComponent } from './components/list.component';
|
||||
import { ViewComponent } from '../user/components/view.component';
|
||||
|
||||
import { PartnerRecommendationsResolver } from './resolvers/partner-recommendation.resolver';
|
||||
import { UserResolver } from '../user/resolvers/user.resolver';
|
||||
|
||||
export const partnerRecommendationRoutes: Route[] = [
|
||||
{
|
||||
path: '',
|
||||
component: ListComponent,
|
||||
resolve: {
|
||||
partnerRecommendations: PartnerRecommendationsResolver,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: ':id',
|
||||
component: ViewComponent,
|
||||
resolve: {
|
||||
users: UserResolver,
|
||||
},
|
||||
},
|
||||
];
|
|
@ -1,91 +0,0 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import {
|
||||
ActivatedRouteSnapshot,
|
||||
Resolve,
|
||||
Router,
|
||||
RouterStateSnapshot,
|
||||
} from '@angular/router';
|
||||
import { catchError, Observable, throwError } from 'rxjs';
|
||||
|
||||
import { PartnerRecommendation } from '../models/partner-recommendation';
|
||||
import { PartnerRecommendationPagination } from '../models/partner-recommendation-pagination';
|
||||
import { PartnerRecommendationService } from '../services/partner-recommendation.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class PartnerRecommendationResolver implements Resolve<any> {
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
constructor(
|
||||
private _partnerRecommendationService: PartnerRecommendationService,
|
||||
private _router: Router
|
||||
) {}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
// @ Public methods
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Resolver
|
||||
*
|
||||
* @param route
|
||||
* @param state
|
||||
*/
|
||||
resolve(
|
||||
route: ActivatedRouteSnapshot,
|
||||
state: RouterStateSnapshot
|
||||
): Observable<PartnerRecommendation | undefined> {
|
||||
return this._partnerRecommendationService
|
||||
.getPartnerRecommendationById(route.paramMap.get('id'))
|
||||
.pipe(
|
||||
// Error here means the requested product is not available
|
||||
catchError((error) => {
|
||||
// Log the error
|
||||
console.error(error);
|
||||
|
||||
// Get the parent url
|
||||
const parentUrl = state.url.split('/').slice(0, -1).join('/');
|
||||
|
||||
// Navigate to there
|
||||
this._router.navigateByUrl(parentUrl);
|
||||
|
||||
// Throw an error
|
||||
return throwError(error);
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class PartnerRecommendationsResolver implements Resolve<any> {
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
constructor(
|
||||
private _partnerRecommendationService: PartnerRecommendationService
|
||||
) {}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
// @ Public methods
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Resolver
|
||||
*
|
||||
* @param route
|
||||
* @param state
|
||||
*/
|
||||
resolve(
|
||||
route: ActivatedRouteSnapshot,
|
||||
state: RouterStateSnapshot
|
||||
): Observable<{
|
||||
pagination: PartnerRecommendationPagination;
|
||||
partnerRecommendations: PartnerRecommendation[];
|
||||
}> {
|
||||
return this._partnerRecommendationService.getPartnerRecommendations();
|
||||
}
|
||||
}
|
|
@ -1,168 +0,0 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import {
|
||||
BehaviorSubject,
|
||||
filter,
|
||||
map,
|
||||
Observable,
|
||||
of,
|
||||
switchMap,
|
||||
take,
|
||||
tap,
|
||||
throwError,
|
||||
} from 'rxjs';
|
||||
|
||||
import { PartnerRecommendation } from '../models/partner-recommendation';
|
||||
import { PartnerRecommendationPagination } from '../models/partner-recommendation-pagination';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class PartnerRecommendationService {
|
||||
// Private
|
||||
private __pagination = new BehaviorSubject<
|
||||
PartnerRecommendationPagination | undefined
|
||||
>(undefined);
|
||||
private __partnerRecommendation = new BehaviorSubject<
|
||||
PartnerRecommendation | undefined
|
||||
>(undefined);
|
||||
private __partnerRecommendations = new BehaviorSubject<
|
||||
PartnerRecommendation[] | undefined
|
||||
>(undefined);
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
constructor(private _httpClient: HttpClient) {}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
// @ Accessors
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Getter for pagination
|
||||
*/
|
||||
get pagination$(): Observable<PartnerRecommendationPagination | undefined> {
|
||||
return this.__pagination.asObservable();
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for partnerRecommendation
|
||||
*/
|
||||
get partnerRecommendation$(): Observable<PartnerRecommendation | undefined> {
|
||||
return this.__partnerRecommendation.asObservable();
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for partnerRecommendations
|
||||
*/
|
||||
get partnerRecommendations$(): Observable<
|
||||
PartnerRecommendation[] | undefined
|
||||
> {
|
||||
return this.__partnerRecommendations.asObservable();
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
// @ Public methods
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Get partnerRecommendations
|
||||
*
|
||||
*
|
||||
* @param page
|
||||
* @param size
|
||||
* @param sort
|
||||
* @param order
|
||||
* @param search
|
||||
*/
|
||||
getPartnerRecommendations(
|
||||
page: number = 0,
|
||||
size: number = 10,
|
||||
sort: string = 'name',
|
||||
order: 'asc' | 'desc' | '' = 'asc',
|
||||
search: string = ''
|
||||
): Observable<{
|
||||
pagination: PartnerRecommendationPagination;
|
||||
partnerRecommendations: PartnerRecommendation[];
|
||||
}> {
|
||||
return this._httpClient
|
||||
.get<{
|
||||
pagination: PartnerRecommendationPagination;
|
||||
partnerRecommendations: PartnerRecommendation[];
|
||||
}>('api/apps/member/partner-recommendation/partner-recommendations', {
|
||||
params: {
|
||||
page: '' + page,
|
||||
size: '' + size,
|
||||
sort,
|
||||
order,
|
||||
search,
|
||||
},
|
||||
})
|
||||
.pipe(
|
||||
tap((response) => {
|
||||
this.__pagination.next(response.pagination);
|
||||
this.__partnerRecommendations.next(response.partnerRecommendations);
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get product by id
|
||||
*/
|
||||
getPartnerRecommendationById(
|
||||
id: string | null
|
||||
): Observable<PartnerRecommendation> {
|
||||
return this.__partnerRecommendations.pipe(
|
||||
take(1),
|
||||
map((partnerRecommendations) => {
|
||||
// Find the product
|
||||
const partnerRecommendation =
|
||||
partnerRecommendations?.find((item) => item.id === id) || undefined;
|
||||
|
||||
// Update the product
|
||||
this.__partnerRecommendation.next(partnerRecommendation);
|
||||
|
||||
// Return the product
|
||||
return partnerRecommendation;
|
||||
}),
|
||||
switchMap((product) => {
|
||||
if (!product) {
|
||||
return throwError('Could not found product with id of ' + id + '!');
|
||||
}
|
||||
|
||||
return of(product);
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create product
|
||||
*/
|
||||
createPartnerRecommendation(): Observable<PartnerRecommendation> {
|
||||
return this.partnerRecommendations$.pipe(
|
||||
take(1),
|
||||
switchMap((partnerRecommendations) =>
|
||||
this._httpClient
|
||||
.post<PartnerRecommendation>(
|
||||
'api/apps/member/partner-recommendation/product',
|
||||
{}
|
||||
)
|
||||
.pipe(
|
||||
map((newPartnerRecommendation) => {
|
||||
// Update the partnerRecommendations with the new product
|
||||
if (!!partnerRecommendations) {
|
||||
this.__partnerRecommendations.next([
|
||||
newPartnerRecommendation,
|
||||
...partnerRecommendations,
|
||||
]);
|
||||
}
|
||||
|
||||
// Return the new product
|
||||
return newPartnerRecommendation;
|
||||
})
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
import { ListComponent } from './list.component';
|
||||
|
||||
export const COMPONENTS = [ListComponent];
|
|
@ -1,8 +0,0 @@
|
|||
export interface PartnerStorePagination {
|
||||
length: number;
|
||||
size: number;
|
||||
page: number;
|
||||
lastPage: number;
|
||||
startIndex: number;
|
||||
endIndex: number;
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
export interface PartnerStore {
|
||||
id?: string;
|
||||
totalPartnerCount?: number;
|
||||
totalHoldingMoney?: number;
|
||||
totalComp?: number;
|
||||
total?: number;
|
||||
branchCount?: number;
|
||||
divisionCount?: number;
|
||||
officeCount?: number;
|
||||
storeCount?: number;
|
||||
memberCount?: number;
|
||||
nickname?: string;
|
||||
accountHolder?: string;
|
||||
phoneNumber?: string;
|
||||
calculateType?: string;
|
||||
ownCash?: number;
|
||||
ownComp?: number;
|
||||
ownCoupon?: number;
|
||||
gameMoney?: number;
|
||||
todayComp?: number;
|
||||
totalDeposit?: number;
|
||||
totalWithdraw?: number;
|
||||
balance?: number;
|
||||
registDate?: string;
|
||||
finalSigninDate?: string;
|
||||
ip?: string;
|
||||
state?: string;
|
||||
note?: string;
|
||||
}
|
|
@ -1,50 +0,0 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule } from '@angular/router';
|
||||
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatFormFieldModule } from '@angular/material/form-field';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { MatInputModule } from '@angular/material/input';
|
||||
import { MatPaginatorModule } from '@angular/material/paginator';
|
||||
import { MatProgressBarModule } from '@angular/material/progress-bar';
|
||||
import { MatRippleModule } from '@angular/material/core';
|
||||
import { MatSortModule } from '@angular/material/sort';
|
||||
import { MatSelectModule } from '@angular/material/select';
|
||||
import { MatTooltipModule } from '@angular/material/tooltip';
|
||||
import { MatGridListModule } from '@angular/material/grid-list';
|
||||
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
|
||||
import { MatRadioModule } from '@angular/material/radio';
|
||||
import { MatCheckboxModule } from '@angular/material/checkbox';
|
||||
|
||||
import { TranslocoModule } from '@ngneat/transloco';
|
||||
|
||||
import { SharedModule } from 'app/shared/shared.module';
|
||||
|
||||
import { COMPONENTS } from './components';
|
||||
|
||||
import { partnerStoreRoutes } from './partner-store.routing';
|
||||
|
||||
@NgModule({
|
||||
declarations: [COMPONENTS],
|
||||
imports: [
|
||||
TranslocoModule,
|
||||
SharedModule,
|
||||
RouterModule.forChild(partnerStoreRoutes),
|
||||
|
||||
MatButtonModule,
|
||||
MatFormFieldModule,
|
||||
MatIconModule,
|
||||
MatInputModule,
|
||||
MatPaginatorModule,
|
||||
MatProgressBarModule,
|
||||
MatRippleModule,
|
||||
MatSortModule,
|
||||
MatSelectModule,
|
||||
MatTooltipModule,
|
||||
MatGridListModule,
|
||||
MatSlideToggleModule,
|
||||
MatRadioModule,
|
||||
MatCheckboxModule,
|
||||
],
|
||||
})
|
||||
export class PartnerStoreModule {}
|
|
@ -1,24 +0,0 @@
|
|||
import { Route } from '@angular/router';
|
||||
|
||||
import { ListComponent } from './components/list.component';
|
||||
import { ViewComponent } from '../user/components/view.component';
|
||||
|
||||
import { PartnerStoresResolver } from './resolvers/partner-store.resolver';
|
||||
import { UserResolver } from '../user/resolvers/user.resolver';
|
||||
|
||||
export const partnerStoreRoutes: Route[] = [
|
||||
{
|
||||
path: '',
|
||||
component: ListComponent,
|
||||
resolve: {
|
||||
partnerStores: PartnerStoresResolver,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: ':id',
|
||||
component: ViewComponent,
|
||||
resolve: {
|
||||
users: UserResolver,
|
||||
},
|
||||
},
|
||||
];
|
|
@ -1,89 +0,0 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import {
|
||||
ActivatedRouteSnapshot,
|
||||
Resolve,
|
||||
Router,
|
||||
RouterStateSnapshot,
|
||||
} from '@angular/router';
|
||||
import { catchError, Observable, throwError } from 'rxjs';
|
||||
|
||||
import { PartnerStore } from '../models/partner-store';
|
||||
import { PartnerStorePagination } from '../models/partner-store-pagination';
|
||||
import { PartnerStoreService } from '../services/partner-store.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class PartnerStoreResolver implements Resolve<any> {
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
constructor(
|
||||
private _partnerStoreService: PartnerStoreService,
|
||||
private _router: Router
|
||||
) {}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
// @ Public methods
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Resolver
|
||||
*
|
||||
* @param route
|
||||
* @param state
|
||||
*/
|
||||
resolve(
|
||||
route: ActivatedRouteSnapshot,
|
||||
state: RouterStateSnapshot
|
||||
): Observable<PartnerStore | undefined> {
|
||||
return this._partnerStoreService
|
||||
.getPartnerStoreById(route.paramMap.get('id'))
|
||||
.pipe(
|
||||
// Error here means the requested product is not available
|
||||
catchError((error) => {
|
||||
// Log the error
|
||||
console.error(error);
|
||||
|
||||
// Get the parent url
|
||||
const parentUrl = state.url.split('/').slice(0, -1).join('/');
|
||||
|
||||
// Navigate to there
|
||||
this._router.navigateByUrl(parentUrl);
|
||||
|
||||
// Throw an error
|
||||
return throwError(error);
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class PartnerStoresResolver implements Resolve<any> {
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
constructor(private _partnerStoreService: PartnerStoreService) {}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
// @ Public methods
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Resolver
|
||||
*
|
||||
* @param route
|
||||
* @param state
|
||||
*/
|
||||
resolve(
|
||||
route: ActivatedRouteSnapshot,
|
||||
state: RouterStateSnapshot
|
||||
): Observable<{
|
||||
pagination: PartnerStorePagination;
|
||||
partnerStores: PartnerStore[];
|
||||
}> {
|
||||
return this._partnerStoreService.getPartnerStores();
|
||||
}
|
||||
}
|
|
@ -1,158 +0,0 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import {
|
||||
BehaviorSubject,
|
||||
filter,
|
||||
map,
|
||||
Observable,
|
||||
of,
|
||||
switchMap,
|
||||
take,
|
||||
tap,
|
||||
throwError,
|
||||
} from 'rxjs';
|
||||
|
||||
import { PartnerStore } from '../models/partner-store';
|
||||
import { PartnerStorePagination } from '../models/partner-store-pagination';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class PartnerStoreService {
|
||||
// Private
|
||||
private __pagination = new BehaviorSubject<
|
||||
PartnerStorePagination | undefined
|
||||
>(undefined);
|
||||
private __partnerStore = new BehaviorSubject<PartnerStore | undefined>(
|
||||
undefined
|
||||
);
|
||||
private __partnerStores = new BehaviorSubject<PartnerStore[] | undefined>(
|
||||
undefined
|
||||
);
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
constructor(private _httpClient: HttpClient) {}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
// @ Accessors
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Getter for pagination
|
||||
*/
|
||||
get pagination$(): Observable<PartnerStorePagination | undefined> {
|
||||
return this.__pagination.asObservable();
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for partnerStore
|
||||
*/
|
||||
get partnerStore$(): Observable<PartnerStore | undefined> {
|
||||
return this.__partnerStore.asObservable();
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for partnerStores
|
||||
*/
|
||||
get partnerStores$(): Observable<PartnerStore[] | undefined> {
|
||||
return this.__partnerStores.asObservable();
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
// @ Public methods
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Get partnerStores
|
||||
*
|
||||
*
|
||||
* @param page
|
||||
* @param size
|
||||
* @param sort
|
||||
* @param order
|
||||
* @param search
|
||||
*/
|
||||
getPartnerStores(
|
||||
page: number = 0,
|
||||
size: number = 10,
|
||||
sort: string = 'name',
|
||||
order: 'asc' | 'desc' | '' = 'asc',
|
||||
search: string = ''
|
||||
): Observable<{
|
||||
pagination: PartnerStorePagination;
|
||||
partnerStores: PartnerStore[];
|
||||
}> {
|
||||
return this._httpClient
|
||||
.get<{
|
||||
pagination: PartnerStorePagination;
|
||||
partnerStores: PartnerStore[];
|
||||
}>('api/apps/member/partner-store/partner-stores', {
|
||||
params: {
|
||||
page: '' + page,
|
||||
size: '' + size,
|
||||
sort,
|
||||
order,
|
||||
search,
|
||||
},
|
||||
})
|
||||
.pipe(
|
||||
tap((response) => {
|
||||
this.__pagination.next(response.pagination);
|
||||
this.__partnerStores.next(response.partnerStores);
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get product by id
|
||||
*/
|
||||
getPartnerStoreById(id: string | null): Observable<PartnerStore> {
|
||||
return this.__partnerStores.pipe(
|
||||
take(1),
|
||||
map((partnerStores) => {
|
||||
// Find the product
|
||||
const partnerStore =
|
||||
partnerStores?.find((item) => item.id === id) || undefined;
|
||||
|
||||
// Update the product
|
||||
this.__partnerStore.next(partnerStore);
|
||||
|
||||
// Return the product
|
||||
return partnerStore;
|
||||
}),
|
||||
switchMap((product) => {
|
||||
if (!product) {
|
||||
return throwError('Could not found product with id of ' + id + '!');
|
||||
}
|
||||
|
||||
return of(product);
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create product
|
||||
*/
|
||||
createPartnerStore(): Observable<PartnerStore> {
|
||||
return this.partnerStores$.pipe(
|
||||
take(1),
|
||||
switchMap((partnerStores) =>
|
||||
this._httpClient
|
||||
.post<PartnerStore>('api/apps/member/partner-store/product', {})
|
||||
.pipe(
|
||||
map((newPartnerStore) => {
|
||||
// Update the partnerStores with the new product
|
||||
if (!!partnerStores) {
|
||||
this.__partnerStores.next([newPartnerStore, ...partnerStores]);
|
||||
}
|
||||
|
||||
// Return the new product
|
||||
return newPartnerStore;
|
||||
})
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
|
@ -36,8 +36,8 @@ import { PartnerService } from '../services/partner.service';
|
|||
import { Router } from '@angular/router';
|
||||
|
||||
@Component({
|
||||
selector: 'list',
|
||||
templateUrl: './list.component.html',
|
||||
selector: 'app-partner-list',
|
||||
templateUrl: './all-list.component.html',
|
||||
styles: [
|
||||
/* language=SCSS */
|
||||
`
|
||||
|
@ -62,7 +62,7 @@ import { Router } from '@angular/router';
|
|||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
animations: fuseAnimations,
|
||||
})
|
||||
export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||
export class AllListComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||
@ViewChild(MatPaginator) private _paginator!: MatPaginator;
|
||||
@ViewChild(MatSort) private _sort!: MatSort;
|
||||
|
|
@ -30,14 +30,16 @@ import { fuseAnimations } from '@fuse/animations';
|
|||
import { FuseConfirmationService } from '@fuse/services/confirmation';
|
||||
|
||||
import { User } from '../../user/models/user';
|
||||
import { PartnerBranch } from '../models/partner-branch';
|
||||
import { PartnerBranchPagination } from '../models/partner-branch-pagination';
|
||||
import { PartnerBranchService } from '../services/partner-branch.service';
|
||||
|
||||
import { Partner as PartnerBranch } from '../models/partner';
|
||||
import { PartnerPagination as PartnerBranchPagination } from '../models/partner-pagination';
|
||||
import { PartnerService as PartnerBranchService } from '../services/partner.service';
|
||||
|
||||
import { Router } from '@angular/router';
|
||||
|
||||
@Component({
|
||||
selector: 'partner-branch-list',
|
||||
templateUrl: './list.component.html',
|
||||
selector: 'app-partner-branch-list',
|
||||
templateUrl: './branch-list.component.html',
|
||||
styles: [
|
||||
/* language=SCSS */
|
||||
`
|
||||
|
@ -62,11 +64,12 @@ import { Router } from '@angular/router';
|
|||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
animations: fuseAnimations,
|
||||
})
|
||||
export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||
export class BranchListComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||
@ViewChild(MatPaginator) private _paginator!: MatPaginator;
|
||||
@ViewChild(MatSort) private _sort!: MatSort;
|
||||
|
||||
partnerBranchs$!: Observable<PartnerBranch[] | undefined>;
|
||||
|
||||
users$!: Observable<User[] | undefined>;
|
||||
|
||||
isLoading = false;
|
||||
|
@ -107,7 +110,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
});
|
||||
|
||||
// Get the products
|
||||
this.partnerBranchs$ = this._partnerBranchService.partnerBranchs$;
|
||||
this.partnerBranchs$ = this._partnerBranchService.partners$;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -138,7 +141,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
.pipe(
|
||||
switchMap(() => {
|
||||
this.isLoading = true;
|
||||
return this._partnerBranchService.getPartnerBranchs(
|
||||
return this._partnerBranchService.getPartners(
|
||||
this._paginator.pageIndex,
|
||||
this._paginator.pageSize,
|
||||
this._sort.active,
|
|
@ -30,14 +30,15 @@ import { fuseAnimations } from '@fuse/animations';
|
|||
import { FuseConfirmationService } from '@fuse/services/confirmation';
|
||||
|
||||
import { User } from '../../user/models/user';
|
||||
import { PartnerDivision } from '../models/partner-division';
|
||||
import { PartnerDivisionPagination } from '../models/partner-division-pagination';
|
||||
import { PartnerDivisionService } from '../services/partner-division.service';
|
||||
import { Partner as PartnerDivision } from '../models/partner';
|
||||
import { PartnerPagination as PartnerDivisionPagination } from '../models/partner-pagination';
|
||||
import { PartnerService as PartnerDivisionService } from '../services/partner.service';
|
||||
|
||||
import { Router } from '@angular/router';
|
||||
|
||||
@Component({
|
||||
selector: 'partner-division-list',
|
||||
templateUrl: './list.component.html',
|
||||
selector: 'app-partner-division-list',
|
||||
templateUrl: './division-list.component.html',
|
||||
styles: [
|
||||
/* language=SCSS */
|
||||
`
|
||||
|
@ -62,7 +63,7 @@ import { Router } from '@angular/router';
|
|||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
animations: fuseAnimations,
|
||||
})
|
||||
export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||
export class DivisionListComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||
@ViewChild(MatPaginator) private _paginator!: MatPaginator;
|
||||
@ViewChild(MatSort) private _sort!: MatSort;
|
||||
|
||||
|
@ -107,7 +108,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
});
|
||||
|
||||
// Get the products
|
||||
this.partnerDivisions$ = this._partnerDivisionService.partnerDivisions$;
|
||||
this.partnerDivisions$ = this._partnerDivisionService.partners$;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -138,7 +139,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
.pipe(
|
||||
switchMap(() => {
|
||||
this.isLoading = true;
|
||||
return this._partnerDivisionService.getPartnerDivisions(
|
||||
return this._partnerDivisionService.getPartners(
|
||||
this._paginator.pageIndex,
|
||||
this._paginator.pageSize,
|
||||
this._sort.active,
|
|
@ -1,3 +1,17 @@
|
|||
import { ListComponent } from './list.component';
|
||||
import { AllListComponent } from './all-list.component';
|
||||
import { MainOfficeListComponent } from './main-office-list.component';
|
||||
import { BranchListComponent } from './branch-list.component';
|
||||
import { DivisionListComponent } from './division-list.component';
|
||||
import { OfficeListComponent } from './office-list.component';
|
||||
import { RecommendationListComponent } from './recommendation-list.component';
|
||||
import { StoreListComponent } from './store-list.component';
|
||||
|
||||
export const COMPONENTS = [ListComponent];
|
||||
export const COMPONENTS = [
|
||||
AllListComponent,
|
||||
MainOfficeListComponent,
|
||||
OfficeListComponent,
|
||||
BranchListComponent,
|
||||
DivisionListComponent,
|
||||
RecommendationListComponent,
|
||||
StoreListComponent,
|
||||
];
|
||||
|
|
|
@ -30,14 +30,14 @@ import { fuseAnimations } from '@fuse/animations';
|
|||
import { FuseConfirmationService } from '@fuse/services/confirmation';
|
||||
|
||||
import { User } from '../../user/models/user';
|
||||
import { PartnerMainoffice } from '../models/partner-mainoffice';
|
||||
import { PartnerMainofficePagination } from '../models/partner-mainoffice-pagination';
|
||||
import { PartnerMainofficeService } from '../services/partner-mainoffice.service';
|
||||
import { Partner as PartnerMainoffice } from '../models/partner';
|
||||
import { PartnerPagination as PartnerMainofficePagination } from '../models/partner-pagination';
|
||||
import { PartnerService as PartnerMainofficeService } from '../services/partner.service';
|
||||
import { Router } from '@angular/router';
|
||||
|
||||
@Component({
|
||||
selector: 'partner-mainoffice-list',
|
||||
templateUrl: './list.component.html',
|
||||
selector: 'app-partner-main-office-list',
|
||||
templateUrl: './main-office-list.component.html',
|
||||
styles: [
|
||||
/* language=SCSS */
|
||||
`
|
||||
|
@ -62,7 +62,9 @@ import { Router } from '@angular/router';
|
|||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
animations: fuseAnimations,
|
||||
})
|
||||
export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||
export class MainOfficeListComponent
|
||||
implements OnInit, AfterViewInit, OnDestroy
|
||||
{
|
||||
@ViewChild(MatPaginator) private _paginator!: MatPaginator;
|
||||
@ViewChild(MatSort) private _sort!: MatSort;
|
||||
|
||||
|
@ -107,8 +109,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
});
|
||||
|
||||
// Get the products
|
||||
this.partnerMainoffices$ =
|
||||
this._partnerMainofficeService.partnerMainoffices$;
|
||||
this.partnerMainoffices$ = this._partnerMainofficeService.partners$;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -139,7 +140,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
.pipe(
|
||||
switchMap(() => {
|
||||
this.isLoading = true;
|
||||
return this._partnerMainofficeService.getPartnerMainoffices(
|
||||
return this._partnerMainofficeService.getPartners(
|
||||
this._paginator.pageIndex,
|
||||
this._paginator.pageSize,
|
||||
this._sort.active,
|
|
@ -30,14 +30,16 @@ import { fuseAnimations } from '@fuse/animations';
|
|||
import { FuseConfirmationService } from '@fuse/services/confirmation';
|
||||
|
||||
import { User } from '../../user/models/user';
|
||||
import { PartnerOffice } from '../models/partner-office';
|
||||
import { PartnerOfficePagination } from '../models/partner-office-pagination';
|
||||
import { PartnerOfficeService } from '../services/partner-office.service';
|
||||
|
||||
import { Partner as PartnerOffice } from '../models/partner';
|
||||
import { PartnerPagination as PartnerOfficePagination } from '../models/partner-pagination';
|
||||
import { PartnerService as PartnerOfficeService } from '../services/partner.service';
|
||||
|
||||
import { Router } from '@angular/router';
|
||||
|
||||
@Component({
|
||||
selector: 'partner-office-list',
|
||||
templateUrl: './list.component.html',
|
||||
selector: 'app-partner-office-list',
|
||||
templateUrl: './office-list.component.html',
|
||||
styles: [
|
||||
/* language=SCSS */
|
||||
`
|
||||
|
@ -62,7 +64,7 @@ import { Router } from '@angular/router';
|
|||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
animations: fuseAnimations,
|
||||
})
|
||||
export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||
export class OfficeListComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||
@ViewChild(MatPaginator) private _paginator!: MatPaginator;
|
||||
@ViewChild(MatSort) private _sort!: MatSort;
|
||||
|
||||
|
@ -107,7 +109,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
});
|
||||
|
||||
// Get the products
|
||||
this.partnerOffices$ = this._partnerOfficeService.partnerOffices$;
|
||||
this.partnerOffices$ = this._partnerOfficeService.partners$;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -138,7 +140,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
.pipe(
|
||||
switchMap(() => {
|
||||
this.isLoading = true;
|
||||
return this._partnerOfficeService.getPartnerOffices(
|
||||
return this._partnerOfficeService.getPartners(
|
||||
this._paginator.pageIndex,
|
||||
this._paginator.pageSize,
|
||||
this._sort.active,
|
|
@ -30,14 +30,16 @@ import { fuseAnimations } from '@fuse/animations';
|
|||
import { FuseConfirmationService } from '@fuse/services/confirmation';
|
||||
|
||||
import { User } from '../../user/models/user';
|
||||
import { PartnerRecommendation } from '../models/partner-recommendation';
|
||||
import { PartnerRecommendationPagination } from '../models/partner-recommendation-pagination';
|
||||
import { PartnerRecommendationService } from '../services/partner-recommendation.service';
|
||||
|
||||
import { Partner as PartnerRecommendation } from '../models/partner';
|
||||
import { PartnerPagination as PartnerRecommendationPagination } from '../models/partner-pagination';
|
||||
import { PartnerService as PartnerRecommendationService } from '../services/partner.service';
|
||||
|
||||
import { Router } from '@angular/router';
|
||||
|
||||
@Component({
|
||||
selector: 'partner-recommendation-list',
|
||||
templateUrl: './list.component.html',
|
||||
selector: 'app-partner-recommendation-list',
|
||||
templateUrl: './recommendation-list.component.html',
|
||||
styles: [
|
||||
/* language=SCSS */
|
||||
`
|
||||
|
@ -62,7 +64,9 @@ import { Router } from '@angular/router';
|
|||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
animations: fuseAnimations,
|
||||
})
|
||||
export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||
export class RecommendationListComponent
|
||||
implements OnInit, AfterViewInit, OnDestroy
|
||||
{
|
||||
@ViewChild(MatPaginator) private _paginator!: MatPaginator;
|
||||
@ViewChild(MatSort) private _sort!: MatSort;
|
||||
|
||||
|
@ -107,8 +111,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
});
|
||||
|
||||
// Get the products
|
||||
this.partnerRecommendations$ =
|
||||
this._partnerRecommendationService.partnerRecommendations$;
|
||||
this.partnerRecommendations$ = this._partnerRecommendationService.partners$;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -139,7 +142,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
.pipe(
|
||||
switchMap(() => {
|
||||
this.isLoading = true;
|
||||
return this._partnerRecommendationService.getPartnerRecommendations(
|
||||
return this._partnerRecommendationService.getPartners(
|
||||
this._paginator.pageIndex,
|
||||
this._paginator.pageSize,
|
||||
this._sort.active,
|
|
@ -30,14 +30,15 @@ import { fuseAnimations } from '@fuse/animations';
|
|||
import { FuseConfirmationService } from '@fuse/services/confirmation';
|
||||
|
||||
import { User } from '../../user/models/user';
|
||||
import { PartnerStore } from '../models/partner-store';
|
||||
import { PartnerStorePagination } from '../models/partner-store-pagination';
|
||||
import { PartnerStoreService } from '../services/partner-store.service';
|
||||
import { Partner as PartnerStore } from '../models/partner';
|
||||
import { PartnerPagination as PartnerStorePagination } from '../models/partner-pagination';
|
||||
import { PartnerService as PartnerStoreService } from '../services/partner.service';
|
||||
|
||||
import { Router } from '@angular/router';
|
||||
|
||||
@Component({
|
||||
selector: 'partner-store-list',
|
||||
templateUrl: './list.component.html',
|
||||
selector: 'app-partner-store-list',
|
||||
templateUrl: './store-list.component.html',
|
||||
styles: [
|
||||
/* language=SCSS */
|
||||
`
|
||||
|
@ -62,7 +63,7 @@ import { Router } from '@angular/router';
|
|||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
animations: fuseAnimations,
|
||||
})
|
||||
export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||
export class StoreListComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||
@ViewChild(MatPaginator) private _paginator!: MatPaginator;
|
||||
@ViewChild(MatSort) private _sort!: MatSort;
|
||||
|
||||
|
@ -107,7 +108,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
});
|
||||
|
||||
// Get the products
|
||||
this.partnerStores$ = this._partnerStoreService.partnerStores$;
|
||||
this.partnerStores$ = this._partnerStoreService.partners$;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -138,7 +139,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
.pipe(
|
||||
switchMap(() => {
|
||||
this.isLoading = true;
|
||||
return this._partnerStoreService.getPartnerStores(
|
||||
return this._partnerStoreService.getPartners(
|
||||
this._paginator.pageIndex,
|
||||
this._paginator.pageSize,
|
||||
this._sort.active,
|
|
@ -20,6 +20,9 @@ export interface Partner {
|
|||
comp?: number;
|
||||
coupon?: number;
|
||||
ownCharge?: number;
|
||||
ownCash?: number;
|
||||
ownComp?: number;
|
||||
ownCoupon?: number;
|
||||
bottomCharge?: number;
|
||||
ownExchange?: number;
|
||||
bottomExchange?: number;
|
||||
|
@ -28,4 +31,14 @@ export interface Partner {
|
|||
accession?: string;
|
||||
state?: string;
|
||||
note?: string;
|
||||
ip?: string;
|
||||
totalPartnerCount?: number;
|
||||
total?: number;
|
||||
gameMoney?: number;
|
||||
todayComp?: number;
|
||||
totalDeposit?: number;
|
||||
totalWithdraw?: number;
|
||||
balance?: number;
|
||||
registDate?: string;
|
||||
finalSigninDate?: string;
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ import { MatTooltipModule } from '@angular/material/tooltip';
|
|||
import { MatGridListModule } from '@angular/material/grid-list';
|
||||
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
|
||||
import { MatRadioModule } from '@angular/material/radio';
|
||||
import { MatCheckboxModule } from '@angular/material/checkbox';
|
||||
|
||||
import { TranslocoModule } from '@ngneat/transloco';
|
||||
|
||||
|
@ -43,6 +44,7 @@ import { partnerRoutes } from './partner.routing';
|
|||
MatGridListModule,
|
||||
MatSlideToggleModule,
|
||||
MatRadioModule,
|
||||
MatCheckboxModule,
|
||||
],
|
||||
})
|
||||
export class PartnerModule {}
|
||||
|
|
|
@ -1,24 +1,68 @@
|
|||
import { Route } from '@angular/router';
|
||||
|
||||
import { ListComponent } from './components/list.component';
|
||||
import { ViewComponent } from '../user/components/view.component';
|
||||
import { AllListComponent } from './components/all-list.component';
|
||||
import { MainOfficeListComponent } from './components/main-office-list.component';
|
||||
import { OfficeListComponent } from './components/office-list.component';
|
||||
import { BranchListComponent } from './components/branch-list.component';
|
||||
import { DivisionListComponent } from './components/division-list.component';
|
||||
import { RecommendationListComponent } from './components/recommendation-list.component';
|
||||
import { StoreListComponent } from './components/store-list.component';
|
||||
|
||||
import { PartnersResolver } from './resolvers/partner.resolver';
|
||||
import { UserResolver } from '../user/resolvers/user.resolver';
|
||||
|
||||
export const partnerRoutes: Route[] = [
|
||||
{
|
||||
path: '',
|
||||
component: ListComponent,
|
||||
pathMatch: 'full',
|
||||
redirectTo: 'all',
|
||||
},
|
||||
{
|
||||
path: 'all',
|
||||
component: AllListComponent,
|
||||
resolve: {
|
||||
Partners: PartnersResolver,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: ':id',
|
||||
component: ViewComponent,
|
||||
path: 'main-office',
|
||||
component: MainOfficeListComponent,
|
||||
resolve: {
|
||||
users: UserResolver,
|
||||
Partners: PartnersResolver,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'branch',
|
||||
component: BranchListComponent,
|
||||
resolve: {
|
||||
Partners: PartnersResolver,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'division',
|
||||
component: DivisionListComponent,
|
||||
resolve: {
|
||||
Partners: PartnersResolver,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'recommendation',
|
||||
component: RecommendationListComponent,
|
||||
resolve: {
|
||||
Partners: PartnersResolver,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'office',
|
||||
component: OfficeListComponent,
|
||||
resolve: {
|
||||
Partners: PartnersResolver,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'store',
|
||||
component: StoreListComponent,
|
||||
resolve: {
|
||||
Partners: PartnersResolver,
|
||||
},
|
||||
},
|
||||
];
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
"Casinomoney": "CASINO 머니파악",
|
||||
"Unconnected": "장기미접속회원",
|
||||
"Project": "프로젝트",
|
||||
"partner-management": "파트너관리",
|
||||
"All Partner": "전체파트너",
|
||||
"Partner Mainoffice": "본사",
|
||||
"Partner Branch": "대본",
|
||||
|
|
Loading…
Reference in New Issue
Block a user