修改
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
a03d7f55c7
commit
8f704c4617
|
@ -15,6 +15,8 @@ using AutoMapper.Execution;
|
|||
using System.Linq;
|
||||
using IRaCIS.Core.Infrastructure;
|
||||
using DocumentFormat.OpenXml.Office2010.Excel;
|
||||
using MassTransit;
|
||||
using NPOI.POIFS.Properties;
|
||||
namespace IRaCIS.Core.Application.Service;
|
||||
|
||||
|
||||
|
@ -281,16 +283,46 @@ public class AuditDocumentService(IRepository<AuditDocument> _auditDocumentRepos
|
|||
|
||||
}
|
||||
|
||||
///// <summary>
|
||||
///// 设置是否授权
|
||||
///// </summary>
|
||||
///// <param name="inDto"></param>
|
||||
///// <returns></returns>
|
||||
//[ht]
|
||||
// public async Task<IResponseOutput> SetIsAuthorization(SetIsAuthorizationInDto inDto)
|
||||
//{
|
||||
/// <summary>
|
||||
/// 设置是否授权
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput> SetIsAuthorization(SetIsAuthorizationInDto inDto)
|
||||
{
|
||||
var data = await _auditDocumentRepository.Select(x => new DeleteAudit()
|
||||
{
|
||||
Id = x.Id,
|
||||
ParentId = x.ParentId,
|
||||
MainFileId = x.MainFileId
|
||||
}).ToListAsync();
|
||||
|
||||
//}
|
||||
List<Guid> allid = new List<Guid>();
|
||||
findChild(allid, inDto.Ids, data);
|
||||
|
||||
await _auditDocumentRepository.UpdatePartialFromQueryAsync(t => allid.Contains(t.Id), x => new AuditDocument() {
|
||||
|
||||
IsAuthorization = inDto.IsAuthorization
|
||||
});
|
||||
await _auditDocumentRepository.SaveChangesAsync();
|
||||
return ResponseOutput.Ok();
|
||||
|
||||
void findChild(List<Guid> allId,List<Guid> current, List<DeleteAudit> data)
|
||||
{
|
||||
allId.AddRange(current);
|
||||
|
||||
var child = data.Where(x =>(x.ParentId!=null&& current.Contains(x.ParentId.Value))||(x.MainFileId!=null&¤t.Contains(x.MainFileId.Value))).Select(x => x.Id).ToList();
|
||||
if (child.Count() > 0)
|
||||
{
|
||||
|
||||
|
||||
findChild(allId, child, data);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue