From 2fe4251ac17255fd7c568f130bd9d32df0e2ea75 Mon Sep 17 00:00:00 2001 From: "dequan.zhang" <13820060@qq.com> Date: Fri, 14 Oct 2022 10:14:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=89=8D=E5=BA=8F=E9=AA=8C=E8=AF=81=EF=BC=8CBZ?= =?UTF-8?q?D=E8=A1=A5=E7=A0=81=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- APPQ5/QMAPP.FJC.DAL/Produce/ProductDAL.cs | 2 +- .../DataAnalyzers/PartAnalyzer.cs | 205 ++++++++++++++---- APPQ5/QMAPP.WinForm/App.config | 8 +- .../Forms/Operation/BZDRePrintForm.cs | 48 +++- .../QMAPP.WinForm/Properties/AssemblyInfo.cs | 4 +- .../WCF/QMFrameWork.WebServiceHost/Web.config | 8 +- 6 files changed, 211 insertions(+), 64 deletions(-) diff --git a/APPQ5/QMAPP.FJC.DAL/Produce/ProductDAL.cs b/APPQ5/QMAPP.FJC.DAL/Produce/ProductDAL.cs index cb08655..2060d54 100644 --- a/APPQ5/QMAPP.FJC.DAL/Produce/ProductDAL.cs +++ b/APPQ5/QMAPP.FJC.DAL/Produce/ProductDAL.cs @@ -293,7 +293,7 @@ namespace QMAPP.FJC.DAL.Produce 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"); + sql.AppendLine(" WHERE [PRODUCTCODE]=@productcode and P.[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()) diff --git a/APPQ5/QMAPP.FJC.TRACING/DataAnalyzers/PartAnalyzer.cs b/APPQ5/QMAPP.FJC.TRACING/DataAnalyzers/PartAnalyzer.cs index c8884b0..73fd515 100644 --- a/APPQ5/QMAPP.FJC.TRACING/DataAnalyzers/PartAnalyzer.cs +++ b/APPQ5/QMAPP.FJC.TRACING/DataAnalyzers/PartAnalyzer.cs @@ -15,62 +15,179 @@ namespace QMAPP.FJC.TRACING.DataAnalyzers { DAL.Produce.ProductDAL proddal = new DAL.Produce.ProductDAL(); //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; + // data.ObjectCacheList.Add(product); + // data.AnalyzedValue = product.PRODUCTCODE; + // data.MaterialCode = product.MATERIAL_CODE; + // DAL.MD.MaterialDAL mdal = new DAL.MD.MaterialDAL(); + // var material = mdal.Get(data.MaterialCode); + // data.MaterialName = material == null ? "" : material.MATERIAL_SHORT; + //} + //else + //{ + // DAL.MD.MaterialDAL mdal = new DAL.MD.MaterialDAL(); + // var material = mdal.Get(data.MaterialCode); + // if (material == null) + // { + // throw new Exception("无法查到此零件信息!"); + // } + // if (string.Equals(material.OUTSOURCE, "1")) // 如果是外购件则创建零件信息 + // { + // var part = new Product() + // { + // PID = Guid.NewGuid().ToString(), + // CAPACITY = material.STD_QTY, + // CREATEDATE = DateTime.Now, + // CREATEUSER = data.UserID, + // MATERIAL_CODE = material.MATERIAL_CODE, + // OUTFLAG = "0", + // PRODUCESHIFTTCODE = "", + // PRODUCTCODE = data.DAValue.ToString(), + // PRODUCTSOURCE = "1", + // STATUS = "0", + // USINGCOUNT = 0, + // USINGSTATE = "0", + // WORKCELL_CODE = "", + // WORKCENTER_CODE = "", + // WORKLOC_CODE = "", + // TEAM_CODE = "", + // MATERIAL_TYPE = material.MATERIAL_TYPE_CODE + // }; + // proddal.Insert(part); + // data.ObjectPID = part.PID; + // //data.ObjectCacheList.Add(part); + // data.AnalyzedValue = part.PRODUCTCODE; + // data.MaterialCode = part.MATERIAL_CODE; + // data.MaterialName = material.MATERIAL_SHORT; + // } + // else + // { + // throw new Exception("无法查到此零件信息!"); + // } + //} - if (product != null) - { - data.ObjectPID = product.PID; - data.ObjectCacheList.Add(product); - data.AnalyzedValue = product.PRODUCTCODE; - data.MaterialCode = product.MATERIAL_CODE; - DAL.MD.MaterialDAL mdal = new DAL.MD.MaterialDAL(); - var material = mdal.Get(data.MaterialCode); - data.MaterialName = material == null ? "" : material.MATERIAL_SHORT; - } - else + + //20220928 DQZhang 查询最新加工记录,增加工序条件,因为创建时间有可能被修改,按时间培训获取最新会出问题 + string Cell = data.WorkLocState.WORKLOC_CODE; + if (Cell.Equals("DP_R_PREASSY_2") || Cell.Equals("DP_L_PREASSY_2")) { - DAL.MD.MaterialDAL mdal=new DAL.MD.MaterialDAL(); - var material= mdal.Get(data.MaterialCode); - if(material==null) + var product = proddal.GetNewestProductCell(data.DAValue.ToString(), Cell); + if (product != null) { - throw new Exception("无法查到此零件信息!"); + data.ObjectPID = product.PID; + data.ObjectCacheList.Add(product); + data.AnalyzedValue = product.PRODUCTCODE; + data.MaterialCode = product.MATERIAL_CODE; + DAL.MD.MaterialDAL mdal = new DAL.MD.MaterialDAL(); + var material = mdal.Get(data.MaterialCode); + data.MaterialName = material == null ? "" : material.MATERIAL_SHORT; } - if (string.Equals(material.OUTSOURCE, "1")) // 如果是外购件则创建零件信息 + else { - var part = new Product() + DAL.MD.MaterialDAL mdal = new DAL.MD.MaterialDAL(); + var material = mdal.Get(data.MaterialCode); + if (material == null) { - PID = Guid.NewGuid().ToString(), - CAPACITY = material.STD_QTY, - CREATEDATE = DateTime.Now, - CREATEUSER = data.UserID, - MATERIAL_CODE = material.MATERIAL_CODE, - OUTFLAG = "0", - PRODUCESHIFTTCODE = "", - PRODUCTCODE = data.DAValue.ToString(), - PRODUCTSOURCE = "1", - STATUS = "0", - USINGCOUNT = 0, - USINGSTATE = "0", - WORKCELL_CODE = "", - WORKCENTER_CODE = "", - WORKLOC_CODE = "", - TEAM_CODE = "", - MATERIAL_TYPE = material.MATERIAL_TYPE_CODE - }; - proddal.Insert(part); - data.ObjectPID = part.PID; - //data.ObjectCacheList.Add(part); - data.AnalyzedValue = part.PRODUCTCODE; - data.MaterialCode = part.MATERIAL_CODE; - data.MaterialName = material.MATERIAL_SHORT; + throw new Exception("无法查到此零件信息!"); + } + if (string.Equals(material.OUTSOURCE, "1")) // 如果是外购件则创建零件信息 + { + var part = new Product() + { + PID = Guid.NewGuid().ToString(), + CAPACITY = material.STD_QTY, + CREATEDATE = DateTime.Now, + CREATEUSER = data.UserID, + MATERIAL_CODE = material.MATERIAL_CODE, + OUTFLAG = "0", + PRODUCESHIFTTCODE = "", + PRODUCTCODE = data.DAValue.ToString(), + PRODUCTSOURCE = "1", + STATUS = "0", + USINGCOUNT = 0, + USINGSTATE = "0", + WORKCELL_CODE = "", + WORKCENTER_CODE = "", + WORKLOC_CODE = "", + TEAM_CODE = "", + MATERIAL_TYPE = material.MATERIAL_TYPE_CODE + }; + proddal.Insert(part); + data.ObjectPID = part.PID; + //data.ObjectCacheList.Add(part); + data.AnalyzedValue = part.PRODUCTCODE; + data.MaterialCode = part.MATERIAL_CODE; + data.MaterialName = material.MATERIAL_SHORT; + } + else + { + throw new Exception("无法查到此零件信息!"); + } + } + } + else + { + var product = proddal.GetNewestProduct(data.DAValue.ToString()); + if (product != null) + { + data.ObjectPID = product.PID; + data.ObjectCacheList.Add(product); + data.AnalyzedValue = product.PRODUCTCODE; + data.MaterialCode = product.MATERIAL_CODE; + DAL.MD.MaterialDAL mdal = new DAL.MD.MaterialDAL(); + var material = mdal.Get(data.MaterialCode); + data.MaterialName = material == null ? "" : material.MATERIAL_SHORT; } else { - throw new Exception("无法查到此零件信息!"); + DAL.MD.MaterialDAL mdal = new DAL.MD.MaterialDAL(); + var material = mdal.Get(data.MaterialCode); + if (material == null) + { + throw new Exception("无法查到此零件信息!"); + } + if (string.Equals(material.OUTSOURCE, "1")) // 如果是外购件则创建零件信息 + { + var part = new Product() + { + PID = Guid.NewGuid().ToString(), + CAPACITY = material.STD_QTY, + CREATEDATE = DateTime.Now, + CREATEUSER = data.UserID, + MATERIAL_CODE = material.MATERIAL_CODE, + OUTFLAG = "0", + PRODUCESHIFTTCODE = "", + PRODUCTCODE = data.DAValue.ToString(), + PRODUCTSOURCE = "1", + STATUS = "0", + USINGCOUNT = 0, + USINGSTATE = "0", + WORKCELL_CODE = "", + WORKCENTER_CODE = "", + WORKLOC_CODE = "", + TEAM_CODE = "", + MATERIAL_TYPE = material.MATERIAL_TYPE_CODE + }; + proddal.Insert(part); + data.ObjectPID = part.PID; + //data.ObjectCacheList.Add(part); + data.AnalyzedValue = part.PRODUCTCODE; + data.MaterialCode = part.MATERIAL_CODE; + data.MaterialName = material.MATERIAL_SHORT; + } + else + { + throw new Exception("无法查到此零件信息!"); + } } + } + + + } } } diff --git a/APPQ5/QMAPP.WinForm/App.config b/APPQ5/QMAPP.WinForm/App.config index b1c0af1..7b6a016 100644 --- a/APPQ5/QMAPP.WinForm/App.config +++ b/APPQ5/QMAPP.WinForm/App.config @@ -4,14 +4,14 @@ - + + - - + diff --git a/APPQ5/QMAPP.WinForm/Forms/Operation/BZDRePrintForm.cs b/APPQ5/QMAPP.WinForm/Forms/Operation/BZDRePrintForm.cs index fe83a54..97716c3 100644 --- a/APPQ5/QMAPP.WinForm/Forms/Operation/BZDRePrintForm.cs +++ b/APPQ5/QMAPP.WinForm/Forms/Operation/BZDRePrintForm.cs @@ -67,17 +67,47 @@ namespace QMAPP.WinForm.Forms.Operation if (_Product == null) { string BZDRule = ""; - DataTable dataTable = _agent.InvokeServiceFunction(B9IPCService.BZDConfigBLL_GetAppConfigValue.ToString(), "BZDRule"); - if (dataTable.Rows.Count > 0) + //old + //DataTable dataTable = _agent.InvokeServiceFunction(B9IPCService.BZDConfigBLL_GetAppConfigValue.ToString(), "BZDRule"); + //if (dataTable.Rows.Count > 0) + //{ + // BZDRule = dataTable.Rows[0]["Value"].ToString(); + //} + //if (string.IsNullOrEmpty(BZDRule)) + //{ + // MessageBox.Show("未配置总成规则!"); + // return; + //} + string MATERIAL_CODE = cbMaterial.Text.Split('|')[0]; + string LINE_CODE = cbMaterial.Text.Split('|')[2]; + +//*******************20221009DQZhang 成都补码增加条码规则校验***************************************************************************************************************** + if (LINE_CODE.Equals("BC316")) { - BZDRule = dataTable.Rows[0]["Value"].ToString(); - } - if (string.IsNullOrEmpty(BZDRule)) + DataTable dataTable = _agent.InvokeServiceFunction(B9IPCService.BZDConfigBLL_GetAppConfigValue.ToString(), "316BZDRule"); + if (dataTable.Rows.Count > 0) + { + BZDRule = dataTable.Rows[0]["Value"].ToString(); + } + if (string.IsNullOrEmpty(BZDRule)) + { + MessageBox.Show("未配置总成规则!"); + return; + } + }else if (LINE_CODE.Equals("VW371")) { - MessageBox.Show("未配置总成规则!"); - return; + DataTable dataTable = _agent.InvokeServiceFunction(B9IPCService.BZDConfigBLL_GetAppConfigValue.ToString(), "371BZDRule"); + if (dataTable.Rows.Count > 0) + { + BZDRule = dataTable.Rows[0]["Value"].ToString(); + } + if (string.IsNullOrEmpty(BZDRule)) + { + MessageBox.Show("未配置总成规则!"); + return; + } } - string MATERIAL_CODE = cbMaterial.Text.Split('|')[0]; + //**************************************************************************************************************************************************************************** if (System.Text.RegularExpressions.Regex.IsMatch(txtMainCode.Text, BZDRule)) { @@ -169,7 +199,7 @@ namespace QMAPP.WinForm.Forms.Operation _agent.InvokeServiceFunction>(B9IPCService.BZDConfigBLL_GetAllList.ToString(),""); foreach (var t in _bzdConfig) { - t.MATERIALCODDE = t.MATERIALCODDE + "|" + t.ColorDetail; + t.MATERIALCODDE = t.MATERIALCODDE + "|" + t.ColorDetail + "|" + t.Line_code; } LoadAssyMaterial(); } diff --git a/APPQ5/QMAPP.WinForm/Properties/AssemblyInfo.cs b/APPQ5/QMAPP.WinForm/Properties/AssemblyInfo.cs index ac09163..edc92b8 100644 --- a/APPQ5/QMAPP.WinForm/Properties/AssemblyInfo.cs +++ b/APPQ5/QMAPP.WinForm/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值, // 方法是按如下所示使用“*”: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2022.09.26.01")] -[assembly: AssemblyFileVersion("2022.09.26.01")] +[assembly: AssemblyVersion("2022.10.14.01")] +[assembly: AssemblyFileVersion("2022.10.14.01")] diff --git a/ServicesCenter/WCF/QMFrameWork.WebServiceHost/Web.config b/ServicesCenter/WCF/QMFrameWork.WebServiceHost/Web.config index f4fb37e..8ef77a0 100644 --- a/ServicesCenter/WCF/QMFrameWork.WebServiceHost/Web.config +++ b/ServicesCenter/WCF/QMFrameWork.WebServiceHost/Web.config @@ -64,8 +64,8 @@ - + + @@ -92,8 +92,8 @@ --> - - +