From cc172d3b01335eb5ed5bc4fe1bcf7d0323fdf7c0 Mon Sep 17 00:00:00 2001
From: wtt <1985833171@qq.com>
Date: 星期三, 02 四月 2025 09:26:43 +0800
Subject: [PATCH] 项目费用待保存列表接口

---
 WebAPI/Controllers/BaseSet/Gy_CheckItemController.cs |  894 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 857 insertions(+), 37 deletions(-)

diff --git a/WebAPI/Controllers/BaseSet/Gy_CheckItemController.cs b/WebAPI/Controllers/BaseSet/Gy_CheckItemController.cs
index b5e70f5..5c8e537 100644
--- a/WebAPI/Controllers/BaseSet/Gy_CheckItemController.cs
+++ b/WebAPI/Controllers/BaseSet/Gy_CheckItemController.cs
@@ -182,26 +182,67 @@
                         objJsonResult.data = null;
                         return objJsonResult;
                     }
-                    //
-                    if (oDept.DeleteByID(HItemID))
+                    oCN.BeginTran();
+                    //鍒犻櫎鍓嶆帶鍒�=========================================
+                    ds = oCN.RunProcReturn("Exec h_p_Gy_QCCheckItem_BeforeDelCtrl " + HItemID + ",'" + User + "'", "h_p_Gy_QCCheckItem_BeforeDelCtrl");
+
+                    if (ds == null)
                     {
-                        //鍐欏叆鏃ュ織
-                        ClsPub.Add_Log("", "鍒犻櫎椤圭洰锛屼唬鐮侊細" + oDeptHlp.omodel.HNumber + ",鍚嶇О锛�" + oDeptHlp.omodel.HName, ClsPub.CurUserName);
-                        //鏇存柊涓婄骇涓� 鏈骇
-                        objJsonResult.code = "1";
-                        objJsonResult.count = 1;
-                        objJsonResult.Message = "鍒犻櫎鎴愬姛";
+                        oCN.RollBack();
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍒犻櫎鍓嶅垽鏂け璐ワ紒";
                         objJsonResult.data = null;
                         return objJsonResult;
                     }
-                    else
+                    if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
                     {
+                        oCN.RollBack();
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍒犻櫎澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    //=========================================================
+
+                    //
+                    if (!oDept.DeleteByID(HItemID))
+                    {
+                        oCN.RollBack();
                         objJsonResult.code = "0";
                         objJsonResult.count = 0;
                         objJsonResult.Message = "鍒犻櫎澶辫触";
                         objJsonResult.data = null;
                         return objJsonResult;
                     }
+
+
+                    //鍒犻櫎鍚庢帶鍒�=========================================
+                    DataSet ds2 = oCN.RunProcReturn("Exec h_p_Gy_QCCheckItem_AfterDelCtrl " + HItemID + ",'" + User + "'", "h_p_Gy_QCCheckItem_AfterDelCtrl");
+                    if (ds2 == null)
+                    {
+                        oCN.RollBack();
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍒犻櫎鍚庡垽鏂け璐ワ紒";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
+                    {
+                        oCN.RollBack();
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍒犻櫎澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    //=========================================================
+
+                    oCN.Commit();
+
+
                 }
                 //ds = oCN.RunProcReturn("delete from Gy_Department where HItemID =  " + HItemID, "Gy_Department");
 
@@ -236,6 +277,7 @@
             {
                 var _value = oMain["oMain"].ToString();
                 string msg1 = _value.ToString();
+               
                 //鍙嶅簭鍒楀寲
                 msg1 = "[" + msg1.ToString() + "]";
 
@@ -255,7 +297,7 @@
                 string HHelpCode = list[0].HHelpCode;
                 string HRemark = list[0].HRemark;
                 bool HStopflag = list[0].HStopflag;
-                bool HUseFlag = list[0].HUseFlag;
+                string HUseFlag = list[0].HUseFlag;
                 long HQCCheckClassID = list[0].HQCCheckClassID;
                 string HDefaultResult = list[0].HDefaultResult;
 
@@ -270,6 +312,9 @@
                 long HInspectBasisID = list[0].HInspectBasisID;
                 long HSampleSchemeID = list[0].HSampleSchemeID;
                 long HISsystemSet = list[0].HISsystemSet;
+                string HMakeEmp = list[0].HMakeEmp;
+                long HUSEORGID = list[0].HUSEORGID;
+                long HCREATEORGID = list[0].HCREATEORGID;
 
                 if (!DBUtility.ClsPub.AllowNumber(HNumber))
                 {
@@ -284,21 +329,70 @@
 
                 //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
                 oCN.BeginTran();
+
+                //淇濆瓨鍓嶆帶鍒�=========================================
+                DataSet ds = oCN.RunProcReturn("Exec h_p_Gy_QCCheckItem_BeforeSaveCtrl " + HMakeEmp + ",'1'", "h_p_Gy_QCCheckItem_BeforeSaveCtrl");
+                if (ds == null)
+                {
+                    oCN.RollBack();
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "淇濆瓨鍓嶅垽鏂け璐ワ紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
+                {
+                    oCN.RollBack();
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                //=========================================================
+
                 //涓昏〃
                 oCN.RunProc("Insert Into Gy_QCCheckItem " +
                 "(HNumber,HName,HHelpCode,HShortNumber,HParentID" +
                 ",HLevel,HEndFlag,HStopflag,HRemark,HUseFlag,HQCCheckClassID,HDefaultResult" +
                 ",HAnalysisMethod,HDefectLevel,HUnitID,HDestructInspect,HKeyInspect,HQualityStdID" +
-                ",HInspectMethodID,HInspectInstruMentID,HInspectBasisID,HSampleSchemeID,HISsystemSet) " +
+                ",HInspectMethodID,HInspectInstruMentID,HInspectBasisID,HSampleSchemeID,HISsystemSet" +
+                ",HMakeEmp,HMakeTime,HUSEORGID,HCREATEORGID) " +
                 " values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "','" + HItemID + "'" +
-                ",'"+ HLevel + "','0','" + Convert.ToString(HStopflag ? 1 : 0) + "','" + HRemark + "','鏈娇鐢�','"+ HQCCheckClassID + "','" + HDefaultResult + 
+                ",'"+ HLevel + "','0','" + Convert.ToString(HStopflag ? 1 : 0) + "','" + HRemark + "','"+ HUseFlag + "','"+ HQCCheckClassID + "','" + HDefaultResult + 
                 "','" + HAnalysisMethod + "','" + HDefectLevel + "'," + HUnitID + "," + HDestructInspect + "," + HKeyInspect + "," + HQualityStdID +
-                "," + HInspectMethodID + "," + HInspectInstruMentID + "," + HInspectBasisID + "," + HSampleSchemeID + "," + HISsystemSet + ")");
+                "," + HInspectMethodID + "," + HInspectInstruMentID + "," + HInspectBasisID + "," + HSampleSchemeID + "," + HISsystemSet + "" +
+                ",'" + HMakeEmp + "',getdate()," + HUSEORGID + "," + HCREATEORGID + ")");
                 //淇敼涓婄骇涓洪潪鏈骇浠g爜
                 if (list[0].HItemID.ToString() != "")
                 {
                     oCN.RunProc("Update Gy_QCCheckItem set HEndflag=0 where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo);
                 }
+
+                //淇濆瓨鍚庢帶鍒�=========================================
+                DataSet ds2 = oCN.RunProcReturn("Exec h_p_Gy_QCCheckItem_AfterSaveCtrl " + HMakeEmp + ",'1'", "h_p_Gy_QCCheckItem_AfterSaveCtrl");
+                if (ds2 == null)
+                {
+                    oCN.RollBack();
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "淇濆瓨鍚庡垽鏂け璐ワ紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+
+                }
+                if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
+                {
+                    oCN.RollBack();
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]);
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                //=========================================================
+
                 oCN.Commit();
                 objJsonResult.code = "1";
                 objJsonResult.count = 1;
@@ -365,7 +459,7 @@
                 long  HQCCheckClassID = list[0].HQCCheckClassID;
                 string HRemark = list[0].HRemark;
                 bool HStopflag = list[0].HStopflag;
-                bool HUseFlag = list[0].HUseFlag;
+                string HUseFlag = list[0].HUseFlag;
 
                 string HDefaultResult = list[0].HDefaultResult;
                 long HUnitID = list[0].HUnitID;
@@ -379,6 +473,8 @@
                 long HInspectBasisID = list[0].HInspectBasisID;
                 long HSampleSchemeID = list[0].HSampleSchemeID;
                 long HISsystemSet = list[0].HISsystemSet;
+                string HModifyEmp = msg4;
+                long HUSEORGID = list[0].HUSEORGID;
 
                 if (!DBUtility.ClsPub.AllowNumber(HNumber))
                 {
@@ -401,11 +497,37 @@
 
                 //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
                 oCN.BeginTran();
+
+                //淇濆瓨鍓嶆帶鍒�=========================================
+                DataSet ds = oCN.RunProcReturn("Exec h_p_Gy_QCCheckItem_BeforeSaveCtrl " + HModifyEmp + ",'1'", "h_p_Gy_QCCheckItem_BeforeSaveCtrl");
+                if (ds == null)
+                {
+                    oCN.RollBack();
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "淇濆瓨鍓嶅垽鏂け璐ワ紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
+                {
+                    oCN.RollBack();
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                //=========================================================
+
                 //涓昏〃
                 oCN.RunProc("Update Gy_QCCheckItem set " +
                     " HNumber='" + HNumber + "'" +
                     ",HName='" + HName + "'" +
                     ",HShortNumber='" + HShortNumber + "'" +
+                     ",HModifyEmp='" + HModifyEmp + "'" +
+                    ",HModifyTime=getdate()" +
+                     ",HUSEORGID='" + HUSEORGID + "'" +
                     ",HHelpCode='" + HHelpCode + "'" +
                     ",HParentID=" + HParentID +
                     ",HStopflag='" + HStopflag + "'" +
@@ -430,6 +552,30 @@
                 //灏嗕笂绾� 涓洪潪鏈骇
                 oCN.RunProc("Update Gy_QCCheckItem set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
                 //
+
+                //淇濆瓨鍚庢帶鍒�=========================================
+                DataSet ds2 = oCN.RunProcReturn("Exec h_p_Gy_QCCheckItem_AfterSaveCtrl " + HModifyEmp + ",'1'", "h_p_Gy_QCCheckItem_AfterSaveCtrl");
+                if (ds2 == null)
+                {
+                    oCN.RollBack();
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "淇濆瓨鍚庡垽鏂け璐ワ紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+
+                }
+                if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
+                {
+                    oCN.RollBack();
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]);
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                //=========================================================
+
                 oCN.Commit();
                 objJsonResult.code = "1";
                 objJsonResult.count = 1;
@@ -443,6 +589,386 @@
                 objJsonResult.code = "0";
                 objJsonResult.count = 0;
                 objJsonResult.Message = "Exception锛�" + e.Message;
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region 妫�楠岄」鐩垎绫诲鏍�/鍙嶅鏍�
+        [Route("Gy_QCCheckClass/AuditGy_QCCheckClass")]
+        [HttpGet]
+        public object AuditGy_QCCheckClass(string HInterID, int Type, string user)
+        {
+            try
+            {
+                //鍒ゆ柇鏄惁鏈夊鏍告潈闄�
+                if (!DBUtility.ClsPub.Security_Log("Gy_QCCheckClass_Check", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犳潈闄愬鏍�!";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                if (string.IsNullOrWhiteSpace(HInterID))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "HInterID涓虹┖锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                DAL.ClsGy_QCCheckClass_Ctl oBill = new DAL.ClsGy_QCCheckClass_Ctl();
+                ClsPub.CurUserName = user;
+                oCN.BeginTran();//寮�濮嬩簨鍔�
+
+                //Type 1 瀹℃牳  2  鍙嶅鏍�
+                if (Type == 1)
+                {
+                    //鍒ゆ柇鍗曟嵁鏄惁宸茬粡瀹℃牳
+                    DataSet ds;
+                    string sql = "select * from  Gy_QCCheckClass  where HItemID = " + HInterID;
+                    ds = oCN.RunProcReturn(sql, oBill.MvarItemKey);
+                    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;
+                    }
+
+                    //瀹℃牳鍓嶆帶鍒�=========================================
+                    ds = oCN.RunProcReturn("Exec h_p_Gy_QCCheckClass_BeforeCheckCtrl " + HInterID + ",'" + user + "'", "h_p_Gy_QCCheckClass_BeforeCheckCtrl");
+                    if (ds == null)
+                    {
+                        oCN.RollBack();
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "瀹℃牳鍓嶅垽鏂け璐ワ紒";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
+                    {
+                        oCN.RollBack();
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "瀹℃牳澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    //=========================================================
+
+                    //瀹℃牳鍗曟嵁
+                    if (!oBill.AuditByID2(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 1;
+                        objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo;
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+
+                    //瀹℃牳鍚庢帶鍒�=========================================
+                    DataSet ds2 = oCN.RunProcReturn("Exec h_p_Gy_QCCheckClass_AfterCheckCtrl " + HInterID + ",'" + user + "'", "h_p_Gy_QCCheckClass_AfterCheckCtrl");
+                    if (ds2 == null)
+                    {
+                        oCN.RollBack();
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "瀹℃牳鍚庡垽鏂け璐ワ紒";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
+                    {
+                        oCN.RollBack();
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "瀹℃牳澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    //=========================================================
+
+                }
+
+                else
+                {
+                    //鍒ゆ柇鍗曟嵁鏄惁宸茬粡鍙嶅鏍�
+                    DataSet ds;
+                    string sql = "select * from  Gy_QCCheckClass  where HItemID = " + HInterID;
+                    ds = oCN.RunProcReturn(sql, oBill.MvarItemKey);
+                    if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
+                    {
+                        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;
+                        }
+
+                        //鍙嶅鏍稿墠鎺у埗=========================================
+                        ds = oCN.RunProcReturn("Exec h_p_Gy_QCCheckClass_BeforeUnCheckCtrl " + HInterID + ",'" + user + "'", "h_p_Gy_QCCheckClass_BeforeUnCheckCtrl");
+                        if (ds == null)
+                        {
+                            oCN.RollBack();
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = "瀹℃牳鍓嶅垽鏂け璐ワ紒";
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
+                        if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
+                        {
+                            oCN.RollBack();
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = "瀹℃牳澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
+                        //=========================================================
+
+                        //鍙嶅鏍稿崟鎹�
+                        if (!oBill.DeAuditByID2(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo))
+                        {
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 1;
+                            objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:" + ClsPub.sExeReturnInfo;
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
+
+
+                        //鍙嶅鏍稿悗鎺у埗=========================================
+                        DataSet ds2 = oCN.RunProcReturn("Exec h_p_Gy_QCCheckClass_AfterUnCheckCtrl " + HInterID + ",'" + user + "'", "h_p_Gy_QCCheckClass_AfterUnCheckCtrl");
+                        if (ds2 == null)
+                        {
+                            oCN.RollBack();
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = "瀹℃牳鍚庡垽鏂け璐ワ紒";
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
+                        if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
+                        {
+                            oCN.RollBack();
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = "瀹℃牳澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
+                        //=========================================================
+                    }
+                }
+
+                oCN.Commit();//鎻愪氦浜嬪姟
+
+                objJsonResult.code = "0";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "鎵ц鎴愬姛锛�";
+                objJsonResult.data = null;
+                return objJsonResult; ;
+
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鎵ц澶辫触锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+
+        #region 妫�楠岄」鐩垎绫荤鐢ㄣ�佸弽绂佺敤
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="HInterID">鍗曟嵁ID</param>
+        /// <param name="IsStop">绂佺敤(0),鍙嶇鐢�(1)</param>
+        /// <param name="CurUserName">瀹℃牳浜�</param>
+        /// <returns></returns>
+        [Route("Gy_QCCheckClass/StopGy_QCCheckClass")]
+        [HttpGet]
+        public object StopGy_QCCheckClass(int HInterID, int IsStop, string CurUserName)
+        {
+            try
+            {
+                //绂佺敤鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log_second("Gy_QCCheckClass_Stop", 1, false, CurUserName))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "绂佺敤澶辫触锛佹棤鏉冮檺锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                var ds = oCN.RunProcReturn("select * from Gy_QCCheckClass 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)  //绂佺敤鍒ゆ柇
+                {
+                    //绂佺敤鍓嶆帶鍒�=========================================
+                    ds = oCN.RunProcReturn("Exec h_p_Gy_QCCheckClass_BeforeStopCtrl " + HInterID + ",'" + CurUserName + "'", "h_p_Gy_QCCheckClass_BeforeStopCtrl");
+                    if (ds == null)
+                    {
+                        oCN.RollBack();
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "绂佺敤鍓嶅垽鏂け璐ワ紒";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
+                    {
+                        oCN.RollBack();
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "绂佺敤澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    //=========================================================
+
+                    oCN.RunProc("update Gy_QCCheckClass set HStopEmp='" + CurUserName + "',HStopTime=getdate(),HStopflag=1 where HItemID=" + HInterID);
+
+                    //绂佺敤鍚庢帶鍒�=========================================
+                    DataSet ds2 = oCN.RunProcReturn("Exec h_p_Gy_QCCheckClass_AfterStopCtrl " + HInterID + ",'" + CurUserName + "'", "h_p_Gy_QCCheckClass_AfterStopCtrl");
+                    if (ds2 == null)
+                    {
+                        oCN.RollBack();
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "绂佺敤鍚庡垽鏂け璐ワ紒";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
+                    {
+                        oCN.RollBack();
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "绂佺敤澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    //=========================================================
+
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "绂佺敤鎴愬姛";
+                    objJsonResult.data = null;
+                }
+                if (IsStop == 1) //鍙嶇鐢ㄥ垽鏂�
+                {
+                    //鍙嶇鐢ㄥ墠鎺у埗=========================================
+                    ds = oCN.RunProcReturn("Exec h_p_Gy_QCCheckClass_BeforeUnStopCtrl " + HInterID + ",'" + CurUserName + "'", "h_p_Gy_QCCheckClass_BeforeUnStopCtrl");
+                    if (ds == null)
+                    {
+                        oCN.RollBack();
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "绂佺敤鍓嶅垽鏂け璐ワ紒";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
+                    {
+                        oCN.RollBack();
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "绂佺敤澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    //=========================================================
+
+                    oCN.RunProc("update Gy_QCCheckClass set HStopEmp='',HStopTime=null,HStopflag=0 where HItemID=" + HInterID);
+
+
+                    //鍙嶇鐢ㄥ悗鎺у埗=========================================
+                    DataSet ds2 = oCN.RunProcReturn("Exec h_p_Gy_QCCheckClass_AfterUnStopCtrl " + HInterID + ",'" + CurUserName + "'", "h_p_Gy_QCCheckClass_AfterUnStopCtrl");
+                    if (ds2 == null)
+                    {
+                        oCN.RollBack();
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "绂佺敤鍚庡垽鏂け璐ワ紒";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
+                    {
+                        oCN.RollBack();
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "绂佺敤澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+                        objJsonResult.data = null;
+                        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;
             }
@@ -583,6 +1109,29 @@
                         objJsonResult.data = null;
                         return objJsonResult;
                     }
+
+                    //瀹℃牳鍓嶆帶鍒�=========================================
+                    ds = oCN.RunProcReturn("Exec h_p_Gy_QCCheckItem_BeforeCheckCtrl " + HInterID + ",'" + user + "'", "h_p_Gy_QCCheckItem_BeforeCheckCtrl");
+                    if (ds == null)
+                    {
+                        oCN.RollBack();
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "瀹℃牳鍓嶅垽鏂け璐ワ紒";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
+                    {
+                        oCN.RollBack();
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "瀹℃牳澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    //=========================================================
+
                     //瀹℃牳鍗曟嵁
                     if (!BillOld.AuditByID2(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo))
                     {
@@ -592,6 +1141,29 @@
                         objJsonResult.data = null;
                         return objJsonResult;
                     }
+
+                    //瀹℃牳鍚庢帶鍒�=========================================
+                    DataSet ds2 = oCN.RunProcReturn("Exec h_p_Gy_QCCheckItem_AfterCheckCtrl " + HInterID + ",'" + user + "'", "h_p_Gy_QCCheckItem_AfterCheckCtrl");
+                    if (ds2 == null)
+                    {
+                        oCN.RollBack();
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "瀹℃牳鍚庡垽鏂け璐ワ紒";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
+                    {
+                        oCN.RollBack();
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "瀹℃牳澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    //=========================================================
+
                 }
 
                 else
@@ -610,6 +1182,29 @@
                             objJsonResult.data = null;
                             return objJsonResult;
                         }
+
+                        //鍙嶅鏍稿墠鎺у埗=========================================
+                        ds = oCN.RunProcReturn("Exec h_p_Gy_QCCheckItem_BeforeUnCheckCtrl " + HInterID + ",'" + user + "'", "h_p_Gy_QCCheckItem_BeforeUnCheckCtrl");
+                        if (ds == null)
+                        {
+                            oCN.RollBack();
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = "瀹℃牳鍓嶅垽鏂け璐ワ紒";
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
+                        if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
+                        {
+                            oCN.RollBack();
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = "瀹℃牳澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
+                        //=========================================================
+
                         //鍙嶅鏍稿崟鎹�
                         if (!BillOld.DeAuditByID2(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo))
                         {
@@ -619,6 +1214,28 @@
                             objJsonResult.data = null;
                             return objJsonResult;
                         }
+
+                        //鍙嶅鏍稿悗鎺у埗=========================================
+                        DataSet ds2 = oCN.RunProcReturn("Exec h_p_Gy_QCCheckItem_AfterUnCheckCtrl " + HInterID + ",'" + user + "'", "h_p_Gy_QCCheckItem_AfterUnCheckCtrl");
+                        if (ds2 == null)
+                        {
+                            oCN.RollBack();
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = "瀹℃牳鍚庡垽鏂け璐ワ紒";
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
+                        if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
+                        {
+                            oCN.RollBack();
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = "瀹℃牳澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
+                        //=========================================================
                     }
                 }
 
@@ -642,10 +1259,194 @@
         }
         #endregion
 
+        #region 妫�楠岄」鐩鐢ㄣ�佸弽绂佺敤
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="HInterID">鍗曟嵁ID</param>
+        /// <param name="IsStop">绂佺敤(0),鍙嶇鐢�(1)</param>
+        /// <param name="CurUserName">瀹℃牳浜�</param>
+        /// <returns></returns>
+        [Route("Gy_QCCheckItem/StopGy_QCCheckItem")]
+        [HttpGet]
+        public object StopGy_QCCheckItem(int HInterID, int IsStop, string CurUserName)
+        {
+            try
+            {
+                //绂佺敤鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log_second("Gy_QCCheckItem_Stop", 1, false, CurUserName))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "绂佺敤澶辫触锛佹棤鏉冮檺锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                var ds = oCN.RunProcReturn("select * from Gy_QCCheckItem 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)  //绂佺敤鍒ゆ柇
+                {
+                    //绂佺敤鍓嶆帶鍒�=========================================
+                    ds = oCN.RunProcReturn("Exec h_p_Gy_QCCheckItem_BeforeStopCtrl " + HInterID + ",'" + CurUserName + "'", "h_p_Gy_QCCheckItem_BeforeStopCtrl");
+                    if (ds == null)
+                    {
+                        oCN.RollBack();
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "绂佺敤鍓嶅垽鏂け璐ワ紒";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
+                    {
+                        oCN.RollBack();
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "绂佺敤澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    //=========================================================
+
+                    oCN.RunProc("update Gy_QCCheckItem set HStopEmp='" + CurUserName + "',HStopTime=getdate(),HStopflag=1 where HItemID=" + HInterID);
+
+                    //绂佺敤鍚庢帶鍒�=========================================
+                    DataSet ds2 = oCN.RunProcReturn("Exec h_p_Gy_QCCheckItem_AfterStopCtrl " + HInterID + ",'" + CurUserName + "'", "h_p_Gy_QCCheckItem_AfterStopCtrl");
+                    if (ds2 == null)
+                    {
+                        oCN.RollBack();
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "绂佺敤鍚庡垽鏂け璐ワ紒";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
+                    {
+                        oCN.RollBack();
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "绂佺敤澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    //=========================================================
+
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "绂佺敤鎴愬姛";
+                    objJsonResult.data = null;
+                }
+                if (IsStop == 1) //鍙嶇鐢ㄥ垽鏂�
+                {
+                    //鍙嶇鐢ㄥ墠鎺у埗=========================================
+                    ds = oCN.RunProcReturn("Exec h_p_Gy_QCCheckItem_BeforeUnStopCtrl " + HInterID + ",'" + CurUserName + "'", "h_p_Gy_QCCheckItem_BeforeUnStopCtrl");
+                    if (ds == null)
+                    {
+                        oCN.RollBack();
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "绂佺敤鍓嶅垽鏂け璐ワ紒";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
+                    {
+                        oCN.RollBack();
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "绂佺敤澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    //=========================================================
+
+                    oCN.RunProc("update Gy_QCCheckItem set HStopEmp='',HStopTime=null,HStopflag=0 where HItemID=" + HInterID);
+
+
+                    //鍙嶇鐢ㄥ悗鎺у埗=========================================
+                    DataSet ds2 = oCN.RunProcReturn("Exec h_p_Gy_QCCheckItem_AfterUnStopCtrl " + HInterID + ",'" + CurUserName + "'", "h_p_Gy_QCCheckItem_AfterUnStopCtrl");
+                    if (ds2 == null)
+                    {
+                        oCN.RollBack();
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "绂佺敤鍚庡垽鏂け璐ワ紒";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
+                    {
+                        oCN.RollBack();
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "绂佺敤澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+                        objJsonResult.data = null;
+                        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_CheckItem/Gy_Process_Excel")]
+        [Route("Gy_CheckItem/Gy_CheckItem_Excel")]
         [HttpPost]
-        public json Gy_Process_Excel()
+        public json Gy_CheckItem_Excel()
         {
             json res = new json();
             try
@@ -674,7 +1475,7 @@
 
                 //妯℃澘缂哄皯鍒� 浣嗛渶瑕佷粠鏁版嵁搴撲腑鏌ヨ鍑烘潵鏄剧ず鍦ㄩ〉闈㈢殑瀛楁
                 provisional.Columns.Add("HOrgID", typeof(Int32));//缁勭粐ID
-                provisional.Columns.Add("HDeptID", typeof(Int32));//閮ㄩ棬ID
+                provisional.Columns.Add("HQCCheckClassID", typeof(Int32));//妫�楠岄」鐩垎绫籌D
 
                 //娣诲姞鏁版嵁
                 for (int i = 1; i < ExcelDs.Tables[0].Rows.Count; i++)
@@ -700,22 +1501,20 @@
 
                 for (int i = 0; i <= provisional.Rows.Count - 1; i++)
                 {
-                    string HNumber = DBUtility.ClsPub.isStrNull(provisional.Rows[i]["浠g爜"].ToString());
-                    string HUSEORGID = DBUtility.ClsPub.isStrNull(provisional.Rows[i]["缁勭粐浠g爜"].ToString());
-                    string HQCCheckClassID = DBUtility.ClsPub.isStrNull(provisional.Rows[i]["妫�楠岄」鐩被鍒唬鐮�"].ToString());
-                    string HQCCheckClassName = DBUtility.ClsPub.isStrNull(provisional.Rows[i]["妫�楠岄」鐩被鍒悕绉�"].ToString());
-                    string HName = DBUtility.ClsPub.isStrNull(provisional.Rows[i]["鍚嶇О"].ToString());
+                    string HCheckItemName = DBUtility.ClsPub.isStrNull(provisional.Rows[i]["妫�楠岄」鐩�"].ToString());
+                    string HCheckItemNumber = DBUtility.ClsPub.isStrNull(provisional.Rows[i]["妫�楠岄」鐩唬鐮�"].ToString());
+                    string HQCCheckClassName = DBUtility.ClsPub.isStrNull(provisional.Rows[i]["妫�楠岄」鐩垎绫�"].ToString());
+                    string HQCCheckClassNumber = DBUtility.ClsPub.isStrNull(provisional.Rows[i]["妫�楠岄」鐩垎绫讳唬鐮�"].ToString());
+                    string HORGNumber = DBUtility.ClsPub.isStrNull(provisional.Rows[i]["缁勭粐浠g爜"].ToString());
                     string HORGName = DBUtility.ClsPub.isStrNull(provisional.Rows[i]["缁勭粐鍚嶇О"].ToString());
-                    string HHelpCode = DBUtility.ClsPub.isStrNull(provisional.Rows[i]["鍔╄鐮�"]);
-                    string HRemark = DBUtility.ClsPub.isStrNull(provisional.Rows[i]["澶囨敞"].ToString());
 
                     //鑾峰彇鐪熷疄琛屾暟
                     int line = i + 1;
 
-                    if (HUSEORGID != "")
+                    if (HORGNumber != "")
                     {
                         //鏌ヨ缁勭粐
-                        ds = oCN.RunProcReturn("select * from Xt_ORGANIZATIONS where  HNumber='" + HUSEORGID + "' and Hname='" + HORGName + "'", "Xt_ORGANIZATIONS");
+                        ds = oCN.RunProcReturn("select * from Xt_ORGANIZATIONS where  HNumber='" + HORGNumber + "' and Hname='" + HORGName + "'", "Xt_ORGANIZATIONS");
 
                         if (ds.Tables[0].Rows.Count == 0)
                         {
@@ -731,8 +1530,8 @@
                         }
                         string HORGid = ds.Tables[0].Rows[0]["HItemID"].ToString();
 
-                        //鏌ヨ妫�楠岄」鐩槸鍚﹀瓨鍦�
-                        DataSet checkClass = oCN.RunProcReturn("select * from Gy_QCCheckClass where HNumber = '" + HQCCheckClassID + "' and HName = '" + HQCCheckClassName + "'", "Gy_QCCheckClass");
+                        //鏌ヨ妫�楠岄」鐩垎绫绘槸鍚﹀瓨鍦�
+                        DataSet checkClass = oCN.RunProcReturn("select * from Gy_QCCheckClass where HNumber = '" + HQCCheckClassNumber + "' and HName = '" + HQCCheckClassName + "'", "Gy_QCCheckClass");
                         if (checkClass.Tables[0].Rows.Count == 0)
                         {
                             res.code = CodeConstant.FAIL;
@@ -740,6 +1539,10 @@
                             res.Message = "绗�" + line + "琛�,妫�楠岄」鐩笉瀛樺湪锛�";
                             res.data = null;
                             return res;
+                        }
+                        else
+                        {
+                            provisional.Rows[i]["HQCCheckClassID"] = ds.Tables[0].Rows[0]["HItemID"].ToString();
                         }
                     }
                     else
@@ -781,14 +1584,32 @@
             if (!provisional.Columns.Contains("缁勭粐浠g爜"))
                 error += "娌℃湁鎵惧埌銆愮粍缁囦唬鐮併�戠殑鏍囬,";
 
-            if(!provisional.Columns.Contains("妫�楠岄」鐩被鍒悕绉�"))
-                error += "娌℃湁鎵惧埌銆愭楠岄」鐩被鍒悕绉般�戠殑鏍囬,";
+            if(!provisional.Columns.Contains("妫�楠岄」鐩垎绫讳唬鐮�"))
+                error += "娌℃湁鎵惧埌銆愭楠岄」鐩垎绫讳唬鐮併�戠殑鏍囬,";
+
+            if (!provisional.Columns.Contains("缁勭粐鍚嶇О"))
+                error += "娌℃湁鎵惧埌銆愮粍缁囧悕绉般�戠殑鏍囬,";
+
+            if (!provisional.Columns.Contains("妫�楠岄」鐩垎绫�"))
+                error += "娌℃湁鎵惧埌銆愭楠岄」鐩垎绫汇�戠殑鏍囬,";
+
+            if (!provisional.Columns.Contains("妫�楠岄」鐩�"))
+                error += "娌℃湁鎵惧埌銆愭楠岄」鐩�戠殑鏍囬,";
+
+            if (!provisional.Columns.Contains("妫�楠岄」鐩唬鐮�"))
+                error += "娌℃湁鎵惧埌銆愭楠岄」鐩唬鐮併�戠殑鏍囬,";
+
+            if (!provisional.Columns.Contains("鍔╄鐮�"))
+                error += "娌℃湁鎵惧埌銆愬姪璁扮爜銆戠殑鏍囬,";
+
+            if (!provisional.Columns.Contains("澶囨敞"))
+                error += "娌℃湁鎵惧埌銆愬娉ㄣ�戠殑鏍囬,";
             return error;
         }
         #endregion
 
         #region 鏍¢獙椤圭洰鍒楄〃 瀵煎叆(淇濆瓨)
-        [Route("Gy_CheckItem/Gy_Process_btnSave")]
+        [Route("Gy_CheckItem/Gy_CheckItem_btnSave")]
         [HttpPost]
         public object Gy_Group_btnSave([FromBody] JObject sMainSub)
         {
@@ -799,7 +1620,7 @@
             string user = sArray[1].ToString();
             try
             {
-                if (!DBUtility.ClsPub.Security_Log("Gy_Group_Edit", 1, false, user))
+                if (!DBUtility.ClsPub.Security_Log("Gy_QCCheckItem_Edit", 1, false, user))
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
@@ -825,12 +1646,11 @@
                 int i = 1;
                 foreach (Dictionary<string, string> item in list)
                 {
-                    string HNumber = item["浠g爜"].ToString();
-                    string HUSEORGID = item["缁勭粐浠g爜"].ToString();
-                    string HName = item["鍚嶇О"].ToString();
-                    string HORGName = item["缁勭粐鍚嶇О"].ToString();
+                    string HNumber = item["妫�楠岄」鐩唬鐮�"].ToString();
+                    string HUSEORGID = item["HOrgID"].ToString();
+                    string HName = item["妫�楠岄」鐩�"].ToString();
                     string HHelpCode = item["鍔╄鐮�"];
-                    string HQCCheckClassID = item["妫�楠岄」鐩被鍒唬鐮�"];
+                    string HQCCheckClassID = item["HQCCheckClassID"];
                     string HRemark = item["澶囨敞"].ToString();
 
                     string sShortNumber;

--
Gitblit v1.9.1