From 8b45c1e0c645c79bea0ae6bd5a1951d26a32c3e7 Mon Sep 17 00:00:00 2001 From: "songnan.zhang" Date: Tue, 12 Apr 2022 15:40:38 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85BC316?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProductionPlan/WorkOrderDAL.cs | 51 +++++++++++++++++++ .../DataValidators/PlanValidator.cs | 9 ++++ APPQ5/QMAPP.WinForm/App.config | 6 +-- .../WCF/QMFrameWork.WebServiceHost/Web.config | 4 +- 4 files changed, 65 insertions(+), 5 deletions(-) diff --git a/APPQ5/QMAPP.FJC.DAL/ProductionPlan/WorkOrderDAL.cs b/APPQ5/QMAPP.FJC.DAL/ProductionPlan/WorkOrderDAL.cs index 16f5b9d..bd4d152 100644 --- a/APPQ5/QMAPP.FJC.DAL/ProductionPlan/WorkOrderDAL.cs +++ b/APPQ5/QMAPP.FJC.DAL/ProductionPlan/WorkOrderDAL.cs @@ -751,6 +751,57 @@ namespace QMAPP.FJC.DAL.ProductionPlan } } + /// + /// 获取指定工位第一条的派工单 + /// + /// + /// + public WorkOrder GetFirstOrderInLoc(string workcellcode, string mouldcode) + { + try + { + 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.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 "); + //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] "); + parameters.Add(new DataParameter("workcellcode", workcellcode)); + parameters.Add(new DataParameter("mouldcode", mouldcode)); + using (var session = AppDataFactory.CreateMainSession()) + { + return session.Get(sql.ToString(), parameters.ToArray()); + } + } + catch (Exception ex) + { + throw ex; + } + } + /// /// 获取工序下匹配的派工单 /// diff --git a/APPQ5/QMAPP.FJC.TRACING/DataValidators/PlanValidator.cs b/APPQ5/QMAPP.FJC.TRACING/DataValidators/PlanValidator.cs index 9ee5a3a..644d97f 100644 --- a/APPQ5/QMAPP.FJC.TRACING/DataValidators/PlanValidator.cs +++ b/APPQ5/QMAPP.FJC.TRACING/DataValidators/PlanValidator.cs @@ -22,6 +22,15 @@ namespace QMAPP.FJC.TRACING.DataValidators var workorderlist = new List(); //获取当前工位正在执行的派工单 var workorder= workorderdal.GetWorkingOrderInLoc(data.WorkLocState.WORKLOC_CODE,data.MouldCode); + + //----------------------------------------------------------------------------------------------- + if (data.WorkLocState.WORKCELL_CODE == "ASSEMBLE_BC316") + { + //20210120 DQzhang 获取当前工位第一条派工单 + workorder = workorderdal.GetFirstOrderInLoc(data.WorkLocState.WORKCELL_CODE, data.MouldCode); + } + //----------------------------------------------------------------------------------------------- + if (workorder == null) //不存在正在执行的派工单 { //获取当前工序优先级最高的工单 diff --git a/APPQ5/QMAPP.WinForm/App.config b/APPQ5/QMAPP.WinForm/App.config index ed50406..f59e43a 100644 --- a/APPQ5/QMAPP.WinForm/App.config +++ b/APPQ5/QMAPP.WinForm/App.config @@ -8,10 +8,10 @@ - + + - + diff --git a/ServicesCenter/WCF/QMFrameWork.WebServiceHost/Web.config b/ServicesCenter/WCF/QMFrameWork.WebServiceHost/Web.config index d651a04..ac985c4 100644 --- a/ServicesCenter/WCF/QMFrameWork.WebServiceHost/Web.config +++ b/ServicesCenter/WCF/QMFrameWork.WebServiceHost/Web.config @@ -64,9 +64,9 @@ - + - +