添加LinkVerificationCode
parent
ddd06c8313
commit
67f17cffe0
|
|
@ -20885,7 +20885,7 @@
|
|||
<returns></returns>
|
||||
<exception cref="T:IRaCIS.Core.Infrastructure.BusinessValidationFailedException"></exception>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.TrialConfigService.SetTrialLinkExpirationTime(IRaCIS.Core.Application.Contracts.SetTrialLinkExpirationTimeDto)">
|
||||
<member name="M:IRaCIS.Core.Application.TrialConfigService.SetTrialLinkExpirationTime(IRaCIS.Core.Application.Contracts.TrialLinkExpirationTimeDto)">
|
||||
<summary>
|
||||
设置项目链接过期时间
|
||||
</summary>
|
||||
|
|
@ -20899,6 +20899,19 @@
|
|||
<param name="inDto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.TrialConfigService.GetLinkLinkExpirationTime(IRaCIS.Core.Application.Contracts.VerifyLinkExpirationTimeDto)">
|
||||
<summary>
|
||||
获取时间是否过期 过期返回true 没有过期返回false
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.TrialConfigService.GetLinkVerificationCodeIsEffective(IRaCIS.Core.Application.Contracts.GetLinkVerificationCodeIsEffectiveDto)">
|
||||
<summary>
|
||||
获取是否Code是否有效 有效返回true 无效返回false
|
||||
</summary>
|
||||
<param name="inDto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.TrialConfigService.GetTrialConfirmCriterionList(IRaCIS.Core.Application.Contracts.GetTrialConfirmCriterionListInDto)">
|
||||
<summary>
|
||||
获取项目已经确认的标准
|
||||
|
|
|
|||
|
|
@ -750,7 +750,14 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
public Guid TrialReadingCriterionId { get; set; }
|
||||
}
|
||||
|
||||
public class TrialLinkExpirationTimeDto
|
||||
{
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
public int ExpirationDays { get; set; }
|
||||
|
||||
public string LinkVerificationCode { get; set; }
|
||||
}
|
||||
public class SetTrialLinkExpirationTimeDto
|
||||
{
|
||||
public Guid TrialId { get; set; }
|
||||
|
|
@ -759,6 +766,38 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
|
||||
}
|
||||
|
||||
public class VerifyLinkExpirationTimeDto
|
||||
{
|
||||
public Guid TrialId { get; set; }
|
||||
}
|
||||
|
||||
public class VerifyLinkExpirationTimeOutDto
|
||||
{
|
||||
public DateTime? LinkExpirationTime { get; set; }
|
||||
|
||||
public bool isIsExpired
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.LinkExpirationTime != null && this.LinkExpirationTime < DateTime.Now;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class GetLinkVerificationCodeIsEffectiveDto
|
||||
{
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
|
||||
public string LinkVerificationCode { get; set; }
|
||||
}
|
||||
|
||||
public class GetLinkVerificationCodeIsEffectiveOutDto
|
||||
{
|
||||
public bool IsEffective { get; set; }
|
||||
}
|
||||
|
||||
public class GetTrialReadingCriterionInfoOutDto
|
||||
{
|
||||
|
||||
|
|
|
|||
|
|
@ -85,11 +85,12 @@ namespace IRaCIS.Core.Application
|
|||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput> SetTrialLinkExpirationTime(SetTrialLinkExpirationTimeDto inDto)
|
||||
public async Task<IResponseOutput> SetTrialLinkExpirationTime(TrialLinkExpirationTimeDto inDto)
|
||||
{
|
||||
await _trialRepository.UpdatePartialFromQueryAsync(x => x.Id == inDto.TrialId, x => new Trial()
|
||||
{
|
||||
LinkExpirationTime = inDto.LinkExpirationTime
|
||||
LinkExpirationTime = DateTime.Now.AddDays(inDto.ExpirationDays),
|
||||
LinkVerificationCode=inDto.LinkVerificationCode,
|
||||
});
|
||||
|
||||
await _trialRepository.SaveChangesAsync();
|
||||
|
|
@ -115,6 +116,37 @@ namespace IRaCIS.Core.Application
|
|||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取时间是否过期 过期返回true 没有过期返回false
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<VerifyLinkExpirationTimeOutDto> GetLinkLinkExpirationTime(VerifyLinkExpirationTimeDto inDto)
|
||||
{
|
||||
var time = await _trialRepository.Where(x => x.Id == inDto.TrialId).Select(x
|
||||
=> new VerifyLinkExpirationTimeOutDto() {
|
||||
LinkExpirationTime = x.LinkExpirationTime
|
||||
} ).FirstNotNullAsync();
|
||||
return time;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取是否Code是否有效 有效返回true 无效返回false
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<GetLinkVerificationCodeIsEffectiveOutDto> GetLinkVerificationCodeIsEffective(GetLinkVerificationCodeIsEffectiveDto inDto)
|
||||
{
|
||||
var trial=await _trialRepository.Where(x => x.Id == inDto.TrialId).Select(x => new { x.LinkVerificationCode, x.ResearchProgramNo }).FirstNotNullAsync();
|
||||
|
||||
return new GetLinkVerificationCodeIsEffectiveOutDto()
|
||||
{
|
||||
|
||||
IsEffective = inDto.LinkVerificationCode == (trial.LinkVerificationCode.IsNotNullOrEmpty() ? trial.ResearchProgramNo : trial.LinkVerificationCode)
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取项目已经确认的标准
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -338,6 +338,11 @@ public partial class Trial : BaseFullDeleteAuditEntity
|
|||
/// </summary>
|
||||
public DateTime? LinkExpirationTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 中心调研链接验证码 (默认用项目方案号)
|
||||
/// </summary>
|
||||
public string LinkVerificationCode { get; set; } = string.Empty;
|
||||
|
||||
}
|
||||
|
||||
public enum TrialDataStore
|
||||
|
|
|
|||
22350
IRaCIS.Core.Infra.EFCore/Migrations/20260617093152_LinkVerificationCode.Designer.cs
generated
Normal file
22350
IRaCIS.Core.Infra.EFCore/Migrations/20260617093152_LinkVerificationCode.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,30 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class LinkVerificationCode : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "LinkVerificationCode",
|
||||
table: "Trial",
|
||||
type: "nvarchar(400)",
|
||||
maxLength: 400,
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "LinkVerificationCode",
|
||||
table: "Trial");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -12711,6 +12711,11 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
|||
b.Property<DateTime?>("LinkExpirationTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("LinkVerificationCode")
|
||||
.IsRequired()
|
||||
.HasMaxLength(400)
|
||||
.HasColumnType("nvarchar(400)");
|
||||
|
||||
b.Property<string>("MainResearchUnit")
|
||||
.IsRequired()
|
||||
.HasMaxLength(400)
|
||||
|
|
|
|||
Loading…
Reference in New Issue