|
@@ -18,6 +18,9 @@ using SqlSugar;
|
|
|
using XF.Domain.Options;
|
|
|
using XF.Utility.EnumExtensions;
|
|
|
using Hotline.Caching.Interfaces;
|
|
|
+using Hotline.Share.Enums.CallCenter;
|
|
|
+using System;
|
|
|
+using Hotline.Settings.CommonOpinions;
|
|
|
|
|
|
namespace Hotline.Api.Controllers;
|
|
|
|
|
@@ -38,6 +41,7 @@ public class UserController : BaseController
|
|
|
private readonly IAccountDomainService _accountDomainService;
|
|
|
private readonly IOptions<IdentityConfiguration> _identityConfigurationAccessor;
|
|
|
private readonly ITelRestRepository _telRestRepository;
|
|
|
+ private readonly ICommonOpinionDomainService _commonOpinionDomainService;
|
|
|
|
|
|
public UserController(
|
|
|
ISessionContext sessionContext,
|
|
@@ -51,7 +55,8 @@ public class UserController : BaseController
|
|
|
IAccountRepository accountRepository,
|
|
|
IAccountDomainService accountDomainService,
|
|
|
IOptions<IdentityConfiguration> identityConfigurationAccessor,
|
|
|
- ITelRestRepository telRestRepository)
|
|
|
+ ITelRestRepository telRestRepository,
|
|
|
+ ICommonOpinionDomainService commonOpinionDomainService)
|
|
|
{
|
|
|
_sessionContext = sessionContext;
|
|
|
_userDomainService = userDomainService;
|
|
@@ -65,6 +70,7 @@ public class UserController : BaseController
|
|
|
_accountDomainService = accountDomainService;
|
|
|
_identityConfigurationAccessor = identityConfigurationAccessor;
|
|
|
_telRestRepository = telRestRepository;
|
|
|
+ _commonOpinionDomainService = commonOpinionDomainService;
|
|
|
}
|
|
|
|
|
|
|
|
@@ -83,12 +89,27 @@ public class UserController : BaseController
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.KeyWords), d => d.UserName.Contains(dto.KeyWords) || d.StaffNo.Contains(dto.KeyWords))
|
|
|
.WhereIF(dto.BeginTime != null && dto.BeginTime != DateTime.MinValue, d => d.CreationTime >= dto.BeginTime)
|
|
|
.WhereIF(dto.EndTime != null && dto.EndTime != DateTime.MinValue, d => d.CreationTime <= dto.EndTime)
|
|
|
+ .Where(d=>d.ApplyStatus == dto.Status)
|
|
|
.OrderByDescending(d => d.CreationTime)
|
|
|
.ToPagedListAsync(dto.PageIndex, dto.PageSize, HttpContext.RequestAborted);
|
|
|
|
|
|
return new PagedDto<RestDto>(total, _mapper.Map<IReadOnlyList<RestDto>>(items));
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 小休申请页面基础信息
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ [Permission(EPermission.RestApplyBaseData)]
|
|
|
+ [HttpGet("rest-apply-basedata")]
|
|
|
+ public object RestApplyBaseData()
|
|
|
+ {
|
|
|
+ return new
|
|
|
+ {
|
|
|
+ RestApplyStatus = EnumExts.GetDescriptions<ETelRestApplyStatus>(),
|
|
|
+ RestReason = _commonOpinionDomainService.GetCommonOpinions(CommonOpinionTypeConsts.Rest).GetAwaiter().GetResult()
|
|
|
+ };
|
|
|
+ }
|
|
|
|
|
|
#endregion
|
|
|
|