public Hashtable Resolve(Dictionary <string, string[]> paramList) { Hashtable dict = new Hashtable(); //组装成为还有复杂类型的Hashtable foreach (KeyValuePair <string, string[]> tableRow in paramList) { object rowObj = IRAPJsonSerializer.Deserializer(tableRow.Value[0], tableRow.Value[1]); dict.Add(tableRow.Key, rowObj); } return(dict); }
/// <summary> /// 计算 QCStatus 的值 /// </summary> /// <param name="communityID">社区标识</param> /// <param name="t102LeafID">产品叶标识</param> /// <param name="t107LeafID">工位叶标识</param> /// <param name="pwoNo">工单号</param> /// <param name="qcStatus">质量控制状态</param> private long CalculateQCStatus( int communityID, int t102LeafID, int t107LeafID, string pwoNo, long qcStatus) { string strProcedureName = string.Format( "{0}.{1}", className, MethodBase.GetCurrentMethod().Name); WriteLog.Instance.WriteBeginSplitter(strProcedureName); try { int errCode = 0; string errText = ""; QC qc = new QC(); try { IRAPJsonResult rlt = qc.ufn_GetQCCheckPointOrdinal( communityID, t102LeafID, t107LeafID, pwoNo, out errCode, out errText); int qcCheckPointOrdinal = (int)IRAPJsonSerializer.Deserializer( rlt.Json, typeof(int)); if (errCode == 0) { qcStatus = qcStatus | Int64.Parse(Math.Pow(2, (23 + qcCheckPointOrdinal)).ToString()); } } catch (Exception error) { WriteLog.Instance.Write(error.Message, strProcedureName); } return(qcStatus); } finally { WriteLog.Instance.WriteEndSplitter(strProcedureName); } }
/// <summary> /// 根据工位呼叫安灯记录计算工位停产时间(秒) /// </summary> /// <param name="t107LeafID">工位叶标识</param> /// <param name="periodBegin">期间开始时间</param> /// <param name="periodEnd">期间结束时间</param> /// <returns>long</returns> private long ufn_GetUnscheduledPDTofAWorkUnit( int communityID, int t107LeafID, DateTime periodBegin, DateTime periodEnd, long sysLogID) { string strProcedureName = string.Format( "{0}.{1}", className, MethodBase.GetCurrentMethod().Name); WriteLog.Instance.WriteBeginSplitter(strProcedureName); try { int errCode = 0; string errText = ""; WorkUnit workUnit = new WorkUnit(); try { IRAPJsonResult rlt = workUnit.ufn_GetUnscheduledPDTofAWorkUnit( communityID, t107LeafID, periodBegin, periodEnd, sysLogID, out errCode, out errText); return((long)IRAPJsonSerializer.Deserializer(rlt.Json, typeof(long))); } catch (Exception error) { WriteLog.Instance.Write(error.Message, strProcedureName); return(0); } } finally { WriteLog.Instance.WriteEndSplitter(strProcedureName); } }
/// <summary> /// 获取指定在制品经过指定工位的次数 /// </summary> /// <param name="t102LeafID">产品叶标识</param> /// <param name="t107LeafID">工位叶标识</param> /// <param name="wipCode">在制品主标识代码</param> private int ufn_GetWIPPassByTimes( int communityID, int t102LeafID, int t107LeafID, string wipCode) { string strProcedureName = string.Format( "{0}.{1}", className, MethodBase.GetCurrentMethod().Name); WriteLog.Instance.WriteBeginSplitter(strProcedureName); try { int errCode = 0; string errText = ""; WIP wip = new WIP(); try { IRAPJsonResult rlt = wip.ufn_GetWIPPassByTimes( communityID, t102LeafID, t107LeafID, wipCode, out errCode, out errText); return((int)IRAPJsonSerializer.Deserializer(rlt.Json, typeof(int))); } catch (Exception error) { WriteLog.Instance.Write(error.Message, strProcedureName); return(0); } } finally { WriteLog.Instance.WriteEndSplitter(strProcedureName); } }
/// <summary> /// 获取工序标准周期时间 /// </summary> /// <param name="t102LeafID">产品叶标识</param> /// <param name="t107LeafID">工位叶标识</param> private long ufn_GetStdCycleTimeOfOperation( int communityID, int t102LeafID, int t107LeafID) { string strProcedureName = string.Format( "{0}.{1}", className, MethodBase.GetCurrentMethod().Name); WriteLog.Instance.WriteBeginSplitter(strProcedureName); try { int errCode = 0; string errText = ""; IRAPMDM mdm = new IRAPMDM(); try { IRAPJsonResult rlt = mdm.ufn_GetStdCycleTimeOfOperation( communityID, t102LeafID, t107LeafID, out errCode, out errText); return((long)IRAPJsonSerializer.Deserializer(rlt.Json, typeof(long))); } catch (Exception error) { WriteLog.Instance.Write(error.Message, strProcedureName); return(0); } } finally { WriteLog.Instance.WriteEndSplitter(strProcedureName); } }
public static object GetObj(IRAPJsonResult param) { object obj = IRAPJsonSerializer.Deserializer(param.Json, param.TypeName); return(obj); }
public IRAPJsonResult Json(object obj) { IRAPJsonResult res = new IRAPJsonResult(IRAPJsonSerializer.Serializer(obj), obj.GetType().FullName); return(res); }
public string[] JsonArray(object obj) { // IRAPJsonSerializer.Serializer(obj), obj.GetType().FullName); return(new string [] { IRAPJsonSerializer.Serializer(obj), obj.GetType().FullName }); }
/// <summary> /// 获取用于人工检查的在制品以及子在制品信息 /// </summary> /// <param name="communityID">社区标识</param> /// <param name="wipIDCode">在制品标识</param> /// <param name="productLeaf">当前选中产品叶标识</param> /// <param name="workUnitLeaf">当前选中工位叶标识</param> /// <param name="isEnhanced">是否增强</param> /// <param name="sysLogID">系统登录标识</param> /// <returns>Inspecting</returns> public IRAPJsonResult mfn_GetInfo_WIPIDCode( int communityID, string wipIDCode, int productLeaf, int workUnitLeaf, bool isEnhanced, long sysLogID, out int errCode, out string errText) { string strProcedureName = string.Format( "{0}.{1}", className, MethodBase.GetCurrentMethod().Name); WriteLog.Instance.WriteBeginSplitter(strProcedureName); try { Inspecting inspectingObject = new Inspecting(); IRAPJsonResult jsonResult = ufn_GetInfo_WIPIDCode( communityID, wipIDCode, productLeaf, workUnitLeaf, isEnhanced, sysLogID, out errCode, out errText); if (errCode == 0) { WIPIDCode wip = IRAPJsonSerializer.Deserializer( jsonResult.Json, typeof(WIPIDCode)) as WIPIDCode; inspectingObject.MainWIPIDCode = wip; if (wip.BarcodeStatus == 0 && wip.RoutingStatus == 0) { jsonResult = ufn_GetList_SubWIPIDCodes( communityID, wip.WIPCode, productLeaf, workUnitLeaf, sysLogID, out errCode, out errText); if (errCode == 0) { List <SubWIPIDCodeInfo> subWIPs = IRAPJsonSerializer.Deserializer( jsonResult.Json, typeof(List <SubWIPIDCodeInfo>)) as List <SubWIPIDCodeInfo>; foreach (SubWIPIDCodeInfo subWIP in subWIPs) { inspectingObject.SubWIPIDCodes.Add( new SubWIPIDCodeInfo_Inspecting() { Ordinal = subWIP.Ordinal, T102LeafID = subWIP.T102LeafID, ProductNo = subWIP.ProductNo, SubWIPGroupID = subWIP.SubWIPGroupID, SubWIPIDCode = subWIP.SubWIPIDCode, Scrapped = subWIP.Scrapped, PWOCategoryLeaf = subWIP.PWOCategoryLeaf, }); } } } } return(Json(inspectingObject)); } catch (Exception error) { errCode = 99000; errText = error.Message; WriteLog.Instance.Write(errText, strProcedureName); WriteLog.Instance.Write(error.StackTrace, strProcedureName); return(Json(new Inspecting())); } finally { WriteLog.Instance.WriteEndSplitter(strProcedureName); } }