yusijie
2024-01-26 93e3db79124da58cacf057e086928546af0930ab
WebAPI/Controllers/ÏîÄ¿¹ÜÀí/±¨±í·ÖÎö/PM_ReportController.cs
@@ -180,6 +180,57 @@
        #endregion
        #region æˆ‘的项目 æŸ¥è¯¢
        /// <summary>
        /// æˆ‘的项目查询
        /// </summary>
        /// <param name="sWhere"></param>
        /// <param name="user"></param>
        /// <returns></returns>
        [Route("PM_ReportController/PM_ProjectBillMYList")]
        [HttpGet]
        public object PM_ProjectBillMYList(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                //查看权限
                if (!DBUtility.ClsPub.Security_Log("PM_ProjectBillMainMy_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查看权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                string sql = "exec h_p_My_PM_ProjectReportBill " + user+",0,''";
                ds=oCn.RunProcReturn(sql, "h_p_My_PM_ProjectReportBill");
                //添加列名
                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;
                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
        #endregion