1
duhe
2025-04-08 7583af9c032a7805a41222db300fbfd3f49d505a
WebAPI/Controllers/ÏîÄ¿¹ÜÀí/±¨±í·ÖÎö/PM_ReportController.cs
@@ -232,6 +232,173 @@
        }
        #endregion
        #region æŠ¢ä¿®é™„属工费报表 æŸ¥è¯¢
        [Route("PM_ReportController/GetPM_ProjectRepairTaskOtherMoneyReport")]
        [HttpGet]
        public object GetPM_ProjectRepairTaskOtherMoneyReport(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                Dictionary<object, object> dic = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<object, object>>(sWhere);
                string HBeginDate = dic["HBeginDate"].ToString();
                string HEndDate = dic["HEndDate"].ToString();
                string HProjectID = dic["HProjectID"].ToString();//工程项目ID
                ds = oCn.RunProcReturn("exec h_p_PM_ProjectRepairTaskOtherMoneyReport '" + HBeginDate + "','" + HEndDate + "','" + HProjectID + "'", "h_p_PM_ProjectRepairTaskOtherMoneyReport");
                //添加列名
                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
        #region æŠ¢ä¿®è´¹ç”¨æ±‡æ€»è¡¨ æŸ¥è¯¢
        [Route("PM_ReportController/GetPM_ProjectRepairTaskSumMoneyReport")]
        [HttpGet]
        public object GetPM_ProjectRepairTaskSumMoneyReport(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                Dictionary<object, object> dic = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<object, object>>(sWhere);
                string HBeginDate = dic["HBeginDate"].ToString();
                string HEndDate = dic["HEndDate"].ToString();
                string HProjectID = dic["HProjectID"].ToString();//工程项目ID
                ds = oCn.RunProcReturn("exec h_p_PM_ProjectRepairTaskSumMoneyReport    '" + HBeginDate + "','" + HEndDate + "','" + HProjectID + "'", "h_p_PM_ProjectRepairTaskSumMoneyReport");
                //添加列名
                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
        #region æŠ¢ä¿®æ±‡æ€»è¡¨ æŸ¥è¯¢
        [Route("PM_ReportController/GetPM_ProjectRepairTaskSumReport")]
        [HttpGet]
        public object GetPM_ProjectRepairTaskSumReport(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                Dictionary<object, object> dic = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<object, object>>(sWhere);
                string HBeginDate = dic["HBeginDate"].ToString();
                string HEndDate = dic["HEndDate"].ToString();
                ds = oCn.RunProcReturn("exec h_p_PM_ProjectRepairTaskSumReport '" + HBeginDate + "','" + HEndDate + "'", "h_p_PM_ProjectRepairTaskSumReport");
                //添加列名
                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
        #region æŠ¢ä¿®è€ƒæ ¸å‡ºå‹¤æ˜Žç»†è¡¨ æŸ¥è¯¢
        [Route("PM_ReportController/GetPM_ProjectRepairTaskExamMoneyReport")]
        [HttpGet]
        public object GetPM_ProjectRepairTaskExamMoneyReport(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                Dictionary<object, object> dic = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<object, object>>(sWhere);
                string HBeginDate = dic["HBeginDate"].ToString();
                string HEndDate = dic["HEndDate"].ToString();
                string HProjectID = dic["HProjectID"].ToString();//工程项目ID
                ds = oCn.RunProcReturn("exec h_p_PM_ProjectRepairTaskExamMoneyReport '" + HBeginDate + "','" + HEndDate + "','" + HProjectID + "'", "h_p_PM_ProjectRepairTaskExamMoneyReport");
                //添加列名
                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