chore: Correção de lógica de contagem e remoção de usuário de testes.
This commit is contained in:
parent
5e85c05cf7
commit
858a52b551
@ -12,7 +12,7 @@ class Program
|
||||
static bool _stop = false;
|
||||
static bool _isAuthenticated = false;
|
||||
static readonly string _connectionString = "Server=192.168.10.248;Port=5432;Database=pipefy_move_cards;User Id=postgres;Password=gds21;";
|
||||
static readonly string _windowsID = "gestao1.3"; // Environment.UserName;
|
||||
static readonly string _windowsID = Environment.UserName;
|
||||
static readonly List<(string actionId, string actionName)> _actionIds = // Tuplas de IDs e nomes das fases que queremos monitorar
|
||||
[
|
||||
new ("318642783-318906957", "Agendou reunião 1"),
|
||||
@ -111,6 +111,7 @@ class Program
|
||||
// Para cada usuário, rodar uma query COUNT(*) e adicionar linha na tabela
|
||||
foreach (var (userId, nome) in _pipeUsers)
|
||||
{
|
||||
var userRecords = new List<Record>();
|
||||
int count = 0;
|
||||
AnsiConsole.Status()
|
||||
.Spinner(Spinner.Known.Line)
|
||||
@ -147,7 +148,7 @@ class Program
|
||||
temp.AcaoID = temp.From + "-" + temp.To;
|
||||
temp.Acao = _actionIds.Find(p => p.actionId == temp.AcaoID).actionName;
|
||||
|
||||
records.Add(temp);
|
||||
userRecords.Add(temp);
|
||||
}
|
||||
}
|
||||
//}
|
||||
@ -158,8 +159,9 @@ class Program
|
||||
// AnsiConsole.MarkupLine($"\n[red]Erro ao consultar {nome}:[/] {ex.Message}");
|
||||
//}
|
||||
});
|
||||
count = records.Where(x => x.MovedAt >= DateTime.Today).ToList().Count;
|
||||
count = userRecords.Where(x => (x.MovedAt > DateTime.Today && x.FieldID is not null)).ToList().Count;
|
||||
tableContLigacoes.AddRow(nome, userId.ToString(), $"[bold yellow]{count}[/]");
|
||||
records.AddRange(userRecords);
|
||||
}
|
||||
|
||||
var panel = new Panel(new Align(tableContLigacoes, HorizontalAlignment.Center, VerticalAlignment.Top))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user