Browse Source

bug完成

HQ
liuyunfeng 7 months ago
parent
commit
9195f1ca22
  1. 47
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/EdiReceive/ImportRecordAppService.cs
  2. 6
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/PrintTable/WaitPrintAppService.cs
  3. 2
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/WY.NewJit.Application.xml
  4. 6
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/EdiReceive/Services/EdiParseDomainService.cs

47
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/EdiReceive/ImportRecordAppService.cs

@ -78,6 +78,9 @@ namespace WY.NewJit.EdiReceive
} }
} }
private readonly IUnitOfWorkManager _unitOfWorkManager;
#endregion #endregion
@ -91,7 +94,8 @@ namespace WY.NewJit.EdiReceive
IBlobContainer<OurFileContainer> blobContainer, IBlobContainer<OurFileContainer> blobContainer,
DicDomainService dicDomainService, DicDomainService dicDomainService,
EdiParseDomainService ediParseDomainService, EdiParseDomainService ediParseDomainService,
Microsoft.Extensions.Configuration.IConfiguration configuration) Microsoft.Extensions.Configuration.IConfiguration configuration,
IUnitOfWorkManager unitOfWorkManager)
{ {
_importRecordRepository = importRecordRepository; _importRecordRepository = importRecordRepository;
_logger = logger; _logger = logger;
@ -100,6 +104,7 @@ namespace WY.NewJit.EdiReceive
_dicDomainService = dicDomainService; _dicDomainService = dicDomainService;
_ediParseDomainService = ediParseDomainService; _ediParseDomainService = ediParseDomainService;
_configuration = configuration; _configuration = configuration;
_unitOfWorkManager = unitOfWorkManager;
} }
#region 私有方法 #region 私有方法
@ -423,7 +428,7 @@ 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] [UnitOfWork(IsDisabled =true)]
[HttpPost] [HttpPost]
[Route("import")] [Route("import")]
[DisableRequestSizeLimit] [DisableRequestSizeLimit]
@ -465,25 +470,29 @@ namespace WY.NewJit.EdiReceive
return ret; return ret;
} }
var srcLst = impResult.Data.AsEnumerable().ToList(); using (var uow = _unitOfWorkManager.Begin())
var tarLst = ObjectMapper.Map<List<ImportRecordDto>, List<ImportRecord>>(srcLst);
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; var srcLst = impResult.Data.AsEnumerable().ToList();
var tarLst = ObjectMapper.Map<List<ImportRecordDto>, List<ImportRecord>>(srcLst);
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;
} }
ret.Status = true;
return ret;
} }
catch (Exception ex) catch (Exception ex)
{ {

6
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/PrintTable/WaitPrintAppService.cs

@ -830,7 +830,7 @@ namespace WY.NewJit.PrintTable
&& itm.PrintType == PrintTypeEnum.OrderPrint //顺序打印 && itm.PrintType == PrintTypeEnum.OrderPrint //顺序打印
).MinAsync(itm => itm.HostSN2); ).MinAsync(itm => itm.HostSN2);
int minHostSN = minHostSN2 % 100000; int minHostSN = minHostSN2 % 100000;
if (input.BeginHostSN != minHostSN) if (input.BeginHostSN != minHostSN2)
{ {
retLst.Add($"输入的大众起始大众顺序号{input.BeginHostSN}和未打印表中的最小大众顺序号{minHostSN2}不相等!"); retLst.Add($"输入的大众起始大众顺序号{input.BeginHostSN}和未打印表中的最小大众顺序号{minHostSN2}不相等!");
return new ListResultDto<string>(retLst); return new ListResultDto<string>(retLst);
@ -853,7 +853,7 @@ namespace WY.NewJit.PrintTable
string breakNumStr = string.Join(" ", breakNumLst); string breakNumStr = string.Join(" ", breakNumLst);
// string breakNumStr = string.Concat(breakNumLst); // string breakNumStr = string.Concat(breakNumLst);
retLst.Add($"存在断号:{breakNumStr}"); retLst.Add($"存在断号:{breakNumStr}");
return new ListResultDto<string>(retLst); //return new ListResultDto<string>(retLst);
} }
//判断未知总成 //判断未知总成
bool containNotMatch = billLst.Any(itm => itm.BillStatus == BillStatusEnum.NotMatch); bool containNotMatch = billLst.Any(itm => itm.BillStatus == BillStatusEnum.NotMatch);
@ -863,7 +863,7 @@ namespace WY.NewJit.PrintTable
string str = string.Join(" ", lst); string str = string.Join(" ", lst);
//string str = string.Concat(lst); //string str = string.Concat(lst);
retLst.Add($"存在未知总成:{str}"); retLst.Add($"存在未知总成:{str}");
return new ListResultDto<string>(retLst); //return new ListResultDto<string>(retLst);
} }
return new ListResultDto<string>(retLst); return new ListResultDto<string>(retLst);

2
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/WY.NewJit.Application.xml

@ -49,7 +49,7 @@
错误信息前缀 错误信息前缀
</summary> </summary>
</member> </member>
<member name="M:WY.NewJit.EdiReceive.ImportRecordAppService.#ctor(Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.EdiReceive.Entitys.ImportRecord,System.Guid},Microsoft.Extensions.Logging.ILogger{WY.NewJit.EdiReceive.ImportRecordAppService},WY.NewJit.EntityFrameworkCore.NewJitDapperRepository,Volo.Abp.BlobStoring.IBlobContainer{WY.NewJit.Common.OurFileContainer},WY.NewJit.MsgBaseData.DicDomainService,WY.NewJit.EdiReceive.Services.EdiParseDomainService,Microsoft.Extensions.Configuration.IConfiguration)"> <member name="M:WY.NewJit.EdiReceive.ImportRecordAppService.#ctor(Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.EdiReceive.Entitys.ImportRecord,System.Guid},Microsoft.Extensions.Logging.ILogger{WY.NewJit.EdiReceive.ImportRecordAppService},WY.NewJit.EntityFrameworkCore.NewJitDapperRepository,Volo.Abp.BlobStoring.IBlobContainer{WY.NewJit.Common.OurFileContainer},WY.NewJit.MsgBaseData.DicDomainService,WY.NewJit.EdiReceive.Services.EdiParseDomainService,Microsoft.Extensions.Configuration.IConfiguration,Volo.Abp.Uow.IUnitOfWorkManager)">
<summary> <summary>
构造函数 构造函数
</summary> </summary>

6
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/EdiReceive/Services/EdiParseDomainService.cs

@ -400,10 +400,14 @@ namespace WY.NewJit.EdiReceive.Services
int curVal = notRepeatOrder[curIdx].HostSN; int curVal = notRepeatOrder[curIdx].HostSN;
int priorIdx = curIdx - 1; int priorIdx = curIdx - 1;
int priorVal = notRepeatOrder[priorIdx].HostSN; int priorVal = notRepeatOrder[priorIdx].HostSN;
if (curVal - priorVal != 1) if (curVal - priorVal > 1)
{ {
sb.AppendLine($"流水号{priorVal}和{curVal}之间存在断号"); sb.AppendLine($"流水号{priorVal}和{curVal}之间存在断号");
} }
else if (curVal - priorVal == 0)
{
sb.AppendLine($"流水号{priorVal}和{curVal}之间存在重复");
}
} }
return sb.ToString(); return sb.ToString();
} }

Loading…
Cancel
Save