From 85a1519636055f76f779e43b2051593bc81fc38a Mon Sep 17 00:00:00 2001 From: liuyunfeng Date: Wed, 8 Nov 2023 15:00:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E6=96=AD=E5=8F=B7=E6=A3=80?= =?UTF-8?q?=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Services/M100CheckDomainService.cs | 108 +++++++++--------- .../WY.NewJit.Job.ConsoleApp/appsettings.json | 2 +- 2 files changed, 55 insertions(+), 55 deletions(-) diff --git a/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgCheck/Services/M100CheckDomainService.cs b/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgCheck/Services/M100CheckDomainService.cs index e1440da..c1bcc94 100644 --- a/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgCheck/Services/M100CheckDomainService.cs +++ b/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgCheck/Services/M100CheckDomainService.cs @@ -429,63 +429,63 @@ namespace WY.NewJit.MsgCheck if (isMatch) { #region 判断是否断号 - //断号判断规则:大众顺序号生成规则是1至1999的重复循环,重复循环到1时判断之前最近的相同车型的VIN和当前VIN是否连续,如果不连续则表示断号 - //断号判断:大众顺序号按生产线分类判断;VIN按车型分类判断 - string curProductLine = m100Bill.ProductLine; - string curSerialNumStr = m100Bill.SerialNumStr; //排序依据 - int curHostSN = m100Bill.HostSN ?? 0; - string curVehicleModel = m100Bill.VehicleModelCode; - int curVinNum = m100Bill.SerialNum ?? 0; //VIN后六位 - //取当前生产线最近一条SerialNumStr - string priorSerialNumStr = _billM100Repository.Where(itm => - itm.ProductLine == curProductLine - && itm.SerialNumStr.CompareTo(curSerialNumStr) < 0 - ).Max(itm => itm.SerialNumStr); - if (priorSerialNumStr != null) - { - //取当前生产线最近一条 - int priorHostSN = _billM100Repository.FirstOrDefault(itm => itm.ProductLine == curProductLine && itm.SerialNumStr == priorSerialNumStr).HostSN ?? 0; - if (curHostSN == priorHostSN + 1) - { - //不断号 - } - else - { - //取当前生产线、相同车型、最近一条SerialNumStr - string priorSerialNumStr2 = _billM100Repository.Where(itm => - itm.ProductLine == curProductLine - && itm.VehicleModelCode == curVehicleModel - && itm.SerialNumStr.CompareTo(curSerialNumStr) < 0 - ).Max(itm => itm.SerialNumStr); - if (priorSerialNumStr2 != null) - { - int priorVinNum = _billM100Repository.FirstOrDefault(itm => itm.SerialNumStr == priorSerialNumStr2).SerialNum ?? 0; - if (curVinNum == priorVinNum + 1) - { - //不断号 - } - else - { - //断号提醒 - string errorMsg = $"{curProductLine}生产线M100报文出现断号,当前VIN:{curVinNum}:{curHostSN},上一VIN:{priorVinNum}:{priorHostSN}。可以操作M100单据信息维护模块进行补号!"; - _logRemindDomainService.WriteLogRemind(_billNumber, errorMsg, LogTypeEnum.M100); - } - } - } - } + ////断号判断规则:大众顺序号生成规则是1至1999的重复循环,重复循环到1时判断之前最近的相同车型的VIN和当前VIN是否连续,如果不连续则表示断号 + ////断号判断:大众顺序号按生产线分类判断;VIN按车型分类判断 + //string curProductLine = m100Bill.ProductLine; + //string curSerialNumStr = m100Bill.SerialNumStr; //排序依据 + //int curHostSN = m100Bill.HostSN ?? 0; + //string curVehicleModel = m100Bill.VehicleModelCode; + //int curVinNum = m100Bill.SerialNum ?? 0; //VIN后六位 + ////取当前生产线最近一条SerialNumStr + //string priorSerialNumStr = _billM100Repository.Where(itm => + // itm.ProductLine == curProductLine + // && itm.SerialNumStr.CompareTo(curSerialNumStr) < 0 + // ).Max(itm => itm.SerialNumStr); + //if (priorSerialNumStr != null) + //{ + // //取当前生产线最近一条 + // int priorHostSN = _billM100Repository.FirstOrDefault(itm => itm.ProductLine == curProductLine && itm.SerialNumStr == priorSerialNumStr).HostSN ?? 0; + // if (curHostSN == priorHostSN + 1) + // { + // //不断号 + // } + // else + // { + // //取当前生产线、相同车型、最近一条SerialNumStr + // string priorSerialNumStr2 = _billM100Repository.Where(itm => + // itm.ProductLine == curProductLine + // && itm.VehicleModelCode == curVehicleModel + // && itm.SerialNumStr.CompareTo(curSerialNumStr) < 0 + // ).Max(itm => itm.SerialNumStr); + // if (priorSerialNumStr2 != null) + // { + // int priorVinNum = _billM100Repository.FirstOrDefault(itm => itm.SerialNumStr == priorSerialNumStr2).SerialNum ?? 0; + // if (curVinNum == priorVinNum + 1) + // { + // //不断号 + // } + // else + // { + // //断号提醒 + // string errorMsg = $"{curProductLine}生产线M100报文出现断号,当前VIN:{curVinNum}:{curHostSN},上一VIN:{priorVinNum}:{priorHostSN}。可以操作M100单据信息维护模块进行补号!"; + // _logRemindDomainService.WriteLogRemind(_billNumber, errorMsg, LogTypeEnum.M100); + // } + // } + // } + //} #endregion #region 当前单据在未匹配时已经参与打印,重新解析后进入补打 - var m100Obj = m100Bill; - string curPL = m100Obj.ProductLine; - string curSNStr = m100Obj.SerialNumStr; - bool hasPrintData = _billM100Repository.Any(itm => itm.ProductLine == curPL && itm.SerialNumStr.CompareTo(curSNStr) > 0 && itm.BillStatus == BillStatusEnum.Publish); - if (hasPrintData) //该单据处于未解析时,已经打印 - { - m100Obj.NeedReplenishPrint = 1; - //_billM100Repository.UpdateAsync(m100Obj, true).GetAwaiter().GetResult(); - _m100DomainService.UpdateM100(m100Obj, true).GetAwaiter().GetResult(); - } + //var m100Obj = m100Bill; + //string curPL = m100Obj.ProductLine; + //string curSNStr = m100Obj.SerialNumStr; + //bool hasPrintData = _billM100Repository.Any(itm => itm.ProductLine == curPL && itm.SerialNumStr.CompareTo(curSNStr) > 0 && itm.BillStatus == BillStatusEnum.Publish); + //if (hasPrintData) //该单据处于未解析时,已经打印 + //{ + // m100Obj.NeedReplenishPrint = 1; + // //_billM100Repository.UpdateAsync(m100Obj, true).GetAwaiter().GetResult(); + // _m100DomainService.UpdateM100(m100Obj, true).GetAwaiter().GetResult(); + //} #endregion ret.Status = true; diff --git a/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Job.ConsoleApp/appsettings.json b/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Job.ConsoleApp/appsettings.json index d9be6ad..b888cb6 100644 --- a/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Job.ConsoleApp/appsettings.json +++ b/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Job.ConsoleApp/appsettings.json @@ -6,7 +6,7 @@ "ConfigDic": { "CurrentVersion": "PaiGe", - "TransferFileCountPerTime": 10, + "TransferFileCountPerTime": 1, //10 "ParseAssemblyCycleCount": 4, "MsgTransmessionTimer": { "IsStop": false,