472 lines
22 KiB
C#
472 lines
22 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
using System.Data;
|
|
using System.Data.SqlClient;
|
|
|
|
using System.Data.OleDb;
|
|
|
|
|
|
using DataLinkMesWork;
|
|
|
|
|
|
using SystemFramework;
|
|
|
|
namespace bizFacade
|
|
{
|
|
public partial class BaseDataSystemMES
|
|
{
|
|
|
|
/// <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="repairCode"></param>
|
|
/// <param name="Is_repairBarcode"></param>
|
|
/// <param name="repairBarcode"></param>
|
|
/// <returns></returns>
|
|
public static bool OpName_MIS_MOBY_Insert(string opName, string orderForm,
|
|
int engineTypeID, string engineType, string engineID,int palletCode, int repairCode, int Is_repairBarcode, string repairBarcode)
|
|
{
|
|
string produceName = "测量数据工位_监控系统_MOBY_增加";
|
|
SqlParameter[] thisParms = new SqlParameter[9];
|
|
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
|
thisParms[1] = new System.Data.SqlClient.SqlParameter("@订单号", orderForm);
|
|
thisParms[2] = new System.Data.SqlClient.SqlParameter("@产品型号代码", engineTypeID);
|
|
thisParms[3] = new System.Data.SqlClient.SqlParameter("@发动机型号", engineType);
|
|
thisParms[4] = new System.Data.SqlClient.SqlParameter("@发动机号", engineID);
|
|
thisParms[5] = new System.Data.SqlClient.SqlParameter("@托盘号", palletCode);
|
|
thisParms[6] = new System.Data.SqlClient.SqlParameter("@返修标志", repairCode);
|
|
thisParms[7] = new System.Data.SqlClient.SqlParameter("@拆解标志", Is_repairBarcode);
|
|
thisParms[8] = new System.Data.SqlClient.SqlParameter("@拆解返修条码", repairBarcode);
|
|
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_Moby_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 = "测量数据工位_监控系统_MOBY_查询";
|
|
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>
|
|
/// 测量数据工位_监控系统_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>
|
|
/// <returns></returns>
|
|
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);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 测量数据发动机在线状态_跟踪发动机条码状态_增加
|
|
/// </summary>
|
|
/// <param name="opName"></param>
|
|
/// <returns></returns>
|
|
public static bool MaterialPush_EngineIDStatus_Insert(string opName)
|
|
{
|
|
string produceName = "测量数据发动机在线状态_跟踪发动机条码状态_增加";
|
|
SqlParameter[] thisParms = new SqlParameter[1];
|
|
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
|
return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 电子看板_装配零件_临时表_判断_是否允许工作
|
|
/// </summary>
|
|
/// <param name="opName"></param>
|
|
/// <param name="IsAllowWork"></param>
|
|
/// <returns></returns>
|
|
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;
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 电子看板_装配零件_临时表_修改_零件条码
|
|
/// </summary>
|
|
/// <param name="opName"></param>
|
|
/// <param name="barCode"></param>
|
|
/// <param name="IsSuccess"></param>
|
|
/// <returns></returns>
|
|
public static bool PartMaterial_DM_Update(string opName, string barCode, out int IsSuccess)
|
|
{
|
|
IsSuccess = 0;
|
|
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.ToInt32(thisParms[2].Value);
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
/// <summary>
|
|
/// AMES_MES_装配数据_零部件追溯_增加
|
|
/// </summary>
|
|
/// <param name="opName"></param>
|
|
/// <param name="m_ConfirmOkGo"></param>
|
|
/// <returns></returns>
|
|
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);
|
|
}
|
|
|
|
|
|
/// <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>
|
|
/// <returns></returns>
|
|
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);
|
|
}
|
|
|
|
|
|
|
|
/// <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;
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// 电子看板_工位机型_质量数据测量位置_临时表_修改
|
|
/// </summary>
|
|
/// <param name="opName"></param>
|
|
/// <param name="workGroupIndex"></param>
|
|
/// <param name="IsOK"></param>
|
|
/// <param name="IsFinish"></param>
|
|
/// <returns></returns>
|
|
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;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 设备管理_保养_待保养_视图_查询
|
|
/// </summary>
|
|
/// <param name="dt"></param>
|
|
/// <returns></returns>
|
|
public static bool MachinePlan_Select(out DataTable dt)
|
|
{
|
|
string produceName = "设备管理_保养_待保养_视图_查询";
|
|
return DataAccess.ExecuteStoredProcedure(produceName,out dt);
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// MES界面显示_弹窗消息_增加
|
|
/// </summary>
|
|
/// <param name="opName"></param>
|
|
/// <param name="notice"></param>
|
|
/// <returns></returns>
|
|
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);
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// MES_基本变量_合格标志定义(分合格标志)
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public static DataTable BaseData_tagTable_IsGoodorbad_Meaning_Item()
|
|
{
|
|
DataTable dt = null;
|
|
string sql;
|
|
sql = "SELECT 定义合格标志,实际合格标志 from MES_基本变量_合格标志定义 where 类型=1 ";
|
|
DataAccess.ExecuteDataTable(sql, out dt);
|
|
return dt;
|
|
}
|
|
|
|
/// <summary>
|
|
/// MES_基本变量_合格标志定义(工位总合格标志)
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public static DataTable BaseData_tagTable_IsGoodorbad_Meaning_OpName()
|
|
{
|
|
DataTable dt = null;
|
|
string sql;
|
|
sql = "SELECT 定义合格标志,实际合格标志 from MES_基本变量_合格标志定义 where 类型=2 ";
|
|
DataAccess.ExecuteDataTable(sql, out dt);
|
|
return dt;
|
|
}
|
|
|
|
/// <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>
|
|
/// 测量数据工位_监控系统_自动手动_查询
|
|
/// </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;
|
|
}
|
|
|
|
|
|
}
|
|
}
|