zrg
2024-01-24 878317b952c8404a9159f471917590ad85e0a2d7
WebAPI/Controllers/ÏîÄ¿¹ÜÀí/±¨±í·ÖÎö/PM_ReportController.cs
@@ -180,6 +180,66 @@
        #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;
                }
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCn.RunProcReturn("select * from h_v_PM_ProjectBillMYList order by å•据号 desc", "h_v_PM_ProjectBillMYList");
                }
                else
                {
                    string sql1 = "select * from h_v_PM_ProjectBillMYList where 1 = 1 ";
                    string sql = sql1 + sWhere + " order by å•据号 desc";
                    ds = oCn.RunProcReturn(sql, "h_v_PM_ProjectBillMYList");
                }
                //添加列名
                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 = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #endregion