|
|
@ -272,6 +272,41 @@ namespace QMAPP.FJC.DAL.Produce |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public Product GetNewestProductCell(string productcode, string cell) |
|
|
|
{ |
|
|
|
StringBuilder sql = new StringBuilder(); |
|
|
|
List<DataParameter> parameters = new List<DataParameter>(); |
|
|
|
try |
|
|
|
{ |
|
|
|
sql.AppendLine("SELECT P.* "); |
|
|
|
sql.AppendLine(" ,WL.[WORKLOC_NAME] "); |
|
|
|
sql.AppendLine(" ,MA.MATERIAL_NAME "); |
|
|
|
sql.AppendLine(" ,WC.WORKCELL_NAME "); |
|
|
|
sql.AppendLine(" FROM [T_AW_PRODUCT] AS P WITH(NOLOCK) "); |
|
|
|
|
|
|
|
sql.AppendLine(" LEFT JOIN [T_MD_WORKLOC] AS WL "); |
|
|
|
sql.AppendLine(" ON WL.[WORKLOC_CODE]=P.[WORKLOC_CODE] "); |
|
|
|
|
|
|
|
sql.AppendLine(" LEFT JOIN [T_MD_WORKCELL] AS WC "); |
|
|
|
sql.AppendLine(" ON WC.[WORKCELL_CODE]=P.[WORKCELL_CODE]"); |
|
|
|
|
|
|
|
sql.AppendLine(" LEFT JOIN [T_MD_MATERIAL] AS MA "); |
|
|
|
sql.AppendLine(" ON P.MATERIAL_CODE=MA.MATERIAL_CODE "); |
|
|
|
|
|
|
|
sql.AppendLine(" WHERE [PRODUCTCODE]=@productcode and workcell_code = @cell ORDER BY P.[CREATEDATE] DESC"); |
|
|
|
parameters.Add(new DataParameter("productcode", productcode)); |
|
|
|
parameters.Add(new DataParameter("cell", cell)); |
|
|
|
using (IDataSession session = AppDataFactory.CreateMainSession()) |
|
|
|
{ |
|
|
|
return session.Get<Product>(sql.ToString(), parameters.ToArray()); |
|
|
|
} |
|
|
|
} |
|
|
|
catch (Exception ex) |
|
|
|
{ |
|
|
|
throw ex; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 根据条码获取最新产品信息
|
|
|
|
/// </summary>
|
|
|
|