From f1b334ba320250708dcb47a8e2c97015fc07cc27 Mon Sep 17 00:00:00 2001
From: wtt <1985833171@qq.com>
Date: 星期一, 18 八月 2025 16:05:08 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 WebAPI/Controllers/基础资料/基础资料/Gy_PNLInfoTypeLevelController.cs  | 1142 +++++++++++++++++++++++++++++++++++++++++++++++++++
 WebAPI/Controllers/华远datamapping/Gy_BarCodeReportController.cs |   92 +++
 WebAPI/Models/ClsGy_PNLTypeLevel.cs                            |   17 
 WebAPI/WebAPI.csproj.user                                      |    4 
 WebAPI/Controllers/LMESController.cs                           |   15 
 WebAPI/Controllers/WebAPIController.cs                         |    1 
 WebAPI/WebAPI.csproj                                           |    3 
 7 files changed, 1,253 insertions(+), 21 deletions(-)

diff --git a/WebAPI/Controllers/LMESController.cs b/WebAPI/Controllers/LMESController.cs
index 137724f..4dc6f45 100644
--- a/WebAPI/Controllers/LMESController.cs
+++ b/WebAPI/Controllers/LMESController.cs
@@ -584,6 +584,7 @@
         public object MES_ProcessExchangeBillList_PG(string sWhere, string user, int OperationType)
         {
             DataSet ds;
+            string sql = "";
             try
             {
                 List<object> columnNameList = new List<object>();
@@ -597,6 +598,8 @@
                     return objJsonResult;
                 }
 
+                sql = "select top 1000 * from h_v_Sc_ProcessExchangeArrangementList_PG where 1 = 1 " + sWhere + " order by hmainid desc ";
+
                 if (OperationType == 1)
                 {
                     //鑾峰彇绯荤粺鍙傛暟
@@ -609,6 +612,10 @@
                             sWhere += "  ";
 
                         }
+                        else if (oSystemParameter.omodel.WMS_CampanyName == "鍑礉濂堢壒")
+                        {
+                            sql = "select top 1000 * from h_v_Sc_ProcessExchangeArrangementList_PG where 1 = 1 " + sWhere;
+                        }
                         else
                         {
                             sWhere += "  ";
@@ -616,7 +623,7 @@
                     }
 
                     SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
-                    ds = oCN.RunProcReturn("select top 1000 * from h_v_Sc_ProcessExchangeArrangementList_PG where 1 = 1 " + sWhere + " order by hmainid desc ", "h_v_Sc_ProcessExchangeArrangementList_PG");
+                    ds = oCN.RunProcReturn(sql, "h_v_Sc_ProcessExchangeArrangementList_PG");
                 }
                 else
                 {
@@ -630,10 +637,14 @@
 
 
                         }
+                        else if (oSystemParameter.omodel.WMS_CampanyName == "鍑礉濂堢壒")
+                        {
+                            sql = "select top 1000 * from h_v_Sc_ProcessExchangeArrangementList_PG where 1 = 1 " + sWhere;
+                        }
                     }
 
                     SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
-                    ds = oCN.RunProcReturn("select * from h_v_Sc_ProcessExchangeArrangementList_PG where 1 = 1 " + sWhere, "h_v_Sc_ProcessExchangeArrangementList_PG");
+                    ds = oCN.RunProcReturn(sql, "h_v_Sc_ProcessExchangeArrangementList_PG");
                 }
 
                 //娣诲姞鍒楀悕
diff --git a/WebAPI/Controllers/WebAPIController.cs b/WebAPI/Controllers/WebAPIController.cs
index 6b3c777..e2776a8 100644
--- a/WebAPI/Controllers/WebAPIController.cs
+++ b/WebAPI/Controllers/WebAPIController.cs
@@ -22279,6 +22279,7 @@
             }
         }
 
+
     }
 
 }
diff --git "a/WebAPI/Controllers/\345\215\216\350\277\234datamapping/Gy_BarCodeReportController.cs" "b/WebAPI/Controllers/\345\215\216\350\277\234datamapping/Gy_BarCodeReportController.cs"
index 27b1b5c..48d9b01 100644
--- "a/WebAPI/Controllers/\345\215\216\350\277\234datamapping/Gy_BarCodeReportController.cs"
+++ "b/WebAPI/Controllers/\345\215\216\350\277\234datamapping/Gy_BarCodeReportController.cs"
@@ -81,7 +81,7 @@
         #endregion
 
 
-        #region 涓嶈壇鍘熷洜鏌ヨ
+        #region 琛ㄦ牸鏌ヨ
         [Route("Gy_BarCodeReportController/GetBadReason_proc")]
         [HttpGet]
         public object GetBadReason_proc(string sWhere, string user)
@@ -99,22 +99,32 @@
 
                 List<object> columnNameList = new List<object>();
 
-                ds = oCN.RunProcReturn("exec h_p_QC_BarCodeBadReasonReport '" + HBeginDate + "','" + HEndDate + "','" + Station + "','" + MaterialNo + "','" + LotNo + "'", "h_p_QC_BarCodeBadReasonReport");
+                ds = oCN.RunProcReturn("exec h_p_QC_BarCodeReasonTable '" + HBeginDate + "','" + HEndDate + "','"  + Station + "','" + MaterialNo + "','" + LotNo + "'", "h_p_QC_BarCodeReasonTable");
 
-                //娣诲姞鍒楀悕
+                //if (ds == null || ds.Tables.Count == 0)
+                //{
+                //    objJsonResult.code = "0";
+                //    objJsonResult.count = 0;
+                //    objJsonResult.Message = "鏈煡璇㈠埌鏁版嵁锛�";
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
+                //娣诲姞鍒楀悕1
                 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.data = ds.Tables;
-                objJsonResult.list = columnNameList;
-                return objJsonResult;
+                    {
+                        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.data = ds.Tables;
+                    objJsonResult.list = columnNameList;
+                    return objJsonResult;
+                
+              
+                
             }
             catch (Exception e)
             {
@@ -127,7 +137,7 @@
         }
         #endregion
 
-        #region 涓嶈壇鐜囨煡璇�
+        #region 鏌辩姸鍥炬煡璇�
         [Route("Gy_BarCodeReportController/GetBadReasonTotal_proc")]
         [HttpGet]
         public object GetBadReasonTotal_proc(string sWhere, string user)
@@ -139,12 +149,13 @@
 
                 string HBeginDate = dic["HBeginDate"].ToString();
                 string HEndDate = dic["HEndDate"].ToString();
+                string Station = dic["Station"].ToString();//绔欏彴
                 string MaterialNo = dic["MaterialNo"].ToString();//鏂欏彿
                 string LotNo = dic["LotNo"].ToString();//鎵规鍙�
 
                 List<object> columnNameList = new List<object>();
 
-                ds = oCN.RunProcReturn("exec h_p_QC_BarCodeReasonTotalReport '" + HBeginDate + "','" + HEndDate + "','"  + "','" + MaterialNo + "','" + LotNo + "'", "h_p_QC_BarCodeBadReasonReport");
+                ds = oCN.RunProcReturn("exec h_p_QC_BarCodeReasonTotalReport '" + HBeginDate + "','" + HEndDate + "','" +Station +  "','" + MaterialNo + "','" + LotNo + "'", "h_p_QC_BarCodeBadReasonReport");
 
                 //娣诲姞鍒楀悕
                 foreach (DataColumn col in ds.Tables[0].Columns)
@@ -172,5 +183,52 @@
         }
         #endregion
 
+        #region pie鍥�
+        [Route("Gy_BarCodeReportController/GetBadReason_pie")]
+        [HttpGet]
+        public object GetBadReason_pie(string sWhere, string user)
+        {
+            try
+            {
+                Dictionary<object, object> dic = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<object, object>>(sWhere);
+
+
+                string HBeginDate = dic["HBeginDate"].ToString();
+                string HEndDate = dic["HEndDate"].ToString();
+                string Station = dic["Station"].ToString();//绔欏彴
+                string MaterialNo = dic["MaterialNo"].ToString();//鏂欏彿
+                string LotNo = dic["LotNo"].ToString();//鎵规鍙�
+
+                List<object> columnNameList = new List<object>();
+
+                ds = oCN.RunProcReturn("exec h_p_QC_BarCodeBadReasonReport_pie '" + HBeginDate + "','" + HEndDate + "','" + Station + "','" + MaterialNo + "','" + LotNo + "'", "h_p_QC_BarCodeBadReasonReport_pie");
+
+                //娣诲姞鍒楀悕
+                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.data = ds.Tables[0];
+                objJsonResult.list = columnNameList;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+
     }
 }
\ No newline at end of file
diff --git "a/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_PNLInfoTypeLevelController.cs" "b/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_PNLInfoTypeLevelController.cs"
new file mode 100644
index 0000000..d586e60
--- /dev/null
+++ "b/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_PNLInfoTypeLevelController.cs"
@@ -0,0 +1,1142 @@
+锘縰sing DBUtility;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Net;
+using System.Net.Http;
+using System.Web.Http;
+using WebAPI.Models;
+using System.Web;
+//using WebAPI.Controllers.SCGL.鏃ヨ鍒掔鐞�;
+using System.IO;
+
+namespace WebAPI.Controllers.鍩虹璧勬枡.鍩虹璧勬枡
+{
+    public class Gy_PNLInfoTypeLevelController : ApiController
+    {
+        public DBUtility.ClsPub.Enum_BillStatus BillStatus;
+
+        private json objJsonResult = new json();
+        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+        DataSet ds;
+        Models.ClsGy_DotCheck oDept = new Models.ClsGy_DotCheck();
+        Models.ClsGy_DotCheck oDeptHlp = new Models.ClsGy_DotCheck();
+
+        #region 灞傜骇鍒楄〃鏁版嵁
+        [Route("Gy_PNLInfoTypeLevelController/GetPNLInfoTypeLevel")]
+        [HttpGet]
+        public object GetPNLInfoTypeLevel(string sWhere, string user)
+        {
+            try
+            {
+                List<object> columnNameList = new List<object>();
+                if (!DBUtility.ClsPub.Security_Log("Gy_PNLInfoTypeLevel", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娌℃湁鏌ョ湅鏉冮檺";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                ds = oCN.RunProcReturn("select * from h_v_Gy_PNLInfoTypeSub where 1=1 " + sWhere + " order by 灞傜骇浠g爜", "h_v_Gy_PNLInfoTypeSub");
+
+                //娣诲姞鍒楀悕
+                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鍒楀璞$殑鍒楀悕
+                }
+
+                //if (ds.Tables[0].Rows.Count != 0 || ds != null)
+                //{
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.data = ds.Tables[0];
+                objJsonResult.list = columnNameList;
+                return objJsonResult;
+                //}
+                //else
+                //{
+                //objJsonResult.code = "0";
+                //objJsonResult.count = 0;
+                //objJsonResult.Message = "鏃犳暟鎹�";
+                //objJsonResult.data = null;
+                //return objJsonResult;
+                //}
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region 灞傜骇椤圭洰鍒犻櫎
+        [Route("Gy_PNLInfoTypeLevelController/DeleteType")]
+        [HttpGet]
+        public object DeleteType(long HInterID, string User)
+        {
+
+            try
+            {
+                if (!DBUtility.ClsPub.Security_Log("Gy_PNLInfoTypeLevel_Delete", 1, false, User))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娌℃湁鍒犻櫎鏉冮檺";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                ds = oCN.RunProcReturn("Select * from Gy_PNLInfoTypeSub Where HInterID='" + HInterID + "'", "Gy_PNLInfoTypeSub", ref DBUtility.ClsPub.sExeReturnInfo);
+                if (ds.Tables[0].Rows.Count != 0)
+                {
+                    oCN.BeginTran();
+
+                    //鍒犻櫎鍓嶆帶鍒�=========================================
+                    //ds = oCN.RunProcReturn("Exec h_p_Gy_DotCheck_BeforeDelCtrl " + HInterID + ",'" + User + "'", "h_p_Gy_DotCheck_BeforeDelCtrl");
+                    //if (ds == null)
+                    //{
+                    //    oCN.RollBack();
+                    //    objJsonResult.code = "0";
+                    //    objJsonResult.count = 0;
+                    //    objJsonResult.Message = "鍒犻櫎鍓嶅垽鏂け璐ワ紒";
+                    //    objJsonResult.data = null;
+                    //    return objJsonResult;
+                    //}
+                    //if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
+                    //{
+                    //    oCN.RollBack();
+                    //    objJsonResult.code = "0";
+                    //    objJsonResult.count = 0;
+                    //    objJsonResult.Message = "鍒犻櫎澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+                    //    objJsonResult.data = null;
+                    //    return objJsonResult;
+                    //}
+                    //=========================================================
+
+                    ds = oCN.RunProcReturn("Delete from Gy_PNLInfoTypeSub Where HInterID='" + HInterID + "'", "Gy_PNLInfoTypeSub", ref DBUtility.ClsPub.sExeReturnInfo);
+
+
+                    //鍒犻櫎鍚庢帶鍒�=========================================
+                    //DataSet ds2 = oCN.RunProcReturn("Exec h_p_Gy_DotCheck_AfterDelCtrl " + HInterID + ",'" + User + "'", "h_p_Gy_DotCheck_AfterDelCtrl");
+                    //if (ds2 == null)
+                    //{
+                    //    oCN.RollBack();
+                    //    objJsonResult.code = "0";
+                    //    objJsonResult.count = 0;
+                    //    objJsonResult.Message = "鍒犻櫎鍚庡垽鏂け璐ワ紒";
+                    //    objJsonResult.data = null;
+                    //    return objJsonResult;
+                    //}
+                    //if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
+                    //{
+                    //    oCN.RollBack();
+                    //    objJsonResult.code = "0";
+                    //    objJsonResult.count = 0;
+                    //    objJsonResult.Message = "鍒犻櫎澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+                    //    objJsonResult.data = null;
+                    //    return objJsonResult;
+                    //}
+                    //=========================================================
+
+                    oCN.Commit();
+
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "鍒犻櫎鎴愬姛";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region 淇敼灞傜骇鑾峰彇缁戝畾鏁版嵁
+        [Route("Gy_PNLInfoTypeLevelController/EditType")]
+        [HttpGet]
+        public object EditType(long HInterID)
+        {
+            try
+            {
+                ds = oCN.RunProcReturn("select * from Gy_PNLInfoTypeSub where HInterID=" + HInterID, "Gy_PNLInfoTypeSub");
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "";
+                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
+
+        #region 鐐规椤圭洰淇敼淇濆瓨
+        [Route("Gy_PNLInfoTypeLevelController/EditBill")]
+        [HttpPost]
+        public object EditBill([FromBody] JObject msg)
+        {
+
+            try
+            {
+                var _value = msg["msg"].ToString();
+                string msg3 = _value.ToString();
+                //string[] sArray = msg3.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+                //string msg1 = sArray[0].ToString();
+                //string msg2 = sArray[1].ToString();
+                string msg2 = msg3.ToString();
+
+                //鍙嶅簭鍒楀寲
+                msg2 = "[" + msg2.ToString() + "]";
+                List<Models.ClsGy_PNLTypeLevel> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Models.ClsGy_PNLTypeLevel>>(msg2);
+
+                int HNumber = list[0].HInterID;
+                int HEntryID = list[0].HEntryID;
+                string HPageIndex = list[0].HPageIndex;
+                string HColorStr = list[0].HColorStr;
+                string HLayerNo = list[0].HLayerNo;
+
+                //鍒ゆ柇鏉冮檺
+                //if (!ClsPub.Security_Log("Gy_DotCheck_Edit", 1, false, msg3))
+                //{
+                //    objJsonResult.code = "0";
+                //    objJsonResult.count = 0;
+                //    objJsonResult.Message = "娌℃湁鎵惧埌璇ュ姛鑳芥ā鍧楋紒";
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
+
+                //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
+                oCN.BeginTran();
+
+
+                ////淇濆瓨鍓嶆帶鍒�=========================================
+                //DataSet ds = oCN.RunProcReturn("Exec h_p_Gy_DotCheck_BeforeSaveCtrl " + msg3 + ",'1'", "h_p_Gy_DotCheck_BeforeSaveCtrl");
+                //if (ds == null)
+                //{
+                //    oCN.RollBack();
+                //    objJsonResult.code = "0";
+                //    objJsonResult.count = 0;
+                //    objJsonResult.Message = "淇濆瓨鍓嶅垽鏂け璐ワ紒";
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
+                //if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
+                //{
+                //    oCN.RollBack();
+                //    objJsonResult.code = "0";
+                //    objJsonResult.count = 0;
+                //    objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
+                //=========================================================
+
+                //涓昏〃
+                oCN.RunProc("Update Gy_PNLInfoTypeSub set " +
+            "HPageIndex='" + HPageIndex + "'" +  
+            ", HColorStr='" + HColorStr + "'" +
+            ", HLayerNo='" + HLayerNo + "'" +
+            " Where HInterID='" + HNumber + "'",  
+            ref DBUtility.ClsPub.sExeReturnInfo);
+                //淇敼瀛愰」鐩唬鐮�
+                //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_RepairCheck,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo);
+
+                //淇濆瓨鍚庢帶鍒�=========================================
+                //DataSet ds2 = oCN.RunProcReturn("Exec h_p_Gy_DotCheck_AfterSaveCtrl " + msg3 + ",'1'", "h_p_Gy_DotCheck_AfterSaveCtrl");
+                //if (ds2 == null)
+                //{
+                //    oCN.RollBack();
+                //    objJsonResult.code = "0";
+                //    objJsonResult.count = 0;
+                //    objJsonResult.Message = "淇濆瓨鍚庡垽鏂け璐ワ紒";
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+
+                //}
+                //if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
+                //{
+                //    oCN.RollBack();
+                //    objJsonResult.code = "0";
+                //    objJsonResult.count = 0;
+                //    objJsonResult.Message = "" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]);
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
+                //=========================================================
+
+                oCN.Commit();
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "淇敼鎴愬姛锛�";
+                //objJsonResult.data = null;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                oCN.RollBack();
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.Message;
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region 灞傜骇椤圭洰鏂板淇濆瓨
+        [Route("Gy_PNLInfoTypeLevelController/AddBill")]
+        [HttpPost]
+        public object AddBill([FromBody] JObject msg)
+        {
+            try
+            {
+                var _value = msg["msg"].ToString();
+                string msg3 = _value.ToString();
+                //string[] sArray = msg3.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+                //string msg1 = sArray[0].ToString();
+                //string msg2 = sArray[1].ToString();
+                string msg2 = msg3.ToString();
+
+                //鍙嶅簭鍒楀寲
+                msg2 = "[" + msg2.ToString() + "]";
+
+                List<Models.ClsGy_PNLTypeLevel> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Models.ClsGy_PNLTypeLevel>>(msg2);
+
+                int HNumber = list[0].HInterID;
+                int HEntryID = list[0].HEntryID;
+                string HPageIndex = list[0].HPageIndex;
+                string HColorStr = list[0].HColorStr;
+                string HLayerNo = list[0].HLayerNo;
+                
+                //鍒ゆ柇鏉冮檺
+                //if (!ClsPub.Security_Log("Gy_DotCheck_Edit", 1, false, msg3))
+                //{
+                //    objJsonResult.code = "0";
+                //    objJsonResult.count = 0;
+                //    objJsonResult.Message = "娌℃湁鎵惧埌璇ュ姛鑳芥ā鍧楋紒";
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
+                //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
+                oCN.BeginTran();
+
+                //淇濆瓨鍓嶆帶鍒�=========================================
+                //DataSet ds = oCN.RunProcReturn("Exec h_p_Gy_DotCheck_BeforeSaveCtrl " + msg3 + ",'1'", "h_p_Gy_DotCheck_BeforeSaveCtrl");
+                //if (ds == null)
+                //{
+                //    oCN.RollBack();
+                //    objJsonResult.code = "0";
+                //    objJsonResult.count = 0;
+                //    objJsonResult.Message = "淇濆瓨鍓嶅垽鏂け璐ワ紒";
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
+                //if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
+                //{
+                //    oCN.RollBack();
+                //    objJsonResult.code = "0";
+                //    objJsonResult.count = 0;
+                //    objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
+                //=========================================================
+
+                //涓昏〃
+                oCN.RunProc("Insert into Gy_PNLInfoTypeSub " +
+                           " (HInterID,HEntryID,HPageIndex,HColorStr,HLayerNo" +
+                           " ) " +
+                           " Values(" + HNumber + "," + HEntryID + ",'" + HPageIndex + "','" + HColorStr + "','" +
+                             HLayerNo + "')", ref DBUtility.ClsPub.sExeReturnInfo);
+                //淇敼涓婄骇涓洪潪鏈骇浠g爜
+                //oCN.RunProc("Update Gy_MouldType set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
+
+                //淇濆瓨鍚庢帶鍒�=========================================
+                //DataSet ds2 = oCN.RunProcReturn("Exec h_p_Gy_DotCheck_AfterSaveCtrl " + msg3 + ",'1'", "h_p_Gy_DotCheck_AfterSaveCtrl");
+                //if (ds2 == null)
+                //{
+                //    oCN.RollBack();
+                //    objJsonResult.code = "0";
+                //    objJsonResult.count = 0;
+                //    objJsonResult.Message = "淇濆瓨鍚庡垽鏂け璐ワ紒";
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+
+                //}
+                //if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
+                //{
+                //    oCN.RollBack();
+                //    objJsonResult.code = "0";
+                //    objJsonResult.count = 0;
+                //    objJsonResult.Message = "" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]);
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
+                //=========================================================
+
+                oCN.Commit();
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "鏂板鎴愬姛锛�";
+                //objJsonResult.data = null;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                oCN.RollBack();
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.Message;
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region 灞傜骇鍒楄〃 鏍戠姸鍥� 鐐瑰嚮鍒嗙被鏌ヨ
+        public class TreeModel
+        {
+            public string id { get; set; }
+            public string title { get; set; }
+            public List<TreeModel> children = new List<TreeModel>();
+        }
+        [Route("Gy_PNLInfoTypeLevelController/TreeGetList")]
+        [HttpGet]
+        public object TreeGetList(string sWhere, string user)
+        {
+            try
+            {
+
+                ds = oCN.RunProcReturn("select HInterID,HName from Gy_PNLInfoType", "Gy_PNLInfoType");
+
+                List<TreeModel> treeModels = new List<TreeModel>();
+                TreeModel first = new TreeModel();
+                first.id = "0";
+                first.title = "灞傜骇椤圭洰鍒嗙被璁剧疆";
+                treeModels.Add(first);
+
+                foreach (DataRow row in ds.Tables[0].Rows)
+                {
+                    var strLen = row["HInterID"].ToString().Split('.');
+                    if (strLen.Length == 1)
+                    {
+                        TreeModel tree = new TreeModel();
+                        tree.id = row["HInterID"].ToString();
+                        tree.title = row["HName"].ToString();
+                        treeModels[0].children.Add(tree);
+                    }
+                }
+                //digui(ds.Tables[0], treeModels[0].children, 2);
+
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.data = Newtonsoft.Json.JsonConvert.SerializeObject(treeModels);
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        
+        #endregion
+
+        //#region 鐐规椤圭洰鏂囦欢涓婁紶
+        //[Route("Gy_DotCheck/Gy_DotCheck_Excel")]
+        //[HttpPost]
+        //public object Gy_DotCheck_Excel()
+        //{
+        //    try
+        //    {
+        //        //鑾峰彇鏂囦欢鍚嶇О
+        //        var file = HttpContext.Current.Request.Files[0];
+        //        //鑾峰彇鏂囦欢鐗╃悊璺緞
+        //        string ExcelPath = HttpContext.Current.Server.MapPath("~/" + file.FileName);
+        //        //淇濆瓨鏂囦欢
+        //        file.SaveAs(ExcelPath);
+
+        //        NpoiHelper np = new NpoiHelper();
+        //        DataSet ExcelDs = np.ReadExcel(ExcelPath, 1, 1, "0");
+
+        //        //鍒犻櫎鏂囦欢
+        //        File.Delete(ExcelPath);
+
+        //        //鍒涘缓涓存椂琛�
+        //        DataTable tb2 = new DataTable("dt2");
+
+        //        //娣诲姞鍒楀悕
+        //        for (int i = 0; i < ExcelDs.Tables[0].Columns.Count; i++)
+        //        {
+        //            tb2.Columns.Add(ExcelDs.Tables[0].Rows[0][i].ToString());
+        //        }
+
+        //        //妯℃澘缂哄皯鍒� 浣嗛渶瑕佷粠鏁版嵁搴撲腑鏌ヨ鍑烘潵鏄剧ず鍦ㄩ〉闈㈢殑瀛楁
+        //        tb2.Columns.Add("HOrgID", typeof(Int32));//缁勭粐ID
+        //        tb2.Columns.Add("HDotCheckItemClassID", typeof(Int32));//鐐规椤圭洰鍒嗙被ID
+
+        //        //娣诲姞鏁版嵁
+        //        for (int i = 1; i < ExcelDs.Tables[0].Rows.Count; i++)
+        //        {
+        //            DataRow row = tb2.NewRow();
+        //            for (int j = 0; j < ExcelDs.Tables[0].Columns.Count; j++)
+        //            {
+        //                row[j] = ExcelDs.Tables[0].Rows[i][j].ToString();
+        //            }
+        //            tb2.Rows.Add(row);
+        //        }
+
+
+        //        var error = "";
+
+        //        //鏌ヨ宸ヤ綔涓績娌℃湁鐨勫垪
+        //        if (!tb2.Columns.Contains("缁勭粐浠g爜"))
+        //            error += "娌℃湁鎵惧埌銆愮粍缁囦唬鐮併�戠殑鏍囬,";
+
+        //        if (!tb2.Columns.Contains("缁勭粐鍚嶇О"))
+        //            error += "娌℃湁鎵惧埌銆愮粍缁囧悕绉般�戠殑鏍囬,";
+
+        //        if (!tb2.Columns.Contains("鐐规椤圭洰浠g爜"))
+        //            error += "娌℃湁鎵惧埌銆愮偣妫�椤圭洰浠g爜銆戠殑鏍囬,";
+
+        //        if (!tb2.Columns.Contains("鐐规椤圭洰鍚嶇О"))
+        //            error += "娌℃湁鎵惧埌銆愮偣妫�椤圭洰鍚嶇О銆戠殑鏍囬,";
+
+        //        if (!tb2.Columns.Contains("鐐规椤圭洰鍒嗙被浠g爜"))
+        //            error += "娌℃湁鎵惧埌銆愮偣妫�椤圭洰鍒嗙被浠g爜銆戠殑鏍囬,";
+
+        //        if (!tb2.Columns.Contains("鐐规椤圭洰鍒嗙被鍚嶇О"))
+        //            error += "娌℃湁鎵惧埌銆愮偣妫�椤圭洰鍒嗙被鍚嶇О銆戠殑鏍囬,";
+
+
+        //        if (error.Length > 0)
+        //        {
+        //            objJsonResult.code = "0";
+        //            objJsonResult.count = 0;
+        //            objJsonResult.Message = $"Excel妯℃澘瀛樺湪閿欒,{error}\r\n";
+        //            objJsonResult.data = null;
+        //            return objJsonResult;
+        //        }
+
+        //        for (int i = 0; i <= tb2.Rows.Count - 1; i++)
+        //        {
+
+        //            string HORGNumber = "";
+        //            string HORGName = "";
+        //            string HDotCheckNum = "";
+        //            string HDotCheckName = "";
+        //            string HDotCheckItemClassNum = "";
+        //            string HDotCheckItemClassName = "";
+
+        //            HORGNumber = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["缁勭粐浠g爜"].ToString());
+        //            HORGName = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["缁勭粐鍚嶇О"].ToString());
+        //            HDotCheckNum = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["鐐规椤圭洰浠g爜"].ToString());
+        //            HDotCheckName = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["鐐规椤圭洰鍚嶇О"].ToString());
+        //            HDotCheckItemClassNum = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["鐐规椤圭洰鍒嗙被浠g爜"].ToString());
+        //            HDotCheckItemClassName = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["鐐规椤圭洰鍒嗙被鍚嶇О"].ToString());
+
+        //            //妫�鏌ョ粍缁�
+        //            int index = i + 1;
+
+        //            if (HORGNumber != "")
+        //            {
+
+
+        //                //鏌ヨ缁勭粐
+        //                ds = oCN.RunProcReturn("select * from Xt_ORGANIZATIONS where  HNumber='" + HORGNumber + "' and Hname='" + HORGName + "'", "Xt_ORGANIZATIONS");
+
+        //                if (ds.Tables[0].Rows.Count == 0)
+        //                {
+        //                    objJsonResult.code = "0";
+        //                    objJsonResult.count = 0;
+        //                    objJsonResult.Message = "绗�" + index + "琛�,缁勭粐涓嶅瓨鍦紒";
+        //                    objJsonResult.data = null;
+        //                    return objJsonResult;
+        //                }
+        //                else
+        //                {
+        //                    tb2.Rows[i]["HOrgID"] = ds.Tables[0].Rows[0]["HItemID"].ToString();
+        //                }
+        //                string HORGid = ds.Tables[0].Rows[0]["HItemID"].ToString();
+
+
+        //                //鏌ヨ鐐规椤圭洰鍒嗙被
+        //                ds = oCN.RunProcReturn("select * from Gy_DotCheckItemClass where  HNumber='" + HDotCheckItemClassNum + "'  and HUSEORGID=" + HORGid + "", "Gy_Department");
+
+        //                if (ds.Tables[0].Rows.Count == 0)
+        //                {
+        //                    objJsonResult.code = "0";
+        //                    objJsonResult.count = 0;
+        //                    objJsonResult.Message = "绗�" + index + "琛�,璇�" + HORGName + "缁勭粐,鐐规椤圭洰鍒嗙被:" + HDotCheckItemClassName + ",涓嶅瓨鍦紒";
+        //                    objJsonResult.data = null;
+        //                    return objJsonResult;
+        //                }
+        //                else
+        //                {
+        //                    tb2.Rows[i]["HDotCheckItemClassID"] = ds.Tables[0].Rows[0]["HItemID"].ToString();
+        //                }
+
+        //                //鐐规椤圭洰鍚嶇О
+        //                if (HDotCheckName == "")
+        //                {
+        //                    objJsonResult.code = "0";
+        //                    objJsonResult.count = 0;
+        //                    objJsonResult.Message = "绗�" + index + "琛�,鐐规椤圭洰鍚嶇О涓嶈兘涓虹┖锛�";
+        //                    objJsonResult.data = null;
+        //                    return objJsonResult;
+        //                }
+
+        //                //鐐规椤圭洰浠g爜
+        //                if (HDotCheckNum == "")
+        //                {
+        //                    objJsonResult.code = "0";
+        //                    objJsonResult.count = 0;
+        //                    objJsonResult.Message = "绗�" + index + "琛�,鐐规椤圭洰浠g爜涓嶈兘涓虹┖锛�";
+        //                    objJsonResult.data = null;
+        //                    return objJsonResult;
+        //                }
+        //            }
+        //            else
+        //            {
+        //                objJsonResult.code = "1";
+        //                objJsonResult.count = 1;
+        //                objJsonResult.Message = "绗�" + index + "琛�,缁勭粐浠g爜涓虹┖";
+        //                objJsonResult.data = null;
+        //                return objJsonResult;
+        //            }
+        //        }
+
+        //        objJsonResult.code = "1";
+        //        objJsonResult.count = 1;
+        //        objJsonResult.Message = error;
+        //        objJsonResult.data = tb2;
+        //        return objJsonResult;
+        //    }
+        //    catch (Exception e)
+        //    {
+        //        objJsonResult.code = "0";
+        //        objJsonResult.count = 0;
+        //        objJsonResult.Message = "Exception锛�" + e.ToString();
+        //        objJsonResult.data = null;
+        //        return objJsonResult;
+        //    }
+        //}
+        //#endregion
+
+        #region 鐐规椤圭洰 瀵煎叆(淇濆瓨)
+        [Route("Gy_DotCheck/Gy_DotCheck_btnSave")]
+        [HttpPost]
+        public object Gy_DotCheck_btnSave([FromBody] JObject sMainSub)
+        {
+            var _value = sMainSub["sMainSub"].ToString();
+            string msg1 = _value.ToString();
+            string[] sArray = msg1.Split(new string[] { "&鍜�" }, StringSplitOptions.RemoveEmptyEntries);
+            string msg2 = sArray[0].ToString();
+            string user = sArray[1].ToString();
+            try
+            {
+                if (!DBUtility.ClsPub.Security_Log("Gy_DotCheck_Edit", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犱繚瀛樻潈闄愶紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                List<object> Excel = Newtonsoft.Json.JsonConvert.DeserializeObject<List<object>>(msg2);
+                List<Dictionary<string, string>> list = new List<Dictionary<string, string>>();
+
+                foreach (JObject item in Excel)
+                {
+                    Dictionary<string, string> dic = new Dictionary<string, string>();
+                    foreach (var itm in item.Properties())
+                    {
+                        dic.Add(itm.Name, itm.Value.ToString());
+                    }
+                    list.Add(dic);
+                }
+
+                oCN.BeginTran();
+                int i = 1;
+                foreach (Dictionary<string, string> item in list)
+                {
+                    string HOrgID = item["HOrgID"].ToString();//缁勭粐ID
+                    string HDotCheckItemClassID = item["HDotCheckItemClassID"].ToString();//鐐规椤圭洰鍒嗙被ID
+                    string HDotCheckItemClassName = item["鐐规椤圭洰鍒嗙被浠g爜"].ToString();
+                    string HDotCheckItemClassNum = item["鐐规椤圭洰鍒嗙被鍚嶇О"].ToString();
+                    string HDotCheckName = item["鐐规椤圭洰鍚嶇О"].ToString();
+                    string HDotCheckNum = item["鐐规椤圭洰浠g爜"].ToString();
+                    string sShortNumber;
+                    sShortNumber = DBUtility.ClsPub.GetShortNumber(HDotCheckNum);//鐭唬鐮�
+                    if (sShortNumber.Trim() == "")
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "淇濆瓨澶辫触锛佺煭浠g爜涓虹┖锛�";
+                        objJsonResult.data = 1;
+                        return objJsonResult;
+                    }
+                    int HEndFlag = 1;//鏈骇鏍囧織
+                    int HLevel = DBUtility.ClsPub.GetLevel(HDotCheckNum); //绛夌骇
+
+
+                    if (!DBUtility.ClsPub.AllowNumber(HDotCheckNum.Trim()))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮佷腑涓嶈兘鍑虹幇杩炵画鈥�.鈥欏苟涓旈浣嶆湯浣嶄笉鑳戒负鈥�.鈥欙紒";
+                        objJsonResult.data = 1;
+                        return objJsonResult;
+                    }
+
+                    ds = oCN.RunProcReturn("select * from Gy_DotCheck where HNumber='" + HDotCheckNum + "'", "Gy_DotCheck");
+
+                    if (ds.Tables[0].Rows.Count == 0)
+                    {
+
+                        string sql = "insert into Gy_DotCheck(HName,HNumber,HDotCheckItemClassID,HUSEORGID,HCREATEORGID,HShortNumber,HEndFlag,HLevel,HParentID,HStopflag,HRemark,HHelpCode)" +
+                            $"values('{HDotCheckName}', '{HDotCheckNum}',{HDotCheckItemClassID}, {HOrgID},{HOrgID}, '{sShortNumber}', {HEndFlag},{HLevel},0,0,'','')";
+                        oCN.RunProc(sql);
+                    }
+                    else
+                    {
+                        oCN.RunProc("	update  Gy_DotCheck set HDotCheckItemClassID=" + HDotCheckItemClassID + "  where HNumber='" + HDotCheckNum + "'");
+                    }
+
+                    i++;
+                }
+
+                oCN.Commit();
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "瀵煎叆鎴愬姛!";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                LogService.Write(e);
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region 鐐规椤圭洰瀹℃牳銆佸弽瀹℃牳
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="HInterID">鍗曟嵁ID</param>
+        /// <param name="IsAudit">瀹℃牳(0),鍙嶅鏍�(1)</param>
+        /// <param name="CurUserName">瀹℃牳浜�</param>
+        /// <returns></returns>
+        [Route("Gy_PNLInfoTypeLevelController/AuditGy_DotCheck")]
+        [HttpGet]
+        public object AuditGy_DotCheck(int HInterID, int IsAudit, string CurUserName)
+        {
+            try
+            {
+                //瀹℃牳鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log_second("Gy_PNLInfoTypeLevel_Check", 1, false, CurUserName))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "瀹℃牳澶辫触锛佹棤鏉冮檺锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                var ds = oCN.RunProcReturn("select * from Gy_PNLInfoType  where HItemID=" + HInterID, "Gy_PNLInfoTypeSub ");
+                if (ds.Tables[0].Rows.Count > 0)
+                {
+                    if (IsAudit == 0)  //瀹℃牳鍒ゆ柇
+                    {
+                        if (ds.Tables[0].Rows[0]["HCheckEmp"].ToString() != "")
+                        {
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = "鍗曟嵁宸插鏍�!涓嶈兘鍐嶆瀹℃牳锛�";
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
+                    }
+                    if (IsAudit == 1) //鍙嶅鏍稿垽鏂�
+                    {
+                        if (ds.Tables[0].Rows[0]["HCheckEmp"].ToString() == "")
+                        {
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = "鍗曟嵁鏈鏍�!涓嶉渶瑕佸弽瀹℃牳!";
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
+                    }
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦�!";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+
+
+                oCN.BeginTran();
+
+                if (IsAudit == 0)  //瀹℃牳鍒ゆ柇
+                {
+                    //瀹℃牳鍓嶆帶鍒�=========================================
+                    ds = oCN.RunProcReturn("Exec h_p_Gy_PNLInfoType_BeforeCheckCtrl " + HInterID + ",'" + CurUserName + "'", "h_p_Gy_PNLInfoType_BeforeCheckCtrl");
+                    if (ds == null)
+                    {
+                        oCN.RollBack();
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "瀹℃牳鍓嶅垽鏂け璐ワ紒";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
+                    {
+                        oCN.RollBack();
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "瀹℃牳澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    //=========================================================
+
+                    oCN.RunProc("update Gy_PNLInfoType set HCheckEmp='" + CurUserName + "',HCheckTime=getdate() where HInterID=" + HInterID);
+
+                    //瀹℃牳鍚庢帶鍒�=========================================
+                    DataSet ds2 = oCN.RunProcReturn("Exec h_p_Gy_PNLInfoType_AfterCheckCtrl " + HInterID + ",'" + CurUserName + "'", "h_p_Gy_PNLInfoType_AfterCheckCtrl");
+                    if (ds2 == null)
+                    {
+                        oCN.RollBack();
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "瀹℃牳鍚庡垽鏂け璐ワ紒";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
+                    {
+                        oCN.RollBack();
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "瀹℃牳澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    //=========================================================
+
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "瀹℃牳鎴愬姛";
+                    objJsonResult.data = null;
+                }
+                if (IsAudit == 1) //鍙嶅鏍稿垽鏂�
+                {
+                    //鍙嶅鏍稿墠鎺у埗=========================================
+                    ds = oCN.RunProcReturn("Exec h_p_Gy_PNLInfoType_BeforeUnCheckCtrl " + HInterID + ",'" + CurUserName + "'", "h_p_Gy_PNLInfoType_BeforeUnCheckCtrl");
+                    if (ds == null)
+                    {
+                        oCN.RollBack();
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "瀹℃牳鍓嶅垽鏂け璐ワ紒";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
+                    {
+                        oCN.RollBack();
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "瀹℃牳澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    //=========================================================
+
+                    oCN.RunProc("update Gy_PNLInfoType set HCheckEmp='',HCheckTime=null where HInterID=" + HInterID);
+
+
+                    //鍙嶅鏍稿悗鎺у埗=========================================
+                    DataSet ds2 = oCN.RunProcReturn("Exec h_p_Gy_PNLInfoType_AfterUnCheckCtrl " + HInterID + ",'" + CurUserName + "'", "h_p_Gy_PNLInfoType_AfterUnCheckCtrl");
+                    if (ds2 == null)
+                    {
+                        oCN.RollBack();
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "瀹℃牳鍚庡垽鏂け璐ワ紒";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
+                    {
+                        oCN.RollBack();
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "瀹℃牳澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    //=========================================================
+
+
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "鍙嶅鏍告垚鍔�";
+                    objJsonResult.data = null;
+                }
+
+
+
+                oCN.Commit();
+
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                oCN.RollBack();
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "瀹℃牳澶辫触鎴栬�呭弽瀹℃牳澶辫触锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region 鐐规椤圭洰绂佺敤銆佸弽绂佺敤
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="HInterID">鍗曟嵁ID</param>
+        /// <param name="IsStop">绂佺敤(0),鍙嶇鐢�(1)</param>
+        /// <param name="CurUserName">瀹℃牳浜�</param>
+        /// <returns></returns>
+        [Route("Gy_PNLInfoTypeLevelController/StopGy_DotCheck")]
+        [HttpGet]
+        public object StopGy_DotCheck(int HInterID, int IsStop, string CurUserName)
+        {
+            try
+            {
+                //绂佺敤鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log_second("Gy_PNLInfoTypeLevel_Stop", 1, false, CurUserName))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "绂佺敤澶辫触锛佹棤鏉冮檺锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                var ds = oCN.RunProcReturn("select * from Gy_PNLInfoType where HInterID=" + HInterID, "Gy_PNLInfoType");
+                if (ds.Tables[0].Rows.Count > 0)
+                {
+                    if (IsStop == 0)  //绂佺敤鍒ゆ柇
+                    {
+                        if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() != "")
+                        {
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = "鍗曟嵁宸茬鐢�!涓嶈兘鍐嶆绂佺敤锛�";
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
+                    }
+                    if (IsStop == 1) //鍙嶇鐢ㄥ垽鏂�
+                    {
+                        if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() == "")
+                        {
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = "鍗曟嵁鏈鐢�!涓嶉渶瑕佸弽绂佺敤!";
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
+                    }
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦�!";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                oCN.BeginTran();
+
+                if (IsStop == 0)  //绂佺敤鍒ゆ柇
+                {
+                    //绂佺敤鍓嶆帶鍒�=========================================
+                    ds = oCN.RunProcReturn("Exec h_p_Gy_PNLInfoType_BeforeStopCtrl " + HInterID + ",'" + CurUserName + "'", "h_p_Gy_PNLInfoType_BeforeStopCtrl");
+                    if (ds == null)
+                    {
+                        oCN.RollBack();
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "绂佺敤鍓嶅垽鏂け璐ワ紒";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
+                    {
+                        oCN.RollBack();
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "绂佺敤澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    //=========================================================
+
+                    oCN.RunProc("update Gy_PNLInfoType set HStopEmp='" + CurUserName + "',HStopTime=getdate() where HInterID=" + HInterID);
+
+                    //绂佺敤鍚庢帶鍒�=========================================
+                    DataSet ds2 = oCN.RunProcReturn("Exec h_p_Gy_PNLInfoType_AFTERStopCtrl " + HInterID + ",'" + CurUserName + "'", "h_p_Gy_PNLInfoType_AFTERStopCtrl");
+                    if (ds2 == null)
+                    {
+                        oCN.RollBack();
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "绂佺敤鍚庡垽鏂け璐ワ紒";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
+                    {
+                        oCN.RollBack();
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "绂佺敤澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    //=========================================================
+
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "绂佺敤鎴愬姛";
+                    objJsonResult.data = null;
+                }
+                if (IsStop == 1) //鍙嶇鐢ㄥ垽鏂�
+                {
+                    //鍙嶇鐢ㄥ墠鎺у埗=========================================
+                    ds = oCN.RunProcReturn("Exec h_p_Gy_PNLInfoType_BeforeUnStopCtrl " + HInterID + ",'" + CurUserName + "'", "h_p_Gy_PNLInfoType_BeforeUnStopCtrl");
+                    if (ds == null)
+                    {
+                        oCN.RollBack();
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "绂佺敤鍓嶅垽鏂け璐ワ紒";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
+                    {
+                        oCN.RollBack();
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "绂佺敤澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    //=========================================================
+
+                    oCN.RunProc("update Gy_PNLInfoType set HStopEmp='',HStopTime=null where HInterID=" + HInterID);
+
+
+                    //鍙嶇鐢ㄥ悗鎺у埗=========================================
+                    DataSet ds2 = oCN.RunProcReturn("Exec h_p_Gy_PNLInfoType_AfterUnStop " + HInterID + ",'" + CurUserName + "'", "h_p_Gy_PNLInfoType_AfterUnStop");
+                    if (ds2 == null)
+                    {
+                        oCN.RollBack();
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "绂佺敤鍚庡垽鏂け璐ワ紒";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
+                    {
+                        oCN.RollBack();
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "绂佺敤澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    //=========================================================
+
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "鍙嶇鐢ㄦ垚鍔�";
+                    objJsonResult.data = null;
+                }
+                oCN.Commit();
+
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                oCN.RollBack();
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "绂佺敤澶辫触鎴栬�呭弽绂佺敤澶辫触锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+    }
+}
diff --git a/WebAPI/Models/ClsGy_PNLTypeLevel.cs b/WebAPI/Models/ClsGy_PNLTypeLevel.cs
new file mode 100644
index 0000000..9728a85
--- /dev/null
+++ b/WebAPI/Models/ClsGy_PNLTypeLevel.cs
@@ -0,0 +1,17 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+
+namespace WebAPI.Models
+{
+    public class ClsGy_PNLTypeLevel : DBUtility.ClsGy_Base_Ctl
+    {
+        public int HInterID;
+        public int HEntryID;          
+        public string HPageIndex;             
+        public string HColorStr;    
+        public string HLayerNo;   
+        
+    }
+}
\ No newline at end of file
diff --git a/WebAPI/WebAPI.csproj b/WebAPI/WebAPI.csproj
index a275b16..591ec52 100644
--- a/WebAPI/WebAPI.csproj
+++ b/WebAPI/WebAPI.csproj
@@ -635,6 +635,7 @@
     <Compile Include="Controllers\鍩虹璧勬枡\鍩虹璧勬枡\Gy_PaymentConditionListBillController.cs" />
     <Compile Include="Controllers\鍩虹璧勬枡\鍩虹璧勬枡\Gy_DisposeWayController.cs" />
     <Compile Include="Controllers\鍗庤繙datamapping\Gy_PNLInfoController.cs" />
+    <Compile Include="Controllers\鍩虹璧勬枡\鍩虹璧勬枡\Gy_PNLInfoTypeLevelController.cs" />
     <Compile Include="Controllers\椤圭洰绠$悊\宸ョ▼椤圭洰\PM_ProjectBill_WorkController.cs" />
     <Compile Include="Models\ClsGy_PNLInfoSub.cs" />
     <Compile Include="Controllers\鍩虹璧勬枡\鍩虹璧勬枡\Gy_ProcMulController.cs" />
@@ -862,6 +863,7 @@
     <Compile Include="Models\ClsGy_BarCodeBill_Set_Temp.cs" />
     <Compile Include="Models\ClsGy_PatrolCheck.cs" />
     <Compile Include="Models\ClsGy_PNLInfo.cs" />
+    <Compile Include="Models\ClsGy_PNLTypeLevel.cs" />
     <Compile Include="Models\ClsGy_Supplier_Link.cs" />
     <Compile Include="Models\ClsGy_Supplier_PayPlan.cs" />
     <Compile Include="Models\ClsGy_MouldFileBillSub_DotCheckRule.cs" />
@@ -1219,6 +1221,7 @@
     <Folder Include="Views\Gy_Operator\" />
     <Folder Include="Views\Gy_PackType\" />
     <Folder Include="Views\Gy_PaymentConditionListBill\" />
+    <Folder Include="Views\Gy_PNLInfoTypeLevel\" />
     <Folder Include="Views\Gy_RateType\" />
     <Folder Include="Views\Gy_RecConditionBill\" />
     <Folder Include="Views\Gy_RepairCheckClass\" />
diff --git a/WebAPI/WebAPI.csproj.user b/WebAPI/WebAPI.csproj.user
index 3ec52c2..cdec41d 100644
--- a/WebAPI/WebAPI.csproj.user
+++ b/WebAPI/WebAPI.csproj.user
@@ -15,8 +15,8 @@
     <IISExpressWindowsAuthentication>disabled</IISExpressWindowsAuthentication>
     <IISExpressUseClassicPipelineMode>false</IISExpressUseClassicPipelineMode>
     <UseGlobalApplicationHostFile />
-    <Controller_SelectedScaffolderID>ApiControllerEmptyScaffolder</Controller_SelectedScaffolderID>
-    <Controller_SelectedScaffolderCategoryPath>root/Common/Web API</Controller_SelectedScaffolderCategoryPath>
+    <Controller_SelectedScaffolderID>MvcControllerEmptyScaffolder</Controller_SelectedScaffolderID>
+    <Controller_SelectedScaffolderCategoryPath>root/Common/MVC/Controller</Controller_SelectedScaffolderCategoryPath>
     <WebStackScaffolding_ControllerDialogWidth>600</WebStackScaffolding_ControllerDialogWidth>
     <WebStackScaffolding_IsLayoutPageSelected>True</WebStackScaffolding_IsLayoutPageSelected>
     <WebStackScaffolding_IsPartialViewSelected>False</WebStackScaffolding_IsPartialViewSelected>

--
Gitblit v1.9.1