update 增加了查询分析详情页的文件
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using Ewide.Core;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
@@ -11,4 +12,10 @@ namespace Ewide.Application
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public class HouseQueryDetailInput
|
||||
{
|
||||
[Required(ErrorMessage = "Id不能为空")]
|
||||
public string Id { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,9 @@ using Ewide.Core.Extension;
|
||||
using Furion.DatabaseAccessor;
|
||||
using Furion.DependencyInjection;
|
||||
using Furion.DynamicApiController;
|
||||
using Mapster;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -77,5 +79,32 @@ WHERE 1=1";
|
||||
"TotalFloor"
|
||||
});
|
||||
}
|
||||
|
||||
[HttpGet("/houseQuery/detail")]
|
||||
public async Task<dynamic> Detail([FromQuery] HouseQueryDetailInput input)
|
||||
{
|
||||
var houseCodeOutputAsync = await _dapperRepository.QueryAsync<HouseCodeOutput>(
|
||||
@"SELECT HC.Id,HC.Address,HC.ProjectId,HC.ZoneId,HC.Type,AA.Name AreaName,RA.Name RoadName,CA.Name CommName,O.Name ZoneName,Proj.Note ProjectNote,CONCAT(Proj.Name,'(',Proj.Note,')') ProjectFullName,HC.HouseCode,HC.Lng,HC.Lat,HC.No FROM bs_house_code HC
|
||||
LEFT JOIN bs_house_projectinfo Proj ON Proj.Id=HC.ProjectId
|
||||
LEFT JOIN sys_org O ON HC.ZoneId = O.Id
|
||||
LEFT JOIN sys_area_code CA ON CA.Code = Proj.AreaCode
|
||||
LEFT JOIN sys_area_code RA ON RA.AdCode = SUBSTR(CA.AdCode,1,9)
|
||||
LEFT JOIN sys_area_code AA ON AA.AdCode = SUBSTR(CA.AdCode,1,6)
|
||||
WHERE HC.Id=@Id", new { input.Id }
|
||||
);
|
||||
|
||||
var houseCodeOutput = houseCodeOutputAsync.SingleOrDefault();
|
||||
|
||||
|
||||
var houseInfoOutputForDetailPage = new HouseInfoOutputForDetailPage
|
||||
{
|
||||
HouseCode = houseCodeOutput
|
||||
};
|
||||
|
||||
var houseInfoOutput = (await _houseInfoRep.DetachedEntities.FirstOrDefaultAsync(p => p.HouseCodeId == houseCodeOutput.Id)).Adapt<HouseInfoOutput>();
|
||||
houseInfoOutputForDetailPage.HouseInfo = houseInfoOutput;
|
||||
|
||||
return houseInfoOutputForDetailPage;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -168,6 +168,7 @@ namespace Ewide.EntityFramework.Core
|
||||
base.OnModelCreating(modelBuilder);
|
||||
if (App.HostEnvironment.EnvironmentName == "Testing") return;
|
||||
//集成测试下面代码会报错
|
||||
#if DEBUG
|
||||
XmlSerializerUtil xmlHandler = new XmlSerializerUtil();
|
||||
Dictionary<Type, object> dic = xmlHandler.ReaderALL();
|
||||
foreach (KeyValuePair<Type, object> item in dic)
|
||||
@@ -183,6 +184,7 @@ namespace Ewide.EntityFramework.Core
|
||||
}
|
||||
modelBuilder.Entity(item.Key).HasData(data);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
-->
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<DeleteExistingFiles>False</DeleteExistingFiles>
|
||||
<ExcludeApp_Data>False</ExcludeApp_Data>
|
||||
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
|
||||
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
|
||||
<LastUsedPlatform>Any CPU</LastUsedPlatform>
|
||||
<PublishProvider>FileSystem</PublishProvider>
|
||||
<PublishUrl>bin\Release\net5.0\publish\</PublishUrl>
|
||||
<WebPublishMethod>FileSystem</WebPublishMethod>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
Reference in New Issue
Block a user