using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QMFrameWork.Data;
using QMAPP.FJC.DAL.QT;
using QMAPP.FJC.Entity.QT;
using QMAPP.FJC.Entity.Produce;
using QMAPP.FJC.TRACING.DAInterface;
using QMAPP.FJC.DAL.Produce;
using QMAPP.FJC.DAL.Basic;
namespace QMAPP.FJC.TRACING.StateActions
{
///
/// 重置采集数据
///
public class ResetData:IStateAction
{
///
/// 执行
///
///
public void Execute(DAObject data)
{
//List resetDai = new List();
foreach (var dai in data.WorkLocState.DataCache)
{
if (!string.IsNullOrWhiteSpace(dai.STATE_CODE)) //过滤工序状态属性为空的采集点
{
dai.MATERIAL_CODE = "";
dai.DA_VALUE = "";
dai.OBJ_PID = "";
dai.SAVED = dai.SAVED.Replace(data.MouldCode, "");
//resetDai.Add(dai);
data.AddToPersistentList(dai, dai.PID);
}
else if(string.Equals(dai.DATA_TYPE,"BN"))
{
dai.SAVED = dai.SAVED.Replace(data.MouldCode, "");
//resetDai.Add(dai);
data.AddToPersistentList(dai, dai.PID);
}
}
data.WorkLocState.CurrentState.PRODUCT_PID = "";
data.WorkLocState.CurrentState.BOM_CODE = "";
data.WorkLocState.CurrentState.MATERIAL_CODE = "";
data.WorkLocState.CurrentState.PROCESS_CODE = "";
data.WorkLocState.CurrentState.ROUTE_CODE = "";
data.WorkLocState.CurrentState.ORDERPLAN_PID = "";
data.AddToPersistentList(data.WorkLocState.CurrentState, data.WorkLocState.CurrentState.PID);
//DAL.QT.WorkCellRunStateDAL wrsdal = new WorkCellRunStateDAL();
//wrsdal.Update(data.WorkLocState.CurrentState,data.DataSession);
//DAICacheDAL dcdal = new DAICacheDAL();
//dcdal.Update(resetDai, data.DataSession);
}
}
}