毛坯出入库修改,质量报表生成标签功能添加
This commit is contained in:
@@ -154,8 +154,7 @@ namespace ZR.Service.Utils
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.Error($"外箱标签码,解析失败 {ex.Message}");
|
||||
return null;
|
||||
throw new Exception($"外箱标签码,解析失败-1: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -214,8 +213,7 @@ namespace ZR.Service.Utils
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.Error($"外箱标签码,解析失败 {ex.Message}");
|
||||
return null;
|
||||
throw new Exception($"外箱标签码,解析失败-2: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -311,7 +309,7 @@ namespace ZR.Service.Utils
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new Exception("解析失败" + e.Message);
|
||||
throw new Exception("标签解析失败-3:" + e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -329,13 +327,13 @@ namespace ZR.Service.Utils
|
||||
// 解析外箱标签码
|
||||
string[] splitstr = packagecode.Split('/');
|
||||
// 解析批次号
|
||||
resultionPackageCode.PatchCode = splitstr[1];
|
||||
resultionPackageCode.PatchCode = splitstr[0];
|
||||
// 解析零件号
|
||||
string partnumber = splitstr[0];
|
||||
string partnumber = "";
|
||||
// 零件号
|
||||
resultionPackageCode.PartNumner = partnumber;
|
||||
// 毛坯号
|
||||
string _blankNumber = splitstr[5];
|
||||
string _blankNumber = splitstr[4];
|
||||
// 去掉毛坯号中带横杠的后缀(如-M2)
|
||||
if (!string.IsNullOrEmpty(_blankNumber) && _blankNumber.Contains('-'))
|
||||
{
|
||||
@@ -345,20 +343,22 @@ namespace ZR.Service.Utils
|
||||
resultionPackageCode.BlankNumber = _blankNumber;
|
||||
// 解析工单号 工单号会带个W,需要去掉
|
||||
string workoderidid = "";
|
||||
resultionPackageCode.WorkoderID = "";
|
||||
resultionPackageCode.WorkoderID = workoderidid;
|
||||
// 解析生产时间 工单号生产时间提取
|
||||
resultionPackageCode.ProductionTime = splitstr[1];
|
||||
resultionPackageCode.ProductionTime = splitstr[0];
|
||||
// 解析箱子中产品数量
|
||||
string product_num = splitstr[4];
|
||||
string product_num = splitstr[3];
|
||||
resultionPackageCode.Quantity = int.Parse(product_num);
|
||||
// 解析产品描述 partnumber 从物料列表抓取数据
|
||||
WmMaterial material = Context
|
||||
.Queryable<WmMaterial>()
|
||||
.Where(it => it.Partnumber == partnumber)
|
||||
.Where(it => it.BlankNum == _blankNumber)
|
||||
.Where(it => it.Type == 2)
|
||||
.Where(it => it.Status == 1)
|
||||
.First();
|
||||
if (material == null)
|
||||
{
|
||||
resultionPackageCode.ProductionDescribe = "物料记录未录入此零件号信息!";
|
||||
resultionPackageCode.ProductionDescribe = "物料清单未录入此毛坯号信息!";
|
||||
return resultionPackageCode;
|
||||
}
|
||||
string des1 = material.Description;
|
||||
@@ -375,8 +375,7 @@ namespace ZR.Service.Utils
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.Error($"外箱标签码,解析失败 {ex.Message}");
|
||||
return null;
|
||||
throw new Exception($"标签码解析失败-4: {ex.Message}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user