Esempio n. 1
0
        /// <summary>
        /// 更新KPRepair状态
        /// </summary>
        protected internal override ActivityExecutionStatus DoExecute(ActivityExecutionContext executionContext)
        {
            IDefectRepository defectRepository = RepositoryFactory.GetInstance().GetRepository<IDefectRepository>();
            IPartRepository partRepository = RepositoryFactory.GetInstance().GetRepository<IPartRepository, IPart>();

            KeyPartRepairInfo cond1 = new KeyPartRepairInfo();
            cond1.productID = this.Key;
            
            KeyPartRepairInfo item1 = new KeyPartRepairInfo();
            item1.productID = this.Key;
            item1.status = 1;
            item1.station = "KPR";
            item1.line = this.Line;
            item1.editor = this.Editor;
            item1.udt = DateTime.Now;

            partRepository.UpdateKPRepairDefered(CurrentSession.UnitOfWork, item1, cond1);

            IqcCause1Info cond2 = new IqcCause1Info();
            cond2.ctLabel = this.Key;
            //cond2.status = "0";

            IqcCause1Info item2 = new IqcCause1Info();
            item2.ctLabel = this.Key;
            item2.status = "1";
            item2.udt = DateTime.Now;

            defectRepository.UpdateUDTofIqcCause(item2, cond2);

            return base.DoExecute(executionContext);
        }
Esempio n. 2
0
        /// <summary>
        /// 保存Defect信息
        /// </summary>
        /// <param name="executionContext"></param>
        /// <returns></returns>
        protected internal override ActivityExecutionStatus DoExecute(ActivityExecutionContext executionContext)
        {
            IList<string> defectList = CurrentSession.GetValue(Session.SessionKeys.DefectList) as IList<string>;
            IDefectRepository defectRepository = RepositoryFactory.GetInstance().GetRepository<IDefectRepository, Defect>();
                     
            foreach (string ele in defectList)
            {
                IqcCause1Info info = new IqcCause1Info();
                info.ctLabel = this.Key;
                info.mpDefect = ele;
                if (defectRepository.CheckIfIqcCauseExist(info))
                {
                    defectRepository.UpdateUDTofIqcCauseDefered(CurrentSession.UnitOfWork, new IqcCause1Info(), info);
                }
                else
                {
                    defectRepository.AddIqcCauseDefered(CurrentSession.UnitOfWork, info);
                }
            }

            return base.DoExecute(executionContext);
        }
Esempio n. 3
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="executionContext"></param>
        /// <returns></returns>
        protected internal override ActivityExecutionStatus DoExecute(ActivityExecutionContext executionContext)
        {

            IProduct curProduct = (IProduct)CurrentSession.GetValue(Session.SessionKeys.Product);
            string ctno = (string)CurrentSession.GetValue("CTNO");

            IList<string> defectList = (IList<string>)CurrentSession.GetValue(Session.SessionKeys.DefectList);

            IProductRepository productRep = RepositoryFactory.GetInstance().GetRepository<IProductRepository, IProduct>();
            
            //Insert UnpackProduct_Part select *, @editor, @Udt from Product_Part 
            //where ProductID=@ProductID and CheckItemType<>’LCM’
            ProductPart cond = new ProductPart();
            cond.PartID = curProduct.ProId;

            ProductPart ncond = new ProductPart();
            ncond.CheckItemType = "LCM";

            productRep.BackUpProductPartByDn(Editor, cond, ncond);
            //Delete Product_Part where ProductID=@ProductID and CheckItemType<>’LCM’
            productRep.DeleteProductPart(cond, ncond);
            //Insert UnpackProductInfo select *, @editor, @Udt from ProductInfo where ProductID=@ProductID
            IMES.FisObject.FA.Product.ProductInfo infoconf = new IMES.FisObject.FA.Product.ProductInfo();
            infoconf.ProductID = curProduct.ProId; ;
            productRep.BackUpProductInfo(Editor, infoconf, null);
            //Delete ProductInfo where ProductID=@ProductID 
            productRep.DeleteProductInfo(infoconf, null);

            //if exists(select * from IqcCause1(nolock) where CtLabel=@CTNo and MpDefect=@Defect)
            //update IqcCause1 set Udt = GETDATE() where CtLabel=@CTNo and MpDefect=@Defect
            //else
            //insert into IqcCause1(CtLabel,MpDefect) values(@CTNo,@Defect)

            IDefectRepository defectRep = RepositoryFactory.GetInstance().GetRepository<IDefectRepository, Defect>();
            foreach (string code in defectList)
            {
                IqcCause1Info qconf = new IqcCause1Info();
                qconf.ctLabel = ctno;
                qconf.mpDefect = code;
                IList<IqcCause1Info> infoList = defectRep.GetIqcCause1InfoList(qconf);

                if (infoList.Count == 0)
                {
                    defectRep.AddIqcCause(qconf);
                }
                else
                {
                    IqcCause1Info item = new IqcCause1Info();
                    item.udt = DateTime.Now;
                    defectRep.UpdateUDTofIqcCause(item, qconf);
                }
            }

            return base.DoExecute(executionContext);
        }
Esempio n. 4
0
        /// <summary>
        /// Generate repair list of KP.
        /// </summary>
        protected internal override ActivityExecutionStatus DoExecute(ActivityExecutionContext executionContext)
        {
            IDefectRepository defectRepository = RepositoryFactory.GetInstance().GetRepository<IDefectRepository>();
            IPartRepository partRepository = RepositoryFactory.GetInstance().GetRepository<IPartRepository, IPart>();
            IList<IqcCause1Info> iqcList = new List<IqcCause1Info>();
            IqcCause1Info cond1 = new IqcCause1Info();
            cond1.ctLabel = Key;
            IqcCause1Info cond_neq = new IqcCause1Info();
            cond_neq.status = "1";
            iqcList = defectRepository.GetIqcCause1InfoList(cond1, cond_neq);
            if (iqcList.Count <= 0)
            {
                FisException ex;
                List<string> erpara = new List<string>();
                erpara.Add(Key);
                ex = new FisException("CHK233", erpara);    //CT:XXX没有不良记录.
                throw ex;
            }

            KeyPartRepairInfo cond2 = new KeyPartRepairInfo();
            cond2.productID = Key;
            cond2.status = 0;
            if (partRepository.GetCountOfKpRepairCount(cond2) <= 0)
            {
                KeyPartRepairInfo kprInfo = new KeyPartRepairInfo();
                kprInfo.productID = this.Key;
                kprInfo.model = "";
                kprInfo.type = "KP";
                kprInfo.line = "";
                kprInfo.station = "";
                kprInfo.status = 0;
                kprInfo.testLogID = 0;
                kprInfo.logID = 0;
                kprInfo.editor = Editor;
                kprInfo.cdt = DateTime.Now;
                kprInfo.udt = DateTime.Now;
                partRepository.AddKPRepair(kprInfo);

                foreach (IqcCause1Info tmp in iqcList)
                {
                    RepairDefect defect = new RepairDefect();
                    defect.RepairID = kprInfo.id;
                    defect.Type = "KP";
                    defect.DefectCodeID = tmp.mpDefect;
                    defect.Mark = "0";
                    defect.IsManual = false;
                    defect.Editor = Editor;
                    defect.Cdt = DateTime.Now;
                    defect.Udt = DateTime.Now;
                    defect.Cause = "";
                    defect.Obligation = "";
                    defect.Component = "";
                    defect.Site = "";
                    defect.Location = "";
                    defect.MajorPart = "";
                    defect.Remark = "";
                    defect.VendorCT = "";
                    defect.PartType = "";
                    defect.OldPart = "";
                    defect.OldPartSno = "";
                    defect.NewPart = "";
                    defect.NewPartSno = "";
                    defect.Manufacture = "";
                    defect.VersionA = "";
                    defect.VersionB = "";
                    defect.SubDefect = "";
                    defect.PIAStation = "";
                    defect.Distribution = "";
                    defect._4M = "";
                    defect.Responsibility = "";
                    defect.Action = "";
                    defect.Cover = "";
                    defect.Uncover = "";
                    defect.TrackingStatus = "";
                    defect.MTAID = "";
                    defect.ReturnStation = "";
                    defect.ReturnSign = "";
                    partRepository.AddKPRepairDefect(defect);
                }
            }

            return base.DoExecute(executionContext);
        }