Merge branch 'dev'

pull/1/head
胡锐 3 years ago
commit c1ceb5b159
  1. 1
      src/app/admin/audit/refund-audit/refund-audit.component.ts
  2. 1
      src/app/admin/discount/discount-edit/discount-edit.component.ts
  3. 15
      src/app/admin/gz-sinopec/gz-sinopec-routing.module.ts
  4. 24
      src/app/admin/gz-sinopec/gz-sinopec.module.ts
  5. 92
      src/app/admin/gz-sinopec/offline-assign/offline-assign.component.html
  6. 0
      src/app/admin/gz-sinopec/offline-assign/offline-assign.component.scss
  7. 25
      src/app/admin/gz-sinopec/offline-assign/offline-assign.component.spec.ts
  8. 91
      src/app/admin/gz-sinopec/offline-assign/offline-assign.component.ts
  9. 80
      src/app/admin/gz-sinopec/use-order/use-order.component.html
  10. 0
      src/app/admin/gz-sinopec/use-order/use-order.component.scss
  11. 25
      src/app/admin/gz-sinopec/use-order/use-order.component.spec.ts
  12. 91
      src/app/admin/gz-sinopec/use-order/use-order.component.ts
  13. 4
      src/app/admin/index/index-routing.module.ts
  14. 3
      src/app/admin/index/index.module.ts
  15. 84
      src/app/admin/index/index/index.component.html
  16. 73
      src/app/admin/index/index/index.component.ts
  17. 30
      src/app/admin/index/test/test.component.html
  18. 0
      src/app/admin/index/test/test.component.scss
  19. 71
      src/app/admin/index/test/test.component.ts
  20. 4
      src/app/admin/merchant-store/merchant-store-routing.module.ts
  21. 24
      src/app/admin/merchant-store/merchant-store.module.ts
  22. 1
      src/app/admin/merchant-store/oli-gun/oli-gun.component.html
  23. 0
      src/app/admin/merchant-store/oli-gun/oli-gun.component.scss
  24. 25
      src/app/admin/merchant-store/oli-gun/oli-gun.component.spec.ts
  25. 15
      src/app/admin/merchant-store/oli-gun/oli-gun.component.ts
  26. 149
      src/app/admin/merchant-store/oli/oli.component.html
  27. 0
      src/app/admin/merchant-store/oli/oli.component.scss
  28. 213
      src/app/admin/merchant-store/oli/oli.component.ts
  29. 13
      src/app/admin/merchant-store/store-detail/store-detail.component.html
  30. 65
      src/app/admin/merchant-store/store-detail/store-detail.component.ts
  31. 279
      src/app/admin/merchant-store/store-edit/store-edit.component.html
  32. 33
      src/app/admin/merchant-store/store-edit/store-edit.component.ts
  33. 23
      src/app/admin/merchant-store/store-list/store-list.component.html
  34. 333
      src/app/admin/merchant-store/store-list/store-list.component.ts
  35. 11
      src/app/admin/merchant/merchant-detail/merchant-detail.component.html
  36. 59
      src/app/admin/merchant/merchant-detail/merchant-detail.component.ts
  37. 314
      src/app/admin/navigation/navigation.component.ts
  38. 155
      src/app/admin/order/oil-station-order/oil-station-order.component.html
  39. 0
      src/app/admin/order/oil-station-order/oil-station-order.component.scss
  40. 152
      src/app/admin/order/oil-station-order/oil-station-order.component.ts
  41. 2
      src/app/admin/order/order-routing.module.ts
  42. 3
      src/app/admin/order/order.module.ts
  43. 2
      src/app/admin/tuanyou-agent/order/ty-order-list/ty-order-list.component.html
  44. 103
      src/app/admin/tuanyou-agent/petrol-station-manage/petrol-station-manage.component.html
  45. 281
      src/app/admin/tuanyou-agent/petrol-station-manage/petrol-station-manage.ts
  46. 2
      src/app/app-common.module.ts
  47. 5
      src/app/app-routing.module.ts
  48. 4
      src/app/pipes/recharge-status.pipe.ts
  49. 18
      src/app/pipes/store/oil-type.pipe.ts
  50. 23
      src/app/services/coupon.service.ts
  51. 39
      src/app/services/gas.service.ts
  52. 55
      src/app/services/index.service.ts
  53. 87
      src/app/services/merchant-store.service.ts
  54. 23
      src/app/services/order.service.ts
  55. 27
      src/app/services/ty-agent-price.service.ts
  56. 239
      src/app/services/websocket.service.ts
  57. 8
      src/environments/environment.ts

@ -116,7 +116,6 @@ export class RefundAuditComponent implements OnInit {
if (refundSource === 1) {
this.recharge.getOrderById(id , data => {
if (data['return_code'] === '000000') {
console.log(data);
this.data = data['return_data'];
} else {
this.message.error(data['return_msg']);

@ -33,6 +33,7 @@ export class DiscountEditComponent implements OnInit {
WEB_SERVE_URL = environment.baseUrl;
previewImage: string | undefined = '';
previewVisible = false;
wx: WebSocket;
constructor(
private fb: FormBuilder,

@ -0,0 +1,15 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import {OfflineAssignComponent} from './offline-assign/offline-assign.component';
import {UseOrderComponent} from './use-order/use-order.component';
const routes: Routes = [
{ path: 'offline-assign-list', component: OfflineAssignComponent },
{ path: 'use-order-list', component: UseOrderComponent },
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class GzSinopecRoutingModule { }

@ -0,0 +1,24 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { GzSinopecRoutingModule } from './gz-sinopec-routing.module';
import { OfflineAssignComponent } from './offline-assign/offline-assign.component';
import { UseOrderComponent } from './use-order/use-order.component';
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 {NgZorroAntdModule} from '_ng-zorro-antd@9.3.0@ng-zorro-antd';
@NgModule({
declarations: [OfflineAssignComponent, UseOrderComponent],
imports: [
CommonModule,
GzSinopecRoutingModule,
NgZorroAntdModule,
ReactiveFormsModule,
FormsModule,
BreadcrumbModule,
AppCommonModule,
]
})
export class GzSinopecModule { }

@ -0,0 +1,92 @@
<!-- start 面包屑 -->
<app-breadcrumb></app-breadcrumb>
<!-- end 面包屑 -->
<!--条件搜索-->
<div class="inner-content">
<form nz-form [formGroup]="searchForm" (ngSubmit)="search(searchForm.value)">
<div nz-row>
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="8">卡券名称</nz-form-label>
<nz-form-control [nzSpan]="14">
<input nz-input formControlName="couponName" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="8">使用状态</nz-form-label>
<nz-form-control [nzSpan]="14">
<nz-select nzShowSearch nzAllowClear formControlName="status" >
<nz-option nzLabel="待使用" nzValue="2"></nz-option>
<nz-option nzLabel="已使用" nzValue="3"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="8">分发时间</nz-form-label>
<nz-form-control [nzSpan]="14">
<nz-range-picker
[nzShowTime]="{ nzHideDisabledOptions: true }"
formControlName="assignTimeArray"
nzFormat="yyyy-MM-dd HH:mm:ss"
></nz-range-picker>
</nz-form-control>
</nz-form-item>
</div>
</div>
<div nz-row>
<div nz-col nzSpan="24" class="search-button">
<button nz-button nzType="primary"><i nz-icon nzType="search" nzTheme="outline"></i>搜索</button>
<button nz-button nzType="default" (click)="resetForm()"><i nz-icon nzType="reload" nzTheme="outline"></i>重置</button>
</div>
</div>
</form>
</div>
<div class="inner-content">
<span>共计 {{dataObject.total?dataObject.total:0}} 条数据</span>
<div class="operating-button">
<button nz-button nzType="primary" class="right-btn" (click)="excelData()"><i nz-icon nzType="import" nzTheme="outline"></i>导出数据</button>
</div>
<!--数组表格 -->
<nz-table #basicTable
[nzData]="dataObject.list"
[nzTotal]="dataObject.total"
[nzFrontPagination]="false"
[nzLoading]="tableLoading"
[nzPageIndex]="whereObject.pageNum"
(nzPageIndexChange)="requestData($event)"
[nzScroll]="{ x: '1150px'}">
<thead>
<tr>
<th nzWidth="80px">序号</th>
<th nzWidth="150px">卡卷名称</th>
<th nzWidth="80px">卡券金额</th>
<th nzWidth="100px">分发时间</th>
<th nzWidth="100px">分发手机号</th>
<th nzWidth="100px">状态</th>
<!-- <th nzWidth="100px" nzRight="0px">操作</th>-->
</tr>
</thead>
<tbody>
<tr *ngFor="let data of basicTable.data;let i = index">
<td>{{i + 1}}</td>
<td>{{data.couponName}}</td>
<td>¥{{data.salesPrice}}</td>
<td>{{data.salesTime | date : 'yyyy-MM-dd HH:mm:ss'}}</td>
<td>{{data.convertUserPhone}}</td>
<td>{{data.status == 2?'待使用':'已使用'}}</td>
<!-- <td nzRight="0px" class="table-td-operation">
</td>-->
</tr>
</tbody>
</nz-table>
</div>

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { OfflineAssignComponent } from './offline-assign.component';
describe('OfflineAssignComponent', () => {
let component: OfflineAssignComponent;
let fixture: ComponentFixture<OfflineAssignComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ OfflineAssignComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(OfflineAssignComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

@ -0,0 +1,91 @@
import { Component, OnInit } from '@angular/core';
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 {TyAgentService} from '../../../services/ty-agent.service';
import {CouponService} from "../../../services/coupon.service";
import {environment} from "../../../../environments/environment";
@Component({
selector: 'app-offline-assign',
templateUrl: './offline-assign.component.html',
styleUrls: ['./offline-assign.component.scss']
})
export class OfflineAssignComponent implements OnInit {
FILE_URL = environment.imageUrl;
dataObject: any = {};
tableLoading = true;
searchForm: FormGroup;
pageNum: number;
whereObject: any = {};
constructor(private modal: NzModalService,
private message: NzMessageService,
private couponService: CouponService,
private form: FormBuilder) { }
ngOnInit(): void {
this.searchForm = this.form.group({
couponName: [null],
status: [null],
assignTimeArray: [null],
});
this.requestData(1);
}
/**
*
*/
requestData(pageNum) {
this.tableLoading = true;
this.whereObject['pageNum'] = pageNum;
this.whereObject['pageSize'] = 10;
this.couponService.getGzSinopecAssignList(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) {
if (whereObject['assignTimeArray'] != null && whereObject['assignTimeArray'].length > 0) {
whereObject['assignTimeS'] = new Date(whereObject['assignTimeArray'][0]).getTime();
whereObject['assignTimeE'] = new Date(whereObject['assignTimeArray'][1]).getTime();
} else {
whereObject['assignTimeS'] = null;
whereObject['assignTimeE'] = null;
}
this.whereObject = whereObject;
this.requestData(1);
}
/**
*
*/
resetForm(): void {
this.searchForm.reset();
}
/**
*
*/
excelData() {
this.couponService.importGzSinopecAssign(this.whereObject, data => {
if (data['return_code'] === '000000') {
window.location.href = this.FILE_URL + 'temporary/' + data['return_data'];
} else {
this.modal.error({
nzTitle: '提示',
nzContent: data['return_msg']
});
}
});
}
}

@ -0,0 +1,80 @@
<!-- start 面包屑 -->
<app-breadcrumb></app-breadcrumb>
<!-- end 面包屑 -->
<!--条件搜索-->
<div class="inner-content">
<form nz-form [formGroup]="searchForm" (ngSubmit)="search(searchForm.value)">
<div nz-row>
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="8">卡券名称</nz-form-label>
<nz-form-control [nzSpan]="14">
<input nz-input formControlName="couponName" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="8">分发时间</nz-form-label>
<nz-form-control [nzSpan]="14">
<nz-range-picker
[nzShowTime]="{ nzHideDisabledOptions: true }"
formControlName="assignTimeArray"
nzFormat="yyyy-MM-dd HH:mm:ss"
></nz-range-picker>
</nz-form-control>
</nz-form-item>
</div>
</div>
<div nz-row>
<div nz-col nzSpan="24" class="search-button">
<button nz-button nzType="primary"><i nz-icon nzType="search" nzTheme="outline"></i>搜索</button>
<button nz-button nzType="default" (click)="resetForm()"><i nz-icon nzType="reload" nzTheme="outline"></i>重置</button>
</div>
</div>
</form>
</div>
<div class="inner-content">
<span>共计 {{dataObject.total?dataObject.total:0}} 条数据</span>
<div class="operating-button">
<button nz-button nzType="primary" class="right-btn" (click)="excelData()"><i nz-icon nzType="import" nzTheme="outline"></i>导出数据</button>
</div>
<!--数组表格 -->
<nz-table #basicTable
[nzData]="dataObject.list"
[nzTotal]="dataObject.total"
[nzFrontPagination]="false"
[nzLoading]="tableLoading"
[nzPageIndex]="whereObject.pageNum"
(nzPageIndexChange)="requestData($event)"
[nzScroll]="{ x: '1150px'}">
<thead>
<tr>
<th nzWidth="80px">序号</th>
<th nzWidth="150px">卡卷名称</th>
<th nzWidth="80px">卡券金额</th>
<th nzWidth="100px">分发时间</th>
<th nzWidth="100px">分发手机号</th>
<th nzWidth="100px">状态</th>
<!-- <th nzWidth="100px" nzRight="0px">操作</th>-->
</tr>
</thead>
<tbody>
<tr *ngFor="let data of basicTable.data;let i = index">
<td>{{i + 1}}</td>
<td>{{data.couponName}}</td>
<td>¥{{data.salesPrice}}</td>
<td>{{data.salesTime | date : 'yyyy-MM-dd HH:mm:ss'}}</td>
<td>{{data.convertUserPhone}}</td>
<td>{{data.status == 2?'待使用':'已使用'}}</td>
<!-- <td nzRight="0px" class="table-td-operation">
</td>-->
</tr>
</tbody>
</nz-table>
</div>

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { UseOrderComponent } from './use-order.component';
describe('UseOrderComponent', () => {
let component: UseOrderComponent;
let fixture: ComponentFixture<UseOrderComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ UseOrderComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(UseOrderComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

@ -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 {CouponService} from '../../../services/coupon.service';
@Component({
selector: 'app-use-order',
templateUrl: './use-order.component.html',
styleUrls: ['./use-order.component.scss']
})
export class UseOrderComponent implements OnInit {
FILE_URL = environment.imageUrl;
dataObject: any = {};
tableLoading = true;
searchForm: FormGroup;
pageNum: number;
whereObject: any = {};
constructor(private modal: NzModalService,
private message: NzMessageService,
private couponService: CouponService,
private form: FormBuilder) { }
ngOnInit(): void {
this.searchForm = this.form.group({
couponName: [null],
status: [null],
assignTimeArray: [null],
});
this.requestData(1);
}
/**
*
*/
requestData(pageNum) {
this.tableLoading = true;
this.whereObject['status'] = 2;
this.whereObject['pageNum'] = pageNum;
this.whereObject['pageSize'] = 10;
this.couponService.getGzSinopecAssignList(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) {
if (whereObject['assignTimeArray'] != null && whereObject['assignTimeArray'].length > 0) {
whereObject['assignTimeS'] = new Date(whereObject['assignTimeArray'][0]).getTime();
whereObject['assignTimeE'] = new Date(whereObject['assignTimeArray'][1]).getTime();
} else {
whereObject['assignTimeS'] = null;
whereObject['assignTimeE'] = null;
}
this.whereObject = whereObject;
this.requestData(1);
}
/**
*
*/
resetForm(): void {
this.searchForm.reset();
}
/**
*
*/
excelData() {
this.couponService.importGzSinopecAssign(this.whereObject, data => {
if (data['return_code'] === '000000') {
window.location.href = this.FILE_URL + 'temporary/' + data['return_data'];
} else {
this.modal.error({
nzTitle: '提示',
nzContent: data['return_msg']
});
}
});
}
}

@ -1,10 +1,12 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import {IndexComponent} from './index/index.component';
import {TestComponent} from './test/test.component';
const routes: Routes = [
{ path: '', component: IndexComponent }
{ path: '', component: IndexComponent },
{ path: 'test', component: TestComponent }
];
@NgModule({

@ -12,10 +12,11 @@ import {RichtextModule} from '../../common/richtext/richtext.module';
import {BreadcrumbModule} from '../../common/breadcrumb/breadcrumb.module';
import {RegionSelectorModule} from '../../common/region-selector/region-selector.module';
import {AppCommonModule} from '../../app-common.module';
import { TestComponent } from './test/test.component';
@NgModule({
declarations: [IndexComponent],
declarations: [IndexComponent, TestComponent],
imports: [
CommonModule,
SystemRoutingModule,

@ -7,9 +7,65 @@
<!-- end 面包屑 -->
<!--条件搜索-->
<div class="inner-content" *ngIf="adminInfoObject['merchantStore'] != null && adminInfoObject['merchantStore']['type'] == 1">
<div *ngIf="adminInfoObject['merchantStore']['prestoreType'] == 1" style="width: 100%;text-align: center;">
<nz-row [nzGutter]="16">
<nz-col [nzSpan]="24">
<nz-statistic [nzValue]="'' + balanceData['amounts']" [nzTitle]="'预存账户余额'" [nzSuffix]="suffixTpl"></nz-statistic>
<ng-template #suffixTpl><a (click)="isVisibleOil = true" style="font-size: 13px;">记录</a></ng-template>
</nz-col>
</nz-row>
</div>
<br/><br/><br/>
<nz-card nzTitle="历史加油订单">
<nz-row [nzGutter]="16">
<nz-col [nzSpan]="4">
<nz-statistic [nzValue]="gasCountData.history.totalPrice ? gasCountData.history.totalPrice : 0" [nzTitle]="'加油总金额'"></nz-statistic>
</nz-col>
<nz-col [nzSpan]="4">
<nz-statistic [nzValue]="gasCountData.history.totalCount ? gasCountData.history.totalCount : 0" [nzTitle]="'加油总数量'"></nz-statistic>
</nz-col>
<nz-col [nzSpan]="4">
<nz-statistic [nzValue]="gasCountData.history.incomePrice ? gasCountData.history.incomePrice : 0" [nzTitle]="'加油金额'"></nz-statistic>
</nz-col>
<nz-col [nzSpan]="4">
<nz-statistic [nzValue]="gasCountData.history.incomeCount ? gasCountData.history.incomeCount : 0" [nzTitle]="'加油数量'"></nz-statistic>
</nz-col>
<nz-col [nzSpan]="4">
<nz-statistic [nzValue]="gasCountData.history.refundPrice ? gasCountData.history.refundPrice : 0" [nzTitle]="'退款金额'"></nz-statistic>
</nz-col>
<nz-col [nzSpan]="4">
<nz-statistic [nzValue]="gasCountData.history.refundCount ? gasCountData.history.refundCount : 0" [nzTitle]="'退款数量'"></nz-statistic>
</nz-col>
</nz-row>
</nz-card>
<br/><br/><br/>
<nz-card nzTitle="今日加油订单">
<nz-row [nzGutter]="16">
<nz-col [nzSpan]="4">
<nz-statistic [nzValue]="gasCountData.today.totalPrice ? gasCountData.today.totalPrice : 0" [nzTitle]="'加油总金额'"></nz-statistic>
</nz-col>
<nz-col [nzSpan]="4">
<nz-statistic [nzValue]="gasCountData.today.totalCount ? gasCountData.today.totalCount : 0" [nzTitle]="'加油总数量'"></nz-statistic>
</nz-col>
<nz-col [nzSpan]="4">
<nz-statistic [nzValue]="gasCountData.today.incomePrice ? gasCountData.today.incomePrice : 0" [nzTitle]="'加油金额'"></nz-statistic>
</nz-col>
<nz-col [nzSpan]="4">
<nz-statistic [nzValue]="gasCountData.today.incomeCount ? gasCountData.today.incomeCount : 0" [nzTitle]="'加油数量'"></nz-statistic>
</nz-col>
<nz-col [nzSpan]="4">
<nz-statistic [nzValue]="gasCountData.today.refundPrice ? gasCountData.today.refundPrice : 0" [nzTitle]="'退款金额'"></nz-statistic>
</nz-col>
<nz-col [nzSpan]="4">
<nz-statistic [nzValue]="gasCountData.today.refundCount ? gasCountData.today.refundCount : 0" [nzTitle]="'退款数量'"></nz-statistic>
</nz-col>
</nz-row>
</nz-card>
</div>
<!--渠道公司-->
<div class="inner-content" *ngIf="roleType == 7">
<div nz-row >
<button nz-button nzType="primary" (click)="isVisibleAdd = true">新增预充值余额</button>
</div>
@ -126,7 +182,6 @@
</nz-table>
</nz-modal>
<nz-modal [(nzVisible)]="isVisibleAdd" nzTitle="新增预充值余额" (nzOnCancel)="isVisibleAdd = false" (nzOnOk)="handleOk()">
<div nz-row>
<div nz-col nzSpan="18">
@ -139,3 +194,28 @@
</div>
</div>
</nz-modal>
<nz-modal [(nzVisible)]="isVisibleOil" nzWidth="900" nzTitle="预充值账户记录" [nzBodyStyle]="{ padding: '15px', height: '600px'}" (nzOnCancel)="isVisibleOil = false" [nzFooter]="null">
<nz-table #RecordList [nzData]="recordList" [nzScroll]="{ y: '470px', x : '900px' }">
<thead>
<tr>
<th nzWidth="50px">编号</th>
<th nzWidth="50px">类型</th>
<th nzWidth="80px">交易金额</th>
<th nzWidth="80px">变更前金额</th>
<th nzWidth="80px">变更后金额</th>
<th nzWidth="300px">内容</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of RecordList.data; let i = index">
<td>{{i+1}}</td>
<td>{{data.type == 1 ? '进账': '出账'}}</td>
<td>{{'¥' + data.amount}}</td>
<td>{{'¥' + data.beforeAmount}}</td>
<td>{{'¥' + data.afterAmount}}</td>
<td>{{data.sourceContent}}</td>
</tr>
</tbody>
</nz-table>
</nz-modal>

@ -4,6 +4,7 @@ import {LocalStorageService} from '../../../services/local-storage.service';
import {IndexService} from '../../../services/index.service';
import {NzMessageService} from '_ng-zorro-antd@9.3.0@ng-zorro-antd';
import {environment} from '../../../../environments/environment';
import {Router} from '_@angular_router@9.0.7@@angular/router';
@Component({
@ -17,6 +18,7 @@ export class IndexComponent implements OnInit {
loading = true;
isVisible = false;
isVisibleAdd = false;
isVisibleOil = false;
balance: number;
price: number;
code = 60;
@ -24,29 +26,38 @@ export class IndexComponent implements OnInit {
countData: any = {};
data: any = {};
orderData = {};
balanceData = {};
balanceData = {
amounts: 0
};
rechargeData = {};
gasCountData: any = {
history: {},
today: {},
};
recordList = [];
tyBalance;
webSocket: WebSocket;
adminInfoObject: {};
constructor(
private store: LocalStorageService, // 数据缓存
private message: NzMessageService, // 信息提示
private router: Router,
private index: IndexService
) {
}
ngOnInit(): void {
this.adminInfoObject = this.store.get(ADMIN_INFO_OBJECT);
this.roleType = this.store.get(ADMIN_INFO_OBJECT)['secRole'].roleType;
if (this.roleType === 1) {
this.getIndexCount();
this.getLineCount();
this.queryCompanyAccountInfo2JD();
}
if (this.store.get(ADMIN_INFO_OBJECT)['highAgent'] != null) {
this.code = this.store.get(ADMIN_INFO_OBJECT)['highAgent'].id;
}
if (this.store.get(ADMIN_INFO_OBJECT)['bsCompany'].id === 3) {
if (this.store.get(ADMIN_INFO_OBJECT)['bsCompany'] != null && this.store.get(ADMIN_INFO_OBJECT)['bsCompany'].id === 3) {
this.code = 60;
this.getHLTBalance();
this.orderByIndex();
@ -55,6 +66,12 @@ export class IndexComponent implements OnInit {
this.HLTOrderByList();
}
if (this.store.get(ADMIN_INFO_OBJECT)['merchantStore'] != null) {
if (this.store.get(ADMIN_INFO_OBJECT)['merchantStore'].type === 1) {
this.getGasStatistical();
this.getGasAccount();
}
}
}
// 查询余额
@ -230,4 +247,52 @@ export class IndexComponent implements OnInit {
});
}
// 查询油站预存余额
public getGasAccount(): void {
this.index.getAccount(data => {
if (data['return_code'] === '000000') {
this.balanceData = data['return_data'];
this.loading = false;
} else {
this.message.error(data['return_msg']);
}
});
}
// 查询加油站统计
public getGasStatistical(): void {
this.index.getGasStatistical(data => {
if (data['return_code'] === '000000') {
this.gasCountData = data['return_data'];
this.getGasAccountRecord();
this.loading = false;
} else {
this.message.error(data['return_msg']);
}
});
}
// 查询预存账户油站记录
public getGasAccountRecord(): void {
const paramsObject = {
pageNum: 1,
pageSize: 10000
};
this.index.getAccountRecordList(paramsObject, data => {
if (data['return_code'] === '000000') {
this.recordList = data['return_data'].list;
} else {
this.message.error(data['return_msg']);
}
});
}
public edit(ids) {
this.router.navigate(['/admin/index/test'], {
queryParams: {
id: ids
}
}).then(r => console.log(r));
}
}

@ -0,0 +1,30 @@
<!--<section>-->
<!-- 大家好!我是:{{currentUser}}-->
<!--</section>-->
<!--<section *ngFor="let msg of messages">-->
<!-- <section>{{msg}}</section>-->
<!--</section>-->
<!--<section>-->
<!-- 当前登录用户:{{users}}-->
<!--</section>-->
<!--<section>-->
<!-- <label>-->
<!-- <select name="type" [(ngModel)]="type">-->
<!-- <option value="all">发送给所有人</option>-->
<!-- <option value="single">发送给个人</option>-->
<!-- </select>-->
<!-- </label>-->
<!--</section>-->
<!--<section>-->
<!-- <label *ngIf="type === 'single'">-->
<!-- <select name="user" [(ngModel)]="sendToUser">-->
<!-- <option *ngFor="let person of users" [value]="person">{{person}}</option>-->
<!-- </select>-->
<!-- </label>-->
<!--</section>-->
<!--<p *ngIf="error">{{error | json}}</p>-->
<!--<p *ngIf="completed">completed!</p>-->
<!--<label>-->
<!-- <input type="text" [(ngModel)]="message">-->
<!--</label>-->
<!--<button (click)="send()">发送</button>-->

@ -0,0 +1,71 @@
import { Component, OnInit } from '@angular/core';
import {ActivatedRoute} from '_@angular_router@9.0.7@@angular/router';
import {Params} from '@angular/router';
import {WebsocketService} from '../../../services/websocket.service';
export enum SEND_TYPE {
ALL = 'all',
SINGLE = 'single'
}
@Component({
selector: 'app-test',
templateUrl: './test.component.html',
styleUrls: ['./test.component.scss']
})
export class TestComponent implements OnInit {
messages = []; // 消息列表
message; // 发送的消息内容
error: any; // 异常信息
completed = false; // 发送完成
type = SEND_TYPE.ALL; // 默认类型发送给所有人
users = []; // 登陆的用户
sendToUser; // 需要发送消息的用户
currentUser; // 当前用户
constructor(
private webSocketService: WebsocketService,
private activatedRoute: ActivatedRoute
) {
this.activatedRoute.queryParams.subscribe(queryParams => {
console.log(queryParams.id);
this.currentUser = queryParams.id;
});
}
ngOnInit(): void {
console.log(this.currentUser);
// 连接websocket
// this.webSocketService.connect(`ws://139.159.177.244:9302/brest/WebSocket/` + this.currentUser);
// 接收消息
this.webSocketService.messageSubject.subscribe(
data => {
// 如果是用户登陆,则添加到登陆列表中
if (data.users) {
this.users = data.users;
} else {
// 否则添加到消息列表
this.messages.push(data.msg);
}
},
err => this.error = err,
() => this.completed = true
);
}
// send() {
// // 创建消息对象
// const msg = {
// msg: this.message, // 消息内容
// type: this.type === SEND_TYPE.ALL ? SEND_TYPE.ALL : SEND_TYPE.SINGLE, // 类型
// to: this.type === SEND_TYPE.SINGLE ? this.sendToUser : undefined // 要发送的对象
// };
// // 发送
// this.webSocketService.sendMessage(JSON.stringify(msg));
// // 发送完成,情况message内容
// this.message = '';
// }
}

@ -3,12 +3,16 @@ import { Routes, RouterModule } from '@angular/router';
import {StoreListComponent} from './store-list/store-list.component';
import {StoreEditComponent} from './store-edit/store-edit.component';
import {StoreDetailComponent} from './store-detail/store-detail.component';
import {OliComponent} from './oli/oli.component';
import {OliGunComponent} from './oli-gun/oli-gun.component';
const routes: Routes = [
{ path: 'store-list', component: StoreListComponent },
{ path: 'store-edit', component: StoreEditComponent },
{ path: 'store-detail', component: StoreDetailComponent },
{ path: 'oil', component: OliComponent },
{ path: 'oil_gun', component: OliGunComponent },
];
@NgModule({

@ -9,18 +9,22 @@ import {NgZorroAntdModule} from 'ng-zorro-antd';
import {SeparateModule} from '../../common/separate/separate.module';
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
import {BreadcrumbModule} from '../../common/breadcrumb/breadcrumb.module';
import { OliComponent } from './oli/oli.component';
import { OliGunComponent } from './oli-gun/oli-gun.component';
import {AppCommonModule} from "../../app-common.module";
@NgModule({
declarations: [StoreListComponent, StoreEditComponent, StoreDetailComponent],
imports: [
CommonModule,
MerchantStoreRoutingModule,
NgZorroAntdModule,
SeparateModule,
ReactiveFormsModule,
FormsModule,
BreadcrumbModule
]
declarations: [StoreListComponent, StoreEditComponent, StoreDetailComponent, OliComponent, OliGunComponent],
imports: [
CommonModule,
MerchantStoreRoutingModule,
NgZorroAntdModule,
SeparateModule,
ReactiveFormsModule,
FormsModule,
BreadcrumbModule,
AppCommonModule
]
})
export class MerchantStoreModule { }

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { OliGunComponent } from './oli-gun.component';
describe('OliGunComponent', () => {
let component: OliGunComponent;
let fixture: ComponentFixture<OliGunComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ OliGunComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(OliGunComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-oli-gun',
templateUrl: './oli-gun.component.html',
styleUrls: ['./oli-gun.component.scss']
})
export class OliGunComponent implements OnInit {
constructor() { }
ngOnInit(): void {
}
}

@ -0,0 +1,149 @@
<!-- start 面包屑 -->
<app-breadcrumb></app-breadcrumb>
<!-- end 面包屑 -->
<!--条件搜索-->
<div class="inner-content">
<span>共计 {{total}} 条数据</span>
<div class="operating-button">
<button nz-button nzType="primary" class="right-btn" (click)="isVisible = true">编辑</button>
</div>
<nz-table
class="table"
#ajaxTable
nzShowSizeChanger
[nzFrontPagination]="false"
[nzData]="requestData"
[nzLoading]="loading"
[nzTotal]="total"
[(nzPageIndex)]="pageNum"
[(nzPageSize)]="pageSize"
[nzScroll]="{ x: '1200px' }"
(nzPageIndexChange)="getRequest(false , {})"
(nzPageSizeChange)="getRequest(false , {})">
<thead nzSingleSort>
<tr>
<th nzWidth="50px">编号</th>
<th nzWidth="80px">油品类型</th>
<th nzWidth="80px">油品</th>
<th nzWidth="80px">国标价</th>
<th nzWidth="100px">油站价</th>
<th nzWidth="100px">优惠价</th>
<th nzWidth="100px">优惠幅度</th>
<th nzWidth="160px" nzRight="0px">操作</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of ajaxTable.data; let i = index">
<td>{{i + 1}}</td>
<td>{{data.oilTypeName}}</td>
<td>{{data.oilNoName}}</td>
<td>{{data.priceOfficial == null ? '暂无' : '¥' + data.priceOfficial}}</td>
<td>{{data.priceGun == null ? '暂无' : '¥' + data.priceGun}}</td>
<td>{{data.priceVip == null ? '暂无' : '¥' + data.priceVip}}</td>
<td>{{data.preferentialMargin == null ? '暂无' : '¥' + data.preferentialMargin}}</td>
<td nzRight="0px" class="table-td-operation">
<a (click)="getGunNoListByOilPrice(data.id)">查看油枪</a>
<nz-divider nzType="vertical"></nz-divider>
<a (click)="getGasOilPrice(data.id)">配置油枪</a>
<nz-divider nzType="vertical"></nz-divider>
<a (click)="getDelete(data.oilNo)">删除</a>
</td>
</tbody>
</nz-table>
</div>
<nz-modal [(nzVisible)]="isVisible" nzTitle="编辑油品" (nzOnCancel)="isVisible = false" (nzOnOk)="editGasOilPrice()"
nzWidth="700px">
<div nz-row>
<div nz-col nzSpan="18">
<nz-form-item>
<nz-form-label [nzSpan]="6">油品</nz-form-label>
<nz-form-control [nzSpan]="16">
<nz-select [(ngModel)]="oilNo" nzAllowClear (ngModelChange)="getOilPriceDetail($event)"
nzPlaceHolder="请选择油品">
<nz-option *ngFor="let item of gasOilType" [nzValue]="item.codeValue"
nzLabel="{{item.codeName}}"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
</div>
<form nz-form [formGroup]="validateForm" class="login-form">
<div nz-row>
<div nz-col nzSpan="18">
<nz-form-item>
<nz-form-label [nzSpan]="6">油枪价</nz-form-label>
<nz-form-control [nzSpan]="16">
<input nz-input formControlName="priceGun" placeholder="请输入油枪价..."/>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="18">
<nz-form-item>
<nz-form-label [nzSpan]="6">优惠幅度</nz-form-label>
<nz-form-control [nzSpan]="16">
<nz-input-number
style="width: 300px"
formControlName="preferentialMargin"
[nzMin]="0"
[nzMax]="100"
[nzPrecision]="2"
nzPrecisionMode="cut"
nzPlaceHolder="请输入优惠幅度!"
[nzFormatter]="formatterPercent"
[nzParser]="parserPercent"
></nz-input-number>
</nz-form-control>
</nz-form-item>
</div>
</div>
</form>
</nz-modal>
<nz-modal [(nzVisible)]="oilGunVisible" nzTitle="油枪列表" (nzOnCancel)="oilGunVisible = false" nzWidth="900px" (nzOnOk)="oilGunVisible= false">
<nz-table #errorStudentTable [nzData]="oilGunList">
<thead>
<tr>
<th nzWidth="80px">序号</th>
<th nzWidth="150px">油枪号</th>
<th nzWidth="150px">油号类型</th>
<th nzWidth="150px">油号</th>
<th nzWidth="80px">操作</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of errorStudentTable.data;let i = index">
<td>{{ i + 1}}</td>
<td>{{data.gunNo}}</td>
<td>{{data.oilTypeName}}</td>
<td>{{data.oilNo}}</td>
<td>
<a (click)="delGunNo(data.id)">删除</a>
</td>
</tr>
</tbody>
</nz-table>
</nz-modal>
<nz-modal [(nzVisible)]="oilVisible" nzTitle="配置油枪" (nzOnCancel)="oilVisible = false" (nzOnOk)="addGasOilPrice()">
<div nz-row>
<div nz-col nzSpan="18">
<nz-form-item>
<nz-form-label [nzSpan]="6">油枪号</nz-form-label>
<nz-form-control [nzSpan]="16">
<nz-input-number
style="width: 300px"
[(ngModel)]="gunNo"
[nzMin]="1"
[nzMax]="10000"
nzPlaceHolder="请输入油枪号!"
></nz-input-number>
</nz-form-control>
</nz-form-item>
</div>
</div>
</nz-modal>

@ -0,0 +1,213 @@
import {Component, OnInit} from '@angular/core';
import {FormBuilder, FormGroup, Validators} from '_@angular_forms@9.0.7@@angular/forms';
import {environment} from '../../../../environments/environment';
import {MerchantStoreService} from '../../../services/merchant-store.service';
import {IconService} from '../../../services/icon.service';
import {NzMessageService, 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 {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace';
import {LocalStorageService} from '../../../services/local-storage.service';
@Component({
selector: 'app-oli',
templateUrl: './oli.component.html',
styleUrls: ['./oli.component.scss']
})
export class OliComponent implements OnInit {
validateForm!: FormGroup;
requestData = []; // 列表数据
total: number; // 页码
pageNum = 1; // 页码
pageSize = 10; // 条码
loading = true;
id = null;
name: string;
WEB_SERVE_URL = environment.baseUrl;
isVisible = false;
oilGunVisible = false;
oilVisible = false;
gasOilType = [];
oilGunList = [];
oilNo;
gunNo;
formatterPercent = (value: number) => `¥ ${value == null ? 0 : value}`;
parserPercent = (value: string) => value.replace('¥ ', '');
constructor(
private form: FormBuilder,
private merchantStore: MerchantStoreService,
private iconService: IconService,
private message: NzMessageService,
private store: LocalStorageService, // 数据请求
private router: Router,
private fb: FormBuilder,
private commonsService: CommonsService,
private modal: NzModalService,
private activatedRoute: ActivatedRoute,
private common: CommonsService
) {
}
ngOnInit(): void {
this.init();
this.validateForm = this.fb.group({
storeId: [this.store.get(ADMIN_INFO_OBJECT)['merchantStore'].id, [Validators.required]],
priceGun: [null, [Validators.required]],
preferentialMargin: [0],
});
}
public init(): void {
this.commonsService.getDictionary('GAS_OIL_TYPE', data => {
this.gasOilType = data['return_data'];
});
this.getRequest(true, {});
}
// 查询列表
public getRequest(reset: boolean = false, whereObject: object) {
this.loading = false;
if (reset) {
this.pageNum = 1;
}
whereObject['storeId'] = this.store.get(ADMIN_INFO_OBJECT)['merchantStore'].id;
this.merchantStore.getOilPriceListByStore(whereObject, data => {
if (data['return_code'] === '000000') {
this.requestData = data['return_data'];
this.total = data['return_data'].length;
} else {
this.message.error(data['return_msg']);
}
});
}
// 是否删除油品
public getDelete(oilNo): void {
const message = '是否删除油品';
this.common.showConfirm(message, data => {
if (data) {
this.merchantStore.delOilPrice({
storeId: this.store.get(ADMIN_INFO_OBJECT)['merchantStore'].id,
oilNo: oilNo
}, dataReturn => {
if (dataReturn['return_code'] === '000000') {
this.message.success('操作成功');
this.getRequest(false, {});
} else {
this.message.warning(dataReturn['return_msg']);
}
});
}
});
}
// 编辑油品
public editGasOilPrice(): void {
if (this.oilNo == null) {
this.message.error('请选择油品!');
return;
}
// tslint:disable-next-line:forin
for (const i in this.validateForm.controls) {
this.validateForm.controls[i].markAsDirty();
this.validateForm.controls[i].updateValueAndValidity();
if (this.validateForm.controls[i].errors != null) {
this.message.error('必填项不能为空');
return;
}
}
if (this.validateForm.value.preferentialMargin == null) {
this.validateForm.value.preferentialMargin = 0;
}
this.validateForm.value.oilNo = this.oilNo;
this.merchantStore.editGasOilPrice(this.validateForm.value, data => {
if (data['return_code'] === '000000') {
this.isVisible = false;
this.getRequest(true, {});
this.message.success('编辑成功');
} else {
this.message.warning(data['return_msg']);
}
});
}
// 获取油站油品价格
public getOilPriceDetail(e): void {
const whereObject = {
storeId: this.store.get(ADMIN_INFO_OBJECT)['merchantStore'].id,
oilNo: e
};
this.merchantStore.getOilPriceDetail(whereObject, data => {
if (data['return_code'] === '000000') {
this.validateForm.patchValue(data['return_data']);
} else {
this.message.warning(data['return_msg']);
}
});
}
// 配置油品油枪
public getGunNoListByOilPrice(id): void {
this.id = id;
this.merchantStore.getGunNoListByOilPrice(id , data => {
if (data['return_code'] === '000000') {
this.oilGunList = data['return_data'];
this.oilGunVisible = true;
} else {
this.message.warning(data['return_msg']);
}
});
}
// 是否删除油枪列表
public delGunNo(id): void {
const message = '是否删除油枪';
this.common.showConfirm(message, data => {
if (data) {
this.merchantStore.delGunNo({
gunNoId: id
}, dataReturn => {
if (dataReturn['return_code'] === '000000') {
this.message.success('操作成功');
this.getGunNoListByOilPrice(this.id);
} else {
this.message.warning(dataReturn['return_msg']);
}
});
}
});
}
// 配置油枪号
public addGasOilPrice(): void {
if (this.gunNo == null) {
this.message.error('请输入油枪号');
return;
}
this.merchantStore.addGasOilPrice({
oilPriceId: this.id,
gunNo: this.gunNo
} , data => {
if (data['return_code'] === '000000') {
this.message.success('操作成功');
this.oilVisible = false;
} else {
this.message.warning(data['return_msg']);
}
});
}
public getGasOilPrice(id): void {
this.id = id;
this.oilVisible = true;
}
}

@ -1,6 +1,17 @@
<!-- start 面包屑 -->
<nz-breadcrumb>
<nz-breadcrumb-item>
<a (click)="getBack()">门店管理</a>
</nz-breadcrumb-item>
<nz-breadcrumb-item>
门店详情
</nz-breadcrumb-item>
</nz-breadcrumb>
<!-- end 面包屑 -->
<div class="inner-content">
<nz-descriptions nzBordered>
<nz-descriptions-item nzTitle="登录账户">{{data.telephone}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="登录账户">{{data['secUser'].loginName}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="门店编号">{{data['storeKey']}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="门店名称">{{data.storeName}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="门店地址">{{data.address}}</nz-descriptions-item>

@ -1,40 +1,47 @@
import { Component, OnInit } from '@angular/core';
import {Component, OnInit} from '@angular/core';
import {NzMessageService} from 'ng-zorro-antd';
import {ActivatedRoute} from '@angular/router';
import {MerchantStoreService} from '../../../services/merchant-store.service';
@Component({
selector: 'app-store-detail',
templateUrl: './store-detail.component.html',
styleUrls: ['./store-detail.component.scss']
selector: 'app-store-detail',
templateUrl: './store-detail.component.html',
styleUrls: ['./store-detail.component.scss']
})
export class StoreDetailComponent implements OnInit {
data: any = {};
id: number;
constructor(
private merchantStore: MerchantStoreService,
private message: NzMessageService, // 信息提示
private activatedRoute: ActivatedRoute,
) { }
ngOnInit(): void {
this.activatedRoute.queryParams.subscribe(queryParams => {
if (queryParams.storeId != null) {
this.id = queryParams.storeId;
this.getDetails(queryParams.storeId);
}
});
}
// 查询详情
public getDetails(id: number) {
this.merchantStore.getMerchantStoreById(id , data => {
this.data = data['return_data'];
});
}
data: any = {};
id: number;
constructor(
private merchantStore: MerchantStoreService,
private message: NzMessageService, // 信息提示
private activatedRoute: ActivatedRoute,
) {
}
ngOnInit(): void {
this.activatedRoute.queryParams.subscribe(queryParams => {
if (queryParams.storeId != null) {
this.id = queryParams.storeId;
this.getDetails(queryParams.storeId);
}
});
}
// 查询详情
public getDetails(id: number) {
this.merchantStore.getMerchantStoreById(id, data => {
console.log(data);
this.data = data['return_data'];
});
}
// 返回
getBack() {
history.back();
}
}

@ -10,120 +10,173 @@
<!-- end 面包屑 -->
<nz-content class="inner-content">
<form nz-form [formGroup]="validateForm" class="ant-advanced-search-form">
<div nz-row [nzGutter]="24">
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label [nzFor]="'telephone'" nzRequired>登录手机号</nz-form-label>
<nz-form-control nzErrorTip="请输入登录手机号!">
<input nz-input placeholder="请输入登录手机号..." [formControlName]="'telephone'" id="'telephone'" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label [nzFor]="'password'" nzRequired>登录密码</nz-form-label>
<nz-form-control nzErrorTip="请输入登录密码!">
<nz-input-group [nzSuffix]="suffixTemplate">
<input [type]="passwordVisible ? 'text' : 'password'" nz-input placeholder="请输入登录密码..." [formControlName]="'password'" id="'password'" />
</nz-input-group>
<ng-template #suffixTemplate>
<i nz-icon [nzType]="passwordVisible ? 'eye-invisible' : 'eye'" (click)="passwordVisible = !passwordVisible"></i>
</ng-template>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label [nzFor]="'storeKey'" nzRequired>门店编号</nz-form-label>
<nz-form-control nzErrorTip="请输入门店编号!">
<input nz-input placeholder="请输入门店编号..." [formControlName]="'storeKey'" id="'storeKey'" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label>门店LOGO</nz-form-label>
<nz-form-control>
<nz-upload
nzAction="{{WEB_SERVE_URL}}/fileUpload/uploadfile"
nzListType="picture-card"
[(nzFileList)]="logoFile"
[nzShowButton]="logoFile.length < 1"
[nzPreview]="handlePreview"
>
<i nz-icon nzType="plus"></i>
<div class="ant-upload-text">上传LOGO</div>
</nz-upload>
<nz-modal [nzVisible]="previewVisible" [nzContent]="modalContent" [nzFooter]="null" (nzOnCancel)="previewVisible = false">
<ng-template #modalContent>
<img [src]="previewImage" [ngStyle]="{ width: '100%' }" />
</ng-template>
</nz-modal>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label [nzFor]="'storeName'" nzRequired>门店名称</nz-form-label>
<nz-form-control nzErrorTip="请输入门店名称!">
<input nz-input placeholder="请输入门店名称..." [formControlName]="'storeName'" id="'storeName'" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label [nzFor]="'latitude'" nzRequired>地址维度</nz-form-label>
<nz-form-control nzErrorTip="请输入门店地址维度!">
<input nz-input placeholder="请输入门店地址维度..." readonly [formControlName]="'latitude'" id="'latitude'" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label [nzFor]="'longitude'" nzRequired>地址经度</nz-form-label>
<nz-form-control nzErrorTip="请输入门店地址维度!">
<input nz-input placeholder="请输入门店地址维度..." readonly [formControlName]="'longitude'" id="'longitude'" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="14">
<nz-form-item>
<nz-form-label [nzFor]="'address'" nzRequired>门店地址</nz-form-label>
<nz-form-control nzErrorTip="请输入门店地址!">
<input nz-input placeholder="请输入门店地址..." [formControlName]="'address'" id="'address'" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="24">
<nz-form-item>
<nz-form-label nzRequired>设置定位</nz-form-label>
<nz-form-control>
<div id="container"></div>
<div >
<table>
<tr>
<td>
<label>请输入关键字:</label>
</td>
</tr>
<tr>
<td>
<input nz-input id="input" />
</td>
</tr>
</table>
</div>
</nz-form-control>
</nz-form-item>
<div nz-row>
<div nz-col nzSpan="2"></div>
<div nz-col nzSpan="20">
<form nz-form [formGroup]="validateForm">
<div nz-row [nzGutter]="24">
<nz-divider nzText="门店信息"></nz-divider>
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label [nzFor]="'storeName'" nzRequired>门店名称</nz-form-label>
<nz-form-control nzErrorTip="请输入门店名称!">
<input nz-input placeholder="请输入门店名称..." [formControlName]="'storeName'" id="'storeName'" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label [nzFor]="'usingScope'" nzRequired>门店品牌</nz-form-label>
<nz-form-control nzErrorTip="请选择品牌!">
<nz-select formControlName="brandId" nzAllowClear nzPlaceHolder="请选择品牌">
<nz-option *ngFor="let item of brandData" [nzValue]="item.codeValue" [nzLabel]="item.codeName"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="8" *ngIf="!editFlag">
<nz-form-item>
<nz-form-label [nzFor]="'prestoreType'" nzRequired>预存类型</nz-form-label>
<nz-form-control nzErrorTip="请选择预存类型!">
<nz-select formControlName="prestoreType" nzAllowClear nzPlaceHolder="请选择预存类型">
<nz-option nzValue="0" nzLabel="非预存"></nz-option>
<nz-option nzValue="1" nzLabel="预存"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label [nzFor]="'type'" nzRequired>门店类型</nz-form-label>
<nz-form-control nzErrorTip="请选择门店类型!">
<nz-select formControlName="type" nzAllowClear nzPlaceHolder="请选择门店类型">
<nz-option nzValue="1" nzLabel="加油站"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label [nzFor]="'contactName'" nzRequired>联系人</nz-form-label>
<nz-form-control nzErrorTip="请输入联系人!">
<input nz-input placeholder="请输入联系人..." [formControlName]="'contactName'" id="'contactName'" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label [nzFor]="'telephone'" nzRequired>联系电话</nz-form-label>
<nz-form-control nzErrorTip="请输入联系电话!">
<input nz-input placeholder="请输入联系电话..." [formControlName]="'telephone'" id="'telephone'" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="24">
<nz-form-item>
<nz-form-label>门店照片</nz-form-label>
<nz-form-control>
<nz-upload
nzAction="{{WEB_SERVE_URL}}/fileUpload/uploadfile"
nzListType="picture-card"
[(nzFileList)]="logoFile"
[nzShowButton]="logoFile.length < 1"
[nzPreview]="handlePreview"
>
<i nz-icon nzType="plus"></i>
<div class="ant-upload-text">上传LOGO</div>
</nz-upload>
<nz-modal [nzVisible]="previewVisible" [nzContent]="modalContent" [nzFooter]="null" (nzOnCancel)="previewVisible = false">
<ng-template #modalContent>
<img [src]="previewImage" [ngStyle]="{ width: '100%' }" />
</ng-template>
</nz-modal>
</nz-form-control>
</nz-form-item>
</div>
<nz-divider nzText="设备信息"></nz-divider>
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label [nzFor]="'deviceSn'" >打印机编号</nz-form-label>
<nz-form-control nzErrorTip="请输入打印机编号!">
<input nz-input placeholder="请输入打印机编号..." [formControlName]="'deviceSn'" id="'deviceSn'" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label [nzFor]="'deviceKey'" >打印机KEY</nz-form-label>
<nz-form-control nzErrorTip="请输入打印机KEY!">
<input nz-input placeholder="请输入打印机KEY..." [formControlName]="'deviceKey'" id="'deviceKey'" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label [nzFor]="'deviceName'" >打印机名称</nz-form-label>
<nz-form-control nzErrorTip="请输入打印机名称!">
<input nz-input placeholder="请输入打印机名称..." [formControlName]="'deviceName'" id="'deviceName'" />
</nz-form-control>
</nz-form-item>
</div>
<nz-divider nzText="定位信息"></nz-divider>
<!-- <div nz-col [nzSpan]="8">-->
<!-- <nz-form-item>-->
<!-- <nz-form-label [nzFor]="'latitude'" nzRequired>地址维度</nz-form-label>-->
<!-- <nz-form-control nzErrorTip="请输入门店地址维度!">-->
<!-- <input nz-input placeholder="请输入门店地址维度..." readonly [formControlName]="'latitude'" id="'latitude'" />-->
<!-- </nz-form-control>-->
<!-- </nz-form-item>-->
<!-- </div>-->
<!-- <div nz-col [nzSpan]="8">-->
<!-- <nz-form-item>-->
<!-- <nz-form-label [nzFor]="'longitude'" nzRequired>地址经度</nz-form-label>-->
<!-- <nz-form-control nzErrorTip="请输入门店地址维度!">-->
<!-- <input nz-input placeholder="请输入门店地址维度..." readonly [formControlName]="'longitude'" id="'longitude'" />-->
<!-- </nz-form-control>-->
<!-- </nz-form-item>-->
<!-- </div>-->
<div nz-col [nzSpan]="14">
<nz-form-item>
<nz-form-label [nzFor]="'address'" nzRequired>门店地址</nz-form-label>
<nz-form-control nzErrorTip="请输入门店地址!">
<input nz-input placeholder="请输入门店地址..." [formControlName]="'address'" id="'address'" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="24">
<nz-form-item>
<nz-form-label nzRequired>设置定位</nz-form-label>
<nz-form-control>
<div id="container"></div>
<div >
<table>
<tr>
<td>
<label>请输入关键字:</label>
</td>
</tr>
<tr>
<td>
<input nz-input id="input" />
</td>
</tr>
</table>
</div>
</nz-form-control>
</nz-form-item>
</div>
</div>
</div>
<div nz-row>
<div nz-col [nzSpan]="24" class="search-area">
<button nz-button (click)="resetForm()">重置</button>
<button nz-button [nzType]="'primary'" (click)="getSave()">提交</button>
<div nz-row>
<div nz-col [nzSpan]="24" class="search-area">
<button nz-button (click)="resetForm()">重置</button>
<button nz-button [nzType]="'primary'" (click)="getSave()">提交</button>
</div>
</div>
</div>
</form>
</form>
</div>
<div nz-col nzSpan="2"></div>
</div>
</nz-content>

@ -6,6 +6,7 @@ import {NzMessageService, NzUploadFile} from 'ng-zorro-antd';
import {ActivatedRoute} from '@angular/router';
import {ValidatorsService} from '../../../services/validators.service';
import {MerchantStoreService} from '../../../services/merchant-store.service';
import {CommonsService} from "../../../services/commons.service";
declare var AMap: any; // 一定要声明AMap,要不然报错找不到AMap
declare var AMapUI: any;
@ -35,15 +36,16 @@ export class StoreEditComponent implements OnInit {
WEB_SERVE_URL = environment.baseUrl;
previewVisible = false;
previewImage: string | undefined = '';
brandData = [];
constructor(
private fb: FormBuilder,
private merchantStore: MerchantStoreService,
private message: NzMessageService, // 信息提示
private commonsService: CommonsService,
private activatedRoute: ActivatedRoute,
) {
}
ngOnInit(): void {
this.activatedRoute.queryParams.subscribe(queryParams => {
if (queryParams.storeId != null) {
@ -55,19 +57,23 @@ export class StoreEditComponent implements OnInit {
}
});
this.validateForm = this.fb.group({
telephone: [null, [Validators.required, ValidatorsService.mobile]],
password: [null, [Validators.required, ValidatorsService.minLength(6)]],
storeKey: [null, [Validators.required, ValidatorsService.maxLength(10)]],
storeName: [null, [Validators.required]],
address: [null, [Validators.required]],
contactName: [null, [Validators.required]],
prestoreType: [null, [Validators.required]],
telephone: [null, [Validators.required]],
latitude: [29.553134, [Validators.required]],
longitude: [106.565428, [Validators.required]],
status: [null],
companyId: [null],
deviceSn: [null],
deviceKey: [null],
deviceName: [null],
regionId: [null],
merchantId: [null],
createTime: [null],
secUser: {},
brandId: [null],
type: [null],
});
this.commonsService.getDictionary('MERCHANT_STORE_BRANCH', data => {
this.brandData = data['return_data'];
});
}
@ -103,8 +109,6 @@ export class StoreEditComponent implements OnInit {
return;
}
}
this.validateForm.value['secUser']['telephone'] = this.validateForm.value.telephone;
this.validateForm.value['secUser']['password'] = this.validateForm.value.password;
if (this.logoFile.length !== 0) {
if (this.logoFile[0]['response'] != null) {
this.validateForm.value.storeLogo = this.logoFile[0]['response']['return_data'][0];
@ -138,8 +142,9 @@ export class StoreEditComponent implements OnInit {
public getDetails(id) {
this.merchantStore.getMerchantStoreById(id, data => {
if (data['return_code'] === '000000') {
data['return_data'].telephone = data['return_data'].secUser.loginName;
data['return_data'].password = data['return_data'].secUser.password;
console.log(data);
data['return_data']['brandId'] = String(data['return_data']['brandId']);
data['return_data']['type'] = String(data['return_data']['type']);
if (data['return_data']['storeLogo'] != null && data['return_data']['storeLogo'] !== '') {
const logo = String(data['return_data']['storeLogo']);
const logoArray = [];
@ -164,7 +169,6 @@ export class StoreEditComponent implements OnInit {
getMap() {
// tslint:disable-next-line:variable-name
AMapUI.loadUI(['misc/PositionPicker'], PositionPicker => {
console.log(this.validateForm.value);
const map = new AMap.Map('container', {
resizeEnable: true,
scrollWheel: false,
@ -194,7 +198,6 @@ export class StoreEditComponent implements OnInit {
map: map
});
positionPicker.on('success', positionResult => {
console.log(positionResult);
positionResult['latitude'] = positionResult.position.lat;
positionResult['longitude'] = positionResult.position.lng;
positionResult['regionId'] = positionResult.regeocode.addressComponent.adcode;

@ -75,7 +75,7 @@
<th nzWidth="80px">门店名称</th>
<th nzWidth="100px">门店电话</th>
<th nzWidth="100px">创建时间</th>
<th nzWidth="80px" nzRight="0px">操作</th>
<th nzWidth="160px" nzRight="0px">操作</th>
</tr>
</thead>
<tbody>
@ -87,11 +87,13 @@
<td>{{data.telephone}}</td>
<td>{{data.createTime | date: 'yyyy-MM-dd HH:mm'}}</td>
<td nzRight="0px" class="table-td-operation">
<a (click)="getEdit(data.id)"><i nz-icon nzType="form" nzTheme="outline" nz-tooltip="编辑"></i></a>
<a (click)="getEdit(data.id)">编辑</a>
<nz-divider nzType="vertical"></nz-divider>
<a (click)="getDetail(data.id)"><i nz-icon [nzIconfont]="'icon-xiangqing'" nz-tooltip="门店详情"></i></a>
<a (click)="getDetail(data.id)">详情</a>
<nz-divider nzType="vertical"></nz-divider>
<a (click)="getDelete(data.id)"><i nz-icon nzType="delete" nzTheme="outline" nz-tooltip="删除"></i></a>
<a *ngIf="'BTN_add_blance' | button" (click)="getRecharge(data.id)">增加余额</a>
<nz-divider *ngIf="'BTN_add_blance' | button" nzType="vertical"></nz-divider>
<a (click)="getDelete(data.id)">删除</a>
</td>
</tbody>
</nz-table>
@ -122,3 +124,16 @@
</tbody>
</nz-table>
</nz-modal>
<nz-modal [(nzVisible)]="isVisibleAdd" nzTitle="新增预充值余额" (nzOnCancel)="isVisibleAdd = false" (nzOnOk)="handleOk()">
<div nz-row>
<div nz-col nzSpan="18">
<nz-form-item>
<nz-form-label [nzSpan]="6">充值金额</nz-form-label>
<nz-form-control [nzSpan]="16">
<input nz-input placeholder="请输入充值金额..." [(ngModel)]="price" />
</nz-form-control>
</nz-form-item>
</div>
</div>
</nz-modal>

@ -1,4 +1,4 @@
import { Component, OnInit } from '@angular/core';
import {Component, OnInit} from '@angular/core';
import {FormBuilder, FormGroup} from '@angular/forms';
import {IconService} from '../../../services/icon.service';
import {NzMessageService, NzModalService, NzUploadChangeParam} from 'ng-zorro-antd';
@ -6,170 +6,201 @@ import {ActivatedRoute, Router} from '@angular/router';
import {CommonsService} from '../../../services/commons.service';
import {MerchantStoreService} from '../../../services/merchant-store.service';
import {environment} from '../../../../environments/environment';
import {IndexService} from '../../../services/index.service';
@Component({
selector: 'app-store-list',
templateUrl: './store-list.component.html',
styleUrls: ['./store-list.component.scss']
selector: 'app-store-list',
templateUrl: './store-list.component.html',
styleUrls: ['./store-list.component.scss']
})
export class StoreListComponent implements OnInit {
searchForm: FormGroup; // 搜索框
requestData = []; // 列表数据
total: number; // 页码
pageNum = 1; // 页码
pageSize = 10; // 条码
loading = true;
id = null;
name: string;
WEB_SERVE_URL = environment.baseUrl;
importErrorStudentArray = [];
errorStudentVisible = false;
isSpinning = false;
constructor(
private form: FormBuilder,
private merchantStore: MerchantStoreService,
private iconService: IconService,
private message: NzMessageService,
private router: Router,
private modal: NzModalService,
private activatedRoute: ActivatedRoute,
private common: CommonsService
) {
}
ngOnInit(): void {
this.init();
}
public init(): void {
this.activatedRoute.queryParams.subscribe(queryParams => {
if (queryParams.merchantId != null) {
this.id = queryParams.merchantId;
this.name = queryParams.name;
}
});
this.searchForm = this.form.group({
storeName: [null],
telephone: [null],
});
this.getRequest(true, this.searchForm.value);
}
// 查询列表
public getRequest(reset: boolean = false, whereObject: object) {
this.loading = false;
if (reset) {
this.pageNum = 1;
searchForm: FormGroup; // 搜索框
requestData = []; // 列表数据
total: number; // 页码
pageNum = 1; // 页码
pageSize = 10; // 条码
loading = true;
id = null;
storeId = null;
name: string;
price: string;
WEB_SERVE_URL = environment.baseUrl;
importErrorStudentArray = [];
errorStudentVisible = false;
isVisibleAdd = false;
isSpinning = false;
constructor(
private form: FormBuilder,
private merchantStore: MerchantStoreService,
private iconService: IconService,
private message: NzMessageService,
private router: Router,
private index: IndexService,
private modal: NzModalService,
private activatedRoute: ActivatedRoute,
private common: CommonsService
) {
}
whereObject['pageNum'] = this.pageNum;
whereObject['pageSize'] = this.pageSize;
if (this.id == null) {
this.merchantStore.getStoreListByMerchant(whereObject, data => {
if (data['return_code'] === '000000') {
this.requestData = data['return_data'].list;
this.total = data['return_data'].total;
} else {
this.message.error(data['return_msg']);
ngOnInit(): void {
this.init();
}
public init(): void {
this.activatedRoute.queryParams.subscribe(queryParams => {
if (queryParams.merchantId != null) {
this.id = queryParams.merchantId;
this.name = queryParams.name;
}
});
this.searchForm = this.form.group({
storeName: [null],
telephone: [null],
});
this.getRequest(true, this.searchForm.value);
}
// 查询列表
public getRequest(reset: boolean = false, whereObject: object) {
this.loading = false;
if (reset) {
this.pageNum = 1;
}
});
} else {
whereObject['merchantId'] = this.id;
this.merchantStore.getStoreListByCompany(whereObject, data => {
if (data['return_code'] === '000000') {
this.requestData = data['return_data'].list;
this.total = data['return_data'].total;
whereObject['pageNum'] = this.pageNum;
whereObject['pageSize'] = this.pageSize;
if (this.id == null) {
this.merchantStore.getStoreListByMerchant(whereObject, data => {
if (data['return_code'] === '000000') {
this.requestData = data['return_data'].list;
this.total = data['return_data'].total;
} else {
this.message.error(data['return_msg']);
}
});
} else {
this.message.error(data['return_msg']);
whereObject['merchantId'] = this.id;
this.merchantStore.getStoreListByCompany(whereObject, data => {
if (data['return_code'] === '000000') {
this.requestData = data['return_data'].list;
this.total = data['return_data'].total;
} else {
this.message.error(data['return_msg']);
}
});
}
});
}
// 重置
public resetForm(): void {
this.searchForm.reset();
}
}
// 重置
public resetForm(): void {
this.searchForm.reset();
}
// 禁用门店
public getDelete(id): void {
const message = '是否删除门店';
this.common.showConfirm(message, data => {
if (data) {
this.merchantStore.deleteMerchantStore(id, dataReturn => {
if (dataReturn['return_code'] === '000000') {
this.message.success('操作成功');
this.getRequest(false , this.searchForm.value);
} else {
this.message.warning(dataReturn['return_msg']);
}
// 禁用门店
public getDelete(id): void {
const message = '是否删除门店';
this.common.showConfirm(message, data => {
if (data) {
this.merchantStore.deleteMerchantStore(id, dataReturn => {
if (dataReturn['return_code'] === '000000') {
this.message.success('操作成功');
this.getRequest(false, this.searchForm.value);
} else {
this.message.warning(dataReturn['return_msg']);
}
});
}
});
}
});
}
// 修改
public getEdit(id: number): void {
this.router.navigate(['/admin/merchantStore/store-edit'], {
queryParams: {
storeId: id
}
}).then(r => console.log(r));
}
// 查看详情
public getDetail(id: number): void {
this.router.navigate(['/admin/merchantStore/store-detail'], {
queryParams: {
storeId: id
}
}).then(r => console.log(r));
}
handleCancelError(): void {
this.errorStudentVisible = false;
}
handleChange(info: NzUploadChangeParam): void {
this.isSpinning = true;
if (info.file.status !== 'uploading') {
console.log(info.file, info.fileList);
}
if (info.file.status === 'done') {
if (info.file.response.return_code === '000000') {
this.loading = false;
this.isSpinning = false;
if (info.file.response.return_data.errorTotal === 0) {
this.message.success('导入成功');
this.getRequest(true, this.searchForm.value);
} else {
this.modal.warning({
nzTitle: '提示',
nzOkText: '查看失败数据',
nzContent: '只有部分数据导入成功',
nzOnOk: () => this.showErrorStudentModal(info.file.response.return_data)
});
// 修改
public getEdit(id: number): void {
this.router.navigate(['/admin/merchantStore/store-edit'], {
queryParams: {
storeId: id
}
}).then(r => console.log(r));
}
// 查看详情
public getDetail(id: number): void {
this.router.navigate(['/admin/merchantStore/store-detail'], {
queryParams: {
storeId: id
}
}).then(r => console.log(r));
}
handleCancelError(): void {
this.errorStudentVisible = false;
}
handleChange(info: NzUploadChangeParam): void {
this.isSpinning = true;
if (info.file.status !== 'uploading') {
console.log(info.file, info.fileList);
}
} else {
this.isSpinning = false;
this.loading = false;
this.message.error(info.file.response.return_msg);
}
} else if (info.file.status === 'error') {
this.message.error('上传错误');
if (info.file.status === 'done') {
if (info.file.response.return_code === '000000') {
this.loading = false;
this.isSpinning = false;
if (info.file.response.return_data.errorTotal === 0) {
this.message.success('导入成功');
this.getRequest(true, this.searchForm.value);
} else {
this.modal.warning({
nzTitle: '提示',
nzOkText: '查看失败数据',
nzContent: '只有部分数据导入成功',
nzOnOk: () => this.showErrorStudentModal(info.file.response.return_data)
});
}
} else {
this.isSpinning = false;
this.loading = false;
this.message.error(info.file.response.return_msg);
}
} else if (info.file.status === 'error') {
this.message.error('上传错误');
}
}
// 打开模态框
showErrorStudentModal(data: []) {
this.getRequest(true, this.searchForm.value);
this.importErrorStudentArray = data['errorData'];
this.errorStudentVisible = true;
}
// 增加余额
public getRecharge(id): void {
this.storeId = id;
this.isVisibleAdd = true;
}
handleOk(): void {
if (this.price == null) {
this.message.error('请输入充值金额');
return;
}
const paramsObject = {
storeId: this.storeId,
amount: this.price
};
this.index.recharge(paramsObject, data => {
if (data['return_code'] === '000000') {
this.getRequest(false, this.searchForm.value);
this.isVisibleAdd = false;
} else {
this.message.error(data['return_msg']);
}
});
}
}
// 打开模态框
showErrorStudentModal(data: []) {
this.getRequest(true, this.searchForm.value);
this.importErrorStudentArray = data['errorData'];
this.errorStudentVisible = true;
}
}

@ -1,3 +1,14 @@
<!-- start 面包屑 -->
<nz-breadcrumb>
<nz-breadcrumb-item>
<a (click)="getBack()">商户管理</a>
</nz-breadcrumb-item>
<nz-breadcrumb-item>
商户详情
</nz-breadcrumb-item>
</nz-breadcrumb>
<!-- end 面包屑 -->
<div class="inner-content">
<nz-descriptions nzBordered>
<nz-descriptions-item nzTitle="商户logo" [nzSpan]="3">

@ -1,39 +1,46 @@
import { Component, OnInit } from '@angular/core';
import {Component, OnInit} from '@angular/core';
import {MerchantService} from '../../../services/merchant.service';
import {NzMessageService} from 'ng-zorro-antd';
import {ActivatedRoute} from '@angular/router';
import {environment} from '../../../../environments/environment';
@Component({
selector: 'app-merchant-detail',
templateUrl: './merchant-detail.component.html',
styleUrls: ['./merchant-detail.component.scss']
selector: 'app-merchant-detail',
templateUrl: './merchant-detail.component.html',
styleUrls: ['./merchant-detail.component.scss']
})
export class MerchantDetailComponent implements OnInit {
data: any = {};
id: number;
FILE_URL = environment.imageUrl;
constructor(
private merchant: MerchantService,
private message: NzMessageService, // 信息提示
private activatedRoute: ActivatedRoute,
) { }
data: any = {};
id: number;
FILE_URL = environment.imageUrl;
ngOnInit(): void {
this.activatedRoute.queryParams.subscribe(queryParams => {
if (queryParams.merchantId != null) {
this.id = queryParams.merchantId;
this.getDetails(queryParams.merchantId);
}
});
}
constructor(
private merchant: MerchantService,
private message: NzMessageService, // 信息提示
private activatedRoute: ActivatedRoute,
) {
}
// 查询详情
public getDetails(id: number) {
this.merchant.getMerchantById(id , data => {
this.data = data['return_data'];
});
}
ngOnInit(): void {
this.activatedRoute.queryParams.subscribe(queryParams => {
if (queryParams.merchantId != null) {
this.id = queryParams.merchantId;
this.getDetails(queryParams.merchantId);
}
});
}
// 查询详情
public getDetails(id: number) {
this.merchant.getMerchantById(id, data => {
this.data = data['return_data'];
});
}
// 返回
getBack() {
history.back();
}
}

@ -1,6 +1,14 @@
import { Component, OnInit } from '@angular/core';
import {Component, OnInit} from '@angular/core';
import {LocalStorageService} from '../../services/local-storage.service';
import {DATA, ROUTENAME, MENUNAME, CHILDMENUNAME, INIT_FLAG, ADMIN_INFO_OBJECT, TOKEN} from '../../services/local-storage.namespace';
import {
DATA,
ROUTENAME,
MENUNAME,
CHILDMENUNAME,
INIT_FLAG,
ADMIN_INFO_OBJECT,
TOKEN
} from '../../services/local-storage.namespace';
import {LoginService} from '../../services/login.service';
import {NzMessageService, NzModalService} from 'ng-zorro-antd';
import {Router} from '@angular/router';
@ -12,164 +20,172 @@ 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']
selector: 'app-navigation',
templateUrl: './navigation.component.html',
styleUrls: ['./navigation.component.less'],
})
export class NavigationComponent implements OnInit {
visibleUpdatePwd = false; // 修改密码抽屉
validateForm: FormGroup; // 定义表单
passwordVisible = false;
isCollapsed = false;
userInfo: any;
menuList: any;
routeName: string;
switchValue = false;
constructor(
private storage: LocalStorageService,
private loginService: LoginService,
private message: NzMessageService,
private commonsService: CommonsService,
private companyTwoPwdService: CompanyTwoPwdService,
private http: HttpClient, // http请求
private iconService: IconService,
private modal: NzModalService,
private fb: FormBuilder, // 表单
private router: Router,
) { }
ngOnInit(): void {
this.validateForm = this.fb.group({
oldPassword: [null, [Validators.required, ValidatorsService.minLength(6), ValidatorsService.maxLength(16)]],
newPassword: [null, [Validators.required, ValidatorsService.minLength(6), ValidatorsService.maxLength(16)]],
checkNewPassword: [null, [Validators.required, this.checkPwd]],
});
this.routeName = this.storage.get(ROUTENAME) == null ? 'index' : this.storage.get(ROUTENAME);
this.userInfo = this.storage.getList(ADMIN_INFO_OBJECT);
this.commonsService.mappingSysNameOl('RECHARGE', data => {
this.switchValue = data['return_data']['codeValue'] === '1';
});
this.menuList = this.storage.getList(ADMIN_INFO_OBJECT)['menuList']; // 定义菜单数据
}
public activeLi(routeName): void {
this.routeName = routeName;
this.storage.set(ROUTENAME, routeName);
}
// 菜单姓名
public getRouteName(menuName , childMenuName): void {
this.storage.set(MENUNAME, menuName);
this.storage.set(CHILDMENUNAME, childMenuName);
}
// 登出
public loginOut(): void {
this.loginService.loginOut(data => {
if (data.return_code === '000000') {
this.storage.set(ADMIN_INFO_OBJECT, null);
this.storage.set(INIT_FLAG, false);
this.storage.set(TOKEN, null);
this.router.navigateByUrl('/adminLogin').then();
} else {
this.message.warning(data.return_msg);
}
});
}
// 返回
public getBack(): void {
history.back();
}
clickSwitch(): void {
this.switchValue = !this.switchValue;
this.commonsService.updateDictionary('RECHARGE' , this.switchValue === true ? '1' : '0' , data => {
if (data['return_code'] === '000000') {
this.message.success(data['return_data']);
} else {
this.message.error(data['return_msg']);
}
});
}
// 打开抽屉
openUpdatePwd(): void {
this.visibleUpdatePwd = true;
}
// 关闭抽屉
closeUser(): void {
this.visibleUpdatePwd = false;
}
// 提交表单
submitForm(value): void {
// 表单验证
// tslint:disable-next-line:forin
for (const i in this.validateForm.controls) {
this.validateForm.controls[i].markAsDirty();
this.validateForm.controls[i].updateValueAndValidity();
visibleUpdatePwd = false; // 修改密码抽屉
validateForm: FormGroup; // 定义表单
passwordVisible = false;
isCollapsed = false;
userInfo: any;
menuList: any;
routeName: string;
switchValue = false;
constructor(
private storage: LocalStorageService,
private loginService: LoginService,
private message: NzMessageService,
private commonsService: CommonsService,
private companyTwoPwdService: CompanyTwoPwdService,
private http: HttpClient, // http请求
private iconService: IconService,
private webSocketService: WebsocketService,
private store: LocalStorageService, // 数据请求
private modal: NzModalService,
private fb: FormBuilder, // 表单
private router: Router,
) {
}
if (this.validateForm.status == null || this.validateForm.status !== 'VALID') {
this.modal.info({
nzTitle: '提示',
nzContent: '请正确填写必填信息',
});
return;
ngOnInit(): void {
this.validateForm = this.fb.group({
oldPassword: [null, [Validators.required, ValidatorsService.minLength(6), ValidatorsService.maxLength(16)]],
newPassword: [null, [Validators.required, ValidatorsService.minLength(6), ValidatorsService.maxLength(16)]],
checkNewPassword: [null, [Validators.required, this.checkPwd]],
});
this.routeName = this.storage.get(ROUTENAME) == null ? 'index' : this.storage.get(ROUTENAME);
this.userInfo = this.storage.getList(ADMIN_INFO_OBJECT);
this.commonsService.mappingSysNameOl('RECHARGE', data => {
this.switchValue = data['return_data']['codeValue'] === '1';
});
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);
}
const timeNum = new Date().getTime();
const signStr = 'userId=' + this.storage.get(ADMIN_INFO_OBJECT)['secUser'].id + '&newPassword=' + value.newPassword + '&nonceStr=' + timeNum;
// 定义请求数据
const params = {
userId: this.storage.get(ADMIN_INFO_OBJECT)['secUser'].id,
oldPassword: value.oldPassword,
newPassword: value.newPassword,
nonceStr: timeNum,
sign: String(Md5.hashStr(signStr)).toLocaleUpperCase(),
};
this.http.post(environment.baseUrl + '/secUser/sendUserPass', params).subscribe(data => {
if (data['return_code'] === '000000') {
this.modal.success({
nzTitle: '提示',
nzContent: '密码修改成功',
nzOkText: '重新登录',
nzOkType: 'primary',
nzOnOk: () => this.loginOut()
public activeLi(routeName): void {
this.routeName = routeName;
this.storage.set(ROUTENAME, routeName);
}
// 菜单姓名
public getRouteName(menuName, childMenuName): void {
this.storage.set(MENUNAME, menuName);
this.storage.set(CHILDMENUNAME, childMenuName);
}
// 登出
public loginOut(): void {
this.loginService.loginOut(data => {
if (data.return_code === '000000') {
this.storage.set(ADMIN_INFO_OBJECT, null);
this.storage.set(INIT_FLAG, false);
this.storage.set(TOKEN, null);
this.router.navigateByUrl('/adminLogin').then();
} else {
this.message.warning(data.return_msg);
}
});
} else {
this.modal.warning({
nzTitle: '提示',
nzContent: data['return_msg'],
nzOkText: '取消',
nzOkType: 'primary',
}
// 返回
public getBack(): void {
history.back();
}
clickSwitch(): void {
this.switchValue = !this.switchValue;
this.commonsService.updateDictionary('RECHARGE', this.switchValue === true ? '1' : '0', data => {
if (data['return_code'] === '000000') {
this.message.success(data['return_data']);
} else {
this.message.error(data['return_msg']);
}
});
}
setTimeout(() => {
}, 1000);
}, error => {
this.message.create('error', `未知错误!`);
});
}
/**
*
* @param control
*/
checkPwd = (control: FormControl): { [s: string]: boolean } => {
if (!control.value) {
return { required: true };
} else if (control.value !== this.validateForm.controls.newPassword.value) {
return { confirm: true, error: true };
}
return {};
}
// 打开抽屉
openUpdatePwd(): void {
this.visibleUpdatePwd = true;
}
// 关闭抽屉
closeUser(): void {
this.visibleUpdatePwd = false;
}
// 提交表单
submitForm(value): void {
// 表单验证
// tslint:disable-next-line:forin
for (const i in this.validateForm.controls) {
this.validateForm.controls[i].markAsDirty();
this.validateForm.controls[i].updateValueAndValidity();
}
if (this.validateForm.status == null || this.validateForm.status !== 'VALID') {
this.modal.info({
nzTitle: '提示',
nzContent: '请正确填写必填信息',
});
return;
}
const timeNum = new Date().getTime();
const signStr = 'userId=' + this.storage.get(ADMIN_INFO_OBJECT)['secUser'].id + '&newPassword=' + value.newPassword + '&nonceStr=' + timeNum;
// 定义请求数据
const params = {
userId: this.storage.get(ADMIN_INFO_OBJECT)['secUser'].id,
oldPassword: value.oldPassword,
newPassword: value.newPassword,
nonceStr: timeNum,
sign: String(Md5.hashStr(signStr)).toLocaleUpperCase(),
};
this.http.post(environment.baseUrl + '/secUser/sendUserPass', params).subscribe(data => {
if (data['return_code'] === '000000') {
this.modal.success({
nzTitle: '提示',
nzContent: '密码修改成功',
nzOkText: '重新登录',
nzOkType: 'primary',
nzOnOk: () => this.loginOut()
});
} else {
this.modal.warning({
nzTitle: '提示',
nzContent: data['return_msg'],
nzOkText: '取消',
nzOkType: 'primary',
});
}
setTimeout(() => {
}, 1000);
}, error => {
this.message.create('error', `未知错误!`);
});
}
/**
*
* @param control
*/
checkPwd = (control: FormControl): { [s: string]: boolean } => {
if (!control.value) {
return {required: true};
} else if (control.value !== this.validateForm.controls.newPassword.value) {
return {confirm: true, error: true};
}
return {};
}
}

@ -0,0 +1,155 @@
<!-- start 面包屑 -->
<app-breadcrumb></app-breadcrumb>
<!-- end 面包屑 -->
<!--条件搜索-->
<div class="inner-content">
<form nz-form [formGroup]="searchForm" (ngSubmit)="getRequest(true , searchForm.value)">
<div nz-row>
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="6">订单号</nz-form-label>
<nz-form-control [nzSpan]="16">
<input nz-input formControlName="orderNo"/>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="6">状态</nz-form-label>
<nz-form-control [nzSpan]="16">
<nz-select nzShowSearch nzAllowClear nzPlaceHolder="请选择订单状态" formControlName="status">
<nz-option nzLabel="待支付" nzValue="1"></nz-option>
<nz-option nzLabel="已支付" nzValue="2"></nz-option>
<nz-option nzLabel="已完成" nzValue="3"></nz-option>
<nz-option nzLabel="已退款" nzValue="4"></nz-option>
<nz-option nzLabel="已取消" nzValue="5"></nz-option>
<nz-option nzLabel="退款中" nzValue="6"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="6">创建时间</nz-form-label>
<nz-form-control [nzSpan]="16">
<nz-range-picker
formControlName="createTime"
[nzShowTime]="{ nzHideDisabledOptions: true}"
nzFormat="yyyy-MM-dd HH:mm:ss"
></nz-range-picker>
</nz-form-control>
</nz-form-item>
</div>
</div>
<div nz-row>
<div nz-col nzSpan="24" class="search-button">
<button nz-button nzType="primary"><i nz-icon nzType="search" nzTheme="outline"></i>搜索</button>
<button nz-button nzType="default" (click)="resetForm()"><i nz-icon nzType="reload"
nzTheme="outline"></i>重置
</button>
</div>
</div>
</form>
</div>
<div class="inner-content">
<span>共计 {{total}} 条数据</span>
<div class="operating-button">
<button nz-button nzType="primary" class="right-btn" (click)="excelOrder()" ><i nz-icon nzType="import" nzTheme="outline"></i>导出订单</button>
</div>
<nz-table
class="table"
#ajaxTable
nzShowSizeChanger
[nzFrontPagination]="false"
[nzData]="requestData"
[nzLoading]="loading"
[nzTotal]="total"
[(nzPageIndex)]="pageNum"
[(nzPageSize)]="pageSize"
[nzScroll]="{ x: '1200px' }"
(nzPageIndexChange)="getRequest(false , searchForm.value)"
(nzPageSizeChange)="getRequest(false , searchForm.value)">
<thead nzSingleSort>
<tr>
<th nzWidth="50px">编号</th>
<th nzWidth="200px">订单号</th>
<th nzWidth="180px">油站名称</th>
<th nzWidth="90px">类型</th>
<th nzWidth="90px">油号</th>
<th nzWidth="90px">油枪号</th>
<th nzWidth="90px">油枪价</th>
<th nzWidth="90px">优惠价</th>
<th nzWidth="90px">加油升数</th>
<th nzWidth="90px">加油金额</th>
<th nzWidth="90px">支付金额</th>
<th nzWidth="90px">优惠金额</th>
<th nzWidth="120px">创建时间</th>
<th nzRight nzWidth="90px">状态</th>
<th nzWidth="120px" nzRight>操作</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of ajaxTable.data; let i = index">
<td>{{i + 1}}</td>
<td>{{data.orderNo}}</td>
<td>{{data.gasName}}</td>
<td>{{data.gasOilType == 1 ? '汽油': '柴油'}}</td>
<td>{{data.gasOilNo + "#"}}</td>
<td>{{data.gasGunNo + "号"}}</td>
<td>{{data.gasPriceGun}}</td>
<td>{{data.gasPricePreferences}}</td>
<td>{{data.gasOilLiters}}</td>
<td>{{data.totalPrice}}</td>
<td>{{data.payRealPrice}}</td>
<td>{{data.deductionPrice}}</td>
<td>{{data.createTime | date: 'yyyy-MM-dd HH:mm:ss'}}</td>
<td nzRight>{{data.status | orderCouponStatus}}</td>
<td nzRight class="table-td-operation">
<a (click)="getDetail(data.orderNo)">详情</a>
<nz-divider *ngIf="data.status == 2 || data.status == 3 " nzType="vertical" ></nz-divider>
<a *ngIf="data.status == 2 || data.status == 3 " (click)="showModal(data.orderId)">退款</a>
</td>
</tbody>
</nz-table>
</div>
<nz-modal [(nzVisible)]="isVisible" nzTitle="退款理由" (nzOnCancel)="handleCancel()" (nzOnOk)="handleOk()">
<nz-form-item>
<nz-form-label nzRequired>退款理由</nz-form-label>
<nz-form-control>
<textarea [(ngModel)]="refundContent" nz-input rows="2" placeholder="请输入退款理由"></textarea>
</nz-form-control>
</nz-form-item>
</nz-modal>
<nz-modal [(nzVisible)]="isVisibleDetail" nzTitle="订单详情" nzWidth="900" (nzOnCancel)="isVisibleDetail= false" (nzOnOk)="isVisibleDetail= false">
<nz-descriptions nzBordered [nzColumn]="{ xxl: 3, xl: 2, lg: 2, md: 2, sm: 2, xs: 1 }">
<nz-descriptions-item nzTitle="油站名称">{{data['gasName']}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="油站地址">{{data['gasAddress']}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="订单号">{{data['orderNo']}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="类型">{{data['gasOilType'] == 1 ? '汽油': '柴油'}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="油号">{{data['gasOilNo']}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="油枪号">{{data['gasGunNo']}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="油枪价">{{data['gasPriceGun']}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="优惠价">{{data['gasPricePreferences']}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="加油升数">{{data['gasOilLiters']}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="加油金额">{{data['totalPrice']}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="支付金额">{{data['payRealPrice']}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="优惠金额">{{data['deductionPrice']}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="加油折扣">{{data['gasDiscount']}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="加油补贴">{{data['gasOilSubsidy']}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="每升优惠">{{data['gasLitersPreferences']}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="生成时间">{{data['createTime'] | date: 'yyyy-MM-dd HH:mm:ss'}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="状态">{{data['status'] | rechargeStatus}}</nz-descriptions-item>
<nz-descriptions-item *ngIf="data['status'] == 4" nzTitle="退款金额">{{data['refundPrice']}}</nz-descriptions-item>
<nz-descriptions-item *ngIf="data['status'] == 4" nzTitle="退款时间">{{data['refundTime'] | date: 'yyyy-MM-dd HH:mm:ss'}}</nz-descriptions-item>
<nz-descriptions-item *ngIf="data['status'] == 4" nzTitle="退款原因">{{data['refundContent']}}</nz-descriptions-item>
</nz-descriptions>
</nz-modal>

@ -0,0 +1,152 @@
import { Component, OnInit } from '@angular/core';
import {environment} from '../../../../environments/environment';
import {FormBuilder, FormGroup} from '_@angular_forms@9.0.7@@angular/forms';
import {OrderService} from '../../../services/order.service';
import {IconService} from '../../../services/icon.service';
import {NzMessageService} from '_ng-zorro-antd@9.3.0@ng-zorro-antd';
import {Router} from '_@angular_router@9.0.7@@angular/router';
import {CompanyService} from '../../../services/company.service';
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';
@Component({
selector: 'app-oil-station-order',
templateUrl: './oil-station-order.component.html',
styleUrls: ['./oil-station-order.component.scss']
})
export class OilStationOrderComponent implements OnInit {
WEB_SERVE_URL = environment.baseUrl;
FILE_URL = environment.imageUrl;
searchForm: FormGroup; // 搜索框
requestData = []; // 列表数据
companyData = []; // 列表数据
merchantData = []; // 列表数据
data = {}; // 列表数据
total: number; // 页码
pageNum = 1; // 页码
pageSize = 10; // 条码
loading = true;
id: number; // 订单ID
isVisible = false;
isVisibleDetail = false;
refundContent: string;
roleType: number;
constructor(
private form: FormBuilder,
private order: OrderService,
private webSocketService: WebsocketService,
private iconService: IconService,
private message: NzMessageService,
private router: Router,
private company: CompanyService,
private merchant: MerchantService,
private store: LocalStorageService, // 数据请求
private common: CommonsService
) {
}
ngOnInit(): void {
this.init();
// 接收消息
this.webSocketService.messageSubject.subscribe(
data => {
console.log(data);
this.getRequest(true, this.searchForm.value);
},
err => console.log(err)
);
}
public init(): void {
this.searchForm = this.form.group({
orderNo: [null],
status: [null],
createTime: [null],
});
this.getRequest(true, this.searchForm.value);
}
// 查询列表
public getRequest(reset: boolean = false, whereObject: object) {
if (whereObject['createTime'] != null && whereObject['createTime'].length !== 0) {
whereObject['createTimeS'] = whereObject['createTime'][0].getTime();
whereObject['createTimeE'] = whereObject['createTime'][1].getTime();
}
this.loading = false;
if (reset) {
this.pageNum = 1;
}
whereObject['pageNum'] = this.pageNum;
whereObject['pageSize'] = this.pageSize;
this.order.getGasOrderListByOil(whereObject, data => {
if (data['return_code'] === '000000') {
this.requestData = data['return_data'].list;
this.total = data['return_data'].total;
} else {
this.message.error(data['return_msg']);
}
});
}
// 重置
public resetForm(): void {
this.searchForm.reset();
}
showModal(id): void {
this.id = id;
this.isVisible = true;
}
handleOk(): void {
this.common.showConfirm('确认订单是否退款', item => {
if (item) {
const params = {
orderId: this.id ,
refundContent: this.refundContent
};
this.order.refuelingOrderRefund(params, data => {
if (data['return_code'] === '000000') {
this.getRequest(true, this.searchForm.value);
this.isVisible = false;
this.message.success('退款成功');
} else {
this.message.error(data['return_msg']);
}
});
}
});
}
handleCancel(): void {
this.isVisible = false;
}
getDetail(orderNo: string): void {
this.order.getGasOrderDetail(orderNo , data => {
if (data['return_code'] === '000000') {
this.isVisibleDetail = true;
this.data = data['return_data'];
} else {
this.message.error(data['return_msg']);
}
});
}
/**
*
*/
excelOrder() {
this.order.exportGasOrder(this.searchForm.value, data => {
if (data['return_code'] === '000000') {
window.location.href = this.FILE_URL + 'temporary/' + data['return_data'];
} else {
this.message.error(data['return_msg']);
}
});
}
}

@ -13,6 +13,7 @@ import {PreOrderComponent} from './pre-order/pre-order.component';
import {PackageRecordListComponent} from './package-record-list/package-record-list.component';
import {DiscountUseConditionListComponent} from './discount-use-condition-list/discount-use-condition-list.component';
import {DicountPackageOrderListComponent} from './dicount-package-order-list/dicount-package-order-list.component';
import {OilStationOrderComponent} from './oil-station-order/oil-station-order.component';
const routes: Routes = [
@ -29,6 +30,7 @@ const routes: Routes = [
{ path: 'package-record-list', component: PackageRecordListComponent },
{ path: 'discount-use-condition-list', component: DiscountUseConditionListComponent },
{ path: 'discount-package-order-list', component: DicountPackageOrderListComponent},
{ path: 'oil_station_order', component: OilStationOrderComponent},
];
@NgModule({

@ -22,9 +22,10 @@ import { PackageRecordListComponent } from './package-record-list/package-record
import { DiscountUseConditionListComponent } from './discount-use-condition-list/discount-use-condition-list.component';
import {DicountPackageOrderListComponent} from "./dicount-package-order-list/dicount-package-order-list.component";
import {NzSpaceModule} from "_ng-zorro-antd@9.3.0@ng-zorro-antd/space";
import { OilStationOrderComponent } from './oil-station-order/oil-station-order.component';
@NgModule({
declarations: [OrderListComponent, OrderDetailComponent, OrderCouponsComponent, OrderCouponComponent , OrderTListComponent, OrderKListComponent , OrderCListComponent, OrderHListComponent, OrderAgentComponent, PreOrderComponent, PackageRecordListComponent, DiscountUseConditionListComponent, DicountPackageOrderListComponent],
declarations: [OrderListComponent, OrderDetailComponent, OrderCouponsComponent, OrderCouponComponent , OrderTListComponent, OrderKListComponent , OrderCListComponent, OrderHListComponent, OrderAgentComponent, PreOrderComponent, PackageRecordListComponent, DiscountUseConditionListComponent, DicountPackageOrderListComponent, OilStationOrderComponent],
imports: [
CommonModule,
OrderRoutingModule,

@ -108,6 +108,7 @@
<th nzWidth="200px">订单号</th>
<th nzWidth="100px">支付类型</th>
<th nzWidth="100px">加油金额</th>
<th nzWidth="100px">加油升数</th>
<th nzWidth="100px">优惠金额</th>
<th nzWidth="100px">实付金额</th>
<th nzWidth="80px">油号</th>
@ -129,6 +130,7 @@
<td>{{data.orderNo}}</td>
<td>{{data.payType}}</td>
<td>{{data.totalPrice}}元</td>
<td>{{data.oilLiters}}升</td>
<td>{{data.deductionPrice}}元</td>
<td>{{data.payRealPrice}}元</td>
<td>{{data.gasOilNo}}</td>

@ -94,6 +94,8 @@
<div class="inner-content">
<span>共计 {{dataObject.total?dataObject.total:0}} 条数据</span>
<div class="operating-button">
<button nz-button nzType="primary" class="right-btn" *ngIf="(roleType == 5 && adminFlag == 1) || (roleType == 8) || (roleType == 9)" (click)="showBatchDiscountConfigModal()"><i nz-icon nzType="edit" nzTheme="outline"></i>批量设置优惠</button>
<button nz-button nzType="primary" class="right-btn" *ngIf="roleType == 5 && adminFlag == 1" (click)="showBatchConfigOilNoModal()"><i nz-icon nzType="edit" nzTheme="outline"></i>批量配置油品</button>
<button nz-button nzType="primary" class="right-btn" *ngIf="roleType == 5 && adminFlag == 1" (click)="showAssignOrgModal()"><i nz-icon nzType="plus" nzTheme="outline"></i>分配代理公司</button>
<button nz-button nzType="primary" class="right-btn" *ngIf="roleType == 5 && adminFlag == 1" (click)="showUnbindOrgConfirm()"><i nz-icon nzType="minus" nzTheme="outline"></i>解绑代理公司</button>
<button nz-button nzType="primary" class="right-btn" *ngIf="roleType == 5 && adminFlag == 0" (click)="showAssignAgentModal()"><i nz-icon nzType="plus" nzTheme="outline"></i>分配代理商</button>
@ -104,12 +106,15 @@
<!--数组表格 -->
<nz-table #basicTable
nzShowSizeChanger
[nzPageSizeOptions]="[10,20,50,100]"
[nzData]="dataObject.list"
[nzTotal]="dataObject.total"
[nzFrontPagination]="false"
[nzLoading]="tableLoading"
[nzPageIndex]="whereObject.pageNum"
(nzPageIndexChange)="requestData($event)"
(nzPageSizeChange)="pageSizeChange($event)"
[nzScroll]="{ x: '1150px'}">
<thead>
<tr>
@ -143,8 +148,8 @@
<a nz-dropdown [nzDropdownMenu]="menu"> 操作列表 <i nz-icon nzType="down"></i> </a>
<nz-dropdown-menu #menu="nzDropdownMenu">
<ul nz-menu nzSelectable>
<li *ngIf="roleType == 8 || roleType == 9" nz-menu-item (click)="showDiscountConfigModal(data.storeId)">优惠配置</li>
<li *ngIf="roleType == 5" nz-menu-item nzDisabled>暂无操作</li>
<li *ngIf="(roleType == 5 && adminFlag == 1) || roleType == 8 || roleType == 9" nz-menu-item (click)="showDiscountConfigModal(data.storeId)">优惠配置</li>
<li *ngIf="roleType == 5 && adminFlag == 1" (click)="showOilConfigModal(data.storeId)" nz-menu-item>油品配置</li>
</ul>
</nz-dropdown-menu>
</td>
@ -209,9 +214,7 @@
<nz-modal [(nzVisible)]="discountConfigModal" nzTitle="优惠配置" (nzOnCancel)="closeDiscountConfigModal()" nzWidth="350px" [nzBodyStyle]="{ padding: '10px 24px 24px 24px' }" [nzFooter]="null">
<div nz-row *ngFor="let item of discountConfigData" style="margin-top: 10px;">
<div nz-col [nzSpan]="3" style="margin-top: 5px;">
{{item.oilNoName}}
</div>
<div nz-col [nzSpan]="3" style="margin-top: 5px;">{{item.oilNoName}}</div>
<div nz-col [nzSpan]="10">
<nz-input-number
[(ngModel)]="item.priceRate"
@ -232,4 +235,94 @@
<button nz-button nzType="primary" style="margin-top: 15px;width: 150px;" (click)="submitDiscountConfig()">保存</button>
</div>
</nz-modal>
<nz-modal [(nzVisible)]="oilConfigModal" nzTitle="油品配置" (nzOnCancel)="closeOilConfigModal()" nzWidth="550px" [nzBodyStyle]="{ padding: '10px 24px 24px 24px' }" [nzFooter]="null">
<div nz-row *ngFor="let item of discountConfigData" style="margin-top: 10px;">
<div nz-col [nzSpan]="3" style="margin-top: 5px;">
{{item.oilNoName}}
</div>
<div nz-col [nzSpan]="10">
<nz-input-number
[(ngModel)]="item.priceRate"
[nzMin]="item.lowPrice"
[nzMax]="100"
[nzStep]="1"
[nzFormatter]="formatterPercent"
[nzParser]="parserPercent"
[nzPrecision]="2"
[disabled]="true"
style="width: 100%;" >
</nz-input-number>
</div>
<div nz-col [nzSpan]="11" style="margin-top: 5px;left: 15px;">
<span nz-typography nzType="warning" *ngIf="item.status == 1">正常销售中<a (click)="showOilDisabledConfirm(item.oilStationId, item.oilNo)">【点击暂停销售】</a></span>
<span nz-typography nzType="danger" *ngIf="item.status == 2">已暂停销售<a (click)="showOilEnableConfirm(item.oilStationId, item.oilNo)">【点击恢复正常销售】</a></span>
</div>
</div>
</nz-modal>
<nz-modal [(nzVisible)]="batchDiscountConfigModal" nzTitle="批量配置优惠" (nzOnCancel)="closeBatchDiscountConfigModal()" nzWidth="350px" [nzFooter]="null">
<form nz-form [formGroup]="batchDiscountConfigForm">
<nz-form-item>
<nz-form-label [nzSpan]="6">
油品
</nz-form-label>
<nz-form-control [nzSpan]="14">
<nz-select nzShowSearch nzAllowClear nzPlaceHolder="请选择油品" formControlName="oilNo">
<nz-option *ngFor="let data of oilNoArray" nzLabel="{{data.codeName}}" nzValue="{{data.codeValue}}"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="6">
折扣
</nz-form-label>
<nz-form-control [nzSpan]="14">
<nz-input-number
[nzMin]="1"
[nzMax]="100"
[nzStep]="1"
[nzFormatter]="formatterPercent"
[nzParser]="parserPercent"
[nzPrecision]="2"
formControlName="priceRate"
style="width: 100%;" >
</nz-input-number>
</nz-form-control>
</nz-form-item>
<div style="text-align: center;">
<button nz-button nzType="primary" style="width: 150px;" (click)="submitBatchDiscountConfig()">确定</button>
</div>
</form>
</nz-modal>
<nz-modal [(nzVisible)]="batchConfigOilNoModal" nzTitle="批量配置油品" (nzOnCancel)="closeBatchConfigOilNoModal()" nzWidth="350px" [nzFooter]="null">
<form nz-form [formGroup]="batchConfigOilNoForm">
<nz-form-item>
<nz-form-label [nzSpan]="6">
油品
</nz-form-label>
<nz-form-control [nzSpan]="14">
<nz-select nzShowSearch nzAllowClear nzPlaceHolder="请选择油品" formControlName="oilNo">
<nz-option *ngFor="let data of oilNoArray" nzLabel="{{data.codeName}}" nzValue="{{data.codeValue}}"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="6">
销售状态
</nz-form-label>
<nz-form-control [nzSpan]="14">
<nz-select nzShowSearch nzAllowClear nzPlaceHolder="请选择销售状态" formControlName="status">
<nz-option nzLabel="正常销售" nzValue="1"></nz-option>
<nz-option nzLabel="暂停销售" nzValue="2"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
<div style="text-align: center;">
<button nz-button nzType="primary" style="width: 150px;" (click)="submitBatchConfigOilNo()">确定</button>
</div>
</form>
</nz-modal>
</nz-spin>

@ -4,11 +4,13 @@ import {NzMessageService, NzModalService} from '_ng-zorro-antd@9.3.0@ng-zorro-an
import {TyAgentService} from '../../../services/ty-agent.service';
import {TyAgentOilStationService} from '../../../services/ty-agent-oil-station.service';
import {Validators} from '@angular/forms';
import {OrganizationService} from "../../../services/organization.service";
import {LocalStorageService} from "../../../services/local-storage.service";
import {OrganizationService} from '../../../services/organization.service';
import {LocalStorageService} from '../../../services/local-storage.service';
import {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace';
import {TySalesmanService} from "../../../services/ty-salesman.service";
import {TyAgentPriceService} from "../../../services/ty-agent-price.service";
import {TySalesmanService} from '../../../services/ty-salesman.service';
import {TyAgentPriceService} from '../../../services/ty-agent-price.service';
import {GasService} from '../../../services/gas.service';
import {CommonsService} from '../../../services/commons.service';
@Component({
selector: 'app-petrol-station-manage',
@ -27,6 +29,7 @@ export class PetrolStationManageComponent implements OnInit {
tableLoading = true;
searchForm: FormGroup;
pageNum: number;
pageSize = 10;
whereObject: any = {};
allChecked = false;
@ -45,15 +48,27 @@ export class PetrolStationManageComponent implements OnInit {
assignSalesmanModal = false;
assignSalesmanForm: FormGroup;
batchDiscountConfigModal = false;
batchDiscountConfigForm: FormGroup;
batchConfigOilNoModal = false;
batchConfigOilNoForm: FormGroup;
discountConfigModal = false;
discountConfigData: PetrolStationManage[] = [];
oilConfigModal = false;
oilNoArray = [];
formatterPercent = (value: number) => `${value}`;
parserPercent = (value: string) => value.replace(' 折', '');
constructor(private modal: NzModalService,
private message: NzMessageService,
private tyAgentService: TyAgentService,
private commonsService: CommonsService,
private gasService: GasService,
private tyAgentPriceService: TyAgentPriceService,
private tySalesmanService: TySalesmanService,
private organizationService: OrganizationService,
@ -84,6 +99,21 @@ export class PetrolStationManageComponent implements OnInit {
this.assignSalesmanForm = this.form.group({
salesmanId: [null, [Validators.required]],
});
this.batchDiscountConfigForm = this.form.group({
belongType: [null],
oilNo: [null, [Validators.required]],
priceRate: [100, [Validators.required]],
});
this.batchConfigOilNoForm = this.form.group({
status: [null, [Validators.required]],
oilNo: [null, [Validators.required]],
});
this.commonsService.getDictionary('GAS_OIL_TYPE', data => {
if (data['return_code'] === '000000') {
this.oilNoArray = data['return_data'];
}
});
this.requestData(1);
}
@ -93,7 +123,7 @@ export class PetrolStationManageComponent implements OnInit {
requestData(pageNum) {
this.tableLoading = true;
this.whereObject['pageNum'] = pageNum;
this.whereObject['pageSize'] = 10;
this.whereObject['pageSize'] = this.pageSize;
this.tyAgentOilStationService.getOilStationList(this.whereObject, data => {
if (data['return_code'] === '000000') {
this.dataObject = data['return_data'];
@ -548,12 +578,80 @@ export class PetrolStationManageComponent implements OnInit {
*
*/
showDiscountConfigModal(oilStationId: number) {
this.tyAgentPriceService.getOilStationPrice(oilStationId, data => {
this.getOilStationPrice(oilStationId);
this.discountConfigModal = true;
}
/**
*
*/
closeDiscountConfigModal() {
this.discountConfigModal = false;
}
/**
*
*/
showBatchDiscountConfigModal() {
this.batchDiscountConfigModal = true;
}
/**
*
*/
closeBatchDiscountConfigModal() {
this.batchDiscountConfigModal = false;
}
/**
*
*/
submitBatchDiscountConfig() {
for (const i in this.batchDiscountConfigForm.controls) {
this.batchDiscountConfigForm.controls[i].markAsDirty();
this.batchDiscountConfigForm.controls[i].updateValueAndValidity();
}
if (this.batchDiscountConfigForm.status == null || this.batchDiscountConfigForm.status !== 'VALID') {
this.modal.warning({
nzTitle: '提示',
nzContent: '有必填项未填写',
});
this.loadingObject.spinning = false;
return;
}
if (this.checkedData.length === 0) {
this.modal.warning({
nzTitle: '提示',
nzContent: '请勾选油站',
});
return;
}
this.loadingObject.spinning = true;
this.loadingObject.msg = '处理中...';
this.batchDiscountConfigModal = false;
if (this.roleType === 5) {
this.batchDiscountConfigForm.value.belongType = 1;
} else {
this.batchDiscountConfigForm.value.belongType = 2;
}
const oilStationList = [];
for (const data of this.checkedData) {
oilStationList.push({ oilStationId: data['storeId'], oilStationName: data['storeName'], tyAgentOilStationId: data['tyAgentOilStationId'] });
}
this.batchDiscountConfigForm.value['oilStationList'] = oilStationList;
this.tyAgentPriceService.batchConfigPrice(this.batchDiscountConfigForm.value, data => {
this.loadingObject.spinning = false;
if (data['return_code'] === '000000') {
this.discountConfigData = data['return_data'];
this.discountConfigModal = true;
this.modal.success({
nzTitle: '提示',
nzContent: '处理成功',
});
this.checkedData = [];
this.requestData(this.whereObject['pageNum']);
this.closeBatchDiscountConfigModal();
} else {
this.modal.warning({
this.modal.error({
nzTitle: '提示',
nzContent: data['return_msg'],
});
@ -562,10 +660,67 @@ export class PetrolStationManageComponent implements OnInit {
}
/**
*
*
*/
closeDiscountConfigModal() {
this.discountConfigModal = false;
showBatchConfigOilNoModal() {
this.batchConfigOilNoModal = true;
}
/**
*
*/
closeBatchConfigOilNoModal() {
this.batchConfigOilNoModal = false;
}
/**
*
*/
submitBatchConfigOilNo() {
for (const i in this.batchConfigOilNoForm.controls) {
this.batchConfigOilNoForm.controls[i].markAsDirty();
this.batchConfigOilNoForm.controls[i].updateValueAndValidity();
}
if (this.batchConfigOilNoForm.status == null || this.batchConfigOilNoForm.status !== 'VALID') {
this.modal.warning({
nzTitle: '提示',
nzContent: '有必填项未填写',
});
return;
}
if (this.checkedData.length === 0) {
this.modal.warning({
nzTitle: '提示',
nzContent: '请勾选油站',
});
return;
}
this.loadingObject.spinning = true;
this.loadingObject.msg = '处理中...';
this.batchDiscountConfigModal = false;
const oilStationList = [];
for (const data of this.checkedData) {
oilStationList.push({ oilStationId: data['storeId'] });
}
this.batchConfigOilNoForm.value['oilStationList'] = oilStationList;
this.tyAgentPriceService.batchConfigOilNo(this.batchConfigOilNoForm.value, data => {
this.loadingObject.spinning = false;
if (data['return_code'] === '000000') {
this.modal.success({
nzTitle: '提示',
nzContent: '处理成功',
});
this.checkedData = [];
this.requestData(this.whereObject['pageNum']);
this.closeBatchConfigOilNoModal();
} else {
this.modal.error({
nzTitle: '提示',
nzContent: data['return_msg'],
});
}
});
}
/**
@ -578,6 +733,15 @@ export class PetrolStationManageComponent implements OnInit {
nzContent: '没有配置优惠数据'
});
}
if (this.roleType === 5) {
for (const data of this.discountConfigData) {
data['belongType'] = 1;
}
} else {
for (const data of this.discountConfigData) {
data['belongType'] = 2;
}
}
this.tyAgentPriceService.editPrice(this.discountConfigData, data => {
if (data['return_code'] === '000000') {
this.modal.success({
@ -595,6 +759,21 @@ export class PetrolStationManageComponent implements OnInit {
});
}
/**
*
*/
showOilConfigModal(oilStationId: number) {
this.getOilStationPrice(oilStationId);
this.oilConfigModal = true;
}
/**
*
*/
closeOilConfigModal() {
this.oilConfigModal = false;
}
/**
*
* @param data
@ -636,13 +815,91 @@ export class PetrolStationManageComponent implements OnInit {
}
}
/**
*
*/
showOilDisabledConfirm(oilStationId: number, oilNo: string): void {
this.modal.confirm({
nzTitle: '警告',
nzContent: '确定要暂停销售该油品吗',
nzOkText: '是',
nzCancelText: '否',
nzOkType: 'danger',
nzOnOk: () => this.submitOilDisabled(oilStationId, oilNo)
});
}
submitOilDisabled(oilStationId: number, oilNo: string) {
this.gasService.disabledOil({ storeId: oilStationId, oilNo }, data => {
if (data['return_code'] === '000000') {
this.modal.success({
nzTitle: '提示',
nzContent: data['return_data'],
});
this.getOilStationPrice(oilStationId);
} else {
this.modal.warning({
nzTitle: '提示',
nzContent: data['return_msg'],
});
}
});
}
/**
*
*/
showOilEnableConfirm(oilStationId: number, oilNo: string): void {
this.gasService.enableOil({ storeId: oilStationId, oilNo }, data => {
if (data['return_code'] === '000000') {
this.modal.success({
nzTitle: '提示',
nzContent: data['return_data'],
});
this.getOilStationPrice(oilStationId);
} else {
this.modal.warning({
nzTitle: '提示',
nzContent: data['return_msg'],
});
}
});
}
/**
*
* @param oilStationId
*/
getOilStationPrice(oilStationId: number) {
let belongType = 2;
if (this.roleType === 5) {
belongType = 1;
}
this.tyAgentPriceService.getOilStationPrice(belongType, oilStationId, data => {
if (data['return_code'] === '000000') {
this.discountConfigData = data['return_data'];
} else {
this.modal.warning({
nzTitle: '提示',
nzContent: data['return_msg'],
});
}
});
}
pageSizeChange(pageSize: number) {
this.pageSize = pageSize;
this.requestData(1);
}
}
export class PetrolStationManage {
belongType: number;
oilStationId: number;
lowPrice: number;
oilNo: string;
oilNoName: string;
priceRate: number;
status: number;
}

@ -44,6 +44,7 @@ import {
OilCardRecordTypePipe, OilCardRecordSourceTypePipe
} from './pipes';
import {OilCardStatusPipe} from "./pipes/oil-card/oil-card-status.pipe";
import { OilTypePipe } from './pipes/store/oil-type.pipe';
@ -98,6 +99,7 @@ const PIPES = [
],
declarations: [
...PIPES,
OilTypePipe,
],

@ -112,6 +112,11 @@ const routes: Routes = [
loadChildren: () => import('./admin/oil-card/oil-card.module').then(m => m.OilCardModule),
canActivate: [InitGuardService]
},
{
path: 'gz-sinopec',
loadChildren: () => import('./admin/gz-sinopec/gz-sinopec.module').then(m => m.GzSinopecModule),
canActivate: [InitGuardService]
},
],
},
];

@ -14,9 +14,9 @@ export class RechargeStatusPipe implements PipeTransform {
case 3:
return '已完成';
case 4:
return '已取消';
case 5:
return '已退款';
case 5:
return '已取消';
case 6:
return '退款中';
}

@ -0,0 +1,18 @@
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'oilType'
})
export class OilTypePipe implements PipeTransform {
transform(value: number): string {
switch (value) {
case 1:
return '汽油';
case 2:
return '柴油';
case 3:
return '天然气';
}
}
}

@ -132,5 +132,28 @@ export class CouponService {
});
}
/**
*
*
* @param id id
* @param callBack
*/
public getGzSinopecAssignList(params: object, callBack) {
this.http.get(environment.baseUrl + 'couponCode/getGzSinopecAssignList?' + this.common.getWhereCondition(params)).subscribe(data => {
callBack(data);
});
}
/**
*
*
* @param id id
* @param callBack
*/
public importGzSinopecAssign(params: object, callBack) {
this.http.get(environment.baseUrl + 'couponCode/importGzSinopecAssign?' + this.common.getWhereCondition(params)).subscribe(data => {
callBack(data);
});
}
}

@ -0,0 +1,39 @@
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 GasService {
constructor(
private http: HttpClient,
private common: CommonsService
) { }
/**
*
*
* @param param
* @param callBack
*/
public disabledOil(param: object, callBack) {
this.http.post(environment.baseUrl + 'highGas/disabledOil', param).subscribe(data => {
callBack(data);
});
}
/**
*
*
* @param param
* @param callBack
*/
public enableOil(param: object, callBack) {
this.http.post(environment.baseUrl + 'highGas/enableOil', param).subscribe(data => {
callBack(data);
});
}
}

@ -53,6 +53,19 @@ export class IndexService {
});
}
/**
* @Author Sum1Dream
* @methodName addHLTBalance
* @Description // 新增余额
* @Date 12:12 2022/1/10
* @Param
*/
public recharge(params: object, callBack) {
this.http.post(environment.baseUrl + 'merStoreAccount/recharge', params).subscribe(data => {
callBack(data);
});
}
/**
* @Author Sum1Dream
* @methodName queryCompanyAccountInfo2JD
@ -124,5 +137,47 @@ export class IndexService {
});
}
/**
* @Author Sum1Dream
* @methodName getAccount
* @Description // 查询门店账户
* @Date 10:00 2022/5/18
* @Param
*/
public getAccount(callBack) {
this.http.get(environment.baseUrl + 'merStoreAccount/getAccount').subscribe(data => {
callBack(data);
});
}
/**
* @Author Sum1Dream
* @methodName getGasStatistical
* @Description // 查询加油站统计
* @Date 10:00 2022/5/18
* @Param
*/
public getGasStatistical(callBack) {
this.http.post(environment.baseUrl + 'highGas/getGasStatistical', null).subscribe(data => {
callBack(data);
});
}
/**
* @Author Sum1Dream
* @methodName getAccountRecordList
* @Description // 查询门店账户流失记录
* @Date 10:00 2022/5/18
* @Param
*/
public getAccountRecordList(paramsObject , callBack) {
this.http.get(environment.baseUrl + 'merStoreAccount/getAccountRecordList?' + this.common.getWhereCondition(paramsObject)).subscribe(data => {
callBack(data);
});
}
}

@ -25,6 +25,18 @@ export class MerchantStoreService {
});
}
/**
*
*
* @param paramsObject
* @param callBack
*/
public getOilPriceListByStore(paramsObject: object, callBack) {
this.http.get(environment.baseUrl + 'gasOilPrice/getOilPriceListByStore?' + this.common.getWhereCondition(paramsObject)).subscribe(data => {
callBack(data);
});
}
/**
*
*
@ -88,5 +100,80 @@ export class MerchantStoreService {
});
}
/**
*
*
* @param paramsObject
* @param callBack
*/
public getOilPriceDetail(paramsObject: object, callBack) {
this.http.get(environment.baseUrl + 'gasOilPrice/getOilPriceDetail?' + this.common.getWhereCondition(paramsObject)).subscribe(data => {
callBack(data);
});
}
/**
*
*
* @param params
* @param callBack
* @return data
*/
public editGasOilPrice(params: object, callBack) {
this.http.post(environment.baseUrl + 'gasOilPrice/editGasOilPrice', params).subscribe(data => {
callBack(data);
});
}
/**
*
*
* @param params
* @param callBack
* @return data
*/
public delOilPrice(params: object, callBack) {
console.log(params);
this.http.post(environment.baseUrl + 'gasOilPrice/delOilPrice', params).subscribe(data => {
callBack(data);
});
}
/**
*
*
* @param params
* @param callBack
* @return data
*/
public delGunNo(params: object, callBack) {
this.http.post(environment.baseUrl + 'gasOilGunNo/delGunNo', params).subscribe(data => {
callBack(data);
});
}
/**
*
*
* @param oilPriceId
* @param callBack
*/
public getGunNoListByOilPrice(oilPriceId: number, callBack) {
this.http.get(environment.baseUrl + 'gasOilGunNo/getGunNoListByOilPrice?oilPriceId=' + oilPriceId).subscribe(data => {
callBack(data);
});
}
/**
*
*
* @param params
* @param callBack
* @return data
*/
public addGasOilPrice(params: object, callBack) {
this.http.post(environment.baseUrl + 'gasOilGunNo/addGasOilPrice', params).subscribe(data => {
callBack(data);
});
}
}

@ -26,6 +26,18 @@ export class OrderService {
});
}
/**
*
*
* @param paramsObject
* @param callBack
*/
public getGasOrderListByOil(paramsObject: object, callBack) {
this.http.get(environment.baseUrl + 'highGas/getGasOrderList?' + this.common.getWhereCondition(paramsObject)).subscribe(data => {
callBack(data);
});
}
/**
* @Author Sum1Dream
* @methodName getDiscountPackageList
@ -233,4 +245,15 @@ export class OrderService {
});
}
public exportGasOrder(params: object , callBack) {
this.http.get(environment.baseUrl + 'highGas/exportGasOrder?' + this.common.getWhereCondition(params)).subscribe( data => {
callBack(data);
});
}
public getGasOrderDetail(orderNo: string , callBack) {
this.http.get(environment.baseUrl + 'highGas/getGasOrderDetail?orderNo=' + orderNo).subscribe( data => {
callBack(data);
});
}
}

@ -24,14 +24,37 @@ export class TyAgentPriceService {
});
}
/**
*
* @param paramObject
* @param callBack
*/
batchConfigPrice(paramObject: object, callBack) {
this.http.post(environment.baseUrl + 'tyAgentPrice/batchConfigPrice', paramObject).subscribe(data => {
callBack(data);
});
}
/**
*
* @param paramObject
* @param callBack
*/
batchConfigOilNo(paramObject: object, callBack) {
this.http.post(environment.baseUrl + 'tyAgentPrice/batchConfigOilNo', paramObject).subscribe(data => {
callBack(data);
});
}
/**
*
* @param paramObject
* @param callBack
*/
getOilStationPrice(oilStationId: number, callBack) {
this.http.get(environment.baseUrl + 'tyAgentPrice/getOilStationPrice?oilStationId=' + oilStationId).subscribe(data => {
getOilStationPrice(belongType: number, oilStationId: number, callBack) {
this.http.get(environment.baseUrl + 'tyAgentPrice/getOilStationPrice?belongType=' + belongType + '&oilStationId=' + oilStationId).subscribe(data => {
callBack(data);
});
}
}

@ -0,0 +1,239 @@
import {Component, Injectable} from '@angular/core';
import {interval, Subject} from 'rxjs';
import {NzNotificationService} from 'ng-zorro-antd';
@Injectable({
providedIn: 'root'
})
export class WebsocketService {
messageSubject; // subject对象,用于发送事件
private url; // 默认请求的url
private webSocket: WebSocket; // websocket对象
connectSuccess = false; // websocket 连接成功
period = 60 * 1000 * 10; // 10分钟检查一次
serverTimeoutSubscription = null; // 定时检测连接对象
reconnectFlag = false; // 重连
reconnectPeriod = 5 * 1000; // 重连失败,则5秒钟重连一次
reconnectSubscription = null; // 重连订阅对象
runTimeSubscription; // 记录运行连接subscription
runTimePeriod = 60 * 10000; // 记录运行连接时间
constructor(private notification: NzNotificationService) {
this.messageSubject = new Subject();
console.log('开始心跳检测');
// 进入程序就进行心跳检测,避免出现开始就连接中断,后续不重连
this.heartCheckStart();
this.calcRunTime();
}
/**
*
* @author Sum1Dream
* @date 2019/1/22
* @param message
*/
sendMessage(message) {
this.webSocket.send(message);
}
/**
*
* @author Sum1Dream
* @date 2019/1/22
* @param url url
*/
connect(url) {
if (!!url) {
this.url = url;
}
// 创建websocket对象
this.createWebSocket();
}
/**
*
* @author Sum1Dream
* @date 2019/1/22
*/
createWebSocket() {
// 如果没有建立过连接,才建立连接并且添加时间监听
this.webSocket = new WebSocket(this.url);
// 建立连接成功
this.webSocket.onopen = (e) => this.onOpen(e);
// 接收到消息
this.webSocket.onmessage = (e) => this.onMessage(e);
// 连接关闭
this.webSocket.onclose = (e) => this.onClose(e);
// 异常
this.webSocket.onerror = (e) => this.onError(e);
}
/**
*
* @author Sum1Dream
* @date 2019/1/22
* @param e
*/
onOpen(e) {
console.log('websocket 已连接');
// 设置连接成功
this.connectSuccess = true;
// 如果是重连中
if (this.reconnectFlag) {
// 1.停止重连
this.stopReconnect();
// 2.重新开启心跳
this.heartCheckStart();
// 3.重新开始计算运行时间
this.calcRunTime();
}
}
/**
*
* @author Sum1Dream
* @date 2019/1/22
* @param event
*/
onMessage(event) {
const data = JSON.parse(event.data);
// 将接受到的消息发布出去
// console.log('接收到消息时间', new Date().getTime());
this.notification.success(
data['order']['gasName'] + '加油订单',
'<p>订单号:' + data['order']['orderNo'] + '</p>' +
'<p>加油金额:' + data['order']['totalPrice'] + '</p>' +
'<p>油号:' + data['order']['gasOilNo'] + '</p>' +
'<p>油枪号:' + data['order']['gasGunNo'] + '</p>'
);
const audio = new Audio();
audio.src = data['voice'];
audio.load();
audio.play().then(r => console.log(r));
this.messageSubject.next(true);
}
/**
*
* @author Sum1Dream
* @date 2019/1/22
*/
private onClose(e) {
console.log('连接关闭', e);
this.connectSuccess = false;
this.webSocket.close();
// 关闭时开始重连
this.reconnect();
this.stopRunTime();
// throw new Error('webSocket connection closed:)');
}
/**
*
* @author Sum1Dream
* @date 2019/1/22
*/
private onError(e) {
// 出现异常时一定会进onClose,所以只在onClose做一次重连动作
console.log('连接异常', e);
this.connectSuccess = false;
// throw new Error('webSocket connection error:)');
}
/**
*
* @author Sum1Dream
* @date 2019/1/22
*/
reconnect() {
// 如果已重连,则直接return,避免重复连接
if (this.connectSuccess) {
this.stopReconnect();
console.log('已经连接成功,停止重连');
return;
}
// 如果正在连接中,则直接return,避免产生多个轮训事件
if (this.reconnectFlag) {
console.log('正在重连,直接返回');
return;
}
// 开始重连
this.reconnectFlag = true;
// 如果没能成功连接,则定时重连
this.reconnectSubscription = interval(this.reconnectPeriod).subscribe(async (val) => {
console.log(`重连:${val}`);
const url = this.url;
// 重新连接
this.connect(url);
});
}
/**
*
* @author Sum1Dream
* @date 2019/1/22
*/
stopReconnect() {
// 连接标识置为false
this.reconnectFlag = false;
// 取消订阅
if (typeof this.reconnectSubscription !== 'undefined' && this.reconnectSubscription != null) {
this.reconnectSubscription.unsubscribe();
}
}
/**
*
* @author Sum1Dream
* @date 2019/1/22
*/
heartCheckStart() {
this.serverTimeoutSubscription = interval(this.period).subscribe((val) => {
// 保持连接状态,重置下
if (this.webSocket != null && this.webSocket.readyState === 1) {
console.log(val, '连接状态,发送消息保持连接');
} else {
// 停止心跳
this.heartCheckStop();
// 开始重连
this.reconnect();
console.log('连接已断开,重新连接');
}
});
}
/**
*
* @author Sum1Dream
* @date 2019/1/22
*/
heartCheckStop() {
// 取消订阅停止心跳
if (typeof this.serverTimeoutSubscription !== 'undefined' && this.serverTimeoutSubscription != null) {
this.serverTimeoutSubscription.unsubscribe();
}
}
/**
*
* @author Sum1Dream
* @date 2019/1/25
*/
calcRunTime() {
this.runTimeSubscription = interval(this.runTimePeriod).subscribe(period => {
console.log('运行时间', `${period}分钟`);
});
}
/**
*
* @author Sum1Dream
* @date 2019/1/25
*/
stopRunTime() {
if (typeof this.runTimeSubscription !== 'undefined' && this.runTimeSubscription !== null) {
this.runTimeSubscription.unsubscribe();
}
}
}

@ -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://hsgcs.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址)
imageUrl: 'https://hsgcs.dctpay.com/filesystem/',
key: 'https://hsgcs.dctpay.com/phone-recharge-H5/index.html?codeValue=',
inviteUrl: 'https://hsgcs.dctpay.com/wx/?action=ic&id=',
};

Loading…
Cancel
Save