chore: 初始化合力驱动桥MES采集程序
This commit is contained in:
25
Common/07WebBusinessFacade/BusinessFacade.sln
Normal file
25
Common/07WebBusinessFacade/BusinessFacade.sln
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.32901.82
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "07BusinessFacade", "BusinessFacade\07BusinessFacade.csproj", "{F0A0C525-03FD-428A-9B17-7F54AA0E4475}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{F0A0C525-03FD-428A-9B17-7F54AA0E4475}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{F0A0C525-03FD-428A-9B17-7F54AA0E4475}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{F0A0C525-03FD-428A-9B17-7F54AA0E4475}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{F0A0C525-03FD-428A-9B17-7F54AA0E4475}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {855F5203-2363-4447-B96A-9A6FE08E1E46}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -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,162 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using DataLinkMesWork;
|
||||
|
||||
using SystemFramework;
|
||||
namespace bizFacade
|
||||
{
|
||||
partial class BaseDataSystemMES
|
||||
{
|
||||
/// <summary>
|
||||
/// 机床报警变量
|
||||
/// 103
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static DataTable BaseData_tagTable_Alarm()
|
||||
{
|
||||
//string errorMessage;
|
||||
DataTable dt;
|
||||
string sql;
|
||||
sql = "SELECT TagID,0 as TagValue,TagName,工位号,数据来源,TagTypeID,TagLong,列位置,测量位置,变量类型代码,测量项目,TagAdr,TagAdrDemo FROM [MES_基本变量_原始数据] where 变量类型代码 = 103 and 是否启用 = 1"
|
||||
+ " and (监控属性代码 = '" + 1 + "')";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
return dt;
|
||||
}
|
||||
/// <summary>
|
||||
/// 测量数据发动机在线状态_增加数据_自动工位
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="EngineID"></param>
|
||||
/// <param name="Pallet"></param>
|
||||
/// <param name="arrivedTime"></param>
|
||||
/// <param name="leavedTime"></param>
|
||||
/// <param name="TimeDiff"></param>
|
||||
/// <param name="Target"></param>
|
||||
/// <param name="lineType"></param>
|
||||
/// <param name="isPass"></param>
|
||||
/// <param name="OpNameUpDownType"></param>
|
||||
static public void WorkStartInsert_AutoWorkStation(string opName, string EngineID, int Pallet, DateTime arrivedTime, DateTime leavedTime, int TimeDiff, int Target, string lineType, string isPass, int OpNameUpDownType)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "测量数据发动机在线状态_增加数据_自动工位";
|
||||
SqlParameter[] thisParms = new SqlParameter[10];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@发动机号", EngineID);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@托盘编号", Pallet);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@到达时间", arrivedTime);
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@离开时间", leavedTime);
|
||||
thisParms[5] = new System.Data.SqlClient.SqlParameter("@在线时间", TimeDiff);
|
||||
thisParms[6] = new System.Data.SqlClient.SqlParameter("@目标时间", Target);
|
||||
thisParms[7] = new System.Data.SqlClient.SqlParameter("@线体类型", lineType);
|
||||
thisParms[8] = new System.Data.SqlClient.SqlParameter("@是否合格", isPass);
|
||||
thisParms[9] = new System.Data.SqlClient.SqlParameter("@工位上下线类型", OpNameUpDownType);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
static public void WorkStartInsert(string opName, int isOK)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "测量数据发动机在线状态_增加数据";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@是否合格", isOK.ToString());
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
|
||||
static public void OPA90CheckErrorData(string EngineID)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "合力_轮毂桥壳缓存数据_异常记录标记";
|
||||
SqlParameter[] thisParms = new SqlParameter[1];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@轮毂总成号", EngineID);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
|
||||
static public void OPA90CheckQiaoKeErrorData(string EngineID)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "合力_轮毂桥壳缓存数据_异常记录标记_桥壳";
|
||||
SqlParameter[] thisParms = new SqlParameter[1];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@桥壳总成号", EngineID);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
|
||||
static public void Set_EngineWorkOpName(string EngineID, string targetOpName)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "合力_转线设置工件状态";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@总成号", EngineID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@目标工位号", targetOpName);
|
||||
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>
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,151 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{F0A0C525-03FD-428A-9B17-7F54AA0E4475}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>BusinessFacade</RootNamespace>
|
||||
<AssemblyName>07BusinessFacade</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<Deterministic>true</Deterministic>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\..\dll\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="MQTTnet">
|
||||
<HintPath>..\..\dll\MQTTnet.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MQTTnet.Extensions.ManagedClient">
|
||||
<HintPath>..\..\dll\MQTTnet.Extensions.ManagedClient.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="05Biz\MES\EngineIDCode.cs" />
|
||||
<Compile Include="05Biz\MES\Materials.cs" />
|
||||
<Compile Include="05Biz\MES\OpName.MainForm.Launch.cs" />
|
||||
<Compile Include="05Biz\MES\RepairWorkStation.cs" />
|
||||
<Compile Include="05Biz\MES\ShowLED.cs" />
|
||||
<Compile Include="05Biz\OPC\BaseDataSystemMES.OPC.Alarm.cs" />
|
||||
<Compile Include="05Biz\OPC\BaseDataSystemMES.OPC.cs" />
|
||||
<Compile Include="05Biz\OPC\BaseDataSystemMES.OPC.QualityData.cs" />
|
||||
<Compile Include="05Biz\OPC\BaseDataSystemMES.OPC.QualityData.GoodBad.cs" />
|
||||
<Compile Include="05Biz\QualityData\DataVerify.cs" />
|
||||
<Compile Include="05Biz\QualityData\GetQualityData_GoodBad.cs" />
|
||||
<Compile Include="Db2023\Order.cs" />
|
||||
<Compile Include="MES.B5A.Factory\Factory.cs" />
|
||||
<Compile Include="MES.B5A.MainForm\EngineIDCode.cs" />
|
||||
<Compile Include="MES.B5A.MainForm\OpName.MainForm.cs" />
|
||||
<Compile Include="MES.B5A.MainForm\OpName.MainForm.Launch.cs" />
|
||||
<Compile Include="MES.B5A.MainForm\OpName.MainForm.Material.cs" />
|
||||
<Compile Include="MES.B5A.MainForm\UserManage.cs" />
|
||||
<Compile Include="MES.B5A.MainForm\UserNamePassword.cs" />
|
||||
<Compile Include="MES.B5A.Manager\EngineType.cs" />
|
||||
<Compile Include="MES.B5A.Manager\IsMES.cs" />
|
||||
<Compile Include="MES.B5A.Manager\OpName.Material.cs" />
|
||||
<Compile Include="MES.B5A.Manager\OpName.Proccess.cs" />
|
||||
<Compile Include="MES.B5A.Manager\OpName.Shaft.cs" />
|
||||
<Compile Include="MES.B5A.QualityData\QualityData.B5A.cs" />
|
||||
<Compile Include="MES.B5A.QualityData\QualityData.B5A.Pack.cs" />
|
||||
<Compile Include="MES.B5A.QualityData\QualityData.B5A.Save.cs" />
|
||||
<Compile Include="MES.B5A.ShaftPosition\OpNameCount.cs" />
|
||||
<Compile Include="MES.B5A.ShaftPosition\OpNameRepair.cs" />
|
||||
<Compile Include="MES.B5A.ShaftPosition\ShaftPosition.cs" />
|
||||
<Compile Include="MES.B5A.ShaftPosition\ShaftPositionData.cs" />
|
||||
<Compile Include="MES.Biz.TraceTable\MES.Biz.TraceTable.Cap.cs" />
|
||||
<Compile Include="MES.Biz.TraceTable\MES.Biz.TraceTable.cs" />
|
||||
<Compile Include="MES.Biz.TraceTable\MES.Biz.TraceTable.Cylinder.cs" />
|
||||
<Compile Include="MES.Biz.TraceTable\MES.Biz.TraceTable.ToOpName.cs" />
|
||||
<Compile Include="MES.Data.GetData\GetOpNameOrderForm.cs" />
|
||||
<Compile Include="MES.Data.GetData\MES.Biz.TraceTable.GetData.cs" />
|
||||
<Compile Include="MES.Data.GetData\OpNameGuid.cs" />
|
||||
<Compile Include="MES.Data.SaveData\MES.Biz.Material.SaveData.cs" />
|
||||
<Compile Include="MES.Data.SaveData\MES.Biz.TraceTable.SaveData.cs" />
|
||||
<Compile Include="MES.HL\MesFunctions.cs" />
|
||||
<Compile Include="MES.Material\Materials.cs" />
|
||||
<Compile Include="MES\BaseDataSystemMES.AssemblyPartTrace.cs" />
|
||||
<Compile Include="MES\BaseDataSystemMES.AssemblyPartTrace.Repair.cs" />
|
||||
<Compile Include="MES\BaseDataSystemMES.CartTrace.cs" />
|
||||
<Compile Include="MES\BaseDataSystemMES.cs" />
|
||||
<Compile Include="MES\BaseDataSystemMES.FalseOverGo.cs" />
|
||||
<Compile Include="MES\BaseDataSystemMES.FirstOpName.cs" />
|
||||
<Compile Include="MES\BaseDataSystemMES.KeyPart.KeyPartAssemblyTempTable.cs" />
|
||||
<Compile Include="MES\BaseDataSystemMES.Load.cs" />
|
||||
<Compile Include="MES\BaseDataSystemMES.Login.cs" />
|
||||
<Compile Include="MES\BaseDataSystemMES.MaterialList.cs" />
|
||||
<Compile Include="MES\BaseDataSystemMES.MaterialVerifyManagement.cs" />
|
||||
<Compile Include="MES\BaseDataSystemMES.MesOverGo.cs" />
|
||||
<Compile Include="MES\BaseDataSystemMES.MesServer.cs" />
|
||||
<Compile Include="MES\BaseDataSystemMES.MOBY.cs" />
|
||||
<Compile Include="MES\BaseDataSystemMES.ProduceCount.cs" />
|
||||
<Compile Include="MES\BaseDataSystemMES.SubLineOpName.cs" />
|
||||
<Compile Include="MES\BaseDataSystemMES.WorkSheet.cs" />
|
||||
<Compile Include="MES\MaterialData.cs" />
|
||||
<Compile Include="MES\MES.Biz.Config.cs" />
|
||||
<Compile Include="MES\MES.Biz.MaterialList.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="SyPartLoad\EngineIDCode.cs" />
|
||||
<Compile Include="Web.New\MES1.cs" />
|
||||
<Compile Include="Web\ando_load.cs" />
|
||||
<Compile Include="Web\ando_load_2.cs" />
|
||||
<Compile Include="Web\ando_machine.cs" />
|
||||
<Compile Include="Web\ando_machine_2.cs" />
|
||||
<Compile Include="Web\ando_matertial.cs" />
|
||||
<Compile Include="Web\ando_matertial_2.cs" />
|
||||
<Compile Include="Web\ando_quality.cs" />
|
||||
<Compile Include="Web\ando_quality_2.cs" />
|
||||
<Compile Include="Web\Buttons.cs" />
|
||||
<Compile Include="Web\Login.cs" />
|
||||
<Compile Include="Web\MES.cs" />
|
||||
<Compile Include="Web\MES.Functions.cs" />
|
||||
<Compile Include="Web\MES.MaterialPull.cs" />
|
||||
<Compile Include="Web\MES_Loading.cs" />
|
||||
<Compile Include="Web\MES_MachineManage.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\00-1Json8.3\Json8.3\00-0Json8.3.1.csproj">
|
||||
<Project>{1a10fdb2-1a6a-44a8-ab4d-33387563247e}</Project>
|
||||
<Name>00-0Json8.3.1</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\00MesWorkMqtt\MesWorkMqtt\00MesWorkMqtt.csproj">
|
||||
<Project>{f55da1a0-a982-4479-8c47-0d9a5aaf3e18}</Project>
|
||||
<Name>00MesWorkMqtt</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\01DoWhatPlc\01_01DoWhatPlc.csproj">
|
||||
<Project>{0d1af432-439a-4920-8692-43ae139f5530}</Project>
|
||||
<Name>01_01DoWhatPlc</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\04DataBaseAccess\DataBaseAccess\04-DataBaseAccess.csproj">
|
||||
<Project>{f434e066-4c59-47c8-aa82-6f48cc84501a}</Project>
|
||||
<Name>04-DataBaseAccess</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
340
Common/07WebBusinessFacade/BusinessFacade/Db2023/Order.cs
Normal file
340
Common/07WebBusinessFacade/BusinessFacade/Db2023/Order.cs
Normal file
@@ -0,0 +1,340 @@
|
||||
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>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="sn"></param>
|
||||
/// <returns></returns>
|
||||
public static bool EngineTypeID_IsNotRepeatedNumber(string sn)
|
||||
{
|
||||
DataTable dt = new DataTable();
|
||||
int count;
|
||||
|
||||
|
||||
string produceName = "北汽福田变速器序列号总线上线_是否重号";
|
||||
SqlParameter[] thisParms = new SqlParameter[1];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@变速器序列号", sn);
|
||||
|
||||
if (DataAccess.ExecuteStoredProcedure(produceName, ref thisParms, out dt))
|
||||
{
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
count = Convert.ToInt32(dt.Rows[0]["数量"]);
|
||||
if (count == 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
}
|
||||
//北汽福田_配方内容_根据配方号查询
|
||||
public static bool PLCRcipeByOpName(string OpName, out byte[] bytes, out string tagStartAdr, int PLCRcipe)
|
||||
{
|
||||
DataTable dt = new DataTable();
|
||||
string produceName = "北汽福田_配方内容_根据配方号查询";
|
||||
tagStartAdr = "";
|
||||
bytes = new byte[0];
|
||||
SqlParameter[] thisParms = new SqlParameter[1];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@配方号", PLCRcipe);
|
||||
|
||||
|
||||
if (DataAccess.ExecuteStoredProcedure(produceName, ref thisParms, dt))
|
||||
{
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
tagStartAdr = dt.Rows[0]["地址"].ToString();
|
||||
bytes = new byte[dt.Rows.Count];
|
||||
for (int i = 0; i < dt.Rows.Count; i++)
|
||||
{
|
||||
bytes[i] = Convert.ToByte(dt.Rows[0]["操作号码"]);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
/// <summary>
|
||||
/// 北汽福田_配方当前_查询
|
||||
/// </summary>
|
||||
/// <param name="bytes"></param>
|
||||
/// <returns></returns>
|
||||
public static bool PLCRcipeCurrent(string opName, out byte[] bytes, out string tagStartAdr)
|
||||
{
|
||||
DataTable dt = new DataTable();
|
||||
string produceName = "北汽福田_配方当前_查询";
|
||||
tagStartAdr = "";
|
||||
bytes = null;
|
||||
SqlParameter[] thisParms = new SqlParameter[1];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
if (DataAccess.ExecuteStoredProcedure(produceName, out dt))
|
||||
{
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
tagStartAdr = dt.Rows[0]["地址"].ToString();
|
||||
bytes = new byte[dt.Rows.Count];
|
||||
for (int i = 0; i < dt.Rows.Count; i++)
|
||||
{
|
||||
bytes[i] = Convert.ToByte(dt.Rows[0]["操作号码"]);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
/// <summary>
|
||||
/// 北汽福田BOM_上线需要数据_查询
|
||||
/// </summary>
|
||||
/// <param name="sn">零件号</param>
|
||||
/// <param name="PTO">PTO检测</param>
|
||||
/// <param name="NgearSwitch">空挡开关检测</param>
|
||||
/// <param name="RgearSwitch">倒挡开关检测</param>
|
||||
/// <param name="SpeedSensor">里程表检测</param>
|
||||
/// <param name="PartTypeMid">大机型扩展</param>
|
||||
/// <returns></returns>
|
||||
public static bool UpLoadPTO(string sn, out int PTO, out int NgearSwitch, out int RgearSwitch, out int SpeedSensor, out string PartTypeMid, out int Tcu_V)
|
||||
{
|
||||
DataTable dt = new DataTable();
|
||||
int count;
|
||||
PTO = 0;
|
||||
NgearSwitch = 0;
|
||||
RgearSwitch = 0;
|
||||
SpeedSensor = 0;
|
||||
Tcu_V = 0;
|
||||
PartTypeMid = "";
|
||||
//select @倒挡开关 as RgearSwitch,@空挡开关 as NgearSwitch,@里程表 as SpeedSensor,@型号 as PartTypeMid,@PTO as PTO
|
||||
//
|
||||
string produceName = "北汽福田BOM_上线需要数据_查询";
|
||||
SqlParameter[] thisParms = new SqlParameter[1];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@零件号", sn);
|
||||
|
||||
if (DataAccess.ExecuteStoredProcedure(produceName, ref thisParms, out dt))
|
||||
{
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
PTO = Convert.ToInt32(dt.Rows[0]["PTO"]);
|
||||
NgearSwitch = Convert.ToInt32(dt.Rows[0]["NgearSwitch"]);
|
||||
RgearSwitch = Convert.ToInt32(dt.Rows[0]["RgearSwitch"]);
|
||||
SpeedSensor = Convert.ToInt32(dt.Rows[0]["SpeedSensor"]);
|
||||
PartTypeMid = dt.Rows[0]["PartTypeMid"].ToString();
|
||||
Tcu_V = Convert.ToInt32(dt.Rows[0]["TCU"]);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 北汽福田变速器序列号总线上线_获得机型信息
|
||||
/// </summary>
|
||||
/// <param name="partSn"></param>
|
||||
/// <param name="EngineTypeID"></param>
|
||||
/// <param name="EngineType"></param>
|
||||
/// <param name="EngineID"></param>
|
||||
/// <param name="OrderForm"></param>
|
||||
/// <param name="Recipe1"></param>
|
||||
/// <param name="Recipe2"></param>
|
||||
/// <returns></returns>
|
||||
public static bool GetEngineTypeUpLoadOpName(string sn, string OpName, out int EngineTypeID, out string EngineType, out string OrderForm, out int Recipe1, out int Recipe2)
|
||||
{
|
||||
DataTable dt = new DataTable();
|
||||
EngineTypeID = 0;
|
||||
EngineType = "";
|
||||
OrderForm = "";
|
||||
Recipe1 = 0;
|
||||
Recipe2 = 0;
|
||||
|
||||
string produceName = "北汽福田变速器序列号总线上线_获得机型信息";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@变速箱总成号", sn);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@工位号", OpName);
|
||||
|
||||
if (DataAccess.ExecuteStoredProcedure(produceName, ref thisParms, out dt))
|
||||
{
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
EngineTypeID = Convert.ToInt32(dt.Rows[0]["机型代码"]);
|
||||
EngineType = dt.Rows[0]["零件号"].ToString();
|
||||
OrderForm = dt.Rows[0]["订单号"].ToString();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
//MES_计划BOM_工位与名称_查询_MQTT监控工位
|
||||
|
||||
public static DataTable GetCheckOpName_BQ()
|
||||
{
|
||||
DataTable dt = new DataTable();
|
||||
string produceName = "MES_计划BOM_工位与名称_查询_MQTT监控工位";
|
||||
SqlParameter[] thisParms = null;
|
||||
|
||||
|
||||
DataAccess.ExecuteStoredProcedure(produceName, ref thisParms, out dt);
|
||||
|
||||
return dt;
|
||||
}
|
||||
public static DataTable GetCheckOpName()
|
||||
{
|
||||
DataTable dt = new DataTable();
|
||||
string produceName = "MES_计划BOM_工位与名称_查询";
|
||||
SqlParameter[] thisParms = null;
|
||||
|
||||
|
||||
DataAccess.ExecuteStoredProcedure(produceName, ref thisParms, out dt);
|
||||
|
||||
return dt;
|
||||
}
|
||||
/// <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 DataTable GetOrder_BQ()
|
||||
{
|
||||
DataTable dt = new DataTable();
|
||||
string produceName = "北汽福田生产订单计划_查询";
|
||||
SqlParameter[] thisParms = null;
|
||||
|
||||
|
||||
DataAccess.ExecuteStoredProcedure(produceName, ref thisParms, out dt);
|
||||
|
||||
return dt;
|
||||
}
|
||||
|
||||
public static DataTable GetOrderOpName_BQ()
|
||||
{
|
||||
DataTable dt = new DataTable();
|
||||
string produceName = "MES_计划BOM_工位与名称_上线工位号查询";
|
||||
SqlParameter[] thisParms = null;
|
||||
|
||||
|
||||
DataAccess.ExecuteStoredProcedure(produceName, ref thisParms, out dt);
|
||||
|
||||
return dt;
|
||||
}
|
||||
/// <summary>
|
||||
/// 北汽福田工位状态监控MOBY_增加_线首工位订单下达
|
||||
/// </summary>
|
||||
/// <param name="orderForm"></param>
|
||||
/// <param name="opName"></param>
|
||||
/// <returns></returns>
|
||||
public static void DownOrderToOpName(string orderForm, string opName)
|
||||
{
|
||||
string produceName = "北汽福田工位状态监控MOBY_增加_线首工位订单下达";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new SqlParameter("@订单号", orderForm);
|
||||
thisParms[1] = new SqlParameter("@工位号", opName);
|
||||
DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
|
||||
|
||||
}
|
||||
|
||||
public static DataTable DownOrderToOpNameMobyList(string OpName)
|
||||
{
|
||||
DataTable dt = new DataTable();
|
||||
SqlParameter[] thisParms = new SqlParameter[1];
|
||||
thisParms[0] = new SqlParameter("@工位号", OpName);
|
||||
string produceName = "北汽福田工位状态监控MOBY_查询_订单下达用";
|
||||
DataAccess.ExecuteStoredProcedure(produceName, ref thisParms, out dt);
|
||||
|
||||
return dt;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// PA30 40 获取数据 测量数据发动机在线状态_抽取记录_查询
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="OrderType">排序方式 0 ASC 1 DESC</param>
|
||||
/// <returns></returns>
|
||||
public static DataTable lineOutTowBackWork_GetData(string OpName, int OrderType)
|
||||
{
|
||||
DataTable dt = new DataTable();
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new SqlParameter("@工位号", OpName);
|
||||
thisParms[1] = new SqlParameter("@排序方式", OrderType);
|
||||
string produceName = "测量数据发动机在线状态_抽取记录_查询";
|
||||
DataAccess.ExecuteStoredProcedure(produceName, ref thisParms, out dt);
|
||||
|
||||
return dt;
|
||||
}
|
||||
/// <summary>
|
||||
/// PA40 获取数据 机型代码 测量数据发动机在线状态_抽取记录_查询
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="OrderType">排序方式 0 ASC 1 DESC</param>
|
||||
/// <returns></returns>
|
||||
public static DataTable lineOutTowBackWorkEngineTypeCode_GetData(string OpName, string materialCode)
|
||||
{
|
||||
DataTable dt = new DataTable();
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new SqlParameter("@工位号", OpName);
|
||||
thisParms[1] = new SqlParameter("@零件编号", materialCode);
|
||||
string produceName = "北汽福田工位状态监控_根据零件号获取型号_查询";
|
||||
DataAccess.ExecuteStoredProcedure(produceName, ref thisParms, out dt);
|
||||
|
||||
return dt;
|
||||
}
|
||||
/// <summary>
|
||||
/// 北汽福田工位状态监控MOBY历史数据_增加
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <returns></returns>
|
||||
public static void MobySaveData(string opName)
|
||||
{
|
||||
string produceName = "北汽福田工位状态监控MOBY历史数据_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[1];
|
||||
thisParms[0] = new SqlParameter("@工位号", opName);
|
||||
DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static string GetOrderDataBySn(string sn)
|
||||
{
|
||||
|
||||
DataTable dt = new DataTable();
|
||||
string orderForm = "";
|
||||
string produceName = "北汽福田变速器序列号_查询订单号";
|
||||
SqlParameter[] thisParms = new SqlParameter[1];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@变速器序列号", sn);
|
||||
if (DataAccess.ExecuteStoredProcedure(produceName, out dt))
|
||||
{
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
orderForm = dt.Rows[0]["订单号"].ToString();
|
||||
}
|
||||
}
|
||||
return orderForm;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Collections;
|
||||
using System.Collections.Specialized;
|
||||
//using SystemFramework;
|
||||
using DataLinkMesWork;
|
||||
|
||||
namespace bizFacade
|
||||
{
|
||||
/// <summary>
|
||||
/// 电子看板信息系统
|
||||
/// </summary>
|
||||
public partial class BaseDataSystemMES
|
||||
{
|
||||
/// <summary>
|
||||
/// 电子看板_零件图号_生产厂家_厂家_查询
|
||||
/// </summary>
|
||||
/// <param name="dt"></param>
|
||||
static public void Factory_Select(out DataTable dt)
|
||||
{
|
||||
string sql;
|
||||
sql = " exec 电子看板_零件图号_生产厂家_厂家_查询";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 电子看板_零件图号_生产厂家_厂家_快速_查询
|
||||
/// </summary>
|
||||
/// <param name="str"></param>
|
||||
/// <param name="dt"></param>
|
||||
static public void Factory_kuaisu_Select(string str ,out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "电子看板_零件图号_生产厂家_厂家_快速_查询";
|
||||
SqlParameter[] thisParms = new SqlParameter[1];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@零件图号", str);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 电子看板_零件图号_生产厂家_厂家_增加
|
||||
/// </summary>
|
||||
static public bool Factory_Insert(string Lingjian_tuhao, string Wuliaohao,
|
||||
string Gongyingshang_number, string Gongyingshang_name, string Gongyingshang_shortname)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "电子看板_零件图号_生产厂家_厂家_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[5];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@零件图号", Lingjian_tuhao);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@物料号", Wuliaohao);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@供应商代码", Gongyingshang_number);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@供应商名称", Gongyingshang_name);
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@供应商简称", Gongyingshang_shortname);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 电子看板_零件图号_生产厂家_厂家_修改
|
||||
/// </summary>
|
||||
static public bool Factory_Update(int Changjia_num, string Lingjian_tuhao, string Wuliaohao,
|
||||
string Gongyingshang_number, string Gongyingshang_name, string Gongyingshang_shortname)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "电子看板_零件图号_生产厂家_厂家_修改";
|
||||
SqlParameter[] thisParms = new SqlParameter[6];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@厂家代码", Changjia_num);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@零件图号", Lingjian_tuhao);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@物料号", Wuliaohao);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@供应商代码", Gongyingshang_number);
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@供应商名称", Gongyingshang_name);
|
||||
thisParms[5] = new System.Data.SqlClient.SqlParameter("@供应商简称", Gongyingshang_shortname);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 电子看板_零件图号_生产厂家_厂家_删除
|
||||
/// </summary>
|
||||
/// <param name="Changjia_num">序号</param>
|
||||
static public bool Factory_Delete(int Changjia_num)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "电子看板_零件图号_生产厂家_厂家_删除";
|
||||
SqlParameter[] thisParms = new SqlParameter[1];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@厂家代码", Changjia_num);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,405 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Collections;
|
||||
using System.Collections.Specialized;
|
||||
//using SystemFramework;
|
||||
using DataLinkMesWork;
|
||||
|
||||
namespace bizFacade
|
||||
{
|
||||
/// <summary>
|
||||
/// 电子看板信息系统
|
||||
/// select 重量1,重量2,重量差,允许重量差,合格标志
|
||||
/// </summary>
|
||||
public partial class BaseDataSystemMES
|
||||
{
|
||||
/// <summary>
|
||||
/// 测量数据合格_查询_称重
|
||||
/// </summary>
|
||||
/// <param name="engineID"></param>
|
||||
/// <param name="dt"></param>
|
||||
static public void ShowWeightData_Select(string engineID, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "测量数据合格_查询_称重";
|
||||
SqlParameter[] thisParms = new SqlParameter[1];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@发动机号", engineID);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt);
|
||||
}
|
||||
/// <summary>
|
||||
///测量数据合格_合并_视图_查询_照相
|
||||
/// select IsGoodBad as 合格标志, 列位置
|
||||
///from 测量数据合格_合并_视图
|
||||
///where EngineID=@工件编号 and 工位号=@工位号
|
||||
///order by 列位置
|
||||
/// </summary>
|
||||
/// <param name="engineID"></param>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="dt"></param>
|
||||
static public void ShowPicData_Select(string engineID, string opName, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "测量数据合格_合并_视图_查询_照相";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@发动机号", engineID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// insert into 电子看板_发动机号_分线组件装配关系
|
||||
///(工位号,发动机号,机型代码,发动机型号,工位号_分线,发动机号_分线,机型代码_分线,发动机型号_分线)
|
||||
///values(@工位号,@发动机号,@机型代码,@发动机型号,@工位号_分线,@发动机号_分线,@机型代码_分线,@发动机型号_分线)
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="engineID"></param>
|
||||
/// <param name="engineTypeID"></param>
|
||||
/// <param name="engineType"></param>
|
||||
/// <param name="opName_SubLine"></param>
|
||||
/// <param name="engineID_SubLine"></param>
|
||||
/// <param name="engineTypeID_SubLine"></param>
|
||||
/// <param name="engineType_SubLine"></param>
|
||||
static public void MailLineAndSubLineData_Insert(string opName, string engineID, int engineTypeID, string engineType, string opName_SubLine, string engineID_SubLine, int engineTypeID_SubLine, string engineType_SubLine)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "电子看板_发动机号_分线组件装配关系_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[8];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@发动机号", engineID);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@机型代码", engineTypeID);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@发动机型号", engineType);
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@工位号_分线", opName_SubLine);
|
||||
thisParms[5] = new System.Data.SqlClient.SqlParameter("@发动机号_分线", engineID_SubLine);
|
||||
thisParms[6] = new System.Data.SqlClient.SqlParameter("@机型代码_分线", engineTypeID_SubLine);
|
||||
thisParms[7] = new System.Data.SqlClient.SqlParameter("@发动机型号_分线", engineType_SubLine);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
/// <summary>
|
||||
/// 电子看板_发动机号_线首工位_查询_根据发动机号
|
||||
/// select 工位号,订单号,发动机号,基本机型,机型代码,发动机型号,托盘号,
|
||||
/// 条码类型,零件流水号,零件流水号带空格,壳体编号型号,壳体编号型号带空格,QR码
|
||||
/// from dbo.电子看板_发动机号_线首工位
|
||||
/// where 发动机号=@发动机号 and 是否禁用=0
|
||||
/// </summary>
|
||||
/// <param name="engineID"></param>
|
||||
/// <param name="dt"></param>
|
||||
static public void GetEngineID_Select(string engineID, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "电子看板_发动机号_线首工位_查询_根据发动机号";
|
||||
SqlParameter[] thisParms = new SqlParameter[1];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@发动机号", engineID);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt);
|
||||
}
|
||||
/// <summary>
|
||||
/// select 工位号,发动机号,机型代码,发动机型号,返修数据
|
||||
/// from 电子看板_发动机号_工件下线
|
||||
/// where 零件流水号=@零件流水号 --and 是否禁用=0
|
||||
/// </summary>
|
||||
/// <param name="partCode">零件流水号</param>
|
||||
/// <param name="dt"></param>
|
||||
static public void GetRepareData_Select(string partCode, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "电子看板_发动机号_工件下线_查询";
|
||||
SqlParameter[] thisParms = new SqlParameter[1];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@零件流水号", partCode);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///select '' as 工位号,发动机号,机型代码,发动机型号,'' as 返修数据
|
||||
///from 电子看板_发动机号_线首工位
|
||||
///where 零件流水号_返修=@零件流水号 and 是否禁用=0
|
||||
/// </summary>
|
||||
/// <param name="partCode">零件流水号</param>
|
||||
/// <param name="dt"></param>
|
||||
static public void GetRepareData_OtherLine_Select(string partCode, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "电子看板_发动机号_工件下线_其它装配线_查询";
|
||||
SqlParameter[] thisParms = new SqlParameter[1];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@零件流水号", partCode);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt);
|
||||
}
|
||||
|
||||
//
|
||||
/// <summary>
|
||||
/// 电子看板_发动机号_工件下线_增加
|
||||
/// @工位号 nvarchar(50) = null,
|
||||
/// @发动机号 nvarchar(50) = null,
|
||||
/// @机型代码 int = 1,
|
||||
/// @发动机型号 nvarchar(50) = null,
|
||||
/// @返修数据 nvarchar(4000) = null
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="partCode">零件流水号</param>
|
||||
/// <param name="engineID"></param>
|
||||
/// <param name="engineTypeID"></param>
|
||||
/// <param name="engineType"></param>
|
||||
/// <param name="engineData"></param>
|
||||
static public void GetRepareData_Insert(string opName,string partCode,
|
||||
string engineID, int engineTypeID, string engineType, string engineData)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "电子看板_发动机号_工件下线_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[6];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@零件流水号", partCode);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@发动机号", engineID);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@机型代码", engineTypeID);
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@发动机型号", engineType);
|
||||
thisParms[5] = new System.Data.SqlClient.SqlParameter("@返修数据", engineData);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
/// <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;
|
||||
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, 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("@条码创建时间", codeCreatetime);
|
||||
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_SY(string opName, string engineID1, 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;
|
||||
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, 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("@发动机号", engineID1);
|
||||
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);
|
||||
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="EngineTypeID"></param>
|
||||
/// <param name="EngineID"></param>
|
||||
/// <param name="dt"></param>
|
||||
static public void GetTime_Arrived(int EngineTypeID, string EngineID, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "测量数据发动机在线状态_工件到位时间_查询";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@机型代码", EngineTypeID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@发动机号", EngineID);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//2013-01-06 王可心 手动创建编号时调用
|
||||
/// <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>
|
||||
/// 电子看板_发动机号_线首工位_查询_QR码返修
|
||||
/// </summary>
|
||||
/// <param name="QR"></param>
|
||||
/// <param name="dt"></param>
|
||||
static public void GetRepareDataSelect_QR(string QR, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "电子看板_发动机号_线首工位_查询_QR码返修";
|
||||
SqlParameter[] thisParms = new SqlParameter[1];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@QR码", QR);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt);
|
||||
}
|
||||
/// <summary>
|
||||
/// 电子看板_发动机号_线首工位_查询_两行条码返修
|
||||
/// </summary>
|
||||
/// <param name="QR"></param>
|
||||
/// <param name="dt"></param>
|
||||
static public void GetRepareDataSelect_EngingeRepair(string barCode_EngineType, string barCode_EngineNum, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "电子看板_发动机号_线首工位_查询_两行条码返修";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@型号条码", barCode_EngineType);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@流水号条码", barCode_EngineNum);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,316 @@
|
||||
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="dt"></param>
|
||||
static public void GetEngineID_MailLine(string opName, string engineType, out DataTable dt)
|
||||
{
|
||||
bool isSubLine;
|
||||
isSubLine = false;
|
||||
GetEngineID_Auto(opName, engineType, isSubLine, out dt);
|
||||
}
|
||||
/// <summary>
|
||||
/// 获得分线发动机号
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="engineType"></param>
|
||||
/// <param name="dt">工件机型,机型代码,工件编号,壳体编号型号,工件流水号,QR码,基本流水号</param>
|
||||
static public void GetEngineID_SubLine(string opName, string engineType, out DataTable dt)
|
||||
{
|
||||
bool isSubLine;
|
||||
isSubLine = true;
|
||||
GetEngineID_Auto(opName, engineType, isSubLine, out dt);
|
||||
}
|
||||
/// <summary>
|
||||
/// 电子看板_发动机号_线首工位_创建线首发动机号_根据输入机型代码
|
||||
/// 工件机型,机型代码,工件编号,壳体编号型号,工件流水号,QR码,基本流水号
|
||||
/// </summary>
|
||||
/// <param name="opName">工位号</param>
|
||||
/// <param name="engineType">发动机型号</param>
|
||||
/// <param name="isSubLine">是否分线--@是否分线 = 0 总线线首(OP2010);=1分线线首(OP1010,OP2100)</param>
|
||||
/// <param name="dt">工件机型,机型代码,工件编号,壳体编号型号,工件流水号,QR码,基本流水号</param>
|
||||
static public void GetEngineID_Auto(string opName, string engineType, bool isSubLine, 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("@是否分线", isSubLine);
|
||||
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="dt"></param>
|
||||
static public void GetEngineID_Manual_MainLine(string opName, string engineType, string engineYear, string engineMoon, string engineDay, int engineNumber, out DataTable dt)
|
||||
{
|
||||
//@是否分线 bit=0 @是否分线 = 0 总线线首(OP2010);=1分线线首(OP1010,OP2100)
|
||||
bool isSubLine = false;
|
||||
GetEngineID_Manual(opName, engineType, engineYear, engineMoon, engineDay, engineNumber, isSubLine, 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="dt"></param>
|
||||
static public void GetEngineID_Manual_SunLine(string opName, string engineType, string engineYear, string engineMoon, string engineDay, int engineNumber, out DataTable dt)
|
||||
{
|
||||
//@是否分线 bit=0 @是否分线 = 0 总线线首(OP2010);=1分线线首(OP1010,OP2100)
|
||||
bool isSubLine = true;
|
||||
GetEngineID_Manual(opName, engineType, engineYear, engineMoon, engineDay, engineNumber, isSubLine, 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">@是否分线 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>
|
||||
/// 电子看板_发动机号_线首工位_创建线首发动机号_根据输入机型代码_手动方式
|
||||
/// </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_OldLineLoad(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="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,
|
||||
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();
|
||||
|
||||
}
|
||||
/// <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="partCode_Repair">零件流水号_返修</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, out string partCode_Repair,
|
||||
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();
|
||||
partCode_Repair = dt.Rows[0]["零件流水号_返修"].ToString();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,165 @@
|
||||
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>
|
||||
/// MES_装配数据_零部件追溯_数据主表_增加_电子看板
|
||||
/// @发动机号 nvarchar(50)=null,
|
||||
/// @发动机型号 nvarchar(50)=null,
|
||||
/// @机型代码 int=null,
|
||||
/// @订单号 nvarchar(50)=null,
|
||||
/// @工位号 nvarchar(50)=null,
|
||||
/// @到达时间 datetime,
|
||||
/// @离开时间 datetime,
|
||||
/// @操作者工号 nvarchar(50)=null,
|
||||
/// @班次代码 nvarchar(50)=null,
|
||||
/// @放行方式 int =null,
|
||||
/// @工位类型 nvarchar(50)=null,
|
||||
/// @追溯代码 int = null output
|
||||
/// </summary>
|
||||
/// <param name="engineID">发动机号</param>
|
||||
/// <param name="engineType">发动机型号</param>
|
||||
/// <param name="engineTypeID">机型代码</param>
|
||||
/// <param name="orderForm">订单号</param>
|
||||
/// <param name="opName">工位号</param>
|
||||
/// <param name="arrivedTime">到达时间</param>
|
||||
/// <param name="leavTime">离开时间</param>
|
||||
/// <param name="opperatorCode">操作者工号</param>
|
||||
/// <param name="shiftCode">班次代码</param>
|
||||
/// <param name="goOverType">放行方式</param>
|
||||
/// <param name="opNameType">工位类型</param>
|
||||
/// <param name="traceCode">追溯代码</param>
|
||||
static public void MaterialMailTable_Insert(string engineID,string engineType,int engineTypeID,string orderForm,string opName,
|
||||
DateTime arrivedTime,DateTime leavTime,string opperatorCode,string shiftCode,
|
||||
int goOverType,string opNameType,out int traceCode)
|
||||
{
|
||||
|
||||
string procedureName;
|
||||
try
|
||||
{
|
||||
procedureName = "MES_装配数据_零部件追溯_数据主表_增加_电子看板";
|
||||
SqlParameter[] thisParms = new SqlParameter[12];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@发动机号", engineID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@发动机型号", engineType);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@机型代码", engineTypeID);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@订单号", orderForm);
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[5] = new System.Data.SqlClient.SqlParameter("@到达时间", arrivedTime);
|
||||
thisParms[6] = new System.Data.SqlClient.SqlParameter("@离开时间", leavTime);
|
||||
thisParms[7] = new System.Data.SqlClient.SqlParameter("@操作者工号", opperatorCode);
|
||||
thisParms[8] = new System.Data.SqlClient.SqlParameter("@班次代码", shiftCode);
|
||||
thisParms[9] = new System.Data.SqlClient.SqlParameter("@放行方式", goOverType);
|
||||
thisParms[10] = new System.Data.SqlClient.SqlParameter("@工位类型", opNameType);
|
||||
thisParms[11] = new System.Data.SqlClient.SqlParameter("@追溯代码", 0);
|
||||
thisParms[11].Direction = ParameterDirection.Output;
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
|
||||
traceCode = Convert.ToInt32(thisParms[11].Value);
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
traceCode = 0;
|
||||
////ApplicationLog.WriteLog(err, err.Message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// MES_装配数据_零部件追溯_增加_电子看板
|
||||
///ALTER PROCEDURE MES_装配数据_零部件追溯_增加_电子看板
|
||||
///@追溯代码 int = null,
|
||||
///@发动机号 nvarchar(50)=null,
|
||||
///@工位号 nvarchar(50)=null,
|
||||
///@零件图号 nvarchar(50)=null,
|
||||
///@零件名称 nvarchar(50)=null,
|
||||
///@零件数量 int=null,
|
||||
///@生产厂家 nvarchar(50)=null,
|
||||
///@物料条码批次 nvarchar(50)=null,
|
||||
///@操作者工号 nvarchar(50)=null,
|
||||
///@班次代码 nvarchar(50)=null
|
||||
/// </summary>
|
||||
/// <param name="traceCode"></param>
|
||||
/// <param name="engineID"></param>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="opperatorCode"></param>
|
||||
/// <param name="shiftCode"></param>
|
||||
/// <param name="dt"></param>
|
||||
static public void MaterialSubTable_Insert(int traceCode,string engineID, string opName,string opperatorCode,string shiftCode,
|
||||
DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "MES_装配数据_零部件追溯_增加_电子看板";
|
||||
SqlParameter[] thisParms = new SqlParameter[10];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@追溯代码", traceCode);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@发动机号", engineID);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@操作者工号", opperatorCode);
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@班次代码", shiftCode);
|
||||
thisParms[5] = new System.Data.SqlClient.SqlParameter("@零件图号", SqlDbType.NVarChar, 50, "零件图号");
|
||||
thisParms[6] = new System.Data.SqlClient.SqlParameter("@零件名称", SqlDbType.NVarChar, 50, "零件名称");
|
||||
thisParms[7] = new System.Data.SqlClient.SqlParameter("@零件数量", SqlDbType.Int, 4, "零件数量");
|
||||
thisParms[8] = new System.Data.SqlClient.SqlParameter("@生产厂家", SqlDbType.NVarChar, 50, "生产厂家");
|
||||
thisParms[9] = new System.Data.SqlClient.SqlParameter("@物料条码批次", SqlDbType.NVarChar, 50, "零件批号");
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms,dt);
|
||||
}
|
||||
/// <summary>
|
||||
/// 保存物料信息
|
||||
/// </summary>
|
||||
/// <param name="engineID">发动机号</param>
|
||||
/// <param name="engineType">发动机型号</param>
|
||||
/// <param name="engineTypeID">机型代码</param>
|
||||
/// <param name="orderForm">订单号</param>
|
||||
/// <param name="opName">工位号</param>
|
||||
/// <param name="arrivedTime">到达时间</param>
|
||||
/// <param name="leavTime">离开时间</param>
|
||||
/// <param name="opperatorCode">操作者工号</param>
|
||||
/// <param name="shiftCode">班次代码</param>
|
||||
/// <param name="goOverType">放行方式</param>
|
||||
/// <param name="opNameType">工位类型</param>
|
||||
/// <param name="dt">装配物料列表</param>
|
||||
static public void Material_Insert_B5A(string engineID, string engineType, int engineTypeID, string orderForm, string opName,
|
||||
DateTime arrivedTime, DateTime leavTime, string opperatorCode, string shiftCode,
|
||||
int goOverType, string opNameType, DataTable dt)
|
||||
{
|
||||
int traceCode;
|
||||
//MES_装配数据_零部件追溯_数据主表_增加_电子看板
|
||||
MaterialMailTable_Insert( engineID, engineType, engineTypeID,orderForm,opName,arrivedTime, leavTime, opperatorCode, shiftCode,goOverType, opNameType,out traceCode);
|
||||
//MES_装配数据_零部件追溯_增加_电子看板
|
||||
MaterialSubTable_Insert(traceCode, engineID, opName, opperatorCode, shiftCode, dt);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 电子看板_工位名称与产品型号工艺卡_查询
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="engineTypeID"></param>
|
||||
/// <param name="PdfSrc"></param>
|
||||
static public void GetPdfSrc(string opName, string engineTypeID, out string PdfSrc)
|
||||
{
|
||||
string sql;
|
||||
DataTable dt;
|
||||
PdfSrc = null;
|
||||
sql = "exec 电子看板_工位名称与产品型号工艺卡_查询 '" + opName + "'," + engineTypeID;
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
PdfSrc = dt.Rows[0]["工艺卡路径"].ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
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="dateTime"></param>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="shiftCode"></param>
|
||||
/// <param name="OpNameCount"></param>
|
||||
/// <param name="opNameTargetTime"></param>
|
||||
/// <param name="onlineCount"></param>
|
||||
/// <param name="onlineTargetTime"></param>
|
||||
static public void OpNameCount_Select(DateTime dateTime, string opName,
|
||||
out int shiftCode,out int OpNameCount,out int opNameTargetTime,out int onlineCount,out int onlineTargetTime)
|
||||
{
|
||||
|
||||
DataTable dt;
|
||||
OpNameCount = 0;
|
||||
shiftCode = 1;
|
||||
OpNameCount = 0;
|
||||
opNameTargetTime = 0;
|
||||
onlineCount = 0;
|
||||
onlineTargetTime = 0;
|
||||
|
||||
string procedureName;
|
||||
procedureName = "基本数据_工作日历_查询";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@日期", dateTime);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms,out dt);
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
shiftCode = Convert.ToInt32(dt.Rows[0]["班次代码"]);
|
||||
OpNameCount = Convert.ToInt32(dt.Rows[0]["工位产量"]);
|
||||
opNameTargetTime = Convert.ToInt32(dt.Rows[0]["工位节拍"]);
|
||||
onlineCount = Convert.ToInt32(dt.Rows[0]["在线产量"]);
|
||||
onlineTargetTime = Convert.ToInt32(dt.Rows[0]["在线节拍"]);
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
////ApplicationLog.WriteLog(err, err.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// MES_操作着_生产班次_查询
|
||||
/// </summary>
|
||||
/// <param name="dt"></param>
|
||||
static public void Shift_Select(out DataTable dt)
|
||||
{
|
||||
string sql;
|
||||
sql = "exec MES_操作着_生产班次_查询";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
}
|
||||
/// <summary>
|
||||
/// 电子看板_托盘编号_查询
|
||||
/// </summary>
|
||||
/// <param name="dt"></param>
|
||||
static public void PartPalletCode_Select(out DataTable dt)
|
||||
{
|
||||
string sql;
|
||||
sql = "exec 电子看板_托盘编号_查询";
|
||||
DataAccess.ExecuteDataTable(sql,out dt);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,223 @@
|
||||
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>
|
||||
/// <param name="userName"></param>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="result"></param>
|
||||
/// <returns></returns>
|
||||
static public bool User_WorkCenter(string userName,string opName, out bool result)
|
||||
{
|
||||
string sql;
|
||||
DataTable dt = null;
|
||||
sql = "SELECT COUNT(*) as usercount FROM [dbo].[MES_Web_User]"
|
||||
+"where[UserId] = (select top 1 ID from MES_用户管理_人员 where 用户名 = '"+userName+"') and OpName = '"+opName+"'";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
string usercount = dt.Rows[0]["usercount"].ToString();
|
||||
if (dt.Rows.Count > 0 && usercount == "1")
|
||||
{
|
||||
return result=true;
|
||||
}
|
||||
else {
|
||||
return result=false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// MES_用户管理_人员信息_视图_显示_查询
|
||||
/// </summary>
|
||||
/// <param name="dt"></param>
|
||||
static public void UserInfo_Select(out DataTable dt)
|
||||
{
|
||||
dt = null;
|
||||
string sql = "exec MES_用户管理_人员信息_视图_显示_查询";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// [MES_用户管理_人员信息_视图_显示车间操作员_查询]
|
||||
/// </summary>
|
||||
/// <param name="dt"></param>
|
||||
static public void UserInfo_OPStaff_Select(out DataTable dt)
|
||||
{
|
||||
dt = null;
|
||||
string sql = "exec MES_用户管理_人员信息_视图_显示车间操作员_查询";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// MES_用户管理_角色_查询
|
||||
/// </summary>
|
||||
static public void StaffRole_select(out DataTable dt)
|
||||
{
|
||||
string sql;
|
||||
sql = "exec MES_用户管理_角色_查询";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// [MES_用户管理_人员_增加_查询]
|
||||
/// 执行后,返回count(*)
|
||||
/// </summary>
|
||||
/// <param name="userName"></param>
|
||||
|
||||
public static int UserInfo_Select_ForInsert(string userID)
|
||||
{
|
||||
int count;
|
||||
string sql;
|
||||
sql = "exec MES_用户管理_人员_增加_查询 '" + userID + "'";
|
||||
DataAccess.ExecuteOutNum(sql, out count);
|
||||
return count;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// MES_用户管理_人员_增加
|
||||
/// </summary>
|
||||
/// <param name="userName"></param>
|
||||
/// <param name="user"></param>
|
||||
static public bool UserInfo_Insert(string userID, string userName, int roleNum)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "MES_用户管理_人员_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[3];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@用户名", userID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@员工姓名", userName);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@角色代码", roleNum);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// MES_用户管理_人员_修改
|
||||
/// </summary>
|
||||
/// <param name="userName"></param>
|
||||
/// <param name="user"></param>
|
||||
static public bool UserInfo_Update(int ID,string userID,string userPassword,string userName, int roleNum)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "MES_用户管理_人员_修改";
|
||||
SqlParameter[] thisParms = new SqlParameter[5];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@ID", ID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@用户名", userID);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@密码", userPassword);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@员工姓名", userName);
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@角色代码", roleNum);
|
||||
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// MES_用户管理_人员_姓名_修改
|
||||
/// </summary>
|
||||
/// <param name="userName"></param>
|
||||
/// <param name="user"></param>
|
||||
static public bool UserInfo_Name_Update(int ID, string userID,string userName)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "MES_用户管理_人员_姓名_修改";
|
||||
SqlParameter[] thisParms = new SqlParameter[3];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@ID", ID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@用户名", userID);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@员工姓名", userName);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///[MES_用户管理_人员_删除]
|
||||
/// </summary>
|
||||
static public bool UserInfo_Delete(int ID, string userID)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "MES_用户管理_人员_删除";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@ID", ID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@用户名", userID);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// MES_用户管理_人员登录_查询
|
||||
/// </summary>
|
||||
/// <param name="engineID"></param>
|
||||
/// <param name="dt"></param>
|
||||
static public void UserInfo_Login(string userID, string userPassword, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "MES_用户管理_人员登录_查询";
|
||||
//procedureName = "权限管理_用户登录_查询数据";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@用户名", userID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@密码", userPassword);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// MES_用户管理_人员登录_是否存在_查询
|
||||
/// 执行后,返回count(*)
|
||||
/// </summary>
|
||||
/// <param name="userID"></param>
|
||||
/// <param name="newPassword"></param>
|
||||
/// <returns></returns>
|
||||
public static int UserInfo_Login_Exist_Select(string userID,string userPassword)
|
||||
{
|
||||
int count;
|
||||
string sql;
|
||||
sql = "exec MES_用户管理_人员登录_是否存在_查询 '" + userID + "'" + ",'" + userPassword + "'";
|
||||
DataAccess.ExecuteOutNum(sql, out count);
|
||||
return count;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// MES_用户管理_人员_密码_修改
|
||||
/// </summary>
|
||||
/// <param name="userName"></param>
|
||||
/// <param name="user"></param>
|
||||
static public bool UserInfo_Password_Update(string userID, string userPassword,string userNewPassword)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "MES_用户管理_人员_密码_修改";
|
||||
SqlParameter[] thisParms = new SqlParameter[3];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@用户名", userID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@密码", userPassword);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@新密码", userNewPassword);
|
||||
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 基本数据_工作日历_班次查询 2013-11-07 查出当前时间班次
|
||||
/// </summary>
|
||||
/// <param name="engineID"></param>
|
||||
/// <param name="dt"></param>
|
||||
static public void UserShift_Select(out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "基本数据_工作日历_班次查询";
|
||||
DataAccess.ExecuteStoredProcedure(procedureName,out dt);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
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_操作者_登录_增加
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="userName"></param>
|
||||
public static void UserNameLoginInsert(string opName,string userName)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "MES_操作者_登录_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@操作者工号", userName);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
/// <summary>
|
||||
/// MES_操作者_用户_增加 2013-01-23 王可心
|
||||
/// </summary>
|
||||
/// <param name="userName"></param>
|
||||
/// <param name="user"></param>
|
||||
static public bool UserNameTableInsert(string userName, string user)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "MES_操作者_用户_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@操作者工号", userName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@操作者姓名", user);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// MES_操作者_用户_修改
|
||||
/// </summary>
|
||||
/// <param name="userName"></param>
|
||||
/// <param name="password"></param>
|
||||
/// <param name="passwordNew"></param>
|
||||
public static void UserNameTableUpdate(string userName,string password,string passwordNew)
|
||||
{
|
||||
string sql;
|
||||
sql = "exec MES_操作者_用户_修改 '" + userName + "','" + password + "','"+passwordNew+"'";
|
||||
DataAccess.ExecuteSQL(sql);
|
||||
}
|
||||
/// <summary>
|
||||
/// MES_操作者_用户_设置初始秘密
|
||||
/// </summary>
|
||||
/// <param name="userName"></param>
|
||||
static public bool UserNameTableUpdateInitPassword(string userName)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "MES_操作者_用户_设置初始秘密";
|
||||
SqlParameter[] thisParms = new SqlParameter[1];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@操作者工号", userName);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// MES_操作者_用户_查询
|
||||
/// 执行后,返回count(*)
|
||||
/// </summary>
|
||||
/// <param name="userName"></param>
|
||||
/// <param name="password"></param>
|
||||
public static int UserNameTableSelect(string userName, string password)
|
||||
{
|
||||
int count;
|
||||
string sql;
|
||||
sql = "exec MES_操作者_用户_查询 '"+ userName + "','" + password + "'";
|
||||
DataAccess.ExecuteOutNum(sql, out count);
|
||||
return count;
|
||||
}
|
||||
/// <summary>
|
||||
/// MES_操作者_用户_增加用_查询
|
||||
/// 执行后,返回count(*)
|
||||
/// </summary>
|
||||
/// <param name="userName"></param>
|
||||
|
||||
public static int UserNameTableSelectForInsert(string userName)
|
||||
{
|
||||
int count;
|
||||
string sql;
|
||||
sql = "exec MES_操作者_用户_增加用_查询 '" + userName + "'";
|
||||
DataAccess.ExecuteOutNum(sql, out count);
|
||||
return count;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// MES_操作者_用户_删除 2013-01-23 王可心 删除该用户
|
||||
/// </summary>
|
||||
/// <param name="userName">用户工号</param>
|
||||
static public bool UserNameTableSelectForDelete(string userName)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "MES_操作者_用户_删除";
|
||||
SqlParameter[] thisParms = new SqlParameter[1];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@操作者工号", userName);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// MES_操作者_用户_姓名_修改 2013-01-23 王可心
|
||||
/// </summary>
|
||||
/// <param name="userName"></param>
|
||||
/// <param name="user"></param>
|
||||
static public bool UserNameTableAlter(string userName, string user)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "MES_操作者_用户_姓名_修改";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@操作者工号", userName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@操作者姓名", user);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,238 @@
|
||||
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="shiftNO">序号</param>
|
||||
static public bool WorkShift_Delete(int shiftNO)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "电子看板_工作时间与班次_删除";
|
||||
SqlParameter[] thisParms = new SqlParameter[1];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@序号", shiftNO);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
/// <summary>
|
||||
/// 电子看板_工作时间与班次_修改
|
||||
/// </summary>
|
||||
/// <param name="shiftNO">序号</param>
|
||||
/// <param name="shiftStartTime">开始工作时间</param>
|
||||
/// <param name="shiftEndTime">结束工作时间</param>
|
||||
/// <param name="shiftWorkNo">班次代码</param>
|
||||
/// <param name="shiftIsWork">是否工作</param>
|
||||
static public bool WorkShift_Update(int shiftNO,string shiftStartTime,
|
||||
string shiftEndTime, int shiftWorkNo, int shiftIsWork)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "电子看板_工作时间与班次_修改";
|
||||
SqlParameter[] thisParms = new SqlParameter[5];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@序号", shiftNO);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@开始工作时间", shiftStartTime);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@结束工作时间", shiftEndTime);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@班次代码", shiftWorkNo);
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@是否工作", shiftIsWork);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
/// <summary>
|
||||
/// 电子看板_工作时间与班次_增加
|
||||
/// </summary>
|
||||
/// <param name="shiftNO">序号</param>
|
||||
/// <param name="shiftStartTime">开始工作时间</param>
|
||||
/// <param name="shiftEndTime">结束工作时间</param>
|
||||
/// <param name="shiftWorkNo">班次代码</param>
|
||||
/// <param name="shiftIsWork">是否工作</param>
|
||||
static public bool WorkShift_Insert(int shiftNO, string shiftStartTime,
|
||||
string shiftEndTime, int shiftWorkNo, int shiftIsWork)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "电子看板_工作时间与班次_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[5];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@序号", shiftNO);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@开始工作时间", shiftStartTime);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@结束工作时间", shiftEndTime);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@班次代码", shiftWorkNo);
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@是否工作", shiftIsWork);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
/// <summary>
|
||||
/// 电子看板_工作时间与班次_查询
|
||||
/// </summary>
|
||||
/// <param name="dt"></param>
|
||||
static public void WorkShift_Select(out DataTable dt)
|
||||
{
|
||||
string sql;
|
||||
sql = " exec 电子看板_工作时间与班次_查询";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
}
|
||||
/// <summary>
|
||||
/// MES_基本变量_基本机型_增加
|
||||
/// @基本机型 nvarchar(50),
|
||||
/// @机型代码 int
|
||||
/// </summary>
|
||||
static public bool EngineBasicType_Insert(string engineBasicType,
|
||||
int engineBasicTypeID, double maxWeight, double minWeight, double Vp, double tm)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "MES_基本变量_基本机型_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[6];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@基本机型", engineBasicType);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@机型代码", engineBasicTypeID);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@重量差上限", maxWeight);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@重量差下限", minWeight);
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@Vp", Vp);
|
||||
thisParms[5] = new System.Data.SqlClient.SqlParameter("@tm", tm);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
/// <summary>
|
||||
/// MES_基本变量_基本机型_修改
|
||||
/// @序号 int,
|
||||
/// @基本机型 nvarchar(50),
|
||||
/// @机型代码 int
|
||||
/// </summary>
|
||||
static public bool EngineBasicType_Update(int sn,string engineBasicType,
|
||||
int engineBasicTypeID, double maxWeight, double minWeight, double Vp, double tm)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "MES_基本变量_基本机型_修改";
|
||||
SqlParameter[] thisParms = new SqlParameter[7];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@序号", sn);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@基本机型", engineBasicType);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@机型代码", engineBasicTypeID);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@重量差上限", maxWeight);
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@重量差下限", minWeight);
|
||||
thisParms[5] = new System.Data.SqlClient.SqlParameter("@Vp", Vp);
|
||||
thisParms[6] = new System.Data.SqlClient.SqlParameter("@tm", tm);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
/// <summary>
|
||||
/// MES_基本变量_基本机型_删除
|
||||
/// @序号 int
|
||||
/// </summary>
|
||||
static public bool EngineBasicType_Delete(int sn)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "MES_基本变量_基本机型_删除";
|
||||
SqlParameter[] thisParms = new SqlParameter[1];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@序号", sn);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
/// <summary>
|
||||
/// MES_基本变量_机型代码_增加
|
||||
/// @发动机型号 nvarchar(50),
|
||||
/// @发动机机型标志 int,
|
||||
/// @条码类型 int ,
|
||||
/// @流水号类型 int,
|
||||
/// @工厂编号 nvarchar(50),
|
||||
/// @装配线班组号 nvarchar(50),
|
||||
/// @壳体编号型号 nvarchar(50),
|
||||
/// @壳体编号型号带空格 nvarchar(50),
|
||||
/// @QR码读数标志 nvarchar(50),
|
||||
/// @QR码产品型号 nvarchar(50)
|
||||
/// </summary>
|
||||
/// <param name="engineType">发动机型号</param>
|
||||
/// <param name="engineTypeID">发动机机型标志</param>
|
||||
/// <param name="barCodeID">条码类型</param>
|
||||
/// <param name="snNumberID">流水号类型</param>
|
||||
/// <param name="factoryID">工厂编号</param>
|
||||
/// <param name="shiftID">装配线班组号</param>
|
||||
/// <param name="shellCode">壳体编号型号</param>
|
||||
/// <param name="shellCode_Space">壳体编号型号带空格</param>
|
||||
/// <param name="QR_Code">QR码读数标志</param>
|
||||
/// <param name="QR_Type">QR码产品型号</param>
|
||||
/// <returns></returns>
|
||||
static public bool EngineType_Insert(string engineType, int engineTypeID,
|
||||
int barCodeID,int snNumberID,string factoryID,string shiftID,
|
||||
string shellCode, string shellCode_Space, string QR_Code, string QR_Type, string shellCode_downline)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "MES_基本变量_机型代码_增加_new";
|
||||
SqlParameter[] thisParms = new SqlParameter[11];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@发动机型号", engineType);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@发动机机型标志", engineTypeID);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@条码类型", barCodeID);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@流水号类型", snNumberID);
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@工厂编号", factoryID);
|
||||
thisParms[5] = new System.Data.SqlClient.SqlParameter("@装配线班组号", shiftID);
|
||||
thisParms[6] = new System.Data.SqlClient.SqlParameter("@壳体编号型号", shellCode);
|
||||
thisParms[7] = new System.Data.SqlClient.SqlParameter("@壳体编号型号带空格", shellCode_Space);
|
||||
thisParms[8] = new System.Data.SqlClient.SqlParameter("@QR码读数标志", QR_Code);
|
||||
thisParms[9] = new System.Data.SqlClient.SqlParameter("@QR码产品型号", QR_Type);
|
||||
thisParms[10] = new System.Data.SqlClient.SqlParameter("@壳体编号型号条码", shellCode_downline);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
/// <summary>
|
||||
/// MES_基本变量_机型代码_修改
|
||||
/// @序号 int,
|
||||
/// @发动机型号 nvarchar(50),
|
||||
/// @发动机机型标志 int,
|
||||
/// @条码类型 int ,
|
||||
/// @流水号类型 int,
|
||||
/// @工厂编号 nvarchar(50),
|
||||
/// @装配线班组号 nvarchar(50),
|
||||
/// @壳体编号型号 nvarchar(50),
|
||||
/// @壳体编号型号带空格 nvarchar(50),
|
||||
/// @QR码读数标志 nvarchar(50),
|
||||
/// @QR码产品型号 nvarchar(50)
|
||||
/// </summary>
|
||||
/// <param name="sn">序号</param>
|
||||
/// <param name="engineType">发动机型号</param>
|
||||
/// <param name="engineBasicTypeID">发动机机型标志</param>
|
||||
/// <param name="barCodeID">条码类型</param>
|
||||
/// <param name="snNumberID">流水号类型</param>
|
||||
/// <param name="factoryID">工厂编号</param>
|
||||
/// <param name="shiftID">装配线班组号</param>
|
||||
/// <param name="shellCode">壳体编号型号</param>
|
||||
/// <param name="shellCode_Space">壳体编号型号带空格</param>
|
||||
/// <param name="QR_Code">QR码读数标志</param>
|
||||
/// <param name="QR_Type">QR码产品型号</param>
|
||||
/// <returns></returns>
|
||||
static public bool EngineType_Update(int sn,string engineType, int engineBasicTypeID,
|
||||
int barCodeID, int snNumberID, string factoryID, string shiftID,
|
||||
string shellCode, string shellCode_Space, string QR_Code, string QR_Type,string shellCode_downline)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "MES_基本变量_机型代码_修改_new";
|
||||
SqlParameter[] thisParms = new SqlParameter[12];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@序号", sn);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@发动机型号", engineType);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@发动机机型标志", engineBasicTypeID);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@条码类型", barCodeID);
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@流水号类型", snNumberID);
|
||||
thisParms[5] = new System.Data.SqlClient.SqlParameter("@工厂编号", factoryID);
|
||||
thisParms[6] = new System.Data.SqlClient.SqlParameter("@装配线班组号", shiftID);
|
||||
thisParms[7] = new System.Data.SqlClient.SqlParameter("@壳体编号型号", shellCode);
|
||||
thisParms[8] = new System.Data.SqlClient.SqlParameter("@壳体编号型号带空格", shellCode_Space);
|
||||
thisParms[9] = new System.Data.SqlClient.SqlParameter("@QR码读数标志", QR_Code);
|
||||
thisParms[10] = new System.Data.SqlClient.SqlParameter("@QR码产品型号", QR_Type);
|
||||
thisParms[11] = new System.Data.SqlClient.SqlParameter("@壳体编号型号条码", shellCode_downline);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
/// <summary>
|
||||
/// MES_基本变量_机型代码_删除
|
||||
/// @序号 int,
|
||||
/// </summary>
|
||||
/// <param name="sn">序号</param>
|
||||
/// <returns></returns>
|
||||
static public bool EngineType_Delete(int sn)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "MES_基本变量_机型代码_删除";
|
||||
SqlParameter[] thisParms = new SqlParameter[1];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@序号", sn);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using DataLinkMesWork;
|
||||
using System.Collections;
|
||||
using System.Collections.Specialized;
|
||||
//using SystemFramework;
|
||||
|
||||
namespace bizFacade
|
||||
{
|
||||
/// <summary>
|
||||
/// [MES_计划BOM_工位与名称_查询_是否启用MES]
|
||||
/// </summary>
|
||||
public partial class BaseDataSystemMES
|
||||
{
|
||||
/// <summary>
|
||||
/// [MES_计划BOM_工位与名称_查询_是否启用MES]
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
public static int IsMES_Select(string opName)
|
||||
{
|
||||
int count;
|
||||
string sql = "exec MES_计划BOM_工位与名称_查询_是否启用MES '" + opName + "'";
|
||||
DataAccess.ExecuteOutNum(sql, out count);
|
||||
return count;
|
||||
}
|
||||
/// <summary>
|
||||
/// [MES_计划BOM_工位与名称_查询_在线状态]
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
public static int IsOnLine_Select(string opName)
|
||||
{
|
||||
int count;
|
||||
string sql = "exec MES_计划BOM_工位与名称_查询_在线状态 '" + opName + "'";
|
||||
DataAccess.ExecuteOutNum(sql, out count);
|
||||
return count;
|
||||
}
|
||||
/// <summary>
|
||||
/// [MES_计划BOM_工位与名称_查询_是否启用MES]
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="tagValue"></param>
|
||||
public static void IsMES_Update(string opName,string tagValue)
|
||||
{
|
||||
string sql = "exec MES_计划BOM_工位与名称_更新_是否启用MES '" + opName + "'," + tagValue;
|
||||
DataAccess.ExecuteSQL(sql);
|
||||
}
|
||||
/// <summary>
|
||||
/// [MES_计划BOM_工位与名称_查询_在线状态]
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="tagValue"></param>
|
||||
public static void IsOnLine_Update(string opName, string tagValue)
|
||||
{
|
||||
string sql = "exec MES_计划BOM_工位与名称_更新_在线状态 '" + opName + "'," + tagValue;
|
||||
DataAccess.ExecuteSQL(sql);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
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>
|
||||
/// MES_基本变量_厂家代码_查询
|
||||
/// </summary>
|
||||
static public void MaterialFactory_Select(out DataTable dt)
|
||||
{
|
||||
string sql;
|
||||
sql = "exec MES_基本变量_厂家代码_查询";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
}
|
||||
///// <summary>
|
||||
///// 电子看板_装配零件_查询
|
||||
///// </summary>
|
||||
///// <param name="opName"></param>
|
||||
///// <param name="engineTypeID"></param>
|
||||
///// <param name="dt"></param>
|
||||
//static public void PartMaterial_Select(string opName, string engineType,string engineTypeID, out DataTable dt)
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "exec 电子看板_装配零件_查询 '" + opName + "'," + engineTypeID + ",'" + engineType+"'";
|
||||
// DataAccess.ExecuteDataTable(sql, out dt);
|
||||
//}
|
||||
/// <summary>
|
||||
/// 电子看板_装配零件_增加
|
||||
/// </summary>
|
||||
/// <param name="opName">工位号</param>
|
||||
/// <param name="engineTypeID">产品型号代码</param>
|
||||
/// <param name="MaterialMark">标号</param>
|
||||
/// <param name="PartDrawNumber">零件图号</param>
|
||||
/// <param name="PartName">零件名称</param>
|
||||
/// <param name="PartCount">零件数量</param>
|
||||
/// <param name="MaterialNumber">零件批号</param>
|
||||
/// <param name="PartFactor">生产厂家</param>
|
||||
/// <param name="PartMemo">备注</param>
|
||||
/// <param name="engineType">发动机型号</param>
|
||||
static public void PartMaterial_Insert
|
||||
(string opName, int engineTypeID,
|
||||
int MaterialMark, string PartDrawNumber, string PartName, int PartCount,
|
||||
string MaterialNumber, string PartFactor, string PartMemo, string engineType)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "电子看板_装配零件_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[10];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@产品型号代码", engineTypeID);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@标号", MaterialMark);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@零件图号", PartDrawNumber);
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@零件名称", PartName);
|
||||
thisParms[5] = new System.Data.SqlClient.SqlParameter("@零件数量", PartCount);
|
||||
thisParms[6] = new System.Data.SqlClient.SqlParameter("@零件批号", MaterialNumber);
|
||||
thisParms[7] = new System.Data.SqlClient.SqlParameter("@生产厂家", PartFactor);
|
||||
thisParms[8] = new System.Data.SqlClient.SqlParameter("@备注", PartMemo);
|
||||
thisParms[9] = new System.Data.SqlClient.SqlParameter("@发动机型号", engineType);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
/// <summary>
|
||||
/// 电子看板_装配零件_修改
|
||||
/// </summary>
|
||||
/// <param name="ID">唯一标志</param>
|
||||
/// <param name="MaterialMark">标号</param>
|
||||
/// <param name="PartDrawNumber">零件图号</param>
|
||||
/// <param name="PartName">零件名称</param>
|
||||
/// <param name="PartCount">零件数量</param>
|
||||
/// <param name="MaterialNumber">零件批号</param>
|
||||
/// <param name="PartFactor">生产厂家</param>
|
||||
/// <param name="PartMemo">备注</param>
|
||||
static public void PartMaterial_Update
|
||||
(int ID,int MaterialMark, string PartDrawNumber, string PartName, int PartCount,
|
||||
string MaterialNumber, string PartFactor, string PartMemo)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "电子看板_装配零件_修改";
|
||||
SqlParameter[] thisParms = new SqlParameter[8];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@ID", ID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@标号", MaterialMark);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@零件图号", PartDrawNumber);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@零件名称", PartName);
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@零件数量", PartCount);
|
||||
thisParms[5] = new System.Data.SqlClient.SqlParameter("@零件批号", MaterialNumber);
|
||||
thisParms[6] = new System.Data.SqlClient.SqlParameter("@生产厂家", PartFactor);
|
||||
thisParms[7] = new System.Data.SqlClient.SqlParameter("@备注", PartMemo);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
/// <summary>
|
||||
/// 电子看板_装配零件_删除
|
||||
/// </summary>
|
||||
/// <param name="ID"></param>
|
||||
static public void PartMaterial_Delete(int ID)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "电子看板_装配零件_删除";
|
||||
SqlParameter[] thisParms = new SqlParameter[1];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@ID", ID);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
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>
|
||||
/// MES_计划BOM_工位与名称_修改_工序号和工序名称;
|
||||
/// </summary>
|
||||
/// <param name="opName">工位号</param>
|
||||
/// <param name="ProccessCode">工序号</param>
|
||||
/// <param name="ProcessName">工序名称</param>
|
||||
static public void OpNameWorkStepName_Update(string opName, string ProccessCode, string ProcessName)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "MES_计划BOM_工位与名称_修改_工序号和工序名称";
|
||||
SqlParameter[] thisParms = new SqlParameter[3];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@工序号", ProccessCode);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@工序名称", ProcessName);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
/// <summary>
|
||||
/// 电子看板_工序内容_工步属性_查询
|
||||
/// </summary>
|
||||
static public void GetWorkStepPropurty(out DataTable dt)
|
||||
{
|
||||
string sql;
|
||||
sql = "exec 电子看板_工序内容_工步属性_查询";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 电子看板_工序内容_增加
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="engineTypeID"></param>
|
||||
/// <param name="workStep"></param>
|
||||
/// <param name="contend"></param>
|
||||
/// <param name="requare"></param>
|
||||
/// <param name="propurtyID"></param>
|
||||
static public void WorkStepPropurty_Insert(string opName, int engineTypeID, int workStep, string contend,string requare, int propurtyID)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "电子看板_工序内容_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[6];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@产品型号代码", engineTypeID);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@工步号", workStep);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@操作内容", contend);
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@技术要求", requare);
|
||||
thisParms[5] = new System.Data.SqlClient.SqlParameter("@工步属性", propurtyID);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
/// <summary>
|
||||
/// 电子看板_工序内容_修改
|
||||
/// </summary>
|
||||
/// <param name="ID"></param>
|
||||
/// <param name="contend"></param>
|
||||
/// <param name="requare"></param>
|
||||
/// <param name="propurtyID"></param>
|
||||
static public void WorkStepPropurty_Update(int ID, string contend, string requare, int propurtyID)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "电子看板_工序内容_修改";
|
||||
SqlParameter[] thisParms = new SqlParameter[4];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@ID", ID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@操作内容", contend);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@技术要求", requare);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@工步属性", propurtyID);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
/// <summary>
|
||||
/// 电子看板_工序内容_删除
|
||||
/// </summary>
|
||||
/// <param name="ID"></param>
|
||||
static public void WorkStepPropurty_Delete(int ID)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "电子看板_工序内容_删除";
|
||||
SqlParameter[] thisParms = new SqlParameter[1];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@ID", ID);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
/// <summary>
|
||||
/// 电子看板_工序内容_修改_修改序号
|
||||
/// </summary>
|
||||
/// <param name="ID"></param>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="engineTypeID"></param>
|
||||
/// <param name="workStep"></param>
|
||||
static public void WorkStepPropurty_Update_WorkStep(int ID,string opName, int engineTypeID, int workStep)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "电子看板_工序内容_修改_修改序号";
|
||||
SqlParameter[] thisParms = new SqlParameter[4];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@ID", ID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@产品型号代码", engineTypeID);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@工步号", workStep);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,244 @@
|
||||
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>
|
||||
/// MES_计划BOM_工位与名称_查询
|
||||
///
|
||||
/// </summary>
|
||||
static public void GetOpNameByOpName(string opName,out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "MES_计划BOM_工位与名称_查询_根据工位号";
|
||||
SqlParameter[] thisParms = new SqlParameter[1];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms,out dt);
|
||||
}
|
||||
/// <summary>
|
||||
/// MES_计划BOM_工位与名称_查询
|
||||
/// MES_计划BOM_工位与名称_查询_根据工位号
|
||||
/// </summary>
|
||||
static public void GetOpName(out DataTable dt)
|
||||
{
|
||||
string sql;
|
||||
sql = "exec MES_计划BOM_工位与名称_查询";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
}
|
||||
/// <summary>
|
||||
/// MES_计划BOM_工位与名称_查询_工位号_有工位计算机
|
||||
/// </summary>
|
||||
static public void GetOpName_IsMEsPC(out DataTable dt)
|
||||
{
|
||||
string sql;
|
||||
sql = "exec MES_计划BOM_工位与名称_查询_工位号_有工位计算机";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
}
|
||||
/// <summary>
|
||||
/// MES_计划BOM_工位与名称_查询_工位号_是否有测量数据_有拧紧数据
|
||||
/// </summary>
|
||||
static public void GetOpName_IsNinJinOpName(out DataTable dt)
|
||||
{
|
||||
string sql;
|
||||
sql = "exec MES_计划BOM_工位与名称_查询_工位号_是否有测量数据_有拧紧数据";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
}
|
||||
/// <summary>
|
||||
/// MES_基本变量_基本机型_查询
|
||||
/// </summary>
|
||||
static public void GetEngineBasicType(out DataTable dt)
|
||||
{
|
||||
string sql;
|
||||
sql = " exec MES_基本变量_基本机型_查询";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
}
|
||||
/// <summary>
|
||||
/// 电子看板_工位名称与产品型号产品图片_保存图片
|
||||
/// @工位号 nvarchar(50),
|
||||
/// @产品型号代码 int =null,
|
||||
/// @产品图片 image
|
||||
/// </summary>
|
||||
static public void SaveImageFile(string opName, int engineTypeID, byte[] pic)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "电子看板_工位名称与产品型号产品图片_保存图片";
|
||||
SqlParameter[] thisParms = new SqlParameter[3];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@产品型号代码", engineTypeID);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@产品图片", pic);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="engineTypeID"></param>
|
||||
/// <param name="pic"></param>
|
||||
static public void GetImageFile(string opName, string engineTypeID, out byte[] pic)
|
||||
{
|
||||
string sql;
|
||||
DataTable dt;
|
||||
pic = null;
|
||||
sql = "exec 电子看板_工位名称与产品型号产品图片_查询 '" + opName + "'," + engineTypeID;
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
pic = (byte[])dt.Rows[0]["产品图片"];
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 电子看板_工位机型_质量数据测量位置_查询
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="engineTypeID"></param>
|
||||
/// <param name="dt"></param>
|
||||
static public void ShaftPositionSelect(string opName, string engineTypeID, out DataTable dt)
|
||||
{
|
||||
string sql;
|
||||
sql = "exec 电子看板_工位机型_质量数据测量位置_查询 '" + opName + "'," + engineTypeID;
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 电子看板_工位机型_质量数据测量位置_套筒号_查询
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="engineTypeID"></param>
|
||||
/// <param name="dt"></param>
|
||||
static public void ShaftPositionSelect_BoltCode(string opName, string engineTypeID, out DataTable dt)
|
||||
{
|
||||
string sql;
|
||||
sql = "exec 电子看板_工位机型_质量数据测量位置_套筒号_查询 '" + opName + "'," + engineTypeID;
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 电子看板_工位机型_质量数据测量位置_保存数据
|
||||
/// 完成增加和修改数据
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="engineTypeID"></param>
|
||||
/// <param name="shaftSN"></param>
|
||||
/// <param name="workGroup"></param>
|
||||
/// <param name="xPosition"></param>
|
||||
/// <param name="yPosition"></param>
|
||||
/// <param name="workStep"></param>
|
||||
/// <param name="taoTongHao"></param>
|
||||
static public void ShaftPositionSaveData(string opName,
|
||||
int engineTypeID, int shaftSN,int workGroup,
|
||||
int xPosition, int yPosition, int workStep, int taoTongHao, string Torque)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "电子看板_工位机型_质量数据测量位置_保存数据";
|
||||
SqlParameter[] thisParms = new SqlParameter[9];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@产品型号代码", engineTypeID);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@序号", shaftSN);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@组号", workGroup);
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@测量位置X", xPosition);
|
||||
thisParms[5] = new System.Data.SqlClient.SqlParameter("@测量位置Y", yPosition);
|
||||
thisParms[6] = new System.Data.SqlClient.SqlParameter("@工作顺序", workStep);
|
||||
thisParms[7] = new System.Data.SqlClient.SqlParameter("@套筒号", taoTongHao);
|
||||
thisParms[8] = new System.Data.SqlClient.SqlParameter("@扭矩", Torque);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
/// <summary>
|
||||
/// 电子看板_工位机型_质量数据测量位置_修改
|
||||
/// 修改数据 电子看板_工位机型_质量数据测量位置_修改_修改序号
|
||||
/// </summary>
|
||||
/// <param name="opName">工位号</param>
|
||||
/// <param name="engineTypeID">产品型号代码</param>
|
||||
/// <param name="shaftSN">序号</param>
|
||||
/// <param name="workGroup">组号</param>
|
||||
/// <param name="xPosition">测量位置X</param>
|
||||
/// <param name="yPosition">测量位置Y</param>
|
||||
/// <param name="workStep">工作顺序</param>
|
||||
/// <param name="taoTongHao">工作顺序</param>
|
||||
static public void ShaftPositionSaveUpdate(string opName,
|
||||
int engineTypeID, int shaftSN, int workGroup,int xPosition,
|
||||
int yPosition, int workStep, int taoTongHao, string Torque)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "电子看板_工位机型_质量数据测量位置_修改";
|
||||
SqlParameter[] thisParms = new SqlParameter[9];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@产品型号代码", engineTypeID);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@序号", shaftSN);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@组号", workGroup);
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@测量位置X", xPosition);
|
||||
thisParms[5] = new System.Data.SqlClient.SqlParameter("@测量位置Y", yPosition);
|
||||
thisParms[6] = new System.Data.SqlClient.SqlParameter("@工作顺序", workStep);
|
||||
thisParms[7] = new System.Data.SqlClient.SqlParameter("@套筒号", taoTongHao);
|
||||
thisParms[8] = new System.Data.SqlClient.SqlParameter("@扭矩", Torque);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
/// <summary>
|
||||
/// 电子看板_工位机型_质量数据测量位置_修改_修改序号
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="engineTypeID"></param>
|
||||
/// <param name="shaftSN"></param>
|
||||
static public void ShaftPositionSaveUpdate_OnlySN(int id,string opName, int engineTypeID, int shaftSN)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "电子看板_工位机型_质量数据测量位置_修改_修改序号";
|
||||
SqlParameter[] thisParms = new SqlParameter[4];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@ID", id);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@产品型号代码", engineTypeID);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@序号", shaftSN);
|
||||
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
/// <summary>
|
||||
/// 电子看板_工位机型_质量数据测量位置_删除
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="engineTypeID"></param>
|
||||
/// <param name="shaftSN"></param>
|
||||
static public void ShaftPositionSaveDelete(string opName, int engineTypeID, int shaftSN)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "电子看板_工位机型_质量数据测量位置_删除";
|
||||
SqlParameter[] thisParms = new SqlParameter[3];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@产品型号代码", engineTypeID);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@序号", shaftSN);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
/// <summary>
|
||||
/// 电子看板_工位机型_质量数据测量位置_修改_修改扭矩
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="engineTypeID"></param>
|
||||
/// <param name="shaftSN"></param>
|
||||
static public void ShaftPositionSaveUpdate_OnlyTorque(int shaftSN, string opName, int engineTypeID, string Torque)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "电子看板_工位机型_质量数据测量位置_修改_修改扭矩";
|
||||
SqlParameter[] thisParms = new SqlParameter[4];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@序号", shaftSN);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@产品型号代码", engineTypeID);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@扭矩", Torque);
|
||||
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,904 @@
|
||||
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="EngineID">发动机号</param>
|
||||
/// <param name="OPName">工位号</param>
|
||||
/// <param name="Count_NG">不合格数量</param>
|
||||
/// <returns></returns>
|
||||
public static bool BaseData_QualityData_B5A_IsGoodBad_select(string EngineID,string OPName,out int Count_NG)
|
||||
{
|
||||
Count_NG = 0;
|
||||
string procedureName;
|
||||
procedureName = "测量数据合格_合格标志_查询";
|
||||
SqlParameter[] thisParms = new SqlParameter[3];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@发动机号", EngineID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@工位号", OPName);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@不合格数", Count_NG);
|
||||
thisParms[2].Direction = ParameterDirection.Output;
|
||||
|
||||
if (DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms))
|
||||
{
|
||||
Count_NG = Convert.ToInt32(thisParms[2].Value.ToString());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 测量数据合格索引_禁用
|
||||
/// </summary>
|
||||
/// <param name="engineID"></param>
|
||||
/// <param name="opName"></param>
|
||||
/// <returns></returns>
|
||||
public static bool BaseData_tagTable_QualityData_B5A_UnUsing
|
||||
(string engineID, string opName)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "测量数据合格索引_禁用";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@EngineID", engineID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 测量数据合格索引_分线数据_删除
|
||||
/// </summary>
|
||||
/// <param name="engineID"></param>
|
||||
/// <param name="opName"></param>
|
||||
/// <returns></returns>
|
||||
public static bool BaseData_tagTable_QualityData_B5A_SubTable_Delete
|
||||
(string engineID,string opName)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "测量数据合格索引_分线数据_删除";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@EngineID", engineID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// alter PROCEDURE [dbo].[测量数据合格_手动拧紧_列位置_增加]
|
||||
///@EngineTypeID int =null,
|
||||
///@EngineType nvarchar(50)=null,
|
||||
///@EngineID nvarchar(100)=null,
|
||||
///@TagValue nvarchar(100)=null,
|
||||
///@合格标志 int=null,
|
||||
///@工位号 nvarchar(50)=null,
|
||||
///@托盘编号 nvarchar(50)=null,
|
||||
///@列位置 int=null,
|
||||
///@变量排序 int=null,
|
||||
///@TagID_CF int=null
|
||||
/// </summary>
|
||||
/// <param name="engineTypeID"></param>
|
||||
/// <param name="engineType"></param>
|
||||
/// <param name="engineID"></param>
|
||||
/// <param name="tagValue"></param>
|
||||
/// <param name="isGoodBad"></param>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="partPallet"></param>
|
||||
/// <param name="shiftID"></param>
|
||||
/// <param name="orderBy"></param>
|
||||
/// <param name="tagID_CF"></param>
|
||||
/// <returns></returns>
|
||||
public static bool BaseData_tagTable_QualityData_B5A_Insert
|
||||
(int engineTypeID,string engineType,string engineID,
|
||||
string tagValue, int isGoodBad,
|
||||
string opName,string partPallet,
|
||||
int shiftID,int orderBy,int tagID_CF
|
||||
)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "测量数据合格_手动拧紧_列位置_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[10];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@EngineTypeID", engineTypeID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@EngineType", engineType);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@EngineID", engineID);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@TagValue", tagValue);
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@合格标志", isGoodBad);
|
||||
thisParms[5] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[6] = new System.Data.SqlClient.SqlParameter("@托盘编号", partPallet);
|
||||
thisParms[7] = new System.Data.SqlClient.SqlParameter("@列位置", shiftID);
|
||||
thisParms[8] = new System.Data.SqlClient.SqlParameter("@变量排序", orderBy);
|
||||
thisParms[9] = new System.Data.SqlClient.SqlParameter("@TagID_CF", tagID_CF);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
/// <summary>
|
||||
/// alter PROCEDURE [dbo].[测量数据合格_手动拧紧_增加]
|
||||
///@EngineTypeID int =null,
|
||||
///@EngineType nvarchar(50)=null,
|
||||
///@EngineID nvarchar(100)=null,
|
||||
///@TagValue nvarchar(100)=null,
|
||||
///@合格标志 int=null,
|
||||
///@工位号 nvarchar(50)=null,
|
||||
///@托盘编号 nvarchar(50)=null,
|
||||
///@TagID int=null,
|
||||
///@TagID_CF int=null
|
||||
/// </summary>
|
||||
/// <param name="engineTypeID"></param>
|
||||
/// <param name="engineType"></param>
|
||||
/// <param name="engineID"></param>
|
||||
/// <param name="tagValue"></param>
|
||||
/// <param name="isGoodBad"></param>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="partPallet"></param>
|
||||
/// <param name="tagID"></param>
|
||||
/// <param name="tagID_CF"></param>
|
||||
/// <returns></returns>
|
||||
public static bool BaseData_tagTable_QualityData_B5A_Insert
|
||||
(int engineTypeID, string engineType, string engineID,
|
||||
string tagValue, int isGoodBad,
|
||||
string opName, string partPallet, int tagID, int tagID_CF)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "测量数据合格_手动拧紧_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[9];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@EngineTypeID", engineTypeID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@EngineType", engineType);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@EngineID", engineID);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@TagValue", tagValue);
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@合格标志", isGoodBad);
|
||||
thisParms[5] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[6] = new System.Data.SqlClient.SqlParameter("@托盘编号", partPallet);
|
||||
thisParms[7] = new System.Data.SqlClient.SqlParameter("@TagID", tagID);
|
||||
thisParms[8] = new System.Data.SqlClient.SqlParameter("@TagID_CF", tagID_CF);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
/// <summary>
|
||||
/// alter PROCEDURE [dbo].[测量数据合格_增加_物料检测]
|
||||
///@EngineTypeID int =null,
|
||||
///@EngineType nvarchar(50)=null,
|
||||
///@EngineID nvarchar(100)=null,
|
||||
///@TagValue nvarchar(100)=null,
|
||||
///@合格标志 int=null,
|
||||
///@工位号 nvarchar(50)=null,
|
||||
///@托盘编号 nvarchar(50)=null,
|
||||
///@TagID int=null,
|
||||
///@TagID_CF int=null
|
||||
/// </summary>
|
||||
/// <param name="engineTypeID"></param>
|
||||
/// <param name="engineType"></param>
|
||||
/// <param name="engineID"></param>
|
||||
/// <param name="tagValue"></param>
|
||||
/// <param name="isGoodBad"></param>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="partPallet"></param>
|
||||
/// <param name="tagID"></param>
|
||||
/// <param name="tagID_CF"></param>
|
||||
/// <returns></returns>
|
||||
public static bool BaseData_tagTable_QualityData_B5A_Insert_MaterialTest
|
||||
(int engineTypeID, string engineType, string engineID,
|
||||
string tagValue, int isGoodBad,
|
||||
string opName, string partPallet, int tagID, int tagID_CF)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "测量数据合格_增加_物料检测";
|
||||
SqlParameter[] thisParms = new SqlParameter[9];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@EngineTypeID", engineTypeID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@EngineType", engineType);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@EngineID", engineID);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@TagValue", tagValue);
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@合格标志", isGoodBad);
|
||||
thisParms[5] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[6] = new System.Data.SqlClient.SqlParameter("@托盘编号", partPallet);
|
||||
thisParms[7] = new System.Data.SqlClient.SqlParameter("@TagID", tagID);
|
||||
thisParms[8] = new System.Data.SqlClient.SqlParameter("@TagID_CF", tagID_CF);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
// /// <summary>
|
||||
// /// 测量数据合格_增加_物料检测
|
||||
// /// </summary>
|
||||
// /// <param name="Id_tagCF"></param>
|
||||
// /// <param name="engineTypeID"></param>
|
||||
// /// <param name="engineID"></param>
|
||||
// /// <param name="tagID"></param>
|
||||
// /// <param name="tagValue"></param>
|
||||
// /// <param name="isGoodBad"></param>
|
||||
// /// <returns></returns>
|
||||
// public static bool BaseData_tagTable_QualityData_B5A_Insert_MaterialTest
|
||||
//(int Id_tagCF, int engineTypeID, string engineID, int tagID, string tagValue, int isGoodBad)
|
||||
// {
|
||||
// string procedureName;
|
||||
// procedureName = "测量数据合格_增加_物料检测";
|
||||
// SqlParameter[] thisParms = new SqlParameter[6];
|
||||
// thisParms[0] = new System.Data.SqlClient.SqlParameter("@Id_tagCF", Id_tagCF);
|
||||
// thisParms[1] = new System.Data.SqlClient.SqlParameter("@EngineTypeID", engineTypeID);
|
||||
// thisParms[2] = new System.Data.SqlClient.SqlParameter("@EngineID", engineID);
|
||||
// thisParms[3] = new System.Data.SqlClient.SqlParameter("@TagID", tagID);
|
||||
// thisParms[4] = new System.Data.SqlClient.SqlParameter("@TagValue", tagValue);
|
||||
// thisParms[5] = new System.Data.SqlClient.SqlParameter("@IsGoodBad", isGoodBad);
|
||||
// return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
// }
|
||||
/// <summary>
|
||||
/// ALTER PROCEDURE [dbo].[电子看板_发动机号_总合格标志_增加]
|
||||
///@工位号 nvarchar(50) = null,
|
||||
///@发动机号 nvarchar(50) = null,
|
||||
///@合格标志 int = 0测量数据合格索引_增加
|
||||
///0合格;1不合格
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="EngineID"></param>
|
||||
/// <param name="isOK"></param>
|
||||
/// <returns></returns>
|
||||
public static bool BaseData_tagTable_Engine_IsOK_Insert
|
||||
(string opName, string EngineID, int isOK)
|
||||
{
|
||||
string procedureName;
|
||||
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("@合格标志", isOK);
|
||||
|
||||
if (DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 测量数据合格索引 合格标志修改-2012-08-23 chenghai
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="EngineID"></param>
|
||||
/// <param name="isOK">0合格;1不合格</param>
|
||||
/// <returns></returns>
|
||||
public static bool BaseData_tagTable_QualityData_B5A_IsOK_update
|
||||
(string opName, string EngineID, int isOK)
|
||||
{
|
||||
string procedureName;
|
||||
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("@合格标志", isOK);
|
||||
|
||||
if (DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ALTER PROCEDURE [dbo].[电子看板_发动机号_总合格标志_查询]
|
||||
///@工位号 nvarchar(50) = null,
|
||||
///@发动机号 nvarchar(50) = null,
|
||||
///@合格标志 int = 0 output
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="EngineID"></param>
|
||||
/// <param name="isOK">0合格;1不合格</param>
|
||||
/// <returns></returns>
|
||||
public static bool BaseData_tagTable_Engine_IsOK_Select
|
||||
(string opName, string EngineID, out int isOK)
|
||||
{
|
||||
isOK = 1;
|
||||
string procedureName;
|
||||
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("@合格标志", isOK);
|
||||
thisParms[2].Direction = ParameterDirection.Output;
|
||||
|
||||
if (DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms))
|
||||
{
|
||||
isOK = Convert.ToInt32(thisParms[2].Value.ToString());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
/// <summary>
|
||||
/// 测量数据合格_发动机返修前数据_合格标志_查询,用于3010工位
|
||||
/// </summary>
|
||||
/// <param name="EngineID">工件号</param>
|
||||
/// <param name="isOK"></param>
|
||||
/// <returns></returns>
|
||||
public static bool TestData_EngineRework_IsOK_Select
|
||||
(string EngineID, out int isOK_M, out int isOK_S)
|
||||
{
|
||||
isOK_M = 1;
|
||||
isOK_S = 1;
|
||||
string procedureName;
|
||||
procedureName = "测量数据合格_发动机返修前数据_合格标志_查询";
|
||||
SqlParameter[] thisParms = new SqlParameter[3];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@发动机号", EngineID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@合格标志_M", isOK_M);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@合格标志_S", isOK_S);
|
||||
thisParms[1].Direction = ParameterDirection.Output;
|
||||
thisParms[2].Direction = ParameterDirection.Output;
|
||||
|
||||
if (DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms))
|
||||
{
|
||||
isOK_M = Convert.ToInt32(thisParms[1].Value.ToString());
|
||||
isOK_S = Convert.ToInt32(thisParms[2].Value.ToString());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 电子看板_发动机号_不合格放行_查询
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="EngineID"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static bool BaseData_tagTable_Engine_IsNG_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);
|
||||
|
||||
if (DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms,out dt))
|
||||
{
|
||||
if (dt != null)
|
||||
{
|
||||
if(dt.Rows.Count==1)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
/// <summary>
|
||||
/// 电子看板_发动机号_不合格放行_增加
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="EngineID"></param>
|
||||
/// <param name="worker"></param>
|
||||
/// <param name="text"></param>
|
||||
/// <returns></returns>
|
||||
public static bool BaseData_tagTable_Engine_IsNG_Insert
|
||||
(string opName, string EngineID, string worker,string text)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "电子看板_发动机号_不合格放行_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[4];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@发动机号", EngineID);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@操作者编号", worker);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@不合格原因", text);
|
||||
|
||||
if (DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
/// <summary>
|
||||
/// 电子看板_发动机号_不合格放行_删除
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="EngineID"></param>
|
||||
/// <returns></returns>
|
||||
public static bool BaseData_tagTable_Engine_IsNG_Delete
|
||||
(string opName, string EngineID)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "电子看板_发动机号_不合格放行_删除";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@发动机号", EngineID);
|
||||
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 电子看板_发动机号_不合格放行_删除_分线线首
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="EngineID"></param>
|
||||
/// <returns></returns>
|
||||
public static bool BaseData_tagTable_Engine_IsNG_Delete_fenxian_xianshou
|
||||
(string opName, string EngineID)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "电子看板_发动机号_不合格放行_删除_分线线首";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@发动机号", EngineID);
|
||||
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 电子看板_零件图号_生产厂家_查询
|
||||
/// </summary>
|
||||
/// <param name="partDrawCode"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static bool MaterialFactory_Select(string partDrawCode,out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "电子看板_零件图号_生产厂家_查询";
|
||||
SqlParameter[] thisParms = new SqlParameter[1];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@零件图号", partDrawCode);
|
||||
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms,out dt);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 派工订单_订单信息_查询
|
||||
/// </summary>
|
||||
/// <param name="partDrawCode"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static bool Get_DataByOrderForm(string OrderForm, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "派工订单_订单信息_查询";
|
||||
SqlParameter[] thisParms = new SqlParameter[1];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@订单号", OrderForm);
|
||||
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt);
|
||||
}
|
||||
/// <summary>
|
||||
/// 电子看板_零件图号_生产厂家_增加
|
||||
/// </summary>
|
||||
/// <param name="partDrawCode"></param>
|
||||
/// <param name="factory"></param>
|
||||
/// <returns></returns>
|
||||
public static bool MaterialFactory_Insert(string partDrawCode,string factory)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "电子看板_零件图号_生产厂家_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@零件图号", partDrawCode);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@生产厂家", factory);
|
||||
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
/// <summary>
|
||||
/// 电子看板_零件图号_生产厂家_修改
|
||||
/// </summary>
|
||||
/// <param name="factoryCode"></param>
|
||||
/// <param name="partDrawCode"></param>
|
||||
/// <param name="factory"></param>
|
||||
/// <returns></returns>
|
||||
public static bool MaterialFactory_Update(int factoryCode, string partDrawCode, string factory)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "电子看板_零件图号_生产厂家_修改";
|
||||
SqlParameter[] thisParms = new SqlParameter[3];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@厂家代码", factoryCode);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@零件图号", partDrawCode);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@生产厂家", factory);
|
||||
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
/// <summary>
|
||||
/// 电子看板_零件图号_生产厂家_删除
|
||||
/// </summary>
|
||||
/// <param name="factoryCode"></param>
|
||||
/// <returns></returns>
|
||||
public static bool MaterialFactory_Delete(int factoryCode)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "电子看板_零件图号_生产厂家_删除";
|
||||
SqlParameter[] thisParms = new SqlParameter[1];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@厂家代码", factoryCode);
|
||||
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
/// <summary>
|
||||
/// [电子看板_发动机号_不合格放行_返修下线_查询]
|
||||
/// </summary>
|
||||
/// <param name="EngineID"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static bool BaseData_tagTable_Engine_IsNG_PartUnLoad_Select
|
||||
(string EngineID, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "电子看板_发动机号_不合格放行_返修下线_查询";
|
||||
SqlParameter[] thisParms = new SqlParameter[1];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@发动机号", EngineID);
|
||||
|
||||
if (DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt))
|
||||
{
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count == 1)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// [电子看板_发动机号_返修下线_查询]-2012-09-14-chenghai 以前只有不合格 才打印工位号
|
||||
/// </summary>
|
||||
/// <param name="EngineID"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static bool BaseData_tagTable_Engine_fanxiu_PartUnLoad_Select
|
||||
(string EngineID, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "电子看板_发动机号_返修下线_查询";
|
||||
SqlParameter[] thisParms = new SqlParameter[1];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@发动机号", EngineID);
|
||||
|
||||
if (DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt))
|
||||
{
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count == 1)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 测量数据合格索引_不合格标志_查询-2012-12-05-kexin OP3024用 打印不合格工位
|
||||
/// </summary>
|
||||
/// <param name="EngineID"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static bool BaseData_tagTable_Engine_buhege_PartUnLoad_Select
|
||||
(string EngineID, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "测量数据合格索引_不合格标志_查询";
|
||||
SqlParameter[] thisParms = new SqlParameter[1];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@发动机号", EngineID);
|
||||
|
||||
if (DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt))
|
||||
{
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count == 1)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// [测量数据合格索引_返修上线信息_查询] OP3024 b6返修上线使用
|
||||
/// </summary>
|
||||
/// <param name="EngineID"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static bool BaseData_Repair_PartUnLoad_Select
|
||||
(string EngineID, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "测量数据合格索引_返修上线信息_查询";
|
||||
SqlParameter[] thisParms = new SqlParameter[1];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@发动机号", EngineID);
|
||||
|
||||
if (DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt))
|
||||
{
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count == 1)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///电子看板_发动机号_人工合格放行记录_增加数据
|
||||
/// </summary>
|
||||
/// <param name="EngineID"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static bool OKGo_Insert
|
||||
(string Opname, string EngineID, string Enginetype,string headernum, string usernum)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "电子看板_发动机号_人工合格放行记录_增加数据";
|
||||
SqlParameter[] thisParms = new SqlParameter[5];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", Opname);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@发动机号", EngineID);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@机型", Enginetype);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@输入领班号", headernum);
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@操作者编号", usernum);
|
||||
if (DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// [显示测量数据_工位号] 王可心 2012-12-06
|
||||
/// </summary>
|
||||
/// <param name="EngineID"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static bool BaseData_tagTable_Engine_ShowOpname
|
||||
(string EngineID, int LineType,out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "显示测量数据_工位号";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@发动机号", EngineID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@固定条形码扫描枪", LineType);
|
||||
|
||||
if (DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt))
|
||||
{
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count == 1)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
/// <summary>
|
||||
/// [显示测量数据_工位数据] 王可心 2012-12-06
|
||||
/// </summary>
|
||||
/// <param name="EngineID"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static bool BaseData_tagTable_Engine_ShowOpname_Data
|
||||
(string EngineID,string OpName,out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "显示测量数据_工位数据";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@发动机号", EngineID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@工位号", OpName);
|
||||
if (DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt))
|
||||
{
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count == 1)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
/// <summary>
|
||||
/// 显示测量数据_工位数据_分线数据 王可心 2012-12-11
|
||||
/// </summary>
|
||||
/// <param name="EngineID"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static bool BaseData_tagTable_Engine_ShowOpname_Data_SubLine
|
||||
(string EngineID, string OpName, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "显示测量数据_工位数据_分线数据";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@发动机号", EngineID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@工位号", OpName);
|
||||
if (DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt))
|
||||
{
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count == 1)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
/// <summary>
|
||||
/// [显示测量数据_工位号_分线] 王可心 2012-12-11
|
||||
/// </summary>
|
||||
/// <param name="EngineID"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static bool BaseData_tagTable_Engine_ShowOpname_SubLine
|
||||
(string EngineID, int LineType, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "显示测量数据_工位号_分线";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@发动机号", EngineID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@固定条形码扫描枪", LineType);
|
||||
|
||||
if (DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt))
|
||||
{
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count == 1)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///[电子看板_发动机号_线首工位_分线删除数据_根据发动机号]
|
||||
/// </summary>
|
||||
/// <param name="factoryCode"></param>
|
||||
/// <returns></returns>
|
||||
public static bool BaseData_tagTable_Engine_SubLine_DataDelete(string EngineID, string OpName)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "电子看板_发动机号_线首工位_分线删除数据_根据发动机号";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@发动机号", EngineID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@工位号_分线", OpName);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
|
||||
//2012-12-15 王可心
|
||||
/// <summary>
|
||||
/// [测量数据合格_变速器总成称重_根据发动机号_删除]
|
||||
/// </summary>
|
||||
/// <param name="engineID"></param>
|
||||
/// <returns></returns>
|
||||
public static bool BaseData_tagTable_QualityData_B5A_Weight_Delete
|
||||
(string engineID)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "测量数据合格_变速器总成称重_根据发动机号_删除";
|
||||
SqlParameter[] thisParms = new SqlParameter[1];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@发动机号", engineID);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// [测量数据合格索引_不合格标志_OP3100_查询] 用于3100工位 2012-12-21
|
||||
/// </summary>
|
||||
/// <param name="EngineID">工件号</param>
|
||||
/// <param name="isOK_S"></param>
|
||||
/// <returns>合格返回true 不合格返回false</returns>
|
||||
public static bool TestData_EngineRework_IsOK_Select_OP3100
|
||||
(string EngineID)
|
||||
{
|
||||
|
||||
int isOK_S = 1;
|
||||
string procedureName;
|
||||
procedureName = "测量数据合格索引_不合格标志_OP3100_查询";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@发动机号", EngineID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@数量", isOK_S);
|
||||
|
||||
thisParms[1].Direction = ParameterDirection.Output;
|
||||
|
||||
|
||||
if (DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms))
|
||||
{
|
||||
isOK_S = Convert.ToInt32(thisParms[1].Value.ToString());
|
||||
if (isOK_S == 0)
|
||||
{ return true; }
|
||||
else
|
||||
{
|
||||
return false; }
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 测量数据合格索引 合格标志修改-2012-12-22 王可心 应用于OP3020R
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="EngineID"></param>
|
||||
/// <param name="isOK">0合格;1不合格</param>
|
||||
/// <returns></returns>
|
||||
public static bool BaseData_tagTable_QualityData_B5A_IsOK_OP3020_update
|
||||
(string opName, string EngineID, int isOK)
|
||||
{
|
||||
string procedureName;
|
||||
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("@合格标志", isOK);
|
||||
|
||||
if (DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// [测量数据合格索引_不合格标志_轴齿上线_查询] 王可心 2012-12-23 轴齿上线匹配时 分线工件合格标志查询
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="EngineID"></param>
|
||||
/// <param name="isOK">0合格;1不合格</param>
|
||||
/// <returns></returns>
|
||||
public static bool BaseData_tagTable_Engine_IsOK_SubLine_Select
|
||||
(string EngineID, int mathType,out int CountNum)
|
||||
{
|
||||
CountNum = 0;
|
||||
string procedureName;
|
||||
procedureName = "测量数据合格索引_不合格标志_轴齿上线_查询";
|
||||
SqlParameter[] thisParms = new SqlParameter[3];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@发动机号", EngineID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@匹配方式", mathType);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@数量", CountNum);
|
||||
thisParms[2].Direction = ParameterDirection.Output;
|
||||
|
||||
if (DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms))
|
||||
{
|
||||
CountNum = Convert.ToInt32(thisParms[2].Value.ToString());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// [测量数据发动机在线状态_下线工位_OP3100_查询]2012-12-30-王可心 OP3100用 下线时查看该工件以前是否进行过下线
|
||||
/// </summary>
|
||||
/// <param name="EngineID">发动机号</param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns>以前下线过返回true ,否则返回false</returns>
|
||||
static public void BaseData_tagTable_Engine_PartUnLoad_Select_OP3100(string EngineID, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "测量数据发动机在线状态_下线工位_OP3100_查询";
|
||||
SqlParameter[] thisParms = new SqlParameter[1];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@发动机号", EngineID);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///电子看板_发动机号_线首工位_查询发动机号 王可心 2013-11-07
|
||||
/// </summary>
|
||||
/// <param name="EngineID"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static bool EngineNum_Select(DateTime BeginTime, DateTime EndTime, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "电子看板_发动机号_线首工位_查询发动机号";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@开始时间", BeginTime);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@结束时间", EndTime);
|
||||
if (DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt))
|
||||
{
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count == 1)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,247 @@
|
||||
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>
|
||||
/// 测量数据合格索引_增加
|
||||
/// 用于B5A项目
|
||||
/// ALTER PROCEDURE [dbo].[测量数据合格索引_增加]
|
||||
///@EngineID nvarchar(50)=null,
|
||||
///@TagID_CF int = null,
|
||||
///@EngineType nvarchar(50)=null,
|
||||
///@EngineTypeID int = null,
|
||||
///@工位号 nvarchar(50)=null,
|
||||
///@订单号 nvarchar(50)=null,
|
||||
///@合格标志 int=null,
|
||||
///@TagValue1 nvarchar(50)=null,
|
||||
///@TagValue2 nvarchar(50)=null,
|
||||
///@TagValue3 nvarchar(50)=null,
|
||||
///@TagValue4 nvarchar(50)=null,
|
||||
///@TagValue5 nvarchar(50)=null,
|
||||
///@TagValue6 nvarchar(50)=null,
|
||||
///@TagValue7 nvarchar(50)=null,
|
||||
///@TagValue8 nvarchar(50)=null,
|
||||
///@TagValue9 nvarchar(50)=null,
|
||||
///@TagValue10 nvarchar(50)=null,
|
||||
///@TagValue nvarchar(50)=null,
|
||||
///@Id_tagCF int=null output
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static bool BaseData_tagTable_QualityData_B5A_IndexInsert
|
||||
(string EngineID, int tagID, string EngineType, int EngineTypeID, string opName,
|
||||
int isGoodBad,string PartPalletCode, out int Id_tagCF)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "测量数据合格索引_增加";
|
||||
Id_tagCF = 0;
|
||||
SqlParameter[] thisParms = new SqlParameter[8];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@EngineID", EngineID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@TagID_CF", tagID);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@EngineType", EngineType);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@EngineTypeID", EngineTypeID);
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[5] = new System.Data.SqlClient.SqlParameter("@托盘编号", PartPalletCode);
|
||||
thisParms[6] = new System.Data.SqlClient.SqlParameter("@合格标志", isGoodBad);
|
||||
thisParms[7] = new System.Data.SqlClient.SqlParameter("@Id_tagCF", Id_tagCF);
|
||||
thisParms[7].Direction = ParameterDirection.Output;
|
||||
|
||||
if (DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms))
|
||||
{
|
||||
Id_tagCF = Convert.ToInt32(thisParms[7].Value.ToString());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// alter PROCEDURE dbo.[测量数据合格_增加]
|
||||
///@Id_tagCF int = null,
|
||||
///@EngineTypeID int =null,
|
||||
///@EngineID nvarchar(100)=null,
|
||||
///@TagID int=null,
|
||||
///@TagValue nvarchar(100)=null,
|
||||
///@IsGoodBad int=null,
|
||||
/// </summary>
|
||||
/// <param name="Id_tagCF"></param>
|
||||
/// <param name="engineTypeID"></param>
|
||||
/// <param name="engineID"></param>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="dt"></param>
|
||||
public static bool BaseData_tagTable_QualityData_B5A_Insert
|
||||
(int Id_tagCF,int engineTypeID,string engineID,string opName,DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "测量数据合格_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[6];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@Id_tagCF", Id_tagCF);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@EngineTypeID", engineTypeID);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@EngineID", engineID);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@TagID", SqlDbType.Int, 4, "TagID");
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@TagValue", SqlDbType.NVarChar, 100, "TagValue");
|
||||
thisParms[5] = new System.Data.SqlClient.SqlParameter("@IsGoodBad", SqlDbType.Int, 4, "IsGoodBad");
|
||||
//thisParms[6] = new System.Data.SqlClient.SqlParameter("@测量位置", SqlDbType.NVarChar, 50, "测量位置");
|
||||
//thisParms[7] = new System.Data.SqlClient.SqlParameter("@测量项目", SqlDbType.NVarChar, 50, "测量项目");
|
||||
//thisParms[8] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
//thisParms[9] = new System.Data.SqlClient.SqlParameter("@理论值", SqlDbType.NVarChar, 50, "理论值");
|
||||
//thisParms[10] = new System.Data.SqlClient.SqlParameter("@上限值", SqlDbType.NVarChar, 50, "上限值");
|
||||
//thisParms[11] = new System.Data.SqlClient.SqlParameter("@下限值", SqlDbType.NVarChar, 50, "下限值");
|
||||
//thisParms[12] = new System.Data.SqlClient.SqlParameter("@测量单位", SqlDbType.NVarChar, 50, "测量单位");
|
||||
//thisParms[13] = new System.Data.SqlClient.SqlParameter("@列位置", SqlDbType.Int, 4, "列位置");
|
||||
//thisParms[14] = new System.Data.SqlClient.SqlParameter("@变量排序", SqlDbType.Int, 4, "变量排序");
|
||||
//table.Columns.Add("TagID", typeof(System.Int32));
|
||||
//table.Columns.Add("TagValue", typeof(System.String));
|
||||
//table.Columns.Add("IsGoodBad", typeof(System.Int32));
|
||||
//table.Columns.Add("测量位置", typeof(System.String));
|
||||
//table.Columns.Add("测量项目", typeof(System.String));
|
||||
//table.Columns.Add("工位号", typeof(System.String));
|
||||
//table.Columns.Add("理论值", typeof(System.String));
|
||||
//table.Columns.Add("上限值", typeof(System.String));
|
||||
//table.Columns.Add("下限值", typeof(System.String));
|
||||
//table.Columns.Add("测量单位", typeof(System.String));
|
||||
//table.Columns.Add("列位置", typeof(System.Int32));
|
||||
//table.Columns.Add("变量排序", typeof(System.Int32));
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, dt);
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="Id_tagCF"></param>
|
||||
/// <param name="engineTypeID"></param>
|
||||
/// <param name="engineID"></param>
|
||||
/// <param name="tagID"></param>
|
||||
/// <param name="tagValue"></param>
|
||||
/// <param name="isGoodBad"></param>
|
||||
/// <returns></returns>
|
||||
public static bool BaseData_tagTable_QualityData_B5A_Insert
|
||||
(int Id_tagCF, int engineTypeID, string engineID,int tagID,string tagValue,int isGoodBad)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "测量数据合格_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[6];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@Id_tagCF", Id_tagCF);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@EngineTypeID", engineTypeID);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@EngineID", engineID);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@TagID", tagID);
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@TagValue", tagValue);
|
||||
thisParms[5] = new System.Data.SqlClient.SqlParameter("@IsGoodBad", isGoodBad);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
|
||||
//2012-12-12 离线状态时 只保存合格索引
|
||||
/// <summary>
|
||||
/// 测量数据合格索引_增加_工位离线状态 2012-12-26
|
||||
/// 用于B5A项目
|
||||
/// ALTER PROCEDURE [dbo].[测量数据合格索引_增加_工位离线状态]
|
||||
///@EngineID nvarchar(50)=null,
|
||||
///@TagID_CF int = null,
|
||||
///@EngineType nvarchar(50)=null,
|
||||
///@EngineTypeID int = null,
|
||||
///@工位号 nvarchar(50)=null,
|
||||
///@订单号 nvarchar(50)=null,
|
||||
///@合格标志 int=null,
|
||||
///@TagValue1 nvarchar(50)=null,
|
||||
///@TagValue2 nvarchar(50)=null,
|
||||
///@TagValue3 nvarchar(50)=null,
|
||||
///@TagValue4 nvarchar(50)=null,
|
||||
///@TagValue5 nvarchar(50)=null,
|
||||
///@TagValue6 nvarchar(50)=null,
|
||||
///@TagValue7 nvarchar(50)=null,
|
||||
///@TagValue8 nvarchar(50)=null,
|
||||
///@TagValue9 nvarchar(50)=null,
|
||||
///@TagValue10 nvarchar(50)=null,
|
||||
///@TagValue nvarchar(50)=null,
|
||||
///@Id_tagCF int=null output
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static bool BaseData_tagTable_QualityData_B5A_IndexInsert_OffLine
|
||||
(string EngineID, int tagID, string EngineType, int EngineTypeID, string opName,
|
||||
int isGoodBad, string PartPalletCode, out int Id_tagCF)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "测量数据合格索引_增加_工位离线状态";
|
||||
Id_tagCF = 0;
|
||||
SqlParameter[] thisParms = new SqlParameter[8];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@EngineID", EngineID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@TagID_CF", tagID);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@EngineType", EngineType);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@EngineTypeID", EngineTypeID);
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[5] = new System.Data.SqlClient.SqlParameter("@托盘编号", PartPalletCode);
|
||||
thisParms[6] = new System.Data.SqlClient.SqlParameter("@合格标志", isGoodBad);
|
||||
thisParms[7] = new System.Data.SqlClient.SqlParameter("@Id_tagCF", Id_tagCF);
|
||||
thisParms[7].Direction = ParameterDirection.Output;
|
||||
|
||||
if (DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms))
|
||||
{
|
||||
Id_tagCF = Convert.ToInt32(thisParms[7].Value.ToString());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//2012-12-16
|
||||
/// <summary>
|
||||
/// [测量数据合格索引_增加_只装配物料工位]
|
||||
/// 用于B5A项目
|
||||
/// ALTER PROCEDURE [dbo].[[测量数据合格索引_增加_只装配物料工位]]
|
||||
///@EngineID nvarchar(50)=null,
|
||||
///@TagID_CF int = null,
|
||||
///@EngineType nvarchar(50)=null,
|
||||
///@EngineTypeID int = null,
|
||||
///@工位号 nvarchar(50)=null,
|
||||
///@托盘编号 nvarchar(50)=null,
|
||||
///@合格标志 int=null,
|
||||
///@TagValue1 nvarchar(50)=null,
|
||||
///@TagValue2 nvarchar(50)=null,
|
||||
///@TagValue3 nvarchar(50)=null,
|
||||
///@TagValue4 nvarchar(50)=null,
|
||||
///@TagValue5 nvarchar(50)=null,
|
||||
///@TagValue6 nvarchar(50)=null,
|
||||
///@TagValue7 nvarchar(50)=null,
|
||||
///@TagValue8 nvarchar(50)=null,
|
||||
///@TagValue9 nvarchar(50)=null,
|
||||
///@TagValue10 nvarchar(50)=null,
|
||||
///@TagValue nvarchar(50)=null,
|
||||
///@Id_tagCF int=null output
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static bool BaseData_tagTable_QualityData_B5A_IndexInsert_OnlyMaterial
|
||||
(string EngineID, int tagID, string EngineType, int EngineTypeID, string opName,
|
||||
int isGoodBad, string PartPalletCode, out int Id_tagCF)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "测量数据合格索引_增加_只装配物料工位";
|
||||
Id_tagCF = 0;
|
||||
SqlParameter[] thisParms = new SqlParameter[8];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@EngineID", EngineID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@TagID_CF", tagID);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@EngineType", EngineType);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@EngineTypeID", EngineTypeID);
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[5] = new System.Data.SqlClient.SqlParameter("@托盘编号", PartPalletCode);
|
||||
thisParms[6] = new System.Data.SqlClient.SqlParameter("@合格标志", isGoodBad);
|
||||
thisParms[7] = new System.Data.SqlClient.SqlParameter("@Id_tagCF", Id_tagCF);
|
||||
thisParms[7].Direction = ParameterDirection.Output;
|
||||
|
||||
if (DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms))
|
||||
{
|
||||
//Id_tagCF = Convert.ToInt32(thisParms[7].Value.ToString());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,162 @@
|
||||
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>
|
||||
/// 测量数据项目
|
||||
/// 用于B5A项目
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static DataTable BaseData_tagTable_QualityData_Item_B5A()
|
||||
{
|
||||
DataTable dt;
|
||||
string sql;
|
||||
sql = "SELECT TagID,0 as TagValue,TagName,工位号,数据来源,TagTypeID,TagLong,列位置,测量位置,变量类型代码,测量项目,TagAdr,TagAdrDemo,变量特点,变量排序 FROM [MES_基本变量_原始数据] "
|
||||
+ " where (TagID <> 0 ) and "
|
||||
+ " ((变量类型代码 = 9) "
|
||||
+ " or (变量类型代码 = 10) "
|
||||
+ " or (变量类型代码 = 11) "
|
||||
+ " or (变量类型代码 = 80) "
|
||||
+ " or (变量类型代码 = 101) "
|
||||
+ " or (变量类型代码 = 102) "
|
||||
|
||||
+ " or (变量类型代码 = 78) "
|
||||
+ " or (变量类型代码 = 79) "
|
||||
+ " or (变量类型代码 = 41) "
|
||||
+ " or (变量类型代码 = 51) "
|
||||
+ " or (变量类型代码 = 8) "
|
||||
+ " or (变量类型代码 = 21) "
|
||||
|
||||
+ " or (变量类型代码 = 105)) "
|
||||
+ " and (是否启用 = 1)";
|
||||
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
return dt;
|
||||
}
|
||||
/// <summary>
|
||||
/// 测量工位
|
||||
/// 变量特点=1001需要自动测量工位
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static DataTable BaseData_tagTable_QualityData_OpName_B5A()
|
||||
{
|
||||
DataTable dt;
|
||||
string sql = "SELECT distinct 工位号 as 工位代码,[工位号] FROM [MES_基本变量_原始数据] "
|
||||
+ " where ((变量类型代码 >= 19 and 变量类型代码 <= 24) or (变量类型代码 = 101) or (变量类型代码 = 102)) and (是否启用 = 1) and (变量特点=1001)";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
return dt;
|
||||
}
|
||||
/// <summary>
|
||||
/// 变量特点=1001需要自动测量工位
|
||||
/// sql = "SELECT TagID,0 as TagValue,TagName,工位号,TagTypeID,TagLong,列位置,测量位置,变量类型代码,测量项目,TagAdr,TagAdrDemo "
|
||||
/// + " FROM MES_基本变量_原始数据 "
|
||||
/// + " where 变量类型代码 = 19 and 是否启用 = 1 and 变量特点=8 ";
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static DataTable BaseData_tagTable_QualityData_Read_CF_MIS_B5A()
|
||||
{
|
||||
DataTable dt;
|
||||
string sql;
|
||||
sql = "SELECT TagID,0 as TagValue,TagName,工位号,数据来源,TagTypeID,TagLong,列位置,测量位置,变量类型代码,测量项目,TagAdr,TagAdrDemo,变量特点,变量排序 "
|
||||
+ " FROM MES_基本变量_原始数据 "
|
||||
+ " where 变量类型代码 = 19 and 是否启用 = 1 and (变量特点=1001 )";
|
||||
// + " and OpcServer_OPNAME='" + opName + "'";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
return dt;
|
||||
}
|
||||
/// <summary>
|
||||
/// 质量数据保存完数据 20
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static DataTable BaseData_tagTable_QualityData_Write_CF_B5A()
|
||||
{
|
||||
DataTable dt;
|
||||
string sql;
|
||||
sql = "SELECT TagID,0 as TagValue,TagName,工位号,数据来源,TagTypeID,TagLong,列位置,测量位置,变量类型代码,测量项目,TagAdr,TagAdrDemo,变量特点,变量排序 FROM [MES_基本变量_原始数据] where 变量类型代码 = 20 and 是否启用 = 1 and (变量特点=1001) ";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
return dt;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 测量数据项目
|
||||
/// 用于B5A项目
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static DataTable BaseData_tagTable_QualityData_Item_B5A(string opName)
|
||||
{
|
||||
DataTable dt;
|
||||
string sql;
|
||||
sql = "SELECT TagID,0 as TagValue,TagName,工位号,数据来源,TagTypeID,TagLong,列位置,测量位置,变量类型代码,测量项目,TagAdr,TagAdrDemo,变量特点,变量排序 FROM [MES_基本变量_原始数据] "
|
||||
+ " where (TagID <> 0 ) and "
|
||||
+ " ((变量类型代码 = 9) "
|
||||
+ " or (变量类型代码 = 10) "
|
||||
+ " or (变量类型代码 = 11) "
|
||||
+ " or (变量类型代码 = 101) "
|
||||
+ " or (变量类型代码 = 102) "
|
||||
+ " or (变量类型代码 = 105)) "
|
||||
+ " and (是否启用 = 1)"
|
||||
+ " and (工位号 = '"+opName+"')";
|
||||
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
return dt;
|
||||
}
|
||||
/// <summary>
|
||||
/// 测量工位
|
||||
/// 变量特点=1001自动测量工位
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static DataTable BaseData_tagTable_QualityData_OpName_B5A(string opName)
|
||||
{
|
||||
DataTable dt;
|
||||
string sql = "SELECT distinct 工位号 as 工位代码,[工位号] FROM [MES_基本变量_原始数据] "
|
||||
+ " where ((变量类型代码 >= 19 and 变量类型代码 <= 24) or (变量类型代码 = 101) or (变量类型代码 = 102)) and (是否启用 = 1) "
|
||||
+ " and 工位号 = '" + opName+"'";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
return dt;
|
||||
}
|
||||
/// <summary>
|
||||
/// sql = "SELECT TagID,0 as TagValue,TagName,工位号,TagTypeID,TagLong,列位置,测量位置,变量类型代码,测量项目,TagAdr,TagAdrDemo "
|
||||
/// + " FROM MES_基本变量_原始数据 "
|
||||
/// + " where 变量类型代码 = 19 and 是否启用 = 1 and 变量特点=8 ";
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static DataTable BaseData_tagTable_QualityData_Read_CF_MIS_B5A(string opName)
|
||||
{
|
||||
DataTable dt;
|
||||
string sql;
|
||||
sql = "SELECT TagID,0 as TagValue,TagName,工位号,数据来源,TagTypeID,TagLong,列位置,测量位置,变量类型代码,测量项目,TagAdr,TagAdrDemo,变量特点,变量排序 "
|
||||
+ " FROM MES_基本变量_原始数据 "
|
||||
+ " where 变量类型代码 = 19 and 是否启用 = 1 "
|
||||
+ " and 工位号 = '" + opName + "'";
|
||||
;
|
||||
// + " and OpcServer_OPNAME='" + opName + "'";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
return dt;
|
||||
}
|
||||
/// <summary>
|
||||
/// 质量数据保存完数据
|
||||
/// 20
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static DataTable BaseData_tagTable_QualityData_Write_CF_B5A(string opName)
|
||||
{
|
||||
DataTable dt;
|
||||
string sql;
|
||||
sql = "SELECT TagID,0 as TagValue,TagName,工位号,数据来源,TagTypeID,TagLong,列位置,测量位置,变量类型代码,测量项目,TagAdr,TagAdrDemo,变量特点,变量排序 FROM [MES_基本变量_原始数据] where 变量类型代码 = 20 and 是否启用 = 1 "
|
||||
+ " and 工位号 = '" + opName + "'";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
return dt;
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,40 @@
|
||||
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="shiftCode">@班次代码</param>
|
||||
/// <param name="opNameTime">@工位节拍</param>
|
||||
/// <param name="currentTime">@当前时间</param>
|
||||
/// <param name="opNameCount">@工位产量</param>
|
||||
static public void OpNameCount(int shiftCode,int opNameTime,DateTime currentTime,out int opNameCount)
|
||||
{
|
||||
//exec 电子看板_工作时间与班次_工作时间 1,45,'2011-11-30 13:11:00', @工位产量 out
|
||||
opNameCount = 0;
|
||||
string procedureName;
|
||||
procedureName = "电子看板_工作时间与班次_工作时间";
|
||||
SqlParameter[] thisParmsSql = new SqlParameter[4];
|
||||
thisParmsSql[0] = new SqlParameter("@班次代码", shiftCode);
|
||||
thisParmsSql[1] = new SqlParameter("@工位节拍", opNameTime);
|
||||
thisParmsSql[2] = new SqlParameter("@当前时间", currentTime);
|
||||
thisParmsSql[3] = new SqlParameter("@工位产量", opNameCount);
|
||||
thisParmsSql[3].Direction = ParameterDirection.Output;
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParmsSql);
|
||||
|
||||
opNameCount = Convert.ToInt32(thisParmsSql[3].Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
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="engineID"></param>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="dt"></param>
|
||||
static public void GetOpNameRepairData(string engineID,string opName,out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "测量数据合格_返修工位_查询";
|
||||
SqlParameter[] thisParmsSql = new SqlParameter[2];
|
||||
thisParmsSql[0] = new SqlParameter("@EngineID", engineID);
|
||||
thisParmsSql[1] = new SqlParameter("@工位号", opName);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParmsSql, out dt);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,203 @@
|
||||
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 ShaftPosition
|
||||
{
|
||||
/// <summary>
|
||||
/// 电子看板_工位机型_质量数据测量位置_查询_工作顺序
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="engineTypeID"></param>
|
||||
/// <param name="dt"></param>
|
||||
static public void ShaftPosition_Select_WorkingStep(string opName, int engineTypeID, out DataTable dt)
|
||||
{
|
||||
dt = null;
|
||||
|
||||
string sql = "exec 电子看板_工位机型_质量数据测量位置_查询_工作顺序 '" + opName + "'," + engineTypeID.ToString();
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 电子看板_工位机型_质量数据测量位置_查询
|
||||
/// </summary>
|
||||
/// <param name="opName">工位号</param>
|
||||
/// <param name="engineTypeID">产品型号代码</param>
|
||||
/// <param name="dt"></param>
|
||||
static public void ShaftPosition_Select(string opName,int engineTypeID,out DataTable dt)
|
||||
{
|
||||
dt = null;
|
||||
|
||||
string sql = "exec 电子看板_工位机型_质量数据测量位置_查询 '" + opName + "'," + engineTypeID.ToString();
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
}
|
||||
/// <summary>
|
||||
/// 电子看板_装配零件_查询
|
||||
/// </summary>
|
||||
/// <param name="opName">工位号</param>
|
||||
/// <param name="engineType">产品型号代码</param>
|
||||
/// <param name="engineTypeID">产品型号代码</param>
|
||||
/// <param name="dt"></param>
|
||||
static public void Material_Select(string opName, string engineTypeID, string engineType, out DataTable dt)
|
||||
{
|
||||
dt = null;
|
||||
string sql = "exec 电子看板_装配零件_查询 '" + opName + "'," + engineTypeID.ToString() + ",'" + engineType + "'"; ;
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
}
|
||||
/// <summary>
|
||||
/// 电子看板_装配零件_查询
|
||||
/// </summary>
|
||||
/// <param name="opName">工位号</param>
|
||||
/// <param name="engineTypeID">产品型号代码</param>
|
||||
/// <param name="dt"></param>
|
||||
static public void Material_Select_1(string opName, int engineTypeID, out DataTable dt)
|
||||
{
|
||||
dt = null;
|
||||
|
||||
string sql = "exec 电子看板_装配零件_查询 '" + opName + "'," + engineTypeID.ToString() ;
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
}
|
||||
/// <summary>
|
||||
/// 电子看板_工序内容_查询
|
||||
/// </summary>
|
||||
/// <param name="opName">工位号</param>
|
||||
/// <param name="engineTypeID">产品型号代码</param>
|
||||
/// <param name="dt"></param>
|
||||
static public void Process_Select(string opName, int engineTypeID, out DataTable dt)
|
||||
{
|
||||
dt = null;
|
||||
|
||||
string sql = "exec 电子看板_工序内容_查询 '" + opName + "'," + engineTypeID.ToString();
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
}
|
||||
/// <summary>
|
||||
/// 电子看板_工序内容_查询
|
||||
/// </summary>
|
||||
/// <param name="opName">工位号</param>
|
||||
/// <param name="engineTypeID">产品型号代码</param>
|
||||
/// <param name="dt"></param>
|
||||
static public void Process_Select_NeedDealWith(string opName, int engineTypeID, out DataTable dt)
|
||||
{
|
||||
dt = null;
|
||||
|
||||
string sql = "exec 电子看板_工序内容_查询_需要处理 '" + opName + "'," + engineTypeID.ToString();
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
}
|
||||
/// <summary>
|
||||
/// MES_基本变量_机型代码_查询
|
||||
/// </summary>
|
||||
/// <param name="dt"></param>
|
||||
static public void EngineType_Select(out DataTable dt)
|
||||
{
|
||||
dt = null;
|
||||
string sql = "exec MES_基本变量_机型代码_查询";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 电子看板_MES_基本变量_原始数据_更新测量数据
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="engineTypeID"></param>
|
||||
/// <param name="shaftNo"></param>
|
||||
/// <param name="value1"></param>
|
||||
/// <param name="value2"></param>
|
||||
/// <param name="value3"></param>
|
||||
/// <param name="value4"></param>
|
||||
static public void ShaftDataUpdate(string opName, string engineTypeID, string shaftNo, string value1, string value2, string value3, string value4)
|
||||
{
|
||||
|
||||
string sql = "exec 电子看板_MES_基本变量_原始数据_更新测量数据 ";
|
||||
sql = sql + " '" + opName + "',";
|
||||
sql = sql + " '" + engineTypeID + "',";
|
||||
sql = sql + " " + shaftNo.ToString() + ",";
|
||||
sql = sql + " '" + value1 + "',";
|
||||
sql = sql + " '" + value2 + "',";
|
||||
sql = sql + " '" + value3 + "',";
|
||||
sql = sql + " " + value4.ToString() +"";
|
||||
DataAccess.ExecuteSQL(sql);
|
||||
}
|
||||
/// <summary>
|
||||
/// 电子看板_MES_基本变量_原始数据_清零测量数据
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
static public void ShaftDataClear(string opName)
|
||||
{
|
||||
|
||||
string sql = "exec 电子看板_MES_基本变量_原始数据_更新测量数据 ";
|
||||
sql = sql + " '" + opName + "'";
|
||||
DataAccess.ExecuteSQL(sql);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 电子看板_MES_基本变量_原始数据_增加测量数据
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="engineID"></param>
|
||||
/// <param name="engineType"></param>
|
||||
/// <param name="engineTypeID"></param>
|
||||
/// <param name="isGood"></param>
|
||||
/// <param name="dateTime"></param>
|
||||
static public void ShaftDataInsert(string opName, string engineID, string engineType, string engineTypeID,
|
||||
string isGood, string dateTime)
|
||||
{
|
||||
|
||||
string sql = "exec 电子看板_MES_基本变量_原始数据_增加测量数据 ";
|
||||
sql = sql + " '" + opName + "',";
|
||||
sql = sql + " '" + engineID + "',";
|
||||
sql = sql + " '" + engineType + "',";
|
||||
sql = sql + " " + engineTypeID + ",";
|
||||
sql = sql + " " + isGood + ",";
|
||||
sql = sql + " '" + dateTime + "'";
|
||||
DataAccess.ExecuteSQL(sql);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// [电子看板_工位机型_质量数据测量位置_查询_OP3010] 2012-12-13
|
||||
/// </summary>
|
||||
/// <param name="opName">工位号</param>
|
||||
/// <param name="engineTypeID">产品型号代码</param>
|
||||
/// <param name="dt"></param>
|
||||
static public void ShaftPosition_Select_OP3010(string opName, int engineTypeID,int IsUsing ,out DataTable dt)
|
||||
{
|
||||
dt = null;
|
||||
|
||||
string sql = "exec 电子看板_工位机型_质量数据测量位置_查询_OP3010 '" + opName + "','" + engineTypeID.ToString() + "','" + IsUsing+ "'";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
}
|
||||
/// <summary>
|
||||
/// [电子看板_工位机型_质量数据测量位置_查询_工作顺序_OP3010] 2012-12-13
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="engineTypeID"></param>
|
||||
/// <param name="dt"></param>
|
||||
static public void ShaftPosition_Select_WorkingStep_OP3010(string opName, int engineTypeID,int IsUsing, out DataTable dt)
|
||||
{
|
||||
dt = null;
|
||||
string sql = "exec 电子看板_工位机型_质量数据测量位置_查询_工作顺序_OP3010 '" + opName + "','" + engineTypeID.ToString() + "','" + IsUsing + "'";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// [MES_操作者_用户_显示_查询] 2013-01-23 王可心 用户名增加用
|
||||
/// </summary>
|
||||
/// <param name="dt"></param>
|
||||
static public void UserName_Select(out DataTable dt)
|
||||
{
|
||||
dt = null;
|
||||
string sql = "exec MES_操作者_用户_显示_查询 ";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,199 @@
|
||||
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 ShaftPosition
|
||||
{
|
||||
/// <summary>
|
||||
/// 测量数据合格_电子看板_质量数据_临时表_增加_返修工位
|
||||
/// @EngineID nvarchar(50)=null,
|
||||
/// @EngineType nvarchar(50)=null,
|
||||
/// @EngineTypeID int = null,
|
||||
/// @工位号 nvarchar(50)=null,
|
||||
/// @工位号返修工位 nvarchar(50)=null,
|
||||
/// @订单号 nvarchar(50)=null,
|
||||
/// @合格标志 int
|
||||
/// </summary>
|
||||
/// <param name="engineID">工件号</param>
|
||||
/// <param name="engineType">机型</param>
|
||||
/// <param name="engineTypeID">机型代码</param>
|
||||
/// <param name="opName">工位号(被返修的工位号)</param>
|
||||
/// <param name="opNameRepair">工位号返修工位</param>
|
||||
/// <param name="orderForm">订单号</param>
|
||||
/// <param name="isOK">合格标志</param>
|
||||
static public void ShaftPosition_Data_OpNameRepair_Insert(string engineID, string engineType, int engineTypeID, string opName, string opNameRepair,string orderForm, int isOK)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "测量数据合格_电子看板_质量数据_临时表_增加_返修工位";
|
||||
SqlParameter[] thisParmsSql = new SqlParameter[7];
|
||||
thisParmsSql[0] = new SqlParameter("@EngineID", engineID);
|
||||
thisParmsSql[1] = new SqlParameter("@EngineType", engineType);
|
||||
thisParmsSql[2] = new SqlParameter("@EngineTypeID", engineTypeID);
|
||||
thisParmsSql[3] = new SqlParameter("@工位号", opName);
|
||||
thisParmsSql[4] = new SqlParameter("@工位号返修工位", opNameRepair);
|
||||
thisParmsSql[5] = new SqlParameter("@订单号", orderForm);
|
||||
thisParmsSql[6] = new SqlParameter("@合格标志", isOK);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParmsSql);
|
||||
}
|
||||
/// <summary>
|
||||
/// 测量数据合格_电子看板_质量数据_临时表_增加
|
||||
/// @EngineID nvarchar(50)=null,
|
||||
/// @EngineType nvarchar(50)=null,
|
||||
/// @EngineTypeID int = null,
|
||||
/// @工位号 nvarchar(50)=null,
|
||||
/// @订单号 nvarchar(50)=null,
|
||||
/// @合格标志 int
|
||||
/// </summary>
|
||||
/// <param name="engineID">工件号</param>
|
||||
/// <param name="engineType">机型</param>
|
||||
/// <param name="engineTypeID">机型代码</param>
|
||||
/// <param name="opName">工位号</param>
|
||||
/// <param name="orderForm">订单号</param>
|
||||
/// <param name="isOK">合格标志</param>
|
||||
static public void ShaftPosition_Data_Insert(string engineID, string engineType, int engineTypeID, string opName, string orderForm, int isOK)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "测量数据合格_电子看板_质量数据_临时表_增加";
|
||||
SqlParameter[] thisParmsSql = new SqlParameter[6];
|
||||
thisParmsSql[0] = new SqlParameter("@EngineID", engineID);
|
||||
thisParmsSql[1] = new SqlParameter("@EngineType", engineType);
|
||||
thisParmsSql[2] = new SqlParameter("@EngineTypeID", engineTypeID);
|
||||
thisParmsSql[3] = new SqlParameter("@工位号", opName);
|
||||
thisParmsSql[4] = new SqlParameter("@订单号", orderForm);
|
||||
thisParmsSql[5] = new SqlParameter("@合格标志", isOK);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParmsSql);
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="shaftStep"></param>
|
||||
/// <param name="engineID"></param>
|
||||
/// <param name="engineType"></param>
|
||||
/// <param name="engineTypeID"></param>
|
||||
/// <param name="orderBy"></param>
|
||||
/// <param name="tagValue"></param>
|
||||
/// <param name="isOK"></param>
|
||||
static public void ShaftPosition_Data_Insert_RepairOpName(string opName, int shaftStep, string engineID, string engineType, int engineTypeID, int orderBy, string tagValue, int isOK)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "电子看板_质量数据_临时表_增加_备用拧紧工位";
|
||||
SqlParameter[] thisParmsSql = new SqlParameter[8];
|
||||
thisParmsSql[0] = new SqlParameter("@工位号", opName);
|
||||
thisParmsSql[1] = new SqlParameter("@序号", shaftStep);
|
||||
thisParmsSql[2] = new SqlParameter("@EngineID", engineID);
|
||||
thisParmsSql[3] = new SqlParameter("@EngineType", engineType);
|
||||
thisParmsSql[4] = new SqlParameter("@EngineTypeID", engineTypeID);
|
||||
thisParmsSql[5] = new SqlParameter("@变量排序", orderBy);
|
||||
thisParmsSql[6] = new SqlParameter("@测量值", tagValue);
|
||||
thisParmsSql[7] = new SqlParameter("@合格标志", isOK);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParmsSql);
|
||||
}
|
||||
/// <summary>
|
||||
/// 电子看板_质量数据_临时表_增加
|
||||
/// </summary>
|
||||
/// <param name="opName">工位号</param>
|
||||
/// <param name="shaftStep">序号</param>
|
||||
/// <param name="engineID">工件号</param>
|
||||
/// <param name="engineType">机型</param>
|
||||
/// <param name="engineTypeID">机型代码</param>
|
||||
/// <param name="tagID">变量代码</param>
|
||||
/// <param name="tagValue">变量值</param>
|
||||
/// <param name="isOK">合格标志</param>
|
||||
static public void ShaftPosition_Data_Insert(string opName,int shaftStep, string engineID,string engineType, int engineTypeID, int tagID,string tagValue, int isOK)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "电子看板_质量数据_临时表_增加";
|
||||
SqlParameter[] thisParmsSql = new SqlParameter[8];
|
||||
thisParmsSql[0] = new SqlParameter("@工位号", opName);
|
||||
thisParmsSql[1] = new SqlParameter("@序号", shaftStep);
|
||||
thisParmsSql[2] = new SqlParameter("@EngineID", engineID);
|
||||
thisParmsSql[3] = new SqlParameter("@EngineType", engineType);
|
||||
thisParmsSql[4] = new SqlParameter("@EngineTypeID", engineTypeID);
|
||||
thisParmsSql[5] = new SqlParameter("@TagID", tagID);
|
||||
thisParmsSql[6] = new SqlParameter("@测量值", tagValue);
|
||||
thisParmsSql[7] = new SqlParameter("@合格标志", isOK);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParmsSql);
|
||||
}
|
||||
/// <summary>
|
||||
/// 电子看板_质量数据_临时表_增加
|
||||
/// </summary>
|
||||
/// <param name="opName">工位号</param>
|
||||
/// <param name="shaftStep">序号</param>
|
||||
/// <param name="engineID">工件号</param>
|
||||
/// <param name="engineType">机型</param>
|
||||
/// <param name="engineTypeID">机型代码</param>
|
||||
/// <param name="tagID">变量代码</param>
|
||||
/// <param name="tagValue">变量值</param>
|
||||
/// <param name="isOK">合格标志</param>
|
||||
//static public void ShaftPosition_Data_Insert_Access(string opName, int shaftStep, string engineID, string engineType,
|
||||
// int engineTypeID, int tagID, string tagValue, int isOK)
|
||||
//{
|
||||
// string sql;
|
||||
// string sql_Delete;
|
||||
// sql = "insert into 电子看板_质量数据_临时表(EngineID,EngineType,EngineTypeID,工位号,TagID,测量值,合格标志) ";
|
||||
// sql = sql+" values(";
|
||||
// sql = sql + "'" + engineID + "',";
|
||||
// sql = sql + "'" + engineType + "',";
|
||||
// sql = sql + "" + engineTypeID.ToString() + ",";
|
||||
// sql = sql + "'" + opName + "',";
|
||||
// sql = sql + "" + tagID.ToString() + ",";
|
||||
// sql = sql + "'" + tagValue + "',";
|
||||
// sql = sql + "" + isOK.ToString() + ")";
|
||||
|
||||
// sql_Delete = "delete from 电子看板_质量数据_临时表";
|
||||
// sql_Delete = sql_Delete + " where tagID=" + tagID.ToString();
|
||||
// DataAccess.ExecuteSQL_OleDb_Access(sql_Delete);
|
||||
// DataAccess.ExecuteSQL_OleDb_Access(sql);
|
||||
//}
|
||||
/// <summary>
|
||||
/// 查询[电子看板_质量数据_临时表]数据
|
||||
/// </summary>
|
||||
/// <param name="opName">工位号</param>
|
||||
/// <param name="dt">合格标志</param>
|
||||
//static public void ShaftPosition_Data_Select_Access(string opName, out DataTable dt)
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "select EngineID,EngineType,EngineTypeID,工位号,TagID,测量值 as TagValue,合格标志 as IsGoodBad";
|
||||
// sql=sql+" from 电子看板_质量数据_临时表 ";
|
||||
// sql = sql+" where 工位号='"+opName+"'";
|
||||
// DataAccess.ExecuteDataTable_OleDb_Access(sql, out dt);
|
||||
//}
|
||||
/// <summary>
|
||||
/// 删除[电子看板_质量数据_临时表]数据
|
||||
/// </summary>
|
||||
/// <param name="opName">工位号</param>
|
||||
//static public void ShaftPosition_Data_Delete_Access(string opName)
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "delete from 电子看板_质量数据_临时表 ";
|
||||
// sql = sql + " where 工位号='" + opName + "'";
|
||||
// DataAccess.ExecuteSQL_OleDb_Access(sql);
|
||||
//}
|
||||
/// <summary>
|
||||
/// 电子看板_质量数据_临时表_删除
|
||||
/// </summary>
|
||||
/// <param name="opName">工位号</param>
|
||||
/// <param name="shaftStep">列位置</param>
|
||||
/// <param name="engineID">EngineID</param>
|
||||
static public void ShaftPosition_Data_Delete(string opName, int shaftStep, string engineID)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "电子看板_质量数据_临时表_删除";
|
||||
SqlParameter[] thisParmsSql = new SqlParameter[3];
|
||||
thisParmsSql[0] = new SqlParameter("@工位号", opName);
|
||||
thisParmsSql[1] = new SqlParameter("@列位置", shaftStep);
|
||||
thisParmsSql[2] = new SqlParameter("@EngineID", engineID);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParmsSql);
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,60 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using DataLinkMesWork;
|
||||
using System.Data.OleDb;
|
||||
|
||||
//using SystemFramework;
|
||||
|
||||
namespace bizFacade
|
||||
{
|
||||
public partial class BaseDataSystemMES
|
||||
{
|
||||
///// <summary>
|
||||
///// MES_装配数据_发动机号_追踪代码
|
||||
///// 追踪代码 SqlServer和Access
|
||||
///// </summary>
|
||||
///// <param name="traceCode"></param>
|
||||
///// <param name="opName"></param>
|
||||
///// <param name="dt"></param>
|
||||
///// <returns></returns>
|
||||
//public static bool TraceTable_Select_SqlServerAndAccess(string traceCode, string opName, out DataTable dt)
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "SELECT top 1 * FROM MES_装配数据_发动机号_追踪代码 "
|
||||
// + " WHERE 追踪代码 = '" + traceCode + "' and 工位号='" + opName + "' order by 操作时间 desc ";
|
||||
// if (!SQLCommon.SqlServerConnectionStatus)
|
||||
// {
|
||||
// return DataAccess.ExecuteDataTable_OleDb_Access(sql, out dt);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// return DataAccess.ExecuteDataTable(sql, out dt);
|
||||
// }
|
||||
//}
|
||||
/// <summary>
|
||||
/// MES_装配数据_发动机号_追踪代码
|
||||
/// 追踪代码 SqlServer和Access
|
||||
/// </summary>
|
||||
/// <param name="traceCode"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static bool TraceTable_Select_SqlServerAndAccess(string traceCode, out DataTable dt)
|
||||
{
|
||||
string sql;
|
||||
sql = "SELECT top 1 * FROM MES_装配数据_发动机号_追踪代码 "
|
||||
+ " WHERE 追踪代码 = '" + traceCode + "' order by 操作时间 desc ";
|
||||
//if (!SQLCommon.SqlServerConnectionStatus)
|
||||
//{
|
||||
// return DataAccess.ExecuteDataTable_OleDb_Access(sql, out dt);
|
||||
//}
|
||||
//else
|
||||
{
|
||||
return DataAccess.ExecuteDataTable(sql, out dt);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,388 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using DataLinkMesWork;
|
||||
using System.Data.OleDb;
|
||||
|
||||
//using SystemFramework;
|
||||
|
||||
namespace bizFacade
|
||||
{
|
||||
public partial class BaseDataSystemMES
|
||||
{
|
||||
/// <summary>
|
||||
/// 检测表 [MES_装配数据_发动机号_追踪代码] 中的扫描挂牌码[追踪代码]是否存在
|
||||
/// 不存在 返回 true 否则返回 false
|
||||
///分线活塞连杆上线工位流程:(活塞连杆OP3800)MachineType=“S”,
|
||||
///ScannerType = “1”,OpType=“F103”。每个发动机装配六个活塞连杆。
|
||||
///六个活塞连杆分别放在三个连续的活塞连杆托盘上,每个托盘放两个活塞连杆,
|
||||
///每个工位完成一个托盘两个活塞连杆的安装。
|
||||
///三个连续的活塞连杆托盘上的描挂牌码(物料追踪号[追踪代码])相同。
|
||||
///活塞连杆上托盘:
|
||||
///1:PLC向MES发送工件到位,开始扫描信号。WorkStart=1
|
||||
///2:扫描挂牌码(物料追踪号[追踪代码])
|
||||
///3:检测表 [MES_装配数据_发动机号_追踪代码] 中的扫描挂牌码[追踪代码]是否存在(是否禁用
|
||||
///3 and追踪代码 = ‘’)。
|
||||
///3.1:如果不存在或存在并且验证完成(是否禁用=3),
|
||||
///显示当前生产计划对应的活塞连杆信息(物料表和需要验证的物料表);
|
||||
///保存[追踪代码]和[追踪标识](追踪标识=HL+时间标签)
|
||||
///到表[MES_装配数据_发动机号_追踪代码]中。[追踪标识]对应表[MES_装配数据_发动机号_追踪代码]的
|
||||
///[发动机号]字段。MES向PLC写入发动机号、机型、机型标志、追踪代码;
|
||||
///MES向PLC写入MES激发变量扫描完成,EngineGetOver=1
|
||||
///3.2:如果存在并且验证完成(是否禁用3),使用[MES_装配数据_发动机号_追踪代码],
|
||||
///显示扫描挂牌码对应的活塞连杆信息(物料表和需要验证的物料表)。
|
||||
///MES向PLC写入发动机号、机型、机型标志、追踪代码;
|
||||
///MES向PLC写入MES激发变量扫描完成,EngineGetOver=1
|
||||
///3.3:如果物料验证完成,追踪代码对应的[是否禁用]=3
|
||||
///(每验证完成一个托盘对应活塞连杆物料增加1)。
|
||||
///3.4:显示每一个托盘对应的验证物料。
|
||||
///4物料验证:每验证完成一个托盘对应活塞连杆物料,如果没有全部完成验证,
|
||||
///MaterialVerifyOver=1,不清空表[MES_装配数据_零部件追溯_临时状态]。
|
||||
///PLC向MES发送工件离开信号WorkStart=0,保存数据到信息管理系统,
|
||||
///完成工件当日计数和工作开始时间和结束时间。
|
||||
///5:如果全部完成验证,MaterialVerifyOver=1,清空表[MES_装配数据_零部件追溯_临时状态]。
|
||||
///每验证完成一个托盘对应活塞连杆物料,追踪代码对应的[是否禁用]增加1,
|
||||
///作为活塞连杆分组验证标识。每验证一个物料,保存数据到表[MES_装配数据_零部件追溯_数据主表]
|
||||
///和[MES_装配数据_零部件追溯],发动机号=追踪标识。PLC向MES发送工件离开信号WorkStart=0,
|
||||
///保存数据到信息管理系统,完成工件当日计数和工作开始时间和结束时间。
|
||||
///6:通过OpNameMainLine(总线活塞连杆上线工位)工位数据表和本工位的装配指南,
|
||||
///获得当前工位的装配指南,订单号、机型、机型标志。
|
||||
///7:显示活塞连杆订单号、活塞连杆、机型、机型标志
|
||||
///-1 不合理
|
||||
///0 没记录
|
||||
///1 验证完成第一组
|
||||
///2 验证完成第二组
|
||||
///3 验证完成第三组
|
||||
/// </summary>
|
||||
//public static int TraceTableCheck_F3_New(string opName, string TraceCode)
|
||||
//{
|
||||
// DataTable dt;
|
||||
// int isFalse;
|
||||
// string sql;
|
||||
// //存在,并且没有验证完成条件
|
||||
// sql = "SELECT top 1 是否禁用 FROM [MES_装配数据_发动机号_追踪代码] "
|
||||
// + " where (追踪代码='" + TraceCode + "'"
|
||||
// + " and 工位号='" + opName + "')"
|
||||
// +" order by 操作时间 desc ";
|
||||
// //if (!SQLCommon.SqlServerConnectionStatus)
|
||||
// //{
|
||||
// // DataAccess.ExecuteDataTable_OleDb_Access(sql, out dt);
|
||||
// //}
|
||||
// //else
|
||||
// {
|
||||
// DataAccess.ExecuteDataTable(sql, out dt);
|
||||
|
||||
// }
|
||||
// if (dt == null)
|
||||
// {
|
||||
// //读[MES_装配数据_发动机号_追踪代码]数据失败
|
||||
// isFalse = -1;
|
||||
// }
|
||||
// if (dt.Rows.Count > 0)
|
||||
// {
|
||||
// isFalse = Convert.ToInt32(dt.Rows[0]["是否禁用"]);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// isFalse = 0;
|
||||
// }
|
||||
|
||||
// return isFalse;
|
||||
|
||||
//}
|
||||
///// <summary>
|
||||
///// 检测表 [MES_装配数据_发动机号_追踪代码] 中的扫描挂牌码[追踪代码]是否存在
|
||||
///// 不存在 返回 true 否则返回 false
|
||||
/////分线活塞连杆上线工位流程:(活塞连杆OP3800)MachineType=“S”,
|
||||
/////ScannerType = “1”,OpType=“F103”。每个发动机装配六个活塞连杆。
|
||||
/////六个活塞连杆分别放在三个连续的活塞连杆托盘上,每个托盘放两个活塞连杆,
|
||||
/////每个工位完成一个托盘两个活塞连杆的安装。
|
||||
/////三个连续的活塞连杆托盘上的描挂牌码(物料追踪号[追踪代码])相同。
|
||||
/////活塞连杆上托盘:
|
||||
/////1:PLC向MES发送工件到位,开始扫描信号。WorkStart=1
|
||||
/////2:扫描挂牌码(物料追踪号[追踪代码])
|
||||
/////3:检测表 [MES_装配数据_发动机号_追踪代码] 中的扫描挂牌码[追踪代码]是否存在(是否禁用
|
||||
/////3 and追踪代码 = ‘’)。
|
||||
/////3.1:如果不存在或存在并且验证完成(是否禁用=3),
|
||||
/////显示当前生产计划对应的活塞连杆信息(物料表和需要验证的物料表);
|
||||
/////保存[追踪代码]和[追踪标识](追踪标识=HL+时间标签)
|
||||
/////到表[MES_装配数据_发动机号_追踪代码]中。[追踪标识]对应表[MES_装配数据_发动机号_追踪代码]的
|
||||
/////[发动机号]字段。MES向PLC写入发动机号、机型、机型标志、追踪代码;
|
||||
/////MES向PLC写入MES激发变量扫描完成,EngineGetOver=1
|
||||
/////3.2:如果存在并且验证完成(是否禁用3),使用[MES_装配数据_发动机号_追踪代码],
|
||||
/////显示扫描挂牌码对应的活塞连杆信息(物料表和需要验证的物料表)。
|
||||
/////MES向PLC写入发动机号、机型、机型标志、追踪代码;
|
||||
/////MES向PLC写入MES激发变量扫描完成,EngineGetOver=1
|
||||
/////3.3:如果物料验证完成,追踪代码对应的[是否禁用]=3
|
||||
/////(每验证完成一个托盘对应活塞连杆物料增加1)。
|
||||
/////3.4:显示每一个托盘对应的验证物料。
|
||||
/////4物料验证:每验证完成一个托盘对应活塞连杆物料,如果没有全部完成验证,
|
||||
/////MaterialVerifyOver=1,不清空表[MES_装配数据_零部件追溯_临时状态]。
|
||||
/////PLC向MES发送工件离开信号WorkStart=0,保存数据到信息管理系统,
|
||||
/////完成工件当日计数和工作开始时间和结束时间。
|
||||
/////5:如果全部完成验证,MaterialVerifyOver=1,清空表[MES_装配数据_零部件追溯_临时状态]。
|
||||
/////每验证完成一个托盘对应活塞连杆物料,追踪代码对应的[是否禁用]增加1,
|
||||
/////作为活塞连杆分组验证标识。每验证一个物料,保存数据到表[MES_装配数据_零部件追溯_数据主表]
|
||||
/////和[MES_装配数据_零部件追溯],发动机号=追踪标识。PLC向MES发送工件离开信号WorkStart=0,
|
||||
/////保存数据到信息管理系统,完成工件当日计数和工作开始时间和结束时间。
|
||||
/////6:通过OpNameMainLine(总线活塞连杆上线工位)工位数据表和本工位的装配指南,
|
||||
/////获得当前工位的装配指南,订单号、机型、机型标志。
|
||||
/////7:显示活塞连杆订单号、活塞连杆、机型、机型标志
|
||||
/////-1 不合理
|
||||
/////0 没记录
|
||||
/////1 验证完成第一组
|
||||
/////2 验证完成第二组
|
||||
/////3 验证完成第三组
|
||||
///// </summary>
|
||||
//public static int TraceTableCheck_F3(string opName, string TraceCode)
|
||||
//{
|
||||
// DataTable dt;
|
||||
// int isFalse;
|
||||
// string sql;
|
||||
// //存在,并且没有验证完成条件
|
||||
// sql = "SELECT top 1 是否禁用 FROM [MES_装配数据_发动机号_追踪代码] "
|
||||
// + " where (追踪代码='" + TraceCode + "'"
|
||||
// + " and 工位号='" + opName + "')"
|
||||
// +" order by 操作时间 desc ";
|
||||
// //if (!SQLCommon.SqlServerConnectionStatus)
|
||||
// //{
|
||||
// // DataAccess.ExecuteDataTable_OleDb_Access(sql, out dt);
|
||||
// //}
|
||||
// //else
|
||||
// {
|
||||
// DataAccess.ExecuteDataTable(sql, out dt);
|
||||
|
||||
// }
|
||||
// if (dt == null)
|
||||
// {
|
||||
// //读[MES_装配数据_发动机号_追踪代码]数据失败
|
||||
// isFalse = -1;
|
||||
// }
|
||||
// if (dt.Rows.Count > 0)
|
||||
// {
|
||||
// isFalse = Convert.ToInt32(dt.Rows[0]["是否禁用"]);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// isFalse = 0;
|
||||
// }
|
||||
|
||||
// return isFalse;
|
||||
|
||||
//}
|
||||
///// <summary>
|
||||
///// 用于:活塞连杆上线
|
||||
///// 活塞连杆分三组,验证完成一组(包括将验证的物料保存以后),
|
||||
///// [MES_装配数据_发动机号_追踪代码] 表中的字段“是否禁用”=1;
|
||||
///// 验证完成二组(包括将验证的物料保存以后),
|
||||
///// [MES_装配数据_发动机号_追踪代码] 表中的字段“是否禁用”=2;
|
||||
///// 验证完成三组(包括将验证的物料保存以后),
|
||||
///// [MES_装配数据_发动机号_追踪代码] 表中的字段“是否禁用”=3。
|
||||
///// 当第三组验证完成后,表[MES_计划BOM_发动机号]的字段“是否装配代码”=1,
|
||||
///// 表示已经完成一个发动机的活塞连杆装配。
|
||||
///// </summary>
|
||||
///// <param name="opName"></param>
|
||||
///// <param name="TraceCode"></param>
|
||||
///// <param name="strConnectionstring"></param>
|
||||
///// <returns></returns>
|
||||
//public static int TraceTableCheck(string opName, string TraceCode, string strConnectionstring)
|
||||
//{
|
||||
// DataTable dt;
|
||||
// int isFalse;
|
||||
// string sql;
|
||||
// //存在,并且没有验证完成条件
|
||||
// sql = "SELECT 是否禁用 FROM [MES_装配数据_发动机号_追踪代码] "
|
||||
// + " where (追踪代码='" + TraceCode + "'"
|
||||
// + " and 工位号='" + opName + "')";
|
||||
// DataAccess.ExecuteDataTable_OleDb_Access(sql, strConnectionstring, out dt);
|
||||
// if (dt == null)
|
||||
// {
|
||||
// isFalse = -1;
|
||||
// }
|
||||
// if (dt.Rows.Count > 0)
|
||||
// {
|
||||
// isFalse = Convert.ToInt32(dt.Rows[0]["是否禁用"]);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// isFalse = -1;
|
||||
// }
|
||||
|
||||
// return isFalse;
|
||||
|
||||
//}
|
||||
///// <summary>
|
||||
///// 用于:活塞连杆上线
|
||||
///// 活塞连杆分三组,验证完成一组(包括将验证的物料保存以后),
|
||||
///// [MES_装配数据_发动机号_追踪代码] 表中的字段“是否禁用”=1;
|
||||
///// 验证完成二组(包括将验证的物料保存以后),
|
||||
///// [MES_装配数据_发动机号_追踪代码] 表中的字段“是否禁用”=2;
|
||||
///// 验证完成三组(包括将验证的物料保存以后),
|
||||
///// [MES_装配数据_发动机号_追踪代码] 表中的字段“是否禁用”=3。
|
||||
///// 当第三组验证完成后,表[MES_计划BOM_发动机号]的字段“是否装配代码”=1,
|
||||
///// 表示已经完成一个发动机的活塞连杆装配。
|
||||
///// </summary>
|
||||
///// <param name="opName"></param>
|
||||
///// <param name="TraceCode"></param>
|
||||
///// <returns></returns>
|
||||
//public static int TraceTableCheck(string opName, string TraceCode)
|
||||
//{
|
||||
// DataTable dt;
|
||||
// int isFalse;
|
||||
// string sql;
|
||||
// //存在,并且没有验证完成条件
|
||||
// sql = "SELECT 是否禁用 FROM [MES_装配数据_发动机号_追踪代码] "
|
||||
// + " where (追踪代码='" + TraceCode + "'"
|
||||
// + " and 工位号='" + opName + "')";
|
||||
// DataAccess.ExecuteDataTable_OleDb_Access(sql, out dt);
|
||||
// if (dt == null)
|
||||
// {
|
||||
// isFalse = -1;
|
||||
// }
|
||||
// if (dt.Rows.Count > 0)
|
||||
// {
|
||||
// isFalse = Convert.ToInt32(dt.Rows[0]["是否禁用"]);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// isFalse = -1;
|
||||
// }
|
||||
|
||||
// return isFalse;
|
||||
|
||||
//}
|
||||
///// <summary>
|
||||
///// 更新活塞连杆验证状态(是否禁用加"1")
|
||||
///// 是否禁用 =0 开始验证新的活塞连杆
|
||||
///// =1第一组验证完成
|
||||
///// =2第二组验证完成
|
||||
///// =3第三组验证完成
|
||||
///// 6.5 活塞连杆分三组,验证完成一组(包括将验证的物料保存以后),
|
||||
///// [MES_装配数据_发动机号_追踪代码] 表中的字段“是否禁用”=1;
|
||||
///// 验证完成二组(包括将验证的物料保存以后),
|
||||
///// [MES_装配数据_发动机号_追踪代码] 表中的字段“是否禁用”=2;
|
||||
///// 验证完成三组(包括将验证的物料保存以后),
|
||||
///// [MES_装配数据_发动机号_追踪代码] 表中的字段“是否禁用”=3。
|
||||
///// 当第三组验证完成后,
|
||||
///// 表[MES_计划BOM_发动机号]的字段“是否装配代码”=1,
|
||||
///// 表示已经完成一个发动机的活塞连杆装配。
|
||||
///// </summary>
|
||||
///// <param name="opName"></param>
|
||||
///// <param name="TraceCode"></param>
|
||||
///// <param name="EngineID"></param>
|
||||
///// <returns></returns>
|
||||
//public static bool TraceTableUpdate_AddOne_F3(string opName, string TraceCode, string EngineID)
|
||||
//{
|
||||
// string sql;
|
||||
// DataTable dt;
|
||||
// int count;
|
||||
// sql = "SELECT top 1 是否禁用 FROM [MES_装配数据_发动机号_追踪代码] "
|
||||
// + " where (追踪代码='" + TraceCode + "'"
|
||||
// + " and 工位号='" + opName + "')"
|
||||
// + " order by 操作时间 desc ";
|
||||
// DataAccess.ExecuteDataTable_OleDb_Access(sql, out dt);
|
||||
// if (dt == null) return false;
|
||||
// if (dt.Rows.Count > 0)
|
||||
// {
|
||||
// count = Convert.ToInt32(dt.Rows[0]["是否禁用"]);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// count = 0;
|
||||
// }
|
||||
// count = count + 1;
|
||||
// sql = "UPDATE [MES_装配数据_发动机号_追踪代码] "
|
||||
// + " SET 是否禁用=" + count.ToString()
|
||||
// + " where (追踪代码='" + TraceCode + "'"
|
||||
// + " and 工位号='" + opName + "')";
|
||||
// //[MES_计划BOM_发动机号]的字段“是否装配代码”=1,
|
||||
// if (count == 3)
|
||||
// {
|
||||
// try
|
||||
// {
|
||||
// BaseDataSystemMES.BaseData_tagTable_EngineID_UpDate(EngineID);
|
||||
// }
|
||||
// catch (Exception err)
|
||||
// {
|
||||
// ////ApplicationLog.WriteLog(err, "更新活塞连杆验证状态");
|
||||
// }
|
||||
// }
|
||||
// return DataAccess.ExecuteSQL_OleDb_Access(sql);
|
||||
//}
|
||||
///// <summary>
|
||||
///// 更新活塞连杆验证状态
|
||||
///// 是否禁用 =0 开始验证新的活塞连杆
|
||||
///// =1第一组验证完成
|
||||
///// =2第二组验证完成
|
||||
///// =3第三组验证完成
|
||||
///// </summary>
|
||||
///// <param name="opName"></param>
|
||||
///// <param name="TraceCode"></param>
|
||||
///// <param name="isFalse"></param>
|
||||
///// <returns></returns>
|
||||
//public static bool TraceTableUpdate_F3_New(string opName, string TraceCode, int isFalse)
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "UPDATE [MES_装配数据_发动机号_追踪代码] "
|
||||
// + " SET 是否禁用=" + isFalse.ToString()
|
||||
// + " where ( 是否禁用<=2 and 追踪代码='" + TraceCode + "'"
|
||||
// + " and 工位号='" + opName + "')";
|
||||
// //if (!SQLCommon.SqlServerConnectionStatus)
|
||||
// //{
|
||||
// // return DataAccess.ExecuteSQL_OleDb_Access(sql);
|
||||
// //}
|
||||
// //else
|
||||
// {
|
||||
// return DataAccess.ExecuteSQL(sql);
|
||||
|
||||
// }
|
||||
//}
|
||||
///// <summary>
|
||||
///// 更新活塞连杆验证状态
|
||||
///// 是否禁用 =0 开始验证新的活塞连杆
|
||||
///// =1第一组验证完成
|
||||
///// =2第二组验证完成
|
||||
///// =3第三组验证完成
|
||||
///// </summary>
|
||||
///// <param name="opName"></param>
|
||||
///// <param name="TraceCode"></param>
|
||||
///// <param name="isFalse"></param>
|
||||
///// <returns></returns>
|
||||
//public static bool TraceTableUpdate_F3(string opName, string TraceCode, int isFalse)
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "UPDATE [MES_装配数据_发动机号_追踪代码] "
|
||||
// + " SET 是否禁用=" + isFalse.ToString()
|
||||
// + " where (追踪代码='" + TraceCode + "'"
|
||||
// + " and 工位号='" + opName + "')";
|
||||
// return DataAccess.ExecuteSQL_OleDb_Access(sql);
|
||||
//}
|
||||
///// <summary>
|
||||
///// 线首,用于物料追踪
|
||||
///// (3.2.2.1)如果表[MES_装配数据_发动机号_追踪代码]中
|
||||
///// 不存在字段“是否禁用” 小于“3”的记录,
|
||||
///// 说明活塞连杆工位已经全部验证完成,
|
||||
///// 开始全新验证流程。同(2)基本流程。
|
||||
///// </summary>
|
||||
///// <returns></returns>
|
||||
//public static bool TableTraceSelectIsFalse()
|
||||
//{
|
||||
// DataTable dt;
|
||||
// string sql = null;
|
||||
// sql = "SELECT * FROM MES_装配数据_发动机号_追踪代码 WHERE 是否禁用 < 3";
|
||||
// DataAccess.ExecuteDataTable_OleDb_Access(sql, out dt);
|
||||
// if (dt == null)
|
||||
// {
|
||||
// return true;
|
||||
// }
|
||||
// if (dt.Rows.Count == 0)
|
||||
// {
|
||||
// return true;
|
||||
// }
|
||||
// return false;
|
||||
//}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
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>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="lineType"></param>
|
||||
/// <param name="transferLineType"></param>
|
||||
/// <param name="dt"></param>
|
||||
//public static void GetOpNameByLineType(string lineType,string transferLineType, DataTable dt)
|
||||
//{
|
||||
// dt = null;
|
||||
// string sql;
|
||||
// sql = "SELECT * FROM MES_计划BOM_工位与名称 WHERE PC=1 "
|
||||
// + " AND 线体类型 ='"+transferLineType+"'";
|
||||
// DataAccess.ExecuteDataTable_OleDb_Access(sql, out dt);
|
||||
|
||||
//}
|
||||
/// <summary>
|
||||
/// 获得上线工位对应线体类型的工位文件列表
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="fileNameList"></param>
|
||||
//public static void GetFileNameListByOpName(string opName, out string[] fileNameList)
|
||||
//{
|
||||
// string transferLineType;
|
||||
// fileNameList = null;
|
||||
// DataTable dt = null;
|
||||
// string sql;
|
||||
// sql = "SELECT 线体类型 FROM MES_计划BOM_工位与名称 WHERE 工位号='" + opName + "'";
|
||||
// DataAccess.ExecuteDataTable_OleDb_Access(sql, out dt);
|
||||
// if (dt != null)
|
||||
// {
|
||||
// if (dt.Rows.Count > 0)
|
||||
// {
|
||||
// transferLineType = dt.Rows[0]["线体类型"].ToString();
|
||||
// sql = "SELECT 文件名称 FROM MES_计划BOM_工位与名称 WHERE 线体类型 ='" + transferLineType + "'"
|
||||
// + " AND 工位号<>'" + opName+"'";
|
||||
// DataAccess.ExecuteDataTable_OleDb_Access(sql, out dt);
|
||||
// if (dt != null)
|
||||
// {
|
||||
// if (dt.Rows.Count > 0)
|
||||
// {
|
||||
// fileNameList = new string[dt.Rows.Count];
|
||||
// for (int i = 0; i < dt.Rows.Count; i++)
|
||||
// {
|
||||
// fileNameList[i] = dt.Rows[i]["文件名称"].ToString();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,817 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using DataLinkMesWork;
|
||||
using System.Data.OleDb;
|
||||
|
||||
//using SystemFramework;
|
||||
|
||||
namespace bizFacade
|
||||
{
|
||||
public partial class BaseDataSystemMES
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 删除[追踪代码]
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="TraceCode"></param>
|
||||
/// <returns></returns>
|
||||
//public static bool TraceTableDelete(string opName, string TraceCode)
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "DELETE FROM [MES_装配数据_发动机号_追踪代码] "
|
||||
// + " where (追踪代码='" + TraceCode + "'"
|
||||
// + " and 工位号='" + opName + "')";
|
||||
// return DataAccess.ExecuteSQL_OleDb_Access(sql);
|
||||
//}
|
||||
/// <summary>
|
||||
/// MES_装配数据_发动机号_追踪代码
|
||||
/// 订单号
|
||||
/// Access
|
||||
/// </summary>
|
||||
/// <param name="traceCode"></param>
|
||||
/// <param name="connectionString_Access"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
//public static bool TraceTable_Select(string traceCode, string connectionString_Access,out DataTable dt)
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "SELECT top 1 * FROM MES_装配数据_发动机号_追踪代码 "
|
||||
// + " WHERE 追踪代码 = '" + traceCode + "'";
|
||||
// return DataAccess.ExecuteDataTable_OleDb_Access(sql, connectionString_Access, out dt);
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// MES_装配数据_发动机号_追踪代码
|
||||
/// Access
|
||||
/// </summary>
|
||||
/// <param name="EngineTraceCode"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static bool TraceTable_Select(string EngineTraceCode, out DataTable dt)
|
||||
{
|
||||
string sql;
|
||||
//sql = "SELECT * FROM MES_装配数据_发动机号_追踪代码 "
|
||||
// + " WHERE 发动机号 = '" + EngineTraceCode + "'";
|
||||
sql = "SELECT top 1 * FROM MES_装配数据_发动机号_追踪代码 "
|
||||
+ " WHERE 追踪代码 = '" + EngineTraceCode + "'"
|
||||
+" order by 操作时间 desc ";
|
||||
//if (!SQLCommon.SqlServerConnectionStatus)
|
||||
//{
|
||||
// return DataAccess.ExecuteDataTable_OleDb_Access(sql, out dt);
|
||||
//}
|
||||
//else
|
||||
{
|
||||
return DataAccess.ExecuteDataTable(sql, out dt);
|
||||
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// [MES_装配数据_零部件追溯_发动机号与缸盖号]
|
||||
/// </summary>
|
||||
private static string GetSqlString_EngineID_CapNumber()
|
||||
{
|
||||
string sql = null;
|
||||
sql = "INSERT INTO [MES_装配数据_零部件追溯_发动机号与缸盖号] " +
|
||||
"(订单号,发动机号,追踪代码,工位号,到达时间,离开时间,操作者工号,班次代码,"
|
||||
+ "[SAP物料号],[发动机型号],[发动机型号代码], [发动机机型], "
|
||||
+ "[发动机数量], [厂牌编号起始号], [客户名称],[投料日期],[文件编号],[集团名称],[通知号],"
|
||||
+ "[功率],[指南文件编号],[装机状态],[适用状态],[物料描述],[计划下达日期],[计划完工日期],[主配厂家],[零件类型])"
|
||||
+ " VALUES ("
|
||||
//订单号,发动机号,追踪代码,工位号,到达时间,离开时间,操作者工号,班次代码
|
||||
+ "'" + MaterialData.orderForm + "',"
|
||||
+ "'" + MaterialData.engineNumber + "',"
|
||||
+ "'" + MaterialData.engineTraceCode + "',"
|
||||
+ "'" + MaterialData.opName + "',"
|
||||
+ "'" + MaterialData.arrivedTime.ToString("G") + "',"
|
||||
+ "'" + MaterialData.leavedTime.ToString("G") + "',"
|
||||
+ "'" + MaterialData.operatorCode + "',"
|
||||
+ "'" + MaterialData.operatorShift + "',"
|
||||
//+ "[SAP物料号],[发动机型号],[发动机型号代码], [发动机机型], "
|
||||
|
||||
+ "'" + MaterialData.sAPMaterialNumber + "',"
|
||||
+ "'" + MaterialData.engineNumberType + "',"
|
||||
+ "" + MaterialData.engineNumberCode + ","//int
|
||||
+ "'" + MaterialData.engineNumberBasicType + "',"
|
||||
//+ "[发动机数量], [厂牌编号起始号], [客户名称],[投料日期],[文件编号],[集团名称],[通知号],"
|
||||
|
||||
+ "" + MaterialData.engineCount + ","//int
|
||||
+ "" + MaterialData.engineNumberFirstID + ","//int
|
||||
+ "'" + MaterialData.customesName + "',"
|
||||
+ "'" + MaterialData.prepareMaterialDateTime.ToString("G") + "',"
|
||||
+ "'" + MaterialData.fileCode + "',"
|
||||
+ "'" + MaterialData.groupName + "',"
|
||||
+ "'" + MaterialData.notifyCode + "',"
|
||||
//+ "[功率],[指南文件编号],[装机状态],[适用状态],[物料描述],[计划下达日期],[计划完工日期],主配厂家,零件类型"
|
||||
+ "'" + MaterialData.n_Force + "',"
|
||||
+ "'" + MaterialData.directFileCode + "',"
|
||||
+ "'" + MaterialData.workEngineStatus + "',"
|
||||
+ "'" + MaterialData.adaptDateTime.ToString("G") + "',"
|
||||
+ "'" + MaterialData.materialDescript + "',"
|
||||
+ "'" + MaterialData.planSendedDateTime.ToString("G") + "',"
|
||||
+ "'" + MaterialData.planFinishDateTime.ToString("G") + "',"
|
||||
+ "'" + MaterialData.mainPruduceFatory + "',"
|
||||
+ "" + MaterialData.partType.ToString() + ") ";
|
||||
return sql;
|
||||
}
|
||||
///// <summary>
|
||||
///// 获得增加表[MES_装配数据_发动机号_追踪代码]的SQL语句
|
||||
///// </summary>
|
||||
//private static string GetSqlStringFirstOpNameTableTrace_F2()
|
||||
//{
|
||||
// string sql = null;
|
||||
// sql = "INSERT INTO [MES_装配数据_零部件追溯_发动机号与缸盖号] " +
|
||||
// "(订单号,发动机号,追踪代码,工位号,到达时间,离开时间,操作者工号,班次代码,"
|
||||
// + "[SAP物料号],[发动机型号],[发动机型号代码], [发动机机型], "
|
||||
// + "[发动机数量], [厂牌编号起始号], [客户名称],[投料日期],[文件编号],[集团名称],[通知号],"
|
||||
// + "[功率],[指南文件编号],[装机状态],[适用状态],[物料描述],[计划下达日期],[计划完工日期],[主配厂家],[零件类型])"
|
||||
// + " VALUES ("
|
||||
// //订单号,发动机号,追踪代码,工位号,到达时间,离开时间,操作者工号,班次代码
|
||||
// + "'" + MaterialData.orderForm + "',"
|
||||
// + "'" + MaterialData.engineNumber + "',"
|
||||
// + "'" + MaterialData.engineTraceCode + "',"
|
||||
// + "'" + MaterialData.opName + "',"
|
||||
// + "'" + MaterialData.arrivedTime.ToString("G") + "',"
|
||||
// + "'" + MaterialData.leavedTime.ToString("G") + "',"
|
||||
// + "'" + MaterialData.operatorCode + "',"
|
||||
// + "'" + MaterialData.operatorShift + "',"
|
||||
// //+ "[SAP物料号],[发动机型号],[发动机型号代码], [发动机机型], "
|
||||
|
||||
// + "'" + MaterialData.sAPMaterialNumber + "',"
|
||||
// + "'" + MaterialData.engineNumberType + "',"
|
||||
// + "" + MaterialData.engineNumberCode + ","//int
|
||||
// + "'" + MaterialData.engineNumberBasicType + "',"
|
||||
// //+ "[发动机数量], [厂牌编号起始号], [客户名称],[投料日期],[文件编号],[集团名称],[通知号],"
|
||||
|
||||
// + "" + MaterialData.engineCount + ","//int
|
||||
// + "" + MaterialData.engineNumberFirstID + ","//int
|
||||
// + "'" + MaterialData.customesName + "',"
|
||||
// + "'" + MaterialData.prepareMaterialDateTime.ToString("G") + "',"
|
||||
// + "'" + MaterialData.fileCode + "',"
|
||||
// + "'" + MaterialData.groupName + "',"
|
||||
// + "'" + MaterialData.notifyCode + "',"
|
||||
// //+ "[功率],[指南文件编号],[装机状态],[适用状态],[物料描述],[计划下达日期],[计划完工日期],主配厂家,零件类型"
|
||||
// + "'" + MaterialData.n_Force + "',"
|
||||
// + "'" + MaterialData.directFileCode + "',"
|
||||
// + "'" + MaterialData.workEngineStatus + "',"
|
||||
// + "'" + MaterialData.adaptDateTime.ToString("G") + "',"
|
||||
// + "'" + MaterialData.materialDescript + "',"
|
||||
// + "'" + MaterialData.planSendedDateTime.ToString("G") + "',"
|
||||
// + "'" + MaterialData.planFinishDateTime.ToString("G") + "',"
|
||||
// + "'" + MaterialData.mainPruduceFatory + "',"
|
||||
// + "" + MaterialData.partType.ToString() + ") ";
|
||||
// return sql;
|
||||
//}
|
||||
/// <summary>
|
||||
/// 线首,用于物料追踪
|
||||
/// 传递到总线上线工位的数据成功,更新isOK=1
|
||||
/// MES_装配数据_发动机号_物料追踪
|
||||
/// SELECT * FROM [MES_装配数据_发动机号_追踪代码] WHERE IsOK = 0
|
||||
/// </summary>
|
||||
/// <param name="firstOpNameTraceCode">上线工位追溯代码</param>
|
||||
/// <returns></returns>
|
||||
//public static bool TableTraceUpdate(int firstOpNameTraceCode)
|
||||
//{
|
||||
// string sql = null;
|
||||
// sql = "UPDATE MES_装配数据_发动机号_追踪代码 SET IsOK = 1 WHERE 上线工位追溯代码 = " + firstOpNameTraceCode.ToString();
|
||||
// return DataAccess.ExecuteSQL_OleDb_Access(sql);
|
||||
//}
|
||||
/// <summary>
|
||||
/// 线首,用于物料追踪
|
||||
/// 查询没有被传递到总线上线工位的数据
|
||||
/// MES_装配数据_发动机号_追踪代码
|
||||
/// SELECT * FROM [MES_装配数据_发动机号_追踪代码] WHERE IsOK = 0
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
//public static bool TableTraceSelect(out DataTable dt)
|
||||
//{
|
||||
// string sql = null;
|
||||
// sql = "SELECT * FROM MES_装配数据_发动机号_追踪代码 WHERE IsOK = 0";
|
||||
// return DataAccess.ExecuteDataTable_OleDb_Access(sql, out dt);
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// 总线上线工位,用于物料追踪
|
||||
/// 增加数据到Access数据库
|
||||
/// MES_装配数据_发动机号_追踪代码
|
||||
/// INSERT INTO [MES_装配数据_发动机号_追踪代码]
|
||||
/// </summary>
|
||||
/// <param name="connectionString_Access_OpNameMainLine">零件类型(1缸体)(2缸盖)(3活塞连杆)</param>
|
||||
/// <returns></returns>
|
||||
//public static bool TableTraceInsert_MainLine(string connectionString_Access_OpNameMainLine)
|
||||
//{
|
||||
// // <summary>
|
||||
// // 上线工位追溯代码
|
||||
// // </summary>
|
||||
// int firstOpNameTraceCode;
|
||||
// string sql = null;
|
||||
// string sql2 = null;
|
||||
// DataTable dt;
|
||||
// DataRow dr;
|
||||
// try
|
||||
// {
|
||||
// // 测试 connectionString_Access_OpNameMainLine 文件是否存在?
|
||||
// if (!File.Exists(connectionString_Access_OpNameMainLine))
|
||||
// {
|
||||
// ////ApplicationLog.WriteLog("file not exists filename=:" + connectionString_Access_OpNameMainLine);
|
||||
// return false;
|
||||
// }
|
||||
|
||||
// // 线首,用于物料追踪
|
||||
// // 查询没有被传递到总线上线工位的数据
|
||||
// // MES_装配数据_发动机号_追踪代码
|
||||
// // SELECT * FROM [MES_装配数据_发动机号_追踪代码] WHERE IsOK = 0
|
||||
// TableTraceSelect(out dt);
|
||||
// if (dt == null) return false;
|
||||
// for (int i = 0; i < dt.Rows.Count; i++)
|
||||
// {
|
||||
// dr = dt.Rows[i];
|
||||
// sql = GetSqlString_TableTraceInsert_MainLine(dr);
|
||||
// if (sql != null)
|
||||
// {
|
||||
// string engineTraceCode = dr[MaterialData.EngineTraceCodeField].ToString();
|
||||
// sql2 = "DELETE FROM MES_装配数据_发动机号_追踪代码 WHERE 追踪代码='" + engineTraceCode + "'";
|
||||
// DataAccess.ExecuteSQL_OleDb_Access(connectionString_Access_OpNameMainLine, sql2);
|
||||
// if (DataAccess.ExecuteSQL_OleDb_Access(connectionString_Access_OpNameMainLine, sql))
|
||||
// {
|
||||
// if (!Convert.IsDBNull(dr[MaterialData.FirstOpNameTraceCodeField]))
|
||||
// {
|
||||
// firstOpNameTraceCode = Convert.ToInt32(dr[MaterialData.FirstOpNameTraceCodeField]);
|
||||
// TableTraceUpdate(firstOpNameTraceCode);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// return true;
|
||||
// }
|
||||
// catch (Exception err)
|
||||
// {
|
||||
// ////ApplicationLog.WriteLog(err.Message);
|
||||
// return false;
|
||||
// }
|
||||
//}
|
||||
/// <summary>
|
||||
/// 线首,用于物料追踪
|
||||
/// 增加数据到Access数据库
|
||||
/// MES_装配数据_发动机号_追踪代码
|
||||
/// INSERT INTO [MES_装配数据_发动机号_追踪代码]
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
//public static bool TableTraceInsert()
|
||||
//{
|
||||
// string sql = null;
|
||||
// sql = GetSqlString_TableTraceInsert();
|
||||
// return DataAccess.ExecuteSQL_OleDb_Access(sql);
|
||||
//}
|
||||
/// <summary>
|
||||
/// 线首,用于物料追踪
|
||||
/// 增加数据到SqlServer数据库
|
||||
/// MES_装配数据_发动机号_追踪代码
|
||||
/// INSERT INTO [MES_装配数据_发动机号_追踪代码]
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static bool TableTraceInsert_SqlServer()
|
||||
{
|
||||
string sql = null;
|
||||
sql = GetSqlString_TableTraceInsert();
|
||||
return DataAccess.ExecuteSQL(sql);
|
||||
}
|
||||
/// <summary>
|
||||
/// 应用于总线上线工位
|
||||
/// 获得增加表[MES_装配数据_发动机号_追踪代码]的SQL语句
|
||||
/// </summary>
|
||||
private static string GetSqlString_TableTraceInsert_MainLine(DataRow dr)
|
||||
{
|
||||
// <summary>
|
||||
// 上线工位追溯代码
|
||||
// </summary>
|
||||
int firstOpNameTraceCode;
|
||||
// <summary>
|
||||
// 订单号
|
||||
// </summary>
|
||||
string orderForm;
|
||||
// <summary>
|
||||
// 主配厂家
|
||||
// </summary>
|
||||
string mainPruduceFatory;
|
||||
// <summary>
|
||||
// 发动号
|
||||
// </summary>
|
||||
string engineNumber;
|
||||
// <summary>
|
||||
// 订单计划发动机号
|
||||
// </summary>
|
||||
string engineNumber_OrderPlan;
|
||||
// <summary>
|
||||
// 追踪代码
|
||||
// </summary>
|
||||
string engineTraceCode;
|
||||
// <summary>
|
||||
// 主物料号
|
||||
// </summary>
|
||||
string mainMaterialNumber;
|
||||
// <summary>
|
||||
// 工位号
|
||||
// </summary>
|
||||
string opName;
|
||||
// <summary>
|
||||
// 到达时间
|
||||
// </summary>
|
||||
DateTime arrivedTime;
|
||||
// <summary>
|
||||
// 离开时间
|
||||
// </summary>
|
||||
DateTime leavedTime;
|
||||
// <summary>
|
||||
// 操作者工号
|
||||
// </summary>
|
||||
string operatorCode;
|
||||
// <summary>
|
||||
// 班次代码
|
||||
// </summary>
|
||||
string operatorShift;
|
||||
// <summary>
|
||||
// SAP物料号
|
||||
// </summary>
|
||||
string sAPMaterialNumber;
|
||||
// <summary>
|
||||
// 发动机型号
|
||||
// </summary>
|
||||
string engineNumberType;
|
||||
// <summary>
|
||||
// 发动机型号代码
|
||||
// </summary>
|
||||
int engineNumberCode;
|
||||
// <summary>
|
||||
// 发动机机型
|
||||
// </summary>
|
||||
string engineNumberBasicType;
|
||||
// <summary>
|
||||
// 发动机数量
|
||||
// </summary>
|
||||
string engineCount;
|
||||
// <summary>
|
||||
// 厂牌编号起始号
|
||||
// </summary>
|
||||
string engineNumberFirstID;
|
||||
// <summary>
|
||||
// 客户名称
|
||||
// </summary>
|
||||
string customesName;
|
||||
// <summary>
|
||||
// 投料日期
|
||||
// </summary>
|
||||
DateTime prepareMaterialDateTime;
|
||||
// <summary>
|
||||
// 文件编号
|
||||
// </summary>
|
||||
string fileCode;
|
||||
// <summary>
|
||||
// 集团名称
|
||||
// </summary>
|
||||
string groupName;
|
||||
// <summary>
|
||||
// 通知号
|
||||
// </summary>
|
||||
string notifyCode;
|
||||
// <summary>
|
||||
// 功率
|
||||
// </summary>
|
||||
string n_Force;
|
||||
// <summary>
|
||||
// 指南文件编号
|
||||
// </summary>
|
||||
string directFileCode;
|
||||
// <summary>
|
||||
// 装机状态
|
||||
// </summary>
|
||||
string workEngineStatus;
|
||||
// <summary>
|
||||
// 适用状态
|
||||
// </summary>
|
||||
DateTime adaptDateTime;
|
||||
// <summary>
|
||||
// 物料描述
|
||||
// </summary>
|
||||
string materialDescript;
|
||||
// <summary>
|
||||
// 计划下达日期
|
||||
// </summary>
|
||||
DateTime planSendedDateTime;
|
||||
// <summary>
|
||||
// 计划完工日期
|
||||
// </summary>
|
||||
DateTime planFinishDateTime;
|
||||
// <summary>
|
||||
// 零件类型
|
||||
// </summary>
|
||||
int partType;
|
||||
|
||||
string sql = null;
|
||||
try
|
||||
{
|
||||
if (Convert.IsDBNull(dr[MaterialData.FirstOpNameTraceCodeField]))
|
||||
{
|
||||
firstOpNameTraceCode = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
firstOpNameTraceCode = Convert.ToInt32(dr[MaterialData.FirstOpNameTraceCodeField]);
|
||||
}
|
||||
|
||||
if (Convert.IsDBNull(dr[MaterialData.OrderFormField]))
|
||||
{
|
||||
orderForm = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
orderForm = dr[MaterialData.OrderFormField].ToString();
|
||||
}
|
||||
|
||||
//
|
||||
if (Convert.IsDBNull(dr[MaterialData.EngineNumber_OrderPlanField]))
|
||||
{
|
||||
engineNumber_OrderPlan = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
engineNumber_OrderPlan = dr[MaterialData.EngineNumber_OrderPlanField].ToString();
|
||||
}
|
||||
if (Convert.IsDBNull(dr[MaterialData.EngineNumberField]))
|
||||
{
|
||||
engineNumber = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
engineNumber = dr[MaterialData.EngineNumberField].ToString();
|
||||
}
|
||||
if (Convert.IsDBNull(dr[MaterialData.EngineTraceCodeField]))
|
||||
{
|
||||
engineTraceCode = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
engineTraceCode = dr[MaterialData.EngineTraceCodeField].ToString();
|
||||
}
|
||||
|
||||
if (Convert.IsDBNull(dr[MaterialData.MainMaterialNumberField]))
|
||||
{
|
||||
mainMaterialNumber = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
mainMaterialNumber = dr[MaterialData.MainMaterialNumberField].ToString();
|
||||
}
|
||||
|
||||
|
||||
if (Convert.IsDBNull(dr[MaterialData.OpNameField]))
|
||||
{
|
||||
opName = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
opName = dr[MaterialData.OpNameField].ToString();
|
||||
}
|
||||
|
||||
|
||||
if (Convert.IsDBNull(dr[MaterialData.ArrivedTimeField]))
|
||||
{
|
||||
arrivedTime = DateTime.Now;
|
||||
}
|
||||
else
|
||||
{
|
||||
arrivedTime = Convert.ToDateTime(dr[MaterialData.ArrivedTimeField]);
|
||||
}
|
||||
|
||||
|
||||
if (Convert.IsDBNull(dr[MaterialData.LeavedTimeField]))
|
||||
{
|
||||
leavedTime = DateTime.Now;
|
||||
}
|
||||
else
|
||||
{
|
||||
leavedTime = Convert.ToDateTime(dr[MaterialData.LeavedTimeField]);
|
||||
}
|
||||
|
||||
|
||||
if (Convert.IsDBNull(dr[MaterialData.OperatorCodeField]))
|
||||
{
|
||||
operatorCode = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
operatorCode = dr[MaterialData.OperatorCodeField].ToString();
|
||||
}
|
||||
|
||||
if (Convert.IsDBNull(dr[MaterialData.OperatorShiftField]))
|
||||
{
|
||||
operatorShift = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
operatorShift = dr[MaterialData.OperatorShiftField].ToString();
|
||||
}
|
||||
|
||||
//+ "[SAP物料号],[发动机型号],[发动机型号代码], [发动机机型], "
|
||||
|
||||
|
||||
if (Convert.IsDBNull(dr[MaterialData.SAPMaterialNumberField]))
|
||||
{
|
||||
sAPMaterialNumber = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
sAPMaterialNumber = dr[MaterialData.SAPMaterialNumberField].ToString();
|
||||
}
|
||||
|
||||
|
||||
if (Convert.IsDBNull(dr[MaterialData.EngineNumberTypeField]))
|
||||
{
|
||||
engineNumberType = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
engineNumberType = dr[MaterialData.EngineNumberTypeField].ToString();
|
||||
}
|
||||
|
||||
if (Convert.IsDBNull(dr[MaterialData.EngineNumberCodeField]))
|
||||
{
|
||||
engineNumberCode = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
engineNumberCode = Convert.ToInt32(dr[MaterialData.EngineNumberCodeField]);
|
||||
}
|
||||
|
||||
|
||||
if (Convert.IsDBNull(dr[MaterialData.EngineNumberBasicTypeField]))
|
||||
{
|
||||
engineNumberBasicType = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
engineNumberBasicType = dr[MaterialData.EngineNumberBasicTypeField].ToString();
|
||||
}
|
||||
|
||||
//+ "[发动机数量], [厂牌编号起始号], [客户名称],[投料日期],[文件编号],[集团名称],[通知号],"
|
||||
|
||||
if (Convert.IsDBNull(dr[MaterialData.EngineCountField]))
|
||||
{
|
||||
engineCount = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
engineCount = dr[MaterialData.EngineCountField].ToString();
|
||||
}
|
||||
|
||||
if (Convert.IsDBNull(dr[MaterialData.EngineNumberFirstIDField]))
|
||||
{
|
||||
engineNumberFirstID = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
engineNumberFirstID = dr[MaterialData.EngineNumberFirstIDField].ToString();
|
||||
}
|
||||
|
||||
if (Convert.IsDBNull(dr[MaterialData.CustomesNameField]))
|
||||
{
|
||||
customesName = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
customesName = dr[MaterialData.CustomesNameField].ToString();
|
||||
}
|
||||
|
||||
|
||||
if (Convert.IsDBNull(dr[MaterialData.PrepareMaterialDateTimeField]))
|
||||
{
|
||||
prepareMaterialDateTime = DateTime.Now;
|
||||
}
|
||||
else
|
||||
{
|
||||
prepareMaterialDateTime = Convert.ToDateTime(dr[MaterialData.PrepareMaterialDateTimeField]);
|
||||
}
|
||||
|
||||
|
||||
if (Convert.IsDBNull(dr[MaterialData.EngineCountField]))
|
||||
{
|
||||
fileCode = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
fileCode = dr[MaterialData.EngineCountField].ToString();
|
||||
}
|
||||
|
||||
|
||||
if (Convert.IsDBNull(dr[MaterialData.GroupNameField]))
|
||||
{
|
||||
groupName = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
groupName = dr[MaterialData.GroupNameField].ToString();
|
||||
}
|
||||
|
||||
|
||||
if (Convert.IsDBNull(dr[MaterialData.NotifyCodeField]))
|
||||
{
|
||||
notifyCode = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
notifyCode = dr[MaterialData.NotifyCodeField].ToString();
|
||||
}
|
||||
|
||||
//+ "[功率],[指南文件编号],[装机状态],[适用状态],[物料描述],[计划下达日期],[计划完工日期],主配厂家,零件类型"
|
||||
|
||||
if (Convert.IsDBNull(dr[MaterialData.N_ForceField]))
|
||||
{
|
||||
n_Force = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
n_Force = dr[MaterialData.N_ForceField].ToString();
|
||||
}
|
||||
|
||||
if (Convert.IsDBNull(dr[MaterialData.DirectFileCodeField]))
|
||||
{
|
||||
directFileCode = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
directFileCode = dr[MaterialData.DirectFileCodeField].ToString();
|
||||
}
|
||||
|
||||
|
||||
if (Convert.IsDBNull(dr[MaterialData.WorkEngineStatusField]))
|
||||
{
|
||||
workEngineStatus = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
workEngineStatus = dr[MaterialData.WorkEngineStatusField].ToString();
|
||||
}
|
||||
|
||||
|
||||
if (Convert.IsDBNull(dr[MaterialData.AdaptDateTimeField]))
|
||||
{
|
||||
adaptDateTime = DateTime.Now;
|
||||
}
|
||||
else
|
||||
{
|
||||
adaptDateTime = Convert.ToDateTime(dr[MaterialData.AdaptDateTimeField]);
|
||||
}
|
||||
|
||||
if (Convert.IsDBNull(dr[MaterialData.MaterialDescriptField]))
|
||||
{
|
||||
materialDescript = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
materialDescript = dr[MaterialData.MaterialDescriptField].ToString();
|
||||
}
|
||||
|
||||
if (Convert.IsDBNull(dr[MaterialData.PlanSendedDateTimeField]))
|
||||
{
|
||||
planSendedDateTime = DateTime.Now;
|
||||
}
|
||||
else
|
||||
{
|
||||
planSendedDateTime = Convert.ToDateTime(dr[MaterialData.PlanSendedDateTimeField]);
|
||||
}
|
||||
|
||||
|
||||
if (Convert.IsDBNull(dr[MaterialData.PlanFinishDateTimeField]))
|
||||
{
|
||||
planFinishDateTime = DateTime.Now;
|
||||
}
|
||||
else
|
||||
{
|
||||
planFinishDateTime = Convert.ToDateTime(dr[MaterialData.PlanFinishDateTimeField]);
|
||||
}
|
||||
|
||||
|
||||
if (Convert.IsDBNull(dr[MaterialData.MainPruduceFatoryField]))
|
||||
{
|
||||
mainPruduceFatory = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
mainPruduceFatory = dr[MaterialData.MainPruduceFatoryField].ToString();
|
||||
}
|
||||
|
||||
|
||||
if (Convert.IsDBNull(dr[MaterialData.PartTypeField]))
|
||||
{
|
||||
partType = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
partType = Convert.ToInt32(dr[MaterialData.PartTypeField]);
|
||||
}
|
||||
|
||||
sql = "INSERT INTO [MES_装配数据_发动机号_追踪代码] " +
|
||||
"(订单号,订单计划发动机号,发动机号,追踪代码,工位号,到达时间,离开时间,操作者工号,班次代码,"
|
||||
+ "[SAP物料号],[发动机型号],[发动机型号代码], [发动机机型], "
|
||||
+ "[发动机数量], [厂牌编号起始号], [客户名称],[投料日期],[文件编号],[集团名称],[通知号],"
|
||||
+ "[功率],[指南文件编号],[装机状态],[适用状态],[物料描述],[计划下达日期],[计划完工日期],[主配厂家],[零件类型])"
|
||||
+ " VALUES ("
|
||||
//上线工位追溯代码,订单号,发动机号,追踪代码,工位号,到达时间,离开时间,操作者工号,班次代码
|
||||
//+ "" + firstOpNameTraceCode + ","
|
||||
+ "'" + orderForm + "',"
|
||||
+ "'" + engineNumber_OrderPlan + "',"
|
||||
+ "'" + engineNumber + "',"
|
||||
+ "'" + engineTraceCode + "',"
|
||||
+ "'" + opName + "',"
|
||||
+ "'" + arrivedTime.ToString("G") + "',"
|
||||
+ "'" + leavedTime.ToString("G") + "',"
|
||||
+ "'" + operatorCode + "',"
|
||||
+ "'" + operatorShift + "',"
|
||||
//+ "[SAP物料号],[发动机型号],[发动机型号代码], [发动机机型], "
|
||||
|
||||
+ "'" + sAPMaterialNumber + "',"
|
||||
+ "'" + engineNumberType + "',"
|
||||
+ "" + engineNumberCode + ","//int
|
||||
+ "'" + engineNumberBasicType + "',"
|
||||
//+ "[发动机数量], [厂牌编号起始号], [客户名称],[投料日期],[文件编号],[集团名称],[通知号],"
|
||||
|
||||
+ "" + engineCount + ","//int
|
||||
+ "'" + engineNumberFirstID + "',"
|
||||
+ "'" + customesName + "',"
|
||||
+ "'" + prepareMaterialDateTime.ToString("G") + "',"
|
||||
+ "'" + fileCode + "',"
|
||||
+ "'" + groupName + "',"
|
||||
+ "'" + notifyCode + "',"
|
||||
//+ "[功率],[指南文件编号],[装机状态],[适用状态],[物料描述],[计划下达日期],[计划完工日期],主配厂家,零件类型"
|
||||
+ "'" + n_Force + "',"
|
||||
+ "'" + directFileCode + "',"
|
||||
+ "'" + workEngineStatus + "',"
|
||||
+ "'" + adaptDateTime.ToString("G") + "',"
|
||||
+ "'" + materialDescript + "',"
|
||||
+ "'" + planSendedDateTime.ToString("G") + "',"
|
||||
+ "'" + planFinishDateTime.ToString("G") + "',"
|
||||
+ "'" + mainPruduceFatory + "',"
|
||||
+ "" + partType.ToString() + ") ";
|
||||
return sql;
|
||||
}
|
||||
catch { return null; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 应用于分线上线工位
|
||||
/// 获得增加表[MES_装配数据_发动机号_追踪代码]的SQL语句
|
||||
/// </summary>
|
||||
private static string GetSqlString_TableTraceInsert()
|
||||
{
|
||||
string sql = null;
|
||||
sql = "INSERT INTO [MES_装配数据_发动机号_追踪代码] " +
|
||||
"(订单号,订单计划发动机号,发动机号,追踪代码,主物料号,工位号,到达时间,离开时间,操作者工号,班次代码,"
|
||||
+ "[SAP物料号],[发动机型号],[发动机型号代码], [发动机机型], "
|
||||
+ "[发动机数量], [厂牌编号起始号], [客户名称],[投料日期],[文件编号],[集团名称],[通知号],"
|
||||
+ "[功率],[指南文件编号],[装机状态],[适用状态],[物料描述],[计划下达日期],[计划完工日期],[主配厂家],[零件类型])"
|
||||
+ " VALUES ("
|
||||
//订单号,发动机号,追踪代码,工位号,到达时间,离开时间,操作者工号,班次代码
|
||||
+ "'" + MaterialData.orderForm + "',"
|
||||
+ "'" + MaterialData.engineNumber_OrderPlan + "',"
|
||||
+ "'" + MaterialData.engineNumber + "',"
|
||||
+ "'" + MaterialData.engineTraceCode + "',"
|
||||
+ "'" + MaterialData.mainMaterialNumber + "',"
|
||||
+ "'" + MaterialData.opName + "',"
|
||||
+ "'" + MaterialData.arrivedTime.ToString("G") + "',"
|
||||
+ "'" + MaterialData.leavedTime.ToString("G") + "',"
|
||||
+ "'" + MaterialData.operatorCode + "',"
|
||||
+ "'" + MaterialData.operatorShift + "',"
|
||||
//+ "[SAP物料号],[发动机型号],[发动机型号代码], [发动机机型], "
|
||||
|
||||
+ "'" + MaterialData.sAPMaterialNumber + "',"
|
||||
+ "'" + MaterialData.engineNumberType + "',"
|
||||
+ "" + MaterialData.engineNumberCode + ","//int
|
||||
+ "'" + MaterialData.engineNumberBasicType + "',"
|
||||
//+ "[发动机数量], [厂牌编号起始号], [客户名称],[投料日期],[文件编号],[集团名称],[通知号],"
|
||||
|
||||
+ "" + MaterialData.engineCount + ","//int
|
||||
+ "'" + MaterialData.engineNumberFirstID + "',"
|
||||
+ "'" + MaterialData.customesName + "',"
|
||||
+ "'" + MaterialData.prepareMaterialDateTime.ToString("G") + "',"
|
||||
+ "'" + MaterialData.fileCode + "',"
|
||||
+ "'" + MaterialData.groupName + "',"
|
||||
+ "'" + MaterialData.notifyCode + "',"
|
||||
//+ "[功率],[指南文件编号],[装机状态],[适用状态],[物料描述],[计划下达日期],[计划完工日期],主配厂家,零件类型"
|
||||
+ "'" + MaterialData.n_Force + "',"
|
||||
+ "'" + MaterialData.directFileCode + "',"
|
||||
+ "'" + MaterialData.workEngineStatus + "',"
|
||||
+ "'" + MaterialData.adaptDateTime.ToString("G") + "',"
|
||||
+ "'" + MaterialData.materialDescript + "',"
|
||||
+ "'" + MaterialData.planSendedDateTime.ToString("G") + "',"
|
||||
+ "'" + MaterialData.planFinishDateTime.ToString("G") + "',"
|
||||
+ "'" + MaterialData.mainPruduceFatory + "',"
|
||||
+ "" + MaterialData.partType.ToString() + ") ";
|
||||
return sql;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,281 @@
|
||||
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
|
||||
{
|
||||
/// <summary>
|
||||
/// 关键零部件追溯
|
||||
/// </summary>
|
||||
public partial class BaseDataSystemMES
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据工位号,将计划下达到工位PC
|
||||
/// [MES_计划BOM_订单计划下达_执行顺序]
|
||||
/// [MES_计划BOM_发动机号]
|
||||
/// [MES_计划BOM_发动机装配指南]
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
//public static void GetOrderForm(string opName)
|
||||
//{
|
||||
// //订单号
|
||||
// string orderForm;
|
||||
// //1:获得需要下达的订单列表
|
||||
// DataTable dt_orderForm;
|
||||
// OrderFormOpName_Select(opName, out dt_orderForm);
|
||||
// if (dt_orderForm != null)
|
||||
// {
|
||||
// for (int i = 0; i < dt_orderForm.Rows.Count; i++)
|
||||
// {
|
||||
// try
|
||||
// {
|
||||
// orderForm = dt_orderForm.Rows[i]["订单号"].ToString();
|
||||
// //2:根据订单号,工位号,获得[MES_计划BOM_订单计划下达_执行顺序]
|
||||
// //[MES_计划BOM_发动机号]
|
||||
// //[MES_计划BOM_发动机装配指南]
|
||||
// DataTable dt_OrderFormOrderBy;
|
||||
// DataTable dt_EngineID;
|
||||
// DataTable dt_OperationGuid;
|
||||
// GetOrderPlanEngineNumber_OrderForm(orderForm, out dt_OrderFormOrderBy);
|
||||
// GetOrderPlanEngineNumberToPcStation(orderForm, out dt_EngineID);
|
||||
// GetOperationGuid(orderForm, opName, out dt_OperationGuid);
|
||||
|
||||
// //3将数据导入到工位PC
|
||||
|
||||
// if (!GetOrderPlanEngineNumberToPcStation_OrderForm_Delete(orderForm)) continue;
|
||||
// if(!GetOrderPlanEngineNumberToPcStation_Delete(orderForm)) continue;
|
||||
// if(!GetOperationGuidToPcStation_Delete(orderForm)) continue;
|
||||
|
||||
// if(!GetOrderPlanEngineNumberToPcStation_OrderForm(dt_OrderFormOrderBy)) continue;
|
||||
// if(!GetOrderPlanEngineNumberToPcStation(dt_EngineID)) continue;
|
||||
// if(!GetOperationGuidToPcStation(dt_OperationGuid)) continue;
|
||||
|
||||
// OrderFormOpName_Update(orderForm, opName);
|
||||
// }
|
||||
// catch (Exception err)
|
||||
// {
|
||||
// //ApplicationLog.WriteLog(err,err.Message);
|
||||
// }
|
||||
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
/// <summary>
|
||||
/// "delete from [MES_计划BOM_订单计划下达_执行顺序] where 订单号='" + orderForm + "'";
|
||||
/// </summary>
|
||||
/// <param name="orderForm"></param>
|
||||
//private static bool GetOrderPlanEngineNumberToPcStation_OrderForm_Delete(string orderForm)
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "delete from [MES_计划BOM_订单计划下达_执行顺序] where 订单号='" + orderForm + "'";
|
||||
// return DataAccess.ExecuteSQL_OleDb_Access(sql);
|
||||
//}
|
||||
/// <summary>
|
||||
/// "delete from [MES_计划BOM_发动机号] where 订单号='" + orderForm + "'";
|
||||
/// </summary>
|
||||
/// <param name="orderForm"></param>
|
||||
//private static bool GetOrderPlanEngineNumberToPcStation_Delete(string orderForm)
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "delete from [MES_计划BOM_发动机号] where 订单号='" + orderForm + "'";
|
||||
// return DataAccess.ExecuteSQL_OleDb_Access(sql);
|
||||
//}
|
||||
/// <summary>
|
||||
/// "delete from [MES_计划BOM_订单计划下达_执行顺序] where 订单号='" + orderForm + "'";
|
||||
/// </summary>
|
||||
/// <param name="orderForm"></param>
|
||||
//private static bool GetOperationGuidToPcStation_Delete(string orderForm)
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "delete from [MES_计划BOM_发动机装配指南] where 订单号='" + orderForm + "'";
|
||||
// return DataAccess.ExecuteSQL_OleDb_Access(sql);
|
||||
//}
|
||||
/// <summary>
|
||||
/// exec MES_计划BOM_发动机订单计划_下达工位_修改
|
||||
/// set 同步状态=1,同步日期=getdate()
|
||||
/// </summary>
|
||||
/// <param name="orderForm"></param>
|
||||
/// <param name="opName"></param>
|
||||
public static void OrderFormOpName_Update(string orderForm,string opName)
|
||||
{
|
||||
string sql;
|
||||
sql = "exec MES_计划BOM_发动机订单计划_下达工位_修改 '"+orderForm+"','"+opName+"'";
|
||||
DataAccess.ExecuteSQL(sql);
|
||||
}
|
||||
/// <summary>
|
||||
/// 获得工位对应的订单号
|
||||
/// MES_计划BOM_发动机订单计划_下达工位
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="dt"></param>
|
||||
public static void OrderFormOpName_Select(string opName, out DataTable dt)
|
||||
{
|
||||
string sql;
|
||||
|
||||
|
||||
|
||||
sql = "select 订单号 from MES_计划BOM_发动机订单计划_下达工位 "
|
||||
+ " where 同步状态 = 0 and 工位号='" + opName + "'";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 下达装配BOM到工位Access文件 INSERT INTO [MES_计划BOM_发动机装配指南]
|
||||
/// </summary>
|
||||
/// <param name="dt"></param>
|
||||
//static public bool GetOperationGuidToPcStation(DataTable dt)
|
||||
//{
|
||||
// string sql;
|
||||
// sql =
|
||||
// "INSERT INTO [MES_计划BOM_发动机装配指南]" +
|
||||
// "([订单号], [主配厂家],[工位号], [工位名称], [物料号], [零件图号], [零件名称]," +
|
||||
// " [零件数量],[是否扫描],[扫描方式],[是否主物料],[厂家代码], [生产厂家],[操作指导] )" +
|
||||
// "VALUES(@订单号,@主配厂家,@工位号,@工位名称,@物料号,@零件图号,@零件名称," +
|
||||
// "@零件数量,@是否扫描,@扫描方式,@是否主物料,@厂家代码,@生产厂家,@操作指导)";
|
||||
// OleDbParameter[] thisParms = new OleDbParameter[14];
|
||||
// thisParms[0] = new OleDbParameter("@订单号", OleDbType.VarChar, 50, "订单号");
|
||||
// thisParms[1] = new OleDbParameter("@主配厂家", OleDbType.VarChar, 50, "主配厂家");
|
||||
// thisParms[2] = new OleDbParameter("@工位号", OleDbType.VarChar, 50, "工位号");
|
||||
// thisParms[3] = new OleDbParameter("@工位名称", OleDbType.VarChar, 255, "工位名称");
|
||||
// thisParms[4] = new OleDbParameter("@物料号", OleDbType.VarChar, 50, "物料号");
|
||||
// thisParms[5] = new OleDbParameter("@零件图号", OleDbType.VarChar, 50, "零件图号");
|
||||
// thisParms[6] = new OleDbParameter("@零件名称", OleDbType.VarChar, 255, "零件名称");
|
||||
// thisParms[7] = new OleDbParameter("@零件数量", OleDbType.Integer, 4, "零件数量");
|
||||
// thisParms[8] = new OleDbParameter("@是否扫描", OleDbType.Integer, 4, "是否扫描");
|
||||
// thisParms[9] = new OleDbParameter("@扫描方式", OleDbType.Integer, 4, "扫描方式");
|
||||
// thisParms[10] = new OleDbParameter("@是否主物料", OleDbType.Integer, 4, "是否主物料");
|
||||
// thisParms[11] = new OleDbParameter("@厂家代码", OleDbType.VarChar, 255, "厂家代码");
|
||||
// thisParms[12] = new OleDbParameter("@生产厂家", OleDbType.VarChar, 255, "生产厂家");
|
||||
// thisParms[13] = new OleDbParameter("@操作指导", OleDbType.VarChar, 255, "操作指导");
|
||||
|
||||
// return DataAccess.ExecuteDataTable_OleDb_Insert_Access(sql, dt, ref thisParms);
|
||||
|
||||
//}
|
||||
/// <summary>
|
||||
/// 下达装配BOM的发动机号到工位Access文件 INSERT INTO [MES_计划BOM_发动机号]
|
||||
/// </summary>
|
||||
/// <param name="dt"></param>
|
||||
//static public bool GetOrderPlanEngineNumberToPcStation(DataTable dt)
|
||||
//{
|
||||
// string sql;
|
||||
// sql =
|
||||
// "INSERT INTO [MES_计划BOM_发动机号]" +
|
||||
// "([发动机号], [订单号], [SAP物料号], [发动机型号], [发动机型号代码], [发动机机型]," +
|
||||
// "[发动机数量], [厂牌编号起始号], [客户名称], [投料日期], [文件编号], [集团名称], [通知号], " +
|
||||
// "[功率], [指南文件编号], [装机状态], [适用状态], [物料描述],[计划下达日期])" +
|
||||
// "VALUES(@发动机号,@订单号,@SAP物料号,@发动机型号,@发动机型号代码,@发动机机型," +
|
||||
// "@发动机数量,@厂牌编号起始号,@客户名称,@投料日期,@文件编号,@集团名称,@通知号," +
|
||||
// "@功率,@指南文件编号,@装机状态,@适用状态,@物料描述,@计划下达日期)";
|
||||
// OleDbParameter[] thisParms = new OleDbParameter[19];
|
||||
// thisParms[0] = new OleDbParameter("@发动机号", OleDbType.VarChar, 50, "发动机号");
|
||||
// thisParms[1] = new OleDbParameter("@订单号", OleDbType.VarChar, 50, "订单号");
|
||||
// thisParms[2] = new OleDbParameter("@SAP物料号", OleDbType.VarChar, 50, "SAP物料号");
|
||||
// thisParms[3] = new OleDbParameter("@发动机型号", OleDbType.VarChar, 50, "发动机型号");
|
||||
// thisParms[4] = new OleDbParameter("@发动机型号代码", OleDbType.Integer, 4, "发动机型号代码");
|
||||
// thisParms[5] = new OleDbParameter("@发动机机型", OleDbType.VarChar, 50, "发动机机型");
|
||||
|
||||
// thisParms[6] = new OleDbParameter("@发动机数量", OleDbType.Integer, 4, "发动机数量");
|
||||
// thisParms[7] = new OleDbParameter("@厂牌编号起始号", OleDbType.VarChar, 50, "厂牌编号起始号");
|
||||
// thisParms[8] = new OleDbParameter("@客户名称", OleDbType.VarChar, 255, "客户名称");
|
||||
// thisParms[9] = new OleDbParameter("@投料日期", OleDbType.DBDate, 8, "投料日期");
|
||||
// thisParms[10] = new OleDbParameter("@文件编号", OleDbType.VarChar, 50, "文件编号");
|
||||
// thisParms[11] = new OleDbParameter("@集团名称", OleDbType.VarChar, 255, "集团名称");
|
||||
// thisParms[12] = new OleDbParameter("@通知号", OleDbType.VarChar, 50, "通知号");
|
||||
|
||||
// thisParms[13] = new OleDbParameter("@功率", OleDbType.VarChar, 50, "功率");
|
||||
// thisParms[14] = new OleDbParameter("@指南文件编号", OleDbType.VarChar, 50, "指南文件编号");
|
||||
// thisParms[15] = new OleDbParameter("@装机状态", OleDbType.VarChar, 50, "装机状态");
|
||||
// thisParms[16] = new OleDbParameter("@适用状态", OleDbType.VarChar, 50, "适用状态");
|
||||
// thisParms[17] = new OleDbParameter("@物料描述", OleDbType.VarChar, 255, "物料描述");
|
||||
// thisParms[18] = new OleDbParameter("@计划下达日期", OleDbType.DBDate, 8, "计划下达日期");
|
||||
|
||||
// return DataAccess.ExecuteDataTable_OleDb_Insert_Access(sql, dt, ref thisParms);
|
||||
|
||||
//}
|
||||
/// <summary>
|
||||
/// 下达装配BOM的发动机号到工位Access文件 INSERT INTO [MES_计划BOM_订单计划下达_执行顺序]
|
||||
/// </summary>
|
||||
/// <param name="dt"></param>
|
||||
//static public bool GetOrderPlanEngineNumberToPcStation_OrderForm(DataTable dt)
|
||||
//{
|
||||
// string sql;
|
||||
// sql =
|
||||
// "INSERT INTO [MES_计划BOM_订单计划下达_执行顺序]" +
|
||||
// "([订单号],[执行顺序],[SAP物料号], [发动机型号], [发动机型号代码], [发动机机型]," +
|
||||
// "[发动机数量], [厂牌编号起始号], [客户名称], [投料日期], [文件编号], [集团名称], [通知号], " +
|
||||
// "[功率], [指南文件编号], [装机状态], [适用状态], [物料描述],[计划下达日期])" +
|
||||
// "VALUES(@订单号,@执行顺序,@SAP物料号,@发动机型号,@发动机型号代码,@发动机机型," +
|
||||
// "@发动机数量,@厂牌编号起始号,@客户名称,@投料日期,@文件编号,@集团名称,@通知号," +
|
||||
// "@功率,@指南文件编号,@装机状态,@适用状态,@物料描述,@计划下达日期)";
|
||||
// OleDbParameter[] thisParms = new OleDbParameter[19];
|
||||
// thisParms[0] = new OleDbParameter("@订单号", OleDbType.VarChar, 50, "订单号");
|
||||
// thisParms[1] = new OleDbParameter("@执行顺序", OleDbType.Integer, 4, "执行顺序");
|
||||
// thisParms[2] = new OleDbParameter("@SAP物料号", OleDbType.VarChar, 50, "SAP物料号");
|
||||
// thisParms[3] = new OleDbParameter("@发动机型号", OleDbType.VarChar, 50, "发动机型号");
|
||||
// thisParms[4] = new OleDbParameter("@发动机型号代码", OleDbType.Integer, 4, "发动机型号代码");
|
||||
// thisParms[5] = new OleDbParameter("@发动机机型", OleDbType.VarChar, 50, "发动机机型");
|
||||
|
||||
// thisParms[6] = new OleDbParameter("@发动机数量", OleDbType.Integer, 4, "发动机数量");
|
||||
// thisParms[7] = new OleDbParameter("@厂牌编号起始号", OleDbType.VarChar, 50, "厂牌编号起始号");
|
||||
// thisParms[8] = new OleDbParameter("@客户名称", OleDbType.VarChar, 255, "客户名称");
|
||||
// thisParms[9] = new OleDbParameter("@投料日期", OleDbType.DBDate, 8, "投料日期");
|
||||
// thisParms[10] = new OleDbParameter("@文件编号", OleDbType.VarChar, 50, "文件编号");
|
||||
// thisParms[11] = new OleDbParameter("@集团名称", OleDbType.VarChar, 255, "集团名称");
|
||||
// thisParms[12] = new OleDbParameter("@通知号", OleDbType.VarChar, 50, "通知号");
|
||||
|
||||
// thisParms[13] = new OleDbParameter("@功率", OleDbType.VarChar, 50, "功率");
|
||||
// thisParms[14] = new OleDbParameter("@指南文件编号", OleDbType.VarChar, 50, "指南文件编号");
|
||||
// thisParms[15] = new OleDbParameter("@装机状态", OleDbType.VarChar, 50, "装机状态");
|
||||
// thisParms[16] = new OleDbParameter("@适用状态", OleDbType.VarChar, 50, "适用状态");
|
||||
// thisParms[17] = new OleDbParameter("@物料描述", OleDbType.VarChar, 255, "物料描述");
|
||||
// thisParms[18] = new OleDbParameter("@计划下达日期", OleDbType.DBDate, 8, "计划下达日期");
|
||||
|
||||
// return DataAccess.ExecuteDataTable_OleDb_Insert_Access(sql, dt, ref thisParms);
|
||||
|
||||
//}
|
||||
/// <summary>
|
||||
/// 根据订单号,工位号获得[MES_计划BOM_发动机装配指南]
|
||||
/// </summary>
|
||||
/// <param name="orderForm">订单号</param>
|
||||
/// <param name="opName">工位号</param>
|
||||
/// <param name="dt">MES_计划BOM_发动机装配指南</param>
|
||||
/// <returns></returns>
|
||||
static public bool GetOperationGuid(string orderForm,string opName,out DataTable dt)
|
||||
{
|
||||
string sql;
|
||||
sql = "exec MES_计划BOM_发动机装配指南_查询_下达到工位 '" + orderForm + "','" + opName + "'";
|
||||
return DataAccess.ExecuteDataTable(sql, out dt);
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据订单号 [MES_计划BOM_订单计划下达_执行顺序]
|
||||
/// </summary>
|
||||
/// <param name="orderForm">订单号</param>
|
||||
/// <param name="dt">[MES_计划BOM_订单计划下达_执行顺序] </param>
|
||||
static public bool GetOrderPlanEngineNumber_OrderForm(string orderForm, out DataTable dt)
|
||||
{
|
||||
string sql;
|
||||
sql = "exec MES_计划BOM_发动机订单计划_查询_下达到工位 '" + orderForm + "'";
|
||||
return DataAccess.ExecuteDataTable(sql, out dt);
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据订单号 [MES_计划BOM_发动机号]
|
||||
/// </summary>
|
||||
/// <param name="orderForm">订单号</param>
|
||||
/// <param name="dt">[MES_计划BOM_发动机号]</param>
|
||||
static public bool GetOrderPlanEngineNumberToPcStation(string orderForm, out DataTable dt)
|
||||
{
|
||||
string sql;
|
||||
sql = "exec MES_计划BOM_发动机号_查询_下达到工位 '" + orderForm + "'";
|
||||
return DataAccess.ExecuteDataTable(sql, out dt);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Data.OleDb;
|
||||
|
||||
//using SystemFramework;
|
||||
using DataLinkMesWork;
|
||||
namespace bizFacade
|
||||
{
|
||||
public partial class BaseDataSystemMES
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 从数据库服务器获得[数据MES_装配数据_发动机号_追踪代码_下达工位]数据,
|
||||
/// 保存到Access中,同时更新[是否同步]标志。
|
||||
/// </summary>
|
||||
/// <param name="opNameTraceCode">线首工位</param>
|
||||
/// <param name="opName">当前工位</param>
|
||||
/// <returns></returns>
|
||||
//public static void GetTraceCodeDataTableFromSqlServer_OpName_InsertIntoAccess(string opNameTraceCode, string opName)
|
||||
//{
|
||||
// DataTable dt;
|
||||
// if (GetTraceCodeDataTableFromSqlServer_OpName(opNameTraceCode, opName, out dt))
|
||||
// {
|
||||
// if (dt != null)
|
||||
// {
|
||||
// if (dt.Rows.Count > 0)
|
||||
// {
|
||||
// if (TableTraceInsert_Access(dt))
|
||||
// {
|
||||
// GetTraceCodeDataTableFromSqlServer_OpName_Update(opNameTraceCode, opName);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
/// <summary>
|
||||
/// 上线工位的[MES_装配数据_发动机号_追踪代码]数据
|
||||
/// 从数据库服务器
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private DataTable GetTraceCodeDataTableFromSqlServer(string opName)
|
||||
{
|
||||
DataTable dt;
|
||||
string sql;
|
||||
sql = "select 订单号,订单计划发动机号,发动机号,追踪代码,主物料号,工位号,操作者工号,班次代码,SAP物料号,发动机型号,发动机型号代码,发动机机型"
|
||||
+ " from MES_装配数据_发动机号_追踪代码 where IsOK=0 and 工位号='" + opName + "'";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
return dt;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 从数据库服务器获得[数据MES_装配数据_发动机号_追踪代码_下达工位]数据
|
||||
/// </summary>
|
||||
/// <param name="opNameTraceCode">线首工位</param>
|
||||
/// <param name="opName">当前工位</param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
private static bool GetTraceCodeDataTableFromSqlServer_OpName(string opNameTraceCode, string opName, out DataTable dt)
|
||||
{
|
||||
string sql;
|
||||
sql = "select 订单号,订单计划发动机号,发动机号,追踪代码,主物料号,工位号,操作者工号,班次代码,SAP物料号,发动机型号,发动机型号代码,发动机机型"
|
||||
+ " from MES_装配数据_发动机号_追踪代码_下达工位 where 是否同步=0 " + " and 下达工位='" + opName + "'";
|
||||
return DataAccess.ExecuteDataTable(sql, out dt);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 从数据库服务器获得[数据MES_装配数据_发动机号_追踪代码_下达工位]数据
|
||||
/// update 数据MES_装配数据_发动机号_追踪代码_下达工位 set 是否同步=1
|
||||
/// </summary>
|
||||
/// <param name="opNameTraceCode">线首工位</param>
|
||||
/// <param name="opName">当前工位</param>
|
||||
/// <returns></returns>
|
||||
private static bool GetTraceCodeDataTableFromSqlServer_OpName_Update(string opNameTraceCode, string opName)
|
||||
{
|
||||
string sql;
|
||||
sql = "update MES_装配数据_发动机号_追踪代码_下达工位 set 是否同步=1 where 是否同步=0 and 工位号='" + opNameTraceCode + "' and 下达工位='" + opName + "'";
|
||||
return DataAccess.ExecuteSQL(sql);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
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
|
||||
{
|
||||
/// <summary>
|
||||
/// MES_计划BOM_工位操作指南
|
||||
/// </summary>
|
||||
public partial class BaseDataSystemMES
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public static void TestConnection()
|
||||
{
|
||||
//SQLCommon.TestConnection();
|
||||
}
|
||||
/// <summary>
|
||||
/// 更新 "update [MES_计划BOM_工位操作指南] set 工位操作指导=?,工位指导图片=? where 发动机型号代码=?
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
//public static void OpNameGuidPic_Update(string opName)
|
||||
//{
|
||||
// DataTable dt;
|
||||
// OpNameGuidPic_Select(opName, out dt);
|
||||
// OpNameGuidPic_Update(opName, dt);
|
||||
//}
|
||||
/// <summary>
|
||||
/// 更新 MES_计划BOM_工位与名称 工位基本指导图片
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
//public static void OpNameGuidBasicPic_Update(string opName)
|
||||
//{
|
||||
// DataTable dt;
|
||||
// OpNameGuidBasicPic_Select(opName, out dt);
|
||||
// if (dt != null)
|
||||
// {
|
||||
// if (dt.Rows.Count > 0)
|
||||
// {
|
||||
// OpNameGuidBasicPic_Update(opName, dt);
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
/// <summary>
|
||||
/// select 工位基本指导图片 MES_计划BOM_工位与名称
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="dt"></param>
|
||||
public static void OpNameGuidBasicPic_Select(string opName, out DataTable dt)
|
||||
{
|
||||
string sql;
|
||||
sql = "select 工位基本指导图片 from MES_计划BOM_工位与名称 where 工位号='" + opName + "'";
|
||||
//如果与SqlServer数据库通讯正常(同步通讯)
|
||||
//if (SQLCommon.SqlServerConnectionStatus)
|
||||
{
|
||||
if (!DataAccess.ExecuteDataTable(sql, out dt))
|
||||
{
|
||||
//DataAccess.ExecuteDataTable_OleDb_Access(sql, out dt);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
////如果与SqlServer数据库通讯不正常(异步通讯)
|
||||
//else
|
||||
//{
|
||||
// DataAccess.ExecuteDataTable_OleDb_Access(sql, out dt);
|
||||
//}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// update [MES_计划BOM_工位与名称] set 工位基本指导图片=@工位基本指导图片 where 工位号
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="dt"></param>
|
||||
//static public bool OpNameGuidBasicPic_Update(string opName, DataTable dt)
|
||||
//{
|
||||
// string sql;
|
||||
// sql =
|
||||
// "update [MES_计划BOM_工位与名称] set 工位基本指导图片=? where 工位号='" + opName + "'";
|
||||
// OleDbParameter[] thisParms = new OleDbParameter[1];
|
||||
// //thisParms[0] = new OleDbParameter("@工位基本指导图片", dt.Rows[0]["工位基本指导图片"]);
|
||||
// thisParms[0] = new OleDbParameter("@工位基本指导图片", OleDbType.Binary, 0, "工位基本指导图片");
|
||||
// return DataAccess.ExecuteDataTable_OleDb_Update(sql, dt, ref thisParms);
|
||||
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// select 工位基本指导图片 MES_计划BOM_工位与名称
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="dt"></param>
|
||||
public static void OpNameGuidPic_Select(string opName, out DataTable dt)
|
||||
{
|
||||
string sql;
|
||||
sql = "select 发动机型号代码,工位操作指导,工位指导图片 from [MES_计划BOM_工位操作指南] where 工位号='" + opName + "'";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
}
|
||||
/// <summary>
|
||||
/// update [MES_计划BOM_工位与名称] set 工位基本指导图片=@工位基本指导图片 where 工位号
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="dt"></param>
|
||||
//static public bool OpNameGuidPic_Update(string opName, DataTable dt)
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "update [MES_计划BOM_工位操作指南] set 工位操作指导=?,工位指导图片=? where 发动机型号代码=? and 工位号='" + opName + "'";
|
||||
// OleDbParameter[] thisParms = new OleDbParameter[3];
|
||||
// //thisParms[0] = new OleDbParameter("@工位基本指导图片", dt.Rows[0]["工位基本指导图片"]);
|
||||
// thisParms[0] = new OleDbParameter("@工位操作指导", OleDbType.VarChar, 255, "工位操作指导");
|
||||
// thisParms[1] = new OleDbParameter("@工位指导图片", OleDbType.Binary, 0, "工位指导图片");
|
||||
// thisParms[2] = new OleDbParameter("@发动机型号代码", OleDbType.Integer, 4, "发动机型号代码");
|
||||
|
||||
// return DataAccess.ExecuteDataTable_OleDb_Update(sql, dt, ref thisParms);
|
||||
|
||||
//}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,338 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Data.OleDb;
|
||||
|
||||
//using SystemFramework;
|
||||
using DataLinkMesWork;
|
||||
namespace bizFacade
|
||||
{
|
||||
public partial class BaseDataSystemMES
|
||||
{
|
||||
/// <summary>
|
||||
/// MES_装配数据_零部件追溯_数据主表
|
||||
/// </summary>
|
||||
/// <param name="traceID"></param>
|
||||
static public void AssemblyPartIndexTableInsert(out long traceID)
|
||||
{
|
||||
traceID = 0;
|
||||
try
|
||||
{
|
||||
string sql = GetSqlStringAssemblyPartIndexTable();
|
||||
//if (SQLCommon.SqlServerConnectionStatus)
|
||||
{
|
||||
DataAccess.ExecuteNonQuery_newID(sql, out traceID);
|
||||
|
||||
}
|
||||
//if (!SQLCommon.SqlServerConnectionStatus)
|
||||
//{
|
||||
// DataAccess.ExecuteNonQuery_newID_OleDb(sql, out traceID);
|
||||
//}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
////ApplicationLog.WriteLog(err, err.Message);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// MES_装配数据_零部件追溯_增加
|
||||
/// </summary>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static void VerifyAssemblyPartTableInsert(DataTable dt)
|
||||
{
|
||||
|
||||
//if (SQLCommon.SqlServerConnectionStatus)
|
||||
{
|
||||
//如果与SQL Server 数据库通讯失败,ApplicationConfig.connectionStringPIS_NEW_Value = "0"
|
||||
VerifyAssemblyPartTableInsert_SqlServer(dt);
|
||||
}
|
||||
//if (!SQLCommon.SqlServerConnectionStatus)
|
||||
//{
|
||||
// VerifyAssemblyPartTableInsert_Access(dt);
|
||||
//}
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 同步通讯方式
|
||||
/// MES_装配数据_零部件追溯_增加
|
||||
/// SQL Server 数据库
|
||||
/// </summary>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static bool VerifyAssemblyPartTableInsert_SqlServer(DataTable dt)
|
||||
{
|
||||
string sql;
|
||||
sql = "INSERT INTO [MES_装配数据_零部件追溯]"
|
||||
+ "([追溯代码],[订单号],[SAP物料号],[发动机型号],[发动机型号代码], [发动机机型], "
|
||||
+ "[发动机数量], [厂牌编号起始号], [客户名称],[投料日期],[文件编号],[集团名称],[通知号],"
|
||||
+ "[功率],[指南文件编号],[装机状态],[适用状态],[物料描述],[计划下达日期],[计划完工日期],"
|
||||
+ "[主配厂家],[工位号], [工位名称],[物料号], [零件图号], [零件名称], [零件数量],"
|
||||
+ "[是否扫描],[扫描方式代码], [扫描方式], [是否主物料],[厂家代码],[生产厂家], "
|
||||
+ "[操作指导],[发动机号],[追踪代码],[主物料号],[物料号表索引号],[零件数量验证],"
|
||||
+ "[物料条码], [物料条码物料号], [物料条码批次],[验证结果], [操作者工号], [操作者姓名], [班次代码], "
|
||||
+ "物料来源代码,物料来源,是否禁用代码,是否禁用,被强制验证物料号,"
|
||||
+ "更改代码,更改原因,零件类型,操作时间)"
|
||||
|
||||
+ "VALUES(@追溯代码,@订单号,@SAP物料号,@发动机型号,@发动机型号代码,@发动机机型,"
|
||||
+ "@发动机数量,@厂牌编号起始号,@客户名称,@投料日期,@文件编号,@集团名称,@通知号,"
|
||||
+ "@功率,@指南文件编号,@装机状态,@适用状态,@物料描述,@计划下达日期,@计划完工日期,"
|
||||
+ "@主配厂家,@工位号,@工位名称,@物料号,@零件图号,@零件名称,@零件数量,"
|
||||
+ " @是否扫描,@扫描方式代码,@扫描方式,@是否主物料,@厂家代码,@生产厂家,"
|
||||
+ "@操作指导,@发动机号,@追踪代码,@主物料号,@物料号表索引号,@零件数量验证,"
|
||||
+ "@物料条码,@物料条码物料号,@物料条码批次,@验证结果,@操作者工号,@操作者姓名,@班次代码,"
|
||||
+ "@物料来源代码,@物料来源,@是否禁用代码,@是否禁用,@被强制验证物料号,"
|
||||
+ "@更改代码,@更改原因,@零件类型,@操作时间)";
|
||||
|
||||
|
||||
|
||||
SqlParameter[] thisParmsSql = new SqlParameter[55];
|
||||
// + "([订单号],[SAP物料号],[发动机型号],[发动机型号代码], [发动机机型], "
|
||||
thisParmsSql[0] = new SqlParameter("@追溯代码", SqlDbType.Int, 4, "追溯代码");
|
||||
thisParmsSql[1] = new SqlParameter("@订单号", SqlDbType.NVarChar, 50, "订单号");
|
||||
thisParmsSql[2] = new SqlParameter("@SAP物料号", SqlDbType.NVarChar, 50, "SAP物料号");
|
||||
thisParmsSql[3] = new SqlParameter("@发动机型号", SqlDbType.NVarChar, 50, "发动机型号");
|
||||
thisParmsSql[4] = new SqlParameter("@发动机型号代码", SqlDbType.Int, 4, "发动机型号代码");
|
||||
thisParmsSql[5] = new SqlParameter("@发动机机型", SqlDbType.NVarChar, 50, "发动机机型");
|
||||
|
||||
// + "@发动机数量,@厂牌编号起始号,@客户名称,@投料日期,@文件编号,@集团名称,@通知号,"
|
||||
thisParmsSql[6] = new SqlParameter("@发动机数量", SqlDbType.Int, 4, "发动机数量");
|
||||
thisParmsSql[7] = new SqlParameter("@厂牌编号起始号", SqlDbType.Int, 4, "厂牌编号起始号");
|
||||
thisParmsSql[8] = new SqlParameter("@客户名称", SqlDbType.NVarChar, 50, "客户名称");
|
||||
thisParmsSql[9] = new SqlParameter("@投料日期", SqlDbType.DateTime, 8, "投料日期");
|
||||
thisParmsSql[10] = new SqlParameter("@文件编号", SqlDbType.NVarChar, 50, "文件编号");
|
||||
thisParmsSql[11] = new SqlParameter("@集团名称", SqlDbType.NVarChar, 50, "集团名称");
|
||||
thisParmsSql[12] = new SqlParameter("@通知号", SqlDbType.NVarChar, 50, "通知号");
|
||||
|
||||
// + "@功率,@指南文件编号,@装机状态,@适用状态,@物料描述,@计划下达日期,@计划完工日期,"
|
||||
thisParmsSql[13] = new SqlParameter("@功率", SqlDbType.NVarChar, 50, "功率");
|
||||
thisParmsSql[14] = new SqlParameter("@指南文件编号", SqlDbType.NVarChar, 50, "指南文件编号");
|
||||
thisParmsSql[15] = new SqlParameter("@装机状态", SqlDbType.NVarChar, 50, "装机状态");
|
||||
thisParmsSql[16] = new SqlParameter("@适用状态", SqlDbType.DateTime, 8, "适用状态");
|
||||
thisParmsSql[17] = new SqlParameter("@物料描述", SqlDbType.NVarChar, 255, "物料描述");
|
||||
thisParmsSql[18] = new SqlParameter("@计划下达日期", SqlDbType.DateTime, 8, "计划下达日期");
|
||||
thisParmsSql[19] = new SqlParameter("@计划完工日期", SqlDbType.DateTime, 8, "计划完工日期");
|
||||
|
||||
// + "@主配厂家,@工位号,@工位名称,@物料号,@零件图号,@零件名称,@零件数量,"
|
||||
|
||||
thisParmsSql[20] = new SqlParameter("@主配厂家", SqlDbType.NVarChar, 50, "主配厂家");
|
||||
thisParmsSql[21] = new SqlParameter("@工位号", SqlDbType.NVarChar, 50, "工位号");
|
||||
thisParmsSql[22] = new SqlParameter("@工位名称", SqlDbType.NVarChar, 50, "工位名称");
|
||||
thisParmsSql[23] = new SqlParameter("@物料号", SqlDbType.NVarChar, 50, "物料号");
|
||||
thisParmsSql[24] = new SqlParameter("@零件图号", SqlDbType.NVarChar, 50, "零件图号");
|
||||
thisParmsSql[25] = new SqlParameter("@零件名称", SqlDbType.NVarChar, 50, "零件名称");
|
||||
thisParmsSql[26] = new SqlParameter("@零件数量", SqlDbType.Int, 4, "零件数量");
|
||||
|
||||
// +"[是否扫描],扫描方式代码, [扫描方式], [厂家代码],[生产厂家], "
|
||||
|
||||
thisParmsSql[27] = new SqlParameter("@是否扫描", SqlDbType.Int, 4, "是否扫描");
|
||||
thisParmsSql[28] = new SqlParameter("@扫描方式代码", SqlDbType.Int, 4, "扫描方式代码");
|
||||
thisParmsSql[29] = new SqlParameter("@扫描方式", SqlDbType.NVarChar, 50, "扫描方式");
|
||||
thisParmsSql[30] = new SqlParameter("@是否主物料", SqlDbType.Int, 4, "是否主物料");
|
||||
thisParmsSql[31] = new SqlParameter("@厂家代码", SqlDbType.NVarChar, 50, "厂家代码");
|
||||
thisParmsSql[32] = new SqlParameter("@生产厂家", SqlDbType.NVarChar, 50, "生产厂家");
|
||||
|
||||
//+ "@操作指导,@发动机号,@物料号表索引号,@零件数量验证,"
|
||||
|
||||
thisParmsSql[33] = new SqlParameter("@操作指导", SqlDbType.NVarChar, 255, "操作指导");
|
||||
thisParmsSql[34] = new SqlParameter("@发动机号", SqlDbType.NVarChar, 50, "发动机号");
|
||||
thisParmsSql[35] = new SqlParameter("@追踪代码", SqlDbType.NVarChar, 50, "追踪代码");
|
||||
thisParmsSql[36] = new SqlParameter("@主物料号", SqlDbType.NVarChar, 50, "主物料号");
|
||||
thisParmsSql[37] = new SqlParameter("@物料号表索引号", SqlDbType.Int, 4, "物料号表索引号");
|
||||
thisParmsSql[38] = new SqlParameter("@零件数量验证", SqlDbType.Int, 4, "零件数量验证");
|
||||
|
||||
// +"[物料条码], [物料条码物料号], [物料条码批次],@验证结果, [操作者工号], [操作者姓名], [班次代码], "
|
||||
thisParmsSql[39] = new SqlParameter("@物料条码", SqlDbType.NVarChar, 50, "物料条码");
|
||||
thisParmsSql[40] = new SqlParameter("@物料条码物料号", SqlDbType.NVarChar, 50, "物料条码物料号");
|
||||
thisParmsSql[41] = new SqlParameter("@物料条码批次", SqlDbType.NVarChar, 50, "物料条码批次");
|
||||
thisParmsSql[42] = new SqlParameter("@验证结果", SqlDbType.Int, 4, "验证结果");
|
||||
thisParmsSql[43] = new SqlParameter("@操作者工号", SqlDbType.NVarChar, 50, "操作者工号");
|
||||
thisParmsSql[44] = new SqlParameter("@操作者姓名", SqlDbType.NVarChar, 50, "操作者姓名");
|
||||
thisParmsSql[45] = new SqlParameter("@班次代码", SqlDbType.NVarChar, 50, "班次代码");
|
||||
|
||||
// +"物料来源代码,物料来源,是否禁用代码,是否禁用,被强制验证物料号,更改代码,更改原因)"
|
||||
|
||||
thisParmsSql[46] = new SqlParameter("@物料来源代码", SqlDbType.Int, 4, "物料来源代码");
|
||||
thisParmsSql[47] = new SqlParameter("@物料来源", SqlDbType.NVarChar, 50, "物料来源");
|
||||
thisParmsSql[48] = new SqlParameter("@是否禁用代码", SqlDbType.Int, 4, "是否禁用代码");
|
||||
thisParmsSql[49] = new SqlParameter("@是否禁用", SqlDbType.NVarChar, 50, "是否禁用");
|
||||
thisParmsSql[50] = new SqlParameter("@被强制验证物料号", SqlDbType.NVarChar, 50, "被强制验证物料号");
|
||||
thisParmsSql[51] = new SqlParameter("@更改代码", SqlDbType.NVarChar, 50, "更改代码");
|
||||
thisParmsSql[52] = new SqlParameter("@更改原因", SqlDbType.NVarChar, 255, "更改原因");
|
||||
thisParmsSql[53] = new SqlParameter("@零件类型", SqlDbType.Int, 4, "零件类型");
|
||||
thisParmsSql[54] = new SqlParameter("@操作时间", SqlDbType.DateTime, 8, "操作时间");
|
||||
if (dt == null) return false;
|
||||
//如果与SQL Server 数据库通讯失败,ApplicationConfig.connectionStringPIS_NEW_Value = "0"
|
||||
|
||||
return DataAccess.ExecuteSQL(sql, ref thisParmsSql, dt);
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 异步通讯方式
|
||||
/// 增加数据到Access数据库
|
||||
/// MES_装配数据_零部件追溯
|
||||
/// INSERT INTO [MES_装配数据_零部件追溯]
|
||||
/// </summary>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
//public static bool VerifyAssemblyPartTableInsert_Access(DataTable dt)
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "INSERT INTO [MES_装配数据_零部件追溯]"
|
||||
// + "([追溯代码],[订单号],[SAP物料号],[发动机型号],[发动机型号代码], [发动机机型], "
|
||||
// + "[发动机数量], [厂牌编号起始号], [客户名称],[投料日期],[文件编号],[集团名称],[通知号],"
|
||||
// + "[功率],[指南文件编号],[装机状态],[适用状态],[物料描述],[计划下达日期],[计划完工日期],"
|
||||
// + "[主配厂家],[工位号], [工位名称],[物料号], [零件图号], [零件名称], [零件数量],"
|
||||
// + "[是否扫描],[扫描方式代码], [扫描方式], [是否主物料],[厂家代码],[生产厂家], "
|
||||
// + "[操作指导],[发动机号],[追踪代码],[主物料号],[物料号表索引号],[零件数量验证],"
|
||||
// + "[物料条码], [物料条码物料号], [物料条码批次],[验证结果], [操作者工号], [操作者姓名], [班次代码], "
|
||||
// + "物料来源代码,物料来源,是否禁用代码,是否禁用,被强制验证物料号,更改代码,更改原因,零件类型,操作时间)"
|
||||
|
||||
// + "VALUES(@追溯代码,@订单号,@SAP物料号,@发动机型号,@发动机型号代码,@发动机机型,"
|
||||
// + "@发动机数量,@厂牌编号起始号,@客户名称,@投料日期,@文件编号,@集团名称,@通知号,"
|
||||
// + "@功率,@指南文件编号,@装机状态,@适用状态,@物料描述,@计划下达日期,@计划完工日期,"
|
||||
// + "@主配厂家,@工位号,@工位名称,@物料号,@零件图号,@零件名称,@零件数量,"
|
||||
// + " @是否扫描,@扫描方式代码,@扫描方式,@是否主物料,@厂家代码,@生产厂家,"
|
||||
// + "@操作指导,@发动机号,@追踪代码,@主物料号,@物料号表索引号,@零件数量验证,"
|
||||
// + "@物料条码,@物料条码物料号,@物料条码批次,@验证结果,@操作者工号,@操作者姓名,@班次代码,"
|
||||
// + "@物料来源代码,@物料来源,@是否禁用代码,@是否禁用,@被强制验证物料号,"
|
||||
// + "@更改代码,@更改原因,@零件类型,@操作时间)";
|
||||
|
||||
|
||||
// OleDbParameter[] thisParms1 = new OleDbParameter[55];
|
||||
// // + "([追溯代码],[订单号],[SAP物料号],[发动机型号],[发动机型号代码], [发动机机型], "
|
||||
// thisParms1[0] = new OleDbParameter("@追溯代码", OleDbType.Integer, 4, "追溯代码");
|
||||
// thisParms1[1] = new OleDbParameter("@订单号", OleDbType.VarChar, 50, "订单号");
|
||||
// thisParms1[2] = new OleDbParameter("@SAP物料号", OleDbType.VarChar, 50, "SAP物料号");
|
||||
// thisParms1[3] = new OleDbParameter("@发动机型号", OleDbType.VarChar, 50, "发动机型号");
|
||||
// thisParms1[4] = new OleDbParameter("@发动机型号代码", OleDbType.Integer, 4, "发动机型号代码");
|
||||
// thisParms1[5] = new OleDbParameter("@发动机机型", OleDbType.VarChar, 50, "发动机机型");
|
||||
|
||||
// // + "@发动机数量,@厂牌编号起始号,@客户名称,@投料日期,@文件编号,@集团名称,@通知号,"
|
||||
// thisParms1[6] = new OleDbParameter("@发动机数量", OleDbType.Integer, 4, "发动机数量");
|
||||
// thisParms1[7] = new OleDbParameter("@厂牌编号起始号", OleDbType.Integer, 4, "厂牌编号起始号");
|
||||
// thisParms1[8] = new OleDbParameter("@客户名称", OleDbType.VarChar, 50, "客户名称");
|
||||
// thisParms1[9] = new OleDbParameter("@投料日期", OleDbType.DBDate, 8, "投料日期");
|
||||
// thisParms1[10] = new OleDbParameter("@文件编号", OleDbType.VarChar, 50, "文件编号");
|
||||
// thisParms1[11] = new OleDbParameter("@集团名称", OleDbType.VarChar, 50, "集团名称");
|
||||
// thisParms1[12] = new OleDbParameter("@通知号", OleDbType.VarChar, 50, "通知号");
|
||||
|
||||
// // + "@功率,@指南文件编号,@装机状态,@适用状态,@物料描述,@计划下达日期,@计划完工日期,"
|
||||
// thisParms1[13] = new OleDbParameter("@功率", OleDbType.VarChar, 50, "功率");
|
||||
// thisParms1[14] = new OleDbParameter("@指南文件编号", OleDbType.VarChar, 50, "指南文件编号");
|
||||
// thisParms1[15] = new OleDbParameter("@装机状态", OleDbType.VarChar, 50, "装机状态");
|
||||
// thisParms1[16] = new OleDbParameter("@适用状态", OleDbType.DBDate, 8, "适用状态");
|
||||
// thisParms1[17] = new OleDbParameter("@物料描述", OleDbType.VarChar, 255, "物料描述");
|
||||
// thisParms1[18] = new OleDbParameter("@计划下达日期", OleDbType.DBDate, 8, "计划下达日期");
|
||||
// thisParms1[19] = new OleDbParameter("@计划完工日期", OleDbType.DBDate, 8, "计划完工日期");
|
||||
|
||||
// // + "@主配厂家,@工位号,@工位名称,@物料号,@零件图号,@零件名称,@零件数量,"
|
||||
|
||||
// thisParms1[20] = new OleDbParameter("@主配厂家", OleDbType.VarChar, 50, "主配厂家");
|
||||
// thisParms1[21] = new OleDbParameter("@工位号", OleDbType.VarChar, 50, "工位号");
|
||||
// thisParms1[22] = new OleDbParameter("@工位名称", OleDbType.VarChar, 50, "工位名称");
|
||||
// thisParms1[23] = new OleDbParameter("@物料号", OleDbType.VarChar, 50, "物料号");
|
||||
// thisParms1[24] = new OleDbParameter("@零件图号", OleDbType.VarChar, 50, "零件图号");
|
||||
// thisParms1[25] = new OleDbParameter("@零件名称", OleDbType.VarChar, 50, "零件名称");
|
||||
// thisParms1[26] = new OleDbParameter("@零件数量", OleDbType.Integer, 4, "零件数量");
|
||||
|
||||
// // +"[是否扫描],扫描方式代码, [扫描方式], [厂家代码],[生产厂家], "
|
||||
|
||||
// thisParms1[27] = new OleDbParameter("@是否扫描", OleDbType.Integer, 4, "是否扫描");
|
||||
// thisParms1[28] = new OleDbParameter("@扫描方式代码", OleDbType.Integer, 4, "扫描方式代码");
|
||||
// thisParms1[29] = new OleDbParameter("@扫描方式", OleDbType.VarChar, 50, "扫描方式");
|
||||
// thisParms1[30] = new OleDbParameter("@是否主物料", OleDbType.Integer, 4, "是否主物料");
|
||||
// thisParms1[31] = new OleDbParameter("@厂家代码", OleDbType.VarChar, 50, "厂家代码");
|
||||
// thisParms1[32] = new OleDbParameter("@生产厂家", OleDbType.VarChar, 50, "生产厂家");
|
||||
|
||||
// //+ "@操作指导,@发动机号,@物料号表索引号,@零件数量验证,"
|
||||
|
||||
// thisParms1[33] = new OleDbParameter("@操作指导", OleDbType.VarChar, 255, "操作指导");
|
||||
// thisParms1[34] = new OleDbParameter("@发动机号", OleDbType.VarChar, 50, "发动机号");
|
||||
// thisParms1[35] = new OleDbParameter("@追踪代码", OleDbType.VarChar, 50, "追踪代码");
|
||||
// thisParms1[36] = new OleDbParameter("@主物料号", OleDbType.VarChar, 50, "主物料号");
|
||||
// thisParms1[37] = new OleDbParameter("@物料号表索引号", OleDbType.Integer, 4, "物料号表索引号");
|
||||
// thisParms1[38] = new OleDbParameter("@零件数量验证", OleDbType.Integer, 4, "零件数量验证");
|
||||
|
||||
// // +"[物料条码], [物料条码物料号], [物料条码批次],@验证结果, [操作者工号], [操作者姓名], [班次代码], "
|
||||
// thisParms1[39] = new OleDbParameter("@物料条码", OleDbType.VarChar, 50, "物料条码");
|
||||
// thisParms1[40] = new OleDbParameter("@物料条码物料号", OleDbType.VarChar, 50, "物料条码物料号");
|
||||
// thisParms1[41] = new OleDbParameter("@物料条码批次", OleDbType.VarChar, 50, "物料条码批次");
|
||||
// thisParms1[42] = new OleDbParameter("@验证结果", OleDbType.Integer, 4, "验证结果");
|
||||
// thisParms1[43] = new OleDbParameter("@操作者工号", OleDbType.VarChar, 50, "操作者工号");
|
||||
// thisParms1[44] = new OleDbParameter("@操作者姓名", OleDbType.VarChar, 50, "操作者姓名");
|
||||
// thisParms1[45] = new OleDbParameter("@班次代码", OleDbType.VarChar, 50, "班次代码");
|
||||
|
||||
// // +"物料来源代码,物料来源,是否禁用代码,是否禁用,被强制验证物料号,更改代码,更改原因)"
|
||||
|
||||
// thisParms1[46] = new OleDbParameter("@物料来源代码", OleDbType.Integer, 4, "物料来源代码");
|
||||
// thisParms1[47] = new OleDbParameter("@物料来源", OleDbType.VarChar, 50, "物料来源");
|
||||
// thisParms1[48] = new OleDbParameter("@是否禁用代码", OleDbType.Integer, 4, "是否禁用代码");
|
||||
// thisParms1[49] = new OleDbParameter("@是否禁用", OleDbType.VarChar, 50, "是否禁用");
|
||||
// thisParms1[50] = new OleDbParameter("@被强制验证物料号", OleDbType.VarChar, 50, "被强制验证物料号");
|
||||
// thisParms1[51] = new OleDbParameter("@更改代码", OleDbType.VarChar, 50, "更改代码");
|
||||
// thisParms1[52] = new OleDbParameter("@更改原因", OleDbType.VarChar, 255, "更改原因");
|
||||
// thisParms1[53] = new OleDbParameter("@零件类型", OleDbType.Integer, 4, "零件类型");
|
||||
// thisParms1[54] = new OleDbParameter("@操作时间", OleDbType.DBTimeStamp, 8, "操作时间");
|
||||
|
||||
// return DataAccess.ExecuteDataTable_OleDb_Insert_Access(sql, dt, ref thisParms1);
|
||||
//}
|
||||
/// <summary>
|
||||
/// 获得增加表[MES_装配数据_零部件追溯_数据主表]的SQL语句
|
||||
/// </summary>
|
||||
private static string GetSqlStringAssemblyPartIndexTable()
|
||||
{
|
||||
string sql = null;
|
||||
sql = "INSERT INTO [MES_装配数据_零部件追溯_数据主表] " +
|
||||
"(订单号,订单计划发动机号,发动机号,追踪代码,主物料号,工位号,到达时间,离开时间,操作者工号,班次代码,"
|
||||
+ "[SAP物料号],[发动机型号],[发动机型号代码], [发动机机型], "
|
||||
+ "[发动机数量], [厂牌编号起始号], [客户名称],[投料日期],[文件编号],[集团名称],[通知号],"
|
||||
+ "[功率],[指南文件编号],[装机状态],[适用状态],[物料描述],[计划下达日期],[计划完工日期],[主配厂家],[零件类型],[是否禁用],[返修标志])"
|
||||
+ " VALUES ("
|
||||
//订单号,发动机号,追踪代码,工位号,到达时间,离开时间,操作者工号,班次代码
|
||||
+ "'" + MaterialData.orderForm + "',"
|
||||
+ "'" + MaterialData.engineNumber_OrderPlan + "',"
|
||||
+ "'" + MaterialData.engineNumber + "',"
|
||||
+ "'" + MaterialData.engineTraceCode + "',"
|
||||
+ "'" + MaterialData.mainMaterialNumber + "',"
|
||||
+ "'" + MaterialData.opName + "',"
|
||||
+ "'" + MaterialData.arrivedTime.ToString("G") + "',"
|
||||
+ "'" + MaterialData.leavedTime.ToString("G") + "',"
|
||||
+ "'" + MaterialData.operatorCode + "',"
|
||||
+ "'" + MaterialData.operatorShift + "',"
|
||||
//+ "[SAP物料号],[发动机型号],[发动机型号代码], [发动机机型], "
|
||||
|
||||
+ "'" + MaterialData.sAPMaterialNumber + "',"
|
||||
+ "'" + MaterialData.engineNumberType + "',"
|
||||
+ "" + MaterialData.engineNumberCode + ","//int
|
||||
+ "'" + MaterialData.engineNumberBasicType + "',"
|
||||
//+ "[发动机数量], [厂牌编号起始号], [客户名称],[投料日期],[文件编号],[集团名称],[通知号],"
|
||||
|
||||
+ "" + MaterialData.engineCount + ","//int
|
||||
+ "'" + MaterialData.engineNumberFirstID + "',"//int
|
||||
+ "'" + MaterialData.customesName + "',"
|
||||
+ "'" + MaterialData.prepareMaterialDateTime.ToString("G") + "',"
|
||||
+ "'" + MaterialData.fileCode + "',"
|
||||
+ "'" + MaterialData.groupName + "',"
|
||||
+ "'" + MaterialData.notifyCode + "',"
|
||||
//+ "[功率],[指南文件编号],[装机状态],[适用状态],[物料描述],[计划下达日期],[计划完工日期],主配厂家,零件类型,是否禁用,返修标志"
|
||||
+ "'" + MaterialData.n_Force + "',"
|
||||
+ "'" + MaterialData.directFileCode + "',"
|
||||
+ "'" + MaterialData.workEngineStatus + "',"
|
||||
+ "'" + MaterialData.adaptDateTime.ToString("G") + "',"
|
||||
+ "'" + MaterialData.materialDescript + "',"
|
||||
+ "'" + MaterialData.planSendedDateTime.ToString("G") + "',"
|
||||
+ "'" + MaterialData.planFinishDateTime.ToString("G") + "',"
|
||||
+ "'" + MaterialData.mainPruduceFatory + "',"
|
||||
+ "" + MaterialData.partType.ToString() + ","
|
||||
+ "" + MaterialData.isMainMaterial.ToString() + ","
|
||||
+ "" + MaterialData.isRepairID.ToString() + ") ";
|
||||
return sql;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,222 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Data.OleDb;
|
||||
|
||||
//using SystemFramework;
|
||||
using DataLinkMesWork;
|
||||
namespace bizFacade
|
||||
{
|
||||
public partial class BaseDataSystemMES
|
||||
{
|
||||
/// <summary>
|
||||
/// 保存[MES_装配数据_发动机号_追踪代码]
|
||||
/// 与SqlServer连接正常,保存到SqlServer数据库中;
|
||||
/// 与SqlServer连接不正常,保存到SqlServer数据库中;
|
||||
/// </summary>
|
||||
public static void TableTraceInsert_SaveData()
|
||||
{
|
||||
DataTable dt;
|
||||
dt = TraceCodeDataTableUpdate_Access();
|
||||
//if (!SQLCommon.SqlServerConnectionStatus)
|
||||
//{
|
||||
// TableTraceInsert_Access(dt);
|
||||
//}
|
||||
//else
|
||||
{
|
||||
TableTraceInsert_SqlServer(dt);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// [MES_装配数据_发动机号_追踪代码]数据保存到本地PC的Access数据库中
|
||||
/// </summary>
|
||||
//private static bool TableTraceInsert_Access(DataTable dt)
|
||||
//{
|
||||
// string sql = null;
|
||||
// sql =
|
||||
// "INSERT INTO [MES_装配数据_发动机号_追踪代码] " +
|
||||
// "(订单号,订单计划发动机号,发动机号,追踪代码,主物料号,工位号,操作者工号,班次代码," +
|
||||
// "[SAP物料号],[发动机型号],[发动机型号代码], [发动机机型])" +
|
||||
// "VALUES(@订单号,@订单计划发动机号,@发动机号,@追踪代码,@主物料号,@工位号,@操作者工号,@班次代码," +
|
||||
// "@SAP物料号,@发动机型号,@发动机型号代码,@发动机机型)";
|
||||
// OleDbParameter[] thisParms = new OleDbParameter[12];
|
||||
// thisParms[0] = new OleDbParameter("@订单号", OleDbType.VarChar, 50, "订单号");
|
||||
// thisParms[1] = new OleDbParameter("@订单计划发动机号", OleDbType.VarChar, 50, "订单计划发动机号");
|
||||
// thisParms[2] = new OleDbParameter("@发动机号", OleDbType.VarChar, 50, "发动机号");
|
||||
// thisParms[3] = new OleDbParameter("@追踪代码", OleDbType.VarChar, 50, "追踪代码");
|
||||
// thisParms[4] = new OleDbParameter("@主物料号", OleDbType.VarChar, 50, "主物料号");
|
||||
// thisParms[5] = new OleDbParameter("@工位号", OleDbType.VarChar, 50, "工位号");
|
||||
// thisParms[6] = new OleDbParameter("@操作者工号", OleDbType.VarChar, 50, "操作者工号");
|
||||
// thisParms[7] = new OleDbParameter("@班次代码", OleDbType.VarChar, 50, "班次代码");
|
||||
// thisParms[8] = new OleDbParameter("@SAP物料号", OleDbType.VarChar, 50, "SAP物料号");
|
||||
// thisParms[9] = new OleDbParameter("@发动机型号", OleDbType.VarChar, 50, "发动机型号");
|
||||
// thisParms[10] = new OleDbParameter("@发动机型号代码", OleDbType.Integer, 4, "发动机型号代码");
|
||||
// thisParms[11] = new OleDbParameter("@发动机机型", OleDbType.VarChar, 50, "发动机机型");
|
||||
// return DataAccess.ExecuteDataTable_OleDb_Insert_Access(sql, dt, ref thisParms);
|
||||
//}
|
||||
/// <summary>
|
||||
/// [MES_装配数据_发动机号_追踪代码]保存到SqlServer数据库服务器
|
||||
/// </summary>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
private static bool TableTraceInsert_SqlServer(DataTable dt)
|
||||
{
|
||||
string sql = null;
|
||||
sql =
|
||||
"INSERT INTO [MES_装配数据_发动机号_追踪代码] " +
|
||||
"(订单号,订单计划发动机号,发动机号,追踪代码,主物料号,工位号,操作者工号,班次代码," +
|
||||
"[SAP物料号],[发动机型号],[发动机型号代码], [发动机机型])" +
|
||||
"VALUES(@订单号,@订单计划发动机号,@发动机号,@追踪代码,@主物料号,@工位号,@操作者工号,@班次代码," +
|
||||
"@SAP物料号,@发动机型号,@发动机型号代码,@发动机机型)";
|
||||
SqlParameter[] thisParms = new SqlParameter[12];
|
||||
thisParms[0] = new SqlParameter("@订单号", SqlDbType.NVarChar, 50, "订单号");
|
||||
thisParms[1] = new SqlParameter("@订单计划发动机号", SqlDbType.NVarChar, 50, "订单计划发动机号");
|
||||
thisParms[2] = new SqlParameter("@发动机号", SqlDbType.NVarChar, 50, "发动机号");
|
||||
thisParms[3] = new SqlParameter("@追踪代码", SqlDbType.NVarChar, 50, "追踪代码");
|
||||
thisParms[4] = new SqlParameter("@主物料号", SqlDbType.NVarChar, 50, "主物料号");
|
||||
thisParms[5] = new SqlParameter("@工位号", SqlDbType.NVarChar, 50, "工位号");
|
||||
thisParms[6] = new SqlParameter("@操作者工号", SqlDbType.NVarChar, 50, "操作者工号");
|
||||
thisParms[7] = new SqlParameter("@班次代码", SqlDbType.NVarChar, 50, "班次代码");
|
||||
thisParms[8] = new SqlParameter("@SAP物料号", SqlDbType.NVarChar, 50, "SAP物料号");
|
||||
thisParms[9] = new SqlParameter("@发动机型号", SqlDbType.NVarChar, 50, "发动机型号");
|
||||
thisParms[10] = new SqlParameter("@发动机型号代码", SqlDbType.Int, 4, "发动机型号代码");
|
||||
thisParms[11] = new SqlParameter("@发动机机型", SqlDbType.NVarChar, 50, "发动机机型");
|
||||
return DataAccess.ExecuteSQL(sql, ref thisParms, dt);
|
||||
//OleDbParameter[] thisParms = new OleDbParameter[12];
|
||||
//thisParms[0] = new OleDbParameter("@订单号", OleDbType.VarChar, 50, "订单号");
|
||||
//thisParms[1] = new OleDbParameter("@订单计划发动机号", OleDbType.VarChar, 50, "订单计划发动机号");
|
||||
//thisParms[2] = new OleDbParameter("@发动机号", OleDbType.VarChar, 50, "发动机号");
|
||||
//thisParms[3] = new OleDbParameter("@追踪代码", OleDbType.VarChar, 50, "追踪代码");
|
||||
//thisParms[4] = new OleDbParameter("@主物料号", OleDbType.VarChar, 50, "主物料号");
|
||||
//thisParms[5] = new OleDbParameter("@工位号", OleDbType.VarChar, 50, "工位号");
|
||||
//thisParms[6] = new OleDbParameter("@操作者工号", OleDbType.VarChar, 50, "操作者工号");
|
||||
//thisParms[7] = new OleDbParameter("@班次代码", OleDbType.VarChar, 50, "班次代码");
|
||||
//thisParms[8] = new OleDbParameter("@SAP物料号", OleDbType.VarChar, 50, "SAP物料号");
|
||||
//thisParms[9] = new OleDbParameter("@发动机型号", OleDbType.VarChar, 50, "发动机型号");
|
||||
//thisParms[10] = new OleDbParameter("@发动机型号代码", OleDbType.Integer, 4, "发动机型号代码");
|
||||
//thisParms[11] = new OleDbParameter("@发动机机型", OleDbType.VarChar, 50, "发动机机型");
|
||||
//return DataAccess.ExecuteDataTable_OleDb_Insert_SqlServer(sql, dt, ref thisParms);
|
||||
}
|
||||
/// <summary>
|
||||
/// 创建临时表[MES_装配数据_发动机号_追踪代码]
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private static DataTable CreateEngineTraceCodeDataTable()
|
||||
{
|
||||
DataTable dt;
|
||||
dt = new DataTable();
|
||||
dt.Columns.Add("订单号", typeof(string));
|
||||
dt.Columns.Add("订单计划发动机号", typeof(string));
|
||||
dt.Columns.Add("发动机号", typeof(string));
|
||||
dt.Columns.Add("追踪代码", typeof(string));
|
||||
dt.Columns.Add("主物料号", typeof(string));
|
||||
dt.Columns.Add("工位号", typeof(string));
|
||||
dt.Columns.Add("操作者工号", typeof(string));
|
||||
dt.Columns.Add("班次代码", typeof(string));
|
||||
dt.Columns.Add("SAP物料号", typeof(string));
|
||||
dt.Columns.Add("发动机型号", typeof(string));
|
||||
dt.Columns.Add("发动机型号代码", typeof(int));
|
||||
dt.Columns.Add("发动机机型", typeof(string));
|
||||
return dt;
|
||||
}
|
||||
/// <summary>
|
||||
/// 上线工位的[MES_装配数据_发动机号_追踪代码]数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private DataTable GetTraceCodeDataTable()
|
||||
{
|
||||
DataTable dt;
|
||||
dt = CreateEngineTraceCodeDataTable();
|
||||
DataRow dr;
|
||||
dr = dt.NewRow();
|
||||
dr["订单号"] = MaterialData.orderForm;
|
||||
dr["订单计划发动机号"] = MaterialData.engineNumber_OrderPlan;
|
||||
dr["发动机号"] = MaterialData.engineNumber;
|
||||
dr["追踪代码"] = MaterialData.engineTraceCode;
|
||||
dr["主物料号"] = MaterialData.mainMaterialNumber;
|
||||
dr["工位号"] = MaterialData.opName;
|
||||
dr["操作者工号"] = MaterialData.operatorCode;
|
||||
dr["班次代码"] = MaterialData.operatorShift;
|
||||
dr["SAP物料号"] = MaterialData.sAPMaterialNumber;
|
||||
dr["发动机型号"] = MaterialData.engineNumberType;
|
||||
dr["发动机型号代码"] = MaterialData.engineNumberCode;
|
||||
dr["发动机机型"] = MaterialData.engineNumberBasicType;
|
||||
dt.Rows.Add(dr);
|
||||
return dt;
|
||||
}
|
||||
/// <summary>
|
||||
/// 上线工位的[MES_装配数据_发动机号_追踪代码]数据
|
||||
/// 从本工位
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
//public static bool GetTraceCodeDataTableFromAccess(string opName, out DataTable dt)
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "select 订单号,订单计划发动机号,发动机号,追踪代码,主物料号,工位号,操作者工号,班次代码,SAP物料号,发动机型号,发动机型号代码,发动机机型"
|
||||
// + " from MES_装配数据_发动机号_追踪代码 where IsOK=0 and 工位号='" + opName + "'";
|
||||
// return DataAccess.ExecuteDataTable_OleDb_Access(sql, out dt);
|
||||
//}
|
||||
/// <summary>
|
||||
/// 更新IsOK = 1 [MES_装配数据_发动机号_追踪代码]数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
//public static bool GetTraceCodeDataTableFromAccess_Update(string opName)
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "update MES_装配数据_发动机号_追踪代码 set IsOK = 1 where IsOK=0 and 工位号='" + opName + "'";
|
||||
// return DataAccess.ExecuteSQL_OleDb_Access(sql);
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// 数据库同步,应用于分装线线首工位
|
||||
/// [数据MES_装配数据_发动机号_追踪代码_下达工位]
|
||||
/// 从到Access中获得[数据MES_装配数据_发动机号_追踪代码_下达工位]数据,
|
||||
/// 保存SqlServer数据库服务器,同时更新[是否同步]标志。
|
||||
/// </summary>
|
||||
/// <param name="opName">当前工位</param>
|
||||
/// <returns></returns>
|
||||
//public static void GetTraceCodeDataTableFromAccess_OpName_InsertIntoSqlServer(string opName)
|
||||
//{
|
||||
// DataTable dt;
|
||||
// if (GetTraceCodeDataTableFromAccess(opName, out dt))
|
||||
// {
|
||||
// if (TableTraceInsert_SqlServer(dt))
|
||||
// {
|
||||
// GetTraceCodeDataTableFromAccess_Update(opName);
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
/// <summary>
|
||||
/// 上线工位的[MES_装配数据_发动机号_追踪代码]
|
||||
/// 对于分线上线工位,要将IsOK=0的行上传到分装部件的总线上线工位;上传后,该值置1。
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private static DataTable TraceCodeDataTableUpdate_Access()
|
||||
{
|
||||
|
||||
DataTable dt;
|
||||
dt = CreateEngineTraceCodeDataTable();
|
||||
DataRow dr;
|
||||
dr = dt.NewRow();
|
||||
dr["订单号"] = MaterialData.orderForm;
|
||||
dr["订单计划发动机号"] = MaterialData.engineNumber_OrderPlan;
|
||||
dr["发动机号"] = MaterialData.engineNumber;
|
||||
dr["追踪代码"] = MaterialData.engineTraceCode;
|
||||
dr["主物料号"] = MaterialData.mainMaterialNumber;
|
||||
dr["工位号"] = MaterialData.opName;
|
||||
dr["操作者工号"] = MaterialData.operatorCode;
|
||||
dr["班次代码"] = MaterialData.operatorShift;
|
||||
dr["SAP物料号"] = MaterialData.sAPMaterialNumber;
|
||||
dr["发动机型号"] = MaterialData.engineNumberType;
|
||||
dr["发动机型号代码"] = MaterialData.engineNumberCode;
|
||||
dr["发动机机型"] = MaterialData.engineNumberBasicType;
|
||||
dt.Rows.Add(dr);
|
||||
return dt;
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,83 @@
|
||||
using DataLinkMesWork;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.SqlClient;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace bizFacade
|
||||
{
|
||||
public class MesFunctions
|
||||
{
|
||||
/// <summary>
|
||||
/// 工件入站
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="EngineTypeID"></param>
|
||||
/// <param name="EngineType"></param>
|
||||
/// <param name="PartPallet_Code"></param>
|
||||
/// <param name="EngineID"></param>
|
||||
/// <param name="Big_EnginTypeID"></param>
|
||||
/// <param name="MES_QualityMask"></param>
|
||||
/// <param name="OrderForm"></param>
|
||||
/// <returns></returns>
|
||||
public static bool EnginePart_Incoming(string OpName, int EngineTypeID, string EngineType, int PartPallet_Code, string EngineID, string Big_EnginTypeID, int MES_QualityMask, string OrderForm)
|
||||
{
|
||||
var procedureName = "MES_合装控制_工件入站";
|
||||
var sqlParameters = new SqlParameter[]
|
||||
{
|
||||
new SqlParameter("@OP_Name", OpName),
|
||||
new SqlParameter("@Engine_TypeID", EngineTypeID),
|
||||
new SqlParameter("@Engine_Type", EngineType),
|
||||
new SqlParameter("@Pallet_Code", PartPallet_Code),
|
||||
new SqlParameter("@Product_Code", EngineID),
|
||||
new SqlParameter("@Big_EnginTypeID", int.Parse(Big_EnginTypeID)),
|
||||
new SqlParameter("@Product_QualityOK", MES_QualityMask),
|
||||
new SqlParameter("@OrderForm", OrderForm)
|
||||
};
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters);
|
||||
}
|
||||
/// <summary>
|
||||
/// 工件出站
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="EngineTypeID"></param>
|
||||
/// <param name="EngineType"></param>
|
||||
/// <param name="PartPallet_Code"></param>
|
||||
/// <param name="EngineID"></param>
|
||||
/// <param name="Big_EnginTypeID"></param>
|
||||
/// <param name="MES_QualityMask"></param>
|
||||
/// <param name="OrderForm"></param>
|
||||
/// <returns></returns>
|
||||
public static bool EnginePart_OutStation(string OpName, string EngineID, int MES_QualityMask)
|
||||
{
|
||||
var procedureName = "MES_合装控制_工件出站";
|
||||
var sqlParameters = new SqlParameter[]
|
||||
{
|
||||
new SqlParameter("@OP_Name", OpName),
|
||||
new SqlParameter("@Product_Code", EngineID),
|
||||
new SqlParameter("@Product_QualityOK", MES_QualityMask)
|
||||
};
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters);
|
||||
}
|
||||
/// <summary>
|
||||
/// Condition_Type:1、判断该工位是否在业务范围内(停用);2、机型匹配,3、获取OPA90的匹配结果
|
||||
/// </summary>
|
||||
/// <param name="Condition_Type"></param>
|
||||
/// <returns></returns>
|
||||
public static int GetCondition_AssemblyControl(int Condition_Type)
|
||||
{
|
||||
//Condition_Type:1、判断该工位是否在业务范围内;2、根据OPA90第一个入站工件进行机型判断;3、获取报警信息
|
||||
string procedureName = "MES_合装控制_控制条件";
|
||||
var sqlParameters = new SqlParameter[]
|
||||
{
|
||||
new SqlParameter("@Condition_Type", Condition_Type),
|
||||
new SqlParameter("@OP_Name", "OPA90")
|
||||
};
|
||||
var result = DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out DataTable dt);
|
||||
return int.Parse(dt.Rows[0][0].ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,977 @@
|
||||
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 class MobyTagType
|
||||
{
|
||||
/// <summary>
|
||||
/// 配方号
|
||||
/// </summary>
|
||||
public static string PLCRcipe = "配方号";
|
||||
/// <summary>
|
||||
/// 工位号
|
||||
/// </summary>
|
||||
public static string OpName = "工位号";
|
||||
/// <summary>
|
||||
/// 订单号
|
||||
/// </summary>
|
||||
public static string OrderForm = "订单号";
|
||||
/// <summary>
|
||||
/// 订单号
|
||||
/// </summary>
|
||||
public static string OrderForm_MES = "订单号_MES";
|
||||
/// <summary>
|
||||
/// 产品型号代码
|
||||
/// </summary>
|
||||
public static string EngineTypeID = "产品型号代码";
|
||||
/// <summary>
|
||||
/// 变速器序列号
|
||||
/// </summary>变速器序列号
|
||||
public static string EngineID = "变速器序列号";
|
||||
|
||||
/// <summary>
|
||||
/// 发动机型号
|
||||
/// </summary>
|
||||
public static string EngineType = "发动机型号";
|
||||
/// <summary>
|
||||
/// 机型基本代码
|
||||
/// </summary>
|
||||
public static string EngineTypeBasicID = "机型基本代码";
|
||||
/// <summary>
|
||||
/// 机型基本代码
|
||||
/// </summary>
|
||||
public static string EngineTypeBasic = "基本机型";
|
||||
/// <summary>
|
||||
/// 变速器总成号
|
||||
/// </summary>
|
||||
public static string EngineIDPrinte = "变速器总成号";
|
||||
/// <summary>
|
||||
/// 托盘号
|
||||
/// </summary>
|
||||
public static string PartPallet_Code = "托盘号";
|
||||
/// <summary>
|
||||
/// 产品型号代码_MES
|
||||
/// </summary>
|
||||
public static string EngineTypeID_MES = "产品型号代码_MES";
|
||||
/// <summary>
|
||||
/// 变速器序列号_MES
|
||||
/// </summary>
|
||||
public static string EngineID_MES = "变速器序列号_MES";
|
||||
/// <summary>
|
||||
/// 发动机型号_MES
|
||||
/// </summary>
|
||||
public static string EngineType_MES = "发动机型号_MES";
|
||||
/// <summary>
|
||||
/// 到达时间线外工位
|
||||
/// </summary>
|
||||
public static string WorkStartOutSideIn = "到达时间线外工位";
|
||||
/// <summary>
|
||||
/// 离开时间线外工位
|
||||
/// </summary>
|
||||
public static string WorkStartOutSideOut = "离开时间线外工位";
|
||||
/// <summary>
|
||||
/// 到达时间
|
||||
/// </summary>
|
||||
public static string WorkStartIn = "到达时间";
|
||||
/// <summary>
|
||||
/// 离开时间
|
||||
/// </summary>
|
||||
public static string WorkStartOut = "离开时间";
|
||||
/// <summary>
|
||||
/// 持续时间
|
||||
/// </summary>
|
||||
public static string WorkStartTime = "持续时间";
|
||||
/// <summary>
|
||||
/// 扫描条码
|
||||
/// </summary>
|
||||
public static string BarCode = "扫描条码";
|
||||
/// <summary>
|
||||
/// 工件到位 2
|
||||
/// </summary>
|
||||
public static string WorkStart = "工件到位";
|
||||
/// <summary>
|
||||
/// 传递机型 44
|
||||
/// </summary>
|
||||
public static string EngineTypeGetOverPLC = "传递机型";
|
||||
/// <summary>
|
||||
/// 申请上件 43
|
||||
/// </summary>
|
||||
public static string PartLoad = "申请上件";
|
||||
/// <summary>
|
||||
/// 允许保存 19
|
||||
/// </summary>
|
||||
public static string MesRead = "允许保存";
|
||||
/// <summary>
|
||||
/// 保存完成 20
|
||||
/// </summary>
|
||||
public static string MesReadOver = "保存完成";
|
||||
|
||||
|
||||
|
||||
|
||||
/// [机床上电],[循环开始],[机床故障],[上料无件],[下料堵塞],[工件到位]
|
||||
/// [传递机型],[申请上件],[允许保存],[保存完成],[合格标志],[前序合格]
|
||||
/// [工号],[班次],[是否返修件],[合格放行],[不合格放行]
|
||||
/// [到达时间],[离开时间],[持续时间]
|
||||
// engineTypeID = Convert.ToInt32(thisParms[2].Value);
|
||||
//engineType = thisParms[3].Value.ToString();
|
||||
//engineID = thisParms[4].Value.ToString();
|
||||
//palletCode = thisParms[5].Value.ToString();
|
||||
}
|
||||
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="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>
|
||||
/// 测量数据工位_获得订单_查询
|
||||
/// </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 OrderFormByOpName_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>
|
||||
/// 北汽福田工位状态监控MOBY_增加
|
||||
/// 工位号],[订单号],[产品型号代码],[变速器序列号],[发动机型号],[机型基本代码],[变速器总成号] ,[托盘号]
|
||||
/// [产品型号代码_MES],[变速器序列号_MES],[发动机型号_MES]
|
||||
/// [机床上电],[循环开始],[机床故障],[上料无件],[下料堵塞],[工件到位]
|
||||
/// [传递机型],[申请上件],[允许保存],[保存完成],[合格标志],[前序合格]
|
||||
/// [工号],[班次],[是否返修件],[合格放行],[不合格放行],[扫描条码]
|
||||
/// [到达时间],[离开时间],[持续时间]
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="tagType"></param>
|
||||
/// <param name="tagValue"></param>
|
||||
/// <returns></returns>
|
||||
public static bool OpName_MIS_MOBY_Insert(string opName, string tagType, string tagValue)
|
||||
{
|
||||
string produceName = "北汽福田工位状态监控MOBY_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[3];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@变量类型", tagType);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@变量值", tagValue);
|
||||
|
||||
return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <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);
|
||||
}
|
||||
|
||||
public static bool OpName_MIS_MOBY_Insert_FirstOpName(string opName,
|
||||
int engineTypeID, string engineType, string engineID, int palletCode, int repairCode, int Is_repairBarcode, string repairBarcode)
|
||||
{
|
||||
string produceName = "测量数据工位_监控系统_MOBY_线首_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[8];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@产品型号代码", engineTypeID);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@发动机型号", engineType);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@发动机号", engineID);
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@托盘号", palletCode);
|
||||
thisParms[5] = new System.Data.SqlClient.SqlParameter("@返修标志", repairCode);
|
||||
thisParms[6] = new System.Data.SqlClient.SqlParameter("@拆解标志", Is_repairBarcode);
|
||||
thisParms[7] = new System.Data.SqlClient.SqlParameter("@拆解返修条码", repairBarcode);
|
||||
return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 测量数据工位_监控系统_订单号_增加
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="orderForm"></param>
|
||||
/// <returns></returns>
|
||||
public static bool OpName_MIS_OrderForm_Insert(string opName, string orderForm)
|
||||
{
|
||||
string produceName = "测量数据工位_监控系统_订单号_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@订单号", orderForm);
|
||||
return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 测量数据工位_监控系统_操作者工号_增加
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="opperatorCode"></param>
|
||||
/// <returns></returns>
|
||||
public static bool OpName_MIS_Operator_Insert(string opName, string opperatorCode)
|
||||
{
|
||||
string produceName = "AMES_物料拉动_测量数据工位_监控系统_操作者工号_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@操作者工号", opperatorCode);
|
||||
return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 测量数据工位_监控系统_发动机号_增加
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="engineID"></param>
|
||||
/// <returns></returns>
|
||||
public static bool OpName_MIS_EngineID_Insert(string opName, string engineID)
|
||||
{
|
||||
string produceName = "测量数据工位_监控系统_发动机号_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@发动机号", engineID);
|
||||
return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
|
||||
}
|
||||
/// <summary>
|
||||
/// 测量数据工位_监控系统_订单号_发动机型号_修改
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="engineTypeID"></param>
|
||||
/// <param name="engineType"></param>
|
||||
/// <param name="engineID"></param>
|
||||
/// <returns></returns>
|
||||
public static bool OpName_MIS_OrderForm_EngineType_Update(string opName, int engineTypeID, string engineType, string engineID)
|
||||
{
|
||||
string produceName = "测量数据工位_监控系统_订单号_发动机型号_修改";
|
||||
SqlParameter[] thisParms = new SqlParameter[4];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@产品型号代码", engineTypeID);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@发动机型号", engineType);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@发动机号", engineID);
|
||||
return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
|
||||
}
|
||||
/// <summary>
|
||||
/// 测量数据工位_监控系统_发动机型号_增加
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="engineTypeID"></param>
|
||||
/// <param name="engineType"></param>
|
||||
/// <returns></returns>
|
||||
public static bool OpName_MIS_EngineType_Insert(string opName, int engineTypeID, string engineType)
|
||||
{
|
||||
string produceName = "测量数据工位_监控系统_发动机型号_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[3];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@产品型号代码", engineTypeID);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@发动机型号", engineType);
|
||||
return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 测量数据工位_监控系统_托盘号_增加
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="palletCode"></param>
|
||||
/// <returns></returns>
|
||||
public static bool OpName_MIS_PalletCode_Insert(string opName, int palletCode)
|
||||
{
|
||||
string produceName = "测量数据工位_监控系统_托盘号_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@托盘号", palletCode);
|
||||
return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 测量数据工位_监控系统_返修_增加
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="repairCode"></param>
|
||||
/// <param name="repairBarcode"></param>
|
||||
/// <returns></returns>
|
||||
public static bool OpName_MIS_Repair_Insert(string opName, int repairCode, int Is_repairBarcode, string repairBarcode)
|
||||
{
|
||||
string produceName = "测量数据工位_监控系统_返修_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[4];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@返修标志", repairCode);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@拆解标志", Is_repairBarcode);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@拆解返修条码", repairBarcode);
|
||||
return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
|
||||
}
|
||||
|
||||
/// <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 MesServer_Process_EngineTypeOverBQ(string opName)
|
||||
{
|
||||
string produceName = "电子看板_装配零件_临时表_增加_北汽";
|
||||
SqlParameter[] thisParms = new SqlParameter[1];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
|
||||
}
|
||||
/// <summary>
|
||||
/// [电子看板_装配零件_临时表_增加_北汽线首]
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <returns></returns>
|
||||
public static bool MesServer_Process_EngineTypeOver_BQ_FirstOP(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="MainLineAllowWork"></param>
|
||||
/// <returns></returns>
|
||||
public static DataTable Create_OutLineBarCode(string EngineID, string OrderForm)
|
||||
{
|
||||
DataTable dt;
|
||||
string produceName = "自制件条码记录_创建";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@总成号", EngineID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@订单号", OrderForm);
|
||||
DataAccess.ExecuteStoredProcedure(produceName, ref thisParms, out dt);
|
||||
return dt;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 合力_OPA90是否允许工作_判断 如果允许工作则将两个轮毂状态设为待匹配
|
||||
/// </summary>
|
||||
/// <param name="EngineTypeID"></param>
|
||||
/// <param name="EngineTypeID_QiaoKe"></param>
|
||||
/// <param name="EngineID"></param>
|
||||
/// <param name="OrderForm"></param>
|
||||
/// <param name="MatchResult"></param>
|
||||
/// <param name="MatchResultStr"></param>
|
||||
/// <returns></returns>
|
||||
public static bool OP50_OPA90_MatchResult(int EngineTypeID, int EngineTypeID_QiaoKe, string EngineID, string OrderForm, out int MatchResult, out string MatchResultStr)
|
||||
{
|
||||
DataTable dt = new DataTable();
|
||||
MatchResult = 3;// 默认是报警 程序出错
|
||||
MatchResultStr = "默认是报警 程序出错";// 默认是报警 程序出错
|
||||
string produceName = "合力_OPA90是否允许工作_判断";
|
||||
SqlParameter[] thisParms = new SqlParameter[4];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@轮毂机型", EngineTypeID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@轮毂总成号", EngineID);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@桥壳_机型", EngineTypeID_QiaoKe);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@订单号", OrderForm);
|
||||
if (DataAccess.ExecuteStoredProcedure(produceName, ref thisParms, out dt))
|
||||
{
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
MatchResult = Convert.ToInt32(dt.Rows[0]["最终结果"]);
|
||||
MatchResultStr = dt.Rows[0]["最终结果说明"].ToString();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool OP051_OP050_NeedWork(string EngineID, string opName, string orderForm, out int MatchResult, out string resultMsg)
|
||||
{
|
||||
DataTable dt = new DataTable();
|
||||
MatchResult = 0;
|
||||
resultMsg = "";
|
||||
|
||||
string produceName = "合力_OP050前停判断_下工位是否需要工作";
|
||||
SqlParameter[] thisParms = new SqlParameter[3];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@桥壳总成号", EngineID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@订单号", orderForm);
|
||||
if (DataAccess.ExecuteStoredProcedure(produceName, ref thisParms, out dt))
|
||||
{
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
MatchResult = Convert.ToInt32(dt.Rows[0]["是否需要工作"]);
|
||||
resultMsg = dt.Rows[0]["msg"].ToString();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool OP051_OP050_NeedWork_Save(string EngineID, int MatchResult, string Cause)
|
||||
{
|
||||
|
||||
string produceName = "合力_OP050是否需要工作_插入";
|
||||
SqlParameter[] thisParms = new SqlParameter[3];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@桥壳总成号", EngineID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@是否需要工作", MatchResult);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@原因", Cause);
|
||||
return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 合力_工位报警记录表_增加
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <returns></returns>
|
||||
public static bool HeLi_OoNameAlarmRecord_Add(string opName, string EngineID, string alarmText)
|
||||
{
|
||||
string produceName = "合力_工位报警记录表_增加";
|
||||
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("@报警内容", alarmText);
|
||||
return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 电子看板_装配零件_临时表_线首_增加
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <returns></returns>
|
||||
public static bool MesServer_Process_EngineTypeOver_FirstOpName(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 GetEngineTypeByEngineID(string engineID, out DataTable dt)
|
||||
{
|
||||
string procedureName = "测量数据发动机在线状态_下线工位_是否存在_查询";
|
||||
SqlParameter[] thisParms = new SqlParameter[1];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@EngineID", engineID);
|
||||
//return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt);
|
||||
|
||||
|
||||
}
|
||||
//测量数据发动机在线状态_下线工位_是否存在_查询
|
||||
|
||||
|
||||
/// <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>
|
||||
/// <returns></returns>
|
||||
public static bool PartMaterialUseNum_Update(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>
|
||||
///[北汽福田工位J07MA40_验证线外工位零件是否与工位J07MA20匹配] @EngineID nvarchar(50),@BarCode nvarchar(50)
|
||||
/// </summary>
|
||||
/// <param name="EngineID"></param>
|
||||
/// <param name="BarCode"></param>
|
||||
/// <param name="IsAllowWork"></param>
|
||||
/// <returns></returns>
|
||||
public static bool MesServer_J07MA20_Judge_IsCanWork(string EngineID, string BarCode, out int IsAllowWork)
|
||||
{
|
||||
IsAllowWork = 0;
|
||||
string produceName = "北汽福田工位J07MA40_验证线外工位零件是否与工位J07MA20匹配";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@EngineID", EngineID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@BarCode", BarCode);
|
||||
if (DataAccess.ExecuteStoredProcedure(produceName, ref thisParms, out DataTable dt))
|
||||
{
|
||||
IsAllowWork = Convert.ToInt32(dt.Rows[0][0]);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 条码扫描_判断条码类型
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="barCode"></param>
|
||||
/// <param name="barCodeType"></param>
|
||||
/// <returns></returns>
|
||||
public static bool GetBarcodeType(string opName, string barCode, out string barCodeType)
|
||||
{
|
||||
barCodeType = "";
|
||||
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("@条码类型", barCodeType);
|
||||
thisParms[2].Direction = ParameterDirection.Output;
|
||||
if (DataAccess.ExecuteStoredProcedure(produceName, ref thisParms))
|
||||
{
|
||||
barCodeType = thisParms[2].Value.ToString();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 物料拉动_线边库存_修改
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="barcode"></param>
|
||||
/// <param name="MaterialIsExsit"></param>
|
||||
/// <param name="BarCodeIsExsit"></param>
|
||||
/// <param name="IsBillOk"></param>
|
||||
/// <param name="IsCanUpdateBetch"></param>
|
||||
/// <param name="IsScaningMulti"></param>
|
||||
/// <param name="IsMultiPC"></param>
|
||||
/// <returns></returns>
|
||||
public static bool ReceiveCard_Update(string OpName, string barcode,
|
||||
out bool MaterialIsExsit, out bool BarCodeIsExsit, out bool IsBillOk, out bool IsCanUpdateBetch, out bool IsScaningMulti, out bool IsMultiPC)
|
||||
{
|
||||
MaterialIsExsit = true;//@物料是否存在
|
||||
BarCodeIsExsit = true;//@条码是否存在
|
||||
IsBillOk = true;//@扫描是否符合订单
|
||||
IsCanUpdateBetch = true;//@是否可以更新批次
|
||||
IsScaningMulti = false;//@是否重复扫描
|
||||
IsMultiPC = false;//是否多箱追踪批次
|
||||
|
||||
|
||||
string produceName = "物料拉动_线边库存_修改";
|
||||
SqlParameter[] thisParms = new SqlParameter[8];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", OpName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@卡片条码", barcode);
|
||||
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@物料是否存在", MaterialIsExsit);
|
||||
thisParms[2].Direction = ParameterDirection.Output;
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@条码是否存在", BarCodeIsExsit);
|
||||
thisParms[3].Direction = ParameterDirection.Output;
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@扫描是否符合订单", IsBillOk);
|
||||
thisParms[4].Direction = ParameterDirection.Output;
|
||||
thisParms[5] = new System.Data.SqlClient.SqlParameter("@是否可以更新批次", IsCanUpdateBetch);
|
||||
thisParms[5].Direction = ParameterDirection.Output;
|
||||
thisParms[6] = new System.Data.SqlClient.SqlParameter("@是否重复扫描", IsScaningMulti);
|
||||
thisParms[6].Direction = ParameterDirection.Output;
|
||||
thisParms[7] = new System.Data.SqlClient.SqlParameter("@是否多箱消耗", IsMultiPC);
|
||||
thisParms[7].Direction = ParameterDirection.Output;
|
||||
|
||||
if (DataAccess.ExecuteStoredProcedure(produceName, ref thisParms))
|
||||
{
|
||||
MaterialIsExsit = Convert.ToBoolean(thisParms[2].Value);
|
||||
BarCodeIsExsit = Convert.ToBoolean(thisParms[3].Value);
|
||||
IsBillOk = Convert.ToBoolean(thisParms[4].Value);
|
||||
IsCanUpdateBetch = Convert.ToBoolean(thisParms[5].Value);
|
||||
IsScaningMulti = Convert.ToBoolean(thisParms[6].Value);
|
||||
IsMultiPC = Convert.ToBoolean(thisParms[7].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 bool IsSuccess)
|
||||
{
|
||||
IsSuccess = false;
|
||||
string produceName = "电子看板_装配零件_临时表_修改_零件条码";
|
||||
SqlParameter[] thisParms = new SqlParameter[3];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@条码", barCode);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@条码是否符合", IsSuccess);
|
||||
thisParms[2].Direction = ParameterDirection.Output;
|
||||
if (DataAccess.ExecuteStoredProcedure(produceName, ref thisParms))
|
||||
{
|
||||
IsSuccess = Convert.ToBoolean(thisParms[2].Value);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 北汽福田_总分线对应表_验证
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="barCode"></param>
|
||||
/// <param name="IsSuccess"></param>
|
||||
/// <returns></returns>
|
||||
public static bool BusPartLine_Check(string PartCode, string OpName, string orderForm, out bool IsSuccess)
|
||||
{
|
||||
IsSuccess = false;
|
||||
string produceName = "北汽福田_总分线对应表_验证";
|
||||
SqlParameter[] thisParms = new SqlParameter[4];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@分线总成号", PartCode);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@工位号", OpName);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@订单号", orderForm);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@Count", IsSuccess);
|
||||
thisParms[3].Direction = ParameterDirection.Output;
|
||||
if (DataAccess.ExecuteStoredProcedure(produceName, ref thisParms))
|
||||
{
|
||||
IsSuccess = Convert.ToBoolean(thisParms[3].Value);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 北汽福田_总分线对应表_增加
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="barCode"></param>
|
||||
/// <param name="IsSuccess"></param>
|
||||
/// <returns></returns>
|
||||
public static void BusPartLine_Add(string BusCode, string PartCode, string opName, string orderForm, string EngineID)
|
||||
{
|
||||
string produceName = "北汽福田_总分线对应表_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[5];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@主线总成号", BusCode);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@分线总成号", PartCode);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@订单号", orderForm);
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@机型号", EngineID);
|
||||
DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
|
||||
}
|
||||
|
||||
/// <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>
|
||||
/// 北汽福田工位BOM换型比对
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="engineType">新零件号(机型)</param>
|
||||
/// <returns></returns>
|
||||
public static DataTable EngineTypeChange(string opName, string engineType)
|
||||
{
|
||||
DataTable dt = new DataTable();
|
||||
string produceName = "北汽福田工位BOM换型比对";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@新零件号", engineType);
|
||||
DataAccess.ExecuteStoredProcedure(produceName, ref thisParms, out dt);
|
||||
return dt;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 测量数据发动机在线状态_查询_是否已工作
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="engineType">新零件号(机型)</param>
|
||||
/// <returns></returns>
|
||||
public static DataTable EngineIsTwoWork(string opName, string OrderForm, string EngineID)
|
||||
{
|
||||
DataTable dt = new DataTable();
|
||||
string produceName = "测量数据发动机在线状态_查询_是否已工作";
|
||||
SqlParameter[] thisParms = new SqlParameter[3];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@订单号", OrderForm);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@总成号", EngineID);
|
||||
DataAccess.ExecuteStoredProcedure(produceName, ref thisParms, out dt);
|
||||
return dt;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 北汽福田_TCU_增加
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="nameplate"></param>
|
||||
/// <param name="assemblyCode"></param>
|
||||
/// <param name="EngineTypeID"></param>
|
||||
/// <returns></returns>
|
||||
public static DataTable TCU_Add(string opName, string nameplate, string EngineID, string EngineTypeID)
|
||||
{
|
||||
DataTable dt = new DataTable();
|
||||
string produceName = "北汽福田_TCU_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[4];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@变速器总成码", EngineID);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@物料码", nameplate);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@机型代码", EngineTypeID);
|
||||
DataAccess.ExecuteStoredProcedure(produceName, ref thisParms, out dt);
|
||||
return dt;
|
||||
}
|
||||
//
|
||||
/// <summary>
|
||||
/// MES_装配数据_零部件追溯_增加
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <returns></returns>
|
||||
public static bool Material_Insert(string opName)
|
||||
{
|
||||
string produceName = "MES_装配数据_零部件追溯_增加";
|
||||
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 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="workGroupIndex"></param>
|
||||
/// <param name="BoltCode"></param>
|
||||
/// <param name="sn_WorkingStepIsOver"></param>
|
||||
/// <returns></returns>
|
||||
public static bool MesServer_ShaftPosition_Select_FinishResult(string opName, out int workGroupIndex, out string BoltCode, out bool sn_WorkingStepIsOver)
|
||||
{
|
||||
workGroupIndex = 0;
|
||||
BoltCode = "";
|
||||
sn_WorkingStepIsOver = true;
|
||||
|
||||
string produceName = "电子看板_工位机型_质量数据测量位置_临时表_查询_完成情况";
|
||||
SqlParameter[] thisParms = new SqlParameter[4];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@组号", SqlDbType.Int, 4);
|
||||
thisParms[1].Direction = ParameterDirection.Output;
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@套筒号", SqlDbType.NVarChar, 50);
|
||||
thisParms[2].Direction = ParameterDirection.Output;
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@是否全部完成", SqlDbType.Int, 4);
|
||||
thisParms[3].Direction = ParameterDirection.Output;
|
||||
if (DataAccess.ExecuteStoredProcedure(produceName, ref thisParms))
|
||||
{
|
||||
workGroupIndex = Convert.ToInt32(thisParms[1].Value);
|
||||
BoltCode = thisParms[2].Value.ToString();
|
||||
sn_WorkingStepIsOver = Convert.ToBoolean(thisParms[3].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>
|
||||
/// 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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,509 @@
|
||||
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
|
||||
{
|
||||
/// <summary>
|
||||
/// 关键零部件追溯
|
||||
/// </summary>
|
||||
public partial class BaseDataSystemMES
|
||||
{
|
||||
/// <summary>
|
||||
/// 向数据库写入返修数据
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="engineID"></param>
|
||||
/// <returns></returns>
|
||||
public static bool UpdateRepairStatusTo_SQL(string opname, string status)
|
||||
{
|
||||
string produceName = "测量数据_返修工位_工位状态_修改";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@返修状态", status);
|
||||
|
||||
return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 返修上线_返修工位及返修路径_增加
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="engineID"></param>
|
||||
/// <returns></returns>
|
||||
public static bool RepairStatusInsert(string engineID, string RepairStatus, string RepairMethod, string engineType)
|
||||
{
|
||||
string produceName = "返修上线_返修工位及返修路径_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[4];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@总成编号", engineID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@返修状态", RepairStatus);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@返修路径", RepairMethod);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@发动机型号", engineType);
|
||||
return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 上传数据
|
||||
/// MES_装配数据_零部件追溯_返修工位_数据主表
|
||||
/// 一般情况追踪代码等于发动机号()
|
||||
/// </summary>
|
||||
/// <param name="orderForm">订单号</param>
|
||||
/// <param name="engineNumber">发动机号</param>
|
||||
/// <param name="engineTraceCode">追踪代码</param>
|
||||
/// <param name="opName">工位号</param>
|
||||
/// <param name="operatorCode">人员代码</param>
|
||||
/// <param name="reasonCode">返修原因代码</param>
|
||||
/// <param name="reason">返修原因内容</param>
|
||||
/// <param name="repareContent">返修内容</param>
|
||||
/// <param name="operationTime">操作时间</param>
|
||||
static public bool AssemblyPartTraceMainTableRepairInsert_OnlySqlServer(string orderForm,
|
||||
string engineNumber, string engineTraceCode, string opName,
|
||||
string operatorCode, string reasonCode, string reason, string repareContent,string operationTime)
|
||||
{
|
||||
string sql_Insert;
|
||||
sql_Insert = "INSERT INTO [MES_装配数据_零部件追溯_返修工位_数据主表] " +
|
||||
"(订单号,发动机号,追踪代码,工位号,人员代码, 返修原因代码, 返修原因内容, 返修内容,操作时间)"
|
||||
+ " VALUES ("
|
||||
+ "'" + orderForm + "',"
|
||||
+ "'" + engineNumber + "',"
|
||||
+ "'" + engineTraceCode + "',"
|
||||
+ "'" + opName + "',"
|
||||
+ "'" + operatorCode + "',"
|
||||
+ "'" + reasonCode + "',"
|
||||
+ "'" + reason + "',"
|
||||
+ "'" + repareContent + "',"
|
||||
+ "'" + operationTime + "') ";
|
||||
|
||||
return DataAccess.ExecuteSQL(sql_Insert);
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 数据上传
|
||||
/// 删除数据
|
||||
/// MES_装配数据_零部件追溯_返修工位_数据主表
|
||||
/// </summary>
|
||||
/// <param name="traceID">追溯代码</param>
|
||||
//static public bool PartTraceTableRepareDelete(long traceID)
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "DELETE FROM [MES_装配数据_零部件追溯_返修工位_数据主表] "
|
||||
// + " WHERE 追溯代码=" + traceID.ToString();
|
||||
// return DataAccess.ExecuteSQL_OleDb_Access(sql);
|
||||
//}
|
||||
/// <summary>
|
||||
/// 数据上传
|
||||
/// 查询数据
|
||||
/// MES_装配数据_零部件追溯_返修工位_数据主表
|
||||
/// </summary>
|
||||
//static public bool PartTraceMainTableRepareSelect(out DataTable dt)
|
||||
//{
|
||||
// string sql;
|
||||
// dt = null;
|
||||
// sql = "SELECT * FROM [MES_装配数据_零部件追溯_返修工位_数据主表] ";
|
||||
// return DataAccess.ExecuteDataTable_OleDb_Access(sql, out dt);
|
||||
//}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询返修原因代码,返修内容
|
||||
/// </summary>
|
||||
/// <param name="engineTraceCode">追踪代码</param>
|
||||
/// <param name="opName">工位号</param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
static public bool AssemblyPartTraceTableRepairSelect(string engineTraceCode, string opName, out DataTable dt)
|
||||
{
|
||||
string sql;
|
||||
dt = null;
|
||||
sql = "SELECT 返修原因代码,返修内容 FROM [MES_装配数据_零部件追溯_返修工位_数据主表] "
|
||||
+ " where 追踪代码='" + engineTraceCode + "'"
|
||||
+ " and 工位号 = '" + opName + "'"
|
||||
+ " and 返修状态 = 0";
|
||||
//if (SQLCommon.SqlServerConnectionStatus)
|
||||
{
|
||||
return DataAccess.ExecuteDataTable(sql, out dt);
|
||||
}
|
||||
//if (!SQLCommon.SqlServerConnectionStatus)
|
||||
//{
|
||||
// return DataAccess.ExecuteDataTable_OleDb_Access(sql, out dt);
|
||||
//}
|
||||
//return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 测试是否填写返修原因数据
|
||||
/// 已经填写,返回true
|
||||
/// 没有填写,返回false
|
||||
/// </summary>
|
||||
/// <param name="orderForm"></param>
|
||||
/// <param name="engineTraceCode"></param>
|
||||
/// <param name="opName"></param>
|
||||
/// <returns></returns>
|
||||
static public bool AssemblyPartTraceTableRepairIsSave(string orderForm,string engineTraceCode, string opName)
|
||||
{
|
||||
string sql_Count;
|
||||
int count = 0;
|
||||
sql_Count = "SELECT COUNT (*) FROM [MES_装配数据_零部件追溯_返修工位_数据主表] "
|
||||
+ " where 追踪代码='" + engineTraceCode + "'"
|
||||
+ " and 工位号 = '" + opName + "'"
|
||||
+ " and 返修状态 = 0";
|
||||
//if (SQLCommon.SqlServerConnectionStatus)
|
||||
{
|
||||
DataAccess.ExecuteOutNum(sql_Count, out count);
|
||||
}
|
||||
//if (!SQLCommon.SqlServerConnectionStatus)
|
||||
//{
|
||||
// DataAccess.ExecuteOutNum_OleDb_Access(sql_Count, out count);
|
||||
//}
|
||||
if (count == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
//static public bool AssemblyPartTraceTableRepairReasonSelect(out DataTable dt)
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "SELECT 返修原因代码,返修原因内容 FROM MES_基本数据_返修原因";
|
||||
// return DataAccess.ExecuteDataTable_OleDb_Access(sql, out dt);
|
||||
//}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 同步通讯方式
|
||||
/// 增加数据,返回自动编号
|
||||
/// MES_装配数据_零部件追溯_返修工位_数据主表
|
||||
/// 一般情况追踪代码等于发动机号()
|
||||
/// </summary>
|
||||
/// <param name="orderForm">订单号</param>
|
||||
/// <param name="engineNumber">发动机号</param>
|
||||
/// <param name="engineTraceCode">追踪代码</param>
|
||||
/// <param name="opName">工位号</param>
|
||||
/// <param name="operatorCode">人员代码</param>
|
||||
/// <param name="reasonCode">返修原因代码</param>
|
||||
/// <param name="reason">返修原因内容</param>
|
||||
/// <param name="repareContent">返修内容</param>
|
||||
static public bool AssemblyPartTraceMainTableRepairInsert(string orderForm,
|
||||
string engineNumber, string engineTraceCode, string opName,
|
||||
string operatorCode, string reasonCode, string reason,string repareContent)
|
||||
{
|
||||
string sql_Insert;
|
||||
string sql_Update;
|
||||
string sql_Count;
|
||||
sql_Insert = "INSERT INTO [MES_装配数据_零部件追溯_返修工位_数据主表] " +
|
||||
"(订单号,发动机号,追踪代码,工位号,人员代码, 返修原因代码, 返修原因内容, 返修内容)"
|
||||
+ " VALUES ("
|
||||
+ "'" + orderForm + "',"
|
||||
+ "'" + engineNumber + "',"
|
||||
+ "'" + engineTraceCode + "',"
|
||||
+ "'" + opName + "',"
|
||||
+ "'" + operatorCode + "',"
|
||||
+ "'" + reasonCode + "',"
|
||||
+ "'" + reason + "',"
|
||||
+ "'" + repareContent + "') ";
|
||||
sql_Update = "UPDATE [MES_装配数据_零部件追溯_返修工位_数据主表] "
|
||||
+ "SET 人员代码 ='" + operatorCode + "',"
|
||||
+ " 返修原因代码 ='" + reasonCode + "',"
|
||||
+ " 返修原因内容 ='" + reason + "',"
|
||||
+ " 返修内容 ='" + repareContent + "'"
|
||||
+ " where 追踪代码='" + engineTraceCode + "'"
|
||||
+ " and 工位号 = '" + opName + "'"
|
||||
+ " and 返修状态 = 0";
|
||||
|
||||
sql_Count = "SELECT COUNT (*) FROM [MES_装配数据_零部件追溯_返修工位_数据主表] "
|
||||
+ " where 追踪代码='" + engineTraceCode + "'"
|
||||
+ " and 工位号 = '" + opName + "'"
|
||||
+ " and 返修状态 = 0";
|
||||
|
||||
int count=0;
|
||||
//if (SQLCommon.SqlServerConnectionStatus)
|
||||
{
|
||||
DataAccess.ExecuteOutNum(sql_Count, out count);
|
||||
if (count == 0)
|
||||
{
|
||||
return DataAccess.ExecuteSQL(sql_Insert);
|
||||
}
|
||||
else
|
||||
//MES_装配数据_零部件追溯_返修工位_数据主表
|
||||
//存在发动机号,工位号
|
||||
{
|
||||
return DataAccess.ExecuteSQL(sql_Update);
|
||||
}
|
||||
}
|
||||
//if (!SQLCommon.SqlServerConnectionStatus)
|
||||
//{
|
||||
// DataAccess.ExecuteOutNum_OleDb_Access(sql_Count, out count);
|
||||
// if (count == 0)
|
||||
// {
|
||||
// return DataAccess.ExecuteSQL_OleDb_Access(sql_Insert);
|
||||
// }
|
||||
// else
|
||||
// //MES_装配数据_零部件追溯_返修工位_数据主表
|
||||
// //存在发动机号,工位号
|
||||
// {
|
||||
// return DataAccess.ExecuteSQL_OleDb_Access(sql_Update);
|
||||
// }
|
||||
//}
|
||||
//return false;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///MES_装配数据_零部件追溯_返修工位
|
||||
///INSERT INTO [MES_装配数据_零部件追溯_返修工位]
|
||||
///增加数据,
|
||||
/// </summary>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static void VerifyAssemblyPartTableRepairInsert(DataTable dt)
|
||||
{
|
||||
//if (ApplicationConfig.connectionStringPIS_NEW_Value == "1")
|
||||
//{
|
||||
// //如果与SQL Server 数据库通讯失败,ApplicationConfig.connectionStringPIS_NEW_Value = "0"
|
||||
// VerifyAssemblyPartTableRepairInsert_SqlServer(dt);
|
||||
//}
|
||||
//if (ApplicationConfig.connectionStringPIS_NEW_Value == "0")
|
||||
//{
|
||||
// VerifyAssemblyPartTableRepairInsert_Access(dt);
|
||||
//}
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 同步操作方式
|
||||
///MES_装配数据_零部件追溯_返修工位
|
||||
///INSERT INTO [MES_装配数据_零部件追溯_返修工位]
|
||||
///增加数据,
|
||||
/// </summary>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static void VerifyAssemblyPartTableRepairInsert_SqlServer(DataTable dt)
|
||||
{
|
||||
string sql;
|
||||
sql = "INSERT INTO [MES_装配数据_零部件追溯_返修工位]"
|
||||
+ "([追溯代码],[订单号],[SAP物料号],[发动机型号],[发动机型号代码], [发动机机型], "
|
||||
+ "[发动机数量], [厂牌编号起始号], [客户名称],[投料日期],[文件编号],[集团名称],[通知号],"
|
||||
+ "[功率],[指南文件编号],[装机状态],[适用状态],[物料描述],[计划下达日期],[计划完工日期],"
|
||||
+ "[主配厂家],[工位号], [工位名称],[物料号], [零件图号], [零件名称], [零件数量],"
|
||||
+ "[是否扫描],[扫描方式代码], [扫描方式], [厂家代码],[生产厂家], "
|
||||
+ "[操作指导],[发动机号],[追踪代码],[物料号表索引号],[零件数量验证],"
|
||||
+ "[物料条码], [物料条码物料号], [物料条码批次],[验证结果], [操作者工号], [操作者姓名], [班次代码], "
|
||||
+ "物料来源代码,物料来源,是否禁用代码,是否禁用,被强制验证物料号,"
|
||||
+"更改代码,更改原因,操作时间)"
|
||||
|
||||
+ "VALUES(@追溯代码,@订单号,@SAP物料号,@发动机型号,@发动机型号代码,@发动机机型,"
|
||||
+ "@发动机数量,@厂牌编号起始号,@客户名称,@投料日期,@文件编号,@集团名称,@通知号,"
|
||||
+ "@功率,@指南文件编号,@装机状态,@适用状态,@物料描述,@计划下达日期,@计划完工日期,"
|
||||
+ "@主配厂家,@工位号,@工位名称,@物料号,@零件图号,@零件名称,@零件数量,"
|
||||
+ " @是否扫描,@扫描方式代码,@扫描方式,@厂家代码,@生产厂家,"
|
||||
+ "@操作指导,@发动机号,@追踪代码,@物料号表索引号,@零件数量验证,"
|
||||
+ "@物料条码,@物料条码物料号,@物料条码批次,@验证结果,@操作者工号,@操作者姓名,@班次代码,"
|
||||
+ "@物料来源代码,@物料来源,@是否禁用代码,@是否禁用,@被强制验证物料号,"
|
||||
+"@更改代码,@更改原因,@操作时间)";
|
||||
|
||||
|
||||
|
||||
SqlParameter[] thisParmsSql = new SqlParameter[52];
|
||||
// + "([订单号],[SAP物料号],[发动机型号],[发动机型号代码], [发动机机型], "
|
||||
thisParmsSql[0] = new SqlParameter("@追溯代码", SqlDbType.Int, 4, "追溯代码");
|
||||
thisParmsSql[1] = new SqlParameter("@订单号", SqlDbType.NVarChar, 50, "订单号");
|
||||
thisParmsSql[2] = new SqlParameter("@SAP物料号", SqlDbType.NVarChar, 50, "SAP物料号");
|
||||
thisParmsSql[3] = new SqlParameter("@发动机型号", SqlDbType.NVarChar, 50, "发动机型号");
|
||||
thisParmsSql[4] = new SqlParameter("@发动机型号代码", SqlDbType.Int, 4, "发动机型号代码");
|
||||
thisParmsSql[5] = new SqlParameter("@发动机机型", SqlDbType.NVarChar, 50, "发动机机型");
|
||||
|
||||
// + "@发动机数量,@厂牌编号起始号,@客户名称,@投料日期,@文件编号,@集团名称,@通知号,"
|
||||
thisParmsSql[6] = new SqlParameter("@发动机数量", SqlDbType.Int, 4, "发动机数量");
|
||||
thisParmsSql[7] = new SqlParameter("@厂牌编号起始号", SqlDbType.Int, 4, "厂牌编号起始号");
|
||||
thisParmsSql[8] = new SqlParameter("@客户名称", SqlDbType.NVarChar, 50, "客户名称");
|
||||
thisParmsSql[9] = new SqlParameter("@投料日期", SqlDbType.DateTime, 8, "投料日期");
|
||||
thisParmsSql[10] = new SqlParameter("@文件编号", SqlDbType.NVarChar, 50, "文件编号");
|
||||
thisParmsSql[11] = new SqlParameter("@集团名称", SqlDbType.NVarChar, 50, "集团名称");
|
||||
thisParmsSql[12] = new SqlParameter("@通知号", SqlDbType.NVarChar, 50, "通知号");
|
||||
|
||||
// + "@功率,@指南文件编号,@装机状态,@适用状态,@物料描述,@计划下达日期,@计划完工日期,"
|
||||
thisParmsSql[13] = new SqlParameter("@功率", SqlDbType.NVarChar, 50, "功率");
|
||||
thisParmsSql[14] = new SqlParameter("@指南文件编号", SqlDbType.NVarChar, 50, "指南文件编号");
|
||||
thisParmsSql[15] = new SqlParameter("@装机状态", SqlDbType.NVarChar, 50, "装机状态");
|
||||
thisParmsSql[16] = new SqlParameter("@适用状态", SqlDbType.DateTime, 8, "适用状态");
|
||||
thisParmsSql[17] = new SqlParameter("@物料描述", SqlDbType.NVarChar, 255, "物料描述");
|
||||
thisParmsSql[18] = new SqlParameter("@计划下达日期", SqlDbType.DateTime, 8, "计划下达日期");
|
||||
thisParmsSql[19] = new SqlParameter("@计划完工日期", SqlDbType.DateTime, 8, "计划完工日期");
|
||||
|
||||
// + "@主配厂家,@工位号,@工位名称,@物料号,@零件图号,@零件名称,@零件数量,"
|
||||
|
||||
thisParmsSql[20] = new SqlParameter("@主配厂家", SqlDbType.NVarChar, 50, "主配厂家");
|
||||
thisParmsSql[21] = new SqlParameter("@工位号", SqlDbType.NVarChar, 50, "工位号");
|
||||
thisParmsSql[22] = new SqlParameter("@工位名称", SqlDbType.NVarChar, 50, "工位名称");
|
||||
thisParmsSql[23] = new SqlParameter("@物料号", SqlDbType.NVarChar, 50, "物料号");
|
||||
thisParmsSql[24] = new SqlParameter("@零件图号", SqlDbType.NVarChar, 50, "零件图号");
|
||||
thisParmsSql[25] = new SqlParameter("@零件名称", SqlDbType.NVarChar, 50, "零件名称");
|
||||
thisParmsSql[26] = new SqlParameter("@零件数量", SqlDbType.Int, 4, "零件数量");
|
||||
|
||||
// +"[是否扫描],扫描方式代码, [扫描方式], [厂家代码],[生产厂家], "
|
||||
|
||||
thisParmsSql[27] = new SqlParameter("@是否扫描", SqlDbType.Int, 4, "是否扫描");
|
||||
thisParmsSql[28] = new SqlParameter("@扫描方式代码", SqlDbType.Int, 4, "扫描方式代码");
|
||||
thisParmsSql[29] = new SqlParameter("@扫描方式", SqlDbType.NVarChar, 50, "扫描方式");
|
||||
thisParmsSql[30] = new SqlParameter("@厂家代码", SqlDbType.NVarChar, 50, "厂家代码");
|
||||
thisParmsSql[31] = new SqlParameter("@生产厂家", SqlDbType.NVarChar, 50, "生产厂家");
|
||||
|
||||
//+ "@操作指导,@发动机号,@物料号表索引号,@零件数量验证,"
|
||||
|
||||
thisParmsSql[32] = new SqlParameter("@操作指导", SqlDbType.NVarChar, 255, "操作指导");
|
||||
thisParmsSql[33] = new SqlParameter("@发动机号", SqlDbType.NVarChar, 50, "发动机号");
|
||||
thisParmsSql[34] = new SqlParameter("@追踪代码", SqlDbType.NVarChar, 50, "追踪代码");
|
||||
thisParmsSql[35] = new SqlParameter("@物料号表索引号", SqlDbType.Int, 4, "物料号表索引号");
|
||||
thisParmsSql[36] = new SqlParameter("@零件数量验证", SqlDbType.Int, 4, "零件数量验证");
|
||||
|
||||
// +"[物料条码], [物料条码物料号], [物料条码批次],@验证结果, [操作者工号], [操作者姓名], [班次代码], "
|
||||
thisParmsSql[37] = new SqlParameter("@物料条码", SqlDbType.NVarChar, 50, "物料条码");
|
||||
thisParmsSql[38] = new SqlParameter("@物料条码物料号", SqlDbType.NVarChar, 50, "物料条码物料号");
|
||||
thisParmsSql[39] = new SqlParameter("@物料条码批次", SqlDbType.NVarChar, 50, "物料条码批次");
|
||||
thisParmsSql[40] = new SqlParameter("@验证结果", SqlDbType.Int, 4, "验证结果");
|
||||
thisParmsSql[41] = new SqlParameter("@操作者工号", SqlDbType.NVarChar, 50, "操作者工号");
|
||||
thisParmsSql[42] = new SqlParameter("@操作者姓名", SqlDbType.NVarChar, 50, "操作者姓名");
|
||||
thisParmsSql[43] = new SqlParameter("@班次代码", SqlDbType.NVarChar, 50, "班次代码");
|
||||
|
||||
// +"物料来源代码,物料来源,是否禁用代码,是否禁用,被强制验证物料号,更改代码,更改原因)"
|
||||
|
||||
thisParmsSql[44] = new SqlParameter("@物料来源代码", SqlDbType.Int, 4, "物料来源代码");
|
||||
thisParmsSql[45] = new SqlParameter("@物料来源", SqlDbType.NVarChar, 50, "物料来源");
|
||||
thisParmsSql[46] = new SqlParameter("@是否禁用代码", SqlDbType.Int, 4, "是否禁用代码");
|
||||
thisParmsSql[47] = new SqlParameter("@是否禁用", SqlDbType.NVarChar, 50, "是否禁用");
|
||||
thisParmsSql[48] = new SqlParameter("@被强制验证物料号", SqlDbType.NVarChar, 50, "被强制验证物料号");
|
||||
thisParmsSql[49] = new SqlParameter("@更改代码", SqlDbType.NVarChar, 50, "更改代码");
|
||||
thisParmsSql[50] = new SqlParameter("@更改原因", SqlDbType.NVarChar, 255, "更改原因");
|
||||
thisParmsSql[51] = new SqlParameter("@操作时间", SqlDbType.DateTime, 8, "操作时间");
|
||||
|
||||
DataAccess.ExecuteSQL(sql, ref thisParmsSql, dt);
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 异步操作方式
|
||||
/// _Access
|
||||
///MES_装配数据_零部件追溯_返修工位
|
||||
///INSERT INTO [MES_装配数据_零部件追溯_返修工位]
|
||||
///增加数据,
|
||||
/// </summary>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
//public static void VerifyAssemblyPartTableRepairInsert_Access(DataTable dt)
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "INSERT INTO [MES_装配数据_零部件追溯_返修工位]"
|
||||
// + "([追溯代码],[订单号],[SAP物料号],[发动机型号],[发动机型号代码], [发动机机型], "
|
||||
// + "[发动机数量], [厂牌编号起始号], [客户名称],[投料日期],[文件编号],[集团名称],[通知号],"
|
||||
// + "[功率],[指南文件编号],[装机状态],[适用状态],[物料描述],[计划下达日期],[计划完工日期],"
|
||||
// + "[主配厂家],[工位号], [工位名称],[物料号], [零件图号], [零件名称], [零件数量],"
|
||||
// + "[是否扫描],[扫描方式代码], [扫描方式], [厂家代码],[生产厂家], "
|
||||
// + "[操作指导],[发动机号],[追踪代码],[物料号表索引号],[零件数量验证],"
|
||||
// + "[物料条码], [物料条码物料号], [物料条码批次],[验证结果], [操作者工号], [操作者姓名], [班次代码], "
|
||||
// + "物料来源代码,物料来源,是否禁用代码,是否禁用,被强制验证物料号,"
|
||||
// +"更改代码,更改原因,操作时间)"
|
||||
|
||||
// + "VALUES(@追溯代码,@订单号,@SAP物料号,@发动机型号,@发动机型号代码,@发动机机型,"
|
||||
// + "@发动机数量,@厂牌编号起始号,@客户名称,@投料日期,@文件编号,@集团名称,@通知号,"
|
||||
// + "@功率,@指南文件编号,@装机状态,@适用状态,@物料描述,@计划下达日期,@计划完工日期,"
|
||||
// + "@主配厂家,@工位号,@工位名称,@物料号,@零件图号,@零件名称,@零件数量,"
|
||||
// + " @是否扫描,@扫描方式代码,@扫描方式,@厂家代码,@生产厂家,"
|
||||
// + "@操作指导,@发动机号,@追踪代码,@物料号表索引号,@零件数量验证,"
|
||||
// + "@物料条码,@物料条码物料号,@物料条码批次,@验证结果,@操作者工号,@操作者姓名,@班次代码,"
|
||||
// + "@物料来源代码,@物料来源,@是否禁用代码,@是否禁用,@被强制验证物料号,"
|
||||
// +"@更改代码,@更改原因,@操作时间)";
|
||||
|
||||
|
||||
// OleDbParameter[] thisParms1 = new OleDbParameter[52];
|
||||
// // + "([追溯代码],[订单号],[SAP物料号],[发动机型号],[发动机型号代码], [发动机机型], "
|
||||
// thisParms1[0] = new OleDbParameter("@追溯代码", OleDbType.Integer, 4, "追溯代码");
|
||||
// thisParms1[1] = new OleDbParameter("@订单号", OleDbType.VarChar, 50, "订单号");
|
||||
// thisParms1[2] = new OleDbParameter("@SAP物料号", OleDbType.VarChar, 50, "SAP物料号");
|
||||
// thisParms1[3] = new OleDbParameter("@发动机型号", OleDbType.VarChar, 50, "发动机型号");
|
||||
// thisParms1[4] = new OleDbParameter("@发动机型号代码", OleDbType.Integer, 4, "发动机型号代码");
|
||||
// thisParms1[5] = new OleDbParameter("@发动机机型", OleDbType.VarChar, 50, "发动机机型");
|
||||
|
||||
// // + "@发动机数量,@厂牌编号起始号,@客户名称,@投料日期,@文件编号,@集团名称,@通知号,"
|
||||
// thisParms1[6] = new OleDbParameter("@发动机数量", OleDbType.Integer, 4, "发动机数量");
|
||||
// thisParms1[7] = new OleDbParameter("@厂牌编号起始号", OleDbType.Integer, 4, "厂牌编号起始号");
|
||||
// thisParms1[8] = new OleDbParameter("@客户名称", OleDbType.VarChar, 50, "客户名称");
|
||||
// thisParms1[9] = new OleDbParameter("@投料日期", OleDbType.DBDate, 8, "投料日期");
|
||||
// thisParms1[10] = new OleDbParameter("@文件编号", OleDbType.VarChar, 50, "文件编号");
|
||||
// thisParms1[11] = new OleDbParameter("@集团名称", OleDbType.VarChar, 50, "集团名称");
|
||||
// thisParms1[12] = new OleDbParameter("@通知号", OleDbType.VarChar, 50, "通知号");
|
||||
|
||||
// // + "@功率,@指南文件编号,@装机状态,@适用状态,@物料描述,@计划下达日期,@计划完工日期,"
|
||||
// thisParms1[13] = new OleDbParameter("@功率", OleDbType.VarChar, 50, "功率");
|
||||
// thisParms1[14] = new OleDbParameter("@指南文件编号", OleDbType.VarChar, 50, "指南文件编号");
|
||||
// thisParms1[15] = new OleDbParameter("@装机状态", OleDbType.VarChar, 50, "装机状态");
|
||||
// thisParms1[16] = new OleDbParameter("@适用状态", OleDbType.DBDate, 8, "适用状态");
|
||||
// thisParms1[17] = new OleDbParameter("@物料描述", OleDbType.VarChar, 255, "物料描述");
|
||||
// thisParms1[18] = new OleDbParameter("@计划下达日期", OleDbType.DBDate, 8, "计划下达日期");
|
||||
// thisParms1[19] = new OleDbParameter("@计划完工日期", OleDbType.DBDate, 8, "计划完工日期");
|
||||
|
||||
// // + "@主配厂家,@工位号,@工位名称,@物料号,@零件图号,@零件名称,@零件数量,"
|
||||
|
||||
// thisParms1[20] = new OleDbParameter("@主配厂家", OleDbType.VarChar, 50, "主配厂家");
|
||||
// thisParms1[21] = new OleDbParameter("@工位号", OleDbType.VarChar, 50, "工位号");
|
||||
// thisParms1[22] = new OleDbParameter("@工位名称", OleDbType.VarChar, 50, "工位名称");
|
||||
// thisParms1[23] = new OleDbParameter("@物料号", OleDbType.VarChar, 50, "物料号");
|
||||
// thisParms1[24] = new OleDbParameter("@零件图号", OleDbType.VarChar, 50, "零件图号");
|
||||
// thisParms1[25] = new OleDbParameter("@零件名称", OleDbType.VarChar, 50, "零件名称");
|
||||
// thisParms1[26] = new OleDbParameter("@零件数量", OleDbType.Integer, 4, "零件数量");
|
||||
|
||||
// // +"[是否扫描],扫描方式代码, [扫描方式], [厂家代码],[生产厂家], "
|
||||
|
||||
// thisParms1[27] = new OleDbParameter("@是否扫描", OleDbType.Integer, 4, "是否扫描");
|
||||
// thisParms1[28] = new OleDbParameter("@扫描方式代码", OleDbType.Integer, 4, "扫描方式代码");
|
||||
// thisParms1[29] = new OleDbParameter("@扫描方式", OleDbType.VarChar, 50, "扫描方式");
|
||||
// thisParms1[30] = new OleDbParameter("@厂家代码", OleDbType.VarChar, 50, "厂家代码");
|
||||
// thisParms1[31] = new OleDbParameter("@生产厂家", OleDbType.VarChar, 50, "生产厂家");
|
||||
|
||||
// //+ "@操作指导,@发动机号,@物料号表索引号,@零件数量验证,"
|
||||
|
||||
// thisParms1[32] = new OleDbParameter("@操作指导", OleDbType.VarChar, 255, "操作指导");
|
||||
// thisParms1[33] = new OleDbParameter("@发动机号", OleDbType.VarChar, 50, "发动机号");
|
||||
// thisParms1[34] = new OleDbParameter("@追踪代码", OleDbType.VarChar, 50, "追踪代码");
|
||||
// thisParms1[35] = new OleDbParameter("@物料号表索引号", OleDbType.Integer, 4, "物料号表索引号");
|
||||
// thisParms1[36] = new OleDbParameter("@零件数量验证", OleDbType.Integer, 4, "零件数量验证");
|
||||
|
||||
// // +"[物料条码], [物料条码物料号], [物料条码批次],@验证结果, [操作者工号], [操作者姓名], [班次代码], "
|
||||
// thisParms1[37] = new OleDbParameter("@物料条码", OleDbType.VarChar, 50, "物料条码");
|
||||
// thisParms1[38] = new OleDbParameter("@物料条码物料号", OleDbType.VarChar, 50, "物料条码物料号");
|
||||
// thisParms1[39] = new OleDbParameter("@物料条码批次", OleDbType.VarChar, 50, "物料条码批次");
|
||||
// thisParms1[40] = new OleDbParameter("@验证结果", OleDbType.Integer, 4, "验证结果");
|
||||
// thisParms1[41] = new OleDbParameter("@操作者工号", OleDbType.VarChar, 50, "操作者工号");
|
||||
// thisParms1[42] = new OleDbParameter("@操作者姓名", OleDbType.VarChar, 50, "操作者姓名");
|
||||
// thisParms1[43] = new OleDbParameter("@班次代码", OleDbType.VarChar, 50, "班次代码");
|
||||
|
||||
// // +"物料来源代码,物料来源,是否禁用代码,是否禁用,被强制验证物料号,更改代码,更改原因)"
|
||||
|
||||
// thisParms1[44] = new OleDbParameter("@物料来源代码", OleDbType.Integer, 4, "物料来源代码");
|
||||
// thisParms1[45] = new OleDbParameter("@物料来源", OleDbType.VarChar, 50, "物料来源");
|
||||
// thisParms1[46] = new OleDbParameter("@是否禁用代码", OleDbType.Integer, 4, "是否禁用代码");
|
||||
// thisParms1[47] = new OleDbParameter("@是否禁用", OleDbType.VarChar, 50, "是否禁用");
|
||||
// thisParms1[48] = new OleDbParameter("@被强制验证物料号", OleDbType.VarChar, 50, "被强制验证物料号");
|
||||
// thisParms1[49] = new OleDbParameter("@更改代码", OleDbType.VarChar, 50, "更改代码");
|
||||
// thisParms1[50] = new OleDbParameter("@更改原因", OleDbType.VarChar, 255, "更改原因");
|
||||
// thisParms1[51] = new OleDbParameter("@操作时间", OleDbType.DBTimeStamp, 8, "操作时间");
|
||||
|
||||
// DataAccess.ExecuteDataTable_OleDb_Insert_Access(sql, dt, ref thisParms1);
|
||||
//}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,687 @@
|
||||
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
|
||||
{
|
||||
/// <summary>
|
||||
/// 关键零部件追溯
|
||||
/// </summary>
|
||||
public partial class BaseDataSystemMES
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 数据上传
|
||||
/// 删除数据
|
||||
/// MES_装配数据_零部件追溯
|
||||
/// </summary>
|
||||
/// <param name="traceID">追溯代码</param>
|
||||
//static public bool PartTraceTableDelete(long traceID)
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "DELETE FROM [MES_装配数据_零部件追溯] "
|
||||
// + " WHERE 追溯代码=" + traceID.ToString();
|
||||
// return DataAccess.ExecuteSQL_OleDb_Access(sql);
|
||||
//}
|
||||
/// <summary>
|
||||
/// 数据上传
|
||||
/// 删除数据
|
||||
/// MES_装配数据_零部件追溯_数据主表
|
||||
/// </summary>
|
||||
/// <param name="traceID">追溯代码</param>
|
||||
//static public bool PartTraceMainTableDelete(long traceID)
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "DELETE FROM [MES_装配数据_零部件追溯_数据主表] "
|
||||
// + " WHERE 追溯代码=" + traceID.ToString();
|
||||
// return DataAccess.ExecuteSQL_OleDb_Access(sql);
|
||||
//}
|
||||
/// <summary>
|
||||
/// 数据上传
|
||||
/// 查询数据
|
||||
/// MES_装配数据_零部件追溯
|
||||
/// </summary>
|
||||
/// <param name="traceID">追溯代码</param>
|
||||
/// <param name="dt"></param>
|
||||
//static public bool PartTraceTableSelect(long traceID, out DataTable dt)
|
||||
//{
|
||||
// string sql;
|
||||
// dt = null;
|
||||
// sql = "SELECT * FROM [MES_装配数据_零部件追溯] "
|
||||
// + " WHERE 追溯代码=" + traceID.ToString();
|
||||
// return DataAccess.ExecuteDataTable_OleDb_Access(sql, out dt);
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// 数据上传
|
||||
/// 查询数据
|
||||
/// MES_装配数据_零部件追溯_数据主表
|
||||
/// </summary>
|
||||
//static public bool PartTraceMainTableSelect(out DataTable dt)
|
||||
//{
|
||||
// string sql;
|
||||
// dt = null;
|
||||
// sql = "SELECT * FROM [MES_装配数据_零部件追溯_数据主表] ";
|
||||
// return DataAccess.ExecuteDataTable_OleDb_Access(sql, out dt);
|
||||
//}
|
||||
/// <summary>
|
||||
/// 数据上传
|
||||
/// 查询数据
|
||||
/// [MES_装配数据_零部件追溯_发动机号与缸盖号]
|
||||
/// </summary>
|
||||
//static public bool EngineID_CapNumber_Select(out DataTable dt)
|
||||
//{
|
||||
// string sql;
|
||||
// dt = null;
|
||||
// sql = "SELECT * FROM [MES_装配数据_零部件追溯_发动机号与缸盖号] ";
|
||||
// return DataAccess.ExecuteDataTable_OleDb_Access(sql, out dt);
|
||||
//}
|
||||
/// <summary>
|
||||
/// 数据上传
|
||||
/// 删除数据
|
||||
/// [MES_装配数据_零部件追溯_发动机号与缸盖号]
|
||||
/// </summary>
|
||||
//static public bool EngineID_CapNumber_Delete(int traceID)
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "DELETE FROM [MES_装配数据_零部件追溯_发动机号与缸盖号] "
|
||||
// + " WHERE 追溯代码=" + traceID.ToString()+"";
|
||||
// return DataAccess.ExecuteSQL_OleDb_Access(sql);
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// 数据上传
|
||||
/// MES_装配数据_零部件追溯_增加
|
||||
/// </summary>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static bool VerifyAssemblyPartTableInsert_OnlySqlServer(DataTable dt)
|
||||
{
|
||||
return VerifyAssemblyPartTableInsert_SqlServer(dt);
|
||||
}
|
||||
/// <summary>
|
||||
/// 数据上传
|
||||
/// 增加数据
|
||||
/// MES_装配数据_零部件追溯_数据主表
|
||||
/// 工件到达时间离开时间
|
||||
/// 返回“追溯代码”
|
||||
/// </summary>
|
||||
static public bool AssemblyPartIndexTableInsert_OnlySqlServer(out long traceID)
|
||||
{
|
||||
traceID = 0;
|
||||
string sql = GetSqlStringAssemblyPartIndexTable();
|
||||
//if (SQLCommon.SqlServerConnectionStatus)
|
||||
{
|
||||
return DataAccess.ExecuteNonQuery_newID(sql, out traceID);
|
||||
}
|
||||
//return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 数据上传
|
||||
/// MES_装配数据_零部件追溯_增加
|
||||
/// </summary>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
//public static bool VerifyAssemblyPartTableInsert_OnlyAccess(DataTable dt)
|
||||
//{
|
||||
// return VerifyAssemblyPartTableInsert_Access(dt);
|
||||
//}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 分装线物料追踪
|
||||
/// 增加数据
|
||||
/// MES_装配数据_零部件追溯_数据主表
|
||||
/// 工件到达时间离开时间
|
||||
/// 返回“追溯代码”
|
||||
/// </summary>
|
||||
/// <param name="traceID"></param>
|
||||
/// <returns></returns>
|
||||
//static public bool AssemblyPartIndexTableInsert_OnlyAccess(out long traceID)
|
||||
//{
|
||||
// traceID = 0;
|
||||
// string sql = GetSqlStringAssemblyPartIndexTable();
|
||||
// DataAccess.ExecuteNonQuery_newID_OleDb(sql, out traceID);
|
||||
// return false;
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// MES_装配数据_零部件追溯_数据主表
|
||||
/// 删除物料数据
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="engineID"></param>
|
||||
static public void AssemblyPartIndexTableDelete(string opName,string engineID)
|
||||
{
|
||||
DataTable dt;
|
||||
int traceID = 0;
|
||||
try
|
||||
{
|
||||
//获得 traceID;
|
||||
|
||||
string sql;
|
||||
sql = "SELECT top 1 追溯代码 From [MES_装配数据_零部件追溯_数据主表]"
|
||||
+ " WHERE 工位号='" + opName+"'"
|
||||
+ " and 发动机号 = '" + engineID+"'";
|
||||
|
||||
//if (SQLCommon.SqlServerConnectionStatus)
|
||||
{
|
||||
DataAccess.ExecuteDataTable( sql, out dt);
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
traceID = Convert.ToInt32(dt.Rows[0]["追溯代码"]);
|
||||
sql = " DELETE FROM MES_装配数据_零部件追溯 "
|
||||
+ " WHERE 追溯代码 = " + traceID.ToString();
|
||||
DataAccess.ExecuteSQL(sql);
|
||||
sql = " DELETE FROM MES_装配数据_零部件追溯_数据主表 "
|
||||
+ " WHERE 追溯代码 = " + traceID.ToString();
|
||||
DataAccess.ExecuteSQL(sql);
|
||||
}
|
||||
}
|
||||
}
|
||||
//if (!SQLCommon.SqlServerConnectionStatus)
|
||||
//{
|
||||
// DataAccess.ExecuteDataTable_OleDb_Access(sql, out dt);
|
||||
|
||||
// if (dt != null)
|
||||
// {
|
||||
// if (dt.Rows.Count > 0)
|
||||
// {
|
||||
// traceID = Convert.ToInt32(dt.Rows[0]["追溯代码"]);
|
||||
// sql = " DELETE FROM MES_装配数据_零部件追溯 "
|
||||
// + " WHERE 追溯代码 = " + traceID.ToString();
|
||||
// DataAccess.ExecuteSQL_OleDb_Access(sql);
|
||||
// sql = " DELETE FROM MES_装配数据_零部件追溯_数据主表 "
|
||||
// + " WHERE 追溯代码 = " + traceID.ToString();
|
||||
// DataAccess.ExecuteSQL_OleDb_Access(sql);
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
////ApplicationLog.WriteLog(err, err.Message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获得增加表[MES_装配数据_工位返修]的SQL语句
|
||||
/// [订单号], [发动机号], [工位号], [操作者工号], [班次代码],
|
||||
///[返修原因代码], [返修原因内容]
|
||||
/// 1:设备返修 2:MES放行
|
||||
/// </summary>
|
||||
private static string GetSqlStringRepairReasonTable()
|
||||
{
|
||||
string sql = null;
|
||||
sql = "INSERT INTO [MES_装配数据_工位返修] " +
|
||||
"(订单号,发动机号,发动机型号代码,工位号,操作者工号,班次代码,返修原因代码,返修原因内容)"
|
||||
+ " VALUES ("
|
||||
+ "'" + MaterialData.orderForm + "',"
|
||||
+ "'" + MaterialData.engineNumber + "',"
|
||||
+ "" + MaterialData.engineNumberCode + ","
|
||||
+ "'" + MaterialData.opName + "',"
|
||||
+ "'" + MaterialData.operatorCode + "',"
|
||||
+ "'" + MaterialData.operatorShift + "',"
|
||||
|
||||
+ "" + MaterialData.RepairReasonID.ToString() + ","
|
||||
+ "'" + MaterialData.RepairReasonText.ToString() + "') ";
|
||||
return sql;
|
||||
}
|
||||
/// <summary>
|
||||
/// MES_装配数据_工位返修
|
||||
/// </summary>
|
||||
static public void AssemblyRepairReasonTableInsert()
|
||||
{
|
||||
try
|
||||
{
|
||||
string sql = GetSqlStringRepairReasonTable();
|
||||
//if (SQLCommon.SqlServerConnectionStatus)
|
||||
{
|
||||
DataAccess.ExecuteSQL(sql);
|
||||
|
||||
}
|
||||
//if (!SQLCommon.SqlServerConnectionStatus)
|
||||
//{
|
||||
// DataAccess.ExecuteSQL_OleDb_Access(sql);
|
||||
//}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
////ApplicationLog.WriteLog(err, err.Message);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// MES_装配数据_零部件追溯_删除
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="engineID"></param>
|
||||
/// <returns></returns>
|
||||
public static void VerifyAssemblyPartTableDelete(string opName, string engineID)
|
||||
{
|
||||
|
||||
string sql;
|
||||
sql = "DELETE FROM [MES_装配数据_零部件追溯]" +
|
||||
" where 工位号='" + opName + "'"
|
||||
+ " and 发动机号='" + engineID + "'";
|
||||
|
||||
//if (SQLCommon.SqlServerConnectionStatus)
|
||||
{
|
||||
DataAccess.ExecuteSQL(sql);
|
||||
|
||||
}
|
||||
//if (!SQLCommon.SqlServerConnectionStatus)
|
||||
//{
|
||||
// DataAccess.ExecuteSQL_OleDb_Access(sql);
|
||||
//}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// MES_装配数据_零部件追溯_返修工位
|
||||
/// </summary>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static void VerifyAssemblyPartTableInsert_Repair(DataTable dt)
|
||||
{
|
||||
|
||||
//if (SQLCommon.SqlServerConnectionStatus)
|
||||
{
|
||||
//如果与SQL Server 数据库通讯失败,ApplicationConfig.connectionStringPIS_NEW_Value = "0"
|
||||
VerifyAssemblyPartTableInsert_SqlServer_Repair(dt);
|
||||
}
|
||||
//if (!SQLCommon.SqlServerConnectionStatus)
|
||||
//{
|
||||
// VerifyAssemblyPartTableInsert_Access_Repair(dt);
|
||||
//}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 同步通讯方式
|
||||
/// MES_装配数据_零部件追溯_返修工位
|
||||
/// SQL Server 数据库
|
||||
/// </summary>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static bool VerifyAssemblyPartTableInsert_SqlServer_Repair(DataTable dt)
|
||||
{
|
||||
string sql;
|
||||
sql = "INSERT INTO [MES_装配数据_零部件追溯_返修工位]"
|
||||
+ "([追溯代码],[订单号],[SAP物料号],[发动机型号],[发动机型号代码], [发动机机型], "
|
||||
+ "[发动机数量], [厂牌编号起始号], [客户名称],[投料日期],[文件编号],[集团名称],[通知号],"
|
||||
+ "[功率],[指南文件编号],[装机状态],[适用状态],[物料描述],[计划下达日期],[计划完工日期],"
|
||||
+ "[主配厂家],[工位号], [工位名称],[物料号], [零件图号], [零件名称], [零件数量],"
|
||||
+ "[是否扫描],[扫描方式代码], [扫描方式], [是否主物料],[厂家代码],[生产厂家], "
|
||||
+ "[操作指导],[发动机号],[追踪代码],[主物料号],[物料号表索引号],[零件数量验证],"
|
||||
+ "[物料条码], [物料条码物料号], [物料条码批次],[验证结果], [操作者工号], [操作者姓名], [班次代码], "
|
||||
+ "物料来源代码,物料来源,是否禁用代码,是否禁用,被强制验证物料号,"
|
||||
+ "更改代码,更改原因,零件类型,操作时间)"
|
||||
|
||||
+ "VALUES(@追溯代码,@订单号,@SAP物料号,@发动机型号,@发动机型号代码,@发动机机型,"
|
||||
+ "@发动机数量,@厂牌编号起始号,@客户名称,@投料日期,@文件编号,@集团名称,@通知号,"
|
||||
+ "@功率,@指南文件编号,@装机状态,@适用状态,@物料描述,@计划下达日期,@计划完工日期,"
|
||||
+ "@主配厂家,@工位号,@工位名称,@物料号,@零件图号,@零件名称,@零件数量,"
|
||||
+ " @是否扫描,@扫描方式代码,@扫描方式,@是否主物料,@厂家代码,@生产厂家,"
|
||||
+ "@操作指导,@发动机号,@追踪代码,@主物料号,@物料号表索引号,@零件数量验证,"
|
||||
+ "@物料条码,@物料条码物料号,@物料条码批次,@验证结果,@操作者工号,@操作者姓名,@班次代码,"
|
||||
+ "@物料来源代码,@物料来源,@是否禁用代码,@是否禁用,@被强制验证物料号,"
|
||||
+ "@更改代码,@更改原因,@零件类型,@操作时间)";
|
||||
|
||||
|
||||
|
||||
SqlParameter[] thisParmsSql = new SqlParameter[55];
|
||||
// + "([订单号],[SAP物料号],[发动机型号],[发动机型号代码], [发动机机型], "
|
||||
thisParmsSql[0] = new SqlParameter("@追溯代码", SqlDbType.Int, 4, "追溯代码");
|
||||
thisParmsSql[1] = new SqlParameter("@订单号", SqlDbType.NVarChar, 50, "订单号");
|
||||
thisParmsSql[2] = new SqlParameter("@SAP物料号", SqlDbType.NVarChar, 50, "SAP物料号");
|
||||
thisParmsSql[3] = new SqlParameter("@发动机型号", SqlDbType.NVarChar, 50, "发动机型号");
|
||||
thisParmsSql[4] = new SqlParameter("@发动机型号代码", SqlDbType.Int, 4, "发动机型号代码");
|
||||
thisParmsSql[5] = new SqlParameter("@发动机机型", SqlDbType.NVarChar, 50, "发动机机型");
|
||||
|
||||
// + "@发动机数量,@厂牌编号起始号,@客户名称,@投料日期,@文件编号,@集团名称,@通知号,"
|
||||
thisParmsSql[6] = new SqlParameter("@发动机数量", SqlDbType.Int, 4, "发动机数量");
|
||||
thisParmsSql[7] = new SqlParameter("@厂牌编号起始号", SqlDbType.Int, 4, "厂牌编号起始号");
|
||||
thisParmsSql[8] = new SqlParameter("@客户名称", SqlDbType.NVarChar, 50, "客户名称");
|
||||
thisParmsSql[9] = new SqlParameter("@投料日期", SqlDbType.DateTime, 8, "投料日期");
|
||||
thisParmsSql[10] = new SqlParameter("@文件编号", SqlDbType.NVarChar, 50, "文件编号");
|
||||
thisParmsSql[11] = new SqlParameter("@集团名称", SqlDbType.NVarChar, 50, "集团名称");
|
||||
thisParmsSql[12] = new SqlParameter("@通知号", SqlDbType.NVarChar, 50, "通知号");
|
||||
|
||||
// + "@功率,@指南文件编号,@装机状态,@适用状态,@物料描述,@计划下达日期,@计划完工日期,"
|
||||
thisParmsSql[13] = new SqlParameter("@功率", SqlDbType.NVarChar, 50, "功率");
|
||||
thisParmsSql[14] = new SqlParameter("@指南文件编号", SqlDbType.NVarChar, 50, "指南文件编号");
|
||||
thisParmsSql[15] = new SqlParameter("@装机状态", SqlDbType.NVarChar, 50, "装机状态");
|
||||
thisParmsSql[16] = new SqlParameter("@适用状态", SqlDbType.DateTime, 8, "适用状态");
|
||||
thisParmsSql[17] = new SqlParameter("@物料描述", SqlDbType.NVarChar, 255, "物料描述");
|
||||
thisParmsSql[18] = new SqlParameter("@计划下达日期", SqlDbType.DateTime, 8, "计划下达日期");
|
||||
thisParmsSql[19] = new SqlParameter("@计划完工日期", SqlDbType.DateTime, 8, "计划完工日期");
|
||||
|
||||
// + "@主配厂家,@工位号,@工位名称,@物料号,@零件图号,@零件名称,@零件数量,"
|
||||
|
||||
thisParmsSql[20] = new SqlParameter("@主配厂家", SqlDbType.NVarChar, 50, "主配厂家");
|
||||
thisParmsSql[21] = new SqlParameter("@工位号", SqlDbType.NVarChar, 50, "工位号");
|
||||
thisParmsSql[22] = new SqlParameter("@工位名称", SqlDbType.NVarChar, 50, "工位名称");
|
||||
thisParmsSql[23] = new SqlParameter("@物料号", SqlDbType.NVarChar, 50, "物料号");
|
||||
thisParmsSql[24] = new SqlParameter("@零件图号", SqlDbType.NVarChar, 50, "零件图号");
|
||||
thisParmsSql[25] = new SqlParameter("@零件名称", SqlDbType.NVarChar, 50, "零件名称");
|
||||
thisParmsSql[26] = new SqlParameter("@零件数量", SqlDbType.Int, 4, "零件数量");
|
||||
|
||||
// +"[是否扫描],扫描方式代码, [扫描方式], [厂家代码],[生产厂家], "
|
||||
|
||||
thisParmsSql[27] = new SqlParameter("@是否扫描", SqlDbType.Int, 4, "是否扫描");
|
||||
thisParmsSql[28] = new SqlParameter("@扫描方式代码", SqlDbType.Int, 4, "扫描方式代码");
|
||||
thisParmsSql[29] = new SqlParameter("@扫描方式", SqlDbType.NVarChar, 50, "扫描方式");
|
||||
thisParmsSql[30] = new SqlParameter("@是否主物料", SqlDbType.Int, 4, "是否主物料");
|
||||
thisParmsSql[31] = new SqlParameter("@厂家代码", SqlDbType.NVarChar, 50, "厂家代码");
|
||||
thisParmsSql[32] = new SqlParameter("@生产厂家", SqlDbType.NVarChar, 50, "生产厂家");
|
||||
|
||||
//+ "@操作指导,@发动机号,@物料号表索引号,@零件数量验证,"
|
||||
|
||||
thisParmsSql[33] = new SqlParameter("@操作指导", SqlDbType.NVarChar, 255, "操作指导");
|
||||
thisParmsSql[34] = new SqlParameter("@发动机号", SqlDbType.NVarChar, 50, "发动机号");
|
||||
thisParmsSql[35] = new SqlParameter("@追踪代码", SqlDbType.NVarChar, 50, "追踪代码");
|
||||
thisParmsSql[36] = new SqlParameter("@主物料号", SqlDbType.NVarChar, 50, "主物料号");
|
||||
thisParmsSql[37] = new SqlParameter("@物料号表索引号", SqlDbType.Int, 4, "物料号表索引号");
|
||||
thisParmsSql[38] = new SqlParameter("@零件数量验证", SqlDbType.Int, 4, "零件数量验证");
|
||||
|
||||
// +"[物料条码], [物料条码物料号], [物料条码批次],@验证结果, [操作者工号], [操作者姓名], [班次代码], "
|
||||
thisParmsSql[39] = new SqlParameter("@物料条码", SqlDbType.NVarChar, 50, "物料条码");
|
||||
thisParmsSql[40] = new SqlParameter("@物料条码物料号", SqlDbType.NVarChar, 50, "物料条码物料号");
|
||||
thisParmsSql[41] = new SqlParameter("@物料条码批次", SqlDbType.NVarChar, 50, "物料条码批次");
|
||||
thisParmsSql[42] = new SqlParameter("@验证结果", SqlDbType.Int, 4, "验证结果");
|
||||
thisParmsSql[43] = new SqlParameter("@操作者工号", SqlDbType.NVarChar, 50, "操作者工号");
|
||||
thisParmsSql[44] = new SqlParameter("@操作者姓名", SqlDbType.NVarChar, 50, "操作者姓名");
|
||||
thisParmsSql[45] = new SqlParameter("@班次代码", SqlDbType.NVarChar, 50, "班次代码");
|
||||
|
||||
// +"物料来源代码,物料来源,是否禁用代码,是否禁用,被强制验证物料号,更改代码,更改原因)"
|
||||
|
||||
thisParmsSql[46] = new SqlParameter("@物料来源代码", SqlDbType.Int, 4, "物料来源代码");
|
||||
thisParmsSql[47] = new SqlParameter("@物料来源", SqlDbType.NVarChar, 50, "物料来源");
|
||||
thisParmsSql[48] = new SqlParameter("@是否禁用代码", SqlDbType.Int, 4, "是否禁用代码");
|
||||
thisParmsSql[49] = new SqlParameter("@是否禁用", SqlDbType.NVarChar, 50, "是否禁用");
|
||||
thisParmsSql[50] = new SqlParameter("@被强制验证物料号", SqlDbType.NVarChar, 50, "被强制验证物料号");
|
||||
thisParmsSql[51] = new SqlParameter("@更改代码", SqlDbType.NVarChar, 50, "更改代码");
|
||||
thisParmsSql[52] = new SqlParameter("@更改原因", SqlDbType.NVarChar, 255, "更改原因");
|
||||
thisParmsSql[53] = new SqlParameter("@零件类型", SqlDbType.Int, 4, "零件类型");
|
||||
thisParmsSql[54] = new SqlParameter("@操作时间", SqlDbType.DateTime, 8, "操作时间");
|
||||
|
||||
//如果与SQL Server 数据库通讯失败,ApplicationConfig.connectionStringPIS_NEW_Value = "0"
|
||||
return DataAccess.ExecuteSQL(sql, ref thisParmsSql, dt);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 异步通讯方式
|
||||
/// 增加数据到Access数据库
|
||||
/// MES_装配数据_零部件追溯_返修工位
|
||||
/// INSERT INTO [MES_装配数据_零部件追溯_返修工位]
|
||||
/// </summary>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
//public static bool VerifyAssemblyPartTableInsert_Access_Repair(DataTable dt)
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "INSERT INTO [MES_装配数据_零部件追溯_返修工位]"
|
||||
// + "([追溯代码],[订单号],[SAP物料号],[发动机型号],[发动机型号代码], [发动机机型], "
|
||||
// + "[发动机数量], [厂牌编号起始号], [客户名称],[投料日期],[文件编号],[集团名称],[通知号],"
|
||||
// + "[功率],[指南文件编号],[装机状态],[适用状态],[物料描述],[计划下达日期],[计划完工日期],"
|
||||
// + "[主配厂家],[工位号], [工位名称],[物料号], [零件图号], [零件名称], [零件数量],"
|
||||
// + "[是否扫描],[扫描方式代码], [扫描方式], [是否主物料],[厂家代码],[生产厂家], "
|
||||
// + "[操作指导],[发动机号],[追踪代码],[主物料号],[物料号表索引号],[零件数量验证],"
|
||||
// + "[物料条码], [物料条码物料号], [物料条码批次],[验证结果], [操作者工号], [操作者姓名], [班次代码], "
|
||||
// + "物料来源代码,物料来源,是否禁用代码,是否禁用,被强制验证物料号,更改代码,更改原因,零件类型,操作时间)"
|
||||
|
||||
// + "VALUES(@追溯代码,@订单号,@SAP物料号,@发动机型号,@发动机型号代码,@发动机机型,"
|
||||
// + "@发动机数量,@厂牌编号起始号,@客户名称,@投料日期,@文件编号,@集团名称,@通知号,"
|
||||
// + "@功率,@指南文件编号,@装机状态,@适用状态,@物料描述,@计划下达日期,@计划完工日期,"
|
||||
// + "@主配厂家,@工位号,@工位名称,@物料号,@零件图号,@零件名称,@零件数量,"
|
||||
// + " @是否扫描,@扫描方式代码,@扫描方式,@是否主物料,@厂家代码,@生产厂家,"
|
||||
// + "@操作指导,@发动机号,@追踪代码,@主物料号,@物料号表索引号,@零件数量验证,"
|
||||
// + "@物料条码,@物料条码物料号,@物料条码批次,@验证结果,@操作者工号,@操作者姓名,@班次代码,"
|
||||
// + "@物料来源代码,@物料来源,@是否禁用代码,@是否禁用,@被强制验证物料号,"
|
||||
// + "@更改代码,@更改原因,@零件类型,@操作时间)";
|
||||
|
||||
|
||||
// OleDbParameter[] thisParms1 = new OleDbParameter[55];
|
||||
// // + "([追溯代码],[订单号],[SAP物料号],[发动机型号],[发动机型号代码], [发动机机型], "
|
||||
// thisParms1[0] = new OleDbParameter("@追溯代码", OleDbType.Integer, 4, "追溯代码");
|
||||
// thisParms1[1] = new OleDbParameter("@订单号", OleDbType.VarChar, 50, "订单号");
|
||||
// thisParms1[2] = new OleDbParameter("@SAP物料号", OleDbType.VarChar, 50, "SAP物料号");
|
||||
// thisParms1[3] = new OleDbParameter("@发动机型号", OleDbType.VarChar, 50, "发动机型号");
|
||||
// thisParms1[4] = new OleDbParameter("@发动机型号代码", OleDbType.Integer, 4, "发动机型号代码");
|
||||
// thisParms1[5] = new OleDbParameter("@发动机机型", OleDbType.VarChar, 50, "发动机机型");
|
||||
|
||||
// // + "@发动机数量,@厂牌编号起始号,@客户名称,@投料日期,@文件编号,@集团名称,@通知号,"
|
||||
// thisParms1[6] = new OleDbParameter("@发动机数量", OleDbType.Integer, 4, "发动机数量");
|
||||
// thisParms1[7] = new OleDbParameter("@厂牌编号起始号", OleDbType.Integer, 4, "厂牌编号起始号");
|
||||
// thisParms1[8] = new OleDbParameter("@客户名称", OleDbType.VarChar, 50, "客户名称");
|
||||
// thisParms1[9] = new OleDbParameter("@投料日期", OleDbType.DBDate, 8, "投料日期");
|
||||
// thisParms1[10] = new OleDbParameter("@文件编号", OleDbType.VarChar, 50, "文件编号");
|
||||
// thisParms1[11] = new OleDbParameter("@集团名称", OleDbType.VarChar, 50, "集团名称");
|
||||
// thisParms1[12] = new OleDbParameter("@通知号", OleDbType.VarChar, 50, "通知号");
|
||||
|
||||
// // + "@功率,@指南文件编号,@装机状态,@适用状态,@物料描述,@计划下达日期,@计划完工日期,"
|
||||
// thisParms1[13] = new OleDbParameter("@功率", OleDbType.VarChar, 50, "功率");
|
||||
// thisParms1[14] = new OleDbParameter("@指南文件编号", OleDbType.VarChar, 50, "指南文件编号");
|
||||
// thisParms1[15] = new OleDbParameter("@装机状态", OleDbType.VarChar, 50, "装机状态");
|
||||
// thisParms1[16] = new OleDbParameter("@适用状态", OleDbType.DBDate, 8, "适用状态");
|
||||
// thisParms1[17] = new OleDbParameter("@物料描述", OleDbType.VarChar, 255, "物料描述");
|
||||
// thisParms1[18] = new OleDbParameter("@计划下达日期", OleDbType.DBDate, 8, "计划下达日期");
|
||||
// thisParms1[19] = new OleDbParameter("@计划完工日期", OleDbType.DBDate, 8, "计划完工日期");
|
||||
|
||||
// // + "@主配厂家,@工位号,@工位名称,@物料号,@零件图号,@零件名称,@零件数量,"
|
||||
|
||||
// thisParms1[20] = new OleDbParameter("@主配厂家", OleDbType.VarChar, 50, "主配厂家");
|
||||
// thisParms1[21] = new OleDbParameter("@工位号", OleDbType.VarChar, 50, "工位号");
|
||||
// thisParms1[22] = new OleDbParameter("@工位名称", OleDbType.VarChar, 50, "工位名称");
|
||||
// thisParms1[23] = new OleDbParameter("@物料号", OleDbType.VarChar, 50, "物料号");
|
||||
// thisParms1[24] = new OleDbParameter("@零件图号", OleDbType.VarChar, 50, "零件图号");
|
||||
// thisParms1[25] = new OleDbParameter("@零件名称", OleDbType.VarChar, 50, "零件名称");
|
||||
// thisParms1[26] = new OleDbParameter("@零件数量", OleDbType.Integer, 4, "零件数量");
|
||||
|
||||
// // +"[是否扫描],扫描方式代码, [扫描方式], [厂家代码],[生产厂家], "
|
||||
|
||||
// thisParms1[27] = new OleDbParameter("@是否扫描", OleDbType.Integer, 4, "是否扫描");
|
||||
// thisParms1[28] = new OleDbParameter("@扫描方式代码", OleDbType.Integer, 4, "扫描方式代码");
|
||||
// thisParms1[29] = new OleDbParameter("@扫描方式", OleDbType.VarChar, 50, "扫描方式");
|
||||
// thisParms1[30] = new OleDbParameter("@是否主物料", OleDbType.Integer, 4, "是否主物料");
|
||||
// thisParms1[31] = new OleDbParameter("@厂家代码", OleDbType.VarChar, 50, "厂家代码");
|
||||
// thisParms1[32] = new OleDbParameter("@生产厂家", OleDbType.VarChar, 50, "生产厂家");
|
||||
|
||||
// //+ "@操作指导,@发动机号,@物料号表索引号,@零件数量验证,"
|
||||
|
||||
// thisParms1[33] = new OleDbParameter("@操作指导", OleDbType.VarChar, 255, "操作指导");
|
||||
// thisParms1[34] = new OleDbParameter("@发动机号", OleDbType.VarChar, 50, "发动机号");
|
||||
// thisParms1[35] = new OleDbParameter("@追踪代码", OleDbType.VarChar, 50, "追踪代码");
|
||||
// thisParms1[36] = new OleDbParameter("@主物料号", OleDbType.VarChar, 50, "主物料号");
|
||||
// thisParms1[37] = new OleDbParameter("@物料号表索引号", OleDbType.Integer, 4, "物料号表索引号");
|
||||
// thisParms1[38] = new OleDbParameter("@零件数量验证", OleDbType.Integer, 4, "零件数量验证");
|
||||
|
||||
// // +"[物料条码], [物料条码物料号], [物料条码批次],@验证结果, [操作者工号], [操作者姓名], [班次代码], "
|
||||
// thisParms1[39] = new OleDbParameter("@物料条码", OleDbType.VarChar, 50, "物料条码");
|
||||
// thisParms1[40] = new OleDbParameter("@物料条码物料号", OleDbType.VarChar, 50, "物料条码物料号");
|
||||
// thisParms1[41] = new OleDbParameter("@物料条码批次", OleDbType.VarChar, 50, "物料条码批次");
|
||||
// thisParms1[42] = new OleDbParameter("@验证结果", OleDbType.Integer, 4, "验证结果");
|
||||
// thisParms1[43] = new OleDbParameter("@操作者工号", OleDbType.VarChar, 50, "操作者工号");
|
||||
// thisParms1[44] = new OleDbParameter("@操作者姓名", OleDbType.VarChar, 50, "操作者姓名");
|
||||
// thisParms1[45] = new OleDbParameter("@班次代码", OleDbType.VarChar, 50, "班次代码");
|
||||
|
||||
// // +"物料来源代码,物料来源,是否禁用代码,是否禁用,被强制验证物料号,更改代码,更改原因)"
|
||||
|
||||
// thisParms1[46] = new OleDbParameter("@物料来源代码", OleDbType.Integer, 4, "物料来源代码");
|
||||
// thisParms1[47] = new OleDbParameter("@物料来源", OleDbType.VarChar, 50, "物料来源");
|
||||
// thisParms1[48] = new OleDbParameter("@是否禁用代码", OleDbType.Integer, 4, "是否禁用代码");
|
||||
// thisParms1[49] = new OleDbParameter("@是否禁用", OleDbType.VarChar, 50, "是否禁用");
|
||||
// thisParms1[50] = new OleDbParameter("@被强制验证物料号", OleDbType.VarChar, 50, "被强制验证物料号");
|
||||
// thisParms1[51] = new OleDbParameter("@更改代码", OleDbType.VarChar, 50, "更改代码");
|
||||
// thisParms1[52] = new OleDbParameter("@更改原因", OleDbType.VarChar, 255, "更改原因");
|
||||
// thisParms1[53] = new OleDbParameter("@零件类型", OleDbType.Integer, 4, "零件类型");
|
||||
// thisParms1[54] = new OleDbParameter("@操作时间", OleDbType.DBTimeStamp, 8, "操作时间");
|
||||
|
||||
// return DataAccess.ExecuteDataTable_OleDb_Insert_Access(sql, dt, ref thisParms1);
|
||||
//}
|
||||
/// <summary>
|
||||
/// MES_装配数据_零部件追溯_返修工位_返修原因
|
||||
/// </summary>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static void RepairReasonInsert(DataTable dt)
|
||||
{
|
||||
|
||||
//if (SQLCommon.SqlServerConnectionStatus)
|
||||
{
|
||||
//如果与SQL Server 数据库通讯失败,ApplicationConfig.connectionStringPIS_NEW_Value = "0"
|
||||
RepairReasonInsert_SqlServer(dt);
|
||||
}
|
||||
//if (!SQLCommon.SqlServerConnectionStatus)
|
||||
//{
|
||||
// RepairReasonInsert_Access(dt);
|
||||
//}
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// MES_装配数据_零部件追溯_返修工位_返修原因
|
||||
/// </summary>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static void RepairReasonInsert_OnlySqlServer(DataTable dt)
|
||||
{
|
||||
|
||||
//if (SQLCommon.SqlServerConnectionStatus)
|
||||
{
|
||||
//如果与SQL Server 数据库通讯失败,ApplicationConfig.connectionStringPIS_NEW_Value = "0"
|
||||
RepairReasonInsert_SqlServer(dt);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 同步通讯方式
|
||||
/// MES_装配数据_零部件追溯_返修工位_返修原因
|
||||
/// SQL Server 数据库
|
||||
/// </summary>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
private static bool RepairReasonInsert_SqlServer(DataTable dt)
|
||||
{
|
||||
string sql;
|
||||
sql = "INSERT INTO [MES_装配数据_零部件追溯_返修工位_返修原因]"
|
||||
+ "([追溯代码],[返修原因代码],[返修原因内容])"
|
||||
|
||||
+ "VALUES(@追溯代码,@返修原因代码,@返修原因内容)";
|
||||
SqlParameter[] thisParmsSql = new SqlParameter[3];
|
||||
thisParmsSql[0] = new SqlParameter("@追溯代码", SqlDbType.Int, 4, "追溯代码");
|
||||
thisParmsSql[1] = new SqlParameter("@返修原因代码", SqlDbType.Int, 4, "返修原因代码");
|
||||
thisParmsSql[2] = new SqlParameter("@返修原因内容", SqlDbType.NVarChar, 200, "返修原因内容");
|
||||
|
||||
return DataAccess.ExecuteSQL(sql, ref thisParmsSql, dt);
|
||||
}
|
||||
/// <summary>
|
||||
/// 异步通讯方式
|
||||
/// INSERT INTO [MES_装配数据_零部件追溯_返修工位_返修原因]
|
||||
/// </summary>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
//private static bool RepairReasonInsert_Access(DataTable dt)
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "INSERT INTO [MES_装配数据_零部件追溯_返修工位_返修原因]"
|
||||
// + "([追溯代码],[返修原因代码],[返修原因内容])"
|
||||
|
||||
// + "VALUES(@追溯代码,@返修原因代码,@返修原因内容)";
|
||||
|
||||
// OleDbParameter[] thisParms1 = new OleDbParameter[3];
|
||||
// // + "([追溯代码],[订单号],[SAP物料号],[发动机型号],[发动机型号代码], [发动机机型], "
|
||||
// thisParms1[0] = new OleDbParameter("@追溯代码", OleDbType.Integer, 4, "追溯代码");
|
||||
// thisParms1[1] = new OleDbParameter("@返修原因代码", OleDbType.Integer, 4, "返修原因代码");
|
||||
// thisParms1[2] = new OleDbParameter("@返修原因内容", OleDbType.VarChar, 200, "返修原因内容");
|
||||
|
||||
// return DataAccess.ExecuteDataTable_OleDb_Insert_Access(sql, dt, ref thisParms1);
|
||||
//}
|
||||
/// <summary>
|
||||
/// 异步通讯方式
|
||||
/// SELECT * FROM [MES_装配数据_零部件追溯_返修工位_返工原因_临时表]
|
||||
/// </summary>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
//public static bool RepairReasonSelect_Access_TempTable(out DataTable dt)
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "SELECT * FROM [MES_装配数据_零部件追溯_返修工位_返工原因_临时表]";
|
||||
|
||||
// return DataAccess.ExecuteDataTable_OleDb_Access( sql, out dt);
|
||||
//}
|
||||
/// <summary>
|
||||
/// 异步通讯方式
|
||||
/// INSERT INTO [MES_装配数据_零部件追溯_返修工位_返工原因_临时表]
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
//public static bool RepairReasonDelete_Access_TempTable()
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "DELETE FROM [MES_装配数据_零部件追溯_返修工位_返工原因_临时表]";
|
||||
|
||||
// return DataAccess.ExecuteSQL_OleDb_Access(sql);
|
||||
//}
|
||||
/// <summary>
|
||||
/// 数据上传
|
||||
/// SELECT * FROM [MES_装配数据_零部件追溯_返修工位_返修原因]
|
||||
/// </summary>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
//public static bool RepairReasonSelect_Access_Table(out DataTable dt)
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "SELECT * FROM [MES_装配数据_零部件追溯_返修工位_返修原因]";
|
||||
|
||||
// return DataAccess.ExecuteDataTable_OleDb_Access(sql, out dt);
|
||||
//}
|
||||
/// <summary>
|
||||
/// 数据上传
|
||||
/// DELETE FROM [MES_装配数据_零部件追溯_返修工位_返修原因]
|
||||
/// </summary>
|
||||
/// <param name="traceID"></param>
|
||||
/// <returns></returns>
|
||||
//public static bool RepairReasonDelete_Access_Table(int traceID)
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "DELETE FROM [MES_装配数据_零部件追溯_返修工位_返修原因] WHERE 追溯代码 = " + traceID.ToString();
|
||||
|
||||
// return DataAccess.ExecuteSQL_OleDb_Access(sql);
|
||||
//}
|
||||
/// <summary>
|
||||
/// INSERT INTO [MES_装配数据_零部件追溯_返修工位_返工原因_临时表]
|
||||
/// </summary>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
//public static bool RepairReasonInsert_Access_TempTable(DataTable dt)
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "INSERT INTO [MES_装配数据_零部件追溯_返修工位_返工原因_临时表]"
|
||||
// + "([追溯代码],[返修原因代码],[返修原因内容])"
|
||||
|
||||
// + "VALUES(@追溯代码,@返修原因代码,@返修原因内容)";
|
||||
|
||||
// OleDbParameter[] thisParms1 = new OleDbParameter[3];
|
||||
|
||||
// thisParms1[0] = new OleDbParameter("@追溯代码", OleDbType.Integer, 4, "追溯代码");
|
||||
// thisParms1[1] = new OleDbParameter("@返修原因代码", OleDbType.Integer, 4, "返修原因代码");
|
||||
// thisParms1[2] = new OleDbParameter("@返修原因内容", OleDbType.VarChar, 200, "返修原因内容");
|
||||
|
||||
// return DataAccess.ExecuteDataTable_OleDb_Insert_Access(sql, dt, ref thisParms1);
|
||||
//}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
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
|
||||
{
|
||||
/// <summary>
|
||||
/// 关键零部件追溯
|
||||
/// </summary>
|
||||
public partial class BaseDataSystemMES
|
||||
{
|
||||
/// <summary>
|
||||
/// 删除追踪代码
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
//public static void CartTraceCodeCheck(string opName, string TraceCode)
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "DELETE FROM [MES_装配数据_零部件追溯] "
|
||||
// + " where 追踪代码='" + TraceCode + "'";
|
||||
|
||||
// DataAccess.ExecuteSQL_OleDb_Access(sql);
|
||||
// sql = "DELETE FROM [MES_装配数据_零部件追溯_数据主表] "
|
||||
// + " where 追踪代码='" + TraceCode + "'";
|
||||
// DataAccess.ExecuteSQL_OleDb_Access(sql);
|
||||
//}
|
||||
/// <summary>
|
||||
/// 删除追踪代码
|
||||
/// 对于曲轴活塞上线工位,如果[MES_装配数据_零部件追溯_数据主表] 中[追踪代码]数量大于3删除
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
//public static void CartTraceCodeCheck_F3(string opName, string TraceCode)
|
||||
//{
|
||||
// int count;
|
||||
// string sql;
|
||||
|
||||
// sql = "SELECT COUNT(*) FROM [MES_装配数据_零部件追溯] "
|
||||
// + " where 追踪代码='" + TraceCode + "'"
|
||||
// + " and 工位号='" + opName+"'";
|
||||
// DataAccess.ExecuteOutNum_OleDb_Access(sql, out count);
|
||||
// if (count >= 3)
|
||||
// {
|
||||
// sql = "DELETE FROM [MES_装配数据_零部件追溯] "
|
||||
// + " where 追踪代码='" + TraceCode + "'";
|
||||
|
||||
// DataAccess.ExecuteSQL_OleDb_Access(sql);
|
||||
// sql = "DELETE FROM [MES_装配数据_零部件追溯_数据主表] "
|
||||
// + " where 追踪代码='" + TraceCode + "'";
|
||||
// DataAccess.ExecuteSQL_OleDb_Access(sql);
|
||||
// }
|
||||
//}
|
||||
/// <summary>
|
||||
/// 更改物料[发动机号][追踪号码]
|
||||
/// [MES_装配数据_零部件追溯_临时状态]
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
//public static void CartTraceCodeUpdate_TraceCode(string engineID, string traceCode)
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "UPDATE [MES_装配数据_零部件追溯_临时状态] "
|
||||
// + " SET 发动机号 = '" + engineID + "'"
|
||||
// + ",追踪代码 = '" + traceCode + "'";
|
||||
// DataAccess.ExecuteSQL_OleDb_Access(sql);
|
||||
//}
|
||||
/// <summary>
|
||||
/// [MES_装配数据_零部件追溯_临时状态]
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
//public static void CartTraceCodeSelect_TraceCode(out DataTable dt)
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "SELECT TOP 1 * FROM [MES_装配数据_零部件追溯_临时状态] ";
|
||||
// DataAccess.ExecuteDataTable_OleDb_Access(sql, out dt);
|
||||
//}
|
||||
/// <summary>
|
||||
/// 更改物料[追踪号码]
|
||||
/// [MES_装配数据_零部件追溯_临时状态]
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
//public static void CartTraceCodeUpdate(string opName, string TraceCode)
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "UPDATE [MES_装配数据_零部件追溯_临时状态] "
|
||||
// + " SET 发动机号 = '" + TraceCode + "'"
|
||||
// + ",追踪代码 = '" + TraceCode + "'"
|
||||
// + " where 工位号='" + opName + "'";
|
||||
// DataAccess.ExecuteSQL_OleDb_Access(sql);
|
||||
//}
|
||||
/// <summary>
|
||||
/// 总线缸盖上线工位
|
||||
/// 根据[追踪号码]获得验证物料
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
//public static void CartTraceCodeGetVerifyMaterial(string opName, string TraceCode, string opNameOtherFileName,out DataTable dt)
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "SELECT * FROM [MES_装配数据_零部件追溯] "
|
||||
// + " WHERE 追踪代码 = '" + TraceCode + "'"
|
||||
// + " AND 工位号 = '" + opName + "'";
|
||||
// DataAccess.ExecuteDataTable_OleDb_Access(sql, opNameOtherFileName, out dt);
|
||||
//}
|
||||
/// <summary>
|
||||
/// 总线缸盖上线工位
|
||||
/// 根据[追踪号码]获得全部验证物料
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
//public static void CartTraceCodeGetMaterial(string opName, string TraceCode, string opNameOtherFileName, out DataTable dt)
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "SELECT * FROM [MES_装配数据_零部件追溯] "
|
||||
// + " WHERE 追踪代码 = '" + TraceCode + "'";
|
||||
// DataAccess.ExecuteDataTable_OleDb_Access(sql, opNameOtherFileName, out dt);
|
||||
//}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
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记录原因,并将信息记录到需要不合格越过工位。
|
||||
/// 工件到位读取发动机号后,读取不合格越过信息,
|
||||
/// mes发送此信号到PLC,plc接收此信号后,才能不合格放行。
|
||||
/// DBX2.5
|
||||
/// 33
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
//public static DataTable BaseData_tagTable_FalseOverGo(string opName)
|
||||
//{
|
||||
// DataTable dt;
|
||||
// string sql;
|
||||
// sql = "SELECT TagID,0 as TagValue,TagName,工位号,数据来源,TagTypeID,TagLong,列位置,测量位置,变量类型代码,测量项目,TagAdr,TagAdrDemo FROM [MES_基本变量_原始数据] "
|
||||
// + " where 变量类型代码 = 33 and 是否启用 = 1 "
|
||||
// + " and 工位号='" + opName + "'";
|
||||
// DataAccess.ExecuteDataTable_OleDb_Access(sql, out dt);
|
||||
// return dt;
|
||||
//}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
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>
|
||||
/// 1、测试发动机号合理:在表[MES_计划BOM_发动机号]中存在
|
||||
/// SELECT COUNT(*) FROM MES_计划BOM_发动机号
|
||||
/// Access
|
||||
/// </summary>
|
||||
/// <param name="EngineID"></param>
|
||||
/// <param name="count"></param>
|
||||
/// <returns></returns>
|
||||
//public static bool EngineID_Select_Count(string EngineID, out int count)
|
||||
//{
|
||||
// count = 0;
|
||||
// string sql;
|
||||
// sql = "SELECT COUNT(*) FROM MES_计划BOM_发动机号 "
|
||||
// + " WHERE 发动机号 = '" + EngineID + "'";
|
||||
// return DataAccess.ExecuteOutNum_OleDb_Access(sql, out count);
|
||||
//}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据订单号,确定订单基本内容
|
||||
/// 返回订单对应的一行记录
|
||||
/// [MES_计划BOM_订单计划下达]
|
||||
/// Access 数据库
|
||||
/// </summary>
|
||||
/// <param name="orderFrom"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
//public static bool FirstOpNameTableGetOrderFormOnlyOneLine(string orderFrom,out DataTable dt)
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "SELECT TOP 1 * FROM [MES_计划BOM_订单计划下达]"
|
||||
// + " WHERE 订单号='" + orderFrom + "'";
|
||||
// return DataAccess.ExecuteDataTable_OleDb_Access(sql, out dt);
|
||||
//}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,395 @@
|
||||
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
|
||||
{
|
||||
/// <summary>
|
||||
/// 关键零部件追溯
|
||||
/// </summary>
|
||||
public partial class BaseDataSystemMES
|
||||
{
|
||||
/// <summary>
|
||||
/// 创建增加数据用表
|
||||
/// 获得物料已经验证的记录
|
||||
/// </summary>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static DataTable GetInsertTableMaterialVerifyOver(DataTable dt)
|
||||
{
|
||||
DataTable dt1;
|
||||
DataRow row;
|
||||
|
||||
dt1 = dt.Clone();
|
||||
|
||||
for (int i = 0; i < dt.Rows.Count; i++)
|
||||
{
|
||||
row = dt1.NewRow();
|
||||
for (int j = 0; j < dt.Columns.Count; j++)
|
||||
{
|
||||
row[j] = dt.Rows[i][j];
|
||||
}
|
||||
if (Convert.ToInt32(row["验证结果"]) != 0)
|
||||
{
|
||||
dt1.Rows.Add(row);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return dt1;
|
||||
}
|
||||
/// <summary>
|
||||
/// 创建增加数据用表
|
||||
/// </summary>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static DataTable GetInsertTable(DataTable dt)
|
||||
{
|
||||
DataTable dt1;
|
||||
DataRow row;
|
||||
|
||||
dt1 = dt.Clone();
|
||||
|
||||
for (int i = 0; i < dt.Rows.Count; i++)
|
||||
{
|
||||
row = dt1.NewRow();
|
||||
for (int j = 0; j < dt.Columns.Count; j++)
|
||||
{
|
||||
row[j] = dt.Rows[i][j];
|
||||
}
|
||||
dt1.Rows.Add(row);
|
||||
|
||||
}
|
||||
|
||||
return dt1;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// MES_装配数据_零部件追溯_临时状态_增加
|
||||
/// </summary>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
//public static void VerifyAssemblyPartTempTableInsert(DataTable dt)
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "INSERT INTO [MES_装配数据_零部件追溯_临时状态]"
|
||||
// + "([订单号],[SAP物料号],[发动机型号],[发动机型号代码], [发动机机型], "
|
||||
// + "[发动机数量], [厂牌编号起始号], [客户名称],[投料日期],[文件编号],[集团名称],[通知号],"
|
||||
// + "[功率],[指南文件编号],[装机状态],[适用状态],[物料描述],[计划下达日期],[计划完工日期],"
|
||||
// + "[主配厂家],[工位号], [工位名称],[物料号], [零件图号], [零件名称], [零件数量],"
|
||||
// + "[是否扫描],[扫描方式代码], [扫描方式], [厂家代码],[生产厂家], "
|
||||
// + "[操作指导],[发动机号],[追踪代码],[物料号表索引号],[零件数量验证],"
|
||||
// + "[物料条码], [物料条码物料号], [物料条码批次],[验证结果], [操作者工号], [操作者姓名], [班次代码], "
|
||||
// + "物料来源代码,物料来源,是否禁用代码,是否禁用,被强制验证物料号,更改代码,更改原因)"
|
||||
|
||||
// + "VALUES(@订单号,@SAP物料号,@发动机型号,@发动机型号代码,@发动机机型,"
|
||||
// + "@发动机数量,@厂牌编号起始号,@客户名称,@投料日期,@文件编号,@集团名称,@通知号,"
|
||||
// + "@功率,@指南文件编号,@装机状态,@适用状态,@物料描述,@计划下达日期,@计划完工日期,"
|
||||
// + "@主配厂家,@工位号,@工位名称,@物料号,@零件图号,@零件名称,@零件数量,"
|
||||
// + " @是否扫描,@扫描方式代码,@扫描方式,@厂家代码,@生产厂家,"
|
||||
// + "@操作指导,@发动机号,@追踪代码,@物料号表索引号,@零件数量验证,"
|
||||
// + "@物料条码,@物料条码物料号,@物料条码批次,@验证结果,@操作者工号,@操作者姓名,@班次代码,"
|
||||
// + "@物料来源代码,@物料来源,@是否禁用代码,@是否禁用,@被强制验证物料号,@更改代码,@更改原因)";
|
||||
|
||||
|
||||
// OleDbParameter[] thisParms1 = new OleDbParameter[50];
|
||||
// // + "([订单号],[SAP物料号],[发动机型号],[发动机型号代码], [发动机机型], "
|
||||
// thisParms1[0] = new OleDbParameter("@订单号", OleDbType.VarChar, 50, "订单号");
|
||||
// thisParms1[1] = new OleDbParameter("@SAP物料号", OleDbType.VarChar, 50, "SAP物料号");
|
||||
// thisParms1[2] = new OleDbParameter("@发动机型号", OleDbType.VarChar, 50, "发动机型号");
|
||||
// thisParms1[3] = new OleDbParameter("@发动机型号代码", OleDbType.Integer, 4, "发动机型号代码");
|
||||
// thisParms1[4] = new OleDbParameter("@发动机机型", OleDbType.VarChar, 50, "发动机机型");
|
||||
|
||||
// // + "@发动机数量,@厂牌编号起始号,@客户名称,@投料日期,@文件编号,@集团名称,@通知号,"
|
||||
// thisParms1[5] = new OleDbParameter("@发动机数量", OleDbType.Integer, 4, "发动机数量");
|
||||
// thisParms1[6] = new OleDbParameter("@厂牌编号起始号", OleDbType.Integer, 4, "厂牌编号起始号");
|
||||
// thisParms1[7] = new OleDbParameter("@客户名称", OleDbType.VarChar, 50, "客户名称");
|
||||
// thisParms1[8] = new OleDbParameter("@投料日期", OleDbType.DBDate, 8, "投料日期");
|
||||
// thisParms1[9] = new OleDbParameter("@文件编号", OleDbType.VarChar, 50, "文件编号");
|
||||
// thisParms1[10] = new OleDbParameter("@集团名称", OleDbType.VarChar, 50, "集团名称");
|
||||
// thisParms1[11] = new OleDbParameter("@通知号", OleDbType.VarChar, 50, "通知号");
|
||||
|
||||
// // + "@功率,@指南文件编号,@装机状态,@适用状态,@物料描述,@计划下达日期,@计划完工日期,"
|
||||
// thisParms1[12] = new OleDbParameter("@功率", OleDbType.VarChar, 50, "功率");
|
||||
// thisParms1[13] = new OleDbParameter("@指南文件编号", OleDbType.VarChar, 50, "指南文件编号");
|
||||
// thisParms1[14] = new OleDbParameter("@装机状态", OleDbType.VarChar, 50, "装机状态");
|
||||
// thisParms1[15] = new OleDbParameter("@适用状态", OleDbType.DBDate, 8, "适用状态");
|
||||
// thisParms1[16] = new OleDbParameter("@物料描述", OleDbType.VarChar, 255, "物料描述");
|
||||
// thisParms1[17] = new OleDbParameter("@计划下达日期", OleDbType.DBDate, 8, "计划下达日期");
|
||||
// thisParms1[18] = new OleDbParameter("@计划完工日期", OleDbType.DBDate, 8, "计划完工日期");
|
||||
|
||||
// // + "@主配厂家,@工位号,@工位名称,@物料号,@零件图号,@零件名称,@零件数量,"
|
||||
|
||||
// thisParms1[19] = new OleDbParameter("@主配厂家", OleDbType.VarChar, 50, "主配厂家");
|
||||
// thisParms1[20] = new OleDbParameter("@工位号", OleDbType.VarChar, 50, "工位号");
|
||||
// thisParms1[21] = new OleDbParameter("@工位名称", OleDbType.VarChar, 50, "工位名称");
|
||||
// thisParms1[22] = new OleDbParameter("@物料号", OleDbType.VarChar, 50, "物料号");
|
||||
// thisParms1[23] = new OleDbParameter("@零件图号", OleDbType.VarChar, 50, "零件图号");
|
||||
// thisParms1[24] = new OleDbParameter("@零件名称", OleDbType.VarChar, 50, "零件名称");
|
||||
// thisParms1[25] = new OleDbParameter("@零件数量", OleDbType.Integer, 4, "零件数量");
|
||||
|
||||
// // +"[是否扫描],扫描方式代码, [扫描方式], [厂家代码],[生产厂家], "
|
||||
|
||||
// thisParms1[26] = new OleDbParameter("@是否扫描", OleDbType.Integer, 4, "是否扫描");
|
||||
// thisParms1[27] = new OleDbParameter("@扫描方式代码", OleDbType.Integer, 4, "扫描方式代码");
|
||||
// thisParms1[28] = new OleDbParameter("@扫描方式", OleDbType.VarChar, 50, "扫描方式");
|
||||
// thisParms1[29] = new OleDbParameter("@厂家代码", OleDbType.VarChar, 50, "厂家代码");
|
||||
// thisParms1[30] = new OleDbParameter("@生产厂家", OleDbType.VarChar, 50, "生产厂家");
|
||||
|
||||
// //+ "@操作指导,@发动机号,@物料号表索引号,@零件数量验证,"
|
||||
|
||||
// thisParms1[31] = new OleDbParameter("@操作指导", OleDbType.VarChar, 255, "操作指导");
|
||||
// thisParms1[32] = new OleDbParameter("@发动机号", OleDbType.VarChar, 50, "发动机号");
|
||||
// thisParms1[33] = new OleDbParameter("@追踪代码", OleDbType.VarChar, 50, "追踪代码");
|
||||
// thisParms1[34] = new OleDbParameter("@物料号表索引号", OleDbType.Integer, 4, "物料号表索引号");
|
||||
// thisParms1[35] = new OleDbParameter("@零件数量验证", OleDbType.Integer, 4, "零件数量验证");
|
||||
|
||||
// // +"[物料条码], [物料条码物料号], [物料条码批次],@验证结果, [操作者工号], [操作者姓名], [班次代码], "
|
||||
// thisParms1[36] = new OleDbParameter("@物料条码", OleDbType.VarChar, 50, "物料条码");
|
||||
// thisParms1[37] = new OleDbParameter("@物料条码物料号", OleDbType.VarChar, 50, "物料条码物料号");
|
||||
// thisParms1[38] = new OleDbParameter("@物料条码批次", OleDbType.VarChar, 50, "物料条码批次");
|
||||
// thisParms1[39] = new OleDbParameter("@验证结果", OleDbType.Integer, 4, "验证结果");
|
||||
// thisParms1[40] = new OleDbParameter("@操作者工号", OleDbType.VarChar, 50, "操作者工号");
|
||||
// thisParms1[41] = new OleDbParameter("@操作者姓名", OleDbType.VarChar, 50, "操作者姓名");
|
||||
// thisParms1[42] = new OleDbParameter("@班次代码", OleDbType.VarChar, 50, "班次代码");
|
||||
|
||||
// // +"物料来源代码,物料来源,是否禁用代码,是否禁用,被强制验证物料号,更改代码,更改原因)"
|
||||
|
||||
// thisParms1[43] = new OleDbParameter("@物料来源代码", OleDbType.Integer, 4, "物料来源代码");
|
||||
// thisParms1[44] = new OleDbParameter("@物料来源", OleDbType.VarChar, 50, "物料来源");
|
||||
// thisParms1[45] = new OleDbParameter("@是否禁用代码", OleDbType.Integer, 4, "是否禁用代码");
|
||||
// thisParms1[46] = new OleDbParameter("@是否禁用", OleDbType.VarChar, 50, "是否禁用");
|
||||
// thisParms1[47] = new OleDbParameter("@被强制验证物料号", OleDbType.VarChar, 50, "被强制验证物料号");
|
||||
// thisParms1[48] = new OleDbParameter("@更改代码", OleDbType.VarChar, 50, "更改代码");
|
||||
// thisParms1[49] = new OleDbParameter("@更改原因", OleDbType.VarChar, 255, "更改原因");
|
||||
|
||||
// DataAccess.ExecuteDataTable_OleDb_Insert_Access(sql, dt, ref thisParms1);
|
||||
//}
|
||||
/// <summary>
|
||||
/// MES_装配数据_零部件追溯_临时状态_删除
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
//public static bool VerifyAssemblyPartTempTableDelete()
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "DELETE FROM [MES_装配数据_零部件追溯_临时状态] ";
|
||||
|
||||
// return DataAccess.ExecuteSQL_OleDb_Access(sql);
|
||||
//}
|
||||
/// <summary>
|
||||
/// MES_装配数据_零部件追溯_临时状态_删除
|
||||
/// </summary>
|
||||
/// <param name="engineNumber"></param>
|
||||
/// <param name="opName"></param>
|
||||
/// <returns></returns>
|
||||
//public static bool VerifyAssemblyPartTempTableDelete(string engineNumber, string opName)
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "DELETE FROM [MES_装配数据_零部件追溯_临时状态] "
|
||||
// + " where 发动机号='" + engineNumber + "' "
|
||||
// + " and 工位号='" + opName + "'";
|
||||
|
||||
// return DataAccess.ExecuteSQL_OleDb_Access(sql);
|
||||
//}
|
||||
/// <summary>
|
||||
/// MES_装配数据_零部件追溯_临时状态
|
||||
/// 符合条件的行数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
//public static int VerifyAssemblyPartTempTableCount()
|
||||
//{
|
||||
// int count;
|
||||
// string sql;
|
||||
// sql = "SELECT COUNT(*) FROM [MES_装配数据_零部件追溯_临时状态] ";
|
||||
|
||||
// DataAccess.ExecuteOutNum_OleDb_Access(sql, out count);
|
||||
// return count;
|
||||
|
||||
//}
|
||||
/// <summary>
|
||||
/// MES_装配数据_零部件追溯_临时状态
|
||||
/// 符合条件的行数
|
||||
/// </summary>
|
||||
/// <param name="engineID"></param>
|
||||
/// <returns></returns>
|
||||
//public static int VerifyAssemblyPartTempTableCountByEngineID(string engineID)
|
||||
//{
|
||||
// int count;
|
||||
// string sql;
|
||||
// sql = "SELECT COUNT(*) FROM [MES_装配数据_零部件追溯_临时状态] "
|
||||
// +" where 发动机号='" + engineID + "' ";
|
||||
// DataAccess.ExecuteOutNum_OleDb_Access(sql, out count);
|
||||
// return count;
|
||||
|
||||
//}
|
||||
/// <summary>
|
||||
/// MES_装配数据_零部件追溯_临时状态
|
||||
/// 符合条件的行数
|
||||
/// </summary>
|
||||
/// <param name="engineTraceCode"></param>
|
||||
/// <returns></returns>
|
||||
//public static int VerifyAssemblyPartTempTableCountByEngineTraceCode(string engineTraceCode)
|
||||
//{
|
||||
// int count;
|
||||
// string sql;
|
||||
// sql = "SELECT COUNT(*) FROM [MES_装配数据_零部件追溯_临时状态] "
|
||||
// +" where 追踪代码='" + engineTraceCode + "' ";
|
||||
|
||||
// DataAccess.ExecuteOutNum_OleDb_Access(sql, out count);
|
||||
// return count;
|
||||
//}
|
||||
///// <summary>
|
||||
///// MES_装配数据_零部件追溯_临时状态
|
||||
///// 符合条件的行数
|
||||
///// </summary>
|
||||
///// <param name="EngineNumber"></param>
|
||||
///// <returns></returns>
|
||||
//public static int VerifyAssemblyPartTempTableCount(string engineNumber, string opName)
|
||||
//{
|
||||
// int count;
|
||||
// string sql;
|
||||
// sql = "SELECT COUNT(*) FROM [MES_装配数据_零部件追溯_临时状态] "
|
||||
// + " where 发动机号='" + engineNumber + "' "
|
||||
// + " and 工位号='" + opName + "'";
|
||||
|
||||
// DataAccess.ExecuteOutNum_OleDb_Access(sql, out count);
|
||||
// return count;
|
||||
|
||||
//}
|
||||
/// <summary>
|
||||
/// MES_装配数据_零部件追溯_临时状态_选择
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
//public static DataTable VerifyAssemblyPartTempTableSelect()
|
||||
//{
|
||||
// string sql;
|
||||
// DataTable dt;
|
||||
// sql = "SELECT * FROM [MES_装配数据_零部件追溯_临时状态] ";
|
||||
|
||||
// DataAccess.ExecuteDataTable_OleDb_Access(sql, out dt);
|
||||
|
||||
// return dt;
|
||||
//}
|
||||
/// <summary>
|
||||
/// MES_装配数据_零部件追溯_临时状态_更新
|
||||
/// </summary>
|
||||
/// <param name="ID">物料号表索引号</param>
|
||||
/// <param name="barCode">物料条码</param>
|
||||
/// <param name="barCode_Material">物料条码物料号</param>
|
||||
/// <param name="barCode_SerailNumber">物料条码批次</param>
|
||||
/// <param name="materialVerifyResult">验证结果</param>
|
||||
/// <returns></returns>
|
||||
//public static bool VerifyAssemblyPartTempTableUpdate(int ID,string barCode, string barCode_Material,
|
||||
// string barCode_SerailNumber, int materialVerifyResult)
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "UPDATE [MES_装配数据_零部件追溯_临时状态] "
|
||||
// + "SET 物料条码='" + barCode + "'"
|
||||
// + ",物料条码物料号='" + barCode_Material + "'"
|
||||
// + ",物料条码批次='" + barCode_SerailNumber + "'"
|
||||
// + ",验证结果=" + materialVerifyResult.ToString()
|
||||
// + " where ID=" + Convert.ToString(ID);
|
||||
|
||||
// return DataAccess.ExecuteSQL_OleDb_Access(sql);
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// MES_装配数据_零部件追溯_临时状态_更新
|
||||
/// </summary>
|
||||
/// <param name="materialIndex">物料号表索引号</param>
|
||||
/// <param name="engineNumber">发动机号</param>
|
||||
/// <param name="opName">工位号</param>
|
||||
/// <param name="barCode">物料条码</param>
|
||||
/// <param name="barCode_Material">物料条码物料号</param>
|
||||
/// <param name="barCode_SerailNumber">物料条码批次</param>
|
||||
/// <param name="materialVerifyResult">验证结果</param>
|
||||
/// <returns></returns>
|
||||
//public static bool VerifyAssemblyPartTempTableUpdate(int materialIndex, string engineNumber, string opName,
|
||||
// string barCode, string barCode_Material, string barCode_SerailNumber, int materialVerifyResult)
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "UPDATE [MES_装配数据_零部件追溯_临时状态] "
|
||||
// + "SET 物料条码='" + barCode + "'"
|
||||
// + ",物料条码物料号='" + barCode_Material + "'"
|
||||
// + ",物料条码批次='" + barCode_SerailNumber + "'"
|
||||
// + ",验证结果=" + materialVerifyResult.ToString()
|
||||
// + " where ID=" + materialIndex.ToString();
|
||||
// //sql = "UPDATE [MES_装配数据_零部件追溯_临时状态] "
|
||||
// // + "SET 物料条码='" + barCode + "'"
|
||||
// // + ",物料条码物料号='" + barCode_Material + "'"
|
||||
// // + ",物料条码批次='" + barCode_SerailNumber + "'"
|
||||
// // + ",验证结果=" + materialVerifyResult.ToString()
|
||||
// // + " where 物料号表索引号=" + materialIndex.ToString();
|
||||
|
||||
// return DataAccess.ExecuteSQL_OleDb_Access(sql);
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// MES_装配数据_零部件追溯_临时状态_更新
|
||||
/// </summary>
|
||||
/// <param name="materialIndex">物料号表索引号</param>
|
||||
/// <param name="barCode">物料条码</param>
|
||||
/// <param name="barCode_Material">物料条码物料号</param>
|
||||
/// <param name="barCode_SerailNumber">物料条码批次</param>
|
||||
/// <param name="engineID"></param>
|
||||
/// <param name="traceCode"></param>
|
||||
/// <param name="materialVerifyResult">验证结果</param>
|
||||
/// <returns></returns>
|
||||
//public static bool VerifyAssemblyPartTempTableUpdate_New(int materialIndex,
|
||||
// string barCode, string barCode_Material, string barCode_SerailNumber,string engineID,string traceCode, int materialVerifyResult)
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "UPDATE [MES_装配数据_零部件追溯_临时状态] "
|
||||
// + "SET 物料条码='" + barCode + "'"
|
||||
// + ",物料条码物料号='" + barCode_Material + "'"
|
||||
// + ",物料条码批次='" + barCode_SerailNumber + "'"
|
||||
// + ",发动机号='" + engineID + "'"
|
||||
// + ",追踪代码='" + traceCode + "'"
|
||||
// + ",验证结果=" + materialVerifyResult.ToString()
|
||||
// + ",操作时间='" + DateTime.Now.ToString("G")+"'"
|
||||
// + " where ID=" + materialIndex.ToString();
|
||||
|
||||
// return DataAccess.ExecuteSQL_OleDb_Access(sql);
|
||||
//}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
//public static bool VerifyAssemblyPartTempTableSelectByMainMaterialCode(out DataTable dt)
|
||||
//{
|
||||
// dt = null;
|
||||
// string sql;
|
||||
// sql = "SELECT * FROM [MES_装配数据_零部件追溯_临时状态] WHERE 是否主物料 = 1";
|
||||
|
||||
// return DataAccess.ExecuteDataTable_OleDb_Access(sql, out dt);
|
||||
//}
|
||||
/// <summary>
|
||||
/// MES_装配数据_零部件追溯_临时状态_更新
|
||||
/// 取消验证
|
||||
/// </summary>
|
||||
/// <param name="ID">ID</param>
|
||||
/// <returns></returns>
|
||||
//public static bool VerifyAssemblyPartTempTableUpdate(int ID)
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "UPDATE [MES_装配数据_零部件追溯_临时状态] "
|
||||
// + "SET 物料条码=''"
|
||||
// + ",物料条码物料号=''"
|
||||
// + ",物料条码批次=''"
|
||||
// + ",验证结果=0 "
|
||||
// + " where ID=" + Convert.ToString(ID);
|
||||
|
||||
// return DataAccess.ExecuteSQL_OleDb_Access(sql);
|
||||
//}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
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
|
||||
{
|
||||
|
||||
public static DataTable dt_Signal()
|
||||
{
|
||||
DataTable dt;
|
||||
string sql;
|
||||
sql = "SELECT [TagID],[TagName] ,[工位号],[数据来源],[IP],[TagTypeID],[TagLong]"+
|
||||
" ,[DbName],[变量类型],[变量地址] ,[变量其它],[演示偏移] ,[列位置],[测量位置] ,[测量项目],[测量单位],[变量类型代码],[变量类型名称]"+
|
||||
" ,[机体类型],[线体类型],[TagAdr],[TagAdrDemo],[是否启用],[监控组] ,[监控时间间隔],[OpcServer_OPNAME],[变量特点],[是否监控]"+
|
||||
" ,[变量排序] ,[工序能力],[监控属性代码],[测量位置短],[上限值],[下限值] ,[理论值],[IsGoodBad] ,[IsSaveToSql]"+
|
||||
" ,[IsWebSocket] FROM [MES_基本变量_原始数据]";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
return dt;
|
||||
}
|
||||
|
||||
public static DataTable dt_Device()
|
||||
{
|
||||
DataTable dt;
|
||||
string sql;
|
||||
sql = "SELECT [设备IP] ,[设备类型],[是否启用] FROM [MES_基本变量设备类型对应表]";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
return dt;
|
||||
}
|
||||
|
||||
public static DataTable dt_TagTypeDataType()
|
||||
{
|
||||
DataTable dt;
|
||||
string sql;
|
||||
sql = "SELECT TOP (1000) [序号],[变量类型],[TagTypeDataType],[TagName],[变量类型代码],[TagTypeChange],[MesTagTypeChange],[WebTagTypeChange],[信号点名称][变量类型名称] FROM [MES_基本变量变量类型代码]";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
return dt;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
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>
|
||||
/// <param name="userName"></param>
|
||||
/// <param name="password"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
//public static bool GetUserName(string userName,string password,out DataTable dt)
|
||||
//{
|
||||
// //string errorMessage;
|
||||
// string sql;
|
||||
// sql = "SELECT top 1 * FROM [MES_操作者_用户] "
|
||||
// + "where 操作者工号='" + userName + "'"
|
||||
// + " and 密码='" + password + "'" ;
|
||||
// return DataAccess.ExecuteDataTable_OleDb_Access(sql, out dt);
|
||||
// //SQLCommon.ExecuteDataTable_OleDb(sql, ApplicationConfig.ConnectionString_Access, out dt, out errorMessage);
|
||||
//}
|
||||
/// <summary>
|
||||
/// 更改用户密码
|
||||
/// </summary>
|
||||
/// <param name="userName"></param>
|
||||
/// <param name="password"></param>
|
||||
/// <returns></returns>
|
||||
//public static bool UpdateUserName(string userName, string password)
|
||||
//{
|
||||
// //string errorMessage;
|
||||
// string sql;
|
||||
// sql = "UPDATE [MES_操作者_用户] "
|
||||
// + "SET 密码='" + password+"'"
|
||||
// + "where 操作者工号='" + userName + "'";
|
||||
// return DataAccess.ExecuteSQL_OleDb_Access(sql);
|
||||
// //return SQLCommon.ExecuteNonQuery_OleDb(sql, ApplicationConfig.ConnectionString_Access, out errorMessage);
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// MES_操作者_登录
|
||||
/// </summary>
|
||||
/// <param name="opName">工位号</param>
|
||||
/// <param name="operatorCode">操作者工号</param>
|
||||
/// <param name="operatorName">操作者姓名</param>
|
||||
/// <param name="operatorShift">班次代码</param>
|
||||
/// <param name="LogType">登录退出 (=1登录) (=0退出)</param>
|
||||
/// <returns></returns>
|
||||
//public static bool InsertLoginAndLogoutUserName(string opName, string operatorCode,
|
||||
// string operatorName,int operatorShift, int LogType)
|
||||
//{
|
||||
// //string errorMessage;
|
||||
// string sql;
|
||||
// sql = "INSERT INTO [MES_操作者_用户] ([工位号], [操作者工号], [操作者姓名], [班次代码], [登录退出])"
|
||||
// + "VALUES("
|
||||
// + "'" + opName + "',"
|
||||
// + "'" + operatorCode + "',"
|
||||
// + "'" + operatorName + "',"
|
||||
// + operatorShift.ToString() + ","
|
||||
// + LogType.ToString()
|
||||
// + ")";
|
||||
// return DataAccess.ExecuteSQL_OleDb_Access(sql);
|
||||
|
||||
// // return SQLCommon.ExecuteNonQuery_OleDb(sql, ApplicationConfig.ConnectionString_Access, out errorMessage);
|
||||
//}
|
||||
}
|
||||
}
|
||||
@@ -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>
|
||||
public static DataTable MobyDataStructureSelect()
|
||||
{
|
||||
DataTable dt;
|
||||
string sql;
|
||||
sql = "SELECT * FROM MES_基本变量_DB数据结构 ORDER BY [序号] ";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
return dt;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// MES_模拟MOBY数据_增加
|
||||
/// 增加一台发动机
|
||||
/// 返回该台发动机数据
|
||||
/// </summary>
|
||||
public static DataTable MobyInsert()
|
||||
{
|
||||
DataTable dt;
|
||||
string procedureName;
|
||||
procedureName = "MES_模拟MOBY数据_增加";
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, out dt);
|
||||
return dt;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// MES_模拟MOBY数据_查询
|
||||
/// </summary>
|
||||
/// <param name="engineNumber">发动机号</param>
|
||||
/// <returns></returns>
|
||||
public static DataTable MobySelect(string engineNumber)
|
||||
{
|
||||
DataTable dt;
|
||||
string procedureName;
|
||||
procedureName = "MES_模拟MOBY数据_查询";
|
||||
SqlParameter[] thisParms = new SqlParameter[1];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@发动机号", engineNumber);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt);
|
||||
return dt;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// MES_模拟MOBY数据_查询
|
||||
/// </summary>
|
||||
/// <param name="engineNumber">发动机号</param>
|
||||
/// <param name="number"></param>
|
||||
/// <param name="tagValue"></param>
|
||||
/// <returns></returns>
|
||||
public static void MobyUpdate(string engineNumber, int number, string tagValue)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "MES_模拟MOBY数据_查询";
|
||||
SqlParameter[] thisParms = new SqlParameter[3];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@发动机号", engineNumber);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@序号", engineNumber);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@数值", engineNumber);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
return;
|
||||
}
|
||||
/// <summary>
|
||||
/// MES_模拟MOBY数据_修改
|
||||
/// 序号 =27 ,工位代码
|
||||
/// </summary>
|
||||
/// <param name="engineNumber">发动机号</param>
|
||||
/// <param name="tagValue"></param>
|
||||
/// <returns></returns>
|
||||
public static void MobyUpdate(string engineNumber, string tagValue)
|
||||
{
|
||||
int number;
|
||||
|
||||
number = 27;
|
||||
|
||||
string procedureName;
|
||||
procedureName = "MES_模拟MOBY数据_修改";
|
||||
SqlParameter[] thisParms = new SqlParameter[3];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@发动机号", engineNumber);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@序号", number);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@数值", tagValue);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,216 @@
|
||||
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>
|
||||
///// MES_计划BOM_发动机号
|
||||
///// 获得订单号
|
||||
///// </summary>
|
||||
///// <param name="dt"></param>
|
||||
//static public void WorkPositionGuidOnLine_OrderForm(out DataTable dt)
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "SELECT distinct 订单号 from MES_计划BOM_订单计划下达_执行顺序 ";
|
||||
// DataAccess.ExecuteDataTable_OleDb_Access(sql, out dt);
|
||||
//}
|
||||
///// <summary>
|
||||
///// 物料清单
|
||||
///// 根据ID号获得物料清单
|
||||
///// 一行
|
||||
///// </summary>
|
||||
///// <param name="ID"></param>
|
||||
///// <param name="dt"></param>
|
||||
//static public void WorkPositionGuidOnLine_MaterialList(int ID, out DataTable dt)
|
||||
//{
|
||||
// string sql;
|
||||
|
||||
// sql = "SELECT [订单号], [SAP物料号], [发动机型号], [发动机型号代码], [发动机机型]," +
|
||||
// "[发动机数量], [厂牌编号起始号], [客户名称], [投料日期], [文件编号], [集团名称], [通知号], " +
|
||||
// "[功率], [指南文件编号], [装机状态], [适用状态], [物料描述],[计划下达日期], [计划完工日期],[实际完成日期],[实际结束日期],[操作时间]," +
|
||||
// "[主配厂家],[工位号], [工位名称], [物料号], [零件图号], [零件名称], [零件数量],[是否扫描],扫描方式,[厂家代码], [生产厂家], " +
|
||||
// "[操作指导],[工位基本操作指导],[工位基本指导图片],[日计划产量], [工位操作指导],[工位指导图片],[物料来源代码],[是否禁用代码],[被强制验证物料号],更改代码,更改原因" +
|
||||
// " FROM MES_计划BOM_订单计划下达 " +
|
||||
// " WHERE ID =" + Convert.ToString(ID);
|
||||
|
||||
// DataAccess.ExecuteDataTable_OleDb_Access(sql, out dt);
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
///// 物料清单
|
||||
///// 根据订单号和工位号
|
||||
///// </summary>
|
||||
///// <param name="orderForm"></param>
|
||||
///// <param name="opName"></param>
|
||||
///// <param name="dt"></param>
|
||||
//static public void WorkPositionGuidOnLine_MaterialList(string orderForm, string opName, out DataTable dt)
|
||||
//{
|
||||
// string sql;
|
||||
// //sql = "SELECT [ID], [订单号], [SAP物料号], [发动机型号], [发动机型号代码], [发动机机型]," +
|
||||
// // "[发动机数量], [厂牌编号起始号], [客户名称], [投料日期], [文件编号], [集团名称], [通知号], " +
|
||||
// // "[功率], [指南文件编号], [装机状态], [适用状态], [物料描述],[计划下达日期], [计划完工日期],[实际完成日期],[实际结束日期],[操作时间], " +
|
||||
// // "[主配厂家],[工位号], [工位名称], [物料号], [零件图号], [零件名称], [零件数量],[是否扫描],d.扫描方式代码,d.扫描方式,[厂家代码], [生产厂家], " +
|
||||
// // "[操作指导],[工位基本操作指导],[工位基本指导图片],[日计划产量], [工位操作指导],[工位指导图片],b.物料来源代码, b.物料来源, a.是否禁用代码, a.是否禁用,被强制验证物料号,更改代码,更改原因 "
|
||||
// // + " FROM MES_计划BOM_订单计划下达_扫描方式 AS d INNER JOIN (MES_计划BOM_订单计划下达_是否禁用 AS a INNER JOIN (MES_计划BOM_订单计划下达_物料来源 AS b INNER JOIN MES_计划BOM_订单计划下达 AS c ON b.物料来源代码 = c.物料来源代码) ON a.是否禁用代码 = c.是否禁用代码) ON c.扫描方式=d.扫描方式代码 "
|
||||
// // + " WHERE 订单号 ='" + orderForm + "'"
|
||||
// // + " AND 工位号 = '" + opName + "' "
|
||||
// // + " ORDER BY 物料号 ";
|
||||
// sql = " SELECT a.订单号, a.执行顺序,a.SAP物料号,a.发动机型号,a.发动机型号代码,a.发动机机型,"
|
||||
// + "a.发动机数量,a.厂牌编号起始号,a.客户名称,a.投料日期,a.文件编号,a.集团名称,a.通知号,a.功率,"
|
||||
// + "a.指南文件编号,a.装机状态,a.适用状态,a.物料描述,a.计划下达日期,a.计划完工日期,a.实际完成日期,"
|
||||
// + "a.实际结束日期,a.完成情况代码,a.完成数量,a.订单完成日期 ,"
|
||||
// + "b.主配厂家, b.工位号, b.工位名称, b.物料号,b.零件图号,b.零件名称,b.零件数量,"
|
||||
// + "b.是否扫描,b.扫描方式,b.是否主物料,b.厂家代码,b.生产厂家,b.操作指导,b.物料来源代码,"
|
||||
// + "b.是否禁用代码,b.被强制验证物料号,b.更改代码,b.更改原因,"
|
||||
// + "c.工位基本指导图片,d.工位操作指导, d.工位指导图片 "
|
||||
// + " FROM MES_计划BOM_订单计划下达_执行顺序 AS a INNER JOIN "
|
||||
// + "(MES_计划BOM_工位操作指南 AS d INNER JOIN "
|
||||
// + "(MES_计划BOM_发动机装配指南 AS b INNER JOIN MES_计划BOM_工位基本指导 AS c ON b.工位号 = c.工位号)"
|
||||
// + "ON d.工位号 = b.工位号) ON a.订单号 = b.订单号"
|
||||
// + " WHERE a.发动机型号代码=d.发动机型号代码 "
|
||||
// + " AND a.订单号 = '" + orderForm + "' "
|
||||
// + " AND b.工位号 = '" + opName + "' "
|
||||
// + " ORDER BY 物料号 ";
|
||||
// DataAccess.ExecuteDataTable_OleDb_Access(sql, out dt);
|
||||
//}
|
||||
///// <summary>
|
||||
///// 0090 F2 分线缸盖上线工位
|
||||
///// 1、缸盖到位后,显示该工位的操作指南,物料表和物料验证表
|
||||
///// 2、扫描缸盖,验证缸盖物料号
|
||||
///// 3、扫描“物料追踪号”
|
||||
///// 4、保存“物料追踪号”和缸盖号到缸盖需要验证的工位
|
||||
///// </summary>
|
||||
///// <returns></returns>
|
||||
//static public void WorkPositionGuidOnLine_MaterialList_F2(out DataTable dt, out string engineID)
|
||||
//{
|
||||
// //订单号
|
||||
// string orderForm;
|
||||
// //发动机号
|
||||
// engineID = null;
|
||||
// string sql;
|
||||
// string whereStr = " WHERE c.ID <> 0 ";
|
||||
// string order = " ORDER BY d.是否优先代码 DESC, a.执行顺序, c.发动机号 ";
|
||||
// sql = "SELECT a.订单号, a.执行顺序, a.计划下达日期, a.订单完成日期, b.完成情况代码, b.完成情况, "
|
||||
// + " c.ID, c.发动机号, c.发动机型号代码,c.发动机机型, c.投料日期, c.人员代码, c.班次, "
|
||||
// + " c.是否优先代码, c.是否装配代码, c.装配日期, d.是否优先代码, d.是否优先, e.是否装配代码, e.是否装配"
|
||||
// + " FROM (((MES_计划BOM_订单计划下达_执行顺序 AS a INNER JOIN MES_计划BOM_订单计划下达_完成情况 AS b ON a.完成情况代码 = b.完成情况代码) INNER JOIN MES_计划BOM_发动机号 AS c ON a.订单号 = c.订单号) INNER JOIN MES_计划BOM_发动机号_是否优先 AS d ON c.是否优先代码 = d.是否优先代码) INNER JOIN MES_计划BOM_发动机号_是否装配 AS e ON c.是否装配代码 = e.是否装配代码 ";
|
||||
// whereStr = whereStr + " and e.是否装配代码 = 0";
|
||||
// sql = sql + whereStr + order;
|
||||
// DataAccess.ExecuteDataTable_OleDb_Access(sql, out dt);
|
||||
// if (dt != null)
|
||||
// {
|
||||
// if (dt.Rows.Count > 0)
|
||||
// {
|
||||
// orderForm = dt.Rows[0]["订单号"].ToString();
|
||||
// engineID = dt.Rows[0]["发动机号"].ToString();
|
||||
// WorkPositionGuidOnLine_MaterialList(orderForm, ApplicationConfig.OpName, out dt);
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
///// <summary>
|
||||
///// 根据追踪代码(挂牌号)获得物料表
|
||||
/////六:分线缸盖半自动工位流程:MachineType=“S”,ScannerType = “1”,
|
||||
/////OpType=“P2”, OpNameMainLine=“OP0000”(总线缸盖上线工位)
|
||||
/////1:PLC向MES发送工件到位,开始扫描信号。WorkStart=1
|
||||
/////2:扫描追踪代码(挂牌号)
|
||||
/////3:通过OpNameMainLine(总线缸盖上线工位)工位数据表和本工位的装配指南,
|
||||
/////获得当前工位的装配指南,订单号、缸盖号、机型、机型标志。
|
||||
/////4:显示订单号、缸盖号、机型、机型标志
|
||||
/////5:显示装配指南和被验证物料
|
||||
/////6:MES向PLC写入发动机号、机型、机型标志、追踪代码
|
||||
/////7:MES向PLC写入MES激发变量扫描完成,EngineGetOver=1
|
||||
/////8:验证物料。
|
||||
/////9:物料验证完成,MES向PLC写入MES激发变量物料验证完毕信号,MaterialVerifyOver=1。
|
||||
/////10:PLC向MES发送工件离开信号WorkStart=0,
|
||||
/////保存数据发动机号、机型、机型标志、追踪代码到OpNameMainLine(总线缸盖上线工位)工位数据表中,
|
||||
/////完成工件当日计数和工作开始时间和结束时间。
|
||||
///// </summary>
|
||||
///// <returns></returns>
|
||||
//static public void WorkPositionGuidOnLine_MaterialList_P2(string opName, string orderForm, out DataTable dt)
|
||||
//{
|
||||
// ////物料追踪数据库来源
|
||||
// //string OpNameOther=null;
|
||||
// //////物料追踪数据库保存
|
||||
// ////string OpNameMainLine;
|
||||
// ////订单号
|
||||
// //string orderForm=null;
|
||||
// string sql;
|
||||
// //sql = "SELECT * FROM [MES_装配数据_零部件追溯_数据主表] "
|
||||
// // + " WHERE 追踪代码='" + traceCode+"'";
|
||||
// //DataAccess.ExecuteDataTable_OleDb_Access(sql,ApplicationConfig.OpNameOtherFileName, out dt);
|
||||
// //if (dt == null) return;
|
||||
// //if (dt.Rows.Count > 0)
|
||||
// //{
|
||||
// // orderForm = dt.Rows[0]["订单号"].ToString();
|
||||
// //}
|
||||
// ////物料清单
|
||||
|
||||
// sql = "SELECT [ID], [订单号], [SAP物料号], [发动机型号], [发动机型号代码], [发动机机型]," +
|
||||
// "[发动机数量], [厂牌编号起始号], [客户名称], [投料日期], [文件编号], [集团名称], [通知号], " +
|
||||
// "[功率], [指南文件编号], [装机状态], [适用状态], [物料描述],[计划下达日期], [计划完工日期],[实际完成日期],[实际结束日期],[操作时间], " +
|
||||
// "[主配厂家],[工位号], [工位名称], [物料号], [零件图号], [零件名称], [零件数量],[是否扫描],d.扫描方式代码,d.扫描方式,[厂家代码], [生产厂家], " +
|
||||
// "[操作指导],[工位基本操作指导],[工位基本指导图片],[日计划产量], [工位操作指导],[工位指导图片],b.物料来源代码, b.物料来源, a.是否禁用代码, a.是否禁用,被强制验证物料号,更改代码,更改原因 "
|
||||
// + " FROM MES_计划BOM_订单计划下达_扫描方式 AS d INNER JOIN (MES_计划BOM_订单计划下达_是否禁用 AS a INNER JOIN (MES_计划BOM_订单计划下达_物料来源 AS b INNER JOIN MES_计划BOM_订单计划下达 AS c ON b.物料来源代码 = c.物料来源代码) ON a.是否禁用代码 = c.是否禁用代码) ON c.扫描方式=d.扫描方式代码 "
|
||||
// + " WHERE 订单号 ='" + orderForm + "'"
|
||||
// + " AND 工位号 = '" + opName + "' "
|
||||
// + " ORDER BY 物料号 ";
|
||||
|
||||
// DataAccess.ExecuteDataTable_OleDb_Access(sql, out dt);
|
||||
//}
|
||||
/// <summary>
|
||||
/// 根据订单号和工位获得装配指南信息
|
||||
/// [MES_计划BOM_订单计划下达]
|
||||
/// </summary>
|
||||
/// <param name="orderForm">订单号</param>
|
||||
/// <param name="OpName">工位号</param>
|
||||
/// <param name="isVerify">是验证物料还是全部物料</param>
|
||||
/// <returns></returns>
|
||||
//public static DataTable GetMaterialListBak(string orderForm, string OpName, bool isVerify)
|
||||
//{
|
||||
// string errorMessage;
|
||||
// DataTable dt;
|
||||
// string sql;
|
||||
// if (isVerify)
|
||||
// {
|
||||
// sql = "SELECT [ID], [订单号], [SAP物料号], [发动机型号], [发动机型号代码], [发动机机型]," +
|
||||
// "[发动机数量], [厂牌编号起始号], [客户名称], [投料日期], [文件编号], [集团名称], [通知号], " +
|
||||
// "[功率], [指南文件编号], [装机状态], [适用状态], [物料描述],[计划下达日期], [计划完工日期]," +
|
||||
// "[主配厂家],[工位号], [工位名称], [物料号], [零件图号], [零件名称], [零件数量],[是否扫描],d.扫描方式代码,d.扫描方式,[厂家代码], [生产厂家], " +
|
||||
// "[操作指导],'' as 发动机号,'' as 追踪代码,0 as 物料号表索引号,0 as 零件数量验证,"
|
||||
// + "'' as 物料条码,'' as 物料条码物料号,'' as 物料条码批次,0 as 验证结果,"
|
||||
// + "'' as 操作者工号,'' as 操作者姓名,'' as 班次代码,"
|
||||
// + "b.物料来源代码, b.物料来源, a.是否禁用代码, a.是否禁用,被强制验证物料号,更改代码,更改原因 "
|
||||
// + " FROM MES_计划BOM_订单计划下达_扫描方式 AS d INNER JOIN (MES_计划BOM_订单计划下达_是否禁用 AS a INNER JOIN (MES_计划BOM_订单计划下达_物料来源 AS b INNER JOIN MES_计划BOM_订单计划下达 AS c ON b.物料来源代码 = c.物料来源代码) ON a.是否禁用代码 = c.是否禁用代码) ON c.扫描方式=d.扫描方式代码 "
|
||||
// + "where 订单号='" + orderForm + "'"
|
||||
// + "and 工位号='" + OpName + "' and a.是否禁用代码 = 0 and 是否扫描 <> 0 "
|
||||
// + " ORDER BY 物料号 ";
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// sql = "SELECT [ID],[订单号], [SAP物料号], [发动机型号], [发动机型号代码], [发动机机型]," +
|
||||
// "[发动机数量], [厂牌编号起始号], [客户名称], [投料日期], [文件编号], [集团名称], [通知号], " +
|
||||
// "[功率], [指南文件编号], [装机状态], [适用状态], [物料描述],[计划下达日期], [计划完工日期]," +
|
||||
// "[主配厂家],[工位号], [工位名称], [物料号], [零件图号], [零件名称], [零件数量],[是否扫描],d.扫描方式代码,d.扫描方式,[厂家代码], [生产厂家], " +
|
||||
// "[操作指导],'' as 发动机号,0 as 物料号表索引号,0 as 零件数量验证,"
|
||||
// + "'' as 物料条码,'' as 物料条码物料号,'' as 物料条码批次,0 as 验证结果,"
|
||||
// + "'' as 操作者工号,'' as 操作者姓名,'' as 班次代码,"
|
||||
// + "b.物料来源代码, b.物料来源, a.是否禁用代码, a.是否禁用,被强制验证物料号,更改代码,更改原因 "
|
||||
// + " FROM MES_计划BOM_订单计划下达_扫描方式 AS d INNER JOIN (MES_计划BOM_订单计划下达_是否禁用 AS a INNER JOIN (MES_计划BOM_订单计划下达_物料来源 AS b INNER JOIN MES_计划BOM_订单计划下达 AS c ON b.物料来源代码 = c.物料来源代码) ON a.是否禁用代码 = c.是否禁用代码) ON c.扫描方式=d.扫描方式代码 "
|
||||
// + "where 订单号='" + orderForm + "'"
|
||||
// + "and 工位号='" + OpName + "' and a.是否禁用代码 = 0 "
|
||||
// + " ORDER BY 物料号 ";
|
||||
// }
|
||||
// SQLCommon.ExecuteDataTable_OleDb(sql, ApplicationConfig.ConnectionString_Access, out dt, out errorMessage);
|
||||
// return dt;
|
||||
//}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,232 @@
|
||||
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>
|
||||
/// 增加,[MES_装配数据_零部件追溯_临时状态_缺省物料]
|
||||
/// </summary>
|
||||
/// <param name="barCode">物料条码</param>
|
||||
//static public void DefaultMaterialBarCodeInsert(string barCode)
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "INSERT INTO [MES_装配数据_零部件追溯_临时状态_缺省物料] (物料条码)"
|
||||
// +"VALUES('"+barCode+"')";
|
||||
// DataAccess.ExecuteSQL_OleDb_Access(sql);
|
||||
//}
|
||||
/// <summary>
|
||||
/// 修改,[MES_装配数据_零部件追溯_临时状态_缺省物料]
|
||||
/// </summary>
|
||||
/// <param name="ID"></param>
|
||||
/// <param name="barCode"></param>
|
||||
//static public void DefaultMaterialBarCodeUpdate(string ID,string barCode)
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "UPDATE [MES_装配数据_零部件追溯_临时状态_缺省物料] "
|
||||
// + "SET 物料条码 = '" + barCode + "'"
|
||||
// + "WHERE ID = "+ID.ToString();
|
||||
// DataAccess.ExecuteSQL_OleDb_Access(sql);
|
||||
//}
|
||||
/// <summary>
|
||||
/// 删除
|
||||
/// [MES_装配数据_零部件追溯_临时状态_缺省物料]
|
||||
/// </summary>
|
||||
/// <param name="ID"></param>
|
||||
//static public void DefaultMaterialBarCodeDelete(string ID)
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "DELETE FROM [MES_装配数据_零部件追溯_临时状态_缺省物料] "
|
||||
// + "WHERE ID = " + ID.ToString();
|
||||
// DataAccess.ExecuteSQL_OleDb_Access(sql);
|
||||
//}
|
||||
/// <summary>
|
||||
/// 获得 [MES_装配数据_零部件追溯_临时状态_缺省物料]
|
||||
/// </summary>
|
||||
/// <param name="dt"></param>
|
||||
//static public void DefaultMaterialBarCodeSelect(out DataTable dt)
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "SELECT * FROM [MES_装配数据_零部件追溯_临时状态_缺省物料] ";
|
||||
// DataAccess.ExecuteDataTable_OleDb_Access(sql, out dt);
|
||||
//}
|
||||
/// <summary>
|
||||
/// 强制验证物料删除,要将原物料设置为启用状态
|
||||
/// </summary>
|
||||
/// <param name="materialNumberVerify"></param>
|
||||
//static public void WorkPositionGuidOnLine_MaterialUpdateByMaterrial(string materialNumberVerify)
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "UPDATE MES_计划BOM_订单计划下达 SET 是否禁用代码=0 WHERE 物料号='" + materialNumberVerify+"'";
|
||||
|
||||
// DataAccess.ExecuteSQL_OleDb_Access(sql);
|
||||
//}
|
||||
/// <summary>
|
||||
/// 物料禁用
|
||||
/// </summary>
|
||||
/// <param name="ID"></param>
|
||||
//static public void WorkPositionGuidOnLine_MaterialNoUsing(int ID)
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "UPDATE MES_计划BOM_订单计划下达 SET 是否禁用代码=1 WHERE ID=" + Convert.ToString(ID);
|
||||
|
||||
// DataAccess.ExecuteSQL_OleDb_Access(sql);
|
||||
//}
|
||||
/// <summary>
|
||||
/// 物料启用
|
||||
/// </summary>
|
||||
/// <param name="ID"></param>
|
||||
//static public void WorkPositionGuidOnLine_MaterialUsing(int ID)
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "UPDATE MES_计划BOM_订单计划下达 SET 是否禁用代码=0 WHERE ID=" + Convert.ToString(ID);
|
||||
|
||||
// DataAccess.ExecuteSQL_OleDb_Access(sql);
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// 订单号, 发动机型号, 发动机类型, 发动机数量
|
||||
/// </summary>
|
||||
/// <param name="orderForm"></param>
|
||||
/// <param name="dt"></param>
|
||||
//static public void WorkPositionGuidOnLine_OrderForm(string orderForm, out DataTable dt)
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "SELECT distinct 订单号, 发动机型号, 发动机机型, 发动机数量, 客户名称,投料日期,计划下达日期 "
|
||||
// + "FROM MES_计划BOM_订单计划下达_执行顺序 WHERE 订单号='"
|
||||
// + orderForm + "'";
|
||||
|
||||
// DataAccess.ExecuteDataTable_OleDb_Access(sql, out dt);
|
||||
//}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// MES_计划BOM_订单计划下达_扫描方式
|
||||
/// </summary>
|
||||
/// <param name="dt"></param>
|
||||
//static public void WorkPositionGuidOnLine_MaterialVerifyID(out DataTable dt)
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "SELECT 扫描方式代码,扫描方式 from MES_计划BOM_订单计划下达_扫描方式 ";
|
||||
// DataAccess.ExecuteDataTable_OleDb_Access(sql, out dt);
|
||||
//}
|
||||
/// <summary>
|
||||
/// MES_计划BOM_订单计划下达_物料来源
|
||||
/// </summary>
|
||||
/// <param name="dt"></param>
|
||||
//static public void WorkPositionGuidOnLine_MaterialComeFrom(out DataTable dt)
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "SELECT 物料来源代码,物料来源 from MES_计划BOM_订单计划下达_物料来源 ";
|
||||
// DataAccess.ExecuteDataTable_OleDb_Access(sql, out dt);
|
||||
//}
|
||||
/// <summary>
|
||||
/// MES_计划BOM_订单计划下达_是否禁用
|
||||
/// </summary>
|
||||
/// <param name="dt"></param>
|
||||
//static public void WorkPositionGuidOnLine_MaterialIsUsing(out DataTable dt)
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "SELECT 是否禁用代码,是否禁用 from MES_计划BOM_订单计划下达_是否禁用 ";
|
||||
// DataAccess.ExecuteDataTable_OleDb_Access(sql, out dt);
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// 物料验证
|
||||
/// 删除新物料
|
||||
/// </summary>
|
||||
/// <param name="ID"></param>
|
||||
//static public void WorkPositionGuidOnLine_NewMaterial_Delete(int ID)
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "DELETE FROM MES_计划BOM_订单计划下达 WHERE ID=" + Convert.ToString(ID);
|
||||
|
||||
// DataAccess.ExecuteSQL_OleDb_Access(sql);
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// 物料验证
|
||||
/// 添加新物料
|
||||
/// </summary>
|
||||
/// <param name="dt"></param>
|
||||
//static public bool WorkPositionGuidOnLine_NewMaterial_Insert(DataTable dt)
|
||||
//{
|
||||
// string sql;
|
||||
// sql =
|
||||
// "INSERT INTO [MES_计划BOM_订单计划下达]" +
|
||||
// "([订单号], [SAP物料号], [发动机型号], [发动机型号代码], [发动机机型]," +
|
||||
// "[发动机数量], [厂牌编号起始号], [客户名称], [投料日期], [文件编号], [集团名称], [通知号], " +
|
||||
// "[功率], [指南文件编号], [装机状态], [适用状态], [物料描述],[计划下达日期], [计划完工日期],[实际完成日期],[实际结束日期],[操作时间], " +
|
||||
// "[主配厂家],[工位号], [工位名称], [物料号], [零件图号], [零件名称], [零件数量],[是否扫描],[扫描方式],[厂家代码], [生产厂家], " +
|
||||
// "[操作指导],[工位基本操作指导],[工位基本指导图片],[日计划产量], [工位操作指导],[工位指导图片],[物料来源代码],[是否禁用代码],[被强制验证物料号],更改代码,更改原因)" +
|
||||
// "VALUES(@订单号,@SAP物料号,@发动机型号,@发动机型号代码,@发动机机型," +
|
||||
// "@发动机数量,@厂牌编号起始号,@客户名称,@投料日期,@文件编号,@集团名称,@通知号," +
|
||||
// "@功率,@指南文件编号,@装机状态,@适用状态,@物料描述,@计划下达日期,@计划完工日期,@实际完成日期,@实际结束日期,@操作时间," +
|
||||
// "@主配厂家,@工位号,@工位名称,@物料号,@零件图号,@零件名称,@零件数量,@是否扫描,@扫描方式,@厂家代码,@生产厂家," +
|
||||
// "@操作指导,@工位基本操作指导,@工位基本指导图片,@日计划产量,@工位操作指导,@工位指导图片,@物料来源代码,@是否禁用代码,@被强制验证物料号,@更改代码,@更改原因)";
|
||||
// OleDbParameter[] thisParms = new OleDbParameter[44];
|
||||
// thisParms[0] = new OleDbParameter("@订单号", OleDbType.VarChar, 50, "订单号");
|
||||
// thisParms[1] = new OleDbParameter("@SAP物料号", OleDbType.VarChar, 50, "SAP物料号");
|
||||
// thisParms[2] = new OleDbParameter("@发动机型号", OleDbType.VarChar, 50, "发动机型号");
|
||||
// thisParms[3] = new OleDbParameter("@发动机型号代码", OleDbType.Integer, 4, "发动机型号代码");
|
||||
// thisParms[4] = new OleDbParameter("@发动机机型", OleDbType.VarChar, 50, "发动机机型");
|
||||
|
||||
// thisParms[5] = new OleDbParameter("@发动机数量", OleDbType.Integer, 4, "发动机数量");
|
||||
// thisParms[6] = new OleDbParameter("@厂牌编号起始号", OleDbType.Integer, 4, "厂牌编号起始号");
|
||||
// thisParms[7] = new OleDbParameter("@客户名称", OleDbType.VarChar, 255, "客户名称");
|
||||
// thisParms[8] = new OleDbParameter("@投料日期", OleDbType.DBDate, 8, "投料日期");
|
||||
// thisParms[9] = new OleDbParameter("@文件编号", OleDbType.VarChar, 50, "文件编号");
|
||||
// thisParms[10] = new OleDbParameter("@集团名称", OleDbType.VarChar, 255, "集团名称");
|
||||
// thisParms[11] = new OleDbParameter("@通知号", OleDbType.VarChar, 50, "通知号");
|
||||
|
||||
// thisParms[12] = new OleDbParameter("@功率", OleDbType.VarChar, 50, "功率");
|
||||
// thisParms[13] = new OleDbParameter("@指南文件编号", OleDbType.VarChar, 50, "指南文件编号");
|
||||
// thisParms[14] = new OleDbParameter("@装机状态", OleDbType.VarChar, 50, "装机状态");
|
||||
// thisParms[15] = new OleDbParameter("@适用状态", OleDbType.VarChar, 50, "适用状态");
|
||||
// thisParms[16] = new OleDbParameter("@物料描述", OleDbType.VarChar, 255, "物料描述");
|
||||
// thisParms[17] = new OleDbParameter("@计划下达日期", OleDbType.DBDate, 8, "计划下达日期");
|
||||
// thisParms[18] = new OleDbParameter("@计划完工日期", OleDbType.DBDate, 8, "计划完工日期");
|
||||
// thisParms[19] = new OleDbParameter("@实际完成日期", OleDbType.DBDate, 8, "实际完成日期");
|
||||
// thisParms[20] = new OleDbParameter("@实际结束日期", OleDbType.DBDate, 8, "实际结束日期");
|
||||
// thisParms[21] = new OleDbParameter("@操作时间", OleDbType.DBDate, 8, "操作时间");
|
||||
|
||||
// thisParms[22] = new OleDbParameter("@主配厂家", OleDbType.VarChar, 50, "主配厂家");
|
||||
// thisParms[23] = new OleDbParameter("@工位号", OleDbType.VarChar, 50, "工位号");
|
||||
// thisParms[24] = new OleDbParameter("@工位名称", OleDbType.VarChar, 255, "工位名称");
|
||||
// thisParms[25] = new OleDbParameter("@物料号", OleDbType.VarChar, 50, "物料号");
|
||||
// thisParms[26] = new OleDbParameter("@零件图号", OleDbType.VarChar, 50, "零件图号");
|
||||
// thisParms[27] = new OleDbParameter("@零件名称", OleDbType.VarChar, 255, "零件名称");
|
||||
// thisParms[28] = new OleDbParameter("@零件数量", OleDbType.Integer, 4, "零件数量");
|
||||
// thisParms[29] = new OleDbParameter("@是否扫描", OleDbType.Integer, 4, "是否扫描");
|
||||
// thisParms[30] = new OleDbParameter("@扫描方式", OleDbType.Integer, 4, "扫描方式");
|
||||
// thisParms[31] = new OleDbParameter("@厂家代码", OleDbType.VarChar, 255, "厂家代码");
|
||||
// thisParms[32] = new OleDbParameter("@生产厂家", OleDbType.VarChar, 255, "生产厂家");
|
||||
|
||||
|
||||
// thisParms[33] = new OleDbParameter("@操作指导", OleDbType.VarChar, 255, "操作指导");
|
||||
// thisParms[34] = new OleDbParameter("@工位基本操作指导", OleDbType.VarChar, 255, "工位基本操作指导");
|
||||
// thisParms[35] = new OleDbParameter("@工位基本指导图片", OleDbType.VarBinary, 10000000, "工位基本指导图片");
|
||||
// thisParms[36] = new OleDbParameter("@日计划产量", OleDbType.Integer, 4, "日计划产量");
|
||||
// thisParms[37] = new OleDbParameter("@工位操作指导", OleDbType.VarChar, 255, "工位操作指导");
|
||||
// thisParms[38] = new OleDbParameter("@工位指导图片", OleDbType.VarBinary, 10000000, "工位指导图片");
|
||||
|
||||
// thisParms[39] = new OleDbParameter("@物料来源代码", OleDbType.Integer, 4, "物料来源代码");
|
||||
// thisParms[40] = new OleDbParameter("@是否禁用代码", OleDbType.Integer, 4, "是否禁用代码");
|
||||
// thisParms[41] = new OleDbParameter("@被强制验证物料号", OleDbType.VarChar, 255, "被强制验证物料号");
|
||||
// thisParms[42] = new OleDbParameter("@更改代码", OleDbType.VarChar, 255, "更改代码");
|
||||
// thisParms[43] = new OleDbParameter("@更改原因", OleDbType.VarChar, 255, "更改原因");
|
||||
|
||||
// return DataAccess.ExecuteDataTable_OleDb_Insert_Access(sql, dt, ref thisParms);
|
||||
//}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
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放行
|
||||
/// 装配工作无法正常进行,MES填写放行原因,向PLC发送此信号,请求放行,plc接收此信号后才能安不合格流程放行
|
||||
/// DBX2.6
|
||||
/// 34
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
//public static DataTable BaseData_tagTable_MesOverGo(string opName)
|
||||
//{
|
||||
// DataTable dt;
|
||||
// string sql;
|
||||
// sql = "SELECT TagID,0 as TagValue,TagName,工位号,数据来源,TagTypeID,TagLong,列位置,测量位置,变量类型代码,测量项目,TagAdr,TagAdrDemo FROM [MES_基本变量_原始数据] "
|
||||
// + " where 变量类型代码 = 34 and 是否启用 = 1 "
|
||||
// + " and 工位号='" + opName + "'";
|
||||
// DataAccess.ExecuteDataTable_OleDb_Access(sql, out dt);
|
||||
// return dt;
|
||||
//}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
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>
|
||||
/// 查询MesServerCode
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static DataTable GetMesServerCodeFromMIS()
|
||||
{
|
||||
DataTable dt;
|
||||
string sql;
|
||||
sql = "exec MES_计划BOM_工位与名称_查询应用程序";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
return dt;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询工步属性
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static DataTable GetworkStepPropertyFromMIS()
|
||||
{
|
||||
DataTable dt;
|
||||
string sql;
|
||||
sql = "SELECT distinct 工位号,工步属性 FROM [MES_计划BOM_工位与名称] where 是否监控=1";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
return dt;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询返修工位号
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static DataTable GetOpNameRepairFromMIS()
|
||||
{
|
||||
DataTable dt;
|
||||
string sql;
|
||||
sql = "SELECT distinct 工位号,返修工位号 FROM [MES_计划BOM_工位与名称] where 是否监控=1";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
return dt;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
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>
|
||||
/// [MES_计划BOM_发动机号]
|
||||
/// SET 是否装配代码=1
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
//public static bool BaseData_tagTable_EngineID_UpDate(string EngineID)
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "UPDATE MES_计划BOM_发动机号 "
|
||||
// + "SET 是否装配代码=1"
|
||||
// + " ,装配日期=CDATE('" + DateTime.Now.ToString("G")
|
||||
// + "') "
|
||||
// + " WHERE 发动机号='" + EngineID + "'";
|
||||
// return DataAccess.ExecuteSQL_OleDb_Access(sql);
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// [MES_装配数据_工件到位离开时间_保留本地]
|
||||
/// 计算当前日期装配的发动机数量
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
//public static int BaseData_tagTable_EngineID_Count()
|
||||
//{
|
||||
// int count;
|
||||
// string sql;
|
||||
// sql = "SELECT COUNT(*) FROM [MES_装配数据_工件到位离开时间_保留本地] "
|
||||
// + "WHERE 计数日期=CDATE('" + DateTime.Now.ToString("d") + "')"
|
||||
// + " AND 是否合格 = 1";
|
||||
// DataAccess.ExecuteOutNum_OleDb_Access(sql, out count);
|
||||
// return count;
|
||||
//}
|
||||
|
||||
|
||||
//static public void ProduceCountInsert()
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "INSERT INTO MES_装配数据_实际产量(实际产量) VALUES(1)";
|
||||
// DataAccess.ExecuteSQL_OleDb_Access(sql);
|
||||
//}
|
||||
//static public void ProduceCountDelete()
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "DELETE FROM MES_装配数据_实际产量 WHERE 生产日期<>CDATE('" + DateTime.Now.ToString("d") + "')";
|
||||
// DataAccess.ExecuteSQL_OleDb_Access(sql);
|
||||
//}
|
||||
//static public void ProduceCountSelect(out DataTable dt)
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "SELECT * FROM MES_装配数据_实际产量 WHERE 生产日期=CDATE('" + DateTime.Now.ToString("d") + "')";
|
||||
// DataAccess.ExecuteDataTable_OleDb_Access(sql, out dt);
|
||||
//}
|
||||
//static public void ProduceCountUpdate(int count)
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "UPDATE MES_装配数据_实际产量 "
|
||||
// + " SET 实际产量=" + count.ToString()
|
||||
// + " WHERE 生产日期=CDATE('" + DateTime.Now.ToString("d") + "')";
|
||||
// DataAccess.ExecuteSQL_OleDb_Access(sql);
|
||||
//}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
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
|
||||
{
|
||||
/// <summary>
|
||||
/// 关键零部件追溯
|
||||
/// </summary>
|
||||
public partial class BaseDataSystemMES
|
||||
{
|
||||
/// <summary>
|
||||
/// SELECT * FROM MES_计划BOM_工位与名称
|
||||
/// </summary>
|
||||
/// <param name="dt"></param>
|
||||
//static public void GetOpNameDataForMIS(out DataTable dt)
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "SELECT * FROM MES_计划BOM_工位与名称 ";
|
||||
// DataAccess.ExecuteDataTable_OleDb_Access(sql, out dt);
|
||||
//}
|
||||
/// <summary>
|
||||
/// 根据工位获得分线可以保存“物料追踪”的工位
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="dt"></param>
|
||||
//static public void SubLineOpName(string opName,out DataTable dt)
|
||||
//{
|
||||
// string lineName;
|
||||
// dt = null;
|
||||
// string sql;
|
||||
// sql = "SELECT 线体类型 FROM MES_计划BOM_工位与名称 "
|
||||
// + "WHERE 工位号 = '" + opName+"'";
|
||||
// DataAccess.ExecuteDataTable_OleDb_Access(sql, out dt);
|
||||
// if (dt != null)
|
||||
// {
|
||||
// if (dt.Rows.Count > 0)
|
||||
// {
|
||||
// lineName = dt.Rows[0]["线体类型"].ToString();
|
||||
// sql = "SELECT DISTINCT 文件名称 FROM FROM MES_计划BOM_工位与名称 "
|
||||
// + "WHERE 线体类型 = '" + lineName + "'"
|
||||
// +" AND PC =1 ";
|
||||
// DataAccess.ExecuteDataTable_OleDb_Access(sql, out dt);
|
||||
// }
|
||||
// }
|
||||
|
||||
//}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
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>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
//public static bool GetWorkSheet(out DataTable dt)
|
||||
//{
|
||||
// //string errorMessage;
|
||||
// string sql;
|
||||
// sql = "SELECT * FROM [MES_操作着_生产班次] ";
|
||||
// return DataAccess.ExecuteDataTable_OleDb_Access(sql, out dt);
|
||||
|
||||
//}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="operatorCode"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
//public static bool GetOperatorCode(string operatorCode,out DataTable dt)
|
||||
//{
|
||||
// //string errorMessage;
|
||||
// string sql;
|
||||
// sql = "SELECT * FROM [MES_操作者_用户] "
|
||||
// + " WHERE 操作者工号='" + operatorCode+"'";
|
||||
// return DataAccess.ExecuteDataTable_OleDb_Access(sql, out dt);
|
||||
|
||||
//}
|
||||
/// <summary>
|
||||
/// 是否是:操作者工号
|
||||
/// </summary>
|
||||
/// <param name="operatorCode"></param>
|
||||
/// <returns></returns>
|
||||
//public static bool GetOperatorCode(string operatorCode)
|
||||
//{
|
||||
// //string errorMessage;
|
||||
// DataTable dt;
|
||||
// string sql;
|
||||
|
||||
|
||||
// sql = "SELECT * FROM [MES_操作者_用户] "
|
||||
// + " WHERE 操作者工号='" + operatorCode + "'";
|
||||
|
||||
// if (DataAccess.ExecuteDataTable_OleDb_Access(sql, out dt))
|
||||
// {
|
||||
// if (dt.Rows.Count > 0)
|
||||
// {
|
||||
// return true;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// return false;
|
||||
// }
|
||||
//}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,224 @@
|
||||
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>
|
||||
/// <param name="positionID"></param>
|
||||
/// <returns></returns>
|
||||
public static string GetAllWorkPositionNameForMIS(string positionID)
|
||||
{
|
||||
string positionIDName = "";
|
||||
string errorMessage;
|
||||
DataTable dt;
|
||||
string sql;
|
||||
sql = "SELECT top 1 工位名称 FROM MES_计划BOM_工位与名称 "
|
||||
+ "where 工位号='" + positionID + "'";
|
||||
//if (!SQLCommon.SqlServerConnectionStatus)
|
||||
//{
|
||||
// SQLCommon.ExecuteDataTable_OleDb(sql, ApplicationConfig.ConnectionString_Access, out dt, out errorMessage);
|
||||
//}
|
||||
//else
|
||||
{
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
}
|
||||
if (dt == null) return positionIDName;
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
positionIDName = dt.Rows[0]["工位名称"].ToString();
|
||||
}
|
||||
return positionIDName;
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据工位号获得工位名称
|
||||
/// </summary>
|
||||
/// <param name="positionID"></param>
|
||||
/// <returns></returns>
|
||||
public static string GetWorkPositionNameByWorkPositionID(string positionID)
|
||||
{
|
||||
string positionIDName = "";
|
||||
string errorMessage;
|
||||
DataTable dt;
|
||||
string sql;
|
||||
sql = "SELECT top 1 工位名称 FROM MES_计划BOM_工位与名称 "
|
||||
+ "where 工位号='" + positionID + "'";
|
||||
//if (!SQLCommon.SqlServerConnectionStatus)
|
||||
//{
|
||||
// SQLCommon.ExecuteDataTable_OleDb(sql, ApplicationConfig.ConnectionString_Access, out dt, out errorMessage);
|
||||
//}
|
||||
//else
|
||||
{
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
}
|
||||
if (dt == null) return positionIDName;
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
positionIDName = dt.Rows[0]["工位名称"].ToString();
|
||||
}
|
||||
return positionIDName;
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据订单号获得订单信息
|
||||
/// </summary>
|
||||
/// <param name="OrderForm">订单号</param>
|
||||
/// <returns></returns>
|
||||
//public static DataTable GetOrderFormPlanByOrderForm(string OrderForm)
|
||||
//{
|
||||
// string errorMessage;
|
||||
// DataTable dt;
|
||||
// string sql;
|
||||
// sql = "SELECT TOP 1 * FROM [MES_计划BOM_订单计划下达] "
|
||||
// + "where 订单号='" + OrderForm + "'";
|
||||
// SQLCommon.ExecuteDataTable_OleDb(sql, ApplicationConfig.ConnectionString_Access, out dt, out errorMessage);
|
||||
// MaterialData.dt_OrderFormPlan = dt;
|
||||
// return dt;
|
||||
//}
|
||||
/// <summary>
|
||||
/// 根据订单号获得工位基本操作指导信息
|
||||
/// </summary>
|
||||
/// <param name="OpName">工位号</param>
|
||||
/// <param name="OrderForm">订单号</param>
|
||||
/// <returns></returns>
|
||||
//public static DataTable GetWorkPositionGuidByOrderForm(string OrderForm,string OpName)
|
||||
//{
|
||||
// string errorMessage;
|
||||
// DataTable dt;
|
||||
// string sql;
|
||||
// sql = "SELECT TOP 1 工位操作指导,工位指导图片 FROM [MES_计划BOM_订单计划下达] "
|
||||
// + "where 工位号='" + OpName + "'"
|
||||
// + " and 订单号='" + OrderForm + "'"
|
||||
// + " order by 导入时间 desc ";
|
||||
// SQLCommon.ExecuteDataTable_OleDb(sql, ApplicationConfig.ConnectionString_Access, out dt, out errorMessage);
|
||||
|
||||
// return dt;
|
||||
//}
|
||||
/// <summary>
|
||||
/// 根据发动机号获得装配指南信息
|
||||
/// </summary>
|
||||
/// <param name="orderForm"></param>
|
||||
/// <param name="OpName"></param>
|
||||
/// <returns></returns>
|
||||
//public static DataTable GetAssemblyListByEngineNumber(string orderForm, string OpName)
|
||||
//{
|
||||
// string errorMessage;
|
||||
// DataTable dt;
|
||||
// string sql;
|
||||
// //sql = "SELECT * "
|
||||
// sql = "SELECT [ID],[订单号], [SAP物料号], [发动机型号], [发动机型号代码], [发动机机型]," +
|
||||
// "[发动机数量], [厂牌编号起始号], [客户名称], [投料日期], [文件编号], [集团名称], [通知号], " +
|
||||
// "[功率], [指南文件编号], [装机状态], [适用状态], [物料描述],[计划下达日期], [计划完工日期]," +
|
||||
// "[主配厂家],[工位号], [工位名称], [物料号], [零件图号], [零件名称], [零件数量],[是否扫描],d.扫描方式代码,d.扫描方式,[厂家代码], [生产厂家], " +
|
||||
// "[操作指导],'' as 发动机号,0 as 物料号表索引号,0 as 零件数量验证,"
|
||||
// + "'' as 物料条码,'' as 物料条码物料号,'' as 物料条码批次,0 as 验证结果,"
|
||||
// + "'' as 操作者工号,'' as 操作者姓名,'' as 班次代码,"
|
||||
// + "b.物料来源代码, b.物料来源, a.是否禁用代码, a.是否禁用,被强制验证物料号,更改代码,更改原因 "
|
||||
// + " FROM MES_计划BOM_订单计划下达_扫描方式 AS d INNER JOIN (MES_计划BOM_订单计划下达_是否禁用 AS a INNER JOIN (MES_计划BOM_订单计划下达_物料来源 AS b INNER JOIN MES_计划BOM_订单计划下达 AS c ON b.物料来源代码 = c.物料来源代码) ON a.是否禁用代码 = c.是否禁用代码) ON c.扫描方式=d.扫描方式代码 "
|
||||
// + "where 订单号='" + orderForm + "'"
|
||||
// + "and 工位号='" + OpName + "' and a.是否禁用代码 = 0 "
|
||||
// + " ORDER BY 物料号 ";
|
||||
// SQLCommon.ExecuteDataTable_OleDb(sql, ApplicationConfig.ConnectionString_Access, out dt, out errorMessage);
|
||||
// return dt;
|
||||
//}
|
||||
/// <summary>
|
||||
/// 根据发动机号获得装配指南信息
|
||||
/// </summary>
|
||||
/// <param name="orderForm"></param>
|
||||
/// <param name="OpName"></param>
|
||||
/// <returns></returns>
|
||||
//public static DataTable GetAssemblyListForVerifyByEngineNumber(string orderForm, string OpName)
|
||||
//{
|
||||
// string errorMessage;
|
||||
// DataTable dt;
|
||||
// string sql;
|
||||
// sql = "SELECT [ID], [订单号], [SAP物料号], [发动机型号], [发动机型号代码], [发动机机型]," +
|
||||
// "[发动机数量], [厂牌编号起始号], [客户名称], [投料日期], [文件编号], [集团名称], [通知号], " +
|
||||
// "[功率], [指南文件编号], [装机状态], [适用状态], [物料描述],[计划下达日期], [计划完工日期]," +
|
||||
// "[主配厂家],[工位号], [工位名称], [物料号], [零件图号], [零件名称], [零件数量],[是否扫描],d.扫描方式代码,d.扫描方式,[厂家代码], [生产厂家], " +
|
||||
// "[操作指导],'' as 发动机号,'' as 追踪代码,0 as 物料号表索引号,0 as 零件数量验证,"
|
||||
// + "'' as 物料条码,'' as 物料条码物料号,'' as 物料条码批次,0 as 验证结果,"
|
||||
// + "'' as 操作者工号,'' as 操作者姓名,'' as 班次代码,"
|
||||
// + "b.物料来源代码, b.物料来源, a.是否禁用代码, a.是否禁用,被强制验证物料号,更改代码,更改原因 "
|
||||
// + " FROM MES_计划BOM_订单计划下达_扫描方式 AS d INNER JOIN (MES_计划BOM_订单计划下达_是否禁用 AS a INNER JOIN (MES_计划BOM_订单计划下达_物料来源 AS b INNER JOIN MES_计划BOM_订单计划下达 AS c ON b.物料来源代码 = c.物料来源代码) ON a.是否禁用代码 = c.是否禁用代码) ON c.扫描方式=d.扫描方式代码 "
|
||||
// + "where 订单号='" + orderForm + "'"
|
||||
// + "and 工位号='" + OpName + "' and a.是否禁用代码 = 0 and 是否扫描 = 1 "
|
||||
// + " ORDER BY 物料号 ";
|
||||
// SQLCommon.ExecuteDataTable_OleDb(sql, ApplicationConfig.ConnectionString_Access, out dt, out errorMessage);
|
||||
// return dt;
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// 根据发动机号获得装配指南信息
|
||||
/// </summary>
|
||||
/// <param name="orderForm"></param>
|
||||
/// <param name="OpName"></param>
|
||||
/// <returns></returns>
|
||||
//public static DataTable GetAssemblyListForVerifyByEngineNumber_F3(string orderForm, string OpName)
|
||||
//{
|
||||
// string errorMessage;
|
||||
// DataTable dt;
|
||||
// string sql;
|
||||
// sql = "SELECT [ID], [订单号], [SAP物料号], [发动机型号], [发动机型号代码], [发动机机型]," +
|
||||
// "[发动机数量], [厂牌编号起始号], [客户名称], [投料日期], [文件编号], [集团名称], [通知号], " +
|
||||
// "[功率], [指南文件编号], [装机状态], [适用状态], [物料描述],[计划下达日期], [计划完工日期]," +
|
||||
// "[主配厂家],[工位号], [工位名称], [物料号], [零件图号], [零件名称], [零件数量],[是否扫描],d.扫描方式代码,d.扫描方式,[厂家代码], [生产厂家], " +
|
||||
// "[操作指导],'' as 发动机号,'' as 追踪代码,0 as 物料号表索引号,0 as 零件数量验证,"
|
||||
// + "'' as 物料条码,'' as 物料条码物料号,'' as 物料条码批次,0 as 验证结果,"
|
||||
// + "'' as 操作者工号,'' as 操作者姓名,'' as 班次代码,"
|
||||
// + "b.物料来源代码, b.物料来源, a.是否禁用代码, a.是否禁用,被强制验证物料号,更改代码,更改原因 "
|
||||
// + " FROM MES_计划BOM_订单计划下达_扫描方式 AS d INNER JOIN (MES_计划BOM_订单计划下达_是否禁用 AS a INNER JOIN (MES_计划BOM_订单计划下达_物料来源 AS b INNER JOIN MES_计划BOM_订单计划下达 AS c ON b.物料来源代码 = c.物料来源代码) ON a.是否禁用代码 = c.是否禁用代码) ON c.扫描方式=d.扫描方式代码 "
|
||||
// + "where 订单号='" + orderForm + "'"
|
||||
// + "and 工位号='" + OpName + "' and a.是否禁用代码 = 0 and 是否扫描 = 2 "//活塞连杆
|
||||
// + " ORDER BY 物料号 ";
|
||||
// SQLCommon.ExecuteDataTable_OleDb(sql, ApplicationConfig.ConnectionString_Access, out dt, out errorMessage);
|
||||
// return dt;
|
||||
//}
|
||||
///// <summary>
|
||||
///// =1 与Access数据库连接 =0 与SQL Server 连接
|
||||
///// </summary>
|
||||
//static int OpcServerIsAccess = 1;
|
||||
/// <summary>
|
||||
/// 从计划中获得发动机信息
|
||||
/// </summary>
|
||||
//public static DataTable PruducePlanGetEngineNumber()
|
||||
//{
|
||||
// string errorMessage;
|
||||
// DataTable dt;
|
||||
// string sql;
|
||||
// sql = "SELECT top 1 * FROM [MES_计划BOM_发动机号] order by 投料日期,发动机号";
|
||||
// SQLCommon.ExecuteDataTable_OleDb(sql, ApplicationConfig.ConnectionString_Access, out dt, out errorMessage);
|
||||
// MaterialData.dt_EngineNumber = dt;
|
||||
|
||||
// return dt;
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// 工位基本指导图片
|
||||
/// </summary>
|
||||
/// <param name="OpName">工位号</param>
|
||||
/// <returns></returns>
|
||||
public static DataTable GetWorkPositionBasicGuidPictureByOpName(string OpName)
|
||||
{
|
||||
//string errorMessage;
|
||||
DataTable dt;
|
||||
string sql;
|
||||
sql = "SELECT TOP 1 工位基本指导图片 FROM [MES_计划BOM_工位基本指导] "
|
||||
+ "where 工位号='" + OpName + "'";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
//BizDataAccess.DataAccess.ExecuteDataTable_OleDb_Access(sql, out dt);
|
||||
|
||||
return dt;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
196
Common/07WebBusinessFacade/BusinessFacade/MES/MES.Biz.Config.cs
Normal file
196
Common/07WebBusinessFacade/BusinessFacade/MES/MES.Biz.Config.cs
Normal file
@@ -0,0 +1,196 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using DataLinkMesWork;
|
||||
using System.Data.OleDb;
|
||||
using System.Collections;
|
||||
|
||||
//using SystemFramework;
|
||||
|
||||
namespace bizFacade
|
||||
{
|
||||
public partial class BaseDataSystemMES
|
||||
{
|
||||
///// <summary>
|
||||
///// 从Access配置表中读取程序配置信息
|
||||
///// </summary>
|
||||
///// <param name="opName"></param>
|
||||
//public static void InitConfig(string opName)
|
||||
//{
|
||||
|
||||
// DataTable dt;
|
||||
// string sql;
|
||||
// sql = " SELECT * FROM MES_计划BOM_工位与名称 WHERE 工位号='" + opName + "'";
|
||||
// DataAccess.ExecuteDataTable_OleDb_Access(sql, out dt);
|
||||
// if (dt == null) return;
|
||||
// if (dt.Rows.Count < 1) return;
|
||||
// try
|
||||
// {
|
||||
// //0032
|
||||
// ApplicationConfig.ConnectionString_Access_OpNameMainLine = dt.Rows[0]["总线上线工位数据文件连接"].ToString();
|
||||
// }
|
||||
// catch { ApplicationConfig.ConnectionString_Access_OpNameMainLine = ""; }
|
||||
// try
|
||||
// {
|
||||
// //0033
|
||||
// ApplicationConfig.ConnectionString_Access_OpNameTraceCode = dt.Rows[0]["分线物料追踪工位数据文件连接"].ToString();
|
||||
// }
|
||||
// catch { ApplicationConfig.ConnectionString_Access_OpNameTraceCode = ""; }
|
||||
// try
|
||||
// {
|
||||
// ApplicationConfig.OpNameGuid = dt.Rows[0]["指南工位号"].ToString();
|
||||
// }
|
||||
// catch { ApplicationConfig.OpNameGuid = ""; }
|
||||
// //try
|
||||
// //{
|
||||
// // //0051
|
||||
// // ApplicationConfig.OpNameOther = dt.Rows[0]["总线被监测工位"].ToString();
|
||||
// //}
|
||||
// //catch { ApplicationConfig.OpNameOther = ""; }
|
||||
// try
|
||||
// {
|
||||
// //0052
|
||||
// ApplicationConfig.OpNameMainLine = dt.Rows[0]["总线上线工位"].ToString();
|
||||
// }
|
||||
// catch { ApplicationConfig.OpNameMainLine = ""; }
|
||||
// try
|
||||
// {
|
||||
// //0053
|
||||
// ApplicationConfig.OpNameTraceCode = dt.Rows[0]["分线物料追踪工位"].ToString();
|
||||
// }
|
||||
// catch { ApplicationConfig.OpNameTraceCode = ""; }
|
||||
// //try
|
||||
// //{
|
||||
// // //0080
|
||||
// // ApplicationConfig.ScannerType = dt.Rows[0]["扫描枪类型"].ToString();
|
||||
// //}
|
||||
// //catch { ApplicationConfig.ScannerType = "0"; }
|
||||
// try
|
||||
// {
|
||||
// //0081
|
||||
// ApplicationConfig.MachineType = dt.Rows[0]["机床类型"].ToString();
|
||||
// }
|
||||
// catch { ApplicationConfig.MachineType = "S"; }
|
||||
// try
|
||||
// {
|
||||
// //0090
|
||||
// ApplicationConfig.OpType = dt.Rows[0]["工位类型"].ToString();
|
||||
// }
|
||||
// catch { ApplicationConfig.OpType = "P1"; }
|
||||
// try
|
||||
// {
|
||||
// //0170
|
||||
// ApplicationConfig.OpcServer = dt.Rows[0]["OpcServer"].ToString().Trim();
|
||||
// }
|
||||
// catch { ApplicationConfig.OpcServer = ""; }
|
||||
// try
|
||||
// {
|
||||
// //0170
|
||||
// ApplicationConfig.OpcServer_MIS = dt.Rows[0]["OpcServer_MIS"].ToString().Trim();
|
||||
// }
|
||||
// catch { ApplicationConfig.OpcServer_MIS = ""; }
|
||||
// try
|
||||
// {
|
||||
// //0170
|
||||
// ApplicationConfig.CycleTargetCycleTime = Convert.ToInt32(dt.Rows[0]["目标循环时间"]);
|
||||
// }
|
||||
// catch { ApplicationConfig.CycleTargetCycleTime = 0; }
|
||||
// try
|
||||
// {
|
||||
// //0190
|
||||
// ApplicationConfig.PartType = dt.Rows[0]["工件类型"].ToString();
|
||||
// }
|
||||
// catch { ApplicationConfig.PartType = ""; }
|
||||
// try
|
||||
// {
|
||||
// //0190
|
||||
// ApplicationConfig.Password = dt.Rows[0]["退出密码"].ToString();
|
||||
// }
|
||||
// catch { ApplicationConfig.Password = ""; }
|
||||
|
||||
// try
|
||||
// {
|
||||
// //0190
|
||||
// ApplicationConfig.LeaderCode = dt.Rows[0]["领班工号"].ToString();
|
||||
// }
|
||||
// catch { ApplicationConfig.LeaderCode = ""; }
|
||||
|
||||
// if (ApplicationConfig.OpType == "F102")
|
||||
// {
|
||||
// sql = " SELECT * FROM MES_计划BOM_工位与名称 WHERE 工位号='" + ApplicationConfig.OpNameOther + "'";
|
||||
// DataAccess.ExecuteDataTable_OleDb_Access(sql, out dt);
|
||||
// if (dt != null)
|
||||
// {
|
||||
// if (dt.Rows.Count > 0)
|
||||
// {
|
||||
// try
|
||||
// {
|
||||
// ApplicationConfig.OpcServerOther = dt.Rows[0]["OpcServer"].ToString();
|
||||
// }
|
||||
// catch { }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
//private static void GetBarCodeCommand(out DataTable dt)
|
||||
//{
|
||||
// string sql = " SELECT * FROM [MES_基本数据_条码命令] ";
|
||||
// DataAccess.ExecuteDataTable_OleDb_Access(sql, out dt);
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="dt"></param>
|
||||
//public static void GetBarCodeCommand_RepareReason(out DataTable dt)
|
||||
//{
|
||||
// string sql = " SELECT * FROM [MES_基本数据_条码命令] WHERE 命令说明='返修原因'";
|
||||
// DataAccess.ExecuteDataTable_OleDb_Access(sql, out dt);
|
||||
//}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static Hashtable Get_hashtableBarCodeCommand()
|
||||
{
|
||||
DataTable dt = new DataTable();
|
||||
Hashtable hashtableBarCodeCommand;
|
||||
hashtableBarCodeCommand = new Hashtable();
|
||||
//GetBarCodeCommand(out dt);
|
||||
for (int i = 0; i < dt.Rows.Count; i++)
|
||||
{
|
||||
hashtableBarCodeCommand.Add(dt.Rows[i]["命令条码"], dt.Rows[i]["命令代码"]);
|
||||
|
||||
}
|
||||
|
||||
return hashtableBarCodeCommand;
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static Hashtable Get_hashtableBarCodeCommand_RepareReason()
|
||||
{
|
||||
DataTable dt = new DataTable ();
|
||||
Hashtable hashtableBarCodeCommand;
|
||||
hashtableBarCodeCommand = new Hashtable();
|
||||
//GetBarCodeCommand(out dt);
|
||||
for (int i = 0; i < dt.Rows.Count; i++)
|
||||
{
|
||||
hashtableBarCodeCommand.Add(dt.Rows[i]["命令代码"], dt.Rows[i]["命令功能"]);
|
||||
|
||||
}
|
||||
|
||||
return hashtableBarCodeCommand;
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,298 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Data.OleDb;
|
||||
using DataLinkMesWork;
|
||||
using System.Collections;
|
||||
|
||||
//using SystemFramework;
|
||||
|
||||
namespace bizFacade
|
||||
{
|
||||
public partial class BaseDataSystemMES
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// [MES_基本变量_厂家代码]
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
//public static Hashtable GetFatoryCodeHashtable()
|
||||
//{
|
||||
// //厂家代码
|
||||
// string fatoryCode;
|
||||
// //三位码
|
||||
// string threeCode;
|
||||
// Hashtable fatoryCodeHashtable;
|
||||
// fatoryCodeHashtable = new Hashtable ();
|
||||
// DataTable dt;
|
||||
// string sql;
|
||||
// sql = "SELECT * FROM MES_基本变量_厂家代码 ";
|
||||
// DataAccess.ExecuteDataTable_OleDb_Access(sql, out dt);
|
||||
// for (int i = 0; i < dt.Rows.Count; i++)
|
||||
// {
|
||||
|
||||
// if (Convert.IsDBNull(dt.Rows[i]["厂家代码"]))
|
||||
// {
|
||||
// fatoryCode = "";
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// fatoryCode = dt.Rows[i]["厂家代码"].ToString();
|
||||
// }
|
||||
|
||||
// if (Convert.IsDBNull(dt.Rows[i]["三位码"]))
|
||||
// {
|
||||
// threeCode = "";
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// threeCode = dt.Rows[i]["三位码"].ToString();
|
||||
// }
|
||||
|
||||
// fatoryCodeHashtable.Add(fatoryCode, threeCode);
|
||||
|
||||
// }
|
||||
// return fatoryCodeHashtable;
|
||||
//}
|
||||
/// <summary>
|
||||
/// 根据订单号和工位获得主物料号
|
||||
/// [MES_计划BOM_发动机装配指南]
|
||||
/// </summary>
|
||||
/// <param name="orderForm">订单号</param>
|
||||
/// <param name="OpName">工位号</param>
|
||||
/// <returns></returns>
|
||||
public static string GetMainMaterialCode(string orderForm, string OpName)
|
||||
{
|
||||
string mainMaterialNumber="";
|
||||
DataTable dt;
|
||||
string sql;
|
||||
sql = "SELECT * FROM MES_计划BOM_发动机装配指南 " +
|
||||
" WHERE 订单号 = '" + orderForm + "'" +
|
||||
" AND 工位号 = '" + OpName + "'" +
|
||||
" AND 是否主物料= 1";
|
||||
//if (!SQLCommon.SqlServerConnectionStatus)
|
||||
//{
|
||||
// DataAccess.ExecuteDataTable_OleDb_Access(sql, out dt);
|
||||
//}
|
||||
//else
|
||||
{
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
}
|
||||
if (dt == null)
|
||||
{
|
||||
mainMaterialNumber = "";
|
||||
}
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
mainMaterialNumber = dt.Rows[0]["物料号"].ToString().Trim();
|
||||
}
|
||||
return mainMaterialNumber;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据订单号和工位获得装配指南信息
|
||||
/// [MES_计划BOM_订单计划下达]
|
||||
/// 同步通讯,从SqlServer数据库获得
|
||||
/// 异步通讯,从Access数据库获得
|
||||
/// </summary>
|
||||
/// <param name="orderForm">订单号</param>
|
||||
/// <param name="OpName">工位号</param>
|
||||
/// <param name="isVerify">(true 是验证物料)(false 是全部物料)</param>
|
||||
/// <returns></returns>
|
||||
public static DataTable GetMaterialList(string orderForm, string OpName, bool isVerify)
|
||||
{
|
||||
string errorMessage;
|
||||
DataTable dt;
|
||||
string sql;
|
||||
if (isVerify)
|
||||
{
|
||||
sql = "SELECT [ID], [订单号], " +
|
||||
"[主配厂家],[工位号], [工位名称], [物料号], [零件图号], [零件名称], [零件数量],[是否扫描],d.扫描方式代码,d.扫描方式,[是否主物料],[厂家代码], [生产厂家], " +
|
||||
"[操作指导],'' as 发动机号,'' as 追踪代码,'' as 主物料号,0 as 物料号表索引号,0 as 零件数量验证,"
|
||||
+ "'' as 物料条码,'' as 物料条码物料号,'' as 物料条码批次,0 as 验证结果,"
|
||||
+ "'' as 操作者工号,'' as 操作者姓名,'' as 班次代码,"
|
||||
+ "b.物料来源代码, b.物料来源, a.是否禁用代码, a.是否禁用,被强制验证物料号,更改代码,更改原因 "
|
||||
+ " FROM MES_计划BOM_订单计划下达_扫描方式 AS d INNER JOIN (MES_计划BOM_订单计划下达_是否禁用 AS a INNER JOIN (MES_计划BOM_订单计划下达_物料来源 AS b INNER JOIN MES_计划BOM_发动机装配指南 AS c ON b.物料来源代码 = c.物料来源代码) ON a.是否禁用代码 = c.是否禁用代码) ON c.扫描方式=d.扫描方式代码 "
|
||||
+ "where 订单号='" + orderForm + "'"
|
||||
+ "and 工位号='" + OpName + "' and a.是否禁用代码 = 0 and 是否扫描 <> 0 "
|
||||
+ " ORDER BY 物料号 ";
|
||||
|
||||
sql = "SELECT [ID],[订单号],"
|
||||
+ "[主配厂家],[工位号], [工位名称], [物料号], [零件图号], [零件名称],[零件数量],"
|
||||
+ "[是否扫描],扫描方式 as 扫描方式代码,'' as 扫描方式,是否主物料,[厂家代码], [生产厂家], "
|
||||
+ "'' as 操作指导,'' as 发动机号,'' as 追踪代码,'' as 主物料号,0 as 物料号表索引号,0 as 零件数量验证,"
|
||||
+ "'' as 物料条码,'' as 物料条码物料号,'' as 物料条码批次,0 as 验证结果,'' as 操作者工号,'' as 操作者姓名,'' as 班次代码,"
|
||||
+ " 物料来源代码,'' as 物料来源,是否禁用代码,'' as 是否禁用, 被强制验证物料号,更改代码,更改原因"
|
||||
+ " from MES_计划BOM_发动机装配指南"
|
||||
+ " where 是否扫描 <> 0"
|
||||
+ " and 订单号='" + orderForm + "'"
|
||||
+"and 工位号='" + OpName + "'";
|
||||
|
||||
// + "([订单号],"
|
||||
//+ "[主配厂家],[工位号], [工位名称],[物料号], [零件图号], [零件名称], [零件数量],"
|
||||
//+ "[是否扫描],[扫描方式代码], [扫描方式],[是否主物料], [厂家代码],[生产厂家], "
|
||||
//+ "[操作指导],[发动机号],[追踪代码],[主物料号],[物料号表索引号],[零件数量验证],"
|
||||
//+ "[物料条码], [物料条码物料号], [物料条码批次],[验证结果], [操作者工号], [操作者姓名], [班次代码], "
|
||||
//+ "物料来源代码,物料来源,是否禁用代码,是否禁用,被强制验证物料号,更改代码,更改原因)"
|
||||
// SELECT [ID],[订单号],[主配厂家],[工位号], [工位名称], [物料号], [零件图号], [零件名称],[零件数量],[是否扫描],
|
||||
//是否主物料,[厂家代码], [生产厂家], 0 as 零件数量验证,'' as 物料条码,''
|
||||
//as 物料条码物料号,'' as 物料条码批次,0 as 验证结果,被强制验证物料号,更改代码,更改原因,是否禁用代码,物料来源代码,扫描方式
|
||||
//from MES_计划BOM_发动机装配指南
|
||||
//where 订单号='100080211'and 工位号='OP3120'
|
||||
}
|
||||
else
|
||||
{
|
||||
sql = "SELECT [ID],[订单号]," +
|
||||
"[主配厂家],[工位号], [工位名称], [物料号], [零件图号], [零件名称], [零件数量],[是否扫描],d.扫描方式代码,d.扫描方式,是否主物料,[厂家代码], [生产厂家], " +
|
||||
"[操作指导],'' as 发动机号,'' as 主物料号,0 as 物料号表索引号,0 as 零件数量验证,"
|
||||
+ "'' as 物料条码,'' as 物料条码物料号,'' as 物料条码批次,0 as 验证结果,"
|
||||
+ "'' as 操作者工号,'' as 操作者姓名,'' as 班次代码,"
|
||||
+ "b.物料来源代码, b.物料来源, a.是否禁用代码, a.是否禁用,被强制验证物料号,更改代码,更改原因 "
|
||||
+ " FROM MES_计划BOM_订单计划下达_扫描方式 AS d INNER JOIN (MES_计划BOM_订单计划下达_是否禁用 AS a INNER JOIN (MES_计划BOM_订单计划下达_物料来源 AS b INNER JOIN MES_计划BOM_发动机装配指南 AS c ON b.物料来源代码 = c.物料来源代码) ON a.是否禁用代码 = c.是否禁用代码) ON c.扫描方式=d.扫描方式代码 "
|
||||
+ "where 订单号='" + orderForm + "'"
|
||||
+ "and 工位号='" + OpName + "' and a.是否禁用代码 = 0 "
|
||||
+ " ORDER BY 物料号 ";
|
||||
sql = "SELECT [ID],[订单号],"
|
||||
+ "[主配厂家],[工位号], [工位名称], [物料号], [零件图号], [零件名称],[零件数量],"
|
||||
+ "[是否扫描],扫描方式 as 扫描方式代码,'' as 扫描方式,是否主物料,[厂家代码], [生产厂家], "
|
||||
+ "'' as 操作指导,'' as 发动机号,'' as 追踪代码,'' as 主物料号,0 as 物料号表索引号,0 as 零件数量验证,"
|
||||
+ "'' as 物料条码,'' as 物料条码物料号,'' as 物料条码批次,0 as 验证结果,'' as 操作者工号,'' as 操作者姓名,'' as 班次代码,"
|
||||
+ " 物料来源代码,'' as 物料来源,是否禁用代码,'' as 是否禁用, 被强制验证物料号,更改代码,更改原因"
|
||||
+ " from MES_计划BOM_发动机装配指南"
|
||||
+ " where 订单号='" + orderForm + "'"
|
||||
+ "and 工位号='" + OpName + "'";
|
||||
}
|
||||
//if (!SQLCommon.SqlServerConnectionStatus)
|
||||
//{
|
||||
// SQLCommon.ExecuteDataTable_OleDb(sql, ApplicationConfig.ConnectionString_Access, out dt, out errorMessage);
|
||||
//}
|
||||
//else
|
||||
{
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
}
|
||||
return dt;
|
||||
}
|
||||
/// <summary>
|
||||
/// MES_装配数据_零部件追溯_临时状态_增加
|
||||
/// </summary>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
//public static void VerifyMaterialTempTableInsert(DataTable dt)
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "INSERT INTO [MES_装配数据_零部件追溯_临时状态]"
|
||||
// + "([订单号],"
|
||||
// + "[主配厂家],[工位号], [工位名称],[物料号], [零件图号], [零件名称], [零件数量],"
|
||||
// + "[是否扫描],[扫描方式代码], [扫描方式],[是否主物料], [厂家代码],[生产厂家], "
|
||||
// + "[操作指导],[发动机号],[追踪代码],[主物料号],[物料号表索引号],[零件数量验证],"
|
||||
// + "[物料条码], [物料条码物料号], [物料条码批次],[验证结果], [操作者工号], [操作者姓名], [班次代码], "
|
||||
// + "物料来源代码,物料来源,是否禁用代码,是否禁用,被强制验证物料号,更改代码,更改原因)"
|
||||
|
||||
// + "VALUES(@订单号,"
|
||||
// + "@主配厂家,@工位号,@工位名称,@物料号,@零件图号,@零件名称,@零件数量,"
|
||||
// + " @是否扫描,@扫描方式代码,@扫描方式,@是否主物料,@厂家代码,@生产厂家,"
|
||||
// + "@操作指导,@发动机号,@追踪代码,@主物料号,@物料号表索引号,@零件数量验证,"
|
||||
// + "@物料条码,@物料条码物料号,@物料条码批次,@验证结果,@操作者工号,@操作者姓名,@班次代码,"
|
||||
// + "@物料来源代码,@物料来源,@是否禁用代码,@是否禁用,@被强制验证物料号,@更改代码,@更改原因)";
|
||||
|
||||
|
||||
// OleDbParameter[] thisParms1 = new OleDbParameter[34];
|
||||
// // + "([订单号] "
|
||||
// thisParms1[0] = new OleDbParameter("@订单号", OleDbType.VarChar, 50, "订单号");
|
||||
|
||||
// // + "@主配厂家,@工位号,@工位名称,@物料号,@零件图号,@零件名称,@零件数量,"
|
||||
|
||||
// thisParms1[1] = new OleDbParameter("@主配厂家", OleDbType.VarChar, 50, "主配厂家");
|
||||
// thisParms1[2] = new OleDbParameter("@工位号", OleDbType.VarChar, 50, "工位号");
|
||||
// thisParms1[3] = new OleDbParameter("@工位名称", OleDbType.VarChar, 50, "工位名称");
|
||||
// thisParms1[4] = new OleDbParameter("@物料号", OleDbType.VarChar, 50, "物料号");
|
||||
// thisParms1[5] = new OleDbParameter("@零件图号", OleDbType.VarChar, 50, "零件图号");
|
||||
// thisParms1[6] = new OleDbParameter("@零件名称", OleDbType.VarChar, 50, "零件名称");
|
||||
// thisParms1[7] = new OleDbParameter("@零件数量", OleDbType.Integer, 4, "零件数量");
|
||||
|
||||
// // +"[是否扫描],扫描方式代码, [扫描方式], [厂家代码],[生产厂家], "
|
||||
|
||||
// thisParms1[8] = new OleDbParameter("@是否扫描", OleDbType.Integer, 4, "是否扫描");
|
||||
// thisParms1[9] = new OleDbParameter("@扫描方式代码", OleDbType.Integer, 4, "扫描方式代码");
|
||||
// thisParms1[10] = new OleDbParameter("@扫描方式", OleDbType.VarChar, 50, "扫描方式");
|
||||
// thisParms1[11] = new OleDbParameter("@是否主物料", OleDbType.Integer, 4, "是否主物料");
|
||||
// thisParms1[12] = new OleDbParameter("@厂家代码", OleDbType.VarChar, 50, "厂家代码");
|
||||
// thisParms1[13] = new OleDbParameter("@生产厂家", OleDbType.VarChar, 50, "生产厂家");
|
||||
|
||||
// //+ "@操作指导,@发动机号,@物料号表索引号,@零件数量验证,"
|
||||
|
||||
// thisParms1[14] = new OleDbParameter("@操作指导", OleDbType.VarChar, 255, "操作指导");
|
||||
// thisParms1[15] = new OleDbParameter("@发动机号", OleDbType.VarChar, 50, "发动机号");
|
||||
// thisParms1[16] = new OleDbParameter("@追踪代码", OleDbType.VarChar, 50, "追踪代码");
|
||||
// thisParms1[17] = new OleDbParameter("@主物料号", OleDbType.VarChar, 50, "主物料号");
|
||||
// thisParms1[18] = new OleDbParameter("@物料号表索引号", OleDbType.Integer, 4, "物料号表索引号");
|
||||
// thisParms1[19] = new OleDbParameter("@零件数量验证", OleDbType.Integer, 4, "零件数量验证");
|
||||
|
||||
// // +"[物料条码], [物料条码物料号], [物料条码批次],@验证结果, [操作者工号], [操作者姓名], [班次代码], "
|
||||
// thisParms1[20] = new OleDbParameter("@物料条码", OleDbType.VarChar, 50, "物料条码");
|
||||
// thisParms1[21] = new OleDbParameter("@物料条码物料号", OleDbType.VarChar, 50, "物料条码物料号");
|
||||
// thisParms1[22] = new OleDbParameter("@物料条码批次", OleDbType.VarChar, 50, "物料条码批次");
|
||||
// thisParms1[23] = new OleDbParameter("@验证结果", OleDbType.Integer, 4, "验证结果");
|
||||
// thisParms1[24] = new OleDbParameter("@操作者工号", OleDbType.VarChar, 50, "操作者工号");
|
||||
// thisParms1[25] = new OleDbParameter("@操作者姓名", OleDbType.VarChar, 50, "操作者姓名");
|
||||
// thisParms1[26] = new OleDbParameter("@班次代码", OleDbType.VarChar, 50, "班次代码");
|
||||
|
||||
// // +"物料来源代码,物料来源,是否禁用代码,是否禁用,被强制验证物料号,更改代码,更改原因)"
|
||||
|
||||
// thisParms1[27] = new OleDbParameter("@物料来源代码", OleDbType.Integer, 4, "物料来源代码");
|
||||
// thisParms1[28] = new OleDbParameter("@物料来源", OleDbType.VarChar, 50, "物料来源");
|
||||
// thisParms1[29] = new OleDbParameter("@是否禁用代码", OleDbType.Integer, 4, "是否禁用代码");
|
||||
// thisParms1[30] = new OleDbParameter("@是否禁用", OleDbType.VarChar, 50, "是否禁用");
|
||||
// thisParms1[31] = new OleDbParameter("@被强制验证物料号", OleDbType.VarChar, 50, "被强制验证物料号");
|
||||
// thisParms1[32] = new OleDbParameter("@更改代码", OleDbType.VarChar, 50, "更改代码");
|
||||
// thisParms1[33] = new OleDbParameter("@更改原因", OleDbType.VarChar, 255, "更改原因");
|
||||
|
||||
// DataAccess.ExecuteDataTable_OleDb_Insert_Access(sql, dt, ref thisParms1);
|
||||
//}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询订单号对应的订单数据
|
||||
/// [MES_计划BOM_发动机号]
|
||||
/// </summary>
|
||||
/// <param name="orderForm"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static bool EngineSelectByOrderForm(string orderForm, out DataTable dt)
|
||||
{
|
||||
string sql;
|
||||
sql = "SELECT TOP 1 * FROM MES_计划BOM_发动机号 WHERE 订单号='" + orderForm+"'";
|
||||
//if (!SQLCommon.SqlServerConnectionStatus)
|
||||
//{
|
||||
// return DataAccess.ExecuteDataTable_OleDb_Access(sql, out dt);
|
||||
//}
|
||||
//else
|
||||
{
|
||||
return DataAccess.ExecuteDataTable(sql, out dt);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据追踪代码查询订单号对应的订单数据
|
||||
/// [MES_装配数据_发动机号_追踪代码]
|
||||
/// </summary>
|
||||
/// <param name="engineTraceCode"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
//public static bool GetOrderFormByEngineTraceCode(string engineTraceCode, out DataTable dt)
|
||||
//{
|
||||
// string sql;
|
||||
// sql = "SELECT TOP 1 * FROM MES_装配数据_发动机号_追踪代码 WHERE 追踪代码='" + engineTraceCode + "'";
|
||||
// return DataAccess.ExecuteDataTable_OleDb_Access(sql, out dt);
|
||||
//}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
1504
Common/07WebBusinessFacade/BusinessFacade/MES/MaterialData.cs
Normal file
1504
Common/07WebBusinessFacade/BusinessFacade/MES/MaterialData.cs
Normal file
File diff suppressed because it is too large
Load Diff
BIN
Common/07WebBusinessFacade/BusinessFacade/MES/vssver2.scc
Normal file
BIN
Common/07WebBusinessFacade/BusinessFacade/MES/vssver2.scc
Normal file
Binary file not shown.
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// 有关程序集的一般信息由以下
|
||||
// 控制。更改这些特性值可修改
|
||||
// 与程序集关联的信息。
|
||||
[assembly: AssemblyTitle("BusinessFacade")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("BusinessFacade")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2022")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// 将 ComVisible 设置为 false 会使此程序集中的类型
|
||||
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
|
||||
//请将此类型的 ComVisible 特性设置为 true。
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
|
||||
[assembly: Guid("f0a0c525-03fd-428a-9b17-7f54aa0e4475")]
|
||||
|
||||
// 程序集的版本信息由下列四个值组成:
|
||||
//
|
||||
// 主版本
|
||||
// 次版本
|
||||
// 生成号
|
||||
// 修订号
|
||||
//
|
||||
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
|
||||
//通过使用 "*",如下所示:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@@ -0,0 +1,230 @@
|
||||
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_InsertAAAAA(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>
|
||||
/// 思源库位管理_查询
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="engineID"></param>
|
||||
/// <param name="dt"></param>
|
||||
static public void GetUpLoadBarCode(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);
|
||||
}
|
||||
/// <summary>
|
||||
/// [思源库位管理_下线库位_根据机型_查询]
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="engineID"></param>
|
||||
/// <param name="dt"></param>
|
||||
static public void GetUpLoadWarehouseNoOpName02(string opName,string EngineIDType, 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("@发动机型号", EngineIDType);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt);
|
||||
}
|
||||
/// <summary>
|
||||
/// 思源库位管理_下线库位查询 [思源库位管理_下线库位_根据机型_查询]
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="engineID"></param>
|
||||
/// <param name="dt"></param>
|
||||
static public void GetUnLoadWarehouseNo(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 GetUpLoadEngineIDOrderForm(string opName,string kuweihao, 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("@库位号", kuweihao);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt);
|
||||
}
|
||||
static public void UpdateKuWeiStatus(string opName, string kuweihao)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "[思源库位管理_上线更新状态_修改]";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@库位号", kuweihao);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
static public void GetUpLoadBarCodeEngineID(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 ClearOpCarData(string opName)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "[思源库位管理_清空所有库位数据]";
|
||||
SqlParameter[] thisParms = new SqlParameter[1];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
// ALTER PROCEDURE[dbo].[思源库位管理_修改]
|
||||
// @条码 nvarchar(50),
|
||||
//@ nvarchar(50)=NULL,
|
||||
//@ nvarchar(50),
|
||||
//@ nvarchar(50),
|
||||
|
||||
//@工位号 nvarchar(50),
|
||||
//@库位号 nvarchar(50)
|
||||
static public void GetUpLoadBarCode_Update(string opName,string kuweiNum ,string barCode,string orderForm,
|
||||
string EngineID, string EngineIDType, int typeID)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "思源库位管理_修改";
|
||||
SqlParameter[] thisParms = new SqlParameter[7];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@库位号", kuweiNum);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@条码", barCode);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@订单号", orderForm);
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@发动机号", EngineID);
|
||||
thisParms[5] = new System.Data.SqlClient.SqlParameter("@发动机型号", EngineIDType);
|
||||
thisParms[6] = new System.Data.SqlClient.SqlParameter("@机型代码", typeID);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
|
||||
static public void GetUpLoadBarCode_0utUpdate(string opName, string kuweiNum)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "思源库位管理_出库修改";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@库位号", kuweiNum);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
/// <summary>
|
||||
/// 上线工位 扫面零件码 判断是否当前要加工的零件
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="dt"></param>
|
||||
static public void CheckUpLoadPart(string partCode, string scanPosition, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "SY_MES_计划BOM_判断工件是否匹配";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@partCode", partCode);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@抓取位置", scanPosition);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt);
|
||||
}
|
||||
/// <summary>
|
||||
/// 线首工位自动查找生产订单
|
||||
/// </summary>
|
||||
/// <param name="dt"></param>
|
||||
static public void GetUpLoadPart(out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "SY_MES_计划BOM_线首工位自动查找生产订单";
|
||||
SqlParameter[] thisParms = new SqlParameter[0];
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt);
|
||||
}
|
||||
/// <summary>
|
||||
/// 查询工位最大盆子数量
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="dt"></param>
|
||||
static public void GetMaxPartCount(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);
|
||||
}
|
||||
/// <summary>
|
||||
/// 测量数据发动机在线状态_与订单数比对
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="dt"></param>
|
||||
static public void GetStartGoCount(out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "测量数据发动机在线状态_与订单数比对";
|
||||
SqlParameter[] thisParms = new SqlParameter[0];
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt);
|
||||
}
|
||||
static public void UpdateOrderStatus(string orderCode)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "SY_MES_计划BOM_更新订单生产状态";
|
||||
SqlParameter[] thisParms = new SqlParameter[1];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@订单号", orderCode);
|
||||
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;
|
||||
// }
|
||||
//}
|
||||
|
||||
}
|
||||
}
|
||||
120
Common/07WebBusinessFacade/BusinessFacade/Web.New/MES1.cs
Normal file
120
Common/07WebBusinessFacade/BusinessFacade/Web.New/MES1.cs
Normal file
@@ -0,0 +1,120 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using DataLinkMesWork;
|
||||
using System.Security.Cryptography;
|
||||
//using SystemFramework;
|
||||
|
||||
namespace bizFacade
|
||||
{
|
||||
public partial class MES1
|
||||
{
|
||||
/// <summary>
|
||||
/// 北汽福田工位状态监控MOBY_查询_订单下达用
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="IsAllowWork"></param>
|
||||
/// <returns></returns>
|
||||
public static void Moby_Select_FirstOpName(string opName, out string OrderForm,
|
||||
out int EngineTypeID, out string EngineType, out string EngineID, out string PartPallet_Code,
|
||||
out int IsrepairBarcode, out string repairBarcode, out string EngineTypeString)
|
||||
{
|
||||
DataTable dt = new DataTable();
|
||||
OrderForm = "";
|
||||
EngineTypeID = 0;
|
||||
EngineType = "";
|
||||
EngineID = "";
|
||||
PartPallet_Code = "";
|
||||
IsrepairBarcode = 0;
|
||||
repairBarcode = "";
|
||||
EngineTypeString = "";
|
||||
try
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "北汽福田工位状态监控MOBY_查询_订单下达用";
|
||||
SqlParameter[] thisParms = new SqlParameter[1];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt);
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
OrderForm = dt.Rows[0][MobyTagType.OrderForm_MES].ToString();
|
||||
EngineTypeID = Convert.ToInt32(dt.Rows[0][MobyTagType.EngineTypeID_MES]); ;
|
||||
EngineType = dt.Rows[0][MobyTagType.EngineType_MES].ToString();
|
||||
EngineID = dt.Rows[0][MobyTagType.EngineID_MES].ToString();
|
||||
PartPallet_Code = dt.Rows[0][MobyTagType.PartPallet_Code].ToString();
|
||||
EngineTypeString = dt.Rows[0][MobyTagType.EngineTypeBasic].ToString();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
OrderForm = "";
|
||||
EngineTypeID = 0;
|
||||
EngineType = "";
|
||||
EngineID = "";
|
||||
PartPallet_Code = "";
|
||||
IsrepairBarcode = 0;
|
||||
repairBarcode = "";
|
||||
EngineTypeString = "";
|
||||
}
|
||||
}
|
||||
/// <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="PartPallet_Code"></param>
|
||||
/// <param name="IsrepairBarcode"></param>
|
||||
/// <param name="repairBarcode"></param>
|
||||
public static void Moby_Select(string opName, out string OrderForm,
|
||||
out int EngineTypeID, out string EngineType, out string EngineID, out string PartPallet_Code,
|
||||
out int IsrepairBarcode, out string repairBarcode, out string EngineTypeString, int type = 1)
|
||||
{
|
||||
DataTable dt = new DataTable();
|
||||
OrderForm = "";
|
||||
EngineTypeID = 0;
|
||||
EngineType = "";
|
||||
EngineID = "";
|
||||
PartPallet_Code = "";
|
||||
IsrepairBarcode = 0;
|
||||
repairBarcode = "";
|
||||
EngineTypeString = "";
|
||||
try
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "北汽福田工位状态监控MOBY_查询_订单下达用";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@计数类型", type);
|
||||
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt);
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
OrderForm = dt.Rows[0][MobyTagType.OrderForm].ToString();
|
||||
EngineTypeID = Convert.ToInt32(dt.Rows[0][MobyTagType.EngineTypeID]); ;
|
||||
EngineType = dt.Rows[0][MobyTagType.EngineType].ToString();
|
||||
EngineID = dt.Rows[0][MobyTagType.EngineID].ToString();
|
||||
PartPallet_Code = dt.Rows[0][MobyTagType.PartPallet_Code].ToString();
|
||||
EngineTypeString = dt.Rows[0][MobyTagType.EngineTypeBasic].ToString();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
OrderForm = "";
|
||||
EngineTypeID = 0;
|
||||
EngineType = "";
|
||||
EngineID = "";
|
||||
PartPallet_Code = "";
|
||||
IsrepairBarcode = 0;
|
||||
repairBarcode = "";
|
||||
EngineTypeString = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
225
Common/07WebBusinessFacade/BusinessFacade/Web/Buttons.cs
Normal file
225
Common/07WebBusinessFacade/BusinessFacade/Web/Buttons.cs
Normal file
@@ -0,0 +1,225 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using DataLinkMesWork;
|
||||
using System.Security.Cryptography;
|
||||
//using SystemFramework;
|
||||
|
||||
namespace bizFacade
|
||||
{
|
||||
public class Buttons
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static string Createbuttons(DataTable dt)//相当于在该DIV内动态画table
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();//动态分配长度
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
sb.Append("<table style=\"width:100%;height:100%\"><tr>");
|
||||
for (int i = 0; i < dt.Rows.Count; i++)
|
||||
{
|
||||
//标签id
|
||||
string id = "button_OPs" + dt.Rows[i]["工位号"].ToString();
|
||||
|
||||
//标签类型
|
||||
string type = "button";
|
||||
|
||||
//标签样式
|
||||
string style = "height:98%;width:98%;font-family:微软雅黑;font-size:15px;border-color: #99CCFF";
|
||||
|
||||
string style_td = "width:20%; height:35px";
|
||||
|
||||
//标签值
|
||||
string value = dt.Rows[i]["工位号"].ToString();
|
||||
|
||||
//标签点击事件
|
||||
string onclick = "QualityDataSelect(value)";
|
||||
|
||||
string bgc = "background-color: #CCCCCC";//默认按钮背景色
|
||||
if (dt.Rows[i]["合格标志"].ToString() == "NOK")
|
||||
{
|
||||
bgc = "background-color: red";
|
||||
}
|
||||
else if (dt.Rows[i]["合格标志"].ToString() == "OK")
|
||||
{
|
||||
bgc = "background-color: green";
|
||||
}
|
||||
else
|
||||
{
|
||||
bgc = "background-color: #CCCCCC";
|
||||
}
|
||||
//对行按钮数进行处理,保证五个换行
|
||||
if (i % 4 == 3)
|
||||
{
|
||||
|
||||
sb.Append("<td style=\"" + style_td + "\"><input id=\"" + id + "\" type=\"" + type + "\" style=\"" + style + ";" + bgc + "\" value=\"" + value + "\" onclick=\"" + onclick + "\" /></td>");
|
||||
sb.Append("</tr>\r\n<tr>");
|
||||
}
|
||||
else
|
||||
{
|
||||
sb.Append("<td style=\"" + style_td + "\"><input id=\"" + id + "\" type=\"" + type + "\" style=\"" + style + ";" + bgc + "\" value=\"" + value + "\" onclick=\"" + onclick + "\" /></td>");
|
||||
}
|
||||
}
|
||||
sb.Append("</tr></table>");
|
||||
}
|
||||
}
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
public static string CreateNewbuttons(DataTable dt)//相当于在该DIV内动态画table
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();//动态分配长度
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
sb.Append("<table style=\"width:100%;height:100%\"><tr>");
|
||||
for (int i = 0; i < dt.Rows.Count; i++)
|
||||
{
|
||||
//标签id
|
||||
string id = "button_OPs" + dt.Rows[i]["工位号"].ToString();
|
||||
|
||||
//标签类型
|
||||
string type = "button";
|
||||
|
||||
//标签样式
|
||||
string style = "height:98%;width:98%;font-family:微软雅黑;font-size:15px;border-color: #99CCFF";
|
||||
|
||||
string style_td = "width:15%; height:30px";
|
||||
|
||||
//标签值
|
||||
string value = dt.Rows[i]["工位号"].ToString();
|
||||
|
||||
//标签点击事件
|
||||
string onclick = "QualityDataSelect(value)";
|
||||
|
||||
string bgc = "background-color: #CCCCCC";//默认按钮背景色
|
||||
if (dt.Rows[i]["合格标志"].ToString() == "NOK")
|
||||
{
|
||||
bgc = "background-color: red";
|
||||
}
|
||||
else if (dt.Rows[i]["合格标志"].ToString() == "OK")
|
||||
{
|
||||
bgc = "background-color: green";
|
||||
}
|
||||
else
|
||||
{
|
||||
bgc = "background-color: #CCCCCC";
|
||||
}
|
||||
//对行按钮数进行处理,保证五个换行
|
||||
if (i % 5 == 4)
|
||||
{
|
||||
|
||||
sb.Append("<td style=\"" + style_td + "\"><input id=\"" + id + "\" type=\"" + type + "\" style=\"" + style + ";" + bgc + "\" value=\"" + value + "\" onclick=\"" + onclick + "\" /></td>");
|
||||
sb.Append("</tr>\r\n<tr>");
|
||||
}
|
||||
else
|
||||
{
|
||||
sb.Append("<td style=\"" + style_td + "\"><input id=\"" + id + "\" type=\"" + type + "\" style=\"" + style + ";" + bgc + "\" value=\"" + value + "\" onclick=\"" + onclick + "\" /></td>");
|
||||
}
|
||||
}
|
||||
sb.Append("</tr></table>");
|
||||
}
|
||||
}
|
||||
return sb.ToString();
|
||||
}
|
||||
/// <summary>
|
||||
/// 物料原因模块按钮创建
|
||||
/// </summary>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static string CreateMaterialsButtons(DataTable dt)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
sb.Append("<table style=\"width: 1000px\" ><tr style=\"height: 150px\">");
|
||||
for (int i = 0; i < dt.Rows.Count; i++)
|
||||
{
|
||||
string id = (string)dt.Rows[i]["id"];
|
||||
string type = (string)dt.Rows[i]["type"];
|
||||
string style = (string)dt.Rows[i]["style"];
|
||||
string value = (string)dt.Rows[i]["零件名称"];
|
||||
string onclick = (string)dt.Rows[i]["onclick"];
|
||||
string bgc = "";//默认按钮背景色
|
||||
sb.Append("<td><button id=\"" + id + "\" onclick=\"" + onclick + "\" value=\"" + value + "\" style=\"" + style + ";" + bgc + "\"><font size=\"5px\"> " + value + " </font></button></td>");
|
||||
}
|
||||
sb.Append("</tr></table>");
|
||||
}
|
||||
}
|
||||
return sb.ToString();
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static string Createbuttons_alert(DataTable dt)//相当于在该DIV内动态画table
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();//动态分配长度
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
sb.Append("<table style=\"width:100%;\" cellpadding='0' cellspacing='0'><tr>");
|
||||
for (int i = 0; i < dt.Rows.Count; i++)
|
||||
{
|
||||
//标签id
|
||||
string id = "button_OPs" + dt.Rows[i]["工位号"].ToString();
|
||||
|
||||
//标签类型
|
||||
string type = "button";
|
||||
|
||||
//标签样式
|
||||
string style = "height:40px;line-height:35px;width:98%;font-family:'微软雅黑';font-size:15px;border-color:#99CCFF";
|
||||
|
||||
string style_td = "width:20%; height:35px";
|
||||
|
||||
//标签值
|
||||
string value = dt.Rows[i]["工位号"].ToString();
|
||||
|
||||
//标签点击事件
|
||||
string onclick = "QualityDataSelect_alert(value)";
|
||||
|
||||
string bgc = "background-color: #CCCCCC";//默认按钮背景色
|
||||
if (dt.Rows[i]["合格标志"].ToString() == "NOK")
|
||||
{
|
||||
bgc = "background-color: red";
|
||||
}
|
||||
else if (dt.Rows[i]["合格标志"].ToString() == "OK")
|
||||
{
|
||||
bgc = "background-color: green";
|
||||
}
|
||||
else
|
||||
{
|
||||
bgc = "background-color: #CCCCCC";
|
||||
}
|
||||
//对行按钮数进行处理,保证五个换行
|
||||
if (i % 4 == 3)
|
||||
{
|
||||
|
||||
sb.Append("<td style=\"" + style_td + "\"><input id=\"" + id + "\" type=\"" + type + "\" style=\"" + style + ";" + bgc + "\" value=\"" + value + "\" onclick=\"" + onclick + "\" /></td>");
|
||||
sb.Append("</tr>\r\n<tr>");
|
||||
}
|
||||
else
|
||||
{
|
||||
sb.Append("<td style=\"" + style_td + "\"><input id=\"" + id + "\" type=\"" + type + "\" style=\"" + style + ";" + bgc + "\" value=\"" + value + "\" onclick=\"" + onclick + "\" /></td>");
|
||||
}
|
||||
}
|
||||
sb.Append("</tr></table>");
|
||||
}
|
||||
}
|
||||
return sb.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
237
Common/07WebBusinessFacade/BusinessFacade/Web/Login.cs
Normal file
237
Common/07WebBusinessFacade/BusinessFacade/Web/Login.cs
Normal file
@@ -0,0 +1,237 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using DataLinkMesWork;
|
||||
using System.Security.Cryptography;
|
||||
//using SystemFramework;
|
||||
|
||||
namespace bizFacade
|
||||
{
|
||||
public class UserLogin
|
||||
{
|
||||
/// <summary>
|
||||
/// 登陆者查询_Easyui
|
||||
/// </summary>
|
||||
/// <param name="opName">登陆名</param>
|
||||
/// <param name="message">密码</param>
|
||||
/// <param name="IsSuccess"></param>
|
||||
/// <returns></returns>
|
||||
public static bool Getlogin(string opName, string message, out int IsSuccess)
|
||||
{
|
||||
IsSuccess = 0;
|
||||
string produceName = "MES_用户管理_人员登录_扫码";
|
||||
SqlParameter[] thisParms = new SqlParameter[3];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@条码", message);
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
public static void GetUrl(string opname, out DataTable tb)
|
||||
{
|
||||
string sql = "SELECT TOP 1 [WebHtml],[工位号],[工步属性],[服务器IP],[通讯端口] FROM [dbo].[MES_计划BOM_工位与名称_视图] WHERE [工位号]='" + opname + "'";
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
string errorMessage;
|
||||
tb = null;
|
||||
DataAccess.ExecuteDataTable(sql, out tb);
|
||||
}
|
||||
public static bool ConfirmClass(string classes, out string confirmclass)
|
||||
{
|
||||
string procedureName = "AMES_物料拉动_人员班组管理_班次信息_查询";
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
string errorMessage;
|
||||
confirmclass = "";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[1];
|
||||
sqlParameters[0] = new SqlParameter("@班次", SqlDbType.NVarChar, 50);
|
||||
sqlParameters[0].Direction = ParameterDirection.Output;
|
||||
if (DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters))
|
||||
{
|
||||
confirmclass = sqlParameters[0].Value.ToString();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public static void ClassName_Select(string ClassCode, out DataTable dt)
|
||||
{
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
string errorMessage;
|
||||
string sql;
|
||||
sql = "SELECT top 1 班次描述 FROM [dbo].[AMES_物料拉动_人员班组管理_班次信息] WHERE [班次代码]='" + ClassCode + "'";
|
||||
dt = null;
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
}
|
||||
/// <summary>
|
||||
/// 修改新密码
|
||||
/// </summary>
|
||||
/// <param name="opname"></param>
|
||||
/// <param name="tb"></param>
|
||||
public static void updatePassWord(string userName, string passWord, out DataTable tb)
|
||||
{
|
||||
string sql = "update [dbo].[MES_用户管理_人员] set 密码='" + passWord + "' WHERE [用户名]='" + userName + "'";
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
string errorMessage;
|
||||
tb = null;
|
||||
DataAccess.ExecuteDataTable(sql, out tb);
|
||||
}
|
||||
/// <summary>
|
||||
/// 登陆界面设置窗口提交
|
||||
/// </summary>
|
||||
/// <param name="opname"></param>
|
||||
/// <param name="tb"></param>
|
||||
public static void InitLoginCombobox(string clientIp,out DataTable tb)
|
||||
{
|
||||
string sql = "SELECT [工位代码],[工位号] FROM [dbo].[MES_计划BOM_工位与名称_视图] WHERE [工控机IP]='" + clientIp + "'";
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
string errorMessage;
|
||||
tb = null;
|
||||
DataAccess.ExecuteDataTable(sql, out tb);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 登陆界面设置窗口提交
|
||||
/// </summary>
|
||||
/// <param name="opname"></param>
|
||||
/// <param name="tb"></param>
|
||||
public static void submitSetOk(string opNum,string opName,string serverIp,string serverPort,string manchineIp, out DataTable tb)
|
||||
{
|
||||
string sql = "update [dbo].[MES_计划BOM_工位与名称] set 工位代码='" + opNum + "',工控机IP='" + manchineIp + "',工位号='" + opName + "',服务器IP='" + serverIp + "',通讯端口='" + serverPort + "' WHERE [工位号]='" + opName + "'";
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
string errorMessage;
|
||||
tb = null;
|
||||
DataAccess.ExecuteDataTable(sql, out tb);
|
||||
}
|
||||
/// <summary>
|
||||
/// 初始化设置串口的工位号
|
||||
/// </summary>
|
||||
/// <param name="tb"></param>
|
||||
public static void InitSetCombobox(out DataTable tb)
|
||||
{
|
||||
string sql = "SELECT [工位代码],[工位号] FROM [dbo].[MES_计划BOM_工位与名称_视图]";
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
string errorMessage;
|
||||
tb = null;
|
||||
DataAccess.ExecuteDataTable(sql, out tb);
|
||||
}
|
||||
/// <summary>
|
||||
/// 登陆者查询_Easyui
|
||||
/// </summary>
|
||||
/// <param name="loginUser">登陆名</param>
|
||||
/// <param name="passWord">密码</param>
|
||||
/// <param name="tb"></param>
|
||||
/// <returns></returns>
|
||||
public static bool loginUserSelect(string loginUser, string passWord, out DataTable tb)
|
||||
{
|
||||
string procedureName = "登陆者查询_Easyui";
|
||||
//string connectionString = ApplicationConfig.ConnectionString_MES;
|
||||
DataSet ds;
|
||||
string errorMessage;
|
||||
bool isOK;
|
||||
SqlParameter[] sqlParameters = new SqlParameter[2];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@登陆名", loginUser);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@密码", passWord);
|
||||
isOK = DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out ds);
|
||||
if (isOK)
|
||||
{
|
||||
tb = ds.Tables[0];
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
tb = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public static void ClassCode_Select(string ClassName, out DataTable dt)
|
||||
{
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
string errorMessage;
|
||||
string sql;
|
||||
sql = "SELECT top 1 班次代码 FROM AMES_物料拉动_人员班组管理_班次信息 WHERE [班次描述]='" + ClassName + "'";
|
||||
dt = null;
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询是否登录过
|
||||
/// </summary>
|
||||
/// <param name="opname"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static void SearchUrl(string opname, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "测量数据工位_监控系统_操作者工号_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[1];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// [测量数据工位_监控系统_员工在线信息表_员工下线]
|
||||
/// </summary>
|
||||
/// <param name="Opname"></param>
|
||||
/// <param name="OperatorName"></param>
|
||||
/// <param name="OperatorManger"></param>
|
||||
/// <param name="Password"></param>
|
||||
/// <param name="Type"></param>
|
||||
/// <param name="Msg"></param>
|
||||
/// <returns></returns>
|
||||
public static bool Getoff_WorkingHours(string Opname, string OperatorName, string OperatorManger, string Password, int Type, out string Msg)
|
||||
{
|
||||
string procedureName = "AMES_物料拉动_测量数据工位_监控系统_员工在线信息表_员工下线";
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
string errorMessage;
|
||||
Msg = "";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[6];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@操作者工号", OperatorName);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@管理者工号", OperatorManger);
|
||||
sqlParameters[2] = new System.Data.SqlClient.SqlParameter("@工位号", Opname);
|
||||
sqlParameters[3] = new System.Data.SqlClient.SqlParameter("@密码", Password);
|
||||
sqlParameters[4] = new System.Data.SqlClient.SqlParameter("@下线类型", Type);
|
||||
sqlParameters[5] = new SqlParameter("@Result", SqlDbType.NVarChar, 50);
|
||||
sqlParameters[5].Direction = ParameterDirection.Output;
|
||||
|
||||
if (DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters))
|
||||
{
|
||||
Msg = sqlParameters[5].Value.ToString();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 查询班次
|
||||
/// </summary>
|
||||
/// <param name="tb"></param>
|
||||
public static void Getclasses(out DataTable tb)
|
||||
{
|
||||
string sql = "SELECT [班次代码],[班次描述] FROM [dbo].[AMES_物料拉动_人员班组管理_班次信息] ORDER BY 班次代码 ";
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
string errorMessage;
|
||||
tb = null;
|
||||
DataAccess.ExecuteDataTable(sql, out tb);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
619
Common/07WebBusinessFacade/BusinessFacade/Web/MES.Functions.cs
Normal file
619
Common/07WebBusinessFacade/BusinessFacade/Web/MES.Functions.cs
Normal file
@@ -0,0 +1,619 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using DataLinkMesWork;
|
||||
using System.Security.Cryptography;
|
||||
//using SystemFramework;
|
||||
using System.Web;
|
||||
|
||||
namespace bizFacade
|
||||
{
|
||||
public partial class MES
|
||||
{
|
||||
/// <summary>
|
||||
/// 测量数据工位_监控系统_MOBY_查询
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="IsAllowWork"></param>
|
||||
/// <returns></returns>
|
||||
public static void Moby_Select(string opName, out string orderNum,
|
||||
out int EngineTypeID, out string EngineType, out string EngineID, out string PartPallet_Code,
|
||||
out int IsrepairBarcode, out string repairBarcode)
|
||||
{
|
||||
orderNum = "";
|
||||
EngineTypeID = 0;
|
||||
EngineType = "";
|
||||
EngineID = "";
|
||||
PartPallet_Code = "";
|
||||
IsrepairBarcode = 0;
|
||||
repairBarcode = "";
|
||||
try
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "测量数据工位_监控系统_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;
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
if (thisParms[1].Value != null && thisParms[2].Value != null && thisParms[3].Value != null && thisParms[4].Value != null && thisParms[5].Value != null && thisParms[6].Value != null && thisParms[7].Value != null)
|
||||
{
|
||||
orderNum = thisParms[1].Value.ToString();
|
||||
EngineTypeID = Convert.ToInt32(thisParms[2].Value); ;
|
||||
EngineType = thisParms[3].Value.ToString();
|
||||
EngineID = thisParms[4].Value.ToString();
|
||||
PartPallet_Code = thisParms[5].Value.ToString();
|
||||
IsrepairBarcode = Convert.ToInt32(thisParms[6].Value); ;
|
||||
repairBarcode = thisParms[7].Value.ToString();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
orderNum = "";
|
||||
EngineTypeID = 0;
|
||||
EngineType = "";
|
||||
EngineID = "";
|
||||
PartPallet_Code = "";
|
||||
IsrepairBarcode = 0;
|
||||
repairBarcode = "";
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 基本数据_工作日历_班次产量查询_Web页面显示_初始化查询
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="IsAllowWork"></param>
|
||||
/// <returns></returns>
|
||||
public static void InitOpNameOuputCount(string opName, out int outputValue, out int nowOutputValue,
|
||||
out int opNameBeatValue, out int NowOpNameBeatValue, out int classNumber)
|
||||
{
|
||||
outputValue = 0;//工位产量
|
||||
nowOutputValue = 0;//在线产量
|
||||
opNameBeatValue = 0;//工位节拍
|
||||
NowOpNameBeatValue = 0;//在线节拍
|
||||
classNumber = 0;//班次
|
||||
try
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "Web页面显示_计划产量初始化查询";
|
||||
SqlParameter[] thisParms = new SqlParameter[6];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@工位产量", SqlDbType.Int, 4, "工位产量");
|
||||
thisParms[1].Direction = ParameterDirection.Output;
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@工位节拍", SqlDbType.Int, 4, "工位节拍");
|
||||
thisParms[2].Direction = ParameterDirection.Output;
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@在线产量", SqlDbType.Int, 4, "在线产量");
|
||||
thisParms[3].Direction = ParameterDirection.Output;
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@在线节拍", SqlDbType.Int, 4, "在线节拍");
|
||||
thisParms[4].Direction = ParameterDirection.Output;
|
||||
thisParms[5] = new System.Data.SqlClient.SqlParameter("@班次代码", SqlDbType.Int, 4, "班次代码");
|
||||
thisParms[5].Direction = ParameterDirection.Output;
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
if (thisParms[1].Value != null && thisParms[2].Value != null && thisParms[3].Value != null && thisParms[4].Value != null && thisParms[5].Value != null)
|
||||
{
|
||||
outputValue = Convert.ToInt32(thisParms[1].Value);
|
||||
opNameBeatValue = Convert.ToInt32(thisParms[2].Value);
|
||||
nowOutputValue = Convert.ToInt32(thisParms[3].Value);
|
||||
NowOpNameBeatValue = Convert.ToInt32(thisParms[4].Value);
|
||||
classNumber = Convert.ToInt32(thisParms[5].Value);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
outputValue = 0;
|
||||
opNameBeatValue = 0;
|
||||
nowOutputValue = 0;
|
||||
NowOpNameBeatValue = 0;
|
||||
classNumber = 0;
|
||||
}
|
||||
}
|
||||
|
||||
static public bool MaterialsDelete(string engineID, string engineType)
|
||||
{
|
||||
string procedureName = "轴系返修零件_删除";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工件编号", engineID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@产品型号", engineType);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 测量数据工位_监控系统_手动转线_增加
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="outLineRepair1"></param>
|
||||
/// <returns></returns>
|
||||
static public bool AskManualTransfer(string opName, int manualTransfer1, int applyOffLine, int updateOptions1)
|
||||
{
|
||||
string procedureName = "测量数据工位_监控系统_手动转线_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[4];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@是否启动转线", manualTransfer1);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@是否强制下线", applyOffLine);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@更新项目", updateOptions1);
|
||||
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 电子看板_工序内容_查询
|
||||
/// </summary>
|
||||
/// <param name="opName">工位号</param>
|
||||
/// <param name="engineTypeID">产品型号代码</param>
|
||||
/// <param name="dt"></param>
|
||||
static public void Process_Select(string opName, int engineTypeID, string EngineType, out DataTable dt)
|
||||
{
|
||||
dt = null;
|
||||
string sql = "exec 电子看板_工序内容_查询 '" + opName + "'," + engineTypeID.ToString() + ",'" + EngineType + "'";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 生产计划_派工订单_查询_工位执行
|
||||
/// </summary>
|
||||
/// <param name="opName">工位号</param>
|
||||
/// <param name="dt"></param>
|
||||
static public void OrderFormList_Select(string opName, out DataTable dt)
|
||||
{
|
||||
dt = null;
|
||||
string sql = "exec 生产计划_派工订单_查询_工位执行 '" + opName + "'";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 电子看板_装配零件_物料验证_查询 20131231
|
||||
/// </summary>
|
||||
/// <param name="opName">工位号</param>
|
||||
/// <param name="engineID">发动机号</param>
|
||||
/// <param name="dt"></param>
|
||||
static public bool PartMaterialVerify_Select(string opName, int engineTypeID, string engineType, out DataTable dt)
|
||||
{
|
||||
dt = null;
|
||||
string procedureName;
|
||||
procedureName = "电子看板_装配零件_临时表_查询";
|
||||
SqlParameter[] thisParms = new SqlParameter[3];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@产品型号代码", engineTypeID);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@发动机型号", engineType);
|
||||
//thisParms[1] = new System.Data.SqlClient.SqlParameter("@发动机号", engineID);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 电子看板_工位机型_质量数据测量位置_查询_工作顺序
|
||||
/// </summary>
|
||||
/// <param name="opNum">工位号</param>
|
||||
/// <param name="EngineTypeID">产品型号代码</param>
|
||||
/// <param name="dt"></param>
|
||||
static public bool ShaftPositionSelect(string opNum, int EngineTypeID, out DataTable dt)
|
||||
{
|
||||
string procedureName = "电子看板_工位机型_质量数据测量位置_临时表_查询";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opNum);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@产品型号代码", EngineTypeID);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 电子看板_工位机型_物料检测测量位置_查询_物料检测
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
static public bool MaterialCheckSelect(string opName, out DataTable dt)
|
||||
{
|
||||
string procedureName = "电子看板_工位机型_物料检测测量位置_查询_物料检测";
|
||||
SqlParameter[] thisParms = new SqlParameter[1];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 测量数据合格_查询
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="engineID"></param>
|
||||
/// <param name="tb"></param>
|
||||
/// <returns></returns>
|
||||
static public bool QualitySelect(string opName, string engineID, out DataTable dt)
|
||||
{
|
||||
string procedureName = "测量数据合格_查询";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@发动机号", engineID);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 启用拧紧
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="orderNum"></param>
|
||||
/// <returns></returns>
|
||||
static public bool IsBackWork_Add(string opName, int IsBackWork)
|
||||
{
|
||||
string procedureName = "测量数据工位_监控系统_拧紧与返修拧紧_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@是否启用备用模式", IsBackWork);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 将手动转线/申请下线/返修上线更新到数据库中
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="manualValue"></param>
|
||||
/// <param name="outlineValue"></param>
|
||||
/// <param name="repairVaule"></param>
|
||||
/// <returns></returns>
|
||||
static public bool updataCbxFunction_add(string opName, int manualValue, int outlineValue, int repairVaule)
|
||||
{
|
||||
string procedureName = "测量数据工位_监控系统_上线下线转线_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[4];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@申请下线", outlineValue);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@返修上线", repairVaule);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@手动转线", manualValue);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 测量数据工位_监控系统_订单号_增加
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="orderNum"></param>
|
||||
/// <returns></returns>
|
||||
static public bool OrderNum_Add(string opName, string orderNum)
|
||||
{
|
||||
string procedureName = "测量数据工位_监控系统_订单号_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@订单号", orderNum);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 测量数据工位_监控系统_订单号_增加
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="orderNum"></param>
|
||||
/// <returns></returns>
|
||||
static public bool Insert_OnlineOutline(string opName, int orderNum)
|
||||
{
|
||||
string procedureName = "测量数据工位_监控系统_在线离线屏蔽_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@工位状态", orderNum);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 功能按钮-从数据库中更新在线/离线/屏蔽
|
||||
/// </summary>
|
||||
/// <param name="opname"></param>
|
||||
/// <param name="tb"></param>
|
||||
public static void Init_OnlineOutline(string opname, out DataTable tb)
|
||||
{
|
||||
string sql = "SELECT [工位状态] FROM [dbo].[测量数据工位_监控系统_在线离线屏蔽] WHERE [工位号]='" + opname + "'";
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
string errorMessage;
|
||||
tb = null;
|
||||
DataAccess.ExecuteDataTable(sql, out tb);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 电子看板_工位机型_质量数据测量位置_查询_返修
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="engineTypeId"></param>
|
||||
/// <param name="engineType"></param>
|
||||
/// <param name="tb"></param>
|
||||
public static void Init_TreeData1(string opName, int engineTypeId, string engineType, out DataTable tb)
|
||||
{
|
||||
string sql = "SELECT [序号],[说明] FROM [dbo].[电子看板_工位机型_质量数据测量位置] WHERE [工位号]='" + opName + "' and [产品型号代码]=" + engineTypeId + " and [发动机型号]='" + engineType + "'";
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
string errorMessage;
|
||||
tb = null;
|
||||
DataAccess.ExecuteDataTable(sql, out tb);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 电子看板_工位机型_质量数据测量位置_查询_返修
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
static public bool Init_TreeData(string opName, out DataTable dt)
|
||||
{
|
||||
string procedureName = "电子看板_工位机型_质量数据测量位置_查询_返修";
|
||||
SqlParameter[] thisParms = new SqlParameter[1];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 测量数据工位_监控系统_发动机型号_增加
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="enginetype"></param>
|
||||
/// <param name="enginetypeID"></param>
|
||||
/// <returns></returns>
|
||||
static public bool EngineNum_Add(string opName, string enginetype, int enginetypeID)
|
||||
{
|
||||
string 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("@产品型号代码", enginetypeID);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 测量数据工位_监控系统_手动打印_增加
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="year"></param>
|
||||
/// <param name="month"></param>
|
||||
/// <param name="day"></param>
|
||||
/// <param name="num"></param>
|
||||
/// <returns></returns>
|
||||
public static bool OpName_MIS_Manual_Insert(string opName, int year, int month, int day, int num)
|
||||
{
|
||||
string produceName = "测量数据工位_监控系统_手动打印_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[5];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@年", year);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@月", month);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@日", day);
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@流水号", num);
|
||||
return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 测量数据工位_监控系统_订单号_查询
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static bool OpName_MIS_OrderForm_Select(string opName, out DataTable dt)
|
||||
{
|
||||
string sql = "select top 1 订单号 from 测量数据工位_监控系统_订单号 where 工位号='" + opName + "'";
|
||||
return DataAccess.ExecuteDataTable(sql, out dt);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 测量数据工位_监控系统_发动机型号_查询
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static bool OpName_MIS_EngineType_Select(string opName, out DataTable dt)
|
||||
{
|
||||
string sql = "select top 1 产品型号代码,发动机型号 from 测量数据工位_监控系统_发动机型号 where 工位号='" + opName + "'";
|
||||
return DataAccess.ExecuteDataTable(sql, out dt);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 测量数据工位_监控系统_系统初始化
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <returns></returns>
|
||||
public static bool WebLoginIn(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="tb"></param>
|
||||
public static void GetopRepairName(string opname, out DataTable tb)
|
||||
{
|
||||
string sql = "SELECT TOP 1 [返修工位号] FROM [dbo].[MES_计划BOM_工位与名称_视图] WHERE [工位号]='" + opname + "'";
|
||||
//string connectionString =ApplicationConfig.ConnectionString;
|
||||
string errorMessage;
|
||||
tb = null;
|
||||
DataAccess.ExecuteDataTable(sql, out tb);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 测量数据工位_监控系统_离线返修_增加
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="outLineRepair1"></param>
|
||||
/// <returns></returns>
|
||||
static public bool AskOutLineRepair(string opName, int outLineRepair1)
|
||||
{
|
||||
string procedureName = "测量数据工位_监控系统_离线返修_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@离线返修", outLineRepair1);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 电子看板_装配零件_修改_零件批号
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="engineType"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static bool Material_Betch_Update(string opName, string engineType, DataTable dt)
|
||||
{
|
||||
string produceName = "电子看板_装配零件_修改_零件批号";
|
||||
SqlParameter[] thisParms = new SqlParameter[5];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@零件图号", SqlDbType.NVarChar, 50, "零件图号");
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@零件批号", SqlDbType.NVarChar, 50, "零件批号");
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@生产厂家", SqlDbType.NVarChar, 50, "生产厂家");
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@发动机型号", engineType);
|
||||
return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms, dt);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 电子看板_工位机型_质量数据测量位置_临时表_修改_返修
|
||||
/// </summary>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static bool Insert_selectTreeData(DataTable dt)
|
||||
{
|
||||
string produceName = "电子看板_工位机型_质量数据测量位置_临时表_修改_返修";
|
||||
SqlParameter[] thisParms = new SqlParameter[3];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", SqlDbType.NVarChar, 50, "工位号");
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@产品型号代码", SqlDbType.Int, 4, "产品型号代码");
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@序号", SqlDbType.Int, 4, "序号");
|
||||
return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms, dt);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 返修上线插入界面选择的工位合格标志
|
||||
/// </summary>
|
||||
/// <param name="opname"></param>
|
||||
/// <param name="tb"></param>
|
||||
public static bool Insert_RepairPartLoad_OpInfo(string opname, string zbz_parameter, string csq_parameter, string zzx_parameter, string jcx_parameter)
|
||||
{
|
||||
string sql = "UPDATE [电子看板_发动机号_线首工位_工位合格标志] SET [轴部装线]=" + zbz_parameter
|
||||
+ " ,[差速器线]=" + csq_parameter
|
||||
+ " ,[总装线]=" + zzx_parameter
|
||||
+ " ,[检测线]=" + jcx_parameter
|
||||
+ " WHERE [工位号]='" + opname + "'";
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
string errorMessage;
|
||||
return DataAccess.ExecuteSQL(sql);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 返修上线插入界面选择的工位合格标志
|
||||
/// </summary>
|
||||
/// <param name="opname"></param>
|
||||
/// <param name="dt"></param>
|
||||
public static bool Select_RepairLoadBtn(string opname, out DataTable dt)
|
||||
{
|
||||
string sql = "SELECT [轴部装线],[差速器线],[总装线],[检测线] FROM [电子看板_发动机号_线首工位_工位合格标志] WHERE 工位号='" + opname + "'";
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
string errorMessage;
|
||||
return DataAccess.ExecuteDataTable(sql, out dt);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获得返修数量信息
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static bool OpName_MIS_RepiareNum_Select(string opName, out DataTable dt)
|
||||
{
|
||||
string sql = "select top 1 设置数量,当前数量 from 测量数据工位_监控系统_批量返修 where 工位号='" + opName + "'";
|
||||
return DataAccess.ExecuteDataTable(sql, out dt);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 插入返修数量信息
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="RepiareNum"></param>
|
||||
/// <returns></returns>
|
||||
static public bool Insert_RepiareNum(string opName, int RepiareNum)
|
||||
{
|
||||
string procedureName = "测量数据工位_监控系统_批量返修_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@返修数量", RepiareNum);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 生产计划_派工订单_查询_工位执行_完工判断
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="isCompleted"></param>
|
||||
/// <param name="num_plan"></param>
|
||||
/// <param name="num_complete"></param>
|
||||
public static void Select_OrderFormList_OrderComplete(string opName, out int isCompleted, out int num_plan, out int num_complete)
|
||||
{
|
||||
isCompleted = 0;//订单数量是否完全上线
|
||||
num_plan = 0;//计划数量
|
||||
num_complete = 0;//上线数量
|
||||
try
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "生产计划_派工订单_查询_工位执行_完工判断";
|
||||
SqlParameter[] thisParms = new SqlParameter[4];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@ISCOMPLETE", SqlDbType.Int, 4, "ISCOMPLETE");
|
||||
thisParms[1].Direction = ParameterDirection.Output;
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@NUM_PLAN", SqlDbType.Int, 4, "NUM_PLAN");
|
||||
thisParms[2].Direction = ParameterDirection.Output;
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@NUM_COMPLETE", SqlDbType.Int, 4, "NUM_COMPLETE");
|
||||
thisParms[3].Direction = ParameterDirection.Output;
|
||||
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms);
|
||||
if (thisParms[1].Value != null && thisParms[2].Value != null && thisParms[3].Value != null)
|
||||
{
|
||||
isCompleted = Convert.ToInt32(thisParms[1].Value);
|
||||
num_plan = Convert.ToInt32(thisParms[2].Value);
|
||||
num_complete = Convert.ToInt32(thisParms[3].Value);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
isCompleted = 0;
|
||||
num_plan = 0;
|
||||
num_complete = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// WEB根据工位号和线外扫描主物料查询质量数据合格索引(包括了分线的信息、存储过程中根据工位类型区分) 20170318 corbin
|
||||
/// </summary>
|
||||
/// <param name="opname"></param>
|
||||
/// <param name="lineout_barcode"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static bool QualityDataButton_bgColor_alert_Select(string opname, out DataTable dt)
|
||||
{
|
||||
string procedureName = "显示测量数据_工位号_根据线外工位验证_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[1];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
//sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@发动机号", lineout_barcode);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 显示物料数据_根据_工位号_发动机型号_查询_分线数据
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="opname"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
static public bool MaterialDataSelect_F_EnergineID(string opname, string energineID, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "显示物料数据_根据_工位号_发动机型号_查询_分线数据";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[2];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@发动机号", energineID);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,684 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using DataLinkMesWork;
|
||||
using System.Security.Cryptography;
|
||||
//using SystemFramework;
|
||||
|
||||
namespace bizFacade
|
||||
{
|
||||
public partial class MaterialPull
|
||||
{
|
||||
#region
|
||||
//---------------------------------MES.Function中的----------------------------------
|
||||
/// <summary>
|
||||
/// 物料拉动_工位物料需求单_转移_查询_单号
|
||||
/// </summary>
|
||||
/// <param name="opName">工位号</param>
|
||||
/// <param name="opName_Checked">1</param>
|
||||
/// <param name="dt"></param>
|
||||
static public void MaterialPush_ListNumer_Select(int orderNum_Check, string orderNum, int opName_Checked, string opName,int type_Check,string type, out DataTable dt)
|
||||
{
|
||||
dt = null;
|
||||
string sql = "物料拉动_工位物料需求单_转移_查询_单号 " + orderNum_Check + ",'" + orderNum + "'," + opName_Checked + ",'" + opName + "'," + type_Check + ",'" + type+"'";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 物料拉动_工位物料需求单_转移_查询
|
||||
/// </summary>
|
||||
/// <param name="opName">工位号</param>
|
||||
/// <param name="dt"></param>
|
||||
static public void MaterialPush_Details_Select(string listNumber,string opName, out DataTable dt)
|
||||
{
|
||||
dt = null;
|
||||
string sql = "物料拉动_工位物料需求单_转移_查询 '" + listNumber + "','" + opName + "'";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 物料拉动_线边库存_接受物料_物料需求单
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="DistributionNum"></param>
|
||||
/// <param name="tb"></param>
|
||||
/// <returns></returns>
|
||||
public static bool DistributionNum(string opName, string DistributionNum)
|
||||
{
|
||||
string produceName = "物料拉动_线边库存_接受物料_物料需求单";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@配送单号", DistributionNum);
|
||||
return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
|
||||
}
|
||||
/// <summary>
|
||||
/// 配送单实时同步表数据增加
|
||||
/// </summary>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
static public bool MaterialPull_DocumentInfo_Add(DataTable dt)
|
||||
{
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
string produceName = "AMES_物料拉动_配送物料接收_配送物料信息_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[12];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@仓库地址", SqlDbType.NVarChar, 50, "WAREHOUSE_CODE");
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@创建时间", SqlDbType.DateTime, 50, "CREATION_DATE");
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@订单号", SqlDbType.NVarChar, 50, "ORDER_NUMBER");
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@工位号", SqlDbType.NVarChar, 50, "DISTRIBUTE_WKC_CODE");
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@供应商代码", SqlDbType.NVarChar, 50, "SUPPLIER_CODE");
|
||||
thisParms[5] = new System.Data.SqlClient.SqlParameter("@卡片条码", SqlDbType.NVarChar, 50, "BARCODE");
|
||||
thisParms[6] = new System.Data.SqlClient.SqlParameter("@类型", SqlDbType.NVarChar, 50, "IS_DOCUMENT");
|
||||
thisParms[7] = new System.Data.SqlClient.SqlParameter("@配送单号", SqlDbType.NVarChar, 50, "DOCUMENT_NUM");
|
||||
thisParms[8] = new System.Data.SqlClient.SqlParameter("@配送数量", SqlDbType.Int, 50, "QUANTITY");
|
||||
thisParms[9] = new System.Data.SqlClient.SqlParameter("@批次号", SqlDbType.NVarChar, 50, "LOT_NUMBER");
|
||||
thisParms[10] = new System.Data.SqlClient.SqlParameter("@条码数量", SqlDbType.Int, 50, "BARCODE_QTY");
|
||||
thisParms[11] = new System.Data.SqlClient.SqlParameter("@物料号", SqlDbType.NVarChar, 50, "ITEM_CODE");
|
||||
if (DataAccess.ExecuteStoredProcedure(produceName, ref thisParms, dt))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取卡片一览信息查询
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="itemCode"></param>
|
||||
/// <param name="dt"></param>
|
||||
public static bool getMaterialNumInfo(string opName, string itemCode, out DataTable dt)
|
||||
{
|
||||
string errorMessage;
|
||||
string sql;
|
||||
//string connectionString_MES = ApplicationConfig.ConnectionString;
|
||||
sql = "SELECT 线边库存流水号,订单号,工位号,物料号,卡片条码,批次号,当前数量 AS '库存数量',卡片数量,使用标志 FROM dbo.AMES_物料拉动_线边库存 WHERE 工位号='" + opName + "' AND 物料号='" + itemCode + "' ORDER BY 使用标志 DESC";
|
||||
return DataAccess.ExecuteDataTable(sql, out dt);
|
||||
}
|
||||
/// <summary>
|
||||
/// 物料号一览信息查询
|
||||
/// </summary>
|
||||
/// <param name="opcnum"></param>
|
||||
/// <param name="dt"></param>
|
||||
public static void InitMaterial_Dialog_MaterialNum(string opcnum, out DataTable dt)
|
||||
{
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
string errorMessage;
|
||||
string sql;
|
||||
dt = null;
|
||||
sql = "SELECT DISTINCT 物料号 FROM dbo.AMES_物料拉动_线边库存 WHERE 工位号='" + opcnum + "' GROUP BY 物料号 ORDER BY 物料号 ";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 查询班次
|
||||
/// </summary>
|
||||
/// <param name="tb"></param>
|
||||
public static void Getclasses(out DataTable tb)
|
||||
{
|
||||
string sql = "SELECT [班次代码],[班次描述] FROM [dbo].[AMES_物料拉动_人员班组管理_班次信息] ORDER BY 班次代码 ";
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
string errorMessage;
|
||||
tb = null;
|
||||
DataAccess.ExecuteDataTable(sql, out tb);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询打卡上线人数
|
||||
/// </summary>
|
||||
/// <param name="opname"></param>
|
||||
/// <param name="dt"></param>
|
||||
public static void Search_OnlineInfo(string opname, out DataTable dt)
|
||||
{
|
||||
string sql = "SELECT [工位号] ,[操作者工号],[操作者姓名] ,[班次] ,[操作时间] FROM [dbo].[AMES_物料拉动_测量数据工位_监控系统_员工在线信息表] WHERE [工位号]='" + opname + "'";
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
string errorMessage;
|
||||
dt = null;
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
}
|
||||
public static void ClassName_Select(string ClassCode, out DataTable dt)
|
||||
{
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
string errorMessage;
|
||||
string sql;
|
||||
sql = "SELECT top 1 班次描述 FROM AMES_物料拉动_人员班组管理_班次信息 WHERE [班次代码]='" + ClassCode + "'";
|
||||
dt = null;
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
}
|
||||
public static bool ConfirmClass( out string confirmclass)
|
||||
{
|
||||
string procedureName = "AMES_物料拉动_人员班组管理_班次信息_查询";
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
string errorMessage;
|
||||
confirmclass = "";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[1];
|
||||
sqlParameters[0] = new SqlParameter("@班次", SqlDbType.NVarChar, 50);
|
||||
sqlParameters[0].Direction = ParameterDirection.Output;
|
||||
if (DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters))
|
||||
{
|
||||
confirmclass = sqlParameters[0].Value.ToString();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// [测量数据工位_监控系统_员工在线信息表_增加]
|
||||
/// </summary>
|
||||
/// <param name="OperatorName"></param>
|
||||
/// <param name="Password"></param>
|
||||
/// <param name="Classes"></param>
|
||||
/// <param name="Msg"></param>
|
||||
/// <returns></returns>
|
||||
public static bool Insert_WorkingHours(string Opname, string OperatorName, string Password, string Classes, out string Msg)
|
||||
{
|
||||
string procedureName = "AMES_物料拉动_测量数据工位_监控系统_员工在线信息表_员工上线";
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
string errorMessage;
|
||||
Msg = "";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[5];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@操作者工号", OperatorName);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@工位号", Opname);
|
||||
sqlParameters[2] = new System.Data.SqlClient.SqlParameter("@员工密码", Password);
|
||||
sqlParameters[3] = new System.Data.SqlClient.SqlParameter("@班次", Classes);
|
||||
sqlParameters[4] = new SqlParameter("@Result", SqlDbType.NVarChar, 50);
|
||||
sqlParameters[4].Direction = ParameterDirection.Output;
|
||||
|
||||
if (DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters))
|
||||
{
|
||||
Msg = sqlParameters[4].Value.ToString();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region
|
||||
//---------------------------------login中的----------------------------------
|
||||
/// <summary>
|
||||
/// 查询工作中心
|
||||
/// </summary>
|
||||
/// <param name="barcode"></param>
|
||||
/// <param name="dt"></param>
|
||||
public static DataTable DirectUpload_WorkCenterCode_Select()
|
||||
{
|
||||
DataTable dt = null;
|
||||
string sql;
|
||||
sql = "SELECT top 1 工作中心 FROM dbo.AMES_物料拉动_MES_工厂与工作中心 ";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
return dt;
|
||||
}
|
||||
|
||||
//新增直供上线
|
||||
public static bool DirectUpload_VerifyTempTable_Delete(string opName)
|
||||
{
|
||||
string produceName = "AMES_物料拉动_直供上线_验证临时表_删除";
|
||||
SqlParameter[] thisParms = new SqlParameter[1];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
|
||||
return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
|
||||
}
|
||||
//新增直供上线
|
||||
public static bool DirectUpload_VerifyTempTable_Add(string opName, DataTable dt)
|
||||
{
|
||||
string produceName = "AMES_物料拉动_直供上线_验证临时表_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[18];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@仓库地址", SqlDbType.NVarChar, 50, "WAREHOUSE_CODE");
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@是否标准", SqlDbType.NVarChar, 50, "NOTIFICATION_TYPE_MEAN");
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@允许接收", SqlDbType.NVarChar, 50, "IS_NEED_VALIDATING");
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@工厂", SqlDbType.NVarChar, 50, "PLANT_ID");
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@工作中心", SqlDbType.NVarChar, 50, "PROD_LINE_CODE");
|
||||
thisParms[5] = new System.Data.SqlClient.SqlParameter("@卡片条码", SqlDbType.NVarChar, 50, "SGL_CODE");
|
||||
thisParms[6] = new System.Data.SqlClient.SqlParameter("@物料号", SqlDbType.NVarChar, 50, "ITEM_CODE");
|
||||
thisParms[7] = new System.Data.SqlClient.SqlParameter("@物料描述", SqlDbType.NVarChar, 50, "DESCRIPTIONS");
|
||||
thisParms[8] = new System.Data.SqlClient.SqlParameter("@卡片数量", SqlDbType.NVarChar, 50, "QUANTITY");
|
||||
thisParms[9] = new System.Data.SqlClient.SqlParameter("@批次号", SqlDbType.NVarChar, 50, "LOT_NUMBER");
|
||||
thisParms[10] = new System.Data.SqlClient.SqlParameter("@供应商代码", SqlDbType.NVarChar, 50, "SUPPLIER_CODE");
|
||||
thisParms[11] = new System.Data.SqlClient.SqlParameter("@工位号", SqlDbType.NVarChar, 50, "DISTRIBUTE_WKC_CODE");
|
||||
thisParms[12] = new System.Data.SqlClient.SqlParameter("@配送单号", SqlDbType.NVarChar, 50, "ATTRIBUTE9");
|
||||
thisParms[13] = new System.Data.SqlClient.SqlParameter("@订单号", SqlDbType.NVarChar, 50, "ORDER_NUMBER");
|
||||
thisParms[14] = new System.Data.SqlClient.SqlParameter("@线边地址", SqlDbType.NVarChar, 50, "WAREHOUSE_CODE1");
|
||||
thisParms[15] = new System.Data.SqlClient.SqlParameter("@创建时间", SqlDbType.NVarChar, 50, "CREATION_DATE");
|
||||
thisParms[16] = new System.Data.SqlClient.SqlParameter("@条码状态", SqlDbType.NVarChar, 50, "STATUS");
|
||||
thisParms[17] = new System.Data.SqlClient.SqlParameter("@验证工位号", opName);
|
||||
return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms, dt);
|
||||
}
|
||||
//新增直供上线
|
||||
public static bool DirectUpload_VerifyTempTable_Select(string opName, string document_Num, out string process_Message, out DataTable dt)
|
||||
{
|
||||
process_Message = "";
|
||||
string procedureName = "AMES_物料拉动_直供上线_验证临时表_查询_送货单行";
|
||||
SqlParameter[] thisParms = new SqlParameter[3];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@配送单号", document_Num);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@PROCESS_MESSGE", SqlDbType.NVarChar, 200);
|
||||
thisParms[2].Direction = ParameterDirection.Output;
|
||||
if (DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt))
|
||||
{
|
||||
process_Message = thisParms[2].Value.ToString();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool DirectUpload_VerifyTempTable_Barcode_Select(string opName, string document_Num, string barcode, out string process_Message, out DataTable dt)
|
||||
{
|
||||
process_Message = "";
|
||||
string procedureName = "AMES_物料拉动_直供上线_验证临时表_查询_料箱标签";
|
||||
SqlParameter[] thisParms = new SqlParameter[4];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@配送单号", document_Num);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@卡片条码", barcode);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@PROCESS_MESSGE", SqlDbType.NVarChar, 200);
|
||||
thisParms[3].Direction = ParameterDirection.Output;
|
||||
if (DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt))
|
||||
{
|
||||
process_Message = thisParms[3].Value.ToString();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool DirectUpload_VerifyTempTable_VerifyOK(string opName, string document_Num, out string process_Message)
|
||||
{
|
||||
process_Message = "";
|
||||
string procedureName = "AMES_物料拉动_直供上线_验证临时表_验证成功";
|
||||
SqlParameter[] thisParms = new SqlParameter[3];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@配送单号", document_Num);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@PROCESS_MESSGE", SqlDbType.NVarChar, 200);
|
||||
thisParms[2].Direction = ParameterDirection.Output;
|
||||
if (DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms))
|
||||
{
|
||||
process_Message = thisParms[2].Value.ToString();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool DirectUpload_ReceiveRecord_Select(string opName, string document_Num, string groupId, out DataTable dt)
|
||||
{
|
||||
|
||||
string procedureName = "AMES_物料拉动_直供上线_接收记录_查询";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@配送单号", document_Num);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@GroupID", groupId);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt);
|
||||
}
|
||||
public static bool DirectUpload_VerifyTempTable_NoticeOK(string opName, string document_Num, string groupId, int isOk, string outResult)
|
||||
{
|
||||
string produceName = "AMES_物料拉动_直供上线_验证临时表_调用成功";
|
||||
SqlParameter[] thisParms = new SqlParameter[5];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@配送单号", document_Num);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@GROUPID", groupId);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@是否成功", isOk);
|
||||
thisParms[4] = new System.Data.SqlClient.SqlParameter("@PROCESS_MESSGE", outResult);
|
||||
return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
|
||||
}
|
||||
|
||||
public static DataTable DirectUpload_OpName_Select(string opName)
|
||||
{
|
||||
DataTable dt = null;
|
||||
string sql;
|
||||
sql = "SELECT top 1 指南工位号 FROM MES_计划BOM_工位与名称 WHERE 工位号='" + opName + "'";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
return dt;
|
||||
}
|
||||
/// <summary>
|
||||
/// 物料拉动_库存盘点_物料号查询
|
||||
/// </summary>
|
||||
/// <param name="tb"></param>
|
||||
|
||||
public static void Init_MaterialNumCombobox(string Opname, out DataTable dt_MaterialNum)
|
||||
{
|
||||
string sql = "SELECT DISTINCT ROW_NUMBER() OVER (ORDER BY 物料号 )AS ID,[物料号] FROM AMES_物料拉动_线边库存 WHERE 工位号='" + Opname + "' GROUP BY 物料号 ORDER BY 物料号 ";
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
string errorMessage;
|
||||
dt_MaterialNum = null;
|
||||
DataAccess.ExecuteDataTable(sql, out dt_MaterialNum);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 物料拉动_库存盘点_消耗
|
||||
/// </summary>
|
||||
/// <param name="OrderNumber"></param>
|
||||
/// <param name="ConsumeNum"></param>
|
||||
/// <returns></returns>
|
||||
public static bool Consume_StockCount(string OrderNumber, string ConsumeNum, string Opname, string CardNum)
|
||||
{
|
||||
string procedureName = "[AMES_物料拉动_线边库存_消耗_人工盘点]";
|
||||
//string connectionString = ApplicationConfig.ConnectionString_MES;
|
||||
string errorMessage;
|
||||
bool isOK;
|
||||
SqlParameter[] sqlParameters = new SqlParameter[4];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@订单号", OrderNumber);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@消耗数量", ConsumeNum);
|
||||
sqlParameters[2] = new System.Data.SqlClient.SqlParameter("@盘点工位号", Opname);
|
||||
sqlParameters[3] = new System.Data.SqlClient.SqlParameter("@卡片条码", CardNum);
|
||||
isOK = DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters);
|
||||
if (isOK)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static public bool MaterialPull_DocumentInfo_ReceiveRecord_Select(string document_Num, string groupId, out DataTable dt)
|
||||
{
|
||||
//此存储过程与直供上线通用
|
||||
string procedureName = "AMES_物料拉动_直供上线_接收记录_查询";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@配送单号", document_Num);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@GroupID", groupId);
|
||||
if (DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out dt))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
//调用成功
|
||||
static public bool MaterialPull_DocumentInfo_NoticeOK(string document_Num, string groupId, int isOk, string outResult)
|
||||
{
|
||||
string process_Message = "";
|
||||
string produceName = "AMES_物料拉动_配送物料接收_调用成功";
|
||||
SqlParameter[] thisParms = new SqlParameter[4];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@配送单号", document_Num);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@GROUPID", groupId);
|
||||
thisParms[2] = new System.Data.SqlClient.SqlParameter("@是否成功", isOk);
|
||||
thisParms[3] = new System.Data.SqlClient.SqlParameter("@PROCESS_MESSGE", outResult);
|
||||
if (DataAccess.ExecuteStoredProcedure(produceName, ref thisParms))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public static bool DocumentOutLineInfo_Select(string distributionNum, out DataTable dt)
|
||||
{
|
||||
string sql;
|
||||
sql = "SELECT * FROM AMES_物料拉动_线边库存_备份 WHERE 配送单号='" + distributionNum + "'";
|
||||
dt = null;
|
||||
return DataAccess.ExecuteDataTable(sql, out dt);
|
||||
}
|
||||
|
||||
public static bool WorkStationInfo_Select(out DataTable dt)
|
||||
{
|
||||
string sql;
|
||||
sql = "SELECT top 1 工作中心 FROM AMES_物料拉动_MES_工厂与工作中心 ";
|
||||
return DataAccess.ExecuteDataTable(sql, out dt);
|
||||
}
|
||||
//物料拉动_库存盘点_初始化 DataGrid
|
||||
public static void init_StockCount(string opname, string MaterialNum, out DataTable dt_StockCount)
|
||||
{
|
||||
string sql = "SELECT DISTINCT A.线边库存流水号,A.工位号, A.订单号,A.当前数量, A.物料号, B.物料描述, A.卡片条码 FROM AMES_物料拉动_线边库存 as A INNER JOIN dbo.AMES_物料拉动_生产计划_派工订单BOM_分配到工位 AS B ON A.物料号 = B.物料号 where A.工位号='" + opname + "'and A.物料号='" + MaterialNum + "' ORDER BY [物料号]";
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
string errorMessage;
|
||||
dt_StockCount = null;
|
||||
DataAccess.ExecuteDataTable(sql, out dt_StockCount);
|
||||
}
|
||||
/// <summary>
|
||||
/// 物料拉动_库存盘点_订单号查询
|
||||
/// </summary>
|
||||
/// <param name="dt_OrderNumber"></param>
|
||||
public static void Init_FinalOrderNumberCombobox(out DataTable dt_OrderNumber)
|
||||
{
|
||||
string dateString = DateTime.Now.ToString("yyyy-MM-01");
|
||||
string sql = "SELECT DISTINCT ROW_NUMBER() OVER (ORDER BY 订单号 )AS ID,订单号 FROM [dbo].[AMES_物料拉动_生产计划_派工订单完工统计] WHERE 操作时间 > '" + dateString + "' GROUP BY 订单号 ORDER BY [订单号]";
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
string errorMessage;
|
||||
dt_OrderNumber = null;
|
||||
DataAccess.ExecuteDataTable(sql, out dt_OrderNumber);
|
||||
}
|
||||
/// <summary>
|
||||
/// FTT总成编号查询
|
||||
/// </summary>
|
||||
/// <param name="dt_EngineNum"></param>
|
||||
public static void Init_FinalListCombobox(string opName, out DataTable dt_EngineNum)
|
||||
{
|
||||
string sql;
|
||||
sql = "SELECT TOP 20 ROW_NUMBER() OVER (ORDER BY 发动机号 )AS ID, 发动机号 FROM [dbo].[测量数据发动机在线状态_跟踪发动机条码状态]" + "WHERE 工位号='" + opName + "' ORDER BY 发动机号 DESC";
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
string errorMessage;
|
||||
dt_EngineNum = null;
|
||||
DataAccess.ExecuteDataTable(sql, out dt_EngineNum);
|
||||
}
|
||||
/// <summary>
|
||||
/// 缺陷代码查询
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="dt_EngineNum"></param>
|
||||
public static void Init_DefectCodeCombobox(string opName, out DataTable dt_DefectCode)
|
||||
{
|
||||
string sql;
|
||||
sql = "SELECT [编号],[编号描述] FROM [dbo].[ANDON_类型_编号]where 工位号='" + opName + "'AND [安东类型代码]=2 ";
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
string errorMessage;
|
||||
dt_DefectCode = null;
|
||||
DataAccess.ExecuteDataTable(sql, out dt_DefectCode);
|
||||
}
|
||||
/// <summary>
|
||||
/// 质量管理_质量FTT_不合格品补录_临时表_增加
|
||||
/// </summary>
|
||||
/// <param name="opname"></param>
|
||||
/// <param name="andoTypeCode"></param>
|
||||
/// <param name="EngineNum"></param>
|
||||
/// <param name="group_Number"></param>
|
||||
/// <param name="defect_Number"></param>
|
||||
/// <param name="ProblemDate"></param>
|
||||
/// <param name="callCount"></param>
|
||||
/// <param name="Msg"></param>
|
||||
/// <returns></returns>
|
||||
public static bool Insert_FTTInformation(string opname, string andoTypeCode, string EngineNum, string group_Number, string defect_Number, string ProblemDate, int callCount, out string Msg)
|
||||
{
|
||||
string procedureName = "质量管理_质量FTT_不合格品补录_临时表_增加";
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
string errorMessage;
|
||||
Msg = "";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[8];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@代码组", group_Number);
|
||||
sqlParameters[2] = new System.Data.SqlClient.SqlParameter("@代码", defect_Number);
|
||||
sqlParameters[3] = new System.Data.SqlClient.SqlParameter("@呼叫数量", callCount);
|
||||
sqlParameters[4] = new System.Data.SqlClient.SqlParameter("@安东类型代码", andoTypeCode);
|
||||
sqlParameters[5] = new System.Data.SqlClient.SqlParameter("@工件编号", EngineNum);
|
||||
sqlParameters[6] = new System.Data.SqlClient.SqlParameter("@问题日期", ProblemDate);
|
||||
sqlParameters[7] = new SqlParameter("@Msg", SqlDbType.NVarChar, 50);
|
||||
sqlParameters[7].Direction = ParameterDirection.Output;
|
||||
|
||||
if (DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters))
|
||||
{
|
||||
Msg = sqlParameters[7].Value.ToString();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
|
||||
}
|
||||
|
||||
static public bool MaterialPull_DocumentInfo_CreateRecord(string document_Num, out string process_Message)
|
||||
{
|
||||
process_Message = "";
|
||||
string procedureName = "AMES_物料拉动_配送物料接收_产生接收记录";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@配送单号", document_Num);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@PROCESS_MESSGE", SqlDbType.NVarChar, 200);
|
||||
thisParms[1].Direction = ParameterDirection.Output;
|
||||
if (DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms))
|
||||
{
|
||||
process_Message = thisParms[1].Value.ToString();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 校验发动机号
|
||||
/// </summary>
|
||||
/// <param name="Final_EngineNum"></param>
|
||||
/// <param name="dt_DefectCode"></param>
|
||||
public static void Confirm_EngineNum(string Final_EngineNum, string DefectGroup, string DefectCode, string Opname, out DataTable dt_DefectCode)
|
||||
{
|
||||
string sql;
|
||||
sql = " SELECT COUNT(*)FROM 质量管理_质量FTT_不合格品_临时表 WHERE 产品序列号 ='" + Final_EngineNum + "' AND 代码='" + DefectCode + "' AND 代码组='" + DefectGroup + "' AND 工位号='" + Opname + "' ";
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
string errorMessage;
|
||||
dt_DefectCode = null;
|
||||
DataAccess.ExecuteDataTable(sql, out dt_DefectCode);
|
||||
}
|
||||
/// 查询指南工位号
|
||||
/// </summary>
|
||||
/// <param name="Final_EngineNum"></param>
|
||||
/// <param name="dt_DefectCode"></param>
|
||||
public static void OpName_Convert_Select(string opname, out DataTable dt_ConvertOpname)
|
||||
{
|
||||
|
||||
string errorMessage;
|
||||
string sql;
|
||||
sql = " SELECT 指南工位号 FROM MES_计划BOM_工位与名称 WHERE 工位号='" + opname + "' ";
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
dt_ConvertOpname = null;
|
||||
DataAccess.ExecuteDataTable(sql, out dt_ConvertOpname);
|
||||
|
||||
}
|
||||
#endregion
|
||||
/// <summary>
|
||||
/// 订单机型查询
|
||||
/// </summary>
|
||||
/// <param name="startTime"></param>
|
||||
/// <param name="endTime"></param>
|
||||
/// <param name="dt"></param>
|
||||
public static void Init_OrderNum_Query(string startTime, string endTime, out DataTable dt)
|
||||
{
|
||||
string sql;
|
||||
sql = "SELECT [订单号] ,[产品型号] FROM dbo.AMES_物料拉动_生产计划_派工订单_订单历史 where 计划开始时间>='" + startTime + "'and 计划开始时间<='" + endTime + "' ORDER BY 计划开始时间";
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
string errorMessage;
|
||||
dt = null;
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
}
|
||||
/// <summary>
|
||||
/// 工位工时补报统计
|
||||
/// </summary>
|
||||
/// <param name="orderNum"></param>
|
||||
/// <param name="Opname"></param>
|
||||
/// <param name="dt"></param>
|
||||
public static void Init_Worktime(string orderNum, string Opname, int Num, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "AMES_物料拉动_生产计划_派工订单完工统计_工时统计";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[3];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@订单号", orderNum);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@工位号", Opname);
|
||||
sqlParameters[2] = new System.Data.SqlClient.SqlParameter("@Workplace", Num);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
}
|
||||
public static void workTime_CompleteCount(string OrderNum, out DataTable dt)
|
||||
{
|
||||
string sql = "SELECT SUM(报工数量) FROM [dbo].[测量数据发动机在线状态_跟踪发动机条码状态] WHERE [订单号]='" + OrderNum + "'AND [工位标识]='O' AND [使用标志]='1' AND 是否禁用=0";
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
string errorMessage;
|
||||
dt = null;
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
}
|
||||
public static void init_Statistics(string orderNum, string Opname, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "AMES_物料拉动_测量数据发动机在线状态_跟踪发动机条码状态_工时补报统计";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[2];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@订单号", orderNum);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@工位号", Opname);
|
||||
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
}
|
||||
/// <summary>
|
||||
/// 校验工时补录人员[MES_用户管理_人员]
|
||||
/// </summary>
|
||||
/// <param name="OperatorName"></param>
|
||||
/// <param name="dt"></param>
|
||||
public static void Confirm_Person(string OperatorName, out DataTable dt)
|
||||
{
|
||||
string sql = "SELECT COUNT(*) FROM [dbo].[MES_用户管理_人员] WHERE [用户名]='" + OperatorName + "'";
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
string errorMessage;
|
||||
dt = null;
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
}
|
||||
/// <summary>
|
||||
/// AMES_物料拉动_生产计划_派工订单_查询_根据订单
|
||||
/// </summary>
|
||||
/// <param name="orderNum"></param>
|
||||
/// <param name="dt"></param>
|
||||
public static void Init_Ordernum_data(string orderNum, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "AMES_物料拉动_生产计划_派工订单_查询_根据订单";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[1];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@订单号", orderNum);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
}
|
||||
|
||||
public static void ClassCode_Select(string ClassName, out DataTable dt)
|
||||
{
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
string errorMessage;
|
||||
string sql;
|
||||
sql = "SELECT top 1 班次代码 FROM AMES_物料拉动_人员班组管理_班次信息 WHERE [班次描述]='" + ClassName + "'";
|
||||
dt = null;
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
}
|
||||
|
||||
public static bool Workinghours_Insert(string OrderNum, string EngineType, string Opname, int Count, string OperatorName, string Classes, string UploadTime)
|
||||
{
|
||||
string procedureName = "AMES_物料拉动_测量数据发动机在线状态_跟踪发动机条码状态_工时补报_增加";
|
||||
//string connectionString = ApplicationConfig.ConnectionString_MES;
|
||||
string errorMessage;
|
||||
bool isOK;
|
||||
SqlParameter[] sqlParameters = new SqlParameter[7];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@订单号", OrderNum);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@发动机型号", EngineType);
|
||||
sqlParameters[2] = new System.Data.SqlClient.SqlParameter("@工位号", Opname);
|
||||
sqlParameters[3] = new System.Data.SqlClient.SqlParameter("@报工数量", Count);
|
||||
sqlParameters[4] = new System.Data.SqlClient.SqlParameter("@操作者工号", OperatorName);
|
||||
sqlParameters[5] = new System.Data.SqlClient.SqlParameter("@班次", Classes);
|
||||
sqlParameters[6] = new System.Data.SqlClient.SqlParameter("@报工时间", UploadTime);
|
||||
isOK = DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters);
|
||||
if (isOK)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 物料拉动工位库存查询
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="itemCode"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static void getWorkStationMaterialInfo(string opName, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "AMES_电子看板_装配零件_库存信息_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[1];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
748
Common/07WebBusinessFacade/BusinessFacade/Web/MES.cs
Normal file
748
Common/07WebBusinessFacade/BusinessFacade/Web/MES.cs
Normal file
@@ -0,0 +1,748 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using DataLinkMesWork;
|
||||
using System.Security.Cryptography;
|
||||
//using SystemFramework;
|
||||
|
||||
namespace bizFacade
|
||||
{
|
||||
public partial class MES
|
||||
{
|
||||
/// <summary>
|
||||
///电子看板_发动机号_合格放行_记录_增加
|
||||
/// </summary>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static bool InsertRecord_ComfirmOkGO(string opName, string userName, string type)
|
||||
{
|
||||
string procedureName = "电子看板_发动机号_合格放行_记录_增加";
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
string errorMessage;
|
||||
SqlParameter[] sqlParameters = new SqlParameter[3];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
sqlParameters[0].Direction = ParameterDirection.Input;
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@放行者工号", userName);
|
||||
sqlParameters[1].Direction = ParameterDirection.Input;
|
||||
sqlParameters[2] = new System.Data.SqlClient.SqlParameter("@放行类别", type);
|
||||
sqlParameters[2].Direction = ParameterDirection.Input;
|
||||
bool isOK;
|
||||
isOK = DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters);
|
||||
if (isOK)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 操作指南-手动转线-增加
|
||||
/// </summary>
|
||||
/// <param name="opname"></param>
|
||||
/// <param name="Cbx_ManualTurnLine"></param>
|
||||
/// <returns></returns>
|
||||
public static bool ManualTurnLine_Insert(string opname, int Cbx_ManualTurnLine)
|
||||
{
|
||||
|
||||
string procedureName = "测量数据工位_监控系统_手动转线_增加";
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
string errorMessage;
|
||||
SqlParameter[] sqlParameters = new SqlParameter[2];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
sqlParameters[0].Direction = ParameterDirection.Input;
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@是否启用转线", Cbx_ManualTurnLine);
|
||||
sqlParameters[1].Direction = ParameterDirection.Input;
|
||||
bool isOK;
|
||||
isOK = DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters);
|
||||
if (isOK)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 操作指南-离线返修-增加
|
||||
/// </summary>
|
||||
/// <param name="opname"></param>
|
||||
/// <param name="Cbx_ManualTurnLine"></param>
|
||||
/// <returns></returns>
|
||||
public static bool OutLineRepair_Insert(string opname, int Cbx_OutLineRepair)
|
||||
{
|
||||
|
||||
string procedureName = "测量数据工位_监控系统_离线返修_增加";
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
string errorMessage;
|
||||
SqlParameter[] sqlParameters = new SqlParameter[2];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
sqlParameters[0].Direction = ParameterDirection.Input;
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@离线返修", Cbx_OutLineRepair);
|
||||
sqlParameters[1].Direction = ParameterDirection.Input;
|
||||
bool isOK;
|
||||
isOK = DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters);
|
||||
if (isOK)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 显示测量数据_工位号_根据发动机型号_查询
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="engineID"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
static public bool QualityDataSelect_engineID(string opName, string engineID, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "显示测量数据_工位号_根据发动机型号_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[2];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@发动机号", engineID);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
}
|
||||
/// <summary>
|
||||
/// StudentSelect
|
||||
/// </summary>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static bool getopname(string opname, out DataTable dt)
|
||||
{
|
||||
string procedureName = "MES_计划BOM_工位与名称_查询_根据工位号";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[1];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 排产计划_查询计划
|
||||
/// </summary>
|
||||
/// <param name="opname"></param>
|
||||
/// <param name="selectDate"></param>
|
||||
/// <param name="tb"></param>
|
||||
/// <returns></returns>
|
||||
public static bool GetPlan(string opname,string selectDate, out DataTable tb)
|
||||
{
|
||||
string procedureName = "排产计划_查询计划";
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
DataSet ds;
|
||||
string errorMessage;
|
||||
bool isOK;
|
||||
tb = null;
|
||||
SqlParameter[] sqlParameters = new SqlParameter[2];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@转生产订单日期", selectDate);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
isOK = DataAccess.ExecuteStoredProcedure(procedureName,ref sqlParameters, out ds);
|
||||
if (isOK)
|
||||
{
|
||||
if (ds.Tables.Count > 0)
|
||||
{
|
||||
tb = ds.Tables[0];
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// [电子看板_发动机号_线首工位_分线订单主表_数据_查询]
|
||||
/// </summary>
|
||||
/// <param name="opname"></param>
|
||||
/// <param name="selectDate"></param>
|
||||
/// <param name="tb"></param>
|
||||
/// <returns></returns>
|
||||
public static bool GetPlan_Cap(string opname, out DataTable tb)
|
||||
{
|
||||
string procedureName = "电子看板_发动机号_线首工位_分线订单主表_数据_查询";
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
DataSet ds;
|
||||
string errorMessage;
|
||||
bool isOK;
|
||||
tb = null;
|
||||
SqlParameter[] sqlParameters = new SqlParameter[1];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
isOK = DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out ds);
|
||||
if (isOK)
|
||||
{
|
||||
if (ds.Tables.Count > 0)
|
||||
{
|
||||
tb = ds.Tables[0];
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 电子看板_发动机号_工位队列表_查询_根据工位号(数据源工位) 20140709 wt
|
||||
/// </summary>
|
||||
/// <param name="opname"></param>
|
||||
/// <param name="tb"></param>
|
||||
/// <returns></returns>
|
||||
public static bool GetQueue(string opname, out DataTable tb)
|
||||
{
|
||||
string procedureName = "电子看板_发动机号_工位队列表_查询_根据工位号";
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
DataSet ds;
|
||||
string errorMessage;
|
||||
bool isOK;
|
||||
tb = null;
|
||||
SqlParameter[] sqlParameters = new SqlParameter[1];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@数据源工位", opname);
|
||||
isOK = DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out ds);
|
||||
if (isOK)
|
||||
{
|
||||
if (ds.Tables.Count > 0)
|
||||
{
|
||||
tb = ds.Tables[0];
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 电子看板_发动机号_工位队列表_增加 20140709 wt ClearQueue
|
||||
/// </summary>
|
||||
/// <param name="opname"></param>
|
||||
/// <param name="engineId"></param>
|
||||
/// <param name="tb"></param>
|
||||
/// <returns></returns>
|
||||
public static bool InsertQueue(string opname, string engineId)
|
||||
{
|
||||
|
||||
string procedureName = "电子看板_发动机号_工位队列表_增加";
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
string errorMessage;
|
||||
SqlParameter[] sqlParameters = new SqlParameter[2];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@数据源工位", opname);
|
||||
sqlParameters[0].Direction = ParameterDirection.Input;
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@发动机号", engineId);
|
||||
sqlParameters[1].Direction = ParameterDirection.Input;
|
||||
bool isOK;
|
||||
isOK = DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters);
|
||||
if (isOK)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 电子看板_发动机号_工位队列表_清空 20140709 wt
|
||||
/// </summary>
|
||||
/// <param name="opname"></param>
|
||||
/// <param name="engineId"></param>
|
||||
/// <param name="tb"></param>
|
||||
/// <returns></returns>
|
||||
//public static bool ClearQueue()
|
||||
//{
|
||||
|
||||
// string procedureName = "电子看板_发动机号_工位队列表_清空";
|
||||
// //string connectionString = ApplicationConfig.ConnectionString;
|
||||
// string errorMessage;
|
||||
// bool isOK;
|
||||
// isOK = DataAccess.ExecuteNonQuery(procedureName);
|
||||
// if (isOK)
|
||||
// {
|
||||
// return true;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// return false;
|
||||
// }
|
||||
//}
|
||||
/// <summary>
|
||||
/// 测量数据合格_查询_WEB页面显示 20140622 wt
|
||||
/// </summary>
|
||||
/// <param name="opname"></param>
|
||||
/// <param name="selectDate"></param>
|
||||
/// <param name="tb"></param>
|
||||
/// <returns></returns>
|
||||
public static bool GetCurrentQuality_Select(string engineID,string opname, out DataTable tb)
|
||||
{
|
||||
string procedureName = "测量数据合格_查询_WEB页面显示";
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
DataSet ds;
|
||||
string errorMessage;
|
||||
bool isOK;
|
||||
tb = null;
|
||||
SqlParameter[] sqlParameters = new SqlParameter[2];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@发动机号", engineID);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
isOK = DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out ds);
|
||||
if (isOK)
|
||||
{
|
||||
if (ds.Tables.Count > 0)
|
||||
{
|
||||
tb = ds.Tables[0];
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
///// <summary>
|
||||
///// WEB查询按钮的信息 20140625 wt
|
||||
///// </summary>
|
||||
///// <param name="tb"></param>
|
||||
///// <returns></returns>
|
||||
//public static bool OpnameSelect_Buttons(out DataTable tb)
|
||||
//{
|
||||
// string procedureName = "WEB_质量查询模块_按钮基础信息_查询";
|
||||
// //string connectionString = ApplicationConfig.ConnectionString;
|
||||
// DataSet ds;
|
||||
// string errorMessage;
|
||||
// bool isOK;
|
||||
|
||||
// isOK = DataAccess.ExecuteStoredProcedure(procedureName, out ds);
|
||||
// if (isOK)
|
||||
// {
|
||||
// tb = ds.Tables[0];
|
||||
// return true;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// tb = null;
|
||||
// return false;
|
||||
// }
|
||||
|
||||
//}
|
||||
/// <summary>
|
||||
/// WEB_安东模块_物料原因按钮基础信息_查询 20140707 wt
|
||||
/// </summary>
|
||||
/// <param name="opname"></param>
|
||||
/// <param name="engineId"></param>
|
||||
/// <param name="tb"></param>
|
||||
/// <returns></returns>
|
||||
public static bool MaterialProblemButtons_Select(string opname, string engineId, out DataTable tb)
|
||||
{
|
||||
|
||||
string procedureName = "WEB_安东模块_物料原因按钮基础信息_查询";
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
string errorMessage;
|
||||
bool isOK;
|
||||
SqlParameter[] sqlParameters = new SqlParameter[2];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@发动机号", engineId);
|
||||
DataSet ds;
|
||||
isOK = DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out ds);
|
||||
if (isOK)
|
||||
{
|
||||
tb = ds.Tables[0];
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
tb = null;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// WEB_安东模块_物料ANDON信息_插入 20140708 wt
|
||||
/// </summary>
|
||||
/// <param name="opname"></param>
|
||||
/// <param name="engineId"></param>
|
||||
/// <param name="tb"></param>
|
||||
/// <returns></returns>
|
||||
public static bool MaterialProblemButtons_Insert(string opname, string materialname)
|
||||
{
|
||||
|
||||
string procedureName = "WEB_安东模块_物料ANDON信息_插入";
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
string errorMessage;
|
||||
SqlParameter[] sqlParameters = new SqlParameter[2];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
sqlParameters[0].Direction = ParameterDirection.Input;
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@物料描述", materialname);
|
||||
sqlParameters[1].Direction = ParameterDirection.Input;
|
||||
bool isOK;
|
||||
isOK = DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters);
|
||||
if (isOK)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// WEB根据工位名称和发动机号查询质量数据 20140625 wt
|
||||
/// </summary>
|
||||
/// <param name="opname"></param>
|
||||
/// <param name="engineId"></param>
|
||||
/// <param name="tb"></param>
|
||||
/// <returns></returns>
|
||||
public static bool QualityData_Select(string opname, string engineId, out DataTable tb)
|
||||
{
|
||||
|
||||
string procedureName = "WEB_质量查询模块_测量数据合格_查询";
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
string errorMessage;
|
||||
bool isOK;
|
||||
SqlParameter[] sqlParameters = new SqlParameter[2];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@发动机号", engineId);
|
||||
DataSet ds;
|
||||
isOK = DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out ds);
|
||||
if (isOK)
|
||||
{
|
||||
tb = ds.Tables[0];
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
tb = null;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// WEB根据工位名称和发动机号查询质量数据合格索引(包括了分线的信息、存储过程中根据工位类型区分) 20140626 wt
|
||||
/// </summary>
|
||||
/// <param name="opname"></param>
|
||||
/// <param name="engineId"></param>
|
||||
/// <param name="tb"></param>
|
||||
/// <returns></returns>
|
||||
public static bool QualityDataButton_bgColor_Select(string opname, out DataTable dt)
|
||||
{
|
||||
string procedureName = "显示测量数据_工位号_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[1];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// MES界面显示_弹窗消息_查询
|
||||
/// </summary>
|
||||
/// <param name="opname"></param>
|
||||
/// <param name="tb"></param>
|
||||
/// <returns></returns>
|
||||
public static bool ShowWindowNotice(string opname, out DataTable dt)
|
||||
{
|
||||
string procedureName = "MES界面显示_弹窗消息_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[1];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// MES界面显示_消息滚动_查询
|
||||
/// </summary>
|
||||
/// <param name="opname"></param>
|
||||
/// <param name="tb"></param>
|
||||
/// <returns></returns>
|
||||
public static bool ShowLEDNotice(string opname, out DataTable dt)
|
||||
{
|
||||
string procedureName = "MES界面显示_消息滚动_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[1];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 上线临时表插入数据 20140609 通过页面直接插入数据库
|
||||
/// </summary>
|
||||
/// <param name="opName">工位号</param>
|
||||
/// <param name="engineID">发动机号</param>
|
||||
static public bool SubOnLoadTemp_Insert(string opName, string orderNum, string engineType, string sublineOrderID, out DataTable tb)
|
||||
{
|
||||
string procedureName = "电子看板_发动机号_上线临时表_增加";
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
DataSet ds;
|
||||
string errorMessage;
|
||||
bool isOK;
|
||||
tb = null;
|
||||
SqlParameter[] sqlParameters = new SqlParameter[4];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@订单号", orderNum);
|
||||
sqlParameters[2] = new System.Data.SqlClient.SqlParameter("@发动机型号", engineType);
|
||||
sqlParameters[3] = new System.Data.SqlClient.SqlParameter("@分线主表数据ID", Convert.ToInt32(sublineOrderID));
|
||||
isOK = DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out ds);
|
||||
if (isOK)
|
||||
{
|
||||
if (ds.Tables.Count > 0)
|
||||
{
|
||||
tb = ds.Tables[0];
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// [电子看板_发动机号_线首工位_查询_根据发动机号和工位号] 20140604 王可心
|
||||
/// </summary>
|
||||
/// <param name="engineID"></param>
|
||||
/// <param name="opName"></param>
|
||||
static public bool GetEngineIDOpName_Select(string engineID, string opName, out DataTable dt)
|
||||
{
|
||||
string errorMessage = "";
|
||||
DataSet ds;
|
||||
bool isOK;
|
||||
dt = null;
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
string procedureName;
|
||||
procedureName = "电子看板_发动机号_线首工位_查询_根据发动机号和工位号";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@发动机号", engineID);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
isOK= DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out ds);
|
||||
if (isOK)
|
||||
{
|
||||
if (ds.Tables.Count > 0)
|
||||
{
|
||||
dt = ds.Tables[0];
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 电子看板_工序内容_查询
|
||||
/// </summary>
|
||||
/// <param name="opName">工位号</param>
|
||||
/// <param name="engineTypeID">产品型号代码</param>
|
||||
/// <param name="dt"></param>
|
||||
static public void Process_Select(string opName, int engineTypeID, out DataTable dt)
|
||||
{
|
||||
dt = null;
|
||||
string sql = "exec 电子看板_工序内容_查询 '" + opName + "'," + engineTypeID.ToString();
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 电子看板_装配零件_物料验证_查询 20131231
|
||||
/// </summary>
|
||||
/// <param name="opName">工位号</param>
|
||||
/// <param name="engineID">发动机号</param>
|
||||
/// <param name="dt"></param>
|
||||
static public bool PartMaterialVerify_Select(string opName, out DataTable dt)
|
||||
{
|
||||
string errorMessage = "";
|
||||
DataSet ds;
|
||||
dt = null;
|
||||
bool isOK;
|
||||
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
|
||||
string procedureName;
|
||||
procedureName = "电子看板_装配零件_物料验证_查询";
|
||||
SqlParameter[] thisParms = new SqlParameter[1];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
//thisParms[1] = new System.Data.SqlClient.SqlParameter("@发动机号", engineID);
|
||||
|
||||
isOK= DataAccess.ExecuteStoredProcedure(procedureName, ref thisParms, out ds);
|
||||
if (isOK)
|
||||
{
|
||||
if (ds.Tables.Count > 0)
|
||||
{
|
||||
dt = ds.Tables[0];
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设备管理_设备维护内容_查询
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="MachineType"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>ShowMaintainPic
|
||||
static public bool LoadMachineType(string opName,out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "设备管理_设备维护初始化_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[1];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设备管理_设备维护内容_查询
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="MachineType"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>ShowMaintainPic
|
||||
static public bool ShowMaintainData(string opName, string MachineType, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "设备管理_设备维护内容_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[2];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@保养类型代码", MachineType);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设备管理_设备维护图片_查询
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="MachineType"></param>
|
||||
/// <param name="pic"></param>
|
||||
static public void GetMaintainImageFile(string opName, string MachineType, out byte[] pic)
|
||||
{
|
||||
string sql;
|
||||
DataTable dt;
|
||||
pic = null;
|
||||
sql = "exec 设备管理_设备维护图片_查询 '" + opName + "'," + MachineType;
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
if (dt != null)
|
||||
{
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
pic = (byte[])dt.Rows[0]["保养图片"];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 显示测量数据_工位数据_查询
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="opname"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
static public bool QualityDataSelect(string opName, string opname, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "显示测量数据_工位数据_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[2];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@查询工位号", opname);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 显示物料数据_工位数据_查询
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="opname"></param>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
static public bool MaterialDataSelect(string opName, string opname, out DataTable dt)
|
||||
{
|
||||
string procedureName;
|
||||
procedureName = "显示物料数据_工位数据_查询";
|
||||
SqlParameter[] sqlParameters = new SqlParameter[2];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@查询工位号", opname);
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out dt);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 操作指南-
|
||||
/// </summary>
|
||||
/// <param name="opName">工位号</param>
|
||||
/// <param name="IsNormalOrRepair">是否启用备用模式</param>
|
||||
/// <returns></returns>
|
||||
public static bool Assembel_RadioNormal_Insert(string opName, int IsNormalOrRepair)
|
||||
{
|
||||
string produceName = "测量数据工位_监控系统_拧紧与返修拧紧_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@是否启用备用模式", IsNormalOrRepair);
|
||||
return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
|
||||
}
|
||||
/// <summary>
|
||||
/// 测量数据工位_监控系统_返修上下线_上线_增加
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="upLine"></param>
|
||||
/// <returns></returns>
|
||||
public static bool AssembelRadioNormalWork_Insert(string opName, int upLine)
|
||||
{
|
||||
string produceName = "测量数据工位_监控系统_返修上下线_上线_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@是否启用备用模式", upLine);
|
||||
return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
|
||||
}
|
||||
/// <summary>
|
||||
/// 启用拧紧_初始化
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="tb"></param>
|
||||
public static void cbx_BakOpNameIsWorkStatus_Select(string opName, out DataTable tb)
|
||||
{
|
||||
string sql = "SELECT [是否启用备用模式] FROM [dbo].[测量数据工位_监控系统_拧紧与返修拧紧] WHERE [工位号]='" + opName + "'";
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
string errorMessage;
|
||||
tb = null;
|
||||
DataAccess.ExecuteDataTable(sql, out tb);
|
||||
}
|
||||
}
|
||||
}
|
||||
99
Common/07WebBusinessFacade/BusinessFacade/Web/MES_Loading.cs
Normal file
99
Common/07WebBusinessFacade/BusinessFacade/Web/MES_Loading.cs
Normal file
@@ -0,0 +1,99 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using DataLinkMesWork;
|
||||
using System.Security.Cryptography;
|
||||
//using SystemFramework;
|
||||
|
||||
namespace bizFacade
|
||||
{
|
||||
public class MES_Loading
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="dt"></param>
|
||||
static public void MES_LoadingOPName(string opName, out DataTable dt)
|
||||
{
|
||||
string sql;
|
||||
sql = " select 线外工位号 as opname from [dbo].[线外工位验证] where 工位号='"+opName+"'";
|
||||
DataAccess.ExecuteDataTable(sql, out dt);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// MES_界面显示_标签语言_视图_查询
|
||||
/// </summary>
|
||||
/// <param name="mainModule">主模块代码</param>
|
||||
/// <param name="MesWebCode">MesWebCode</param>
|
||||
/// <param name="工位号">opName</param>
|
||||
/// <param name="tb"></param>
|
||||
public static void MES_Loading_select(string mainModule, string MesWebCode,string opName, out DataTable tb)
|
||||
{
|
||||
string procedureName = "MES_界面显示_标签语言_视图_查询";
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
DataSet ds;
|
||||
string errorMessage;
|
||||
bool isOK;
|
||||
SqlParameter[] sqlParameters = new SqlParameter[3];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@主模块代码", mainModule);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@MesWebCode", MesWebCode);
|
||||
sqlParameters[2] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
isOK = DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out ds);
|
||||
if (isOK)
|
||||
{
|
||||
tb = ds.Tables[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
tb = null;
|
||||
}
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 测量数据工位_监控系统_操作者工号_增加
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="userNum"></param>
|
||||
/// <returns></returns>
|
||||
public static bool MES_Loading_Insert(string opName,string userNum)
|
||||
{
|
||||
string produceName = "测量数据工位_监控系统_操作者工号_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@操作者工号", userNum);
|
||||
return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 测量数据合格_查询
|
||||
/// </summary>
|
||||
/// <param name="opname"></param>
|
||||
/// <param name="engineid"></param>
|
||||
/// <param name="tb"></param>
|
||||
public static void initImage(string opname, string engineid, out DataTable tb)
|
||||
{
|
||||
string procedureName = "测量数据合格_查询";
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
DataSet ds;
|
||||
string errorMessage;
|
||||
bool isOK;
|
||||
SqlParameter[] sqlParameters = new SqlParameter[2];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@发动机号", engineid);
|
||||
isOK = DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out ds);
|
||||
if (isOK)
|
||||
{
|
||||
tb = ds.Tables[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
tb = null;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using DataLinkMesWork;
|
||||
using System.Security.Cryptography;
|
||||
//using SystemFramework;
|
||||
|
||||
namespace bizFacade
|
||||
{
|
||||
public class MES_MachineManage
|
||||
{
|
||||
/// <summary>
|
||||
/// [设备管理_设备维护记录表_增加]
|
||||
/// </summary>
|
||||
/// <param name="opName">工位号</param>
|
||||
/// <param name="beizhu">备注</param>
|
||||
/// <returns></returns>
|
||||
public static bool Mes_MachineTakeCare_Insert(string opName, string mark)
|
||||
{
|
||||
string produceName = "设备管理_设备维护记录表_增加";
|
||||
SqlParameter[] thisParms = new SqlParameter[2];
|
||||
thisParms[0] = new System.Data.SqlClient.SqlParameter("@工位号", opName);
|
||||
thisParms[1] = new System.Data.SqlClient.SqlParameter("@备注", mark);
|
||||
return DataAccess.ExecuteStoredProcedure(produceName, ref thisParms);
|
||||
}
|
||||
}
|
||||
}
|
||||
67
Common/07WebBusinessFacade/BusinessFacade/Web/ando_load.cs
Normal file
67
Common/07WebBusinessFacade/BusinessFacade/Web/ando_load.cs
Normal file
@@ -0,0 +1,67 @@
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using DataLinkMesWork;
|
||||
using System.Security.Cryptography;
|
||||
//using SystemFramework;
|
||||
using System.Text;
|
||||
|
||||
namespace bizFacade
|
||||
{
|
||||
public class ando_load
|
||||
{
|
||||
/// <summary>
|
||||
/// 查询ando类型andoTypeSelect
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static bool andoTypeSelect(out DataTable dt)
|
||||
{
|
||||
string procedureName = "ANDON_类型_查询";
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, out dt);
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static bool andoDetailCount(out DataTable dt)
|
||||
{
|
||||
string procedureName = "ANDON_类型_查询";
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, out dt);
|
||||
}
|
||||
/// <summary>
|
||||
/// 初始化ando界面
|
||||
/// </summary>
|
||||
public static string ando_loading(string opname)
|
||||
{
|
||||
System.Data.DataTable dt;
|
||||
dt=null;
|
||||
andoTypeSelect(out dt);
|
||||
string responsetext="";
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
for(int i=0;i<dt.Rows.Count;i++)
|
||||
{
|
||||
string andoTypeCode = dt.Rows[i]["安东类型代码"].ToString();
|
||||
switch (andoTypeCode)
|
||||
{
|
||||
case "1":
|
||||
responsetext = ando_matertial.CreateAndo_Material(opname, "1");
|
||||
sb.Append(responsetext);
|
||||
break;
|
||||
case "2":
|
||||
responsetext = ando_quality.CreateAndo_quality(opname, "2");
|
||||
sb.Append(responsetext);
|
||||
break;
|
||||
case "3":
|
||||
responsetext = ando_machine.CreateAndo_Machine(opname, "3");
|
||||
sb.Append(responsetext);
|
||||
break;
|
||||
case "4":
|
||||
//sb.Append(responsetext);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return sb.ToString();;
|
||||
}
|
||||
}
|
||||
}
|
||||
67
Common/07WebBusinessFacade/BusinessFacade/Web/ando_load_2.cs
Normal file
67
Common/07WebBusinessFacade/BusinessFacade/Web/ando_load_2.cs
Normal file
@@ -0,0 +1,67 @@
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using DataLinkMesWork;
|
||||
using System.Security.Cryptography;
|
||||
//using SystemFramework;
|
||||
using System.Text;
|
||||
|
||||
namespace bizFacade
|
||||
{
|
||||
public class ando_load_2
|
||||
{
|
||||
/// <summary>
|
||||
/// 查询ando类型andoTypeSelect
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static bool andoTypeSelect(out DataTable dt)
|
||||
{
|
||||
string procedureName = "ANDON_类型_查询";
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, out dt);
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static bool andoDetailCount(out DataTable dt)
|
||||
{
|
||||
string procedureName = "ANDON_类型_查询";
|
||||
return DataAccess.ExecuteStoredProcedure(procedureName, out dt);
|
||||
}
|
||||
/// <summary>
|
||||
/// 初始化ando界面
|
||||
/// </summary>
|
||||
public static string ando_loading(string opname)
|
||||
{
|
||||
System.Data.DataTable dt;
|
||||
dt=null;
|
||||
andoTypeSelect(out dt);
|
||||
string responsetext="";
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
for(int i=0;i<dt.Rows.Count;i++)
|
||||
{
|
||||
string andoTypeCode = dt.Rows[i]["安东类型代码"].ToString();
|
||||
switch (andoTypeCode)
|
||||
{
|
||||
case "1":
|
||||
responsetext = ando_matertial_2.CreateAndo_Material(opname, "1");
|
||||
sb.Append(responsetext);
|
||||
break;
|
||||
case "2":
|
||||
responsetext = ando_quality_2.CreateAndo_quality(opname, "2");
|
||||
sb.Append(responsetext);
|
||||
break;
|
||||
case "3":
|
||||
responsetext = ando_machine_2.CreateAndo_Machine(opname, "3");
|
||||
sb.Append(responsetext);
|
||||
break;
|
||||
case "4":
|
||||
//sb.Append(responsetext);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return sb.ToString();;
|
||||
}
|
||||
}
|
||||
}
|
||||
225
Common/07WebBusinessFacade/BusinessFacade/Web/ando_machine.cs
Normal file
225
Common/07WebBusinessFacade/BusinessFacade/Web/ando_machine.cs
Normal file
@@ -0,0 +1,225 @@
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using DataLinkMesWork;
|
||||
using System.Security.Cryptography;
|
||||
//using SystemFramework;
|
||||
using System.Text;
|
||||
using System;
|
||||
|
||||
namespace bizFacade
|
||||
{
|
||||
public class ando_machine
|
||||
{
|
||||
/// <summary>
|
||||
/// 创建质量ando
|
||||
/// </summary>
|
||||
/// <param name="opname"></param>
|
||||
/// <param name="AndoTypeCode"></param>
|
||||
/// <returns></returns>
|
||||
public static string CreateAndo_Machine(string opname, string AndoTypeCode)
|
||||
{
|
||||
System.Data.DataTable dt_list;
|
||||
//查询ando明细
|
||||
ando_matertial.andoListSelect(opname, AndoTypeCode, out dt_list);
|
||||
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.Append("<div id=\"div_ando_third_main\" class=\"div_ando_third_main\">");
|
||||
sb.Append("<div id=\"div_ando_third\" class=\"div_ando_third\">");
|
||||
sb.Append("<div style=\"width:96%;height:82%;margin-left:10px;margin-top:12px;\">");
|
||||
|
||||
#region 大图片的div
|
||||
sb.Append("<div style=\"width:8%;height:100%;float:left;\">");
|
||||
sb.Append("<img alt=\"loading....\" src=\"../images/ando_machine.png\" width=\"92%\" height=\"100%\" />");
|
||||
sb.Append("</div>");
|
||||
#endregion
|
||||
|
||||
#region 整个ANDON选项DIV
|
||||
sb.Append("<div style=\"width:70%;height:100%;float:left;\">");
|
||||
|
||||
#region 左按钮DIV
|
||||
sb.Append("<div style=\"width:10%;height:100%;float:left;\">");
|
||||
sb.Append("<input type=\"button\" style=\"width:100%;height:100%;text-align:center;font-size:30px;\" value=\"<<\" onclick=\"machine_RightMove()\" />");
|
||||
sb.Append("</div>");
|
||||
#endregion
|
||||
|
||||
|
||||
#region 中间内容DIV
|
||||
sb.Append("<div style=\"width:80%;height:100%;float:left;\">");
|
||||
|
||||
#region 可支持移动的div
|
||||
|
||||
sb.Append("<div style=\"width:100%;height:100%; overflow:hidden;position:relative;\">");
|
||||
|
||||
sb.Append("<div id=\"div_machine_Scroll\" style=\"width:100%;height:100%; position:relative;\">");
|
||||
|
||||
|
||||
//附加tabel
|
||||
string tabelString = CreatAndo_machine_table(opname, AndoTypeCode);
|
||||
sb.Append(tabelString);
|
||||
|
||||
sb.Append("</div>");
|
||||
sb.Append("</div>");
|
||||
#endregion
|
||||
|
||||
sb.Append("</div>");
|
||||
#endregion
|
||||
|
||||
#region 右按钮div
|
||||
|
||||
sb.Append("<div style=\"width:10%;height:100%;float:left;\">");
|
||||
|
||||
sb.Append("<input type=\"button\" style=\"width:100%;height:100%;text-align:center;font-size:30px;\" value=\">>\" onclick=\"machine_leftMove()\" />");
|
||||
sb.Append("</div>");
|
||||
|
||||
#endregion
|
||||
|
||||
sb.Append("</div>");
|
||||
#endregion
|
||||
#region ando按钮div
|
||||
|
||||
sb.Append("<div style=\"width:22%;height:100%;float:left;\">");
|
||||
|
||||
sb.Append("<div style=\"width: 100%; height: 100%; margin: 30px 0px 0px -5px;\">");
|
||||
|
||||
sb.Append("<table style=\"width: 100%;\">");
|
||||
sb.Append("<tr>");
|
||||
sb.Append("<td align=\"left\">");
|
||||
sb.Append("<img onclick=\"andon_machine_call_down('m_machine_call')\" alt=\"loading...\" id='m_machine_call' src=\"../images/call.png\" style=\"width: 100px; height: 80px\"/>");
|
||||
sb.Append("</td>");
|
||||
sb.Append("<td align=\"right\">");
|
||||
sb.Append("<img onclick=\"andon_machine_reset_down('m_machine_reset')\" alt=\"loading...\" id='m_machine_reset' src=\"../images/reset.png\" style=\"width: 100px;height: 80px\" />");
|
||||
sb.Append("</td>");
|
||||
sb.Append("</tr>");
|
||||
sb.Append("<tr>");
|
||||
sb.Append("<td style=\"padding-top: 20px\" align=\"center\">");
|
||||
sb.Append("<label style=\"padding-top: 20px;font-size:18px;\">呼 叫</label>");
|
||||
sb.Append("</td>");
|
||||
sb.Append("<td style=\"padding-top: 20px\" align=\"center\">");
|
||||
sb.Append("<label style=\"padding-top: 20px;font-size:18px;\">复 位</label>");
|
||||
sb.Append("</td>");
|
||||
sb.Append("</tr>");
|
||||
sb.Append("</table>");
|
||||
|
||||
sb.Append("</div>");
|
||||
|
||||
sb.Append("</div>");
|
||||
|
||||
#endregion
|
||||
|
||||
sb.Append("</div></div></div>");
|
||||
|
||||
|
||||
return sb.ToString();
|
||||
//string text = "";
|
||||
//int count = dt_list.Rows.Count/2*120;
|
||||
//return text = "{\"InnerHtml\":\"" + sb.ToString() + "\",\"Count\":\"" + count + "\"}";
|
||||
}
|
||||
/// <summary>
|
||||
/// 创建物料ando的table
|
||||
/// </summary>
|
||||
/// <param name="opname"></param>
|
||||
/// <param name="AndoTypeCode"></param>
|
||||
/// <returns></returns>
|
||||
public static string CreatAndo_machine_table(string opname, string AndoTypeCode)
|
||||
{
|
||||
System.Data.DataTable dt_list;
|
||||
//查询ando明细
|
||||
ando_matertial.andoListSelect(opname, AndoTypeCode, out dt_list);
|
||||
StringBuilder sb = new StringBuilder();
|
||||
int tableCount = dt_list.Rows.Count;
|
||||
int td_count = (tableCount / 2) + (tableCount % 2);//获取每个tr中应该创建多少个td
|
||||
int tablewidth = 145 * td_count;
|
||||
if (tablewidth == 0)
|
||||
{
|
||||
tablewidth = 10;
|
||||
}
|
||||
string tablewidth2 = Convert.ToString(tablewidth) + "px";
|
||||
|
||||
#region table
|
||||
|
||||
sb.Append("<table id=\"table_machine_Scroll\" style=\"width:" + tablewidth2 + ";height:100%;left:0px;\">");
|
||||
|
||||
//创建第一行
|
||||
sb.Append("<tr>");
|
||||
for (int i = 0; i < td_count; i++)
|
||||
{
|
||||
#region 第一行按钮
|
||||
sb.Append("<td style=\"height:50%;width:145px;\">");
|
||||
//标签id
|
||||
string id = "button_ando_machine_" + dt_list.Rows[i]["编号"].ToString();
|
||||
|
||||
#region 颜色代码
|
||||
//标签值
|
||||
string value = dt_list.Rows[i]["编号描述2"].ToString();
|
||||
string color = dt_list.Rows[i]["颜色代码"].ToString();
|
||||
//string inputColor = "background-color:" + color + "";
|
||||
if (color == "0")
|
||||
{
|
||||
sb.Append("<input type=\"button\" onclick=\"andon_machine(id)\" id=\"" + id + "\" value=\"" + value + "\" style=\"width: 140px; height:100%;\"/>");
|
||||
}
|
||||
if (color == "1")
|
||||
{
|
||||
sb.Append("<input type=\"button\" onclick=\"andon_machine(id)\" id=\"" + id + "\" value=\"" + value + "\" style=\"width: 140px; height:100%;background-color:pink;\"/>");
|
||||
}
|
||||
if (color == "2")
|
||||
{
|
||||
sb.Append("<input type=\"button\" onclick=\"andon_machine(id)\" id=\"" + id + "\" value=\"" + value + "\" style=\"width: 140px; height:100%;background-color:yellow;\"/>");
|
||||
}
|
||||
#endregion
|
||||
|
||||
sb.Append("</td>");
|
||||
|
||||
#endregion
|
||||
}
|
||||
sb.Append("</tr>");
|
||||
|
||||
|
||||
//创建第二行
|
||||
sb.Append("<tr>");
|
||||
for (int i = td_count; i < tableCount; i++)
|
||||
{
|
||||
#region 第二行按钮
|
||||
sb.Append("<td style=\"height:50%;width:145px;\">");
|
||||
//标签id
|
||||
string id = "button_ando_machine_" + dt_list.Rows[i]["编号"].ToString();
|
||||
|
||||
#region 颜色代码
|
||||
//标签值
|
||||
string value = dt_list.Rows[i]["编号描述2"].ToString();
|
||||
string color = dt_list.Rows[i]["颜色代码"].ToString();
|
||||
if (color == "0")
|
||||
{
|
||||
sb.Append("<input type=\"button\" onclick=\"andon_machine(id)\" id=\"" + id + "\" value=\"" + value + "\" style=\"width: 140px; height:100%;\"/>");
|
||||
}
|
||||
if (color == "1")
|
||||
{
|
||||
sb.Append("<input type=\"button\" onclick=\"andon_machine(id)\" id=\"" + id + "\" value=\"" + value + "\" style=\"width: 140px; height:100%;background-color:pink;\"/>");
|
||||
}
|
||||
if (color == "2")
|
||||
{
|
||||
sb.Append("<input type=\"button\" onclick=\"andon_machine(id)\" id=\"" + id + "\" value=\"" + value + "\" style=\"width: 140px; height:100%;background-color:yellow;\"/>");
|
||||
}
|
||||
#endregion
|
||||
|
||||
sb.Append("</td>");
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
//补充第二行的信息
|
||||
if ((tableCount % 2) > 0 && (tableCount > 0))
|
||||
{
|
||||
sb.Append("<td style=\"height:50%\">");
|
||||
sb.Append("</td>");
|
||||
}
|
||||
sb.Append("</tr>");
|
||||
|
||||
//最后组合成table
|
||||
sb.Append("</table>");
|
||||
return sb.ToString();
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
225
Common/07WebBusinessFacade/BusinessFacade/Web/ando_machine_2.cs
Normal file
225
Common/07WebBusinessFacade/BusinessFacade/Web/ando_machine_2.cs
Normal file
@@ -0,0 +1,225 @@
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using DataLinkMesWork;
|
||||
using System.Security.Cryptography;
|
||||
//using SystemFramework;
|
||||
using System.Text;
|
||||
using System;
|
||||
|
||||
namespace bizFacade
|
||||
{
|
||||
public class ando_machine_2
|
||||
{
|
||||
/// <summary>
|
||||
/// 创建质量ando
|
||||
/// </summary>
|
||||
/// <param name="opname"></param>
|
||||
/// <param name="AndoTypeCode"></param>
|
||||
/// <returns></returns>
|
||||
public static string CreateAndo_Machine(string opname, string AndoTypeCode)
|
||||
{
|
||||
System.Data.DataTable dt_list;
|
||||
//查询ando明细
|
||||
ando_matertial.andoListSelect(opname, AndoTypeCode, out dt_list);
|
||||
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.Append("<div id=\"div_ando_third_main\" class=\"div_ando_third_main\">");
|
||||
sb.Append("<div id=\"div_ando_third\" class=\"div_ando_third\">");
|
||||
sb.Append("<div style=\"width:96%;height:82%;margin-left:10px;margin-top:12px;\">");
|
||||
|
||||
#region 大图片的div
|
||||
sb.Append("<div style=\"width:8%;height:100%;float:left;\">");
|
||||
sb.Append("<img alt=\"loading....\" src=\"../images/ando_machine.png\" width=\"92%\" height=\"100%\" />");
|
||||
sb.Append("</div>");
|
||||
#endregion
|
||||
|
||||
#region 整个ANDON选项DIV
|
||||
sb.Append("<div style=\"width:67%;height:100%;float:left;\">");
|
||||
|
||||
#region 左按钮DIV
|
||||
sb.Append("<div style=\"width:10%;height:100%;float:left;\">");
|
||||
sb.Append("<input type=\"button\" style=\"width:100%;height:100%;text-align:center;font-size:30px;\" value=\"<<\" onclick=\"machine_RightMove()\" />");
|
||||
sb.Append("</div>");
|
||||
#endregion
|
||||
|
||||
|
||||
#region 中间内容DIV
|
||||
sb.Append("<div style=\"width:80%;height:100%;float:left;\">");
|
||||
|
||||
#region 可支持移动的div
|
||||
|
||||
sb.Append("<div style=\"width:100%;height:100%; overflow:hidden;position:relative;\">");
|
||||
|
||||
sb.Append("<div id=\"div_machine_Scroll\" style=\"width:100%;height:100%; position:relative;\">");
|
||||
|
||||
|
||||
//附加tabel
|
||||
string tabelString = CreatAndo_machine_table(opname, AndoTypeCode);
|
||||
sb.Append(tabelString);
|
||||
|
||||
sb.Append("</div>");
|
||||
sb.Append("</div>");
|
||||
#endregion
|
||||
|
||||
sb.Append("</div>");
|
||||
#endregion
|
||||
|
||||
#region 右按钮div
|
||||
|
||||
sb.Append("<div style=\"width:10%;height:100%;float:left;\">");
|
||||
|
||||
sb.Append("<input type=\"button\" style=\"width:100%;height:100%;text-align:center;font-size:30px;\" value=\">>\" onclick=\"machine_leftMove()\" />");
|
||||
sb.Append("</div>");
|
||||
|
||||
#endregion
|
||||
|
||||
sb.Append("</div>");
|
||||
#endregion
|
||||
#region ando按钮div
|
||||
|
||||
sb.Append("<div style=\"width:25%;height:100%;float:left;\">");
|
||||
|
||||
sb.Append("<div style=\"width: 100%; height:80%; margin: 20px 0px 0px 5px;\">");
|
||||
|
||||
sb.Append("<table style=\"width: 100%;\">");
|
||||
sb.Append("<tr>");
|
||||
sb.Append("<td align=\"left\">");
|
||||
sb.Append("<img onclick=\"andon_machine_call_down('m_machine_call')\" alt=\"loading...\" id='m_machine_call' src=\"../images/call.png\" style=\"width: 100px; height: 80px\"/>");
|
||||
sb.Append("</td>");
|
||||
sb.Append("<td align=\"right\">");
|
||||
sb.Append("<img onclick=\"andon_machine_reset_down('m_machine_reset')\" alt=\"loading...\" id='m_machine_reset' src=\"../images/reset.png\" style=\"width: 100px;height: 80px\" />");
|
||||
sb.Append("</td>");
|
||||
sb.Append("</tr>");
|
||||
sb.Append("<tr>");
|
||||
sb.Append("<td style=\"padding-top: 20px\" align=\"center\">");
|
||||
sb.Append("<label style=\"padding-top: 20px;font-size:18px;\">呼 叫</label>");
|
||||
sb.Append("</td>");
|
||||
sb.Append("<td style=\"padding-top: 20px\" align=\"center\">");
|
||||
sb.Append("<label style=\"padding-top: 20px;font-size:18px;\">复 位</label>");
|
||||
sb.Append("</td>");
|
||||
sb.Append("</tr>");
|
||||
sb.Append("</table>");
|
||||
|
||||
sb.Append("</div>");
|
||||
|
||||
sb.Append("</div>");
|
||||
|
||||
#endregion
|
||||
|
||||
sb.Append("</div></div></div>");
|
||||
|
||||
|
||||
return sb.ToString();
|
||||
//string text = "";
|
||||
//int count = dt_list.Rows.Count/2*120;
|
||||
//return text = "{\"InnerHtml\":\"" + sb.ToString() + "\",\"Count\":\"" + count + "\"}";
|
||||
}
|
||||
/// <summary>
|
||||
/// 创建物料ando的table
|
||||
/// </summary>
|
||||
/// <param name="opname"></param>
|
||||
/// <param name="AndoTypeCode"></param>
|
||||
/// <returns></returns>
|
||||
public static string CreatAndo_machine_table(string opname, string AndoTypeCode)
|
||||
{
|
||||
System.Data.DataTable dt_list;
|
||||
//查询ando明细
|
||||
ando_matertial.andoListSelect(opname, AndoTypeCode, out dt_list);
|
||||
StringBuilder sb = new StringBuilder();
|
||||
int tableCount = dt_list.Rows.Count;
|
||||
int td_count = (tableCount / 2) + (tableCount % 2);//获取每个tr中应该创建多少个td
|
||||
int tablewidth = 145 * td_count;
|
||||
if (tablewidth == 0)
|
||||
{
|
||||
tablewidth = 10;
|
||||
}
|
||||
string tablewidth2 = Convert.ToString(tablewidth) + "px";
|
||||
|
||||
#region table
|
||||
|
||||
sb.Append("<table id=\"table_machine_Scroll\" style=\"width:" + tablewidth2 + ";height:100%;left:0px;\">");
|
||||
|
||||
//创建第一行
|
||||
sb.Append("<tr>");
|
||||
for (int i = 0; i < td_count; i++)
|
||||
{
|
||||
#region 第一行按钮
|
||||
sb.Append("<td style=\"height:50%;width:145px;\">");
|
||||
//标签id
|
||||
string id = "button_ando_machine_" + dt_list.Rows[i]["编号"].ToString();
|
||||
|
||||
#region 颜色代码
|
||||
//标签值
|
||||
string value = dt_list.Rows[i]["编号描述2"].ToString();
|
||||
string color = dt_list.Rows[i]["颜色代码"].ToString();
|
||||
//string inputColor = "background-color:" + color + "";
|
||||
if (color == "0")
|
||||
{
|
||||
sb.Append("<input type=\"button\" onclick=\"andon_machine(id)\" id=\"" + id + "\" value=\"" + value + "\" style=\"width: 140px; height:100%;\"/>");
|
||||
}
|
||||
if (color == "1")
|
||||
{
|
||||
sb.Append("<input type=\"button\" onclick=\"andon_machine(id)\" id=\"" + id + "\" value=\"" + value + "\" style=\"width: 140px; height:100%;background-color:pink;\"/>");
|
||||
}
|
||||
if (color == "2")
|
||||
{
|
||||
sb.Append("<input type=\"button\" onclick=\"andon_machine(id)\" id=\"" + id + "\" value=\"" + value + "\" style=\"width: 140px; height:100%;background-color:yellow;\"/>");
|
||||
}
|
||||
#endregion
|
||||
|
||||
sb.Append("</td>");
|
||||
|
||||
#endregion
|
||||
}
|
||||
sb.Append("</tr>");
|
||||
|
||||
|
||||
//创建第二行
|
||||
sb.Append("<tr>");
|
||||
for (int i = td_count; i < tableCount; i++)
|
||||
{
|
||||
#region 第二行按钮
|
||||
sb.Append("<td style=\"height:50%;width:145px;\">");
|
||||
//标签id
|
||||
string id = "button_ando_machine_" + dt_list.Rows[i]["编号"].ToString();
|
||||
|
||||
#region 颜色代码
|
||||
//标签值
|
||||
string value = dt_list.Rows[i]["编号描述2"].ToString();
|
||||
string color = dt_list.Rows[i]["颜色代码"].ToString();
|
||||
if (color == "0")
|
||||
{
|
||||
sb.Append("<input type=\"button\" onclick=\"andon_machine(id)\" id=\"" + id + "\" value=\"" + value + "\" style=\"width: 140px; height:100%;\"/>");
|
||||
}
|
||||
if (color == "1")
|
||||
{
|
||||
sb.Append("<input type=\"button\" onclick=\"andon_machine(id)\" id=\"" + id + "\" value=\"" + value + "\" style=\"width: 140px; height:100%;background-color:pink;\"/>");
|
||||
}
|
||||
if (color == "2")
|
||||
{
|
||||
sb.Append("<input type=\"button\" onclick=\"andon_machine(id)\" id=\"" + id + "\" value=\"" + value + "\" style=\"width: 140px; height:100%;background-color:yellow;\"/>");
|
||||
}
|
||||
#endregion
|
||||
|
||||
sb.Append("</td>");
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
//补充第二行的信息
|
||||
if ((tableCount % 2) > 0 && (tableCount > 0))
|
||||
{
|
||||
sb.Append("<td style=\"height:50%\">");
|
||||
sb.Append("</td>");
|
||||
}
|
||||
sb.Append("</tr>");
|
||||
|
||||
//最后组合成table
|
||||
sb.Append("</table>");
|
||||
return sb.ToString();
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
605
Common/07WebBusinessFacade/BusinessFacade/Web/ando_matertial.cs
Normal file
605
Common/07WebBusinessFacade/BusinessFacade/Web/ando_matertial.cs
Normal file
@@ -0,0 +1,605 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using DataLinkMesWork;
|
||||
using System.Security.Cryptography;
|
||||
//using SystemFramework;
|
||||
|
||||
namespace bizFacade
|
||||
{
|
||||
public class ando_matertial
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 物料ando明细查询 ANDON_类型_编号_查询
|
||||
/// </summary>
|
||||
/// <param name="tb"></param>
|
||||
/// <returns></returns>
|
||||
public static bool andoListSelect(string opname, string andoTypeCode, out DataTable tb)
|
||||
{
|
||||
string procedureName = "ANDON_类型_编号_查询";
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
DataSet ds;
|
||||
string errorMessage;
|
||||
bool isOK;
|
||||
tb = null;
|
||||
SqlParameter[] sqlParameters = new SqlParameter[2];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@安东类型代码", andoTypeCode);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
isOK = DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out ds);
|
||||
if (isOK)
|
||||
{
|
||||
if (ds.Tables.Count > 0)
|
||||
{
|
||||
tb = ds.Tables[0];
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// ANDON_呼叫状态_解除(返回table)
|
||||
/// </summary>
|
||||
/// <param name="opname">工位号</param>
|
||||
/// <param name="number">具体button编号</param>
|
||||
/// <param name="andoTypeCode">安东类型代码</param>
|
||||
/// <param name="andoListCode">安东明细代码(补料,错料,不合格)</param>
|
||||
/// <param name="callInfo">呼叫内容</param>
|
||||
/// <returns></returns>
|
||||
public static bool AndoMaterialResetOutTable(string opname, string number, string andoTypeCode, string andoListCode, string callInfo,out DataTable tb)
|
||||
{
|
||||
string procedureName = "ANDON_呼叫状态_解除";
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
DataSet ds;
|
||||
string errorMessage;
|
||||
bool isOK;
|
||||
tb = null;
|
||||
SqlParameter[] sqlParameters = new SqlParameter[5];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
sqlParameters[0].Direction = ParameterDirection.Input;
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@编号", number);
|
||||
sqlParameters[1].Direction = ParameterDirection.Input;
|
||||
sqlParameters[2] = new System.Data.SqlClient.SqlParameter("@安东类型代码", andoTypeCode);
|
||||
sqlParameters[2].Direction = ParameterDirection.Input;
|
||||
sqlParameters[3] = new System.Data.SqlClient.SqlParameter("@安东明细代码", andoListCode);
|
||||
sqlParameters[3].Direction = ParameterDirection.Input;
|
||||
sqlParameters[4] = new System.Data.SqlClient.SqlParameter("@解除内容", callInfo);
|
||||
sqlParameters[4].Direction = ParameterDirection.Input;
|
||||
isOK = DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out ds);
|
||||
if (isOK)
|
||||
{
|
||||
if (ds.Tables.Count > 0)
|
||||
{
|
||||
tb = ds.Tables[0];
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ANDON_呼叫状态_解除
|
||||
/// </summary>
|
||||
/// <param name="opname"></param>
|
||||
/// <param name="number"></param>
|
||||
/// <param name="andoTypeCode"></param>
|
||||
/// <param name="andoListCode"></param>
|
||||
/// <param name="callInfo"></param>
|
||||
/// <returns></returns>
|
||||
public static bool AndoMaterialReset(string opname, string number, string andoTypeCode, string andoListCode, string callInfo)
|
||||
{
|
||||
|
||||
string procedureName = "ANDON_呼叫状态_解除";
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
string errorMessage;
|
||||
SqlParameter[] sqlParameters = new SqlParameter[5];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
sqlParameters[0].Direction = ParameterDirection.Input;
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@编号", number);
|
||||
sqlParameters[1].Direction = ParameterDirection.Input;
|
||||
sqlParameters[2] = new System.Data.SqlClient.SqlParameter("@安东类型代码", andoTypeCode);
|
||||
sqlParameters[2].Direction = ParameterDirection.Input;
|
||||
sqlParameters[3] = new System.Data.SqlClient.SqlParameter("@安东明细代码", andoListCode);
|
||||
sqlParameters[3].Direction = ParameterDirection.Input;
|
||||
sqlParameters[4] = new System.Data.SqlClient.SqlParameter("@解除内容", callInfo);
|
||||
sqlParameters[4].Direction = ParameterDirection.Input;
|
||||
bool isOK;
|
||||
isOK = DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters);
|
||||
if (isOK)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ANDON_呼叫状态_呼叫(物料ando插入)
|
||||
/// </summary>
|
||||
/// <param name="opname"></param>
|
||||
/// <param name="andoTypeCode"></param>
|
||||
/// <param name="andoListCode"></param>
|
||||
/// <param name="number"></param>
|
||||
/// <param name="callInfo"></param>
|
||||
/// <param name="callCount"></param>
|
||||
/// <param name="cardNumber"></param>
|
||||
/// <param name="noNumber"></param>
|
||||
/// <returns></returns>
|
||||
public static bool andoMaterialCall(string opname, string andoTypeCode, string andoListCode, string number, string callInfo, int callCount, string cardNumber, string noNumber)
|
||||
{
|
||||
|
||||
string procedureName = "ANDON_呼叫状态_呼叫";
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
string errorMessage;
|
||||
SqlParameter[] sqlParameters = new SqlParameter[8];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
sqlParameters[0].Direction = ParameterDirection.Input;
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@安东类型代码", andoTypeCode);
|
||||
sqlParameters[1].Direction = ParameterDirection.Input;
|
||||
sqlParameters[2] = new System.Data.SqlClient.SqlParameter("@安东明细代码", andoListCode);
|
||||
sqlParameters[2].Direction = ParameterDirection.Input;
|
||||
sqlParameters[3] = new System.Data.SqlClient.SqlParameter("@编号", number);
|
||||
sqlParameters[3].Direction = ParameterDirection.Input;
|
||||
sqlParameters[4] = new System.Data.SqlClient.SqlParameter("@呼叫内容", callInfo);
|
||||
sqlParameters[4].Direction = ParameterDirection.Input;
|
||||
sqlParameters[5] = new System.Data.SqlClient.SqlParameter("@呼叫数量", callCount);
|
||||
sqlParameters[5].Direction = ParameterDirection.Input;
|
||||
sqlParameters[6] = new System.Data.SqlClient.SqlParameter("@卡片条码", cardNumber);
|
||||
sqlParameters[6].Direction = ParameterDirection.Input;
|
||||
sqlParameters[7] = new System.Data.SqlClient.SqlParameter("@不合格代码", noNumber);
|
||||
sqlParameters[7].Direction = ParameterDirection.Input;
|
||||
bool isOK;
|
||||
isOK = DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters);
|
||||
if (isOK)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// ANDON_呼叫状态_呼叫(物料ando插入,返回table)
|
||||
/// </summary>
|
||||
/// <param name="opname">工位号</param>
|
||||
/// <param name="andoTypeCode">安东类型代码</param>
|
||||
/// <param name="andoListCode">安东明细代码(缺料,补料,不合格)</param>
|
||||
/// <param name="number">编号(具体物料信息)</param>
|
||||
/// <param name="callInfo"></param>
|
||||
/// <param name="callCount"></param>
|
||||
/// <param name="cardNumber"></param>
|
||||
/// <param name="noNumber"></param>
|
||||
/// <param name="tb"></param>
|
||||
/// <returns></returns>
|
||||
public static bool andoMaterialCallOutTable(string opname, string andoTypeCode,string andoListCode,string number,string callInfo,int callCount,string cardNumber,string noNumber,out DataTable tb)
|
||||
{
|
||||
string procedureName = "ANDON_呼叫状态_呼叫";
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
DataSet ds;
|
||||
string errorMessage;
|
||||
bool isOK;
|
||||
tb = null;
|
||||
SqlParameter[] sqlParameters = new SqlParameter[8];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
sqlParameters[0].Direction = ParameterDirection.Input;
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@安东类型代码", andoTypeCode);
|
||||
sqlParameters[1].Direction = ParameterDirection.Input;
|
||||
sqlParameters[2] = new System.Data.SqlClient.SqlParameter("@安东明细代码", andoListCode);
|
||||
sqlParameters[2].Direction = ParameterDirection.Input;
|
||||
sqlParameters[3] = new System.Data.SqlClient.SqlParameter("@编号", number);
|
||||
sqlParameters[3].Direction = ParameterDirection.Input;
|
||||
sqlParameters[4] = new System.Data.SqlClient.SqlParameter("@呼叫内容", callInfo);
|
||||
sqlParameters[4].Direction = ParameterDirection.Input;
|
||||
sqlParameters[5] = new System.Data.SqlClient.SqlParameter("@呼叫数量", callCount);
|
||||
sqlParameters[5].Direction = ParameterDirection.Input;
|
||||
sqlParameters[6] = new System.Data.SqlClient.SqlParameter("@卡片条码", cardNumber);
|
||||
sqlParameters[6].Direction = ParameterDirection.Input;
|
||||
sqlParameters[7] = new System.Data.SqlClient.SqlParameter("@不合格代码", noNumber);
|
||||
sqlParameters[7].Direction = ParameterDirection.Input;
|
||||
isOK = DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out ds);
|
||||
if (isOK)
|
||||
{
|
||||
if (ds.Tables.Count > 0)
|
||||
{
|
||||
tb = ds.Tables[0];
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 创建物料andon
|
||||
/// </summary>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static string CreateAndo_Material(string opname,string AndoTypeCode)
|
||||
{
|
||||
System.Data.DataTable dt_list;
|
||||
//查询ando明细
|
||||
andoListSelect(opname, AndoTypeCode, out dt_list);
|
||||
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
//if (dt_list != null)
|
||||
//{
|
||||
// if (dt_list.Rows.Count > 0)
|
||||
// {
|
||||
sb.Append("<div id=\"div_ando_first_main\" class=\"div_ando_first_main\">");
|
||||
sb.Append("<div id=\"div_ando_first\" class=\"div_ando_first\">");
|
||||
sb.Append("<div style=\"width:96%;height:92%;margin-left:10px;margin-top:10px;\">");
|
||||
|
||||
#region 大图片的div
|
||||
sb.Append("<div style=\"width:8%;height:100%;float:left;\">");
|
||||
sb.Append("<img alt=\"loading....\" src=\"../images/materiracall2.png\" width=\"92%\" height=\"100%\" />");
|
||||
sb.Append("</div>");
|
||||
#endregion
|
||||
|
||||
#region 整个ANDON选项DIV
|
||||
sb.Append("<div style=\"width:70%;height:100%;float:left;\">");
|
||||
|
||||
#region 左按钮DIV
|
||||
sb.Append("<div style=\"width:10%;height:100%;float:left;\">");
|
||||
sb.Append("<input type=\"button\" style=\"width:100%;height:100%;text-align:center;font-size:30px;\" value=\"<<\" onclick=\"RightMove()\" />");
|
||||
sb.Append("</div>");
|
||||
#endregion
|
||||
|
||||
|
||||
#region 中间内容DIV
|
||||
sb.Append("<div style=\"width:80%;height:100%;float:left;\">");
|
||||
|
||||
#region 可支持移动的div
|
||||
|
||||
sb.Append("<div style=\"width:100%;height:100%; overflow:hidden;position:relative;\" id=\"div_andon_table_material\">");
|
||||
|
||||
sb.Append("<div id=\"div_Scroll\" style=\"width:100%;height:100%; position:relative;\" >");
|
||||
|
||||
|
||||
//附加tabel
|
||||
string tabelString=CreatAndo_Material_table(opname,AndoTypeCode);
|
||||
sb.Append(tabelString);
|
||||
|
||||
sb.Append("</div>");
|
||||
sb.Append("</div>");
|
||||
#endregion
|
||||
|
||||
sb.Append("</div>");
|
||||
#endregion
|
||||
|
||||
#region 右按钮div
|
||||
|
||||
sb.Append("<div style=\"width:10%;height:100%;float:left;\">");
|
||||
|
||||
sb.Append("<input type=\"button\" style=\"width:100%;height:100%;text-align:center;font-size:30px;\" value=\">>\" onclick=\"leftMove()\" />");
|
||||
sb.Append("</div>");
|
||||
|
||||
#endregion
|
||||
|
||||
sb.Append("</div>");
|
||||
#endregion
|
||||
#region ando按钮div
|
||||
|
||||
sb.Append("<div style=\"width:22%;height:100%;float:left;\">");
|
||||
|
||||
sb.Append("<div style=\"width: 100%; height: 100%; margin: 30px 0px 0px -5px;\">");
|
||||
|
||||
sb.Append("<table style=\"width: 100%;\">");
|
||||
sb.Append("<tr>");
|
||||
sb.Append("<td align=\"left\">");
|
||||
sb.Append("<img onclick=\"andon_call_down('m_call')\" alt=\"loading...\" id='m_call' src=\"../images/call.png\" style=\"width: 100px; height: 80px\"/>");
|
||||
sb.Append("</td>");
|
||||
sb.Append("<td align=\"right\">");
|
||||
sb.Append("<img onclick=\"andon_reset_down('m_reset')\" alt=\"loading...\" id='m_reset' src=\"../images/reset.png\" style=\"width: 100px;height: 80px\" />");
|
||||
sb.Append("</td>");
|
||||
sb.Append("</tr>");
|
||||
sb.Append("<tr>");
|
||||
sb.Append("<td style=\"padding-top: 20px\" align=\"center\">");
|
||||
sb.Append("<label style=\"padding-top: 20px;font-size:18px;\">呼 叫</label>");
|
||||
sb.Append("</td>");
|
||||
sb.Append("<td style=\"padding-top: 20px\" align=\"center\">");
|
||||
sb.Append("<label style=\"padding-top: 20px;font-size:18px;\">复 位</label>");
|
||||
sb.Append("</td>");
|
||||
sb.Append("</tr>");
|
||||
sb.Append("</table>");
|
||||
|
||||
sb.Append("</div>");
|
||||
|
||||
sb.Append("</div>");
|
||||
|
||||
#endregion
|
||||
|
||||
sb.Append("</div></div></div>");
|
||||
|
||||
// }
|
||||
|
||||
//}
|
||||
return sb.ToString();
|
||||
}
|
||||
/// <summary>
|
||||
/// 更新物料安东的中间的tabel
|
||||
/// </summary>
|
||||
/// <param name="opname">工位号</param>
|
||||
/// <param name="AndoTypeCode">物料ando类型明细</param>
|
||||
/// <returns></returns>
|
||||
public static string CreatAndo_Material_table(string opname, string AndoTypeCode)
|
||||
{
|
||||
System.Data.DataTable dt_list;
|
||||
//查询ando明细
|
||||
andoListSelect(opname, AndoTypeCode, out dt_list);
|
||||
StringBuilder sb = new StringBuilder();
|
||||
int tableCount = dt_list.Rows.Count;
|
||||
int td_count = (tableCount / 2) + (tableCount % 2);//获取每个tr中应该创建多少个td
|
||||
int tablewidth = 145 * td_count;
|
||||
if (tablewidth == 0)
|
||||
{
|
||||
tablewidth = 10;
|
||||
}
|
||||
string tablewidth2 = Convert.ToString(tablewidth) + "px";
|
||||
|
||||
#region table
|
||||
|
||||
sb.Append("<table id=\"table_Scroll\" style=\"width:" + tablewidth2 + ";height:100%;left:0px;\">");
|
||||
|
||||
//创建第一行
|
||||
sb.Append("<tr>");
|
||||
for (int i = 0; i < td_count; i++)
|
||||
{
|
||||
#region 第一行按钮
|
||||
sb.Append("<td style=\"height:50%;width:145px;\">");
|
||||
//标签id
|
||||
string id = "button_ando_material_" + dt_list.Rows[i]["编号"].ToString();
|
||||
|
||||
#region 颜色代码
|
||||
//标签值
|
||||
string value = dt_list.Rows[i]["编号描述2"].ToString();
|
||||
string color = dt_list.Rows[i]["颜色代码"].ToString();
|
||||
//string inputColor = "background-color:" + color + "";
|
||||
if (color == "0")
|
||||
{
|
||||
sb.Append("<input type=\"button\" onclick=\"andon_material(id)\" id=\"" + id + "\" value=\"" + value + "\" style=\"width: 140px; height:100%;\"/>");
|
||||
}
|
||||
if (color == "1")
|
||||
{
|
||||
sb.Append("<input type=\"button\" onclick=\"andon_material(id)\" id=\"" + id + "\" value=\"" + value + "\" style=\"width: 140px; height:100%;background-color:pink;\"/>");
|
||||
}
|
||||
if (color == "2")
|
||||
{
|
||||
sb.Append("<input type=\"button\" onclick=\"andon_material(id)\" id=\"" + id + "\" value=\"" + value + "\" style=\"width: 140px; height:100%;background-color:yellow;\"/>");
|
||||
}
|
||||
#endregion
|
||||
|
||||
sb.Append("</td>");
|
||||
|
||||
#endregion
|
||||
}
|
||||
sb.Append("</tr>");
|
||||
|
||||
|
||||
//创建第二行
|
||||
sb.Append("<tr>");
|
||||
for (int i = td_count; i < tableCount; i++)
|
||||
{
|
||||
#region 第二行按钮
|
||||
sb.Append("<td style=\"height:50%;width:145px;\">");
|
||||
//标签id
|
||||
string id = "button_ando_material_" + dt_list.Rows[i]["编号"].ToString();
|
||||
|
||||
#region 颜色代码
|
||||
//标签值
|
||||
string value = dt_list.Rows[i]["编号描述2"].ToString();
|
||||
string color = dt_list.Rows[i]["颜色代码"].ToString();
|
||||
//string inputColor = "background-color:" + color + "";
|
||||
if (color == "0")
|
||||
{
|
||||
sb.Append("<input type=\"button\" onclick=\"andon_material(id)\" id=\"" + id + "\" value=\"" + value + "\" style=\"width: 140px; height:100%;\"/>");
|
||||
}
|
||||
if (color == "1")
|
||||
{
|
||||
sb.Append("<input type=\"button\" onclick=\"andon_material(id)\" id=\"" + id + "\" value=\"" + value + "\" style=\"width: 140px; height:100%;background-color:pink;\"/>");
|
||||
}
|
||||
if (color == "2")
|
||||
{
|
||||
sb.Append("<input type=\"button\" onclick=\"andon_material(id)\" id=\"" + id + "\" value=\"" + value + "\" style=\"width: 140px; height:100%;background-color:yellow;\"/>");
|
||||
}
|
||||
#endregion
|
||||
|
||||
sb.Append("</td>");
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
//补充第二行的信息
|
||||
if ((tableCount % 2) > 0 && (tableCount > 0))
|
||||
{
|
||||
sb.Append("<td style=\"height:50%\">");
|
||||
sb.Append("</td>");
|
||||
}
|
||||
sb.Append("</tr>");
|
||||
|
||||
//最后组合成table
|
||||
sb.Append("</table>");
|
||||
return sb.ToString();
|
||||
|
||||
|
||||
// if (tableCount > 4)
|
||||
// {
|
||||
// sb.Append("<tr>");
|
||||
// int i = 0;
|
||||
// for (i = 0; i < dt_list.Rows.Count; i++)
|
||||
// {
|
||||
// //总条数
|
||||
// int seecond = dt_list.Rows.Count;
|
||||
// //总条数和2取余
|
||||
// int seecond1 = seecond % 2;
|
||||
// if ((seecond % 2) == 1)
|
||||
// {
|
||||
// seecond = seecond / 2 + 1;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// seecond = dt_list.Rows.Count / 2;
|
||||
// }
|
||||
// if (i <= seecond)
|
||||
// {
|
||||
// #region 第一行按钮
|
||||
|
||||
|
||||
// sb.Append("<td style=\"height:50%\">");
|
||||
// //标签id
|
||||
// string id = "button_ando_material_" + dt_list.Rows[i]["编号"].ToString();
|
||||
|
||||
// #region 颜色代码
|
||||
// //标签值
|
||||
// string value = dt_list.Rows[i]["编号描述2"].ToString();
|
||||
// string color = dt_list.Rows[i]["颜色代码"].ToString();
|
||||
// //string inputColor = "background-color:" + color + "";
|
||||
// if (color == "0")
|
||||
// {
|
||||
// sb.Append("<input type=\"button\" onclick=\"andon_material(id)\" id=\"" + id + "\" value=\"" + value + "\" style=\"width: 140px; height:100%;\"/>");
|
||||
// }
|
||||
// if (color == "1")
|
||||
// {
|
||||
// sb.Append("<input type=\"button\" onclick=\"andon_material(id)\" id=\"" + id + "\" value=\"" + value + "\" style=\"width: 140px; height:100%;background-color:pink;\"/>");
|
||||
// }
|
||||
// if (color == "2")
|
||||
// {
|
||||
// sb.Append("<input type=\"button\" onclick=\"andon_material(id)\" id=\"" + id + "\" value=\"" + value + "\" style=\"width: 140px; height:100%;background-color:yellow;\"/>");
|
||||
// }
|
||||
// #endregion
|
||||
|
||||
// sb.Append("</td>");
|
||||
|
||||
// #endregion
|
||||
|
||||
// }
|
||||
// }
|
||||
// sb.Append("</tr>");
|
||||
// sb.Append("<tr>");
|
||||
// for (i = 0; i < dt_list.Rows.Count; i++)
|
||||
// {
|
||||
// //如果第一行超过一半的按钮就重新放一行
|
||||
// int second1 = dt_list.Rows.Count;
|
||||
// if ((second1) % 2 == 1)
|
||||
// {
|
||||
// second1 = second1 / 2 + 1;
|
||||
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// second1 = dt_list.Rows.Count / 2;
|
||||
// }
|
||||
// if (i > second1)
|
||||
// {
|
||||
// #region 第二行按钮
|
||||
|
||||
|
||||
// sb.Append("<td style=\"height:50%\">");
|
||||
// //标签id
|
||||
// string id = "button_ando_material_" + dt_list.Rows[i]["编号"].ToString();
|
||||
|
||||
// #region 颜色代码
|
||||
|
||||
// //标签值
|
||||
// string value = dt_list.Rows[i]["编号描述2"].ToString();
|
||||
// string color = dt_list.Rows[i]["颜色代码"].ToString();
|
||||
// //string inputColor = "background-color:" + color + "";
|
||||
// if (color == "0")
|
||||
// {
|
||||
// sb.Append("<input type=\"button\" onclick=\"andon_material(id)\" id=\"" + id + "\" value=\"" + value + "\" style=\"width: 140px; height:100%;\"/>");
|
||||
// }
|
||||
// if (color == "1")
|
||||
// {
|
||||
// sb.Append("<input type=\"button\" onclick=\"andon_material(id)\" id=\"" + id + "\" value=\"" + value + "\" style=\"width: 140px; height:100%;background-color:pink;\"/>");
|
||||
// }
|
||||
// if (color == "2")
|
||||
// {
|
||||
// sb.Append("<input type=\"button\" onclick=\"andon_material(id)\" id=\"" + id + "\" value=\"" + value + "\" style=\"width: 140px; height:100%;background-color:yellow;\"/>");
|
||||
// }
|
||||
// #endregion
|
||||
|
||||
// sb.Append("</td>");
|
||||
// #endregion
|
||||
|
||||
// }
|
||||
// }
|
||||
// sb.Append("</tr>");
|
||||
// }
|
||||
// //小于4个物料ando按钮
|
||||
// else
|
||||
// {
|
||||
// sb.Append("<tr>");
|
||||
// int i = 0;
|
||||
// for (i = 0; i < dt_list.Rows.Count; i++)
|
||||
// {
|
||||
// //如果按钮数小于一半,都放在第一行
|
||||
// if (i < dt_list.Rows.Count)
|
||||
// {
|
||||
// #region 第一行按钮
|
||||
|
||||
|
||||
// sb.Append("<td style=\"height:50%\">");
|
||||
// //标签id
|
||||
// string id = "button_ando_material_" + dt_list.Rows[i]["编号"].ToString();
|
||||
|
||||
// #region 颜色代码
|
||||
|
||||
// //标签值
|
||||
// string value = dt_list.Rows[i]["编号描述2"].ToString();
|
||||
// string color = dt_list.Rows[i]["颜色代码"].ToString();
|
||||
// //string inputColor = "background-color:" + color + "";
|
||||
// if (color == "0")
|
||||
// {
|
||||
// sb.Append("<input type=\"button\" onclick=\"andon_material(id)\" id=\"" + id + "\" value=\"" + value + "\" style=\"width: 140px; height:100%;\"/>");
|
||||
// }
|
||||
// if (color == "1")
|
||||
// {
|
||||
// sb.Append("<input type=\"button\" onclick=\"andon_material(id)\" id=\"" + id + "\" value=\"" + value + "\" style=\"width: 140px; height:100%;background-color:pink;\"/>");
|
||||
// }
|
||||
// if (color == "2")
|
||||
// {
|
||||
// sb.Append("<input type=\"button\" onclick=\"andon_material(id)\" id=\"" + id + "\" value=\"" + value + "\" style=\"width: 140px; height:100%;background-color:yellow;\"/>");
|
||||
// }
|
||||
// #endregion
|
||||
|
||||
// sb.Append("</td>");
|
||||
|
||||
// #endregion
|
||||
|
||||
// }
|
||||
// }
|
||||
// sb.Append("</tr>");
|
||||
// }
|
||||
//sb.Append("</table>");
|
||||
|
||||
//return sb.ToString();
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,605 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using DataLinkMesWork;
|
||||
using System.Security.Cryptography;
|
||||
//using SystemFramework;
|
||||
|
||||
namespace bizFacade
|
||||
{
|
||||
public class ando_matertial_2
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 物料ando明细查询 ANDON_类型_编号_查询
|
||||
/// </summary>
|
||||
/// <param name="tb"></param>
|
||||
/// <returns></returns>
|
||||
public static bool andoListSelect(string opname, string andoTypeCode, out DataTable tb)
|
||||
{
|
||||
string procedureName = "ANDON_类型_编号_查询";
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
DataSet ds;
|
||||
string errorMessage;
|
||||
bool isOK;
|
||||
tb = null;
|
||||
SqlParameter[] sqlParameters = new SqlParameter[2];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@安东类型代码", andoTypeCode);
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
isOK = DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out ds);
|
||||
if (isOK)
|
||||
{
|
||||
if (ds.Tables.Count > 0)
|
||||
{
|
||||
tb = ds.Tables[0];
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// ANDON_呼叫状态_解除(返回table)
|
||||
/// </summary>
|
||||
/// <param name="opname">工位号</param>
|
||||
/// <param name="number">具体button编号</param>
|
||||
/// <param name="andoTypeCode">安东类型代码</param>
|
||||
/// <param name="andoListCode">安东明细代码(补料,错料,不合格)</param>
|
||||
/// <param name="callInfo">呼叫内容</param>
|
||||
/// <returns></returns>
|
||||
public static bool AndoMaterialResetOutTable(string opname, string number, string andoTypeCode, string andoListCode, string callInfo,out DataTable tb)
|
||||
{
|
||||
string procedureName = "ANDON_呼叫状态_解除";
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
DataSet ds;
|
||||
string errorMessage;
|
||||
bool isOK;
|
||||
tb = null;
|
||||
SqlParameter[] sqlParameters = new SqlParameter[5];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
sqlParameters[0].Direction = ParameterDirection.Input;
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@编号", number);
|
||||
sqlParameters[1].Direction = ParameterDirection.Input;
|
||||
sqlParameters[2] = new System.Data.SqlClient.SqlParameter("@安东类型代码", andoTypeCode);
|
||||
sqlParameters[2].Direction = ParameterDirection.Input;
|
||||
sqlParameters[3] = new System.Data.SqlClient.SqlParameter("@安东明细代码", andoListCode);
|
||||
sqlParameters[3].Direction = ParameterDirection.Input;
|
||||
sqlParameters[4] = new System.Data.SqlClient.SqlParameter("@解除内容", callInfo);
|
||||
sqlParameters[4].Direction = ParameterDirection.Input;
|
||||
isOK = DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out ds);
|
||||
if (isOK)
|
||||
{
|
||||
if (ds.Tables.Count > 0)
|
||||
{
|
||||
tb = ds.Tables[0];
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ANDON_呼叫状态_解除
|
||||
/// </summary>
|
||||
/// <param name="opname"></param>
|
||||
/// <param name="number"></param>
|
||||
/// <param name="andoTypeCode"></param>
|
||||
/// <param name="andoListCode"></param>
|
||||
/// <param name="callInfo"></param>
|
||||
/// <returns></returns>
|
||||
public static bool AndoMaterialReset(string opname, string number, string andoTypeCode, string andoListCode, string callInfo)
|
||||
{
|
||||
|
||||
string procedureName = "ANDON_呼叫状态_解除";
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
string errorMessage;
|
||||
SqlParameter[] sqlParameters = new SqlParameter[5];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
sqlParameters[0].Direction = ParameterDirection.Input;
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@编号", number);
|
||||
sqlParameters[1].Direction = ParameterDirection.Input;
|
||||
sqlParameters[2] = new System.Data.SqlClient.SqlParameter("@安东类型代码", andoTypeCode);
|
||||
sqlParameters[2].Direction = ParameterDirection.Input;
|
||||
sqlParameters[3] = new System.Data.SqlClient.SqlParameter("@安东明细代码", andoListCode);
|
||||
sqlParameters[3].Direction = ParameterDirection.Input;
|
||||
sqlParameters[4] = new System.Data.SqlClient.SqlParameter("@解除内容", callInfo);
|
||||
sqlParameters[4].Direction = ParameterDirection.Input;
|
||||
bool isOK;
|
||||
isOK = DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters);
|
||||
if (isOK)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ANDON_呼叫状态_呼叫(物料ando插入)
|
||||
/// </summary>
|
||||
/// <param name="opname"></param>
|
||||
/// <param name="andoTypeCode"></param>
|
||||
/// <param name="andoListCode"></param>
|
||||
/// <param name="number"></param>
|
||||
/// <param name="callInfo"></param>
|
||||
/// <param name="callCount"></param>
|
||||
/// <param name="cardNumber"></param>
|
||||
/// <param name="noNumber"></param>
|
||||
/// <returns></returns>
|
||||
public static bool andoMaterialCall(string opname, string andoTypeCode, string andoListCode, string number, string callInfo, int callCount, string cardNumber, string noNumber)
|
||||
{
|
||||
|
||||
string procedureName = "ANDON_呼叫状态_呼叫";
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
string errorMessage;
|
||||
SqlParameter[] sqlParameters = new SqlParameter[8];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
sqlParameters[0].Direction = ParameterDirection.Input;
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@安东类型代码", andoTypeCode);
|
||||
sqlParameters[1].Direction = ParameterDirection.Input;
|
||||
sqlParameters[2] = new System.Data.SqlClient.SqlParameter("@安东明细代码", andoListCode);
|
||||
sqlParameters[2].Direction = ParameterDirection.Input;
|
||||
sqlParameters[3] = new System.Data.SqlClient.SqlParameter("@编号", number);
|
||||
sqlParameters[3].Direction = ParameterDirection.Input;
|
||||
sqlParameters[4] = new System.Data.SqlClient.SqlParameter("@呼叫内容", callInfo);
|
||||
sqlParameters[4].Direction = ParameterDirection.Input;
|
||||
sqlParameters[5] = new System.Data.SqlClient.SqlParameter("@呼叫数量", callCount);
|
||||
sqlParameters[5].Direction = ParameterDirection.Input;
|
||||
sqlParameters[6] = new System.Data.SqlClient.SqlParameter("@卡片条码", cardNumber);
|
||||
sqlParameters[6].Direction = ParameterDirection.Input;
|
||||
sqlParameters[7] = new System.Data.SqlClient.SqlParameter("@不合格代码", noNumber);
|
||||
sqlParameters[7].Direction = ParameterDirection.Input;
|
||||
bool isOK;
|
||||
isOK = DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters);
|
||||
if (isOK)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// ANDON_呼叫状态_呼叫(物料ando插入,返回table)
|
||||
/// </summary>
|
||||
/// <param name="opname">工位号</param>
|
||||
/// <param name="andoTypeCode">安东类型代码</param>
|
||||
/// <param name="andoListCode">安东明细代码(缺料,补料,不合格)</param>
|
||||
/// <param name="number">编号(具体物料信息)</param>
|
||||
/// <param name="callInfo"></param>
|
||||
/// <param name="callCount"></param>
|
||||
/// <param name="cardNumber"></param>
|
||||
/// <param name="noNumber"></param>
|
||||
/// <param name="tb"></param>
|
||||
/// <returns></returns>
|
||||
public static bool andoMaterialCallOutTable(string opname, string andoTypeCode,string andoListCode,string number,string callInfo,int callCount,string cardNumber,string noNumber,out DataTable tb)
|
||||
{
|
||||
string procedureName = "ANDON_呼叫状态_呼叫";
|
||||
//string connectionString = ApplicationConfig.ConnectionString;
|
||||
DataSet ds;
|
||||
string errorMessage;
|
||||
bool isOK;
|
||||
tb = null;
|
||||
SqlParameter[] sqlParameters = new SqlParameter[8];
|
||||
sqlParameters[0] = new System.Data.SqlClient.SqlParameter("@工位号", opname);
|
||||
sqlParameters[0].Direction = ParameterDirection.Input;
|
||||
sqlParameters[1] = new System.Data.SqlClient.SqlParameter("@安东类型代码", andoTypeCode);
|
||||
sqlParameters[1].Direction = ParameterDirection.Input;
|
||||
sqlParameters[2] = new System.Data.SqlClient.SqlParameter("@安东明细代码", andoListCode);
|
||||
sqlParameters[2].Direction = ParameterDirection.Input;
|
||||
sqlParameters[3] = new System.Data.SqlClient.SqlParameter("@编号", number);
|
||||
sqlParameters[3].Direction = ParameterDirection.Input;
|
||||
sqlParameters[4] = new System.Data.SqlClient.SqlParameter("@呼叫内容", callInfo);
|
||||
sqlParameters[4].Direction = ParameterDirection.Input;
|
||||
sqlParameters[5] = new System.Data.SqlClient.SqlParameter("@呼叫数量", callCount);
|
||||
sqlParameters[5].Direction = ParameterDirection.Input;
|
||||
sqlParameters[6] = new System.Data.SqlClient.SqlParameter("@卡片条码", cardNumber);
|
||||
sqlParameters[6].Direction = ParameterDirection.Input;
|
||||
sqlParameters[7] = new System.Data.SqlClient.SqlParameter("@不合格代码", noNumber);
|
||||
sqlParameters[7].Direction = ParameterDirection.Input;
|
||||
isOK = DataAccess.ExecuteStoredProcedure(procedureName, ref sqlParameters, out ds);
|
||||
if (isOK)
|
||||
{
|
||||
if (ds.Tables.Count > 0)
|
||||
{
|
||||
tb = ds.Tables[0];
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 创建物料andon
|
||||
/// </summary>
|
||||
/// <param name="dt"></param>
|
||||
/// <returns></returns>
|
||||
public static string CreateAndo_Material(string opname,string AndoTypeCode)
|
||||
{
|
||||
System.Data.DataTable dt_list;
|
||||
//查询ando明细
|
||||
andoListSelect(opname, AndoTypeCode, out dt_list);
|
||||
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
//if (dt_list != null)
|
||||
//{
|
||||
// if (dt_list.Rows.Count > 0)
|
||||
// {
|
||||
sb.Append("<div id=\"div_ando_first_main\" class=\"div_ando_first_main\">");
|
||||
sb.Append("<div id=\"div_ando_first\" class=\"div_ando_first\">");
|
||||
sb.Append("<div style=\"width:96%;height:92%;margin-left:10px;margin-top:10px;\">");
|
||||
|
||||
#region 大图片的div
|
||||
sb.Append("<div style=\"width:8%;height:100%;float:left;\">");
|
||||
sb.Append("<img alt=\"loading....\" src=\"../images/materiracall2.png\" width=\"92%\" height=\"100%\" />");
|
||||
sb.Append("</div>");
|
||||
#endregion
|
||||
|
||||
#region 整个ANDON选项DIV
|
||||
sb.Append("<div style=\"width:67%;height:100%;float:left;\">");
|
||||
|
||||
#region 左按钮DIV
|
||||
sb.Append("<div style=\"width:10%;height:100%;float:left;\">");
|
||||
sb.Append("<input type=\"button\" style=\"width:100%;height:100%;text-align:center;font-size:30px;\" value=\"<<\" onclick=\"RightMove()\" />");
|
||||
sb.Append("</div>");
|
||||
#endregion
|
||||
|
||||
|
||||
#region 中间内容DIV
|
||||
sb.Append("<div style=\"width:80%;height:100%;float:left;\">");
|
||||
|
||||
#region 可支持移动的div
|
||||
|
||||
sb.Append("<div style=\"width:100%;height:100%; overflow:hidden;position:relative;\" id=\"div_andon_table_material\">");
|
||||
|
||||
sb.Append("<div id=\"div_Scroll\" style=\"width:100%;height:100%; position:relative;\" >");
|
||||
|
||||
|
||||
//附加tabel
|
||||
string tabelString=CreatAndo_Material_table(opname,AndoTypeCode);
|
||||
sb.Append(tabelString);
|
||||
|
||||
sb.Append("</div>");
|
||||
sb.Append("</div>");
|
||||
#endregion
|
||||
|
||||
sb.Append("</div>");
|
||||
#endregion
|
||||
|
||||
#region 右按钮div
|
||||
|
||||
sb.Append("<div style=\"width:10%;height:100%;float:left;\">");
|
||||
|
||||
sb.Append("<input type=\"button\" style=\"width:100%;height:100%;text-align:center;font-size:30px;\" value=\">>\" onclick=\"leftMove()\" />");
|
||||
sb.Append("</div>");
|
||||
|
||||
#endregion
|
||||
|
||||
sb.Append("</div>");
|
||||
#endregion
|
||||
#region ando按钮div
|
||||
|
||||
sb.Append("<div style=\"width:25%;height:100%;float:left;\">");
|
||||
|
||||
sb.Append("<div style=\"width: 100%; height:80%; margin: 20px 0px 0px 5px;\">");
|
||||
|
||||
sb.Append("<table style=\"width: 100%;\">");
|
||||
sb.Append("<tr>");
|
||||
sb.Append("<td align=\"left\">");
|
||||
sb.Append("<img onclick=\"andon_call_down('m_call')\" alt=\"loading...\" id='m_call' src=\"../images/call.png\" style=\"width: 100px; height: 80px\"/>");
|
||||
sb.Append("</td>");
|
||||
sb.Append("<td align=\"right\">");
|
||||
sb.Append("<img onclick=\"andon_reset_down('m_reset')\" alt=\"loading...\" id='m_reset' src=\"../images/reset.png\" style=\"width: 100px;height: 80px\" />");
|
||||
sb.Append("</td>");
|
||||
sb.Append("</tr>");
|
||||
sb.Append("<tr>");
|
||||
sb.Append("<td style=\"padding-top: 20px\" align=\"center\">");
|
||||
sb.Append("<label style=\"padding-top: 20px;font-size:18px;\">呼 叫</label>");
|
||||
sb.Append("</td>");
|
||||
sb.Append("<td style=\"padding-top: 20px\" align=\"center\">");
|
||||
sb.Append("<label style=\"padding-top: 20px;font-size:18px;\">复 位</label>");
|
||||
sb.Append("</td>");
|
||||
sb.Append("</tr>");
|
||||
sb.Append("</table>");
|
||||
|
||||
sb.Append("</div>");
|
||||
|
||||
sb.Append("</div>");
|
||||
|
||||
#endregion
|
||||
|
||||
sb.Append("</div></div></div>");
|
||||
|
||||
// }
|
||||
|
||||
//}
|
||||
return sb.ToString();
|
||||
}
|
||||
/// <summary>
|
||||
/// 更新物料安东的中间的tabel
|
||||
/// </summary>
|
||||
/// <param name="opname">工位号</param>
|
||||
/// <param name="AndoTypeCode">物料ando类型明细</param>
|
||||
/// <returns></returns>
|
||||
public static string CreatAndo_Material_table(string opname, string AndoTypeCode)
|
||||
{
|
||||
System.Data.DataTable dt_list;
|
||||
//查询ando明细
|
||||
andoListSelect(opname, AndoTypeCode, out dt_list);
|
||||
StringBuilder sb = new StringBuilder();
|
||||
int tableCount = dt_list.Rows.Count;
|
||||
int td_count = (tableCount / 2) + (tableCount % 2);//获取每个tr中应该创建多少个td
|
||||
int tablewidth = 145 * td_count;
|
||||
if (tablewidth == 0)
|
||||
{
|
||||
tablewidth = 10;
|
||||
}
|
||||
string tablewidth2 = Convert.ToString(tablewidth) + "px";
|
||||
|
||||
#region table
|
||||
|
||||
sb.Append("<table id=\"table_Scroll\" style=\"width:" + tablewidth2 + ";height:100%;left:0px;\">");
|
||||
|
||||
//创建第一行
|
||||
sb.Append("<tr>");
|
||||
for (int i = 0; i < td_count; i++)
|
||||
{
|
||||
#region 第一行按钮
|
||||
sb.Append("<td style=\"height:50%;width:145px;\">");
|
||||
//标签id
|
||||
string id = "button_ando_material_" + dt_list.Rows[i]["编号"].ToString();
|
||||
|
||||
#region 颜色代码
|
||||
//标签值
|
||||
string value = dt_list.Rows[i]["编号描述2"].ToString();
|
||||
string color = dt_list.Rows[i]["颜色代码"].ToString();
|
||||
//string inputColor = "background-color:" + color + "";
|
||||
if (color == "0")
|
||||
{
|
||||
sb.Append("<input type=\"button\" onclick=\"andon_material(id)\" id=\"" + id + "\" value=\"" + value + "\" style=\"width: 140px; height:100%;\"/>");
|
||||
}
|
||||
if (color == "1")
|
||||
{
|
||||
sb.Append("<input type=\"button\" onclick=\"andon_material(id)\" id=\"" + id + "\" value=\"" + value + "\" style=\"width: 140px; height:100%;background-color:pink;\"/>");
|
||||
}
|
||||
if (color == "2")
|
||||
{
|
||||
sb.Append("<input type=\"button\" onclick=\"andon_material(id)\" id=\"" + id + "\" value=\"" + value + "\" style=\"width: 140px; height:100%;background-color:yellow;\"/>");
|
||||
}
|
||||
#endregion
|
||||
|
||||
sb.Append("</td>");
|
||||
|
||||
#endregion
|
||||
}
|
||||
sb.Append("</tr>");
|
||||
|
||||
|
||||
//创建第二行
|
||||
sb.Append("<tr>");
|
||||
for (int i = td_count; i < tableCount; i++)
|
||||
{
|
||||
#region 第二行按钮
|
||||
sb.Append("<td style=\"height:50%;width:145px;\">");
|
||||
//标签id
|
||||
string id = "button_ando_material_" + dt_list.Rows[i]["编号"].ToString();
|
||||
|
||||
#region 颜色代码
|
||||
//标签值
|
||||
string value = dt_list.Rows[i]["编号描述2"].ToString();
|
||||
string color = dt_list.Rows[i]["颜色代码"].ToString();
|
||||
//string inputColor = "background-color:" + color + "";
|
||||
if (color == "0")
|
||||
{
|
||||
sb.Append("<input type=\"button\" onclick=\"andon_material(id)\" id=\"" + id + "\" value=\"" + value + "\" style=\"width: 140px; height:100%;\"/>");
|
||||
}
|
||||
if (color == "1")
|
||||
{
|
||||
sb.Append("<input type=\"button\" onclick=\"andon_material(id)\" id=\"" + id + "\" value=\"" + value + "\" style=\"width: 140px; height:100%;background-color:pink;\"/>");
|
||||
}
|
||||
if (color == "2")
|
||||
{
|
||||
sb.Append("<input type=\"button\" onclick=\"andon_material(id)\" id=\"" + id + "\" value=\"" + value + "\" style=\"width: 140px; height:100%;background-color:yellow;\"/>");
|
||||
}
|
||||
#endregion
|
||||
|
||||
sb.Append("</td>");
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
//补充第二行的信息
|
||||
if ((tableCount % 2) > 0 && (tableCount > 0))
|
||||
{
|
||||
sb.Append("<td style=\"height:50%\">");
|
||||
sb.Append("</td>");
|
||||
}
|
||||
sb.Append("</tr>");
|
||||
|
||||
//最后组合成table
|
||||
sb.Append("</table>");
|
||||
return sb.ToString();
|
||||
|
||||
|
||||
// if (tableCount > 4)
|
||||
// {
|
||||
// sb.Append("<tr>");
|
||||
// int i = 0;
|
||||
// for (i = 0; i < dt_list.Rows.Count; i++)
|
||||
// {
|
||||
// //总条数
|
||||
// int seecond = dt_list.Rows.Count;
|
||||
// //总条数和2取余
|
||||
// int seecond1 = seecond % 2;
|
||||
// if ((seecond % 2) == 1)
|
||||
// {
|
||||
// seecond = seecond / 2 + 1;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// seecond = dt_list.Rows.Count / 2;
|
||||
// }
|
||||
// if (i <= seecond)
|
||||
// {
|
||||
// #region 第一行按钮
|
||||
|
||||
|
||||
// sb.Append("<td style=\"height:50%\">");
|
||||
// //标签id
|
||||
// string id = "button_ando_material_" + dt_list.Rows[i]["编号"].ToString();
|
||||
|
||||
// #region 颜色代码
|
||||
// //标签值
|
||||
// string value = dt_list.Rows[i]["编号描述2"].ToString();
|
||||
// string color = dt_list.Rows[i]["颜色代码"].ToString();
|
||||
// //string inputColor = "background-color:" + color + "";
|
||||
// if (color == "0")
|
||||
// {
|
||||
// sb.Append("<input type=\"button\" onclick=\"andon_material(id)\" id=\"" + id + "\" value=\"" + value + "\" style=\"width: 140px; height:100%;\"/>");
|
||||
// }
|
||||
// if (color == "1")
|
||||
// {
|
||||
// sb.Append("<input type=\"button\" onclick=\"andon_material(id)\" id=\"" + id + "\" value=\"" + value + "\" style=\"width: 140px; height:100%;background-color:pink;\"/>");
|
||||
// }
|
||||
// if (color == "2")
|
||||
// {
|
||||
// sb.Append("<input type=\"button\" onclick=\"andon_material(id)\" id=\"" + id + "\" value=\"" + value + "\" style=\"width: 140px; height:100%;background-color:yellow;\"/>");
|
||||
// }
|
||||
// #endregion
|
||||
|
||||
// sb.Append("</td>");
|
||||
|
||||
// #endregion
|
||||
|
||||
// }
|
||||
// }
|
||||
// sb.Append("</tr>");
|
||||
// sb.Append("<tr>");
|
||||
// for (i = 0; i < dt_list.Rows.Count; i++)
|
||||
// {
|
||||
// //如果第一行超过一半的按钮就重新放一行
|
||||
// int second1 = dt_list.Rows.Count;
|
||||
// if ((second1) % 2 == 1)
|
||||
// {
|
||||
// second1 = second1 / 2 + 1;
|
||||
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// second1 = dt_list.Rows.Count / 2;
|
||||
// }
|
||||
// if (i > second1)
|
||||
// {
|
||||
// #region 第二行按钮
|
||||
|
||||
|
||||
// sb.Append("<td style=\"height:50%\">");
|
||||
// //标签id
|
||||
// string id = "button_ando_material_" + dt_list.Rows[i]["编号"].ToString();
|
||||
|
||||
// #region 颜色代码
|
||||
|
||||
// //标签值
|
||||
// string value = dt_list.Rows[i]["编号描述2"].ToString();
|
||||
// string color = dt_list.Rows[i]["颜色代码"].ToString();
|
||||
// //string inputColor = "background-color:" + color + "";
|
||||
// if (color == "0")
|
||||
// {
|
||||
// sb.Append("<input type=\"button\" onclick=\"andon_material(id)\" id=\"" + id + "\" value=\"" + value + "\" style=\"width: 140px; height:100%;\"/>");
|
||||
// }
|
||||
// if (color == "1")
|
||||
// {
|
||||
// sb.Append("<input type=\"button\" onclick=\"andon_material(id)\" id=\"" + id + "\" value=\"" + value + "\" style=\"width: 140px; height:100%;background-color:pink;\"/>");
|
||||
// }
|
||||
// if (color == "2")
|
||||
// {
|
||||
// sb.Append("<input type=\"button\" onclick=\"andon_material(id)\" id=\"" + id + "\" value=\"" + value + "\" style=\"width: 140px; height:100%;background-color:yellow;\"/>");
|
||||
// }
|
||||
// #endregion
|
||||
|
||||
// sb.Append("</td>");
|
||||
// #endregion
|
||||
|
||||
// }
|
||||
// }
|
||||
// sb.Append("</tr>");
|
||||
// }
|
||||
// //小于4个物料ando按钮
|
||||
// else
|
||||
// {
|
||||
// sb.Append("<tr>");
|
||||
// int i = 0;
|
||||
// for (i = 0; i < dt_list.Rows.Count; i++)
|
||||
// {
|
||||
// //如果按钮数小于一半,都放在第一行
|
||||
// if (i < dt_list.Rows.Count)
|
||||
// {
|
||||
// #region 第一行按钮
|
||||
|
||||
|
||||
// sb.Append("<td style=\"height:50%\">");
|
||||
// //标签id
|
||||
// string id = "button_ando_material_" + dt_list.Rows[i]["编号"].ToString();
|
||||
|
||||
// #region 颜色代码
|
||||
|
||||
// //标签值
|
||||
// string value = dt_list.Rows[i]["编号描述2"].ToString();
|
||||
// string color = dt_list.Rows[i]["颜色代码"].ToString();
|
||||
// //string inputColor = "background-color:" + color + "";
|
||||
// if (color == "0")
|
||||
// {
|
||||
// sb.Append("<input type=\"button\" onclick=\"andon_material(id)\" id=\"" + id + "\" value=\"" + value + "\" style=\"width: 140px; height:100%;\"/>");
|
||||
// }
|
||||
// if (color == "1")
|
||||
// {
|
||||
// sb.Append("<input type=\"button\" onclick=\"andon_material(id)\" id=\"" + id + "\" value=\"" + value + "\" style=\"width: 140px; height:100%;background-color:pink;\"/>");
|
||||
// }
|
||||
// if (color == "2")
|
||||
// {
|
||||
// sb.Append("<input type=\"button\" onclick=\"andon_material(id)\" id=\"" + id + "\" value=\"" + value + "\" style=\"width: 140px; height:100%;background-color:yellow;\"/>");
|
||||
// }
|
||||
// #endregion
|
||||
|
||||
// sb.Append("</td>");
|
||||
|
||||
// #endregion
|
||||
|
||||
// }
|
||||
// }
|
||||
// sb.Append("</tr>");
|
||||
// }
|
||||
//sb.Append("</table>");
|
||||
|
||||
//return sb.ToString();
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
225
Common/07WebBusinessFacade/BusinessFacade/Web/ando_quality.cs
Normal file
225
Common/07WebBusinessFacade/BusinessFacade/Web/ando_quality.cs
Normal file
@@ -0,0 +1,225 @@
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using DataLinkMesWork;
|
||||
using System.Security.Cryptography;
|
||||
//using SystemFramework;
|
||||
using System.Text;
|
||||
using System;
|
||||
|
||||
namespace bizFacade
|
||||
{
|
||||
public class ando_quality
|
||||
{
|
||||
/// <summary>
|
||||
/// 创建质量ando
|
||||
/// </summary>
|
||||
/// <param name="opname"></param>
|
||||
/// <param name="AndoTypeCode"></param>
|
||||
/// <returns></returns>
|
||||
public static string CreateAndo_quality(string opname, string AndoTypeCode)
|
||||
{
|
||||
System.Data.DataTable dt_list;
|
||||
//查询ando明细
|
||||
ando_matertial.andoListSelect(opname, AndoTypeCode, out dt_list);
|
||||
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.Append("<div id=\"div_ando_second_main\" class=\"div_ando_second_main\">");
|
||||
sb.Append("<div id=\"div_ando_second\" class=\"div_ando_second\">");
|
||||
sb.Append("<div style=\"width:96%;height:92%;margin-left:10px;margin-top:10px;\">");
|
||||
|
||||
#region 大图片的div
|
||||
sb.Append("<div style=\"width:8%;height:100%;float:left;\">");
|
||||
sb.Append("<img alt=\"loading....\" src=\"../images/ando_quality.png\" width=\"92%\" height=\"100%\" onclick=\"btn_Manual_QualityDataFTT()\" />");
|
||||
sb.Append("</div>");
|
||||
#endregion
|
||||
|
||||
#region 整个ANDON选项DIV
|
||||
sb.Append("<div style=\"width:70%;height:100%;float:left;\">");
|
||||
|
||||
#region 左按钮DIV
|
||||
sb.Append("<div style=\"width:10%;height:100%;float:left;\">");
|
||||
sb.Append("<input type=\"button\" style=\"width:100%;height:100%;text-align:center;font-size:30px;\" value=\"<<\" onclick=\"quality_RightMove()\" />");
|
||||
sb.Append("</div>");
|
||||
#endregion
|
||||
|
||||
|
||||
#region 中间内容DIV
|
||||
sb.Append("<div style=\"width:80%;height:100%;float:left;\">");
|
||||
|
||||
#region 可支持移动的div
|
||||
|
||||
sb.Append("<div style=\"width:100%;height:100%; overflow:hidden;position:relative;\">");
|
||||
|
||||
sb.Append("<div id=\"div_quality_Scroll\" style=\"width:100%;height:100%; position:relative;\">");
|
||||
|
||||
|
||||
//附加tabel
|
||||
string tabelString = CreatAndo_quality_table(opname, AndoTypeCode);
|
||||
sb.Append(tabelString);
|
||||
|
||||
sb.Append("</div>");
|
||||
sb.Append("</div>");
|
||||
#endregion
|
||||
|
||||
sb.Append("</div>");
|
||||
#endregion
|
||||
|
||||
#region 右按钮div
|
||||
|
||||
sb.Append("<div style=\"width:10%;height:100%;float:left;\">");
|
||||
|
||||
sb.Append("<input type=\"button\" style=\"width:100%;height:100%;text-align:center;font-size:30px;\" value=\">>\" onclick=\"qualty_leftMove()\" />");
|
||||
sb.Append("</div>");
|
||||
|
||||
#endregion
|
||||
|
||||
sb.Append("</div>");
|
||||
#endregion
|
||||
#region ando按钮div
|
||||
|
||||
sb.Append("<div style=\"width:22%;height:100%;float:left;\">");
|
||||
|
||||
sb.Append("<div style=\"width: 100%; height: 100%; margin: 30px 0px 0px -5px;\">");
|
||||
|
||||
sb.Append("<table style=\"width: 100%;\">");
|
||||
sb.Append("<tr>");
|
||||
sb.Append("<td align=\"left\">");
|
||||
sb.Append("<img onclick=\"andon_quality_call_down('m_quality_call')\" alt=\"loading...\" id='m_quality_call' src=\"../images/call.png\" style=\"width: 100px; height: 80px\"/>");
|
||||
sb.Append("</td>");
|
||||
sb.Append("<td align=\"right\">");
|
||||
sb.Append("<img onclick=\"andon_quality_reset_down('m_quality_reset')\" alt=\"loading...\" id='m_quality_reset' src=\"../images/reset.png\" style=\"width: 100px;height: 80px\" />");
|
||||
sb.Append("</td>");
|
||||
sb.Append("</tr>");
|
||||
sb.Append("<tr>");
|
||||
sb.Append("<td style=\"padding-top: 20px\" align=\"center\">");
|
||||
sb.Append("<label style=\"padding-top: 20px;font-size:18px;\">呼 叫</label>");
|
||||
sb.Append("</td>");
|
||||
sb.Append("<td style=\"padding-top: 20px\" align=\"center\">");
|
||||
sb.Append("<label style=\"padding-top: 20px;font-size:18px;\">复 位</label>");
|
||||
sb.Append("</td>");
|
||||
sb.Append("</tr>");
|
||||
sb.Append("</table>");
|
||||
|
||||
sb.Append("</div>");
|
||||
|
||||
sb.Append("</div>");
|
||||
|
||||
#endregion
|
||||
|
||||
sb.Append("</div></div></div>");
|
||||
|
||||
|
||||
return sb.ToString();
|
||||
//string text = "";
|
||||
//int count = dt_list.Rows.Count/2*120;
|
||||
//return text = "{\"InnerHtml\":\"" + sb.ToString() + "\",\"Count\":\"" + count + "\"}";
|
||||
}
|
||||
/// <summary>
|
||||
/// 创建物料ando的table
|
||||
/// </summary>
|
||||
/// <param name="opname"></param>
|
||||
/// <param name="AndoTypeCode"></param>
|
||||
/// <returns></returns>
|
||||
public static string CreatAndo_quality_table(string opname, string AndoTypeCode)
|
||||
{
|
||||
System.Data.DataTable dt_list;
|
||||
//查询ando明细
|
||||
ando_matertial.andoListSelect(opname, AndoTypeCode, out dt_list);
|
||||
StringBuilder sb = new StringBuilder();
|
||||
int tableCount = dt_list.Rows.Count;
|
||||
int td_count = (tableCount / 2) + (tableCount % 2);//获取每个tr中应该创建多少个td
|
||||
int tablewidth = 145 * td_count;
|
||||
if (tablewidth == 0)
|
||||
{
|
||||
tablewidth = 10;
|
||||
}
|
||||
string tablewidth2 = Convert.ToString(tablewidth) + "px";
|
||||
|
||||
#region table
|
||||
|
||||
sb.Append("<table id=\"table_quality_Scroll\" style=\"width:" + tablewidth2 + ";height:100%;left:0px;\">");
|
||||
|
||||
//创建第一行
|
||||
sb.Append("<tr>");
|
||||
for (int i = 0; i < td_count; i++)
|
||||
{
|
||||
#region 第一行按钮
|
||||
sb.Append("<td style=\"height:50%;width:145px;\">");
|
||||
//标签id
|
||||
string id = "button_ando_quality_" + dt_list.Rows[i]["编号"].ToString();
|
||||
|
||||
#region 颜色代码
|
||||
//标签值
|
||||
string value = dt_list.Rows[i]["编号描述2"].ToString();
|
||||
string color = dt_list.Rows[i]["颜色代码"].ToString();
|
||||
//string inputColor = "background-color:" + color + "";
|
||||
if (color == "0")
|
||||
{
|
||||
sb.Append("<input type=\"button\" onclick=\"andon_quality(id)\" id=\"" + id + "\" value=\"" + value + "\" style=\"width: 140px; height:100%;\"/>");
|
||||
}
|
||||
if (color == "1")
|
||||
{
|
||||
sb.Append("<input type=\"button\" onclick=\"andon_quality(id)\" id=\"" + id + "\" value=\"" + value + "\" style=\"width: 140px; height:100%;background-color:pink;\"/>");
|
||||
}
|
||||
if (color == "2")
|
||||
{
|
||||
sb.Append("<input type=\"button\" onclick=\"andon_quality(id)\" id=\"" + id + "\" value=\"" + value + "\" style=\"width: 140px; height:100%;background-color:yellow;\"/>");
|
||||
}
|
||||
#endregion
|
||||
|
||||
sb.Append("</td>");
|
||||
|
||||
#endregion
|
||||
}
|
||||
sb.Append("</tr>");
|
||||
|
||||
|
||||
//创建第二行
|
||||
sb.Append("<tr>");
|
||||
for (int i = td_count; i < tableCount; i++)
|
||||
{
|
||||
#region 第二行按钮
|
||||
sb.Append("<td style=\"height:50%;width:145px;\">");
|
||||
//标签id
|
||||
string id = "button_ando_quality_" + dt_list.Rows[i]["编号"].ToString();
|
||||
|
||||
#region 颜色代码
|
||||
//标签值
|
||||
string value = dt_list.Rows[i]["编号描述2"].ToString();
|
||||
string color = dt_list.Rows[i]["颜色代码"].ToString();
|
||||
if (color == "0")
|
||||
{
|
||||
sb.Append("<input type=\"button\" onclick=\"andon_quality(id)\" id=\"" + id + "\" value=\"" + value + "\" style=\"width: 140px; height:100%;\"/>");
|
||||
}
|
||||
if (color == "1")
|
||||
{
|
||||
sb.Append("<input type=\"button\" onclick=\"andon_quality(id)\" id=\"" + id + "\" value=\"" + value + "\" style=\"width: 140px; height:100%;background-color:pink;\"/>");
|
||||
}
|
||||
if (color == "2")
|
||||
{
|
||||
sb.Append("<input type=\"button\" onclick=\"andon_quality(id)\" id=\"" + id + "\" value=\"" + value + "\" style=\"width: 140px; height:100%;background-color:yellow;\"/>");
|
||||
}
|
||||
#endregion
|
||||
|
||||
sb.Append("</td>");
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
//补充第二行的信息
|
||||
if ((tableCount % 2) > 0 && (tableCount > 0))
|
||||
{
|
||||
sb.Append("<td style=\"height:50%\">");
|
||||
sb.Append("</td>");
|
||||
}
|
||||
sb.Append("</tr>");
|
||||
|
||||
//最后组合成table
|
||||
sb.Append("</table>");
|
||||
return sb.ToString();
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
225
Common/07WebBusinessFacade/BusinessFacade/Web/ando_quality_2.cs
Normal file
225
Common/07WebBusinessFacade/BusinessFacade/Web/ando_quality_2.cs
Normal file
@@ -0,0 +1,225 @@
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using DataLinkMesWork;
|
||||
using System.Security.Cryptography;
|
||||
//using SystemFramework;
|
||||
using System.Text;
|
||||
using System;
|
||||
|
||||
namespace bizFacade
|
||||
{
|
||||
public class ando_quality_2
|
||||
{
|
||||
/// <summary>
|
||||
/// 创建质量ando
|
||||
/// </summary>
|
||||
/// <param name="opname"></param>
|
||||
/// <param name="AndoTypeCode"></param>
|
||||
/// <returns></returns>
|
||||
public static string CreateAndo_quality(string opname, string AndoTypeCode)
|
||||
{
|
||||
System.Data.DataTable dt_list;
|
||||
//查询ando明细
|
||||
ando_matertial.andoListSelect(opname, AndoTypeCode, out dt_list);
|
||||
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.Append("<div id=\"div_ando_second_main\" class=\"div_ando_second_main\">");
|
||||
sb.Append("<div id=\"div_ando_second\" class=\"div_ando_second\">");
|
||||
sb.Append("<div style=\"width:96%;height:92%;margin-left:10px;margin-top:10px;\">");
|
||||
|
||||
#region 大图片的div
|
||||
sb.Append("<div style=\"width:8%;height:100%;float:left;\">");
|
||||
sb.Append("<img alt=\"loading....\" src=\"../images/ando_quality.png\" width=\"92%\" height=\"100%\" onclick=\"btn_Manual_QualityDataFTT()\" />");
|
||||
sb.Append("</div>");
|
||||
#endregion
|
||||
|
||||
#region 整个ANDON选项DIV
|
||||
sb.Append("<div style=\"width:67%;height:100%;float:left;\">");
|
||||
|
||||
#region 左按钮DIV
|
||||
sb.Append("<div style=\"width:10%;height:100%;float:left;\">");
|
||||
sb.Append("<input type=\"button\" style=\"width:100%;height:100%;text-align:center;font-size:30px;\" value=\"<<\" onclick=\"quality_RightMove()\" />");
|
||||
sb.Append("</div>");
|
||||
#endregion
|
||||
|
||||
|
||||
#region 中间内容DIV
|
||||
sb.Append("<div style=\"width:80%;height:100%;float:left;\">");
|
||||
|
||||
#region 可支持移动的div
|
||||
|
||||
sb.Append("<div style=\"width:100%;height:100%; overflow:hidden;position:relative;\">");
|
||||
|
||||
sb.Append("<div id=\"div_quality_Scroll\" style=\"width:100%;height:100%; position:relative;\">");
|
||||
|
||||
|
||||
//附加tabel
|
||||
string tabelString = CreatAndo_quality_table(opname, AndoTypeCode);
|
||||
sb.Append(tabelString);
|
||||
|
||||
sb.Append("</div>");
|
||||
sb.Append("</div>");
|
||||
#endregion
|
||||
|
||||
sb.Append("</div>");
|
||||
#endregion
|
||||
|
||||
#region 右按钮div
|
||||
|
||||
sb.Append("<div style=\"width:10%;height:100%;float:left;\">");
|
||||
|
||||
sb.Append("<input type=\"button\" style=\"width:100%;height:100%;text-align:center;font-size:30px;\" value=\">>\" onclick=\"qualty_leftMove()\" />");
|
||||
sb.Append("</div>");
|
||||
|
||||
#endregion
|
||||
|
||||
sb.Append("</div>");
|
||||
#endregion
|
||||
#region ando按钮div
|
||||
|
||||
sb.Append("<div style=\"width:25%;height:100%;float:left;\">");
|
||||
|
||||
sb.Append("<div style=\"width: 100%; height:80%; margin: 20px 0px 0px 5px;\">");
|
||||
|
||||
sb.Append("<table style=\"width: 100%;\">");
|
||||
sb.Append("<tr>");
|
||||
sb.Append("<td align=\"left\">");
|
||||
sb.Append("<img onclick=\"andon_quality_call_down('m_quality_call')\" alt=\"loading...\" id='m_quality_call' src=\"../images/call.png\" style=\"width: 100px; height: 80px\"/>");
|
||||
sb.Append("</td>");
|
||||
sb.Append("<td align=\"right\">");
|
||||
sb.Append("<img onclick=\"andon_quality_reset_down('m_quality_reset')\" alt=\"loading...\" id='m_quality_reset' src=\"../images/reset.png\" style=\"width: 100px;height: 80px\" />");
|
||||
sb.Append("</td>");
|
||||
sb.Append("</tr>");
|
||||
sb.Append("<tr>");
|
||||
sb.Append("<td style=\"padding-top: 20px\" align=\"center\">");
|
||||
sb.Append("<label style=\"padding-top: 20px;font-size:18px;\">呼 叫</label>");
|
||||
sb.Append("</td>");
|
||||
sb.Append("<td style=\"padding-top: 20px\" align=\"center\">");
|
||||
sb.Append("<label style=\"padding-top: 20px;font-size:18px;\">复 位</label>");
|
||||
sb.Append("</td>");
|
||||
sb.Append("</tr>");
|
||||
sb.Append("</table>");
|
||||
|
||||
sb.Append("</div>");
|
||||
|
||||
sb.Append("</div>");
|
||||
|
||||
#endregion
|
||||
|
||||
sb.Append("</div></div></div>");
|
||||
|
||||
|
||||
return sb.ToString();
|
||||
//string text = "";
|
||||
//int count = dt_list.Rows.Count/2*120;
|
||||
//return text = "{\"InnerHtml\":\"" + sb.ToString() + "\",\"Count\":\"" + count + "\"}";
|
||||
}
|
||||
/// <summary>
|
||||
/// 创建物料ando的table
|
||||
/// </summary>
|
||||
/// <param name="opname"></param>
|
||||
/// <param name="AndoTypeCode"></param>
|
||||
/// <returns></returns>
|
||||
public static string CreatAndo_quality_table(string opname, string AndoTypeCode)
|
||||
{
|
||||
System.Data.DataTable dt_list;
|
||||
//查询ando明细
|
||||
ando_matertial.andoListSelect(opname, AndoTypeCode, out dt_list);
|
||||
StringBuilder sb = new StringBuilder();
|
||||
int tableCount = dt_list.Rows.Count;
|
||||
int td_count = (tableCount / 2) + (tableCount % 2);//获取每个tr中应该创建多少个td
|
||||
int tablewidth = 145 * td_count;
|
||||
if (tablewidth == 0)
|
||||
{
|
||||
tablewidth = 10;
|
||||
}
|
||||
string tablewidth2 = Convert.ToString(tablewidth) + "px";
|
||||
|
||||
#region table
|
||||
|
||||
sb.Append("<table id=\"table_quality_Scroll\" style=\"width:" + tablewidth2 + ";height:100%;left:0px;\">");
|
||||
|
||||
//创建第一行
|
||||
sb.Append("<tr>");
|
||||
for (int i = 0; i < td_count; i++)
|
||||
{
|
||||
#region 第一行按钮
|
||||
sb.Append("<td style=\"height:50%;width:145px;\">");
|
||||
//标签id
|
||||
string id = "button_ando_quality_" + dt_list.Rows[i]["编号"].ToString();
|
||||
|
||||
#region 颜色代码
|
||||
//标签值
|
||||
string value = dt_list.Rows[i]["编号描述2"].ToString();
|
||||
string color = dt_list.Rows[i]["颜色代码"].ToString();
|
||||
//string inputColor = "background-color:" + color + "";
|
||||
if (color == "0")
|
||||
{
|
||||
sb.Append("<input type=\"button\" onclick=\"andon_quality(id)\" id=\"" + id + "\" value=\"" + value + "\" style=\"width: 140px; height:100%;\"/>");
|
||||
}
|
||||
if (color == "1")
|
||||
{
|
||||
sb.Append("<input type=\"button\" onclick=\"andon_quality(id)\" id=\"" + id + "\" value=\"" + value + "\" style=\"width: 140px; height:100%;background-color:pink;\"/>");
|
||||
}
|
||||
if (color == "2")
|
||||
{
|
||||
sb.Append("<input type=\"button\" onclick=\"andon_quality(id)\" id=\"" + id + "\" value=\"" + value + "\" style=\"width: 140px; height:100%;background-color:yellow;\"/>");
|
||||
}
|
||||
#endregion
|
||||
|
||||
sb.Append("</td>");
|
||||
|
||||
#endregion
|
||||
}
|
||||
sb.Append("</tr>");
|
||||
|
||||
|
||||
//创建第二行
|
||||
sb.Append("<tr>");
|
||||
for (int i = td_count; i < tableCount; i++)
|
||||
{
|
||||
#region 第二行按钮
|
||||
sb.Append("<td style=\"height:50%;width:145px;\">");
|
||||
//标签id
|
||||
string id = "button_ando_quality_" + dt_list.Rows[i]["编号"].ToString();
|
||||
|
||||
#region 颜色代码
|
||||
//标签值
|
||||
string value = dt_list.Rows[i]["编号描述2"].ToString();
|
||||
string color = dt_list.Rows[i]["颜色代码"].ToString();
|
||||
if (color == "0")
|
||||
{
|
||||
sb.Append("<input type=\"button\" onclick=\"andon_quality(id)\" id=\"" + id + "\" value=\"" + value + "\" style=\"width: 140px; height:100%;\"/>");
|
||||
}
|
||||
if (color == "1")
|
||||
{
|
||||
sb.Append("<input type=\"button\" onclick=\"andon_quality(id)\" id=\"" + id + "\" value=\"" + value + "\" style=\"width: 140px; height:100%;background-color:pink;\"/>");
|
||||
}
|
||||
if (color == "2")
|
||||
{
|
||||
sb.Append("<input type=\"button\" onclick=\"andon_quality(id)\" id=\"" + id + "\" value=\"" + value + "\" style=\"width: 140px; height:100%;background-color:yellow;\"/>");
|
||||
}
|
||||
#endregion
|
||||
|
||||
sb.Append("</td>");
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
//补充第二行的信息
|
||||
if ((tableCount % 2) > 0 && (tableCount > 0))
|
||||
{
|
||||
sb.Append("<td style=\"height:50%\">");
|
||||
sb.Append("</td>");
|
||||
}
|
||||
sb.Append("</tr>");
|
||||
|
||||
//最后组合成table
|
||||
sb.Append("</table>");
|
||||
return sb.ToString();
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
Common/07WebBusinessFacade/BusinessFacade/Web/vssver2.scc
Normal file
BIN
Common/07WebBusinessFacade/BusinessFacade/Web/vssver2.scc
Normal file
Binary file not shown.
Reference in New Issue
Block a user