chore: 初始化北汽福田MES采集程序
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user