人员查询接口改用项目代号作为必填参数

- 在 ProjectPersonInput/Output 和 PersonInOutRecordInput 模型中添加 ProjectCode 属性
  - GetProjectPerson 和 GetPersonInOutRecord 接口必填参数改为 ProjectCode
  - APIPersonService 添加项目代号过滤逻辑和查询结果输出
This commit is contained in:
2026-01-28 15:18:10 +08:00
parent f1224ea194
commit 403ae1921b
6 changed files with 32 additions and 10 deletions
+13 -3
View File
@@ -320,7 +320,11 @@ namespace BLL
{
query = query.Where(x => x.ProjectName.Contains(filter.ProjectName));
}
// 项目代号过滤(模糊查询)
if (!string.IsNullOrEmpty(filter.ProjectCode))
{
query = query.Where(x => x.ProjectCode.Contains(filter.ProjectCode));
}
// 人员ID过滤
if (!string.IsNullOrEmpty(filter.PersonId))
{
@@ -384,6 +388,7 @@ namespace BLL
IdentityCard = x.IdentityCard,
ProjectId = x.ProjectId,
ProjectName = x.ProjectName,
ProjectCode= x.ProjectCode,
UnitId = x.UnitId,
UnitName = x.UnitName,
TeamGroupName = x.TeamGroupName,
@@ -1112,7 +1117,7 @@ namespace BLL
var query = from x in db.SitePerson_PersonInOut
join y in db.SitePerson_Person on x.PersonId equals y.PersonId
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)
where x.ChangeTime >= filter.StartTime && x.ChangeTime <= filter.EndTime && z.ProjectCode.Contains(filter.ProjectCode)
select new Model.PersonInOutItem
{
PersonId = x.PersonId,
@@ -1130,7 +1135,12 @@ namespace BLL
// 添加过滤条件
if (filter != null)
{
{
// 项目名称过滤(模糊查询)
if (!string.IsNullOrEmpty(filter.ProjectName))
{
query = query.Where(x => x.ProjectName.Contains(filter.ProjectName));
}
// 单位名称过滤(模糊查询)
if (!string.IsNullOrEmpty(filter.UnitName))
{