From 07aa1370e2d4359bd27d78c1a03ae8902e475ed2 Mon Sep 17 00:00:00 2001
From: fei550 <1420031550@qq.com>
Date: Wed, 24 Dec 2025 16:48:46 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8E=A5=E5=8F=A3=EF=BC=8C?=
=?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=8F=82=E6=95=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
SGGL/BLL/API/APIPersonService.cs | 5 +++--
SGGL/Model/HSSE/PersonInOutRecordInput.cs | 4 ++++
SGGL/WebAPI/Controllers/PersonController.cs | 15 ++++++++++-----
3 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/SGGL/BLL/API/APIPersonService.cs b/SGGL/BLL/API/APIPersonService.cs
index 9f46216d..51e9c7c8 100644
--- a/SGGL/BLL/API/APIPersonService.cs
+++ b/SGGL/BLL/API/APIPersonService.cs
@@ -1111,8 +1111,9 @@ namespace BLL
{
var query = from x in db.SitePerson_PersonInOut
join y in db.SitePerson_Person on x.PersonId equals y.PersonId
- where x.ChangeTime >= filter.StartTime && x.ChangeTime <= filter.EndTime
- select new Model.PersonInOutItem
+ join z in db.Base_Project on x.ProjectId equals z.ProjectId
+ where x.ChangeTime >= filter.StartTime && x.ChangeTime <= filter.EndTime && z.ProjectName.Contains(filter.ProjectName)
+ select new Model.PersonInOutItem
{
PersonId = x.PersonId,
PersonName = y.PersonName,
diff --git a/SGGL/Model/HSSE/PersonInOutRecordInput.cs b/SGGL/Model/HSSE/PersonInOutRecordInput.cs
index 659d32ea..12287848 100644
--- a/SGGL/Model/HSSE/PersonInOutRecordInput.cs
+++ b/SGGL/Model/HSSE/PersonInOutRecordInput.cs
@@ -11,6 +11,10 @@ namespace Model
///
public class PersonInOutRecordInput
{
+ ///
+ /// 项目名称
+ ///
+ public string ProjectName { get; set; }
///
/// 单位名称
///
diff --git a/SGGL/WebAPI/Controllers/PersonController.cs b/SGGL/WebAPI/Controllers/PersonController.cs
index af0377ad..c534b96a 100644
--- a/SGGL/WebAPI/Controllers/PersonController.cs
+++ b/SGGL/WebAPI/Controllers/PersonController.cs
@@ -115,7 +115,7 @@ namespace WebAPI.Controllers
// 验证必填参数 ProjectName
if (filter == null || string.IsNullOrEmpty(filter.ProjectName))
{
- responeData.code = 2;
+ responeData.code = 0;
responeData.message = "ProjectName为必填参数!";
return responeData;
}
@@ -1061,18 +1061,23 @@ namespace WebAPI.Controllers
// 验证必填参数
if (filter == null || filter.StartTime == default(DateTime) || filter.EndTime == default(DateTime))
{
- responeData.code = 2;
+ responeData.code = 0;
responeData.message = "StartTime和EndTime为必填参数!";
return responeData;
- }
-
+ }
// 验证时间范围
if (filter.StartTime > filter.EndTime)
{
- responeData.code = 2;
+ responeData.code = 0;
responeData.message = "StartTime不能大于EndTime!";
return responeData;
}
+ if (filter == null || string.IsNullOrEmpty(filter.ProjectName))
+ {
+ responeData.code = 0;
+ responeData.message = "ProjectName为必填参数!";
+ return responeData;
+ }
// 处理可空参数的默认值
int actualPagesize = pagesize ?? 15;