From 7632bb98d88c05da859ba0a6030fe0a9d3940b3d Mon Sep 17 00:00:00 2001 From: duhe <226547893@qq.com> Date: 星期二, 27 五月 2025 13:01:21 +0800 Subject: [PATCH] 器具维护:修改和删除是判断是否已经审核,若已审核则操作失败 --- WebAPI/Controllers/BaseSet/Gy_ModelTypeController.cs | 69 ++++++++++++++++++++++++++++++++-- 1 files changed, 65 insertions(+), 4 deletions(-) diff --git a/WebAPI/Controllers/BaseSet/Gy_ModelTypeController.cs b/WebAPI/Controllers/BaseSet/Gy_ModelTypeController.cs index 03c8a4a..60b8326 100644 --- a/WebAPI/Controllers/BaseSet/Gy_ModelTypeController.cs +++ b/WebAPI/Controllers/BaseSet/Gy_ModelTypeController.cs @@ -150,6 +150,25 @@ objJsonResult.data = null; return objJsonResult; } + + DataSet ds_check_1 = oCN.RunProcReturn("select * from Gy_MouldType where HItemID =" + HItemID, "Gy_MouldType"); + if (ds_check_1.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍒犻櫎澶辫触锛氭暟鎹笉瀛樺湪"; + objJsonResult.data = null; + return objJsonResult; + } + else if (ds_check_1.Tables[0].Rows[0]["HCheckEmp"].ToString() != "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍒犻櫎澶辫触锛氬綋鍓嶆暟鎹凡瀹℃牳锛屼笉鍙垹闄�"; + objJsonResult.data = null; + return objJsonResult; + } + if (oDeptHlp.GetInfoByID(HItemID)) { if (oDept.HavChildCodes(HItemID)) @@ -243,6 +262,17 @@ bool HStopflag = list[0].HStopflag; string HUseFlag = list[0].HUseFlag; bool HEndFlag = list[0].HEndFlag; + long HUSEORGID = list[0].HUSEORGID; + + DataSet ds_check = oCN.RunProcReturn("select * from Gy_MouldType where HNumber = '" + HNumber + "' and HUSEORGID = " + HUSEORGID, "Gy_MouldType"); + if (ds_check.Tables[0].Rows.Count > 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏂板澶辫触锛氬綋鍓嶇粍缁囦笅浠g爜銆�" + HNumber + "銆戝凡瀛樺湪锛岃淇敼浠g爜鍚庨噸鏂颁繚瀛�"; + objJsonResult.data = null; + return objJsonResult; + } //鍒ゆ柇鏉冮檺 if (!DBUtility.ClsPub.Security_Log(msg4, 1, false, msg3)) @@ -270,9 +300,9 @@ //涓昏〃 oCN.RunProc("Insert into Gy_MouldType " + " (HNumber,HName,HHelpCode,HShortNumber,HParentID" + - ",HLevel,HEndFlag,HStopflag,HRemark,HMakeEmp,HMakeTime) " + + ",HLevel,HEndFlag,HStopflag,HRemark,HMakeEmp,HMakeTime,HUSEORGID) " + " Values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "'," + HParentID + - "," + HLevel+ "," + Convert.ToString(HEndFlag ? 1 : 0) + "," + Convert.ToString(HStopflag ? 1 : 0) + ",'" + HRemark + "','" + msg3 + "',getdate())", ref DBUtility.ClsPub.sExeReturnInfo); + "," + HLevel+ "," + Convert.ToString(HEndFlag ? 1 : 0) + "," + Convert.ToString(HStopflag ? 1 : 0) + ",'" + HRemark + "','" + msg3 + "',getdate()," + HUSEORGID + ")", ref DBUtility.ClsPub.sExeReturnInfo); //淇敼涓婄骇涓洪潪鏈骇浠g爜 oCN.RunProc("Update Gy_MouldType set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo); oCN.Commit(); @@ -328,6 +358,35 @@ string HRemark = list[0].HRemark; bool HStopflag = list[0].HStopflag; string HUseFlag = list[0].HUseFlag; + long HUSEORGID = list[0].HUSEORGID; + + DataSet ds_check = oCN.RunProcReturn("select * from Gy_MouldType where HNumber = '" + HNumber + "' and HUSEORGID = " + HUSEORGID + " and HItemID <>" + HItemID,"Gy_MouldType"); + if (ds_check.Tables[0].Rows.Count > 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇敼澶辫触锛氬綋鍓嶇粍缁囦笅浠g爜銆�" + HNumber + "銆戝凡瀛樺湪锛岃淇敼浠g爜鍚庨噸鏂颁繚瀛�"; + objJsonResult.data = null; + return objJsonResult; + } + + DataSet ds_check_1 = oCN.RunProcReturn("select * from Gy_MouldType where HItemID =" + HItemID, "Gy_MouldType"); + if (ds_check_1.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇敼澶辫触锛氭暟鎹笉瀛樺湪"; + objJsonResult.data = null; + return objJsonResult; + } + else if(ds_check_1.Tables[0].Rows[0]["HCheckEmp"].ToString() != "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇敼澶辫触锛氬綋鍓嶆暟鎹凡瀹℃牳锛屼笉鍙慨鏀�"; + objJsonResult.data = null; + return objJsonResult; + } //鍒ゆ柇鏉冮檺 if (!DBUtility.ClsPub.Security_Log(msg5, 1, false, msg4)) @@ -372,7 +431,8 @@ ",HRemark= '" + HRemark + "' " + ",HModifyEmp='" + msg4 + "' " + ",HModifyTime=getdate() " + - "Where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo); + ",HUSEORGID=" + HUSEORGID + " " + + " Where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo); //淇敼瀛愰」鐩唬鐮� //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_RepairCheck,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo); //灏嗕笂绾� 涓洪潪鏈骇 @@ -409,7 +469,8 @@ { try { - ds = oCN.RunProcReturn("select * from Gy_MouldType where HItemID=" + HInterID, "Gy_MouldType"); + string sql = "select a.*,b.HName HParentName from Gy_MouldType as a left join Gy_MouldType as b on a.HParentID = b.HItemID where a.HItemID=" + HInterID; + ds = oCN.RunProcReturn(sql, "Gy_MouldType"); objJsonResult.code = "1"; objJsonResult.count = 1; -- Gitblit v1.9.1