| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- using Admin.NET.Plugin.AiDOP.Dto.S8;
- using Admin.NET.Plugin.AiDOP.Entity.S8;
- namespace Admin.NET.Plugin.AiDOP.Service.S8;
- public class S8DecisionService : ITransient
- {
- private readonly SqlSugarRepository<AdoS8ExceptionTimeline> _timelineRep;
- private readonly SqlSugarRepository<AdoS8DecisionRecord> _decisionRep;
- private readonly SqlSugarRepository<AdoS8Evidence> _evidenceRep;
- public S8DecisionService(
- SqlSugarRepository<AdoS8ExceptionTimeline> timelineRep,
- SqlSugarRepository<AdoS8DecisionRecord> decisionRep,
- SqlSugarRepository<AdoS8Evidence> evidenceRep)
- {
- _timelineRep = timelineRep;
- _decisionRep = decisionRep;
- _evidenceRep = evidenceRep;
- }
- public async Task<List<AdoS8TimelineItemDto>> GetTimelineAsync(long exceptionId) =>
- await _timelineRep.AsQueryable()
- .Where(x => x.ExceptionId == exceptionId)
- .OrderBy(x => x.CreatedAt)
- .Select(x => new AdoS8TimelineItemDto
- {
- Id = x.Id,
- ActionCode = x.ActionCode,
- ActionLabel = x.ActionLabel,
- FromStatus = x.FromStatus,
- ToStatus = x.ToStatus,
- OperatorId = x.OperatorId,
- OperatorName = x.OperatorName,
- ActionRemark = x.ActionRemark,
- CreatedAt = x.CreatedAt
- })
- .ToListAsync();
- public async Task<List<AdoS8DecisionItemDto>> GetDecisionsAsync(long exceptionId) =>
- await _decisionRep.AsQueryable()
- .Where(x => x.ExceptionId == exceptionId && !x.IsDeleted)
- .OrderBy(x => x.DecisionTime)
- .Select(x => new AdoS8DecisionItemDto
- {
- Id = x.Id,
- DecisionType = x.DecisionType,
- DecisionMakerId = x.DecisionMakerId,
- DecisionMakerName = x.DecisionMakerName,
- DecisionBasis = x.DecisionBasis,
- DecisionResult = x.DecisionResult,
- DecisionRemark = x.DecisionRemark,
- DecisionTime = x.DecisionTime
- })
- .ToListAsync();
- public async Task<List<AdoS8EvidenceItemDto>> GetEvidencesAsync(long exceptionId) =>
- await _evidenceRep.AsQueryable()
- .Where(x => x.ExceptionId == exceptionId && !x.IsDeleted)
- .OrderBy(x => x.UploadedAt)
- .Select(x => new AdoS8EvidenceItemDto
- {
- Id = x.Id,
- EvidenceType = x.EvidenceType,
- FileName = x.FileName,
- FileUrl = x.FileUrl,
- SourceSystem = x.SourceSystem,
- UploadedBy = x.UploadedBy,
- UploadedAt = x.UploadedAt
- })
- .ToListAsync();
- }
|