可通过PACK码查询 产品静置记录 进行静置上线
This commit is contained in:
@@ -58,16 +58,15 @@ namespace MesServerFunctions
|
||||
return false;
|
||||
}
|
||||
|
||||
MisDataFun.Moby_Select_PDC(engineID, out string orderForm, out string engineType, out int engineTypeID);
|
||||
if (engineTypeID <= 0 || string.IsNullOrWhiteSpace(engineType))
|
||||
// PAD 可能扫描箱体码,最终产品编号以存储过程返回的产品编号为准。
|
||||
if (!TrySelectManualStaticPdcProduct(engineID, out string productCode, out string orderForm, out string engineType, out int engineTypeID, out message))
|
||||
{
|
||||
message = "未查询到产品执行信息:" + engineID;
|
||||
return false;
|
||||
}
|
||||
|
||||
product = new ManualStaticOutProduct
|
||||
{
|
||||
EngineID = engineID.Trim(),
|
||||
EngineID = productCode,
|
||||
OrderForm = orderForm,
|
||||
EngineType = engineType,
|
||||
EngineTypeID = engineTypeID
|
||||
@@ -75,6 +74,56 @@ namespace MesServerFunctions
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询 PDC 产品执行信息,兼容产品码和箱体码输入。
|
||||
/// </summary>
|
||||
private bool TrySelectManualStaticPdcProduct(string scanCode, out string productCode, out string orderForm, out string engineType, out int engineTypeID, out string message)
|
||||
{
|
||||
productCode = "";
|
||||
orderForm = "";
|
||||
engineType = "";
|
||||
engineTypeID = 0;
|
||||
message = "";
|
||||
|
||||
try
|
||||
{
|
||||
SqlParameter[] sqlParameters = new SqlParameter[1];
|
||||
sqlParameters[0] = new SqlParameter("@发动机号", scanCode);
|
||||
DataAccess.ExecuteStoredProcedure("测量数据工位_监控系统_MOBY_查询_PDC", ref sqlParameters, out DataTable dt, out string errorMessage);
|
||||
if (!string.IsNullOrWhiteSpace(errorMessage))
|
||||
{
|
||||
message = "查询产品执行信息失败:" + errorMessage;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (dt == null || dt.Rows.Count == 0)
|
||||
{
|
||||
message = "未查询到产品执行信息:" + scanCode;
|
||||
return false;
|
||||
}
|
||||
|
||||
DataRow row = dt.Rows[0];
|
||||
productCode = dt.Columns.Contains("产品编号") ? Convert.ToString(row["产品编号"]) : Convert.ToString(row["发动机号"]);
|
||||
orderForm = Convert.ToString(row["订单号"]);
|
||||
engineType = Convert.ToString(row["产品型号"]);
|
||||
engineTypeID = Convert.ToInt32(row["机型代码"]);
|
||||
|
||||
if (string.IsNullOrWhiteSpace(productCode) || engineTypeID <= 0 || string.IsNullOrWhiteSpace(engineType))
|
||||
{
|
||||
message = "产品执行信息不完整:" + scanCode;
|
||||
return false;
|
||||
}
|
||||
|
||||
productCode = productCode.Trim();
|
||||
return true;
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
message = "查询产品执行信息失败:" + err.Message;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询 OP420 记录的线下手动静置开始时间。
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user