public ActionResult InBin(LotTerminalViewModel model) { MethodReturnResult result = new MethodReturnResult(); try { InBinParameter p = new InBinParameter() { Creator = User.Identity.Name, OperateComputer = Request.UserHostAddress, Operator = User.Identity.Name, //ReasonCodeCategoryName = model.ReasonCodeCategoryName, //ReasonCodeName = model.ReasonCodeName, Remark = model.Description, ScanLotNumber = Request["LotNumber"].ToUpper(), ScanIP = "192.168.0.1", ScanNo = "192.168.0.1", LotNumbers = new List <string>() }; char splitChar = ','; //获取批次号值。 string[] lotNumbers = Request["LotNumber"].ToUpper().Split(splitChar); p.LotNumbers = lotNumbers.ToList(); for (int i = 0; i < p.LotNumbers.Count; i++) { string lotNumber = p.LotNumbers[i]; result = GetLot(lotNumber); if (result.Code > 0) { return(Json(result)); } } //终止批次。 //using (LotTerminalServiceClient client = new LotTerminalServiceClient()) //{ // result = client.Terminal(p); //} using (LotBinServiceClient client = new LotBinServiceClient()) { result = client.InBin(p); } if (result.Code == 0) { result.Message = string.Format("结束 {0} 成功。", model.LotNumber); } } catch (Exception ex) { result.Code = 1000; result.Message = ex.Message; result.Detail = ex.ToString(); } // 如果我们进行到这一步时某个地方出错,则重新显示表单 return(Json(result)); }
public ActionResult ChkBin(LotBinViewModel lotBinViewModel) { MethodReturnResult result = new MethodReturnResult(); try { InBinParameter p = new InBinParameter() { Creator = User.Identity.Name, OperateComputer = Request.UserHostAddress, Operator = User.Identity.Name, ScanLotNumber = lotBinViewModel.LotNumber, ScanIP = lotBinViewModel.ScanIP, ScanNo = lotBinViewModel.ScanNo,// LotNumbers = new List <string>() }; char splitChar = ','; //获取批次号值。 string[] lotNumbers = lotBinViewModel.LotNumber.ToUpper().Split(splitChar); p.LotNumbers = lotNumbers.ToList(); for (int i = 0; i < p.LotNumbers.Count; i++) { string lotNumber = p.LotNumbers[i]; //result = GetLot(lotNumber); if (result.Code > 0) { return(Json(result)); } } using (LotBinServiceClient client = new LotBinServiceClient()) { result = client.ChkBin(p); } result.Message = string.Format("批次{0}将入Bin{1}.原因{2}", lotBinViewModel.LotNumber, result.Detail, result.Message); } catch (Exception ex) { result.Code = 1000; result.Message = ex.Message; result.Detail = ex.ToString(); } // 如果我们进行到这一步时某个地方出错,则重新显示表单 return(Json(result)); }
public ActionResult Save(LotBinViewModel model) { MethodReturnResult result = new MethodReturnResult(); try { string IPAddress = model.ScanIP; string packalgeLine = string.Empty; if (localName == "K01") { MethodReturnResult <Equipment> resultEquipment = new MethodReturnResult <Equipment>(); using (EquipmentServiceClient client = new EquipmentServiceClient()) { resultEquipment = client.Get(IPAddress); if (resultEquipment.Code > 0) { result.Code = resultEquipment.Code; result.Message = resultEquipment.Message; return(Json(result)); } else { packalgeLine = resultEquipment.Data.LineCode; } } } if (localName == "G01") { packalgeLine = model.ScanIP; } InBinParameter p = new InBinParameter() { Creator = User.Identity.Name, OperateComputer = Request.UserHostAddress, Operator = User.Identity.Name, BinNo = model.BinNo, //ReasonCodeCategoryName = model.ReasonCodeCategoryName, //ReasonCodeName = model.ReasonCodeName, //Remark = model.Description, PackageLine = packalgeLine, ScanLotNumber = model.LotNumber, ScanIP = model.ScanIP, ScanNo = model.ScanNo,// LotNumbers = new List <string>() }; //char splitChar = ','; ////获取批次号值。 //string[] lotNumbers = Request["LotNumber"].ToUpper().Split(splitChar); //p.LotNumbers = lotNumbers.ToList(); //for (int i = 0; i < p.LotNumbers.Count; i++) //{ // string lotNumber = p.LotNumbers[i]; // //result = GetLot(lotNumber); // if (result.Code > 0) // { // return Json(result); // } //} using (LotBinServiceClient client = new LotBinServiceClient()) { result = client.InBin(p); } if (result.Code == 0) { result.Message = string.Format("批次{0}入Bin成功.{1}", model.LotNumber, result.Message); } } catch (Exception ex) { result.Code = 1000; result.Message = ex.Message; result.Detail = ex.ToString(); } // 如果我们进行到这一步时某个地方出错,则重新显示表单 return(Json(result)); }
/// <summary> /// /// </summary> /// <param name="lotNumber"></param> /// <returns></returns> public string GetLotPath(string lotNumber) { MethodReturnResult result1 = new MethodReturnResult(); IList <ColorTestData> corolValues = new List <ColorTestData>(); IList <BaseAttributeValue> lstValues = new List <BaseAttributeValue>(); using (ColorTestDataServiceClient client = new ColorTestDataServiceClient()) { PagingConfig cfg = new PagingConfig() { PageNo = 0, PageSize = 1, Where = string.Format("Key.LotNumber='{0}'", lotNumber) }; MethodReturnResult <IList <ColorTestData> > result = client.Get(ref cfg); if (result.Code <= 0 && result.Data != null) { corolValues = result.Data; } } if (corolValues.Count > 0) { foreach (ColorTestData item in corolValues) { if (item.InspctResult.Equals("NG品")) { //返回不良品图片地址名称 return("10.png"); } else { try { InBinParameter p = new InBinParameter() { ScanLotNumber = lotNumber }; using (LotBinServiceClient client = new LotBinServiceClient()) { result1 = client.PathCheck(p); } if (result1.Code < 1000) { //返回通过品图片地址名称 return("20.png"); } else { //返回档外品图片地址名称 return("30.png"); } } catch (Exception ex) { result1.Code = 1000; result1.Message = ex.Message; result1.Detail = ex.ToString(); //返回档外品图片地址名称 return("30.png"); } } } } else { //返回不良品图片地址名称 return("10.png"); } //返回档外品图片地址名称 return("30.png"); }