public IResult DoWork(ILE.IJob job) { DispatchForm form = new DispatchForm(job.StationCode); form.ShowDialog(); string dispatching = form.Dispetching; string orderNO = form.OrderNO; IResult result = new LEResult(); if (dispatching == null) { result.Result = false; result.ExtMessage = "未选择"; } else { job.DispatchNO = dispatching; job.Product = form.Product; job.OrderNO = orderNO; result.Result = true; ServiceReference.ServiceClient client = new ServiceReference.ServiceClient(); ILE.LEResult res = new LEResult(); string ResProduct1 = client.RunServerAPI("BLL.Product", "GetProductFlow", job.OrderNO); res = JsonConvert.DeserializeObject <ILE.LEResult>(ResProduct1); V_ProductFlow produc1 = JsonConvert.DeserializeObject <V_ProductFlow>(res.obj.ToString()); string strRes1 = client.RunServerAPI("BLL.Process", "GetFlowDetailOK", produc1.flow_code + "," + job.ProcessCode); res = JsonConvert.DeserializeObject <ILE.LEResult>(strRes1); job.Pid = Convert.ToInt32(res.obj); job.StepList[job.StepIdx].Completed = true; } return(result); }
public IResult DoWork(ILE.IJob jobModel) { //DataTable dt = DB.Database.getDataTable("select * from s_employee"); //int i = dt.Rows.Count; //IResult res = new LEResult(); //res.Result = true; //res.ExtMessage = i.ToString(); return(null); }
public static int NextStep1(ILE.IJob job) { if (job.StepIdx - 1 == job.StepList.Count) { return(job.StepIdx);//最后工步 } for (int i = job.StepIdx + 1; i < job.StepList.Count; i++) { if (!job.StepList[i].Completed) { //job.StepIdx = i; return(i); // } } return(job.StepIdx - 1); }
public static ILE.IResult PrintBing(ILE.IJob job, ServiceReference.ServiceClient client, string val, IResult res) { //////////////////////////////////////////////////////// string product_code = job.Product; string ResultProduct = client.RunServerAPI("BLL.SSW", "GetProduct", product_code); B_Product productObj = JsonConvert.DeserializeObject <B_Product>(ResultProduct); string Print_bind = string.Empty; if (productObj != null) { Print_bind = productObj.print_bind.ToString(); } if (Print_bind == "1") { //根据工单号查询主工单 string order = job.OrderNO; string ResultMainOrder = client.RunServerAPI("BLL.SSW", "GetMainOrderByOrderNo", order); List <P_WorkOrder> workorder = JsonConvert.DeserializeObject <List <P_WorkOrder> >(ResultMainOrder); string Main_Order = workorder[0].main_order; //通过电池块批次查询主工单 string SFC = val.Replace("#", ""); string Result = client.RunServerAPI("BLL.Pack", "GetMainWorder", SFC); List <P_BarCodeBing> MainWork = JsonConvert.DeserializeObject <List <P_BarCodeBing> >(Result); if (MainWork != null) { string Main_Or = MainWork[0].main_order; string order_no = MainWork[0].order; if (Main_Order != Main_Or || order_no != order) { res.ExtMessage = "该批次不属于当前工单下的批次"; res.Result = false; return(res); } } else { res.ExtMessage = "该批次不存在于条码清单"; res.Result = false; return(res); } } //////////////////////////////////////////////////////// res.Result = true; return(res); }
public static ILE.IResult HandleJob(ILE.IJob job, string val) { string driveName = job.StepList[job.StepIdx].FileName; string path = System.IO.Directory.GetCurrentDirectory() + "\\DriveList\\" + driveName; IResult rec = new LEResult(); try { Assembly ass = Assembly.LoadFrom(path); Type type = ass.GetType(job.StepList[job.StepIdx].DriveCode + ".SPO"); //drive_code作为默认的驱动内命名空间 Object obj = Activator.CreateInstance(type); ISPO SpoObj = (ISPO)obj; if (val == null) //自动耗料 { rec = SpoObj.DoWork(job); } else { rec = SpoObj.DoWork(job, val); } } catch (Exception exp) { rec.Result = false; rec.ExtMessage = "加载工步驱动" + "[" + driveName + "]失败:" + exp.Message; return(rec); } ///如果当前被完成的STEP是关键步骤 if (rec.Result && job.Pid != 0 && job.StepList[job.StepIdx].KeyStep && !job.StepLoad) { return(Component.JobConstructor.FillJobStep(job)); } string i = rec.ExtMessage; return(rec); }
public IResult DoWork(ILE.IJob jobModel) { return(null); }
// public IResult DoWork(ILE.IJob job, string val) { return(null); }