diff --git a/src/app/admin/index/index/index.component.less b/src/app/admin/index/index/index.component.less
index cb1e546..904d3b2 100644
--- a/src/app/admin/index/index/index.component.less
+++ b/src/app/admin/index/index/index.component.less
@@ -5,3 +5,45 @@
.row-bottom {
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;
+}
diff --git a/src/app/admin/index/index/index.component.ts b/src/app/admin/index/index/index.component.ts
index a3411cc..01d7cab 100644
--- a/src/app/admin/index/index/index.component.ts
+++ b/src/app/admin/index/index/index.component.ts
@@ -5,6 +5,7 @@ import {IndexService} from '../../../services/index.service';
import {environment} from '../../../../environments/environment';
import {NzMessageService} from 'ng-zorro-antd';
import {Router} from '@angular/router';
+import {CommonsService} from "../../../services/commons.service";
@Component({
@@ -42,11 +43,18 @@ export class IndexComponent implements OnInit {
tyBalance;
webSocket: WebSocket;
adminInfoObject: {};
+
+ // 根据年月日查询总交易金额
+ orderStatisticsByYMDData: any;
+ // 查询每日交易总额
+ orderStatisticsByProductTypeByDay: any;
+ orderStatisticsByProductTypeAll: any;
constructor(
private store: LocalStorageService, // 数据缓存
private message: NzMessageService, // 信息提示
private router: Router,
- private index: IndexService
+ private index: IndexService,
+ private common: CommonsService
) {
}
@@ -57,6 +65,9 @@ export class IndexComponent implements OnInit {
this.getIndexCount();
this.getLineCount();
this.queryCompanyAccountInfo2JD();
+ this.orderStatisticsByYMD(1);
+ this.orderStatisticsByProductType(1);
+ this.orderStatisticsByProductTypeByAll(3);
}
if (this.store.get(ADMIN_INFO_OBJECT)['highAgent'] != null) {
this.code = this.store.get(ADMIN_INFO_OBJECT)['highAgent'].id;
@@ -314,5 +325,142 @@ export class IndexComponent implements OnInit {
}
}).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']);
+ }
+ });
+ }
}
diff --git a/src/app/admin/navigation/navigation.component.html b/src/app/admin/navigation/navigation.component.html
index a85efac..b0a960d 100644
--- a/src/app/admin/navigation/navigation.component.html
+++ b/src/app/admin/navigation/navigation.component.html
@@ -5,11 +5,11 @@
{{userInfo.secRole.roleName}}
- -
+
-
首页
- -
+
-
{{item.menuName}}
-
diff --git a/src/app/admin/order-manage/order-manage-routing.module.ts b/src/app/admin/order-manage/order-manage-routing.module.ts
index f0c21ed..40cec00 100644
--- a/src/app/admin/order-manage/order-manage-routing.module.ts
+++ b/src/app/admin/order-manage/order-manage-routing.module.ts
@@ -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 {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 {OrderHListComponent} from '../order/order-h-list/order-h-list.component';
import {PreOrderComponent} from '../order/pre-order/pre-order.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 {OrderListComponent} from '../recharge-order/order-list/order-list.component';
const routes: Routes = [
@@ -21,7 +21,7 @@ const routes: Routes = [
{ path: 'order-kfc-list', component: KfcOrderListComponent},
{ path: 'order-starbucks--list', component: StarbucksOrderListComponent},
{ 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: 'discount-use-condition-list', component: DiscountUseConditionListComponent },
{ path: 'discount-package-order-list', component: DicountPackageOrderListComponent},
diff --git a/src/app/admin/recharge-order/order-list/order-list.component.html b/src/app/admin/recharge-order/order-list/order-list.component.html
index b6348f3..f767ff7 100644
--- a/src/app/admin/recharge-order/order-list/order-list.component.html
+++ b/src/app/admin/recharge-order/order-list/order-list.component.html
@@ -163,6 +163,7 @@
{
+ 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);
+ });
+ }
}
diff --git a/src/environments/environment.ts b/src/environments/environment.ts
index 7a35916..264e5d9 100644
--- a/src/environments/environment.ts
+++ b/src/environments/environment.ts
@@ -4,11 +4,11 @@
export const environment = {
production: false,
- // baseUrl: 'http://localhost:9302/brest/', // 测试环境服务器地址(请求数据地址)
- // orderUrl: 'http://localhost:9304/order/',
+ baseUrl: 'http://localhost:9302/brest/', // 测试环境服务器地址(请求数据地址)
+ orderUrl: 'http://localhost:9304/order/',
// imageUrl: 'https://hsgcs.dctpay.com/filesystem/',
- baseUrl: 'https://hsgcs.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址)
- orderUrl: 'https://hsgcs.dctpay.com/order/',
+ // 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=',
inviteUrl: 'https://hsgcs.dctpay.com/wx/?action=ic&id=',