From de11f71014cb91222dc2ec9888d4a38acb855ce5 Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期四, 14 九月 2023 09:31:37 +0800
Subject: [PATCH] 工艺路线 工序流转卡 工序进出站 增加权限 子数据 报表 十张

---
 WebAPI/Controllers/JHGL/Gy_RoutingBillController.cs         |   14 
 WebAPI/Controllers/MateOutController.cs                     |   70 +++++
 WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs      |  188 +++++++++---
 WebAPI/Controllers/CJGL/Sc_ProcessExchangeBillController.cs |  146 ++++++++--
 WebAPI/Controllers/LMESController.cs                        |  202 +++++++++++---
 WebAPI/Controllers/CJGL/Cj_StationInBillController.cs       |  191 ++++++++++---
 6 files changed, 627 insertions(+), 184 deletions(-)

diff --git a/WebAPI/Controllers/CJGL/Cj_StationInBillController.cs b/WebAPI/Controllers/CJGL/Cj_StationInBillController.cs
index 5cbd86a..705fbcc 100644
--- a/WebAPI/Controllers/CJGL/Cj_StationInBillController.cs
+++ b/WebAPI/Controllers/CJGL/Cj_StationInBillController.cs
@@ -42,15 +42,30 @@
                 string OperationType = sArray[2].ToString();
                 string HComputerName = SystemInformation.ComputerName; //璁惧鍚嶇О
 
-                //鍒ゆ柇鏄惁鏈夌紪杈戞潈闄�
-                if (!DBUtility.ClsPub.Security_Log("Cj_StationInBill_Edit", 1, false, user))
+                if (OperationType == "5")
                 {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 0;
-                    objJsonResult.Message = "鏃犵紪杈戞潈闄�!";
-                    objJsonResult.data = null;
-                    return objJsonResult;
+                    //鍒ゆ柇鏄惁鏈夌紪杈戞潈闄�
+                    if (!DBUtility.ClsPub.Security_Log("Cj_StationInBill_Sub_Edit", 1, false, user))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "寮�宸ュ崟鏃犵紪杈戞潈闄�!";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
                 }
+                else {
+                    //鍒ゆ柇鏄惁鏈夌紪杈戞潈闄�
+                    if (!DBUtility.ClsPub.Security_Log("Cj_StationInBill_Edit", 1, false, user))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "杩涚珯鍗曟棤缂栬緫鏉冮檺!";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                }
+              
 
                 List<StationBill> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<StationBill>>(msg2);
                 long HMainInterID = 0;
@@ -534,20 +549,36 @@
         #region 杩斿洖宸ュ簭杩涚珯鎺ユ敹鍗曞垪琛�
         [Route("Cj_StationInBill/get_Display")]
         [HttpGet]
-        public object get_Display(string sWhere,string user)
+        public object get_Display(string sWhere,string user,string HBillSubType)
         {
             try
             {
                 List<object> columnNameList = new List<object>();
-                //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
-                if (!DBUtility.ClsPub.Security_Log("Cj_StationInBill_Query", 1, false, user))
+
+                if (HBillSubType == "SUB")
                 {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 0;
-                    objJsonResult.Message = "鏃犳煡璇㈡潈闄�!";
-                    objJsonResult.data = null;
-                    return objJsonResult;
+                    //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
+                    if (!DBUtility.ClsPub.Security_Log("Cj_StationInBill_Sub_Query", 1, false, user))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "寮�宸ュ崟鏃犳煡璇㈡潈闄�!";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
                 }
+                else {
+                    //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
+                    if (!DBUtility.ClsPub.Security_Log("Cj_StationInBill_Query", 1, false, user))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "杩涚珯鍗曟棤鏌ヨ鏉冮檺!";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                }
+              
 
                 if (sWhere == null || sWhere.Equals(""))
                 {
@@ -680,20 +711,36 @@
         #region 瀹℃牳
         [Route("Cj_StationInBill/set_CheckBill")]
         [HttpGet]
-        public object set_CheckBill(int HInterID,string CurUserName)
+        public object set_CheckBill(int HInterID,string CurUserName,string HBillSubType)
         {
             try
             {
-                string ModRightNameCheck = "Cj_StationInBill_Check";
-                //瀹℃牳鏉冮檺
-                if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, false,CurUserName))
+                string ModRightNameCheck = "";
+
+                if (HBillSubType == "SUB")
                 {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 0;
-                    objJsonResult.Message = "瀹℃牳澶辫触锛佹棤鏉冮檺锛�";
-                    objJsonResult.data = null;
-                    return objJsonResult;
+                    //瀹℃牳鏉冮檺
+                    if (!DBUtility.ClsPub.Security_Log("Cj_StationInBill_Sub_Check", 1, false, CurUserName))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "寮�宸ュ崟瀹℃牳澶辫触锛佹棤鏉冮檺锛�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
                 }
+                else {
+                    //瀹℃牳鏉冮檺
+                    if (!DBUtility.ClsPub.Security_Log("Cj_StationInBill_Check", 1, false, CurUserName))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "杩涚珯鍗曞鏍稿け璐ワ紒鏃犳潈闄愶紒";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                }
+              
                 if (HInterID == 0)
                 {
                     objJsonResult.code = "0";
@@ -797,20 +844,36 @@
         #region 鍙嶅鏍�
         [Route("Cj_StationInBill/set_AbandonCheck")]
         [HttpGet]
-        public object set_AbandonCheck(int HInterID, string CurUserName)
+        public object set_AbandonCheck(int HInterID, string CurUserName, string HBillSubType)
         {
             try
             {
-                string ModRightNameCheck = "Cj_StationInBill_Check";
-                //瀹℃牳鏉冮檺
-                if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, false, CurUserName))
+                if (HBillSubType == "SUB")
                 {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 0;
-                    objJsonResult.Message = "鍙嶅鏍稿け璐ワ紒鏃犳潈闄愶紒";
-                    objJsonResult.data = null;
-                    return objJsonResult;
+                    //瀹℃牳鏉冮檺
+                    if (!DBUtility.ClsPub.Security_Log("Cj_StationInBill_Sub_Check", 1, false, CurUserName))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "寮�宸ュ崟鍙嶅鏍稿け璐ワ紒鏃犳潈闄愶紒";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
                 }
+                else
+                {
+                    //瀹℃牳鏉冮檺
+                    if (!DBUtility.ClsPub.Security_Log("Cj_StationInBill_Check", 1, false, CurUserName))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "杩涚珯鍗曞弽瀹℃牳澶辫触锛佹棤鏉冮檺锛�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                }
+
+              
 
                 if (HInterID == 0)
                 {
@@ -942,19 +1005,34 @@
         #region 宸ュ簭杩涚珯鍏抽棴/鍙嶅叧闂姛鑳�
         [Route("Cj_StationInBill/CloseCj_StationInBill")]
         [HttpGet]
-        public object CloseSc_StationInBill(string HInterID, int Type, string user)
+        public object CloseSc_StationInBill(string HInterID, int Type, string user,string HBillSubType)
         {
             try
             {
-                //鍒ゆ柇鏄惁鏈夊垹闄ゆ潈闄�
-                if (!DBUtility.ClsPub.Security_Log("Cj_StationInBill_Close", 1, false, user))
+                if (HBillSubType == "SUB")
                 {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 0;
-                    objJsonResult.Message = "鏃犳潈闄愬叧闂�!";
-                    objJsonResult.data = null;
-                    return objJsonResult;
+                    //鍒ゆ柇鏄惁鏈夊垹闄ゆ潈闄�
+                    if (!DBUtility.ClsPub.Security_Log("Cj_StationInBill_Sub_Close", 1, false, user))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "寮�宸ュ崟鏃犳潈闄愬叧闂�!";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
                 }
+                else {
+                    //鍒ゆ柇鏄惁鏈夊垹闄ゆ潈闄�
+                    if (!DBUtility.ClsPub.Security_Log("Cj_StationInBill_Close", 1, false, user))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "杩涚珯鍗曟棤鏉冮檺鍏抽棴!";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                }
+               
 
                 if (string.IsNullOrWhiteSpace(HInterID))
                 {
@@ -1094,20 +1172,35 @@
         #region 鏍规嵁id鍒犻櫎杩涚珯鍗�
         [Route("Cj_StationInBill/del_StationInBill")]
         [HttpGet]
-        public object del_StationInBill(long HInterID,string HDeleteMan)
+        public object del_StationInBill(long HInterID,string HDeleteMan,string HBillSubType)
         {
             try
             {
                 string HComputerName = SystemInformation.ComputerName; //璁惧鍚嶇О
-                //缂栬緫鏉冮檺
-                if (!DBUtility.ClsPub.Security_Log("Cj_StationInBill_Drop", 1, false, HDeleteMan))
+                if (HBillSubType == "SUB")
                 {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 0;
-                    objJsonResult.Message = "鏃犳潈闄愶紒";
-                    objJsonResult.data = null;
-                    return objJsonResult;
+                    //缂栬緫鏉冮檺
+                    if (!DBUtility.ClsPub.Security_Log("Cj_StationInBill_Sub_Drop", 1, false, HDeleteMan))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "寮�宸ュ崟鏃犳潈闄愶紒";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
                 }
+                else {
+                    //缂栬緫鏉冮檺
+                    if (!DBUtility.ClsPub.Security_Log("Cj_StationInBill_Drop", 1, false, HDeleteMan))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "杩涚珯鎺ユ敹鍗曟棤鏉冮檺锛�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                }
+              
                 DAL.ClsSc_StationInBill oBill = new DAL.ClsSc_StationInBill();
                 if (oBill.ShowBill(HInterID, ref DBUtility.ClsPub.sExeReturnInfo))
                 {
diff --git a/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs b/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs
index fbe4b72..d1d7e04 100644
--- a/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs
+++ b/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs
@@ -44,15 +44,30 @@
                 string OperationType = sArray[2].ToString();//绫诲瀷
                 string HComputerName = SystemInformation.ComputerName; //璁惧鍚嶇О
 
-                //鍒ゆ柇鏄惁鏈夌紪杈戞潈闄�
-                if (!DBUtility.ClsPub.Security_Log("Cj_StationOutBill_Edit", 1, false, user))
+                if (OperationType == "5")
                 {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 0;
-                    objJsonResult.Message = "鏃犵紪杈戞潈闄�!";
-                    objJsonResult.data = null;
-                    return objJsonResult;
+                    //鍒ゆ柇鏄惁鏈夌紪杈戞潈闄�
+                    if (!DBUtility.ClsPub.Security_Log("Cj_StationOutBill_Sub_Edit", 1, false, user))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "瀹屽伐鍗曟棤缂栬緫鏉冮檺!";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
                 }
+                else {
+                    //鍒ゆ柇鏄惁鏈夌紪杈戞潈闄�
+                    if (!DBUtility.ClsPub.Security_Log("Cj_StationOutBill_Edit", 1, false, user))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍑虹珯鍗曟棤缂栬緫鏉冮檺!";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                }
+               
 
                 Stopwatch sw = new Stopwatch();
                 sw.Start();//寮�濮嬭鏃�
@@ -1500,20 +1515,35 @@
         #region 杩斿洖宸ュ簭鍑虹珯姹囨姤鍗曞垪琛�
         [Route("Cj_StationOutBill/get_Display")]
         [HttpGet]
-        public object get_Display(string sWhere,string user)
+        public object get_Display(string sWhere,string user,string HBillSubType)
         {
             try
             {
                 List<object> columnNameList = new List<object>();
-                //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
-                if (!DBUtility.ClsPub.Security_Log("Cj_StationOutBill_Query", 1, false, user))
+                if (HBillSubType == "SUB")
                 {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 0;
-                    objJsonResult.Message = "鏃犳煡璇㈡潈闄�!";
-                    objJsonResult.data = null;
-                    return objJsonResult;
+                    //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
+                    if (!DBUtility.ClsPub.Security_Log("Cj_StationOutBill_Sub_Query", 1, false, user))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "瀹屽伐鍗曟棤鏌ヨ鏉冮檺!";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
                 }
+                else {
+                    //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
+                    if (!DBUtility.ClsPub.Security_Log("Cj_StationOutBill_Query", 1, false, user))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍑虹珯鍗曟棤鏌ヨ鏉冮檺!";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                }
+               
 
                 //鑾峰彇绯荤粺鍙傛暟
                 string Ret = "";
@@ -1942,20 +1972,35 @@
         #region 鏍规嵁id鍒犻櫎鍑虹珯鍗�
         [Route("Cj_StationOutBill/del_StationOutBill")]
         [HttpGet]
-        public object del_StationOutBill(long HInterID, string HDeleteMan)
+        public object del_StationOutBill(long HInterID, string HDeleteMan,string HBillSubType)
         {
             try
             {
                 string HComputerName = SystemInformation.ComputerName; //璁惧鍚嶇О
-                //缂栬緫鏉冮檺
-                if (!DBUtility.ClsPub.Security_Log("Cj_StationOutBill_Drop", 1, false, HDeleteMan))
+                if (HBillSubType == "SUB")
                 {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 0;
-                    objJsonResult.Message = "鏃犳潈闄愶紒";
-                    objJsonResult.data = null;
-                    return objJsonResult;
+                    //缂栬緫鏉冮檺
+                    if (!DBUtility.ClsPub.Security_Log("Cj_StationOutBill_Sub_Drop", 1, false, HDeleteMan))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "瀹屽伐鍗曟棤鏉冮檺锛�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
                 }
+                else {
+                    //缂栬緫鏉冮檺
+                    if (!DBUtility.ClsPub.Security_Log("Cj_StationOutBill_Drop", 1, false, HDeleteMan))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍑虹珯鍗曟棤鏉冮檺锛�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                }
+               
                 DAL.ClsSc_StationOutBill oBill = new DAL.ClsSc_StationOutBill();
                 if (oBill.ShowBill(HInterID, ref DBUtility.ClsPub.sExeReturnInfo))
                 {
@@ -2171,20 +2216,35 @@
         #region 瀹℃牳
         [Route("Cj_StationOutBill/set_CheckBill")]
         [HttpGet]
-        public object set_CheckBill(string HInterID, string CurUserName)
+        public object set_CheckBill(string HInterID, string CurUserName,string HBillSubType)
         {
             try
             {
-                string ModRightNameCheck = "Cj_StationOutBill_Check";
-                ////瀹℃牳鏉冮檺
-                if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, false, CurUserName))
+                if (HBillSubType == "SUB")
                 {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 0;
-                    objJsonResult.Message = "瀹℃牳澶辫触锛佹棤鏉冮檺锛�";
-                    objJsonResult.data = null;
-                    return objJsonResult;
+                    ////瀹℃牳鏉冮檺
+                    if (!DBUtility.ClsPub.Security_Log("Cj_StationOutBill_Sub_Check", 1, false, CurUserName))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "瀹屽伐鍗曞鏍稿け璐ワ紒鏃犳潈闄愶紒";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
                 }
+                else
+                {   ////瀹℃牳鏉冮檺
+                    if (!DBUtility.ClsPub.Security_Log("Cj_StationOutBill_Check", 1, false, CurUserName))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍑虹珯鍗曞鏍稿け璐ワ紒鏃犳潈闄愶紒";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                }
+              
+            
                 var HBillNo = HInterID.Split(',');
                 DAL.ClsSc_StationOutBill oBill = new DAL.ClsSc_StationOutBill();
 
@@ -2299,20 +2359,35 @@
         #region 鍙嶅鏍�
         [Route("Cj_StationOutBill/set_AbandonCheck")]
         [HttpGet]
-        public object set_AbandonCheck(string HInterID, string CurUserName)
+        public object set_AbandonCheck(string HInterID, string CurUserName,string HBillSubType)
         {
             try
             {
-                string ModRightNameCheck = "Cj_StationOutBill_Check";
-                ////瀹℃牳鏉冮檺
-                if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, false, CurUserName))
+                if (HBillSubType == "SUB")
                 {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 0;
-                    objJsonResult.Message = "鍙嶅鏍稿け璐ワ紒鏃犳潈闄愶紒";
-                    objJsonResult.data = null;
-                    return objJsonResult;
+                    ////瀹℃牳鏉冮檺
+                    if (!DBUtility.ClsPub.Security_Log("Cj_StationOutBill_Sub_Check", 1, false, CurUserName))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "瀹屽伐鍗曞弽瀹℃牳澶辫触锛佹棤鏉冮檺锛�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
                 }
+                else
+                {
+                    ////瀹℃牳鏉冮檺
+                    if (!DBUtility.ClsPub.Security_Log("Cj_StationOutBill_Check", 1, false, CurUserName))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍑虹珯鍗曞弽瀹℃牳澶辫触锛佹棤鏉冮檺锛�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                }
+              
 
                 var HBillNo = HInterID.Split(',');
                 DAL.ClsSc_StationOutBill oBill = new DAL.ClsSc_StationOutBill();
@@ -2451,19 +2526,34 @@
         #region 宸ュ簭鍑虹珯鍏抽棴/鍙嶅叧闂姛鑳�
         [Route("Cj_StationOutBill/CloseCj_StationOutBill")]
         [HttpGet]
-        public object CloseCj_StationOutBill(string HInterID, int Type, string user)
+        public object CloseCj_StationOutBill(string HInterID, int Type, string user,string HBillSubType)
         {
             try
             {
-                //鍒ゆ柇鏄惁鏈夊垹闄ゆ潈闄�
-                if (!DBUtility.ClsPub.Security_Log("Cj_StationOutBill_Close", 1, false, user))
+                if (HBillSubType == "SUB")
                 {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 0;
-                    objJsonResult.Message = "鏃犳潈闄愬叧闂�!";
-                    objJsonResult.data = null;
-                    return objJsonResult;
+                    //鍒ゆ柇鏄惁鏈夊垹闄ゆ潈闄�
+                    if (!DBUtility.ClsPub.Security_Log("Cj_StationOutBill_Sub_Close", 1, false, user))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "瀹屽伐鍗曟棤鏉冮檺鍏抽棴!";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
                 }
+                else {
+                    //鍒ゆ柇鏄惁鏈夊垹闄ゆ潈闄�
+                    if (!DBUtility.ClsPub.Security_Log("Cj_StationOutBill_Close", 1, false, user))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍑虹珯鍗曟棤鏉冮檺鍏抽棴!";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                }
+               
 
                 if (string.IsNullOrWhiteSpace(HInterID))
                 {
diff --git a/WebAPI/Controllers/CJGL/Sc_ProcessExchangeBillController.cs b/WebAPI/Controllers/CJGL/Sc_ProcessExchangeBillController.cs
index 22547e6..d38a608 100644
--- a/WebAPI/Controllers/CJGL/Sc_ProcessExchangeBillController.cs
+++ b/WebAPI/Controllers/CJGL/Sc_ProcessExchangeBillController.cs
@@ -40,7 +40,7 @@
             string msg3 = sArray[1].ToString();
             string msg4 = sArray[2].ToString();
             string msg5 = sArray[3].ToString();
-            string OperationType = sArray[4].ToString();
+            string HBillSubType = sArray[4].ToString();
             string HComputerName = SystemInformation.ComputerName; //璁惧鍚嶇О    
 
             string UserName = "";
@@ -48,14 +48,28 @@
             
             try
             {
-                if (!DBUtility.ClsPub.Security_Log("Sc_ProcessExchangeBill_Edit", 1, false, msg4))
+                if (HBillSubType == "SUB")
                 {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 0;
-                    objJsonResult.Message = "鏃犱繚瀛樻潈闄愶紒";
-                    objJsonResult.data = null;
-                    return objJsonResult;
+                    if (!DBUtility.ClsPub.Security_Log("Sc_ProcessExchangeBill_Sub_Edit", 1, false, msg4))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鎸囧紩鍗℃棤淇濆瓨鏉冮檺锛�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
                 }
+                else {
+                    if (!DBUtility.ClsPub.Security_Log("Sc_ProcessExchangeBill_Edit", 1, false, msg4))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "娴佽浆鍗℃棤淇濆瓨鏉冮檺锛�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                }
+               
                 DBUtility.ClsPub.CurUserName = msg4;
                 DAL.ClsSc_ProcessExchangeBill oBill = new DAL.ClsSc_ProcessExchangeBill();
                 List<Model.ClsSc_ProcessExchangeBillMain> lsmain = new List<Model.ClsSc_ProcessExchangeBillMain>();
@@ -66,10 +80,10 @@
                 {
                     UserName = oItem.HMaker;  //鍒跺崟浜�
                     oItem.HBillType = "3772";
-                    oItem.HBillSubType = OperationType=="5"?"SUB":"3772";
+                    oItem.HBillSubType = HBillSubType == "SUB" ? HBillSubType : "3772";
                     oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
                     oItem.HPeriod = DBUtility.ClsPub.isLong(DateTime.Now.Month);
-                    oItem.HDate = OperationType == "5" ? DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")) : oItem.HDate;
+                    oItem.HDate = HBillSubType == "SUB" ? DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")) : oItem.HDate;
                     if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "")
                     {
                         objJsonResult.code = "0";
@@ -831,17 +845,33 @@
         /// <returns></returns>
         [Route("Sc_ProcessExchangeBill/DeltetProcessExchangeBillByID")]
         [HttpGet]
-        public object DeltetProcessExchangeBillByID(string HInterID, int HPRDORGID, string user)
+        public object DeltetProcessExchangeBillByID(string HInterID, int HPRDORGID, string user, string HSouceBillType)
         {
-            //缂栬緫鏉冮檺
-            if (!DBUtility.ClsPub.Security_Log("Sc_ProcessExchangeBill_Drop", 1, false, user))
+
+            if (HSouceBillType == "SUB")
             {
-                objJsonResult.code = "0";
-                objJsonResult.count = 0;
-                objJsonResult.Message = "鏃犲垹闄ゆ潈闄愶紒";
-                objJsonResult.data = null;
-                return objJsonResult;
+                //缂栬緫鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log("Sc_ProcessExchangeBill_Sub_Drop", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鎸囧紩鍗℃棤鍒犻櫎鏉冮檺锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
             }
+            else {
+                //缂栬緫鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log("Sc_ProcessExchangeBill_Drop", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娴佽浆鍗℃棤鍒犻櫎鏉冮檺锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+            }
+          
 
             string HComputerName = SystemInformation.ComputerName; //璁惧鍚嶇О    
 
@@ -937,15 +967,34 @@
 
             foreach (var item in HBillNo)
             {
+                oCN.BeginTran();
+                if (HSouceBillType == "SUB") {
+                    ds = oCN.RunProcReturn("select  * from Sc_ProcessExchangeBillMain where HInterID=" + item, "Sc_ProcessExchangeBillMain");
+
+                    if (ds.Tables[0].Rows.Count == 0) {
+                        oCN.RollBack();
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鏃犳祦杞崱鏁版嵁!";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+
+                    oCN.RunProc("update Sc_ProcessExchangeBillSub set HSourceID=0 where HInterID=" + ds.Tables[0].Rows[0]["HMainSourceInterID"].ToString() + " and HEntryID=" + ds.Tables[0].Rows[0]["HMainSourceEntryID"].ToString());
+                }
+
                 bool IsDete = oBill.DeleteBill(long.Parse(item), ref DBUtility.ClsPub.sExeReturnInfo);
+
                 if (!IsDete)
                 {
+                    oCN.RollBack();
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
                     objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo;
                     objJsonResult.data = null;
                     return objJsonResult;
                 }
+                oCN.Commit();
             }
 
             if (oSystemParameter.omodel.WMS_CampanyName == "鐟炰笌绁�")
@@ -1277,19 +1326,34 @@
         #region 宸ュ簭娴佽浆鍗″鏍�/鍙嶅鏍稿姛鑳�
         [Route("Sc_ProcessExchangeBill/CheckSc_ProcessExchangeBill")]
         [HttpGet]
-        public object CheckSc_ProcessExchangeBill(string HInterID, int Type, string user)
+        public object CheckSc_ProcessExchangeBill(string HInterID, int Type, string user,string HBillSubType)
         {
             try
             {
-                //鍒ゆ柇鏄惁鏈夊垹闄ゆ潈闄�
-                if (!DBUtility.ClsPub.Security_Log("Sc_ProcessExchangeBill_Check", 1, false, user))
+                if (HBillSubType == "SUB")
                 {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 0;
-                    objJsonResult.Message = "鏃犳潈闄愬鏍�!";
-                    objJsonResult.data = null;
-                    return objJsonResult;
+                    //鍒ゆ柇鏄惁鏈夊垹闄ゆ潈闄�
+                    if (!DBUtility.ClsPub.Security_Log("Sc_ProcessExchangeBill_Check", 1, false, user))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鎸囧紩鍗℃棤鏉冮檺瀹℃牳!";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
                 }
+                else {
+                    //鍒ゆ柇鏄惁鏈夊垹闄ゆ潈闄�
+                    if (!DBUtility.ClsPub.Security_Log("Sc_ProcessExchangeBill_Sub_Check", 1, false, user))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "娴佽浆鍗℃棤鏉冮檺瀹℃牳!";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                }
+               
 
                 if (string.IsNullOrWhiteSpace(HInterID))
                 {
@@ -1396,19 +1460,35 @@
         #region 宸ュ簭娴佽浆鍗″叧闂�/鍙嶅叧闂姛鑳�
         [Route("Sc_ProcessExchangeBill/CloseSc_ProcessExchangeBill")]
         [HttpGet]
-        public object CloseSc_ProcessExchangeBill(string HInterID, int Type, string user)
+        public object CloseSc_ProcessExchangeBill(string HInterID, int Type, string user,string HBillSubType)
         {
             try
             {
-                //鍒ゆ柇鏄惁鏈夊垹闄ゆ潈闄�
-                if (!DBUtility.ClsPub.Security_Log("Sc_ProcessExchangeBill_Close", 1, false, user))
+                if (HBillSubType == "SUB")
                 {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 0;
-                    objJsonResult.Message = "鏃犳潈闄愬叧闂�!";
-                    objJsonResult.data = null;
-                    return objJsonResult;
+                    //鍒ゆ柇鏄惁鏈夊垹闄ゆ潈闄�
+                    if (!DBUtility.ClsPub.Security_Log("Sc_ProcessExchangeBill_Sub_Close", 1, false, user))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鎸囧紩鍗℃棤鏉冮檺鍏抽棴!";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
                 }
+                else
+                {
+                    //鍒ゆ柇鏄惁鏈夊垹闄ゆ潈闄�
+                    if (!DBUtility.ClsPub.Security_Log("Sc_ProcessExchangeBill_Close", 1, false, user))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "娴佽浆鍗℃棤鏉冮檺鍏抽棴!";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                }
+              
 
                 if (string.IsNullOrWhiteSpace(HInterID))
                 {
diff --git a/WebAPI/Controllers/JHGL/Gy_RoutingBillController.cs b/WebAPI/Controllers/JHGL/Gy_RoutingBillController.cs
index 6bd8c6b..17c2d00 100644
--- a/WebAPI/Controllers/JHGL/Gy_RoutingBillController.cs
+++ b/WebAPI/Controllers/JHGL/Gy_RoutingBillController.cs
@@ -132,17 +132,17 @@
             string user = sArray[3].ToString();//鐢ㄦ埛鍚�
             string HComputerName = SystemInformation.ComputerName; //璁惧鍚嶇О
             user_LongShan = sArray[3].ToString();//鐢ㄦ埛鍚�
-            string HSouceBillType = sArray[4].ToString();//鐢ㄦ埛鍚�
+            string HBillSubType = sArray[4].ToString();//鍗曟嵁瀛愮被鍨�
             try
             {
-                if (HSouceBillType == "")
+                if (HBillSubType == "3301")
                 {
                     //鍒ゆ柇鏄惁鏈夌紪杈戞潈闄�
                     if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_Edit", 1, false, user))
                     {
                         objJsonResult.code = "0";
                         objJsonResult.count = 0;
-                        objJsonResult.Message = "鏃犳潈闄愮紪杈�!";
+                        objJsonResult.Message = "宸ヨ壓璺嚎鏃犳潈闄愮紪杈�!";
                         objJsonResult.data = null;
                         return objJsonResult;
                     }
@@ -154,7 +154,7 @@
                     {
                         objJsonResult.code = "0";
                         objJsonResult.count = 0;
-                        objJsonResult.Message = "鏃犳潈闄愮紪杈�!";
+                        objJsonResult.Message = "瀛愬伐鑹鸿矾绾挎棤鏉冮檺缂栬緫!";
                         objJsonResult.data = null;
                         return objJsonResult;
                     }
@@ -257,7 +257,7 @@
 
                 ds = oCN.RunProcReturn("select * from h_v_Gy_RoutingBillList where hmainid=" + HInterID + " and 鍗曟嵁鍙�='" + HBillNo + "'", "h_v_Gy_RoutingBillList");
 
-                if ((OperationType == 1 || OperationType == 2|| OperationType == 4) && ds.Tables[0].Rows.Count == 0)//鏂板
+                if ((OperationType == 1 || OperationType == 2) && ds.Tables[0].Rows.Count == 0)//鏂板
                 {
                     //涓昏〃
                     oCN.RunProc("Insert Into Gy_RoutingBillMain   " +
@@ -267,7 +267,7 @@
                     ",HMainGroupID,HMainProcID,HMainCenterID,HMainTimeUnit,HMainUnitTime,HMainWorkQty" +
                     ",HMainPrice,HStdSourceQty,HAddSourceRate,HPRDORGID,HDelSourceRate" +
                     ",HPicNumVer,HPicNumAssemble,HMaterTexture,HProductNum,HVerNum,HOrgID) " + 
-                    " values('" + BillType + "','"+ HSouceBillType + "'," + HInterID + ",'" + HBillNo + "','" + HDate + "'" +
+                    " values('" + BillType + "','"+ HBillSubType + "'," + HInterID + ",'" + HBillNo + "','" + HDate + "'" +
                     "," + HYear + "," + HPeriod + ",'" + HRemark + "','" + HMaker + "',getdate()," + HMaterID + ",'" + HName + "'," + HMaterTypeID +
                     "," + HRoutingGroupID + "," + HUnitID + ",'" + HMaterNumber + "','" + HUnitNumber + "'," + Convert.ToString(HStandard ? 1 : 0) +
                     "," + HMainGroupID + "," + HMainProcID + "," + HMainCenterID + ",'" + HMainTimeUnit + "'," + HMainUnitTime + "," + HMainWorkQty +
@@ -326,7 +326,7 @@
                         oCN.RunProc("exec Gy_RoutingBill_LastProNo " + HInterID);
                     }
                 }
-                else if (IsProNo == 1 && (OperationType == 1 || OperationType == 4))
+                else if (IsProNo == 1 && (OperationType == 1))
                 {
                     ds = oCN.RunProcReturn("select * from Gy_Process Where HTProcessFlag = 1 and HNumber='9999' ", "Gy_Process");
 
diff --git a/WebAPI/Controllers/LMESController.cs b/WebAPI/Controllers/LMESController.cs
index 942bf90..58bc4ee 100644
--- a/WebAPI/Controllers/LMESController.cs
+++ b/WebAPI/Controllers/LMESController.cs
@@ -58,20 +58,35 @@
         /// </summary>
         [Route("LEMS/MES_Sc_ProcessExchangeBillQuery_Json")]
         [HttpGet]
-        public object MES_Sc_ProcessExchangeBillList_Json(string sWhere, string user)
+        public object MES_Sc_ProcessExchangeBillList_Json(string sWhere, string user,string HBillSubType)
         {
             DataSet ds;
             try
             {
                 List<object> columnNameList = new List<object>();
-                //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
-                if (!DBUtility.ClsPub.Security_Log("Sc_ProcessExchangeBill_Query", 1, false, user))
+                if (HBillSubType == "SUB")
                 {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 0;
-                    objJsonResult.Message = "鏃犳煡璇㈡潈闄�!";
-                    objJsonResult.data = null;
-                    return objJsonResult;
+                    //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
+                    if (!DBUtility.ClsPub.Security_Log("Sc_ProcessExchangeBill_SubQuery", 1, false, user))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鎸囧紩鍗℃棤鏌ヨ鏉冮檺!";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                }
+                else {
+
+                    //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
+                    if (!DBUtility.ClsPub.Security_Log("Sc_ProcessExchangeBill_Query", 1, false, user))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "娴佽浆鍗℃棤鏌ヨ鏉冮檺!";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
                 }
 
                 //鑾峰彇绯荤粺鍙傛暟
@@ -211,11 +226,21 @@
         {
             DataSet ds;
             DataSet ds1;
+            DataSet ds2;
             try
             {
+                if (!DBUtility.ClsPub.Security_Log("Sc_ProcessExchangeBill_Sub_Edit", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鎸囧紩鍗℃棤缂栬緫鏉冮檺锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
                 var HNum = HInterID_S.Split(',');
 
-                oCN.BeginTran();
+               
 
                 for (int j = 0; j < HNum.Length; j++)
                 {
@@ -236,12 +261,21 @@
                     string HMaterID = ds.Tables[0].Rows[0]["HMaterID"].ToString();
                     string HProcID = ds.Tables[0].Rows[0]["HProcID"].ToString();
 
+                    ds2 = oCN.RunProcReturn(@"select  a.HMaterID,a.HMainProcID,b.* from Gy_RoutingBillMain a 	inner join Gy_RoutingBillSub b on a.HInterID=b.HInterID where a.HMaterID=" + HMaterID + " and a.HMainProcID=" + HProcID + " and a.HBillSubType='SUB'", "Gy_RoutingBillMain");
+                    if (ds2.Tables[0].Rows.Count == 0)
+                    {
+                        long HGYInterID = DBUtility.ClsPub.CreateBillID("3301", ref DBUtility.ClsPub.sExeReturnInfo);
+                        string HGYBillNo = DBUtility.ClsPub.CreateBillCode("3301", ref DBUtility.ClsPub.sExeReturnInfo, true);
+                        oCN.RunProc("exec h_p_gy_Materl_PG " + HGYInterID + ",'" + HGYBillNo + "'," + HMaterID);
+                    }
+                   
+
                     ds1 = oCN.RunProcReturn(@"select  a.HMaterID,a.HMainProcID,b.* from Gy_RoutingBillMain a 	inner join Gy_RoutingBillSub b on a.HInterID=b.HInterID where a.HMaterID=" + HMaterID + " and a.HMainProcID=" + HProcID + " and a.HBillSubType='SUB'", "Gy_RoutingBillMain");
                     if (ds1.Tables[0].Rows.Count == 0)
                     {
                         objJsonResult.code = "0";
                         objJsonResult.count = 0;
-                        objJsonResult.Message = "娌℃湁鐩稿搴旂殑榛樿宸ヨ壓璺嚎,璇峰厛璁剧疆宸ヨ壓璺嚎锛�";
+                        objJsonResult.Message = "鏃犻粯璁ゅ伐鑹鸿矾绾匡紒";
                         objJsonResult.data = null;
                         return objJsonResult;
                     }
@@ -250,6 +284,8 @@
                     string sReturn = "";
                     DBUtility.ClsPub.HOrgID = HOrgID;
                     oBill.ShowBill(HInterID, ref sReturn);
+
+                    oCN.BeginTran();
 
                     long HInterID1 = DBUtility.ClsPub.CreateBillID(oBill.omodel.HBillType, ref DBUtility.ClsPub.sExeReturnInfo);
                     string HBillNo = DBUtility.ClsPub.CreateBillCode(oBill.omodel.HBillType, ref DBUtility.ClsPub.sExeReturnInfo, true);
@@ -285,7 +321,6 @@
                         oBill.DetailColl.Add(oSub);
                     }
 
-
                     bool bResult = false;
                     bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
 
@@ -300,9 +335,10 @@
                         objJsonResult.data = null;
                         return objJsonResult;
                     }
+                    oCN.Commit();
                 }
 
-                oCN.Commit();
+              
                 objJsonResult.code = "1";
                 objJsonResult.count = 1;
                 objJsonResult.Message = "娲惧伐鎴愬姛锛�";
@@ -330,6 +366,15 @@
             DataSet ds1;
             try
             {
+                if (!DBUtility.ClsPub.Security_Log("Sc_ProcessExchangeBill_Sub_Edit", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鎸囧紩鍗℃棤缂栬緫鏉冮檺锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
                 var HNum = HInterID_S.Split(',');
 
                 oCN.BeginTran();
@@ -658,20 +703,38 @@
         /// </summary>
         [Route("LEMS/MES_Gy_RoutingBillList_Json")]
         [HttpGet]
-        public object MES_Gy_RoutingBillList_Json(string sWhere, string user)
+        public object MES_Gy_RoutingBillList_Json(string sWhere, string user,string HBillSubType)
         {
             DataSet ds;
             try
             {
-                //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
-                if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_Query", 1, false, user))
+                if (HBillSubType == "SUB")
                 {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 0;
-                    objJsonResult.Message = "鏃犳潈闄愭煡璇�!";
-                    objJsonResult.data = null;
-                    return objJsonResult;
+                    //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
+                    if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_Sub_Query", 1, false, user))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "瀛愬伐鑹鸿矾绾挎棤鏉冮檺鏌ヨ!";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+
                 }
+                else {
+
+                    //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
+                    if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_Query", 1, false, user))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "宸ヨ壓璺嚎鏃犳潈闄愭煡璇�!";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+
+                }
+
 
                 //鑾峰彇绯荤粺鍙傛暟
                 string Ret = "";
@@ -885,22 +948,37 @@
         /// <returns></returns>
         [Route("LEMS/DeltetGy_RoutingBillSub")]
         [HttpGet]
-        public object DeltetGy_RoutingBillSub(Int64 lngBillKey, string user)
+        public object DeltetGy_RoutingBillSub(Int64 lngBillKey, string user,string HBillSubType)
         {
             DataSet ds;
-            string ModRightNameCheck = "Gy_RoutingBill_Drop";
+           
             try
             {
-                string HComputerName = SystemInformation.ComputerName; //璁惧鍚嶇О
-                //鍒犻櫎鏉冮檺
-                if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, false, user))
+                if (HBillSubType == "SUB")
                 {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 0;
-                    objJsonResult.Message = "鍒犻櫎澶辫触锛佹棤鏉冮檺锛�";
-                    objJsonResult.data = null;
-                    return objJsonResult;
+                    //鍒犻櫎鏉冮檺
+                    if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_Sub_Drop", 1, false, user))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "瀛愬伐鑹鸿矾绾垮垹闄ゅけ璐ワ紒鏃犳潈闄愶紒";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
                 }
+                else {
+                    //鍒犻櫎鏉冮檺
+                    if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_Drop", 1, false, user))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "宸ヨ壓璺嚎鍒犻櫎澶辫触锛佹棤鏉冮檺锛�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                }
+                string HComputerName = SystemInformation.ComputerName; //璁惧鍚嶇О
+               
 
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                 if (lngBillKey == 0)
@@ -2191,19 +2269,35 @@
         #region 宸ヨ壓璺嚎瀹℃牳/鍙嶅鏍稿姛鑳�
         [Route("Gy_RoutingBill/CheckGy_RoutingBill")]
         [HttpGet]
-        public object CheckGy_RoutingBill(string HInterID, int Type, string user)
+        public object CheckGy_RoutingBill(string HInterID, int Type, string user,string HBillSubType)
         {
             try
             {
-                //鍒ゆ柇鏄惁鏈夊垹闄ゆ潈闄�
-                if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_Check", 1, false, user))
+                if (HBillSubType == "SUB")
                 {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 0;
-                    objJsonResult.Message = "鏃犳潈闄愬鏍�!";
-                    objJsonResult.data = null;
-                    return objJsonResult;
+                    //鍒ゆ柇鏄惁鏈夊垹闄ゆ潈闄�
+                    if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_Sub_Check", 1, false, user))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "瀛愬伐鑹鸿矾绾挎棤鏉冮檺瀹℃牳!";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
                 }
+                else
+                {
+                    //鍒ゆ柇鏄惁鏈夊垹闄ゆ潈闄�
+                    if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_Check", 1, false, user))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "宸ヨ壓璺嚎鏃犳潈闄愬鏍�!";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                }
+               
 
                 if (string.IsNullOrWhiteSpace(HInterID))
                 {
@@ -2310,19 +2404,35 @@
         #region 宸ヨ壓璺嚎鍗曞叧闂�/鍙嶅叧闂姛鑳�
         [Route("Gy_RoutingBill/CloseGy_RoutingBill_1")]
         [HttpGet]
-        public object CloseGy_RoutingBill(string HInterID, int Type, string user)
+        public object CloseGy_RoutingBill(string HInterID, int Type, string user,string HBillSubType)
         {
             try
             {
-                //鍒ゆ柇鏄惁鏈夊垹闄ゆ潈闄�
-                if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_Close", 1, false, user))
+                if (HBillSubType == "SUB")
                 {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 0;
-                    objJsonResult.Message = "鏃犳潈闄愬叧闂�!";
-                    objJsonResult.data = null;
-                    return objJsonResult;
+                    //鍒ゆ柇鏄惁鏈夊垹闄ゆ潈闄�
+                    if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_Sub_Close", 1, false, user))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "瀛愬伐鑹鸿矾绾挎棤鏉冮檺鍏抽棴!";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
                 }
+                else
+                {
+                    //鍒ゆ柇鏄惁鏈夊垹闄ゆ潈闄�
+                    if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_Close", 1, false, user))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "宸ヨ壓璺嚎鏃犳潈闄愬叧闂�!";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                }
+               
 
                 if (string.IsNullOrWhiteSpace(HInterID))
                 {
diff --git a/WebAPI/Controllers/MateOutController.cs b/WebAPI/Controllers/MateOutController.cs
index bf15653..f4a819e 100644
--- a/WebAPI/Controllers/MateOutController.cs
+++ b/WebAPI/Controllers/MateOutController.cs
@@ -1758,6 +1758,76 @@
         #endregion
 
 
+        #region 鍘嬫按鍑虹珯  姣涘皷鍑虹珯
+        [Route("ProdProcessSumReport/Kf_PressurizedWaterOutReport")]
+        [HttpGet]
+        public object Kf_PressurizedWaterOutReport(string sWhere,string HBillType)
+        {
+            try
+            {
+                switch (HBillType)
+                {
+                    case "Kf_PressurizedWaterOutReport":
+                        ds = oCN.RunProcReturn($"select * from h_v_Kf_PressurizedWaterOutReport where 1=1 " + sWhere, "h_v_Kf_PressurizedWaterOutReport");
+                        break;
+                    case "Kf_HairtipReport":
+                        ds = oCN.RunProcReturn($"select * from h_v_Kf_HairtipReport where 1=1 " + sWhere, "h_v_Kf_HairtipReport");
+                        break;
+                    case "Kf_DigitalSprayPaintingReport":
+                        ds = oCN.RunProcReturn($"select * from h_v_Kf_DigitalSprayPaintingReport where 1=1 " + sWhere, "h_v_Kf_DigitalSprayPaintingReport");
+                        break;
+                    case "Kf_ShrinkBrushReport":
+                        ds = oCN.RunProcReturn($"select * from h_v_Kf_ShrinkBrushReport where 1=1 " + sWhere, "h_v_Kf_ShrinkBrushReport");
+                        break;
+                    case "Kf_FinalizeTheDesignOutReport":
+                        ds = oCN.RunProcReturn($"select * from h_v_Kf_FinalizeTheDesignOutReport where 1=1 " + sWhere, "h_v_Kf_FinalizeTheDesignOutReport");
+                        break;
+                    case "Kf_LustringOutReport":
+                        ds = oCN.RunProcReturn($"select * from h_v_Kf_LustringOutReport where 1=1 " + sWhere, "h_v_Kf_LustringOutReport");
+                        break;
+                    case "Kf_ShrinkBrushOutReport":
+                        ds = oCN.RunProcReturn($"select * from h_v_Kf_ShrinkBrushOutReport where 1=1 " + sWhere, "h_v_Kf_ShrinkBrushOutReport");
+                        break;
+                    case "Kf_FinalizeOutReport":
+                        ds = oCN.RunProcReturn($"select * from h_v_Kf_FinalizeOutReport where 1=1 " + sWhere, "h_v_Kf_FinalizeOutReport");
+                        break;
+                    case "Kf_LustringReport":
+                        ds = oCN.RunProcReturn($"select * from h_v_Kf_LustringReport where 1=1 " + sWhere, "h_v_Kf_LustringReport");
+                        break;
+                    case "Kf_ShrinkBrushTeReport":
+                        ds = oCN.RunProcReturn($"select * from h_v_Kf_ShrinkBrushTeReport where 1=1 " + sWhere, "h_v_Kf_ShrinkBrushTeReport");
+                        break;
+                }
+
+
+                //鑾峰彇鍒楀悕
+                List<object> columnNameList = new List<object>();
+                //娣诲姞鍒楀悕
+                foreach (DataColumn col in ds.Tables[0].Columns)
+                {
+                    Type dataType = col.DataType;
+                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+                }
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.list = columnNameList;
+                objJsonResult.data = ds.Tables[0];
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
 
         #endregion
 

--
Gitblit v1.9.1