From 97c43d459cb96e768948a44d9845a0b439bc2adc Mon Sep 17 00:00:00 2001 From: yangle <admin@YINMOU> Date: 星期四, 29 十二月 2022 10:07:10 +0800 Subject: [PATCH] 设备点检计划 记录 设备保养记录单 --- WebAPI/Controllers/SBGL/Gy_EquipTypeController.cs | 74 +++++++++++++++++++++++++++--------- 1 files changed, 55 insertions(+), 19 deletions(-) diff --git a/WebAPI/Controllers/SBGL/Gy_EquipTypeController.cs b/WebAPI/Controllers/SBGL/Gy_EquipTypeController.cs index b468dfd..dab55bc 100644 --- a/WebAPI/Controllers/SBGL/Gy_EquipTypeController.cs +++ b/WebAPI/Controllers/SBGL/Gy_EquipTypeController.cs @@ -24,27 +24,36 @@ [Route("Gy_EquipType/GetList")] [HttpGet] - public object GetList(string sWhere) + public object GetList(string sWhere,string user) { try { - ds = oCN.RunProcReturn("select HItemID,HParentID,HNumber,HName,HLevel, case when HEndFlag<>0 then 'Y'else ' 'end HEndFlag,case when HStopFlag <> 0 then 'Y'else ' 'end HStopFlag, HRemark, HUseFlag from Gy_EquipFileType where 1=1 " + sWhere, "Gy_EquipFileType"); - if (ds == null) - { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "鏌ヨ鏁版嵁寮傚父锛岃涓庣鐞嗗憳鑱旂郴锛�"; - objJsonResult.data = null; - return objJsonResult; - } - else - { - objJsonResult.code = "1"; - objJsonResult.count = 1; - objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�"; - objJsonResult.data = ds.Tables[0]; - return objJsonResult; - } + //if (!DBUtility.ClsPub.Security_Log("Gy_EquipTypeList", 1, false, user)) + //{ + // objJsonResult.code = "0"; + // objJsonResult.count = 0; + // objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒"; + // objJsonResult.data = null; + // return objJsonResult; + //} + ds = oCN.RunProcReturn("select HItemID,HParentID,HNumber,HName,HLevel, case when HEndFlag<>0 then 'Y'else ' 'end HEndFlag,case when HStopFlag <> 0 then 'Y'else ' 'end HStopFlag, HRemark, HUseFlag from Gy_EquipFileType where 1=1 " + sWhere+ " order by HItemID ", "Gy_EquipFileType"); + + //if (ds.Tables[0].Rows.Count != 0 || ds != null) + //{ + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + //} + //else + //{ + //objJsonResult.code = "0"; + //objJsonResult.count = 0; + //objJsonResult.Message = "鏃犳暟鎹�"; + //objJsonResult.data = null; + //return objJsonResult; + //} } catch (Exception ex) { @@ -61,8 +70,17 @@ #region [璁惧鍒嗙被鍒犻櫎鍔熻兘] [Route("Gy_EquipType/Delete_EquipType")] [HttpGet] - public object Delete_EquipType(string HItemID) + public object Delete_EquipType(string HItemID,string user) { + if (!DBUtility.ClsPub.Security_Log("Gy_EquipType_Delete", 1, false, user)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犱繚瀛樻潈闄愶紒"; + objJsonResult.data = null; + return objJsonResult; + } + string s = ""; Int64 lngBillKey = 0; lngBillKey = DBUtility.ClsPub.isLong(HItemID); @@ -112,7 +130,16 @@ string msg1 = _value.ToString(); string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); string msg2 = sArray[0].ToString(); + string msg4 = sArray[1].ToString(); + if (!DBUtility.ClsPub.Security_Log("Gy_EquipType_Edit", 1, false, msg4)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犱繚瀛樻潈闄愶紒"; + objJsonResult.data = null; + return objJsonResult; + } //鍙嶅簭鍒楀寲 msg2 = "[" + msg2.ToString() + "]"; @@ -188,7 +215,16 @@ string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); string msg2 = sArray[0].ToString(); string msg3 = sArray[1].ToString(); + string msg4 = sArray[2].ToString(); + if (!DBUtility.ClsPub.Security_Log("Gy_EquipType_Edit", 1, false, msg4)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犱繚瀛樻潈闄愶紒"; + objJsonResult.data = null; + return objJsonResult; + } //鍙嶅簭鍒楀寲 msg2 = "[" + msg2.ToString() + "]"; List<Models.ClsGy_EquipFileType> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Models.ClsGy_EquipFileType>>(msg2); -- Gitblit v1.9.1