chore: 初始化北汽福田MES采集程序
This commit is contained in:
@@ -0,0 +1,105 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
|
||||
using System.Collections;
|
||||
using System.Collections.Specialized;
|
||||
//using SystemFramework;
|
||||
using DataLinkMesWork;
|
||||
namespace SystemFramework
|
||||
{
|
||||
|
||||
}
|
||||
namespace bizFacade
|
||||
{
|
||||
/// <summary>
|
||||
/// 电子看板信息系统
|
||||
/// select 重量1,重量2,重量差,允许重量差,合格标志
|
||||
/// </summary>
|
||||
public partial class BaseDataSystemMES
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 电子看板_发动机号_分线组件装配关系_增加
|
||||
/// </summary>
|
||||
/// <param name="engineID"></param>
|
||||
/// <param name="engineTypeID"></param>
|
||||
/// <param name="engineType"></param>
|
||||
/// <param name="engineID_SubLine"></param>
|
||||
static public void MailLineAndSubLineData_Insert(string engineID, int engineTypeID, string engineType, string engineID_SubLine)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "电子看板_发动机号_分线组件装配关系_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[4];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@发动机号_分线", engineID_SubLine);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@发动机号", engineID);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@机型代码", engineTypeID);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@发动机型号", engineType);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
/// <summary>
|
||||
/// 电子看板_发动机号_线首工位_查询_根据发动机号
|
||||
/// select 工位号,订单号,发动机号,基本机型,机型代码,发动机型号,托盘号,
|
||||
/// 条码类型,零件流水号,零件流水号带空格,壳体编号型号,壳体编号型号带空格,QR码
|
||||
/// from dbo.电子看板_发动机号_线首工位
|
||||
/// where 发动机号=@发动机号 and 是否禁用=0
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="engineID"></param>
|
||||
/// <param name="dt"></param>
|
||||
static public void GetEngineID_Select(string opName,string engineID, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "电子看板_发动机号_线首工位_查询_根据发动机号";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@发动机号", engineID);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 测量数据工位_监控系统_操作者工号_是否登录
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="engineID"></param>
|
||||
/// <param name="dt"></param>
|
||||
static public void CheckUser_IsLogin(string opName, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "测量数据工位_监控系统_操作者工号_是否登录";
|
||||
SqlParameter[] thisParms = new SqlParameter[1];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt);
|
||||
}
|
||||
|
||||
static public void SubLineLoadPartCountMatch_Update( string opName, int SubLineLoadPartCountMatch)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "MES_计划BOM_工位与名称_工步属性修改";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@工步属性", SubLineLoadPartCountMatch);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
|
||||
|
||||
static public void SubLineLoadPartCountMatch_Select(string opName, out int SubLineLoadPartCountMatch)
|
||||
{
|
||||
string procedureName;
|
||||
DataTable dt;
|
||||
procedureName = "MES_计划BOM_工位与名称_工步属性查询";
|
||||
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)
|
||||
{
|
||||
SubLineLoadPartCountMatch = Convert.ToInt32(dt.Rows[0][0]);
|
||||
}
|
||||
else
|
||||
{
|
||||
SubLineLoadPartCountMatch = 0;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
204
Common/07WebBusinessFacade/BusinessFacade/05Biz/MES/Materials.cs
Normal file
204
Common/07WebBusinessFacade/BusinessFacade/05Biz/MES/Materials.cs
Normal file
@@ -0,0 +1,204 @@
|
||||
using DataLinkMesWork;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace bizFacade
|
||||
{
|
||||
public partial class BaseDataSystemMES
|
||||
{
|
||||
/// <summary>
|
||||
/// 测量数据工位_监控系统_自动手动_查询
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <returns></returns>
|
||||
public static DataTable OpName_MIS_AutoOrMaunal_Select(string opName)
|
||||
{
|
||||
DataTable dt = null;
|
||||
string sql;
|
||||
sql = "SELECT top 1 自动手动 from 测量数据工位_监控系统_自动手动 where 工位号='" + opName + "' ";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
return dt;
|
||||
}
|
||||
/// <summary>
|
||||
/// 订单下达到线首工位
|
||||
/// 北汽福田工位状态监控MOBY_增加_线首工位订单下达
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <returns></returns>
|
||||
public static void OrderWorkStartToOpName(string opName,string orderForm)
|
||||
{
|
||||
string procedureName = "北汽福田工位状态监控MOBY_增加_线首工位订单下达";
|
||||
SqlParameter[] thisParms = new SqlParameter[3];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@订单号", orderForm);
|
||||
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 电子看板_发动机号_线首工位_流水号_修改
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="engineID"></param>
|
||||
/// <returns></returns>
|
||||
static public bool FirstOpName_Code_Update(string opName, string engineID, string partcode)
|
||||
{
|
||||
string 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("@托盘号", partcode);
|
||||
if (DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 测量数据工位_监控系统_自动手动_增加
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="isAutoOrManul"></param>
|
||||
/// <returns></returns>
|
||||
public static bool OpName_MIS_AutoOrMaunal_Insert(string opName, int isAutoOrManul)
|
||||
{
|
||||
string produceName = "测量数据工位_监控系统_自动手动_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@自动手动", isAutoOrManul);
|
||||
return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// MES_装配数据_零部件追溯_增加_不合格
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="m_ConfirmOkGo"></param>
|
||||
/// <returns></returns>
|
||||
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);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 测量数据工位_监控系统_手动打印_查询
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static bool OpName_MIS_MaualPrint_Select(string opName, out DataTable dt)
|
||||
{
|
||||
string sql;
|
||||
sql = "SELECT top 1 * FROM [测量数据工位_监控系统_手动打印] "
|
||||
+ "where 工位号='" + opName + "'";
|
||||
return DataAccess.ExecuteDataTable(sql, out dt);
|
||||
}
|
||||
/// <summary>
|
||||
/// 测量数据工位_监控系统_MOBY_查询
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="orderForm"></param>
|
||||
/// <param name="engineTypeID"></param>
|
||||
/// <param name="engineType"></param>
|
||||
/// <param name="engineID"></param>
|
||||
/// <param name="palletCode"></param>
|
||||
/// <param name="isRepair"></param>
|
||||
/// <param name="repairCode"></param>
|
||||
/// <returns></returns>
|
||||
public static bool OpName_MIS_CreateMoby_Select(string opName,
|
||||
out string orderForm, out int engineTypeID, out string engineType,
|
||||
out string engineID, out string palletCode, out int isRepair, out string repairCode)
|
||||
{
|
||||
orderForm = "";
|
||||
engineTypeID = 0;
|
||||
engineType = "";
|
||||
engineID = "";
|
||||
palletCode = "";
|
||||
isRepair = 0;
|
||||
repairCode = "";
|
||||
|
||||
string produceName = "测量数据工位_监控系统_创建发动机号_扫描方式";
|
||||
SqlParameter[] thisParms = new SqlParameter[8];
|
||||
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;
|
||||
if (DataAccess.ExecuteStoredProcedure(produceName, ref thisParms))
|
||||
{
|
||||
orderForm = thisParms[1].Value.ToString();
|
||||
engineTypeID = Convert.ToInt32(thisParms[2].Value);
|
||||
engineType = thisParms[3].Value.ToString();
|
||||
engineID = thisParms[4].Value.ToString();
|
||||
palletCode = thisParms[5].Value.ToString();
|
||||
isRepair = Convert.ToInt32(thisParms[6].Value);
|
||||
repairCode = thisParms[7].Value.ToString();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 电子看板_工位机型_质量数据测量位置_临时表_查询_完成情况
|
||||
/// </summary>
|
||||
/// <param name="opName">工位号</param>
|
||||
/// <param name="ProcessCode">拧紧序号</param>
|
||||
/// <param name="BoltCode">套筒号</param>
|
||||
/// <param name="workStepProperty">工步属性</param>
|
||||
/// <param name="sn_WorkingStepIsOver">是否全部完成</param>
|
||||
/// <returns></returns>
|
||||
public static bool MesServer_ShaftPosition_Select_FinishResult(string opName, out int ProcessCode, out int BoltCode, out int workStepProperty, out bool sn_WorkingStepIsOver)
|
||||
{
|
||||
BoltCode = 0;
|
||||
ProcessCode = 512;
|
||||
workStepProperty = 0;
|
||||
sn_WorkingStepIsOver = true;
|
||||
|
||||
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.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;
|
||||
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);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,447 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using DataLinkMesWork;
|
||||
using System.Collections;
|
||||
using System.Collections.Specialized;
|
||||
using SystemFramework;
|
||||
|
||||
namespace bizFacade
|
||||
{
|
||||
/// <summary>
|
||||
/// 电子看板信息系统
|
||||
/// </summary>
|
||||
public partial class BaseDataSystemMES
|
||||
{
|
||||
///// <summary>
|
||||
///// 电子看板_发动机号_线首工位_创建线首发动机号_根据输入机型代码_手动方式
|
||||
///// </summary>
|
||||
///// <param name="opName">工位号</param>
|
||||
///// <param name="engineType">发动机型号</param>
|
||||
///// <param name="engineYear">年份</param>
|
||||
///// <param name="engineMoon">月份</param>
|
||||
///// <param name="engineDay">日期</param>
|
||||
///// <param name="engineNumber">流水号</param>
|
||||
///// <param name="isSubLine">@是否分线 bit=0 @是否分线 = 0 总线线首(OP2010);=1分线线首(OP1010,OP2100)</param>
|
||||
///// <param name="dt"></param>
|
||||
//static public void GetEngineID_Manual(string opName, string engineType, string engineYear, string engineMoon, string engineDay, int engineNumber, bool isSubLine, out DataTable dt)
|
||||
//{
|
||||
// string procedureName;
|
||||
// procedureName = "电子看板_发动机号_线首工位_创建线首发动机号_根据输入机型代码_手动方式";
|
||||
// SqlParameter[] thisParms = new SqlParameter[7];
|
||||
// thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
// thisParms[1] = new System.Data.SqlClient.SqlParameter("@发动机型号", engineType);
|
||||
// thisParms[2] = new System.Data.SqlClient.SqlParameter("@年份", engineYear);
|
||||
// thisParms[3] = new System.Data.SqlClient.SqlParameter("@月份", engineMoon);
|
||||
// thisParms[4] = new System.Data.SqlClient.SqlParameter("@日期", engineDay);
|
||||
// thisParms[5] = new System.Data.SqlClient.SqlParameter("@流水号", engineNumber);
|
||||
// thisParms[6] = new System.Data.SqlClient.SqlParameter("@是否分线", isSubLine);
|
||||
// DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt);
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// 电子看板_发动机号_线首工位_创建线首发动机号_根据输入机型代码
|
||||
/// 工件机型,机型代码,工件编号,壳体编号型号,工件流水号,QR码,基本流水号
|
||||
/// </summary>
|
||||
/// <param name="opName">工位号</param>
|
||||
/// <param name="engineType">发动机型号</param>
|
||||
/// <param name="palletCode">托盘号 = 0 总线线首(OP2010);=1分线线首(OP1010,OP2100)</param>
|
||||
/// <param name="dt">工件机型,机型代码,工件编号,壳体编号型号,工件流水号,QR码,基本流水号</param>
|
||||
static public void GetEngineID_Auto(string opName, string engineType, string palletCode, out DataTable dt)
|
||||
{
|
||||
try
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "电子看板_发动机号_线首工位_创建线首发动机号_根据输入机型代码";
|
||||
SqlParameter[] thisParms = new SqlParameter[3];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@发动机型号", engineType);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@托盘号", palletCode);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt);
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
dt = null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 分线线首号生成
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="engineType"></param>
|
||||
/// <param name="partcode"></param>
|
||||
/// <param name="dt"></param>
|
||||
static public void GetEngineID_Auto_branch(string opName, string engineType, string partcode, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "电子看板_发动机号_线首工位_创建线首发动机号_根据输入机型代码_分线";
|
||||
SqlParameter[] thisParms = new SqlParameter[3];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@发动机型号", engineType);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@托盘号", partcode);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt);
|
||||
}
|
||||
/// <summary>
|
||||
/// 电子看板_发动机号_线首工位_创建线首发动机号_根据输入机型代码_分线_手动方式
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="engineType"></param>
|
||||
/// <param name="engineYear"></param>
|
||||
/// <param name="engineMoon"></param>
|
||||
/// <param name="engineDay"></param>
|
||||
/// <param name="engineNumber"></param>
|
||||
/// <param name="isSubLine"></param>
|
||||
/// <param name="dt"></param>
|
||||
static public void GetEngineID_Manual_branch(string opName, string engineType, string engineYear, string engineMoon, string engineDay, int engineNumber, bool isSubLine, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "电子看板_发动机号_线首工位_创建线首发动机号_根据输入机型代码_分线_手动方式";
|
||||
SqlParameter[] thisParms = new SqlParameter[7];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@发动机型号", engineType);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@年份", engineYear);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@月份", engineMoon);
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@日期", engineDay);
|
||||
thisParms[5] = new System.Data.SqlClient.SqlParameter("@流水号", engineNumber);
|
||||
thisParms[6] = new System.Data.SqlClient.SqlParameter("@是否分线", isSubLine);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt);
|
||||
}
|
||||
|
||||
///// <summary>
|
||||
///// [电子看板_发动机号_线首工位_手动方式_增加]
|
||||
///// </summary>
|
||||
///// <param name="opName">工位号</param>
|
||||
///// <param name="orderForm">订单号</param>
|
||||
///// <param name="PartPalletCode">托盘号</param>
|
||||
///// <param name="engineType">工件机型</param>
|
||||
///// <param name="dt">工件机型,机型代码,工件编号, 壳体编号型号,工件流水号,QR码,基本流水号</param>
|
||||
//static public bool GetEngineID_ManulEngine_Save(string opName, string orderForm, string PartPalletCode, string engineType, string EngineID_DateTime, DataTable dt)
|
||||
//{
|
||||
// string engineID;
|
||||
// int engineTypeID;
|
||||
// string partCode_Space;
|
||||
// string partCode;
|
||||
// string shellCode;
|
||||
// string shellCode_Space;
|
||||
// string QR_Code;
|
||||
// int engineCount;
|
||||
// int barCodeType;
|
||||
// string engineTypeBase;
|
||||
// string partCode_Text;
|
||||
// string partCode_BarCode;
|
||||
// string engineType_Text;
|
||||
// string engineType_BarCode;
|
||||
|
||||
// try
|
||||
// {
|
||||
// GetEngineIDFromFirstOpName(out engineID, out engineTypeID, out partCode_Space,
|
||||
// out partCode, out shellCode, out shellCode_Space, out QR_Code,
|
||||
// out engineCount, out barCodeType, out engineTypeBase,
|
||||
// out partCode_Text, out partCode_BarCode, out engineType_Text, out engineType_BarCode, dt);
|
||||
|
||||
|
||||
// string procedureName;
|
||||
// procedureName = "电子看板_发动机号_线首工位_手动方式_增加";
|
||||
// SqlParameter[] thisParms = new SqlParameter[19];
|
||||
// thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
// thisParms[1] = new System.Data.SqlClient.SqlParameter("@订单号", orderForm);
|
||||
// thisParms[2] = new System.Data.SqlClient.SqlParameter("@发动机号", engineID);
|
||||
// thisParms[3] = new System.Data.SqlClient.SqlParameter("@发动机型号", engineType);
|
||||
// thisParms[4] = new System.Data.SqlClient.SqlParameter("@基本机型", engineTypeBase);
|
||||
// thisParms[5] = new System.Data.SqlClient.SqlParameter("@机型代码", engineTypeID);
|
||||
// thisParms[6] = new System.Data.SqlClient.SqlParameter("@托盘号", PartPalletCode);
|
||||
// thisParms[7] = new System.Data.SqlClient.SqlParameter("@条码类型", barCodeType);
|
||||
// thisParms[8] = new System.Data.SqlClient.SqlParameter("@零件流水号", partCode);
|
||||
// thisParms[9] = new System.Data.SqlClient.SqlParameter("@零件流水号带空格", partCode_Space);
|
||||
// thisParms[10] = new System.Data.SqlClient.SqlParameter("@壳体编号型号", shellCode);
|
||||
// thisParms[11] = new System.Data.SqlClient.SqlParameter("@壳体编号型号带空格", shellCode_Space);
|
||||
// thisParms[12] = new System.Data.SqlClient.SqlParameter("@QR码", QR_Code);
|
||||
// thisParms[13] = new System.Data.SqlClient.SqlParameter("@基本流水号", engineCount);
|
||||
// thisParms[14] = new System.Data.SqlClient.SqlParameter("@流水号文本", partCode_Text);
|
||||
// thisParms[15] = new System.Data.SqlClient.SqlParameter("@流水号条码", partCode_BarCode);
|
||||
// thisParms[16] = new System.Data.SqlClient.SqlParameter("@型号文本", engineType_Text);
|
||||
// thisParms[17] = new System.Data.SqlClient.SqlParameter("@型号条码", engineType_BarCode);
|
||||
// thisParms[18] = new System.Data.SqlClient.SqlParameter("@工件编号时间", EngineID_DateTime);
|
||||
|
||||
// return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
// // return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt);
|
||||
// }
|
||||
|
||||
// catch (Exception err)
|
||||
// {
|
||||
// ////ApplicationLog.WriteLog(err, err.Message);
|
||||
// return false;
|
||||
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
///// <summary>
|
||||
///// 电子看板_发动机号_线首工位_增加
|
||||
///// </summary>
|
||||
///// <param name="opName">工位号</param>
|
||||
///// <param name="orderForm">订单号</param>
|
||||
///// <param name="PartPalletCode">托盘号</param>
|
||||
///// <param name="engineType">工件机型</param>
|
||||
///// <param name="dt">工件机型,机型代码,工件编号, 壳体编号型号,工件流水号,QR码,基本流水号</param>
|
||||
//static public bool GetEngineID_Save(string opName, string orderForm, string PartPalletCode, string engineType, DataTable dt)
|
||||
//{
|
||||
// string engineID;
|
||||
// int engineTypeID;
|
||||
// string partCode_Space;
|
||||
// string partCode;
|
||||
// string shellCode;
|
||||
// string shellCode_Space;
|
||||
// string QR_Code;
|
||||
// int engineCount;
|
||||
// int barCodeType;
|
||||
// string engineTypeBase;
|
||||
// string partCode_Text;
|
||||
// string partCode_BarCode;
|
||||
// string engineType_Text;
|
||||
// string engineType_BarCode;
|
||||
// string codeCreatetime;
|
||||
// string a_code;
|
||||
// string b_code;
|
||||
// string c_code;
|
||||
// string d_code;
|
||||
|
||||
// try
|
||||
// {
|
||||
// GetEngineIDFromFirstOpName_Auto(out engineID, out engineTypeID, out partCode_Space,
|
||||
// out partCode, out shellCode, out shellCode_Space, out QR_Code,
|
||||
// out engineCount, out barCodeType, out engineTypeBase,
|
||||
// out partCode_Text, out partCode_BarCode, out engineType_Text, out engineType_BarCode, out codeCreatetime,
|
||||
// out a_code, out b_code, out c_code, out d_code,
|
||||
// dt);
|
||||
|
||||
|
||||
// string procedureName;
|
||||
// procedureName = "电子看板_发动机号_线首工位_增加";
|
||||
// SqlParameter[] thisParms = new SqlParameter[23];
|
||||
// thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
// thisParms[1] = new System.Data.SqlClient.SqlParameter("@订单号", orderForm);
|
||||
// thisParms[2] = new System.Data.SqlClient.SqlParameter("@发动机号", engineID);
|
||||
// thisParms[3] = new System.Data.SqlClient.SqlParameter("@发动机型号", engineType);
|
||||
// thisParms[4] = new System.Data.SqlClient.SqlParameter("@基本机型", engineTypeBase);
|
||||
// thisParms[5] = new System.Data.SqlClient.SqlParameter("@机型代码", engineTypeID);
|
||||
// thisParms[6] = new System.Data.SqlClient.SqlParameter("@托盘号", PartPalletCode);
|
||||
// thisParms[7] = new System.Data.SqlClient.SqlParameter("@条码类型", barCodeType);
|
||||
// thisParms[8] = new System.Data.SqlClient.SqlParameter("@零件流水号", partCode);
|
||||
// thisParms[9] = new System.Data.SqlClient.SqlParameter("@零件流水号带空格", partCode_Space);
|
||||
// thisParms[10] = new System.Data.SqlClient.SqlParameter("@壳体编号型号", shellCode);
|
||||
// thisParms[11] = new System.Data.SqlClient.SqlParameter("@壳体编号型号带空格", shellCode_Space);
|
||||
// thisParms[12] = new System.Data.SqlClient.SqlParameter("@QR码", QR_Code);
|
||||
// thisParms[13] = new System.Data.SqlClient.SqlParameter("@基本流水号", engineCount);
|
||||
// thisParms[14] = new System.Data.SqlClient.SqlParameter("@流水号文本", partCode_Text);
|
||||
// thisParms[15] = new System.Data.SqlClient.SqlParameter("@流水号条码", partCode_BarCode);
|
||||
// thisParms[16] = new System.Data.SqlClient.SqlParameter("@型号文本", engineType_Text);
|
||||
// thisParms[17] = new System.Data.SqlClient.SqlParameter("@型号条码", engineType_BarCode);
|
||||
// thisParms[18] = new System.Data.SqlClient.SqlParameter("@条码创建时间", codeCreatetime);
|
||||
// thisParms[19] = new System.Data.SqlClient.SqlParameter("@总成代码", a_code);
|
||||
// thisParms[20] = new System.Data.SqlClient.SqlParameter("@零件图号", b_code);
|
||||
// thisParms[21] = new System.Data.SqlClient.SqlParameter("@邓氏码", c_code);
|
||||
// thisParms[22] = new System.Data.SqlClient.SqlParameter("@VPPS码", d_code);
|
||||
|
||||
|
||||
// return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
// // return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt);
|
||||
// }
|
||||
|
||||
// catch (Exception err)
|
||||
// {
|
||||
// ////ApplicationLog.WriteLog(err, err.Message);
|
||||
// return false;
|
||||
|
||||
// }
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// 电子看板_发动机号_线首工位_增加
|
||||
/// </summary>
|
||||
/// <param name="opName">工位号</param>
|
||||
/// <param name="orderForm">订单号</param>
|
||||
/// <param name="PartPalletCode">托盘号</param>
|
||||
/// <param name="engineType">工件机型</param>
|
||||
/// <param name="dt">工件机型,机型代码,工件编号, 壳体编号型号,工件流水号,QR码,基本流水号</param>
|
||||
static public bool GetEngineID_Save_Outline(string opName, string orderForm, string PartPalletCode, string engineType, int engineTypeID, string engineID, string barCodeType)
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "电子看板_发动机号_线首工位_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[19];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@订单号", orderForm);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@发动机号", engineID);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@发动机型号", engineType);
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@基本机型", engineType);
|
||||
thisParms[5] = new System.Data.SqlClient.SqlParameter("@机型代码", engineTypeID);
|
||||
thisParms[6] = new System.Data.SqlClient.SqlParameter("@托盘号", PartPalletCode);
|
||||
thisParms[7] = new System.Data.SqlClient.SqlParameter("@条码类型", barCodeType);
|
||||
thisParms[8] = new System.Data.SqlClient.SqlParameter("@零件流水号", engineID);
|
||||
thisParms[9] = new System.Data.SqlClient.SqlParameter("@零件流水号带空格", engineID);
|
||||
thisParms[10] = new System.Data.SqlClient.SqlParameter("@壳体编号型号", engineType);
|
||||
thisParms[11] = new System.Data.SqlClient.SqlParameter("@壳体编号型号带空格", engineType);
|
||||
thisParms[12] = new System.Data.SqlClient.SqlParameter("@QR码", engineID);
|
||||
thisParms[13] = new System.Data.SqlClient.SqlParameter("@基本流水号", 1);
|
||||
thisParms[14] = new System.Data.SqlClient.SqlParameter("@流水号文本", engineID);
|
||||
thisParms[15] = new System.Data.SqlClient.SqlParameter("@流水号条码", engineID);
|
||||
thisParms[16] = new System.Data.SqlClient.SqlParameter("@型号文本", engineType);
|
||||
thisParms[17] = new System.Data.SqlClient.SqlParameter("@型号条码", engineType);
|
||||
thisParms[18] = new System.Data.SqlClient.SqlParameter("@条码创建时间", DateTime.Now.ToShortDateString());
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
|
||||
catch (Exception err)
|
||||
{
|
||||
////ApplicationLog.WriteLog(err, err.Message);
|
||||
return false;
|
||||
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 电子看板_装配零件_盆子类型_查询
|
||||
/// </summary>
|
||||
static public DataTable WorkPlatePartSelect(string opName, string engineID)
|
||||
{
|
||||
try
|
||||
{
|
||||
DataTable dt = new DataTable();
|
||||
string procedureName;
|
||||
procedureName = "电子看板_装配零件_盆子类型_查询";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@发动机型号", engineID);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt);
|
||||
return dt;
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
////ApplicationLog.WriteLog(err, err.Message);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// [电子看板_发动机号_线首工位]信息手动用
|
||||
/// </summary>
|
||||
/// <param name="engineID">发动机号</param>
|
||||
/// <param name="engineTypeID">机型代码</param>
|
||||
/// <param name="partCode_Space">零件流水号带空格</param>
|
||||
/// <param name="partCode">零件流水号</param>
|
||||
/// <param name="shellCode">壳体编号型号</param>
|
||||
/// <param name="shellCode_Space">壳体编号型号带空格</param>
|
||||
/// <param name="QR_Code">QR码</param>
|
||||
/// <param name="engineCount">基本流水号</param>
|
||||
/// <param name="barCodeType">条码类型</param>
|
||||
/// <param name="engineTypeBase">基本机型</param>
|
||||
/// <param name="partCode_Text">流水号文本</param>
|
||||
/// <param name="partCode_BarCode">流水号条码</param>
|
||||
/// <param name="engineType_Text">型号文本</param>
|
||||
/// <param name="engineType_BarCode">型号条码</param>
|
||||
/// <param name="dt"></param>
|
||||
//static public void GetEngineIDFromFirstOpName(out string engineID, out int engineTypeID, out string partCode_Space,
|
||||
// out string partCode, out string shellCode, out string shellCode_Space, out string QR_Code,
|
||||
// out int engineCount, out int barCodeType, out string engineTypeBase,
|
||||
// out string partCode_Text, out string partCode_BarCode,
|
||||
// out string engineType_Text, out string engineType_BarCode,
|
||||
// DataTable dt)
|
||||
//{
|
||||
// engineID = "";
|
||||
// engineTypeID = 0;
|
||||
// partCode_Space = "";
|
||||
// partCode = "";
|
||||
// shellCode = "";
|
||||
// shellCode_Space = "";
|
||||
// QR_Code = "";
|
||||
// engineCount = 0;
|
||||
// barCodeType = 0;
|
||||
// engineTypeBase = "";
|
||||
// partCode_Text = "";
|
||||
// partCode_BarCode = "";
|
||||
// engineType_Text = "";
|
||||
// engineType_BarCode = "";
|
||||
|
||||
// engineID = dt.Rows[0]["发动机号"].ToString();
|
||||
// engineTypeID = Convert.ToInt32(dt.Rows[0]["机型代码"]);
|
||||
// shellCode = dt.Rows[0]["壳体编号型号"].ToString();
|
||||
// shellCode_Space = dt.Rows[0]["壳体编号型号带空格"].ToString();
|
||||
// partCode = dt.Rows[0]["零件流水号"].ToString();
|
||||
// partCode_Space = dt.Rows[0]["零件流水号带空格"].ToString();
|
||||
// QR_Code = dt.Rows[0]["QR码"].ToString();
|
||||
// engineCount = Convert.ToInt32(dt.Rows[0]["基本流水号"]);
|
||||
// engineTypeBase = dt.Rows[0]["基本机型"].ToString();
|
||||
// barCodeType = Convert.ToInt32(dt.Rows[0]["条码类型"]);
|
||||
// partCode_Text = dt.Rows[0]["流水号文本"].ToString();
|
||||
// partCode_BarCode = dt.Rows[0]["流水号条码"].ToString();
|
||||
// engineType_Text = dt.Rows[0]["型号文本"].ToString();
|
||||
// engineType_BarCode = dt.Rows[0]["型号条码"].ToString();
|
||||
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// [电子看板_发动机号_线首工位]信息自动用
|
||||
/// </summary>
|
||||
/// <param name="engineID">发动机号</param>
|
||||
/// <param name="engineTypeID">机型代码</param>
|
||||
/// <param name="partCode_Space">零件流水号带空格</param>
|
||||
/// <param name="partCode">零件流水号</param>
|
||||
/// <param name="shellCode">壳体编号型号</param>
|
||||
/// <param name="shellCode_Space">壳体编号型号带空格</param>
|
||||
/// <param name="QR_Code">QR码</param>
|
||||
/// <param name="engineCount">基本流水号</param>
|
||||
/// <param name="barCodeType">条码类型</param>
|
||||
/// <param name="engineTypeBase">基本机型</param>
|
||||
/// <param name="partCode_Text">流水号文本</param>
|
||||
/// <param name="partCode_BarCode">流水号条码</param>
|
||||
/// <param name="engineType_Text">型号文本</param>
|
||||
/// <param name="engineType_BarCode">型号条码</param>
|
||||
/// <param name="dt"></param>
|
||||
static public void GetEngineIDFromFirstOpName_Auto(out string engineID, out int engineTypeID, out string partCode_Space,
|
||||
out string partCode, out string shellCode, out string shellCode_Space, out string QR_Code,
|
||||
out int engineCount, out int barCodeType, out string engineTypeBase,
|
||||
out string partCode_Text, out string partCode_BarCode,
|
||||
out string engineType_Text, out string engineType_BarCode, out string CodeCreatetime,
|
||||
out string a_code, out string b_code, out string c_code, out string d_code,
|
||||
DataTable dt)
|
||||
{
|
||||
engineID = "";
|
||||
engineTypeID = 0;
|
||||
partCode_Space = "";
|
||||
partCode = "";
|
||||
shellCode = "";
|
||||
shellCode_Space = "";
|
||||
QR_Code = "";
|
||||
engineCount = 0;
|
||||
barCodeType = 0;
|
||||
engineTypeBase = "";
|
||||
partCode_Text = "";
|
||||
partCode_BarCode = "";
|
||||
engineType_Text = "";
|
||||
engineType_BarCode = "";
|
||||
|
||||
engineID = dt.Rows[0]["发动机号"].ToString();
|
||||
engineTypeID = Convert.ToInt32(dt.Rows[0]["机型代码"]);
|
||||
shellCode = dt.Rows[0]["壳体编号型号"].ToString();
|
||||
shellCode_Space = dt.Rows[0]["壳体编号型号带空格"].ToString();
|
||||
partCode = dt.Rows[0]["零件流水号"].ToString();
|
||||
partCode_Space = dt.Rows[0]["零件流水号带空格"].ToString();
|
||||
QR_Code = dt.Rows[0]["QR码"].ToString();
|
||||
engineCount = Convert.ToInt32(dt.Rows[0]["基本流水号"]);
|
||||
engineTypeBase = dt.Rows[0]["基本机型"].ToString();
|
||||
barCodeType = Convert.ToInt32(dt.Rows[0]["条码类型"]);
|
||||
partCode_Text = dt.Rows[0]["流水号文本"].ToString();
|
||||
partCode_BarCode = dt.Rows[0]["流水号条码"].ToString();
|
||||
engineType_Text = dt.Rows[0]["型号文本"].ToString();
|
||||
engineType_BarCode = dt.Rows[0]["型号条码"].ToString();
|
||||
CodeCreatetime = dt.Rows[0]["条码创建时间"].ToString();
|
||||
a_code = dt.Rows[0]["总成代码"].ToString();
|
||||
b_code = dt.Rows[0]["零件图号"].ToString();
|
||||
c_code = dt.Rows[0]["邓氏码"].ToString();
|
||||
d_code = dt.Rows[0]["VPPS码"].ToString();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace bizFacade
|
||||
{
|
||||
public class RepairWorkStation
|
||||
{
|
||||
/// <summary>
|
||||
/// 保存复合工位工作状态
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="Status"></param>
|
||||
public static void StationStatusChanges(string OpName,int Status)
|
||||
{
|
||||
if (NormalOrRepairRecord_Hash.ContainsKey (OpName))
|
||||
{
|
||||
NormalOrRepairRecord_Hash[OpName] = Status;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
NormalOrRepairRecord_Hash.Add(OpName,Status );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询工位工作状态 1为正常,其他为返修
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <returns></returns>
|
||||
public static int StationStatusSearch(string OpName)
|
||||
{
|
||||
if (NormalOrRepairRecord_Hash.ContainsKey(OpName))
|
||||
{
|
||||
return Convert.ToInt32(NormalOrRepairRecord_Hash[OpName]);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static Hashtable NormalOrRepairRecord_Hash = new Hashtable();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using DataLinkMesWork;
|
||||
using System.Collections;
|
||||
using System.Collections.Specialized;
|
||||
using SystemFramework;
|
||||
|
||||
namespace bizFacade
|
||||
{
|
||||
/// <summary>
|
||||
/// 电子看板信息系统
|
||||
/// </summary>
|
||||
public partial class BaseDataSystemMES
|
||||
{
|
||||
/// <summary>
|
||||
/// 基本数据_工作日历_班次产量查询_New
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="opNameCount">在线产量</param>
|
||||
/// <param name="opNameCountTime">在线节拍</param>
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 基本数据_工作日历_班次产量查询_New
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="opNameCount">在线产量</param>
|
||||
/// <param name="opNameCountTime">在线节拍</param>
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// MES界面显示_消息滚动_增加
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="content"></param>
|
||||
/// <returns></returns>
|
||||
public static bool Rolling_news_Add(string opName, string content)
|
||||
{
|
||||
|
||||
string procedureName = "MES界面显示_消息滚动_增加";
|
||||
bool isOK;
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@ScollNotice", content);
|
||||
isOK = DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
if (isOK)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
Common/07WebBusinessFacade/BusinessFacade/05Biz/MES/vssver2.scc
Normal file
BIN
Common/07WebBusinessFacade/BusinessFacade/05Biz/MES/vssver2.scc
Normal file
Binary file not shown.
@@ -0,0 +1,149 @@
|
||||
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 dishNumber = null)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "测量数据发动机在线状态_增加数据";
|
||||
SqlParameter[] thisParms = new SqlParameter[3];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@是否合格", isOK.ToString());
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@托盘号", dishNumber);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
|
||||
static public void Update_DataBaind(string EngineID, string nowOpName, string moveOpName)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "北汽福田_总分线对应表_数据转移";
|
||||
SqlParameter[] thisParms = new SqlParameter[3];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("总成号", EngineID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("当前工位号", nowOpName);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("转移工位号", moveOpName);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static public void SLResult_Add(string SLResult, string EngineID, string EngineType, int EngineTypeID, int TurnLineWork)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "试漏结果_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[5];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@测量结果", SLResult);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@总成码", EngineID);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@机型号", EngineType);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@机型代码", EngineTypeID);
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@转线工件", TurnLineWork);
|
||||
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.
@@ -0,0 +1,129 @@
|
||||
using DataLinkMesWork;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace bizFacade
|
||||
{
|
||||
/// <summary>
|
||||
/// 通用BizFaced类
|
||||
/// </summary>
|
||||
public partial class BaseDataSystemMES
|
||||
{
|
||||
/// <summary>
|
||||
/// 验证质量数据状态哈希表
|
||||
/// </summary>
|
||||
public static Hashtable QualityVerifyStatus_Hash = new Hashtable();
|
||||
|
||||
/// <summary>
|
||||
/// 读取工位质量数据验证状态
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <returns></returns>
|
||||
public static bool QualityVerifyStatus_Hash_Read(string OpName)
|
||||
{
|
||||
if (QualityVerifyStatus_Hash.Contains(OpName))
|
||||
{
|
||||
return Convert.ToBoolean(QualityVerifyStatus_Hash[OpName]);
|
||||
|
||||
}
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 写入工位质量数据验证状态
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="Result"></param>
|
||||
public static void QualityVerifyStatus_Hash_Write(string OpName, bool Result)
|
||||
{
|
||||
if (QualityVerifyStatus_Hash.Contains(OpName))
|
||||
{
|
||||
QualityVerifyStatus_Hash[OpName] = Result;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
QualityVerifyStatus_Hash.Add(OpName, Result);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 部装工位质量数据验证
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static bool QulityDataVerify(string OpName, string EngineID_Subline, out string AlarmStr)
|
||||
{
|
||||
int IsAlarm = 0;
|
||||
AlarmStr = "";
|
||||
string procedureName;
|
||||
procedureName = "测量数据工位_监控系统_部装质量数据验证";
|
||||
SqlParameter[] thisParms = new SqlParameter[4];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", OpName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@部装总成号", EngineID_Subline);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@是否报警", IsAlarm);
|
||||
thisParms[2].Direction = ParameterDirection.Output;
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@报警工位号", AlarmStr);
|
||||
thisParms[3].Direction = ParameterDirection.Output;
|
||||
|
||||
if (DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms))
|
||||
{
|
||||
IsAlarm = Convert.ToInt32(thisParms[2].Value.ToString());
|
||||
AlarmStr = thisParms[3].Value.ToString();
|
||||
|
||||
if (IsAlarm == 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 线外工位质量数据验证
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static bool QualityVerifyStatusOutline(string OpName, out string AlarmStr)
|
||||
{
|
||||
int IsAlarm = 0;
|
||||
AlarmStr = "";
|
||||
string procedureName;
|
||||
procedureName = "测量数据工位_监控系统_线外质量数据验证";
|
||||
SqlParameter[] thisParms = new SqlParameter[3];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", OpName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@是否报警", IsAlarm);
|
||||
thisParms[1].Direction = ParameterDirection.Output;
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@报警工位号", AlarmStr);
|
||||
thisParms[2].Direction = ParameterDirection.Output;
|
||||
|
||||
if (DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms))
|
||||
{
|
||||
IsAlarm = Convert.ToInt32(thisParms[1].Value.ToString());
|
||||
AlarmStr = thisParms[2].Value.ToString();
|
||||
|
||||
if (IsAlarm == 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,415 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using DataLinkMesWork;
|
||||
using System.Collections;
|
||||
|
||||
using SystemFramework;
|
||||
using DoWhatPlc;
|
||||
//using BasicData;
|
||||
//using OpcData;
|
||||
|
||||
namespace bizFacade
|
||||
{
|
||||
|
||||
public partial class BaseDataSystemMES
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 对应玉柴项目
|
||||
/// 20111101
|
||||
/// 质量数据的上限值,下限值,理论值来源于表[MES_基本数据_测量范围]
|
||||
/// 通过TagID和engineTypeID。如果engineTypeID=0,上限值,下限值,理论值=""
|
||||
/// 质量数据可以读数据 19
|
||||
/// 分散控制
|
||||
/// tagID_CF质量数据激发变量对应的质量数据列表
|
||||
/// </summary>
|
||||
/// <param name="valuList">tagID_CF质量数据激发变量对应的质量数据列表(Hashtable)</param>
|
||||
/// <param name="opName">质量数据列表</param>
|
||||
/// <param name="BasicDataTagValue">质量数据列表</param>
|
||||
/// <param name="BasicDataTagValueUpDown"></param>
|
||||
/// <param name="dt">质量数据列表</param>
|
||||
/// <param name="qualityMask">质量数据总成合格标志 21( =0 数据合格) (= 1数据不合格)</param>
|
||||
/// <param name="engineTypeID">质量数据发动机机型标志 9</param>
|
||||
/// <param name="engineID">质量数据发动机号 10</param>
|
||||
/// <param name="engineType">质量数据发动机机型 11</param>
|
||||
/// <param name="partPallet"></param>
|
||||
/// <param name="engineTraceCode"></param>
|
||||
/// <param name="engineCap">缸盖号[TagValue2]</param>
|
||||
/// <param name="hashtable_EngineTypeID">发动机类型转换表</param>
|
||||
/// <param name="mes_MustTest">发动机类型转换表</param>
|
||||
/// <param name="onLineState">发动机类型转换表</param>
|
||||
/// <param name="partMoveDirection">发动机类型转换表</param>
|
||||
/// <param name="pressIsOK">发动机类型转换表</param>
|
||||
/// <param name="pressIsNoOK">发动机类型转换表</param>
|
||||
static public void GetQualityDataTable_B5A(Hashtable valuList, string opName, DataTable BasicDataTagValue,
|
||||
DataTable BasicDataTagValueUpDown,
|
||||
out DataTable dt,
|
||||
out int qualityMask,
|
||||
out int engineTypeID,
|
||||
out string engineID,
|
||||
out string engineType,out string partPallet, out string engineTraceCode, out string engineCap, Hashtable hashtable_EngineTypeID,
|
||||
out int mes_MustTest,out int onLineState,out int partMoveDirection,
|
||||
out int pressIsOK, out int pressIsNoOK)
|
||||
{
|
||||
//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)
|
||||
mes_MustTest = 0;
|
||||
onLineState = 0;
|
||||
partMoveDirection = 0;
|
||||
pressIsOK = 0;
|
||||
pressIsNoOK = 0;
|
||||
QualityDataType qualityData;
|
||||
//是否有数据
|
||||
//bool isUsing;
|
||||
|
||||
DataRow dr;
|
||||
DataRow[] dr_WWW;
|
||||
//MES_基本数据_测量范围
|
||||
DataRow[] dr_WWW_UpDown;
|
||||
|
||||
dt = BuildDataTables_WWW();
|
||||
qualityMask = 0;
|
||||
engineTypeID = 0;
|
||||
engineID = "";
|
||||
engineType = "";
|
||||
engineTraceCode = "";
|
||||
engineCap = "";
|
||||
partPallet = "";
|
||||
//测量位置
|
||||
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 = (QualityDataType)valueItem.Value;
|
||||
|
||||
switch (qualityData.tagValueType)
|
||||
{
|
||||
case 21:
|
||||
qualityMask = Convert.ToInt32(qualityData.tagValue);
|
||||
//转变一下
|
||||
//qualityMask = transferIsOK_OpName_2(Convert.ToInt32(qualityData.tagValue));
|
||||
break;
|
||||
case 8:
|
||||
//8 只要返修,必须由mes发送此信号,plc接收此信号后才能放行
|
||||
//(暂时没用)用于有扳手拧紧工位。通知设备螺钉拧紧完成。PC已经将数据保存到数据库中。(B5A)
|
||||
pressIsNoOK = Convert.ToInt32(qualityData.tagValue);
|
||||
break;
|
||||
//质量数据发动机机型标志 22(玉柴) 发动机机型标志 9 (有MOBY)需要换算成2的n次幂的形式,以便生成报表
|
||||
case 9:
|
||||
engineTypeID = Convert.ToInt32(qualityData.tagValue);
|
||||
if (engineTypeID == 0)
|
||||
{
|
||||
engineTypeID = 1;
|
||||
}
|
||||
if (hashtable_EngineTypeID.ContainsKey(engineTypeID))
|
||||
{
|
||||
string engineTypeIDString = hashtable_EngineTypeID[engineTypeID].ToString();
|
||||
engineTypeID = Convert.ToInt32(engineTypeIDString);
|
||||
if (engineTypeID == 0)
|
||||
{
|
||||
engineTypeID = 1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
//发动机编号 23 10
|
||||
//case 23:
|
||||
case 10:
|
||||
engineID = Convert.ToString(qualityData.tagValue);
|
||||
break;
|
||||
//质量数据发动机机型 24(玉柴) 11(有MOBY)
|
||||
//case 24:
|
||||
case 11:
|
||||
engineType = Convert.ToString(qualityData.tagValue);
|
||||
break;
|
||||
case 41:
|
||||
//41 机体流向标志(1 BYTE):0普通工位:1:上线(发动机上线);
|
||||
//2:下线(发动机下线);(必须PLC)
|
||||
partMoveDirection = Convert.ToInt32(qualityData.tagValue);
|
||||
break;
|
||||
case 51:
|
||||
//51 返修工位,修改后的数据MES将数据写入PLC ,MES通知PLC数据修改完成。(YN)
|
||||
pressIsOK = Convert.ToInt32(qualityData.tagValue);
|
||||
break;
|
||||
//78 0:屏蔽MES;1:启用MES(必须MIS)
|
||||
case 78:
|
||||
mes_MustTest = Convert.ToInt32(qualityData.tagValue);
|
||||
break;
|
||||
//79 通过线体工位PC实现下达工位工作状态:工位有三种状态:在线、离线、屏蔽。在线:
|
||||
//0正常状态,实现正常功能。1离线:2屏蔽。(必须MIS)
|
||||
case 79:
|
||||
onLineState = Convert.ToInt32(qualityData.tagValue);
|
||||
break;
|
||||
//托盘编号(B5A)
|
||||
case 80:
|
||||
partPallet = Convert.ToString(qualityData.tagValue);
|
||||
break;
|
||||
}
|
||||
//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 = "";
|
||||
if (dr_WWW_UpDown != null&& dr_WWW_UpDown.Length >0)
|
||||
{
|
||||
tagValueUp = dr_WWW_UpDown[0]["值上限"].ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
tagValueUp = "";
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
tagValueUp = "";
|
||||
}
|
||||
try
|
||||
{
|
||||
tagValueDown = "";
|
||||
if (dr_WWW_UpDown != null && dr_WWW_UpDown.Length > 0)
|
||||
{
|
||||
tagValueDown = dr_WWW_UpDown[0]["值下限"].ToString();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
tagValueDown = "";
|
||||
}
|
||||
try
|
||||
{
|
||||
tagValeNormal = "";
|
||||
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"] = BaseDataSystemMES.GetQualityData_GoodBad_String((bool[])qualityData.tagValue);
|
||||
break;
|
||||
case 8209:
|
||||
dr["TagValue"] = "";
|
||||
break;
|
||||
//非标准REAL
|
||||
case 8210:
|
||||
dr["TagValue"] = GetNoNormalReal(qualityData.tagValue);
|
||||
dt.Rows.Add(dr);
|
||||
break;
|
||||
default:
|
||||
dr["TagValue"] = Convert.ToString(qualityData.tagValue);
|
||||
dt.Rows.Add(dr);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
////ApplicationLog.WriteLog(err, err.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 数据表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
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;
|
||||
}
|
||||
/// <summary>
|
||||
/// 返回非标准real
|
||||
/// </summary>
|
||||
/// <param name="vDataValue"></param>
|
||||
/// <returns></returns>
|
||||
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";
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 29 工位具体零件合格标志
|
||||
/// </summary>
|
||||
/// <param name="QualityData_GoodBad"></param>
|
||||
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;
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 返回非标准real
|
||||
/// </summary>
|
||||
/// <param name="vDataValue"></param>
|
||||
/// <returns></returns>
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user