Browse Source

报文解析bug

master
liuyunfeng 1 year ago
parent
commit
c6bfbb57a9
  1. 4
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/PrintTable/WaitPrintAppService.cs
  2. 28
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgCheck/Services/BillNumberRecordDomainService.cs
  3. 9
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Job.ConsoleApp/Messages/MsgTransmissionService.cs

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

@ -167,7 +167,7 @@ namespace WY.NewJit.PrintTable
/// <param name="pageSize"></param>
/// <param name="pageIndex"></param>
/// <returns></returns>
public async Task<List<T>> GetEntityListAsync<T>(string tableName, string where, string orderFieldName, int pageSize, int pageIndex)
private async Task<List<T>> GetEntityListAsync<T>(string tableName, string where, string orderFieldName, int pageSize, int pageIndex)
{
int skipNum = (pageIndex - 1) * pageSize;
int takeNum = pageSize;
@ -176,7 +176,7 @@ namespace WY.NewJit.PrintTable
return ret;
}
public async Task<List<T>> GetEntityListFromToAsync<T>(string tableName, string where, string orderFieldName, int skipNum, int takeNum)
private async Task<List<T>> GetEntityListFromToAsync<T>(string tableName, string where, string orderFieldName, int skipNum, int takeNum)
{
string sql = $"select * from {tableName} where 1=1 {where} order by {orderFieldName} offset {skipNum} rows fetch next {takeNum} rows only";
var ret = await _newJitDapperRepository.GetListBySqlAsync<T>(sql);

28
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgCheck/Services/BillNumberRecordDomainService.cs

@ -59,20 +59,20 @@ namespace WY.NewJit.MsgCheck
{
_billNumberRecordCaches.Clear();
_billNumberRecordCaches = await _billNumberRepository.GetListAsync();
foreach (var item in _billNumberRecordCaches)
{
var list = await _waitPrintRepository.GetListAsync(r => r.ProductLine == item.ProductLine);
if (list.Count > 0)
{
var max = list.Select(r => r.HostSN2).Max();
if(item.RecordNumber!= max)
{
ret.Status = false;
ret.Message = "获取记录缓存错误!";
_logger.LogDebug("获取记录缓存错误!");
}
}
}
//foreach (var item in _billNumberRecordCaches)
//{
// var list = await _waitPrintRepository.GetListAsync(r => r.ProductLine == item.ProductLine);
// if (list.Count > 0)
// {
// var max = list.Select(r => r.HostSN2).Max();
// if(item.RecordNumber!= max)
// {
// ret.Status = false;
// ret.Message = "获取记录缓存错误!";
// _logger.LogDebug("获取记录缓存错误!");
// }
// }
//}
}
return ret;
}

9
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Job.ConsoleApp/Messages/MsgTransmissionService.cs

@ -119,6 +119,8 @@ namespace WY.NewJit.Job.ConsoleApp.Messages
/// 跨进程全局配置领域服务
/// </summary>
private readonly GlobalSettingsDomainService _globalSettingsDomainService;
private readonly BillNumberRecordDomainService _billNumRecDomainSrv;
#endregion
#region 缓存
@ -232,7 +234,8 @@ namespace WY.NewJit.Job.ConsoleApp.Messages
DicDomainService dicDomainService,
IGuidGenerator guidGenerator,
GlobalSettingsDomainService globalSettingsDomainService,
IRepository<MessageReceiveArchive, Guid> messageReceiveArchiveRepository
IRepository<MessageReceiveArchive, Guid> messageReceiveArchiveRepository,
BillNumberRecordDomainService billNumRecDomainSrv
//CacheManagerDomainService cacheManagerDomainService
)
{
@ -255,6 +258,7 @@ namespace WY.NewJit.Job.ConsoleApp.Messages
_globalSettingsDomainService = globalSettingsDomainService;
_messageReceiveArchiveRepository = messageReceiveArchiveRepository;
//_cacheManagerDomainService = cacheManagerDomainService;
_billNumRecDomainSrv = billNumRecDomainSrv;
}
#endregion
@ -274,6 +278,8 @@ namespace WY.NewJit.Job.ConsoleApp.Messages
string fileName = "";
try
{
//_billNumRecDomainSrv.CleanBillNumberRecordCache();
_billNumRecDomainSrv.GetOrUpDateBillNumberRecordCache(false).GetAwaiter().GetResult();
//PathConfigInfo cfgInfo = ReadConfig();
int countPerTime = _configuration["ConfigDic:TransferFileCountPerTime"].TryToInt() ?? 10;
@ -287,6 +293,7 @@ namespace WY.NewJit.Job.ConsoleApp.Messages
fileName = msgReceiveObj.MessageFileName;
ParseOneEdiFile(msgReceiveObj);
}
_billNumRecDomainSrv.GetOrUpDateBillNumberRecordCache(true).GetAwaiter().GetResult();
}
catch (Exception ex)
{

Loading…
Cancel
Save