Merge branch 'S07' into test
This commit is contained in:
commit
d4fa8d8dcc
@ -11,9 +11,9 @@ public class GetWarningRuleInput
|
||||
public int? SubSystemId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 关键字(kpi名称 模糊查询)
|
||||
/// kpi名称 模糊查询
|
||||
/// </summary>
|
||||
public string? Keywords { get; set; }
|
||||
public string? KpiName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 客户id
|
||||
|
||||
@ -38,7 +38,7 @@ public class WarningService : ApplicationService
|
||||
[HttpPost("GetWarningRule")]
|
||||
public async Task<UnifyResultDto<List<WarningRuleDto>>> GetWarningRule(GetWarningRuleInput input)
|
||||
{
|
||||
var result = await _warningRuleRepository.GetWarningRuleListAsync(input.SubSystemId, input.CustomId, input.Keywords, input.IsEnabled, input.WarningType);
|
||||
var result = await _warningRuleRepository.GetWarningRuleListAsync(input.SubSystemId, input.CustomId, input.KpiName, input.IsEnabled, input.WarningType);
|
||||
if (result.Count == 0)
|
||||
return new UnifyResultDto<List<WarningRuleDto>>(true, new List<WarningRuleDto>());
|
||||
|
||||
|
||||
@ -25,7 +25,7 @@ public interface IWarningRuleRepository : IBasicRepository<WarningRuleEntity>
|
||||
Task<string> UpdateVersionAsync(WarningRuleEntity entity);
|
||||
|
||||
// 模糊查询预警规则主体
|
||||
Task<List<WarningRuleEntity>> GetWarningRuleListAsync(int? subsystemId, int? customId, string? keyword, bool? isEnabled, int? warningType);
|
||||
Task<List<WarningRuleEntity>> GetWarningRuleListAsync(int? subsystemId, int? customId, string? kpiname, bool? isEnabled, int? warningType);
|
||||
|
||||
// 获取启用的预警规则主体
|
||||
Task<WarningRuleEntity?> GetWarningRuleForEnabledAsync(int subSystemId, int customId, WarningRuleType warningType);
|
||||
|
||||
@ -76,14 +76,14 @@ public class WarningRuleRepository : BasicRepository<WarningRuleEntity>, IWarnin
|
||||
return version;
|
||||
}
|
||||
|
||||
public Task<List<WarningRuleEntity>> GetWarningRuleListAsync(int? subsystemId, int? customId, string? keywords, bool? isEnabled, int? warningType)
|
||||
public Task<List<WarningRuleEntity>> GetWarningRuleListAsync(int? subsystemId, int? customId, string? kpiname, bool? isEnabled, int? warningType)
|
||||
{
|
||||
return Context.Queryable<WarningRuleEntity>()
|
||||
.WhereIF(customId.HasValue, x => x.CustomId == customId!.Value)
|
||||
.WhereIF(subsystemId.HasValue, x => x.SubSystemId == subsystemId!.Value)
|
||||
.WhereIF(warningType.HasValue, x => x.WarningType == warningType!.Value)
|
||||
.WhereIF(isEnabled.HasValue, x => x.IsEnabled == isEnabled!.Value)
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(keywords), x => x.Name.Contains(keywords!))
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(kpiname), x => x.Name.Contains(kpiname!))
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user