From a579a1be6380843324d8d3a6c0e22b4e6bd238df Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Fri, 10 Mar 2023 14:11:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../agent-list/agent-list.component.html | 98 ++++++++++++++++- .../agent-list/agent-list.component.scss | 17 +++ .../agent/agent-list/agent-list.component.ts | 101 +++++++++++++++++- .../company-list/company-list.component.html | 70 +++++++++++- .../company-list/company-list.component.scss | 7 ++ .../company-list/company-list.component.ts | 81 +++++++++++++- .../device-list/device-list.component.html | 2 +- .../device-list/device-list.component.ts | 4 +- ...tore-discount-activity-edit.component.html | 7 ++ .../store-discount-activity-edit.component.ts | 1 + ...tore-discount-activity-list.component.html | 1 + .../trade-take-config-routing.module.ts | 11 ++ .../trade-take-config.module.ts | 14 +++ src/app/services/trade-take-config.service.ts | 68 ++++++++++++ src/environments/environment.prod.ts | 6 +- src/environments/environment.ts | 6 +- 16 files changed, 476 insertions(+), 18 deletions(-) create mode 100644 src/app/admin/trade-take-config/trade-take-config-routing.module.ts create mode 100644 src/app/admin/trade-take-config/trade-take-config.module.ts create mode 100644 src/app/services/trade-take-config.service.ts diff --git a/src/app/admin/agent/agent-list/agent-list.component.html b/src/app/admin/agent/agent-list/agent-list.component.html index 06232c8..417408a 100644 --- a/src/app/admin/agent/agent-list/agent-list.component.html +++ b/src/app/admin/agent/agent-list/agent-list.component.html @@ -87,7 +87,7 @@ 详细地址 状态 创建时间 - 操作 + 操作 @@ -101,13 +101,101 @@ {{data.status | agentStatus}} {{data.createTime | date : 'yyyy-MM-dd HH:mm:ss'}} + 更多操作 + + + - 修改 - 停用 - 启用 - 删除 + + + + +
+
+
+ + 平台类型 + + + + + + +
+ +
公司入账配置
+
+ + 入账商户名称 + + + + +
+
+ + 平台入账商户号 + + + + +
+
+ + 分账比例(%) + + + + +
+ +
代理商入账配置
+
+ + 入账商户名称 + + + + +
+
+ + 平台入账商户号 + + + + +
+
+ + 分账比例(%) + + + + +
+ +
+ + + + + + +
+ +
+
+ +
diff --git a/src/app/admin/agent/agent-list/agent-list.component.scss b/src/app/admin/agent/agent-list/agent-list.component.scss index 690993b..8c7d488 100644 --- a/src/app/admin/agent/agent-list/agent-list.component.scss +++ b/src/app/admin/agent/agent-list/agent-list.component.scss @@ -1,3 +1,20 @@ .table-td-operation a { padding: 0px 5px; } +.title { + width: 100%; + height: 46px; + line-height: 46px; + font-size: 16px; + text-align: center; + color: #1890ff; + background-color: #f3f9ff; + margin-bottom: 20px; +} +nz-input-number { + width: 100%; +} +button { + width: 100px; + margin-left: 8px; +} diff --git a/src/app/admin/agent/agent-list/agent-list.component.ts b/src/app/admin/agent/agent-list/agent-list.component.ts index c3fe22a..1957af1 100644 --- a/src/app/admin/agent/agent-list/agent-list.component.ts +++ b/src/app/admin/agent/agent-list/agent-list.component.ts @@ -1,10 +1,12 @@ import { Component, OnInit } from '@angular/core'; import {NzMessageService, NzModalService} from 'ng-zorro-antd'; import {AgentService} from '../../../services/agent.service'; -import {FormBuilder, FormGroup} from '@angular/forms'; +import {FormBuilder, FormGroup, Validators} from '@angular/forms'; import {CompanyService} from '../../../services/company.service'; import {LocalStorageService} from '../../../services/local-storage.service'; import {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace'; +import {TradeTakeConfigService} from '../../../services/trade-take-config.service'; +import {CommonsService} from '../../../services/commons.service'; @Component({ selector: 'app-agent-list', @@ -16,26 +18,46 @@ export class AgentListComponent implements OnInit { dataObject: any = {}; tableLoading = true; searchForm: FormGroup; + tradeTakeConfigForm: FormGroup; pageNum: number; whereObject: any = {}; userObjectType: number; companyArray = []; + tradeTakeConfigMadel = false; + platformTypeArray = []; + constructor(private modal: NzModalService, private message: NzMessageService, private agentService: AgentService, private companyService: CompanyService, + private commonsService: CommonsService, private localStorageService: LocalStorageService, + private tradeTakeConfigService: TradeTakeConfigService, private form: FormBuilder) { this.userObjectType = Number(this.localStorageService.get(ADMIN_INFO_OBJECT)['secUser']['objectType']); } - ngOnInit(): void { if (this.userObjectType != null && this.userObjectType === 0) { this.getCompanyList(); } + this.commonsService.getDictionary('PLATFORM_TYPE', data => { + this.platformTypeArray = data['return_data']; + }); + + this.tradeTakeConfigForm = this.form.group({ + platformType: ['4', [Validators.required]], + receiverName: [null, [Validators.required]], + receiverAccount: [null, [Validators.required]], + receiverRatio: [100, [Validators.required]], + + subReceiverName: [null, [Validators.required]], + subReceiverAccount: [null, [Validators.required]], + subReceiverRatio: [{ value: 0, disabled: true }, [Validators.required]], + subReceiverObjectId: [null, [Validators.required]], + }); this.searchForm = this.form.group({ companyId: [null], @@ -155,4 +177,79 @@ export class AgentListComponent implements OnInit { }); } + + /** + * 展示交易分账配置 + */ + showTradeTakeConfigMadel(agentId: number) { + this.tradeTakeConfigService.getAgentTradeTakeConfig(this.tradeTakeConfigForm.controls['platformType'].value, agentId, data => { + if (data['return_code'] === '000000') { + if (data['return_data'] != null) { + data['return_data']['platformType'] = String(data['return_data']['platformType']); + data['return_data']['receiverRatio'] = data['return_data']['receiverRatio'] * 100; + data['return_data']['subReceiverRatio'] = data['return_data']['subReceiverRatio'] * 100; + this.tradeTakeConfigForm.patchValue(data['return_data']); + } else { + this.tradeTakeConfigForm.controls['subReceiverObjectId'].setValue(agentId); + } + } + }); + this.tradeTakeConfigMadel = true; + } + + /** + * 关闭交易分账配置 + */ + closeTradeTakeConfigMadel() { + this.tradeTakeConfigForm.reset(); + this.tradeTakeConfigForm.controls['platformType'].setValue('4'); + this.tradeTakeConfigForm.controls['receiverRatio'].setValue('100'); + this.tradeTakeConfigForm.controls['subReceiverRatio'].setValue('0'); + this.tradeTakeConfigMadel = false; + } + + /** + * 提交配置 + */ + submitTradeTakeConfig() { + for (const i in this.tradeTakeConfigForm.controls) { + this.tradeTakeConfigForm.controls[i].markAsDirty(); + this.tradeTakeConfigForm.controls[i].updateValueAndValidity(); + } + if (this.tradeTakeConfigForm.status == null || this.tradeTakeConfigForm.status !== 'VALID') { + this.modal.warning({ + nzTitle: '提示', + nzContent: '请规范填写所有的必填项信息', + }); + return; + } + this.tradeTakeConfigForm.value['receiverRatio'] = this.tradeTakeConfigForm.controls['receiverRatio']['value'] / 100; + this.tradeTakeConfigForm.value['subReceiverRatio'] = this.tradeTakeConfigForm.controls['subReceiverRatio']['value'] / 100; + this.tradeTakeConfigService.editAgentConfig(this.tradeTakeConfigForm.value, data => { + if (data['return_code'] === '000000') { + this.modal.success({ + nzTitle: '提示', + nzContent: '添加成功', + nzOnOk: () => this.closeTradeTakeConfigMadel() + }); + } else { + this.modal.error({ + nzTitle: '提示', + nzContent: data['return_msg'], + }); + } + }); + } + + /** + * 计算 + * @param ratio + * @param subRatio + */ + compute(ratio: number) { + // console.log(parentRatio); + // this.tradeTakeConfigForm['receiverRatio'].value = parentRatio; + this.tradeTakeConfigForm.controls['subReceiverRatio'].setValue(100 - ratio); + } + } diff --git a/src/app/admin/company/company-list/company-list.component.html b/src/app/admin/company/company-list/company-list.component.html index 1a5ddc9..5bf54b6 100644 --- a/src/app/admin/company/company-list/company-list.component.html +++ b/src/app/admin/company/company-list/company-list.component.html @@ -48,7 +48,7 @@ 联系电话 详细地址 创建时间 - 操作 + 操作 @@ -60,10 +60,76 @@ {{data.address?data.address:'未填写'}} {{data.createTime | date : 'yyyy-MM-dd HH:mm:ss'}} + 更多操作 + + + - 修改 + + + + +
+
+
+ + 交易平台类型 + + + + + + +
+ +
+ + 入账商户名称 + + + + +
+ +
+ + 入账商户号 + + + + +
+ +
+ + 抽成比例(%) + + + + +
+ +
+ + + + + + +
+ +
+
+ +
+
+ +
diff --git a/src/app/admin/company/company-list/company-list.component.scss b/src/app/admin/company/company-list/company-list.component.scss index e69de29..276c90b 100644 --- a/src/app/admin/company/company-list/company-list.component.scss +++ b/src/app/admin/company/company-list/company-list.component.scss @@ -0,0 +1,7 @@ +button { + width: 100px; + margin-left: 8px; +} +nz-input-number { + width: 100%; +} diff --git a/src/app/admin/company/company-list/company-list.component.ts b/src/app/admin/company/company-list/company-list.component.ts index 27671d6..cb91ea6 100644 --- a/src/app/admin/company/company-list/company-list.component.ts +++ b/src/app/admin/company/company-list/company-list.component.ts @@ -1,7 +1,9 @@ import { Component, OnInit } from '@angular/core'; -import {FormBuilder, FormGroup} from '@angular/forms'; +import {FormBuilder, FormGroup, Validators} from '@angular/forms'; import {NzMessageService, NzModalService} from 'ng-zorro-antd'; import {CompanyService} from '../../../services/company.service'; +import {CommonsService} from '../../../services/commons.service'; +import {TradeTakeConfigService} from '../../../services/trade-take-config.service'; @Component({ selector: 'app-company-list', @@ -13,18 +15,34 @@ export class CompanyListComponent implements OnInit { dataObject: any = {}; tableLoading = true; searchForm: FormGroup; + tradeTakeConfigForm: FormGroup; pageNum: number; whereObject: any = {}; + tradeTakeConfigMadel = false; + platformTypeArray = []; constructor(private modal: NzModalService, private message: NzMessageService, private companyService: CompanyService, + private commonsService: CommonsService, + private tradeTakeConfigService: TradeTakeConfigService, private form: FormBuilder) { } ngOnInit(): void { this.searchForm = this.form.group({ name: [null], }); + this.commonsService.getDictionary('PLATFORM_TYPE', data => { + this.platformTypeArray = data['return_data']; + }); + + this.tradeTakeConfigForm = this.form.group({ + companyId: [null, [Validators.required]], + platformType: ['4', [Validators.required]], + receiverName: [null, [Validators.required]], + receiverAccount: [null, [Validators.required]], + receiverRatio: [0, [Validators.required]] + }); this.requestData(1); } @@ -61,4 +79,65 @@ export class CompanyListComponent implements OnInit { this.searchForm.reset(); } + + /** + * 展示交易分账配置 + */ + showTradeTakeConfigMadel(companyId: number) { + this.tradeTakeConfigService.getTradeTakeConfig(companyId, this.tradeTakeConfigForm.controls['platformType'].value, 1 , 2, null, data => { + if (data['return_code'] === '000000') { + if (data['return_data'] != null) { + data['return_data']['platformType'] = String(data['return_data']['platformType']); + data['return_data']['receiverRatio'] = data['return_data']['receiverRatio'] * 100; + this.tradeTakeConfigForm.patchValue(data['return_data']); + } else { + this.tradeTakeConfigForm.controls['companyId'].setValue(companyId); + } + } + }); + this.tradeTakeConfigMadel = true; + } + + /** + * 关闭交易分账配置 + */ + closeTradeTakeConfigMadel() { + this.tradeTakeConfigForm.reset(); + this.tradeTakeConfigForm.controls['platformType'].setValue('4'); + this.tradeTakeConfigForm.controls['receiverRatio'].setValue(0); + this.tradeTakeConfigMadel = false; + } + + /** + * 提交配置 + */ + submitTradeTakeConfig() { + for (const i in this.tradeTakeConfigForm.controls) { + this.tradeTakeConfigForm.controls[i].markAsDirty(); + this.tradeTakeConfigForm.controls[i].updateValueAndValidity(); + } + if (this.tradeTakeConfigForm.status == null || this.tradeTakeConfigForm.status !== 'VALID') { + this.modal.warning({ + nzTitle: '提示', + nzContent: '请规范填写所有的必填项信息', + }); + return; + } + this.tradeTakeConfigForm.value['receiverRatio'] = this.tradeTakeConfigForm.controls['receiverRatio']['value'] / 100; + this.tradeTakeConfigService.editParentCompanyConfig(this.tradeTakeConfigForm.value, data => { + if (data['return_code'] === '000000') { + this.modal.success({ + nzTitle: '提示', + nzContent: '保存成功', + nzOnOk: () => this.closeTradeTakeConfigMadel() + }); + } else { + this.modal.error({ + nzTitle: '提示', + nzContent: data['return_msg'], + }); + } + }); + + } } diff --git a/src/app/admin/device/device-list/device-list.component.html b/src/app/admin/device/device-list/device-list.component.html index cf1e3a1..bb5fccc 100644 --- a/src/app/admin/device/device-list/device-list.component.html +++ b/src/app/admin/device/device-list/device-list.component.html @@ -151,7 +151,7 @@
  • 门店解绑
  • 停用
  • 启用
  • -
  • 删除
  • +
  • 删除
  • diff --git a/src/app/admin/device/device-list/device-list.component.ts b/src/app/admin/device/device-list/device-list.component.ts index 10c58ec..15b14ca 100644 --- a/src/app/admin/device/device-list/device-list.component.ts +++ b/src/app/admin/device/device-list/device-list.component.ts @@ -178,7 +178,7 @@ export class DeviceListComponent implements OnInit { showDeleteConfirm(data: object): void { this.modal.confirm({ nzTitle: '警告', - nzContent: '是否删除该设备?', + nzContent: '设备编号:' + data['deviceNo'] + ',是否删除该设备?', nzOkText: '是', nzCancelText: '否', nzOkType: 'danger', @@ -279,6 +279,7 @@ export class DeviceListComponent implements OnInit { this.loadingObject.spinning = false; return; } + this.importDeviceModal = false; this.deviceService.importDevice(this.importDeviceForm.value, data => { this.loadingObject.spinning = false; @@ -298,6 +299,7 @@ export class DeviceListComponent implements OnInit { }); } } else { + this.importDeviceModal = true; this.modal.error({ nzTitle: '提示', nzContent: data['return_msg'], diff --git a/src/app/admin/store-discount-activity/store-discount-activity-edit/store-discount-activity-edit.component.html b/src/app/admin/store-discount-activity/store-discount-activity-edit/store-discount-activity-edit.component.html index 76bcf4d..fe17f1d 100644 --- a/src/app/admin/store-discount-activity/store-discount-activity-edit/store-discount-activity-edit.component.html +++ b/src/app/admin/store-discount-activity/store-discount-activity-edit/store-discount-activity-edit.component.html @@ -53,6 +53,13 @@ + + {{dataForm.value.discountType === '3' ? '成本折扣' : '成本优惠'}} + + + + + 活动结束时间 diff --git a/src/app/admin/store-discount-activity/store-discount-activity-edit/store-discount-activity-edit.component.ts b/src/app/admin/store-discount-activity/store-discount-activity-edit/store-discount-activity-edit.component.ts index 88e1c01..a5bf379 100644 --- a/src/app/admin/store-discount-activity/store-discount-activity-edit/store-discount-activity-edit.component.ts +++ b/src/app/admin/store-discount-activity/store-discount-activity-edit/store-discount-activity-edit.component.ts @@ -34,6 +34,7 @@ export class StoreDiscountActivityEditComponent implements OnInit { discountType: [1, [Validators.required]], discountCondition: [0, [Validators.required]], discountPrice: [0, [Validators.required]], + finalCostPrice: [0, [Validators.required]], endTime: [null, [Validators.required]], }); diff --git a/src/app/admin/store-discount-activity/store-discount-activity-list/store-discount-activity-list.component.html b/src/app/admin/store-discount-activity/store-discount-activity-list/store-discount-activity-list.component.html index da350f3..6a4958d 100644 --- a/src/app/admin/store-discount-activity/store-discount-activity-list/store-discount-activity-list.component.html +++ b/src/app/admin/store-discount-activity/store-discount-activity-list/store-discount-activity-list.component.html @@ -102,6 +102,7 @@
  • 上线
  • 下线
  • 删除
  • +
  • 暂无其他操作
  • diff --git a/src/app/admin/trade-take-config/trade-take-config-routing.module.ts b/src/app/admin/trade-take-config/trade-take-config-routing.module.ts new file mode 100644 index 0000000..ad4fbda --- /dev/null +++ b/src/app/admin/trade-take-config/trade-take-config-routing.module.ts @@ -0,0 +1,11 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; + + +const routes: Routes = []; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class TradeTakeConfigRoutingModule { } diff --git a/src/app/admin/trade-take-config/trade-take-config.module.ts b/src/app/admin/trade-take-config/trade-take-config.module.ts new file mode 100644 index 0000000..7f27859 --- /dev/null +++ b/src/app/admin/trade-take-config/trade-take-config.module.ts @@ -0,0 +1,14 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; + +import { TradeTakeConfigRoutingModule } from './trade-take-config-routing.module'; + + +@NgModule({ + declarations: [], + imports: [ + CommonModule, + TradeTakeConfigRoutingModule + ] +}) +export class TradeTakeConfigModule { } diff --git a/src/app/services/trade-take-config.service.ts b/src/app/services/trade-take-config.service.ts new file mode 100644 index 0000000..7cdce19 --- /dev/null +++ b/src/app/services/trade-take-config.service.ts @@ -0,0 +1,68 @@ +import { Injectable } from '@angular/core'; +import {HttpClient} from '@angular/common/http'; +import {CommonsService} from './commons.service'; +import {environment} from '../../environments/environment'; + +@Injectable({ + providedIn: 'root' +}) +export class TradeTakeConfigService { + + constructor( + private http: HttpClient, + private commonsService: CommonsService + ) { } + + /** + * 交易抽成配置 + * @param paramObject 参数 + * @param callBack + */ + editParentCompanyConfig(paramObject: object, callBack) { + this.http.post(environment.baseUrl + 'tradeTakeConfig/editParentCompanyConfig', paramObject).subscribe(data => { + callBack(data); + }); + } + + /** + * 交易抽成配置 + * @param paramObject 参数 + * @param callBack + */ + editAgentConfig(paramObject: object, callBack) { + this.http.post(environment.baseUrl + 'tradeTakeConfig/editAgentConfig', paramObject).subscribe(data => { + callBack(data); + }); + } + + /** + * 查询交易配置 + * @param paramObject 参数 + * @param callBack + */ + getTradeTakeConfig(companyId: number, platformType: number, profitSharingReceiverRole: number, receiverObjectId: number, subReceiverObjectId: number, callBack) { + const param = { + companyId: companyId, + platformType: platformType, + profitSharingReceiverRole: profitSharingReceiverRole, + receiverObjectId: receiverObjectId, + subReceiverObjectId: subReceiverObjectId, + }; + + this.http.get(environment.baseUrl + 'tradeTakeConfig/getTradeTakeConfig?' + this.commonsService.getWhereCondition(param)).subscribe(data => { + callBack(data); + }); + } + + /** + * 查询代理商交易配置 + * @param paramObject 参数 + * @param callBack + */ + getAgentTradeTakeConfig(platformType: number, agentId: number, callBack) { + this.http.get(environment.baseUrl + 'tradeTakeConfig/getAgentTradeTakeConfig?platformType=' + platformType + '&agentId=' + agentId).subscribe(data => { + callBack(data); + }); + } + +} diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts index 075f4aa..5f650e3 100644 --- a/src/environments/environment.prod.ts +++ b/src/environments/environment.prod.ts @@ -1,6 +1,6 @@ export const environment = { production: true, - baseUrl: 'https://pay.bxb.cn/brest/', // 测试环境服务器地址(请求数据地址) - imageUrl: 'https://pay.bxb.cn/filesystem/', - obsUrl: 'https://xuan-pay-private.obs.cn-southwest-2.myhuaweicloud.com', + baseUrl: 'https://pay.dctpay.com//brest/', // 测试环境服务器地址(请求数据地址) + imageUrl: 'https://pay.dctpay.com/filesystem/', + obsUrl: 'https://gratia-pay.obs.cn-southwest-2.myhuaweicloud.com', }; diff --git a/src/environments/environment.ts b/src/environments/environment.ts index cfbbb01..7fbf062 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -5,9 +5,9 @@ export const environment = { production: false, // baseUrl: 'https://gratia-pay.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址) - baseUrl: 'https://gratia-pay.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址) - imageUrl: 'https://gratia-pay.dctpay.com/filesystem/', - obsUrl: 'https://xuan-pay-private.obs.cn-southwest-2.myhuaweicloud.com', + baseUrl: 'http://localhost:9602/brest/', // 测试环境服务器地址(请求数据地址) + imageUrl: 'http://gratia-pay.dctpay.com/filesystem/', + obsUrl: 'https://gratia-pay-test.obs.cn-southwest-2.myhuaweicloud.com', }; /*