From f4e89066f9119fac831b64f388516aeb01c7dd60 Mon Sep 17 00:00:00 2001
From: 沈泽 <211959439@qq.com>
Date: 星期三, 03 十一月 2021 16:59:04 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 WebAPI/Controllers/Sc_MouldRepairInBillListController - .cs |  453 ++++++++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 352 insertions(+), 101 deletions(-)

diff --git a/WebAPI/Controllers/Sc_MouldRepairInBillListController - .cs b/WebAPI/Controllers/Sc_MouldRepairInBillListController - .cs
index cef2724..3c0c023 100644
--- a/WebAPI/Controllers/Sc_MouldRepairInBillListController - .cs
+++ b/WebAPI/Controllers/Sc_MouldRepairInBillListController - .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();   //妯″叿鎶ュ簾鍏ュ簱瀵瑰簲鍗曟嵁绫�
@@ -4089,139 +4090,223 @@
         }
         #endregion
 
-        #region [妯″叿澶勭悊鍑哄簱鍗曞鏍搞�佸弽瀹℃牳]
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="HInterID">鍗曟嵁ID</param>
-        /// <param name="IsAudit">瀹℃牳(0),鍙嶅鏍�(1)</param>
-        /// <param name="CurUserName">瀹℃牳浜�</param>
-        /// <returns></returns>
-        [Route("Sc_MouldScrapOutHouseBill/AuditMouldScrapOutList")]
+        //#region [妯″叿澶勭悊鍑哄簱鍗曞鏍搞�佸弽瀹℃牳]
+        ///// <summary>
+        ///// 
+        ///// </summary>
+        ///// <param name="HInterID">鍗曟嵁ID</param>
+        ///// <param name="IsAudit">瀹℃牳(0),鍙嶅鏍�(1)</param>
+        ///// <param name="CurUserName">瀹℃牳浜�</param>
+        ///// <returns></returns>
+        //[Route("Sc_MouldScrapOutHouseBill/AuditMouldScrapOutList")]
+        //[HttpGet]
+        //public object AuditMouldScrapOutList(int HInterID, int IsAudit, string CurUserName)
+        //{
+        //    string ModRightNameCheck = "Sc_MouldScrapOutBill_Check";
+        //    DBUtility.ClsPub.CurUserName = CurUserName;
+        //    try
+        //    {
+        //        //瀹℃牳鏉冮檺
+        //        if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, true, CurUserName))
+        //        {
+        //            objJsonResult.code = "0";
+        //            objJsonResult.count = 0;
+        //            objJsonResult.Message = "瀹℃牳澶辫触锛佹棤鏉冮檺锛�";
+        //            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);
+        //        DLL.ClsSc_MouldScrapOutBill oBill = new DLL.ClsSc_MouldScrapOutBill();
+        //        //鏌ョ湅鏄惁宸插鏍�,鍏抽棴,浣滃簾
+        //        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 (IsAudit == 0)  //瀹℃牳鍒ゆ柇
+        //            {
+        //                if (oBill.omodel.HChecker.Trim() != "")
+        //                {
+        //                    objJsonResult.code = "0";
+        //                    objJsonResult.count = 0;
+        //                    objJsonResult.Message = "鍗曟嵁宸插鏍�!涓嶈兘鍐嶆瀹℃牳锛�";
+        //                    objJsonResult.data = null;
+        //                    return objJsonResult;
+        //                }
+        //            }
+        //            if (IsAudit == 1) //鍙嶅鏍稿垽鏂�
+        //            {
+        //                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 (IsAudit == 0) //瀹℃牳鎻愪氦
+        //        {
+        //            //瀹℃牳鎻愪氦
+        //            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 = "0";
+        //                objJsonResult.count = 0;
+        //                objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
+        //                objJsonResult.data = null;
+        //                return objJsonResult;
+        //            }
+        //        }
+        //        if (IsAudit == 1) //鍙嶅鏍告彁浜�
+        //        {
+        //            //鍙嶅鏍告彁浜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 = "0";
+        //                objJsonResult.count = 0;
+        //                objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
+        //                objJsonResult.data = null;
+        //                return objJsonResult;
+        //            }
+        //        }
+        //        return objJsonResult;
+        //    }
+        //    catch (Exception e)
+        //    {
+        //        objJsonResult.code = "0";
+        //        objJsonResult.count = 0;
+        //        objJsonResult.Message = "瀹℃牳澶辫触鎴栬�呭弽瀹℃牳澶辫触锛�" + e.ToString();
+        //        objJsonResult.data = null;
+        //        return objJsonResult;
+        //    }
+        //}
+        //#endregion
+
+        #region 鍣ㄥ叿澶勭悊鍑哄簱鍗曞鏍�/鍙嶅鏍�
+        [Route("Sc_MouldScrapOutHouseBill/AuditMouldScrapOutHouseBill")]
         [HttpGet]
-        public object AuditMouldScrapOutList(int HInterID, int IsAudit, string CurUserName)
+        public object AuditMouldScrapOutHouseBill(string HInterID, string user, int flag)
         {
-            string ModRightNameCheck = "Sc_MouldScrapOutBill_Check";
-            DBUtility.ClsPub.CurUserName = CurUserName;
-            try
+            //flag=1 瀹℃牳锛�  flag=2 鍙嶅鏍�
+            //缂栬緫鏉冮檺
+            if (!DBUtility.ClsPub.Security_Log_second("Sc_MouldScrapOutBill_Check", 1, true, user))
             {
-                //瀹℃牳鏉冮檺
-                if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, true, CurUserName))
+                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)
                 {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 0;
-                    objJsonResult.Message = "瀹℃牳澶辫触锛佹棤鏉冮檺锛�";
-                    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);
-                DLL.ClsSc_MouldScrapOutBill oBill = new DLL.ClsSc_MouldScrapOutBill();
-                //鏌ョ湅鏄惁宸插鏍�,鍏抽棴,浣滃簾
-                if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))
-                {
-                    if (oBill.omodel.HCloseMan.Trim() != "")
+                    if (oBill.omodel.HBillStatus == 2)
                     {
                         objJsonResult.code = "0";
                         objJsonResult.count = 0;
-                        objJsonResult.Message = "鍗曟嵁宸插叧闂�!涓嶈兘鍐嶆瀹℃牳锛�";
+                        objJsonResult.Message = "褰撳墠鍗曟嵁宸插鏍革紝鏃犻渶鍐嶆瀹℃牳";
                         objJsonResult.data = null;
                         return objJsonResult;
                     }
-                    if (oBill.omodel.HDeleteMan.Trim() != "")
+                    else
                     {
+                        string HCheckDate = DateTime.Now.Date.ToString();
+                        oCn.RunProc(" Update Sc_MouldStockBillMain set HChecker ='" + user + "',HCheckDate='" + HCheckDate + "',HBillStatus=2 Where HBillType='3832' and HInterID=" + HInterID);
                         objJsonResult.code = "0";
-                        objJsonResult.count = 0;
-                        objJsonResult.Message = "鍗曟嵁宸蹭綔搴�!涓嶈兘鍐嶆瀹℃牳锛�";
-                        objJsonResult.data = null;
+                        objJsonResult.count = 1;
+                        objJsonResult.Message = "瀹℃牳鎴愬姛锛�";
+                        objJsonResult.data = 1;
                         return objJsonResult;
-                    }
-                    if (IsAudit == 0)  //瀹℃牳鍒ゆ柇
-                    {
-                        if (oBill.omodel.HChecker.Trim() != "")
-                        {
-                            objJsonResult.code = "0";
-                            objJsonResult.count = 0;
-                            objJsonResult.Message = "鍗曟嵁宸插鏍�!涓嶈兘鍐嶆瀹℃牳锛�";
-                            objJsonResult.data = null;
-                            return objJsonResult;
-                        }
-                    }
-                    if (IsAudit == 1) //鍙嶅鏍稿垽鏂�
-                    {
-                        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 (IsAudit == 0) //瀹℃牳鎻愪氦
-                {
-                    //瀹℃牳鎻愪氦
-                    if (oBill.CheckBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
+                    if (oBill.omodel.HBillStatus == 1)
                     {
-                        objJsonResult.code = "1";
-                        objJsonResult.count = 1;
-                        objJsonResult.Message = "瀹℃牳鎴愬姛";
+                        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='3832' and HInterID=" + HInterID);
                         objJsonResult.code = "0";
-                        objJsonResult.count = 0;
-                        objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
-                        objJsonResult.data = null;
-                        return objJsonResult;
-                    }
-                }
-                if (IsAudit == 1) //鍙嶅鏍告彁浜�
-                {
-                    //鍙嶅鏍告彁浜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 = "0";
-                        objJsonResult.count = 0;
-                        objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
-                        objJsonResult.data = null;
+                        objJsonResult.Message = "鍙嶅鏍告垚鍔燂紒";
+                        objJsonResult.data = 1;
                         return objJsonResult;
                     }
                 }
-                return objJsonResult;
+
             }
-            catch (Exception e)
+            else
             {
                 objJsonResult.code = "0";
                 objJsonResult.count = 0;
-                objJsonResult.Message = "瀹℃牳澶辫触鎴栬�呭弽瀹℃牳澶辫触锛�" + e.ToString();
+                objJsonResult.Message = "鍗曟嵁鏈壘鍒�";
                 objJsonResult.data = null;
                 return objJsonResult;
             }
@@ -4573,6 +4658,89 @@
         }
         #endregion
 
+        #region 鍣ㄥ叿鐢熶骇閫�搴撳崟瀹℃牳/鍙嶅鏍�
+        [Route("Sc_MouldProdBackBill/AuditMouldProdBackBill")]
+        [HttpGet]
+        public object AuditMouldProdBackBill(string HInterID, string user, int flag)
+        {
+            //flag=1 瀹℃牳锛�  flag=2 鍙嶅鏍�
+            //缂栬緫鏉冮檺
+            if (!DBUtility.ClsPub.Security_Log_second("Sc_MouldProdBackBill_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='3803' 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='3803' 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
         #endregion
 
         #region 妯″叿棰嗙敤鍗�
@@ -4918,6 +5086,89 @@
         }
         #endregion
 
+        #region 鍣ㄥ叿棰嗙敤鍑哄簱鍗曞鏍�/鍙嶅鏍�
+        [Route("Sc_MouldProdOutBill/AuditMouldProdOutBill")]
+        [HttpGet]
+        public object AuditMouldProdOutBill(string HInterID, string user, int flag)
+        {
+            //flag=1 瀹℃牳锛�  flag=2 鍙嶅鏍�
+            //缂栬緫鏉冮檺
+            if (!DBUtility.ClsPub.Security_Log_second("Sc_MouldProdOutBill_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='3802' 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='3802' 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
         #endregion
 
         #region 妯″叿瀵垮懡璋冩暣鍗�

--
Gitblit v1.9.1