public override string ParsePalletID(string palletID) { //throw new NotImplementedException(); if (string.IsNullOrWhiteSpace(palletID)) { return(string.Empty); } if (palletID.Length < 12) { return(string.Empty); } string re = ""; JObject jsonObj = new JObject(new JProperty("电芯型号", ""), new JProperty("料筐内衬类型", ""), new JProperty("料筐内衬PLC值", ""), new JProperty("分容库区", "")); string batteryCata = palletID.Substring(0, 4); jsonObj["电芯型号"] = batteryCata; MesDBAccess.BLL.BatteryCataBll batCataBll = new MesDBAccess.BLL.BatteryCataBll(); MesDBAccess.Model.BatteryCataModel batCataModel = batCataBll.GetModel(batteryCata); if (batCataModel == null) { return(string.Empty); } MesDBAccess.BLL.PalletCataBll palletCataBll = new MesDBAccess.BLL.PalletCataBll(); MesDBAccess.Model.PalletCataModel palletCataModel = palletCataBll.GetModel(batCataModel.palletCataID); if (palletCataModel == null) { return(string.Empty); } jsonObj["料筐内衬类型"] = batCataModel.palletCataID; jsonObj["料筐内衬PLC值"] = palletCataModel.plcDefVal; jsonObj["分容库区"] = batCataModel.fenrongZone; re = jsonObj.ToString(); return(re); }
private void RefreshDevCfg() { MesDBAccess.BLL.BatteryCataBll batCataBll = new MesDBAccess.BLL.BatteryCataBll(); List <string> batCatas = GetBatteryCataList(); this.comboBox4.Items.Clear(); if (batCatas.Count > 0) { this.comboBox4.Items.AddRange(batCatas.ToArray()); } if (this.comboBox4.Items.Count > 0) { this.comboBox4.SelectedIndex = 0; } MesDBAccess.BLL.ViewDevLineBatteryCfgBll devLineCfgBll = new MesDBAccess.BLL.ViewDevLineBatteryCfgBll(); string strWhere = ""; if (comboBox3.Text != "所有") { strWhere = string.Format("ShopSection='{0}' ", comboBox3.Text); } DataSet ds = devLineCfgBll.GetList(strWhere); this.dataGridView2.DataSource = ds.Tables[0]; this.dataGridView2.Columns["DevBatteryCfgID"].HeaderText = "产线配置ID"; this.dataGridView2.Columns["ShopSection"].HeaderText = "工段名称"; this.dataGridView2.Columns["LineID"].HeaderText = "产线序号"; this.dataGridView2.Columns["mark"].HeaderText = "描述"; this.dataGridView2.Columns["batteryCataCode"].HeaderText = "电芯型号"; this.dataGridView2.Columns["palletCataID"].HeaderText = "料筐型号"; this.dataGridView2.Columns["plcDefVal"].HeaderText = "PLC值"; this.dataGridView2.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells; this.dataGridView2.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells; }
private void OnModifyBatteryCata() { string batteryCata = this.textBox2.Text; if (string.IsNullOrWhiteSpace(batteryCata)) { MessageBox.Show("电芯型号不能为空,请重新输入"); return; } try { MesDBAccess.BLL.BatteryCataBll batCatBll = new MesDBAccess.BLL.BatteryCataBll(); MesDBAccess.Model.BatteryCataModel batCataModel = batCatBll.GetModel(batteryCata); if (batCataModel == null) { MessageBox.Show(string.Format("电芯型号{0}不存在", batteryCata)); return; } batCataModel.palletCataID = this.comboBox6.Text; batCataModel.mark = this.textBox1.Text; if (batCatBll.Update(batCataModel)) { MessageBox.Show("修改成功!"); OnRefreshBatteryCata(); } else { MessageBox.Show("修改失败!"); } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
private void OnAddBatteryCata() { string batteryCata = this.textBox2.Text; if (string.IsNullOrWhiteSpace(batteryCata)) { MessageBox.Show("电芯型号不能为空,请重新输入"); return; } MesDBAccess.BLL.BatteryCataBll batCatBll = new MesDBAccess.BLL.BatteryCataBll(); if (batCatBll.Exists(batteryCata)) { MessageBox.Show(string.Format("电芯型号{0}已经存在", batteryCata)); return; } try { MesDBAccess.Model.BatteryCataModel batCataModel = new MesDBAccess.Model.BatteryCataModel(); batCataModel.batteryCataCode = batteryCata; batCataModel.palletCataID = this.comboBox6.Text; batCataModel.mark = this.textBox1.Text; batCatBll.Add(batCataModel); OnRefreshBatteryCata(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
private void OnRefreshBatteryCata() { MesDBAccess.BLL.PalletCataBll palletCataBll = new MesDBAccess.BLL.PalletCataBll(); List <MesDBAccess.Model.PalletCataModel> palletCatas = palletCataBll.GetModelList(""); this.comboBox6.Items.Clear(); foreach (MesDBAccess.Model.PalletCataModel m in palletCatas) { this.comboBox6.Items.Add(m.PalletCataID); } if (this.comboBox6.Items.Count > 0) { this.comboBox6.SelectedIndex = 0; } MesDBAccess.BLL.BatteryCataBll batCatBll = new MesDBAccess.BLL.BatteryCataBll(); DataSet ds = batCatBll.GetAllList(); this.dataGridView3.DataSource = ds.Tables[0]; this.dataGridView3.Columns["batteryCataCode"].HeaderText = "电芯型号"; this.dataGridView3.Columns["palletCataID"].HeaderText = "料筐型号"; this.dataGridView3.Columns["mark"].HeaderText = "备注"; this.dataGridView3.Columns["tag1"].Visible = false; this.dataGridView3.Columns["tag2"].Visible = false; this.dataGridView3.Columns["tag3"].Visible = false; this.dataGridView3.Columns["tag4"].Visible = false; this.dataGridView3.Columns["tag5"].Visible = false; this.dataGridView3.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells; this.dataGridView3.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells; }
private List <string> GetBatteryCataList() { MesDBAccess.BLL.BatteryCataBll batCataBll = new MesDBAccess.BLL.BatteryCataBll(); List <MesDBAccess.Model.BatteryCataModel> batCatas = batCataBll.GetModelList(""); List <string> batCataList = new List <string>(); foreach (MesDBAccess.Model.BatteryCataModel m in batCatas) { batCataList.Add(m.batteryCataCode); } return(batCataList); }
private void OnRefreshBatteryCata() { try { this.cbxBatteryCata.Items.Clear(); MesDBAccess.BLL.BatteryCataBll batteryCataBll = new MesDBAccess.BLL.BatteryCataBll(); List <MesDBAccess.Model.BatteryCataModel> batteryCatas = batteryCataBll.GetModelList(""); foreach (MesDBAccess.Model.BatteryCataModel m in batteryCatas) { this.cbxBatteryCata.Items.Add(m.batteryCataCode); } if (this.cbxBatteryCata.Items.Count > 0) { this.cbxBatteryCata.SelectedIndex = 0; } this.cbxBatteryCata.Items.Add("所有"); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } }
/// <summary> /// 是否组盘入库允许 /// </summary> /// <param name="port"></param> /// <param name="palletID"></param> /// <param name="reStr"></param> /// <returns></returns> private bool AsrsCheckinGroupEnabled(AsrsPortalModel port, string palletID, ref string reStr) { int step = 0; if (!port.MesAcc.GetStep(palletID, out step, ref reStr)) { Console.WriteLine("在组盘入库判断过程中,查询托盘步号失败,因为:" + reStr); return(false); } if (port.PortinBufCapacity < 2) { return(true); } else //只有入口最大允许缓存数量大于1时才考虑库区,批次 { if (port.PalletBuffer.Count() > 0) { //1 判断是否同一个库区 string lastPalletID = port.PalletBuffer[0]; string lastCata = lastPalletID.Substring(0, 4); string cata = palletID.Substring(0, 4); int lastStep = 0; if (!port.MesAcc.GetStep(lastPalletID, out lastStep, ref reStr)) { return(false); } string areaLast = port.AsrsCtl.GetAreaToCheckin(lastPalletID, lastStep).ToString(); // AsrsModel.EnumLogicArea.注液高温区.ToString(); // areaLast=SysCfg.SysCfgModel.asrsStepCfg.AsrsAreaSwitch(lastStep); string areaCur = port.AsrsCtl.GetAreaToCheckin(palletID, step).ToString(); //AsrsModel.EnumLogicArea.注液高温区.ToString(); ; // areaCur=SysCfg.SysCfgModel.asrsStepCfg.AsrsAreaSwitch(step); if (areaLast != areaCur) { reStr = string.Format("托盘{0}待进入的立库分区{1},跟当前缓存托盘待进入的分区{2}不同", palletID, areaCur, areaLast); return(false); } if (step > 0) { //2 是否同批 string batchLast = ""; string batch = ""; if (!port.MesAcc.GetTrayCellLotNO(palletID, out batch, ref reStr)) { return(false); } if (!port.MesAcc.GetTrayCellLotNO(lastPalletID, out batchLast, ref reStr)) { return(false); } if (batchLast != batch) { reStr = string.Format("托盘{0} 批次{1},与入口缓存的托盘{2} 批次{3}不同", palletID, batch, lastPalletID, batchLast); return(false); } ////3 是否同型号 //if (port.NodeID == "2011" || port.NodeID == "2015" || port.NodeID == "2019") //{ // if (lastCata != cata) // { // return false; // } //} } else { //空筐,只判断筐子类型 MesDBAccess.BLL.BatteryCataBll batteryCataBll = new MesDBAccess.BLL.BatteryCataBll(); MesDBAccess.Model.BatteryCataModel batCata = batteryCataBll.GetModel(cata); if (batCata == null) { reStr = "不存在的电池型号配置:" + cata; Console.Write(reStr); return(false); } if (batCata.palletCataID == "A筐") { if ((port.NodeID != "2013") && (port.NodeID != "2017")) { return(false); } } else if (batCata.palletCataID == "B筐") { if (port.NodeID != "2021") { return(false); } } else { reStr = "不存在的筐类型配置:" + batCata.palletCataID; return(false); } } return(true); } return(true); } }