diff --git a/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs b/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs index 8d32e60d2..bd8ccb5fc 100644 --- a/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs @@ -12,6 +12,7 @@ using EasyCaching.Core; using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Infrastructure; using AutoMapper; +using MassTransit; namespace IRaCIS.Core.Application.Service { @@ -291,17 +292,18 @@ namespace IRaCIS.Core.Application.Service VisitTask visitTask = new VisitTask() { ArmEnum = Arm.JudgeArm, - + Id= NewId.NextGuid(), SubjectId = firstTask.SubjectId, ReadingTaskState = ReadingTaskState.WaitReading, TaskName = firstTask.TaskName, ReadingCategory = ReadingCategory.Judge, TrialId = firstTask.TrialId, - Code = currentMaxCodeInt + 1, TaskCode = AppSettings.GetCodeStr(currentMaxCodeInt + 1, nameof(VisitTask)), }; + + await _visitTaskRepository.AddAsync(visitTask); currentMaxCodeInt = currentMaxCodeInt + 1; _provider.Set($"{trialId }_{ StaticData.CacheKey.TaskMaxCode}", currentMaxCodeInt + 1, TimeSpan.FromMinutes(30));