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 { /// /// 测量数据工位_监控系统_MOBY_增加 /// /// /// /// /// /// /// /// /// /// /// 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); } /// /// 测量数据工位_监控系统_手动打印_查询 /// /// /// /// 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); } /// /// 测量数据工位_监控系统_MOBY_查询 /// /// /// /// /// /// /// /// /// /// 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; } /// /// 测量数据工位_监控系统_MOBY_查询 /// /// /// /// /// /// /// /// /// /// 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; } /// /// 电子看板_装配零件_临时表_增加 /// /// /// 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); } /// /// 测量数据发动机在线状态_跟踪发动机条码状态_增加 /// /// /// 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); } /// /// 电子看板_装配零件_临时表_判断_是否允许工作 /// /// /// /// public static bool MesServer_Judge_IsCanWork(string opName,out int IsAllowWork) { IsAllowWork = 0; string produceName = "电子看板_装配零件_临时表_判断_是否允许工作"; SqlParameter[] thisParms = new SqlParameter[2]; thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName); thisParms[1] = new System.Data.SqlClient.SqlParameter("@是否允许工作", IsAllowWork); thisParms[1].Direction = ParameterDirection.Output; if (DataAccess.ExecuteStoredProcedure(produceName, ref thisParms)) { IsAllowWork = Convert.ToInt32(thisParms[1].Value); return true; } return false; } /// /// 电子看板_装配零件_临时表_修改_零件条码 /// /// /// /// /// public static bool 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; } /// /// AMES_MES_装配数据_零部件追溯_增加 /// /// /// /// public static bool Material_Insert(string opName, int m_ConfirmOkGo) { string produceName = "MES_装配数据_零部件追溯_增加"; SqlParameter[] thisParms = new SqlParameter[2]; thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName); thisParms[1] = new System.Data.SqlClient.SqlParameter("@放行方式", m_ConfirmOkGo); return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms); } /// /// MES_装配数据_零部件追溯_增加_不合格 /// /// /// /// public static bool Material_Insert_NG(string opName, int m_ConfirmOkGo) { string produceName = "MES_装配数据_零部件追溯_增加_不合格"; SqlParameter[] thisParms = new SqlParameter[2]; thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName); thisParms[1] = new System.Data.SqlClient.SqlParameter("@放行方式", m_ConfirmOkGo); return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms); } /// /// 电子看板_工位机型_质量数据测量位置_临时表_增加 /// /// /// public static bool MesServer_ShaftPosition_EngineTypeOver(string opName) { string produceName = "电子看板_工位机型_质量数据测量位置_临时表_增加"; SqlParameter[] thisParms = new SqlParameter[1]; thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName); return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms); } /// /// 电子看板_工位机型_质量数据测量位置_临时表_查询_完成情况 /// /// 工位号 /// 拧紧序号 /// 套筒号 /// 工步属性 /// 是否全部完成 /// public static bool MesServer_ShaftPosition_Select_FinishResult(string opName, out int 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; } /// /// 电子看板_工位机型_质量数据测量位置_临时表_修改 /// /// /// /// /// /// public static bool MesServer_ShaftPosition_Update(string opName,int workGroupIndex,int IsOK,out bool IsFinish) { IsFinish = true; string produceName = "电子看板_工位机型_质量数据测量位置_临时表_修改"; SqlParameter[] thisParms = new SqlParameter[4]; thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName); thisParms[1] = new System.Data.SqlClient.SqlParameter("@组号", workGroupIndex); thisParms[2] = new System.Data.SqlClient.SqlParameter("@合格标志", IsOK); thisParms[3] = new System.Data.SqlClient.SqlParameter("@是否全部完成",SqlDbType.Int,4); thisParms[3].Direction = ParameterDirection.Output; if (DataAccess.ExecuteStoredProcedure(produceName, ref thisParms)) { IsFinish = Convert.ToBoolean(thisParms[3].Value); return true; } return false; } /// /// 设备管理_保养_待保养_视图_查询 /// /// /// public static bool MachinePlan_Select(out DataTable dt) { string produceName = "设备管理_保养_待保养_视图_查询"; return DataAccess.ExecuteStoredProcedure(produceName,out dt); } /// /// MES界面显示_弹窗消息_增加 /// /// /// /// public static bool Web_Notice_Insert(string opName,string notice) { string produceName = "MES界面显示_弹窗消息_增加"; SqlParameter[] thisParms = new SqlParameter[2]; thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName); thisParms[1] = new System.Data.SqlClient.SqlParameter("@Notice", notice); return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms); } /// /// MES_基本变量_合格标志定义(分合格标志) /// /// 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; } /// /// MES_基本变量_合格标志定义(工位总合格标志) /// /// 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; } /// /// 电子看板_发动机号_线首工位_流水号_修改 /// /// /// /// 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; } } /// /// 测量数据工位_监控系统_自动手动_增加 /// /// /// /// 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); } /// /// 测量数据工位_监控系统_自动手动_查询 /// /// /// 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; } } }