修改提单管理

dev
jianghaiqing 3 weeks ago
parent b16e503ec9
commit 3c2e800faa

@ -21,11 +21,11 @@ namespace DS.WMS.Core.Op.Interface
Task<DataResult<List<BLIssueManageBaseDto>>> GetPageAsync(PageRequest querySearch); Task<DataResult<List<BLIssueManageBaseDto>>> GetPageAsync(PageRequest querySearch);
/// <summary> /// <summary>
/// 导出 /// 获取导出数据列表
/// </summary> /// </summary>
/// <param name="querySearch">查询条件</param> /// <param name="querySearch">查询条件</param>
/// <returns>返回回执</returns> /// <returns>返回回执</returns>
Task<DataResult<string>> Export(PageRequest querySearch); Task<DataResult<List<BLIssueManageBaseDto>>> GetExportList(PageRequest querySearch);
/// <summary> /// <summary>
/// 打印 /// 打印

@ -69,6 +69,7 @@ using DS.WMS.Core.Application.Dtos;
using iText.Layout.Element; using iText.Layout.Element;
using AngleSharp.Html; using AngleSharp.Html;
using DS.WMS.Core.Op.Dtos.Enum; using DS.WMS.Core.Op.Dtos.Enum;
using static Microsoft.EntityFrameworkCore.DbLoggerCategory;
namespace DS.WMS.Core.Op.Method namespace DS.WMS.Core.Op.Method
{ {
@ -185,15 +186,93 @@ namespace DS.WMS.Core.Op.Method
} }
#endregion #endregion
#region 导出 #region 获取导出数据列表
/// <summary> /// <summary>
/// 导出 /// 获取导出数据列表
/// </summary> /// </summary>
/// <param name="querySearch">查询条件</param> /// <param name="querySearch">查询条件</param>
/// <returns>返回回执</returns> /// <returns>返回回执</returns>
public async Task<DataResult<string>> Export(PageRequest querySearch) public async Task<DataResult<List<BLIssueManageBaseDto>>> GetExportList(PageRequest querySearch)
{ {
return null; var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var query = tenantDb.Queryable<SeaExport>().ClearFilter(typeof(IOrgId))
.LeftJoin<BLIssueManageBase>((l, r) => l.Id == r.BookingId)
.Select((l, r) => new { order = l, bl = r });
if (!querySearch.QueryCondition.IsNullOrEmpty())
{
var whereList = querySearch.GetConditionalModels(db);
query = query.Where(whereList);
}
querySearch.PageCondition.PageSize = Int16.MaxValue;
var result = await query.ToQueryPageAsync(querySearch.PageCondition);
List<BLIssueManageBaseDto> resultList = new List<BLIssueManageBaseDto>();
if (result.Data.Count > 0)
{
int start = 1;
foreach (var data in result.Data)
{
if (data.bl != null && data.bl.Id > 0)
{
var currBl = data.bl.Adapt<BLIssueManageBaseDto>();
currBl.IssueType = data.order.IssueType;
currBl.IssueTypeCode = data.order.IssueTypeCode;
currBl.IssuePlaceId = data.order.IssuePlaceId;
currBl.IssuePlaceCode = data.order.IssuePlaceCode;
currBl.IssuePlace = data.order.IssuePlace;
currBl.LoadPortId = data.order.LoadPortId;
currBl.LoadPortCode = data.order.LoadPortCode;
currBl.LoadPort = data.order.LoadPort;
currBl.DischargePortId = data.order.DischargePortId;
currBl.DischargePortCode = data.order.DischargePortCode;
currBl.DischargePort = data.order.DischargePort;
currBl.CustomerService = data.order.CustomerService;
currBl.CustomerServiceName = data.order.CustomerServiceName;
resultList.Add(currBl);
continue;
}
resultList.Add(new BLIssueManageBaseDto
{
Id = start,
BookingId = data.order.Id,
BLNo = data.order.MBLNO,
CustomerId = data.order.CustomerId,
CustomerName = data.order.CustomerName,
SaleId = data.order.SaleId,
Sale = data.order.Sale,
IssueType = data.order.IssueType,
IssueTypeCode = data.order.IssueTypeCode,
IssuePlaceCode = data.order.IssuePlaceCode,
IssuePlace = data.order.IssuePlace,
LoadPortId = data.order.LoadPortId,
LoadPortCode = data.order.LoadPortCode,
LoadPort = data.order.LoadPort,
DischargePortId = data.order.DischargePortId,
DischargePortCode = data.order.DischargePortCode,
DischargePort = data.order.DischargePort,
CustomerService = data.order.CustomerService,
CustomerServiceName = data.order.CustomerServiceName,
BusiType = BLIssueBusiTypeEnum.SeaExport.ToString(),
BusiTypeName = BLIssueBusiTypeEnum.SeaExport.GetDescription(),
BLType = BLTypeEnum.BL.ToString(),
BLTypeName = BLTypeEnum.BL.GetDescription(),
});
start++;
}
}
return DataResult<List<BLIssueManageBaseDto>>.Success(resultList);
} }
#endregion #endregion

@ -40,17 +40,17 @@ namespace DS.WMS.OpApi.Controllers
} }
#endregion #endregion
#region 导出 #region 获取导出数据列表
/// <summary> /// <summary>
/// 导出 /// 获取导出数据列表
/// </summary> /// </summary>
/// <param name="querySearch">查询条件</param> /// <param name="querySearch">查询条件</param>
/// <returns>返回回执</returns> /// <returns>返回回执</returns>
[HttpPost] [HttpPost]
[Route("Export")] [Route("GetExportList")]
public async Task<DataResult<string>> Export([FromBody] PageRequest querySearch) public async Task<DataResult<List<BLIssueManageBaseDto>>> GetExportList(PageRequest querySearch)
{ {
return await _BLIssueManageService.Export(querySearch); return await _BLIssueManageService.GetExportList(querySearch);
} }
#endregion #endregion

Loading…
Cancel
Save