修改
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
1688d7c934
commit
d2571d5f79
|
@ -533,7 +533,11 @@ public class AuditDocumentService(IRepository<AuditDocument> _auditDocumentRepos
|
||||||
|
|
||||||
List<Guid> allid = new List<Guid>();
|
List<Guid> allid = new List<Guid>();
|
||||||
findChild(allid, inDto.Ids, data);
|
findChild(allid, inDto.Ids, data);
|
||||||
|
if (inDto.IsAuthorization)
|
||||||
|
{
|
||||||
|
findParent(allid, inDto.Ids, data);
|
||||||
|
}
|
||||||
|
allid= allid.Distinct().ToList();
|
||||||
await _auditDocumentRepository.UpdatePartialFromQueryAsync(t => allid.Contains(t.Id), x => new AuditDocument() {
|
await _auditDocumentRepository.UpdatePartialFromQueryAsync(t => allid.Contains(t.Id), x => new AuditDocument() {
|
||||||
|
|
||||||
IsAuthorization = inDto.IsAuthorization
|
IsAuthorization = inDto.IsAuthorization
|
||||||
|
@ -541,6 +545,20 @@ public class AuditDocumentService(IRepository<AuditDocument> _auditDocumentRepos
|
||||||
await _auditDocumentRepository.SaveChangesAsync();
|
await _auditDocumentRepository.SaveChangesAsync();
|
||||||
return ResponseOutput.Ok();
|
return ResponseOutput.Ok();
|
||||||
|
|
||||||
|
void findParent(List<Guid> allId, List<Guid> current, List<DeleteAudit> data)
|
||||||
|
{
|
||||||
|
allId.AddRange(current);
|
||||||
|
var parent = data.Where(x => current.Contains(x.Id)).Select(x => x.Id).ToList();
|
||||||
|
|
||||||
|
if (parent.Count() > 0)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
findChild(allId, parent, data);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void findChild(List<Guid> allId,List<Guid> current, List<DeleteAudit> data)
|
void findChild(List<Guid> allId,List<Guid> current, List<DeleteAudit> data)
|
||||||
{
|
{
|
||||||
allId.AddRange(current);
|
allId.AddRange(current);
|
||||||
|
|
Loading…
Reference in New Issue