/// <summary> /// 通过传入参数初始化查询报表需要参数 /// </summary> private void Init(string token, string actionType, Dictionary <string, string> parameters, ref string responseXml) { this._loginInfo = TokenTransfer.GetLoginInfo(token); ClientReportContext.Login = this._loginInfo; this._solutionId = this.GetInformationByKey("solutionId", parameters); this.Init2(); }
// 定时任务 private static void OnTimedEvent(object sender, ElapsedEventArgs e) { var loginInfo = TokenTransfer.GetLoginInfo(Token); if (!Engine.Busy) { stopwatch.Reset(); Engine.CreatDownLoadEngine(loginInfo); } if (string.IsNullOrEmpty(loginInfo.UfDataCnnString)) { Status = 0; _timer.Close(); } stopwatch.Stop(); // 停止监视计时 TimeSpan timespan = stopwatch.Elapsed; // 获取当前实例测量得出的总时间 double seconds = timespan.TotalSeconds; // 总秒数 if (seconds > 60) { // 如果报表下载任务超过60S,则销毁任务 Engine.DestroyTask(); stopwatch.Reset(); } stopwatch.Start(); // 开始监视计时 }
public string GetReportList(string token) { var result = new ActionResult() { Action = "", Flag = 1, Description = "调用失败", ResultData = null }; var time = System.DateTime.Now; System.Diagnostics.Trace.WriteLine("<<<<<<<<<<MobileReportTest>>>>>>>>>>GetReportList-->GetReportList TaskID: " + token + " Start:" + time.ToString()); var ds = new DataSet(); this._loginInfo = TokenTransfer.GetLoginInfo(token); //TimerTask timer = new TimerTask(1000, this._loginInfo); try { ds = this.GetDataFromDb(false, false); } catch (Exception ex) { result.Description = "获取模块信息失败:" + ex.Message; return(result.Description);//代码走查点修改 } if (ds != null && ds.Tables.Count > 0) { ds.Tables[0].TableName = "ReportListInfo"; } const string templateId = "getReportList"; #region 将login缓存到MERP中 var token1 = ""; var xmlDocument = new XmlDocument(); xmlDocument.LoadXml(token); var doc = xmlDocument.DocumentElement; var tokennode = doc.SelectSingleNode("/ufsoft/data/SignedToken"); if (tokennode != null) { token1 = tokennode.Attributes["id"].Value; } var login = new UFSoft.U8.Framework.Login.UI.clsLogin(); var userData = login.GetLoginInfo(token); login.login(userData.cSubID, userData.UserId, userData.Password, userData.AppServer, userData.operDate, userData.DataSource, userData.WorkStationSerial, false); ContextObj context = new ContextObj(); context.Login = login; //context.Login = _u8LoginCls as UFSoft.U8.Framework.Login.UI.clsLogin; ContextManager.SingletonInstance.Add(token1, context); #endregion var service = new SchemaServiceForNet(); result.ResultData = service.MakeSchema(token1, templateId, ds, null); result.Flag = 0; result.Description = "查询报表列表信息成功!"; System.Diagnostics.Trace.WriteLine("<<<<<<<<<<MobileReportTest>>>>>>>>>>GetReportList-->GetReportList TaskID: " + token1 + " End:" + System.DateTime.Now.ToString()); System.Diagnostics.Trace.WriteLine("<<<<<<<<<<MobileReportTest>>>>>>>>>>OpenReport-->GetReportList TaskID: " + token1 + " Use Time " + (DateTime.Now - time).ToString()); return(result.ResultData); }
/// <summary> /// 初始化关注报表需要的参数信息 /// </summary> /// <param name="token"></param> /// <param name="actionType"></param> /// <param name="parameters"></param> /// <param name="responseXml"></param> private void Init(string token, string actionType, Dictionary <string, string> parameters, ref string responseXml) { this._loginInfo = TokenTransfer.GetLoginInfo(token); this._taskId = TokenTransfer.GetInformationByKey("taskId", parameters); if (string.IsNullOrEmpty(this._taskId)) { this._taskId = Guid.NewGuid().ToString(); } this._solutionId = TokenTransfer.GetInformationByKey("solutionId", parameters); this._queryParams = TokenTransfer.GetInformationByKey("queryParams", parameters); }
public override ActionResult Execute(string token, string actionType, Dictionary <string, string> parameters, ref string responseXml) { var result = new ActionResult() { Action = actionType, Flag = 1, Description = "调用失败", ResultData = null }; var time = System.DateTime.Now; System.Diagnostics.Trace.Write("<<<<<<<<<<MobileReportTest>>>>>>>>>>GetReportList-->GetReportList TaskID: " + token + " Start:" + time.ToString()); var ds = new DataSet(); this._loginInfo = TokenTransfer.GetLoginInfo(token); System.Diagnostics.Trace.Write("<<<<<<<<<<MobileReportTest>>>>>>>>>>TokenTransfer处理之后-->token=: " + token); System.Diagnostics.Trace.Write("<<<<<<<<<<MobileReportTest>>>>>>>>>>Login.UfMetaCnnString-->" + this._loginInfo.UfMetaCnnString); //TimerTask timer = new TimerTask(1000, this._loginInfo); try { ds = this.GetDataFromDb(false, false); } catch (Exception ex) { result.Description = "获取模块信息失败:" + ex.Message; return(result);//代码走查点修改 } if (ds != null && ds.Tables.Count > 0) { ds.Tables[0].TableName = "ReportListInfo"; } const string templateId = "getReportList"; var service = new SchemaServiceForNet(); result.ResultData = service.MakeSchema(token, templateId, ds, null); result.Flag = 0; result.Description = "查询报表列表信息成功!"; System.Diagnostics.Trace.WriteLine("<<<<<<<<<<MobileReportTest>>>>>>>>>>GetReportList-->GetReportList TaskID: " + token + " End:" + System.DateTime.Now.ToString()); System.Diagnostics.Trace.WriteLine("<<<<<<<<<<MobileReportTest>>>>>>>>>>OpenReport-->GetReportList TaskID: " + token + " Use Time " + (DateTime.Now - time).ToString()); return(result); }
private void Init(string token, string actionType, Dictionary <string, string> parameters, ref string responseXml) { this._loginInfo = TokenTransfer.GetLoginInfo(token); TokenTransfer.GetInformationByKey("taskId", parameters); }
/// <summary> /// 通过task中存储的用户登陆信息构建用户登陆对象 /// </summary> /// <param name="task"></param> /// <returns></returns> private U8LoginInfor ConstructLogin(MobileReportDownloadTask task) { return(TokenTransfer.DoLogin(task.AccId, task.Syear, task.AppServer, task.DataSource, task.Sdate, task.UserId, task.Pass, "zh-CN")); }