zrg
2024-12-20 8eaf4618fd765316a1d92fe156e1fa507d4a5528
WebAPI/Controllers/ÏîÄ¿¹ÜÀí/¹¤×÷ÈÎÎñ/PM_WorkTaskBillController.cs
@@ -12,6 +12,7 @@
using WebAPI.Models;
using System.Threading.Tasks;
using DLL;
using SyntacticSugar.constant;
namespace WebAPI.Controllers.项目管理.工作任务
{
@@ -442,6 +443,62 @@
            }
        }
        #endregion
        #region å·¥ä½œä»»åŠ¡åˆ—è¡¨åˆ†é¡µåˆ—è¡¨
        [Route("PM_WorkTaskBill/page")]
        [HttpGet]
        public object PM_WorkTaskBillPage(string sWhere, string user, int page, int size)
        {
            DataSet ds;
            try
            {
                List<object> columnNameList = new List<object>();
                //判断权限
                //if (!DBUtility.ClsPub.Security_Log("Cg_POInStockBillQuery", 1, false, user))
                //{
                //    objJsonResult.code = CodeConstant.FAIL;
                //    objJsonResult.count = CountConstant.FAIL;
                //    objJsonResult.Message = "您没有该模块权限,请与管理员联系!";
                //    objJsonResult.data = null;
                //    return objJsonResult;
                //}
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("exec h_p_PM_WorkTaskBillList " + page + "," + size + ",''", "h_p_PM_WorkTaskBillList");
                }
                else
                {
                    sWhere = sWhere.Replace("'", "''");
                    ds = oCN.RunProcReturn("exec h_p_PM_WorkTaskBillList " + page + "," + size + ",'" + sWhere + "'", "h_p_PM_WorkTaskBillList");
                }
                //添加列名
                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 = CodeConstant.SUCCEED;
                objJsonResult.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString());
                objJsonResult.Message = "Sucess!";
                objJsonResult.list = columnNameList;
                objJsonResult.data = ds.Tables[0];
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = CodeConstant.FAIL;
                objJsonResult.count = CountConstant.FAIL;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region å·¥ä½œä»»åŠ¡åˆ—è¡¨  ä¸‹æŽ¨æ•°æ®æŸ¥è¯¢
        /// <summary>
@@ -1700,6 +1757,62 @@
        }
        #endregion
        #region ä»»åŠ¡æ±‡æŠ¥åˆ†é¡µåˆ—è¡¨
        [Route("PM_WorkTaskReportBill/page")]
        [HttpGet]
        public object PM_WorkTaskReportBillPage(string sWhere, string user, int page, int size)
        {
            DataSet ds;
            try
            {
                List<object> columnNameList = new List<object>();
                //判断权限
                //if (!DBUtility.ClsPub.Security_Log("Cg_POInStockBillQuery", 1, false, user))
                //{
                //    objJsonResult.code = CodeConstant.FAIL;
                //    objJsonResult.count = CountConstant.FAIL;
                //    objJsonResult.Message = "您没有该模块权限,请与管理员联系!";
                //    objJsonResult.data = null;
                //    return objJsonResult;
                //}
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("exec h_p_PM_WorkTaskReportBillList " + page + "," + size + ",''", "h_p_PM_WorkTaskReportBillList");
                }
                else
                {
                    sWhere = sWhere.Replace("'", "''");
                    ds = oCN.RunProcReturn("exec h_p_PM_WorkTaskReportBillList " + page + "," + size + ",'" + sWhere + "'", "h_p_PM_WorkTaskReportBillList");
                }
                //添加列名
                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 = CodeConstant.SUCCEED;
                objJsonResult.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString());
                objJsonResult.Message = "Sucess!";
                objJsonResult.list = columnNameList;
                objJsonResult.data = ds.Tables[0];
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = CodeConstant.FAIL;
                objJsonResult.count = CountConstant.FAIL;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region ä»»åŠ¡æ±‡æŠ¥ ç¼–辑-页面赋值
        /// <summary>
        ///参数:string HInterID。