Ver código fonte

添加项目文件。

czt 3 semanas atrás
pai
commit
f1d95a3e56

+ 22 - 0
TimedUpload.sln

@@ -0,0 +1,22 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 15
+VisualStudioVersion = 15.0.26430.14
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TimedUpload", "TimedUpload\TimedUpload.csproj", "{54D76C85-4B6F-44D6-9B95-8B4BB411FC4D}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Release|Any CPU = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{54D76C85-4B6F-44D6-9B95-8B4BB411FC4D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{54D76C85-4B6F-44D6-9B95-8B4BB411FC4D}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{54D76C85-4B6F-44D6-9B95-8B4BB411FC4D}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{54D76C85-4B6F-44D6-9B95-8B4BB411FC4D}.Release|Any CPU.Build.0 = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal

+ 42 - 0
TimedUpload/Program.cs

@@ -0,0 +1,42 @@
+using RDIFramework.Utilities;
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.Data;
+using System.IO;
+using System.Linq;
+using System.Text;
+using Topshelf;
+
+namespace TimedUpload
+{
+    class Program
+    {
+        private static string programName = ConfigurationManager.AppSettings["serverName"];
+        static void Main(string[] args)
+        {
+
+            log4net.Config.XmlConfigurator.ConfigureAndWatch(new FileInfo(AppDomain.CurrentDomain.BaseDirectory + "log4net.config"));
+            try
+            {
+                HostFactory.Run(x =>
+                {
+                    x.UseLog4Net();
+
+                    x.Service<ServiceRunner>();
+
+                    x.SetDescription(programName);
+                    x.SetDisplayName(programName);
+                    x.SetServiceName(programName);
+
+                    x.EnablePauseAndContinue();
+                });
+            }
+            catch (Exception ex)
+            {
+                throw ex;
+            }
+            
+        }
+    }
+}

+ 36 - 0
TimedUpload/Properties/AssemblyInfo.cs

@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// 有关程序集的一般信息由以下
+// 控制。更改这些特性值可修改
+// 与程序集关联的信息。
+[assembly: AssemblyTitle("TimedUpload")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Microsoft")]
+[assembly: AssemblyProduct("TimedUpload")]
+[assembly: AssemblyCopyright("Copyright © Microsoft 2017")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// 将 ComVisible 设置为 false 会使此程序集中的类型
+//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
+//请将此类型的 ComVisible 特性设置为 true。
+[assembly: ComVisible(false)]
+
+// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
+[assembly: Guid("54d76c85-4b6f-44d6-9b95-8b4bb411fc4d")]
+
+// 程序集的版本信息由下列四个值组成: 
+//
+//      主版本
+//      次版本
+//      生成号
+//      修订号
+//
+// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
+// 方法是按如下所示使用“*”: :
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

+ 49 - 0
TimedUpload/QuartzJobs/Constants.cs

@@ -0,0 +1,49 @@
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.Linq;
+using System.Text;
+
+namespace TimedUpload
+{
+    public static class Constants
+    {
+        public static string MiddleTable = "if_yc_rawdata";
+        public static string UploadDB = "";
+        public static string DBUrlNb = "";
+        public static string DBUrl = ConfigurationManager.AppSettings["DbConncetion_NB"];
+        public static string ticketUrl =  ConfigurationManager.AppSettings["ticketUrl"];
+        public static string uploadUrl = ConfigurationManager.AppSettings["uploadUrl"];
+
+        public static string logincode = ConfigurationManager.AppSettings["logincode"];
+        public static string password = ConfigurationManager.AppSettings["password"];
+        public static string clientid = ConfigurationManager.AppSettings["clientid"];
+        public static string clientsecret = ConfigurationManager.AppSettings["clientsecret"];
+        public static string xaAppId = ConfigurationManager.AppSettings["xaAppId"];
+        public static string xaAppSecret = ConfigurationManager.AppSettings["xaAppSecret"];
+        public static string ticketxaApiSecret = ConfigurationManager.AppSettings["ticketxaApiSecret"];
+        public static string uploadxaApiSecret = ConfigurationManager.AppSettings["uploadxaApiSecret"];
+        public static string xaEnvironment = ConfigurationManager.AppSettings["xaEnvironment"];
+        public static string CONCENTRATOR_ADDR = ConfigurationManager.AppSettings["CONCENTRATOR_ADDR"];
+        public static string FACTORYCODE = ConfigurationManager.AppSettings["FACTORYCODE"];
+        //ComPanyId
+        public static string ComPanyId = ConfigurationManager.AppSettings["ComPanyId"];
+        //passWord
+        public static string passWord = ConfigurationManager.AppSettings["passWord"];
+        //Company_Name
+        public static string str_Company_Name = ConfigurationManager.AppSettings["Company_Name"];
+        //8888888888
+        public static string conCode = ConfigurationManager.AppSettings["conCode"];
+        // AppId
+        public static string AppId = ConfigurationManager.AppSettings["AppId"];
+        // appSecret
+        public static string appSecret = ConfigurationManager.AppSettings["appSecret"];
+        // 上报接口
+        public static string newUrl = ConfigurationManager.AppSettings["newUrl"];
+        // 查询时间
+        public static string uploadTime = ConfigurationManager.AppSettings["uploadTime"];
+        public static string loraUploadTime = ConfigurationManager.AppSettings["loraUploadTime"];
+        public static string SongZiLoraDB = ConfigurationManager.AppSettings["SongZiLoraDB"];
+
+    }
+}

+ 191 - 0
TimedUpload/QuartzJobs/DataUploadJob.cs

@@ -0,0 +1,191 @@
+//using log4net;
+//using Newtonsoft.Json;
+//using Quartz;
+//using RDIFramework.Utilities;
+//using System;
+//using System.Collections.Generic;
+//using System.Configuration;
+//using System.Data;
+//using System.Globalization;
+//using System.IO;
+//using System.Linq;
+//using System.Net;
+//using System.Text;
+//using System.Web.Script.Serialization;
+
+//namespace TimedUpload.QuartzJobs
+//{
+//    [DisallowConcurrentExecution]
+//    public class DataUploadJob:IJob
+//    {
+//        private readonly ILog log = LogManager.GetLogger(typeof(IJob));
+
+//        public void Execute(IJobExecutionContext context)
+//        {
+//            log.Info("抄表数据上传任务开始执行.................\r\n");
+//            #region 变量
+//            //公司ID 
+//            String str_CompanyID = "";
+//            String str_Url = "";
+//            DataTable dt_MeterInfo = new DataTable();
+//            String str_Sql = "";
+//            //表地址
+//            String str_ElecAddress = "";
+//            //水表读数
+//            String str_Reading = "";
+//            //抄表时间
+//            String str_ReadiTime = "";
+//            //阀门状态
+//            String str_ValveStatus = "";
+//            //电源电压
+//            String str_PowerVoltage = "";
+//            //信号
+//            String str_Rsrp = "";
+//            List<datalist> l_Data = new List<datalist>();
+//            datalist dataList = new datalist();
+//            data data = new data();
+//            #endregion
+
+//            #region 逻辑
+//            try
+//            {
+//                str_CompanyID = Constants.ComPanyId;
+//                str_Url =  Constants.uploadUrl;
+//                //GetSecretKey(str_Url, Constants.passWord);
+//                //查询水表数据
+//                str_Sql = "select ElecAddress as meterAdd,ISNULL(NowReading,0) as collValue,NowRadingDT as collTime,isNULL(Rsrp,'') as Rsrp ,isNULL(ValveStatus,'') as ValveStatus,isNULL(BatteryVoltage,0) as BatteryVoltage from RMRS_MeterInfo where CompanyID ='" + str_CompanyID + "' and DeleteMark =0";
+
+//                dt_MeterInfo = dbHelper.Fill(str_Sql);
+
+//                if (dt_MeterInfo.Rows.Count > 0)
+//                {
+//                    for (int i = 0; i < dt_MeterInfo.Rows.Count; i++)
+//                    {
+//                        dataList = new datalist();
+//                        str_ElecAddress = dt_MeterInfo.Rows[i]["meterAdd"].ToString();
+//                        str_Reading = dt_MeterInfo.Rows[i]["collValue"].ToString();
+//                        str_ReadiTime = dt_MeterInfo.Rows[i]["collTime"].ToString();
+//                        str_ValveStatus = dt_MeterInfo.Rows[i]["ValveStatus"].ToString();
+//                        str_PowerVoltage = dt_MeterInfo.Rows[i]["BatteryVoltage"].ToString();
+//                        str_Rsrp = dt_MeterInfo.Rows[i]["Rsrp"].ToString();
+//                        //数据处理
+//                        dataList.meterAdd = str_ElecAddress.PadLeft(14, '0');
+//                        dataList.collValue = str_Reading;
+//                        dataList.collTime = Convert.ToDateTime(str_ReadiTime).ToString("yyyyMMddHHmmss");
+//                        dataList.conCode = Constants.conCode;//"8888888888";
+//                        l_Data.Add(dataList);
+//                    }
+
+//                    data.factCode = "WW";
+//                    //获取秘钥
+
+//                    data.secretKey = GetSecretKey(str_Url, Constants.passWord);
+
+//                    data.dataList = l_Data;
+
+//                    String str_Param = JsonHelper.ObjectToJSON(data);
+
+//                    String str_Result = WebHelper.HttpWebRequest(str_Url + "/integration/waterMeter/waterMeterReadming", str_Param, "POST", "application/json");
+
+//                    if (str_Result.Contains("success"))
+//                    {
+//                        log.Info("上传成功" + str_Param);
+//                    }
+//                }
+
+//                //整理数据格式
+
+
+//                //调接口上传数据
+//            }
+//            catch (Exception ex)
+//            {
+//                log.Error("抄表数据上传任务异常:" + ex.Message);
+//            } 
+//            #endregion
+
+//            log.InfoFormat("抄表数据上传任务执行结束.................\r\n");
+//        }
+
+
+
+//        /// <summary>
+//        /// 更新配置文件中的更新数据时间
+//        /// </summary>
+//        /// <param name="time"></param>
+//        private void UpdateUploadTime(string time)
+//        {
+//            var cfg = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
+//            cfg.AppSettings.Settings["uploadTime"].Value = time;
+//            cfg.Save();
+//            ConfigurationManager.RefreshSection("appSettings");
+
+//        }
+//        public String GetSecretKey(String str_Url,String str_PassWord)
+//        {
+//            String str_SecretKey = "";
+//            String str = "";
+//            result result = new result();
+
+//            str  = WebHelper.HttpWebRequest(str_Url + "/integration/auth/secretKey", "{\"password\":\"" + str_PassWord + "\"}", "POST", "application/json");
+
+//             result = JsonConvert.DeserializeObject<result>(str);
+
+//             if (result.message == "成功")
+//             {
+//                 str_SecretKey = result.secretKey;
+//             }
+
+//             return str_SecretKey;
+//        }
+
+
+//        static IDbProvider dbHelper
+//        {
+//            get
+//            {
+//                var DbDefine = DbFactoryProvider.GetProvider(CurrentDbType.SqlServer, Constants.DBUrl);
+//                return DbDefine;
+//            }
+//        }
+//    }
+//    public class result
+//    {
+//        public String secretKey { get; set; }
+//        public String message { get; set; }
+
+//        public String status { get; set; }
+//    }
+
+
+//    public class data
+//    {
+//        public String secretKey { get; set; }
+//        public String factCode { get; set; }
+
+//        public List<datalist> dataList { get; set; }
+//    }
+//    public class datalist
+//    {
+//        //集中器编号
+//        public String conCode { get; set; }
+
+//        //表身唯一编号
+//        public String meterAdd { get; set; }
+
+//        //水表读数
+//        public String collValue { get; set; }
+
+//        //抄表时间20181122100000000(毫秒)
+//        public String collTime { get; set; }
+
+//        ////阀控状态 OPEN:开 CLOSE:关
+//        //public String valveStatus { get; set; }
+
+//        ////电源电压 单位:V
+//        //public String powerVoltage { get; set; }
+
+//        ////信号强度(0:信号强 1:信号良,2:信号一般,3:信号弱,4:信号差,5:无信号)
+//        //public String rssi { get; set; }
+//    }
+//}

+ 99 - 0
TimedUpload/QuartzJobs/DataUploadMJYJob.cs

@@ -0,0 +1,99 @@
+//using log4net;
+//using Quartz;
+//using RDIFramework.Utilities;
+//using System;
+//using System.Collections.Generic;
+//using System.Configuration;
+//using System.Data;
+//using System.Globalization;
+//using System.IO;
+//using System.Linq;
+//using System.Net;
+//using System.Text;
+//using System.Web.Script.Serialization;
+
+//namespace TimedUpload.QuartzJobs
+//{
+//    /// <summary>
+//    /// 2020-10-30 闽江源数据对接(新天集抄平台)
+//    /// </summary>
+//    [DisallowConcurrentExecution]
+//    public class DataUploadMJYJob : IJob
+//    {
+//        private readonly ILog log = LogManager.GetLogger(typeof(IJob));
+
+//        public void Execute(IJobExecutionContext context)
+//        {
+//            log.Info("抄表数据上传和达任务开始执行.................\r\n");
+//            try
+//            {
+//                string now = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss", DateTimeFormatInfo.InvariantInfo);
+//                string uploadTime = ConfigurationManager.AppSettings["uploadTime"];
+//                string meterType = ConfigurationManager.AppSettings["meterType"];
+//                string realS = ConfigurationManager.AppSettings["realS"];
+//                #region 有现远传水表
+//                String sql = "SELECT 表地址,表读数,ReviseDT FROM [Bsc_MeterInfo] where ReviseDT > '" + uploadTime + "'";
+//                DataTable dt = dbHelper.Fill(sql);
+//                int rowCount = dt.Rows.Count;
+
+//                StringBuilder requestBody = new StringBuilder();
+//                int sucessNum = 0;
+//                for (int i = 0;i < rowCount; i++)
+//                {
+//                    string result = "";
+//                    try
+//                    {
+//                        requestBody.Clear();
+//                        long date = (Convert.ToDateTime(dt.Rows[i]["ReviseDT"]).ToUniversalTime().Ticks - 621355968000000000) / 10000000;
+//                        requestBody.Append("{\"deviceId\":\"").Append(dt.Rows[i]["表地址"]).Append("\",");
+//                        requestBody.Append("\"type\":\"").Append(meterType).Append("\",");
+//                        requestBody.Append("\"real\":[{\"s\":\"").Append(realS).Append("\",");
+//                        requestBody.Append("\"v\":").Append(Convert.ToDouble(dt.Rows[i]["表读数"])).Append(",");
+//                        requestBody.Append("\"t\":").Append(date).Append("}]}");
+
+//                        result = WebHelper.HttpWebRequest(Constants.uploadUrl, requestBody.ToString(), "POST", "application/json");
+//                        sucessNum++;
+//                    }
+//                    catch (Exception)
+//                    {
+//                        log.Info("上传抄表数据:" + requestBody.ToString());
+//                        log.Info("上传抄表数据接口返回结果:" + result);
+//                    }
+//                }
+
+//                UpdateUploadTime(now);
+
+//                log.Info("抄表数据共" + rowCount + "条数据,上传成功" + sucessNum + "条.................\r\n"); 
+//                #endregion
+//            }
+//            catch (Exception ex)
+//            {
+//                log.Error("抄表数据上传任务异常:" + ex.Message);
+//            }
+
+//            log.InfoFormat("抄表数据上传任务执行结束.................\r\n");
+//        }
+
+//        /// <summary>
+//        /// 更新配置文件中的更新数据时间
+//        /// </summary>
+//        /// <param name="time"></param>
+//        private void UpdateUploadTime(string time)
+//        {
+//            var cfg = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
+//            cfg.AppSettings.Settings["uploadTime"].Value = time;
+//            cfg.Save();
+//            ConfigurationManager.RefreshSection("appSettings");
+
+//        }
+
+//        static IDbProvider dbHelper
+//        {
+//            get
+//            {
+//                var DbDefine = DbFactoryProvider.GetProvider(CurrentDbType.SqlServer, Constants.DBUrl);
+//                return DbDefine;
+//            }
+//        }
+//    }
+//}

+ 243 - 0
TimedUpload/QuartzJobs/LoRaDataUploadJob.cs

@@ -0,0 +1,243 @@
+using log4net;
+using Newtonsoft.Json;
+using Quartz;
+using RDIFramework.Utilities;
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.Data;
+using System.Globalization;
+using System.IO;
+using System.Linq;
+using System.Net;
+using System.Security.Cryptography;
+using System.Text;
+using System.Web.Script.Serialization;
+
+namespace TimedUpload.QuartzJobs
+{
+    [DisallowConcurrentExecution]
+    public class LoRaDataUploadJob:IJob
+    {
+        private readonly ILog log = LogManager.GetLogger(typeof(IJob));
+
+        private static DateTime timeStampStartTime = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
+
+
+        public void Execute(IJobExecutionContext context)
+        {
+            log.Info("lora抄表数据上传任务开始执行.................\r\n");
+            #region 逻辑
+            try
+            {
+                String str_CompanyID = Constants.ComPanyId;
+                String loraUploadTime = Constants.loraUploadTime;
+                String str_Url = Constants.newUrl;
+                string now = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss", DateTimeFormatInfo.InvariantInfo);
+                //GetSecretKey(str_Url, Constants.passWord);
+                //查询水表数据
+                String str_Sql = "SELECT * FROM Bsc_MeterInfo where ReviseDT >= '" + loraUploadTime + "'";
+
+                DataTable dt_MeterInfo = dbHelper.Fill(str_Sql);
+
+                if (dt_MeterInfo.Rows.Count > 0)
+                {
+                    List<loraDatalist> l_Data = new List<loraDatalist>();
+                    for (int i = 0; i < dt_MeterInfo.Rows.Count; i++)
+                    {
+                        loraDatalist dataList = new loraDatalist();
+                        //数据处理
+                        dataList.meterFactory = Constants.AppId;
+                        dataList.meterNo = dt_MeterInfo.Rows[i]["表地址"].ToString();
+                        dataList.endInt = Math.Round(Convert.ToDecimal(dt_MeterInfo.Rows[i]["表读数"]), 2);
+                        dataList.revInt = null;
+                        dataList.realInt = null;
+                        dataList.pressInt = null;
+                        dataList.elecInt = null;
+                        dataList.waterTime = Convert.ToDateTime(dt_MeterInfo.Rows[i]["ReviseDT"].ToString()).ToString("yyyy-MM-dd HH:mm");
+                        dataList.mon = Convert.ToInt32(Convert.ToDateTime(dt_MeterInfo.Rows[i]["ReviseDT"].ToString()).ToString("yyyyMM"));
+                        dataList.remark = "";
+                        dataList.meterType = 0;
+                        //dataList.UserNo = dt_MeterInfo.Rows[i]["UserNo"].ToString();
+                        l_Data.Add(dataList);
+                    }
+
+                    String timestamp = getTimeStamp10(DateTime.Now).ToString();
+
+                    // 原始数据转为json格式
+                    String obj = JsonHelper.ObjectToJSON(l_Data);
+
+                    String appSecret = Constants.appSecret;
+
+                    // 拼接字符串
+                    String sign = obj+ "&timestamp="+timestamp+ "&key="+appSecret;
+
+                    String md5Sign = md5Encript(sign);
+
+                    // 封装数据到实体类
+                    loraData data = new loraData();
+                    data.timestamp = timestamp;
+                    data.sign = md5Sign;
+                    data.body = l_Data;
+
+                    String parameter = JsonHelper.ObjectToJSON(data);
+                    str_Url = str_Url + "?sign=" + md5Sign + "&timestamp=" + timestamp;
+                    String str_Result = WebHelper.HttpWebRequest(str_Url, obj, "POST", "application/json");
+
+                    if (str_Result.Contains("成功"))
+                    {
+                        log.Info("lora上传成功:" + str_Result);
+                    }
+                    UpdateUploadTime(now);
+
+                }
+
+                //整理数据格式
+
+
+                //调接口上传数据
+            }
+            catch (Exception ex)
+            {
+                log.Error("lora抄表数据上传任务异常:" + ex.Message);
+            } 
+            #endregion
+
+            log.InfoFormat("lora抄表数据上传任务执行结束.................\r\n");
+        }
+
+
+
+        /// <summary>
+        /// 更新配置文件中的更新数据时间
+        /// </summary>
+        /// <param name="time"></param>
+        private void UpdateUploadTime(string time)
+        {
+            var cfg = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
+            cfg.AppSettings.Settings["loraUploadTime"].Value = time;
+            cfg.Save();
+            ConfigurationManager.RefreshSection("appSettings");
+
+        }
+
+        public string md5Encript(String str)
+        {
+            MD5 md5 = new MD5CryptoServiceProvider();
+            byte[] data = Encoding.UTF8.GetBytes(str);
+            byte[] result = md5.ComputeHash(data);
+            String md5Str = BitConverter.ToString(result).Replace("-", "");
+            return md5Str;
+
+        }
+        /// <summary>
+        /// 返回13位整数
+        /// </summary>
+        /// <param name="dateTime"></param>
+        /// <returns></returns>
+        public long getTimeStamp(DateTime dateTime)
+        {
+            return (long)(dateTime.ToUniversalTime() - timeStampStartTime).TotalMilliseconds;
+
+        }
+        public long getTimeStamp10(DateTime dateTime)
+        {
+            return (long)(dateTime.ToUniversalTime() - timeStampStartTime).TotalSeconds;
+
+        }
+
+        public static bool CheckTableExiste(string strTableName)
+        {
+
+            string strSql = "select * from sysobjects where name='" + strTableName + "'";
+            if (CreateDataSet(strSql).Tables[0].Rows.Count == 0)
+            {
+                return false;
+            }
+            return true;
+        }
+
+        public static DataSet CreateDataSet(string strSql)
+        {
+            DataSet dataSet = new DataSet();
+            try
+            {
+
+                dataSet = new DataSet();
+
+                dbHelper.Fill(dataSet, strSql, "checkTable");
+            }
+            catch (Exception exception)
+            {
+                //log.Error("checkTable:" + exception.Message);
+            }
+            return dataSet;
+        }
+
+
+        static IDbProvider dbHelper
+        {
+            get
+            {
+                var DbDefine = DbFactoryProvider.GetProvider(CurrentDbType.SqlServer, Constants.SongZiLoraDB);
+                return DbDefine;
+            }
+        }
+    }
+    public class loraResult
+    {
+        public String secretKey { get; set; }
+        public String message { get; set; }
+
+        public String status { get; set; }
+    }
+
+
+    public class loraData
+    {
+        public String timestamp { get; set; }
+
+        public String sign { get; set; }
+
+        public List<loraDatalist> body { get; set; }
+    }
+    public class loraDatalist
+    {
+        //水表厂商编号 AppId
+        public String meterFactory { get; set; }
+
+        //水表编号
+        public String meterNo { get; set; }
+
+        //正累计读数
+        public Decimal? endInt { get; set; }
+
+        //负累计读数
+        public Decimal? revInt { get; set; }
+
+        //瞬时流量读数
+        public Decimal? realInt { get; set; }
+
+        //压力
+        public String pressInt { get; set; }
+
+        //电池电量
+        public Decimal? elecInt { get; set; }
+
+        //采集时间
+        public String waterTime { get; set; }
+
+        //年月 例:202407
+        public int mon { get; set; }
+
+        //备注
+        public String remark { get; set; }
+
+        //0小表 1大表
+        public int meterType { get; set; }
+
+        ////用户号
+        //public String UserNo { get; set; }
+
+    }
+}

+ 219 - 0
TimedUpload/QuartzJobs/NewDataUploadJob-old.cs

@@ -0,0 +1,219 @@
+//using log4net;
+//using Newtonsoft.Json;
+//using Quartz;
+//using RDIFramework.Utilities;
+//using System;
+//using System.Collections.Generic;
+//using System.Configuration;
+//using System.Data;
+//using System.Globalization;
+//using System.IO;
+//using System.Linq;
+//using System.Net;
+//using System.Security.Cryptography;
+//using System.Text;
+//using System.Web.Script.Serialization;
+
+//namespace TimedUpload.QuartzJobs
+//{
+//    [DisallowConcurrentExecution]
+//    public class NewDataUploadJob:IJob
+//    {
+//        private readonly ILog log = LogManager.GetLogger(typeof(IJob));
+
+//        private static DateTime timeStampStartTime = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
+
+
+//        public void Execute(IJobExecutionContext context)
+//        {
+//            log.Info("抄表数据上传任务开始执行.................\r\n");
+//            #region 逻辑
+//            try
+//            {
+//                String str_CompanyID = Constants.ComPanyId;
+//                String uploadTime = Constants.uploadTime;
+//                String str_Url = Constants.newUrl;
+//                string now = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss", DateTimeFormatInfo.InvariantInfo);
+//                //GetSecretKey(str_Url, Constants.passWord);
+//                //查询水表数据
+//                String str_Sql = "select ElecAddress AS MeterNo,ISNULL( NowReading, 0 ) AS EndNumber,NowRadingDT,UserNo from V_WaterMeters where UserNo is not null and CompanyID ='" + str_CompanyID + "' and DeleteMark =0 and NowRadingDT >= '"+ uploadTime+"'";
+
+//                DataTable dt_MeterInfo = dbHelper.Fill(str_Sql);
+
+//                if (dt_MeterInfo.Rows.Count > 0)
+//                {
+//                    List<newDatalist> l_Data = new List<newDatalist>();
+//                    for (int i = 0; i < dt_MeterInfo.Rows.Count; i++)
+//                    {
+//                        newDatalist dataList = new newDatalist();
+//                        //数据处理
+//                        dataList.MeterFactory = Constants.AppId;
+//                        dataList.MeterNo = dt_MeterInfo.Rows[i]["MeterNo"].ToString();
+//                        dataList.EndNumber = Convert.ToDouble(dt_MeterInfo.Rows[i]["EndNumber"]); ;
+//                        dataList.Mon = Convert.ToInt32(Convert.ToDateTime(dt_MeterInfo.Rows[i]["NowRadingDT"].ToString()).ToString("yyyyMM"));
+//                        dataList.Remark = "";
+//                        dataList.UserNo = dt_MeterInfo.Rows[i]["UserNo"].ToString();
+//                        l_Data.Add(dataList);
+//                    }
+
+//                    String timestamp = getTimeStamp10(DateTime.Now).ToString();
+
+//                    // 原始数据转为json格式
+//                    String obj = JsonHelper.ObjectToJSON(l_Data);
+
+//                    String appSecret = Constants.appSecret;
+
+//                    // 拼接字符串
+//                    String sign = obj+ "&timestamp="+timestamp+ "&key="+appSecret;
+
+//                    String md5Sign = md5Encript(sign);
+
+//                    // 封装数据到实体类
+//                    newData data = new newData();
+//                    data.timestamp = timestamp;
+//                    data.sign = md5Sign;
+//                    data.body = l_Data;
+
+//                    String parameter = JsonHelper.ObjectToJSON(data);
+//                    str_Url = str_Url + "?sign=" + md5Sign + "&timestamp=" + timestamp;
+//                    String str_Result = WebHelper.HttpWebRequest(str_Url, obj, "POST", "application/json");
+
+//                    if (str_Result.Contains("成功"))
+//                    {
+//                        log.Info("上传成功" + parameter);
+//                    }
+//                    UpdateUploadTime(now);
+
+//                }
+
+//                //整理数据格式
+
+
+//                //调接口上传数据
+//            }
+//            catch (Exception ex)
+//            {
+//                log.Error("抄表数据上传任务异常:" + ex.Message);
+//            } 
+//            #endregion
+
+//            log.InfoFormat("抄表数据上传任务执行结束.................\r\n");
+//        }
+
+
+
+//        /// <summary>
+//        /// 更新配置文件中的更新数据时间
+//        /// </summary>
+//        /// <param name="time"></param>
+//        private void UpdateUploadTime(string time)
+//        {
+//            var cfg = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
+//            cfg.AppSettings.Settings["uploadTime"].Value = time;
+//            cfg.Save();
+//            ConfigurationManager.RefreshSection("appSettings");
+
+//        }
+
+//        public string md5Encript(String str)
+//        {
+//            MD5 md5 = new MD5CryptoServiceProvider();
+//            byte[] data = Encoding.UTF8.GetBytes(str);
+//            byte[] result = md5.ComputeHash(data);
+//            String md5Str = BitConverter.ToString(result).Replace("-", "");
+//            return md5Str;
+
+//        }
+//        /// <summary>
+//        /// 返回13位整数
+//        /// </summary>
+//        /// <param name="dateTime"></param>
+//        /// <returns></returns>
+//        public long getTimeStamp(DateTime dateTime)
+//        {
+//            return (long)(dateTime.ToUniversalTime() - timeStampStartTime).TotalMilliseconds;
+
+//        }
+//        public long getTimeStamp10(DateTime dateTime)
+//        {
+//            return (long)(dateTime.ToUniversalTime() - timeStampStartTime).TotalSeconds;
+
+//        }
+
+//        public static bool CheckTableExiste(string strTableName)
+//        {
+
+//            string strSql = "select * from sysobjects where name='" + strTableName + "'";
+//            if (CreateDataSet(strSql).Tables[0].Rows.Count == 0)
+//            {
+//                return false;
+//            }
+//            return true;
+//        }
+
+//        public static DataSet CreateDataSet(string strSql)
+//        {
+//            DataSet dataSet = new DataSet();
+//            try
+//            {
+
+//                dataSet = new DataSet();
+
+//                dbHelper.Fill(dataSet, strSql, "checkTable");
+//            }
+//            catch (Exception exception)
+//            {
+//                //log.Error("checkTable:" + exception.Message);
+//            }
+//            return dataSet;
+//        }
+
+
+//        static IDbProvider dbHelper
+//        {
+//            get
+//            {
+//                var DbDefine = DbFactoryProvider.GetProvider(CurrentDbType.SqlServer, Constants.DBUrl);
+//                return DbDefine;
+//            }
+//        }
+//    }
+//    public class newResult
+//    {
+//        public String secretKey { get; set; }
+//        public String message { get; set; }
+
+//        public String status { get; set; }
+//    }
+
+
+//    public class newData
+//    {
+//        public String timestamp { get; set; }
+
+//        public String sign { get; set; }
+
+//        public List<newDatalist> body { get; set; }
+//    }
+//    public class newDatalist
+//    {
+//        //水表厂商编号 AppId
+//        public String MeterFactory { get; set; }
+
+//        //水表编号
+//        public String MeterNo { get; set; }
+
+//        //水表读数
+//        public double EndNumber { get; set; }
+
+//        //年月 例:202407
+//        public int Mon { get; set; }
+
+//        //备注
+//        public String Remark { get; set; }
+
+//        //用户号
+//        public String UserNo { get; set; }
+
+//    }
+//}

+ 243 - 0
TimedUpload/QuartzJobs/NewDataUploadJob.cs

@@ -0,0 +1,243 @@
+using log4net;
+using Newtonsoft.Json;
+using Quartz;
+using RDIFramework.Utilities;
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.Data;
+using System.Globalization;
+using System.IO;
+using System.Linq;
+using System.Net;
+using System.Security.Cryptography;
+using System.Text;
+using System.Web.Script.Serialization;
+
+namespace TimedUpload.QuartzJobs
+{
+    [DisallowConcurrentExecution]
+    public class NewDataUploadJob:IJob
+    {
+        private readonly ILog log = LogManager.GetLogger(typeof(IJob));
+
+        private static DateTime timeStampStartTime = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
+
+
+        public void Execute(IJobExecutionContext context)
+        {
+            log.Info("NB表抄表数据上传任务开始执行.................\r\n");
+            #region 逻辑
+            try
+            {
+                String str_CompanyID = Constants.ComPanyId;
+                String uploadTime = Constants.uploadTime;
+                String str_Url = Constants.newUrl;
+                string now = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss", DateTimeFormatInfo.InvariantInfo);
+                //GetSecretKey(str_Url, Constants.passWord);
+                //查询水表数据
+                String str_Sql = "select ElecAddress AS MeterNo,ISNULL( NowReading, 0 ) AS EndInt,ISNULL( Total_down, 0 ) AS RevInt,ISNULL( Instance, 0 ) AS RealInt,ISNULL( BatteryVoltage , 0) as ElecInt,NowRadingDT,UserNo from V_WaterMeters where UserNo is not null and CompanyID in ('" + str_CompanyID + "') and DeleteMark =0 and NowRadingDT >= '"+ uploadTime+"'";
+
+                DataTable dt_MeterInfo = dbHelper.Fill(str_Sql);
+
+                if (dt_MeterInfo.Rows.Count > 0)
+                {
+                    List<newDatalist> l_Data = new List<newDatalist>();
+                    for (int i = 0; i < dt_MeterInfo.Rows.Count; i++)
+                    {
+                        newDatalist dataList = new newDatalist();
+                        //数据处理
+                        dataList.meterFactory = Constants.AppId;
+                        dataList.meterNo = dt_MeterInfo.Rows[i]["MeterNo"].ToString();
+                        dataList.endInt = Math.Round(Convert.ToDecimal(dt_MeterInfo.Rows[i]["EndInt"]),2);
+                        dataList.revInt = Math.Round(Convert.ToDecimal(dt_MeterInfo.Rows[i]["RevInt"]), 2);
+                        dataList.realInt = Math.Round(Convert.ToDecimal(dt_MeterInfo.Rows[i]["RealInt"]), 2);
+                        dataList.pressInt = null;
+                        dataList.elecInt = Math.Round(Convert.ToDecimal(dt_MeterInfo.Rows[i]["ElecInt"]), 2);
+                        dataList.waterTime = Convert.ToDateTime(dt_MeterInfo.Rows[i]["NowRadingDT"].ToString()).ToString("yyyy-MM-dd HH:mm");
+                        dataList.mon = Convert.ToInt32(Convert.ToDateTime(dt_MeterInfo.Rows[i]["NowRadingDT"].ToString()).ToString("yyyyMM"));
+                        dataList.remark = "";
+                        dataList.meterType = 0;
+                        //dataList.UserNo = dt_MeterInfo.Rows[i]["UserNo"].ToString();
+                        l_Data.Add(dataList);
+                    }
+
+                    String timestamp = getTimeStamp10(DateTime.Now).ToString();
+
+                    // 原始数据转为json格式
+                    String obj = JsonHelper.ObjectToJSON(l_Data);
+
+                    String appSecret = Constants.appSecret;
+
+                    // 拼接字符串
+                    String sign = obj+ "&timestamp="+timestamp+ "&key="+appSecret;
+
+                    String md5Sign = md5Encript(sign);
+
+                    // 封装数据到实体类
+                    newData data = new newData();
+                    data.timestamp = timestamp;
+                    data.sign = md5Sign;
+                    data.body = l_Data;
+
+                    String parameter = JsonHelper.ObjectToJSON(data);
+                    str_Url = str_Url + "?sign=" + md5Sign + "&timestamp=" + timestamp;
+                    String str_Result = WebHelper.HttpWebRequest(str_Url, obj, "POST", "application/json");
+
+                    if (str_Result.Contains("成功"))
+                    {
+                        log.Info("NB表上传成功:" + str_Url);
+                    }
+                    UpdateUploadTime(now);
+
+                }
+
+                //整理数据格式
+
+
+                //调接口上传数据
+            }
+            catch (Exception ex)
+            {
+                log.Error("NB表抄表数据上传任务异常:" + ex.Message);
+            } 
+            #endregion
+
+            log.InfoFormat("NB表抄表数据上传任务执行结束.................\r\n");
+        }
+
+
+
+        /// <summary>
+        /// 更新配置文件中的更新数据时间
+        /// </summary>
+        /// <param name="time"></param>
+        private void UpdateUploadTime(string time)
+        {
+            var cfg = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
+            cfg.AppSettings.Settings["uploadTime"].Value = time;
+            cfg.Save();
+            ConfigurationManager.RefreshSection("appSettings");
+
+        }
+
+        public string md5Encript(String str)
+        {
+            MD5 md5 = new MD5CryptoServiceProvider();
+            byte[] data = Encoding.UTF8.GetBytes(str);
+            byte[] result = md5.ComputeHash(data);
+            String md5Str = BitConverter.ToString(result).Replace("-", "");
+            return md5Str;
+
+        }
+        /// <summary>
+        /// 返回13位整数
+        /// </summary>
+        /// <param name="dateTime"></param>
+        /// <returns></returns>
+        public long getTimeStamp(DateTime dateTime)
+        {
+            return (long)(dateTime.ToUniversalTime() - timeStampStartTime).TotalMilliseconds;
+
+        }
+        public long getTimeStamp10(DateTime dateTime)
+        {
+            return (long)(dateTime.ToUniversalTime() - timeStampStartTime).TotalSeconds;
+
+        }
+
+        public static bool CheckTableExiste(string strTableName)
+        {
+
+            string strSql = "select * from sysobjects where name='" + strTableName + "'";
+            if (CreateDataSet(strSql).Tables[0].Rows.Count == 0)
+            {
+                return false;
+            }
+            return true;
+        }
+
+        public static DataSet CreateDataSet(string strSql)
+        {
+            DataSet dataSet = new DataSet();
+            try
+            {
+
+                dataSet = new DataSet();
+
+                dbHelper.Fill(dataSet, strSql, "checkTable");
+            }
+            catch (Exception exception)
+            {
+                //log.Error("checkTable:" + exception.Message);
+            }
+            return dataSet;
+        }
+
+
+        static IDbProvider dbHelper
+        {
+            get
+            {
+                var DbDefine = DbFactoryProvider.GetProvider(CurrentDbType.SqlServer, Constants.DBUrl);
+                return DbDefine;
+            }
+        }
+    }
+    public class newResult
+    {
+        public String secretKey { get; set; }
+        public String message { get; set; }
+
+        public String status { get; set; }
+    }
+
+
+    public class newData
+    {
+        public String timestamp { get; set; }
+
+        public String sign { get; set; }
+
+        public List<newDatalist> body { get; set; }
+    }
+    public class newDatalist
+    {
+        //水表厂商编号 AppId
+        public String meterFactory { get; set; }
+
+        //水表编号
+        public String meterNo { get; set; }
+
+        //正累计读数
+        public Decimal endInt { get; set; }
+
+        //负累计读数
+        public Decimal revInt { get; set; }
+
+        //瞬时流量读数
+        public Decimal realInt { get; set; }
+
+        //压力
+        public String pressInt { get; set; }
+
+        //电池电量
+        public Decimal elecInt { get; set; }
+
+        //采集时间
+        public String waterTime { get; set; }
+
+        //年月 例:202407
+        public int mon { get; set; }
+
+        //备注
+        public String remark { get; set; }
+
+        //0小表 1大表
+        public int meterType { get; set; }
+
+        ////用户号
+        //public String UserNo { get; set; }
+
+    }
+}

+ 354 - 0
TimedUpload/QuartzJobs/WebHelper.cs

@@ -0,0 +1,354 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Net;
+using System.Net.Security;
+using System.Security.Cryptography.X509Certificates;
+using System.Text;
+using System.Text.RegularExpressions;
+
+namespace TimedUpload
+{
+    /// <summary>
+    /// Web操作
+    /// </summary>
+    public static class WebHelper
+    {
+        #region Host(获取主机名)
+
+        /// <summary>
+        /// 获取主机名,即域名,
+        /// 范例:用户输入网址http://www.a.com/b.htm?a=1&amp;b=2,
+        /// 返回值为: www.a.com
+        /// </summary>
+        //public static string Host
+        //{
+        //    get
+        //    {
+        //        return HttpContext.Current.Request.Url.Host;
+        //    }
+        //}
+        #endregion
+
+        #region HttpWebRequest(请求网络资源)
+
+        /// <summary>
+        /// 请求网络资源,返回响应的文本
+        /// </summary>
+        /// <param name="url">网络资源地址</param>
+        public static string HttpWebRequest(string url)
+        {
+            return HttpWebRequest(url, string.Empty, Encoding.GetEncoding("utf-8"));
+        }
+
+        /// <summary>
+        /// 请求网络资源,返回响应的文本
+        /// </summary>
+        /// <param name="url">网络资源Url地址</param>
+        /// <param name="parameters">提交的参数,格式:参数1=参数值1&amp;参数2=参数值2</param>
+        public static string HttpWebRequest(string url, string parameters, String mehtod)
+        {
+            return HttpWebRequest(url, parameters, Encoding.GetEncoding("utf-8"), mehtod);
+        }
+
+        /// <summary>
+        /// 请求网络资源,返回响应的文本
+        /// </summary>
+        /// <param name="url">网络资源Url地址</param>
+        /// <param name="parameters">提交的参数,格式:参数1=参数值1&amp;参数2=参数值2</param>
+        public static string HttpWebRequest(string url, string parameters, String mehtod, string contentType)
+        {
+            return HttpWebRequest(url, parameters, Encoding.GetEncoding("utf-8"), mehtod, contentType);
+        }
+
+        /// <summary>
+        /// 请求网络资源,返回响应的文本
+        /// </summary>
+        /// <param name="url">网络资源Url地址</param>
+        /// <param name="parameters"></param>
+        public static string HttpWebRequest(string url, string parameters, string contentType, string Authorization, string app_key)
+        {
+            return HttpWebRequest(url, parameters, Encoding.GetEncoding("utf-8"), "POST", contentType, Authorization, app_key);
+        }
+
+        /// <summary>
+        /// 请求网络资源,返回响应的文本
+        /// </summary>
+        /// <param name="url">网络资源Url地址</param>
+        /// <param name="parameters"></param>
+        public static string HttpWebRequest(string url, string parameters, string mehtod, string contentType, string Authorization, string app_key)
+        {
+            return HttpWebRequest(url, parameters, Encoding.GetEncoding("utf-8"), mehtod, contentType, Authorization, app_key);
+        }
+
+        /// <summary>
+        /// 请求网络资源,返回响应的文本
+        /// </summary>
+        /// <param name="url">网络资源Url地址</param>
+        /// <param name="parameters">提交的参数</param>
+        /// <param name="requestBody">提交的requestBody参数json格式</param>
+        public static string HttpWebRequest(string url, Dictionary<string, string> parameters,string requestBody)
+        {
+            return HttpWebRequest(url, null, parameters, requestBody);
+        }
+
+        /// <summary>
+        /// 请求网络资源,返回响应的文本
+        /// </summary>
+        /// <param name="url">网络资源地址</param>
+        /// <param name="parameters">提交的参数,格式:参数1=参数值1&amp;参数2=参数值2</param>
+        /// <param name="encoding">字符编码</param>
+        /// <param name="isPost">是否Post提交</param>
+        /// <param name="contentType">内容类型</param>
+        /// <param name="cookie">Cookie容器</param>
+        /// <param name="timeout">超时时间</param>
+        public static string HttpWebRequest(string url, string parameters, Encoding encoding, string mehtod = "POST",
+             string contentType = "application/x-www-form-urlencoded", string Authorization = null, string app_key = null, CookieContainer cookie = null, int timeout = 120000)
+        {
+            HttpWebRequest request = null;
+            try
+            {
+                if (mehtod == "GET")
+                {
+                    request = WebRequest.Create(url + (parameters == "" ? "" : "?") + parameters) as HttpWebRequest;
+                }
+                else
+                {
+                    request = WebRequest.Create(url) as HttpWebRequest;
+                }
+
+                request.Timeout = timeout;
+                if (!string.IsNullOrEmpty(Authorization))
+                {
+                    request.Headers["Authorization"] = Authorization;
+                }
+                if (!string.IsNullOrEmpty(app_key))
+                {
+                    request.Headers["app_key"] = app_key;
+                }
+                request.Headers["AppId"] = Constants.AppId;
+                request.CookieContainer = cookie;
+                request.ContentType = contentType;
+                request.Method = mehtod;
+
+                if (mehtod == "POST")
+                {
+                    byte[] postData = encoding.GetBytes(parameters);
+                    request.ContentType = contentType;
+                    request.ContentLength = postData.Length;
+                    using (Stream stream = request.GetRequestStream())
+                    {
+                        stream.Write(postData, 0, postData.Length);
+                    }
+                }
+                else if(mehtod == "PUT")
+                {
+                    using (StreamWriter requestStream = new StreamWriter(request.GetRequestStream()))
+                    {
+                        requestStream.Write(parameters);
+                    }
+                }
+                else if (mehtod == "GET")
+                {
+
+                    request.ContentType = "text/html;charset=UTF-8";
+                }
+
+                var response = (HttpWebResponse)request.GetResponse();
+                string result;
+                using (Stream stream = response.GetResponseStream())
+                {
+                    if (stream == null)
+                        return string.Empty;
+                    using (var reader = new StreamReader(stream, encoding))
+                    {
+                        result = reader.ReadToEnd();
+                    }
+                }
+                return result;
+            }
+            catch (Exception ex)
+            {
+                throw ex;
+            }
+        }
+
+        /// <summary>
+        /// 有Request Paras和Request Body的接口
+        /// </summary>
+        /// <param name="baseUrl"></param>
+        /// <param name="headers"></param>
+        /// <param name="urlParas"></param>
+        /// <param name="requestBody"></param>
+        /// <returns></returns>
+        public static string HttpWebRequest(string baseUrl,Dictionary<string, string> headers,Dictionary<string, string> urlParas,string requestBody = null,int timeout = 120000)
+        {
+            string result ;
+            try
+            {
+                var apiUrl = baseUrl;
+
+                if (urlParas != null)
+                {
+                    foreach (var p in urlParas)
+                    {
+                        if (apiUrl.IndexOf("{" + p.Key + "}") > -1)
+                        {
+                            apiUrl = apiUrl.Replace("{" + p.Key + "}", p.Value);
+                        }
+                        else
+                        {
+                            apiUrl += string.Format("{0}{1}={2}", apiUrl.Contains("?") ? "&" : "?", p.Key, p.Value);
+                        }
+                    }
+                }
+
+                var req = (HttpWebRequest)WebRequest.Create(apiUrl);
+                req.Method = "POST";
+                req.ContentType = "application/json";
+                req.Timeout = timeout;
+                if (!String.IsNullOrEmpty(requestBody))
+                {
+                    using (var postStream = new StreamWriter(req.GetRequestStream()))
+                    {
+                        postStream.Write(requestBody);
+                    }
+                }
+
+                if (headers != null)
+                {
+                    if (headers.Keys.Any(p => p.ToLower() == "content-type"))
+                        req.ContentType = headers.SingleOrDefault(p => p.Key.ToLower() == "content-type").Value;
+                    if (headers.Keys.Any(p => p.ToLower() == "accept"))
+                        req.Accept = headers.SingleOrDefault(p => p.Key.ToLower() == "accept").Value;
+                }
+
+                var response = (HttpWebResponse)req.GetResponse();
+
+                using (Stream stream = response.GetResponseStream())
+                {
+                    if (stream == null)
+                    {
+                        result = string.Empty;
+                    }
+                    else
+                    {
+                        using (StreamReader reader = new StreamReader(stream, Encoding.GetEncoding("UTF-8")))
+                        {
+                            result = reader.ReadToEnd();
+                        }
+                    }
+                    
+                }
+            }
+            catch (Exception ex)
+            {
+                throw ex;
+            }
+            return result;
+        }
+
+
+        private static bool CheckValidationResult(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors)
+        {
+            return true;
+        }
+        private static X509Certificate2 GetSentosaCertificate()
+        {
+            X509Store userCaStore = new X509Store(StoreName.My, StoreLocation.LocalMachine);
+            try
+            {
+                userCaStore.Open(OpenFlags.ReadOnly);
+                X509Certificate2Collection certificatesInStore = userCaStore.Certificates;
+                X509Certificate2Collection findResult = certificatesInStore.Find(X509FindType.FindBySubjectName, "server", true);
+                X509Certificate2 clientCertificate = null;
+                if (findResult.Count == 1)
+                {
+                    clientCertificate = findResult[0];
+                }
+                else
+                {
+                    throw new Exception("Unable to locate the correct client certificate.");
+                }
+                return clientCertificate;
+            }
+            catch
+            {
+                throw;
+            }
+            finally
+            {
+                userCaStore.Close();
+            }
+        }
+        #endregion
+
+        #region 去除HTML标记
+        /// <summary>
+        /// 去除HTML标记
+        /// </summary>
+        /// <param name="NoHTML">包括HTML的源码 </param>
+        /// <returns>已经去除后的文字</returns>
+        //public static string NoHtml(string Htmlstring)
+        //{
+        //    //删除脚本
+        //    Htmlstring = Regex.Replace(Htmlstring, @"<script[^>]*?>.*?</script>", "", RegexOptions.IgnoreCase);
+        //    //删除HTML
+        //    Htmlstring = Regex.Replace(Htmlstring, @"<(.[^>]*)>", "", RegexOptions.IgnoreCase);
+        //    Htmlstring = Regex.Replace(Htmlstring, @"([\r\n])[\s]+", "", RegexOptions.IgnoreCase);
+        //    Htmlstring = Regex.Replace(Htmlstring, @"-->", "", RegexOptions.IgnoreCase);
+        //    Htmlstring = Regex.Replace(Htmlstring, @"<!--.*", "", RegexOptions.IgnoreCase);
+        //    Htmlstring = Regex.Replace(Htmlstring, @"&(quot|#34);", "\"", RegexOptions.IgnoreCase);
+        //    Htmlstring = Regex.Replace(Htmlstring, @"&(amp|#38);", "&", RegexOptions.IgnoreCase);
+        //    Htmlstring = Regex.Replace(Htmlstring, @"&(lt|#60);", "<", RegexOptions.IgnoreCase);
+        //    Htmlstring = Regex.Replace(Htmlstring, @"&(gt|#62);", ">", RegexOptions.IgnoreCase);
+        //    Htmlstring = Regex.Replace(Htmlstring, @"&(nbsp|#160);", " ", RegexOptions.IgnoreCase);
+        //    Htmlstring = Regex.Replace(Htmlstring, @"&(iexcl|#161);", "\xa1", RegexOptions.IgnoreCase);
+        //    Htmlstring = Regex.Replace(Htmlstring, @"&(cent|#162);", "\xa2", RegexOptions.IgnoreCase);
+        //    Htmlstring = Regex.Replace(Htmlstring, @"&(pound|#163);", "\xa3", RegexOptions.IgnoreCase);
+        //    Htmlstring = Regex.Replace(Htmlstring, @"&(copy|#169);", "\xa9", RegexOptions.IgnoreCase);
+        //    Htmlstring = Regex.Replace(Htmlstring, @"&#(\d+);", "", RegexOptions.IgnoreCase);
+        //    Htmlstring = Regex.Replace(Htmlstring, @"&hellip;", "", RegexOptions.IgnoreCase);
+        //    Htmlstring = Regex.Replace(Htmlstring, @"&mdash;", "", RegexOptions.IgnoreCase);
+        //    Htmlstring = Regex.Replace(Htmlstring, @"&ldquo;", "", RegexOptions.IgnoreCase);
+        //    Htmlstring.Replace("<", "");
+        //    Htmlstring = Regex.Replace(Htmlstring, @"&rdquo;", "", RegexOptions.IgnoreCase);
+        //    Htmlstring.Replace(">", "");
+        //    Htmlstring.Replace("\r\n", "");
+        //    Htmlstring = HttpContext.Current.Server.HtmlEncode(Htmlstring).Trim();
+        //    return Htmlstring;
+
+        //}
+        #endregion
+
+        #region 格式化文本(防止SQL注入)
+        /// <summary>
+        /// 格式化文本(防止SQL注入)
+        /// </summary>
+        /// <param name="str"></param>
+        /// <returns></returns>
+        public static string Formatstr(string html)
+        {
+            System.Text.RegularExpressions.Regex regex1 = new System.Text.RegularExpressions.Regex(@"<script[\s\S]+</script *>", System.Text.RegularExpressions.RegexOptions.IgnoreCase);
+            System.Text.RegularExpressions.Regex regex2 = new System.Text.RegularExpressions.Regex(@" href *= *[\s\S]*script *:", System.Text.RegularExpressions.RegexOptions.IgnoreCase);
+            System.Text.RegularExpressions.Regex regex3 = new System.Text.RegularExpressions.Regex(@" on[\s\S]*=", System.Text.RegularExpressions.RegexOptions.IgnoreCase);
+            System.Text.RegularExpressions.Regex regex4 = new System.Text.RegularExpressions.Regex(@"<iframe[\s\S]+</iframe *>", System.Text.RegularExpressions.RegexOptions.IgnoreCase);
+            System.Text.RegularExpressions.Regex regex5 = new System.Text.RegularExpressions.Regex(@"<frameset[\s\S]+</frameset *>", System.Text.RegularExpressions.RegexOptions.IgnoreCase);
+            System.Text.RegularExpressions.Regex regex10 = new System.Text.RegularExpressions.Regex(@"select", System.Text.RegularExpressions.RegexOptions.IgnoreCase);
+            System.Text.RegularExpressions.Regex regex11 = new System.Text.RegularExpressions.Regex(@"update", System.Text.RegularExpressions.RegexOptions.IgnoreCase);
+            System.Text.RegularExpressions.Regex regex12 = new System.Text.RegularExpressions.Regex(@"delete", System.Text.RegularExpressions.RegexOptions.IgnoreCase);
+            html = regex1.Replace(html, ""); //过滤<script></script>标记
+            html = regex2.Replace(html, ""); //过滤href=javascript: (<A>) 属性
+            html = regex3.Replace(html, " _disibledevent="); //过滤其它控件的on...事件
+            html = regex4.Replace(html, ""); //过滤iframe
+            html = regex10.Replace(html, "s_elect");
+            html = regex11.Replace(html, "u_pudate");
+            html = regex12.Replace(html, "d_elete");
+            html = html.Replace("'", "’");
+            html = html.Replace("&nbsp;", " ");
+            return html;
+        }
+        #endregion
+    }
+}

+ 45 - 0
TimedUpload/ServiceRunner.cs

@@ -0,0 +1,45 @@
+using Quartz;
+using Quartz.Impl;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Topshelf;
+
+namespace TimedUpload
+{
+    public class ServiceRunner : ServiceControl, ServiceSuspend
+    {
+        private readonly IScheduler scheduler;
+
+        public ServiceRunner()
+        {
+            scheduler = StdSchedulerFactory.GetDefaultScheduler();
+        }
+
+        public bool Start(HostControl hostControl)
+        {
+            scheduler.Start();
+            return true;
+        }
+
+        public bool Stop(HostControl hostControl)
+        {
+            scheduler.Shutdown(false);
+            return true;
+        }
+
+        public bool Continue(HostControl hostControl)
+        {
+            scheduler.ResumeAll();
+            return true;
+        }
+
+        public bool Pause(HostControl hostControl)
+        {
+            scheduler.PauseAll();
+            return true;
+        }
+
+    }
+}

+ 145 - 0
TimedUpload/TimedUpload.csproj

@@ -0,0 +1,145 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{54D76C85-4B6F-44D6-9B95-8B4BB411FC4D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <RootNamespace>TimedUpload</RootNamespace>
+    <AssemblyName>TimedUpload</AssemblyName>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <IsWebBootstrapper>false</IsWebBootstrapper>
+    <PublishUrl>publish\</PublishUrl>
+    <Install>true</Install>
+    <InstallFrom>Disk</InstallFrom>
+    <UpdateEnabled>false</UpdateEnabled>
+    <UpdateMode>Foreground</UpdateMode>
+    <UpdateInterval>7</UpdateInterval>
+    <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+    <UpdatePeriodically>false</UpdatePeriodically>
+    <UpdateRequired>false</UpdateRequired>
+    <MapFileExtensions>true</MapFileExtensions>
+    <ApplicationRevision>3</ApplicationRevision>
+    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+    <UseApplicationTrust>false</UseApplicationTrust>
+    <PublishWizardCompleted>true</PublishWizardCompleted>
+    <BootstrapperEnabled>true</BootstrapperEnabled>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <PlatformTarget>x86</PlatformTarget>
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <PlatformTarget>x86</PlatformTarget>
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup>
+    <ManifestCertificateThumbprint>003EAC3A8686DCFD792C5BCBE4D5E13334C8988E</ManifestCertificateThumbprint>
+  </PropertyGroup>
+  <PropertyGroup>
+    <ManifestKeyFile>TimedUpload_TemporaryKey.pfx</ManifestKeyFile>
+  </PropertyGroup>
+  <PropertyGroup>
+    <GenerateManifests>true</GenerateManifests>
+  </PropertyGroup>
+  <PropertyGroup>
+    <SignManifests>false</SignManifests>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="Common.Logging, Version=3.3.1.0, Culture=neutral, PublicKeyToken=af08829b84f0328e, processorArchitecture=MSIL">
+      <HintPath>..\packages\Common.Logging.3.3.1\lib\net40\Common.Logging.dll</HintPath>
+    </Reference>
+    <Reference Include="Common.Logging.Core, Version=3.3.1.0, Culture=neutral, PublicKeyToken=af08829b84f0328e, processorArchitecture=MSIL">
+      <HintPath>..\packages\Common.Logging.Core.3.3.1\lib\net40\Common.Logging.Core.dll</HintPath>
+    </Reference>
+    <Reference Include="log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
+      <HintPath>..\packages\log4net.2.0.8\lib\net40-full\log4net.dll</HintPath>
+    </Reference>
+    <Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>E:\仓库管理\packages\Newtonsoft.Json.4.5.6\lib\net20\Newtonsoft.Json.dll</HintPath>
+    </Reference>
+    <Reference Include="Oracle.ManagedDataAccess, Version=4.122.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342, processorArchitecture=MSIL">
+      <HintPath>..\packages\Oracle.ManagedDataAccess.12.2.1100\lib\net40\Oracle.ManagedDataAccess.dll</HintPath>
+    </Reference>
+    <Reference Include="Quartz, Version=2.6.0.0, Culture=neutral, PublicKeyToken=f6b8c98a402cc8a4, processorArchitecture=MSIL">
+      <HintPath>..\packages\Quartz.2.6.0\lib\net40\Quartz.dll</HintPath>
+    </Reference>
+    <Reference Include="RDIFramework.Utilities">
+      <HintPath>..\..\SmartCityForFY\Plugin\RDIFramework.Utilities.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.configuration" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Web.Extensions" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Xml" />
+    <Reference Include="Topshelf">
+      <HintPath>F:\插件\C#\Topshelf\net-4.0-full\Topshelf.dll</HintPath>
+    </Reference>
+    <Reference Include="Topshelf.Log4Net">
+      <HintPath>F:\插件\C#\Topshelf\net-4.0-full\Topshelf.Log4Net.dll</HintPath>
+    </Reference>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Program.cs" />
+    <Compile Include="QuartzJobs\Constants.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="QuartzJobs\LoRaDataUploadJob.cs" />
+    <Compile Include="QuartzJobs\NewDataUploadJob-old.cs" />
+    <Compile Include="QuartzJobs\NewDataUploadJob.cs" />
+    <Compile Include="QuartzJobs\DataUploadJob.cs" />
+    <Compile Include="QuartzJobs\DataUploadMJYJob.cs" />
+    <Compile Include="QuartzJobs\WebHelper.cs" />
+    <Compile Include="ServiceRunner.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="app.config">
+      <SubType>Designer</SubType>
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Include="job_scheduling_data_2_0.xsd">
+      <SubType>Designer</SubType>
+    </None>
+    <None Include="log4net.config">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+      <SubType>Designer</SubType>
+    </None>
+    <None Include="packages.config" />
+    <None Include="quartz.config">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+      <SubType>Designer</SubType>
+    </None>
+    <None Include="TimedUpload_TemporaryKey.pfx" />
+  </ItemGroup>
+  <ItemGroup>
+    <Content Include="quartz_jobs.xml">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+      <SubType>Designer</SubType>
+    </Content>
+  </ItemGroup>
+  <ItemGroup>
+    <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1</ProductName>
+      <Install>false</Install>
+    </BootstrapperPackage>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+</Project>

+ 52 - 0
TimedUpload/app.config

@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+  <appSettings>
+    <add key="DbConncetion" value="Data Source=60.205.104.179;Initial Catalog=鹤壁第四水厂;uid=sa;password=wwkj@2136807" />
+    <!--远传抄表数据对接-->
+    <add key="uploadUrl" value="http://61.184.36.52:9550" />
+    <!--接口中type-->
+    <add key="meterType" value="nbxb" />
+    <!--接口中real的S-->
+    <add key="realS" value="v" />
+    <!--远传抄表数据对接-->
+    <add key="uploadTime" value="2024-10-11 00:00:00" />
+	<add key="loraUploadTime" value="2024-10-11 00:00:00" />
+    <add key="serverName" value="松滋水表上传服务" />
+    <add key="passWord" value="test_2021" />
+    <add key="Company_Name" value="WW" />
+    <add key="conCode" value="8888888888" />
+    <!--NB水表对接-Start-->
+    <!--远传抄表数据对接闽江源-->
+    <add key="ComPanyId" value="b08b5c41-29c1-4d63-bae0-df59704829c2','258e2be0-fe94-45a5-8258-72e2ef59f6ea" />
+    <add key="DbConncetion_NB" value="Data Source=182.92.149.41,12433;Initial Catalog=Mul_AMRS_NBManager;uid=wwkjsw;password=Wwkj@2136807." />
+    <!--NB水表对接-End-->
+    <add key="ClientSettingsProvider.ServiceUri" value="" />
+	  
+	  <!--松滋抄表数据对接-->
+	  <add key="newUrl" value="https://water.szcssw.com/api/meter/open/MeterDataLoad" />
+	  <add key="AppId" value="WeiFang" />
+	  <add key="appSecret" value="1q2W**" />
+	  <add key="SongZiLoraDB" value="Data Source=47.105.90.108;Initial Catalog=松滋;uid=sa;password=wwkj@2136807" />
+
+  </appSettings>
+  <runtime>
+    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+      <dependentAssembly>
+        <assemblyIdentity name="log4net" publicKeyToken="669e0ddf0bb1aa2a" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-2.0.8.0" newVersion="2.0.8.0" />
+      </dependentAssembly>
+    </assemblyBinding>
+  </runtime>
+  <system.web>
+    <membership defaultProvider="ClientAuthenticationMembershipProvider">
+      <providers>
+        <add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" />
+      </providers>
+    </membership>
+    <roleManager defaultProvider="ClientRoleProvider" enabled="true">
+      <providers>
+        <add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400" />
+      </providers>
+    </roleManager>
+  </system.web>
+</configuration>

Diferenças do arquivo suprimidas por serem muito extensas
+ 364 - 0
TimedUpload/job_scheduling_data_2_0.xsd


+ 53 - 0
TimedUpload/log4net.config

@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+  <configSections>
+    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>
+  </configSections>
+
+  <log4net>
+    <appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
+      <!--日志路径-->
+      <param name= "File" value= "logs\"/>
+      <!--是否是向文件中追加日志-->
+      <param name= "AppendToFile" value= "true"/>
+      <!--log保留天数-->
+      <param name= "MaxSizeRollBackups" value= "10"/>
+      <!--日志文件名是否是固定不变的-->
+      <param name= "StaticLogFileName" value= "false"/>
+      <!--日志文件名格式为:2008-08-31.log-->
+      <param name= "DatePattern" value= "yyyy-MM-dd&quot;.read.log&quot;"/>
+      <!--日志根据日期滚动-->
+      <param name= "RollingStyle" value= "Date"/>
+      <layout type="log4net.Layout.PatternLayout">
+        <param name="ConversionPattern" value="%d [%t] %-5p %c - %m%n %loggername" />
+      </layout>
+    </appender>
+
+    <!-- 控制台前台显示日志 -->
+    <appender name="ColoredConsoleAppender" type="log4net.Appender.ColoredConsoleAppender">
+      <mapping>
+        <level value="ERROR" />
+        <foreColor value="Red, HighIntensity" />
+      </mapping>
+      <mapping>
+        <level value="Info" />
+        <foreColor value="Green" />
+      </mapping>
+      <layout type="log4net.Layout.PatternLayout">
+        <conversionPattern value="%n%date{HH:mm:ss,fff} [%-5level] %m" />
+      </layout>
+
+      <filter type="log4net.Filter.LevelRangeFilter">
+        <param name="LevelMin" value="Info" />
+        <param name="LevelMax" value="Fatal" />
+      </filter>
+    </appender>
+
+    <root>
+      <!--(高) OFF > FATAL > ERROR > WARN > INFO > DEBUG > ALL (低) -->
+      <level value="all" />
+      <appender-ref ref="ColoredConsoleAppender"/>
+      <appender-ref ref="RollingLogFileAppender"/>
+    </root>
+  </log4net>
+</configuration>

+ 8 - 0
TimedUpload/packages.config

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+  <package id="Common.Logging" version="3.3.1" targetFramework="net40" />
+  <package id="Common.Logging.Core" version="3.3.1" targetFramework="net40" />
+  <package id="log4net" version="2.0.8" targetFramework="net40" />
+  <package id="Oracle.ManagedDataAccess" version="12.2.1100" targetFramework="net40" />
+  <package id="Quartz" version="2.6.0" targetFramework="net40" />
+</packages>

+ 21 - 0
TimedUpload/quartz.config

@@ -0,0 +1,21 @@
+# You can configure your scheduler in either <quartz> configuration section
+# or in quartz properties file
+# Configuration section has precedence
+
+quartz.scheduler.instanceName = QuartzTest
+
+# configure thread pool info
+quartz.threadPool.type = Quartz.Simpl.SimpleThreadPool, Quartz
+quartz.threadPool.threadCount = 10
+quartz.threadPool.threadPriority = Normal
+
+# job initialization plugin handles our xml reading, without it defaults are used
+quartz.plugin.xml.type = Quartz.Plugin.Xml.XMLSchedulingDataProcessorPlugin, Quartz
+quartz.plugin.xml.fileNames = ~/quartz_jobs.xml
+
+# export this server to remoting context
+#quartz.scheduler.exporter.type = Quartz.Simpl.RemotingSchedulerExporter, Quartz
+#quartz.scheduler.exporter.port = 555
+#quartz.scheduler.exporter.bindName = QuartzScheduler
+#quartz.scheduler.exporter.channelType = tcp
+#quartz.scheduler.exporter.channelName = httpQuartz

+ 54 - 0
TimedUpload/quartz_jobs.xml

@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- This file contains job definitions in schema version 2.0 format -->
+
+<job-scheduling-data xmlns="http://quartznet.sourceforge.net/JobSchedulingData" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0">
+
+  <processing-directives>
+    <overwrite-existing-data>true</overwrite-existing-data>
+  </processing-directives>
+
+  <schedule>
+
+    <!--松滋nb定时上传数据-->
+    <job>
+      <name>NewDataUploadJob</name>
+      <group>NewDataUpload</group>
+      <description>数据定时上传服务</description>
+      <job-type>TimedUpload.QuartzJobs.NewDataUploadJob,TimedUpload</job-type>
+      <durable>true</durable>
+      <recover>false</recover>
+    </job>
+    <trigger>
+      <cron>
+        <name>NewDataUploadJobTrigger</name>
+        <group>NewDataUpload</group>
+        <job-name>NewDataUploadJob</job-name>
+        <job-group>NewDataUpload</job-group>
+        <start-time>2017-08-08T00:00:00+08:00</start-time>
+        <cron-expression>0 0 1 * * ? </cron-expression>
+      </cron>
+    </trigger>
+
+	  <!--松滋lora定时上传数据--><!--
+	  <job>
+		  <name>LoRaDataUploadJob</name>
+		  <group>LoRaDataUpload</group>
+		  <description>数据定时上传服务</description>
+		  <job-type>TimedUpload.QuartzJobs.LoRaDataUploadJob,TimedUpload</job-type>
+		  <durable>true</durable>
+		  <recover>false</recover>
+	  </job>
+	  <trigger>
+		  <cron>
+			  <name>LoRaDataUploadJobTrigger</name>
+			  <group>LoRaDataUpload</group>
+			  <job-name>LoRaDataUploadJob</job-name>
+			  <job-group>LoRaDataUpload</job-group>
+			  <start-time>2017-08-08T00:00:00+08:00</start-time>
+			  <cron-expression>0 0 1 * * ? </cron-expression>
+		  </cron>
+	  </trigger>-->
+    
+  </schedule>
+</job-scheduling-data>