diff --git a/APPQ5/QMAPP.FJC.BLL/FIS/DoorPlankPlanBLL.cs b/APPQ5/QMAPP.FJC.BLL/FIS/DoorPlankPlanBLL.cs index 627b2b6..4dc657b 100644 --- a/APPQ5/QMAPP.FJC.BLL/FIS/DoorPlankPlanBLL.cs +++ b/APPQ5/QMAPP.FJC.BLL/FIS/DoorPlankPlanBLL.cs @@ -257,7 +257,19 @@ namespace QMAPP.FJC.BLL.FIS } QMAPP.MD.Entity.ProcessRoute routecode = new QMAPP.MD.DAL.ProcessRouteDAL().RouteWithMaterial(model.MATERIAL_CODE); //QMAPP.MD.Entity.ProcessRoute routecode = new QMAPP.MD.DAL.ProcessRouteDAL().RouteWithMaterial(model.MATERIAL_CODE); - model.ROUTE_CODE = "DP_ASSEMBLY_770B"; + + var listMatral = new TJDoorPlankPlanDAL(); + var ListMachine = listMatral.GetListMachine(model.MATERIAL_CODE); + + foreach (var MA in ListMachine) + { + if (MA.MATERIALNAME.Contains("左")) + model.ROUTE_CODE = "DP_L_ASSEMBLY_770B"; + else if(MA.MATERIALNAME.Contains("右")) + model.ROUTE_CODE = "DP_R_ASSEMBLY_770B"; + } + + //model.ROUTE_CODE = "DP_ASSEMBLY_770B"; model.CREATEUSER = this.LoginUser.UserID; model.CREATEDATE = DateTime.Now; model.UPDATEUSER = model.CREATEUSER; @@ -907,7 +919,15 @@ namespace QMAPP.FJC.BLL.FIS workOrder["PLAN_DATE"] = info.PLAN_DATE; workOrder["SHIFT_CODE"] = info.SHIFT_CODE; workOrder["WORKCENTER_CODE"] = info.WORKCENTER_CODE; - workOrder["WORKCELL_CODE"] = "PREPARE1"; + if (info.ROUTE_CODE.Contains("DP_L")) + { + workOrder["WORKCELL_CODE"] = "DP_L_PREPARE1"; + } + else if(info.ROUTE_CODE.Contains("DP_R")) + workOrder["WORKCELL_CODE"] = "DP_R_PREPARE1"; + else + workOrder["WORKCELL_CODE"] = "PREPARE1"; + workOrder["WORKLOC_CODE"] = ""; workOrder["REMARK"] = ""; workOrder["EQPT_NAME"] = ""; @@ -1025,15 +1045,25 @@ namespace QMAPP.FJC.BLL.FIS workOrder["MATERIAL_CODE"] = ""; } - - workOrder["QTY"] = 1; workOrder["COMPLETE_QTY"] = 0; workOrder["PLAN_DATE"] = info.PLAN_DATE; workOrder["SHIFT_CODE"] = info.SHIFT_CODE; workOrder["WORKCENTER_CODE"] = info.WORKCENTER_CODE; - workOrder["WORKCELL_CODE"] = "PREPARE1"; + if (WEIZHI.Contains("左")) + { + workOrder["WORKCELL_CODE"] = "DP_L_PREPARE1"; + } + else if (WEIZHI.Contains("右")) + { + workOrder["WORKCELL_CODE"] = "DP_R_PREPARE1"; + } + else + { + workOrder["WORKCELL_CODE"] = "PREPARE1"; + } + workOrder["WORKLOC_CODE"] = ""; workOrder["REMARK"] = ""; workOrder["EQPT_NAME"] = ""; diff --git a/APPQ5/QMAPP.FJC.BLL/TianJin/TJDoorPlankPlanBLL.cs b/APPQ5/QMAPP.FJC.BLL/TianJin/TJDoorPlankPlanBLL.cs index 72972da..400d8c1 100644 --- a/APPQ5/QMAPP.FJC.BLL/TianJin/TJDoorPlankPlanBLL.cs +++ b/APPQ5/QMAPP.FJC.BLL/TianJin/TJDoorPlankPlanBLL.cs @@ -19,6 +19,7 @@ using QMFrameWork.Common.Util; using QMAPP.FJC.Entity.FileCopy.FIS; using QMAPP.FJC.Entity.TianJin; using QMAPP.FJC.DAL.TianJin; +using QMAPP.FJC.Entity.Basic; namespace QMAPP.FJC.BLL.TianJin { @@ -1011,5 +1012,20 @@ namespace QMAPP.FJC.BLL.TianJin } #endregion + + public List GetListMachine(string MaterielCode) + { + try + { + var dal = new TJDoorPlankPlanDAL(); + return dal.GetAllMachine(MaterielCode); + } + catch + { + return null; + } + + } + } } diff --git a/APPQ5/QMAPP.FJC.DAL/TianJin/TJDoorPlankPlanDAL.cs b/APPQ5/QMAPP.FJC.DAL/TianJin/TJDoorPlankPlanDAL.cs index ad122fe..9e57724 100644 --- a/APPQ5/QMAPP.FJC.DAL/TianJin/TJDoorPlankPlanDAL.cs +++ b/APPQ5/QMAPP.FJC.DAL/TianJin/TJDoorPlankPlanDAL.cs @@ -1050,6 +1050,19 @@ namespace QMAPP.FJC.DAL.TianJin } } + public List GetAllMachine(string MaterielCode) + { + string sql = null; + List parameters = new List(); + sql = $"SELECT MATERIAL_NAME as 'MATERIALNAME',MATERIAL_CODE as 'MATERIALNO' FROM [dbo].[T_MD_MATERIAL] where MATERIAL_CODE = '{MaterielCode}' "; + + using (IDataSession session = AppDataFactory.CreateMainSession()) + { + var datatable = session.GetList(sql, parameters.ToArray()).ToList(); + return datatable; + } + } + #endregion } } diff --git a/APPQ5/QMAPP.WinForm/App.config b/APPQ5/QMAPP.WinForm/App.config index ca6f96e..5cda615 100644 --- a/APPQ5/QMAPP.WinForm/App.config +++ b/APPQ5/QMAPP.WinForm/App.config @@ -207,12 +207,11 @@ - - - - + + + diff --git a/APPQ5/QMAPP.WinForm/Forms/TianJin/TJFrmPlace.cs b/APPQ5/QMAPP.WinForm/Forms/TianJin/TJFrmPlace.cs index d72713c..d4f6904 100644 --- a/APPQ5/QMAPP.WinForm/Forms/TianJin/TJFrmPlace.cs +++ b/APPQ5/QMAPP.WinForm/Forms/TianJin/TJFrmPlace.cs @@ -77,7 +77,8 @@ namespace QMAPP.WinForm.Forms.TianJin PlaceFirstPositionType = System.Configuration.ConfigurationManager.AppSettings["PlaceFirstPositionType"].ToString(); - _barcodeRules = _agent.InvokeServiceFunction>("BarcodeRulesBLL_GetListForSend"); + //_barcodeRules = _agent.InvokeServiceFunction>("BarcodeRulesBLL_GetListForSend"); + _barcodeRules = _agent.InvokeServiceFunction>(B9BasicService.BarcodeRulesBLL_GetAllList.ToString()); _TJFYPrintName = GetAppConfigValue("FYPrintName"); //查找所有 需要自动填充的工位 } @@ -190,10 +191,10 @@ namespace QMAPP.WinForm.Forms.TianJin DataTable tbl = agent.InvokeServiceFunction(QMAPP.ServicesAgent.FrmPlaceManage.TJFrmPlaceBLL_GetList.ToString(), pFisType, WORKCENTER_CODE); tbl.AcceptChanges(); - var tblf = tbl.Select("MOULD_CODE = '左前'"); - var tblr = tbl.Select("MOULD_CODE = '左后'"); - var tbrf = tbl.Select("MOULD_CODE = '右前'"); - var tbrr = tbl.Select("MOULD_CODE = '右后'"); + //var tblf = tbl.Select("MOULD_CODE = '左前'"); + //var tblr = tbl.Select("MOULD_CODE = '左后'"); + //var tbrf = tbl.Select("MOULD_CODE = '右前'"); + //var tbrr = tbl.Select("MOULD_CODE = '右后'"); //if (tb.Rows.Count > 0) //{ @@ -1287,14 +1288,14 @@ namespace QMAPP.WinForm.Forms.TianJin } } string msgs = ""; - CheckDataBase(inputstring,ref msgs); //检查T_PP_TJFY_WORKORDER 是否存在条码记录 - if (!string.IsNullOrEmpty(msgs)) - { - Alert("该条码已扫描!"); - txtCode.Text = ""; - txtCode.Focus(); - return; - } + //CheckDataBase(inputstring,ref msgs); //检查T_PP_TJFY_WORKORDER 是否存在条码记录 + //if (!string.IsNullOrEmpty(msgs)) + //{ + // Alert("该条码已扫描!"); + // txtCode.Text = ""; + // txtCode.Focus(); + // return; + //} foreach (var rule in _barcodeRules) { if (System.Text.RegularExpressions.Regex.IsMatch(inputstring, rule.REGEX)) @@ -1304,6 +1305,12 @@ namespace QMAPP.WinForm.Forms.TianJin strcarsetdesc_cn = rule.MATERIAL_TYPE; } } + + List tbl = agent.InvokeServiceFunction>(QMAPP.ServicesAgent.FrmPlaceManage.TJDoorPlankPlanBLL_GetListMachine.ToString(), strprodno); + + if (tbl.Count == 1) + strcarsetdesc_cn = tbl[0].MATERIALNAME; + strvin = inputstring; CreateNFPaste(inputstring); //创建NF的贴车单以及明细 @@ -1404,14 +1411,14 @@ namespace QMAPP.WinForm.Forms.TianJin //判断当前扫描过的数据集合中是否有相同条码 string msg = ""; - CheckDataBase(Code,ref msg); - if (!string.IsNullOrEmpty(msg)) - { - Alert("该条码已扫描!"); - txtCode.Text = ""; - txtCode.Focus(); - return; - } + //CheckDataBase(Code,ref msg); + //if (!string.IsNullOrEmpty(msg)) + //{ + // Alert("该条码已扫描!"); + // txtCode.Text = ""; + // txtCode.Focus(); + // return; + //} #endregion #endregion @@ -1807,7 +1814,7 @@ namespace QMAPP.WinForm.Forms.TianJin //pastdetail.KIN = strkin; pastdetail.DGVROWINDEX = dgvrowindex; - pastdetail.LINENO = strcarsetdesc_cn.Substring(0,3); + pastdetail.LINENO = strvin.Substring(0,3); pastdetail.MOULDCODE = strmouldcode; nfpastecard.DetailsCardlist.Add(pastdetail); nflist.Add(pastdetail); diff --git a/APPQ5/QMAPP.WinForm/Forms/TianJin/TJPrintPlanLabel.cs b/APPQ5/QMAPP.WinForm/Forms/TianJin/TJPrintPlanLabel.cs index 65cf662..49cd7f2 100644 --- a/APPQ5/QMAPP.WinForm/Forms/TianJin/TJPrintPlanLabel.cs +++ b/APPQ5/QMAPP.WinForm/Forms/TianJin/TJPrintPlanLabel.cs @@ -506,7 +506,7 @@ namespace QMAPP.WinForm.Forms.TianJin //变更打印状态 0=>1 _agent.InvokeServiceFunction("WorkOrderBLL_SetOrderPrinted", orders[0].PID); - InsertProduct(labeldata.OrderNo, orders[0].MATERIAL_CODE); + InsertProduct(labeldata.OrderNo, orders[0].MATERIAL_CODE, comboBox1.SelectedValue.ToString()); BindPlanView(); tsbPrint.Enabled = true; } @@ -534,7 +534,7 @@ namespace QMAPP.WinForm.Forms.TianJin /// /// /// - public void InsertProduct(string ProductCode,string Material_Code) + public void InsertProduct(string ProductCode,string Material_Code,string prepare) { #region 组成新增产品实例 Product newProduct = new Product(); @@ -560,10 +560,25 @@ namespace QMAPP.WinForm.Forms.TianJin newProduct.CAPACITY = 1; newProduct.USINGCOUNT = 0; + if (prepare.Contains("左")) + { + newProduct.WORKCELL_CODE = "DP_L_PREPARE1"; - newProduct.WORKCELL_CODE = "PREPARE1"; + newProduct.WORKLOC_CODE = "DP_L_PREPARELOC1"; + } + else if (prepare.Contains("右")) + { + newProduct.WORKCELL_CODE = "DP_R_PREPARE1"; - newProduct.WORKLOC_CODE = "DP_PREPARELOC1"; + newProduct.WORKLOC_CODE = "DP_R_PREPARELOC1"; + } + else + { + newProduct.WORKCELL_CODE = "PREPARE1"; + + newProduct.WORKLOC_CODE = "DP_PREPARELOC1"; + } + newProduct.WORKCENTER_CODE = "WORK770B"; diff --git a/APPQ5/QMAPP.WinForm/Properties/AssemblyInfo.cs b/APPQ5/QMAPP.WinForm/Properties/AssemblyInfo.cs index 03e9c92..c2e2bf7 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("2022.06.23.02")] -[assembly: AssemblyFileVersion("2022.06.23.02")] +[assembly: AssemblyVersion("2022.07.15.02")] +[assembly: AssemblyFileVersion("2022.07.15.02")] diff --git a/AppCommon/QMAPP.ServicesAgent/ServiceEnums.cs b/AppCommon/QMAPP.ServicesAgent/ServiceEnums.cs index 4471ed2..62ac63e 100644 --- a/AppCommon/QMAPP.ServicesAgent/ServiceEnums.cs +++ b/AppCommon/QMAPP.ServicesAgent/ServiceEnums.cs @@ -2039,6 +2039,12 @@ namespace QMAPP.ServicesAgent [Description(" 添加贴车单")] TJFrmPlaceBLL_AddPasteCard, + /// + /// 查询物料名称 + /// + [Description(" 查询物料名称")] + TJDoorPlankPlanBLL_GetListMachine, + #endregion ///