From 988fe2b2ef25bd72c90f11a51c91a60c532c7666 Mon Sep 17 00:00:00 2001
From: geh <1923421292@qq.com>
Date: Sun, 27 Apr 2025 19:36:01 +0800
Subject: [PATCH] =?UTF-8?q?fix:=E6=8E=A5=E5=8F=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Controllers/HSSE/RectifyController.cs | 92 +++++++++++++++++++
.../WebAPI/Filter/TestPermissionAttribute.cs | 2 +
2 files changed, 94 insertions(+)
create mode 100644 SUBQHSE/WebAPI/Controllers/HSSE/RectifyController.cs
diff --git a/SUBQHSE/WebAPI/Controllers/HSSE/RectifyController.cs b/SUBQHSE/WebAPI/Controllers/HSSE/RectifyController.cs
new file mode 100644
index 0000000..3d0c22f
--- /dev/null
+++ b/SUBQHSE/WebAPI/Controllers/HSSE/RectifyController.cs
@@ -0,0 +1,92 @@
+using BLL;
+using System;
+using System.Data.Linq.SqlClient;
+using System.Linq;
+using System.Web.Http;
+namespace WebAPI.Controllers.HSSE
+{
+ public class RectifyController : ApiController
+ {
+
+ #region 获取集合
+ ///
+ /// 获取集合
+ ///
+ ///
+ public Model.ResponeData getRectifyList(string RectifyName, int PageNumber, int PageSize)
+ {
+ var responeData = new Model.ResponeData();
+ try
+ {
+ var query = (from x in Funs.DB.Technique_Rectify
+ where x.IsEndLever.Value == true
+ select new
+ {
+ x.RectifyId,
+ x.RectifyName,
+ }).ToList();
+ if (!string.IsNullOrEmpty(RectifyName))
+ {
+ query = query.Where(x => x.RectifyName.Contains(RectifyName)).ToList();
+ }
+
+ var paginatedQuery = query
+ .Skip((PageNumber - 1) * PageSize)
+ .Take(PageSize)
+ .ToList();
+
+ responeData.data = paginatedQuery;
+ }
+ catch (Exception ex)
+ {
+ responeData.code = 0;
+ responeData.message = ex.Message;
+ }
+
+ return responeData;
+ }
+ #endregion
+
+
+ #region 根据id获取明细列表
+ ///
+ /// 获取集合
+ ///
+ ///
+ public Model.ResponeData getRectifyItemListBy(string RectifyId,string HazardSourcePoint, int PageNumber, int PageSize)
+ {
+ var responeData = new Model.ResponeData();
+ try
+ {
+ var query = (from x in Funs.DB.Technique_RectifyItem
+ where x.RectifyId == RectifyId
+ select new
+ {
+ x.RectifyItemId,
+ x.HazardSourcePoint,
+ x.RiskAnalysis,
+ x.RiskPrevention
+ }).ToList();
+ if (!string.IsNullOrEmpty(HazardSourcePoint))
+ {
+ query = query.Where(x => x.HazardSourcePoint.Contains(HazardSourcePoint)).ToList();
+ }
+
+ var paginatedQuery = query
+ .Skip((PageNumber - 1) * PageSize)
+ .Take(PageSize)
+ .ToList();
+
+ responeData.data = paginatedQuery;
+ }
+ catch (Exception ex)
+ {
+ responeData.code = 0;
+ responeData.message = ex.Message;
+ }
+
+ return responeData;
+ }
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/SUBQHSE/WebAPI/Filter/TestPermissionAttribute.cs b/SUBQHSE/WebAPI/Filter/TestPermissionAttribute.cs
index 07add15..0ed799a 100644
--- a/SUBQHSE/WebAPI/Filter/TestPermissionAttribute.cs
+++ b/SUBQHSE/WebAPI/Filter/TestPermissionAttribute.cs
@@ -152,6 +152,8 @@ namespace WebAPI.Filter
, "Person*PostAddUrl"
, "Person*getWorkPostList"
, "ProjectUnitPenetrate*getDataByProjectUnitId"
+ , "Rectify*getRectifyList"
+ , "Rectify*getRectifyItemListBy"
};
///