|
@ -11,6 +11,7 @@ using System.IO; |
|
|
using System.Linq; |
|
|
using System.Linq; |
|
|
using System.Text; |
|
|
using System.Text; |
|
|
using System.Threading.Tasks; |
|
|
using System.Threading.Tasks; |
|
|
|
|
|
using Volo.Abp; |
|
|
using Volo.Abp.Application.Dtos; |
|
|
using Volo.Abp.Application.Dtos; |
|
|
using Volo.Abp.Application.Services; |
|
|
using Volo.Abp.Application.Services; |
|
|
using Volo.Abp.BlobStoring; |
|
|
using Volo.Abp.BlobStoring; |
|
@ -428,9 +429,9 @@ namespace WY.NewJit.EdiReceive |
|
|
/// <param name="files">导入文件</param>
|
|
|
/// <param name="files">导入文件</param>
|
|
|
/// <param name="forceExecute">校验出错时,是否强制执行</param>
|
|
|
/// <param name="forceExecute">校验出错时,是否强制执行</param>
|
|
|
/// <returns>执行成功返回真</returns>
|
|
|
/// <returns>执行成功返回真</returns>
|
|
|
[UnitOfWork(IsDisabled =true)] |
|
|
//[UnitOfWork(IsDisabled =true)]
|
|
|
//[UnitOfWork(isTransactional: false)] //[UnitOfWork(false)]
|
|
|
//[UnitOfWork(isTransactional: false)] //[UnitOfWork(false)]
|
|
|
//[UnitOfWork]
|
|
|
[UnitOfWork] |
|
|
[HttpPost] |
|
|
[HttpPost] |
|
|
[Route("import")] |
|
|
[Route("import")] |
|
|
[DisableRequestSizeLimit] |
|
|
[DisableRequestSizeLimit] |
|
@ -472,36 +473,38 @@ namespace WY.NewJit.EdiReceive |
|
|
return ret; |
|
|
return ret; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
using (var uow = _unitOfWorkManager.Begin(requiresNew:true)) |
|
|
//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) |
|
|
{ |
|
|
{ |
|
|
var srcLst = impResult.Data.AsEnumerable().ToList(); |
|
|
//tar.CreatePerson = "导入";
|
|
|
var tarLst = ObjectMapper.Map<List<ImportRecordDto>, List<ImportRecord>>(srcLst); |
|
|
tar.CreateTime = ServerHelper.CurrentDateTime; |
|
|
foreach (var tar in tarLst) |
|
|
|
|
|
{ |
|
|
|
|
|
//tar.CreatePerson = "导入";
|
|
|
|
|
|
tar.CreateTime = ServerHelper.CurrentDateTime; |
|
|
|
|
|
} |
|
|
|
|
|
//报文解析
|
|
|
|
|
|
ObjectResultDto ret2 = await _ediParseDomainService.ParseEdi(tarLst, forceExecute); |
|
|
|
|
|
if (ret2.Status == false) |
|
|
|
|
|
{ |
|
|
|
|
|
return ret2; |
|
|
|
|
|
} |
|
|
|
|
|
if (ret2.Status == true && ret2.Message.HasValue()) |
|
|
|
|
|
{ |
|
|
|
|
|
return ret2; |
|
|
|
|
|
} |
|
|
|
|
|
await uow.CompleteAsync(); |
|
|
|
|
|
ret.Status = true; |
|
|
|
|
|
return ret; |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
//报文解析
|
|
|
|
|
|
ObjectResultDto ret2 = await _ediParseDomainService.ParseEdi(tarLst, forceExecute); |
|
|
|
|
|
if (ret2.Status == false) |
|
|
|
|
|
{ |
|
|
|
|
|
return ret2; |
|
|
|
|
|
} |
|
|
|
|
|
if (ret2.Status == true && ret2.Message.HasValue()) |
|
|
|
|
|
{ |
|
|
|
|
|
return ret2; |
|
|
|
|
|
} |
|
|
|
|
|
//await uow.CompleteAsync();
|
|
|
|
|
|
ret.Status = true; |
|
|
|
|
|
|
|
|
|
|
|
return ret; |
|
|
|
|
|
//}
|
|
|
} |
|
|
} |
|
|
catch (Exception ex) |
|
|
catch (Exception ex) |
|
|
{ |
|
|
{ |
|
|
ret.Status = false; |
|
|
ret.Status = false; |
|
|
ret.Message = _errorMessagePrefix + "ImportAsync 执行出错:" + ex.Message; |
|
|
ret.Message = _errorMessagePrefix + "ImportAsync 执行出错:" + ex.Message; |
|
|
_logger.LogError(ret.Message); |
|
|
_logger.LogError(ret.Message); |
|
|
return ret; |
|
|
throw new BusinessException("1001", ret.Message); |
|
|
|
|
|
//return ret;
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -515,6 +518,7 @@ namespace WY.NewJit.EdiReceive |
|
|
[Route("print-timeout-remind")] |
|
|
[Route("print-timeout-remind")] |
|
|
public virtual async Task<TimeOutRemindResultDto> PrintTimeoutRemind() |
|
|
public virtual async Task<TimeOutRemindResultDto> PrintTimeoutRemind() |
|
|
{ |
|
|
{ |
|
|
|
|
|
//return new TimeOutRemindResultDto();
|
|
|
TimeOutRemindResultDto retObj = new TimeOutRemindResultDto(); |
|
|
TimeOutRemindResultDto retObj = new TimeOutRemindResultDto(); |
|
|
retObj.ConfigMinutes = _configuration[$"ConfigDic:ProductLineTimeoutRemind_New:{"Record"}"].TryToInt() ?? 40; |
|
|
retObj.ConfigMinutes = _configuration[$"ConfigDic:ProductLineTimeoutRemind_New:{"Record"}"].TryToInt() ?? 40; |
|
|
var qry = await _importRecordRepository.MaxAsync(itm => itm.CreateTime); |
|
|
var qry = await _importRecordRepository.MaxAsync(itm => itm.CreateTime); |
|
|