You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
817 lines
32 KiB
817 lines
32 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using QMFrameWork.Data;
|
|
using QMFrameWork.Log;
|
|
using System.Data;
|
|
using QMAPP.FJC.Entity.ProcessParameter;
|
|
using QMAPP.FJC.Entity.Produce;
|
|
using QMAPP.FJC.Entity.Operation;
|
|
|
|
namespace QMAPP.FJC.DAL.ProductPetrospect
|
|
{
|
|
/// <summary>
|
|
/// 模块编号:M5-1
|
|
/// 作 用:产品档案数据层
|
|
/// 作 者:王丹丹
|
|
/// 编写日期:2015年06月08日
|
|
///</summary>
|
|
public class ProductArchivesDAL
|
|
{
|
|
#region 根据本体ID、工序类别获取加工记录
|
|
/// <summary>
|
|
/// 根据本体ID、工序类别获取加工记录
|
|
/// </summary>
|
|
/// <param name="">条件</param>
|
|
/// <returns>*信息</returns>
|
|
public MainOperation GetMainOperation(Main condition)
|
|
{
|
|
List<DataParameter> parameters = new List<DataParameter>();
|
|
StringBuilder sqlBuilder = new StringBuilder();
|
|
StringBuilder whereBuilder = new StringBuilder();
|
|
MainOperation mainPoeration = new MainOperation();
|
|
try
|
|
{
|
|
//sqlBuilder.AppendLine(" SELECT MO.* FROM T_AW_MAINPRODUCT MP ");
|
|
//sqlBuilder.AppendLine(" LEFT JOIN T_AW_MAINOPERATION MO ON MO.PID=MP.MOID ");
|
|
|
|
sqlBuilder.AppendLine(" SELECT MO.* FROM T_AW_MAINPRODUCT MP ");
|
|
sqlBuilder.AppendLine(" LEFT JOIN T_AW_MAINOPERATION MO ON MO.PDID=MP.PDID ");
|
|
sqlBuilder.AppendLine(" WHERE MP.MID =@PID ");
|
|
//工序类别
|
|
if (string.IsNullOrEmpty(condition.PROCESSTYPE) == false)
|
|
{
|
|
sqlBuilder.Append(" AND MO.PROCESSTYPE =@PROCESSTYPE ");
|
|
|
|
}
|
|
sqlBuilder.AppendLine(" union ");
|
|
|
|
sqlBuilder.AppendLine(" SELECT distinct MO.* FROM T_AW_MAINPRODUCT MP ");
|
|
sqlBuilder.AppendLine(" LEFT JOIN T_AW_MAINOPERATION MO ON MO.PDID=MP.MID ");
|
|
sqlBuilder.AppendLine(" WHERE MP.MID =@PID ");
|
|
|
|
|
|
parameters.Add(new DataParameter { ParameterName = "PID", DataType = DbType.String, Value = condition.PID });
|
|
|
|
//工序类别
|
|
if (string.IsNullOrEmpty(condition.PROCESSTYPE) == false)
|
|
{
|
|
sqlBuilder.Append(" AND MO.PROCESSTYPE =@PROCESSTYPE ");
|
|
parameters.Add(new DataParameter { ParameterName = "PROCESSTYPE", DataType = DbType.String, Value = condition.PROCESSTYPE });
|
|
}
|
|
//if (whereBuilder.Length > 0)
|
|
//{
|
|
// sqlBuilder.Append(" WHERE " + whereBuilder.ToString().Substring(4));
|
|
//}
|
|
using (IDataSession session = AppDataFactory.CreateMainSession())
|
|
{
|
|
//获取信息
|
|
mainPoeration = session.Get<MainOperation>(sqlBuilder.ToString(), parameters.ToArray());
|
|
}
|
|
return mainPoeration;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
LogManager.LogHelper.Error(new LogInfo()
|
|
{
|
|
ErrorInfo = ex,
|
|
Tag = ex.StackTrace,
|
|
Info = "产品档案数据层-根据本体ID、工序类别获取加工记录"
|
|
});
|
|
throw;
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 根据本体ID、工序类别获取加工记录
|
|
/// </summary>
|
|
/// <param name="">条件</param>
|
|
/// <returns>*信息</returns>
|
|
public List<MainOperation> GetMainOperations(Main condition)
|
|
{
|
|
List<DataParameter> parameters = new List<DataParameter>();
|
|
StringBuilder sqlBuilder = new StringBuilder();
|
|
StringBuilder whereBuilder = new StringBuilder();
|
|
List<MainOperation> mainPoerations = new List<MainOperation>();
|
|
try
|
|
{
|
|
//sqlBuilder.AppendLine(" SELECT MO.* FROM T_AW_MAINPRODUCT MP ");
|
|
//sqlBuilder.AppendLine(" LEFT JOIN T_AW_MAINOPERATION MO ON MO.PID=MP.MOID ");
|
|
|
|
sqlBuilder.AppendLine(" SELECT MO.* FROM T_AW_MAINPRODUCT MP ");
|
|
sqlBuilder.AppendLine(" LEFT JOIN T_AW_MAINOPERATION MO ON MO.PDID=MP.PDID ");
|
|
sqlBuilder.AppendLine(" WHERE MP.MID =@PID ");
|
|
//工序类别
|
|
if (string.IsNullOrEmpty(condition.PROCESSTYPE) == false)
|
|
{
|
|
sqlBuilder.Append(" AND MO.PROCESSTYPE =@PROCESSTYPE ");
|
|
|
|
}
|
|
sqlBuilder.AppendLine(" union ");
|
|
|
|
sqlBuilder.AppendLine(" SELECT distinct MO.* FROM T_AW_MAINPRODUCT MP ");
|
|
sqlBuilder.AppendLine(" LEFT JOIN T_AW_MAINOPERATION MO ON MO.PDID=MP.MID ");
|
|
sqlBuilder.AppendLine(" WHERE MP.MID =@PID ");
|
|
|
|
|
|
parameters.Add(new DataParameter { ParameterName = "PID", DataType = DbType.String, Value = condition.PID });
|
|
|
|
//工序类别
|
|
if (string.IsNullOrEmpty(condition.PROCESSTYPE) == false)
|
|
{
|
|
sqlBuilder.Append(" AND MO.PROCESSTYPE =@PROCESSTYPE ");
|
|
parameters.Add(new DataParameter { ParameterName = "PROCESSTYPE", DataType = DbType.String, Value = condition.PROCESSTYPE });
|
|
}
|
|
//if (whereBuilder.Length > 0)
|
|
//{
|
|
// sqlBuilder.Append(" WHERE " + whereBuilder.ToString().Substring(4));
|
|
//}
|
|
using (IDataSession session = AppDataFactory.CreateMainSession())
|
|
{
|
|
//获取信息
|
|
mainPoerations = session.GetList<MainOperation>(sqlBuilder.ToString(), parameters.ToArray()).ToList();
|
|
}
|
|
return mainPoerations;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
LogManager.LogHelper.Error(new LogInfo()
|
|
{
|
|
ErrorInfo = ex,
|
|
Tag = ex.StackTrace,
|
|
Info = "产品档案数据层-根据本体ID、工序类别获取加工记录"
|
|
});
|
|
throw;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 获取加工参数信息
|
|
/// <summary>
|
|
/// 获取加工参数信息
|
|
/// </summary>
|
|
/// <param name="">条件</param>
|
|
/// <returns>*信息</returns>
|
|
public List<DataTable> GetTableParamter(string strProductCode)
|
|
{
|
|
List<DataParameter> parameters = new List<DataParameter>();
|
|
List<DataTable> dtList = new List<DataTable>();
|
|
DataTable dt = new DataTable();
|
|
try
|
|
{
|
|
var sqls =string.Format(
|
|
"select distinct p.TABLENAME from T_AW_MAINOPERATION m,T_BD_PARAMETERCONFIG p where m.MACHINECODDE=p.MACHINECODDE and m.pdid in (select PRODUCT_PID from T_QT_PRODUCT_STRUCTURE where PROCESS_CODE='{0}' union select PART_PID from T_QT_PRODUCT_STRUCTURE where PROCESS_CODE='{0}')", strProductCode);
|
|
using (IDataSession session = AppDataFactory.CreateMainSession())
|
|
{
|
|
var tables = session.GetTable(sqls, parameters.ToArray());
|
|
if (tables != null && tables.Rows.Count>0)
|
|
{
|
|
for (int i = 0; i < tables.Rows.Count; i++)
|
|
{
|
|
var tableName = "[" + tables.Rows[i].ItemArray[0] + "]";
|
|
var sql = "SELECT * FROM " + tableName + " WHERE PRODUCTCODE = '" + strProductCode + "'";
|
|
dt = session.GetTable(sql, parameters.ToArray());
|
|
dtList.Add(dt);
|
|
|
|
}
|
|
|
|
}
|
|
}
|
|
return dtList;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
LogManager.LogHelper.Error(new LogInfo()
|
|
{
|
|
ErrorInfo = ex,
|
|
Tag = ex.StackTrace,
|
|
Info = "产品档案数据层-获取加工参数信息"
|
|
});
|
|
throw;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 获取搪塑加工参数信息
|
|
/// <summary>
|
|
/// 获取搪塑加工参数信息
|
|
/// </summary>
|
|
/// <param name="">条件</param>
|
|
/// <returns>*信息</returns>
|
|
public DataTable GetSlushParamter(SlushParamter condition)
|
|
{
|
|
List<DataParameter> parameters = new List<DataParameter>();
|
|
StringBuilder sqlBuilder = new StringBuilder();
|
|
StringBuilder whereBuilder = new StringBuilder();
|
|
DataTable dt = new DataTable();
|
|
try
|
|
{
|
|
sqlBuilder.AppendLine(" SELECT * ");
|
|
sqlBuilder.AppendLine(" FROM T_AW_SLUSHPARAMTER ");
|
|
//加工记录主键
|
|
if (string.IsNullOrEmpty(condition.IOID) == false)
|
|
{
|
|
whereBuilder.Append(" AND MOID =@MOID ");
|
|
parameters.Add(new DataParameter { ParameterName = "MOID", DataType = DbType.String, Value = condition.IOID });
|
|
}
|
|
if (whereBuilder.Length > 0)
|
|
{
|
|
sqlBuilder.Append(" WHERE " + whereBuilder.ToString().Substring(4));
|
|
}
|
|
using (IDataSession session = AppDataFactory.CreateMainSession())
|
|
{
|
|
dt.TableName = "搪塑";
|
|
//获取信息
|
|
dt = session.GetTable(sqlBuilder.ToString(), parameters.ToArray());
|
|
}
|
|
return dt;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
LogManager.LogHelper.Error(new LogInfo()
|
|
{
|
|
ErrorInfo = ex,
|
|
Tag = ex.StackTrace,
|
|
Info = "产品档案数据层-获取搪塑加工参数信息"
|
|
});
|
|
throw;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 获取注塑加工参数信息
|
|
/// <summary>
|
|
/// 获取注塑加工参数信息
|
|
/// </summary>
|
|
/// <param name="">条件</param>
|
|
/// <returns>*信息</returns>
|
|
public DataTable GetInJectionParameter(InJectionParameter condition)
|
|
{
|
|
List<DataParameter> parameters = new List<DataParameter>();
|
|
StringBuilder sqlBuilder = new StringBuilder();
|
|
StringBuilder whereBuilder = new StringBuilder();
|
|
DataTable dt = new DataTable();
|
|
try
|
|
{
|
|
sqlBuilder.AppendLine(" SELECT * ");
|
|
sqlBuilder.AppendLine(" FROM T_AW_INJECTIONPARAMETER ");
|
|
|
|
//加工记录主键
|
|
if (string.IsNullOrEmpty(condition.MOID) == false)
|
|
{
|
|
whereBuilder.Append(" AND MOID =@MOID ");
|
|
parameters.Add(new DataParameter { ParameterName = "MOID", DataType = DbType.String, Value = condition.MOID });
|
|
}
|
|
//零件类别
|
|
if (string.IsNullOrEmpty(condition.PRODUCTTYPE) == false)
|
|
{
|
|
whereBuilder.Append(" AND PRODUCTTYPE =@PRODUCTTYPE ");
|
|
parameters.Add(new DataParameter { ParameterName = "PRODUCTTYPE", DataType = DbType.String, Value = condition.PRODUCTTYPE });
|
|
}
|
|
if (whereBuilder.Length > 0)
|
|
{
|
|
sqlBuilder.Append(" WHERE " + whereBuilder.ToString().Substring(4));
|
|
}
|
|
using (IDataSession session = AppDataFactory.CreateMainSession())
|
|
{
|
|
//获取信息
|
|
dt = session.GetTable(sqlBuilder.ToString(), parameters.ToArray());
|
|
}
|
|
return dt;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
LogManager.LogHelper.Error(new LogInfo()
|
|
{
|
|
ErrorInfo = ex,
|
|
Tag = ex.StackTrace,
|
|
Info = "产品档案数据层-获取注塑加工参数信息"
|
|
});
|
|
throw;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 获取冷刀弱化参数信息
|
|
/// <summary>
|
|
/// 获取冷刀弱化参数信息
|
|
/// </summary>
|
|
/// <param name="">条件</param>
|
|
/// <returns>*信息</returns>
|
|
public DataTable GetBurnParameter(BurnParameter condition)
|
|
{
|
|
List<DataParameter> parameters = new List<DataParameter>();
|
|
StringBuilder sqlBuilder = new StringBuilder();
|
|
StringBuilder whereBuilder = new StringBuilder();
|
|
DataTable dt = new DataTable();
|
|
try
|
|
{
|
|
sqlBuilder.AppendLine(" SELECT * ");
|
|
sqlBuilder.AppendLine(" FROM T_AW_BURNPARAMETER ");
|
|
|
|
//加工记录主键
|
|
if (string.IsNullOrEmpty(condition.MOID) == false)
|
|
{
|
|
whereBuilder.Append(" AND MOID =@MOID ");
|
|
parameters.Add(new DataParameter { ParameterName = "MOID", DataType = DbType.String, Value = condition.MOID });
|
|
}
|
|
if (whereBuilder.Length > 0)
|
|
{
|
|
sqlBuilder.Append(" WHERE " + whereBuilder.ToString().Substring(4));
|
|
}
|
|
using (IDataSession session = AppDataFactory.CreateMainSession())
|
|
{
|
|
//获取信息
|
|
dt = session.GetTable(sqlBuilder.ToString(), parameters.ToArray());
|
|
}
|
|
return dt;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
LogManager.LogHelper.Error(new LogInfo()
|
|
{
|
|
ErrorInfo = ex,
|
|
Tag = ex.StackTrace,
|
|
Info = "产品档案数据层-获取冷刀弱化参数信息"
|
|
});
|
|
throw;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 获取火焰加工参数信息
|
|
/// <summary>
|
|
/// 获取火焰加工参数信息
|
|
/// </summary>
|
|
/// <param name="">条件</param>
|
|
/// <returns>*信息</returns>
|
|
public DataTable GetFlamepParameter(FlamepParameter condition)
|
|
{
|
|
List<DataParameter> parameters = new List<DataParameter>();
|
|
StringBuilder sqlBuilder = new StringBuilder();
|
|
StringBuilder whereBuilder = new StringBuilder();
|
|
DataTable dt = new DataTable();
|
|
try
|
|
{
|
|
sqlBuilder.AppendLine(" SELECT * ");
|
|
sqlBuilder.AppendLine(" FROM T_AW_FLAMEPPARAMETER ");
|
|
|
|
//加工记录主键
|
|
if (string.IsNullOrEmpty(condition.MOID) == false)
|
|
{
|
|
whereBuilder.Append(" AND MOID =@MOID ");
|
|
parameters.Add(new DataParameter { ParameterName = "MOID", DataType = DbType.String, Value = condition.MOID });
|
|
}
|
|
if (whereBuilder.Length > 0)
|
|
{
|
|
sqlBuilder.Append(" WHERE " + whereBuilder.ToString().Substring(4));
|
|
}
|
|
using (IDataSession session = AppDataFactory.CreateMainSession())
|
|
{
|
|
//获取信息
|
|
dt = session.GetTable(sqlBuilder.ToString(), parameters.ToArray());
|
|
}
|
|
return dt;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
LogManager.LogHelper.Error(new LogInfo()
|
|
{
|
|
ErrorInfo = ex,
|
|
Tag = ex.StackTrace,
|
|
Info = "产品档案数据层-获取火焰加工参数信息"
|
|
});
|
|
throw;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 获取预热参数信息
|
|
/// <summary>
|
|
/// 获取预热参数信息
|
|
/// </summary>
|
|
/// <param name="">条件</param>
|
|
/// <returns>*信息</returns>
|
|
public DataTable GetPreheatParameter(PreheatParameter condition)
|
|
{
|
|
List<DataParameter> parameters = new List<DataParameter>();
|
|
StringBuilder sqlBuilder = new StringBuilder();
|
|
StringBuilder whereBuilder = new StringBuilder();
|
|
DataTable dt = new DataTable();
|
|
try
|
|
{
|
|
sqlBuilder.AppendLine(" SELECT * ");
|
|
sqlBuilder.AppendLine(" FROM T_AW_PREHEATPARAMETER ");
|
|
|
|
//加工记录主键
|
|
if (string.IsNullOrEmpty(condition.MOID) == false)
|
|
{
|
|
whereBuilder.Append(" AND MOID =@MOID ");
|
|
parameters.Add(new DataParameter { ParameterName = "MOID", DataType = DbType.String, Value = condition.MOID });
|
|
}
|
|
if (whereBuilder.Length > 0)
|
|
{
|
|
sqlBuilder.Append(" WHERE " + whereBuilder.ToString().Substring(4));
|
|
}
|
|
using (IDataSession session = AppDataFactory.CreateMainSession())
|
|
{
|
|
//获取信息
|
|
dt = session.GetTable(sqlBuilder.ToString(), parameters.ToArray());
|
|
}
|
|
return dt;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
LogManager.LogHelper.Error(new LogInfo()
|
|
{
|
|
ErrorInfo = ex,
|
|
Tag = ex.StackTrace,
|
|
Info = "产品档案数据层-获取预热参数信息"
|
|
});
|
|
throw;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 获取浇注参数信息
|
|
/// <summary>
|
|
/// 获取浇注参数信息
|
|
/// </summary>
|
|
/// <param name="">条件</param>
|
|
/// <returns>*信息</returns>
|
|
public DataTable GetCastingParameter(CastingParameter condition)
|
|
{
|
|
List<DataParameter> parameters = new List<DataParameter>();
|
|
StringBuilder sqlBuilder = new StringBuilder();
|
|
StringBuilder whereBuilder = new StringBuilder();
|
|
DataTable dt = new DataTable();
|
|
try
|
|
{
|
|
sqlBuilder.AppendLine(" SELECT * ");
|
|
sqlBuilder.AppendLine(" FROM T_AW_CASTINGPARAMETER ");
|
|
|
|
//加工记录主键
|
|
if (string.IsNullOrEmpty(condition.MOID) == false)
|
|
{
|
|
whereBuilder.Append(" AND MOID =@MOID ");
|
|
parameters.Add(new DataParameter { ParameterName = "MOID", DataType = DbType.String, Value = condition.MOID });
|
|
}
|
|
if (whereBuilder.Length > 0)
|
|
{
|
|
sqlBuilder.Append(" WHERE " + whereBuilder.ToString().Substring(4));
|
|
}
|
|
using (IDataSession session = AppDataFactory.CreateMainSession())
|
|
{
|
|
//获取信息
|
|
dt = session.GetTable(sqlBuilder.ToString(), parameters.ToArray());
|
|
}
|
|
return dt;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
LogManager.LogHelper.Error(new LogInfo()
|
|
{
|
|
ErrorInfo = ex,
|
|
Tag = ex.StackTrace,
|
|
Info = "产品档案数据层-获取浇注参数信息"
|
|
});
|
|
throw;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 获取红外扫描参数信息
|
|
/// <summary>
|
|
/// 获取红外扫描参数信息
|
|
/// </summary>
|
|
/// <param name="">条件</param>
|
|
/// <returns>*信息</returns>
|
|
public DataTable GetHostcanPatameter(HostcanPatameter condition)
|
|
{
|
|
List<DataParameter> parameters = new List<DataParameter>();
|
|
StringBuilder sqlBuilder = new StringBuilder();
|
|
StringBuilder whereBuilder = new StringBuilder();
|
|
DataTable dt = new DataTable();
|
|
try
|
|
{
|
|
sqlBuilder.AppendLine(" SELECT * ");
|
|
sqlBuilder.AppendLine(" FROM T_AW_HOTSCANPARAMETER ");
|
|
|
|
//加工记录主键
|
|
if (string.IsNullOrEmpty(condition.MOID) == false)
|
|
{
|
|
whereBuilder.Append(" AND MOID =@MOID ");
|
|
parameters.Add(new DataParameter { ParameterName = "MOID", DataType = DbType.String, Value = condition.MOID });
|
|
}
|
|
if (whereBuilder.Length > 0)
|
|
{
|
|
sqlBuilder.Append(" WHERE " + whereBuilder.ToString().Substring(4));
|
|
}
|
|
using (IDataSession session = AppDataFactory.CreateMainSession())
|
|
{
|
|
//获取信息
|
|
dt = session.GetTable(sqlBuilder.ToString(), parameters.ToArray());
|
|
}
|
|
return dt;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
LogManager.LogHelper.Error(new LogInfo()
|
|
{
|
|
ErrorInfo = ex,
|
|
Tag = ex.StackTrace,
|
|
Info = "产品档案数据层-获取红外扫描参数信息"
|
|
});
|
|
throw;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 获取冲切参数信息
|
|
/// <summary>
|
|
/// 获取冲切参数信息
|
|
/// </summary>
|
|
/// <param name="">条件</param>
|
|
/// <returns>*信息</returns>
|
|
public DataTable GetPunchParameter(PunchParameter condition)
|
|
{
|
|
List<DataParameter> parameters = new List<DataParameter>();
|
|
StringBuilder sqlBuilder = new StringBuilder();
|
|
StringBuilder whereBuilder = new StringBuilder();
|
|
DataTable dt = new DataTable();
|
|
try
|
|
{
|
|
sqlBuilder.AppendLine(" SELECT * ");
|
|
sqlBuilder.AppendLine(" FROM T_AW_PUNCHPARAMETER ");
|
|
|
|
//加工记录主键
|
|
if (string.IsNullOrEmpty(condition.MOID) == false)
|
|
{
|
|
whereBuilder.Append(" AND MOID =@MOID ");
|
|
parameters.Add(new DataParameter { ParameterName = "MOID", DataType = DbType.String, Value = condition.MOID });
|
|
}
|
|
if (whereBuilder.Length > 0)
|
|
{
|
|
sqlBuilder.Append(" WHERE " + whereBuilder.ToString().Substring(4));
|
|
}
|
|
using (IDataSession session = AppDataFactory.CreateMainSession())
|
|
{
|
|
//获取信息
|
|
dt = session.GetTable(sqlBuilder.ToString(), parameters.ToArray());
|
|
}
|
|
return dt;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
LogManager.LogHelper.Error(new LogInfo()
|
|
{
|
|
ErrorInfo = ex,
|
|
Tag = ex.StackTrace,
|
|
Info = "产品档案数据层-获取冲切参数信息"
|
|
});
|
|
throw;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 获取铣削参数信息
|
|
/// <summary>
|
|
/// 获取铣削参数信息
|
|
/// </summary>
|
|
/// <param name="">条件</param>
|
|
/// <returns>*信息</returns>
|
|
public DataTable GetMilingParameter(MilingParameter condition)
|
|
{
|
|
List<DataParameter> parameters = new List<DataParameter>();
|
|
StringBuilder sqlBuilder = new StringBuilder();
|
|
StringBuilder whereBuilder = new StringBuilder();
|
|
DataTable dt = new DataTable();
|
|
try
|
|
{
|
|
sqlBuilder.AppendLine(" SELECT * ");
|
|
sqlBuilder.AppendLine(" FROM T_AW_MILINGPARAMETER ");
|
|
|
|
|
|
//加工记录主键
|
|
if (string.IsNullOrEmpty(condition.MOID) == false)
|
|
{
|
|
whereBuilder.Append(" AND MOID =@MOID ");
|
|
parameters.Add(new DataParameter { ParameterName = "MOID", DataType = DbType.String, Value = condition.MOID });
|
|
}
|
|
if (whereBuilder.Length > 0)
|
|
{
|
|
sqlBuilder.Append(" WHERE " + whereBuilder.ToString().Substring(4));
|
|
}
|
|
using (IDataSession session = AppDataFactory.CreateMainSession())
|
|
{
|
|
//获取信息
|
|
dt = session.GetTable(sqlBuilder.ToString(), parameters.ToArray());
|
|
}
|
|
return dt;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
LogManager.LogHelper.Error(new LogInfo()
|
|
{
|
|
ErrorInfo = ex,
|
|
Tag = ex.StackTrace,
|
|
Info = "产品档案数据层-获取铣削参数信息"
|
|
});
|
|
throw;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 获取铆接参数信息
|
|
/// <summary>
|
|
/// 获取铆接参数信息
|
|
/// </summary>
|
|
/// <param name="">条件</param>
|
|
/// <returns>*信息</returns>
|
|
public DataTable GetRivetingPatameter(RivetingPatameter condition)
|
|
{
|
|
List<DataParameter> parameters = new List<DataParameter>();
|
|
StringBuilder sqlBuilder = new StringBuilder();
|
|
StringBuilder whereBuilder = new StringBuilder();
|
|
DataTable dt = new DataTable();
|
|
try
|
|
{
|
|
sqlBuilder.AppendLine(" SELECT * ");
|
|
sqlBuilder.AppendLine(" FROM T_AW_RIVETINGPARAMETER ");
|
|
|
|
|
|
//加工记录主键
|
|
if (string.IsNullOrEmpty(condition.MOID) == false)
|
|
{
|
|
whereBuilder.Append(" AND MOID =@MOID ");
|
|
parameters.Add(new DataParameter { ParameterName = "MOID", DataType = DbType.String, Value = condition.MOID });
|
|
}
|
|
if (whereBuilder.Length > 0)
|
|
{
|
|
sqlBuilder.Append(" WHERE " + whereBuilder.ToString().Substring(4));
|
|
}
|
|
using (IDataSession session = AppDataFactory.CreateMainSession())
|
|
{
|
|
//获取信息
|
|
dt = session.GetTable(sqlBuilder.ToString(), parameters.ToArray());
|
|
}
|
|
return dt;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
LogManager.LogHelper.Error(new LogInfo()
|
|
{
|
|
ErrorInfo = ex,
|
|
Tag = ex.StackTrace,
|
|
Info = "产品档案数据层-获取铆接参数信息"
|
|
});
|
|
throw;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 获取超声波焊接参数信息
|
|
/// <summary>
|
|
/// 获取超声波焊接参数信息
|
|
/// </summary>
|
|
/// <param name="">条件</param>
|
|
/// <returns>*信息</returns>
|
|
public DataTable GetUltrasParameter(UltrasParameter condition)
|
|
{
|
|
List<DataParameter> parameters = new List<DataParameter>();
|
|
StringBuilder sqlBuilder = new StringBuilder();
|
|
StringBuilder whereBuilder = new StringBuilder();
|
|
DataTable dt = new DataTable();
|
|
try
|
|
{
|
|
sqlBuilder.AppendLine(" SELECT * ");
|
|
sqlBuilder.AppendLine(" FROM T_AW_ULTRASPARAMETER ");
|
|
|
|
//加工记录主键
|
|
if (string.IsNullOrEmpty(condition.MOID) == false)
|
|
{
|
|
whereBuilder.Append(" AND MOID =@MOID ");
|
|
parameters.Add(new DataParameter { ParameterName = "MOID", DataType = DbType.String, Value = condition.MOID });
|
|
}
|
|
if (whereBuilder.Length > 0)
|
|
{
|
|
sqlBuilder.Append(" WHERE " + whereBuilder.ToString().Substring(4));
|
|
}
|
|
using (IDataSession session = AppDataFactory.CreateMainSession())
|
|
{
|
|
//获取信息
|
|
dt = session.GetTable(sqlBuilder.ToString(), parameters.ToArray());
|
|
}
|
|
return dt;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
LogManager.LogHelper.Error(new LogInfo()
|
|
{
|
|
ErrorInfo = ex,
|
|
Tag = ex.StackTrace,
|
|
Info = "产品档案数据层-获取超声波焊接参数信息"
|
|
});
|
|
throw;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 获取红外焊接参数信息
|
|
/// <summary>
|
|
/// 获取红外焊接参数信息
|
|
/// </summary>
|
|
/// <param name="">条件</param>
|
|
/// <returns>*信息</returns>
|
|
public DataTable GetHotweldParameter(HotweldParameter condition)
|
|
{
|
|
List<DataParameter> parameters = new List<DataParameter>();
|
|
StringBuilder sqlBuilder = new StringBuilder();
|
|
StringBuilder whereBuilder = new StringBuilder();
|
|
DataTable dt = new DataTable();
|
|
try
|
|
{
|
|
sqlBuilder.AppendLine(" SELECT * ");
|
|
sqlBuilder.AppendLine(" FROM T_AW_HOTWELDPARAMETER ");
|
|
|
|
//加工记录主键
|
|
if (string.IsNullOrEmpty(condition.MOID) == false)
|
|
{
|
|
whereBuilder.Append(" AND MOID =@MOID ");
|
|
parameters.Add(new DataParameter { ParameterName = "MOID", DataType = DbType.String, Value = condition.MOID });
|
|
}
|
|
if (whereBuilder.Length > 0)
|
|
{
|
|
sqlBuilder.Append(" WHERE " + whereBuilder.ToString().Substring(4));
|
|
}
|
|
using (IDataSession session = AppDataFactory.CreateMainSession())
|
|
{
|
|
//获取信息
|
|
dt = session.GetTable(sqlBuilder.ToString(), parameters.ToArray());
|
|
}
|
|
return dt;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
LogManager.LogHelper.Error(new LogInfo()
|
|
{
|
|
ErrorInfo = ex,
|
|
Tag = ex.StackTrace,
|
|
Info = "产品档案数据层-获取红外焊接参数信息"
|
|
});
|
|
throw;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 获取总成装配参数信息
|
|
/// <summary>
|
|
/// 获取总成装配参数信息
|
|
/// </summary>
|
|
/// <param name="">条件</param>
|
|
/// <returns>*信息</returns>
|
|
public DataTable GetAssembleParameter(AssembleParameter condition)
|
|
{
|
|
List<DataParameter> parameters = new List<DataParameter>();
|
|
StringBuilder sqlBuilder = new StringBuilder();
|
|
StringBuilder whereBuilder = new StringBuilder();
|
|
DataTable dt = new DataTable();
|
|
try
|
|
{
|
|
sqlBuilder.AppendLine(" SELECT * ");
|
|
sqlBuilder.AppendLine(" FROM T_AW_ASSEMBLEPARAMETER ");
|
|
|
|
//加工记录主键
|
|
if (string.IsNullOrEmpty(condition.MOID) == false)
|
|
{
|
|
whereBuilder.Append(" AND MOID =@MOID ");
|
|
parameters.Add(new DataParameter { ParameterName = "MOID", DataType = DbType.String, Value = condition.MOID });
|
|
}
|
|
if (whereBuilder.Length > 0)
|
|
{
|
|
sqlBuilder.Append(" WHERE " + whereBuilder.ToString().Substring(4));
|
|
}
|
|
using (IDataSession session = AppDataFactory.CreateMainSession())
|
|
{
|
|
//获取信息
|
|
dt = session.GetTable(sqlBuilder.ToString(), parameters.ToArray());
|
|
}
|
|
return dt;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
LogManager.LogHelper.Error(new LogInfo()
|
|
{
|
|
ErrorInfo = ex,
|
|
Tag = ex.StackTrace,
|
|
Info = "产品档案数据层-获取总成装配参数信息"
|
|
});
|
|
throw;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
}
|
|
}
|
|
|