diff --git a/src/app/admin/index/index/index.component.html b/src/app/admin/index/index/index.component.html index 09db79d..461bc4d 100644 --- a/src/app/admin/index/index/index.component.html +++ b/src/app/admin/index/index/index.component.html @@ -8,13 +8,23 @@
-
+
+
+ +

预充值账号余额

+

余额:{{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=', };