update 项目管理

This commit is contained in:
2021-05-11 13:30:38 +08:00
parent 452c0291aa
commit 82e7ac70bd
6 changed files with 18 additions and 14 deletions

View File

@@ -63,7 +63,7 @@ namespace Ewide.Application.Service.HouseProjectInfo
public async Task UpdateProject(UpdateProjectInput input)
{
var project = input.Adapt<BsHouseProjectInfo>();
await project.UpdateExcludeAsync(new[] { nameof(BsHouseProjectInfo.AreaId)}, true);
await project.UpdateExcludeAsync(new[] { nameof(BsHouseProjectInfo.AreaCode) }, true);
}
/// <summary>
@@ -85,12 +85,12 @@ namespace Ewide.Application.Service.HouseProjectInfo
[HttpPost("/houseProjectInfo/page")]
public async Task<dynamic> QueryProjectPageList([FromBody] HouseProjectInfoInput input)
{
var areaID = !string.IsNullOrEmpty(input.AreaId);
var areaID = !string.IsNullOrEmpty(input.AreaCode);
var areaCodeRep = Db.GetRepository<SysAreaCode>();
var projects = await _houseProjectInfoRep.DetachedEntities
.Join(areaCodeRep.DetachedEntities, p => p.AreaId, a => a.Code, (p, a) => new { p, AreaName = a.Name })
.Where(areaID, x => x.p.AreaId == input.AreaId)
.Select(x => new { x.p.Id, x.p.Name, x.p.Note, x.p.Sort, x.p.AreaId, x.AreaName, x.p.Type }.Adapt<HouseProjectOutput>()).ToPagedListAsync(input.PageNo, input.PageSize);
.Join(areaCodeRep.DetachedEntities, p => p.AreaCode, a => a.Code, (p, a) => new { p, AreaName = a.Name })
.Where(areaID, x => x.p.AreaCode == input.AreaCode)
.Select(x => new { x.p.Id, x.p.Name, x.p.Note, x.p.Sort, x.p.AreaCode, x.AreaName, x.p.Type }.Adapt<HouseProjectOutput>()).ToPagedListAsync(input.PageNo, input.PageSize);
return XnPageResult<HouseProjectOutput>.PageResult(projects);
}