Browse Source

BC316帽檐超声焊工位计划排序

master
dequan.zhang 2 years ago
parent
commit
adf3c76b6c
  1. 114
      APPQ5/QMAPP.FJC.DAL/ProductionPlan/WorkOrderDAL.cs
  2. 5
      APPQ5/QMAPP.FJC.TRACING/DataValidators/PlanValidator.cs
  3. 2
      APPQ5/QMAPP.FJC.TRACING/StateActions/SubmitWithOrder.cs
  4. 22
      APPQ5/QMAPP.WinForm/App.config
  5. 4
      APPQ5/QMAPP.WinForm/Properties/AssemblyInfo.cs
  6. 10
      ServicesCenter/WCF/QMFrameWork.WebServiceHost/Web.config

114
APPQ5/QMAPP.FJC.DAL/ProductionPlan/WorkOrderDAL.cs

@ -265,7 +265,15 @@ namespace QMAPP.FJC.DAL.ProductionPlan
try
{
StringBuilder sql = new StringBuilder();
sql.AppendFormat("SELECT TOP {0} W.[PID]\r\n", count);
if (workcellcode == "BRIM_WELDING_BC316")
{
sql.AppendFormat("SELECT TOP 12 A.[PID], A.[ORDERPLANID], A.[ORDERPLAN_NO], A.[ORDER_TYPE], A.[SEQ], A.[MATERIAL_CODE], A.[MATERIAL_NAME], A.[PBOM_CODE], A.[QTY], A.[COMPLETE_QTY], A.[PLAN_DATE], A.[SHIFT_CODE], A.[WORKCENTER_CODE], A.[WORKCENTER_NAME], A.[WORKCELL_CODE], A.[WORKCELL_NAME], A.[WORKLOC_CODE], A.[REMARK], A.[EQPT_NAME], A.[EQPT_CODE], A.[STATE], A.[MOULD_CODE], A.[PRI], A.[UPDATEDATE], A.[IGNORE_FISBREAK], A.[FIS_ASMSETCODE] FROM ( ");
sql.AppendFormat("SELECT TOP {0} W.[PID]\r\n", 12);
}else
{
sql.AppendFormat("SELECT TOP {0} W.[PID]\r\n", count);
}
sql.AppendFormat(" ,W.[ORDERPLANID] ");
sql.AppendFormat(" ,W.[ORDERPLAN_NO] ");
sql.AppendFormat(" ,W.[ORDER_TYPE] ");
@ -289,6 +297,7 @@ namespace QMAPP.FJC.DAL.ProductionPlan
sql.AppendFormat(" ,W.[MOULD_CODE] ");
sql.AppendFormat(" ,W.[PRI] ");
sql.AppendFormat(" ,W.[UPDATEDATE] ");
sql.AppendFormat(" ,P.[PLAN_SEQ] ");
sql.AppendFormat(" ,P.[IGNORE_FISBREAK] ");
sql.AppendFormat(" ,P.[FIS_ASMSETCODE] ");
sql.AppendFormat(" FROM [T_PP_WORKORDER] AS W WITH(NOLOCK) ");
@ -310,7 +319,15 @@ namespace QMAPP.FJC.DAL.ProductionPlan
break;
}
}
sql.AppendFormat(" ORDER BY W.[UPDATEDATE],W.[PRI],W.[PLAN_DATE],P.PLAN_SEQ,W.[SEQ],W.[MATERIAL_CODE] ");
if (workcellcode == "BRIM_WELDING_BC316")
{
sql.AppendFormat(" ORDER BY W.[PLAN_DATE]) A ");
sql.AppendFormat(" ORDER BY A.[UPDATEDATE],A.[PRI],A.[PLAN_DATE],A.PLAN_SEQ,A.[SEQ],A.[MATERIAL_CODE] ");
}
else
{
sql.AppendFormat(" ORDER BY W.[UPDATEDATE],W.[PRI],W.[PLAN_DATE],P.PLAN_SEQ,W.[SEQ],W.[MATERIAL_CODE] ");
}
List<DataParameter> parameters = new List<DataParameter>();
parameters.Add(new DataParameter("workcellcode", workcellcode));
using (var session = AppDataFactory.CreateMainSession())
@ -324,6 +341,8 @@ namespace QMAPP.FJC.DAL.ProductionPlan
}
}
/// <summary>
/// 获取指定工序的生产计划清单
/// </summary>
@ -762,35 +781,76 @@ namespace QMAPP.FJC.DAL.ProductionPlan
{
List<DataParameter> parameters = new List<DataParameter>();
StringBuilder sql = new StringBuilder();
sql.AppendLine("SELECT TOP 1 W.* ");
sql.AppendLine(" ,P.[IGNORE_FISBREAK] ");
sql.AppendFormat(" FROM [T_PP_WORKORDER] AS W ");
sql.AppendFormat(" LEFT JOIN [T_PP_ORDERPLAN] AS P ");
//sql.AppendLine("SELECT TOP 1 W.* ");
//sql.AppendLine(" ,P.[IGNORE_FISBREAK] ");
//sql.AppendFormat(" FROM [T_PP_WORKORDER] AS W ");
//sql.AppendFormat(" LEFT JOIN [T_PP_ORDERPLAN] AS P ");
//sql.AppendFormat(" ON P.[PID]=W.[ORDERPLANID] ");
//sql.AppendFormat(" LEFT JOIN [T_MD_MATERIAL] AS M ");
//sql.AppendFormat(" ON W.[MATERIAL_CODE]=M.[MATERIAL_CODE] ");
//sql.AppendFormat(" WHERE W.[WORKCELL_CODE]=@workcellcode ");
//sql.AppendLine(" AND W.[STATE]<>'4' AND W.[STATE]<>'2' ");
//sql.AppendFormat(" ORDER BY W.[PRI],W.[PLAN_DATE],P.PLAN_SEQ,W.[SEQ],W.[MATERIAL_CODE] ");
//parameters.Add(new DataParameter("workcellcode", workcellcode));
//parameters.Add(new DataParameter("mouldcode", mouldcode));
if (workcellcode == "BRIM_WELDING_BC316")
{
sql.AppendFormat("SELECT TOP 1 A.[PID], A.[ORDERPLANID], A.[ORDERPLAN_NO], A.[ORDER_TYPE], A.[SEQ], A.[MATERIAL_CODE], A.[MATERIAL_NAME], A.[PBOM_CODE], A.[QTY], A.[COMPLETE_QTY], A.[PLAN_DATE], A.[SHIFT_CODE], A.[WORKCENTER_CODE], A.[WORKCENTER_NAME], A.[WORKCELL_CODE], A.[WORKCELL_NAME], A.[WORKLOC_CODE], A.[REMARK], A.[EQPT_NAME], A.[EQPT_CODE], A.[STATE], A.[MOULD_CODE], A.[PRI], A.[UPDATEDATE], A.[IGNORE_FISBREAK], A.[FIS_ASMSETCODE] FROM ( ");
sql.AppendFormat("SELECT TOP {0} W.[PID]\r\n", 12);
}
else
{
sql.AppendFormat("SELECT TOP {0} W.[PID]\r\n", 1);
}
sql.AppendFormat(" ,W.[ORDERPLANID] ");
sql.AppendFormat(" ,W.[ORDERPLAN_NO] ");
sql.AppendFormat(" ,W.[ORDER_TYPE] ");
sql.AppendFormat(" ,W.[SEQ] ");
sql.AppendFormat(" ,W.[MATERIAL_CODE] ");
sql.AppendFormat(" ,M.[MATERIAL_NAME] ");
sql.AppendFormat(" ,W.[PBOM_CODE] ");
sql.AppendFormat(" ,W.[QTY] ");
sql.AppendFormat(" ,W.[COMPLETE_QTY] ");
sql.AppendFormat(" ,W.[PLAN_DATE] ");
sql.AppendFormat(" ,W.[SHIFT_CODE] ");
sql.AppendFormat(" ,W.[WORKCENTER_CODE] ");
sql.AppendFormat(" ,W.[WORKCENTER_NAME] ");
sql.AppendFormat(" ,W.[WORKCELL_CODE] ");
sql.AppendFormat(" ,W.[WORKCELL_NAME] ");
sql.AppendFormat(" ,W.[WORKLOC_CODE] ");
sql.AppendFormat(" ,W.[REMARK] ");
sql.AppendFormat(" ,W.[EQPT_NAME] ");
sql.AppendFormat(" ,W.[EQPT_CODE] ");
sql.AppendFormat(" ,W.[STATE] ");
sql.AppendFormat(" ,W.[MOULD_CODE] ");
sql.AppendFormat(" ,W.[PRI] ");
sql.AppendFormat(" ,W.[UPDATEDATE] ");
sql.AppendFormat(" ,P.[PLAN_SEQ] ");
sql.AppendFormat(" ,P.[IGNORE_FISBREAK] ");
sql.AppendFormat(" ,P.[FIS_ASMSETCODE] ");
sql.AppendFormat(" FROM [T_PP_WORKORDER] AS W WITH(NOLOCK) ");
sql.AppendFormat(" LEFT JOIN [T_PP_ORDERPLAN] AS P WITH(NOLOCK) ");
sql.AppendFormat(" ON P.[PID]=W.[ORDERPLANID] ");
sql.AppendFormat(" LEFT JOIN [T_MD_MATERIAL] AS M ");
sql.AppendFormat(" LEFT JOIN [T_MD_MATERIAL] AS M WITH(NOLOCK)");
sql.AppendFormat(" ON W.[MATERIAL_CODE]=M.[MATERIAL_CODE] ");
sql.AppendFormat(" WHERE W.[WORKCELL_CODE]=@workcellcode ");
//if (mouldcode == "HWL_FRONT") // 左前门
//{
// sql.AppendLine(" and left(W.PBOM_CODE,10) = 'VW331DP_LF'");
//}
//else if (mouldcode == "HWL_REAR") //左后门
//{
// sql.AppendLine(" and left(W.PBOM_CODE,10) = 'VW331DP_LR' ");
//}
//else if (mouldcode == "HWL_FRONT") //右前门
//{
// sql.AppendLine(" and left(W.PBOM_CODE,10) = 'VW331DP_RF' ");
//}
//else if (mouldcode == "HWR_REAR") //右后门
//{
// sql.AppendLine(" and left(W.PBOM_CODE,10) = 'VW331DP_RR' ");
//}
//sql.AppendLine(" AND W.[MOULD_CODE]=@mouldcode ");
sql.AppendLine(" AND W.[STATE]<>'4' ");
sql.AppendFormat(" ORDER BY W.[PRI],W.[PLAN_DATE],P.PLAN_SEQ,W.[SEQ],W.[MATERIAL_CODE] ");
sql.AppendFormat(" AND W.[STATE]<>4 and W.[STATE]<>2 ");
if (workcellcode == "BRIM_WELDING_BC316")
{
sql.AppendFormat(" ORDER BY W.[PLAN_DATE]) A ");
sql.AppendFormat(" ORDER BY A.[UPDATEDATE],A.[PRI],A.[PLAN_DATE],A.PLAN_SEQ,A.[SEQ],A.[MATERIAL_CODE] ");
}
else
{
sql.AppendFormat(" ORDER BY W.[UPDATEDATE],W.[PRI],W.[PLAN_DATE],P.PLAN_SEQ,W.[SEQ],W.[MATERIAL_CODE] ");
}
parameters.Add(new DataParameter("workcellcode", workcellcode));
parameters.Add(new DataParameter("mouldcode", mouldcode));
using (var session = AppDataFactory.CreateMainSession())
{
return session.Get<WorkOrder>(sql.ToString(), parameters.ToArray());

5
APPQ5/QMAPP.FJC.TRACING/DataValidators/PlanValidator.cs

@ -27,10 +27,6 @@ namespace QMAPP.FJC.TRACING.DataValidators
//--------------------BC316总成装配工位----------------------------------------------------------
if (data.WorkLocState.WORKCELL_CODE == "ASSEMBLE_BC316")
{
//20210120 DQzhang 获取当前工位第一条派工单
//workorder = workorderdal.GetFirstOrderInLoc(data.WorkLocState.WORKCELL_CODE, data.MouldCode);
//20220501 DQzhang 用pid 获取重新排序后的第一条派工单
workorder = workorderdal.GetNewFirstOrderInLoc(data.WorkLocState.CurrentState.ORDERPLAN_PID, data.MouldCode);
}
@ -42,6 +38,7 @@ namespace QMAPP.FJC.TRACING.DataValidators
{
//20230309 DQzhang 获取当前工位第一条派工单
workorder = workorderdal.GetFirstOrderInLoc(data.WorkLocState.WORKCELL_CODE, data.MouldCode);
}
//-----------------------------------------------------------------------------------------------

2
APPQ5/QMAPP.FJC.TRACING/StateActions/SubmitWithOrder.cs

@ -115,7 +115,7 @@ namespace QMAPP.FJC.TRACING.StateActions
product.PLAN_NO = workorder.ORDERPLAN_NO;
//--------------------BC316帽檐超声波焊接工位----------------------------------------------------
if (data.WorkLocState.WORKCELL_CODE == "BRIM_WELDING_BC316")
if (data.WorkLocState.WORKCELL_CODE == "BRIM_WELDING_BC316" && data.WorkLocState.CurrentState.STATE_CODE== "WORKING")
{
workorder.IsDelete = true;
}

22
APPQ5/QMAPP.WinForm/App.config

@ -3,23 +3,20 @@
<connectionStrings>
<!--主数据库连接-->
<!--
<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=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=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"/>
-->
@ -31,6 +28,11 @@
<!--<add name="maindb" connectionString="Data Source=123.56.115.74;Initial Catalog=ADIENT_TJ_MES;User Id=sa;Password=qwe123$%^;" 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"/>
</connectionStrings>
<appSettings>

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

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

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

@ -64,9 +64,9 @@
<!--主数据库连接-->
<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="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="maindbYBB" connectionString="Data Source=10.111.144.72;Initial Catalog=scCFAACDYBNCSNF;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"/>-->
@ -96,13 +96,11 @@
<!--<add name="maindbYBB" connectionString="Data Source=10.111.144.72;Initial Catalog=scCFAACDYBNCSNF;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="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"/>
</connectionStrings>
<!--缓存设置-->

Loading…
Cancel
Save