出库信息导出
This commit is contained in:
Binary file not shown.
@@ -88,6 +88,29 @@ namespace WMS.Web.Api.Controllers
|
|||||||
|
|
||||||
return Task.FromResult(Result<string>.ReSuccess(res));
|
return Task.FromResult(Result<string>.ReSuccess(res));
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 导出详情
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="dto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
[Route("ExportInfo")]
|
||||||
|
public Task<Result<string>> ExportInfo(OperateRequest 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.OutStockTaskInfo.GetRemark() + loginInfo.UserInfo.CompanyId + DateTime.Now.DateToStringSeconds() + ".xlsx";
|
||||||
|
string res = _option.Url + fileName;
|
||||||
|
|
||||||
|
Task.Run(async () =>
|
||||||
|
{
|
||||||
|
//await _exportExcelService.ExportList<OutStockTaskQueryInfoResponse, OutStockTaskQueryRequest>(dto, fileName, loginInfo.UserInfo.StaffId, loginInfo.UserInfo.CompanyId, FileDownLoadOrderType.OutStockTask);
|
||||||
|
await _outStockTaskService.ExportInfo(dto, fileName, loginInfo);
|
||||||
|
});
|
||||||
|
|
||||||
|
return Task.FromResult(Result<string>.ReSuccess(res));
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 作废
|
/// 作废
|
||||||
|
|||||||
@@ -471,6 +471,13 @@
|
|||||||
<param name="dto"></param>
|
<param name="dto"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:WMS.Web.Api.Controllers.OutStockTaskController.ExportInfo(WMS.Web.Core.Dto.OperateRequest)">
|
||||||
|
<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>
|
||||||
作废
|
作废
|
||||||
|
|||||||
@@ -4744,6 +4744,61 @@
|
|||||||
序列号集
|
序列号集
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="T:WMS.Web.Core.Dto.OutStockTask.ExportInfoResponse">
|
||||||
|
<summary>
|
||||||
|
出库单导出详情
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Dto.OutStockTask.ExportInfoResponse.SourceBillNo">
|
||||||
|
<summary>
|
||||||
|
来源单号
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Dto.OutStockTask.ExportInfoResponse.SaleBillNo">
|
||||||
|
<summary>
|
||||||
|
销售订单号
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Dto.OutStockTask.ExportInfoResponse.CreateTime">
|
||||||
|
<summary>
|
||||||
|
出库时间
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Dto.OutStockTask.ExportInfoResponse.ReceiptCustomer">
|
||||||
|
<summary>
|
||||||
|
客户
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Dto.OutStockTask.ExportInfoResponse.BoxBillNo">
|
||||||
|
<summary>
|
||||||
|
箱号
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Dto.OutStockTask.ExportInfoResponse.Specifications">
|
||||||
|
<summary>
|
||||||
|
物料规格型号
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Dto.OutStockTask.ExportInfoResponse.MaterialName">
|
||||||
|
<summary>
|
||||||
|
物料名称
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Dto.OutStockTask.ExportInfoResponse.MaterialNumber">
|
||||||
|
<summary>
|
||||||
|
物料编码
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Dto.OutStockTask.ExportInfoResponse.BarCode">
|
||||||
|
<summary>
|
||||||
|
物料69条码
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Dto.OutStockTask.ExportInfoResponse.SerialNumbers">
|
||||||
|
<summary>
|
||||||
|
序列号
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="T:WMS.Web.Core.Dto.OutStockTask.GetOutStockTaskByNoResponse">
|
<member name="T:WMS.Web.Core.Dto.OutStockTask.GetOutStockTaskByNoResponse">
|
||||||
<summary>
|
<summary>
|
||||||
根据单号搜索出库单任务信息
|
根据单号搜索出库单任务信息
|
||||||
@@ -4824,6 +4879,21 @@
|
|||||||
出库任务单对应出库明细
|
出库任务单对应出库明细
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Dto.OutStockTask.OutStockTaskInfoDetailsResponse.MaterialName">
|
||||||
|
<summary>
|
||||||
|
物料名称
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Dto.OutStockTask.OutStockTaskInfoDetailsResponse.BarCode">
|
||||||
|
<summary>
|
||||||
|
物料69条码
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Dto.OutStockTask.OutStockTaskInfoDetailsResponse.SerialNumberList">
|
||||||
|
<summary>
|
||||||
|
序列号(数组)
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="P:WMS.Web.Core.Dto.OutStockTask.OutStockTaskInfoDetailsResponse.MaterialNumber">
|
<member name="P:WMS.Web.Core.Dto.OutStockTask.OutStockTaskInfoDetailsResponse.MaterialNumber">
|
||||||
<summary>
|
<summary>
|
||||||
物料编码
|
物料编码
|
||||||
@@ -4889,6 +4959,11 @@
|
|||||||
来源单号
|
来源单号
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Dto.OutStockTask.OutStockTaskInfoResponse.SaleBillNo">
|
||||||
|
<summary>
|
||||||
|
销售订单号
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="P:WMS.Web.Core.Dto.OutStockTask.OutStockTaskInfoResponse.DeliveryOrg">
|
<member name="P:WMS.Web.Core.Dto.OutStockTask.OutStockTaskInfoResponse.DeliveryOrg">
|
||||||
<summary>
|
<summary>
|
||||||
发货组织
|
发货组织
|
||||||
|
|||||||
@@ -4192,13 +4192,20 @@
|
|||||||
<param name="begin"></param>
|
<param name="begin"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:WMS.Web.Domain.IService.Public.IOutStockTaskService.GetInfo(System.Int32,WMS.Web.Core.Dto.Login.LoginInDto)">
|
<member name="M:WMS.Web.Domain.IService.Public.IOutStockTaskService.GetInfo(System.Int32,WMS.Web.Core.Dto.Login.LoginInDto,Microsoft.Extensions.DependencyInjection.IServiceScope)">
|
||||||
<summary>
|
<summary>
|
||||||
查询出库任务单详情
|
查询出库任务单详情
|
||||||
</summary>
|
</summary>
|
||||||
<param name="id"></param>
|
<param name="id"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:WMS.Web.Domain.IService.Public.IOutStockTaskService.ExportInfo(WMS.Web.Core.Dto.OperateRequest,System.String,WMS.Web.Core.Dto.Login.LoginInDto)">
|
||||||
|
<summary>
|
||||||
|
导出详情
|
||||||
|
</summary>
|
||||||
|
<param name="dto"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="T:WMS.Web.Domain.IService.Public.ISingleDataService">
|
<member name="T:WMS.Web.Domain.IService.Public.ISingleDataService">
|
||||||
<summary>
|
<summary>
|
||||||
单点数据返回服务接口
|
单点数据返回服务接口
|
||||||
@@ -5441,13 +5448,20 @@
|
|||||||
<param name="sourceBillNos"></param>
|
<param name="sourceBillNos"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:WMS.Web.Domain.Services.OutStockTaskService.GetInfo(System.Int32,WMS.Web.Core.Dto.Login.LoginInDto)">
|
<member name="M:WMS.Web.Domain.Services.OutStockTaskService.GetInfo(System.Int32,WMS.Web.Core.Dto.Login.LoginInDto,Microsoft.Extensions.DependencyInjection.IServiceScope)">
|
||||||
<summary>
|
<summary>
|
||||||
获取出库任务单详情
|
获取出库任务单详情
|
||||||
</summary>
|
</summary>
|
||||||
<param name="id"></param>
|
<param name="id"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:WMS.Web.Domain.Services.OutStockTaskService.ExportInfo(WMS.Web.Core.Dto.OperateRequest,System.String,WMS.Web.Core.Dto.Login.LoginInDto)">
|
||||||
|
<summary>
|
||||||
|
导出详情
|
||||||
|
</summary>
|
||||||
|
<param name="dto"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="T:WMS.Web.Domain.Services.Public.ErpBaseDataSync">
|
<member name="T:WMS.Web.Domain.Services.Public.ErpBaseDataSync">
|
||||||
<summary>
|
<summary>
|
||||||
同步erp基础数据
|
同步erp基础数据
|
||||||
@@ -6596,6 +6610,11 @@
|
|||||||
出入库回退上下架
|
出入库回退上下架
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="F:WMS.Web.Domain.Values.FileDownLoadOrderType.OutStockTaskInfo">
|
||||||
|
<summary>
|
||||||
|
出库信息
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="T:WMS.Web.Domain.Values.InstockStatus">
|
<member name="T:WMS.Web.Domain.Values.InstockStatus">
|
||||||
<summary>
|
<summary>
|
||||||
入库状态
|
入库状态
|
||||||
|
|||||||
64
src/WMS.Web.Core/Dto/OutStockTask/ExportInfoResponse.cs
Normal file
64
src/WMS.Web.Core/Dto/OutStockTask/ExportInfoResponse.cs
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
using Npoi.Mapper.Attributes;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace WMS.Web.Core.Dto.OutStockTask
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 出库单导出详情
|
||||||
|
/// </summary>
|
||||||
|
public class ExportInfoResponse
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 来源单号
|
||||||
|
/// </summary>
|
||||||
|
[Column("来源单号")]
|
||||||
|
public string SourceBillNo { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 销售订单号
|
||||||
|
///</summary>
|
||||||
|
[Column("销售订单号")]
|
||||||
|
public string SaleBillNo { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 出库时间
|
||||||
|
/// </summary>
|
||||||
|
[Column("销售出库时间")]
|
||||||
|
public string CreateTime { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 客户
|
||||||
|
///</summary>
|
||||||
|
[Column("客户")]
|
||||||
|
public string ReceiptCustomer { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 箱号
|
||||||
|
/// </summary>
|
||||||
|
[Column("箱号")]
|
||||||
|
public string BoxBillNo { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 物料规格型号
|
||||||
|
/// </summary>
|
||||||
|
[Column("规格型号")]
|
||||||
|
public string Specifications { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 物料名称
|
||||||
|
/// </summary>
|
||||||
|
[Column("物料名称")]
|
||||||
|
public string MaterialName { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 物料编码
|
||||||
|
/// </summary>
|
||||||
|
[Column("物料编码")]
|
||||||
|
public string MaterialNumber { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 物料69条码
|
||||||
|
/// </summary>
|
||||||
|
[Column("EAN 69码")]
|
||||||
|
public string BarCode { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 序列号
|
||||||
|
/// </summary>
|
||||||
|
[Column("序列号")]
|
||||||
|
public string SerialNumbers { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -9,6 +9,18 @@ namespace WMS.Web.Core.Dto.OutStockTask
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class OutStockTaskInfoDetailsResponse
|
public class OutStockTaskInfoDetailsResponse
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 物料名称
|
||||||
|
/// </summary>
|
||||||
|
public string MaterialName { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 物料69条码
|
||||||
|
/// </summary>
|
||||||
|
public string BarCode { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 序列号(数组)
|
||||||
|
/// </summary>
|
||||||
|
public List<string> SerialNumberList { get; set; } = new List<string>();
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 物料编码
|
/// 物料编码
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -22,6 +22,10 @@ namespace WMS.Web.Core.Dto.OutStockTask
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string SourceBillNo { get; set; }
|
public string SourceBillNo { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
/// 销售订单号
|
||||||
|
///</summary>
|
||||||
|
public string SaleBillNo { get; set; }
|
||||||
|
/// <summary>
|
||||||
/// 发货组织
|
/// 发货组织
|
||||||
///</summary>
|
///</summary>
|
||||||
public string DeliveryOrg { get; set; }
|
public string DeliveryOrg { get; set; }
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ using WMS.Web.Core.Dto.Erp.OutStock;
|
|||||||
using WMS.Web.Core.Dto.Login;
|
using WMS.Web.Core.Dto.Login;
|
||||||
using WMS.Web.Core.Dto.OutStockTask;
|
using WMS.Web.Core.Dto.OutStockTask;
|
||||||
using WMS.Web.Core.Internal.Results;
|
using WMS.Web.Core.Internal.Results;
|
||||||
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
|
||||||
namespace WMS.Web.Domain.IService.Public
|
namespace WMS.Web.Domain.IService.Public
|
||||||
{
|
{
|
||||||
@@ -62,6 +63,12 @@ namespace WMS.Web.Domain.IService.Public
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="id"></param>
|
/// <param name="id"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<Result<OutStockTaskInfoResponse>> GetInfo(int id, LoginInDto loginInfo);
|
Task<Result<OutStockTaskInfoResponse>> GetInfo(int id, LoginInDto loginInfo, IServiceScope scope = null);
|
||||||
|
/// <summary>
|
||||||
|
/// 导出详情
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="dto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task ExportInfo(OperateRequest dto,string fileName, LoginInDto loginInfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ using WMS.Web.Domain.IService.Public;
|
|||||||
using WMS.Web.Domain.Services.Public;
|
using WMS.Web.Domain.Services.Public;
|
||||||
using WMS.Web.Domain.Values;
|
using WMS.Web.Domain.Values;
|
||||||
using WMS.Web.Domain.Values.Single;
|
using WMS.Web.Domain.Values.Single;
|
||||||
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
|
||||||
namespace WMS.Web.Domain.Services
|
namespace WMS.Web.Domain.Services
|
||||||
{
|
{
|
||||||
@@ -31,22 +32,24 @@ namespace WMS.Web.Domain.Services
|
|||||||
public class OutStockTaskService : IOutStockTaskService
|
public class OutStockTaskService : IOutStockTaskService
|
||||||
{
|
{
|
||||||
private readonly IMapper _mapper;
|
private readonly IMapper _mapper;
|
||||||
private readonly IErpService _erpService;
|
private IErpService _erpService;
|
||||||
private readonly ILoginService _loginService;
|
private readonly ILoginService _loginService;
|
||||||
private readonly IBasicsRepositories _transactionRepositories;
|
private readonly IBasicsRepositories _transactionRepositories;
|
||||||
private readonly IOutStockRepositories _outStockRepositories;
|
private IOutStockRepositories _outStockRepositories;
|
||||||
private readonly IOutStockTaskRepositories _outStockTaskRepositories;
|
private IOutStockTaskRepositories _outStockTaskRepositories;
|
||||||
private readonly IErpOpsSyncDateRepositories _erpOpsSyncDateRepositories;
|
private readonly IErpOpsSyncDateRepositories _erpOpsSyncDateRepositories;
|
||||||
private readonly RedisClientService _redisClientService;
|
private readonly RedisClientService _redisClientService;
|
||||||
private readonly IErpBasicDataExtendService _erpBasicDataExtendService;
|
private readonly IErpBasicDataExtendService _erpBasicDataExtendService;
|
||||||
private readonly ISingleDataService _singleDataService;
|
private readonly ISingleDataService _singleDataService;
|
||||||
private readonly IBoxRepositories _boxRepositories;
|
private readonly IBoxRepositories _boxRepositories;
|
||||||
|
private readonly IExportExcelService _exportExcelService;
|
||||||
|
private readonly IServiceScopeFactory _serviceScopeFactory;
|
||||||
|
|
||||||
public OutStockTaskService(IMapper mapper, IErpService erpService, ILoginService loginService,
|
public OutStockTaskService(IMapper mapper, IErpService erpService, ILoginService loginService,
|
||||||
IBasicsRepositories transactionRepositories,
|
IBasicsRepositories transactionRepositories,
|
||||||
IOutStockRepositories outStockRepositories, IOutStockTaskRepositories outStockTaskRepositories, IErpOpsSyncDateRepositories erpOpsSyncDateRepositories,
|
IOutStockRepositories outStockRepositories, IOutStockTaskRepositories outStockTaskRepositories, IErpOpsSyncDateRepositories erpOpsSyncDateRepositories,
|
||||||
RedisClientService redisClientService, IErpBasicDataExtendService erpBasicDataExtendService,
|
RedisClientService redisClientService, IErpBasicDataExtendService erpBasicDataExtendService,
|
||||||
ISingleDataService singleDataService, IBoxRepositories boxRepositories)
|
ISingleDataService singleDataService, IBoxRepositories boxRepositories, IExportExcelService exportExcelService, IServiceScopeFactory serviceScopeFactory)
|
||||||
{
|
{
|
||||||
_mapper = mapper;
|
_mapper = mapper;
|
||||||
_erpService = erpService;
|
_erpService = erpService;
|
||||||
@@ -59,6 +62,8 @@ namespace WMS.Web.Domain.Services
|
|||||||
_erpBasicDataExtendService = erpBasicDataExtendService;
|
_erpBasicDataExtendService = erpBasicDataExtendService;
|
||||||
_singleDataService = singleDataService;
|
_singleDataService = singleDataService;
|
||||||
_boxRepositories = boxRepositories;
|
_boxRepositories = boxRepositories;
|
||||||
|
_exportExcelService = exportExcelService;
|
||||||
|
_serviceScopeFactory = serviceScopeFactory;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -454,8 +459,15 @@ namespace WMS.Web.Domain.Services
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="id"></param>
|
/// <param name="id"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<Result<OutStockTaskInfoResponse>> GetInfo(int id, LoginInDto loginInfo)
|
public async Task<Result<OutStockTaskInfoResponse>> GetInfo(int id, LoginInDto loginInfo, IServiceScope scope = null)
|
||||||
{
|
{
|
||||||
|
if (scope == null)
|
||||||
|
{
|
||||||
|
_outStockTaskRepositories = scope.ServiceProvider.GetRequiredService<IOutStockTaskRepositories>();
|
||||||
|
_outStockRepositories = scope.ServiceProvider.GetRequiredService<IOutStockRepositories>();
|
||||||
|
_erpService = scope.ServiceProvider.GetRequiredService<IErpService>();
|
||||||
|
}
|
||||||
|
|
||||||
var entity = await _outStockTaskRepositories.Get(id);
|
var entity = await _outStockTaskRepositories.Get(id);
|
||||||
if (entity == null)
|
if (entity == null)
|
||||||
return Result<OutStockTaskInfoResponse>.ReFailure(ResultCodes.OutStockTaskNoData);
|
return Result<OutStockTaskInfoResponse>.ReFailure(ResultCodes.OutStockTaskNoData);
|
||||||
@@ -483,7 +495,8 @@ namespace WMS.Web.Domain.Services
|
|||||||
{
|
{
|
||||||
Id = entity.Id,
|
Id = entity.Id,
|
||||||
BillNo = entity.BillNo,
|
BillNo = entity.BillNo,
|
||||||
SourceBillNo = string.Join(",", entity.Details.SelectMany(s => s.ErpDetails).Select(s => s.SourceBillNo)),
|
SourceBillNo = string.Join(",", entity.Details.SelectMany(s => s.ErpDetails).Select(s => s.SourceBillNo).Distinct()),
|
||||||
|
SaleBillNo = string.Join(",", entity.Details.SelectMany(s => s.ErpDetails).Select(s => s.SaleBillNo).Distinct()),
|
||||||
CreateTime = entity.CreateTime.DateToStringSeconds(),
|
CreateTime = entity.CreateTime.DateToStringSeconds(),
|
||||||
Status = entity.Status.GetRemark(),
|
Status = entity.Status.GetRemark(),
|
||||||
Type = entity.Type.GetRemark(),
|
Type = entity.Type.GetRemark(),
|
||||||
@@ -499,16 +512,20 @@ namespace WMS.Web.Domain.Services
|
|||||||
{
|
{
|
||||||
var detail = details.FirstOrDefault(f => f.Id == b.DetailId);
|
var detail = details.FirstOrDefault(f => f.Id == b.DetailId);
|
||||||
var outStock = outStockList.FirstOrDefault(f => f.Id == detail.Fid);
|
var outStock = outStockList.FirstOrDefault(f => f.Id == detail.Fid);
|
||||||
|
var m = materials.FirstOrDefault(f => f.MaterialNumber.Equals(detail.MaterialNumber));
|
||||||
OutStockTaskInfoDetailsResponse infoDetail = new OutStockTaskInfoDetailsResponse()
|
OutStockTaskInfoDetailsResponse infoDetail = new OutStockTaskInfoDetailsResponse()
|
||||||
{
|
{
|
||||||
BoxBillNo = boxList.FirstOrDefault(f => f.Id == b.BoxId)?.BoxBillNo ?? "",
|
BoxBillNo = boxList.FirstOrDefault(f => f.Id == b.BoxId)?.BoxBillNo ?? "",
|
||||||
Qty = b.Qty,
|
Qty = b.Qty,
|
||||||
SerialNumbers = string.Join(",", b.SerialNumbers),
|
SerialNumbers = string.Join(",", b.SerialNumbers),
|
||||||
|
SerialNumberList = b.SerialNumbers,
|
||||||
Method = outStock.Method.GetRemark(),
|
Method = outStock.Method.GetRemark(),
|
||||||
Creator = _singleDataService.GetSingleData(SingleAction.Staffs, loginInfo.UserInfo.CompanyId, outStock.CreatorId),
|
Creator = _singleDataService.GetSingleData(SingleAction.Staffs, loginInfo.UserInfo.CompanyId, outStock.CreatorId),
|
||||||
CreateTime = outStock.CreateTime.DateToStringSeconds(),
|
CreateTime = outStock.CreateTime.DateToStringSeconds(),
|
||||||
MaterialNumber = detail.MaterialNumber,
|
MaterialNumber = detail.MaterialNumber,
|
||||||
Specifications = _erpBasicDataExtendService.GetMaterialSpecifications(materials, detail.MaterialNumber),
|
Specifications = m?.Specifications ?? "",
|
||||||
|
BarCode = m?.BarCode ?? "",
|
||||||
|
MaterialName = m?.MaterialName ?? "",
|
||||||
AccruedQty = entity.Details.FirstOrDefault(f => f.MaterialNumber == detail.MaterialNumber)?.AccruedQty ?? 0
|
AccruedQty = entity.Details.FirstOrDefault(f => f.MaterialNumber == detail.MaterialNumber)?.AccruedQty ?? 0
|
||||||
};
|
};
|
||||||
response.Details.Add(infoDetail);
|
response.Details.Add(infoDetail);
|
||||||
@@ -516,5 +533,65 @@ namespace WMS.Web.Domain.Services
|
|||||||
|
|
||||||
return Result<OutStockTaskInfoResponse>.ReSuccess(response);
|
return Result<OutStockTaskInfoResponse>.ReSuccess(response);
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 导出详情
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="dto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task ExportInfo(OperateRequest dto, string fileName, LoginInDto loginInfo)
|
||||||
|
{
|
||||||
|
var ids = dto.Ids.Distinct().ToList();
|
||||||
|
using (var scope = _serviceScopeFactory.CreateScope())
|
||||||
|
{
|
||||||
|
List<ExportInfoResponse> list = new List<ExportInfoResponse>();
|
||||||
|
foreach (var id in ids)
|
||||||
|
{
|
||||||
|
var info = await this.GetInfo(id, loginInfo, scope);
|
||||||
|
if (!info.IsSuccess) continue;
|
||||||
|
var response = info.Data;
|
||||||
|
foreach (var d in response.Details)
|
||||||
|
{
|
||||||
|
if (d.SerialNumberList == null || d.SerialNumberList.Count() <= 0)
|
||||||
|
{
|
||||||
|
list.Add(new ExportInfoResponse()
|
||||||
|
{
|
||||||
|
SourceBillNo = response.SourceBillNo,
|
||||||
|
SaleBillNo = response.SaleBillNo,
|
||||||
|
ReceiptCustomer = response.ReceiptCustomer,
|
||||||
|
CreateTime = d.CreateTime,
|
||||||
|
BoxBillNo = d.BoxBillNo,
|
||||||
|
Specifications = d.Specifications,
|
||||||
|
MaterialName = d.MaterialName,
|
||||||
|
MaterialNumber = d.MaterialNumber,
|
||||||
|
BarCode = d.BarCode,
|
||||||
|
SerialNumbers = ""
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
foreach (var s in d.SerialNumberList)
|
||||||
|
{
|
||||||
|
list.Add(new ExportInfoResponse()
|
||||||
|
{
|
||||||
|
SourceBillNo = response.SourceBillNo,
|
||||||
|
SaleBillNo = response.SaleBillNo,
|
||||||
|
ReceiptCustomer = response.ReceiptCustomer,
|
||||||
|
CreateTime = d.CreateTime,
|
||||||
|
BoxBillNo = d.BoxBillNo,
|
||||||
|
Specifications = d.Specifications,
|
||||||
|
MaterialName = d.MaterialName,
|
||||||
|
MaterialNumber = d.MaterialNumber,
|
||||||
|
BarCode = d.BarCode,
|
||||||
|
SerialNumbers = s
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var _exportExcelService = scope.ServiceProvider.GetRequiredService<IExportExcelService>();
|
||||||
|
await _exportExcelService.Export(list, fileName, loginInfo.UserInfo.StaffId, loginInfo.UserInfo.CompanyId, FileDownLoadOrderType.OutStockTaskInfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,5 +65,10 @@ namespace WMS.Web.Domain.Values
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[EnumRemark("出入库回退上下架")]
|
[EnumRemark("出入库回退上下架")]
|
||||||
BackRecord = 11,
|
BackRecord = 11,
|
||||||
|
/// <summary>
|
||||||
|
/// 出库信息
|
||||||
|
/// </summary>
|
||||||
|
[EnumRemark("出库信息")]
|
||||||
|
OutStockTaskInfo = 12,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user