IKpiTargetContracts.cs 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. using Admin.NET.Plugin.AiDOP.Dto.SmartOps;
  2. using Admin.NET.Plugin.AiDOP.Entity;
  3. namespace Admin.NET.Plugin.AiDOP.SmartOps;
  4. public interface IKpiTargetConfigStore
  5. {
  6. Task<AdoSmartOpsKpiMaster?> FindKpiAsync(long tenantId, string metricCode, CancellationToken ct = default);
  7. Task<List<AdoSmartOpsKpiTargetConfig>> ListAsync(long tenantId, string metricCode, long? factoryId, CancellationToken ct = default);
  8. Task<List<AdoSmartOpsKpiTargetConfig>> ListActiveScopeAsync(long tenantId, long factoryId, string metricCode, CancellationToken ct = default);
  9. Task<AdoSmartOpsKpiTargetConfig?> GetByIdAsync(long tenantId, long id, CancellationToken ct = default);
  10. Task<AdoSmartOpsKpiTargetConfig> InsertAsync(AdoSmartOpsKpiTargetConfig row, CancellationToken ct = default);
  11. Task UpdateAsync(AdoSmartOpsKpiTargetConfig row, CancellationToken ct = default);
  12. Task<bool> IsReferencedByDailyAsync(long tenantId, long configId, CancellationToken ct = default);
  13. Task<int> CountCommittedHashAsync(long tenantId, string sha256, CancellationToken ct = default);
  14. Task<AdoSmartOpsKpiTargetImportBatch> InsertBatchAsync(AdoSmartOpsKpiTargetImportBatch batch, CancellationToken ct = default);
  15. Task<AdoSmartOpsKpiTargetImportBatch?> GetBatchAsync(long tenantId, long batchId, CancellationToken ct = default);
  16. Task UpdateBatchAsync(AdoSmartOpsKpiTargetImportBatch batch, CancellationToken ct = default);
  17. }
  18. public interface IKpiTargetResolver
  19. {
  20. Task<KpiTargetSnapshot> ResolveAsync(
  21. long tenantId,
  22. long factoryId,
  23. string metricCode,
  24. string moduleCode,
  25. DateTime bizDate,
  26. CancellationToken ct = default);
  27. }
  28. public interface ILegacyKpiTargetProvider
  29. {
  30. Task<KpiTargetSnapshot?> TryResolveLegacyAsync(
  31. long tenantId,
  32. long factoryId,
  33. string metricCode,
  34. string moduleCode,
  35. DateTime bizDate,
  36. CancellationToken ct = default);
  37. }
  38. public interface IKpiDailyTargetReader
  39. {
  40. Task<decimal?> GetCurrentTargetAsync(long tenantId, long factoryId, string moduleCode, string metricCode, DateTime bizDate, CancellationToken ct = default);
  41. Task<decimal?> GetPriorTargetAsync(long tenantId, long factoryId, string moduleCode, string metricCode, DateTime bizDate, CancellationToken ct = default);
  42. }