Browse Source

更新版本

Agv分支2024-11-19
赵新宇 5 months ago
parent
commit
135c32e0a8
  1. 13
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferNotes/TransferNoteAppService.cs

13
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferNotes/TransferNoteAppService.cs

@ -31,6 +31,7 @@ using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
using Volo.Abp.ObjectMapping; using Volo.Abp.ObjectMapping;
using NUglify.Helpers; using NUglify.Helpers;
using Volo.Abp.Uow;
namespace Win_in.Sfs.Wms.Store.Application; namespace Win_in.Sfs.Wms.Store.Application;
@ -64,7 +65,7 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase
private readonly IPostionLocationAppService _postionLocationAppService; private readonly IPostionLocationAppService _postionLocationAppService;
private readonly UnitOfWorkManager _unitOfWorkManager;
public TransferNoteAppService( public TransferNoteAppService(
ITransferNoteRepository repository, ITransferNoteRepository repository,
@ -82,8 +83,10 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase
IOptions<AgvOptions> agvOptions, IOptions<AgvOptions> agvOptions,
IPostionLocationAppService postionLocationAppService, IPostionLocationAppService postionLocationAppService,
IItemBasicAppService itemBasicAppService, IItemBasicAppService itemBasicAppService,
UnitOfWorkManager unitOfWorkManager,
IExpectOutAppService expectOutAppService) : base(repository) IExpectOutAppService expectOutAppService) : base(repository)
{ {
_unitOfWorkManager = unitOfWorkManager;
_transferNoteManager = transferNoteManager; _transferNoteManager = transferNoteManager;
_balanceAppService = balanceAppService; _balanceAppService = balanceAppService;
_locationAppService = locationAppService; _locationAppService = locationAppService;
@ -682,6 +685,7 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase
Message = "OK", Message = "OK",
ReqCode = "", ReqCode = "",
}; };
using var unitOfWork = _unitOfWorkManager.Begin();
try try
{ {
if (request.Data.Count > 0) if (request.Data.Count > 0)
@ -752,10 +756,10 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase
detailInput.ToLocationArea = tolocation.AreaCode; detailInput.ToLocationArea = tolocation.AreaCode;
detailInput.ToLocationErpCode = tolocation.ErpLocationCode; detailInput.ToLocationErpCode = tolocation.ErpLocationCode;
detailInput.ToWarehouseCode = tolocation.WarehouseCode; detailInput.ToWarehouseCode = tolocation.WarehouseCode;
detailInput.FromStatus = tolocation.DefaultInventoryStatus; detailInput.FromStatus = tolocation.DefaultInventoryStatus;
detailInput.Qty = detail.MatQty; detailInput.Qty = detail.MatQty;
detailInput.ToLot = !string.IsNullOrEmpty(detail.BatchAttr07) ? detail.BatchAttr07 : string.Empty; detailInput.ToLot = !string.IsNullOrEmpty(detail.BatchAttr07) ? detail.BatchAttr07 : string.Empty;
detailInput.ToPackingCode = string.Empty; detailInput.ToPackingCode = string.Empty;
@ -788,8 +792,8 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase
ReqCode = "", ReqCode = "",
Message = ex.Message Message = ex.Message
}; };
//await unitOfWork.RollbackAsync(); await unitOfWork.RollbackAsync().ConfigureAwait(false);
return ret;
} }
if (errors.Count > 0) if (errors.Count > 0)
@ -800,6 +804,7 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase
Message = string.Join(",", errors.ToArray()), Message = string.Join(",", errors.ToArray()),
ReqCode = "" ReqCode = ""
}; };
await unitOfWork.RollbackAsync().ConfigureAwait(false);
} }
return ret; return ret;
} }

Loading…
Cancel
Save