|
|
@ -78,6 +78,9 @@ namespace WY.NewJit.EdiReceive |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private readonly IUnitOfWorkManager _unitOfWorkManager; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
@ -91,7 +94,8 @@ namespace WY.NewJit.EdiReceive |
|
|
|
IBlobContainer<OurFileContainer> blobContainer, |
|
|
|
DicDomainService dicDomainService, |
|
|
|
EdiParseDomainService ediParseDomainService, |
|
|
|
Microsoft.Extensions.Configuration.IConfiguration configuration) |
|
|
|
Microsoft.Extensions.Configuration.IConfiguration configuration, |
|
|
|
IUnitOfWorkManager unitOfWorkManager) |
|
|
|
{ |
|
|
|
_importRecordRepository = importRecordRepository; |
|
|
|
_logger = logger; |
|
|
@ -100,6 +104,7 @@ namespace WY.NewJit.EdiReceive |
|
|
|
_dicDomainService = dicDomainService; |
|
|
|
_ediParseDomainService = ediParseDomainService; |
|
|
|
_configuration = configuration; |
|
|
|
_unitOfWorkManager = unitOfWorkManager; |
|
|
|
} |
|
|
|
|
|
|
|
#region 私有方法
|
|
|
@ -423,7 +428,7 @@ namespace WY.NewJit.EdiReceive |
|
|
|
/// <param name="files">导入文件</param>
|
|
|
|
/// <param name="forceExecute">校验出错时,是否强制执行</param>
|
|
|
|
/// <returns>执行成功返回真</returns>
|
|
|
|
[UnitOfWork] |
|
|
|
[UnitOfWork(IsDisabled =true)] |
|
|
|
[HttpPost] |
|
|
|
[Route("import")] |
|
|
|
[DisableRequestSizeLimit] |
|
|
@ -465,6 +470,8 @@ namespace WY.NewJit.EdiReceive |
|
|
|
return ret; |
|
|
|
} |
|
|
|
|
|
|
|
using (var uow = _unitOfWorkManager.Begin()) |
|
|
|
{ |
|
|
|
var srcLst = impResult.Data.AsEnumerable().ToList(); |
|
|
|
var tarLst = ObjectMapper.Map<List<ImportRecordDto>, List<ImportRecord>>(srcLst); |
|
|
|
foreach (var tar in tarLst) |
|
|
@ -482,9 +489,11 @@ namespace WY.NewJit.EdiReceive |
|
|
|
{ |
|
|
|
return ret2; |
|
|
|
} |
|
|
|
await uow.CompleteAsync(); |
|
|
|
ret.Status = true; |
|
|
|
return ret; |
|
|
|
} |
|
|
|
} |
|
|
|
catch (Exception ex) |
|
|
|
{ |
|
|
|
ret.Status = false; |
|
|
|