From bf3a35390d000958592acd3be5e6beeb940acdba Mon Sep 17 00:00:00 2001 From: yuanye <418471657@qq.com> Date: Thu, 15 Aug 2024 09:42:38 +0800 Subject: [PATCH] 1 --- src/app/data/goods/goods.namespace.ts | 1 + src/app/pages/body/index/index.component.html | 57 +++++++++ src/app/pages/body/index/index.component.less | 3 + src/app/pages/body/index/index.component.ts | 116 +++++++++++++++++- .../goods-list/goods-list.component.html | 99 +++++++++------ .../goods-list/goods-list.component.less | 3 +- .../trade/goods-list/goods-list.component.ts | 49 +++++++- .../goods-logistics-list.component.html | 101 ++++++++------- .../goods-logistics-list.component.ts | 29 ++++- src/app/pipes/common/data-utils.pipe.ts | 16 +++ src/app/pipes/file/business-type.pipe.ts | 30 +++++ src/app/pipes/file/status.pipe.ts | 22 ++++ .../services/common/communication.service.ts | 17 +++ src/app/services/common/icon.service.ts | 2 +- src/app/services/file/file.service.ts | 41 +++++++ src/app/services/trade/order-goods.service.ts | 11 ++ src/environments/environment.ts | 18 +-- 17 files changed, 515 insertions(+), 100 deletions(-) create mode 100644 src/app/pipes/common/data-utils.pipe.ts create mode 100644 src/app/pipes/file/business-type.pipe.ts create mode 100644 src/app/pipes/file/status.pipe.ts create mode 100644 src/app/services/common/communication.service.ts create mode 100644 src/app/services/file/file.service.ts diff --git a/src/app/data/goods/goods.namespace.ts b/src/app/data/goods/goods.namespace.ts index 427ceff..7c485b4 100644 --- a/src/app/data/goods/goods.namespace.ts +++ b/src/app/data/goods/goods.namespace.ts @@ -2,6 +2,7 @@ export const fallbackImg = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7Dkgd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4p/cPzLly/dtv9Ts/EbcvGAHhHyfBIhZ6NSiIBTo0LNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg=='; export const logisticsStatus = [ + {name: "待发货" , key: "待发货"} , {name: "派件中" , key: "DELIVERING"} , {name: "运输中" , key: "TRANSPORT"}, {name: "已代签收" , key: "AGENT_SIGN"}, diff --git a/src/app/pages/body/index/index.component.html b/src/app/pages/body/index/index.component.html index c17ef31..3e980c8 100644 --- a/src/app/pages/body/index/index.component.html +++ b/src/app/pages/body/index/index.component.html @@ -14,6 +14,7 @@
+
{{userInfo['userName']}} @@ -24,7 +25,29 @@
+
+ + + +
+ + + + + + {{item.title}} + + 失败 + + + + 查看更多记录 + + +
+
+
@@ -52,6 +75,40 @@ + + + + + + + 序号 + 文件名称 + 下载来源 + 申请时间 + 下载时间 + 状态 + 操作 + + + + + {{ i + 1 }} + {{ data.title }} + {{ data.businessType | businessType }} + {{ data.createTime | date: 'yyyy-MM-dd HH:mm:ss'}} + {{ data.downloadTime | date: 'yyyy-MM-dd HH:mm:ss'}} + {{ data.status | status}} + + 下载 + 重新下载 + + + + + + + diff --git a/src/app/pages/body/index/index.component.less b/src/app/pages/body/index/index.component.less index 735b7cf..b14d3f5 100644 --- a/src/app/pages/body/index/index.component.less +++ b/src/app/pages/body/index/index.component.less @@ -67,3 +67,6 @@ nz-content { } } +.file-downLoad { + width: 300px; +} diff --git a/src/app/pages/body/index/index.component.ts b/src/app/pages/body/index/index.component.ts index c5c2aa8..b0d5a55 100644 --- a/src/app/pages/body/index/index.component.ts +++ b/src/app/pages/body/index/index.component.ts @@ -1,4 +1,4 @@ -import { Component } from '@angular/core'; +import {AfterViewInit, Component} from '@angular/core'; import {Router, RouterLink, RouterOutlet} from "@angular/router"; import { NzContentComponent, @@ -10,7 +10,7 @@ import { import {NzBreadCrumbComponent, NzBreadCrumbItemComponent} from "ng-zorro-antd/breadcrumb"; import {NzColDirective, NzRowDirective} from "ng-zorro-antd/grid"; import {NzMenuDirective, NzMenuGroupComponent, NzMenuItemComponent, NzSubMenuComponent} from "ng-zorro-antd/menu"; -import {NgClass, NgForOf} from "@angular/common"; +import {DatePipe, NgClass, NgForOf, NgIf} from "@angular/common"; import {NzIconDirective} from "ng-zorro-antd/icon"; import {NzTabComponent, NzTabSetComponent} from "ng-zorro-antd/tabs"; import {TabComponent} from "../tab/tab.component"; @@ -22,6 +22,22 @@ import {Dictionary, dictionaryData} from "../../../data/common/dictionary.namesp import {CommonService} from "../../../services/common/common.service"; import {LoginService} from "../../../services/login/login.service"; import {NzConfigService} from "ng-zorro-antd/core/config"; +import {NzPopoverDirective} from "ng-zorro-antd/popover"; +import {NzListItemComponent, NzListItemMetaComponent, NzListModule} from "ng-zorro-antd/list"; +import {NzTypographyComponent} from "ng-zorro-antd/typography"; +import {IconService} from "../../../services/common/icon.service"; +import {FileService} from "../../../services/file/file.service"; +import {DataUtilsPipe} from "../../../pipes/common/data-utils.pipe"; +import {GoodsListComponent} from "../../trade/goods-list/goods-list.component"; +import {Subject} from "rxjs"; +import {CommunicationService} from "../../../services/common/communication.service"; +import {NzModalComponent, NzModalContentDirective, NzModalModule} from "ng-zorro-antd/modal"; +import {NzResultComponent} from "ng-zorro-antd/result"; +import {NzSpinComponent} from "ng-zorro-antd/spin"; +import {NzTimelineComponent, NzTimelineItemComponent} from "ng-zorro-antd/timeline"; +import {NzTableComponent, NzTableModule} from "ng-zorro-antd/table"; +import {BusinessTypePipe} from "../../../pipes/file/business-type.pipe"; +import {StatusPipe} from "../../../pipes/file/status.pipe"; @Component({ selector: 'app-index', @@ -37,6 +53,7 @@ import {NzConfigService} from "ng-zorro-antd/core/config"; NzRowDirective, NzColDirective, NzMenuItemComponent, + NzModalModule, NzMenuDirective, RouterLink, NzSubMenuComponent, @@ -44,12 +61,31 @@ import {NzConfigService} from "ng-zorro-antd/core/config"; NgClass, NzIconDirective, NzTabComponent, + NzListModule, NzTabSetComponent, TabComponent, NzSiderComponent, NzMenuGroupComponent, NzDropDownDirective, - NzDropdownMenuComponent + NzDropdownMenuComponent, + NgIf, + NzPopoverDirective, + NzListItemComponent, + NzListItemMetaComponent, + NzTypographyComponent, + NzTableModule, + DataUtilsPipe, + GoodsListComponent, + DatePipe, + NzModalComponent, + NzResultComponent, + NzSpinComponent, + NzTimelineComponent, + NzTimelineItemComponent, + NzTableComponent, + NzModalContentDirective, + BusinessTypePipe, + StatusPipe ], templateUrl: './index.component.html', styleUrl: './index.component.less', @@ -60,22 +96,39 @@ export class IndexComponent { 'menuName' : '首页', 'selected' : true, }]; + // 表单页数 + tablePageNum = 1; + // 表单数据 + tableData: any; userInfo: any; // 左侧菜单栏数据 leftMenuData: any = []; // 侧边菜单展示开关 isCollapse = true; + loading = false; + isVisible = false; // 当前顶级菜单 currentParentMenu: any = {}; - + downloadType = 1; + interval: any; constructor( private commonService: CommonService, private storage: BrowserStorageService, + private communicationService: CommunicationService, private nzConfigService: NzConfigService, + private iconService: IconService, + private fileService: FileService, private message: NzMessageService, private router: Router, // 路由 private login: LoginService ) { + + this.communicationService.currentMessage.subscribe(message => { + this.fileRecords(); + this.findFileRecords(message.id); + this.downloadType = 2; + }); + this.nzConfigService.set('button', { nzSize: 'large' }) this.nzConfigService.set('treeSelect', { nzSize: 'large' }) // 缓存数据字典 @@ -99,6 +152,7 @@ export class IndexComponent { this.menuData = this.menuData.concat(this.storage.get(DATA)['menuTree']); this.userInfo = this.storage.get(DATA)['account']; + this.fileRecords(); } // 选择操作 @@ -131,4 +185,58 @@ export class IndexComponent { } }); } + + // 弹出下载记录 + public getFileRecords() { + this.loading = true; + this.isVisible = true; + } + + // 查询下载记录 + public fileRecords() { + let searchForm = { + time: new Date().getTime() + } + + this.fileService.getFileRecordsList(searchForm , (data: any) => { + if (data['return_code'] == '000000') { + this.tableData = data['return_data']; + } else { + this.message.error(data['return_msg']); + } + this.loading = false; + }); + } + + // 查询详情 + public findFileRecords(id: number) { + this.interval = setInterval(() => this.fileService.findFileRecords(id, (data: any) => { + if (data['return_code'] == '000000') { + if (data['return_data'].status == 1) { + clearTimeout(this.interval); + console.log("完成"); + this.downloadType = 1; + this.fileRecords(); + } + }else { + clearTimeout(this.interval); + this.fileRecords(); + this.downloadType = 1; + } + }), 1000); + + + + } + + // 下载 + public getDownLoad(id: number) { + this.fileService.getDownLoad(id, (data: any) => { + if (data['return_code'] == '000000') { + window.location.href = data['return_data']; + }else { + this.message.error(data['return_msg']); + } + }) + } } diff --git a/src/app/pages/trade/goods-list/goods-list.component.html b/src/app/pages/trade/goods-list/goods-list.component.html index 78ad508..3aba1ad 100644 --- a/src/app/pages/trade/goods-list/goods-list.component.html +++ b/src/app/pages/trade/goods-list/goods-list.component.html @@ -1,18 +1,21 @@
+
- 商品名称 + 物流订单号 - +
- 物流订单号 + 物流状态 - + + +
@@ -25,6 +28,34 @@
+ + 创建时间 + + + + +
+
+ + 商户 + + + + + + +
+
+ + 商品名称 + + + + +
+ + +
子订单号 @@ -32,7 +63,7 @@
-
+
用户手机号 @@ -41,7 +72,7 @@
-
+
商品分类 @@ -54,7 +85,7 @@
-
+
商品品牌 @@ -65,17 +96,8 @@
-
- - 物流状态 - - - - - - -
-
+ +
支付类型 @@ -85,7 +107,7 @@
-
+
支付状态 @@ -95,18 +117,17 @@
-
- - 创建时间 - - - - +
+
@@ -134,9 +155,9 @@ 物流单号 创建时间 更新时间 - 支付类型 - 支付状态 - 物流状态 + 支付类型 + 支付状态 + 物流状态 操作 @@ -162,6 +183,8 @@ {{data.status | orderChildStatus}} + + @@ -205,15 +228,15 @@ - - - - - - - - - + + + + + + + + + diff --git a/src/app/pages/trade/goods-list/goods-list.component.less b/src/app/pages/trade/goods-list/goods-list.component.less index 4056a86..1190184 100644 --- a/src/app/pages/trade/goods-list/goods-list.component.less +++ b/src/app/pages/trade/goods-list/goods-list.component.less @@ -1,6 +1,7 @@ .search-area { + margin-top: 20px; margin-bottom: 10px; } .search-area button { - margin-right: 8px; + margin-right: 14px; } diff --git a/src/app/pages/trade/goods-list/goods-list.component.ts b/src/app/pages/trade/goods-list/goods-list.component.ts index bc6d458..18193fc 100644 --- a/src/app/pages/trade/goods-list/goods-list.component.ts +++ b/src/app/pages/trade/goods-list/goods-list.component.ts @@ -1,4 +1,4 @@ -import { Component } from '@angular/core'; +import {Component, Output} from '@angular/core'; import {DatePipe, NgClass, NgForOf, NgIf} from "@angular/common"; import {FormGroup, FormsModule, NonNullableFormBuilder, ReactiveFormsModule} from "@angular/forms"; import {NzButtonComponent} from "ng-zorro-antd/button"; @@ -41,6 +41,12 @@ import {NzRadioButtonDirective, NzRadioComponent, NzRadioGroupComponent} from "n import {PayTypePipe} from "../../../pipes/goods/pay-type.pipe"; import {IconService} from "../../../services/common/icon.service"; import {OrderChildStatusPipe} from "../../../pipes/goods/order-child-status.pipe"; +import {DATA} from "../../../data/login/localStorage.namespace"; +import {BrowserStorageService} from "../../../utils/localStorage.service"; +import {MerService} from "../../../services/merchant/mer.service"; +import EventEmitter from "node:events"; +import {Subject} from "rxjs"; +import {CommunicationService} from "../../../services/common/communication.service"; @Component({ selector: 'app-goods-list', @@ -124,19 +130,28 @@ export class GoodsListComponent { logisticsTraceDetails: any; goodsOrderId: any; deliveryAddress: any; - + // 更多查询条件 + isCollapse = false; + merData: any; + objectType: any; protected readonly fallbackImg = fallbackImg; protected readonly logisticsStatus = logisticsStatus; protected readonly orderGoodsChild = orderGoodsChild; + protected readonly orderPayType = orderPayType; constructor(private fb: NonNullableFormBuilder, private msg: NzMessageService, + private storage: BrowserStorageService, + private communicationService: CommunicationService, + private merService: MerService, private iconService: IconService, private orderGoodsService: OrderGoodsService, private goodsService: GoodsService) { + + // 初始化搜索框 this.searchForm = this.fb.group({ logisticsNo: [''], @@ -145,6 +160,7 @@ export class GoodsListComponent { logisticsStatus: [''], goodsType: [''], goodsBrand: [''], + merId: [''], userPhone: [''], goodsSpecsName: [''], createTimeArray: [[]], @@ -158,7 +174,22 @@ export class GoodsListComponent { this.getRequest(); this.getGoodsTypeNode(); this.getGoodsBrandNode(); + this.merList(); + this.objectType = this.storage.get(DATA)['account']['objectType']; + } + // 查询商户 + public merList() { + let params: any = { + pageNum: 1, + pageSize: 1000, + time: new Date().getTime(), + } + this.merService.queryList(params, (data: any) => { + if (data['return_code'] == '000000') { + this.merData = data['return_data']['list']; + } + }); } // 查询列表 @@ -286,6 +317,18 @@ export class GoodsListComponent { }); } + // 订单导出 + public getExport() { + this.searchForm.value.time = new Date().getTime(); + this.orderGoodsService.exportGoodsOrder(this.searchForm.value , (data: any) => { + if (data['return_code'] == '000000') { + this.communicationService.sendMessage(data['return_data']); + } else { + this.msg.error(data['return_msg']); + } + this.tableData.loading = false; + }); + } + - protected readonly orderPayType = orderPayType; } diff --git a/src/app/pages/trade/goods-logistics-list/goods-logistics-list.component.html b/src/app/pages/trade/goods-logistics-list/goods-logistics-list.component.html index effed5e..20149b8 100644 --- a/src/app/pages/trade/goods-logistics-list/goods-logistics-list.component.html +++ b/src/app/pages/trade/goods-logistics-list/goods-logistics-list.component.html @@ -1,30 +1,60 @@
+
- 商品名称 + 物流订单号 - +
- 物流订单号 + 订单号 - +
+
- 订单号 + 物流状态 - + + +
+ + 创建时间 + + + + +
+
+ + 商户 + + + + + + +
+
+ + 商品名称 + + + + +
+
子订单号 @@ -32,7 +62,7 @@
-
+
用户手机号 @@ -41,7 +71,7 @@
-
+
商品分类 @@ -54,7 +84,7 @@
-
+
商品品牌 @@ -65,17 +95,7 @@
-
- - 物流状态 - - - - - - -
-
+
支付类型 @@ -85,18 +105,15 @@
-
- - 创建时间 - - - - -
+
@@ -122,11 +139,11 @@ 订单号 子订单号 物流单号 - 创建时间 - 更新时间 - 支付类型 - 支付状态 - 物流状态 + 创建时间 + 更新时间 + 支付类型 + 支付状态 + 物流状态 操作 @@ -152,6 +169,7 @@ {{data.status | orderChildStatus}} + @@ -196,15 +214,14 @@ - - - - - - - - - + + + + + + + + diff --git a/src/app/pages/trade/goods-logistics-list/goods-logistics-list.component.ts b/src/app/pages/trade/goods-logistics-list/goods-logistics-list.component.ts index 6124b27..730395b 100644 --- a/src/app/pages/trade/goods-logistics-list/goods-logistics-list.component.ts +++ b/src/app/pages/trade/goods-logistics-list/goods-logistics-list.component.ts @@ -35,6 +35,9 @@ import {AuditStatusPipe} from "../../../pipes/audit/audit-status.pipe"; import {IconService} from "../../../services/common/icon.service"; import {PayTypePipe} from "../../../pipes/goods/pay-type.pipe"; import {OrderChildStatusPipe} from "../../../pipes/goods/order-child-status.pipe"; +import {MerService} from "../../../services/merchant/mer.service"; +import {DATA} from "../../../data/login/localStorage.namespace"; +import {BrowserStorageService} from "../../../utils/localStorage.service"; @Component({ selector: 'app-goods-logistics-list', @@ -118,19 +121,24 @@ export class GoodsLogisticsListComponent { logisticsTraceDetails: any; goodsOrderId: any; deliveryAddress: any; - - + // 更多查询条件 + isCollapse = false; + merData: any; + objectType: any; protected readonly fallbackImg = fallbackImg; protected readonly orderPayType = orderPayType; protected readonly logisticsStatus = logisticsStatus; constructor(private fb: NonNullableFormBuilder, private msg: NzMessageService, + private storage: BrowserStorageService, + private merService: MerService, private iconService: IconService, private orderGoodsService: OrderGoodsService, private goodsService: GoodsService) { + // 初始化搜索框 this.searchForm = this.fb.group({ logisticsNo: [''], @@ -138,6 +146,7 @@ export class GoodsLogisticsListComponent { childOrderNo: [''], goodsType: [''], goodsBrand: [''], + merId: [''], userPhone: [''], goodsSpecsName: [''], createTimeArray: [[]], @@ -152,9 +161,25 @@ export class GoodsLogisticsListComponent { this.getRequest(); this.getGoodsTypeNode(); this.getGoodsBrandNode(); + this.merList(); + this.objectType = this.storage.get(DATA)['account']['objectType']; + } + // 查询商户 + public merList() { + let params: any = { + pageNum: 1, + pageSize: 1000, + time: new Date().getTime(), + } + this.merService.queryList(params, (data: any) => { + if (data['return_code'] == '000000') { + this.merData = data['return_data']['list']; + } + }); } + // 查询列表 public getRequest(reset: boolean = false) { diff --git a/src/app/pipes/common/data-utils.pipe.ts b/src/app/pipes/common/data-utils.pipe.ts new file mode 100644 index 0000000..89fd259 --- /dev/null +++ b/src/app/pipes/common/data-utils.pipe.ts @@ -0,0 +1,16 @@ +import { Pipe, PipeTransform } from '@angular/core'; + +@Pipe({ + name: 'dataUtils', + standalone: true +}) +export class DataUtilsPipe implements PipeTransform { + + transform(data: any, length: number): any { + if (data.length == 0) { + return []; + } + return data.slice(0 , length); + } + +} diff --git a/src/app/pipes/file/business-type.pipe.ts b/src/app/pipes/file/business-type.pipe.ts new file mode 100644 index 0000000..d648af3 --- /dev/null +++ b/src/app/pipes/file/business-type.pipe.ts @@ -0,0 +1,30 @@ +import { Pipe, PipeTransform } from '@angular/core'; + +@Pipe({ + name: 'businessType', + standalone: true +}) +export class BusinessTypePipe implements PipeTransform { + + transform(value: number): any { + switch (value) { + case 1: + return '实物产品'; + case 2: + return '虚拟产品'; + case 3: + return '肯德基'; + case 4: + return '星巴克'; + case 5: + return '支付订单'; + case 6: + return '物流上传订单'; + case 7: + return '物流下载订单'; + default: + return '未知状态' + } + } + +} diff --git a/src/app/pipes/file/status.pipe.ts b/src/app/pipes/file/status.pipe.ts new file mode 100644 index 0000000..f94cb5a --- /dev/null +++ b/src/app/pipes/file/status.pipe.ts @@ -0,0 +1,22 @@ +import { Pipe, PipeTransform } from '@angular/core'; + +@Pipe({ + name: 'status', + standalone: true +}) +export class StatusPipe implements PipeTransform { + + transform(value: number): any { + switch (value) { + case 1: + return '成功'; + case 2: + return '导出中'; + case 3: + return '失败'; + default: + return '未知状态' + } + } + +} diff --git a/src/app/services/common/communication.service.ts b/src/app/services/common/communication.service.ts new file mode 100644 index 0000000..78ab2cc --- /dev/null +++ b/src/app/services/common/communication.service.ts @@ -0,0 +1,17 @@ +import { Injectable } from '@angular/core'; +import {Subject} from "rxjs"; + +@Injectable({ + providedIn: 'root' +}) +export class CommunicationService { + + private messageSource = new Subject(); + currentMessage = this.messageSource.asObservable(); + + constructor() { } + + sendMessage(message: string) { + this.messageSource.next(message); + } +} diff --git a/src/app/services/common/icon.service.ts b/src/app/services/common/icon.service.ts index 5189b6d..c89c04c 100644 --- a/src/app/services/common/icon.service.ts +++ b/src/app/services/common/icon.service.ts @@ -8,7 +8,7 @@ export class IconService { constructor(private iconService: NzIconService) { this.iconService.fetchFromIconfont({ - scriptUrl: 'https://at.alicdn.com/t/c/font_4647823_zeitf111aa.js' + scriptUrl: 'https://at.alicdn.com/t/c/font_4647823_ys5j7ogeas.js' }); } } diff --git a/src/app/services/file/file.service.ts b/src/app/services/file/file.service.ts new file mode 100644 index 0000000..64f58b2 --- /dev/null +++ b/src/app/services/file/file.service.ts @@ -0,0 +1,41 @@ +import { Injectable } from '@angular/core'; +import {HttpClient} from "@angular/common/http"; +import {environment} from "../../../environments/environment"; +import {ObjectData} from "../../utils/objectData.service"; + +@Injectable({ + providedIn: 'root' +}) +export class FileService { + + constructor(private http: HttpClient) { } + + /** + * 查询列表 + * @param params + * @param callBack + */ + public getFileRecordsList(params: object, callBack:any) { + this.http.get(environment.baseUrl + 'file/getFileRecordsList?' + ObjectData.objectByString(params)).subscribe(data => { + callBack(data); + }); + } + + /** + * 查询详情 + * @param id + * @param callBack + */ + public findFileRecords(id: number, callBack:any) { + this.http.get(environment.baseUrl + 'file/findFileRecords?id=' + id + "&time=" + new Date().getTime()).subscribe(data => { + callBack(data); + }); + } + + public getDownLoad(id: number, callBack:any) { + this.http.get(environment.baseUrl + 'file/getDownLoad?id=' + id + "&time=" + new Date().getTime()).subscribe(data => { + callBack(data); + }); + } + +} diff --git a/src/app/services/trade/order-goods.service.ts b/src/app/services/trade/order-goods.service.ts index 1eeee14..309b8b6 100644 --- a/src/app/services/trade/order-goods.service.ts +++ b/src/app/services/trade/order-goods.service.ts @@ -32,4 +32,15 @@ export class OrderGoodsService { callBack(data); }); } + + /** + * 订单导出 + * @param param + * @param callBack + */ + public exportGoodsOrder(param: object, callBack:any) { + this.http.get(environment.orderUrl + 'orderGoods/exportGoodsOrder?'+ObjectData.objectByString(param)).subscribe(data => { + callBack(data); + }); + } } diff --git a/src/environments/environment.ts b/src/environments/environment.ts index ec6ab5c..6230f92 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -4,15 +4,15 @@ export const environment = { production: false, - baseUrl: 'https://phg.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址) - orderUrl: 'https://phg.dctpay.com/order/', // 测试环境服务器地址(请求数据地址) - userUrl: 'https://phg.dctpay.com/user/', // 测试环境服务器地址(请求数据地址) - imageUrl: 'https://phg.obs.cn-southwest-2.myhuaweicloud.com/', - - // baseUrl: 'http://localhost:9702/brest/', // 测试环境服务器地址(请求数据地址) - // orderUrl: 'http://localhost:9703/order/', // 测试环境服务器地址(请求数据地址) - // userUrl: 'http://localhost:9704/user/', // 测试环境服务器地址(请求数据地址) - // imageUrl: 'https://phg-test.obs.cn-southwest-2.myhuaweicloud.com/', + // baseUrl: 'https://phg.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址) + // orderUrl: 'https://phg.dctpay.com/order/', // 测试环境服务器地址(请求数据地址) + // userUrl: 'https://phg.dctpay.com/user/', // 测试环境服务器地址(请求数据地址) + // imageUrl: 'https://phg.obs.cn-southwest-2.myhuaweicloud.com/', + // + baseUrl: 'http://localhost:9702/brest/', // 测试环境服务器地址(请求数据地址) + orderUrl: 'http://localhost:9703/order/', // 测试环境服务器地址(请求数据地址) + userUrl: 'http://localhost:9704/user/', // 测试环境服务器地址(请求数据地址) + imageUrl: 'https://phg-test.obs.cn-southwest-2.myhuaweicloud.com/', };