增加留存字段
This commit is contained in:
@@ -50,6 +50,26 @@ namespace WMS.Web.Domain.Entitys
|
|||||||
[Column("DestBoxId")]
|
[Column("DestBoxId")]
|
||||||
public int DestBoxId { get; set; }
|
public int DestBoxId { get; set; }
|
||||||
/// <summary>
|
/// <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>
|
/// </summary>
|
||||||
[Column("CreatorId")]
|
[Column("CreatorId")]
|
||||||
|
|||||||
@@ -31,6 +31,11 @@ namespace WMS.Web.Domain.Entitys
|
|||||||
[Column("BoxId")]
|
[Column("BoxId")]
|
||||||
public int BoxId { get; set; }
|
public int BoxId { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
/// 组织编码
|
||||||
|
///</summary>
|
||||||
|
[Column("OrgCode")]
|
||||||
|
public string OrgCode { get; set; }
|
||||||
|
/// <summary>
|
||||||
/// 仓库
|
/// 仓库
|
||||||
///</summary>
|
///</summary>
|
||||||
[Column("StockCode")]
|
[Column("StockCode")]
|
||||||
|
|||||||
@@ -51,6 +51,11 @@ namespace WMS.Web.Domain.Entitys
|
|||||||
[Column("MaterialId")]
|
[Column("MaterialId")]
|
||||||
public int MaterialId { get; set; }
|
public int MaterialId { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
/// 组织编码
|
||||||
|
/// </summary>
|
||||||
|
[Column("OrgCode")]
|
||||||
|
public string OrgCode { get; set; }
|
||||||
|
/// <summary>
|
||||||
/// 仓库
|
/// 仓库
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Column("StockCode")]
|
[Column("StockCode")]
|
||||||
|
|||||||
@@ -36,11 +36,12 @@ namespace WMS.Web.Domain.Services
|
|||||||
private readonly IErpService _erpService;
|
private readonly IErpService _erpService;
|
||||||
private readonly ISerialNumberService _serialNumberService;
|
private readonly ISerialNumberService _serialNumberService;
|
||||||
private readonly IBoxInventoryService _boxInventoryService;
|
private readonly IBoxInventoryService _boxInventoryService;
|
||||||
|
private readonly IInventoryInOutDetailsService _inventoryInOutDetailsService;
|
||||||
public OutStockService(IMapper mapper, ILoginService loginService,
|
public OutStockService(IMapper mapper, ILoginService loginService,
|
||||||
IBasicsRepositories transactionRepositories,
|
IBasicsRepositories transactionRepositories,
|
||||||
IOutStockRepositories outStockRepositories, IOutStockTaskRepositories outStockTaskRepositories,
|
IOutStockRepositories outStockRepositories, IOutStockTaskRepositories outStockTaskRepositories,
|
||||||
IOutStockTaskService outStockTaskService, IErpService erpService, ISerialNumberService serialNumberService,
|
IOutStockTaskService outStockTaskService, IErpService erpService, ISerialNumberService serialNumberService,
|
||||||
IBoxInventoryService boxInventoryService)
|
IBoxInventoryService boxInventoryService, IInventoryInOutDetailsService inventoryInOutDetailsService)
|
||||||
{
|
{
|
||||||
_mapper = mapper;
|
_mapper = mapper;
|
||||||
_loginService = loginService;
|
_loginService = loginService;
|
||||||
@@ -51,6 +52,7 @@ namespace WMS.Web.Domain.Services
|
|||||||
_erpService = erpService;
|
_erpService = erpService;
|
||||||
_serialNumberService = serialNumberService;
|
_serialNumberService = serialNumberService;
|
||||||
_boxInventoryService = boxInventoryService;
|
_boxInventoryService = boxInventoryService;
|
||||||
|
_inventoryInOutDetailsService = inventoryInOutDetailsService;
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 出库单
|
/// 出库单
|
||||||
@@ -120,6 +122,19 @@ namespace WMS.Web.Domain.Services
|
|||||||
};
|
};
|
||||||
inventoryList.Add(inventory);
|
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
|
#endregion
|
||||||
|
|
||||||
IDbContextTransaction _transaction = _transactionRepositories.GetTransaction();
|
IDbContextTransaction _transaction = _transactionRepositories.GetTransaction();
|
||||||
@@ -143,6 +158,11 @@ namespace WMS.Web.Domain.Services
|
|||||||
var res_change = await _serialNumberService.OutStock(entity, loginInfo, false);
|
var res_change = await _serialNumberService.OutStock(entity, loginInfo, false);
|
||||||
if (!res_change.IsSuccess) res_Rollback = res_change;
|
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);
|
isSuccess = _transactionRepositories.CommitTransaction(res_Rollback.IsSuccess ? false : true, _transaction);
|
||||||
if (!res_Rollback.IsSuccess) return res_Rollback;
|
if (!res_Rollback.IsSuccess) return res_Rollback;
|
||||||
|
|||||||
Reference in New Issue
Block a user