diff --git a/src/app/admin/gas-oil-price/gas-oil-price-routing.module.ts b/src/app/admin/gas-oil-price/gas-oil-price-routing.module.ts new file mode 100644 index 0000000..17ad1dc --- /dev/null +++ b/src/app/admin/gas-oil-price/gas-oil-price-routing.module.ts @@ -0,0 +1,17 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; +import {OilPriceOfficialListComponent} from './oil-price-official-list/oil-price-official-list.component'; +import {OilPriceTaskListComponent} from './oil-price-task-list/oil-price-task-list.component'; +import {OilPriceTaskEditComponent} from './oil-price-task-edit/oil-price-task-edit.component'; + +const routes: Routes = [ + { path: 'official-list', component: OilPriceOfficialListComponent }, + { path: 'task-list', component: OilPriceTaskListComponent }, + { path: 'task-edit', component: OilPriceTaskEditComponent } +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class GasOilPriceRoutingModule { } diff --git a/src/app/admin/gas-oil-price/gas-oil-price.module.ts b/src/app/admin/gas-oil-price/gas-oil-price.module.ts new file mode 100644 index 0000000..d9937f9 --- /dev/null +++ b/src/app/admin/gas-oil-price/gas-oil-price.module.ts @@ -0,0 +1,28 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; + +import { GasOilPriceRoutingModule } from './gas-oil-price-routing.module'; +import { OilPriceOfficialListComponent } from './oil-price-official-list/oil-price-official-list.component'; +import {NgZorroAntdModule} from '_ng-zorro-antd@9.3.0@ng-zorro-antd'; +import {FormsModule, ReactiveFormsModule} from '_@angular_forms@9.0.7@@angular/forms'; +import {BreadcrumbModule} from '../../common/breadcrumb/breadcrumb.module'; +import {AppCommonModule} from '../../app-common.module'; +import {NgxEchartsModule} from '_ngx-echarts@4.2.2@ngx-echarts'; +import { OilPriceTaskListComponent } from './oil-price-task-list/oil-price-task-list.component'; +import { OilPriceTaskEditComponent } from './oil-price-task-edit/oil-price-task-edit.component'; + + +@NgModule({ + declarations: [OilPriceOfficialListComponent, OilPriceTaskListComponent, OilPriceTaskEditComponent], + imports: [ + CommonModule, + GasOilPriceRoutingModule, + NgZorroAntdModule, + ReactiveFormsModule, + FormsModule, + BreadcrumbModule, + AppCommonModule, + NgxEchartsModule, + ] +}) +export class GasOilPriceModule { } diff --git a/src/app/admin/gas-oil-price/oil-price-official-list/oil-price-official-list.component.html b/src/app/admin/gas-oil-price/oil-price-official-list/oil-price-official-list.component.html new file mode 100644 index 0000000..cd2af9d --- /dev/null +++ b/src/app/admin/gas-oil-price/oil-price-official-list/oil-price-official-list.component.html @@ -0,0 +1,100 @@ + + + + + + +
+
+
+ +
+ + 区域名称 + + + + +
+ +
+ + 油品号 + + + + + + +
+ +
+ + 油品类型 + + + + + + + +
+ +
+ +
+
+ + +
+
+
+
+ +
+ 共计 {{dataObject.total?dataObject.total:0}} 条数据 +
+ +
+ + + + + + 序号 + 区域名称 + 国标价 + 油品号 + 油品类型 + 操作 + + + + + {{i+1}} + {{data.regionName}} + {{data.priceOfficial}} + {{data.oilNo}} + {{data.oilTypeName}} + + 操作列表 + +
    + +
  • 暂无
  • +
+
+ + + +
+
+
+ diff --git a/src/app/admin/gas-oil-price/oil-price-official-list/oil-price-official-list.component.scss b/src/app/admin/gas-oil-price/oil-price-official-list/oil-price-official-list.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/admin/gas-oil-price/oil-price-official-list/oil-price-official-list.component.spec.ts b/src/app/admin/gas-oil-price/oil-price-official-list/oil-price-official-list.component.spec.ts new file mode 100644 index 0000000..a90f1a4 --- /dev/null +++ b/src/app/admin/gas-oil-price/oil-price-official-list/oil-price-official-list.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { OilPriceOfficialListComponent } from './oil-price-official-list.component'; + +describe('OilPriceOfficialListComponent', () => { + let component: OilPriceOfficialListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ OilPriceOfficialListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(OilPriceOfficialListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/admin/gas-oil-price/oil-price-official-list/oil-price-official-list.component.ts b/src/app/admin/gas-oil-price/oil-price-official-list/oil-price-official-list.component.ts new file mode 100644 index 0000000..4eea6fc --- /dev/null +++ b/src/app/admin/gas-oil-price/oil-price-official-list/oil-price-official-list.component.ts @@ -0,0 +1,91 @@ +import { Component, OnInit } from '@angular/core'; +import {environment} from '../../../../environments/environment'; +import {FormBuilder, FormGroup} from '_@angular_forms@9.0.7@@angular/forms'; +import {NzMessageService, NzModalService} from '_ng-zorro-antd@9.3.0@ng-zorro-antd'; +import {LocalStorageService} from '../../../services/local-storage.service'; +import {CommonsService} from '../../../services/commons.service'; +import {Router} from '_@angular_router@9.0.7@@angular/router'; +import {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace'; +import {OilPriceOfficialService} from '../../../services/oil-price/oil-price-official.service'; + +@Component({ + selector: 'app-oil-price-official-list', + templateUrl: './oil-price-official-list.component.html', + styleUrls: ['./oil-price-official-list.component.scss'] +}) +export class OilPriceOfficialListComponent implements OnInit { + FILE_URL = environment.imageUrl; + roleType; + adminFlag; + loadingObject = { + spinning: false, + msg: '加载中' + }; + + dataObject: any = {}; + tableLoading = true; + searchForm: FormGroup; + pageNum: number; + whereObject: any = {}; + + oilNoArray = []; + + constructor(private modal: NzModalService, + private message: NzMessageService, + private store: LocalStorageService, + private oilPriceOfficialService: OilPriceOfficialService, + private commonsService: CommonsService, + private router: Router, + private form: FormBuilder) { + this.roleType = Number(this.store.get(ADMIN_INFO_OBJECT)['secRole'].roleType); + this.adminFlag = Number(this.store.get(ADMIN_INFO_OBJECT)['secUser'].adminFlag); + } + + ngOnInit(): void { + this.searchForm = this.form.group({ + regionName: [null], + oilNo: [null], + oilType: [null], + }); + + this.commonsService.getDictionary('GAS_OIL_TYPE', data => { + this.oilNoArray = data['return_data']; + }); + + this.requestData(1); + } + + /** + * 请求数据 + */ + requestData(pageNum) { + this.tableLoading = true; + this.whereObject['pageNum'] = pageNum; + this.whereObject['pageSize'] = 10; + this.oilPriceOfficialService.getOilPriceOfficialList(this.whereObject, data => { + if (data['return_code'] === '000000') { + this.dataObject = data['return_data']; + } else { + this.modal.error(data['return_msg']); + } + this.tableLoading = false; + }); + } + + /** + * 搜索 + * @param whereObject 条件 + */ + search(whereObject: object) { + this.whereObject = whereObject; + this.requestData(1); + } + + /** + * 重置 + */ + resetForm(): void { + this.searchForm.reset(); + } + +} diff --git a/src/app/admin/gas-oil-price/oil-price-task-edit/oil-price-task-edit.component.html b/src/app/admin/gas-oil-price/oil-price-task-edit/oil-price-task-edit.component.html new file mode 100644 index 0000000..c00c3a7 --- /dev/null +++ b/src/app/admin/gas-oil-price/oil-price-task-edit/oil-price-task-edit.component.html @@ -0,0 +1,90 @@ + + + + +
+
+
+
+
+ + 油号 + + + + + + +
+ +
+ + 价格类型 + + + + + + +
+ +
+ + 执行地区 + + + + + + +
+ +
+ + 加油站 + + + + + + +
+ +
+ + 执行价格(¥) + + + + +
+ +
+ + 执行方式 + + + + + + + +
+ +
+ + 执行时间 + + + + +
+ +
+ +
+ +
+
+
+
diff --git a/src/app/admin/gas-oil-price/oil-price-task-edit/oil-price-task-edit.component.scss b/src/app/admin/gas-oil-price/oil-price-task-edit/oil-price-task-edit.component.scss new file mode 100644 index 0000000..f28a63f --- /dev/null +++ b/src/app/admin/gas-oil-price/oil-price-task-edit/oil-price-task-edit.component.scss @@ -0,0 +1,13 @@ +.btn-div { + width: 100%; + text-align: center; +} +.btn-post { + width: 25%; +} +nz-input-number { + width: 100%; +} +nz-date-picker { + width: 100%; +} diff --git a/src/app/admin/gas-oil-price/oil-price-task-edit/oil-price-task-edit.component.spec.ts b/src/app/admin/gas-oil-price/oil-price-task-edit/oil-price-task-edit.component.spec.ts new file mode 100644 index 0000000..864af65 --- /dev/null +++ b/src/app/admin/gas-oil-price/oil-price-task-edit/oil-price-task-edit.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { OilPriceTaskEditComponent } from './oil-price-task-edit.component'; + +describe('OilPriceTaskEditComponent', () => { + let component: OilPriceTaskEditComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ OilPriceTaskEditComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(OilPriceTaskEditComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/admin/gas-oil-price/oil-price-task-edit/oil-price-task-edit.component.ts b/src/app/admin/gas-oil-price/oil-price-task-edit/oil-price-task-edit.component.ts new file mode 100644 index 0000000..752ca77 --- /dev/null +++ b/src/app/admin/gas-oil-price/oil-price-task-edit/oil-price-task-edit.component.ts @@ -0,0 +1,160 @@ +import { Component, OnInit } from '@angular/core'; +import {FormBuilder, FormGroup, Validators} from '_@angular_forms@9.0.7@@angular/forms'; +import {NzModalService} from '_ng-zorro-antd@9.3.0@ng-zorro-antd'; +import {ActivatedRoute, Router} from '_@angular_router@9.0.7@@angular/router'; +import {CommonsService} from '../../../services/commons.service'; +import {OilPriceTaskService} from '../../../services/oil-price/oil-price-task.service'; +import {LocalStorageService} from "../../../services/local-storage.service"; +import {ADMIN_INFO_OBJECT} from "../../../services/local-storage.namespace"; + +@Component({ + selector: 'app-oil-price-task-edit', + templateUrl: './oil-price-task-edit.component.html', + styleUrls: ['./oil-price-task-edit.component.scss'] +}) +export class OilPriceTaskEditComponent implements OnInit { + dataFrom: FormGroup; + btnLoading = false; + + oilNoArray = []; + priceTypeArray = []; + regionArray = []; + gasArray = []; + + secUserObjectType: number; + + constructor(private formBuilder: FormBuilder, + private modal: NzModalService, + private oilPriceTaskService: OilPriceTaskService, + private activatedRoute: ActivatedRoute, + private commonsService: CommonsService, + private localStorageService: LocalStorageService , // 请求缓存 + private router: Router) { + this.secUserObjectType = Number(this.localStorageService.get(ADMIN_INFO_OBJECT)['secUser']['objectType']); + } + + ngOnInit(): void { + + this.dataFrom = this.formBuilder.group({ + oilNo: ['92', [Validators.required]], + priceType: [null, [Validators.required]], + price: [0, [Validators.required]], + executionType: ['1', [Validators.required]], + startTime: [null], + regionId: [null], + merStoreIdArray: [[]], + }); + + // 管理员 + if (this.secUserObjectType === 0) { + // 价格类型 1. 国标价 2. 油站价 3. 优惠幅度 + this.priceTypeArray.push({ codeValue: 1, codeName: '国标价' }); + this.priceTypeArray.push({ codeValue: 2, codeName: '油站价' }); + this.priceTypeArray.push({ codeValue: 3, codeName: '优惠幅度'}); + + // 获取全部省级地区 + this.commonsService.getProvinceList(data => { + this.regionArray = data['return_data']; + }); + + this.commonsService.getGasSelectList( data => { + this.gasArray = data['return_data']; + }); + + // 分公司 + } else if (this.secUserObjectType === 1) { + // 价格类型 1. 国标价 2. 油站价 3. 优惠幅度 + this.priceTypeArray.push({ codeValue: 1, codeName: '国标价' }); + this.priceTypeArray.push({ codeValue: 2, codeName: '油站价' }); + this.priceTypeArray.push({ codeValue: 3, codeName: '优惠幅度'}); + + this.regionArray.push({ regionId: this.localStorageService.get(ADMIN_INFO_OBJECT)['bsCompany']['regionId'], + regionName: this.localStorageService.get(ADMIN_INFO_OBJECT)['bsCompany']['regionName'] }); + + this.commonsService.getGasSelectList( data => { + this.gasArray = data['return_data']; + }); + + // 商户 + } else if (this.secUserObjectType === 2) { + this.priceTypeArray.push({ codeValue: 2, codeName: '油站价' }); + this.priceTypeArray.push({ codeValue: 3, codeName: '优惠幅度' }); + + this.commonsService.getGasSelectList( data => { + this.gasArray = data['return_data']; + }); + + // 加油站 + } else if (this.secUserObjectType === 3) { + this.priceTypeArray.push({ codeValue: 2, codeName: '油站价' }); + this.priceTypeArray.push({ codeValue: 3, codeName: '优惠幅度' }); + + this.dataFrom.patchValue({ merStoreIdArray: [ this.localStorageService.get(ADMIN_INFO_OBJECT)['merchantStore']['id'] ] }); + } + + this.commonsService.getDictionary('GAS_OIL_TYPE', data => { + this.oilNoArray = data['return_data']; + }); + + } + + /** + * 提交 + */ + submitFrom() { + for (const i in this.dataFrom.controls) { + this.dataFrom.controls[i].markAsDirty(); + this.dataFrom.controls[i].updateValueAndValidity(); + } + if (this.dataFrom.status == null || this.dataFrom.status !== 'VALID') { + this.modal.warning({ + nzTitle: '提示', + nzContent: '请规范填写所有的必填项信息', + }); + return; + } + + const dataFromValue = this.dataFrom.value; + const dataArray = []; + + if (dataFromValue.priceType === '1') { + dataArray.push({ + regionId: dataFromValue.regionId, + oilNo: dataFromValue.oilNo, + priceType: dataFromValue.priceType, + price: dataFromValue.price, + executionType: dataFromValue.executionType, + startTime: dataFromValue.startTime, + }); + } else { + for (const storeId of this.dataFrom.value.merStoreIdArray) { + dataArray.push({ + merStoreId: storeId, + oilNo: dataFromValue.oilNo, + priceType: dataFromValue.priceType, + price: dataFromValue.price, + executionType: dataFromValue.executionType, + startTime: dataFromValue.startTime, + }); + } + } + + this.btnLoading = true; + this.oilPriceTaskService.batchAddTask(dataArray, data => { + if (data['return_code'] === '000000') { + this.modal.success({ + nzTitle: '提示', + nzContent: '添加成功', + nzOnOk: () => this.router.navigateByUrl('admin/gas-oil-price/task-list') + }); + } else { + this.modal.error({ + nzTitle: '提示', + nzContent: data['return_msg'], + }); + } + this.btnLoading = false; + }); + } + +} diff --git a/src/app/admin/gas-oil-price/oil-price-task-list/oil-price-task-list.component.html b/src/app/admin/gas-oil-price/oil-price-task-list/oil-price-task-list.component.html new file mode 100644 index 0000000..75eff96 --- /dev/null +++ b/src/app/admin/gas-oil-price/oil-price-task-list/oil-price-task-list.component.html @@ -0,0 +1,169 @@ + + + + + + +
+
+
+ +
+ + 区域名称 + + + + +
+ +
+ + 油站编号 + + + + +
+ +
+ + 油站名称 + + + + +
+ +
+ + 油品号 + + + + + + +
+ +
+ + 油品类型 + + + + + + + +
+ +
+ + 价格类型 + + + + + + +
+ +
+ + 执行方式 + + + + + + + +
+ +
+ + 任务状态 + + + + + + + +
+ +
+ +
+
+ + +
+
+
+
+ +
+ 共计 {{dataObject.total?dataObject.total:0}} 条数据 +
+ +
+ + + + + + 序号 + 区域名称 + 油站编号 + 油站名称 + 油品号 + 油品类型 + 价格类型 + 执行价格 + 执行方式 + 执行时间 + 任务状态 + 创建时间 + 创建人 + 操作 + + + + + {{i+1}} + {{data.regionName}} + {{data.merStoreKey?data.merStoreKey:'无'}} + {{data.merStoreName?data.merStoreName:'无'}} + {{data.oilNo}} + {{data.oilTypeName}} + {{data.priceType | oilPriceTaskPriceType}} + ¥{{data.price}} + {{data.executionType | oilPriceTaskExecutionType}} + {{data.startTime | date : 'yyyy-MM-dd HH:mm:ss'}} + {{data.status | oilPriceTaskStatus}} + {{data.createTime | date : 'yyyy-MM-dd HH:mm:ss'}} + {{data.opUserName}} + + 操作列表 + + + + + + + +
+
+ diff --git a/src/app/admin/gas-oil-price/oil-price-task-list/oil-price-task-list.component.scss b/src/app/admin/gas-oil-price/oil-price-task-list/oil-price-task-list.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/admin/gas-oil-price/oil-price-task-list/oil-price-task-list.component.spec.ts b/src/app/admin/gas-oil-price/oil-price-task-list/oil-price-task-list.component.spec.ts new file mode 100644 index 0000000..d738e69 --- /dev/null +++ b/src/app/admin/gas-oil-price/oil-price-task-list/oil-price-task-list.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { OilPriceTaskListComponent } from './oil-price-task-list.component'; + +describe('OilPriceTaskListComponent', () => { + let component: OilPriceTaskListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ OilPriceTaskListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(OilPriceTaskListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/admin/gas-oil-price/oil-price-task-list/oil-price-task-list.component.ts b/src/app/admin/gas-oil-price/oil-price-task-list/oil-price-task-list.component.ts new file mode 100644 index 0000000..5b7bab5 --- /dev/null +++ b/src/app/admin/gas-oil-price/oil-price-task-list/oil-price-task-list.component.ts @@ -0,0 +1,140 @@ +import { Component, OnInit } from '@angular/core'; +import {environment} from '../../../../environments/environment'; +import {FormBuilder, FormGroup} from '_@angular_forms@9.0.7@@angular/forms'; +import {NzMessageService, NzModalService} from '_ng-zorro-antd@9.3.0@ng-zorro-antd'; +import {LocalStorageService} from '../../../services/local-storage.service'; +import {CommonsService} from '../../../services/commons.service'; +import {Router} from '_@angular_router@9.0.7@@angular/router'; +import {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace'; +import {OilPriceTaskService} from '../../../services/oil-price/oil-price-task.service'; + +@Component({ + selector: 'app-oil-price-task-list', + templateUrl: './oil-price-task-list.component.html', + styleUrls: ['./oil-price-task-list.component.scss'] +}) +export class OilPriceTaskListComponent implements OnInit { + FILE_URL = environment.imageUrl; + roleType; + adminFlag; + loadingObject = { + spinning: false, + msg: '加载中' + }; + + dataObject: any = {}; + tableLoading = true; + searchForm: FormGroup; + pageNum: number; + whereObject: any = {}; + + oilNoArray = []; + priceTypeArray = []; + secUserObjectType: number; + + constructor(private modal: NzModalService, + private message: NzMessageService, + private store: LocalStorageService, + private oilPriceTaskService: OilPriceTaskService, + private localStorageService: LocalStorageService , // 请求缓存 + private commonsService: CommonsService, + private router: Router, + private form: FormBuilder) { + this.roleType = Number(this.store.get(ADMIN_INFO_OBJECT)['secRole'].roleType); + this.adminFlag = Number(this.store.get(ADMIN_INFO_OBJECT)['secUser'].adminFlag); + this.secUserObjectType = Number(this.localStorageService.get(ADMIN_INFO_OBJECT)['secUser']['objectType']); + } + + ngOnInit(): void { + this.searchForm = this.form.group({ + regionName: [null], + merStoreKey: [null], + merStoreName: [null], + oilNo: [null], + oilType: [null], + priceType: [null], + executionType: [null], + status: [null], + }); + + this.commonsService.getDictionary('GAS_OIL_TYPE', data => { + this.oilNoArray = data['return_data']; + }); + + // 管理员 、分公司 + if (this.secUserObjectType === 0 || this.secUserObjectType === 1) { + // 价格类型 1. 国标价 2. 油站价 3. 优惠幅度 + this.priceTypeArray.push({codeValue: 1, codeName: '国标价'}); + this.priceTypeArray.push({codeValue: 2, codeName: '油站价'}); + this.priceTypeArray.push({codeValue: 3, codeName: '优惠幅度'}); + } else { + this.priceTypeArray.push({codeValue: 2, codeName: '油站价'}); + this.priceTypeArray.push({codeValue: 3, codeName: '优惠幅度'}); + } + this.requestData(1); + } + + /** + * 请求数据 + */ + requestData(pageNum) { + this.tableLoading = true; + this.whereObject['pageNum'] = pageNum; + this.whereObject['pageSize'] = 10; + this.oilPriceTaskService.getTaskList(this.whereObject, data => { + if (data['return_code'] === '000000') { + this.dataObject = data['return_data']; + } else { + this.modal.error(data['return_msg']); + } + this.tableLoading = false; + }); + } + + /** + * 搜索 + * @param whereObject 条件 + */ + search(whereObject: object) { + this.whereObject = whereObject; + this.requestData(1); + } + + /** + * 重置 + */ + resetForm(): void { + this.searchForm.reset(); + } + + + /** + * 弹出删除对话框 + */ + showDelConfirm(id: number): void { + this.modal.confirm({ + nzTitle: '警告', + nzContent: '是否删除任务?任务一旦被删除,不会执行。', + nzOkText: '是', + nzCancelText: '否', + nzOkType: 'danger', + nzOnOk: () => this.delData(id) + }); + } + + /** + * 禁用数据 + */ + delData(id: number) { + this.oilPriceTaskService.delTask(id, data => { + if (data['return_code'] === '000000') { + this.requestData(this.whereObject['pageNum']); + } else { + this.modal.error({ + nzTitle: '提示', + nzContent: data['return_msg'] + }); + } + }); + } +} diff --git a/src/app/admin/gas-staff/gas-staff-edit/gas-staff-edit.component.html b/src/app/admin/gas-staff/gas-staff-edit/gas-staff-edit.component.html new file mode 100644 index 0000000..3e9f709 --- /dev/null +++ b/src/app/admin/gas-staff/gas-staff-edit/gas-staff-edit.component.html @@ -0,0 +1,45 @@ + + + + +
+
+
+
+
+ + 职位类型 + + + + + + +
+ +
+ + 员工名称 + + + + +
+ +
+ + 员工电话 + + + + +
+ +
+ +
+ +
+
+
+
diff --git a/src/app/admin/gas-staff/gas-staff-edit/gas-staff-edit.component.scss b/src/app/admin/gas-staff/gas-staff-edit/gas-staff-edit.component.scss new file mode 100644 index 0000000..1be0cf8 --- /dev/null +++ b/src/app/admin/gas-staff/gas-staff-edit/gas-staff-edit.component.scss @@ -0,0 +1,7 @@ +.btn-div { + width: 100%; + text-align: center; +} +.btn-post { + width: 25%; +} diff --git a/src/app/admin/gas-staff/gas-staff-edit/gas-staff-edit.component.spec.ts b/src/app/admin/gas-staff/gas-staff-edit/gas-staff-edit.component.spec.ts new file mode 100644 index 0000000..7dbde58 --- /dev/null +++ b/src/app/admin/gas-staff/gas-staff-edit/gas-staff-edit.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { GasStaffEditComponent } from './gas-staff-edit.component'; + +describe('GasStaffEditComponent', () => { + let component: GasStaffEditComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ GasStaffEditComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(GasStaffEditComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/admin/gas-staff/gas-staff-edit/gas-staff-edit.component.ts b/src/app/admin/gas-staff/gas-staff-edit/gas-staff-edit.component.ts new file mode 100644 index 0000000..d4abf1f --- /dev/null +++ b/src/app/admin/gas-staff/gas-staff-edit/gas-staff-edit.component.ts @@ -0,0 +1,116 @@ +import { Component, OnInit } from '@angular/core'; +import {FormBuilder, FormGroup, Validators} from '_@angular_forms@9.0.7@@angular/forms'; +import {NzModalService} from '_ng-zorro-antd@9.3.0@ng-zorro-antd'; +import {ActivatedRoute, Router} from '_@angular_router@9.0.7@@angular/router'; +import {GasStaffService} from '../../../services/gas-staff.service'; +import {CommonsService} from "../../../services/commons.service"; +import {ValidatorsService} from "../../../services/validators.service"; + +@Component({ + selector: 'app-gas-staff-edit', + templateUrl: './gas-staff-edit.component.html', + styleUrls: ['./gas-staff-edit.component.scss'] +}) +export class GasStaffEditComponent implements OnInit { + + staffFrom: FormGroup; + btnLoading = false; + + positionTypeArray = []; + + constructor(private formBuilder: FormBuilder, + private modal: NzModalService, + private gasStaffService: GasStaffService, + private activatedRoute: ActivatedRoute, + private commonsService: CommonsService, + private router: Router) { } + + ngOnInit(): void { + this.activatedRoute.queryParams.subscribe(queryParams => { + if (queryParams['id'] != null) { + this.getDetail(queryParams['id']); + } + }); + + this.commonsService.getDictionary('GAS_STAFF_POSITION_TYPE', data => { + this.positionTypeArray = data['return_data']; + }); + + this.staffFrom = this.formBuilder.group({ + id: [null], + positionType: ['1', [Validators.required]], + name: [null, [Validators.required]], + telephone: [null, [Validators.required, ValidatorsService.mobile]], + }); + } + + /** + * 查询详情 + * @param id + */ + getDetail(id: number) { + this.gasStaffService.getStaffDetail(id, data => { + if (data['return_code'] === '000000') { + data['return_data']['positionType'] = String(data['return_data']['positionType']); + this.staffFrom.patchValue(data['return_data']); + } else { + this.modal.error({ + nzTitle: '提示', + nzContent: data['return_msg'], + }); + } + }); + } + + /** + * 提交 + */ + submitFrom() { + for (const i in this.staffFrom.controls) { + this.staffFrom.controls[i].markAsDirty(); + this.staffFrom.controls[i].updateValueAndValidity(); + } + if (this.staffFrom.status == null || this.staffFrom.status !== 'VALID') { + this.modal.warning({ + nzTitle: '提示', + nzContent: '请规范填写所有的必填项信息', + }); + return; + } + + this.btnLoading = true; + if (this.staffFrom.value.id == null) { + this.gasStaffService.addStaff(this.staffFrom.value, data => { + if (data['return_code'] === '000000') { + this.modal.success({ + nzTitle: '提示', + nzContent: '添加成功', + nzOnOk: () => this.router.navigateByUrl('admin/gas-staff/list') + }); + } else { + this.modal.error({ + nzTitle: '提示', + nzContent: data['return_msg'], + }); + } + this.btnLoading = false; + }); + } else { + this.gasStaffService.updateStaff(this.staffFrom.value, data => { + if (data['return_code'] === '000000') { + this.modal.success({ + nzTitle: '提示', + nzContent: '修改成功', + nzOnOk: () => this.router.navigateByUrl('admin/gas-staff/list') + }); + } else { + this.modal.error({ + nzTitle: '提示', + nzContent: data['return_msg'], + }); + } + this.btnLoading = false; + }); + } + } +} diff --git a/src/app/admin/gas-staff/gas-staff-list/gas-staff-list.component.html b/src/app/admin/gas-staff/gas-staff-list/gas-staff-list.component.html new file mode 100644 index 0000000..d3abb7f --- /dev/null +++ b/src/app/admin/gas-staff/gas-staff-list/gas-staff-list.component.html @@ -0,0 +1,116 @@ + + + + + + +
+
+
+ +
+ + 职位类型 + + + + + + +
+ +
+ + 员工名称 + + + + +
+ +
+ + 员工电话 + + + + +
+ +
+ + 员工状态 + + + + + + + +
+ + +
+ +
+
+ + +
+
+
+
+ +
+ 共计 {{dataObject.total?dataObject.total:0}} 条数据 +
+ +
+ + + + + + 序号 + 职位类型 + 员工名称 + 员工电话 + 员工状态 + 创建时间 + 修改时间 + 操作 + + + + + {{i+1}} + {{data.positionName}} + {{data.name}} + {{data.telephone}} + {{data.status | gasStaffStatus}} + {{data.createTime | date : 'yyyy-MM-dd HH:mm:ss'}} + {{data.updateTime | date : 'yyyy-MM-dd HH:mm:ss'}} + + 操作列表 + + + + + + + +
+
+ diff --git a/src/app/admin/gas-staff/gas-staff-list/gas-staff-list.component.scss b/src/app/admin/gas-staff/gas-staff-list/gas-staff-list.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/admin/gas-staff/gas-staff-list/gas-staff-list.component.spec.ts b/src/app/admin/gas-staff/gas-staff-list/gas-staff-list.component.spec.ts new file mode 100644 index 0000000..f392a96 --- /dev/null +++ b/src/app/admin/gas-staff/gas-staff-list/gas-staff-list.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { GasStaffListComponent } from './gas-staff-list.component'; + +describe('GasStaffListComponent', () => { + let component: GasStaffListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ GasStaffListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(GasStaffListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/admin/gas-staff/gas-staff-list/gas-staff-list.component.ts b/src/app/admin/gas-staff/gas-staff-list/gas-staff-list.component.ts new file mode 100644 index 0000000..8a259c7 --- /dev/null +++ b/src/app/admin/gas-staff/gas-staff-list/gas-staff-list.component.ts @@ -0,0 +1,184 @@ +import { Component, OnInit } from '@angular/core'; +import {environment} from '../../../../environments/environment'; +import {FormBuilder, FormGroup, Validators} from '_@angular_forms@9.0.7@@angular/forms'; +import {NzMessageService, NzModalService} from '_ng-zorro-antd@9.3.0@ng-zorro-antd'; +import {LocalStorageService} from '../../../services/local-storage.service'; +import {OrganizationService} from '../../../services/organization.service'; +import {CompanyAccountService} from '../../../services/company-account.service'; +import {Router} from '_@angular_router@9.0.7@@angular/router'; +import {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace'; +import {GasStaffService} from '../../../services/gas-staff.service'; +import {CommonsService} from "../../../services/commons.service"; + +@Component({ + selector: 'app-gas-staff-list', + templateUrl: './gas-staff-list.component.html', + styleUrls: ['./gas-staff-list.component.scss'] +}) +export class GasStaffListComponent implements OnInit { + FILE_URL = environment.imageUrl; + roleType; + adminFlag; + loadingObject = { + spinning: false, + msg: '加载中' + }; + + dataObject: any = {}; + tableLoading = true; + searchForm: FormGroup; + pageNum: number; + whereObject: any = {}; + + positionTypeArray = []; + + constructor(private modal: NzModalService, + private message: NzMessageService, + private store: LocalStorageService, + private gasStaffService: GasStaffService, + private commonsService: CommonsService, + private router: Router, + private form: FormBuilder) { + this.roleType = Number(this.store.get(ADMIN_INFO_OBJECT)['secRole'].roleType); + this.adminFlag = Number(this.store.get(ADMIN_INFO_OBJECT)['secUser'].adminFlag); + } + + ngOnInit(): void { + this.searchForm = this.form.group({ + name: [null], + telephone: [null], + positionType: [null], + status: [null], + }); + + this.commonsService.getDictionary('GAS_STAFF_POSITION_TYPE', data => { + this.positionTypeArray = data['return_data']; + }); + + this.requestData(1); + } + + /** + * 请求数据 + */ + requestData(pageNum) { + this.tableLoading = true; + this.whereObject['pageNum'] = pageNum; + this.whereObject['pageSize'] = 10; + this.gasStaffService.getStaffList(this.whereObject, data => { + if (data['return_code'] === '000000') { + this.dataObject = data['return_data']; + } else { + this.modal.error(data['return_msg']); + } + this.tableLoading = false; + }); + } + + /** + * 搜索 + * @param whereObject 条件 + */ + search(whereObject: object) { + this.whereObject = whereObject; + this.requestData(1); + } + + /** + * 重置 + */ + resetForm(): void { + this.searchForm.reset(); + } + + /** + * 弹出删除对话框 + */ + showDisabledConfirm(id: number): void { + this.modal.confirm({ + nzTitle: '警告', + nzContent: '是否禁用该员工', + nzOkText: '是', + nzCancelText: '否', + nzOkType: 'danger', + nzOnOk: () => this.disabledData(id) + }); + } + + /** + * 禁用数据 + */ + disabledData(id: number) { + this.gasStaffService.disabled({ staffId: id }, data => { + if (data['return_code'] === '000000') { + this.requestData(this.whereObject['pageNum']); + } else { + this.modal.error({ + nzTitle: '提示', + nzContent: data['return_msg'] + }); + } + }); + } + + /** + * 弹出恢复对话框 + */ + showRecoverConfirm(id: number): void { + this.modal.confirm({ + nzTitle: '警告', + nzContent: '是否恢复该员工状态', + nzOkText: '是', + nzCancelText: '否', + nzOkType: 'danger', + nzOnOk: () => this.recoverData(id) + }); + } + + /** + * 恢复数据 + */ + recoverData(id: number) { + this.gasStaffService.recover({ staffId: id }, data => { + if (data['return_code'] === '000000') { + this.requestData(this.whereObject['pageNum']); + } else { + this.modal.error({ + nzTitle: '提示', + nzContent: data['return_msg'] + }); + } + }); + } + + /** + * 弹出删除对话框 + */ + showDelConfirm(id: number): void { + this.modal.confirm({ + nzTitle: '警告', + nzContent: '是否删除该员工', + nzOkText: '是', + nzCancelText: '否', + nzOkType: 'danger', + nzOnOk: () => this.delData(id) + }); + } + + /** + * 删除数据 + */ + delData(id: number) { + this.gasStaffService.delStaff({ staffId: id }, data => { + if (data['return_code'] === '000000') { + this.requestData(this.whereObject['pageNum']); + } else { + this.modal.error({ + nzTitle: '提示', + nzContent: data['return_msg'] + }); + } + }); + } + +} diff --git a/src/app/admin/gas-staff/gas-staff-routing.module.ts b/src/app/admin/gas-staff/gas-staff-routing.module.ts new file mode 100644 index 0000000..2c12d73 --- /dev/null +++ b/src/app/admin/gas-staff/gas-staff-routing.module.ts @@ -0,0 +1,15 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; +import {GasStaffListComponent} from './gas-staff-list/gas-staff-list.component'; +import {GasStaffEditComponent} from './gas-staff-edit/gas-staff-edit.component'; + +const routes: Routes = [ + { path: 'list', component: GasStaffListComponent}, + { path: 'edit', component: GasStaffEditComponent}, +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class GasStaffRoutingModule { } diff --git a/src/app/admin/gas-staff/gas-staff.module.ts b/src/app/admin/gas-staff/gas-staff.module.ts new file mode 100644 index 0000000..2304dc2 --- /dev/null +++ b/src/app/admin/gas-staff/gas-staff.module.ts @@ -0,0 +1,27 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; + +import { GasStaffRoutingModule } from './gas-staff-routing.module'; +import { GasStaffListComponent } from './gas-staff-list/gas-staff-list.component'; +import { GasStaffEditComponent } from './gas-staff-edit/gas-staff-edit.component'; +import {NgZorroAntdModule} from '_ng-zorro-antd@9.3.0@ng-zorro-antd'; +import {FormsModule, ReactiveFormsModule} from '_@angular_forms@9.0.7@@angular/forms'; +import {BreadcrumbModule} from '../../common/breadcrumb/breadcrumb.module'; +import {AppCommonModule} from '../../app-common.module'; +import {NgxEchartsModule} from '_ngx-echarts@4.2.2@ngx-echarts'; + + +@NgModule({ + declarations: [GasStaffListComponent, GasStaffEditComponent], + imports: [ + CommonModule, + GasStaffRoutingModule, + NgZorroAntdModule, + ReactiveFormsModule, + FormsModule, + BreadcrumbModule, + AppCommonModule, + NgxEchartsModule, + ] +}) +export class GasStaffModule { } diff --git a/src/app/admin/index/index/index.component.html b/src/app/admin/index/index/index.component.html index 4618094..bb119fb 100644 --- a/src/app/admin/index/index/index.component.html +++ b/src/app/admin/index/index/index.component.html @@ -8,7 +8,7 @@
-
+ - + - + - + - + @@ -43,27 +43,60 @@ - + - + - + - +
+ + +
+
+ + + + + +
+


+ + + + + 序号 + 油站名称 + 油站地址 + 油站加油总额 + + + + + {{ i + 1 }} + {{ data.store_name }} + {{ data.address }} + {{ '¥' + data.countPrice }} + + + + +
+
@@ -196,15 +229,18 @@ - + - 编号 - 类型 - 交易金额 - 变更前金额 - 变更后金额 + 编号 + 类型 + 交易金额 + 变更前金额 + 变更后金额 + 来源类型 内容 + 操作时间 + 操作人 @@ -214,7 +250,13 @@ {{'¥' + data.amount}} {{'¥' + data.beforeAmount}} {{'¥' + data.afterAmount}} + + 金额充值 + 订单消费 + 订单退款 {{data.sourceContent}} + {{data.createTime | date : 'yyyy-MM-dd HH:mm:ss'}} + {{data.opUserName}} diff --git a/src/app/admin/index/index/index.component.ts b/src/app/admin/index/index/index.component.ts index 4f38c5c..9efaa93 100644 --- a/src/app/admin/index/index/index.component.ts +++ b/src/app/admin/index/index/index.component.ts @@ -34,6 +34,10 @@ export class IndexComponent implements OnInit { history: {}, today: {}, }; + merGasCount: any = { + amount: 0, + storeList: [] + }; recordList = []; tyBalance; webSocket: WebSocket; @@ -72,6 +76,10 @@ export class IndexComponent implements OnInit { this.getGasAccount(); } } + + if (this.store.get(ADMIN_INFO_OBJECT)['secUser']['objectType'] === 2) { + this.getMerGasStatistical(); + } } // 查询余额 @@ -272,6 +280,18 @@ export class IndexComponent implements OnInit { }); } + // 查询加油站统计 + public getMerGasStatistical(): void { + this.index.getMerGasStatistical(data => { + if (data['return_code'] === '000000') { + this.merGasCount = data['return_data']; + this.loading = false; + } else { + this.message.error(data['return_msg']); + } + }); + } + // 查询预存账户油站记录 public getGasAccountRecord(): void { const paramsObject = { diff --git a/src/app/admin/login/login/login.component.ts b/src/app/admin/login/login/login.component.ts index b1847ef..333777c 100644 --- a/src/app/admin/login/login/login.component.ts +++ b/src/app/admin/login/login/login.component.ts @@ -1,12 +1,13 @@ import {Component, OnInit} from '@angular/core'; import {FormGroup, Validators, FormBuilder} from '@angular/forms'; import {LoginService} from '../../../services/login.service'; -import {NzModalService} from 'ng-zorro-antd'; +import {NzMessageService, NzModalService} from 'ng-zorro-antd'; import {ADMIN_INFO_OBJECT, TOKEN, INIT_FLAG, LOGINTYPE} from '../../../services/local-storage.namespace'; import {LocalStorageService} from '../../../services/local-storage.service'; import {Router} from '@angular/router'; import {HttpClient} from '@angular/common/http'; + @Component({ selector: 'app-login', templateUrl: './login.component.html', @@ -21,6 +22,7 @@ export class LoginComponent implements OnInit { private form: FormBuilder, // 表单校验 private http: HttpClient, // http请求 private loginService: LoginService, + private message: NzMessageService, private modal: NzModalService) { } @@ -55,11 +57,9 @@ export class LoginComponent implements OnInit { this.store.set(LOGINTYPE, data['return_data']['type']); this.router.navigateByUrl('/admin/index').then(); } else { - this.modal.warning({ - nzTitle: '提示', - nzContent: data['return_msg'] - }); + this.message.error(data['return_msg']); } }); + } } diff --git a/src/app/admin/merchant/merchant-list/merchant-list.component.html b/src/app/admin/merchant/merchant-list/merchant-list.component.html index dcecb3d..706d723 100644 --- a/src/app/admin/merchant/merchant-list/merchant-list.component.html +++ b/src/app/admin/merchant/merchant-list/merchant-list.component.html @@ -80,7 +80,7 @@ 商户电话 创建时间 状态 - 操作 + 操作 @@ -103,10 +103,27 @@ + +
+ +
+ + 充值金额 + + + + +
+ +
+
+
+ + diff --git a/src/app/admin/merchant/merchant-list/merchant-list.component.ts b/src/app/admin/merchant/merchant-list/merchant-list.component.ts index 53fd260..3737264 100644 --- a/src/app/admin/merchant/merchant-list/merchant-list.component.ts +++ b/src/app/admin/merchant/merchant-list/merchant-list.component.ts @@ -1,11 +1,12 @@ import { Component, OnInit } from '@angular/core'; -import {FormBuilder, FormGroup} from '@angular/forms'; +import {FormBuilder, FormGroup, Validators} from '@angular/forms'; import {IconService} from '../../../services/icon.service'; -import {NzMessageService} from 'ng-zorro-antd'; +import {NzMessageService, NzModalService} from 'ng-zorro-antd'; import {CommonsService} from '../../../services/commons.service'; import {MerchantService} from '../../../services/merchant.service'; import {Router} from '@angular/router'; import {environment} from '../../../../environments/environment'; +import {MerAmountService} from "../../../services/mer-amount.service"; @Component({ selector: 'app-merchant-list', @@ -21,13 +22,18 @@ export class MerchantListComponent implements OnInit { pageSize = 10; // 条码 loading = true; + rechargeModal = false; + rechargeForm: FormGroup; // 充值模态框 + constructor( private form: FormBuilder, private merchant: MerchantService, private iconService: IconService, private message: NzMessageService, + private merAmountService: MerAmountService, private router: Router, - private common: CommonsService + private common: CommonsService, + private modal: NzModalService, ) { } @@ -42,6 +48,11 @@ export class MerchantListComponent implements OnInit { telephone: [null], status: [null], }); + + this.rechargeForm = this.form.group({ + merId: [null], + amount: [null, [Validators.required]], + }); this.getRequest(true, this.searchForm.value); } @@ -131,5 +142,45 @@ export class MerchantListComponent implements OnInit { } }).then(r => console.log(r)); } + + + showRechargeModal(merId: number) { + this.rechargeForm.patchValue({ merId: merId}); + this.rechargeModal = true; + } + + closeRechargeModal() { + this.rechargeModal = false; + } + + submitRecharge() { + for (const i in this.rechargeForm.controls) { + this.rechargeForm.controls[i].markAsDirty(); + this.rechargeForm.controls[i].updateValueAndValidity(); + } + if (this.rechargeForm.status == null || this.rechargeForm.status !== 'VALID') { + this.modal.warning({ + nzTitle: '提示', + nzContent: '请填写所有必填项', + }); + return; + } + + this.merAmountService.recharge(this.rechargeForm.value, data => { + if (data['return_code'] === '000000') { + this.modal.success({ + nzTitle: '提示', + nzContent: '充值成功', + }); + this.closeRechargeModal(); + } else { + this.modal.error({ + nzTitle: '提示', + nzContent: data['return_msg'], + }); + } + }); + } + } diff --git a/src/app/admin/navigation/navigation.component.ts b/src/app/admin/navigation/navigation.component.ts index 3c7a236..6aebddc 100644 --- a/src/app/admin/navigation/navigation.component.ts +++ b/src/app/admin/navigation/navigation.component.ts @@ -20,12 +20,11 @@ import {Md5} from 'ts-md5'; import {environment} from '../../../environments/environment'; import {HttpClient} from '@angular/common/http'; import {CompanyTwoPwdService} from '../../services/company-two-pwd.service'; -import {WebsocketService} from '../../services/websocket.service'; @Component({ selector: 'app-navigation', templateUrl: './navigation.component.html', - styleUrls: ['./navigation.component.less'], + styleUrls: ['./navigation.component.less'] }) export class NavigationComponent implements OnInit { @@ -47,9 +46,8 @@ export class NavigationComponent implements OnInit { private companyTwoPwdService: CompanyTwoPwdService, private http: HttpClient, // http请求 private iconService: IconService, - private webSocketService: WebsocketService, - private store: LocalStorageService, // 数据请求 private modal: NzModalService, + private common: CommonsService, private fb: FormBuilder, // 表单 private router: Router, ) { @@ -69,11 +67,9 @@ export class NavigationComponent implements OnInit { }); this.menuList = this.storage.getList(ADMIN_INFO_OBJECT)['menuList']; // 定义菜单数据 - // 连接websocket - // this.webSocketService.connect(`wss://hsgcs.dctpay.com/msg/WebSocket/` + this.store.get(ADMIN_INFO_OBJECT)['merchantStore'].id); - } + public activeLi(routeName): void { this.routeName = routeName; this.storage.set(ROUTENAME, routeName); diff --git a/src/app/admin/order/oil-station-order/oil-station-order.component.html b/src/app/admin/order/oil-station-order/oil-station-order.component.html index b295686..7686ff5 100644 --- a/src/app/admin/order/oil-station-order/oil-station-order.component.html +++ b/src/app/admin/order/oil-station-order/oil-station-order.component.html @@ -111,8 +111,8 @@ {{data.status | orderCouponStatus}} 详情 - - 退款 + + 退款 diff --git a/src/app/admin/order/oil-station-order/oil-station-order.component.ts b/src/app/admin/order/oil-station-order/oil-station-order.component.ts index cbd0e9b..4c78b49 100644 --- a/src/app/admin/order/oil-station-order/oil-station-order.component.ts +++ b/src/app/admin/order/oil-station-order/oil-station-order.component.ts @@ -10,6 +10,7 @@ import {MerchantService} from '../../../services/merchant.service'; import {LocalStorageService} from '../../../services/local-storage.service'; import {CommonsService} from '../../../services/commons.service'; import {WebsocketService} from '../../../services/websocket.service'; +import {ADMIN_INFO_OBJECT} from "../../../services/local-storage.namespace"; @Component({ selector: 'app-oil-station-order', @@ -34,6 +35,7 @@ export class OilStationOrderComponent implements OnInit { isVisibleDetail = false; refundContent: string; roleType: number; + secUser: object; constructor( private form: FormBuilder, private order: OrderService, @@ -49,6 +51,7 @@ export class OilStationOrderComponent implements OnInit { } ngOnInit(): void { + this.secUser = this.store.get(ADMIN_INFO_OBJECT)['secUser']; this.init(); // 接收消息 this.webSocketService.messageSubject.subscribe( diff --git a/src/app/admin/recharge-order/order-list/order-list.component.html b/src/app/admin/recharge-order/order-list/order-list.component.html index 6d700a0..6f6d80f 100644 --- a/src/app/admin/recharge-order/order-list/order-list.component.html +++ b/src/app/admin/recharge-order/order-list/order-list.component.html @@ -64,7 +64,7 @@ 充值号码 - +
@@ -72,7 +72,7 @@ 订单号 - +
@@ -80,36 +80,19 @@ 工会卡卡号 - + - - - - - - - - -
支付时间 - +
- - - - - - - - -
@@ -125,16 +108,10 @@
共计 {{total}} 条数据
- - - - +
编号 - 订单名称 - 订单类型 - 充值类型 - 工会卡号 - 订单号 - 客户名称 - 充值号码 + 充值类型 + 运营商 + 充值内容 充值金额 - 支付金额 + 充值订单号 + 客户名称 生成时间 支付方式 - 充值状态 - 订单状态 - 操作 + 充值状态 + 支付状态 + 操作 - {{i+1}} - {{data.remarks}} - {{data.rechargeModel | rechargePrice}} - {{data.rechargeType== 1? '快充':'慢充'}} - {{data.idCard}} + {{i + 1}} + {{data.type == 1 ? '话费充值' : ''}} + {{data.operatorName}} + {{data.rechargeContent}} | {{data.rechargeType == 1 ? '快充' : '慢充'}} + ¥{{data.rechargePrice}} {{data.orderNo}} - {{data.userName == null ? '暂无': data.userName}} - {{data.rechargeContent == null ? '暂无': data.rechargeContent}} - {{data.orderPrice}} - {{data.payPrice}} + {{data.userName == null ? '暂无' : data.userName}} {{data.createTimed | date: 'yyyy-MM-dd HH:mm:ss'}} {{data.payType | rechargePayType}} - - {{data.rechargeStatus == 1 ? '充值异常' : '正常'}} - ({{data.abnormalMsg}}) - - {{data.status | rechargeStatus}} + {{data.rechargeStatus | rechargeStatus}} + {{data.payStatus | payStatus}} - 详情 - 再次充值 - 申请退款 + 详情 + + 查看子订单
- + - {{data['remarks']}} - {{data['rechargeModel'] | rechargePrice}} {{data['orderNo']}} - {{data['userName'] == null ? '暂无': data['userName']}} - {{data['rechargeContent'] == null ? '暂无': data['rechargeContent']}} - {{data['idCard']}} - {{data['rechargeName']}} - {{data['orderPrice']}} - {{data['payPrice']}} - {{data['refundFee']}} + {{data['type'] == 1 ? '话费充值' : ''}} + {{data['operatorName']}} + {{data['rechargeContent']}} | {{data['rechargeType'] == 1 ? '快充' : '慢充'}} + ¥{{data['rechargePrice']}} + ¥{{data['payPrice']}} + ¥{{data['integralDeductionPrice'] == null ? '0' : data['integralDeductionPrice']}} + ¥{{data['discountDeductionPrice'] == null ? '0' : data['discountDeductionPrice']}} + ¥{{data['payRealPrice']}} + ¥{{data['refundFee']}} + {{data['memDiscountName']}} + {{data['paySerialNo']}} {{data['createTimed'] | date: 'yyyy-MM-dd HH:mm:ss'}} {{data['cancelTime'] | date: 'yyyy-MM-dd HH:mm:ss'}} {{data['finishTime'] | date: 'yyyy-MM-dd HH:mm:ss'}} {{data['payTime'] | date: 'yyyy-MM-dd HH:mm:ss'}} {{data['refundTime'] | date: 'yyyy-MM-dd HH:mm:ss'}} - {{data['status'] | rechargeStatus}} + {{data['payType'] | rechargePayType}} + {{data['laborUnionCard']}} + {{data['rechargeStatus'] | rechargeStatus}} + {{data['payStatus'] | payStatus}} - - - - - - + + + - 序号 - 订单号 - 用户昵称 - 用户联系方式 - 充值类型 - 充值内容 - 支付方式 - 卡号 - 订单金额 - 应付金额 - 订单状态 - 支付时间 - 原因 + 订单号 + 充值平台 + 充值状态 + 创建时间 - - {{ i + 1}} + {{data.orderNo}} - {{data.userName}} - {{data.userPhone}} - {{data.rechargeModelName}} - {{data.rechargeContent}} - {{data.payTypeName}} - {{data.cardNo}} - {{data.orderPrice}} - {{data.payRealPrice}} - {{data.statusName}} - {{data.payTime}} - {{data.errorMessage}} + {{data.rechargePlatform == 1 ? '尖椒':'龙阅'}} + {{data.status | chlidRechargeStatus}} + {{data['createTime'] | date: 'yyyy-MM-dd HH:mm'}} diff --git a/src/app/admin/recharge-order/order-list/order-list.component.ts b/src/app/admin/recharge-order/order-list/order-list.component.ts index db5b170..3e8b8e6 100644 --- a/src/app/admin/recharge-order/order-list/order-list.component.ts +++ b/src/app/admin/recharge-order/order-list/order-list.component.ts @@ -22,8 +22,10 @@ export class OrderListComponent implements OnInit , OnDestroy { searchForm: FormGroup; // 搜索框 validateForm: FormGroup; // 添加框 requestData = []; // 列表数据 + childData = []; // 列表数据 importErrorStudentArray = []; errorStudentVisible = false; + isVisibleChild = false; total: number; // 页码 pageNum = 1; // 页码 pageSize = 10; // 条码 @@ -249,4 +251,16 @@ export class OrderListComponent implements OnInit , OnDestroy { this.errorStudentVisible = true; } + // 查询子订单 + public getChildOrder(id: number): void { + this.isVisibleChild = true; + this.recharge.getChildOrder(id , data => { + if (data['return_code'] === '000000') { + this.childData = data['return_data']; + } else { + this.message.error(data['return_msg']); + } + }); + } + } diff --git a/src/app/admin/recharge-order/order-statistical/order-statistical.component.html b/src/app/admin/recharge-order/order-statistical/order-statistical.component.html index fedba68..7ddffa9 100644 --- a/src/app/admin/recharge-order/order-statistical/order-statistical.component.html +++ b/src/app/admin/recharge-order/order-statistical/order-statistical.component.html @@ -19,11 +19,11 @@ 订单状态 - - - - - + + + + + @@ -74,7 +74,7 @@ {{data.count}} {{data.payPrice}} {{data.orderPrice}} - {{data.status | rechargeStatus}} + {{data.payStatus | payStatus}}
diff --git a/src/app/admin/recharge-order/order-statistical/order-statistical.component.ts b/src/app/admin/recharge-order/order-statistical/order-statistical.component.ts index 26ab063..5eb6a1d 100644 --- a/src/app/admin/recharge-order/order-statistical/order-statistical.component.ts +++ b/src/app/admin/recharge-order/order-statistical/order-statistical.component.ts @@ -27,7 +27,7 @@ export class OrderStatisticalComponent implements OnInit { ngOnInit(): void { this.searchForm = this.form.group({ finishTime: [null], - status: ['3'], + status: ['100'], }); this.getRequest(true, this.searchForm.value); } diff --git a/src/app/admin/recharge-order/price-list/price-list.component.html b/src/app/admin/recharge-order/price-list/price-list.component.html index 406ef4d..d03eac8 100644 --- a/src/app/admin/recharge-order/price-list/price-list.component.html +++ b/src/app/admin/recharge-order/price-list/price-list.component.html @@ -9,24 +9,23 @@
- 金额类型 + 运营商 - - - - + + + +
- 展示区域 + 充值平台 - - - - + + + @@ -42,6 +41,42 @@
+ + + + + + + + + + + + +
+ + 充值方式 + + + + + + + +
+
+ + 价格状态 + + + + + + + + +
+
@@ -73,35 +108,46 @@ [nzTotal]="total" [(nzPageIndex)]="pageNum" [(nzPageSize)]="pageSize" + [nzScroll]="{ x: '1200px' }" (nzPageIndexChange)="getRequest(false , searchForm.value)" (nzPageSizeChange)="getRequest(false , searchForm.value)"> - 编号 - 金额类型 - 充值类型 - 展示区域 - - - 充值金额 - 支付金额 - 创建时间 - 操作 + 编号 + 充值金额 + 折扣比例 + 支付金额 + 积分抵扣比例 + 运营商 + 充值类型 + 充值平台 + 支付方式 + 展示平台 + 商品ID + 创建时间 + 状态 + 操作 {{i + 1}} - {{data.type | rechargePrice}} + {{data.rechargePrice}} + {{data.discount + "%"}} + {{data.payPrice}} + {{data.integralDiscount + "%"}} + {{data.operatorType | rechargePrice}} {{data.rechargeType== 1? '快充':'慢充'}} - {{data.showType | showType}} - {{data.price}} - {{data.realPrice}} + {{data.rechargePlatform | rechargePlatform}} + {{data.productPayTypeString.substring(0 , data.productPayTypeString.length - 1)}} + {{data.productPlatformString.substring(0 , data.productPlatformString.length - 1)}} + {{data.goodsId == null ? '暂未配置' : data.goodsId}} {{data.createTime | date: 'yyyy-MM-dd HH:mm'}} - - 编辑 - {{data.status === 1 ? '禁用': '启用'}} - 删除 + {{data.status | priceStatus}} + + 编辑 + {{data.status === 1 ? '售空': '上线'}} + 删除 @@ -112,24 +158,80 @@ 金额类型 - - - - + + + - - 展示区域 - - - - - + + 充值金额 + + + + + + 支付金额 + + + + + + 运营商 + + + + + - + + 展示平台 + + + + + + + + 充值平台 + + + + + + + + 支付方式 + + + + + + + + 充值方式 + + + + + + + + 充值类型 @@ -139,73 +241,66 @@ - 商品排序 - - + 折扣比例 + + - - - - - - - - - - - - - 充值金额 - - - - + 积分支付比例 + + - - 折扣比例 - - - - + + 商品编号 + + - - 支付金额 - - - - + + 排序 + + - - - - - 供货商编号 - 商品ID - 渠道商标识符 - 折扣比例 - 商品名称 - 渠道商名称 - 状态 - - - - - {{data.channel}} - {{data.goodsId}} - {{data.channelMark | channelMark}} - {{data.discountRatio}}% - {{data.goodsName}} - {{data.memberName}} - {{data.state == 1 ? '上架' : '下架'}} - - - - diff --git a/src/app/admin/recharge-order/price-list/price-list.component.ts b/src/app/admin/recharge-order/price-list/price-list.component.ts index 36691eb..903eccd 100644 --- a/src/app/admin/recharge-order/price-list/price-list.component.ts +++ b/src/app/admin/recharge-order/price-list/price-list.component.ts @@ -19,6 +19,10 @@ export class PriceListComponent implements OnInit { searchForm: FormGroup; // 搜索框 validateForm: FormGroup; // 添加框 requestData = []; // 列表数据 + priceArray = []; // 价格数据 + priceTypeArray = []; // 支付类型数据 + platformArray = []; // 充值平台数据 + productPlatformArray = []; // 展示平台数据 total: number; // 页码 pageNum = 1; // 页码 @@ -27,10 +31,13 @@ export class PriceListComponent implements OnInit { isVisible = false; id: number; edit = false; - + payPrice; isVisibleGoods = false; realPrice = 0; - goodsArray; + + formatterPercent = (value: number): string => `${value == null ? 0 : value} %`; + parserPercent = (value: string): string => value.replace(' %', ''); + constructor( private form: FormBuilder, private recharge: RechargeService, @@ -45,23 +52,53 @@ export class PriceListComponent implements OnInit { ngOnInit(): void { this.init(); + this.getInitData(); + } + + // 获取初始化数据 + private getInitData(): void { + // 获取价格数据 + this.common.getDictionary('RECHARGE_AMOUNT ', data => { + this.priceArray = data['return_data']; + }); + // 获取支付类型 + this.common.getDictionary('PAY_TYPE ', data => { + this.priceTypeArray = data['return_data']; + }); + // 获取充值平台 + this.common.getDictionary('RECHARGE_PLATFORM ', data => { + this.platformArray = data['return_data']; + }); + // 获取展示平台 + this.common.getDictionary('SHOW_PLATFORM ', data => { + this.productPlatformArray = data['return_data']; + }); + } public init(): void { this.searchForm = this.form.group({ - type: [null], + operatorType : [null], + rechargePlatform: [null], rechargeType: [null], - showType: [null], + rechargeWay: [null], + status: [null], }); this.validateForm = this.form.group({ - type: [null, [Validators.required]], - showType: [null, [Validators.required]], - price: [null, [Validators.required]], - rechargeType: [null, [Validators.required]], - realPrice: [{value: null, disabled: true}, [Validators.required]], discount: [null, [Validators.required]], - sort: [null, [Validators.required]], - // channel: [null, [Validators.required]], + integralDiscount: [0], + operatorType: [null, [Validators.required]], + rechargePrices: [null, [Validators.required]], + productPlatform: [null, [Validators.required]], + rechargeType: [null, [Validators.required]], + rechargePlatform: [null, [Validators.required]], + rechargeWay: [null, [Validators.required]], + payType: [null, [Validators.required]], + rechargePrice: [null], + payPrice: [null], + sort: [null], + goodsId: [null], + }); @@ -98,6 +135,10 @@ export class PriceListComponent implements OnInit { this.id = id; this.edit = true; this.recharge.findById(id, data => { + data['return_data']['productPlatform'] = data['return_data']['productPlatformString'].substring(0 , data['return_data']['productPlatformString'].length - 1).split(','); + data['return_data']['rechargePlatform'] = data['return_data']['rechargePlatform'].substring(1 , data['return_data']['rechargePlatform'].length - 1).split('-'); + data['return_data']['payType'] = data['return_data']['productPayTypeString'].substring(0 , data['return_data']['productPayTypeString'].length - 1).split(','); + data['return_data']['rechargePrices'] = ['1']; this.validateForm.patchValue(data['return_data']); this.isVisible = true; }); @@ -108,17 +149,8 @@ export class PriceListComponent implements OnInit { } } - // 查看详情 - public getDetail(id: number): void { - this.router.navigate(['/admin/company/company-detail'], { - queryParams: { - companyId: id - } - }).then(r => console.log(r)); - } - - handleOk(): void { + const wait = this.message.loading('提交中..', { nzDuration: 0 }).messageId; // tslint:disable-next-line:forin for (const i in this.validateForm.controls) { this.validateForm.controls[i].markAsDirty(); @@ -128,14 +160,15 @@ export class PriceListComponent implements OnInit { return; } } - this.validateForm.value.realPrice = this.validateForm.value.price * this.validateForm.value.discount / 100; if (this.edit) { this.validateForm.value['id'] = this.id; this.recharge.updatePrice(this.validateForm.value, data => { if (data['return_code'] === '000000') { + this.message.remove(wait); this.message.success('修改成功'); this.getRequest(false, this.searchForm.value); + this.validateForm.reset(); this.isVisible = false; } else { this.message.error(data['return_msg']); @@ -144,9 +177,11 @@ export class PriceListComponent implements OnInit { } else { this.recharge.insertPrice(this.validateForm.value, data => { if (data['return_code'] === '000000') { + this.message.remove(wait); this.message.success('添加成功'); this.getRequest(false, this.searchForm.value); this.isVisible = false; + this.validateForm.reset(); } else { this.message.error(data['return_msg']); } @@ -156,35 +191,59 @@ export class PriceListComponent implements OnInit { } handleCancel(): void { + this.validateForm.reset(); this.isVisible = false; } - handleCancelGoods(): void { - this.isVisibleGoods = false; - } - public getForbiddenUser(id, status: any): void { - const message = (status === 1 ? '是否禁用' : '是否启用'); + public getForbiddenUser(idPost, status: any): void { + + let statusPost; + let message; - this.common.showConfirm(message, data => { - if (data) { - this.recharge.onAndOffShelves(id, dataUser => { - if (dataUser['return_code'] === '000000') { - this.message.success('操作成功'); - this.getRequest(false , this.searchForm.value); + switch (status) { + case 1: + statusPost = 2; + message = '是否售空'; + break; + case 2: + statusPost = 1; + message = '是否上线'; + break; + case 3: + statusPost = 1; + message = '是否上线'; + break; + } + + this.common.showConfirm(message, item => { + if (item) { + this.recharge.editPriceStatus( { + id: idPost, + status: statusPost + }, data => { + if (data['return_code'] === '000000') { + this.message.success('提交成功'); + this.getRequest(false, this.searchForm.value); } else { - this.message.error(dataUser['return_msg']); + this.message.error(data['return_msg']); } }); } }); + console.log(status); + console.log(statusPost); + console.log(message); } - public getForbiddenUserD(id): void { + public getForbiddenUserD(idPost): void { this.common.showConfirm('是否删除', item => { if (item) { - this.recharge.deletePrice(id, data => { + this.recharge.editPriceStatus({ + id: idPost, + status: 0 + }, data => { if (data['return_code'] === '000000') { this.message.success('删除成功'); this.getRequest(false, this.searchForm.value); @@ -196,17 +255,9 @@ export class PriceListComponent implements OnInit { }); } - public getMemberGoods(): void { - this.isVisibleGoods = true; - this.recharge.getMemberGoods(data => { - this.goodsArray = data['return_data']['data']; - }); + public changePayType(e): void { + this.payPrice = this.validateForm.value['rechargePrice'] * e / 100; } - public getPrice(): void { - this.realPrice = this.validateForm.value.price * this.validateForm.value.discount / 100; - } - - } diff --git a/src/app/app-common.module.ts b/src/app/app-common.module.ts index 43159ee..4e53997 100644 --- a/src/app/app-common.module.ts +++ b/src/app/app-common.module.ts @@ -41,14 +41,19 @@ import { CompanyAmountRecordTypePipe, CompanyAmountRecordSourceTypePipe, OilCardBindStatusPipe, - OilCardRecordTypePipe, OilCardRecordSourceTypePipe + OilCardRecordTypePipe, + OilCardRecordSourceTypePipe, + RechargePlatformPipe, + PriceStatusPipe, + GasStaffStatusPipe, + PayStatusPipe, + ChlidRechargeStatusPipe } from './pipes'; -import {OilCardStatusPipe} from "./pipes/oil-card/oil-card-status.pipe"; -import { OilTypePipe } from './pipes/store/oil-type.pipe'; - - - - +import {OilCardStatusPipe} from './pipes'; +import {OilTypePipe} from './pipes/store/oil-type.pipe'; +import {OilPriceTaskStatusPipe} from './pipes/gas-oil-price/oil-price-task-status.pipe'; +import {OilPriceTaskExecutionTypePipe} from './pipes/gas-oil-price/oil-price-task-execution-type.pipe'; +import {OilPriceTaskPriceTypePipe} from './pipes/gas-oil-price/oil-price-task-price-type.pipe'; const PIPES = [ TimesPipe, @@ -86,6 +91,15 @@ const PIPES = [ OilCardBindStatusPipe, OilCardRecordTypePipe, OilCardRecordSourceTypePipe, + GasStaffStatusPipe, + OilTypePipe, + RechargePlatformPipe, + PriceStatusPipe, + OilPriceTaskStatusPipe, + OilPriceTaskExecutionTypePipe, + OilPriceTaskPriceTypePipe, + PayStatusPipe, + ChlidRechargeStatusPipe, ]; @@ -99,8 +113,6 @@ const PIPES = [ ], declarations: [ ...PIPES, - OilTypePipe, - ], exports: [ diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 74cf71a..30b8329 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -117,6 +117,16 @@ const routes: Routes = [ loadChildren: () => import('./admin/gz-sinopec/gz-sinopec.module').then(m => m.GzSinopecModule), canActivate: [InitGuardService] }, + { + path: 'gas-staff', + loadChildren: () => import('./admin/gas-staff/gas-staff.module').then(m => m.GasStaffModule), + canActivate: [InitGuardService] + }, + { + path: 'gas-oil-price', + loadChildren: () => import('./admin/gas-oil-price/gas-oil-price.module').then(m => m.GasOilPriceModule), + canActivate: [InitGuardService] + }, ], }, ]; diff --git a/src/app/pipes/chlid-recharge-status.pipe.ts b/src/app/pipes/chlid-recharge-status.pipe.ts new file mode 100644 index 0000000..b43a75a --- /dev/null +++ b/src/app/pipes/chlid-recharge-status.pipe.ts @@ -0,0 +1,21 @@ +import { Pipe, PipeTransform } from '@angular/core'; + +@Pipe({ + name: 'chlidRechargeStatus' +}) +export class ChlidRechargeStatusPipe implements PipeTransform { + + transform(value: number): string { + switch (value) { + case 101: + return '充值成功'; + case 102: + return '充值中'; + case 103: + return '充值失败'; + case 104: + return '未充值'; + } + } + +} diff --git a/src/app/pipes/gas-oil-price/oil-price-task-execution-type.pipe.ts b/src/app/pipes/gas-oil-price/oil-price-task-execution-type.pipe.ts new file mode 100644 index 0000000..c373a7f --- /dev/null +++ b/src/app/pipes/gas-oil-price/oil-price-task-execution-type.pipe.ts @@ -0,0 +1,17 @@ +import { Pipe, PipeTransform } from '@angular/core'; + +@Pipe({ + name: 'oilPriceTaskExecutionType' +}) +export class OilPriceTaskExecutionTypePipe implements PipeTransform { + + transform(value: number): string { + switch (value) { + case 1: + return '立刻执行'; + case 2: + return '定时执行'; + } + } + +} diff --git a/src/app/pipes/gas-oil-price/oil-price-task-price-type.pipe.ts b/src/app/pipes/gas-oil-price/oil-price-task-price-type.pipe.ts new file mode 100644 index 0000000..2d988f3 --- /dev/null +++ b/src/app/pipes/gas-oil-price/oil-price-task-price-type.pipe.ts @@ -0,0 +1,19 @@ +import { Pipe, PipeTransform } from '@angular/core'; + +@Pipe({ + name: 'oilPriceTaskPriceType' +}) +export class OilPriceTaskPriceTypePipe implements PipeTransform { + + transform(value: number): string { + switch (value) { + case 1: + return '国标价'; + case 2: + return '油站价'; + case 3: + return '优惠幅度'; + } + } + +} diff --git a/src/app/pipes/gas-oil-price/oil-price-task-status.pipe.ts b/src/app/pipes/gas-oil-price/oil-price-task-status.pipe.ts new file mode 100644 index 0000000..703e6db --- /dev/null +++ b/src/app/pipes/gas-oil-price/oil-price-task-status.pipe.ts @@ -0,0 +1,17 @@ +import { Pipe, PipeTransform } from '@angular/core'; + +@Pipe({ + name: 'oilPriceTaskStatus' +}) +export class OilPriceTaskStatusPipe implements PipeTransform { + + transform(value: number): string { + switch (value) { + case 1: + return '等待中'; + case 2: + return '已执行'; + } + } + +} diff --git a/src/app/pipes/gas-staff/gas-staff-status.pipe.ts b/src/app/pipes/gas-staff/gas-staff-status.pipe.ts new file mode 100644 index 0000000..dd58646 --- /dev/null +++ b/src/app/pipes/gas-staff/gas-staff-status.pipe.ts @@ -0,0 +1,19 @@ +import { Pipe, PipeTransform } from '@angular/core'; + +@Pipe({ + name: 'gasStaffStatus' +}) +export class GasStaffStatusPipe implements PipeTransform { + + transform(value: number): string { + switch (value) { + case 0: + return '删除'; + case 1: + return '正常'; + case 2: + return '已禁用'; + } + } + +} diff --git a/src/app/pipes/index.ts b/src/app/pipes/index.ts index 7481d5f..78e6433 100644 --- a/src/app/pipes/index.ts +++ b/src/app/pipes/index.ts @@ -32,3 +32,8 @@ export * from './oil-card/oil-card-status.pipe'; export * from './oil-card/oil-card-bind-status.pipe'; export * from './oil-card/oil-card-record-type.pipe'; export * from './oil-card/oil-card-record-source-type.pipe'; +export * from './gas-staff/gas-staff-status.pipe'; +export * from './recharge-price/recharge-platform.pipe'; +export * from './recharge-price/price-status.pipe'; +export * from './pay-status.pipe'; +export * from './chlid-recharge-status.pipe'; diff --git a/src/app/pipes/pay-status.pipe.ts b/src/app/pipes/pay-status.pipe.ts new file mode 100644 index 0000000..15edb4b --- /dev/null +++ b/src/app/pipes/pay-status.pipe.ts @@ -0,0 +1,23 @@ +import { Pipe, PipeTransform } from '@angular/core'; + +@Pipe({ + name: 'payStatus' +}) +export class PayStatusPipe implements PipeTransform { + + transform(value: number): string { + switch (value) { + case 101: + return '待支付'; + case 102: + return '已支付'; + case 100: + return '已完成'; + case 104: + return '已取消'; + case 105: + return '已退款'; + } + } + +} diff --git a/src/app/pipes/recharge-pay-type.pipe.ts b/src/app/pipes/recharge-pay-type.pipe.ts index 730a0b2..4adb344 100644 --- a/src/app/pipes/recharge-pay-type.pipe.ts +++ b/src/app/pipes/recharge-pay-type.pipe.ts @@ -1,21 +1,26 @@ -import { Pipe, PipeTransform } from '@angular/core'; +import {Pipe, PipeTransform} from '@angular/core'; @Pipe({ - name: 'rechargePayType' + name: 'rechargePayType' }) export class RechargePayTypePipe implements PipeTransform { - transform(value: number): string { - switch (value) { - case 1: - return '微信'; - case 2: - return '工会卡'; - case 3: - return '积分'; - case 4: - return '银联'; + transform(value: number): string { + switch (value) { + case 1: + return '支付宝'; + case 2: + return '微信'; + case 3: + return '汇联通工会卡'; + case 4: + return '银联'; + case 5: + return '银联分期'; + case null: + return '积分抵扣'; + } } - } } + diff --git a/src/app/pipes/recharge-price.pipe.ts b/src/app/pipes/recharge-price.pipe.ts index 7da171c..dfde7b3 100644 --- a/src/app/pipes/recharge-price.pipe.ts +++ b/src/app/pipes/recharge-price.pipe.ts @@ -8,11 +8,11 @@ export class RechargePricePipe implements PipeTransform { transform(value: number): string { switch (value) { case 1: - return '电信充值'; + return '电信运营商'; case 2: - return '移动充值'; + return '移动运营商'; case 3: - return '联通充值'; + return '联通运营商'; } } diff --git a/src/app/pipes/recharge-price/price-status.pipe.ts b/src/app/pipes/recharge-price/price-status.pipe.ts new file mode 100644 index 0000000..e110c73 --- /dev/null +++ b/src/app/pipes/recharge-price/price-status.pipe.ts @@ -0,0 +1,19 @@ +import { Pipe, PipeTransform } from '@angular/core'; + +@Pipe({ + name: 'priceStatus' +}) +export class PriceStatusPipe implements PipeTransform { + + transform(value: number): string { + switch (value) { + case 1: + return '上线中'; + case 2: + return '已售空'; + case 3: + return '编辑中'; + } + } + +} diff --git a/src/app/pipes/recharge-price/recharge-platform.pipe.ts b/src/app/pipes/recharge-price/recharge-platform.pipe.ts new file mode 100644 index 0000000..5897009 --- /dev/null +++ b/src/app/pipes/recharge-price/recharge-platform.pipe.ts @@ -0,0 +1,23 @@ +import {Pipe, PipeTransform} from '@angular/core'; + +@Pipe({ + name: 'rechargePlatform' +}) +export class RechargePlatformPipe implements PipeTransform { + + transform(value: string): unknown { + const array = value.split('-'); + let string = ''; + for (const i of array) { + if (Number(i) === 1) { + string = string + '尖椒,'; + } + if (Number(i) === 2) { + string = string + '龙阅,'; + } + + } + return string.substring(0 , string.length - 1); + } + +} diff --git a/src/app/pipes/recharge-status.pipe.ts b/src/app/pipes/recharge-status.pipe.ts index e659165..fd8e946 100644 --- a/src/app/pipes/recharge-status.pipe.ts +++ b/src/app/pipes/recharge-status.pipe.ts @@ -7,18 +7,14 @@ export class RechargeStatusPipe implements PipeTransform { transform(value: number): string { switch (value) { - case 1: - return '待支付'; - case 2: - return '已支付'; - case 3: - return '已完成'; - case 4: - return '已退款'; - case 5: - return '已取消'; - case 6: - return '退款中'; + case 201: + return '充值中'; + case 202: + return '充值成功'; + case 203: + return '充值失败'; + case 204: + return '充值中'; } } diff --git a/src/app/services/commons.service.ts b/src/app/services/commons.service.ts index cecb47c..c98d14a 100644 --- a/src/app/services/commons.service.ts +++ b/src/app/services/commons.service.ts @@ -6,49 +6,51 @@ import {environment} from '../../environments/environment'; import {HttpClient} from '@angular/common/http'; @Injectable({ - providedIn: 'root' + providedIn: 'root' }) export class CommonsService { - constructor( - private storage: LocalStorageService, - private modalService: NzModalService, // 对话框 - private http: HttpClient, - private notification: NzNotificationService - ) { } + constructor( + private storage: LocalStorageService, + private modalService: NzModalService, // 对话框 + private http: HttpClient, + private notification: NzNotificationService + ) { + } - /** - * 将对象转换成GET请求参数 key1=value1&key2=value2 - * @param object 传入对象 - */ - getWhereCondition(object: object): string { - let str = ''; - for (const i in object) { - if (object[i] != null && object[i] !== '') { - if (str === '') { - str = i + '=' + object[i]; - } else { - str += '&' + i + '=' + object[i]; + /** + * 将对象转换成GET请求参数 key1=value1&key2=value2 + * @param object 传入对象 + */ + getWhereCondition(object: object): string { + let str = ''; + for (const i in object) { + if (object[i] != null && object[i] !== '') { + if (str === '') { + str = i + '=' + object[i]; + } else { + str += '&' + i + '=' + object[i]; + } + } } - } + return str; } - return str; - } - /** - * 校验当前用户是否拥有按钮权限 - * @param btnCode 按钮名称 - */ - public isBtnCompetence(btnCode: string): boolean { - let buttonList = []; - buttonList = this.storage.get(DATA).buttonList; - if (buttonList != null && buttonList.length > 0) { - if (buttonList.find(b => b.permissionCode === btnCode) != null) { - return true; - } + /** + * 校验当前用户是否拥有按钮权限 + * @param btnCode 按钮名称 + */ + public isBtnCompetence(btnCode: string): boolean { + let buttonList = []; + buttonList = this.storage.get(DATA).buttonList; + if (buttonList != null && buttonList.length > 0) { + if (buttonList.find(b => b.permissionCode === btnCode) != null) { + return true; + } + } + return false; } - return false; - } + /** * 提示框提示 @@ -117,6 +119,26 @@ export class CommonsService { }); } + /** + * 查询省级列表 + * @param callBack 回调 + */ + public getProvinceList(callBack) { + this.http.get(environment.baseUrl + 'common/getProvinceList').subscribe(data => { + callBack(data); + }); + } + + /** + * 查询省级列表 + * @param callBack 回调 + */ + public getGasSelectList(callBack) { + this.http.get(environment.baseUrl + 'highGas/getGasSelectList').subscribe(data => { + callBack(data); + }); + } + /** * 根据数组对象去重 @@ -191,168 +213,179 @@ export class CommonsService { }); } - /** - * 时间戳转化为年 月 日 时 分 秒 - * timestamp: 时间戳 - * format:返回格式,支持自定义,但参数必须与formatArr里保持一致 - */ - public formatTime(timestamp: number, format: string) { + /** + * 时间戳转化为年 月 日 时 分 秒 + * timestamp: 时间戳 + * format:返回格式,支持自定义,但参数必须与formatArr里保持一致 + */ + public formatTime(timestamp: number, format: string) { - const formatArr = ['yyyy', 'MM', 'dd', 'HH', 'mm', 'ss']; - const returnArr = []; - const date = new Date(timestamp); + const formatArr = ['yyyy', 'MM', 'dd', 'HH', 'mm', 'ss']; + const returnArr = []; + const date = new Date(timestamp); - returnArr.push(date.getFullYear()); - returnArr.push(this.formatNumber(date.getMonth() + 1)); - returnArr.push(this.formatNumber(date.getDate())); + returnArr.push(date.getFullYear()); + returnArr.push(this.formatNumber(date.getMonth() + 1)); + returnArr.push(this.formatNumber(date.getDate())); - returnArr.push(this.formatNumber(date.getHours())); - returnArr.push(this.formatNumber(date.getMinutes())); - returnArr.push(this.formatNumber(date.getSeconds())); + returnArr.push(this.formatNumber(date.getHours())); + returnArr.push(this.formatNumber(date.getMinutes())); + returnArr.push(this.formatNumber(date.getSeconds())); - // tslint:disable-next-line:forin - for (const i in returnArr) { - format = format.replace(formatArr[i], returnArr[i]); + // tslint:disable-next-line:forin + for (const i in returnArr) { + format = format.replace(formatArr[i], returnArr[i]); + } + return format; } - return format; - } - // 数据转化 - formatNumber(n) { - n = n.toString(); - return n[1] ? n : '0' + n; - } + // 数据转化 + formatNumber(n) { + n = n.toString(); + return n[1] ? n : '0' + n; + } - /** - * Notification通知提醒框 - * - * @param type 页码 - * @param title 标题 - * @param content 内容 - */ - public createNotification(type: string , title: string , content: string): void { - this.notification.create( - type, - title, - content - ); - } + /** + * Notification通知提醒框 + * + * @param type 页码 + * @param title 标题 + * @param content 内容 + */ + public createNotification(type: string, title: string, content: string): void { + this.notification.create( + type, + title, + content + ); + } - /** - * 职位列表key查询value - * - * @param value string - * @param object object - * @param callback 回调 - */ - public positionKeyValue(value: string , object: Array , callback): void { - // tslint:disable-next-line:forin - for (const i in object) { - if (object[i].value === value) { - callback(object[i].label); - } else { - this.positionKeyValue(value , object[i].children , callback); - } + /** + * 职位列表key查询value + * + * @param value string + * @param object object + * @param callback 回调 + */ + public positionKeyValue(value: string, object: Array, callback): void { + // tslint:disable-next-line:forin + for (const i in object) { + if (object[i].value === value) { + callback(object[i].label); + } else { + this.positionKeyValue(value, object[i].children, callback); + } + } } - } - /** - * 根据数据类型查询数据字典 - * - * @param codeType 类型 - * @param codeValue value - * @param callback 回调 - */ - public getDictionaryByCodeTypeAndValue(codeType: string , codeValue: string , callback): any { - this.http.get(environment.baseUrl + '/common/getDictionaryByCodeTypeAndValue?codeType=' + codeType + '&codeValue=' + codeValue).subscribe( data => { - callback(data); - }); - } + /** + * 根据数据类型查询数据字典 + * + * @param codeType 类型 + * @param codeValue value + * @param callback 回调 + */ + public getDictionaryByCodeTypeAndValue(codeType: string, codeValue: string, callback): any { + this.http.get(environment.baseUrl + '/common/getDictionaryByCodeTypeAndValue?codeType=' + codeType + '&codeValue=' + codeValue).subscribe(data => { + callback(data); + }); + } - /** - * 根据数据类型查询数据字典 同步请求 - * - * @param codeType 类型 - * @param codeValue value - * @param callback 回调 - */ - public getDictionaryByCodeTypeAndValuePromise(codeType: string , codeValue: string): any { - return new Promise(resolve => { - this.http.get(environment.baseUrl + '/common/getDictionaryByCodeTypeAndValue?codeType=' + codeType + '&codeValue=' + codeValue).subscribe(data => { - resolve(data['return_data']['codeName']); - }); - }); - } + /** + * 根据数据类型查询数据字典 同步请求 + * + * @param codeType 类型 + * @param codeValue value + * @param callback 回调 + */ + public getDictionaryByCodeTypeAndValuePromise(codeType: string, codeValue: string): any { + return new Promise(resolve => { + this.http.get(environment.baseUrl + '/common/getDictionaryByCodeTypeAndValue?codeType=' + codeType + '&codeValue=' + codeValue).subscribe(data => { + resolve(data['return_data']['codeName']); + }); + }); + } /** * 查询登录页展示的公司 * @param param 参数 * @param callback 回调 */ - public getHomeCompanyList(param: object, callback): any { - this.http.get(environment.baseUrl + 'common/getHomeCompanyList?' + this.getWhereCondition(param)).subscribe( data => { - callback(data); - }); - } + public getHomeCompanyList(param: object, callback): any { + this.http.get(environment.baseUrl + 'common/getHomeCompanyList?' + this.getWhereCondition(param)).subscribe(data => { + callback(data); + }); + } - /** - * 新增团油油品配置 - * - * @param params 上传对象 - * @param callBack 回调 - * @return data 返回结果 - */ - public editGasDiscountOilPrice(params: object, callBack) { - this.http.post(environment.baseUrl + 'highGasDiscountOilPrice/editGasDiscountOilPrice', params).subscribe(data => { - callBack(data); - }); - } + /** + * 新增团油油品配置 + * + * @param params 上传对象 + * @param callBack 回调 + * @return data 返回结果 + */ + public editGasDiscountOilPrice(params: object, callBack) { + this.http.post(environment.baseUrl + 'highGasDiscountOilPrice/editGasDiscountOilPrice', params).subscribe(data => { + callBack(data); + }); + } - /** - * 查询公司列表 - * - * @param paramsObject 对象 - * @param callBack 回调 - */ - public getList(paramsObject: object, callBack) { - this.http.get(environment.baseUrl + 'highGasDiscountOilPrice/getList?' + this.getWhereCondition(paramsObject)).subscribe(data => { - callBack(data); - }); - } + /** + * 查询公司列表 + * + * @param paramsObject 对象 + * @param callBack 回调 + */ + public getList(paramsObject: object, callBack) { + this.http.get(environment.baseUrl + 'highGasDiscountOilPrice/getList?' + this.getWhereCondition(paramsObject)).subscribe(data => { + callBack(data); + }); + } - /** - * 根据estateId 查询类目树 - * - * @param id 类目id - * @param callBack 回调 - */ - public getDetailById(id: number , callBack) { - this.http.get(environment.baseUrl + 'highGasDiscountOilPrice/getDetailById?id=' + id).subscribe(data => { - callBack(data); - }); - } + /** + * 根据estateId 查询类目树 + * + * @param id 类目id + * @param callBack 回调 + */ + public getDetailById(id: number, callBack) { + this.http.get(environment.baseUrl + 'highGasDiscountOilPrice/getDetailById?id=' + id).subscribe(data => { + callBack(data); + }); + } - /** - * 根据estateId 查询类目树 - * - * @param id 类目id - * @param callBack 回调 - */ - public delete(id: number , callBack) { - this.http.post(environment.baseUrl + 'highGasDiscountOilPrice/delete' , { id: id}).subscribe(data => { - callBack(data); - }); - } + /** + * 根据estateId 查询类目树 + * + * @param id 类目id + * @param callBack 回调 + */ + public delete(id: number, callBack) { + this.http.post(environment.baseUrl + 'highGasDiscountOilPrice/delete', {id: id}).subscribe(data => { + callBack(data); + }); + } - /** - * 查询公司 - * @param param 参数 - * @param callback 回调 - */ - public getOrganizationList(param: object, callback): any { - this.http.get(environment.baseUrl + 'bsOrganization/getOrganizationList?' + this.getWhereCondition(param)).subscribe( data => { - callback(data); - }); - } + /** + * 查询公司 + * @param param 参数 + * @param callback 回调 + */ + public getOrganizationList(param: object, callback): any { + this.http.get(environment.baseUrl + 'bsOrganization/getOrganizationList?' + this.getWhereCondition(param)).subscribe(data => { + callback(data); + }); + } + + /** + * 查询所有数据字典 + * @param param 参数 + * @param callback 回调 + */ + public getDictionaries(callback): any { + this.http.get(environment.baseUrl + 'bsOrganization/getOrganizationList').subscribe(data => { + callback(data); + }); + } } diff --git a/src/app/services/gas-staff.service.ts b/src/app/services/gas-staff.service.ts new file mode 100644 index 0000000..6b38116 --- /dev/null +++ b/src/app/services/gas-staff.service.ts @@ -0,0 +1,99 @@ +import { Injectable } from '@angular/core'; +import {HttpClient} from '_@angular_common@9.0.7@@angular/common/http'; +import {CommonsService} from './commons.service'; +import {environment} from '../../environments/environment'; + +@Injectable({ + providedIn: 'root' +}) +export class GasStaffService { + + constructor( + private http: HttpClient, + private common: CommonsService + ) { } + + /** + * 禁用油品 + * + * @param param 参数对象 + * @param callBack 回调 + */ + public addStaff(param: object, callBack) { + this.http.post(environment.baseUrl + 'gasStaff/addGasStaff', param).subscribe(data => { + callBack(data); + }); + } + + /** + * 禁用油品 + * + * @param param 参数对象 + * @param callBack 回调 + */ + public updateStaff(param: object, callBack) { + this.http.post(environment.baseUrl + 'gasStaff/updateGasStaff', param).subscribe(data => { + callBack(data); + }); + } + + /** + * 禁用 + * + * @param param 参数对象 + * @param callBack 回调 + */ + public disabled(param: object, callBack) { + this.http.post(environment.baseUrl + 'gasStaff/disabled', param).subscribe(data => { + callBack(data); + }); + } + + /** + * 恢复 + * + * @param param 参数对象 + * @param callBack 回调 + */ + public recover(param: object, callBack) { + this.http.post(environment.baseUrl + 'gasStaff/recover', param).subscribe(data => { + callBack(data); + }); + } + + /** + * 删除 + * + * @param param 参数对象 + * @param callBack 回调 + */ + public delStaff(param: object, callBack) { + this.http.post(environment.baseUrl + 'gasStaff/delStaff', param).subscribe(data => { + callBack(data); + }); + } + + /** + * 禁用油品 + * + * @param param 参数对象 + * @param callBack 回调 + */ + public getStaffDetail(staffId: number, callBack) { + this.http.get(environment.baseUrl + 'gasStaff/getStaffDetail?staffId=' + staffId).subscribe(data => { + callBack(data); + }); + } + + /** + * 禁用油品 + * + * @param param 参数对象 + * @param callBack 回调 + */ + public getStaffList(param: object, callBack) { + this.http.get(environment.baseUrl + 'gasStaff/getStaffList?' + this.common.getWhereCondition(param)).subscribe(data => { + callBack(data); + }); + } +} diff --git a/src/app/services/gas.service.ts b/src/app/services/gas.service.ts index 6dc73e5..64664d6 100644 --- a/src/app/services/gas.service.ts +++ b/src/app/services/gas.service.ts @@ -1,7 +1,7 @@ import { Injectable } from '@angular/core'; import {HttpClient} from '_@angular_common@9.0.7@@angular/common/http'; import {CommonsService} from './commons.service'; -import {environment} from "../../environments/environment"; +import {environment} from '../../environments/environment'; @Injectable({ providedIn: 'root' @@ -13,6 +13,18 @@ export class GasService { private common: CommonsService ) { } + /** + * 查询商户油站统计 + * + * @param param 参数对象 + * @param callBack 回调 + */ + public getMerGasStatistical(param: object, callBack) { + this.http.post(environment.baseUrl + 'highGas/getMerGasStatistical', param).subscribe(data => { + callBack(data); + }); + } + /** * 禁用油品 * diff --git a/src/app/services/index.service.ts b/src/app/services/index.service.ts index 9195faa..7377d43 100644 --- a/src/app/services/index.service.ts +++ b/src/app/services/index.service.ts @@ -164,6 +164,19 @@ export class IndexService { }); } + /** + * @Author Sum1Dream + * @methodName getGasStatistical + * @Description // 查询加油站统计 + * @Date 10:00 2022/5/18 + * @Param + */ + public getMerGasStatistical(callBack) { + this.http.post(environment.baseUrl + 'highGas/getMerGasStatistical', null).subscribe(data => { + callBack(data); + }); + } + /** * @Author Sum1Dream * @methodName getAccountRecordList diff --git a/src/app/services/local-storage.namespace.ts b/src/app/services/local-storage.namespace.ts index 7932616..c98ad03 100644 --- a/src/app/services/local-storage.namespace.ts +++ b/src/app/services/local-storage.namespace.ts @@ -14,3 +14,4 @@ export const RESUME_STATUS = 'resume_status'; export const RESUME_STATUS_NAME = 'resume_status_name'; export const LOGINTYPE = 'loginType'; // 1 pc端登录 2 后台登录 export const COMPANYMENU = 'companyMenu'; // 1 公司路由 +export const ALL_DICTIONARY = 'dictionary'; // 数据字典 diff --git a/src/app/services/mer-amount.service.ts b/src/app/services/mer-amount.service.ts new file mode 100644 index 0000000..2ff2b6c --- /dev/null +++ b/src/app/services/mer-amount.service.ts @@ -0,0 +1,28 @@ +import { Injectable } from '@angular/core'; +import {HttpClient} from '_@angular_common@9.0.7@@angular/common/http'; +import {CommonsService} from './commons.service'; +import {environment} from '../../environments/environment'; + +@Injectable({ + providedIn: 'root' +}) +export class MerAmountService { + + constructor( + private http: HttpClient, + private common: CommonsService + ) { } + + /** + * 充值 + * + * @param params 上传对象 + * @param callBack 回调 + * @return data 返回结果 + */ + public recharge(params: object, callBack) { + this.http.post(environment.baseUrl + 'merAccount/recharge', params).subscribe(data => { + callBack(data); + }); + } +} diff --git a/src/app/services/oil-price/oil-price-official.service.ts b/src/app/services/oil-price/oil-price-official.service.ts new file mode 100644 index 0000000..be7f713 --- /dev/null +++ b/src/app/services/oil-price/oil-price-official.service.ts @@ -0,0 +1,53 @@ +import { Injectable } from '@angular/core'; +import {HttpClient} from '_@angular_common@9.0.7@@angular/common/http'; +import {CommonsService} from '../commons.service'; +import {environment} from '../../../environments/environment'; + +@Injectable({ + providedIn: 'root' +}) +export class OilPriceOfficialService { + + constructor( + private http: HttpClient, + private common: CommonsService + ) { } + + + /** + * 修改油品国标价价格 + * + * @param paramsObject 对象 + * @param callBack 回调 + */ + public updateOilPriceOfficial(paramsObject: object, callBack) { + this.http.post(environment.baseUrl + 'gasOilPriceOfficial/updateOilPriceOfficial', paramsObject).subscribe(data => { + callBack(data); + }); + } + + /** + * 查询油品国标价列表 + * + * @param paramsObject 对象 + * @param callBack 回调 + */ + public getOilPriceOfficialList(paramsObject: object, callBack) { + this.http.get(environment.baseUrl + 'gasOilPriceOfficial/getOilPriceOfficialList?' + this.common.getWhereCondition(paramsObject)).subscribe(data => { + callBack(data); + }); + } + + /** + * 查询油品国标价详情 + * + * @param paramsObject 对象 + * @param callBack 回调 + */ + public getOilPriceOfficialDetail(regionId: number, oilNo: number, callBack) { + this.http.get(environment.baseUrl + 'gasOilPriceOfficial/getOilPriceOfficialDetail?regionId=' + regionId + '&oilNo=' + oilNo).subscribe(data => { + callBack(data); + }); + } + +} diff --git a/src/app/services/oil-price/oil-price-task.service.ts b/src/app/services/oil-price/oil-price-task.service.ts new file mode 100644 index 0000000..b586061 --- /dev/null +++ b/src/app/services/oil-price/oil-price-task.service.ts @@ -0,0 +1,64 @@ +import { Injectable } from '@angular/core'; +import {HttpClient} from '_@angular_common@9.0.7@@angular/common/http'; +import {CommonsService} from '../commons.service'; +import {environment} from '../../../environments/environment'; + +@Injectable({ + providedIn: 'root' +}) +export class OilPriceTaskService { + + constructor( + private http: HttpClient, + private common: CommonsService + ) { } + + + /** + * 批量增加任务 + * + * @param paramsObject 对象 + * @param callBack 回调 + */ + public batchAddTask(paramsObject: object, callBack) { + this.http.post(environment.baseUrl + 'gasOilPriceTask/batchAddTask', paramsObject).subscribe(data => { + callBack(data); + }); + } + + /** + * 删除任务 + * + * @param id 任务id + * @param callBack 回调 + */ + public delTask(id: number, callBack) { + this.http.post(environment.baseUrl + 'gasOilPriceTask/delTask', { taskId: id }).subscribe(data => { + callBack(data); + }); + } + + /** + * 批量增加任务 + * + * @param paramsObject 对象 + * @param callBack 回调 + */ + public getTaskDetail(id: number, callBack) { + this.http.get(environment.baseUrl + 'gasOilPriceTask/getTaskDetail?taskId=' + id).subscribe(data => { + callBack(data); + }); + } + + /** + * 批量增加任务 + * + * @param paramsObject 对象 + * @param callBack 回调 + */ + public getTaskList(param: object, callBack) { + this.http.get(environment.baseUrl + 'gasOilPriceTask/getTaskList?' + this.common.getWhereCondition(param)).subscribe(data => { + callBack(data); + }); + } +} diff --git a/src/app/services/recharge.service.ts b/src/app/services/recharge.service.ts index 756f6ae..4f22dc7 100644 --- a/src/app/services/recharge.service.ts +++ b/src/app/services/recharge.service.ts @@ -1,251 +1,263 @@ -import { Injectable } from '@angular/core'; +import {Injectable} from '@angular/core'; import {HttpClient} from '@angular/common/http'; import {CommonsService} from './commons.service'; import {environment} from '../../environments/environment'; @Injectable({ - providedIn: 'root' + providedIn: 'root' }) export class RechargeService { - constructor( - private http: HttpClient, - private common: CommonsService - ) { - } - - /** - * 查询列表 - * - * @param paramsObject 对象 - * @param callBack 回调 - */ - public getListOutRechargePrice(paramsObject: object, callBack) { - this.http.get(environment.baseUrl + 'outRechargePrice/getListOutRechargePrice?' + this.common.getWhereCondition(paramsObject)).subscribe(data => { - callBack(data); - }); - } - - /** - * @Author Sum1Dream - * @methodName deletePrice - * @Description //上下架 - * @Date 15:03 2021/8/12 - * @Param mod - **/ - public onAndOffShelves(id: number, callBack) { - this.http.get(environment.baseUrl + 'outRechargePrice/onAndOffShelves?id=' + id).subscribe(data => { - callBack(data); - }); - } - - /** - * 新增 - * - * @param params 上传对象 - * @param callBack 回调 - * @return data 返回结果 - */ - public insertPrice(params: object, callBack) { - this.http.post(environment.baseUrl + 'outRechargePrice/insertPrice', params).subscribe(data => { - callBack(data); - }); - } - - /** - * 修改卡券 - * - * @param params 上传对象 - * @param callBack 回调 - * @return data 返回结果 - */ - public updatePrice(params: object, callBack) { - this.http.post(environment.baseUrl + 'outRechargePrice/updatePrice', params).subscribe(data => { - callBack(data); - }); - } - - /** - * 根据id查询详情 - * - * @param id id - * @param callBack 回调 - */ - public findById(id: number, callBack) { - this.http.get(environment.baseUrl + 'outRechargePrice/findById?id=' + id).subscribe(data => { - callBack(data); - }); - } - - /** - * 根据id查询详情 - * - * @param id id - * @param callBack 回调 - */ - public deletePrice(id: number, callBack) { - this.http.get(environment.baseUrl + 'outRechargePrice/deletePrice?id=' + id).subscribe(data => { - callBack(data); - }); - } - - /** - * 查询订单列表 - * - * @param paramsObject 对象 - * @param callBack 回调 - */ - public getOrderList(paramsObject: object, callBack) { - this.http.get(environment.baseUrl + 'outRechargeOrder/getOrderList?' + this.common.getWhereCondition(paramsObject)).subscribe(data => { - callBack(data); - }); - } - - - /** - * 根据id查询详情 - * - * @param id id - * @param callBack 回调 - */ - public getOrderById(id: number, callBack) { - this.http.get(environment.baseUrl + 'outRechargeOrder/getOrderById?orderId=' + id).subscribe(data => { - callBack(data); - }); - } - - /** - * 根据id完成订单 - * - * @param id id - * @param callBack 回调 - */ - public getMobileRechargeByOrderId(id: number, callBack) { - this.http.get(environment.baseUrl + 'outRechargeOrder/getMobileRechargeByOrderId?orderId=' + id).subscribe(data => { - callBack(data); - }); - } - - /** - * 根据id完成退款 - * - * @param id id - * @param callBack 回调 - */ - public orderToRefund(id: number, callBack) { - this.http.get(environment.baseUrl + 'outRechargeOrder/orderToRefund?orderId=' + id).subscribe(data => { - callBack(data); - }); - } - - /** - * @Author Sum1Dream - * @methodName orderToRefundPre - * @Description // 预约订单退款 - * @Date 11:17 上午 2021/11/23 - * @Param [id: number, callBack] - */ - public orderToRefundPre(id: number, callBack) { - this.http.get(environment.baseUrl + 'highOrderPre/orderToRefund?orderId=' + id).subscribe(data => { - callBack(data); - }); - } - - /** - * 申请退款 - * - * @param id id - * @param callBack 回调 - */ - public postRefund(params: object, callBack) { - this.http.post(environment.baseUrl + 'highRefundAudit/insertRefundAudit', params).subscribe(data => { - callBack(data); - }); - } - - /** - * 查询充值订单数量 - * - * @param id id - * @param callBack 回调 - */ - public countOrder(callBack) { - this.http.get(environment.baseUrl + 'outRechargeOrder/countOrder').subscribe(data => { - callBack(data); - }); - } - - /** - * 查询订单列表 - * - * @param paramsObject 对象 - * @param callBack 回调 - */ - public getOrderCountList(paramsObject: object, callBack) { - this.http.get(environment.baseUrl + 'outRechargeOrder/getOrderCountList?' + this.common.getWhereCondition(paramsObject)).subscribe(data => { - callBack(data); - }); - } - - /** - * 到处订单统计 - * - * @param paramsObject 对象 - * @param callBack 回调 - */ - public exportOrderListCount(paramsObject: object, callBack) { - this.http.get(environment.baseUrl + 'outRechargeOrder/exportOrderListCount?' + this.common.getWhereCondition(paramsObject)).subscribe(data => { - callBack(data); - }); - } - - /** - * 到处订单统计 - * - * @param paramsObject 对象 - * @param callBack 回调 - */ - public exportOrderList(paramsObject: object, callBack) { - this.http.get(environment.baseUrl + 'outRechargeOrder/exportOrderList?' + this.common.getWhereCondition(paramsObject)).subscribe(data => { - callBack(data); - }); - } - - /** - * 查询订单列表 - * - * @param paramsObject 对象 - * @param callBack 回调 - */ - public getUserCountList(paramsObject: object, callBack) { - this.http.get(environment.baseUrl + 'outRechargeOrder/getUserCountList?' + this.common.getWhereCondition(paramsObject)).subscribe(data => { - callBack(data); - }); - } - - - /** - * 到处订单统计 - * - * @param paramsObject 对象 - * @param callBack 回调 - */ - public exportUserOrderListCount(paramsObject: object, callBack) { - this.http.get(environment.baseUrl + 'outRechargeOrder/exportUserOrderListCount?' + this.common.getWhereCondition(paramsObject)).subscribe(data => { - callBack(data); - }); - } - - /** - * 获取渠道商获取关联商品 - * - * @param callBack 回调 - */ - public getMemberGoods(callBack) { - this.http.get(environment.baseUrl + 'telApi/getMemberGoods').subscribe(data => { - callBack(data); - }); - } + constructor( + private http: HttpClient, + private common: CommonsService + ) { + } + /** + * 查询列表 + * + * @param paramsObject 对象 + * @param callBack 回调 + */ + public getListOutRechargePrice(paramsObject: object, callBack) { + this.http.get(environment.baseUrl + 'outRechargePrice/getListOutRechargePrice?' + this.common.getWhereCondition(paramsObject)).subscribe(data => { + callBack(data); + }); + } + + /** + * @Author Sum1Dream + * @methodName editPriceStatus + * @Description // 修改价格状态 + * @Date 15:03 2021/8/12 + * @Param mod + **/ + public editPriceStatus(params: object, callBack) { + this.http.post(environment.baseUrl + 'outRechargePrice/editPriceStatus', params).subscribe(data => { + callBack(data); + }); + } + + /** + * 新增 + * + * @param params 上传对象 + * @param callBack 回调 + * @return data 返回结果 + */ + public insertPrice(params: object, callBack) { + this.http.post(environment.baseUrl + 'outRechargePrice/insertPrice', params).subscribe(data => { + callBack(data); + }); + } + + /** + * 修改卡券 + * + * @param params 上传对象 + * @param callBack 回调 + * @return data 返回结果 + */ + public updatePrice(params: object, callBack) { + this.http.post(environment.baseUrl + 'outRechargePrice/updatePrice', params).subscribe(data => { + callBack(data); + }); + } + + /** + * 根据id查询详情 + * + * @param id id + * @param callBack 回调 + */ + public findById(id: number, callBack) { + this.http.get(environment.baseUrl + 'outRechargePrice/findById?id=' + id).subscribe(data => { + callBack(data); + }); + } + + /** + * 根据id查询详情 + * + * @param id id + * @param callBack 回调 + */ + public deletePrice(id: number, callBack) { + this.http.get(environment.baseUrl + 'outRechargePrice/deletePrice?id=' + id).subscribe(data => { + callBack(data); + }); + } + + /** + * 查询订单列表 + * + * @param paramsObject 对象 + * @param callBack 回调 + */ + public getOrderList(paramsObject: object, callBack) { + this.http.get(environment.baseUrl + 'outRechargeOrder/getOrderList?' + this.common.getWhereCondition(paramsObject)).subscribe(data => { + callBack(data); + }); + } + + + /** + * 根据id查询详情 + * + * @param id id + * @param callBack 回调 + */ + public getOrderById(id: number, callBack) { + this.http.get(environment.baseUrl + 'outRechargeOrder/getOrderById?orderId=' + id).subscribe(data => { + callBack(data); + }); + } + + /** + * 根据id完成订单 + * + * @param id id + * @param callBack 回调 + */ + public getMobileRechargeByOrderId(id: number, callBack) { + this.http.get(environment.baseUrl + 'outRechargeOrder/getMobileRechargeByOrderId?orderId=' + id).subscribe(data => { + callBack(data); + }); + } + + /** + * 根据id完成退款 + * + * @param id id + * @param callBack 回调 + */ + public orderToRefund(id: number, callBack) { + this.http.get(environment.baseUrl + 'outRechargeOrder/orderToRefund?orderId=' + id).subscribe(data => { + callBack(data); + }); + } + + /** + * @Author Sum1Dream + * @methodName orderToRefundPre + * @Description // 预约订单退款 + * @Date 11:17 上午 2021/11/23 + * @Param [id: number, callBack] + */ + public orderToRefundPre(id: number, callBack) { + this.http.get(environment.baseUrl + 'highOrderPre/orderToRefund?orderId=' + id).subscribe(data => { + callBack(data); + }); + } + + /** + * 申请退款 + * + * @param id id + * @param callBack 回调 + */ + public postRefund(params: object, callBack) { + this.http.post(environment.baseUrl + 'highRefundAudit/insertRefundAudit', params).subscribe(data => { + callBack(data); + }); + } + + /** + * 查询充值订单数量 + * + * @param id id + * @param callBack 回调 + */ + public countOrder(callBack) { + this.http.get(environment.baseUrl + 'outRechargeOrder/countOrder').subscribe(data => { + callBack(data); + }); + } + + /** + * 查询订单列表 + * + * @param paramsObject 对象 + * @param callBack 回调 + */ + public getOrderCountList(paramsObject: object, callBack) { + this.http.get(environment.baseUrl + 'outRechargeOrder/getOrderCountList?' + this.common.getWhereCondition(paramsObject)).subscribe(data => { + callBack(data); + }); + } + + /** + * 到处订单统计 + * + * @param paramsObject 对象 + * @param callBack 回调 + */ + public exportOrderListCount(paramsObject: object, callBack) { + this.http.get(environment.baseUrl + 'outRechargeOrder/exportOrderListCount?' + this.common.getWhereCondition(paramsObject)).subscribe(data => { + callBack(data); + }); + } + + /** + * 到处订单统计 + * + * @param paramsObject 对象 + * @param callBack 回调 + */ + public exportOrderList(paramsObject: object, callBack) { + this.http.get(environment.baseUrl + 'outRechargeOrder/exportOrderList?' + this.common.getWhereCondition(paramsObject)).subscribe(data => { + callBack(data); + }); + } + + /** + * 查询订单列表 + * + * @param paramsObject 对象 + * @param callBack 回调 + */ + public getUserCountList(paramsObject: object, callBack) { + this.http.get(environment.baseUrl + 'outRechargeOrder/getUserCountList?' + this.common.getWhereCondition(paramsObject)).subscribe(data => { + callBack(data); + }); + } + + + /** + * 到处订单统计 + * + * @param paramsObject 对象 + * @param callBack 回调 + */ + public exportUserOrderListCount(paramsObject: object, callBack) { + this.http.get(environment.baseUrl + 'outRechargeOrder/exportUserOrderListCount?' + this.common.getWhereCondition(paramsObject)).subscribe(data => { + callBack(data); + }); + } + + /** + * 获取渠道商获取关联商品 + * + * @param callBack 回调 + */ + public getMemberGoods(callBack) { + this.http.get(environment.baseUrl + 'telApi/getMemberGoods').subscribe(data => { + callBack(data); + }); + } + + /** + * @Author Sum1Dream + * @methodName orderToRefundPre + * @Description // 预约订单退款 + * @Date 11:17 上午 2021/11/23 + * @Param [id: number, callBack] + */ + public getChildOrder(id: number, callBack) { + this.http.get(environment.baseUrl + 'outRechargeOrder/getChildOrder?orderId=' + id).subscribe(data => { + callBack(data); + }); + } } diff --git a/src/environments/environment.ts b/src/environments/environment.ts index ca22a39..8ebb4f1 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -4,10 +4,10 @@ export const environment = { production: false, -/* baseUrl: 'http://localhost:9302/brest/', // 测试环境服务器地址(请求数据地址) - imageUrl: 'http://localhost:9302/filesystem/',*/ - baseUrl: 'https://hsgcs.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址) - imageUrl: 'https://hsgcs.dctpay.com/filesystem/', + baseUrl: 'http://localhost:9302/brest/', // 测试环境服务器地址(请求数据地址) + imageUrl: 'http://localhost:9302/filesystem/', +/* baseUrl: 'https://hsg.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址) + imageUrl: 'https://hsg.dctpay.com/filesystem/',*/ key: 'https://hsgcs.dctpay.com/phone-recharge-H5/index.html?codeValue=', inviteUrl: 'https://hsgcs.dctpay.com/wx/?action=ic&id=', };