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

1820 lines
73 KiB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QMAPP.FJC.Entity.Operation;
using QMAPP.FJC.Entity;
using QMAPP.FJC.DAL.Operation;
using QMAPP.FJC.DAL;
using QMAPP.FJC.DAL.Basic;
using QMAPP.FJC.Entity.Basic;
using QMAPP.FJC.Entity.ProcessParameter;
using QMFrameWork.Data;
namespace SimulateServiceHost.DataTest
{
public class HalfYearCreate
{
public void InsertData(DateTime startDt,DateTime endDt)
{
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();
RivetingPatameterDAL rpdal = new RivetingPatameterDAL();
MainProductDAL mpdal = new MainProductDAL();
int count = 0;
//开关支架
Product kPro = new Product();
//中控支架
Product zPro = new Product();
//格栅
Product gsPro = new Product();
Product hPro = new Product();
MainOperation kmo=new MainOperation();
ProductInjection ki = new ProductInjection();
MainOperation hmo = new MainOperation();
InJectionParameter hPara = new InJectionParameter();
ProductInjection hi = new ProductInjection();
MainProduct huq = new MainProduct();
try
{
while (startDt < endDt)
{
if (count == 10)
{
count = 0;
}
Console.WriteLine(startDt.ToString("yyyy-MM-dd HH:mm:ss"));
try
{
#region 表皮
#region 表皮条码
//年
string yearStr = startDt.Year.ToString().Substring(2, 2);
//月
string monthStr = startDt.Month.ToString().PadLeft(2, '0');
//日
string dayStr = startDt.Day.ToString().PadLeft(2, '0');
//时
string hourStr = startDt.Hour.ToString().PadLeft(2, '0');
//时
string minuteStr = startDt.Minute.ToString().PadLeft(2, '0');
//机器号
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);
#endregion
#region 表皮信息
Product slushPro = new Product();
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'));
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.jiaozhu.GetHashCode().ToString();
slushPro.PRODUCELINE = "B9";
slushPro.PRODUCESHIFTNAME = "";
slushPro.PRODUCESHIFTTCODE = "";
slushPro.OUTFLAG = "1";
slushPro.USINGSTATE = "2";
slushPro.CAPACITY = 1;
slushPro.USINGCOUNT = 1;
slushPro.CREATEUSER = "";
slushPro.CREATEDATE = startDt;
slushPro.UPDATEDATE = startDt;
#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 = startDt;
bmo.UPDATEDATE = startDt;
#endregion
#region 搪塑加工参数
SlushParamter spara = new SlushParamter();
spara.PID = Guid.NewGuid().ToString();
spara.IOID = bmo.PID;
spara.CREATEDATE = System.DateTime.Now;
#endregion
#region 表皮属性
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");
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 = startDt;
pi.UPDATEDATE = startDt;
#endregion
#endregion
#region 冷刀弱化
#region 加工记录
MainOperation bmowe = new MainOperation();
bmowe.PID = Guid.NewGuid().ToString();
bmowe.PDID = slushPro.PID;
bmowe.PRODUCTCODE = slushPro.PRODUCTCODE;
bmowe.PROCESSTYPE = EnumGeter.ProcessType.lengdaoruohua.GetHashCode().ToString();
bmowe.PRODUCTTYPE = slushPro.PRODUCTTYPE;
bmowe.MACHINENAME = slushPro.MACHINENAME;
bmowe.MACHINECODDE = slushPro.MACHINECODDE;
bmowe.STATUS = slushPro.STATUS;
bmowe.MOLDNUMBER = "1";
bmowe.OPERATESTATE = "1";
bmowe.OPERATEDDATE = slushPro.CREATEDATE;
bmowe.CURRENTPROCESS = EnumGeter.ProcessType.lengdaoruohua.GetHashCode().ToString();
bmowe.PRODUCESHIFTNAME = slushPro.PRODUCESHIFTNAME;
bmowe.PRODUCESHIFTTCODE = slushPro.PRODUCESHIFTTCODE;
bmowe.PRODUCELINE = slushPro.PRODUCELINE;
bmowe.MODELSTATION = "1";
bmowe.CREATEDATE = startDt;
bmowe.UPDATEDATE = startDt;
#endregion
#region 加工参数
BurnParameter burn = new BurnParameter();
burn.PID = Guid.NewGuid().ToString();
burn.PDID = slushPro.PID;
burn.PRODUCTCODE = slushPro.PRODUCTCODE;
burn.MOID = bmowe.PID;
burn.PRODUCTTYPE = slushPro.PRODUCTTYPE;
burn.MACHINENAME = slushPro.MACHINENAME;
burn.MACHINECODDE = slushPro.MACHINECODDE;
burn.CREATEDATE = startDt;
burn.RESTTHICKNESS = 1;
#endregion
#endregion
#region 预热
#region 加工记录
MainOperation bmohe = new MainOperation();
bmohe.PID = Guid.NewGuid().ToString();
bmohe.PDID = slushPro.PID;
bmohe.PRODUCTCODE = slushPro.PRODUCTCODE;
bmohe.PROCESSTYPE = EnumGeter.ProcessType.yure.GetHashCode().ToString();
bmohe.PRODUCTTYPE = slushPro.PRODUCTTYPE;
bmohe.MACHINENAME = slushPro.MACHINENAME;
bmohe.MACHINECODDE = slushPro.MACHINECODDE;
bmohe.STATUS = slushPro.STATUS;
bmohe.MOLDNUMBER = "1";
bmohe.OPERATESTATE = "1";
bmohe.OPERATEDDATE = slushPro.CREATEDATE;
bmohe.CURRENTPROCESS = EnumGeter.ProcessType.yure.GetHashCode().ToString();
bmohe.PRODUCESHIFTNAME = slushPro.PRODUCESHIFTNAME;
bmohe.PRODUCESHIFTTCODE = slushPro.PRODUCESHIFTTCODE;
bmohe.PRODUCELINE = slushPro.PRODUCELINE;
bmohe.MODELSTATION = "1";
bmohe.CREATEDATE = startDt;
bmohe.UPDATEDATE = startDt;
#endregion
#region 加工参数
PreheatParameter pre = new PreheatParameter();
pre.PID = Guid.NewGuid().ToString();
pre.PDID = slushPro.PID;
pre.PRODUCTCODE = slushPro.PRODUCTCODE;
pre.MOID = bmohe.PID;
pre.PRODUCTTYPE = slushPro.PRODUCTTYPE;
pre.TEMPRATURE = 1;
pre.MACHINENAME = slushPro.MACHINENAME;
pre.MACHINECODDE = slushPro.MACHINECODDE;
pre.CREATEDATE = startDt;
#endregion
#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 = startDt;
gPro.UPDATEDATE = startDt;
#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 = startDt;
gmo.UPDATEDATE = startDt;
#endregion
#region 加工参数
InJectionParameter gjPara = new InJectionParameter();
gjPara.PID = Guid.NewGuid().ToString();
gjPara.PDID = gPro.PID;
gjPara.MOID = gmo.PID;
gjPara.CREATEDATE = System.DateTime.Now;
#endregion
#region 投料关联表
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 = startDt;
gi.UPDATEDATE = startDt;
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 = startDt;
gii.UPDATEDATE = startDt;
#endregion
#endregion
#region 气囊支架
#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 = startDt;
qPro.UPDATEDATE = startDt;
#endregion
#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 = startDt;
qmo.UPDATEDATE = startDt;
#endregion
#region 加工参数
InJectionParameter qPara = new InJectionParameter();
qPara.PID = Guid.NewGuid().ToString();
qPara.MOID = qmo.PID;
qPara.PDID = qPro.PID;
qPara.CREATEDATE = System.DateTime.Now;
#endregion
#region 投料关联
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 = startDt;
qi.UPDATEDATE = startDt;
#endregion
#endregion
#region 开关支架
if (count == 0)
{
#region 生成开关支架
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 = startDt;
kPro.UPDATEDATE = startDt;
#endregion
#region 加工记录
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 = startDt;
kmo.UPDATEDATE = startDt;
#endregion
#region 投料关联表
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 = startDt;
ki.UPDATEDATE = startDt;
#endregion
}
#endregion
#region 中控支架
if (count == 0)
{
#region 生成中控支架
zPro = new Product();
StringBuilder kStr = new StringBuilder();
kStr.Append("ZKZ");
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'));
zPro.PID = Guid.NewGuid().ToString();
zPro.PRODUCTCODE = kStr.ToString();
zPro.PRODUCTTYPE = EnumGeter.ProductType.zhongkongzhijia.GetHashCode().ToString();
zPro.PRODUCTSOURCE = "0";
zPro.MACHINENAME = machineList.First(o => o.PROCESSTYPE == EnumGeter.ProcessType.gujiazhusu.GetHashCode().ToString()).MACHINENAME;
zPro.MACHINECODDE = machineList.First(o => o.PROCESSTYPE == EnumGeter.ProcessType.gujiazhusu.GetHashCode().ToString()).MACHINECODDE;
zPro.STATUS = "0";
zPro.CURRENTPROCESS = EnumGeter.ProcessType.chaoshengbohanjie.GetHashCode().ToString();
zPro.PRODUCELINE = "B9";
zPro.PRODUCESHIFTNAME = "";
zPro.PRODUCESHIFTTCODE = "";
zPro.OUTFLAG = "0";
zPro.USINGSTATE = "0";
zPro.CAPACITY = 10;
zPro.USINGCOUNT = 10;
zPro.CREATEUSER = "";
zPro.CREATEDATE = startDt;
zPro.UPDATEDATE = startDt;
#endregion
}
#endregion
#region 格栅
if (count == 0)
{
#region 生成格栅
gsPro = new Product();
StringBuilder kStr = new StringBuilder();
kStr.Append("GSZ");
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'));
gsPro.PID = Guid.NewGuid().ToString();
gsPro.PRODUCTCODE = kStr.ToString();
gsPro.PRODUCTTYPE = EnumGeter.ProductType.geshan.GetHashCode().ToString();
gsPro.PRODUCTSOURCE = "0";
gsPro.MACHINENAME = machineList.First(o => o.PROCESSTYPE == EnumGeter.ProcessType.gujiazhusu.GetHashCode().ToString()).MACHINENAME;
gsPro.MACHINECODDE = machineList.First(o => o.PROCESSTYPE == EnumGeter.ProcessType.gujiazhusu.GetHashCode().ToString()).MACHINECODDE;
gsPro.STATUS = "0";
gsPro.CURRENTPROCESS = EnumGeter.ProcessType.zongchengzhuangpei.GetHashCode().ToString();
gsPro.PRODUCELINE = "B9";
gsPro.PRODUCESHIFTNAME = "";
gsPro.PRODUCESHIFTTCODE = "";
gsPro.OUTFLAG = "0";
gsPro.USINGSTATE = "0";
gsPro.CAPACITY = 1;
gsPro.USINGCOUNT = 0;
gsPro.CREATEUSER = "";
gsPro.CREATEDATE = startDt;
gsPro.UPDATEDATE = startDt;
#endregion
}
#endregion
#region 风道
#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 = startDt;
fPro.UPDATEDATE = startDt;
#endregion
#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 = startDt;
fmo.UPDATEDATE = startDt;
#endregion
#region 加工参数
InJectionParameter fPara = new InJectionParameter();
fPara.PDID = fPro.PID;
fPara.MOID = fmo.PID;
fPara.PID = Guid.NewGuid().ToString();
fPara.CREATEDATE = System.DateTime.Now;
#endregion
#region 投料关联表
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 = startDt;
fi.UPDATEDATE = startDt;
#endregion
#endregion
#region 风道铆接
#region 加工记录
MainOperation fmorp = new MainOperation();
fmorp.PID = Guid.NewGuid().ToString();
fmorp.PDID = fPro.PID;
fmorp.PRODUCTCODE = fPro.PRODUCTCODE;
fmorp.PROCESSTYPE = EnumGeter.ProcessType.maojie.GetHashCode().ToString();
fmorp.PRODUCTTYPE = fPro.PRODUCTTYPE;
fmorp.MACHINENAME = fPro.MACHINENAME;
fmorp.MACHINECODDE = fPro.MACHINECODDE;
fmorp.STATUS = fPro.STATUS;
fmorp.MOLDNUMBER = "1";
fmorp.OPERATESTATE = "1";
fmorp.OPERATEDDATE = fPro.CREATEDATE;
fmorp.CURRENTPROCESS = EnumGeter.ProcessType.maojie.GetHashCode().ToString();
fmorp.PRODUCESHIFTNAME = fPro.PRODUCESHIFTNAME;
fmorp.PRODUCESHIFTTCODE = fPro.PRODUCESHIFTTCODE;
fmorp.PRODUCELINE = fPro.PRODUCELINE;
fmorp.MODELSTATION = "1";
fmorp.CREATEDATE = startDt;
fmorp.UPDATEDATE = startDt;
#endregion
#region 加工参数
RivetingPatameter rp = new RivetingPatameter();
rp.PID = Guid.NewGuid().ToString();
rp.PDID = fPro.PID;
rp.PRODUCTCODE = fPro.PRODUCTCODE;
rp.MOID = fmorp.PID;
rp.PRODUCTTYPE = fmorp.PRODUCTTYPE;
rp.MACHINENAME = fPro.MACHINENAME;
rp.MACHINECODDE = fPro.MACHINECODDE;
rp.PSTATUE = fPro.STATUS;
rp.CREATEDATE = startDt;
#endregion
#endregion
#region HUD风道
#region HUD风道信息
if (hudBasicValue == 1)
{
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 = startDt;
hPro.UPDATEDATE = startDt;
#region HUD风道信息
#region 加工记录
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 = startDt;
hmo.UPDATEDATE = startDt;
#endregion
hPara = new InJectionParameter();
hPara.PID = Guid.NewGuid().ToString();
hPara.MOID = hmo.PID;
hPara.PDID = hPro.PID;
hPara.CREATEDATE = System.DateTime.Now;
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 = startDt;
hi.UPDATEDATE = startDt;
#endregion
}
#endregion
#endregion
#region 浇注
#region 本体表
Main main = new Main();
main.PID = Guid.NewGuid().ToString();
main.SKELETONCODE = gPro.PRODUCTCODE;
main.SKID = gPro.PID;
main.EPIDERMISCODE = slushPro.PRODUCTCODE;
main.EID = slushPro.PID;
main.HB = proAttr.VAL3;
main.COLOR = proAttr.VAL4;
main.MACHINECODDE = "";
main.PROCESSSTATE = "1";
main.STATUS = "0";
main.CURRENTPROCESS = "16";
main.COMPLETEFLAG = "1";
main.PRODUCELINE = "B9";
main.PRODUCESHIFTNAME = "";
main.PRODUCESHIFTTCODE = "";
main.OUTFLAG = "1";
main.SPID = "";
main.SENDCODE = "";
main.COMPLETETIME = startDt;
main.CREATEDATE = startDt;
main.UPDATEDATE = startDt;
#endregion
#region 加工记录
MainOperation castbmo = new MainOperation();
castbmo.PID = Guid.NewGuid().ToString();
castbmo.PDID = main.PID;
castbmo.PRODUCTCODE = slushPro.PRODUCTCODE;
castbmo.PROCESSTYPE = EnumGeter.ProcessType.jiaozhu.GetHashCode().ToString();
castbmo.PRODUCTTYPE = EnumGeter.ProductType.benti.GetHashCode().ToString();
castbmo.MACHINENAME = slushPro.MACHINENAME;
castbmo.MACHINECODDE = slushPro.MACHINECODDE;
castbmo.STATUS = slushPro.STATUS;
castbmo.MOLDNUMBER = "1";
castbmo.OPERATESTATE = "1";
castbmo.OPERATEDDATE = slushPro.CREATEDATE;
castbmo.CURRENTPROCESS = EnumGeter.ProcessType.jiaozhu.GetHashCode().ToString();
castbmo.PRODUCESHIFTNAME = slushPro.PRODUCESHIFTNAME;
castbmo.PRODUCESHIFTTCODE = slushPro.PRODUCESHIFTTCODE;
castbmo.PRODUCELINE = slushPro.PRODUCELINE;
castbmo.MODELSTATION = "1";
castbmo.CREATEDATE = startDt;
castbmo.UPDATEDATE = startDt;
#endregion
#region 本体与表皮关联
MainProduct mainSlush = new MainProduct();
mainSlush.PID = Guid.NewGuid().ToString();
mainSlush.MID = main.PID;
mainSlush.PDID = slushPro.PID;
mainSlush.COUNT = 1;
mainSlush.MOID = castbmo.PID;
mainSlush.UPDATEDATE = startDt;
mainSlush.CREATEDATE = startDt;
#endregion
#region 本体与骨架关联
MainProduct mainG = new MainProduct();
mainG.PID = Guid.NewGuid().ToString();
mainG.MID = main.PID;
mainG.PDID = gPro.PID;
mainG.COUNT = 1;
mainG.MOID = castbmo.PID;
mainG.UPDATEDATE = startDt;
mainG.CREATEDATE = startDt;
#endregion
#region 加工参数
CastingParameter cp = new CastingParameter();
cp.PID = Guid.NewGuid().ToString();
cp.MID = main.PID;
cp.MAINCODE = slushPro.PRODUCTCODE;
cp.PDID = slushPro.PID;
cp.PRODUCTCODE = slushPro.PRODUCTCODE;
cp.MOID = castbmo.PID;
cp.PRODUCTTYPE = EnumGeter.ProductType.benti.GetHashCode().ToString();
cp.MACHINENAME = slushPro.MACHINENAME;
cp.MACHINECODDE = slushPro.MACHINECODDE;
cp.FLOW = 1;
cp.STRESSPERCENT = 1;
cp.METARIALTEMPRATURE = 1;
cp.CREATEDATE = startDt;
CastingParameterDAL cpdal = new CastingParameterDAL();
#endregion
#endregion
#region 红外扫描
#region 加工记录
MainOperation hsOp = new MainOperation();
hsOp.PID = Guid.NewGuid().ToString();
hsOp.PDID = main.PID;
hsOp.PRODUCTCODE = slushPro.PRODUCTCODE;
hsOp.PROCESSTYPE = EnumGeter.ProcessType.hongwaisaomiao.GetHashCode().ToString();
hsOp.PRODUCTTYPE = EnumGeter.ProductType.benti.GetHashCode().ToString();
hsOp.MACHINENAME = slushPro.MACHINENAME;
hsOp.MACHINECODDE = slushPro.MACHINECODDE;
hsOp.STATUS = slushPro.STATUS;
hsOp.MOLDNUMBER = "1";
hsOp.OPERATESTATE = "1";
hsOp.OPERATEDDATE = slushPro.CREATEDATE;
hsOp.CURRENTPROCESS = EnumGeter.ProcessType.hongwaisaomiao.GetHashCode().ToString();
hsOp.PRODUCESHIFTNAME = slushPro.PRODUCESHIFTNAME;
hsOp.PRODUCESHIFTTCODE = slushPro.PRODUCESHIFTTCODE;
hsOp.PRODUCELINE = slushPro.PRODUCELINE;
hsOp.MODELSTATION = "1";
hsOp.CREATEDATE = startDt;
hsOp.UPDATEDATE = startDt;
#endregion
#region 加工参数
HostcanPatameter htp = new HostcanPatameter();
htp.PID = Guid.NewGuid().ToString();
htp.MID = main.PID;
htp.MAINCODE = slushPro.PRODUCTCODE;
htp.PDID = slushPro.PID;
htp.PRODUCTCODE = slushPro.PRODUCTCODE;
htp.MOID = hsOp.PID;
htp.PRODUCTTYPE = EnumGeter.ProductType.benti.GetHashCode().ToString();
htp.MACHINENAME = slushPro.MACHINENAME;
htp.MACHINECODDE = slushPro.MACHINECODDE;
htp.CREATEDATE = startDt;
#endregion
#endregion
#region 冲切
#region 加工记录
MainOperation cqOp = new MainOperation();
cqOp.PID = Guid.NewGuid().ToString();
cqOp.PDID = main.PID;
cqOp.PRODUCTCODE = slushPro.PRODUCTCODE;
cqOp.PROCESSTYPE = EnumGeter.ProcessType.chongqie.GetHashCode().ToString();
cqOp.PRODUCTTYPE = EnumGeter.ProductType.benti.GetHashCode().ToString();
cqOp.MACHINENAME = slushPro.MACHINENAME;
cqOp.MACHINECODDE = slushPro.MACHINECODDE;
cqOp.STATUS = slushPro.STATUS;
cqOp.MOLDNUMBER = "1";
cqOp.OPERATESTATE = "1";
cqOp.OPERATEDDATE = slushPro.CREATEDATE;
cqOp.CURRENTPROCESS = EnumGeter.ProcessType.chongqie.GetHashCode().ToString();
cqOp.PRODUCESHIFTNAME = slushPro.PRODUCESHIFTNAME;
cqOp.PRODUCESHIFTTCODE = slushPro.PRODUCESHIFTTCODE;
cqOp.PRODUCELINE = slushPro.PRODUCELINE;
cqOp.MODELSTATION = "1";
cqOp.CREATEDATE = startDt;
cqOp.UPDATEDATE = startDt;
#endregion
#region 加工参数
PunchParameter cqp = new PunchParameter(); ;
cqp.PID = Guid.NewGuid().ToString();
cqp.MID = main.PID;
cqp.MAINCODE = slushPro.PRODUCTCODE;
cqp.PDID = slushPro.PID;
cqp.PRODUCTCODE = slushPro.PRODUCTCODE;
cqp.MOID = cqOp.PID;
cqp.PRODUCTTYPE = EnumGeter.ProductType.benti.GetHashCode().ToString();
cqp.MACHINENAME = slushPro.MACHINENAME;
cqp.MACHINECODDE = slushPro.MACHINECODDE;
cqp.CREATEDATE = startDt;
cqp.EOILSTRESS = 1;
cqp.HB = proAttr.VAL3;
cqp.PSTATUE = "1";
#endregion
#endregion
#region 铣削
#region 加工记录
MainOperation xOp = new MainOperation();
xOp.PID = Guid.NewGuid().ToString();
xOp.PDID = main.PID;
xOp.PRODUCTCODE = slushPro.PRODUCTCODE;
xOp.PROCESSTYPE = EnumGeter.ProcessType.xixiao.GetHashCode().ToString();
xOp.PRODUCTTYPE = EnumGeter.ProductType.benti.GetHashCode().ToString();
xOp.MACHINENAME = slushPro.MACHINENAME;
xOp.MACHINECODDE = slushPro.MACHINECODDE;
xOp.STATUS = slushPro.STATUS;
xOp.MOLDNUMBER = "1";
xOp.OPERATESTATE = "1";
xOp.OPERATEDDATE = slushPro.CREATEDATE;
xOp.CURRENTPROCESS = EnumGeter.ProcessType.xixiao.GetHashCode().ToString();
xOp.PRODUCESHIFTNAME = slushPro.PRODUCESHIFTNAME;
xOp.PRODUCESHIFTTCODE = slushPro.PRODUCESHIFTTCODE;
xOp.PRODUCELINE = slushPro.PRODUCELINE;
xOp.MODELSTATION = "1";
xOp.CREATEDATE = startDt;
xOp.UPDATEDATE = startDt;
#endregion
#region 加工参数
MilingParameter mip = new MilingParameter();
mip.PID = Guid.NewGuid().ToString();
mip.MID = main.PID;
mip.MAINCODE = slushPro.PRODUCTCODE;
mip.PDID = slushPro.PID;
mip.PRODUCTCODE = slushPro.PRODUCTCODE;
mip.MOID = xOp.PID;
mip.PRODUCTTYPE = EnumGeter.ProductType.benti.GetHashCode().ToString();
mip.MACHINENAME = slushPro.MACHINENAME;
mip.MACHINECODDE = slushPro.MACHINECODDE;
mip.CREATEDATE = startDt;
mip.HB = proAttr.VAL3;
mip.PSTATUE = "1";
#endregion
#endregion
#region 本体铆接
#region 加工记录
MainOperation mjOp = new MainOperation();
mjOp.PID = Guid.NewGuid().ToString();
mjOp.PDID = main.PID;
mjOp.PRODUCTCODE = slushPro.PRODUCTCODE;
mjOp.PROCESSTYPE = EnumGeter.ProcessType.maojie.GetHashCode().ToString();
mjOp.PRODUCTTYPE = EnumGeter.ProductType.benti.GetHashCode().ToString();
mjOp.MACHINENAME = slushPro.MACHINENAME;
mjOp.MACHINECODDE = slushPro.MACHINECODDE;
mjOp.STATUS = slushPro.STATUS;
mjOp.MOLDNUMBER = "1";
mjOp.OPERATESTATE = "1";
mjOp.OPERATEDDATE = slushPro.CREATEDATE;
mjOp.CURRENTPROCESS = EnumGeter.ProcessType.maojie.GetHashCode().ToString();
mjOp.PRODUCESHIFTNAME = slushPro.PRODUCESHIFTNAME;
mjOp.PRODUCESHIFTTCODE = slushPro.PRODUCESHIFTTCODE;
mjOp.PRODUCELINE = slushPro.PRODUCELINE;
mjOp.MODELSTATION = "1";
mjOp.CREATEDATE = startDt;
mjOp.UPDATEDATE = startDt;
#endregion
#region 加工参数
RivetingPatameter brp = new RivetingPatameter();
brp.PID = Guid.NewGuid().ToString();
brp.PDID = main.PID;
brp.PRODUCTCODE = slushPro.PRODUCTCODE;
brp.MOID = mjOp.PID;
brp.PRODUCTTYPE = fmorp.PRODUCTTYPE;
brp.MACHINENAME = fPro.MACHINENAME;
brp.MACHINECODDE = fPro.MACHINECODDE;
brp.PSTATUE = fPro.STATUS;
brp.CREATEDATE = startDt;
#endregion
#endregion
#region 超声波焊接
#region 加工记录
MainOperation csbOp = new MainOperation();
csbOp.PID = Guid.NewGuid().ToString();
csbOp.PDID = main.PID;
csbOp.PRODUCTCODE = slushPro.PRODUCTCODE;
csbOp.PROCESSTYPE = EnumGeter.ProcessType.chaoshengbohanjie.GetHashCode().ToString();
csbOp.PRODUCTTYPE = EnumGeter.ProductType.benti.GetHashCode().ToString();
csbOp.MACHINENAME = slushPro.MACHINENAME;
csbOp.MACHINECODDE = slushPro.MACHINECODDE;
csbOp.STATUS = slushPro.STATUS;
csbOp.MOLDNUMBER = "1";
csbOp.OPERATESTATE = "1";
csbOp.OPERATEDDATE = slushPro.CREATEDATE;
csbOp.CURRENTPROCESS = EnumGeter.ProcessType.chaoshengbohanjie.GetHashCode().ToString();
csbOp.PRODUCESHIFTNAME = slushPro.PRODUCESHIFTNAME;
csbOp.PRODUCESHIFTTCODE = slushPro.PRODUCESHIFTTCODE;
csbOp.PRODUCELINE = slushPro.PRODUCELINE;
csbOp.MODELSTATION = "1";
csbOp.CREATEDATE = startDt;
csbOp.UPDATEDATE = startDt;
#endregion
#region 加工参数
UltrasParameter ult = new UltrasParameter();
ult.PID = Guid.NewGuid().ToString();
ult.MID = main.PID;
ult.MAINCODE = slushPro.PRODUCTCODE;
ult.PDID = slushPro.PID;
ult.PRODUCTCODE = slushPro.PRODUCTCODE;
ult.MOID = csbOp.PID;
ult.PRODUCTTYPE = EnumGeter.ProductType.benti.GetHashCode().ToString();
ult.MACHINENAME = slushPro.MACHINENAME;
ult.MACHINECODDE = slushPro.MACHINECODDE;
ult.CREATEDATE = startDt;
ult.STRESS = 1;
ult.DISTANCE = 1;
ult.DEEPEN = 1;
#endregion
#region 本体与中控支架关联
MainProduct mainZk = new MainProduct();
mainZk.PID = Guid.NewGuid().ToString();
mainZk.MID = main.PID;
mainZk.PDID = zPro.PID;
mainZk.COUNT = 1;
mainZk.MOID = ult.PID;
mainZk.UPDATEDATE = startDt;
mainZk.CREATEDATE = startDt;
#endregion
#region 本体与开关支架关联
MainProduct mainKg = new MainProduct();
mainKg.PID = Guid.NewGuid().ToString();
mainKg.MID = main.PID;
mainKg.PDID = kPro.PID;
mainKg.COUNT = 1;
mainKg.MOID = ult.PID;
mainKg.UPDATEDATE = startDt;
mainKg.CREATEDATE = startDt;
#endregion
#endregion
#region 红外焊接
#region 加工记录
MainOperation hwOp = new MainOperation();
hwOp.PID = Guid.NewGuid().ToString();
hwOp.PDID = main.PID;
hwOp.PRODUCTCODE = slushPro.PRODUCTCODE;
hwOp.PROCESSTYPE = EnumGeter.ProcessType.hongwaihanjie.GetHashCode().ToString();
hwOp.PRODUCTTYPE = EnumGeter.ProductType.benti.GetHashCode().ToString();
hwOp.MACHINENAME = slushPro.MACHINENAME;
hwOp.MACHINECODDE = slushPro.MACHINECODDE;
hwOp.STATUS = slushPro.STATUS;
hwOp.MOLDNUMBER = "1";
hwOp.OPERATESTATE = "1";
hwOp.OPERATEDDATE = slushPro.CREATEDATE;
hwOp.CURRENTPROCESS = EnumGeter.ProcessType.hongwaihanjie.GetHashCode().ToString();
hwOp.PRODUCESHIFTNAME = slushPro.PRODUCESHIFTNAME;
hwOp.PRODUCESHIFTTCODE = slushPro.PRODUCESHIFTTCODE;
hwOp.PRODUCELINE = slushPro.PRODUCELINE;
hwOp.MODELSTATION = "1";
hwOp.CREATEDATE = startDt;
hwOp.UPDATEDATE = startDt;
#endregion
#region 加工参数
HotweldParameter hwp = new HotweldParameter();
hwp.PID = Guid.NewGuid().ToString();
hwp.MID = main.PID;
hwp.MAINCODE = slushPro.PRODUCTCODE;
hwp.PDID = slushPro.PID;
hwp.PRODUCTCODE = slushPro.PRODUCTCODE;
hwp.MOID = hwOp.PID;
hwp.PRODUCTTYPE = EnumGeter.ProductType.benti.GetHashCode().ToString();
hwp.MACHINENAME = slushPro.MACHINENAME;
hwp.MACHINECODDE = slushPro.MACHINECODDE;
hwp.CREATEDATE = startDt;
#endregion
#region 本体与气囊支架关联
MainProduct mainq = new MainProduct();
mainq.PID = Guid.NewGuid().ToString();
mainq.MID = main.PID;
mainq.PDID = qPro.PID;
mainq.COUNT = 1;
mainq.MOID = hwOp.PID;
mainq.UPDATEDATE = startDt;
mainq.CREATEDATE = startDt;
#endregion
#region 本体与风道关联
MainProduct mainf = new MainProduct();
mainf.PID = Guid.NewGuid().ToString();
mainf.MID = main.PID;
mainf.PDID = fPro.PID;
mainf.COUNT = 1;
mainf.MOID = hwOp.PID;
mainf.UPDATEDATE = startDt;
mainf.CREATEDATE = startDt;
#endregion
#endregion
#region 总成装配
#region 加工记录
MainOperation zcOp = new MainOperation();
zcOp.PID = Guid.NewGuid().ToString();
zcOp.PDID = main.PID;
zcOp.PRODUCTCODE = slushPro.PRODUCTCODE;
zcOp.PROCESSTYPE = EnumGeter.ProcessType.zongchengzhuangpei.GetHashCode().ToString();
zcOp.PRODUCTTYPE = EnumGeter.ProductType.benti.GetHashCode().ToString();
zcOp.MACHINENAME = slushPro.MACHINENAME;
zcOp.MACHINECODDE = slushPro.MACHINECODDE;
zcOp.STATUS = slushPro.STATUS;
zcOp.MOLDNUMBER = "1";
zcOp.OPERATESTATE = "1";
zcOp.OPERATEDDATE = slushPro.CREATEDATE;
zcOp.CURRENTPROCESS = EnumGeter.ProcessType.zongchengzhuangpei.GetHashCode().ToString();
zcOp.PRODUCESHIFTNAME = slushPro.PRODUCESHIFTNAME;
zcOp.PRODUCESHIFTTCODE = slushPro.PRODUCESHIFTTCODE;
zcOp.PRODUCELINE = slushPro.PRODUCELINE;
zcOp.MODELSTATION = "1";
zcOp.CREATEDATE = startDt;
zcOp.UPDATEDATE = startDt;
#endregion
#region 加工参数
AssembleParameter asp = new AssembleParameter();
asp.PID = Guid.NewGuid().ToString();
asp.MID = main.PID;
asp.MAINCODE = slushPro.PRODUCTCODE;
asp.PDID = slushPro.PID;
asp.PRODUCTCODE = slushPro.PRODUCTCODE;
asp.MOID = zcOp.PID;
asp.PRODUCTTYPE = EnumGeter.ProductType.benti.GetHashCode().ToString();
asp.MACHINENAME = slushPro.MACHINENAME;
asp.MACHINECODDE = slushPro.MACHINECODDE;
asp.CREATEDATE = startDt;
#region 本体与HUD风道关联
if (hudBasicValue == 1)
{
huq = new MainProduct();
huq.PID = Guid.NewGuid().ToString();
huq.MID = main.PID;
huq.PDID = hPro.PID;
huq.COUNT = 1;
huq.MOID = zcOp.PID;
huq.UPDATEDATE = startDt;
huq.CREATEDATE = startDt;
}
#endregion
#region 本体与格栅关联
MainProduct gsq = new MainProduct();
gsq.PID = Guid.NewGuid().ToString();
gsq.MID = main.PID;
gsq.PDID = gsPro.PID;
gsq.COUNT = 1;
gsq.MOID = zcOp.PID;
gsq.UPDATEDATE = startDt;
gsq.CREATEDATE = startDt;
#endregion
#endregion
#endregion
using (IDataSession session = AppDataFactory.CreateMainSession())
{
session.OpenTs();
#region 表皮
session.Insert<Product>(slushPro);
session.Insert<MainOperation>(bmo);
session.Insert<SlushParamter>(spara);
session.Insert<ProductAttribute>(proAttr);
session.Insert<ProductInjection>(pi);
#endregion
#region 冷刀弱化
session.Insert<MainOperation>(bmowe);
session.Insert<BurnParameter>(burn);
#endregion
#region 预热
session.Insert<MainOperation>(bmohe);
session.Insert<PreheatParameter>(pre);
#endregion
#region 骨架
session.Insert<Product>(gPro);
session.Insert<MainOperation>(gmo);
session.Insert<InJectionParameter>(gjPara);
session.Insert<ProductInjection>(gi);
session.Insert<ProductInjection>(gii);
#endregion
#region 气囊支架
session.Insert<Product>(qPro);
session.Insert<MainOperation>(qmo);
session.Insert<InJectionParameter>(qPara);
session.Insert<ProductInjection>(qi);
#endregion
#region 开关支架
if (count == 0)
{
session.Insert<Product>(kPro);
session.Insert<MainOperation>(kmo);
session.Insert<ProductInjection>(ki);
}
#endregion
#region 中控支架
if (count == 0)
{
session.Insert<Product>(zPro);
}
#endregion
#region 格栅
if (count == 0)
{
session.Insert<Product>(gsPro);
}
#endregion
#region 风道
session.Insert<Product>(fPro);
session.Insert<MainOperation>(fmo);
session.Insert<InJectionParameter>(fPara);
session.Insert<ProductInjection>(fi);
#endregion
#region 风道铆接
session.Insert<MainOperation>(fmorp);
session.Insert<RivetingPatameter>(rp);
#endregion
#region HUDfengdao
if (hudBasicValue == 1)
{
session.Insert<Product>(hPro);
session.Insert<MainOperation>(hmo);
session.Insert<InJectionParameter>(hPara);
session.Insert<ProductInjection>(hi);
}
#endregion
#region 浇注
session.Insert<Main>(main);
session.Insert<MainOperation>(castbmo);
session.Insert<MainProduct>(mainSlush);
session.Insert<MainProduct>(mainG);
session.Insert<CastingParameter>(cp);
#endregion
#region 红外扫描
session.Insert<MainOperation>(hsOp);
session.Insert<HostcanPatameter>(htp);
#endregion
#region 冲切
session.Insert<MainOperation>(cqOp);
session.Insert<PunchParameter>(cqp);
#endregion
#region 铣削
session.Insert<MainOperation>(xOp);
session.Insert<MilingParameter>(mip);
#endregion
#region 本体铆接
session.Insert<MainOperation>(mjOp);
session.Insert<RivetingPatameter>(brp);
#endregion
#region 超声波焊接
session.Insert<MainOperation>(csbOp);
session.Insert<UltrasParameter>(ult);
session.Insert<MainProduct>(mainZk);
session.Insert<MainProduct>(mainKg);
#endregion
#region 红外焊接
session.Insert<MainOperation>(hwOp);
session.Insert<HotweldParameter>(hwp);
session.Insert<MainProduct>(mainq);
session.Insert<MainProduct>(mainf);
#endregion
#region 总成装配
if (hudBasicValue == 1)
{
session.Insert<MainOperation>(zcOp);
session.Insert<AssembleParameter>(asp);
session.Insert<MainProduct>(huq);
session.Insert<MainProduct>(gsq);
}
#endregion
session.CommitTs();
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
continue;
}
startDt = startDt.AddSeconds(143);
count++;
GC.Collect();
}
}
catch (Exception ex)
{
Console.Write(ex.Message);
}
}
}
}