feat: 处理缓存null的报错
This commit is contained in:
parent
1931ffda88
commit
e727ab26ca
@ -113,7 +113,6 @@ public class KpiAreaService : ApplicationService
|
||||
await _ruleAreaRepository.UpdateAreaInfoAsync(ruleAreaEntity);
|
||||
|
||||
await _forewarningCacheService.ClearRedisByAreaId(areaInfo.AreaId);
|
||||
await RedisHelper.Client.PublishAsync(GlobalConst.PublishNotifyChannelKey, "clear local cache");
|
||||
return new UnifyResultDto(true, "更新成功");
|
||||
}
|
||||
|
||||
|
||||
@ -1,3 +1,17 @@
|
||||
namespace SJZY.Track.Domain.Dtos.Forewarning;
|
||||
|
||||
public record RuleAreaBaseInfo(int SystemId, int CustomerId);
|
||||
public class RuleAreaBaseInfo
|
||||
{
|
||||
public int SystemId { get; set; }
|
||||
public int CustomerId { get; set; }
|
||||
|
||||
public RuleAreaBaseInfo()
|
||||
{
|
||||
}
|
||||
|
||||
public RuleAreaBaseInfo(int systemId, int customerId)
|
||||
{
|
||||
SystemId = systemId;
|
||||
CustomerId = customerId;
|
||||
}
|
||||
}
|
||||
@ -60,7 +60,11 @@ public class WarningQueries : ISugarRepository, IWarningQueries,
|
||||
return Context.Queryable<WarningRuleEntity>()
|
||||
.InnerJoin<WarningEntity>((a, b) => a.WarningId == b.Id)
|
||||
.Where((a, b) => b.IsEnable && a.AreaId == areaId)
|
||||
.Select((a, b) => new RuleAreaBaseInfo(b.CustomerId, b.SubSystemId))
|
||||
.Select((a, b) => new RuleAreaBaseInfo
|
||||
{
|
||||
CustomerId = b.CustomerId,
|
||||
SystemId = b.SubSystemId
|
||||
})
|
||||
.ToListAsync();
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user