yusijie
2025-02-20 5fccb067ad7dc2dbcdacf8db642aa471488cd8f0
WebAPI/Controllers/SBGL/Sb_EquipBeginBillController.cs
@@ -33,7 +33,7 @@
                List<object> columnNameList = new List<object>();
                //查看权限
                if (!DBUtility.ClsPub.Security_Log_second("Sb_EquipBeginBillMain_Check", 1, false, user))
                if (!DBUtility.ClsPub.Security_Log_second("Sb_EquipBeginBillMain_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
@@ -67,6 +67,59 @@
                objJsonResult.Message = "Sucess!";
                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("Sb_EquipBeginBill/getSb_EquipBeginBillListPage")]
        [HttpGet]
        public object Sb_EquipBeginBillListPage(string sWhere, string user, int page, int size)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                //编辑权限
                if (!DBUtility.ClsPub.Security_Log_second("Sb_EquipBeginBillMain_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查看权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                sWhere = sWhere.Replace("'", "''");
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("exec h_p_Sb_EquipBeginBillMainListPage " + page + "," + size + ",''", "h_p_Sb_EquipBeginBillMainListPage");
                }
                else
                {
                    ds = oCN.RunProcReturn("exec h_p_Sb_EquipBeginBillMainListPage " + page + "," + size + ",'" + sWhere + "'", "h_p_Sb_EquipBeginBillMainListPage");
                }
                //添加列名
                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 = "1";
                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)
@@ -210,7 +263,7 @@
                    oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
                    oItem.HPeriod = DBUtility.ClsPub.isLong(DateTime.Now.Month);
                    oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd"));
                    oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now);
                    if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "")
                    {
@@ -748,7 +801,7 @@
                List<object> columnNameList = new List<object>();
                //查看权限
                if (!DBUtility.ClsPub.Security_Log_second("Sb_EquipBeginBillMain_Check", 1, false, user))
                if (!DBUtility.ClsPub.Security_Log_second("Sb_EquipBeginBillMain_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
@@ -795,5 +848,6 @@
        }
        #endregion
    }
}