Browse Source

补充276

master
songnan.zhang 2 years ago
parent
commit
29e117e9d0
  1. 2
      APPQ5/QMAPP.FJC.TRACING/DataValidators/TimeValidator.cs
  2. 5
      APPQ5/QMAPP.FJC.TRACING/StateActions/SubmitData276PA.cs
  3. 7
      APPQ5/QMAPP.WinForm/App.config
  4. 215
      APPQ5/QMAPP.WinForm/Forms/Operation/OperationForm.cs
  5. 4
      APPQ5/QMAPP.WinForm/Properties/AssemblyInfo.cs
  6. 7
      ServicesCenter/WCF/QMFrameWork.WebServiceHost/Web.config

2
APPQ5/QMAPP.FJC.TRACING/DataValidators/TimeValidator.cs

@ -34,7 +34,7 @@ namespace QMAPP.FJC.TRACING.DataValidators
DateTime serviceTime = dal.GetServiceDateTime();
TimeSpan ts = serviceTime.Subtract(preStatTime);
return new ValidateResult(false, $"未达到{timeCheck.Operator}{(Convert.ToDecimal(timeCheck.Check_Value) / 3600).ToString("#0.0")}小时验证标准,当前时间{(Convert.ToDecimal(ts.TotalSeconds) / 3600).ToString("#0.0")}小时");
return new ValidateResult(false, $"未达到{timeCheck.Operator}{(Convert.ToDecimal(timeCheck.Check_Value) / 3600).ToString("#0.0")}小时验证标准");
}

5
APPQ5/QMAPP.FJC.TRACING/StateActions/SubmitData276PA.cs

@ -600,7 +600,10 @@ namespace QMAPP.FJC.TRACING.StateActions
var bomlocations = pbidal.LocateBom(materials);
//确定物料组成数量一致
var bomlocation = bomlocations.FirstOrDefault(p => p.SubCount == materials.Length);
return bomlocation;
if (bomlocations.Count > 0)
return bomlocations[0];
else
return null;
}

7
APPQ5/QMAPP.WinForm/App.config

@ -14,11 +14,12 @@
<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_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=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"/>-->

215
APPQ5/QMAPP.WinForm/Forms/Operation/OperationForm.cs

@ -817,93 +817,174 @@ namespace QMAPP.WinForm.Forms.Operation
}
if (ispass)//扫描的是过程主码
{
if (!string.IsNullOrEmpty(result.WorkOrderID))
//ZHANGSN 20220925 佛山276PA没有计划ID,使用物料号查找配置
if (_operationServiceParam.machineInfo.WORKLOC_CODE.Contains("276"))
{
List<FJC.Entity.ProductionPlan.WorkOrder> list = this.dgvPlan.DataSource as List<FJC.Entity.ProductionPlan.WorkOrder>;
var pBomcode = GetWorkOrder_MATERIAL_CODE(result.WorkOrderID);
if (!string.IsNullOrEmpty(pBomcode))
if (!string.IsNullOrEmpty(result.MATERIAL_CODE))
{
//List<FJC.Entity.ProductionPlan.WorkOrder> filterList = list.Where(p => pBomCodes.Contains(p.MATERIAL_CODE)).ToList();
var ScanIPConfig_list = GetSendPlcConfig(new ScanIPConfig() { MaterialCode = pBomcode, LocCode = _operationServiceParam.machineInfo.WORKLOC_CODE });
if (ScanIPConfig_list != null && ScanIPConfig_list.Count > 0)
var bomCodes = GetPBOMCODEValue(result.MATERIAL_CODE);
foreach (var bom in bomCodes)
{
foreach (var Config in ScanIPConfig_list)
var ScanIPConfig_list = GetSendPlcConfig(new ScanIPConfig() { MaterialCode = bom, LocCode = _operationServiceParam.machineInfo.WORKLOC_CODE });
if (ScanIPConfig_list != null && ScanIPConfig_list.Count > 0)
{
if (!string.IsNullOrEmpty(Config.PlcAddr))
foreach (var Config in ScanIPConfig_list)
{
var BarCode = Config.BarCode;
var PlcAddr = Config.PlcAddr;
GetNewCode(ref BarCode, ref PlcAddr); //查询产品条码是否存在
if (UpdateSendPlcConfig(new ScanIPConfig { PID = Config.PID, PlcAddr = PlcAddr }))
if (!string.IsNullOrEmpty(Config.PlcAddr))
{
var ProductList = SelectProduct(Config.BarCode);
if (ProductList != null)
var BarCode = Config.BarCode;
var PlcAddr = Config.PlcAddr;
GetNewCode(ref BarCode, ref PlcAddr); //查询产品条码是否存在
if (UpdateSendPlcConfig(new ScanIPConfig { PID = Config.PID, PlcAddr = PlcAddr }))
{
var PID = Guid.NewGuid().ToString();
var ProductNew = new Product()
{
PRODUCTCODE = BarCode,
PID = PID,
MACHINECODDE = _operationServiceParam.machineInfo.MACHINECODDE,
MACHINENAME = _operationServiceParam.machineInfo.MACHINENAME,
PRODUCTSOURCE = "0",
MATERIAL_CODE = ProductList.MATERIAL_CODE,
STATUS = "0",
OUTFLAG = "0",
USINGSTATE = "0",
CAPACITY = 1,
USINGCOUNT = 0,
WORKCELL_CODE = ProductList.WORKCELL_CODE,
WORKLOC_CODE = ProductList.WORKLOC_CODE,
WORKCENTER_CODE = ProductList.WORKCENTER_CODE
};
var ProcessRecords = new ProcessRecord()
var ProductList = SelectProduct(Config.BarCode);
if (ProductList != null)
{
PID = Guid.NewGuid().ToString(),
PRODUCT_PID = ProductNew.PID,
WORKCELL_CODE = ProductList.WORKCELL_CODE,
WORKLOC_CODE = ProductList.WORKLOC_CODE,
IN_WORKCELL_TIME = DateTime.Now,
WORK_START_TIME = DateTime.Now,
WORK_END_TIME = DateTime.Now,
PROCESS_STATE = "1",
MANUAL_PASS = "",
MODULE_CODE = string.Equals(dai.DIVBY_MOULD, "0") ? _operationServiceParam.machineInfo.WORKCELL_CODE : (string.IsNullOrWhiteSpace(lblMould.Text) ? _operationServiceParam.machineInfo.WORKCELL_CODE : lblMould.Text)
};
if (InsertProduct(ProductNew) && InsertProcessRecord(ProcessRecords))
{
txtCode.Text = BarCode;
Operation();
var PID = Guid.NewGuid().ToString();
var ProductNew = new Product()
{
PRODUCTCODE = BarCode,
PID = PID,
MACHINECODDE = _operationServiceParam.machineInfo.MACHINECODDE,
MACHINENAME = _operationServiceParam.machineInfo.MACHINENAME,
PRODUCTSOURCE = "0",
MATERIAL_CODE = ProductList.MATERIAL_CODE,
STATUS = "0",
OUTFLAG = "0",
USINGSTATE = "0",
CAPACITY = 1,
USINGCOUNT = 0,
WORKCELL_CODE = ProductList.WORKCELL_CODE,
WORKLOC_CODE = ProductList.WORKLOC_CODE,
WORKCENTER_CODE = ProductList.WORKCENTER_CODE
};
//var ProcessRecords = new ProcessRecord()
//{
// PID = Guid.NewGuid().ToString(),
// PRODUCT_PID = ProductNew.PID,
// WORKCELL_CODE = ProductList.WORKCELL_CODE,
// WORKLOC_CODE = ProductList.WORKLOC_CODE,
// IN_WORKCELL_TIME = DateTime.Now,
// WORK_START_TIME = DateTime.Now,
// WORK_END_TIME = DateTime.Now,
// PROCESS_STATE = "1",
// MANUAL_PASS = "",
// MODULE_CODE = string.Equals(dai.DIVBY_MOULD, "0") ? _operationServiceParam.machineInfo.WORKCELL_CODE : (string.IsNullOrWhiteSpace(lblMould.Text) ? _operationServiceParam.machineInfo.WORKCELL_CODE : lblMould.Text)
//};
//if (InsertProduct(ProductNew) && InsertProcessRecord(ProcessRecords))
if (InsertProduct(ProductNew))
{
txtCode.Text = BarCode;
Operation();
}
}
}
}
}
else
{
txtCode.Text = Config.BarCode;
Operation();
else
{
txtCode.Text = Config.BarCode;
Operation();
}
}
}
}
}
//else
//{
// this.lblError.Text = "通过result.WorkOrderID({result.WorkOrderID.ToString()})未查询到WorkOrder.PBOM_CODE";
// this.lblError.ForeColor = Color.Black;
// MessageBox.Show($"通过result.WorkOrderID({result.WorkOrderID.ToString()})未查询到WorkOrder.PBOM_CODE");
//}
}
else
{
this.lblError.Text = "result.WorkOrderID为空,未进行后续填充!";
this.lblError.ForeColor = Color.Black;
MessageBox.Show($"result.WorkOrderID为空,未进行后续填充!");
if (!string.IsNullOrEmpty(result.WorkOrderID))
{
List<FJC.Entity.ProductionPlan.WorkOrder> list = this.dgvPlan.DataSource as List<FJC.Entity.ProductionPlan.WorkOrder>;
var pBomcode = GetWorkOrder_MATERIAL_CODE(result.WorkOrderID);
if (!string.IsNullOrEmpty(pBomcode))
{
//List<FJC.Entity.ProductionPlan.WorkOrder> filterList = list.Where(p => pBomCodes.Contains(p.MATERIAL_CODE)).ToList();
var ScanIPConfig_list = GetSendPlcConfig(new ScanIPConfig() { MaterialCode = pBomcode, LocCode = _operationServiceParam.machineInfo.WORKLOC_CODE });
if (ScanIPConfig_list != null && ScanIPConfig_list.Count > 0)
{
foreach (var Config in ScanIPConfig_list)
{
if (!string.IsNullOrEmpty(Config.PlcAddr))
{
var BarCode = Config.BarCode;
var PlcAddr = Config.PlcAddr;
GetNewCode(ref BarCode, ref PlcAddr); //查询产品条码是否存在
if (UpdateSendPlcConfig(new ScanIPConfig { PID = Config.PID, PlcAddr = PlcAddr }))
{
var ProductList = SelectProduct(Config.BarCode);
if (ProductList != null)
{
var PID = Guid.NewGuid().ToString();
var ProductNew = new Product()
{
PRODUCTCODE = BarCode,
PID = PID,
MACHINECODDE = _operationServiceParam.machineInfo.MACHINECODDE,
MACHINENAME = _operationServiceParam.machineInfo.MACHINENAME,
PRODUCTSOURCE = "0",
MATERIAL_CODE = ProductList.MATERIAL_CODE,
STATUS = "0",
OUTFLAG = "0",
USINGSTATE = "0",
CAPACITY = 1,
USINGCOUNT = 0,
WORKCELL_CODE = ProductList.WORKCELL_CODE,
WORKLOC_CODE = ProductList.WORKLOC_CODE,
WORKCENTER_CODE = ProductList.WORKCENTER_CODE
};
var ProcessRecords = new ProcessRecord()
{
PID = Guid.NewGuid().ToString(),
PRODUCT_PID = ProductNew.PID,
WORKCELL_CODE = ProductList.WORKCELL_CODE,
WORKLOC_CODE = ProductList.WORKLOC_CODE,
IN_WORKCELL_TIME = DateTime.Now,
WORK_START_TIME = DateTime.Now,
WORK_END_TIME = DateTime.Now,
PROCESS_STATE = "1",
MANUAL_PASS = "",
MODULE_CODE = string.Equals(dai.DIVBY_MOULD, "0") ? _operationServiceParam.machineInfo.WORKCELL_CODE : (string.IsNullOrWhiteSpace(lblMould.Text) ? _operationServiceParam.machineInfo.WORKCELL_CODE : lblMould.Text)
};
if (InsertProduct(ProductNew) && InsertProcessRecord(ProcessRecords))
{
txtCode.Text = BarCode;
Operation();
}
}
}
}
else
{
txtCode.Text = Config.BarCode;
Operation();
}
}
}
}
//else
//{
// this.lblError.Text = "通过result.WorkOrderID({result.WorkOrderID.ToString()})未查询到WorkOrder.PBOM_CODE";
// this.lblError.ForeColor = Color.Black;
// MessageBox.Show($"通过result.WorkOrderID({result.WorkOrderID.ToString()})未查询到WorkOrder.PBOM_CODE");
//}
}
else
{
this.lblError.Text = "result.WorkOrderID为空,未进行后续填充!";
this.lblError.ForeColor = Color.Black;
MessageBox.Show($"result.WorkOrderID为空,未进行后续填充!");
}
}
}
}

4
APPQ5/QMAPP.WinForm/Properties/AssemblyInfo.cs

@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值,
// 方法是按如下所示使用“*”:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2022.09.23.01")]
[assembly: AssemblyFileVersion("2022.09.23.01")]
[assembly: AssemblyVersion("2022.09.26.01")]
[assembly: AssemblyFileVersion("2022.09.26.01")]

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

@ -76,11 +76,12 @@
<!--<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=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=10.117.133.48;Initial Catalog=ADIENT_TJ_MES;User Id=sa;Password=ASDqwe123!@#;" providerName="System.Data.SqlClient"/>-->

Loading…
Cancel
Save