diff --git a/angular.json b/angular.json index cc4e66b..218e30d 100644 --- a/angular.json +++ b/angular.json @@ -131,7 +131,8 @@ "serve": { "builder": "@angular-devkit/build-angular:dev-server", "options": { - "browserTarget": "high-web:build" + "browserTarget": "high-web:build", + "proxyConfig":"proxy.conf.json" }, "configurations": { "production": { diff --git a/src/app/admin/index/index-routing.module.ts b/src/app/admin/index/index-routing.module.ts index 74da3ab..9dd1c26 100644 --- a/src/app/admin/index/index-routing.module.ts +++ b/src/app/admin/index/index-routing.module.ts @@ -2,11 +2,13 @@ import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; import {IndexComponent} from './index/index.component'; import {TestComponent} from './test/test.component'; +import {OrderStatisticsComponent} from './order-statistics/order-statistics.component'; const routes: Routes = [ { path: '', component: IndexComponent }, - { path: 'test', component: TestComponent } + { path: 'test', component: TestComponent }, + { path: 'order-statistics', component: OrderStatisticsComponent } ]; @NgModule({ diff --git a/src/app/admin/index/index.module.ts b/src/app/admin/index/index.module.ts index dcb69aa..8f89def 100644 --- a/src/app/admin/index/index.module.ts +++ b/src/app/admin/index/index.module.ts @@ -14,11 +14,12 @@ import {RegionSelectorModule} from '../../common/region-selector/region-selector import {AppCommonModule} from '../../app-common.module'; import { TestComponent } from './test/test.component'; import {NzSpaceModule} from 'ng-zorro-antd/space'; +import { OrderStatisticsComponent } from './order-statistics/order-statistics.component'; @NgModule({ - declarations: [IndexComponent, TestComponent], + declarations: [IndexComponent, TestComponent, OrderStatisticsComponent], imports: [ CommonModule, SystemRoutingModule, diff --git a/src/app/admin/index/index/index.component.html b/src/app/admin/index/index/index.component.html index 5d24a5d..e0f1fa8 100644 --- a/src/app/admin/index/index/index.component.html +++ b/src/app/admin/index/index/index.component.html @@ -132,41 +132,44 @@
-
-
- -

{{item['accountBalance']}}

-
-
-
- -

{{countData['registrantNum']}}

-
-
-
- -

{{countData['transactionNum']}}

-
+
+
+
+ + + +
+
-
- -

{{countData['transactionOrder']}}

-
+
+
+
+

注册总人数

+ {{countData['registrantNum']}} +

总交易金额(元)

+ {{countData['transactionNum']}} +

总交易订单数量

+ {{countData['transactionOrder']}}
-
- -

{{countData['transactionToday']}}

-
+
+
-
- -

{{countData['transactionOrderToday']}}

-
+
+
+ + + + +
+
-
+
+ + +
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..ce5dc2b 100644 --- a/src/app/admin/index/index/index.component.ts +++ b/src/app/admin/index/index/index.component.ts @@ -5,6 +5,8 @@ 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"; +import {HttpClient , HttpClientJsonpModule} from '@angular/common/http'; @Component({ @@ -42,21 +44,40 @@ export class IndexComponent implements OnInit { tyBalance; webSocket: WebSocket; adminInfoObject: {}; + + // 根据年月日查询总交易金额 + orderStatisticsByYMDData: any; + // 查询每日交易总额 + orderStatisticsByProductTypeByDay: any; + orderStatisticsByProductTypeAll: any; constructor( private store: LocalStorageService, // 数据缓存 + private http: HttpClient, private message: NzMessageService, // 信息提示 private router: Router, - private index: IndexService + private index: IndexService, + private common: CommonsService ) { } 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.roleType = this.store.get(ADMIN_INFO_OBJECT)['secRole'].roleType; if (this.roleType === 1) { 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 +335,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 9e974d4..433def0 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -5,11 +5,13 @@ export const environment = { production: false, // 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/', 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=', inviteUrl: 'https://hsgcs.dctpay.com/wx/?action=ic&id=', }; diff --git a/src/index.html b/src/index.html index 7e90525..c50cc83 100644 --- a/src/index.html +++ b/src/index.html @@ -5,7 +5,7 @@ 嗨森逛 - + diff --git a/src/proxy.conf.json b/src/proxy.conf.json new file mode 100644 index 0000000..f0fcba4 --- /dev/null +++ b/src/proxy.conf.json @@ -0,0 +1,11 @@ +{ + "/api":{ + "target":"https://geo.datav.aliyun.com", + "secure":false, + "logLevel":"debug", + "changeOrigin":true, + "pathRewrite":{ + "^/api":"" + } + } +}