You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.3 KiB
38 lines
1.3 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
namespace QMAPP.FJC.TRACING.DataAnalyzers
|
|
{
|
|
/// <summary>
|
|
/// 从组成零件的条码解析总成/分总成信息
|
|
/// </summary>
|
|
public class PartToMainAnalyzer : DAInterface.IDataAnalyzer
|
|
{
|
|
public void Analyze(DAInterface.DAObject data)
|
|
{
|
|
DAL.Produce.ProductDAL proddal = new DAL.Produce.ProductDAL();
|
|
var product = proddal.GetNewestProduct(data.DAValue.ToString());
|
|
if (product != null)
|
|
{
|
|
var prod= proddal.GetProductByPartID(product.PID);
|
|
if (prod != null)
|
|
{
|
|
product = prod;
|
|
}
|
|
data.ObjectPID = product.PID;
|
|
data.ObjectCacheList.Add(product);
|
|
data.AnalyzedValue = product.PRODUCTCODE;
|
|
data.MaterialCode = product.MATERIAL_CODE;
|
|
DAL.MD.MaterialDAL mdal = new DAL.MD.MaterialDAL();
|
|
var materialT = mdal.Get(data.MaterialCode);
|
|
data.MaterialName = materialT == null ? "" : materialT.MATERIAL_SHORT;
|
|
}
|
|
else
|
|
{
|
|
throw new Exception("无法查到此零件信息!");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|