修复相关bug

This commit is contained in:
fuenmao
2026-09-14 15:59:37 +08:00
parent 20409635d6
commit f004aec10f
9 changed files with 230 additions and 29 deletions
@@ -117,6 +117,28 @@ public class OnboardingTaskLifecycleService : IOnboardingTaskLifecycleService
.Select(x => x.Id)
.ToListAsync();
var signProcessIds = await _db.Queryable<ObElectronicSignProcess>()
.Where(x => x.TaskId == task.Id)
.Select(x => x.Id)
.ToListAsync();
if (signProcessIds.Count > 0)
{
await _db.Deleteable<ObElectronicSignEvent>()
.Where(x => x.SignProcessId.HasValue
&& signProcessIds.Contains(x.SignProcessId.Value))
.ExecuteCommandAsync();
await _db.Deleteable<ObElectronicSignDocument>()
.Where(x => signProcessIds.Contains(x.SignProcessId))
.ExecuteCommandAsync();
await _db.Deleteable<ObElectronicSignProcess>()
.Where(x => signProcessIds.Contains(x.Id))
.ExecuteCommandAsync();
}
await _db.Deleteable<ObEmployeeContractSnapshot>()
.Where(x => x.TaskId == task.Id)
.ExecuteCommandAsync();
if (taskContractIds.Count > 0)
{
await _db.Deleteable<ObTaskContractVariable>()
@@ -130,7 +152,6 @@ public class OnboardingTaskLifecycleService : IOnboardingTaskLifecycleService
await _db.Deleteable<ObTaskMaterial>().Where(x => x.TaskId == task.Id).ExecuteCommandAsync();
await _db.Deleteable<ObTaskEmployeeInfo>().Where(x => x.TaskId == task.Id).ExecuteCommandAsync();
await _db.Deleteable<ObTaskFormRequirement>().Where(x => x.TaskId == task.Id).ExecuteCommandAsync();
await _db.Deleteable<ObTaskFormValue>().Where(x => x.TaskId == task.Id).ExecuteCommandAsync();
await _db.Deleteable<ObTaskOperationLog>().Where(x => x.TaskId == task.Id).ExecuteCommandAsync();
await _db.Deleteable<ObTaskAudit>().Where(x => x.TaskId == task.Id).ExecuteCommandAsync();
await _db.Deleteable<ObOnboardingTask>().In(task.Id).ExecuteCommandAsync();