Browse Source

前序验证,BZD补码验证

master
dequan.zhang 2 years ago
parent
commit
2fe4251ac1
  1. 2
      APPQ5/QMAPP.FJC.DAL/Produce/ProductDAL.cs
  2. 205
      APPQ5/QMAPP.FJC.TRACING/DataAnalyzers/PartAnalyzer.cs
  3. 8
      APPQ5/QMAPP.WinForm/App.config
  4. 48
      APPQ5/QMAPP.WinForm/Forms/Operation/BZDRePrintForm.cs
  5. 4
      APPQ5/QMAPP.WinForm/Properties/AssemblyInfo.cs
  6. 8
      ServicesCenter/WCF/QMFrameWork.WebServiceHost/Web.config

2
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())

205
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("无法查到此零件信息!");
}
}
}
}
}
}

8
APPQ5/QMAPP.WinForm/App.config

@ -4,14 +4,14 @@
<!--主数据库连接-->
<!--<add name="maindb" connectionString="Data Source=10.111.144.98;Initial Catalog=ADIENT_CD_MES;User Id=sa;Password=Password2018;" providerName="System.Data.SqlClient"/>
<add name="maindbBZD" connectionString="Data Source=10.111.144.98;Initial Catalog=BZD;User Id=sa;Password=Password2018;" providerName="System.Data.SqlClient"/>-->
<add name="maindb" connectionString="Data Source=10.111.144.98;Initial Catalog=ADIENT_CD_MES;User Id=sa;Password=Password2018;" providerName="System.Data.SqlClient"/>
<add name="maindbBZD" connectionString="Data Source=10.111.144.98;Initial Catalog=BZD;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="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="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="maindb" connectionString="Data Source=dev.ccwin-in.com,6191;Initial Catalog=ADIENT_TJ_MES;User Id=sa;Password=Microsoft@2021;" providerName="System.Data.SqlClient"/>
-->

48
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<DataTable>(B9IPCService.BZDConfigBLL_GetAppConfigValue.ToString(), "BZDRule");
if (dataTable.Rows.Count > 0)
//old
//DataTable dataTable = _agent.InvokeServiceFunction<DataTable>(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<DataTable>(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<DataTable>(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<List<BZDConfig>>(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();
}

4
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")]

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

@ -64,8 +64,8 @@
<!--主数据库连接-->
<!--<add name="maindb" connectionString="Data Source=10.111.144.98;Initial Catalog=ADIENT_CD_MES;User Id=sa;Password=Password2018;" providerName="System.Data.SqlClient"/>
<add name="maindbBZD" connectionString="Data Source=10.111.144.98;Initial Catalog=BZD;User Id=sa;Password=Password2018;" providerName="System.Data.SqlClient"/>-->
<add name="maindb" connectionString="Data Source=10.111.144.98;Initial Catalog=ADIENT_CD_MES;User Id=sa;Password=Password2018;" providerName="System.Data.SqlClient"/>
<add name="maindbBZD" connectionString="Data Source=10.111.144.98;Initial Catalog=BZD;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=CDMESADM;Password=CDmes123;max pool size=10240;" 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="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="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"/>-->

Loading…
Cancel
Save