commit aa6841144afdb31a7bdd3f117132c3b1cb6e0250 Author: yexingqiang Date: Fri May 29 13:57:08 2026 +0800 chore: 初始化东安动力外部数据接口工程 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0d3d9ee --- /dev/null +++ b/.gitignore @@ -0,0 +1,11 @@ +# Visual Studio / .NET build artifacts +[Bb]in/ +[Oo]bj/ +.vs/ +packages/ +*.user +*.suo +*.cache + +# Logs +*.log diff --git a/CallWebApi/03_CallWebApi.csproj b/CallWebApi/03_CallWebApi.csproj new file mode 100644 index 0000000..61ad5b8 --- /dev/null +++ b/CallWebApi/03_CallWebApi.csproj @@ -0,0 +1,62 @@ + + + + + Debug + AnyCPU + {727A1B50-D83A-4319-BDF6-E923F4BD41B3} + Exe + CallWebApi + CallWebApi + v4.8 + 512 + true + true + + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CallWebApi/App.config b/CallWebApi/App.config new file mode 100644 index 0000000..6043180 --- /dev/null +++ b/CallWebApi/App.config @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CallWebApi/CallWebApi.cs b/CallWebApi/CallWebApi.cs new file mode 100644 index 0000000..810b81f --- /dev/null +++ b/CallWebApi/CallWebApi.cs @@ -0,0 +1,205 @@ +using Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Net; +using System.Text; +using System.Threading.Tasks; + +namespace CallWebApi +{ + public class Post + { + public static string Postring(string url, Dictionary dic) + { + string result = ""; + //url = "http://172.16.22.15:8000/" + url; + HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url); + req.Method = "POST"; + req.ContentType = "application/x-www-form-urlencoded"; + req.Proxy = null; + + req.KeepAlive = false; + + #region 添加Post 参数 + StringBuilder builder = new StringBuilder(); + int i = 0; + foreach (var item in dic) + { + if (i > 0) + builder.Append("&"); + builder.AppendFormat("{0}={1}", item.Key, item.Value); + i++; + } + byte[] data = Encoding.UTF8.GetBytes(builder.ToString()); + req.ContentLength = data.Length; + using (Stream reqStream = req.GetRequestStream()) + { + reqStream.Write(data, 0, data.Length); + reqStream.Close(); + } + #endregion + HttpWebResponse resp = (HttpWebResponse)req.GetResponse(); + Stream stream = resp.GetResponseStream(); + + //获取响应内容 + using (StreamReader reader = new StreamReader(stream, Encoding.UTF8)) + { + result = reader.ReadToEnd(); + } + return result; + } + + public static string Postring1(string url, string token, Dictionary dic) + { + string results = ""; + //url = "http://172.16.22.15:8000/" + url; + + HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url); + req.Method = "POST"; + req.ContentType = "application/x-www-form-urlencoded"; + req.Headers.Add("Authorization", "Bearer " + token); + + StringBuilder builder = new StringBuilder(); + int i = 0; + foreach (var item in dic) + { + if (i > 0) + builder.Append("&"); + builder.AppendFormat("{0}={1}", item.Key, item.Value); + i++; + } + byte[] data = Encoding.UTF8.GetBytes(builder.ToString()); + req.ContentLength = data.Length; + try + { + using (Stream reqStream = req.GetRequestStream()) + { + reqStream.Write(data, 0, data.Length); + reqStream.Close(); + } + HttpWebResponse resp = (HttpWebResponse)req.GetResponse(); + Stream stream = resp.GetResponseStream(); + //获取响应内容 + using (StreamReader reader = new StreamReader(stream, Encoding.UTF8)) + { + results = reader.ReadToEnd(); + } + return results; + } + catch (Exception e) + { + Console.WriteLine(e.Message); + return e.Message; + throw; + } + + } + + + public static string MyPost() + { + // var url = "http://192.168.1.224:41190/"; + var url = "http://127.0.0.1:41190/"; + var controller = "ZSaveTag"; + var action = "SelectPage"; + Dictionary dict = new Dictionary(); + dict.Add("OpName",""); + dict.Add("StartTime", "2022-06-24 00:00:00"); + dict.Add("EndTime", "2022-06-30 00:00:00"); + dict.Add("PageCurrent", "1"); + dict.Add("PageSize", "2"); + + + var reqUrl = url + "/api/" + controller + "/" + action; + HttpWebRequest req = (HttpWebRequest)WebRequest.Create(reqUrl); + req.Method = "POST"; + req.ContentType = "application/json"; + req.Proxy = null; + + req.KeepAlive = false; + + #region 添加Post 参数 + JObject jObject = new JObject(); + jObject.Add("OpName", ""); + jObject.Add("StartTime", "2022-06-24 00:00:00"); + jObject.Add("EndTime", "2022-06-30 00:00:00"); + jObject.Add("PageCurrent", "2"); + jObject.Add("PageSize", "3"); + var jStr = jObject.ToString(); + + //StringBuilder builder = new StringBuilder(); + //int i = 0; + //foreach (var item in dict) + //{ + // if (i > 0) + // builder.Append("&"); + // builder.AppendFormat("{0}={1}", item.Key, item.Value); + // i++; + //} + //byte[] data = Encoding.UTF8.GetBytes(builder.ToString()); + byte[] data = Encoding.UTF8.GetBytes(jStr); + req.ContentLength = data.Length; + using (Stream reqStream = req.GetRequestStream()) + { + reqStream.Write(data, 0, data.Length); + reqStream.Close(); + } + #endregion + HttpWebResponse resp = (HttpWebResponse)req.GetResponse(); + Stream stream = resp.GetResponseStream(); + + string result = ""; + + //获取响应内容 + using (StreamReader reader = new StreamReader(stream, Encoding.UTF8)) + { + result = reader.ReadToEnd(); + } + return result; + } + + public static string MyPost(string url,string jsonStr) + { + string result = ""; + + try + { + HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url); + req.Method = "POST"; + req.ContentType = "application/json"; + req.Proxy = null; + req.KeepAlive = false; + + byte[] data = Encoding.UTF8.GetBytes(jsonStr); + req.ContentLength = data.Length; + using (Stream reqStream = req.GetRequestStream()) + { + reqStream.Write(data, 0, data.Length); + reqStream.Close(); + } + + HttpWebResponse resp = (HttpWebResponse)req.GetResponse(); + Stream stream = resp.GetResponseStream(); + + + //获取响应内容 + using (StreamReader reader = new StreamReader(stream, Encoding.UTF8)) + { + result = reader.ReadToEnd(); + } + Console.WriteLine(result); + + + } + catch (Exception err) + { + Console.WriteLine(" " + err.Message); + } + + return result; + } + + } +} diff --git a/CallWebApi/Program.cs b/CallWebApi/Program.cs new file mode 100644 index 0000000..aaf6a2d --- /dev/null +++ b/CallWebApi/Program.cs @@ -0,0 +1,32 @@ +using Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CallWebApi +{ + internal class Program + { + static void Main(string[] args) + { + Post.MyPost(); + + var url = "http://localhost:41190/api/ZSaveTag/SelectPage"; + + JObject jObject = new JObject(); + jObject.Add("OpName", ""); + jObject.Add("StartTime", "2022-06-24 00:00:00"); + jObject.Add("EndTime", "2022-06-30 00:00:00"); + jObject.Add("PageCurrent", "2"); + jObject.Add("PageSize", "3"); + var jStr = jObject.ToString(); + + Post.MyPost(url, jStr); + + Console.ReadKey(); + + } + } +} diff --git a/CallWebApi/Properties/AssemblyInfo.cs b/CallWebApi/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..7fca5ca --- /dev/null +++ b/CallWebApi/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("CallWebApi")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("CallWebApi")] +[assembly: AssemblyCopyright("Copyright © 2022")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("727a1b50-d83a-4319-bdf6-e923f4bd41b3")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/CallWebApi/packages.config b/CallWebApi/packages.config new file mode 100644 index 0000000..ce3dc38 --- /dev/null +++ b/CallWebApi/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/DLL/BasicData.dll b/DLL/BasicData.dll new file mode 100644 index 0000000..2531c4d Binary files /dev/null and b/DLL/BasicData.dll differ diff --git a/DLL/DataLinkMesWork.dll b/DLL/DataLinkMesWork.dll new file mode 100644 index 0000000..57fcd25 Binary files /dev/null and b/DLL/DataLinkMesWork.dll differ diff --git a/DLL/ICSharpCode.SharpZipLib.dll b/DLL/ICSharpCode.SharpZipLib.dll new file mode 100644 index 0000000..84e8c68 Binary files /dev/null and b/DLL/ICSharpCode.SharpZipLib.dll differ diff --git a/DLL/NPOI.OOXML.dll b/DLL/NPOI.OOXML.dll new file mode 100644 index 0000000..031d41d Binary files /dev/null and b/DLL/NPOI.OOXML.dll differ diff --git a/DLL/NPOI.OpenXml4Net.dll b/DLL/NPOI.OpenXml4Net.dll new file mode 100644 index 0000000..8da4ac2 Binary files /dev/null and b/DLL/NPOI.OpenXml4Net.dll differ diff --git a/DLL/NPOI.OpenXmlFormats.dll b/DLL/NPOI.OpenXmlFormats.dll new file mode 100644 index 0000000..4a8f87b Binary files /dev/null and b/DLL/NPOI.OpenXmlFormats.dll differ diff --git a/DLL/NPOI.dll b/DLL/NPOI.dll new file mode 100644 index 0000000..1a500e9 Binary files /dev/null and b/DLL/NPOI.dll differ diff --git a/DLL/Newtonsoft.Json.dll b/DLL/Newtonsoft.Json.dll new file mode 100644 index 0000000..7af125a Binary files /dev/null and b/DLL/Newtonsoft.Json.dll differ diff --git a/DatabaseClient/01_DatabaseClient.csproj b/DatabaseClient/01_DatabaseClient.csproj new file mode 100644 index 0000000..c05ab38 --- /dev/null +++ b/DatabaseClient/01_DatabaseClient.csproj @@ -0,0 +1,134 @@ + + + + + Debug + AnyCPU + {C7C5E929-BE10-4ED6-94DB-B8D65E05E52F} + Exe + DatabaseClient + DatabaseClient + v4.8 + 512 + true + true + + + + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + LocalIntranet + + + false + + + + + ..\packages\BouncyCastle.1.8.5\lib\BouncyCastle.Crypto.dll + + + ..\packages\Google.Protobuf.3.19.4\lib\net45\Google.Protobuf.dll + + + ..\packages\K4os.Compression.LZ4.1.2.6\lib\net46\K4os.Compression.LZ4.dll + + + ..\packages\K4os.Compression.LZ4.Streams.1.2.6\lib\net46\K4os.Compression.LZ4.Streams.dll + + + ..\packages\K4os.Hash.xxHash.1.0.6\lib\net46\K4os.Hash.xxHash.dll + + + ..\packages\log4net.2.0.14\lib\net45\log4net.dll + + + ..\packages\MySql.Data.8.0.29\lib\net452\MySql.Data.dll + + + + ..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll + + + + + + + + ..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.116.0\lib\net46\System.Data.SQLite.dll + + + + ..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll + + + + ..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll + + + ..\packages\System.Runtime.CompilerServices.Unsafe.5.0.0\lib\net45\System.Runtime.CompilerServices.Unsafe.dll + + + + + + + + + + + ..\packages\MySql.Data.8.0.29\lib\net452\Ubiety.Dns.Core.dll + + + ..\packages\MySql.Data.8.0.29\lib\net452\ZstdNet.dll + + + + + + + + + + + + + + + + + PreserveNewest + + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + \ No newline at end of file diff --git a/DatabaseClient/App.config b/DatabaseClient/App.config new file mode 100644 index 0000000..fbf0811 --- /dev/null +++ b/DatabaseClient/App.config @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/DatabaseClient/DBClient.cs b/DatabaseClient/DBClient.cs new file mode 100644 index 0000000..96ee82d --- /dev/null +++ b/DatabaseClient/DBClient.cs @@ -0,0 +1,62 @@ +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DatabaseClient +{ + public abstract class DBClient + { + /// + /// 根据连接字符串连接 + /// + /// 连接字符串 + public abstract void Connect(string connString); + + /// + /// 执行sql查询语句,返回DataTable + /// + /// 查询sql字符串 + /// + public abstract DataTable ExecQuery(string sql); + + /// + /// 执行sql非查询语句,返回执行结果 + /// + /// 非查询sql字符串 + /// + public abstract int ExecNonQuery(string sql); + + /// + /// 分页,将原始表分成子表。约束为当前页数和每页记录数 + /// + /// 泛型类型 + /// 原始表 + /// 每页记录数 + /// 当前页数 + /// + public static List SplitePage(List originList,int pageSize,int currentPage) + { + List resList = new List(); + + var numAll = originList.Count; + var numPage = numAll / pageSize + 1; + + var start = (currentPage - 1) * pageSize; + var end = start + pageSize; + + for (int i = 0; i < originList.Count; i++) + { + var origin = originList[i]; + if (i >= start && i < end) + { + resList.Add(origin); + } + } + + return resList; + } + } +} diff --git a/DatabaseClient/DBClientFactory.cs b/DatabaseClient/DBClientFactory.cs new file mode 100644 index 0000000..cffba85 --- /dev/null +++ b/DatabaseClient/DBClientFactory.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DatabaseClient +{ + public class DBClientFactory + { + DatabaseFactory factory; + + public DBClientFactory(string dbTypeStr) + { + switch (dbTypeStr.ToLower()) + { + case "mysql": + { + factory = new MysqlDatabaseFactory(); + break; + } + case "sqlite": + { + factory = new SqliteDatabaseFactory(); + break; + } + case "mssql": + { + factory = new MssqlDatabaseFactory(); + break; + } + default: + { + factory = new MysqlDatabaseFactory(); + break; + } + } + } + + public DBClient Create() + { + return factory.Create(); + } + } +} diff --git a/DatabaseClient/DBClientLog4net.config b/DatabaseClient/DBClientLog4net.config new file mode 100644 index 0000000..2842f30 --- /dev/null +++ b/DatabaseClient/DBClientLog4net.config @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/DatabaseClient/DatabaseFactory.cs b/DatabaseClient/DatabaseFactory.cs new file mode 100644 index 0000000..240cf43 --- /dev/null +++ b/DatabaseClient/DatabaseFactory.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DatabaseClient +{ + public abstract class DatabaseFactory + { + public abstract DBClient Create(); + } + + class MysqlDatabaseFactory : DatabaseFactory + { + public override DBClient Create() + { + return new MysqlClient(); + } + } + + class SqliteDatabaseFactory : DatabaseFactory + { + public override DBClient Create() + { + return new SqliteClient(); + } + } + + class MssqlDatabaseFactory : DatabaseFactory + { + public override DBClient Create() + { + return new MssqlClient(); + } + } +} diff --git a/DatabaseClient/GlobalVar.cs b/DatabaseClient/GlobalVar.cs new file mode 100644 index 0000000..15deaac --- /dev/null +++ b/DatabaseClient/GlobalVar.cs @@ -0,0 +1,9 @@ +using log4net; + +namespace DatabaseClient +{ + class GlobalVar + { + public static ILog log = LogManager.GetLogger("DBClient"); + } +} diff --git a/DatabaseClient/MssqlClient.cs b/DatabaseClient/MssqlClient.cs new file mode 100644 index 0000000..9e5b022 --- /dev/null +++ b/DatabaseClient/MssqlClient.cs @@ -0,0 +1,75 @@ +using System; +using System.Data; +using System.Data.SqlClient; + +namespace DatabaseClient +{ + class MssqlClient : DBClient + { + SqlConnection conn = null; + + public MssqlClient(){} + + public override void Connect(string connString) + { + try + { + conn = new SqlConnection(connString); + } + catch (Exception err) + { + GlobalVar.log.Error(err.Message); + } + } + + public override DataTable ExecQuery(string sql) + { + DataTable dt = null; + try + { + if (conn != null) + { + conn.Open(); + + var cmd = new SqlCommand(sql, conn); + SqlDataAdapter da = new SqlDataAdapter(cmd); + DataSet ds = new DataSet(); + da.Fill(ds); + + conn.Close(); + if (ds.Tables.Count > 0) + { + dt = ds.Tables[0]; + } + } + + } + catch (Exception err) + { + GlobalVar.log.Error(err.Message); + } + + return dt; + } + + public override int ExecNonQuery(string sql) + { + int res = 0; + try + { + if (conn!=null) + { + var cmd = new SqlCommand(sql, conn); + conn.Open(); + res = cmd.ExecuteNonQuery(); + conn.Close(); + } + } + catch (Exception err) + { + GlobalVar.log.Error(err.Message); + } + return res; + } + } +} \ No newline at end of file diff --git a/DatabaseClient/MysqlClient.cs b/DatabaseClient/MysqlClient.cs new file mode 100644 index 0000000..a22e42f --- /dev/null +++ b/DatabaseClient/MysqlClient.cs @@ -0,0 +1,126 @@ +using MySql.Data.MySqlClient; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DatabaseClient +{ + public class MysqlClient : DBClient + { + MySqlConnection conn; + + public MysqlClient() { } + + public override void Connect(string connString) + { + try + { + conn = new MySqlConnection(connString); + } + catch (Exception err) + { + GlobalVar.log.Error(err.Message); + } + } + + public override DataTable ExecQuery(string sql) + { + DataTable dt = null; + try + { + if (conn != null) + { + conn.Open(); + + MySqlCommand command = new MySqlCommand(sql, conn); + MySqlDataAdapter da = new MySqlDataAdapter(command); + DataSet ds = new DataSet(); + da.Fill(ds); + + conn.Close(); + + if (ds.Tables.Count > 0) + { + dt = ds.Tables[0]; + } + + } + + } + catch (Exception err) + { + GlobalVar.log.Error(err.Message); + } + return dt; + } + + public override int ExecNonQuery(string sql) + { + int res = 0; + + try + { + if (conn != null) + { + conn.Open(); + + MySqlCommand command = new MySqlCommand(sql, conn); + res = command.ExecuteNonQuery(); + + conn.Close(); + } + } + catch (Exception err) + { + GlobalVar.log.Error(err.Message); + } + + return res; + } + + public static bool ExecQueryDataTable(string sql,string ConnectStr,out DataTable dt, out string err) + { + bool success = false; + err = ""; + dt = null; + using (MySqlConnection conn = new MySqlConnection(ConnectStr)) + { + try + { + conn.Open(); + + MySqlCommand command = new MySqlCommand(sql, conn); + MySqlDataAdapter da = new MySqlDataAdapter(command); + DataSet ds = new DataSet(); + da.Fill(ds); + + if (ds.Tables.Count > 0) + { + dt = ds.Tables[0]; + } + success = true; + } + catch (Exception er) + { + err = er.Message; + } + finally + { + if (conn != null) + { + conn.Close(); + } + } + + } + + return success; + } + + + + } +} diff --git a/DatabaseClient/Program.cs b/DatabaseClient/Program.cs new file mode 100644 index 0000000..9f03a4b --- /dev/null +++ b/DatabaseClient/Program.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DatabaseClient +{ + internal class Program + { + static void Main(string[] args) + { + + // TestSqlite(); + TestMysql(); + //TestMssql(); + Console.ReadKey(); + } + static void TestSqlite() + { + var sqlClient = new DBClientFactory("Sqlite").Create(); + sqlClient.Connect("Data Source=mytest.sqlite;Version=3;"); + var ds = sqlClient.ExecQuery("select * from Z_Save_Position"); + } + static void TestMysql() + { + var sqlClient = new DBClientFactory("Mysql").Create(); + sqlClient.Connect("server=192.168.1.204;port=33060;database=zkeco;username=mesuser;password=Mes147258;"); + var ds = sqlClient.ExecQuery("select * from vw_mes_userinfo;"); + } + + static void TestMssql() + { + var sqlClient = new DBClientFactory("Mssql").Create(); + + sqlClient.Connect(@"server=.\WINCC;database=MW_DataFactory_App_Add;uid=sa;pwd=126.com;Connection Reset=FALSE;Max Pool Size = 1000"); + var ds = sqlClient.ExecQuery("select * from ProjectList"); + } + } +} diff --git a/DatabaseClient/Properties/AssemblyInfo.cs b/DatabaseClient/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..8b1127e --- /dev/null +++ b/DatabaseClient/Properties/AssemblyInfo.cs @@ -0,0 +1,38 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Database")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Database")] +[assembly: AssemblyCopyright("Copyright © 2022")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("c7c5e929-be10-4ed6-94db-b8d65e05e52f")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] + +[assembly: log4net.Config.XmlConfigurator(ConfigFile = "DBClientLog4net.config", Watch = true)] \ No newline at end of file diff --git a/DatabaseClient/SqliteClient.cs b/DatabaseClient/SqliteClient.cs new file mode 100644 index 0000000..051c462 --- /dev/null +++ b/DatabaseClient/SqliteClient.cs @@ -0,0 +1,83 @@ +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using System.Data.SQLite; + + + +namespace DatabaseClient +{ + class SqliteClient : DBClient + { + SQLiteConnection conn; + + public SqliteClient() { } + + public override void Connect(string connString) + { + try + { + conn = new SQLiteConnection(connString); + } + catch (Exception err) + { + GlobalVar.log.Error(err.Message); + } + } + + public override int ExecNonQuery(string sql) + { + int res = 0; + try + { + if (conn!=null) + { + conn.Open(); + + var cmd = new SQLiteCommand(sql, conn); + res = cmd.ExecuteNonQuery(); + + conn.Close(); + } + } + catch (Exception err) + { + GlobalVar.log.Error(err.Message); + } + return res; + } + + public override DataTable ExecQuery(string sql) + { + DataTable dt = null; + try + { + if (conn!=null) + { + conn.Open(); + + var cmd = new SQLiteCommand(sql, conn); + SQLiteDataAdapter da = new SQLiteDataAdapter(cmd); + DataSet ds = new DataSet(); + da.Fill(ds); + conn.Close(); + if (ds.Tables.Count > 0) + { + dt = ds.Tables[0]; + } + } + } + catch (Exception err) + { + GlobalVar.log.Error(err.Message); + } + + + return dt; + } + } +} diff --git a/DatabaseClient/packages.config b/DatabaseClient/packages.config new file mode 100644 index 0000000..2a1becf --- /dev/null +++ b/DatabaseClient/packages.config @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ExternalDataSyncSln.sln b/ExternalDataSyncSln.sln new file mode 100644 index 0000000..2b5d944 --- /dev/null +++ b/ExternalDataSyncSln.sln @@ -0,0 +1,48 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.33530.505 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "03_CallWebApi", "CallWebApi\03_CallWebApi.csproj", "{727A1B50-D83A-4319-BDF6-E923F4BD41B3}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{157C56BA-4D67-4ED0-B3D6-6D29888D81B9}" + ProjectSection(SolutionItems) = preProject + ReadMe.md = ReadMe.md + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExternalDataSync", "SlMesDbIterface\ExternalDataSync.csproj", "{2F33D79D-1DFF-4CDA-B357-FCD5221CAB9A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "01_DatabaseClient", "DatabaseClient\01_DatabaseClient.csproj", "{C7C5E929-BE10-4ED6-94DB-B8D65E05E52F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "00_MyLog4Net", "MyLog4Net\00_MyLog4Net.csproj", "{1DC48C83-1842-4DE8-ACAF-26E1E7F7C58F}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {727A1B50-D83A-4319-BDF6-E923F4BD41B3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {727A1B50-D83A-4319-BDF6-E923F4BD41B3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {727A1B50-D83A-4319-BDF6-E923F4BD41B3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {727A1B50-D83A-4319-BDF6-E923F4BD41B3}.Release|Any CPU.Build.0 = Release|Any CPU + {2F33D79D-1DFF-4CDA-B357-FCD5221CAB9A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2F33D79D-1DFF-4CDA-B357-FCD5221CAB9A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2F33D79D-1DFF-4CDA-B357-FCD5221CAB9A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2F33D79D-1DFF-4CDA-B357-FCD5221CAB9A}.Release|Any CPU.Build.0 = Release|Any CPU + {C7C5E929-BE10-4ED6-94DB-B8D65E05E52F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C7C5E929-BE10-4ED6-94DB-B8D65E05E52F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C7C5E929-BE10-4ED6-94DB-B8D65E05E52F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C7C5E929-BE10-4ED6-94DB-B8D65E05E52F}.Release|Any CPU.Build.0 = Release|Any CPU + {1DC48C83-1842-4DE8-ACAF-26E1E7F7C58F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1DC48C83-1842-4DE8-ACAF-26E1E7F7C58F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1DC48C83-1842-4DE8-ACAF-26E1E7F7C58F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1DC48C83-1842-4DE8-ACAF-26E1E7F7C58F}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {0AADB308-CA83-444C-BB95-7C628DA904BB} + EndGlobalSection +EndGlobal diff --git a/MyLog4Net/00_MyLog4Net.csproj b/MyLog4Net/00_MyLog4Net.csproj new file mode 100644 index 0000000..1c1c6ad --- /dev/null +++ b/MyLog4Net/00_MyLog4Net.csproj @@ -0,0 +1,61 @@ + + + + + Debug + AnyCPU + {1DC48C83-1842-4DE8-ACAF-26E1E7F7C58F} + Library + Properties + MyLog4Net + MyLog4Net + v4.8 + 512 + true + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\log4net.2.0.14\lib\net45\log4net.dll + + + + + + + + + + + + + + + + + + + + + Always + + + + \ No newline at end of file diff --git a/MyLog4Net/MyLogEventArgs.cs b/MyLog4Net/MyLogEventArgs.cs new file mode 100644 index 0000000..a913363 --- /dev/null +++ b/MyLog4Net/MyLogEventArgs.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MyLog4Net +{ + public class MyLogEventArgs : EventArgs + { + public string Message { get; set; } + public string Module { get; set; } + } +} diff --git a/MyLog4Net/MyLogHelper.cs b/MyLog4Net/MyLogHelper.cs new file mode 100644 index 0000000..cb446e4 --- /dev/null +++ b/MyLog4Net/MyLogHelper.cs @@ -0,0 +1,65 @@ +using log4net; +using System; + +namespace MyLog4Net +{ + public class MyLogHelper + { + public delegate void MyLogEventHandler(object sender, MyLogEventArgs e); + public static event MyLogEventHandler LogCommit; + + /// + /// 普通日志 + /// + /// 日志内容 + public static void Info(string module, string message) + { + ILog log = LogManager.GetLogger(module); + if (log.IsInfoEnabled) + { + log.Info(message); + + var e = new MyLogEventArgs(); + e.Module = module; + e.Message = message; + LogCommit?.Invoke(null, e); + } + } + /// + /// 错误日志带异常 + /// + /// 错误日志 + public static void Error(string module, string message, Exception ex) + { + ILog log = LogManager.GetLogger(module); + if (log.IsErrorEnabled) + { + log.Error(message, ex); + + var e = new MyLogEventArgs(); + e.Module = module; + e.Message = message; + LogCommit?.Invoke(null, e); + } + } + + /// + /// 错误日志不带异常 + /// + /// 错误日志 + public static void Error(string module, string message) + { + ILog log = LogManager.GetLogger(module); + if (log.IsErrorEnabled) + { + log.Error(message); + + var e = new MyLogEventArgs(); + e.Module = module; + e.Message = message; + LogCommit?.Invoke(null, e); + } + } + } + +} diff --git a/MyLog4Net/Properties/AssemblyInfo.cs b/MyLog4Net/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..1228254 --- /dev/null +++ b/MyLog4Net/Properties/AssemblyInfo.cs @@ -0,0 +1,37 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Log4Net")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Log4Net")] +[assembly: AssemblyCopyright("Copyright © 2022")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("1dc48c83-1842-4de8-acaf-26e1e7f7c58f")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: log4net.Config.XmlConfigurator(ConfigFile = "log4net.config", Watch = true)] diff --git a/MyLog4Net/log4net.config b/MyLog4Net/log4net.config new file mode 100644 index 0000000..92f4d40 --- /dev/null +++ b/MyLog4Net/log4net.config @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MyLog4Net/packages.config b/MyLog4Net/packages.config new file mode 100644 index 0000000..a0798f9 --- /dev/null +++ b/MyLog4Net/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/SlMesDbIterface/AnalysisMsg.cs b/SlMesDbIterface/AnalysisMsg.cs new file mode 100644 index 0000000..2a035b9 --- /dev/null +++ b/SlMesDbIterface/AnalysisMsg.cs @@ -0,0 +1,179 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Data.SqlClient; +using System.Data; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using SlMesDbIterface; +using System.Net.Mail; +using PLMTEST; +using ExternalDataSync.MOM; +using DataLinkMesWork; +using System.Collections; +using System.Drawing.Imaging; + +namespace ExternalDataSync +{ + public class AnalysisMsg + { + /// + /// UUID生成 + /// + /// + public static string UuidUtil() + { + string result = Guid.NewGuid().ToString(); + + return result; + } + + /// + /// 物料主数据下发 + /// + /// + /// + /// + public static string ProductionCalendarData(string url, string str) + { + var result = new msgResHeader(); + result.taskId = UuidUtil(); + result.code = "0"; + result.msg = ""; + result.returnData = ""; + + + + string errorMessage = ""; + string parentID = ""; + int AID = -1; + int isError = 0; + try + { + //存储日志 + var CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"); + //Event_MOM_Log_Insert,@创建时间,@内容 + var param1 = new SqlParameter[] { + new SqlParameter("@接口地址",url), + new SqlParameter("@接口类型",2), // 1. 主动调用接口 2. 被调用接口 + new SqlParameter("@请求内容",str), + new SqlParameter("@请求时间",CreateTime) + }; + DataLinkMesWork.SQLCommon.ExecuteStoredProcedure("接口_IOT接口交互日志_请求记录", Program.ConnectionString, ref param1, out DataTable dt, out errorMessage); + if (dt.Rows.Count > 0) + { + AID = Convert.ToInt32(dt.Rows[0]["AID"]); + } + // 解析订单内容,存储数据库,根据实际业务来写 + ProductionCalendarData BaseData = JsonHelper.JsonDeserialize(str); + + var parsingParam = new SqlParameter[] { + new SqlParameter("@类型",BaseData.typesOf), + new SqlParameter("@类型编码",BaseData.typeCode), + new SqlParameter("@日历编码",BaseData.calendarEncoding), + new SqlParameter("@班次名称",BaseData.shiftName), + new SqlParameter("@开始时间",BaseData.timeOn), + new SqlParameter("@结束时间",BaseData.endTime), + new SqlParameter("@开始日期",BaseData.startDate), + new SqlParameter("@结束日期",BaseData.endDate), + new SqlParameter("@班次描述",BaseData.shiftDescription), + new SqlParameter("@固定休息日",BaseData.fixedRestDays), + }; + DataLinkMesWork.SQLCommon.ExecuteStoredProcedure("接口_接收_生产日历下发_增加", Program.ConnectionString, ref parsingParam, out DataTable parsingDt, out errorMessage); + if (parsingDt.Rows.Count > 0) + { + if (Convert.ToInt32(parsingDt.Rows[0]["result"]) == 1) + { + parentID = BaseData.calendarEncoding; + List statutoryHoliday = BaseData.statutoryHolidays; + + List nonProductionTime = BaseData.nonProductionTime; + if (statutoryHoliday != null) + { + foreach (ProductionCalendarStatutoryData item in statutoryHoliday) + { + var parsingParam2 = new SqlParameter[] { + new SqlParameter("@日历编码",parentID), + new SqlParameter("@开始日期",item.startDate), + new SqlParameter("@结束日期",item.endDate), + }; + DataLinkMesWork.SQLCommon.ExecuteStoredProcedure("接口_接收_生产日历下发_法定节日_增加", Program.ConnectionString, ref parsingParam2, out DataTable parsingDt2, out errorMessage); + + if (errorMessage != "") + { + result.msg = errorMessage; + result.code = "501"; + result.returnData = "ERROR"; + } + } + } + + if (nonProductionTime != null) + { + foreach (ProductionCalendarNonProductionData item in nonProductionTime) + { + var parsingParam2 = new SqlParameter[] { + new SqlParameter("@日历编码",parentID), + new SqlParameter("@开始时间",item.timeOn), + new SqlParameter("@结束时间",item.endTime), + }; + DataLinkMesWork.SQLCommon.ExecuteStoredProcedure("接口_接收_生产日历下发_非生产时间_增加", Program.ConnectionString, ref parsingParam2, out DataTable parsingDt2, out errorMessage); + + if (errorMessage != "") + { + result.msg = errorMessage; + result.code = "501"; + result.returnData = "ERROR"; + } + } + } + } + else + { + isError = 1; + } + } + else + { + isError = 1; + } + + if (isError == 1) + { + result.msg = "存储过程调用失败!"; + result.code = "501"; + result.returnData = "ERROR"; + } + + if (errorMessage != "") + { + result.msg = errorMessage; + result.code = "501"; + result.returnData = "ERROR"; + } + + //响应结果 + CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"); + var resParam = new SqlParameter[] { + new SqlParameter("@AID",AID), + new SqlParameter("@响应时间",CreateTime), + new SqlParameter("@响应内容",JsonConvert.SerializeObject(result)) + }; + DataLinkMesWork.SQLCommon.ExecuteStoredProcedure("接口_IOT接口交互日志_响应记录", Program.ConnectionString, ref resParam, out errorMessage); + if (dt.Rows.Count > 0) + { + AID = Convert.ToInt32(dt.Rows[0]["AID"]); + } + } + catch (Exception err) + { + result.code = "501"; + result.msg = err.Message; + result.returnData = "ERROR"; + } + return JsonConvert.SerializeObject(result); + } + + } +} diff --git a/SlMesDbIterface/App.config b/SlMesDbIterface/App.config new file mode 100644 index 0000000..7a11d9a --- /dev/null +++ b/SlMesDbIterface/App.config @@ -0,0 +1,116 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SlMesDbIterface/Connected Services/ESB_base/ExternalDataSync.ESB_base.baseResponse.datasource b/SlMesDbIterface/Connected Services/ESB_base/ExternalDataSync.ESB_base.baseResponse.datasource new file mode 100644 index 0000000..1678cd8 --- /dev/null +++ b/SlMesDbIterface/Connected Services/ESB_base/ExternalDataSync.ESB_base.baseResponse.datasource @@ -0,0 +1,10 @@ + + + + ExternalDataSync.ESB_base.baseResponse, Connected Services.ESB_base.Reference.cs.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + \ No newline at end of file diff --git a/SlMesDbIterface/Connected Services/ESB_base/ExternalDataSync.ESB_base.interfaceResponse.datasource b/SlMesDbIterface/Connected Services/ESB_base/ExternalDataSync.ESB_base.interfaceResponse.datasource new file mode 100644 index 0000000..24b0918 --- /dev/null +++ b/SlMesDbIterface/Connected Services/ESB_base/ExternalDataSync.ESB_base.interfaceResponse.datasource @@ -0,0 +1,10 @@ + + + + ExternalDataSync.ESB_base.interfaceResponse, Connected Services.ESB_base.Reference.cs.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + \ No newline at end of file diff --git a/SlMesDbIterface/Connected Services/ESB_base/Reference.cs b/SlMesDbIterface/Connected Services/ESB_base/Reference.cs new file mode 100644 index 0000000..9aae7fb --- /dev/null +++ b/SlMesDbIterface/Connected Services/ESB_base/Reference.cs @@ -0,0 +1,497 @@ +//------------------------------------------------------------------------------ +// +// 此代码由工具生成。 +// 运行时版本:4.0.30319.42000 +// +// 对此文件的更改可能会导致不正确的行为,并且如果 +// 重新生成代码,这些更改将会丢失。 +// +//------------------------------------------------------------------------------ + +namespace ExternalDataSync.ESB_base { + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + [System.ServiceModel.ServiceContractAttribute(Namespace="http://zk.ws.epichust.com/", ConfigurationName="ESB_base.UrmRsBaseInterface")] + public interface UrmRsBaseInterface { + + // CODEGEN: 参数“return”需要其他方案信息,使用参数模式无法捕获这些信息。特定特性为“System.Xml.Serialization.XmlElementAttribute”。 + [System.ServiceModel.OperationContractAttribute(Action="", ReplyAction="*")] + [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults=true)] + [return: System.ServiceModel.MessageParameterAttribute(Name="return")] + ExternalDataSync.ESB_base.baseResponse @base(ExternalDataSync.ESB_base.@base request); + + [System.ServiceModel.OperationContractAttribute(Action="", ReplyAction="*")] + System.Threading.Tasks.Task baseAsync(ExternalDataSync.ESB_base.@base request); + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.4161.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://zk.ws.epichust.com/")] + public partial class interfaceRequestHeader : object, System.ComponentModel.INotifyPropertyChanged { + + private string interfaceIDField; + + private string messageIDField; + + private string receiverField; + + private string senderField; + + private string transIDField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)] + public string interfaceID { + get { + return this.interfaceIDField; + } + set { + this.interfaceIDField = value; + this.RaisePropertyChanged("interfaceID"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)] + public string messageID { + get { + return this.messageIDField; + } + set { + this.messageIDField = value; + this.RaisePropertyChanged("messageID"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=2)] + public string receiver { + get { + return this.receiverField; + } + set { + this.receiverField = value; + this.RaisePropertyChanged("receiver"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=3)] + public string sender { + get { + return this.senderField; + } + set { + this.senderField = value; + this.RaisePropertyChanged("sender"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=4)] + public string transID { + get { + return this.transIDField; + } + set { + this.transIDField = value; + this.RaisePropertyChanged("transID"); + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + protected void RaisePropertyChanged(string propertyName) { + System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged; + if ((propertyChanged != null)) { + propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.4161.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://zk.ws.epichust.com/")] + public partial class interfaceResponse : object, System.ComponentModel.INotifyPropertyChanged { + + private string commentField; + + private string interfaceIDField; + + private string messageIDField; + + private string resultCodeField; + + private string resultMessageField; + + private string resultTypeField; + + private string transIDField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)] + public string comment { + get { + return this.commentField; + } + set { + this.commentField = value; + this.RaisePropertyChanged("comment"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)] + public string interfaceID { + get { + return this.interfaceIDField; + } + set { + this.interfaceIDField = value; + this.RaisePropertyChanged("interfaceID"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=2)] + public string messageID { + get { + return this.messageIDField; + } + set { + this.messageIDField = value; + this.RaisePropertyChanged("messageID"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=3)] + public string resultCode { + get { + return this.resultCodeField; + } + set { + this.resultCodeField = value; + this.RaisePropertyChanged("resultCode"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=4)] + public string resultMessage { + get { + return this.resultMessageField; + } + set { + this.resultMessageField = value; + this.RaisePropertyChanged("resultMessage"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=5)] + public string resultType { + get { + return this.resultTypeField; + } + set { + this.resultTypeField = value; + this.RaisePropertyChanged("resultType"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=6)] + public string transID { + get { + return this.transIDField; + } + set { + this.transIDField = value; + this.RaisePropertyChanged("transID"); + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + protected void RaisePropertyChanged(string propertyName) { + System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged; + if ((propertyChanged != null)) { + propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.4161.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://zk.ws.epichust.com/")] + public partial class rsBaseInfoTo : object, System.ComponentModel.INotifyPropertyChanged { + + private string alarmDateField; + + private string equipCodeField; + + private string siteField; + + private string toolCodeField; + + private string toolDownProdutionField; + + private string toolDownReasonField; + + private string toolDownResidualField; + + private string toolDownTypeField; + + private string workCellCodeField; + + private string workCenterField; + + private string tNumberField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)] + public string alarmDate { + get { + return this.alarmDateField; + } + set { + this.alarmDateField = value; + this.RaisePropertyChanged("alarmDate"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)] + public string equipCode { + get { + return this.equipCodeField; + } + set { + this.equipCodeField = value; + this.RaisePropertyChanged("equipCode"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=2)] + public string site { + get { + return this.siteField; + } + set { + this.siteField = value; + this.RaisePropertyChanged("site"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=3)] + public string toolCode { + get { + return this.toolCodeField; + } + set { + this.toolCodeField = value; + this.RaisePropertyChanged("toolCode"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=4)] + public string toolDownProdution { + get { + return this.toolDownProdutionField; + } + set { + this.toolDownProdutionField = value; + this.RaisePropertyChanged("toolDownProdution"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=5)] + public string toolDownReason { + get { + return this.toolDownReasonField; + } + set { + this.toolDownReasonField = value; + this.RaisePropertyChanged("toolDownReason"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=6)] + public string toolDownResidual { + get { + return this.toolDownResidualField; + } + set { + this.toolDownResidualField = value; + this.RaisePropertyChanged("toolDownResidual"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=7)] + public string toolDownType { + get { + return this.toolDownTypeField; + } + set { + this.toolDownTypeField = value; + this.RaisePropertyChanged("toolDownType"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=8)] + public string workCellCode { + get { + return this.workCellCodeField; + } + set { + this.workCellCodeField = value; + this.RaisePropertyChanged("workCellCode"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=9)] + public string workCenter { + get { + return this.workCenterField; + } + set { + this.workCenterField = value; + this.RaisePropertyChanged("workCenter"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=10)] + public string tNumber { + get { + return this.tNumberField; + } + set { + this.tNumberField = value; + this.RaisePropertyChanged("tNumber"); + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + protected void RaisePropertyChanged(string propertyName) { + System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged; + if ((propertyChanged != null)) { + propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + [System.ServiceModel.MessageContractAttribute(WrapperName="base", WrapperNamespace="http://zk.ws.epichust.com/", IsWrapped=true)] + public partial class @base { + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://zk.ws.epichust.com/", Order=0)] + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] + public ExternalDataSync.ESB_base.interfaceRequestHeader arg0; + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://zk.ws.epichust.com/", Order=1)] + [System.Xml.Serialization.XmlElementAttribute("arg1", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] + public ExternalDataSync.ESB_base.rsBaseInfoTo[] arg1; + + public @base() { + } + + public @base(ExternalDataSync.ESB_base.interfaceRequestHeader arg0, ExternalDataSync.ESB_base.rsBaseInfoTo[] arg1) { + this.arg0 = arg0; + this.arg1 = arg1; + } + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + [System.ServiceModel.MessageContractAttribute(WrapperName="baseResponse", WrapperNamespace="http://zk.ws.epichust.com/", IsWrapped=true)] + public partial class baseResponse { + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://zk.ws.epichust.com/", Order=0)] + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] + public ExternalDataSync.ESB_base.interfaceResponse @return; + + public baseResponse() { + } + + public baseResponse(ExternalDataSync.ESB_base.interfaceResponse @return) { + this.@return = @return; + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + public interface UrmRsBaseInterfaceChannel : ExternalDataSync.ESB_base.UrmRsBaseInterface, System.ServiceModel.IClientChannel { + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + public partial class UrmRsBaseInterfaceClient : System.ServiceModel.ClientBase, ExternalDataSync.ESB_base.UrmRsBaseInterface { + + public UrmRsBaseInterfaceClient() { + } + + public UrmRsBaseInterfaceClient(string endpointConfigurationName) : + base(endpointConfigurationName) { + } + + public UrmRsBaseInterfaceClient(string endpointConfigurationName, string remoteAddress) : + base(endpointConfigurationName, remoteAddress) { + } + + public UrmRsBaseInterfaceClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) : + base(endpointConfigurationName, remoteAddress) { + } + + public UrmRsBaseInterfaceClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : + base(binding, remoteAddress) { + } + + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + ExternalDataSync.ESB_base.baseResponse ExternalDataSync.ESB_base.UrmRsBaseInterface.@base(ExternalDataSync.ESB_base.@base request) { + return base.Channel.@base(request); + } + + public ExternalDataSync.ESB_base.interfaceResponse @base(ExternalDataSync.ESB_base.interfaceRequestHeader arg0, ExternalDataSync.ESB_base.rsBaseInfoTo[] arg1) { + ExternalDataSync.ESB_base.@base inValue = new ExternalDataSync.ESB_base.@base(); + inValue.arg0 = arg0; + inValue.arg1 = arg1; + ExternalDataSync.ESB_base.baseResponse retVal = ((ExternalDataSync.ESB_base.UrmRsBaseInterface)(this)).@base(inValue); + return retVal.@return; + } + + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + System.Threading.Tasks.Task ExternalDataSync.ESB_base.UrmRsBaseInterface.baseAsync(ExternalDataSync.ESB_base.@base request) { + return base.Channel.baseAsync(request); + } + + public System.Threading.Tasks.Task baseAsync(ExternalDataSync.ESB_base.interfaceRequestHeader arg0, ExternalDataSync.ESB_base.rsBaseInfoTo[] arg1) { + ExternalDataSync.ESB_base.@base inValue = new ExternalDataSync.ESB_base.@base(); + inValue.arg0 = arg0; + inValue.arg1 = arg1; + return ((ExternalDataSync.ESB_base.UrmRsBaseInterface)(this)).baseAsync(inValue); + } + } +} diff --git a/SlMesDbIterface/Connected Services/ESB_base/Reference.svcmap b/SlMesDbIterface/Connected Services/ESB_base/Reference.svcmap new file mode 100644 index 0000000..25b3409 --- /dev/null +++ b/SlMesDbIterface/Connected Services/ESB_base/Reference.svcmap @@ -0,0 +1,32 @@ + + + + false + true + true + + false + false + false + + + true + Auto + true + true + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/SlMesDbIterface/Connected Services/ESB_base/UrmRsBaseInterface2.wsdl b/SlMesDbIterface/Connected Services/ESB_base/UrmRsBaseInterface2.wsdl new file mode 100644 index 0000000..acb39bf --- /dev/null +++ b/SlMesDbIterface/Connected Services/ESB_base/UrmRsBaseInterface2.wsdl @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/SlMesDbIterface/Connected Services/ESB_base/configuration.svcinfo b/SlMesDbIterface/Connected Services/ESB_base/configuration.svcinfo new file mode 100644 index 0000000..c56d4c7 --- /dev/null +++ b/SlMesDbIterface/Connected Services/ESB_base/configuration.svcinfo @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/SlMesDbIterface/Connected Services/ESB_base/configuration91.svcinfo b/SlMesDbIterface/Connected Services/ESB_base/configuration91.svcinfo new file mode 100644 index 0000000..f56e88e --- /dev/null +++ b/SlMesDbIterface/Connected Services/ESB_base/configuration91.svcinfo @@ -0,0 +1,201 @@ + + + + + + + urmRsBaseInterfaceSoapBinding + + + + + + + + + + + + + + + + + + + + + StrongWildcard + + + + + + 65536 + + + + + + + + + System.ServiceModel.Configuration.XmlDictionaryReaderQuotasElement + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + System.Text.UTF8Encoding + + + Buffered + + + + + + Text + + + System.ServiceModel.Configuration.BasicHttpSecurityElement + + + None + + + System.ServiceModel.Configuration.HttpTransportSecurityElement + + + None + + + None + + + System.Security.Authentication.ExtendedProtection.Configuration.ExtendedProtectionPolicyElement + + + Never + + + TransportSelected + + + (集合) + + + + + + System.ServiceModel.Configuration.BasicHttpMessageSecurityElement + + + UserName + + + Default + + + + + + + + + http://10.6.201.184:8011/CDMOM/COMMON/COMMON2CDMOM_CutterDownInfo/ProxyServices/CutterDownInfoPS + + + + + + basicHttpBinding + + + urmRsBaseInterfaceSoapBinding + + + ESB_base.UrmRsBaseInterface + + + System.ServiceModel.Configuration.AddressHeaderCollectionElement + + + <Header /> + + + System.ServiceModel.Configuration.IdentityElement + + + System.ServiceModel.Configuration.UserPrincipalNameElement + + + + + + System.ServiceModel.Configuration.ServicePrincipalNameElement + + + + + + System.ServiceModel.Configuration.DnsElement + + + + + + System.ServiceModel.Configuration.RsaElement + + + + + + System.ServiceModel.Configuration.CertificateElement + + + + + + System.ServiceModel.Configuration.CertificateReferenceElement + + + My + + + LocalMachine + + + FindBySubjectDistinguishedName + + + + + + False + + + UrmRsBaseInterfaceImplPort + + + + + + + + + + + \ No newline at end of file diff --git a/SlMesDbIterface/Connected Services/ESB_base/urmRsBaseInterface.wsdl b/SlMesDbIterface/Connected Services/ESB_base/urmRsBaseInterface.wsdl new file mode 100644 index 0000000..3d02d0b --- /dev/null +++ b/SlMesDbIterface/Connected Services/ESB_base/urmRsBaseInterface.wsdl @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + OSB Service + + + + + \ No newline at end of file diff --git a/SlMesDbIterface/Connected Services/ESB_collt/ColltReInterface2.wsdl b/SlMesDbIterface/Connected Services/ESB_collt/ColltReInterface2.wsdl new file mode 100644 index 0000000..51cca5a --- /dev/null +++ b/SlMesDbIterface/Connected Services/ESB_collt/ColltReInterface2.wsdl @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/SlMesDbIterface/Connected Services/ESB_collt/ExternalDataSync.ESB_collt.colltResponse.datasource b/SlMesDbIterface/Connected Services/ESB_collt/ExternalDataSync.ESB_collt.colltResponse.datasource new file mode 100644 index 0000000..3563b3d --- /dev/null +++ b/SlMesDbIterface/Connected Services/ESB_collt/ExternalDataSync.ESB_collt.colltResponse.datasource @@ -0,0 +1,10 @@ + + + + ExternalDataSync.ESB_collt.colltResponse, Connected Services.ESB_collt.Reference.cs.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + \ No newline at end of file diff --git a/SlMesDbIterface/Connected Services/ESB_collt/ExternalDataSync.ESB_collt.interfaceResponse.datasource b/SlMesDbIterface/Connected Services/ESB_collt/ExternalDataSync.ESB_collt.interfaceResponse.datasource new file mode 100644 index 0000000..93bf208 --- /dev/null +++ b/SlMesDbIterface/Connected Services/ESB_collt/ExternalDataSync.ESB_collt.interfaceResponse.datasource @@ -0,0 +1,10 @@ + + + + ExternalDataSync.ESB_collt.interfaceResponse, Connected Services.ESB_collt.Reference.cs.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + \ No newline at end of file diff --git a/SlMesDbIterface/Connected Services/ESB_collt/Reference.cs b/SlMesDbIterface/Connected Services/ESB_collt/Reference.cs new file mode 100644 index 0000000..f3d6f5d --- /dev/null +++ b/SlMesDbIterface/Connected Services/ESB_collt/Reference.cs @@ -0,0 +1,515 @@ +//------------------------------------------------------------------------------ +// +// 此代码由工具生成。 +// 运行时版本:4.0.30319.42000 +// +// 对此文件的更改可能会导致不正确的行为,并且如果 +// 重新生成代码,这些更改将会丢失。 +// +//------------------------------------------------------------------------------ + +namespace ExternalDataSync.ESB_collt { + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + [System.ServiceModel.ServiceContractAttribute(Namespace="http://zk.ws.epichust.com/", ConfigurationName="ESB_collt.ColltReInterface")] + public interface ColltReInterface { + + // CODEGEN: 参数“return”需要其他方案信息,使用参数模式无法捕获这些信息。特定特性为“System.Xml.Serialization.XmlElementAttribute”。 + [System.ServiceModel.OperationContractAttribute(Action="", ReplyAction="*")] + [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults=true)] + [return: System.ServiceModel.MessageParameterAttribute(Name="return")] + ExternalDataSync.ESB_collt.colltResponse collt(ExternalDataSync.ESB_collt.collt request); + + [System.ServiceModel.OperationContractAttribute(Action="", ReplyAction="*")] + System.Threading.Tasks.Task colltAsync(ExternalDataSync.ESB_collt.collt request); + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.4161.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://zk.ws.epichust.com/")] + public partial class interfaceRequestHeader : object, System.ComponentModel.INotifyPropertyChanged { + + private string interfaceIDField; + + private string messageIDField; + + private string receiverField; + + private string senderField; + + private string transIDField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)] + public string interfaceID { + get { + return this.interfaceIDField; + } + set { + this.interfaceIDField = value; + this.RaisePropertyChanged("interfaceID"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)] + public string messageID { + get { + return this.messageIDField; + } + set { + this.messageIDField = value; + this.RaisePropertyChanged("messageID"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=2)] + public string receiver { + get { + return this.receiverField; + } + set { + this.receiverField = value; + this.RaisePropertyChanged("receiver"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=3)] + public string sender { + get { + return this.senderField; + } + set { + this.senderField = value; + this.RaisePropertyChanged("sender"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=4)] + public string transID { + get { + return this.transIDField; + } + set { + this.transIDField = value; + this.RaisePropertyChanged("transID"); + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + protected void RaisePropertyChanged(string propertyName) { + System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged; + if ((propertyChanged != null)) { + propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.4161.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://zk.ws.epichust.com/")] + public partial class interfaceResponse : object, System.ComponentModel.INotifyPropertyChanged { + + private string commentField; + + private string interfaceIDField; + + private string messageIDField; + + private string resultCodeField; + + private string resultMessageField; + + private string resultTypeField; + + private string transIDField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)] + public string comment { + get { + return this.commentField; + } + set { + this.commentField = value; + this.RaisePropertyChanged("comment"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)] + public string interfaceID { + get { + return this.interfaceIDField; + } + set { + this.interfaceIDField = value; + this.RaisePropertyChanged("interfaceID"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=2)] + public string messageID { + get { + return this.messageIDField; + } + set { + this.messageIDField = value; + this.RaisePropertyChanged("messageID"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=3)] + public string resultCode { + get { + return this.resultCodeField; + } + set { + this.resultCodeField = value; + this.RaisePropertyChanged("resultCode"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=4)] + public string resultMessage { + get { + return this.resultMessageField; + } + set { + this.resultMessageField = value; + this.RaisePropertyChanged("resultMessage"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=5)] + public string resultType { + get { + return this.resultTypeField; + } + set { + this.resultTypeField = value; + this.RaisePropertyChanged("resultType"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=6)] + public string transID { + get { + return this.transIDField; + } + set { + this.transIDField = value; + this.RaisePropertyChanged("transID"); + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + protected void RaisePropertyChanged(string propertyName) { + System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged; + if ((propertyChanged != null)) { + propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.4161.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://zk.ws.epichust.com/")] + public partial class citemInfoTo : object, System.ComponentModel.INotifyPropertyChanged { + + private string actualValueField; + + private string citemCodeField; + + private string citemNameField; + + private string citemRemarkField; + + private string isOKField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)] + public string actualValue { + get { + return this.actualValueField; + } + set { + this.actualValueField = value; + this.RaisePropertyChanged("actualValue"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)] + public string citemCode { + get { + return this.citemCodeField; + } + set { + this.citemCodeField = value; + this.RaisePropertyChanged("citemCode"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=2)] + public string citemName { + get { + return this.citemNameField; + } + set { + this.citemNameField = value; + this.RaisePropertyChanged("citemName"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=3)] + public string citemRemark { + get { + return this.citemRemarkField; + } + set { + this.citemRemarkField = value; + this.RaisePropertyChanged("citemRemark"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=4)] + public string isOK { + get { + return this.isOKField; + } + set { + this.isOKField = value; + this.RaisePropertyChanged("isOK"); + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + protected void RaisePropertyChanged(string propertyName) { + System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged; + if ((propertyChanged != null)) { + propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.4161.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://zk.ws.epichust.com/")] + public partial class colltReInfoTo : object, System.ComponentModel.INotifyPropertyChanged { + + private string acqTimeField; + + private citemInfoTo[] citemInfoToField; + + private string equipCodeField; + + private string siteField; + + private string workCellCodeField; + + private string workCenterField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)] + public string acqTime { + get { + return this.acqTimeField; + } + set { + this.acqTimeField = value; + this.RaisePropertyChanged("acqTime"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("citemInfoTo", Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true, Order=1)] + public citemInfoTo[] citemInfoTo { + get { + return this.citemInfoToField; + } + set { + this.citemInfoToField = value; + this.RaisePropertyChanged("citemInfoTo"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=2)] + public string equipCode { + get { + return this.equipCodeField; + } + set { + this.equipCodeField = value; + this.RaisePropertyChanged("equipCode"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=3)] + public string site { + get { + return this.siteField; + } + set { + this.siteField = value; + this.RaisePropertyChanged("site"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=4)] + public string workCellCode { + get { + return this.workCellCodeField; + } + set { + this.workCellCodeField = value; + this.RaisePropertyChanged("workCellCode"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=5)] + public string workCenter { + get { + return this.workCenterField; + } + set { + this.workCenterField = value; + this.RaisePropertyChanged("workCenter"); + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + protected void RaisePropertyChanged(string propertyName) { + System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged; + if ((propertyChanged != null)) { + propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + [System.ServiceModel.MessageContractAttribute(WrapperName="collt", WrapperNamespace="http://zk.ws.epichust.com/", IsWrapped=true)] + public partial class collt { + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://zk.ws.epichust.com/", Order=0)] + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] + public ExternalDataSync.ESB_collt.interfaceRequestHeader arg0; + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://zk.ws.epichust.com/", Order=1)] + [System.Xml.Serialization.XmlElementAttribute("arg1", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] + public ExternalDataSync.ESB_collt.colltReInfoTo[] arg1; + + public collt() { + } + + public collt(ExternalDataSync.ESB_collt.interfaceRequestHeader arg0, ExternalDataSync.ESB_collt.colltReInfoTo[] arg1) { + this.arg0 = arg0; + this.arg1 = arg1; + } + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + [System.ServiceModel.MessageContractAttribute(WrapperName="colltResponse", WrapperNamespace="http://zk.ws.epichust.com/", IsWrapped=true)] + public partial class colltResponse { + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://zk.ws.epichust.com/", Order=0)] + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] + public ExternalDataSync.ESB_collt.interfaceResponse @return; + + public colltResponse() { + } + + public colltResponse(ExternalDataSync.ESB_collt.interfaceResponse @return) { + this.@return = @return; + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + public interface ColltReInterfaceChannel : ExternalDataSync.ESB_collt.ColltReInterface, System.ServiceModel.IClientChannel { + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + public partial class ColltReInterfaceClient : System.ServiceModel.ClientBase, ExternalDataSync.ESB_collt.ColltReInterface { + + public ColltReInterfaceClient() { + } + + public ColltReInterfaceClient(string endpointConfigurationName) : + base(endpointConfigurationName) { + } + + public ColltReInterfaceClient(string endpointConfigurationName, string remoteAddress) : + base(endpointConfigurationName, remoteAddress) { + } + + public ColltReInterfaceClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) : + base(endpointConfigurationName, remoteAddress) { + } + + public ColltReInterfaceClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : + base(binding, remoteAddress) { + } + + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + ExternalDataSync.ESB_collt.colltResponse ExternalDataSync.ESB_collt.ColltReInterface.collt(ExternalDataSync.ESB_collt.collt request) { + return base.Channel.collt(request); + } + + public ExternalDataSync.ESB_collt.interfaceResponse collt(ExternalDataSync.ESB_collt.interfaceRequestHeader arg0, ExternalDataSync.ESB_collt.colltReInfoTo[] arg1) { + ExternalDataSync.ESB_collt.collt inValue = new ExternalDataSync.ESB_collt.collt(); + inValue.arg0 = arg0; + inValue.arg1 = arg1; + ExternalDataSync.ESB_collt.colltResponse retVal = ((ExternalDataSync.ESB_collt.ColltReInterface)(this)).collt(inValue); + return retVal.@return; + } + + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + System.Threading.Tasks.Task ExternalDataSync.ESB_collt.ColltReInterface.colltAsync(ExternalDataSync.ESB_collt.collt request) { + return base.Channel.colltAsync(request); + } + + public System.Threading.Tasks.Task colltAsync(ExternalDataSync.ESB_collt.interfaceRequestHeader arg0, ExternalDataSync.ESB_collt.colltReInfoTo[] arg1) { + ExternalDataSync.ESB_collt.collt inValue = new ExternalDataSync.ESB_collt.collt(); + inValue.arg0 = arg0; + inValue.arg1 = arg1; + return ((ExternalDataSync.ESB_collt.ColltReInterface)(this)).colltAsync(inValue); + } + } +} diff --git a/SlMesDbIterface/Connected Services/ESB_collt/Reference.svcmap b/SlMesDbIterface/Connected Services/ESB_collt/Reference.svcmap new file mode 100644 index 0000000..063ba59 --- /dev/null +++ b/SlMesDbIterface/Connected Services/ESB_collt/Reference.svcmap @@ -0,0 +1,32 @@ + + + + false + true + true + + false + false + false + + + true + Auto + true + true + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/SlMesDbIterface/Connected Services/ESB_collt/colltReInterface.wsdl b/SlMesDbIterface/Connected Services/ESB_collt/colltReInterface.wsdl new file mode 100644 index 0000000..a112612 --- /dev/null +++ b/SlMesDbIterface/Connected Services/ESB_collt/colltReInterface.wsdl @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + OSB Service + + + + + \ No newline at end of file diff --git a/SlMesDbIterface/Connected Services/ESB_collt/configuration.svcinfo b/SlMesDbIterface/Connected Services/ESB_collt/configuration.svcinfo new file mode 100644 index 0000000..1deb5af --- /dev/null +++ b/SlMesDbIterface/Connected Services/ESB_collt/configuration.svcinfo @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/SlMesDbIterface/Connected Services/ESB_collt/configuration91.svcinfo b/SlMesDbIterface/Connected Services/ESB_collt/configuration91.svcinfo new file mode 100644 index 0000000..e574fda --- /dev/null +++ b/SlMesDbIterface/Connected Services/ESB_collt/configuration91.svcinfo @@ -0,0 +1,201 @@ + + + + + + + colltReInterfaceSoapBinding + + + + + + + + + + + + + + + + + + + + + StrongWildcard + + + + + + 65536 + + + + + + + + + System.ServiceModel.Configuration.XmlDictionaryReaderQuotasElement + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + System.Text.UTF8Encoding + + + Buffered + + + + + + Text + + + System.ServiceModel.Configuration.BasicHttpSecurityElement + + + None + + + System.ServiceModel.Configuration.HttpTransportSecurityElement + + + None + + + None + + + System.Security.Authentication.ExtendedProtection.Configuration.ExtendedProtectionPolicyElement + + + Never + + + TransportSelected + + + (集合) + + + + + + System.ServiceModel.Configuration.BasicHttpMessageSecurityElement + + + UserName + + + Default + + + + + + + + + http://10.6.201.184:8011/CDMOM/COMMON/COMMON2CDMOM_EquipmentParameter/ProxyServices/EquipmentParameterPS + + + + + + basicHttpBinding + + + colltReInterfaceSoapBinding + + + ESB_collt.ColltReInterface + + + System.ServiceModel.Configuration.AddressHeaderCollectionElement + + + <Header /> + + + System.ServiceModel.Configuration.IdentityElement + + + System.ServiceModel.Configuration.UserPrincipalNameElement + + + + + + System.ServiceModel.Configuration.ServicePrincipalNameElement + + + + + + System.ServiceModel.Configuration.DnsElement + + + + + + System.ServiceModel.Configuration.RsaElement + + + + + + System.ServiceModel.Configuration.CertificateElement + + + + + + System.ServiceModel.Configuration.CertificateReferenceElement + + + My + + + LocalMachine + + + FindBySubjectDistinguishedName + + + + + + False + + + ColltReInterfaceImplPort + + + + + + + + + + + \ No newline at end of file diff --git a/SlMesDbIterface/Connected Services/ESB_daq/.editorconfig b/SlMesDbIterface/Connected Services/ESB_daq/.editorconfig new file mode 100644 index 0000000..e69de29 diff --git a/SlMesDbIterface/Connected Services/ESB_daq/ExternalDataSync.ESB_daq.daqResponse.datasource b/SlMesDbIterface/Connected Services/ESB_daq/ExternalDataSync.ESB_daq.daqResponse.datasource new file mode 100644 index 0000000..1cf722c --- /dev/null +++ b/SlMesDbIterface/Connected Services/ESB_daq/ExternalDataSync.ESB_daq.daqResponse.datasource @@ -0,0 +1,10 @@ + + + + ExternalDataSync.ESB_daq.daqResponse, Connected Services.ESB_daq.Reference.cs.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + \ No newline at end of file diff --git a/SlMesDbIterface/Connected Services/ESB_daq/ExternalDataSync.ESB_daq.interfaceResponse.datasource b/SlMesDbIterface/Connected Services/ESB_daq/ExternalDataSync.ESB_daq.interfaceResponse.datasource new file mode 100644 index 0000000..bb7d07b --- /dev/null +++ b/SlMesDbIterface/Connected Services/ESB_daq/ExternalDataSync.ESB_daq.interfaceResponse.datasource @@ -0,0 +1,10 @@ + + + + ExternalDataSync.ESB_daq.interfaceResponse, Connected Services.ESB_daq.Reference.cs.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + \ No newline at end of file diff --git a/SlMesDbIterface/Connected Services/ESB_daq/Reference.cs b/SlMesDbIterface/Connected Services/ESB_daq/Reference.cs new file mode 100644 index 0000000..e745675 --- /dev/null +++ b/SlMesDbIterface/Connected Services/ESB_daq/Reference.cs @@ -0,0 +1,539 @@ +//------------------------------------------------------------------------------ +// +// 此代码由工具生成。 +// 运行时版本:4.0.30319.42000 +// +// 对此文件的更改可能会导致不正确的行为,并且如果 +// 重新生成代码,这些更改将会丢失。 +// +//------------------------------------------------------------------------------ + +namespace ExternalDataSync.ESB_daq { + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + [System.ServiceModel.ServiceContractAttribute(Namespace="http://zk.ws.epichust.com/", ConfigurationName="ESB_daq.UexDaqInfoInterface")] + public interface UexDaqInfoInterface { + + // CODEGEN: 参数“return”需要其他方案信息,使用参数模式无法捕获这些信息。特定特性为“System.Xml.Serialization.XmlElementAttribute”。 + [System.ServiceModel.OperationContractAttribute(Action="", ReplyAction="*")] + [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults=true)] + [return: System.ServiceModel.MessageParameterAttribute(Name="return")] + ExternalDataSync.ESB_daq.daqResponse daq(ExternalDataSync.ESB_daq.daq request); + + [System.ServiceModel.OperationContractAttribute(Action="", ReplyAction="*")] + System.Threading.Tasks.Task daqAsync(ExternalDataSync.ESB_daq.daq request); + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.4161.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://zk.ws.epichust.com/")] + public partial class interfaceRequestHeader : object, System.ComponentModel.INotifyPropertyChanged { + + private string interfaceIDField; + + private string messageIDField; + + private string receiverField; + + private string senderField; + + private string transIDField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)] + public string interfaceID { + get { + return this.interfaceIDField; + } + set { + this.interfaceIDField = value; + this.RaisePropertyChanged("interfaceID"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)] + public string messageID { + get { + return this.messageIDField; + } + set { + this.messageIDField = value; + this.RaisePropertyChanged("messageID"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=2)] + public string receiver { + get { + return this.receiverField; + } + set { + this.receiverField = value; + this.RaisePropertyChanged("receiver"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=3)] + public string sender { + get { + return this.senderField; + } + set { + this.senderField = value; + this.RaisePropertyChanged("sender"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=4)] + public string transID { + get { + return this.transIDField; + } + set { + this.transIDField = value; + this.RaisePropertyChanged("transID"); + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + protected void RaisePropertyChanged(string propertyName) { + System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged; + if ((propertyChanged != null)) { + propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.4161.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://zk.ws.epichust.com/")] + public partial class interfaceResponse : object, System.ComponentModel.INotifyPropertyChanged { + + private string commentField; + + private string interfaceIDField; + + private string messageIDField; + + private string resultCodeField; + + private string resultMessageField; + + private string resultTypeField; + + private string transIDField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)] + public string comment { + get { + return this.commentField; + } + set { + this.commentField = value; + this.RaisePropertyChanged("comment"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)] + public string interfaceID { + get { + return this.interfaceIDField; + } + set { + this.interfaceIDField = value; + this.RaisePropertyChanged("interfaceID"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=2)] + public string messageID { + get { + return this.messageIDField; + } + set { + this.messageIDField = value; + this.RaisePropertyChanged("messageID"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=3)] + public string resultCode { + get { + return this.resultCodeField; + } + set { + this.resultCodeField = value; + this.RaisePropertyChanged("resultCode"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=4)] + public string resultMessage { + get { + return this.resultMessageField; + } + set { + this.resultMessageField = value; + this.RaisePropertyChanged("resultMessage"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=5)] + public string resultType { + get { + return this.resultTypeField; + } + set { + this.resultTypeField = value; + this.RaisePropertyChanged("resultType"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=6)] + public string transID { + get { + return this.transIDField; + } + set { + this.transIDField = value; + this.RaisePropertyChanged("transID"); + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + protected void RaisePropertyChanged(string propertyName) { + System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged; + if ((propertyChanged != null)) { + propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.4161.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://zk.ws.epichust.com/")] + public partial class uexDaqInfoExTo : object, System.ComponentModel.INotifyPropertyChanged { + + private string containerIDField; + + private string daqDateField; + + private string daqIDField; + + private string daqTypeField; + + private string discardQtyField; + + private string effectiveQtyField; + + private string opCodeField; + + private string operateTypeField; + + private string produCodeField; + + private string siteField; + + private string stationField; + + private string unEffectiveQtyField; + + private string workCenterField; + + private string workOrderCodeField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)] + public string containerID { + get { + return this.containerIDField; + } + set { + this.containerIDField = value; + this.RaisePropertyChanged("containerID"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)] + public string daqDate { + get { + return this.daqDateField; + } + set { + this.daqDateField = value; + this.RaisePropertyChanged("daqDate"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=2)] + public string daqID { + get { + return this.daqIDField; + } + set { + this.daqIDField = value; + this.RaisePropertyChanged("daqID"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=3)] + public string daqType { + get { + return this.daqTypeField; + } + set { + this.daqTypeField = value; + this.RaisePropertyChanged("daqType"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=4)] + public string discardQty { + get { + return this.discardQtyField; + } + set { + this.discardQtyField = value; + this.RaisePropertyChanged("discardQty"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=5)] + public string effectiveQty { + get { + return this.effectiveQtyField; + } + set { + this.effectiveQtyField = value; + this.RaisePropertyChanged("effectiveQty"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=6)] + public string opCode { + get { + return this.opCodeField; + } + set { + this.opCodeField = value; + this.RaisePropertyChanged("opCode"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=7)] + public string operateType { + get { + return this.operateTypeField; + } + set { + this.operateTypeField = value; + this.RaisePropertyChanged("operateType"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=8)] + public string produCode { + get { + return this.produCodeField; + } + set { + this.produCodeField = value; + this.RaisePropertyChanged("produCode"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=9)] + public string site { + get { + return this.siteField; + } + set { + this.siteField = value; + this.RaisePropertyChanged("site"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=10)] + public string station { + get { + return this.stationField; + } + set { + this.stationField = value; + this.RaisePropertyChanged("station"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=11)] + public string unEffectiveQty { + get { + return this.unEffectiveQtyField; + } + set { + this.unEffectiveQtyField = value; + this.RaisePropertyChanged("unEffectiveQty"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=12)] + public string workCenter { + get { + return this.workCenterField; + } + set { + this.workCenterField = value; + this.RaisePropertyChanged("workCenter"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=13)] + public string workOrderCode { + get { + return this.workOrderCodeField; + } + set { + this.workOrderCodeField = value; + this.RaisePropertyChanged("workOrderCode"); + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + protected void RaisePropertyChanged(string propertyName) { + System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged; + if ((propertyChanged != null)) { + propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + [System.ServiceModel.MessageContractAttribute(WrapperName="daq", WrapperNamespace="http://zk.ws.epichust.com/", IsWrapped=true)] + public partial class daq { + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://zk.ws.epichust.com/", Order=0)] + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] + public ExternalDataSync.ESB_daq.interfaceRequestHeader arg0; + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://zk.ws.epichust.com/", Order=1)] + [System.Xml.Serialization.XmlElementAttribute("arg1", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] + public ExternalDataSync.ESB_daq.uexDaqInfoExTo[] arg1; + + public daq() { + } + + public daq(ExternalDataSync.ESB_daq.interfaceRequestHeader arg0, ExternalDataSync.ESB_daq.uexDaqInfoExTo[] arg1) { + this.arg0 = arg0; + this.arg1 = arg1; + } + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + [System.ServiceModel.MessageContractAttribute(WrapperName="daqResponse", WrapperNamespace="http://zk.ws.epichust.com/", IsWrapped=true)] + public partial class daqResponse { + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://zk.ws.epichust.com/", Order=0)] + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] + public ExternalDataSync.ESB_daq.interfaceResponse @return; + + public daqResponse() { + } + + public daqResponse(ExternalDataSync.ESB_daq.interfaceResponse @return) { + this.@return = @return; + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + public interface UexDaqInfoInterfaceChannel : ExternalDataSync.ESB_daq.UexDaqInfoInterface, System.ServiceModel.IClientChannel { + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + public partial class UexDaqInfoInterfaceClient : System.ServiceModel.ClientBase, ExternalDataSync.ESB_daq.UexDaqInfoInterface { + + public UexDaqInfoInterfaceClient() { + } + + public UexDaqInfoInterfaceClient(string endpointConfigurationName) : + base(endpointConfigurationName) { + } + + public UexDaqInfoInterfaceClient(string endpointConfigurationName, string remoteAddress) : + base(endpointConfigurationName, remoteAddress) { + } + + public UexDaqInfoInterfaceClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) : + base(endpointConfigurationName, remoteAddress) { + } + + public UexDaqInfoInterfaceClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : + base(binding, remoteAddress) { + } + + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + ExternalDataSync.ESB_daq.daqResponse ExternalDataSync.ESB_daq.UexDaqInfoInterface.daq(ExternalDataSync.ESB_daq.daq request) { + return base.Channel.daq(request); + } + + public ExternalDataSync.ESB_daq.interfaceResponse daq(ExternalDataSync.ESB_daq.interfaceRequestHeader arg0, ExternalDataSync.ESB_daq.uexDaqInfoExTo[] arg1) { + ExternalDataSync.ESB_daq.daq inValue = new ExternalDataSync.ESB_daq.daq(); + inValue.arg0 = arg0; + inValue.arg1 = arg1; + ExternalDataSync.ESB_daq.daqResponse retVal = ((ExternalDataSync.ESB_daq.UexDaqInfoInterface)(this)).daq(inValue); + return retVal.@return; + } + + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + System.Threading.Tasks.Task ExternalDataSync.ESB_daq.UexDaqInfoInterface.daqAsync(ExternalDataSync.ESB_daq.daq request) { + return base.Channel.daqAsync(request); + } + + public System.Threading.Tasks.Task daqAsync(ExternalDataSync.ESB_daq.interfaceRequestHeader arg0, ExternalDataSync.ESB_daq.uexDaqInfoExTo[] arg1) { + ExternalDataSync.ESB_daq.daq inValue = new ExternalDataSync.ESB_daq.daq(); + inValue.arg0 = arg0; + inValue.arg1 = arg1; + return ((ExternalDataSync.ESB_daq.UexDaqInfoInterface)(this)).daqAsync(inValue); + } + } +} diff --git a/SlMesDbIterface/Connected Services/ESB_daq/Reference.svcmap b/SlMesDbIterface/Connected Services/ESB_daq/Reference.svcmap new file mode 100644 index 0000000..eea5ee6 --- /dev/null +++ b/SlMesDbIterface/Connected Services/ESB_daq/Reference.svcmap @@ -0,0 +1,32 @@ + + + + false + true + true + + false + false + false + + + true + Auto + true + true + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/SlMesDbIterface/Connected Services/ESB_daq/UexDaqInfoInterface2.wsdl b/SlMesDbIterface/Connected Services/ESB_daq/UexDaqInfoInterface2.wsdl new file mode 100644 index 0000000..73c1449 --- /dev/null +++ b/SlMesDbIterface/Connected Services/ESB_daq/UexDaqInfoInterface2.wsdl @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/SlMesDbIterface/Connected Services/ESB_daq/configuration.svcinfo b/SlMesDbIterface/Connected Services/ESB_daq/configuration.svcinfo new file mode 100644 index 0000000..d480da5 --- /dev/null +++ b/SlMesDbIterface/Connected Services/ESB_daq/configuration.svcinfo @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/SlMesDbIterface/Connected Services/ESB_daq/configuration91.svcinfo b/SlMesDbIterface/Connected Services/ESB_daq/configuration91.svcinfo new file mode 100644 index 0000000..78e55eb --- /dev/null +++ b/SlMesDbIterface/Connected Services/ESB_daq/configuration91.svcinfo @@ -0,0 +1,201 @@ + + + + + + + uexDaqInfoInterfaceSoapBinding + + + + + + + + + + + + + + + + + + + + + StrongWildcard + + + + + + 65536 + + + + + + + + + System.ServiceModel.Configuration.XmlDictionaryReaderQuotasElement + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + System.Text.UTF8Encoding + + + Buffered + + + + + + Text + + + System.ServiceModel.Configuration.BasicHttpSecurityElement + + + None + + + System.ServiceModel.Configuration.HttpTransportSecurityElement + + + None + + + None + + + System.Security.Authentication.ExtendedProtection.Configuration.ExtendedProtectionPolicyElement + + + Never + + + TransportSelected + + + (集合) + + + + + + System.ServiceModel.Configuration.BasicHttpMessageSecurityElement + + + UserName + + + Default + + + + + + + + + http://10.6.201.184:8011/CDMOM/COMMON/COMMON2CDMOM_PassingPointInfo/ProxyServices/PassingPointInfoPS + + + + + + basicHttpBinding + + + uexDaqInfoInterfaceSoapBinding + + + ESB_daq.UexDaqInfoInterface + + + System.ServiceModel.Configuration.AddressHeaderCollectionElement + + + <Header /> + + + System.ServiceModel.Configuration.IdentityElement + + + System.ServiceModel.Configuration.UserPrincipalNameElement + + + + + + System.ServiceModel.Configuration.ServicePrincipalNameElement + + + + + + System.ServiceModel.Configuration.DnsElement + + + + + + System.ServiceModel.Configuration.RsaElement + + + + + + System.ServiceModel.Configuration.CertificateElement + + + + + + System.ServiceModel.Configuration.CertificateReferenceElement + + + My + + + LocalMachine + + + FindBySubjectDistinguishedName + + + + + + False + + + UexDaqInfoInterfaceImplPort + + + + + + + + + + + \ No newline at end of file diff --git a/SlMesDbIterface/Connected Services/ESB_daq/uexDaqInfoInterface.wsdl b/SlMesDbIterface/Connected Services/ESB_daq/uexDaqInfoInterface.wsdl new file mode 100644 index 0000000..8c27c45 --- /dev/null +++ b/SlMesDbIterface/Connected Services/ESB_daq/uexDaqInfoInterface.wsdl @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + OSB Service + + + + + \ No newline at end of file diff --git a/SlMesDbIterface/Connected Services/ESB_energy/ExternalDataSync.ESB_energy.energyResponse.datasource b/SlMesDbIterface/Connected Services/ESB_energy/ExternalDataSync.ESB_energy.energyResponse.datasource new file mode 100644 index 0000000..a51c555 --- /dev/null +++ b/SlMesDbIterface/Connected Services/ESB_energy/ExternalDataSync.ESB_energy.energyResponse.datasource @@ -0,0 +1,10 @@ + + + + ExternalDataSync.ESB_energy.energyResponse, Connected Services.ESB_energy.Reference.cs.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + \ No newline at end of file diff --git a/SlMesDbIterface/Connected Services/ESB_energy/ExternalDataSync.ESB_energy.interfaceResponse.datasource b/SlMesDbIterface/Connected Services/ESB_energy/ExternalDataSync.ESB_energy.interfaceResponse.datasource new file mode 100644 index 0000000..d4d200c --- /dev/null +++ b/SlMesDbIterface/Connected Services/ESB_energy/ExternalDataSync.ESB_energy.interfaceResponse.datasource @@ -0,0 +1,10 @@ + + + + ExternalDataSync.ESB_energy.interfaceResponse, Connected Services.ESB_energy.Reference.cs.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + \ No newline at end of file diff --git a/SlMesDbIterface/Connected Services/ESB_energy/PctEnergyInfoInterface1.wsdl b/SlMesDbIterface/Connected Services/ESB_energy/PctEnergyInfoInterface1.wsdl new file mode 100644 index 0000000..973cd45 --- /dev/null +++ b/SlMesDbIterface/Connected Services/ESB_energy/PctEnergyInfoInterface1.wsdl @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/SlMesDbIterface/Connected Services/ESB_energy/Reference.cs b/SlMesDbIterface/Connected Services/ESB_energy/Reference.cs new file mode 100644 index 0000000..c62e567 --- /dev/null +++ b/SlMesDbIterface/Connected Services/ESB_energy/Reference.cs @@ -0,0 +1,413 @@ +//------------------------------------------------------------------------------ +// +// 此代码由工具生成。 +// 运行时版本:4.0.30319.42000 +// +// 对此文件的更改可能会导致不正确的行为,并且如果 +// 重新生成代码,这些更改将会丢失。 +// +//------------------------------------------------------------------------------ + +namespace ExternalDataSync.ESB_energy { + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + [System.ServiceModel.ServiceContractAttribute(Namespace="http://zk.ws.epichust.com/", ConfigurationName="ESB_energy.PctEnergyInfoInterface")] + public interface PctEnergyInfoInterface { + + // CODEGEN: 参数“return”需要其他方案信息,使用参数模式无法捕获这些信息。特定特性为“System.Xml.Serialization.XmlElementAttribute”。 + [System.ServiceModel.OperationContractAttribute(Action="", ReplyAction="*")] + [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults=true)] + [return: System.ServiceModel.MessageParameterAttribute(Name="return")] + ExternalDataSync.ESB_energy.energyResponse energy(ExternalDataSync.ESB_energy.energy request); + + [System.ServiceModel.OperationContractAttribute(Action="", ReplyAction="*")] + System.Threading.Tasks.Task energyAsync(ExternalDataSync.ESB_energy.energy request); + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.4161.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://zk.ws.epichust.com/")] + public partial class interfaceRequestHeader : object, System.ComponentModel.INotifyPropertyChanged { + + private string interfaceIDField; + + private string messageIDField; + + private string receiverField; + + private string senderField; + + private string transIDField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)] + public string interfaceID { + get { + return this.interfaceIDField; + } + set { + this.interfaceIDField = value; + this.RaisePropertyChanged("interfaceID"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)] + public string messageID { + get { + return this.messageIDField; + } + set { + this.messageIDField = value; + this.RaisePropertyChanged("messageID"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=2)] + public string receiver { + get { + return this.receiverField; + } + set { + this.receiverField = value; + this.RaisePropertyChanged("receiver"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=3)] + public string sender { + get { + return this.senderField; + } + set { + this.senderField = value; + this.RaisePropertyChanged("sender"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=4)] + public string transID { + get { + return this.transIDField; + } + set { + this.transIDField = value; + this.RaisePropertyChanged("transID"); + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + protected void RaisePropertyChanged(string propertyName) { + System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged; + if ((propertyChanged != null)) { + propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.4161.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://zk.ws.epichust.com/")] + public partial class interfaceResponse : object, System.ComponentModel.INotifyPropertyChanged { + + private string commentField; + + private string interfaceIDField; + + private string messageIDField; + + private string resultCodeField; + + private string resultMessageField; + + private string resultTypeField; + + private string transIDField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)] + public string comment { + get { + return this.commentField; + } + set { + this.commentField = value; + this.RaisePropertyChanged("comment"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)] + public string interfaceID { + get { + return this.interfaceIDField; + } + set { + this.interfaceIDField = value; + this.RaisePropertyChanged("interfaceID"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=2)] + public string messageID { + get { + return this.messageIDField; + } + set { + this.messageIDField = value; + this.RaisePropertyChanged("messageID"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=3)] + public string resultCode { + get { + return this.resultCodeField; + } + set { + this.resultCodeField = value; + this.RaisePropertyChanged("resultCode"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=4)] + public string resultMessage { + get { + return this.resultMessageField; + } + set { + this.resultMessageField = value; + this.RaisePropertyChanged("resultMessage"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=5)] + public string resultType { + get { + return this.resultTypeField; + } + set { + this.resultTypeField = value; + this.RaisePropertyChanged("resultType"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=6)] + public string transID { + get { + return this.transIDField; + } + set { + this.transIDField = value; + this.RaisePropertyChanged("transID"); + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + protected void RaisePropertyChanged(string propertyName) { + System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged; + if ((propertyChanged != null)) { + propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.4161.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://zk.ws.epichust.com/")] + public partial class pctEnergyInfoTo : object, System.ComponentModel.INotifyPropertyChanged { + + private string accrueNumField; + + private string energyTypeField; + + private string powerLevelField; + + private string powerLoadField; + + private string sourceCodeField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)] + public string accrueNum { + get { + return this.accrueNumField; + } + set { + this.accrueNumField = value; + this.RaisePropertyChanged("accrueNum"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)] + public string energyType { + get { + return this.energyTypeField; + } + set { + this.energyTypeField = value; + this.RaisePropertyChanged("energyType"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=2)] + public string powerLevel { + get { + return this.powerLevelField; + } + set { + this.powerLevelField = value; + this.RaisePropertyChanged("powerLevel"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=3)] + public string powerLoad { + get { + return this.powerLoadField; + } + set { + this.powerLoadField = value; + this.RaisePropertyChanged("powerLoad"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=4)] + public string sourceCode { + get { + return this.sourceCodeField; + } + set { + this.sourceCodeField = value; + this.RaisePropertyChanged("sourceCode"); + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + protected void RaisePropertyChanged(string propertyName) { + System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged; + if ((propertyChanged != null)) { + propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + [System.ServiceModel.MessageContractAttribute(WrapperName="energy", WrapperNamespace="http://zk.ws.epichust.com/", IsWrapped=true)] + public partial class energy { + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://zk.ws.epichust.com/", Order=0)] + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] + public ExternalDataSync.ESB_energy.interfaceRequestHeader arg0; + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://zk.ws.epichust.com/", Order=1)] + [System.Xml.Serialization.XmlElementAttribute("arg1", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] + public ExternalDataSync.ESB_energy.pctEnergyInfoTo[] arg1; + + public energy() { + } + + public energy(ExternalDataSync.ESB_energy.interfaceRequestHeader arg0, ExternalDataSync.ESB_energy.pctEnergyInfoTo[] arg1) { + this.arg0 = arg0; + this.arg1 = arg1; + } + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + [System.ServiceModel.MessageContractAttribute(WrapperName="energyResponse", WrapperNamespace="http://zk.ws.epichust.com/", IsWrapped=true)] + public partial class energyResponse { + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://zk.ws.epichust.com/", Order=0)] + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] + public ExternalDataSync.ESB_energy.interfaceResponse @return; + + public energyResponse() { + } + + public energyResponse(ExternalDataSync.ESB_energy.interfaceResponse @return) { + this.@return = @return; + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + public interface PctEnergyInfoInterfaceChannel : ExternalDataSync.ESB_energy.PctEnergyInfoInterface, System.ServiceModel.IClientChannel { + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + public partial class PctEnergyInfoInterfaceClient : System.ServiceModel.ClientBase, ExternalDataSync.ESB_energy.PctEnergyInfoInterface { + + public PctEnergyInfoInterfaceClient() { + } + + public PctEnergyInfoInterfaceClient(string endpointConfigurationName) : + base(endpointConfigurationName) { + } + + public PctEnergyInfoInterfaceClient(string endpointConfigurationName, string remoteAddress) : + base(endpointConfigurationName, remoteAddress) { + } + + public PctEnergyInfoInterfaceClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) : + base(endpointConfigurationName, remoteAddress) { + } + + public PctEnergyInfoInterfaceClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : + base(binding, remoteAddress) { + } + + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + ExternalDataSync.ESB_energy.energyResponse ExternalDataSync.ESB_energy.PctEnergyInfoInterface.energy(ExternalDataSync.ESB_energy.energy request) { + return base.Channel.energy(request); + } + + public ExternalDataSync.ESB_energy.interfaceResponse energy(ExternalDataSync.ESB_energy.interfaceRequestHeader arg0, ExternalDataSync.ESB_energy.pctEnergyInfoTo[] arg1) { + ExternalDataSync.ESB_energy.energy inValue = new ExternalDataSync.ESB_energy.energy(); + inValue.arg0 = arg0; + inValue.arg1 = arg1; + ExternalDataSync.ESB_energy.energyResponse retVal = ((ExternalDataSync.ESB_energy.PctEnergyInfoInterface)(this)).energy(inValue); + return retVal.@return; + } + + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + System.Threading.Tasks.Task ExternalDataSync.ESB_energy.PctEnergyInfoInterface.energyAsync(ExternalDataSync.ESB_energy.energy request) { + return base.Channel.energyAsync(request); + } + + public System.Threading.Tasks.Task energyAsync(ExternalDataSync.ESB_energy.interfaceRequestHeader arg0, ExternalDataSync.ESB_energy.pctEnergyInfoTo[] arg1) { + ExternalDataSync.ESB_energy.energy inValue = new ExternalDataSync.ESB_energy.energy(); + inValue.arg0 = arg0; + inValue.arg1 = arg1; + return ((ExternalDataSync.ESB_energy.PctEnergyInfoInterface)(this)).energyAsync(inValue); + } + } +} diff --git a/SlMesDbIterface/Connected Services/ESB_energy/Reference.svcmap b/SlMesDbIterface/Connected Services/ESB_energy/Reference.svcmap new file mode 100644 index 0000000..d5df003 --- /dev/null +++ b/SlMesDbIterface/Connected Services/ESB_energy/Reference.svcmap @@ -0,0 +1,32 @@ + + + + false + true + true + + false + false + false + + + true + Auto + true + true + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/SlMesDbIterface/Connected Services/ESB_energy/configuration.svcinfo b/SlMesDbIterface/Connected Services/ESB_energy/configuration.svcinfo new file mode 100644 index 0000000..505dfb2 --- /dev/null +++ b/SlMesDbIterface/Connected Services/ESB_energy/configuration.svcinfo @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/SlMesDbIterface/Connected Services/ESB_energy/configuration91.svcinfo b/SlMesDbIterface/Connected Services/ESB_energy/configuration91.svcinfo new file mode 100644 index 0000000..9fe0e55 --- /dev/null +++ b/SlMesDbIterface/Connected Services/ESB_energy/configuration91.svcinfo @@ -0,0 +1,201 @@ + + + + + + + pctEnergyInfoInterfaceSoapBinding + + + + + + + + + + + + + + + + + + + + + StrongWildcard + + + + + + 65536 + + + + + + + + + System.ServiceModel.Configuration.XmlDictionaryReaderQuotasElement + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + System.Text.UTF8Encoding + + + Buffered + + + + + + Text + + + System.ServiceModel.Configuration.BasicHttpSecurityElement + + + None + + + System.ServiceModel.Configuration.HttpTransportSecurityElement + + + None + + + None + + + System.Security.Authentication.ExtendedProtection.Configuration.ExtendedProtectionPolicyElement + + + Never + + + TransportSelected + + + (集合) + + + + + + System.ServiceModel.Configuration.BasicHttpMessageSecurityElement + + + UserName + + + Default + + + + + + + + + http://10.6.201.184:8011/CDMOM/COMMON/COMMON2CDMOM_EnergyInfo/ProxyServices/EnergyInfoPS + + + + + + basicHttpBinding + + + pctEnergyInfoInterfaceSoapBinding + + + ESB_energy.PctEnergyInfoInterface + + + System.ServiceModel.Configuration.AddressHeaderCollectionElement + + + <Header /> + + + System.ServiceModel.Configuration.IdentityElement + + + System.ServiceModel.Configuration.UserPrincipalNameElement + + + + + + System.ServiceModel.Configuration.ServicePrincipalNameElement + + + + + + System.ServiceModel.Configuration.DnsElement + + + + + + System.ServiceModel.Configuration.RsaElement + + + + + + System.ServiceModel.Configuration.CertificateElement + + + + + + System.ServiceModel.Configuration.CertificateReferenceElement + + + My + + + LocalMachine + + + FindBySubjectDistinguishedName + + + + + + False + + + PctEnergyInfoImplPort + + + + + + + + + + + \ No newline at end of file diff --git a/SlMesDbIterface/Connected Services/ESB_energy/pctEnergyInfoInterface.wsdl b/SlMesDbIterface/Connected Services/ESB_energy/pctEnergyInfoInterface.wsdl new file mode 100644 index 0000000..c3416bd --- /dev/null +++ b/SlMesDbIterface/Connected Services/ESB_energy/pctEnergyInfoInterface.wsdl @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + OSB Service + + + + + \ No newline at end of file diff --git a/SlMesDbIterface/Connected Services/ESB_excep/EquipExceInterface2.wsdl b/SlMesDbIterface/Connected Services/ESB_excep/EquipExceInterface2.wsdl new file mode 100644 index 0000000..7f19d7d --- /dev/null +++ b/SlMesDbIterface/Connected Services/ESB_excep/EquipExceInterface2.wsdl @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/SlMesDbIterface/Connected Services/ESB_excep/ExternalDataSync.ESB_excep.excepResponse.datasource b/SlMesDbIterface/Connected Services/ESB_excep/ExternalDataSync.ESB_excep.excepResponse.datasource new file mode 100644 index 0000000..e95e165 --- /dev/null +++ b/SlMesDbIterface/Connected Services/ESB_excep/ExternalDataSync.ESB_excep.excepResponse.datasource @@ -0,0 +1,10 @@ + + + + ExternalDataSync.ESB_excep.excepResponse, Connected Services.ESB_excep.Reference.cs.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + \ No newline at end of file diff --git a/SlMesDbIterface/Connected Services/ESB_excep/ExternalDataSync.ESB_excep.interfaceResponse.datasource b/SlMesDbIterface/Connected Services/ESB_excep/ExternalDataSync.ESB_excep.interfaceResponse.datasource new file mode 100644 index 0000000..343e81e --- /dev/null +++ b/SlMesDbIterface/Connected Services/ESB_excep/ExternalDataSync.ESB_excep.interfaceResponse.datasource @@ -0,0 +1,10 @@ + + + + ExternalDataSync.ESB_excep.interfaceResponse, Connected Services.ESB_excep.Reference.cs.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + \ No newline at end of file diff --git a/SlMesDbIterface/Connected Services/ESB_excep/Reference.cs b/SlMesDbIterface/Connected Services/ESB_excep/Reference.cs new file mode 100644 index 0000000..f6c392b --- /dev/null +++ b/SlMesDbIterface/Connected Services/ESB_excep/Reference.cs @@ -0,0 +1,497 @@ +//------------------------------------------------------------------------------ +// +// 此代码由工具生成。 +// 运行时版本:4.0.30319.42000 +// +// 对此文件的更改可能会导致不正确的行为,并且如果 +// 重新生成代码,这些更改将会丢失。 +// +//------------------------------------------------------------------------------ + +namespace ExternalDataSync.ESB_excep { + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + [System.ServiceModel.ServiceContractAttribute(Namespace="http://zk.ws.epichust.com/", ConfigurationName="ESB_excep.EquipExceInterface")] + public interface EquipExceInterface { + + // CODEGEN: 参数“return”需要其他方案信息,使用参数模式无法捕获这些信息。特定特性为“System.Xml.Serialization.XmlElementAttribute”。 + [System.ServiceModel.OperationContractAttribute(Action="", ReplyAction="*")] + [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults=true)] + [return: System.ServiceModel.MessageParameterAttribute(Name="return")] + ExternalDataSync.ESB_excep.excepResponse excep(ExternalDataSync.ESB_excep.excep request); + + [System.ServiceModel.OperationContractAttribute(Action="", ReplyAction="*")] + System.Threading.Tasks.Task excepAsync(ExternalDataSync.ESB_excep.excep request); + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.4161.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://zk.ws.epichust.com/")] + public partial class interfaceRequestHeader : object, System.ComponentModel.INotifyPropertyChanged { + + private string interfaceIDField; + + private string messageIDField; + + private string receiverField; + + private string senderField; + + private string transIDField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)] + public string interfaceID { + get { + return this.interfaceIDField; + } + set { + this.interfaceIDField = value; + this.RaisePropertyChanged("interfaceID"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)] + public string messageID { + get { + return this.messageIDField; + } + set { + this.messageIDField = value; + this.RaisePropertyChanged("messageID"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=2)] + public string receiver { + get { + return this.receiverField; + } + set { + this.receiverField = value; + this.RaisePropertyChanged("receiver"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=3)] + public string sender { + get { + return this.senderField; + } + set { + this.senderField = value; + this.RaisePropertyChanged("sender"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=4)] + public string transID { + get { + return this.transIDField; + } + set { + this.transIDField = value; + this.RaisePropertyChanged("transID"); + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + protected void RaisePropertyChanged(string propertyName) { + System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged; + if ((propertyChanged != null)) { + propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.4161.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://zk.ws.epichust.com/")] + public partial class interfaceResponse : object, System.ComponentModel.INotifyPropertyChanged { + + private string commentField; + + private string interfaceIDField; + + private string messageIDField; + + private string resultCodeField; + + private string resultMessageField; + + private string resultTypeField; + + private string transIDField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)] + public string comment { + get { + return this.commentField; + } + set { + this.commentField = value; + this.RaisePropertyChanged("comment"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)] + public string interfaceID { + get { + return this.interfaceIDField; + } + set { + this.interfaceIDField = value; + this.RaisePropertyChanged("interfaceID"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=2)] + public string messageID { + get { + return this.messageIDField; + } + set { + this.messageIDField = value; + this.RaisePropertyChanged("messageID"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=3)] + public string resultCode { + get { + return this.resultCodeField; + } + set { + this.resultCodeField = value; + this.RaisePropertyChanged("resultCode"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=4)] + public string resultMessage { + get { + return this.resultMessageField; + } + set { + this.resultMessageField = value; + this.RaisePropertyChanged("resultMessage"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=5)] + public string resultType { + get { + return this.resultTypeField; + } + set { + this.resultTypeField = value; + this.RaisePropertyChanged("resultType"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=6)] + public string transID { + get { + return this.transIDField; + } + set { + this.transIDField = value; + this.RaisePropertyChanged("transID"); + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + protected void RaisePropertyChanged(string propertyName) { + System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged; + if ((propertyChanged != null)) { + propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.4161.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://zk.ws.epichust.com/")] + public partial class equipExceInfoTo : object, System.ComponentModel.INotifyPropertyChanged { + + private string acqTimeField; + + private string alarmContentField; + + private string alarmNumberField; + + private string equipCodeField; + + private string equipStateField; + + private string isAlarmField; + + private string opCodeField; + + private string siteField; + + private string stateValueField; + + private string workCellCodeField; + + private string workCenterField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)] + public string acqTime { + get { + return this.acqTimeField; + } + set { + this.acqTimeField = value; + this.RaisePropertyChanged("acqTime"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)] + public string alarmContent { + get { + return this.alarmContentField; + } + set { + this.alarmContentField = value; + this.RaisePropertyChanged("alarmContent"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=2)] + public string alarmNumber { + get { + return this.alarmNumberField; + } + set { + this.alarmNumberField = value; + this.RaisePropertyChanged("alarmNumber"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=3)] + public string equipCode { + get { + return this.equipCodeField; + } + set { + this.equipCodeField = value; + this.RaisePropertyChanged("equipCode"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=4)] + public string equipState { + get { + return this.equipStateField; + } + set { + this.equipStateField = value; + this.RaisePropertyChanged("equipState"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=5)] + public string isAlarm { + get { + return this.isAlarmField; + } + set { + this.isAlarmField = value; + this.RaisePropertyChanged("isAlarm"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=6)] + public string opCode { + get { + return this.opCodeField; + } + set { + this.opCodeField = value; + this.RaisePropertyChanged("opCode"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=7)] + public string site { + get { + return this.siteField; + } + set { + this.siteField = value; + this.RaisePropertyChanged("site"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=8)] + public string stateValue { + get { + return this.stateValueField; + } + set { + this.stateValueField = value; + this.RaisePropertyChanged("stateValue"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=9)] + public string workCellCode { + get { + return this.workCellCodeField; + } + set { + this.workCellCodeField = value; + this.RaisePropertyChanged("workCellCode"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=10)] + public string workCenter { + get { + return this.workCenterField; + } + set { + this.workCenterField = value; + this.RaisePropertyChanged("workCenter"); + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + protected void RaisePropertyChanged(string propertyName) { + System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged; + if ((propertyChanged != null)) { + propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + [System.ServiceModel.MessageContractAttribute(WrapperName="excep", WrapperNamespace="http://zk.ws.epichust.com/", IsWrapped=true)] + public partial class excep { + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://zk.ws.epichust.com/", Order=0)] + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] + public ExternalDataSync.ESB_excep.interfaceRequestHeader arg0; + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://zk.ws.epichust.com/", Order=1)] + [System.Xml.Serialization.XmlElementAttribute("arg1", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] + public ExternalDataSync.ESB_excep.equipExceInfoTo[] arg1; + + public excep() { + } + + public excep(ExternalDataSync.ESB_excep.interfaceRequestHeader arg0, ExternalDataSync.ESB_excep.equipExceInfoTo[] arg1) { + this.arg0 = arg0; + this.arg1 = arg1; + } + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + [System.ServiceModel.MessageContractAttribute(WrapperName="excepResponse", WrapperNamespace="http://zk.ws.epichust.com/", IsWrapped=true)] + public partial class excepResponse { + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://zk.ws.epichust.com/", Order=0)] + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] + public ExternalDataSync.ESB_excep.interfaceResponse @return; + + public excepResponse() { + } + + public excepResponse(ExternalDataSync.ESB_excep.interfaceResponse @return) { + this.@return = @return; + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + public interface EquipExceInterfaceChannel : ExternalDataSync.ESB_excep.EquipExceInterface, System.ServiceModel.IClientChannel { + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + public partial class EquipExceInterfaceClient : System.ServiceModel.ClientBase, ExternalDataSync.ESB_excep.EquipExceInterface { + + public EquipExceInterfaceClient() { + } + + public EquipExceInterfaceClient(string endpointConfigurationName) : + base(endpointConfigurationName) { + } + + public EquipExceInterfaceClient(string endpointConfigurationName, string remoteAddress) : + base(endpointConfigurationName, remoteAddress) { + } + + public EquipExceInterfaceClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) : + base(endpointConfigurationName, remoteAddress) { + } + + public EquipExceInterfaceClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : + base(binding, remoteAddress) { + } + + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + ExternalDataSync.ESB_excep.excepResponse ExternalDataSync.ESB_excep.EquipExceInterface.excep(ExternalDataSync.ESB_excep.excep request) { + return base.Channel.excep(request); + } + + public ExternalDataSync.ESB_excep.interfaceResponse excep(ExternalDataSync.ESB_excep.interfaceRequestHeader arg0, ExternalDataSync.ESB_excep.equipExceInfoTo[] arg1) { + ExternalDataSync.ESB_excep.excep inValue = new ExternalDataSync.ESB_excep.excep(); + inValue.arg0 = arg0; + inValue.arg1 = arg1; + ExternalDataSync.ESB_excep.excepResponse retVal = ((ExternalDataSync.ESB_excep.EquipExceInterface)(this)).excep(inValue); + return retVal.@return; + } + + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + System.Threading.Tasks.Task ExternalDataSync.ESB_excep.EquipExceInterface.excepAsync(ExternalDataSync.ESB_excep.excep request) { + return base.Channel.excepAsync(request); + } + + public System.Threading.Tasks.Task excepAsync(ExternalDataSync.ESB_excep.interfaceRequestHeader arg0, ExternalDataSync.ESB_excep.equipExceInfoTo[] arg1) { + ExternalDataSync.ESB_excep.excep inValue = new ExternalDataSync.ESB_excep.excep(); + inValue.arg0 = arg0; + inValue.arg1 = arg1; + return ((ExternalDataSync.ESB_excep.EquipExceInterface)(this)).excepAsync(inValue); + } + } +} diff --git a/SlMesDbIterface/Connected Services/ESB_excep/Reference.svcmap b/SlMesDbIterface/Connected Services/ESB_excep/Reference.svcmap new file mode 100644 index 0000000..475d6f7 --- /dev/null +++ b/SlMesDbIterface/Connected Services/ESB_excep/Reference.svcmap @@ -0,0 +1,32 @@ + + + + false + true + true + + false + false + false + + + true + Auto + true + true + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/SlMesDbIterface/Connected Services/ESB_excep/configuration.svcinfo b/SlMesDbIterface/Connected Services/ESB_excep/configuration.svcinfo new file mode 100644 index 0000000..c9d20dc --- /dev/null +++ b/SlMesDbIterface/Connected Services/ESB_excep/configuration.svcinfo @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/SlMesDbIterface/Connected Services/ESB_excep/configuration91.svcinfo b/SlMesDbIterface/Connected Services/ESB_excep/configuration91.svcinfo new file mode 100644 index 0000000..6d221fe --- /dev/null +++ b/SlMesDbIterface/Connected Services/ESB_excep/configuration91.svcinfo @@ -0,0 +1,201 @@ + + + + + + + equipExceInterfaceSoapBinding + + + + + + + + + + + + + + + + + + + + + StrongWildcard + + + + + + 65536 + + + + + + + + + System.ServiceModel.Configuration.XmlDictionaryReaderQuotasElement + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + System.Text.UTF8Encoding + + + Buffered + + + + + + Text + + + System.ServiceModel.Configuration.BasicHttpSecurityElement + + + None + + + System.ServiceModel.Configuration.HttpTransportSecurityElement + + + None + + + None + + + System.Security.Authentication.ExtendedProtection.Configuration.ExtendedProtectionPolicyElement + + + Never + + + TransportSelected + + + (集合) + + + + + + System.ServiceModel.Configuration.BasicHttpMessageSecurityElement + + + UserName + + + Default + + + + + + + + + http://10.6.201.184:8011/CDMOM/COMMON/COMMON2CDMOM_EquipmentFailInfo/ProxyServices/EquipmentFailInfoPS + + + + + + basicHttpBinding + + + equipExceInterfaceSoapBinding + + + ESB_excep.EquipExceInterface + + + System.ServiceModel.Configuration.AddressHeaderCollectionElement + + + <Header /> + + + System.ServiceModel.Configuration.IdentityElement + + + System.ServiceModel.Configuration.UserPrincipalNameElement + + + + + + System.ServiceModel.Configuration.ServicePrincipalNameElement + + + + + + System.ServiceModel.Configuration.DnsElement + + + + + + System.ServiceModel.Configuration.RsaElement + + + + + + System.ServiceModel.Configuration.CertificateElement + + + + + + System.ServiceModel.Configuration.CertificateReferenceElement + + + My + + + LocalMachine + + + FindBySubjectDistinguishedName + + + + + + False + + + EquipExceInterfaceImplPort + + + + + + + + + + + \ No newline at end of file diff --git a/SlMesDbIterface/Connected Services/ESB_excep/equipExceInterface1.wsdl b/SlMesDbIterface/Connected Services/ESB_excep/equipExceInterface1.wsdl new file mode 100644 index 0000000..fa1182a --- /dev/null +++ b/SlMesDbIterface/Connected Services/ESB_excep/equipExceInterface1.wsdl @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + OSB Service + + + + + \ No newline at end of file diff --git a/SlMesDbIterface/Connected Services/ESB_history/EquipHistoryInterface2.wsdl b/SlMesDbIterface/Connected Services/ESB_history/EquipHistoryInterface2.wsdl new file mode 100644 index 0000000..8c9feaf --- /dev/null +++ b/SlMesDbIterface/Connected Services/ESB_history/EquipHistoryInterface2.wsdl @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/SlMesDbIterface/Connected Services/ESB_history/ExternalDataSync.ESB_history.historyResponse.datasource b/SlMesDbIterface/Connected Services/ESB_history/ExternalDataSync.ESB_history.historyResponse.datasource new file mode 100644 index 0000000..3a638e2 --- /dev/null +++ b/SlMesDbIterface/Connected Services/ESB_history/ExternalDataSync.ESB_history.historyResponse.datasource @@ -0,0 +1,10 @@ + + + + ExternalDataSync.ESB_history.historyResponse, Connected Services.ESB_history.Reference.cs.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + \ No newline at end of file diff --git a/SlMesDbIterface/Connected Services/ESB_history/ExternalDataSync.ESB_history.interfaceResponse.datasource b/SlMesDbIterface/Connected Services/ESB_history/ExternalDataSync.ESB_history.interfaceResponse.datasource new file mode 100644 index 0000000..9202819 --- /dev/null +++ b/SlMesDbIterface/Connected Services/ESB_history/ExternalDataSync.ESB_history.interfaceResponse.datasource @@ -0,0 +1,10 @@ + + + + ExternalDataSync.ESB_history.interfaceResponse, Connected Services.ESB_history.Reference.cs.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + \ No newline at end of file diff --git a/SlMesDbIterface/Connected Services/ESB_history/Reference.cs b/SlMesDbIterface/Connected Services/ESB_history/Reference.cs new file mode 100644 index 0000000..9e813aa --- /dev/null +++ b/SlMesDbIterface/Connected Services/ESB_history/Reference.cs @@ -0,0 +1,469 @@ +//------------------------------------------------------------------------------ +// +// 此代码由工具生成。 +// 运行时版本:4.0.30319.42000 +// +// 对此文件的更改可能会导致不正确的行为,并且如果 +// 重新生成代码,这些更改将会丢失。 +// +//------------------------------------------------------------------------------ + +namespace ExternalDataSync.ESB_history { + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + [System.ServiceModel.ServiceContractAttribute(Namespace="http://zk.ws.epichust.com/", ConfigurationName="ESB_history.EquipHistoryInterface")] + public interface EquipHistoryInterface { + + // CODEGEN: 参数“return”需要其他方案信息,使用参数模式无法捕获这些信息。特定特性为“System.Xml.Serialization.XmlElementAttribute”。 + [System.ServiceModel.OperationContractAttribute(Action="", ReplyAction="*")] + [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults=true)] + [return: System.ServiceModel.MessageParameterAttribute(Name="return")] + ExternalDataSync.ESB_history.historyResponse history(ExternalDataSync.ESB_history.history request); + + [System.ServiceModel.OperationContractAttribute(Action="", ReplyAction="*")] + System.Threading.Tasks.Task historyAsync(ExternalDataSync.ESB_history.history request); + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.4161.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://zk.ws.epichust.com/")] + public partial class interfaceRequestHeader : object, System.ComponentModel.INotifyPropertyChanged { + + private string interfaceIDField; + + private string messageIDField; + + private string receiverField; + + private string senderField; + + private string transIDField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)] + public string interfaceID { + get { + return this.interfaceIDField; + } + set { + this.interfaceIDField = value; + this.RaisePropertyChanged("interfaceID"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)] + public string messageID { + get { + return this.messageIDField; + } + set { + this.messageIDField = value; + this.RaisePropertyChanged("messageID"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=2)] + public string receiver { + get { + return this.receiverField; + } + set { + this.receiverField = value; + this.RaisePropertyChanged("receiver"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=3)] + public string sender { + get { + return this.senderField; + } + set { + this.senderField = value; + this.RaisePropertyChanged("sender"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=4)] + public string transID { + get { + return this.transIDField; + } + set { + this.transIDField = value; + this.RaisePropertyChanged("transID"); + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + protected void RaisePropertyChanged(string propertyName) { + System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged; + if ((propertyChanged != null)) { + propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.4161.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://zk.ws.epichust.com/")] + public partial class interfaceResponse : object, System.ComponentModel.INotifyPropertyChanged { + + private string commentField; + + private string interfaceIDField; + + private string messageIDField; + + private string resultCodeField; + + private string resultMessageField; + + private string resultTypeField; + + private string transIDField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)] + public string comment { + get { + return this.commentField; + } + set { + this.commentField = value; + this.RaisePropertyChanged("comment"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)] + public string interfaceID { + get { + return this.interfaceIDField; + } + set { + this.interfaceIDField = value; + this.RaisePropertyChanged("interfaceID"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=2)] + public string messageID { + get { + return this.messageIDField; + } + set { + this.messageIDField = value; + this.RaisePropertyChanged("messageID"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=3)] + public string resultCode { + get { + return this.resultCodeField; + } + set { + this.resultCodeField = value; + this.RaisePropertyChanged("resultCode"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=4)] + public string resultMessage { + get { + return this.resultMessageField; + } + set { + this.resultMessageField = value; + this.RaisePropertyChanged("resultMessage"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=5)] + public string resultType { + get { + return this.resultTypeField; + } + set { + this.resultTypeField = value; + this.RaisePropertyChanged("resultType"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=6)] + public string transID { + get { + return this.transIDField; + } + set { + this.transIDField = value; + this.RaisePropertyChanged("transID"); + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + protected void RaisePropertyChanged(string propertyName) { + System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged; + if ((propertyChanged != null)) { + propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.4161.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://zk.ws.epichust.com/")] + public partial class equipHistoryInfoTo : object, System.ComponentModel.INotifyPropertyChanged { + + private string equipCodeField; + + private string equipStateField; + + private string opCodeField; + + private string siteField; + + private string stateStartTimeField; + + private string stateSwtichTimeField; + + private string stateValueField; + + private string workCellCodeField; + + private string workCenterField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)] + public string equipCode { + get { + return this.equipCodeField; + } + set { + this.equipCodeField = value; + this.RaisePropertyChanged("equipCode"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)] + public string equipState { + get { + return this.equipStateField; + } + set { + this.equipStateField = value; + this.RaisePropertyChanged("equipState"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=2)] + public string opCode { + get { + return this.opCodeField; + } + set { + this.opCodeField = value; + this.RaisePropertyChanged("opCode"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=3)] + public string site { + get { + return this.siteField; + } + set { + this.siteField = value; + this.RaisePropertyChanged("site"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=4)] + public string stateStartTime { + get { + return this.stateStartTimeField; + } + set { + this.stateStartTimeField = value; + this.RaisePropertyChanged("stateStartTime"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=5)] + public string stateSwtichTime { + get { + return this.stateSwtichTimeField; + } + set { + this.stateSwtichTimeField = value; + this.RaisePropertyChanged("stateSwtichTime"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=6)] + public string stateValue { + get { + return this.stateValueField; + } + set { + this.stateValueField = value; + this.RaisePropertyChanged("stateValue"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=7)] + public string workCellCode { + get { + return this.workCellCodeField; + } + set { + this.workCellCodeField = value; + this.RaisePropertyChanged("workCellCode"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=8)] + public string workCenter { + get { + return this.workCenterField; + } + set { + this.workCenterField = value; + this.RaisePropertyChanged("workCenter"); + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + protected void RaisePropertyChanged(string propertyName) { + System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged; + if ((propertyChanged != null)) { + propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + [System.ServiceModel.MessageContractAttribute(WrapperName="history", WrapperNamespace="http://zk.ws.epichust.com/", IsWrapped=true)] + public partial class history { + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://zk.ws.epichust.com/", Order=0)] + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] + public ExternalDataSync.ESB_history.interfaceRequestHeader arg0; + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://zk.ws.epichust.com/", Order=1)] + [System.Xml.Serialization.XmlElementAttribute("arg1", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] + public ExternalDataSync.ESB_history.equipHistoryInfoTo[] arg1; + + public history() { + } + + public history(ExternalDataSync.ESB_history.interfaceRequestHeader arg0, ExternalDataSync.ESB_history.equipHistoryInfoTo[] arg1) { + this.arg0 = arg0; + this.arg1 = arg1; + } + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + [System.ServiceModel.MessageContractAttribute(WrapperName="historyResponse", WrapperNamespace="http://zk.ws.epichust.com/", IsWrapped=true)] + public partial class historyResponse { + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://zk.ws.epichust.com/", Order=0)] + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] + public ExternalDataSync.ESB_history.interfaceResponse @return; + + public historyResponse() { + } + + public historyResponse(ExternalDataSync.ESB_history.interfaceResponse @return) { + this.@return = @return; + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + public interface EquipHistoryInterfaceChannel : ExternalDataSync.ESB_history.EquipHistoryInterface, System.ServiceModel.IClientChannel { + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + public partial class EquipHistoryInterfaceClient : System.ServiceModel.ClientBase, ExternalDataSync.ESB_history.EquipHistoryInterface { + + public EquipHistoryInterfaceClient() { + } + + public EquipHistoryInterfaceClient(string endpointConfigurationName) : + base(endpointConfigurationName) { + } + + public EquipHistoryInterfaceClient(string endpointConfigurationName, string remoteAddress) : + base(endpointConfigurationName, remoteAddress) { + } + + public EquipHistoryInterfaceClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) : + base(endpointConfigurationName, remoteAddress) { + } + + public EquipHistoryInterfaceClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : + base(binding, remoteAddress) { + } + + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + ExternalDataSync.ESB_history.historyResponse ExternalDataSync.ESB_history.EquipHistoryInterface.history(ExternalDataSync.ESB_history.history request) { + return base.Channel.history(request); + } + + public ExternalDataSync.ESB_history.interfaceResponse history(ExternalDataSync.ESB_history.interfaceRequestHeader arg0, ExternalDataSync.ESB_history.equipHistoryInfoTo[] arg1) { + ExternalDataSync.ESB_history.history inValue = new ExternalDataSync.ESB_history.history(); + inValue.arg0 = arg0; + inValue.arg1 = arg1; + ExternalDataSync.ESB_history.historyResponse retVal = ((ExternalDataSync.ESB_history.EquipHistoryInterface)(this)).history(inValue); + return retVal.@return; + } + + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + System.Threading.Tasks.Task ExternalDataSync.ESB_history.EquipHistoryInterface.historyAsync(ExternalDataSync.ESB_history.history request) { + return base.Channel.historyAsync(request); + } + + public System.Threading.Tasks.Task historyAsync(ExternalDataSync.ESB_history.interfaceRequestHeader arg0, ExternalDataSync.ESB_history.equipHistoryInfoTo[] arg1) { + ExternalDataSync.ESB_history.history inValue = new ExternalDataSync.ESB_history.history(); + inValue.arg0 = arg0; + inValue.arg1 = arg1; + return ((ExternalDataSync.ESB_history.EquipHistoryInterface)(this)).historyAsync(inValue); + } + } +} diff --git a/SlMesDbIterface/Connected Services/ESB_history/Reference.svcmap b/SlMesDbIterface/Connected Services/ESB_history/Reference.svcmap new file mode 100644 index 0000000..791ec58 --- /dev/null +++ b/SlMesDbIterface/Connected Services/ESB_history/Reference.svcmap @@ -0,0 +1,32 @@ + + + + false + true + true + + false + false + false + + + true + Auto + true + true + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/SlMesDbIterface/Connected Services/ESB_history/configuration.svcinfo b/SlMesDbIterface/Connected Services/ESB_history/configuration.svcinfo new file mode 100644 index 0000000..4a9ac8e --- /dev/null +++ b/SlMesDbIterface/Connected Services/ESB_history/configuration.svcinfo @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/SlMesDbIterface/Connected Services/ESB_history/configuration91.svcinfo b/SlMesDbIterface/Connected Services/ESB_history/configuration91.svcinfo new file mode 100644 index 0000000..d24c780 --- /dev/null +++ b/SlMesDbIterface/Connected Services/ESB_history/configuration91.svcinfo @@ -0,0 +1,201 @@ + + + + + + + equipHistoryInterfaceSoapBinding + + + + + + + + + + + + + + + + + + + + + StrongWildcard + + + + + + 65536 + + + + + + + + + System.ServiceModel.Configuration.XmlDictionaryReaderQuotasElement + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + System.Text.UTF8Encoding + + + Buffered + + + + + + Text + + + System.ServiceModel.Configuration.BasicHttpSecurityElement + + + None + + + System.ServiceModel.Configuration.HttpTransportSecurityElement + + + None + + + None + + + System.Security.Authentication.ExtendedProtection.Configuration.ExtendedProtectionPolicyElement + + + Never + + + TransportSelected + + + (集合) + + + + + + System.ServiceModel.Configuration.BasicHttpMessageSecurityElement + + + UserName + + + Default + + + + + + + + + http://10.6.201.184:8011/CDMOM/COMMON/COMMON2CDMOM_EquipmentStateInfo/ProxyServices/EquipmentStateInfoPS + + + + + + basicHttpBinding + + + equipHistoryInterfaceSoapBinding + + + ESB_history.EquipHistoryInterface + + + System.ServiceModel.Configuration.AddressHeaderCollectionElement + + + <Header /> + + + System.ServiceModel.Configuration.IdentityElement + + + System.ServiceModel.Configuration.UserPrincipalNameElement + + + + + + System.ServiceModel.Configuration.ServicePrincipalNameElement + + + + + + System.ServiceModel.Configuration.DnsElement + + + + + + System.ServiceModel.Configuration.RsaElement + + + + + + System.ServiceModel.Configuration.CertificateElement + + + + + + System.ServiceModel.Configuration.CertificateReferenceElement + + + My + + + LocalMachine + + + FindBySubjectDistinguishedName + + + + + + False + + + EquipHistoryInterfaceImplPort + + + + + + + + + + + \ No newline at end of file diff --git a/SlMesDbIterface/Connected Services/ESB_history/equipHistoryInterface.wsdl b/SlMesDbIterface/Connected Services/ESB_history/equipHistoryInterface.wsdl new file mode 100644 index 0000000..ce3f75d --- /dev/null +++ b/SlMesDbIterface/Connected Services/ESB_history/equipHistoryInterface.wsdl @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + OSB Service + + + + + \ No newline at end of file diff --git a/SlMesDbIterface/Connected Services/ESB_life/ExternalDataSync.ESB_life.interfaceResponse.datasource b/SlMesDbIterface/Connected Services/ESB_life/ExternalDataSync.ESB_life.interfaceResponse.datasource new file mode 100644 index 0000000..259864c --- /dev/null +++ b/SlMesDbIterface/Connected Services/ESB_life/ExternalDataSync.ESB_life.interfaceResponse.datasource @@ -0,0 +1,10 @@ + + + + ExternalDataSync.ESB_life.interfaceResponse, Connected Services.ESB_life.Reference.cs.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + \ No newline at end of file diff --git a/SlMesDbIterface/Connected Services/ESB_life/ExternalDataSync.ESB_life.lifeResponse.datasource b/SlMesDbIterface/Connected Services/ESB_life/ExternalDataSync.ESB_life.lifeResponse.datasource new file mode 100644 index 0000000..bf72632 --- /dev/null +++ b/SlMesDbIterface/Connected Services/ESB_life/ExternalDataSync.ESB_life.lifeResponse.datasource @@ -0,0 +1,10 @@ + + + + ExternalDataSync.ESB_life.lifeResponse, Connected Services.ESB_life.Reference.cs.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + \ No newline at end of file diff --git a/SlMesDbIterface/Connected Services/ESB_life/Reference.cs b/SlMesDbIterface/Connected Services/ESB_life/Reference.cs new file mode 100644 index 0000000..f01b6e8 --- /dev/null +++ b/SlMesDbIterface/Connected Services/ESB_life/Reference.cs @@ -0,0 +1,567 @@ +//------------------------------------------------------------------------------ +// +// 此代码由工具生成。 +// 运行时版本:4.0.30319.42000 +// +// 对此文件的更改可能会导致不正确的行为,并且如果 +// 重新生成代码,这些更改将会丢失。 +// +//------------------------------------------------------------------------------ + +namespace ExternalDataSync.ESB_life { + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + [System.ServiceModel.ServiceContractAttribute(Namespace="http://zk.ws.epichust.com/", ConfigurationName="ESB_life.UrmRsBaseLifeInterface")] + public interface UrmRsBaseLifeInterface { + + // CODEGEN: 参数“return”需要其他方案信息,使用参数模式无法捕获这些信息。特定特性为“System.Xml.Serialization.XmlElementAttribute”。 + [System.ServiceModel.OperationContractAttribute(Action="", ReplyAction="*")] + [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults=true)] + [return: System.ServiceModel.MessageParameterAttribute(Name="return")] + ExternalDataSync.ESB_life.lifeResponse life(ExternalDataSync.ESB_life.life request); + + [System.ServiceModel.OperationContractAttribute(Action="", ReplyAction="*")] + System.Threading.Tasks.Task lifeAsync(ExternalDataSync.ESB_life.life request); + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.4161.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://zk.ws.epichust.com/")] + public partial class interfaceRequestHeader : object, System.ComponentModel.INotifyPropertyChanged { + + private string interfaceIDField; + + private string messageIDField; + + private string receiverField; + + private string senderField; + + private string transIDField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)] + public string interfaceID { + get { + return this.interfaceIDField; + } + set { + this.interfaceIDField = value; + this.RaisePropertyChanged("interfaceID"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)] + public string messageID { + get { + return this.messageIDField; + } + set { + this.messageIDField = value; + this.RaisePropertyChanged("messageID"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=2)] + public string receiver { + get { + return this.receiverField; + } + set { + this.receiverField = value; + this.RaisePropertyChanged("receiver"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=3)] + public string sender { + get { + return this.senderField; + } + set { + this.senderField = value; + this.RaisePropertyChanged("sender"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=4)] + public string transID { + get { + return this.transIDField; + } + set { + this.transIDField = value; + this.RaisePropertyChanged("transID"); + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + protected void RaisePropertyChanged(string propertyName) { + System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged; + if ((propertyChanged != null)) { + propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.4161.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://zk.ws.epichust.com/")] + public partial class interfaceResponse : object, System.ComponentModel.INotifyPropertyChanged { + + private string commentField; + + private string interfaceIDField; + + private string messageIDField; + + private string resultCodeField; + + private string resultMessageField; + + private string resultTypeField; + + private string transIDField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)] + public string comment { + get { + return this.commentField; + } + set { + this.commentField = value; + this.RaisePropertyChanged("comment"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)] + public string interfaceID { + get { + return this.interfaceIDField; + } + set { + this.interfaceIDField = value; + this.RaisePropertyChanged("interfaceID"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=2)] + public string messageID { + get { + return this.messageIDField; + } + set { + this.messageIDField = value; + this.RaisePropertyChanged("messageID"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=3)] + public string resultCode { + get { + return this.resultCodeField; + } + set { + this.resultCodeField = value; + this.RaisePropertyChanged("resultCode"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=4)] + public string resultMessage { + get { + return this.resultMessageField; + } + set { + this.resultMessageField = value; + this.RaisePropertyChanged("resultMessage"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=5)] + public string resultType { + get { + return this.resultTypeField; + } + set { + this.resultTypeField = value; + this.RaisePropertyChanged("resultType"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=6)] + public string transID { + get { + return this.transIDField; + } + set { + this.transIDField = value; + this.RaisePropertyChanged("transID"); + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + protected void RaisePropertyChanged(string propertyName) { + System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged; + if ((propertyChanged != null)) { + propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.4161.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://zk.ws.epichust.com/")] + public partial class baseLifeInfoTo : object, System.ComponentModel.INotifyPropertyChanged { + + private string acqTimeField; + + private string dupField; + + private string equipCodeField; + + private string kpartCodeField; + + private string magField; + + private string placeField; + + private string proCodeField; + + private string siteField; + + private string toolAlarmField; + + private string toolCodeField; + + private string toolProductionField; + + private string toolResidualField; + + private string toolSetField; + + private string workCellCodeField; + + private string workCenterField; + + private string tNumberField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)] + public string acqTime { + get { + return this.acqTimeField; + } + set { + this.acqTimeField = value; + this.RaisePropertyChanged("acqTime"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)] + public string dup { + get { + return this.dupField; + } + set { + this.dupField = value; + this.RaisePropertyChanged("dup"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=2)] + public string equipCode { + get { + return this.equipCodeField; + } + set { + this.equipCodeField = value; + this.RaisePropertyChanged("equipCode"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=3)] + public string kpartCode { + get { + return this.kpartCodeField; + } + set { + this.kpartCodeField = value; + this.RaisePropertyChanged("kpartCode"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=4)] + public string mag { + get { + return this.magField; + } + set { + this.magField = value; + this.RaisePropertyChanged("mag"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=5)] + public string place { + get { + return this.placeField; + } + set { + this.placeField = value; + this.RaisePropertyChanged("place"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=6)] + public string proCode { + get { + return this.proCodeField; + } + set { + this.proCodeField = value; + this.RaisePropertyChanged("proCode"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=7)] + public string site { + get { + return this.siteField; + } + set { + this.siteField = value; + this.RaisePropertyChanged("site"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=8)] + public string toolAlarm { + get { + return this.toolAlarmField; + } + set { + this.toolAlarmField = value; + this.RaisePropertyChanged("toolAlarm"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=9)] + public string toolCode { + get { + return this.toolCodeField; + } + set { + this.toolCodeField = value; + this.RaisePropertyChanged("toolCode"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=10)] + public string toolProduction { + get { + return this.toolProductionField; + } + set { + this.toolProductionField = value; + this.RaisePropertyChanged("toolProduction"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=11)] + public string toolResidual { + get { + return this.toolResidualField; + } + set { + this.toolResidualField = value; + this.RaisePropertyChanged("toolResidual"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=12)] + public string toolSet { + get { + return this.toolSetField; + } + set { + this.toolSetField = value; + this.RaisePropertyChanged("toolSet"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=13)] + public string workCellCode { + get { + return this.workCellCodeField; + } + set { + this.workCellCodeField = value; + this.RaisePropertyChanged("workCellCode"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=14)] + public string workCenter { + get { + return this.workCenterField; + } + set { + this.workCenterField = value; + this.RaisePropertyChanged("workCenter"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=15)] + public string tNumber { + get { + return this.tNumberField; + } + set { + this.tNumberField = value; + this.RaisePropertyChanged("tNumber"); + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + protected void RaisePropertyChanged(string propertyName) { + System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged; + if ((propertyChanged != null)) { + propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + [System.ServiceModel.MessageContractAttribute(WrapperName="life", WrapperNamespace="http://zk.ws.epichust.com/", IsWrapped=true)] + public partial class life { + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://zk.ws.epichust.com/", Order=0)] + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] + public ExternalDataSync.ESB_life.interfaceRequestHeader arg0; + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://zk.ws.epichust.com/", Order=1)] + [System.Xml.Serialization.XmlElementAttribute("arg1", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] + public ExternalDataSync.ESB_life.baseLifeInfoTo[] arg1; + + public life() { + } + + public life(ExternalDataSync.ESB_life.interfaceRequestHeader arg0, ExternalDataSync.ESB_life.baseLifeInfoTo[] arg1) { + this.arg0 = arg0; + this.arg1 = arg1; + } + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + [System.ServiceModel.MessageContractAttribute(WrapperName="lifeResponse", WrapperNamespace="http://zk.ws.epichust.com/", IsWrapped=true)] + public partial class lifeResponse { + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://zk.ws.epichust.com/", Order=0)] + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] + public ExternalDataSync.ESB_life.interfaceResponse @return; + + public lifeResponse() { + } + + public lifeResponse(ExternalDataSync.ESB_life.interfaceResponse @return) { + this.@return = @return; + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + public interface UrmRsBaseLifeInterfaceChannel : ExternalDataSync.ESB_life.UrmRsBaseLifeInterface, System.ServiceModel.IClientChannel { + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + public partial class UrmRsBaseLifeInterfaceClient : System.ServiceModel.ClientBase, ExternalDataSync.ESB_life.UrmRsBaseLifeInterface { + + public UrmRsBaseLifeInterfaceClient() { + } + + public UrmRsBaseLifeInterfaceClient(string endpointConfigurationName) : + base(endpointConfigurationName) { + } + + public UrmRsBaseLifeInterfaceClient(string endpointConfigurationName, string remoteAddress) : + base(endpointConfigurationName, remoteAddress) { + } + + public UrmRsBaseLifeInterfaceClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) : + base(endpointConfigurationName, remoteAddress) { + } + + public UrmRsBaseLifeInterfaceClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : + base(binding, remoteAddress) { + } + + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + ExternalDataSync.ESB_life.lifeResponse ExternalDataSync.ESB_life.UrmRsBaseLifeInterface.life(ExternalDataSync.ESB_life.life request) { + return base.Channel.life(request); + } + + public ExternalDataSync.ESB_life.interfaceResponse life(ExternalDataSync.ESB_life.interfaceRequestHeader arg0, ExternalDataSync.ESB_life.baseLifeInfoTo[] arg1) { + ExternalDataSync.ESB_life.life inValue = new ExternalDataSync.ESB_life.life(); + inValue.arg0 = arg0; + inValue.arg1 = arg1; + ExternalDataSync.ESB_life.lifeResponse retVal = ((ExternalDataSync.ESB_life.UrmRsBaseLifeInterface)(this)).life(inValue); + return retVal.@return; + } + + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + System.Threading.Tasks.Task ExternalDataSync.ESB_life.UrmRsBaseLifeInterface.lifeAsync(ExternalDataSync.ESB_life.life request) { + return base.Channel.lifeAsync(request); + } + + public System.Threading.Tasks.Task lifeAsync(ExternalDataSync.ESB_life.interfaceRequestHeader arg0, ExternalDataSync.ESB_life.baseLifeInfoTo[] arg1) { + ExternalDataSync.ESB_life.life inValue = new ExternalDataSync.ESB_life.life(); + inValue.arg0 = arg0; + inValue.arg1 = arg1; + return ((ExternalDataSync.ESB_life.UrmRsBaseLifeInterface)(this)).lifeAsync(inValue); + } + } +} diff --git a/SlMesDbIterface/Connected Services/ESB_life/Reference.svcmap b/SlMesDbIterface/Connected Services/ESB_life/Reference.svcmap new file mode 100644 index 0000000..c8cffda --- /dev/null +++ b/SlMesDbIterface/Connected Services/ESB_life/Reference.svcmap @@ -0,0 +1,32 @@ + + + + false + true + true + + false + false + false + + + true + Auto + true + true + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/SlMesDbIterface/Connected Services/ESB_life/UrmRsBaseLifeInterface2.wsdl b/SlMesDbIterface/Connected Services/ESB_life/UrmRsBaseLifeInterface2.wsdl new file mode 100644 index 0000000..30c0b81 --- /dev/null +++ b/SlMesDbIterface/Connected Services/ESB_life/UrmRsBaseLifeInterface2.wsdl @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/SlMesDbIterface/Connected Services/ESB_life/configuration.svcinfo b/SlMesDbIterface/Connected Services/ESB_life/configuration.svcinfo new file mode 100644 index 0000000..c196433 --- /dev/null +++ b/SlMesDbIterface/Connected Services/ESB_life/configuration.svcinfo @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/SlMesDbIterface/Connected Services/ESB_life/configuration91.svcinfo b/SlMesDbIterface/Connected Services/ESB_life/configuration91.svcinfo new file mode 100644 index 0000000..3c26e59 --- /dev/null +++ b/SlMesDbIterface/Connected Services/ESB_life/configuration91.svcinfo @@ -0,0 +1,201 @@ + + + + + + + urmRsBaseLifeInterfaceSoapBinding + + + + + + + + + + + + + + + + + + + + + StrongWildcard + + + + + + 65536 + + + + + + + + + System.ServiceModel.Configuration.XmlDictionaryReaderQuotasElement + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + System.Text.UTF8Encoding + + + Buffered + + + + + + Text + + + System.ServiceModel.Configuration.BasicHttpSecurityElement + + + None + + + System.ServiceModel.Configuration.HttpTransportSecurityElement + + + None + + + None + + + System.Security.Authentication.ExtendedProtection.Configuration.ExtendedProtectionPolicyElement + + + Never + + + TransportSelected + + + (集合) + + + + + + System.ServiceModel.Configuration.BasicHttpMessageSecurityElement + + + UserName + + + Default + + + + + + + + + http://10.6.201.184:8011/CDMOM/COMMON/COMMON2CDMOM_CutterStateInfo/ProxyServices/CutterStateInfoPS + + + + + + basicHttpBinding + + + urmRsBaseLifeInterfaceSoapBinding + + + ESB_life.UrmRsBaseLifeInterface + + + System.ServiceModel.Configuration.AddressHeaderCollectionElement + + + <Header /> + + + System.ServiceModel.Configuration.IdentityElement + + + System.ServiceModel.Configuration.UserPrincipalNameElement + + + + + + System.ServiceModel.Configuration.ServicePrincipalNameElement + + + + + + System.ServiceModel.Configuration.DnsElement + + + + + + System.ServiceModel.Configuration.RsaElement + + + + + + System.ServiceModel.Configuration.CertificateElement + + + + + + System.ServiceModel.Configuration.CertificateReferenceElement + + + My + + + LocalMachine + + + FindBySubjectDistinguishedName + + + + + + False + + + UrmRsBaseLifeInterfaceImplPort + + + + + + + + + + + \ No newline at end of file diff --git a/SlMesDbIterface/Connected Services/ESB_life/urmRsBaseLifeInterface1.wsdl b/SlMesDbIterface/Connected Services/ESB_life/urmRsBaseLifeInterface1.wsdl new file mode 100644 index 0000000..4b19020 --- /dev/null +++ b/SlMesDbIterface/Connected Services/ESB_life/urmRsBaseLifeInterface1.wsdl @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + OSB Service + + + + + \ No newline at end of file diff --git a/SlMesDbIterface/ExternalDataSync.csproj b/SlMesDbIterface/ExternalDataSync.csproj new file mode 100644 index 0000000..860a967 --- /dev/null +++ b/SlMesDbIterface/ExternalDataSync.csproj @@ -0,0 +1,457 @@ + + + + + Debug + AnyCPU + {2F33D79D-1DFF-4CDA-B357-FCD5221CAB9A} + WinExe + ExternalDataSync + ExternalDataSync + v4.8 + 512 + true + true + + + + + + AnyCPU + true + full + false + bin\ExternalDataSync\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + 系统管理和监控服务.ico + + + + + ..\DLL\BasicData.dll + + + ..\DLL\DataLinkMesWork.dll + + + ..\DLL\ICSharpCode.SharpZipLib.dll + + + ..\packages\Microsoft.Bcl.AsyncInterfaces.5.0.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll + + + ..\packages\Microsoft.Extensions.Logging.Abstractions.2.0.0\lib\netstandard2.0\Microsoft.Extensions.Logging.Abstractions.dll + + + ..\packages\Microsoft.Owin.2.0.2\lib\net45\Microsoft.Owin.dll + + + ..\packages\Microsoft.Win32.Registry.5.0.0\lib\net461\Microsoft.Win32.Registry.dll + + + ..\packages\Newtonsoft.Json.6.0.4\lib\net45\Newtonsoft.Json.dll + + + ..\DLL\NPOI.dll + + + ..\DLL\NPOI.OOXML.dll + + + ..\DLL\NPOI.OpenXml4Net.dll + + + ..\DLL\NPOI.OpenXmlFormats.dll + + + ..\packages\Owin.1.0\lib\net40\Owin.dll + + + ..\packages\SharpCompress.0.30.1\lib\net461\SharpCompress.dll + + + + ..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll + + + + + + ..\packages\System.IO.4.3.0\lib\net462\System.IO.dll + True + True + + + ..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll + + + ..\packages\System.Net.Http.4.3.4\lib\net46\System.Net.Http.dll + True + True + + + ..\packages\Microsoft.AspNet.WebApi.Client.5.2.9\lib\net45\System.Net.Http.Formatting.dll + + + + ..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll + + + ..\packages\System.Runtime.4.3.0\lib\net462\System.Runtime.dll + True + True + + + ..\packages\System.Runtime.CompilerServices.Unsafe.5.0.0\lib\net45\System.Runtime.CompilerServices.Unsafe.dll + + + ..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll + True + True + + + + ..\packages\System.Security.AccessControl.5.0.0\lib\net461\System.Security.AccessControl.dll + + + ..\packages\System.Security.Cryptography.Algorithms.4.3.0\lib\net463\System.Security.Cryptography.Algorithms.dll + True + True + + + ..\packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll + True + True + + + ..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll + True + True + + + ..\packages\System.Security.Cryptography.X509Certificates.4.3.0\lib\net461\System.Security.Cryptography.X509Certificates.dll + True + True + + + ..\packages\System.Security.Principal.Windows.5.0.0\lib\net461\System.Security.Principal.Windows.dll + + + + ..\packages\System.Text.Encoding.CodePages.5.0.0\lib\net461\System.Text.Encoding.CodePages.dll + + + ..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll + + + + ..\packages\Microsoft.AspNet.Cors.5.2.9\lib\net45\System.Web.Cors.dll + + + ..\packages\Microsoft.AspNet.WebApi.Core.5.2.9\lib\net45\System.Web.Http.dll + + + ..\packages\Microsoft.AspNet.WebApi.Cors.5.2.9\lib\net45\System.Web.Http.Cors.dll + + + ..\packages\Microsoft.AspNet.WebApi.Owin.5.2.9\lib\net45\System.Web.Http.Owin.dll + + + ..\packages\Microsoft.AspNet.WebApi.SelfHost.5.2.9\lib\net45\System.Web.Http.SelfHost.dll + + + ..\packages\Microsoft.AspNet.WebApi.WebHost.5.2.9\lib\net45\System.Web.Http.WebHost.dll + + + + ..\packages\System.Web.Services.Description.4.10.2\lib\net461\System.Web.Services.Description.dll + + + + + + + + + + + + + + True + True + Reference.svcmap + + + True + True + Reference.svcmap + + + True + True + Reference.svcmap + + + True + True + Reference.svcmap + + + True + True + Reference.svcmap + + + True + True + Reference.svcmap + + + True + True + Reference.svcmap + + + + + + + + + + + + Form + + + Form_MoveSqlTable.cs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Form_MoveSqlTable.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + True + + + Reference.svcmap + + + Reference.svcmap + + + + + + + Reference.svcmap + + + Reference.svcmap + + + + Reference.svcmap + + + Reference.svcmap + + + + + Reference.svcmap + + + Reference.svcmap + + + + + + + Reference.svcmap + + + Reference.svcmap + + + + + Reference.svcmap + + + Reference.svcmap + + + Reference.svcmap + + + Reference.svcmap + + + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WCF Proxy Generator + Reference.cs + + + + + WCF Proxy Generator + Reference.cs + + + + + WCF Proxy Generator + Reference.cs + + + + + WCF Proxy Generator + Reference.cs + + + + + WCF Proxy Generator + Reference.cs + + + + + WCF Proxy Generator + Reference.cs + + + + + WCF Proxy Generator + Reference.cs + + + + + + {727a1b50-d83a-4319-bdf6-e923f4bd41b3} + 03_CallWebApi + + + {C7C5E929-BE10-4ED6-94DB-B8D65E05E52F} + 01_DatabaseClient + + + {1dc48c83-1842-4de8-acaf-26e1e7f7c58f} + 00_MyLog4Net + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/SlMesDbIterface/Form_MoveSqlTable.Designer.cs b/SlMesDbIterface/Form_MoveSqlTable.Designer.cs new file mode 100644 index 0000000..a62b1a7 --- /dev/null +++ b/SlMesDbIterface/Form_MoveSqlTable.Designer.cs @@ -0,0 +1,93 @@ + +namespace SlMesDbIterface +{ + partial class Form_MoveSqlTable + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form_MoveSqlTable)); + this.button1 = new System.Windows.Forms.Button(); + this.richTextBoxLogBox = new System.Windows.Forms.RichTextBox(); + this.button2_passstation = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // button1 + // + this.button1.Location = new System.Drawing.Point(3, 29); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(141, 37); + this.button1.TabIndex = 0; + this.button1.Text = "模拟订单下达"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // richTextBoxLogBox + // + this.richTextBoxLogBox.Location = new System.Drawing.Point(150, 12); + this.richTextBoxLogBox.Name = "richTextBoxLogBox"; + this.richTextBoxLogBox.Size = new System.Drawing.Size(518, 385); + this.richTextBoxLogBox.TabIndex = 2; + this.richTextBoxLogBox.Text = ""; + // + // button2_passstation + // + this.button2_passstation.Location = new System.Drawing.Point(3, 90); + this.button2_passstation.Name = "button2_passstation"; + this.button2_passstation.Size = new System.Drawing.Size(141, 37); + this.button2_passstation.TabIndex = 0; + this.button2_passstation.Text = "开始上传按钮"; + this.button2_passstation.UseVisualStyleBackColor = true; + this.button2_passstation.Click += new System.EventHandler(this.button1_Click1111); + // + // Form_MoveSqlTable + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(680, 409); + this.Controls.Add(this.richTextBoxLogBox); + this.Controls.Add(this.button2_passstation); + this.Controls.Add(this.button1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.Margin = new System.Windows.Forms.Padding(2); + this.MaximizeBox = false; + this.Name = "Form_MoveSqlTable"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "2023.04.09.1250"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form_MoveSqlTable_FormClosing_1); + this.Load += new System.EventHandler(this.Form_MoveSqlTable_Load); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Button button1; + private System.Windows.Forms.RichTextBox richTextBoxLogBox; + private System.Windows.Forms.Button button2_passstation; + } +} \ No newline at end of file diff --git a/SlMesDbIterface/Form_MoveSqlTable.cs b/SlMesDbIterface/Form_MoveSqlTable.cs new file mode 100644 index 0000000..e9e4cea --- /dev/null +++ b/SlMesDbIterface/Form_MoveSqlTable.cs @@ -0,0 +1,208 @@ +using ExternalDataSync; +using ExternalDataSync.MOM; +using Newtonsoft.Json; +using NPOI.SS.Formula.Functions; +using PLMTEST; +using System; +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Data.SqlClient; +using System.Diagnostics; +using System.Drawing; +using System.IO; +using System.Linq; +using System.Net; +using System.Net.NetworkInformation; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using System.Windows.Forms; +using WebApi; +using static NPOI.HSSF.Record.UnicodeString; +using static System.Configuration.ConfigurationManager; + +/// +/// +/// +namespace SlMesDbIterface +{ + public partial class Form_MoveSqlTable : Form + { + public static Action Delegate_UpdateValue = null; + public int count = 0; + public static int upload_Interval = Convert.ToInt32(AppSettings["upload_Interval"]); + public static int upload_Interval_error = Convert.ToInt32(AppSettings["upload_Interval_error"]); + InitServer initServer = null; + UpLoadMessage uploadMessage = new UpLoadMessage(); + /// + /// + /// + public Form_MoveSqlTable() + { + InitializeComponent(); + initServer = new WebApi.InitServer(Program.WebSvrPort); + } + + private void button1_Click(object sender, EventArgs e) + { + var a = new msg(); + // a.insertOrderData = new InsertOrderData(); + a.msgHeader = new msgHeader(); + //string bodyData = JsonConvert.SerializeObject(a); + string bodyData = "{\r\n \"msgHeader\": {\r\n \"messageID\": \"865f0c4ed27f45718189a6cb0e83c1a4\",\r\n \"interfaceID\": \"MOM-中控-011\",\r\n \"transID\": \"865f0c4ed27f45718189a6cb0e83c1a4\",\r\n \"sender\": \"mom\",\r\n \"receiver\": \"中控\"\r\n },\r\n \"msgBody\": {\r\n \"batchNo\": null,\r\n \"flag\": \"1\",\r\n \"HasProduSerial\": \"0\",\r\n \"isOiling\": \"0\",\r\n \"isPainting\": \"0\",\r\n \"markDate\": null,\r\n \"markTime\": null,\r\n \"nature\": \"0\",\r\n \"numCode\": null,\r\n \"orderCode\": null,\r\n \"planDate\": \"2023-06-08\",\r\n \"planEndDate\": \"2023-06-27\",\r\n \"planStartDate\": \"2023-06-27\",\r\n \"priority\": \"0\",\r\n \"proCode\": \"2401016-B4C/B\",\r\n \"proName\": \"后桥半壳\",\r\n \"proShift\": \"7\",\r\n \"produceType\": \"0\",\r\n \"productState\": \"生产\",\r\n \"qty\": \"1\",\r\n \"routeCode\": \"2401016-B4C/B\",\r\n \"routeVer\": \"2401016-B4C/B_0\",\r\n \"seqNo\": \"1\",\r\n \"serialOrlor\": \"1\",\r\n \"site\": \"W13\",\r\n \"sn\": \"0\",\r\n \"workCenter\": \"中重型桥壳冲压一线\",\r\n \"workOrderCode\": \"10BK10|PO-202306027-001_002\",\r\n \"msgTaskList\": [\r\n {\r\n \"equiCode\": null,\r\n \"opCode\": \"10BK1001\",\r\n \"planEndDate\": \"2023-06-27\",\r\n \"planStartDate\": \"2023-06-27\",\r\n \"proCode\": \"2401016-B4C/B\",\r\n \"proName\": \"后桥半壳\",\r\n \"qty\": \"1\",\r\n \"taskOrderCode\": \"TO-20230627-2588\",\r\n \"workCell\": null\r\n },\r\n {\r\n \"equiCode\": null,\r\n \"opCode\": \"10BK1002\",\r\n \"planEndDate\": \"2023-06-27\",\r\n \"planStartDate\": \"2023-06-27\",\r\n \"proCode\": \"2401016-B4C/B\",\r\n \"proName\": \"后桥半壳\",\r\n \"qty\": \"1\",\r\n \"taskOrderCode\": \"TO-20230627-2589\",\r\n \"workCell\": null\r\n },\r\n {\r\n \"equiCode\": null,\r\n \"opCode\": \"10BK1003\",\r\n \"planEndDate\": \"2023-06-27\",\r\n \"planStartDate\": \"2023-06-27\",\r\n \"proCode\": \"2401016-B4C/B\",\r\n \"proName\": \"后桥半壳\",\r\n \"qty\": \"1\",\r\n \"taskOrderCode\": \"TO-20230627-2590\",\r\n \"workCell\": null\r\n },\r\n {\r\n \"equiCode\": null,\r\n \"opCode\": \"10BK1004\",\r\n \"planEndDate\": \"2023-06-27\",\r\n \"planStartDate\": \"2023-06-27\",\r\n \"proCode\": \"2401016-B4C/B\",\r\n \"proName\": \"后桥半壳\",\r\n \"qty\": \"1\",\r\n \"taskOrderCode\": \"TO-20230627-2591\",\r\n \"workCell\": null\r\n },\r\n {\r\n \"equiCode\": null,\r\n \"opCode\": \"10BK1005\",\r\n \"planEndDate\": \"2023-06-27\",\r\n \"planStartDate\": \"2023-06-27\",\r\n \"proCode\": \"2401016-B4C/B\",\r\n \"proName\": \"后桥半壳\",\r\n \"qty\": \"1\",\r\n \"taskOrderCode\": \"TO-20230627-2592\",\r\n \"workCell\": null\r\n },\r\n {\r\n \"equiCode\": null,\r\n \"opCode\": \"10BK1006\",\r\n \"planEndDate\": \"2023-06-27\",\r\n \"planStartDate\": \"2023-06-27\",\r\n \"proCode\": \"2401016-B4C/B\",\r\n \"proName\": \"后桥半壳\",\r\n \"qty\": \"1\",\r\n \"taskOrderCode\": \"TO-20230627-2593\",\r\n \"workCell\": null\r\n },\r\n {\r\n \"equiCode\": null,\r\n \"opCode\": \"10BK1007\",\r\n \"planEndDate\": \"2023-06-27\",\r\n \"planStartDate\": \"2023-06-27\",\r\n \"proCode\": \"2401016-B4C/B\",\r\n \"proName\": \"后桥半壳\",\r\n \"qty\": \"1\",\r\n \"taskOrderCode\": \"TO-20230627-2594\",\r\n \"workCell\": null\r\n },\r\n {\r\n \"equiCode\": null,\r\n \"opCode\": \"10BK1008\",\r\n \"planEndDate\": \"2023-06-27\",\r\n \"planStartDate\": \"2023-06-27\",\r\n \"proCode\": \"2401016-B4C/B\",\r\n \"proName\": \"后桥半壳\",\r\n \"qty\": \"1\",\r\n \"taskOrderCode\": \"TO-20230627-2595\",\r\n \"workCell\": null\r\n },\r\n {\r\n \"equiCode\": null,\r\n \"opCode\": \"10BK1009\",\r\n \"planEndDate\": \"2023-06-27\",\r\n \"planStartDate\": \"2023-06-27\",\r\n \"proCode\": \"2401016-B4C/B\",\r\n \"proName\": \"后桥半壳\",\r\n \"qty\": \"1\",\r\n \"taskOrderCode\": \"TO-20230627-2596\",\r\n \"workCell\": null\r\n }\r\n ]\r\n }\r\n}"; + string urlStr = "http://127.0.0.1:9981/api/IOrder/person"; + string retString; + HttpWebRequest request = (HttpWebRequest)WebRequest.Create(urlStr); + request.Method = "POST"; + byte[] bytes = Encoding.UTF8.GetBytes(bodyData); + request.Accept = "*/*"; + request.ContentType = "application/json;charset=UTF-8"; + + msgHeader mHeader = new msgHeader(); + //mHeader.messageID = "API_InsertOrder_002"; + //mHeader.interfaceID = "API_InsertOrder_002"; + //mHeader.transID = "API_InsertOrder_002"; + //mHeader.sender = "JF_MTD00002"; + //mHeader.receiver = "JF_D00002"; + + ////请求头 + //request.Headers.Add("messageID", mHeader.messageID); + //request.Headers.Add("interfaceID", mHeader.interfaceID); + //request.Headers.Add("transID", mHeader.transID); + //request.Headers.Add("sender", mHeader.sender); + //request.Headers.Add("receiver", mHeader.receiver); + + + request.ContentLength = bytes.Length; + try + { + Stream myResponseStream = request.GetRequestStream(); + myResponseStream.Write(bytes, 0, bytes.Length); + HttpWebResponse response = (HttpWebResponse)request.GetResponse(); + StreamReader myStreamReader = new StreamReader(response.GetResponseStream(), Encoding.UTF8); + retString = myStreamReader.ReadToEnd(); + msgResHeader mrh = JsonConvert.DeserializeObject(retString); + int statusCode = (int)response.StatusCode; + if (statusCode == 200) + { + myStreamReader.Close(); + myResponseStream.Close(); + if (response != null) + { + response.Close(); + } + if (request != null) + { + request.Abort(); + } + } + MyLog4Net.MyLogHelper.Info("res:", retString); + } + catch (Exception err) + { + + } + } + /// + /// 过点信息上传测试 + /// + /// + /// + private void button1_Click1111(object sender, EventArgs e) + { + //uploadMessage.GetUpLoadMessageButton("MES_产品过点信息", 1); + new Thread(new ThreadStart(delegate () { + while (true) + { + try + { + uploadMessage.GetUpLoadMessageButton("接口_上传_质量数据"); + } + catch (Exception err) + { + } + Thread.Sleep(5000); + } + })) + { IsBackground = true }.Start(); + } + /// + /// 报警信息上传测试 + /// + /// + /// + private void button1_Click2222(object sender, EventArgs e) + { + new Thread(new ThreadStart(delegate () { + while (true) + { + try + { + //uploadMessage.GetUpLoadMessageButton("上传MES_设备报警信息"); + } + catch (Exception err) + { + } + Thread.Sleep(5000); + } + })) + { IsBackground = true }.Start(); + } + + private void Form_MoveSqlTable_Load(object sender, EventArgs e) + { + MyLog4Net.MyLogHelper.LogCommit += MyLogHelper_LogCommit; + } + + private void MyLogHelper_LogCommit(object sender, MyLog4Net.MyLogEventArgs e) + { + var module = e.Module; + var message = e.Message; + + var log = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss fff") + " " + module + " " + message + "\r\n"; + + count++; + + + if (this.InvokeRequired) + { + this.Invoke(new Action(() => + { + if (count > 100) + { + this.richTextBoxLogBox.Text = ""; + } + this.richTextBoxLogBox.AppendText(log); + // this.richTextBoxLogBox.Text += log; + richTextBoxLogBox.Focus(); + })); + } + else + { + if (count > 100) + { + this.richTextBoxLogBox.Text = ""; + } + this.richTextBoxLogBox.AppendText(log); + // this.richTextBoxLogBox.Text += log; + richTextBoxLogBox.Focus(); + } + + } + + private void Form_MoveSqlTable_FormClosing_1(object sender, FormClosingEventArgs e) + { + if (MessageBox.Show("确认关闭?", "是否关闭", MessageBoxButtons.YesNo) == DialogResult.Yes) + { + //initServer.Close(); + Process.GetCurrentProcess().Kill(); + } + else + { + e.Cancel = true; + } + } + } +} diff --git a/SlMesDbIterface/Form_MoveSqlTable.resx b/SlMesDbIterface/Form_MoveSqlTable.resx new file mode 100644 index 0000000..aedf36b --- /dev/null +++ b/SlMesDbIterface/Form_MoveSqlTable.resx @@ -0,0 +1,200 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 47 + + + + + AAABAAEAICAAAAEAIACoEAAAFgAAACgAAAAgAAAAQAAAAAEAIAAAAAAAABAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAnVsKAKFdDgChXQ4CoV0OBaFdDgWhXQ4FoVwNBaBc + DAWgXAwFoFwMBaBcDAWhXA0FoV0OBaFdDgWhXQ4FoV0OAqFdDgChXQ4AAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACdWwoAoV0OAKFdDk6hXQ6voV0OrqFd + Dq6hXA2uoFwMrqBcDK6gXAyuoFwMrqFcDa6hXQ6uoV0OrqFdDq+hXQ5IoV0OAKFdDgAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJ1bCwCiXQ4AoV0OLaFd + DmWhXQ11o2EU7MKYZv/OrYX/zayD/82sg//OrYX/xZxs/6RjF+yhXA11oV0OZKFdDimhXQ4AoV0OAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAChXQ4AoVwOAKFdDgChXQ4AoV0OAKFdDgChXQ4AoV0OAKFd + DgChXQ4AoV0OAJ9YBhSlZBnZ3Mar//Hs4v/w6t//8Orf//Hr4v/gzrb/p2ge2Z1VAhShXQ4AoV0OAKFd + DgChXQ4AoV0OAKFdDgChXQ4AoV0OAKFdDgCiXhAAoVwNAKFdDgChXQ4AoV0OD6FdDiqhXQ4uoV0OLaFd + Di2hXQ4toV0OLaFdDi2hXQ4soFwMQ6RjF+LStI//49K8/+LQuv/i0Lr/49K8/9W6mP+mZhvioFsLQ6Fd + DiyhXQ4toV0OLaFdDi2hXQ4toV0OLaFdDi6hXQ4poV0ODaFdDgCiXQ8AoV0OAKFdDiehXQ60oV0OzqFd + DsmhXQ7KoV0OyqFdDsqhXQ7KoV0OyqFdDsmhXQ7MoV4P3KdoH9+pbCXfqWwk36lsJN+pbCTfqGkg36Fe + ENyhXQ7MoV0OyaFdDsqhXQ7KoV0OyqFdDsqhXQ7KoV0OyaFdDs6hXQ6woV0OI6FdDgChXQ0AoV0Oj6Fd + DqyhXQ4ooF0OIaBdDiGgXQ4hoF0OIaBdDiGgXQ4hoF0OIaBdDiGgXA4gnVgGIJxWBCCdVgQgnVYEIJxW + BCCdVwYgoFwNIKBdDiGgXQ4hoF0OIaBdDiGgXQ4hoF0OIaBdDiGgXQ4hoV0OKqFdDrKhXQ6JolwOAKFd + DgShXQ6woV0ObqFdDgCgXQ4AoF0OAKBdDgCgXQ4AoF0OAKBdDgCgXQ4AoF0OAKBdDgCgXQ4AoF0OAKBd + DgCgXQ4AoV0OAKFdDgCgXQ4AoF0OAKBdDgCgXQ4AoF0OAKBdDgCgXQ4AoF0OAKBdDgChXQ4AoV0Ob6Fd + DqeiXQ0DoV0OBaFdDrChXQ5toV0OAKFdDgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAoV4NAKBd + DgCdXw4AoV0OAKFdDg+hXQ5WoV0OIKFdDgChXQ4An10OAAAAAAAAAAAAAAAAAAAAAAAAAAAAoV0OAKFd + DgChXQ5toV0Op6NdDAOhXQ4FoV0OsKFdDm2hXQ4AoV0OAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKJb + CwChXQ4AoV0OAKFdDgChXQ4moV0OqKFdDuOhXQ6toV0OFKFdDgChXQ4AAAAAAAAAAAAAAAAAAAAAAAAA + AAChXQ4AoV0OAKFdDm2hXQ6no10MA6FdDgWhXQ6woV0ObaFdDgChXQ4AoV0OAKFdDgCfWwwAAAAAAAAA + AAChXg4AoV0OAKFdDgCgXg0BoV0OTaFdDsuhXQ6eoV0ONKFdDrKhXQ6VoV0OCKFdDgAAAAAAAAAAAAAA + AAAAAAAAAAAAAKFdDgChXQ4AoV0ObaFdDqejXQwDoV0OBaFdDrChXQ5toV8TAaFdDimhXA4HoV0OAKFc + DQChXg8AoV0OAKBdDwChXQ4AoV0ODqFdDn2hXQ7VoV0OcaFdDgmhXQ4AoV0OKqFdDnajXAkMg3lpAFCo + /wBQqP8AUKn/AFCp/wAAAAAAoV0OAKFdDgChXQ5toV0Op6NdDAOhXQ4FoV0OsKFdDmyhXQ4VoV0Ot6Fd + DpShXQ4boV0OAKFdDgChXQ4AoV0OAKFdDiihXQ6soV0OxqFdDkOfXA8AoV0OAKFdDwCiXAsAdomUAEO0 + /wNQqP4HUKj/B1Co/wVQqf8AUKr/AAAAAAChXQ4AoV0OAKFdDm2hXQ6no10MA6FdDgWhXQ6woV0ObaFd + DgChXQ4woV0OraFdDsKhXQ5GoVwRAKBgDQGhXQ5QoV0OzaFdDqKhXQ4goV0OALJOAABPqv8AUKn/AFKn + +gBPqv8OUKn/kU+p/7lPqf+4UKn/pFCp/x5Qqf8AUKn/AFCp/wCiXAsAoV0ObaFdDqejXQwDoV0OBaFd + DrChXQ5toV0OAKFdDgChXQ4NoV0OdKFdDtChXQ6BoV0OhKFdDtihXQ5zoV0OCqFdDgBok7kAUKn/AFCp + /wtQqf8zUKn/BE2n/xlWrP/Xjcf//47H//9XrP/zTqj/N1Co/wBQqf8wUKn/FIZ2XgChXQ5uoV0OqaNd + DAOhXQ4FoV0OsKFdDm2hXQ4AoV0OAKFdDgChXQ8AoV0OPKFdDrmhXQ7FoV0ORaJcDQChXQ4AdIeUAFCp + /wBPqf8NT6n/j1Gp/+pPqP92TKf/OVit/9i+3v/1vt//+lqu//BNp/9STqj/XFCp/+RPqf+pQrb/FaNb + B1ihXQ6Lo10MAqFdDgWhXQ6woV0ObaFdDgChXQ4AoV0OAKFdDQChXQ4AoV0OEKFdDhWhXQ4AoV0OAKFd + DgBQqf8AUKn/D0+p/5ZuuP/0lcv/+V2v//NUq//gdrz/8cXi//nG4v/8eLz/+VWs/+Zbrv/sksn/93G5 + //xQqf+wZJbDJalUAA2hXA0AoV0OBaFdDrChXQ5toV0OAKFdDgB9TQkAoV0NAKFdDgChXQ4AoV0OAKZc + DQCiXQ4AfhIAAFCp/wBPqf8vUan/4ZfM/+vQ6P/8sdn/+6zW//nI5P/70Of//9Dn///I5P/+rdb//rDY + //vQ6P/8m87/+FKq//NPqf9LYZnLAKJbCAChXQ4FoV0OsKFdDm2hXQ4AoV0OAKFdDgChXQ4AAAAAAAAA + AAAAAAAAAAAAAFCp/wBQqf8AUKn/AFCo/wBPqP9aXK//47LZ//TS6P//0ej//9Dn///I4///x+P//8/n + ///R6P//0uj//7Xa//tfsP/yT6j/dlCq/wNQqf8AUKn/AKFdDgWhXQ6woV0ObaFdDgChXQ4BoV0OAKFd + DgAAAAAAAAAAAAAAAAAAAAAAUKn/AFCp/wBQqf8XTqj/N0un/0xXrP/astn/9tHo///L5f//mMz//3C5 + //9vuP//jsf//8fj///R6P//tdr//Vmt/+5Lpv9eTaf/NlCp/x5Qqf8AoV0OBaFdDrChXQ5roV0OT6Fd + DmmhXQ4AoV0OAKFdDgChXQ4AoV0OAJ9cDABQqf8AUKn/AFCp/35Yrf/tYLH/6YDB/+7L5f/70ej//6HR + //9ptf//pNL//6vV//9vuP//ksn//9Dn///N5v/+iMT/+mOy//Fcr//zUKn/nlCp/wOhXQ4FoV0OsKFd + DmmhXQ58oV0Ow6FdDkWhXQ4OoV0OMqFdDh2hXQ4An1wMAFCp/wBQqf8ATaj/jYfE//PH4//1y+X/+s/n + ///O5///fr///5DI///S6f//0+n//6LR//9wuf//yeT//9Dn///M5v/+yOT//JTK//9Pqf+vT6n/BaFd + DgShXQ6voV0ObqFdDjyhXQ67oV0OraFdDiGhXQ5+oV0OSaFdDgChXQ4AoV0PAGCa0ABOqP+Oeb3//qjU + //+63f/9z+f//8/n//+Fw///gcH//8zl///P5///kcn//3W7///L5f//0Of//7rd//am0//wf8D//U+p + /7FPqf8FoV0OAKFdDn+hXQ6/oV0OSKFdDkWhXQ5IoV0OPaFdDkShXQ5AoV0OO6FdDjuhXQ42uUYACE+p + /19Rqv/HUan/zmy3//PE4v/80ej//7Ta//9otf//eLz//32///9ls///p9T//9Ho///I5P/7cLn/8k+o + /8tQqf+/UKn/dlCp/wGhXQ4AoV0OF6FdDpKhXQ7HoV0OxqFdDsahXQ7HoV0OxqFdDsehXQ7HoV0OyKFd + DrahXAwiAP//AU6o/wpOqP8pUqr/16fT//nR6P//z+f//7jc//+PyP//i8b//7DY///O5///0ej//7HY + //hVq//pTqj/P0+q/wZQqv8EUKn/AKFdDgChXQ4AoV0OA6FdDhSiXQ0Xol0NFqJdDRaiXQ0Wol0NFqJd + DRaiXQ0XoV0NFaBdDgRenNYAUKn/Dk+p/5VvuP/wv9//+dDn///P5//+0uj//9Ho///Q6P//0uj//9Dn + //7Q5//+w+H/+nW7//NQqf+1UKn/HlCp/wBQqf8AoF0PAKFdDgChXQ4AoV0OAKJdDQCiXQ0Aol0NAKJd + DQCiXQ0Aol0NAKJdDQChXQ0AoV0OAFCp/wBPqf8vUan/45PK//jJ5P/8kcn//IbD//6x2P/7zeb//s7n + //+12//5iMT/+o3H//nI5P/7nc//91Oq//FPqf9LUKn/AFCp/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUKn/AFCp/wJPqP9bXK//5nK6//9Sqv/aTKf/ql6w + /+y93v/2xOH//Ga0//ZMp/+xUan/xnC5//tesP/uT6j/b1Cp/wZQqf8AUKn/AAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQqf8AUKn/AEmk/wBOqP9UTqj/tk+p + /z5Mp/8bV63/07bb//S+3//8XrD/70yn/zhPqP8jTqj/p06o/2ZTq/8CUKn/AFCp/wBQqP8AAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCq/wBQqf8AUKn/AEmq + /wBQqf8KUKn/AE+o/xlSqv/Ub7j//XO6//5Vq//tT6j/NFCp/wBQqf8HUKn/AVCp/wBQqf8AUKz/AAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCx + /wBQqf8AUKn/AFCp/wBQqf8AUKn/BVCp/0lMp/9hS6f/YU+p/1NQqf8NUKn/AFCp/wBQqf8AUKn/AFCo + /wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCp/wBQqf8AUKn/AFCp/wBQqf8AUKn/AFCp/wBQqf8AAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAA/gAAf/4AAH/+AAB/AAAAAAAAAAAAAAAAAAAAAAAAAAAH8APgB+AD4ADA + A+AAAAAgAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAeAAAAHgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAA//gAAP/4AAD/+AAB//wAA///wD8= + + + \ No newline at end of file diff --git a/SlMesDbIterface/MOM/ProductionCalendarBodyData.cs b/SlMesDbIterface/MOM/ProductionCalendarBodyData.cs new file mode 100644 index 0000000..bacf6cf --- /dev/null +++ b/SlMesDbIterface/MOM/ProductionCalendarBodyData.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ExternalDataSync.MOM +{ + ///生产日历下发 Body + public class ProductionCalendarBodyData + { + /// + // 日历组 + /// + public List calendarGroup + { + get; + set; + } = null; + } +} diff --git a/SlMesDbIterface/MOM/ProductionCalendarData.cs b/SlMesDbIterface/MOM/ProductionCalendarData.cs new file mode 100644 index 0000000..61e06ec --- /dev/null +++ b/SlMesDbIterface/MOM/ProductionCalendarData.cs @@ -0,0 +1,109 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ExternalDataSync.MOM +{ + ///物料主数据下发 Body + public class ProductionCalendarData + { + /// + // 类型 + /// + public string typesOf + { + get; + set; + } = ""; + /// + // 类型编码 + /// + public string typeCode + { + get; + set; + } = ""; + /// + // 日历编码 + /// + public string calendarEncoding + { + get; + set; + } = ""; + /// + // 班次名称 + /// + public string shiftName + { + get; + set; + } = ""; + /// + // 开始时间 + /// + public string timeOn + { + get; + set; + } = ""; + /// + /// 结束时间 + /// + public string endTime + { + get; + set; + } = ""; + /// + // 开始日期 + /// + public string startDate + { + get; + set; + } = ""; + /// + // 结束日期 + /// + public string endDate + { + get; + set; + } = ""; + /// + // 班次描述 + /// + public string shiftDescription + { + get; + set; + } = ""; + /// + // 固定休息日 + /// + public string fixedRestDays + { + get; + set; + } = ""; + /// + // 法定节日 + /// + public List statutoryHolidays + { + get; + set; + } = null; + /// + // 非生产时间 + /// + public List nonProductionTime + { + get; + set; + } = null; + } +} diff --git a/SlMesDbIterface/MOM/ProductionCalendarNonProductionData.cs b/SlMesDbIterface/MOM/ProductionCalendarNonProductionData.cs new file mode 100644 index 0000000..77067f5 --- /dev/null +++ b/SlMesDbIterface/MOM/ProductionCalendarNonProductionData.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ExternalDataSync.MOM +{ + ///物料主数据下发 非生产时间 + public class ProductionCalendarNonProductionData + { + /// + // 开始时间 + /// + public string timeOn + { + get; + set; + } = ""; + /// + // 结束时间 + /// + public string endTime + { + get; + set; + } = ""; + } +} diff --git a/SlMesDbIterface/MOM/ProductionCalendarStatutoryData.cs b/SlMesDbIterface/MOM/ProductionCalendarStatutoryData.cs new file mode 100644 index 0000000..7e6c83e --- /dev/null +++ b/SlMesDbIterface/MOM/ProductionCalendarStatutoryData.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ExternalDataSync.MOM +{ + ///物料主数据下发 法定节日 + public class ProductionCalendarStatutoryData + { + /// + // 开始日期 + /// + public string startDate + { + get; + set; + } = ""; + /// + // 结束日期 + /// + public string endDate + { + get; + set; + } = ""; + } +} diff --git a/SlMesDbIterface/MOM/ReportUploadData.cs b/SlMesDbIterface/MOM/ReportUploadData.cs new file mode 100644 index 0000000..e7f2c56 --- /dev/null +++ b/SlMesDbIterface/MOM/ReportUploadData.cs @@ -0,0 +1,77 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ExternalDataSync.MOM +{ + ///生产报工上传 + public class ReportUploadData + { + /// + // 订单号 + /// + public string orderNumber + { + get; + set; + } = ""; + /// + // SN号 + /// + public string snCode + { + get; + set; + } = ""; + /// + // 产品型号 + /// + public string productModel + { + get; + set; + } = ""; + /// + // 配方号 + /// + public string recipeNumber + { + get; + set; + } = ""; + /// + /// 合格标志 + /// + public string qualityResult + { + get; + set; + } = ""; + /// + // 工位号 + /// + public string stationCode + { + get; + set; + } = ""; + /// + // 生产日期 + /// + public string productionDate + { + get; + set; + } = ""; + /// + // 质量数据列表 + /// + public List qualityList + { + get; + set; + } = null; + } +} diff --git a/SlMesDbIterface/MOM/ReportUploadQualityData.cs b/SlMesDbIterface/MOM/ReportUploadQualityData.cs new file mode 100644 index 0000000..3a0ef13 --- /dev/null +++ b/SlMesDbIterface/MOM/ReportUploadQualityData.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ExternalDataSync.MOM +{ + ///生产报工上传 + public class ReportUploadQualityData + { + /// + // 螺钉孔号 + /// + public string screwPositionNumber + { + get; + set; + } = ""; + /// + // 扭矩 + /// + public string torque + { + get; + set; + } = ""; + /// + // 螺桩高度测量值 + /// + public string dowelHeightValue + { + get; + set; + } = ""; + /// + // 合格标志 + /// + public string qualityResult + { + get; + set; + } = null; + } +} diff --git a/SlMesDbIterface/MOM/TemporaryChangeData.cs b/SlMesDbIterface/MOM/TemporaryChangeData.cs new file mode 100644 index 0000000..dea4235 --- /dev/null +++ b/SlMesDbIterface/MOM/TemporaryChangeData.cs @@ -0,0 +1,213 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ExternalDataSync.MOM +{ + ///临时工艺通知下发 + public class TemporaryChangeData + { + /// + // 产品编码、型号 + /// + public string productNo + { + get; + set; + } = ""; + /// + // 产品名称 + /// + public string productName + { + get; + set; + } = ""; + /// + // 项目代号 + /// + public string projectNo + { + get; + set; + } = ""; + /// + // 项目名称 + /// + public string projectName + { + get; + set; + } = ""; + /// + /// 临时工艺通知单号 + /// + public string technicalChangeOrderNo + { + get; + set; + } = ""; + /// + // 批次数量 + /// + public string batchQty + { + get; + set; + } = ""; + /// + // 发放时间 + /// + public string createOn + { + get; + set; + } = ""; + /// + // 开始时间 + /// + public decimal effectiveDateStart + { + get; + set; + } = 0; + /// + // 结束时间 + /// + public string effectiveDateEnd + { + get; + set; + } = ""; + /// + // 临时工艺通知单文件链接 + /// + public string techFileUrl + { + get; + set; + } = ""; + /// + // 原因 + /// + public int reason + { + get; + set; + } = 0; + /// + // 编制 + /// + public string staffing + { + get; + set; + } = ""; + /// + // 编制日期 + /// + public string staffingDate + { + get; + set; + } = ""; + /// + // 校对 + /// + public string proofread + { + get; + set; + } = ""; + /// + // 校对日期 + /// + public string proofreadDate + { + get; + set; + } = ""; + /// + // 审核 + /// + public string check + { + get; + set; + } = ""; + /// + // 审核日期 + /// + public string checkDate + { + get; + set; + } = ""; + /// + // 会签 + /// + public string countersign + { + get; + set; + } = ""; + /// + // 会签日期 + /// + public string countersignDate + { + get; + set; + } = ""; + /// + // 批准 + /// + public string approve + { + get; + set; + } = ""; + /// + // 批准日期 + /// + public string approveDate + { + get; + set; + } = ""; + /// + // 临时工艺通知详细列表 + /// + public List changeList + { + get; + set; + } = null; + /// + // 临时工艺文件列表 + /// + public List fileList + { + get; + set; + } = null; + /// + // 接收部门列表 + /// + public List departmentList + { + get; + set; + } = null; + /// + // 绑定工单列表 + /// + public List wipOrderList + { + get; + set; + } = null; + } +} diff --git a/SlMesDbIterface/MOM/msgResHeader.cs b/SlMesDbIterface/MOM/msgResHeader.cs new file mode 100644 index 0000000..66e5d3e --- /dev/null +++ b/SlMesDbIterface/MOM/msgResHeader.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ExternalDataSync +{ + public class msgResHeader + { + /// + /// 任务ID + /// + public string taskId + { + get; + set; + } + /// + /// 返回结果 + /// + public string code + { + get; + set; + } + /// + /// 返回消息 + /// + public string msg + { + get; + set; + } + /// + /// 返回结果集 + /// + public string returnData + { + get; + set; + } + } +} diff --git a/SlMesDbIterface/MessageHanlder/ApiTools.cs b/SlMesDbIterface/MessageHanlder/ApiTools.cs new file mode 100644 index 0000000..a51e14d --- /dev/null +++ b/SlMesDbIterface/MessageHanlder/ApiTools.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Web.Http; +using System.Net.Http; +using System.Text.RegularExpressions; + +namespace WebApi +{ + public enum ResponseCode + { + Fail = 00000, + Success = 00200, + } + + public class ApiTools + { + private string msgModel = "{{\"code\":{0},\"message\":\"{1}\",\"result\":{2}}}"; + public ApiTools() + { + } + public HttpResponseMessage MsgFormat(ResponseCode code, string explanation, string result) + { + string r = @"^(\-|\+)?\d+(\.\d+)?$"; + string json = string.Empty; + if (Regex.IsMatch(result, r) || result.ToLower() == "true" || result.ToLower() == "false" || result == "[]" || result.Contains('{')) + { + json = string.Format(msgModel, (int)code, explanation, result); + } + else + { + if (result.Contains('"')) + { + json = string.Format(msgModel, (int)code, explanation, result); + } + else + { + json = string.Format(msgModel, (int)code, explanation, "\"" + result + "\""); + } + } + return new HttpResponseMessage { Content = new StringContent(json, System.Text.Encoding.UTF8, "application/json") }; + } + } +} diff --git a/SlMesDbIterface/MessageHanlder/CallWebApi.cs b/SlMesDbIterface/MessageHanlder/CallWebApi.cs new file mode 100644 index 0000000..a836a40 --- /dev/null +++ b/SlMesDbIterface/MessageHanlder/CallWebApi.cs @@ -0,0 +1,148 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Net; +using System.Text; +using System.Threading.Tasks; + +namespace SlMesDbIterface +{ + public partial class MyHttpRequest { + + public static string MyPost(string url,string jsonStr) + { + string result = ""; + + try + { + HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url); + req.Method = "POST"; + req.ContentType = "text/html, application/xhtml+xml, application/json, */*"; + req.Proxy = null; + req.KeepAlive = false; + + byte[] data = Encoding.UTF8.GetBytes(jsonStr); + req.ContentLength = data.Length; + using (Stream reqStream = req.GetRequestStream()) + { + reqStream.Write(data, 0, data.Length); + reqStream.Close(); + } + + HttpWebResponse resp = (HttpWebResponse)req.GetResponse(); + Stream stream = resp.GetResponseStream(); + + + //获取响应内容 + using (StreamReader reader = new StreamReader(stream, Encoding.UTF8)) + { + result = reader.ReadToEnd(); + } + Console.WriteLine(result); + + + } + catch (Exception err) + { + Console.WriteLine(" " + err.Message); + } + + return result; + } + + public static string MyPost(string url,Dictionary paramDict, string jsonStr) + { + string result = ""; + + try + { + StringBuilder builder = new StringBuilder(); + + builder.Append(url); + if (paramDict.Count > 0) + { + builder.Append("?"); + int i = 0; + foreach (var item in paramDict) + { + if (i > 0) + builder.Append("&"); + builder.AppendFormat("{0}={1}", item.Key, item.Value); + i++; + } + } + + HttpWebRequest req = (HttpWebRequest)WebRequest.Create(builder.ToString()); + req.Method = "POST"; + req.ContentType = "text/html, application/xhtml+xml, application/json, */*"; + req.Proxy = null; + req.KeepAlive = false; + + byte[] data = Encoding.UTF8.GetBytes(jsonStr); + req.ContentLength = data.Length; + using (Stream reqStream = req.GetRequestStream()) + { + reqStream.Write(data, 0, data.Length); + reqStream.Close(); + } + + HttpWebResponse resp = (HttpWebResponse)req.GetResponse(); + Stream stream = resp.GetResponseStream(); + + + //获取响应内容 + using (StreamReader reader = new StreamReader(stream, Encoding.UTF8)) + { + result = reader.ReadToEnd(); + } + Console.WriteLine(result); + + + } + catch (Exception err) + { + Console.WriteLine(" " + err.Message); + } + + return result; + } + + public static string MyGet(string url, Dictionary paramDict) + { + string result = ""; + + StringBuilder builder = new StringBuilder(); + + builder.Append(url); + if (paramDict.Count > 0) + { + builder.Append("?"); + int i = 0; + foreach (var item in paramDict) + { + if (i > 0) + builder.Append("&"); + builder.AppendFormat("{0}={1}", item.Key, item.Value); + i++; + } + } + + HttpWebRequest req = (HttpWebRequest)WebRequest.Create(builder.ToString()); + req.Method = "GET"; + req.ContentType = "text/html, application/xhtml+xml, application/json, */*"; + req.Proxy = null; + req.KeepAlive = false; + + HttpWebResponse response = (HttpWebResponse)req.GetResponse(); + Stream rs = response.GetResponseStream(); + StreamReader sr = new StreamReader(rs, Encoding.UTF8); + result = sr.ReadToEnd(); + sr.Close(); + rs.Close(); + + return result; + } + + } +} diff --git a/SlMesDbIterface/MessageHanlder/DeviceTools.cs b/SlMesDbIterface/MessageHanlder/DeviceTools.cs new file mode 100644 index 0000000..895833a --- /dev/null +++ b/SlMesDbIterface/MessageHanlder/DeviceTools.cs @@ -0,0 +1,313 @@ +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using TECSharpFunction; + +namespace SlMesDbIterface +{ + public class DeviceTools + { + public static void GetToolExcel(string FtpServer, string FtpUser,string FtpPassWord, string FtpFileList) + { + FTPHelper ftpClient = new FTPHelper(FtpServer, @"", FtpUser, FtpPassWord); + //ListType=1代表获取文件列表,ListType=2代表获取文件夹列表,ListType=3代表获取文件和文件夹列表。 + //Detail=true时获文件或文件夹详细信息,Detail=false时只获取文件或文件夹名称。 + //Keyword是只需list名称包含Keyword的文件或文件夹,若要list所有文件或文件夹,则该参数为空。若ListType=3,则该参数无效。 + + int ListType = 1; + bool Detail = false; + string Keyword = ""; + + var fileList = ftpClient.GetFileDirctoryList(ListType, Detail, Keyword); + + foreach (string itemFileName in fileList) + { + string tableName = itemFileName.Substring(0, itemFileName.LastIndexOf(".")); + if (FtpFileList.Contains(itemFileName)) + { + ftpClient.Download(itemFileName, itemFileName, null); + ExcelToDataTable(itemFileName, tableName); + } + else + { + } + } + } + + private static void ExcelToDataTable(string excelPath, string tableName) + { + ////判断是否包含当前日期的记录 + //int excelSheetindex = 0; + //var dt = NPOITest.ExeclHelper.ExcelToDataTable(excelPath, excelSheetindex, true); + //switch (tableName) + //{ + // case "刀具柜-库存明细": + // { + // string str1 = "delete from[刀具柜-库存明细] where[导入日期] = '" + DateTime.Now.ToShortDateString() + "'"; + // DataLinkMesWork.SQLCommon.ExecuteSql(str1, Program.ConnectionString_MES, out string errorMessage1); + // var dt_DB = GetToolDetail(dt); + // SqlBulkCopyByDatatable(Program.ConnectionString_MES, tableName, dt_DB); + // } + // break; + // case "刀具领用记录": + // { + // string str2 = "delete from[刀具领用记录] where[导入日期] = '" + DateTime.Now.ToShortDateString() + "'"; + // DataLinkMesWork.SQLCommon.ExecuteSql(str2, Program.ConnectionString_MES, out string errorMessage2); + // var dt_DB = GetToolRecoder(dt); + // SqlBulkCopyByDatatable(Program.ConnectionString_MES, tableName, dt_DB); + // } + // break; + //} + } + + + /// + /// 刀具领用记录 + /// + private static DataTable GetToolRecoder(DataTable dtData) + { + //刀具领用记录.xls + + DataTable dt = new DataTable(); + dt.Columns.Add("物料名称", typeof(System.String)); + dt.Columns.Add("物料编号", typeof(System.String)); + dt.Columns.Add("物料型号", typeof(System.String)); + dt.Columns.Add("供应商", typeof(System.String));//品牌(供应商) + dt.Columns.Add("领取来源", typeof(System.String)); + dt.Columns.Add("领取数量", typeof(System.Int32)); + dt.Columns.Add("实领数量", typeof(System.Int32)); + dt.Columns.Add("领取单位", typeof(System.String)); + dt.Columns.Add("包装数量", typeof(System.Int32)); + dt.Columns.Add("包装单位", typeof(System.String)); + dt.Columns.Add("领用类型", typeof(System.String)); + dt.Columns.Add("单价", typeof(System.Double));//单价(元) + dt.Columns.Add("金额", typeof(System.Double)); + dt.Columns.Add("部门", typeof(System.String)); + dt.Columns.Add("领用人员", typeof(System.String)); + dt.Columns.Add("已归还数量", typeof(System.Int32)); + dt.Columns.Add("是否归还", typeof(System.String)); + dt.Columns.Add("领用时间", typeof(System.DateTime)); + DataRow dr = dt.NewRow(); + for (int i = 0; i < dtData.Rows.Count; i++) + { + dr = dt.NewRow(); + var 物料名称 = dtData.Rows[i][0].ToString(); + if (物料名称 == "合计") + { + continue; + } + dr["物料名称"] = 物料名称; + dr["物料编号"] = dtData.Rows[i][1].ToString(); + dr["物料型号"] = dtData.Rows[i][2].ToString(); + dr["供应商"] = dtData.Rows[i][3].ToString(); + dr["领取来源"] = dtData.Rows[i][4].ToString(); + try + { + dr["领取数量"] = Convert.ToInt32(dtData.Rows[i][5]); + } + catch + { + dr["领取数量"] = 0; + } + try + { + dr["实领数量"] = Convert.ToInt32(dtData.Rows[i][6]); + } + catch + { + dr["实领数量"] = 0; + } + dr["领取单位"] = dtData.Rows[i][7].ToString(); + try + { + dr["包装数量"] = Convert.ToInt32(dtData.Rows[i][8]); + } + catch + { + dr["包装数量"] = 0; + } + + + dr["包装单位"] = dtData.Rows[i][9].ToString(); + dr["领用类型"] = dtData.Rows[i][10].ToString(); + try + { + dr["单价"] = Convert.ToDouble(dtData.Rows[i][11]); + } + catch + { + dr["单价"] = 0; + } + try + { + dr["金额"] = Convert.ToDouble(dtData.Rows[i][12]); + } + catch + { + dr["金额"] = 0; + } + dr["部门"] = dtData.Rows[i][13].ToString(); + dr["领用人员"] = dtData.Rows[i][14].ToString(); + + + try + { + dr["已归还数量"] = Convert.ToInt32(dtData.Rows[i][15]); + } + catch + { + dr["已归还数量"] = 0; + } + dr["是否归还"] = dtData.Rows[i][16].ToString(); + try + { + dr["领用时间"] = Convert.ToDateTime(dtData.Rows[i][17]); + // dr["领用时间"] = dtData.Rows[i][17].ToString(); + } + catch + { + dr["领用时间"] = DBNull.Value; + } + + dt.Rows.Add(dr); + } + + + return dt; + + } + /// + /// 刀具柜-库存明细 + /// + private static DataTable GetToolDetail(DataTable dtData) + { + //刀具柜 - 库存明细.xls + + DataTable dt = new DataTable(); + dt.Columns.Add("刀具柜名称", typeof(System.String)); + dt.Columns.Add("行号", typeof(System.Int32)); + dt.Columns.Add("列号", typeof(System.Int32)); + dt.Columns.Add("物料名称", typeof(System.String)); + dt.Columns.Add("物料编号", typeof(System.String)); + dt.Columns.Add("物料型号", typeof(System.String)); + dt.Columns.Add("当前数量", typeof(System.Double)); + dt.Columns.Add("包装单位", typeof(System.String)); + dt.Columns.Add("单价", typeof(System.Double)); + dt.Columns.Add("金额", typeof(System.Double)); + dt.Columns.Add("最大存储", typeof(System.Int32)); + dt.Columns.Add("警告阀值", typeof(System.Int32)); + dt.Columns.Add("最后上架时间", typeof(System.DateTime)); + DataRow dr = dt.NewRow(); + for (int i = 0; i < dtData.Rows.Count; i++) + { + dr = dt.NewRow(); + dr["刀具柜名称"] = dtData.Rows[i]["刀具柜名称"].ToString(); + try + { + dr["行号"] = Convert.ToInt32(dtData.Rows[i]["行号"]); + } + catch + { + dr["行号"] = 0; + } + try + { + dr["列号"] = Convert.ToInt32(dtData.Rows[i]["列号"]); + } + catch + { + dr["列号"] = 0; + } + dr["物料名称"] = dtData.Rows[i]["物料名称"].ToString(); + dr["物料编号"] = dtData.Rows[i]["物料编号"].ToString(); + dr["物料型号"] = dtData.Rows[i]["物料型号"].ToString(); + try + { + dr["当前数量"] = Convert.ToDouble(dtData.Rows[i]["当前数量"]); + } + catch + { + dr["当前数量"] = 0; + } + dr["包装单位"] = dtData.Rows[i]["包装单位"].ToString(); + try + { + dr["单价"] = Convert.ToDouble(dtData.Rows[i]["单价"]); + } + catch + { + dr["单价"] = 0; + } + try + { + dr["金额"] = Convert.ToDouble(dtData.Rows[i]["金额"]); + } + catch + { + dr["金额"] = 0; + } + try + { + dr["最大存储"] = Convert.ToDouble(dtData.Rows[i]["最大存储"]); + } + catch + { + dr["最大存储"] = 0; + } + try + { + dr["警告阀值"] = Convert.ToDouble(dtData.Rows[i]["警告阀值"]); + } + catch + { + dr["警告阀值"] = 0; + } + try + { + dr["最后上架时间"] = Convert.ToDateTime(dtData.Rows[i]["最后上架时间"]); + } + catch + { + dr["警告阀值"] = DBNull.Value; + } + dt.Rows.Add(dr); + } + + + return dt; + + } + + static void SqlBulkCopyByDatatable(string connectionString, string TableName, DataTable dt) + { + using (SqlConnection conn = new SqlConnection(connectionString)) + { + using (SqlBulkCopy sqlbulkcopy = + new SqlBulkCopy(connectionString, SqlBulkCopyOptions.UseInternalTransaction)) + { + try + { + sqlbulkcopy.DestinationTableName = "[" + TableName + "]"; + dt.TableName = TableName; + for (int i = 0; i < dt.Columns.Count; i++) + { + sqlbulkcopy.ColumnMappings.Add(dt.Columns[i].ColumnName.Trim(), "[" + dt.Columns[i].ColumnName + "]"); + } + sqlbulkcopy.WriteToServer(dt); + } + catch (System.Exception ex) + { + //throw ex; + } + } + } + } + + + + } +} diff --git a/SlMesDbIterface/MessageHanlder/FTPHelper.cs b/SlMesDbIterface/MessageHanlder/FTPHelper.cs new file mode 100644 index 0000000..df8e7d0 --- /dev/null +++ b/SlMesDbIterface/MessageHanlder/FTPHelper.cs @@ -0,0 +1,332 @@ +using System; +using System.IO; +using System.Net; +using System.Collections.Generic; +using System.Windows.Forms; + +namespace TECSharpFunction +{ + /// + /// FTP操作 + /// + public class FTPHelper + { + #region FTPConfig + string ftpURI; + string ftpUserID; + string ftpServerIP; + string ftpPassword; + string ftpRemotePath; + #endregion + + /// + /// 连接FTP服务器 + /// + /// FTP连接地址 + /// 指定FTP连接成功后的当前目录, 如果不指定即默认为根目录 + /// 用户名 + /// 密码 + public FTPHelper(string FtpServerIP, string FtpRemotePath, string FtpUserID, string FtpPassword) + { + ftpServerIP = FtpServerIP; + ftpRemotePath = FtpRemotePath; + ftpUserID = FtpUserID; + ftpPassword = FtpPassword; + ftpURI = "ftp://" + ftpServerIP + "/" + ftpRemotePath + "/"; + } + + public bool CheckFtp() + { + try + { + FtpWebRequest ftprequest = (FtpWebRequest)FtpWebRequest.Create(new Uri(ftpURI)); + // ftp用户名和密码 + ftprequest.Credentials = new NetworkCredential(ftpUserID, ftpPassword); + ftprequest.Method = WebRequestMethods.Ftp.ListDirectory; + ftprequest.Timeout = 3000; + FtpWebResponse ftpResponse = (FtpWebResponse)ftprequest.GetResponse(); + + ftpResponse.Close(); + return true; + } + catch (Exception ex) + { + return false; + } + } + // 参数localfile为要上传的本地文件,ftpfile为上传到FTP的文件名称,ProgressBar为显示上传进度的滚动条,适用于WinForm。若应用于控制台程序,只要重写该函数,将参数ProgressBar去掉即可,同时将函数实现里所有涉及ProgressBar的地方都删掉。 + //———————————————— + //版权声明:本文为CSDN博主「只会搬运的小菜鸟」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。 + //原文链接:https://blog.csdn.net/u011465910/article/details/126563124 + public void Upload(string localfile, string ftpfile, System.Windows.Forms.ProgressBar pb) + { + FileInfo fileInf = new FileInfo(localfile); + FtpWebRequest reqFTP; + reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri(ftpURI + ftpfile)); + reqFTP.Credentials = new NetworkCredential(ftpUserID, ftpPassword); + reqFTP.Method = WebRequestMethods.Ftp.UploadFile; + reqFTP.KeepAlive = false; + reqFTP.UseBinary = true; + reqFTP.ContentLength = fileInf.Length; + if (pb != null) + { + pb.Maximum = Convert.ToInt32(reqFTP.ContentLength / 2048); + pb.Maximum = pb.Maximum + 1; + pb.Minimum = 0; + pb.Value = 0; + } + int buffLength = 2048; + byte[] buff = new byte[buffLength]; + int contentLen; + FileStream fs = fileInf.OpenRead(); + try + { + Stream strm = reqFTP.GetRequestStream(); + contentLen = fs.Read(buff, 0, buffLength); + while (contentLen != 0) + { + strm.Write(buff, 0, contentLen); + if (pb != null) + { + if (pb.Value != pb.Maximum) + pb.Value = pb.Value + 1; + } + contentLen = fs.Read(buff, 0, buffLength); + System.Windows.Forms.Application.DoEvents(); + } + if (pb != null) + pb.Value = pb.Maximum; + System.Windows.Forms.Application.DoEvents(); + strm.Close(); + fs.Close(); + } + catch (Exception ex) + { + throw new Exception(ex.Message); + } + } + //参数localfilename为将下载到本地的文件名称,ftpfilename为要下载的FTP上文件名称, + // ProcessBar为用于显示下载进度的进度条。该函数用于WinForm,若用于控制台,只要重写该函数,删除所有涉及ProcessBar的代码即可。 + public void Download(string localfilename, string ftpfileName, System.Windows.Forms.ProgressBar pb) + { + long fileSize = GetFileSize(ftpfileName); + if (fileSize > 0) + { + if (pb != null) + { + pb.Maximum = Convert.ToInt32(fileSize / 2048); + pb.Maximum = pb.Maximum + 1; + pb.Minimum = 0; + pb.Value = 0; + } + try + { + FileStream outputStream = new FileStream(localfilename, FileMode.Create); + FtpWebRequest reqFTP; + reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri(ftpURI + ftpfileName)); + reqFTP.Credentials = new NetworkCredential(ftpUserID, ftpPassword); + reqFTP.Method = WebRequestMethods.Ftp.DownloadFile; + reqFTP.UseBinary = true; + FtpWebResponse response = (FtpWebResponse)reqFTP.GetResponse(); + Stream ftpStream = response.GetResponseStream(); + int bufferSize = 2048; + + int readCount; + byte[] buffer = new byte[bufferSize]; + readCount = ftpStream.Read(buffer, 0, bufferSize); + while (readCount > 0) + { + outputStream.Write(buffer, 0, readCount); + if (pb != null) + { + if (pb.Value != pb.Maximum) + pb.Value = pb.Value + 1; + } + readCount = ftpStream.Read(buffer, 0, bufferSize); + System.Windows.Forms.Application.DoEvents(); + } + if (pb != null) + pb.Value = pb.Maximum; + System.Windows.Forms.Application.DoEvents(); + ftpStream.Close(); + outputStream.Close(); + response.Close(); + } + catch (Exception ex) + { + File.Delete(localfilename); + //throw new Exception(ex.Message); + } + } + } + + public void Delete(string fileName) + { + try + { + FtpWebRequest reqFTP; + reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri(ftpURI + fileName)); + reqFTP.Credentials = new NetworkCredential(ftpUserID, ftpPassword); + reqFTP.Method = WebRequestMethods.Ftp.DeleteFile; + reqFTP.KeepAlive = false; + string result = String.Empty; + FtpWebResponse response = (FtpWebResponse)reqFTP.GetResponse(); + long size = response.ContentLength; + Stream datastream = response.GetResponseStream(); + StreamReader sr = new StreamReader(datastream); + result = sr.ReadToEnd(); + sr.Close(); + datastream.Close(); + response.Close(); + } + catch (Exception ex) + { + throw new Exception(ex.Message); + } + } + //ListType=1代表获取文件列表,ListType=2代表获取文件夹列表,ListType=3代表获取文件和文件夹列表。 + //Detail=true时获文件或文件夹详细信息,Detail=false时只获取文件或文件夹名称。 + //Keyword是只需list名称包含Keyword的文件或文件夹,若要list所有文件或文件夹,则该参数为空。若ListType=3,则该参数无效。 + //———————————————— + //版权声明:本文为CSDN博主「只会搬运的小菜鸟」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。 + public List GetFileDirctoryList(int ListType, bool Detail, string Keyword) + { + List strs = new List(); + try + { + FtpWebRequest reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri(ftpURI)); + // ftp用户名和密码 + reqFTP.Credentials = new NetworkCredential(ftpUserID, ftpPassword); + if (Detail) + reqFTP.Method = WebRequestMethods.Ftp.ListDirectoryDetails; + else + reqFTP.Method = WebRequestMethods.Ftp.ListDirectory; + WebResponse response = reqFTP.GetResponse(); + + + StreamReader reader = new StreamReader(response.GetResponseStream(), System.Text.Encoding.Default);//中文文件名 + string line = reader.ReadLine(); + while (line != null) + { + if (ListType == 1) + { + if (line.Contains(".")) + { + if (Keyword.Trim() == "*.*" || Keyword.Trim() == "") + { + strs.Add(line); + } + else if (line.IndexOf(Keyword.Trim()) > -1) + { + strs.Add(line); + } + } + } + else if (ListType == 2) + { + if (!line.Contains(".")) + { + if (Keyword.Trim() == "*" || Keyword.Trim() == "") + { + strs.Add(line); + } + else if (line.IndexOf(Keyword.Trim()) > -1) + { + strs.Add(line); + } + } + } + else if (ListType == 3) + { + strs.Add(line); + } + line = reader.ReadLine(); + } + reader.Close(); + response.Close(); + return strs; + } + catch (Exception ex) + { + throw new Exception(ex.Message); + } + + + + + } + + public void MakeDir(string dirName) + { + FtpWebRequest reqFTP; + try + { + reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri(ftpURI + dirName)); + reqFTP.Method = WebRequestMethods.Ftp.MakeDirectory; + reqFTP.UseBinary = true; + reqFTP.Credentials = new NetworkCredential(ftpUserID, ftpPassword); + FtpWebResponse response = (FtpWebResponse)reqFTP.GetResponse(); + Stream ftpStream = response.GetResponseStream(); + ftpStream.Close(); + response.Close(); + } + catch (Exception ex) + { + throw new Exception(ex.Message); + } + } + + public long GetFileSize(string ftpfileName) + { + long fileSize = 0; + try + { + FtpWebRequest reqFTP; + reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri(ftpURI + ftpfileName)); + reqFTP.Credentials = new NetworkCredential(ftpUserID, ftpPassword); + reqFTP.Method = WebRequestMethods.Ftp.GetFileSize; + reqFTP.UseBinary = true; + FtpWebResponse response = (FtpWebResponse)reqFTP.GetResponse(); + Stream ftpStream = response.GetResponseStream(); + fileSize = response.ContentLength; + ftpStream.Close(); + response.Close(); + } + catch (Exception ex) + { + throw new Exception(ex.Message); + } + return fileSize; + } + + + + public void ReName(string currentFilename, string newFilename) + { + FtpWebRequest reqFTP; + try + { + reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri(ftpURI + currentFilename)); + reqFTP.Method = WebRequestMethods.Ftp.Rename; + reqFTP.RenameTo = newFilename; + reqFTP.UseBinary = true; + reqFTP.Credentials = new NetworkCredential(ftpUserID, ftpPassword); + FtpWebResponse response = (FtpWebResponse)reqFTP.GetResponse(); + Stream ftpStream = response.GetResponseStream(); + ftpStream.Close(); + response.Close(); + } + catch (Exception ex) + { + throw new Exception(ex.Message); + } + } + + public void MovieFile(string currentFilename, string newDirectory) + { + ReName(currentFilename, newDirectory); + } + + + } +} \ No newline at end of file diff --git a/SlMesDbIterface/MessageHanlder/GetVal.cs b/SlMesDbIterface/MessageHanlder/GetVal.cs new file mode 100644 index 0000000..6043381 --- /dev/null +++ b/SlMesDbIterface/MessageHanlder/GetVal.cs @@ -0,0 +1,69 @@ +using Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace RecData +{ + public class GetVal + { + + public static string JObject_Value(JObject jObj,string name) + { + var objVal = "NULL"; + if (jObj[name] != null) + { + objVal = jObj[name].ToString(); + } + return objVal; + } + public static string JObject_Value_Int(JObject jObj, string name) + { + var objVal = "-1"; + if (jObj[name] != null) + { + objVal = jObj[name].ToString(); + } + return objVal; + } + public static string JToken_Value(JToken jToken, string name) + { + var objVal = "NULL"; + var jTokenStr = jToken.ToString(); + if (!jTokenStr.Contains(name)) + { + return objVal; + } + + if (jToken[name] != null) + { + objVal = jToken[name].ToString(); + } + return objVal; + + } + public static string JToken_Value_Int(JToken jToken, string name) + { + var objVal = "-1"; + if (jToken[name] != null) + { + objVal = jToken[name].ToString(); + } + return objVal; + + } + public static JArray JObject_JArray(JObject jObj, string name) + { + var jArray = new JArray(); + if (jObj[name] != null) + { + jArray = (JArray)jObj[name]; + } + return jArray; + } + + + } +} diff --git a/SlMesDbIterface/MessageHanlder/HttpCli.cs b/SlMesDbIterface/MessageHanlder/HttpCli.cs new file mode 100644 index 0000000..cefdfd7 --- /dev/null +++ b/SlMesDbIterface/MessageHanlder/HttpCli.cs @@ -0,0 +1,349 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Net; +using System.Text; +using System.Threading.Tasks; + +namespace PLMTEST +{ + public class HttpCli + { + + + /// + /// 指定Url地址使用Get 方式获取全部字符串 + /// + /// 请求链接地址 + /// + public static string Get(string url) + { + string result = ""; + HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url); + HttpWebResponse resp = (HttpWebResponse)req.GetResponse(); + Stream stream = resp.GetResponseStream(); + try + { + //获取内容 + using (StreamReader reader = new StreamReader(stream)) + { + result = reader.ReadToEnd(); + } + } + finally + { + stream.Close(); + } + return result; + } + + public static void GetFile(string url,string path) + { + WebRequest request = WebRequest.Create(url); + WebResponse response = request.GetResponse(); + if (response.ContentType.ToLower().Length > 0) + { + using (Stream reader = response.GetResponseStream()) + { + using (FileStream writer = new FileStream(path, FileMode.OpenOrCreate, FileAccess.Write)) + { + byte[] buffer = new byte[1024]; + int c = 0; + while ((c = reader.Read(buffer, 0, buffer.Length)) > 0) + { + writer.Write(buffer, 0, c); + } + } + } + //HttpContext + } + } + + public static byte[] GetFile_Bytes(string url) + { + byte[] bytesAll = null; + WebRequest request = WebRequest.Create(url); + WebResponse response = request.GetResponse(); + if (response.ContentType.ToLower().Length > 0) + { + using (Stream reader = response.GetResponseStream()) + { + MemoryStream ms = new MemoryStream(); + byte[] buffer = new byte[1024]; + while (true) + { + int sz = reader.Read(buffer, 0, 1024); + if (sz == 0) break; + ms.Write(buffer, 0, sz); + } + bytesAll = ms.ToArray(); + } + } + + //如是图片 + //System.Drawing.Image img = System.Drawing.Image.FromStream(ms); + + return bytesAll; + + } + + + + + + + + public void FGHJ() + { + + // Create a 'WebRequest' object with the specified url. + WebRequest myWebRequest = WebRequest.Create("http://www.contoso.com"); + + // Send the 'WebRequest' and wait for response. + WebResponse myWebResponse = myWebRequest.GetResponse(); + + // Obtain a 'Stream' object associated with the response object. + Stream ReceiveStream = myWebResponse.GetResponseStream(); + + Encoding encode = System.Text.Encoding.GetEncoding("utf-8"); + + // Pipe the stream to a higher level stream reader with the required encoding format. + StreamReader readStream = new StreamReader(ReceiveStream, encode); + Console.WriteLine("\nResponse stream received"); + Char[] read = new Char[256]; + + // Read 256 charcters at a time. + int count = readStream.Read(read, 0, 256); + Console.WriteLine("HTML...\r\n"); + + while (count > 0) + { + // Dump the 256 characters on a string and display the string onto the console. + String str = new String(read, 0, count); + Console.Write(str); + count = readStream.Read(read, 0, 256); + } + + Console.WriteLine(""); + // Release the resources of stream object. + readStream.Close(); + + // Release the resources of response object. + myWebResponse.Close(); + + } + + /// + /// 发送Get请求 + /// + /// 地址 + /// 请求参数定义 + /// + public static string Get(string url, Dictionary dic) + { + string result = ""; + StringBuilder builder = new StringBuilder(); + builder.Append(url); + if (dic.Count > 0) + { + builder.Append("?"); + int i = 0; + foreach (var item in dic) + { + if (i > 0) + builder.Append("&"); + builder.AppendFormat("{0}={1}", item.Key, item.Value); + i++; + } + } + HttpWebRequest req = (HttpWebRequest)WebRequest.Create(builder.ToString()); + //添加参数 + HttpWebResponse resp = (HttpWebResponse)req.GetResponse(); + Stream stream = resp.GetResponseStream(); + try + { + //获取内容 + using (StreamReader reader = new StreamReader(stream)) + { + result = reader.ReadToEnd(); + } + } + finally + { + stream.Close(); + } + return result; + } + + + + /// + /// 指定Post地址使用Get 方式获取全部字符串 + /// + /// 请求后台地址 + /// + public static string Post(string url) + { + string result = ""; + HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url); + req.Method = "POST"; + HttpWebResponse resp = (HttpWebResponse)req.GetResponse(); + Stream stream = resp.GetResponseStream(); + //获取内容 + using (StreamReader reader = new StreamReader(stream, Encoding.UTF8)) + { + result = reader.ReadToEnd(); + } + return result; + } + + + + /// + /// 指定Post地址使用Get 方式获取全部字符串 + /// + /// 请求后台地址 + /// + public static string Post(string url, Dictionary dic) + { + string result = ""; + HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url); + req.Method = "POST"; + req.ContentType = "application/x-www-form-urlencoded"; + #region 添加Post 参数 + StringBuilder builder = new StringBuilder(); + int i = 0; + foreach (var item in dic) + { + if (i > 0) + builder.Append("&"); + builder.AppendFormat("{0}={1}", item.Key, item.Value); + i++; + } + byte[] data = Encoding.UTF8.GetBytes(builder.ToString()); + req.ContentLength = data.Length; + using (Stream reqStream = req.GetRequestStream()) + { + reqStream.Write(data, 0, data.Length); + reqStream.Close(); + } + #endregion + HttpWebResponse resp = (HttpWebResponse)req.GetResponse(); + Stream stream = resp.GetResponseStream(); + //获取响应内容 + using (StreamReader reader = new StreamReader(stream, Encoding.UTF8)) + { + result = reader.ReadToEnd(); + } + return result; + } + + + /// + /// 指定Post地址使用Get 方式获取全部字符串 + /// + /// 请求后台地址 + /// Post提交数据内容(utf-8编码的) + /// + public static string Post(string url, string content) + { + string result = ""; + HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url); + req.Method = "POST"; + req.ContentType = "application/json"; + + #region 添加Post 参数 + byte[] data = Encoding.UTF8.GetBytes(content); + req.ContentLength = data.Length; + using (Stream reqStream = req.GetRequestStream()) + { + reqStream.Write(data, 0, data.Length); + reqStream.Close(); + } + #endregion + + HttpWebResponse resp = (HttpWebResponse)req.GetResponse(); + Stream stream = resp.GetResponseStream(); + //获取响应内容 + using (StreamReader reader = new StreamReader(stream, Encoding.UTF8)) + { + result = reader.ReadToEnd(); + } + return result; + } + + + + + /// + /// Http下载文件 + /// + /// 下载地址 + /// 存放完整路径(含文件名) + /// 每次多的大小 + /// 下载操作是否成功 + + public static bool DownLoadFiles(string uri, string filefullpath, int size = 1000000) + { + try + { + if (File.Exists(filefullpath)) + { + try + { + File.Delete(filefullpath); + } + catch (Exception ex) + { + return false; + } + } + + string fileDirectory = System.IO.Path.GetDirectoryName(filefullpath); + + if (!Directory.Exists(fileDirectory)) + { + Directory.CreateDirectory(fileDirectory); + } + + FileStream fs = new FileStream(filefullpath, FileMode.Create); + + byte[] buffer = new byte[size]; + + HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(uri); + + request.Timeout = 100000; + + request.AddRange((int)fs.Length); + + Stream ns = request.GetResponse().GetResponseStream(); + + long contentLength = request.GetResponse().ContentLength; + + int length = ns.Read(buffer, 0, buffer.Length); + + while (length > 0) + { + fs.Write(buffer,0 , length); + buffer = new byte[size]; + length = ns.Read(buffer, 0, buffer.Length); + } + + fs.Close(); + + return true; + } + catch (Exception ex) + { + return false; + } + + } + + + + + + } +} diff --git a/SlMesDbIterface/MessageHanlder/IOrderController.cs b/SlMesDbIterface/MessageHanlder/IOrderController.cs new file mode 100644 index 0000000..1e012d0 --- /dev/null +++ b/SlMesDbIterface/MessageHanlder/IOrderController.cs @@ -0,0 +1,68 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Net.Http; +using System.Text; +using System.Web; +using System.Web.Http; +using System.Collections.Concurrent; +using Newtonsoft.Json.Linq; +using System.Threading; +using SlMesDbIterface; +using PLMTEST; +using System.Net; +using System.Net.Http.Headers; +using System.IO; +using ExternalDataSync; + + +/////http://127.0.0.1:9981/api/IOrder/InsertOrder + + + +/// +/// +/// +namespace WebApi +{ + /// + /// + /// + [RoutePrefix("api/IOrder")] + public class IOrderController : ApiController + { + readonly string headUrl = "Project/"; + + /// + /// 上传测试接收 + /// + /// + /// + [HttpPost] + public HttpResponseMessage test([FromBody] JObject jobj) + { + string JsonStr = jobj.ToString(); + + return new HttpResponseMessage + { + Content = new StringContent(AnalysisMsg.ProductionCalendarData(headUrl + System.Reflection.MethodBase.GetCurrentMethod().Name, jobj.ToString()), Encoding.GetEncoding("UTF-8"), "application/json") + }; + } + + /// + /// 生产建模基础数据 + /// + /// + /// + [HttpPost] + public HttpResponseMessage productCalendar([FromBody] JObject jobj) + { + return new HttpResponseMessage + { + Content = new StringContent(AnalysisMsg.ProductionCalendarData(headUrl + System.Reflection.MethodBase.GetCurrentMethod().Name, jobj.ToString()), Encoding.GetEncoding("UTF-8"), "application/json") + }; + } + } +} diff --git a/SlMesDbIterface/MessageHanlder/InitServer.cs b/SlMesDbIterface/MessageHanlder/InitServer.cs new file mode 100644 index 0000000..25a74d4 --- /dev/null +++ b/SlMesDbIterface/MessageHanlder/InitServer.cs @@ -0,0 +1,151 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Net; +using System.Net.Http; +using System.Net.Http.Formatting; +using System.Net.Http.Headers; +using System.Text; +using System.Web.Http; +using System.Web.Http.Cors; +using System.Web.Http.SelfHost; + +namespace WebApi +{ + /// + /// + /// + public class InitServer + { + /// + /// + /// + HttpSelfHostConfiguration config = null; + /// + /// + /// + HttpSelfHostServer server = null; + /// + /// + /// + /// + public InitServer(int port) + { + config = new HttpSelfHostConfiguration($"http://0.0.0.0:{port}"); + + config.EnableCors(new EnableCorsAttribute("*", "*", "*")); + + config.MapHttpAttributeRoutes(); + + //config.Routes.MapHttpRoute( + // name: "DefaultApi", + // routeTemplate: "api/{controller}/{id}", + // defaults: new { id = RouteParameter.Optional } + //); + + // 自定义路由匹配到action + config.Routes.MapHttpRoute( + name: "API Default", + routeTemplate: "api/{controller}/{action}/{id}", + defaults: new { id = RouteParameter.Optional } + ); + + server = new HttpSelfHostServer(config); + + server.OpenAsync().Wait(); + + } + /// + /// + /// + /// + public void Init(int port) + { + + + } + public void Close() + { + server.CloseAsync(); + } + /// + /// + /// + public class JsonContentNegotiator : IContentNegotiator + { + /// + /// + /// + private readonly JsonMediaTypeFormatter _jsonFormatter; + /// + /// + /// + /// + public JsonContentNegotiator(JsonMediaTypeFormatter formatter) + { + _jsonFormatter = formatter; + } + /// + /// + /// + /// + /// + /// + /// + public ContentNegotiationResult Negotiate(Type type, HttpRequestMessage request, IEnumerable formatters) + { + var result = new ContentNegotiationResult(_jsonFormatter, new MediaTypeHeaderValue("application/json")); + return result; + } + + public static string Postring1(string url, string token, Dictionary dic) + { + string results = ""; + //url = "http://172.16.22.15:8000/" + url; + + HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url); + req.Method = "POST"; + req.ContentType = "application/x-www-form-urlencoded"; + req.Headers.Add("Authorization", "Bearer " + token); + + StringBuilder builder = new StringBuilder(); + int i = 0; + foreach (var item in dic) + { + if (i > 0) + builder.Append("&"); + builder.AppendFormat("{0}={1}", item.Key, item.Value); + i++; + } + byte[] data = Encoding.UTF8.GetBytes(builder.ToString()); + req.ContentLength = data.Length; + try + { + using (Stream reqStream = req.GetRequestStream()) + { + reqStream.Write(data, 0, data.Length); + reqStream.Close(); + } + HttpWebResponse resp = (HttpWebResponse)req.GetResponse(); + Stream stream = resp.GetResponseStream(); + //获取响应内容 + using (StreamReader reader = new StreamReader(stream, Encoding.UTF8)) + { + results = reader.ReadToEnd(); + } + return results; + } + catch (Exception e) + { + Console.WriteLine(e.Message); + return e.Message; + throw; + } + + } + + + + } + } +} diff --git a/SlMesDbIterface/MessageHanlder/InterfaceUpLoad.cs b/SlMesDbIterface/MessageHanlder/InterfaceUpLoad.cs new file mode 100644 index 0000000..2384119 --- /dev/null +++ b/SlMesDbIterface/MessageHanlder/InterfaceUpLoad.cs @@ -0,0 +1,20 @@ +using Newtonsoft.Json; +using PLMTEST; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ExternalDataSync +{ + public class InterfaceUpLoad + { + public static msgResHeader RequestPost(string url, msg m_msg) + { + return JsonConvert.DeserializeObject(HttpCli.Post(url, JsonConvert.SerializeObject(m_msg))); + } + + + } +} diff --git a/SlMesDbIterface/MessageHanlder/OExcel.cs b/SlMesDbIterface/MessageHanlder/OExcel.cs new file mode 100644 index 0000000..2390387 --- /dev/null +++ b/SlMesDbIterface/MessageHanlder/OExcel.cs @@ -0,0 +1,517 @@ +using NPOI.HPSF; +using NPOI.HSSF.UserModel; +using NPOI.SS.UserModel; +using NPOI.XSSF.UserModel; +using System; +using System.Collections.Generic; +using System.Data; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace NPOITest +{ + + /// + /// Execl工具辅助类 + /// + public class ExeclHelper + { + + /// + /// 读取Execl数据到DataTable中 + /// + /// 指定Execl文件路径 + /// 设置第一行是否是列名 + /// 返回一个DataTable数据集 + public static DataTable ExcelToDataTable(string filePath, string sheetName, bool isColumnName) + { + DataTable dataTable = null; + FileStream fs = null; + DataColumn column = null; + DataRow dataRow = null; + IWorkbook workbook = null; + ISheet sheet = null; + IRow row = null; + ICell cell = null; + int startRow = 0; + try + { + using (fs = new FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) + { + // 2007版本 + if (filePath.IndexOf(".xlsx") > 0) + workbook = new XSSFWorkbook(fs); + // 2003版本 + else if (filePath.IndexOf(".xls") > 0) + workbook = new HSSFWorkbook(fs); + if (workbook != null) + { + sheet = workbook.GetSheet(sheetName);//读取第一个sheet,当然也可以循环读取每个sheet + dataTable = new DataTable(); + if (sheet != null) + { + int rowCount = sheet.LastRowNum;//总行数 + if (rowCount > 0) + { + IRow firstRow = sheet.GetRow(0);//第一行 + int cellCount = firstRow.LastCellNum;//列数 + + //构建datatable的列 + if (isColumnName) + { + startRow = 1;//如果第一行是列名,则从第二行开始读取 + for (int i = firstRow.FirstCellNum; i < cellCount; ++i) + { + cell = firstRow.GetCell(i); + if (cell != null) + { + if (cell.StringCellValue != null) + { + column = new DataColumn(cell.StringCellValue); + dataTable.Columns.Add(column); + } + } + } + } + else + { + for (int i = firstRow.FirstCellNum; i < cellCount; ++i) + { + column = new DataColumn("column" + (i + 1)); + dataTable.Columns.Add(column); + } + } + + //填充行 + for (int i = startRow; i <= rowCount; ++i) + { + row = sheet.GetRow(i); + if (row == null) continue; + + dataRow = dataTable.NewRow(); + for (int j = row.FirstCellNum; j < cellCount; ++j) + { + cell = row.GetCell(j); + if (cell == null) + { + dataRow[j] = ""; + } + else + { + //CellType(Unknown = -1,Numeric = 0,String = 1,Formula = 2,Blank = 3,Boolean = 4,Error = 5,) + switch (cell.CellType) + { + case CellType.Blank: + dataRow[j] = ""; + break; + case CellType.Numeric: + short format = cell.CellStyle.DataFormat; + //对时间格式(2015.12.5、2015/12/5、2015-12-5等)的处理 + if (format == 14 || format == 31 || format == 57 || format == 58) + dataRow[j] = cell.DateCellValue; + else + dataRow[j] = cell.NumericCellValue; + break; + case CellType.String: + dataRow[j] = cell.StringCellValue; + break; + } + } + } + dataTable.Rows.Add(dataRow); + } + } + } + } + } + return dataTable; + } + catch (Exception err) + { + if (fs != null) + { + fs.Close(); + } + return null; + } + } + + public static DataTable ExcelToDataTable(string filePath,int sheetIndex, bool isColumnName) + { + DataTable dataTable = null; + FileStream fs = null; + DataColumn column = null; + DataRow dataRow = null; + IWorkbook workbook = null; + ISheet sheet = null; + IRow row = null; + ICell cell = null; + int startRow = 0; + try + { + using (fs = new FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) + { + // 2007版本 + if (filePath.IndexOf(".xlsx") > 0) + workbook = new XSSFWorkbook(fs); + // 2003版本 + else if (filePath.IndexOf(".xls") > 0) + workbook = new HSSFWorkbook(fs); + if (workbook != null) + { + sheet = workbook.GetSheetAt(sheetIndex);//读取第一个sheet,当然也可以循环读取每个sheet + dataTable = new DataTable(); + if (sheet != null) + { + int rowCount = sheet.LastRowNum;//总行数 + if (rowCount > 0) + { + IRow firstRow = sheet.GetRow(0);//第一行 + int cellCount = firstRow.LastCellNum;//列数 + + //构建datatable的列 + if (isColumnName) + { + startRow = 1;//如果第一行是列名,则从第二行开始读取 + for (int i = firstRow.FirstCellNum; i < cellCount; ++i) + { + cell = firstRow.GetCell(i); + if (cell != null) + { + if (cell.StringCellValue != null) + { + column = new DataColumn(cell.StringCellValue); + dataTable.Columns.Add(column); + } + } + } + } + else + { + for (int i = firstRow.FirstCellNum; i < cellCount; ++i) + { + column = new DataColumn("column" + (i + 1)); + dataTable.Columns.Add(column); + } + } + + //填充行 + for (int i = startRow; i <= rowCount; ++i) + { + row = sheet.GetRow(i); + if (row == null) continue; + + dataRow = dataTable.NewRow(); + for (int j = row.FirstCellNum; j < cellCount; ++j) + { + cell = row.GetCell(j); + if (cell == null) + { + dataRow[j] = ""; + } + else + { + //CellType(Unknown = -1,Numeric = 0,String = 1,Formula = 2,Blank = 3,Boolean = 4,Error = 5,) + switch (cell.CellType) + { + case CellType.Blank: + dataRow[j] = ""; + break; + case CellType.Numeric: + short format = cell.CellStyle.DataFormat; + //对时间格式(2015.12.5、2015/12/5、2015-12-5等)的处理 + if (format == 14 || format == 31 || format == 57 || format == 58 || format == 22) + dataRow[j] = cell.DateCellValue; + else + dataRow[j] = cell.NumericCellValue; + break; + case CellType.String: + dataRow[j] = cell.StringCellValue; + break; + } + } + } + dataTable.Rows.Add(dataRow); + } + } + } + } + } + return dataTable; + } + catch (Exception) + { + if (fs != null) + { + fs.Close(); + } + return null; + } + } + + /// + /// 将DataTable导出到Execl文档 + /// + /// 传入一个DataTable数据集 + /// 返回一个Bool类型的值,表示是否导出成功 + /// True表示导出成功,Flase表示导出失败 + public static bool DataTableToExcel(DataTable dt, string sheetName, string Outpath) + { + bool result = false; + IWorkbook workbook = null; + FileStream fs = null; + IRow row = null; + ISheet sheet = null; + ICell cell = null; + try + { + if (dt != null && dt.Rows.Count > 0) + { + workbook = new HSSFWorkbook(); + sheet = workbook.CreateSheet(sheetName);//创建一个名称为Sheet0的表 + int rowCount = dt.Rows.Count;//行数 + int columnCount = dt.Columns.Count;//列数 + + //设置列头 + row = sheet.CreateRow(0);//excel第一行设为列头 + for (int c = 0; c < columnCount; c++) + { + cell = row.CreateCell(c); + cell.SetCellValue(dt.Columns[c].ColumnName); + } + + //设置每行每列的单元格, + for (int i = 0; i < rowCount; i++) + { + row = sheet.CreateRow(i + 1); + for (int j = 0; j < columnCount; j++) + { + cell = row.CreateCell(j);//excel第二行开始写入数据 + cell.SetCellValue(dt.Rows[i][j].ToString()); + } + } + //向outPath输出数据 + using (fs = File.OpenWrite(Outpath)) + { + workbook.Write(fs);//向打开的这个xls文件中写入数据 + result = true; + } + } + return result; + } + catch (Exception ex) + { + if (fs != null) + { + fs.Close(); + } + return false; + } + } + + + /// + /// 读取Execl数据到DataTable(DataSet)中 + /// + /// 指定Execl文件路径 + /// 设置第一行是否是列名 + /// 返回一个DataTable数据集 + public static DataSet ExcelToDataSet(string filePath, bool isFirstLineColumnName) + { + DataSet dataSet = new DataSet(); + int startRow = 0; + try + { + using (FileStream fs = new FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) + { + IWorkbook workbook = null; + // 如果是2007+的Excel版本 + if (filePath.IndexOf(".xlsx") > 0) + { + workbook = new XSSFWorkbook(fs); + } + // 如果是2003-的Excel版本 + else if (filePath.IndexOf(".xls") > 0) + { + workbook = new HSSFWorkbook(fs); + } + if (workbook != null) + { + //循环读取Excel的每个sheet,每个sheet页都转换为一个DataTable,并放在DataSet中 + for (int p = 0; p < workbook.NumberOfSheets; p++) + { + ISheet sheet = workbook.GetSheetAt(p); + DataTable dataTable = new DataTable(); + dataTable.TableName = sheet.SheetName; + if (sheet != null) + { + int rowCount = sheet.LastRowNum;//获取总行数 + if (rowCount > 0) + { + IRow firstRow = sheet.GetRow(0);//获取第一行 + int cellCount = firstRow.LastCellNum;//获取总列数 + + //构建datatable的列 + if (isFirstLineColumnName) + { + startRow = 1;//如果第一行是列名,则从第二行开始读取 + for (int i = firstRow.FirstCellNum; i < cellCount; ++i) + { + ICell cell = firstRow.GetCell(i); + if (cell != null) + { + if (cell.StringCellValue != null) + { + DataColumn column = new DataColumn(cell.StringCellValue); + dataTable.Columns.Add(column); + } + } + } + } + else + { + for (int i = firstRow.FirstCellNum; i < cellCount; ++i) + { + DataColumn column = new DataColumn("column" + (i + 1)); + dataTable.Columns.Add(column); + } + } + + //填充行 + for (int i = startRow; i <= rowCount; ++i) + { + IRow row = sheet.GetRow(i); + if (row == null) continue; + + DataRow dataRow = dataTable.NewRow(); + for (int j = row.FirstCellNum; j < cellCount; ++j) + { + ICell cell = row.GetCell(j); + if (cell == null) + { + dataRow[j] = ""; + } + else + { + //CellType(Unknown = -1,Numeric = 0,String = 1,Formula = 2,Blank = 3,Boolean = 4,Error = 5,) + switch (cell.CellType) + { + case CellType.Blank: + dataRow[j] = ""; + break; + case CellType.Numeric: + short format = cell.CellStyle.DataFormat; + //对时间格式(2015.12.5、2015/12/5、2015-12-5等)的处理 + if (format == 14 || format == 31 || format == 57 || format == 58) + dataRow[j] = cell.DateCellValue; + else + dataRow[j] = cell.NumericCellValue; + break; + case CellType.String: + dataRow[j] = cell.StringCellValue; + break; + } + } + } + dataTable.Rows.Add(dataRow); + } + } + } + dataSet.Tables.Add(dataTable); + } + + } + } + return dataSet; + } + catch (Exception err) + { + return null; + } + } + + + /// + /// 将DataTable(DataSet)导出到Execl文档 + /// + /// 传入一个DataSet + /// 导出路径(可以不加扩展名,不加默认为.xls) + /// 返回一个Bool类型的值,表示是否导出成功 + /// True表示导出成功,Flase表示导出失败 + public static bool DataSetToExcel(DataSet dataSet, string Outpath) + { + bool result = false; + try + { + if (dataSet == null || dataSet.Tables == null || dataSet.Tables.Count == 0 || string.IsNullOrEmpty(Outpath)) + throw new Exception("输入的DataSet或路径异常"); + int sheetIndex = 0; + //根据输出路径的扩展名判断workbook的实例类型 + IWorkbook workbook = null; + string pathExtensionName = Outpath.Trim().Substring(Outpath.Length - 5); + if (pathExtensionName.Contains(".xlsx")) + { + workbook = new XSSFWorkbook(); + } + else if (pathExtensionName.Contains(".xls")) + { + workbook = new HSSFWorkbook(); + } + else + { + Outpath = Outpath.Trim() + ".xls"; + workbook = new HSSFWorkbook(); + } + //将DataSet导出为Excel + foreach (DataTable dt in dataSet.Tables) + { + sheetIndex++; + if (dt != null && dt.Rows.Count > 0) + { + ISheet sheet = workbook.CreateSheet(string.IsNullOrEmpty(dt.TableName) ? ("sheet" + sheetIndex) : dt.TableName);//创建一个名称为Sheet0的表 + int rowCount = dt.Rows.Count;//行数 + int columnCount = dt.Columns.Count;//列数 + + //设置列头 + IRow row = sheet.CreateRow(0);//excel第一行设为列头 + for (int c = 0; c < columnCount; c++) + { + ICell cell = row.CreateCell(c); + cell.SetCellValue(dt.Columns[c].ColumnName); + } + + //设置每行每列的单元格, + for (int i = 0; i < rowCount; i++) + { + row = sheet.CreateRow(i + 1); + for (int j = 0; j < columnCount; j++) + { + ICell cell = row.CreateCell(j);//excel第二行开始写入数据 + cell.SetCellValue(dt.Rows[i][j].ToString()); + } + } + } + } + //向outPath输出数据 + using (FileStream fs = File.OpenWrite(Outpath)) + { + workbook.Write(fs);//向打开的这个xls文件中写入数据 + result = true; + } + return result; + } + catch (Exception ex) + { + return false; + } + } + + + } + + +} + + diff --git a/SlMesDbIterface/MessageHanlder/Re.cs b/SlMesDbIterface/MessageHanlder/Re.cs new file mode 100644 index 0000000..001c77e --- /dev/null +++ b/SlMesDbIterface/MessageHanlder/Re.cs @@ -0,0 +1,173 @@ +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using RecData; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace PLMTEST +{ + public class Re + { + + + public static DataTable Analysis_DataObject(string jsonStr) + { + /* +{ +"list": [ +{ + "errcode": 0, + "errmsg": null, + "objId": "01_18AC913FCA4A4DA99BDF01A99C232219", + "objNo": "0100045006", + "fname": null, + "suffix": null, + "hasAffine": null, + "name": "油泵轴油封", + "fsize": null, + "fsizeStr": "未知", + "type": "D", + "tablename": "MPART", + "smemo": null, + "ctimestr": "2017-07-11 16:03", + "mtimestr": "2020-12-21 15:36", + "creator": "5914洪杰", + "modifier": "11458戚亚克", + "ver": "1", + "stimestr": null, + "etimestr": null, + "extra": null,//这里加了俩字段:PTYPE(小类)、DTYPE(大类) + "searchText": null +} +], +"errcode": 0, +"errmsg": null, +"total": 1 +} + */ + + DataTable dt = new DataTable(); + dt.Columns.Add("errcode"); + dt.Columns.Add("errmsg"); + dt.Columns.Add("objId"); + dt.Columns.Add("objNo"); + dt.Columns.Add("fname"); + dt.Columns.Add("suffix"); + dt.Columns.Add("hasAffine"); + dt.Columns.Add("name"); + dt.Columns.Add("fsize"); + dt.Columns.Add("fsizeStr"); + dt.Columns.Add("type"); + dt.Columns.Add("tablename"); + dt.Columns.Add("smemo"); + dt.Columns.Add("ctimestr"); + dt.Columns.Add("mtimestr"); + dt.Columns.Add("creator"); + dt.Columns.Add("modifier"); + dt.Columns.Add("ver"); + dt.Columns.Add("stimestr"); + dt.Columns.Add("etimestr"); + dt.Columns.Add("extra"); + dt.Columns.Add("PTYPE"); + dt.Columns.Add("DTYPE"); + dt.Columns.Add("searchText"); + + + + var json = JsonConvert.DeserializeObject(jsonStr); + var errcode = json["errcode"].ToString(); + var errmsg = json["errmsg"].ToString(); + // var total = json["total"].ToString(); + if (errcode != "0") + { + dt = new DataTable(); + dt.Columns.Add("errcode"); + dt.Columns.Add("errmsg"); + // dt.Columns.Add("total"); + var dr = dt.NewRow(); + dr["errcode"] = errcode; + dr["errmsg"] = errmsg; + //dr["total"] = total; + dt.Rows.Add(dr); + return dt; + } + var array = json["list"]; + foreach (var a in array) + { + var _errcode = a["errcode"].ToString(); + var _errmsg = a["errmsg"].ToString(); + var objId = a["objId"].ToString(); + var objNo = a["objNo"].ToString(); + var fname = a["fname"].ToString(); + var suffix = a["suffix"].ToString(); + var hasAffine = a["hasAffine"].ToString(); + var name = a["name"].ToString(); + var fsize = a["fsize"].ToString(); + var fsizeStr = a["fsizeStr"].ToString(); + var type = a["type"].ToString(); + var tablename = a["tablename"].ToString(); + var smemo = a["smemo"].ToString(); + var ctimestr = a["ctimestr"].ToString(); + var mtimestr = a["mtimestr"].ToString(); + var creator = a["creator"].ToString(); + var modifier = a["modifier"].ToString(); + var ver = a["ver"].ToString(); + var stimestr = a["stimestr"].ToString(); + var etimestr = a["etimestr"].ToString(); + var extra_O = a["extra"]; + var extra = "-1"; + if (a["extra"] != null) + { + extra = a["extra"].ToString(); + } + var PTYPE = GetVal.JToken_Value(extra_O, "PTYPE"); + var DTYPE = GetVal.JToken_Value(extra_O, "DTYPE"); + + var searchText = a["searchText"].ToString(); + + var dr = dt.NewRow(); + dr["errcode"] = _errcode; + dr["errmsg"] = _errmsg; + dr["objId"] = objId; + dr["objNo"] = objNo; + dr["fname"] = fname; + dr["suffix"] = suffix; + dr["hasAffine"] = hasAffine; + dr["name"] = name; + dr["fsize"] = fsize; + dr["fsizeStr"] = fsizeStr; + dr["type"] = type; + dr["tablename"] = tablename; + dr["smemo"] = smemo; + + dr["ctimestr"] = ctimestr; + dr["mtimestr"] = mtimestr; + dr["creator"] = creator; + dr["modifier"] = modifier; + dr["ver"] = ver; + + dr["stimestr"] = stimestr; + dr["etimestr"] = etimestr; + dr["extra"] = extra; + dr["PTYPE"] = PTYPE; + dr["DTYPE"] = DTYPE; + dr["searchText"] = searchText; + + dt.Rows.Add(dr); + } + + return dt; + } + + + + + + + + } +} diff --git a/SlMesDbIterface/MessageHanlder/WCController.cs b/SlMesDbIterface/MessageHanlder/WCController.cs new file mode 100644 index 0000000..46bd4c7 --- /dev/null +++ b/SlMesDbIterface/MessageHanlder/WCController.cs @@ -0,0 +1,131 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Net.Http; +using System.Text; +using System.Web; +using System.Web.Http; +using System.Collections.Concurrent; +using Newtonsoft.Json.Linq; +using System.Threading; + +namespace WebApi +{ + + [RoutePrefix("api/WC")] //定义路由前缀 + public class WCController : ApiController + { + + /// + /// 插入数据库 + /// + /// + [HttpGet] + public HttpResponseMessage ReportUp() + { + string pp = @"{\""Result\"":\""OK\""}"; + try + { + // pp = jObject.ToString(); + } + catch (Exception err) + { + } + return new HttpResponseMessage { Content = new StringContent(pp, Encoding.GetEncoding("UTF-8"), "application/json") }; + } + /// + /// + /// + /// + [HttpGet] + public HttpResponseMessage ReportUpCancel() + { + string pp = @"{\""Result\"":\""别试了,就不好用,试了也不好用\""}"; + try + { + // pp = jObject.ToString(); + } + catch (Exception err) + { + } + return new HttpResponseMessage { Content = new StringContent(pp, Encoding.GetEncoding("UTF-8"), "application/json") }; + } + + + + + [HttpPost] + public HttpResponseMessage SelectPage([FromBody]JObject jobj) + { + string pp = ""; + + try + { + var OpName = jobj["OpName"].ToString(); + var StartTime = jobj["StartTime"].ToString(); + var EndTime = jobj["EndTime"].ToString(); + var PageCurrent = jobj["PageCurrent"].ToString(); + var PageSize = jobj["PageSize"].ToString(); + + + string sql = "SELECT * FROM z_save_tag " + + "WHERE(OperationTime BETWEEN '" + StartTime + "' AND '" + EndTime + "') AND OpName like '" + OpName + "%' " + + "ORDER BY OperationTime;\n"; + // var res = GlobalVar.dbClient.ExecQuery(sql); + + // var zSavePersonList = Z_Save_Position.DataTableToClass(res); + + // var newZSaveList = DatabaseClient.DBClient.SplitePage(zSavePersonList, Convert.ToInt32(PageSize), Convert.ToInt32(PageCurrent)); + //var tableData = (JArray)JsonConvert.DeserializeObject(JsonConvert.SerializeObject(newZSaveList)); + //JObject resjobj = new JObject() { + // new JProperty("ItemCount", zSavePersonList.Count.ToString()), + // new JProperty("TableData",tableData) + //}; + + //pp = resjobj.ToString() + // //.Replace("\r\n","") + // ; + + } + catch (Exception err) + { + //GlobalVar.log.Error(err.Message); + // Console.WriteLine(err.Message); + } + HttpResponseMessage result = new HttpResponseMessage { Content = new StringContent(pp, Encoding.GetEncoding("UTF-8"), "application/json") }; + return result; + } + + [HttpPost] + public HttpResponseMessage Select([FromBody] JObject jobj) + { + string pp = ""; + try + { + string OpName = jobj["OpName"].ToString(); + string StartTime = jobj["StartTime"].ToString(); + string EndTime = jobj["EndTime"].ToString(); + + string sql = "SELECT * FROM z_save_tag " + + "WHERE(OperationTime BETWEEN '"+StartTime+"' AND '"+EndTime+"') AND OpName like '"+OpName+"%' " + + "ORDER BY OperationTime;\n"; + // var res = GlobalVar.dbClient.ExecQuery(sql); + + //var zSavePersonList = Z_Save_Position.DataTableToClass(res); + + //var zSavePersonListStr = JsonConvert.SerializeObject(zSavePersonList); + + //pp = zSavePersonListStr.ToString(); + } + catch (Exception err) + { + // GlobalVar.log.Error(err.Message); + // Console.WriteLine(err.Message); + } + HttpResponseMessage result = new HttpResponseMessage { Content = new StringContent(pp, Encoding.GetEncoding("UTF-8"), "application/json") }; + return result; + } + } +} diff --git a/SlMesDbIterface/MessageHanlder/ZSavePositionController.cs b/SlMesDbIterface/MessageHanlder/ZSavePositionController.cs new file mode 100644 index 0000000..57bacb0 --- /dev/null +++ b/SlMesDbIterface/MessageHanlder/ZSavePositionController.cs @@ -0,0 +1,119 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Net.Http; +using System.Text; +using System.Web; +using System.Web.Http; +using System.Collections.Concurrent; +using Newtonsoft.Json.Linq; + + +namespace WebApi +{ + + [RoutePrefix("api/ZSavePosition")] //定义路由前缀 + public class ZSavePositionController : ApiController + { + /// + /// 插入数据库 + /// + /// + /// + [HttpPost] + public void Insert(JObject jObject) + { + string pp = ""; + try + { + var z_Save_Position = JsonConvert.DeserializeObject(JsonConvert.SerializeObject(jObject)); + + //z_Save_Position.OpName = "a1"; + //z_Save_Position.Value = "asd"; + //z_Save_Position.OperationTime = "2022/06/29 16:40:43"; + //z_Save_Position.ProjectCode = "123"; + + string sql = "INSERT INTO z_save_position(OpName, Value, OperationTime, ProjectCode) VALUES('" + z_Save_Position.OpName + "', '" + z_Save_Position.Value + "', '" + z_Save_Position.OperationTime + "', '" + z_Save_Position.ProjectCode + "');\n"; + // var res = GlobalVar.dbClient.ExecNonQuery(sql); + + // pp = res.ToString(); + + } + catch (Exception err) + { + // GlobalVar.log.Error(err.Message); + // Console.WriteLine(err.Message); + } + } + + [HttpPost] + public HttpResponseMessage SelectPage([FromBody] JObject jobj) + { + string pp = ""; + try + { + var OpName = jobj["OpName"].ToString(); + var StartTime = jobj["StartTime"].ToString(); + var EndTime = jobj["EndTime"].ToString(); + var PageCurrent = jobj["PageCurrent"].ToString(); + var PageSize = jobj["PageSize"].ToString(); + + string sql = "SELECT * FROM z_save_position " + + "WHERE(OperationTime BETWEEN '" + StartTime + "' AND '" + EndTime + "') AND OpName like '" + OpName + "%' " + + "ORDER BY OperationTime;\n"; + // var res = GlobalVar.dbClient.ExecQuery(sql); + + //var zSavePersonList = Z_Save_Position.DataTableToClass(res); + + // var newZSaveList = DatabaseClient.DBClient.SplitePage(zSavePersonList, Convert.ToInt32(PageSize), Convert.ToInt32(PageCurrent)); + // var tableData = (JArray)JsonConvert.DeserializeObject(JsonConvert.SerializeObject(newZSaveList)); + //JObject resjobj = new JObject() { + // new JProperty("ItemCount", zSavePersonList.Count.ToString()), + // new JProperty("TableData",tableData) + //}; + + // pp = resjobj.ToString(); + + } + catch (Exception err) + { + // GlobalVar.log.Error(err.Message); + // Console.WriteLine(err.Message); + } + HttpResponseMessage result = new HttpResponseMessage { Content = new StringContent(pp, Encoding.GetEncoding("UTF-8"), "application/json") }; + return result; + } + + [HttpPost] + public HttpResponseMessage Select([FromBody] JObject jobj) + { + string pp = ""; + try + { + var OpName = jobj["OpName"].ToString(); + var StartTime = jobj["StartTime"].ToString(); + var EndTime = jobj["EndTime"].ToString(); + + string sql = "SELECT * FROM z_save_position " + + "WHERE(OperationTime BETWEEN '"+StartTime+"' AND '"+EndTime+"') AND OpName like '"+OpName+"%' " + + "ORDER BY OperationTime;\n"; + //var res = GlobalVar.dbClient.ExecQuery(sql); + + // var zSavePersonList = Z_Save_Position.DataTableToClass(res); + + // var zSavePersonListStr = JsonConvert.SerializeObject(zSavePersonList); + + // pp = zSavePersonListStr.ToString(); + } + catch (Exception err) + { + //GlobalVar.log.Error(err.Message); + // Console.WriteLine (err.Message); + } + HttpResponseMessage result = new HttpResponseMessage { Content = new StringContent(pp, Encoding.GetEncoding("UTF-8"), "application/json") }; + return result; + } + } +} diff --git a/SlMesDbIterface/MessageHanlder/ZSaveTagController.cs b/SlMesDbIterface/MessageHanlder/ZSaveTagController.cs new file mode 100644 index 0000000..bfe6653 --- /dev/null +++ b/SlMesDbIterface/MessageHanlder/ZSaveTagController.cs @@ -0,0 +1,122 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Net.Http; +using System.Text; +using System.Web; +using System.Web.Http; +using System.Collections.Concurrent; +using Newtonsoft.Json.Linq; + + +namespace WebApi +{ + + [RoutePrefix("api/ZSaveTag")] //定义路由前缀 + public class ZSaveTagController : ApiController + { + + /// + /// 插入数据库 + /// + /// + /// + [HttpPost] + public void Insert(JObject jObject) + { + string pp = ""; + try + { + var z_Save_Tag = JsonConvert.DeserializeObject(JsonConvert.SerializeObject(jObject)); + + string sql = "" + + "INSERT INTO z_save_tag (OpName, TagID, Value, KeepTime, OperationTime, ProjectCode) " + + " VALUES('"+ z_Save_Tag.OpName+ "', '"+ z_Save_Tag.TagID+ "', '"+ z_Save_Tag.Value+ "', '"+ z_Save_Tag .KeepTime+ "', '"+ z_Save_Tag .OperationTime+ "', '"+ z_Save_Tag .ProjectCode+ "'); \n"; + //var res = GlobalVar.dbClient.ExecNonQuery(sql); + + // pp = res.ToString(); + + } + catch (Exception err) + { + //GlobalVar.log.Error(err.Message); + } + // HttpResponseMessage result = new HttpResponseMessage { Content = new StringContent(pp, Encoding.GetEncoding("UTF-8"), "application/json") }; + // return result; + } + + [HttpPost] + public HttpResponseMessage SelectPage([FromBody]JObject jobj) + { + string pp = ""; + + try + { + var OpName = jobj["OpName"].ToString(); + var StartTime = jobj["StartTime"].ToString(); + var EndTime = jobj["EndTime"].ToString(); + var PageCurrent = jobj["PageCurrent"].ToString(); + var PageSize = jobj["PageSize"].ToString(); + + + string sql = "SELECT * FROM z_save_tag " + + "WHERE(OperationTime BETWEEN '" + StartTime + "' AND '" + EndTime + "') AND OpName like '" + OpName + "%' " + + "ORDER BY OperationTime;\n"; + // var res = GlobalVar.dbClient.ExecQuery(sql); + + // var zSavePersonList = Z_Save_Position.DataTableToClass(res); + + // var newZSaveList = DatabaseClient.DBClient.SplitePage(zSavePersonList, Convert.ToInt32(PageSize), Convert.ToInt32(PageCurrent)); + //var tableData = (JArray)JsonConvert.DeserializeObject(JsonConvert.SerializeObject(newZSaveList)); + //JObject resjobj = new JObject() { + // new JProperty("ItemCount", zSavePersonList.Count.ToString()), + // new JProperty("TableData",tableData) + //}; + + //pp = resjobj.ToString() + // //.Replace("\r\n","") + // ; + + } + catch (Exception err) + { + //GlobalVar.log.Error(err.Message); + // Console.WriteLine(err.Message); + } + HttpResponseMessage result = new HttpResponseMessage { Content = new StringContent(pp, Encoding.GetEncoding("UTF-8"), "application/json") }; + return result; + } + + [HttpPost] + public HttpResponseMessage Select([FromBody] JObject jobj) + { + string pp = ""; + try + { + string OpName = jobj["OpName"].ToString(); + string StartTime = jobj["StartTime"].ToString(); + string EndTime = jobj["EndTime"].ToString(); + + string sql = "SELECT * FROM z_save_tag " + + "WHERE(OperationTime BETWEEN '"+StartTime+"' AND '"+EndTime+"') AND OpName like '"+OpName+"%' " + + "ORDER BY OperationTime;\n"; + // var res = GlobalVar.dbClient.ExecQuery(sql); + + //var zSavePersonList = Z_Save_Position.DataTableToClass(res); + + //var zSavePersonListStr = JsonConvert.SerializeObject(zSavePersonList); + + //pp = zSavePersonListStr.ToString(); + } + catch (Exception err) + { + // GlobalVar.log.Error(err.Message); + // Console.WriteLine(err.Message); + } + HttpResponseMessage result = new HttpResponseMessage { Content = new StringContent(pp, Encoding.GetEncoding("UTF-8"), "application/json") }; + return result; + } + } +} diff --git a/SlMesDbIterface/MessageHanlder/Z_Save_Position.cs b/SlMesDbIterface/MessageHanlder/Z_Save_Position.cs new file mode 100644 index 0000000..f22f343 --- /dev/null +++ b/SlMesDbIterface/MessageHanlder/Z_Save_Position.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using System.Data; + +namespace WebApi +{ + class Z_Save_Position + { + public int ID; + public string OpName; + public string Value; + public string OperationTime; + public string ProjectCode; + + public Z_Save_Position() { } + + public static List DataTableToClass(DataTable dt_Z_Save_Position) + { + List z_Save_PositionList = new List(); + Z_Save_Position z_Save_Position; + for (int i = 0; i < dt_Z_Save_Position.Rows.Count; i++) + { + z_Save_Position = new Z_Save_Position(); + var row = dt_Z_Save_Position.Rows[i]; + z_Save_Position.ID = Convert.ToInt32(row["ID"]); + z_Save_Position.OpName = row["OpName"].ToString(); + z_Save_Position.Value = row["Value"].ToString(); + z_Save_Position.OperationTime = row["OperationTime"].ToString(); + z_Save_Position.ProjectCode = row["ProjectCode"].ToString(); + z_Save_PositionList.Add(z_Save_Position); + } + + return z_Save_PositionList; + } + } +} diff --git a/SlMesDbIterface/MessageHanlder/Z_Save_Tag.cs b/SlMesDbIterface/MessageHanlder/Z_Save_Tag.cs new file mode 100644 index 0000000..4626848 --- /dev/null +++ b/SlMesDbIterface/MessageHanlder/Z_Save_Tag.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WebApi +{ + class Z_Save_Tag + { + public int ID; + public string OpName; + public string TagID; + public string Value; + public string KeepTime; + public string OperationTime; + public string ProjectCode; + public Z_Save_Tag() + { + + } + public static List DataTableToClass(DataTable dt_Z_Save_Tag) + { + List z_Save_TagList = new List(); + Z_Save_Tag z_Save_Tag; + for (int i = 0; i < dt_Z_Save_Tag.Rows.Count; i++) + { + z_Save_Tag = new Z_Save_Tag(); + + var row = dt_Z_Save_Tag.Rows[i]; + z_Save_Tag.ID = Convert.ToInt32(row["ID"]); + z_Save_Tag.OpName = row["OpName"].ToString(); + z_Save_Tag.TagID = row["TagID"].ToString(); + z_Save_Tag.Value = row["Value"].ToString(); + z_Save_Tag.KeepTime = row["KeepTime"].ToString(); + z_Save_Tag.OperationTime = row["OperationTime"].ToString(); + z_Save_Tag.ProjectCode = row["ProjectCode"].ToString(); + + z_Save_TagList.Add(z_Save_Tag); + } + + return z_Save_TagList; + } + } +} diff --git a/SlMesDbIterface/MessageHanlder/msgHeader.cs b/SlMesDbIterface/MessageHanlder/msgHeader.cs new file mode 100644 index 0000000..e8fd3cd --- /dev/null +++ b/SlMesDbIterface/MessageHanlder/msgHeader.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ExternalDataSync +{ + public class msgHeader + { + /// + /// 协议版本,默认1.0 + /// + public int version + { + get; + set; + } = 1; + /// + /// 消息ID + /// + public string taskId + { + get; + set; + } = "1"; + /// + /// 事务号 + /// + public string taskType + { + get; + set; + } = ""; + } +} diff --git a/SlMesDbIterface/Mysql/solveUploadData.cs b/SlMesDbIterface/Mysql/solveUploadData.cs new file mode 100644 index 0000000..7fb3422 --- /dev/null +++ b/SlMesDbIterface/Mysql/solveUploadData.cs @@ -0,0 +1,50 @@ +using DatabaseClient; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + + +namespace SlMesDbIterface +{ + public class solveUploadData { + + public static DataTable GetUpLoadData(int dataType, string tableName, out string erorrMessage) + { + erorrMessage = ""; + DataTable dt = new DataTable(); + var dbClient = new DBClientFactory("mysql").Create(); + dbClient.Connect(Program.MySqlConnectString); + try + { + string sql = "select * from " + tableName + " WHERE S001 = '" + dataType.ToString() + "' AND S028 = '0' order by S029 DESC limit 10"; + dt = dbClient.ExecQuery(sql); + } + catch (Exception err) + { + erorrMessage = err.Message; + } + return dt; + } + + public static void UpDateUpLoadData(int id, string tableName, string resCode, string resMsg) + { + + var dbClient = new DBClientFactory("mysql").Create(); + dbClient.Connect(Program.MySqlConnectString); + try + { + string sql = "update " + tableName + " set S028 = '" + resCode + + "', S029 = '" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "', S030 = '" + resMsg + "'" + + " WHERE id = '" + id.ToString() + "'"; + dbClient.ExecNonQuery(sql); + } + catch (Exception err) + { + } + } + + } +} diff --git a/SlMesDbIterface/Program.cs b/SlMesDbIterface/Program.cs new file mode 100644 index 0000000..7451a57 --- /dev/null +++ b/SlMesDbIterface/Program.cs @@ -0,0 +1,56 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace SlMesDbIterface +{ + static class Program + { + public static int WebSvrPort = Convert.ToInt32(ConfigurationManager.AppSettings["WebSvrPort"]); + public static string ConnectionString = ConfigurationManager.AppSettings["ConnectionString"]; + public static string MySqlConnectString = ConfigurationManager.AppSettings["MySqlConnectString"]; + + public static string interfaceIDField = ConfigurationManager.AppSettings["interfaceIDField"]; + public static string messageIDField = ConfigurationManager.AppSettings["messageIDField"]; + public static string receiverField = ConfigurationManager.AppSettings["receiverField"]; + public static string senderField = ConfigurationManager.AppSettings["senderField"]; + public static string transIDField = ConfigurationManager.AppSettings["transIDField"]; + public static string changeUploadUrl = ConfigurationManager.AppSettings["changeUploadUrl"]; + public static string reportUploadUrl = ConfigurationManager.AppSettings["HL_urlStr"]; + public static string andonAbnormalUploadUr = ConfigurationManager.AppSettings["HL_urlStr"]; + public static string emptyContainerRecoveryUploadUr = ConfigurationManager.AppSettings["HL_urlStr"]; + public static string temporaryChangeUploadUrl = ConfigurationManager.AppSettings["HL_urlStr"]; + + /// + /// 应用程序的主入口点。 + /// + [STAThread] + static void Main() + { + bool bCanRun = false; + System.Threading.Mutex mutex = new System.Threading.Mutex(true, "InterfaceUpLoad", out bCanRun); + if (!bCanRun) + { + MessageBox.Show("接口数据上传 程序 正在运行!不可重复启动!"); + return; + } + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new Form_MoveSqlTable()); + } + + + + + + + + + + + + } +} diff --git a/SlMesDbIterface/Properties/AssemblyInfo.cs b/SlMesDbIterface/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..fb7c2d0 --- /dev/null +++ b/SlMesDbIterface/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 有关程序集的一般信息由以下 +// 控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("SlMesDbIterface")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("SlMesDbIterface")] +[assembly: AssemblyCopyright("Copyright © 2022")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 将 ComVisible 设置为 false 会使此程序集中的类型 +//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 +//请将此类型的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID +[assembly: Guid("2f33d79d-1dff-4cda-b357-fcd5221cab9a")] + +// 程序集的版本信息由下列四个值组成: +// +// 主版本 +// 次版本 +// 生成号 +// 修订号 +// +//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 +//通过使用 "*",如下所示: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/SlMesDbIterface/Properties/Resources.Designer.cs b/SlMesDbIterface/Properties/Resources.Designer.cs new file mode 100644 index 0000000..c36b797 --- /dev/null +++ b/SlMesDbIterface/Properties/Resources.Designer.cs @@ -0,0 +1,163 @@ +//------------------------------------------------------------------------------ +// +// 此代码由工具生成。 +// 运行时版本:4.0.30319.42000 +// +// 对此文件的更改可能会导致不正确的行为,并且如果 +// 重新生成代码,这些更改将会丢失。 +// +//------------------------------------------------------------------------------ + +namespace ExternalDataSync.Properties { + using System; + + + /// + /// 一个强类型的资源类,用于查找本地化的字符串等。 + /// + // 此类是由 StronglyTypedResourceBuilder + // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 + // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen + // (以 /str 作为命令选项),或重新生成 VS 项目。 + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// 返回此类使用的缓存的 ResourceManager 实例。 + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ExternalDataSync.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// 重写当前线程的 CurrentUICulture 属性,对 + /// 使用此强类型资源类的所有资源查找执行重写。 + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap 任务监控和查询 { + get { + object obj = ResourceManager.GetObject("任务监控和查询", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap 关闭系统 { + get { + object obj = ResourceManager.GetObject("关闭系统", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap 动态数据查询 { + get { + object obj = ResourceManager.GetObject("动态数据查询", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap 按键分割线 { + get { + object obj = ResourceManager.GetObject("按键分割线", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap 按键分割线浅 { + get { + object obj = ResourceManager.GetObject("按键分割线浅", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap 断开连接 { + get { + object obj = ResourceManager.GetObject("断开连接", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap 日志 { + get { + object obj = ResourceManager.GetObject("日志", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap 清除 { + get { + object obj = ResourceManager.GetObject("清除", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap 连接 { + get { + object obj = ResourceManager.GetObject("连接", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap 重新加载数据 { + get { + object obj = ResourceManager.GetObject("重新加载数据", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + } +} diff --git a/SlMesDbIterface/Properties/Resources.resx b/SlMesDbIterface/Properties/Resources.resx new file mode 100644 index 0000000..e08dc5a --- /dev/null +++ b/SlMesDbIterface/Properties/Resources.resx @@ -0,0 +1,151 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + ..\icon\任务监控和查询.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\icon\关闭系统.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\icon\动态数据查询.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\icon\按键分割线.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\icon\按键分割线浅.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\icon\断开连接.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\icon\日志.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\icon\清除.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\icon\连接.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\icon\重新加载数据.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + \ No newline at end of file diff --git a/SlMesDbIterface/Properties/Settings.Designer.cs b/SlMesDbIterface/Properties/Settings.Designer.cs new file mode 100644 index 0000000..5f6e85b --- /dev/null +++ b/SlMesDbIterface/Properties/Settings.Designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// 此代码由工具生成。 +// 运行时版本:4.0.30319.42000 +// +// 对此文件的更改可能会导致不正确的行为,并且如果 +// 重新生成代码,这些更改将会丢失。 +// +//------------------------------------------------------------------------------ + +namespace ExternalDataSync.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.5.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + } +} diff --git a/SlMesDbIterface/Properties/Settings.settings b/SlMesDbIterface/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/SlMesDbIterface/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/SlMesDbIterface/UMPP_ORDER.cs b/SlMesDbIterface/UMPP_ORDER.cs new file mode 100644 index 0000000..346001d --- /dev/null +++ b/SlMesDbIterface/UMPP_ORDER.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ExternalDataSync +{ + public class UMPP_ORDER + { + + public List List_UMPP_WORK_ORDER + { + get; + set; + } + public List List_UMPP_TASK_ORDER + { + get; + set; + } + } +} diff --git a/SlMesDbIterface/UMPP_TASK_ORDER.cs b/SlMesDbIterface/UMPP_TASK_ORDER.cs new file mode 100644 index 0000000..2770309 --- /dev/null +++ b/SlMesDbIterface/UMPP_TASK_ORDER.cs @@ -0,0 +1,176 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ExternalDataSync +{ + public class UMPP_TASK_ORDER + { + /// + /// 1 + /// 工厂编码 + /// + public string SITE + { + get; + set; + } = "1"; + /// + /// 2 + /// 工作中心 + /// + public string WORK_CENTER + { + get; + set; + } = "1"; + /// + /// 3 + /// 订单号 + /// + public string ORDER_CODE + { + get; + set; + } = "1"; + /// + /// 4 + /// 工单号 + /// + public string WORK_ORDER_CODE + { + get; + set; + } = "1"; + /// + /// 5 + /// 派工单号 + /// + public string TASK_ORDER_CODE + { + get; + set; + } = "1"; + /// + /// 6 + /// 产品编码 + /// + public string PRO_CODE + { + get; + set; + } = "1"; + /// + /// 7 + /// 产品名称 + /// + public string PRO_NAME + { + get; + set; + } = "1"; + /// + /// 8 + /// 工序编码 + /// + public string OP_CODE + { + get; + set; + } = "1"; + /// + /// 9 + /// 工作单元 + /// + public string WORK_CELL + { + get; + set; + } = "1"; + /// + /// 10 + /// 设备编码 + /// + public string EQUIP_CODE + { + get; + set; + } = "1"; + /// + /// 11 + /// 生产数量 + /// + public string QTY + { + get; + set; + } = "1"; + /// + /// 12 + /// 计划开始时间 + /// + public string PLAN_START_DATE + { + get; + set; + } = "1"; + /// + /// 13 + /// 计划结束时间 + /// + public string PLAN_END_DATE + { + get; + set; + } = "1"; + /// + /// 14 + /// 批次号 + /// + public string BATCH_NO + { + get; + set; + } = "1"; + /// + /// 15 + /// 操作标示 + /// + public string FLAG + { + get; + set; + } = "1"; + /// + /// 16 + /// 序号 + /// + public string SN + { + get; + set; + } = "1"; + /// + /// 17 + /// 时间戳 + /// + public string MARK_TIME + { + get; + set; + } = "1"; + /// + /// 18 + /// 日期 + /// + public string MARK_DATE + { + get; + set; + } = "1"; + + + } +} diff --git a/SlMesDbIterface/UMPP_WORK_ORDER.cs b/SlMesDbIterface/UMPP_WORK_ORDER.cs new file mode 100644 index 0000000..fc32f18 --- /dev/null +++ b/SlMesDbIterface/UMPP_WORK_ORDER.cs @@ -0,0 +1,265 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ExternalDataSync +{ + public class UMPP_WORK_ORDER + { + /// + /// 1 + /// 工厂编码 + /// + public string SITE + { + get; + set; + } = "1"; + /// + /// 2 + /// 工作中心 + /// + public string WORK_CENTER + { + get; + set; + } = "1"; + /// + /// 3 + /// 订单号 + /// + public string ORDER_CODE + { + get; + set; + } = "1"; + /// + /// 4 + /// 工单号 + /// + public string WORK_ORDER_CODE + { + get; + set; + } = "1"; + /// + /// 5 + /// 工单性质 + /// + public string NATURE + { + get; + set; + } = "1"; + /// + /// 6 + /// 产品编码 + /// + public string PRO_CODE + { + get; + set; + } = "1"; + /// + /// 7 + /// 产品名称 + /// + public string PRO_NAME + { + get; + set; + } = "1"; + /// + /// 8 + /// 工艺路线编码 + /// + public string ROUTE_CODE + { + get; + set; + } = "1"; + /// + /// 9 + /// 工艺路线版本 + /// + public string ROUTE_VER + { + get; + set; + } = "1"; + /// + /// 10 + /// 产品状态 + /// + public string PRODUCT_STATE + { + get; + set; + } = "1"; + /// + /// 11 + /// 是否注油 + /// + public string IS_OILING + { + get; + set; + } = "1"; + /// + /// 12 + /// 是否喷漆 + /// + public string IS_PAINTING + { + get; + set; + } = "1"; + /// + /// 13 + /// 生产方式 + /// + public string PRODUCE_TYPE + { + get; + set; + } = "1"; + /// + /// 14 + /// 优先级 + /// + public string PRIORITY + { + get; + set; + } = "1"; + /// + /// 15 + /// 生产数量 + /// + public string QTY + { + get; + set; + } = "1"; + /// + /// 16 + /// 追溯码类型 + /// + public string SERIAL_OR_LOR + { + get; + set; + } = "1"; + /// + /// 17 + /// 追溯码状态 + /// + public string HAS_PRODU_SERIAL + { + get; + set; + } = "1"; + /// + /// 18 + /// 追溯码信息 + /// + public string NUM_CODE + { + get; + set; + } = "1"; + /// + /// 19 + /// 生产日期 + /// + public string PLAN_DATE + { + get; + set; + } = "1"; + /// + /// 20 + /// 生产班次 + /// + public string PRO_SHIFT + { + get; + set; + } = "1"; + /// + /// 21 + /// 生产顺序 + /// + public string SEQ_NO + { + get; + set; + } = "1"; + /// + /// 22 + /// 计划开始时间 + /// + public string PLAN_START_DATE + { + get; + set; + } = "1"; + /// + /// 23 + /// 计划结束时间 + /// + public string PLAN_END_DATE + { + get; + set; + } = "1"; + /// + /// 24 + /// 批次号 + /// + public string BATCH_NO + { + get; + set; + } = "1"; + /// + /// 25 + /// 操作标示 + /// + public string FLAG + { + get; + set; + } = "1"; + /// + /// 26 + /// 序号 + /// + public string SN + { + get; + set; + } = "1"; + /// + /// 27 + /// 时间戳 + /// + public string MARK_TIME + { + get; + set; + } = "1"; + /// + /// 28 + /// 日期 + /// + public string MARK_DATE + { + get; + set; + } = "1"; + + } +} diff --git a/SlMesDbIterface/icon/002_列表.png b/SlMesDbIterface/icon/002_列表.png new file mode 100644 index 0000000..81abc65 Binary files /dev/null and b/SlMesDbIterface/icon/002_列表.png differ diff --git a/SlMesDbIterface/icon/0780fca3def52d8a02649c7aa2f8093a.gif b/SlMesDbIterface/icon/0780fca3def52d8a02649c7aa2f8093a.gif new file mode 100644 index 0000000..f27d4fa Binary files /dev/null and b/SlMesDbIterface/icon/0780fca3def52d8a02649c7aa2f8093a.gif differ diff --git a/SlMesDbIterface/icon/BOSS-数据管理.ico b/SlMesDbIterface/icon/BOSS-数据管理.ico new file mode 100644 index 0000000..0cda236 Binary files /dev/null and b/SlMesDbIterface/icon/BOSS-数据管理.ico differ diff --git a/SlMesDbIterface/icon/BOSS-数据管理.png b/SlMesDbIterface/icon/BOSS-数据管理.png new file mode 100644 index 0000000..eca58d7 Binary files /dev/null and b/SlMesDbIterface/icon/BOSS-数据管理.png differ diff --git a/SlMesDbIterface/icon/JD.png b/SlMesDbIterface/icon/JD.png new file mode 100644 index 0000000..abe9aa8 Binary files /dev/null and b/SlMesDbIterface/icon/JD.png differ diff --git a/SlMesDbIterface/icon/MBE风格多色图标-密码.png b/SlMesDbIterface/icon/MBE风格多色图标-密码.png new file mode 100644 index 0000000..e20eaa8 Binary files /dev/null and b/SlMesDbIterface/icon/MBE风格多色图标-密码.png differ diff --git a/SlMesDbIterface/icon/action_Cancel_16xLG.png b/SlMesDbIterface/icon/action_Cancel_16xLG.png new file mode 100644 index 0000000..ac08d59 Binary files /dev/null and b/SlMesDbIterface/icon/action_Cancel_16xLG.png differ diff --git a/SlMesDbIterface/icon/bitbug_favicon.ico b/SlMesDbIterface/icon/bitbug_favicon.ico new file mode 100644 index 0000000..4e9b14c Binary files /dev/null and b/SlMesDbIterface/icon/bitbug_favicon.ico differ diff --git a/SlMesDbIterface/icon/excelICON.ico b/SlMesDbIterface/icon/excelICON.ico new file mode 100644 index 0000000..f7dcbf6 Binary files /dev/null and b/SlMesDbIterface/icon/excelICON.ico differ diff --git a/SlMesDbIterface/icon/jk.ico b/SlMesDbIterface/icon/jk.ico new file mode 100644 index 0000000..fe585a8 Binary files /dev/null and b/SlMesDbIterface/icon/jk.ico differ diff --git a/SlMesDbIterface/icon/panlClose.png b/SlMesDbIterface/icon/panlClose.png new file mode 100644 index 0000000..462a22f Binary files /dev/null and b/SlMesDbIterface/icon/panlClose.png differ diff --git a/SlMesDbIterface/icon/ssbj.png b/SlMesDbIterface/icon/ssbj.png new file mode 100644 index 0000000..10dc152 Binary files /dev/null and b/SlMesDbIterface/icon/ssbj.png differ diff --git a/SlMesDbIterface/icon/staticjd.png b/SlMesDbIterface/icon/staticjd.png new file mode 100644 index 0000000..f891867 Binary files /dev/null and b/SlMesDbIterface/icon/staticjd.png differ diff --git a/SlMesDbIterface/icon/任务监控和查询.png b/SlMesDbIterface/icon/任务监控和查询.png new file mode 100644 index 0000000..ff8cca0 Binary files /dev/null and b/SlMesDbIterface/icon/任务监控和查询.png differ diff --git a/SlMesDbIterface/icon/倾斜校准.png b/SlMesDbIterface/icon/倾斜校准.png new file mode 100644 index 0000000..92e6fc7 Binary files /dev/null and b/SlMesDbIterface/icon/倾斜校准.png differ diff --git a/SlMesDbIterface/icon/关闭.png b/SlMesDbIterface/icon/关闭.png new file mode 100644 index 0000000..b78aef6 Binary files /dev/null and b/SlMesDbIterface/icon/关闭.png differ diff --git a/SlMesDbIterface/icon/关闭系统.png b/SlMesDbIterface/icon/关闭系统.png new file mode 100644 index 0000000..ffd64a8 Binary files /dev/null and b/SlMesDbIterface/icon/关闭系统.png differ diff --git a/SlMesDbIterface/icon/分布图.ico b/SlMesDbIterface/icon/分布图.ico new file mode 100644 index 0000000..d2bd021 Binary files /dev/null and b/SlMesDbIterface/icon/分布图.ico differ diff --git a/SlMesDbIterface/icon/分布图.png b/SlMesDbIterface/icon/分布图.png new file mode 100644 index 0000000..c41710c Binary files /dev/null and b/SlMesDbIterface/icon/分布图.png differ diff --git a/SlMesDbIterface/icon/动态数据查询.png b/SlMesDbIterface/icon/动态数据查询.png new file mode 100644 index 0000000..ad87d56 Binary files /dev/null and b/SlMesDbIterface/icon/动态数据查询.png differ diff --git a/SlMesDbIterface/icon/增加.png b/SlMesDbIterface/icon/增加.png new file mode 100644 index 0000000..4bfbb6b Binary files /dev/null and b/SlMesDbIterface/icon/增加.png differ diff --git a/SlMesDbIterface/icon/密码.png b/SlMesDbIterface/icon/密码.png new file mode 100644 index 0000000..295d5a9 Binary files /dev/null and b/SlMesDbIterface/icon/密码.png differ diff --git a/SlMesDbIterface/icon/手动打印.png b/SlMesDbIterface/icon/手动打印.png new file mode 100644 index 0000000..a682191 Binary files /dev/null and b/SlMesDbIterface/icon/手动打印.png differ diff --git a/SlMesDbIterface/icon/按键分割线.png b/SlMesDbIterface/icon/按键分割线.png new file mode 100644 index 0000000..f54e139 Binary files /dev/null and b/SlMesDbIterface/icon/按键分割线.png differ diff --git a/SlMesDbIterface/icon/按键分割线浅.png b/SlMesDbIterface/icon/按键分割线浅.png new file mode 100644 index 0000000..db55df6 Binary files /dev/null and b/SlMesDbIterface/icon/按键分割线浅.png differ diff --git a/SlMesDbIterface/icon/断开.png b/SlMesDbIterface/icon/断开.png new file mode 100644 index 0000000..fe5b4e9 Binary files /dev/null and b/SlMesDbIterface/icon/断开.png differ diff --git a/SlMesDbIterface/icon/断开连接.png b/SlMesDbIterface/icon/断开连接.png new file mode 100644 index 0000000..8221ffc Binary files /dev/null and b/SlMesDbIterface/icon/断开连接.png differ diff --git a/SlMesDbIterface/icon/日志.ico b/SlMesDbIterface/icon/日志.ico new file mode 100644 index 0000000..37a300e Binary files /dev/null and b/SlMesDbIterface/icon/日志.ico differ diff --git a/SlMesDbIterface/icon/日志.jpg b/SlMesDbIterface/icon/日志.jpg new file mode 100644 index 0000000..c5912e7 Binary files /dev/null and b/SlMesDbIterface/icon/日志.jpg differ diff --git a/SlMesDbIterface/icon/日志.png b/SlMesDbIterface/icon/日志.png new file mode 100644 index 0000000..1ef853f Binary files /dev/null and b/SlMesDbIterface/icon/日志.png differ diff --git a/SlMesDbIterface/icon/权限角色管理.png b/SlMesDbIterface/icon/权限角色管理.png new file mode 100644 index 0000000..8ab50e8 Binary files /dev/null and b/SlMesDbIterface/icon/权限角色管理.png differ diff --git a/SlMesDbIterface/icon/添加.png b/SlMesDbIterface/icon/添加.png new file mode 100644 index 0000000..47b1193 Binary files /dev/null and b/SlMesDbIterface/icon/添加.png differ diff --git a/SlMesDbIterface/icon/清除.jpg b/SlMesDbIterface/icon/清除.jpg new file mode 100644 index 0000000..4df456b Binary files /dev/null and b/SlMesDbIterface/icon/清除.jpg differ diff --git a/SlMesDbIterface/icon/用户.png b/SlMesDbIterface/icon/用户.png new file mode 100644 index 0000000..f7b6826 Binary files /dev/null and b/SlMesDbIterface/icon/用户.png differ diff --git a/SlMesDbIterface/icon/系统管理.png b/SlMesDbIterface/icon/系统管理.png new file mode 100644 index 0000000..136f392 Binary files /dev/null and b/SlMesDbIterface/icon/系统管理.png differ diff --git a/SlMesDbIterface/icon/系统管理和监控服务.png b/SlMesDbIterface/icon/系统管理和监控服务.png new file mode 100644 index 0000000..dab233f Binary files /dev/null and b/SlMesDbIterface/icon/系统管理和监控服务.png differ diff --git a/SlMesDbIterface/icon/质控管理.png b/SlMesDbIterface/icon/质控管理.png new file mode 100644 index 0000000..ad6a993 Binary files /dev/null and b/SlMesDbIterface/icon/质控管理.png differ diff --git a/SlMesDbIterface/icon/返修.jpg b/SlMesDbIterface/icon/返修.jpg new file mode 100644 index 0000000..cc57e91 Binary files /dev/null and b/SlMesDbIterface/icon/返修.jpg differ diff --git a/SlMesDbIterface/icon/连接.png b/SlMesDbIterface/icon/连接.png new file mode 100644 index 0000000..cc7650b Binary files /dev/null and b/SlMesDbIterface/icon/连接.png differ diff --git a/SlMesDbIterface/icon/配置.ico b/SlMesDbIterface/icon/配置.ico new file mode 100644 index 0000000..d028cc1 Binary files /dev/null and b/SlMesDbIterface/icon/配置.ico differ diff --git a/SlMesDbIterface/icon/配置.png b/SlMesDbIterface/icon/配置.png new file mode 100644 index 0000000..e16ab0b Binary files /dev/null and b/SlMesDbIterface/icon/配置.png differ diff --git a/SlMesDbIterface/icon/配置2.ico b/SlMesDbIterface/icon/配置2.ico new file mode 100644 index 0000000..45b4c44 Binary files /dev/null and b/SlMesDbIterface/icon/配置2.ico differ diff --git a/SlMesDbIterface/icon/配置2.png b/SlMesDbIterface/icon/配置2.png new file mode 100644 index 0000000..e5e7dc5 Binary files /dev/null and b/SlMesDbIterface/icon/配置2.png differ diff --git a/SlMesDbIterface/icon/重新加载数据.png b/SlMesDbIterface/icon/重新加载数据.png new file mode 100644 index 0000000..c98d847 Binary files /dev/null and b/SlMesDbIterface/icon/重新加载数据.png differ diff --git a/SlMesDbIterface/msg.cs b/SlMesDbIterface/msg.cs new file mode 100644 index 0000000..a438ed3 --- /dev/null +++ b/SlMesDbIterface/msg.cs @@ -0,0 +1,18 @@ +using ExternalDataSync.MOM; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ExternalDataSync +{ + public class msg + { + public msgHeader msgHeader + { + get; + set; + } + } +} diff --git a/SlMesDbIterface/msgBody.cs b/SlMesDbIterface/msgBody.cs new file mode 100644 index 0000000..dc979f4 --- /dev/null +++ b/SlMesDbIterface/msgBody.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ExternalDataSync +{ + public class msgBody + { + public msgWork msgWorkList; + } +} diff --git a/SlMesDbIterface/msgTask.cs b/SlMesDbIterface/msgTask.cs new file mode 100644 index 0000000..6d729ea --- /dev/null +++ b/SlMesDbIterface/msgTask.cs @@ -0,0 +1,85 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ExternalDataSync +{ + public class msgTask + { + /// + /// 派工单号 + /// + public string taskOrderCode + { + get; + set; + } = "1"; + /// + /// 产品编码 + /// + public string proCode + { + get; + set; + } = "1"; + /// + /// 产品名称 + /// + public string proName + { + get; + set; + } = "1"; + /// + /// 工序编码 + /// + public string opCode + { + get; + set; + } = "1"; + /// + /// 工作单元 + /// + public string workCell + { + get; + set; + } = "1"; + /// + /// 设备编码 + /// + public string equiCode + { + get; + set; + } = "1"; + /// + /// 生产数量 + /// + public string qty + { + get; + set; + } = "1"; + /// + /// 计划开始时间 + /// + public string planStartDate + { + get; + set; + } = "1"; + /// + /// 计划结束时间 + /// + public string planEndDate + { + get; + set; + } = "1"; + + } +} diff --git a/SlMesDbIterface/msgWork.cs b/SlMesDbIterface/msgWork.cs new file mode 100644 index 0000000..ac2e11f --- /dev/null +++ b/SlMesDbIterface/msgWork.cs @@ -0,0 +1,270 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ExternalDataSync +{ + public class msgWork + { + /// + /// 工厂编码 + /// + public string site + { + get; + set; + } = "1"; + /// + /// 工作中心 + /// + public string workCenter + { + get; + set; + } = "1"; + /// + /// 订单号 + + /// + public string orderCode + { + get; + set; + } = "1"; + /// + /// 工单号 + + /// + public string workOrderCode + { + get; + set; + } = "1"; + /// + /// 工单性质 + + /// + public string nature + { + get; + set; + } = "1"; + /// + /// 产品编码 + + /// + public string proCode + { + get; + set; + } = "1"; + /// + /// 产品名称 + + /// + public string proName + { + get; + set; + } = "1"; + /// + /// 工艺路线编码 + + /// + public string routeCode + { + get; + set; + } = "1"; + /// + /// 工艺路线版本 + + /// + public string routeVer + { + get; + set; + } = "1"; + /// + /// 产品状态 + + /// + public string productState + { + get; + set; + } = "1"; + /// + /// 是否注油 + + /// + public string isOiling + { + get; + set; + } = "1"; + /// + /// 是否喷漆 + + /// + public string isPainting + { + get; + set; + } = "1"; + /// + /// 生产方式 + + /// + public string produceType + { + get; + set; + } = "1"; + /// + /// 优先级 + + /// + public string priority + { + get; + set; + } = "1"; + /// + /// 生产数量 + + /// + public string qty + { + get; + set; + } = "1"; + /// + /// 追溯码类型 + + /// + public string serialOrlor + { + get; + set; + } = "1"; + /// + /// 追溯码状态 + + /// + public string HasProduSerial + { + get; + set; + } = "1"; + /// + /// 追溯码信息 + + /// + public string numCode + { + get; + set; + } = "1"; + /// + /// 生产日期 + + /// + public string planDate + { + get; + set; + } = "1"; + /// + /// 生产班次 + + /// + public string proShift + { + get; + set; + } = "1"; + /// + /// 生产顺序 + + /// + public string seqNo + { + get; + set; + } = "1"; + /// + /// 计划开始时间 + + /// + public string planStartDate + { + get; + set; + } = "1"; + /// + /// 计划结束时间 + + /// + public string planEndDate + { + get; + set; + } = "1"; + /// + /// 批次号 + + /// + public string batchNo + { + get; + set; + } = "1"; + /// + /// 操作标示 + + /// + public string flag + { + get; + set; + } = "1"; + /// + /// 序号 + + /// + public string sn + { + get; + set; + } = "1"; + /// + /// 时间戳 + /// + public string markTime + { + get; + set; + } = "1"; + /// + /// 日期 + + /// + public string markDate + { + get; + set; + } = "1"; + /// + /// + /// + public List msgTaskList + { + get; + set; + } = new List (); + + } +} diff --git a/SlMesDbIterface/packages.config b/SlMesDbIterface/packages.config new file mode 100644 index 0000000..c59b416 --- /dev/null +++ b/SlMesDbIterface/packages.config @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/SlMesDbIterface/uploadMessage/UpLoadMessage.cs b/SlMesDbIterface/uploadMessage/UpLoadMessage.cs new file mode 100644 index 0000000..4514278 --- /dev/null +++ b/SlMesDbIterface/uploadMessage/UpLoadMessage.cs @@ -0,0 +1,302 @@ +using ExternalDataSync; +using ExternalDataSync.ESB_daq; +using ExternalDataSync.MOM; +using Newtonsoft.Json; +using NPOI.SS.Formula.Functions; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.IO; +using System.Linq; +using System.Net; +using System.Security.Cryptography; +using System.Security.Policy; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using System.Web.UI.WebControls; + +namespace SlMesDbIterface +{ + public class UpLoadMessage + { + enum InterFaceType + { + passStation = 1, + deviceAlarm = 2 + }; + + /// + /// UUID生成 + /// + /// + public static string UuidUtil() + { + string result = Guid.NewGuid().ToString(); + + return result; + } + + public void GetUpLoadMessageButton(string productName) + { + try + { + // 第一个存储过程 查询一个总成号的所有过点信息 第一个表 + DataLinkMesWork.SQLCommon.ExecuteStoredProcedure(productName + "_查询", Program.ConnectionString, out DataTable dt, out string errorMessage); + //InterFaceType interFaceTypeEnum = (InterFaceType)interFaceType; + if (dt.Rows.Count > 0) + { + switch (productName) + { + + case "接口_上传_质量数据": + ReportUploadData(dt,productName); + break; + default: + break; + } + } + } + catch (Exception err) + { + } + } + public void GetUpLoadMessage(string productName, int interFaceType) + { + new Thread(new ThreadStart(delegate () + { + while (true) + { + try + { + DataLinkMesWork.SQLCommon.ExecuteStoredProcedure(productName + "_查询", Program.ConnectionString, out DataTable dt, out string errorMessage); + InterFaceType interFaceTypeEnum = (InterFaceType)interFaceType; + if (dt.Rows.Count > 0) + { + switch (interFaceTypeEnum) + { + case InterFaceType.passStation: + //UpLoadPassStation(dt, productName); + break; + case InterFaceType.deviceAlarm: + //UpLoadDeviceAlarmn(dt); + break; + default: + break; + } + } + } + catch (Exception err) + { + } + Thread.Sleep(Form_MoveSqlTable.upload_Interval); + } + })) + { IsBackground = true }.Start(); + } + + /// + /// 接口_上传_生产报工 + /// + /// 变更执行结果上传 父表数据集 只有一条未上传的父表数据 + public void ReportUploadData(DataTable dt, string productName) + { + string ParentId = dt.Rows[0]["ID"].ToString(); + + try + { + // 创建父集合 + ReportUploadData BaseData = new ReportUploadData(); + // 填充基本数据 + BaseData.orderNumber = dt.Rows[0]["订单号"].ToString(); + BaseData.snCode = dt.Rows[0]["SN号"].ToString(); + BaseData.productModel = dt.Rows[0]["产品型号"].ToString(); + BaseData.recipeNumber = dt.Rows[0]["配方号"].ToString(); + BaseData.qualityResult = dt.Rows[0]["合格标志"].ToString(); + BaseData.stationCode = dt.Rows[0]["工位号"].ToString(); + BaseData.productionDate = dt.Rows[0]["生产日期"].ToString(); + + // 通过ParentId 去查找子表数据 获取结果集 + var ChildrenParam1 = new SqlParameter[] { + new SqlParameter("@parentId",ParentId) + }; + + string ChildrenTableName1 = "接口_上传_质量数据_质量"; + DataLinkMesWork.SQLCommon.ExecuteStoredProcedure(ChildrenTableName1 + "_查询", Program.ConnectionString, ref ChildrenParam1, out DataTable ChildrenDt1, out string errormessage1); + + // 创建子对象列表 + List reportUploadQualityDataList = new List(); + + // 遍历子表结果集 + // 工单 + for (int i = 0; i < ChildrenDt1.Rows.Count; i++) + { + // 子对象 + ReportUploadQualityData reportUploadQualityData = new ReportUploadQualityData(); + DataRow item = ChildrenDt1.Rows[i]; + + // 填充数据 + reportUploadQualityData.screwPositionNumber = item["螺钉孔号"].ToString(); + reportUploadQualityData.torque = item["扭矩"].ToString(); + reportUploadQualityData.dowelHeightValue = item["螺桩高度测量值"].ToString(); + reportUploadQualityData.qualityResult = item["合格标志"].ToString(); + + // 添加到集合列表中 + reportUploadQualityDataList.Add(reportUploadQualityData); + } + + // 将子表结果List加入到父对象中 + BaseData.qualityList = reportUploadQualityDataList; + + //准备上传的数据 反序列化 + string bodydata = JsonConvert.SerializeObject(BaseData); + + string urlstr = Program.reportUploadUrl; + string retString; + HttpWebRequest request = (HttpWebRequest)WebRequest.Create(urlstr); + request.Method = "post"; + byte[] bytes = Encoding.UTF8.GetBytes(bodydata); + request.Accept = "*/*"; + request.ContentType = "application/json;charset=utf-8"; + + + // 反序列化后先把JSON做接口记录 + //存储日志 + int AID = -1; + var CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"); + //Event_MOM_Log_Insert,@创建时间,@内容 + var reqParam = new SqlParameter[] { + new SqlParameter("@接口地址",urlstr), + new SqlParameter("@接口类型",1), // 1. 主动调用接口 2. 被调用接口 + new SqlParameter("@请求内容",bodydata), + new SqlParameter("@请求时间",CreateTime) + }; + DataLinkMesWork.SQLCommon.ExecuteStoredProcedure("接口_IOT接口交互日志_请求记录", Program.ConnectionString, ref reqParam, out DataTable reqDt, out string errorMessage); + if (reqDt.Rows.Count > 0) + { + AID = Convert.ToInt32(reqDt.Rows[0]["AID"]); + } + + // 根据接口需要 准备Header + msgHeader mHeader = new msgHeader(); + mHeader.version = 1; //协议版本,默认1.0 + mHeader.taskId = UuidUtil(); //消息ID + mHeader.taskType = ""; //接口类型 固定为接口目录编号,"" + + // 根据接口需要 添加Header + request.Headers.Add("version", mHeader.version.ToString()); + request.Headers.Add("taskId", mHeader.taskId); + request.Headers.Add("taskType", mHeader.taskType); + + request.ContentLength = bytes.Length; + + // 准备请求体 + Stream myResponseStream = request.GetRequestStream(); + myResponseStream.Write(bytes, 0, bytes.Length); + //发送webapi请求 等待相应 + HttpWebResponse response = (HttpWebResponse)request.GetResponse(); + StreamReader myStreamReader = new StreamReader(response.GetResponseStream(), Encoding.UTF8); + retString = myStreamReader.ReadToEnd(); + + //响应结果 + CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"); + var resParam = new SqlParameter[] { + new SqlParameter("@AID",AID), + new SqlParameter("@响应时间",CreateTime), + new SqlParameter("@响应内容",retString) + }; + DataLinkMesWork.SQLCommon.ExecuteStoredProcedure("接口_IOT接口交互日志_响应记录", Program.ConnectionString, ref resParam, out errorMessage); + + // 序列化响应内容 + msgResHeader mrh = JsonConvert.DeserializeObject(retString); + int statusCode = (int)response.StatusCode; + // 对响应内容进行处理 更新数据库标志 + if (statusCode == 200) + { + myStreamReader.Close(); + myResponseStream.Close(); + // 这里的接口不返回任何数据,200 直接成功! + updateUpLoadMessage(productName, ParentId, mrh.msg, 1); + //if (response != null) + //{ + // // 成功 + // if (mrh.code == "0") + // { + // updateUpLoadMessage(productName, ParentId, mrh.msg, 1); + // } + // // 失败 + // else + // { + // updateUpLoadMessage(productName, ParentId, mrh.msg, 2); + // } + // response.Close(); + //} + if (request != null) + { + request.Abort(); + } + MyLog4Net.MyLogHelper.Info("res:", retString); + // + } + else + { + updateUpLoadMessage(productName, ParentId, "请求失败,请求结果码" + statusCode, 2); + MyLog4Net.MyLogHelper.Error(productName + "接口" + ParentId + "上传失败", "请求失败,请求结果码" + statusCode); + } + } + catch (Exception err) + { + updateUpLoadMessage(productName, ParentId, err.Message, 2); + MyLog4Net.MyLogHelper.Error(productName + "接口" + ParentId + "上传失败", err.Message); + } + Thread.Sleep(100); + } + + /// + /// 上传成功更新数据库 + /// + /// + /// + /// + /// 1成功 2 不成功 + public void updateUpLoadMessage(string productName, string parentId,string resMsg,int isOk) + { + try + { + var param = new SqlParameter[] { + new SqlParameter("@主键值", parentId), + new SqlParameter("@文本", resMsg), + new SqlParameter("@是否成功", isOk), //1成功 2 不成功 + new SqlParameter("@接口表", productName) //1成功 2 不成功 + }; + DataLinkMesWork.SQLCommon.ExecuteStoredProcedure(productName + "_更新", Program.ConnectionString, ref param, out string errorMessage); + } + catch (Exception err) + { + } + } + /// + /// 上传失败更新数据库 + /// + /// + /// + /// + public void updateUpLoadMessage_error(string productName, string ParentId, string err_msg) + { + try + { + var param = new SqlParameter[] { + new SqlParameter("@主键值", ParentId), + new SqlParameter("@接口表", productName), + new SqlParameter("@文本", err_msg), + }; + DataLinkMesWork.SQLCommon.ExecuteStoredProcedure("接口_上传_失败日志_增加", Program.ConnectionString, ref param, out string errorMessage); + } + catch (Exception err) + { + } + } + + } +} diff --git a/SlMesDbIterface/系统管理和监控服务.ico b/SlMesDbIterface/系统管理和监控服务.ico new file mode 100644 index 0000000..6a4cb0f Binary files /dev/null and b/SlMesDbIterface/系统管理和监控服务.ico differ diff --git a/SlMesDbIterface/系统管理和监控服务.png b/SlMesDbIterface/系统管理和监控服务.png new file mode 100644 index 0000000..dab233f Binary files /dev/null and b/SlMesDbIterface/系统管理和监控服务.png differ diff --git a/WebApi/02_WebApi.csproj b/WebApi/02_WebApi.csproj new file mode 100644 index 0000000..eb740e0 --- /dev/null +++ b/WebApi/02_WebApi.csproj @@ -0,0 +1,107 @@ + + + + + Debug + AnyCPU + {5C6E31A8-8B45-4459-BA62-07AF6135DF4A} + Exe + WebApi + WebApi + v4.8 + 512 + true + true + + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + LocalIntranet + + + false + + + Properties\app.manifest + + + + ..\packages\log4net.2.0.14\lib\net45\log4net.dll + + + ..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll + + + + + + ..\packages\Microsoft.AspNet.WebApi.Client.5.2.9\lib\net45\System.Net.Http.Formatting.dll + + + + ..\packages\Microsoft.AspNet.Cors.5.2.9\lib\net45\System.Web.Cors.dll + + + ..\packages\Microsoft.AspNet.WebApi.Core.5.2.9\lib\net45\System.Web.Http.dll + + + ..\packages\Microsoft.AspNet.WebApi.Cors.5.2.9\lib\net45\System.Web.Http.Cors.dll + + + ..\packages\Microsoft.AspNet.WebApi.SelfHost.5.2.9\lib\net45\System.Web.Http.SelfHost.dll + + + + + + + + + + + + + + + + + + + + + + + PreserveNewest + + + + + + + + + + {c7c5e929-be10-4ed6-94db-b8d65e05e52f} + 01_DatabaseClient + + + + \ No newline at end of file diff --git a/WebApi/ApiTools.cs b/WebApi/ApiTools.cs new file mode 100644 index 0000000..a51e14d --- /dev/null +++ b/WebApi/ApiTools.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Web.Http; +using System.Net.Http; +using System.Text.RegularExpressions; + +namespace WebApi +{ + public enum ResponseCode + { + Fail = 00000, + Success = 00200, + } + + public class ApiTools + { + private string msgModel = "{{\"code\":{0},\"message\":\"{1}\",\"result\":{2}}}"; + public ApiTools() + { + } + public HttpResponseMessage MsgFormat(ResponseCode code, string explanation, string result) + { + string r = @"^(\-|\+)?\d+(\.\d+)?$"; + string json = string.Empty; + if (Regex.IsMatch(result, r) || result.ToLower() == "true" || result.ToLower() == "false" || result == "[]" || result.Contains('{')) + { + json = string.Format(msgModel, (int)code, explanation, result); + } + else + { + if (result.Contains('"')) + { + json = string.Format(msgModel, (int)code, explanation, result); + } + else + { + json = string.Format(msgModel, (int)code, explanation, "\"" + result + "\""); + } + } + return new HttpResponseMessage { Content = new StringContent(json, System.Text.Encoding.UTF8, "application/json") }; + } + } +} diff --git a/WebApi/App.config b/WebApi/App.config new file mode 100644 index 0000000..c2f5d55 --- /dev/null +++ b/WebApi/App.config @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WebApi/Controller/ZSavePositionController.cs b/WebApi/Controller/ZSavePositionController.cs new file mode 100644 index 0000000..9bfb916 --- /dev/null +++ b/WebApi/Controller/ZSavePositionController.cs @@ -0,0 +1,119 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Net.Http; +using System.Text; +using System.Web; +using System.Web.Http; +using System.Collections.Concurrent; +using Newtonsoft.Json.Linq; + + +namespace WebApi +{ + + [RoutePrefix("api/ZSavePosition")] //定义路由前缀 + public class ZSavePositionController : ApiController + { + /// + /// 插入数据库 + /// + /// + /// + [HttpPost] + public void Insert(JObject jObject) + { + string pp = ""; + try + { + var z_Save_Position = JsonConvert.DeserializeObject(JsonConvert.SerializeObject(jObject)); + + //z_Save_Position.OpName = "a1"; + //z_Save_Position.Value = "asd"; + //z_Save_Position.OperationTime = "2022/06/29 16:40:43"; + //z_Save_Position.ProjectCode = "123"; + + string sql = "INSERT INTO z_save_position(OpName, Value, OperationTime, ProjectCode) VALUES('" + z_Save_Position.OpName + "', '" + z_Save_Position.Value + "', '" + z_Save_Position.OperationTime + "', '" + z_Save_Position.ProjectCode + "');\n"; + var res = GlobalVar.dbClient.ExecNonQuery(sql); + + pp = res.ToString(); + + } + catch (Exception err) + { + GlobalVar.log.Error(err.Message); + // Console.WriteLine(err.Message); + } + } + + [HttpPost] + public HttpResponseMessage SelectPage([FromBody] JObject jobj) + { + string pp = ""; + try + { + var OpName = jobj["OpName"].ToString(); + var StartTime = jobj["StartTime"].ToString(); + var EndTime = jobj["EndTime"].ToString(); + var PageCurrent = jobj["PageCurrent"].ToString(); + var PageSize = jobj["PageSize"].ToString(); + + string sql = "SELECT * FROM z_save_position " + + "WHERE(OperationTime BETWEEN '" + StartTime + "' AND '" + EndTime + "') AND OpName like '" + OpName + "%' " + + "ORDER BY OperationTime;\n"; + var res = GlobalVar.dbClient.ExecQuery(sql); + + var zSavePersonList = Z_Save_Position.DataTableToClass(res); + + var newZSaveList = DatabaseClient.DBClient.SplitePage(zSavePersonList, Convert.ToInt32(PageSize), Convert.ToInt32(PageCurrent)); + var tableData = (JArray)JsonConvert.DeserializeObject(JsonConvert.SerializeObject(newZSaveList)); + JObject resjobj = new JObject() { + new JProperty("ItemCount", zSavePersonList.Count.ToString()), + new JProperty("TableData",tableData) + }; + + pp = resjobj.ToString(); + + } + catch (Exception err) + { + GlobalVar.log.Error(err.Message); + // Console.WriteLine(err.Message); + } + HttpResponseMessage result = new HttpResponseMessage { Content = new StringContent(pp, Encoding.GetEncoding("UTF-8"), "application/json") }; + return result; + } + + [HttpPost] + public HttpResponseMessage Select([FromBody] JObject jobj) + { + string pp = ""; + try + { + var OpName = jobj["OpName"].ToString(); + var StartTime = jobj["StartTime"].ToString(); + var EndTime = jobj["EndTime"].ToString(); + + string sql = "SELECT * FROM z_save_position " + + "WHERE(OperationTime BETWEEN '"+StartTime+"' AND '"+EndTime+"') AND OpName like '"+OpName+"%' " + + "ORDER BY OperationTime;\n"; + var res = GlobalVar.dbClient.ExecQuery(sql); + + var zSavePersonList = Z_Save_Position.DataTableToClass(res); + + var zSavePersonListStr = JsonConvert.SerializeObject(zSavePersonList); + + pp = zSavePersonListStr.ToString(); + } + catch (Exception err) + { + GlobalVar.log.Error(err.Message); + // Console.WriteLine (err.Message); + } + HttpResponseMessage result = new HttpResponseMessage { Content = new StringContent(pp, Encoding.GetEncoding("UTF-8"), "application/json") }; + return result; + } + } +} diff --git a/WebApi/Controller/ZSaveTagController.cs b/WebApi/Controller/ZSaveTagController.cs new file mode 100644 index 0000000..4371fde --- /dev/null +++ b/WebApi/Controller/ZSaveTagController.cs @@ -0,0 +1,122 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Net.Http; +using System.Text; +using System.Web; +using System.Web.Http; +using System.Collections.Concurrent; +using Newtonsoft.Json.Linq; + + +namespace WebApi +{ + + [RoutePrefix("api/ZSaveTag")] //定义路由前缀 + public class ZSaveTagController : ApiController + { + + /// + /// 插入数据库 + /// + /// + /// + [HttpPost] + public void Insert(JObject jObject) + { + string pp = ""; + try + { + var z_Save_Tag = JsonConvert.DeserializeObject(JsonConvert.SerializeObject(jObject)); + + string sql = "" + + "INSERT INTO z_save_tag (OpName, TagID, Value, KeepTime, OperationTime, ProjectCode) " + + " VALUES('"+ z_Save_Tag.OpName+ "', '"+ z_Save_Tag.TagID+ "', '"+ z_Save_Tag.Value+ "', '"+ z_Save_Tag .KeepTime+ "', '"+ z_Save_Tag .OperationTime+ "', '"+ z_Save_Tag .ProjectCode+ "'); \n"; + var res = GlobalVar.dbClient.ExecNonQuery(sql); + + pp = res.ToString(); + + } + catch (Exception err) + { + GlobalVar.log.Error(err.Message); + } + // HttpResponseMessage result = new HttpResponseMessage { Content = new StringContent(pp, Encoding.GetEncoding("UTF-8"), "application/json") }; + // return result; + } + + [HttpPost] + public HttpResponseMessage SelectPage([FromBody]JObject jobj) + { + string pp = ""; + + try + { + var OpName = jobj["OpName"].ToString(); + var StartTime = jobj["StartTime"].ToString(); + var EndTime = jobj["EndTime"].ToString(); + var PageCurrent = jobj["PageCurrent"].ToString(); + var PageSize = jobj["PageSize"].ToString(); + + + string sql = "SELECT * FROM z_save_tag " + + "WHERE(OperationTime BETWEEN '" + StartTime + "' AND '" + EndTime + "') AND OpName like '" + OpName + "%' " + + "ORDER BY OperationTime;\n"; + var res = GlobalVar.dbClient.ExecQuery(sql); + + var zSavePersonList = Z_Save_Position.DataTableToClass(res); + + var newZSaveList = DatabaseClient.DBClient.SplitePage(zSavePersonList, Convert.ToInt32(PageSize), Convert.ToInt32(PageCurrent)); + var tableData = (JArray)JsonConvert.DeserializeObject(JsonConvert.SerializeObject(newZSaveList)); + JObject resjobj = new JObject() { + new JProperty("ItemCount", zSavePersonList.Count.ToString()), + new JProperty("TableData",tableData) + }; + + pp = resjobj.ToString() + //.Replace("\r\n","") + ; + + } + catch (Exception err) + { + GlobalVar.log.Error(err.Message); + // Console.WriteLine(err.Message); + } + HttpResponseMessage result = new HttpResponseMessage { Content = new StringContent(pp, Encoding.GetEncoding("UTF-8"), "application/json") }; + return result; + } + + [HttpPost] + public HttpResponseMessage Select([FromBody] JObject jobj) + { + string pp = ""; + try + { + string OpName = jobj["OpName"].ToString(); + string StartTime = jobj["StartTime"].ToString(); + string EndTime = jobj["EndTime"].ToString(); + + string sql = "SELECT * FROM z_save_tag " + + "WHERE(OperationTime BETWEEN '"+StartTime+"' AND '"+EndTime+"') AND OpName like '"+OpName+"%' " + + "ORDER BY OperationTime;\n"; + var res = GlobalVar.dbClient.ExecQuery(sql); + + var zSavePersonList = Z_Save_Position.DataTableToClass(res); + + var zSavePersonListStr = JsonConvert.SerializeObject(zSavePersonList); + + pp = zSavePersonListStr.ToString(); + } + catch (Exception err) + { + GlobalVar.log.Error(err.Message); + // Console.WriteLine(err.Message); + } + HttpResponseMessage result = new HttpResponseMessage { Content = new StringContent(pp, Encoding.GetEncoding("UTF-8"), "application/json") }; + return result; + } + } +} diff --git a/WebApi/GlobalVar.cs b/WebApi/GlobalVar.cs new file mode 100644 index 0000000..1f22604 --- /dev/null +++ b/WebApi/GlobalVar.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using DatabaseClient; +using log4net; + +namespace WebApi +{ + class GlobalVar + { + public static DatabaseClient.DBClient dbClient; + public static ILog log = LogManager.GetLogger("WebApi"); + } +} diff --git a/WebApi/InitServer.cs b/WebApi/InitServer.cs new file mode 100644 index 0000000..6c5c09c --- /dev/null +++ b/WebApi/InitServer.cs @@ -0,0 +1,68 @@ +using System; +using System.Collections.Generic; +using System.Net.Http; +using System.Net.Http.Formatting; +using System.Net.Http.Headers; +using System.Web.Http; +using System.Web.Http.Cors; +using System.Web.Http.SelfHost; + +namespace WebApi +{ + + + public class InitServer + { + HttpSelfHostConfiguration config = null; + HttpSelfHostServer server = null; + public InitServer(string Url_WebApi) + { + // var Url_WebApi = System.Configuration.ConfigurationManager.AppSettings["Url_WebApi"]; + Init(Url_WebApi); + } + public void Init(string url) + { + config = new HttpSelfHostConfiguration(url); + + // 启用跨域 + config.EnableCors(new EnableCorsAttribute("*", "*", "*")); + // 启用特性路由 + config.MapHttpAttributeRoutes(); + + //config.Routes.MapHttpRoute( + // name: "DefaultApi", + // routeTemplate: "api/{controller}/{id}", + // defaults: new { id = RouteParameter.Optional } + //); + + // 自定义路由匹配到action + config.Routes.MapHttpRoute( + name: "API Default", + routeTemplate: "api/{controller}/{action}/{id}", + defaults: new { id = RouteParameter.Optional } + ); + + + + server = new HttpSelfHostServer(config); + + server.OpenAsync().Wait(); + + + } + public class JsonContentNegotiator : IContentNegotiator + { + private readonly JsonMediaTypeFormatter _jsonFormatter; + + public JsonContentNegotiator(JsonMediaTypeFormatter formatter) + { + _jsonFormatter = formatter; + } + public ContentNegotiationResult Negotiate(Type type, HttpRequestMessage request, IEnumerable formatters) + { + var result = new ContentNegotiationResult(_jsonFormatter, new MediaTypeHeaderValue("application/json")); + return result; + } + } + } +} diff --git a/WebApi/Program.cs b/WebApi/Program.cs new file mode 100644 index 0000000..531e9ae --- /dev/null +++ b/WebApi/Program.cs @@ -0,0 +1,82 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using DatabaseClient; + + +namespace WebApi +{ + + internal class Program + { + static void Main(string[] args) + { + + // CallDbFactoryTest(); + + #region DBConfig + var DatabaseType = System.Configuration.ConfigurationManager.AppSettings["DatabaseType"]; + var connString = ""; + switch (DatabaseType.ToLower()) + { + case "mysql": + { + connString = System.Configuration.ConfigurationManager.AppSettings["MysqlConnectString"]; + break; + } + case "mssql": + { + connString = System.Configuration.ConfigurationManager.AppSettings["MssqlConnectString"]; + break; + } + case "sqlite": + { + connString = System.Configuration.ConfigurationManager.AppSettings["SqliteConnectString"]; + break; + } + default: + { + connString = System.Configuration.ConfigurationManager.AppSettings["MysqlConnectString"]; + break; + } + } + + GlobalVar.dbClient = new DBClientFactory(DatabaseType).Create(); + GlobalVar.dbClient.Connect(connString); + #endregion + + var WebApiUrl = System.Configuration.ConfigurationManager.AppSettings["WebApiUrl"]; + new InitServer(WebApiUrl); + + + //GlobalVar.log.Error("错误", new Exception("发生了一个异常"));//错误 + //GlobalVar.log.Fatal("严重错误", new Exception("发生了一个致命错误"));//严重错误 + //GlobalVar.log.Info("信息"); //记录一般信息 + //GlobalVar.log.Debug("调试信息");//记录调试信息 + //GlobalVar.log.Warn("警告");//记录警告信息 + + + GlobalVar.log.Info("Start WebApi server..."); //记录一般信息 + GlobalVar.log.Info(" " + WebApiUrl); //记录一般信息 + // Console.WriteLine("Start WebApi server..."); + // Console.WriteLine(" " + WebApiUrl); + + Console.ReadKey(); + } + + static void CallDbFactoryTest() + { + DBClientFactory factory = new DBClientFactory("Mysql"); + // 只需切换 MySqlDatabaseFactory 就可切换数据库 + var mySqlClient = factory.Create(); + + + // MySqlClient sqlClient = new MySqlClient(); + mySqlClient.Connect("server=localhost;database=mytest;username=root;password=123456;"); + var ds = mySqlClient.ExecQuery("select * from Z_Save_Position"); + var zSavePositionList = Z_Save_Position.DataTableToClass(ds); + } + } +} diff --git a/WebApi/Properties/AssemblyInfo.cs b/WebApi/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..35fc201 --- /dev/null +++ b/WebApi/Properties/AssemblyInfo.cs @@ -0,0 +1,39 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("WebApi")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("WebApi")] +[assembly: AssemblyCopyright("Copyright © 2022")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("5c6e31a8-8b45-4459-ba62-07af6135df4a")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] + +// 指定log4net 的配置文件 +[assembly: log4net.Config.XmlConfigurator(ConfigFile = "log4net.config", Watch = true)] \ No newline at end of file diff --git a/WebApi/Properties/app.manifest b/WebApi/Properties/app.manifest new file mode 100644 index 0000000..db843ba --- /dev/null +++ b/WebApi/Properties/app.manifest @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/WebApi/Z_Save_Position.cs b/WebApi/Z_Save_Position.cs new file mode 100644 index 0000000..f22f343 --- /dev/null +++ b/WebApi/Z_Save_Position.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using System.Data; + +namespace WebApi +{ + class Z_Save_Position + { + public int ID; + public string OpName; + public string Value; + public string OperationTime; + public string ProjectCode; + + public Z_Save_Position() { } + + public static List DataTableToClass(DataTable dt_Z_Save_Position) + { + List z_Save_PositionList = new List(); + Z_Save_Position z_Save_Position; + for (int i = 0; i < dt_Z_Save_Position.Rows.Count; i++) + { + z_Save_Position = new Z_Save_Position(); + var row = dt_Z_Save_Position.Rows[i]; + z_Save_Position.ID = Convert.ToInt32(row["ID"]); + z_Save_Position.OpName = row["OpName"].ToString(); + z_Save_Position.Value = row["Value"].ToString(); + z_Save_Position.OperationTime = row["OperationTime"].ToString(); + z_Save_Position.ProjectCode = row["ProjectCode"].ToString(); + z_Save_PositionList.Add(z_Save_Position); + } + + return z_Save_PositionList; + } + } +} diff --git a/WebApi/Z_Save_Tag.cs b/WebApi/Z_Save_Tag.cs new file mode 100644 index 0000000..4626848 --- /dev/null +++ b/WebApi/Z_Save_Tag.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WebApi +{ + class Z_Save_Tag + { + public int ID; + public string OpName; + public string TagID; + public string Value; + public string KeepTime; + public string OperationTime; + public string ProjectCode; + public Z_Save_Tag() + { + + } + public static List DataTableToClass(DataTable dt_Z_Save_Tag) + { + List z_Save_TagList = new List(); + Z_Save_Tag z_Save_Tag; + for (int i = 0; i < dt_Z_Save_Tag.Rows.Count; i++) + { + z_Save_Tag = new Z_Save_Tag(); + + var row = dt_Z_Save_Tag.Rows[i]; + z_Save_Tag.ID = Convert.ToInt32(row["ID"]); + z_Save_Tag.OpName = row["OpName"].ToString(); + z_Save_Tag.TagID = row["TagID"].ToString(); + z_Save_Tag.Value = row["Value"].ToString(); + z_Save_Tag.KeepTime = row["KeepTime"].ToString(); + z_Save_Tag.OperationTime = row["OperationTime"].ToString(); + z_Save_Tag.ProjectCode = row["ProjectCode"].ToString(); + + z_Save_TagList.Add(z_Save_Tag); + } + + return z_Save_TagList; + } + } +} diff --git a/WebApi/log4net.config b/WebApi/log4net.config new file mode 100644 index 0000000..5ec9cd8 --- /dev/null +++ b/WebApi/log4net.config @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/WebApi/mysql.sql b/WebApi/mysql.sql new file mode 100644 index 0000000..af19273 --- /dev/null +++ b/WebApi/mysql.sql @@ -0,0 +1,30 @@ +CREATE DATABASE mytest; +USE mytest; +# show databases; +# show engines; +# show variables like '%character%'; + +-- auto-generated definition +create table z_save_position +( + ID int auto_increment + primary key, + OpName varchar(50) null, + Value varchar(200) null, + OperationTime datetime null, + ProjectCode varchar(50) null +)engine = InnoDB; + + +-- auto-generated definition +create table z_save_tag +( + ID int auto_increment + primary key, + OpName varchar(50) null, + TagID varchar(50) null, + Value varchar(200) null, + KeepTime varchar(50) null, + OperationTime datetime null, + ProjectCode varchar(50) null +)engine = InnoDB; \ No newline at end of file diff --git a/WebApi/packages.config b/WebApi/packages.config new file mode 100644 index 0000000..49b7fab --- /dev/null +++ b/WebApi/packages.config @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/mytest.sqlite b/mytest.sqlite new file mode 100644 index 0000000..a6d844e Binary files /dev/null and b/mytest.sqlite differ