wtt
4 天以前 f1b334ba320250708dcb47a8e2c97015fc07cc27
Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API
2个文件已添加
5个文件已修改
1274 ■■■■■ 已修改文件
WebAPI/Controllers/LMESController.cs 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/WebAPIController.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/华远datamapping/Gy_BarCodeReportController.cs 92 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/基础资料/基础资料/Gy_PNLInfoTypeLevelController.cs 1142 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Models/ClsGy_PNLTypeLevel.cs 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/WebAPI.csproj 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/WebAPI.csproj.user 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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");
                }
                //添加列名
WebAPI/Controllers/WebAPIController.cs
@@ -22279,6 +22279,7 @@
            }
        }
    }
}
WebAPI/Controllers/»ªÔ¶datamapping/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));//获取到DataColumn列对象的列名
                }
                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));//获取到DataColumn列对象的列名
                    }
                    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));//获取到DataColumn列对象的列名
                }
                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
    }
}
WebAPI/Controllers/»ù´¡×ÊÁÏ/»ù´¡×ÊÁÏ/Gy_PNLInfoTypeLevelController.cs
New file
@@ -0,0 +1,1142 @@
using 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 å±‚级代码", "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));//获取到DataColumn列对象的列名
                }
                //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;
                //}
                //若MAINDI重复则重新获取
                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;
                //}
                //若MAINDI重复则重新获取
                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);
                //修改上级为非末级代码
                //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("组织代码"))
        //            error += "没有找到【组织代码】的标题,";
        //        if (!tb2.Columns.Contains("组织名称"))
        //            error += "没有找到【组织名称】的标题,";
        //        if (!tb2.Columns.Contains("点检项目代码"))
        //            error += "没有找到【点检项目代码】的标题,";
        //        if (!tb2.Columns.Contains("点检项目名称"))
        //            error += "没有找到【点检项目名称】的标题,";
        //        if (!tb2.Columns.Contains("点检项目分类代码"))
        //            error += "没有找到【点检项目分类代码】的标题,";
        //        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]["组织代码"].ToString());
        //            HORGName = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["组织名称"].ToString());
        //            HDotCheckNum = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["点检项目代码"].ToString());
        //            HDotCheckName = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["点检项目名称"].ToString());
        //            HDotCheckItemClassNum = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["点检项目分类代码"].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;
        //                }
        //                //点检项目代码
        //                if (HDotCheckNum == "")
        //                {
        //                    objJsonResult.code = "0";
        //                    objJsonResult.count = 0;
        //                    objJsonResult.Message = "第" + index + "行,点检项目代码不能为空!";
        //                    objJsonResult.data = null;
        //                    return objJsonResult;
        //                }
        //            }
        //            else
        //            {
        //                objJsonResult.code = "1";
        //                objJsonResult.count = 1;
        //                objJsonResult.Message = "第" + index + "行,组织代码为空";
        //                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["点检项目分类代码"].ToString();
                    string HDotCheckItemClassNum = item["点检项目分类名称"].ToString();
                    string HDotCheckName = item["点检项目名称"].ToString();
                    string HDotCheckNum = item["点检项目代码"].ToString();
                    string sShortNumber;
                    sShortNumber = DBUtility.ClsPub.GetShortNumber(HDotCheckNum);//短代码
                    if (sShortNumber.Trim() == "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存失败!短代码为空!";
                        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
    }
}
WebAPI/Models/ClsGy_PNLTypeLevel.cs
New file
@@ -0,0 +1,17 @@
using 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;
    }
}
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\" />
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>