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

34 lines
1.1 KiB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QMAPP.FJC.TRACING.DAInterface;
namespace QMAPP.FJC.TRACING.DataValidators
{
/// <summary>
/// 工单顺序校验
/// </summary>
public class OrderSEQValidator : IDataValidator
{
public ValidateResult Validate(DAObject data, Entity.QT.DAIValidation validOption)
{
if (data.OrderPlan == null)
{
return new ValidateResult(true, "");
}
DAL.ProductionPlan.WorkOrderDAL orderdal = new DAL.ProductionPlan.WorkOrderDAL();
var orders=orderdal.GetOrderInCell(data.DAI.WORKCELL_CODE, 1, 1);
if (orders.Count < 1)
{
throw new Exception("无可生产工单!");
}
if (!string.Equals(data.OrderPlan.PID, orders[0].PID))
{
return new ValidateResult(false, string.Format("请按照前工序下线顺序生产!当前应生产的工单号为“{0}”", orders[0].ORDERPLAN_NO));
}
return new ValidateResult(true, "");
}
}
}