From 92a93a399f8c8481a9cc2f2e46b89ee0b45a98ec Mon Sep 17 00:00:00 2001 From: chenhaozhe <cgz@hz-kingdee.com> Date: 星期二, 06 五月 2025 13:14:43 +0800 Subject: [PATCH] 2025/5/6 提交 --- WebAPI/Controllers/BaseSet/Gy_SourceController.cs | 302 ++++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 280 insertions(+), 22 deletions(-) diff --git a/WebAPI/Controllers/BaseSet/Gy_SourceController.cs b/WebAPI/Controllers/BaseSet/Gy_SourceController.cs index e5bed9c..0ba8333 100644 --- a/WebAPI/Controllers/BaseSet/Gy_SourceController.cs +++ b/WebAPI/Controllers/BaseSet/Gy_SourceController.cs @@ -38,14 +38,14 @@ { List<object> columnNameList = new List<object>(); //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄� - //if (!DBUtility.ClsPub.Security_Log("Gy_Source_Query", 1, false, user)) - //{ - // objJsonResult.code = "0"; - // objJsonResult.count = 0; - // objJsonResult.Message = "鏃犳潈闄愭煡璇�!"; - // objJsonResult.data = null; - // return objJsonResult; - //} + if (!DBUtility.ClsPub.Security_Log("Gy_Source_Query", 1, false, user)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犳潈闄愭煡璇�!"; + objJsonResult.data = null; + return objJsonResult; + } if (sWhere == null || sWhere.Equals("")) { @@ -110,15 +110,15 @@ string msg1 = sArray[0].ToString(); string msg2 = sArray[1].ToString(); - ////鏌ョ湅鏉冮檺 - //if (!DBUtility.ClsPub.Security_Log("Gy_Source_Edit", 1, false, msg2)) - //{ - // objJsonResult.code = "0"; - // objJsonResult.count = 0; - // objJsonResult.Message = "鏃犱繚瀛樻潈闄愶紒"; - // objJsonResult.data = null; - // return objJsonResult; - //} + //鏌ョ湅鏉冮檺 + if (!DBUtility.ClsPub.Security_Log("Gy_Source_Edit", 1, false, msg2)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犱繚瀛樻潈闄愶紒"; + objJsonResult.data = null; + return objJsonResult; + } Int64 HItemID = 0; SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); @@ -255,6 +255,7 @@ oItem.HLevel = DBUtility.ClsPub.GetLevel(oItem.HNumber.Trim()); //绛夌骇 oItem.HEquipFileID_K3 = 0;//瀵瑰簲K3璁惧 oItem.HGroupK3ID = 0;//榛樿K3鐢熶骇鐝粍 + oItem.HMakeEmp = msg2;//鍒涘缓浜� oBill.oModel = oItem; } @@ -263,19 +264,17 @@ bool bResult; if (oBill.oModel.HItemID == 0) { - // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); - bResult = oBill.AddNew(); + bResult = oBill.AddNew(ref DBUtility.ClsPub.sExeReturnInfo); } else { - bResult = oBill.ModifyByID(oBill.oModel.HItemID); + bResult = oBill.ModifyByID(oBill.oModel.HItemID, ref DBUtility.ClsPub.sExeReturnInfo); } if (bResult) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "淇濆瓨鎴愬姛锛�"; - //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�"); objJsonResult.data = 1; return objJsonResult; } @@ -676,7 +675,7 @@ { try { - string sql1 = string.Format("select hitemid,hnumber,hname from Gy_Source"+ sWhere + " order by hnumber"); + string sql1 = string.Format("select hitemid,hnumber,hname,HUSEORGID from Gy_Source" + sWhere + " order by hnumber"); ds = oCN.RunProcReturn(sql1, "Gy_Source"); @@ -784,8 +783,67 @@ objJsonResult.data = null; return objJsonResult; ; } + else if (ds.Tables[0].Rows[0]["HCheckEmp"] != null && ds.Tables[0].Rows[0]["HCheckEmp"].ToString() != "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "宸茬粡瀹℃牳涓嶈兘鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; ; + } + + //鍒犻櫎鍓嶆帶鍒�========================================= + string sql1 = "exec h_p_Gy_Source_BeforeDelCtrl " + HItemID + ",'" + user + "'"; + ds = oCN.RunProcReturn(sql1, "h_p_Gy_Source_BeforeDelCtrl"); + if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:鍒犻櫎鍓嶅垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴"; + objJsonResult.data = null; + oCN.RollBack(); + return objJsonResult; + } + + if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; + objJsonResult.data = null; + oCN.RollBack(); + return objJsonResult; + } + //================================================================================== + oCN.RunProc("delete from Gy_Source where HItemID=" + HItemID); + + + //鍒犻櫎鍚庢帶鍒�========================================= + string sql2 = "exec h_p_Gy_Source_AfterDelCtrl " + HItemID + ",'" + user + "'"; + ds = oCN.RunProcReturn(sql2, "h_p_Gy_Source_AfterDelCtrl"); + if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜锛氬垹闄ゅ悗鍒ゆ柇澶辫触锛岃涓庣綉缁滅鐞嗕汉鍛樿仈绯�"; + objJsonResult.data = null; + oCN.RollBack(); + return objJsonResult; + } + + if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; + objJsonResult.data = null; + oCN.RollBack(); + return objJsonResult; + } + //================================================================================== + oCN.Commit();//鎻愪氦浜嬪姟 objJsonResult.code = "0"; @@ -870,8 +928,58 @@ if (IsAudit == 0) //瀹℃牳鍒ゆ柇 { + //瀹℃牳鍓嶆帶鍒�========================================= + string sql1 = "exec h_p_Gy_Source_BeforeCheckCtrl " + HInterID + ",'" + CurUserName + "'"; + ds = oCN.RunProcReturn(sql1, "h_p_Gy_Source_BeforeCheckCtrl"); + if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:瀹℃牳鍓嶅垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴"; + objJsonResult.data = null; + oCN.RollBack(); + return objJsonResult; + } + + if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; + objJsonResult.data = null; + oCN.RollBack(); + return objJsonResult; + } + //================================================================================== + + oCN.RunProc("update Gy_Source set HCheckEmp='" + CurUserName + "',HCheckTime=getdate() where HItemID=" + HInterID); + + //瀹℃牳鍚庢帶鍒�========================================= + string sql2 = "exec h_p_Gy_Source_AfterCheckCtrl " + HInterID + ",'" + CurUserName + "'"; + ds = oCN.RunProcReturn(sql2, "h_p_Gy_Source_AfterCheckCtrl"); + if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:瀹℃牳鍚庡垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴"; + objJsonResult.data = null; + oCN.RollBack(); + return objJsonResult; + } + + if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; + objJsonResult.data = null; + oCN.RollBack(); + return objJsonResult; + } + //================================================================================== + objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "瀹℃牳鎴愬姛"; @@ -879,7 +987,58 @@ } if (IsAudit == 1) //鍙嶅鏍稿垽鏂� { + //鍙嶅鏍稿墠鎺у埗========================================= + string sql1 = "exec h_p_Gy_Source_BeforeUnCheckCtrl " + HInterID + ",'" + CurUserName + "'"; + ds = oCN.RunProcReturn(sql1, "h_p_Gy_Source_BeforeCheckCtrl"); + if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:鍙嶅鏍稿墠鍒ゆ柇澶辫触锛岃涓庣綉缁滅鐞嗕汉鍛樿仈绯�"; + objJsonResult.data = null; + oCN.RollBack(); + return objJsonResult; + } + + if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; + objJsonResult.data = null; + oCN.RollBack(); + return objJsonResult; + } + //================================================================================== + + + oCN.RunProc("update Gy_Source set HCheckEmp='',HCheckTime=null where HItemID=" + HInterID); + + + //鍙嶅鏍稿悗鎺у埗========================================= + string sql2 = "exec h_p_Gy_Source_AfterUnCheckCtrl " + HInterID + ",'" + CurUserName + "'"; + ds = oCN.RunProcReturn(sql2, "h_p_Gy_Source_AfterCheckCtrl"); + if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:鍙嶅鏍稿悗鍒ゆ柇澶辫触锛岃涓庣綉缁滅鐞嗕汉鍛樿仈绯�"; + objJsonResult.data = null; + oCN.RollBack(); + return objJsonResult; + } + + if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; + objJsonResult.data = null; + oCN.RollBack(); + return objJsonResult; + } + //================================================================================== objJsonResult.code = "1"; objJsonResult.count = 1; @@ -965,7 +1124,56 @@ if (IsStop == 0) //绂佺敤鍒ゆ柇 { + + //绂佺敤鍓嶆帶鍒�========================================= + string sql1 = "exec h_p_Gy_Source_BeforeStopCtrl " + HInterID + ",'" + CurUserName + "'"; + ds = oCN.RunProcReturn(sql1, "h_p_Gy_Source_BeforeStopCtrl"); + if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "绂佺敤澶辫触!鍘熷洜:绂佺敤鍓嶅垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴"; + objJsonResult.data = null; + oCN.RollBack(); + return objJsonResult; + } + + if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "绂佺敤澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; + objJsonResult.data = null; + oCN.RollBack(); + return objJsonResult; + } + //================================================================================== + oCN.RunProc("update Gy_Source set HStopEmp='" + CurUserName + "',HStopTime=getdate(),HStopflag=1 where HItemID=" + HInterID); + + //绂佺敤鍚庢帶鍒�========================================= + string sql2 = "exec h_p_Gy_Source_AfterStopCtrl " + HInterID + ",'" + CurUserName + "'"; + ds = oCN.RunProcReturn(sql2, "h_p_Gy_Source_AfterStopCtrl"); + if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "绂佺敤澶辫触!鍘熷洜:绂佺敤鍚庡垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴"; + objJsonResult.data = null; + oCN.RollBack(); + return objJsonResult; + } + + if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "绂佺敤澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; + objJsonResult.data = null; + oCN.RollBack(); + return objJsonResult; + } + //================================================================================== objJsonResult.code = "1"; objJsonResult.count = 1; @@ -974,8 +1182,58 @@ } if (IsStop == 1) //鍙嶇鐢ㄥ垽鏂� { + //鍙嶇鐢ㄥ墠鎺у埗========================================= + string sql1 = "exec h_p_Gy_Source_BeforeUnStopCtrl " + HInterID + ",'" + CurUserName + "'"; + ds = oCN.RunProcReturn(sql1, "h_p_Gy_Source_BeforeUnStopCtrl"); + if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍙嶇鐢ㄥけ璐�!鍘熷洜:鍙嶇鐢ㄥ墠鍒ゆ柇澶辫触锛岃涓庣綉缁滅鐞嗕汉鍛樿仈绯�"; + objJsonResult.data = null; + oCN.RollBack(); + return objJsonResult; + } + + if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍙嶇鐢ㄥけ璐�!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; + objJsonResult.data = null; + oCN.RollBack(); + return objJsonResult; + } + //================================================================================== + + oCN.RunProc("update Gy_Source set HStopEmp='',HStopTime=null,HStopflag=0 where HItemID=" + HInterID); + + //鍙嶇鐢ㄥ悗鎺у埗========================================= + string sql2 = "exec h_p_Gy_Source_AfterUnStopCtrl " + HInterID + ",'" + CurUserName + "'"; + ds = oCN.RunProcReturn(sql2, "h_p_Gy_Source_AfterUnStopCtrl"); + if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍙嶇鐢ㄥけ璐�!鍘熷洜:鍙嶇鐢ㄥ悗鍒ゆ柇澶辫触锛岃涓庣綉缁滅鐞嗕汉鍛樿仈绯�"; + objJsonResult.data = null; + oCN.RollBack(); + return objJsonResult; + } + + if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍙嶇鐢ㄥけ璐�!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; + objJsonResult.data = null; + oCN.RollBack(); + return objJsonResult; + } + //================================================================================== + objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "鍙嶇鐢ㄦ垚鍔�"; -- Gitblit v1.9.1