Merge branch 'master' into features/UserManger

This commit is contained in:
2021-07-01 15:48:20 +08:00
37 changed files with 1565 additions and 1331 deletions

View File

@@ -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; }
}
}

View File

@@ -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;
}
}
}

View File

@@ -41,6 +41,20 @@ namespace Ewide.Core
// 解析异常信息
var (StatusCode, ErrorCode, Errors) = UnifyContext.GetExceptionMetadata(context);
// 如果是代码自行抛出的异常,视为接口调用成功,返回结果失败
if (context.Exception.GetType() == typeof(Furion.FriendlyException.AppFriendlyException))
{
return DisplayJson(new RestfulResult<object>
{
Code = StatusCodes.Status200OK,
Success = false,
Data = null,
Message = Errors,
Extras = UnifyContext.Take(),
Timestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()
});
}
return DisplayJson(new RestfulResult<object>
{
Code = StatusCode,

View File

@@ -431,7 +431,7 @@ namespace Ewide.Core.Service
///<summary>
///发送验证码
/// </summary>
[HttpPost("/sysUser/SendCode")]
[HttpPost("/sysUser/sendCode")]
public async Task<dynamic> SendCode(Usermailphone input)
{
var Orgcode_Key = "ewide_Orgcode";
@@ -505,7 +505,7 @@ namespace Ewide.Core.Service
///<summary>
///检验验证码并且绑定
/// </summary>
[HttpPost("/sysUser/CheckBindcode")]
[HttpPost("/sysUser/checkBindcode")]
public async Task<dynamic> CheckBindcode(Usermailphone input)
{
var Orgcode_Key = "ewide_Orgcode";

View File

@@ -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
}
}
}

View File

@@ -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>