zrg
2024-01-31 3e50b181ccb47db77d2e7e10ba7268a89c139df5
我的任务数据查询
1个文件已修改
62 ■■■■■ 已修改文件
WebAPI/Controllers/项目管理/工作任务/PM_WorkTaskBillController.cs 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/ÏîÄ¿¹ÜÀí/¹¤×÷ÈÎÎñ/PM_WorkTaskBillController.cs
@@ -1988,5 +1988,67 @@
            }
        }
        #endregion
        #region  æˆ‘的任务列表(未完成,已完成,正在进行)
        /// <summary>
        /// è¿”回我的任务列表
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("PM_WorkTaskBill/PM_WorkTaskBillMainList")]
        [HttpGet]
        public object PM_WorkTaskBillMainList( string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                ds = oCN.RunProcReturn("exec h_p_PM_WorkTaskBillMyList " + user, "h_p_PM_WorkTaskBillMyList");
                if (ds.Tables[0].Rows.Count != 0 || ds != null)
                {
                    //添加列名
                    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列对象的列名
                    }
                    //添加列名
                    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 = ds;
                    objJsonResult.list = columnNameList;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无数据";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
    }
}