コード例 #1
0
        public void CheckFRUMBOA3(string mbsn,string usedmodel)
        {
            CommonImpl cmi = new CommonImpl();
            IList<ConstValueTypeInfo> lstConst = cmi.GetConstValueTypeListByType("RMAOA3CheckModel");
            bool needcheckoa3 = lstConst.Where(x => x.value == usedmodel).Any();
            if (needcheckoa3)
            {
                IMBRepository mbRepository = RepositoryFactory.GetInstance().GetRepository<IMBRepository, IMB>();
                IMB mb = mbRepository.Find(mbsn);
                if (mb == null )
                {
                    throw new FisException("SFC001", new string[] { mbsn });
                }
                string mbct = (string)mb.GetExtendedProperty("MBCT");
                if (string.IsNullOrEmpty(mbct))
                {
                    throw new FisException("ICT024");
                }

                string strSQL = @"IF EXISTS(SELECT 1 from RMA_OA3Data where CT=@CT)
                                                         SELECT 1
                                                        ELSE
                                                         SELECT 0 ";
                SqlParameter sqlPara = new SqlParameter("@CT", SqlDbType.VarChar, 32);
                sqlPara.Direction = ParameterDirection.Input;
                sqlPara.Value = mbct;
                object data = SqlHelper.ExecuteScalar(SqlHelper.ConnectionString_GetData, System.Data.CommandType.Text, strSQL, sqlPara);
                if ((int)data == 0)
                {
                    throw new FisException("CQCHK50118", new string[] { mbct });
                }



               
            }

        }
コード例 #2
0
ファイル: PodLabelCheck.cs プロジェクト: wra222/testgit
        public ArrayList InputCustSnForCQ(string custsn, string pdLine, string editor, string station, string customer)
        {
            logger.Debug("(PodLabelCheckImpl)InputCustSnForCQ start, custsn:" + custsn + "pdLine:" + pdLine + "editor:" + editor + "station:" + station + "customer:" + customer);
            FisException ex;
            List<string> erpara = new List<string>();
            ArrayList retArr = new ArrayList();
            string label = "";
            try
            {
               
                var currentProduct = CommonImpl.GetProductByInput(custsn, CommonImpl.InputTypeEnum.CustSN);
                string sessionKey = currentProduct.ProId;
                Session currentSession = SessionManager.GetInstance.GetSession(sessionKey, Session.SessionType.Product);
                CommonImpl2 cm2 = new CommonImpl2();
                label = cm2.CheckPodLabel(custsn);
                if (label == "")
                { label = cm2.CheckConfigLabel(custsn); }
                 if (string.IsNullOrEmpty(label))
                 {
                     throw new FisException("SFC013", new string[] { });
                 }

                if (currentSession == null)
                {
                    currentSession = new Session(sessionKey, Session.SessionType.Product, editor, station, pdLine, 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", pdLine);
                    wfArguments.Add("Customer", customer);
                    wfArguments.Add("SessionType", Session.SessionType.Product);
                    string wfName, rlName;
                    RouteManagementUtils.GetWorkflow(station, "PodLabelCheck.xoml", "PodLabelCheck.rules", out wfName, out rlName);
                    WorkflowInstance instance = WorkflowRuntimeManager.getInstance.CreateXomlFisWorkflow(wfName, rlName, wfArguments);
                    currentSession.AddValue(Session.SessionKeys.CustSN, custsn);
                    currentSession.AddValue(Session.SessionKeys.Product, currentProduct);
                    currentSession.AddValue(Session.SessionKeys.IsComplete, false);
                    currentSession.SetInstance(instance);

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

                    currentSession.WorkflowInstance.Start();
                    currentSession.SetHostWaitOne();
                }
                else
                {
                    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;
                }
                CommonImpl cmi = new CommonImpl();
                IList<ConstValueInfo> lstConst = cmi.GetConstValueListByType("PODModel", "Name").Where(y => y.value != "").ToList();
                string countryCode = currentProduct.Model.Substring(9, 2);
                var s = lstConst.Where(x => x.name == countryCode).Select(x => x.value).ToList();
                IList<string> codeLst = null;
                List<string> modelLst = new List<string>();

                if (s.Count > 0)
                {
                    string code = s[0];
                    codeLst = code.Split('~').Where(x=>x.Trim()!="").ToList();
                    foreach (string m in codeLst)
                    { modelLst.Add(currentProduct.Model+m.Trim()); }
                }
                string NoNeedScanMAC = "";
                IList<ConstValueTypeInfo> typeinfo = cmi.GetConstValueTypeListByType("ConfigNoCheckMAC").ToList();
                if (typeinfo.Where(x => x.value == currentProduct.Family).Any())
                {
                    NoNeedScanMAC = "NoNeed";
                }
                   
             
          
                currentSession.AddValue(Session.SessionKeys.ifElseBranch, label);
                retArr.Add(currentProduct.ProId);
                retArr.Add(currentProduct.Model);
                retArr.Add(label);
                retArr.Add(modelLst);
                retArr.Add(NoNeedScanMAC);//0001583: 86站POD Label check修改
                return retArr;
            }
            catch (FisException e)
            {
                //logger.Error(e.mErrmsg, e);
                //throw new Exception(e.mErrmsg);
                logger.Error(e.mErrmsg, e);
                if (e.mErrcode == "CHK020") //序號已被刷入
                {
                    throw e;
                }
                throw new Exception(e.mErrmsg);
            }
            catch (Exception e)
            {
                logger.Error(e.Message, e);
                throw new SystemException(e.Message);
            }
            finally
            {
                logger.Debug("(PodLabelCheckImpl)InputCustSnForCQ end, custsn:" + custsn + "pdLine:" + pdLine + "editor:" + editor + "station:" + station + "customer:" + customer);
            }
        
        
        
        }
コード例 #3
0
        public void CheckPAQC(IProduct p)
        {
            CommonImpl cmi = new CommonImpl();
            bool noneedcheck = false;
            IList<ConstValueTypeInfo> lstConst = cmi.GetConstValueTypeListByType("RCTOCombinePOInCartonNoCheckQC");
            if (lstConst != null && lstConst.Count > 0)
            {
                noneedcheck = lstConst.Where(x => !string.IsNullOrEmpty(x.value) && (x.value == p.Model || x.value == p.Family)).Any(); 
            }
            if (noneedcheck)//维护机型或者Family不检查qcstatus
            {
                return;
            }
            IList<ProductQCStatus> qcsStatus = p.QCStatus;
            if (qcsStatus != null && qcsStatus.Count>0)
            {
                ProductQCStatus PQ = qcsStatus.Where(x => x.Type == "PAQC").OrderByDescending(y => y.Udt).First();
                if (PQ != null)
                {
                    switch (PQ.Status)
                    {
                        case "":
                            throw new FisException("PAK014", new string[] { });
                        case "8":
                            throw new FisException("PAK014", new string[] { });
                        case "B":
                            throw new FisException("PAK014", new string[] { });
                        case "C":
                            throw new FisException("PAK014", new string[] { });
                        case "A":
                            throw new FisException("PAK015", new string[] { });
                        case "9":
                            
                        default:
                            break;
                    }

                }
                else
                {
                    List<string> erpara = new List<string>();
                    erpara.Add(p.ProductID);
                    erpara.Add("PAQC");
                   throw new FisException("PAK051", erpara);    //QCStatus 中Product%1 的参数 %2 不存在!
                   
                }
            }
          
        }