|
|
@ -38,6 +38,7 @@ using Shentun.Utilities.Enums; |
|
|
using Shentun.Sms.Client; |
|
|
using Shentun.Sms.Client; |
|
|
using Shentun.Utilities; |
|
|
using Shentun.Utilities; |
|
|
using IdentityModel; |
|
|
using IdentityModel; |
|
|
|
|
|
using Shentun.WebPeis.SysParmValues; |
|
|
namespace Shentun.WebPeis.Persons |
|
|
namespace Shentun.WebPeis.Persons |
|
|
{ |
|
|
{ |
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
@ -61,6 +62,7 @@ namespace Shentun.WebPeis.Persons |
|
|
private readonly CacheService _cacheService; |
|
|
private readonly CacheService _cacheService; |
|
|
private readonly IHttpContextAccessor _httpContextAccessor; |
|
|
private readonly IHttpContextAccessor _httpContextAccessor; |
|
|
private readonly IRepository<CustomerOrg> _customerOrgRepository; |
|
|
private readonly IRepository<CustomerOrg> _customerOrgRepository; |
|
|
|
|
|
private readonly SysParmValueManager _sysParmValueManager; |
|
|
public PersonAppService(IRepository<Person> repository, |
|
|
public PersonAppService(IRepository<Person> repository, |
|
|
IConfiguration configuration, |
|
|
IConfiguration configuration, |
|
|
IRepository<Volo.Abp.Identity.IdentityUser, Guid> identityUserRepository, |
|
|
IRepository<Volo.Abp.Identity.IdentityUser, Guid> identityUserRepository, |
|
|
@ -74,7 +76,8 @@ namespace Shentun.WebPeis.Persons |
|
|
CacheService cacheService, |
|
|
CacheService cacheService, |
|
|
IHttpContextAccessor httpContextAccessor, |
|
|
IHttpContextAccessor httpContextAccessor, |
|
|
IRepository<CustomerOrg> customerOrgRepository, |
|
|
IRepository<CustomerOrg> customerOrgRepository, |
|
|
IRepository<QuestionRegister> questionRegisterRepository) |
|
|
|
|
|
|
|
|
IRepository<QuestionRegister> questionRegisterRepository, |
|
|
|
|
|
SysParmValueManager sysParmValueManager) |
|
|
{ |
|
|
{ |
|
|
_repository = repository; |
|
|
_repository = repository; |
|
|
_configuration = configuration; |
|
|
_configuration = configuration; |
|
|
@ -90,6 +93,7 @@ namespace Shentun.WebPeis.Persons |
|
|
_httpContextAccessor = httpContextAccessor; |
|
|
_httpContextAccessor = httpContextAccessor; |
|
|
_customerOrgRepository = customerOrgRepository; |
|
|
_customerOrgRepository = customerOrgRepository; |
|
|
_questionRegisterRepository = questionRegisterRepository; |
|
|
_questionRegisterRepository = questionRegisterRepository; |
|
|
|
|
|
_sysParmValueManager = sysParmValueManager; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public async Task<PersonDto> GetByIdAsync(PersonIdInputDto input) |
|
|
public async Task<PersonDto> GetByIdAsync(PersonIdInputDto input) |
|
|
@ -154,7 +158,10 @@ namespace Shentun.WebPeis.Persons |
|
|
_cache.Set(sessionKey, sessionKeyValue, options); |
|
|
_cache.Set(sessionKey, sessionKeyValue, options); |
|
|
token.SessionKey = sessionKey; |
|
|
token.SessionKey = sessionKey; |
|
|
token.SessionKeyValue = sessionKeyValue; |
|
|
token.SessionKeyValue = sessionKeyValue; |
|
|
|
|
|
|
|
|
|
|
|
var isOpenPersonalAppointmentStr = await _sysParmValueManager.GetSysParmValueAsync(Guid.Empty, "is_open_personal_appointment"); |
|
|
|
|
|
if (string.IsNullOrWhiteSpace(isOpenPersonalAppointmentStr)) |
|
|
|
|
|
isOpenPersonalAppointmentStr = "Y"; |
|
|
|
|
|
token.IsOpenPersonalAppointment = Convert.ToChar(isOpenPersonalAppointmentStr); |
|
|
return token; |
|
|
return token; |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
@ -765,12 +772,25 @@ namespace Shentun.WebPeis.Persons |
|
|
|
|
|
|
|
|
var verifySmsValidTimeStr = _configuration.GetSection("Sms") |
|
|
var verifySmsValidTimeStr = _configuration.GetSection("Sms") |
|
|
.GetSection("VerifySmsValidTime").Value; |
|
|
.GetSection("VerifySmsValidTime").Value; |
|
|
|
|
|
|
|
|
|
|
|
var isTemplateTimeStr = _configuration.GetSection("Sms") |
|
|
|
|
|
.GetSection("IsTemplateTime").Value; |
|
|
|
|
|
|
|
|
if (!int.TryParse(verifySmsValidTimeStr, out var verifySmsValidTime)) |
|
|
if (!int.TryParse(verifySmsValidTimeStr, out var verifySmsValidTime)) |
|
|
{ |
|
|
{ |
|
|
throw new Exception("解析校验短信有效时间错误"); |
|
|
throw new Exception("解析校验短信有效时间错误"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (isTemplateTimeStr == "N") |
|
|
|
|
|
{ |
|
|
|
|
|
createSmsTaskDto.Content = message; |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
createSmsTaskDto.Content = message + "|" + verifySmsValidTime.ToString(); |
|
|
createSmsTaskDto.Content = message + "|" + verifySmsValidTime.ToString(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//发送短信
|
|
|
//发送短信
|
|
|
createSmsTaskDto.TaskCycleType = '0'; |
|
|
createSmsTaskDto.TaskCycleType = '0'; |
|
|
await SmsClientHelper.CreateVerifySmsTask(createSmsTaskDto); |
|
|
await SmsClientHelper.CreateVerifySmsTask(createSmsTaskDto); |
|
|
|