1
chenhaozhe
7 天以前 3f64cbf0939459bf4fe946a89cbc3a500377af5c
WebAPI/Controllers/WebAPIController.cs
@@ -6,6 +6,7 @@
using Newtonsoft.Json.Linq;
using SQLHelper;
using System;
using System.Text;
using System.Collections.Generic;
using System.Data;
using System.IO;
@@ -89,7 +90,7 @@
        }
        /// <summary>
        /// 根据时间获取产量汇报单集合
        /// </summary>
@@ -358,7 +359,7 @@
                    return objjson;
                }
                //判断用户数是否大于客户账号数
                DataSet ds1 = oCN.RunProcReturn("Exec h_p_Xt_BaseInfo ", "h_p_Xt_BaseInfo");
                DataSet ds1 = oCN.RunProcReturn("Exec h_p_Xt_BaseInfo ", "h_p_Xt_BaseInfo");
                if (DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HBack"]) != "0")
                {
                    objjson.code = "0";
@@ -381,7 +382,7 @@
                        objjson.data = null;
                        return objjson;
                    }
                }
                }
                objjson.code = "0";
                objjson.count = 1;
@@ -496,15 +497,15 @@
        /// <returns></returns>
        [Route("Web/GetXGPassword")]
        [HttpGet]
        public object GetXGPassword(string UserName, string oldPassword, string PassWord, string Repassword,string HCloudUserName,string HCloudUserPsd)
        public object GetXGPassword(string UserName, string oldPassword, string PassWord, string Repassword, string HCloudUserName, string HCloudUserPsd)
        {
            try
            {
                ClsCN oCn = new ClsCN();
                DataSet oDs = new DataSet();
                //==========
                if(PassWord!=null)
                if (PassWord != null)
                {
                    oDs = oCn.RunProcReturn("select Czmm from  Gy_Czygl where Czybm='" + UserName + "'", "Gy_Czygl");
                    if (PassWord.Trim() != Repassword.Trim())
@@ -524,12 +525,12 @@
                        objjson.data = null;
                        return objjson; ;
                    }
                    oCn.RunProc("update  Gy_Czygl set Czmm='" + ClsPub.StrToPsd(PassWord.Trim()) + "',HCloudUserName = '" + HCloudUserName+ "',HCloudUserPsd = '" + HCloudUserPsd+ "' where Czybm='" + UserName.Trim() + "'");
                    oCn.RunProc("update  Gy_Czygl set Czmm='" + ClsPub.StrToPsd(PassWord.Trim()) + "',HCloudUserName = '" + HCloudUserName + "',HCloudUserPsd = '" + HCloudUserPsd + "' where Czybm='" + UserName.Trim() + "'");
                    objjson.code = "0";
                    objjson.count = 1;
                    objjson.Message = "* 密码修改成功!";
                    objjson.data = null;
                    return objjson;
                    return objjson;
                }
                else
                {
@@ -1213,7 +1214,7 @@
                return objjson;
            }
        }
        /// <summary>
        /// 获取仓位列表
        /// </summary>
@@ -2235,7 +2236,7 @@
        public object Gy_EnvironmentTestSchemeBillList_Json(string sWhere)
        {
            DataSet ds;
            if (sWhere != "")
            {
                sWhere = " and ( 生产部门 like '%" + sWhere + "%' or 工作中心 like '%" + sWhere + "%' or 工序名称 like '%" + sWhere + "%' or 检测项目 like '%" + sWhere + "%' ) ";
@@ -2698,7 +2699,7 @@
                        objJsonResult.Message = "保存失败!代码为空!";
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    }
                    //新增时判断
                    if (oItem.HItemID == 0)
                    {
@@ -2812,7 +2813,7 @@
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "保存成功!";;
                    objJsonResult.Message = "保存成功!"; ;
                    objJsonResult.data = 1;
                    return objJsonResult;
                }
@@ -2956,7 +2957,7 @@
                }
                //================================================================================== 
                oCN.Commit();//提交事务
                objJsonResult.code = "0";
                objJsonResult.count = 1;
@@ -3266,7 +3267,7 @@
                    if (ds.Tables[0].Rows.Count == 0)
                    {
                        oCN.RunProc("Insert into "  + "Gy_BadReason " +
                        oCN.RunProc("Insert into " + "Gy_BadReason " +
                        " (HNumber,HName,HHelpCode,HShortNumber,HParentID" +
                        ",HDeptID,HProcID" +
                        ",HLevel,HEndFlag,HStopflag,HRemark,HBadTypeID) " +
@@ -3276,7 +3277,7 @@
                    }
                    else
                    {
                        oCN.RunProc("Update Gy_BadReason"+ " set " +
                        oCN.RunProc("Update Gy_BadReason" + " set " +
                        "HName='" + HName + "'" +
                        ",HShortNumber='" + sShortNumber + "'" +
                        ",HHelpCode='" + HHelpCode + "'" +
@@ -3395,7 +3396,7 @@
                        objJsonResult.Message = "保存失败!代码为空!";
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    }
                    //新增时判断
                    if (oItem.HItemID == 0)
                    {
@@ -3556,7 +3557,7 @@
        [HttpGet]
        public object DeltetGy_BadType(string HItemID, string user)
        {
            DataSet ds;
            DataSet ds;
            try
            {
                //删除权限
@@ -3656,7 +3657,7 @@
                }
                //================================================================================== 
                oCN.Commit();//提交事务
                objJsonResult.code = "0";
                objJsonResult.count = 1;
@@ -3793,7 +3794,7 @@
                        {
                            tb2.Rows[i]["HOrgID"] = ds.Tables[0].Rows[0]["HItemID"].ToString();
                        }
                        if(HGroupNumber != "")
                        if (HGroupNumber != "")
                        {
                            //查询班组
                            ds = oCN.RunProcReturn("select * from Gy_Group where  HNumber='" + HGroupNumber + "' and Hname='" + HGroupName + "'", "Gy_Group");
@@ -3935,13 +3936,13 @@
                    if (ds.Tables[0].Rows.Count == 0)
                    {
                            oCN.RunProc("Insert into Gy_BadType" + " " +
                        " (HNumber,HName,HHelpCode,HShortNumber,HParentID" +
                        ",HGroupID" +
                        ",HLevel,HEndFlag,HStopflag,HRemark,HUSEORGID,HCREATEORGID,HUseFlag,HMakeEmp,HMakeTime) " +
                        " Values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + sShortNumber + "'," + 0 +
                        "," + HGroupID.ToString() +
                        "," + HLevel.ToString() + "," + HEndFlag + "," + 0 + ",'" + HRemark + "'," + HOrgID + "," + HOrgID + ",'" + "未检测" + "','" + user + "',getdate())", ref DBUtility.ClsPub.sExeReturnInfo);
                        oCN.RunProc("Insert into Gy_BadType" + " " +
                    " (HNumber,HName,HHelpCode,HShortNumber,HParentID" +
                    ",HGroupID" +
                    ",HLevel,HEndFlag,HStopflag,HRemark,HUSEORGID,HCREATEORGID,HUseFlag,HMakeEmp,HMakeTime) " +
                    " Values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + sShortNumber + "'," + 0 +
                    "," + HGroupID.ToString() +
                    "," + HLevel.ToString() + "," + HEndFlag + "," + 0 + ",'" + HRemark + "'," + HOrgID + "," + HOrgID + ",'" + "未检测" + "','" + user + "',getdate())", ref DBUtility.ClsPub.sExeReturnInfo);
                    }
                    else
@@ -4825,7 +4826,7 @@
                //保存完毕后处理
                bool bResult;
                if (oBill.oModel.HItemID == 0)
                {
                {
                    bResult = oBill.AddNew(ref DBUtility.ClsPub.sExeReturnInfo);
                }
                else
@@ -4980,7 +4981,7 @@
                    return objJsonResult;
                }
                //================================================================================== 
                oCN.Commit();//提交事务
                objJsonResult.code = "0";
                objJsonResult.count = 1;
@@ -5226,7 +5227,7 @@
                    if (ds.Tables[0].Rows.Count == 0)
                    {
                        oCN.RunProc("Insert into Gy_BadResult"  +
                        oCN.RunProc("Insert into Gy_BadResult" +
                        " (HNumber,HName,HHelpCode,HShortNumber,HParentID" +
                        ",HLevel,HEndFlag,HStopflag,HRemark,HMakeTime,HUSEORGID,HUseFlag,HMakeEmp,HISsystemSet,HCREATEORGID,HERPItemID) " +
                        " Values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + sShortNumber + "'," + 0 +
@@ -6296,7 +6297,7 @@
                    oItem.HMakeEmp = msg2; //创建人
                    oBill.oModel = oItem;
                }
                }
                //保存
                //保存完毕后处理
@@ -7140,7 +7141,7 @@
                bool bResult;
                if (oBill.oModel.HItemID == 0)
                {
                    bResult = oBill.AddNew();
                }
                else
@@ -7499,7 +7500,7 @@
        [HttpGet]
        public object DeltetGy_PostSkill(string HItemID, string user)
        {
            DataSet ds;
            DataSet ds;
            try
            {
                //删除权限
@@ -7583,7 +7584,7 @@
                    return objJsonResult;
                }
                //================================================================================== 
                oCN.Commit();//提交事务
                objJsonResult.code = "0";
                objJsonResult.count = 1;
@@ -7725,7 +7726,7 @@
                        }
                        string HORGid = ds.Tables[0].Rows[0]["HItemID"].ToString();
                        //查询岗位
                        ds = oCN.RunProcReturn("select * from Gy_Post where  HNumber='" + HPostNumber + "' and Hname='" + HPostName + "' and HUSEORGID = "+ HORGid, "Gy_Post");
                        ds = oCN.RunProcReturn("select * from Gy_Post where  HNumber='" + HPostNumber + "' and Hname='" + HPostName + "' and HUSEORGID = " + HORGid, "Gy_Post");
                        if (ds.Tables[0].Rows.Count == 0)
                        {
@@ -8226,7 +8227,7 @@
                }
                //================================================================================== 
                oCN.Commit();//提交事务
                objJsonResult.code = "0";
                objJsonResult.count = 1;
@@ -10705,11 +10706,11 @@
                    if (ds.Tables[0].Rows.Count == 0)
                    {
                            oCN.RunProc("Insert into "  + "Gy_SupType " +
                        " (HNumber,HName,HHelpCode,HShortNumber,HParentID" +
                        ",HLevel,HEndFlag,HStopflag,HRemark,HMakeTime,HUSEORGID,HUseFlag,HMakeEmp,HCREATEORGID) " +
                        " Values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + sShortNumber + "'," + 0 +
                        "," + HLevel.ToString() + "," + HEndFlag + "," + 0 + ",'" + HRemark + "','" + DateTime.Now + "','" + HOrgID + "','" + "未检测" + "','" + user + "','" + HOrgID + "')", ref DBUtility.ClsPub.sExeReturnInfo);
                        oCN.RunProc("Insert into " + "Gy_SupType " +
                    " (HNumber,HName,HHelpCode,HShortNumber,HParentID" +
                    ",HLevel,HEndFlag,HStopflag,HRemark,HMakeTime,HUSEORGID,HUseFlag,HMakeEmp,HCREATEORGID) " +
                    " Values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + sShortNumber + "'," + 0 +
                    "," + HLevel.ToString() + "," + HEndFlag + "," + 0 + ",'" + HRemark + "','" + DateTime.Now + "','" + HOrgID + "','" + "未检测" + "','" + user + "','" + HOrgID + "')", ref DBUtility.ClsPub.sExeReturnInfo);
                    }
                    else
                    {
@@ -11047,7 +11048,7 @@
                }
                //================================================================================== 
                oCN.Commit();//提交事务
                objJsonResult.code = "0";
                objJsonResult.count = 1;
@@ -12083,7 +12084,7 @@
                //保存完毕后处理
                bool bResult;
                if (oBill.oModel.HItemID == 0)
                {
                {
                    bResult = oBill.AddNew();
                }
                else
@@ -12242,7 +12243,7 @@
                    return objJsonResult;
                }
                //================================================================================== 
                oCN.Commit();//提交事务
                objJsonResult.code = "0";
                objJsonResult.count = 1;
@@ -13185,10 +13186,10 @@
                    if (ds.Tables[0].Rows.Count == 0)
                    {
                        oCN.RunProc("Insert into "  + "Gy_ErrMsgBackType " +
                        oCN.RunProc("Insert into " + "Gy_ErrMsgBackType " +
                    " (HNumber,HName,HHelpCode,HShortNumber,HParentID" +
                    ",HLevel,HEndFlag,HStopflag,HRemark,HMakeTime,HUSEORGID,HUseFlag,HMakeEmp,HCREATEORGID) " +
                    " Values('" + HProcessNum + "','" + HProcessName + "','" +  "','" + sShortNumber + "'," + 0 +
                    " Values('" + HProcessNum + "','" + HProcessName + "','" + "','" + sShortNumber + "'," + 0 +
                    "," + HLevel + "," + HEndFlag + "," + 0 + ",'" + HRemark + "','" + DateTime.Now + "','" + HOrgID + "','" + "未检测" + "','" + user + "','" + HOrgID + "')");
                    }
                    else
@@ -13304,7 +13305,7 @@
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    //新增时判断
                    if (oItem.HItemID == 0)
                    {
@@ -13416,7 +13417,7 @@
                }
                else
                {
                    bResult = oBill.ModifyByID(oBill.oModel.HItemID,ref DBUtility.ClsPub.sExeReturnInfo);
                    bResult = oBill.ModifyByID(oBill.oModel.HItemID, ref DBUtility.ClsPub.sExeReturnInfo);
                }
                if (bResult)
                {
@@ -13571,7 +13572,7 @@
                }
                //================================================================================== 
                oCN.Commit();//提交事务
                objJsonResult.code = "0";
                objJsonResult.count = 1;
@@ -15057,7 +15058,7 @@
                    return objJsonResult;
                }
                //================================================================================== 
                oCN.Commit();//提交事务
                objJsonResult.code = "0";
                objJsonResult.count = 1;
@@ -15300,7 +15301,7 @@
        [Route("DeltetGy_MaintainLev")]
        [HttpGet]
        public object DeltetGy_MaintainLev(string HItemID, string user)
        {
        {
            try
            {
                //删除权限
@@ -15493,7 +15494,7 @@
                    //新增时判断
                    if (oItem.HItemID == 0)
                    {
                        //检查父级是否存在
                        string sParent;
                        sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim());
@@ -15706,7 +15707,7 @@
                    return objJsonResult;
                }
                //================================================================================== 
                oCN.Commit();//提交事务
                objJsonResult.code = "0";
                objJsonResult.count = 1;
@@ -15954,7 +15955,7 @@
                    if (ds.Tables[0].Rows.Count == 0)
                    {
                        oCN.RunProc("Insert into " + "Gy_CheckNoteItem" +
                        oCN.RunProc("Insert into " + "Gy_CheckNoteItem" +
                    " (HNumber,HName,HHelpCode,HShortNumber,HParentID" +
                    ",HLevel,HEndFlag,HStopflag,HRemark,HMakeTime,HUSEORGID,HUseFlag,HMakeEmp,HCREATEORGID,HCheckPostID) " +
                    " Values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "'," + 0 +
@@ -15965,7 +15966,7 @@
                    else
                    {
                        oCN.RunProc("Update " + "Gy_CheckNoteItem" + " set " +
                        "HName='" + HName + "'" +
                        ",HShortNumber='" + HShortNumber + "'" +
                        ",HHelpCode='" + HHelpCode + "'" +
@@ -16092,7 +16093,7 @@
                    // 定义星期几的中文映射关系
                    Dictionary<DayOfWeek, string> chineseDayOfWeek = new Dictionary<DayOfWeek, string>
                    {
                        { DayOfWeek.Sunday, "星期日" },
                        { DayOfWeek.Sunday, "星期日" },
                        { DayOfWeek.Saturday, "星期六" }
                    };
@@ -16169,18 +16170,18 @@
            JObject msgObj = JObject.Parse(msg1);
            string HYear = msgObj["HYear"].ToString();
            string HNumber1 = msgObj["HDeptNumber"].ToString()+'-' + msgObj["HOrgNumber"].ToString();
            string HName1 = msgObj["HDeptName"].ToString()+'-'+msgObj["HOrgName"].ToString();
            string HNumber1 = msgObj["HDeptNumber"].ToString() + '-' + msgObj["HOrgNumber"].ToString();
            string HName1 = msgObj["HDeptName"].ToString() + '-' + msgObj["HOrgName"].ToString();
            string HOrgID = msgObj["HOrgID"].ToString();
            string HDeptID = msgObj["HDeptID"].ToString();
            string HDeptID = msgObj["HDeptID"].ToString();
            bool HStopflag = bool.Parse(msgObj["HStopflag"].ToString());
            string HRemark= msgObj["HRemark"].ToString();
            string HUSEORGID= msgObj["HUSEORGID"].ToString();
            string HHelpCode= msgObj["HHelpCode"].ToString();
            string HRemark = msgObj["HRemark"].ToString();
            string HUSEORGID = msgObj["HUSEORGID"].ToString();
            string HHelpCode = msgObj["HHelpCode"].ToString();
            string HMakeEmp = msg2; //创建人
            bool Sunday = Convert.ToBoolean(msgObj["Sunday"]);
            bool Saturday = Convert.ToBoolean(msgObj["Saturday"]);
            List<Tuple<DateTime, string>> sundaysInYear = GetSundaysInYear(Convert.ToInt32(HYear),  Sunday,  Saturday);
            List<Tuple<DateTime, string>> sundaysInYear = GetSundaysInYear(Convert.ToInt32(HYear), Sunday, Saturday);
            foreach (var oItem in sundaysInYear)
            {
@@ -16201,11 +16202,11 @@
                string HNumber = "";
                string HName = "";
                HNumber = HNumber1 + '-' + HDate;
                 HName = HName1 + '-' + HDate;
                HName = HName1 + '-' + HDate;
                //先查看数据库有没有
                ds = oCN.RunProcReturn("select * from Gy_RestDay where HRestDay='" + HRestDay + "' and HOrgID='" + HOrgID + "' and HDeptID='" + HDeptID + "'", "Gy_RestDay");
                if (ds.Tables[0].Rows.Count<1)
                if (ds.Tables[0].Rows.Count < 1)
                {
                    oCN.RunProc("Insert into Gy_RestDay " +
                   " (HNumber,HName,HHelpCode,HShortNumber,HParentID" +
@@ -16214,7 +16215,7 @@
                   " Values('" + HNumber + "','" + HName + "','" + HHelpCode + "',''," + 0 +
                   "," + 0 + "," + 0 + "," + Convert.ToString(HStopflag ? 1 : 0) + ",'" + HRemark + "','" + DateTime.Now + "','" + HUSEORGID + "',' 未检测','" + HMakeEmp + "','" + HUSEORGID + "'" +
                   ",'" + HOrgID.ToString() + "','" + HDeptID.ToString() + "','" + HRestDay.ToString() + "','" + HWeekDay.ToString() + "')");
                }
                }
            }
            objJsonResult.code = "0";
            objJsonResult.count = 1;
@@ -16300,7 +16301,7 @@
        }
        //获取一年中的周六,周日或者两个同时获取
        public List<Tuple<DateTime, string>> GetSundaysInYear(int HYear, bool Sunday,bool Saturday)
        public List<Tuple<DateTime, string>> GetSundaysInYear(int HYear, bool Sunday, bool Saturday)
        {
            List<Tuple<DateTime, string>> Days = new List<Tuple<DateTime, string>>();
            DateTime startDate = new DateTime(HYear, 1, 1);
@@ -16340,16 +16341,16 @@
                        {
                            weekdayChinese = "星期天";
                            Days.Add(Tuple.Create(startDate, weekdayChinese));
                        }
                        }
                        else if (startDate.DayOfWeek == DayOfWeek.Saturday)
                        {
                            weekdayChinese = "星期六";
                            Days.Add(Tuple.Create(startDate, weekdayChinese));
                        }
                        }
                    }
                    startDate = startDate.AddDays(1);
                }
            }
            }
            return Days;
        }
@@ -17421,7 +17422,7 @@
                    return objJsonResult;
                }
                //================================================================================== 
                oCN.Commit();//提交事务
                objJsonResult.code = "0";
                objJsonResult.count = 1;
@@ -18314,7 +18315,7 @@
                oCN.RunProc("delete from EqiupMaterWorkTimes where HItemID=" + HItemID);
                oCN.Commit();//提交事务
                objJsonResult.code = "0";
                objJsonResult.count = 1;
@@ -18652,7 +18653,7 @@
                    objjson.data = ds.Tables[0];
                    return objjson;
                }
            }catch(Exception e)
            } catch (Exception e)
            {
                objjson.code = "0";
                objjson.count = 0;
@@ -19400,17 +19401,17 @@
        [HttpGet]
        public object GetPatrolCheckItemList_Json(string CheckItem)
        {
            DataSet ds;
            DataSet ds;
            try
            {
                sWhere = " Where HStopFlag=0 and HEndFlag=1";
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                if(CheckItem != "" && CheckItem != null)
                if (CheckItem != "" && CheckItem != null)
                {
                    sWhere = sWhere + " and ( HNumber like '%" + CheckItem + "%' or HName like '%" + CheckItem + "%' ) ";
                }
                ds = oCN.RunProcReturn("Select HItemID,HNumber,HName  from Gy_PatrolCheck " + sWhere + " Order by HItemID ", "Gy_DotCheck");
                if(ds == null )
                if (ds == null)
                {
                    objjson.code = "0";
                    objjson.count = 0;
@@ -19427,7 +19428,7 @@
                    return objjson;
                }
            }
            catch(Exception ex)
            catch (Exception ex)
            {
                objjson.code = "0";
                objjson.count = 0;
@@ -19649,15 +19650,15 @@
        /// <returns></returns>
        [Route("Web/GetSc_ProcessExchangeBillListView")]
        [HttpGet]
        public object GetSc_ProcessExchangeBillListView(string sWhere,int OrganizationID)
        {
        public object GetSc_ProcessExchangeBillListView(string sWhere, int OrganizationID)
        {
            try
            {
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("select top 300 * from h_v_Sc_ProcessExchangeBillList_PDA where 1=1  order by 单据号 desc,hsubid", "h_v_Sc_ProcessExchangeBillList_PDA");
                }
                }
                else
                {
                    string sql = "select * from h_v_Sc_ProcessExchangeBillList_PDA  where 1=1 " + sWhere + " order by 单据号 desc,hsubid ";
@@ -19960,12 +19961,12 @@
        /// <returns></returns>
        [Route("Web/GetCheckItemID")]
        [HttpGet]
        public object GetCheckItemID(string HName,string HProName,string HSourceID)
        {
        public object GetCheckItemID(string HName, string HProName, string HSourceID)
        {
            try
            {
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                ds = oCN.RunProcReturn("select  top 1 * from h_v_Gy_QCCheckProjectList_Main where 物料名称='"+HName+ "' and 工序名称='" + HProName + "' and HSourceID='" + HSourceID + "'   order by 日期 desc ", "h_v_Gy_QCCheckProjectList_Main");
                ds = oCN.RunProcReturn("select  top 1 * from h_v_Gy_QCCheckProjectList_Main where 物料名称='" + HName + "' and 工序名称='" + HProName + "' and HSourceID='" + HSourceID + "'   order by 日期 desc ", "h_v_Gy_QCCheckProjectList_Main");
                if (ds == null || ds.Tables[0].Rows.Count <= 0)
                {
                    ds = oCN.RunProcReturn("select  top 1 * from h_v_Gy_QCCheckProjectList_Main where 物料名称='" + HName + "' and 工序名称 ='" + HProName + "'  order by 日期 desc ", "h_v_Gy_QCCheckProjectList_Main");
@@ -21095,6 +21096,118 @@
                return objjson; ;
            }
        }
        #region [从数据库加载菜单 APP]
        //public class AppMenuLoad
        //{
        //    public string HitemID { get; set; } // 主键
        //    public string HPartentID { get; set; } = "0"; // 父节点ID
        //    public string HEntryID { get; set; } // 菜单节点id
        //    public string HIndex { get; set; }
        //    public string HName { get; set; }
        //    public string HMenuName { get; set; }
        //    public string HPicNum { get; set; }
        //    public string HShowMode { get; set; }
        //    public string HTranslationText_English { get; set; }
        //    public string HTranslationText_Spain { get; set; }
        //    public string HMaker { get; set; }
        //    public List<MenuLoad> childMenus { get; set; }
        //}
        //[Route("Web/MenuList_APP")]
        //[HttpGet]
        //public object MenuList_APP(string HMaker, string HType)
        //{
        //    try {
        //        DataSet ds = oCN.RunProcReturn("exec h_p_Gy_MenuDefineSet_APP_Get" +
        //            "@HMaker = '" + HMaker + "'" +
        //            "@HType = '" + HType + "'"
        //            , "h_p_Gy_MenuDefineSet_APP_Get");
        //        if((bool)ds.Tables[0].Rows[0]["returntype"] == true)
        //        {
        //            objJsonResult.code = "1";
        //            objJsonResult.count = 1;
        //            objJsonResult.Message = ds.Tables[0].Rows[0]["mesg"].ToString();
        //            objJsonResult.data = ds.Tables[1];
        //            return objJsonResult;
        //        }
        //        else
        //        {
        //            objJsonResult.code = "0";
        //            objJsonResult.count = 0;
        //            objJsonResult.Message = ds.Tables[0].Rows[0]["mesg"].ToString();
        //            return objJsonResult;
        //        }
        //    }
        //    catch(Exception e)
        //    {
        //        objJsonResult.code = "0";
        //        objJsonResult.count = 0;
        //        objJsonResult.Message = e.ToString();
        //        objJsonResult.data = null;
        //        return objJsonResult;
        //    }
        //}
        //[Route("Web/SetMenuList_APP")]
        //[HttpPost]
        //public object SetMenuList_APP([FromBody] JObject oMain)
        //{
        //    var _value = oMain["oMain"].ToString();
        //    string msg1 = _value.ToString();
        //    string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
        //    try
        //    {
        //        string msg2 = sArray[0];
        //        string user = sArray[1].ToString();
        //        string MenuName = sArray[2].ToString();
        //        string type = sArray[3].ToString();
        //        if (String.Equals(type, "APP", StringComparison.InvariantCultureIgnoreCase))
        //        {
        //            oCN.BeginTran();
        //            List<AppMenuLoad> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<AppMenuLoad>>(msg2);
        //            string sql1 = "delete from Gy_MenuDefineSet_APP where HMenuName = '" + MenuName + "' and HMaker = '" + user + "'";
        //            oCN.RunProcReturn(sql1, "Gy_MenuDefineSet_APP");
        //            list.ForEach(one =>
        //            {
        //                string sql2 = "insert into Gy_MenuDefineSet_APP( HEntryID, HIndex, HName, HMenuName, HPicNum, HShowMode, HMaker)" +
        //               "Values('" + one.HEntryID + "','" + one.HIndex + "','" + one.HName + "','" + one.HName +
        //               "','" + MenuName + "','" + one.HPicNum + "','" + one.HShowMode + "','" + user + "')";
        //                oCN.RunProcReturn(sql2, "Gy_MenuDefineSet_APP");
        //            });
        //            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 = e.ToString();
        //        objJsonResult.data = null;
        //        return objJsonResult;
        //    }
        //}
        #endregion
        #region [从数据库加载菜单]
        public class MenuLoad
@@ -21132,8 +21245,14 @@
                    ds = oCn.RunProcReturn(sql1, "Gy_MenuDefineSet");        //查询用户绑定的角色 是否设置菜单信息 取角色名称最短的一个
                    if ((ds.Tables[0] == null || ds.Tables[0].Rows.Count == 0))
                    {
                        sql = "Select HitemID,HNumber,HName,HPartentID,HLevel,Hurl,HShowMode,isnull(HTranslationText_English,HName) HTranslationText_English,isnull(HTranslationText_Spain,HName) HTranslationText_Spain,HPicNum from Gy_Menu_1 where HType = '" + HType + "' Order by HPosition,len(HitemID),HitemID  ";
                        ds = oCn.RunProcReturn(sql, "Gy_Menu_1");
                        sql1 = "select HItemID,HPartentID,HNumber,HName,HLevel,Hurl,HType,HPicNum,HShowMode,isnull(HTranslationText_English,HName) HTranslationText_English,isnull(HTranslationText_Spain,HName) HTranslationText_Spain  from Gy_MenuDefineSet where HMakeName = 'admin' and HType = '" + HType + "' order by HPosition";
                        ds = oCn.RunProcReturn(sql1, "Gy_MenuDefineSet");   //查询admin 是否设置菜单信息
                        if ((ds.Tables[0] == null || ds.Tables[0].Rows.Count == 0))
                        {
                            sql = "Select HitemID,HNumber,HName,HPartentID,HLevel,Hurl,HShowMode,isnull(HTranslationText_English,HName) HTranslationText_English,isnull(HTranslationText_Spain,HName) HTranslationText_Spain,HPicNum from Gy_Menu_1 where HType = '" + HType + "' Order by HPosition,len(HitemID),HitemID  ";
                            ds = oCn.RunProcReturn(sql, "Gy_Menu_1");
                        }
                    }                 
                }