Browse Source

中插createdate被修改,修改查询最新生产数据方法

master
dequan.zhang 2 years ago
parent
commit
d85bd5585a
  1. 35
      APPQ5/QMAPP.FJC.DAL/Produce/ProductDAL.cs
  2. 5
      APPQ5/QMAPP.FJC.TRACING/DataAnalyzers/PartAnalyzer.cs
  3. 11
      APPQ5/QMAPP.WinForm/App.config
  4. 12
      ServicesCenter/WCF/QMFrameWork.WebServiceHost/Web.config

35
APPQ5/QMAPP.FJC.DAL/Produce/ProductDAL.cs

@ -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>
/// 根据条码获取最新产品信息 /// 根据条码获取最新产品信息
/// </summary> /// </summary>

5
APPQ5/QMAPP.FJC.TRACING/DataAnalyzers/PartAnalyzer.cs

@ -14,7 +14,10 @@ namespace QMAPP.FJC.TRACING.DataAnalyzers
public void Analyze(DAInterface.DAObject data) public void Analyze(DAInterface.DAObject data)
{ {
DAL.Produce.ProductDAL proddal = new DAL.Produce.ProductDAL(); DAL.Produce.ProductDAL proddal = new DAL.Produce.ProductDAL();
var product=proddal.GetNewestProduct(data.DAValue.ToString()); //var product=proddal.GetNewestProduct(data.DAValue.ToString());
//20220928 DQZhang 查询最新Product增加工序条件,时间有可能
var product = proddal.GetNewestProductCell(data.DAValue.ToString(),data.WorkLocState.WORKCELL_CODE);
if (product != null) if (product != null)
{ {
data.ObjectPID = product.PID; data.ObjectPID = product.PID;

11
APPQ5/QMAPP.WinForm/App.config

@ -10,16 +10,17 @@
<!--<add name="maindb" connectionString="Data Source=10.111.144.99;Initial Catalog=ADIENT_CD_MES;User Id=sa;Password=Password2018;" providerName="System.Data.SqlClient"/> <!--<add name="maindb" connectionString="Data Source=10.111.144.99;Initial Catalog=ADIENT_CD_MES;User Id=sa;Password=Password2018;" providerName="System.Data.SqlClient"/>
<add name="maindbBZD" connectionString="Data Source=10.111.144.99;Initial Catalog=BZD;User Id=sa;Password=Password2018;" providerName="System.Data.SqlClient"/>--> <add name="maindbBZD" connectionString="Data Source=10.111.144.99;Initial Catalog=BZD;User Id=sa;Password=Password2018;" providerName="System.Data.SqlClient"/>-->
<!--<add name="maindb" connectionString="Data Source=.;Initial Catalog=ADIENT_CD_MES;User Id=sa;Password=Microsoft2008;" providerName="System.Data.SqlClient"/> <add name="maindb" connectionString="Data Source=.;Initial Catalog=ADIENT_CD_MES;User Id=sa;Password=Microsoft2008;" providerName="System.Data.SqlClient"/>
<add name="maindbBZD" connectionString="Data Source=.;Initial Catalog=BZD;User Id=sa;Password=Microsoft2008;" providerName="System.Data.SqlClient"/>--> <add name="maindbBZD" connectionString="Data Source=.;Initial Catalog=BZD;User Id=sa;Password=Microsoft2008;" providerName="System.Data.SqlClient"/>
<!--<add name="maindb" connectionString="Data Source=dev.ccwin-in.com,6191;Initial Catalog=ADIENT_TJ_MES;User Id=sa;Password=Microsoft@2021;" providerName="System.Data.SqlClient"/> <!--<add name="maindb" connectionString="Data Source=dev.ccwin-in.com,6191;Initial Catalog=ADIENT_TJ_MES;User Id=sa;Password=Microsoft@2021;" providerName="System.Data.SqlClient"/>
--> -->
<add name="maindb" connectionString="Data Source=dev.ccwin-in.com,6191;Initial Catalog=ADIENT_VW276PA_MES;User Id=sa;Password=Microsoft@2021;" providerName="System.Data.SqlClient"/>
<!-- <!--
<add name="maindb" connectionString="Data Source=10.122.213.104;Initial Catalog=ADIENT_VW276_MES;User Id=MES;Password=Password1;" providerName="System.Data.SqlClient"/> <add name="maindb" connectionString="Data Source=dev.ccwin-in.com,6191;Initial Catalog=ADIENT_VW276PA_MES;User Id=sa;Password=Microsoft@2021;" providerName="System.Data.SqlClient"/>
-->
<!--<add name="maindb" connectionString="Data Source=10.122.213.104;Initial Catalog=ADIENT_VW276_MES;User Id=MES;Password=Password1;" providerName="System.Data.SqlClient"/>-->
<add name="maindb" connectionString="Data Source=10.117.133.48;Initial Catalog=ADIENT_TJ_MES;User Id=sa;Password=ASDqwe123!@#;" providerName="System.Data.SqlClient"/>--> <!--<add name="maindb" connectionString="Data Source=10.117.133.48;Initial Catalog=ADIENT_TJ_MES;User Id=sa;Password=ASDqwe123!@#;" providerName="System.Data.SqlClient"/>-->
<!--<add name="maindb" connectionString="Data Source=10.122.213.104;Initial Catalog=ADIENT_VW276_MES;User Id=MES;Password=Password1;" providerName="System.Data.SqlClient"/>--> <!--<add name="maindb" connectionString="Data Source=10.122.213.104;Initial Catalog=ADIENT_VW276_MES;User Id=MES;Password=Password1;" providerName="System.Data.SqlClient"/>-->

12
ServicesCenter/WCF/QMFrameWork.WebServiceHost/Web.config

@ -77,11 +77,11 @@
<add name="maindb" connectionString="Data Source=10.122.213.104;Initial Catalog=ADIENT_VW276_MES;User Id=MES;Password=Password1;" providerName="System.Data.SqlClient"/> <add name="maindb" connectionString="Data Source=10.122.213.104;Initial Catalog=ADIENT_VW276_MES;User Id=MES;Password=Password1;" providerName="System.Data.SqlClient"/>
--> -->
<add name="maindb" connectionString="Data Source=dev.ccwin-in.com,6191;Initial Catalog=ADIENT_VW276PA_MES;User Id=sa;Password=Microsoft@2021;" providerName="System.Data.SqlClient"/> <!--<add name="maindb" connectionString="Data Source=dev.ccwin-in.com,6191;Initial Catalog=ADIENT_VW276PA_MES;User Id=sa;Password=Microsoft@2021;" providerName="System.Data.SqlClient"/>-->
<!--
<add name="maindb" connectionString="Data Source=10.122.213.104;Initial Catalog=ADIENT_VW276_MES;User Id=MES;Password=Password1;" providerName="System.Data.SqlClient"/> <!--<add name="maindb" connectionString="Data Source=10.122.213.104;Initial Catalog=ADIENT_VW276_MES;User Id=MES;Password=Password1;" providerName="System.Data.SqlClient"/>-->
<add name="maindb" connectionString="Data Source=dev.ccwin-in.com,6191;Initial Catalog=ADIENT_TJ_MES;User Id=sa;Password=Microsoft@2021;" providerName="System.Data.SqlClient"/>--> <!--<add name="maindb" connectionString="Data Source=dev.ccwin-in.com,6191;Initial Catalog=ADIENT_TJ_MES;User Id=sa;Password=Microsoft@2021;" providerName="System.Data.SqlClient"/>-->
<!--<add name="maindb" connectionString="Data Source=10.117.133.48;Initial Catalog=ADIENT_TJ_MES;User Id=sa;Password=ASDqwe123!@#;" providerName="System.Data.SqlClient"/>--> <!--<add name="maindb" connectionString="Data Source=10.117.133.48;Initial Catalog=ADIENT_TJ_MES;User Id=sa;Password=ASDqwe123!@#;" providerName="System.Data.SqlClient"/>-->
@ -92,8 +92,8 @@
<add name="maindbNCSYBB" connectionString="Data Source=10.111.144.72;Initial Catalog=scCFAACDYBDY;User Id=mesreaderdcs;Password=mesreaderdcs;" providerName="System.Data.SqlClient"/>--> <add name="maindbNCSYBB" connectionString="Data Source=10.111.144.72;Initial Catalog=scCFAACDYBDY;User Id=mesreaderdcs;Password=mesreaderdcs;" providerName="System.Data.SqlClient"/>-->
<!--<add name="maindb" connectionString="Data Source=.;Initial Catalog=ADIENT_CD_MES;User Id=sa;Password=Microsoft2008;" providerName="System.Data.SqlClient"/> <add name="maindb" connectionString="Data Source=.;Initial Catalog=ADIENT_CD_MES;User Id=sa;Password=Microsoft2008;" providerName="System.Data.SqlClient"/>
<add name="maindbBZD" connectionString="Data Source=.;Initial Catalog=BZD;User Id=sa;Password=Microsoft2008;" providerName="System.Data.SqlClient"/>--> <add name="maindbBZD" connectionString="Data Source=.;Initial Catalog=BZD;User Id=sa;Password=Microsoft2008;" providerName="System.Data.SqlClient"/>

Loading…
Cancel
Save