From 6ca4391a35cb940a5a27fd45811cce2d07f04b78 Mon Sep 17 00:00:00 2001
From: zrg <z18737863051@163.com>
Date: 星期一, 17 三月 2025 16:58:31 +0800
Subject: [PATCH]  销售报价单 列表 和 编辑 页面; (见原型设计) 增加 客户拜访记录单 列表 和 编辑 页面; 工艺路线,产品工艺参数 车间管理:岗位技能清单,员工技能清单,设备启动点检清单列表,产品防错验证清单列表 质量管理:检验方案,安灯逐级呼叫规则,环境检测方案 增加; 保存前控制存储过程,保存后控制存储过程,审核前控制,审核后控制,删除前控制,删除后控制;作废前控制 作废后控制

---
 WebAPI/Controllers/BaseSet/Gy_ConkTypeController.cs |  589 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 564 insertions(+), 25 deletions(-)

diff --git a/WebAPI/Controllers/BaseSet/Gy_ConkTypeController.cs b/WebAPI/Controllers/BaseSet/Gy_ConkTypeController.cs
index aad3df7..4b70e17 100644
--- a/WebAPI/Controllers/BaseSet/Gy_ConkTypeController.cs
+++ b/WebAPI/Controllers/BaseSet/Gy_ConkTypeController.cs
@@ -32,7 +32,7 @@
             {
                 List<object> columnNameList = new List<object>();
                 //缂栬緫鏉冮檺
-                //if (!DBUtility.ClsPub.Security_Log_second("Gy_ConkType", 1, false, user))
+                //if (!DBUtility.ClsPub.Security_Log_second("Gy_ConkType_Query", 1, false, user))
                 //{
                 //    objJsonResult.code = "0";
                 //    objJsonResult.count = 0;
@@ -87,8 +87,7 @@
         {
             try
             {
-                //DAL.ClsGy_Warehouse_Ctl oDept = new DAL.ClsGy_Warehouse_Ctl();
-                //DAL.ClsGy_Warehouse_View oDeptHlp = new DAL.ClsGy_Warehouse_View();
+              
 
                 var _value = oMain["oMain"].ToString();
                 string msg1 = _value.ToString();
@@ -114,14 +113,23 @@
                 DateTime HMakeTime = list[0].HMakeTime;
                 string HMakeEmp = list[0].HMakeEmp;
                 string HCheckEmp = list[0].HCheckEmp;
-                DateTime HCheckTime = list[0].HCheckTime;
+                string HCheckTime = list[0].HCheckTime;
                 string HModifyEmp = list[0].HModifyEmp;
-                DateTime HModifyTime = list[0].HModifyTime;
+                string HModifyTime = list[0].HModifyTime;
                 string HStopEmp = list[0].HStopEmp;
-                DateTime HStopTime = list[0].HStopTime;
+                string HStopTime = list[0].HStopTime;
                 long HUSEORGID = list[0].HUSEORGID;
                 long HCREATEORGID = list[0].HCREATEORGID;
 
+                //鍒ゆ柇鏉冮檺
+                if (!ClsPub.Security_Log("Gy_ConkType_Edit", 1, false, msg3))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犱繚瀛樻潈闄愶紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
 
                 #region [娉ㄩ噴浠g爜]
                 ////鍒ゆ柇鏉冮檺
@@ -158,20 +166,98 @@
                 if (HItemID == 0)
                 {
                     oCN.BeginTran();
+
+
+                    //淇濆瓨鍓嶆帶鍒�=========================================      
+                    string sql1 = "exec h_p_Gy_ConkType_BeforeSaveCtrl " + HMakeEmp + ",'" + 1 + "'";
+                    ds = oCN.RunProcReturn(sql1, "h_p_Gy_ConkType_BeforeSaveCtrl");
+                    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("Insert into Gy_ConkType  " +
-                        " (HNumber,HName,HHelpCode,HShortNumber,HParentID" +
-                        ",HLevel,HEndFlag,HStopflag,HRemark,HUseFlag,HMakeTime,HMakeEmp," +
-                        "HUSEORGID,HCREATEORGID) " +
-                        " Values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "'," + HParentID.ToString() +
-                        "," + HLevel.ToString() + "," + Convert.ToString(HEndFlag ? 1 : 0) + "," + Convert.ToString(HStopflag ? 1 : 0) + ",'" + HRemark + "'," + HUseFlag + ",'" + HMakeTime + "','" + HMakeEmp + "','" + HUSEORGID + "','" + HCREATEORGID + "')", ref DBUtility.ClsPub.sExeReturnInfo);
+                      " (HNumber,HName,HHelpCode,HShortNumber,HParentID" +
+                      ",HLevel,HEndFlag,HStopflag,HRemark,HUseFlag,HMakeTime,HMakeEmp," +
+                      "HUSEORGID,HCREATEORGID) " +
+                      " Values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "'," + HParentID.ToString() +
+                      "," + HLevel.ToString() + "," + Convert.ToString(HEndFlag ? 1 : 0) + "," + Convert.ToString(HStopflag ? 1 : 0) + ",'" + HRemark + "'," + HUseFlag + ",getdate(),'" + HMakeEmp + "','" + HUSEORGID + "','" + HCREATEORGID + "')", ref DBUtility.ClsPub.sExeReturnInfo);
                     //淇敼涓婄骇涓洪潪鏈骇浠g爜
                     oCN.RunProc("Update Gy_ConkType set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
+
+
+                    //淇濆瓨鍚庢帶鍒�=========================================      
+                    string sql2 = "exec h_p_Gy_ConkType_AfterSaveCtrl " + HMakeEmp + ",'" + 1 + "'";
+                    ds = oCN.RunProcReturn(sql2, "h_p_Gy_ConkType_AfterSaveCtrl");
+                    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();
                 }
                 else
                 {
                     //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
                     oCN.BeginTran();
+
+                    //淇濆瓨鍓嶆帶鍒�=========================================      
+                    string sql1 = "exec h_p_Gy_ConkType_BeforeSaveCtrl " + HMakeEmp + ",'" + 2 + "'";
+                    ds = oCN.RunProcReturn(sql1, "h_p_Gy_ConkType_BeforeSaveCtrl");
+                    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_ConkType set " +
                         " HNumber='" + HNumber + "'" +
@@ -182,14 +268,42 @@
                         ",HParentID=" + HParentID.ToString() +
                         ",HEndflag=" + Convert.ToString(HEndFlag ? 1 : 0) +
                         ",HStopflag=" + Convert.ToString(HStopflag ? 1 : 0) +
-                        ",HMakeEmp='" + HMakeEmp + "'" +
+                         ",HModifyTime= getdate()" +
+                        ",HModifyEmp='" + HMakeEmp + "'" +
+                        ",HUSEORGID='" + HUSEORGID + "'" +
+                        ",HCREATEORGID='" + HCREATEORGID + "'" +
                         ",HUseFlag='" + HUseFlag + "'" +
                         ",HRemark= '" + HRemark + "' Where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo);
                     //淇敼瀛愰」鐩唬鐮�
                     //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_Warehouse,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo);
                     //灏嗕笂绾� 涓洪潪鏈骇
                     oCN.RunProc("Update Gy_ConkType set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
-                    //
+
+                    //淇濆瓨鍚庢帶鍒�=========================================      
+                    string sql2 = "exec h_p_Gy_ConkType_AfterSaveCtrl " + HMakeEmp + ",'" + 2 + "'";
+                    ds = oCN.RunProcReturn(sql2, "h_p_Gy_ConkType_AfterSaveCtrl");
+                    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";
@@ -260,7 +374,7 @@
             try
             {
                 ////鍒犻櫎鏉冮檺
-                //if (!DBUtility.ClsPub.Security_Log("Gy_Warehouse_Delete", 1, false, user))
+                //if (!DBUtility.ClsPub.Security_Log("Gy_ConkType_Delete", 1, false, user))
                 //{
                 //    objJsonResult.code = "0";
                 //    objJsonResult.count = 0;
@@ -287,17 +401,7 @@
                     objJsonResult.Message = "娌℃湁鏁版嵁锛屾棤娉曞垹闄わ紒";
                     objJsonResult.data = null;
                     return objJsonResult; ;
-                }
-                //var HStopflag = Convert.ToBoolean(ds.Tables[0].Rows[0]["HStopflag"]);
-                //if (HStopflag)
-                //{
-                //    oCN.RollBack();//鍥炴粴浜嬪姟
-                //    objJsonResult.code = "0";
-                //    objJsonResult.count = 0;
-                //    objJsonResult.Message = "鏁版嵁宸插垹闄ゆ棤娉曞啀娆″垹闄わ紒";
-                //    objJsonResult.data = null;
-                //    return objJsonResult;
-                //}
+                }               
                 ds1 = oCN.RunProcReturn("Select HItemID from Gy_ConkType  Where HParentID='" + HItemID + "'", "Gy_ConkType");
                 if (ds1.Tables[0].Rows.Count != 0)
                 {
@@ -316,8 +420,58 @@
                     objJsonResult.data = null;
                     return objJsonResult;
                 }
+                //鍒犻櫎鍓嶆帶鍒�=========================================      
+                string sql1 = "exec h_p_Gy_ConkType_BeforeDelCtrl " + HItemID + ",'" + user + "'";
+                ds = oCN.RunProcReturn(sql1, "h_p_Gy_ConkType_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_ConkType where HItemID=" + HItemID);
+
+
+                //鍒犻櫎鍚庢帶鍒�=========================================      
+                string sql2 = "exec h_p_Gy_ConkType_AfterDelCtrl " + HItemID + ",'" + user + "'";
+                ds = oCN.RunProcReturn(sql2, "h_p_Gy_ConkType_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";
                 objJsonResult.count = 1;
@@ -383,5 +537,390 @@
         }
 
 
+        #region 宸ヨ壓鍙傛暟 瀹℃牳銆佸弽瀹℃牳
+
+        [Route("Gy_ConkType/AuditGy_ConkType")]
+        [HttpGet]
+        public object AuditGy_ConkType(int HInterID, int IsAudit, string CurUserName)
+        {
+            try
+            {
+                //瀹℃牳鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log_second("Gy_ConkType_Check", 1, false, CurUserName))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "瀹℃牳澶辫触锛佹棤鏉冮檺锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                var ds = oCN.RunProcReturn("select * from Gy_ConkType where HItemID=" + HInterID, "Gy_ConkType");
+                if (ds.Tables[0].Rows.Count > 0)
+                {
+                    if (IsAudit == 0)  //瀹℃牳鍒ゆ柇
+                    {
+                        if (ds.Tables[0].Rows[0]["HCheckEmp"].ToString() != "")
+                        {
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = "鍗曟嵁宸插鏍�!涓嶈兘鍐嶆瀹℃牳锛�";
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
+                    }
+                    if (IsAudit == 1) //鍙嶅鏍稿垽鏂�
+                    {
+                        if (ds.Tables[0].Rows[0]["HCheckEmp"].ToString() == "")
+                        {
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = "鍗曟嵁鏈鏍�!涓嶉渶瑕佸弽瀹℃牳!";
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
+                    }
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦�!";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                oCN.BeginTran();
+
+                if (IsAudit == 0)  //瀹℃牳鍒ゆ柇
+                {
+
+                    //瀹℃牳鍓嶆帶鍒�=========================================      
+                    string sql1 = "exec h_p_Gy_ConkType_BeforeCheckCtrl " + HInterID + ",'" + CurUserName + "'";
+                    ds = oCN.RunProcReturn(sql1, "h_p_Gy_ConkType_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_ConkType set HCheckEmp='" + CurUserName + "',HCheckTime=getdate() where HItemID=" + HInterID);
+
+
+                    //瀹℃牳鍚庢帶鍒�=========================================      
+                    string sql2 = "exec h_p_Gy_ConkType_AfterCheckCtrl " + HInterID + ",'" + CurUserName + "'";
+                    ds = oCN.RunProcReturn(sql2, "h_p_Gy_ConkType_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 = "瀹℃牳鎴愬姛";
+                    objJsonResult.data = null;
+                }
+                if (IsAudit == 1) //鍙嶅鏍稿垽鏂�
+                {
+
+                    //鍙嶅鏍稿墠鎺у埗=========================================      
+                    string sql1 = "exec h_p_Gy_ConkType_BeforeUnCheckCtrl " + HInterID + ",'" + CurUserName + "'";
+                    ds = oCN.RunProcReturn(sql1, "h_p_Gy_ConkType_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_ConkType set HCheckEmp='',HCheckTime=null where HItemID=" + HInterID);
+
+
+                    //鍙嶅鏍稿悗鎺у埗=========================================      
+                    string sql2 = "exec h_p_Gy_ConkType_AfterUnCheckCtrl " + HInterID + ",'" + CurUserName + "'";
+                    ds = oCN.RunProcReturn(sql2, "h_p_Gy_ConkType_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 = "鍙嶅鏍告垚鍔�";
+                    objJsonResult.data = null;
+                }
+                oCN.Commit();
+
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                oCN.RollBack();
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "瀹℃牳澶辫触鎴栬�呭弽瀹℃牳澶辫触锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region 宸ヨ壓鍙傛暟 绂佺敤銆佸弽绂佺敤
+
+        [Route("Gy_ConkType/StopGy_ConkType")]
+        [HttpGet]
+        public object StopGy_ConkType(int HInterID, int IsStop, string CurUserName)
+        {
+            try
+            {
+                //绂佺敤鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log_second("Gy_ConkType_Stop", 1, false, CurUserName))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "绂佺敤澶辫触锛佹棤鏉冮檺锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                var ds = oCN.RunProcReturn("select * from Gy_ConkType where HItemID=" + HInterID, "Gy_Material");
+                if (ds.Tables[0].Rows.Count > 0)
+                {
+                    if (IsStop == 0)  //绂佺敤鍒ゆ柇
+                    {
+                        if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() != "")
+                        {
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = "鍗曟嵁宸茬鐢�!涓嶈兘鍐嶆绂佺敤锛�";
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
+                    }
+                    if (IsStop == 1) //鍙嶇鐢ㄥ垽鏂�
+                    {
+                        if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() == "")
+                        {
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = "鍗曟嵁鏈鐢�!涓嶉渶瑕佸弽绂佺敤!";
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
+                    }
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦�!";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                oCN.BeginTran();
+
+                if (IsStop == 0)  //绂佺敤鍒ゆ柇
+                {
+
+                    //绂佺敤鍓嶆帶鍒�=========================================      
+                    string sql1 = "exec h_p_Gy_ConkType_BeforeStopCtrl " + HInterID + ",'" + CurUserName + "'";
+                    ds = oCN.RunProcReturn(sql1, "h_p_Gy_ConkType_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_ConkType set HStopEmp='" + CurUserName + "',HStopTime=getdate(),HStopflag=1 where HItemID=" + HInterID);
+
+
+                    //绂佺敤鍚庢帶鍒�=========================================      
+                    string sql2 = "exec h_p_Gy_ConkType_AfterStopCtrl " + HInterID + ",'" + CurUserName + "'";
+                    ds = oCN.RunProcReturn(sql2, "h_p_Gy_ConkType_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;
+                    objJsonResult.Message = "绂佺敤鎴愬姛";
+                    objJsonResult.data = null;
+                }
+                if (IsStop == 1) //鍙嶇鐢ㄥ垽鏂�
+                {
+                    //鍙嶇鐢ㄥ墠鎺у埗=========================================      
+                    string sql1 = "exec h_p_Gy_ConkType_BeforeUnStopCtrl " + HInterID + ",'" + CurUserName + "'";
+                    ds = oCN.RunProcReturn(sql1, "h_p_Gy_ConkType_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_ConkType set HStopEmp='',HStopTime=null,HStopflag=0 where HItemID=" + HInterID);
+
+
+                    //鍙嶇鐢ㄥ悗鎺у埗=========================================      
+                    string sql2 = "exec h_p_Gy_ConkType_AfterUnStopCtrl " + HInterID + ",'" + CurUserName + "'";
+                    ds = oCN.RunProcReturn(sql2, "h_p_Gy_ConkType_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 = "鍙嶇鐢ㄦ垚鍔�";
+                    objJsonResult.data = null;
+                }
+                oCN.Commit();
+
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                oCN.RollBack();
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "绂佺敤澶辫触鎴栬�呭弽绂佺敤澶辫触锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
     }
 }
\ No newline at end of file

--
Gitblit v1.9.1