/// <summary> /// 获取表格内容 /// </summary> public void EditRepairInfo(string productID, RepairInfo repInfo) { logger.Debug("(_RepairInfoImpl)EditRepairInfo starts"); try { UnitOfWork uow = new UnitOfWork(); productRepository.BackupProductRepairDefectInfoDefered(uow, repInfo.Identity, productID, repInfo.editor); repInfo.location = (repInfo.majorPart + " ").Substring(0, 3) + (repInfo.component + " ").Substring(0, 2) + repInfo.site.TrimEnd(); RepairInfo cond = new RepairInfo(); cond.Identity = repInfo.Identity; repInfo.Identity = int.MinValue; productRepository.UpdateProductRepairDefectInfoDefered(uow, repInfo, cond); uow.Commit(); return; } 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("(_RepairInfoImpl)EditRepairInfo end"); } }
public static void setRepairInfo(string proId, RepairInfo rep) { try { ServiceAgent.getInstance().GetObjectByName<IRepairInfo>(WebConstant.RepairInfoObject).EditRepairInfo(proId, rep); return; } catch (Exception ex) { throw ex; } }
/// <summary> /// 添加 KP 维修记录 /// </summary> public int Add(string ctno, RepairInfo repInfo) { logger.Debug("(KPRepairImpl)Add start, CTNO:" + ctno); FisException ex; List<string> erpara = new List<string>(); string sessionKey = ctno; try { Session session = SessionManager.GetInstance.GetSession(sessionKey, SessionType); if (session == null) { erpara.Add(sessionKey); ex = new FisException("CHK021", erpara); throw ex; } RepairDefect defect = GetKPRepairDefect(repInfo); session.AddValue(Session.SessionKeys.CurrentRepairdefect, defect); session.AddValue("isAdd", true); session.Exception = null; session.SwitchToWorkFlow(); //check workflow exception if (session.Exception != null) { if (session.GetValue(Session.SessionKeys.WFTerminated) != null) { session.ResumeWorkFlow(); } throw session.Exception; } return (int)session.GetValue(Session.SessionKeys.RepairTimes); } catch (FisException e) { logger.Error(e.mErrmsg); throw; } catch (Exception e) { logger.Error(e.Message); throw; } finally { logger.Debug("(KPRepairImpl)Add end, CTNO:" + ctno); } }
private string getHideColumn(RepairInfo temp) { StringBuilder builder = new StringBuilder(); string seperator = "\u0003"; builder.Append(temp.id); builder.Append(seperator); builder.Append(temp.repairID); builder.Append(seperator); builder.Append(temp.type); builder.Append(seperator); builder.Append(temp.obligation); builder.Append(seperator); builder.Append(temp.component); builder.Append(seperator); builder.Append(temp.site); builder.Append(seperator); builder.Append(temp.majorPart); builder.Append(seperator); builder.Append(temp.remark); builder.Append(seperator); builder.Append(temp.vendorCT); builder.Append(seperator); builder.Append(temp.partType); builder.Append(seperator); builder.Append(temp.oldPart); builder.Append(seperator); builder.Append(temp.oldPartSno); builder.Append(seperator); builder.Append(temp.newPart); builder.Append(seperator); builder.Append(temp.newPartSno); builder.Append(seperator); builder.Append(temp.manufacture); builder.Append(seperator); builder.Append(temp.versionA); builder.Append(seperator); builder.Append(temp.versionB); builder.Append(seperator); builder.Append(temp.returnSign); builder.Append(seperator); builder.Append(temp.mark); builder.Append(seperator); builder.Append(temp.subDefect); builder.Append(seperator); builder.Append(temp.piaStation); builder.Append(seperator); builder.Append(temp.distribution); builder.Append(seperator); builder.Append(temp._4M); builder.Append(seperator); builder.Append(temp.responsibility); builder.Append(seperator); builder.Append(temp.action); builder.Append(seperator); builder.Append(temp.cover); builder.Append(seperator); builder.Append(temp.uncover); builder.Append(seperator); builder.Append(temp.trackingStatus); builder.Append(seperator); builder.Append(temp.isManual); builder.Append(seperator); builder.Append(temp.editor); builder.Append(seperator); builder.Append(temp.newPartDateCode); builder.Append(seperator); builder.Append(temp.defectCodeID); builder.Append(seperator); builder.Append(temp.cause); //2012-5-4 builder.Append(seperator); builder.Append(temp.location); builder.Append(seperator); builder.Append(temp.mtaID); return builder.ToString(); }
/// <summary> /// 添加 MB 维修记录 /// </summary> /// <param name="mbSno"></param> /// <param name="repInfo">待添加的RepairLogInfo</param> /// <returns>已维修的次数</returns> public int Add(string mbSno, RepairInfo repInfo) { logger.Debug("(PCARepairImpl)Add start, MB_SNo:" + mbSno); FisException ex; List<string> erpara = new List<string>(); string sessionKey = mbSno; try { string location = "MB " + repInfo.component; IMBRepository iMBRepository = RepositoryFactory.GetInstance().GetRepository<IMBRepository>(); int qty = iMBRepository.GetMbRepairCountByLocationAndStation(mbSno, "15", location); if (qty >= 2) { FisException e = new FisException("CQCHK1052", new string[] { }); e.stopWF = false; throw e; } Session session = SessionManager.GetInstance.GetSession(sessionKey, MBSessionType); if (session == null) { erpara.Add(sessionKey); ex = new FisException("CHK021", erpara); //ex.logErr("", "", "", "", "83"); //logger.Error(ex); throw ex; } RepairDefect defect = GetMBRepairDefect(repInfo); session.AddValue(Session.SessionKeys.CurrentRepairdefect, defect); session.AddValue(Session.SessionKeys.MaintainAction, 0); session.Exception = null; session.SwitchToWorkFlow(); //check workflow exception if (session.Exception != null) { if (session.GetValue(Session.SessionKeys.WFTerminated) != null) { session.ResumeWorkFlow(); } throw session.Exception; } return (int)session.GetValue(Session.SessionKeys.RepairTimes); } catch (FisException e) { logger.Error(e.mErrmsg); throw; } catch (Exception e) { logger.Error(e.Message); throw; } finally { logger.Debug("(PCARepairImpl)Add end, MB_SNo:" + mbSno); } }
private RepairDefect getOQCRepairDefect(RepairInfo repairLogInfo) { RepairDefect defect = new RepairDefect(); defect.ID = string.IsNullOrEmpty(repairLogInfo.id) ? 0 : int.Parse(repairLogInfo.id); defect._4M = repairLogInfo._4M; defect.Action = repairLogInfo.action; defect.Cause = repairLogInfo.cause; defect.Cdt = repairLogInfo.cdt; defect.Component = repairLogInfo.component; defect.Cover = repairLogInfo.cover; defect.DefectCodeID = repairLogInfo.defectCodeID; defect.Distribution = repairLogInfo.distribution; defect.Editor = repairLogInfo.editor; defect.IsManual = (!string.IsNullOrEmpty(repairLogInfo.isManual) && repairLogInfo.isManual.Equals("1")) ? true : false; defect.MajorPart = repairLogInfo.majorPart; defect.Manufacture = repairLogInfo.manufacture; defect.Mark = repairLogInfo.mark; defect.NewPart = repairLogInfo.newPart; defect.NewPartSno = repairLogInfo.newPartSno; defect.Obligation = repairLogInfo.obligation; defect.OldPart = repairLogInfo.oldPart; defect.OldPartSno = repairLogInfo.oldPartSno; defect.PartType = repairLogInfo.partType; defect.PIAStation = repairLogInfo.piaStation; defect.Remark = repairLogInfo.remark; defect.RepairID = string.IsNullOrEmpty(repairLogInfo.repairID) ? 0 : int.Parse(repairLogInfo.repairID); defect.Responsibility = repairLogInfo.responsibility; defect.ReturnSign = repairLogInfo.returnSign; defect.Site = repairLogInfo.site; defect.SubDefect = repairLogInfo.subDefect; defect.TrackingStatus = repairLogInfo.trackingStatus; defect.Type = repairLogInfo.type; defect.Udt = repairLogInfo.udt; defect.Uncover = repairLogInfo.uncover; defect.VendorCT = repairLogInfo.vendorCT; defect.VersionA = repairLogInfo.versionA; defect.VersionB = repairLogInfo.versionB; defect.NewPartDateCode = repairLogInfo.newPartDateCode; //2012-5-4 defect.Location = repairLogInfo.location; defect.MTAID = repairLogInfo.mtaID; return defect; }
//2012-8-1, Jessica Liu, 需求变更:增加Return Station 计算逻辑, 修改解DN条件 /// <summary> /// GetReturnStation /// </summary> /// <param name="code"></param> /// <param name="preStn"></param> /// <param name="station"></param> /// <param name="cause"></param> /// <returns></returns> public IList<DefectCodeStationInfo> GetReturnStation(int id, string code, string preStn, string station, string cause) { var stationRepository = RepositoryFactory.GetInstance().GetRepository<IMES.FisObject.Common.Station.IStationRepository, IMES.FisObject.Common.Station.IStation>(); var productRepository = RepositoryFactory.GetInstance().GetRepository<IProductRepository, IProduct>(); DefectCodeStationInfo cond = new DefectCodeStationInfo(); IList<DefectCodeStationInfo> info = null; cond.defect = code; cond.pre_stn = preStn; cond.crt_stn = station; cond.cause = cause; info = stationRepository.GetDefectCodeStationList(cond); if (info != null && info.Count > 0) { RepairInfo setValue = new RepairInfo(); RepairInfo c1 = new RepairInfo(); c1.Identity = id; setValue.returnStation = info[0].nxt_stn; productRepository.UpdateProductRepairDefectInfo(setValue, c1); } else { DefectCodeStationInfo cond1 = new DefectCodeStationInfo(); IList<DefectCodeStationInfo> info1 = null; cond1.defect = code; cond1.pre_stn = preStn; cond.crt_stn = station; info1 = stationRepository.GetDefectCodeStationList(cond1); if (info1 != null && info1.Count > 0) { RepairInfo setValue = new RepairInfo(); RepairInfo c1 = new RepairInfo(); c1.Identity = id; setValue.returnStation = info[0].nxt_stn; productRepository.UpdateProductRepairDefectInfo(setValue, c1); } else { List<string> errpara = new List<string>(); FisException e = new FisException("CHK830", errpara); throw e; } } return info; }
/// <summary> /// Delete Repair logs /// </summary> /// <param name="prodId">Product Id</param> /// <param name="rll">删除的Repair logs</param> public void Delete(string prodId, RepairInfo rll) { //FisException ex; //List<string> erpara = new List<string>(); //string sessionKey = prodId; //try //{ // Session session = SessionManager.GetInstance.GetSession(sessionKey, ProductSessionType); // if (session == null) // { // erpara.Add(sessionKey); // ex = new FisException("CHK021", erpara); // //ex.logErr("", "", "", "", "83"); // //logger.Error(ex); // throw ex; // } // else // { // RepairDefect defect = getMBRepairDefect(rll); // //session.AddValue(Session.SessionKeys.RepairDefectID, repairLogId); // session.AddValue(Session.SessionKeys.MaintainAction, "2"); // session.Exception = null; // session.SwitchToWorkFlow(); // //check workflow exception // if (session.Exception != null) // { // if (session.GetValue(Session.SessionKeys.WFTerminated) != null) // { // session.ResumeWorkFlow(); // } // throw session.Exception; // } // } //} //catch (FisException e) //{ // throw e; //} //catch (Exception e) //{ // throw e; //} //finally //{ } }
private string GetDefectComponentID(IProduct prod, RepairInfo repairInfo) { IMiscRepository miscRep = RepositoryFactory.GetInstance().GetRepository<IMiscRepository>(); string OldPartSno = repairInfo.oldPartSno; int RepadirID = int.Parse(repairInfo.repairID); IList<string> lstProdPartSN = prod.ProductParts.Select(x => x.PartSn).ToList(); //IProductPart pp = null; DefectComponentInfo condQuery = new DefectComponentInfo(); condQuery.PartSn = OldPartSno; IList<string> lstPartSN = new List<string>(); lstPartSN.Add(OldPartSno); IList<DefectComponentInfo> lstDefectComponent = miscRep.GetDataByList<IMES.Infrastructure.Repository._Metas.DefectComponent, DefectComponentInfo>(condQuery, "PartSn", lstPartSN); DefectComponentInfo dc = null; if (null != lstDefectComponent) lstDefectComponent = lstDefectComponent.Where(x => x.RepairID == RepadirID).ToList(); if (null != lstDefectComponent && lstDefectComponent.Count > 0) { dc = lstDefectComponent[0]; return dc.ID.ToString(); } return ""; }
private string getHideColumn(RepairInfo temp) { StringBuilder builder = new StringBuilder(); string seperator = "\u0003"; builder.Append(temp.id); builder.Append(seperator); builder.Append(temp.repairID); builder.Append(seperator); builder.Append(temp.type); builder.Append(seperator); builder.Append(temp.obligation); builder.Append(seperator); builder.Append(temp.component); builder.Append(seperator); builder.Append(temp.site); builder.Append(seperator); builder.Append(temp.majorPart); builder.Append(seperator); /* * Answer to: ITC-1360-0240 * Description: Change and recover character "<NL>" in remark. */ builder.Append(temp.remark.Replace("\r\n", "___M_NL___")); builder.Append(seperator); builder.Append(temp.vendorCT); builder.Append(seperator); builder.Append(temp.partType); builder.Append(seperator); builder.Append(temp.oldPart); builder.Append(seperator); builder.Append(temp.oldPartSno); builder.Append(seperator); builder.Append(temp.newPart); builder.Append(seperator); builder.Append(temp.newPartSno); builder.Append(seperator); builder.Append(temp.manufacture); builder.Append(seperator); builder.Append(temp.versionA); builder.Append(seperator); builder.Append(temp.versionB); builder.Append(seperator); builder.Append(temp.returnSign); builder.Append(seperator); builder.Append(temp.mark); builder.Append(seperator); builder.Append(temp.subDefect); builder.Append(seperator); builder.Append(temp.piaStation); builder.Append(seperator); builder.Append(temp.distribution); builder.Append(seperator); builder.Append(temp._4M); builder.Append(seperator); builder.Append(temp.responsibility); builder.Append(seperator); builder.Append(temp.action); builder.Append(seperator); builder.Append(temp.cover); builder.Append(seperator); builder.Append(temp.uncover); builder.Append(seperator); builder.Append(temp.trackingStatus); builder.Append(seperator); builder.Append(temp.isManual); builder.Append(seperator); builder.Append(temp.editor); builder.Append(seperator); builder.Append(temp.newPartDateCode); builder.Append(seperator); builder.Append(temp.defectCodeID); builder.Append(seperator); builder.Append(temp.cause); //2010-03-20 add side builder.Append(seperator); builder.Append(temp.side); return builder.ToString(); }
/// <summary> /// Add Repair logs /// </summary> /// <param name="prodId">Product Id</param> /// <param name="rll">新增的Repair Log</param> public void Add(string prodId, string macValue, RepairInfo rll, string repairStation) { logger.Debug("(FARepairImpl)Add start, [prodId]:" + prodId + " [rll]: " + rll); FisException ex; List<string> erpara = new List<string>(); string sessionKey = prodId; try { Session session = SessionManager.GetInstance.GetSession(sessionKey, Session.SessionType.Product); if (session == null) { erpara.Add(sessionKey); ex = new FisException("CHK021", erpara); throw ex; } else { RepairDefect defect = getFARepairDefect(rll); #region get next station IProduct productObj = (IProduct)session.GetValue(Session.SessionKeys.Product); var stationRepository = RepositoryFactory.GetInstance().GetRepository<IMES.FisObject.Common.Station.IStationRepository, IMES.FisObject.Common.Station.IStation>(); //IList<DefectCodeNextStationInfo> nextStationList = stationRepository.GetNextStationFromDefectStation(productObj.Status.StationId, // repairStation, // string.IsNullOrEmpty(defect.MajorPart) ? string.Empty : defect.MajorPart.Trim(), // string.IsNullOrEmpty(defect.Cause) ? string.Empty : defect.Cause.Trim(), // string.IsNullOrEmpty(defect.DefectCodeID) ? string.Empty : defect.DefectCodeID.Trim()); IList<DefectCodeNextStationInfo> nextStationList = stationRepository.GetNextStationFromDefectStation(productObj.Status.StationId, repairStation, string.IsNullOrEmpty(defect.MajorPart) ? string.Empty : defect.MajorPart.Trim(), string.IsNullOrEmpty(defect.Cause) ? string.Empty : defect.Cause.Trim(), string.IsNullOrEmpty(defect.DefectCodeID) ? string.Empty : defect.DefectCodeID.Trim(), productObj.Family, productObj.Model); if (nextStationList == null || nextStationList.Count == 0) { List<string> errpara = new List<string>(); FisException e = new FisException("CHK950", errpara); throw e; } defect.ReturnStation = nextStationList[0].NXT_STN; #endregion defect.Location = (defect.MajorPart + " ").Substring(0, 3) + (defect.Component + " ").Substring(0, 2) + defect.Site.TrimEnd(); session.AddValue(Session.SessionKeys.CurrentRepairdefect, defect); session.AddValue(Session.SessionKeys.MaintainAction, 0); session.AddValue(Session.SessionKeys.MAC, macValue); session.Exception = null; session.SwitchToWorkFlow(); //check workflow exception if (session.Exception != null) { if (session.GetValue(Session.SessionKeys.WFTerminated) != null) { session.ResumeWorkFlow(); } throw session.Exception; } } } catch (FisException e) { logger.Error(e.mErrmsg); throw e; } catch (Exception e) { logger.Error(e.Message); throw e; } finally { logger.Debug("(FARepairImpl)Add end, [prodId]:" + prodId + " [rll]: " + rll); } }
void CreateDefectComponentInfo(DefectComponentInfo v, RepairInfo ri, IProduct prod, IProductPart pp, string OldPart, string PartType, string BomNodeType, string IECPn, string CheckItemType) { v.RepairID = int.Parse(ri.repairID); v.BatchID = ""; //remark v.Customer = this.Customer; v.Model = prod.Model; v.Family = prod.Family == null ? "" : prod.Family; v.DefectCode = ri.defectCodeID; v.DefectDescr = ri.defectCodeDesc == null ? "" : ri.defectCodeDesc; v.ReturnLine = ""; v.PartSn = ri.oldPartSno; v.PartNo = OldPart; v.PartType = PartType; v.BomNodeType = BomNodeType; v.IECPn = IECPn; v.CustomerPn = ""; v.Vendor = ""; v.CheckItemType = CheckItemType; v.Comment = ""; v.Status = this.Status; v.Editor = this.Editor; v.Cdt = DateTime.Now; v.Udt = DateTime.Now; }
/// <summary> /// 获取指定的维修记录 /// </summary> public RepairInfo GetDefectInfo(int id) { logger.Debug("(_RepairInfoImpl)GetDefectInfo starts"); try { RepairInfo cond = new RepairInfo(); cond.Identity = id; IList<RepairInfo> diList = productRepository.GetProductRepairDefectInfo(cond); if (diList.Count == 1) { return diList[0]; } else { return null; } } 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("(_RepairInfoImpl)GetDefectInfo end"); } }
/// <summary> /// 1.2 UC-PCA-PCAR-02 Edit /// 修改指定的MB 维修记录 /// </summary> /// <param name="log">被修改的RepairLogInfo</param> /// <param name="editor">operator</param> /// <returns>已维修的次数</returns> public int Edit( string MB_SNo, RepairInfo log, string editor, string stationId, string customer) { logger.Debug("(PCARepairImpl)Edit start, MB_SNo:" + MB_SNo); FisException ex; List<string> erpara = new List<string>(); string sessionKey = MB_SNo; try { Session session = SessionManager.GetInstance.GetSession(sessionKey, MBSessionType); if (session == null) { erpara.Add(sessionKey); ex = new FisException("CHK021", erpara); //ex.logErr("", "", "", "", "83"); //logger.Error(ex); throw ex; } else { RepairDefect defect = getMBRepairDefect(log); session.AddValue(Session.SessionKeys.CurrentRepairdefect, defect); session.AddValue(Session.SessionKeys.MaintainAction, 1); session.Exception = null; session.SwitchToWorkFlow(); //check workflow exception if (session.Exception != null) { if (session.GetValue(Session.SessionKeys.WFTerminated) != null) { session.ResumeWorkFlow(); } throw session.Exception; } return (int) session.GetValue(Session.SessionKeys.RepairTimes); } } catch (FisException e) { logger.Error(e.mErrmsg); throw e; } catch (Exception e) { logger.Error(e.Message); throw e; } finally { logger.Debug("(PCARepairImpl)Edit end, MB_SNo:" + MB_SNo); } }
public ArrayList SaveFaultPartSno(string defectId, string prodId, RepairInfo rll, string line, string editor, string station, string customer) { string methodName = System.Reflection.MethodBase.GetCurrentMethod().Name; logger.DebugFormat("BEGIN: {0}(prodId:{1})", methodName, prodId); try { ArrayList retLst = new ArrayList(); string sessionKey = prodId; Dictionary<string,object> sessionKeyValueList = new Dictionary<string,object>(); Session currentSession = null; string wfName = "FARepairAddEdit_SaveFaultPartSno.xoml"; string wfRule = ""; sessionKeyValueList.Add(IMES.Infrastructure.Session.SessionKeys.IsComplete, true); sessionKeyValueList.Add("OldPartSn", rll.oldPartSno); sessionKeyValueList.Add("RepairInfo", rll); sessionKeyValueList.Add("DefectId", defectId); //executing workflow, if fail then throw error currentSession = WorkflowUtility.InvokeWF(sessionKey, station, line, customer, editor, Session.SessionType.Common, wfName, wfRule, sessionKeyValueList); IProduct prod = currentSession.GetValue(Session.SessionKeys.Product) as IProduct; string DefectComponentID = GetDefectComponentID(prod, rll); retLst.Add(DefectComponentID); return retLst; } 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.DebugFormat("END: {0}()", methodName); } }
/// <summary> /// 添加 MB 维修记录 /// </summary> /// <param name="mbSno"></param> /// <param name="repInfo">待添加的RepairLogInfo</param> /// <returns>已维修的次数</returns> public int Add(string mbSno, RepairInfo repInfo) { logger.Debug("(PCARepairImpl)Add start, MB_SNo:" + mbSno); FisException ex; List<string> erpara = new List<string>(); string sessionKey = mbSno; try { Session session = SessionManager.GetInstance.GetSession(sessionKey, MBSessionType); if (session == null) { erpara.Add(sessionKey); ex = new FisException("CHK021", erpara); //ex.logErr("", "", "", "", "83"); //logger.Error(ex); throw ex; } RepairDefect defect = GetMBRepairDefect(repInfo); session.AddValue(Session.SessionKeys.CurrentRepairdefect, defect); session.AddValue(Session.SessionKeys.MaintainAction, 0); session.Exception = null; session.SwitchToWorkFlow(); //check workflow exception if (session.Exception != null) { if (session.GetValue(Session.SessionKeys.WFTerminated) != null) { session.ResumeWorkFlow(); } throw session.Exception; } return (int)session.GetValue(Session.SessionKeys.RepairTimes); } catch (FisException e) { logger.Error(e.mErrmsg); throw; } catch (Exception e) { logger.Error(e.Message); throw; } finally { logger.Debug("(PCARepairImpl)Add end, MB_SNo:" + mbSno); } }
private RepairDefect GetMBRepairDefect(RepairInfo repairLogInfo) { RepairDefect defect = new RepairDefect(); defect.ID = string.IsNullOrEmpty(repairLogInfo.id) ? 0 : int.Parse(repairLogInfo.id); defect._4M = repairLogInfo._4M; defect.Action = repairLogInfo.action; defect.Cause = repairLogInfo.cause; defect.Cdt = repairLogInfo.cdt; defect.Component = repairLogInfo.component; defect.Cover = repairLogInfo.cover; defect.DefectCodeID = repairLogInfo.defectCodeID; defect.Distribution = repairLogInfo.distribution; defect.Editor = repairLogInfo.editor; defect.IsManual = (!string.IsNullOrEmpty(repairLogInfo.isManual) && repairLogInfo.isManual.Equals("1")); defect.MajorPart = repairLogInfo.majorPart; defect.Manufacture = repairLogInfo.manufacture; defect.Mark = repairLogInfo.mark; defect.NewPart = repairLogInfo.newPart; defect.NewPartSno = repairLogInfo.newPartSno; defect.Obligation = repairLogInfo.obligation; defect.OldPart = repairLogInfo.oldPart; defect.OldPartSno = repairLogInfo.oldPartSno; defect.PartType = repairLogInfo.partType; defect.PIAStation = repairLogInfo.piaStation; defect.Remark = repairLogInfo.remark; defect.RepairID = string.IsNullOrEmpty(repairLogInfo.repairID) ? 0 : int.Parse(repairLogInfo.repairID); defect.Responsibility = repairLogInfo.responsibility; defect.ReturnSign = repairLogInfo.returnSign; defect.Site = repairLogInfo.site; defect.SubDefect = repairLogInfo.subDefect; defect.TrackingStatus = repairLogInfo.trackingStatus; defect.Type = repairLogInfo.type; defect.Udt = repairLogInfo.udt; defect.Uncover = repairLogInfo.uncover; defect.VendorCT = repairLogInfo.vendorCT; defect.VersionA = repairLogInfo.versionA; defect.VersionB = repairLogInfo.versionB; defect.NewPartDateCode = repairLogInfo.newPartDateCode; //ITC-1103-0143 Tong.Zhi-Yong 2010-01-31 //defect.Location = repairLogInfo.component + repairLogInfo.site; /* * Answer to: ITC-1414-0155,ITC-1414-0156 * Description: UC updated. */ defect.Location = (repairLogInfo.majorPart + " ").Substring(0, 3) + (repairLogInfo.component + " ").Substring(0, 2) + repairLogInfo.site.TrimEnd(); defect.Side = repairLogInfo.side; return defect; }
/// <summary> /// Add Repair logs /// </summary> /// <param name="prodId">Product Id</param> /// <param name="rll">新增的Repair Log</param> public void Add(string prodId, RepairInfo rll) { logger.Debug("(OQCRepairImpl)Add start, [prodId]:" + prodId + " [rll]: " + rll); FisException ex; List<string> erpara = new List<string>(); string sessionKey = prodId; try { Session session = SessionManager.GetInstance.GetSession(sessionKey, ProductSessionType); if (session == null) { erpara.Add(sessionKey); ex = new FisException("CHK021", erpara); //ex.logErr("", "", "", "", "83"); //logger.Error(ex); throw ex; } else { RepairDefect defect = getOQCRepairDefect(rll); session.AddValue(Session.SessionKeys.CurrentRepairdefect, defect); session.AddValue(Session.SessionKeys.MaintainAction, 0); session.Exception = null; session.SwitchToWorkFlow(); //check workflow exception if (session.Exception != null) { if (session.GetValue(Session.SessionKeys.WFTerminated) != null) { session.ResumeWorkFlow(); } throw session.Exception; } } } catch (FisException e) { logger.Error(e.mErrmsg); throw e; } catch (Exception e) { logger.Error(e.Message); throw e; } finally { logger.Debug("(OQCRepairImpl)Add end, [prodId]:" + prodId + " [rll]: " + rll); } }