质检任务优化

This commit is contained in:
qianjiawei
2023-07-14 15:27:32 +08:00
parent 1eaae0a983
commit f91317c065
2 changed files with 16 additions and 16 deletions

View File

@@ -230,9 +230,8 @@ public class TimeTaskService : ITimeTaskService, IDynamicApiController, ITransie
var entitys = await _repository.AsQueryable().Where(p=>p.FullName==fullName).ToListAsync();
foreach (var entity in entitys)
{
var isOk = await _repository.AsUpdateable(entity).CallEntityMethod(m => m.Delete()).UpdateColumns(it => new { it.DeleteMark, it.DeleteTime, it.DeleteUserId }).ExecuteCommandHasChangeAsync();
if (!isOk)
throw Oops.Oh(ErrorCode.COM1002);
await _repository.AsSugarClient().Deleteable(entity).ExecuteCommandAsync();
// 从调度器里取消
SpareTime.Cancel(entity.Id);
}