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.
50 lines
1.7 KiB
50 lines
1.7 KiB
4 years ago
|
using System;
|
||
|
using System.Collections.Generic;
|
||
|
using System.Linq;
|
||
|
using System.Text;
|
||
|
using QMAPP.FJC.Entity.Operation;
|
||
|
|
||
|
namespace QMAPP.FJC.TRACING.DataAnalyzers
|
||
|
{
|
||
|
/// <summary>
|
||
|
/// 门板零件类型数据解析类
|
||
|
/// 根据输入的零件类型、当前工序、模架关联生产计划取得物料号
|
||
|
/// </summary>
|
||
|
public class DPPartTypeAnalyzer : DAInterface.IDataAnalyzer
|
||
|
{
|
||
|
public void Analyze(DAInterface.DAObject data)
|
||
|
{
|
||
|
var bindingdal = new DAL.QT.MaterialBindingDAL();
|
||
|
var binding = bindingdal.GetBindingTarget("MOULD", data.DAValue.ToString());
|
||
|
if (binding == null)
|
||
|
{
|
||
|
throw new Exception("此物料无法在当前工位进行加工!");
|
||
|
}
|
||
|
data.MouldCode = binding.TARGET_CODE;
|
||
|
|
||
|
|
||
|
var orderdal = new DAL.ProductionPlan.WorkOrderDAL();
|
||
|
var order= orderdal.SearchByMould(data.MouldCode, data.DAI.WORKCELL_CODE);
|
||
|
if (order == null)
|
||
|
{
|
||
|
throw new Exception("未找到与此物料相关的生产计划!");
|
||
|
}
|
||
|
var plandal = new DAL.FIS.OrderPlanDAL();
|
||
|
|
||
|
data.OrderPlan = plandal.Get(new Entity.FIS.OrderPlan { PID = order.ORDERPLANID });
|
||
|
|
||
|
var bomdal = new MD.DAL.PbomDAL();
|
||
|
var bomitem= bomdal.GetBomItemByMaterilType(order.PBOM_CODE, data.DAValue.ToString());
|
||
|
|
||
|
if (bomitem == null)
|
||
|
{
|
||
|
throw new Exception("未找到与此物料相关的BOM!");
|
||
|
}
|
||
|
data.AnalyzedValue = bomitem.MATERIAL_CODE;
|
||
|
data.MaterialCode = bomitem.MATERIAL_CODE;
|
||
|
|
||
|
|
||
|
}
|
||
|
}
|
||
|
}
|