This commit is contained in:
2021-06-25 15:49:35 +08:00
11 changed files with 338 additions and 29 deletions

View File

@@ -29,6 +29,7 @@ namespace Ewide.Application
public class GetHouseCodeOutput
{
public string Id { get; set; }
public string HouseCode { get; set; }
public int Type { get; set; }
public int Industry { get; set; }
public string AreaCode { get; set; }

View File

@@ -88,6 +88,7 @@ namespace Ewide.Application.Service.HouseProjectInfo
var areaCodeRep = Db.GetRepository<SysAreaCode>();
var projects = await _houseProjectInfoRep.DetachedEntities
.Join(areaCodeRep.DetachedEntities, p => p.AreaCode, a => a.Code, (p, a) => new { p, AreaName = a.Name })
.Where(input.Type>0, x => x.p.Type == input.Type)
.Where(!string.IsNullOrEmpty(input.Name), x => x.p.Name.Contains(input.Name))
.Where(!string.IsNullOrEmpty(input.Note), x => x.p.Note.Contains(input.Note))
.Where(!string.IsNullOrEmpty(input.AreaCode), x => x.p.AreaCode == input.AreaCode)

View File

@@ -93,11 +93,17 @@ namespace Ewide.Core.Service.Area
#endif
}
var query = cachedAreaCodes.Where(p => p.LevelType <= level);
var resAreaCode = new List<SysAreaCode>();
if (areaCodeList != null)
{
query = query.Where(p => areaCodeList.Contains(p.Code));
foreach (var code in areaCodeList)
{
var queryRes = query.Where(p => p.Code.StartsWith(code));
resAreaCode.AddRange(queryRes);
}
cachedAreaCodes = resAreaCode.Distinct().ToList();
}
cachedAreaCodes = query.ToList();
return new TreeBuildUtil<AreaTreeNode>().DoTreeBuild(cachedAreaCodes.Select(u => new AreaTreeNode
{
Code = u.Code,