WebAPI/Controllers/BaseSet/Gy_EmployeeController.cs
@@ -1308,5 +1308,56 @@
        }
        #endregion
        #region 根据班组返回职员信息
        /// <summary>
        /// 根据班组返回职员信息
        /// </summary>
        /// <returns></returns>
        [Route("Gy_EmployeeController/GetEmpInfoByGroup_Json")]
        [HttpGet]
        public object GetEmpInfoByGroup_Json(Int64 HGroupID)
        {
            try
            {
                //返回列表信息
                ds = oCN.RunProcReturn("select * from h_v_IF_EmployeeList where 禁用标记='' and HGroupID=" + HGroupID + " order by 职员代码", "h_v_IF_EmployeeList");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "所选班组无对应职员信息!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    List<object> columnNameList = new List<object>();
                    //添加列名
                    foreach (DataColumn col in ds.Tables[0].Columns)
                    {
                        Type dataType = col.DataType;
                        string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                        columnNameList.Add(JsonConvert.DeserializeObject(ColmString));  //获取到DataColumn列对象的列名
                    }
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "成功!";
                    objJsonResult.data = ds.Tables[0];
                    objJsonResult.list = columnNameList;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "根据班组返回职员信息失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
    }
}