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

44 lines
1.4 KiB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QMAPP.FJC.TRACING.DAInterface;
using QMAPP.FJC.Entity.Operation;
namespace QMAPP.FJC.TRACING.StateActions
{
/// <summary>
/// 创建产品数据
/// </summary>
public class CreateProduct : IStateAction
{
public void Execute(DAObject data)
{
var product = new Product()
{
PID = Guid.NewGuid().ToString(),
CAPACITY = 1,
CREATEDATE = DateTime.Now,
CREATEUSER = data.UserID,
MATERIAL_CODE = data.MaterialCode,
OUTFLAG = "0",
PRODUCESHIFTTCODE = data.Shift.PRODUCESHIFTTCODE,
PRODUCTCODE = "",
PRODUCTSOURCE = "0",
STATUS = "0",
USINGCOUNT = 0,
USINGSTATE = "0",
WORKCELL_CODE = data.WorkLocState.WORKCELL_CODE,
WORKCENTER_CODE = data.WorkLocState.WORKCELL_CODE,
WORKLOC_CODE = data.WorkLocState.WORKLOC_CODE,
TEAM_CODE = "",
MATERIAL_TYPE = data.DAI.MATERIAL_TYPE
};
data.ObjectPID = product.PID;
data.ObjectCacheList.Add(product);
data.WorkLocState.CurrentState.PROCESS_CODE = product.PRODUCTCODE;
data.AddToPersistentList(product, product.PID);
}
}
}