chore: 初始化东安动力MES采集程序
This commit is contained in:
@@ -0,0 +1,121 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using DataLinkMesWork;
|
||||
|
||||
using SystemFramework;
|
||||
|
||||
namespace bizFacade
|
||||
{
|
||||
partial class BaseDataSystemMES
|
||||
{
|
||||
/// <summary>
|
||||
/// 机床报警变量
|
||||
/// 103
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static DataTable BaseData_tagTable_Alarm()
|
||||
{
|
||||
//string errorMessage;
|
||||
DataTable dt;
|
||||
string sql;
|
||||
sql = "SELECT TagID,0 as TagValue,TagName,工位号,数据来源,TagTypeID,TagLong,列位置,测量位置,变量类型代码,测量项目,TagAdr,TagAdrDemo FROM [MES_基本变量_原始数据] where 变量类型代码 = 103 and 是否启用 = 1"
|
||||
+ " and (监控属性代码 = '" + 1 + "')";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
return dt;
|
||||
}
|
||||
/// <summary>
|
||||
/// 测量数据发动机在线状态_增加数据_自动工位
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="EngineID"></param>
|
||||
/// <param name="Pallet"></param>
|
||||
/// <param name="arrivedTime"></param>
|
||||
/// <param name="leavedTime"></param>
|
||||
/// <param name="TimeDiff"></param>
|
||||
/// <param name="Target"></param>
|
||||
/// <param name="lineType"></param>
|
||||
/// <param name="isPass"></param>
|
||||
/// <param name="OpNameUpDownType"></param>
|
||||
static public void WorkStartInsert_AutoWorkStation(string opName, string EngineID, int Pallet, DateTime arrivedTime, DateTime leavedTime, int TimeDiff, int Target, string lineType, string isPass, int OpNameUpDownType)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "测量数据发动机在线状态_增加数据_自动工位";
|
||||
SqlParameter[] thisParms = new SqlParameter[10];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@发动机号", EngineID);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@托盘编号", Pallet);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@到达时间", arrivedTime);
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@离开时间", leavedTime);
|
||||
thisParms[5] = new System.Data.SqlClient.SqlParameter("@在线时间", TimeDiff);
|
||||
thisParms[6] = new System.Data.SqlClient.SqlParameter("@目标时间", Target);
|
||||
thisParms[7] = new System.Data.SqlClient.SqlParameter("@线体类型", lineType);
|
||||
thisParms[8] = new System.Data.SqlClient.SqlParameter("@是否合格", isPass);
|
||||
thisParms[9] = new System.Data.SqlClient.SqlParameter("@工位上下线类型", OpNameUpDownType);
|
||||
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);
|
||||
}
|
||||
// ALTER PROCEDURE[dbo].[测量数据报警全部_增加数据]
|
||||
// @TagID nvarchar(50),
|
||||
//@OpName nvarchar(50),
|
||||
//@TagValue int,
|
||||
//@State int,
|
||||
//@alarmStartTime datetime,
|
||||
//@alarmEndTime datetime,
|
||||
//@TimeDiff int,
|
||||
//@Text1 nvarchar(255),
|
||||
//@Text2 nvarchar(255)
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="TagID"></param>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="TagValue"></param>
|
||||
/// <param name="State"></param>
|
||||
/// <param name="alarmStartTime"></param>
|
||||
/// <param name="alarmEndTime"></param>
|
||||
/// <param name="TimeDiff"></param>
|
||||
/// <param name="Text1">报警级别</param>
|
||||
/// <param name="Text2">报文</param>
|
||||
/// <param name="TagOrderBy"></param>
|
||||
/// <returns></returns>
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using DataLinkMesWork;
|
||||
|
||||
using SystemFramework;
|
||||
|
||||
namespace bizFacade
|
||||
{
|
||||
public partial class BaseDataSystemMES
|
||||
{
|
||||
/// <summary>
|
||||
/// 发动机类型转换表
|
||||
/// SELECT ID,发动机机型代码 FROM MES_计划BOM_发动机型号代码
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static DataTable BaseData_tagTable_QualityData_EngineTypeID()
|
||||
{
|
||||
DataTable dt;
|
||||
string sql;
|
||||
sql = "SELECT ID,发动机机型代码 FROM MES_计划BOM_发动机型号代码 ";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
return dt;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 测量合格标志
|
||||
/// 全部测量数据的测量工位
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
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;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 测量合格标志
|
||||
/// 全部测量数据的测量工位的数据来源
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
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;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 测量合格标志
|
||||
/// 全部测量数据的测量工位的数据来源的测量变量
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using DataLinkMesWork;
|
||||
|
||||
using SystemFramework;
|
||||
|
||||
namespace bizFacade
|
||||
{
|
||||
public partial class BaseDataSystemMES
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 测量工位号和工位名称
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
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;
|
||||
}
|
||||
/// <summary>
|
||||
/// MES_计划BOM_工位与名称
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using DataLinkMesWork;
|
||||
|
||||
using SystemFramework;
|
||||
|
||||
namespace bizFacade
|
||||
{
|
||||
public partial class BaseDataSystemMES
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// MES_基本变量_DB数据结构_根据工位代码_获得普通变量
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
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;
|
||||
}
|
||||
/// <summary>
|
||||
/// MES_基本变量_DB数据结构_根据工位代码_获得普通变量
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
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;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// MES_基本变量_DB数据结构_获得激发变量
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
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;
|
||||
}
|
||||
/// <summary>
|
||||
/// MES_基本变量_DB数据结构_获得激发变量
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
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;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 20170310 新加
|
||||
/// MES_基本变量_DB数据结构_获得所有普通变量(除101.102.103.104.105)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
BIN
Common/07WebBusinessFacade/BusinessFacade/05Biz/OPC/vssver2.scc
Normal file
BIN
Common/07WebBusinessFacade/BusinessFacade/05Biz/OPC/vssver2.scc
Normal file
Binary file not shown.
Reference in New Issue
Block a user