From ffbcbb6ac13d3e700e51ea37063c9a5f4a8a3455 Mon Sep 17 00:00:00 2001 From: zrg <z18737863051@163.com> Date: 星期二, 16 一月 2024 16:15:17 +0800 Subject: [PATCH] 1.收料通知单编辑功能完善, 保存方法中,增加 反写关联数量至 采购订单的 存储过程增加超过关闭,反关闭 2.首件检验单保存方法,增加 调用 保存前控制 h_p_QC_FirstPieceCheckBill_BeforeSaveCtrl 和保存后控制 h_p_QC_FirstPieceCheckBill_AfterSaveCtrl的 存储过程。 巡检单保存方法,增加 调用 保存前控制 h_p_QC_PatrolProcCheckBill_BeforeSaveCtrl 和保存后控制 h_p_QC_PatrolProcCheckBill_AfterSaveCtrl的 存储过程。 工序检验单保存方法,增加 调用 保存前控制 h_p_QC_ProcessCheckBill_BeforeSaveCtrl 和保存后控制 h_p_QC_ProcessCheckBill_AfterSaveCtrl的 存储过程。设备保养记录单保存方法,增加 调用 保存前控制 h_p_Sb_EquipMaintainBill_BeforeSaveCtrl 和保存后控制 h_p_Sb_EquipMaintainBill_AfterSaveCtrl的 存储过程。 设备点检记录单保存方法,增加 调用 保存前控制 h_p_Sb_EquipDotCheckBill_BeforeSaveCtrl 和保存后控制 h_p_Sb_EquipDotCheckBill_AfterSaveCtrl的 存储过程。 设备故障登记单保存方法,增加 调用 保存前控制 h_p_Sb_EquipConkBookBill_BeforeSaveCtrl 和保存后控制 h_p_Sb_EquipConkBookBill_AfterSaveCtrl的 存储过程。 设备维修记录单保存方法,增加 调用 保存前控制 h_p_Sb_EquipRepairWorkBill_BeforeSaveCtrl 和保存后控制 h_p_Sb_EquipRepairWorkBill_AfterSaveCtrl的 存储过程。 --- WebAPI/Controllers/BaseSet/Xt_grdAlignment_WMESController.cs | 72 +++++++++++++++++++++++++++++++++-- 1 files changed, 67 insertions(+), 5 deletions(-) diff --git a/WebAPI/Controllers/BaseSet/Xt_grdAlignment_WMESController.cs b/WebAPI/Controllers/BaseSet/Xt_grdAlignment_WMESController.cs index 9d779c3..8f4ae94 100644 --- a/WebAPI/Controllers/BaseSet/Xt_grdAlignment_WMESController.cs +++ b/WebAPI/Controllers/BaseSet/Xt_grdAlignment_WMESController.cs @@ -27,7 +27,21 @@ { try { + ds = oCN.RunProcReturn("select * from Xt_grdAlignment_WMES where HModName='" + HModName + "' and HUserName='" + user + "'", "Xt_grdAlignment_WMES"); + + if (ds.Tables[0].Rows.Count == 0) + { + ds = oCN.RunProcReturn("select * from Xt_grdAlignment_WMES where HModName='" + HModName + "' and (HUserName='admin' or HUserName='Admin')", "Xt_grdAlignment_WMES"); + + if (ds.Tables[0].Rows.Count == 0) { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } objJsonResult.code = "1"; objJsonResult.count = 1; @@ -144,15 +158,57 @@ #endregion + #region 闅愯棌鍒楄缃� 鍒犻櫎 + [Route("Xt_grdAlignment_WMES/DelgrdAlignmentWMES")] + [HttpGet] + public object DelgrdAlignmentWMES(string HModName, string user) + { + try + { + ds = oCN.RunProcReturn("select * from Xt_grdAlignment_WMES where HModName='" + HModName + "' and HUserName='" + user + "'", "Xt_grdAlignment_WMES"); + + if (ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "姝や汉鏃犳ā鍧楁暟鎹�!"; + objJsonResult.data = null; + return objJsonResult; + } + + + oCN.BeginTran(); + + oCN.RunProc("delete from Xt_grdAlignment_WMES where HModName='" + HModName + "' and HUserName='" + user + "'"); + + oCN.Commit(); + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鍒犻櫎鎴愬姛锛�"; + objJsonResult.data = null; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + #region 鎸夐挳璁剧疆 鍒楄〃 [Route("Xt_ModuleButtonSet_WMES/moduleButtonSetWMESList")] [HttpGet] - public object moduleButtonSetWMESList(string HModName, string HBillType) + public object moduleButtonSetWMESList(string HModName, string HBillType, string HUserName) { try { - ds = oCN.RunProcReturn("select * from Xt_ModuleButtonSet where HModuleName='" + HModName + "' and HBillType='" + HBillType + "'", "Xt_ModuleButtonSet"); + ds = oCN.RunProcReturn("select * from Xt_ModuleButtonSet where HModuleName='" + HModName + "' and HBillType='" + HBillType + "' and HUserName='" + HUserName + "'", "Xt_ModuleButtonSet"); objJsonResult.code = "1"; objJsonResult.count = ds.Tables[0].Rows.Count; @@ -225,6 +281,7 @@ string HModuleName = sArray[4].ToString(); string HBillType = sArray[5].ToString(); string NoEditList = sArray[6].ToString(); + string HUserName = sArray[7].ToString(); try { @@ -235,7 +292,7 @@ List<noEditList> noEditLists= Newtonsoft.Json.JsonConvert.DeserializeObject<List<noEditList>>(NoEditList); //鎻掑叆鍙紪杈戞寜閽殑淇℃伅璁板綍 - oCN.RunProc("delete from Xt_ModuleButtonSet where HModuleName= '" + HModuleName + "' and HBillType='" + HBillType + "'"); + oCN.RunProc("delete from Xt_ModuleButtonSet where HModuleName= '" + HModuleName + "' and HBillType='" + HBillType + "' and HUserName= '" + HUserName + "'"); for (int i = 0; i < button.Count; i++) { for(int j = 0; j < HButtonIDLists.Count; j++) @@ -251,7 +308,12 @@ { HHideFlag = 1; } - string sql = "exec h_p_Xt_ModuleButtonSet '" + HBillType + "','" + HModuleName + "','" + HButtonID + "','" + HButtonName + "'," + HOrder + "," + HHideFlag + "," + HEditFlag; + if(button[i].BtnID== "HideButton") //鐢ㄦ埛杩涜绗竴娆¤缃椂锛岃缃� 鎸夐挳璁剧疆 鎸夐挳涓轰笉鍙紪杈戜笖涓嶉殣钘� + { + HEditFlag = 0; + HHideFlag = 0; + } + string sql = "exec h_p_Xt_ModuleButtonSet '" + HBillType + "','" + HModuleName + "','" + HButtonID + "','" + HButtonName + "'," + HOrder + "," + HHideFlag + "," + HEditFlag + ",'" + HUserName + "'"; oCN.RunProc(sql); } } @@ -269,7 +331,7 @@ string HButtonID = noEditLists[i].HButtonID; string HButtonName = noEditLists[i].HButtonName; int HOrder = HOrderLists[j]; - string sql = "exec h_p_Xt_ModuleButtonSet '" + HBillType + "','" + HModuleName + "','" + HButtonID + "','" + HButtonName + "'," + HOrder + "," + HHideFlag + "," + HEditFlag; + string sql = "exec h_p_Xt_ModuleButtonSet '" + HBillType + "','" + HModuleName + "','" + HButtonID + "','" + HButtonName + "'," + HOrder + "," + HHideFlag + "," + HEditFlag + ",'" + HUserName + "'"; oCN.RunProc(sql); } } -- Gitblit v1.9.1