commit 78ae9dcd2e7e5577918860a6c86e306ee7c195f4
Author: XingCheng3 <1773407212@qq.com>
Date: Fri May 29 09:34:04 2026 +0800
chore: initial commit
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..ad9c8bb
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,24 @@
+## Visual Studio
+.vs/
+[Bb]in/
+[Oo]bj/
+packages/
+*.user
+*.suo
+*.userosscache
+*.sln.docstates
+*.userprefs
+
+## Build results
+[Dd]ebug/
+[Rr]elease/
+x64/
+x86/
+[Aa][Rr][Mm]/
+[Bb]uild/
+bld/
+
+## Logs / temp
+*.log
+*.tmp
+*.cache
diff --git a/.vscode/settings.json b/.vscode/settings.json
new file mode 100644
index 0000000..cbc14d0
--- /dev/null
+++ b/.vscode/settings.json
@@ -0,0 +1,3 @@
+{
+ "claudeCodeChat.permissions.yoloMode": false
+}
\ No newline at end of file
diff --git a/Common/09MesDataFunction/MesDataFunction.sln b/Common/09MesDataFunction/MesDataFunction.sln
new file mode 100644
index 0000000..5cc56d6
--- /dev/null
+++ b/Common/09MesDataFunction/MesDataFunction.sln
@@ -0,0 +1,25 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.32901.82
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MesDataFunction", "MesDataFunction\MesDataFunction.csproj", "{90E76FB4-646D-45E2-95DB-0B8AB4E465D6}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {90E76FB4-646D-45E2-95DB-0B8AB4E465D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {90E76FB4-646D-45E2-95DB-0B8AB4E465D6}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {90E76FB4-646D-45E2-95DB-0B8AB4E465D6}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {90E76FB4-646D-45E2-95DB-0B8AB4E465D6}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {48DF007D-B08C-43B9-9AC7-78F6B2C23954}
+ EndGlobalSection
+EndGlobal
diff --git a/Common/09MesDataFunction/MesDataFunction/01-MesDataFunction.csproj b/Common/09MesDataFunction/MesDataFunction/01-MesDataFunction.csproj
new file mode 100644
index 0000000..72b6042
--- /dev/null
+++ b/Common/09MesDataFunction/MesDataFunction/01-MesDataFunction.csproj
@@ -0,0 +1,151 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {90E76FB4-646D-45E2-95DB-0B8AB4E465D6}
+ Library
+ Properties
+ MesDataFunction
+ 09MesDataFunction
+ v4.8
+ 512
+ true
+
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+ ..\..\..\dll_common\BasicData.dll
+
+
+ ..\..\..\dll_common\ConLink.dll
+
+
+ ..\..\..\dll_common\ConLink19.dll
+
+
+ ..\..\..\dll_common\DataLinkMesWork.dll
+
+
+ ..\..\..\dll_common\MesWork.DeviceDriver.dll
+
+
+ ..\..\..\dll_common\Monitor.MesWork.dll
+
+
+ ..\..\..\dll_common\MQTTnet.dll
+
+
+ ..\..\..\dll_common\MQTTnet.Extensions.ManagedClient.dll
+
+
+ False
+ ..\..\..\dll_common\Newtonsoft.Json.dll
+
+
+ ..\..\..\dll_common\NPOI.dll
+
+
+ ..\..\..\dll_common\NPOI.OOXML.dll
+
+
+ ..\..\..\dll_common\NPOI.OpenXml4Net.dll
+
+
+ ..\..\..\dll_common\NPOI.OpenXmlFormats.dll
+
+
+ ..\..\..\dll_common\Opc.Ua.Client.dll
+
+
+ ..\..\..\dll_common\Opc.Ua.Configuration.dll
+
+
+ ..\..\..\dll_common\Opc.Ua.Core.dll
+
+
+ ..\..\..\dll_common\OpcUaHelper.dll
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Form
+
+
+
+
+
+
+
+
+
+
+ {1dc48c83-1842-4de8-acaf-26e1e7f7c58f}
+ 00_MyLog4Net
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Common/09MesDataFunction/MesDataFunction/04-DataBaseAccess/DataAccess.cs b/Common/09MesDataFunction/MesDataFunction/04-DataBaseAccess/DataAccess.cs
new file mode 100644
index 0000000..aa173d8
--- /dev/null
+++ b/Common/09MesDataFunction/MesDataFunction/04-DataBaseAccess/DataAccess.cs
@@ -0,0 +1,746 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.Specialized;
+using System.Configuration;
+using System.Data;
+using System.Data.SqlClient;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace DataLinkMesWork1
+{
+ public class DataAccess
+ {
+ // 读配置文件有问题,先直接写死
+ public static string ConnectionString_MES = ConfigurationManager.AppSettings["ConnectionString_MES"];
+ public static bool ExecuteNonQuery(string sql, string connectionString, out string errorMessage)
+ {
+ bool result = false;
+ errorMessage = "";
+ using (SqlConnection conn = new SqlConnection(connectionString))
+ {
+ try
+ {
+ using (SqlCommand cmd = new SqlCommand(sql, conn))
+ {
+ //if (!SqlServerConnectionStatus) return false;
+ conn.Open();
+ cmd.ExecuteNonQuery();
+ }
+ //SqlServerConnectionStatus = true;
+ result = true;
+ }
+ catch (Exception e)
+ {
+ errorMessage = e.ToString();
+ //TestConnection();
+ //ApplicationLog.WriteLog(e, "\r\nExecuteNonQuery\r\nSQL��䣺\r\n" + sql + "\r\n�����ַ�����\r\n" + connectionString);
+ }
+ finally
+ {
+ if (conn.State == ConnectionState.Open)
+ conn.Close();
+ }
+ }
+ return result;
+
+ }
+ public static bool ExecuteDataset(string sql, string connectionString, out DataSet ds, out string errorMessage)
+ {
+ errorMessage = "";
+ bool result = true;
+ errorMessage = "";
+ ds = new DataSet();
+
+ /// SQLSERVER
+ /// SQLiteDB
+ try
+ {
+ //bool result = false;
+ errorMessage = "";
+ ds = new DataSet();
+ using (SqlConnection conn = new SqlConnection(connectionString))
+ {
+ try
+ {
+ //if (!SqlServerConnectionStatus) return false;
+ conn.Open();
+ using (SqlDataAdapter dsCommand = new SqlDataAdapter())
+ {
+ dsCommand.SelectCommand = new SqlCommand(sql, conn);
+ dsCommand.Fill(ds);
+ }
+ //SqlServerConnectionStatus = true;
+ result = true;
+ }
+ catch (Exception e)
+ {
+ errorMessage = e.ToString();
+ //TestConnection();
+ //ApplicationLog.WriteLog(e, "\r\nExecuteNonQuery\r\nSQL��䣺\r\n" + sql + "\r\n�����ַ�����\r\n" + connectionString);
+ }
+ finally
+ {
+ if (conn.State == ConnectionState.Open)
+ conn.Close();
+ }
+ }
+ return result;
+ }
+ catch (Exception err)
+ {
+
+ }
+
+ return result;
+
+
+ }
+ ///
+ /// 增 删 改
+ ///
+ ///
+ ///
+ ///
+ public static bool ExecuteStoredProcedure(string procedureName, ref SqlParameter[] sqlParameters)
+ {
+ string connectionString = ConnectionString_MES;
+ string errorMessage;
+ bool result = false;
+ errorMessage = "";
+ using (SqlConnection conn = new SqlConnection(connectionString))
+ {
+ try
+ {
+ //if (!SqlServerConnectionStatus) return false;
+ conn.Open();
+ using (SqlCommand cmd = new SqlCommand(procedureName, conn))
+ {
+ cmd.CommandTimeout = 0;
+ cmd.CommandType = CommandType.StoredProcedure;
+ if (sqlParameters != null)
+ {
+ for (int i = 0; i < sqlParameters.Length; i++)
+ {
+ cmd.Parameters.Add(sqlParameters[i]);
+ }
+ }
+ cmd.ExecuteNonQuery();
+ }
+ //SqlServerConnectionStatus = true;
+ result = true;
+ }
+ catch (Exception e)
+ {
+ errorMessage = e.ToString();
+ if (conn.State == ConnectionState.Open)
+ conn.Close();
+ //TestConnection();
+ ////ApplicationLog.WriteLog(e, "\r\nExecuteStoredProcedure\r\n�洢���̣�\r\n" + procedureName + "\r\n�����ַ�����\r\n" + connectionString);
+ }
+ finally
+ {
+ if (conn.State == ConnectionState.Open)
+ conn.Close();
+ }
+ }
+ return result;
+ }
+ public static bool ExecuteStoredProcedure(string procedureName, ref SqlParameter[] sqlParameters,out DataTable dt)
+ {
+ string connectionString = ConnectionString_MES;
+ string errorMessage;
+ bool result = false;
+ errorMessage = "";
+ //ds = new DataSet();
+ dt = new DataTable();
+ using (SqlConnection conn = new SqlConnection(connectionString))
+ {
+ try
+ {
+ //if (!SqlServerConnectionStatus) return false;
+ conn.Open();
+ using (SqlDataAdapter dsCommand = new SqlDataAdapter())
+ {
+ dsCommand.SelectCommand = new SqlCommand(procedureName, conn);
+ dsCommand.SelectCommand.CommandType = CommandType.StoredProcedure;
+ dsCommand.SelectCommand.CommandTimeout = 0;
+ if (sqlParameters != null)
+ {
+ for (int i = 0; i < sqlParameters.Length; i++)
+ {
+ dsCommand.SelectCommand.Parameters.Add(sqlParameters[i]);
+ }
+ }
+
+ dsCommand.Fill(dt);
+ }
+ //SqlServerConnectionStatus = true;
+ result = true;
+ }
+ catch (Exception e)
+ {
+ errorMessage = e.ToString();
+ //TestConnection();
+ ////ApplicationLog.WriteLog(e, "\r\nExecuteStoredProcedure\r\n�洢���̣�\r\n" + procedureName + "\r\n�����ַ�����\r\n" + connectionString);
+ }
+ finally
+ {
+ if (conn.State == ConnectionState.Open)
+ conn.Close();
+ }
+ }
+ return result;
+ }
+ public static bool ExecuteStoredProcedure(string procedureName, ref SqlParameter[] sqlParameters, out DataSet ds)
+ {
+ string connectionString = ConnectionString_MES;
+ string errorMessage;
+ bool result = false;
+ errorMessage = "";
+ ds = new DataSet();
+ using (SqlConnection conn = new SqlConnection(connectionString))
+ {
+ try
+ {
+ //if (!SqlServerConnectionStatus) return false;
+ conn.Open();
+ using (SqlDataAdapter dsCommand = new SqlDataAdapter())
+ {
+ dsCommand.SelectCommand = new SqlCommand(procedureName, conn);
+ dsCommand.SelectCommand.CommandType = CommandType.StoredProcedure;
+ dsCommand.SelectCommand.CommandTimeout = 0;
+ if (sqlParameters != null)
+ {
+ for (int i = 0; i < sqlParameters.Length; i++)
+ {
+ dsCommand.SelectCommand.Parameters.Add(sqlParameters[i]);
+ }
+ }
+
+ dsCommand.Fill(ds);
+ }
+ //SqlServerConnectionStatus = true;
+ result = true;
+ }
+ catch (Exception e)
+ {
+ errorMessage = e.ToString();
+ //TestConnection();
+ ////ApplicationLog.WriteLog(e, "\r\nExecuteStoredProcedure\r\n�洢���̣�\r\n" + procedureName + "\r\n�����ַ�����\r\n" + connectionString);
+ }
+ finally
+ {
+ if (conn.State == ConnectionState.Open)
+ conn.Close();
+ }
+ }
+ return result;
+ }
+
+ public static bool ExecuteStoredProcedure(string procedureName, ref SqlParameter[] sqlParameters, out string errorMessage)
+ {
+ string connectionString = ConnectionString_MES;
+ bool result = false;
+ errorMessage = "";
+ using (SqlConnection conn = new SqlConnection(connectionString))
+ {
+ try
+ {
+ //if (!SqlServerConnectionStatus) return false;
+ conn.Open();
+ using (SqlCommand cmd = new SqlCommand(procedureName, conn))
+ {
+ cmd.CommandTimeout = 0;
+ cmd.CommandType = CommandType.StoredProcedure;
+ if (sqlParameters != null)
+ {
+ for (int i = 0; i < sqlParameters.Length; i++)
+ {
+ cmd.Parameters.Add(sqlParameters[i]);
+ }
+ }
+ cmd.ExecuteNonQuery();
+ }
+ //SqlServerConnectionStatus = true;
+ result = true;
+ }
+ catch (Exception e)
+ {
+ errorMessage = e.ToString();
+ if (conn.State == ConnectionState.Open)
+ conn.Close();
+ //TestConnection();
+ ////ApplicationLog.WriteLog(e, "\r\nExecuteStoredProcedure\r\n�洢���̣�\r\n" + procedureName + "\r\n�����ַ�����\r\n" + connectionString);
+ }
+ finally
+ {
+ if (conn.State == ConnectionState.Open)
+ conn.Close();
+ }
+ }
+ return result;
+ }
+ public static bool ExecuteStoredProcedure(string procedureName, ref SqlParameter[] sqlParameters, out DataTable dt, out string errorMessage)
+ {
+ string connectionString = ConnectionString_MES;
+ bool result = false;
+ errorMessage = "";
+ //ds = new DataSet();
+ dt = new DataTable();
+ using (SqlConnection conn = new SqlConnection(connectionString))
+ {
+ try
+ {
+ //if (!SqlServerConnectionStatus) return false;
+ conn.Open();
+ using (SqlDataAdapter dsCommand = new SqlDataAdapter())
+ {
+ dsCommand.SelectCommand = new SqlCommand(procedureName, conn);
+ dsCommand.SelectCommand.CommandType = CommandType.StoredProcedure;
+ dsCommand.SelectCommand.CommandTimeout = 0;
+ if (sqlParameters != null)
+ {
+ for (int i = 0; i < sqlParameters.Length; i++)
+ {
+ dsCommand.SelectCommand.Parameters.Add(sqlParameters[i]);
+ }
+ }
+
+ dsCommand.Fill(dt);
+ }
+ //SqlServerConnectionStatus = true;
+ result = true;
+ }
+ catch (Exception e)
+ {
+ errorMessage = e.ToString();
+ //TestConnection();
+ ////ApplicationLog.WriteLog(e, "\r\nExecuteStoredProcedure\r\n�洢���̣�\r\n" + procedureName + "\r\n�����ַ�����\r\n" + connectionString);
+ }
+ finally
+ {
+ if (conn.State == ConnectionState.Open)
+ conn.Close();
+ }
+ }
+ return result;
+ }
+ public static bool ExecuteStoredProcedure(string procedureName, ref SqlParameter[] sqlParameters, out DataSet ds, out string errorMessage)
+ {
+ string connectionString = ConnectionString_MES;
+ bool result = false;
+ errorMessage = "";
+ ds = new DataSet();
+ using (SqlConnection conn = new SqlConnection(connectionString))
+ {
+ try
+ {
+ //if (!SqlServerConnectionStatus) return false;
+ conn.Open();
+ using (SqlDataAdapter dsCommand = new SqlDataAdapter())
+ {
+ dsCommand.SelectCommand = new SqlCommand(procedureName, conn);
+ dsCommand.SelectCommand.CommandType = CommandType.StoredProcedure;
+ dsCommand.SelectCommand.CommandTimeout = 0;
+ if (sqlParameters != null)
+ {
+ for (int i = 0; i < sqlParameters.Length; i++)
+ {
+ dsCommand.SelectCommand.Parameters.Add(sqlParameters[i]);
+ }
+ }
+
+ dsCommand.Fill(ds);
+ }
+ //SqlServerConnectionStatus = true;
+ result = true;
+ }
+ catch (Exception e)
+ {
+ errorMessage = e.ToString();
+ //TestConnection();
+ ////ApplicationLog.WriteLog(e, "\r\nExecuteStoredProcedure\r\n�洢���̣�\r\n" + procedureName + "\r\n�����ַ�����\r\n" + connectionString);
+ }
+ finally
+ {
+ if (conn.State == ConnectionState.Open)
+ conn.Close();
+ }
+ }
+ return result;
+ }
+
+ public static bool ExecuteDataset(string sql, out DataSet ds)
+ {
+ string errorMessage;
+ string connectionString = ConnectionString_MES;
+ bool result = false;
+ errorMessage = "";
+ ds = new DataSet();
+ using (SqlConnection conn = new SqlConnection(connectionString))
+ {
+ try
+ {
+ //if (!SqlServerConnectionStatus) return false;
+ conn.Open();
+ using (SqlDataAdapter dsCommand = new SqlDataAdapter())
+ {
+ dsCommand.SelectCommand = new SqlCommand(sql, conn);
+ dsCommand.Fill(ds);
+ }
+ //SqlServerConnectionStatus = true;
+ result = true;
+ }
+ catch (Exception e)
+ {
+ errorMessage = e.ToString();
+ //TestConnection();
+ ////ApplicationLog.WriteLog(e, "\r\nExecuteNonQuery\r\nSQL��䣺\r\n" + sql + "\r\n�����ַ�����\r\n" + connectionString);
+ }
+ finally
+ {
+ if (conn.State == ConnectionState.Open)
+ conn.Close();
+ }
+ }
+ return result;
+ }
+
+ public static bool ExecuteDataTable(string sql, out DataTable dt)
+ {
+ //public static bool ExecuteDataTable(string sql, string connectionString, out DataTable dt, out string errorMessage)
+ string errorMessage;
+ string connectionString = ConnectionString_MES;
+ bool result = false;
+ errorMessage = "";
+ dt = new DataTable();
+ using (SqlConnection conn = new SqlConnection(connectionString))
+ {
+ try
+ {
+ //if (!SqlServerConnectionStatus) return false;
+ conn.Open();
+ using (SqlDataAdapter dsCommand = new SqlDataAdapter())
+ {
+ dsCommand.SelectCommand = new SqlCommand(sql, conn);
+ dsCommand.Fill(dt);
+ }
+ //SqlServerConnectionStatus = true;
+ result = true;
+ }
+ catch (Exception e)
+ {
+ errorMessage = e.ToString();
+ //TestConnection();
+ ////ApplicationLog.WriteLog(e, "\r\nExecuteNonQuery\r\nSQL��䣺\r\n" + sql + "\r\n�����ַ�����\r\n" + connectionString);
+ }
+ finally
+ {
+ if (conn.State == ConnectionState.Open)
+ conn.Close();
+ }
+ }
+ return result;
+ }
+
+ public static DataTable ExecuteSQL(string sql, ref SqlParameter[] sqlParameters)
+ {
+ string connectionString = ConnectionString_MES;
+ string err;
+ bool result = false;
+ err = "";
+ DataTable dt = new DataTable();
+ using (SqlConnection conn = new SqlConnection(connectionString))
+ {
+ try
+ {
+ //if (!SqlServerConnectionStatus) return false;
+ conn.Open();
+ using (SqlDataAdapter dsCommand = new SqlDataAdapter(sql, conn))
+ {
+ if (sqlParameters != null)
+ {
+ for (int i = 0; i < sqlParameters.Length; i++)
+ {
+ dsCommand.SelectCommand.Parameters.Add(sqlParameters[i]);
+ }
+ }
+ dsCommand.Fill(dt);
+ }
+ result = true;
+ }
+ catch (Exception e)
+ {
+ err = e.ToString();
+ ////ApplicationLog.WriteLog(e, "\r\nExecuteSelectMesWork\r\n" + sql + "\r\n" + connectionString);
+ }
+ finally
+ {
+ if (conn.State == ConnectionState.Open)
+ conn.Close();
+ }
+ }
+ return dt;
+ }
+
+ public static bool ExecuteSQL(string sql)
+ {
+ string connectionString = ConnectionString_MES;
+ string errorMessage;
+ bool result = false;
+ errorMessage = "";
+ using (SqlConnection conn = new SqlConnection(connectionString))
+ {
+ try
+ {
+ using (SqlCommand cmd = new SqlCommand(sql, conn))
+ {
+ //if (!SqlServerConnectionStatus) return false;
+ conn.Open();
+ cmd.ExecuteNonQuery();
+ }
+ //SqlServerConnectionStatus = true;
+ result = true;
+ }
+ catch (Exception e)
+ {
+ errorMessage = e.ToString();
+ //TestConnection();
+ ////ApplicationLog.WriteLog(e, "\r\nExecuteNonQuery\r\nSQL��䣺\r\n" + sql + "\r\n�����ַ�����\r\n" + connectionString);
+ }
+ finally
+ {
+ if (conn.State == ConnectionState.Open)
+ conn.Close();
+ }
+ }
+ return result;
+ }
+
+ ///
+ /// 提供通用的调用存储过程的方法(增加数据的数据表的到数据库的调用)
+ ///
+ /// 存储过程名称
+ /// 存储过程参数数组
+ /// 增加数据的数据表
+ ///
+ public static bool ExecuteStoredProcedure(string procedureName, ref SqlParameter[] sqlParameters, DataTable dt)
+ {
+ string connectionString = ConnectionString_MES;
+ string errorMessage;
+ bool result = false;
+ errorMessage = "";
+ using (SqlConnection conn = new SqlConnection(connectionString))
+ {
+ try
+ {
+ // if (!SqlServerConnectionStatus) return false;
+ conn.Open();
+ using (SqlDataAdapter dsCommand = new SqlDataAdapter())
+ {
+ dsCommand.InsertCommand = new SqlCommand(procedureName, conn);
+ dsCommand.InsertCommand.CommandType = CommandType.StoredProcedure;
+ for (int i = 0; i < sqlParameters.Length; i++)
+ {
+ dsCommand.InsertCommand.Parameters.Add(sqlParameters[i]);
+ }
+ if (dt == null) return false;
+ dt.AcceptChanges();
+ for (int i = 0; i < dt.Rows.Count; i++)
+ {
+ dt.Rows[i].SetAdded();
+ }
+ dsCommand.Update(dt);
+ }
+ //SqlServerConnectionStatus = true;
+ result = true;
+ }
+ catch (Exception e)
+ {
+ errorMessage = e.ToString();
+ //TestConnection();
+ ////ApplicationLog.WriteLog(e, "\r\nExecuteStoredProcedure\r\n�洢���̣�\r\n" + procedureName + "\r\n�����ַ�����\r\n" + connectionString);
+ }
+ finally
+ {
+ if (conn.State == ConnectionState.Open)
+ conn.Close();
+ }
+ }
+ return result;
+ }
+
+ ///
+ /// 提供通用的调用存储过程的方法(增加数据的数据表的到数据库的调用)
+ ///
+ ///
+ ///
+ ///
+ public static bool ExecuteStoredProcedure(string procedureName, out DataTable dt)
+ {
+ string connectionString = ConnectionString_MES;
+ string errorMessage;
+ bool result = false;
+ errorMessage = "";
+ dt = new DataTable();
+ using (SqlConnection conn = new SqlConnection(connectionString))
+ {
+ try
+ {
+
+ //if (!SqlServerConnectionStatus) return false;
+ conn.Open();
+ using (SqlDataAdapter dsCommand = new SqlDataAdapter())
+ {
+ dsCommand.SelectCommand = new SqlCommand(procedureName, conn);
+ dsCommand.SelectCommand.CommandType = CommandType.StoredProcedure;
+
+ dsCommand.Fill(dt);
+ }
+ //SqlServerConnectionStatus = true;
+ result = true;
+ }
+ catch (Exception e)
+ {
+ errorMessage = e.ToString();
+ //TestConnection();
+ ////ApplicationLog.WriteLog(e, "\r\nExecuteStoredProcedure\r\n�洢���̣�\r\n" + procedureName + "\r\n�����ַ�����\r\n" + connectionString);
+ }
+ finally
+ {
+ if (conn.State == ConnectionState.Open)
+ conn.Close();
+ }
+ }
+ return result;
+ }
+
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static bool ExecuteSQL(string sql, ref SqlParameter[] sqlParameters, DataTable dt)
+ {
+ string connectionString = ConnectionString_MES;
+ string errorMessage;
+ bool result = false;
+ errorMessage = "";
+ using (SqlConnection conn = new SqlConnection(connectionString))
+ {
+
+
+ try
+ {
+ // if (!SqlServerConnectionStatus) return false;
+ conn.Open();
+ using (SqlDataAdapter dsCommand = new SqlDataAdapter())
+ {
+ dsCommand.InsertCommand = new SqlCommand(sql, conn);
+
+ for (int i = 0; i < sqlParameters.Length; i++)
+ {
+ sqlParameters[i].IsNullable = true;
+ dsCommand.InsertCommand.Parameters.Add(sqlParameters[i]);
+ }
+ if (dt == null) return false;
+ dt.AcceptChanges();
+ for (int i = 0; i < dt.Rows.Count; i++)
+ {
+ dt.Rows[i].SetAdded();
+ }
+ dsCommand.Update(dt);
+ }
+ //SqlServerConnectionStatus = true;
+ result = true;
+ }
+ catch (Exception e)
+ {
+ //ApplicationConfig.ConnectionStringPIS_NEW_Value = "0";
+ //TestConnection();
+ //errorMessage = e.ToString();
+ ////ApplicationLog.WriteLog(e, "\r\nExecuteSQL\r\nSQL��䣺\r\n" + sql + "\r\n�����ַ�����\r\n" + connectionString);
+ }
+ finally
+ {
+ if (conn.State == ConnectionState.Open)
+ conn.Close();
+ }
+ }
+ return result;
+ }
+
+ public static bool ExecuteNonQuery_newID(string sql, out long newID)
+ {
+ sql += ";select @@identity";
+ string connectionString;
+ connectionString = ConnectionString_MES;
+ using (SqlConnection conn = new SqlConnection(connectionString))
+ {
+ try
+ {
+ using (SqlCommand cmd = new SqlCommand(sql, conn))
+ {
+ conn.Open();
+ newID = Convert.ToInt64(cmd.ExecuteScalar());
+ }
+ return true;
+ }
+ catch (Exception e)
+ {
+ newID = 0;
+ //TestConnection();
+ ////ApplicationLog.WriteLog(e, "\r\n ExecuteNonQuery_newID\r\n�洢���̣�\r\n" + sql + "\r\n�����ַ�����\r\n" + connectionString);
+ return false;
+ }
+ finally
+ {
+ if (conn.State == ConnectionState.Open)
+ conn.Close();
+ }
+ }
+ }
+
+ public static bool ExecuteOutNum(string sql, out int count)
+ {
+ string connectionString;
+ connectionString = ConnectionString_MES;
+ string errorMessage;
+ bool result = false;
+ errorMessage = "";
+ using (SqlConnection conn = new SqlConnection(connectionString))
+ {
+ count = 0;
+ try
+ {
+ using (SqlCommand cmd = new SqlCommand(sql, conn))
+ {
+ //if (!SqlServerConnectionStatus) return false;
+ conn.Open();
+ count = Convert.ToInt32(cmd.ExecuteScalar().ToString());
+ }
+ //SqlServerConnectionStatus = true;
+ result = true;
+ }
+ catch (Exception e)
+ {
+ errorMessage = e.ToString();
+ //TestConnection();
+ ////ApplicationLog.WriteLog(e, "\r\nExecuteNonQuery\r\nSQL��䣺\r\n" + sql + "\r\n�����ַ�����\r\n" + connectionString);
+ }
+ finally
+ {
+ if (conn.State == ConnectionState.Open)
+ conn.Close();
+ }
+ }
+ return result;
+ }
+ }
+
+
+}
diff --git a/Common/09MesDataFunction/MesDataFunction/04-DataBaseAccess/JsonHelper.cs b/Common/09MesDataFunction/MesDataFunction/04-DataBaseAccess/JsonHelper.cs
new file mode 100644
index 0000000..5ec9f9c
--- /dev/null
+++ b/Common/09MesDataFunction/MesDataFunction/04-DataBaseAccess/JsonHelper.cs
@@ -0,0 +1,336 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Text;
+using System.Text.RegularExpressions;
+using System.Data;
+using System.Runtime.Serialization.Json;
+using System.Web.Script.Serialization;
+//using System.Runtime.Serialization.Json;
+
+//using System.Runtime.Serialization.Json;
+
+public class JsonHelper
+{
+ #region 序列化和反序列化
+ // 序列化
+ public static string JsonSerializer(T t)
+ {
+ // 使用 DataContractJsonSerializer 将 T 对象序列化为内存流。
+ DataContractJsonSerializer jsonSerializer = new DataContractJsonSerializer(typeof(T));
+ MemoryStream ms = new MemoryStream();
+ // 使用 WriteObject 方法将 JSON 数据写入到流中。
+ jsonSerializer.WriteObject(ms, t);
+ // 流转字符串
+ string jsonString = Encoding.UTF8.GetString(ms.ToArray());
+ ms.Close();
+ //替换Json的Date字符串
+ string p = @"\\/Date\((\d+)\+\d+\)\\/";
+ MatchEvaluator matchEvaluator = new MatchEvaluator(ConvertJsonDateToDateString);
+ Regex reg = new Regex(p);
+ jsonString = reg.Replace(jsonString, matchEvaluator);
+ return jsonString;
+ }
+ public static T JsonDeserialize(string jsonString)
+ {
+ //将"yyyy-MM-dd HH:mm:ss"格式的字符串转为"\/Date(1294499956278+0800)\/"格式
+ string p = @"\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}";
+ MatchEvaluator matchEvaluator = new MatchEvaluator(ConvertDateStringToJsonDate);
+ Regex reg = new Regex(p);
+ jsonString = reg.Replace(jsonString, matchEvaluator);
+ DataContractJsonSerializer jsonSerializer = new DataContractJsonSerializer(typeof(T));
+ // 字符串转流
+ MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(jsonString));
+ // 通过使用 DataContractJsonSerializer 的 ReadObject 方法,将 JSON 编码数据反序列化为T
+ T obj = (T)jsonSerializer.ReadObject(ms);
+ return obj;
+ }
+ public static string ConvertJsonDateToDateString(Match match)
+ {
+ string result = string.Empty;
+ DateTime dateTime = new DateTime(1970, 1, 1);
+ dateTime = dateTime.AddMilliseconds(long.Parse(match.Groups[1].Value));
+ dateTime = dateTime.ToLocalTime();
+ result = dateTime.ToString("yyyy-MM-dd HH:mm:ss");
+ return result;
+ }
+ private static string ConvertDateStringToJsonDate(Match m)
+ {
+ string result = string.Empty;
+ DateTime dt = DateTime.Parse(m.Groups[0].Value);
+ dt = dt.ToUniversalTime();
+ TimeSpan ts = dt - DateTime.Parse("1970-01-01");
+ result = string.Format("\\/Date({0}+0800)\\/", ts.TotalMilliseconds);
+ return result;
+ }
+ #endregion
+
+ // 对象转换为Json
+ public static string ObjectToJson(object obj)
+ {
+ JavaScriptSerializer js = new JavaScriptSerializer();
+ js.MaxJsonLength = Int32.MaxValue; // 定义JavaScriptSerializer接受字符串的最大长度 hdk 20180524
+ try
+ {
+ return js.Serialize(obj);
+ }
+ catch (Exception exception)
+ {
+
+ throw new Exception(exception.Message);
+ }
+ }
+ // 数据表转化为集合
+ public static List> DataTableToList(DataTable dt)
+ {
+ List> list = new List>();
+ foreach (DataRow dataRow in dt.Rows)
+ {
+ Dictionary dic = new Dictionary();
+
+
+ foreach (DataColumn dc in dt.Columns)
+ {
+ if (dataRow[dc.ColumnName].GetType() == typeof(DateTime))
+ {
+ string str = Convert.ToDateTime(dataRow[dc.ColumnName]).ToString("yyyy-MM-dd HH:mm:ss");
+ dic.Add(dc.ColumnName, str);
+ }
+ else if
+ (dataRow[dc.ColumnName].GetType() == typeof(byte[]))
+ {
+ string str = Convert.ToBase64String((byte[])dataRow[dc.ColumnName]);
+ dic.Add(dc.ColumnName, str);
+ }
+ else
+ {
+ dic.Add(dc.ColumnName, dataRow[dc.ColumnName]);
+ }
+
+ //Type type1 = dt.Rows[0]["产品图片"].GetType();
+ //Type type2 = typeof(byte[]);
+
+ }
+ list.Add(dic);
+ }
+ return list;
+ }
+ ///
+ /// 表转换为Json
+ ///
+ ///
+ ///
+ public static string DataTableToJson(DataTable dt)
+ {
+ return ObjectToJson(DataTableToList(dt));
+ }
+ ///
+ /// 将DataTable中的数据转换成JSON格式
+ ///
+ /// 数据源DataTable
+ /// 是否输出数据总条数
+ /// JSON中显示的数据总条数
+ ///
+ public static string CreateJsonParameters(DataTable dt, bool displayCount, int totalcount)
+ {
+ StringBuilder JsonString = new StringBuilder();
+ //Exception Handling
+
+ if (dt != null)
+ {
+ JsonString.Append("{ ");
+ JsonString.Append("\"rows\":[ ");
+ for (int i = 0; i < dt.Rows.Count; i++)
+ {
+ JsonString.Append("{ ");
+ for (int j = 0; j < dt.Columns.Count; j++)
+ {
+ if (j < dt.Columns.Count - 1)
+ {
+ //if (dt.Rows[i][j] == DBNull.Value) continue;
+ if (dt.Columns[j].DataType == typeof(bool))
+ {
+ JsonString.Append("\"" + dt.Columns[j].ColumnName.ToLower() + "\":" +
+ dt.Rows[i][j].ToString().ToLower() + ",");
+ }
+ else if (dt.Columns[j].DataType == typeof(string))
+ {
+ JsonString.Append("\"" + dt.Columns[j].ColumnName.ToLower() + "\":" +
+ ObjectToJson(dt.Rows[i][j]).ToString() + ",");
+ //JsonString.Append("\"" + dt.Columns[j].ColumnName.ToLower() + "\":" + "\"" +
+ // dt.Rows[i][j].ToString().Replace("\"", "\\\"") + "\",");
+ }
+ else
+ {
+ JsonString.Append("\"" + dt.Columns[j].ColumnName.ToLower() + "\":" + "\"" + dt.Rows[i][j] + "\",");
+ }
+ }
+ else if (j == dt.Columns.Count - 1)
+ {
+ //if (dt.Rows[i][j] == DBNull.Value) continue;
+ if (dt.Columns[j].DataType == typeof(bool))
+ {
+ JsonString.Append("\"" + dt.Columns[j].ColumnName.ToLower() + "\":" +
+ dt.Rows[i][j].ToString().ToLower());
+ }
+ else if (dt.Columns[j].DataType == typeof(string))
+ {
+ JsonString.Append("\"" + dt.Columns[j].ColumnName.ToLower() + "\":" +
+ ObjectToJson(dt.Rows[i][j]).ToString());
+ //JsonString.Append("\"" + dt.Columns[j].ColumnName.ToLower() + "\":" + "\"" +
+ // dt.Rows[i][j].ToString().Replace("\"", "\\\"") + "\"");
+ }
+ else
+ {
+ JsonString.Append("\"" + dt.Columns[j].ColumnName.ToLower() + "\":" + "\"" + dt.Rows[i][j] + "\"");
+ }
+ }
+ }
+ /*end Of String*/
+ if (i == dt.Rows.Count - 1)
+ {
+ JsonString.Append("} ");
+ }
+ else
+ {
+ JsonString.Append("}, ");
+ }
+ }
+ JsonString.Append("]");
+
+ if (displayCount)
+ {
+ JsonString.Append(",");
+
+ JsonString.Append("\"total\":");
+ JsonString.Append(totalcount);
+ }
+
+ JsonString.Append("}");
+ return JsonString.ToString().Replace("\n", "");
+ }
+ else
+ {
+ return null;
+ }
+ }
+ public static string CreateJsonParameters(DataTable dt)
+ {
+ StringBuilder JsonString = new StringBuilder();
+ //Exception Handling
+
+ if (dt != null)
+ {
+ JsonString.Append("{ ");
+ JsonString.Append("\"rows\":[ ");
+ for (int i = 0; i < dt.Rows.Count; i++)
+ {
+ JsonString.Append("{ ");
+ for (int j = 0; j < dt.Columns.Count; j++)
+ {
+ if (j < dt.Columns.Count - 1)
+ {
+ //if (dt.Rows[i][j] == DBNull.Value) continue;
+ if (dt.Columns[j].DataType == typeof(bool))
+ {
+ JsonString.Append("\"" + dt.Columns[j].ColumnName.ToLower() + "\":" +
+ dt.Rows[i][j].ToString().ToLower() + ",");
+ }
+ else if (dt.Columns[j].DataType == typeof(string))
+ {
+ JsonString.Append("\"" + dt.Columns[j].ColumnName.ToLower() + "\":" +
+ ObjectToJson(dt.Rows[i][j]).ToString() + ",");
+ //JsonString.Append("\"" + dt.Columns[j].ColumnName.ToLower() + "\":" + "\"" +
+ // dt.Rows[i][j].ToString().Replace("\"", "\\\"") + "\",");
+ }
+ else
+ {
+ JsonString.Append("\"" + dt.Columns[j].ColumnName.ToLower() + "\":" + "\"" + dt.Rows[i][j] + "\",");
+ }
+ }
+ else if (j == dt.Columns.Count - 1)
+ {
+ //if (dt.Rows[i][j] == DBNull.Value) continue;
+ if (dt.Columns[j].DataType == typeof(bool))
+ {
+ JsonString.Append("\"" + dt.Columns[j].ColumnName.ToLower() + "\":" +
+ dt.Rows[i][j].ToString().ToLower());
+ }
+ else if (dt.Columns[j].DataType == typeof(string))
+ {
+ JsonString.Append("\"" + dt.Columns[j].ColumnName.ToLower() + "\":" +
+ ObjectToJson(dt.Rows[i][j]).ToString());
+ //JsonString.Append("\"" + dt.Columns[j].ColumnName.ToLower() + "\":" + "\"" +
+ // dt.Rows[i][j].ToString().Replace("\"", "\\\"") + "\"");
+ }
+ else
+ {
+ JsonString.Append("\"" + dt.Columns[j].ColumnName.ToLower() + "\":" + "\"" + dt.Rows[i][j] + "\"");
+ }
+ }
+ }
+ /*end Of String*/
+ if (i == dt.Rows.Count - 1)
+ {
+ JsonString.Append("} ");
+ }
+ else
+ {
+ JsonString.Append("}, ");
+ }
+ }
+ JsonString.Append("]");
+
+ JsonString.Append("}");
+ return JsonString.ToString().Replace("\n", "");
+ }
+ else
+ {
+ return null;
+ }
+ }
+ StringBuilder result = new StringBuilder();
+ StringBuilder sb = new StringBuilder();
+ ///
+ /// 根据DataTable生成EasyUI Tree Json树结构
+ ///
+ /// 数据源
+ /// ID列
+ /// Text列
+ /// 节点Url
+ /// 关系字段
+ /// 父ID
+ public string GetTreeJsonByTable(DataTable tabel, string idCol, string txtCol, string url, string rela, object pId)
+ {
+ result.Append(sb.ToString());
+ sb.Clear();
+ if (tabel.Rows.Count > 0)
+ {
+ sb.Append("[");
+ string filer = string.Format("{0}='{1}'", rela, pId);
+ DataRow[] rows = tabel.Select(filer);
+ if (rows.Length > 0)
+ {
+ foreach (DataRow row in rows)
+ {
+ sb.Append("{\"id\":\"" + row[idCol] + "\",\"text\":\"" + row[txtCol] + "\",\"attributes\":\"" + row[url] + "\",\"state\":\"open\"");
+ if (tabel.Select(string.Format("{0}='{1}'", rela, row[idCol])).Length > 0)
+ {
+ sb.Append(",\"children\":");
+ GetTreeJsonByTable(tabel, idCol, txtCol, url, rela, row[idCol]);
+ result.Append(sb.ToString());
+ sb.Clear();
+ }
+ result.Append(sb.ToString());
+ sb.Clear();
+ sb.Append("},");
+ }
+ sb = sb.Remove(sb.Length - 1, 1);
+ }
+ sb.Append("]");
+ result.Append(sb.ToString());
+ sb.Clear();
+ }
+ return result.ToString();
+ }
+}
\ No newline at end of file
diff --git a/Common/09MesDataFunction/MesDataFunction/08-WebFun_base/MesWebFun_base.cs b/Common/09MesDataFunction/MesDataFunction/08-WebFun_base/MesWebFun_base.cs
new file mode 100644
index 0000000..a9d1eb8
--- /dev/null
+++ b/Common/09MesDataFunction/MesDataFunction/08-WebFun_base/MesWebFun_base.cs
@@ -0,0 +1,165 @@
+using System;
+namespace MesWebFun_base
+{
+ public partial class MisWebInterface
+ {
+ public static MesWebFun_base _MesWebFun_base = new MesWebFun_base();
+ public string WebSocket_Function(string msg)
+ {
+ var responseStr = "";
+ try
+ {
+ //返回的数据msg.data,包含了协议中的4部分9
+ var arrays_signal = msg.Split('|');
+ var m_Source = arrays_signal[0];
+ var m_Command = arrays_signal[1];
+ var m_Opname = arrays_signal[2];
+ var m_Value = arrays_signal[3];
+ // var opName = $("#tbx_opname").val();
+ switch (m_Source)
+ {
+ case "MES":
+
+ switch (m_Command)
+ {
+ //显示托盘信息 √
+ case "ShowMoby":
+ try
+ {
+ responseStr = MesWebFun_base.MobySelect(m_Opname);
+ }
+ catch (Exception exception)
+ {
+ //ApplicationLog.WriteLog("信息提示" + "|" + "错误断点:ShowMoby" + "|" + "info");
+ }
+ break;
+ //显示操作指南√
+ case "ProcessList":
+ try
+ {
+ responseStr = MesWebFun_base.ProcessList(m_Opname);
+ }
+ catch (Exception exception)
+ {
+ //ApplicationLog.WriteLog("信息提示" + "|" + "错误断点:ProcessList" + "|" + "info");
+ }
+ break;
+ //显示物料√
+ case "MaterialList":
+ try
+ {
+ responseStr = MesWebFun_base.MaterialList(m_Opname);
+ }
+ catch (Exception exception)
+ {
+ //ApplicationLog.WriteLog("信息提示" + "|" + "错误断点:MaterialList" + "|" + "info");
+ }
+ break;
+ //显示操作图片√
+ case "PicShow":
+ try
+ {
+ responseStr = MesWebFun_base.PictureShow(m_Opname);
+ }
+ catch (Exception exception)
+ {
+ //ApplicationLog.WriteLog("信息提示" + "|" + "错误断点:PicShow" + "|" + "info");
+ }
+ break;
+ //显示拧紧位置√
+ case "ShaftPosition":
+ try
+ {
+ responseStr = MesWebFun_base.ShaftPotion_Select(m_Opname);
+ }
+ catch (Exception exception)
+ {
+ //ApplicationLog.WriteLog("信息提示" + "|" + "错误断点:ShaftPosition" + "|" + "info");
+ }
+ break;
+ //实时显示质量数据√
+ case "ShowTimelyQuality":
+ try
+ {
+ responseStr = MesWebFun_base.Quality_Select(m_Opname);
+ }
+ catch (Exception exception)
+ {
+ //ApplicationLog.WriteLog("信息提示" + "|" + "错误断点:ShowTimelyQuality" + "|" + "info");
+ }
+ break;
+ //手动拧紧实时显示质量数据√
+ case "ShowTimelyQuality_Tight":
+ try
+ {
+ responseStr = MesWebFun_base.Quality_Select(m_Opname);
+ }
+ catch (Exception exception)
+ {
+ //ApplicationLog.WriteLog("信息提示" + "|" + "错误断点:ShowTimelyQuality_Tight" + "|" + "info");
+ }
+ break;
+
+ //√
+ case "OrderFormList":
+ try
+ {
+ responseStr = MesWebFun_base.OrderFormList(m_Opname);
+ }
+ catch (Exception exception)
+ {
+ //ApplicationLog.WriteLog("信息提示" + "|" + "错误断点:OrderFormList" + "|" + "info");
+ }
+ break;
+ //弹窗消息√
+ case "Notice":
+ try
+ {
+ responseStr = MesWebFun_base.ShowWindowNotice(m_Opname);
+ }
+ catch (Exception exception)
+ {
+ //ApplicationLog.WriteLog("信息提示" + "|" + "错误断点:Notice" + "|" + "info");
+ }
+ break;
+ //LED消息提醒√
+ case "ScrollNotice":
+ try
+ {
+ responseStr = MesWebFun_base.ShowLEDNotice(m_Opname);
+ }
+ catch (Exception exception)
+ {
+ //ApplicationLog.WriteLog("信息提示" + "|" + "错误断点:ScrollNotice" + "|" + "info");
+ }
+ break;
+ //物料检测初始化√
+ case "MaterialCheckPosition":
+ try
+ {
+ responseStr = MesWebFun_base.MaterialCheckPosition(m_Opname);
+ }
+ catch (Exception exception)
+ {
+ //ApplicationLog.WriteLog("信息提示" + "|" + "错误断点:MaterialCheckPosition" + "|" + "info");
+ }
+ break;
+
+ default:
+ // Web_Socket_Interface(m_Opname, msg);
+ break;
+ }
+ break;
+ }
+ }
+ catch (Exception exception)
+ {
+ var error = exception.ToString();
+ //ApplicationLog.WriteLog("信息提示" + "|" + "系统出现错误,接受onmessage:" + "|" + error + "|" + "info");
+ responseStr = "";
+ }
+ return responseStr;
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/Common/09MesDataFunction/MesDataFunction/08-WebFun_base/MesWebFun_baseFun.cs b/Common/09MesDataFunction/MesDataFunction/08-WebFun_base/MesWebFun_baseFun.cs
new file mode 100644
index 0000000..f9004d2
--- /dev/null
+++ b/Common/09MesDataFunction/MesDataFunction/08-WebFun_base/MesWebFun_baseFun.cs
@@ -0,0 +1,1860 @@
+using System;
+using System.Collections.Generic;
+using System.Web;
+using System.Text;
+
+using System.Data;
+using MisDataFunDll;
+//using SystemFramework;
+
+namespace MesWebFun_base
+{
+ public partial class MesWebFun_base
+ {
+ /////
+ ///// 电子看板_发动机号_合格放行_记录_增加
+ /////
+ /////
+ //private string Insert_ConfirmOk(string opName, string operatorNum, string type)
+ //{
+ // string text = "";
+ // try
+ // {
+ // // string operatorNum = HttpContext.Current.Request["userName"];//放行者工号
+ // // string type = HttpContext.Current.Request["recordType"];//放行类型
+ // MES.InsertRecord_ComfirmOkGO(opName, operatorNum, type);
+ // }
+ // catch (Exception err)
+ // {
+ // ////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:Insert_ConfirmOk");
+ // }
+ // return text;
+ //}
+
+
+
+ /////
+ ///// 初始化节拍数据
+ /////
+ /////
+ //private string InitOpNameOuputCount(string opnameValue)
+ //{
+ // string text = "";
+ // try
+ // {
+ // int outputValue = 0; //工位产量
+ // int nowOutputValue = 0; //在线产量
+ // int opNameBeatValue = 0; //工位节拍
+ // int NowOpNameBeatValue = 0; //在线节拍
+ // int classNumber = 0;//班次代码
+ // MisDataFun.InitOpNameOuputCount(opnameValue, out outputValue, out nowOutputValue, out opNameBeatValue, out NowOpNameBeatValue, out classNumber);
+ // text = "{\"outputValue\":\"" + outputValue + "\",\"nowOutputValue\":\"" + nowOutputValue + "\",\"opNameBeatValue\":\"" + opNameBeatValue + "\",\"NowOpNameBeatValue\":\"" + NowOpNameBeatValue + "\",\"classNumber\":\"" + classNumber + "\"}";
+ // }
+ // catch (Exception err)
+ // {
+ // ////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:InitOpNameOuputCount");
+ // }
+ // return text;
+ //}
+
+ /////
+ ///// 功能按钮 - 从数据库中初始化在线 / 离线 / 屏蔽的combobox
+ /////
+ /////
+ //private string Init_OnlineOutline(string opnameValue)
+ //{
+ // string text = "";
+ // try
+ // {
+ // System.Data.DataTable dt = null;
+ // MES.Init_OnlineOutline(opnameValue, out dt);
+ // string value = "";
+ // if (dt != null)
+ // {
+ // if (dt.Rows.Count > 0)
+ // {
+ // value = dt.Rows[0]["工位状态"].ToString();
+ // }
+ // }
+ // text = "{\"value\":\"" + value + "\"}";
+ // }
+ // catch (Exception err)
+ // {
+ // ////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:Init_OnlineOutline");
+ // }
+ // return text;
+ //}
+
+ /////
+ ///// 功能按钮---将在线,离线,屏蔽更新到数据库中
+ /////
+ /////
+ //private string Insert_OnlineOutline(string opnameValue, string selectValue)
+ //{
+ // string text = "";
+ // try
+ // {
+ // //string opnameValue = HttpContext.Current.Request["opnameValue"];//工位号
+ // //string selectValue = HttpContext.Current.Request["selectValue"];//选择的值
+ // if (selectValue == "")
+ // {
+ // selectValue = "0";
+ // }
+ // int selectValueint = Convert.ToInt32(selectValue);
+ // bool falg = MES.Insert_OnlineOutline(opnameValue, selectValueint);
+ // if (falg)
+ // {
+ // text = "{\"falg\":\"1\"}";
+ // }
+ // else
+ // {
+ // text = "{\"falg\":\"0\"}";
+ // }
+ // }
+ // catch (Exception err)
+ // {
+ // ////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:Insert_OnlineOutline");
+ // }
+ // return text;
+ //}
+
+ /////
+ ///// 合格放行
+ /////
+ /////
+ //private string functionButtonConfirmOk(string userName, string passWord)
+ //{
+ // string text = "";
+ // try
+ // {
+ // string roleFlag = "";
+ // string loginFlag = "";
+ // System.Data.DataTable dt_User = null;
+ // //string userName = HttpContext.Current.Request["function_button_confirmOkGo_userName"];
+ // //string passWord = HttpContext.Current.Request["function_button_confirmOkGo_passWord"];
+
+ // BaseDataSystemMES.UserInfo_Login(userName, passWord, out dt_User);
+ // if (dt_User != null)
+ // {
+ // if (dt_User.Rows.Count == 1)
+ // {
+ // int roleCodSum = Convert.ToInt32(dt_User.Rows[0][0].ToString());
+ // bool IsOK = false;
+ // RoleDistribution(roleCodSum, out IsOK);
+ // if (IsOK == true)
+ // {
+ // roleFlag = "1";
+ // loginFlag = "1";
+ // }
+ // else
+ // {
+ // roleFlag = "0";
+ // }
+ // }
+ // else
+ // {
+ // loginFlag = "0";
+ // }
+ // }
+ // else
+ // {
+ // loginFlag = "0";
+ // }
+ // text = "{\"roleFlag\":\"" + roleFlag + "\",\"loginFlag\":\"" + loginFlag + "\"}";
+ // }
+ // catch (Exception err)
+ // {
+ // ////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:functionButtonConfirmOk");
+ // }
+ // return text;
+ //}
+
+ /////
+ ///// 看用户是否有权限访问该页面
+ /////
+ /////
+ /////
+ //private void RoleDistribution(int roleCodSum, out bool IsOK)
+ //{
+ // IsOK = false;
+ // //登录工位MES的权限是256 如果role&256>0则有权限登录MES软件
+ // int roleCode = 64;
+ // //ArrayList aList = new ArrayList();
+ // if ((roleCodSum & roleCode) > 0)
+ // {
+ // ////加了没用上
+ // //aList.Add(roleCode);
+
+ // switch (roleCode)
+ // {
+ // case 64:
+ // {
+ // //一级用户管理
+ // IsOK = true;
+ // }
+ // break;
+
+ // default:
+ // break;
+ // }
+ // }
+ //}
+
+ /////
+ ///// 选择订单_增加订单号
+ /////
+ /////
+ //private string InsertOrderNum(string orderlist, string opName)
+ //{
+ // //string orderlist = HttpContext.Current.Request["orderNum"];
+ // MES.OrderNum_Add(opName, orderlist);
+ // return orderlist;
+ //}
+
+ /////
+ ///// 选择订单_增加发动机型号
+ /////
+ /////
+ //private string InsertEngineNum(string opName, string enginetype, string enginetypecode)
+ //{
+ // string orderlist = "";
+ // //string enginetype = HttpContext.Current.Request["enginetype"];
+ // //string enginetypecode = HttpContext.Current.Request["enginetypecode"];
+ // int enginetypeID = Convert.ToInt32(enginetypecode);
+ // MES.EngineNum_Add(opName, enginetype, enginetypeID);
+ // return orderlist;
+ //}
+
+ /////
+ ///// 物料拉动_确认接受
+ /////
+ /////
+ //private string AffirmReceive(string opName, string DistributionNums)
+ //{
+ // string text = "";
+ // try
+ // {
+ // bool falg = false;
+ // //string DistributionNums = HttpContext.Current.Request["DistributionNums"];
+ // string[] array = DistributionNums.Split(',');
+ // string DistributionNum = "";
+ // for (int i = 0; i < array.Length; i++)
+ // {
+ // DistributionNum = array[i];
+ // falg = MaterialPull.DistributionNum(opName, DistributionNum);
+ // }
+ // if (falg)
+ // {
+ // text = "{\"falg\":\"1\"}";
+ // }
+ // else
+ // {
+ // text = "{\"falg\":\"0\"}";
+ // }
+ // }
+ // catch (Exception err)
+ // {
+ // //////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:AffirmReceive");
+ // }
+ // return text;
+ //}
+
+ /////
+ ///// 设备管理_设备保养记录增加
+ /////
+ /////
+ //private string equipmentmanagementSubmit(string opname, string mark)
+ //{
+ // string text = "";
+ // try
+ // {
+ // bool flag;
+ // // string mark = HttpContext.Current.Request["mark"];
+ // flag = bizFacade.MES_MachineManage.Mes_MachineTakeCare_Insert(opname, mark);
+ // if (flag)
+ // {
+ // text = "{\"flag\":\"1\"}";
+ // }
+ // else
+ // {
+ // text = "{\"flag\":\"0\"}";
+ // }
+ // }
+ // catch (Exception err)
+ // {
+ // ////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:equipmentmanagementSubmit");
+ // }
+ // return text;
+ //}
+
+ /////
+ ///// 获取对应工位的质量数据
+ /////
+ /////
+ //private string QualityDataSelect(string opName, string opname)
+ //{
+ // string qualitydata = "";
+ // try
+ // {
+ // System.Data.DataTable dt = null;
+ // //string opName = HttpContext.Current.Request["value"];
+ // //string opname = HttpContext.Current.Request["opname"];
+ // MES.QualityDataSelect(opName, opname, out dt);
+ // if (dt != null)
+ // {
+ // if (dt.Rows.Count > 0)
+ // {
+ // qualitydata = JsonHelper.CreateJsonParameters(dt);
+ // }
+ // }
+ // }
+ // catch (Exception err)
+ // {
+ // ////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:QualityDataSelect");
+ // }
+ // return qualitydata;
+ //}
+
+
+
+ ///// 获取设备保养类型
+ /////
+ /////
+ //private string LoadMachineType(string opName)
+ //{
+ // string Maintain = "";
+ // try
+ // {
+ // System.Data.DataTable dt = null;
+ // //string opName = HttpContext.Current.Request["value"];
+ // MES.LoadMachineType(opName, out dt);
+ // if (dt.Rows.Count > 0)
+ // {
+ // Maintain = JsonHelper.DataTableToJson(dt);
+ // }
+ // }
+ // catch (Exception err)
+ // {
+ // ////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:LoadMachineType");
+ // }
+ // return Maintain;
+ //}
+
+
+ ///// 获取设备保养内容
+ /////
+ /////
+ //private string ShowMaintainData(string opName, string MachineType)
+ //{
+ // string Maintain = "";
+ // try
+ // {
+ // System.Data.DataTable dt = null;
+ // //string opName = HttpContext.Current.Request["value"];
+ // //string MachineType = HttpContext.Current.Request["machinetype"];
+ // MES.ShowMaintainData(opName, MachineType, out dt);
+ // if (dt.Rows.Count > 0)
+ // {
+ // Maintain = JsonHelper.CreateJsonParameters(dt);
+ // }
+ // }
+ // catch (Exception err)
+ // {
+ // ////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:ShowMaintainData");
+ // }
+ // return Maintain;
+ //}
+
+ /////
+ ///// 获取设备保养图片
+ /////
+ /////
+ //private string ShowMaintainPic(string opName, string MachineType)
+ //{
+ // string Maintain = "";
+ // try
+ // {
+ // //string opName = HttpContext.Current.Request["value"];
+ // //string MachineType = HttpContext.Current.Request["machinetype"];
+ // byte[] imgBytesIn;
+ // MES.GetMaintainImageFile(opName, MachineType, out imgBytesIn);
+ // if (imgBytesIn == null)
+ // {
+ // return Maintain;
+ // }
+ // Maintain = Convert.ToBase64String(imgBytesIn);
+ // }
+ // catch (Exception err)
+ // {
+ // ////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:ShowMaintainPic");
+ // }
+ // return Maintain;
+ //}
+
+ /////
+ ///// 物料ando复位
+ /////
+ /////
+ //private string submitAndoMaterialReset(string opname, string andoTypeCode, string andoListCode, string number)
+ //{
+ // string text = "";
+ // try
+ // {
+ // string number1 = "";
+ // //string andoTypeCode = HttpContext.Current.Request["andoTypeCode"];
+ // //string andoListCode = HttpContext.Current.Request["andoListCode"];
+ // //string number = HttpContext.Current.Request["number"];
+
+ // string[] number_array = number.Split(',');
+ // string number_value = "";
+ // string callInfo = "复位信息";
+
+ // for (int i = 0; i < number_array.Length - 1; i++)
+ // {
+ // number_value = number_array[i].ToString();
+ // string[] valuelist = number_value.Split('_');
+ // if (valuelist.Length >= 4)
+ // {
+ // number1 = valuelist[3];
+ // bizFacade.ando_matertial.AndoMaterialReset(opname, number1, andoTypeCode, andoListCode, callInfo);
+ // }
+ // }
+ // }
+ // catch (Exception err)
+ // {
+ // ////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:submitAndoMaterialReset");
+ // }
+
+ // return text;
+ //}
+
+ /////
+ ///// ando界面_质量ando复位
+ /////
+ /////
+ //private string submitAndoQualityReset(string opname, string andoTypeCode, string andoListCode, string number)
+ //{
+ // string text = "";
+ // try
+ // {
+ // string number1 = "";
+ // //string andoTypeCode = HttpContext.Current.Request["andoTypeCode"];
+ // //string andoListCode = HttpContext.Current.Request["andoListCode"];
+ // //string number = HttpContext.Current.Request["number"];
+ // string[] valuelist = number.Split('_');
+ // if (valuelist.Length >= 4)
+ // {
+ // number1 = valuelist[3];
+ // }
+
+ // //呼叫内容
+ // string callInfo = "复位信息";
+ // bool flag = bizFacade.ando_matertial.AndoMaterialReset(opname, number1, andoTypeCode, andoListCode, callInfo);
+ // if (flag)
+ // {
+ // text = "{\"flag\":\"1\"}";
+ // }
+ // else
+ // {
+ // text = "{\"flag\":\"0\"}";
+ // }
+ // }
+ // catch (Exception err)
+ // {
+ // ////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:submitAndoQualityReset");
+ // }
+ // return text;
+ //}
+
+ /////
+ ///// 物料ando_更新ando的具体的tabel
+ /////
+ /////
+ //private string updataAndoMaterialTabel(string opname, string andoTypeCode)
+ //{
+ // string text = "";
+ // try
+ // {
+ // //string andoTypeCode = HttpContext.Current.Request["andoTypeCode"];
+ // text = bizFacade.ando_matertial.CreatAndo_Material_table(opname, andoTypeCode);
+ // }
+ // catch (Exception err)
+ // {
+ // ////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:updataAndoMaterialTabel");
+ // }
+ // return text;
+ //}
+
+ /////
+ ///// 质量ando_更新ando的具体的tabel
+ /////
+ /////
+ //private string updataAndoQualityTabel(string opname, string andoTypeCode)
+ //{
+ // string text = "";
+ // try
+ // {
+ // // string andoTypeCode = HttpContext.Current.Request["andoTypeCode"];
+ // text = bizFacade.ando_quality.CreatAndo_quality_table(opname, andoTypeCode);
+ // }
+ // catch (Exception err)
+ // {
+ // ////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:updataAndoQualityTabel");
+ // }
+ // return text;
+ //}
+
+ /////
+ ///// ando界面_提交物料ando信息(插入呼叫信息)
+ /////
+ /////
+ //private string submitAndoMaterialCall(string opname, string andoTypeCode, string andoListCode, string number)
+ //{
+ // string text = "";
+ // try
+ // {
+ // string number1 = "";
+ // //System.Data.DataTable tb;
+ // //string andoTypeCode = HttpContext.Current.Request["andoTypeCode"];
+ // //string andoListCode = HttpContext.Current.Request["andoListCode"];
+ // //string number = HttpContext.Current.Request["number"];
+ // string[] number_array = number.Split(',');
+ // string number_value = "";
+ // string callInfo = "0";
+ // int callCount = 0;
+ // string cardNumber = "0";
+ // string noNumber = "0";
+
+ // for (int i = 0; i < number_array.Length - 1; i++)
+ // {
+ // number_value = number_array[i].ToString();
+ // string[] valuelist = number_value.Split('_');
+ // if (valuelist.Length >= 4)
+ // {
+ // number1 = valuelist[3];
+ // bizFacade.ando_matertial.andoMaterialCall(opname, andoTypeCode, andoListCode, number1, callInfo, callCount, cardNumber, noNumber);
+ // }
+ // }
+ // }
+ // catch (Exception err)
+ // {
+ // ////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:submitAndoMaterialCall");
+ // }
+ // return text;
+ //}
+
+ /////
+ ///// 安东界面_质量ando_呼叫提交
+ /////
+ /////
+ //private string submitAndoQualityCall()
+ //{
+ // string text = "";
+ // //string number1 = "";
+ // //string opname = HttpContext.Current.Request["opname"];
+ // //string andoTypeCode = HttpContext.Current.Request["andoTypeCode"];
+ // //string andoListCode = HttpContext.Current.Request["andoListCode"];
+ // //string number = HttpContext.Current.Request["number"];
+ // //string[] valuelist = number.Split('_');
+ // //if (valuelist.Length >= 4)
+ // //{
+ // // number1 = valuelist[3];
+ // //}
+ // //string callInfo = "0";
+ // //int callCount = 5;
+ // //string cardNumber = "0";
+ // //string noNumber = "0";
+ // //bool flag = bizFacade.ando_matertial.andoMaterialCall(opname, andoTypeCode, andoListCode, number1, callInfo, callCount, cardNumber, noNumber);
+ // //if (flag)
+ // //{
+ // // text = "{\"flag\":\"1\"}";
+ // //}
+ // //else
+ // //{
+ // // text = "{\"flag\":\"0\"}";
+ // //}
+ // return text;
+ //}
+
+ /////
+ ///// 查询物料ando条数,为了左移动的
+ /////
+ /////
+ //private string InitMaterailAndoCount(string opname, string andoTypeCode)
+ //{
+ // string text = "";
+ // try
+ // {
+ // System.Data.DataTable dt_material;
+ // System.Data.DataTable dt_quality;
+ // System.Data.DataTable dt_machine;
+ // //string andoTypeCode = HttpContext.Current.Request["andoTypeCode"];
+ // //查询物料ando具体的button个数
+ // bizFacade.ando_matertial.andoListSelect(opname, "1", out dt_material);
+ // int count_material = 0;
+
+ // //不为空
+ // if (dt_material != null)
+ // {
+ // if (dt_material.Rows.Count == 0)
+ // {
+ // count_material = 0;
+ // }
+ // else
+ // {
+ // count_material = dt_material.Rows.Count;
+ // }
+ // }
+ // //查询质量ando具体的button个数
+ // bizFacade.ando_matertial.andoListSelect(opname, "2", out dt_quality);
+ // int count_quality = 0;
+ // if (dt_quality != null)
+ // {
+ // if (dt_quality.Rows.Count == 0)
+ // {
+ // count_quality = 0;
+ // }
+ // else
+ // {
+ // count_quality = dt_quality.Rows.Count;
+ // }
+ // }
+ // //查询设备ando具体的button个数
+ // bizFacade.ando_matertial.andoListSelect(opname, "3", out dt_machine);
+
+ // int count_machine = 0;
+ // if (dt_machine != null)
+ // {
+ // if (dt_machine.Rows.Count == 0)
+ // {
+ // count_machine = 0;
+ // }
+ // else
+ // {
+ // count_machine = dt_machine.Rows.Count;
+ // }
+ // }
+ // text = "{\"material_count\":\"" + count_material + "\",\"machine_count\":\"" + count_machine + "\",\"quality_count\":\"" + count_quality + "\"}";
+ // }
+ // catch (Exception err)
+ // {
+ // ////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:InitMaterailAndoCount");
+ // }
+ // return text;
+ //}
+
+ /////
+ ///// 初始化ando
+ /////
+ /////
+ //private string InitMaterailAndo(string opname)
+ //{
+ // string text = "";
+ // try
+ // {
+ // text = bizFacade.ando_load.ando_loading(opname);
+ // }
+ // catch (Exception err)
+ // {
+ // ////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:InitMaterailAndo");
+ // }
+ // return text;
+ //}
+
+ /////
+ ///// ando_查询具体ando类型明细
+ /////
+ /////
+ //private string InitComboboxAndoDetail()
+ //{
+ // string text = "";
+ // //System.Data.DataTable dt = null;
+ // //string andoType="1";
+ // //bizFacade.ando.select_ando_detail(andoType, out dt);
+ // //text = JsonHelper.DataTableToJson(dt);
+ // return text;
+ //}
+
+ /////
+ ///// 初始化装配线MES
+ /////
+ /////
+ //private string MesloadingSelect(string opname, string languageType, string mainModule)
+ //{
+ // string text = "";
+ // try
+ // {
+ // System.Data.DataTable dt = null;
+
+ // //string languageType = HttpContext.Current.Request["mainModule"];
+ // //string mainModule = HttpContext.Current.Request["MesWebCode"];
+ // bizFacade.MES_Loading.MES_Loading_select(languageType, mainModule, opname, out dt);
+ // if (dt != null)
+ // {
+ // if (dt.Rows.Count > 0)
+ // {
+ // text = JsonHelper.DataTableToJson(dt);
+ // }
+ // }
+ // }
+ // catch (Exception err)
+ // {
+ // ////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:MesloadingSelect");
+ // }
+ // return text;
+ //}
+
+
+
+ /////
+ ///// 查询物料库存信息
+ /////
+ /////
+ //private string MaterialListStock(string OpName)
+ //{
+ // string jsonStr_Materail = "";
+ // try
+ // {
+ // string orderNum = "";
+ // int EngineTypeID = 0;
+ // string EngineType = "";
+ // string EngineID = "";
+ // string PartPallet_Code = "";
+ // int IsrepairBarcode = 0;
+ // string repairBarcode = "";
+ // string EngineTypeString = "";
+ // MisDataFun.Moby_Select(OpName, out orderNum, out EngineTypeID, out EngineType, out EngineID, out PartPallet_Code, out IsrepairBarcode, out repairBarcode, out EngineTypeString);
+ // DataTable dt_Material;
+
+ // MisDataFun.PartMaterialVerify_Select(OpName, EngineTypeID, EngineType, out dt_Material);
+ // if (dt_Material != null)
+ // {
+ // if (dt_Material.Rows.Count > 0)
+ // {
+ // jsonStr_Materail = JsonHelper.CreateJsonParameters(dt_Material);
+ // }
+ // }
+ // }
+ // catch (Exception err)
+ // {
+ // ////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:MaterialList");
+ // }
+ // return jsonStr_Materail;
+ //}
+
+
+
+
+
+ /////
+ ///// 获得工步属性
+ /////
+ /////
+ //private string StepProperty(string opName)
+ //{
+ // string stepProperty = "512";
+ // System.Data.DataTable dt = null;
+ // bizFacade.UserLogin.GetUrl(opName, out dt);
+ // if (dt != null)
+ // {
+ // if (dt.Rows.Count > 0)
+ // {
+ // stepProperty = dt.Rows[0]["工步属性"].ToString();
+ // }
+ // }
+ // return stepProperty;
+ //}
+
+
+
+ //private static string CreateJsonParameters(DataTable dt)
+ //{
+ // StringBuilder JsonString = new StringBuilder();
+ // //Exception Handling
+ // if (dt != null)
+ // {
+ // JsonString.Append("{ ");
+ // JsonString.Append("\"total\":");
+ // JsonString.Append(dt.Rows.Count);
+ // JsonString.Append(",");
+ // JsonString.Append("\"rows\":[ ");
+ // for (int i = 0; i < dt.Rows.Count; i++)
+ // {
+ // JsonString.Append("{ ");
+ // for (int j = 0; j < dt.Columns.Count; j++)
+ // {
+ // if (j < dt.Columns.Count - 1)
+ // {
+ // //if (dt.Rows[i][j] == DBNull.Value) continue;
+ // if (dt.Columns[j].DataType == typeof(bool))
+ // {
+ // JsonString.Append("\"JSON_" + dt.Columns[j].ColumnName.ToLower() + "\":" +
+ // dt.Rows[i][j].ToString().ToLower() + ",");
+ // }
+ // else if (dt.Columns[j].DataType == typeof(string))
+ // {
+ // JsonString.Append("\"JSON_" + dt.Columns[j].ColumnName.ToLower() + "\":" + "\"" +
+ // dt.Rows[i][j].ToString().Replace("\"", "\\\"") + "\",");
+ // }
+ // else
+ // {
+ // JsonString.Append("\"JSON_" + dt.Columns[j].ColumnName.ToLower() + "\":" + "\"" + dt.Rows[i][j] + "\",");
+ // }
+ // }
+ // else if (j == dt.Columns.Count - 1)
+ // {
+ // //if (dt.Rows[i][j] == DBNull.Value) continue;
+ // if (dt.Columns[j].DataType == typeof(bool))
+ // {
+ // JsonString.Append("\"JSON_" + dt.Columns[j].ColumnName.ToLower() + "\":" +
+ // dt.Rows[i][j].ToString().ToLower());
+ // }
+ // else if (dt.Columns[j].DataType == typeof(string))
+ // {
+ // JsonString.Append("\"JSON_" + dt.Columns[j].ColumnName.ToLower() + "\":" + "\"" +
+ // dt.Rows[i][j].ToString().Replace("\"", "\\\"") + "\"");
+ // }
+ // else
+ // {
+ // JsonString.Append("\"JSON_" + dt.Columns[j].ColumnName.ToLower() + "\":" + "\"" + dt.Rows[i][j] + "\"");
+ // }
+ // }
+ // }
+ // /*end Of String*/
+ // if (i == dt.Rows.Count - 1)
+ // {
+ // JsonString.Append("} ");
+ // }
+ // else
+ // {
+ // JsonString.Append("}, ");
+ // }
+ // }
+ // JsonString.Append("]");
+ // JsonString.Append("}");
+ // return JsonString.ToString().Replace("\n", "");
+ // }
+ // else
+ // {
+ // return null;
+ // }
+ //}
+
+ /////
+ ///// 获得机型
+ /////
+ /////
+ //private string Orderenginetypeselect()
+ //{
+ // string enginetypelist = "";
+ // try
+ // {
+ // System.Data.DataTable dt = null;
+ // ShaftPosition.EngineType_Select(out dt);
+ // if (dt != null)
+ // {
+ // if (dt.Rows.Count > 0)
+ // {
+ // enginetypelist = JsonHelper.DataTableToJson(dt);
+ // }
+ // }
+ // }
+ // catch (Exception err)
+ // {
+ // ////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:Orderenginetypeselect");
+ // }
+ // return enginetypelist;
+ //}
+
+ /////
+ ///// 物料拉动_获取单号
+ /////
+ /////
+ //private string MaterialPush_ListNumer(string opName)
+ //{
+ // string listNumber = "";
+ // try
+ // {
+ // System.Data.DataTable dt = null;
+ // MaterialPull.MaterialPush_ListNumer_Select(0, "", 1, opName, 0, "", out dt);
+ // if (dt != null)
+ // {
+ // if (dt.Rows.Count > 0)
+ // {
+ // listNumber = JsonHelper.CreateJsonParameters(dt);
+ // }
+ // }
+ // }
+ // catch (Exception err)
+ // {
+ // ////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:MaterialPush_ListNumer");
+ // }
+ // return listNumber;
+ //}
+
+ /////
+ ///// 物料拉动_根据单号获取详细信息
+ /////
+ /////
+ //private string MaterialPush_Details(string opname, string listNumer)
+ //{
+ // string listDetails = "";
+ // try
+ // {
+ // System.Data.DataTable dt = null;
+ // //单号
+ // //string listNumer = HttpContext.Current.Request["listNumber"];
+ // MaterialPull.MaterialPush_Details_Select(listNumer, opname, out dt);
+ // if (dt != null)
+ // {
+ // if (dt.Rows.Count > 0)
+ // {
+ // listDetails = JsonHelper.CreateJsonParameters(dt);
+ // }
+ // }
+ // }
+ // catch (Exception err)
+ // {
+ // ////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:MaterialPush_Details");
+ // }
+ // return listDetails;
+ //}
+
+ /////
+ ///// 物料拉动_根据单号获取详细信息
+ /////
+ /////
+ //private string QualityDataButton_bgColor_Select(string opname)
+ //{
+ // string text = "";
+ // try
+ // {
+ // System.Data.DataTable dt = null;
+ // //单号
+ // MES.QualityDataButton_bgColor_Select(opname, out dt);
+ // if (dt != null)
+ // {
+ // if (dt.Rows.Count >= 0)
+ // {
+ // text = Buttons.Createbuttons(dt);
+ // }
+ // }
+ // }
+ // catch (Exception err)
+ // {
+ // ////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:QualityDataButton_bgColor_Select");
+ // }
+ // return text;
+ //}
+
+
+
+
+
+ /////
+ ///// 获取生产订单
+ /////
+ /////
+ //private string GetOrderForm(string opname)
+ //{
+ // string text = "";
+ // try
+ // {
+ // System.Data.DataTable dt = null;
+ // MES.OpName_MIS_OrderForm_Select(opname, out dt);
+ // if (dt != null)
+ // {
+ // if (dt.Rows.Count > 0)
+ // {
+ // text = dt.Rows[0]["订单号"].ToString();
+ // return text;
+ // }
+ // }
+ // }
+ // catch (Exception err)
+ // {
+ // ////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:GetOrderForm");
+ // }
+ // return text;
+ //}
+
+ /////
+ ///// 获取发动机型号
+ /////
+ /////
+ //private string GetEngineType(string opname)
+ //{
+ // string text = "";
+ // try
+ // {
+ // System.Data.DataTable dt = null;
+ // MES.OpName_MIS_EngineType_Select(opname, out dt);
+ // if (dt != null)
+ // {
+ // if (dt.Rows.Count > 0)
+ // {
+ // text = dt.Rows[0]["产品型号代码"].ToString() + "&" + dt.Rows[0]["发动机型号"].ToString();
+ // return text;
+ // }
+ // }
+ // }
+ // catch (Exception err)
+ // {
+ // ////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:GetEngineType");
+ // }
+ // return ("" + "&" + "");
+ //}
+
+ /////
+ /////
+ /////
+ /////
+ //private string ShowOpNameMessage(string opname)
+ //{
+ // string text = "";
+ // try
+ // {
+ // System.Data.DataTable dt = null;
+ // BaseDataSystemMES.GetOpNameByOpName(opname, out dt);
+ // if (dt != null)
+ // {
+ // if (dt.Rows.Count > 0)
+ // {
+ // text = dt.Rows[0]["工序名称"].ToString() + "&" + dt.Rows[0]["操作者工号"].ToString() + "&" + dt.Rows[0]["是否启用物料拉动"].ToString();
+ // return text;
+ // }
+ // }
+ // }
+ // catch (Exception err)
+ // {
+ // ////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:ShowOpNameMessage");
+ // }
+ // return ("" + "&" + "" + "&" + "0");
+ //}
+
+ /////
+ ///// 系统初始化时
+ /////
+ /////
+ //private string WebLoginIn(string opname)
+ //{
+ // string text = "";
+ // MES.WebLoginIn(opname);
+ // return text;
+ //}
+
+
+
+ /////
+ ///// 获取对应工位的物料数据
+ /////
+ /////
+ //private string MaterialDataSelect(string opName, string opname)
+ //{
+ // string qualitydata = "";
+ // try
+ // {
+ // System.Data.DataTable dt = null;
+ // //string opName = HttpContext.Current.Request["value"];
+ // //string opname = HttpContext.Current.Request["opname"];
+ // MES.MaterialDataSelect(opName, opname, out dt);
+ // if (dt != null)
+ // {
+ // //if (dt.Rows.Count > 0)
+ // {
+ // qualitydata = JsonHelper.CreateJsonParameters(dt);
+ // }
+ // }
+ // }
+ // catch (Exception err)
+ // {
+ // ////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:MaterialDataSelect");
+ // }
+ // return qualitydata;
+ //}
+
+ /////
+ ///// 电子看板_装配零件_查询
+ /////
+ /////
+ //private string MaterialSelect(string opName, string enginetypeid, string enginetype)
+ //{
+ // string text = "";
+ // try
+ // {
+ // System.Data.DataTable dt = null;
+ // //string enginetypeid = HttpContext.Current.Request["enginetypeid"];
+ // //string enginetype = HttpContext.Current.Request["enginetype"];
+ // ShaftPosition.Material_Select(opName, enginetypeid, enginetype, out dt);
+
+ // if (dt != null)
+ // {
+ // if (dt.Rows.Count > 0)
+ // {
+ // text = JsonHelper.CreateJsonParameters(dt);
+ // }
+ // }
+ // }
+ // catch (Exception err)
+ // {
+ // //ApplicationLog.WriteLog(err, "MesWebFun_baseFun:MaterialSelect");
+ // }
+ // return text;
+ //}
+
+ //public string GetLoginOutUrl()
+ //{
+ // string url = System.Configuration.ConfigurationManager.AppSettings["Linklogin"].ToString();
+ // return url;
+ //}
+
+ /////
+ ///// 手动修改批次信息
+ /////
+ /////
+ //private string MaterialManualUpdateBetch(string opName,string arrays, string enginetype)
+ //{
+ // string text = "";
+ // try
+ // {
+ // //string arrays = HttpContext.Current.Request["arrays"];//组合
+ // //string enginetype = HttpContext.Current.Request["enginetype"];//产品型号
+
+ // //创建datatable
+ // DataRow row;
+ // DataTable dt = new DataTable();
+ // dt.Columns.AddRange(new DataColumn[] {
+ // new DataColumn("零件图号"),
+ // new DataColumn("零件批号"),
+ // new DataColumn("生产厂家") });
+
+ // string[] collection = arrays.Split('^');//获取
+ // if (collection.Length > 0)
+ // {
+ // for (int i = 0; i < collection.Length; i++)
+ // {
+ // string a = collection[i];
+ // string[] a_array = a.Split('&');
+ // if (a_array.Length > 2)
+ // {
+ // row = dt.NewRow();
+ // string materialid = a_array[0].ToString();
+ // string betch = a_array[1].ToString();
+ // string factory = a_array[2].ToString();
+ // row["零件图号"] = materialid;
+ // row["零件批号"] = betch;
+ // row["生产厂家"] = factory;
+ // dt.Rows.Add(row);
+ // }
+ // }
+
+ // //修改到数据库
+ // if (dt != null)
+ // {
+ // if (dt.Rows.Count > 0)
+ // {
+ // MES.Material_Betch_Update(opName, enginetype, dt);
+ // }
+ // }
+ // }
+ // }
+ // catch (Exception err)
+ // {
+ // //ApplicationLog.WriteLog(err, "MesWebFun_baseFun:MaterialManualUpdateBetch");
+ // }
+ // return text;
+ //}
+
+ /////
+ ///// 获得返修数量信息
+ /////
+ /////
+ //private string GetRepaireNum(string opname)
+ //{
+ // string text = "";
+ // try
+ // {
+ // System.Data.DataTable dt = null;
+ // MES.OpName_MIS_RepiareNum_Select(opname, out dt);
+ // if (dt != null)
+ // {
+ // if (dt.Rows.Count > 0)
+ // {
+ // text = dt.Rows[0]["当前数量"].ToString() + "&" + dt.Rows[0]["设置数量"].ToString();
+ // return text;
+ // }
+ // else
+ // {
+ // return text = "0&0";
+ // }
+ // }
+ // else
+ // {
+ // return text = "0&0";
+ // }
+ // }
+ // catch (Exception err)
+ // {
+ // //ApplicationLog.WriteLog(err, "MesWebFun_baseFun:GetEngineType");
+ // }
+ // return ("" + "&" + "");
+ //}
+
+ /////
+ ///// 插入返修数量
+ /////
+ /////
+ //private string Insert_RepiareNum(string opnameValue, string selectValue)
+ //{
+ // string text = "";
+ // try
+ // {
+ // //string selectValue = HttpContext.Current.Request["CurrentNum"];//选择值
+ // if (selectValue == "")
+ // {
+ // selectValue = "0";
+ // }
+ // int selectValueint = Convert.ToInt32(selectValue);
+ // bool falg = MES.Insert_RepiareNum(opnameValue, selectValueint);
+ // if (falg)
+ // {
+ // text = "{\"falg\":\"1\"}";
+ // }
+ // else
+ // {
+ // text = "{\"falg\":\"0\"}";
+ // }
+ // }
+ // catch (Exception err)
+ // {
+ // //ApplicationLog.WriteLog(err, "MesWebFun_baseFun:Insert_RepiareNum");
+ // }
+ // return text;
+ //}
+
+ /////
+ ///// 初始化返修选择tree数据
+ /////
+ /////
+ //private string Init_TreeData(string opnameValue)
+ //{
+ // string text = "";
+ // try
+ // {
+ // System.Data.DataTable dt;
+ // //string opnameValue = HttpContext.Current.Request["Opname"];//工位号
+ // MES.Init_TreeData(opnameValue, out dt);
+ // if (dt != null)
+ // {
+ // if (dt.Rows.Count > 0)
+ // {
+ // text = JsonHelper.CreateJsonParameters(dt);
+ // }
+ // }
+ // }
+ // catch (Exception err)
+ // {
+ // //ApplicationLog.WriteLog(err, "MesWebFun_baseFun:Init_TreeData");
+ // }
+ // return text;
+ //}
+
+ /////
+ ///// 返修上线--初始化质量数据
+ /////
+ /////
+ //private string Quality_Select_Repair(string OpName, string EngineID)
+ //{
+ // string text = "";
+ // try
+ // {
+ // DataTable dt;
+ // MES.QualitySelect(OpName, EngineID, out dt);
+ // if (dt != null)
+ // {
+ // if (dt.Rows.Count > 0)
+ // {
+ // text = JsonHelper.CreateJsonParameters(dt);
+ // }
+ // }
+ // }
+ // catch (Exception err)
+ // {
+ // //ApplicationLog.WriteLog(err, "MesWebFun_baseFun:Quality_Select_Repair");
+ // }
+ // return text;
+ //}
+
+ /////
+ ///// 返修上线-将选择的根节点数据更新到数据库中
+ /////
+ /////
+ //private string Insert_selectTreeData(string opName, string engineTypeId, string selectIdsArray)
+ //{
+ // string text = "";
+ // try
+ // {
+ // //string engineTypeId = HttpContext.Current.Request["engineTypeId"];//产品型号代码
+ // //string selectIdsArray = HttpContext.Current.Request["selectId"];//选中的节点数据数据
+ // //创建datatable
+ // DataRow row;
+ // DataTable dt = new DataTable();
+ // dt.Columns.AddRange(new DataColumn[] {
+ // new DataColumn("工位号"),
+ // new DataColumn("产品型号代码"),
+ // new DataColumn("序号") });
+ // string[] collection = selectIdsArray.Split(',');//获取
+ // if (collection.Length > 0)
+ // {
+ // for (int i = 0; i < collection.Length - 1; i++)
+ // {
+ // string idValue = collection[i];
+ // row = dt.NewRow();
+ // string opNameValue = opName;
+ // int engineTypeIdValue = Convert.ToInt32(engineTypeId);
+ // int selectId = Convert.ToInt32(idValue);
+ // row["工位号"] = opNameValue;
+ // row["产品型号代码"] = engineTypeIdValue;
+ // row["序号"] = selectId;
+ // dt.Rows.Add(row);
+ // }
+ // //修改到数据库
+ // if (dt != null)
+ // {
+ // if (dt.Rows.Count > 0)
+ // {
+ // MES.Insert_selectTreeData(dt);
+ // }
+ // }
+ // }
+ // }
+ // catch (Exception err)
+ // {
+ // //ApplicationLog.WriteLog(err, "MesWebFun_baseFun:Insert_selectTreeData");
+ // }
+
+ // return text;
+ //}
+
+ /////
+ ///// 质量报警_根据按钮获取详细信息 20170318
+ /////
+ /////
+ //public static string QualityDataButton_bgColor_alert_Select(string opname)
+ //{
+ // string text = "";
+ // try
+ // {
+ // System.Data.DataTable dt = null;
+ // //单号
+ // //string opname = HttpContext.Current.Request["value"];
+ // //string lineout_barcode = HttpContext.Current.Request["lineout_barcode"];
+ // MES.QualityDataButton_bgColor_alert_Select(opname, out dt);
+ // if (dt != null)
+ // {
+ // if (dt.Rows.Count >= 0)
+ // {
+ // text = Buttons.Createbuttons_alert(dt);
+ // }
+ // }
+ // }
+ // catch (Exception err)
+ // {
+ // //ApplicationLog.WriteLog(err, "MesWebFun_baseFun:QualityDataButton_bgColor_alert_Select");
+ // }
+ // return text;
+ //}
+
+ /////
+ ///// 获取对应工位的物料数据_根据发动机 20170319
+ /////
+ /////
+ //private string MaterialDataSelect_F_EnergineID(string opname, string energineID)
+ //{
+ // string qualitydata = "";
+ // try
+ // {
+ // System.Data.DataTable dt = null;
+ // //string energineID = HttpContext.Current.Request["value"];
+ // MES.MaterialDataSelect_F_EnergineID(opname, energineID, out dt);
+ // if (dt != null)
+ // {
+ // if (dt.Rows.Count > 0)
+ // {
+ // qualitydata = JsonHelper.CreateJsonParameters(dt);
+ // }
+ // }
+ // }
+ // catch (Exception err)
+ // {
+ // //ApplicationLog.WriteLog(err, "MesWebFun_baseFun:MaterialDataSelect");
+ // }
+ // return qualitydata;
+ //}
+
+ /////
+ ///// 获取操作指南的PDF路径
+ /////
+ /////
+ //private string GetPdfSrc(string OpName)
+ //{
+ // string PdfSrc = "";
+ // try
+ // {
+ // System.Data.DataTable dt = null;
+
+ // string orderNum = "";
+ // int EngineTypeID = 0;
+ // string EngineType = "";
+ // string EngineID = "";
+ // string PartPallet_Code = "";
+ // int IsrepairBarcode = 0;
+ // string repairBarcode = "";
+ // string EngineTypeString = "";
+ // MisDataFun.Moby_Select(OpName, out orderNum, out EngineTypeID, out EngineType, out EngineID, out PartPallet_Code, out IsrepairBarcode, out repairBarcode, out EngineTypeString);
+ // BaseDataSystemMES.GetPdfSrc(OpName, EngineTypeID.ToString(), out PdfSrc);
+ // }
+ // catch (Exception err)
+ // {
+ // //ApplicationLog.WriteLog(err, "MesWebFun_baseFun:GetPdfSrc");
+ // }
+ // return PdfSrc;
+ //}
+
+
+
+ #region 目前有用的函数
+
+ ///
+ /// 查询托盘信息
+ ///
+ ///
+ public static string MobySelect(string OpName)
+ {
+ string data = "";
+ try
+ {
+ string orderNum = "";
+ int EngineTypeID = 0;
+ string EngineType = "";
+ string EngineID = "";
+ string PartPallet_Code = "";
+ int IsrepairBarcode = 0;
+ string repairBarcode = "";
+ string workCode = ""; // 制造编号
+ string projectName = ""; // 项目名称
+ string splitCode = ""; // 间隔号
+ string unidCode = ""; // 单元号
+ string engineType = ""; // 本体类型
+ string engineTypeModel = ""; // 附件类型
+ string startTime = ""; // 开始时间
+ MisDataFun.Moby_Select(OpName, out orderNum, out EngineTypeID, out EngineType, out EngineID, out PartPallet_Code, out IsrepairBarcode, out repairBarcode,
+ out workCode, out projectName, out splitCode, out unidCode, out engineType, out engineTypeModel, out startTime);
+ data = orderNum + "&" + EngineTypeID + "&" + EngineType + "&" + EngineID + "&" + PartPallet_Code + "&" + IsrepairBarcode + "&" + repairBarcode + "&" +
+ workCode + "&" + projectName + "&" + splitCode + "&" + unidCode + "&" + engineType + "&" + engineTypeModel + "&" + startTime;
+ }
+ catch (Exception err)
+ {
+ ////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:MobySelect");
+ }
+ return data;
+ }
+
+ ///
+ /// 查询操作图片
+ ///
+ ///
+ public static string PictureShow(string OpName)
+ {
+ string data = "";
+ try
+ {
+ string orderNum = "";
+ int EngineTypeID = 0;
+ string EngineType = "";
+ string EngineID = "";
+ string PartPallet_Code = "";
+ int IsrepairBarcode = 0;
+ string repairBarcode = "";
+ string workCode = ""; // 制造编号
+ string projectName = ""; // 项目名称
+ string splitCode = ""; // 间隔号
+ string unidCode = ""; // 单元号
+ string engineType = ""; // 本体类型
+ string engineTypeModel = ""; // 附件类型
+ string startTime = ""; // 开始时间
+ MisDataFun.Moby_Select(OpName, out orderNum, out EngineTypeID, out EngineType, out EngineID, out PartPallet_Code, out IsrepairBarcode, out repairBarcode,
+ out workCode, out projectName, out splitCode, out unidCode, out engineType, out engineTypeModel, out startTime);
+ byte[] imgBytesIn;
+ MisDataFun.GetImageFile(OpName, EngineTypeID, out imgBytesIn);
+ if (imgBytesIn == null)
+ {
+ return data;
+ }
+ data = Convert.ToBase64String(imgBytesIn);
+ }
+ catch (Exception err)
+ {
+ ////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:PictureShow");
+ }
+ return data;
+ }
+
+ ///
+ /// 查询物料
+ ///
+ ///
+ public static string MaterialList(string OpName)
+ {
+ string jsonStr_Materail = "";
+ try
+ {
+ string orderNum = "";
+ int EngineTypeID = 0;
+ string EngineType = "";
+ string EngineID = "";
+ string PartPallet_Code = "";
+ int IsrepairBarcode = 0;
+ string repairBarcode = "";
+ string workCode = ""; // 制造编号
+ string projectName = ""; // 项目名称
+ string splitCode = ""; // 间隔号
+ string unidCode = ""; // 单元号
+ string engineType = ""; // 本体类型
+ string engineTypeModel = ""; // 附件类型
+ string startTime = ""; // 开始时间
+ MisDataFun.Moby_Select(OpName, out orderNum, out EngineTypeID, out EngineType, out EngineID, out PartPallet_Code, out IsrepairBarcode, out repairBarcode,
+ out workCode, out projectName, out splitCode, out unidCode, out engineType, out engineTypeModel, out startTime);
+ DataTable dt_Material;
+ MisDataFun.PartMaterialVerify_Select(OpName, EngineTypeID, EngineType, out dt_Material);
+ if (dt_Material != null)
+ {
+ if (dt_Material.Rows.Count > 0)
+ {
+ jsonStr_Materail = JsonHelper.CreateJsonParameters(dt_Material);
+ }
+ }
+ }
+ catch (Exception err)
+ {
+ ////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:MaterialList");
+ }
+ return jsonStr_Materail;
+ }
+ ///
+ /// 查询操作指南
+ ///
+ ///
+ public static string ProcessList(string OpName)
+ {
+ string jsonStr_Process = "";
+ try
+ {
+ string orderNum = "";
+ int EngineTypeID = 0;
+ string EngineType = "";
+ string EngineID = "";
+ string PartPallet_Code = "";
+ int IsrepairBarcode = 0;
+ string repairBarcode = "";
+ string workCode = ""; // 制造编号
+ string projectName = ""; // 项目名称
+ string splitCode = ""; // 间隔号
+ string unidCode = ""; // 单元号
+ string engineType = ""; // 本体类型
+ string engineTypeModel = ""; // 附件类型
+ string startTime = ""; // 开始时间
+ MisDataFun.Moby_Select(OpName, out orderNum, out EngineTypeID, out EngineType, out EngineID, out PartPallet_Code, out IsrepairBarcode, out repairBarcode,
+ out workCode, out projectName, out splitCode, out unidCode, out engineType, out engineTypeModel, out startTime);
+
+ DataTable dt_Proccess;
+ MisDataFun.Process_Select(OpName, EngineTypeID, EngineType, out dt_Proccess);
+ if (dt_Proccess != null)
+ {
+ if (dt_Proccess.Rows.Count > 0)
+ {
+ jsonStr_Process = JsonHelper.CreateJsonParameters(dt_Proccess);
+ }
+ }
+ }
+ catch (Exception err)
+ {
+ ////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:ProcessList");
+ }
+ return jsonStr_Process;
+ }
+ ///
+ /// 创建动态div
+ ///
+ ///
+ public static string ShaftPotion_Select(string OpName)
+ {
+ string text = "";
+ try
+ {
+ string orderNum = "";
+ int EngineTypeID = 0;
+ string EngineType = "";
+ string EngineID = "";
+ string PartPallet_Code = "";
+ int IsrepairBarcode = 0;
+ string repairBarcode = "";
+ string workCode = ""; // 制造编号
+ string projectName = ""; // 项目名称
+ string splitCode = ""; // 间隔号
+ string unidCode = ""; // 单元号
+ string engineType = ""; // 本体类型
+ string engineTypeModel = ""; // 附件类型
+ string startTime = ""; // 开始时间
+ MisDataFun.Moby_Select(OpName, out orderNum, out EngineTypeID, out EngineType, out EngineID, out PartPallet_Code, out IsrepairBarcode, out repairBarcode,
+ out workCode, out projectName, out splitCode, out unidCode, out engineType, out engineTypeModel, out startTime);
+
+ DataTable dt;
+ MisDataFun.ShaftPositionSelect(OpName, EngineTypeID, out dt);
+ if (dt != null)
+ {
+ if (dt.Rows.Count > 0)
+ {
+ text = JsonHelper.DataTableToJson(dt);
+ }
+ }
+ }
+ catch (Exception err)
+ {
+ ////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:ShaftPotion_Select");
+ }
+ return text;
+ }
+ ///
+ /// 实时显示质量数据
+ ///
+ ///
+ public static string Quality_Select(string OpName)
+ {
+ string text = "";
+ try
+ {
+ string orderNum = "";
+ int EngineTypeID = 0;
+ string EngineType = "";
+ string EngineID = "";
+ string PartPallet_Code = "";
+ int IsrepairBarcode = 0;
+ string repairBarcode = "";
+ string workCode = ""; // 制造编号
+ string projectName = ""; // 项目名称
+ string splitCode = ""; // 间隔号
+ string unidCode = ""; // 单元号
+ string engineType = ""; // 本体类型
+ string engineTypeModel = ""; // 附件类型
+ string startTime = ""; // 开始时间
+ MisDataFun.Moby_Select(OpName, out orderNum, out EngineTypeID, out EngineType, out EngineID, out PartPallet_Code, out IsrepairBarcode, out repairBarcode,
+ out workCode, out projectName, out splitCode, out unidCode, out engineType, out engineTypeModel, out startTime);
+
+ DataTable dt;
+ MisDataFun.QualitySelect(OpName, EngineID, out dt);
+ if (dt != null)
+ {
+ if (dt.Rows.Count > 0)
+ {
+ text = JsonHelper.CreateJsonParameters(dt);
+ }
+ }
+ }
+ catch (Exception err)
+ {
+ ////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:Quality_Select");
+ }
+ return text;
+ }
+ ///
+ /// 订单完工,上线数量大于计划数量,界面提示
+ ///
+ ///
+ private string OrderFormList_OrderComplete(string opName)
+ {
+ string text = "";
+ try
+ {
+ int isCompleted;//订单数量是否完全上线
+ int num_plan;//计划数量
+ int num_complete;//上线数量
+ MisDataFun.Select_OrderFormList_OrderComplete(opName, out isCompleted, out num_plan, out num_complete);
+ text = "{\"isCompleted\":\"" + isCompleted + "\",\"num_plan\":\"" + num_plan + "\",\"num_complete\":\"" + num_complete + "\"}";
+ }
+ catch (Exception err)
+ {
+ ////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:OrderFormList_OrderComplete");
+ }
+ return text;
+ }
+ ///
+ /// 获得订单信息
+ ///
+ ///
+ public static string OrderFormList(string opName)
+ {
+ string orderlist = "";
+ try
+ {
+ System.Data.DataTable dt = null;
+ MisDataFun.OrderFormList_Select(opName, out dt);
+ //对其进行判断
+ if (dt != null)
+ {
+ if (dt.Rows.Count > 0)
+ {
+ int planCount;//计划数量
+ int finishCount;//完成数量
+ int isOverCount;//是否超标,0表示未完成,1表示正好完成,2表示超过预期
+ int isSelect;//选择标志
+ int isCanSelect;//是否有订单选择权限
+ string status;//状态
+ for (int i = 0; i < dt.Rows.Count; i++)
+ {
+ planCount = 0;
+ finishCount = 0;
+ isOverCount = 0;
+ isSelect = 0;
+ isCanSelect = 0;
+ status = "";
+
+ if (dt.Rows[i]["计划数量"].ToString() != "")
+ {
+ planCount = Convert.ToInt32(dt.Rows[i]["计划数量"]);
+ }
+ if (dt.Rows[i]["完成数量"].ToString() != "")
+ {
+ finishCount = Convert.ToInt32(dt.Rows[i]["完成数量"]);
+ }
+ if (dt.Rows[i]["选择标志"].ToString() != "")
+ {
+ isSelect = Convert.ToInt32(dt.Rows[i]["选择标志"]);
+ }
+ if (dt.Rows[i]["订单选择权限"].ToString() != "")
+ {
+ isCanSelect = Convert.ToInt32(dt.Rows[i]["订单选择权限"]);
+ }
+ if (isSelect == 1)//表示选择当前订单,显示"√"
+ {
+ status = "√";
+ }
+ if (finishCount == planCount)//完成数量>计划数量则表示超标
+ {
+ isOverCount = 1;
+ }
+ if (finishCount > planCount)//完成数量>计划数量则表示超标
+ {
+ isOverCount = 2;
+ }
+ //重新赋值
+ dt.Rows[i]["状态"] = status;
+ dt.Rows[i]["是否超标"] = isOverCount;//0表示未完成,1表示正好完成,2表示超过预期
+ dt.Rows[i]["选择标志"] = isSelect;
+ dt.Rows[i]["订单选择权限"] = isCanSelect;
+ }
+ }
+ }
+
+ orderlist = JsonHelper.CreateJsonParameters(dt);
+ //orderlist = CreateJsonParameters(dt);
+ }
+ catch (Exception err)
+ {
+ ////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:OrderFormList");
+ }
+ return orderlist;
+ }
+ ///
+ /// 消息提醒
+ ///
+ ///
+ public static string ShowWindowNotice(string opname)
+ {
+ string text = "";
+ try
+ {
+ System.Data.DataTable dt = null;
+ MisDataFun.ShowWindowNotice(opname, out dt);
+ if (dt != null)
+ {
+ if (dt.Rows.Count > 0)
+ {
+ text = JsonHelper.DataTableToJson(dt);
+ }
+ }
+ }
+ catch (Exception err)
+ {
+ ////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:ShowWindowNotice");
+ }
+ return text;
+ }
+ ///
+ /// 消息滚动
+ ///
+ ///
+ public static string ShowLEDNotice(string opname)
+ {
+ string text = "";
+ try
+ {
+ DataTable dt = null;
+ MisDataFun.ShowLEDNotice(opname, out dt);
+ if (dt != null)
+ {
+ if (dt.Rows.Count > 0)
+ {
+ text = JsonHelper.DataTableToJson(dt);
+ }
+ }
+ }
+ catch (Exception err)
+ {
+ ////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:ShowLEDNotice");
+ }
+ return text;
+ }
+ ///
+ /// 物料检测
+ ///
+ ///
+ public static string MaterialCheckPosition(string OpName)
+ {
+ string text = "";
+ try
+ {
+ DataTable dt;
+ MisDataFun.MaterialCheckSelect(OpName, out dt);
+ if (dt != null)
+ {
+ if (dt.Rows.Count > 0)
+ {
+ text = JsonHelper.DataTableToJson(dt);
+ }
+ }
+ }
+ catch (Exception err)
+ {
+ ////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:MaterialCheckPosition");
+ }
+ return text;
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+ #endregion
+
+
+ }
+}
\ No newline at end of file
diff --git a/Common/09MesDataFunction/MesDataFunction/12SendMessageToWeb/MIS.SendMessage.cs b/Common/09MesDataFunction/MesDataFunction/12SendMessageToWeb/MIS.SendMessage.cs
new file mode 100644
index 0000000..120fb56
--- /dev/null
+++ b/Common/09MesDataFunction/MesDataFunction/12SendMessageToWeb/MIS.SendMessage.cs
@@ -0,0 +1,100 @@
+using System;
+using System.Data;
+using System.Collections;
+//using BasicData;
+////using bizFacade;
+//using SystemFramework;
+using System.Configuration;
+//using MesWork;
+using MQTTnet.Client.Connecting;
+using MQTTnet.Client.Disconnecting;
+using MQTTnet.Client.Receiving;
+using MQTTnet;
+using System.Threading.Tasks;
+
+namespace MesServerFunctions
+{
+ public partial class MIS_SendMessage
+ {
+ ///
+ ///
+ ///
+ public static string MqttTargetTopic = ConfigurationManager.AppSettings["MqttTargetTopic"];
+ ///
+ ///
+ ///
+ static new MesWebFun_base.MisWebInterface misWebInterface = new MesWebFun_base.MisWebInterface();
+ ///
+ ///
+ ///
+ static readonly Object locker = new Object();
+ ///
+ /// 发消息给通讯服务器
+ ///
+ ///
+ public static string asyncSendMessage(string Message)
+ {
+ lock (locker)
+ {
+ //"MES|MachinePlan|OpName|Value
+ var array = Message.Split('|');
+ var cmd = array[1];
+ var opName = array[2];
+ var topic = $"{MqttTargetTopic}/{opName}";
+ Task.Run(() => Mqtt.Publish(topic, Message));
+
+ var responseStr = misWebInterface.WebSocket_Function(Message);
+ if (responseStr.Length > 0)
+ {
+ Task.Run(() => Mqtt.Publish(topic, $"MES|{cmd}_Resources|{opName}|{responseStr}"));
+ }
+ return responseStr;
+ }
+ }
+
+ public static string asyncSendMessageDemo(string Message)
+ {
+ lock (locker)
+ {
+ //"MES|MachinePlan|OpName|Value
+ var array = Message.Split('|');
+ var cmd = array[1];
+ var opName = array[2];
+ var topic = $"{MqttTargetTopic}/{opName}";
+
+ //Mqtt.Publish(topic, Message);
+ string responseStr = "";
+ //var responseStr = misWebInterface.WebSocket_Function(Message);
+ //if (responseStr.Length > 0)
+ //{
+
+ // Mqtt.Publish(topic, $"MES|{cmd}_Resources|{opName}|{responseStr}");
+ //}
+ return responseStr;
+ }
+ }
+
+ ///
+ /// 发消息给通讯服务器
+ ///
+ ///
+ public static string asyncSendMessageQos0(string Message)
+ {
+ lock (locker)
+ {
+ //"MES|MachinePlan|OpName|Value
+ var array = Message.Split('|');
+ var cmd = array[1];
+ var opName = array[2];
+ var topic = $"{MqttTargetTopic}/{opName}";
+ Mqtt.PublishQos0(topic, Message);
+
+ return "";
+ }
+ }
+
+
+
+ }
+}
+
diff --git a/Common/09MesDataFunction/MesDataFunction/12SendMessageToWeb/Mqtt.cs b/Common/09MesDataFunction/MesDataFunction/12SendMessageToWeb/Mqtt.cs
new file mode 100644
index 0000000..e6a69e6
--- /dev/null
+++ b/Common/09MesDataFunction/MesDataFunction/12SendMessageToWeb/Mqtt.cs
@@ -0,0 +1,281 @@
+
+using MQTTnet;
+using MQTTnet.Client;
+using MQTTnet.Client.Connecting;
+using MQTTnet.Client.Disconnecting;
+using MQTTnet.Client.Options;
+using MQTTnet.Client.Receiving;
+using MQTTnet.Extensions.ManagedClient;
+using MQTTnet.Formatter;
+
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace MesServerFunctions
+{
+ public class Mqtt
+ {
+ ///
+ ///
+ ///
+ public static IManagedMqttClient mqttClient = null;
+ public static string MqttUrl = ConfigurationManager.AppSettings["MqttUrl"];
+ ///
+ ///
+ ///
+ public static string topic = "";
+
+
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task StartAsync()
+ {
+ string uri = MqttUrl;
+ //127.0.0.1:18083,123
+ var array = uri.Split(new char[] { ':', ',' });
+ string mqttUser = "MisDataFun";
+ string mqttPassword = "";
+ var options = new MqttClientOptions
+ {
+ ClientId = "MisDataFun-200170511",
+ ProtocolVersion = MqttProtocolVersion.V311,
+ ChannelOptions = new MqttClientTcpOptions { Server = array[0], Port = Convert.ToInt32(array[1]) },
+ CleanSession = false,
+ SessionExpiryInterval = 300,
+ KeepAlivePeriod = TimeSpan.FromSeconds(20),
+ Credentials = new MqttClientCredentials
+ {
+ Username = mqttUser,
+ Password = Encoding.UTF8.GetBytes(mqttPassword)
+ }
+ };
+ mqttClient = new MqttFactory().CreateManagedMqttClient();
+
+ //mqttClient.ConnectedHandler = new MqttClientConnectedHandlerDelegate(OnSubscriberConnected);
+ //mqttClient.DisconnectedHandler = new MqttClientDisconnectedHandlerDelegate(OnSubscriberDisconnected);
+ //mqttClient.ApplicationMessageReceivedHandler = new MqttApplicationMessageReceivedHandlerDelegate(OnSubscriberMessageReceived);
+ await mqttClient.StartAsync(new ManagedMqttClientOptions { ClientOptions = options });
+ topic = array[2];
+ await mqttClient.SubscribeAsync(new MqttTopicFilter { Topic = topic });
+
+ }
+
+
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task Publish(string publish_topic, string publish_msg)
+ {
+ if (mqttClient != null)
+ {
+ try
+ {
+ await mqttClient.PublishAsync(new MqttApplicationMessageBuilder().WithTopic(publish_topic).WithPayload(publish_msg).WithExactlyOnceQoS().Build());
+
+ }
+ catch (Exception err)
+ {
+
+ }
+ }
+ }
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static async Task PublishQos0(string publish_topic, string publish_msg)
+ {
+ if (mqttClient != null)
+ {
+ await mqttClient.PublishAsync(new MqttApplicationMessageBuilder().WithTopic(publish_topic).WithPayload(publish_msg).WithAtLeastOnceQoS().Build());
+ }
+ }
+ ///
+ ///
+ ///
+ ///
+ public static async Task StopAsync()
+ {
+ if (mqttClient != null)
+ {
+ await mqttClient.UnsubscribeAsync(new string[] { topic });
+ await mqttClient.StopAsync();
+ }
+ }
+ /////
+ /////
+ /////
+ /////
+ //private static void OnSubscriberConnected(MqttClientConnectedEventArgs x)
+ //{
+ // var rec = x.AuthenticateResult.ResultCode.ToString();
+ // // label_State.Text = rec;
+ //}
+ /////
+ /////
+ /////
+ /////
+ //private static void OnSubscriberDisconnected(MqttClientDisconnectedEventArgs x)
+ //{
+ // //var rec = x.AuthenticateResult.ResultCode.ToString();
+ // //label_State.Text = rec;
+ //}
+ /////
+ /////
+ /////
+ /////
+ //private static void OnSubscriberMessageReceived(MqttApplicationMessageReceivedEventArgs x)
+ //{
+ // var rec = x.ApplicationMessage.ConvertPayloadToString();
+ // // txt_Rec.Text = txt_Rec.Text + rec + System.Environment.NewLine;
+
+ //}
+
+
+
+ }
+
+ public class Mqtt2
+ {
+ ///
+ ///
+ ///
+ public IManagedMqttClient mqttClient = null;
+ public string MqttUrl;
+ ///
+ ///
+ ///
+ public string topic = "";
+
+ public Mqtt2()
+ {
+ mqttClient = new MqttFactory().CreateManagedMqttClient();
+ }
+ ///
+ ///
+ ///
+ ///
+ ///
+ public async Task StartAsync()
+ {
+ string uri = MqttUrl;
+ //127.0.0.1:18083,123
+ var array = uri.Split(new char[] { ':', ',' });
+ string mqttUser = "";
+ string mqttPassword = "";
+ var options = new MqttClientOptions
+ {
+ ClientId = Guid.NewGuid().ToString(),
+ ProtocolVersion = MqttProtocolVersion.V311,
+ ChannelOptions = new MqttClientTcpOptions { Server = array[0], Port = Convert.ToInt32(array[1]) },
+ CleanSession = true,
+ KeepAlivePeriod = TimeSpan.FromSeconds(100),
+ Credentials = new MqttClientCredentials
+ {
+ Username = mqttUser,
+ Password = Encoding.UTF8.GetBytes(mqttPassword)
+ }
+ };
+ //mqttClient.ConnectedHandler = new MqttClientConnectedHandlerDelegate(OnSubscriberConnected);
+ //mqttClient.DisconnectedHandler = new MqttClientDisconnectedHandlerDelegate(OnSubscriberDisconnected);
+ //mqttClient.ApplicationMessageReceivedHandler = new MqttApplicationMessageReceivedHandlerDelegate(OnSubscriberMessageReceived);
+ await mqttClient.StartAsync(new ManagedMqttClientOptions { ClientOptions = options });
+ //topic = array[2];
+ await mqttClient.SubscribeAsync(new MqttTopicFilter { Topic = topic });
+
+ }
+
+
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public async Task Publish(string publish_topic, string publish_msg)
+ {
+ if (mqttClient != null)
+ {
+ try
+ {
+ await mqttClient.PublishAsync(new MqttApplicationMessageBuilder().WithTopic(publish_topic).WithPayload(publish_msg).WithExactlyOnceQoS().Build());
+
+ }
+ catch (Exception err)
+ {
+
+ }
+ }
+ }
+ //static public async Task Publish(IManagedMqttClient mqttClient_1, string publish_topic, string publish_msg)
+ //{
+ // if (mqttClient_1 != null)
+ // {
+ // try
+ // {
+ // await mqttClient_1.PublishAsync(new MqttApplicationMessageBuilder().WithTopic(publish_topic).WithPayload(publish_msg).WithExactlyOnceQoS().Build());
+
+ // }
+ // catch (Exception err)
+ // {
+
+ // }
+ // }
+ //}
+ ///
+ ///
+ ///
+ ///
+ public async Task StopAsync()
+ {
+ if (mqttClient != null)
+ {
+ await mqttClient.UnsubscribeAsync(new string[] { topic });
+ await mqttClient.StopAsync();
+ }
+ }
+ /////
+ /////
+ /////
+ /////
+ //private static void OnSubscriberConnected(MqttClientConnectedEventArgs x)
+ //{
+ // var rec = x.AuthenticateResult.ResultCode.ToString();
+ // // label_State.Text = rec;
+ //}
+ /////
+ /////
+ /////
+ /////
+ //private static void OnSubscriberDisconnected(MqttClientDisconnectedEventArgs x)
+ //{
+ // //var rec = x.AuthenticateResult.ResultCode.ToString();
+ // //label_State.Text = rec;
+ //}
+ /////
+ /////
+ /////
+ /////
+ //private static void OnSubscriberMessageReceived(MqttApplicationMessageReceivedEventArgs x)
+ //{
+ // var rec = x.ApplicationMessage.ConvertPayloadToString();
+ // // txt_Rec.Text = txt_Rec.Text + rec + System.Environment.NewLine;
+
+ //}
+
+
+
+ }
+}
diff --git a/Common/09MesDataFunction/MesDataFunction/12SendMessageToWeb/SendMessage.cs b/Common/09MesDataFunction/MesDataFunction/12SendMessageToWeb/SendMessage.cs
new file mode 100644
index 0000000..d5d8ee6
--- /dev/null
+++ b/Common/09MesDataFunction/MesDataFunction/12SendMessageToWeb/SendMessage.cs
@@ -0,0 +1,666 @@
+using MisDataFunDll;
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.Data;
+using System.Linq;
+using System.Net.Sockets;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace MesServerFunctions
+{
+
+ ///
+ /// 命令
+ ///显示托盘信息√ case "ShowMoby":
+ ///显示操作指南√ case "ProcessList":
+ ///显示物料√ case "MaterialList":
+ ///显示操作图片√ case "PicShow":
+ ///显示拧紧位置√ case "ShaftPosition":
+ ///实时显示质量数据√ case "ShowTimelyQuality":
+ ///手动拧紧实时显示质量数据√case "ShowTimelyQuality_Tight":
+ ///√ case "OrderFormList":
+ ///弹窗消息√ case "Notice":
+ ///LED消息提醒√ case "ScrollNotice":
+ ///物料检测初始化√ case "MaterialCheckPosition":
+ ///返修质量数据显示√ case "RepairQuality"
+ ///
+ ///
+ public class SendMessage
+ {
+ ///
+ /// MES/InstantMessaging/BQ
+ ///
+ public static string MqttTargetTopic = ConfigurationManager.AppSettings["MqttTargetTopic"];
+
+ ///
+ /// 5 显示订单、机型信息 上线工位
+ ///
+ ///
+ public static void ShowMoby_FirstOpName(string opName)
+ {
+ var topic = $"{MqttTargetTopic}/{opName}";
+ var responseStr = ShowMoby_String_FirstOpName(opName);
+ string cmd = "ShowMoby";
+ if (responseStr.Length > 0)
+ {
+ Task.Run(() => Mqtt.Publish(topic, $"MES|{cmd}_Resources|{opName}|{responseStr}"));
+ }
+ }
+ ///
+ /// 5 显示订单、机型信息 非上线工位
+ ///
+ ///
+ public static void ShowMoby(string opName, int type = 1)
+ {
+ var topic = $"{MqttTargetTopic}/{opName}";
+ var responseStr = ShowMoby_String(opName, type);
+ string cmd = "ShowMoby";
+ if (responseStr.Length > 0)
+ {
+ Task.Run(() => Mqtt.Publish(topic, $"MES|{cmd}_Resources|{opName}|{responseStr}"));
+ }
+ }
+ public static void MaterialList_Dif(string opName, string msgText)
+ {
+ var topic = $"{MqttTargetTopic}/{opName}";
+ string cmd = "MaterialList_Dif";
+ if (msgText.Length > 0)
+ {
+ Task.Run(() => Mqtt.Publish(topic, $"MES|{cmd}_Resources|{opName}|{msgText}"));
+ }
+ }
+ public static void AsyncSendMessage_Notice(string opname, string notice)
+ {
+ //通知Web界面
+ MisDataFun.Web_Notice_Insert(opname, notice);
+ Notice(opname);
+ }
+ public static void Notice(string opName)
+ {
+ var topic = $"{MqttTargetTopic}/{opName}";
+ var responseStr = Notice_String(opName);
+ string cmd = "Notice";
+ if (responseStr.Length > 0)
+ {
+ Task.Run(() => Mqtt.Publish(topic, $"MES|{cmd}_Resources|{opName}|{responseStr}"));
+ }
+ }
+ ///
+ /// 1(直接在界面通过选择机型确认工序内容)
+ ///
+ ///
+ public static void ProcessList(string opName)
+ {
+ var topic = $"{MqttTargetTopic}/{opName}";
+ var responseStr = ProcessList_String(opName);
+ string cmd = "ProcessList";
+ if (responseStr.Length > 0)
+ {
+ Task.Run(() => Mqtt.Publish(topic, $"MES|{cmd}_Resources|{opName}|{responseStr}"));
+ }
+ }
+ public static void ProcessList_FirstOpName(string opName)
+ {
+ var topic = $"{MqttTargetTopic}/{opName}";
+ var responseStr = ProcessList_String_FirstOpName(opName);
+ string cmd = "ProcessList";
+ if (responseStr.Length > 0)
+ {
+ Task.Run(() => Mqtt.Publish(topic, $"MES|{cmd}_Resources|{opName}|{responseStr}"));
+ }
+ }
+ ///
+ /// 2显示物料
+ ///
+ ///
+ public static void MaterialList(string opName)
+ {
+ var topic = $"{MqttTargetTopic}/{opName}";
+ var responseStr = MaterialList_String(opName);
+ string cmd = "MaterialList";
+ if (responseStr.Length > 0)
+ {
+ Task.Run(() => Mqtt.Publish(topic, $"MES|{cmd}_Resources|{opName}|{responseStr}"));
+ }
+
+ }
+ public static void MaterialList_FirstOpName(string opName)
+ {
+ var topic = $"{MqttTargetTopic}/{opName}";
+ var responseStr = MaterialList_String_FirstOpName(opName);
+ string cmd = "MaterialList";
+ if (responseStr.Length > 0)
+ {
+ Task.Run(() => Mqtt.Publish(topic, $"MES|{cmd}_Resources|{opName}|{responseStr}"));
+ }
+
+ }
+ ///
+ /// 3显示操作指导图片
+ ///
+ ///
+ public static void PicShow(string opName)
+ {
+ var topic = $"{MqttTargetTopic}/{opName}";
+ var responseStr = PicShow_String(opName);
+ string cmd = "PicShow";
+ if (responseStr.Length > 0)
+ {
+ Task.Run(() => Mqtt.Publish(topic, $"MES|{cmd}_Resources|{opName}|{responseStr}"));
+ }
+ }
+ public static void PicShow_FirstOpName(string opName)
+ {
+ var topic = $"{MqttTargetTopic}/{opName}";
+ var responseStr = PicShow_String_FirstOpName(opName);
+ string cmd = "PicShow";
+ if (responseStr.Length > 0)
+ {
+ Task.Run(() => Mqtt.Publish(topic, $"MES|{cmd}_Resources|{opName}|{responseStr}"));
+ }
+ }
+
+ ///
+ /// 4订单完工模块刷新完成数量
+ ///
+ ///
+ public static void OrderFormList(string opName)
+ {
+ var topic = $"{MqttTargetTopic}/{opName}";
+ var responseStr = OrderFormList_String();
+ string cmd = "OrderFormList";
+ if (responseStr.Length > 0)
+ {
+ Task.Run(() => Mqtt.Publish(topic, $"MES|{cmd}_Resources|{opName}|{responseStr}"));
+ }
+ }
+
+ //实时显示质量数据√
+ public static void ShowTimelyQuality(string opName)
+ {
+
+ }
+
+ public static void SendActuallyCount(string OpName, int tagValue)
+ {
+ //当工件离开时,更新在线产量、在线节拍
+ //if (tagValue == 0)
+ {
+ try
+ {
+ int opNameCount = 0;//在线产量
+ int opNameCountTime = 0;//在线节拍
+
+ MisDataFun.OpNameCount_BQ(OpName, out opNameCount, out opNameCountTime); //基本数据_工作日历_班次产量查询_New
+
+ SendInfomation("ActuallyCount", opNameCount.ToString() + "&" + opNameCountTime.ToString(), OpName);
+
+ }
+ catch (Exception err)
+ {
+ ////ApplicationLog.WriteLog(err, "Function01:SendActuallyCount");
+ }
+ }
+ }
+
+ public static void SendInfomation(string Command, string Value, string OpName)
+ {
+
+ string SendMessage = "MES|" + Command + "|" + OpName + "|" + Value;
+ AsyncSendMessage(SendMessage);
+ }
+
+ public static void AsyncSendMessage(string Message)
+ {
+ //lock (locker)
+ {
+ //"MES|MachinePlan|OpName|Value
+ var array = Message.Split('|');
+ var cmd = array[1];
+ var opName = array[2];
+ var topic = $"{MqttTargetTopic}/{opName}";
+ Task.Run(() => Mqtt.Publish(topic, Message));
+
+ }
+
+
+ }
+ private static string ProcessList_String(string OpName)
+ {
+ string jsonStr_Process = "";
+ try
+ {
+ string orderNum = "";
+ int EngineTypeID = 0;
+ string EngineType = "";
+ string EngineID = "";
+ string PartPallet_Code = "";
+ int IsrepairBarcode = 0;
+ string repairBarcode = "";
+ string EngineTypeString = "";
+ DataTable dt_Proccess;
+
+ MisDataFun.Moby_Select(OpName, out orderNum, out EngineTypeID, out EngineType, out EngineID, out PartPallet_Code, out IsrepairBarcode, out repairBarcode, out EngineTypeString);
+ MisDataFun.Process_Select(OpName, EngineTypeID, EngineType, out dt_Proccess);
+ if (dt_Proccess != null)
+ {
+ if (dt_Proccess.Rows.Count > 0)
+ {
+ jsonStr_Process = JsonHelper.CreateJsonParameters(dt_Proccess);
+ }
+ }
+ }
+ catch (Exception err)
+ {
+ ////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:ProcessList");
+ }
+ return jsonStr_Process;
+ }
+ private static string ProcessList_String_FirstOpName(string OpName)
+ {
+ string jsonStr_Process = "";
+ try
+ {
+ string orderNum = "";
+ int EngineTypeID = 0;
+ string EngineType = "";
+ string EngineID = "";
+ string PartPallet_Code = "";
+ int IsrepairBarcode = 0;
+ string repairBarcode = "";
+ string EngineTypeString = "";
+ DataTable dt_Proccess;
+
+ MisDataFun.Moby_Select(OpName, out orderNum, out EngineTypeID, out EngineType, out EngineID, out PartPallet_Code, out IsrepairBarcode, out repairBarcode, out EngineTypeString);
+ MisDataFun.Process_Select(OpName, EngineTypeID, EngineType, out dt_Proccess);
+ if (dt_Proccess != null)
+ {
+ if (dt_Proccess.Rows.Count > 0)
+ {
+ jsonStr_Process = JsonHelper.CreateJsonParameters(dt_Proccess);
+ }
+ }
+ }
+ catch (Exception err)
+ {
+ ////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:ProcessList");
+ }
+ return jsonStr_Process;
+ }
+ //
+ private static string PicShow_String(string OpName)
+ {
+ string data = "";
+ try
+ {
+ string orderNum = "";
+ int EngineTypeID = 0;
+ string EngineType = "";
+ string EngineID = "";
+ string PartPallet_Code = "";
+ int IsrepairBarcode = 0;
+ string repairBarcode = "";
+ string EngineTypeString = "";
+ byte[] imgBytesIn;
+ MisDataFun.Moby_Select(OpName, out orderNum, out EngineTypeID, out EngineType, out EngineID, out PartPallet_Code, out IsrepairBarcode, out repairBarcode, out EngineTypeString);
+ MisDataFun.GetImageFile(OpName, EngineTypeID, out imgBytesIn);
+ if (imgBytesIn == null)
+ {
+ return data;
+ }
+ data = Convert.ToBase64String(imgBytesIn);
+ }
+ catch (Exception err)
+ {
+ ////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:PictureShow");
+ }
+ return data;
+ }
+
+ private static string PicShow_String_FirstOpName(string OpName)
+ {
+ string data = "";
+ try
+ {
+ string orderNum = "";
+ int EngineTypeID = 0;
+ string EngineType = "";
+ string EngineID = "";
+ string PartPallet_Code = "";
+ int IsrepairBarcode = 0;
+ string repairBarcode = "";
+ string EngineTypeString = "";
+ byte[] imgBytesIn;
+ MisDataFun.Moby_Select(OpName, out orderNum, out EngineTypeID, out EngineType, out EngineID, out PartPallet_Code, out IsrepairBarcode, out repairBarcode, out EngineTypeString);
+ MisDataFun.GetImageFile(OpName, EngineTypeID, out imgBytesIn);
+ if (imgBytesIn == null)
+ {
+ return data;
+ }
+ data = Convert.ToBase64String(imgBytesIn);
+ }
+ catch (Exception err)
+ {
+ ////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:PictureShow");
+ }
+ return data;
+ }
+ ///
+ /// 上线工位
+ ///
+ ///
+ ///
+ private static string ShowMoby_String(string OpName, int type = 1)
+ {
+ string data = "";
+ try
+ {
+ string orderNum = "";
+ int EngineTypeID = 0;
+ string EngineType = "";
+ string EngineID = "";
+ string PartPallet_Code = "";
+ int IsrepairBarcode = 0;
+ string repairBarcode = "";
+ string EngineTypeString = "";
+ //非上线工位
+ MisDataFun.Moby_Select(OpName, out orderNum, out EngineTypeID, out EngineType, out EngineID, out PartPallet_Code, out IsrepairBarcode, out repairBarcode, out EngineTypeString);
+ data = orderNum + "&" + EngineTypeID + "&" + EngineType + "&" + EngineID + "&" + PartPallet_Code + "&" + IsrepairBarcode + "&" + repairBarcode + "&" + EngineTypeString;
+ }
+ catch (Exception err)
+ {
+ ////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:MobySelect");
+ }
+ return data;
+ }
+ private static string ShowMoby_String_FirstOpName(string OpName)
+ {
+ string data = "";
+ try
+ {
+ string orderNum = "";
+ int EngineTypeID = 0;
+ string EngineType = "";
+ string EngineID = "";
+ string PartPallet_Code = "";
+ int IsrepairBarcode = 0;
+ string repairBarcode = "";
+ string EngineTypeString = "";
+ //上线工位
+ MisDataFun.Moby_Select(OpName, out orderNum, out EngineTypeID, out EngineType, out EngineID, out PartPallet_Code, out IsrepairBarcode, out repairBarcode, out EngineTypeString);
+ data = orderNum + "&" + EngineTypeID + "&" + EngineType + "&" + EngineID + "&" + PartPallet_Code + "&" + IsrepairBarcode + "&" + repairBarcode + "&" + EngineTypeString;
+ }
+ catch (Exception err)
+ {
+ ////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:MobySelect");
+ }
+ return data;
+ }
+ private static string MaterialList_String(string OpName)
+ {
+ string jsonStr_Materail = "";
+ try
+ {
+ string orderNum = "";
+ int EngineTypeID = 0;
+ string EngineType = "";
+ string EngineID = "";
+ string PartPallet_Code = "";
+ int IsrepairBarcode = 0;
+ string repairBarcode = "";
+ string EngineTypeString = "";
+
+ MisDataFun.Moby_Select(OpName, out orderNum, out EngineTypeID, out EngineType, out EngineID, out PartPallet_Code, out IsrepairBarcode, out repairBarcode, out EngineTypeString);
+ MisDataFun.PartMaterialVerify_Select(OpName, EngineTypeID, EngineType, out DataTable dt_Material);
+ if (dt_Material != null)
+ {
+ if (dt_Material.Rows.Count > 0)
+ {
+ jsonStr_Materail = JsonHelper.CreateJsonParameters(dt_Material);
+ }
+ }
+ }
+ catch (Exception err)
+ {
+ ////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:MaterialList");
+ }
+ return jsonStr_Materail;
+ }
+ private static string MaterialList_String_FirstOpName(string OpName)
+ {
+ string jsonStr_Materail = "";
+ try
+ {
+ string orderNum = "";
+ int EngineTypeID = 0;
+ string EngineType = "";
+ string EngineID = "";
+ string PartPallet_Code = "";
+ int IsrepairBarcode = 0;
+ string repairBarcode = "";
+ string EngineTypeString = "";
+
+ MisDataFun.Moby_Select(OpName, out orderNum, out EngineTypeID, out EngineType, out EngineID, out PartPallet_Code, out IsrepairBarcode, out repairBarcode, out EngineTypeString);
+ MisDataFun.PartMaterialVerify_Select(OpName, EngineTypeID, EngineType, out DataTable dt_Material);
+ if (dt_Material != null)
+ {
+ if (dt_Material.Rows.Count > 0)
+ {
+ jsonStr_Materail = JsonHelper.CreateJsonParameters(dt_Material);
+ }
+ }
+ }
+ catch (Exception err)
+ {
+ ////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:MaterialList");
+ }
+ return jsonStr_Materail;
+ }
+
+ private static string ShowTimelyQuality_String(string OpName)
+ {
+ string text = "";
+ try
+ {
+ string orderNum = "";
+ int EngineTypeID = 0;
+ string EngineType = "";
+ string EngineID = "";
+ string PartPallet_Code = "";
+ int IsrepairBarcode = 0;
+ string repairBarcode = "";
+ string EngineTypeString = "";
+ DataTable dt;
+
+ MisDataFun.Moby_Select(OpName, out orderNum, out EngineTypeID, out EngineType, out EngineID, out PartPallet_Code, out IsrepairBarcode, out repairBarcode, out EngineTypeString);
+ MisDataFun.QualitySelect(OpName, EngineID, out dt);
+ if (dt != null)
+ {
+ if (dt.Rows.Count > 0)
+ {
+ text = JsonHelper.CreateJsonParameters(dt);
+ }
+ }
+ }
+ catch (Exception err)
+ {
+ ////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:Quality_Select");
+ }
+ return text;
+ }
+ private static string ShowTimelyQuality_String_FirstOpName(string OpName)
+ {
+ string text = "";
+ try
+ {
+ string orderNum = "";
+ int EngineTypeID = 0;
+ string EngineType = "";
+ string EngineID = "";
+ string PartPallet_Code = "";
+ int IsrepairBarcode = 0;
+ string repairBarcode = "";
+ string EngineTypeString = "";
+ DataTable dt;
+ MisDataFun.Moby_Select(OpName, out orderNum, out EngineTypeID, out EngineType, out EngineID, out PartPallet_Code, out IsrepairBarcode, out repairBarcode, out EngineTypeString);
+ MisDataFun.QualitySelect(OpName, EngineID, out dt);
+ if (dt != null)
+ {
+ if (dt.Rows.Count > 0)
+ {
+ text = JsonHelper.CreateJsonParameters(dt);
+ }
+ }
+ }
+ catch (Exception err)
+ {
+ ////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:Quality_Select");
+ }
+ return text;
+ }
+
+ private static string OrderFormList_String()
+ {
+ string enginetypelist = "";
+ try
+ {
+ System.Data.DataTable dt = null;
+ MisDataFun.EngineType_Select(out dt);
+ if (dt != null)
+ {
+ if (dt.Rows.Count > 0)
+ {
+ enginetypelist = JsonHelper.DataTableToJson(dt);
+ }
+ }
+ }
+ catch (Exception err)
+ {
+ ////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:Orderenginetypeselect");
+ }
+ return enginetypelist;
+ }
+
+ ///
+ /// 消息提醒
+ ///
+ ///
+ private static string Notice_String(string opname)
+ {
+ string text = "";
+ try
+ {
+ System.Data.DataTable dt = null;
+ MisDataFun.ShowWindowNotice(opname, out dt);
+ if (dt != null)
+ {
+ if (dt.Rows.Count > 0)
+ {
+ text = JsonHelper.DataTableToJson(dt);
+ }
+ }
+ }
+ catch (Exception err)
+ {
+ ////ApplicationLog.WriteLog(err, "MesWebFun_baseFun:ShowWindowNotice");
+ }
+ return text;
+ }
+
+ ///
+ /// 批量发送WEB消息(Value为BOOL值)
+ ///
+ /// 消息编号组合
+ /// 消息值组合
+ /// 工位号
+ void Sendmessage(string MessageNumm, string Value, string OpName)
+ {
+ for (int i = 0; i < MessageNumm.Length; i++)
+ {
+ Sendmessage(MessageNumm[i], Value[i].ToString(), OpName);
+
+ }
+ }
+
+ ///
+ /// 选择发送给WEB的消息
+ ///
+ /// 消息类型
+ /// 消息工位
+ static void Sendmessage(char Num, string Value, string OpName)
+ {
+ string SendMessage;
+ switch (Num)
+ {
+ case '1':
+ //1(直接在界面通过选择机型确认工序内容)
+ SendMessage = "MES|ProcessList|" + OpName + "|" + Value;
+ AsyncSendMessage(SendMessage);
+ break;
+
+ case '2':
+ //2显示物料
+ SendMessage = "MES|MaterialList|" + OpName + "|" + Value;
+ AsyncSendMessage(SendMessage);
+ break;
+
+ case '3':
+
+ //3显示操作指导图片
+ SendMessage = "MES|PicShow|" + OpName + "|" + Value;
+ AsyncSendMessage(SendMessage);
+ break;
+ case '4':
+ //3显示操作指导图片
+ SendMessage = "MES|OrderFormList|" + OpName + "|" + Value;
+ AsyncSendMessage(SendMessage);
+ break;
+
+ case '5':
+ SendMessage = "MES|ShowMoby|" + OpName + "|" + Value;
+ AsyncSendMessage(SendMessage);
+ break;
+ case '6':
+ SendMessage = "MES|MaterialCheckPosition|" + OpName + "|" + Value;
+ AsyncSendMessage(SendMessage);
+ break;
+ case '7':
+ SendMessage = "MES|WorkStart|" + OpName + "|" + Value;
+ AsyncSendMessage(SendMessage);
+ break;
+ case '8':
+ SendMessage = "MES|OrderFormList|" + OpName + "|" + Value;
+ AsyncSendMessage(SendMessage);
+ break;
+ case '9':
+ SendMessage = "MES|ConfirmOkGo|" + OpName + "|" + Value;
+ AsyncSendMessage(SendMessage);
+ break;
+ case 'a':
+ SendMessage = "MES|FixAllow|" + OpName + "|" + Value;
+ AsyncSendMessage(SendMessage);
+ break;
+ case 'b':
+ SendMessage = "MES|ShaftPosition|" + OpName + "|" + Value;
+ AsyncSendMessage(SendMessage);
+ break;
+ case 'c':
+ SendMessage = "MES|ShowQuality|" + OpName + "|" + Value;
+ AsyncSendMessage(SendMessage);
+ break;
+ }
+ }
+ /////
+ ///// 发送信息到MES通讯服务器或者其他的
+ /////
+ /////
+ //static private void AsyncSendMessage1(string Message)
+ //{
+ // MIS_BASE.asyncSendMessage(Message);
+ //}
+
+
+ }
+}
\ No newline at end of file
diff --git a/Common/09MesDataFunction/MesDataFunction/12SendMessageToWeb/SendMessageFun.cs b/Common/09MesDataFunction/MesDataFunction/12SendMessageToWeb/SendMessageFun.cs
new file mode 100644
index 0000000..af96e4a
--- /dev/null
+++ b/Common/09MesDataFunction/MesDataFunction/12SendMessageToWeb/SendMessageFun.cs
@@ -0,0 +1,249 @@
+using MisDataFunDll;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace MesServerFunctions
+{
+ ///
+ /// 命令
+ ///显示托盘信息√ case "ShowMoby":
+ ///显示操作指南√ case "ProcessList":
+ ///显示物料√ case "MaterialList":
+ ///显示操作图片√ case "PicShow":
+ ///显示拧紧位置√ case "ShaftPosition":
+ ///实时显示质量数据√ case "ShowTimelyQuality":
+ ///手动拧紧实时显示质量数据√case "ShowTimelyQuality_Tight":
+ ///√ case "OrderFormList":
+ ///弹窗消息√ case "Notice":
+ ///LED消息提醒√ case "ScrollNotice":
+ ///物料检测初始化√ case "MaterialCheckPosition":
+ ///返修质量数据显示√ case "RepairQuality"
+ ///
+ ///
+ public class SendMessageFun
+ {
+ ///
+ /// 批量发送WEB消息(Value为BOOL值)
+ /// 1:显示工序内容
+ /// 2:显示物料
+ /// 3:显示操作指导图片
+ /// 5:显示机型、工件流水号、订单信息
+ /// c:显示质量数据
+ ///
+ /// 消息编号组合
+ /// 消息值组合
+ /// 工位号
+ static public void SendMessage(string MessageNumm, string Value, string OpName)
+ {
+ for (int i = 0; i < MessageNumm.Length; i++)
+ {
+ SendMessageFun.SendMessage(MessageNumm[i], Value[i].ToString(), OpName);
+
+ }
+ }
+ ///
+ /// 向WEB发送信息(value为字符串)
+ ///
+ /// 消息种类
+ /// 消息内容
+ /// 工位号
+ static public void SendInfomation(string Command, string Value, string OpName)
+ {
+
+ string SendMessage = "MES|" + Command + "|" + OpName + "|" + Value;
+ AsyncSendMessage(SendMessage);
+ }
+
+ static public void AsyncSendMessage_Notice(string opname, string notice, string noticeType = "misServer")
+ {
+ //通知Web界面
+ notice = $"{{\"Notice\":\"{notice}\",\"NoticeType\":\"{noticeType}\"}}";
+
+ MisDataFun.Web_Notice_Insert(opname, notice);
+ string SendMessage = "MES|Notice_Info|" + opname + "|" + notice;
+ MIS_SendMessage.asyncSendMessage(SendMessage);
+ }
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// barcode mis
+ static public void AsyncSendMessage_Notice_Error(string opname, string notice, string noticeType)
+ {
+ //通知Web界面
+ // notice: notice, noticeType: noticeType
+
+ notice = $"{{\"Notice\":\"{notice}\",\"NoticeType\":\"{noticeType}\"}}";
+
+ MisDataFun.Web_Notice_Insert(opname, notice);
+ string SendMessage = "MES|Notice_Error|" + opname + "|" + notice;
+ MIS_SendMessage.asyncSendMessage(SendMessage);
+ }
+ ///
+ /// 选择发送给WEB的消息
+ /// 1:显示工序内容
+ /// 2:显示物料
+ /// 3:显示操作指导图片
+ /// 5:显示机型、工件流水号、订单信息
+ /// c:显示质量数据
+ ///
+ /// 消息类型
+ /// 消息工位
+ static void SendMessage(char Num, string Value, string OpName)
+ {
+ string SendMessage;
+ switch (Num)
+ {
+ case '1':
+ //1(直接在界面通过选择机型确认工序内容)
+ SendMessage = "MES|ProcessList|" + OpName + "|" + Value;
+ AsyncSendMessage(SendMessage);
+ break;
+
+ case '2':
+ //2显示物料
+ SendMessage = "MES|MaterialList|" + OpName + "|" + Value;
+ AsyncSendMessage(SendMessage);
+ break;
+
+ case '3':
+
+ //3显示操作指导图片
+ SendMessage = "MES|PicShow|" + OpName + "|" + Value;
+ AsyncSendMessage(SendMessage);
+ break;
+ case '4':
+ //3显示操作指导图片
+ SendMessage = "MES|OrderFormList|" + OpName + "|" + Value;
+ AsyncSendMessage(SendMessage);
+ break;
+
+ case '5':
+ SendMessage = "MES|ShowMoby|" + OpName + "|" + Value;
+ AsyncSendMessage(SendMessage);
+ break;
+ case '6':
+ SendMessage = "MES|MaterialCheckPosition|" + OpName + "|" + Value;
+ AsyncSendMessage(SendMessage);
+ break;
+ case '7':
+ SendMessage = "MES|WorkStart|" + OpName + "|" + Value;
+ AsyncSendMessage(SendMessage);
+ break;
+ case '8':
+ SendMessage = "MES|OrderFormList|" + OpName + "|" + Value;
+ AsyncSendMessage(SendMessage);
+ break;
+ case '9':
+ SendMessage = "MES|ConfirmOkGo|" + OpName + "|" + Value;
+ AsyncSendMessage(SendMessage);
+ break;
+ case 'a':
+ SendMessage = "MES|FixAllow|" + OpName + "|" + Value;
+ AsyncSendMessage(SendMessage);
+ break;
+ case 'b':
+ SendMessage = "MES|ShaftPosition|" + OpName + "|" + Value;
+ AsyncSendMessage(SendMessage);
+ break;
+ case 'c':
+ //SendMessage = "MES|ShowQuality|" + OpName + "|" + Value;
+ SendMessage = "MES|ShowTimelyQuality|" + OpName + "|" + Value;
+ AsyncSendMessage(SendMessage);
+ break;
+ }
+ }
+
+ ///
+ /// 向WEB发送信息(value为字符串)
+ ///
+ /// 消息种类
+ /// 消息内容
+ /// 工位号
+ //void SendInfomation(string Command, string Value, string OpName)
+ //{
+
+ // string SendMessage = "MES|" + Command + "|" + OpName + "|" + Value;
+ // AsyncSendMessage(SendMessage);
+ //}
+
+
+ ///
+ /// 发送在线产量、在线节拍
+ ///
+ ///
+ ///
+ private void SendActuallyCount(string OpName, int tagValue)
+ {
+ //当工件离开时,更新在线产量、在线节拍
+ if (tagValue == 0)
+ {
+ try
+ {
+ int opNameCount = 0;//在线产量
+ int opNameCountTime = 0;//在线节拍
+
+ MisDataFun.OpNameCount_New(OpName, out opNameCount, out opNameCountTime); //基本数据_工作日历_班次产量查询_New
+
+ SendInfomation("ActuallyCount", opNameCount.ToString() + "&" + opNameCountTime.ToString(), OpName);
+
+ }
+ catch (Exception err)
+ {
+ ////ApplicationLog.WriteLog(err, "Function01:SendActuallyCount");
+ }
+ }
+ }
+
+ ///
+ /// 发送信息到MES通讯服务器或者其他的
+ ///
+ ///
+ static public void AsyncSendMessage(string Message)
+ {
+ MIS_SendMessage.asyncSendMessage(Message);
+ }
+
+ /////
+ ///// 发送提示消息
+ /////
+ /////
+ //static public void AsyncSendMessage_Notice(string opname, string notice)
+ //{
+ // //通知Web界面
+ // BaseDataSystemMES.Web_Notice_Insert(opname, notice);
+ // string SendMessage = "MES|Notice|" + opname + "|" + "1";
+ // MIS_BASE.asyncSendMessage(SendMessage);
+ //}
+
+ ///
+ /// 发送信息到打印机
+ ///
+ ///
+ private void asyncSendMessageToMark(string Message)
+ {
+ string messageSend = (string)Message;
+ //UDPClientSend.Send_ALL(ApplicationConfig.MES_MarkPortNum, messageSend);
+ }
+
+ ///
+ /// 发送信息到LED
+ ///
+ ///
+ private void asyncSendMessageLED(string OpName)
+ {
+
+ //发送到大屏幕显示 41104
+ string strMessage = "MIS|" + OpName + "|" + "0" + "|" + "1";
+ //UDPClientSend.Send_ALL(ApplicationConfig.Port_ShowLED_ProductCount, strMessage);
+
+ }
+
+
+ }
+}
+
diff --git a/Common/09MesDataFunction/MesDataFunction/13MIS_FuntionSaveData/Funtion.Alarm.cs b/Common/09MesDataFunction/MesDataFunction/13MIS_FuntionSaveData/Funtion.Alarm.cs
new file mode 100644
index 0000000..bd04a2f
--- /dev/null
+++ b/Common/09MesDataFunction/MesDataFunction/13MIS_FuntionSaveData/Funtion.Alarm.cs
@@ -0,0 +1,247 @@
+using DataLinkMesWork1;
+using MesServerFunctions;
+using MesServerWork;
+using MisDataFunDll;
+using Newtonsoft.Json;
+using System;
+using System.Collections;
+using System.Collections.Concurrent;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SqlClient;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Xml.Linq;
+
+namespace MisDataSaveDate
+{
+ public partial class FuntionMesRead
+ {
+
+ #region 2023.05.14,新增报警
+
+ public static Hashtable Base_TagIdList = new Hashtable();
+ public static Hashtable Base_ObjList = new Hashtable();
+
+
+ public static void GetAlarmInit()
+ {
+ Base_TagIdList.Clear();
+ GetTagIdList("", out DataTable dt);
+
+ for (int i = 0; i < dt.Rows.Count; i++)
+ {
+ string tagid = dt.Rows[i]["TagID"].ToString();
+
+ if (tagid[0].ToString() == "9")
+ {
+ var opName = dt.Rows[i]["工位号"].ToString();
+ var ItemName = dt.Rows[i]["测量项目"].ToString(); // 报警内容
+ var ShaftID = dt.Rows[i]["测量位置"].ToString(); // 报警类型
+
+ string SendMessage = "MES|PlcAlarm|" + opName + "|" + tagid + "&@TagValue&" + ItemName + "&" + ShaftID;
+ Base_TagIdList.Add(tagid, SendMessage);
+
+ //在存一份报警对象到键值对中
+ Base_ObjList.Add(tagid, dt.Rows[i]);
+ }
+ }
+ }
+
+ //public static void Send_AlarmMsg(string tagid, string tagVvalue)
+ //{
+ // var val = Base_TagIdList[tagid];
+ // if (val != null)
+ // {
+ // //var msg = Base_TagIdList[tagid].ToString();
+ // //var sendmsg = msg.Replace("@TagValue", tagVvalue);
+ // //SendMessageFun.AsyncSendMessage(sendmsg);
+ // string alarmTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
+ // var msg = Base_TagIdList[tagid].ToString();
+ // var sendmsg = msg.Replace("@TagValue", tagVvalue) + "&" + alarmTime;
+ // SendMessageFun.AsyncSendMessage(sendmsg);
+ // // 去存一份记录到数据库
+ // DataRow errObj = (DataRow)Base_ObjList[tagid];
+ // MisDataFun.Alarm_Insert2(Convert.ToInt32(errObj["TagID"]), errObj["工位号"].ToString(), errObj["测量项目"].ToString(), Convert.ToInt32(tagVvalue), errObj["测量位置"].ToString());
+ // }
+ //}
+ public static DataRow Send_AlarmMsg(string tagid, string tagVvalue)
+ {
+ var val = Base_TagIdList[tagid];
+ DataRow errObj = null;
+ if (val != null)
+ {
+ //var msg = Base_TagIdList[tagid].ToString();
+ //var sendmsg = msg.Replace("@TagValue", tagVvalue);
+ //SendMessageFun.AsyncSendMessage(sendmsg);
+
+ var msg = Base_TagIdList[tagid].ToString();
+ var sendmsg = msg.Replace("@TagValue", tagVvalue);
+ SendMessageFun.AsyncSendMessage(sendmsg);
+ // 去存一份记录到数据库
+ errObj = (DataRow)Base_ObjList[tagid];
+
+ MisDataFun.Alarm_Insert2(Convert.ToInt32(errObj["TagID"]), errObj["工位号"].ToString(), errObj["测量项目"].ToString(), Convert.ToInt32(tagVvalue), errObj["测量位置"].ToString());
+ }
+ return errObj;
+ }
+
+
+
+ static public void GetTagIdList(string opName, out DataTable dt)
+ {
+ string procedureName;
+ procedureName = "MES_基本变量_原始数据_根据工位号查询";
+ SqlParameter[] thisParms = new SqlParameter[1];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
+ DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt);
+ }
+
+
+
+
+
+ #endregion
+
+ public static void Alarm_Insert_Init(string Opname)
+ {
+ DataTable dt;
+ MisDataFun.Alarm_Moby_Search(out dt);
+ if (dt == null) return;
+ for (int i = 0; i < dt.Rows.Count; i++)
+ {
+ string TagId = dt.Rows[i]["TagId"].ToString();
+ object tagValueStr = "";
+ string tagValue = "0";
+ MIS_BASE.Read_TagValueByTagID(TagId, out tagValueStr);
+ if (tagValueStr != null)
+ {
+ switch (tagValueStr.ToString().ToLower())
+ {
+ case "1":
+ case "true":
+ tagValue = "1";
+ break;
+ default:
+ tagValue = "0";
+ break;
+ }
+ Send_AlarmMsg(TagId, tagValue);
+ }
+ }
+ }
+
+ public static void Alarm_InitAlarm_Send(string opName, out Hashtable ht)
+ {
+ var tagValues = MIS_BASE.ReadPLC_OpName(opName);
+ //过滤出来质量数据 //获得带合格标志的质量数据
+ var keyValues = tagValues.OrderBy(x => x.Key).ToDictionary(k => k.Key, v => v.Value);
+ ht = new Hashtable();
+
+ foreach (KeyValuePair _cd in keyValues)
+ {
+ var tf = _cd.Value;
+ string TagID = tf.TagID.ToString();
+ if (TagID[0].ToString() == "9")
+ {
+ string tagValue = tf.TagValue.ToString();
+ if (tf.TagValue == null) return;
+ switch (tagValue.ToLower())
+ {
+ case "1":
+ case "true":
+ tagValue = "1";
+ break;
+ default:
+ tagValue = "0";
+ break;
+ }
+ if (tagValue == "1")
+ {
+ ht.Add(tf.TagID, tagValue);
+ }
+ }
+ }
+ }
+ public static bool Alarm_Insert(string TagID, string tagTypeID, string opName, int TagValue,
+ DateTime alarmStartTime, DateTime alarmEndTime, int TimeDiff,
+ string Text1, string Text2, string TagOrderBy)
+ {
+
+
+ string produceName = "测量数据工位报警全部_增加数据";
+ SqlParameter[] thisParms = new SqlParameter[10];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@TagID", TagID);
+ thisParms[1] = new System.Data.SqlClient.SqlParameter("@TagTypeID", tagTypeID);
+ thisParms[2] = new System.Data.SqlClient.SqlParameter("@opName", opName);
+ thisParms[3] = new System.Data.SqlClient.SqlParameter("@TagValue", TagValue);
+ thisParms[4] = new System.Data.SqlClient.SqlParameter("@alarmStartTime", alarmStartTime);
+ thisParms[5] = new System.Data.SqlClient.SqlParameter("@alarmEndTime", alarmEndTime);
+ thisParms[6] = new System.Data.SqlClient.SqlParameter("@TimeDiff", TimeDiff);
+ thisParms[7] = new System.Data.SqlClient.SqlParameter("@Text1", Text1);
+ thisParms[8] = new System.Data.SqlClient.SqlParameter("@Text2", Text2);
+ thisParms[9] = new System.Data.SqlClient.SqlParameter("@TagOrderBy", TagOrderBy);
+ if (DataAccess.ExecuteStoredProcedure(produceName, ref thisParms))
+ {
+
+ return true;
+ }
+ return false;
+ }
+
+ ///
+ /// 报错详细工件记录日志 (有可能报错 所以封装)
+ ///
+ /// 1.申请上线 2.传递机型 3.允许保存 4.扫码
+ ///
+ public static void Alarm_SaveFileLog4Error(string errorStep, object e, string FunName, Exception err)
+ {
+ try
+ {
+ MyLog4Net.MyLogHelper.Error($"{FunName}异常:", $"Message:{err.Message} InnerException: {err.InnerException}");
+ string leftErrorStep;
+ if (errorStep == "PartLoad")
+ {
+ leftErrorStep = "申请上线";
+ }
+ else if (errorStep == "EngineGetOver")
+ {
+ leftErrorStep = "传递机型";
+ }
+ else if (errorStep == "MesRead")
+ {
+ leftErrorStep = "允许保存";
+ }
+ else if (errorStep == "Barcode")
+ {
+ leftErrorStep = "扫码";
+ }
+ else
+ {
+ leftErrorStep = $"未知类型{errorStep}";
+ }
+
+ DeviceDriver_BasicData.CustomeEvetnArgs msgEvent = (DeviceDriver_BasicData.CustomeEvetnArgs)e;
+ string OpName = Convert.ToString(msgEvent.OpName);
+ MIS_BASE.GetEngineTypeFromPLC(OpName, out int EngineTypeID, out string EngineType, out string EngineID, out int PartPallet_Code, out string OrderForm);
+ MyLog4Net.MyLogHelper.Error($"{FunName}{leftErrorStep}操作异常:", $"工位号:{OpName}、总成号:{EngineID}、机型:{EngineType}、机型代码:{EngineTypeID}、订单号:{OrderForm}、托盘号:{PartPallet_Code}");
+
+ string saveString = $"{FunName}{leftErrorStep}操作异常 Message:{err.Message} InnerException: {err.InnerException}:工位号:{OpName}、总成号:{EngineID}、机型:{EngineType}、机型代码:{EngineTypeID}、订单号:{OrderForm}、托盘号:{PartPallet_Code}";
+ var sql =
+ $"INSERT INTO 合力_系统日志 ([工位号],[日志类型],[日志文本])"+
+ $" VALUES('{OpName}', 'system', '{saveString}')";
+ DataAccess.ExecuteDataTable(sql, out DataTable dt);
+ }
+ catch (Exception ex)
+ {
+ MyLog4Net.MyLogHelper.Error($"{FunName}保存错误日志失败:", $"Message:{ex}");
+ }
+ }
+
+ public static void Alarm_SystemError(string FunName, Exception err)
+ {
+ MyLog4Net.MyLogHelper.Error($"系统{FunName}方法异常:", $"Message:{err.Message} InnerException:{err.InnerException}");
+ }
+ }
+}
diff --git a/Common/09MesDataFunction/MesDataFunction/13MIS_FuntionSaveData/Funtion.MesRead.cs b/Common/09MesDataFunction/MesDataFunction/13MIS_FuntionSaveData/Funtion.MesRead.cs
new file mode 100644
index 0000000..3866226
--- /dev/null
+++ b/Common/09MesDataFunction/MesDataFunction/13MIS_FuntionSaveData/Funtion.MesRead.cs
@@ -0,0 +1,635 @@
+using BasicData;
+using MesServerFunctions;
+using MesServerWork;
+using MisDataFunDll;
+using Newtonsoft.Json;
+using OpcBasic;
+using System;
+using System.Collections;
+using System.Collections.Concurrent;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SqlClient;
+using System.Linq;
+using DataLinkMesWork1;
+
+using static System.Windows.Forms.VisualStyles.VisualStyleElement.TaskBand;
+
+namespace MisDataSaveDateMesRead
+{
+ public partial class Funtion
+ {
+
+
+ ///
+ /// 允许保存(针对半自动和手动压装工位)
+ ///
+ ///
+ ///
+ public static int MesRead(string opName, string tagValue, string tagid, bool isCheck = false)
+ {
+ int qualityMask = 0;
+
+ qualityMask = SaveQualityData(opName, Convert.ToInt32(tagValue), tagid, isCheck);
+
+
+ //if (tagValue == "0")
+ //{
+ // MIS_BASE.Write_TagTypeID(20, opName, false);
+ //}
+ //else
+ //{
+ // qualityMask = SaveQualityData(opName, Convert.ToInt32(tagValue), tagid, isCheck);
+ // MIS_BASE.Write_TagTypeID(20, opName, true);
+ //}
+ return qualityMask;
+ }
+ public static string GetRealTimeQualityData(string opName)
+ {
+ string message = "";
+ DataTable dt1 = new DataTable();
+ DataTable dt_WWW;
+ DataTable dt_WWW_Copy1;
+ DataTable dt_WWW_Copy2;
+ Hashtable valueList;
+ try
+ {
+ //读取工位全部数据
+ var rtList = MIS_BASE.ReadPLC_OpName(opName); //GetDbAndMaxLengthByOpNameByBytes(opName);
+ var pp = JsonConvert.SerializeObject(rtList);
+ var tagValues = JsonConvert.DeserializeObject>(pp);
+ //过滤出来质量数据 //获得带合格标志的质量数据
+ valueList = ReadPLC_OpName_Qd(tagValues);
+
+ //获得带基本信息的质量数据表
+ GetQualityDataTable(valueList, opName, MIS_BASE.BasicDataTagValue, MIS_BASE.BasicDataTagValueUpDown, out dt_WWW);
+
+ dt_WWW_Copy1 = dt_WWW.Copy().Select("变量排序 = 1").CopyToDataTable();
+ DataView dv1 = dt_WWW_Copy1.DefaultView;
+ dv1.Sort = "列位置 DESC";
+ dt_WWW_Copy1 = dv1.ToTable();
+
+ dt_WWW_Copy2 = dt_WWW.Copy().Select("变量排序 = 2").CopyToDataTable();
+ DataView dv2 = dt_WWW_Copy2.DefaultView;
+ dv2.Sort = "列位置 DESC";
+ dt_WWW_Copy2 = dv2.ToTable();
+
+ dt1.Columns.Add("列位置", System.Type.GetType("System.String"));
+ dt1.Columns.Add("测量项目1", System.Type.GetType("System.String"));
+ dt1.Columns.Add("测量项目2", System.Type.GetType("System.String"));
+ dt1.Columns.Add("合格标志", System.Type.GetType("System.String"));
+ dt1.Columns.Add("名称", System.Type.GetType("System.String"));
+
+ for (int i = 0; i < dt_WWW_Copy1.Rows.Count; i++)
+ {
+ if (Convert.ToInt32(dt_WWW_Copy1.Rows[i]["TagValue"]) > 45)
+ {
+ var dr = dt1.NewRow();
+ dr["列位置"] = dt_WWW_Copy1.Rows[i]["列位置"].ToString();
+ dr["测量项目1"] = dt_WWW_Copy1.Rows[i]["TagValue"].ToString();
+ dr["合格标志"] = "1";
+ dr["名称"] = dt_WWW_Copy1.Rows[i]["测量项目"].ToString();
+ dt1.Rows.Add(dr);
+ }
+ }
+ for (int i = 0; i < dt_WWW_Copy2.Rows.Count; i++)
+ {
+ if (Convert.ToInt32(dt_WWW_Copy2.Rows[i]["TagValue"]) > 45)
+ {
+ var dr = dt1.NewRow();
+ dr["列位置"] = dt_WWW_Copy2.Rows[i]["列位置"].ToString();
+ dr["测量项目1"] = dt_WWW_Copy2.Rows[i]["TagValue"].ToString();
+ dr["合格标志"] = "1";
+ dr["名称"] = dt_WWW_Copy2.Rows[i]["测量项目"].ToString();
+ dt1.Rows.Add(dr);
+ }
+ }
+ }
+ catch (Exception err)
+ {
+ }
+ message = JsonHelper.CreateJsonParameters(dt1);
+
+ return message;
+ }
+ ///
+ /// 返回合格标志
+ ///
+ ///
+ ///
+ ///
+ ///
+ private static int SaveQualityData(string opName, int tagValue, string tagID, bool isCheck = false)
+
+ {
+ int id_tagCF;
+ int qualityMask = 0;
+ int engineTypeID = 0;
+ string engineID = "";
+ string engineType = "";
+ string partPallet = "";
+ string orderFormPlc = "";
+ DataTable dt_WWW;
+ Hashtable valueList;
+ try
+ {
+
+ //读取工位全部数据
+ var rtList = MIS_BASE.ReadPLC_OpName(opName); //GetDbAndMaxLengthByOpNameByBytes(opName);
+ var pp = JsonConvert.SerializeObject(rtList);
+ var tagValues = JsonConvert.DeserializeObject>(pp);
+ //过滤出来质量数据 //获得带合格标志的质量数据
+ valueList = ReadPLC_OpName_Qd(tagValues);
+
+
+ engineTypeID = Convert.ToInt32(GetValueByTagTypeCodeID(tagValues, Convert.ToInt32(EnumTagTypeCodeID.EngineTypeID)));
+ engineID = GetValueByTagTypeCodeID(tagValues, Convert.ToInt32(EnumTagTypeCodeID.EngineID)).ToString();
+ engineType = GetValueByTagTypeCodeID(tagValues, Convert.ToInt32(EnumTagTypeCodeID.EngineType)).ToString();
+ orderFormPlc = GetValueByTagTypeCodeID(tagValues, Convert.ToInt32(EnumTagTypeCodeID.OrderFormPLC)).ToString();
+ qualityMask = Convert.ToInt32(GetValueByTagTypeCodeID(tagValues, Convert.ToInt32(EnumTagTypeCodeID.QualityMask)));
+
+
+
+ //获得带基本信息的质量数据表
+ GetQualityDataTable(valueList, opName, MIS_BASE.BasicDataTagValue,
+ MIS_BASE.BasicDataTagValueUpDown, out dt_WWW);
+
+ DateTime lastupdatetime = DateTime.Now;
+ //保存质量数
+ BaseData_tagTable_QualityData_B5A_IndexInsert(engineID, tagID, engineType, engineTypeID, opName, qualityMask, partPallet, out id_tagCF);
+ BaseData_tagTable_QualityData_B5A_Insert(id_tagCF, engineTypeID, engineID, opName, dt_WWW, isCheck);
+ //保存质量数据到 接口表
+ MisDataFun.SaveQualityInterfaceData(opName, engineID);
+ }
+ catch (Exception err)
+ {
+ //MIS_BASE.Write_TagTypeID(20, opName, true);
+ ////ApplicationLog.WriteLog(err, err.Message);
+ }
+ return qualityMask;
+ }
+
+ public class QualityDataType1
+ {
+ public int tagValueType;
+ public int tagTypeID;
+ public string opName;
+ public string tagID;
+ public object TagValeNormal;
+ public object TagValueDown;
+ public object TagValueUp;
+ public object Unit;
+ public object tagValue;
+ public int tagQuality;
+ public int tagOrderBy;
+ public int tagItemOrderBy;
+ public int tagProperty;
+ public int isGoodBad;
+ }
+ static public void GetQualityDataTable(Hashtable valuList, string opName, DataTable BasicDataTagValue, DataTable BasicDataTagValueUpDown, out DataTable dt)
+ {
+ //78 0:屏蔽MES;1:启用MES(必须MIS)
+ //79 通过线体工位PC实现下达工位工作状态:工位有三种状态:在线、离线、屏蔽。在线;0正常状态,实现正常功能。1离线:2屏蔽。(必须MIS)
+ //41 机体流向标志(1 BYTE):0普通工位:1:上线(发动机上线);2:下线(发动机下线);(必须PLC)
+ //51 返修工位,修改后的数据MES将数据写入PLC ,MES通知PLC数据修改完成。(YN)
+ //8 只要返修,必须由mes发送此信号,plc接收此信号后才能放行
+ //(暂时没用)用于有扳手拧紧工位。通知设备螺钉拧紧完成。PC已经将数据保存到数据库中。(B5A)
+
+ QualityDataType1 qualityData;
+ //是否有数据
+ //bool isUsing;
+
+ DataRow dr;
+ DataRow[] dr_WWW;
+ //MES_基本数据_测量范围
+ DataRow[] dr_WWW_UpDown;
+
+ dt = MisDataFun.BuildDataTables_WWW();
+
+ //测量位置
+ string shaftID;
+ //测量项目
+ string item;
+ //测量单位
+ string unit;
+ //机体类型
+ //原始数据中的机型代码
+ int engineTypeID_Source;
+ //上限值
+ string tagValueUp;
+ //下限值
+ string tagValueDown;
+ //理论值
+ string tagValeNormal;
+ //TagValue
+ // 合格标志
+ //string IsGoodBad;
+
+ foreach (DictionaryEntry valueItem in valuList) //ht为一个Hashtable实例
+ {
+ try
+ {
+ qualityData = (QualityDataType1)valueItem.Value;
+
+
+ //if ((qualityData.tagProperty != 2) || (qualityData.tagProperty != 6))
+ //{
+ // continue ;
+ //}
+ //if ((qualityData.tagProperty == 2) || (qualityData.tagProperty == 6))
+ {
+ //if (engineTypeID == 0)
+ //{
+ // engineTypeID = 1;
+ //}
+ dr_WWW = BasicDataTagValue.Select("TagID = " + qualityData.tagID);
+ //try
+ //{
+ // dr_WWW_UpDown = BasicDataTagValueUpDown.Select("TagID = " + qualityData.tagID);
+ //}
+ //catch { dr_WWW_UpDown = null; }
+
+
+ //if (dr_WWW.Length > 0)
+ //{
+ // {
+ // engineTypeID_Source = Convert.ToInt32(dr_WWW[0]["机体类型"]);
+ // int temp;
+ // temp = engineTypeID_Source & engineTypeID;
+ // if (temp == 0)
+ // {
+ // continue;
+ // }
+ // if (qualityData.isGoodBad == -1)
+ // {
+ // continue;
+ // }
+ // }
+ //}
+ //else
+ //{
+ // continue;
+
+ //}
+
+ try
+ {
+ shaftID = dr_WWW[0]["测量位置"].ToString();
+ }
+ catch
+ {
+ shaftID = "";
+ }
+ try
+ {
+ item = dr_WWW[0]["测量项目"].ToString();
+ }
+ catch
+ {
+ item = "";
+ }
+ try
+ {
+ unit = dr_WWW[0]["测量单位"].ToString();
+ }
+ catch
+ {
+ unit = "";
+ }
+ try
+ {
+ tagValueUp = qualityData.TagValueUp.ToString();
+ //if (dr_WWW_UpDown != null && dr_WWW_UpDown.Length > 0)
+ //{
+ // tagValueUp = dr_WWW_UpDown[0]["值上限"].ToString();
+ //}
+ //else
+ //{
+ // tagValueUp = "";
+ //}
+ }
+ catch
+ {
+ tagValueUp = "";
+ }
+ try
+ {
+ tagValueDown = "";
+ tagValueDown = qualityData.TagValueDown.ToString();
+ //if (dr_WWW_UpDown != null && dr_WWW_UpDown.Length > 0)
+ //{
+ // tagValueDown = dr_WWW_UpDown[0]["值下限"].ToString();
+ //}
+ }
+ catch
+ {
+ tagValueDown = "";
+ }
+ try
+ {
+ tagValeNormal = "";
+ tagValeNormal = qualityData.TagValeNormal.ToString();
+ //if (dr_WWW_UpDown != null && dr_WWW_UpDown.Length > 0)
+ //{
+ // tagValeNormal = dr_WWW_UpDown[0]["理论值"].ToString();
+ //}
+
+ }
+ catch
+ {
+ tagValeNormal = "";
+ }
+
+ dr = dt.NewRow();
+
+ dr["TagID"] = qualityData.tagID;
+ dr["测量位置"] = shaftID;
+ dr["测量项目"] = item;
+ dr["测量单位"] = unit;
+ dr["上限值"] = tagValueUp;
+ dr["下限值"] = tagValueDown;
+ dr["理论值"] = tagValeNormal;
+ dr["工位号"] = opName;
+ dr["列位置"] = qualityData.tagOrderBy;
+ dr["变量排序"] = qualityData.tagItemOrderBy;
+
+ dr["IsGoodBad"] = qualityData.isGoodBad;
+
+ switch (qualityData.tagTypeID)//
+ {
+ //合格标志数组
+ case 8203:
+ dr["TagValue"] = MisDataFun.GetQualityData_GoodBad_String((bool[])qualityData.tagValue);
+ break;
+ case 8209:
+ dr["TagValue"] = "";
+ break;
+ //非标准REAL
+ case 8210:
+ dr["TagValue"] = MisDataFun.GetNoNormalReal(qualityData.tagValue);
+ dt.Rows.Add(dr);
+ break;
+ default:
+ dr["TagValue"] = Convert.ToString(qualityData.tagValue);
+ dt.Rows.Add(dr);
+ break;
+ }
+
+ ////福田对质量数据特殊处理,MA20保留4位小数点,其余保留两位
+ //if (opName == "J07MA020")
+ //{
+ // dr["TagValue"] = Convert.ToDouble(dr["TagValue"]).ToString("0.####");
+ //}
+ //else
+ //{
+ // dr["TagValue"] = Convert.ToDouble(dr["TagValue"]).ToString("0.##");
+ //}
+
+ //if (opName == "J07MA150")
+ //{
+ // dr["变量排序"] = 1;
+ // dr["IsGoodBad"] = 1;
+ //}
+
+
+ }
+
+
+
+ }
+ catch (Exception err)
+ {
+ //ApplicationLog.WriteLog(err, err.Message);
+ }
+ }
+ }
+ ///
+ /// 数据表
+ ///
+ ///
+ private static object GetValueByTagTypeCodeID(ConcurrentDictionary opTagList, int TagTypeCodeID)
+ {
+ try
+ {
+ return opTagList.Where(x => x.Value.TagTypeCodeID == TagTypeCodeID).ToList()[0].Value.TagValue;
+
+ }
+ catch (Exception err) { return "-3"; }
+ }
+ ///
+ /// 根据工位名称,读取工位对应的质量数据,带合格标志
+ ///
+ ///
+ ///
+ public static Hashtable ReadPLC_OpName_Qd(ConcurrentDictionary tagValues)
+ {
+ //lock (l)
+ {
+
+ //var tagValues = DtWebApi.ReadWritePLC.ReadPLC_OpName(opName); //GetDbAndMaxLengthByOpNameByBytes(opName);
+
+ var keyValues = tagValues.Where(x => x.Value.TagTypeCodeID == 105).OrderBy(x => x.Key).ToDictionary(k => k.Key, v => v.Value);
+
+ TagFormat tagFormatTemp;
+ int tagIndex = 1;
+ int isOK = 0;
+ string TagValeNormal = "";
+ string TagValueDown = "";
+ string TagValueUp = "";
+
+ Hashtable ht = new Hashtable();
+
+ for (int i = 0; i < keyValues.Count / 8; i++)
+ {
+ isOK = Convert.ToInt32(keyValues.ElementAt(i * 8 + 0).Value.TagValue);
+ TagValeNormal = keyValues.ElementAt(i * 8 + 3).Value.TagValue.ToString();
+ TagValueUp = keyValues.ElementAt(i * 8 + 4).Value.TagValue.ToString();
+ TagValueDown = keyValues.ElementAt(i * 8 + 5).Value.TagValue.ToString();
+
+ var TF1 = keyValues.ElementAt(i * 8 + 1).Value;
+ QualityDataType1 qualityDataType1;
+ qualityDataType1 = GetQualityDataType(TF1);
+ qualityDataType1.isGoodBad = isOK;
+ qualityDataType1.TagValeNormal = TagValeNormal;
+ qualityDataType1.TagValueDown = TagValueDown;
+ qualityDataType1.TagValueUp = TagValueUp;
+ ht.Add(qualityDataType1.tagID, qualityDataType1);
+ var TF2 = keyValues.ElementAt(i * 8 + 2).Value;
+ QualityDataType1 qualityDataType2;
+ qualityDataType2 = GetQualityDataType(TF2);
+ qualityDataType2.isGoodBad = isOK;
+ qualityDataType2.TagValeNormal = TagValeNormal;
+ qualityDataType2.TagValueDown = TagValueDown;
+ qualityDataType2.TagValueUp = TagValueUp;
+ ht.Add(qualityDataType2.tagID, qualityDataType2);
+ }
+
+
+
+ //foreach (KeyValuePair _cd in keyValues)
+ //{
+ // if (_cd.Key.ToString()[0].ToString() == "7")
+ // {
+ // tagFormatTemp = _cd.Value;
+ // if (tagIndex % 8 == 1)
+ // {
+ // isOK = Convert.ToInt32(tagFormatTemp.TagValue);
+ // }
+ // else if (tagIndex % 8 == 2)
+ // {
+ // var TF = _cd.Value;
+
+ // QualityDataType qualityDataType;
+ // qualityDataType = GetQualityDataType(TF);
+ // qualityDataType.isGoodBad = isOK;
+ // ht.Add(qualityDataType.tagID, qualityDataType);
+ // }
+ // else if (tagIndex % 8 == 3)
+ // {
+ // var TF = (TagFormat)_cd.Value;
+
+ // QualityDataType qualityDataType;
+ // qualityDataType = GetQualityDataType(TF);
+ // qualityDataType.isGoodBad = isOK;
+ // ht.Add(qualityDataType.tagID, qualityDataType);
+ // }
+
+ // tagIndex++;
+ // }
+ // //Console.WriteLine($"key:{kv.Key} value:{kv.Value}");
+ //}
+ return ht;
+ }
+ }
+
+ //public static Hashtable ReadPLC_OpName_Entite(string opName)
+ //{
+ // //lock (l)
+ // {
+
+ // var tagValues = DtWebApi.ReadWritePLC.ReadPLC_OpName(opName); //GetDbAndMaxLengthByOpNameByBytes(opName);
+
+ // var keyValues = tagValues.OrderBy(x => x.Key).ToDictionary(k => k.Key, v => v.Value);
+
+ // TagFormat tagFormatTemp;
+ // int tagIndex = 1;
+ // int isOK = 0;
+
+ // Hashtable ht = new Hashtable();
+
+
+ // foreach (KeyValuePair _cd in keyValues)
+ // {
+ // if (_cd.Key.ToString()[0].ToString() == "7")
+ // {
+ // tagFormatTemp = _cd.Value;
+ // if (tagIndex % 3 == 1)
+ // {
+ // isOK = Convert.ToInt32(tagFormatTemp.TagValue);
+ // }
+ // else if (tagIndex % 3 == 2)
+ // {
+ // var TF = _cd.Value;
+
+ // QualityDataType qualityDataType;
+ // qualityDataType = GetQualityDataType(TF);
+ // qualityDataType.isGoodBad = isOK;
+ // ht.Add(qualityDataType.tagID, qualityDataType);
+ // }
+ // else if (tagIndex % 3 == 0)
+ // {
+ // var TF = (TagFormat)_cd.Value;
+
+ // QualityDataType qualityDataType;
+ // qualityDataType = GetQualityDataType(TF);
+ // qualityDataType.isGoodBad = isOK;
+ // ht.Add(qualityDataType.tagID, qualityDataType);
+ // }
+
+ // tagIndex++;
+ // }
+ // //Console.WriteLine($"key:{kv.Key} value:{kv.Value}");
+ // }
+ // return ht;
+ // }
+ //}
+ public static QualityDataType1 GetQualityDataType(TagFormat TF)
+ {
+ QualityDataType1 qualityDataType;
+
+ qualityDataType = new QualityDataType1();
+
+ qualityDataType.tagID = TF.TagID;
+ qualityDataType.tagTypeID = TF.TagTypeID;//变量类型
+ qualityDataType.opName = TF.OpName;
+ qualityDataType.tagValueType = TF.TagTypeCodeID;
+ int.TryParse(TF.TagOrderBy, out int TagOrderBy);
+ qualityDataType.tagOrderBy = TagOrderBy;
+ int.TryParse(TF.TagItemOrderBy, out int TagItemOrderBy);
+ qualityDataType.tagItemOrderBy = TagItemOrderBy;
+ qualityDataType.tagValue = TF.TagValue;//变量值
+
+ return qualityDataType;
+ }
+
+ public static bool BaseData_tagTable_QualityData_B5A_IndexInsert(string EngineID, string tagID, string EngineType, int EngineTypeID, string opName, int isGoodBad, string PartPalletCode, out int Id_tagCF)
+ {
+ string procedureName;
+ procedureName = "测量数据合格索引_增加";
+ Id_tagCF = 0;
+ SqlParameter[] thisParms = new SqlParameter[8];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@EngineID", EngineID);
+ thisParms[1] = new System.Data.SqlClient.SqlParameter("@TagID_CF", tagID);
+ thisParms[2] = new System.Data.SqlClient.SqlParameter("@EngineType", EngineType);
+ thisParms[3] = new System.Data.SqlClient.SqlParameter("@EngineTypeID", EngineTypeID);
+ thisParms[4] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
+ thisParms[5] = new System.Data.SqlClient.SqlParameter("@托盘编号", PartPalletCode);
+ thisParms[6] = new System.Data.SqlClient.SqlParameter("@合格标志", isGoodBad);
+ thisParms[7] = new System.Data.SqlClient.SqlParameter("@Id_tagCF", Id_tagCF);
+ thisParms[7].Direction = ParameterDirection.Output;
+
+ if (DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms))
+ {
+ Id_tagCF = Convert.ToInt32(thisParms[7].Value.ToString());
+ return true;
+ }
+ return false;
+ }
+ public static bool BaseData_tagTable_QualityData_B5A_Insert(int Id_tagCF, int engineTypeID, string engineID, string opName, DataTable dt, bool IsCheck = false)
+ {
+ string procedureName;
+ procedureName = "测量数据合格_增加";
+ SqlParameter[] thisParms = new SqlParameter[15];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@Id_tagCF", Id_tagCF);
+ thisParms[1] = new System.Data.SqlClient.SqlParameter("@EngineTypeID", engineTypeID);
+ thisParms[2] = new System.Data.SqlClient.SqlParameter("@EngineID", engineID);
+ thisParms[3] = new System.Data.SqlClient.SqlParameter("@TagID", SqlDbType.Int, 4, "TagID");
+ thisParms[4] = new System.Data.SqlClient.SqlParameter("@TagValue", SqlDbType.NVarChar, 100, "TagValue");
+ thisParms[5] = new System.Data.SqlClient.SqlParameter("@IsGoodBad", SqlDbType.Int, 4, "IsGoodBad");
+ //是否保存无合格标志数据数据
+ //thisParms[6] = new System.Data.SqlClient.SqlParameter("@IsCheck", IsCheck);
+ thisParms[6] = new System.Data.SqlClient.SqlParameter("@测量位置", SqlDbType.NVarChar, 50, "测量位置");
+ thisParms[7] = new System.Data.SqlClient.SqlParameter("@测量项目", SqlDbType.NVarChar, 50, "测量项目");
+ thisParms[8] = new System.Data.SqlClient.SqlParameter("@工位号", opName); //为了给J07MA020 保留四位精度而设置
+ thisParms[9] = new System.Data.SqlClient.SqlParameter("@理论值", SqlDbType.NVarChar, 50, "理论值");
+ thisParms[10] = new System.Data.SqlClient.SqlParameter("@上限值", SqlDbType.NVarChar, 50, "上限值");
+ thisParms[11] = new System.Data.SqlClient.SqlParameter("@下限值", SqlDbType.NVarChar, 50, "下限值");
+ thisParms[12] = new System.Data.SqlClient.SqlParameter("@测量单位", SqlDbType.NVarChar, 50, "测量单位");
+ thisParms[13] = new System.Data.SqlClient.SqlParameter("@列位置", SqlDbType.Int, 4, "列位置");
+ thisParms[14] = new System.Data.SqlClient.SqlParameter("@变量排序", SqlDbType.Int, 4, "变量排序");
+ //table.Columns.Add("TagID", typeof(System.Int32));
+ //table.Columns.Add("TagValue", typeof(System.String));
+ //table.Columns.Add("IsGoodBad", typeof(System.Int32));
+ //table.Columns.Add("测量位置", typeof(System.String));
+ //table.Columns.Add("测量项目", typeof(System.String));
+ //table.Columns.Add("工位号", typeof(System.String));
+ //table.Columns.Add("理论值", typeof(System.String));
+ //table.Columns.Add("上限值", typeof(System.String));
+ //table.Columns.Add("下限值", typeof(System.String));
+ //table.Columns.Add("测量单位", typeof(System.String));
+ //table.Columns.Add("列位置", typeof(System.Int32));
+ //table.Columns.Add("变量排序", typeof(System.Int32));
+ return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, dt);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Common/09MesDataFunction/MesDataFunction/13MIS_FuntionSaveData/GetQualityData_GoodBad.cs b/Common/09MesDataFunction/MesDataFunction/13MIS_FuntionSaveData/GetQualityData_GoodBad.cs
new file mode 100644
index 0000000..45c05f8
--- /dev/null
+++ b/Common/09MesDataFunction/MesDataFunction/13MIS_FuntionSaveData/GetQualityData_GoodBad.cs
@@ -0,0 +1,99 @@
+using System;
+
+using System.Data;
+
+
+
+namespace MisDataSaveDateMesRead
+{
+
+ public partial class Funtion
+ {
+ ///
+ /// 数据表
+ ///
+ ///
+ static public DataTable BuildDataTables_WWW()
+ {
+ DataTable table;
+ DataColumnCollection columns;
+ table = new DataTable();
+ columns = table.Columns;
+ table.Columns.Add("TagID", typeof(System.String));
+ table.Columns.Add("TagValue", typeof(System.String));
+ table.Columns.Add("IsGoodBad", typeof(System.Int32));
+ table.Columns.Add("测量位置", typeof(System.String));
+ table.Columns.Add("测量项目", typeof(System.String));
+ table.Columns.Add("工位号", typeof(System.String));
+ table.Columns.Add("理论值", typeof(System.String));
+ table.Columns.Add("上限值", typeof(System.String));
+ table.Columns.Add("下限值", typeof(System.String));
+ table.Columns.Add("测量单位", typeof(System.String));
+ table.Columns.Add("列位置", typeof(System.Int32));
+ table.Columns.Add("变量排序", typeof(System.Int32));
+
+ return table;
+ }
+ ///
+ /// 返回非标准real
+ ///
+ ///
+ ///
+ static public string GetNoNormalReal(object vDataValue)
+ {
+ try
+ {
+ string real_a;
+ string real_b;
+ string groupValueString;
+ int length;
+
+ //int real_b_Int;
+
+ length = ((System.Array)(vDataValue)).Length;
+ groupValueString = "";
+ if (length != 2)
+ return "0.0";
+
+ real_a = Convert.ToUInt16((((System.Array)(vDataValue)).GetValue(0))).ToString();
+ real_b = Convert.ToUInt16((((System.Array)(vDataValue)).GetValue(1))).ToString("00");
+ groupValueString = real_a + "." + real_b;
+ return groupValueString;
+ }
+ catch
+ {
+ ////ApplicationLog.WriteLog(err, "GetNoNormalReal");
+ return "0.0";
+
+ }
+ }
+
+ ///
+ /// 29 工位具体零件合格标志
+ ///
+ ///
+ static public string GetQualityData_GoodBad_String(bool[] QualityData_GoodBad)
+ {
+ string str;
+ str = "";
+ if (QualityData_GoodBad != null)
+ {
+
+ for (int i = 0; i < QualityData_GoodBad.Length; i++)
+ {
+ str = str + (Convert.ToInt32(QualityData_GoodBad[i])).ToString() + "|";
+ }
+
+ }
+ return str;
+
+ }
+ ///
+ /// 返回非标准real
+ ///
+ ///
+ ///
+
+
+ }
+}
diff --git a/Common/09MesDataFunction/MesDataFunction/14MisDataFunctionDB/CommFun_CATL.cs b/Common/09MesDataFunction/MesDataFunction/14MisDataFunctionDB/CommFun_CATL.cs
new file mode 100644
index 0000000..84a1056
--- /dev/null
+++ b/Common/09MesDataFunction/MesDataFunction/14MisDataFunctionDB/CommFun_CATL.cs
@@ -0,0 +1,18 @@
+
+using System.Threading;
+
+namespace MisDataFunDll
+{
+ public partial class CommFun_CATL
+ {
+
+ // 由于现在没有接口,先模拟调用webapi,输入参数1.电芯码,返回参数1.对比结果
+ public static int GetCellInfo(string cellCode)
+ {
+ int result = 1;
+ Thread.Sleep(200);
+ return result;
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/Common/09MesDataFunction/MesDataFunction/14MisDataFunctionDB/MisDataFun.Base.DB.cs b/Common/09MesDataFunction/MesDataFunction/14MisDataFunctionDB/MisDataFun.Base.DB.cs
new file mode 100644
index 0000000..77f7171
--- /dev/null
+++ b/Common/09MesDataFunction/MesDataFunction/14MisDataFunctionDB/MisDataFun.Base.DB.cs
@@ -0,0 +1,299 @@
+
+using DataLinkMesWork1;
+using System.Data;
+using System.Data.SqlClient;
+
+namespace MisDataFunDll
+{
+ public partial class MisDataFun
+ {
+ public static DataTable BaseData_tagTable_TagName()
+ {
+ DataTable dt = null;
+ string sql;
+ sql = "SELECT distinct[TagName],[变量类型代码] FROM[MES_基本变量_原始数据] ";
+ DataAccess.ExecuteDataTable(sql, out dt);
+ return dt;
+ }
+
+ public static DataTable GetMesServerCodeFromMIS()
+ {
+ DataTable dt;
+ string sql;
+ sql = "exec MES_计划BOM_工位与名称_查询应用程序";
+ DataAccess.ExecuteDataTable(sql, out dt);
+ return dt;
+ }
+
+ public static DataTable dt_Signal()
+ {
+ DataTable dt;
+ string sql;
+ sql = "SELECT * FROM [MES_基本变量_原始数据]";
+ DataAccess.ExecuteDataTable(sql, out dt);
+ return dt;
+ }
+
+ public static DataTable dt_Device()
+ {
+ DataTable dt;
+ string sql;
+ sql = "SELECT * FROM [MES_基本变量设备类型对应表]";
+ DataAccess.ExecuteDataTable(sql, out dt);
+ return dt;
+ }
+
+ public static DataTable dt_TagTypeDataType()
+ {
+ DataTable dt;
+ string sql;
+ sql = "SELECT TOP (1000) [序号],[变量类型],[TagTypeDataType],[TagName],[变量类型代码],[TagTypeChange],[MesTagTypeChange],[WebTagTypeChange],[信号点名称][变量类型名称] FROM [MES_基本变量变量类型代码]";
+ DataAccess.ExecuteDataTable(sql, out dt);
+ return dt;
+ }
+ public static DataTable GetCheckOpName()
+ {
+ DataTable dt = new DataTable();
+ string produceName = "MES_计划BOM_工位与名称_查询";
+ SqlParameter[] thisParms = null;
+
+
+ DataAccess.ExecuteStoredProcedure(produceName, ref thisParms, out dt);
+
+ return dt;
+ }
+
+ ///
+ /// 查询工步属性
+ ///
+ ///
+ public static DataTable GetworkStepPropertyFromMIS()
+ {
+ DataTable dt;
+ string sql;
+ sql = "SELECT distinct 工位号,工步属性 FROM [MES_计划BOM_工位与名称] where 是否监控=1";
+ DataAccess.ExecuteDataTable(sql, out dt);
+ return dt;
+ }
+
+ ///
+ /// 查询返修工位号
+ ///
+ ///
+ public static DataTable GetOpNameRepairFromMIS()
+ {
+ DataTable dt;
+ string sql;
+ sql = "SELECT distinct 工位号,返修工位号 FROM [MES_计划BOM_工位与名称] where 是否监控=1";
+ DataAccess.ExecuteDataTable(sql, out dt);
+ return dt;
+ }
+
+
+
+ ///
+ /// 测量工位号和工位名称
+ ///
+ ///
+ public static DataTable BaseData_tagTable_QualityData_OpName_Name()
+ {
+ DataTable dt;
+ string sql = "SELECT distinct [工位号],[工位名称] FROM [MES_计划BOM_工位与名称] "
+ + " where (监控属性代码 = '" + 1 + "')"
+ + " ORDER BY 工位号 ";
+ //来源于SQL Server
+ DataAccess.ExecuteDataTable(sql, out dt);
+ return dt;
+ }
+ ///
+ /// MES_计划BOM_工位与名称
+ ///
+ ///
+ public static DataTable BaseData_tagTable_OpName()
+ {
+ //DataTable dt;
+ //string sql = "SELECT * FROM [MES_计划BOM_工位与名称] "
+ // + " where (监控属性代码 = '" + ApplicationConfig.MES_Code.ToString() + "')"
+ // + " ORDER BY 工位号 ";
+ //DataAccess.ExecuteDataTable(sql, out dt);
+ //return dt;
+
+ //2022.07.27.LLX 处理了一下子
+ DataTable dt;
+ string sql = "SELECT * FROM [MES_计划BOM_工位与名称] "
+ + " where (监控属性代码 = '" + 1 + "') and [是否通过监控系统保存数据] is not null"
+ + " ORDER BY 工位号 ";
+ DataAccess.ExecuteDataTable(sql, out dt);
+ return dt;
+ }
+ ///
+ /// MES_基本变量_DB数据结构_根据工位代码_获得普通变量
+ ///
+ ///
+ public static DataTable BaseData_tagTable_OpcServerMES(int mesCode, string opName)
+ {
+ DataTable dt;
+ string sql;
+ sql = "SELECT TagID,0 as TagValue,TagName,工位号,数据来源,TagTypeID,TagLong,列位置,测量位置,变量类型代码,测量项目,TagAdr,TagAdrDemo,变量特点,变量排序 "
+ + " FROM MES_基本变量_原始数据 "
+ + " where 变量类型代码 = " + mesCode.ToString() + " and 是否启用 = 1"
+ + " and 工位号='" + opName + "'"
+ + " and (监控属性代码 = '" + 1 + "')";
+ DataAccess.ExecuteDataTable(sql, out dt);
+ return dt;
+ }
+ ///
+ /// MES_基本变量_DB数据结构_根据工位代码_获得普通变量
+ ///
+ ///
+ public static DataTable BaseData_tagTable_OpcServerMES(int mesCode)
+ {
+ DataTable dt;
+ string sql;
+ sql = "SELECT TagID,0 as TagValue,TagName,工位号,数据来源,TagTypeID,TagLong,列位置,测量位置,变量类型代码,测量项目,TagAdr,TagAdrDemo,变量特点,变量排序 "
+ + " FROM MES_基本变量_原始数据 "
+ + " where 变量类型代码 = " + mesCode.ToString() + " and 是否启用 = 1"
+ + " and (监控属性代码 = '" + 1 + "')";
+ DataAccess.ExecuteDataTable(sql, out dt);
+ return dt;
+ }
+
+ ///
+ /// MES_基本变量_DB数据结构_获得激发变量
+ ///
+ ///
+ public static DataTable BaseData_tagTable_All()
+ {
+ //string errorMessage;
+ DataTable dt = null;
+ string sql;
+ sql = "SELECT TagID,0 as TagValue,TagName,工位号,数据来源,TagTypeID,TagLong,列位置,测量位置,变量类型代码,测量项目,TagAdr,TagAdrDemo,变量特点,变量排序 FROM [MES_基本变量_原始数据] "
+ + " where ((变量类型代码 >= 19 and 变量类型代码 <= 27) or (变量类型代码 = 101) or (变量类型代码 = 102) or (变量类型代码 = 105) or (变量类型代码 = 1000) or (变量类型代码 = 1001) or (变量类型代码 = 1002) or (变量类型代码 = 1003) or (变量类型代码 = 1004)) and (是否启用 = 1) "
+ + " and (监控属性代码 = '" + 1 + "')"
+ + " ORDER BY TagID ";
+ DataAccess.ExecuteDataTable(sql, out dt);
+ return dt;
+ }
+ ///
+ /// MES_基本变量_DB数据结构_获得激发变量
+ ///
+ ///
+ public static DataTable BaseData_tagTable_All_B5A()
+ {
+ //string errorMessage;
+ DataTable dt = null;
+ string sql;
+ sql = "SELECT TagID,0 as TagValue,TagName,工位号,数据来源,TagTypeID,TagLong,列位置,测量位置,变量类型代码,测量项目,TagAdr,TagAdrDemo,变量特点,变量排序 FROM [MES_基本变量_原始数据] "
+ + " where ((变量类型代码 = 101) or (变量类型代码 = 102) ) and (是否启用 = 1) "
+ + " and (监控属性代码 = '" + 1 + "')"
+ + " ORDER BY TagID ";
+ DataAccess.ExecuteDataTable(sql, out dt);
+ return dt;
+ }
+
+ ///
+ /// 20170310 新加
+ /// MES_基本变量_DB数据结构_获得所有普通变量(除101.102.103.104.105)
+ ///
+ ///
+ public static DataTable BaseData_tagTable_OpcServerMES_ALL_CF()
+ {
+ DataTable dt;
+ string sql;
+ sql = "SELECT TagID,0 as TagValue,TagName,工位号,数据来源,TagTypeID,TagLong,列位置,测量位置,变量类型代码,测量项目,TagAdr,TagAdrDemo,变量特点,变量排序 "
+ + " FROM MES_基本变量_原始数据 "
+ + " where 变量类型代码 <> 101 and 变量类型代码 <> 102 and 变量类型代码 <> 103 and 变量类型代码 <> 104 and 变量类型代码 <> 105 and 是否启用 = 1"
+ + " and (监控属性代码 = '" + 1 + "')";
+ DataAccess.ExecuteDataTable(sql, out dt);
+ return dt;
+ }
+
+ ///
+ /// 发动机类型转换表
+ /// SELECT ID,发动机机型代码 FROM MES_计划BOM_发动机型号代码
+ ///
+ ///
+ public static DataTable BaseData_tagTable_QualityData_EngineTypeID()
+ {
+ DataTable dt;
+ string sql;
+ sql = "SELECT ID,发动机机型代码 FROM MES_计划BOM_发动机型号代码 ";
+ DataAccess.ExecuteDataTable(sql, out dt);
+ return dt;
+ }
+
+
+ ///
+ /// 测量合格标志
+ /// 全部测量数据的测量工位
+ ///
+ ///
+ public static DataTable BaseData_tagTable_QualityData_GoodBad_MIS_OpName_B5A()
+ {
+ DataTable dt;
+ string sql;
+ sql = "SELECT distinct 工位号 "
+ + " FROM MES_基本变量_原始数据 "
+ + " where 变量特点 = 8 and 是否启用 = 1 "
+ + " and (监控属性代码 = '" + 1 + "')";
+ DataAccess.ExecuteDataTable(sql, out dt);
+ return dt;
+ }
+
+ ///
+ /// 测量合格标志
+ /// 全部测量数据的测量工位的数据来源
+ ///
+ ///
+ public static DataTable BaseData_tagTable_QualityData_GoodBad_MIS_OpName(string opName)
+ {
+ DataTable dt;
+ string sql;
+ sql = "SELECT TagID,工位号,数据来源 "
+ + " FROM MES_基本变量_原始数据 "
+ + " where OpcServer_OPNAME = '1' and 是否启用 = 1 "
+ + " and 工位号='" + opName + "'"
+ + " and (监控属性代码 = '" + 1 + "')";
+ DataAccess.ExecuteDataTable(sql, out dt);
+ return dt;
+ }
+
+ ///
+ /// 测量合格标志
+ /// 全部测量数据的测量工位的数据来源的测量变量
+ ///
+ ///
+ public static DataTable BaseData_tagTable_QualityData_GoodBad_MIS_OpName(string opName, string opNameFrom)
+ {
+ DataTable dt;
+ string sql;
+ sql = "SELECT TagID "
+ + " FROM MES_基本变量_原始数据 "
+ + " where OpcServer_OPNAME = '2' and 是否启用 = 1 "
+ + " and 工位号='" + opName + "'"
+ + " and 数据来源='" + opNameFrom + "'"
+ + " and (监控属性代码 = '" + 1 + "')";
+ DataAccess.ExecuteDataTable(sql, out dt);
+ return dt;
+ }
+ ///
+ /// MES_基本变量_机型代码_查询
+ ///
+ ///
+ static public void EngineType_Select(out DataTable dt)
+ {
+ dt = null;
+ string sql = "exec MES_基本变量_机型代码_查询";
+ DataAccess.ExecuteDataTable(sql, out dt);
+ }
+
+
+
+
+
+
+
+
+
+ }
+}
diff --git a/Common/09MesDataFunction/MesDataFunction/14MisDataFunctionDB/MisDataFun.CommonUtils.cs b/Common/09MesDataFunction/MesDataFunction/14MisDataFunctionDB/MisDataFun.CommonUtils.cs
new file mode 100644
index 0000000..8150218
--- /dev/null
+++ b/Common/09MesDataFunction/MesDataFunction/14MisDataFunctionDB/MisDataFun.CommonUtils.cs
@@ -0,0 +1,49 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Data;
+
+namespace MisDataFunDll
+{
+ public partial class MisDataFun
+ {
+ ///
+ /// Source|Cmd|OpName|TagValue
+ ///
+ ///
+ ///
+ public static List GetCmdStringList(string cmd)
+ {
+ List list = new List();
+ string item;
+ int index;
+ try
+ {
+ index = cmd.IndexOf('|');
+ item = cmd.Substring(0, index);
+ list.Add(item);
+
+ cmd = cmd.Substring(index + 1);
+ index = cmd.IndexOf('|');
+ item = cmd.Substring(0, index);
+ list.Add(item);
+
+ cmd = cmd.Substring(index + 1);
+ index = cmd.IndexOf('|');
+ item = cmd.Substring(0, index);
+ list.Add(item);
+
+ item = cmd.Substring(index + 1);
+
+ list.Add(item);
+
+ }
+ catch { }
+
+
+ return list;
+ }
+
+
+ }
+}
\ No newline at end of file
diff --git a/Common/09MesDataFunction/MesDataFunction/14MisDataFunctionDB/MisDataFun.DB.cs b/Common/09MesDataFunction/MesDataFunction/14MisDataFunctionDB/MisDataFun.DB.cs
new file mode 100644
index 0000000..a57f39a
--- /dev/null
+++ b/Common/09MesDataFunction/MesDataFunction/14MisDataFunctionDB/MisDataFun.DB.cs
@@ -0,0 +1,1835 @@
+
+using DataLinkMesWork1;
+using MesServerFunctions;
+using Newtonsoft.Json;
+using Opc.Ua.Export;
+using System;
+using System.Data;
+using System.Data.SqlClient;
+using System.Diagnostics.Eventing.Reader;
+
+namespace MisDataFunDll
+{
+ public partial class MisDataFun
+ {
+
+ public class MobyTagType
+ {
+ ///
+ /// 配方号
+ ///
+ public static string PLCRcipe = "配方号";
+ ///
+ /// 工位号
+ ///
+ public static string OpName = "工位号";
+ ///
+ /// 订单号
+ ///
+ public static string OrderForm = "订单号";
+ ///
+ /// 订单号
+ ///
+ public static string OrderForm_MES = "订单号_MES";
+ ///
+ /// 产品型号代码
+ ///
+ public static string EngineTypeID = "产品型号代码";
+ ///
+ /// 变速器序列号
+ /// 变速器序列号
+ public static string EngineID = "变速器序列号";
+
+ ///
+ /// 发动机型号
+ ///
+ public static string EngineType = "发动机型号";
+ ///
+ /// 机型基本代码
+ ///
+ public static string EngineTypeBasicID = "机型基本代码";
+ ///
+ /// 机型基本代码
+ ///
+ public static string EngineTypeBasic = "基本机型";
+ ///
+ /// 变速器总成号
+ ///
+ public static string EngineIDPrinte = "变速器总成号";
+ ///
+ /// 托盘号
+ ///
+ public static string PartPallet_Code = "托盘号";
+ ///
+ /// 产品型号代码_MES
+ ///
+ public static string EngineTypeID_MES = "产品型号代码_MES";
+ ///
+ /// 变速器序列号_MES
+ ///
+ public static string EngineID_MES = "变速器序列号_MES";
+ ///
+ /// 发动机型号_MES
+ ///
+ public static string EngineType_MES = "发动机型号_MES";
+ ///
+ /// 到达时间线外工位
+ ///
+ public static string WorkStartOutSideIn = "到达时间线外工位";
+ ///
+ /// 离开时间线外工位
+ ///
+ public static string WorkStartOutSideOut = "离开时间线外工位";
+ ///
+ /// 到达时间
+ ///
+ public static string WorkStartIn = "到达时间";
+ ///
+ /// 离开时间
+ ///
+ public static string WorkStartOut = "离开时间";
+ ///
+ /// 持续时间
+ ///
+ public static string WorkStartTime = "持续时间";
+ ///
+ /// 扫描条码
+ ///
+ public static string BarCode = "扫描条码";
+ ///
+ /// 工件到位 2
+ ///
+ public static string WorkStart = "工件到位";
+ ///
+ /// 传递机型 44
+ ///
+ public static string EngineTypeGetOverPLC = "传递机型";
+ ///
+ /// 申请上件 43
+ ///
+ public static string PartLoad = "申请上件";
+ ///
+ /// 允许保存 19
+ ///
+ public static string MesRead = "允许保存";
+ ///
+ /// 保存完成 20
+ ///
+ public static string MesReadOver = "保存完成";
+ ///
+ /// 允许工作 20
+ ///
+ public static string FixAllow = "允许工作";
+
+
+
+
+ /// [机床上电],[循环开始],[机床故障],[上料无件],[下料堵塞],[工件到位]
+ /// [传递机型],[申请上件],[允许保存],[保存完成],[合格标志],[前序合格]
+ /// [工号],[班次],[是否返修件],[合格放行],[不合格放行]
+ /// [到达时间],[离开时间],[持续时间]
+ // engineTypeID = Convert.ToInt32(thisParms[2].Value);
+ //engineType = thisParms[3].Value.ToString();
+ //engineID = thisParms[4].Value.ToString();
+ //palletCode = thisParms[5].Value.ToString();
+ }
+
+ ///
+ /// 测量数据工位_监控系统_MOBY_线首_增加
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static bool OpName_MIS_MOBY_Insert_FirstOpName(string opName, int engineTypeID, int engineTypeID_MES, string engineType, string engineType_MES, string engineID, string engineID_MES, int palletCode, string orderForm, string orderForm_MES)
+ {
+ string produceName = "测量数据工位_监控系统_MOBY_线首_增加";
+ SqlParameter[] thisParms = new SqlParameter[10];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
+ thisParms[1] = new System.Data.SqlClient.SqlParameter("@产品型号代码", engineTypeID);
+ thisParms[2] = new System.Data.SqlClient.SqlParameter("@产品型号代码_MES", engineTypeID_MES);
+ thisParms[3] = new System.Data.SqlClient.SqlParameter("@发动机型号", engineType);
+ thisParms[4] = new System.Data.SqlClient.SqlParameter("@发动机型号_MES", engineType_MES);
+ thisParms[5] = new System.Data.SqlClient.SqlParameter("@发动机号", engineID);
+ thisParms[6] = new System.Data.SqlClient.SqlParameter("@发动机号_MES", engineID_MES);
+ thisParms[7] = new System.Data.SqlClient.SqlParameter("@订单号", orderForm);
+ thisParms[8] = new System.Data.SqlClient.SqlParameter("@订单号_MES", orderForm_MES);
+ thisParms[9] = new System.Data.SqlClient.SqlParameter("@托盘号", palletCode);
+ return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
+ }
+ ///
+ /// 测量数据工位_监控系统_MOBY_增加
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static bool OpName_MIS_MOBY_Insert(string opName, string tagType, string tagValue)
+ {
+ string produceName = "北汽福田工位状态监控MOBY_增加";
+ SqlParameter[] thisParms = new SqlParameter[3];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
+ thisParms[1] = new System.Data.SqlClient.SqlParameter("@变量类型", tagType);
+ thisParms[2] = new System.Data.SqlClient.SqlParameter("@变量值", tagValue);
+
+ return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
+ }
+
+ ///
+ /// 生产计划_派工订单_工件追溯_校验
+ ///
+ ///
+ ///
+ ///
+ public static DataTable WorkOrderCheck(string opName, string EngineID, string OrderFrom, string EngineType)
+ {
+ string produceName = "生产计划_派工订单_工件追溯_校验";
+ SqlParameter[] thisParms = new SqlParameter[4];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
+ thisParms[1] = new System.Data.SqlClient.SqlParameter("@工件编号", EngineID);
+ thisParms[2] = new System.Data.SqlClient.SqlParameter("@订单号", OrderFrom);
+ thisParms[3] = new System.Data.SqlClient.SqlParameter("@机型", EngineType);
+ DataAccess.ExecuteStoredProcedure(produceName, ref thisParms, out DataTable dt);
+ return dt;
+ }
+
+ ///
+ /// 接口_IOT接口_报工记录_是否报工判断
+ ///
+ ///
+ ///
+ ///
+ public static DataTable IOT_ReqData_UpLoad_IsSend(string opName, string OrderFrom, string reqType)
+ {
+ string produceName = "接口_IOT接口_报工记录_是否报工判断";
+ SqlParameter[] thisParms = new SqlParameter[3];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
+ thisParms[1] = new System.Data.SqlClient.SqlParameter("@订单号", OrderFrom);
+ thisParms[2] = new System.Data.SqlClient.SqlParameter("@报工类型", reqType);
+ DataAccess.ExecuteStoredProcedure(produceName, ref thisParms, out DataTable dt);
+ return dt;
+ }
+
+ ///
+ /// 测量数据工位_监控系统_MOBY_增加
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static bool OpName_MIS_MOBY_Insert_JZ(string opName, string engineID)
+ {
+ string produceName = "测量数据工位_监控系统_MOBY_静置工位_增加";
+ SqlParameter[] thisParms = new SqlParameter[2];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
+ thisParms[1] = new System.Data.SqlClient.SqlParameter("@发动机号", engineID);
+ return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
+ }
+
+ public static void BarCodeIsSecondVerification(string opName, out bool isSecondVerification)
+ {
+ isSecondVerification = false;
+ DataTable dt = new DataTable();
+ string produceName = "测量数据工位_监控系统_是否二次验证_查询";
+ SqlParameter[] thisParms = new SqlParameter[1];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
+ DataAccess.ExecuteStoredProcedure(produceName, ref thisParms, out dt);
+ if (dt.Rows.Count > 0)
+ {
+ string isVerification = dt.Rows[0]["是否验证"].ToString();
+ if (isVerification == "1")
+ {
+ isSecondVerification = true;
+ }
+ }
+ }
+ ///
+ /// 日志_工位操作_增加
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static bool LogRecording_OP(string OpName, string type, string msgType, string content)
+ {
+ string produceName = "日志_工位操作_增加";
+ SqlParameter[] thisParms = new SqlParameter[4];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", OpName);
+ thisParms[1] = new System.Data.SqlClient.SqlParameter("@消息类型", type);
+ thisParms[2] = new System.Data.SqlClient.SqlParameter("@操作类型", msgType);
+ thisParms[3] = new System.Data.SqlClient.SqlParameter("@内容", content);
+ return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
+ }
+ ///
+ /// 电子看板_工序内容_临时表_增加
+ ///
+ ///
+ ///
+ public static bool MesServer_ProcessList_EngineTypeOver(string opName)
+ {
+ string produceName = "电子看板_工序内容_临时表_增加";
+ SqlParameter[] thisParms = new SqlParameter[1];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
+ return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
+ }
+ ///
+ /// 电子看板_装配零件_临时表_增加
+ ///
+ ///
+ ///
+ public static bool MesServer_Process_EngineTypeOver(string opName)
+ {
+ string produceName = "电子看板_装配零件_临时表_增加";
+ SqlParameter[] thisParms = new SqlParameter[1];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
+ return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
+ }
+ ///
+ /// 测量数据工位_监控系统_MOBY_查询
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static void Moby_Select(string opName, out string OrderForm, out int EngineTypeID, out string EngineType, out string EngineID, out string PartPallet_Code, out int IsrepairBarcode, out string repairBarcode, out string EngineTypeString)
+ {
+ DataTable dt = new DataTable();
+ OrderForm = "";
+ EngineTypeID = 0;
+ EngineType = "";
+ EngineID = "";
+ PartPallet_Code = "0";
+ IsrepairBarcode = 0;
+ repairBarcode = "0";
+ EngineTypeString = "";
+ try
+ {
+ string procedureName;
+ procedureName = "测量数据工位_监控系统_MOBY_查询";
+ SqlParameter[] thisParms = new SqlParameter[1];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
+
+ DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt);
+ if (dt.Rows.Count > 0)
+ {
+ OrderForm = dt.Rows[0]["订单号"].ToString();
+ EngineTypeID = Convert.ToInt32(dt.Rows[0]["产品型号代码"]); ;
+ EngineType = dt.Rows[0]["发动机型号"].ToString();
+ EngineID = dt.Rows[0]["发动机号"].ToString();
+ PartPallet_Code = dt.Rows[0]["托盘号"].ToString();
+ }
+ }
+ catch
+ {
+ OrderForm = "";
+ EngineTypeID = 0;
+ EngineType = "";
+ EngineID = "";
+ PartPallet_Code = "0";
+ IsrepairBarcode = 0;
+ repairBarcode = "";
+ EngineTypeString = "";
+ }
+ }
+
+ ///
+ /// 测量数据工位_监控系统_MOBY_查询
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static void Moby_Select(string opName, out string orderNum,
+ out int EngineTypeID, out string EngineType, out string EngineID, out string PartPallet_Code,
+ out int IsrepairBarcode, out string repairBarcode,
+ out string workCode, out string projectName, out string splitCode, out string unidCode, out string engineType, out string engineTypeModel, out string startTime)
+ {
+ orderNum = "";
+ EngineTypeID = 0;
+ EngineType = "";
+ EngineID = "";
+ PartPallet_Code = "";
+ IsrepairBarcode = 0;
+ repairBarcode = "";
+ workCode = ""; // 制造编号
+ projectName = ""; // 项目名称
+ splitCode = ""; // 间隔号
+ unidCode = ""; // 单元号
+ engineType = ""; // 本体类型
+ engineTypeModel = ""; // 附件类型
+ startTime = ""; // 开始时间
+
+ try
+ {
+ string procedureName;
+ procedureName = "测量数据工位_监控系统_MOBY_查询";
+ SqlParameter[] thisParms = new SqlParameter[15];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
+ thisParms[1] = new System.Data.SqlClient.SqlParameter("@订单号", SqlDbType.NVarChar, 50, "订单号");
+ thisParms[1].Direction = ParameterDirection.Output;
+ thisParms[2] = new System.Data.SqlClient.SqlParameter("@产品型号代码", SqlDbType.Int, 4, "产品型号代码");
+ thisParms[2].Direction = ParameterDirection.Output;
+ thisParms[3] = new System.Data.SqlClient.SqlParameter("@发动机型号", SqlDbType.NVarChar, 50, "发动机型号");
+ thisParms[3].Direction = ParameterDirection.Output;
+ thisParms[4] = new System.Data.SqlClient.SqlParameter("@发动机号", SqlDbType.NVarChar, 50, "发动机号");
+ thisParms[4].Direction = ParameterDirection.Output;
+ thisParms[5] = new System.Data.SqlClient.SqlParameter("@托盘号", SqlDbType.NVarChar, 50, "托盘号");
+ thisParms[5].Direction = ParameterDirection.Output;
+ thisParms[6] = new System.Data.SqlClient.SqlParameter("@拆解标志", SqlDbType.Int, 4, "拆解标志");
+ thisParms[6].Direction = ParameterDirection.Output;
+ thisParms[7] = new System.Data.SqlClient.SqlParameter("@拆解返修条码", SqlDbType.NVarChar, 50, "拆解返修条码");
+ thisParms[7].Direction = ParameterDirection.Output;
+ thisParms[8] = new System.Data.SqlClient.SqlParameter("@制造编号", SqlDbType.NVarChar, 50, "制造编号");
+ thisParms[8].Direction = ParameterDirection.Output;
+ thisParms[9] = new System.Data.SqlClient.SqlParameter("@间隔号", SqlDbType.NVarChar, 50, "间隔号");
+ thisParms[9].Direction = ParameterDirection.Output;
+ thisParms[10] = new System.Data.SqlClient.SqlParameter("@单元号", SqlDbType.NVarChar, 50, "单元号");
+ thisParms[10].Direction = ParameterDirection.Output;
+ thisParms[11] = new System.Data.SqlClient.SqlParameter("@项目名称", SqlDbType.NVarChar, 50, "项目名称");
+ thisParms[11].Direction = ParameterDirection.Output;
+ thisParms[12] = new System.Data.SqlClient.SqlParameter("@本体类型", SqlDbType.NVarChar, 50, "本体类型");
+ thisParms[12].Direction = ParameterDirection.Output;
+ thisParms[13] = new System.Data.SqlClient.SqlParameter("@附件类型", SqlDbType.NVarChar, 50, "附件类型");
+ thisParms[13].Direction = ParameterDirection.Output;
+ thisParms[14] = new System.Data.SqlClient.SqlParameter("@开始时间", SqlDbType.NVarChar, 50, "开始时间");
+ thisParms[14].Direction = ParameterDirection.Output;
+ DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
+ if (thisParms[1].Value != null && thisParms[2].Value != null && thisParms[3].Value != null && thisParms[4].Value != null && thisParms[5].Value != null && thisParms[6].Value != null && thisParms[7].Value != null)
+ {
+ orderNum = thisParms[1].Value.ToString();
+ EngineTypeID = Convert.ToInt32(thisParms[2].Value); ;
+ EngineType = thisParms[3].Value.ToString();
+ EngineID = thisParms[4].Value.ToString();
+ PartPallet_Code = thisParms[5].Value.ToString();
+ IsrepairBarcode = Convert.ToInt32(thisParms[6].Value);
+ repairBarcode = thisParms[7].Value.ToString();
+ workCode = thisParms[8].Value.ToString(); // 制造编号
+ projectName = thisParms[9].Value.ToString(); // 项目名称
+ splitCode = thisParms[10].Value.ToString();// 间隔号
+ unidCode = thisParms[11].Value.ToString(); // 单元号
+ engineType = thisParms[12].Value.ToString(); // 本体类型
+ engineTypeModel = thisParms[13].Value.ToString(); // 附件类型
+ startTime = thisParms[14].Value.ToString(); // 开始时间
+ }
+ }
+ catch
+ {
+ orderNum = "";
+ EngineTypeID = 0;
+ EngineType = "";
+ EngineID = "";
+ PartPallet_Code = "";
+ IsrepairBarcode = 0;
+ repairBarcode = "";
+ workCode = ""; // 制造编号
+ projectName = ""; // 项目名称
+ splitCode = ""; // 间隔号
+ unidCode = ""; // 单元号
+ engineType = ""; // 本体类型
+ engineTypeModel = ""; // 附件类型
+ }
+ }
+
+ ///
+ /// 电子看板_工序内容_查询
+ ///
+ /// 工位号
+ /// 产品型号代码
+ ///
+ static public void Process_Select(string opName, int engineTypeID, string EngineType, out DataTable dt)
+ {
+ dt = null;
+ string sql = "exec 电子看板_工序内容_查询 '" + opName + "'," + engineTypeID.ToString() + ",'" + EngineType + "'";
+ DataAccess.ExecuteDataTable(sql, out dt);
+ }
+ ///
+ /// 电子看板_装配零件_物料验证_查询
+ ///
+ /// 工位号
+ /// 发动机号
+ ///
+ static public bool PartMaterialVerify_Select(string opName, int engineTypeID, string engineType, out DataTable dt)
+ {
+ dt = null;
+ string procedureName;
+ procedureName = "电子看板_装配零件_临时表_查询";
+ SqlParameter[] thisParms = new SqlParameter[1];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
+ return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt);
+ }
+ ///
+ /// 电子看板_装配零件_临时表_判断_是否允许工作
+ ///
+ ///
+ ///
+ ///
+ public static bool MesServer_Judge_IsCanWork(string opName, out int IsAllowWork)
+ {
+ IsAllowWork = 0;
+ string produceName = "电子看板_装配零件_临时表_判断_是否允许工作";
+ SqlParameter[] thisParms = new SqlParameter[2];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
+ thisParms[1] = new System.Data.SqlClient.SqlParameter("@是否允许工作", IsAllowWork);
+ thisParms[1].Direction = ParameterDirection.Output;
+ if (DataAccess.ExecuteStoredProcedure(produceName, ref thisParms))
+ {
+ IsAllowWork = Convert.ToInt32(thisParms[1].Value);
+ return true;
+ }
+ return false;
+ }
+
+ ///
+ /// [电子看板_装配零件_临时表_增加_北汽]
+ ///
+ ///
+ ///
+ public static bool MesServer_Process_EngineTypeOverBQ(string opName)
+ {
+ string produceName = "电子看板_装配零件_临时表_增加_北汽";
+ SqlParameter[] thisParms = new SqlParameter[1];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
+ return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
+ }
+
+ ///
+ /// 发送页面点位 同时存入数据库状态
+ ///
+ ///
+ public static void MobySendWebAndSaveData(string OpName, string tagType, string tagValue)
+ {
+ MisDataFun.OpName_MIS_MOBY_Insert(OpName, tagType, tagValue);
+ // 判断是否为涉及前端页面的信号,如果是则同步发送点位
+ string tagName = "";
+ switch (tagType)
+ {
+ case "工件到位":
+ tagName = "WorkStart";
+ break;
+ case "传递机型":
+ tagName = "EngineTypeGetOverPLC";
+ break;
+ case "申请上件":
+ tagName = "PartLoad";
+ break;
+ case "允许工作":
+ tagName = "FixAllow";
+ break;
+ case "允许保存":
+ tagName = "MesRead";
+ break;
+ case "保存完成":
+ tagName = "MesReadOver";
+ break;
+ default:
+ break;
+ }
+ if (tagName != "")
+ {
+ SendMessageFun.SendInfomation(tagName, Convert.ToString(Convert.ToInt32(tagValue)), OpName);
+ }
+ }
+
+ ///
+ /// 电子看板_装配零件_临时表_修改_零件条码
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static bool PartMaterial_DM_Update(string opName, string barCode, out bool IsSuccess)
+ {
+ IsSuccess = false;
+ string produceName = "电子看板_装配零件_临时表_修改_零件条码";
+ SqlParameter[] thisParms = new SqlParameter[3];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
+ thisParms[1] = new System.Data.SqlClient.SqlParameter("@条码", barCode);
+ thisParms[2] = new System.Data.SqlClient.SqlParameter("@条码是否符合", IsSuccess);
+ thisParms[2].Direction = ParameterDirection.Output;
+ if (DataAccess.ExecuteStoredProcedure(produceName, ref thisParms))
+ {
+ IsSuccess = Convert.ToBoolean(thisParms[2].Value);
+ return true;
+ }
+ return false;
+ }
+
+ ///
+ /// 测量数据合格索引_增加
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static bool BaseData_tagTable_QualityData_B5A_IndexInsert(string EngineID, string tagID, string EngineType, int EngineTypeID, string opName, int isGoodBad, string PartPalletCode, out int Id_tagCF)
+ {
+ string procedureName;
+ procedureName = "测量数据合格索引_增加";
+ Id_tagCF = 0;
+ SqlParameter[] thisParms = new SqlParameter[8];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@EngineID", EngineID);
+ thisParms[1] = new System.Data.SqlClient.SqlParameter("@TagID_CF", tagID);
+ thisParms[2] = new System.Data.SqlClient.SqlParameter("@EngineType", EngineType);
+ thisParms[3] = new System.Data.SqlClient.SqlParameter("@EngineTypeID", EngineTypeID);
+ thisParms[4] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
+ thisParms[5] = new System.Data.SqlClient.SqlParameter("@托盘编号", PartPalletCode);
+ thisParms[6] = new System.Data.SqlClient.SqlParameter("@合格标志", isGoodBad);
+ thisParms[7] = new System.Data.SqlClient.SqlParameter("@Id_tagCF", Id_tagCF);
+ thisParms[7].Direction = ParameterDirection.Output;
+
+ if (DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms))
+ {
+ Id_tagCF = Convert.ToInt32(thisParms[7].Value.ToString());
+ return true;
+ }
+ return false;
+ }
+ ///
+ /// 测量数据合格_增加
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static bool BaseData_tagTable_QualityData_B5A_Insert(int Id_tagCF, int engineTypeID, string engineID, string opName, DataTable dt, bool IsCheck = false)
+ {
+ string procedureName;
+ procedureName = "测量数据合格_增加";
+ SqlParameter[] thisParms = new SqlParameter[15];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@Id_tagCF", Id_tagCF);
+ thisParms[1] = new System.Data.SqlClient.SqlParameter("@EngineTypeID", engineTypeID);
+ thisParms[2] = new System.Data.SqlClient.SqlParameter("@EngineID", engineID);
+ thisParms[3] = new System.Data.SqlClient.SqlParameter("@TagID", SqlDbType.Int, 4, "TagID");
+ thisParms[4] = new System.Data.SqlClient.SqlParameter("@TagValue", SqlDbType.NVarChar, 100, "TagValue");
+ thisParms[5] = new System.Data.SqlClient.SqlParameter("@IsGoodBad", SqlDbType.Int, 4, "IsGoodBad");
+ //是否保存无合格标志数据数据
+ //thisParms[6] = new System.Data.SqlClient.SqlParameter("@IsCheck", IsCheck);
+ thisParms[6] = new System.Data.SqlClient.SqlParameter("@测量位置", SqlDbType.NVarChar, 50, "测量位置");
+ thisParms[7] = new System.Data.SqlClient.SqlParameter("@测量项目", SqlDbType.NVarChar, 50, "测量项目");
+ thisParms[8] = new System.Data.SqlClient.SqlParameter("@工位号", opName); //为了给J07MA020 保留四位精度而设置
+ thisParms[9] = new System.Data.SqlClient.SqlParameter("@理论值", SqlDbType.NVarChar, 50, "理论值");
+ thisParms[10] = new System.Data.SqlClient.SqlParameter("@上限值", SqlDbType.NVarChar, 50, "上限值");
+ thisParms[11] = new System.Data.SqlClient.SqlParameter("@下限值", SqlDbType.NVarChar, 50, "下限值");
+ thisParms[12] = new System.Data.SqlClient.SqlParameter("@测量单位", SqlDbType.NVarChar, 50, "测量单位");
+ thisParms[13] = new System.Data.SqlClient.SqlParameter("@列位置", SqlDbType.Int, 4, "列位置");
+ thisParms[14] = new System.Data.SqlClient.SqlParameter("@变量排序", SqlDbType.Int, 4, "变量排序");
+ //table.Columns.Add("TagID", typeof(System.Int32));
+ //table.Columns.Add("TagValue", typeof(System.String));
+ //table.Columns.Add("IsGoodBad", typeof(System.Int32));
+ //table.Columns.Add("测量位置", typeof(System.String));
+ //table.Columns.Add("测量项目", typeof(System.String));
+ //table.Columns.Add("工位号", typeof(System.String));
+ //table.Columns.Add("理论值", typeof(System.String));
+ //table.Columns.Add("上限值", typeof(System.String));
+ //table.Columns.Add("下限值", typeof(System.String));
+ //table.Columns.Add("测量单位", typeof(System.String));
+ //table.Columns.Add("列位置", typeof(System.Int32));
+ //table.Columns.Add("变量排序", typeof(System.Int32));
+ return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, dt);
+ }
+ ///
+ /// 测量数据合格_手动拧紧_增加
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static bool BaseData_tagTable_QualityData_B5A_Insert(int engineTypeID, string engineType, string engineID, string tagValue, int isGoodBad, string opName, string partPallet, int tagID, int tagID_CF, string MaxValue, string MinValue)
+ {
+ string procedureName;
+ procedureName = "测量数据合格_手动拧紧_增加";
+ SqlParameter[] thisParms = new SqlParameter[11];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@EngineTypeID", engineTypeID);
+ thisParms[1] = new System.Data.SqlClient.SqlParameter("@EngineType", engineType);
+ thisParms[2] = new System.Data.SqlClient.SqlParameter("@EngineID", engineID);
+ thisParms[3] = new System.Data.SqlClient.SqlParameter("@TagValue", tagValue);
+ thisParms[4] = new System.Data.SqlClient.SqlParameter("@合格标志", isGoodBad);
+ thisParms[5] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
+ thisParms[6] = new System.Data.SqlClient.SqlParameter("@托盘编号", partPallet);
+ thisParms[7] = new System.Data.SqlClient.SqlParameter("@TagID", tagID);
+ thisParms[8] = new System.Data.SqlClient.SqlParameter("@TagID_CF", tagID_CF);
+ thisParms[9] = new System.Data.SqlClient.SqlParameter("@上限值", MaxValue);
+ thisParms[10] = new System.Data.SqlClient.SqlParameter("@下限值", MinValue);
+ return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
+ }
+ ///
+ /// 测量数据合格索引_增加_电芯
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static bool BaseData_tagTable_QualityData_B5A_IndexInsert_cell(string EngineID, string tagID, string EngineType, int EngineTypeID, string opName, int isGoodBad, string PartPalletCode, out int Id_tagCF)
+ {
+ string procedureName;
+ procedureName = "测量数据合格索引_增加_电芯";
+ Id_tagCF = 0;
+ SqlParameter[] thisParms = new SqlParameter[8];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@EngineID", EngineID);
+ thisParms[1] = new System.Data.SqlClient.SqlParameter("@TagID_CF", tagID);
+ thisParms[2] = new System.Data.SqlClient.SqlParameter("@EngineType", EngineType);
+ thisParms[3] = new System.Data.SqlClient.SqlParameter("@EngineTypeID", EngineTypeID);
+ thisParms[4] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
+ thisParms[5] = new System.Data.SqlClient.SqlParameter("@托盘编号", PartPalletCode);
+ thisParms[6] = new System.Data.SqlClient.SqlParameter("@合格标志", isGoodBad);
+ thisParms[7] = new System.Data.SqlClient.SqlParameter("@Id_tagCF", Id_tagCF);
+ thisParms[7].Direction = ParameterDirection.Output;
+
+ if (DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms))
+ {
+ Id_tagCF = Convert.ToInt32(thisParms[7].Value.ToString());
+ return true;
+ }
+ return false;
+ }
+ ///
+ /// 测量数据合格_增加_电芯
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static bool BaseData_tagTable_QualityData_B5A_Insert_cell(int Id_tagCF, int engineTypeID, string engineID, string opName, DataTable dt, bool IsCheck = false)
+ {
+ string procedureName;
+ procedureName = "测量数据合格_增加_电芯";
+ SqlParameter[] thisParms = new SqlParameter[15];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@Id_tagCF", Id_tagCF);
+ thisParms[1] = new System.Data.SqlClient.SqlParameter("@EngineTypeID", engineTypeID);
+ thisParms[2] = new System.Data.SqlClient.SqlParameter("@EngineID", engineID);
+ thisParms[3] = new System.Data.SqlClient.SqlParameter("@TagID", SqlDbType.Int, 4, "TagID");
+ thisParms[4] = new System.Data.SqlClient.SqlParameter("@TagValue", SqlDbType.NVarChar, 100, "TagValue");
+ thisParms[5] = new System.Data.SqlClient.SqlParameter("@IsGoodBad", SqlDbType.Int, 4, "IsGoodBad");
+ //是否保存无合格标志数据数据
+ //thisParms[6] = new System.Data.SqlClient.SqlParameter("@IsCheck", IsCheck);
+ thisParms[6] = new System.Data.SqlClient.SqlParameter("@测量位置", SqlDbType.NVarChar, 50, "测量位置");
+ thisParms[7] = new System.Data.SqlClient.SqlParameter("@测量项目", SqlDbType.NVarChar, 50, "测量项目");
+ thisParms[8] = new System.Data.SqlClient.SqlParameter("@工位号", opName); //为了给J07MA020 保留四位精度而设置
+ thisParms[9] = new System.Data.SqlClient.SqlParameter("@理论值", SqlDbType.NVarChar, 50, "理论值");
+ thisParms[10] = new System.Data.SqlClient.SqlParameter("@上限值", SqlDbType.NVarChar, 50, "上限值");
+ thisParms[11] = new System.Data.SqlClient.SqlParameter("@下限值", SqlDbType.NVarChar, 50, "下限值");
+ thisParms[12] = new System.Data.SqlClient.SqlParameter("@测量单位", SqlDbType.NVarChar, 50, "测量单位");
+ thisParms[13] = new System.Data.SqlClient.SqlParameter("@列位置", SqlDbType.Int, 4, "列位置");
+ thisParms[14] = new System.Data.SqlClient.SqlParameter("@变量排序", SqlDbType.Int, 4, "变量排序");
+ //table.Columns.Add("TagID", typeof(System.Int32));
+ //table.Columns.Add("TagValue", typeof(System.String));
+ //table.Columns.Add("IsGoodBad", typeof(System.Int32));
+ //table.Columns.Add("测量位置", typeof(System.String));
+ //table.Columns.Add("测量项目", typeof(System.String));
+ //table.Columns.Add("工位号", typeof(System.String));
+ //table.Columns.Add("理论值", typeof(System.String));
+ //table.Columns.Add("上限值", typeof(System.String));
+ //table.Columns.Add("下限值", typeof(System.String));
+ //table.Columns.Add("测量单位", typeof(System.String));
+ //table.Columns.Add("列位置", typeof(System.Int32));
+ //table.Columns.Add("变量排序", typeof(System.Int32));
+ return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, dt);
+ }
+
+ ///
+ /// MES_装配数据_零部件追溯_增加
+ ///
+ ///
+ ///
+ ///
+ public static bool Material_Insert(string opName, int m_ConfirmOkGo)
+ {
+ string produceName = "MES_装配数据_零部件追溯_增加";
+ SqlParameter[] thisParms = new SqlParameter[2];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
+ thisParms[1] = new System.Data.SqlClient.SqlParameter("@放行方式", m_ConfirmOkGo);
+ return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
+ }
+
+ ///
+ /// 测量数据发动机在线状态_增加数据
+ ///
+ ///
+ ///
+ static public void WorkStartInsert_JZ(string opName, string engineID, int isOK)
+ {
+ string procedureName;
+ procedureName = "测量数据发动机在线状态_增加数据_JZ";
+ SqlParameter[] thisParms = new SqlParameter[3];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
+ thisParms[1] = new System.Data.SqlClient.SqlParameter("@发动机号", engineID);
+ thisParms[2] = new System.Data.SqlClient.SqlParameter("@是否合格", isOK.ToString());
+ DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
+ }
+ ///
+ /// 测量数据发动机在线状态_增加数据
+ ///
+ ///
+ ///
+ static public void WorkStartInsert(string opName, int isOK)
+ {
+ string procedureName;
+ procedureName = "测量数据发动机在线状态_增加数据";
+ SqlParameter[] thisParms = new SqlParameter[2];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
+ thisParms[1] = new System.Data.SqlClient.SqlParameter("@是否合格", isOK.ToString());
+ DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
+ }
+
+ ///
+ /// 接口_IOT接口_报工记录_增加
+ ///
+ ///
+ public static void IOT_Data_UpLode_Res_Save(string opName, string OrderID, string EngineID, string ReqType, bool reqIsOk, string ResText)
+ {
+ string produceName = "接口_IOT接口_报工记录_增加";
+ SqlParameter[] thisParms = new SqlParameter[6];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@订单号", OrderID);
+ thisParms[1] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
+ thisParms[2] = new System.Data.SqlClient.SqlParameter("@工件编号", EngineID);
+ thisParms[3] = new System.Data.SqlClient.SqlParameter("@报工类型", ReqType);
+ thisParms[4] = new System.Data.SqlClient.SqlParameter("@报工结果", reqIsOk);
+ thisParms[5] = new System.Data.SqlClient.SqlParameter("@结果报文", ResText);
+ DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
+ }
+
+
+ ///
+ /// CallWebApi_FactoryMes_NGRecordSave
+ ///
+ ///
+ public static void CallWebApi_FactoryMes_NGRecordSave(string InterfaceName, int AID, string InterfaceUrl, string ReqText, string ResText)
+ {
+ string produceName = "CallWebApi_FactoryMes_NGRecordSave";
+ SqlParameter[] thisParms = new SqlParameter[5];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@接口名称", InterfaceName);
+ thisParms[1] = new System.Data.SqlClient.SqlParameter("@AID", AID);
+ thisParms[2] = new System.Data.SqlClient.SqlParameter("@接口地址", InterfaceUrl);
+ thisParms[3] = new System.Data.SqlClient.SqlParameter("@请求内容", ReqText);
+ thisParms[4] = new System.Data.SqlClient.SqlParameter("@响应内容", ResText);
+ DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
+ }
+
+ ///
+ /// 生产计划_派工订单_工件追溯_工位完工
+ ///
+ ///
+ ///
+ ///
+ public static bool WorkOrderOpWorkOver(string opName, string EngineID, string OrderFrom)
+ {
+ string produceName = "生产计划_派工订单_工件追溯_工位完工";
+ SqlParameter[] thisParms = new SqlParameter[3];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
+ thisParms[1] = new System.Data.SqlClient.SqlParameter("@订单号", OrderFrom);
+ thisParms[2] = new System.Data.SqlClient.SqlParameter("@工件编号", EngineID);
+ return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
+ }
+
+ ///
+ /// 生产计划_派工订单_工件追溯_工位完工
+ ///
+ ///
+ ///
+ ///
+ public static bool SaveQualityInterfaceData(string opName, string EngineID)
+ {
+ string produceName = "接口_质量数据_增加";
+ SqlParameter[] thisParms = new SqlParameter[2];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
+ thisParms[1] = new System.Data.SqlClient.SqlParameter("@工件编号", EngineID);
+ return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
+ }
+
+ ///
+ /// 数据表
+ ///
+ ///
+ static public DataTable BuildDataTables_WWW()
+ {
+ DataTable table;
+ DataColumnCollection columns;
+ table = new DataTable();
+ columns = table.Columns;
+ table.Columns.Add("TagID", typeof(System.String));
+ table.Columns.Add("TagValue", typeof(System.String));
+ table.Columns.Add("IsGoodBad", typeof(System.Int32));
+ table.Columns.Add("测量位置", typeof(System.String));
+ table.Columns.Add("测量项目", typeof(System.String));
+ table.Columns.Add("工位号", typeof(System.String));
+ table.Columns.Add("理论值", typeof(System.String));
+ table.Columns.Add("上限值", typeof(System.String));
+ table.Columns.Add("下限值", typeof(System.String));
+ table.Columns.Add("测量单位", typeof(System.String));
+ table.Columns.Add("列位置", typeof(System.Int32));
+ table.Columns.Add("变量排序", typeof(System.Int32));
+
+ return table;
+ }
+
+ static public DataTable GetMobyTableByOpName(string opName)
+ {
+ DataTable dt;
+ string procedureName;
+ procedureName = "北汽福田工位状态监控MOBY_工位_查询";
+ SqlParameter[] thisParms = new SqlParameter[1];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
+ DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt);
+ return dt;
+ }
+
+ ///
+ /// 生产计划_派工订单_工件追溯_工件下线
+ ///
+ ///
+ ///
+ ///
+ public static bool WorkOrderOpWorkOutLine(string EngineID, string OrderFrom)
+ {
+ string produceName = "生产计划_派工订单_工件追溯_工件下线";
+ SqlParameter[] thisParms = new SqlParameter[2];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@订单号", OrderFrom);
+ thisParms[1] = new System.Data.SqlClient.SqlParameter("@工件编号", EngineID);
+ return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
+ }
+
+
+ ///
+ /// XD_提前上料记录_获取
+ ///
+ ///
+ ///
+ public static DataTable Get_ReqEarlyFeedingData(string opName)
+ {
+ DataTable dt = new DataTable();
+ string produceName = "XD_提前上料记录_获取";
+ SqlParameter[] thisParms = new SqlParameter[1];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
+ DataAccess.ExecuteStoredProcedure(produceName, ref thisParms, out dt);
+ return dt;
+ }
+
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static bool Location_MIS_MOBY_Insert(string opName, string tagType, string tagValue)
+ {
+ string produceName = "XD_库位Moby_增加";
+ SqlParameter[] thisParms = new SqlParameter[3];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@库位号", opName);
+ thisParms[1] = new System.Data.SqlClient.SqlParameter("@变量类型", tagType);
+ thisParms[2] = new System.Data.SqlClient.SqlParameter("@变量值", tagValue);
+
+ return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
+ }
+
+ public static DataTable GetRequestReturnMaterials_Type(string opName, string type)
+ {
+ DataTable dt = new DataTable();
+ string produceName = "XD_库位叫料_叫料类型装换";
+ SqlParameter[] thisParms = new SqlParameter[2];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
+ thisParms[1] = new System.Data.SqlClient.SqlParameter("@叫料类型", type);
+ DataAccess.ExecuteStoredProcedure(produceName, ref thisParms, out dt);
+ return dt;
+ }
+
+ public static DataTable GetEngineType_Order(string opName, out int EngineTypeID, out string EngineType, out string EngineID, out string OrderForm, out int parType, out int isCheckOk, out string msg)
+ {
+ DataTable dt = new DataTable();
+ isCheckOk = 2;
+ EngineTypeID = 0;
+ EngineType = "";
+ EngineID = "";
+ parType = 0;
+ OrderForm = "";
+ msg = "";
+ string produceName = "XD_产品上线";
+ SqlParameter[] thisParms = new SqlParameter[1];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
+ if (DataAccess.ExecuteStoredProcedure(produceName, ref thisParms, out dt))
+ {
+ if (dt.Rows.Count > 0)
+ {
+ EngineTypeID = Convert.ToInt32(dt.Rows[0]["产品型号代码"]);
+ EngineType = dt.Rows[0]["产品型号"].ToString();
+ EngineID = dt.Rows[0]["工件编号"].ToString();
+ OrderForm = dt.Rows[0]["订单号"].ToString();
+ parType = Convert.ToInt32(dt.Rows[0]["小机型"]);
+ isCheckOk = Convert.ToInt32(dt.Rows[0]["result"]);
+ msg = dt.Rows[0]["msg"].ToString();
+ return dt;
+ }
+ }
+ return dt;
+ }
+
+ public static DataTable GetEngineType_Order(string opName, string Program_No, out int EngineTypeID, out string EngineType, out string EngineID, out string OrderForm, out int isCheckOk, out int planCount, out int haveUplaodCount, out int remainingQuantity, out string msg)
+ {
+ DataTable dt = new DataTable();
+ isCheckOk = 2;
+ EngineTypeID = 0;
+ EngineType = "";
+ EngineID = "";
+ OrderForm = "";
+ planCount = 0;
+ haveUplaodCount = 0;
+ remainingQuantity = 0;
+ msg = "";
+ string produceName = "平芝_生产上线_判断机型订单是否匹配_分线";
+ SqlParameter[] thisParms = new SqlParameter[1];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
+ //thisParms[1] = new System.Data.SqlClient.SqlParameter("@PLC_机型代码", Program_No);
+ if (DataAccess.ExecuteStoredProcedure(produceName, ref thisParms, out dt))
+ {
+ if (dt.Rows.Count > 0)
+ {
+ EngineTypeID = Convert.ToInt32(dt.Rows[0]["机型代码"]);
+ EngineType = dt.Rows[0]["机型"].ToString();
+ EngineID = dt.Rows[0]["变速箱总成号"].ToString();
+ OrderForm = dt.Rows[0]["订单号"].ToString();
+ isCheckOk = Convert.ToInt32(dt.Rows[0]["是否匹配"]);
+ planCount = Convert.ToInt32(dt.Rows[0]["计划上料数量"]);
+ haveUplaodCount = Convert.ToInt32(dt.Rows[0]["已上料数量"]);
+ remainingQuantity = Convert.ToInt32(dt.Rows[0]["待上料数量"]);
+ msg = dt.Rows[0]["msg"].ToString();
+ return dt;
+ }
+ }
+ return dt;
+ }
+
+ ///
+ /// 29 工位具体零件合格标志
+ ///
+ ///
+ static public string GetQualityData_GoodBad_String(bool[] QualityData_GoodBad)
+ {
+ string str;
+ str = "";
+ if (QualityData_GoodBad != null)
+ {
+
+ for (int i = 0; i < QualityData_GoodBad.Length; i++)
+ {
+ str = str + (Convert.ToInt32(QualityData_GoodBad[i])).ToString() + "|";
+ }
+
+ }
+ return str;
+
+ }
+
+ ///
+ /// 返回非标准real
+ ///
+ ///
+ ///
+ static public string GetNoNormalReal(object vDataValue)
+ {
+ try
+ {
+ string real_a;
+ string real_b;
+ string groupValueString;
+ int length;
+
+ //int real_b_Int;
+
+ length = ((System.Array)(vDataValue)).Length;
+ groupValueString = "";
+ if (length != 2)
+ return "0.0";
+
+ real_a = Convert.ToUInt16((((System.Array)(vDataValue)).GetValue(0))).ToString();
+ real_b = Convert.ToUInt16((((System.Array)(vDataValue)).GetValue(1))).ToString("00");
+ groupValueString = real_a + "." + real_b;
+ return groupValueString;
+ }
+ catch
+ {
+ ////ApplicationLog.WriteLog(err, "GetNoNormalReal");
+ return "0.0";
+
+ }
+ }
+
+ ///
+ /// 测量数据工位_监控系统_MOBY_查询_PDC
+ ///
+ ///
+ ///
+ ///
+ public static void Moby_Select_PDC(string EngineID, out string OrderForm, out string EngineType, out int EngineTypeCode)
+ {
+ DataTable dt = new DataTable();
+ OrderForm = "";
+ EngineType = "";
+ EngineTypeCode = 0;
+ try
+ {
+ string procedureName;
+ procedureName = "测量数据工位_监控系统_MOBY_查询_PDC";
+ SqlParameter[] thisParms = new SqlParameter[1];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@发动机号", EngineID);
+
+ DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt);
+ if (dt.Rows.Count > 0)
+ {
+ OrderForm = dt.Rows[0]["订单号"].ToString();
+ EngineType = dt.Rows[0]["产品型号"].ToString();
+ EngineTypeCode = Convert.ToInt32(dt.Rows[0]["机型代码"].ToString());
+ }
+ }
+ catch
+ {
+ OrderForm = "";
+ EngineType = "";
+ EngineTypeCode = 0;
+ }
+ }
+
+ ///
+ /// 基本数据_工作日历_班次产量查询_Web页面显示_初始化查询
+ ///
+ ///
+ ///
+ ///
+ public static void InitOpNameOuputCount(string opName, out int outputValue, out int nowOutputValue,
+ out int opNameBeatValue, out int NowOpNameBeatValue, out int classNumber)
+ {
+ outputValue = 0;//工位产量
+ nowOutputValue = 0;//在线产量
+ opNameBeatValue = 0;//工位节拍
+ NowOpNameBeatValue = 0;//在线节拍
+ classNumber = 0;//班次
+ try
+ {
+ string procedureName;
+ procedureName = "Web页面显示_计划产量初始化查询";
+ SqlParameter[] thisParms = new SqlParameter[6];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
+ thisParms[1] = new System.Data.SqlClient.SqlParameter("@工位产量", SqlDbType.Int, 4, "工位产量");
+ thisParms[1].Direction = ParameterDirection.Output;
+ thisParms[2] = new System.Data.SqlClient.SqlParameter("@工位节拍", SqlDbType.Int, 4, "工位节拍");
+ thisParms[2].Direction = ParameterDirection.Output;
+ thisParms[3] = new System.Data.SqlClient.SqlParameter("@在线产量", SqlDbType.Int, 4, "在线产量");
+ thisParms[3].Direction = ParameterDirection.Output;
+ thisParms[4] = new System.Data.SqlClient.SqlParameter("@在线节拍", SqlDbType.Int, 4, "在线节拍");
+ thisParms[4].Direction = ParameterDirection.Output;
+ thisParms[5] = new System.Data.SqlClient.SqlParameter("@班次代码", SqlDbType.Int, 4, "班次代码");
+ thisParms[5].Direction = ParameterDirection.Output;
+ DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
+ if (thisParms[1].Value != null && thisParms[2].Value != null && thisParms[3].Value != null && thisParms[4].Value != null && thisParms[5].Value != null)
+ {
+ outputValue = Convert.ToInt32(thisParms[1].Value);
+ opNameBeatValue = Convert.ToInt32(thisParms[2].Value);
+ nowOutputValue = Convert.ToInt32(thisParms[3].Value);
+ NowOpNameBeatValue = Convert.ToInt32(thisParms[4].Value);
+ classNumber = Convert.ToInt32(thisParms[5].Value);
+ }
+ }
+ catch
+ {
+ outputValue = 0;
+ opNameBeatValue = 0;
+ nowOutputValue = 0;
+ NowOpNameBeatValue = 0;
+ classNumber = 0;
+ }
+ }
+
+ static public void GetImageFile(string opName, int engineTypeID, out byte[] pic)
+ {
+ string sql;
+ DataTable dt;
+ pic = null;
+ sql = "exec 电子看板_工位名称与产品型号产品图片_查询 '" + opName + "'," + engineTypeID.ToString();
+ DataAccess.ExecuteDataTable(sql, out dt);
+ if (dt != null)
+ {
+ if (dt.Rows.Count > 0)
+ {
+ pic = (byte[])dt.Rows[0]["产品图片"];
+ }
+ }
+ }
+
+ ///
+ /// 电子看板_工位机型_质量数据测量位置_查询_工作顺序
+ ///
+ /// 工位号
+ /// 产品型号代码
+ ///
+ static public bool ShaftPositionSelect(string opNum, int EngineTypeID, out DataTable dt)
+ {
+ string procedureName = "电子看板_工位机型_质量数据测量位置_临时表_查询";
+ SqlParameter[] thisParms = new SqlParameter[2];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opNum);
+ thisParms[1] = new System.Data.SqlClient.SqlParameter("@产品型号代码", EngineTypeID);
+ return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt);
+ }
+
+
+ ///
+ /// 测量数据合格_查询
+ ///
+ ///
+ ///
+ ///
+ ///
+ static public bool QualitySelect(string opName, string engineID, out DataTable dt)
+ {
+ string procedureName = "测量数据合格_查询";
+ SqlParameter[] thisParms = new SqlParameter[2];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
+ thisParms[1] = new System.Data.SqlClient.SqlParameter("@发动机号", engineID);
+ return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt);
+ }
+ ///
+ /// 生产计划_派工订单_查询_工位执行_完工判断
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static void Select_OrderFormList_OrderComplete(string opName, out int isCompleted, out int num_plan, out int num_complete)
+ {
+ isCompleted = 0;//订单数量是否完全上线
+ num_plan = 0;//计划数量
+ num_complete = 0;//上线数量
+ try
+ {
+ string procedureName;
+ procedureName = "生产计划_派工订单_查询_工位执行_完工判断";
+ SqlParameter[] thisParms = new SqlParameter[4];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
+ thisParms[1] = new System.Data.SqlClient.SqlParameter("@ISCOMPLETE", SqlDbType.Int, 4, "ISCOMPLETE");
+ thisParms[1].Direction = ParameterDirection.Output;
+ thisParms[2] = new System.Data.SqlClient.SqlParameter("@NUM_PLAN", SqlDbType.Int, 4, "NUM_PLAN");
+ thisParms[2].Direction = ParameterDirection.Output;
+ thisParms[3] = new System.Data.SqlClient.SqlParameter("@NUM_COMPLETE", SqlDbType.Int, 4, "NUM_COMPLETE");
+ thisParms[3].Direction = ParameterDirection.Output;
+
+ DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
+ if (thisParms[1].Value != null && thisParms[2].Value != null && thisParms[3].Value != null)
+ {
+ isCompleted = Convert.ToInt32(thisParms[1].Value);
+ num_plan = Convert.ToInt32(thisParms[2].Value);
+ num_complete = Convert.ToInt32(thisParms[3].Value);
+ }
+ }
+ catch
+ {
+ isCompleted = 0;
+ num_plan = 0;
+ num_complete = 0;
+ }
+ }
+ ///
+ /// 生产计划_派工订单_查询_工位执行
+ ///
+ /// 工位号
+ ///
+ static public void OrderFormList_Select(string opName, out DataTable dt)
+ {
+ dt = null;
+ string sql = "exec 生产计划_派工订单_查询_工位执行 '" + opName + "'";
+ DataAccess.ExecuteDataTable(sql, out dt);
+ }
+ ///
+ /// MES界面显示_弹窗消息_查询
+ ///
+ ///
+ ///
+ ///
+ public static bool ShowWindowNotice(string opname, out DataTable dt)
+ {
+ string procedureName = "MES界面显示_弹窗消息_查询";
+ SqlParameter[] sqlParameters = new SqlParameter[1];
+ sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
+ return DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
+ }
+
+ ///
+ /// MES界面显示_消息滚动_查询
+ ///
+ ///
+ ///
+ ///
+ public static bool ShowLEDNotice(string opname, out DataTable dt)
+ {
+ string procedureName = "MES界面显示_消息滚动_查询";
+ SqlParameter[] sqlParameters = new SqlParameter[1];
+ sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
+ return DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
+ }
+ ///
+ /// 电子看板_工位机型_物料检测测量位置_查询_物料检测
+ ///
+ ///
+ ///
+ ///
+ static public bool MaterialCheckSelect(string opName, out DataTable dt)
+ {
+ string procedureName = "电子看板_工位机型_物料检测测量位置_查询_物料检测";
+ SqlParameter[] thisParms = new SqlParameter[1];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
+ return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt);
+ }
+ ///
+ /// 电芯进站 离站
+ ///
+ ///
+ ///
+ ///
+ public static bool Cell_CheckDataAdd(string opName, string EngineID, string operationTime, int isOK)
+ {
+ string produceName = "测量数据合格_增加数据_电芯";
+ SqlParameter[] thisParms = new SqlParameter[4];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
+ thisParms[1] = new System.Data.SqlClient.SqlParameter("@发动机号", EngineID);
+ thisParms[2] = new System.Data.SqlClient.SqlParameter("@操作时间", operationTime);
+ thisParms[3] = new System.Data.SqlClient.SqlParameter("@合格标志", isOK);
+ return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
+ }
+ public static bool Cell_PassStation(string opName, string EngineID, string operationTime, int passType, int isOK = 1)
+ {
+ string produceName = "测量数据发动机在线状态_增加数据_电芯";
+ SqlParameter[] thisParms = new SqlParameter[5];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@发动机号", EngineID);
+ thisParms[1] = new System.Data.SqlClient.SqlParameter("@操作时间", operationTime);
+ thisParms[2] = new System.Data.SqlClient.SqlParameter("@合格标志", isOK);
+ thisParms[3] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
+ thisParms[4] = new System.Data.SqlClient.SqlParameter("@过站类型", passType);
+ return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
+ }
+ ///
+ /// 报警接口记录 存储
+ /// 关机(0)/开机(1)/报警(2)/故障(3) 运行(4) 待机(5)
+ /// 注意事项:当设备状态发生变化时,给表里插入一条数据。状态时间字段精确到年月日时分秒。当状态没变化时,不用重复去存数据,不同的故障告警,认为是不同的状态,当前如果是报警1,先存一条报警1,如果一直是报警1,就不用重复存报警1,当又产生了报警2时,需要给表里再存一条报警2。场景如下:
+ ////1.开机后,状态先存一条开机,3秒后,再继续存一条待机
+ ////2.设备运行后,存一条运行
+ ////3.有故障1时,存一条故障,内容为故障1
+ ////4.有故障2时,存一条故障,内容为故障2
+ ////5.故障1解除后,先存一条运行,如果还有故障2, 继续再存一条故障,内容为故障2
+ ////6.故障2解除后,存一条运行或者待机(看设备具体是运行还是待机状态)
+ ///
+ /// 工位号
+ /// 状态代码
+ /// 故障代码 如状态为故障/报警,记录故障/报警代码。
+ /// 故障名称 如状态为故障/报警,记录故障/报警名称
+ /// 故障说明 如状态为故障/报警,记录故障/报警说明。
+ /// 备注
+ ///
+ public static bool errorPortSave(string opName, string DeviceStatus, string MalfunctionCode = null, string MalfunctionName = null, string Malfunctionexplain = null, string Remark = null, int? alarmRemove = null)
+ {
+ string produceName = "接口_工位运行状态_增加";
+ SqlParameter[] thisParms = new SqlParameter[7];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
+ thisParms[1] = new System.Data.SqlClient.SqlParameter("@状态代码", DeviceStatus);
+ thisParms[2] = new System.Data.SqlClient.SqlParameter("@故障代码", MalfunctionCode);
+ thisParms[3] = new System.Data.SqlClient.SqlParameter("@故障名称", MalfunctionName);
+ thisParms[4] = new System.Data.SqlClient.SqlParameter("@故障说明", Malfunctionexplain);
+ thisParms[5] = new System.Data.SqlClient.SqlParameter("@备注", Remark);
+ thisParms[6] = new System.Data.SqlClient.SqlParameter("@alarmRemove", (object)alarmRemove ?? DBNull.Value);
+ return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
+ }
+
+
+ ///
+ /// 工位运行状态 存储
+ ///
+ ///
+ ///
+ ///
+ public static bool WorkRunStatusSave(string opName, int toolPowered, int toolStart, float energy)
+ {
+ string produceName = "接口_工位使用情况_增加";
+ SqlParameter[] thisParms = new SqlParameter[4];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
+ thisParms[1] = new System.Data.SqlClient.SqlParameter("@机床上电", toolPowered);
+ thisParms[2] = new System.Data.SqlClient.SqlParameter("@循环开始", toolStart);
+ thisParms[3] = new System.Data.SqlClient.SqlParameter("@能耗", energy);
+ return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
+ }
+
+
+ ///
+ /// MES界面显示_弹窗消息_增加
+ ///
+ ///
+ ///
+ ///
+ public static bool Web_Notice_Insert(string opName, string notice)
+ {
+ string produceName = "MES界面显示_弹窗消息_增加";
+ SqlParameter[] thisParms = new SqlParameter[2];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
+ thisParms[1] = new System.Data.SqlClient.SqlParameter("@Notice", notice);
+ return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
+ }
+ ///
+ /// 基本数据_工作日历_班次产量查询_New
+ ///
+ ///
+ /// 在线产量
+ /// 在线节拍
+ static public void OpNameCount_New(string opName, out int opNameCount, out int opNameCountTime)
+ {
+ opNameCount = 0;
+ opNameCountTime = 0;
+ string procedureName;
+ procedureName = "基本数据_工作日历_班次产量查询_New";
+ SqlParameter[] thisParms = new SqlParameter[3];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
+ thisParms[1] = new System.Data.SqlClient.SqlParameter("@在线产量", 0);
+ thisParms[1].Direction = ParameterDirection.Output;
+ thisParms[2] = new System.Data.SqlClient.SqlParameter("@在线节拍", 0);
+ thisParms[2].Direction = ParameterDirection.Output;
+ if (DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms))
+ {
+ opNameCount = Convert.ToInt32(thisParms[1].Value);
+ opNameCountTime = Convert.ToInt32(thisParms[2].Value);
+ }
+ }
+ ///
+ /// 基本数据_工作日历_班次产量查询_New
+ ///
+ ///
+ /// 在线产量
+ /// 在线节拍
+ static public void OpNameCount_BQ(string opName, out int opNameCount, out int opNameCountTime)
+ {
+ opNameCount = 0;
+ opNameCountTime = 0;
+ string procedureName;
+ procedureName = "基本数据_工作日历_班次产量查询_北汽";
+ SqlParameter[] thisParms = new SqlParameter[3];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
+ thisParms[1] = new System.Data.SqlClient.SqlParameter("@在线产量", 0);
+ thisParms[1].Direction = ParameterDirection.Output;
+ thisParms[2] = new System.Data.SqlClient.SqlParameter("@在线节拍", 0);
+ thisParms[2].Direction = ParameterDirection.Output;
+ if (DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms))
+ {
+ opNameCount = Convert.ToInt32(thisParms[1].Value);
+ opNameCountTime = Convert.ToInt32(thisParms[2].Value);
+ }
+ }
+ ///
+ /// 电子看板_工位机型_质量数据测量位置_临时表_增加
+ ///
+ ///
+ ///
+ public static bool MesServer_ShaftPosition_EngineTypeOver(string opName)
+ {
+ string produceName = "电子看板_工位机型_质量数据测量位置_临时表_增加";
+ SqlParameter[] thisParms = new SqlParameter[1];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
+ return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
+ }
+
+ ///
+ /// 电子看板_工位机型_质量数据测量位置_临时表_查询_完成情况
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static bool MesServer_ShaftPosition_Select_FinishResult(string opName, out int workGroupIndex, out string BoltCode, out bool sn_WorkingStepIsOver, out bool isHaveNg)
+ {
+ workGroupIndex = 0;
+ BoltCode = "";
+ sn_WorkingStepIsOver = true;
+ isHaveNg = false;
+
+ string produceName = "电子看板_工位机型_质量数据测量位置_临时表_查询_完成情况";
+ SqlParameter[] thisParms = new SqlParameter[5];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
+ thisParms[1] = new System.Data.SqlClient.SqlParameter("@组号", SqlDbType.Int, 4);
+ thisParms[1].Direction = ParameterDirection.Output;
+ thisParms[2] = new System.Data.SqlClient.SqlParameter("@套筒号", SqlDbType.NVarChar, 50);
+ thisParms[2].Direction = ParameterDirection.Output;
+ thisParms[3] = new System.Data.SqlClient.SqlParameter("@是否全部完成", SqlDbType.Int, 4);
+ thisParms[3].Direction = ParameterDirection.Output;
+ thisParms[4] = new System.Data.SqlClient.SqlParameter("@是否全部完成", SqlDbType.Int, 4);
+ thisParms[4].Direction = ParameterDirection.Output;
+ if (DataAccess.ExecuteStoredProcedure(produceName, ref thisParms))
+ {
+ workGroupIndex = Convert.ToInt32(thisParms[1].Value);
+ BoltCode = thisParms[2].Value.ToString();
+ sn_WorkingStepIsOver = Convert.ToBoolean(thisParms[3].Value);
+ isHaveNg = Convert.ToBoolean(thisParms[3].Value);
+ return true;
+ }
+ return false;
+ }
+
+
+ ///
+ /// 电子看板_工位机型_质量数据测量位置_临时表_修改
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static bool MesServer_ShaftPosition_Update(string opName, int workGroupIndex, int IsOK, out bool IsFinish)
+ {
+ IsFinish = true;
+ string produceName = "电子看板_工位机型_质量数据测量位置_临时表_修改";
+ SqlParameter[] thisParms = new SqlParameter[4];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
+ thisParms[1] = new System.Data.SqlClient.SqlParameter("@组号", workGroupIndex);
+ thisParms[2] = new System.Data.SqlClient.SqlParameter("@合格标志", IsOK);
+ thisParms[3] = new System.Data.SqlClient.SqlParameter("@是否全部完成", SqlDbType.Int, 4);
+ thisParms[3].Direction = ParameterDirection.Output;
+ if (DataAccess.ExecuteStoredProcedure(produceName, ref thisParms))
+ {
+ IsFinish = Convert.ToBoolean(thisParms[3].Value);
+ return true;
+ }
+ return false;
+ }
+ ///
+ /// 电子看板_工位机型_质量数据测量位置_临时表_查询_完成情况
+ ///
+ /// 工位号
+ /// 拧紧序号
+ /// 套筒号
+ /// 工步属性
+ /// 是否全部完成
+ ///
+ public static bool MesServer_ShaftPosition_Select_FinishResult(string opName, out int ProcessCode, out int BoltCode, out int workStepProperty, out bool sn_WorkingStepIsOver, out bool isHaveNg)
+ {
+ BoltCode = 0;
+ ProcessCode = 512;
+ workStepProperty = 0;
+ sn_WorkingStepIsOver = true;
+ isHaveNg = false;
+
+ string produceName = "电子看板_工位机型_质量数据测量位置_临时表_查询_完成情况";
+ SqlParameter[] thisParms = new SqlParameter[6];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
+ thisParms[1] = new System.Data.SqlClient.SqlParameter("@拧紧序号", SqlDbType.Int, 4);
+ thisParms[1].Direction = ParameterDirection.Output;
+ thisParms[2] = new System.Data.SqlClient.SqlParameter("@套筒号", SqlDbType.Int, 4);
+ thisParms[2].Direction = ParameterDirection.Output;
+ thisParms[3] = new System.Data.SqlClient.SqlParameter("@工步属性", SqlDbType.Int, 4);
+ thisParms[3].Direction = ParameterDirection.Output;
+ thisParms[4] = new System.Data.SqlClient.SqlParameter("@是否全部完成", SqlDbType.Int, 4);
+ thisParms[4].Direction = ParameterDirection.Output;
+ thisParms[5] = new System.Data.SqlClient.SqlParameter("@是否存在不合格", SqlDbType.Int, 4);
+ thisParms[5].Direction = ParameterDirection.Output;
+ if (DataAccess.ExecuteStoredProcedure(produceName, ref thisParms))
+ {
+ ProcessCode = Convert.ToInt32(thisParms[1].Value);
+ BoltCode = Convert.ToInt32(thisParms[2].Value);
+ workStepProperty = Convert.ToInt32(thisParms[3].Value);
+ sn_WorkingStepIsOver = Convert.ToBoolean(thisParms[4].Value);
+ isHaveNg = Convert.ToBoolean(thisParms[5].Value);
+ return true;
+ }
+ return false;
+ }
+
+
+ ///
+ /// 电子看板_工位机型_质量数据测量位置_临时表_修改_重新拧紧
+ ///
+ /// 工位号
+ /// 拧紧序号
+ ///
+ public static bool MesServer_ShaftPosition_FixAllow_Again(string opName, int ProcessCode)
+ {
+ string produceName = "电子看板_工位机型_质量数据测量位置_临时表_修改_重新拧紧";
+ SqlParameter[] thisParms = new SqlParameter[2];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
+ thisParms[1] = new System.Data.SqlClient.SqlParameter("@组号", ProcessCode);
+ if (DataAccess.ExecuteStoredProcedure(produceName, ref thisParms))
+ {
+ return true;
+ }
+ return false;
+ }
+
+ ///
+ /// 测量数据项目
+ /// 用于B5A项目
+ ///
+ ///
+ public static DataTable BaseData_tagTable_QualityData_Item_B5A()
+ {
+ DataTable dt;
+ string sql;
+ sql = "SELECT TagID,0 as TagValue,TagName,工位号,数据来源,TagTypeID,TagLong,列位置,测量位置,变量类型代码,测量项目,TagAdr,TagAdrDemo,变量特点,变量排序 FROM [MES_基本变量_原始数据] "
+ + " where (TagID <> 0 ) and "
+ + " ((变量类型代码 = 9) "
+ + " or (变量类型代码 = 10) "
+ + " or (变量类型代码 = 11) "
+ + " or (变量类型代码 = 80) "
+ + " or (变量类型代码 = 101) "
+ + " or (变量类型代码 = 102) "
+
+ + " or (变量类型代码 = 78) "
+ + " or (变量类型代码 = 79) "
+ + " or (变量类型代码 = 41) "
+ + " or (变量类型代码 = 51) "
+ + " or (变量类型代码 = 8) "
+ + " or (变量类型代码 = 21) "
+
+ + " or (变量类型代码 = 105)) "
+ + " and (是否启用 = 1)";
+
+ DataAccess.ExecuteDataTable(sql, out dt);
+ return dt;
+ }
+
+ ///
+ /// 测量数据合格索引_分线数据_删除
+ ///
+ ///
+ ///
+ ///
+ public static bool BaseData_tagTable_QualityData_B5A_SubTable_Delete
+ (string engineID, string opName)
+ {
+ string procedureName;
+ procedureName = "测量数据合格索引_分线数据_删除";
+ SqlParameter[] thisParms = new SqlParameter[2];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@EngineID", engineID);
+ thisParms[1] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
+ return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
+ }
+ ///
+ /// MES_装配数据_零部件追溯_增加_不合格
+ ///
+ ///
+ ///
+ ///
+ public static bool Material_Insert_NG(string opName, int m_ConfirmOkGo)
+ {
+ string produceName = "MES_装配数据_零部件追溯_增加_不合格";
+ SqlParameter[] thisParms = new SqlParameter[2];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
+ thisParms[1] = new System.Data.SqlClient.SqlParameter("@放行方式", m_ConfirmOkGo);
+ return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
+ }
+ ///
+ /// 测量数据发动机在线状态_查询_是否已工作
+ ///
+ ///
+ /// 新零件号(机型)
+ ///
+ public static DataTable EngineIsTwoWork(string opName, string OrderForm, string EngineID)
+ {
+ DataTable dt = new DataTable();
+ string produceName = "测量数据发动机在线状态_查询_是否已工作";
+ SqlParameter[] thisParms = new SqlParameter[3];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
+ thisParms[1] = new System.Data.SqlClient.SqlParameter("@订单号", OrderForm);
+ thisParms[2] = new System.Data.SqlClient.SqlParameter("@总成号", EngineID);
+ DataAccess.ExecuteStoredProcedure(produceName, ref thisParms, out dt);
+ return dt;
+ }
+
+ ///
+ /// 测量数据发动机在线状态_增加数据
+ ///
+ ///
+ ///
+ static public DataTable CheckAllFinish(string opName, string EngineID, int type)
+ {
+ string procedureName;
+ DataTable dt = new DataTable();
+ procedureName = "测量数据工位_测试工位状态_修改";
+ SqlParameter[] thisParms = new SqlParameter[3];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
+ thisParms[1] = new System.Data.SqlClient.SqlParameter("@发动机号", EngineID);
+ thisParms[2] = new System.Data.SqlClient.SqlParameter("@type", type);
+ DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt);
+ return dt;
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ///
+ /// 报警工位记录表_新增
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ static public void Alarm_Insert2(int TagID, string opName, string Text, int Status, string errType)
+ {
+ //@TagID ,
+ //@工位号,
+ // @报警内容,
+ // @报警类型,
+ // @报警状态
+ string procedureName;
+ procedureName = "报警工位记录表_新增";
+ SqlParameter[] thisParms = new SqlParameter[5];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@TagID", TagID);
+ thisParms[1] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
+ thisParms[2] = new System.Data.SqlClient.SqlParameter("@报警内容", Text);
+ thisParms[3] = new System.Data.SqlClient.SqlParameter("@报警类型", errType);
+ thisParms[4] = new System.Data.SqlClient.SqlParameter("@报警状态", Status);
+ DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
+ }
+
+
+ public static DataTable XD_MaterialsVerify(string opName, string engineID, string materialsCode, int MaterialsTypeCode)
+ {
+ DataTable dt = new DataTable();
+ string produceName = "XD_物料记录_增加";
+ SqlParameter[] thisParms = new SqlParameter[4];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@工件编号", engineID);
+ thisParms[1] = new System.Data.SqlClient.SqlParameter("@物料编码", materialsCode);
+ thisParms[2] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
+ thisParms[3] = new System.Data.SqlClient.SqlParameter("@物料类型编号", MaterialsTypeCode);
+ DataAccess.ExecuteStoredProcedure(produceName, ref thisParms, out dt);
+ return dt;
+ }
+
+ ///
+ /// 报警工位记录表_MOBY_查询
+ ///
+ public static void Alarm_Moby_Search(out DataTable dt)
+ {
+ string procedureName;
+ procedureName = "报警工位记录表_MOBY_查询";
+ SqlParameter[] thisParms = new SqlParameter[0];
+ DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt);
+ }
+
+ ///
+ /// 生产计划_派工订单_配送信息_验证记录_校验
+ ///
+ ///
+ ///
+ public static DataTable Get_MaterialsScanOverRes(string opName, string order, string engineID, string materialsCode)
+ {
+ DataTable dt = new DataTable();
+ string produceName = "生产计划_派工订单_配送信息_验证记录_校验";
+ SqlParameter[] thisParms = new SqlParameter[4];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@订单号", order);
+ thisParms[1] = new System.Data.SqlClient.SqlParameter("@工件编号", engineID);
+ thisParms[2] = new System.Data.SqlClient.SqlParameter("@物料编码", materialsCode);
+ thisParms[3] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
+ DataAccess.ExecuteStoredProcedure(produceName, ref thisParms, out dt);
+ return dt;
+ }
+
+
+ public static DataTable Rrunning_AGV_Arrive(string opName)
+ {
+ DataTable dt = new DataTable();
+ string produceName = "XD_磨合_AGV到达";
+ SqlParameter[] thisParms = new SqlParameter[1];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@库位号", opName);
+ DataAccess.ExecuteStoredProcedure(produceName, ref thisParms, out dt);
+ return dt;
+ }
+ public static DataTable Rrunning_AGV_Leave(string opName)
+ {
+ DataTable dt = new DataTable();
+ string produceName = "XD_磨合_AGV离开";
+ SqlParameter[] thisParms = new SqlParameter[1];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@库位号", opName);
+ DataAccess.ExecuteStoredProcedure(produceName, ref thisParms, out dt);
+ return dt;
+ }
+
+ public static DataTable Rrunning_GetNextStoreData(string opName, string EngineID, string EngineType)
+ {
+ DataTable dt = new DataTable();
+ string produceName = "XD_磨合_获取下一序";
+ SqlParameter[] thisParms = new SqlParameter[3];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@库位号", opName);
+ thisParms[1] = new System.Data.SqlClient.SqlParameter("@产品编号", EngineID);
+ thisParms[2] = new System.Data.SqlClient.SqlParameter("@产品型号", EngineType);
+ DataAccess.ExecuteStoredProcedure(produceName, ref thisParms, out dt);
+ return dt;
+ }
+
+ public static DataTable Rrunning_UpdateOpCallStatus(string opName, int status)
+ {
+ DataTable dt = new DataTable();
+ string produceName = "XD_磨合_状态_是否呼叫_更新";
+ SqlParameter[] thisParms = new SqlParameter[2];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@库位号", opName);
+ thisParms[1] = new System.Data.SqlClient.SqlParameter("@是否呼叫", status);
+ DataAccess.ExecuteStoredProcedure(produceName, ref thisParms, out dt);
+ return dt;
+ }
+ }
+}
diff --git a/Common/09MesDataFunction/MesDataFunction/14MisDataFunctionDB/MisDataFun.MES.cs b/Common/09MesDataFunction/MesDataFunction/14MisDataFunctionDB/MisDataFun.MES.cs
new file mode 100644
index 0000000..f62ac3f
--- /dev/null
+++ b/Common/09MesDataFunction/MesDataFunction/14MisDataFunctionDB/MisDataFun.MES.cs
@@ -0,0 +1,163 @@
+using DataLinkMesWork1;
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Data;
+
+namespace MisDataFunDll
+{
+ public partial class MisDataFun
+ {
+ static object locker = new object();
+ ///
+ ///引用程序集Hashtable
+ ///
+ public static Hashtable Hashtable_assembly = new Hashtable();
+ public static Hashtable hashtable_MesServerCode = new Hashtable();
+ public static Hashtable hashtable_MesDll = new Hashtable();
+ public static Hashtable hashtable_TagTypeTagName = new Hashtable();
+ public static Hashtable hashtable_TagName = new Hashtable();
+
+ ///
+ ///
+ ///
+ /// 变量名称对应的变量类型代码
+ /// 变量类型代码对应的变量名称
+ public static void GetBaseData_tagTable_TagName(out Hashtable hashtable_TagName, out Hashtable hashtable_TagTypeTagName)
+ {
+ hashtable_TagName = new Hashtable();
+ hashtable_TagTypeTagName = new Hashtable();
+
+ string tagName;
+ string tagTypeCode;
+ DataTable dt;//GetMesServerCodeFromMIS
+ dt = BaseData_tagTable_TagName();
+ if (dt != null)
+ {
+ for (int i = 0; i < dt.Rows.Count; i++)
+ {
+ tagName = dt.Rows[i]["TagName"].ToString();
+ tagTypeCode = dt.Rows[i]["变量类型代码"].ToString();
+ if (!hashtable_TagName.Contains(tagName))
+ {
+ hashtable_TagName.Add(tagName, tagTypeCode);
+ }
+ if (!hashtable_TagTypeTagName.Contains(tagTypeCode))
+ {
+ hashtable_TagTypeTagName.Add(tagTypeCode, tagName);
+ }
+ }
+ }
+ }
+
+ public static void GetMesServerCodeAndMesDll(out Hashtable hashtable_MesServerCode, out Hashtable hashtable_MesDll)
+ {
+ hashtable_MesServerCode = new Hashtable();
+ hashtable_MesDll = new Hashtable();
+
+ string OpName;
+ string MesServerCode;
+ string MesDll;
+ DataTable dt;//GetMesServerCodeFromMIS
+ dt = GetMesServerCodeFromMIS();
+ if (dt != null)
+ {
+ for (int i = 0; i < dt.Rows.Count; i++)
+ {
+ OpName = dt.Rows[i]["工位号"].ToString();
+ MesServerCode = dt.Rows[i]["MesServerCode"].ToString();
+ MesDll = dt.Rows[i]["MesDll"].ToString();
+ if (!hashtable_MesDll.Contains(OpName))
+ {
+ hashtable_MesDll.Add(OpName, MesDll);
+ }
+ if (!hashtable_MesServerCode.Contains(OpName))
+ {
+ hashtable_MesServerCode.Add(OpName, MesServerCode);
+ }
+ }
+ }
+ }
+
+
+ ///
+ /// MesServerFunction
+ ///
+ ///
+ ///
+ ///
+ public static void TransferInfToMES(object text)
+ {
+ try
+ {
+ string recData = text.ToString();
+ List dataArray = GetCmdStringList(recData);
+ //消息来源
+ string m_Source = dataArray[0].ToString();
+ //消息类型 Barcode
+ string m_Command = dataArray[1].ToString();
+ //工位号
+ string m_OpName = dataArray[2].ToString();
+ //消息参数
+ string m_Value = dataArray[3].ToString();
+
+ string mesServerdllName;
+ //获得工位对应的 dll
+ if (!GetMesServerDllNameByOpName(out mesServerdllName, m_OpName)) return;
+ if (mesServerdllName == null) return;
+ if (mesServerdllName.Length < 1) return;
+
+ string ResultOK = "";
+ object[] Paramsters = new object[1];
+ Paramsters[0] = text;
+
+ System.Reflection.Assembly assembly = null;
+
+ bool IsOK = Hashtable_assembly.ContainsKey(mesServerdllName);
+ if (IsOK)
+ {
+ assembly = (System.Reflection.Assembly)Hashtable_assembly[mesServerdllName];
+ }
+ else
+ {
+ assembly = System.Reflection.Assembly.Load(mesServerdllName);
+ if (assembly == null)
+ {
+ return;
+ }
+ Hashtable_assembly.Add(mesServerdllName, assembly);
+ }
+ ResultOK = Reflection.ReflectionMethod(assembly, "MesServerFunctions", "FunctionMES", "FunWork", Paramsters);
+
+ }
+ catch (Exception err)
+ {
+ ////ApplicationLog.WriteLog(err, "TransferInf");
+ }
+
+ }
+ ///
+ /// 获得工位对应的 dll
+ ///
+ ///
+ ///
+ ///
+ private static bool GetMesServerDllNameByOpName(out string mesServerdllName, string opName)
+ {
+ try
+ {
+ mesServerdllName = hashtable_MesDll[opName].ToString();
+ return true;
+ }
+ catch
+ {
+ mesServerdllName = "";
+ return false;
+ }
+ }
+
+
+
+ }
+}
\ No newline at end of file
diff --git a/Common/09MesDataFunction/MesDataFunction/14MisDataFunctionDB/MisDataFun.ShaftPositionData.cs b/Common/09MesDataFunction/MesDataFunction/14MisDataFunctionDB/MisDataFun.ShaftPositionData.cs
new file mode 100644
index 0000000..563c988
--- /dev/null
+++ b/Common/09MesDataFunction/MesDataFunction/14MisDataFunctionDB/MisDataFun.ShaftPositionData.cs
@@ -0,0 +1,156 @@
+using DataLinkMesWork1;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SqlClient;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace MisDataFunDll
+{
+ public partial class ShaftPosition
+ {
+ ///
+ /// 测量数据合格_电子看板_质量数据_临时表_增加_返修工位
+ /// @EngineID nvarchar(50)=null,
+ /// @EngineType nvarchar(50)=null,
+ /// @EngineTypeID int = null,
+ /// @工位号 nvarchar(50)=null,
+ /// @工位号返修工位 nvarchar(50)=null,
+ /// @订单号 nvarchar(50)=null,
+ /// @合格标志 int
+ ///
+ /// 工件号
+ /// 机型
+ /// 机型代码
+ /// 工位号(被返修的工位号)
+ /// 工位号返修工位
+ /// 订单号
+ /// 合格标志
+ static public void ShaftPosition_Data_OpNameRepair_Insert(string engineID, string engineType, int engineTypeID, string opName, string opNameRepair, string orderForm, int isOK)
+ {
+ string procedureName;
+ procedureName = "测量数据合格_电子看板_质量数据_临时表_增加_返修工位";
+ SqlParameter[] thisParmsSql = new SqlParameter[7];
+ thisParmsSql[0] = new SqlParameter("@EngineID", engineID);
+ thisParmsSql[1] = new SqlParameter("@EngineType", engineType);
+ thisParmsSql[2] = new SqlParameter("@EngineTypeID", engineTypeID);
+ thisParmsSql[3] = new SqlParameter("@工位号", opName);
+ thisParmsSql[4] = new SqlParameter("@工位号返修工位", opNameRepair);
+ thisParmsSql[5] = new SqlParameter("@订单号", orderForm);
+ thisParmsSql[6] = new SqlParameter("@合格标志", isOK);
+ DataAccess.ExecuteStoredProcedure(procedureName, ref thisParmsSql);
+ }
+ ///
+ /// 测量数据合格_电子看板_质量数据_临时表_增加
+ /// @EngineID nvarchar(50)=null,
+ /// @EngineType nvarchar(50)=null,
+ /// @EngineTypeID int = null,
+ /// @工位号 nvarchar(50)=null,
+ /// @订单号 nvarchar(50)=null,
+ /// @合格标志 int
+ ///
+ /// 工件号
+ /// 机型
+ /// 机型代码
+ /// 工位号
+ /// 订单号
+ /// 合格标志
+ static public void ShaftPosition_Data_Insert(string engineID, string engineType, int engineTypeID, string opName, string orderForm, int isOK)
+ {
+ string procedureName;
+ procedureName = "测量数据合格_电子看板_质量数据_临时表_增加";
+ SqlParameter[] thisParmsSql = new SqlParameter[6];
+ thisParmsSql[0] = new SqlParameter("@EngineID", engineID);
+ thisParmsSql[1] = new SqlParameter("@EngineType", engineType);
+ thisParmsSql[2] = new SqlParameter("@EngineTypeID", engineTypeID);
+ thisParmsSql[3] = new SqlParameter("@工位号", opName);
+ thisParmsSql[4] = new SqlParameter("@订单号", orderForm);
+ thisParmsSql[5] = new SqlParameter("@合格标志", isOK);
+ DataAccess.ExecuteStoredProcedure(procedureName, ref thisParmsSql);
+ }
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ static public void ShaftPosition_Data_Insert_RepairOpName(string opName, int shaftStep, string engineID, string engineType, int engineTypeID, int orderBy, string tagValue, int isOK)
+ {
+ string procedureName;
+ procedureName = "电子看板_质量数据_临时表_增加_备用拧紧工位";
+ SqlParameter[] thisParmsSql = new SqlParameter[8];
+ thisParmsSql[0] = new SqlParameter("@工位号", opName);
+ thisParmsSql[1] = new SqlParameter("@序号", shaftStep);
+ thisParmsSql[2] = new SqlParameter("@EngineID", engineID);
+ thisParmsSql[3] = new SqlParameter("@EngineType", engineType);
+ thisParmsSql[4] = new SqlParameter("@EngineTypeID", engineTypeID);
+ thisParmsSql[5] = new SqlParameter("@变量排序", orderBy);
+ thisParmsSql[6] = new SqlParameter("@测量值", tagValue);
+ thisParmsSql[7] = new SqlParameter("@合格标志", isOK);
+ DataAccess.ExecuteStoredProcedure(procedureName, ref thisParmsSql);
+ }
+ ///
+ /// 电子看板_质量数据_临时表_增加
+ ///
+ /// 工位号
+ /// 序号
+ /// 工件号
+ /// 机型
+ /// 机型代码
+ /// 变量代码
+ /// 变量值
+ /// 合格标志
+ static public void ShaftPosition_Data_Insert(string opName, int shaftStep, string engineID, string engineType, int engineTypeID, int tagID, string tagValue, int isOK)
+ {
+ string procedureName;
+ procedureName = "电子看板_质量数据_临时表_增加";
+ SqlParameter[] thisParmsSql = new SqlParameter[8];
+ thisParmsSql[0] = new SqlParameter("@工位号", opName);
+ thisParmsSql[1] = new SqlParameter("@序号", shaftStep);
+ thisParmsSql[2] = new SqlParameter("@EngineID", engineID);
+ thisParmsSql[3] = new SqlParameter("@EngineType", engineType);
+ thisParmsSql[4] = new SqlParameter("@EngineTypeID", engineTypeID);
+ thisParmsSql[5] = new SqlParameter("@TagID", tagID);
+ thisParmsSql[6] = new SqlParameter("@测量值", tagValue);
+ thisParmsSql[7] = new SqlParameter("@合格标志", isOK);
+ DataAccess.ExecuteStoredProcedure(procedureName, ref thisParmsSql);
+ }
+ ///
+ /// 电子看板_工位机型_质量数据测量位置_查询_工作顺序
+ ///
+ ///
+ ///
+ ///
+ static public void ShaftPosition_Select_WorkingStep(string opName, int engineTypeID, out DataTable dt)
+ {
+ dt = null;
+
+ string sql = "exec 电子看板_工位机型_质量数据测量位置_查询_工作顺序 '" + opName + "'," + engineTypeID.ToString();
+ DataAccess.ExecuteDataTable(sql, out dt);
+ }
+
+ ///
+ /// 电子看板_质量数据_临时表_删除
+ ///
+ /// 工位号
+ /// 列位置
+ /// EngineID
+ static public void ShaftPosition_Data_Delete(string opName, int shaftStep, string engineID)
+ {
+ string procedureName;
+ procedureName = "电子看板_质量数据_临时表_删除";
+ SqlParameter[] thisParmsSql = new SqlParameter[3];
+ thisParmsSql[0] = new SqlParameter("@工位号", opName);
+ thisParmsSql[1] = new SqlParameter("@列位置", shaftStep);
+ thisParmsSql[2] = new SqlParameter("@EngineID", engineID);
+ DataAccess.ExecuteStoredProcedure(procedureName, ref thisParmsSql);
+ }
+ }
+}
diff --git a/Common/09MesDataFunction/MesDataFunction/14MisDataFunctionDB/MisDataFun.TagTypeCodeID.cs b/Common/09MesDataFunction/MesDataFunction/14MisDataFunctionDB/MisDataFun.TagTypeCodeID.cs
new file mode 100644
index 0000000..ad1531b
--- /dev/null
+++ b/Common/09MesDataFunction/MesDataFunction/14MisDataFunctionDB/MisDataFun.TagTypeCodeID.cs
@@ -0,0 +1,462 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+///1 X WorkStart 2 工件到位(PLC) 工件到位。托盘到达工位,并且托盘上有工件。
+///2 X RepairPartStatusPLC 3 RepairPartStatusPLC 备用
+///3 STRING RepairPathString 4 RepairPathString "工位返修字符串(121211112222111),前2位是西门子字符串格式,第一位是总长度,第二位是实际长度"
+///4 X EngineTypeGetOverMES 5 传递机型(MES) MES传递总成信息给PLC(上线工位)
+///5 X PartPalletGoOver 6 PartPalletGoOver 上线工位。0:正常工作;1:空托盘放行,PLC读取到此标志不走申请上线逻辑。
+///6 X MaterialVerifyOver 7 MaterialVerifyOver MES保存完质量数据,物料数据等与PLC信号交互完成后通知PLC,所以工步都完成,才可以放行工件,正常工作时工件放行的必要条件。
+///7 X FalseGo 8 FalseGo 按MES界面[不合格放行]按钮,MES发送此信号。操作者判断工件不合格,通知设备,按不合格方式放行工件,工件流转到返修下线工位后,返修下线。MES工作完成MES0.3=1,MES合格放行MES0.5=0,MES0.4=1
+///8 INT EngineTypeID 9 EngineTypeID MES发动机机型标志(必须PLC)
+///9 STRING EngineID 10 EngineID MES发动机编号(必须PLC)
+///10 STRING EngineType 11 机型(MES) MES发动机机型(必须PLC)
+///11 X PartPalletStatus 13 PartPalletStatus MES激发变量托盘到位离开(必须PLC)
+///12 X HeartBeatPLC 14 HeartBeatPLC 心跳处理:PLC收到MES心跳信号后,PLC延时5秒后,数值取反再写回PLC,写回PLC开始计时,如果5秒钟MES无反馈报通讯故障。
+///13 X HeartBeatMIS 15 HeartBeatMIS 间隔时间5S,心跳处理。收到PLC心跳信号后,MES按原值回写。PLC收到MES信号后延时5秒,取反写入,以此循环。
+///14 X TargetTimeRead 16 TargetTimeRead MES允许可读工位运行时间
+///15 Int MachineTargetTime 17 MachineTargetTime 目标运行时间
+///16 Int MachineActualTime 18 MachineActualTime 实际运行时间
+///17 X MesRead 19 允许保存(PLC) 质量数据可以读数据
+///18 X MesReadOver 20 保存完成(MES) MES保存完数据(必须MIS)
+///19 INT QualityMask 21 合格标志(PLC) 质量数据工位合格标志0:没有工作;1:合格 ;2 :不合格(必须PLC)
+///20 B PalletInfo 22 PalletInfo 0空托盘,1合格件,2不合格件
+///21 INT RepairStatusPLC 23 RepairStatusPLC 0正常件,1返修件
+///22 INT OrderNo 24 订单号(MES) 订单号(MES)
+///23 X StorageNo 25 库位号(MES) 库位号(MES)
+///24 X AllowPass 26 允许放行(MES) 允许放行
+///25 X PartLoadFinish 27 PartLoadFinish PartLoadFinish
+///26 X Reserved_7 28 Reserved_7 备用
+///27 X Reserved_8 29 Reserved_8 备用
+///28 X Reserved_9 30 Reserved_9 备用
+///29 X Reserved_10 31 Reserved_10 备用
+///30 X Reserved_11 32 Reserved_11 备用
+///31 X Reserved_12 33 Reserved_12 备用
+///32 X Reserved_13 34 Reserved_13 备用
+///33 X Reserved_14 35 Reserved_14 备用
+///34 Int PLCSPareint1 36 PLCSPareint1 备用
+///35 Int PLCSPareint2 37 PLCSPareint2 备用
+///36 Int PLCSPareint3 38 PLCSPareint3 备用
+///37 STRING PLCSarestring1 39 PLCSarestring1 备用
+///38 STRING PLCSarestring2 40 PLCSarestring2 备用
+///39 STRING MarkID 42 MarkID 机体打标号(MES)前2位是西门子字符串格式,第一位是总长度,第二位是实际长度
+///40 X PartLoad 43 PartLoad 上线工位,PLC向MES申请总成编号。收到该信号后,MES将机型标志(DBB22 ~23)、总成号(DBB24 ~63)、总成机型DBB64 ~103写入PLC。之后MES通过信号“传递机型(DBX0.1)”通知PLC。
+///41 X EngineTypeGetOverPLC 44 传递机型(PLC) PLC将机型标志(DBB50…51)、工件编号(DBB52…101)、产品型号(DBB102…187)、托盘编号(DBB188…189)准备完毕后,通知MES。
+///42 X PartLoadOK 48 PartLoadOK 备用
+///43 X Reserved_18 49 Reserved_18 备用
+///44 X PalletDown 50 PalletDown 暂时保留,项目未使用
+///45 X ConfirmOkGo 51 ConfirmOkGo 按MES界面[合格放行]按钮,MES发送此信号。操作者判断工件合格,通知设备,工件按合格方式放行工件。MES工作完成MES0.3=1,MES合格放行MES0.5=1,MES0.4=0
+///46 X ResetDevice 52 ResetDevice 针对手动工位,无HMI,需要复位设备在MES页面操作。
+///47 X UnloadCompleted 53 UnloadCompleted 暂时保留,项目未使用
+///48 X MachineTime_ReadOver 54 MachineTime_ReadOver 备用
+///49 X Reserved_19 58 Reserved_19 备用
+///50 X FixOK 59 FixOK 手动拧紧工位,单工步螺栓拧紧完成,通知PC读取数据。
+///51 X Reserved_21 61 Reserved_21 备用
+///52 X Reserved_22 62 Reserved_22 备用
+///53 X Reserved_23 63 Reserved_23 备用
+///54 X Reserved_24 64 Reserved_24 备用
+///55 X Reserved_25 65 Reserved_25 备用
+///56 X FixAllow 66 FixAllow "设备工作的必须信号,对于有物料验证的工位,MES验证完成给出此信号,对于无物料验证工位,MES直接给出此信号。"
+///57 X FixOver 67 FixOver 用于手动拧紧且有质量数据工位。通知设备当前工步拧紧螺钉工作结束。
+///58 X MatchingCompleted 68 MatchingCompleted 分线上总线,匹配成功是1;不成功是0。
+///59 X Match 69 Match 分线上总线,匹配成功是1;不成功是0。
+///60 X Reserved_2 70 Reserved_2 备用
+///61 X IsAutoGetEngineID 71 IsAutoGetEngineID 自动手动申请工件编号。0是自动方式;1:手动方式。暂时保留,生成流水号方式是在数据库中实现的
+///62 X RepairUplineMES 72 RepairUplineMES 上线清空MOBY(针对上线工位):通知PLC从新开始申请上线流程
+///63 INT EngineTypeID_MES 73 机型代码(MES) MES发动机机型标志(必须MES)
+///64 STRING EngineID_MES 74 工件编号(MES) MES发动机编号(必须MES)
+///65 STRING EngineType_MES 75 EngineType_MES MES发动机机型(必须MES)
+///66 X Reserved_20 76 Reserved_20 备用
+///67 INT ProcessCode 77 ProcessCode 手动拧紧工位:由MES通知PLC拧紧序号
+///68 B OnLineState 79 OnLineState 通过线体工位PC实现下达工位工作状态:工位有三种状态:在线、离线、屏蔽。在线:0正常状态,实现正常功能。1离线:设备脱离MES工作,进入不交互模式。
+///69 INT PartPalletCode 80 托盘号(MES) 托盘编号(B5A)
+///70 INT BoltCode 88 BoltCode 手动拧紧工位:指导PLC所用套筒
+///71 INT RepairStatus 93 RepairStatus "0正常件,1返修件。对于上线工位MES给出是正常上线还是返修上线,返修路径"
+///72 DInt Reserved_15 110 Reserved_15 备用
+///73 DInt Reserved_16 111 Reserved_16 备用
+///74 B Reserved_17 112 Reserved_17 备用
+///75 INT SPareint1 113 SPareint1 备用int1
+///76 INT SPareint2 114 SPareint2 备用int2
+///77 INT SPareint3 115 SPareint3 备用int3
+///78 STRING Sparestring1 116 Sparestring1 备用字符串1
+///79 STRING Sparestring2 117 Sparestring2 备用字符串2
+///80 X MachineStatusPutOn 1000 机床上电(PLC) 机床上电(必须PLC)
+///81 X MachineStatusWorkOn 1001 循环开始(PLC) 循环开始(必须PLC)
+///82 X MachineStatusAlarm 1002 设备报警(PLC) 机床故障(必须PLC)
+///83 X MachineStatusNoPart 1003 MachineStatusNoPart 上料无件(必须PLC)
+///84 X MachineStatusBlock 1004 MachineStatusBlock 下料堵塞(必须PLC)
+
+
+namespace MisDataFunDll
+{
+ ///
+ /// 这是变量类型代码的配置,几乎是不变的
+ /// 请不要随意修改,为了保证变量版本同一,并且方便维护,请联系发行人修改!
+ /// 请注意,此修改为全局修改!
+ ///
+ public enum EnumTagTypeCodeID
+ {
+ ///
+ /// 工件到位(PLC)
+ /// 变量类型:Bool
+ /// 解释:托盘到达工位,并且托盘上有工件。
+ ///
+ WorkStart = 2,
+ ///
+ ///
+ ///
+ RepairPartStatusPLC = 3,
+ ///
+ /// 工位返修字符串
+ /// 变量类型:String
+ /// 解释:工位返修字符串
+ ///
+ RepairPathString = 4,
+ ///
+ /// 传递机型(MES)
+ /// 变量类型:Bool
+ /// 解释:MES传递总成信息给PLC(上线工位)
+ ///
+ EngineTypeGetOverMES = 5,
+ ///
+ ///
+ ///
+ PartPalletGoOver = 6,
+ ///
+ ///
+ ///
+ MaterialVerifyOver = 7,
+ ///
+ ///
+ ///
+ FalseGo = 8,
+ ///
+ ///
+ ///
+ EngineTypeID = 9,
+ ///
+ ///
+ ///
+ EngineID = 10,
+ ///
+ /// 机型(MES)
+ /// 变量类型:String
+ ///
+ EngineType = 11,
+ ///
+ ///
+ ///
+ PartPalletStatus = 13,
+ ///
+ ///
+ ///
+ HeartBeatPLC = 14,
+ ///
+ ///
+ ///
+ HeartBeatMIS = 15,
+ ///
+ ///
+ ///
+ TargetTimeRead = 16,
+ ///
+ ///
+ ///
+ MachineTargetTime = 17,
+ ///
+ ///
+ ///
+ MachineActualTime = 18,
+ ///
+ /// 允许保存(PLC)
+ /// 变量类型:Bool
+ ///
+ MesRead = 19,
+ ///
+ /// 保存完成(MES)
+ /// 变量类型:Bool
+ ///
+ MesReadOver = 20,
+ ///
+ /// 合格标志(PLC)
+ /// 变量类型:Int
+ ///
+ QualityMask = 21,
+ ///
+ ///
+ ///
+ PalletInfo = 22,
+ ///
+ ///
+ ///
+ RepairStatusPLC = 23,
+ ///
+ /// 订单号(MES)
+ /// 变量类型:Int
+ ///
+ OrderNo = 24,
+ ///
+ /// 库位号(MES)
+ /// 变量类型:Bool
+ ///
+ StorageNo = 25,
+ ///
+ /// 允许放行(MES)
+ /// 变量类型:Bool
+ ///
+ AllowPass = 26,
+ ///
+ ///
+ ///
+ PartLoadFinish = 27,
+ ///
+ ///
+ ///
+ Reserved_7 = 28,
+ ///
+ ///
+ ///
+ Reserved_8 = 29,
+ ///
+ ///
+ ///
+ Reserved_9 = 30,
+ ///
+ ///
+ ///
+ Reserved_10 = 31,
+ ///
+ ///
+ ///
+ Reserved_11 = 32,
+ ///
+ ///
+ ///
+ Reserved_12 = 33,
+ ///
+ ///
+ ///
+ Reserved_13 = 34,
+ ///
+ ///
+ ///
+ Reserved_14 = 35,
+ ///
+ ///
+ ///
+ PLCSPareint1 = 36,
+ ///
+ ///
+ ///
+ PLCSPareint2 = 37,
+ ///
+ ///
+ ///
+ PLCSPareint3 = 38,
+ ///
+ /// 订单号(PLC)
+ ///
+ OrderFormPLC = 39,
+ ///
+ ///
+ ///
+ PLCSarestring2 = 40,
+ ///
+ ///
+ ///
+ MarkID = 42,
+ ///
+ ///
+ ///
+ PartLoad = 43,
+ ///
+ /// 传递机型(PLC)
+ /// 变量类型:Bool
+ ///
+ EngineTypeGetOverPLC = 44,
+ ///
+ ///
+ ///
+ PartLoadOK = 48,
+ ///
+ ///
+ ///
+ Reserved_18 = 49,
+ ///
+ ///
+ ///
+ PalletDown = 50,
+ ///
+ ///
+ ///
+ ConfirmOkGo = 51,
+ ///
+ ///
+ ///
+ ResetDevice = 52,
+ ///
+ ///
+ ///
+ UnloadCompleted = 53,
+ ///
+ ///
+ ///
+ MachineTime_ReadOver = 54,
+ ///
+ ///
+ ///
+ Reserved_19 = 58,
+ ///
+ ///
+ ///
+ FixOK = 59,
+ ///
+ ///
+ ///
+ Reserved_21 = 61,
+ ///
+ ///
+ ///
+ Reserved_22 = 62,
+ ///
+ ///
+ ///
+ Reserved_23 = 63,
+ ///
+ ///
+ ///
+ Reserved_24 = 64,
+ ///
+ ///
+ ///
+ Reserved_25 = 65,
+ ///
+ ///
+ ///
+ FixAllow = 66,
+ ///
+ ///
+ ///
+ FixOver = 67,
+ ///
+ ///
+ ///
+ MatchingCompleted = 68,
+ ///
+ ///
+ ///
+ Match = 69,
+ ///
+ ///
+ ///
+ Reserved_2 = 70,
+ ///
+ ///
+ ///
+ IsAutoGetEngineID = 71,
+ ///
+ ///
+ ///
+ RepairUplineMES = 72,
+ ///
+ /// 机型代码(MES)
+ /// 变量类型:Int
+ ///
+ EngineTypeID_MES = 73,
+ ///
+ /// 工件编号(MES)
+ /// 变量类型:String
+ ///
+ EngineID_MES = 74,
+ ///
+ ///
+ ///
+ EngineType_MES = 75,
+ ///
+ ///
+ ///
+ Reserved_20 = 76,
+ ///
+ ///
+ ///
+ ProcessCode = 77,
+ ///
+ ///
+ ///
+ OnLineState = 79,
+ ///
+ /// 托盘号(MES)
+ /// 变量类型:Int
+ ///
+ PartPalletCode = 80,
+ ///
+ ///
+ ///
+ BoltCode = 88,
+ ///
+ ///
+ ///
+ RepairStatus = 93,
+ ///
+ ///
+ ///
+ Reserved_15 = 110,
+ ///
+ ///
+ ///
+ Reserved_16 = 111,
+ ///
+ ///
+ ///
+ Reserved_17 = 112,
+ ///
+ ///
+ ///
+ SPareint1 = 113,
+ ///
+ ///
+ ///
+ SPareint2 = 114,
+ ///
+ ///
+ ///
+ ///
+ /// MES订单号
+ ///
+ OrdeFormMES = 116,
+ ///
+ ///
+ ///
+ Sparestring2 = 117,
+ ///
+ /// 机床上电(PLC)
+ /// 变量类型:Bool
+ ///
+ MachineStatusPutOn = 1000,
+ ///
+ /// 循环开始(PLC)
+ /// 变量类型:Bool
+ ///
+ MachineStatusWorkOn = 1001,
+ ///
+ /// 设备报警(PLC)
+ /// 变量类型:Bool
+ ///
+ MachineStatusAlarm = 1002,
+ ///
+ /// 上料无件(PLC)
+ /// 变量类型:Bool
+ ///
+ MachineStatusNoPart = 1003,
+ ///
+ /// 下料堵塞(PLC)
+ /// 变量类型:Bool
+ ///
+ MachineStatusBlock = 1004,
+
+
+ }
+}
diff --git a/Common/09MesDataFunction/MesDataFunction/14MisDataFunctionDB/Reflection.cs b/Common/09MesDataFunction/MesDataFunction/14MisDataFunctionDB/Reflection.cs
new file mode 100644
index 0000000..d7bd835
--- /dev/null
+++ b/Common/09MesDataFunction/MesDataFunction/14MisDataFunctionDB/Reflection.cs
@@ -0,0 +1,94 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Reflection;
+using System.Web;
+using System.ComponentModel;
+
+namespace MisDataFunDll
+{
+ ///
+ ///
+ ///
+ public class Reflection
+ {
+ ///
+ /// 通过反射调用动态连接库方法
+ ///
+ /// 程序集(DLL)
+ /// 命名空间名称,如果无命名空间写“”
+ /// 类名
+ /// 方法名
+ /// 函数参数数组
+ static public string ReflectionMethod(Assembly assembly, string Namespace, string Classname, string Method, object[] Paramsters)
+ {
+ try
+ {
+
+ Type t;
+ //类
+ if (Namespace == "")
+ {
+ t = assembly.GetType(Classname);
+ }
+ else
+ {
+ t = assembly.GetType(Namespace + "." + Classname);
+ }
+ if (t == null)
+ {
+ return "类不存在";
+ }
+ ////方法
+ MethodInfo mi = t.GetMethod(Method); //获取方法
+ if (mi == null)
+ {
+ return "方法不存在";
+ }
+ ParameterInfo[] paramsInfo = mi.GetParameters();
+ for (int i = 0; i < paramsInfo.Length; i++)
+ {
+ Type tType = paramsInfo[i].ParameterType;
+ //改变参数类型
+ Paramsters[i]= SD_ChanageType(Paramsters[i],tType);
+ }
+ /// 建一个实例化的类
+ object instanceObject = Activator.CreateInstance(t);
+ mi.Invoke(instanceObject, Paramsters);
+ return "ok";
+ }
+ catch(Exception err)
+ {
+ return err.ToString();
+
+ }
+
+ }
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static object SD_ChanageType(object value, Type convertsionType)
+ {
+ //判断convertsionType类型是否为泛型,因为nullable是泛型类,
+ if (convertsionType.IsGenericType &&
+ //判断convertsionType是否为nullable泛型类
+ convertsionType.GetGenericTypeDefinition().Equals(typeof(Nullable<>)))
+ {
+ if (value == null || value.ToString().Length == 0)
+ {
+ return null;
+ }
+
+ //如果convertsionType为nullable类,声明一个NullableConverter类,该类提供从Nullable类到基础基元类型的转换
+ NullableConverter nullableConverter = new NullableConverter(convertsionType);
+ //将convertsionType转换为nullable对的基础基元类型
+ convertsionType = nullableConverter.UnderlyingType;
+ }
+ return Convert.ChangeType(value, convertsionType);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Common/09MesDataFunction/MesDataFunction/LoadTagTypeCodeID.cs b/Common/09MesDataFunction/MesDataFunction/LoadTagTypeCodeID.cs
new file mode 100644
index 0000000..8418da8
--- /dev/null
+++ b/Common/09MesDataFunction/MesDataFunction/LoadTagTypeCodeID.cs
@@ -0,0 +1,128 @@
+//using BasicData;
+//using MesWork;
+//using OpcBasic;
+using MesServerWork;
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Collections.Specialized;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using static MesServerWork.MIS_BASE;
+
+namespace MesDataFunction
+{
+ public class LoadTagTypeCodeID
+ {
+
+
+ public static void Load(string path)
+ {
+ MIS_BASE.hashtable_TagType = new NameValueCollection();
+ MIS_BASE.hashtable_TagTypeTagName = new NameValueCollection();
+ MIS_BASE.hashtable_TagTypeChange = new NameValueCollection();
+ MIS_BASE.hashtable_MesTagTypeChange = new NameValueCollection();
+ MIS_BASE.hashtable_WebTagTypeChange = new NameValueCollection();
+ MIS_BASE.hashtable_TagTypeDataType = new NameValueCollection();
+
+ var dt = NPOITest.ExeclHelper.ExcelToDataTable(path, "变量类型代码", true);
+ for (int i = 0; i < dt.Rows.Count; i++)
+ {
+ //序号 变量类型 TagTypeDataType TagName 变量类型代码 TagTypeChange MesTagTypeChange WebTagTypeChange 信号点名称 变量类型名称
+
+ var TagTypeDataType = dt.Rows[i]["TagTypeDataType"].ToString();
+ var TagName = dt.Rows[i]["TagName"].ToString();
+ var 变量类型代码 = dt.Rows[i]["变量类型代码"].ToString();
+ var TagTypeChange = dt.Rows[i]["TagTypeChange"].ToString();
+ var WebTagTypeChange = dt.Rows[i]["WebTagTypeChange"].ToString();
+ var MesTagTypeChange = dt.Rows[i]["MesTagTypeChange"].ToString();
+
+ //OpcOperation.hashtable_TagType.Add(TagName, 变量类型代码);
+ //OpcOperation.hashtable_TagTypeTagName.Add(变量类型代码, TagName);
+ //OpcOperation.hashtable_TagTypeChange.Add(TagName, TagTypeChange);
+ //OpcOperation.hashtable_MesTagTypeChange.Add(TagName, MesTagTypeChange);
+ //OpcOperation.hashtable_WebTagTypeChange.Add(TagName, WebTagTypeChange);
+ //OpcOperation.hashtable_TagTypeDataType.Add(变量类型代码, TagTypeDataType);
+ if (!MIS_BASE.hashtable_TagType.AllKeys.Contains(TagName))
+ MIS_BASE.hashtable_TagType.Add(TagName, 变量类型代码);
+ if (!MIS_BASE.hashtable_TagTypeTagName.AllKeys.Contains(变量类型代码))
+ MIS_BASE.hashtable_TagTypeTagName.Add(变量类型代码, TagName);
+ if (!MIS_BASE.hashtable_TagTypeChange.AllKeys.Contains(TagName))
+ MIS_BASE.hashtable_TagTypeChange.Add(TagName, TagTypeChange);
+ if (!MIS_BASE.hashtable_MesTagTypeChange.AllKeys.Contains(TagName))
+ MIS_BASE.hashtable_MesTagTypeChange.Add(TagName, MesTagTypeChange);
+ if (!MIS_BASE.hashtable_WebTagTypeChange.AllKeys.Contains(TagName))
+ MIS_BASE.hashtable_WebTagTypeChange.Add(TagName, WebTagTypeChange);
+ if (!MIS_BASE.hashtable_TagTypeDataType.AllKeys.Contains(变量类型代码))
+ MIS_BASE.hashtable_TagTypeDataType.Add(变量类型代码, TagTypeDataType);
+ }
+ HashtableList.hashtable_TagTypeTagName_Temp = new Hashtable();
+ foreach (string key in MIS_BASE.hashtable_TagTypeTagName.Keys)
+ {
+ HashtableList.hashtable_TagTypeTagName_Temp.Add(key, MIS_BASE.hashtable_TagTypeTagName[key]);
+ }
+ HashtableList.hashtable_TagTypeDataType_Temp = new NameValueCollection();
+ foreach (string key in MIS_BASE.hashtable_TagTypeDataType.Keys)
+ {
+ HashtableList.hashtable_TagTypeDataType_Temp.Add(key, MIS_BASE.hashtable_TagTypeDataType[key]);
+ }
+ HashtableList.hashtable_TagType_Temp = new NameValueCollection();
+ foreach (string key in MIS_BASE.hashtable_TagType.Keys)
+ {
+ HashtableList.hashtable_TagType_Temp.Add(key, MIS_BASE.hashtable_TagType[key]);
+ }
+ }
+
+ public static void Load(DataTable dt)
+ {
+ MIS_BASE.hashtable_TagType = new NameValueCollection();
+ MIS_BASE.hashtable_TagTypeTagName = new NameValueCollection();
+ MIS_BASE.hashtable_TagTypeChange = new NameValueCollection();
+ MIS_BASE.hashtable_MesTagTypeChange = new NameValueCollection();
+ MIS_BASE.hashtable_WebTagTypeChange = new NameValueCollection();
+ MIS_BASE.hashtable_TagTypeDataType = new NameValueCollection();
+
+ for (int i = 0; i < dt.Rows.Count; i++)
+ {
+ //序号 变量类型 TagTypeDataType TagName 变量类型代码 TagTypeChange MesTagTypeChange WebTagTypeChange 信号点名称 变量类型名称
+ var TagTypeDataType = dt.Rows[i]["TagTypeDataType"].ToString();
+ var TagName = dt.Rows[i]["TagName"].ToString();
+ var 变量类型代码 = dt.Rows[i]["变量类型代码"].ToString();
+ var TagTypeChange = dt.Rows[i]["TagTypeChange"].ToString();
+ var WebTagTypeChange = dt.Rows[i]["WebTagTypeChange"].ToString();
+ var MesTagTypeChange = dt.Rows[i]["MesTagTypeChange"].ToString();
+ if (!MIS_BASE.hashtable_TagType.AllKeys.Contains(TagName))
+ MIS_BASE.hashtable_TagType.Add(TagName, 变量类型代码);
+ if (!MIS_BASE.hashtable_TagTypeTagName.AllKeys.Contains(变量类型代码))
+ MIS_BASE.hashtable_TagTypeTagName.Add(变量类型代码, TagName);
+ if (!MIS_BASE.hashtable_TagTypeChange.AllKeys.Contains(TagName))
+ MIS_BASE.hashtable_TagTypeChange.Add(TagName, TagTypeChange);
+ if (!MIS_BASE.hashtable_MesTagTypeChange.AllKeys.Contains(TagName))
+ MIS_BASE.hashtable_MesTagTypeChange.Add(TagName, MesTagTypeChange);
+ if (!MIS_BASE.hashtable_WebTagTypeChange.AllKeys.Contains(TagName))
+ MIS_BASE.hashtable_WebTagTypeChange.Add(TagName, WebTagTypeChange);
+ if (!MIS_BASE.hashtable_TagTypeDataType.AllKeys.Contains(变量类型代码))
+ MIS_BASE.hashtable_TagTypeDataType.Add(变量类型代码, TagTypeDataType);
+ }
+ HashtableList.hashtable_TagTypeTagName_Temp = new Hashtable();
+ foreach (string key in MIS_BASE.hashtable_TagTypeTagName.Keys)
+ {
+ HashtableList.hashtable_TagTypeTagName_Temp.Add(key, MIS_BASE.hashtable_TagTypeTagName[key]);
+ }
+ HashtableList.hashtable_TagTypeDataType_Temp = new NameValueCollection();
+ foreach (string key in MIS_BASE.hashtable_TagTypeDataType.Keys)
+ {
+ HashtableList.hashtable_TagTypeDataType_Temp.Add(key, MIS_BASE.hashtable_TagTypeDataType[key]);
+ }
+ HashtableList.hashtable_TagType_Temp = new NameValueCollection();
+ foreach (string key in MIS_BASE.hashtable_TagType.Keys)
+ {
+ HashtableList.hashtable_TagType_Temp.Add(key, MIS_BASE.hashtable_TagType[key]);
+ }
+ }
+
+ }
+
+}
diff --git a/Common/09MesDataFunction/MesDataFunction/MesDataFunction/InitTagValueListData.cs b/Common/09MesDataFunction/MesDataFunction/MesDataFunction/InitTagValueListData.cs
new file mode 100644
index 0000000..e4cc6aa
--- /dev/null
+++ b/Common/09MesDataFunction/MesDataFunction/MesDataFunction/InitTagValueListData.cs
@@ -0,0 +1,83 @@
+//using DataLinkMesWork;
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Text;
+//using SystemFramework;
+
+namespace MesServerWork
+{
+ public class InitTagValueListData
+ {
+ public InitTagValueListData()
+ {
+ DataTable dt = ReadMesServerData();
+
+ InitMesReadTagKey();
+ initAllItemValue(dt);
+ }
+
+ DataTable ReadMesServerData()
+ {
+ return null;// MesWork.PlcLinkForm.dt_BasicData.Select($"是否启用 = 1 and 监控属性代码 = '{1}'").CopyToDataTable();
+ }
+
+ void InitMesReadTagKey()
+ {
+ DataTable dt = null;// MesWork.PlcLinkForm.dt_BasicData.Select($"是否启用 = 1 and 变量类型代码=19 and 监控属性代码 = '{1}'").CopyToDataTable(); ;
+
+ for (int i = 0; i < dt.Rows.Count; i++)
+ {
+ if (MesReadTagKey_Hash.ContainsKey(dt.Rows[i]["工位号"].ToString()))
+ {
+ MesReadTagKey_Hash[dt.Rows[i]["工位号"].ToString()] = dt.Rows[i]["TagID"].ToString();
+ }
+ else
+ {
+ MesReadTagKey_Hash.Add(dt.Rows[i]["工位号"].ToString(), dt.Rows[i]["TagID"].ToString());
+ }
+
+ }
+
+ }
+ void initAllItemValue(DataTable dt)
+ {
+ for (int i = 0; i < dt.Rows.Count; i++)
+ {
+ if (ItemValue_Hash.ContainsKey(dt.Rows[i]["TagID"]))
+ {
+ if (Convert.ToInt32(dt.Rows[i]["列位置"]) != 0)
+ {
+ ItemValue_Hash[dt.Rows[i]["TagID"]] = dt.Rows[i]["测量项目"].ToString() + "(" + dt.Rows[i]["列位置"].ToString() + ")";
+ }
+ else
+ {
+ ItemValue_Hash[dt.Rows[i]["TagID"]] = dt.Rows[i]["测量项目"].ToString();
+ }
+
+ }
+ else
+ {
+ if (Convert.ToInt32(dt.Rows[i]["列位置"]) != 0)
+ {
+ ItemValue_Hash[dt.Rows[i]["TagID"]] = dt.Rows[i]["测量项目"].ToString() + "(" + dt.Rows[i]["列位置"].ToString() + ")";
+ }
+ else
+ {
+ ItemValue_Hash[dt.Rows[i]["TagID"]] = dt.Rows[i]["测量项目"].ToString();
+ }
+ }
+
+ }
+
+
+ }
+
+
+ public static Hashtable MesReadTagKey_Hash = new Hashtable();
+ public static Hashtable ItemValue_Hash = new Hashtable();
+
+ }
+}
diff --git a/Common/09MesDataFunction/MesDataFunction/MesDataFunction/MIS.Functions.Barcode.cs b/Common/09MesDataFunction/MesDataFunction/MesDataFunction/MIS.Functions.Barcode.cs
new file mode 100644
index 0000000..1df2dfe
--- /dev/null
+++ b/Common/09MesDataFunction/MesDataFunction/MesDataFunction/MIS.Functions.Barcode.cs
@@ -0,0 +1,95 @@
+using System;
+using System.Data;
+using System.Collections;
+
+using System.Windows.Forms;
+//using bizFacade;
+using System.Collections.Specialized;
+//using MesWork;
+//using SystemFramework;
+using bizFacade;
+
+namespace MesServerWork
+{
+ public partial class MIS_BASE
+ {
+ static object lockerBarcode = new object();
+
+ ///
+ ///1.扫描配送单号,用于接收物料,扫描单号的时候,将接收的物料信息显示在“物料拉动”Tab区域
+ ///2.扫描料箱标签/看板卡,用于追溯物料批次信息
+ ///3.扫描零件条码,根据零件图号进行防错
+ ///第一步,判断条码类型,根据条码类型,执行对应的存储过程
+ ///第二步,条码类型(将扫描的条码保存到对应的表中)
+ ///第三步,扫描完成之后给出允许工作信号
+ /// 处理页面扫描条码
+ ///
+ ///
+ ///
+ static public void Barcode(object e)
+ {
+ lock (lockerBarcode)
+ {
+ try
+ {
+ DoWhatPlc.CustomeEvetnArgs msgEvent = (DoWhatPlc.CustomeEvetnArgs)e;
+ string OpName = Convert.ToString(msgEvent.OpName);
+ string barcode = Convert.ToString(msgEvent.TagValue);
+ string AlarmStr = "";
+
+ int IsAllowWork;
+ bool IsSuccess = false;
+ bool EngineGetOver_PLC_NextWorkStep;
+ //传递机型是否到位
+ MIS_BASE.Read_EngineGetOver_PLC(OpName, out EngineGetOver_PLC_NextWorkStep);
+
+ BaseDataSystemMES.PartMaterial_DM_Update(OpName, barcode, out IsSuccess);
+ if (!IsSuccess)
+ {
+ AsyncSendMessage_Notice(OpName, "条码无效,请确认");
+ return;
+ }
+ else
+ {
+ SendInfomation("MaterialList", "1", OpName);//通知界面更新零件信息
+ }
+
+
+
+ //获取是否允许工作
+ BaseDataSystemMES.MesServer_Judge_IsCanWork(OpName, out IsAllowWork);
+
+ //此处逻辑有问题 需要考虑到批次扫描 提示PLC未传递机型的情况
+ if (EngineGetOver_PLC_NextWorkStep && IsSuccess)
+ {
+ if (IsAllowWork == 1)
+ {
+ BaseDataSystemMES.Material_Insert(OpName, 1);
+
+ //if (!BaseDataSystemMES.QualityVerifyStatusOutline(OpName, out AlarmStr))
+ //{
+ // SendInfomation("LineoutAlert", AlarmStr, OpName);
+ // return;
+ //}
+ //通知PLC允许工作,允许工作在保存完成时清空
+ MIS_BASE.Write_FixAllow(OpName, true);
+ }
+ else
+ {
+ AsyncSendMessage_Notice(OpName, "请扫描物料!");
+ }
+ }
+ else
+ {
+ AsyncSendMessage_Notice(OpName, "PLC未传递机型");
+ }
+
+ }
+ catch (Exception err)
+ {
+ ////ApplicationLog.WriteLog(err, "Function02:Barcode");
+ }
+ }
+ }
+ }
+}
diff --git a/Common/09MesDataFunction/MesDataFunction/MesDataFunction/MIS.Functions.ConfirmOkGo.cs b/Common/09MesDataFunction/MesDataFunction/MesDataFunction/MIS.Functions.ConfirmOkGo.cs
new file mode 100644
index 0000000..26b9cfa
--- /dev/null
+++ b/Common/09MesDataFunction/MesDataFunction/MesDataFunction/MIS.Functions.ConfirmOkGo.cs
@@ -0,0 +1,47 @@
+using System;
+using System.Data;
+using System.Collections;
+
+using System.Windows.Forms;
+//using bizFacade;
+using System.Collections.Specialized;
+//using MesWork;
+//using SystemFramework;
+
+namespace MesServerWork
+{
+ public partial class MIS_BASE
+ {
+ static object lockerConfirmOkGo = new object();
+
+ static public void ConfirmOkGo(object e)
+ {
+ lock (lockerConfirmOkGo)
+ {
+ try
+ {
+ DoWhatPlc.CustomeEvetnArgs msgEvent = (DoWhatPlc.CustomeEvetnArgs)e;
+ string OpName = Convert.ToString(msgEvent.OpName);
+ int tagValue = Convert.ToInt32(msgEvent.TagValue);
+
+ if (tagValue == 1)
+ {
+
+ //BaseDataSystemMES.Material_Insert(OpName, 1);
+
+ //更新订单完工数量及物料
+ Sendmessage("24", "11", OpName);
+
+ //工作完成
+ MIS_BASE.Write_MaterialVerifyOver(OpName, true);
+ }
+ }
+ catch (Exception err)
+ {
+ ////ApplicationLog.WriteLog(err, "Function02:ConfirmOkGo");
+ }
+ }
+
+ }
+ }
+}
diff --git a/Common/09MesDataFunction/MesDataFunction/MesDataFunction/MIS.Functions.EngineTypeGetOver_PLC_Work.cs b/Common/09MesDataFunction/MesDataFunction/MesDataFunction/MIS.Functions.EngineTypeGetOver_PLC_Work.cs
new file mode 100644
index 0000000..670819c
--- /dev/null
+++ b/Common/09MesDataFunction/MesDataFunction/MesDataFunction/MIS.Functions.EngineTypeGetOver_PLC_Work.cs
@@ -0,0 +1,139 @@
+using System;
+using System.Data;
+using System.Collections;
+
+using System.Windows.Forms;
+//using bizFacade;
+using System.Collections.Specialized;
+//using MesWork;
+//using SystemFramework;
+using bizFacade;
+
+namespace MesServerWork
+{
+ public partial class MIS_BASE
+ {
+ static object lockerEngineTypeGetOver_PLC_Work = new object();
+
+
+ static public void EngineTypeGetOver_PLC_Work(string OpName, int EngineTypeID, string EngineType, string EngineID, int PartPallet_Code,string OrderForm)
+ {
+ lock (lockerEngineTypeGetOver_PLC_Work)
+ {
+ int IsAllowWork;
+ int RepairPartStatusPLC = 0;
+ int MES_QualityMask = 1;
+ //string OrderForm = "";//订单号
+ DataTable dt;
+
+ if (EngineTypeID <= 0)
+ {
+ AsyncSendMessage_Notice(OpName, "PLC传递机型为空");
+ return;
+ }
+
+ //第一步,查询订单号,保存机型、机型代码、总成号、托盘号、订单号到数据库
+ BaseDataSystemMES.GetEngineID_Select(OpName, EngineID, out dt);
+ if (dt != null && dt.Rows.Count > 0)
+ {
+ OrderForm = Convert.ToString(dt.Rows[0]["订单号"]);
+ }
+ BaseDataSystemMES.OpName_MIS_MOBY_Insert(OpName, OrderForm, EngineTypeID, EngineType, EngineID, PartPallet_Code, 0, 0, "");
+ SaveMobyMessage(OpName, EngineTypeID, EngineType, EngineID, OrderForm);
+
+ //第二步,将零件信息转移到零件_临时表中(本地BOM与订单BOM的选择显示关系)
+ BaseDataSystemMES.MesServer_Process_EngineTypeOver(OpName);
+
+ //通知web显示
+ Sendmessage("5123", "1111", OpName);
+ MIS_BASE.Read_PalletInfo(OpName, out MES_QualityMask);//合格标志
+ MIS_BASE.Read_RepairStatus_PLC(OpName, out RepairPartStatusPLC);//返修标志
+ SendInfomation("QualityMask", Convert.ToString(MES_QualityMask), OpName);//显示合格标志
+ SendInfomation("RepairPartStatusPLC", Convert.ToString(RepairPartStatusPLC), OpName);//显示返修标志
+
+ if (MES_QualityMask == 2)
+ {
+ //工作完成
+ MIS_BASE.Write_MaterialVerifyOver(OpName, true);
+ SendInfomation("NgGO", "1", OpName);//显示不合格标志
+ return;
+ }
+
+
+ //第三步,用于工件离开后完工数量统计及工件编号追溯
+ BaseDataSystemMES.MaterialPush_EngineIDStatus_Insert(OpName);//更新订单产量
+
+ //第四步,获取是否允许工作
+ BaseDataSystemMES.MesServer_Judge_IsCanWork(OpName, out IsAllowWork);
+
+ //暂时先定义为扫描完成才能进行压装工作,因为考虑到工作完成后,操作工未必会去扫描物料的情况
+ if (IsAllowWork == 1)
+ {
+ //通知PLC允许工作,允许工作在保存完成时清空
+ MIS_BASE.Write_FixAllow(OpName, true);
+ }
+ else
+ {
+ AsyncSendMessage_Notice(OpName, "请扫描物料!");
+ }
+ }
+
+
+ }
+
+ ///
+ /// 保存MOBY信息
+ ///
+ ///
+ ///
+ ///
+ ///
+ static private void SaveMobyMessage(string OpName, int engineTypeID, string engineType, string engineID, string orderForm)
+ {
+ if (MIS_BASE.hashtable_EngineGetOver_EngineTypeID == null)
+ {
+ MIS_BASE.InitHashtable_MesServerCode();
+ }
+ if (MIS_BASE.hashtable_EngineGetOver_EngineTypeID.ContainsKey(OpName))
+ {
+ MIS_BASE.hashtable_EngineGetOver_EngineTypeID[OpName] = engineTypeID;
+ }
+ if (MIS_BASE.hashtable_EngineGetOver_EngineType.ContainsKey(OpName))
+ {
+ MIS_BASE.hashtable_EngineGetOver_EngineType[OpName] = engineType;
+ }
+ if (MIS_BASE.hashtable_EngineGetOver_EngineID.ContainsKey(OpName))
+ {
+ MIS_BASE.hashtable_EngineGetOver_EngineID[OpName] = engineID;
+ }
+ if (MIS_BASE.hashtable_EngineGetOver_OrderForm.ContainsKey(OpName))
+ {
+ MIS_BASE.hashtable_EngineGetOver_OrderForm[OpName] = orderForm;
+ }
+ }
+
+ ///
+ /// 返修件需要工作
+ ///
+ /// 工位号
+ static private void IsNeedRepaire_OK(string OpName)
+ {
+ string orderForm = "";
+ int engineTypeID;
+ string engineType = "";
+ string engineID = "";
+ string palletCode = "";
+ int isRepair;
+ string repairCode = "";
+ //从监控系统中查询出本工位信息
+ BaseDataSystemMES.OpName_MIS_Moby_Select(OpName,
+ out orderForm, out engineTypeID, out engineType,
+ out engineID, out palletCode, out isRepair, out repairCode);
+
+ EngineTypeGetOver_PLC_Work(OpName, engineTypeID, engineType, engineID, Convert.ToInt32(palletCode),orderForm);
+ }
+
+
+
+ }
+}
diff --git a/Common/09MesDataFunction/MesDataFunction/MesDataFunction/MIS.Functions.FalseGO.cs b/Common/09MesDataFunction/MesDataFunction/MesDataFunction/MIS.Functions.FalseGO.cs
new file mode 100644
index 0000000..92ee314
--- /dev/null
+++ b/Common/09MesDataFunction/MesDataFunction/MesDataFunction/MIS.Functions.FalseGO.cs
@@ -0,0 +1,48 @@
+using System;
+using System.Data;
+using System.Collections;
+
+using System.Windows.Forms;
+//using bizFacade;
+using System.Collections.Specialized;
+//using MesWork;
+//using SystemFramework;
+
+namespace MesServerWork
+{
+ public partial class MIS_BASE
+ {
+ static object lockerFalseGO = new object();
+
+
+ static public void FalseGO(object e)
+ {
+ lock (lockerConfirmOkGo)
+ {
+ try
+ {
+ DoWhatPlc.CustomeEvetnArgs msgEvent = (DoWhatPlc.CustomeEvetnArgs)e;
+ string OpName = Convert.ToString(msgEvent.OpName);
+ int tagValue = Convert.ToInt32(msgEvent.TagValue);
+
+ if (tagValue == 1)
+ {
+ //总合格标志2(不合格)
+
+ //BaseDataSystemMES.Material_Insert_NG(OpName, 2);
+
+ Sendmessage("24", "11", OpName);
+
+ //工作完成
+ MIS_BASE.Write_MaterialVerifyOver(OpName, true);
+ }
+ }
+ catch (Exception err)
+ {
+ ////ApplicationLog.WriteLog(err, "Function02:FalseGO");
+ }
+ }
+
+ }
+ }
+}
diff --git a/Common/09MesDataFunction/MesDataFunction/MesDataFunction/MIS.Functions.Material_Insert.cs b/Common/09MesDataFunction/MesDataFunction/MesDataFunction/MIS.Functions.Material_Insert.cs
new file mode 100644
index 0000000..fc78eb6
--- /dev/null
+++ b/Common/09MesDataFunction/MesDataFunction/MesDataFunction/MIS.Functions.Material_Insert.cs
@@ -0,0 +1,59 @@
+using System;
+using System.Data;
+using System.Collections;
+
+using System.Windows.Forms;
+//using bizFacade;
+using System.Collections.Specialized;
+//using MesWork;
+//using SystemFramework;
+using bizFacade;
+
+namespace MesServerWork
+{
+ public partial class MIS_BASE
+ {
+ static object lockerMaterial_Insert = new object();
+
+ static public void Material_Insert(string OpName)
+ {
+ lock (lockerMaterial_Insert)
+ {
+ try
+ {
+ //int tagValue = Convert.ToInt32(msgEvent.TagValue);
+ int IsAllowWork;
+ //第四步,获取是否允许工作
+ BaseDataSystemMES.MesServer_Judge_IsCanWork(OpName, out IsAllowWork);
+ bool EngineGetOver_PLC_NextWorkStep;
+ //传递机型是否到位
+ MIS_BASE.Read_EngineGetOver_PLC(OpName, out EngineGetOver_PLC_NextWorkStep);
+
+ //暂时先定义为扫描完成才能进行压装工作,因为考虑到工作完成后,操作工未必会去扫描物料的情况
+ if (EngineGetOver_PLC_NextWorkStep&&IsAllowWork == 1)
+ {
+ BaseDataSystemMES.Material_Insert(OpName, 1);
+
+ //更新订单完工数量及物料
+ Sendmessage("24", "11", OpName);
+
+ //工作完成
+ MIS_BASE.Write_MaterialVerifyOver(OpName, true);
+ //通知PLC允许工作,允许工作在保存完成时清空
+ MIS_BASE.Write_FixAllow(OpName, true);
+ }
+ else
+ {
+ AsyncSendMessage_Notice(OpName, "请扫描物料!");
+ }
+
+ }
+ catch (Exception err)
+ {
+ ////ApplicationLog.WriteLog(err, "Function02:ConfirmOkGo");
+ }
+ }
+
+ }
+ }
+}
diff --git a/Common/09MesDataFunction/MesDataFunction/MesDataFunction/MIS.Functions.MesReadOver.cs b/Common/09MesDataFunction/MesDataFunction/MesDataFunction/MIS.Functions.MesReadOver.cs
new file mode 100644
index 0000000..260cd1a
--- /dev/null
+++ b/Common/09MesDataFunction/MesDataFunction/MesDataFunction/MIS.Functions.MesReadOver.cs
@@ -0,0 +1,66 @@
+using System;
+using System.Data;
+using System.Collections;
+
+using System.Windows.Forms;
+//using bizFacade;
+using System.Collections.Specialized;
+//using MesWork;
+//using SystemFramework;
+
+namespace MesServerWork
+{
+ public partial class MIS_BASE
+ {
+ static object lockerMesReadOver = new object();
+
+ ///
+ /// 保存完成(针对半自动和手动压装工位)
+ ///
+ ///
+ ///
+ static public void MesReadOver(object e)
+ {
+ lock (lockerMesReadOver)
+ {
+ try
+ {
+ DoWhatPlc.CustomeEvetnArgs msgEvent = (DoWhatPlc.CustomeEvetnArgs)e;
+ string OpName = Convert.ToString(msgEvent.OpName);
+ var tagValue = msgEvent.TagValue.ToString();
+
+ if (tagValue == "1" | tagValue.ToLower() == "true")
+ {
+ int qualityMask;
+ MIS_BASE.Read_QualityMask(OpName, out qualityMask);
+
+ SendInfomation("ShowTimelyQuality", "1&" + qualityMask.ToString(), OpName);//发给Web页面显示质量数据
+
+ if (qualityMask == 1)//全部OK,给出合格放行
+ {
+ //如果存在线外扫描工位,根据扫描条码绑定线外数据 需要时解除禁用
+ //BaseDataSystemMES.TransLaunchDataByMainMaterial(OpName, EngineType, EngineID, EngineTypeID);
+
+ //如果存在线外排队工位,根据排队编号绑定线外数据 需要时解除禁用
+ ////BaseDataSystemMES.MailLineAndSubLineData_InsertByEngineID_Subline(OpName,EngineID, EngineTypeID, EngineType);
+
+ MIS_BASE.Write_ConfirmOkGo(OpName, true);
+ //MIS_BASE.Write_FalseGO(OpName, false);
+ }
+ else
+ {
+ //MIS_BASE.Write_ConfirmOkGo(OpName, false);
+ MIS_BASE.Write_FalseGO(OpName, true);
+ }
+
+ }
+ }
+ catch (Exception err)
+ {
+ ////ApplicationLog.WriteLog(err, "Function02:MesReadOver");
+ }
+ }
+
+ }
+ }
+}
diff --git a/Common/09MesDataFunction/MesDataFunction/MesDataFunction/MIS.Functions.SendMessage.cs b/Common/09MesDataFunction/MesDataFunction/MesDataFunction/MIS.Functions.SendMessage.cs
new file mode 100644
index 0000000..92bfe0a
--- /dev/null
+++ b/Common/09MesDataFunction/MesDataFunction/MesDataFunction/MIS.Functions.SendMessage.cs
@@ -0,0 +1,162 @@
+using System;
+using System.Data;
+using System.Collections;
+
+using System.Windows.Forms;
+//using bizFacade;
+using System.Collections.Specialized;
+//using MesWork;
+//using SystemFramework;
+using bizFacade;
+
+namespace MesServerWork
+{
+ public partial class MIS_BASE
+ {
+
+ ///
+ /// 发送提示消息
+ ///
+ ///
+ static private void AsyncSendMessage_Notice(string opname, string notice)
+ {
+ //通知Web界面
+ BaseDataSystemMES.Web_Notice_Insert(opname, notice);
+ string SendMessage = "MES|Notice|" + opname + "|" + "1";
+ MIS_BASE.asyncSendMessage(SendMessage);
+ }
+
+ ///
+ /// 向WEB发送信息(value为字符串)
+ ///
+ /// 消息种类
+ /// 消息内容
+ /// 工位号
+ static public string SendInfomation(string Command, string Value, string OpName)
+ {
+ string SendMessage = "MES|" + Command + "|" + OpName + "|" + Value;
+ return AsyncSendMessage(SendMessage);
+ }
+
+ ///
+ /// 发送信息到MES通讯服务器或者其他的
+ ///
+ ///
+ static private string AsyncSendMessage(string Message)
+ {
+ return MIS_BASE.asyncSendMessage(Message);
+ }
+
+
+ ///
+ /// 批量发送WEB消息(Value为BOOL值)
+ ///
+ /// 消息编号组合
+ /// 消息值组合
+ /// 工位号
+ static void Sendmessage(string MessageNumm, string Value, string OpName)
+ {
+ for (int i = 0; i < MessageNumm.Length; i++)
+ {
+ Sendmessage(MessageNumm[i], Value[i].ToString(), OpName);
+
+ }
+ }
+ ///
+ /// 选择发送给WEB的消息
+ ///
+ /// 消息类型
+ /// 消息工位
+ static string Sendmessage(char Num, string Value, string OpName)
+ {
+ string SendMessage;
+ string result = "";
+ switch (Num)
+ {
+ case '1':
+ //1(直接在界面通过选择机型确认工序内容)
+ SendMessage = "MES|ProcessList|" + OpName + "|" + Value;
+ result = AsyncSendMessage(SendMessage);
+ break;
+ case '2':
+ //2显示物料
+ SendMessage = "MES|MaterialList|" + OpName + "|" + Value;
+ result = AsyncSendMessage(SendMessage);
+ break;
+ case '3':
+ //3显示操作指导图片
+ SendMessage = "MES|PicShow|" + OpName + "|" + Value;
+ result = AsyncSendMessage(SendMessage);
+ break;
+ case '4':
+ //4订单完工模块刷新完成数量
+ SendMessage = "MES|OrderFormList|" + OpName + "|" + Value;
+ AsyncSendMessage(SendMessage);
+ break;
+ case '5':
+ SendMessage = "MES|ShowMoby|" + OpName + "|" + Value;
+ result = AsyncSendMessage(SendMessage);
+ break;
+ case '6':
+ SendMessage = "MES|MaterialCheckPosition|" + OpName + "|" + Value;
+ result = AsyncSendMessage(SendMessage);
+ break;
+ case '7':
+ SendMessage = "MES|WorkStart|" + OpName + "|" + Value;
+ result = AsyncSendMessage(SendMessage);
+ break;
+ case '8'://清除MES生成编号
+
+ break;
+ case '9':
+ SendMessage = "MES|ConfirmOkGo|" + OpName + "|" + Value;
+ result = AsyncSendMessage(SendMessage);
+ break;
+ case 'a':
+ SendMessage = "MES|FixAllow|" + OpName + "|" + Value;
+ result = AsyncSendMessage(SendMessage);
+ break;
+ }
+ return result;
+ }
+ /////
+ ///// 向WEB发送信息(value为字符串)
+ /////
+ ///// 消息种类
+ ///// 消息内容
+ ///// 工位号
+ //string SendInfomation(string Command, string Value, string OpName)
+ //{
+ // string SendMessage = "MES|" + Command + "|" + OpName + "|" + Value;
+ // return AsyncSendMessage(SendMessage);
+ //}
+
+
+ ///
+ /// 发送在线产量、在线节拍
+ ///
+ ///
+ ///
+ private void SendActuallyCount(string OpName, int tagValue)
+ {
+ //当工件离开时,更新在线产量、在线节拍
+ if (tagValue == 0)
+ {
+ try
+ {
+ int opNameCount = 0;//在线产量
+ int opNameCountTime = 0;//在线节拍
+ //基本数据_工作日历_班次产量查询_New
+ BaseDataSystemMES.OpNameCount_New(OpName, out opNameCount, out opNameCountTime);
+ string SendMessage;
+ SendMessage = "MES|ActuallyCount|" + OpName + "|" + opNameCount.ToString() + "&" + opNameCountTime.ToString();
+ AsyncSendMessage(SendMessage);
+ }
+ catch (Exception err)
+ {
+ ////ApplicationLog.WriteLog(err, "Function02:SendActuallyCount");
+ }
+ }
+ }
+ }
+}
diff --git a/Common/09MesDataFunction/MesDataFunction/MesDataFunction/MIS.Functions.WebSubmit.cs b/Common/09MesDataFunction/MesDataFunction/MesDataFunction/MIS.Functions.WebSubmit.cs
new file mode 100644
index 0000000..e472489
--- /dev/null
+++ b/Common/09MesDataFunction/MesDataFunction/MesDataFunction/MIS.Functions.WebSubmit.cs
@@ -0,0 +1,282 @@
+using System;
+using System.Data;
+using System.Collections;
+
+using System.Windows.Forms;
+//using bizFacade;
+using System.Collections.Specialized;
+//using MesWork;
+//using SystemFramework;
+using System.Threading;
+using bizFacade;
+
+namespace MesServerWork
+{
+ public partial class MIS_BASE
+ {
+ static object lockerWebSubmit = new object();
+
+
+ ///
+ /// 处理WEB页面发送过来的请求(m_Command + "|" + m_Value;)
+ ///
+ ///
+ ///
+ static public void WebSubmit(object e)
+ {
+ lock (lockerWebSubmit)
+ {
+ try
+ {
+ DoWhatPlc.CustomeEvetnArgs msgEvent = (DoWhatPlc.CustomeEvetnArgs)e;
+ string OpName = Convert.ToString(msgEvent.OpName);
+ string Content = Convert.ToString(msgEvent.TagValue);
+
+ string[] dataArray = Content.Split('|');
+ if (dataArray.Length != 2)
+ return;
+ //消息类型
+ string m_Command = dataArray[0].ToString();
+ //消息参数
+ string m_Value = dataArray[1].ToString();
+ //消息参数数量
+ string[] m_Value_array = m_Value.Split('&');
+ //消息参数长度
+ int m_Value_length = m_Value_array.Length;
+
+ //工件信息
+ string engineID = "";
+ if (MIS_BASE.hashtable_EngineGetOver_EngineTypeID == null)
+ {
+ MIS_BASE.InitHashtable_MesServerCode();
+ }
+ if (MIS_BASE.hashtable_EngineGetOver_EngineID.ContainsKey(OpName))
+ {
+ engineID = MIS_BASE.hashtable_EngineGetOver_EngineID[OpName].ToString();
+ }
+
+ DoWhatPlc.CustomeEvetnArgs _e = new DoWhatPlc.CustomeEvetnArgs();
+ _e.OpName = OpName;
+ _e.TagValue = m_Value;
+
+ //根据请求的命令处理逻辑
+ switch (m_Command)
+ {
+ case "Barcode":
+ if (m_Value_length > 1) return;
+ fun_Barcode(_e);
+ break;
+ case "ConfirmOkGo"://合格放行
+ //删除不合格放行记录
+ //修改托盘状态
+ //Update_PalletStatus(OpName, 1, false);
+ BaseDataSystemMES.BaseData_tagTable_Engine_IsNG_Delete(OpName, engineID);
+ MIS_BASE.Write_ConfirmOkGo(OpName, true);
+ MIS_BASE.Write_FalseGO(OpName, false);
+ break;
+ case "FalseGO"://返修放行
+ //修改托盘状态
+ //Update_PalletStatus(OpName, 3, false);
+ BaseDataSystemMES.BaseData_tagTable_Engine_IsNG_Delete(OpName, engineID);
+ MIS_BASE.Write_FalseGO(OpName, true);
+ MIS_BASE.Write_ConfirmOkGo(OpName, false);
+ break;
+ case "NgGO"://不合格放行
+ //修改托盘状态
+ //Update_PalletStatus(OpName, 2, false);
+ //保存不合格信息(必须保存不合格放行信息,由于B5A的Moby没有不合格标志位)
+ BaseDataSystemMES.BaseData_tagTable_Engine_IsNG_Insert(OpName, engineID, "", "");
+ MIS_BASE.Write_FalseGO(OpName, true);
+ MIS_BASE.Write_ConfirmOkGo(OpName, false);
+ break;
+ case "OnLineState"://在线0、离线1、屏蔽2
+ try
+ {
+ if (m_Value_length > 1) return;
+ int a = Convert.ToInt32(m_Value);
+ if (a <= 2)
+ {
+ BaseDataSystemMES.IsOnLine_Update(OpName, m_Value.ToString());
+ MIS_BASE.Write_OnLineState(OpName, Convert.ToInt32(m_Value));
+ }
+ }
+ catch
+ {
+
+ }
+ break;
+ case "Reset"://复位,将MES所有的信息都复位了
+ SetMoby(OpName);//将MES所有信号清空
+ break;
+ case "FixAllow"://重新拧紧
+ MIS_BASE.Write_FixAllow(OpName, false);
+ MIS_BASE.Write_FixAllow(OpName, true);
+ break;
+ case "IsAutoGetEngineID"://自动手动申请编号(线首)
+ if (m_Value_length > 1) return;
+ MIS_BASE.Write_IsAutoGetEngineID(OpName, Convert.ToInt32(m_Value));
+ break;
+ case "PartPalletGoOver"://空托盘放行
+ int Is_PartPalletGoOver;
+ MIS_BASE.Read_PartPalletGoOver(OpName, out Is_PartPalletGoOver);
+ if (Is_PartPalletGoOver == 1)
+ {
+ MIS_BASE.Write_PartPalletGoOver(OpName, 1);
+ }
+ else
+ {
+ MIS_BASE.Write_PartPalletGoOver(OpName, 0);
+ }
+ break;
+ case "SetMoby"://清空托盘(线首)
+ SetMoby(OpName);//将MES所有信号清空
+ //MIS_BASE.Write_PartPalletCode_PLC(OpName, 1);
+ break;
+ case "RepairUplineMES"://返修上线
+ MIS_BASE.Write_RepairUpline_MES(OpName, true);
+ break;
+ case "CancelRepair"://将返修件置为正常件
+
+ break;
+ case "PartPalletCode"://申请写入托盘号
+ //MIS_BASE.Write_PartPalletCode_PLC(OpName, 1);
+ break;
+ case "WritePartPalletCode"://写入托盘号
+ if (m_Value_length > 1) return;
+ MIS_BASE.Write_PalletCode(OpName, Convert.ToInt32(m_Value));
+ break;
+ case "Normal"://启用正常拧紧工位
+ MIS_BASE.Write_Normal(OpName, 1);
+ MIS_BASE.Write_UnNormal(OpName, 0);
+ break;
+ case "UnNormal"://启用备用拧紧工位
+ MIS_BASE.Write_Normal(OpName, 0);
+ MIS_BASE.Write_UnNormal(OpName, 1);
+ break;
+ case "ResetDevice"://复位设备
+ MIS_BASE.Write_ResetDevice(OpName, true);
+ System.Threading.Thread.Sleep(1000);
+ MIS_BASE.Write_ResetDevice(OpName, false);
+ break;
+ case "IsNeedRepaire"://返修上线(返修上线点)
+ if (Convert.ToInt32(m_Value) == 1)
+ {
+ //修改托盘状态
+ MIS_BASE.Write_PalletInfo(OpName, 3);
+ //通知修改成功
+ MIS_BASE.Write_UpdatePalletOK(OpName, true);
+ IsNeedRepaire_OK(OpName);
+
+ }
+ else if (Convert.ToInt32(m_Value) == 0)
+ {
+ //通知修改成功
+ MIS_BASE.Write_UpdatePalletOK(OpName, true);
+ //直接给出工作完成
+ MIS_BASE.Write_MaterialVerifyOver(OpName, true);
+ }
+ else
+ { }
+
+ break;
+ case "ContinueMatch":
+ BaseDataSystemMES.QualityVerifyStatus_Hash_Write(OpName, true);
+ break;
+ //初始化网页信号
+ case "IniSingalToWeb":
+ InitializeSingalToWeb(OpName);
+ break;
+ case "Reset_Engine"://返修上线(返修上线点)
+ SetMoby(OpName);//将MES所有信号清空
+ //fun_EngineTypeGetOverPLC(OpName, 0);
+ //fun_EngineTypeGetOverPLC(OpName, 1);
+ break;
+
+
+ default: break;
+ }
+ }
+ catch (Exception err)
+ {
+ ////ApplicationLog.WriteLog(err, "Function02:WebSubmit");
+ }
+ }
+
+ }
+
+ //1.工件到位后,PLC给MES传递机型(DBX0.4)(44),
+ //MES判断条码是否全部扫描完成
+ //PLC给出允许保存(DBX100.2)(19),MES见到(DBX100.2)(19)为1后给出保存完成(DBX102.2)(20),
+ //PLC见到保存完成(DBX102.2)(20)为1后,清空允许保存(DBX100.2)(19),
+ //MES见到允许保存(DBX100.2)(19)为0后,清空保存完成(DBX102.2)(20)
+ //MES判断总合格标志(INT104)(21)为1后,给出合格放行(DBX2.5)(51)
+ ///
+ /// 扫描条码
+ ///
+ ///
+ ///
+ static public void fun_Barcode(DoWhatPlc.CustomeEvetnArgs e)
+ {
+ ThreadPool.QueueUserWorkItem(Barcode, e);
+ }
+ static private void SetMoby(string OpName)
+ {
+ try
+ {
+ //清空Moby时,需要将MES信号清空
+ MIS_BASE.Write_ClearMesMoby(OpName);
+
+ BaseDataSystemMES.MesServer_Process_EngineTypeOver(OpName);
+
+ Sendmessage("5123", "1111", OpName);
+
+ MIS_BASE.Write_ResetDevice(OpName, true);
+ System.Threading.Thread.Sleep(1000);
+ MIS_BASE.Write_ResetDevice(OpName, false);
+ }
+ catch
+ {
+
+ }
+ }
+ /// 网页重现登录,恢复关闭前的页面状态
+ ///
+ /// 工位号
+ static private void InitializeSingalToWeb(string Opname)
+ {
+
+ //工件到位 DBX0.1
+ bool S_WorkStart;
+ bool S_FixAllow;
+ bool S_EngineGetOver;
+ bool S_MaterialVerifyOver;
+
+ MIS_BASE.Read_WorkStart(Opname, out S_WorkStart);
+ MIS_BASE.Read_FixAllow(Opname, out S_FixAllow);
+ MIS_BASE.Read_EngineGetOver_PLC(Opname, out S_EngineGetOver);
+ MIS_BASE.Read_MaterialVerifyOver(Opname, out S_MaterialVerifyOver);
+
+
+
+ if (S_WorkStart == true)
+ {
+ SendInfomation("WorkStart", Convert.ToString(Convert.ToInt32(S_WorkStart)), Opname);
+ }
+
+ if (S_EngineGetOver == true)
+ {
+
+ SendInfomation("EngineTypeGetOverPLC", Convert.ToString(Convert.ToInt32(S_EngineGetOver)), Opname);
+ Sendmessage("5123", "1111", Opname);
+ }
+ if (S_FixAllow == true)
+ {
+ SendInfomation("FixAllow", Convert.ToString(Convert.ToInt32(S_FixAllow)), Opname);
+ }
+ if (S_MaterialVerifyOver == true)
+ {
+ SendInfomation("MaterialVerifyOver", Convert.ToString(Convert.ToInt32(S_MaterialVerifyOver)), Opname);
+ }
+ }
+ }
+}
diff --git a/Common/09MesDataFunction/MesDataFunction/MesDataFunction/MIS.Functions.WorkStart.cs b/Common/09MesDataFunction/MesDataFunction/MesDataFunction/MIS.Functions.WorkStart.cs
new file mode 100644
index 0000000..ec1d4c4
--- /dev/null
+++ b/Common/09MesDataFunction/MesDataFunction/MesDataFunction/MIS.Functions.WorkStart.cs
@@ -0,0 +1,45 @@
+using System;
+using System.Data;
+using System.Collections;
+
+using System.Windows.Forms;
+////using bizFacade;
+using System.Collections.Specialized;
+//using MesWork;
+//using SystemFramework;
+using System.Threading;
+
+namespace MesServerWork
+{
+ public partial class MIS_BASE
+ {
+ static object lockerWorkStart = new object();
+
+
+
+ ///
+ /// 工件到位与离开时,清空MES自身信号
+ ///
+ ///
+ ///
+ static private void WorkStart(object e)
+ {
+ lock (lockerWorkStart)
+ {
+ try
+ {
+ DoWhatPlc.CustomeEvetnArgs msgEvent = (DoWhatPlc.CustomeEvetnArgs)e;
+ string OpName = Convert.ToString(msgEvent.OpName);
+ int tagValue = Convert.ToInt32(msgEvent.TagValue);
+
+ }
+ catch (Exception err)
+ {
+ ////ApplicationLog.WriteLog(err, "Function02:WorkStart");
+ }
+ }
+
+ }
+
+ }
+}
diff --git a/Common/09MesDataFunction/MesDataFunction/MesDataFunction/MIS.Hashtable.TagID.cs b/Common/09MesDataFunction/MesDataFunction/MesDataFunction/MIS.Hashtable.TagID.cs
new file mode 100644
index 0000000..bc3387a
--- /dev/null
+++ b/Common/09MesDataFunction/MesDataFunction/MesDataFunction/MIS.Hashtable.TagID.cs
@@ -0,0 +1,805 @@
+using System;
+using System.Data;
+using System.Collections;
+
+using System.Windows.Forms;
+//using bizFacade;
+using System.Collections.Specialized;
+using MisDataFunDll;
+//using MesWork;
+
+
+namespace MesServerWork
+{
+ public partial class MIS_BASE // : Form
+ {
+ ///
+ /// 全部数据列表
+ ///
+ public static DataTable BasicDataTagValue;
+ ///
+ /// MES_基本数据_测量范围
+ ///
+ public static DataTable BasicDataTagValueUpDown;
+ ///
+ /// 是否通过监控系统保存数据
+ /// 1:通过监控系统保存采集的质量数据;0:不通过监控系统保存采集的质量数据
+ ///
+ static public Hashtable hashtable_tagTable_OpName_SaveData;
+ ///
+ /// 变量代码与列位置
+ ///
+ static public Hashtable hashtable_tagTable_TagID_TagOrderBy;
+ ///
+ /// 变量代码与变量排序
+ ///
+ static public Hashtable hashtable_tagTable_TagID_TagItemOrderBy;
+ ///
+ /// 变量代码与变量特点
+ /// 0:没定义1:工位合格标志2:需要合格标志的测量数据3:每个工位的合格标志4:物料5:IQA码6:压装数据7:压装合格标志8:(自动拧紧)工位合格标志
+ ///
+ static public Hashtable hashtable_tagTable_TagID_TagProperty;
+ ///
+ /// 发动机类型转换表
+ /// SELECT ID,发动机机型代码 FROM MES_计划BOM_发动机型号代码
+ ///
+ public static Hashtable hashtable_EngineTypeID;
+
+ ///
+ /// 工位号与工位上下线类型
+ /// (0普通工位)(1正常上线)(2正常下线)(3返修上线)(4返修下线)
+ /// (5分线上线 总线)(6分线上线 分线)
+ ///
+ public static Hashtable hashtableOpName_OpType;
+ ///
+ /// 工位号与大屏幕代码
+ /// 对应LED大屏幕(1,2,3,4)
+ ///
+ public static Hashtable hashtableOpName_LedID;
+ ///
+ /// 大屏幕显示产量端口(41104)
+ ///
+ public static Hashtable hashtableOpName_LedID_Port;
+
+ ///
+ /// 大屏幕显示Andon大屏幕代码 1
+ ///
+ public static Hashtable hashtableOpName_AndonID;
+
+ ///
+ /// 大屏幕显示Andon端口 (41105)
+ ///
+ public static Hashtable hashtableOpName_AndonID_Port;
+
+
+ ///
+ /// 是否有打印机(0,1)
+ ///
+ public static Hashtable hashtableOpName_IsPrinter;
+
+ ///
+ /// 打印机通讯端口
+ ///
+ public static Hashtable hashtableOpName_IsPrinter_Port;
+
+
+
+ ///
+ /// 工位号与目标循环时间
+ ///
+ public static Hashtable hashtableOpName_TargetTime;
+ ///
+ /// 工位号与线体类型
+ ///
+ public static Hashtable hashtableOpName_LineType;
+ ///
+ /// 是否有工位计算机
+ ///
+ public static Hashtable hashtableOpName_IsHaveComputer;
+ ///
+ /// 变量名称
+ ///
+ public static Hashtable hashtableTagID_TagName;
+ ///
+ /// 工位号
+ ///
+ public static Hashtable hashtableTagID_OpName;
+ ///
+ /// 数据来源
+ ///
+ public static Hashtable hashtableTagID_OpNameFrom;
+
+ ///
+ /// 工位名称
+ ///
+ static Hashtable hashtableTagID_OpName_Name;
+ ///
+ /// 测量位置
+ ///
+ public static Hashtable hashtableTagID_ShaftID;
+ ///
+ /// 测量项目
+ ///
+ public static Hashtable hashtableTagID_ItemVale;
+ ///
+ /// 变量代码与变量类型
+ ///
+ public static Hashtable hashtable_tagTable_TagID_TagTypeID_All;
+
+
+
+ ///
+ ///工位号与机床状态
+ /// [测量数据机床状态]
+ ///
+ public static Hashtable m_MachineStatus_OpName;
+ ///
+ ///工位号与工件离开 1->0 =0 无工件或工件离开
+ ///工位号与工件到位 0->1 =1 有工件或工件到达
+ ///[测量数据发动机在线状态]
+ ///
+ public static Hashtable m_WorkStart_OpName;
+
+ ///
+ ///工位号与工件到位时间
+ ///工位号与工件到位 0->1
+ ///[测量数据发动机在线状态]
+ ///
+ public static Hashtable m_WorkStart_OpName_Time;
+
+ ///
+ ///工位号与工件到位时间
+ ///工位号与工件到位 0->1,零件运动方向
+ ///
+ public static Hashtable m_WorkStart_OpName_PartMoveDirection;
+
+
+ ///
+ ///工位号与发动机号
+ ///
+ public static Hashtable m_EngineTrace_OpName;
+ ///
+ ///工位号与发动机号_时间
+ ///
+ public static Hashtable m_EngineTrace_OpName_Time;
+ ///
+ ///工位号与合格标志
+ ///[测量数据发动机在线状态]
+ ///
+ public static Hashtable m_QualityMask_OpName;
+
+ ///
+ ///工位号与机型
+ ///[测量数据发动机在线状态]
+ ///
+ public static Hashtable m_EngineNumberType_OpName;
+ ///
+ ///工位号与发动机号
+ ///[测量数据发动机在线状态]
+ ///
+ public static Hashtable m_EngineNumber_OpName;
+
+ ///
+ ///工位号与订单号
+ ///[测量数据发动机在线状态]
+ ///
+ public static Hashtable m_OrderForm_OpName;
+ ///
+ ///工位号与操作者工号
+ ///[测量数据发动机在线状态]
+ ///
+ public static Hashtable m_OperatorCode_OpName;
+
+
+ ///
+ /// 测量合格标志
+ /// 全部测量数据的测量工位
+ /// 全部测量数据的测量工位的数据来源
+ /// 全部测量数据的测量工位的数据来源的测量变量
+ ///
+ public static Hashtable hashtable_QualityData_GoodBad_MIS_OpName;
+ ///
+ /// 列位置
+ ///
+ public static Hashtable hashtable_QualityData_GoodBad_Index;
+
+ ///
+ /// MesServerCode
+ ///
+ public static Hashtable hashtable_MesServerCode;
+ ///
+ /// MesDll
+ ///
+ public static Hashtable hashtable_MesDll;
+ ///
+ /// 各个工位是否允许工作
+ ///
+ public static Hashtable hashtable_IsAllowWork;
+
+ ///
+ /// 返修工位是否需要强制合格放行
+ /// //20141104 ljl
+ ///
+ public static Hashtable hashtable_IsConfirmOkGo;
+
+
+ ///
+ /// 工步属性哈西表
+ ///
+ public static Hashtable hashtable_workStepProperty;
+
+ ///
+ /// 工作顺序哈西表
+ ///
+ public static Hashtable hashtable_WorkGroupIndex;
+
+ ///
+ /// 返修工位哈西表
+ ///
+ public static Hashtable hashtable_OpNameRepair;
+
+ ///
+ /// 记录工件到位的发动机机型代码
+ ///
+ public static Hashtable hashtable_EngineGetOver_EngineTypeID;
+ ///
+ /// 记录工件到位的发动机机型
+ ///
+ public static Hashtable hashtable_EngineGetOver_EngineType;
+ ///
+ /// 记录工件到位的发动机号
+ ///
+ public static Hashtable hashtable_EngineGetOver_EngineID;
+ ///
+ /// 记录工件到位的订单号
+ ///
+ public static Hashtable hashtable_EngineGetOver_OrderForm;
+
+ ///
+ /// 拧紧/压装过程中的合格标志
+ ///
+ public static Hashtable hashtable_QualityMesRead;
+
+
+ ///
+ /// 物料检测哈希表
+ ///
+ public static Hashtable hashtable_CheckMaterial;
+
+ ///
+ /// 托盘状态哈希表
+ ///
+ public static Hashtable hashtable_PalletInfo;
+ ///
+ ///[测量数据机床状态_分拆统计]
+ ///各个工位机床上电开始时间
+ ///机床上电产生 0->1
+ ///机床上电解除 1->0
+ ///
+ public static Hashtable m_MachineStatusPutOn_OpName_Time;
+ ///
+ ///[测量数据机床状态_分拆统计]
+ ///各个工位循环开始 开始时间
+ ///循环开始产生 0->1
+ ///循环开始解除 1->0
+ ///
+ public static Hashtable m_MachineStatusWorkOn_OpName_Time;
+ ///
+ ///[测量数据机床状态_分拆统计]
+ ///各个工位机床故障开始时间
+ ///机床故障产生 0->1
+ ///机床故障解除 1->0
+ ///
+ public static Hashtable m_MachineStatusAlarm_OpName_Time;
+ ///
+ ///[测量数据机床状态_分拆统计]
+ ///各个工位上料无件开始时间
+ ///上料无件产生 0->1
+ ///上料无件解除 1->0
+ ///
+ public static Hashtable m_MachineStatusNoPart_OpName_Time;
+ ///
+ ///[测量数据机床状态_分拆统计]
+ ///各个工位下料堵塞开始时间
+ ///下料堵塞产生 0->1
+ ///下料堵塞解除 1->0
+ ///
+ public static Hashtable m_MachineStatusBlock_OpName_Time;
+
+ ///
+ ///工位号与托盘离开 1->0
+ ///工位号与托盘到位 0->1
+ ///[测量数据_监控系统_托盘到位]
+ ///
+ public static Hashtable m_PartPalletStatus_OpName;
+ ///
+ ///工位号与托盘离开 1->0
+ ///工位号与托盘到位 0->1
+ ///[测量数据_监控系统_托盘到位]
+ ///
+ public static Hashtable m_PartPalletStatus_OpName_Time;
+ ///
+ /// 托盘到位(1)托盘离开(0) (DBX101.7)(13)
+ ///
+ ///
+ ///
+
+ ///
+ ///[测量数据机床状态_分拆统计]
+ ///各个工位机床上电开始时间
+ ///机床上电产生 0->1
+ ///机床上电解除 1->0
+ ///
+ public static Hashtable m_MachineStatusPutOn_OpName;
+ ///
+ ///[测量数据机床状态_分拆统计]
+ ///各个工位循环开始 开始时间
+ ///循环开始产生 0->1
+ ///循环开始解除 1->0
+ ///
+ public static Hashtable m_MachineStatusWorkOn_OpName;
+ ///
+ ///[测量数据机床状态_分拆统计]
+ ///各个工位机床故障开始时间
+ ///机床故障产生 0->1
+ ///机床故障解除 1->0
+ ///
+ public static Hashtable m_MachineStatusAlarm_OpName;
+ ///
+ ///[测量数据机床状态_分拆统计]
+ ///各个工位上料无件开始时间
+ ///上料无件产生 0->1
+ ///上料无件解除 1->0
+ ///
+ public static Hashtable m_MachineStatusNoPart_OpName;
+ ///
+ ///[测量数据机床状态_分拆统计]
+ ///各个工位下料堵塞开始时间
+ ///下料堵塞产生 0->1
+ ///下料堵塞解除 1->0
+ ///
+ public static Hashtable m_MachineStatusBlock_OpName;
+
+ public static NameValueCollection hashtable_TagTypeDataType ;
+ public static NameValueCollection hashtable_TagType;
+ ///
+ /// 托盘代码(DBB86)(80)
+ ///
+ ///
+ ///
+
+ ///
+ /// 创建MesServerCode哈西表
+ ///
+ static public void InitHashtable_MesServerCode()
+ {
+ hashtable_MesServerCode = new Hashtable();
+ hashtable_IsAllowWork = new Hashtable();
+ hashtable_WorkGroupIndex = new Hashtable();
+ hashtable_EngineGetOver_EngineTypeID = new Hashtable();
+ hashtable_EngineGetOver_EngineType = new Hashtable();
+ hashtable_EngineGetOver_EngineID = new Hashtable();
+ hashtable_EngineGetOver_OrderForm = new Hashtable();
+ hashtable_QualityMesRead = new Hashtable();
+ hashtable_CheckMaterial = new Hashtable();
+ hashtable_PalletInfo = new Hashtable();
+ hashtable_IsConfirmOkGo = new Hashtable();
+ hashtable_MesDll = new Hashtable();
+
+ string OpName;
+ string MesServerCode;
+ string MesDll;
+ string workStepProperty;
+ string OpNameRepair;
+ DataTable dt;
+ dt = MisDataFun.GetMesServerCodeFromMIS();
+ if (dt != null)
+ {
+ for (int i = 0; i < dt.Rows.Count; i++)
+ {
+ OpName = dt.Rows[i]["工位号"].ToString();
+ MesServerCode = dt.Rows[i]["MesServerCode"].ToString();
+ MesDll = dt.Rows[i]["MesDll"].ToString();
+ hashtable_MesDll.Add(OpName, MesDll);
+ hashtable_MesServerCode.Add(OpName, MesServerCode);
+ hashtable_IsAllowWork.Add(OpName, 1);
+ hashtable_IsConfirmOkGo.Add(OpName, 0);//20141104 ljl
+ hashtable_PalletInfo.Add(OpName, 0);//20141104 ljl
+ hashtable_WorkGroupIndex.Add(OpName, 1);
+ hashtable_EngineGetOver_EngineTypeID.Add(OpName, 0);
+ hashtable_EngineGetOver_EngineType.Add(OpName, "");
+ hashtable_EngineGetOver_EngineID.Add(OpName, "");
+ hashtable_EngineGetOver_OrderForm.Add(OpName, "");
+ hashtable_QualityMesRead.Add(OpName, 0);
+ hashtable_CheckMaterial.Add(OpName, new bool[16]);
+ }
+ }
+ HashtableList.hashtable_MesServerCode_Temp = hashtable_MesServerCode;
+ HashtableList.hashtable_MesDll_Temp = hashtable_MesDll;
+
+ HashtableList.hashtable_EngineGetOver_EngineID_Temp = hashtable_EngineGetOver_EngineID;
+ HashtableList.hashtable_EngineGetOver_EngineTypeID_Temp = hashtable_EngineGetOver_EngineTypeID;
+ HashtableList.hashtable_EngineGetOver_EngineType_Temp = hashtable_EngineGetOver_EngineType;
+ HashtableList.hashtable_EngineGetOver_OrderForm_Temp = hashtable_EngineGetOver_OrderForm;
+
+ //初始化工步属性
+ hashtable_workStepProperty = new Hashtable();
+ dt = MisDataFun.GetworkStepPropertyFromMIS();
+ if (dt != null)
+ {
+ for (int i = 0; i < dt.Rows.Count; i++)
+ {
+ OpName = dt.Rows[i]["工位号"].ToString();
+ workStepProperty = dt.Rows[i]["工步属性"].ToString();
+ hashtable_workStepProperty.Add(OpName, workStepProperty);
+ }
+ }
+
+ //返修工位
+ hashtable_OpNameRepair = new Hashtable();
+ dt = MisDataFun.GetOpNameRepairFromMIS();
+ if (dt != null)
+ {
+ for (int i = 0; i < dt.Rows.Count; i++)
+ {
+ OpName = dt.Rows[i]["工位号"].ToString();
+ OpNameRepair = dt.Rows[i]["返修工位号"].ToString();
+ hashtable_OpNameRepair.Add(OpName, OpNameRepair);
+ }
+ }
+
+ HashtableList.hashtable_OpNameRepair_Temp = hashtable_OpNameRepair;
+ HashtableList.hashtable_workStepProperty_Temp = hashtable_workStepProperty;
+ HashtableList.hashtable_QualityMesRead_Temp = hashtable_QualityMesRead;
+ HashtableList.hashtable_IsAllowWork_Temp = hashtable_IsAllowWork;
+ HashtableList.hashtable_WorkGroupIndex_Temp = hashtable_WorkGroupIndex;
+
+
+
+ }
+
+
+ ///
+ /// 创建合格标志哈西表
+ ///
+ private static void InitHashtable_QualityData_GoodBad()
+ {
+ //列位置
+ string index;
+ //
+ int tagID;
+ DataTable dt ;
+ dt = MisDataFun.BaseData_tagTable_All_B5A();
+
+ hashtable_QualityData_GoodBad_Index = new Hashtable();
+ for (int i = 0; i < dt.Rows.Count; i++)
+ {
+ tagID = Convert.ToInt32(dt.Rows[i]["TagID"]);
+ index = (dt.Rows[i]["列位置"]).ToString();
+ hashtable_QualityData_GoodBad_Index.Add(tagID, index);
+ }
+
+ hashtable_EngineTypeID = new Hashtable();
+ dt = MisDataFun.BaseData_tagTable_QualityData_EngineTypeID();
+ for (int i = 0; i < dt.Rows.Count; i++)
+ {
+ tagID = Convert.ToInt32(dt.Rows[i]["发动机机型代码"]);
+ index = (dt.Rows[i]["ID"]).ToString();
+ hashtable_EngineTypeID.Add(tagID, index);
+ }
+ //工位号
+ DataTable dt_OpName;
+ //工位号数据来源
+ DataTable dt_OpNameFrom;
+ //数据来源对应的TagID
+ DataTable dt_OpNameTagID;
+ string opName;
+ string opNameFrom;
+ hashtable_QualityData_GoodBad_MIS_OpName = new Hashtable();
+ // 测量合格标志
+ // 全部测量数据的测量工位的数据来源
+ Hashtable hashtable_QualityData_GoodBad_MIS_OpName_OpNameFrom;
+
+ // 测量合格标志
+ // 全部测量数据的测量工位的数据来源的测量变量
+ Hashtable hashtable_QualityData_GoodBad_MIS_OpName_OpNameFrom_TagID;
+ dt_OpName = MisDataFun.BaseData_tagTable_QualityData_GoodBad_MIS_OpName_B5A();
+ if (dt_OpName != null)
+ {
+ //有不合格标志的测量工位
+ for (int i = 0; i < dt_OpName.Rows.Count; i++)
+ {
+ //有不合格标志的测量工位 对应的 数据来源工位号
+ hashtable_QualityData_GoodBad_MIS_OpName_OpNameFrom = new Hashtable();
+ opName = dt_OpName.Rows[i]["工位号"].ToString();
+ dt_OpNameFrom = MisDataFun.BaseData_tagTable_QualityData_GoodBad_MIS_OpName(opName);
+ if (dt_OpNameFrom != null)
+ {
+ for (int j = 0; j < dt_OpNameFrom.Rows.Count; j++)
+ {
+ opNameFrom = dt_OpNameFrom.Rows[j]["数据来源"].ToString();
+ dt_OpNameTagID = MisDataFun.BaseData_tagTable_QualityData_GoodBad_MIS_OpName(opName, opNameFrom);
+ //
+ hashtable_QualityData_GoodBad_MIS_OpName_OpNameFrom_TagID = new Hashtable();
+ if (dt_OpNameTagID != null)
+ {
+ for (int k = 0; k < dt_OpNameTagID.Rows.Count; k++)
+ {
+ tagID = Convert.ToInt32(dt_OpNameTagID.Rows[k]["TagID"]);
+ hashtable_QualityData_GoodBad_MIS_OpName_OpNameFrom_TagID.Add(tagID, tagID);
+ }
+ }
+ tagID = Convert.ToInt32(dt_OpNameFrom.Rows[j]["TagID"]);
+ //全部测量数据的测量工位的数据来源的测量变量
+ hashtable_QualityData_GoodBad_MIS_OpName_OpNameFrom.Add(tagID, hashtable_QualityData_GoodBad_MIS_OpName_OpNameFrom_TagID);
+ }
+ }
+ hashtable_QualityData_GoodBad_MIS_OpName.Add(opName, hashtable_QualityData_GoodBad_MIS_OpName_OpNameFrom);
+ }
+ }
+ }
+
+
+ public static NameValueCollection hashtable_TagTypeID_OpName_ToTagID;
+
+ ///
+ /// 变量代码与其他字段的对应关系
+ ///
+ public static void InitHashtableTagID()
+ {
+ //变量代码
+ string tagID;
+ //变量名称
+ string tagName;
+ //工位号
+ string opNmae;
+ //测量位置
+ string shaftID;
+ //测量项目
+ string itemVale;
+ //变量排序
+ int tagItemOrderBy;
+ //变量特点
+ // 0:没定义1:工位合格标志2:需要合格标志的测量数据3:每个工位的合格标志4:物料5:IQA码6:压装数据7:压装合格标志8:(自动拧紧)工位合格标志
+ int tagProperty;
+ //列位置
+ int tagOrderBy;
+ InitHashtable_QualityData_GoodBad();
+ //MesServerCode哈希表创建
+ InitHashtable_MesServerCode();
+ //列位置
+ hashtable_tagTable_TagID_TagOrderBy = new Hashtable();
+ // 变量代码与变量排序
+ hashtable_tagTable_TagID_TagItemOrderBy = new Hashtable();
+ // 变量代码与变量特点
+ // 0:没定义1:工位合格标志2:需要合格标志的测量数据3:每个工位的合格标志4:物料5:IQA码6:压装数据7:压装合格标志8:(自动拧紧)工位合格标志
+ hashtable_tagTable_TagID_TagProperty = new Hashtable();
+ hashtable_tagTable_OpName_SaveData = new Hashtable();
+ //工位号与机床状态
+ //[测量数据发动机在线状态]
+ m_MachineStatus_OpName = new Hashtable();
+ ////工位号与工件离开 0
+ ////工位号与工件到位 1
+ ////[测量数据发动机在线状态]
+ //m_WorkStart_OpName = new Hashtable();
+ ////工位号与工件到位时间
+ ////工位号与工件到位 0->1
+ ////[测量数据发动机在线状态]
+ //m_WorkStart_OpName_Time = new Hashtable();
+ //工位号与发动机号
+ //[测量数据发动机在线状态]
+ m_EngineTrace_OpName = new Hashtable();
+ m_EngineTrace_OpName_Time = new Hashtable();
+ //工位号与合格标志
+ //[测量数据发动机在线状态]
+ m_QualityMask_OpName = new Hashtable();
+ //工位号与目标循环时间
+ hashtableOpName_TargetTime = new Hashtable();
+ //工位号与线体类型
+ hashtableOpName_LineType = new Hashtable();
+ //是否有工位计算机
+ hashtableOpName_IsHaveComputer = new Hashtable();
+
+ //工位号与机型
+ //[测量数据发动机在线状态]
+ m_EngineNumberType_OpName = new Hashtable();
+ //工位号与发动机号
+ //[测量数据发动机在线状态]
+ m_EngineNumber_OpName = new Hashtable();
+ //工位号与订单号
+ //[测量数据发动机在线状态]
+ m_OrderForm_OpName = new Hashtable();
+ //工位号与操作者工号
+ //[测量数据发动机在线状态]
+ m_OperatorCode_OpName = new Hashtable();
+
+
+ //
+ // 变量名称
+ //
+ hashtableTagID_TagName = new Hashtable();
+ //
+ // 工位号
+ //
+ hashtableTagID_OpName = new Hashtable();
+ //
+ // 数据来源
+ //
+ hashtableTagID_OpNameFrom = new Hashtable();
+ //
+ // 工位名称
+ //
+ hashtableTagID_OpName_Name = new Hashtable();
+ //
+ // 测量位置
+ //
+ hashtableTagID_ShaftID = new Hashtable();
+ //
+ // 测量项目
+ //
+ hashtableTagID_ItemVale = new Hashtable();
+
+ hashtable_tagTable_TagID_TagTypeID_All = new Hashtable();
+
+ // 工位号与工位上下线类型
+ // (0普通工位)(1正常上线)(2正常下线)(3返修上线)(4返修下线)
+ // (5 分线上线 总线) (6 分线上线 总线)
+ hashtableOpName_OpType = new Hashtable();
+ // 工位号与大屏幕代码
+ // 对应LED大屏幕(1,2,3,4)
+ hashtableOpName_LedID = new Hashtable();
+
+
+
+
+ // 大屏幕显示产量端口(41104)
+ hashtableOpName_LedID_Port = new Hashtable();
+ // 大屏幕显示Andon大屏幕代码 1
+ hashtableOpName_AndonID = new Hashtable();
+ // 大屏幕显示Andon端口 (41105)
+ hashtableOpName_AndonID_Port = new Hashtable();
+ // 是否有打印机(0,1)
+ hashtableOpName_IsPrinter = new Hashtable();
+ // 打印机通讯端口 (缸盖打印机 41101) (发动机上线打印机 41102) (发动机下线打印机 41103)
+ hashtableOpName_IsPrinter_Port = new Hashtable();
+
+ m_WorkStart_OpName_Time = new Hashtable();
+ m_WorkStart_OpName = new Hashtable();
+
+
+ m_MachineStatusPutOn_OpName_Time = new Hashtable();
+ m_MachineStatusPutOn_OpName = new Hashtable();
+ m_MachineStatusWorkOn_OpName_Time = new Hashtable();
+ m_MachineStatusWorkOn_OpName = new Hashtable();
+ m_MachineStatusAlarm_OpName_Time = new Hashtable();
+ m_MachineStatusAlarm_OpName = new Hashtable();
+ m_MachineStatusNoPart_OpName_Time = new Hashtable();
+ m_MachineStatusNoPart_OpName = new Hashtable();
+ m_MachineStatusBlock_OpName_Time = new Hashtable();
+ m_MachineStatusBlock_OpName = new Hashtable();
+
+
+
+
+ m_WorkStart_OpName_PartMoveDirection = new Hashtable();
+ m_PartPalletStatus_OpName_Time = new Hashtable();
+ m_PartPalletStatus_OpName = new Hashtable();
+
+ hashtable_TagTypeID_OpName_ToTagID = new NameValueCollection();
+
+
+
+ DataTable dt;
+ DateTime dateTime;
+ dateTime = DateTime.Now;
+ dt = MisDataFun.BaseData_tagTable_All();
+
+ //变量类型代码
+ int TagTypeID;
+ for (int i = 0; i < dt.Rows.Count; i++)
+ {
+ tagID = dt.Rows[i]["TagID"].ToString ();
+ tagName = Convert.ToString(dt.Rows[i]["TagName"]);
+ opNmae = Convert.ToString(dt.Rows[i]["工位号"]);
+ shaftID = Convert.ToString(dt.Rows[i]["测量位置"]);
+ itemVale = Convert.ToString(dt.Rows[i]["测量项目"]);
+ TagTypeID = Convert.ToInt32(dt.Rows[i]["变量类型代码"]);
+ tagItemOrderBy = Convert.ToInt32(dt.Rows[i]["变量排序"]);
+ tagProperty = Convert.ToInt32(dt.Rows[i]["变量特点"]);
+ tagOrderBy = Convert.ToInt32(dt.Rows[i]["列位置"]);
+
+ hashtableTagID_TagName.Add(tagID, tagName);
+ hashtableTagID_OpName.Add(tagID, opNmae);
+ hashtableTagID_ShaftID.Add(tagID, shaftID);
+ hashtableTagID_ItemVale.Add(tagID, itemVale);//列位置
+ hashtable_tagTable_TagID_TagTypeID_All.Add(tagID, TagTypeID);
+ hashtable_tagTable_TagID_TagItemOrderBy.Add(tagID, tagItemOrderBy);
+ hashtable_tagTable_TagID_TagProperty.Add(tagID, tagProperty);
+ hashtable_tagTable_TagID_TagOrderBy.Add(tagID, tagOrderBy);
+
+
+ }
+ dt = MisDataFun.BaseData_tagTable_OpName();
+ for (int i = 0; i < dt.Rows.Count; i++)
+ {
+ //是否通过监控系统保存数据
+ // 1:通过监控系统保存采集的质量数据;0:不通过监控系统保存采集的质量数据
+ hashtable_tagTable_OpName_SaveData.Add(Convert.ToString(dt.Rows[i]["工位号"]), Convert.ToInt32(dt.Rows[i]["是否通过监控系统保存数据"]));
+
+ hashtableOpName_TargetTime.Add(Convert.ToString(dt.Rows[i]["工位号"]), Convert.ToString(dt.Rows[i]["目标循环时间"]));
+ hashtableOpName_LineType.Add(Convert.ToString(dt.Rows[i]["工位号"]), Convert.ToString(dt.Rows[i]["线体类型"]));
+ hashtableOpName_IsHaveComputer.Add(Convert.ToString(dt.Rows[i]["工位号"]), Convert.ToString(dt.Rows[i]["是否有工位计算机"]));
+ //用于LED显示
+ // [MES_计划BOM_工位与名称]
+ // 工位上下线类型
+ //(0普通工位)(1正常上线)(2正常下线)(3返修上线)(4返修下线)
+ hashtableOpName_OpType.Add(Convert.ToString(dt.Rows[i]["工位号"]), Convert.ToInt32(dt.Rows[i]["工位上下线类型"]));
+ hashtableOpName_LedID.Add(Convert.ToString(dt.Rows[i]["工位号"]), Convert.ToInt32(dt.Rows[i]["大屏幕代码"]));
+ m_WorkStart_OpName_Time.Add(Convert.ToString(dt.Rows[i]["工位号"]), dateTime);
+ m_WorkStart_OpName.Add(Convert.ToString(dt.Rows[i]["工位号"]), 0);
+
+
+ m_MachineStatusPutOn_OpName_Time.Add(Convert.ToString(dt.Rows[i]["工位号"]), dateTime);
+ m_MachineStatusPutOn_OpName.Add(Convert.ToString(dt.Rows[i]["工位号"]), 0);
+ m_MachineStatusWorkOn_OpName_Time.Add(Convert.ToString(dt.Rows[i]["工位号"]), dateTime);
+ m_MachineStatusWorkOn_OpName.Add(Convert.ToString(dt.Rows[i]["工位号"]), 0);
+ m_MachineStatusAlarm_OpName_Time.Add(Convert.ToString(dt.Rows[i]["工位号"]), dateTime);
+ m_MachineStatusAlarm_OpName.Add(Convert.ToString(dt.Rows[i]["工位号"]), 0);
+ m_MachineStatusNoPart_OpName_Time.Add(Convert.ToString(dt.Rows[i]["工位号"]), dateTime);
+ m_MachineStatusNoPart_OpName.Add(Convert.ToString(dt.Rows[i]["工位号"]), 0);
+ m_MachineStatusBlock_OpName_Time.Add(Convert.ToString(dt.Rows[i]["工位号"]), dateTime);
+ m_MachineStatusBlock_OpName.Add(Convert.ToString(dt.Rows[i]["工位号"]), 0);
+
+
+
+ m_WorkStart_OpName_PartMoveDirection.Add(Convert.ToString(dt.Rows[i]["工位号"]), 0);
+
+
+ m_PartPalletStatus_OpName_Time.Add(Convert.ToString(dt.Rows[i]["工位号"]), dateTime);
+ m_PartPalletStatus_OpName.Add(Convert.ToString(dt.Rows[i]["工位号"]), 0);
+ try
+ {
+ hashtableOpName_LedID_Port.Add(Convert.ToString(dt.Rows[i]["工位号"]), Convert.ToInt32(dt.Rows[i]["大屏幕显示产量端口"]));
+ }
+ catch { }
+ try
+ {
+ hashtableOpName_AndonID.Add(Convert.ToString(dt.Rows[i]["工位号"]), Convert.ToInt32(dt.Rows[i]["大屏幕显示Andon大屏幕代码"]));
+ }
+ catch { }
+ try
+ {
+ hashtableOpName_AndonID_Port.Add(Convert.ToString(dt.Rows[i]["工位号"]), Convert.ToInt32(dt.Rows[i]["大屏幕显示Andon端口"]));
+ }
+ catch { }
+ try { hashtableOpName_IsPrinter.Add(Convert.ToString(dt.Rows[i]["工位号"]), Convert.ToInt32(dt.Rows[i]["是否有打印机"])); }
+ catch { }
+ try
+ {
+ hashtableOpName_IsPrinter_Port.Add(Convert.ToString(dt.Rows[i]["工位号"]), Convert.ToInt32(dt.Rows[i]["打印机通讯端口"]));
+ }
+ catch { }
+ }
+
+
+ //20170310 CLB新加
+ dt = MisDataFun.BaseData_tagTable_OpcServerMES_ALL_CF();
+ for (int i = 0; i < dt.Rows.Count; i++)
+ {
+ try
+ {
+ hashtable_TagTypeID_OpName_ToTagID.Add(Convert.ToString(dt.Rows[i]["工位号"]) + "_" + Convert.ToString(dt.Rows[i]["变量类型代码"]), Convert.ToString(dt.Rows[i]["TagID"]));
+ //hashtable_TagTypeID_OpName_ToTagID;
+ }
+ catch(Exception err)
+ {
+
+ }
+ }
+
+
+
+
+ }
+ }
+}
diff --git a/Common/09MesDataFunction/MesDataFunction/MesDataFunction/MIS.Hashtable.cs b/Common/09MesDataFunction/MesDataFunction/MesDataFunction/MIS.Hashtable.cs
new file mode 100644
index 0000000..19cfd3a
--- /dev/null
+++ b/Common/09MesDataFunction/MesDataFunction/MesDataFunction/MIS.Hashtable.cs
@@ -0,0 +1,91 @@
+using System;
+using System.Data;
+using System.Collections;
+
+using System.Windows.Forms;
+//using bizFacade;
+using System.Collections.Specialized;
+using MisDataFunDll;
+//using MesWork;
+
+
+namespace MesServerWork
+{
+ public partial class MIS_BASE // : Form
+ {
+ public class HashtableList
+ {
+ ///
+ /// MesServerCode
+ ///
+ static public Hashtable hashtable_MesServerCode_Temp;
+ ///
+ /// MesDll
+ ///
+ static public Hashtable hashtable_MesDll_Temp;
+ static public NameValueCollection hashtable_TagTypeDataType_Temp;
+ static public NameValueCollection hashtable_TagType_Temp;
+ static public Hashtable hashtable_TagTypeTagName_Temp;
+
+ static public Hashtable hashtable_EngineGetOver_EngineTypeID_Temp;
+ static public Hashtable hashtable_EngineGetOver_EngineType_Temp;
+ static public Hashtable hashtable_EngineGetOver_EngineID_Temp;
+ static public Hashtable hashtable_EngineGetOver_OrderForm_Temp;
+
+ static public Hashtable hashtable_OpNameRepair_Temp;
+
+ static public Hashtable hashtable_WorkGroupIndex_Temp;
+ static public Hashtable hashtable_workStepProperty_Temp;
+ static public Hashtable hashtable_QualityMesRead_Temp;
+ static public Hashtable hashtable_IsAllowWork_Temp;
+ ///
+ /// 工位号与工位上下线类型
+ /// (0普通工位)(1正常上线)(2正常下线)(3返修上线)(4返修下线)
+ /// 5 分线上线(总线) 6 分线上线(分线)
+ ///
+ static public Hashtable hashtableOpName_OpType_Temp;
+
+ static public Hashtable hashtable_tagTable_OpName_SaveData_Temp;
+
+
+ public Hashtable hashtable_tagTable_OpName_SaveData;
+
+
+ ///
+ ///
+ /// 工位号与工位上下线类型
+ /// (0普通工位)(1正常上线)(2正常下线)(3返修上线)(4返修下线)
+ /// 5 分线上线(总线) 6 分线上线(分线)
+ ///
+ public Hashtable hashtableOpName_OpType;
+ public Hashtable hashtable_IsAllowWork;
+ public Hashtable hashtable_QualityMesRead;
+ public Hashtable hashtable_workStepProperty;
+ public Hashtable hashtable_OpNameRepair;
+ ///
+ /// MesServerCode
+ ///
+ public Hashtable hashtable_MesServerCode;
+ public Hashtable hashtable_TagTypeTagName;
+
+ ///
+ /// MesDll
+ ///
+ public Hashtable hashtable_MesDll;
+ public NameValueCollection hashtable_TagTypeDataType;
+ public NameValueCollection hashtable_TagType;
+
+
+ public Hashtable hashtable_EngineGetOver_EngineTypeID;
+ public Hashtable hashtable_EngineGetOver_EngineType;
+ public Hashtable hashtable_EngineGetOver_EngineID;
+ public Hashtable hashtable_EngineGetOver_OrderForm;
+
+ public Hashtable hashtable_WorkGroupIndex;
+
+ public DataTable BasicDataTagValue;
+ public DataTable BasicDataTagValueUpDown;
+ public Hashtable hashtable_EngineTypeID;
+ }
+ }
+}
diff --git a/Common/09MesDataFunction/MesDataFunction/MesDataFunction/MIS.Machine.ServicePlan.cs b/Common/09MesDataFunction/MesDataFunction/MesDataFunction/MIS.Machine.ServicePlan.cs
new file mode 100644
index 0000000..61d5684
--- /dev/null
+++ b/Common/09MesDataFunction/MesDataFunction/MesDataFunction/MIS.Machine.ServicePlan.cs
@@ -0,0 +1,98 @@
+using System;
+using System.Data;
+using System.Windows.Forms;
+//using bizFacade;
+//using DataLinkMesWork;
+//using SystemFramework;
+
+namespace MesServerWork
+{
+ public partial class MIS_BASE
+ {
+ ///
+ /// 设备保养计划
+ ///
+ ///
+ ///
+ ///
+ public delegate void MachinePlan_Invoke(string OpName, string MachineType, string PlanID);
+ ///
+ /// 设备保养计划
+ ///
+ public MachinePlan_Invoke machinePlan_Invoke;
+ ///
+ /// 设备保养
+ ///
+ ///
+ /// 设备保养类型
+ /// 工作日历流水号
+ public void MachinePlan(string OpName, string MachineType, string PlanID)
+ {
+ try
+ {
+ string SendMessage;
+ SendMessage = "MES|MachinePlan|" + OpName + "|" + MachineType + "&" + PlanID;
+ asyncSendMessage(SendMessage);
+ }
+ catch (Exception err)
+ {
+ ////ApplicationLog.WriteLog(err, "MachinePlan");
+ }
+ }
+
+ ///
+ /// 设备保养计划Timer
+ ///
+ private Timer timer_Machine;
+ ///
+ /// 初始化设备保养计划
+ ///
+ public void InitMachinePlan(MachinePlan_Invoke machinePlan_Invoke)
+ {
+ this.machinePlan_Invoke = machinePlan_Invoke;
+ timer_Machine = new Timer();
+ timer_Machine.Interval = 60000;//每隔一分钟查询一次
+ timer_Machine.Tick += new EventHandler(timer_Machine_Tick);
+ timer_Machine.Start();
+ }
+
+ ///
+ /// 分钟调度
+ ///
+ ///
+ ///
+ private void timer_Machine_Tick(object sender, EventArgs e)
+ {
+ try
+ {
+ //if (ApplicationConfig.Is_MachinePlan == 1)
+ //{
+ // DataTable dt;
+ // string opName;
+ // string machineType;//保养类型代码
+ // string planID;//工作日历流水号
+ // BaseDataSystemMES.MachinePlan_Select(out dt);
+ // if (dt != null)
+ // {
+ // if (dt.Rows.Count > 0)
+ // {
+ // for (int i = 0; i < dt.Rows.Count; i++)
+ // {
+ // opName = dt.Rows[i]["工位号"].ToString();
+ // machineType = dt.Rows[i]["保养类型代码"].ToString();
+ // planID = dt.Rows[i]["工作日历流水号"].ToString();
+ // BaseDataSystemMES.Rolling_news_Add(opName, opName + "工位有设备保养计划,请相关人员进行保养!!!");
+ // BeginInvoke(machinePlan_Invoke, new object[] { opName, machineType, planID });
+ // }
+ // }
+ // }
+ //}
+ }
+ catch (Exception err)
+ {
+ ////ApplicationLog.WriteLog(err, "timer_Machine_Tick");
+ }
+ }
+
+ }
+}
diff --git a/Common/09MesDataFunction/MesDataFunction/MesDataFunction/MIS.OpcServerMIS.Read.cs b/Common/09MesDataFunction/MesDataFunction/MesDataFunction/MIS.OpcServerMIS.Read.cs
new file mode 100644
index 0000000..f768d82
--- /dev/null
+++ b/Common/09MesDataFunction/MesDataFunction/MesDataFunction/MIS.OpcServerMIS.Read.cs
@@ -0,0 +1,1196 @@
+
+using MisDataFunDll;
+using System;
+using SystemFramework;
+//using SystemFramework;
+//using bizFacade;
+
+namespace MesServerWork
+{
+
+ public partial class MIS_BASE
+ {
+
+
+ ///
+ /// 通过TagTypeName读取PLC数据
+ ///
+ ///
+ ///
+ static private void Read_TagValueByTagTypeName(string cmd, string opName, out string tagValue)
+ {
+ tagValue = "-1";
+ int tagTypeID;
+ try
+ {
+ tagTypeID = Convert.ToInt32(MIS_BASE.hashtable_TagType[cmd]);
+ string msg = "MES|" + tagTypeID.ToString() + "|" + opName + "|" + tagValue;
+ //tagValue = ChatService.MesReadWhisperMessage(msg);
+ MIS_BASE.ReadTagValue(tagTypeID, opName, out tagValue);
+ }
+ catch (Exception err)
+ {
+ ApplicationLog.WriteLog(err, "Read_TagValueByTagTypeName_FUNC;工位号:" + opName + ";命令:" + cmd + ";值:" + tagValue);
+ }
+
+ }
+
+ ///
+ /// 通过TagID读取对应值
+ ///
+ ///
+ ///
+ public static void Read_TagValueByTagID(string TagID, out object tagValue)
+ {
+ tagValue = "0";
+ try
+ {
+ tagValue = MIS_BASE.ReadPLC(TagID).ToString();
+ }
+ catch (Exception err)
+ {
+ ApplicationLog.WriteLog(err, "Read_TagValueByTagID_FUNC");
+ }
+ }
+
+ ///
+ /// 根据变量类型代码、工位号获得对应值
+ ///
+ ///
+ ///
+ ///
+ public static void Read_TagValueByTagTypeID(int tagTypeID, string opName, out string tagValueStr)
+ {
+ tagValueStr = "-1";
+
+ try
+ {
+ MIS_BASE.ReadTagValue(tagTypeID, opName, out tagValueStr);
+ }
+ catch (Exception err)
+ {
+ ApplicationLog.WriteLog(err, "Read_TagValueByTagTypeID_FUNC");
+ }
+ }
+
+ ///
+ /// 根据变量类型代码、工位号获得对应值
+ ///
+ ///
+ ///
+ ///
+ public static void Read_TagValueByTagTypeID(int tagTypeID, string opName, out object tagValueStr)
+ {
+ tagValueStr = "-1";
+
+ try
+ {
+ tagValueStr = MIS_BASE.ReadPLC(tagTypeID, opName);
+ }
+ catch (Exception err)
+ {
+ ApplicationLog.WriteLog(err, "Read_TagValueByTagTypeID_FUNC");
+ }
+ }
+ ///
+ /// 根据变量类型代码、工位号获得对应值
+ ///
+ ///
+ ///
+ ///
+ public static string Read_TagValueByTagTypeID(int tagTypeID, string opName)
+ {
+ string tagValueStr = "-1";
+ try
+ {
+ MIS_BASE.ReadTagValue(tagTypeID, opName, out tagValueStr);
+
+ }
+ catch (Exception err)
+ {
+ ApplicationLog.WriteLog(err, "Read_TagValueByTagTypeID_FUNC");
+ }
+ return tagValueStr;
+ }
+
+ ///
+ /// 读取数据通过(TagTypeName&opName)
+ ///
+ ///
+ ///
+ public static void Read_TagTypeName(string cmd, string opName, out string tagValueStr)
+ {
+ Read_TagValueByTagTypeName(cmd, opName, out tagValueStr);
+ }
+
+ ///
+ /// 读取数据通过(TagTypeID&opName)
+ ///
+ ///
+ ///
+ public static void Read_TagTypeID(int tagTypeID, string opName, out string tagValueStr)
+ {
+ Read_TagValueByTagTypeID(tagTypeID, opName, out tagValueStr);
+ }
+
+
+
+
+
+
+ ///
+ /// 订单号(string)(25)
+ ///
+ ///
+ ///
+ public static void Read_OrderForm(string opName, out string tagValue)
+ {
+ int tagTypeID = 39;
+ tagValue = "";
+ Read_TagValueByTagTypeID(tagTypeID, opName, out tagValue);
+ }
+ ///
+ /// 总成编号(string)(26)
+ ///
+ ///
+ ///
+ public static void Read_AssemblyCode(string opName, out string tagValue)
+ {
+ tagValue = "";
+ string cmd = "AssemblyCode";
+ Read_TagValueByTagTypeName(cmd, opName, out tagValue);
+ //tagValue = Convert.ToBoolean(Convert.ToInt32(tagValueStr));
+ }
+ ///
+ /// 配方号1(dint)(27)
+ ///
+ ///
+ ///
+ public static void Read_Recipe1(string opName, out int tagValue)
+ {
+ tagValue = 0;
+ string cmd = "Recipe1";
+ string tagValueStr;
+ Read_TagValueByTagTypeName(cmd, opName, out tagValueStr);
+ tagValue = Convert.ToInt32(tagValueStr);
+ }
+ ///
+ /// 配方号2(dint)(28)
+ ///
+ ///
+ ///
+ public static void Read_Recipe2(string opName, out int tagValue)
+ {
+ tagValue = 0;
+ string cmd = "Recipe2";
+ string tagValueStr;
+ Read_TagValueByTagTypeName(cmd, opName, out tagValueStr);
+ tagValue = Convert.ToInt32(tagValueStr);
+ }
+
+ ///
+ /// 订单号(string)(116)
+ ///
+ ///
+ ///
+ public static void Read_OrderForm_MES(string opName, out string tagValue)
+ {
+ int tagTypeID = 116;
+ tagValue = "";
+ Read_TagValueByTagTypeID(tagTypeID, opName, out tagValue);
+ //tagValue = Convert.ToBoolean(Convert.ToInt32(tagValueStr));
+ }
+ ///
+ /// 总成编号(string)(62)
+ ///
+ ///
+ ///
+ public static void Read_AssemblyCode_MES(string opName, out string tagValue)
+ {
+ tagValue = "";
+ string cmd = "AssemblyCode_MES";
+ Read_TagValueByTagTypeName(cmd, opName, out tagValue);
+ //tagValue = Convert.ToBoolean(Convert.ToInt32(tagValueStr));
+ }
+ ///
+ /// 配方号1(dint)(63)
+ ///
+ ///
+ ///
+ public static void Read_Recipe1_MES(string opName, out int tagValue)
+ {
+ tagValue = 0;
+ string cmd = "Recipe1_MES";
+ string tagValueStr;
+ Read_TagValueByTagTypeName(cmd, opName, out tagValueStr);
+ tagValue = Convert.ToInt32(tagValueStr);
+ }
+ ///
+ /// 配方号2(dint)(64)
+ ///
+ ///
+ ///
+ public static void Read_Recipe2_MES(string opName, out int tagValue)
+ {
+ tagValue = 0;
+ string cmd = "Recipe2_MES";
+ string tagValueStr;
+ Read_TagValueByTagTypeName(cmd, opName, out tagValueStr);
+ tagValue = Convert.ToInt32(tagValueStr);
+ }
+
+ ///
+ /// 匹配结果(DBX3.4)(69)
+ /// 匹配是否成功
+ ///
+ ///
+ ///
+ public static void Read_MatchSuccess(string opName, out int tagValue)
+ {
+ tagValue = 0;
+ string cmd = "Match";
+ string tagValueStr;
+ Read_TagValueByTagTypeName(cmd, opName, out tagValueStr);
+ tagValue = Convert.ToInt32(tagValueStr);
+
+ }
+
+ ///
+ /// 是否匹配(DBX3.3)(68)
+ ///
+ ///
+ ///
+ public static void Read_MatchingCompleted(string opName, out int tagValue)
+ {
+ tagValue = 0;
+ string cmd = "MatchingCompleted";
+ string tagValueStr;
+ Read_TagValueByTagTypeName(cmd, opName, out tagValueStr);
+ tagValue = Convert.ToInt32(tagValueStr);
+
+ }
+
+
+ ///
+ /// MES保存完数据(必须MIS)(X102.2)(20)
+ ///
+ ///
+ ///
+ public static void Read_MesReadOver(string opName, out bool tagValue)
+ {
+ tagValue = false;
+ int tagTypeID = 20;
+ string tagValueStr;
+ Read_TagValueByTagTypeID(tagTypeID, opName, out tagValueStr);
+ tagValue = Convert.ToBoolean(Convert.ToInt32(tagValueStr));
+
+ }
+
+ ///
+ /// 发动机到位(X0.1)(2)
+ ///
+ ///
+ ///
+ public static void Read_WorkStart(string opName, out bool tagValue)
+ {
+ tagValue = false;
+ int tagTypeID = 2;
+ string tagValueStr;
+ Read_TagValueByTagTypeID(tagTypeID, opName, out tagValueStr);
+ tagValue = Convert.ToBoolean(Convert.ToInt32(tagValueStr));
+ }
+
+ ///
+ /// 发动机机型标志(INT4)(9)
+ ///
+ public static void Read_EngineTypeID(string opName, out int tagValue)
+ {
+ int tagTypeID = 9;
+ tagValue = 0;
+ string tagValueStr;
+ Read_TagValueByTagTypeID(tagTypeID, opName, out tagValueStr);
+ tagValue = Convert.ToInt32(tagValueStr);
+
+ }
+ ///
+ /// 发动机ID(STRING6.38)(10)
+ ///
+ public static void Read_EngineID(string opName, out string tagValue)
+ {
+ int tagTypeID = 10;
+ tagValue = "";
+ string tagValueStr;
+ Read_TagValueByTagTypeID(tagTypeID, opName, out tagValueStr);
+ tagValue = tagValueStr;
+ }
+ //public static void Read_OrderForm(string opName, out string tagValue)
+ //{
+ // tagValue = "";
+ // string tagTypeID = "39";
+ // string tagValueStr;
+ // tagValueStr = DtWebApi.ReadWritePLC.ReadPLC(tagTypeID, opName).ToString();
+ // tagValue = tagValueStr;
+ //}
+ ///
+ /// 发动机型号(STRING46.38)(11)
+ ///
+ public static void Read_EngineType(string opName, out string tagValue)
+ {
+ int tagTypeID = 11;
+ tagValue = "";
+ string tagValueStr;
+ Read_TagValueByTagTypeID(tagTypeID, opName, out tagValueStr);
+ tagValue = tagValueStr;
+
+ }
+
+ ///
+ /// 工位直通(X101.6)(1006)
+ ///
+ public static void Read_PartGoOver(string opName, out int tagValue)
+ {
+ tagValue = 0;
+ string cmd = "PartGoOver";
+ string tagValueStr;
+ Read_TagValueByTagTypeName(cmd, opName, out tagValueStr);
+ tagValue = Convert.ToInt32(tagValueStr);
+
+ }
+
+ ///
+ /// 托盘到位(1)托盘离开(0) (DBX101.5)(13)
+ ///
+ public static void Read_PartPalletStatus(string opName, out bool tagValue)
+ {
+ tagValue = false;
+ string cmd = "PartPalletStatus";
+ string tagValueStr;
+ Read_TagValueByTagTypeName(cmd, opName, out tagValueStr);
+ tagValue = Convert.ToBoolean(Convert.ToInt32(tagValueStr));
+ }
+
+ ///
+ /// 加工时间变量目标时间 (DINT 106)(17)
+ ///
+ public static void Read_MachineTime_TargetTime(string opName, out int tagValue)
+ {
+ tagValue = 0;
+ string cmd = "TargetTime";
+ string tagValueStr;
+ Read_TagValueByTagTypeName(cmd, opName, out tagValueStr);
+ tagValue = Convert.ToInt32(tagValueStr);
+
+ }
+ ///
+ /// 加工时间变量实际时间 (DINT 110)(18)
+ ///
+ public static void Read_MachineTime_ActualTime(string opName, out int tagValue)
+ {
+ tagValue = 0;
+ string cmd = "ActualTime";
+ string tagValueStr;
+ Read_TagValueByTagTypeName(cmd, opName, out tagValueStr);
+ tagValue = Convert.ToInt32(tagValueStr);
+
+ }
+
+ ///
+ /// 质量数据总成合格标志(INT104)(21)
+ ///
+ public static void Read_QualityMask(string opName, out int tagValue)
+ {
+ tagValue = 0;
+ int tagTypeID = 21;
+ string tagValueStr;
+ Read_TagValueByTagTypeID(tagTypeID, opName, out tagValueStr);
+ if (tagValueStr == "1" | tagValueStr.ToLower () == "true")
+ {
+ tagValueStr = "1";
+ }
+ tagValue = Convert.ToInt32(tagValueStr);
+
+ }
+
+ ///
+ /// 机体流向标志(1 BYTE):
+ /// 0普通工位:
+ /// 1:上线(发动机上线);
+ /// 2:下线(发动机下线);(INT114)(41)
+ ///
+ public static void Read_PartMoveDirection(string opName, out int tagValue)
+ {
+ tagValue = 0;
+ string cmd = "PartMoveDirection";
+ string tagValueStr;
+ Read_TagValueByTagTypeName(cmd, opName, out tagValueStr);
+ tagValue = Convert.ToInt32(tagValueStr);
+ }
+
+
+ ///
+ /// 强制MES(X103.0)(78)
+ ///
+ public static void Read_Mes_MustTest(string opName, out int tagValue)
+ {
+ tagValue = 0;
+ string cmd = "IsMES";
+ string tagValueStr;
+ Read_TagValueByTagTypeName(cmd, opName, out tagValueStr);
+ tagValue = Convert.ToInt32(tagValueStr);
+
+ }
+ ///
+ /// 工位三种状态:在线、离线、屏蔽(0,1,2)(DBB116)(79)
+ ///
+ public static void Read_OnLineState(string opName, out int tagValue)
+ {
+ tagValue = 0;
+ string cmd = "OnLineState";
+ string tagValueStr;
+ Read_TagValueByTagTypeName(cmd, opName, out tagValueStr);
+ tagValue = Convert.ToInt32(tagValueStr);
+ }
+
+ ///
+ /// 变量类型代码=44 CF0.4
+ /// PLC向MES传递机型,机型代码,零件编号完成,通知PLC。
+ /// 机型可读
+ ///
+ ///
+ ///
+ public static void Read_EngineGetOver_PLC(string opName, out bool tagValue)
+ {
+ tagValue = false;
+ int tagTypeID = 44;
+ string tagValueStr;
+ Read_TagValueByTagTypeID(tagTypeID, opName, out tagValueStr);
+ tagValue = Convert.ToBoolean(Convert.ToInt32(tagValueStr));
+
+ }
+
+ ///
+ /// X100.2允许保存质量数据(19)
+ ///
+ ///
+ ///
+ public static void Read_QualityData_Read_CF(string opName, out bool tagValue)
+ {
+ tagValue = false;
+ int tagTypeID = 19;
+ string tagValueStr;
+ Read_TagValueByTagTypeID(tagTypeID, opName, out tagValueStr);
+ tagValue = Convert.ToBoolean(Convert.ToInt64(tagValueStr));
+
+ }
+
+ ///
+ /// MES向PLC传递机型(DBX2.1)(5)
+ ///
+ ///
+ ///
+ public static void Read_EngineTypeGetOver_MES(string opName, out bool tagValue)
+ {
+ tagValue = false;
+ int tagTypeID = 5;
+ string tagValueStr;
+ Read_TagValueByTagTypeID(tagTypeID, opName, out tagValueStr);
+ tagValue = Convert.ToBoolean(Convert.ToInt32(tagValueStr));
+
+ }
+
+ ///
+ /// X2.3 工作完成(7)
+ ///
+ ///
+ ///
+ public static void Read_MaterialVerifyOver(string opName, out bool tagValue)
+ {
+ tagValue = false;
+ int tagTypeID = 7;
+ string tagValueStr;
+ Read_TagValueByTagTypeID(tagTypeID, opName, out tagValueStr);
+ tagValue = Convert.ToBoolean(Convert.ToInt32(tagValueStr));
+
+ }
+
+ ///
+ /// 申请上线(DBX0.3)(43)
+ ///
+ ///
+ ///
+ public static void Read_PartLoad(string opName, out bool tagValue)
+ {
+ tagValue = false;
+ int tagTypeID = 43;
+ string tagValueStr;
+ Read_TagValueByTagTypeID(tagTypeID, opName, out tagValueStr);
+ tagValue = Convert.ToBoolean(Convert.ToInt32(tagValueStr));
+
+ }
+
+ ///
+ /// 上线完成(DBX0.3)(48)
+ ///
+ ///
+ ///
+ public static void Read_PartLoad_OK(string opName, out bool tagValue)
+ {
+ tagValue = false;
+ string cmd = "PartLoadOK";
+ string tagValueStr;
+ Read_TagValueByTagTypeName(cmd, opName, out tagValueStr);
+ tagValue = Convert.ToBoolean(Convert.ToInt32(tagValueStr));
+
+ }
+
+ ///
+ /// 合格放行(51)
+ ///
+ ///
+ ///
+ public static void Read_ConfirmOkGo(string opName, out bool tagValue)
+ {
+ tagValue = false;
+ string cmd = "ConfirmOkGo";
+ string tagValueStr;
+ Read_TagValueByTagTypeName(cmd, opName, out tagValueStr);
+ tagValue = Convert.ToBoolean(Convert.ToInt32(tagValueStr));
+
+ }
+
+ ///
+ /// 拧紧结束(DBX1.1)(59)
+ ///
+ ///
+ ///
+ public static void Read_FixOK(string opName, out bool tagValue)
+ {
+ tagValue = false;
+ string cmd = "FixOK";
+ string tagValueStr;
+ Read_TagValueByTagTypeName(cmd, opName, out tagValueStr);
+ tagValue = Convert.ToBoolean(Convert.ToInt32(tagValueStr));
+
+ }
+
+ ///
+ /// 蘑菇按钮(DBX1.3)(61)
+ ///
+ ///
+ ///
+ public static void Read_NextPushButton(string opName, out bool tagValue)
+ {
+ tagValue = false;
+ string cmd = "NextPushButton";
+ string tagValueStr;
+ Read_TagValueByTagTypeName(cmd, opName, out tagValueStr);
+ tagValue = Convert.ToBoolean(Convert.ToInt32(tagValueStr));
+
+ }
+
+ ///
+ /// 允许拧紧(DBX3.1)(66)
+ ///
+ ///
+ ///
+ public static void Read_FixAllow(string opName, out bool tagValue)
+ {
+ tagValue = false;
+ int tagTypeID = 66;
+ string tagValueStr;
+ Read_TagValueByTagTypeID(tagTypeID, opName, out tagValueStr);
+ tagValue = Convert.ToBoolean(Convert.ToInt32(tagValueStr));
+
+ }
+
+ ///
+ /// 拧紧结束确认(DBX3.2)(67)
+ ///
+ ///
+ ///
+ public static void Read_FixOver(string opName, out bool tagValue)
+ {
+ tagValue = false;
+ string cmd = "FixOver";
+ string tagValueStr;
+ Read_TagValueByTagTypeName(cmd, opName, out tagValueStr);
+ tagValue = Convert.ToBoolean(Convert.ToInt32(tagValueStr));
+
+ }
+
+ ///
+ ///返修上线,在上线工位,MES依据工件情况,设定为返修件,PLC见到MES设定为1后,将返修标志写入到DBX0.2为1
+ ///MES设定完返修返修上线后,MES清空该信号
+ ///DBX3.7(72)
+ ///
+ ///
+ ///
+ public static void Read_RepairUpline_MES(string opName, out int tagValue)
+ {
+ tagValue = 0;
+ string cmd = "RepairUplineMES";
+ string tagValueStr;
+ Read_TagValueByTagTypeName(cmd, opName, out tagValueStr);
+ tagValue = Convert.ToInt32(tagValueStr);
+
+ }
+
+
+
+ ///
+ /// 匹配结果(DBX3.4)(69)
+ ///
+ ///
+ ///
+ public static void Read_Match(string opName, out int tagValue)
+ {
+ tagValue = 0;
+ string cmd = "Match";
+ string tagValueStr;
+ Read_TagValueByTagTypeName(cmd, opName, out tagValueStr);
+ tagValue = Convert.ToInt32(tagValueStr);
+ }
+
+ ///
+ /// 发动机机型代码(DBB404)(73)[false]
+ ///
+ ///
+ ///
+ public static void Read_EngineTypeID_MES(string opName, out int EngineTypeID)
+ {
+ int tagTypeID = 73;
+ EngineTypeID = 0;
+ string tagValueStr;
+ Read_TagValueByTagTypeID(tagTypeID, opName, out tagValueStr);
+ EngineTypeID = Convert.ToInt32(tagValueStr);
+
+ }
+
+ ///
+ /// 发动机机型(DBB446)(75)
+ ///
+ ///
+ ///
+ public static void Read_EngineType_MES(string opName, out string EngineType)
+ {
+ int tagTypeID = 75;
+ EngineType = "";
+ string tagValueStr;
+ Read_TagValueByTagTypeID(tagTypeID, opName, out tagValueStr);
+ EngineType = tagValueStr;
+
+ }
+
+ ///
+ /// 发动机号(DBB406)(74)
+ ///
+ ///
+ ///
+ public static void Read_EngineID_MES(string opName, out string EngineID)
+ {
+ int tagTypeID = 74;
+ EngineID = "";
+ string tagValueStr;
+ Read_TagValueByTagTypeID(tagTypeID, opName, out tagValueStr);
+ EngineID = tagValueStr;
+
+ }
+
+ ///
+ /// 拧紧序号(77)
+ ///
+ ///
+ ///
+ public static void Read_ProcessCode(string opName, out int tagValue)
+ {
+ int tagTypeID = 77;
+ tagValue = 0;
+ string tagValueStr;
+ Read_TagValueByTagTypeID(tagTypeID, opName, out tagValueStr);
+ tagValue = Convert.ToInt32(tagValueStr);
+
+ }
+
+
+ ///
+ /// 套筒号、子程序代码子程序(DBB26)(2025)[false]
+ ///
+ ///
+ ///
+ public static void Read_BoltCode(string opName, out int tagValue)
+ {
+ int tagTypeID = 88;
+ tagValue = 0;
+ string tagValueStr;
+ Read_TagValueByTagTypeID(tagTypeID, opName, out tagValueStr);
+ tagValue = Convert.ToInt32(tagValueStr);
+
+ }
+
+
+ ///
+ /// 托盘代码(DBB86)(80)
+ ///
+ public static void Read_PalletCode(string opName, out int tagValue)
+ {
+ int tagTypeID = 80;
+ tagValue = 0;
+ string tagValueStr;
+ Read_TagValueByTagTypeID(tagTypeID, opName, out tagValueStr);
+ tagValue = Convert.ToInt32(tagValueStr);
+ }
+ ///
+ /// 获得机型,零件编号,机型代码,托盘号,(从PLC)
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static void GetEngineTypeFromPLC(string opName, out int EngineTypeID, out string EngineType, out string EngineID, out int PartPallet_Code,out string OrderForm)
+ {
+ Read_EngineTypeID(opName,out EngineTypeID);
+ Read_EngineType(opName, out EngineType);
+ Read_EngineID(opName, out EngineID);
+ Read_OrderForm(opName, out OrderForm);
+ Read_PalletCode(opName, out PartPallet_Code);
+ }
+ ///
+ /// /// 获得机型,零件编号,机型代码,托盘号,(从MES)
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static void GetEngineTypeFromPLC_MES(string opName, out int EngineTypeID, out string EngineType, out string EngineID, out string OrderForm)
+ {
+ Read_EngineTypeID_MES(opName, out EngineTypeID);
+ Read_EngineType_MES(opName, out EngineType);
+ Read_EngineID_MES(opName, out EngineID);
+ Read_OrderForm_MES(opName, out OrderForm);
+ }
+
+ ///
+ /// 获得机型,零件编号,机型代码,托盘号,(从DB)
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static void GetEngineTypeFromDB(string opName, out int EngineTypeID, out string EngineType, out string EngineID, out int PartPallet_Code)
+ {
+ string orderForm = "";
+ int isRepair = 0;
+ string repairCode = "";
+ string palletCode = "0";
+ string EngineTypeString = "";
+ MisDataFun.Moby_Select(opName,
+ out orderForm, out EngineTypeID, out EngineType,
+ out EngineID, out palletCode, out isRepair, out repairCode, out EngineTypeString);
+ PartPallet_Code = Convert.ToInt32(palletCode);
+ }
+
+ ///
+ /// 0:不修改;1:可以修改。(上线工位)通知PLC。(DBX1.2)(76)
+ ///
+ ///
+ ///
+ public static void Read_PartPalletCode_PLC_ToMES(string opName, out int tagValue)
+ {
+ tagValue = 0;
+ string cmd = "PartPalletCodePLCToMES";
+ string tagValueStr;
+ Read_TagValueByTagTypeName(cmd, opName, out tagValueStr);
+ tagValue = Convert.ToInt32(tagValueStr);
+
+ }
+
+ ///
+ /// 通知写入托盘号(DBX3.5)(70)
+ ///
+ ///
+ ///
+ public static void Read_PartPalletCode_PLC(string opName, out int tagValue)
+ {
+ tagValue = 0;
+ string cmd = "PartPalletCodePLC";
+ string tagValueStr;
+ Read_TagValueByTagTypeName(cmd, opName, out tagValueStr);
+ tagValue = Convert.ToInt32(tagValueStr);
+
+ }
+
+ ///
+ /// 变量类型代码=86,打印第一行(机型),用于线首打印机。STRING 486 .38
+ ///
+ ///
+ ///
+ public static void Read_PrintBarCode1_MES(string opName, out string tagValue)
+ {
+ tagValue = "";
+ string cmd = "PrintBarCode1MES";
+ string tagValueStr;
+ Read_TagValueByTagTypeName(cmd, opName, out tagValueStr);
+ tagValue = tagValueStr;
+
+ }
+
+ ///
+ /// 变量类型代码=87,打印第二行(流水号),用于线首打印机。STRING 526 .38
+ ///
+ ///
+ ///
+ public static void Read_PrintBarCode2_MES(string opName, out string tagValue)
+ {
+ tagValue = "";
+ string cmd = "PrintBarCode2MES";
+ string tagValueStr;
+ Read_TagValueByTagTypeName(cmd, opName, out tagValueStr);
+ tagValue = tagValueStr;
+
+ }
+
+
+ ///
+ /// 上线工位。0:正常工作;1:空托盘放行(DBX2.2)(6)
+ ///
+ ///
+ ///
+ public static void Read_PartPalletGoOver(string opName, out int tagValue)
+ {
+ tagValue = 0;
+ string cmd = "PartPalletGoOver";
+ string tagValueStr;
+ Read_TagValueByTagTypeName(cmd, opName, out tagValueStr);
+ tagValue = Convert.ToInt32(tagValueStr);
+
+ }
+
+ ///
+ /// 自动手动申请工件编号,0是自动方式;1:手动方式。切换时,(DBX2.1)(71)
+ ///
+ ///
+ ///
+ public static void Read_IsAutoGetEngineID(string opName, out int tagValue)
+ {
+ tagValue = 0;
+ string cmd = "IsAutoGetEngineID";
+ string tagValueStr;
+ Read_TagValueByTagTypeName(cmd, opName, out tagValueStr);
+ tagValue = Convert.ToInt32(tagValueStr);
+
+ }
+
+ ///
+ /// 正常拧紧时选择(DBX100.3)(81)
+ ///
+ ///
+ ///
+ public static void Read_Normal(string opName, out int tagValue)
+ {
+ tagValue = 0;
+ string cmd = "Normal";
+ string tagValueStr;
+ Read_TagValueByTagTypeName(cmd, opName, out tagValueStr);
+ tagValue = Convert.ToInt32(tagValueStr);
+
+ }
+
+ ///
+ /// 备用拧紧时选择(DBX100.4)(82)
+ ///
+ ///
+ ///
+ public static void Read_UnNormal(string opName, out int tagValue)
+ {
+ tagValue = 0;
+ string cmd = "UnNormal";
+ string tagValueStr;
+ Read_TagValueByTagTypeName(cmd, opName, out tagValueStr);
+ tagValue = Convert.ToInt32(tagValueStr);
+
+ }
+
+ ///
+ /// 允许拧紧2(DBX100.5)(83)
+ ///
+ ///
+ ///
+ public static void Read_FixAllow_2(string opName, out int tagValue)
+ {
+ tagValue = 0;
+ string cmd = "FixAllow2";
+ string tagValueStr;
+ Read_TagValueByTagTypeName(cmd, opName, out tagValueStr);
+ tagValue = Convert.ToInt32(tagValueStr);
+
+ }
+
+ ///
+ /// 拧紧结束2(DBX100.6)(84)
+ ///
+ ///
+ ///
+ public static void Read_FixOK_2(string opName, out int tagValue)
+ {
+ tagValue = 0;
+ string cmd = "FixOK2";
+ string tagValueStr;
+ Read_TagValueByTagTypeName(cmd, opName, out tagValueStr);
+ tagValue = Convert.ToInt32(tagValueStr);
+
+ }
+
+ ///
+ /// 拧紧结束确认2(DBX100.7)(85)
+ ///
+ ///
+ ///
+ public static void Read_FixOver_2(string opName, out int tagValue)
+ {
+ tagValue = 0;
+ string cmd = "FixOver2";
+ string tagValueStr;
+ Read_TagValueByTagTypeName(cmd, opName, out tagValueStr);
+ tagValue = Convert.ToInt32(tagValueStr);
+
+ }
+
+ ///
+ /// 拧紧顺序2(DBX101.7)(1007)
+ /// MES通知PLC开始拧紧顺序(0为其他位,1为第一位置)(必须MES)
+ ///
+ ///
+ ///
+ public static void Read_WriteShaft_2(string opName, out int tagValue)
+ {
+ tagValue = 0;
+ string cmd = "WriteShaft2";
+ string tagValueStr;
+ Read_TagValueByTagTypeName(cmd, opName, out tagValueStr);
+ tagValue = Convert.ToInt32(tagValueStr);
+ }
+
+
+ ///
+ /// 返修上线(DBX2.6)(52)
+ ///
+ ///
+ ///
+ public static void Read_PartLoadFinish(string opName, out int tagValue)
+ {
+ tagValue = 0;
+ string cmd = "PartLoadFinish";
+ string tagValueStr;
+ Read_TagValueByTagTypeName(cmd, opName, out tagValueStr);
+ tagValue = Convert.ToInt32(tagValueStr);
+
+ }
+
+ ///
+ /// 返修上线后,PLC确认(DBX1.0)(58)
+ ///
+ ///
+ ///
+ public static void Read_PartLoadOver(string opName, out int tagValue)
+ {
+ tagValue = 0;
+ string cmd = "PartLoadOver";
+ string tagValueStr;
+ Read_TagValueByTagTypeName(cmd, opName, out tagValueStr);
+ tagValue = Convert.ToInt32(tagValueStr);
+
+ }
+
+ ///
+ /// 变量类型代码=22,读取托盘信息 DBW126
+ ///
+ ///
+ ///
+ public static void Read_PalletInfo(string opName, out int tagValue)
+ {
+ tagValue = 0;
+ string cmd = "PalletInfo";
+ string tagValueStr;
+ Read_TagValueByTagTypeName(cmd, opName, out tagValueStr);
+ tagValue = Convert.ToInt32(tagValueStr);
+ }
+
+ ///
+ /// 变量类型代码=23,读取托盘信息 DBW194
+ ///
+ ///
+ ///
+ public static void Read_RepairStatus_PLC(string opName, out int tagValue)
+ {
+ int tagTypeID = 23;
+ tagValue = 0;
+ string cmd = "RepairStatusPLC";
+ string tagValueStr;
+ Read_TagValueByTagTypeID(tagTypeID, opName, out tagValueStr);
+ tagValue = Convert.ToInt32(tagValueStr);
+
+ }
+
+ ///
+ /// PLC将MOBY信息成功写入到了对应的DB,然后通知MES(DBX1.5)(63)
+ ///
+ ///
+ ///
+ public static void Read_PalletMobyReadOver(string opName, out int tagValue)
+ {
+ tagValue = 0;
+ string cmd = "PalletMobyReadOver";
+ string tagValueStr;
+ Read_TagValueByTagTypeName(cmd, opName, out tagValueStr);
+ tagValue = Convert.ToInt32(tagValueStr);
+
+ }
+
+
+ ///
+ /// 在线返修状态(DBX4.0)(91)
+ ///
+ ///
+ ///
+ public static void Read_OnlineRepair(string opName, out int tagValue)
+ {
+ tagValue = 0;
+ string cmd = "OnlineRepair";
+ string tagValueStr;
+ Read_TagValueByTagTypeName(cmd, opName, out tagValueStr);
+ tagValue = Convert.ToInt32(tagValueStr);
+
+ }
+
+ ///
+ /// 离线返修状态(DBX4.1)(92)
+ ///
+ ///
+ ///
+ public static void Read_OutLineRepair(string opName, out bool tagValue)
+ {
+ tagValue = false;
+ string cmd = "OutLineRepair";
+ string tagValueStr;
+ Read_TagValueByTagTypeName(cmd, opName, out tagValueStr);
+ tagValue = Convert.ToBoolean(Convert.ToInt32(tagValueStr));
+
+ }
+
+ ///
+ /// MES通知PLC修改托盘状态成功(DBX4.2)(93)
+ ///
+ ///
+ ///
+ public static void Read_UpdatePalletOK(string opName, out bool tagValue)
+ {
+ tagValue = false;
+ string cmd = "UpdatePalletOK";
+ string tagValueStr;
+ Read_TagValueByTagTypeName(cmd, opName, out tagValueStr);
+ tagValue = Convert.ToBoolean(Convert.ToInt32(tagValueStr));
+ }
+
+
+ ///
+ /// MES向PLC要求申请下线(DBX0.7)(50)
+ ///
+ ///
+ ///
+ public static void Read_PalletDown(string opName, out bool tagValue)
+ {
+ tagValue = false;
+ string cmd = "PalletDown";
+ string tagValueStr;
+ Read_TagValueByTagTypeName(cmd, opName, out tagValueStr);
+ tagValue = Convert.ToBoolean(Convert.ToInt32(tagValueStr));
+
+ }
+
+
+ ///
+ /// 物料检测(99)
+ ///
+ ///
+ ///
+ public static void Read_CheckMaterial(string opName, out object tagValue)
+ {
+ tagValue = new bool[16];
+ string cmd = "CheckMaterial";
+ string tagValueStr;
+ Read_TagValueByTagTypeName(cmd, opName, out tagValueStr);
+ tagValue = Convert.ToBoolean(Convert.ToInt32(tagValueStr));
+
+ }
+
+ ///
+ /// 备用功能是否启用(95)
+ ///
+ ///
+ ///
+ public static void Read_BakOpNameIsWork(string opName, out bool tagValue)
+ {
+ tagValue = false;
+ string cmd = "BakOpNameIsWork";
+ string tagValueStr;
+ Read_TagValueByTagTypeName(cmd, opName, out tagValueStr);
+ tagValue = Convert.ToBoolean(Convert.ToInt32(tagValueStr));
+ }
+
+
+ ///
+ /// 质量呼叫(DBX301.2)(2011)
+ ///
+ ///
+ ///
+ public static void Read_QualityCall(string opName, out bool tagValue)
+ {
+ tagValue = false;
+ string cmd = "QualityCall";
+ string tagValueStr;
+ Read_TagValueByTagTypeName(cmd, opName, out tagValueStr);
+ tagValue = Convert.ToBoolean(Convert.ToInt32(tagValueStr));
+ }
+
+ ///
+ /// 物料呼叫(DBX301.3)(2012)
+ ///
+ ///
+ ///
+ public static void Read_MaterialCall(string opName, out bool tagValue)
+ {
+ tagValue = false;
+ string cmd = "MaterialCall";
+ string tagValueStr;
+ Read_TagValueByTagTypeName(cmd, opName, out tagValueStr);
+ tagValue = Convert.ToBoolean(Convert.ToInt32(tagValueStr));
+
+ }
+
+ ///
+ /// 故障呼叫(DBX301.4)(2013)
+ ///
+ ///
+ ///
+ public static void Read_FaultCall(string opName, out bool tagValue)
+ {
+ tagValue = false;
+ string cmd = "FaultCall";
+ string tagValueStr;
+ Read_TagValueByTagTypeName(cmd, opName, out tagValueStr);
+ tagValue = Convert.ToBoolean(Convert.ToInt32(tagValueStr));
+ }
+
+ public static void Read_PartScanCode(int tagTypeID, string opName, out string tagValue)
+ {
+ tagValue = "";
+ string tagValueStr;
+ Read_TagValueByTagTypeID(tagTypeID, opName, out tagValueStr);
+ tagValue = tagValueStr;
+ }
+
+ }
+}
diff --git a/Common/09MesDataFunction/MesDataFunction/MesDataFunction/MIS.OpcServerMIS.Write.cs b/Common/09MesDataFunction/MesDataFunction/MesDataFunction/MIS.OpcServerMIS.Write.cs
new file mode 100644
index 0000000..7d1826b
--- /dev/null
+++ b/Common/09MesDataFunction/MesDataFunction/MesDataFunction/MIS.OpcServerMIS.Write.cs
@@ -0,0 +1,574 @@
+using System;
+//using SystemFramework;
+
+
+namespace MesServerWork
+{
+
+ public partial class MIS_BASE
+ {
+
+
+ //static public void WritePLC(int tagType, string opName, object tagValue)
+ //{
+ // Write_TagTypeID(tagType, opName, tagValue);
+ //}
+ ///
+ ///
+ ///
+ ///
+ public delegate void DemoHandler(object sender, DeviceDriver_BasicData.CustomeEvetnArgs e);
+ ///
+ ///
+ ///
+ public static event DemoHandler OPCTagDataDemo;
+
+ ///
+ /// 根据tagType,工位号写入PLC对应值
+ ///
+ ///
+ ///
+ static private void Write_TagValueByTagTypeName(string cmd, string opName,object tagValue)
+ {
+ int tagTypeID = 0;
+ string msg;
+ try
+ {
+ tagTypeID = Convert.ToInt32(MIS_BASE.hashtable_TagType[cmd]);
+ MIS_BASE.WriteTagValue(tagTypeID, opName, tagValue);
+ }
+ catch (Exception err)
+ {
+ ////ApplicationLog.WriteLog(err, "Write_TagValueByTagTypeName_FUNC");
+ }
+
+ }
+
+ ///
+ /// 根据TagTypeID,工位号写入PLC对应值
+ ///
+ ///
+ ///
+ static public void Write_TagValueByTagTypeID(int tagTypeID, string opName, object tagValue)
+ {
+ string msg;
+ object tagValueOb;
+ object newTagValue= tagValue;
+ try
+ {
+ MIS_BASE.WriteTagValue(tagTypeID, opName, tagValue);
+
+ }
+ catch (Exception err)
+ {
+ ////ApplicationLog.WriteLog(err, "Write_TagValueByTagTypeID_FUNC");
+ }
+
+ }
+
+ ///
+ /// 通过TagID写入PLC数据
+ ///
+ ///
+ ///
+ public static void Write_TagID(string TagID, object tagValue)
+ {
+ try
+ {
+ MIS_BASE.WritePLC(TagID, tagValue);
+ }
+ catch (Exception err)
+ {
+ ////ApplicationLog.WriteLog(err, "Write_TagValueByTagID_FUNC");
+ }
+ }
+
+
+ ///
+ /// 清空MES信号 MES传递机型(5) 允许工作(66) 合格放行(51) 不合格放行(8) 拧紧结束(67) 工作完成(7) 保存完成(20) 加工时间保存完成(54) 匹配完成(68) 默认false
+ ///
+ ///
+ ///
+ public static void Write_ClearMesMoby(string opName)
+ {
+ MIS_BASE.Write_EngineTypeGetOver_MES(opName, false);
+ MIS_BASE.Write_FixAllow(opName, false);
+ MIS_BASE.Write_ConfirmOkGo(opName, false);
+ MIS_BASE.Write_FalseGO(opName, false);
+ MIS_BASE.Write_FixOver(opName, false);
+ MIS_BASE.Write_MesWorkFinish(opName, false);
+ MIS_BASE.Write_MesReadOver(opName, false);
+ MIS_BASE.Write_MachineTime_ReadOver(opName, false);
+ MIS_BASE.Write_MatchingCompleted(opName, false);
+ }
+
+
+ ///
+ /// 订单号(string)(25)
+ ///
+ ///
+ ///
+ public static void Write_OrderForm(string opName, string tagValue)
+ {
+ string cmd = "OrderForm";
+ Write_TagValueByTagTypeName(cmd, opName, tagValue);
+ }
+ ///
+ /// 总成编号(string)(26)
+ ///
+ ///
+ ///
+ public static void Write_AssemblyCode(string opName, string tagValue)
+ {
+ string cmd = "AssemblyCode";
+ Write_TagValueByTagTypeName(cmd, opName, tagValue);
+ }
+ ///
+ /// 配方号1(dint)(27)
+ ///
+ ///
+ ///
+ public static void Write_Recipe1(string opName, int tagValue)
+ {
+ string cmd = "Recipe1";
+ Write_TagValueByTagTypeName(cmd, opName, tagValue);
+ }
+ ///
+ /// 配方号2(dint)(28)
+ ///
+ ///
+ ///
+ public static void Write_Recipe2(string opName, int tagValue)
+ {
+ tagValue = 0;
+ string cmd = "Recipe2";
+ Write_TagValueByTagTypeName(cmd, opName, tagValue);
+ }
+
+
+
+ ///
+ /// 总成编号(string)(62)
+ ///
+ ///
+ ///
+ public static void Write_AssemblyCode_MES(string opName, string tagValue)
+ {
+
+ string cmd = "AssemblyCode_MES";
+ Write_TagValueByTagTypeName(cmd, opName, tagValue);
+ }
+ ///
+ /// 配方号1(dint)(63)
+ ///
+ ///
+ ///
+ public static void Write_Recipe1_MES(string opName, int tagValue)
+ {
+ string cmd = "Recipe1_MES";
+ Write_TagValueByTagTypeName(cmd, opName, tagValue);
+ }
+ ///
+ /// 配方号2(dint)(64)
+ ///
+ ///
+ ///
+ public static void Write_Recipe2_MES(string opName, int tagValue)
+ {
+ string cmd = "Recipe2_MES";
+ Write_TagValueByTagTypeName(cmd, opName, tagValue);
+ }
+
+
+ ///
+ /// 各个工位返修状态(4)
+ ///
+ ///
+ ///
+ public static void Write_RepairPathString(string opName, string tagValue)
+ {
+ string cmd = "RepairPathString";
+ Write_TagValueByTagTypeName(cmd, opName, tagValue);
+ }
+
+
+ ///
+ /// 加工时间保存完数据 DBX102.1 (54)
+ ///
+ ///
+ ///
+ public static void Write_MachineTime_ReadOver(string opName, bool tagValue)
+ {
+
+ int tagTypeID = 54;
+ Write_TagValueByTagTypeID(tagTypeID, opName, tagValue);
+ }
+
+ ///
+ /// 工位三种状态:在线、离线、屏蔽(0,1,2)(DBB116)(79)
+ ///
+ ///
+ ///
+ public static void Write_OnLineState(string opName, int tagValue)
+ {
+ string cmd = "OnLineState";
+ Write_TagValueByTagTypeName(cmd, opName,Convert .ToInt16 ( tagValue));
+ }
+
+ ///
+ /// 托盘编号(PLC)(80)
+ ///
+ ///
+ ///
+ public static void Write_PalletCode(string opName, int tagValue)
+ {
+ string cmd = "PartPalletCode";
+ Write_TagValueByTagTypeName(cmd, opName, Convert.ToInt16(tagValue));
+ }
+
+ ///
+ /// MES向PLC传递机型(5)
+ ///
+ ///
+ ///
+ public static void Write_EngineTypeGetOver_MES(string opName, bool tagValue)
+ {
+ int tagTypeID = 5;
+ Write_TagValueByTagTypeID(tagTypeID, opName, tagValue);
+ }
+
+ ///
+ /// PLC向MES传递机型(44)
+ ///
+ ///
+ ///
+ public static void Write_EngineTypeGetOver_PLC(string opName, bool tagValue)
+ {
+ string cmd = "EngineTypeGetOverPLC";
+ Write_TagValueByTagTypeName(cmd, opName, tagValue);
+ }
+
+ ///
+ /// PLC向MES质量数据可以读 允许保存(19) DBX587.0
+ ///
+ ///
+ ///
+ public static void Write_MesRead_PLC(string opName, bool tagValue)
+ {
+ string cmd = "MesRead";
+ Write_TagValueByTagTypeName(cmd, opName, tagValue);
+ }
+
+
+ ///
+ /// 工件到位
+ ///
+ ///
+ ///
+ public static void Write_WorkStart(string opName, bool tagValue)
+ {
+ string cmd = "WorkStart";
+ Write_TagValueByTagTypeName(cmd, opName, tagValue);
+ }
+
+ ///
+ /// 拧紧结束确认(67)
+ ///
+ ///
+ ///
+ public static void Write_FixOver(string opName, bool tagValue)
+ {
+
+ int tagTypeID = 67;
+ Write_TagValueByTagTypeID(tagTypeID, opName, tagValue);
+ }
+
+ ///
+ ///返修上线,在上线工位,MES依据工件情况,设定为返修件,PLC见到MES设定为1后,将返修标志写入到DBX0.2为1
+ ///MES设定完返修返修上线后,MES清空该信号
+ ///DBX3.7(72)
+ ///
+ ///
+ ///
+ public static void Write_RepairUpline_MES(string opName, bool tagValue)
+ {
+ int tagTypeID = 72;
+ Write_TagValueByTagTypeID(tagTypeID, opName, tagValue);
+ }
+
+ ///
+ /// 匹配完成(68)
+ ///
+ ///
+ ///
+ public static void Write_MatchingCompleted(string opName, bool tagValue)
+ {
+ int tagTypeID = 68;
+ Write_TagValueByTagTypeID(tagTypeID, opName, tagValue);
+ }
+
+
+
+
+ ///
+ /// 匹配结果(69)
+ ///
+ ///
+ ///
+ public static void Write_Match(string opName, bool tagValue)
+ {
+ int tagTypeID = 69;
+ Write_TagValueByTagTypeID(tagTypeID, opName, tagValue);
+
+ }
+
+ ///
+ /// 空托盘放行(DBX2.2)(6)
+ ///
+ ///
+ ///
+ public static void Write_PartPalletGoOver(string opName, int tagValue)
+ {
+ int tagTypeID = 6;
+ Write_TagValueByTagTypeID(tagTypeID, opName, tagValue);
+ }
+
+
+ ///
+ /// 自动手动申请工件编号,0是自动方式;1:手动方式。切换时,(DBX2.1)(71)
+ ///
+ ///
+ ///
+ public static void Write_IsAutoGetEngineID(string opName, int tagValue)
+ {
+ string cmd = "IsAutoGetEngineID";
+ Write_TagValueByTagTypeName(cmd, opName, Convert.ToInt16(tagValue));
+ }
+
+
+ ///
+ /// 正常拧紧时选择(DBX100.3)(81)
+ ///
+ ///
+ ///
+ public static void Write_Normal(string opName, int tagValue)
+ {
+ string cmd = "Normal";
+ Write_TagValueByTagTypeName(cmd, opName, Convert.ToInt16(tagValue));
+ }
+ ///
+ /// 备用拧紧时选择(DBX100.4)(82)
+ ///
+ ///
+ ///
+ public static void Write_UnNormal(string opName, int tagValue)
+ {
+ string cmd = "UnNormal";
+ Write_TagValueByTagTypeName(cmd, opName, Convert.ToInt16(tagValue));
+ }
+
+ ///
+ /// 变量类型代码=52,复位设备(MES)DBX0.6
+ /// 通知PLC复位设备
+ ///
+ ///
+ ///
+ public static void Write_ResetDevice(string opName, bool tagValue)
+ {
+ string cmd = "PartLoadFinish";
+ Write_TagValueByTagTypeName(cmd, opName, tagValue);
+ }
+
+ ///
+ ///托盘状态(22)
+ ///
+ ///
+ ///
+ public static void Write_PalletInfo(string opName, int tagValue)
+ {
+ string cmd = "PalletInfo";
+ Write_TagValueByTagTypeName(cmd, opName, Convert.ToInt16(tagValue));
+ }
+ ///
+ /// 返修标志(93)
+ ///
+ ///
+ ///
+ public static void Write_RepairStatusMES(string opName, int tagValue)
+ {
+ string cmd = "RepairStatusMES";
+ Write_TagValueByTagTypeName(cmd, opName, Convert.ToInt16(tagValue));
+ }
+
+ ///
+ /// MES通知PLC修改托盘状态成功
+ ///
+ ///
+ ///
+ public static void Write_UpdatePalletOK(string opName, bool tagValue)
+ {
+ string cmd = "UpdatePalletOK";
+ Write_TagValueByTagTypeName(cmd, opName, tagValue);
+ }
+
+ #region MES交互区写值
+
+ ///
+ /// 工作完成(7)(MES)
+ ///
+ ///
+ ///
+ public static void Write_MesWorkFinish(string opName, bool tagValue)
+ {
+ int tagTypeID = 7;
+ Write_TagValueByTagTypeID(tagTypeID, opName, tagValue);
+ }
+ ///
+ /// 合格方式放行(51)(MES)
+ ///
+ ///
+ ///
+ public static void Write_ConfirmOkGo(string opName, bool tagValue)
+ {
+ int tagTypeID = 51;
+ Write_TagValueByTagTypeID(tagTypeID, opName, tagValue);
+ }
+
+ ///
+ /// 允许拧紧(66)(MES)
+ ///
+ ///
+ ///
+ public static void Write_FixAllow(string opName, bool tagValue)
+ {
+ int tagTypeID = 66;
+ Write_TagValueByTagTypeID(tagTypeID, opName, tagValue);
+ }
+
+ ///
+ /// 不合格放行(8)
+ ///
+ ///
+ ///
+ public static void Write_FalseGO(string opName, bool tagValue)
+ {
+ int tagTypeID = 8;
+ Write_TagValueByTagTypeID(tagTypeID, opName, tagValue);
+ }
+
+ ///
+ /// 拧紧序号(77)
+ ///
+ ///
+ ///
+ public static void Write_ProcessCode(string opName, int tagValue)
+ {
+ int tagTypeID = 77;
+ Write_TagValueByTagTypeID(tagTypeID, opName, tagValue);
+ }
+
+
+ ///
+ /// 套筒号(88)
+ ///
+ ///
+ ///
+ public static void Write_BoltCode(string opName, int tagValue)
+ {
+ int tagTypeID = 88;
+ Write_TagValueByTagTypeID(tagTypeID, opName, tagValue);
+ }
+ ///
+ /// MES保存完数据(必须MIS)(X102.2)(20)
+ ///
+ ///
+ ///
+ public static void Write_MesReadOver(string opName, bool tagValue)
+ {
+ int tagTypeID = 20;
+ Write_TagValueByTagTypeID(tagTypeID, opName, tagValue);
+ }
+ ///
+ /// 工作完成(7)
+ ///
+ ///
+ ///
+ public static void Write_MaterialVerifyOver(string opName, bool tagValue)
+ {
+ string cmd = "MaterialVerifyOver";
+ Write_TagValueByTagTypeName(cmd, opName, tagValue);
+ }
+ public static void Write_TagTypeID(int tagTypeID, string opName, object tagValue)
+ {
+ Write_TagValueByTagTypeID(tagTypeID, opName, tagValue);
+ }
+
+ ///
+ /// 变量类型代码=73,机型代码。DBB404~405 机型标志
+ ///
+ ///
+ ///
+ public static void Write_EngineTypeID_MES(string opName, int tagValue)
+ {
+ int tagTypeID = 73;
+ Write_TagValueByTagTypeID(tagTypeID, opName, tagValue);
+ }
+
+ public static void Write_OpNameIsOk(string opName,int qualityMask)
+ {
+
+ // -99 是复位
+ if (qualityMask == -99)
+ {
+ Write_TagValueByTagTypeID(51, opName, false);
+ Write_TagValueByTagTypeID(8, opName, false);
+ }
+ else if(qualityMask == 1)
+ {
+ // 51 合格放行
+ Write_TagValueByTagTypeID(51, opName, true);
+ }
+ else
+ {
+ // 8 不合格放行
+ Write_TagValueByTagTypeID(8, opName, true);
+ }
+ }
+
+ ///
+ /// 变量类型代码=74,零件编号。DBB406~445 发动机编号
+ ///
+ ///
+ ///
+ public static void Write_EngineID_MES(string opName, string tagValue)
+ {
+ int tagTypeID = 74;
+ Write_TagValueByTagTypeID(tagTypeID, opName, tagValue);
+ }
+ ///
+ /// 变量类型代码=75,零件机型。DBB446~485 发动机机型
+ ///
+ ///
+ ///
+ public static void Write_EngineType_MES(string opName, string tagValue)
+ {
+ int tagTypeID = 75;
+ Write_TagValueByTagTypeID(tagTypeID, opName, tagValue);
+ }
+
+ ///
+ /// 订单号(string)(116)
+ ///
+ ///
+ ///
+ public static void Write_OrderForm_MES(string opName, string tagValue)
+ {
+ int tagTypeID = 116;
+ Write_TagValueByTagTypeID(tagTypeID, opName, tagValue);
+ }
+
+ #endregion
+
+
+ }
+}
diff --git a/Common/09MesDataFunction/MesDataFunction/MesDataFunction/MIS.QualityData.Read.cs b/Common/09MesDataFunction/MesDataFunction/MesDataFunction/MIS.QualityData.Read.cs
new file mode 100644
index 0000000..92dbfdf
--- /dev/null
+++ b/Common/09MesDataFunction/MesDataFunction/MesDataFunction/MIS.QualityData.Read.cs
@@ -0,0 +1,75 @@
+using System;
+using System.Data;
+using System.Collections;
+using MisDataFunDll;
+
+namespace MesServerWork
+{
+ public partial class MIS_BASE
+ {
+
+ ///
+ /// 读取质量数据
+ ///
+ ///
+ public static void ReadPLC_Sync_ValueList(string opName, out Hashtable valueList)
+ {
+ valueList = null;
+ ReadPLCData(opName, out valueList);
+ }
+ ///
+ /// 根据工位号 同步读取数据
+ ///
+ /// 工位号
+ /// PLC仅仅值列表
+ private static void ReadPLCData(string opName, out Hashtable valueList)
+ {
+ valueList = new Hashtable();
+
+ System.Data.DataTable dt;
+ dt = MisDataFun.BaseData_tagTable_QualityData_Item_B5A();
+
+ object tagValueStr = "0";
+ for (int i = 0; i < dt.Rows.Count; i++)
+ {
+ if (opName == dt.Rows[i]["工位号"].ToString())
+ {
+
+ DeviceDriver_BasicData.CustomeEvetnArgs qualityDataType;
+ qualityDataType = new DeviceDriver_BasicData.CustomeEvetnArgs();
+
+ qualityDataType.TagID = dt.Rows[i]["TagID"].ToString ();
+ qualityDataType.TagTypeID = Convert.ToInt32(dt.Rows[i]["TagTypeID"]);//变量类型
+ qualityDataType.OpName = opName;//
+ qualityDataType.IsGoodBad = 192;//
+ qualityDataType.TagQuality = 192;//
+ qualityDataType.TagValueType = Convert.ToInt32(dt.Rows[i]["变量类型代码"]);
+ qualityDataType.TagOrderBy = Convert.ToInt32(dt.Rows[i]["列位置"]);
+ qualityDataType.TagItemOrderBy = Convert.ToInt32(dt.Rows[i]["变量排序"]);
+ qualityDataType.TagProperty = Convert.ToInt32(dt.Rows[i]["变量特点"]); ;//变量特点
+
+ MIS_BASE.Read_TagValueByTagID(qualityDataType.TagID.ToString(), out tagValueStr);
+
+ if (Convert.ToInt32(qualityDataType.TagTypeID) == 18)
+ {
+ qualityDataType.TagValue = Convert.ToInt32(tagValueStr);//变量值
+ }
+ else
+ {
+ qualityDataType.TagValue = tagValueStr;//变量值
+ }
+ valueList.Add(qualityDataType.TagID, qualityDataType);
+ }
+ }
+ }
+ }
+
+ public class QualityDataSaveList
+ {
+ public Hashtable valuList;
+ public DataTable BasicDataTagValue;
+ public DataTable BasicDataTagValueUpDown;
+ public Hashtable hashtable_EngineTypeID;
+ public Hashtable hashtable_tagTable_OpName_SaveData;
+ }
+}
diff --git a/Common/09MesDataFunction/MesDataFunction/MesDataFunction/MIS_BASE.cs b/Common/09MesDataFunction/MesDataFunction/MesDataFunction/MIS_BASE.cs
new file mode 100644
index 0000000..bd2012d
--- /dev/null
+++ b/Common/09MesDataFunction/MesDataFunction/MesDataFunction/MIS_BASE.cs
@@ -0,0 +1,341 @@
+using BasicData;
+
+using MesWork;
+using Newtonsoft.Json;
+using NPOI.Util;
+using OpcBasic;
+using System;
+using System.Collections;
+using System.Collections.Concurrent;
+using System.Collections.Generic;
+using System.Collections.Specialized;
+using System.Linq;
+using System.Net.Http;
+using System.Runtime.Remoting.Messaging;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace MesServerWork
+{
+
+ /*
+HeartBeatMIS 15
+EngineTypeGetOverMES 5
+PartPalletGoOver 6
+MaterialVerifyOver 7
+FalseGo 8
+ConfirmOkGo 51
+PartLoadFinish 52
+UnloadCompleted 53
+MachineTime_ReadOver 54
+FixAllow 66
+FixOver 67
+MatchingCompleted 68
+Match 69
+Reserved_1 70
+IsAutoGetEngineID 71
+RepairUplineMES 72
+ProcessCode 77
+BoltCode 88
+RepairStatus 93
+Reserved_3 24
+Reserved_4 25
+Reserved_5 26
+Reserved_6 27
+Reserved_7 28
+Reserved_8 29
+Reserved_9 30
+Reserved_10 31
+Reserved_11 32
+Reserved_12 33
+Reserved_13 34
+Reserved_14 35
+MesReadOver 20
+Reserved_15 110
+Reserved_16 111
+Reserved_17 112
+OnLineState 79
+EngineTypeID_MES 73
+EngineID_MES 74
+EngineType_MES 75
+MarkID 42
+RepairPathString 4
+SPareint1 113
+SPareint2 114
+SPareint3 115
+Sparestring1 116
+Sparestring2 117
+HeartBeatPLC 14
+WorkStart 2
+RepairPartStatusPLC 3
+PartLoad 43
+EngineTypeGetOverPLC 44
+PartLoadOK 48
+Reserved_18 49
+PalletDown 50
+Reserved_19 58
+FixOK 59
+Reserved_20 76
+Reserved_21 61
+Reserved_22 62
+Reserved_23 63
+Reserved_24 64
+Reserved_25 65
+EngineTypeID 9
+EngineID 10
+EngineType 11
+PartPalletCode 80
+PalletInfo 22
+MesRead 19
+PutOn 1000
+WorkOn 1001
+Alarm 1002
+NoPart 1003
+Block 1004
+PartPalletStatus 13
+TargetTimeRead 16
+QualityMask 21
+RepairStatusPLC 23
+MachineTargetTime 17
+MachineActualTime 18
+PLCSPareint1 36
+PLCSPareint2 37
+PLCSPareint3 38
+PLCSarestring1 39
+PLCSarestring2 40
+ */
+
+
+
+ public partial class MIS_BASE
+ {
+
+
+ ///
+ ///引用程序集Hashtable
+ ///
+ public static Hashtable Hashtable_assembly = new Hashtable();
+ ///
+ ///
+ ///
+ static public NameValueCollection hashtable_TagTypeTagName = null;
+
+ ///
+ ///
+ ///
+ static public NameValueCollection hashtable_TagTypeChange = null;
+ ///
+ ///
+ ///
+ static public NameValueCollection hashtable_WebTagTypeChange = null;
+ ///
+ ///
+ ///
+ static public NameValueCollection hashtable_MesTagTypeChange = null;
+ ///
+ ///
+ ///
+ static readonly object l = new object();
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static object ReadPLC(int tagTypeCodeID, string opName)
+ {
+ try
+ {
+ return PlcLinkForm.ReadPLC(tagTypeCodeID, opName);
+
+ }
+ catch { return "-3"; }
+ }
+ ///
+ ///
+ ///
+ ///
+ ///
+ private static object ReadPLC(string tagID)
+ {
+ return PlcLinkForm.ReadPLC(tagID);
+ }
+ ///
+ /// 20230218
+ /// 按组读质量数据,返回带合格标志的质量数据列表
+ ///
+ ///
+ ///
+ public static Hashtable ReadPLC_Sync_DataList_MesRead_ByOnlyDataGroup(string opName)
+ {
+ lock (l)
+ {
+
+ var tagValues = GetDbAndMaxLengthByOpNameByBytes(opName);
+
+ var keyValues = tagValues.OrderBy(x => x.Key).ToDictionary(k => k.Key, v => v.Value);
+
+ TagFormat tagFormatTemp;
+ int tagIndex = 1;
+ int isOK = 0;
+
+ Hashtable ht = new Hashtable();
+
+
+ foreach (KeyValuePair _cd in keyValues)
+ {
+ if (_cd.Key.ToString()[0].ToString() == "7")
+ {
+ tagFormatTemp = (TagFormat)_cd.Value;
+ if (tagIndex % 3 == 1)
+ {
+ isOK = Convert.ToInt32(tagFormatTemp.TagValue);
+ }
+ else if (tagIndex % 3 == 2)
+ {
+ var TF = (TagFormat)_cd.Value;
+
+ QualityDataType qualityDataType;
+ qualityDataType = GetQualityDataType(TF);
+ qualityDataType.isGoodBad = isOK;
+ ht.Add(qualityDataType.tagID, qualityDataType);
+ }
+ else if (tagIndex % 3 == 0)
+ {
+ var TF = (TagFormat)_cd.Value;
+
+ QualityDataType qualityDataType;
+ qualityDataType = GetQualityDataType(TF);
+ qualityDataType.isGoodBad = isOK;
+ ht.Add(qualityDataType.tagID, qualityDataType);
+ }
+
+ tagIndex++;
+ }
+ //Console.WriteLine($"key:{kv.Key} value:{kv.Value}");
+ }
+ return ht;
+ }
+ }
+
+ public static ConcurrentDictionary GetDbAndMaxLengthByOpNameByBytes(string opName)
+ {
+ string tagStartAdr = "";
+ ushort tagAdrListMaxLength = 0;
+ PlcLinkForm.GetDbAndMaxLengthByOpName(opName, out tagStartAdr, out tagAdrListMaxLength);
+ var tagAdrListTagFormat = PlcLinkForm.ReadQualityDataList(opName, tagStartAdr, tagAdrListMaxLength);
+ return tagAdrListTagFormat;
+ }
+
+
+ public static BasicData.QualityDataType GetQualityDataType(TagFormat TF)
+ {
+ QualityDataType qualityDataType;
+
+ qualityDataType = new QualityDataType();
+
+ qualityDataType.tagID = TF.TagID;
+ qualityDataType.tagTypeID = TF.TagTypeID;//变量类型
+ qualityDataType.opName = TF.OpName;
+ qualityDataType.tagQuality = TF.Code;
+ qualityDataType.tagValueType = TF.TagTypeCodeID;
+ int.TryParse(TF.TagOrderBy, out int TagOrderBy);
+ qualityDataType.tagOrderBy = TagOrderBy;
+ int.TryParse(TF.TagItemOrderBy, out int TagItemOrderBy);
+ qualityDataType.tagItemOrderBy = TagItemOrderBy;
+ qualityDataType.tagProperty = Convert.ToInt32( TF.TagProperty);//变量特点
+ qualityDataType.tagValue = TF.TagValue;//变量值
+
+ return qualityDataType;
+ }
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ private static void ReadTagValue(int tagTypeCodeID, string opName, out string tagValue)
+ {
+ tagValue = "0";
+ try
+ {
+ var tagValueObj = PlcLinkForm.ReadPLC(tagTypeCodeID, opName);
+ var type = tagValueObj.GetType().Name.ToLower();
+ if (type == "bool" | type == "boolean")
+ {
+ var val = tagValueObj.ToString().ToLower();
+
+ if (val == "true")
+ {
+ tagValue = "1";
+ }
+ }
+ else
+ {
+ tagValue = tagValueObj.ToString();
+ }
+ }
+ catch { }
+ }
+
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ private static bool WritePLC(string tagID, object tagValue)
+ {
+ return PlcLinkForm.WritePLC(tagID, tagValue);
+ }
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static bool WritePLC(int tagTypeCodeID, string opName, object tagValue)
+ {
+ return PlcLinkForm.WritePLC(tagTypeCodeID, opName, tagValue);
+ }
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ private static bool WriteTagValue(int tagTypeCodeID, string opName, object tagValue)
+ {
+ return PlcLinkForm.WritePLC(tagTypeCodeID, opName, tagValue);
+ }
+
+ public static ConcurrentDictionary ReadPLC_OpName(string opName)
+ {
+ try
+ {
+ string tagStartAdr = "";
+ ushort tagAdrListMaxLength = 0;
+ PlcLinkForm.GetDbAndMaxLengthByOpName(opName, out tagStartAdr, out tagAdrListMaxLength);
+ var tagAdrListTagFormat0 = PlcLinkForm.ReadQualityDataList(opName, tagStartAdr, tagAdrListMaxLength);
+
+ var pp = JsonConvert.SerializeObject(tagAdrListTagFormat0);
+ var tagAdrListTagFormat = JsonConvert.DeserializeObject>(pp);
+
+
+ return tagAdrListTagFormat;
+ }
+ catch (Exception err)
+ {
+ return null;
+
+ }
+
+ }
+
+ }
+
+
+
+}
diff --git a/Common/09MesDataFunction/MesDataFunction/MesWorkPlc.cs b/Common/09MesDataFunction/MesDataFunction/MesWorkPlc.cs
new file mode 100644
index 0000000..68db1b0
--- /dev/null
+++ b/Common/09MesDataFunction/MesDataFunction/MesWorkPlc.cs
@@ -0,0 +1,41 @@
+
+using MesWork;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace MesDataFunction
+{
+ public class MesWorkPlc: PlcLinkForm
+ {
+
+ public static Action D_OPCTagData_TagDataOnChangeMIS = null;
+
+ ///
+ /// 监控数据的所有变化,从这里产生
+ ///
+ ///
+ ///
+ public override void OPCTagData_TagDataOnChangeMIS(object sender, DeviceDriver_BasicData.CustomeEvetnArgs e)
+ {
+ Console.WriteLine($"【【{e.TagName}【【{e.TagValueBefore}->{e.TagValue}【【{e.TagKeepTime}");
+
+ if (D_OPCTagData_TagDataOnChangeMIS != null)
+ D_OPCTagData_TagDataOnChangeMIS(e);
+ // OPCTagData_TagDataOnChange(sender, e);
+ }
+
+ ///
+ /// 定时触发,检测PLC在线状态,周期:3 s
+ ///
+ ///
+ ///
+ public override void PlcStateEvent(object sender, DeviceDriver_BasicData.PlcStateEvetnArgs eState)
+ {
+
+ }
+
+ }
+}
diff --git a/Common/09MesDataFunction/MesDataFunction/MisDataFunction/Heartbeat.cs b/Common/09MesDataFunction/MesDataFunction/MisDataFunction/Heartbeat.cs
new file mode 100644
index 0000000..75d41ea
--- /dev/null
+++ b/Common/09MesDataFunction/MesDataFunction/MisDataFunction/Heartbeat.cs
@@ -0,0 +1,25 @@
+//using bizFacade;
+using System;
+using System.Collections;
+using System.Data;
+//using SystemFramework;
+
+namespace MisDataFunction
+{
+ partial class Function
+ {
+
+ private static void Heartbeat(string opName, string tagValue)
+ {
+ if (tagValue == "1")
+ {
+ Write_TagValueByTagTypeID(15, opName, true);
+ }
+ else
+ {
+ Write_TagValueByTagTypeID(15, opName, false);
+ }
+ }
+
+ }
+}
diff --git a/Common/09MesDataFunction/MesDataFunction/MisDataFunction/MIS.Interface.cs b/Common/09MesDataFunction/MesDataFunction/MisDataFunction/MIS.Interface.cs
new file mode 100644
index 0000000..904c975
--- /dev/null
+++ b/Common/09MesDataFunction/MesDataFunction/MisDataFunction/MIS.Interface.cs
@@ -0,0 +1,326 @@
+
+using bizFacade;
+using DoWhatPlc;
+using MesServerWork;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+//using SystemFramework;
+
+namespace MisDataFunction
+{
+ public partial class Function: MIS_BASE
+ {
+
+
+
+ ///
+ /// 处理MIS逻辑 TagName 变量类型代码 变量类型名称
+ /// WorkStart 2 工件到位。托盘到达工位,并且托盘上有工件。
+ ///RepairPartStatusPLC 3 备用
+ ///RepairPathString 4 工位返修字符串(121211112222111),前2位是西门子字符串格式,第一位是总长度,第二位是实际长度
+ ///EngineTypeGetOverMES 5 MES传递总成信息给PLC(上线工位)
+ ///PartPalletGoOver 6 上线工位。0:正常工作;1:空托盘放行,PLC读取到此标志不走申请上线逻辑。
+ ///MaterialVerifyOver 7 MES保存完质量数据,物料数据等与PLC信号交互完成后通知PLC,所以工步都完成,才可以放行工件,正常工作时工件放行的必要条件。
+ ///FalseGo 8 按MES界面[不合格放行] 按钮,MES发送此信号。操作者判断工件不合格,通知设备,按不合格方式放行工件,工件流转到返修下线工位后,返修下线。MES工作完成MES0.3=1,MES合格放行MES0.5=0,MES0.4=1
+ ///EngineTypeID 9 MES发动机机型标志(必须PLC)
+ ///EngineID 10 MES发动机编号(必须PLC)
+ ///EngineType 11 MES发动机机型(必须PLC)
+ ///PartPalletStatus 13 MES激发变量托盘到位离开(必须PLC)
+ ///HeartBeatPLC 14 心跳处理:PLC收到MES心跳信号后,PLC延时5秒后,数值取反再写回PLC,写回PLC开始计时,如果5秒钟MES无反馈报通讯故障。
+ ///HeartBeatMIS 15 间隔时间5S,心跳处理。收到PLC心跳信号后,MES按原值回写。PLC收到MES信号后延时5秒,取反写入,以此循环。
+ ///TargetTimeRead 16 MES允许可读工位运行时间
+ ///MachineTargetTime 17 目标运行时间
+ ///MachineActualTime 18 实际运行时间
+ ///MesRead 19 质量数据可以读数据
+ ///MesReadOver 20 MES保存完数据(必须MIS)
+ ///QualityMask 21 质量数据工位合格标志0:没有工作;1:合格 ;2 :不合格(必须PLC)
+ ///PalletInfo 22 0空托盘,1合格件,2不合格件
+ ///RepairStatusPLC 23 0正常件,1返修件
+ ///Reserved_3 24 备用
+ ///Reserved_4 25 备用
+ ///Reserved_5 26 备用
+ ///Reserved_6 27 备用
+ ///Reserved_7 28 备用
+ ///Reserved_8 29 备用
+ ///Reserved_9 30 备用
+ ///Reserved_10 31 备用
+ ///Reserved_11 32 备用
+ ///Reserved_12 33 备用
+ ///Reserved_13 34 备用
+ ///Reserved_14 35 备用
+ ///PLCSPareint1 36 备用
+ ///PLCSPareint2 37 备用
+ ///PLCSPareint3 38 备用
+ ///PLCSarestring1 39 备用
+ ///PLCSarestring2 40 备用
+ ///MarkID 42 机体打标号(MES)前2位是西门子字符串格式,第一位是总长度,第二位是实际长度
+ ///PartLoad 43 上线工位,PLC向MES申请总成编号。收到该信号后,MES将机型标志(DBB22 ~23)、总成号(DBB24 ~63)、总成机型DBB64 ~103写入PLC。之后MES通过信号“传递机型(DBX0.1)”通知PLC。
+ ///EngineTypeGetOverPLC 44 PLC将机型标志(DBB50…51)、工件编号(DBB52…101)、产品型号(DBB102…187)、托盘编号(DBB188…189)准备完毕后,通知MES。
+ ///PartLoadOK 48 备用
+ ///Reserved_18 49 备用
+ ///PalletDown 50 暂时保留,项目未使用
+ ///ConfirmOkGo 51 按MES界面[合格放行] 按钮,MES发送此信号。操作者判断工件合格,通知设备,工件按合格方式放行工件。MES工作完成MES0.3=1,MES合格放行MES0.5=1,MES0.4=0
+ ///ResetDevice 52 针对手动工位,无HMI,需要复位设备在MES页面操作。
+ ///UnloadCompleted 53 暂时保留,项目未使用
+ ///MachineTime_ReadOver 54 备用
+ ///Reserved_19 58 备用
+ ///FixOK 59 手动拧紧工位,单工步螺栓拧紧完成,通知PC读取数据。
+ ///Reserved_21 61 备用
+ ///Reserved_22 62 备用
+ ///Reserved_23 63 备用
+ ///Reserved_24 64 备用
+ ///Reserved_25 65 备用
+ ///FixAllow 66 设备工作的必须信号,对于有物料验证的工位,MES验证完成给出此信号,对于无物料验证工位,MES直接给出此信号。
+ ///FixOver 67 用于手动拧紧且有质量数据工位。通知设备当前工步拧紧螺钉工作结束。
+ ///MatchingCompleted 68 分线上总线,匹配成功是1;不成功是0。
+ ///Match 69 分线上总线,匹配成功是1;不成功是0。
+ ///Reserved_2 70 备用
+ ///IsAutoGetEngineID 71 自动手动申请工件编号。0是自动方式;1:手动方式。暂时保留,生成流水号方式是在数据库中实现的
+ ///RepairUplineMES 72 上线清空MOBY(针对上线工位):通知PLC从新开始申请上线流程
+ ///EngineTypeID_MES 73 MES发动机机型标志(必须MES)
+ ///EngineID_MES 74 MES发动机编号(必须MES)
+ ///EngineType_MES 75 MES发动机机型(必须MES)
+ ///Reserved_20 76 备用
+ ///ProcessCode 77 手动拧紧工位:由MES通知PLC拧紧序号
+ ///OnLineState 79 通过线体工位PC实现下达工位工作状态:工位有三种状态:在线、离线、屏蔽。在线:0正常状态,实现正常功能。1离线:设备脱离MES工作,进入不交互模式。
+ ///PartPalletCode 80 托盘编号(B5A)
+ ///BoltCode 88 手动拧紧工位:指导PLC所用套筒
+ ///RepairStatus 93 0正常件,1返修件。对于上线工位MES给出是正常上线还是返修上线,返修路径
+ ///Reserved_15 110 备用
+ ///Reserved_16 111 备用
+ ///Reserved_17 112 备用
+ ///SPareint1 113 备用int1
+ ///SPareint2 114 备用int2
+ ///SPareint3 115 备用int3
+ ///Sparestring1 116 备用字符串1
+ ///Sparestring2 117 备用字符串2
+ ///MachineStatusPutOn 1000 机床上电(必须PLC)
+ ///MachineStatusWorkOn 1001 循环开始(必须PLC)
+ ///MachineStatusAlarm 1002 机床故障(必须PLC)
+ ///MachineStatusNoPart 1003 上料无件(必须PLC)
+ ///MachineStatusBlock 1004 下料堵塞(必须PLC)
+ ///Alarm 103 设备报警
+ ///
+ /// param >
+ public static void MIS_Funtion(object e)
+ {
+ try
+ {
+
+ string recData = e.ToString();
+ string[] dataArray = recData.Split('|');
+ if (dataArray.Length != 4)
+ return;
+ //消息来源
+ string m_Source = dataArray[0].ToString();
+ //消息类型
+ string m_Command = dataArray[1].ToString();
+ //工位号
+ string m_OpName = dataArray[2].ToString();
+ //消息参数
+ string m_Value = dataArray[3].ToString();
+
+ DoWhatPlc.ReturnValueString rv = Newtonsoft.Json.JsonConvert.DeserializeObject(m_Value);
+ //Console.WriteLine($"【【{rv.TagID}【【【【{ rv.TagKeepTime}");
+
+ int tagType;
+ string opName;
+ string tagValue;
+ int tagid;
+ DoWhatPlc.ReturnValueString msgEvent = rv;
+ if (msgEvent.TagValue == null) return;
+ tagType = Convert.ToInt32(msgEvent.TagTypeID);
+ opName = msgEvent.OpName.ToString();
+ tagid = Convert.ToInt32(msgEvent.TagID);
+
+
+ //int tagType;
+ //string opName;
+ //string tagValue;
+ //int tagid;
+ //DoWhatPlc.CustomeEvetnArgs msgEvent = (DoWhatPlc.CustomeEvetnArgs)e;
+ //if (msgEvent.TagValue == null) return;
+ //tagType = Convert.ToInt32(msgEvent.TagType);
+ //opName = msgEvent.OpName.ToString();
+ //tagid = Convert.ToInt32(msgEvent.TagKey);
+ switch (Convert.ToInt32(msgEvent.TagTypeCodeID))
+ {
+ case 11:
+ switch (msgEvent.TagValue.ToLower())
+ {
+ case "1":
+ case "true":
+ tagValue = "1";
+ break;
+ default:
+ tagValue = "0";
+ break;
+ }
+ break;
+ default:
+ tagValue = msgEvent.TagValue.ToString();
+ break;
+ }
+ ///根据信号处理逻辑
+ switch (tagType)
+ {
+ case 19:
+ //允许保存
+ MesRead(opName, tagValue, tagid);
+ break;
+ case 14:
+ //心跳
+ Heartbeat(opName, tagValue);
+ break;
+ case 44://PLC传递机型过后 才允许保存过站信息,否则不允许保存
+ //if (tagValue == "1")
+ //{
+ // IsEngTypeGetOver_Write(opName, true);
+
+ // EngineData Enginedata = new EngineData(DtWebApi.ReadWritePLC.ReadPLC("10", opName).ToString(), Convert.ToInt32(DtWebApi.ReadWritePLC.ReadPLC("80", opName)));
+ // //EngineData Enginedata = new EngineData(MesDataFunction.OpcOperation.ReadPLC(10, opName).ToString(), Convert.ToInt32(MesDataFunction.OpcOperation.ReadPLC(80, opName)));
+ // //保存产品编号、托盘号 保存过站信息用
+ // EngineData_Hash_Write(opName, Enginedata);
+ //}
+ break;
+ case 2://工件到位
+ WorkStart( rv);
+
+
+ //WorkStart(opName, tagValue);
+ break;
+ case 51:
+ if (hashtableOpName_IsHaveComputer[opName].ToString() == "1")
+ {
+ SaveProductLeaveData(opName, 1);
+ }
+
+ break;
+ case 8:
+ if (hashtableOpName_IsHaveComputer[opName].ToString() == "1")
+ {
+ SaveProductLeaveData(opName, 2);
+ }
+ break;
+ case 103:
+
+ Alarm_Insert(rv);
+
+ break;
+ }
+
+ }
+ catch (Exception err)
+ {
+ ////ApplicationLog.WriteLog(err, err.Message);
+ }
+ }
+ private static void Alarm_Insert(ReturnValueString rv)
+ {
+ string TagID;
+ string opName;
+ string tagTypeID;
+ int TagValue;
+
+ DateTime alarmStartTime;
+ DateTime alarmEndTime;
+ int TimeDiff;
+ string TagOrderBy;
+ string Text1;
+ string Text2;
+ TagID = rv.TagID;
+ tagTypeID = rv.TagTypeID;
+ opName = rv.OpName;
+ TagValue = Convert.ToInt32( rv.TagValue);
+
+ alarmStartTime = Convert.ToDateTime( rv.TimeStampBefore);
+ alarmEndTime = Convert.ToDateTime( rv.TimeStamp);
+ TimeDiff = Convert.ToInt32(rv.TagKeepTime);
+ TagOrderBy = rv.TagOrderBy;
+ Text1 = rv.ItemName;
+ Text2 = rv.ShaftID;
+
+ BaseDataSystemMES.Alarm_Insert(TagID, tagTypeID, opName, TagValue,
+ alarmStartTime, alarmEndTime, TimeDiff, Text1, Text2, TagOrderBy);
+ }
+ private static void WorkStart(ReturnValueString rv)
+ {
+
+
+
+ var ro = rv.ReturnValueToObject();
+
+ string opName = ro.OpName;
+ DateTime arrivedTime = ro.TimeStampBefore;
+ DateTime leavedTime = ro.TimeStamp;
+ int TimeDiff = ro.TagKeepTime;
+ int targetTime = 0;
+ string isPass = "";
+
+ int QualityMark=0;
+ string tagValue="0";
+ switch (ro.TagValue.ToString().ToLower())
+ {
+ case "1":
+ case "true":
+ tagValue = "1";
+ break;
+ default:
+ tagValue = "0";
+ break;
+ }
+ //if (ro.TagValue.ToString() == "0")
+ //{
+ // //Write_TagTypeID(5, opName, false);//MES传递机型
+ // //Write_TagTypeID(66, opName, false);//允许工作
+ // //Write_TagTypeID(51, opName, false);//合格放行
+ // //Write_TagTypeID(8, opName, false);//不合格放行
+ // //Write_TagTypeID(7, opName, false);//工作完成
+ // //Write_TagTypeID(20, opName, false);//保存完成
+
+ // //string isHaveComputer = hashtableOpName_IsHaveComputer[opName].ToString();
+ // //if (Convert.ToInt32(isHaveComputer) == 0)//自动工位 读合格标志
+ // //{
+ // // if (IsEngTypeGetOver_Read(opName))
+ // // {
+ // // //PLC未传递机型 不保存过站信息
+ // // SaveProductLeaveData_AutoWorkStation(opName, Convert.ToInt32(DtWebApi.ReadWritePLC.ReadPLC("21", opName)));
+ // // //SaveProductLeaveData_AutoWorkStation(opName, Convert.ToInt32(MesDataFunction.OpcOperation.ReadPLC(21, opName)));
+ // // }
+
+ // //}
+
+ // ////清空信号
+ // ////m_WorkStart_OpName[opName] = 0;//清空工件到位标志
+ // ////通知WEB更新产量
+ // //SendActuallyCount(opName, 0);
+ //}
+
+ QualityMark = Convert.ToInt32(ReadPLC(21, opName));
+
+ if (QualityMark == 1)
+ {
+ isPass = "1";
+ }
+ else
+ {
+ isPass = "0";
+ }
+ int EngineTypeID;//机型代码
+ int PartPallet_Code;//托盘编号
+ string EngineType;//机型
+ string EngineID;//工件编号
+ string OrderForm;
+ MIS_BASE.GetEngineTypeFromPLC(opName, out EngineTypeID, out EngineType, out EngineID, out PartPallet_Code,out OrderForm);
+
+ //EngineData Enginedata = (EngineData)EngineData_Hash_Read(opName);
+ BaseDataSystemMES.WorkStartInsert_AutoWorkStation(opName, EngineID, PartPallet_Code, arrivedTime, leavedTime, TimeDiff, targetTime, null, isPass, 0);
+
+ }
+
+
+
+ }
+}
diff --git a/Common/09MesDataFunction/MesDataFunction/MisDataFunction/MesRead.cs b/Common/09MesDataFunction/MesDataFunction/MisDataFunction/MesRead.cs
new file mode 100644
index 0000000..f716152
--- /dev/null
+++ b/Common/09MesDataFunction/MesDataFunction/MisDataFunction/MesRead.cs
@@ -0,0 +1,465 @@
+//using BasicData;
+using bizFacade;
+using DoWhatPlc;
+using Newtonsoft.Json;
+//using bizFacade;
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Data;
+//using SystemFramework;
+
+namespace MisDataFunction
+{
+ partial class Function
+ {
+ ///
+ /// 获取质量数据Hashtable
+ ///
+ ///
+ ///
+ //static public Hashtable ReadPLC_Sync_DataList_MesRead(string opName)
+ //{
+ // return (Hashtable)MesDataFunction.OpcOperation.ReadPLC_Sync_DataList_MesRead(opName);
+ //}
+ static object lockerReadPLC_Sync_DataList_MesRead1 = new object();
+ public static void ReadPLC_Sync_DataList_MesRead(string opName, out Hashtable valueList, out DataTable BasicDataTagValue, out DataTable BasicDataTagValueUpDown, out Hashtable hashtable_EngineTypeID, out Hashtable hashtable_tagTable_OpName_SaveData)
+ {
+ //QualityDataSaveList QualityDataType
+ valueList = new Hashtable();
+ //var qualityDataSaveList = DtWebApi.SaveData.ReadPLC_Sync_DataList_MesRead(opName);
+ var qualityDataSaveList = MesServerWork.MIS_BASE.ReadPLC_Sync_DataList_MesRead(opName);
+ foreach (DictionaryEntry de in qualityDataSaveList.valuList)
+ {
+ valueList.Add(de.Key, JsonConvert.DeserializeObject(de.Value.ToString()));
+ }
+ BasicDataTagValue = qualityDataSaveList.BasicDataTagValue;
+ BasicDataTagValueUpDown = qualityDataSaveList.BasicDataTagValueUpDown;
+ hashtable_EngineTypeID = qualityDataSaveList.hashtable_EngineTypeID;
+ hashtable_tagTable_OpName_SaveData = qualityDataSaveList.hashtable_tagTable_OpName_SaveData;
+ }
+ public static Hashtable ReadPLC_Sync_DataList_MesRead(string opName)
+ {
+ lock (lockerReadPLC_Sync_DataList_MesRead1)
+ {
+ Hashtable ht = new Hashtable();
+ var cd = ReadPLC_GroupData(opName);
+ //var cd = PlcLinkForm.ReadPLC_GroupData(opName);
+
+ foreach (var _cd in cd)
+ {
+ var tagID = Convert.ToInt32(_cd.TagID);
+ var TF =_cd.TF;
+
+ QualityDataType qualityDataType;
+ qualityDataType = new QualityDataType();
+
+ qualityDataType.tagID = TF.TagID;
+ qualityDataType.tagTypeID = TF.TagTypeID;//变量类型
+ qualityDataType.opName = opName;
+ qualityDataType.isGoodBad = 192;
+ int.TryParse(TF.TagQuality, out int TagQuality);
+ qualityDataType.tagQuality = TagQuality;
+ qualityDataType.tagValueType = TF.TagTypeCodeID;
+ int.TryParse(TF.TagOrderBy, out int TagOrderBy);
+ qualityDataType.tagOrderBy = TagOrderBy;
+ int.TryParse(TF.TagItemOrderBy, out int TagItemOrderBy);
+ qualityDataType.tagItemOrderBy = TagItemOrderBy;
+ qualityDataType.tagProperty = TF.TagProperty;//变量特点
+ qualityDataType.tagValue = TF.TagValue;//变量值
+
+ ht.Add(tagID, qualityDataType);
+ }
+ return ht;
+ }
+
+ }
+
+ ///
+ /// 允许保存(针对半自动和手动压装工位)
+ ///
+ ///
+ ///
+ private static void MesRead(string opName, string tagValue, int tagid)
+ {
+ if (tagValue == "0")
+ {
+ Write_TagValueByTagTypeID(20, opName, false);
+ }
+ else
+ {
+ SaveQualityData(opName, Convert.ToInt32(tagValue), tagid);
+ }
+ }
+
+ private static void SaveQualityData(string opName, int tagValue, int tagID)
+ {
+ try
+ {
+ int id_tagCF;
+ int qualityMask = 0;
+ int engineTypeID = 0;
+ string engineID = "";
+ string engineType = "";
+ string engineTraceCode = "";
+ string engineCap = "";
+ string partPallet = "";
+ DataTable dt_WWW;
+ dt_WWW = BaseDataSystemMES.BuildDataTables_WWW();
+ Hashtable valueList;
+ //valueList = ReadPLC_Sync_DataList_MesRead(opName);
+ ReadPLC_Sync_DataList_MesRead(opName, out valueList, out BasicDataTagValue, out BasicDataTagValueUpDown, out hashtable_EngineTypeID, out hashtable_tagTable_OpName_SaveData);
+ valueList = GetQualityData_GoodBad_Values(valueList);
+ int mes_MustTest = 0;
+ int onLineState = 0;
+ int partMoveDirection = 0;
+ int pressIsOK = 0;
+ int pressIsNoOK = 0;
+ BaseDataSystemMES.GetQualityDataTable_B5A(valueList, opName, BasicDataTagValue,
+ BasicDataTagValueUpDown,
+ out dt_WWW,//数据列表
+ out qualityMask,//工位合格标志
+ out engineTypeID,//发动机类型代码
+ out engineID,//发动机编号
+ out engineType, //发动机型号
+ out partPallet,//托盘编号
+ out engineTraceCode, //发动机条码
+ out engineCap,//缸盖号,
+ hashtable_EngineTypeID,//发动机类型转换表
+ out mes_MustTest, out onLineState, out partMoveDirection, out pressIsOK, out pressIsNoOK);
+
+
+
+
+ // 1:通过监控系统保存采集的质量数据;0:不通过监控系统保存采集的质量数据
+ if (Convert.ToInt32(hashtable_tagTable_OpName_SaveData[opName]) != 0)
+ {
+ DateTime lastupdatetime = DateTime.Now;
+
+ BaseDataSystemMES.BaseData_tagTable_QualityData_B5A_IndexInsert(engineID, tagID, engineType, engineTypeID, opName, qualityMask, partPallet, out id_tagCF);
+ BaseDataSystemMES.BaseData_tagTable_QualityData_B5A_Insert(id_tagCF, engineTypeID, engineID, opName, dt_WWW);
+
+ }
+ Write_TagValueByTagTypeID(20, opName, true);
+ #region
+ //string orderForm = "";
+ //string operatorCode = "";
+ //int shiftCode = 1;
+ //DateTime arrivedTime;
+ //DateTime leavedTime;
+ //int TimeDiff;
+ //int targetTime = 0;
+ //string lineType = "";
+ //string isPass;
+ //int machineWorkOn = 0;
+ //int arrivedOrLeaved = 2;
+ //int cartColorOpName = 0;
+ //int cartColorConfirm = 0;
+ //// int partMoveDirection;
+ //int partGoOver = 0;
+ //if (qualityMask == 1)
+ //{
+ // isPass = "PASS";
+ //}
+ //else
+ //{
+ // isPass = "FAIL";
+ //}
+
+ ////工位上下线类型
+ ////(0普通工位)(1正常上线)(2正常下线)(3返修上线)(4返修下线)
+ //int OpNameUpDownType;
+ //OpNameUpDownType = Convert.ToInt32(hashtableOpName_OpType[opName]);
+ //arrivedTime = (DateTime)m_WorkStart_OpName_Time[opName];
+ //leavedTime = DateTime.Now;
+ //TimeDiff = Convert.ToInt32(leavedTime.Subtract(arrivedTime).TotalSeconds);
+
+ //lineType = hashtableOpName_LineType[opName].ToString();
+
+ //string isHaveComputer = hashtableOpName_IsHaveComputer[opName].ToString();
+ ////isHaveComputer = MIS_BASE.hashtable_tagTable_OpName_SaveData[opName].ToString();
+ ////有计算机的工位,通过工位计算机保存[测量数据发动机在线状态]。
+ //if (Convert.ToInt32(isHaveComputer) == 0)
+ //{
+ // //1->0 工件离开 工件刚刚离开
+ // if (Convert.ToInt32(m_WorkStart_OpName[opName]) == 1)
+ // {
+
+ // //[测量数据发动机在线状态]
+ // QualityDataSystem.WorkStartInsert
+ // (opName, orderForm, engineTypeID, engineType, engineID, partPallet.ToString(), operatorCode, shiftCode,
+ // arrivedTime, leavedTime, TimeDiff, targetTime, lineType, isPass, machineWorkOn,
+ // arrivedOrLeaved, cartColorOpName, cartColorConfirm, partMoveDirection, partGoOver, mes_MustTest, onLineState, OpNameUpDownType);
+ // }
+ //}
+ #endregion
+ }
+ catch (Exception err)
+ {
+ Write_TagValueByTagTypeID(20, opName, true);
+ ////ApplicationLog.WriteLog(err, err.Message);
+ }
+
+ }
+ public static void SaveQualityData_Mes(string opName, int tagID)
+ {
+ try
+ {
+ int id_tagCF;
+ int qualityMask = 0;
+ int engineTypeID = 0;
+ string engineID = "";
+ string engineType = "";
+ string engineTraceCode = "";
+ string engineCap = "";
+ string partPallet = "";
+ DataTable dt_WWW;
+ dt_WWW = BaseDataSystemMES.BuildDataTables_WWW();
+ Hashtable valueList;
+ valueList = ReadPLC_Sync_DataList_MesRead(opName);
+ valueList = GetQualityData_GoodBad_Values(valueList);
+ int mes_MustTest = 0;
+ int onLineState = 0;
+ int partMoveDirection = 0;
+ int pressIsOK = 0;
+ int pressIsNoOK = 0;
+ BaseDataSystemMES.GetQualityDataTable_B5A(valueList, opName, BasicDataTagValue,
+ BasicDataTagValueUpDown,
+ out dt_WWW,//数据列表
+ out qualityMask,//工位合格标志
+ out engineTypeID,//发动机类型代码
+ out engineID,//发动机编号
+ out engineType, //发动机型号
+ out partPallet,//托盘编号
+ out engineTraceCode, //发动机条码
+ out engineCap,//缸盖号,
+ hashtable_EngineTypeID,//发动机类型转换表
+ out mes_MustTest, out onLineState, out partMoveDirection, out pressIsOK, out pressIsNoOK);
+ // 1:通过监控系统保存采集的质量数据;0:不通过监控系统保存采集的质量数据
+ if (Convert.ToInt32(hashtable_tagTable_OpName_SaveData[opName]) != 0)
+ {
+ DateTime lastupdatetime = DateTime.Now;
+ BaseDataSystemMES.BaseData_tagTable_QualityData_B5A_IndexInsert(engineID, tagID, engineType, engineTypeID, opName, qualityMask, partPallet, out id_tagCF);
+ //BaseDataSystemMES.BaseData_tagTable_QualityData_B5A_Insert(id_tagCF, engineTypeID, engineID, opName, dt_WWW);
+
+ }
+
+
+ }
+ catch (Exception err)
+ {
+ Write_TagValueByTagTypeID(20, opName, true);
+ ////ApplicationLog.WriteLog(err, err.Message);
+ }
+
+ }
+
+ ///
+ /// 确定合格标志
+ ///
+ ///
+ ///
+ static public Hashtable GetQualityData_GoodBad_Values(Hashtable valuList)
+ {
+ try
+ {
+ Hashtable valuList_Temp;
+ valuList_Temp = (Hashtable)valuList.Clone();
+ int[] value_GoodBad_New = new int[128];
+ int tagID;
+ QualityDataType value;
+ //1:获得合格标志
+ foreach (DictionaryEntry de in valuList) //ht为一个Hashtable实例
+ {
+ tagID = Convert.ToInt32(de.Key);
+ value = (QualityDataType)de.Value;
+
+ //拧紧数据合格标志
+ if (value.tagProperty == 1)
+ {
+ if (value.tagTypeID == 8203)
+ {
+ value_GoodBad_New = (int[])value.tagValue;
+ break;
+ }
+ else
+ {
+ value_GoodBad_New[value.tagOrderBy - 1] = Convert.ToInt32(value.tagValue);
+ }
+ }
+ //拧紧数据合格标志
+ if (value.tagProperty == 8)
+ {
+ if (value.tagTypeID == 8203)
+ {
+ value_GoodBad_New = (int[])value.tagValue;
+ break;
+ }
+ else
+ {
+ value_GoodBad_New[value.tagOrderBy - 1] = Convert.ToInt32(value.tagValue);
+ }
+ }
+ //压装数据合格标志
+ if (value.tagProperty == 7)
+ {
+ value_GoodBad_New[value.tagOrderBy - 1] = Convert.ToInt32(value.tagValue);
+ }
+ }
+ //将合格标志赋予每个变量
+ foreach (DictionaryEntry de in valuList) //ht为一个Hashtable实例
+ {
+ tagID = Convert.ToInt32(de.Key);
+ value = (QualityDataType)de.Value;
+ //201706061720新加
+ if (value .tagTypeID ==11)
+ {
+ if (value.tagValue.ToString ()=="False")
+ {
+ value.tagValue ="0";
+ }
+ else
+ {
+ value.tagValue = "1";
+ }
+ valuList_Temp[tagID] = value;
+ //value.tagValue = Convert.ToInt32(value.tagValue);
+ }
+
+
+ //测量变量
+ if (value.tagProperty == 2 || value.tagProperty == 6)
+ {
+ try
+ {
+ if (value_GoodBad_New != null)
+ {
+ value.isGoodBad = Convert.ToInt32(value_GoodBad_New[value.tagOrderBy - 1]);
+ valuList_Temp[tagID] = value;
+ }
+ else
+ {
+ value.isGoodBad = 0;
+ valuList_Temp[tagID] = value;
+ }
+ }
+ catch (Exception err)
+ {
+ ////ApplicationLog.WriteLog(err, err.Message);
+
+ }
+ }
+
+
+
+ }
+ return valuList_Temp;
+ }
+ catch//转换出了故障时
+ {
+ return valuList;
+ }
+ }
+
+
+
+ ///
+ /// 制定工位PLC是否传递过机型 (默认不传递机型不保存过站信息)
+ ///
+ static Hashtable EngTypeGetOver = new Hashtable();
+
+ static Hashtable EngineData_Hash = new Hashtable(); //保存
+
+ public static void IsEngTypeGetOver_Write(string OpName, bool value)
+ {
+ if (EngTypeGetOver.ContainsKey(OpName))
+ {
+ EngTypeGetOver[OpName] = value;
+ }
+ else
+ {
+ EngTypeGetOver.Add(OpName, value);
+ }
+ }
+
+
+ public static bool IsEngTypeGetOver_Read(string OpName)
+ {
+ if (EngTypeGetOver.ContainsKey(OpName))
+ {
+ return Convert.ToBoolean(EngTypeGetOver[OpName]);
+ }
+ else
+ {
+ return true;
+ }
+ }
+
+ public static void EngineData_Hash_Write(string OpName, object value)
+ {
+ if (EngineData_Hash.ContainsKey(OpName))
+ {
+ EngineData_Hash[OpName] = value;
+
+ }
+ else
+ {
+ EngineData_Hash.Add(OpName, value);
+ }
+ }
+
+ public static object EngineData_Hash_Read(string OpName)
+ {
+ if (EngineData_Hash.ContainsKey(OpName))
+ {
+ return EngineData_Hash[OpName];
+ }
+ else
+ {
+ return null;
+ }
+
+ }
+
+
+ private DataTable ChangeQualificationMark(DataTable dt)
+ {
+ var dtNew = dt.Copy();
+ for (int i = 0; i < dt.Rows.Count; i++)
+ {
+ var 变量排序 = dt.Rows[i]["变量排序"].ToString();
+ if (变量排序 == "0")
+ {
+
+ }
+ }
+
+
+ return dtNew;
+ }
+
+
+
+
+ }
+ struct EngineData
+ {
+ public EngineData(string engineID, int pallet)
+ {
+ EngineID = engineID;
+ Pallet = pallet;
+ }
+
+ public string EngineID;//工件编号
+ //public string EngineType;
+ //public int EngineTypeID;
+ public int Pallet;//托盘号
+
+ }
+
+
+
+
+
+
+}
diff --git a/Common/09MesDataFunction/MesDataFunction/MisDataFunction/WorkStart.cs b/Common/09MesDataFunction/MesDataFunction/MisDataFunction/WorkStart.cs
new file mode 100644
index 0000000..0ab46b5
--- /dev/null
+++ b/Common/09MesDataFunction/MesDataFunction/MisDataFunction/WorkStart.cs
@@ -0,0 +1,236 @@
+//using BasicData;
+using bizFacade;
+//using DataBaseAccess;
+//using bizFacade;
+using DataLinkMesWork;
+using MesServerWork;
+using System;
+using System.Collections;
+using System.Data;
+using System.Data.SqlClient;
+//using SystemFramework;
+
+namespace MisDataFunction
+{
+ partial class Function
+ {
+ ///
+ /// 工件到位与离开时,清空MES自身信号
+ ///
+ ///
+ ///
+ private static void WorkStart(string opName, string tagValue)
+ {
+ try
+ {
+ //工位没有工件,或工件刚刚离开 工件离开工位后,清空该工位的发动机号
+ if (tagValue == "0")
+ {
+ Write_TagValueByTagTypeID(5, opName, false);//MES传递机型
+ Write_TagValueByTagTypeID(66, opName, false);//允许工作
+ Write_TagValueByTagTypeID(51, opName, false);//合格放行
+ Write_TagValueByTagTypeID(8, opName, false);//不合格放行
+ Write_TagValueByTagTypeID(7, opName, false);//工作完成
+ Write_TagValueByTagTypeID(20, opName, false);//保存完成
+
+ //string isHaveComputer = hashtableOpName_IsHaveComputer[opName].ToString();
+ //if (Convert.ToInt32(isHaveComputer) == 0)//自动工位 读合格标志
+ {
+ if (IsEngTypeGetOver_Read(opName))
+ {
+ //PLC未传递机型 不保存过站信息
+ SaveProductLeaveData_AutoWorkStation(opName, Convert.ToInt32(Read_TagValueByTagTypeID(21, opName)));
+ //SaveProductLeaveData_AutoWorkStation(opName, Convert.ToInt32(MesDataFunction.OpcOperation.ReadPLC(21, opName)));
+ }
+
+ }
+
+ //清空信号
+ //m_WorkStart_OpName[opName] = 0;//清空工件到位标志
+ //通知WEB更新产量
+ SendActuallyCount(opName,0);
+ }
+ else
+ {
+ //保存工件到达数据
+ //m_WorkStart_OpName_Time[opName] = DateTime.Now;
+ //m_WorkStart_OpName[opName] = 1;
+ }
+
+ }
+ catch (Exception err)
+ {
+ ////ApplicationLog.WriteLog(err, err.Message);
+
+ }
+ }
+ ///
+ /// 保存过站信息 (数据库读机型信息)
+ ///
+ ///
+ ///
+ static void SaveProductLeaveData(string opName, int QualityMark)
+ {
+ try
+ {
+ if (!IsEngTypeGetOver_Read(opName))
+ {
+ //PLC未传递机型 不保存过站信息
+ return;
+ }
+ IsEngTypeGetOver_Write(opName, false);//清空传递机型标志
+
+ DateTime arrivedTime;
+ DateTime leavedTime;
+ int TimeDiff;
+ int targetTime = 0;
+ string lineType = "";
+ string isPass;
+ if (QualityMark == 1)
+ {
+ isPass = "PASS";
+ }
+ else
+ {
+ isPass = "FAIL";
+ }
+ //工位上下线类型
+ //(0普通工位)(1正常上线)(2正常下线)(3返修上线)(4返修下线)
+ int OpNameUpDownType;
+ OpNameUpDownType = Convert.ToInt32(hashtableOpName_OpType[opName]);
+ arrivedTime = (DateTime)m_WorkStart_OpName_Time[opName];
+ leavedTime = DateTime.Now;
+ TimeDiff = Convert.ToInt32(leavedTime.Subtract(arrivedTime).TotalSeconds);
+ lineType = hashtableOpName_LineType[opName].ToString();
+
+ //1->0 工件离开 工件刚刚离开
+ //if (Convert.ToInt32(m_WorkStart_OpName[opName]) == 1)
+ //{
+ // WorkStartInsert(opName, arrivedTime, leavedTime, TimeDiff, targetTime, lineType, isPass, OpNameUpDownType);
+ //}
+ //通知WEB更新产量
+ SendActuallyCount(opName, 0);
+ }
+ catch (Exception err)
+ {
+ ////ApplicationLog.WriteLog(err, err.Message);
+
+ }
+
+
+ }
+ ///
+ /// 保存过站信息 (数据库读机型信息)
+ ///
+ ///
+ ///
+ static void SaveProductLeaveData_AutoWorkStation(string opName, int QualityMark)
+ {
+ try
+ {
+ if (!IsEngTypeGetOver_Read(opName))
+ {
+ //PLC未传递机型 不保存过站信息
+ return;
+ }
+ IsEngTypeGetOver_Write(opName, false);//清空传递机型标志
+
+ DateTime arrivedTime;
+ DateTime leavedTime;
+ int TimeDiff;
+ int targetTime = 0;
+ string lineType = "";
+ string isPass;
+ if (QualityMark == 1)
+ {
+ isPass = "PASS";
+ }
+ else
+ {
+ isPass = "FAIL";
+ }
+ //工位上下线类型
+ //(0普通工位)(1正常上线)(2正常下线)(3返修上线)(4返修下线)
+ int OpNameUpDownType;
+ //OpNameUpDownType = Convert.ToInt32(hashtableOpName_OpType[opName]);
+ // arrivedTime = (DateTime)m_WorkStart_OpName_Time[opName];
+ leavedTime = DateTime.Now;
+ //TimeDiff = Convert.ToInt32(leavedTime.Subtract(arrivedTime).TotalSeconds);
+ //lineType = hashtableOpName_LineType[opName].ToString();
+
+ //1->0 工件离开 工件刚刚离开
+ //if (Convert.ToInt32(m_WorkStart_OpName[opName]) == 1)
+ //{
+ // //查询工件编号、托盘号
+ //EngineData Enginedata = (EngineData)EngineData_Hash_Read(opName);
+ //WorkStartInsert_AutoWorkStation(opName, Enginedata.EngineID, Enginedata.Pallet, arrivedTime, leavedTime, TimeDiff, targetTime, lineType, isPass, OpNameUpDownType);
+ //}
+
+ }
+ catch (Exception err)
+ {
+ ////ApplicationLog.WriteLog(err, err.Message);
+
+ }
+
+
+ }
+
+ ///
+ /// 测量数据发动机在线状态_增加数据
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ static public void WorkStartInsert(string opName, DateTime arrivedTime, DateTime leavedTime, int TimeDiff, int Target, string lineType, string isPass, int OpNameUpDownType)
+ {
+ string procedureName;
+ procedureName = "测量数据发动机在线状态_增加数据";
+ SqlParameter[] thisParms = new SqlParameter[8];
+ thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
+ thisParms[1] = new System.Data.SqlClient.SqlParameter("@到达时间", arrivedTime);
+ thisParms[2] = new System.Data.SqlClient.SqlParameter("@离开时间", leavedTime);
+ thisParms[3] = new System.Data.SqlClient.SqlParameter("@在线时间", TimeDiff);
+ thisParms[4] = new System.Data.SqlClient.SqlParameter("@目标时间", Target);
+ thisParms[5] = new System.Data.SqlClient.SqlParameter("@线体类型", lineType);
+ thisParms[6] = new System.Data.SqlClient.SqlParameter("@是否合格", isPass);
+ thisParms[7] = new System.Data.SqlClient.SqlParameter("@工位上下线类型", OpNameUpDownType);
+ DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
+ }
+
+
+
+ ///
+ /// 发送在线产量、在线节拍
+ ///
+ ///
+ ///
+ static void SendActuallyCount(string OpName, int tagValue)
+ {
+ //当工件离开时,更新在线产量、在线节拍
+ if (tagValue == 0)
+ {
+ try
+ {
+ int opNameCount = 0;//在线产量
+ int opNameCountTime = 0;//在线节拍
+ //基本数据_工作日历_班次产量查询_New
+ BaseDataSystemMES.OpNameCount_New(OpName, out opNameCount, out opNameCountTime);
+
+ string SendMessage;
+ SendMessage = "MES|ActuallyCount|" + OpName + "|" + opNameCount.ToString() + "&" + opNameCountTime.ToString();
+
+ MIS_BASE.asyncSendMessage(SendMessage);
+ }
+ catch (Exception err)
+ {
+ ////ApplicationLog.WriteLog(err, "Function01:SendActuallyCount");
+ }
+ }
+ }
+
+ }
+}
diff --git a/Common/09MesDataFunction/MesDataFunction/Properties/AssemblyInfo.cs b/Common/09MesDataFunction/MesDataFunction/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..057bcf1
--- /dev/null
+++ b/Common/09MesDataFunction/MesDataFunction/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// 有关程序集的一般信息由以下
+// 控制。更改这些特性值可修改
+// 与程序集关联的信息。
+[assembly: AssemblyTitle("MesDataFunction")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("MesDataFunction")]
+[assembly: AssemblyCopyright("Copyright © 2022")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// 将 ComVisible 设置为 false 会使此程序集中的类型
+//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
+//请将此类型的 ComVisible 特性设置为 true。
+[assembly: ComVisible(false)]
+
+// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
+[assembly: Guid("90e76fb4-646d-45e2-95db-0b8ab4e465d6")]
+
+// 程序集的版本信息由下列四个值组成:
+//
+// 主版本
+// 次版本
+// 生成号
+// 修订号
+//
+//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
+//通过使用 "*",如下所示:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Common/09MesDataFunction/MesDataFunction/ToPrinter/PP.cs b/Common/09MesDataFunction/MesDataFunction/ToPrinter/PP.cs
new file mode 100644
index 0000000..a861074
--- /dev/null
+++ b/Common/09MesDataFunction/MesDataFunction/ToPrinter/PP.cs
@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace MesDataFunction
+{
+ public class PP
+ {
+
+ public static string ConnectionString_MES { get; set; }
+ public static string PrintURL { get; set; }
+ public static int IsDemoMesServer { get; set; }
+
+
+
+
+
+
+
+
+ }
+}
diff --git a/Common/09MesDataFunction/MesDataFunction/ToPrinter/PrintTo.cs b/Common/09MesDataFunction/MesDataFunction/ToPrinter/PrintTo.cs
new file mode 100644
index 0000000..7e3d91d
--- /dev/null
+++ b/Common/09MesDataFunction/MesDataFunction/ToPrinter/PrintTo.cs
@@ -0,0 +1,65 @@
+using MesWork;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace MesDataFunction
+{
+ public class PrintTo
+ {
+
+ ///
+ ///
+ ///
+ ///
+ public static bool Print(bool isSinglePrint,string url,string[] strArray)
+ {
+ if (PP.IsDemoMesServer == 1)
+ {
+ var list = new List();
+ foreach (string str in strArray)
+ {
+ var printStr = str;
+ if (isSinglePrint)
+ {
+ printStr = str.Replace("^XB", "");
+ }
+ list.Add(printStr);
+ }
+
+ File.WriteAllText($"PrintContent_{DateTime .Now.ToString ("yyyy_MM_dd_HH_mm_ss")}.print", string.Join (" ", list));
+
+ return true;
+ }
+
+
+ var sucess = false;
+ try
+ {
+ var client = new System.Net.Sockets.TcpClient();
+ client.Connect(url.Split(':')[0], Convert.ToInt32(url.Split(':')[1]));
+
+ foreach (string str in strArray)
+ {
+ var printStr = str;
+ if (isSinglePrint)
+ {
+ printStr = str.Replace("^XB", "");
+ }
+ client.Client.Send(System.Text.Encoding.ASCII.GetBytes(printStr));
+ }
+ client.Close();
+
+ sucess = true;
+ }
+ catch (Exception err) { }
+
+ return sucess;
+ }
+
+
+ }
+}
diff --git a/Common/09MesDataFunction/MesDataFunction/ToPrinter/Print_Sql.cs b/Common/09MesDataFunction/MesDataFunction/ToPrinter/Print_Sql.cs
new file mode 100644
index 0000000..69fb29d
--- /dev/null
+++ b/Common/09MesDataFunction/MesDataFunction/ToPrinter/Print_Sql.cs
@@ -0,0 +1,80 @@
+using MesDataFunction;
+using MesWork;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace MesDataFunction
+{
+ public class Print_Sql
+ {
+
+
+ public static bool Select_Print_Template(out DataTable dt_Print_Template)
+ {
+ /*
+SELECT [IDG],[TemplateName],[TemplateContent],[DefSelect],[UpdateTime] FROM [OL_Repair_Print_Template]
+ */
+
+ bool success = false;
+ var sql =
+@"
+SELECT [IDG],[TemplateName],[DefSelect],[UpdateTime] FROM [OL_Repair_Print_Template]
+ORDER BY [UpdateTime]
+";
+ success = DataLinkMesWork.SQLCommon.ExecuteDataTable(sql, PP.ConnectionString_MES, out DataTable dt, out string err2);
+ dt_Print_Template = dt;
+ return success;
+
+ }
+
+ public static bool Select_Print_TemplateStr(string IDG, out string templateStr)
+ {
+ /*
+SELECT [IDG],[TemplateName],[TemplateContent],[DefSelect],[UpdateTime] FROM [OL_Repair_Print_Template]
+ */
+ templateStr = "";
+ bool success = false;
+ var sql =
+ $" DECLARE @IDG nvarchar(50) = '{IDG}'" +
+@"
+SELECT [TemplateContent] FROM [OL_Repair_Print_Template]
+WHERE [IDG] = @IDG
+";
+ success = DataLinkMesWork.SQLCommon.ExecuteDataTable(sql, PP.ConnectionString_MES, out DataTable dt, out string err2);
+ if (dt.Rows.Count > 0)
+ {
+ templateStr = dt.Rows[0]["TemplateContent"].ToString();
+ }
+ return success;
+
+ }
+
+ public static bool Select_Print_Template_Def(out string templateStr)
+ {
+ /*
+SELECT [IDG],[TemplateName],[TemplateContent],[DefSelect],[UpdateTime] FROM [OL_Repair_Print_Template]
+ */
+ templateStr = "";
+ bool success = false;
+ var sql =
+@"
+SELECT top 1 [TemplateContent] FROM [OL_Repair_Print_Template]
+WHERE [DefSelect]= 'True'
+";
+ success = DataLinkMesWork.SQLCommon.ExecuteDataTable(sql, PP.ConnectionString_MES, out DataTable dt, out string err2);
+ if (dt.Rows.Count > 0)
+ {
+ templateStr = dt.Rows[0]["TemplateContent"].ToString();
+ }
+ return success;
+
+ }
+
+
+ }
+}
diff --git a/Common/09MesDataFunction/MesDataFunction/ToPrinter/PrinterCommandCenter.cs b/Common/09MesDataFunction/MesDataFunction/ToPrinter/PrinterCommandCenter.cs
new file mode 100644
index 0000000..9b83dcc
--- /dev/null
+++ b/Common/09MesDataFunction/MesDataFunction/ToPrinter/PrinterCommandCenter.cs
@@ -0,0 +1,33 @@
+using MesWork;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace MesDataFunction
+{
+ public class PrinterCommandCenter
+ {
+
+ public static bool PrintToPrinter(string code)
+ {
+ bool success = false;
+
+ Print_Sql.Select_Print_Template_Def(out string templateStr);
+ var printContent = Template_Make_Zpl(templateStr, code);
+
+ PrintTo.Print(true, PP.PrintURL, new string[] { printContent });
+
+ return success;
+ }
+
+
+ public static string Template_Make_Zpl(string templateStr,string TowCode)
+ {
+ return templateStr.Replace("@TowCode", TowCode);
+ }
+
+
+ }
+}
diff --git a/Common/MyLog4Net/00_MyLog4Net.csproj b/Common/MyLog4Net/00_MyLog4Net.csproj
new file mode 100644
index 0000000..1c1c6ad
--- /dev/null
+++ b/Common/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/Common/MyLog4Net/MyLogEventArgs.cs b/Common/MyLog4Net/MyLogEventArgs.cs
new file mode 100644
index 0000000..a913363
--- /dev/null
+++ b/Common/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/Common/MyLog4Net/MyLogHelper.cs b/Common/MyLog4Net/MyLogHelper.cs
new file mode 100644
index 0000000..cb446e4
--- /dev/null
+++ b/Common/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/Common/MyLog4Net/Properties/AssemblyInfo.cs b/Common/MyLog4Net/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..1228254
--- /dev/null
+++ b/Common/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/Common/MyLog4Net/log4net.config b/Common/MyLog4Net/log4net.config
new file mode 100644
index 0000000..92f4d40
--- /dev/null
+++ b/Common/MyLog4Net/log4net.config
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Common/MyLog4Net/packages.config b/Common/MyLog4Net/packages.config
new file mode 100644
index 0000000..a0798f9
--- /dev/null
+++ b/Common/MyLog4Net/packages.config
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/DatabaseScripts/AGV举升回调_现场总装.sql b/DatabaseScripts/AGV举升回调_现场总装.sql
new file mode 100644
index 0000000..0a24d11
--- /dev/null
+++ b/DatabaseScripts/AGV举升回调_现场总装.sql
@@ -0,0 +1,95 @@
+-- 现场总装数据库:MESBasicDB_XD_ZZ
+-- 用途:支持 AGV lower/raise 回调与 PLC 允许下降/举升放行查询。
+-- 说明:请在目标库手工执行。本脚本不直接修改 AGV_光栅请求记录 表结构。
+
+SET NOCOUNT ON;
+GO
+
+-- 1. 增加变量类型代码。500/501 是 MES 写 PLC 请求位,550/551 是 PLC 允许位。
+IF NOT EXISTS (SELECT 1 FROM [dbo].[MES_基本变量变量类型代码] WHERE [变量类型代码] = 500)
+BEGIN
+ INSERT INTO [dbo].[MES_基本变量变量类型代码]
+ ([变量类型], [TagTypeDataType], [TagName], [变量类型代码], [TagTypeChange], [MesTagTypeChange], [WebTagTypeChange], [信号点名称], [变量类型名称])
+ VALUES
+ (N'X', 11, N'AGV请求下降', 500, 1, 0, 1, N'AGV请求下降', N'AGV请求下降');
+END
+
+IF NOT EXISTS (SELECT 1 FROM [dbo].[MES_基本变量变量类型代码] WHERE [变量类型代码] = 501)
+BEGIN
+ INSERT INTO [dbo].[MES_基本变量变量类型代码]
+ ([变量类型], [TagTypeDataType], [TagName], [变量类型代码], [TagTypeChange], [MesTagTypeChange], [WebTagTypeChange], [信号点名称], [变量类型名称])
+ VALUES
+ (N'X', 11, N'AGV请求举升', 501, 1, 0, 1, N'AGV请求举升', N'AGV请求举升');
+END
+
+IF NOT EXISTS (SELECT 1 FROM [dbo].[MES_基本变量变量类型代码] WHERE [变量类型代码] = 550)
+BEGIN
+ INSERT INTO [dbo].[MES_基本变量变量类型代码]
+ ([变量类型], [TagTypeDataType], [TagName], [变量类型代码], [TagTypeChange], [MesTagTypeChange], [WebTagTypeChange], [信号点名称], [变量类型名称])
+ VALUES
+ (N'X', 11, N'允许AGV下降', 550, 1, 0, 1, N'允许AGV下降', N'允许AGV下降');
+END
+
+IF NOT EXISTS (SELECT 1 FROM [dbo].[MES_基本变量变量类型代码] WHERE [变量类型代码] = 551)
+BEGIN
+ INSERT INTO [dbo].[MES_基本变量变量类型代码]
+ ([变量类型], [TagTypeDataType], [TagName], [变量类型代码], [TagTypeChange], [MesTagTypeChange], [WebTagTypeChange], [信号点名称], [变量类型名称])
+ VALUES
+ (N'X', 11, N'允许AGV举升', 551, 1, 0, 1, N'允许AGV举升', N'允许AGV举升');
+END
+GO
+
+-- 2. 扩展 AGV continueTask 放行查询。
+-- apply/release 保持原有 XD_库位Moby 查询。
+-- lower/raise 从 AGV_光栅请求记录 取最新未允许或最近请求,避免改动 XD_库位Moby 与历史表列顺序。
+ALTER PROCEDURE [dbo].[AGV_允许进入离开_查询]
+ @opName nvarchar(50) = 'AC0901-02',
+ @engineID nvarchar(50) = '0',
+ @type nvarchar(50) = 'apply'
+AS
+BEGIN
+ SET NOCOUNT ON;
+
+ IF (@type = 'apply')
+ BEGIN
+ SELECT [进入req] AS reqCode, [进入task] AS taskCode
+ FROM [dbo].[XD_库位Moby]
+ WHERE [库位号] = @opName
+ AND [AGV请求进入时间] IS NOT NULL;
+ END
+
+ IF (@type = 'release')
+ BEGIN
+ SELECT [离开req] AS reqCode, [离开task] AS taskCode
+ FROM [dbo].[XD_库位Moby]
+ WHERE [库位号] = @opName
+ AND [AGV请求离开时间] IS NOT NULL;
+ END
+
+ IF (@type = 'lower')
+ BEGIN
+ SELECT TOP 1 [reqCode], [taskCode]
+ FROM [dbo].[AGV_光栅请求记录]
+ WHERE [method] = 'lower'
+ AND (
+ [currentPositionCode] = @opName
+ OR [currentPositionCode] LIKE @opName + N'[_]%'
+ OR [wbCode] = @opName
+ )
+ ORDER BY ISNULL([是否允许], 0) ASC, [创建时间] DESC, [ID] DESC;
+ END
+
+ IF (@type = 'raise')
+ BEGIN
+ SELECT TOP 1 [reqCode], [taskCode]
+ FROM [dbo].[AGV_光栅请求记录]
+ WHERE [method] = 'raise'
+ AND (
+ [currentPositionCode] = @opName
+ OR [currentPositionCode] LIKE @opName + N'[_]%'
+ OR [wbCode] = @opName
+ )
+ ORDER BY ISNULL([是否允许], 0) ASC, [创建时间] DESC, [ID] DESC;
+ END
+END
+GO
diff --git a/DatabaseScripts/XD_电能表谐波数据.sql b/DatabaseScripts/XD_电能表谐波数据.sql
new file mode 100644
index 0000000..8c6308a
--- /dev/null
+++ b/DatabaseScripts/XD_电能表谐波数据.sql
@@ -0,0 +1,173 @@
+IF OBJECT_ID(N'dbo.XD_电能表谐波数据', N'U') IS NULL
+BEGIN
+ CREATE TABLE dbo.XD_电能表谐波数据
+ (
+ ID int IDENTITY(1,1) NOT NULL,
+ 工位号 nvarchar(50) NULL,
+ A相电压总谐波畸变 float NULL,
+ B相电压总谐波畸变 float NULL,
+ C相电压总谐波畸变 float NULL,
+ 系统电压总谐波畸变 float NULL,
+ A相电流总谐波畸变 float NULL,
+ B相电流总谐波畸变 float NULL,
+ C相电流总谐波畸变 float NULL,
+ 系统电流总谐波畸变 float NULL,
+ A相电压奇次谐波畸变 float NULL,
+ B相电压奇次谐波畸变 float NULL,
+ C相电压奇次谐波畸变 float NULL,
+ A相电流奇次谐波畸变 float NULL,
+ B相电流奇次谐波畸变 float NULL,
+ C相电流奇次谐波畸变 float NULL,
+ A相电压偶次谐波畸变 float NULL,
+ B相电压偶次谐波畸变 float NULL,
+ C相电压偶次谐波畸变 float NULL,
+ A相电流偶次谐波畸变 float NULL,
+ B相电流偶次谐波畸变 float NULL,
+ C相电流偶次谐波畸变 float NULL,
+ 操作时间 datetime NULL CONSTRAINT DF_XD_电能表谐波数据_操作时间 DEFAULT (GETDATE()),
+ CONSTRAINT PK_XD_电能表谐波数据 PRIMARY KEY CLUSTERED (ID ASC)
+ );
+END
+GO
+
+IF NOT EXISTS (
+ SELECT 1
+ FROM sys.indexes
+ WHERE name = N'IX_XD_电能表谐波数据_工位号_操作时间'
+ AND object_id = OBJECT_ID(N'dbo.XD_电能表谐波数据')
+)
+BEGIN
+ CREATE NONCLUSTERED INDEX IX_XD_电能表谐波数据_工位号_操作时间
+ ON dbo.XD_电能表谐波数据 (工位号 ASC, 操作时间 DESC);
+END
+GO
+
+IF OBJECT_ID(N'dbo.XD_电能表谐波数据_增加', N'P') IS NOT NULL
+ DROP PROCEDURE dbo.XD_电能表谐波数据_增加;
+GO
+
+CREATE PROCEDURE dbo.XD_电能表谐波数据_增加
+ @工位号 nvarchar(50) = N'',
+ @A相电压总谐波畸变 float = NULL,
+ @B相电压总谐波畸变 float = NULL,
+ @C相电压总谐波畸变 float = NULL,
+ @系统电压总谐波畸变 float = NULL,
+ @A相电流总谐波畸变 float = NULL,
+ @B相电流总谐波畸变 float = NULL,
+ @C相电流总谐波畸变 float = NULL,
+ @系统电流总谐波畸变 float = NULL,
+ @A相电压奇次谐波畸变 float = NULL,
+ @B相电压奇次谐波畸变 float = NULL,
+ @C相电压奇次谐波畸变 float = NULL,
+ @A相电流奇次谐波畸变 float = NULL,
+ @B相电流奇次谐波畸变 float = NULL,
+ @C相电流奇次谐波畸变 float = NULL,
+ @A相电压偶次谐波畸变 float = NULL,
+ @B相电压偶次谐波畸变 float = NULL,
+ @C相电压偶次谐波畸变 float = NULL,
+ @A相电流偶次谐波畸变 float = NULL,
+ @B相电流偶次谐波畸变 float = NULL,
+ @C相电流偶次谐波畸变 float = NULL
+AS
+BEGIN
+ SET NOCOUNT ON;
+
+ IF NULLIF(LTRIM(RTRIM(@工位号)), N'') IS NULL
+ RETURN;
+
+ -- 电表返回 -1 表示无效数据;任一谐波点无效时,本次整条采集不入库。
+ IF @A相电压总谐波畸变 = -1
+ OR @B相电压总谐波畸变 = -1
+ OR @C相电压总谐波畸变 = -1
+ OR @系统电压总谐波畸变 = -1
+ OR @A相电流总谐波畸变 = -1
+ OR @B相电流总谐波畸变 = -1
+ OR @C相电流总谐波畸变 = -1
+ OR @系统电流总谐波畸变 = -1
+ OR @A相电压奇次谐波畸变 = -1
+ OR @B相电压奇次谐波畸变 = -1
+ OR @C相电压奇次谐波畸变 = -1
+ OR @A相电流奇次谐波畸变 = -1
+ OR @B相电流奇次谐波畸变 = -1
+ OR @C相电流奇次谐波畸变 = -1
+ OR @A相电压偶次谐波畸变 = -1
+ OR @B相电压偶次谐波畸变 = -1
+ OR @C相电压偶次谐波畸变 = -1
+ OR @A相电流偶次谐波畸变 = -1
+ OR @B相电流偶次谐波畸变 = -1
+ OR @C相电流偶次谐波畸变 = -1
+ RETURN;
+
+ -- 谐波畸变允许为 0;只有全部点位都为空时跳过保存。
+ IF @A相电压总谐波畸变 IS NULL
+ AND @B相电压总谐波畸变 IS NULL
+ AND @C相电压总谐波畸变 IS NULL
+ AND @系统电压总谐波畸变 IS NULL
+ AND @A相电流总谐波畸变 IS NULL
+ AND @B相电流总谐波畸变 IS NULL
+ AND @C相电流总谐波畸变 IS NULL
+ AND @系统电流总谐波畸变 IS NULL
+ AND @A相电压奇次谐波畸变 IS NULL
+ AND @B相电压奇次谐波畸变 IS NULL
+ AND @C相电压奇次谐波畸变 IS NULL
+ AND @A相电流奇次谐波畸变 IS NULL
+ AND @B相电流奇次谐波畸变 IS NULL
+ AND @C相电流奇次谐波畸变 IS NULL
+ AND @A相电压偶次谐波畸变 IS NULL
+ AND @B相电压偶次谐波畸变 IS NULL
+ AND @C相电压偶次谐波畸变 IS NULL
+ AND @A相电流偶次谐波畸变 IS NULL
+ AND @B相电流偶次谐波畸变 IS NULL
+ AND @C相电流偶次谐波畸变 IS NULL
+ RETURN;
+
+ INSERT INTO dbo.XD_电能表谐波数据
+ (
+ 工位号,
+ A相电压总谐波畸变,
+ B相电压总谐波畸变,
+ C相电压总谐波畸变,
+ 系统电压总谐波畸变,
+ A相电流总谐波畸变,
+ B相电流总谐波畸变,
+ C相电流总谐波畸变,
+ 系统电流总谐波畸变,
+ A相电压奇次谐波畸变,
+ B相电压奇次谐波畸变,
+ C相电压奇次谐波畸变,
+ A相电流奇次谐波畸变,
+ B相电流奇次谐波畸变,
+ C相电流奇次谐波畸变,
+ A相电压偶次谐波畸变,
+ B相电压偶次谐波畸变,
+ C相电压偶次谐波畸变,
+ A相电流偶次谐波畸变,
+ B相电流偶次谐波畸变,
+ C相电流偶次谐波畸变
+ )
+ VALUES
+ (
+ @工位号,
+ @A相电压总谐波畸变 / 1000.0,
+ @B相电压总谐波畸变 / 1000.0,
+ @C相电压总谐波畸变 / 1000.0,
+ @系统电压总谐波畸变 / 1000.0,
+ @A相电流总谐波畸变 / 1000.0,
+ @B相电流总谐波畸变 / 1000.0,
+ @C相电流总谐波畸变 / 1000.0,
+ @系统电流总谐波畸变 / 1000.0,
+ @A相电压奇次谐波畸变 / 1000.0,
+ @B相电压奇次谐波畸变 / 1000.0,
+ @C相电压奇次谐波畸变 / 1000.0,
+ @A相电流奇次谐波畸变 / 1000.0,
+ @B相电流奇次谐波畸变 / 1000.0,
+ @C相电流奇次谐波畸变 / 1000.0,
+ @A相电压偶次谐波畸变 / 1000.0,
+ @B相电压偶次谐波畸变 / 1000.0,
+ @C相电压偶次谐波畸变 / 1000.0,
+ @A相电流偶次谐波畸变 / 1000.0,
+ @B相电流偶次谐波畸变 / 1000.0,
+ @C相电流偶次谐波畸变 / 1000.0
+ );
+END
+GO
diff --git a/Interface_WebAPI/CallWebApi/03_CallWebApi.csproj b/Interface_WebAPI/CallWebApi/03_CallWebApi.csproj
new file mode 100644
index 0000000..61ad5b8
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/CallWebApi/App.config b/Interface_WebAPI/CallWebApi/App.config
new file mode 100644
index 0000000..6043180
--- /dev/null
+++ b/Interface_WebAPI/CallWebApi/App.config
@@ -0,0 +1,57 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Interface_WebAPI/CallWebApi/CallWebApi.cs b/Interface_WebAPI/CallWebApi/CallWebApi.cs
new file mode 100644
index 0000000..095318a
--- /dev/null
+++ b/Interface_WebAPI/CallWebApi/CallWebApi.cs
@@ -0,0 +1,257 @@
+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 Post_XK(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/Interface_WebAPI/CallWebApi/Program.cs b/Interface_WebAPI/CallWebApi/Program.cs
new file mode 100644
index 0000000..aaf6a2d
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/CallWebApi/Properties/AssemblyInfo.cs b/Interface_WebAPI/CallWebApi/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..7fca5ca
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/CallWebApi/packages.config b/Interface_WebAPI/CallWebApi/packages.config
new file mode 100644
index 0000000..ce3dc38
--- /dev/null
+++ b/Interface_WebAPI/CallWebApi/packages.config
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/Interface_WebAPI/DLL/BasicData.dll b/Interface_WebAPI/DLL/BasicData.dll
new file mode 100644
index 0000000..2531c4d
Binary files /dev/null and b/Interface_WebAPI/DLL/BasicData.dll differ
diff --git a/Interface_WebAPI/DLL/DataLinkMesWork.dll b/Interface_WebAPI/DLL/DataLinkMesWork.dll
new file mode 100644
index 0000000..57fcd25
Binary files /dev/null and b/Interface_WebAPI/DLL/DataLinkMesWork.dll differ
diff --git a/Interface_WebAPI/DLL/ICSharpCode.SharpZipLib.dll b/Interface_WebAPI/DLL/ICSharpCode.SharpZipLib.dll
new file mode 100644
index 0000000..84e8c68
Binary files /dev/null and b/Interface_WebAPI/DLL/ICSharpCode.SharpZipLib.dll differ
diff --git a/Interface_WebAPI/DLL/NPOI.OOXML.dll b/Interface_WebAPI/DLL/NPOI.OOXML.dll
new file mode 100644
index 0000000..031d41d
Binary files /dev/null and b/Interface_WebAPI/DLL/NPOI.OOXML.dll differ
diff --git a/Interface_WebAPI/DLL/NPOI.OpenXml4Net.dll b/Interface_WebAPI/DLL/NPOI.OpenXml4Net.dll
new file mode 100644
index 0000000..8da4ac2
Binary files /dev/null and b/Interface_WebAPI/DLL/NPOI.OpenXml4Net.dll differ
diff --git a/Interface_WebAPI/DLL/NPOI.OpenXmlFormats.dll b/Interface_WebAPI/DLL/NPOI.OpenXmlFormats.dll
new file mode 100644
index 0000000..4a8f87b
Binary files /dev/null and b/Interface_WebAPI/DLL/NPOI.OpenXmlFormats.dll differ
diff --git a/Interface_WebAPI/DLL/NPOI.dll b/Interface_WebAPI/DLL/NPOI.dll
new file mode 100644
index 0000000..1a500e9
Binary files /dev/null and b/Interface_WebAPI/DLL/NPOI.dll differ
diff --git a/Interface_WebAPI/DLL/Newtonsoft.Json.dll b/Interface_WebAPI/DLL/Newtonsoft.Json.dll
new file mode 100644
index 0000000..7af125a
Binary files /dev/null and b/Interface_WebAPI/DLL/Newtonsoft.Json.dll differ
diff --git a/Interface_WebAPI/DatabaseClient/01_DatabaseClient.csproj b/Interface_WebAPI/DatabaseClient/01_DatabaseClient.csproj
new file mode 100644
index 0000000..c05ab38
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/DatabaseClient/App.config b/Interface_WebAPI/DatabaseClient/App.config
new file mode 100644
index 0000000..fbf0811
--- /dev/null
+++ b/Interface_WebAPI/DatabaseClient/App.config
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Interface_WebAPI/DatabaseClient/DBClient.cs b/Interface_WebAPI/DatabaseClient/DBClient.cs
new file mode 100644
index 0000000..96ee82d
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/DatabaseClient/DBClientFactory.cs b/Interface_WebAPI/DatabaseClient/DBClientFactory.cs
new file mode 100644
index 0000000..cffba85
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/DatabaseClient/DBClientLog4net.config b/Interface_WebAPI/DatabaseClient/DBClientLog4net.config
new file mode 100644
index 0000000..2842f30
--- /dev/null
+++ b/Interface_WebAPI/DatabaseClient/DBClientLog4net.config
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Interface_WebAPI/DatabaseClient/DatabaseFactory.cs b/Interface_WebAPI/DatabaseClient/DatabaseFactory.cs
new file mode 100644
index 0000000..240cf43
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/DatabaseClient/GlobalVar.cs b/Interface_WebAPI/DatabaseClient/GlobalVar.cs
new file mode 100644
index 0000000..15deaac
--- /dev/null
+++ b/Interface_WebAPI/DatabaseClient/GlobalVar.cs
@@ -0,0 +1,9 @@
+using log4net;
+
+namespace DatabaseClient
+{
+ class GlobalVar
+ {
+ public static ILog log = LogManager.GetLogger("DBClient");
+ }
+}
diff --git a/Interface_WebAPI/DatabaseClient/MssqlClient.cs b/Interface_WebAPI/DatabaseClient/MssqlClient.cs
new file mode 100644
index 0000000..9e5b022
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/DatabaseClient/MysqlClient.cs b/Interface_WebAPI/DatabaseClient/MysqlClient.cs
new file mode 100644
index 0000000..a22e42f
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/DatabaseClient/Program.cs b/Interface_WebAPI/DatabaseClient/Program.cs
new file mode 100644
index 0000000..9f03a4b
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/DatabaseClient/Properties/AssemblyInfo.cs b/Interface_WebAPI/DatabaseClient/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..8b1127e
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/DatabaseClient/SqliteClient.cs b/Interface_WebAPI/DatabaseClient/SqliteClient.cs
new file mode 100644
index 0000000..051c462
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/DatabaseClient/packages.config b/Interface_WebAPI/DatabaseClient/packages.config
new file mode 100644
index 0000000..2a1becf
--- /dev/null
+++ b/Interface_WebAPI/DatabaseClient/packages.config
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Interface_WebAPI/ExternalDataSyncSln.sln b/Interface_WebAPI/ExternalDataSyncSln.sln
new file mode 100644
index 0000000..2b5d944
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/MyLog4Net/00_MyLog4Net.csproj b/Interface_WebAPI/MyLog4Net/00_MyLog4Net.csproj
new file mode 100644
index 0000000..1c1c6ad
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/MyLog4Net/MyLogEventArgs.cs b/Interface_WebAPI/MyLog4Net/MyLogEventArgs.cs
new file mode 100644
index 0000000..a913363
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/MyLog4Net/MyLogHelper.cs b/Interface_WebAPI/MyLog4Net/MyLogHelper.cs
new file mode 100644
index 0000000..cb446e4
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/MyLog4Net/Properties/AssemblyInfo.cs b/Interface_WebAPI/MyLog4Net/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..1228254
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/MyLog4Net/log4net.config b/Interface_WebAPI/MyLog4Net/log4net.config
new file mode 100644
index 0000000..92f4d40
--- /dev/null
+++ b/Interface_WebAPI/MyLog4Net/log4net.config
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Interface_WebAPI/MyLog4Net/packages.config b/Interface_WebAPI/MyLog4Net/packages.config
new file mode 100644
index 0000000..a0798f9
--- /dev/null
+++ b/Interface_WebAPI/MyLog4Net/packages.config
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_base/ExternalDataSync.ESB_base.baseResponse.datasource b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_base/ExternalDataSync.ESB_base.baseResponse.datasource
new file mode 100644
index 0000000..1678cd8
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_base/ExternalDataSync.ESB_base.interfaceResponse.datasource b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_base/ExternalDataSync.ESB_base.interfaceResponse.datasource
new file mode 100644
index 0000000..24b0918
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_base/Reference.cs b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_base/Reference.cs
new file mode 100644
index 0000000..9aae7fb
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_base/Reference.svcmap b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_base/Reference.svcmap
new file mode 100644
index 0000000..25b3409
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_base/UrmRsBaseInterface2.wsdl b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_base/UrmRsBaseInterface2.wsdl
new file mode 100644
index 0000000..acb39bf
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_base/UrmRsBaseInterface2.wsdl
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_base/configuration.svcinfo b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_base/configuration.svcinfo
new file mode 100644
index 0000000..c56d4c7
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_base/configuration.svcinfo
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_base/configuration91.svcinfo b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_base/configuration91.svcinfo
new file mode 100644
index 0000000..f56e88e
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_base/urmRsBaseInterface.wsdl b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_base/urmRsBaseInterface.wsdl
new file mode 100644
index 0000000..3d02d0b
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_base/urmRsBaseInterface.wsdl
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ OSB Service
+
+
+
+
+
\ No newline at end of file
diff --git a/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_collt/ColltReInterface2.wsdl b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_collt/ColltReInterface2.wsdl
new file mode 100644
index 0000000..51cca5a
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_collt/ColltReInterface2.wsdl
@@ -0,0 +1,71 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_collt/ExternalDataSync.ESB_collt.colltResponse.datasource b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_collt/ExternalDataSync.ESB_collt.colltResponse.datasource
new file mode 100644
index 0000000..3563b3d
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_collt/ExternalDataSync.ESB_collt.interfaceResponse.datasource b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_collt/ExternalDataSync.ESB_collt.interfaceResponse.datasource
new file mode 100644
index 0000000..93bf208
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_collt/Reference.cs b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_collt/Reference.cs
new file mode 100644
index 0000000..f3d6f5d
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_collt/Reference.svcmap b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_collt/Reference.svcmap
new file mode 100644
index 0000000..063ba59
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_collt/colltReInterface.wsdl b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_collt/colltReInterface.wsdl
new file mode 100644
index 0000000..a112612
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_collt/colltReInterface.wsdl
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ OSB Service
+
+
+
+
+
\ No newline at end of file
diff --git a/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_collt/configuration.svcinfo b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_collt/configuration.svcinfo
new file mode 100644
index 0000000..1deb5af
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_collt/configuration.svcinfo
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_collt/configuration91.svcinfo b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_collt/configuration91.svcinfo
new file mode 100644
index 0000000..e574fda
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_daq/.editorconfig b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_daq/.editorconfig
new file mode 100644
index 0000000..e69de29
diff --git a/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_daq/ExternalDataSync.ESB_daq.daqResponse.datasource b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_daq/ExternalDataSync.ESB_daq.daqResponse.datasource
new file mode 100644
index 0000000..1cf722c
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_daq/ExternalDataSync.ESB_daq.interfaceResponse.datasource b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_daq/ExternalDataSync.ESB_daq.interfaceResponse.datasource
new file mode 100644
index 0000000..bb7d07b
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_daq/Reference.cs b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_daq/Reference.cs
new file mode 100644
index 0000000..e745675
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_daq/Reference.svcmap b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_daq/Reference.svcmap
new file mode 100644
index 0000000..eea5ee6
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_daq/UexDaqInfoInterface2.wsdl b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_daq/UexDaqInfoInterface2.wsdl
new file mode 100644
index 0000000..73c1449
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_daq/UexDaqInfoInterface2.wsdl
@@ -0,0 +1,70 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_daq/configuration.svcinfo b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_daq/configuration.svcinfo
new file mode 100644
index 0000000..d480da5
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_daq/configuration.svcinfo
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_daq/configuration91.svcinfo b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_daq/configuration91.svcinfo
new file mode 100644
index 0000000..78e55eb
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_daq/uexDaqInfoInterface.wsdl b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_daq/uexDaqInfoInterface.wsdl
new file mode 100644
index 0000000..8c27c45
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_daq/uexDaqInfoInterface.wsdl
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ OSB Service
+
+
+
+
+
\ No newline at end of file
diff --git a/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_energy/ExternalDataSync.ESB_energy.energyResponse.datasource b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_energy/ExternalDataSync.ESB_energy.energyResponse.datasource
new file mode 100644
index 0000000..a51c555
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_energy/ExternalDataSync.ESB_energy.interfaceResponse.datasource b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_energy/ExternalDataSync.ESB_energy.interfaceResponse.datasource
new file mode 100644
index 0000000..d4d200c
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_energy/PctEnergyInfoInterface1.wsdl b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_energy/PctEnergyInfoInterface1.wsdl
new file mode 100644
index 0000000..973cd45
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_energy/PctEnergyInfoInterface1.wsdl
@@ -0,0 +1,61 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_energy/Reference.cs b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_energy/Reference.cs
new file mode 100644
index 0000000..c62e567
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_energy/Reference.svcmap b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_energy/Reference.svcmap
new file mode 100644
index 0000000..d5df003
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_energy/configuration.svcinfo b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_energy/configuration.svcinfo
new file mode 100644
index 0000000..505dfb2
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_energy/configuration.svcinfo
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_energy/configuration91.svcinfo b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_energy/configuration91.svcinfo
new file mode 100644
index 0000000..9fe0e55
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_energy/pctEnergyInfoInterface.wsdl b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_energy/pctEnergyInfoInterface.wsdl
new file mode 100644
index 0000000..c3416bd
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_energy/pctEnergyInfoInterface.wsdl
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ OSB Service
+
+
+
+
+
\ No newline at end of file
diff --git a/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_excep/EquipExceInterface2.wsdl b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_excep/EquipExceInterface2.wsdl
new file mode 100644
index 0000000..7f19d7d
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_excep/EquipExceInterface2.wsdl
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_excep/ExternalDataSync.ESB_excep.excepResponse.datasource b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_excep/ExternalDataSync.ESB_excep.excepResponse.datasource
new file mode 100644
index 0000000..e95e165
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_excep/ExternalDataSync.ESB_excep.interfaceResponse.datasource b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_excep/ExternalDataSync.ESB_excep.interfaceResponse.datasource
new file mode 100644
index 0000000..343e81e
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_excep/Reference.cs b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_excep/Reference.cs
new file mode 100644
index 0000000..f6c392b
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_excep/Reference.svcmap b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_excep/Reference.svcmap
new file mode 100644
index 0000000..475d6f7
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_excep/configuration.svcinfo b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_excep/configuration.svcinfo
new file mode 100644
index 0000000..c9d20dc
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_excep/configuration.svcinfo
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_excep/configuration91.svcinfo b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_excep/configuration91.svcinfo
new file mode 100644
index 0000000..6d221fe
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_excep/equipExceInterface1.wsdl b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_excep/equipExceInterface1.wsdl
new file mode 100644
index 0000000..fa1182a
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_excep/equipExceInterface1.wsdl
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ OSB Service
+
+
+
+
+
\ No newline at end of file
diff --git a/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_history/EquipHistoryInterface2.wsdl b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_history/EquipHistoryInterface2.wsdl
new file mode 100644
index 0000000..8c9feaf
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_history/EquipHistoryInterface2.wsdl
@@ -0,0 +1,65 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_history/ExternalDataSync.ESB_history.historyResponse.datasource b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_history/ExternalDataSync.ESB_history.historyResponse.datasource
new file mode 100644
index 0000000..3a638e2
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_history/ExternalDataSync.ESB_history.interfaceResponse.datasource b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_history/ExternalDataSync.ESB_history.interfaceResponse.datasource
new file mode 100644
index 0000000..9202819
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_history/Reference.cs b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_history/Reference.cs
new file mode 100644
index 0000000..9e813aa
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_history/Reference.svcmap b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_history/Reference.svcmap
new file mode 100644
index 0000000..791ec58
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_history/configuration.svcinfo b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_history/configuration.svcinfo
new file mode 100644
index 0000000..4a9ac8e
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_history/configuration.svcinfo
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_history/configuration91.svcinfo b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_history/configuration91.svcinfo
new file mode 100644
index 0000000..d24c780
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_history/equipHistoryInterface.wsdl b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_history/equipHistoryInterface.wsdl
new file mode 100644
index 0000000..ce3f75d
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_history/equipHistoryInterface.wsdl
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ OSB Service
+
+
+
+
+
\ No newline at end of file
diff --git a/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_life/ExternalDataSync.ESB_life.interfaceResponse.datasource b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_life/ExternalDataSync.ESB_life.interfaceResponse.datasource
new file mode 100644
index 0000000..259864c
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_life/ExternalDataSync.ESB_life.lifeResponse.datasource b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_life/ExternalDataSync.ESB_life.lifeResponse.datasource
new file mode 100644
index 0000000..bf72632
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_life/Reference.cs b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_life/Reference.cs
new file mode 100644
index 0000000..f01b6e8
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_life/Reference.svcmap b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_life/Reference.svcmap
new file mode 100644
index 0000000..c8cffda
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_life/UrmRsBaseLifeInterface2.wsdl b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_life/UrmRsBaseLifeInterface2.wsdl
new file mode 100644
index 0000000..30c0b81
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_life/UrmRsBaseLifeInterface2.wsdl
@@ -0,0 +1,72 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_life/configuration.svcinfo b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_life/configuration.svcinfo
new file mode 100644
index 0000000..c196433
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_life/configuration.svcinfo
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_life/configuration91.svcinfo b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_life/configuration91.svcinfo
new file mode 100644
index 0000000..3c26e59
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_life/urmRsBaseLifeInterface1.wsdl b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_life/urmRsBaseLifeInterface1.wsdl
new file mode 100644
index 0000000..4b19020
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/Connected Services/ESB_life/urmRsBaseLifeInterface1.wsdl
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ OSB Service
+
+
+
+
+
\ No newline at end of file
diff --git a/Interface_WebAPI/SlMesDbIterface/ExternalDataSync.csproj b/Interface_WebAPI/SlMesDbIterface/ExternalDataSync.csproj
new file mode 100644
index 0000000..812ee07
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/ExternalDataSync.csproj
@@ -0,0 +1,522 @@
+
+
+
+
+ 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
+
+
+ False
+ bin\ExternalDataSync\DataLinkMesWork.dll
+
+
+ ..\DLL\ICSharpCode.SharpZipLib.dll
+
+
+ False
+ ..\..\dll_common\MesWork.DeviceDriver.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
+
+
+ ..\..\MisDataFun\packages\Microsoft.Owin.4.2.2\lib\net45\Microsoft.Owin.dll
+
+
+ ..\packages\Microsoft.Win32.Registry.5.0.0\lib\net461\Microsoft.Win32.Registry.dll
+
+
+ ..\..\MisDataFun\packages\Newtonsoft.Json.13.0.3\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\libet45\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
+
+
+
+
+
+
+
+
+
+
+ ..\..\packages\WinSCP.6.5.3\lib\net40\WinSCPnet.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
+
+
+
+
+
+ {f55da1a0-a982-4479-8c47-0d9a5aaf3e18}
+ 00MesWorkMqtt
+
+
+ {0d1af432-439a-4920-8692-43ae139f5530}
+ 01_01DoWhatPlc
+
+
+ {f0a0c525-03fd-428a-9b17-7f54aa0e4475}
+ 07BusinessFacade
+
+
+ {d98be764-adeb-488d-9714-61e308aa8201}
+ 08-WebFun_base
+
+
+ {90e76fb4-646d-45e2-95db-0b8ab4e465d6}
+ 09-MesDataFunction
+
+
+ {5c0c572b-f8f1-41de-b049-4d40ae29cd21}
+ 99-DataBaseAccess2
+
+
+ {e4eb6420-906d-4672-947a-ca33ddcdadfc}
+ 12SendMessageToWeb
+
+
+ {55b510c1-59e9-4bfd-ae84-d76d46f6e365}
+ 13.3MIS_FuntionSaveData
+
+
+ {1dc48c83-1842-4de8-acaf-26e1e7f7c58f}
+ 00_MyLog4Net
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。
+
+
+
+
\ No newline at end of file
diff --git a/Interface_WebAPI/SlMesDbIterface/Form_MoveSqlTable.Designer.cs b/Interface_WebAPI/SlMesDbIterface/Form_MoveSqlTable.Designer.cs
new file mode 100644
index 0000000..73418af
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/Form_MoveSqlTable.Designer.cs
@@ -0,0 +1,207 @@
+
+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.richTextBoxLogBox = new System.Windows.Forms.RichTextBox();
+ this.label1 = new System.Windows.Forms.Label();
+ this.button1 = new System.Windows.Forms.Button();
+ this.button2 = new System.Windows.Forms.Button();
+ this.button3 = new System.Windows.Forms.Button();
+ this.button56 = new System.Windows.Forms.Button();
+ this.button5 = new System.Windows.Forms.Button();
+ this.button4 = new System.Windows.Forms.Button();
+ this.button6 = new System.Windows.Forms.Button();
+ this.button7 = new System.Windows.Forms.Button();
+ this.button8 = new System.Windows.Forms.Button();
+ this.SuspendLayout();
+ //
+ // richTextBoxLogBox
+ //
+ this.richTextBoxLogBox.Location = new System.Drawing.Point(3, 47);
+ this.richTextBoxLogBox.Name = "richTextBoxLogBox";
+ this.richTextBoxLogBox.Size = new System.Drawing.Size(518, 361);
+ this.richTextBoxLogBox.TabIndex = 2;
+ this.richTextBoxLogBox.Text = "";
+ //
+ // label1
+ //
+ this.label1.AutoSize = true;
+ this.label1.Font = new System.Drawing.Font("宋体", 22F);
+ this.label1.Location = new System.Drawing.Point(8, 6);
+ this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(133, 30);
+ this.label1.TabIndex = 3;
+ this.label1.Text = "数据接口";
+ this.label1.Click += new System.EventHandler(this.label1_Click);
+ //
+ // button1
+ //
+ this.button1.Location = new System.Drawing.Point(538, 165);
+ this.button1.Margin = new System.Windows.Forms.Padding(2);
+ this.button1.Name = "button1";
+ this.button1.Size = new System.Drawing.Size(109, 34);
+ this.button1.TabIndex = 4;
+ this.button1.Text = "生产开工";
+ this.button1.UseVisualStyleBackColor = true;
+ this.button1.Click += new System.EventHandler(this.button1_Click);
+ //
+ // button2
+ //
+ this.button2.Location = new System.Drawing.Point(538, 203);
+ this.button2.Margin = new System.Windows.Forms.Padding(2);
+ this.button2.Name = "button2";
+ this.button2.Size = new System.Drawing.Size(109, 34);
+ this.button2.TabIndex = 4;
+ this.button2.Text = "产线报警";
+ this.button2.UseVisualStyleBackColor = true;
+ this.button2.Click += new System.EventHandler(this.button2_Click);
+ //
+ // button3
+ //
+ this.button3.Location = new System.Drawing.Point(538, 243);
+ this.button3.Margin = new System.Windows.Forms.Padding(2);
+ this.button3.Name = "button3";
+ this.button3.Size = new System.Drawing.Size(109, 34);
+ this.button3.TabIndex = 4;
+ this.button3.Text = "工序完工";
+ this.button3.UseVisualStyleBackColor = true;
+ this.button3.Click += new System.EventHandler(this.button3_Click);
+ //
+ // button56
+ //
+ this.button56.Location = new System.Drawing.Point(538, 281);
+ this.button56.Margin = new System.Windows.Forms.Padding(2);
+ this.button56.Name = "button56";
+ this.button56.Size = new System.Drawing.Size(109, 34);
+ this.button56.TabIndex = 4;
+ this.button56.Text = "任务完工与报工";
+ this.button56.UseVisualStyleBackColor = true;
+ this.button56.Click += new System.EventHandler(this.button56_Click);
+ //
+ // button5
+ //
+ this.button5.Location = new System.Drawing.Point(538, 47);
+ this.button5.Margin = new System.Windows.Forms.Padding(2);
+ this.button5.Name = "button5";
+ this.button5.Size = new System.Drawing.Size(109, 34);
+ this.button5.TabIndex = 4;
+ this.button5.Text = "物料配送";
+ this.button5.UseVisualStyleBackColor = true;
+ this.button5.Click += new System.EventHandler(this.button4_Click);
+ //
+ // button4
+ //
+ this.button4.Location = new System.Drawing.Point(538, 367);
+ this.button4.Margin = new System.Windows.Forms.Padding(2);
+ this.button4.Name = "button4";
+ this.button4.Size = new System.Drawing.Size(109, 31);
+ this.button4.TabIndex = 5;
+ this.button4.Text = "缓存位置查询";
+ this.button4.UseVisualStyleBackColor = true;
+ this.button4.Click += new System.EventHandler(this.button4_Click_1);
+ //
+ // button6
+ //
+ this.button6.Location = new System.Drawing.Point(538, 85);
+ this.button6.Margin = new System.Windows.Forms.Padding(2);
+ this.button6.Name = "button6";
+ this.button6.Size = new System.Drawing.Size(109, 34);
+ this.button6.TabIndex = 4;
+ this.button6.Text = "器具信息查询";
+ this.button6.UseVisualStyleBackColor = true;
+ this.button6.Click += new System.EventHandler(this.button6_Click);
+ //
+ // button7
+ //
+ this.button7.Location = new System.Drawing.Point(538, 123);
+ this.button7.Margin = new System.Windows.Forms.Padding(2);
+ this.button7.Name = "button7";
+ this.button7.Size = new System.Drawing.Size(109, 34);
+ this.button7.TabIndex = 4;
+ this.button7.Text = "物料配送确认";
+ this.button7.UseVisualStyleBackColor = true;
+ this.button7.Click += new System.EventHandler(this.button7_Click);
+ //
+ // button8
+ //
+ this.button8.Location = new System.Drawing.Point(538, 319);
+ this.button8.Margin = new System.Windows.Forms.Padding(2);
+ this.button8.Name = "button8";
+ this.button8.Size = new System.Drawing.Size(109, 34);
+ this.button8.TabIndex = 4;
+ this.button8.Text = "转序(点对点)";
+ this.button8.UseVisualStyleBackColor = true;
+ this.button8.Click += new System.EventHandler(this.button8_Click);
+ //
+ // 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.button4);
+ this.Controls.Add(this.button7);
+ this.Controls.Add(this.button6);
+ this.Controls.Add(this.button5);
+ this.Controls.Add(this.button8);
+ this.Controls.Add(this.button56);
+ this.Controls.Add(this.button3);
+ this.Controls.Add(this.button2);
+ this.Controls.Add(this.button1);
+ this.Controls.Add(this.label1);
+ this.Controls.Add(this.richTextBoxLogBox);
+ 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 = "20250106.1105";
+ this.Load += new System.EventHandler(this.Form_MoveSqlTable_Load);
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+ private System.Windows.Forms.RichTextBox richTextBoxLogBox;
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.Button button1;
+ private System.Windows.Forms.Button button2;
+ private System.Windows.Forms.Button button3;
+ private System.Windows.Forms.Button button56;
+ private System.Windows.Forms.Button button5;
+ private System.Windows.Forms.Button button4;
+ private System.Windows.Forms.Button button6;
+ private System.Windows.Forms.Button button7;
+ private System.Windows.Forms.Button button8;
+ }
+}
\ No newline at end of file
diff --git a/Interface_WebAPI/SlMesDbIterface/Form_MoveSqlTable.cs b/Interface_WebAPI/SlMesDbIterface/Form_MoveSqlTable.cs
new file mode 100644
index 0000000..59f4c39
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/Form_MoveSqlTable.cs
@@ -0,0 +1,325 @@
+using MisDataSaveDate;
+using MisDataSaveDate.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.Configuration;
+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;
+ //InitServer initServer = null;
+
+ ///
+ ///
+ ///
+ public Form_MoveSqlTable()
+ {
+ InitializeComponent();
+ }
+
+ private void Form_MoveSqlTable_Load(object sender, EventArgs e)
+ {
+ //MyLog4Net.MyLogHelper.LogCommit += MyLogHelper_LogCommit;
+ //initServer = new InitServer();
+ }
+
+ 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)
+ {
+
+ }
+
+ private void label1_Click(object sender, EventArgs e)
+ {
+
+ }
+
+ private void button1_Click(object sender, EventArgs e)
+ {
+ //new TaskFactory().StartNew(delegate ()
+ //{
+ try
+ {
+ CALL_Inerface_DataHandle.CALL_Inerface_JobStart("AC2401", "SCDD-0302-250707-0410-01", "SCDD-0302-250707-0410-01");
+ }
+ catch (Exception err)
+ {
+ MyLog4Net.MyLogHelper.Info("生产开工接口res:", err.Message);
+ }
+ //});
+ }
+
+ private void button2_Click(object sender, EventArgs e)
+ {
+ try
+ {
+ CALL_Inerface_DataHandle.CALL_Inerface_DeviceAlarm("AC0901", "90010003", "1", "测试报警信息!");
+ }
+
+ catch (Exception err)
+ {
+ MyLog4Net.MyLogHelper.Info("产线报警接口res:", err.Message);
+ }
+ }
+
+ private void button3_Click(object sender, EventArgs e)
+ {
+
+ try
+ {
+ //JobFinished productionReport = GenerateTestData_ProductionReport();
+ //string InterfaceUrl = ConfigurationManager.AppSettings["CallWebApiUrl_ProcessJobFinish"];
+ //var result = CALL_Interface_WebAPI.CALL_WebApi_JobFinished(InterfaceUrl,productionReport);
+ //richTextBoxLogBox.Text = result.ToString();
+ CALL_Inerface_DataHandle.CALL_Inerface_JobFinished("AC2401", "SCDD-0302-250707-0410-01", "SCDD-0302-250707-0410-01");
+ }
+
+ catch (Exception err)
+ {
+ MyLog4Net.MyLogHelper.Info("工序完工接口res:", err.Message);
+ }
+
+ }
+
+ private void button4_Click(object sender, EventArgs e)
+ {
+ //new TaskFactory().StartNew(delegate ()
+ //{
+ try
+ {
+ // 1退托盘,2叫料,3送料,4转序
+ CALL_Inerface_DataHandle.CALL_Inerface_CallMaterial("AC0901-2", "2");
+ }
+ catch (Exception err)
+ {
+ MyLog4Net.MyLogHelper.Info("物料配送接口res:", err.Message);
+ }
+ //});
+ }
+
+ private void button56_Click(object sender, EventArgs e)
+ {
+ //new TaskFactory().StartNew(delegate ()
+ //{
+ try
+ {
+ TaskFinish taskFinish = GenerateTestData_taskFinish();
+ var result = CALL_Interface_WebAPI.CALL_WebApi_FinishedReport(taskFinish);
+ richTextBoxLogBox.Text = result.ToString();
+
+ }
+
+ catch (Exception err)
+ {
+ MyLog4Net.MyLogHelper.Info("任务完工与工时汇报接口res:", err.Message);
+ }
+ //});
+ }
+
+ public static JobFinished GenerateTestData_ProductionReport()
+ {
+ return new JobFinished
+ {
+ orderID = "OrderID20250512",
+ taskID = "TASK202403150001",
+ finishedQuantity = 100.00m,
+ createTime = "2024-03-15 08:00:00",
+ endTime = "2024-03-15 17:00:00",
+ beat = 5.5m,
+ processNo = "PROC001",
+ lastModifiedTime = "2024-03-15 17:00:00",
+ operation = "操作人",
+ inspectionInfo = new List
+ {
+ new InspectionInfo
+ {
+ Inspectcode = "INS202403150001",
+ inspector = "张三",
+ inspectionTime = "2024-03-15 16:30:00",
+ qualifiedQuantity = 98.00m,
+ unqualifiedQuantity = 2.00m,
+ inspectionDetails = new List
+ {
+ new InspectionDetail
+ {
+ inspectionItemID = "ITEM001",
+ inspectionItemNo = "CHECK001",
+ inspectionItemName = "尺寸检查",
+ inspectionValue = "检测值",
+ inspectionStandardText = "标准尺寸检查",
+ upperLimitSymbol = "≤",
+ upperLimitValue = 11.0m,
+ lowerLimitSymbol = "≥",
+ lowerLimitValue = 10.0m,
+ standardValue = 10.5m,
+ inspectionResult = "检验结果"
+ },
+ new InspectionDetail
+ {
+ inspectionItemID = "ITEM002",
+ inspectionItemNo = "CHECK002",
+ inspectionItemName = "重量检查",
+ inspectionValue = "检测值",
+ inspectionStandardText = "标准重量检查",
+ upperLimitSymbol = "≤",
+ upperLimitValue = 550.0m,
+ lowerLimitSymbol = "≥",
+ lowerLimitValue = 450.0m,
+ standardValue = 500.0m,
+ inspectionResult = "检验结果"
+ }
+ }
+ }
+ },
+ materialInfo = new List
+ {
+ new MaterialInfo
+ {
+ consumedMaterialNo = "MAT001",
+ qty = 1.0m,
+ qualifiedqty = 1.0m,
+ unqualifiedqty = 0.0m,
+ inspectionTool = "游标卡尺",
+ batchNo = "BATCH202403150001",
+ serialNo = "序列号"
+ },
+ new MaterialInfo
+ {
+ consumedMaterialNo = "MAT002",
+ qty = 1.0m,
+ qualifiedqty = 1.0m,
+ unqualifiedqty = 0.0m,
+ inspectionTool = "电子秤",
+ batchNo = "BATCH202403150002",
+ serialNo = "序列号"
+ }
+ },
+ workinghours = new List
+ {
+ new Workinghours
+ {
+ employee = "员工1",
+ quantity = 1.0m,
+ workingHours = 1.0m,
+ },
+ new Workinghours
+ {
+ employee = "员工2",
+ quantity = 1.0m,
+ workingHours = 1.0m,
+ }
+ }
+ };
+ }
+
+ public static TaskFinish GenerateTestData_taskFinish()
+ {
+ return new TaskFinish
+ {
+ orderID = "ORD202403150002",
+ taskID = "TASK202403150003",
+ employee = "王五",
+ quantity = 120,
+ workingHours = 9
+ };
+ }
+
+ private void button4_Click_1(object sender, EventArgs e)
+ {
+ new TaskFactory().StartNew(delegate ()
+ {
+ try
+ {
+ MaterialPosition materialPosition = new MaterialPosition
+ {
+ requestId = "请求ID",
+ process = "工序"
+ };
+ //var result = CALL_Interface_WebAPI.CALL_WebApi_CallMaterial(materialSend);
+ //richTextBoxLogBox.Text = result.ToString();
+ }
+
+ catch (Exception err)
+ {
+ MyLog4Net.MyLogHelper.Info("缓存位置查询接口res:", err.Message);
+ }
+ });
+ }
+
+ private void button6_Click(object sender, EventArgs e)
+ {
+ CALL_Inerface_DataHandle.CALL_Inerface_DeviceInfoQuery("AC0901-2", "Y1030121000595");
+ }
+
+ private void button7_Click(object sender, EventArgs e)
+ {
+ CALL_Inerface_DataHandle.CALL_Inerface_MaterialConfirm("AC0901-02", "YX126GISSGW002");
+ }
+
+ private void button8_Click(object sender, EventArgs e)
+ {
+ CALL_Inerface_DataHandle.CALL_Inerface_MaterialTransfer("ACHC01", "ACHC02", "211");
+ }
+ }
+}
diff --git a/Interface_WebAPI/SlMesDbIterface/Form_MoveSqlTable.resx b/Interface_WebAPI/SlMesDbIterface/Form_MoveSqlTable.resx
new file mode 100644
index 0000000..aedf36b
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/SlMesDbIterface/MOM/AGV_InterAction.cs b/Interface_WebAPI/SlMesDbIterface/MOM/AGV_InterAction.cs
new file mode 100644
index 0000000..8c98553
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/MOM/AGV_InterAction.cs
@@ -0,0 +1,27 @@
+using System;
+ using Newtonsoft.Json;
+namespace MisDataSaveDate.MOM
+{
+ public class AGV_InterAction
+ {
+//"{
+//""LocationCode"": ""位置编号"",
+//""TaskCode"": ""配送任务号"",
+//""deliveryType"": ""配送类型"",
+//""ReqCMD"": ""请求标识""
+//}"
+
+ [JsonProperty("LocationCode")]
+ public string LocationCode { get; set; } // 位置编号
+
+ [JsonProperty("TaskCode")]
+ public string TaskCode { get; set; } // 配送任务号
+
+ [JsonProperty("deliveryType")]
+ public string DeliveryType { get; set; } // 配送类型
+
+ [JsonProperty("ReqCMD")]
+ public string ReqCMD { get; set; } // 请求标识
+
+ }
+}
\ No newline at end of file
diff --git a/Interface_WebAPI/SlMesDbIterface/MOM/AlarmClosed.cs b/Interface_WebAPI/SlMesDbIterface/MOM/AlarmClosed.cs
new file mode 100644
index 0000000..6e6a299
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/MOM/AlarmClosed.cs
@@ -0,0 +1,34 @@
+using System;
+using System.Collections.Generic;
+//using System.Text.Json.Serialization; // 用于 System.Text.Json
+using Newtonsoft.Json; // 如果使用 Newtonsoft.Json 则取消注释
+namespace MisDataSaveDate.MOM
+{
+ public class AlarmClosed
+ {
+ [JsonProperty("taskID")]
+ // [JsonProperty("taskID")] // Newtonsoft.Json 用法
+ public string alarmTaskId { get; set; } // 报警任务ID
+
+ [JsonProperty("handleInfo")]
+ public List HandleInfos { get; set; } // 处理信息列表
+ }
+
+ public class AlarmHandleInfo
+ {
+ [JsonProperty("userId")]
+ public string UserId { get; set; } // 处理用户ID
+
+ [JsonProperty("userCode")]
+ public string UserCode { get; set; } // 处理用户编号
+
+ [JsonProperty("userName")]
+ public string UserName { get; set; } // 处理用户名称
+
+ [JsonProperty("startTime")]
+ public string StartTime { get; set; } // 处理开始时间
+
+ [JsonProperty("endTime")]
+ public string EndTime { get; set; } // 处理完成时间(可空)
+ }
+}
\ No newline at end of file
diff --git a/Interface_WebAPI/SlMesDbIterface/MOM/ApiResponse.cs b/Interface_WebAPI/SlMesDbIterface/MOM/ApiResponse.cs
new file mode 100644
index 0000000..fddbfba
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/MOM/ApiResponse.cs
@@ -0,0 +1,29 @@
+using System;
+using System.Collections.Generic;
+using Newtonsoft.Json;
+namespace MisDataSaveDate.MOM
+{
+ public class ApiResponse
+ {
+ [JsonProperty("code")]
+ public int Code { get; set; }
+
+ [JsonProperty("message")]
+ public string Message { get; set; }
+
+ [JsonProperty("data")]
+ public List Data { get; set; }
+ }
+
+ public class Response_Data
+ {
+ [JsonProperty("code")]
+ public int Code { get; set; }
+
+ [JsonProperty("message")]
+ public string Message { get; set; }
+
+ [JsonProperty("dataid")]
+ public string DataId { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/Interface_WebAPI/SlMesDbIterface/MOM/Employee.cs b/Interface_WebAPI/SlMesDbIterface/MOM/Employee.cs
new file mode 100644
index 0000000..57d6c3f
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/MOM/Employee.cs
@@ -0,0 +1,37 @@
+using System;
+using System.Collections.Generic;
+//using System.Text.Json.Serialization; // For System.Text.Json
+using Newtonsoft.Json; // Uncomment if using Newtonsoft.Json
+namespace MisDataSaveDate.MOM
+{
+ public class EmployeeInfoSave
+ {
+ [JsonProperty("data")]
+ public List Data { get; set; }
+ }
+
+ public class EmployeeInfo
+ {
+ [JsonProperty("personID")]
+ // [JsonProperty("empID")] // For Newtonsoft.Json
+ public string PersonId { get; set; } // 人员ID
+
+ [JsonProperty("personCode")]
+ public string PersonCode { get; set; } // 人员编号
+
+ [JsonProperty("personName")]
+ public string PersonName { get; set; } // 人员名称
+
+ [JsonProperty("orgID")]
+ public string OrgId { get; set; } // 所属组织
+
+ [JsonProperty("phoneNumber")]
+ public string PhoneNumber { get; set; } // 手机号
+
+ [JsonProperty("createTime")]
+ public string CreateTime { get; set; } // 创建时间
+
+ [JsonProperty("lastModifyTime")]
+ public string LastModifyTime { get; set; } // 最后修改时间
+ }
+}
\ No newline at end of file
diff --git a/Interface_WebAPI/SlMesDbIterface/MOM/InspectionPlan.cs b/Interface_WebAPI/SlMesDbIterface/MOM/InspectionPlan.cs
new file mode 100644
index 0000000..da1b302
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/MOM/InspectionPlan.cs
@@ -0,0 +1,146 @@
+using System;
+using System.Collections.Generic;
+using Newtonsoft.Json;
+namespace MisDataSaveDate.MOM
+{
+ public class InspectionPlan
+ {
+ [JsonProperty("id")]
+ public string Id { get; set; }
+
+ [JsonProperty("code")]
+ public string Code { get; set; }
+
+ [JsonProperty("name")]
+ public string Name { get; set; }
+
+ [JsonProperty("usecompecode")]
+ public string CompileUnitCode { get; set; }
+
+ [JsonProperty("usecompename")]
+ public string CompileUnitName { get; set; }
+
+ [JsonProperty("checktypecode")]
+ public string CheckTypeCode { get; set; }
+
+ [JsonProperty("checktypename")]
+ public string CheckTypeName { get; set; }
+
+ [JsonProperty("cycleplan")]
+ public string IsCyclePlan { get; set; }
+
+ [JsonProperty("checkcycle")]
+ public string CheckCycle { get; set; }
+
+ [JsonProperty("cycleunit")]
+ public string CycleUnit { get; set; }
+
+ [JsonProperty("nextchecktime")]
+ public string NextCheckTime { get; set; }
+
+ [JsonProperty("planstatus")]
+ public string PlanStatus { get; set; }
+
+ [JsonProperty("whetherinspect")]
+ public string WhetherInspect { get; set; }
+
+ [JsonProperty("taskvalidityperiod")]
+ public string TaskValidityPeriod { get; set; }
+
+ [JsonProperty("validityunit")]
+ public string ValidityUnit { get; set; }
+
+ [JsonProperty("daysahead")]
+ public string DaysAhead { get; set; }
+
+ [JsonProperty("aheadunit")]
+ public string AheadUnit { get; set; }
+
+ [JsonProperty("checkobjects")]
+ public List CheckObjects { get; set; }
+ }
+
+ public class CheckObject
+ {
+ [JsonProperty("checkobjectsid")]
+ public string CheckObjectId { get; set; }
+
+ [JsonProperty("amcode")]
+ public string AssetCode { get; set; }
+
+ [JsonProperty("amname")]
+ public string AssetName { get; set; }
+
+ [JsonProperty("poscode")]
+ public string PositionCode { get; set; }
+
+ [JsonProperty("posname")]
+ public string PositionName { get; set; }
+
+ [JsonProperty("plancheckercode")]
+ public string PlanCheckerCode { get; set; }
+
+ [JsonProperty("plancheckername")]
+ public string PlanCheckerName { get; set; }
+
+ [JsonProperty("detail")]
+ public List Details { get; set; }
+ }
+
+ public class CheckDetail
+ {
+ [JsonProperty("detailid")]
+ public string DetailId { get; set; }
+
+ [JsonProperty("checkpart")]
+ public string CheckPart { get; set; }
+
+ [JsonProperty("checkitem")]
+ public string CheckItem { get; set; }
+
+ [JsonProperty("checkcontent")]
+ public string CheckContent { get; set; }
+
+ [JsonProperty("checkmethodcode")]
+ public string CheckMethodCode { get; set; }
+
+ [JsonProperty("checkmethodname")]
+ public string CheckMethodName { get; set; }
+
+ [JsonProperty("standardclaim")]
+ public string StandardClaim { get; set; }
+
+ [JsonProperty("resulttype")]
+ public string ResultType { get; set; }
+
+ [JsonProperty("resultoptionsids")]
+ public string ResultOptionsIds { get; set; }
+
+ [JsonProperty("resultoptions")]
+ public string ResultOptions { get; set; }
+
+ [JsonProperty("Abnmeasurescode")]
+ public string AbnormalMeasuresCode { get; set; }
+
+ [JsonProperty("abnmeasuresname")]
+ public string AbnormalMeasuresName { get; set; }
+
+ [JsonProperty("checkstatusenumcode")]
+ public string CheckStatusEnumCode { get; set; }
+
+ [JsonProperty("checkstatusenumname")]
+ public string CheckStatusEnumName { get; set; }
+
+ [JsonProperty("isphotographed")]
+ public string IsPhotographed { get; set; }
+
+ [JsonProperty("plancheckercode")]
+ public string PlanCheckerCode { get; set; }
+
+ [JsonProperty("plancheckername")]
+ public string PlanCheckerName { get; set; }
+
+ [JsonProperty("lastchecktime")]
+ public string LastCheckTime { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/Interface_WebAPI/SlMesDbIterface/MOM/LineSideStock.cs b/Interface_WebAPI/SlMesDbIterface/MOM/LineSideStock.cs
new file mode 100644
index 0000000..6079b14
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/MOM/LineSideStock.cs
@@ -0,0 +1,38 @@
+using System;
+using System.Collections.Generic;
+using Newtonsoft.Json;
+namespace MisDataSaveDate.MOM
+{
+ public class LineSideStock
+ {
+ [JsonProperty("requestId")]
+ public string RequestId { get; set; }
+
+ [JsonProperty("process")]
+ public string Process { get; set; }
+ }
+
+ public class Res_LineSideStock
+ {
+ [JsonProperty("code")]
+ public int Code { get; set; }
+
+ [JsonProperty("message")]
+ public string Message { get; set; }
+
+ [JsonProperty("data")]
+ public List Data { get; set; }
+ }
+
+ public class LSSData
+ {
+ [JsonProperty("processNo")]
+ public string ProcessNo { get; set; }
+
+ [JsonProperty("locationNo")]
+ public string LocationNo { get; set; }
+
+ [JsonProperty("emptySlots")]
+ public string EmptySlots { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/Interface_WebAPI/SlMesDbIterface/MOM/MOM_Order.cs b/Interface_WebAPI/SlMesDbIterface/MOM/MOM_Order.cs
new file mode 100644
index 0000000..a6c8ac0
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/MOM/MOM_Order.cs
@@ -0,0 +1,290 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace MisDataSaveDate.MOM
+{
+ public class DispatchOrder
+ {
+ ///
+ /// 派工单ID
+ ///
+ public string orderID { get; set; }
+
+ ///
+ /// 派工单号
+ ///
+ public string orderNo { get; set; }
+
+ ///
+ /// 物料ID
+ ///
+ public string materialId { get; set; }
+
+ ///
+ /// 物料编号
+ ///
+ public string materialCode { get; set; }
+
+ ///
+ /// 物料名称
+ ///
+ public string materialName { get; set; }
+
+ ///
+ /// 物料规格
+ ///
+ public string materialSpec { get; set; }
+
+ ///
+ /// 物料型号
+ ///
+ public string materialModel { get; set; }
+ ///
+ /// 工程号
+ ///
+ public string projectCode { get; set; }
+ ///
+ /// 工程名称
+ ///
+ public string projectName { get; set; }
+ ///
+ /// 断路器产线根据此判断是不是同一工艺路线
+ ///
+ public string routingId { get; set; }
+ ///
+ /// 数量
+ ///
+ public string qty { get; set; }
+ ///
+ /// 计划投产时间
+ ///
+ public string planStartTime { get; set; }
+
+ ///
+ /// 派工任务列表
+ ///
+ public List dispatchTask { get; set; }
+ }
+
+ public class DispatchTask
+ {
+ ///
+ /// 任务ID
+ ///
+ public string taskId { get; set; }
+
+ ///
+ /// 任务号
+ ///
+ public string taskNo { get; set; }
+
+ ///
+ /// 工单工序ID
+ ///
+ public string workOrderProcessId { get; set; }
+
+ ///
+ /// 工单号
+ ///
+ public string workOrderNo { get; set; }
+
+ ///
+ /// 工作中心ID
+ ///
+ public string workCenterId { get; set; }
+
+ ///
+ /// 工作中心编号
+ ///
+ public string workCenterCode { get; set; }
+
+ ///
+ /// 工作中心名称
+ ///
+ public string workCenterName { get; set; }
+
+ ///
+ /// 工序ID
+ ///
+ public string processId { get; set; }
+
+ ///
+ /// 工序编号
+ ///
+ public string processCode { get; set; }
+
+ ///
+ /// 工序名称
+ ///
+ public string processName { get; set; }
+
+ ///
+ /// 物料ID
+ ///
+ public string materialId { get; set; }
+
+ ///
+ /// 物料编号
+ ///
+ public string materialCode { get; set; }
+
+ ///
+ /// 物料名称
+ ///
+ public string materialName { get; set; }
+
+ ///
+ /// 物料型号
+ ///
+ public string materialModel { get; set; }
+
+ ///
+ /// 计划投产时间
+ ///
+ public string planStartTime { get; set; }
+
+ ///
+ /// 计划产出时间
+ ///
+ public string planEndTime { get; set; }
+
+ ///
+ /// 派工数量
+ ///
+ public string dispatchQty { get; set; }
+
+ ///
+ /// 任务状态
+ ///
+ public string taskStatus { get; set; }
+
+ ///
+ /// 创建时间
+ ///
+ public string createdAt { get; set; }
+
+ ///
+ /// 修改时间
+ ///
+ public string modifiedAt { get; set; }
+
+ ///
+ /// 配送信息列表
+ ///
+ public List deliveryInfo { get; set; }
+ }
+
+ public class DeliveryInfo
+ {
+ ///
+ /// 配送计划ID
+ ///
+ public string deliveryInfoid { get; set; }
+ ///
+ /// 工单备料ID
+ ///
+ public string momid { get; set; }
+ ///
+ /// 备料号
+ ///
+ public string preparationNo { get; set; }
+
+ ///
+ /// 物料ID
+ ///
+ public string materialId { get; set; }
+
+ ///
+ /// 物料编号
+ ///
+ public string materialCode { get; set; }
+
+ ///
+ /// 物料名称
+ ///
+ public string materialName { get; set; }
+
+ ///
+ /// 物料规格
+ ///
+ public string materialSpec { get; set; }
+
+ ///
+ /// 物料型号
+ ///
+ public string materialModel { get; set; }
+
+ ///
+ /// 物料描述
+ ///
+ public string materialDesc { get; set; }
+
+ ///
+ /// 工序ID
+ ///
+ public string processId { get; set; }
+
+ ///
+ /// 工序编号
+ ///
+ public string processCode { get; set; }
+
+ ///
+ /// 工序名称
+ ///
+ public string processName { get; set; }
+
+ ///
+ /// 工作中心ID
+ ///
+ public string workCenterId { get; set; }
+
+ ///
+ /// 工作中心编号
+ ///
+ public string workCenterCode { get; set; }
+
+ ///
+ /// 工作中心名称
+ ///
+ public string workCenterName { get; set; }
+
+ ///
+ /// 所需数量
+ ///
+ public string requiredQty { get; set; }
+
+ ///
+ /// 计划时间
+ ///
+ public string planTime { get; set; }
+
+ ///
+ /// 批次号
+ ///
+ public string batchNo { get; set; }
+
+ ///
+ /// 序列号
+ ///
+ public string serialNo { get; set; }
+
+ ///
+ /// 配送位置ID
+ ///
+ public string deliveryPosId { get; set; }
+
+ ///
+ /// 配送位置编号
+ ///
+ public string deliveryPosCode { get; set; }
+
+ ///
+ /// 配送位置名称
+ ///
+ public string deliveryPosName { get; set; }
+ }
+}
diff --git a/Interface_WebAPI/SlMesDbIterface/MOM/MOM_Process.cs b/Interface_WebAPI/SlMesDbIterface/MOM/MOM_Process.cs
new file mode 100644
index 0000000..8fbe85a
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/MOM/MOM_Process.cs
@@ -0,0 +1,143 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace MisDataSaveDate.MOM
+{
+
+ ///
+ /// 工艺方案类
+ ///
+ public class ProcessScheme
+ {
+ ///
+ /// 工艺方案ID,数据唯一标识
+ ///
+ public string id { get; set; }
+
+ ///
+ /// 工艺方案编号
+ ///
+ public string code { get; set; }
+
+ ///
+ /// 工艺方案编号
+ ///
+ public string name { get; set; }
+
+ ///
+ /// 订单号(生产订单或生产工单的编号)
+ ///
+ public string orderNo { get; set; }
+
+ ///
+ /// 产品ID
+ ///
+ public string productId { get; set; }
+
+ ///
+ /// 产品编号
+ ///
+ public string productCode { get; set; }
+
+ ///
+ /// 产品名称
+ ///
+ public string productName { get; set; }
+
+ ///
+ /// 产品规格(非必填)
+ ///
+ public string productSpec { get; set; }
+
+ ///
+ /// 产品型号(非必填)
+ ///
+ public string model { get; set; }
+
+ ///
+ /// 创建时间,格式为yyyy-MM-dd HH:mm:ss
+ ///
+ public string createdTime { get; set; }
+
+ ///
+ /// 最后修改时间,格式为yyyy-MM-dd HH:mm:ss
+ ///
+ public string lastModifiedTime { get; set; }
+
+ ///
+ /// 工序信息
+ ///
+ public List processInfo { get; set; }
+
+ public List routingInfo { get; set; }
+ }
+
+ ///
+ /// 工序信息类
+ ///
+ public class ProcessInfo
+ {
+ ///
+ /// 顺序号
+ ///
+ public string sequenceNo { get; set; }
+
+ ///
+ /// 工序ID
+ ///
+ public string processId { get; set; }
+
+ ///
+ /// 工序编号
+ ///
+ public string processCode { get; set; }
+
+ ///
+ /// 工序名称
+ ///
+ public string processName { get; set; }
+
+ ///
+ /// 文档信息(文档路径)
+ ///
+ public string docInfo { get; set; }
+ ///
+ /// 文档名称
+ ///
+ public string filename { get; set; }
+ ///
+ /// 工序信息id
+ ///
+ public string processInfoid { get; set; }
+ }
+ public class RoutingInfo
+ {
+ ///
+ /// 工艺路线信息ID
+ ///
+ public string routingid { get; set; }
+
+ ///
+ /// 工艺路线编号
+ ///
+ public string routingcode { get; set; }
+
+ ///
+ /// 工序ID
+ ///
+ public string processId { get; set; }
+
+ ///
+ /// 工序号
+ ///
+ public string processCode { get; set; }
+
+ ///
+ /// 工序名称
+ ///
+ public string processName { get; set; }
+ }
+}
diff --git a/Interface_WebAPI/SlMesDbIterface/MOM/MaterialData.cs b/Interface_WebAPI/SlMesDbIterface/MOM/MaterialData.cs
new file mode 100644
index 0000000..13dd0fd
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/MOM/MaterialData.cs
@@ -0,0 +1,44 @@
+using System;
+using System.Collections.Generic;
+using Newtonsoft.Json;
+namespace MisDataSaveDate.MOM
+{
+ public class MaterialInfoSave
+ {
+ [JsonProperty("data")]
+ public List Data { get; set; }
+ }
+
+ public class Material
+ {
+ [JsonProperty("materialID")]
+ public string MaterialID { get; set; }
+
+ [JsonProperty("materialCode")]
+ public string MaterialCode { get; set; }
+
+ [JsonProperty("materialName")]
+ public string MaterialName { get; set; }
+
+ [JsonProperty("unitOfMeasure")]
+ public string UnitOfMeasure { get; set; }
+
+ [JsonProperty("materialCategory")]
+ public string MaterialCategory { get; set; }
+
+ [JsonProperty("materialSpec")]
+ public string MaterialSpec { get; set; }
+
+ [JsonProperty("materialModel")]
+ public string MaterialModel { get; set; }
+
+ [JsonProperty("materialDescription")]
+ public string MaterialDescription { get; set; }
+
+ [JsonProperty("createTime")]
+ public string CreateTime { get; set; }
+
+ [JsonProperty("lastModifyTime")]
+ public string LastModifyTime { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/Interface_WebAPI/SlMesDbIterface/MOM/OneCheckData.cs b/Interface_WebAPI/SlMesDbIterface/MOM/OneCheckData.cs
new file mode 100644
index 0000000..4f867d3
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/MOM/OneCheckData.cs
@@ -0,0 +1,241 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ExternalDataSync.MOM
+{
+ public class OnlineCheckData
+ {
+ ///
+ /// MsgId
+ ///
+ public string MsgId { get; set; } = "";
+ ///
+ /// OpCode
+ ///
+ public string OpCode { get; set; } = "";
+ ///
+ /// ProductionCode
+ ///
+ public string ProductionCode { get; set; } = "";
+ ///
+ /// CheckTime
+ ///
+ public string ScanTime { get; set; } = "";
+
+ ///
+ /// EndTime
+ ///
+ public string EndTime { get; set; } = "";
+
+ ///
+ /// CheckPerson
+ ///
+ public string CheckPerson { get; set; } = "";
+
+ ///
+ /// Powerused
+ ///
+ public string Powerused { get; set; } = "";
+
+
+ ///
+ /// QualityMark
+ ///
+ public int QualityMark { get; set; } = 1;
+
+ public List CheckData { get; set; } = new List();
+ }
+
+ public class OnlineCheckData_CheckData
+ {
+ ///
+ /// CheckCode
+ ///
+ public string CheckCode { get; set; } = "";
+ ///
+ /// CheckName
+ ///
+ public string CheckName { get; set; } = "";
+ ///
+ /// ProductionCode
+ ///
+ public string Unit { get; set; }
+ ///
+ /// StandardValue
+ ///
+ public string StandardValue { get; set; } = "";
+ ///
+ /// MinValue
+ ///
+ public string MinValue { get; set; } = "";
+ ///
+ /// MaxValue
+ ///
+ public string MaxValue { get; set; } = "";
+ ///
+ /// CheckValue
+ ///
+ public string CheckValue { get; set; } = "";
+ ///
+ /// QualityMark
+ ///
+ public int QualityMark { get; set; } = 1;
+ }
+
+ ///
+ /// 测试数据上传接口响应类
+ ///
+ public class OnlineCheckDataResponse
+ {
+ ///
+ /// 响应码 200正常、500失败
+ ///
+ public string Code { get; set; } = "";
+
+ ///
+ /// 响应消息,出错时返回接口调用失败原因
+ ///
+ public string Message { get; set; } = "";
+
+ ///
+ /// 请求编号,响应结果带回请求编号
+ ///
+ public string MsgId { get; set; } = "";
+
+ ///
+ /// 携带数据,JSON格式字符串数据
+ ///
+ public string Data { get; set; } = "";
+ }
+ public class PrintTaskData
+ {
+ /// string msg = $"MARK|{printTemplete}|{productCode},{printDate}";
+
+ ///
+ /// printTemplete
+ ///
+ public string printTemplete { get; set; } = "";
+ ///
+ /// productCode
+ ///
+ public string productCode { get; set; } = "";
+ ///
+ /// printDate
+ ///
+ public string printDate { get; set; } = "";
+
+ }
+
+ ///
+ /// 设备状态数据上传
+ ///
+ public class OnlineStatusData
+ {
+ ///
+ /// 消息ID
+ ///
+ public string MsgId { get; set; } = "";
+
+ ///
+ /// 设备编码
+ ///
+ public string DeviceCode { get; set; } = "";
+
+ ///
+ /// 数据类型: Status-设备状态, Use-使用情况
+ ///
+ public string DataType { get; set; } = "";
+
+ ///
+ /// 状态数据列表
+ ///
+ public List CheckData { get; set; } = new List();
+ }
+
+ ///
+ /// 设备状态数据明细
+ ///
+ public class OnlineStatusData_CheckData
+ {
+ ///
+ /// 状态代码
+ ///
+ public string StatuCode { get; set; } = "";
+
+ ///
+ /// 状态名称
+ ///
+ public string StatuName { get; set; } = "";
+
+ ///
+ /// 状态值
+ ///
+ public string StatuValue { get; set; } = "";
+ }
+
+ ///
+ /// 获取位置待测试产品信息 - 请求类
+ ///
+ public class GetWaitCheckProductDataRequest
+ {
+ ///
+ /// 请求编号 GUID
+ ///
+ public string MsgId { get; set; } = "";
+
+ ///
+ /// 位置号 AC1104-1, AC1104-2等
+ ///
+ public string OpCode { get; set; } = "";
+ }
+
+ ///
+ /// 获取位置待测试产品信息 - 响应类
+ ///
+ public class GetWaitCheckProductDataResponse
+ {
+ ///
+ /// 响应码 200正常、500失败
+ ///
+ public string Code { get; set; } = "";
+
+ ///
+ /// 响应消息,出错时返回接口调用失败原因
+ ///
+ public string Message { get; set; } = "";
+
+ ///
+ /// 请求编号,响应结果带回请求编号
+ ///
+ public string MsgId { get; set; } = "";
+
+ ///
+ /// 响应数据
+ ///
+ public GetWaitCheckProductDataResult Data { get; set; } = new GetWaitCheckProductDataResult();
+ }
+
+ ///
+ /// 获取位置待测试产品信息 - 响应数据
+ ///
+ public class GetWaitCheckProductDataResult
+ {
+ ///
+ /// 产品编号,唯一产品编码,若无待测产品则空
+ ///
+ public string ProductionCode { get; set; } = "";
+
+ ///
+ /// 产品型号,待测产品型号
+ ///
+ public string ProductModel { get; set; } = "";
+
+ ///
+ /// 产品型号代码,机型对应数字类型编号
+ ///
+ public int ProductModelCode { get; set; } = 0;
+ }
+}
diff --git a/Interface_WebAPI/SlMesDbIterface/MOM/OrganizationData.cs b/Interface_WebAPI/SlMesDbIterface/MOM/OrganizationData.cs
new file mode 100644
index 0000000..15a368e
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/MOM/OrganizationData.cs
@@ -0,0 +1,39 @@
+using System;
+using System.Collections.Generic;
+using Newtonsoft.Json;
+namespace MisDataSaveDate.MOM
+{
+
+ public class OrganizationData
+ {
+ [JsonProperty("data")]
+ public List Data { get; set; }
+ }
+
+ public class Organization
+ {
+ [JsonProperty("orgID")]
+ public string OrgID { get; set; }
+
+ [JsonProperty("orgCode")]
+ public string OrgCode { get; set; }
+
+ [JsonProperty("orgName")]
+ public string OrgName { get; set; }
+
+ [JsonProperty("classification")]
+ public string Classification { get; set; }
+
+ [JsonProperty("level")]
+ public string LevelNo { get; set; }
+
+ [JsonProperty("detail")]
+ public string Detail { get; set; }
+
+ [JsonProperty("createTime")]
+ public string CreateTime { get; set; }
+
+ [JsonProperty("lastModifyTime")]
+ public string LastModifyTime { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/Interface_WebAPI/SlMesDbIterface/MOM/ProductionOrder.cs b/Interface_WebAPI/SlMesDbIterface/MOM/ProductionOrder.cs
new file mode 100644
index 0000000..72ea489
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/MOM/ProductionOrder.cs
@@ -0,0 +1,182 @@
+using System;
+using System.Collections.Generic;
+using Newtonsoft.Json;
+namespace MisDataSaveDate.MOM
+{
+ public class ProductionOrder
+ {
+ [JsonProperty("orderID")]
+ public string OrderID { get; set; }
+
+ [JsonProperty("orderNo")]
+ public string OrderNo { get; set; }
+
+ [JsonProperty("materialId")]
+ public string MaterialId { get; set; }
+
+ [JsonProperty("materialCode")]
+ public string MaterialCode { get; set; }
+
+ [JsonProperty("materialName")]
+ public string MaterialName { get; set; }
+
+ [JsonProperty("materialSpec")]
+ public string MaterialSpec { get; set; }
+
+ [JsonProperty("materialModel")]
+ public string MaterialModel { get; set; }
+
+ [JsonProperty("orderType")]
+ public string OrderType { get; set; }
+
+ [JsonProperty("clr")]
+ public string Clr { get; set; }
+
+ [JsonProperty("planproddate")]
+ public string PlanProdDate { get; set; }
+
+ [JsonProperty("planprodqty")]
+ public string PlanProdQty { get; set; }
+
+ [JsonProperty("planoutputdate")]
+ public string PlanOutputDate { get; set; }
+
+ [JsonProperty("planoutputqty")]
+ public string PlanOutputQty { get; set; }
+
+ [JsonProperty("projectno")]
+ public string ProjectNo { get; set; }
+
+ [JsonProperty("projectname")]
+ public string ProjectName { get; set; }
+
+ [JsonProperty("planid")]
+ public string PlanId { get; set; }
+
+ [JsonProperty("processplan")]
+ public List ProcessPlans { get; set; }
+ }
+
+ public class ProcessPlan
+ {
+ [JsonProperty("rountingid")]
+ public string RoutingId { get; set; }
+
+ [JsonProperty("processplanId")]
+ public string ProcessPlanId { get; set; }
+
+ [JsonProperty("processplanNo")]
+ public string ProcessPlanNo { get; set; }
+
+ [JsonProperty("workOrderProcessId")]
+ public string WorkOrderProcessId { get; set; }
+
+ [JsonProperty("workOrderNo")]
+ public string WorkOrderNo { get; set; }
+
+ [JsonProperty("workCenterId")]
+ public string WorkCenterId { get; set; }
+
+ [JsonProperty("workCenterCode")]
+ public string WorkCenterCode { get; set; }
+
+ [JsonProperty("workCenterName")]
+ public string WorkCenterName { get; set; }
+
+ [JsonProperty("processId")]
+ public string ProcessId { get; set; }
+
+ [JsonProperty("processCode")]
+ public string ProcessCode { get; set; }
+
+ [JsonProperty("processName")]
+ public string ProcessName { get; set; }
+
+ [JsonProperty("materialId")]
+ public string MaterialId { get; set; }
+
+ [JsonProperty("materialCode")]
+ public string MaterialCode { get; set; }
+
+ [JsonProperty("materialName")]
+ public string MaterialName { get; set; }
+
+ [JsonProperty("materialModel")]
+ public string MaterialModel { get; set; }
+
+ [JsonProperty("planStartTime")]
+ public string PlanStartTime { get; set; }
+
+ [JsonProperty("planEndTime")]
+ public string PlanEndTime { get; set; }
+
+ [JsonProperty("qty")]
+ public decimal Qty { get; set; }
+
+ [JsonProperty("outqty")]
+ public decimal OutQty { get; set; }
+
+ [JsonProperty("status")]
+ public string Status { get; set; }
+
+ [JsonProperty("createdAt")]
+ public string CreatedAt { get; set; }
+
+ [JsonProperty("modifiedAt")]
+ public string ModifiedAt { get; set; }
+
+ [JsonProperty("deliveryInfo")]
+ public List DeliveryInfo { get; set; }
+ }
+
+ public class DeliveryMaterialInfo
+ {
+ [JsonProperty("deliveryInfoid")]
+ public string DeliveryInfoId { get; set; }
+
+ [JsonProperty("preparationNo")]
+ public string PreparationNo { get; set; }
+
+ [JsonProperty("materialId")]
+ public string MaterialId { get; set; }
+
+ [JsonProperty("materialCode")]
+ public string MaterialCode { get; set; }
+
+ [JsonProperty("materialName")]
+ public string MaterialName { get; set; }
+
+ [JsonProperty("materialSpec")]
+ public string MaterialSpec { get; set; }
+
+ [JsonProperty("materialModel")]
+ public string MaterialModel { get; set; }
+
+ [JsonProperty("materialDesc")]
+ public string MaterialDesc { get; set; }
+
+ [JsonProperty("processId")]
+ public string ProcessId { get; set; }
+
+ [JsonProperty("processCode")]
+ public string ProcessCode { get; set; }
+
+ [JsonProperty("processName")]
+ public string ProcessName { get; set; }
+
+ [JsonProperty("workCenterId")]
+ public string WorkCenterId { get; set; }
+
+ [JsonProperty("workCenterCode")]
+ public string WorkCenterCode { get; set; }
+
+ [JsonProperty("workCenterName")]
+ public string WorkCenterName { get; set; }
+
+ [JsonProperty("requiredQty")]
+ public decimal RequiredQty { get; set; }
+
+ [JsonProperty("planTime")]
+ public string PlanTime { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/Interface_WebAPI/SlMesDbIterface/MOM/QTStandardInfo.cs b/Interface_WebAPI/SlMesDbIterface/MOM/QTStandardInfo.cs
new file mode 100644
index 0000000..64fa1cd
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/MOM/QTStandardInfo.cs
@@ -0,0 +1,268 @@
+using Newtonsoft.Json;
+using NPOI.OpenXml4Net.OPC;
+using NPOI.SS.Formula.Functions;
+using System;
+using System.Collections.Generic;
+namespace MisDataSaveDate.MOM
+{
+ public class QTStandardInfo
+ {
+ [JsonProperty("id")]
+ public string Id { get; set; }
+
+ [JsonProperty("code")]
+ public string Code { get; set; }
+
+ [JsonProperty("name_chs")]
+ public string NameChs { get; set; }
+
+ [JsonProperty("createdate")]
+ public string CreateDate { get; set; }
+
+ [JsonProperty("lastmodifiedtime")]
+ public string LastModifiedTime { get; set; }
+
+ [JsonProperty("materialid")]
+ public MaterialID Material { get; set; }
+
+ [JsonProperty("note")]
+ public string Note { get; set; }
+
+ [JsonProperty("procedureid")]
+ public ProcedureInfo Procedure { get; set; }
+
+ [JsonProperty("standardsortid")]
+ public StandardSortInfo StandardSort { get; set; }
+
+ [JsonProperty("standardstate")]
+ public string StandardState { get; set; }
+
+ [JsonProperty("standardtypeid")]
+ public StandardTypeInfo StandardType { get; set; }
+
+ [JsonProperty("meqmstandarditemsource")]
+ public List StandardItemList { get; set; }
+
+ [JsonProperty("meqmstandardvaluesource")]
+ public List StandardValueList { get; set; }
+ }
+
+ public class MaterialidInfo
+ {
+ [JsonProperty("materialid")]
+ public string MaterialId { get; set; }
+
+ [JsonProperty("materialid_code")]
+ public string MaterialCode { get; set; }
+
+ [JsonProperty("materialid_name_chs")]
+ public string MaterialName { get; set; }
+ }
+
+ public class ProcedureInfo
+ {
+ [JsonProperty("procedureid")]
+ public string ProcedureId { get; set; }
+
+ [JsonProperty("procedureid_name_chs")]
+ public string ProcedureName { get; set; }
+
+ [JsonProperty("procedureid_ppbzgx_gxbh")]
+ public string ProcedureCode { get; set; }
+ }
+
+ public class StandardSortInfo
+ {
+ [JsonProperty("standardsortid")]
+ public string StandardSortId { get; set; }
+
+ [JsonProperty("standardsortid_code")]
+ public string StandardSortCode { get; set; }
+
+ [JsonProperty("standardsortid_name_chs")]
+ public string StandardSortName { get; set; }
+
+ [JsonProperty("standardsortid_sortpath")]
+ public string StandardSortPath { get; set; }
+ }
+
+ public class StandardTypeInfo
+ {
+ [JsonProperty("standardtypeid")]
+ public string StandardTypeId { get; set; }
+
+ [JsonProperty("standardtypeid_code")]
+ public string StandardTypeCode { get; set; }
+
+ [JsonProperty("standardtypeid_iseffective")]
+ public string IsEffective { get; set; }
+
+ [JsonProperty("standardtypeid_issystem")]
+ public string IsSystem { get; set; }
+
+ [JsonProperty("standardtypeid_name_chs")]
+ public string StandardTypeName { get; set; }
+ }
+
+ public class StandardItemSource
+ {
+ [JsonProperty("id")]
+ public string itemId { get; set; }
+
+ [JsonProperty("standardid")]
+ public RelatedStandard Standard { get; set; }
+
+ [JsonProperty("createtime")]
+ public DateTime CreateTime { get; set; }
+
+ [JsonProperty("inspecclassification")]
+ public string InspectionClassification { get; set; }
+
+ [JsonProperty("inspecclassificationname")]
+ public string InspectionClassificationName { get; set; }
+
+ [JsonProperty("note")]
+ public string Note { get; set; }
+
+ [JsonProperty("targetauxdescribe")]
+ public string TargetAuxDescribe { get; set; }
+
+ [JsonProperty("targetdescribe")]
+ public string TargetDescribe { get; set; }
+
+ [JsonProperty("targetgroupid")]
+ public TargetGroup TargetGroup { get; set; }
+
+ [JsonProperty("targetid")]
+ public TargetInfo Target { get; set; }
+
+ [JsonProperty("targetno")]
+ public string TargetNo { get; set; }
+ }
+
+ public class RelatedStandard
+ {
+ [JsonProperty("standardid")]
+ public string StandardId { get; set; }
+
+ [JsonProperty("standardid_code")]
+ public string StandardCode { get; set; }
+
+ [JsonProperty("standardid_name_chs")]
+ public string StandardName { get; set; }
+ }
+
+ public class TargetGroup
+ {
+ [JsonProperty("targetgroupid")]
+ public string TargetGroupId { get; set; }
+
+ [JsonProperty("targetgroupid_code")]
+ public string TargetGroupCode { get; set; }
+
+ [JsonProperty("targetgroupid_name_chs")]
+ public string TargetGroupName { get; set; }
+ }
+
+ public class TargetInfo
+ {
+ [JsonProperty("targetid")]
+ public string TargetId { get; set; }
+
+ [JsonProperty("targetid_code")]
+ public string TargetCode { get; set; }
+
+ [JsonProperty("targetid_name_chs")]
+ public string TargetName { get; set; }
+
+ [JsonProperty("targetid_note")]
+ public string TargetNote { get; set; }
+
+ [JsonProperty("targetid_targetgroupid")]
+ public string TargetGroupId { get; set; }
+
+ [JsonProperty("targetid_targettype")]
+ public string TargetType { get; set; }
+ }
+
+ public class StandardValueInfo
+ {
+ [JsonProperty("id")]
+ public string Id { get; set; }
+
+ [JsonProperty("inspectionresults")]
+ public InspectionResult InspectionResults { get; set; }
+
+ [JsonProperty("inspectionresultsname")]
+ public string InspectionResultsName { get; set; }
+
+ [JsonProperty("itemvaluetype")]
+ public string ItemValueType { get; set; }
+
+ [JsonProperty("lowercharacter")]
+ public string LowerCharacter { get; set; }
+
+ [JsonProperty("lowerdiffvalue")]
+ public decimal? LowerDiffValue { get; set; }
+
+ [JsonProperty("lowervalue")]
+ public decimal? LowerValue { get; set; }
+
+ [JsonProperty("note")]
+ public string Note { get; set; }
+
+ [JsonProperty("standardid")]
+ public string StandardId { get; set; }
+
+ [JsonProperty("standarditemid")]
+ public string StandardItemId { get; set; }
+
+ [JsonProperty("standardstrvalue")]
+ public string StandardStrValue { get; set; }
+
+ [JsonProperty("standardvalue")]
+ public string StandardValue { get; set; }
+
+ [JsonProperty("targetvalueid")]
+ public TargetValue TargetValue { get; set; }
+
+ [JsonProperty("uppercharacter")]
+ public string UpperCharacter { get; set; }
+
+ [JsonProperty("upperdiffvalue")]
+ public string UpperDiffValue { get; set; }
+
+ [JsonProperty("uppervalue")]
+ public string UpperValue { get; set; }
+
+ [JsonProperty("valueno")]
+ public string ValueNo { get; set; }
+ }
+
+ public class InspectionResult
+ {
+ [JsonProperty("inspectionresults")]
+ public string InspectionResults { get; set; }
+
+ [JsonProperty("inspectionresults_code")]
+ public string InspectionResultsCode { get; set; }
+
+ [JsonProperty("inspectionresults_enable")]
+ public string InspectionResultsEnable { get; set; }
+
+ [JsonProperty("inspectionresults_name")]
+ public string InspectionResultsName { get; set; }
+ }
+
+ public class TargetValue
+ {
+ [JsonProperty("targetvalueid")]
+ public string TargetValueId { get; set; }
+
+ [JsonProperty("targetvalueid_code")]
+ public string TargetValueCode { get; set; }
+
+ [JsonProperty("targetvalueid_name")]
+ public string TargetValueName { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/Interface_WebAPI/SlMesDbIterface/MOM/QTTemplateInfo.cs b/Interface_WebAPI/SlMesDbIterface/MOM/QTTemplateInfo.cs
new file mode 100644
index 0000000..4f51d6c
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/MOM/QTTemplateInfo.cs
@@ -0,0 +1,287 @@
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+namespace MisDataSaveDate.MOM
+{
+ public class QTTemplateInfo
+ {
+ [JsonProperty("note")]
+ public string Note { get; set; }
+
+ [JsonProperty("code")]
+ public string Code { get; set; }
+
+ [JsonProperty("productionworkcenter")]
+ public ProdWorkCenter ProductionWorkCenter { get; set; }
+
+ [JsonProperty("classidentifier2")]
+ public string ClassIdentifier2 { get; set; }
+
+ [JsonProperty("classidentifier1")]
+ public string ClassIdentifier1 { get; set; }
+
+ [JsonProperty("filedata")]
+ public string FileData { get; set; }
+
+ [JsonProperty("classidentifier4")]
+ public string ClassIdentifier4 { get; set; }
+
+ [JsonProperty("classidentifier3")]
+ public string ClassIdentifier3 { get; set; }
+
+ [JsonProperty("classidentifier6")]
+ public string ClassIdentifier6 { get; set; }
+
+ [JsonProperty("materialid")]
+ public MaterialID Material { get; set; }
+
+ [JsonProperty("type")]
+ public Type Type { get; set; }
+
+ [JsonProperty("classidentifier5")]
+ public string ClassIdentifier5 { get; set; }
+
+ [JsonProperty("procedureid")]
+ public ProcedureID Process { get; set; }
+
+ [JsonProperty("classidentifier8")]
+ public string ClassIdentifier8 { get; set; }
+
+ [JsonProperty("classidentifier7")]
+ public string ClassIdentifier7 { get; set; }
+
+ [JsonProperty("lastmodifieduserid")]
+ public string LastModifiedUserId { get; set; }
+
+ [JsonProperty("materialtype")]
+ public MaterialType MaterialType { get; set; }
+
+ [JsonProperty("createuserid")]
+ public string CreateUserId { get; set; }
+
+ [JsonProperty("lastmodifieduser")]
+ public string LastModifiedUser { get; set; }
+
+ [JsonProperty("id")]
+ public string Id { get; set; }
+
+ [JsonProperty("state")]
+ public string State { get; set; }
+
+ [JsonProperty("lastmodifiedtime")]
+ public string LastModifiedTime { get; set; }
+
+ [JsonProperty("createtime")]
+ public string CreateTime { get; set; }
+
+ [JsonProperty("xm_inspectfile")]
+ public List XmInspectFile { get; set; }
+
+ [JsonProperty("qualityorg")]
+ public QualityOrg QualityOrg { get; set; }
+
+ [JsonProperty("createuser")]
+ public string CreateUser { get; set; }
+
+ [JsonProperty("recordtemplateitems")]
+ public List RecordTemplateItems { get; set; }
+
+ [JsonProperty("name")]
+ public string Name { get; set; }
+
+ [JsonProperty("productionorg")]
+ public ProductionOrg ProductionOrg { get; set; }
+ }
+ public class ProdWorkCenter
+ {
+ [JsonProperty("productionworkcenter_ppsczx_zxbh")]
+ public string ProductionWorkCenterPpsczxZxbh { get; set; }
+
+ [JsonProperty("productionworkcenter")]
+ public string ProductionWorkCenter { get; set; }
+
+ [JsonProperty("productionworkcenter_name_chs")]
+ public string ProductionWorkCenterNameChs { get; set; }
+ }
+
+ public class MaterialID
+ {
+ [JsonProperty("materialid_code")]
+ public string MaterialIdCode { get; set; }
+
+ [JsonProperty("materialid")]
+ public string MaterialId { get; set; }
+
+ [JsonProperty("materialid_name_chs")]
+ public string MaterialIdNameChs { get; set; }
+ }
+
+ public class Type
+ {
+ [JsonProperty("type_name")]
+ public string TypeName { get; set; }
+
+ [JsonProperty("type")]
+ public string TypeID { get; set; }
+
+ [JsonProperty("type_code")]
+ public string TypeCode { get; set; }
+ }
+
+ public class ProcedureID
+ {
+ [JsonProperty("procedureid_ppbzgx_gxbh")]
+ public string ProcedureIdPpbzgxGxbh { get; set; }
+
+ [JsonProperty("procedureid_name_chs")]
+ public string ProcedureIdNameChs { get; set; }
+
+ [JsonProperty("procedureid")]
+ public string ProcedureId { get; set; }
+ }
+
+ public class MaterialType
+ {
+ [JsonProperty("materialtype_code")]
+ public string MaterialTypeCode { get; set; }
+
+ [JsonProperty("materialtype")]
+ public string MaterialTypeValue { get; set; }
+
+ [JsonProperty("materialtype_name_chs")]
+ public string MaterialTypeNameChs { get; set; }
+ }
+
+ public class QualityOrg
+ {
+ [JsonProperty("qualityorg_ppzzzl_zzbh")]
+ public string QualityOrgPpzzzlZzbh { get; set; }
+
+ [JsonProperty("qualityorg")]
+ public string QualityOrgValue { get; set; }
+
+ [JsonProperty("qualityorg_name_chs")]
+ public string QualityOrgNameChs { get; set; }
+ }
+
+ public class ProductionOrg
+ {
+ [JsonProperty("productionorg_name_chs")]
+ public string ProductionOrgNameChs { get; set; }
+
+ [JsonProperty("productionorg_ppzzsc_zzbh")]
+ public string ProductionOrgPpzzscZzbh { get; set; }
+
+ [JsonProperty("productionorg")]
+ public string ProductionOrgValue { get; set; }
+ }
+
+ public class DefaultResultValue
+ {
+ [JsonProperty("defaultresultvalue_code")]
+ public string DefaultResultValueCode { get; set; }
+
+ [JsonProperty("defaultresultvalue_name")]
+ public string DefaultResultValueName { get; set; }
+
+ [JsonProperty("defaultresultvalue")]
+ public string defaultResultValue { get; set; }
+ }
+
+ public class InspectionItemId
+ {
+ [JsonProperty("inspectionitemid_code")]
+ public string InspectionItemIdCode { get; set; }
+
+ [JsonProperty("inspectionitemid_name_chs")]
+ public string InspectionItemIdNameChs { get; set; }
+
+ [JsonProperty("inspectionitemid")]
+ public string inspectionItemId { get; set; }
+ }
+
+ public class RecordTemplateItem
+ {
+ [JsonProperty("inspectkey")]
+ public string InspectKey { get; set; }
+
+ [JsonProperty("note")]
+ public string Note { get; set; }
+
+ [JsonProperty("uploadattachments")]
+ public string UploadAttachments { get; set; }
+
+ [JsonProperty("mutualinspect")]
+ public string MutualInspect { get; set; }
+
+ [JsonProperty("importance")]
+ public string Importance { get; set; }
+
+ [JsonProperty("defaultvalue")]
+ public string DefaultValue { get; set; }
+
+ [JsonProperty("templateid")]
+ public string TemplateId { get; set; }
+
+ [JsonProperty("defaultresultvalue")]
+ public DefaultResultValue DefaultResult { get; set; }
+
+ [JsonProperty("requirementdesc")]
+ public string RequirementDesc { get; set; }
+
+ [JsonProperty("specialinspect")]
+ public string SpecialInspect { get; set; }
+
+ [JsonProperty("autoadject")]
+ public string AutoAdject { get; set; }
+
+ [JsonProperty("selfinspect")]
+ public string SelfInspect { get; set; }
+
+ [JsonProperty("inspectionitemstype")]
+ public string InspectionItemsType { get; set; }
+
+ [JsonProperty("requiredtext")]
+ public string RequiredText { get; set; }
+
+ [JsonProperty("firstinspect")]
+ public string FirstInspect { get; set; }
+
+ [JsonProperty("inspectionitemname")]
+ public string InspectionItemName { get; set; }
+
+ [JsonProperty("linenum")]
+ public string LineNum { get; set; }
+
+ [JsonProperty("id")]
+ public string Id { get; set; }
+
+ [JsonProperty("inspectionitemid")]
+ public InspectionItemId InspectionItem { get; set; }
+ }
+
+ public class XmInspectFile
+ {
+ [JsonProperty("fileuser")]
+ public string FileUser { get; set; }
+
+ [JsonProperty("filename")]
+ public string FileName { get; set; }
+
+ [JsonProperty("filesize")]
+ public string FileSize { get; set; }
+
+ [JsonProperty("id")]
+ public string Id { get; set; }
+
+ [JsonProperty("fileext")]
+ public string FileExt { get; set; }
+
+ [JsonProperty("templateid")]
+ public string TemplateId { get; set; }
+
+ [JsonProperty("fileid")]
+ public string FileId { get; set; }
+ }
+
+}
\ No newline at end of file
diff --git a/Interface_WebAPI/SlMesDbIterface/MOM/ShiftSchedule.cs b/Interface_WebAPI/SlMesDbIterface/MOM/ShiftSchedule.cs
new file mode 100644
index 0000000..c03a4b9
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/MOM/ShiftSchedule.cs
@@ -0,0 +1,32 @@
+using System;
+using System.Collections.Generic;
+using Newtonsoft.Json;
+namespace MisDataSaveDate.MOM
+{
+ public class ShiftSchedule
+ {
+ [JsonProperty("empID")]
+ public string EmployeeID { get; set; }
+
+ [JsonProperty("empCode")]
+ public string EmployeeCode { get; set; }
+
+ [JsonProperty("empName")]
+ public string EmployeeName { get; set; }
+
+ [JsonProperty("startDate")]
+ public string StartDate { get; set; }
+
+ [JsonProperty("endDate")]
+ public string EndDate { get; set; }
+
+ [JsonProperty("prodOrg")]
+ public string ProductionOrg { get; set; }
+
+ [JsonProperty("prodCenter")]
+ public string ProductionCenter { get; set; }
+
+ [JsonProperty("workProc")]
+ public string WorkProcess { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/Interface_WebAPI/SlMesDbIterface/MOM/UnitData.cs b/Interface_WebAPI/SlMesDbIterface/MOM/UnitData.cs
new file mode 100644
index 0000000..755b3fb
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/MOM/UnitData.cs
@@ -0,0 +1,29 @@
+using System;
+using System.Collections.Generic;
+using Newtonsoft.Json;
+namespace MisDataSaveDate.MOM
+{
+ public class UnitData
+ {
+ [JsonProperty("data")]
+ public List Data { get; set; }
+ }
+
+ public class Unit
+ {
+ [JsonProperty("unitID")]
+ public string UnitID { get; set; }
+
+ [JsonProperty("unitCode")]
+ public string UnitCode { get; set; }
+
+ [JsonProperty("unitName")]
+ public string UnitName { get; set; }
+
+ [JsonProperty("createTime")]
+ public string CreateTime { get; set; }
+
+ [JsonProperty("lastModifyTime")]
+ public string LastModifyTime { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/Interface_WebAPI/SlMesDbIterface/MOM/WorkCenterData.cs b/Interface_WebAPI/SlMesDbIterface/MOM/WorkCenterData.cs
new file mode 100644
index 0000000..3f8f8dd
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/MOM/WorkCenterData.cs
@@ -0,0 +1,42 @@
+using System;
+using System.Collections.Generic;
+using Newtonsoft.Json;
+namespace MisDataSaveDate.MOM
+{
+
+ public class WorkCenterData
+ {
+ [JsonProperty("data")]
+ public List Data { get; set; }
+ }
+
+ public class WorkCenter
+ {
+ [JsonProperty("workCenterID")]
+ public string WorkCenterID { get; set; }
+
+ [JsonProperty("workCenterCode")]
+ public string WorkCenterCode { get; set; }
+
+ [JsonProperty("workCenterName")]
+ public string WorkCenterName { get; set; }
+
+ [JsonProperty("orgID")]
+ public string OrgID { get; set; }
+
+ [JsonProperty("classification")]
+ public string Classification { get; set; }
+
+ [JsonProperty("level")]
+ public string LevelNo { get; set; }
+
+ [JsonProperty("detail")]
+ public string Detail { get; set; }
+
+ [JsonProperty("createTime")]
+ public string CreateTime { get; set; }
+
+ [JsonProperty("lastModifyTime")]
+ public string LastModifyTime { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/Interface_WebAPI/SlMesDbIterface/MOM/msgResHeader.cs b/Interface_WebAPI/SlMesDbIterface/MOM/msgResHeader.cs
new file mode 100644
index 0000000..03f27c7
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/MOM/msgResHeader.cs
@@ -0,0 +1,36 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace MisDataSaveDate
+{
+ public class MsgResHeader
+ {
+ ///
+ /// 返回结果
+ ///
+ public int code
+ {
+ get;
+ set;
+ }
+ ///
+ /// 返回消息
+ ///
+ public string message
+ {
+ get;
+ set;
+ }
+ ///
+ /// 返回结果集
+ ///
+ public T Data {
+ get;
+ set;
+ }
+ }
+
+}
diff --git a/Interface_WebAPI/SlMesDbIterface/MOM_Upload/DeviceAlarm.cs b/Interface_WebAPI/SlMesDbIterface/MOM_Upload/DeviceAlarm.cs
new file mode 100644
index 0000000..8716ce3
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/MOM_Upload/DeviceAlarm.cs
@@ -0,0 +1,80 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace MisDataSaveDate.MOM
+{
+ ///
+ /// 设备异常报警数据上传
+ ///
+
+ public class DeviceAlarm
+ {
+ ///
+ /// 派工单ID
+ ///
+ public string orderID { get; set; }
+
+ ///
+ /// 派工任务ID
+ ///
+ public string taskID { get; set; }
+
+ ///
+ /// 报警唯一标识
+ ///
+ public string id { get; set; }
+ ///
+ /// 异常工序
+ ///
+ public string processNo { get; set; }
+
+ ///
+ /// 报警代码
+ ///
+ public string alarmCode { get; set; }
+
+ ///
+ /// 报文/设备状态信息
+ ///
+ public string deviceInfo { get; set; }
+
+ ///
+ /// 异常类型
+ ///
+ public string exceptionType { get; set; }
+
+ ///
+ /// 异常信息
+ ///
+ public string exceptionInfo { get; set; }
+
+ ///
+ /// 异常发送人
+ ///
+ public string sender { get; set; }
+
+ ///
+ /// 异常位置
+ ///
+ public string location { get; set; }
+
+ ///
+ /// 异常生产中心
+ ///
+ public string productionCenter { get; set; }
+
+ ///
+ /// 创建时间
+ ///
+ public string createTime { get; set; }
+
+ ///
+ /// 最后修改时间
+ ///
+ public string lastModifiedTime { get; set; }
+
+ }
+}
diff --git a/Interface_WebAPI/SlMesDbIterface/MOM_Upload/DeviceInfo.cs b/Interface_WebAPI/SlMesDbIterface/MOM_Upload/DeviceInfo.cs
new file mode 100644
index 0000000..4821a14
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/MOM_Upload/DeviceInfo.cs
@@ -0,0 +1,29 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace MisDataSaveDate.MOM
+{
+ ///
+ /// 缓存位置查询
+ ///
+
+ public class DeviceInfo
+ {
+ ///
+ /// 请求编号
+ ///
+ public string id { get; set; } = "";
+ ///
+ /// 请求方标识
+ ///
+ public string callcode { get; set; } = "";
+ ///
+ /// 工位号
+ ///
+ public string containerNo { get; set; } = "";
+ }
+
+}
diff --git a/Interface_WebAPI/SlMesDbIterface/MOM_Upload/DeviceInfoResponse.cs b/Interface_WebAPI/SlMesDbIterface/MOM_Upload/DeviceInfoResponse.cs
new file mode 100644
index 0000000..0d4c473
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/MOM_Upload/DeviceInfoResponse.cs
@@ -0,0 +1,44 @@
+using System;
+using System.Collections.Generic;
+
+namespace MisDataSaveDate.MOM
+{
+ ///
+ /// 器具信息查询响应实体
+ ///
+ public class DeviceInfoResponse
+ {
+ public int code { get; set; }
+ public string message { get; set; }
+ public DeviceInfoData data { get; set; }
+ }
+
+ ///
+ /// 器具信息数据
+ ///
+ public class DeviceInfoData
+ {
+ public List businessdata { get; set; }
+ }
+
+ ///
+ /// 业务数据
+ ///
+ public class BusinessData
+ {
+ ///
+ /// 批次号
+ ///
+ public string batchno { get; set; }
+
+ ///
+ /// 数量
+ ///
+ public string qty { get; set; }
+
+ ///
+ /// 物料编号
+ ///
+ public string sku { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/Interface_WebAPI/SlMesDbIterface/MOM_Upload/DeviceStatus.cs b/Interface_WebAPI/SlMesDbIterface/MOM_Upload/DeviceStatus.cs
new file mode 100644
index 0000000..cb25693
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/MOM_Upload/DeviceStatus.cs
@@ -0,0 +1,37 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace MisDataSaveDate.MOM
+{
+ ///
+ /// 缓存位置查询
+ ///
+
+ public class DeviceStatus
+ {
+ ///
+ /// 请求编号
+ ///
+ public string MsgId { get; set; } = "";
+ ///
+ /// 请求方标识
+ ///
+ public string MsgSource { get; set; } = "";
+ ///
+ /// 工位号
+ ///
+ public string OPNo { get; set; } = "";
+ ///
+ /// 当前状态
+ ///
+ public int StatusCode { get; set; } = 0;
+ ///
+ /// 采集时间
+ ///
+ public string StatusTime { get; set; } = "";
+ }
+
+}
diff --git a/Interface_WebAPI/SlMesDbIterface/MOM_Upload/JobFinished.cs b/Interface_WebAPI/SlMesDbIterface/MOM_Upload/JobFinished.cs
new file mode 100644
index 0000000..d40ad80
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/MOM_Upload/JobFinished.cs
@@ -0,0 +1,98 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Xml.Linq;
+
+namespace MisDataSaveDate.MOM
+{
+ ///
+ /// 开工
+ ///
+
+ public class JobFinished
+ {
+ ///
+ /// 派工单ID
+ ///
+ public string orderID { get; set; }
+ ///
+ /// 派工任务ID
+ ///
+ public string taskID { get; set; }
+ ///
+ /// 工序ID
+ ///
+ public decimal finishedQuantity { get; set; }
+
+ ///
+ /// 操作时间
+ ///
+ public string createTime { get; set; }
+
+ ///
+ /// 操作人
+ ///
+ public string endTime { get; set; }
+
+ ///
+ /// 创建时间
+ ///
+ public decimal beat { get; set; }
+ public string processNo { get; set; }
+ public string lastModifiedTime { get; set; }
+ public List inspectionInfo { get; set; }
+ public List materialInfo { get; set; }
+ public List workinghours { get; set; }
+ ///
+ /// 操作:0取消开工,1开工
+ ///
+ public string operation { get; set; }
+
+ }
+ public class InspectionInfo
+ {
+ public string Inspectcode { get; set; }
+ public string inspector { get; set; }
+ public string inspectionTime { get; set; }
+ public decimal qualifiedQuantity { get; set; }
+ public decimal unqualifiedQuantity { get; set; }
+ public string templetecode { get; set; }
+ public List inspectionDetails { get; set; }
+ }
+ public class InspectionDetail
+ {
+ public string inspectionItemID { get; set; }
+ public string inspectionItemNo { get; set; }
+ public string inspectionItemName { get; set; }
+ public string inspectionValue { get; set; }
+ public string inspectionStandardText { get; set; }
+ public string upperLimitSymbol { get; set; }
+ public decimal upperLimitValue { get; set; }
+ public string lowerLimitSymbol { get; set; }
+ public decimal lowerLimitValue { get; set; }
+ public decimal standardValue { get; set; }
+ public string inspectionResult { get; set; }
+
+ }
+ public class MaterialInfo
+ {
+ public string consumedMaterialNo { get; set; }
+ public string type { get; set; }
+ public decimal qty { get; set; }
+ public decimal qualifiedqty { get; set; }
+ public decimal unqualifiedqty { get; set; }
+ public string inspectionTool { get; set; }
+ public string batchNo { get; set; }
+ public string serialNo { get; set; }
+
+ }
+ public class Workinghours
+ {
+ public string employee { get; set; }
+ public decimal quantity { get; set; }
+ public decimal workingHours { get; set; }
+ public string operation { get; set; }
+ }
+}
diff --git a/Interface_WebAPI/SlMesDbIterface/MOM_Upload/JobStart.cs b/Interface_WebAPI/SlMesDbIterface/MOM_Upload/JobStart.cs
new file mode 100644
index 0000000..ea5129a
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/MOM_Upload/JobStart.cs
@@ -0,0 +1,56 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Xml.Linq;
+using Newtonsoft.Json;
+
+namespace MisDataSaveDate.MOM
+{
+ ///
+ /// 开工
+ ///
+
+ public class JobStart
+ {
+ ///
+ /// 派工单ID
+ ///
+ public string orderID { get; set; }
+ ///
+ /// 派工任务ID
+ ///
+ public string taskID { get; set; }
+ ///
+ /// 工序ID
+ ///
+ public string processId { get; set; }
+
+ ///
+ /// 操作时间
+ ///
+ public string operationTime { get; set; }
+
+ ///
+ /// 操作人
+ ///
+ [JsonProperty("operator")]
+ public string operatorName { get; set; }
+
+ ///
+ /// 创建时间
+ ///
+ public string createTime { get; set; }
+
+ ///
+ /// 最后修改时间
+ ///
+ public string lastModifiedTime { get; set; }
+ ///
+ /// 操作:0取消开工,1开工
+ ///
+ public string operation { get; set; }
+
+ }
+}
diff --git a/Interface_WebAPI/SlMesDbIterface/MOM_Upload/MaterialConfirm.cs b/Interface_WebAPI/SlMesDbIterface/MOM_Upload/MaterialConfirm.cs
new file mode 100644
index 0000000..3b75a53
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/MOM_Upload/MaterialConfirm.cs
@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace MisDataSaveDate.MOM
+{
+ ///
+ /// 缓存位置查询
+ ///
+
+ public class MaterialConfirm
+ {
+ ///
+ /// 请求编号
+ ///
+ public string tackcode { get; set; } = "";
+ ///
+ /// 请求方标识
+ ///
+ public string orderID { get; set; } = "";
+ ///
+ /// 工位号
+ ///
+ public string taskID { get; set; } = "";
+ public string processId { get; set; } = "";
+ public string containerNo { get; set; } = "";
+ }
+
+}
diff --git a/Interface_WebAPI/SlMesDbIterface/MOM_Upload/MaterialPosition.cs b/Interface_WebAPI/SlMesDbIterface/MOM_Upload/MaterialPosition.cs
new file mode 100644
index 0000000..c76d66f
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/MOM_Upload/MaterialPosition.cs
@@ -0,0 +1,42 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace MisDataSaveDate.MOM
+{
+ ///
+ /// 缓存位置查询
+ ///
+
+ public class MaterialPosition
+ {
+ ///
+ /// 请求ID
+ ///
+ public string requestId { get; set; }
+
+ ///
+ /// 工序
+ ///
+ public string process { get; set; }
+
+ }
+ public class MaterialPositionInfo
+ {
+ ///
+ /// 工序编号
+ ///
+ public string processNo { get; set; }
+
+ ///
+ /// 位置编号
+ ///
+ public string locationNo { get; set; }
+ ///
+ /// 空位置数量编号
+ ///
+ public string emptySlots { get; set; }
+ }
+}
diff --git a/Interface_WebAPI/SlMesDbIterface/MOM_Upload/MaterialSend.cs b/Interface_WebAPI/SlMesDbIterface/MOM_Upload/MaterialSend.cs
new file mode 100644
index 0000000..4d5319b
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/MOM_Upload/MaterialSend.cs
@@ -0,0 +1,107 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace MisDataSaveDate.MOM
+{
+ ///
+ /// 物料配送
+ ///
+
+ public class MaterialSend
+ {
+ ///
+ /// 叫料任务号
+ ///
+ public string code { get; set; }
+
+ ///
+ /// 派工单ID
+ ///
+ public string orderID { get; set; }
+
+ ///
+ /// 派工任务ID
+ ///
+ public string taskID { get; set; }
+
+ ///
+ /// 顺序号
+ ///
+ public string sequenceNo { get; set; }
+
+ ///
+ /// 配送类型
+ ///
+ public string deliveryType { get; set; }
+
+ ///
+ /// 工序
+ ///
+ public string processStep { get; set; }
+
+ ///
+ /// 起始位置
+ ///
+ public string startLocation { get; set; }
+
+ ///
+ /// 终止位置
+ ///
+ public string endLocation { get; set; }
+
+ ///
+ /// 配送物料
+ ///
+ public string material { get; set; }
+
+ ///
+ /// 配送数量
+ ///
+ public int quantity { get; set; }
+
+ ///
+ /// 托盘号
+ ///
+ public string trayNumber { get; set; }
+
+ ///
+ /// 产线
+ ///
+ public string prodline { get; set; }
+
+ ///
+ /// 工位
+ ///
+ public string workstation { get; set; }
+
+ ///
+ /// 车间
+ ///
+ public string workshop { get; set; }
+
+ ///
+ /// 企业
+ ///
+ public string customerid { get; set; }
+
+ ///
+ /// 创建人
+ ///
+ public string creator { get; set; }
+
+ ///
+ /// 创建时间
+ ///
+ public string createTime { get; set; }
+
+ ///
+ /// 最后修改时间
+ ///
+ public string lastModifiedTime { get; set; }
+
+ }
+
+}
diff --git a/Interface_WebAPI/SlMesDbIterface/MOM_Upload/MaterialTransfer.cs b/Interface_WebAPI/SlMesDbIterface/MOM_Upload/MaterialTransfer.cs
new file mode 100644
index 0000000..22cfb5c
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/MOM_Upload/MaterialTransfer.cs
@@ -0,0 +1,77 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace MisDataSaveDate.MOM
+{
+ ///
+ /// 物料转序
+ ///
+ public class MaterialTransfer
+ {
+ ///
+ /// 请求编号,每个请求都要一个唯一编号,同一个请求重复提交,使用同一编号
+ ///
+ public string reqCode { get; set; }
+
+ ///
+ /// 请求时间截 格式: "yyyy-MM-dd HH:mm:ss"
+ ///
+ public string reqTime { get; set; }
+
+ ///
+ /// 令牌号, 由系统颁发
+ ///
+ public string tokenCode { get; set; }
+
+ ///
+ /// 客户端编号,如PDA,HCWMS等
+ ///
+ public string clientCode { get; set; }
+
+ ///
+ /// 任务模板编号
+ ///
+ public string taskType { get; set; }
+
+ ///
+ /// 1:搬运容器,2;搬运货架,默认:2
+ ///
+ public string moveTaskType { get; set; }
+
+ ///
+ /// 载具类型:0-空;1-满,搬运货架起点不是地码,搬运容器起点不是仓位时必填
+ /// 0:空料架;1:满料架
+ ///
+ public string vehicleStatus { get; set; }
+
+ ///
+ /// 位置列表(默认第一个位置是起点,第二个位置是终点)
+ ///
+ public List positionCodeList { get; set; }
+
+ ///
+ /// 派工任务id
+ ///
+ public string dataid { get; set; }
+ }
+
+ ///
+ /// 位置信息
+ ///
+ public class PositionInfo
+ {
+ ///
+ /// 00-地码(位置);05-仓位;04-区域
+ /// 00:工位;04:区域
+ ///
+ public string type { get; set; }
+
+ ///
+ /// 根据type填值,具体的点位
+ ///
+ public string positionCode { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/Interface_WebAPI/SlMesDbIterface/MOM_Upload/SpotCheckResult.cs b/Interface_WebAPI/SlMesDbIterface/MOM_Upload/SpotCheckResult.cs
new file mode 100644
index 0000000..5b4f735
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/MOM_Upload/SpotCheckResult.cs
@@ -0,0 +1,73 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Newtonsoft.Json;
+public class SpotCheckResult
+{
+ [JsonProperty("id")]
+ public string Id { get; set; } // 点检记录id
+
+ [JsonProperty("code")]
+ public string Code { get; set; } // 点检记录编号
+
+ [JsonProperty("checkplanid")]
+ public string CheckPlanId { get; set; } // 点检计划ID
+
+ [JsonProperty("createusercode")]
+ public string CreateUserCode { get; set; } // 点检记录编制人编号
+
+ [JsonProperty("createusername")]
+ public string CreateUserName { get; set; } // 点检记录编制人名称
+
+ [JsonProperty("createtime")]
+ public DateTime CreateTime { get; set; } // 点检时间
+
+ [JsonProperty("resultData")]
+ public List ResultData { get; set; } // 点检明细列表
+}
+
+public class CheckResultDetail
+{
+ [JsonProperty("resultid")]
+ public string ResultId { get; set; } // 点检明细id
+
+ [JsonProperty("checkplandetailid")]
+ public string CheckPlanDetailId { get; set; } // 点检计划详细信息ID
+
+ [JsonProperty("abnormal")]
+ public string Abnormal { get; set; } // 是否异常(假设为布尔值)
+
+ [JsonProperty("checkvalue")]
+ public string CheckValue { get; set; } // 点检值
+
+ [JsonProperty("checkresult")]
+ public string CheckResult { get; set; } // 点检结果
+
+ [JsonProperty("checkercode")]
+ public string CheckerCode { get; set; } // 点检人
+
+ [JsonProperty("checkername")]
+ public string CheckerName { get; set; } // 点检人名称
+
+ [JsonProperty("checktime")]
+ public string CheckTime { get; set; } // 实际点检时间
+
+ [JsonProperty("processresult")]
+ public string ProcessResult { get; set; } // 处理结果
+
+ [JsonProperty("processmethod")]
+ public string ProcessMethod { get; set; } // 处理方式
+
+ [JsonProperty("filebefore")]
+ public string FileBefore { get; set; } // 改善前附件
+
+ [JsonProperty("fileafter")]
+ public string FileAfter { get; set; } // 改善后附件
+
+ [JsonProperty("exdescribe")]
+ public string ExDescribe { get; set; } // 异常描述
+
+ [JsonProperty("nohandlereason")]
+ public string NoHandleReason { get; set; } // 不处理原因
+}
\ No newline at end of file
diff --git a/Interface_WebAPI/SlMesDbIterface/MOM_Upload/taskFinish.cs b/Interface_WebAPI/SlMesDbIterface/MOM_Upload/taskFinish.cs
new file mode 100644
index 0000000..8d28321
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/MOM_Upload/taskFinish.cs
@@ -0,0 +1,42 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace MisDataSaveDate.MOM
+{
+ ///
+ /// 任务完工与工时汇报
+ ///
+
+ public class TaskFinish
+ {
+ ///
+ /// 派工单ID
+ ///
+ public string orderID { get; set; }
+
+ ///
+ /// 派工任务ID
+ ///
+ public string taskID { get; set; }
+
+ ///
+ /// 员工
+ ///
+ public string employee { get; set; }
+
+ ///
+ /// 数量
+ ///
+ public int quantity { get; set; }
+
+ ///
+ /// 工时
+ ///
+ public int workingHours { get; set; }
+ }
+
+
+}
diff --git a/Interface_WebAPI/SlMesDbIterface/MessageHanlder/ApiTools.cs b/Interface_WebAPI/SlMesDbIterface/MessageHanlder/ApiTools.cs
new file mode 100644
index 0000000..a51e14d
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/SlMesDbIterface/MessageHanlder/CallWebApi.cs b/Interface_WebAPI/SlMesDbIterface/MessageHanlder/CallWebApi.cs
new file mode 100644
index 0000000..6af3a4f
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/MessageHanlder/CallWebApi.cs
@@ -0,0 +1,355 @@
+using ExternalDataSync;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.IO;
+using System.Linq;
+using System.Net;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace WebApi
+{
+ 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 Post_XK(string url, string content)
+ {
+
+ var WebapiPostHeader_Tenant = ConfigurationManager.AppSettings["WebapiPostHeader_Tenant"];
+ var WebapiPostHeader_Language = ConfigurationManager.AppSettings["WebapiPostHeader_Language"];
+ var WebapiPostHeader_Authorization = ConfigurationManager.AppSettings["WebapiPostHeader_Authorization"];
+ var WebapiPostHeader_Systemcode = ConfigurationManager.AppSettings["WebapiPostHeader_Systemcode"];
+
+ ServicePointManager.ServerCertificateValidationCallback = (sender, certificate, chain, sslPolicyErrors) => true;
+
+ string result = "";
+ HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
+
+ req.Headers.Add("X-ECC-Current-Tenant", WebapiPostHeader_Tenant);
+ req.Headers.Add("Accept-Language", WebapiPostHeader_Language);
+ req.Headers.Add("Authorization", WebapiPostHeader_Authorization);
+ //req.Headers.Add("Connect-Type", "application/json");
+ req.Headers.Add("Systemcode", WebapiPostHeader_Systemcode);
+
+ req.Accept = "*/*";
+ req.Method = "POST";
+ req.ContentType = "application/json";
+ req.Timeout = 10000;
+
+ try
+ {
+ byte[] data = Encoding.UTF8.GetBytes(content);
+ req.ContentLength = data.Length;
+ using (Stream reqStream = req.GetRequestStream())
+ {
+ reqStream.Write(data, 0, data.Length);
+ reqStream.Close();
+ }
+ }
+ catch (Exception ex)
+ {
+ return JsonConvert.SerializeObject(new { code = 500, message = ex.Message, data = new object() });
+ }
+
+
+ try
+ {
+ using (HttpWebResponse resp = (HttpWebResponse)req.GetResponse())
+ using (Stream stream = resp.GetResponseStream())
+ using (StreamReader reader = new StreamReader(stream, Encoding.UTF8))
+ {
+ result = reader.ReadToEnd();
+ }
+ }
+ catch (WebException ex)
+ {
+ if (ex.Response != null)
+ {
+ using (Stream stream = ex.Response.GetResponseStream())
+ using (StreamReader reader = new StreamReader(stream, Encoding.UTF8))
+ {
+ result = reader.ReadToEnd();
+ }
+ }
+ else
+ {
+ result = JsonConvert.SerializeObject(new { code = 500, message = ex.Message, data = new object() });
+ }
+ }
+ catch (Exception ex)
+ {
+
+ result = JsonConvert.SerializeObject(new { code = 500, message = ex.Message, data = new object() });
+ }
+
+ return result;
+ }
+
+ public static string Post_Auto(string url, string content)
+ {
+ ServicePointManager.ServerCertificateValidationCallback = (sender, certificate, chain, sslPolicyErrors) => true;
+
+ string result = "";
+
+ try
+ {
+ HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
+ req.Headers.Add("Connect-Type", "application/json");
+ req.Accept = "*/*";
+ req.Method = "POST";
+ req.ContentType = "application/json";
+ req.Timeout = 10000;
+
+ // 写入请求数据
+ if (!string.IsNullOrEmpty(content))
+ {
+ byte[] data = Encoding.UTF8.GetBytes(content);
+ req.ContentLength = data.Length;
+ using (Stream reqStream = req.GetRequestStream())
+ {
+ reqStream.Write(data, 0, data.Length);
+ }
+ }
+ else
+ {
+ req.ContentLength = 0;
+ }
+
+ // 获取响应
+ using (HttpWebResponse resp = (HttpWebResponse)req.GetResponse())
+ using (Stream stream = resp.GetResponseStream())
+ using (StreamReader reader = new StreamReader(stream, Encoding.UTF8))
+ {
+ result = reader.ReadToEnd();
+ }
+ }
+ catch (WebException ex)
+ {
+ if (ex.Response != null)
+ {
+ using (Stream stream = ex.Response.GetResponseStream())
+ using (StreamReader reader = new StreamReader(stream, Encoding.UTF8))
+ {
+ result = reader.ReadToEnd();
+ }
+ }
+ else
+ {
+ // 返回标准格式的错误信息
+ result = JsonConvert.SerializeObject(new { code = 500, message = ex.Message });
+ }
+ }
+ catch (Exception ex)
+ {
+ // 返回标准格式的错误信息
+ result = JsonConvert.SerializeObject(new { code = 500, message = ex.Message });
+ }
+
+ return result;
+ }
+
+ public static JObject Post_WebAPI(string WebAPI_Url, string m_msg)
+ {
+ try
+ {
+ return JsonConvert.DeserializeObject(WebApi.Post.Post_Auto(WebAPI_Url, m_msg));
+ }
+ catch (Exception ex)
+ {
+ return new JObject { { "code", 500 }, { "Message", ex.Message }, { "data", new JObject() } };
+ }
+ }
+
+ 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/Interface_WebAPI/SlMesDbIterface/MessageHanlder/DeviceTools.cs b/Interface_WebAPI/SlMesDbIterface/MessageHanlder/DeviceTools.cs
new file mode 100644
index 0000000..895833a
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/SlMesDbIterface/MessageHanlder/FTPHelper.cs b/Interface_WebAPI/SlMesDbIterface/MessageHanlder/FTPHelper.cs
new file mode 100644
index 0000000..df8e7d0
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/SlMesDbIterface/MessageHanlder/GetVal.cs b/Interface_WebAPI/SlMesDbIterface/MessageHanlder/GetVal.cs
new file mode 100644
index 0000000..6043381
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/SlMesDbIterface/MessageHanlder/HttpCli.cs b/Interface_WebAPI/SlMesDbIterface/MessageHanlder/HttpCli.cs
new file mode 100644
index 0000000..cefdfd7
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/SlMesDbIterface/MessageHanlder/InitServer.cs b/Interface_WebAPI/SlMesDbIterface/MessageHanlder/InitServer.cs
new file mode 100644
index 0000000..a2870f2
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/MessageHanlder/InitServer.cs
@@ -0,0 +1,150 @@
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+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.MaxReceivedMessageSize = 1024 * 1024 * 10;
+ //config.Routes.MapHttpRoute(
+ // name: "DefaultApi",
+ // routeTemplate: "api/{controller}/{id}",
+ // defaults: new { id = RouteParameter.Optional }
+ //);
+
+ // 自定义路由匹配到action
+ config.Routes.MapHttpRoute(
+ name: "API Default",
+ routeTemplate: "api/{controller}/{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/Interface_WebAPI/SlMesDbIterface/MessageHanlder/LocalNetworkFileHelper.cs b/Interface_WebAPI/SlMesDbIterface/MessageHanlder/LocalNetworkFileHelper.cs
new file mode 100644
index 0000000..7460b81
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/MessageHanlder/LocalNetworkFileHelper.cs
@@ -0,0 +1,329 @@
+using ICSharpCode.SharpZipLib.Zip;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.IO;
+using System.Linq;
+using System.Net;
+using System.Net.NetworkInformation;
+using System.Reflection;
+using System.Runtime.InteropServices;
+using System.Security.Cryptography;
+using System.Text;
+using System.Threading.Tasks;
+using System.Web.UI.WebControls;
+
+namespace ExternalDataSync.MessageHanlder
+{
+ public class LocalNetworkFileHelper
+ {
+ [DllImport("Shlwapi.dll", SetLastError = true, CharSet = CharSet.Auto)]
+ public extern static bool PathFileExists(string path);
+ ///
+ /// 连接远程共享文件夹
+ ///
+ /// 远程共享文件夹的路径
+ /// 用户名
+ /// 密码
+ public static bool connectState(string path, string userName, string passWord, out string Sharefile_Error)
+ {
+ Sharefile_Error = "";
+ bool Flag = false;
+ Process proc = new Process();
+ try
+ {
+ proc.StartInfo.FileName = "cmd.exe";
+ proc.StartInfo.UseShellExecute = false;
+ proc.StartInfo.RedirectStandardInput = true;
+ proc.StartInfo.RedirectStandardOutput = true;
+ proc.StartInfo.RedirectStandardError = true;
+ proc.StartInfo.CreateNoWindow = true;
+ proc.Start();
+ string dosLine = "net use " + path + " " + passWord + " /user:" + userName;
+ proc.StandardInput.WriteLine(dosLine);
+ proc.StandardInput.WriteLine("exit");
+ while (!proc.HasExited)
+ {
+ proc.WaitForExit(1000);
+ }
+ string errormsg = proc.StandardError.ReadToEnd();
+ proc.StandardError.Close();
+ if (string.IsNullOrEmpty(errormsg))
+ {
+ Flag = true;
+ }
+ else
+ {
+ Sharefile_Error = errormsg;
+ }
+ }
+ catch (Exception ex)
+ {
+ Sharefile_Error = ex.Message;
+ }
+ finally
+ {
+ proc.Close();
+ proc.Dispose();
+ }
+ return Flag;
+ }
+
+ ///
+ /// 从远程服务器下载文件到本地
+ ///
+ /// 远程服务器路径(共享文件夹路径)
+ /// 下载到本地后的文件路径
+ /// 下载到本地文件名称,包含扩展名:ABC.text
+ public static bool TransportRemoteToLocal(string SourceFile, string LocalFile, string LocalFileName, out string Sharefile_Error, out byte[] fileContent)
+ {
+ fileContent = null;
+ Sharefile_Error = "";
+ bool rel = false;
+ try
+ {
+
+ if (Directory.Exists(LocalFile))
+ {
+ Directory.Delete(LocalFile, true);
+ }
+ Directory.CreateDirectory(LocalFile);
+ //从远程服务器下载到本地的文件
+ if (LocalFile.EndsWith(@"\"))
+ {
+ LocalFile = LocalFile + LocalFileName;
+ }
+ else
+ {
+ LocalFile = LocalFile + "\\" + LocalFileName;
+ }
+ //远程服务器文件 此处假定远程服务器共享文件夹下确实包含本文件,否则程序报错
+ FileStream inFileStream = new FileStream(SourceFile, FileMode.Open);
+ FileStream outFileStream = new FileStream(LocalFile, FileMode.OpenOrCreate);
+ byte[] buf = new byte[inFileStream.Length];
+ int byteCount;
+ while ((byteCount = inFileStream.Read(buf, 0, buf.Length)) > 0)
+ {
+ outFileStream.Write(buf, 0, byteCount);
+ fileContent = new byte[buf.Length];
+ Array.Copy(buf, fileContent, buf.Length);
+ }
+ inFileStream.Flush();
+ inFileStream.Close();
+ outFileStream.Flush();
+ outFileStream.Close();
+ rel = true;
+ }
+ catch (Exception ex)
+ {
+ Sharefile_Error = ex.Message;
+ }
+ return rel;
+ }
+
+ ///
+ /// 从远程服务器下载文件到本地
+ ///
+ /// 远程服务器路径(共享文件夹路径)
+ /// 下载到本地后的文件路径
+ public static bool TransportRemoteToLocal(string SourceFilePath, string LocalFilePath, out string Sharefile_Error)
+ {
+ Sharefile_Error = "";
+ bool rel = false;
+ try
+ {
+ if (!Directory.Exists(SourceFilePath))
+ {
+ Sharefile_Error = "共享文件路径不存在!" + SourceFilePath;
+ return false;
+ }
+ if (!Directory.Exists(LocalFilePath))
+ {
+ Directory.CreateDirectory(LocalFilePath);
+ }
+ IEnumerable files = System.IO.Directory.EnumerateFileSystemEntries(SourceFilePath);
+ if (files != null && files.Count() > 0)
+ {
+ foreach (var item in files)
+ {
+ string desPath = System.IO.Path.Combine(LocalFilePath, System.IO.Path.GetFileName(item));
+ //如果是文件
+ var fileExist = System.IO.File.Exists(item);
+ if (fileExist)
+ {
+ //复制文件到指定目录下
+ System.IO.File.Copy(item, desPath, true);
+ continue;
+ }
+ //如果是文件夹
+ TransportRemoteToLocal(item, desPath, out string aaa);
+ }
+ }
+ rel = true;
+ }
+ catch (Exception ex)
+ {
+ Sharefile_Error = ex.Message;
+ }
+ return rel;
+ }
+ public static class DirectoryExtension
+ {
+ public static bool IsShareAccessible(string path)
+ {
+
+ return true;
+
+ //Ping ping = new Ping();
+ //var response = ping.Send(path, 4);
+
+
+ //string errorMessage;
+ //var timeStart = DateTime.Now;
+ //using (var process = new Process {
+ // StartInfo = {
+ // FileName = "cmd.exe",
+ // UseShellExecute = false,
+ // RedirectStandardInput = true,
+ // RedirectStandardOutput = true,
+ // CreateNoWindow = true,
+ // RedirectStandardError = true
+ // }
+ //})
+ //{
+ // process.Start();
+ // process.StandardInput.AutoFlush = true;
+ // process.StandardInput.WriteLine(@"net use " + path);
+ // process.StandardInput.WriteLine("exit");
+ // errorMessage = process.StandardError.ReadToEnd();
+ // process.WaitForExit();
+ // if (string.IsNullOrEmpty(errorMessage))
+ // {
+ // return true;
+ // }
+ // else
+ // {
+ // return false;
+ // }
+ //}
+ }
+
+ public static bool FtpFolderExists(string folderPath, string username, string password)
+ {
+ FtpWebRequest request = (FtpWebRequest)WebRequest.Create(folderPath);
+ request.Credentials = new NetworkCredential(username, password);
+ request.Method = WebRequestMethods.Ftp.ListDirectory;
+
+ try
+ {
+ using (FtpWebResponse response = (FtpWebResponse)request.GetResponse())
+ {
+ return true; // 如果成功获取响应,则文件夹存在
+ }
+ }
+ catch (WebException ex)
+ {
+ return false; // 文件夹不存在
+ }
+ }
+
+ }
+ ///
+ /// 从远程服务器下载文件到本地
+ ///
+ /// 远程服务器路径(共享文件夹路径)
+ /// 下载到本地后的文件路径
+ /// 下载到本地文件名称,包含扩展名:ABC.text
+ public static bool TransportRemoteToLocalZip(string SourceFile, string LocalFile, string LocalFileName, string zipedFolder, out string Sharefile_Error)
+ {
+ Sharefile_Error = "";
+ bool rel = false;
+ try
+ {
+ //远程服务器文件 此处假定远程服务器共享文件夹下确实包含本文件,否则程序报错
+ FileStream inFileStream = new FileStream(SourceFile, FileMode.Open);
+ if (Directory.Exists(LocalFile))
+ {
+ Directory.Delete(LocalFile, true);
+ }
+ Directory.CreateDirectory(LocalFile);
+ //从远程服务器下载到本地的文件
+ if (LocalFile.EndsWith(@"\"))
+ {
+ LocalFile = LocalFile + LocalFileName;
+ }
+ else
+ {
+ LocalFile = LocalFile + "\\" + LocalFileName;
+ }
+
+ FileStream outFileStream = new FileStream(LocalFile, FileMode.OpenOrCreate);
+ byte[] buf = new byte[inFileStream.Length];
+ int byteCount;
+ while ((byteCount = inFileStream.Read(buf, 0, buf.Length)) > 0)
+ {
+ outFileStream.Write(buf, 0, byteCount);
+ }
+ inFileStream.Flush();
+ inFileStream.Close();
+ outFileStream.Flush();
+ outFileStream.Close();
+
+ ZipHelper.UnZip(LocalFile, zipedFolder);
+ rel = true;
+ }
+ catch (Exception ex)
+ {
+ Sharefile_Error = ex.Message;
+ }
+ return rel;
+ }
+
+ ///
+ /// 将本地文件上传到远程服务器共享目录
+ ///
+ /// 本地文件的绝对路径,包含扩展名
+ /// 远程服务器共享文件路径,不包含文件扩展名
+ /// 上传到远程服务器后的文件扩展名
+ public static bool TransportLocalToRemote(string SourceFile, string RemoteFile, string RemoteFileName, out string Sharefile_Error) //src
+ {
+ Sharefile_Error = "";
+ //string SourceFile, string LocalFile, string LocalFileName
+ bool rel = false;
+ try
+ {
+ FileStream inFileStream = new FileStream(SourceFile, FileMode.Open); //此处假定本地文件存在,不然程序会报错
+ if (!Directory.Exists(RemoteFile)) //判断上传到的远程服务器路径是否存在
+ {
+ Directory.CreateDirectory(RemoteFile);
+ }
+ //上传到远程服务器共享文件夹后文件的绝对路径
+ if (!RemoteFile.EndsWith(@"\"))
+ {
+ RemoteFile = RemoteFile + RemoteFileName;
+ }
+ else
+ {
+ RemoteFile = RemoteFile + "\\" + RemoteFileName;
+ }
+ FileStream outFileStream = new FileStream(RemoteFile, FileMode.OpenOrCreate);
+ byte[] buf = new byte[inFileStream.Length];
+ int byteCount;
+ while ((byteCount = inFileStream.Read(buf, 0, buf.Length)) > 0)
+ {
+ outFileStream.Write(buf, 0, byteCount);
+ }
+ inFileStream.Flush();
+ inFileStream.Close();
+ outFileStream.Flush();
+ outFileStream.Close();
+ rel = true;
+ }
+ catch (Exception ex)
+ {
+ Sharefile_Error = ex.Message;
+ }
+ return rel;
+ }
+ }
+}
diff --git a/Interface_WebAPI/SlMesDbIterface/MessageHanlder/Re.cs b/Interface_WebAPI/SlMesDbIterface/MessageHanlder/Re.cs
new file mode 100644
index 0000000..001c77e
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/SlMesDbIterface/MessageHanlder/ZipHelper.cs b/Interface_WebAPI/SlMesDbIterface/MessageHanlder/ZipHelper.cs
new file mode 100644
index 0000000..3ffd69a
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/MessageHanlder/ZipHelper.cs
@@ -0,0 +1,245 @@
+using ICSharpCode.SharpZipLib.Zip;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ExternalDataSync.MessageHanlder
+{
+ ///
+ /// 适用于ZIP压缩
+ ///
+ public class ZipHelper
+ {
+ #region 压缩
+ ///
+ /// 压缩文件夹
+ ///
+ /// 要压缩的文件夹路径
+ /// 压缩前的Stream,方法执行后变为压缩完成后的文件
+ /// 密码
+ /// 是否成功
+ public static bool ZipDirectoryToStream(string folderToZip, Stream Stream, string password = null)
+ {
+ return ZipDirectoryToZipStream(folderToZip, Stream, password) != null;
+ }
+
+ ///
+ /// 压缩文件夹
+ ///
+ /// 要压缩的文件夹路径
+ /// 压缩前的Stream,方法执行后变为压缩完成后的文件
+ /// 密码
+ /// 是否压缩成功返回ZipOutputStream,否则返回null
+ public static ZipOutputStream ZipDirectoryToZipStream(string folderToZip, Stream Stream, string password = null)
+ {
+ if (!Directory.Exists(folderToZip))
+ {
+ return null;
+ }
+ ZipOutputStream zipStream = new ZipOutputStream(Stream);
+ zipStream.SetLevel(6);
+ if (!string.IsNullOrEmpty(password))
+ {
+ zipStream.Password = password;
+ }
+ if (ZipDirectory(folderToZip, zipStream, ""))
+ {
+ zipStream.Finish();
+ return zipStream;
+ }
+ GC.Collect(1);
+ return null;
+ }
+
+ ///
+ /// 递归压缩文件夹的内部方法
+ ///
+ /// 要压缩的文件夹路径
+ /// 压缩输出流
+ /// 此文件夹的上级文件夹
+ /// 是否成功
+ private static bool ZipDirectory(string folderToZip, ZipOutputStream zipStream, string parentFolderName)
+ {
+ var crc = new ICSharpCode.SharpZipLib.Checksum.Crc32();
+
+ //这段是创建空文件夹,注释掉可以去掉空文件夹(因为在写入文件的时候也会创建文件夹)
+ //if (!string.IsNullOrEmpty(parentFolderName))
+ //{
+ // ent = new ZipEntry(parentFolderName + "/");
+ // zipStream.PutNextEntry(ent);
+ // zipStream.Flush();
+ //}
+
+ var files = Directory.GetFiles(folderToZip);
+ foreach (string file in files)
+ {
+ byte[] buffer = File.ReadAllBytes(file);
+ var ent = new ZipEntry(parentFolderName + "/" + Path.GetFileName(file));
+ //ent.DateTime = File.GetLastWriteTime(file);//设置文件最后修改时间
+ ent.DateTime = DateTime.Now;
+ ent.Size = buffer.Length;
+
+ crc.Reset();
+ crc.Update(buffer);
+
+ ent.Crc = crc.Value;
+ zipStream.PutNextEntry(ent);
+ zipStream.Write(buffer, 0, buffer.Length);
+ }
+
+ var folders = Directory.GetDirectories(folderToZip);
+ foreach (var folder in folders)
+ {
+ var _parentFolderName = parentFolderName + "\\" + folder.Substring(folder.LastIndexOf('\\') + 1);
+ if (!ZipDirectory(folder, zipStream, _parentFolderName))
+ {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ ///
+ /// 压缩文件夹
+ ///
+ /// 要压缩的文件夹路径
+ /// 压缩文件完整路径
+ /// 密码
+ /// 是否成功
+ public static bool ZipDirectory(string folderToZip, string zipedFile, string password = null)
+ {
+ var zipStream = ZipDirectoryToZipStream(folderToZip, new FileStream(zipedFile, FileMode.Create, FileAccess.Write), password);
+ if (zipStream == null)
+ {
+ return false;
+ }
+ zipStream.Close();
+ return true;
+ }
+
+ ///
+ /// 压缩文件
+ ///
+ /// 要压缩的文件全名
+ /// 压缩后的文件名
+ /// 密码
+ /// 是否成功
+ public static bool ZipFile(string fileToZip, string zipedFile, string password = null)
+ {
+ if (!File.Exists(fileToZip))
+ {
+ return false;
+ }
+ var fs = File.OpenRead(fileToZip);
+ byte[] buffer = new byte[fs.Length];
+ fs.Read(buffer, 0, buffer.Length);
+ fs.Close();
+
+ fs = File.Create(zipedFile);
+ var ent = new ZipEntry(Path.GetFileName(fileToZip));
+ using (var zipStream = new ZipOutputStream(fs))
+ {
+ if (!string.IsNullOrEmpty(password))
+ {
+ zipStream.Password = password;
+ }
+ zipStream.PutNextEntry(ent);
+ zipStream.SetLevel(6);
+ zipStream.Write(buffer, 0, buffer.Length);
+ }
+
+ if (fs != null)
+ {
+ fs.Close();
+ fs.Dispose();
+ }
+
+ GC.Collect(1);
+
+ return true;
+ }
+
+ ///
+ /// 压缩文件或文件夹
+ ///
+ /// 要压缩的路径
+ /// 压缩后的文件名
+ /// 密码
+ /// 是否成功
+ public static bool Zip(string fileToZip, string zipedFile, string password = null)
+ {
+ if (Directory.Exists(fileToZip))
+ {
+ return ZipDirectory(fileToZip, zipedFile, password);
+ }
+ else if (File.Exists(fileToZip))
+ {
+ return ZipFile(fileToZip, zipedFile, password);
+ }
+ return false;
+ }
+ #endregion
+
+ #region 解压
+ ///
+ /// 解压功能(解压压缩文件到指定目录)
+ ///
+ /// 待解压的文件
+ /// 指定解压目标目录
+ /// 密码
+ /// 是否成功
+ public static bool UnZip(string fileToUnZip, string zipedFolder, string password = null)
+ {
+ if (!System.IO.File.Exists(fileToUnZip))
+ {
+ return false;
+ }
+
+ if (!Directory.Exists(zipedFolder))
+ {
+ Directory.CreateDirectory(zipedFolder);
+ }
+
+ if (!zipedFolder.EndsWith("\\"))
+ {
+ zipedFolder += "\\";
+ }
+ ZipEntry ent = null;
+ using (var zipStream = new ZipInputStream(System.IO.File.OpenRead(fileToUnZip)))
+ {
+ if (!string.IsNullOrEmpty(password))
+ {
+ zipStream.Password = password;
+ }
+ while ((ent = zipStream.GetNextEntry()) != null)
+ {
+ if (ent.IsDirectory)
+ {
+ continue;
+ }
+ if (string.IsNullOrEmpty(ent.Name))
+ {
+ continue;
+ }
+ string fileName = zipedFolder + ent.Name.Replace('/', '\\');
+ var index = ent.Name.LastIndexOf('/');
+ if (index != -1)
+ {
+ string path = zipedFolder + ent.Name.Substring(0, index).Replace('/', '\\');
+ System.IO.Directory.CreateDirectory(path);
+ }
+ var bytes = new byte[ent.Size];
+ zipStream.Read(bytes, 0, bytes.Length);
+ System.IO.File.WriteAllBytes(fileName, bytes);
+ }
+ }
+ GC.Collect(1);
+ return true;
+ }
+ #endregion
+ }
+
+}
diff --git a/Interface_WebAPI/SlMesDbIterface/Program.cs b/Interface_WebAPI/SlMesDbIterface/Program.cs
new file mode 100644
index 0000000..cfaaa8e
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/Program.cs
@@ -0,0 +1,30 @@
+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
+ {
+ ///
+ /// 应用程序的主入口点。
+ ///
+ [STAThread]
+ static void Main()
+ {
+ bool bCanRun = false;
+ System.Threading.Mutex mutex = new System.Threading.Mutex(true, "InterfaceUpLoad508SMALL_AGV", out bCanRun);
+ if (!bCanRun)
+ {
+ MessageBox.Show("508小AGV接口数据上传 程序 正在运行!不可重复启动!");
+ return;
+ }
+ Application.EnableVisualStyles();
+ Application.SetCompatibleTextRenderingDefault(false);
+ Application.Run(new Form_MoveSqlTable());
+ }
+ }
+}
diff --git a/Interface_WebAPI/SlMesDbIterface/Properties/AssemblyInfo.cs b/Interface_WebAPI/SlMesDbIterface/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..fb7c2d0
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/SlMesDbIterface/Properties/Resources.Designer.cs b/Interface_WebAPI/SlMesDbIterface/Properties/Resources.Designer.cs
new file mode 100644
index 0000000..c36b797
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/SlMesDbIterface/Properties/Resources.resx b/Interface_WebAPI/SlMesDbIterface/Properties/Resources.resx
new file mode 100644
index 0000000..e08dc5a
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/SlMesDbIterface/Properties/Settings.Designer.cs b/Interface_WebAPI/SlMesDbIterface/Properties/Settings.Designer.cs
new file mode 100644
index 0000000..5f6e85b
--- /dev/null
+++ b/Interface_WebAPI/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/Interface_WebAPI/SlMesDbIterface/Properties/Settings.settings b/Interface_WebAPI/SlMesDbIterface/Properties/Settings.settings
new file mode 100644
index 0000000..3964565
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/Properties/Settings.settings
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/Interface_WebAPI/SlMesDbIterface/SQLHelper/DataAccess.cs b/Interface_WebAPI/SlMesDbIterface/SQLHelper/DataAccess.cs
new file mode 100644
index 0000000..daa7472
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/SQLHelper/DataAccess.cs
@@ -0,0 +1,606 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.Specialized;
+using System.Configuration;
+using System.Data;
+using System.Data.SqlClient;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace DataLinkMesWork2
+{
+ public class DataAccess2
+ {
+ public static string ConnectionString_MES = ConfigurationManager.AppSettings["ConnectionString_MES"];
+ public static bool ExecuteNonQuery(string sql, string connectionString, out string errorMessage)
+ {
+ bool result = false;
+ errorMessage = "";
+ using (SqlConnection conn = new SqlConnection(connectionString))
+ {
+ try
+ {
+ using (SqlCommand cmd = new SqlCommand(sql, conn))
+ {
+ //if (!SqlServerConnectionStatus) return false;
+ conn.Open();
+ cmd.ExecuteNonQuery();
+ }
+ //SqlServerConnectionStatus = true;
+ result = true;
+ }
+ catch (Exception e)
+ {
+ errorMessage = e.ToString();
+ //TestConnection();
+ //ApplicationLog.WriteLog(e, "\r\nExecuteNonQuery\r\nSQL��䣺\r\n" + sql + "\r\n�����ַ�����\r\n" + connectionString);
+ }
+ finally
+ {
+ if (conn.State == ConnectionState.Open)
+ conn.Close();
+ }
+ }
+ return result;
+
+ }
+ public static bool ExecuteDataset(string sql, string connectionString, out DataSet ds, out string errorMessage)
+ {
+ errorMessage = "";
+ bool result = true;
+ errorMessage = "";
+ ds = new DataSet();
+
+ /// SQLSERVER
+ /// SQLiteDB
+ try
+ {
+ //bool result = false;
+ errorMessage = "";
+ ds = new DataSet();
+ using (SqlConnection conn = new SqlConnection(connectionString))
+ {
+ try
+ {
+ //if (!SqlServerConnectionStatus) return false;
+ conn.Open();
+ using (SqlDataAdapter dsCommand = new SqlDataAdapter())
+ {
+ dsCommand.SelectCommand = new SqlCommand(sql, conn);
+ dsCommand.Fill(ds);
+ }
+ //SqlServerConnectionStatus = true;
+ result = true;
+ }
+ catch (Exception e)
+ {
+ errorMessage = e.ToString();
+ //TestConnection();
+ //ApplicationLog.WriteLog(e, "\r\nExecuteNonQuery\r\nSQL��䣺\r\n" + sql + "\r\n�����ַ�����\r\n" + connectionString);
+ }
+ finally
+ {
+ if (conn.State == ConnectionState.Open)
+ conn.Close();
+ }
+ }
+ return result;
+ }
+ catch (Exception err)
+ {
+
+ }
+
+ return result;
+
+
+ }
+ ///
+ /// 增 删 改
+ ///
+ ///
+ ///
+ ///
+ public static bool ExecuteStoredProcedure(string procedureName, ref SqlParameter[] sqlParameters, out string errorMessage)
+ {
+ string connectionString = ConnectionString_MES;
+ errorMessage="";
+ bool result = false;
+ errorMessage = "";
+ using (SqlConnection conn = new SqlConnection(connectionString))
+ {
+ try
+ {
+ //if (!SqlServerConnectionStatus) return false;
+ conn.Open();
+ using (SqlCommand cmd = new SqlCommand(procedureName, conn))
+ {
+ cmd.CommandTimeout = 0;
+ cmd.CommandType = CommandType.StoredProcedure;
+ if (sqlParameters != null)
+ {
+ for (int i = 0; i < sqlParameters.Length; i++)
+ {
+ cmd.Parameters.Add(sqlParameters[i]);
+ }
+ }
+ cmd.ExecuteNonQuery();
+ }
+ //SqlServerConnectionStatus = true;
+ result = true;
+ }
+ catch (Exception e)
+ {
+ errorMessage = e.ToString();
+ if (conn.State == ConnectionState.Open)
+ conn.Close();
+ //TestConnection();
+ ////ApplicationLog.WriteLog(e, "\r\nExecuteStoredProcedure\r\n�洢���̣�\r\n" + procedureName + "\r\n�����ַ�����\r\n" + connectionString);
+ }
+ finally
+ {
+ if (conn.State == ConnectionState.Open)
+ conn.Close();
+ }
+ }
+ return result;
+ }
+ public static bool ExecuteStoredProcedure(string procedureName, ref SqlParameter[] sqlParameters,out DataTable dt, out string errorMessage)
+ {
+ string connectionString = ConnectionString_MES;
+ errorMessage="";
+ bool result = false;
+ errorMessage = "";
+ //ds = new DataSet();
+ dt = new DataTable();
+ using (SqlConnection conn = new SqlConnection(connectionString))
+ {
+ try
+ {
+ //if (!SqlServerConnectionStatus) return false;
+ conn.Open();
+ using (SqlDataAdapter dsCommand = new SqlDataAdapter())
+ {
+ dsCommand.SelectCommand = new SqlCommand(procedureName, conn);
+ dsCommand.SelectCommand.CommandType = CommandType.StoredProcedure;
+ dsCommand.SelectCommand.CommandTimeout = 0;
+ if (sqlParameters != null)
+ {
+ for (int i = 0; i < sqlParameters.Length; i++)
+ {
+ dsCommand.SelectCommand.Parameters.Add(sqlParameters[i]);
+ }
+ }
+
+ dsCommand.Fill(dt);
+ }
+ //SqlServerConnectionStatus = true;
+ result = true;
+ }
+ catch (Exception e)
+ {
+ errorMessage = e.ToString();
+ //TestConnection();
+ ////ApplicationLog.WriteLog(e, "\r\nExecuteStoredProcedure\r\n�洢���̣�\r\n" + procedureName + "\r\n�����ַ�����\r\n" + connectionString);
+ }
+ finally
+ {
+ if (conn.State == ConnectionState.Open)
+ conn.Close();
+ }
+ }
+ return result;
+ }
+ public static bool ExecuteStoredProcedure(string procedureName, ref SqlParameter[] sqlParameters, out DataSet ds, out string errorMessage)
+ {
+ string connectionString = ConnectionString_MES;
+ errorMessage = "";
+ bool result = false;
+ errorMessage = "";
+ ds = new DataSet();
+ using (SqlConnection conn = new SqlConnection(connectionString))
+ {
+ try
+ {
+ //if (!SqlServerConnectionStatus) return false;
+ conn.Open();
+ using (SqlDataAdapter dsCommand = new SqlDataAdapter())
+ {
+ dsCommand.SelectCommand = new SqlCommand(procedureName, conn);
+ dsCommand.SelectCommand.CommandType = CommandType.StoredProcedure;
+ dsCommand.SelectCommand.CommandTimeout = 0;
+ if (sqlParameters != null)
+ {
+ for (int i = 0; i < sqlParameters.Length; i++)
+ {
+ dsCommand.SelectCommand.Parameters.Add(sqlParameters[i]);
+ }
+ }
+
+ dsCommand.Fill(ds);
+ }
+ //SqlServerConnectionStatus = true;
+ result = true;
+ }
+ catch (Exception e)
+ {
+ errorMessage = e.ToString();
+ //TestConnection();
+ ////ApplicationLog.WriteLog(e, "\r\nExecuteStoredProcedure\r\n�洢���̣�\r\n" + procedureName + "\r\n�����ַ�����\r\n" + connectionString);
+ }
+ finally
+ {
+ if (conn.State == ConnectionState.Open)
+ conn.Close();
+ }
+ }
+ return result;
+ }
+ public static bool ExecuteDataset(string sql, out DataSet ds)
+ {
+ string errorMessage;
+ string connectionString = ConnectionString_MES;
+ bool result = false;
+ errorMessage = "";
+ ds = new DataSet();
+ using (SqlConnection conn = new SqlConnection(connectionString))
+ {
+ try
+ {
+ //if (!SqlServerConnectionStatus) return false;
+ conn.Open();
+ using (SqlDataAdapter dsCommand = new SqlDataAdapter())
+ {
+ dsCommand.SelectCommand = new SqlCommand(sql, conn);
+ dsCommand.Fill(ds);
+ }
+ //SqlServerConnectionStatus = true;
+ result = true;
+ }
+ catch (Exception e)
+ {
+ errorMessage = e.ToString();
+ //TestConnection();
+ ////ApplicationLog.WriteLog(e, "\r\nExecuteNonQuery\r\nSQL��䣺\r\n" + sql + "\r\n�����ַ�����\r\n" + connectionString);
+ }
+ finally
+ {
+ if (conn.State == ConnectionState.Open)
+ conn.Close();
+ }
+ }
+ return result;
+ }
+
+ public static bool ExecuteDataTable(string sql, out DataTable dt)
+ {
+ //public static bool ExecuteDataTable(string sql, string connectionString, out DataTable dt, out string errorMessage)
+ string errorMessage;
+ string connectionString = ConnectionString_MES;
+ bool result = false;
+ errorMessage = "";
+ dt = new DataTable();
+ using (SqlConnection conn = new SqlConnection(connectionString))
+ {
+ try
+ {
+ //if (!SqlServerConnectionStatus) return false;
+ conn.Open();
+ using (SqlDataAdapter dsCommand = new SqlDataAdapter())
+ {
+ dsCommand.SelectCommand = new SqlCommand(sql, conn);
+ dsCommand.Fill(dt);
+ }
+ //SqlServerConnectionStatus = true;
+ result = true;
+ }
+ catch (Exception e)
+ {
+ errorMessage = e.ToString();
+ //TestConnection();
+ ////ApplicationLog.WriteLog(e, "\r\nExecuteNonQuery\r\nSQL��䣺\r\n" + sql + "\r\n�����ַ�����\r\n" + connectionString);
+ }
+ finally
+ {
+ if (conn.State == ConnectionState.Open)
+ conn.Close();
+ }
+ }
+ return result;
+ }
+
+ public static DataTable ExecuteSQL(string sql, ref SqlParameter[] sqlParameters, out string errorMessage)
+ {
+ string connectionString = ConnectionString_MES;
+ bool result = false;
+ errorMessage = "";
+ DataTable dt = new DataTable();
+ using (SqlConnection conn = new SqlConnection(connectionString))
+ {
+ try
+ {
+ //if (!SqlServerConnectionStatus) return false;
+ conn.Open();
+ using (SqlDataAdapter dsCommand = new SqlDataAdapter(sql, conn))
+ {
+ if (sqlParameters != null)
+ {
+ for (int i = 0; i < sqlParameters.Length; i++)
+ {
+ dsCommand.SelectCommand.Parameters.Add(sqlParameters[i]);
+ }
+ }
+ dsCommand.Fill(dt);
+ }
+ result = true;
+ }
+ catch (Exception e)
+ {
+ errorMessage = e.ToString();
+ ////ApplicationLog.WriteLog(e, "\r\nExecuteSelectMesWork\r\n" + sql + "\r\n" + connectionString);
+ }
+ finally
+ {
+ if (conn.State == ConnectionState.Open)
+ conn.Close();
+ }
+ }
+ return dt;
+ }
+
+ public static bool ExecuteSQL(string sql, out string errorMessage)
+ {
+ string connectionString = ConnectionString_MES;
+ bool result = false;
+ errorMessage = "";
+ using (SqlConnection conn = new SqlConnection(connectionString))
+ {
+ try
+ {
+ using (SqlCommand cmd = new SqlCommand(sql, conn))
+ {
+ //if (!SqlServerConnectionStatus) return false;
+ conn.Open();
+ cmd.ExecuteNonQuery();
+ }
+ //SqlServerConnectionStatus = true;
+ result = true;
+ }
+ catch (Exception e)
+ {
+ errorMessage = e.ToString();
+ //TestConnection();
+ ////ApplicationLog.WriteLog(e, "\r\nExecuteNonQuery\r\nSQL��䣺\r\n" + sql + "\r\n�����ַ�����\r\n" + connectionString);
+ }
+ finally
+ {
+ if (conn.State == ConnectionState.Open)
+ conn.Close();
+ }
+ }
+ return result;
+ }
+
+ ///
+ /// 提供通用的调用存储过程的方法(增加数据的数据表的到数据库的调用)
+ ///
+ /// 存储过程名称
+ /// 存储过程参数数组
+ /// 增加数据的数据表
+ ///
+ public static bool ExecuteStoredProcedure(string procedureName, ref SqlParameter[] sqlParameters, DataTable dt, out string errorMessage)
+ {
+ string connectionString = ConnectionString_MES;
+ bool result = false;
+ errorMessage = "";
+ using (SqlConnection conn = new SqlConnection(connectionString))
+ {
+ try
+ {
+ // if (!SqlServerConnectionStatus) return false;
+ conn.Open();
+ using (SqlDataAdapter dsCommand = new SqlDataAdapter())
+ {
+ dsCommand.InsertCommand = new SqlCommand(procedureName, conn);
+ dsCommand.InsertCommand.CommandType = CommandType.StoredProcedure;
+ for (int i = 0; i < sqlParameters.Length; i++)
+ {
+ dsCommand.InsertCommand.Parameters.Add(sqlParameters[i]);
+ }
+ if (dt == null) return false;
+ dt.AcceptChanges();
+ for (int i = 0; i < dt.Rows.Count; i++)
+ {
+ dt.Rows[i].SetAdded();
+ }
+ dsCommand.Update(dt);
+ }
+ //SqlServerConnectionStatus = true;
+ result = true;
+ }
+ catch (Exception e)
+ {
+ errorMessage = e.ToString();
+ //TestConnection();
+ ////ApplicationLog.WriteLog(e, "\r\nExecuteStoredProcedure\r\n�洢���̣�\r\n" + procedureName + "\r\n�����ַ�����\r\n" + connectionString);
+ }
+ finally
+ {
+ if (conn.State == ConnectionState.Open)
+ conn.Close();
+ }
+ }
+ return result;
+ }
+
+ ///
+ /// 提供通用的调用存储过程的方法(增加数据的数据表的到数据库的调用)
+ ///
+ ///
+ ///
+ ///
+ public static bool ExecuteStoredProcedure(string procedureName, out DataTable dt, out string errorMessage)
+ {
+ string connectionString = ConnectionString_MES;
+ bool result = false;
+ errorMessage = "";
+ dt = new DataTable();
+ using (SqlConnection conn = new SqlConnection(connectionString))
+ {
+ try
+ {
+
+ //if (!SqlServerConnectionStatus) return false;
+ conn.Open();
+ using (SqlDataAdapter dsCommand = new SqlDataAdapter())
+ {
+ dsCommand.SelectCommand = new SqlCommand(procedureName, conn);
+ dsCommand.SelectCommand.CommandType = CommandType.StoredProcedure;
+
+ dsCommand.Fill(dt);
+ }
+ //SqlServerConnectionStatus = true;
+ result = true;
+ }
+ catch (Exception e)
+ {
+ errorMessage = e.ToString();
+ //TestConnection();
+ ////ApplicationLog.WriteLog(e, "\r\nExecuteStoredProcedure\r\n�洢���̣�\r\n" + procedureName + "\r\n�����ַ�����\r\n" + connectionString);
+ }
+ finally
+ {
+ if (conn.State == ConnectionState.Open)
+ conn.Close();
+ }
+ }
+ return result;
+ }
+
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static bool ExecuteSQL(string sql, ref SqlParameter[] sqlParameters, DataTable dt, out string errorMessage)
+ {
+ string connectionString = ConnectionString_MES;
+ bool result = false;
+ errorMessage = "";
+ using (SqlConnection conn = new SqlConnection(connectionString))
+ {
+
+
+ try
+ {
+ // if (!SqlServerConnectionStatus) return false;
+ conn.Open();
+ using (SqlDataAdapter dsCommand = new SqlDataAdapter())
+ {
+ dsCommand.InsertCommand = new SqlCommand(sql, conn);
+
+ for (int i = 0; i < sqlParameters.Length; i++)
+ {
+ sqlParameters[i].IsNullable = true;
+ dsCommand.InsertCommand.Parameters.Add(sqlParameters[i]);
+ }
+ if (dt == null) return false;
+ dt.AcceptChanges();
+ for (int i = 0; i < dt.Rows.Count; i++)
+ {
+ dt.Rows[i].SetAdded();
+ }
+ dsCommand.Update(dt);
+ }
+ //SqlServerConnectionStatus = true;
+ result = true;
+ }
+ catch (Exception e)
+ {
+ //ApplicationConfig.ConnectionStringPIS_NEW_Value = "0";
+ //TestConnection();
+ //errorMessage = e.ToString();
+ ////ApplicationLog.WriteLog(e, "\r\nExecuteSQL\r\nSQL��䣺\r\n" + sql + "\r\n�����ַ�����\r\n" + connectionString);
+ }
+ finally
+ {
+ if (conn.State == ConnectionState.Open)
+ conn.Close();
+ }
+ }
+ return result;
+ }
+
+ public static bool ExecuteNonQuery_newID(string sql, out long newID)
+ {
+ sql += ";select @@identity";
+ string connectionString;
+ connectionString = ConnectionString_MES;
+ using (SqlConnection conn = new SqlConnection(connectionString))
+ {
+ try
+ {
+ using (SqlCommand cmd = new SqlCommand(sql, conn))
+ {
+ conn.Open();
+ newID = Convert.ToInt64(cmd.ExecuteScalar());
+ }
+ return true;
+ }
+ catch (Exception e)
+ {
+ newID = 0;
+ //TestConnection();
+ ////ApplicationLog.WriteLog(e, "\r\n ExecuteNonQuery_newID\r\n�洢���̣�\r\n" + sql + "\r\n�����ַ�����\r\n" + connectionString);
+ return false;
+ }
+ finally
+ {
+ if (conn.State == ConnectionState.Open)
+ conn.Close();
+ }
+ }
+ }
+
+ public static bool ExecuteOutNum(string sql, out int count)
+ {
+ string connectionString;
+ connectionString = ConnectionString_MES;
+ string errorMessage;
+ bool result = false;
+ errorMessage = "";
+ using (SqlConnection conn = new SqlConnection(connectionString))
+ {
+ count = 0;
+ try
+ {
+ using (SqlCommand cmd = new SqlCommand(sql, conn))
+ {
+ //if (!SqlServerConnectionStatus) return false;
+ conn.Open();
+ count = Convert.ToInt32(cmd.ExecuteScalar().ToString());
+ }
+ //SqlServerConnectionStatus = true;
+ result = true;
+ }
+ catch (Exception e)
+ {
+ errorMessage = e.ToString();
+ //TestConnection();
+ ////ApplicationLog.WriteLog(e, "\r\nExecuteNonQuery\r\nSQL��䣺\r\n" + sql + "\r\n�����ַ�����\r\n" + connectionString);
+ }
+ finally
+ {
+ if (conn.State == ConnectionState.Open)
+ conn.Close();
+ }
+ }
+ return result;
+ }
+ }
+
+
+}
diff --git a/Interface_WebAPI/SlMesDbIterface/SQLHelper/JsonHelper.cs b/Interface_WebAPI/SlMesDbIterface/SQLHelper/JsonHelper.cs
new file mode 100644
index 0000000..0e6aa68
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/SQLHelper/JsonHelper.cs
@@ -0,0 +1,333 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Text;
+using System.Text.RegularExpressions;
+using System.Data;
+using System.Runtime.Serialization.Json;
+using System.Web.Script.Serialization;
+
+public class JsonHelper
+{
+ #region 序列化和反序列化
+ // 序列化
+ public static string JsonSerializer(T t)
+ {
+ // 使用 DataContractJsonSerializer 将 T 对象序列化为内存流。
+ DataContractJsonSerializer jsonSerializer = new DataContractJsonSerializer(typeof(T));
+ MemoryStream ms = new MemoryStream();
+ // 使用 WriteObject 方法将 JSON 数据写入到流中。
+ jsonSerializer.WriteObject(ms, t);
+ // 流转字符串
+ string jsonString = Encoding.UTF8.GetString(ms.ToArray());
+ ms.Close();
+ //替换Json的Date字符串
+ string p = @"\\/Date\((\d+)\+\d+\)\\/";
+ MatchEvaluator matchEvaluator = new MatchEvaluator(ConvertJsonDateToDateString);
+ Regex reg = new Regex(p);
+ jsonString = reg.Replace(jsonString, matchEvaluator);
+ return jsonString;
+ }
+ public static T JsonDeserialize(string jsonString)
+ {
+ //将"yyyy-MM-dd HH:mm:ss"格式的字符串转为"\/Date(1294499956278+0800)\/"格式
+ string p = @"\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}";
+ MatchEvaluator matchEvaluator = new MatchEvaluator(ConvertDateStringToJsonDate);
+ Regex reg = new Regex(p);
+ jsonString = reg.Replace(jsonString, matchEvaluator);
+ DataContractJsonSerializer jsonSerializer = new DataContractJsonSerializer(typeof(T));
+ // 字符串转流
+ MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(jsonString));
+ // 通过使用 DataContractJsonSerializer 的 ReadObject 方法,将 JSON 编码数据反序列化为T
+ T obj = (T)jsonSerializer.ReadObject(ms);
+ return obj;
+ }
+ public static string ConvertJsonDateToDateString(Match match)
+ {
+ string result = string.Empty;
+ DateTime dateTime = new DateTime(1970, 1, 1);
+ dateTime = dateTime.AddMilliseconds(long.Parse(match.Groups[1].Value));
+ dateTime = dateTime.ToLocalTime();
+ result = dateTime.ToString("yyyy-MM-dd HH:mm:ss");
+ return result;
+ }
+ private static string ConvertDateStringToJsonDate(Match m)
+ {
+ string result = string.Empty;
+ DateTime dt = DateTime.Parse(m.Groups[0].Value);
+ dt = dt.ToUniversalTime();
+ TimeSpan ts = dt - DateTime.Parse("1970-01-01");
+ result = string.Format("\\/Date({0}+0800)\\/", ts.TotalMilliseconds);
+ return result;
+ }
+ #endregion
+
+ // 对象转换为Json
+ public static string ObjectToJson(object obj)
+ {
+ JavaScriptSerializer js = new JavaScriptSerializer();
+ js.MaxJsonLength = Int32.MaxValue; // 定义JavaScriptSerializer接受字符串的最大长度 hdk 20180524
+ try
+ {
+ return js.Serialize(obj);
+ }
+ catch (Exception exception)
+ {
+
+ throw new Exception(exception.Message);
+ }
+ }
+ // 数据表转化为集合
+ public static List> DataTableToList(DataTable dt)
+ {
+ List> list = new List>();
+ foreach (DataRow dataRow in dt.Rows)
+ {
+ Dictionary dic = new Dictionary();
+
+
+ foreach (DataColumn dc in dt.Columns)
+ {
+ if (dataRow[dc.ColumnName].GetType() == typeof(DateTime))
+ {
+ string str = Convert.ToDateTime(dataRow[dc.ColumnName]).ToString("yyyy-MM-dd HH:mm:ss");
+ dic.Add(dc.ColumnName, str);
+ }
+ else if
+ (dataRow[dc.ColumnName].GetType() == typeof(byte[]))
+ {
+ string str = Convert.ToBase64String((byte[])dataRow[dc.ColumnName]);
+ dic.Add(dc.ColumnName, str);
+ }
+ else
+ {
+ dic.Add(dc.ColumnName, dataRow[dc.ColumnName]);
+ }
+
+ //Type type1 = dt.Rows[0]["产品图片"].GetType();
+ //Type type2 = typeof(byte[]);
+
+ }
+ list.Add(dic);
+ }
+ return list;
+ }
+ ///
+ /// 表转换为Json
+ ///
+ ///
+ ///
+ public static string DataTableToJson(DataTable dt)
+ {
+ return ObjectToJson(DataTableToList(dt));
+ }
+ ///
+ /// 将DataTable中的数据转换成JSON格式
+ ///
+ /// 数据源DataTable
+ /// 是否输出数据总条数
+ /// JSON中显示的数据总条数
+ ///
+ public static string CreateJsonParameters(DataTable dt, bool displayCount, int totalcount)
+ {
+ StringBuilder JsonString = new StringBuilder();
+ //Exception Handling
+
+ if (dt != null)
+ {
+ JsonString.Append("{ ");
+ JsonString.Append("\"rows\":[ ");
+ for (int i = 0; i < dt.Rows.Count; i++)
+ {
+ JsonString.Append("{ ");
+ for (int j = 0; j < dt.Columns.Count; j++)
+ {
+ if (j < dt.Columns.Count - 1)
+ {
+ //if (dt.Rows[i][j] == DBNull.Value) continue;
+ if (dt.Columns[j].DataType == typeof(bool))
+ {
+ JsonString.Append("\"" + dt.Columns[j].ColumnName.ToLower() + "\":" +
+ dt.Rows[i][j].ToString().ToLower() + ",");
+ }
+ else if (dt.Columns[j].DataType == typeof(string))
+ {
+ JsonString.Append("\"" + dt.Columns[j].ColumnName.ToLower() + "\":" +
+ ObjectToJson(dt.Rows[i][j]).ToString() + ",");
+ //JsonString.Append("\"" + dt.Columns[j].ColumnName.ToLower() + "\":" + "\"" +
+ // dt.Rows[i][j].ToString().Replace("\"", "\\\"") + "\",");
+ }
+ else
+ {
+ JsonString.Append("\"" + dt.Columns[j].ColumnName.ToLower() + "\":" + "\"" + dt.Rows[i][j] + "\",");
+ }
+ }
+ else if (j == dt.Columns.Count - 1)
+ {
+ //if (dt.Rows[i][j] == DBNull.Value) continue;
+ if (dt.Columns[j].DataType == typeof(bool))
+ {
+ JsonString.Append("\"" + dt.Columns[j].ColumnName.ToLower() + "\":" +
+ dt.Rows[i][j].ToString().ToLower());
+ }
+ else if (dt.Columns[j].DataType == typeof(string))
+ {
+ JsonString.Append("\"" + dt.Columns[j].ColumnName.ToLower() + "\":" +
+ ObjectToJson(dt.Rows[i][j]).ToString());
+ //JsonString.Append("\"" + dt.Columns[j].ColumnName.ToLower() + "\":" + "\"" +
+ // dt.Rows[i][j].ToString().Replace("\"", "\\\"") + "\"");
+ }
+ else
+ {
+ JsonString.Append("\"" + dt.Columns[j].ColumnName.ToLower() + "\":" + "\"" + dt.Rows[i][j] + "\"");
+ }
+ }
+ }
+ /*end Of String*/
+ if (i == dt.Rows.Count - 1)
+ {
+ JsonString.Append("} ");
+ }
+ else
+ {
+ JsonString.Append("}, ");
+ }
+ }
+ JsonString.Append("]");
+
+ if (displayCount)
+ {
+ JsonString.Append(",");
+
+ JsonString.Append("\"total\":");
+ JsonString.Append(totalcount);
+ }
+
+ JsonString.Append("}");
+ return JsonString.ToString().Replace("\n", "");
+ }
+ else
+ {
+ return null;
+ }
+ }
+ public static string CreateJsonParameters(DataTable dt)
+ {
+ StringBuilder JsonString = new StringBuilder();
+ //Exception Handling
+
+ if (dt != null)
+ {
+ JsonString.Append("{ ");
+ JsonString.Append("\"rows\":[ ");
+ for (int i = 0; i < dt.Rows.Count; i++)
+ {
+ JsonString.Append("{ ");
+ for (int j = 0; j < dt.Columns.Count; j++)
+ {
+ if (j < dt.Columns.Count - 1)
+ {
+ //if (dt.Rows[i][j] == DBNull.Value) continue;
+ if (dt.Columns[j].DataType == typeof(bool))
+ {
+ JsonString.Append("\"" + dt.Columns[j].ColumnName.ToLower() + "\":" +
+ dt.Rows[i][j].ToString().ToLower() + ",");
+ }
+ else if (dt.Columns[j].DataType == typeof(string))
+ {
+ JsonString.Append("\"" + dt.Columns[j].ColumnName.ToLower() + "\":" +
+ ObjectToJson(dt.Rows[i][j]).ToString() + ",");
+ //JsonString.Append("\"" + dt.Columns[j].ColumnName.ToLower() + "\":" + "\"" +
+ // dt.Rows[i][j].ToString().Replace("\"", "\\\"") + "\",");
+ }
+ else
+ {
+ JsonString.Append("\"" + dt.Columns[j].ColumnName.ToLower() + "\":" + "\"" + dt.Rows[i][j] + "\",");
+ }
+ }
+ else if (j == dt.Columns.Count - 1)
+ {
+ //if (dt.Rows[i][j] == DBNull.Value) continue;
+ if (dt.Columns[j].DataType == typeof(bool))
+ {
+ JsonString.Append("\"" + dt.Columns[j].ColumnName.ToLower() + "\":" +
+ dt.Rows[i][j].ToString().ToLower());
+ }
+ else if (dt.Columns[j].DataType == typeof(string))
+ {
+ JsonString.Append("\"" + dt.Columns[j].ColumnName.ToLower() + "\":" +
+ ObjectToJson(dt.Rows[i][j]).ToString());
+ //JsonString.Append("\"" + dt.Columns[j].ColumnName.ToLower() + "\":" + "\"" +
+ // dt.Rows[i][j].ToString().Replace("\"", "\\\"") + "\"");
+ }
+ else
+ {
+ JsonString.Append("\"" + dt.Columns[j].ColumnName.ToLower() + "\":" + "\"" + dt.Rows[i][j] + "\"");
+ }
+ }
+ }
+ /*end Of String*/
+ if (i == dt.Rows.Count - 1)
+ {
+ JsonString.Append("} ");
+ }
+ else
+ {
+ JsonString.Append("}, ");
+ }
+ }
+ JsonString.Append("]");
+
+ JsonString.Append("}");
+ return JsonString.ToString().Replace("\n", "");
+ }
+ else
+ {
+ return null;
+ }
+ }
+ StringBuilder result = new StringBuilder();
+ StringBuilder sb = new StringBuilder();
+ ///
+ /// 根据DataTable生成EasyUI Tree Json树结构
+ ///
+ /// 数据源
+ /// ID列
+ /// Text列
+ /// 节点Url
+ /// 关系字段
+ /// 父ID
+ public string GetTreeJsonByTable(DataTable tabel, string idCol, string txtCol, string url, string rela, object pId)
+ {
+ result.Append(sb.ToString());
+ sb.Clear();
+ if (tabel.Rows.Count > 0)
+ {
+ sb.Append("[");
+ string filer = string.Format("{0}='{1}'", rela, pId);
+ DataRow[] rows = tabel.Select(filer);
+ if (rows.Length > 0)
+ {
+ foreach (DataRow row in rows)
+ {
+ sb.Append("{\"id\":\"" + row[idCol] + "\",\"text\":\"" + row[txtCol] + "\",\"attributes\":\"" + row[url] + "\",\"state\":\"open\"");
+ if (tabel.Select(string.Format("{0}='{1}'", rela, row[idCol])).Length > 0)
+ {
+ sb.Append(",\"children\":");
+ GetTreeJsonByTable(tabel, idCol, txtCol, url, rela, row[idCol]);
+ result.Append(sb.ToString());
+ sb.Clear();
+ }
+ result.Append(sb.ToString());
+ sb.Clear();
+ sb.Append("},");
+ }
+ sb = sb.Remove(sb.Length - 1, 1);
+ }
+ sb.Append("]");
+ result.Append(sb.ToString());
+ sb.Clear();
+ }
+ return result.ToString();
+ }
+}
\ No newline at end of file
diff --git a/Interface_WebAPI/SlMesDbIterface/WebAPI/AGV/AGV_BusinessLogic.cs b/Interface_WebAPI/SlMesDbIterface/WebAPI/AGV/AGV_BusinessLogic.cs
new file mode 100644
index 0000000..d314ecd
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/WebAPI/AGV/AGV_BusinessLogic.cs
@@ -0,0 +1,428 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Configuration;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+using ExternalDataSync;
+using MesServerWork;
+using MisDataSaveDate;
+using System.Net.Http;
+using System.Web.Http;
+using MisDataSaveDate.MOM;
+using System.Data.SqlClient;
+using static MisDataSaveDate.Helper.ApiLogHelper;
+using MisDataSaveDate.Helper;
+using WebApi;
+using System.Security.Policy;
+using System.Data;
+using MisDataFunDll;
+using System.Reflection.Emit;
+
+namespace MisDataSaveDate
+{
+ ///
+ /// AGV业务处理类
+ ///
+ public class AGV_BusinessLogic
+ {
+ static string agvBaseUrl = ConfigurationManager.AppSettings["AGV_BaseUrl"];
+
+ ///
+ /// 处理AGV进入请求业务逻辑
+ ///
+ /// 接口URL
+ /// AGV请求数据
+ /// 处理结果
+ public static string ProcessAGVEnterRequest(string url, [FromBody] JObject jobj)
+ {
+ var result = new AGV_Response();
+ result.code = "0";
+ result.message = "";
+ result.reqCode = "";
+ string errorMessage = "";
+
+ if (jobj == null)
+ {
+ result.code = "1";
+ result.message = "参数格式不正确!";
+ result.reqCode = "";
+ string retString1 = JsonConvert.SerializeObject(result);
+ SaveMesLog("AGV进入请求", "参数格式不正确!", MesLogType.ERROR);
+ MyLog4Net.MyLogHelper.Info("AGV请求进入接口res:", retString1);
+ return retString1;
+ }
+
+ string str = jobj.ToString();
+ //存储请求日志
+ SaveLog_Interface_Request(url, 2, str, out int AID);
+
+ try
+ {
+ // 解析AGV请求内容
+ AGV_EnterRequest enterRequest = JsonConvert.DeserializeObject(str);
+
+ // 必填字段校验
+ if (string.IsNullOrWhiteSpace(enterRequest.reqCode))
+ {
+ throw new Exception("请求编号(reqCode)不能为空");
+ }
+
+ if (string.IsNullOrWhiteSpace(enterRequest.reqTime))
+ {
+ throw new Exception("请求时间戳(reqTime)不能为空");
+ }
+
+ if (string.IsNullOrWhiteSpace(enterRequest.currentPositionCode))
+ {
+ throw new Exception("当前位置编号(currentPositionCode)不能为空");
+ }
+
+ if (string.IsNullOrWhiteSpace(enterRequest.method))
+ {
+ throw new Exception("方法名(method)不能为空");
+ }
+
+ if (string.IsNullOrWhiteSpace(enterRequest.robotCode))
+ {
+ throw new Exception("AGV编号(robotCode)不能为空");
+ }
+
+ if (string.IsNullOrWhiteSpace(enterRequest.taskCode))
+ {
+ throw new Exception("任务编号(taskCode)不能为空");
+ }
+
+ string method = enterRequest.method.Trim().ToLower();
+ if (method != "apply" && method != "release" && method != "lower" && method != "raise")
+ {
+ throw new Exception($"不支持的method:{enterRequest.method}");
+ }
+
+ //enterRequest.currentPositionCode = RemoveTrailingZero(enterRequest.currentPositionCode);
+
+ // 调用存储过程保存AGV请求数据
+ var param = new SqlParameter[] {
+ new SqlParameter("@reqCode", enterRequest.reqCode ?? ""),
+ new SqlParameter("@reqTime", enterRequest.reqTime ?? ""),
+ new SqlParameter("@cooX", enterRequest.cooX ?? ""),
+ new SqlParameter("@cooY", enterRequest.cooY ?? ""),
+ new SqlParameter("@currentPositionCode", enterRequest.currentPositionCode ?? ""),
+ new SqlParameter("@data", ""),// enterRequest.data ??
+ new SqlParameter("@mapCode", enterRequest.mapCode ?? ""),
+ new SqlParameter("@mapDataCode", enterRequest.mapDataCode ?? ""),
+ new SqlParameter("@stgBinCode", enterRequest.stgBinCode ?? ""),
+ new SqlParameter("@method", method),
+ new SqlParameter("@podCode", enterRequest.podCode ?? ""),
+ new SqlParameter("@podDir", enterRequest.podDir ?? ""),
+ new SqlParameter("@materialLot", enterRequest.materialLot ?? ""),
+ new SqlParameter("@robotCode", enterRequest.robotCode ?? ""),
+ new SqlParameter("@taskCode", enterRequest.taskCode ?? ""),
+ new SqlParameter("@wbCode", enterRequest.wbCode ?? ""),
+ new SqlParameter("@ctnrCode", enterRequest.ctnrCode ?? ""),
+ new SqlParameter("@ctnrType", enterRequest.ctnrType ?? ""),
+ new SqlParameter("@roadWayCode", enterRequest.roadWayCode ?? ""),
+ new SqlParameter("@seq", enterRequest.seq ?? ""),
+ new SqlParameter("@eqpCode", enterRequest.eqpCode ?? "")
+ };
+
+ // 这里定义AGV返回的位置 - 从currentPositionCode获取并去掉尾部_1后缀
+ string OpCode = "";
+ try
+ {
+ // 从请求的currentPositionCode字段获取位置码
+ string currentPositionCode = enterRequest.currentPositionCode?.ToString() ?? "";
+ if (!string.IsNullOrEmpty(currentPositionCode))
+ {
+ // 去掉尾部的_1后缀,保留前面的库位号
+ int lastUnderscoreIndex = currentPositionCode.LastIndexOf('_');
+ if (lastUnderscoreIndex > 0)
+ {
+ OpCode = currentPositionCode.Substring(0, lastUnderscoreIndex);
+ }
+ else
+ {
+ // 如果没有下划线,直接使用原值
+ OpCode = currentPositionCode;
+ }
+ }
+
+ // 如果从currentPositionCode获取不到,使用wbCode作为备用
+ if (string.IsNullOrEmpty(OpCode))
+ {
+ OpCode = enterRequest.wbCode?.ToString() ?? "";
+ }
+ }
+ catch (Exception ex)
+ {
+ // 解析失败时使用wbCode作为备用
+ OpCode = enterRequest.wbCode?.ToString() ?? "";
+ SaveMesLog("AGV进入请求", $"解析currentPositionCode失败,使用wbCode作为备用:{ex.Message}", MesLogType.WARNING);
+ }
+
+ // 跟新Moby表 AGV进入离开、下降举升状态
+ MisDataFun.Location_MIS_MOBY_Insert(OpCode, method, "1");
+
+ // 执行存储过程
+ DataLinkMesWork2.DataAccess2.ExecuteStoredProcedure("AGV_光栅请求记录_增加", ref param, out errorMessage);
+
+ switch (method)
+ {
+ case "apply":
+ MisDataFun.Location_MIS_MOBY_Insert(OpCode, "inReq", enterRequest.reqCode);
+ MisDataFun.Location_MIS_MOBY_Insert(OpCode, "inTask", enterRequest.taskCode);
+ MisDataFun.Rrunning_AGV_Arrive(OpCode); // 磨合AGV到达
+ MIS_BASE.WritePLC(301, OpCode, true); // 请求进入
+ SaveMesLog(OpCode, $"AGV请求进入成功:工位{OpCode}", MesLogType.INFO);
+ break;
+ case "release": // 离开在收到后反馈回去 发给PLC
+ MisDataFun.Location_MIS_MOBY_Insert(OpCode, "outReq", enterRequest.reqCode);
+ MisDataFun.Location_MIS_MOBY_Insert(OpCode, "outTask", enterRequest.taskCode);
+ MisDataFun.Rrunning_AGV_Leave(OpCode); // 磨合AGV离开
+ // 读取一下上一个请求进入的工件编号~~~ 然后传过去 找对应的
+ //bool agvOutResult = PassAgvInOut(OpCode, "", "release"); // 通知AGV可以离开
+ //if (!agvOutResult)
+ //{
+ // errorMessage = $"AGV离开通知失败:工位{OpCode}";
+ // SaveMesLog("AGV进入请求", errorMessage, "error");
+ //}
+ SaveMesLog(OpCode, $"AGV离开通知成功:工位{OpCode}", MesLogType.INFO);
+ MIS_BASE.WritePLC(301, OpCode, false); // 请求进入
+ // AGV已离开 - 通知PLC
+ MIS_BASE.WritePLC(303, OpCode, true);
+ MIS_BASE.WritePLC(302, OpCode, false); // 托盘到位 器具放置完毕 请求扫描器具码
+ MisDataFun.Location_MIS_MOBY_Insert(OpCode, "AllowAGVLeave", "1");
+ break;
+ case "lower":
+ MisDataFun.Location_MIS_MOBY_Insert(OpCode, "lowerReq", enterRequest.reqCode);
+ MisDataFun.Location_MIS_MOBY_Insert(OpCode, "lowerTask", enterRequest.taskCode);
+ MisDataFun.Location_MIS_MOBY_Insert(OpCode, "当前状态", "AGV请求下降");
+ MisDataFun.Location_MIS_MOBY_Insert(OpCode, "备注", $"lowerReq={enterRequest.reqCode};lowerTask={enterRequest.taskCode}");
+ MIS_BASE.WritePLC(500, OpCode, true); // AGV请求下降
+ SaveMesLog(OpCode, $"AGV请求下降成功:工位{OpCode}", MesLogType.INFO);
+ break;
+ case "raise":
+ MisDataFun.Location_MIS_MOBY_Insert(OpCode, "raiseReq", enterRequest.reqCode);
+ MisDataFun.Location_MIS_MOBY_Insert(OpCode, "raiseTask", enterRequest.taskCode);
+ MisDataFun.Location_MIS_MOBY_Insert(OpCode, "当前状态", "AGV请求举升");
+ MisDataFun.Location_MIS_MOBY_Insert(OpCode, "备注", $"raiseReq={enterRequest.reqCode};raiseTask={enterRequest.taskCode}");
+ MIS_BASE.WritePLC(501, OpCode, true); // AGV请求举升
+ SaveMesLog(OpCode, $"AGV请求举升成功:工位{OpCode}", MesLogType.INFO);
+ break;
+ default:
+ break;
+ }
+
+
+ if (!string.IsNullOrEmpty(errorMessage))
+ {
+ result.code = "500";
+ result.message = "AGV请求处理失败";
+ result.reqCode = enterRequest.reqCode;
+ SaveMesLog("AGV进入请求", errorMessage, MesLogType.ERROR);
+ }
+ else
+ {
+ result.code = "0";
+ result.message = "";
+ result.reqCode = enterRequest.reqCode;
+ }
+ }
+ catch (Exception err)
+ {
+ // 记录错误日志
+ SaveMesLog("AGV进入请求", err.Message, MesLogType.ERROR);
+
+ result.code = "1";
+ result.message = err.Message;
+
+ // 尝试从请求中获取reqCode
+ try
+ {
+ AGV_EnterRequest tempRequest = JsonConvert.DeserializeObject(str);
+ result.reqCode = tempRequest?.reqCode ?? "";
+ }
+ catch
+ {
+ result.reqCode = "";
+ }
+ }
+
+ string retString = JsonConvert.SerializeObject(result);
+ // 存储响应日志
+ SaveLog_Interface_Response(retString, AID);
+ MyLog4Net.MyLogHelper.Info("AGV请求进入接口res:", retString);
+ return retString;
+ }
+
+ public static string RemoveTrailingZero(string input)
+ {
+ if (input != null && input.Contains("-0") && input.Length >= 3)
+ {
+ int dashIndex = input.LastIndexOf("-0");
+ if (dashIndex > 0 && dashIndex == input.Length - 3) // 确保是最后的-0x格式
+ {
+ return input.Remove(dashIndex + 1, 1); // 去掉"-0"中的0
+ }
+ }
+ return input;
+ }
+
+ ///
+ /// 发送AGV任务继续执行请求(允许进入、离开、下降或举升)
+ ///
+ /// 工位号
+ /// 工件编号
+ /// 任务类型
+ /// 操作是否成功
+ public static bool PassAgvInOut(string opName, string engineID, string type)
+ {
+ try
+ {
+ // 其实没有用 engineID 这玩意正常本工位获取不到
+
+ // 调用存储过程获取AGV任务数据
+ var param = new SqlParameter[] {
+ new SqlParameter("@opName", opName),
+ new SqlParameter("@engineID", engineID),
+ new SqlParameter("@type", type)
+ };
+ DataLinkMesWork2.DataAccess2.ExecuteStoredProcedure("AGV_允许进入离开_查询", ref param, out DataTable dtResult, out string errMessage);
+
+ if (dtResult == null || dtResult.Rows.Count == 0)
+ {
+ SaveMesLog(opName, $"获取AGV任务数据失败:工位号={opName}, 工件编号={engineID}, 任务类型={type}, 错误信息={errMessage}", MesLogType.ERROR);
+ return false;
+ }
+
+ // 从数据库获取请求编号和任务号
+ string reqCode = dtResult.Rows[0]["reqCode"].ToString();
+ string taskCode = dtResult.Rows[0]["taskCode"].ToString();
+
+ // 构造AGV反馈请求对象
+ AGV_FeedbackRequest agvFeedbackRequest = new AGV_FeedbackRequest()
+ {
+ reqCode = reqCode,
+ taskCode = taskCode
+ };
+
+ // 获取AGV接口地址并发送请求
+ string interfaceUrl = agvBaseUrl.TrimEnd('/') + "/rcms/services/rest/hikRpcService/continueTask";
+ string jsonStr = JsonConvert.SerializeObject(agvFeedbackRequest);
+
+ //存储请求日志
+ SaveLog_Interface_Request(interfaceUrl, 1, jsonStr, out int AID);
+
+ string resultStr = "";
+ try
+ {
+ resultStr = Post.Post_Auto(interfaceUrl, jsonStr);
+ }
+ catch (Exception httpEx)
+ {
+ SaveMesLog(opName, $"AGV接口HTTP请求异常:工位号={opName}, 工件编号={engineID}, 任务类型={type}, 异常信息={httpEx.Message}", MesLogType.ERROR);
+ // 存储响应日志
+ SaveLog_Interface_Response($"HTTP请求异常:{httpEx.Message}", AID);
+ return false;
+ }
+
+ // 存储响应日志
+ SaveLog_Interface_Response(resultStr, AID);
+
+ // 解析响应结果
+ if (string.IsNullOrWhiteSpace(resultStr))
+ {
+ SaveMesLog(opName, "AGV接口返回空响应", MesLogType.ERROR);
+ return false;
+ }
+
+ // 检查是否为Post.Post_Auto返回的错误格式
+ try
+ {
+ JObject tempResult = JsonConvert.DeserializeObject(resultStr);
+ if (tempResult != null && tempResult["code"] != null && tempResult["code"].ToString() == "500")
+ {
+ string errorMsg = tempResult["message"]?.ToString() ?? "HTTP请求异常";
+ SaveMesLog(opName, $"AGV接口HTTP异常:工位号={opName}, 工件编号={engineID}, 任务类型={type}, 错误信息={errorMsg}", MesLogType.ERROR);
+ return false;
+ }
+ }
+ catch
+ {
+ // 如果不是标准JSON格式,继续后续处理
+ }
+
+ AGV_Response result = JsonConvert.DeserializeObject(resultStr);
+ if (result == null)
+ {
+ SaveMesLog(opName, "AGV接口返回数据格式错误", MesLogType.ERROR);
+ return false;
+ }
+
+ // 检查AGV返回码
+ string code = result.code?.ToString();
+ if (code != "0")
+ {
+ string message = result.message?.ToString() ?? "未知错误";
+ SaveMesLog(opName, $"允许AGV光栅请求失败:工位号={opName}, 工件编号={engineID}, 任务类型={type}, code={code}, message={message}", MesLogType.ERROR);
+ return false;
+ }
+
+ // 请求成功后调用存储过程更新送料状态
+ var updateParam = new SqlParameter[] {
+ new SqlParameter("@opName", opName),
+ new SqlParameter("@engineID", engineID),
+ new SqlParameter("@reqCode", reqCode),
+ new SqlParameter("@taskCode", taskCode)
+ };
+ DataLinkMesWork2.DataAccess2.ExecuteStoredProcedure("AGV_光栅请求记录_允许", ref updateParam, out string updateErrMessage);
+
+ if (!string.IsNullOrEmpty(updateErrMessage))
+ {
+ SaveMesLog(opName, $"允许AGV光栅请求失败:工位号={opName}, 工件编号={engineID}, 任务类型={type}, 异常信息={updateErrMessage}", MesLogType.ERROR);
+ return false;
+ }
+
+
+ // 根据任务类型进行后续操作
+ if (type == "apply")
+ {
+ // AGV已进入
+ MisDataFun.Location_MIS_MOBY_Insert(opName, "AllowAGVEnter", "1");
+ }
+ else if (type == "release")
+ {
+ // AGV已离开 - 通知PLC
+ MIS_BASE.WritePLC(301, opName, false); // 请求进入
+ MIS_BASE.WritePLC(303, opName, true);
+ MisDataFun.Location_MIS_MOBY_Insert(opName, "AllowAGVLeave", "1");
+ }
+ else if (type == "lower")
+ {
+ // AGV允许下降
+ MIS_BASE.WritePLC(500, opName, false); // AGV请求下降
+ MisDataFun.Location_MIS_MOBY_Insert(opName, "AllowAGVLower", "1");
+ MisDataFun.Location_MIS_MOBY_Insert(opName, "当前状态", "允许AGV下降");
+ }
+ else if (type == "raise")
+ {
+ // AGV允许举升
+ MIS_BASE.WritePLC(501, opName, false); // AGV请求举升
+ MisDataFun.Location_MIS_MOBY_Insert(opName, "AllowAGVRaise", "1");
+ MisDataFun.Location_MIS_MOBY_Insert(opName, "当前状态", "允许AGV举升");
+ }
+
+ SaveMesLog(opName, $"允许AGV光栅请求成功:工件编号={engineID}, 请求编号={reqCode}, 任务号={taskCode}, 工位号={opName}, 任务类型={type}", MesLogType.INFO);
+ return true;
+ }
+ catch (Exception ex)
+ {
+ SaveMesLog(opName, $"允许AGV光栅请求失败:工位号={opName}, 工件编号={engineID}, 任务类型={type}, 异常信息={ex.Message}", MesLogType.ERROR);
+ return false;
+ }
+ }
+ }
+}
+
diff --git a/Interface_WebAPI/SlMesDbIterface/WebAPI/AGV/AGV_Models.cs b/Interface_WebAPI/SlMesDbIterface/WebAPI/AGV/AGV_Models.cs
new file mode 100644
index 0000000..6ee9939
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/WebAPI/AGV/AGV_Models.cs
@@ -0,0 +1,164 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Newtonsoft.Json.Linq;
+
+namespace MisDataSaveDate
+{
+ ///
+ /// AGV进入请求实体类
+ ///
+ public class AGV_EnterRequest
+ {
+ ///
+ /// 请求编号,每个请求都要一个唯一编号,同一个请求重复提交,使用同一编号
+ ///
+ public string reqCode { get; set; }
+
+ ///
+ /// 请求时间戳,格式: "yyyy-MM-dd HH:mm:ss"
+ ///
+ public string reqTime { get; set; }
+
+ ///
+ /// 地码 X 坐标(mm):任务完成时有值
+ ///
+ public string cooX { get; set; }
+
+ ///
+ /// 地码 Y 坐标(mm):任务完成时有值
+ ///
+ public string cooY { get; set; }
+
+ ///
+ /// 当前位置编号
+ ///
+ public string currentPositionCode { get; set; }
+
+ ///
+ /// 自定义字段,不超过2000个字符
+ ///
+ public object data { get; set; }
+
+ ///
+ /// 地图编号
+ ///
+ public string mapCode { get; set; }
+
+ ///
+ /// 地码编号:任务完成时有值
+ ///
+ public string mapDataCode { get; set; }
+
+ ///
+ /// 仓位编号:叉车与CTU任务时有值
+ ///
+ public string stgBinCode { get; set; }
+
+ ///
+ /// 方法名, apply: 申请进入;release:申请离开
+ ///
+ public string method { get; set; }
+
+ ///
+ /// 货架编号:背货架时有值
+ ///
+ public string podCode { get; set; }
+
+ ///
+ /// "180","0","90","-90" 分别对应地图的"左","右","上","下":任务完成时有值
+ ///
+ public string podDir { get; set; }
+
+ ///
+ /// 物料编号
+ ///
+ public string materialLot { get; set; }
+
+ ///
+ /// AGV编号(同 agvCode)
+ ///
+ public string robotCode { get; set; }
+
+ ///
+ /// 当前任务单号
+ ///
+ public string taskCode { get; set; }
+
+ ///
+ /// 工作位,与RCS-2000端配置的位置名称一致。任务完成时有值,与生成任务单接口中的wbCode一致
+ ///
+ public string wbCode { get; set; }
+
+ ///
+ /// 容器编号
+ ///
+ public string ctnrCode { get; set; }
+
+ ///
+ /// 容器类型
+ ///
+ public string ctnrType { get; set; }
+
+ ///
+ /// 巷道编号
+ ///
+ public string roadWayCode { get; set; }
+
+ ///
+ /// 巷道内顺序号,巷道尾是0,到巷道头依次递增1
+ ///
+ public string seq { get; set; }
+
+ ///
+ /// 设备编号,如梳齿式工作站、输送线等,一般使用于CTU场景。系统根据仓位定位到关联的设备编号
+ ///
+ public string eqpCode { get; set; }
+ }
+
+ ///
+ /// AGV请求反馈实体类
+ ///
+ public class AGV_FeedbackRequest
+ {
+ ///
+ /// 请求编号
+ ///
+ public string reqCode { get; set; }
+
+ ///
+ /// 任务单号
+ ///
+ public string taskCode { get; set; }
+ }
+
+ ///
+ /// AGV接口通用响应类
+ ///
+ public class AGV_Response
+ {
+ ///
+ /// 返回码 "0"表示成功
+ ///
+ public string code { get; set; }
+
+ ///
+ /// 返回消息
+ ///
+ public string message { get; set; }
+
+ ///
+ /// 请求编号
+ ///
+ public string reqCode { get; set; }
+
+ public AGV_Response()
+ {
+ code = "0";
+ message = "成功";
+ reqCode = "";
+ }
+ }
+}
\ No newline at end of file
diff --git a/Interface_WebAPI/SlMesDbIterface/WebAPI/AGV/ZZAGV_BusinessLogic.cs b/Interface_WebAPI/SlMesDbIterface/WebAPI/AGV/ZZAGV_BusinessLogic.cs
new file mode 100644
index 0000000..498b08d
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/WebAPI/AGV/ZZAGV_BusinessLogic.cs
@@ -0,0 +1,200 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Configuration;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+using MisDataSaveDate;
+using System.Web.Http;
+using static MisDataSaveDate.Helper.ApiLogHelper;
+using MisDataSaveDate.Helper;
+
+namespace MisDataSaveDate
+{
+ ///
+ /// 西开 AGV 业务处理类
+ /// 处理 AGV -> MES 的接收请求
+ ///
+ public class ZZAGV_BusinessLogic
+ {
+ ///
+ /// 处理状态更新请求(到达/离开)
+ ///
+ /// 接口URL
+ /// 请求数据
+ /// 处理结果 JSON 字符串
+ public static string ProcessStatusUpdate(string url, [FromBody] JObject jobj)
+ {
+ var result = ZZAGV_Response.Success();
+ string str = jobj?.ToString() ?? "";
+
+ // 存储请求日志
+ SaveLog_Interface_Request(url, 2, str, out int AID);
+
+ try
+ {
+ if (jobj == null)
+ {
+ throw new Exception("请求参数不能为空");
+ }
+
+ ZZAGV_StatusUpdateRequest request = JsonConvert.DeserializeObject(str);
+
+ // 参数校验
+ if (string.IsNullOrWhiteSpace(request.position))
+ {
+ throw new Exception("工位编号(position)不能为空");
+ }
+
+ string typeDesc = request.type == 1 ? "到达" : (request.type == 2 ? "离开" : "未知");
+ SaveMesLog("ZZAGV_StatusUpdate", $"AGV状态更新:工位={request.position}, 类型={typeDesc}, AGV={request.agvid}, 物料={request.materialCode}", MesLogType.INFO);
+
+ // TODO: 后续业务逻辑在此添加
+
+ }
+ catch (Exception ex)
+ {
+ result = ZZAGV_Response.Fail(1, ex.Message);
+ SaveMesLog("ZZAGV_StatusUpdate", $"处理异常:{ex.Message}", MesLogType.ERROR);
+ }
+
+ string retString = JsonConvert.SerializeObject(result);
+ SaveLog_Interface_Response(retString, AID);
+ return retString;
+ }
+
+ ///
+ /// 处理动作完成请求(举升/下降)
+ ///
+ /// 接口URL
+ /// 请求数据
+ /// 处理结果 JSON 字符串
+ public static string ProcessActionComplete(string url, [FromBody] JObject jobj)
+ {
+ var result = ZZAGV_Response.Success();
+ string str = jobj?.ToString() ?? "";
+
+ // 存储请求日志
+ SaveLog_Interface_Request(url, 2, str, out int AID);
+
+ try
+ {
+ if (jobj == null)
+ {
+ throw new Exception("请求参数不能为空");
+ }
+
+ ZZAGV_ActionCompleteRequest request = JsonConvert.DeserializeObject(str);
+
+ // 参数校验
+ if (string.IsNullOrWhiteSpace(request.position))
+ {
+ throw new Exception("工位编号(position)不能为空");
+ }
+
+ string typeDesc = request.type == 1 ? "举升完成" : (request.type == 2 ? "下降完成" : "未知");
+ SaveMesLog("ZZAGV_ActionComplete", $"AGV动作完成:工位={request.position}, 类型={typeDesc}", MesLogType.INFO);
+
+ // TODO: 后续业务逻辑在此添加
+
+ }
+ catch (Exception ex)
+ {
+ result = ZZAGV_Response.Fail(1, ex.Message);
+ SaveMesLog("ZZAGV_ActionComplete", $"处理异常:{ex.Message}", MesLogType.ERROR);
+ }
+
+ string retString = JsonConvert.SerializeObject(result);
+ SaveLog_Interface_Response(retString, AID);
+ return retString;
+ }
+
+ ///
+ /// 处理故障/报警推送请求
+ ///
+ /// 接口URL
+ /// 请求数据
+ /// 处理结果 JSON 字符串
+ public static string ProcessAlarmPush(string url, [FromBody] JObject jobj)
+ {
+ var result = ZZAGV_Response.Success();
+ string str = jobj?.ToString() ?? "";
+
+ // 存储请求日志
+ SaveLog_Interface_Request(url, 2, str, out int AID);
+
+ try
+ {
+ if (jobj == null)
+ {
+ throw new Exception("请求参数不能为空");
+ }
+
+ ZZAGV_AlarmPushRequest request = JsonConvert.DeserializeObject(str);
+
+ string typeDesc = request.type == 1 ? "AGV故障" : (request.type == 2 ? "区域故障" : "未知");
+ SaveMesLog("ZZAGV_AlarmPush", $"AGV故障推送:类型={typeDesc}, AGV={request.agvNo}, 故障码={request.errorCode}, 信息={request.errorMsg}", MesLogType.WARNING);
+
+ // TODO: 后续业务逻辑在此添加
+
+ }
+ catch (Exception ex)
+ {
+ result = ZZAGV_Response.Fail(1, ex.Message);
+ SaveMesLog("ZZAGV_AlarmPush", $"处理异常:{ex.Message}", MesLogType.ERROR);
+ }
+
+ string retString = JsonConvert.SerializeObject(result);
+ SaveLog_Interface_Response(retString, AID);
+ return retString;
+ }
+
+ ///
+ /// 处理任务执行结果请求
+ ///
+ /// 接口URL
+ /// 请求数据
+ /// 处理结果 JSON 字符串
+ public static string ProcessTaskResult(string url, [FromBody] JObject jobj)
+ {
+ var result = ZZAGV_Response.Success();
+ string str = jobj?.ToString() ?? "";
+
+ // 存储请求日志
+ SaveLog_Interface_Request(url, 2, str, out int AID);
+
+ try
+ {
+ if (jobj == null)
+ {
+ throw new Exception("请求参数不能为空");
+ }
+
+ ZZAGV_TaskResultRequest request = JsonConvert.DeserializeObject(str);
+
+ // 参数校验
+ if (string.IsNullOrWhiteSpace(request.requestTaskId))
+ {
+ throw new Exception("任务ID(requestTaskId)不能为空");
+ }
+
+ string statusDesc = request.status == "success" ? "成功" : "失败";
+ SaveMesLog("ZZAGV_TaskResult", $"AGV任务结果:任务ID={request.requestTaskId}, 状态={statusDesc}, AGV={request.agvNo}, 消息={request.message}", MesLogType.INFO);
+
+ // TODO: 后续业务逻辑在此添加
+
+ }
+ catch (Exception ex)
+ {
+ result = ZZAGV_Response.Fail(1, ex.Message);
+ SaveMesLog("ZZAGV_TaskResult", $"处理异常:{ex.Message}", MesLogType.ERROR);
+ }
+
+ string retString = JsonConvert.SerializeObject(result);
+ SaveLog_Interface_Response(retString, AID);
+ return retString;
+ }
+ }
+}
diff --git a/Interface_WebAPI/SlMesDbIterface/WebAPI/AGV/ZZAGV_Models.cs b/Interface_WebAPI/SlMesDbIterface/WebAPI/AGV/ZZAGV_Models.cs
new file mode 100644
index 0000000..347e37f
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/WebAPI/AGV/ZZAGV_Models.cs
@@ -0,0 +1,221 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace MisDataSaveDate
+{
+ #region AGV -> MES 接收请求模型
+
+ ///
+ /// 状态更新请求(到达/离开)
+ /// AGV 到达或离开工位时通知 MES
+ ///
+ public class ZZAGV_StatusUpdateRequest
+ {
+ ///
+ /// 工位编号
+ ///
+ public string position { get; set; }
+
+ ///
+ /// 类型:1-到达,2-离开
+ ///
+ public int type { get; set; }
+
+ ///
+ /// 物料编码/产品编码
+ ///
+ public string materialCode { get; set; }
+
+ ///
+ /// AGV车号
+ ///
+ public string agvid { get; set; }
+ }
+
+ ///
+ /// 动作完成请求(举升/下降)
+ /// AGV 完成托盘举升或下降动作后通知 MES
+ ///
+ public class ZZAGV_ActionCompleteRequest
+ {
+ ///
+ /// 工位编号
+ ///
+ public string position { get; set; }
+
+ ///
+ /// 类型:1-举升完成,2-下降完成
+ ///
+ public int type { get; set; }
+ }
+
+ ///
+ /// 故障/报警推送请求
+ /// AGV 上报故障或区域故障
+ ///
+ public class ZZAGV_AlarmPushRequest
+ {
+ ///
+ /// AGV车号
+ ///
+ public string agvNo { get; set; }
+
+ ///
+ /// 故障代码
+ ///
+ public string errorCode { get; set; }
+
+ ///
+ /// 故障信息
+ ///
+ public string errorMsg { get; set; }
+
+ ///
+ /// 故障类型:1-AGV故障,2-区域故障
+ ///
+ public int type { get; set; }
+ }
+
+ ///
+ /// 任务执行结果请求
+ /// AGV 告知 MES 任务是否执行成功
+ ///
+ public class ZZAGV_TaskResultRequest
+ {
+ ///
+ /// 任务唯一ID(与下发任务时的 requestTaskId 对应)
+ ///
+ public string requestTaskId { get; set; }
+
+ ///
+ /// 执行状态:success-成功,fail-失败
+ ///
+ public string status { get; set; }
+
+ ///
+ /// AGV车号
+ ///
+ public string agvNo { get; set; }
+
+ ///
+ /// 失败原因(成功时为空)
+ ///
+ public string message { get; set; }
+ }
+
+ #endregion
+
+ #region MES -> AGV 发送请求模型
+
+ ///
+ /// 下发任务请求
+ /// MES 给 AGV 下发搬运任务
+ ///
+ public class ZZAGV_AddTaskRequest
+ {
+ ///
+ /// 任务唯一ID(由 MES 生成)
+ ///
+ public string requestTaskId { get; set; }
+
+ ///
+ /// 抬货点/取货位置
+ ///
+ public string startPosition { get; set; }
+
+ ///
+ /// 卸货点/目标位置
+ ///
+ public string endPosition { get; set; }
+
+ ///
+ /// 产品编码/物料编码
+ ///
+ public string materialCode { get; set; }
+ }
+
+ ///
+ /// 放行请求
+ /// MES 告知 AGV 可以离开当前位置
+ ///
+ public class ZZAGV_AllowLeaveRequest
+ {
+ ///
+ /// 请求ID
+ ///
+ public string requestId { get; set; }
+
+ ///
+ /// 当前位置编号
+ ///
+ public string position { get; set; }
+
+ ///
+ /// 放行标志(固定为1)
+ ///
+ public int allowLeave { get; set; } = 1;
+ }
+
+ #endregion
+
+ #region 通用响应模型
+
+ ///
+ /// 西开 AGV 接口通用响应
+ ///
+ public class ZZAGV_Response
+ {
+ ///
+ /// 返回码:0-成功,其他-失败
+ ///
+ public int code { get; set; }
+
+ ///
+ /// 返回描述信息
+ ///
+ public string desc { get; set; }
+
+ ///
+ /// 是否成功
+ ///
+ public bool success { get; set; }
+
+ public ZZAGV_Response()
+ {
+ code = 0;
+ desc = "成功";
+ success = true;
+ }
+
+ ///
+ /// 设置成功响应
+ ///
+ public static ZZAGV_Response Success(string desc = "成功")
+ {
+ return new ZZAGV_Response
+ {
+ code = 0,
+ desc = desc,
+ success = true
+ };
+ }
+
+ ///
+ /// 设置失败响应
+ ///
+ public static ZZAGV_Response Fail(int code, string desc)
+ {
+ return new ZZAGV_Response
+ {
+ code = code,
+ desc = desc,
+ success = false
+ };
+ }
+ }
+
+ #endregion
+}
diff --git a/Interface_WebAPI/SlMesDbIterface/WebAPI/Controller/AGVController.cs b/Interface_WebAPI/SlMesDbIterface/WebAPI/Controller/AGVController.cs
new file mode 100644
index 0000000..e2c2be2
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/WebAPI/Controller/AGVController.cs
@@ -0,0 +1,44 @@
+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 System.Net;
+using System.Net.Http.Headers;
+using System.IO;
+using MisDataSaveDate;
+
+namespace MisDataSaveDate
+{
+ ///
+ /// AGV接口控制器
+ ///
+ public class AGVController : ApiController
+ {
+ readonly string headUrl = "agv/";
+
+ ///
+ /// AGV请求进入离开、下降举升接口(接收方)
+ /// 接收AGV的进入、离开、下降、举升请求并存储到数据库
+ ///
+ /// AGV请求数据
+ /// 处理结果
+ [HttpPost]
+ [Route("agv/agvReqInOut")]
+ public HttpResponseMessage agvReqInOut([FromBody] JObject jobj)
+ {
+ return new HttpResponseMessage
+ {
+ Content = new StringContent(AGV_BusinessLogic.ProcessAGVEnterRequest(headUrl + System.Reflection.MethodBase.GetCurrentMethod().Name, jobj), Encoding.GetEncoding("UTF-8"), "application/json")
+ };
+ }
+
+ }
+}
diff --git a/Interface_WebAPI/SlMesDbIterface/WebAPI/Controller/CheckDataController.cs b/Interface_WebAPI/SlMesDbIterface/WebAPI/Controller/CheckDataController.cs
new file mode 100644
index 0000000..46e68b2
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/WebAPI/Controller/CheckDataController.cs
@@ -0,0 +1,97 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Newtonsoft.Json.Linq;
+using System.Net.Http;
+using System.Web.Http;
+using ExternalDataSync.MOM;
+
+namespace ExternalDataSync.WebAPI.Controller
+{
+ public class CheckDataController : ApiController
+ {
+ private readonly string headUrl = "TestPlatform/";
+
+ [HttpPost]
+ [Route("TestPlatform/OnlineCheckData")]
+ public HttpResponseMessage OnlineCheckData([FromBody] JObject jobj)
+ {
+ var result = Other.OnlineCheckData(headUrl + System.Reflection.MethodBase.GetCurrentMethod().Name, jobj);
+ return new HttpResponseMessage
+ {
+ Content = new StringContent(result, Encoding.GetEncoding("UTF-8"), "application/json")
+ };
+ }
+
+ [HttpPost]
+ [Route("TestPlatform/OnlineStatusData")]
+ public HttpResponseMessage OnlineStatusData([FromBody] JObject jobj)
+ {
+ var result = Other.OnlineStatusData(headUrl + System.Reflection.MethodBase.GetCurrentMethod().Name, jobj);
+ return new HttpResponseMessage
+ {
+ Content = new StringContent(result, Encoding.GetEncoding("UTF-8"), "application/json")
+ };
+ }
+
+ [HttpPost]
+ [Route("TestPlatform/OnlineDewPointResultData")]
+ public HttpResponseMessage OnlineDewPointResultData([FromBody] JObject jobj)
+ {
+ var result = DewPointDataHandler.OnlineDewPointResultData(headUrl + System.Reflection.MethodBase.GetCurrentMethod().Name, jobj);
+ return new HttpResponseMessage
+ {
+ Content = new StringContent(result, Encoding.GetEncoding("UTF-8"), "application/json")
+ };
+ }
+
+ [HttpPost]
+ [Route("TestPlatform/OnlineDewPointTechnologyData")]
+ public HttpResponseMessage OnlineDewPointTechnologyData([FromBody] JObject jobj)
+ {
+ var result = DewPointDataHandler.OnlineDewPointTechnologyData(headUrl + System.Reflection.MethodBase.GetCurrentMethod().Name, jobj);
+ return new HttpResponseMessage
+ {
+ Content = new StringContent(result, Encoding.GetEncoding("UTF-8"), "application/json")
+ };
+ }
+
+ [HttpPost]
+ [Route("TestPlatform/OnlineDewPointUseData")]
+ public HttpResponseMessage OnlineDewPointUseData([FromBody] JObject jobj)
+ {
+ var result = DewPointDataHandler.OnlineDewPointUseData(headUrl + System.Reflection.MethodBase.GetCurrentMethod().Name, jobj);
+ return new HttpResponseMessage
+ {
+ Content = new StringContent(result, Encoding.GetEncoding("UTF-8"), "application/json")
+ };
+ }
+
+ [HttpPost]
+ [Route("TestPlatform/OnlineDewPointStatusData")]
+ public HttpResponseMessage OnlineDewPointStatusData([FromBody] JObject jobj)
+ {
+ var result = DewPointDataHandler.OnlineDewPointStatusData(headUrl + System.Reflection.MethodBase.GetCurrentMethod().Name, jobj);
+ return new HttpResponseMessage
+ {
+ Content = new StringContent(result, Encoding.GetEncoding("UTF-8"), "application/json")
+ };
+ }
+
+ ///
+ /// 获取位置待测试产品信息
+ ///
+ [HttpPost]
+ [Route("TestPlatform/GetWaitCheckProductData")]
+ public HttpResponseMessage GetWaitCheckProductData([FromBody] JObject jobj)
+ {
+ var result = Other.GetWaitCheckProductData(headUrl + System.Reflection.MethodBase.GetCurrentMethod().Name, jobj);
+ return new HttpResponseMessage
+ {
+ Content = new StringContent(result, Encoding.GetEncoding("UTF-8"), "application/json")
+ };
+ }
+ }
+}
diff --git a/Interface_WebAPI/SlMesDbIterface/WebAPI/Controller/CheckImageController.cs b/Interface_WebAPI/SlMesDbIterface/WebAPI/Controller/CheckImageController.cs
new file mode 100644
index 0000000..1a4be08
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/WebAPI/Controller/CheckImageController.cs
@@ -0,0 +1,270 @@
+using System;
+using System.Configuration;
+using System.Data;
+using System.Data.SqlClient;
+using System.IO;
+using System.Net;
+using System.Net.Http;
+using System.Net.Http.Headers;
+using System.Text.RegularExpressions;
+using System.Web.Http;
+using DataLinkMesWork2;
+
+namespace WebApi
+{
+ [RoutePrefix("api/checkimage")]
+ public class CheckImageController : ApiController
+ {
+ private readonly string _defaultRoot = @"D:\\XDCheckImages";
+
+ public class ImageUploadRequest
+ {
+ public string ProductCode { get; set; }
+ public string Remark { get; set; }
+ public string ImageBase64 { get; set; }
+ public string FileExt { get; set; }
+ }
+
+ public class ImageDownloadRequest
+ {
+ public string Path { get; set; }
+ }
+
+ private string GetRootPath()
+ {
+ string root = null;
+ try
+ {
+ root = ConfigurationManager.AppSettings["XD_CheckImageRootPath"];
+ }
+ catch
+ {
+ }
+
+ if (string.IsNullOrWhiteSpace(root))
+ {
+ root = _defaultRoot;
+ }
+
+ return root;
+ }
+
+ private string SanitizeForPath(string input)
+ {
+ if (string.IsNullOrEmpty(input)) return string.Empty;
+ char[] invalid = Path.GetInvalidFileNameChars();
+ var value = input.Trim();
+ foreach (var c in invalid)
+ {
+ value = value.Replace(c.ToString(), string.Empty);
+ }
+ value = value.Replace("/", string.Empty).Replace("\\", string.Empty);
+ return value;
+ }
+
+ private string GetExtensionFromRequest(ImageUploadRequest request)
+ {
+ string ext = ".jpg";
+ if (request == null) return ext;
+
+ if (!string.IsNullOrWhiteSpace(request.FileExt))
+ {
+ ext = request.FileExt.Trim();
+ if (!ext.StartsWith("."))
+ {
+ ext = "." + ext;
+ }
+ return ext;
+ }
+
+ if (!string.IsNullOrWhiteSpace(request.ImageBase64) &&
+ request.ImageBase64.StartsWith("data:", StringComparison.OrdinalIgnoreCase))
+ {
+ try
+ {
+ var match = Regex.Match(request.ImageBase64, "^data:(?[^;]+);base64,", RegexOptions.IgnoreCase);
+ if (match.Success)
+ {
+ var mime = match.Groups["mime"].Value.ToLowerInvariant();
+ if (mime == "image/png") return ".png";
+ if (mime == "image/gif") return ".gif";
+ if (mime == "image/bmp") return ".bmp";
+ if (mime == "image/webp") return ".webp";
+ if (mime == "image/tiff" || mime == "image/tif") return ".tif";
+ if (mime == "image/jpeg" || mime == "image/jpg") return ".jpg";
+ }
+ }
+ catch
+ {
+ }
+ }
+
+ return ext;
+ }
+
+ private string GetContentType(string fileName)
+ {
+ var extension = Path.GetExtension(fileName).ToLowerInvariant();
+ if (extension == ".bmp") return "image/bmp";
+ if (extension == ".jpg" || extension == ".jpeg") return "image/jpeg";
+ if (extension == ".png") return "image/png";
+ if (extension == ".gif") return "image/gif";
+ if (extension == ".tiff" || extension == ".tif") return "image/tiff";
+ if (extension == ".webp") return "image/webp";
+ return "application/octet-stream";
+ }
+
+ private bool IsPathSafe(string fullPath)
+ {
+ try
+ {
+ var basePath = Path.GetFullPath(GetRootPath());
+ var requestedPath = Path.GetFullPath(fullPath);
+ return requestedPath.StartsWith(basePath, StringComparison.OrdinalIgnoreCase);
+ }
+ catch
+ {
+ return false;
+ }
+ }
+
+ [HttpPost]
+ [Route("upload")]
+ public IHttpActionResult Upload([FromBody] ImageUploadRequest request)
+ {
+ try
+ {
+ if (request == null ||
+ string.IsNullOrWhiteSpace(request.ProductCode) ||
+ string.IsNullOrWhiteSpace(request.Remark) ||
+ string.IsNullOrWhiteSpace(request.ImageBase64))
+ {
+ return Ok(new { success = false, message = "产品编号、备注和图片不能为空" });
+ }
+
+ string productCode = SanitizeForPath(request.ProductCode);
+ string remark = SanitizeForPath(request.Remark);
+ if (string.IsNullOrEmpty(productCode))
+ {
+ return Ok(new { success = false, message = "产品编号无效" });
+ }
+
+ string ext = GetExtensionFromRequest(request);
+ string base64 = request.ImageBase64.Trim();
+ int commaIndex = base64.IndexOf(',');
+ if (base64.StartsWith("data:", StringComparison.OrdinalIgnoreCase) && commaIndex > 0)
+ {
+ base64 = base64.Substring(commaIndex + 1);
+ }
+
+ byte[] bytes;
+ try
+ {
+ bytes = Convert.FromBase64String(base64);
+ }
+ catch
+ {
+ return Ok(new { success = false, message = "图片数据格式错误" });
+ }
+
+ var now = DateTime.Now;
+ string datePart = now.ToString("yyyyMMdd");
+ string timePart = now.ToString("HHmmss");
+
+ string fileName = string.Format("{0}-{1}-{2}{3}", timePart, productCode, remark, ext);
+ string relativePath = string.Format("/{0}/{1}", datePart, fileName);
+
+ string root = GetRootPath();
+ string directory = Path.Combine(root, datePart);
+ if (!Directory.Exists(directory))
+ {
+ Directory.CreateDirectory(directory);
+ }
+
+ string fullPath = Path.Combine(directory, fileName);
+
+ if (!IsPathSafe(fullPath))
+ {
+ return Ok(new { success = false, message = "目标路径不安全" });
+ }
+
+ File.WriteAllBytes(fullPath, bytes);
+
+ string errorMessage;
+ var sqlParameters = new SqlParameter[4];
+ sqlParameters[0] = new SqlParameter("@产品编号", SqlDbType.NVarChar, 500) { Value = (object)request.ProductCode ?? DBNull.Value };
+ sqlParameters[1] = new SqlParameter("@备注", SqlDbType.NVarChar, 500) { Value = (object)request.Remark ?? DBNull.Value };
+ sqlParameters[2] = new SqlParameter("@图片路径", SqlDbType.NVarChar, 500) { Value = (object)relativePath ?? DBNull.Value };
+ sqlParameters[3] = new SqlParameter("@图片名称", SqlDbType.NVarChar, 500) { Value = (object)fileName ?? DBNull.Value };
+
+ bool dbOk = DataAccess2.ExecuteStoredProcedure("XD_检测图片上传_增加", ref sqlParameters, out errorMessage);
+ if (!dbOk)
+ {
+ return Ok(new { success = false, message = "图片已保存,但写入数据库失败:" + errorMessage });
+ }
+
+ return Ok(new
+ {
+ success = true,
+ message = "上传成功",
+ data = new
+ {
+ 产品编号 = request.ProductCode,
+ 备注 = request.Remark,
+ 图片路径 = relativePath,
+ 图片名称 = fileName
+ }
+ });
+ }
+ catch (Exception ex)
+ {
+ return Ok(new { success = false, message = "服务器错误:" + ex.Message });
+ }
+ }
+
+ [HttpPost]
+ [Route("download")]
+ public IHttpActionResult Download([FromBody] ImageDownloadRequest request)
+ {
+ try
+ {
+ if (request == null || string.IsNullOrWhiteSpace(request.Path))
+ {
+ return Ok(new { success = false, message = "文件路径不能为空" });
+ }
+
+ string root = GetRootPath();
+ string relative = request.Path.Replace("\\", "/").Trim();
+ if (relative.StartsWith("/"))
+ {
+ relative = relative.Substring(1);
+ }
+ string fullPath = Path.Combine(root, relative.Replace('/', Path.DirectorySeparatorChar));
+
+ if (!IsPathSafe(fullPath) || !File.Exists(fullPath))
+ {
+ return Ok(new { success = false, message = "文件不存在" });
+ }
+
+ var fileInfo = new FileInfo(fullPath);
+ var contentType = GetContentType(fileInfo.Name);
+
+ var response = new HttpResponseMessage(HttpStatusCode.OK)
+ {
+ Content = new StreamContent(new FileStream(fullPath, FileMode.Open, FileAccess.Read, FileShare.Read))
+ };
+ response.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType);
+ response.Content.Headers.ContentDisposition = new ContentDispositionHeaderValue("inline")
+ {
+ FileName = fileInfo.Name
+ };
+
+ return ResponseMessage(response);
+ }
+ catch (Exception ex)
+ {
+ return Ok(new { success = false, message = "下载文件失败:" + ex.Message });
+ }
+ }
+ }
+}
diff --git a/Interface_WebAPI/SlMesDbIterface/WebAPI/Controller/CraftFileController.cs b/Interface_WebAPI/SlMesDbIterface/WebAPI/Controller/CraftFileController.cs
new file mode 100644
index 0000000..bc955b3
--- /dev/null
+++ b/Interface_WebAPI/SlMesDbIterface/WebAPI/Controller/CraftFileController.cs
@@ -0,0 +1,458 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Net;
+using System.Net.Http;
+using System.Web.Http;
+using System.Net.Http.Headers;
+using WinSCP;
+
+namespace WebApi
+{
+ [RoutePrefix("api/craftfile")]
+ public class CraftFileController : ApiController
+ {
+ // 本地缓存根目录
+ private readonly string _cacheRoot = @"D:\\CraftFilesCache";
+
+ private readonly string _sftpHost = "10.107.69.5";
+ private readonly string _sftpUser = "root";
+ private readonly string _sftpPassword = "XKYXmes@123!";
+
+ public class FileRequestDto
+ {
+ // 远程(SFTP)相对路径或绝对路径:如 /root/PLM-MES/.../xxx.pdf
+ public string RelativePath { get; set; } = "";
+ }
+
+ [HttpPost]
+ [Route("browse")]
+ public IHttpActionResult Browse([FromBody] FileRequestDto request)
+ {
+ try
+ {
+ if (request == null || string.IsNullOrWhiteSpace(request.RelativePath))
+ return Ok(new { success = false, message = "路径不能为空" });
+
+ EnsureCacheRoot();
+
+ var remotePath = NormalizeRemotePath(request.RelativePath);
+ var localPath = ToLocalPath(remotePath);
+
+ var isFile = Path.HasExtension(remotePath);
+
+ if (isFile)
+ {
+ // 确保本地存在
+ if (!System.IO.File.Exists(localPath))
+ {
+ var ok = DownloadFileFromSftp(remotePath, localPath, out string err);
+ if (!ok) return Ok(new { success = false, message = $"下载失败: {err}" });
+ }
+ return GetFilePreviewLocal(localPath, remotePath);
+ }
+ else
+ {
+ // 目录:优先读取本地,没有则读取远程目录结构
+ if (Directory.Exists(localPath))
+ {
+ return GetDirectoryContentsLocal(localPath, remotePath);
+ }
+ else
+ {
+ return GetDirectoryContentsRemote(remotePath);
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ return Ok(new { success = false, message = $"服务器错误: {ex.Message}" });
+ }
+ }
+
+ [HttpPost]
+ [Route("download")]
+ public IHttpActionResult Download([FromBody] FileRequestDto request)
+ {
+ try
+ {
+ if (request == null || string.IsNullOrWhiteSpace(request.RelativePath))
+ return Ok(new { success = false, message = "文件路径不能为空" });
+
+ EnsureCacheRoot();
+
+ var remotePath = NormalizeRemotePath(request.RelativePath);
+ var localPath = ToLocalPath(remotePath);
+
+ if (!Path.HasExtension(remotePath))
+ return Ok(new { success = false, message = "请传入文件路径" });
+
+ if (!System.IO.File.Exists(localPath))
+ {
+ var ok = DownloadFileFromSftp(remotePath, localPath, out string err);
+ if (!ok) return Ok(new { success = false, message = $"下载失败: {err}" });
+ }
+
+ var fileInfo = new FileInfo(localPath);
+ var contentType = GetContentType(fileInfo.Name);
+ var response = new HttpResponseMessage(HttpStatusCode.OK)
+ {
+ Content = new StreamContent(new FileStream(localPath, FileMode.Open, FileAccess.Read, FileShare.Read))
+ };
+ response.Content.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue(contentType);
+ response.Content.Headers.ContentDisposition = new System.Net.Http.Headers.ContentDispositionHeaderValue("attachment")
+ {
+ FileName = fileInfo.Name
+ };
+ return ResponseMessage(response);
+ }
+ catch (Exception ex)
+ {
+ return Ok(new { success = false, message = $"下载文件失败: {ex.Message}" });
+ }
+ }
+
+ // 新增:浏览器直接预览文件(支持PDF等),支持Range分块
+ [HttpGet]
+ [Route("preview")]
+ public HttpResponseMessage Preview([FromUri] string path)
+ {
+ try
+ {
+ if (string.IsNullOrWhiteSpace(path))
+ {
+ return Request.CreateResponse(HttpStatusCode.BadRequest, new { success = false, message = "文件路径不能为空" });
+ }
+
+ EnsureCacheRoot();
+ var remotePath = NormalizeRemotePath(path);
+ var localPath = ToLocalPath(remotePath);
+
+ if (!Path.HasExtension(remotePath))
+ {
+ return Request.CreateResponse(HttpStatusCode.BadRequest, new { success = false, message = "请传入文件路径" });
+ }
+
+ if (!System.IO.File.Exists(localPath))
+ {
+ var ok = DownloadFileFromSftp(remotePath, localPath, out string err);
+ if (!ok)
+ {
+ return Request.CreateResponse(HttpStatusCode.InternalServerError, new { success = false, message = $"下载失败: {err}" });
+ }
+ }
+
+ var fileInfo = new FileInfo(localPath);
+ var contentType = GetContentType(fileInfo.Name);
+ var totalLength = fileInfo.Length;
+
+ var response = new HttpResponseMessage();
+ var range = Request.Headers.Range;
+
+ var stream = new FileStream(localPath, FileMode.Open, FileAccess.Read, FileShare.Read);
+ if (range != null && range.Ranges.Count > 0 && totalLength > 0)
+ {
+ // 处理 Range 请求
+ var from = range.Ranges.First().From ?? 0;
+ var to = range.Ranges.First().To ?? (totalLength - 1);
+ if (to >= totalLength) to = totalLength - 1;
+ var length = to - from + 1;
+ stream.Seek(from, SeekOrigin.Begin);
+
+ response.StatusCode = HttpStatusCode.PartialContent;
+ response.Content = new StreamContent(stream);
+ response.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType);
+ response.Content.Headers.ContentLength = length;
+ response.Content.Headers.ContentRange = new ContentRangeHeaderValue(from, to, totalLength);
+ response.Headers.AcceptRanges.Add("bytes");
+ }
+ else
+ {
+ // 全量流式
+ response.StatusCode = HttpStatusCode.OK;
+ response.Content = new StreamContent(stream);
+ response.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType);
+ response.Content.Headers.ContentLength = totalLength;
+ response.Headers.AcceptRanges.Add("bytes");
+ }
+
+ // inline 以支持浏览器内嵌预览
+ response.Content.Headers.ContentDisposition = new ContentDispositionHeaderValue("inline")
+ {
+ FileName = fileInfo.Name
+ };
+
+ // CORS 允许跨域及暴露必要头
+ if (!response.Headers.Contains("Access-Control-Allow-Origin"))
+ response.Headers.Add("Access-Control-Allow-Origin", "*");
+ if (!response.Headers.Contains("Access-Control-Expose-Headers"))
+ response.Headers.Add("Access-Control-Expose-Headers", "Accept-Ranges, Content-Range, Content-Length, Content-Type, Content-Disposition");
+
+ return response;
+ }
+ catch (Exception ex)
+ {
+ return Request.CreateResponse(HttpStatusCode.InternalServerError, new { success = false, message = $"预览失败: {ex.Message}" });
+ }
+ }
+
+ private IHttpActionResult GetFilePreviewLocal(string localPath, string remotePath)
+ {
+ try
+ {
+ var fileInfo = new FileInfo(localPath);
+ var extension = fileInfo.Extension.ToLowerInvariant();
+ var previewable = IsPreviewableFile(extension);
+ var contentType = GetContentType(fileInfo.Name);
+
+ bool tooLarge = fileInfo.Length > 500 * 1024 * 1024; // 500MB限制
+ string base64String = null;
+ string dataUrl = null;
+ bool canPreview = previewable && !tooLarge;
+ if (canPreview)
+ {
+ var fileBytes = System.IO.File.ReadAllBytes(localPath);
+ base64String = Convert.ToBase64String(fileBytes);
+ dataUrl = $"data:{contentType};base64,{base64String}";
+ }
+
+ var result = new
+ {
+ success = true,
+ type = "file",
+ path = remotePath,
+ name = fileInfo.Name,
+ size = fileInfo.Length,
+ extension = fileInfo.Extension,
+ contentType = contentType,
+ isPreviewable = canPreview,
+ base64Data = base64String,
+ dataUrl = dataUrl,
+ created = fileInfo.CreationTime,
+ modified = fileInfo.LastWriteTime,
+ message = tooLarge ? "文件过大,无法预览,可下载" : null
+ };
+ return Ok(result);
+ }
+ catch (Exception ex)
+ {
+ return Ok(new { success = false, message = $"获取文件预览失败: {ex.Message}" });
+ }
+ }
+
+ private IHttpActionResult GetDirectoryContentsLocal(string localPath, string remotePath)
+ {
+ try
+ {
+ var items = new List