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

707 lines
28 KiB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using QMAPP.FJC.Entity.Operation;
using QMAPP.FJC.Entity;
using QMAPP.FJC.Entity.Basic;
using QMAPP.FJC.DAL.Basic;
using QMAPP.FJC.DAL.Operation;
using QMAPP.FJC.Entity.ProcessParameter;
using QMAPP.FJC.DAL;
namespace SimulateServiceHost
{
/// <summary>
/// 模拟生成搪塑表皮
/// </summary>
public class SlushClass
{
/// <summary>
/// 生成表皮信息
/// </summary>
public void Create()
{
//获取所有设备信息
List<MachineInfo> machineList = new List<MachineInfo>();
machineList = new MachineInfoDAL().GetList(new MachineInfo());
ProductDAL productDal = new ProductDAL();
MainOperationDAL modal = new MainOperationDAL();
InjectionParameterDAL indal = new InjectionParameterDAL();
ProductInjectionDAL pidal = new ProductInjectionDAL();
while (true)
{
Thread.Sleep(65000);
DateTime dt = System.DateTime.Now;
//年
string yearStr = dt.Year.ToString().Substring(2, 2);
//月
string monthStr = dt.Month.ToString().PadLeft(2, '0');
//日
string dayStr = dt.Day.ToString().PadLeft(2, '0');
//时
string hourStr = dt.Hour.ToString().PadLeft(2, '0');
//时
string minuteStr = dt.Minute.ToString().PadLeft(2, '0');
#region 生成表皮信息
//机器号
string machineNo = "2";
//产品类别
string productType = "B";
//高低配
int hudBasicValue = new Random().Next(1,3);
//颜色码
int colorValue = new Random().Next(1, 4);
//AB腔
int cavityTypeValue = new Random().Next(2);
//膜腔号
int cavityNoValue = new Random().Next(1, 10);
Product slushPro = new Product();
#region 表皮信息
#region 条码
StringBuilder slushCode = new StringBuilder();
slushCode.Append(yearStr);
slushCode.Append(monthStr);
slushCode.Append(dayStr);
slushCode.Append(hourStr);
slushCode.Append(minuteStr);
slushCode.Append(machineNo);
slushCode.Append(productType);
slushCode.Append((hudBasicValue == 1 ? "H" : "B"));
slushCode.Append(colorValue.ToString());
slushCode.Append((cavityTypeValue == 0 ? "A" : "B"));
slushCode.Append(cavityNoValue.ToString().PadLeft(2, '0'));
#endregion
slushPro.PID = Guid.NewGuid().ToString();
slushPro.PRODUCTCODE = slushCode.ToString();
slushPro.PRODUCTTYPE = EnumGeter.ProductType.biaopi.GetHashCode().ToString();
slushPro.PRODUCTSOURCE = "0";
slushPro.MACHINENAME = machineList.First(o => o.PROCESSTYPE == "0").MACHINENAME;
slushPro.MACHINECODDE = machineList.First(o => o.PROCESSTYPE == "0").MACHINECODDE;
slushPro.STATUS = "0";
slushPro.CURRENTPROCESS = EnumGeter.ProcessType.lengdaoruohua.GetHashCode().ToString();
slushPro.PRODUCELINE = "B9";
slushPro.PRODUCESHIFTNAME = "";
slushPro.PRODUCESHIFTTCODE = "";
slushPro.OUTFLAG = "0";
slushPro.USINGSTATE = "0";
slushPro.CAPACITY = 1;
slushPro.USINGCOUNT = 0;
slushPro.CREATEUSER = "";
slushPro.CREATEDATE = dt;
slushPro.UPDATEDATE = dt;
productDal.Insert(slushPro);
Console.WriteLine("生成表皮条码" + slushPro.PRODUCTCODE);
#endregion
#region 加工记录
MainOperation bmo = new MainOperation();
bmo.PID = Guid.NewGuid().ToString();
bmo.PDID = slushPro.PID;
bmo.PRODUCTCODE = slushPro.PRODUCTCODE;
bmo.PROCESSTYPE = EnumGeter.ProcessType.tangsu.GetHashCode().ToString();
bmo.PRODUCTTYPE = slushPro.PRODUCTTYPE;
bmo.MACHINENAME = slushPro.MACHINENAME;
bmo.MACHINECODDE = slushPro.MACHINECODDE;
bmo.STATUS = slushPro.STATUS;
bmo.MOLDNUMBER = "1";
bmo.OPERATESTATE = "1";
bmo.OPERATEDDATE = slushPro.CREATEDATE;
bmo.CURRENTPROCESS = EnumGeter.ProcessType.tangsu.GetHashCode().ToString();
bmo.PRODUCESHIFTNAME = slushPro.PRODUCESHIFTNAME;
bmo.PRODUCESHIFTTCODE = slushPro.PRODUCESHIFTTCODE;
bmo.PRODUCELINE = slushPro.PRODUCELINE;
bmo.MODELSTATION = "1";
bmo.CREATEDATE = dt;
bmo.UPDATEDATE = dt;
modal.Insert(bmo);
#endregion
#region 搪塑加工参数
SlushParamter spara = new SlushParamter();
spara.PID = Guid.NewGuid().ToString();
spara.IOID = bmo.PID;
spara.CREATEDATE = System.DateTime.Now;
SlushParamterDAL spdal = new SlushParamterDAL();
spdal.Insert(spara);
#endregion
ProductAttribute proAttr = new ProductAttribute();
proAttr.PID = Guid.NewGuid().ToString();
proAttr.MPPID = slushPro.PID;
proAttr.VAL1 = slushPro.MACHINECODDE;
proAttr.VAL2 = slushPro.PRODUCTTYPE;
proAttr.VAL3 = (hudBasicValue == 1 ? "H" : "B");
proAttr.VAL4 = colorValue.ToString();
proAttr.VAL5 = (cavityTypeValue == 0 ? "A" : "B");
proAttr.VAL6 = cavityNoValue.ToString().PadLeft(2, '0');
proAttr.VAL7 = System.DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss");
ProductAttributeDAL proAttrDAL = new ProductAttributeDAL();
proAttrDAL.Insert(proAttr);
ProductInjection pi = new ProductInjection();
pi.PID = Guid.NewGuid().ToString();
pi.IPID = Guid.NewGuid().ToString();
pi.MPPID = slushPro.PID;
pi.MATERIALNAME = "搪塑原材料";
pi.MATERIALCODE = "PVC";
pi.MATERIALTYPE = "0";
pi.MATERIALBATCH = "20150820";
pi.INJECTIONINDEX = 1;
pi.INJECTIONTERMINAL = 1;
pi.USEDWEIGHT = 100;
pi.PROCESSTYPE = EnumGeter.ProcessType.tangsu.GetHashCode().ToString();
pi.CREATEDATE = dt;
pi.UPDATEDATE = dt;
pidal.Insert(pi);
#endregion
#region 生成骨架信息
#region 骨架
Product gPro = new Product();
StringBuilder gjStr = new StringBuilder();
gjStr.Append("B9A");
gjStr.Append(yearStr);
gjStr.Append(monthStr);
gjStr.Append(dayStr);
gjStr.Append(hourStr);
gjStr.Append(minuteStr);
gjStr.Append(new Random().Next(1, 4).ToString());
gjStr.Append(new Random().Next(10, 20).ToString());
gjStr.Append(new Random().Next(1, 5000).ToString().PadLeft(4,'0'));
gPro.PID = Guid.NewGuid().ToString();
gPro.PRODUCTCODE = gjStr.ToString();
gPro.PRODUCTTYPE = EnumGeter.ProductType.gujia.GetHashCode().ToString();
gPro.PRODUCTSOURCE = "0";
gPro.MACHINENAME = machineList.First(o => o.PROCESSTYPE == EnumGeter.ProcessType.gujiazhusu.GetHashCode().ToString()).MACHINENAME;
gPro.MACHINECODDE = machineList.First(o => o.PROCESSTYPE == EnumGeter.ProcessType.gujiazhusu.GetHashCode().ToString()).MACHINECODDE;
gPro.STATUS = "0";
gPro.CURRENTPROCESS = EnumGeter.ProcessType.huoyanjiagong.GetHashCode().ToString();
gPro.PRODUCELINE = "B9";
gPro.PRODUCESHIFTNAME = "";
gPro.PRODUCESHIFTTCODE = "";
gPro.OUTFLAG = "0";
gPro.USINGSTATE = "0";
gPro.CAPACITY = 1;
gPro.USINGCOUNT = 0;
gPro.CREATEUSER = "";
gPro.CREATEDATE = dt;
gPro.UPDATEDATE = dt;
productDal.Insert(gPro);
Console.WriteLine("生成骨架条码" + gPro.PRODUCTCODE);
#endregion
#region 加工记录
MainOperation gmo = new MainOperation();
gmo.PID = Guid.NewGuid().ToString();
gmo.PDID = gPro.PID;
gmo.PRODUCTCODE = gPro.PRODUCTCODE;
gmo.PROCESSTYPE = EnumGeter.ProcessType.gujiazhusu.GetHashCode().ToString();
gmo.PRODUCTTYPE = gPro.PRODUCTTYPE;
gmo.MACHINENAME = gPro.MACHINENAME;
gmo.MACHINECODDE = gPro.MACHINECODDE;
gmo.STATUS = gPro.STATUS;
gmo.MOLDNUMBER = "1";
gmo.OPERATESTATE = "1";
gmo.OPERATEDDATE = gPro.CREATEDATE;
gmo.CURRENTPROCESS = EnumGeter.ProcessType.gujiazhusu.GetHashCode().ToString();
gmo.PRODUCESHIFTNAME = gPro.PRODUCESHIFTNAME;
gmo.PRODUCESHIFTTCODE = gPro.PRODUCESHIFTTCODE;
gmo.PRODUCELINE = gPro.PRODUCELINE;
gmo.MODELSTATION = "1";
gmo.CREATEDATE = dt;
gmo.UPDATEDATE = dt;
modal.Insert(gmo);
#endregion
InJectionParameter gjPara = new InJectionParameter();
gjPara.PID = Guid.NewGuid().ToString();
gjPara.PDID = gPro.PID;
gjPara.MOID = gmo.PID;
gjPara.CREATEDATE = System.DateTime.Now;
indal.Insert(gjPara);
ProductInjection gi = new ProductInjection();
gi.PID = Guid.NewGuid().ToString();
gi.IPID = Guid.NewGuid().ToString();
gi.MPPID = gPro.PID;
gi.MATERIALNAME = "骨架注塑原材料";
gi.MATERIALCODE = "PVC";
gi.MATERIALTYPE = "0";
gi.MATERIALBATCH = "20150720";
gi.INJECTIONINDEX = 1;
gi.INJECTIONTERMINAL = 1;
gi.USEDWEIGHT = 100;
gi.PROCESSTYPE = EnumGeter.ProcessType.gujiazhusu.GetHashCode().ToString();
gi.CREATEDATE = dt;
gi.UPDATEDATE = dt;
pidal.Insert(gi);
ProductInjection gii = new ProductInjection();
gii.PID = Guid.NewGuid().ToString();
gii.IPID = Guid.NewGuid().ToString();
gii.MPPID = gPro.PID;
gii.MATERIALNAME = "织布";
gii.MATERIALCODE = "ZB";
gii.MATERIALTYPE = "1";
gii.MATERIALBATCH = "20150720";
gii.INJECTIONINDEX = 1;
gii.INJECTIONTERMINAL = 1;
gii.USEDWEIGHT = 100;
gii.PROCESSTYPE = EnumGeter.ProcessType.gujiazhusu.GetHashCode().ToString();
gii.CREATEDATE = dt;
gii.UPDATEDATE = dt;
pidal.Insert(gii);
#endregion
#region 生成气囊支架
Product qPro = new Product();
StringBuilder qnStr = new StringBuilder();
qnStr.Append("B9D");
qnStr.Append(yearStr);
qnStr.Append(monthStr);
qnStr.Append(dayStr);
qnStr.Append(hourStr);
qnStr.Append(minuteStr);
qnStr.Append(new Random().Next(1, 4).ToString());
qnStr.Append(new Random().Next(10, 20).ToString());
qnStr.Append(new Random().Next(1, 5000).ToString().PadLeft(4, '0'));
qPro.PID = Guid.NewGuid().ToString();
qPro.PRODUCTCODE = qnStr.ToString();
qPro.PRODUCTTYPE = EnumGeter.ProductType.qinangzhijia.GetHashCode().ToString();
qPro.PRODUCTSOURCE = "0";
qPro.MACHINENAME = machineList.First(o => o.PROCESSTYPE == EnumGeter.ProcessType.qinangzhijiazhusu.GetHashCode().ToString()).MACHINENAME;
qPro.MACHINECODDE = machineList.First(o => o.PROCESSTYPE == EnumGeter.ProcessType.qinangzhijiazhusu.GetHashCode().ToString()).MACHINECODDE;
qPro.STATUS = "0";
qPro.CURRENTPROCESS = EnumGeter.ProcessType.maojie.GetHashCode().ToString();
qPro.PRODUCELINE = "B9";
qPro.PRODUCESHIFTNAME = "";
qPro.PRODUCESHIFTTCODE = "";
qPro.OUTFLAG = "0";
qPro.USINGSTATE = "0";
qPro.CAPACITY = 1;
qPro.USINGCOUNT = 0;
qPro.CREATEUSER = "";
qPro.CREATEDATE = dt;
qPro.UPDATEDATE = dt;
productDal.Insert(qPro);
Console.WriteLine("生成气囊支架条码" + qPro.PRODUCTCODE);
#region 加工记录
MainOperation qmo = new MainOperation();
qmo.PID = Guid.NewGuid().ToString();
qmo.PDID = qPro.PID;
qmo.PRODUCTCODE = qPro.PRODUCTCODE;
qmo.PROCESSTYPE = EnumGeter.ProcessType.qinangzhijiazhusu.GetHashCode().ToString();
qmo.PRODUCTTYPE = qPro.PRODUCTTYPE;
qmo.MACHINENAME = qPro.MACHINENAME;
qmo.MACHINECODDE = qPro.MACHINECODDE;
qmo.STATUS = qPro.STATUS;
qmo.MOLDNUMBER = "1";
qmo.OPERATESTATE = "1";
qmo.OPERATEDDATE = qPro.CREATEDATE;
qmo.CURRENTPROCESS = EnumGeter.ProcessType.qinangzhijiazhusu.GetHashCode().ToString();
qmo.PRODUCESHIFTNAME = qPro.PRODUCESHIFTNAME;
qmo.PRODUCESHIFTTCODE = qPro.PRODUCESHIFTTCODE;
qmo.PRODUCELINE = qPro.PRODUCELINE;
qmo.MODELSTATION = "1";
qmo.CREATEDATE = dt;
qmo.UPDATEDATE = dt;
modal.Insert(qmo);
#endregion
InJectionParameter qPara = new InJectionParameter();
qPara.PID = Guid.NewGuid().ToString();
qPara.MOID = qmo.PID;
qPara.PDID = qPro.PID;
qPara.CREATEDATE = System.DateTime.Now;
indal.Insert(qPara);
ProductInjection qi = new ProductInjection();
qi.PID = Guid.NewGuid().ToString();
qi.IPID = Guid.NewGuid().ToString();
qi.MPPID = qPro.PID;
qi.MATERIALNAME = "气囊支架原材料";
qi.MATERIALCODE = "PVC";
qi.MATERIALTYPE = "0";
qi.MATERIALBATCH = "20150725";
qi.INJECTIONINDEX = 1;
qi.INJECTIONTERMINAL = 1;
qi.USEDWEIGHT = 100;
qi.PROCESSTYPE = EnumGeter.ProcessType.qinangzhijiazhusu.GetHashCode().ToString();
qi.CREATEDATE = dt;
qi.UPDATEDATE = dt;
pidal.Insert(qi);
#endregion
#region 生成开关支架
Product kPro = new Product();
StringBuilder kStr = new StringBuilder();
kStr.Append("B9F");
kStr.Append(yearStr);
kStr.Append(monthStr);
kStr.Append(dayStr);
kStr.Append(hourStr);
kStr.Append(minuteStr);
kStr.Append(new Random().Next(1, 4).ToString());
kStr.Append(new Random().Next(10, 20).ToString());
kStr.Append(new Random().Next(1, 5000).ToString().PadLeft(4, '0'));
kPro.PID = Guid.NewGuid().ToString();
kPro.PRODUCTCODE = kStr.ToString();
kPro.PRODUCTTYPE = EnumGeter.ProductType.kaiguanzhijia.GetHashCode().ToString();
kPro.PRODUCTSOURCE = "0";
kPro.MACHINENAME = machineList.First(o => o.PROCESSTYPE == EnumGeter.ProcessType.gujiazhusu.GetHashCode().ToString()).MACHINENAME;
kPro.MACHINECODDE = machineList.First(o => o.PROCESSTYPE == EnumGeter.ProcessType.gujiazhusu.GetHashCode().ToString()).MACHINECODDE;
kPro.STATUS = "0";
kPro.CURRENTPROCESS = EnumGeter.ProcessType.chaoshengbohanjie.GetHashCode().ToString();
kPro.PRODUCELINE = "B9";
kPro.PRODUCESHIFTNAME = "";
kPro.PRODUCESHIFTTCODE = "";
kPro.OUTFLAG = "0";
kPro.USINGSTATE = "0";
kPro.CAPACITY = 1;
kPro.USINGCOUNT = 0;
kPro.CREATEUSER = "";
kPro.CREATEDATE = dt;
kPro.UPDATEDATE = dt;
productDal.Insert(kPro);
Console.WriteLine("生成开关支架条码" + kPro.PRODUCTCODE);
#region 加工记录
MainOperation kmo = new MainOperation();
kmo.PID = Guid.NewGuid().ToString();
kmo.PDID = kPro.PID;
kmo.PRODUCTCODE = kPro.PRODUCTCODE;
kmo.PROCESSTYPE = EnumGeter.ProcessType.gujiazhusu.GetHashCode().ToString();
kmo.PRODUCTTYPE = kPro.PRODUCTTYPE;
kmo.MACHINENAME = kPro.MACHINENAME;
kmo.MACHINECODDE = kPro.MACHINECODDE;
kmo.STATUS = kPro.STATUS;
kmo.MOLDNUMBER = "1";
kmo.OPERATESTATE = "1";
kmo.OPERATEDDATE = kPro.CREATEDATE;
kmo.CURRENTPROCESS = EnumGeter.ProcessType.gujiazhusu.GetHashCode().ToString();
kmo.PRODUCESHIFTNAME = kPro.PRODUCESHIFTNAME;
kmo.PRODUCESHIFTTCODE = kPro.PRODUCESHIFTTCODE;
kmo.PRODUCELINE = kPro.PRODUCELINE;
kmo.MODELSTATION = "1";
kmo.CREATEDATE = dt;
kmo.UPDATEDATE = dt;
modal.Insert(kmo);
#endregion
InJectionParameter kPara = new InJectionParameter();
kPara.PDID = kPro.PID;
kPara.MOID = kmo.PID;
kPara.PID = Guid.NewGuid().ToString();
kPara.CREATEDATE = System.DateTime.Now;
indal.Insert(kPara);
ProductInjection ki = new ProductInjection();
ki.PID = Guid.NewGuid().ToString();
ki.IPID = Guid.NewGuid().ToString();
ki.MPPID = kPro.PID;
ki.MATERIALNAME = "开关支架原材料";
ki.MATERIALCODE = "PVC";
ki.MATERIALTYPE = "0";
ki.MATERIALBATCH = "20150725";
ki.INJECTIONINDEX = 1;
ki.INJECTIONTERMINAL = 1;
ki.USEDWEIGHT = 100;
ki.PROCESSTYPE = EnumGeter.ProcessType.gujiazhusu.GetHashCode().ToString();
ki.CREATEDATE = dt;
ki.UPDATEDATE = dt;
pidal.Insert(ki);
#endregion
#region 生成风道信息
Product fPro = new Product();
StringBuilder fStr = new StringBuilder();
fStr.Append("B9B");
fStr.Append(yearStr);
fStr.Append(monthStr);
fStr.Append(dayStr);
fStr.Append(hourStr);
fStr.Append(minuteStr);
fStr.Append(new Random().Next(1, 4).ToString());
fStr.Append(new Random().Next(10, 20).ToString());
fStr.Append(new Random().Next(1, 5000).ToString().PadLeft(4, '0'));
fPro.PID = Guid.NewGuid().ToString();
fPro.PRODUCTCODE = fStr.ToString();
fPro.PRODUCTTYPE = EnumGeter.ProductType.fengdao.GetHashCode().ToString();
fPro.PRODUCTSOURCE = "0";
fPro.MACHINENAME = machineList.First(o => o.PROCESSTYPE == EnumGeter.ProcessType.fengdaozhusu.GetHashCode().ToString()).MACHINENAME;
fPro.MACHINECODDE = machineList.First(o => o.PROCESSTYPE == EnumGeter.ProcessType.fengdaozhusu.GetHashCode().ToString()).MACHINECODDE;
fPro.STATUS = "0";
fPro.CURRENTPROCESS = EnumGeter.ProcessType.maojie.GetHashCode().ToString();
fPro.PRODUCELINE = "B9";
fPro.PRODUCESHIFTNAME = "";
fPro.PRODUCESHIFTTCODE = "";
fPro.OUTFLAG = "0";
fPro.USINGSTATE = "0";
fPro.CAPACITY = 1;
fPro.USINGCOUNT = 0;
fPro.CREATEUSER = "";
fPro.CREATEDATE = dt;
fPro.UPDATEDATE = dt;
productDal.Insert(fPro);
Console.WriteLine("生成风道条码" + fPro.PRODUCTCODE);
#region 加工记录
MainOperation fmo = new MainOperation();
fmo.PID = Guid.NewGuid().ToString();
fmo.PDID = fPro.PID;
fmo.PRODUCTCODE = fPro.PRODUCTCODE;
fmo.PROCESSTYPE = EnumGeter.ProcessType.fengdaozhusu.GetHashCode().ToString();
fmo.PRODUCTTYPE = fPro.PRODUCTTYPE;
fmo.MACHINENAME = fPro.MACHINENAME;
fmo.MACHINECODDE = fPro.MACHINECODDE;
fmo.STATUS = fPro.STATUS;
fmo.MOLDNUMBER = "1";
fmo.OPERATESTATE = "1";
fmo.OPERATEDDATE = fPro.CREATEDATE;
fmo.CURRENTPROCESS = EnumGeter.ProcessType.fengdaozhusu.GetHashCode().ToString();
fmo.PRODUCESHIFTNAME = fPro.PRODUCESHIFTNAME;
fmo.PRODUCESHIFTTCODE = fPro.PRODUCESHIFTTCODE;
fmo.PRODUCELINE = fPro.PRODUCELINE;
fmo.MODELSTATION = "1";
fmo.CREATEDATE = dt;
fmo.UPDATEDATE = dt;
modal.Insert(fmo);
#endregion
InJectionParameter fPara = new InJectionParameter();
fPara.PDID = fPro.PID;
fPara.MOID = fmo.PID;
fPara.PID = Guid.NewGuid().ToString();
fPara.CREATEDATE = System.DateTime.Now;
indal.Insert(fPara);
ProductInjection fi = new ProductInjection();
fi.PID = Guid.NewGuid().ToString();
fi.IPID = Guid.NewGuid().ToString();
fi.MPPID = fPro.PID;
fi.MATERIALNAME = "风道注塑原材料";
fi.MATERIALCODE = "PVC";
fi.MATERIALTYPE = "0";
fi.MATERIALBATCH = "20150720";
fi.INJECTIONINDEX = 1;
fi.INJECTIONTERMINAL = 1;
fi.USEDWEIGHT = 100;
fi.PROCESSTYPE = EnumGeter.ProcessType.fengdaozhusu.GetHashCode().ToString();
fi.CREATEDATE = dt;
fi.UPDATEDATE = dt;
pidal.Insert(fi);
#endregion
#region 生成HUD风道
if (hudBasicValue == 1)
{
Product hPro = new Product();
StringBuilder hStr = new StringBuilder();
hStr.Append("B9C");
hStr.Append(yearStr);
hStr.Append(monthStr);
hStr.Append(dayStr);
hStr.Append(hourStr);
hStr.Append(minuteStr);
hStr.Append(new Random().Next(1, 4).ToString());
hStr.Append(new Random().Next(10, 20).ToString());
hStr.Append(new Random().Next(1, 5000).ToString().PadLeft(4, '0'));
hPro.PID = Guid.NewGuid().ToString();
hPro.PRODUCTCODE = hStr.ToString();
hPro.PRODUCTTYPE = EnumGeter.ProductType.HUDfengdao.GetHashCode().ToString();
hPro.PRODUCTSOURCE = "0";
hPro.MACHINENAME = machineList.First(o => o.PROCESSTYPE == EnumGeter.ProcessType.HUDfengdaozhusu.GetHashCode().ToString()).MACHINENAME;
hPro.MACHINECODDE = machineList.First(o => o.PROCESSTYPE == EnumGeter.ProcessType.HUDfengdaozhusu.GetHashCode().ToString()).MACHINECODDE;
hPro.STATUS = "0";
hPro.CURRENTPROCESS = EnumGeter.ProcessType.zongchengzhuangpei.GetHashCode().ToString();
hPro.PRODUCELINE = "B9";
hPro.PRODUCESHIFTNAME = "";
hPro.PRODUCESHIFTTCODE = "";
hPro.OUTFLAG = "0";
hPro.USINGSTATE = "0";
hPro.CAPACITY = 1;
hPro.USINGCOUNT = 0;
hPro.CREATEUSER = "";
hPro.CREATEDATE = dt;
hPro.UPDATEDATE = dt;
productDal.Insert(hPro);
Console.WriteLine("生成HUD风道条码" + hPro.PRODUCTCODE);
#region 加工记录
MainOperation hmo = new MainOperation();
hmo.PID = Guid.NewGuid().ToString();
hmo.PDID = hPro.PID;
hmo.PRODUCTCODE = hPro.PRODUCTCODE;
hmo.PROCESSTYPE = EnumGeter.ProcessType.HUDfengdaozhusu.GetHashCode().ToString();
hmo.PRODUCTTYPE = hPro.PRODUCTTYPE;
hmo.MACHINENAME = hPro.MACHINENAME;
hmo.MACHINECODDE = hPro.MACHINECODDE;
hmo.STATUS = hPro.STATUS;
hmo.MOLDNUMBER = "1";
hmo.OPERATESTATE = "1";
hmo.OPERATEDDATE = hPro.CREATEDATE;
hmo.CURRENTPROCESS = EnumGeter.ProcessType.HUDfengdaozhusu.GetHashCode().ToString();
hmo.PRODUCESHIFTNAME = hPro.PRODUCESHIFTNAME;
hmo.PRODUCESHIFTTCODE = hPro.PRODUCESHIFTTCODE;
hmo.PRODUCELINE = hPro.PRODUCELINE;
hmo.MODELSTATION = "1";
hmo.CREATEDATE = dt;
hmo.UPDATEDATE = dt;
modal.Insert(hmo);
#endregion
InJectionParameter hPara = new InJectionParameter();
hPara.PID = Guid.NewGuid().ToString();
hPara.MOID = hmo.PID;
hPara.PDID = hPro.PID;
hPara.CREATEDATE = System.DateTime.Now;
indal.Insert(hPara);
ProductInjection hi = new ProductInjection();
hi.PID = Guid.NewGuid().ToString();
hi.IPID = Guid.NewGuid().ToString();
hi.MPPID = hPro.PID;
hi.MATERIALNAME = "HUD风道注塑原材料";
hi.MATERIALCODE = "PVC";
hi.MATERIALTYPE = "0";
hi.MATERIALBATCH = "20150720";
hi.INJECTIONINDEX = 1;
hi.INJECTIONTERMINAL = 1;
hi.USEDWEIGHT = 100;
hi.PROCESSTYPE = EnumGeter.ProcessType.HUDfengdaozhusu.GetHashCode().ToString();
hi.CREATEDATE = dt;
hi.UPDATEDATE = dt;
pidal.Insert(hi);
}
#endregion
}
}
}
}