From e3f218a023f0625f415a1526b278636c3e39aa4f Mon Sep 17 00:00:00 2001
From: llj <132905093+newwwwwwtree@users.noreply.github.com>
Date: 星期一, 18 八月 2025 12:59:32 +0800
Subject: [PATCH] 1

---
 WebAPI/Controllers/BLL/Xt_UserGroupController.cs |   35 ++++++++++++++++++++++++++++++-----
 1 files changed, 30 insertions(+), 5 deletions(-)

diff --git a/WebAPI/Controllers/BLL/Xt_UserGroupController.cs b/WebAPI/Controllers/BLL/Xt_UserGroupController.cs
index 2a9191c..2a90a28 100644
--- a/WebAPI/Controllers/BLL/Xt_UserGroupController.cs
+++ b/WebAPI/Controllers/BLL/Xt_UserGroupController.cs
@@ -82,6 +82,8 @@
             public string GroupName { get; set; }
             public string HLev { get; set; }
             public string Explain { get; set; }
+            public int HUSEORGID { get; set; }
+            public int HCREATEORGID { get; set; }
         }
         [Route("Xt_UserGroup/UserGroupInfoEdit")]
         [HttpPost]
@@ -124,9 +126,20 @@
 
                 if (OperationType == 1)//鏂板
                 {
+                    //鏂板鍓嶆煡璇�  纭繚瑙掕壊鍚嶆湭閲嶅鏂板
+                    ds = oCN.RunProcReturn("Select * from  System_UserGroup where GroupName='" + omdelMian.GroupName + "'", "System_UserGroup");
+                    if (ds.Tables[0].Rows.Count > 0)
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "瑙掕壊鏂板澶辫触锛佸綋鍓嶈鑹插悕宸茬粡瀛樺湪锛屼笉鍙噸澶�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+
                     //涓昏〃
-                    oCN.RunProc("insert into  System_UserGroup (GroupName,HLev,Explain)values" +
-                        $"('{omdelMian.GroupName}','{omdelMian.HLev}','{omdelMian.Explain}')");
+                    oCN.RunProc("insert into  System_UserGroup (GroupName,HLev,Explain,HUSEORGID,HCREATEORGID)values" +
+                        $"('{omdelMian.GroupName}','{omdelMian.HLev}','{omdelMian.Explain}','{omdelMian.HUSEORGID}','{omdelMian.HCREATEORGID}')");
 
                     //鏂板鍚庢煡璇�  纭繚鏁版嵁娣诲姞鎴愬姛
                     ds = oCN.RunProcReturn("Select * from  System_UserGroup where GroupName='" + omdelMian.GroupName + "'", "System_UserGroup");
@@ -153,13 +166,25 @@
                 }
                 else if (OperationType == 2)//澶嶅埗
                 {
+                    //鏂板鍓嶆煡璇�  纭繚瑙掕壊鍚嶆湭閲嶅鏂板
+                    ds = oCN.RunProcReturn("Select * from  System_UserGroup where GroupName='" + omdelMian.GroupName + "'", "System_UserGroup");
+                    if (ds.Tables[0].Rows.Count > 0)
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "瑙掕壊鏂板澶辫触锛佸綋鍓嶈鑹插悕宸茬粡瀛樺湪锛屼笉鍙噸澶�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+
                     string realExplain = omdelMian.Explain.Substring(0, omdelMian.Explain.IndexOf("#澶嶅埗鍘熻鑹睮D锛�"));        //鑾峰彇鐣岄潰璁剧疆鐨凟xplain鍊�
                     string sourceBill_GroupID = omdelMian.Explain.Replace(realExplain + "#澶嶅埗鍘熻鑹睮D锛�", "");                     //鑾峰彇澶嶅埗鐨勬簮鍗曟嵁鐨処D
                     omdelMian.Explain = realExplain;
 
                     //涓昏〃
-                    oCN.RunProc("insert into  System_UserGroup (GroupName,HLev,Explain)values" +
-                        $"('{omdelMian.GroupName}','{omdelMian.HLev}','{omdelMian.Explain}')");
+                    oCN.RunProc("insert into  System_UserGroup (GroupName,HLev,Explain,HUSEORGID,HCREATEORGID)values" +
+                        $"('{omdelMian.GroupName}','{omdelMian.HLev}','{omdelMian.Explain}','{omdelMian.HUSEORGID}','{omdelMian.HCREATEORGID}')");
+
 
                     //鏂板鍚庢煡璇�  纭繚鏁版嵁娣诲姞鎴愬姛
                     ds = oCN.RunProcReturn("Select * from  System_UserGroup where GroupName='" + omdelMian.GroupName + "'", "System_UserGroup");
@@ -202,7 +227,7 @@
                 }
                 else if (OperationType == 3)
                 {
-                    oCN.RunProc("update  System_UserGroup set GroupName='" + omdelMian.GroupName + "',HLev='" + omdelMian.HLev + "',Explain='" + omdelMian.Explain + "'"
+                    oCN.RunProc("update  System_UserGroup set GroupName='" + omdelMian.GroupName + "',HLev='" + omdelMian.HLev + "',Explain='" + omdelMian.Explain + "',HUSEORGID='" + omdelMian.HUSEORGID + "',HCREATEORGID='" + omdelMian.HCREATEORGID + "'"
                     + " where GroupId=" + omdelMian.HGroupID);
 
                     oCN.RunProc("delete from  System_UserGroupInfo where GroupId=" + omdelMian.HGroupID);

--
Gitblit v1.9.1