예제 #1
0
        public ArrayList GetDefectInfo(string code)
        {
            logger.Debug("(PCAOQCCosmetic)GetDefectInfo start, [DefectCode]:" + code);
            ArrayList retValue = new ArrayList();
            try
            {
                IDefectRepository defectRepository = RepositoryFactory.GetInstance().GetRepository<IDefectRepository, Defect>();

                string desc = string.Empty;
                IList<DefectCodeInfo> defectcodeLst = new List<DefectCodeInfo>();
                DefectCodeInfo cond = new DefectCodeInfo();
                cond.Defect = code;
                defectcodeLst = defectRepository.GetDefectCodeInfoList(cond);
                if (defectcodeLst != null && defectcodeLst.Count > 0)
                {
                    desc = defectcodeLst[0].Descr;
                }
                else
                {
                    FisException ex;
                    List<string> erpara = new List<string>();
                    ex = new FisException("CHK908", erpara);
                    throw ex;
                }

                retValue.Add(desc);
                return retValue;
            }
            catch (FisException e)
            {
                logger.Error(e.mErrmsg);
                throw e;
            }
            catch (Exception e)
            {
                logger.Error(e.Message);
                throw e;
            }
            finally
            {
                logger.Debug("(PCAOQCCosmetic)GetDefectInfo end, [DefectCode]:" + code);
            }
        }
예제 #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="executionContext"></param>
        /// <returns></returns>
        protected internal override ActivityExecutionStatus DoExecute(ActivityExecutionContext executionContext)
        {
            var mb = CurrentSession.GetValue(Session.SessionKeys.MB) as IMB;

            //若该MB的PCBStatus.Status=0,则报错:“MBSN:XXX已经存在不良,请去修护区修护”
            if (mb.MBStatus.Status == MBStatusEnum.Fail)
            {
                List<string> errpara = new List<string>();
                errpara.Add(mb.Sn);
                throw new FisException("CHK905", errpara);
            }

            //若该MB存在PCBRepair.Status=0的记录,则报错:“请先Key出修护的MB,再刷画面”
            IList<Repair> repairs = new List<Repair>();
            repairs = mb.Repairs;
            foreach (Repair temp in repairs)
            {
                if (temp.Status == Repair.RepairStatus.NotFinished)
                {
                    List<string> errpara = new List<string>();
                    throw new FisException("CHK907", errpara);
                }
            }


            //若该MB的PCBStatus.Station 非(15或者16或者17或者31A或者31或者30),则报错:“MBSN:XXX不该出现在Q区”
            if (!(mb.MBStatus.Station == "15" || mb.MBStatus.Station == "16"
                || mb.MBStatus.Station == "17" || mb.MBStatus.Station == "31A"
                || mb.MBStatus.Station == "31" || mb.MBStatus.Station == "30"))
            {
                List<string> errpara = new List<string>();
                errpara.Add(mb.Sn);
                throw new FisException("CHK906", errpara);
            }


            var mbRepository = RepositoryFactory.GetInstance().GetRepository<IMBRepository, IMB>();

            //[Station] = PCBStatus.Station + ‘  ’ + Station.Descr
            IList<string> stationLst = new List<string>();
            stationLst = mbRepository.GetStationListFromPcbStatus(mb.Sn);
            if (stationLst != null && stationLst.Count > 0)
            {
                CurrentSession.AddValue(Session.SessionKeys.StationDescr, stationLst[0]);
            }
            else
            {
                CurrentSession.AddValue(Session.SessionKeys.StationDescr, "");
            }

            //[LotNo] = Top 1 PCBLot.LotNo where PCBNo=@MBSn and Status=1 order by Cdt desc
            IList<PcblotInfo> lots = new List<PcblotInfo>();
            PcblotInfo cond = new PcblotInfo();
            cond.pcbno = mb.Sn;
            cond.status = "1";
            lots = mbRepository.GetPcblotInfoList(cond);
            if (lots != null && lots.Count > 0)
            {
                CurrentSession.AddValue(Session.SessionKeys.LotNo, lots[0].lotNo);
            }
            else
            {
                CurrentSession.AddValue(Session.SessionKeys.LotNo, "");
            }


            //[PdLine]=PCBStatus.Line + ‘  ’ +Line.Descr
            IList<string> lineLst = new List<string>();
            lineLst = mbRepository.GetLineListFromPcbStatus(mb.Sn);
            if (lineLst != null && lineLst.Count > 0)
            {
                CurrentSession.AddValue(Session.SessionKeys.LineCode, lineLst[0]);
            }
            else
            {
                CurrentSession.AddValue(Session.SessionKeys.LineCode, "");
            }

            //若PCBOQCRepair中存在(Status=0 and PCBNo=@MBSN order by Cdt desc),获取Top 1数据,显示如下:
            IList<PcboqcrepairInfo> repairLst = new List<PcboqcrepairInfo>();
            PcboqcrepairInfo cond1 = new PcboqcrepairInfo();
            cond1.status = "0";
            cond1.pcbno = mb.Sn;
            repairLst = mbRepository.GetPcboqcrepairInfoListOrderByCdtDesc(cond1);
            if (repairLst != null && repairLst.Count > 0)
            {
                CurrentSession.AddValue(Session.SessionKeys.Remark, repairLst[0].remark);
                CurrentSession.AddValue(Session.SessionKeys.RepairDefectID, repairLst[0].id);

                //获取如下数据,显示在Defect List
                //Select * from PCBOQCRepair_DefectInfo where PCBOQCRepairID = @PCBOQCRepairID order by Cdt 
                IList<Pcboqcrepair_DefectinfoInfo> infoLst = new List<Pcboqcrepair_DefectinfoInfo>();
                Pcboqcrepair_DefectinfoInfo cond2 = new Pcboqcrepair_DefectinfoInfo();
                cond2.pcboqcrepairid = repairLst[0].id;
                infoLst = mbRepository.GetPcboqcrepairDefectinfoInfoList(cond2);


                IDefectRepository defectRepository = RepositoryFactory.GetInstance().GetRepository<IDefectRepository, Defect>();
                IList<string> defectLst = new List<string>();
                IList<string> descLst = new List<string>();
                foreach (Pcboqcrepair_DefectinfoInfo temp in infoLst)
                {
                    defectLst.Add(temp.defect);
                    IList<DefectCodeInfo> defectcodeLst = new List<DefectCodeInfo>();
                    DefectCodeInfo cond3 = new DefectCodeInfo();
                    cond3.Defect = temp.defect;
                    defectcodeLst = defectRepository.GetDefectCodeInfoList(cond3);
                    if (defectcodeLst != null && defectcodeLst.Count > 0)
                    {
                        descLst.Add(defectcodeLst[0].Descr);
                    }
                    else
                    {
                        descLst.Add("");
                    }
                }
                CurrentSession.AddValue("DefectLst", defectLst);
                CurrentSession.AddValue("DescLst", descLst);
            }
            else
            {
                IList<string> defectLst = new List<string>();
                IList<string> descLst = new List<string>();
                CurrentSession.AddValue(Session.SessionKeys.Remark, "");
                CurrentSession.AddValue(Session.SessionKeys.RepairDefectID, -1);
                CurrentSession.AddValue("DefectLst", defectLst);
                CurrentSession.AddValue("DescLst", descLst);
            }


            return base.DoExecute(executionContext);
        }
예제 #3
0
        /// <summary>
        /// 插入一条defect数据
        /// </summary>
        /// <param name="dfc"></param>
        public void InsertDefectCode(DefectCodeInfo dfc)
        {
            int count = 0;
            try
            {
                IDefectRepository itemRepository = RepositoryFactory.GetInstance().GetRepository<IDefectRepository>();
                count = itemRepository.CheckExistsRecord(dfc.Defect);
                if (count <= 0)
                {
                    itemRepository.InsertDefectCode(dfc);
                }
                else
                {

                    //已经存在具有相同的defectCode记录
                    List<string> erpara = new List<string>();
                    FisException ex;
                    ex = new FisException("DMT118", erpara);
                    throw ex;
                }
            }
            catch (FisException e)
            {
                logger.Error(e.mErrmsg);
                throw e;
            }
            catch (Exception e)
            {
                logger.Error(e.Message);
                throw;
            }
        }
예제 #4
0
 /// <summary>
 /// 更新一条defect数据
 /// </summary>
 /// <param name="dfc"></param>
 public void UpdateDefectCode(DefectCodeInfo dfc)
 {
     try
     {
         IDefectRepository itemRepository = RepositoryFactory.GetInstance().GetRepository<IDefectRepository>();
         itemRepository.UpdateDefectCode(dfc);
     }
     catch (FisException e)
     {
         logger.Error(e.mErrmsg);
         throw e;
     }
     catch (Exception e)
     {
         logger.Error(e.Message);
         throw;
     }
 }
예제 #5
0
 protected void btnSave_ServerClick(Object sender, EventArgs e)
 {
     try
     {
         string defect = this.txtDefect.Text;
         string oldCode = this.hidCode.Value;
         string type = this.cmdDefectCodeType.SelectedValue;
         DefectCodeInfo dfc = new DefectCodeInfo();
         dfc.Defect = defect;
         dfc.Type = type;
         dfc.Descr = this.txtDescription.Text.ToString().Trim();
         dfc.engDescr = this.txtEngDescr.Text;
         dfc.Editor = this.HiddenUserName.Value.Trim();
         dfc.Udt = DateTime.Now;
         if (defect == oldCode)
         {
             iDefectMaintain.UpdateDefectCode(dfc);
         }
         else
         {
             
             dfc.Cdt = DateTime.Now;
             iDefectMaintain.InsertDefectCode(dfc);
         }
         showList();
         updatePanel.Update();
         defect = replaceSpecialChart(dfc.Defect);
         ScriptManager.RegisterStartupScript(this.updatePanelAll, typeof(System.Object), "save complete", "DealHideWait();AddUpdateComplete('" + defect + "');resetTableHeight()", true);
     }
     catch (FisException ex)
     {
         showErrorMessage(ex.mErrmsg);
         return;
     }
     catch (Exception ex)
     {
         showErrorMessage(ex.Message);
         return;
     }
 }