diff --git a/Fila-Opiniometro/fila_opiniometro.yml b/Fila-Opiniometro/fila_opiniometro.yml index 1bb068f..cf30a7f 100644 --- a/Fila-Opiniometro/fila_opiniometro.yml +++ b/Fila-Opiniometro/fila_opiniometro.yml @@ -1,13 +1,13 @@ --- name: Fila::Opiniometro Engine::XMPP2: - username: opiniometro1 + username: opiniometro domain: agents.fila.vhost password: password override_host: localhost timeout: 5 portas: - opiniometro: emulate + opiniometro: /dev/ttyUSB0 perguntas: - 1 - 2 diff --git a/Fila-Senha/fila_senha.yml b/Fila-Senha/fila_senha.yml index 2cba4b6..b3fd6d6 100644 --- a/Fila-Senha/fila_senha.yml +++ b/Fila-Senha/fila_senha.yml @@ -7,7 +7,7 @@ Engine::XMPP2: override_host: 127.0.0.1 portas: impressora: emulate - emissor: emulate + emissor: /dev/ttyUSB0 categorias: - 1 - 2 diff --git a/Fila-Senha/lib/Fila/Senha/Model/Emissor.pm b/Fila-Senha/lib/Fila/Senha/Model/Emissor.pm index 8bbd3d7..e78ce09 100644 --- a/Fila-Senha/lib/Fila/Senha/Model/Emissor.pm +++ b/Fila-Senha/lib/Fila/Senha/Model/Emissor.pm @@ -176,7 +176,7 @@ sub _check_rb { my $buf = $self->read_buffer; return unless $buf; - return unless length $buf >= 5; + return unless length $buf >= 2; while ($buf) { if (substr($buf,0,1) ne '@') { diff --git a/Fila-Servico/lib/Fila/Servico/Controller/WS/Gestao/Atendente.pm b/Fila-Servico/lib/Fila/Servico/Controller/WS/Gestao/Atendente.pm index 69f5755..39e4e2e 100644 --- a/Fila-Servico/lib/Fila/Servico/Controller/WS/Gestao/Atendente.pm +++ b/Fila-Servico/lib/Fila/Servico/Controller/WS/Gestao/Atendente.pm @@ -79,16 +79,15 @@ sub refresh_atendente :Private { my $guiche = $self->status_guiche($c, {}); - my $atendente = $c->stash->{guiche}->atendente_atual->first; + my $atendente = $c->stash->{guiche}->atendente_atual->first || $c->stash->{atendente}; if ($atendente) { $c->model('SOAP')->transport->connection($c->engine->connection($c)); $c->model('SOAP')->transport->addrs([$atendente->funcionario->jid.'/cb/render/atendente']); $c->model('SOAP::CB::Atendente')->render_atendente({ %$guiche }); - } elsif ($c->stash->{atendente}) { - $c->model('SOAP')->transport->connection($c->engine->connection($c)); - $c->model('SOAP')->transport->addrs([$c->stash->{atendente}->funcionario->jid.'/cb/render/atendente']); - $c->model('SOAP::CB::Atendente')->render_atendente({ %$guiche }); + + $c->model('SOAP')->transport->addrs([$c->stash->{gerente}->funcionario->jid.'/cb/render/guiche_gerente']); + $c->model('SOAP::CB::GuicheGerente')->render_guiche_gerente({ %$guiche }); } $c->stash->{soap}->compile_return($old); @@ -348,7 +347,6 @@ sub registrar_no_show :WSDLPort('GestaoAtendente') :DBICTransaction('DB') :MI { vt_fim => 'Infinity', id_estado => $estado_concluido->id_estado }); - $c->stash->{refresh_gerente} = 1; $c->stash->{refresh_guiche} ||= []; push @{$c->stash->{refresh_guiche}}, $c->stash->{guiche}->id_guiche; } @@ -444,7 +442,6 @@ sub atender_no_show :WSDLPort('GestaoAtendente') :DBICTransaction('DB') :MI { vt_fim => 'Infinity', id_estado => $estado_atendendo_gu->id_estado }); - $c->stash->{refresh_gerente} = 1; $c->stash->{refresh_guiche} ||= []; push @{$c->stash->{refresh_guiche}}, $c->stash->{guiche}->id_guiche; } @@ -517,7 +514,6 @@ sub iniciar_atendimento :WSDLPort('GestaoAtendente') :DBICTransaction('DB') :MI $c->stash->{refresh_painel} = 1; - $c->stash->{refresh_gerente} = 1; $c->stash->{refresh_guiche} ||= []; push @{$c->stash->{refresh_guiche}}, $c->stash->{guiche}->id_guiche; } @@ -593,7 +589,6 @@ sub devolver_senha :WSDLPort('GestaoAtendente') :DBICTransaction('DB') :MI { ({ vt_fim => $now }); $c->stash->{refresh_painel} = 1; - $c->stash->{refresh_gerente} = 1; $c->stash->{refresh_guiche} ||= []; push @{$c->stash->{refresh_guiche}}, $c->stash->{guiche}->id_guiche; } @@ -681,7 +676,7 @@ sub concluir_atendimento :WSDLPort('GestaoAtendente') :DBICTransaction('DB') :MI $c->model('SOAP')->transport->connection($c->engine->connection($c)); $c->model('SOAP')->transport->addrs([$c->stash->{guiche}->jid_opiniometro . '/callback']); $c->model('SOAP::Opiniometro') - ->iniciar_opiniometro({ refresh_request => '' }); + ->iniciar_opiniometro({ refresh_request => 'abc' }); } else { #encerra atendimento my $estado_atual = $atendimento->atendimento->estado_atual->search @@ -727,16 +722,15 @@ sub concluir_atendimento :WSDLPort('GestaoAtendente') :DBICTransaction('DB') :MI $c->model('SOAP')->transport->connection($c->engine->connection($c)); - $c->model('SOAP')->transport->addrs([$guiche->jid_opiniometro . '/callback/']); + $c->model('SOAP')->transport->addrs([$guiche->jid_opiniometro . '/callback']); $c->model('SOAP::Opiniometro') - ->encerrar_opiniometro({ refresh_request => '' }); + ->encerrar_opiniometro({ refresh_request => 'abc' }); $c->stash->{refresh_guiche} ||= []; push @{$c->stash->{refresh_guiche}}, $guiche->id_guiche; } $c->stash->{refresh_painel} = 1; - $c->stash->{refresh_gerente} = 1; $c->stash->{refresh_guiche} ||= []; push @{$c->stash->{refresh_guiche}}, $c->stash->{guiche}->id_guiche; } @@ -882,7 +876,6 @@ sub iniciar_pausa :WSDLPort('GestaoAtendente') :DBICTransaction('DB') :MI { motivo => '' }); - $c->stash->{refresh_gerente} = 1; $c->stash->{refresh_guiche} ||= []; push @{$c->stash->{refresh_guiche}}, $c->stash->{guiche}->id_guiche; } @@ -911,7 +904,6 @@ sub setar_motivo_pausa : WSDLPort('GestaoAtendente') :DBICTransaction('DB') :MI $pausa_atual->update ({ motivo => $pausa_motivo }); - $c->stash->{refresh_gerente} = 1; $c->stash->{refresh_guiche} ||= []; push @{$c->stash->{refresh_guiche}}, $c->stash->{guiche}->id_guiche; } @@ -956,7 +948,6 @@ sub fechar_servico_interno: WSDLPort('GestaoAtendente') :DBICTransaction('DB') : vt_fim => 'Infinity', id_estado => $estado_concluido->id_estado }); - $c->stash->{refresh_gerente} = 1; $c->stash->{refresh_guiche} ||= []; push @{$c->stash->{refresh_guiche}}, $c->stash->{guiche}->id_guiche; } @@ -1017,7 +1008,6 @@ sub disponivel :WSDLPort('GestaoAtendente') :DBICTransaction('DB') :MI { id_estado => $estado_disponivel->id_estado }); - $c->stash->{escalonar_gerente} = 1; $c->stash->{escalonar_senha} = 1; $c->stash->{refresh_guiche} ||= []; push @{$c->stash->{refresh_guiche}}, $c->stash->{guiche}->id_guiche; @@ -1154,7 +1144,6 @@ sub iniciar_servico_interno :WSDLPort('GestaoAtendente') :DBICTransaction('DB') id_servico => $id_servico, informacoes => '' }); - $c->stash->{refresh_gerente} = 1; $c->stash->{refresh_guiche} ||= []; push @{$c->stash->{refresh_guiche}}, $c->stash->{guiche}->id_guiche; @@ -1238,7 +1227,6 @@ sub setar_info_interno : WSDLPort('GestaoAtendente') :DBICTransaction('DB') :MI $servico_atual->update ({ informacoes => $informacoes }); - $c->stash->{refresh_gerente} = 1; $c->stash->{refresh_guiche} ||= []; push @{$c->stash->{refresh_guiche}}, $c->stash->{guiche}->id_guiche; } @@ -1287,7 +1275,6 @@ sub iniciar_servico_atendimento :WSDLPort('GestaoAtendente') :DBICTransaction('D id_servico => $id_servico, informacoes => '' }); - $c->stash->{refresh_gerente} = 1; $c->stash->{refresh_guiche} ||= []; push @{$c->stash->{refresh_guiche}}, $c->stash->{guiche}->id_guiche; @@ -1338,7 +1325,6 @@ sub fechar_servico_atendimento: WSDLPort('GestaoAtendente') :DBICTransaction('DB $servico_atual->update ({ vt_fim => $now }); - $c->stash->{refresh_gerente} = 1; $c->stash->{refresh_guiche} ||= []; push @{$c->stash->{refresh_guiche}}, $c->stash->{guiche}->id_guiche; } @@ -1393,7 +1379,6 @@ sub setar_info_atendimento : WSDLPort('GestaoAtendente') :DBICTransaction('DB') $servico_atual->update ({ informacoes => $informacoes }); - $c->stash->{refresh_gerente} = 1; $c->stash->{refresh_guiche} ||= []; push @{$c->stash->{refresh_guiche}}, $c->stash->{guiche}->id_guiche; } @@ -1437,7 +1422,6 @@ sub retornar_pausa : WSDLPort('GestaoAtendente') :DBICTransaction('DB') :MI { vt_fim => 'Infinity', id_estado => $estado_concluido->id_estado }); - $c->stash->{refresh_gerente} = 1; $c->stash->{refresh_guiche} ||= []; push @{$c->stash->{refresh_guiche}}, $c->stash->{guiche}->id_guiche; diff --git a/Fila-Servico/lib/Fila/Servico/Model/SOAP.pm b/Fila-Servico/lib/Fila/Servico/Model/SOAP.pm index 9d39088..9cd0e3b 100644 --- a/Fila-Servico/lib/Fila/Servico/Model/SOAP.pm +++ b/Fila-Servico/lib/Fila/Servico/Model/SOAP.pm @@ -27,6 +27,7 @@ __PACKAGE__->register_wsdl ({ wsdl => Fila::Servico->path_to('/schemas/FilaWebApp.wsdl'), schema => Fila::Servico->path_to('/schemas/fila-servico.xsd') }, { render_gerente => 'CB::Gerente', + render_guiche_gerente => 'CB::GuicheGerente', render_atendente => 'CB::Atendente', render_error => 'CB::Error' }); diff --git a/Fila-Servico/schemas/FilaWebApp.wsdl b/Fila-Servico/schemas/FilaWebApp.wsdl index 8a00d12..4fc58f4 100644 --- a/Fila-Servico/schemas/FilaWebApp.wsdl +++ b/Fila-Servico/schemas/FilaWebApp.wsdl @@ -56,6 +56,12 @@ + + + + + + @@ -82,6 +88,14 @@ + + + + + + + + @@ -110,6 +124,9 @@ + + + diff --git a/Fila-Servico/script/fila_servico_xmpp.pl b/Fila-Servico/script/fila_servico_xmpp.pl index e49f680..6deaa1b 100755 --- a/Fila-Servico/script/fila_servico_xmpp.pl +++ b/Fila-Servico/script/fila_servico_xmpp.pl @@ -25,14 +25,7 @@ use Pod::Usage; use FindBin; use lib "$FindBin::Bin/../lib"; -use EV; -use AnyEvent; -use Net::XMPP2::Connection; use Catalyst::Engine::XMPP2; -{ - no warnings; - *Catalyst::Engine::XMPP2::loop = *EV::loop; -} my $debug = 0; my $help = 0; diff --git a/Fila-Web/lib/Fila/WebApp/Controller/CB/Render/Gerente.pm b/Fila-Web/lib/Fila/WebApp/Controller/CB/Render/Gerente.pm index 94120f1..3f85503 100644 --- a/Fila-Web/lib/Fila/WebApp/Controller/CB/Render/Gerente.pm +++ b/Fila-Web/lib/Fila/WebApp/Controller/CB/Render/Gerente.pm @@ -35,6 +35,13 @@ sub render_gerente :WSDLPort('render_gerente') { $c->forward($c->view()); } +sub render_guiche_gerente :WSDLPort('render_guiche_gerente') { + my ($self, $c, $dados) = @_; + $c->stash->{guiche} = $dados->{guiche}; + $c->stash->{template} = 'render/guiche_gerente.tt'; + $c->forward($c->view()); +} + 1; __END__ diff --git a/Fila-Web/root/render/guiche.tt b/Fila-Web/root/render/guiche.tt new file mode 100644 index 0000000..bbf2ad5 --- /dev/null +++ b/Fila-Web/root/render/guiche.tt @@ -0,0 +1,64 @@ + + + [% SWITCH guiche.estado %] + [% CASE ['atendimento' 'disponivel' 'chamando' ] %] + + + + + + + + + [% SWITCH guiche.estado %] + [% CASE 'pausa' %] + + [% CASE 'interno' %] + + [% CASE 'chamando' %] + + [% CASE 'concluido' %] + + [% CASE 'atendimento' %] + + [% CASE 'disponivel' %] + + [% CASE %] + [% IF guiche.estado_atendimento == 'avaliacao' %] + + [% ELSE %] + [%# %] + [% END %] + [% END %] +
[% guiche.identificador %] + [% CASE ['interno' 'pausa'] %] + [% guiche.identificador %] + [% CASE ['avaliacao' 'concluido'] %] + [% guiche.identificador %] + [% CASE ['fechado'] %] + [% guiche.identificador %] + + [% END %] + [% IF guiche.pular_opiniometro == 0 %] + + [% c.prototype.link_to_remote('(Desab.)', { url => '/cb/gerente/pular_opiniometro/1/' _ guiche.id_guiche, confirm => 'confirmar(\'Deseja mesmo desabilitar o opiniometro da mesa?\')' }) %] + + [% ELSE %] + + [% c.prototype.link_to_remote('(Habil.)', { url => '/cb/gerente/pular_opiniometro/0/' _ guiche.id_guiche, confirm => 'confirmar(\'Deseja habilitar o opiniometro da mesa?\')' }) %] + + [% END %] + [% guiche.estado %] [%guiche.senha%] + [% SWITCH guiche.estado %] + [% CASE 'pausa' %] + + (Motivo) + + [% CASE 'interno' %] + + (Serviço) + + [% END %] +
[% dtf.f(guiche.estado_desde) %] 
[% guiche.funcionario %] 
[% c.prototype.link_to_remote('(Fechar Mesa)', { url => '/cb/gerente/fechar_guiche/' _ guiche.id_guiche , confirm => 'confirmar(\'Deseja mesmo fechar a mesa?\')' }) %]
[% c.prototype.link_to_remote('(Fechar Mesa)', { url => '/cb/gerente/fechar_guiche/' _ guiche.id_guiche , confirm => 'confirmar(\'Deseja mesmo fechar a mesa?\')' }) %]
[% c.prototype.link_to_remote('(Devolver Senha)', { url => '/cb/gerente/devolver_senha/' _ guiche.id_guiche }) %]
[% c.prototype.link_to_remote('(Fechar Mesa)', { url => '/cb/gerente/fechar_guiche/' _ guiche.id_guiche , confirm => 'confirmar(\'Deseja mesmo fechar a mesa?\')' }) %]
[% c.prototype.link_to_remote('(Encerrar)', { url => '/cb/gerente/concluir_atendimento/' _ guiche.id_guiche , confirm => 'confirmar(\'Deseja mesmo concluir o atendimento?\')' }) %]
[% c.prototype.link_to_remote('(Fechar Mesa)', { url => '/cb/gerente/fechar_guiche/' _ guiche.id_guiche , confirm => 'confirmar(\'Deseja mesmo fechar a mesa?\')' }) %]
+ [% c.prototype.link_to_remote('(Encerrar)', { url => '/cb/gerente/encerrar_atendimento/' _ guiche.id_atendimento }) %] +
 
diff --git a/Fila-Web/root/render/guiche_gerente.tt b/Fila-Web/root/render/guiche_gerente.tt new file mode 100644 index 0000000..de95650 --- /dev/null +++ b/Fila-Web/root/render/guiche_gerente.tt @@ -0,0 +1,10 @@ + diff --git a/Fila-Web/root/render/guiches.tt b/Fila-Web/root/render/guiches.tt index 2355613..ac5ff72 100644 --- a/Fila-Web/root/render/guiches.tt +++ b/Fila-Web/root/render/guiches.tt @@ -21,70 +21,7 @@ [% nova_lista_guiches = BLOCK %]
[% FOREACH guiche IN status_guiches.lista_guiches.guiche %] - - - [% SWITCH guiche.estado %] - [% CASE ['atendimento' 'disponivel' 'chamando' ] %] - - - - - - - - - [% SWITCH guiche.estado %] - [% CASE 'pausa' %] - - [% CASE 'interno' %] - - [% CASE 'chamando' %] - - [% CASE 'concluido' %] - - [% CASE 'atendimento' %] - - [% CASE 'disponivel' %] - - [% CASE %] - [% IF guiche.estado_atendimento == 'avaliacao' %] - - [% ELSE %] - [%# %] - [% END %] - [% END %] -
[% guiche.identificador %] - [% CASE ['interno' 'pausa'] %] - [% guiche.identificador %] - [% CASE ['avaliacao' 'concluido'] %] - [% guiche.identificador %] - [% CASE ['fechado'] %] - [% guiche.identificador %] - - [% END %] - [% IF guiche.pular_opiniometro == 0 %] - - [% c.prototype.link_to_remote('(Desab.)', { url => '/cb/gerente/pular_opiniometro/1/' _ guiche.id_guiche, confirm => 'confirmar(\'Deseja mesmo desabilitar o opiniometro da mesa?\')' }) %] - - [% ELSE %] - - [% c.prototype.link_to_remote('(Habil.)', { url => '/cb/gerente/pular_opiniometro/0/' _ guiche.id_guiche, confirm => 'confirmar(\'Deseja habilitar o opiniometro da mesa?\')' }) %] - - [% END %] - [% guiche.estado %] [%guiche.senha%] - [% SWITCH guiche.estado %] - [% CASE 'pausa' %] - - (Motivo) - - [% CASE 'interno' %] - - (Serviço) - - [% END %] -
[% dtf.f(guiche.estado_desde) %] 
[% guiche.funcionario %] 
[% c.prototype.link_to_remote('(Fechar Mesa)', { url => '/cb/gerente/fechar_guiche/' _ guiche.id_guiche , confirm => 'confirmar(\'Deseja mesmo fechar a mesa?\')' }) %]
[% c.prototype.link_to_remote('(Fechar Mesa)', { url => '/cb/gerente/fechar_guiche/' _ guiche.id_guiche , confirm => 'confirmar(\'Deseja mesmo fechar a mesa?\')' }) %]
[% c.prototype.link_to_remote('(Devolver Senha)', { url => '/cb/gerente/devolver_senha/' _ guiche.id_guiche }) %]
[% c.prototype.link_to_remote('(Fechar Mesa)', { url => '/cb/gerente/fechar_guiche/' _ guiche.id_guiche , confirm => 'confirmar(\'Deseja mesmo fechar a mesa?\')' }) %]
[% c.prototype.link_to_remote('(Encerrar)', { url => '/cb/gerente/concluir_atendimento/' _ guiche.id_guiche , confirm => 'confirmar(\'Deseja mesmo concluir o atendimento?\')' }) %]
[% c.prototype.link_to_remote('(Fechar Mesa)', { url => '/cb/gerente/fechar_guiche/' _ guiche.id_guiche , confirm => 'confirmar(\'Deseja mesmo fechar a mesa?\')' }) %]
- [% c.prototype.link_to_remote('(Encerrar)', { url => '/cb/gerente/encerrar_atendimento/' _ guiche.id_atendimento }) %] -
 
+ [% INCLUDE 'render/guiche.tt' %] [% END %]
-- libgit2 0.21.2