增加留存字段

This commit is contained in:
18942506660
2023-11-22 15:11:00 +08:00
parent b9fb9219e9
commit 81616cd477
4 changed files with 51 additions and 1 deletions

View File

@@ -50,6 +50,26 @@ namespace WMS.Web.Domain.Entitys
[Column("DestBoxId")]
public int DestBoxId { get; set; }
/// <summary>
/// 原箱仓位
///</summary>
[Column("SrcSubStockId")]
public int SrcSubStockId { get; set; }
/// <summary>
/// 目标箱的仓库或重新上架选择仓位对应的仓库
/// </summary>
[Column("DestStockCode")]
public string DestStockCode { get; set; }
/// <summary>
/// 目标箱仓位或重新上架选择仓位
///</summary>
[Column("DestSubStockId")]
public string DestSubStockId { get; set; }
/// <summary>
/// 目标箱组织编码
/// </summary>
[Column("DestBoxOrgCode")]
public string DestBoxOrgCode { get; set; }
/// <summary>
/// 操作人
/// </summary>
[Column("CreatorId")]

View File

@@ -31,6 +31,11 @@ namespace WMS.Web.Domain.Entitys
[Column("BoxId")]
public int BoxId { get; set; }
/// <summary>
/// 组织编码
///</summary>
[Column("OrgCode")]
public string OrgCode { get; set; }
/// <summary>
/// 仓库
///</summary>
[Column("StockCode")]

View File

@@ -51,6 +51,11 @@ namespace WMS.Web.Domain.Entitys
[Column("MaterialId")]
public int MaterialId { get; set; }
/// <summary>
/// 组织编码
/// </summary>
[Column("OrgCode")]
public string OrgCode { get; set; }
/// <summary>
/// 仓库
/// </summary>
[Column("StockCode")]

View File

@@ -36,11 +36,12 @@ namespace WMS.Web.Domain.Services
private readonly IErpService _erpService;
private readonly ISerialNumberService _serialNumberService;
private readonly IBoxInventoryService _boxInventoryService;
private readonly IInventoryInOutDetailsService _inventoryInOutDetailsService;
public OutStockService(IMapper mapper, ILoginService loginService,
IBasicsRepositories transactionRepositories,
IOutStockRepositories outStockRepositories, IOutStockTaskRepositories outStockTaskRepositories,
IOutStockTaskService outStockTaskService, IErpService erpService, ISerialNumberService serialNumberService,
IBoxInventoryService boxInventoryService)
IBoxInventoryService boxInventoryService, IInventoryInOutDetailsService inventoryInOutDetailsService)
{
_mapper = mapper;
_loginService = loginService;
@@ -51,6 +52,7 @@ namespace WMS.Web.Domain.Services
_erpService = erpService;
_serialNumberService = serialNumberService;
_boxInventoryService = boxInventoryService;
_inventoryInOutDetailsService = inventoryInOutDetailsService;
}
/// <summary>
/// 出库单
@@ -120,6 +122,19 @@ namespace WMS.Web.Domain.Services
};
inventoryList.Add(inventory);
}
List<InventoryInOutDetailsGenerateDto> generateList = dto.Details.Select(s => new InventoryInOutDetailsGenerateDto()
{
BoxId = s.BoxId,
InventoryInOutType = 2,
OrderBillNo = outStockTask.BillNo,
Qty = s.Qty,
StockCode = outStockTask.StockCode,
MaterialId = s.MaterialId,
SubStockId = s.SubStockId,
OrgCode = outStockTask.OrgCode,
OrderType = 1,
}).ToList();
#endregion
IDbContextTransaction _transaction = _transactionRepositories.GetTransaction();
@@ -143,6 +158,11 @@ namespace WMS.Web.Domain.Services
var res_change = await _serialNumberService.OutStock(entity, loginInfo, false);
if (!res_change.IsSuccess) res_Rollback = res_change;
}
if (res_Rollback.IsSuccess)
{
res_Inventory = await _inventoryInOutDetailsService.GenerateInOrOutDetails(generateList, false);
if (!res_Inventory.IsSuccess) res_Rollback = res_Inventory;
}
//提交事务
isSuccess = _transactionRepositories.CommitTransaction(res_Rollback.IsSuccess ? false : true, _transaction);
if (!res_Rollback.IsSuccess) return res_Rollback;