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

59 lines
2.2 KiB

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
{
/// <summary>
/// 重置采集数据
/// </summary>
public class ResetData:IStateAction
{
/// <summary>
/// 执行
/// </summary>
/// <param name="data"></param>
public void Execute(DAObject data)
{
//List<DAICache> resetDai = new List<DAICache>();
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);
}
}
}