+
+
+ 预充值账号余额
+ 余额:{{balanceData['amounts']}}
+
+
- 预充值账号
- 余额:{{(balanceData['amounts']).toFixed(2)}}
+ 预充值账号今日收入
今日收入:{{todayBalanceData['incomePrice'] == null ? '0': todayBalanceData['incomePrice']}}
今日收款笔数:{{todayBalanceData['incomeCount'] == null ? '0': todayBalanceData['incomeCount']}}
+
+
+
+
+ 预充值账号今日退款
今日退款金额:{{todayBalanceData['refundPrice'] == null ? '0': todayBalanceData['refundPrice']}}
今日退款笔数:{{todayBalanceData['incomeCount'] == null ? '0': todayBalanceData['incomeCount']}}
@@ -153,20 +163,27 @@
-
-
- 中石化订单
- 订单数量:{{orderData['count']}}
- 订单总额:{{orderData['orderPrice'] == null ? '0': orderData['orderPrice']}}
- 支付总额:{{orderData['payRealPrice'] == null ? '0': orderData['payRealPrice']}}
-
-
-
-
-
- 中石化订单
- 订单数量:{{orderData['count']}}
- 订单总额:{{orderData['orderPrice'] == null ? '0': orderData['orderPrice']}}
- 支付总额:{{orderData['payRealPrice'] == null ? '0': orderData['payRealPrice']}}
-
-
+
+
+
+
+ 编号 |
+ 类型 |
+ 金额 |
+ 变更前金额 |
+ 变更后金额 |
+ 内容 |
+
+
+
+
+ {{i+1}} |
+ {{data.type == 1 ? '进账': '出账'}} |
+ {{data.amount}} |
+ {{data.beforeAmount}} |
+ {{data.afterAmount}} |
+ {{data.sourceContent}} |
+
+
+
+
diff --git a/src/app/admin/index/index/index.component.ts b/src/app/admin/index/index/index.component.ts
index 36cceae..088f73a 100644
--- a/src/app/admin/index/index/index.component.ts
+++ b/src/app/admin/index/index/index.component.ts
@@ -4,7 +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";
+import {Router} from '_@angular_router@9.0.7@@angular/router';
@Component({
@@ -18,6 +18,7 @@ export class IndexComponent implements OnInit {
loading = true;
isVisible = false;
isVisibleAdd = false;
+ isVisibleOil = false;
balance: number;
price: number;
code = 60;
@@ -28,6 +29,7 @@ export class IndexComponent implements OnInit {
balanceData = {};
rechargeData = {};
todayBalanceData = {};
+ recordList = [];
tyBalance;
webSocket: WebSocket;
@@ -243,7 +245,6 @@ export class IndexComponent implements OnInit {
public getAccount(): void {
this.index.getAccount(data => {
if (data['return_code'] === '000000') {
- console.log(data);
this.balanceData = data['return_data'];
this.loading = false;
} else {
@@ -273,7 +274,8 @@ export class IndexComponent implements OnInit {
};
this.index.getAccountRecordList(paramsObject, data => {
if (data['return_code'] === '000000') {
- console.log(data);
+ this.recordList = data['return_data'].list;
+ console.log(this.recordList);
} else {
this.message.error(data['return_msg']);
}
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 1a19a13..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
@@ -22,6 +22,7 @@ export class StoreListComponent implements OnInit {
pageSize = 10; // 条码
loading = true;
id = null;
+ storeId = null;
name: string;
price: string;
WEB_SERVE_URL = environment.baseUrl;
@@ -179,7 +180,7 @@ export class StoreListComponent implements OnInit {
// 增加余额
public getRecharge(id): void {
- this.id = id;
+ this.storeId = id;
this.isVisibleAdd = true;
}
@@ -190,7 +191,7 @@ export class StoreListComponent implements OnInit {
return;
}
const paramsObject = {
- storeId: this.id,
+ storeId: this.storeId,
amount: this.price
};
this.index.recharge(paramsObject, data => {
diff --git a/src/app/admin/navigation/navigation.component.ts b/src/app/admin/navigation/navigation.component.ts
index e583df5..3c7a236 100644
--- a/src/app/admin/navigation/navigation.component.ts
+++ b/src/app/admin/navigation/navigation.component.ts
@@ -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 {};
+ }
}
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/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/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/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=',
};
From 04073709db17457d2ea8152db322be5e4e75fd84 Mon Sep 17 00:00:00 2001
From: Sum1Dream <418471657@qq.com>
Date: Mon, 23 May 2022 09:27:06 +0800
Subject: [PATCH 07/10] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BF=AE=E6=94=B9?=
=?UTF-8?q?=E8=87=AA=E5=BB=BA=E7=AB=99?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/app/admin/index/test/test.component.html | 30 +++
src/app/admin/index/test/test.component.scss | 0
src/app/admin/index/test/test.component.ts | 71 ++++++
.../oli-gun/oli-gun.component.html | 1 +
.../oli-gun/oli-gun.component.scss | 0
.../oli-gun/oli-gun.component.spec.ts | 25 ++
.../oli-gun/oli-gun.component.ts | 15 ++
.../merchant-store/oli/oli.component.html | 149 +++++++++++
.../merchant-store/oli/oli.component.scss | 0
.../admin/merchant-store/oli/oli.component.ts | 213 ++++++++++++++++
.../oil-station-order.component.html | 141 +++++++++++
.../oil-station-order.component.scss | 0
.../oil-station-order.component.ts | 140 ++++++++++
src/app/pipes/store/oil-type.pipe.ts | 18 ++
src/app/services/websocket.service.ts | 239 ++++++++++++++++++
15 files changed, 1042 insertions(+)
create mode 100644 src/app/admin/index/test/test.component.html
create mode 100644 src/app/admin/index/test/test.component.scss
create mode 100644 src/app/admin/index/test/test.component.ts
create mode 100644 src/app/admin/merchant-store/oli-gun/oli-gun.component.html
create mode 100644 src/app/admin/merchant-store/oli-gun/oli-gun.component.scss
create mode 100644 src/app/admin/merchant-store/oli-gun/oli-gun.component.spec.ts
create mode 100644 src/app/admin/merchant-store/oli-gun/oli-gun.component.ts
create mode 100644 src/app/admin/merchant-store/oli/oli.component.html
create mode 100644 src/app/admin/merchant-store/oli/oli.component.scss
create mode 100644 src/app/admin/merchant-store/oli/oli.component.ts
create mode 100644 src/app/admin/order/oil-station-order/oil-station-order.component.html
create mode 100644 src/app/admin/order/oil-station-order/oil-station-order.component.scss
create mode 100644 src/app/admin/order/oil-station-order/oil-station-order.component.ts
create mode 100644 src/app/pipes/store/oil-type.pipe.ts
create mode 100644 src/app/services/websocket.service.ts
diff --git a/src/app/admin/index/test/test.component.html b/src/app/admin/index/test/test.component.html
new file mode 100644
index 0000000..559660c
--- /dev/null
+++ b/src/app/admin/index/test/test.component.html
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/app/admin/index/test/test.component.scss b/src/app/admin/index/test/test.component.scss
new file mode 100644
index 0000000..e69de29
diff --git a/src/app/admin/index/test/test.component.ts b/src/app/admin/index/test/test.component.ts
new file mode 100644
index 0000000..69f906f
--- /dev/null
+++ b/src/app/admin/index/test/test.component.ts
@@ -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 = '';
+ // }
+
+
+}
diff --git a/src/app/admin/merchant-store/oli-gun/oli-gun.component.html b/src/app/admin/merchant-store/oli-gun/oli-gun.component.html
new file mode 100644
index 0000000..396d8da
--- /dev/null
+++ b/src/app/admin/merchant-store/oli-gun/oli-gun.component.html
@@ -0,0 +1 @@
+
oli-gun works!
diff --git a/src/app/admin/merchant-store/oli-gun/oli-gun.component.scss b/src/app/admin/merchant-store/oli-gun/oli-gun.component.scss
new file mode 100644
index 0000000..e69de29
diff --git a/src/app/admin/merchant-store/oli-gun/oli-gun.component.spec.ts b/src/app/admin/merchant-store/oli-gun/oli-gun.component.spec.ts
new file mode 100644
index 0000000..358df11
--- /dev/null
+++ b/src/app/admin/merchant-store/oli-gun/oli-gun.component.spec.ts
@@ -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
;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ OliGunComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(OliGunComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/src/app/admin/merchant-store/oli-gun/oli-gun.component.ts b/src/app/admin/merchant-store/oli-gun/oli-gun.component.ts
new file mode 100644
index 0000000..664f9f6
--- /dev/null
+++ b/src/app/admin/merchant-store/oli-gun/oli-gun.component.ts
@@ -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 {
+ }
+
+}
diff --git a/src/app/admin/merchant-store/oli/oli.component.html b/src/app/admin/merchant-store/oli/oli.component.html
new file mode 100644
index 0000000..fb3e56c
--- /dev/null
+++ b/src/app/admin/merchant-store/oli/oli.component.html
@@ -0,0 +1,149 @@
+
+
+
+
+
+
+
共计 {{total}} 条数据
+
+
+
+
+
+
+
+ 编号 |
+ 油品类型 |
+ 油品 |
+ 国标价 |
+ 油站价 |
+ 优惠价 |
+ 优惠幅度 |
+ 操作 |
+
+
+
+
+ {{i + 1}} |
+ {{data.oilTypeName}} |
+ {{data.oilNoName}} |
+ {{data.priceOfficial == null ? '暂无' : '¥' + data.priceOfficial}} |
+ {{data.priceGun == null ? '暂无' : '¥' + data.priceGun}} |
+ {{data.priceVip == null ? '暂无' : '¥' + data.priceVip}} |
+ {{data.preferentialMargin == null ? '暂无' : '¥' + data.preferentialMargin}} |
+
+ 查看油枪
+
+ 配置油枪
+
+ 删除
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 序号 |
+ 油枪号 |
+ 油号类型 |
+ 油号 |
+ 操作 |
+
+
+
+
+ {{ i + 1}} |
+ {{data.gunNo}} |
+ {{data.oilTypeName}} |
+ {{data.oilNo}} |
+
+ 删除
+ |
+
+
+
+
+
+
+
+
+
diff --git a/src/app/admin/merchant-store/oli/oli.component.scss b/src/app/admin/merchant-store/oli/oli.component.scss
new file mode 100644
index 0000000..e69de29
diff --git a/src/app/admin/merchant-store/oli/oli.component.ts b/src/app/admin/merchant-store/oli/oli.component.ts
new file mode 100644
index 0000000..d07563e
--- /dev/null
+++ b/src/app/admin/merchant-store/oli/oli.component.ts
@@ -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;
+ }
+}
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/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/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();
+ }
+ }
+}
From 57a31e1a83a52ef8cc6ba86730bde91bcffbfb1c Mon Sep 17 00:00:00 2001
From: hurui <177768073@qq.com>
Date: Mon, 23 May 2022 17:29:12 +0800
Subject: [PATCH 08/10] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../admin/index/index/index.component.html | 100 ++++++++++++------
src/app/admin/index/index/index.component.ts | 39 ++++---
.../oil-station-order.component.html | 46 +++++---
.../oil-station-order.component.ts | 22 +++-
src/app/services/index.service.ts | 4 +-
src/app/services/order.service.ts | 7 +-
src/environments/environment.ts | 8 +-
7 files changed, 148 insertions(+), 78 deletions(-)
diff --git a/src/app/admin/index/index/index.component.html b/src/app/admin/index/index/index.component.html
index 461bc4d..a8e6077 100644
--- a/src/app/admin/index/index/index.component.html
+++ b/src/app/admin/index/index/index.component.html
@@ -7,29 +7,62 @@
-
-
-
-
- 预充值账号余额
- 余额:{{balanceData['amounts']}}
-
-
-
-
- 预充值账号今日收入
- 今日收入:{{todayBalanceData['incomePrice'] == null ? '0': todayBalanceData['incomePrice']}}
- 今日收款笔数:{{todayBalanceData['incomeCount'] == null ? '0': todayBalanceData['incomeCount']}}
-
-
-
-
- 预充值账号今日退款
- 今日退款金额:{{todayBalanceData['refundPrice'] == null ? '0': todayBalanceData['refundPrice']}}
- 今日退款笔数:{{todayBalanceData['incomeCount'] == null ? '0': todayBalanceData['incomeCount']}}
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -149,7 +182,6 @@
-
@@ -163,25 +195,25 @@
-
-
+
+
- 编号 |
- 类型 |
- 金额 |
- 变更前金额 |
- 变更后金额 |
- 内容 |
+ 编号 |
+ 类型 |
+ 交易金额 |
+ 变更前金额 |
+ 变更后金额 |
+ 内容 |
{{i+1}} |
{{data.type == 1 ? '进账': '出账'}} |
- {{data.amount}} |
- {{data.beforeAmount}} |
- {{data.afterAmount}} |
+ {{'¥' + data.amount}} |
+ {{'¥' + data.beforeAmount}} |
+ {{'¥' + data.afterAmount}} |
{{data.sourceContent}} |
diff --git a/src/app/admin/index/index/index.component.ts b/src/app/admin/index/index/index.component.ts
index 088f73a..4f38c5c 100644
--- a/src/app/admin/index/index/index.component.ts
+++ b/src/app/admin/index/index/index.component.ts
@@ -26,13 +26,18 @@ export class IndexComponent implements OnInit {
countData: any = {};
data: any = {};
orderData = {};
- balanceData = {};
+ balanceData = {
+ amounts: 0
+ };
rechargeData = {};
- todayBalanceData = {};
+ gasCountData: any = {
+ history: {},
+ today: {},
+ };
recordList = [];
tyBalance;
webSocket: WebSocket;
-
+ adminInfoObject: {};
constructor(
private store: LocalStorageService, // 数据缓存
private message: NzMessageService, // 信息提示
@@ -42,18 +47,13 @@ export class IndexComponent implements OnInit {
}
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.roleType === 3) {
- this.getAccount();
- this.getAccountRecordList();
- }
-
if (this.store.get(ADMIN_INFO_OBJECT)['highAgent'] != null) {
this.code = this.store.get(ADMIN_INFO_OBJECT)['highAgent'].id;
}
@@ -66,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();
+ }
+ }
}
// 查询余额
@@ -241,8 +247,8 @@ export class IndexComponent implements OnInit {
});
}
- // 查询门店余额
- public getAccount(): void {
+ // 查询油站预存余额
+ public getGasAccount(): void {
this.index.getAccount(data => {
if (data['return_code'] === '000000') {
this.balanceData = data['return_data'];
@@ -253,12 +259,12 @@ export class IndexComponent implements OnInit {
});
}
- // 查询门店余额
+ // 查询加油站统计
public getGasStatistical(): void {
this.index.getGasStatistical(data => {
if (data['return_code'] === '000000') {
- console.log(data);
- this.todayBalanceData = data['return_data']['today'];
+ this.gasCountData = data['return_data'];
+ this.getGasAccountRecord();
this.loading = false;
} else {
this.message.error(data['return_msg']);
@@ -266,8 +272,8 @@ export class IndexComponent implements OnInit {
});
}
- // 查询门店账户流失记录
- public getAccountRecordList(): void {
+ // 查询预存账户油站记录
+ public getGasAccountRecord(): void {
const paramsObject = {
pageNum: 1,
pageSize: 10000
@@ -275,7 +281,6 @@ export class IndexComponent implements OnInit {
this.index.getAccountRecordList(paramsObject, data => {
if (data['return_code'] === '000000') {
this.recordList = data['return_data'].list;
- console.log(this.recordList);
} else {
this.message.error(data['return_msg']);
}
diff --git a/src/app/admin/order/oil-station-order/oil-station-order.component.html b/src/app/admin/order/oil-station-order/oil-station-order.component.html
index d2b3f3b..6dc2eae 100644
--- a/src/app/admin/order/oil-station-order/oil-station-order.component.html
+++ b/src/app/admin/order/oil-station-order/oil-station-order.component.html
@@ -29,6 +29,18 @@
+
+
+ 创建时间
+
+
+
+
+
@@ -45,6 +57,10 @@
共计 {{total}} 条数据
+
+
+
+
编号 |
- 订单号 |
+ 订单号 |
油站名称 |
油站地址 |
- 类型 |
- 油号 |
- 油枪号 |
- 油枪价 |
- 优惠价 |
- 加油升数 |
+ 类型 |
+ 油号 |
+ 油枪号 |
+ 油枪价 |
+ 优惠价 |
+ 加油升数 |
+ 加油金额 |
+ 支付金额 |
+ 优惠金额 |
创建时间 |
- 加油金额 |
- 支付金额 |
- 优惠金额 |
状态 |
操作 |
@@ -85,15 +101,15 @@
{{data.gasName}} |
{{data.gasAddress}} |
{{data.gasOilType == 1 ? '汽油': '柴油'}} |
- {{data.gasOilNo}} |
- {{data.gasGunNo}} |
+ {{data.gasOilNo + "#"}} |
+ {{data.gasGunNo + "号"}} |
{{data.gasPriceGun}} |
{{data.gasPricePreferences}} |
{{data.gasOilLiters}} |
+ {{data.totalPrice}} |
+ {{data.payRealPrice}} |
+ {{data.deductionPrice}} |
{{data.createTime | date: 'yyyy-MM-dd HH:mm:ss'}} |
- {{data.totalPrice}} |
- {{data.payRealPrice}} |
- {{data.deductionPrice}} |
{{data.status | orderCouponStatus}} |
详情
diff --git a/src/app/admin/order/oil-station-order/oil-station-order.component.ts b/src/app/admin/order/oil-station-order/oil-station-order.component.ts
index 16c010d..cbd0e9b 100644
--- a/src/app/admin/order/oil-station-order/oil-station-order.component.ts
+++ b/src/app/admin/order/oil-station-order/oil-station-order.component.ts
@@ -64,19 +64,18 @@ export class OilStationOrderComponent implements OnInit {
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['payTime'] != null && whereObject['payTime'].length !== 0) {
- whereObject['payTimeS'] = whereObject['payTime'][0].getTime();
- whereObject['payTimeE'] = whereObject['payTime'][1].getTime();
+ 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;
@@ -137,4 +136,17 @@ export class OilStationOrderComponent implements OnInit {
}
});
}
+
+ /**
+ * 导出订单
+ */
+ 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']);
+ }
+ });
+ }
}
diff --git a/src/app/services/index.service.ts b/src/app/services/index.service.ts
index 439c5d3..9195faa 100644
--- a/src/app/services/index.service.ts
+++ b/src/app/services/index.service.ts
@@ -154,12 +154,12 @@ export class IndexService {
/**
* @Author Sum1Dream
* @methodName getGasStatistical
- * @Description // 查询门店账户
+ * @Description // 查询加油站统计
* @Date 10:00 2022/5/18
* @Param
*/
public getGasStatistical(callBack) {
- this.http.get(environment.baseUrl + 'highGas/getGasStatistical').subscribe(data => {
+ this.http.post(environment.baseUrl + 'highGas/getGasStatistical', null).subscribe(data => {
callBack(data);
});
}
diff --git a/src/app/services/order.service.ts b/src/app/services/order.service.ts
index 7a54d77..fe68ecf 100644
--- a/src/app/services/order.service.ts
+++ b/src/app/services/order.service.ts
@@ -245,10 +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);
});
}
-
}
diff --git a/src/environments/environment.ts b/src/environments/environment.ts
index 21ad46f..0f97376 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=',
};
From f6693a0571216916c8fd0e2073fb581f0e825637 Mon Sep 17 00:00:00 2001
From: hurui <177768073@qq.com>
Date: Tue, 24 May 2022 11:09:46 +0800
Subject: [PATCH 09/10] =?UTF-8?q?=E6=8F=90=E4=BA=A4diam?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/app/admin/index/index/index.component.html | 2 +-
.../oil-station-order/oil-station-order.component.html | 4 +---
src/environments/environment.ts | 8 ++++----
3 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/src/app/admin/index/index/index.component.html b/src/app/admin/index/index/index.component.html
index a8e6077..4618094 100644
--- a/src/app/admin/index/index/index.component.html
+++ b/src/app/admin/index/index/index.component.html
@@ -7,7 +7,7 @@
-
+
diff --git a/src/app/admin/order/oil-station-order/oil-station-order.component.html b/src/app/admin/order/oil-station-order/oil-station-order.component.html
index 6dc2eae..b295686 100644
--- a/src/app/admin/order/oil-station-order/oil-station-order.component.html
+++ b/src/app/admin/order/oil-station-order/oil-station-order.component.html
@@ -79,7 +79,6 @@
编号 |
订单号 |
油站名称 |
- 油站地址 |
类型 |
油号 |
油枪号 |
@@ -99,7 +98,6 @@
{{i + 1}} |
{{data.orderNo}} |
{{data.gasName}} |
- {{data.gasAddress}} |
{{data.gasOilType == 1 ? '汽油': '柴油'}} |
{{data.gasOilNo + "#"}} |
{{data.gasGunNo + "号"}} |
@@ -131,7 +129,7 @@
-
+
{{data['gasName']}}
{{data['gasAddress']}}
{{data['orderNo']}}
diff --git a/src/environments/environment.ts b/src/environments/environment.ts
index 0f97376..ca22a39 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=',
};
From af8def6a3cbc561967ef53bdfe57113605fde5ce Mon Sep 17 00:00:00 2001
From: hurui <177768073@qq.com>
Date: Tue, 24 May 2022 14:22:02 +0800
Subject: [PATCH 10/10] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../order/ty-order-list/ty-order-list.component.html | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/app/admin/tuanyou-agent/order/ty-order-list/ty-order-list.component.html b/src/app/admin/tuanyou-agent/order/ty-order-list/ty-order-list.component.html
index 6b8c0e3..2d2f6ca 100644
--- a/src/app/admin/tuanyou-agent/order/ty-order-list/ty-order-list.component.html
+++ b/src/app/admin/tuanyou-agent/order/ty-order-list/ty-order-list.component.html
@@ -108,6 +108,7 @@
订单号 |
支付类型 |
加油金额 |
+ 加油升数 |
优惠金额 |
实付金额 |
油号 |
@@ -129,6 +130,7 @@
{{data.orderNo}} |
{{data.payType}} |
{{data.totalPrice}}元 |
+ {{data.oilLiters}}升 |
{{data.deductionPrice}}元 |
{{data.payRealPrice}}元 |
{{data.gasOilNo}} |
|