/// <summary> /// 通过条码查询相对应的产品信息 /// </summary> /// <param name="context"></param> /// <returns></returns> private string Create(HttpContext context) { try { string _EqID = context.Request["EqID"].Trim(); string _BARCODE = context.Request["BARCODE"].Trim(); string _LNO = context.Request["LNO"].Trim(); string _Storehouse = context.Request["Storehouse"].Trim(); string _LOGINNAM = context.Request["LOGINNAM"].Trim(); string _ENAM = context.Request["ENAM"].Trim(); string _FAC = context.Request["FAC"].Trim(); //限制只能扫描镂空条码 if (_BARCODE.Length != 11) { return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("444", "请扫描镂空硫化条码!"))); } //软控货架验证 /*string mess = new MESNACMESDal().GetShelfInfo(_BARCODE); * if (!string.IsNullOrWhiteSpace(mess)) * { * return JsonHelper<Messaging<string>>.EntityToJson(new Messaging<string>("444", mess)); * }*/ //验证软控报警胎 string _alarm = new LogisticsLaunchVerificationDal().ALARM(_BARCODE); if (!string.IsNullOrWhiteSpace(_alarm)) { return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("444", _alarm))); } //MES综合验证 string strMes = dal.GetScanShelfChecking(_LNO, _BARCODE, _LOGINNAM, _FAC, _ENAM, _Storehouse); if (!string.IsNullOrEmpty(strMes)) { return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("444", strMes))); } //如果多个货架为空优先使用最新的 string newLNO = dal.GetNewestLnoNum(_EqID.Trim()); if (!string.IsNullOrWhiteSpace(newLNO)) { _LNO = newLNO; } QMB0101 qmb0101 = new QMB0101Dal().GetByModel(_BARCODE); STC0009 stc0009 = dal.GetBySTC0009Model(qmb0101.ITNBR, _EqID, _level); //同一个规格默认装载一个货笼 if (!string.IsNullOrWhiteSpace(stc0009.LNO)) { _LNO = stc0009.LNO; } else { string derLno = dal.GetFirstCargoASC(_EqID); if (!string.IsNullOrEmpty(derLno)) { _LNO = derLno; } } STC0009 stc9 = new STC0009 { BARCODE = qmb0101.BARCODE, DBRES = qmb0101.DBRES, Grade = qmb0101.QCSTATE, ITDSC = qmb0101.ITDSC, ITNBR = qmb0101.ITNBR, LEVEL = _level, LNO = _LNO, LOGINNAM = _LOGINNAM, Storehouse = _Storehouse, TyreNo = qmb0101.TYRENO, EQUIPID = _EqID }; if (dal.Create(stc9)) { dal.DeleteCage(stc9.LNO, stc9.EQUIPID, _level); return(JsonHelper <Messaging <STC0009> > .EntityToJson(new Messaging <STC0009>("0", xml.ReadLandXml("0"), dal.GetDataList(stc9.LNO, stc9.EQUIPID, _level)))); } else { return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("2", "轮胎上架货笼失败!"))); } } catch (Exception ex) { SystemErrorPlug.ErrorRecord(ex.ToString()); return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("500", ex.Message.ToString().Trim().Replace("\r\n", "")))); } }
/// <summary> /// 通过条码查询相对应的产品信息 /// </summary> /// <param name="context"></param> /// <returns></returns> private string Create(HttpContext context) { try { string _barcode = context.Request["BARCODE"] as string; string _LNO = context.Request["LNO"] as string; string _Storehouse = context.Request["Storehouse"] as string; string _LOGINNAM = context.Request["LOGINNAM"] as string; string _ENAM = context.Request["ENAM"] as string; string _BARCODE = _barcode.Trim(); string LNO = _LNO.Trim(); string Storehouse = _Storehouse.Trim(); string LOGINNAM = _LOGINNAM.Trim(); string ENAM = _ENAM.Trim(); WIP0010 model = new WIP0010Dal().GetEntityById(_BARCODE); if (string.IsNullOrEmpty(model.BARCODE)) { //扫描异常轮胎报警 //dal.CallPolice(_BARCODE, ENAM, LOGINNAM, Storehouse); return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("2", "该条码信息的轮胎不在车间库存中!"))); } if (dal.CheckSTC0017BarCode(model.BARCODE.Trim()) > 0) { return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("2", "该条码已经扫描上架!"))); } if (dal.CheckUpCage17(LNO) > 0) { return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("2", "货笼已经使用!"))); } if (model.LOCKYN == "Y") { return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("2", "该条码信息的轮胎在库存中已经锁定!"))); } if (model.STA != "1") { return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("2", "该条码信息的轮胎在库存中处于、不良、保留或者报废状态!"))); } QMB0101 qmb0101 = new QMB0101Dal().GetByModel(model.BARCODE); if (qmb0101.QCSTATE.Trim() == "1") { return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("2", "该条码信息的轮胎是合格品,无法上架操作!"))); } int barCodeCount = dal.GetBarCodeCount(model.BARCODE); if (barCodeCount > 0) { STC0009 stc09 = dal.GetBySTC0009(model.BARCODE, LOGINNAM, _level); return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("2", "该条码信息的轮胎已经在[" + stc09.LNO + "]货架上!"))); } int count = dal.GetCount(LNO, model.ITNBR, "", _level); int num = dal.GetCargoCageQuantity(model.ITNBR); if (0 != num) { if (count > num) { return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("2", "该货笼已经达到最大装胎数量,无法在装笼操作!"))); } } else { num = 30; if ("03" == model.FAC || "01" == model.FAC) { num = 9; } if (count > num) { return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("2", "该货笼已经达到最大装胎数量,无法在装笼操作!"))); } } STC0009 stc9 = new STC0009 { BARCODE = model.BARCODE, DBRES = qmb0101.DBRES, Grade = qmb0101.QCSTATE, ITDSC = model.ITDSC, ITNBR = model.ITNBR, LEVEL = _level, LNO = LNO, LOGINNAM = LOGINNAM, Storehouse = Storehouse, TyreNo = qmb0101.TYRENO, QRCode = "", RfidCode = "" }; if (dal.Create(stc9)) { dal.DeleteCage(stc9.LNO, stc9.LOGINNAM, _level); return(JsonHelper <Messaging <STC0009> > .EntityToJson(new Messaging <STC0009>("0", xml.ReadLandXml("0"), dal.GetDataList(LNO, LOGINNAM, _level)))); } else { return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("2", "轮胎上架货笼失败!"))); } } catch (Exception ex) { SystemErrorPlug.ErrorRecord(ex.ToString()); return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("500", ex.Message.ToString().Trim().Replace("\r\n", "")))); } }