Beispiel #1
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="prodList"></param>
        /// <param name="editor"></param>
        /// <param name="station"></param>
        /// <param name="customer"></param>
        /// <returns></returns>
        public ArrayList CheckProdList(IList<string> prodList, string editor, string station, string customer)
        {
            logger.Debug("(ProductReinputImpl)CheckProdList start");

            try
            {
                ArrayList retList = new ArrayList();
                IList<DataModel.ProductInfo> failList = new List<DataModel.ProductInfo>();
                IList<DataModel.ProductInfo> okList = new List<DataModel.ProductInfo>();
                IProductRepository productRep = RepositoryFactory.GetInstance().GetRepository<IProductRepository, IMES.FisObject.FA.Product.IProduct>();
                IPartRepository partRep = RepositoryFactory.GetInstance().GetRepository<IPartRepository, IPart>();
                IStationRepository stationRep = RepositoryFactory.GetInstance().GetRepository<IStationRepository>();

                foreach (string node in prodList)
                {
                    
                    IMES.FisObject.FA.Product.IProduct curProduct = null;
                    DataModel.ProductInfo prod = new DataModel.ProductInfo();

                    curProduct = productRep.FindOneProductWithProductIDOrCustSN(node);

                    if (curProduct == null)
                    {   //[Fail List].Cause = ‘不存在’ 
                        prod.customSN = node;
                        prod.id = node;
                        prod.familyId = "不存在";
                        failList.Add(prod);
                    }
                    else
                    {
                        prod.id = curProduct.ProId;
                        prod.customSN = curProduct.CUSTSN;
                        prod.modelId = curProduct.Status.StationId;
                        prod.familyId ="";

                        switch (curProduct.Status.StationId)
                        {
                            case "73":
                                //若ProductStatus.Station = ‘73’,则在[Fail List]添加显示:
                                //[Fail List].Cause = ‘EPIA抽中,需刷出’
                                prod.familyId ="EPIA抽中,需刷出";
                                break;
                            case"71":
                                //若ProductStatus.Station = ‘71,则在[Fail List]添加显示:
                                //[Fail List].ProdId/CustSN = [ProductID]/[CustSN]
                                //[Fail List].Cause = ‘PIA抽中,需刷出’
                                prod.familyId = "PIA抽中,需刷出";
                                break;
                            default:    
                                break;
                        }

                        //获取@StationS = SysSetting.Value( Condtion: SysSetting.Name = ‘FAReturnStation’),
                        //若ProductStatus.Station不在@StationS中,则在[Fail List]添加显示:
                        //[Fail List].Cause = ‘不在FA’
                        IList<string> valueList = new List<string>();
                        valueList = partRep.GetValueFromSysSettingByName("FAReturnStation");
                        if (!valueList[0].Contains(curProduct.Status.StationId))
                        {
                            prod.familyId = "不在FA";
                        }
                        //ProductStatus.Station<>’45’、’76’和’7P’,
                        //则获取@ForceNWC(ForceNWC.ForceNWC Condtion: ForceNWC.PreStation=ProductStatus.Station and ProductID=[ProductID])
                        //若@ForceNWC不为空,且不为Null,则在[Fail List]添加显示:
                        //[Fail List].Cause = ‘必须去刷 ’+Station.Descr(Station.Station=@ForceNWC)
                        string tmpsta="45,76,7P";
                        if (tmpsta.IndexOf(curProduct.Status.StationId) < 0)
                        {
                            ForceNWCInfo cond = new ForceNWCInfo();
                            cond.productID = curProduct.ProId;
                            cond.preStation = curProduct.Status.StationId;
                            IList<ForceNWCInfo> flist = partRep.GetForceNWCListByCondition(cond);

                            if (flist.Count > 0)
                            {
                                IStation curstation = stationRep.Find(flist[0].forceNWC);
                                prod.familyId = "必须去刷 " + curstation.Descr;
                            }
                        }

                        // mantis 1558
                        if (curProduct.Status.Status.Equals(StationStatus.Fail))
                            prod.familyId = "存在不良";

                        if (string.IsNullOrEmpty(prod.familyId))
                        {
                            okList.Add(prod);
                        }
                        else
                        {
                            failList.Add(prod);
                        }
                    }                    
                }
                retList.Add(okList);
                retList.Add(failList);

                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("(ProductReinputImpl)CheckProdList end");
            }
        }
Beispiel #2
0
 /// <summary>
 /// 转换为IMES.DataModel.ProductInfo
 /// </summary>
 /// <returns>IMES.DataModel.ProductInfo</returns>
 public DataModel.ProductInfo ToProductInfo()
 {
     var info = new DataModel.ProductInfo();
     info.id = ProId;
     info.modelId = Model;
     info.pizzaId = PizzaID;
     info.familyId = Family;
     info.modelId = Model;
     info.MOId = MO;
     info.cvSN = CVSN;
     info.customSN = CUSTSN;
     return info;
 }