From d85bd5585a172db43016ffb87256792196032966 Mon Sep 17 00:00:00 2001 From: "dequan.zhang" <13820060@qq.com> Date: Thu, 29 Sep 2022 07:59:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=AD=E6=8F=92createdate=E8=A2=AB=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=EF=BC=8C=E4=BF=AE=E6=94=B9=E6=9F=A5=E8=AF=A2=E6=9C=80?= =?UTF-8?q?=E6=96=B0=E7=94=9F=E4=BA=A7=E6=95=B0=E6=8D=AE=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- APPQ5/QMAPP.FJC.DAL/Produce/ProductDAL.cs | 35 +++++++++++++++++++ .../DataAnalyzers/PartAnalyzer.cs | 5 ++- APPQ5/QMAPP.WinForm/App.config | 11 +++--- .../WCF/QMFrameWork.WebServiceHost/Web.config | 12 +++---- 4 files changed, 51 insertions(+), 12 deletions(-) diff --git a/APPQ5/QMAPP.FJC.DAL/Produce/ProductDAL.cs b/APPQ5/QMAPP.FJC.DAL/Produce/ProductDAL.cs index 2af4e45..cb08655 100644 --- a/APPQ5/QMAPP.FJC.DAL/Produce/ProductDAL.cs +++ b/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 parameters = new List(); + 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(sql.ToString(), parameters.ToArray()); + } + } + catch (Exception ex) + { + throw ex; + } + } + /// /// 根据条码获取最新产品信息 /// diff --git a/APPQ5/QMAPP.FJC.TRACING/DataAnalyzers/PartAnalyzer.cs b/APPQ5/QMAPP.FJC.TRACING/DataAnalyzers/PartAnalyzer.cs index c185c00..c8884b0 100644 --- a/APPQ5/QMAPP.FJC.TRACING/DataAnalyzers/PartAnalyzer.cs +++ b/APPQ5/QMAPP.FJC.TRACING/DataAnalyzers/PartAnalyzer.cs @@ -14,7 +14,10 @@ namespace QMAPP.FJC.TRACING.DataAnalyzers public void Analyze(DAInterface.DAObject data) { 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) { data.ObjectPID = product.PID; diff --git a/APPQ5/QMAPP.WinForm/App.config b/APPQ5/QMAPP.WinForm/App.config index 0132462..b1c0af1 100644 --- a/APPQ5/QMAPP.WinForm/App.config +++ b/APPQ5/QMAPP.WinForm/App.config @@ -10,16 +10,17 @@ - + + - + - --> + diff --git a/ServicesCenter/WCF/QMFrameWork.WebServiceHost/Web.config b/ServicesCenter/WCF/QMFrameWork.WebServiceHost/Web.config index a2b6567..f4fb37e 100644 --- a/ServicesCenter/WCF/QMFrameWork.WebServiceHost/Web.config +++ b/ServicesCenter/WCF/QMFrameWork.WebServiceHost/Web.config @@ -77,11 +77,11 @@ --> - - + + - --> + @@ -92,8 +92,8 @@ --> - + +