提交代码

pull/1/head
胡锐 2 years ago
commit 843c8ce02f
  1. 3
      angular.json
  2. 4
      src/app/admin/index/index-routing.module.ts
  3. 3
      src/app/admin/index/index.module.ts
  4. 55
      src/app/admin/index/index/index.component.html
  5. 42
      src/app/admin/index/index/index.component.less
  6. 160
      src/app/admin/index/index/index.component.ts
  7. 4
      src/app/admin/navigation/navigation.component.html
  8. 4
      src/app/admin/order-manage/order-manage-routing.module.ts
  9. 1
      src/app/admin/recharge-order/order-list/order-list.component.html
  10. 1
      src/app/app.module.ts
  11. 8
      src/app/pipes/recharge-pay-type.pipe.ts
  12. 59
      src/app/services/commons.service.ts
  13. 24
      src/app/services/index.service.ts
  14. 4
      src/environments/environment.ts
  15. 2
      src/index.html
  16. 11
      src/proxy.conf.json

@ -131,7 +131,8 @@
"serve": { "serve": {
"builder": "@angular-devkit/build-angular:dev-server", "builder": "@angular-devkit/build-angular:dev-server",
"options": { "options": {
"browserTarget": "high-web:build" "browserTarget": "high-web:build",
"proxyConfig":"proxy.conf.json"
}, },
"configurations": { "configurations": {
"production": { "production": {

@ -2,11 +2,13 @@ import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router'; import { Routes, RouterModule } from '@angular/router';
import {IndexComponent} from './index/index.component'; import {IndexComponent} from './index/index.component';
import {TestComponent} from './test/test.component'; import {TestComponent} from './test/test.component';
import {OrderStatisticsComponent} from './order-statistics/order-statistics.component';
const routes: Routes = [ const routes: Routes = [
{ path: '', component: IndexComponent }, { path: '', component: IndexComponent },
{ path: 'test', component: TestComponent } { path: 'test', component: TestComponent },
{ path: 'order-statistics', component: OrderStatisticsComponent }
]; ];
@NgModule({ @NgModule({

@ -14,11 +14,12 @@ import {RegionSelectorModule} from '../../common/region-selector/region-selector
import {AppCommonModule} from '../../app-common.module'; import {AppCommonModule} from '../../app-common.module';
import { TestComponent } from './test/test.component'; import { TestComponent } from './test/test.component';
import {NzSpaceModule} from 'ng-zorro-antd/space'; import {NzSpaceModule} from 'ng-zorro-antd/space';
import { OrderStatisticsComponent } from './order-statistics/order-statistics.component';
@NgModule({ @NgModule({
declarations: [IndexComponent, TestComponent], declarations: [IndexComponent, TestComponent, OrderStatisticsComponent],
imports: [ imports: [
CommonModule, CommonModule,
SystemRoutingModule, SystemRoutingModule,

@ -132,41 +132,44 @@
</div> </div>
<!--运营角色--> <!--运营角色-->
<div class="inner-content" *ngIf="roleType == 1"> <div class="inner-content" *ngIf="roleType == 1">
<div nz-row style="margin-top: 20px;" [nzGutter]="16"> <div nz-row>
<div nz-col nzSpan="8" *ngFor="let item of tyBalance" class="row-bottom"> <div nz-col nzSpan="24">
<nz-card nzHoverable [nzLoading]="loading" [nzTitle]="item['energyType'] | energyType"> <div class="date">
<h3>{{item['accountBalance']}}</h3> <span (click)="orderStatisticsByYMD(1)" class="day wh-date fl span-block"></span>
</nz-card> <span (click)="orderStatisticsByYMD(3)" class="month wh-date fl span-block"></span>
<span (click)="orderStatisticsByYMD(4)" class="year wh-date fl span-block"></span>
</div> </div>
<div nz-col nzSpan="8" class="row-bottom"> <div style="margin-top: 40px;" echarts [options]="orderStatisticsByYMDData"></div>
<nz-card nzHoverable [nzLoading]="loading" [nzTitle]="'注册总人数'">
<h3>{{countData['registrantNum']}}</h3>
</nz-card>
</div> </div>
<div nz-col nzSpan="8" class="row-bottom">
<nz-card nzHoverable [nzLoading]="loading" [nzTitle]="'总交易金额'">
<h3>{{countData['transactionNum']}}</h3>
</nz-card>
</div> </div>
<div nz-col nzSpan="8" class="row-bottom"> <div nz-row>
<nz-card nzHoverable [nzLoading]="loading" [nzTitle]="'总交易订单数量'"> <div nz-col nzSpan="4">
<h3>{{countData['transactionOrder']}}</h3> <h3>注册总人数</h3>
</nz-card> <span class="span-block wh-price day">{{countData['registrantNum']}}</span>
<h3>总交易金额(元)</h3>
<span class="span-block wh-price month">{{countData['transactionNum']}}</span>
<h3>总交易订单数量</h3>
<span class="span-block wh-price year">{{countData['transactionOrder']}}</span>
</div> </div>
<div nz-col nzSpan="8" class="row-bottom"> <div nz-col nzSpan="12">
<nz-card nzHoverable [nzLoading]="loading" [nzTitle]="'当天交易金额'"> <div echarts [options]="orderStatisticsByProductTypeByDay"></div>
<h3>{{countData['transactionToday']}}</h3>
</nz-card>
</div> </div>
<div nz-col nzSpan="8" class="row-bottom"> <div nz-col nzSpan="8">
<nz-card nzHoverable [nzLoading]="loading" [nzTitle]="'当天交易订单'"> <div class="date">
<h3>{{countData['transactionOrderToday']}}</h3> <span (click)="orderStatisticsByProductTypeByAll(1)" class="day wh-date fl span-block"></span>
</nz-card> <span (click)="orderStatisticsByProductTypeByAll(2)" class="week wh-date fl span-block"></span>
<span (click)="orderStatisticsByProductTypeByAll(3)" class="month wh-date fl span-block"></span>
<span (click)="orderStatisticsByProductTypeByAll(4)" class="year wh-date fl span-block"></span>
</div> </div>
<div style="margin-top: 40px;" echarts [options]="orderStatisticsByProductTypeAll"></div>
</div> </div>
<div style="margin-top: 20px" echarts [options]="data"></div> </div>
</div> </div>
<!--运营角色-->
<nz-modal [(nzVisible)]="isVisible" nzWidth="1200" nzTitle="订单列表" (nzOnCancel)="isVisible = false" (nzOnOk)="isVisible = false"> <nz-modal [(nzVisible)]="isVisible" nzWidth="1200" nzTitle="订单列表" (nzOnCancel)="isVisible = false" (nzOnOk)="isVisible = false">
<div nz-row> <div nz-row>

@ -5,3 +5,45 @@
.row-bottom { .row-bottom {
margin-bottom: 16px; margin-bottom: 16px;
} }
.date {
float: right;
}
.span-block {
display:block;
margin-left: 10px;
text-align: center;
cursor:pointer;
color: white;
}
.wh-date {
width: 30px;
height: 30px;
border-radius: 4px;
line-height: 30px;
}
.wh-price {
width: 140px;
height: 50px;
line-height: 50px;
font-size: 18px;
}
.day {
background: #f50;
}
.week {
background: #faad14;
}
.month {
background: #2db7f5;
}
.year {
background: #87d068;
}
h3 {
margin-top: 14px;
margin-left: 10px;
}

@ -5,6 +5,8 @@ import {IndexService} from '../../../services/index.service';
import {environment} from '../../../../environments/environment'; import {environment} from '../../../../environments/environment';
import {NzMessageService} from 'ng-zorro-antd'; import {NzMessageService} from 'ng-zorro-antd';
import {Router} from '@angular/router'; import {Router} from '@angular/router';
import {CommonsService} from "../../../services/commons.service";
import {HttpClient , HttpClientJsonpModule} from '@angular/common/http';
@Component({ @Component({
@ -42,21 +44,40 @@ export class IndexComponent implements OnInit {
tyBalance; tyBalance;
webSocket: WebSocket; webSocket: WebSocket;
adminInfoObject: {}; adminInfoObject: {};
// 根据年月日查询总交易金额
orderStatisticsByYMDData: any;
// 查询每日交易总额
orderStatisticsByProductTypeByDay: any;
orderStatisticsByProductTypeAll: any;
constructor( constructor(
private store: LocalStorageService, // 数据缓存 private store: LocalStorageService, // 数据缓存
private http: HttpClient,
private message: NzMessageService, // 信息提示 private message: NzMessageService, // 信息提示
private router: Router, private router: Router,
private index: IndexService private index: IndexService,
private common: CommonsService
) { ) {
} }
ngOnInit(): void { ngOnInit(): void {
this.http.jsonp('/areas_v3/bound/510000_full.json' , 'features').subscribe(data => {
console.log(data);
});
this.adminInfoObject = this.store.get(ADMIN_INFO_OBJECT); this.adminInfoObject = this.store.get(ADMIN_INFO_OBJECT);
this.roleType = this.store.get(ADMIN_INFO_OBJECT)['secRole'].roleType; this.roleType = this.store.get(ADMIN_INFO_OBJECT)['secRole'].roleType;
if (this.roleType === 1) { if (this.roleType === 1) {
this.getIndexCount(); this.getIndexCount();
this.getLineCount(); this.getLineCount();
this.queryCompanyAccountInfo2JD(); this.queryCompanyAccountInfo2JD();
this.orderStatisticsByYMD(1);
this.orderStatisticsByProductType(1);
this.orderStatisticsByProductTypeByAll(3);
} }
if (this.store.get(ADMIN_INFO_OBJECT)['highAgent'] != null) { if (this.store.get(ADMIN_INFO_OBJECT)['highAgent'] != null) {
this.code = this.store.get(ADMIN_INFO_OBJECT)['highAgent'].id; this.code = this.store.get(ADMIN_INFO_OBJECT)['highAgent'].id;
@ -314,5 +335,142 @@ export class IndexComponent implements OnInit {
} }
}).then(r => console.log(r)); }).then(r => console.log(r));
} }
// 查询
public orderStatisticsByYMD(type: number): void {
const queryParams = {
dateType: type,
num: this.common.dateTimeType(type)
};
this.index.orderStatisticsByYMD(queryParams , data => {
if (data['return_code'] === '000000') {
const timeData = [];
const sumData = [];
for (const i of data['return_data']) {
timeData.push(i['time']);
sumData.push(i['sum']);
}
this.orderStatisticsByYMDData = {
title: {
text: this.common.dateType(type) + '总交易额(元)',
},
xAxis: {
type: 'category',
data: timeData
},
yAxis: {
type: 'value'
},
series: [
{
data: sumData,
label: {
show: true,
color: 'black',
position: 'top'
},
type: 'bar',
showBackground: true,
color: '#1890ff',
backgroundStyle: {
color: 'rgba(180, 180, 180, 0.2)'
}
}
]
};
} else {
this.message.error(data['return_msg']);
}
});
}
public orderStatisticsByProductType(type): void {
const queryParams = {
dateType: type,
};
this.index.orderStatisticsByProductType(queryParams , data => {
if (data['return_code'] === '000000') {
const productData = [];
const sumData = [];
for (const i of data['return_data']) {
productData.push(this.common.productType(i['name']));
sumData.push(i['value']);
}
this.orderStatisticsByProductTypeByDay = {
title: {
text: '今日交易总额(元)',
},
xAxis: {
type: 'value'
},
yAxis: {
type: 'category',
data: productData
},
series: [
{
data: sumData,
label: {
show: true,
color: 'black',
position: 'right'
},
type: 'bar',
showBackground: true,
color: '#1890ff',
backgroundStyle: {
color: 'rgba(180, 180, 180, 0.2)'
}
}
]
};
} else {
this.message.error(data['return_msg']);
}
});
}
public orderStatisticsByProductTypeByAll(type): void {
const queryParams = {
dateType: type,
};
this.index.orderStatisticsByProductType(queryParams , data => {
if (data['return_code'] === '000000') {
const dataShow = [];
for (const i of data['return_data']) {
dataShow.push({
name: this.common.productType(i['name']),
value: i['value']
});
}
this.orderStatisticsByProductTypeAll = {
title: {
text: this.common.dateType(type) + '交易占比分布',
left: 'center'
},
tooltip: {
trigger: 'item'
},
series: [
{
name: '交易金额总额(元)',
type: 'pie',
radius: '50%',
data: dataShow,
}
]
};
} else {
this.message.error(data['return_msg']);
}
});
}
} }

@ -5,11 +5,11 @@
<span *ngIf="!isCollapsed">{{userInfo.secRole.roleName}}</span> <span *ngIf="!isCollapsed">{{userInfo.secRole.roleName}}</span>
</div> </div>
<ul nz-menu nzTheme="dark" nzMode="inline" [nzInlineCollapsed]="isCollapsed"> <ul nz-menu nzTheme="dark" nzMode="inline" [nzInlineCollapsed]="isCollapsed">
<li nz-menu-item nz-tooltip nzPlacement="right" (click)="activeLi('index')" [nzSelected]="routeName == 'index' ? true : false" routerLink="/admin/index" [nzTitle]="isCollapsed ? '首页' : ''" > <li nz-menu-item nz-tooltip nzPlacement="right" (click)="activeLi('index')" [nzSelected]="routeName == 'index'" routerLink="/admin/index" [nzTitle]="isCollapsed ? '首页' : ''" >
<i nz-icon nzType="home" nzTheme="outline"></i> <i nz-icon nzType="home" nzTheme="outline"></i>
<span>首页</span> <span>首页</span>
</li> </li>
<li nz-submenu *ngFor="let item of menuList;" (click)="activeLi(item.menuUrl)" [nzOpen]="routeName == item.menuUrl ? true : false" [nzTitle]="titleTpl"> <li nz-submenu *ngFor="let item of menuList;" (click)="activeLi(item.menuUrl)" [nzOpen]="routeName == item.menuUrl" [nzTitle]="titleTpl">
<ng-template #titleTpl><i nz-icon [nzIconfont]="item.menuUrlImg"></i><span>{{item.menuName}}</span></ng-template> <ng-template #titleTpl><i nz-icon [nzIconfont]="item.menuUrlImg"></i><span>{{item.menuName}}</span></ng-template>
<ul *ngFor="let child of item.children"> <ul *ngFor="let child of item.children">
<li nz-menu-item nzMatchRouter> <li nz-menu-item nzMatchRouter>

@ -7,10 +7,10 @@ import {OrderRefundListComponent} from './order-refund-list/order-refund-list.co
import {KfcOrderListComponent} from './kfc-order/kfc-order-list/kfc-order-list.component'; import {KfcOrderListComponent} from './kfc-order/kfc-order-list/kfc-order-list.component';
import {StarbucksOrderListComponent} from './starbucks-order/starbucks-order-list/starbucks-order-list.component'; import {StarbucksOrderListComponent} from './starbucks-order/starbucks-order-list/starbucks-order-list.component';
import {MemberChargeOrderListComponent} from './member-charge-order/member-charge-order-list/member-charge-order-list.component'; import {MemberChargeOrderListComponent} from './member-charge-order/member-charge-order-list/member-charge-order-list.component';
import {OrderHListComponent} from '../order/order-h-list/order-h-list.component';
import {PreOrderComponent} from '../order/pre-order/pre-order.component'; import {PreOrderComponent} from '../order/pre-order/pre-order.component';
import {DiscountUseConditionListComponent} from '../order/discount-use-condition-list/discount-use-condition-list.component'; import {DiscountUseConditionListComponent} from '../order/discount-use-condition-list/discount-use-condition-list.component';
import {DicountPackageOrderListComponent} from '../order/dicount-package-order-list/dicount-package-order-list.component'; import {DicountPackageOrderListComponent} from '../order/dicount-package-order-list/dicount-package-order-list.component';
import {OrderListComponent} from '../recharge-order/order-list/order-list.component';
const routes: Routes = [ const routes: Routes = [
@ -21,7 +21,7 @@ const routes: Routes = [
{ path: 'order-kfc-list', component: KfcOrderListComponent}, { path: 'order-kfc-list', component: KfcOrderListComponent},
{ path: 'order-starbucks--list', component: StarbucksOrderListComponent}, { path: 'order-starbucks--list', component: StarbucksOrderListComponent},
{ path: 'order-member-charge--list', component: MemberChargeOrderListComponent}, { path: 'order-member-charge--list', component: MemberChargeOrderListComponent},
{ path: 'order-h-list', component: OrderHListComponent }, { path: 'mobile-recharge-order-list', component: OrderListComponent },
{ path: 'pre-order', component: PreOrderComponent }, { path: 'pre-order', component: PreOrderComponent },
{ path: 'discount-use-condition-list', component: DiscountUseConditionListComponent }, { path: 'discount-use-condition-list', component: DiscountUseConditionListComponent },
{ path: 'discount-package-order-list', component: DicountPackageOrderListComponent}, { path: 'discount-package-order-list', component: DicountPackageOrderListComponent},

@ -163,6 +163,7 @@
<nz-table <nz-table
class="table" class="table"
#ajaxTable #ajaxTable
nzBordered
nzShowSizeChanger nzShowSizeChanger
[nzFrontPagination]="false" [nzFrontPagination]="false"
[nzData]="requestData" [nzData]="requestData"

@ -35,6 +35,7 @@ registerLocaleData(zh);
ReactiveFormsModule, ReactiveFormsModule,
NavigationModule, NavigationModule,
AppCommonModule, AppCommonModule,
NgxEchartsModule, NgxEchartsModule,
], ],
providers: [ providers: [

@ -13,13 +13,15 @@ export class RechargePayTypePipe implements PipeTransform {
case 2: case 2:
return '微信'; return '微信';
case 3: case 3:
return '汇联通工会卡'; return '积分抵扣';
case 4: case 4:
return '银联'; return '汇联通工会卡';
case 5: case 5:
return '银联';
case 6:
return '银联分期'; return '银联分期';
case null: case null:
return '积分抵扣'; return '未支付';
} }
} }
} }

@ -1,6 +1,6 @@
import {Injectable} from '@angular/core'; import {Injectable} from '@angular/core';
import {LocalStorageService} from './local-storage.service'; import {LocalStorageService} from './local-storage.service';
import {ADMIN_INFO_OBJECT, DATA} from './local-storage.namespace'; import {ADMIN_INFO_OBJECT} from './local-storage.namespace';
import {NzModalService, NzNotificationService} from 'ng-zorro-antd'; import {NzModalService, NzNotificationService} from 'ng-zorro-antd';
import {environment} from '../../environments/environment'; import {environment} from '../../environments/environment';
import {HttpClient} from '@angular/common/http'; import {HttpClient} from '@angular/common/http';
@ -420,4 +420,61 @@ export class CommonsService {
}); });
} }
/**
*
*
* @param type
*/
public dateTimeType(type: number): number {
if (type === 1) {
return new Date().getDay() - 2;
} else if (type === 3) {
return new Date().getMonth() + 1;
} else {
return 100;
}
}
// 根据产品类型返回产品名称
public productType(type: number): string {
switch (type) {
case 1:
return '星巴克';
case 2:
return '肯德基';
case 3:
return '会员充值';
case 4:
return '积分充值';
case 5:
return '购买卡券';
case 6:
return '加油服务';
case 7:
return '优惠券包';
case 8:
return '汇联通充值';
case 9:
return '话费充值';
default:
return '未知';
}
}
// 时间类型转换
public dateType(type: number): string {
switch (type) {
case 1:
return '日';
case 2:
return '周';
case 3:
return '月';
case 4:
return '年';
default:
return '未知';
}
}
} }

@ -217,6 +217,30 @@ export class IndexService {
}); });
} }
/**
* @Author Sum1Dream
* @methodName orderStatisticsByYMD
* @Description //TODO
* @Date 15:56 2022/11/3
* @Param params: object, callBack
*/
public orderStatisticsByYMD(params: object, callBack) {
this.http.get(environment.baseUrl + 'homeOrderStatistics/orderStatisticsByYMD?' + this.common.getWhereCondition(params)).subscribe(data => {
callBack(data);
});
}
/**
* @Author Sum1Dream
* @methodName orderStatisticsByYMD
* @Description //
* @Date 15:56 2022/11/3
* @Param params: object, callBack
*/
public orderStatisticsByProductType(params: object, callBack) {
this.http.get(environment.baseUrl + 'homeOrderStatistics/orderStatisticsByProductType?' + this.common.getWhereCondition(params)).subscribe(data => {
callBack(data);
});
}
} }

@ -5,11 +5,13 @@
export const environment = { export const environment = {
production: false, production: false,
// baseUrl: 'http://localhost:9302/brest/', // 测试环境服务器地址(请求数据地址) // baseUrl: 'http://localhost:9302/brest/', // 测试环境服务器地址(请求数据地址)
orderUrl: 'http://localhost:9304/order/',
// imageUrl: 'https://hsgcs.dctpay.com/filesystem/', // imageUrl: 'https://hsgcs.dctpay.com/filesystem/',
baseUrl: 'https://hsgcs.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址) baseUrl: 'https://hsgcs.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址)
// orderUrl: 'https://hsgcs.dctpay.com/order/', // orderUrl: 'https://hsgcs.dctpay.com/order/',
imageUrl: 'https://hsgcs.dctpay.com/filesystem/', imageUrl: 'https://hsgcs.dctpay.com/filesystem/',
// baseUrl: 'https://hsgcs.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址)
orderUrl: 'https://hsgcs.dctpay.com/order/',
// imageUrl: 'https://hsgcs.dctpay.com/filesystem/',
key: 'https://hsgcs.dctpay.com/phone-recharge-H5/index.html?codeValue=', key: 'https://hsgcs.dctpay.com/phone-recharge-H5/index.html?codeValue=',
inviteUrl: 'https://hsgcs.dctpay.com/wx/?action=ic&id=', inviteUrl: 'https://hsgcs.dctpay.com/wx/?action=ic&id=',
}; };

@ -5,7 +5,7 @@
<title>嗨森逛</title> <title>嗨森逛</title>
<base href="/"> <base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://webapi.amap.com/maps?v=1.4.3&key=3a42e959c2a1e1d76e691bc1cc25a0b0&plugin=AMap.ToolBar,AMap.Autocomplete,AMap.PlaceSearch"></script> <script src="https://qz.dctpay.com/maps?v=1.4.3&key=3a42e959c2a1e1d76e691bc1cc25a0b0&plugin=AMap.ToolBar,AMap.Autocomplete,AMap.PlaceSearch"></script>
<script src="//webapi.amap.com/ui/1.1/main.js"></script> <script src="//webapi.amap.com/ui/1.1/main.js"></script>
<link rel="icon" type="image/x-icon" href="favicon.ico"> <link rel="icon" type="image/x-icon" href="favicon.ico">
</head> </head>

@ -0,0 +1,11 @@
{
"/api":{
"target":"https://geo.datav.aliyun.com",
"secure":false,
"logLevel":"debug",
"changeOrigin":true,
"pathRewrite":{
"^/api":""
}
}
}
Loading…
Cancel
Save