|
@@ -28,6 +28,7 @@ using NPOI.XWPF.UserModel;
|
|
using SqlSugar;
|
|
using SqlSugar;
|
|
using XF.Domain.Authentications;
|
|
using XF.Domain.Authentications;
|
|
using XF.Domain.Cache;
|
|
using XF.Domain.Cache;
|
|
|
|
+using XF.Domain.Exceptions;
|
|
using XF.Domain.Filters;
|
|
using XF.Domain.Filters;
|
|
using XF.Domain.Repository;
|
|
using XF.Domain.Repository;
|
|
|
|
|
|
@@ -782,12 +783,12 @@ namespace Hotline.Api.Controllers
|
|
/// <param name="dto"></param>
|
|
/// <param name="dto"></param>
|
|
/// <returns></returns>
|
|
/// <returns></returns>
|
|
[HttpGet("getOrderResultList")]
|
|
[HttpGet("getOrderResultList")]
|
|
- public async Task<OpenResponse> GetOrderResultList([FromBody] DateDto dto)
|
|
|
|
|
|
+ public async Task<IReadOnlyList<Hotline.Share.Dtos.WebPortal.OrderResultDto>> GetOrderResultList([FromBody] DateDto dto)
|
|
{
|
|
{
|
|
TimeSpan timeSpan = dto.EndTime - dto.StartTime;
|
|
TimeSpan timeSpan = dto.EndTime - dto.StartTime;
|
|
if (timeSpan.TotalHours > 24)
|
|
if (timeSpan.TotalHours > 24)
|
|
{
|
|
{
|
|
- return OpenResponse.Ok(WebPortalDeResponse<IReadOnlyList<Hotline.Share.Dtos.WebPortal.OrderResultDto>>.Failed("0", "开始结束时间不能大于24小时!"));
|
|
|
|
|
|
+ throw UserFriendlyException.SameMessage("开始结束时间不能大于24小时!");
|
|
}
|
|
}
|
|
|
|
|
|
var items = await _orderListRepository.Queryable()
|
|
var items = await _orderListRepository.Queryable()
|
|
@@ -807,8 +808,7 @@ namespace Hotline.Api.Controllers
|
|
})
|
|
})
|
|
.ToListAsync();
|
|
.ToListAsync();
|
|
|
|
|
|
- var OrderDto = _mapper.Map<IReadOnlyList<Hotline.Share.Dtos.WebPortal.OrderResultDto>>(items);
|
|
|
|
- return OpenResponse.Ok(WebPortalDeResponse<IReadOnlyList<Hotline.Share.Dtos.WebPortal.OrderResultDto>>.Success(OrderDto, "成功"));
|
|
|
|
|
|
+ return _mapper.Map<IReadOnlyList<Hotline.Share.Dtos.WebPortal.OrderResultDto>>(items);
|
|
}
|
|
}
|
|
|
|
|
|
#endregion
|
|
#endregion
|
|
@@ -821,12 +821,12 @@ namespace Hotline.Api.Controllers
|
|
/// <param name="dto"></param>
|
|
/// <param name="dto"></param>
|
|
/// <returns></returns>
|
|
/// <returns></returns>
|
|
[HttpGet("getVisitResultList")]
|
|
[HttpGet("getVisitResultList")]
|
|
- public async Task<OpenResponse> GetVisitResultList([FromBody] DateDto dto)
|
|
|
|
|
|
+ public async Task<IReadOnlyList<Hotline.Share.Dtos.WebPortal.VisitResultDto>> GetVisitResultList([FromBody] DateDto dto)
|
|
{
|
|
{
|
|
TimeSpan timeSpan = dto.EndTime - dto.StartTime;
|
|
TimeSpan timeSpan = dto.EndTime - dto.StartTime;
|
|
if (timeSpan.TotalHours > 24)
|
|
if (timeSpan.TotalHours > 24)
|
|
{
|
|
{
|
|
- return OpenResponse.Ok(WebPortalDeResponse<IReadOnlyList<Hotline.Share.Dtos.WebPortal.VisitResultDto>>.Failed("0", "开始结束时间不能大于24小时!"));
|
|
|
|
|
|
+ throw UserFriendlyException.SameMessage("开始结束时间不能大于24小时!");
|
|
}
|
|
}
|
|
|
|
|
|
var items = await _orderVisitRepository.Queryable()
|
|
var items = await _orderVisitRepository.Queryable()
|
|
@@ -846,8 +846,7 @@ namespace Hotline.Api.Controllers
|
|
})
|
|
})
|
|
.ToListAsync();
|
|
.ToListAsync();
|
|
|
|
|
|
- var VisitDto = _mapper.Map<IReadOnlyList<Hotline.Share.Dtos.WebPortal.VisitResultDto>>(items);
|
|
|
|
- return OpenResponse.Ok(WebPortalDeResponse<IReadOnlyList<Hotline.Share.Dtos.WebPortal.VisitResultDto>>.Success(VisitDto, "成功"));
|
|
|
|
|
|
+ return _mapper.Map<IReadOnlyList<Hotline.Share.Dtos.WebPortal.VisitResultDto>>(items);
|
|
}
|
|
}
|
|
|
|
|
|
#endregion
|
|
#endregion
|
|
@@ -857,10 +856,9 @@ namespace Hotline.Api.Controllers
|
|
/// <summary>
|
|
/// <summary>
|
|
/// 账号信息
|
|
/// 账号信息
|
|
/// </summary>
|
|
/// </summary>
|
|
- /// <param name="dto"></param>
|
|
|
|
/// <returns></returns>
|
|
/// <returns></returns>
|
|
[HttpGet("getUserResultList")]
|
|
[HttpGet("getUserResultList")]
|
|
- public async Task<OpenResponse> GetUserResultList()
|
|
|
|
|
|
+ public async Task<IReadOnlyList<Hotline.Share.Dtos.WebPortal.UserResultDto>> GetUserResultList()
|
|
{
|
|
{
|
|
var items = await _userRepository.Queryable()
|
|
var items = await _userRepository.Queryable()
|
|
.OrderByDescending(x => x.CreationTime)
|
|
.OrderByDescending(x => x.CreationTime)
|
|
@@ -871,8 +869,7 @@ namespace Hotline.Api.Controllers
|
|
})
|
|
})
|
|
.ToListAsync();
|
|
.ToListAsync();
|
|
|
|
|
|
- var UserDto = _mapper.Map<IReadOnlyList<Hotline.Share.Dtos.WebPortal.UserResultDto>>(items);
|
|
|
|
- return OpenResponse.Ok(WebPortalDeResponse<IReadOnlyList<Hotline.Share.Dtos.WebPortal.UserResultDto>>.Success(UserDto, "成功"));
|
|
|
|
|
|
+ return _mapper.Map<IReadOnlyList<Hotline.Share.Dtos.WebPortal.UserResultDto>>(items);
|
|
}
|
|
}
|
|
|
|
|
|
#endregion
|
|
#endregion
|