private string Para_18X01_ToXml(ParaParent para) { Vehicle_18X01_Para m_18X01_Papa = (Vehicle_18X01_Para)para; ModelReflection mR = new ModelReflection(); string strRet = mR.ParaModelToXML(m_18X01_Papa, "QueryCondition"); return(strRet); }
private Vehicle_18X01_Para Para_18X01_ToModel(ParaParent para, string strParaContent) { Vehicle_18X01_Para m_para = (Vehicle_18X01_Para)para; ModelReflection mR = new ModelReflection(); m_para = mR.ParaSetModelValue(m_para, "QueryCondition", strParaContent); return(m_para); }
public Vehicle_18J80_Result AJ_Read_18J80(Vehicle_18J80_Para para) { Vehicle_18J80_Result aj_18J80_Result = new Vehicle_18J80_Result(); AJ_IRead aj_18J80 = new AJ_Read_WebServices(); AdapterHelper adapter = new AdapterHelper(); #if RZLD string[] strAryJYXM; if (para.jyxm.Contains(",")) { strAryJYXM = para.jyxm.Split(','); } else { strAryJYXM = new string[1]; strAryJYXM[0] = para.jyxm; } Vehicle_18X01_Para m_18X01_Para = null; Vehicle_18X02_Para m_18X02_Para = null; Vehicle_18X03_Para m_18X03_Para = null; if (strAryJYXM.Contains("F1")) { m_18X01_Para = new Vehicle_18X01_Para("18X01", para.jkxlh, para.xtlb); m_18X01_Para.cllx = para.cllx; m_18X01_Para.clsbdh = para.clsbdh; m_18X01_Para.hphm = para.hphm; m_18X01_Para.hpzl = para.hpzl; m_18X01_Para.jycs = para.jycs; m_18X01_Para.jyjgbh = para.jyjgbh; m_18X01_Para.jylsh = para.jylsh; } if (strAryJYXM.Contains("C1")) { m_18X02_Para = new Vehicle_18X02_Para("18X02", para.jkxlh, para.xtlb); m_18X02_Para.cllx = para.cllx; m_18X02_Para.clsbdh = para.clsbdh; m_18X02_Para.hphm = para.hphm; m_18X02_Para.hpzl = para.hpzl; m_18X02_Para.jycs = para.jycs; m_18X02_Para.jyjgbh = para.jyjgbh; m_18X02_Para.jylsh = para.jylsh; } if (strAryJYXM.Contains("DC")) { m_18X03_Para = new Vehicle_18X03_Para("18X03", para.jkxlh, para.xtlb); m_18X03_Para.cllx = para.cllx; m_18X03_Para.clsbdh = para.clsbdh; m_18X03_Para.hphm = para.hphm; m_18X03_Para.hpzl = para.hpzl; m_18X03_Para.jycs = para.jycs; m_18X03_Para.jyjgbh = para.jyjgbh; m_18X03_Para.jylsh = para.jylsh; } Func <object, ResultParent> action = (object obj) => { ResultParent result = null; if (obj is Vehicle_18X01_Para && m_18X01_Para != null) { result = aj_18J80.Read_18X01(m_18X01_Para); } else if (obj is Vehicle_18X02_Para && m_18X02_Para != null) { //result = aj_18J80.Read_18X02(m_18X02_Para); } else if (obj is Vehicle_18X03_Para && m_18X03_Para != null) { result = aj_18J80.Read_18X03(m_18X03_Para); } return(result); }; Task <ResultParent> tk_18X01 = Task.Factory.StartNew(action, m_18X01_Para); Task <ResultParent> tk_18X02 = Task.Factory.StartNew(action, m_18X02_Para); Task <ResultParent> tk_18X03 = Task.Factory.StartNew(action, m_18X03_Para); Task <ResultParent>[] tasks = new Task <ResultParent>[3] { tk_18X01, tk_18X02, tk_18X03 }; Task.WaitAll(tasks); aj_18J80_Result.jkid = para.jkid; aj_18J80_Result.jkxlh = para.jkxlh; aj_18J80_Result.xtlb = para.xtlb; bool bIsSuc = true; for (int i = 0; i < 3; i++) { var vResult = tasks[i].Result; if (vResult != null) { if (vResult is Vehicle_18X01_Result) { Vehicle_18X01_Result m_18X01_Result = (Vehicle_18X01_Result)vResult; aj_18J80_Result.rgjybhgx = adapter.UpdateWJDP_Net_To_IY(m_18X01_Result.pre_GaWjfjx); aj_18J80_Result.rgjybjcx = adapter.UpdateWJDP_Net_To_IY(m_18X01_Result.pre_GawjPbx); aj_18J80_Result.wgjcczy = m_18X01_Result.ass_wjy; if (m_18X01_Result.code != "1") { aj_18J80_Result.message = " 外检失败 "; bIsSuc = false; } else { if (string.IsNullOrEmpty(m_18X01_Result.ass_wjy)) { bIsSuc = false; aj_18J80_Result.message = " 外检未检 "; } else { aj_18J80_Result.message = " 外检成功 "; } } } else if (vResult is Vehicle_18X02_Result) { Vehicle_18X02_Result m_18X02_Result = (Vehicle_18X02_Result)vResult; aj_18J80_Result.dgjybhgx = adapter.UpdateWJDP_Net_To_IY(m_18X02_Result.pre_GaDjfjx); aj_18J80_Result.dgjybjcx = adapter.UpdateWJDP_Net_To_IY(m_18X02_Result.pre_GaDjpbx); aj_18J80_Result.dpbjczy = m_18X02_Result.ass_xfjcy; if (m_18X02_Result.code != "1") { bIsSuc = false; aj_18J80_Result.message += " 底盘部件失败 "; } else { if (string.IsNullOrEmpty(m_18X02_Result.ass_xfjcy)) { bIsSuc = false; aj_18J80_Result.message += " 底盘部件未检 "; } else { aj_18J80_Result.message += " 底盘部件成功 "; } } } else if (vResult is Vehicle_18X03_Result) { Vehicle_18X03_Result m_18X03_Result = (Vehicle_18X03_Result)vResult; aj_18J80_Result.dgjybhgx += adapter.UpdateWJDP_Net_To_IY(m_18X03_Result.pre_GaDpdtfjx); aj_18J80_Result.dgjybjcx += adapter.UpdateWJDP_Net_To_IY(m_18X03_Result.pre_GaDpdtpbx); aj_18J80_Result.dtdpczy = m_18X03_Result.diPDTJCY; if (m_18X03_Result.code != "1") { bIsSuc = false; aj_18J80_Result.message += " 动态底盘失败 "; } else { if (string.IsNullOrEmpty(m_18X03_Result.diPDTJCY)) { bIsSuc = false; aj_18J80_Result.message += " 动态底盘未检 "; } else { aj_18J80_Result.message += " 动态底盘成功 "; } } } } } aj_18J80_Result.code = bIsSuc ? "1" : "0"; #endif return(aj_18J80_Result); }
public Vehicle_18X01_Result Read_18X01(Vehicle_18X01_Para para) { Vehicle_18X01_Result m_Vehicle_18X01_Result = new Vehicle_18X01_Result(); try { //ModelToXML AJ_ModelToXML modelToXml = new AJ_ModelToXML(); string strQueryXmlDoc = modelToXml.ModelToXml("18X01", para); #region 填充联网公司接口 string strResult = ""; #if RZLD var client = new VehicleForNetWebService.DataService.DataServicePortTypeClient(); #elif BJXY var client = new VehicleForNetWebService.TmriOutAccess.TmriOutAccessSoapClient(); #endif client.Open(); client.InnerChannel.OperationTimeout = new TimeSpan(0, 0, TimeOut); strResult = client.queryObjectOut(para.xtlb, para.jkxlh, para.jkid, strQueryXmlDoc); if (client.State != System.ServiceModel.CommunicationState.Closed || client.State != System.ServiceModel.CommunicationState.Closing) { client.Close(); } #endregion AJ_XMLToModel xmlToModel = new AJ_XMLToModel(); m_Vehicle_18X01_Result = (Vehicle_18X01_Result)xmlToModel.Result_XmlToModel("18X01", strResult); #region 联网日志记录 NETLOG_INFO log = new NETLOG_INFO(); log.LWLSH = para.jylsh; log.JYXM = "F1"; log.LWType = "AJ"; log.SendInfo = strQueryXmlDoc; log.RevcInfo = strResult; log.JKName = para.jkid; if (m_Vehicle_18X01_Result == null || string.IsNullOrEmpty(m_Vehicle_18X01_Result.code)) { log.IsSuc = "0"; } else { log.IsSuc = m_Vehicle_18X01_Result.code; } log.LogTime = DateTime.Now; bool b = LogHelper.Log.WriteJKLog(log); #endregion } catch (Exception ex) { string strCategory = Log.LogType.NetFail.ToString(); LOG_INFO logInfo = new LOG_INFO(); logInfo.Category = strCategory; logInfo.HostName = System.Net.Dns.GetHostName(); logInfo.IPAddress = System.Net.Dns.GetHostAddresses(logInfo.HostName).GetValue(1).ToString(); logInfo.LogTime = DateTime.Now; logInfo.FS_Infor = ""; logInfo.JS_Infor = ""; logInfo.Log_Infor = "18X01->" + ex.Message; logInfo.Name = "上传下载"; logInfo.FunName = "AJ_Read_WebServices.cs -> Read_18X01"; Log.WriteLog(logInfo); } return(m_Vehicle_18X01_Result); }