导出列表
This commit is contained in:
@@ -1,16 +1,20 @@
|
|||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Microsoft.Extensions.Options;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using WMS.Web.Core;
|
||||||
using WMS.Web.Core.Dto;
|
using WMS.Web.Core.Dto;
|
||||||
using WMS.Web.Core.Dto.OutStockTask;
|
using WMS.Web.Core.Dto.OutStockTask;
|
||||||
|
using WMS.Web.Core.Help;
|
||||||
using WMS.Web.Core.Internal.Results;
|
using WMS.Web.Core.Internal.Results;
|
||||||
using WMS.Web.Domain.Infrastructure;
|
using WMS.Web.Domain.Infrastructure;
|
||||||
using WMS.Web.Domain.IService;
|
using WMS.Web.Domain.IService;
|
||||||
using WMS.Web.Domain.IService.Public;
|
using WMS.Web.Domain.IService.Public;
|
||||||
|
using WMS.Web.Domain.Options;
|
||||||
using WMS.Web.Domain.Values;
|
using WMS.Web.Domain.Values;
|
||||||
|
|
||||||
namespace WMS.Web.Api.Controllers
|
namespace WMS.Web.Api.Controllers
|
||||||
@@ -27,14 +31,19 @@ namespace WMS.Web.Api.Controllers
|
|||||||
private readonly IOutStockTaskRepositories _repositories;
|
private readonly IOutStockTaskRepositories _repositories;
|
||||||
private readonly IOutStockService _outStockService;
|
private readonly IOutStockService _outStockService;
|
||||||
private readonly IOutStockTaskService _outStockTaskService;
|
private readonly IOutStockTaskService _outStockTaskService;
|
||||||
|
private readonly QiniuOptions _option;
|
||||||
|
private readonly IExportExcelService _exportExcelService;
|
||||||
public OutStockTaskController(IMapper mapper, ILoginService loginService,
|
public OutStockTaskController(IMapper mapper, ILoginService loginService,
|
||||||
IOutStockTaskRepositories repositories, IOutStockService outStockService, IOutStockTaskService outStockTaskService)
|
IOutStockTaskRepositories repositories, IOutStockService outStockService,
|
||||||
|
IOutStockTaskService outStockTaskService, IOptions<QiniuOptions> option, IExportExcelService exportExcelServic)
|
||||||
{
|
{
|
||||||
_mapper = mapper;
|
_mapper = mapper;
|
||||||
_loginService = loginService;
|
_loginService = loginService;
|
||||||
_repositories = repositories;
|
_repositories = repositories;
|
||||||
_outStockService = outStockService;
|
_outStockService = outStockService;
|
||||||
_outStockTaskService = outStockTaskService;
|
_outStockTaskService = outStockTaskService;
|
||||||
|
_option = option?.Value;
|
||||||
|
_exportExcelService = exportExcelServic;
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 列表
|
/// 列表
|
||||||
@@ -54,6 +63,29 @@ namespace WMS.Web.Api.Controllers
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 导出
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="dto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
[Route("Export")]
|
||||||
|
public Task<Result<string>> Export([FromBody] OutStockTaskQueryRequest dto)
|
||||||
|
{
|
||||||
|
var loginInfo = _loginService.GetLoginInfo(this.HttpContext.Request.Headers["Authorization"]);
|
||||||
|
if (loginInfo == null)
|
||||||
|
return Task.FromResult(Result<string>.ReFailure(ResultCodes.Token_Invalid_Error));
|
||||||
|
string fileName = FileDownLoadOrderType.OutStockTask.GetRemark() + loginInfo.UserInfo.CompanyId + DateTime.Now.DateTimeToLongTimeStamp() + ".xlsx";
|
||||||
|
string res = _option.Url + fileName;
|
||||||
|
|
||||||
|
Task.Run(async () =>
|
||||||
|
{
|
||||||
|
await _exportExcelService.ExportList<OutStockTaskQueryInfoResponse, OutStockTaskQueryRequest>(dto, fileName, loginInfo.UserInfo.StaffId, loginInfo.UserInfo.CompanyId, FileDownLoadOrderType.OutStockTask);
|
||||||
|
});
|
||||||
|
|
||||||
|
return Task.FromResult(Result<string>.ReSuccess(res));
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 作废
|
/// 作废
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -304,6 +304,13 @@
|
|||||||
<param name="dto"></param>
|
<param name="dto"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:WMS.Web.Api.Controllers.OutStockTaskController.Export(WMS.Web.Core.Dto.OutStockTask.OutStockTaskQueryRequest)">
|
||||||
|
<summary>
|
||||||
|
导出
|
||||||
|
</summary>
|
||||||
|
<param name="dto"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="M:WMS.Web.Api.Controllers.OutStockTaskController.Repeal(WMS.Web.Core.Dto.OperateRequest)">
|
<member name="M:WMS.Web.Api.Controllers.OutStockTaskController.Repeal(WMS.Web.Core.Dto.OperateRequest)">
|
||||||
<summary>
|
<summary>
|
||||||
作废
|
作废
|
||||||
|
|||||||
@@ -2897,12 +2897,12 @@
|
|||||||
</member>
|
</member>
|
||||||
<member name="P:WMS.Web.Core.Dto.OutStockTask.OutStockTaskQueryInfoResponse.BillNo">
|
<member name="P:WMS.Web.Core.Dto.OutStockTask.OutStockTaskQueryInfoResponse.BillNo">
|
||||||
<summary>
|
<summary>
|
||||||
单据编号
|
出库任务单号
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:WMS.Web.Core.Dto.OutStockTask.OutStockTaskQueryInfoResponse.Status">
|
<member name="P:WMS.Web.Core.Dto.OutStockTask.OutStockTaskQueryInfoResponse.Status">
|
||||||
<summary>
|
<summary>
|
||||||
单据状态
|
出库状态
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:WMS.Web.Core.Dto.OutStockTask.OutStockTaskQueryInfoResponse.Type">
|
<member name="P:WMS.Web.Core.Dto.OutStockTask.OutStockTaskQueryInfoResponse.Type">
|
||||||
@@ -2957,7 +2957,7 @@
|
|||||||
</member>
|
</member>
|
||||||
<member name="P:WMS.Web.Core.Dto.OutStockTask.OutStockTaskQueryInfoResponse.Stock">
|
<member name="P:WMS.Web.Core.Dto.OutStockTask.OutStockTaskQueryInfoResponse.Stock">
|
||||||
<summary>
|
<summary>
|
||||||
仓库ID
|
仓库
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:WMS.Web.Core.Dto.OutStockTask.OutStockTaskQueryInfoResponse.AccruedQty">
|
<member name="P:WMS.Web.Core.Dto.OutStockTask.OutStockTaskQueryInfoResponse.AccruedQty">
|
||||||
|
|||||||
@@ -1389,6 +1389,13 @@
|
|||||||
备注
|
备注
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:WMS.Web.Domain.Infrastructure.IAllFielRepositories`1.GetListField(`0,System.Int32)">
|
||||||
|
<summary>
|
||||||
|
列表字段导出接口
|
||||||
|
</summary>
|
||||||
|
<param name="dto"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="T:WMS.Web.Domain.Infrastructure.IBackRecordRepositories">
|
<member name="T:WMS.Web.Domain.Infrastructure.IBackRecordRepositories">
|
||||||
<summary>
|
<summary>
|
||||||
出入库回退记录-仓储接口
|
出入库回退记录-仓储接口
|
||||||
@@ -1812,6 +1819,50 @@
|
|||||||
改箱 移箱服务
|
改箱 移箱服务
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:WMS.Web.Domain.IService.IExportExcelService.ExportAll``2(``1,System.String,System.Int32,System.Int32,WMS.Web.Domain.Values.FileDownLoadOrderType,Npoi.Mapper.Mapper,System.Nullable{System.Int32})">
|
||||||
|
<summary>
|
||||||
|
全字段导出数据
|
||||||
|
</summary>
|
||||||
|
<typeparam name="Response"></typeparam>
|
||||||
|
<typeparam name="Request"></typeparam>
|
||||||
|
<param name="request"></param>
|
||||||
|
<param name="fileName"></param>
|
||||||
|
<param name="mapper"></param>
|
||||||
|
<param name="userId"></param>
|
||||||
|
<param name="companyId"></param>
|
||||||
|
<param name="type"></param>
|
||||||
|
<param name="supplierId"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:WMS.Web.Domain.IService.IExportExcelService.ExportList``2(``1,System.String,System.Int32,System.Int32,WMS.Web.Domain.Values.FileDownLoadOrderType,Npoi.Mapper.Mapper,System.Nullable{System.Int32})">
|
||||||
|
<summary>
|
||||||
|
列表字段导出数据
|
||||||
|
</summary>
|
||||||
|
<typeparam name="Response"></typeparam>
|
||||||
|
<typeparam name="Request"></typeparam>
|
||||||
|
<param name="request"></param>
|
||||||
|
<param name="fileName"></param>
|
||||||
|
<param name="mapper"></param>
|
||||||
|
<param name="userId"></param>
|
||||||
|
<param name="companyId"></param>
|
||||||
|
<param name="type"></param>
|
||||||
|
<param name="supplierId"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:WMS.Web.Domain.IService.IExportExcelService.Export``1(System.Collections.Generic.List{``0},System.String,System.Int32,System.Int32,WMS.Web.Domain.Values.FileDownLoadOrderType,Npoi.Mapper.Mapper,System.Nullable{System.Int32})">
|
||||||
|
<summary>
|
||||||
|
列表页导出数据
|
||||||
|
</summary>
|
||||||
|
<typeparam name="T"></typeparam>
|
||||||
|
<param name="dataList"></param>
|
||||||
|
<param name="fileName"></param>
|
||||||
|
<param name="mapper"></param>
|
||||||
|
<param name="userId"></param>
|
||||||
|
<param name="type"></param>
|
||||||
|
<param name="companyId"></param>
|
||||||
|
<param name="supplierId"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="T:WMS.Web.Domain.IService.IInStockService">
|
<member name="T:WMS.Web.Domain.IService.IInStockService">
|
||||||
<summary>
|
<summary>
|
||||||
入库单服务接口
|
入库单服务接口
|
||||||
@@ -1951,6 +2002,15 @@
|
|||||||
出库服务
|
出库服务
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:WMS.Web.Domain.IService.IQiniuUploadService.Upload(System.String,System.IO.Stream,System.Boolean)">
|
||||||
|
<summary>
|
||||||
|
上传文件
|
||||||
|
</summary>
|
||||||
|
<param name="fileName"></param>
|
||||||
|
<param name="stream"></param>
|
||||||
|
<param name="isAutoDelte">是否开启自动删除 如果开启 3天后自动删除 导出的execl文件</param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="T:WMS.Web.Domain.IService.ISerialNumberService">
|
<member name="T:WMS.Web.Domain.IService.ISerialNumberService">
|
||||||
<summary>
|
<summary>
|
||||||
序列号服务
|
序列号服务
|
||||||
@@ -2525,6 +2585,31 @@
|
|||||||
老ops对接
|
老ops对接
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="T:WMS.Web.Domain.Options.QiniuOptions">
|
||||||
|
<summary>
|
||||||
|
七牛云 配置
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Domain.Options.QiniuOptions.AccessKey">
|
||||||
|
<summary>
|
||||||
|
访问key
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Domain.Options.QiniuOptions.SecretKey">
|
||||||
|
<summary>
|
||||||
|
秘钥
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Domain.Options.QiniuOptions.Bucket">
|
||||||
|
<summary>
|
||||||
|
区块文件夹
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Domain.Options.QiniuOptions.Url">
|
||||||
|
<summary>
|
||||||
|
访问域名
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="T:WMS.Web.Domain.Options.QuartzJobOptions">
|
<member name="T:WMS.Web.Domain.Options.QuartzJobOptions">
|
||||||
<summary>
|
<summary>
|
||||||
Quartz定时任务-配置项
|
Quartz定时任务-配置项
|
||||||
@@ -2753,6 +2838,33 @@
|
|||||||
<param name="loginInfo"></param>
|
<param name="loginInfo"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:WMS.Web.Domain.Services.ExportExcelService.Export``1(System.Collections.Generic.List{``0},System.String,System.Int32,System.Int32,WMS.Web.Domain.Values.FileDownLoadOrderType,Npoi.Mapper.Mapper,System.Nullable{System.Int32})">
|
||||||
|
<summary>
|
||||||
|
列表页导出
|
||||||
|
</summary>
|
||||||
|
<typeparam name="T"></typeparam>
|
||||||
|
<param name="dataList"></param>
|
||||||
|
<param name="fileName"></param>
|
||||||
|
<param name="userId"></param>
|
||||||
|
<param name="companyId"></param>
|
||||||
|
<param name="type"></param>
|
||||||
|
<param name="mapper"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:WMS.Web.Domain.Services.ExportExcelService.ExportAll``2(``1,System.String,System.Int32,System.Int32,WMS.Web.Domain.Values.FileDownLoadOrderType,Npoi.Mapper.Mapper,System.Nullable{System.Int32})">
|
||||||
|
<summary>
|
||||||
|
全字段导出
|
||||||
|
</summary>
|
||||||
|
<typeparam name="Response"></typeparam>
|
||||||
|
<typeparam name="Request"></typeparam>
|
||||||
|
<param name="request"></param>
|
||||||
|
<param name="fileName"></param>
|
||||||
|
<param name="userId"></param>
|
||||||
|
<param name="companyId"></param>
|
||||||
|
<param name="type"></param>
|
||||||
|
<param name="mapper"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="T:WMS.Web.Domain.Services.InStockService">
|
<member name="T:WMS.Web.Domain.Services.InStockService">
|
||||||
<summary>
|
<summary>
|
||||||
入库单服务
|
入库单服务
|
||||||
@@ -3626,6 +3738,15 @@
|
|||||||
<param name="customerStockCode"></param>
|
<param name="customerStockCode"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:WMS.Web.Domain.Services.QiniuUploadService.Upload(System.String,System.IO.Stream,System.Boolean)">
|
||||||
|
<summary>
|
||||||
|
上传文件
|
||||||
|
</summary>
|
||||||
|
<param name="fileName"></param>
|
||||||
|
<param name="stream"></param>
|
||||||
|
<param name="isAutoDelte"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="T:WMS.Web.Domain.Services.SerialNumberService">
|
<member name="T:WMS.Web.Domain.Services.SerialNumberService">
|
||||||
<summary>
|
<summary>
|
||||||
序列号服务
|
序列号服务
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using System;
|
using Npoi.Mapper.Attributes;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
@@ -12,90 +13,112 @@ namespace WMS.Web.Core.Dto.OutStockTask
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 单据Id
|
/// 单据Id
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[Ignore]
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 明细Id
|
/// 明细Id
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[Ignore]
|
||||||
public int DetailId { get; set; }
|
public int DetailId { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 单据编号
|
/// 出库任务单号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[Column("出库任务单号")]
|
||||||
public string BillNo { get; set; }
|
public string BillNo { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 单据状态
|
/// 出库状态
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[Column("出库状态")]
|
||||||
public string Status { get; set; }
|
public string Status { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 单据类型
|
/// 单据类型
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[Column("出库类型")]
|
||||||
public string Type { get; set; }
|
public string Type { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 操作人(出库人)
|
/// 操作人(出库人)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[Column("出库人")]
|
||||||
public string Operator { get; set; }
|
public string Operator { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 操作时间(出库时间)
|
/// 操作时间(出库时间)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[Column("出库时间")]
|
||||||
public string OperateTime { get; set; }
|
public string OperateTime { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 来源单号
|
/// 来源单号
|
||||||
///</summary>
|
///</summary>
|
||||||
|
[Column("来源单号")]
|
||||||
public string SourceBillNo { get; set; }
|
public string SourceBillNo { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 销售订单号
|
/// 销售订单号
|
||||||
///</summary>
|
///</summary>
|
||||||
|
[Column("销售订单号")]
|
||||||
public string SaleBillNo { get; set; }
|
public string SaleBillNo { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 发货组织
|
/// 发货组织
|
||||||
///</summary>
|
///</summary>
|
||||||
|
[Column("发货组织")]
|
||||||
public string DeliveryOrg { get; set; }
|
public string DeliveryOrg { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 收货客户
|
/// 收货客户
|
||||||
///</summary>
|
///</summary>
|
||||||
|
[Column("收货客户")]
|
||||||
public string ReceiptCustomer { get; set; }
|
public string ReceiptCustomer { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 物料名称
|
/// 物料名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[Column("物料名称")]
|
||||||
public string MaterialName { get; set; }
|
public string MaterialName { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 物料编码
|
/// 物料编码
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[Column("物料编码")]
|
||||||
public string MaterialNumber { get; set; }
|
public string MaterialNumber { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 物料规格型号
|
/// 物料规格型号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[Column("规格型号")]
|
||||||
public string Specifications { get; set; }
|
public string Specifications { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 仓库ID
|
/// 仓库
|
||||||
///</summary>
|
///</summary>
|
||||||
|
[Column("发货仓库")]
|
||||||
public string Stock { get; set; }
|
public string Stock { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 应出库数量
|
/// 应出库数量
|
||||||
///</summary>
|
///</summary>
|
||||||
|
[Column("应出库数量")]
|
||||||
public decimal AccruedQty { get; set; }
|
public decimal AccruedQty { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 已出库数量
|
/// 已出库数量
|
||||||
///</summary>
|
///</summary>
|
||||||
|
[Column("已出库数量")]
|
||||||
public decimal RealityQty { get; set; }
|
public decimal RealityQty { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 订单明细备注
|
/// 订单明细备注
|
||||||
///</summary>
|
///</summary>
|
||||||
|
[Column("订单明细备注")]
|
||||||
public string Remark { get; set; }
|
public string Remark { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 创建时间(erp那边的创建时间)
|
/// 创建时间(erp那边的创建时间)
|
||||||
///</summary>
|
///</summary>
|
||||||
|
[Column("创建时间")]
|
||||||
public string CreateTime { get; set; }
|
public string CreateTime { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 单位
|
/// 单位
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[Column("单位")]
|
||||||
public string Unit { get; set; }
|
public string Unit { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 出库开始时间
|
/// 出库开始时间
|
||||||
///</summary>
|
///</summary>
|
||||||
|
[Column("出库开始时间")]
|
||||||
public string OutStockBeginTime { get; set; }
|
public string OutStockBeginTime { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 出库结束时间
|
/// 出库结束时间
|
||||||
///</summary>
|
///</summary>
|
||||||
|
[Column("出库结束时间")]
|
||||||
public string OutStockEndTime { get; set; }
|
public string OutStockEndTime { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
55
src/WMS.Web.Domain/IService/IExportExcelService.cs
Normal file
55
src/WMS.Web.Domain/IService/IExportExcelService.cs
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
using Npoi.Mapper;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using WMS.Web.Core.Dto;
|
||||||
|
using WMS.Web.Domain.Values;
|
||||||
|
|
||||||
|
namespace WMS.Web.Domain.IService
|
||||||
|
{
|
||||||
|
public interface IExportExcelService
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 全字段导出数据
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="Response"></typeparam>
|
||||||
|
/// <typeparam name="Request"></typeparam>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <param name="fileName"></param>
|
||||||
|
/// <param name="mapper"></param>
|
||||||
|
/// <param name="userId"></param>
|
||||||
|
/// <param name="companyId"></param>
|
||||||
|
/// <param name="type"></param>
|
||||||
|
/// <param name="supplierId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task ExportAll<Response, Request>(Request request, string fileName, int userId,int companyId, FileDownLoadOrderType type, Mapper mapper = null, int? supplierId = null) where Request : PaginationBaseRequestDto;
|
||||||
|
/// <summary>
|
||||||
|
/// 列表字段导出数据
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="Response"></typeparam>
|
||||||
|
/// <typeparam name="Request"></typeparam>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <param name="fileName"></param>
|
||||||
|
/// <param name="mapper"></param>
|
||||||
|
/// <param name="userId"></param>
|
||||||
|
/// <param name="companyId"></param>
|
||||||
|
/// <param name="type"></param>
|
||||||
|
/// <param name="supplierId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task ExportList<Response, Request>(Request request, string fileName, int userId, int companyId, FileDownLoadOrderType type, Mapper mapper = null, int? supplierId = null) where Request : PaginationBaseRequestDto;
|
||||||
|
/// <summary>
|
||||||
|
/// 列表页导出数据
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="T"></typeparam>
|
||||||
|
/// <param name="dataList"></param>
|
||||||
|
/// <param name="fileName"></param>
|
||||||
|
/// <param name="mapper"></param>
|
||||||
|
/// <param name="userId"></param>
|
||||||
|
/// <param name="type"></param>
|
||||||
|
/// <param name="companyId"></param>
|
||||||
|
/// <param name="supplierId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task Export<T>(List<T> dataList, string fileName,int userId,int companyId, FileDownLoadOrderType type, Mapper mapper = null, int? supplierId = null);
|
||||||
|
}
|
||||||
|
}
|
||||||
22
src/WMS.Web.Domain/IService/IQiniuUploadService.cs
Normal file
22
src/WMS.Web.Domain/IService/IQiniuUploadService.cs
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using WMS.Web.Core.Internal.Results;
|
||||||
|
|
||||||
|
namespace WMS.Web.Domain.IService
|
||||||
|
{
|
||||||
|
public interface IQiniuUploadService
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 上传文件
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="fileName"></param>
|
||||||
|
/// <param name="stream"></param>
|
||||||
|
/// <param name="isAutoDelte">是否开启自动删除 如果开启 3天后自动删除 导出的execl文件</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Result<string>> Upload(string fileName, Stream stream,bool isAutoDelte= false);
|
||||||
|
}
|
||||||
|
}
|
||||||
26
src/WMS.Web.Domain/Infrastructure/IAllFielRepositories.cs
Normal file
26
src/WMS.Web.Domain/Infrastructure/IAllFielRepositories.cs
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace WMS.Web.Domain.Infrastructure
|
||||||
|
{
|
||||||
|
public interface IAllFielRepositories<Request>
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 全字段导出接口
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="dto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
//Task<(object obj, int total)> GetListAllField(Request dto, int companyId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 列表字段导出接口
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="dto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<(object obj, int total)> GetListField(Request dto, int companyId);
|
||||||
|
}
|
||||||
|
}
|
||||||
31
src/WMS.Web.Domain/Options/QiniuOptions.cs
Normal file
31
src/WMS.Web.Domain/Options/QiniuOptions.cs
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace WMS.Web.Domain.Options
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 七牛云 配置
|
||||||
|
/// </summary>
|
||||||
|
public class QiniuOptions
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 访问key
|
||||||
|
/// </summary>
|
||||||
|
public string AccessKey { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 秘钥
|
||||||
|
/// </summary>
|
||||||
|
public string SecretKey { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 区块文件夹
|
||||||
|
/// </summary>
|
||||||
|
public string Bucket { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 访问域名
|
||||||
|
/// </summary>
|
||||||
|
public string Url { get; set; }
|
||||||
|
//导出数据一页条数
|
||||||
|
public int PageSize { get; set; } = 50000;
|
||||||
|
}
|
||||||
|
}
|
||||||
228
src/WMS.Web.Domain/Services/ExportExcelService.cs
Normal file
228
src/WMS.Web.Domain/Services/ExportExcelService.cs
Normal file
@@ -0,0 +1,228 @@
|
|||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Npoi.Mapper;
|
||||||
|
using System.IO;
|
||||||
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
using Microsoft.Extensions.Options;
|
||||||
|
using WMS.Web.Domain.IService;
|
||||||
|
using WMS.Web.Domain.Options;
|
||||||
|
using WMS.Web.Domain.Entitys;
|
||||||
|
using WMS.Web.Domain.Values;
|
||||||
|
using WMS.Web.Domain.Infrastructure;
|
||||||
|
using WMS.Web.Core.Dto;
|
||||||
|
|
||||||
|
namespace WMS.Web.Domain.Services
|
||||||
|
{
|
||||||
|
public class ExportExcelService : IExportExcelService
|
||||||
|
{
|
||||||
|
private readonly IQiniuUploadService _qiniuUploadService;
|
||||||
|
private readonly IServiceScopeFactory _serviceScopeFactory;
|
||||||
|
private readonly ILogger<ExportExcelService> _logger;
|
||||||
|
private readonly QiniuOptions _option;
|
||||||
|
public ExportExcelService(IQiniuUploadService qiniuUploadService, IServiceScopeFactory serviceScopeFactory,
|
||||||
|
ILogger<ExportExcelService> logger, IOptions<QiniuOptions> option)
|
||||||
|
{
|
||||||
|
_qiniuUploadService = qiniuUploadService;
|
||||||
|
_serviceScopeFactory = serviceScopeFactory;
|
||||||
|
_logger = logger;
|
||||||
|
_option = option?.Value;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 列表页导出
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="T"></typeparam>
|
||||||
|
/// <param name="dataList"></param>
|
||||||
|
/// <param name="fileName"></param>
|
||||||
|
/// <param name="userId"></param>
|
||||||
|
/// <param name="companyId"></param>
|
||||||
|
/// <param name="type"></param>
|
||||||
|
/// <param name="mapper"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task Export<T>(List<T> dataList, string fileName, int userId, int companyId, FileDownLoadOrderType type, Mapper mapper = null, int? supplierId = null)
|
||||||
|
{
|
||||||
|
FileDownManager entity = new FileDownManager(userId, companyId, type, _option.Url + fileName, supplierId);
|
||||||
|
using (var scope = _serviceScopeFactory.CreateScope())
|
||||||
|
{
|
||||||
|
var _fileDownManagerService = scope.ServiceProvider.GetRequiredService<IFileDownManagerRepositories>();
|
||||||
|
entity = await _fileDownManagerService.Add(entity);
|
||||||
|
List<List<T>> listz = new List<List<T>>();
|
||||||
|
listz.Add(dataList);
|
||||||
|
|
||||||
|
string msg = await Upload(listz, fileName, userId, type);
|
||||||
|
|
||||||
|
entity.Finish(string.IsNullOrEmpty(msg) == true ? true : false, msg);
|
||||||
|
await _fileDownManagerService.Edit(entity);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 全字段导出
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="Response"></typeparam>
|
||||||
|
/// <typeparam name="Request"></typeparam>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <param name="fileName"></param>
|
||||||
|
/// <param name="userId"></param>
|
||||||
|
/// <param name="companyId"></param>
|
||||||
|
/// <param name="type"></param>
|
||||||
|
/// <param name="mapper"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public Task ExportAll<Response, Request>(Request request, string fileName, int userId, int companyId, FileDownLoadOrderType type, Mapper mapper = null, int? supplierId = null) where Request : PaginationBaseRequestDto
|
||||||
|
{
|
||||||
|
return Task.CompletedTask;
|
||||||
|
//FileDownManager entity = new FileDownManager(userId, companyId, type, _option.Url + fileName, supplierId);
|
||||||
|
|
||||||
|
//request.PageNo = 1;
|
||||||
|
//request.PageSize = _option.PageSize;
|
||||||
|
//List<List<Response>> listz = new List<List<Response>>();
|
||||||
|
//string msg = "";
|
||||||
|
//using (var scope = _serviceScopeFactory.CreateScope())
|
||||||
|
//{
|
||||||
|
// var _fileDownManagerService = scope.ServiceProvider.GetRequiredService<IFileDownManagerRepositories>();
|
||||||
|
// entity = await _fileDownManagerService.Add(entity);
|
||||||
|
// try
|
||||||
|
// {
|
||||||
|
// var _service = scope.ServiceProvider.GetRequiredService<IAllFielRepositories<Request>>();
|
||||||
|
// _logger.LogInformation($"{DateTime.Now}--开始访问数据");
|
||||||
|
// var (obj, total) = await _service.GetListAllField(request, companyId);
|
||||||
|
// var list = (List<Response>)obj;
|
||||||
|
// var page = Math.Ceiling(Convert.ToDecimal(total) / _option.PageSize);
|
||||||
|
|
||||||
|
// listz.Add(list);
|
||||||
|
// for (int i = 1; i < page; i++)
|
||||||
|
// {
|
||||||
|
// request.PageNo++;
|
||||||
|
// var (obj_f, total_f) = await _service.GetListAllField(request, companyId);
|
||||||
|
// var list_f = (List<Response>)obj_f;
|
||||||
|
// listz.Add(list_f);
|
||||||
|
// }
|
||||||
|
// _logger.LogInformation($"{DateTime.Now}--访问数据成功 总数:{total}");
|
||||||
|
// }
|
||||||
|
// catch (Exception ex)
|
||||||
|
// {
|
||||||
|
// msg = $"未找到数据 {ex.ToString()}";
|
||||||
|
// _logger.LogError($"导出异常:{ex.ToString()}");
|
||||||
|
// }
|
||||||
|
|
||||||
|
// if (!string.IsNullOrEmpty(msg))
|
||||||
|
// {
|
||||||
|
// entity.Finish(false, msg);
|
||||||
|
// await _fileDownManagerService.Edit(entity);
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// msg = await Upload(listz, fileName, userId, type);
|
||||||
|
|
||||||
|
// entity.Finish(string.IsNullOrEmpty(msg) == true ? true : false, msg);
|
||||||
|
// await _fileDownManagerService.Edit(entity);
|
||||||
|
// return;
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task ExportList<Response, Request>(Request request, string fileName, int userId, int companyId, FileDownLoadOrderType type, Mapper mapper = null, int? supplierId = null) where Request : PaginationBaseRequestDto
|
||||||
|
{
|
||||||
|
FileDownManager entity = new FileDownManager(userId, companyId, type, _option.Url + fileName, supplierId);
|
||||||
|
|
||||||
|
request.PageNo = 1;
|
||||||
|
request.PageSize = _option.PageSize;
|
||||||
|
List<List<Response>> listz = new List<List<Response>>();
|
||||||
|
string msg = "";
|
||||||
|
using (var scope = _serviceScopeFactory.CreateScope())
|
||||||
|
{
|
||||||
|
var _fileDownManagerService = scope.ServiceProvider.GetRequiredService<IFileDownManagerRepositories>();
|
||||||
|
entity = await _fileDownManagerService.Add(entity);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var _service = scope.ServiceProvider.GetRequiredService<IAllFielRepositories<Request>>();
|
||||||
|
_logger.LogInformation($"{DateTime.Now}--开始访问数据");
|
||||||
|
var (obj, total) = await _service.GetListField(request, companyId);
|
||||||
|
var list = (List<Response>)obj;
|
||||||
|
var page = Math.Ceiling(Convert.ToDecimal(total) / _option.PageSize);
|
||||||
|
|
||||||
|
listz.Add(list);
|
||||||
|
for (int i = 1; i < page; i++)
|
||||||
|
{
|
||||||
|
request.PageNo++;
|
||||||
|
var (obj_f, total_f) = await _service.GetListField(request, companyId);
|
||||||
|
var list_f = (List<Response>)obj_f;
|
||||||
|
listz.Add(list_f);
|
||||||
|
}
|
||||||
|
_logger.LogInformation($"{DateTime.Now}--访问数据成功 总数:{total}");
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
msg = "未找到数据";
|
||||||
|
_logger.LogError($"导出数据查询异常 {ex.ToString()}");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (listz.Count <= 0)
|
||||||
|
{
|
||||||
|
entity.Finish(false, msg);
|
||||||
|
await _fileDownManagerService.Edit(entity);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
msg = await Upload(listz, fileName, userId, type);
|
||||||
|
|
||||||
|
entity.Finish(string.IsNullOrEmpty(msg) == true ? true : false, msg);
|
||||||
|
await _fileDownManagerService.Edit(entity);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task<string> Upload<T>(List<List<T>> dataList, string fileName, int userId, FileDownLoadOrderType type, Mapper mapper = null)
|
||||||
|
{
|
||||||
|
if (mapper == null)
|
||||||
|
mapper = new Mapper();
|
||||||
|
|
||||||
|
//第一个参数为导出Excel名称
|
||||||
|
//第二个参数为Excel数据来源
|
||||||
|
//第三个参数为导出的Sheet名称
|
||||||
|
//overwrite参数如果是要覆盖已存在的Excel或者新建Excel则为true,如果在原有Excel上追加数据则为false
|
||||||
|
//xlsx参数是用于区分导出的数据格式为xlsx还是xls
|
||||||
|
MemoryStream stream = new MemoryStream();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
for (int i = 0; i < dataList.Count; i++)
|
||||||
|
{
|
||||||
|
mapper.Put<T>(dataList[i], "sheet" + (i + 1), true);
|
||||||
|
}
|
||||||
|
mapper.Save(stream);
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
return "数据导入Execl异常";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//mapper.Save(stream, dataList, "sheet1", overwrite: true, xlsx: true);
|
||||||
|
//,但是这里也踩到了一个坑,不过这个是 Npoi 的坑并不是 Npoi.Mapper 的坑,
|
||||||
|
// 那就是 Workbook.Write(stream)的时候会将 stream 关闭,如果继续操作这个 Stream 会报流已关闭的错误
|
||||||
|
//所以这里 是把流先转成byte[] 再转回使用的流
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var middleByte = stream.ToArray();
|
||||||
|
using (MemoryStream streamUpload = new MemoryStream(middleByte))
|
||||||
|
{
|
||||||
|
var res = await _qiniuUploadService.Upload(fileName, streamUpload, true);
|
||||||
|
if (!res.Success)
|
||||||
|
{
|
||||||
|
_logger.LogError($"{DateTime.Now}--上传千牛云失败 原因:{res.Message}");
|
||||||
|
return res.Message;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
return "数据上传云端异常";
|
||||||
|
}
|
||||||
|
|
||||||
|
_logger.LogInformation($"{DateTime.Now}--导出成功");
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
73
src/WMS.Web.Domain/Services/QiniuUploadService.cs
Normal file
73
src/WMS.Web.Domain/Services/QiniuUploadService.cs
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
using Microsoft.Extensions.Options;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Qiniu.Http;
|
||||||
|
using Qiniu.Storage;
|
||||||
|
using Qiniu.Util;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using WMS.Web.Core.Internal.Results;
|
||||||
|
using WMS.Web.Domain.IService;
|
||||||
|
using WMS.Web.Domain.Options;
|
||||||
|
|
||||||
|
namespace WMS.Web.Domain.Services
|
||||||
|
{
|
||||||
|
public class QiniuUploadService : IQiniuUploadService
|
||||||
|
{
|
||||||
|
private readonly QiniuOptions _option;
|
||||||
|
public QiniuUploadService(IOptions<QiniuOptions> option)
|
||||||
|
{
|
||||||
|
_option = option?.Value;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 上传文件
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="fileName"></param>
|
||||||
|
/// <param name="stream"></param>
|
||||||
|
/// <param name="isAutoDelte"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public Task<Result<string>> Upload(string fileName, Stream stream, bool isAutoDelte = false)
|
||||||
|
{
|
||||||
|
// 生成(上传)凭证时需要使用此Mac
|
||||||
|
// 这个示例单独使用了一个Settings类,其中包含AccessKey和SecretKey
|
||||||
|
// 实际应用中,请自行设置您的AccessKey和SecretKey
|
||||||
|
Mac mac = new Mac(_option.AccessKey, _option.SecretKey);
|
||||||
|
|
||||||
|
PutPolicy putPolicy = new PutPolicy();
|
||||||
|
// 如果需要设置为"覆盖"上传(如果云端已有同名文件则覆盖),请使用 SCOPE = "BUCKET:KEY"
|
||||||
|
putPolicy.Scope = _option.Bucket + ":" + fileName;
|
||||||
|
// putPolicy.Scope = bucket;
|
||||||
|
// 上传策略有效期(对应于生成的凭证的有效期)
|
||||||
|
putPolicy.SetExpires(3600);
|
||||||
|
// 上传到云端多少天后自动删除该文件,如果不设置(即保持默认默认)则不删除
|
||||||
|
if (isAutoDelte)
|
||||||
|
putPolicy.DeleteAfterDays = 7;
|
||||||
|
string jstr = putPolicy.ToJsonString();
|
||||||
|
string token = Auth.CreateUploadToken(mac, jstr);
|
||||||
|
|
||||||
|
Config config = new Config();
|
||||||
|
// 空间对应的机房 华 东 ZONE_CN_East 华 北 ZONE_CN_North 华 南 ZONE_CN_Sout 北 美 ZONE_US_North 东南亚 ZONE_AS_Singapore
|
||||||
|
config.Zone = Zone.ZONE_CN_South;
|
||||||
|
// 是否使用https域名
|
||||||
|
config.UseHttps = true;
|
||||||
|
// 上传是否使用cdn加速
|
||||||
|
config.UseCdnDomains = true;
|
||||||
|
HttpResult result = null;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
FormUploader fu = new FormUploader(config);
|
||||||
|
result = fu.UploadStream(stream, fileName, token, null);
|
||||||
|
if (result.Code == 200)
|
||||||
|
return Task.FromResult(Result<string>.ReSuccess(_option.Url + fileName));
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Console.WriteLine(ex);
|
||||||
|
return Task.FromResult(Result<string>.ReFailure("上传文件失败" + ex.ToString(), 0));
|
||||||
|
}
|
||||||
|
return Task.FromResult(Result<string>.ReFailure("上传文件失败" + JsonConvert.SerializeObject(result), 0));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -177,6 +177,8 @@ namespace WMS.Web.Repositories.DependencyInjection
|
|||||||
Services.Configure<ErpOptions>(Configuration.GetSection("ErpOptions"));
|
Services.Configure<ErpOptions>(Configuration.GetSection("ErpOptions"));
|
||||||
Services.AddOptions<OpsOptions>();
|
Services.AddOptions<OpsOptions>();
|
||||||
Services.Configure<OpsOptions>(Configuration.GetSection("OpsOptions"));
|
Services.Configure<OpsOptions>(Configuration.GetSection("OpsOptions"));
|
||||||
|
Services.AddOptions<QiniuOptions>();
|
||||||
|
Services.Configure<QiniuOptions>(Configuration.GetSection("Qiniu"));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -252,7 +254,8 @@ namespace WMS.Web.Repositories.DependencyInjection
|
|||||||
Services.AddTransient<IOpsService, OpsService>();
|
Services.AddTransient<IOpsService, OpsService>();
|
||||||
|
|
||||||
Services.AddTransient<IErpBasicDataExtendService, ErpBasicDataExtendService>();
|
Services.AddTransient<IErpBasicDataExtendService, ErpBasicDataExtendService>();
|
||||||
|
Services.AddTransient<IExportExcelService, ExportExcelService>();
|
||||||
|
Services.AddTransient<IQiniuUploadService, QiniuUploadService>();
|
||||||
|
|
||||||
|
|
||||||
Services.AddTransient<IBoxService, BoxService>();
|
Services.AddTransient<IBoxService, BoxService>();
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using WMS.Web.Core.Dto.OutStockTask;
|
||||||
using WMS.Web.Domain.Infrastructure;
|
using WMS.Web.Domain.Infrastructure;
|
||||||
using WMS.Web.Repositories;
|
using WMS.Web.Repositories;
|
||||||
using WMS.Web.Repositories.Configuration;
|
using WMS.Web.Repositories.Configuration;
|
||||||
@@ -36,7 +37,11 @@ namespace Microsoft.Extensions.DependencyInjection
|
|||||||
services.AddTransient<IBoxRepositories, BoxRepositories>();
|
services.AddTransient<IBoxRepositories, BoxRepositories>();
|
||||||
services.AddTransient<IBasicsRepositories, BasicsRepositories>();
|
services.AddTransient<IBasicsRepositories, BasicsRepositories>();
|
||||||
services.AddTransient<ITransactionRepositories, TransactionRepositories>();
|
services.AddTransient<ITransactionRepositories, TransactionRepositories>();
|
||||||
|
|
||||||
|
#region 导出
|
||||||
|
services.AddTransient<IAllFielRepositories<OutStockTaskQueryRequest>, OutStockTaskRepositories>();
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
services.AddTransient<IInStockRepositories, InStockRepositories>();
|
services.AddTransient<IInStockRepositories, InStockRepositories>();
|
||||||
services.AddTransient<IInStockTaskRepositories, InStockTaskRepositories>();
|
services.AddTransient<IInStockTaskRepositories, InStockTaskRepositories>();
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ using WMS.Web.Repositories.Configuration;
|
|||||||
|
|
||||||
namespace WMS.Web.Repositories
|
namespace WMS.Web.Repositories
|
||||||
{
|
{
|
||||||
public class OutStockTaskRepositories : IOutStockTaskRepositories
|
public class OutStockTaskRepositories : IAllFielRepositories<OutStockTaskQueryRequest>, IOutStockTaskRepositories
|
||||||
{
|
{
|
||||||
private readonly IMapper _mapper;
|
private readonly IMapper _mapper;
|
||||||
private readonly IServiceProvider _serviceProvider;
|
private readonly IServiceProvider _serviceProvider;
|
||||||
@@ -425,5 +425,16 @@ namespace WMS.Web.Repositories
|
|||||||
.Select(s => s.BillNo)
|
.Select(s => s.BillNo)
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 导出列表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="dto"></param>
|
||||||
|
/// <param name="companyId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<(object obj, int total)> GetListField(OutStockTaskQueryRequest dto, int companyId)
|
||||||
|
{
|
||||||
|
return await GetListAsync(dto);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user