物料清单添加-FL等判定

This commit is contained in:
2025-05-22 11:28:09 +08:00
parent ced4eeb6c6
commit 5543dae437

View File

@@ -65,16 +65,26 @@ namespace ZR.Service.Business
// TYPE === 1 时,同时根据物料清单获取详细信息 // TYPE === 1 时,同时根据物料清单获取详细信息
if (type == 1) if (type == 1)
{ {
string checkPartnumber = labelAnalysisDto.Partnumber;
// 使用正则表达式匹配并移除特殊后缀
string processedPartnumber = Regex.Replace(
checkPartnumber,
@"-(FL|FR|RR|RL)$",
"",
RegexOptions.IgnoreCase
);
WmMaterial material = Context WmMaterial material = Context
.Queryable<WmMaterial>() .Queryable<WmMaterial>()
.Where(it => it.Partnumber == labelAnalysisDto.Partnumber) .Where(it => it.Partnumber == processedPartnumber)
.Where(it => it.Type == 1) .Where(it => it.Type == 1)
.Where(it => it.Status == 1) .Where(it => it.Status == 1)
.First(); .First();
if (material == null) if (material == null)
{ {
labelAnalysisDto.IsOk = false; labelAnalysisDto.IsOk = false;
labelAnalysisDto.Msg = "物料清单内无此零件号!请检查物料清单:" + labelAnalysisDto.Partnumber; labelAnalysisDto.Msg = "物料清单内无此零件号!请检查物料清单:" + processedPartnumber;
} }
else else
{ {
@@ -708,7 +718,7 @@ namespace ZR.Service.Business
if (packageLabelConfig == null) if (packageLabelConfig == null)
{ {
Context.Ado.RollbackTran(); Context.Ado.RollbackTran();
return $"该产品内标签,未检测到对应打印参数:{data.PartNumber}"; return $"该产品内标签,未检测到对应打印参数:{data.PartNumber},{workorder.Description}";
} }
// 上一个内标签流水号检查 // 上一个内标签流水号检查
int oldInnerLabelSort = 0; int oldInnerLabelSort = 0;