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;