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_MouldRepairChangeBillController.cs |   85 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 85 insertions(+), 0 deletions(-)

diff --git a/WebAPI/Controllers/MJGL/Sc_MouldRepairChangeBillController.cs b/WebAPI/Controllers/MJGL/Sc_MouldRepairChangeBillController.cs
index 2bd0218..1e23516 100644
--- a/WebAPI/Controllers/MJGL/Sc_MouldRepairChangeBillController.cs
+++ b/WebAPI/Controllers/MJGL/Sc_MouldRepairChangeBillController.cs
@@ -16,6 +16,7 @@
         public DBUtility.ClsPub.Enum_BillStatus BillStatus;//鍗曟嵁鐘舵�侊紙鏂板锛屼慨鏀癸紝娴忚锛屾洿鏂板崟浠凤紝鍙樻洿锛�
         private json objJsonResult = new json();
         public DataSet ds = new DataSet();
+        public SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
         public DLL.ClsSc_MouldRepairChangeBill BillNew0 = new DLL.ClsSc_MouldRepairChangeBill();   //妯″叿鏀瑰埗鍑哄簱瀵瑰簲鍗曟嵁绫�
         public DLL.ClsSc_MouldRepairChangeBill BillOld0 = new DLL.ClsSc_MouldRepairChangeBill();   //妯″叿鏀瑰埗鍑哄簱瀵瑰簲鍗曟嵁绫�
 
@@ -562,5 +563,89 @@
             }
         }
         #endregion
+
+        #region 鍣ㄥ叿鏀瑰埗鐢宠鍗曞鏍�/鍙嶅鏍�
+        [Route("Sc_MouldRepairChangeHouseBill/AuditMouldRepairChangeBill")]
+        [HttpGet]
+        public object AuditMouldRepairChangeBill(string HInterID, string user, int flag)
+        {
+            //flag=1 瀹℃牳锛�  flag=2 鍙嶅鏍�
+            //缂栬緫鏉冮檺
+            if (!DBUtility.ClsPub.Security_Log_second("Sc_MouldRepairChangeBill_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_MouldRepairChangeBillMain set HChecker='" + user + "',HCheckDate='" + HCheckDate + "',HBillStatus=2 Where HBillType='3842' 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_MouldRepairChangeBillMain set HChecker=' ',HCheckDate=' ',HBillStatus=1 Where HBillType='3842' 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