Exemplo n.º 1
0
 public ArrayList GetPODLabelPathAndSite()
 {
    ArrayList arr = new ArrayList();
    string site = "";
    string path = "";
    CommonImpl2 cm2 = new CommonImpl2();
    site = cm2.GetSite();
    if (site == "ICC")
    { path = cm2.GetValueFromSysSetting("PODLabelPath"); }
    arr.Add(site);
    arr.Add(path);
    return arr;
 }
Exemplo n.º 2
0
 /// <summary>
 /// 取ModelBOM 中Model 直接下阶中有BomNodeType 为'P1' 的Part
 /// </summary>
 /// <param name="custSN">custSN</param>
 public string CheckBOM(string custSN)
 {
     string ret = "NotFind";
     try 
     {
         IProduct product = productRepository.GetProductByCustomSn(custSN);
         if (product == null)
         {
             return ret;
         }
         string model = product.Model;
         // 取ModelBOM 中Model 直接下阶中有BomNodeType 为'P1' 的Part
         IBOMRepository ibomRepository = RepositoryFactory.GetInstance().GetRepository<IMES.FisObject.Common.FisBOM.IBOMRepository>();
         IHierarchicalBOM sessionBOM = null;
         sessionBOM = ibomRepository.GetHierarchicalBOMByModel(product.Model);
         CommonImpl2 cm2 = new CommonImpl2();
         string site = cm2.GetSite();
         if (site == "ICC" && cm2.CheckIsWIN8(sessionBOM))
         {
             return ret;
         }
         IList<IBOMNode> bomNodeLst = new List<IBOMNode>();
         bomNodeLst = sessionBOM.FirstLevelNodes;
         if (bomNodeLst != null && bomNodeLst.Count > 0)
         {
             foreach (IBOMNode ibomnode in bomNodeLst)
             {
                 IPart currentPart = ibomnode.Part;
                 if (currentPart.BOMNodeType == "P1" && currentPart.Descr.IndexOf("COA") == 0)
                 {
                     return currentPart.PN;
                 }
             }
         }
         return ret;
     }
     catch (Exception ee)
     {
         throw ee;
     }
 }
Exemplo n.º 3
0
        /// <summary>
        /// 刷custSn,启动工作流,检查输入的custSn,卡站,获取ProductModel
        /// </summary>
        /// <param name="queryflag"></param>
        /// <param name="custSN"></param>
        /// <param name="line"></param>
        /// <param name="code"></param>
        /// <param name="floor"></param>
        /// <param name="editor"></param>
        /// <param name="station"></param>
        /// <param name="customer"></param>
        /// <returns></returns>
        public ArrayList InputSN(Boolean queryflag, string custSN, string line, string code, string floor,
                                                    string editor, string station, string customer)
        {
            logger.Debug("(PDPALabel01)InputSN start, custSn:" + custSN);
            CommonImpl2 cm2 = new CommonImpl2();
            string site = cm2.GetSite();
            try
            {
                var currentProduct = CommonImpl.GetProductByInput(custSN, CommonImpl.InputTypeEnum.CustSN);
                string sessionKey = currentProduct.ProId;
                Session currentSession = SessionManager.GetInstance.GetSession(sessionKey, SessionType);

                if (currentSession == null)
                {
                    currentSession = new Session(sessionKey, SessionType, editor, station, line, customer);

                    Dictionary<string, object> wfArguments = new Dictionary<string, object>();
                    wfArguments.Add("Key", sessionKey);
                    wfArguments.Add("Station", station);
                    wfArguments.Add("CurrentFlowSession", currentSession);
                    wfArguments.Add("Editor", editor);
                    wfArguments.Add("PdLine", line);
                    wfArguments.Add("Customer", customer);
                    wfArguments.Add("SessionType", SessionType);

                    //wfArguments.Add("Floor", floor);
                    //wfArguments.Add("Code", code);

                    string wfName, rlName;

                    string xmlname = "";
                    if (!queryflag)
                    {
                        if (site == "ICC")
                        { xmlname = "PDPALabel01_CQ.xoml"; }
                        else
                        { xmlname = "PDPALabel01.xoml"; }
                       
                    }
                    else
                    {
                        xmlname = "PDPALabel01Query.xoml";
                    }
                    RouteManagementUtils.GetWorkflow(station, xmlname, "", out wfName, out rlName);//PDPLabel01.rules
                    WorkflowInstance instance = WorkflowRuntimeManager.getInstance.CreateXomlFisWorkflow(wfName, rlName, wfArguments);
                    currentSession.AddValue("Site", site);
                    currentSession.AddValue(Session.SessionKeys.Floor, floor);
                    currentSession.AddValue(Session.SessionKeys.MBCode, code);
                    currentSession.AddValue(Session.SessionKeys.IsPalletChange, queryflag);

                    if (!queryflag)
                    {
                        currentSession.AddValue(Session.SessionKeys.IsComplete, false);

                    }
                    else
                    {
                        currentSession.AddValue(Session.SessionKeys.IsComplete, true);

                    }
                    currentSession.SetInstance(instance);

                    if (!SessionManager.GetInstance.AddSession(currentSession))
                    {
                        currentSession.WorkflowInstance.Terminate("Session:" + sessionKey + " Exists.");
                        FisException ex;
                        List<string> erpara = new List<string>();
                        erpara.Add(sessionKey);
                        ex = new FisException("CHK020", erpara);
                        throw ex;
                    }

                    currentSession.WorkflowInstance.Start();
                    currentSession.SetHostWaitOne();
                }
                else
                {
                    FisException ex;
                    List<string> erpara = new List<string>();
                    erpara.Add(sessionKey);
                    ex = new FisException("CHK020", erpara);
                    throw ex;
                }


                if (currentSession.Exception != null)
                {
                    if (currentSession.GetValue(Session.SessionKeys.WFTerminated) != null)
                    {
                        currentSession.ResumeWorkFlow();
                    }

                    throw currentSession.Exception;
                }

                //========================================================
                ArrayList retList = new ArrayList();
                Product curProduct = (Product)currentSession.GetValue(Session.SessionKeys.Product);
                ProductModel curModel = new ProductModel();
                IList<WipBufferDef> wipBufferList = (IList<WipBufferDef>)currentSession.GetValue("WipBuffer");

                /*IList<WipBuffer> wipBufferList = new List<WipBuffer>();
                for (int i = 1; i < 14; i++)
                {
                    WipBuffer item = new WipBuffer();
                    item.PartNo = "PartNo"+Convert.ToString(i);
                    item.Tp = "TP"+Convert.ToString(i);
                    item.Qty = i;
                    wipBufferList.Add(item);
                }
                */

                IPartRepository partRepository = RepositoryFactory.GetInstance().GetRepository<IPartRepository, IPart>();
                IList<ConstValueInfo> cvInfo = new List<ConstValueInfo>();

                //ConstValueInfo cvCond = new ConstValueInfo();
                //cvCond.type = "PD PA Label 1";
                ////cvCond.name = product.Status.Line.Substring(0, 1);
                //cvInfo = partRepository.GetConstValueInfoList(cvCond);

                string wlabel = (string)currentSession.GetValue("WLabel");
                string clabel = (string)currentSession.GetValue("LanguageLabel");
                string cmessage = (string)currentSession.GetValue("LanguageMessage");
                string llabel = (string)currentSession.GetValue("LANOMLabel");
                string win8label = (string)currentSession.GetValue("Win8BoxLabel");
                List<string> label = new List<string>();
                //foreach (ConstValueInfo tmp in cvInfo)
                //{
                //    label.Add((string)currentSession.GetValue(tmp.name.ToString()));
                //}
                //string postellabel = (string)currentSession.GetValue("India Safety label");

                curModel.ProductID = curProduct.ProId;
                curModel.CustSN = curProduct.CUSTSN;
                curModel.Model = curProduct.Model;
                retList.Add(curModel);
                retList.Add(wipBufferList);

                retList.Add(wlabel);
                retList.Add(clabel);
                retList.Add(cmessage);
                retList.Add(llabel);
                retList.Add(win8label);
                if (site == "ICC")
                { 
                   retList.Add((string)currentSession.GetValue("EnergyLabel")); 
                }

                if (currentSession.GetValue("PDPA1LabelType") == null)
                {
                    retList.Add(new List<string>());
                }
                else
                {
                    retList.Add((List<string>)(currentSession.GetValue("PDPA1LabelType")));
                }

                //retList.Add(postellabel);
                //========================================================
                return retList;

            }
            catch (FisException e)
            {
                logger.Error(e.mErrmsg, e);
                throw new Exception(e.mErrmsg);
            }
            catch (Exception e)
            {
                logger.Error(e.Message, e);
                throw new SystemException(e.Message);
            }
            finally
            {
                logger.Debug("(PDPALabel01)InputSN end, uutSn:" + custSN);
            }
        }