-
- 设置定位
-
-
-
-
-
+
diff --git a/src/app/admin/merchant-store/store-edit/store-edit.component.ts b/src/app/admin/merchant-store/store-edit/store-edit.component.ts
index 372f5d0..32b53e4 100644
--- a/src/app/admin/merchant-store/store-edit/store-edit.component.ts
+++ b/src/app/admin/merchant-store/store-edit/store-edit.component.ts
@@ -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;
diff --git a/src/app/admin/merchant-store/store-list/store-list.component.html b/src/app/admin/merchant-store/store-list/store-list.component.html
index 836925b..5bcf915 100644
--- a/src/app/admin/merchant-store/store-list/store-list.component.html
+++ b/src/app/admin/merchant-store/store-list/store-list.component.html
@@ -75,7 +75,7 @@
门店名称 |
门店电话 |
创建时间 |
-
操作 |
+
操作 |
@@ -87,11 +87,13 @@
{{data.telephone}} |
{{data.createTime | date: 'yyyy-MM-dd HH:mm'}} |
-
+ 编辑
-
+ 详情
-
+ 增加余额
+
+ 删除
|
@@ -122,3 +124,16 @@
+
+
+
+
diff --git a/src/app/admin/merchant-store/store-list/store-list.component.ts b/src/app/admin/merchant-store/store-list/store-list.component.ts
index 336dd01..6adb50d 100644
--- a/src/app/admin/merchant-store/store-list/store-list.component.ts
+++ b/src/app/admin/merchant-store/store-list/store-list.component.ts
@@ -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;
- }
}
diff --git a/src/app/admin/merchant/merchant-detail/merchant-detail.component.html b/src/app/admin/merchant/merchant-detail/merchant-detail.component.html
index 31ec073..96dab30 100644
--- a/src/app/admin/merchant/merchant-detail/merchant-detail.component.html
+++ b/src/app/admin/merchant/merchant-detail/merchant-detail.component.html
@@ -1,3 +1,14 @@
+
+
+
+ 商户管理
+
+
+ 商户详情
+
+
+
+
diff --git a/src/app/admin/merchant/merchant-detail/merchant-detail.component.ts b/src/app/admin/merchant/merchant-detail/merchant-detail.component.ts
index dd25626..279914c 100644
--- a/src/app/admin/merchant/merchant-detail/merchant-detail.component.ts
+++ b/src/app/admin/merchant/merchant-detail/merchant-detail.component.ts
@@ -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();
+ }
}
diff --git a/src/app/admin/order/oil-station-order/oil-station-order.component.html b/src/app/admin/order/oil-station-order/oil-station-order.component.html
new file mode 100644
index 0000000..d2b3f3b
--- /dev/null
+++ b/src/app/admin/order/oil-station-order/oil-station-order.component.html
@@ -0,0 +1,141 @@
+
+
+
+
+
+
+
+
+
+
共计 {{total}} 条数据
+
+
+
+ 编号 |
+ 订单号 |
+ 油站名称 |
+ 油站地址 |
+ 类型 |
+ 油号 |
+ 油枪号 |
+ 油枪价 |
+ 优惠价 |
+ 加油升数 |
+ 创建时间 |
+ 加油金额 |
+ 支付金额 |
+ 优惠金额 |
+ 状态 |
+ 操作 |
+
+
+
+
+ {{i + 1}} |
+ {{data.orderNo}} |
+ {{data.gasName}} |
+ {{data.gasAddress}} |
+ {{data.gasOilType == 1 ? '汽油': '柴油'}} |
+ {{data.gasOilNo}} |
+ {{data.gasGunNo}} |
+ {{data.gasPriceGun}} |
+ {{data.gasPricePreferences}} |
+ {{data.gasOilLiters}} |
+ {{data.createTime | date: 'yyyy-MM-dd HH:mm:ss'}} |
+ {{data.totalPrice}} |
+ {{data.payRealPrice}} |
+ {{data.deductionPrice}} |
+ {{data.status | orderCouponStatus}} |
+
+ 详情
+
+ 退款
+ |
+
+
+
+
+
+
+
+ 退款理由
+
+
+
+
+
+
+
+
+ {{data['gasName']}}
+ {{data['gasAddress']}}
+ {{data['orderNo']}}
+ {{data['gasOilType'] == 1 ? '汽油': '柴油'}}
+ {{data['gasOilNo']}}
+ {{data['gasGunNo']}}
+ {{data['gasPriceGun']}}
+ {{data['gasPricePreferences']}}
+ {{data['gasOilLiters']}}
+ {{data['totalPrice']}}
+ {{data['payRealPrice']}}
+ {{data['deductionPrice']}}
+ {{data['gasDiscount']}}
+ {{data['gasOilSubsidy']}}
+ {{data['gasLitersPreferences']}}
+ {{data['createTime'] | date: 'yyyy-MM-dd HH:mm:ss'}}
+ {{data['status'] | rechargeStatus}}
+ {{data['refundPrice']}}
+ {{data['refundTime'] | date: 'yyyy-MM-dd HH:mm:ss'}}
+ {{data['refundContent']}}
+
+
+
diff --git a/src/app/admin/order/oil-station-order/oil-station-order.component.scss b/src/app/admin/order/oil-station-order/oil-station-order.component.scss
new file mode 100644
index 0000000..e69de29
diff --git a/src/app/admin/order/oil-station-order/oil-station-order.component.ts b/src/app/admin/order/oil-station-order/oil-station-order.component.ts
new file mode 100644
index 0000000..16c010d
--- /dev/null
+++ b/src/app/admin/order/oil-station-order/oil-station-order.component.ts
@@ -0,0 +1,140 @@
+import { Component, OnInit } from '@angular/core';
+import {environment} from '../../../../environments/environment';
+import {FormBuilder, FormGroup} from '_@angular_forms@9.0.7@@angular/forms';
+import {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],
+ });
+ this.getRequest(true, this.searchForm.value);
+ }
+
+ // 查询列表
+ public getRequest(reset: boolean = false, whereObject: object) {
+
+ if (whereObject['payTime'] != null && whereObject['payTime'].length !== 0) {
+ whereObject['payTimeS'] = whereObject['payTime'][0].getTime();
+ whereObject['payTimeE'] = whereObject['payTime'][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']);
+ }
+ });
+ }
+}
diff --git a/src/app/admin/order/order-routing.module.ts b/src/app/admin/order/order-routing.module.ts
index 67e635a..ddd9412 100644
--- a/src/app/admin/order/order-routing.module.ts
+++ b/src/app/admin/order/order-routing.module.ts
@@ -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({
diff --git a/src/app/admin/order/order.module.ts b/src/app/admin/order/order.module.ts
index c098c10..43accf7 100644
--- a/src/app/admin/order/order.module.ts
+++ b/src/app/admin/order/order.module.ts
@@ -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,
diff --git a/src/app/admin/tuanyou-agent/petrol-station-manage/petrol-station-manage.ts b/src/app/admin/tuanyou-agent/petrol-station-manage/petrol-station-manage.ts
index e1eaa15..b1bb110 100644
--- a/src/app/admin/tuanyou-agent/petrol-station-manage/petrol-station-manage.ts
+++ b/src/app/admin/tuanyou-agent/petrol-station-manage/petrol-station-manage.ts
@@ -29,9 +29,8 @@ export class PetrolStationManageComponent implements OnInit {
tableLoading = true;
searchForm: FormGroup;
pageNum: number;
- whereObject: any = {
- pageSize: 10
- };
+ pageSize = 10;
+ whereObject: any = {};
allChecked = false;
checkedData = [];
@@ -124,6 +123,7 @@ export class PetrolStationManageComponent implements OnInit {
requestData(pageNum) {
this.tableLoading = true;
this.whereObject['pageNum'] = pageNum;
+ this.whereObject['pageSize'] = this.pageSize;
this.tyAgentOilStationService.getOilStationList(this.whereObject, data => {
if (data['return_code'] === '000000') {
this.dataObject = data['return_data'];
@@ -888,7 +888,7 @@ export class PetrolStationManageComponent implements OnInit {
}
pageSizeChange(pageSize: number) {
- this.whereObject.pageSize = pageSize;
+ this.pageSize = pageSize;
this.requestData(1);
}
}
diff --git a/src/app/app-common.module.ts b/src/app/app-common.module.ts
index 86b5820..43159ee 100644
--- a/src/app/app-common.module.ts
+++ b/src/app/app-common.module.ts
@@ -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,
],
diff --git a/src/app/pipes/recharge-status.pipe.ts b/src/app/pipes/recharge-status.pipe.ts
index 9a832e2..e659165 100644
--- a/src/app/pipes/recharge-status.pipe.ts
+++ b/src/app/pipes/recharge-status.pipe.ts
@@ -14,9 +14,9 @@ export class RechargeStatusPipe implements PipeTransform {
case 3:
return '已完成';
case 4:
- return '已取消';
- case 5:
return '已退款';
+ case 5:
+ return '已取消';
case 6:
return '退款中';
}
diff --git a/src/app/pipes/store/oil-type.pipe.ts b/src/app/pipes/store/oil-type.pipe.ts
new file mode 100644
index 0000000..e878379
--- /dev/null
+++ b/src/app/pipes/store/oil-type.pipe.ts
@@ -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 '天然气';
+ }
+ }
+}
diff --git a/src/app/services/index.service.ts b/src/app/services/index.service.ts
index 3e22da1..439c5d3 100644
--- a/src/app/services/index.service.ts
+++ b/src/app/services/index.service.ts
@@ -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.get(environment.baseUrl + 'highGas/getGasStatistical').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);
+ });
+ }
+
+
}
diff --git a/src/app/services/merchant-store.service.ts b/src/app/services/merchant-store.service.ts
index 8c3a479..5854d19 100644
--- a/src/app/services/merchant-store.service.ts
+++ b/src/app/services/merchant-store.service.ts
@@ -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);
+ });
+ }
}
diff --git a/src/app/services/order.service.ts b/src/app/services/order.service.ts
index 977ba3b..7a54d77 100644
--- a/src/app/services/order.service.ts
+++ b/src/app/services/order.service.ts
@@ -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,10 @@ export class OrderService {
});
}
+ public getGasOrderDetail(orderNo: string , callBack) {
+ this.http.get(environment.baseUrl + 'highGas/getGasOrderDetail?orderNo=' + orderNo).subscribe( data => {
+ callBack(data);
+ });
+ }
+
}
diff --git a/src/app/services/websocket.service.ts b/src/app/services/websocket.service.ts
new file mode 100644
index 0000000..80b6222
--- /dev/null
+++ b/src/app/services/websocket.service.ts
@@ -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'] + '加油订单',
+ '订单号:' + data['order']['orderNo'] + '
' +
+ '加油金额:' + data['order']['totalPrice'] + '
' +
+ '油号:' + data['order']['gasOilNo'] + '
' +
+ '油枪号:' + data['order']['gasGunNo'] + '
'
+ );
+ 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();
+ }
+ }
+}
diff --git a/src/environments/environment.ts b/src/environments/environment.ts
index a2d6d6f..21ad46f 100644
--- a/src/environments/environment.ts
+++ b/src/environments/environment.ts
@@ -4,10 +4,10 @@
export const environment = {
production: false,
- baseUrl: 'http://localhost:9302/brest/', // 测试环境服务器地址(请求数据地址)
- imageUrl: 'http://localhost:9302/filesystem/',
- // baseUrl: 'https://hsgcs.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址)
- // imageUrl: 'https://hsgcs.dctpay.com/filesystem/',
+ // baseUrl: 'http://localhost:9302/brest/', // 测试环境服务器地址(请求数据地址)
+ // imageUrl: 'http://localhost:9302/filesystem/',
+ baseUrl: 'https://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=',
};