人员查询接口改用项目代号作为必填参数
- 在 ProjectPersonInput/Output 和 PersonInOutRecordInput 模型中添加 ProjectCode 属性 - GetProjectPerson 和 GetPersonInOutRecord 接口必填参数改为 ProjectCode - APIPersonService 添加项目代号过滤逻辑和查询结果输出
This commit is contained in:
@@ -320,7 +320,11 @@ namespace BLL
|
|||||||
{
|
{
|
||||||
query = query.Where(x => x.ProjectName.Contains(filter.ProjectName));
|
query = query.Where(x => x.ProjectName.Contains(filter.ProjectName));
|
||||||
}
|
}
|
||||||
|
// 项目代号过滤(模糊查询)
|
||||||
|
if (!string.IsNullOrEmpty(filter.ProjectCode))
|
||||||
|
{
|
||||||
|
query = query.Where(x => x.ProjectCode.Contains(filter.ProjectCode));
|
||||||
|
}
|
||||||
// 人员ID过滤
|
// 人员ID过滤
|
||||||
if (!string.IsNullOrEmpty(filter.PersonId))
|
if (!string.IsNullOrEmpty(filter.PersonId))
|
||||||
{
|
{
|
||||||
@@ -384,6 +388,7 @@ namespace BLL
|
|||||||
IdentityCard = x.IdentityCard,
|
IdentityCard = x.IdentityCard,
|
||||||
ProjectId = x.ProjectId,
|
ProjectId = x.ProjectId,
|
||||||
ProjectName = x.ProjectName,
|
ProjectName = x.ProjectName,
|
||||||
|
ProjectCode= x.ProjectCode,
|
||||||
UnitId = x.UnitId,
|
UnitId = x.UnitId,
|
||||||
UnitName = x.UnitName,
|
UnitName = x.UnitName,
|
||||||
TeamGroupName = x.TeamGroupName,
|
TeamGroupName = x.TeamGroupName,
|
||||||
@@ -1112,7 +1117,7 @@ namespace BLL
|
|||||||
var query = from x in db.SitePerson_PersonInOut
|
var query = from x in db.SitePerson_PersonInOut
|
||||||
join y in db.SitePerson_Person on x.PersonId equals y.PersonId
|
join y in db.SitePerson_Person on x.PersonId equals y.PersonId
|
||||||
join z in db.Base_Project on x.ProjectId equals z.ProjectId
|
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
|
select new Model.PersonInOutItem
|
||||||
{
|
{
|
||||||
PersonId = x.PersonId,
|
PersonId = x.PersonId,
|
||||||
@@ -1130,7 +1135,12 @@ namespace BLL
|
|||||||
|
|
||||||
// 添加过滤条件
|
// 添加过滤条件
|
||||||
if (filter != null)
|
if (filter != null)
|
||||||
{
|
{
|
||||||
|
// 项目名称过滤(模糊查询)
|
||||||
|
if (!string.IsNullOrEmpty(filter.ProjectName))
|
||||||
|
{
|
||||||
|
query = query.Where(x => x.ProjectName.Contains(filter.ProjectName));
|
||||||
|
}
|
||||||
// 单位名称过滤(模糊查询)
|
// 单位名称过滤(模糊查询)
|
||||||
if (!string.IsNullOrEmpty(filter.UnitName))
|
if (!string.IsNullOrEmpty(filter.UnitName))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -16910,7 +16910,7 @@
|
|||||||
</COMReference>
|
</COMReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v15.0\WebApplications\Microsoft.WebApplication.targets" />
|
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v18.0\WebApplications\Microsoft.WebApplication.targets" />
|
||||||
<ProjectExtensions>
|
<ProjectExtensions>
|
||||||
<VisualStudio>
|
<VisualStudio>
|
||||||
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
|
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
|
||||||
|
|||||||
@@ -16,6 +16,10 @@ namespace Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string ProjectName { get; set; }
|
public string ProjectName { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
/// 项目代号
|
||||||
|
/// </summary>
|
||||||
|
public string ProjectCode { get; set; }
|
||||||
|
/// <summary>
|
||||||
/// 单位名称
|
/// 单位名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string UnitName { get; set; }
|
public string UnitName { get; set; }
|
||||||
|
|||||||
@@ -40,6 +40,10 @@ namespace Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string ProjectName { get; set; }
|
public string ProjectName { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
/// 项目代号
|
||||||
|
/// </summary>
|
||||||
|
public string ProjectCode { get; set; }
|
||||||
|
/// <summary>
|
||||||
/// 单位名称
|
/// 单位名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string UnitName { get; set; }
|
public string UnitName { get; set; }
|
||||||
|
|||||||
@@ -42,6 +42,10 @@ namespace Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string ProjectName { get; set; }
|
public string ProjectName { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
/// 项目代号
|
||||||
|
/// </summary>
|
||||||
|
public string ProjectCode { get; set; }
|
||||||
|
/// <summary>
|
||||||
/// 单位ID
|
/// 单位ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string UnitId { get; set; }
|
public string UnitId { get; set; }
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ namespace WebAPI.Controllers
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 根据条件获取项目人员信息(支持分页和过滤)
|
/// 根据条件获取项目人员信息(支持分页和过滤)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="filter">查询过滤条件(ProjectName为必填参数)</param>
|
/// <param name="filter">查询过滤条件(ProjectCode为必填参数)</param>
|
||||||
/// <param name="pagesize">每页条数</param>
|
/// <param name="pagesize">每页条数</param>
|
||||||
/// <param name="pageindex">页码(从1开始)</param>
|
/// <param name="pageindex">页码(从1开始)</param>
|
||||||
/// <param name="returnAll">是否返回全部数据</param>
|
/// <param name="returnAll">是否返回全部数据</param>
|
||||||
@@ -112,11 +112,11 @@ namespace WebAPI.Controllers
|
|||||||
var responeData = new Model.ResponeData();
|
var responeData = new Model.ResponeData();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// 验证必填参数 ProjectName
|
// 验证必填参数 ProjectCode
|
||||||
if (filter == null || string.IsNullOrEmpty(filter.ProjectName))
|
if (filter == null || string.IsNullOrEmpty(filter.ProjectCode))
|
||||||
{
|
{
|
||||||
responeData.code = 0;
|
responeData.code = 0;
|
||||||
responeData.message = "ProjectName为必填参数!";
|
responeData.message = "ProjectCode为必填参数!";
|
||||||
return responeData;
|
return responeData;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1072,10 +1072,10 @@ namespace WebAPI.Controllers
|
|||||||
responeData.message = "StartTime不能大于EndTime!";
|
responeData.message = "StartTime不能大于EndTime!";
|
||||||
return responeData;
|
return responeData;
|
||||||
}
|
}
|
||||||
if (filter == null || string.IsNullOrEmpty(filter.ProjectName))
|
if (filter == null || string.IsNullOrEmpty(filter.ProjectCode))
|
||||||
{
|
{
|
||||||
responeData.code = 0;
|
responeData.code = 0;
|
||||||
responeData.message = "ProjectName为必填参数!";
|
responeData.message = "ProjectCode为必填参数!";
|
||||||
return responeData;
|
return responeData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user