天津投入产出系统后端
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.
 
 
 
 
 
 

39 lines
1.4 KiB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace QMAPP.FJC.TRACING.DataAnalyzers
{
/// <summary>
/// 门板产品数据解析类
/// </summary>
public class DPProductAnalyzer : DAInterface.IDataAnalyzer
{
public void Analyze(DAInterface.DAObject data)
{
DAL.Produce.ProductDAL dal = new DAL.Produce.ProductDAL();
var product = dal.GetNewestProduct(data.DAValue.ToString());
if (product == null)
{
throw new Exception("无法查到与此条码相关的产品数据!");
}
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 material = mdal.Get(data.MaterialCode);
data.MaterialName = material == null ? "" : material.MATERIAL_SHORT;
var bindingdal = new DAL.QT.MaterialBindingDAL();
var binding = bindingdal.GetBindingTarget(data.DAI.WORKLOC_CODE + "_MOULD", product.MATERIAL_TYPE);
if (binding == null)
{
throw new Exception("此产品无法在当前工位进行加工!");
}
data.MouldCode = binding.TARGET_CODE;
data.MouldReLocate = true;
}
}
}