yusijie
2024-11-22 3697b0dda739b38c33406d6e164714167e9ad5b5
WebAPI/Controllers/Sb_CheckEqpRepairWorkBillController.cs
@@ -83,6 +83,60 @@
        }
        #endregion
        #region 设备维修工单分页查询
        [Route("Sb_EqpRepairWorkBill/GetEqpRepairWorkBillListPage")]
        [HttpGet]
        public object GetEqpRepairWorkBillListPage(string sWhere, string user, int page, int size)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                //编辑权限
                if (!DBUtility.ClsPub.Security_Log_second("Sb_EquipRepairWorkBillList", 3, 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_EquipRepairWorkBillListPage " + page + "," + size + ",''", "h_p_Sb_EquipRepairWorkBillListPage");
                }
                else
                {
                    ds = oCN.RunProcReturn("exec h_p_Sb_EquipRepairWorkBillListPage " + page + "," + size + ",'" + sWhere + "'", "h_p_Sb_EquipRepairWorkBillListPage");
                }
                //添加列名
                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)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region 设备维修记录统计分析 
        /// <summary>
        /// 返回设备维修记录统计分析 列表
@@ -195,6 +249,59 @@
        }
        #endregion
        #region 设备维修验收单分页查询
        [Route("Sb_EqpRepairWorkBill/GetEqpRepairCheckWorkBillListPage")]
        [HttpGet]
        public object GetEqpRepairCheckWorkBillListPage(string sWhere, string user, int page, int size)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                //编辑权限
                if (!DBUtility.ClsPub.Security_Log_second("Sb_EquipRepairCheckBillList", 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_EquipRepairCheckBillListPage " + page + "," + size + ",''", "h_p_Sb_EquipRepairCheckBillListPage");
                }
                else
                {
                    ds = oCN.RunProcReturn("exec h_p_Sb_EquipRepairCheckBillListPage " + page + "," + size + ",'" + sWhere + "'", "h_p_Sb_EquipRepairCheckBillListPage");
                }
                //添加列名
                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)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region 设备维修验收单列表sql语句
        public static DataSet Sb_EquipRepairCheckWorkBill_s(string sWhere)
        {
@@ -211,8 +318,6 @@
            
        }
        #endregion
        #region 设备故障登记单列表
        /// <summary>
@@ -264,6 +369,58 @@
        }
        #endregion
        #region 设备故障登记单分页查询
        [Route("Sb_EqpRepairWorkBill/GetEqpConkBookBillListPage")]
        [HttpGet]
        public object GetEqpConkBookBillListPage(string sWhere, string user, int page, int size)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                //编辑权限
                if (!DBUtility.ClsPub.Security_Log_second("Sb_EquipConkBookBillList", 3, 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_EquipConkBookBillListPage " + page + "," + size + ",''", "h_p_Sb_EquipConkBookBillListPage");
                }
                else
                {
                    ds = oCN.RunProcReturn("exec h_p_Sb_EquipConkBookBillListPage " + page + "," + size + ",'" + sWhere + "'", "h_p_Sb_EquipConkBookBillListPage");
                }
                //添加列名
                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)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region 设备故障记录统计分析 
        /// <summary>
@@ -2128,6 +2285,59 @@
        }
        #endregion
        #region 设备签到单分页查询
        [Route("Sb_CheckEqpRepairWorkBill/Sb_EquipRepairSignBillListPage")]
        [HttpGet]
        public object Sb_EquipRepairSignBillListPage(string sWhere, string user, int page, int size)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                //编辑权限
                if (!DBUtility.ClsPub.Security_Log_second("Sb_EquipRepairSignBillMain_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_EquipRepairSignBillListPage " + page + "," + size + ",''", "h_p_Sb_EquipRepairSignBillListPage");
                }
                else
                {
                    ds = oCN.RunProcReturn("exec h_p_Sb_EquipRepairSignBillListPage " + page + "," + size + ",'" + sWhere + "'", "h_p_Sb_EquipRepairSignBillListPage");
                }
                //添加列名
                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)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region 设备维修签到单保存 新增/编辑
        [Route("Sb_CheckEqpRepairWorkBill/SaveSb_EquipRepairSignBillMain")]
        [HttpPost]