Пример #1
0
        /// <summary>
        /// 刷料检查的一些属性,全部检查成功后调用save
        /// 将Session.IsComplete设为False
        /// </summary>
        IList<MatchedPartOrCheckItem> IJPNPVS.CheckExplicitCheckItem(string productID, string checkValue)
        {
            logger.Debug("(JPNPVSImpl)CheckExplicitCheckItem start, productID:" + productID + " checkValue:" + checkValue);

            FisException ex;
            List<string> erpara = new List<string>();
            string sessionKey = productID;
            Session currentSession = SessionManager.GetInstance.GetSession(sessionKey, currentSessionType);

            if (currentSession == null)
            {
                erpara.Add(sessionKey);
                ex = new FisException("CHK021", erpara);
                throw ex;
            }
            try
            {
                currentSession.Exception = null;
                currentSession.AddValue(Session.SessionKeys.ValueToCheck, checkValue);
                currentSession.InputParameter = checkValue;
                currentSession.SwitchToWorkFlow();

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

                    throw currentSession.Exception;
                }


                IList<MatchedPartOrCheckItem> MatchedList = new List<MatchedPartOrCheckItem>();
                //get matchedinfo

                ICheckItem citem = (ICheckItem)currentSession.GetValue(Session.SessionKeys.MatchedCheckItem);
                if (citem == null)
                {
                    throw new FisException("MAT010", new string[] { checkValue });
                }
                else
                {
                    MatchedPartOrCheckItem tempMatchedPart = new MatchedPartOrCheckItem();
                   // tempMatchedPart.PNOrItemName = citem.CheckItem;
					tempMatchedPart.PNOrItemName = citem.ItemDisplayName;
                    tempMatchedPart.CollectionData = citem.ValueToCollect;
                    MatchedList.Add(tempMatchedPart);
                    return MatchedList;
                }

            }
            catch (FisException e)
            {
                throw e;
            }
            catch (Exception e)
            {
                throw new SystemException(e.Message);
            }
            finally
            {
                logger.Debug("(JPNPVSImpl)CheckExplicitCheckItem end, productID:" + productID + " checkValue:" + checkValue);
            }
        }
Пример #2
0
        /// <summary>
        /// InputPPID
        /// </summary>
        /// <param name="prodId"></param>
        /// <param name="ppid"></param>
        /// <returns></returns>
        public IMES.DataModel.MatchedPartOrCheckItem InputPPID(string prodId, string ppid)
        {
            logger.Debug("(CreateProductandCombineLCM)InputPPID start," + " [prodId]: " + prodId + " [ppid]:" + ppid);
            FisException ex;
            List<string> erpara = new List<string>();
            try
            {
                string sessionKey = prodId;
                Session sessionInfo = SessionManager.GetInstance.GetSession(sessionKey, TheType);

                if (sessionInfo == null)
                {
                    erpara.Add(sessionKey);
                    ex = new FisException("CHK021", erpara);
                    throw ex;
                }
                else
                {
                    sessionInfo.AddValue(Session.SessionKeys.PartID, ppid);
                    sessionInfo.AddValue(Session.SessionKeys.ValueToCheck, ppid);
                    sessionInfo.Exception = null;
                    sessionInfo.SwitchToWorkFlow();
                }

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

                    throw sessionInfo.Exception;
                }

                PartUnit matchedPart = (PartUnit)sessionInfo.GetValue(Session.SessionKeys.MatchedParts);

                if (matchedPart != null)
                {
                    MatchedPartOrCheckItem tempMatchedPart = new MatchedPartOrCheckItem();
                    tempMatchedPart.PNOrItemName = matchedPart.Pn;
                    tempMatchedPart.CollectionData = ppid;
                    tempMatchedPart.ValueType = matchedPart.ValueType;
                    return tempMatchedPart;
                }
                return null;
            }
            catch (FisException e)
            {
                logger.Error(e.mErrmsg);
                throw e;
            }
            catch (Exception e)
            {
                logger.Error(e.Message);
                throw new SystemException(e.Message);
            }
            finally
            {
                logger.Debug("(CreateProductandCombineLCM)InputPPID  End," + " [prodId]: " + prodId + " [ppid]:" + ppid);
            }
        }
Пример #3
0
        public IList<MatchedPartOrCheckItem> InputCheckItemData(
            string MB_SNo,
            string item)
        {
            logger.Debug("(PCAShippingLabel)InputCheckItemData start, MB_SNo:" + MB_SNo + " item:" + item);

            try
            {
                FisException ex;
                List<string> erpara = new List<string>();
                string sessionKey = MB_SNo;
                Session Session = SessionManager.GetInstance.GetSession(sessionKey, TheType);


                if (Session == null)
                {
                    erpara.Add(sessionKey);
                    ex = new FisException("CHK021", erpara);
                    throw ex;
                }
                else
                {
                    ArrayList returnItem = new ArrayList();

                    Session.AddValue(Session.SessionKeys.ValueToCheck, item);
                    Session.InputParameter = item;
                    Session.Exception = null;
                    Session.SwitchToWorkFlow();

                    //check workflow exception
                    if (Session.Exception != null)
                    {
                        if (Session.GetValue(Session.SessionKeys.WFTerminated) != null)
                        {
                            Session.ResumeWorkFlow();
                        }
                        throw Session.Exception;
                    }

                    IList<MatchedPartOrCheckItem> MatchedList = new List<MatchedPartOrCheckItem>();
                    //get matchedinfo
                    IList<IBOMPart> bomPartlist = (IList<IBOMPart>)Session.GetValue(Session.SessionKeys.MatchedParts);
                    if ((bomPartlist != null) && (bomPartlist.Count > 0))
                    {
                        foreach (IBOMPart bompartitem in bomPartlist)
                        {
                            MatchedPartOrCheckItem tempMatchedPart = new MatchedPartOrCheckItem();
                            tempMatchedPart.PNOrItemName = bompartitem.PN;
                            tempMatchedPart.CollectionData = bompartitem.MatchedSn;
                            tempMatchedPart.ValueType = bompartitem.ValueType;
                            MatchedList.Add(tempMatchedPart);
                        }
                        return MatchedList;
                    }
                    else
                    {
                        ICheckItem citem = (ICheckItem)Session.GetValue(Session.SessionKeys.MatchedCheckItem);
                        if (citem == null)
                        {
                            throw new FisException("MAT010", new string[] { item });
                        }
                        else
                        {
                            MatchedPartOrCheckItem tempMatchedPart = new MatchedPartOrCheckItem();
                            tempMatchedPart.PNOrItemName = citem.ItemDisplayName;
                            tempMatchedPart.CollectionData = citem.ValueToCollect;
                            tempMatchedPart.ValueType = "";
                            MatchedList.Add(tempMatchedPart);
                            return MatchedList;
                        }
                    }
                }
            }

            catch (FisException e)
            {
                throw e;
            }
            catch (Exception e)
            {
                throw new SystemException(e.Message);
            }
            finally
            {
                logger.Debug("(PCAShippingLabel)InputCheckItemData end, MB_SNo:" + MB_SNo + " item:" + item);
            }
        }
Пример #4
0
        /// <summary>
        /// 根据输入的字符串做PartMatch,成功返回匹配上的料,失败抛对应的业务异常
        /// </summary>
        /// <param name="sessionKey"></param>
        /// <param name="currentSessionType"></param>
        /// <param name="checkValue"></param>
        /// <returns></returns>
        public static IMES.DataModel.MatchedPartOrCheckItem TryPartMatchCheck(string sessionKey, Session.SessionType currentSessionType, string checkValue)
        {
            ILog logger = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

            logger.Debug("TryPartMatchCheck start, SessionKey:" + sessionKey);

            try
            {
                Session currentSession = SessionManager.GetInstance.GetSession(sessionKey,currentSessionType);

                if (currentSession == null)
                {
                    FisException ex;
                    List<string> erpara = new List<string>();
                    erpara.Add(sessionKey);
                    ex = new FisException("CHK021", erpara);
                    logger.Error(ex.Message, ex);
                    throw ex;
                }
                else
                {
                    currentSession.AddValue(Session.SessionKeys.PartID, checkValue);
                    currentSession.AddValue(Session.SessionKeys.ValueToCheck, checkValue);
                    currentSession.Exception = null;
                    currentSession.SwitchToWorkFlow();
                }

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

                    throw currentSession.Exception;
                }

                // IList<MatchedPartOrCheckItem> MatchedList = new List<MatchedPartOrCheckItem>();
                //get matchedinfo
                PartUnit matchedPart = (PartUnit)currentSession.GetValue(Session.SessionKeys.MatchedParts);

                if (matchedPart != null)
                {
                    MatchedPartOrCheckItem tempMatchedPart = new MatchedPartOrCheckItem();
                    tempMatchedPart.PNOrItemName = matchedPart.Pn;
                    tempMatchedPart.CollectionData = checkValue;
                    tempMatchedPart.ValueType = matchedPart.ItemType;
                    tempMatchedPart.FlatBomItemGuid = matchedPart.FlatBomItemGuid;
                    return tempMatchedPart;
                }
                else
                {
                    throw new FisException("MAT010", new string[] { checkValue });
                }
                //else
                //{
                //    ICheckItem citem = (ICheckItem)currentSession.GetValue(Session.SessionKeys.MatchedCheckItem);
                //    if (citem == null)
                //    {
                //        throw new FisException("MAT010", new string[] { checkValue });
                //    }
                //    else
                //    {
                //        MatchedPartOrCheckItem tempMatchedPart = new MatchedPartOrCheckItem();
                //        tempMatchedPart.PNOrItemName = citem.ItemDisplayName;
                //        tempMatchedPart.CollectionData = citem.ValueToCollect;
                //        tempMatchedPart.ValueType = "";
                //        MatchedList.Add(tempMatchedPart);
                //        return MatchedList;
                //    }
                //}
                //return null;
            }
            catch (FisException e)
            {
                logger.Error(e.mErrmsg, e);
                throw e;
            }
            catch (Exception e)
            {
                logger.Error(e.Message, e);
                throw new SystemException(e.Message);
            }
            finally
            {
                logger.Debug("TryPartMatchCheck end, SessionKey:" + sessionKey);
            }
        }
Пример #5
0
        /// 输入PPID
        /// </summary>
        /// <param name="prodId">Product Id</param>
        /// <param name="ppid">PPID</param>
        /// <returns>主料的Part No</returns>
        public IMES.DataModel.MatchedPartOrCheckItem InputPPID(
            string prodId,
            string ppid)
        {
            logger.Debug("(ICheckCombineCT)InputPPID start,"
               + " [prodId]: " + prodId
               + " [ppid]:" + ppid);
            FisException ex;
            List<string> erpara = new List<string>();
            try
            {

                string sessionKey = prodId;
                Session sessionInfo = SessionManager.GetInstance.GetSession(sessionKey, TheType);

                if (sessionInfo == null)
                {
                    erpara.Add(sessionKey);
                    ex = new FisException("CHK021", erpara);
                    throw ex;
                }
                else
                {
                    sessionInfo.AddValue(Session.SessionKeys.PartID, ppid);
                    sessionInfo.AddValue(Session.SessionKeys.ValueToCheck, ppid);
                    sessionInfo.Exception = null;
                    sessionInfo.SwitchToWorkFlow();
                }

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

                    throw sessionInfo.Exception;
                }

                PartUnit matchedPart = (PartUnit)sessionInfo.GetValue(Session.SessionKeys.MatchedParts);

                if (matchedPart != null)
                {
                    MatchedPartOrCheckItem tempMatchedPart = new MatchedPartOrCheckItem();
                    tempMatchedPart.PNOrItemName = matchedPart.Pn;
                    tempMatchedPart.CollectionData = ppid;
                    tempMatchedPart.ValueType = matchedPart.ValueType;
                    return tempMatchedPart;
                }
                /*
                                IList<MatchedPartOrCheckItem> RetList = new List<MatchedPartOrCheckItem>(); 

                                //get matchedinfo
                                IList<IBOMPart> bomPartlist = (IList<IBOMPart>)sessionInfo.GetValue(Session.SessionKeys.MatchedParts);
                                if ((bomPartlist != null) && (bomPartlist.Count > 0))
                                {
                                    foreach (IBOMPart bompartitem in bomPartlist)
                                    {
                                        MatchedPartOrCheckItem tempMatchedPart = new MatchedPartOrCheckItem();
                                        tempMatchedPart.PNOrItemName = bompartitem.PN;
                                        //tempMatchedPart.CollectionData = bompartitem.MatchedSn; //itc200052 , 2011.12.13
                                        tempMatchedPart.ValueType = bompartitem.Type; 
                                        RetList.Add(tempMatchedPart); 
                                    }
                                    return RetList;
                                }
                                else
                                {
                                    ICheckObject citem = (ICheckObject)sessionInfo.GetValue(Session.SessionKeys.MatchedCheckItem);
                                    if (citem == null)
                                    {
                                        erpara.Add(ppid);
                                        throw new FisException("MAT010", erpara);
                                    }
                                    else
                                    {
                                        MatchedPartOrCheckItem tempMatchedPart = new MatchedPartOrCheckItem();
                                        //tempMatchedPart.PNOrItemName = citem.ItemDisplayName; itc200052, 2011.12.13
                                        //tempMatchedPart.CollectionData = citem.ValueToCollect; itc200052, 2011.12.13
                                        tempMatchedPart.ValueType = "";
                                        RetList.Add(tempMatchedPart);                                      
                                        return RetList;
                                    }
                                } */
                return null;
            }
            catch (FisException e)
            {
                logger.Error(e.mErrmsg);
                throw e;
            }
            catch (Exception e)
            {
                logger.Error(e.Message);
                throw new SystemException(e.Message);
            }
            finally
            {
                logger.Debug("(ICheckCombineCT)InputPPID  End,"
                               + " [prodId]: " + prodId
                               + " [ppid]:" + ppid);
            }
        }
Пример #6
0
        public IMES.DataModel.MatchedPartOrCheckItem InputMBSn(string prodId, string item)
        {
            logger.Debug("(CombineTmp)InputMBSn start, prodId:" + prodId + " item:" + item);

            FisException ex;
            List<string> erpara = new List<string>();
            string sessionKey = prodId;
          //  string sessionKey = OriSessionkey;

            Session Session = SessionManager.GetInstance.GetSession(prodId, TheType);
            if (Session == null)
            {

                erpara.Add(sessionKey);
                ex = new FisException("CHK021", erpara);
                //ex.logErr("", "", "", "", "83");
                //logger.Error(ex);
                throw ex;
            }
            try
            {

                ArrayList returnItem = new ArrayList();

                Session.Exception = null;
                Session.AddValue(Session.SessionKeys.ValueToCheck, item);
                Session.InputParameter = item;
                Session.SwitchToWorkFlow();

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

                    throw Session.Exception;
                }

                //2010-02-03   207006     ITC-1122-0079
                //IList<MatchedPartOrCheckItem> MatchedList = new List<MatchedPartOrCheckItem>();
                //get matchedinfo
                PartUnit matchedPart = (PartUnit)Session.GetValue(Session.SessionKeys.MatchedParts);

                if (matchedPart != null)
                {
                    MatchedPartOrCheckItem tempMatchedPart = new MatchedPartOrCheckItem();
                    tempMatchedPart.PNOrItemName = matchedPart.Pn;
                    tempMatchedPart.CollectionData = item;
                    tempMatchedPart.ValueType = matchedPart.ValueType;
                    return tempMatchedPart;
                }


                return null;
        
            }
            catch (FisException e)
            {
                throw e;
            }
            catch (Exception e)
            {
                throw new SystemException(e.Message);
            }
            finally
            {
                logger.Debug("(CombineTmp)InputMBSn end, prodId:" + prodId + " item:" + item); 
            }

        }
Пример #7
0
        public IMES.DataModel.MatchedPartOrCheckItem InputMBSn(string prodId, string item)
        {
            logger.Debug("(_BoardInput)InputMBSn start, prodId:" + prodId + " item:" + item);

            FisException ex;
            List<string> erpara = new List<string>();
            string sessionKey = prodId;
          //  string sessionKey = OriSessionkey;

            Session Session = SessionManager.GetInstance.GetSession(prodId, TheType);
            if (Session == null)
            {

                erpara.Add(sessionKey);
                ex = new FisException("CHK021", erpara);
                //ex.logErr("", "", "", "", "83");
                //logger.Error(ex);
                throw ex;
            }
            try
            {

                ArrayList returnItem = new ArrayList();

                Session.Exception = null;
                Session.AddValue(Session.SessionKeys.ValueToCheck, item);
                Session.InputParameter = item;
                Session.SwitchToWorkFlow();

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

                    throw Session.Exception;
                }

                //2010-02-03   207006     ITC-1122-0079
                //IList<MatchedPartOrCheckItem> MatchedList = new List<MatchedPartOrCheckItem>();
                //get matchedinfo
                PartUnit matchedPart = (PartUnit)Session.GetValue(Session.SessionKeys.MatchedParts);

                if (matchedPart != null)
                {
                    MatchedPartOrCheckItem tempMatchedPart = new MatchedPartOrCheckItem();
                    tempMatchedPart.PNOrItemName = matchedPart.Pn;
                    tempMatchedPart.CollectionData = item;
                    tempMatchedPart.ValueType = matchedPart.ValueType;
                    return tempMatchedPart;
                }

/*                IList<IBOMPart> bomPartlist = (IList<IBOMPart>)Session.GetValue(Session.SessionKeys.MatchedParts);
  
                if ((bomPartlist != null) && (bomPartlist.Count > 0))
                {
                    foreach (IBOMPart bompartitem in bomPartlist)
                    {
                        MatchedPartOrCheckItem tempMatchedPart = new MatchedPartOrCheckItem();
                        tempMatchedPart.PNOrItemName = bompartitem.PN;
                        tempMatchedPart.CollectionData = item;
                        //tempMatchedPart.CollectionData = bompartitem.MatchedSn; itc200052 , 2011.12.13
                        tempMatchedPart.ValueType = bompartitem.Type; //itc200052 , 2011.12.13
                        MatchedList.Add(tempMatchedPart);
                    }
                    return MatchedList;
                }

                else
                {
                    ICheckObject citem = (ICheckObject)Session.GetValue(Session.SessionKeys.MatchedCheckItem);
                    if (citem == null)
                    {
                        throw new FisException("MAT010", new string[] { item });
                    }
                    else
                    {
                        MatchedPartOrCheckItem tempMatchedPart = new MatchedPartOrCheckItem();
                        //tempMatchedPart.PNOrItemName = citem.ItemDisplayName; itc200052, 2011.12.13
                        //tempMatchedPart.CollectionData = citem.ValueToCollect; itc200052, 2011.12.13
                        tempMatchedPart.ValueType = "";
                        MatchedList.Add(tempMatchedPart);
                        return MatchedList;
                    }
                } */
                return null;
        
            }
            catch (FisException e)
            {
                throw e;
            }
            catch (Exception e)
            {
                throw new SystemException(e.Message);
            }
            finally
            {
                logger.Debug("(_BoardInput)InputMBSn end, prodId:" + prodId + " item:" + item); 
            }

        }
Пример #8
0
        /// <summary>
        /// 输入料或者要检查的CheckItem进行检查
        /// 如果没有抛出Match异常,从Session.SessionKeys.MatchedParts中把当前Match的料取出
        /// 如果没有match到Part,从Session.SessionKeys.MatchedCheckItem取出match的CheckItem
        /// 返回给前台
        /// 检料全部完成后调用Save
        /// </summary>
        /// <param name="productID"></param>
        /// <param name="checkValue"></param>
        /// <returns></returns>
        public IList<MatchedPartOrCheckItem> CheckPartAndItem(string productID, string checkValue)
        {
            logger.Debug("(UnitLabelPrintImpl)GetNeedCheckPartAndItem start, ProductID:" + productID
                 + " [checkValue]:" + checkValue);

            try
            {
                Session currentSession = SessionManager.GetInstance.GetSession(productID, SessionType);

                if (currentSession == null)
                {
                    FisException ex;
                    List<string> erpara = new List<string>();
                    erpara.Add(productID);
                    ex = new FisException("CHK021", erpara);
                    logger.Error(ex.Message, ex);
                    throw ex;
                }
                else
                {
                    currentSession.AddValue(Session.SessionKeys.PartID, checkValue);
                    currentSession.AddValue(Session.SessionKeys.ValueToCheck, checkValue);
                    currentSession.Exception = null;
                    currentSession.SwitchToWorkFlow();
                }

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

                    throw currentSession.Exception;
                }

                IList<MatchedPartOrCheckItem> MatchedList = null;
                MatchedList = new List<MatchedPartOrCheckItem>();
                //get matchedinfo
                IList<IBOMPart> bomPartlist = (IList<IBOMPart>)currentSession.GetValue(Session.SessionKeys.MatchedParts);
                if ((bomPartlist != null) && (bomPartlist.Count > 0))
                {
                    foreach (IBOMPart bompartitem in bomPartlist)
                    {
                        MatchedPartOrCheckItem tempMatchedPart = new MatchedPartOrCheckItem();
                        tempMatchedPart.PNOrItemName = bompartitem.PN;
                        tempMatchedPart.CollectionData = bompartitem.MatchedSn;
                        tempMatchedPart.ValueType = bompartitem.ValueType;
                        MatchedList.Add(tempMatchedPart);
                    }
                    return MatchedList;
                }
                else
                {
                    ICheckItem citem = (ICheckItem)currentSession.GetValue(Session.SessionKeys.MatchedCheckItem);
                    if (citem == null)
                    {
                        throw new FisException("MAT010", new string[] { checkValue });
                    }
                    else
                    {
                        MatchedPartOrCheckItem tempMatchedPart = new MatchedPartOrCheckItem();
                        tempMatchedPart.PNOrItemName = citem.ItemDisplayName;
                        tempMatchedPart.CollectionData = citem.CheckValue;
                        tempMatchedPart.ValueType = "";
                        MatchedList.Add(tempMatchedPart);
                        return MatchedList;
                    }
                }
            }
            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("(UnitLabelPrintImpl)GetNeedCheckPartAndItem end, ProductID:" + productID
                     + " [checkValue]:" + checkValue);
            }
        }
Пример #9
0
        /// <summary>
        /// 刷入替换物料后的处理
        /// </summary>
        public MatchedPartOrCheckItem TryPartMatchCheck(string sesKey, string checkValue)
        {
            logger.Debug("(_ChangeKeyParts)TryPartMatchCheck start, SessionKey:" + sesKey);

            try
            {
                Session currentSession = SessionManager.GetInstance.GetSession(sesKey, TheType);

                if (currentSession == null)
                {
                    FisException ex;
                    List<string> erpara = new List<string>();
                    erpara.Add(sesKey);
                    ex = new FisException("CHK021", erpara);
                    logger.Error(ex.Message, ex);
                    throw ex;
                }
                else
                {
                    currentSession.AddValue(Session.SessionKeys.PartID, checkValue);
                    currentSession.AddValue(Session.SessionKeys.ValueToCheck, checkValue);
                    currentSession.Exception = null;
                    currentSession.SwitchToWorkFlow();
                }

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

                    throw currentSession.Exception;
                }

                PartUnit matchedPart = (PartUnit)currentSession.GetValue(Session.SessionKeys.MatchedParts);

                if (matchedPart != null)
                {
                    MatchedPartOrCheckItem tempMatchedPart = new MatchedPartOrCheckItem();
                    tempMatchedPart.PNOrItemName = matchedPart.Pn;
                    tempMatchedPart.CollectionData = checkValue;
                    tempMatchedPart.ValueType = matchedPart.ItemType;
                    return tempMatchedPart;
                }
                else
                {
                    throw new FisException("MAT010", new string[] { checkValue });
                }
            }
            catch (FisException e)
            {
                logger.Error(e.mErrmsg, e);
                throw e;
            }
            catch (Exception e)
            {
                logger.Error(e.Message, e);
                throw new SystemException(e.Message);
            }
            finally
            {
                logger.Debug("(_ChangeKeyParts)TryPartMatchCheck end, SessionKey:" + sesKey);
            }
        }
Пример #10
0
        /// <summary>
        /// 刷料检查的一些属性,全部检查成功后调用save
        /// 将Session.IsComplete设为False
        /// </summary>
        /// <param name="productID">product id</param>
        /// <param name="checkValue">检查值</param>
        /// <returns>匹配项列表</returns>
        public IList<MatchedPartOrCheckItem> CheckExplicitCheckItem(string prodId, string item)
        {
            logger.Debug("(_FGShippingLabel)CheckExplicitCheckItem start, prodId:" + prodId + " item:" + item);

            FisException ex;
            List<string> erpara = new List<string>();
            string sessionKey = prodId;
            Session Session = SessionManager.GetInstance.GetSession(sessionKey, TheType);
            if (Session == null)
            {
                erpara.Add(sessionKey);
                ex = new FisException("CHK021", erpara);
                throw ex;
            }
            try
            {

                ArrayList returnItem = new ArrayList();

                Session.Exception = null;
                Session.AddValue(Session.SessionKeys.ValueToCheck, item);
                Session.InputParameter = item;
                Session.SwitchToWorkFlow();

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

                    throw Session.Exception;
                }


                IList<MatchedPartOrCheckItem> MatchedList = new List<MatchedPartOrCheckItem>();
                ICheckItem citem = (ICheckItem)Session.GetValue(Session.SessionKeys.MatchedCheckItem);
                if (citem == null)
                {
                    erpara.Add(item);
                    throw new FisException("MAT010", erpara);
                }
                else
                {

                    MatchedPartOrCheckItem tempMatchedPart = new MatchedPartOrCheckItem();
                    tempMatchedPart.PNOrItemName = citem.ItemDisplayName;
                    tempMatchedPart.CollectionData = citem.ValueToCollect;
                    tempMatchedPart.ValueType = "";
                    MatchedList.Add(tempMatchedPart);
                    return MatchedList;
                }
                
              
            }
            catch (FisException e)
            {
                throw e;
            }
            catch (Exception e)
            {
                throw new SystemException(e.Message);
            }
            finally
            {
                logger.Debug("(_FGShippingLabel)CheckExplicitCheckItem end, prodId:" + prodId + " item:" + item);
            }
        }