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.
53 lines
1.8 KiB
53 lines
1.8 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
namespace QMAPP.FJC.TRACING.DataAnalyzers
|
|
{
|
|
/// <summary>
|
|
/// 门板计划标签数据解析类
|
|
/// </summary>
|
|
public class DPPlanLabelAnalyzer : DAInterface.IDataAnalyzer
|
|
{
|
|
public void Analyze(DAInterface.DAObject data)
|
|
{
|
|
string[] planlabel = data.DAValue.ToString().Split('-');
|
|
if (planlabel.Length < 2)
|
|
{
|
|
throw new Exception("此计划标签条码格式异常!");
|
|
}
|
|
string sn = planlabel[planlabel.Length-1];
|
|
string planno = planlabel[0];
|
|
data.WorkOrderID = planno;
|
|
|
|
var plandal = new DAL.FIS.OrderPlanDAL();
|
|
var plan = plandal.GetInfo(new Entity.FIS.OrderPlan { PLAN_NO = planno });
|
|
if (plan == null)
|
|
{
|
|
throw new Exception("未找到此计划标签相关计划");
|
|
}
|
|
data.OrderPlan = plan;
|
|
//data.WorkLocState.CurrentState.ORDERPLAN_PID = plan.PID;
|
|
|
|
|
|
DAL.Produce.ProductDAL dal = new DAL.Produce.ProductDAL();
|
|
var product = dal.GetNewestProduct(sn);
|
|
if (product == null)
|
|
{
|
|
throw new Exception("无法查到与此条码相关的产品数据!");
|
|
}
|
|
data.ObjectPID = product.PID;
|
|
data.AnalyzedValue = product.PRODUCTCODE;
|
|
data.MaterialCode = product.MATERIAL_CODE;
|
|
|
|
var bindingdal = new DAL.QT.MaterialBindingDAL();
|
|
var binding = bindingdal.GetBindingTarget("MOULD", product.MATERIAL_TYPE);
|
|
if (binding == null)
|
|
{
|
|
throw new Exception("此产品无法在当前工位进行加工!");
|
|
}
|
|
data.MouldCode = binding.TARGET_CODE;
|
|
}
|
|
}
|
|
}
|
|
|