相关优化
This commit is contained in:
@@ -30,6 +30,9 @@ public class OnboardingPublicTaskService : IOnboardingPublicTaskService
|
||||
var task = await _db.Queryable<ObOnboardingTask>().InSingleAsync(link.TaskId)
|
||||
?? throw Oops.Bah("入职任务不存在");
|
||||
|
||||
// 员工端必须展示当前 Token 的实际到期时间,不能依赖任务表中的冗余时间。
|
||||
task.LinkExpireAt = link.ExpiresAt;
|
||||
|
||||
link.AccessCount++;
|
||||
link.LastAccessedAt = DateTime.Now;
|
||||
await _db.Updateable(link).ExecuteCommandAsync();
|
||||
|
||||
@@ -79,24 +79,6 @@ public class OnboardingTaskPublicSaveInput : ObTaskEmployeeInfo
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.DataAnnotations.Required]
|
||||
public string Token { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 员工姓名。
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.DataAnnotations.Required]
|
||||
public new string EmployeeName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 手机号码。
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.DataAnnotations.Required]
|
||||
public new string Phone { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 身份证号码。
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.DataAnnotations.Required]
|
||||
public new string IdCardNumber { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -172,6 +172,16 @@ public class OnboardingTaskQueryService : IOnboardingTaskQueryService
|
||||
|
||||
if (activeLink != null)
|
||||
{
|
||||
// 修复历史数据或旧页面造成的冗余到期时间不一致。
|
||||
var activeExpiresAt = activeLink.ExpiresAt;
|
||||
if (task.LinkExpireAt != activeExpiresAt)
|
||||
{
|
||||
await _db.Updateable<ObOnboardingTask>()
|
||||
.SetColumns(item => item.LinkExpireAt == activeExpiresAt)
|
||||
.Where(item => item.Id == task.Id)
|
||||
.ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
return new OnboardingTaskCreatedOutput
|
||||
{
|
||||
TaskId = task.Id,
|
||||
|
||||
Reference in New Issue
Block a user