WebAPI/Controllers/ÏîÄ¿¹ÜÀí/¹¤³ÌÏîÄ¿/PM_ProjectBillController.cs
@@ -938,5 +938,113 @@
            }
        }
        #endregion
        #region å·¥ç¨‹é¡¹ç›® ä¸‹æŽ¨(阶段汇报)-页面显示
        [Route("PM_ProjectBill/set_ProjectReport")]
        [HttpGet]
        public object ProjectBill_ProjectReport(string HInterID, string HProjectStageID, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                List<DataTable> tables = new List<DataTable>();
                //查看权限
                //if (!DBUtility.ClsPub.Security_Log("Gy_ProjectStage_Query", 1, false, user))
                //{
                //    objJsonResult.code = "0";
                //    objJsonResult.count = 0;
                //    objJsonResult.Message = "无查看权限!";
                //    objJsonResult.data = null;
                //    return objJsonResult;
                //}
                //获取表头信息
                string sql = "exec h_p_PM_ProjectBill_setProjectReport " + HInterID + "," + HProjectStageID;
                ds = oCN.RunProcReturn(sql, "h_p_PM_ProjectBill_setProjectReport");
                tables.Add(ds.Tables[0]);
                tables.Add(ds.Tables[1]);
                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[1].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 = tables;
                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
        #region å·¥ç¨‹é¡¹ç›® ä¸‹æŽ¨(任务汇报)-页面显示
        [Route("PM_ProjectBill/set_WorkTaskReport")]
        [HttpGet]
        public object ProjectBill_WorkTaskReport(string HInterID, string HProjectStageID, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                List<DataTable> tables = new List<DataTable>();
                //查看权限
                //if (!DBUtility.ClsPub.Security_Log("Gy_ProjectStage_Query", 1, false, user))
                //{
                //    objJsonResult.code = "0";
                //    objJsonResult.count = 0;
                //    objJsonResult.Message = "无查看权限!";
                //    objJsonResult.data = null;
                //    return objJsonResult;
                //}
                //获取表头信息
                string sql = "exec h_p_PM_ProjectBill_setWorkTaskReport " + HInterID + "," + HProjectStageID;
                ds = oCN.RunProcReturn(sql, "h_p_PM_ProjectBill_setWorkTaskReport");
                tables.Add(ds.Tables[0]);
                tables.Add(ds.Tables[1]);
                //添加列名
                foreach (DataColumn col in ds.Tables[1].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 = tables;
                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
    }
}