diff --git a/src/app/admin/index/index/index.component.ts b/src/app/admin/index/index/index.component.ts
index 8330c5a..a051195 100644
--- a/src/app/admin/index/index/index.component.ts
+++ b/src/app/admin/index/index/index.component.ts
@@ -35,8 +35,6 @@ export class IndexComponent implements OnInit {
ngOnInit(): void {
this.roleType = this.store.get(ADMIN_INFO_OBJECT)['secRole'].roleType;
- console.log(this.roleType);
-
if (this.roleType === 1) {
this.getIndexCount();
this.getLineCount();
diff --git a/src/app/admin/tuanyou-agent/order-st/order-st.component.html b/src/app/admin/tuanyou-agent/order-st/order-st.component.html
index 82e6e65..b774de4 100644
--- a/src/app/admin/tuanyou-agent/order-st/order-st.component.html
+++ b/src/app/admin/tuanyou-agent/order-st/order-st.component.html
@@ -1 +1,143 @@
-
order-st works!
+
+
+
+ 团油订单统计
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 团油订单金额(元)
+ ¥{{requestData['orderPrice'] == null ? 0 :requestData['orderPrice']}}
+
+
+
+
+ 团油交易金额(元)
+ ¥{{requestData['tradePrice'] == null ? 0 :requestData['tradePrice']}}
+
+
+
+
+ 团油优惠金额(元)
+ ¥{{requestData['discountedPrice'] == null ? 0 :requestData['discountedPrice']}}
+
+
+
+
+ 团油订单数量(笔)
+ {{requestData['orderNum'] == null ? 0 :requestData['orderNum']}}
+
+
+
+
+
+
+
diff --git a/src/app/admin/tuanyou-agent/order-st/order-st.component.spec.ts b/src/app/admin/tuanyou-agent/order-st/order-st.component.spec.ts
deleted file mode 100644
index 9b0f7a3..0000000
--- a/src/app/admin/tuanyou-agent/order-st/order-st.component.spec.ts
+++ /dev/null
@@ -1,25 +0,0 @@
-import { async, ComponentFixture, TestBed } from '@angular/core/testing';
-
-import { OrderStComponent } from './order-st.component';
-
-describe('OrderStComponent', () => {
- let component: OrderStComponent;
- let fixture: ComponentFixture;
-
- beforeEach(async(() => {
- TestBed.configureTestingModule({
- declarations: [ OrderStComponent ]
- })
- .compileComponents();
- }));
-
- beforeEach(() => {
- fixture = TestBed.createComponent(OrderStComponent);
- component = fixture.componentInstance;
- fixture.detectChanges();
- });
-
- it('should create', () => {
- expect(component).toBeTruthy();
- });
-});
diff --git a/src/app/admin/tuanyou-agent/order-st/order-st.component.ts b/src/app/admin/tuanyou-agent/order-st/order-st.component.ts
index 765a103..875f1a7 100644
--- a/src/app/admin/tuanyou-agent/order-st/order-st.component.ts
+++ b/src/app/admin/tuanyou-agent/order-st/order-st.component.ts
@@ -1,15 +1,230 @@
-import { Component, OnInit } from '@angular/core';
+import {Component, OnInit} from '@angular/core';
+import {FormBuilder, FormGroup} from '_@angular_forms@9.0.7@@angular/forms';
+import {AuditService} from '../../../services/audit.service';
+import {IconService} from '../../../services/icon.service';
+import {NzMessageService} from '_ng-zorro-antd@9.3.0@ng-zorro-antd';
+import {CommonsService} from '../../../services/commons.service';
+import {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace';
+import {LocalStorageService} from '../../../services/local-storage.service';
+import {TyAgentService} from '../../../services/ty-agent.service';
+import {TySalesmanService} from '../../../services/ty-salesman.service';
+import {OrderService} from '../../../services/order.service';
@Component({
- selector: 'app-order-st',
- templateUrl: './order-st.component.html',
- styleUrls: ['./order-st.component.scss']
+ selector: 'app-order-st',
+ templateUrl: './order-st.component.html',
+ styleUrls: ['./order-st.component.scss']
})
export class OrderStComponent implements OnInit {
+ searchForm: FormGroup; // 搜索框
+ loading = true;
+ requestData = {}; // 列表数据
+ roleType: number; // 角色类型
+ adminFlag: number; // 是否主角色 1 是 0 不是
+ companyData = [];
+ agentData = [];
+ salesmanData = [];
+ priceData: any = {};
+ payTypeData: any = {};
+ gasOilNoData: any = {};
- constructor() { }
+ constructor(
+ private form: FormBuilder,
+ private audit: AuditService,
+ private iconService: IconService,
+ private message: NzMessageService,
+ private store: LocalStorageService, // 数据缓存
+ private order: OrderService,
+ private tyAgentService: TyAgentService,
+ private tySalesmanService: TySalesmanService,
+ private common: CommonsService,
+ ) {
+ }
- ngOnInit(): void {
- }
+ ngOnInit(): void {
+ this.roleType = this.store.get(ADMIN_INFO_OBJECT)['secRole']['roleType'];
+ this.adminFlag = this.store.get(ADMIN_INFO_OBJECT)['secUser']['adminFlag'];
+ this.searchForm = this.form.group({
+ createTime: [null],
+ organizationId: [null],
+ agentId: [null],
+ gasSalesmanId: [null],
+ payType: [null],
+ gasOilNo: [null],
+ gasOilType: [null],
+ });
+ this.getRequest(true, this.searchForm.value);
+
+ if (this.adminFlag == 1 && this.roleType == 5) {
+ const object = {
+ companyId: this.store.get(ADMIN_INFO_OBJECT)['bsCompany'].id,
+ };
+ this.common.getOrganizationList(object, data => {
+ if (data['return_code'] === '000000') {
+ this.companyData = data['return_data'];
+ } else {
+ this.message.error('查询公司失败');
+ }
+ });
+ } else if (this.adminFlag == 0 && this.roleType == 5) {
+ this.getAgentList(this.store.get(ADMIN_INFO_OBJECT)['bsOrganization']['id']);
+ } else if (this.roleType == 8) {
+ this.getSalesmanList(this.store.get(ADMIN_INFO_OBJECT)['highTyAgent']['id']);
+ }
+
+ }
+
+ // 查询列表
+ public getRequest(reset: boolean = false, whereObject: object) {
+ this.loading = true;
+ if (whereObject['createTime'] != null && whereObject['createTime'].length !== 0) {
+ whereObject['createTimeS'] = whereObject['createTime'][0].getTime();
+ whereObject['createTimeE'] = whereObject['createTime'][1].getTime();
+ }
+
+ if (this.roleType == 5 && this.adminFlag == 0) {
+ console.log(this.store.get(ADMIN_INFO_OBJECT));
+ whereObject['organizationId'] = this.store.get(ADMIN_INFO_OBJECT)['bsOrganization']['id'];
+ }
+ if (this.roleType == 8) {
+ whereObject['agentId'] = this.store.get(ADMIN_INFO_OBJECT)['highTyAgent']['id'];
+ }
+ if (this.roleType == 9) {
+ whereObject['gasSalesmanId'] = this.store.get(ADMIN_INFO_OBJECT)['highTySalesman']['id'];
+ }
+
+ this.order.TyOrderStatistics(whereObject, data => {
+ this.loading = false;
+ if (data['return_code'] === '000000') {
+ this.requestData = data['return_data'];
+ this.getPieChart(this.requestData);
+ } else {
+ this.message.error(data['return_msg']);
+ }
+ });
+
+ }
+
+ // 重置
+ public resetForm(): void {
+ this.searchForm.reset();
+ }
+
+ // 查询代理商
+ public getAgentList(e): void {
+ if (e != null) {
+ const object = {
+ orgId: e,
+ pageNum: 1,
+ pageSize: 10000
+ };
+ this.tyAgentService.getAgentList(object, data => {
+ if (data['return_code'] === '000000') {
+ this.agentData = data['return_data'].list;
+ } else {
+ this.message.error('查询代理商失败');
+ }
+ });
+ }
+ }
+
+ // 查询业务员
+ public getSalesmanList(e): void {
+ if (e != null) {
+ const object = {
+ tyAgentId: e,
+ pageNum: 1,
+ pageSize: 10000
+ };
+ this.tySalesmanService.getSalesmanList(object, data => {
+ if (data['return_code'] === '000000') {
+ this.salesmanData = data['return_data'].list;
+ } else {
+ this.message.error('查询代理商失败');
+ }
+ });
+ }
+
+ }
+
+
+ // 饼状图
+ public getPieChart(data) {
+ // 交易金额分布图
+ this.priceData = {
+ title: {
+ text: '交易金额分布图',
+ left: 'center'
+ },
+ tooltip: {
+ trigger: 'item'
+ },
+ series: [
+ {
+ name: '金额分布',
+ type: 'pie',
+ radius: '50%',
+ data: data['priceGorp'],
+ emphasis: {
+ itemStyle: {
+ shadowBlur: 10,
+ shadowOffsetX: 0,
+ shadowColor: 'rgba(0, 0, 0, 0.5)'
+ }
+ }
+ }
+ ]
+ };
+ // 交易金额分布图
+ this.payTypeData = {
+ title: {
+ text: '交易方式分布图',
+ left: 'center'
+ },
+ tooltip: {
+ trigger: 'item'
+ },
+ series: [
+ {
+ name: '交易方式分布',
+ type: 'pie',
+ radius: '50%',
+ data: data['payTypeGorp'],
+ emphasis: {
+ itemStyle: {
+ shadowBlur: 10,
+ shadowOffsetX: 0,
+ shadowColor: 'rgba(0, 0, 0, 0.5)'
+ }
+ }
+ }
+ ]
+ };
+ // 交易金额分布图
+ this.gasOilNoData = {
+ title: {
+ text: '交易类型分布图',
+ left: 'center'
+ },
+ tooltip: {
+ trigger: 'item'
+ },
+ series: [
+ {
+ name: '交易类型分布',
+ type: 'pie',
+ radius: '50%',
+ data: data['gasOilNoGorp'],
+ emphasis: {
+ itemStyle: {
+ shadowBlur: 10,
+ shadowOffsetX: 0,
+ shadowColor: 'rgba(0, 0, 0, 0.5)'
+ }
+ }
+ }
+ ]
+ };
+ }
}
diff --git a/src/app/admin/tuanyou-agent/tuanyou-agent-routing.module.ts b/src/app/admin/tuanyou-agent/tuanyou-agent-routing.module.ts
index f7ccb27..a712819 100644
--- a/src/app/admin/tuanyou-agent/tuanyou-agent-routing.module.ts
+++ b/src/app/admin/tuanyou-agent/tuanyou-agent-routing.module.ts
@@ -6,6 +6,7 @@ import {TySalesmanListComponent} from './ty-salesman/ty-salesman-list/ty-salesma
import {TySalesmanEditComponent} from './ty-salesman/ty-salesman-edit/ty-salesman-edit.component';
import {PetrolStationManageComponent} from './petrol-station-manage/petrol-station-manage';
import {TyOrderListComponent} from './order/ty-order-list/ty-order-list.component';
+import {OrderStComponent} from './order-st/order-st.component';
const routes: Routes = [
{ path: 'agent-edit', component: TyAgentEditComponent },
@@ -14,6 +15,7 @@ const routes: Routes = [
{ path: 'salesman-edit', component: TySalesmanEditComponent },
{ path: 'petrol-station', component: PetrolStationManageComponent },
{ path: 'order-list', component: TyOrderListComponent },
+ { path: 'order-st', component: OrderStComponent },
];
@NgModule({
diff --git a/src/app/admin/tuanyou-agent/tuanyou-agent.module.ts b/src/app/admin/tuanyou-agent/tuanyou-agent.module.ts
index cc6de6b..cd08b78 100644
--- a/src/app/admin/tuanyou-agent/tuanyou-agent.module.ts
+++ b/src/app/admin/tuanyou-agent/tuanyou-agent.module.ts
@@ -13,17 +13,19 @@ import { TySalesmanListComponent } from './ty-salesman/ty-salesman-list/ty-sales
import { TySalesmanEditComponent } from './ty-salesman/ty-salesman-edit/ty-salesman-edit.component';
import { OrderStComponent } from './order-st/order-st.component';
import { TyOrderListComponent } from './order/ty-order-list/ty-order-list.component';
+import {NgxEchartsModule} from '_ngx-echarts@4.2.2@ngx-echarts';
@NgModule({
declarations: [PetrolStationManageComponent, TyAgentListComponent, TyAgentEditComponent, TySalesmanListComponent, TySalesmanEditComponent, OrderStComponent, TyOrderListComponent],
- imports: [
- CommonModule,
- TuanyouAgentRoutingModule,
- NgZorroAntdModule,
- ReactiveFormsModule,
- FormsModule,
- BreadcrumbModule,
- AppCommonModule,
- ]
+ imports: [
+ CommonModule,
+ TuanyouAgentRoutingModule,
+ NgZorroAntdModule,
+ ReactiveFormsModule,
+ FormsModule,
+ BreadcrumbModule,
+ AppCommonModule,
+ NgxEchartsModule,
+ ]
})
export class TuanyouAgentModule { }
diff --git a/src/app/services/Interceptor.service.ts b/src/app/services/Interceptor.service.ts
index 9197934..957b29e 100644
--- a/src/app/services/Interceptor.service.ts
+++ b/src/app/services/Interceptor.service.ts
@@ -35,7 +35,6 @@ export class InterceptorService implements HttpInterceptor {
.pipe(
catchError((res: HttpResponse) => {
let msg = '';
- console.log(res);
switch (res.status) {
case 401:
msg = '身份验证过期,请重新进入页面';
diff --git a/src/app/services/commons.service.ts b/src/app/services/commons.service.ts
index 3296637..cecb47c 100644
--- a/src/app/services/commons.service.ts
+++ b/src/app/services/commons.service.ts
@@ -343,4 +343,16 @@ export class CommonsService {
callBack(data);
});
}
+
+ /**
+ * 查询公司
+ * @param param 参数
+ * @param callback 回调
+ */
+ public getOrganizationList(param: object, callback): any {
+ this.http.get(environment.baseUrl + 'bsOrganization/getOrganizationList?' + this.getWhereCondition(param)).subscribe( data => {
+ callback(data);
+ });
+ }
+
}
diff --git a/src/app/services/order.service.ts b/src/app/services/order.service.ts
index 87e0c15..977ba3b 100644
--- a/src/app/services/order.service.ts
+++ b/src/app/services/order.service.ts
@@ -220,4 +220,17 @@ export class OrderService {
});
}
+ /**
+ * 请求团油统计
+ *
+ * @param params 上传对象
+ * @param callBack 回调
+ * @return data 返回结果
+ */
+ public TyOrderStatistics(params: object, callBack) {
+ this.http.post(environment.baseUrl + 'highOrder/TyOrderStatistics', params).subscribe(data => {
+ callBack(data);
+ });
+ }
+
}