From 11099336f48a1a160a7aaf0e3c8c82d0f79ce332 Mon Sep 17 00:00:00 2001
From: 王 垚 <1402714037@qq.com>
Date: 星期二, 19 十月 2021 15:50:16 +0800
Subject: [PATCH] nothing

---
 WebAPI/Controllers/Sc_CheckToolsRepairWorkBillListController.cs |  267 ++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 252 insertions(+), 15 deletions(-)

diff --git a/WebAPI/Controllers/Sc_CheckToolsRepairWorkBillListController.cs b/WebAPI/Controllers/Sc_CheckToolsRepairWorkBillListController.cs
index 07abf99..b38fe11 100644
--- a/WebAPI/Controllers/Sc_CheckToolsRepairWorkBillListController.cs
+++ b/WebAPI/Controllers/Sc_CheckToolsRepairWorkBillListController.cs
@@ -4213,12 +4213,21 @@
 
         [Route("Sc_CheckToolsRepairWorkBillList/GetMouldRepairInBillList")]
         [HttpGet]
-        public object GetMouldRepairInBillList(string sWhere)
+        public object GetMouldRepairInBillList(string sWhere,string user, string Organization)
         {
             try
             {
+                //缂栬緫鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log("Sc_MouldRepairIn_SingleBillList", 1, true, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犲垹闄ゆ潈闄愶紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
 
-                ds = Sc_MouldRepairInBillList(sWhere);
+                ds = Sc_MouldRepairInBillList(sWhere,Organization);
                 objJsonResult.code = "1";
                 objJsonResult.count = 1;
                 objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�";
@@ -4235,16 +4244,16 @@
             }
         }
 
-        public static DataSet Sc_MouldRepairInBillList(string sWhere)
+        public static DataSet Sc_MouldRepairInBillList(string sWhere,string Organization)
         {
+            string sql1 = string.Format(@"select * from h_v_Sc_MouldRepairInBillList where 搴撳瓨缁勭粐='" + Organization + "'");
             if (sWhere == null || sWhere.Equals(""))
             {
-                return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MouldRepairInBillList ", "h_v_Sc_MouldRepairInBillList");
+                return new SQLHelper.ClsCN().RunProcReturn(sql1 + "order by 鏃ユ湡 desc", "h_v_Sc_MouldRepairInBillList");
             }
             else
             {
-                string sql1 = "select * from h_v_Sc_MouldRepairInBillList where 1 = 1 ";
-                string sql = sql1 + sWhere;
+                string sql = sql1 + sWhere+ "order by 鏃ユ湡 desc";
                 return new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_Sc_MouldRepairInBillList");
             }
 
@@ -4317,12 +4326,23 @@
             string msg2 = sArray[0].ToString();
             string msg3 = sArray[1].ToString();
             string refSav = sArray[2].ToString();
+            string msg4 = sArray[3].ToString();
 
             string UserName = "";
             string s = "";
             ListModels oListModels = new ListModels();
             try
             {
+                //缂栬緫鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log("Sc_MouldRepairIn_SingleBill_Edit", 1, true, msg4))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犲垹闄ゆ潈闄愶紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
                 DLL.ClsSc_MouldRepairInBill oBill = new DLL.ClsSc_MouldRepairInBill();
                 List<Models.ClsSc_MouldRepairInBillMain> lsmain = new List<Models.ClsSc_MouldRepairInBillMain>();
                 msg2 = msg2.Replace("\\", "");
@@ -4485,6 +4505,223 @@
         }
         #endregion
 
+        #region [鍣ㄥ叿鏀瑰埗鍏ュ簱鍗曞鏍搞�佸弽瀹℃牳]
+        /// <summary>
+        /// 瀹℃牳
+        /// </summary>
+        /// <param name="HInterID">鍗曟嵁ID</param>
+        /// <param name="CurUserName">瀹℃牳浜�</param>
+        /// <returns></returns>
+        [Route("Sc_MouldRepairInBill/set_CheckBill")]
+        [HttpGet]
+        public object set_CheckBill(int HInterID, string CurUserName)
+        {
+            string ModRightNameCheck = "Sc_MouldRepairInBill_Check";
+            DBUtility.ClsPub.CurUserName = CurUserName;
+            DLL.ClsSc_MouldRepairInBill oBill = new DLL.ClsSc_MouldRepairInBill();
+            try
+            {
+                //瀹℃牳鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, true, CurUserName))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "瀹℃牳澶辫触锛佹棤鏉冮檺锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                //瀹℃牳鍓嶅垽鏂槸鍚﹀厑璁�
+                string s = "";
+                if (!DBUtility.Xt_BaseBillFun.Fun_AllowCheckBill(oBill, ref s))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = s + "锛屼笉鍏佽瀹℃牳";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                if (HInterID <= 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "HInterID灏忎簬0锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                Int64 lngBillKey = 0;
+                lngBillKey = DBUtility.ClsPub.isLong(HInterID);
+                //鏌ョ湅鏄惁宸插鏍�,鍏抽棴,浣滃簾
+                if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))
+                {
+                    if (oBill.omodel.HCloseMan.Trim() != "")
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍗曟嵁宸插叧闂�!涓嶈兘鍐嶆瀹℃牳锛�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    if (oBill.omodel.HDeleteMan.Trim() != "")
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍗曟嵁宸蹭綔搴�!涓嶈兘鍐嶆瀹℃牳锛�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    if (oBill.omodel.HChecker.Trim() != "")
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍗曟嵁宸插鏍�!涓嶈兘鍐嶆瀹℃牳锛�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦�!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                //瀹℃牳鎻愪氦
+                if (oBill.CheckBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
+                {
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "瀹℃牳鎴愬姛";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "瀹℃牳澶辫触锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        /// <summary>
+        /// 鍙嶅鏍�
+        /// </summary>
+        /// <param name="HInterID">鍗曟嵁ID</param>
+        /// <param name="CurUserName">瀹℃牳浜�</param>
+        /// <returns></returns>
+        [Route("Sc_MouldRepairInBill/set_AbandonCheck")]
+        [HttpGet]
+        public object set_AbandonCheck(int HInterID, string CurUserName)
+        {
+            string ModRightNameCheck = "Sc_MouldRepairInBill_Check";
+            DBUtility.ClsPub.CurUserName = CurUserName;
+            DLL.ClsSc_MouldRepairInBill oBill = new DLL.ClsSc_MouldRepairInBill();
+            try
+            {
+                //瀹℃牳鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, true, CurUserName))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鍙嶅鏍稿け璐ワ紒鏃犳潈闄愶紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                //鍙嶅鏍稿墠鍒ゆ柇
+                string s = "";
+                if (!DBUtility.Xt_BaseBillFun.Fun_AllowCheckBill(oBill, ref s))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = s + "锛屼笉鍏佽鍙嶅鏍�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                if (HInterID <= 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "HInterID灏忎簬0锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                Int64 lngBillKey = 0;
+                lngBillKey = DBUtility.ClsPub.isLong(HInterID);
+                //鏌ョ湅鏄惁宸插鏍�,鍏抽棴,浣滃簾
+                if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))
+                {
+                    if (oBill.omodel.HCloseMan.Trim() != "")
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍗曟嵁宸插叧闂�!涓嶈兘鍐嶆鍙嶅鏍革紒";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    if (oBill.omodel.HDeleteMan.Trim() != "")
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍗曟嵁宸蹭綔搴�!涓嶈兘鍐嶆鍙嶅鏍革紒";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    if (oBill.omodel.HChecker.Trim() == "")
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍗曟嵁鏈鏍�!涓嶉渶瑕佸弽瀹℃牳!";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦�!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                //鍙嶅鏍告彁浜bandonCheck
+                if (oBill.AbandonCheck(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
+                {
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "鍙嶅鏍告垚鍔�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
+                    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>
         /// 鍣ㄥ叿鏀瑰埗鍏ュ簱鍗曞垹闄ゅ姛鑳�
@@ -4492,17 +4729,17 @@
         /// <returns></returns>
         [Route("Sc_MouldRepairInBill/DeltetMouldRepairInBill")]
         [HttpGet]
-        public object DeltetMouldRepairInBill(string HInterID)
+        public object DeltetMouldRepairInBill(string HInterID,string user)
         {
             //缂栬緫鏉冮檺
-            //if (!DBUtility.ClsPub.Security_Log("Sc_MouldProdBackBill_Delete", 1, true, DBUtility.ClsPub.CurUserName))
-            //{
-            //    objJsonResult.code = "0";
-            //    objJsonResult.count = 0;
-            //    objJsonResult.Message = "鏃犲垹闄ゆ潈闄愶紒";
-            //    objJsonResult.data = null;
-            //    return objJsonResult;
-            //}
+            if (!DBUtility.ClsPub.Security_Log("Sc_MouldRepairIn_SingleBill_Delete", 1, true, user))
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鏃犲垹闄ゆ潈闄愶紒";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
 
 
             Int64 lngBillKey = 0;

--
Gitblit v1.9.1