diff --git a/APP/QMAPP.Web/App_Data/MainPower.xml b/APP/QMAPP.Web/App_Data/MainPower.xml index 67aef77..5a6f189 100644 --- a/APP/QMAPP.Web/App_Data/MainPower.xml +++ b/APP/QMAPP.Web/App_Data/MainPower.xml @@ -292,27 +292,24 @@ - - - + + + - - - + + + - - - + + + - - - diff --git a/APP/QMAPP.Web/App_Data/Menu.xml b/APP/QMAPP.Web/App_Data/Menu.xml index b16209f..d58fbb7 100644 --- a/APP/QMAPP.Web/App_Data/Menu.xml +++ b/APP/QMAPP.Web/App_Data/Menu.xml @@ -489,34 +489,31 @@ 查询 - 添加 - 修改 - 删除 + 添加 + 修改 + 删除 查询 - 添加 - 修改 - 删除 + 添加 + 修改 + 删除 查询 - 添加 - 修改 - 删除 + 添加 + 修改 + 删除 查询 - 添加 - 修改批次号 - 删除 diff --git a/APPQ5/QMAPP.FJC.BLL/Operation/ProductBLL.cs b/APPQ5/QMAPP.FJC.BLL/Operation/ProductBLL.cs index f6ff4f5..07f5a77 100644 --- a/APPQ5/QMAPP.FJC.BLL/Operation/ProductBLL.cs +++ b/APPQ5/QMAPP.FJC.BLL/Operation/ProductBLL.cs @@ -1758,6 +1758,24 @@ namespace QMAPP.FJC.BLL.Operation throw ex; } } + + public int DeleteProduct(string ProductCode, string machineCode) + { + try + { + return new ProductDAL().DeleteProduct(ProductCode, machineCode); + } + catch (Exception ex) + { + LogManager.LogHelper.Error(new LogInfo() + { + ErrorInfo = ex, + Tag = ex.StackTrace, + Info = "零件条码--获取零件信息" + }); + throw ex; + } + } #endregion #region 导出数据 diff --git a/APPQ5/QMAPP.FJC.DAL/Operation/ProductDAL.cs b/APPQ5/QMAPP.FJC.DAL/Operation/ProductDAL.cs index 04123d8..a7cc2e0 100644 --- a/APPQ5/QMAPP.FJC.DAL/Operation/ProductDAL.cs +++ b/APPQ5/QMAPP.FJC.DAL/Operation/ProductDAL.cs @@ -1318,6 +1318,17 @@ namespace QMAPP.FJC.DAL.Operation } } + public int DeleteProduct(string ProductCode, string machineCode) + { + var count = 0; + var sqlBuilder = $"delete T_AW_Product Where PRODUCTCODE = '{ProductCode}' and MACHINECODDE = '{machineCode}'"; + List parameters = new List(); + using (IDataSession session = AppDataFactory.CreateMainSession()) + { + count = Convert.ToInt32(session.ExecuteSqlScalar(sqlBuilder.ToString(), parameters.ToArray())); + } + return count; + } #endregion #region 导入 diff --git a/APPQ5/QMAPP.FJC.Web/App_Data/Menu.xml b/APPQ5/QMAPP.FJC.Web/App_Data/Menu.xml index 99e89d6..059ccaa 100644 --- a/APPQ5/QMAPP.FJC.Web/App_Data/Menu.xml +++ b/APPQ5/QMAPP.FJC.Web/App_Data/Menu.xml @@ -489,34 +489,31 @@ 查询 - 添加 - 修改 - 删除 + 添加 + 修改 + 删除 查询 - 添加 - 修改 - 删除 + 添加 + 修改 + 删除 查询 - 添加 - 修改 - 删除 + 添加 + 修改 + 删除 查询 - 添加 - 修改批次号 - 删除 diff --git a/APPQ5/QMAPP.WinForm/Forms/Operation/OperationForm.cs b/APPQ5/QMAPP.WinForm/Forms/Operation/OperationForm.cs index 28bb27b..0b88ed9 100644 --- a/APPQ5/QMAPP.WinForm/Forms/Operation/OperationForm.cs +++ b/APPQ5/QMAPP.WinForm/Forms/Operation/OperationForm.cs @@ -106,6 +106,9 @@ namespace QMAPP.WinForm.Forms.Operation private string _AutoMachineCode = string.Empty; //自动扫码的配置设备编号 + private string _DeleteProductLoc = string.Empty; //撤销按钮删除产品信息触发工位 + private string _DeleteProductDaiCode = string.Empty; //撤销按钮删除产品信息触发采集点 + #endregion #region 窗体构造函数 @@ -131,6 +134,9 @@ namespace QMAPP.WinForm.Forms.Operation _371BiaoPiBarCodeRegex = System.Configuration.ConfigurationManager.AppSettings["052打印条码规则371"]; _316BiaoPiBarCodeRegex = System.Configuration.ConfigurationManager.AppSettings["052打印条码规则316"]; + _DeleteProductLoc = GetAppConfigValue("DeleteProductLoc"); + _DeleteProductDaiCode = GetAppConfigValue("DeleteProductDaiCode"); + this.WindowState = FormWindowState.Maximized; //this.CheckFile(); okSoundPath = System.Configuration.ConfigurationManager.AppSettings["SaveFilePath"] + "Sound\\" + PlaySoundConst.strSoundOk; @@ -2413,6 +2419,18 @@ namespace QMAPP.WinForm.Forms.Operation return; } + var product_dai = ""; + if (!string.IsNullOrEmpty(_DeleteProductDaiCode)) + { + foreach (var d in daicache) + { + if (_DeleteProductDaiCode.Contains(d.DACode)) + { + product_dai = d.DAValue; + } + } + } + var result = _agent.InvokeServiceFunction(B9IPCService.DAI_Rollback.ToString() , new DAArgs { @@ -2437,6 +2455,16 @@ namespace QMAPP.WinForm.Forms.Operation } SendRecoveryOrder(result.MouldCode); DoResultActions(result); + + //zhangsn 20220519 撤销删除产品信息 + if (!string.IsNullOrEmpty(_DeleteProductLoc) && _DeleteProductLoc.Contains(_operationServiceParam.machineInfo.WORKLOC_CODE)) + { + //删除产品信息 + //ProductHelper.DeleteProduct(product_dai, _operationServiceParam.machineInfo.MACHINECODDE); + _agent.InvokeServiceFunction>(B9IPCService.ProductBLL_DeleteProduct.ToString(), product_dai, _operationServiceParam.machineInfo.MACHINECODDE); + + } + DGView.Refresh(); DGViewColorBind(); diff --git a/AppCommon/QMAPP.ServicesAgent/ServiceEnums.cs b/AppCommon/QMAPP.ServicesAgent/ServiceEnums.cs index a92b3e0..3cae307 100644 --- a/AppCommon/QMAPP.ServicesAgent/ServiceEnums.cs +++ b/AppCommon/QMAPP.ServicesAgent/ServiceEnums.cs @@ -4708,7 +4708,12 @@ namespace QMAPP.ServicesAgent /// 插入产品信息 /// ProductBLL_Insert, - + + /// + /// 删除产品信息 + /// + ProductBLL_DeleteProduct, + #endregion #region 查验