llj
9 天以前 f0e9b7ca417d91480759345a83c03004216305e9
WebAPI/Controllers/WebAPIController.cs
@@ -1150,7 +1150,52 @@
            }
        }
        /// <summary>
        /// 获取仓库列表  --添加模具仓库条件  用于只查询模具仓库
        /// </summary>
        /// <returns></returns>
        [Route("Web/GetWarehouseList_Json_MJ")]
        [HttpGet]
        public object GetWarehouseList_Json_MJ(string Warehouse, Int64 HOrgID)
        {
            sWhere = " Where HStopFlag=0  and HEndFlag=1 and HWarehouseType='模具仓库' and HUSEORGID =" + HOrgID + "";
            //sWhere = " Where HStopFlag=0  and HEndFlag=1  and HUSEORGID = " + DBUtility.ClsPub.HORGANIZATIONSID.ToString();
            if (Warehouse != "")
            {
                sWhere = sWhere + " and ( HNumber like '%" + Warehouse + "%' or HName like '%" + Warehouse + "%'  or HUSEORGID like '%" + Warehouse + "%' ) ";
            }
            try
            {
                WebS.WebService1 oWeb = new WebS.WebService1();
                ds = oWeb.GetWarehouseList(sWhere, ref DBUtility.ClsPub.sErrInfo);
                if (ds == null || ds.Tables[0].Rows.Count <= 0)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败" + DBUtility.ClsPub.sErrInfo;
                    objjson.data = null;
                    return objjson;
                }
                else
                {
                    objjson.code = "0";
                    objjson.count = 1;
                    objjson.Message = "获取成功!";
                    objjson.data = ds.Tables[0];
                    return objjson;
                }
            }
            catch (Exception ex)
            {
                objjson.code = "0";
                objjson.count = 0;
                objjson.Message = "获取失败" + ex.ToString();
                objjson.data = null;
                return objjson;
            }
        }
        /// <summary>
        /// 获取仓位列表
@@ -1466,14 +1511,68 @@
            }
        }
        #region 获取职员列表 (添加车间筛选)
        [Route("Web/GetEmployeeList_Json")]
        [HttpGet]
        public object GetEmployeeList_Json3(string Employee, Int64 HGroupID, Int64 HDeptID = -1)
        {
            // 给部门(车间)ID设置默认值,当没有传入值或者值为0的时候,走旧有的函数,否则走新的逻辑
            if(HDeptID == -1 || HDeptID == 0)
            {
                return GetEmployeeList_Json2(Employee, HGroupID);
            }else
            {
                sWhere = $" Where HStopFlag=0  and HEndFlag=1  and HDeptID=${HDeptID}";
                if(Employee != "")
                {
                    sWhere += " and ( HNumber like '%" + Employee + "%' or HName like '%" + Employee + "%' )";
                }
                if(HGroupID != 0)
                {
                    sWhere += " and HGroupID=" + HGroupID.ToString();
                }
                try
                {
                    string sql = $"Select * from h_v_IF_Emp {sWhere} Order by HNumber";
                    ds = oCN.RunProcReturn(sql, "h_v_IF_Emp");
                    if (ds == null || ds.Tables[0].Rows.Count <= 0)
                    {
                        // 如果 递入 部门没有维护人员列表 则降级使用老方案
                        return GetEmployeeList_Json2(Employee, HGroupID);
                    }
                    else
                    {
                        objjson.code = "0";
                        objjson.count = 1;
                        objjson.Message = "获取成功!";
                        objjson.data = ds.Tables[0];
                        return objjson;
                    }
                }
                catch (Exception ex)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败" + ex.ToString();
                    objjson.data = null;
                    return objjson;
                }
            }
        }
        #endregion
        /// <summary>
        /// 获取职员列表
        /// </summary>
        /// <returns></returns>
        [Route("Web/GetEmployeeList_Json")]
        [HttpGet]
        public object GetEmployeeList_Json(string Employee, Int64 HGroupID)
        // [Route("Web/GetEmployeeList_Json")]
        // [HttpGet]
        public object GetEmployeeList_Json2(string Employee, Int64 HGroupID)
        {
            sWhere = " Where HStopFlag=0  and HEndFlag=1";
            //sWhere = " Where HStopFlag=0  and HEndFlag=1  and HUSEORGID = " + DBUtility.ClsPub.HORGANIZATIONSID.ToString();
@@ -1492,11 +1591,11 @@
            {
                if (Employee != "")
                {
                    sWhere = " Where HStopFlag=0 and HWHID=" + HGroupID.ToString() + " and ( HNumber like '%" + Employee + "%' or HName like '%" + Employee + "%' ) ";
                    sWhere = " Where HStopFlag=0 and HGroupID=" + HGroupID.ToString() + " and ( HNumber like '%" + Employee + "%' or HName like '%" + Employee + "%' ) ";
                }
                else
                {
                    sWhere = " Where HStopFlag=0 and HWHID=" + HGroupID.ToString();
                    sWhere = " Where HStopFlag=0 and HGroupID=" + HGroupID.ToString();
                }
            }
            try
@@ -1531,6 +1630,7 @@
            }
        }
        /// <summary>
        /// 获取班次列表
@@ -20070,7 +20170,7 @@
                List<object> columnNameList = new List<object>();
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                string sql = "Select * from h_v_Gy_GetSampleSchemeListView where 1 = 1 " + sWhere + "Order by hmainid ";
                string sql = "Select * from h_v_Gy_GetSampleSchemeListView where 1 = 1 and HUSEORGID = "+OrganizationID + sWhere + "Order by hmainid ";
                ds = oCN.RunProcReturn(sql, "h_v_Gy_GetSampleSchemeListView");
                //添加列名
@@ -20333,6 +20433,7 @@
            try
            {
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                string sql = "exec h_p_Gy_GetQCCheckItemByProject_Sec " + CheckProjectID + "," + HBatchQty + "," + HMaterID + ",'" + HBillType + "'";
                ds = oCN.RunProcReturn(sql, "h_p_Gy_GetQCCheckItemByProject_Sec");
                if (ds == null || ds.Tables[0].Rows.Count <= 0)
@@ -20930,6 +21031,80 @@
            }
        }
        #region
        [Route("Web/GetMouldBillsList")]
        [HttpGet]
        public object GetMouldBillsList(string sWhere, string Type, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                string HView = "";
                switch (Type)
                {
                    case "RC": // 模具维修检验单
                        HView = "h_v_Sc_MouldRepairCheckBillList";
                        break;
                    case "PG": // 模具维修派工单
                        HView = "h_v_Sc_MouldRepairSendWorkBill";
                        break;
                    default:
                        objjson.code = "0";
                        objjson.count = 0;
                        objjson.Message = "设备模块类型错误!";
                        objjson.data = null;
                        return objjson;
                }
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                ds = oCN.RunProcReturn("select ManagerFlag from gy_czygl where czymc='" + user.Trim() + "'", "gy_czygl");
                if (!(bool)ds.Tables[0].Rows[0]["ManagerFlag"])  //是否管理员
                {
                    //不是管理员
                    sWhere += " and 制单人 = '" + user + "'";
                }
                string sql = string.Format(@"select * from " + HView + " where 1 = 1 " + sWhere + " order by 日期 desc, hmainid desc");
                ds = oCN.RunProcReturn(sql, HView);
                //添加列名
                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 == null || ds.Tables[0].Rows.Count <= 0)
                {
                    objjson.code = "1";
                    objjson.count = 1;
                    objjson.Message = "获取失败,查无数据";
                    objjson.data = null;
                    objjson.list = columnNameList;
                    return objjson;
                }
                else
                {
                    objjson.code = "1";
                    objjson.count = 1;
                    objjson.Message = "获取成功!";
                    objjson.data = ds.Tables[0];
                    objjson.list = columnNameList;
                    return objjson;
                }
            }
            catch (Exception ex)
            {
                objjson.code = "0";
                objjson.count = 0;
                objjson.Message = "获取失败" + ex.ToString();
                objjson.data = null;
                return objjson;
            }
        }
        #endregion
        /// <summary>
        /// 查询各类设备单据列表(设备点检,设备维修,设备保养......)
        /// </summary>
@@ -20965,6 +21140,9 @@
                    case "XJ":
                        HView = "h_v_Sb_EquipPatrolCheckBillList";
                        break;
                    case "PG": // 设备维修派工单
                        HView = "h_v_Sb_EquipRepairSendWorkBillList";
                        break;
                    default:
                        objjson.code = "0";
                        objjson.count = 0;
@@ -20983,7 +21161,7 @@
                }
                string sql = string.Format(@"select * from " + HView + " where 1 = 1 " + sWhere);
                string sql = string.Format(@"select * from " + HView + " where 1 = 1 " + sWhere + " order by 日期 desc, hmainid desc");
                ds = oCN.RunProcReturn(sql, HView);
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
@@ -21587,6 +21765,8 @@
            public string HTranslationText_English { get; set; }
            public string HTranslationText_Spain { get; set; }
            public List<MenuLoad> childMenus { get; set; }
            public DateTime HMakeDate { get; set; }
            public string HMaker { get; set; }
        }
        [Route("Web/MenuList")]
@@ -21693,6 +21873,163 @@
        }
        #endregion
        #region 构建路由嵌套对象
        [Route("Web/MenuList_1")]
        [HttpGet]
        public object MenuList_1(string HMakeName, string HType)
        {
            try
            {
                string filePath = HttpContext.Current.Server.MapPath($"~/RouterDisplay/DisplayConfig.json");
                string directory = Path.GetDirectoryName(filePath);
                if (!string.IsNullOrEmpty(directory) && !Directory.Exists(directory))
                {
                    Directory.CreateDirectory(directory);
                }
                DateTime lastWriteTime = File.GetLastWriteTime(filePath);
                lastWriteTime = new DateTime(lastWriteTime.Year, lastWriteTime.Month, lastWriteTime.Day, lastWriteTime.Hour, 0, 0);
                DataSet ds = oCN.RunProcReturn($"select top 1 HMakeDate from Gy_Menu_1_build ORDER BY HMakeDate desc  ", "Gy_Menu_1_build");
                DateTime dbTime = Convert.ToDateTime(ds.Tables[0].Rows[0]["HMakeDate"]);
                dbTime = new DateTime(dbTime.Year, dbTime.Month, dbTime.Day, dbTime.Hour, 0, 0);
                if (dbTime> lastWriteTime)
                {
                    List<MenuLoad> mu = new List<MenuLoad>();                       //以父子级结构存放菜单清单信息
                    SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();            //数据库操作工具
                    string sql = "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 = '" + HMakeName + "' and HType = '" + HType + "' order by HPosition";
                    ds = oCn.RunProcReturn(sql, "Gy_MenuDefineSet");        //查询当前用户的自定义菜单数据
                    if (ds.Tables[0] == null || ds.Tables[0].Rows.Count == 0) //判断当前用户是否有设置过自定义信息,若记录数为0,则没有设置过,加载所有的菜单信息
                    {
                        string 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=" +
                            "(select   top 1 c.GroupName  from Gy_Czygl a left join System_UserGroupInfo b on a.Czybm = b.UserId  " +
                            "left join System_UserGroup c on b.GroupId = c.GroupID  where a.Czymc ='" + HMakeName + "' order by len(c.GroupName ))";
                        ds = oCn.RunProcReturn(sql1, "Gy_MenuDefineSet");        //查询用户绑定的角色 是否设置菜单信息 取角色名称最短的一个
                        if ((ds.Tables[0] == null || ds.Tables[0].Rows.Count == 0))
                        {
                            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_build where HType = '" + HType + "' Order by HPosition,len(HitemID),HitemID  ";
                                ds = oCn.RunProcReturn(sql, "Gy_Menu_1_build");
                            }
                        }
                    }
                    for (int i = 0; i < ds.Tables[0].Rows.Count; i++)       //将菜单的根节点保存到列表menu中
                    {
                        if (ds.Tables[0].Rows[i]["HPartentID"].ToString() == "0" || ds.Tables[0].Rows[i]["HitemID"].ToString() == ds.Tables[0].Rows[i]["HPartentID"].ToString())  //判断是否最外层根节点
                        {
                            MenuLoad tbj = new MenuLoad();
                            tbj.HitemID = ds.Tables[0].Rows[i]["HitemID"].ToString();
                            tbj.HNumber = ds.Tables[0].Rows[i]["HNumber"].ToString();
                            tbj.HName = ds.Tables[0].Rows[i]["HName"].ToString();
                            tbj.HPartentID = ds.Tables[0].Rows[i]["HPartentID"].ToString();
                            tbj.HLevel = int.Parse(ds.Tables[0].Rows[i]["HLevel"].ToString());
                            tbj.Hurl = ds.Tables[0].Rows[i]["Hurl"].ToString();
                            tbj.HShowMode = ds.Tables[0].Rows[i]["HShowMode"].ToString();
                            tbj.HTranslationText_English = ds.Tables[0].Rows[i]["HTranslationText_English"].ToString();
                            tbj.HTranslationText_Spain = ds.Tables[0].Rows[i]["HTranslationText_Spain"].ToString();
                            if (ds.Tables[0].Rows[i]["HPicNum"] != null)
                            {
                                tbj.HPicNum = ds.Tables[0].Rows[i]["HPicNum"].ToString();
                            }
                            mu.Add(tbj);
                        }
                    }
                    diguiLoad(ds.Tables[0], mu);                //使用递归,将需要加载的数据以父子级的结构存放在mu中
                    objJsonResult.code = "1";//信号参数
                    objJsonResult.count = 1;
                    objJsonResult.Message = "查询成功!";
                    objJsonResult.data = Newtonsoft.Json.JsonConvert.SerializeObject(mu);
                    return objJsonResult;
                }
                else
                {
                    string josncontext = File.ReadAllText(filePath);
                    objJsonResult.code = "2";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "查询成功!";
                    objJsonResult.data = josncontext;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "查询失败!";
                objJsonResult.data = e.ToString();
                return objJsonResult;
            }
        }
        public class RequestDto
        {
            public string content { get; set; }
        }
        [Route("Web/buildRouteObj")]
        [HttpPost]
        public object buildRouteObj([FromBody] RequestDto request)
        {
            string filePath = HttpContext.Current.Server.MapPath($"~/RouterDisplay/DisplayConfig.json");
            try
            {
                string jsonContent = request.content;
                if (string.IsNullOrEmpty(jsonContent))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "JSON 内容不能为空!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (string.IsNullOrWhiteSpace(filePath))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "文件路径不能为空。!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                string directory = Path.GetDirectoryName(filePath);
                if (!string.IsNullOrEmpty(directory) && !Directory.Exists(directory))
                {
                    Directory.CreateDirectory(directory);
                }
                string contentToWrite = jsonContent;
                File.WriteAllText(filePath, contentToWrite);
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "文件保存成功,路径为"+filePath;
                objJsonResult.data = null;
                LogService.Write($"路径为{filePath}");
                return objJsonResult;
            }
            catch (Exception e)
            {
                LogService.Write("Exception!" + e.ToString());
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region [菜单目录自定义]
@@ -23098,5 +23435,299 @@
            }
        }
        #endregion
        #region 用于连接的健康度检验,只要能访问通这个接口,则表明连接可用
        [Route("Health")]
        [HttpGet]
        public IHttpActionResult CheckHealth()
        {
            // 返回 200 状态码 确认健康状态
            return Ok();
        }
        #endregion
        #region 登录用户与设备ClientID 的关系 写入数据库
        [Route("Web/SetGy_UserClientIdConnection")]
        [HttpPost]
        public object SetGy_UserClientIdConnection([FromBody] JObject msg)
        {
            DataSet ds;
            oCN.BeginTran();
            try
            {
                ds = oCN.RunProcReturn($@"exec h_p_SetGy_UserClientIdRelation
                @HUserbm=N'{msg["HUserbm"].ToString()}',
               @HUserName=N'{msg["HUserName"].ToString()}',
               @HClientID=N'{msg["HClientID"].ToString()}',
                @HOnline={msg["HOnline"].ToString()}
                ", "h_p_SetGy_UserClientIdRelation");
                if(ds.Tables[0].Rows[0]["HStatus"].ToString() == "1")
                {
                    oCN.Commit();
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "保存设备信息成功!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    oCN.RollBack();
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "保存设备信息失败!" + ds.Tables[0].Rows[0]["msg"];
                    objJsonResult.data = null;
                    return objJsonResult;
                }
            }catch(Exception e)
            {
                oCN.RollBack();
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "保存设备信息失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region APP 根据模块获取该模块下需要显示消息标识的子模块
        [Route("Web/getMessageIdentified")]
        [HttpGet]
        public object getMessageIdentified(string user, string moduleName)
        {
            DataSet oDs = oCN.RunProcReturn($"exec h_p_getMessageIdentifier_APP '{user}', '{moduleName}'", "h_p_getMessageIdentifier_APP");
            if(oDs == null || oDs.Tables[0].Rows.Count == 0)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "获取消息标识失败!";
                objJsonResult.data = null;
                return objJsonResult;
            }
            else
            {
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "获取消息标识成功!";
                objJsonResult.data = oDs.Tables[0];
                return objJsonResult;
            }
        }
        #endregion
        #region 模具待上模查询 获取
        [Route("Web/getSc_MouldUpperAwaitQuery")]
        [HttpGet]
        public object getSc_MouldUpperAwaitQuery(string user, string HBeginDate = "", string HEndDate = "")
        {
            if(HBeginDate == "") // 默认7天间距
            {
                HBeginDate = DateTime.Now.AddDays(-7).ToString("yyyy-MM-dd");
            }
            if(HEndDate == "")
            {
                HEndDate = DateTime.Today.ToString("yyyy-MM-dd");
            }
            List<object> columnNameList = new List<object>();
            try
            {
                DataSet oDs = oCN.RunProcReturn($" exec h_p_Sc_MouldUpperAwaitQuery '{user}', '{HBeginDate}', '{HEndDate}'", "h_p_Sc_MouldUpperAwaitQuery");
                if(oDs == null || oDs.Tables[0].Rows.Count == 0)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败, 单据无返回值!";
                    objjson.data = null;
                    return objjson;
                }else
                {
                    //添加列名
                    foreach (DataColumn col in oDs.Tables[0].Columns)
                    {
                        Type dataType = col.DataType;
                        string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                        columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
                    }
                    objjson.code = "1";
                    objjson.count = 1;
                    objjson.Message = "获取成功!";
                    objjson.data = oDs.Tables[0];
                    objjson.list = columnNameList;
                    return objjson;
                }
            }catch(Exception ex)
            {
                LogService.Write(ex.ToString());
                objjson.code = "0";
                objjson.count = 0;
                objjson.Message = "获取失败" + ex.Message.ToString();
                objjson.data = null;
                return objjson;
            }
        }
        #endregion
        #region 待开工列表 获取
        [Route("Web/getCj_StationInBillAwaitQuery")]
        [HttpGet]
        public object getCj_StationInBillAwaitQuery(string user, string HBeginDate = "", string HEndDate = "")
        {
            if (HBeginDate == "") // 默认7天间距
            {
                HBeginDate = DateTime.Now.AddDays(-7).ToString("yyyy-MM-dd");
            }
            if (HEndDate == "")
            {
                HEndDate = DateTime.Today.ToString("yyyy-MM-dd");
            }
            List<object> columnNameList = new List<object>();
            try
            {
                DataSet oDs = oCN.RunProcReturn($" exec h_p_Cj_StationInBillAwaitQuery '{user}', '{HBeginDate}', '{HEndDate}'", "h_p_Cj_StationInBillAwaitQuery");
                if (oDs == null || oDs.Tables[0].Rows.Count == 0)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败, 单据无返回值!";
                    objjson.data = null;
                    return objjson;
                }
                else
                {
                    //添加列名
                    foreach (DataColumn col in oDs.Tables[0].Columns)
                    {
                        Type dataType = col.DataType;
                        string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                        columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
                    }
                    objjson.code = "1";
                    objjson.count = 1;
                    objjson.Message = "获取成功!";
                    objjson.data = oDs.Tables[0];
                    objjson.list = columnNameList;
                    return objjson;
                }
            }
            catch (Exception ex)
            {
                LogService.Write(ex.ToString());
                objjson.code = "0";
                objjson.count = 0;
                objjson.Message = "获取失败" + ex.Message.ToString();
                objjson.data = null;
                return objjson;
            }
        }
        #endregion
        #region 模具待下模查询 获取
        [Route("Web/getSc_MouldLowerBillAwaitQuery")]
        [HttpGet]
        public object getSc_MouldLowerBillAwaitQuery(string user, string HBeginDate = "", string HEndDate = "")
        {
            if (HBeginDate == "") // 默认7天间距
            {
                HBeginDate = DateTime.Now.AddDays(-7).ToString("yyyy-MM-dd");
            }
            if (HEndDate == "")
            {
                HEndDate = DateTime.Today.ToString("yyyy-MM-dd");
            }
            List<object> columnNameList = new List<object>();
            try
            {
                DataSet oDs = oCN.RunProcReturn($" exec h_p_Sc_MouldLowerBillAwaitQuery '{user}', '{HBeginDate}', '{HEndDate}'", "h_p_Sc_MouldLowerBillAwaitQuery");
                if (oDs == null || oDs.Tables[0].Rows.Count == 0)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败, 单据无返回值!";
                    objjson.data = null;
                    return objjson;
                }
                else
                {
                    //添加列名
                    foreach (DataColumn col in oDs.Tables[0].Columns)
                    {
                        Type dataType = col.DataType;
                        string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                        columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
                    }
                    objjson.code = "1";
                    objjson.count = 1;
                    objjson.Message = "获取成功!";
                    objjson.data = oDs.Tables[0];
                    objjson.list = columnNameList;
                    return objjson;
                }
            }
            catch (Exception ex)
            {
                LogService.Write(ex.ToString());
                objjson.code = "0";
                objjson.count = 0;
                objjson.Message = "获取失败" + ex.Message.ToString();
                objjson.data = null;
                return objjson;
            }
        }
        #endregion
        #region 获取 设备绑定职员信息(带出模具职员信息) 华舟
        [Route("Web/getEquipBindingEmp")]
        [HttpGet]
        public object getEquipBindingEmp(string HEquipNumber)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                ds = oCN.RunProcReturn($"exec h_p_getEquipBindingEmp_huazhou {HEquipNumber}", "h_p_getEquipBindingEmp_huazhou");
                if (ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "当前设备没有上模信息";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //添加列名
                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 ex)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "查询数据异常,请与管理员联系!" + ex.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
    }
}