From a2a242077d814b48eb5ef2d609b5538f4fe30fad Mon Sep 17 00:00:00 2001
From: zrg <z18737863051@163.com>
Date: 星期一, 06 五月 2024 17:16:27 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 WebAPI/Controllers/WebAPIController.cs |  108 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 105 insertions(+), 3 deletions(-)

diff --git a/WebAPI/Controllers/WebAPIController.cs b/WebAPI/Controllers/WebAPIController.cs
index 31c8db2..681f05e 100644
--- a/WebAPI/Controllers/WebAPIController.cs
+++ b/WebAPI/Controllers/WebAPIController.cs
@@ -2909,7 +2909,7 @@
 
 
         /// <summary>
-        /// 涓嶅紓甯哥被鍨嬪垹闄ゅ姛鑳�
+        /// 寮傚父绫诲瀷鍒犻櫎鍔熻兘
         /// </summary>
         /// <returns></returns>
         [Route("DeltetGy_ErrType")]
@@ -2969,6 +2969,108 @@
             }
         }
 
+        #region 寮傚父绫诲瀷瀹℃牳/鍙嶅鏍�
+        [Route("Gy_ErrType/AuditGy_ErrType")]
+        [HttpGet]
+        public object AuditGy_ErrType(string HInterID, int Type, string user)
+        {
+            try
+            {
+                //鍒ゆ柇鏄惁鏈夊鏍告潈闄�
+                if (!DBUtility.ClsPub.Security_Log("Gy_ErrType_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_ErrType_Ctl oBill = new DAL.ClsGy_ErrType_Ctl();
+                ClsPub.CurUserName = user;
+                oCN.BeginTran();//寮�濮嬩簨鍔�
+
+                //Type 1 瀹℃牳  2  鍙嶅鏍�
+                if (Type == 1)
+                {
+                    //鍒ゆ柇鍗曟嵁鏄惁宸茬粡瀹℃牳
+                    DataSet ds;
+                    string sql = "select * from  Gy_ErrType 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;
+                    }
+                    //瀹℃牳鍗曟嵁
+                    if (!oBill.AuditByID2(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 1;
+                        objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo;
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                }
+
+                else
+                {
+                    //鍒ゆ柇鍗曟嵁鏄惁宸茬粡鍙嶅鏍�
+                    DataSet ds;
+                    string sql = "select * from  Gy_ErrType 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;
+                        }
+                        //鍙嶅鏍稿崟鎹�
+                        if (!oBill.DeAuditByID2(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo))
+                        {
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 1;
+                            objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:" + ClsPub.sExeReturnInfo;
+                            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
 
         /// <summary>
         /// 涓嶈壇绫诲瀷鑾峰彇淇℃伅
@@ -11645,11 +11747,11 @@
                 //鏈夌殑鍗曞瓙婧愬崟鍒嗕负绾㈣摑鍗�  0浠h〃钃濆崟  1浠h〃绾㈠崟
                 if (Num==0)
                 {           //婧愬崟涓鸿摑鍗�
-                    oDs = oCn.RunProcReturn("select * from  Xt_BillSourceSet where HName='" + HName + "' HRedBlueFlag ='"+ Num+"' ", "Xt_BillSourceSet");
+                    oDs = oCn.RunProcReturn("select * from  Xt_BillSourceSet where HName='" + HName + "'and  HRedBlueFlag ='"+ Num+"' ", "Xt_BillSourceSet");
                 }
                 else if (Num==1)
                 {          //婧愬崟涓虹孩鍗�
-                    oDs = oCn.RunProcReturn("select * from  Xt_BillSourceSet where HName='" + HName + "' HRedBlueFlag ='" + Num + "' ", "Xt_BillSourceSet");
+                    oDs = oCn.RunProcReturn("select * from  Xt_BillSourceSet where HName='" + HName + "' and  HRedBlueFlag ='" + Num + "' ", "Xt_BillSourceSet");
                 }
                 else if(Num==2)
                 {       //涓嶅垎绾㈣摑鍗�

--
Gitblit v1.9.1