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="pageSize"></param>
/// <param name="pageIndex"></param> /// <param name="pageIndex"></param>
/// <returns></returns> /// <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 skipNum = (pageIndex - 1) * pageSize;
int takeNum = pageSize; int takeNum = pageSize;
@ -176,7 +176,7 @@ namespace WY.NewJit.PrintTable
return ret; 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"; 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); 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.Clear();
_billNumberRecordCaches = await _billNumberRepository.GetListAsync(); _billNumberRecordCaches = await _billNumberRepository.GetListAsync();
foreach (var item in _billNumberRecordCaches) //foreach (var item in _billNumberRecordCaches)
{ //{
var list = await _waitPrintRepository.GetListAsync(r => r.ProductLine == item.ProductLine); // var list = await _waitPrintRepository.GetListAsync(r => r.ProductLine == item.ProductLine);
if (list.Count > 0) // if (list.Count > 0)
{ // {
var max = list.Select(r => r.HostSN2).Max(); // var max = list.Select(r => r.HostSN2).Max();
if(item.RecordNumber!= max) // if(item.RecordNumber!= max)
{ // {
ret.Status = false; // ret.Status = false;
ret.Message = "获取记录缓存错误!"; // ret.Message = "获取记录缓存错误!";
_logger.LogDebug("获取记录缓存错误!"); // _logger.LogDebug("获取记录缓存错误!");
} // }
} // }
} //}
} }
return ret; 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> /// </summary>
private readonly GlobalSettingsDomainService _globalSettingsDomainService; private readonly GlobalSettingsDomainService _globalSettingsDomainService;
private readonly BillNumberRecordDomainService _billNumRecDomainSrv;
#endregion #endregion
#region 缓存 #region 缓存
@ -232,7 +234,8 @@ namespace WY.NewJit.Job.ConsoleApp.Messages
DicDomainService dicDomainService, DicDomainService dicDomainService,
IGuidGenerator guidGenerator, IGuidGenerator guidGenerator,
GlobalSettingsDomainService globalSettingsDomainService, GlobalSettingsDomainService globalSettingsDomainService,
IRepository<MessageReceiveArchive, Guid> messageReceiveArchiveRepository IRepository<MessageReceiveArchive, Guid> messageReceiveArchiveRepository,
BillNumberRecordDomainService billNumRecDomainSrv
//CacheManagerDomainService cacheManagerDomainService //CacheManagerDomainService cacheManagerDomainService
) )
{ {
@ -255,6 +258,7 @@ namespace WY.NewJit.Job.ConsoleApp.Messages
_globalSettingsDomainService = globalSettingsDomainService; _globalSettingsDomainService = globalSettingsDomainService;
_messageReceiveArchiveRepository = messageReceiveArchiveRepository; _messageReceiveArchiveRepository = messageReceiveArchiveRepository;
//_cacheManagerDomainService = cacheManagerDomainService; //_cacheManagerDomainService = cacheManagerDomainService;
_billNumRecDomainSrv = billNumRecDomainSrv;
} }
#endregion #endregion
@ -274,6 +278,8 @@ namespace WY.NewJit.Job.ConsoleApp.Messages
string fileName = ""; string fileName = "";
try try
{ {
//_billNumRecDomainSrv.CleanBillNumberRecordCache();
_billNumRecDomainSrv.GetOrUpDateBillNumberRecordCache(false).GetAwaiter().GetResult();
//PathConfigInfo cfgInfo = ReadConfig(); //PathConfigInfo cfgInfo = ReadConfig();
int countPerTime = _configuration["ConfigDic:TransferFileCountPerTime"].TryToInt() ?? 10; int countPerTime = _configuration["ConfigDic:TransferFileCountPerTime"].TryToInt() ?? 10;
@ -287,6 +293,7 @@ namespace WY.NewJit.Job.ConsoleApp.Messages
fileName = msgReceiveObj.MessageFileName; fileName = msgReceiveObj.MessageFileName;
ParseOneEdiFile(msgReceiveObj); ParseOneEdiFile(msgReceiveObj);
} }
_billNumRecDomainSrv.GetOrUpDateBillNumberRecordCache(true).GetAwaiter().GetResult();
} }
catch (Exception ex) catch (Exception ex)
{ {

Loading…
Cancel
Save