|
|
@ -5,6 +5,7 @@ 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"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Component({ |
|
|
|
@Component({ |
|
|
@ -42,11 +43,18 @@ 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 message: NzMessageService, // 信息提示
|
|
|
|
private message: NzMessageService, // 信息提示
|
|
|
|
private router: Router, |
|
|
|
private router: Router, |
|
|
|
private index: IndexService |
|
|
|
private index: IndexService, |
|
|
|
|
|
|
|
private common: CommonsService |
|
|
|
) { |
|
|
|
) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -57,6 +65,9 @@ export class IndexComponent implements OnInit { |
|
|
|
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 +325,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']); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|