From 1391244d57b3f6fac3d7881268b8033b53cc03fe Mon Sep 17 00:00:00 2001
From: zzr99 <1940172413@qq.com>
Date: 星期二, 02 十一月 2021 17:34:09 +0800
Subject: [PATCH] 器具管理模块加审核反审核权限

---
 WebAPI/Controllers/MJGL/Sc_MouldOtherOutBillController.cs |   85 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 84 insertions(+), 1 deletions(-)

diff --git a/WebAPI/Controllers/MJGL/Sc_MouldOtherOutBillController.cs b/WebAPI/Controllers/MJGL/Sc_MouldOtherOutBillController.cs
index 9e3ef9c..1d1b015 100644
--- a/WebAPI/Controllers/MJGL/Sc_MouldOtherOutBillController.cs
+++ b/WebAPI/Controllers/MJGL/Sc_MouldOtherOutBillController.cs
@@ -17,6 +17,7 @@
         private json objJsonResult = new json();
         public DataSet ds = new DataSet();
         public WebServer webserver = new WebServer();
+        public SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
 
         public DAL.ClsSc_MouldScrapInBill BillNew0 = new DAL.ClsSc_MouldScrapInBill();   //妯″叿鎶ュ簾鍏ュ簱瀵瑰簲鍗曟嵁绫�
         public DAL.ClsSc_MouldScrapInBill BillOld0 = new DAL.ClsSc_MouldScrapInBill();   //妯″叿鎶ュ簾鍏ュ簱瀵瑰簲鍗曟嵁绫�
@@ -341,7 +342,7 @@
         }
         #endregion
 
-        #region [鍣ㄥ叿鍏朵粬鍏ュ簱鍗曞垹闄ゅ姛鑳絔
+        #region [鍣ㄥ叿鍏朵粬鍑哄簱鍗曞垹闄ゅ姛鑳絔
         /// <summary>
         /// 妯″叿澶勭悊棰嗙敤鍗曞垹闄ゅ姛鑳�
         /// </summary>
@@ -421,7 +422,89 @@
         }
         #endregion
 
+        #region 鍣ㄥ叿鍏朵粬鍑哄簱鍗曞鏍�/鍙嶅鏍�
+        [Route("Sc_MouldOtherOutBill/AuditMouldOtherOutBill")]
+        [HttpGet]
+        public object AuditMouldOtherOutBill(string HInterID, string user, int flag)
+        {
+            //flag=1 瀹℃牳锛�  flag=2 鍙嶅鏍�
+            //缂栬緫鏉冮檺
+            if (!DBUtility.ClsPub.Security_Log_second("Sc_MouldOtherOutBill_Check", 1, true, user))
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鏃犲鏍告潈闄愶紒";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
 
+            Int64 lngBillKey = 0;
+            lngBillKey = DBUtility.ClsPub.isLong(HInterID);
+            if (lngBillKey == 0)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鍗曟嵁ID涓虹┖锛�";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+            DLL.ClsSc_MouldProdOutBill oBill = new DLL.ClsSc_MouldProdOutBill();
+            if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))
+            {
+                if (flag == 1)
+                {
+                    if (oBill.omodel.HBillStatus == 2)
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "褰撳墠鍗曟嵁宸插鏍革紝鏃犻渶鍐嶆瀹℃牳";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    else
+                    {
+                        string HCheckDate = DateTime.Now.Date.ToString();
+                        oCn.RunProc(" Update Sc_MouldStockBillMain set HChecker='" + user + "',HCheckDate='" + HCheckDate + "',HBillStatus=2 Where HBillType='3828' and HInterID=" + HInterID);
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 1;
+                        objJsonResult.Message = "瀹℃牳鎴愬姛锛�";
+                        objJsonResult.data = 1;
+                        return objJsonResult;
+                    }
+                }
+                else
+                {
+                    if (oBill.omodel.HBillStatus == 1)
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "褰撳墠鍗曟嵁鏈鏍革紝鏃犻渶鍙嶅鏍�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    else
+                    {
+                        string HCheckDate = DateTime.Now.Date.ToString();
+                        oCn.RunProc(" Update Sc_MouldStockBillMain set HChecker=' ',HCheckDate=' ',HBillStatus=1 Where HBillType='3828' and HInterID=" + HInterID);
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 1;
+                        objJsonResult.Message = "鍙嶅鏍告垚鍔燂紒";
+                        objJsonResult.data = 1;
+                        return objJsonResult;
+                    }
+                }
+
+            }
+            else
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鍗曟嵁鏈壘鍒�";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
 
     }
 }

--
Gitblit v1.9.1