@@ -39,6 +39,7 @@ namespace IRaCIS.Core.Application.Triggers
|
||||
}
|
||||
}
|
||||
|
||||
//这里提交事务 多次 会进入多次 导致新生成的裁判任务设置了后,再次进入,又设置为null了
|
||||
//这个放在save 之前,不然可能先执行添加的修改为正确的,再执行修改的,又重置为空了 所以这里需要调整下 (裁判重阅,会修改裁判需要充值, 同时也会新增裁判任务)
|
||||
public async Task BeforeSave(ITriggerContext<VisitTask> context, CancellationToken cancellationToken)
|
||||
{
|
||||
@@ -53,7 +54,13 @@ namespace IRaCIS.Core.Application.Triggers
|
||||
if (find != null)
|
||||
{
|
||||
var ids = new Guid[] { find.TaskIdOne, find.TaskIdTwo };
|
||||
await _visitTaskRepository.BatchUpdateNoTrackingAsync(t => ids.Contains(t.Id), u => new VisitTask() { JudgeVisitTaskId = null });
|
||||
|
||||
if(!_readingJudgeInfoRepository.Any(t=> ids.Contains(t.TaskIdOne) && t.CreateTime > find.CreateTime))
|
||||
{
|
||||
await _visitTaskRepository.BatchUpdateNoTrackingAsync(t => ids.Contains(t.Id), u => new VisitTask() { JudgeVisitTaskId = null });
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user