lvzb 1 year ago
parent
commit
c4752335d9
  1. 108
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgCheck/Services/M100CheckDomainService.cs
  2. 2
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Job.ConsoleApp/appsettings.json

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

@ -429,63 +429,63 @@ namespace WY.NewJit.MsgCheck
if (isMatch) if (isMatch)
{ {
#region 判断是否断号 #region 判断是否断号
//断号判断规则:大众顺序号生成规则是1至1999的重复循环,重复循环到1时判断之前最近的相同车型的VIN和当前VIN是否连续,如果不连续则表示断号 ////断号判断规则:大众顺序号生成规则是1至1999的重复循环,重复循环到1时判断之前最近的相同车型的VIN和当前VIN是否连续,如果不连续则表示断号
//断号判断:大众顺序号按生产线分类判断;VIN按车型分类判断 ////断号判断:大众顺序号按生产线分类判断;VIN按车型分类判断
string curProductLine = m100Bill.ProductLine; //string curProductLine = m100Bill.ProductLine;
string curSerialNumStr = m100Bill.SerialNumStr; //排序依据 //string curSerialNumStr = m100Bill.SerialNumStr; //排序依据
int curHostSN = m100Bill.HostSN ?? 0; //int curHostSN = m100Bill.HostSN ?? 0;
string curVehicleModel = m100Bill.VehicleModelCode; //string curVehicleModel = m100Bill.VehicleModelCode;
int curVinNum = m100Bill.SerialNum ?? 0; //VIN后六位 //int curVinNum = m100Bill.SerialNum ?? 0; //VIN后六位
//取当前生产线最近一条SerialNumStr ////取当前生产线最近一条SerialNumStr
string priorSerialNumStr = _billM100Repository.Where(itm => //string priorSerialNumStr = _billM100Repository.Where(itm =>
itm.ProductLine == curProductLine // itm.ProductLine == curProductLine
&& itm.SerialNumStr.CompareTo(curSerialNumStr) < 0 // && itm.SerialNumStr.CompareTo(curSerialNumStr) < 0
).Max(itm => itm.SerialNumStr); // ).Max(itm => itm.SerialNumStr);
if (priorSerialNumStr != null) //if (priorSerialNumStr != null)
{ //{
//取当前生产线最近一条 // //取当前生产线最近一条
int priorHostSN = _billM100Repository.FirstOrDefault(itm => itm.ProductLine == curProductLine && itm.SerialNumStr == priorSerialNumStr).HostSN ?? 0; // int priorHostSN = _billM100Repository.FirstOrDefault(itm => itm.ProductLine == curProductLine && itm.SerialNumStr == priorSerialNumStr).HostSN ?? 0;
if (curHostSN == priorHostSN + 1) // if (curHostSN == priorHostSN + 1)
{ // {
//不断号 // //不断号
} // }
else // else
{ // {
//取当前生产线、相同车型、最近一条SerialNumStr // //取当前生产线、相同车型、最近一条SerialNumStr
string priorSerialNumStr2 = _billM100Repository.Where(itm => // string priorSerialNumStr2 = _billM100Repository.Where(itm =>
itm.ProductLine == curProductLine // itm.ProductLine == curProductLine
&& itm.VehicleModelCode == curVehicleModel // && itm.VehicleModelCode == curVehicleModel
&& itm.SerialNumStr.CompareTo(curSerialNumStr) < 0 // && itm.SerialNumStr.CompareTo(curSerialNumStr) < 0
).Max(itm => itm.SerialNumStr); // ).Max(itm => itm.SerialNumStr);
if (priorSerialNumStr2 != null) // if (priorSerialNumStr2 != null)
{ // {
int priorVinNum = _billM100Repository.FirstOrDefault(itm => itm.SerialNumStr == priorSerialNumStr2).SerialNum ?? 0; // int priorVinNum = _billM100Repository.FirstOrDefault(itm => itm.SerialNumStr == priorSerialNumStr2).SerialNum ?? 0;
if (curVinNum == priorVinNum + 1) // if (curVinNum == priorVinNum + 1)
{ // {
//不断号 // //不断号
} // }
else // else
{ // {
//断号提醒 // //断号提醒
string errorMsg = $"{curProductLine}生产线M100报文出现断号,当前VIN:{curVinNum}:{curHostSN},上一VIN:{priorVinNum}:{priorHostSN}。可以操作M100单据信息维护模块进行补号!"; // string errorMsg = $"{curProductLine}生产线M100报文出现断号,当前VIN:{curVinNum}:{curHostSN},上一VIN:{priorVinNum}:{priorHostSN}。可以操作M100单据信息维护模块进行补号!";
_logRemindDomainService.WriteLogRemind(_billNumber, errorMsg, LogTypeEnum.M100); // _logRemindDomainService.WriteLogRemind(_billNumber, errorMsg, LogTypeEnum.M100);
} // }
} // }
} // }
} //}
#endregion #endregion
#region 当前单据在未匹配时已经参与打印,重新解析后进入补打 #region 当前单据在未匹配时已经参与打印,重新解析后进入补打
var m100Obj = m100Bill; //var m100Obj = m100Bill;
string curPL = m100Obj.ProductLine; //string curPL = m100Obj.ProductLine;
string curSNStr = m100Obj.SerialNumStr; //string curSNStr = m100Obj.SerialNumStr;
bool hasPrintData = _billM100Repository.Any(itm => itm.ProductLine == curPL && itm.SerialNumStr.CompareTo(curSNStr) > 0 && itm.BillStatus == BillStatusEnum.Publish); //bool hasPrintData = _billM100Repository.Any(itm => itm.ProductLine == curPL && itm.SerialNumStr.CompareTo(curSNStr) > 0 && itm.BillStatus == BillStatusEnum.Publish);
if (hasPrintData) //该单据处于未解析时,已经打印 //if (hasPrintData) //该单据处于未解析时,已经打印
{ //{
m100Obj.NeedReplenishPrint = 1; // m100Obj.NeedReplenishPrint = 1;
//_billM100Repository.UpdateAsync(m100Obj, true).GetAwaiter().GetResult(); // //_billM100Repository.UpdateAsync(m100Obj, true).GetAwaiter().GetResult();
_m100DomainService.UpdateM100(m100Obj, true).GetAwaiter().GetResult(); // _m100DomainService.UpdateM100(m100Obj, true).GetAwaiter().GetResult();
} //}
#endregion #endregion
ret.Status = true; ret.Status = true;

2
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Job.ConsoleApp/appsettings.json

@ -6,7 +6,7 @@
"ConfigDic": { "ConfigDic": {
"CurrentVersion": "PaiGe", "CurrentVersion": "PaiGe",
"TransferFileCountPerTime": 10, "TransferFileCountPerTime": 1, //10
"ParseAssemblyCycleCount": 4, "ParseAssemblyCycleCount": 4,
"MsgTransmessionTimer": { "MsgTransmessionTimer": {
"IsStop": false, "IsStop": false,

Loading…
Cancel
Save