fenglinyong 2 лет назад
Родитель
Сommit
1493b83d1b
2 измененных файлов с 132 добавлено и 117 удалено
  1. 10 3
      wwwroot/App_Code/Export.cs
  2. 122 114
      wwwroot/Global.asax

+ 10 - 3
wwwroot/App_Code/Export.cs

@@ -77,6 +77,8 @@ public static class Export
 			}
 		}
 	}
+
+	#region 结转整理
 	public static void export001()
 	{
 		using (IDataAccess conn = DataAccess.Create())
@@ -232,7 +234,7 @@ public static class Export
 				conn.Commit();
 				if (result > 0 && result1 > 0)
 				{
-					Curtain.Log.Logger.Debug(b+"年"+a+ "月:export001注浆产品存坯汇总表结转成功!");
+					Curtain.Log.Logger.Debug(b + "年" + a + "月:export001注浆产品存坯汇总表结转成功!");
 				}
 				else
 				{
@@ -242,7 +244,7 @@ public static class Export
 			catch (Exception ex)
 			{
 				conn.Rollback();
-				Curtain.Log.Logger.Debug(DateTime.Now.AddMonths(-1).Year.ToString()+"年"+DateTime.Now.AddMonths(-1).Month+ "月:export001注浆产品存坯汇总表结转失败!");
+				Curtain.Log.Logger.Debug(DateTime.Now.AddMonths(-1).Year.ToString() + "年" + DateTime.Now.AddMonths(-1).Month + "月:export001注浆产品存坯汇总表结转失败!");
 				Curtain.Log.Logger.Error(ex);
 			}
 			finally
@@ -657,7 +659,7 @@ public static class Export
 			}
 			else
 			{
-				Curtain.Log.Logger.Debug(b + "年" + a + "月:export006员工出勤汇总表结转0条!"); 
+				Curtain.Log.Logger.Debug(b + "年" + a + "月:export006员工出勤汇总表结转0条!");
 			}
 		}
 
@@ -7251,6 +7253,11 @@ USERCODE_CHECK_FRONT ,
 			}
 		}
 	}
+	#endregion
+
+	#region 新增结转
+
+	#endregion
 
 	/// <summary>
 	/// 在指定日期内有几个星期几

+ 122 - 114
wwwroot/Global.asax

@@ -4,118 +4,126 @@
 <%@ Import Namespace="DK.XuWei.WebMes" %>
 
 <script runat="server">
-    void Application_Start(object sender, EventArgs e)
-    {
-        // 在应用程序启动时运行的代码
-        string connStr = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
-        DataAccess.DefaultParameterType = SQLParameterType.CDA;
-        DataAccess.DefaultDataBaseType = Curtain.DataAccess.DataBaseType.Oracle;
-        DataAccess.DefaultConnectionString = connStr;
-
-        Curtain.Log.Logger.Debug("结转启动!");
-        tr_Load();
-    }
-
-    void Application_End(object sender, EventArgs e)
-    {
-        //  在应用程序关闭时运行的代码
-        System.Threading.Thread.Sleep(1000);
-        string url = "http://10.0.8.2:9020/api/start.ashx";
-        System.Net.HttpWebRequest myHttpWebRequest = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(url);
-        System.Net.HttpWebResponse myHttpWebResponse = (System.Net.HttpWebResponse)myHttpWebRequest.GetResponse();
-        System.IO.Stream receiveStream = myHttpWebResponse.GetResponseStream();
-        myHttpWebResponse.Close();
-        receiveStream.Close();
-    }
-
-    void Application_Error(object sender, EventArgs e)
-    {
-        // 在出现未处理的错误时运行的代码
-        Exception error = Server.GetLastError().GetBaseException();
-        if (error != null)
-        {
-            //记录日志
-            Logger.Error(error);
-            //输出错误信息
-            HttpContext.Current.Response.Write(new JsonResult(JsonStatus.otherError).ToJson());
-        }
-        Server.ClearError();
-    }
-
-    void Session_Start(object sender, EventArgs e)
-    {
-        // 在新会话启动时运行的代码
-
-    }
-
-    void Session_End(object sender, EventArgs e)
-    {
-        // 在会话结束时运行的代码。 
-        // 注意: 只有在 Web.config 文件中的 sessionstate 模式设置为
-        // InProc 时,才会引发 Session_End 事件。如果会话模式设置为 StateServer
-        // 或 SQLServer,则不引发该事件。
-
-    }
-
-
-    //定时器任务 自动推送数据===============================
-    void tr_Load()
-    {
-        //取刷新时间1小时
-        int refreshTime = 1000*60*60*24;
-        Boolean flag = Export.getRunningFlag();
-        if (flag == false) {
-            Logger.Debug("正在运行中——");
-            return;
-        }
-        //设置timer
-        System.Timers.Timer tr = new System.Timers.Timer(refreshTime);
-        tr.Elapsed += new System.Timers.ElapsedEventHandler(tr_Elapsed);
-        tr.Enabled = true;
-        tr.AutoReset = true;
-    }
-
-    void tr_Elapsed(object sender, EventArgs e)
-    {
-        //每月5号凌晨1点触发
-        DateTime now = DateTime.Now;
-
-        if (now.Day == 5)
-        {
-            Export.setRunning();
-            Export.export001();
-            Export.export002();
-            Export.export006();
-            Export.export008();
-            Export.export009();
-            Export.export010();
-            Export.export011();
-            Export.export012();
-            Export.export013();
-            Export.export014();
-            Export.export015();
-            Export.export016();
-            Export.export017();
-            Export.export018();
-            Export.export019();
-            Export.export020();
-            Export.export021();
-            Export.export022();
-            Export.export024();
-            Export.export025();
-            Export.export027();
-            Export.export028();
-            //Export.export029();没有表,暂不结转
-            Export.export030();
-            Export.export031();
-            Export.export032();
-            Export.export033();
-            Export.export034();
-            Export.export035();
-            Export.setSleeping();
-        }
-        else {
-            Logger.Debug("不符合触发条件——" + now);
-        }
-    }
+	void Application_Start(object sender, EventArgs e)
+	{
+		// 在应用程序启动时运行的代码
+		string connStr = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
+		DataAccess.DefaultParameterType = SQLParameterType.CDA;
+		DataAccess.DefaultDataBaseType = Curtain.DataAccess.DataBaseType.Oracle;
+		DataAccess.DefaultConnectionString = connStr;
+
+		Curtain.Log.Logger.Debug("结转启动!");
+		tr_Load();
+	}
+
+	void Application_End(object sender, EventArgs e)
+	{
+		//  在应用程序关闭时运行的代码
+		System.Threading.Thread.Sleep(1000);
+		string url = "http://10.0.8.2:9020/api/start.ashx";
+		System.Net.HttpWebRequest myHttpWebRequest = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(url);
+		System.Net.HttpWebResponse myHttpWebResponse = (System.Net.HttpWebResponse)myHttpWebRequest.GetResponse();
+		System.IO.Stream receiveStream = myHttpWebResponse.GetResponseStream();
+		myHttpWebResponse.Close();
+		receiveStream.Close();
+	}
+
+	void Application_Error(object sender, EventArgs e)
+	{
+		// 在出现未处理的错误时运行的代码
+		Exception error = Server.GetLastError().GetBaseException();
+		if (error != null)
+		{
+			//记录日志
+			Logger.Error(error);
+			//输出错误信息
+			HttpContext.Current.Response.Write(new JsonResult(JsonStatus.otherError).ToJson());
+		}
+		Server.ClearError();
+	}
+
+	void Session_Start(object sender, EventArgs e)
+	{
+		// 在新会话启动时运行的代码
+
+	}
+
+	void Session_End(object sender, EventArgs e)
+	{
+		// 在会话结束时运行的代码。 
+		// 注意: 只有在 Web.config 文件中的 sessionstate 模式设置为
+		// InProc 时,才会引发 Session_End 事件。如果会话模式设置为 StateServer
+		// 或 SQLServer,则不引发该事件。
+
+	}
+
+
+	//定时器任务 自动推送数据===============================
+	void tr_Load()
+	{
+		//取刷新时间1小时
+		int refreshTime = 1000*60*60*24;
+		Boolean flag = Export.getRunningFlag();
+		if (flag == false) {
+			Logger.Debug("正在运行中——");
+			return;
+		}
+		//设置timer
+		System.Timers.Timer tr = new System.Timers.Timer(refreshTime);
+		tr.Elapsed += new System.Timers.ElapsedEventHandler(tr_Elapsed);
+		tr.Enabled = true;
+		tr.AutoReset = true;
+	}
+
+	void tr_Elapsed(object sender, EventArgs e)
+	{
+		//每月5号凌晨1点触发
+		DateTime now = DateTime.Now;
+
+		if (now.Day == 5)
+		{
+			Export.setRunning();
+
+			#region 结转整理
+			//Export.export001();
+			//Export.export002();
+			//Export.export006();
+			//Export.export008();
+			//Export.export009();
+			//Export.export010();
+			//Export.export011();
+			//Export.export012();
+			//Export.export013();
+			//Export.export014();
+			//Export.export015();
+			//Export.export016();
+			//Export.export017();
+			//Export.export018();
+			//Export.export019();
+			//Export.export020();
+			//Export.export021();
+			//Export.export022();
+			//Export.export024();
+			//Export.export025();
+			//Export.export027();
+			//Export.export028();
+			////Export.export029();没有表,暂不结转
+			//Export.export030();
+			//Export.export031();
+			//Export.export032();
+			//Export.export033();
+			//Export.export034();
+			//Export.export035();
+			#endregion
+
+			#region 新增结转
+
+			#endregion
+
+			Export.setSleeping();
+		}
+		else {
+			Logger.Debug("不符合触发条件——" + now);
+		}
+	}
 </script>