From b26eb148d0773f4d2a2c39117580d9427abe91c7 Mon Sep 17 00:00:00 2001 From: "dequan.zhang" <13820060@qq.com> Date: Tue, 4 Apr 2023 10:35:29 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=B8=BD=E6=AA=90=E5=B7=A5=E4=BD=8D?= =?UTF-8?q?=E8=AE=A1=E5=88=92=EF=BC=88=E6=9A=82=E6=97=B6=E5=B1=8F=E8=94=BD?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DataValidators/PlanValidator.cs | 14 +++++++++++++- .../StateActions/SubmitWithOrder.cs | 10 +++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/APPQ5/QMAPP.FJC.TRACING/DataValidators/PlanValidator.cs b/APPQ5/QMAPP.FJC.TRACING/DataValidators/PlanValidator.cs index b271c13..fc366f8 100644 --- a/APPQ5/QMAPP.FJC.TRACING/DataValidators/PlanValidator.cs +++ b/APPQ5/QMAPP.FJC.TRACING/DataValidators/PlanValidator.cs @@ -23,7 +23,8 @@ namespace QMAPP.FJC.TRACING.DataValidators //获取当前工位正在执行的派工单 var workorder= workorderdal.GetWorkingOrderInLoc(data.WorkLocState.WORKLOC_CODE,data.MouldCode); - //----------------------------------------------------------------------------------------------- + + //--------------------BC316总成装配工位---------------------------------------------------------- if (data.WorkLocState.WORKCELL_CODE == "ASSEMBLE_BC316") { //20210120 DQzhang 获取当前工位第一条派工单 @@ -35,6 +36,17 @@ namespace QMAPP.FJC.TRACING.DataValidators } //----------------------------------------------------------------------------------------------- + + //--------------------BC316帽檐超声波焊接工位---------------------------------------------------- + //if (data.WorkLocState.WORKCELL_CODE == "BRIM_WELDING_BC316") + //{ + // //20230309 DQzhang 获取当前工位第一条派工单 + // workorder = workorderdal.GetFirstOrderInLoc(data.WorkLocState.WORKCELL_CODE, data.MouldCode); + //} + //----------------------------------------------------------------------------------------------- + + + if (workorder == null) //不存在正在执行的派工单 { //获取当前工序优先级最高的工单 diff --git a/APPQ5/QMAPP.FJC.TRACING/StateActions/SubmitWithOrder.cs b/APPQ5/QMAPP.FJC.TRACING/StateActions/SubmitWithOrder.cs index abf12e1..94f7287 100644 --- a/APPQ5/QMAPP.FJC.TRACING/StateActions/SubmitWithOrder.cs +++ b/APPQ5/QMAPP.FJC.TRACING/StateActions/SubmitWithOrder.cs @@ -113,7 +113,15 @@ namespace QMAPP.FJC.TRACING.StateActions //关联计划ID product.PLAN_ID = workorder.ORDERPLANID; product.PLAN_NO = workorder.ORDERPLAN_NO; - + + //--------------------BC316帽檐超声波焊接工位---------------------------------------------------- + //if (data.WorkLocState.WORKCELL_CODE == "BRIM_WELDING_BC316") + //{ + // workorder.IsDelete = true; + //} + //----------------------------------------------------------------------------------------------- + + if (!workcellend) { workorder.WORKLOC_CODE = data.WorkLocState.WORKLOC_CODE; From f95cfde5a956e051852bba6e8d38430985cba7de Mon Sep 17 00:00:00 2001 From: "dequan.zhang" <13820060@qq.com> Date: Thu, 20 Apr 2023 10:33:23 +0800 Subject: [PATCH 2/3] =?UTF-8?q?BC316=E5=B8=BD=E6=AA=90=E8=B6=85=E5=A3=B0?= =?UTF-8?q?=E6=B3=A2=E4=B8=80=E5=A2=9E=E5=8A=A0=E5=8D=95=E4=B8=80=E5=B7=A5?= =?UTF-8?q?=E4=BD=8Dfis=E8=AE=A1=E5=88=92=E7=94=9F=E4=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../QMAPP.FJC.TRACING/DataValidators/PlanValidator.cs | 10 +++++----- .../QMAPP.FJC.TRACING/StateActions/SubmitWithOrder.cs | 8 ++++---- APPQ5/QMAPP.WinForm/App.config | 6 +++--- .../WCF/QMFrameWork.WebServiceHost/Web.config | 6 +++--- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/APPQ5/QMAPP.FJC.TRACING/DataValidators/PlanValidator.cs b/APPQ5/QMAPP.FJC.TRACING/DataValidators/PlanValidator.cs index fc366f8..3a2f358 100644 --- a/APPQ5/QMAPP.FJC.TRACING/DataValidators/PlanValidator.cs +++ b/APPQ5/QMAPP.FJC.TRACING/DataValidators/PlanValidator.cs @@ -38,11 +38,11 @@ namespace QMAPP.FJC.TRACING.DataValidators //--------------------BC316帽檐超声波焊接工位---------------------------------------------------- - //if (data.WorkLocState.WORKCELL_CODE == "BRIM_WELDING_BC316") - //{ - // //20230309 DQzhang 获取当前工位第一条派工单 - // workorder = workorderdal.GetFirstOrderInLoc(data.WorkLocState.WORKCELL_CODE, data.MouldCode); - //} + if (data.WorkLocState.WORKCELL_CODE == "BRIM_WELDING_BC316") + { + //20230309 DQzhang 获取当前工位第一条派工单 + workorder = workorderdal.GetFirstOrderInLoc(data.WorkLocState.WORKCELL_CODE, data.MouldCode); + } //----------------------------------------------------------------------------------------------- diff --git a/APPQ5/QMAPP.FJC.TRACING/StateActions/SubmitWithOrder.cs b/APPQ5/QMAPP.FJC.TRACING/StateActions/SubmitWithOrder.cs index 94f7287..eed5f8a 100644 --- a/APPQ5/QMAPP.FJC.TRACING/StateActions/SubmitWithOrder.cs +++ b/APPQ5/QMAPP.FJC.TRACING/StateActions/SubmitWithOrder.cs @@ -115,10 +115,10 @@ namespace QMAPP.FJC.TRACING.StateActions product.PLAN_NO = workorder.ORDERPLAN_NO; //--------------------BC316帽檐超声波焊接工位---------------------------------------------------- - //if (data.WorkLocState.WORKCELL_CODE == "BRIM_WELDING_BC316") - //{ - // workorder.IsDelete = true; - //} + if (data.WorkLocState.WORKCELL_CODE == "BRIM_WELDING_BC316") + { + workorder.IsDelete = true; + } //----------------------------------------------------------------------------------------------- diff --git a/APPQ5/QMAPP.WinForm/App.config b/APPQ5/QMAPP.WinForm/App.config index 98f4854..98e4904 100644 --- a/APPQ5/QMAPP.WinForm/App.config +++ b/APPQ5/QMAPP.WinForm/App.config @@ -6,10 +6,10 @@ - --> + - + diff --git a/ServicesCenter/WCF/QMFrameWork.WebServiceHost/Web.config b/ServicesCenter/WCF/QMFrameWork.WebServiceHost/Web.config index 2e96a89..db7e3ac 100644 --- a/ServicesCenter/WCF/QMFrameWork.WebServiceHost/Web.config +++ b/ServicesCenter/WCF/QMFrameWork.WebServiceHost/Web.config @@ -64,9 +64,9 @@ - @@ -78,7 +78,7 @@ - + From adf3c76b6c7e9e1979a200f5fdfea7a12ef9c4a0 Mon Sep 17 00:00:00 2001 From: "dequan.zhang" <13820060@qq.com> Date: Mon, 24 Apr 2023 14:34:26 +0800 Subject: [PATCH 3/3] =?UTF-8?q?BC316=E5=B8=BD=E6=AA=90=E8=B6=85=E5=A3=B0?= =?UTF-8?q?=E7=84=8A=E5=B7=A5=E4=BD=8D=E8=AE=A1=E5=88=92=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProductionPlan/WorkOrderDAL.cs | 114 +++++++++++++----- .../DataValidators/PlanValidator.cs | 5 +- .../StateActions/SubmitWithOrder.cs | 2 +- APPQ5/QMAPP.WinForm/App.config | 26 ++-- .../QMAPP.WinForm/Properties/AssemblyInfo.cs | 4 +- .../WCF/QMFrameWork.WebServiceHost/Web.config | 14 +-- 6 files changed, 111 insertions(+), 54 deletions(-) diff --git a/APPQ5/QMAPP.FJC.DAL/ProductionPlan/WorkOrderDAL.cs b/APPQ5/QMAPP.FJC.DAL/ProductionPlan/WorkOrderDAL.cs index 63e5816..5d0c942 100644 --- a/APPQ5/QMAPP.FJC.DAL/ProductionPlan/WorkOrderDAL.cs +++ b/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 parameters = new List(); parameters.Add(new DataParameter("workcellcode", workcellcode)); using (var session = AppDataFactory.CreateMainSession()) @@ -324,6 +341,8 @@ namespace QMAPP.FJC.DAL.ProductionPlan } } + + /// /// 获取指定工序的生产计划清单 /// @@ -762,35 +781,76 @@ namespace QMAPP.FJC.DAL.ProductionPlan { List parameters = new List(); 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(sql.ToString(), parameters.ToArray()); diff --git a/APPQ5/QMAPP.FJC.TRACING/DataValidators/PlanValidator.cs b/APPQ5/QMAPP.FJC.TRACING/DataValidators/PlanValidator.cs index 3a2f358..71ea5e2 100644 --- a/APPQ5/QMAPP.FJC.TRACING/DataValidators/PlanValidator.cs +++ b/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); + } //----------------------------------------------------------------------------------------------- diff --git a/APPQ5/QMAPP.FJC.TRACING/StateActions/SubmitWithOrder.cs b/APPQ5/QMAPP.FJC.TRACING/StateActions/SubmitWithOrder.cs index eed5f8a..6247ee5 100644 --- a/APPQ5/QMAPP.FJC.TRACING/StateActions/SubmitWithOrder.cs +++ b/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; } diff --git a/APPQ5/QMAPP.WinForm/App.config b/APPQ5/QMAPP.WinForm/App.config index 98e4904..8349214 100644 --- a/APPQ5/QMAPP.WinForm/App.config +++ b/APPQ5/QMAPP.WinForm/App.config @@ -3,23 +3,20 @@ - - - + + + + - - + @@ -30,7 +27,12 @@ --> - + + + + + + diff --git a/APPQ5/QMAPP.WinForm/Properties/AssemblyInfo.cs b/APPQ5/QMAPP.WinForm/Properties/AssemblyInfo.cs index 0f4c43f..d0874e6 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("2023.01.02.02")] -[assembly: AssemblyFileVersion("2023.01.02.02")] +[assembly: AssemblyVersion("2023.04.02.02")] +[assembly: AssemblyFileVersion("2023.04.02.02")] diff --git a/ServicesCenter/WCF/QMFrameWork.WebServiceHost/Web.config b/ServicesCenter/WCF/QMFrameWork.WebServiceHost/Web.config index db7e3ac..a00c2ef 100644 --- a/ServicesCenter/WCF/QMFrameWork.WebServiceHost/Web.config +++ b/ServicesCenter/WCF/QMFrameWork.WebServiceHost/Web.config @@ -63,10 +63,10 @@ - - + + @@ -96,13 +96,11 @@ + + ---> - - -