Example #1
0
        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());
            }
        }
Example #2
0
        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);
        }
Example #3
0
        /// <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);
            }
        }