|
@@ -35,7 +35,8 @@ public class EndWorkflowHandler : INotificationHandler<EndWorkflowNotify>
|
|
private readonly IRepository<OrderScreen> _orderScreenRepository;
|
|
private readonly IRepository<OrderScreen> _orderScreenRepository;
|
|
private readonly IRepository<Bulletin> _bulletinRepository;
|
|
private readonly IRepository<Bulletin> _bulletinRepository;
|
|
private readonly IRepository<Circular> _circularRepository;
|
|
private readonly IRepository<Circular> _circularRepository;
|
|
- private readonly IRepository<CircularReadGroup> _circularReadGroupRepository;
|
|
|
|
|
|
+ private readonly IRepositorySqlSugar<CircularReadGroup> _circularReadGroupRepository;
|
|
|
|
+ private readonly IRepositorySqlSugar<CircularRecord> _circularRecordRepository;
|
|
|
|
|
|
public EndWorkflowHandler(
|
|
public EndWorkflowHandler(
|
|
IKnowledgeDomainService knowledgeDomainService,
|
|
IKnowledgeDomainService knowledgeDomainService,
|
|
@@ -50,7 +51,8 @@ public class EndWorkflowHandler : INotificationHandler<EndWorkflowNotify>
|
|
IRepository<OrderScreen> orderScreenRepository,
|
|
IRepository<OrderScreen> orderScreenRepository,
|
|
IRepository<Bulletin> bulletinRepository,
|
|
IRepository<Bulletin> bulletinRepository,
|
|
IRepository<Circular> circularRepository,
|
|
IRepository<Circular> circularRepository,
|
|
- IRepository<CircularReadGroup> circularReadGroupRepository
|
|
|
|
|
|
+ IRepositorySqlSugar<CircularReadGroup> circularReadGroupRepository,
|
|
|
|
+ IRepositorySqlSugar<CircularRecord> circularRecordRepository
|
|
)
|
|
)
|
|
{
|
|
{
|
|
_knowledgeDomainService = knowledgeDomainService;
|
|
_knowledgeDomainService = knowledgeDomainService;
|
|
@@ -66,6 +68,7 @@ public class EndWorkflowHandler : INotificationHandler<EndWorkflowNotify>
|
|
_bulletinRepository = bulletinRepository;
|
|
_bulletinRepository = bulletinRepository;
|
|
_circularRepository = circularRepository;
|
|
_circularRepository = circularRepository;
|
|
_circularReadGroupRepository = circularReadGroupRepository;
|
|
_circularReadGroupRepository = circularReadGroupRepository;
|
|
|
|
+ _circularRecordRepository = circularRecordRepository;
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>Handles a notification</summary>
|
|
/// <summary>Handles a notification</summary>
|
|
@@ -145,13 +148,26 @@ public class EndWorkflowHandler : INotificationHandler<EndWorkflowNotify>
|
|
if (circular.CircularType == Share.Enums.Article.ECircularType.Person)
|
|
if (circular.CircularType == Share.Enums.Article.ECircularType.Person)
|
|
{
|
|
{
|
|
//个人
|
|
//个人
|
|
- _circularReadGroupRepository.Queryable().Where(x => x.CircularId == circular.Id).Select(x => x.UserId).ToList();
|
|
|
|
- //_circularReadGroupRepository.
|
|
|
|
-
|
|
|
|
|
|
+ var userlist = await _circularReadGroupRepository.Queryable()
|
|
|
|
+ .Where(x => x.CircularId == circular.Id)
|
|
|
|
+ .Select(x => x.UserId)
|
|
|
|
+ .ToListAsync(cancellationToken);
|
|
|
|
+ await _circularRecordRepository.Updateable()
|
|
|
|
+ .SetColumns(x => x.RecordCount == x.RecordCount + 1)
|
|
|
|
+ .Where(x => userlist.Contains(x.UserId))
|
|
|
|
+ .ExecuteCommandAsync();
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
//部门
|
|
//部门
|
|
|
|
+ var orglist = await _circularReadGroupRepository.Queryable()
|
|
|
|
+ .Where(x => x.CircularId == circular.Id)
|
|
|
|
+ .Select(x => x.OrgId)
|
|
|
|
+ .ToListAsync(cancellationToken);
|
|
|
|
+ await _circularRecordRepository.Updateable()
|
|
|
|
+ .SetColumns(x => x.RecordCount == x.RecordCount + 1)
|
|
|
|
+ .Where(x => orglist.Contains(x.OrgId))
|
|
|
|
+ .ExecuteCommandAsync();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
break;
|
|
break;
|