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

30 lines
1.3 KiB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QMAPP.FJC.TRACING.DAInterface;
namespace QMAPP.FJC.TRACING.StateActions
{
public class CanLetPass:IStateAction
{
public void Execute(DAObject data)
{
//判断是否已生成产品数据
if (string.IsNullOrWhiteSpace(data.WorkLocState.CurrentState.PROCESS_CODE))
{
throw new Exception(string.Format("当前状态“{0}”,无法执行放行操作!", data.WorkLocState.CurrentState.STATE_NAME));
}
var novalue_count = data.WorkLocState.DataCache.Count(p => p.STATE_CODE == data.WorkLocState.CurrentState.STATE_CODE //采集点采集状态为当前工序状态
&& string.IsNullOrWhiteSpace(p.DA_VALUE) //采集点采集值不为空
&& !string.Equals(p.DA_MODE, "2") //过滤掉可省略的采集点
&& !string.IsNullOrWhiteSpace(p.MATERIAL_TYPE));//带有物料类别信息的采集点
if (novalue_count > 0)
{
throw new Exception("缺少重要物料信息,无法执行放行操作!");
}
}
}
}