Subversion Repositories Integrator Subversion

Rev

Rev 648 | Rev 717 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 648 Rev 698
Line 23... Line 23...
23
import br.com.ec.domain.dto.FolhaPagamentoDTO;
23
import br.com.ec.domain.dto.FolhaPagamentoDTO;
24
import br.com.ec.domain.dto.FolhaPagamentoFuncionarioDTO;
24
import br.com.ec.domain.dto.FolhaPagamentoFuncionarioDTO;
25
import br.com.ec.domain.dto.FolhaPagamentoFuncionarioExtraidoDTO;
25
import br.com.ec.domain.dto.FolhaPagamentoFuncionarioExtraidoDTO;
26
import br.com.ec.domain.dto.VigenciaDTO;
26
import br.com.ec.domain.dto.VigenciaDTO;
27
import br.com.ec.domain.model.Avaliacao;
27
import br.com.ec.domain.model.Avaliacao;
-
 
28
import br.com.ec.domain.model.tipos.TipoSituacoesVigencia;
28
import br.com.ec.domain.service.AvaliacaoService;
29
import br.com.ec.domain.service.AvaliacaoService;
29
import br.com.ec.domain.service.FolhaPagamentoService;
30
import br.com.ec.domain.service.FolhaPagamentoService;
30
import br.com.ec.domain.service.ParcelaService;
31
import br.com.ec.domain.service.ParcelaService;
31
import br.com.ec.domain.service.VigenciaService;
32
import br.com.ec.domain.service.VigenciaService;
32
import br.com.ec.web.exception.VerificadorLancamentoException;
33
import br.com.ec.web.exception.VerificadorLancamentoException;
Line 76... Line 77...
76
                limparEntidade();
77
                limparEntidade();
77
        }
78
        }
78
       
79
       
79
        @PostConstruct
80
        @PostConstruct
80
        private void posCarregamento() {
81
        private void posCarregamento() {
81
                if (VerificadorUtil.estaNulo(vigenciaSelecionada)) {
-
 
82
                        if (VerificadorUtil.naoEstaNulo(getParametro("vigencia"))) {
-
 
83
                                setVigenciaSelecionada(vigenciaService.consultarVigencia(new Long(getParametro("vigencia").toString())));
-
 
-
 
82
                if (VerificadorUtil.naoEstaNulo(getParametro("vigencia"))) {
-
 
83
                        setVigenciaSelecionada(vigenciaService.consultarVigencia(new Long(getParametro("vigencia").toString())));
-
 
84
                        if (VerificadorUtil.naoEstaNulo(getVigenciaSelecionada())) {
-
 
85
                                detalharFolhaPagamento();
84
                        }
86
                        }
85
                }
87
                }
-
 
88
        }
-
 
89
-
 
90
        private void detalharFolhaPagamento() {
86
                AvaliacaoDTO avaliacaoDTO = avaliacaoService.consultarAvaliacao(getVigenciaSelecionada().getSequencial());
91
                AvaliacaoDTO avaliacaoDTO = avaliacaoService.consultarAvaliacao(getVigenciaSelecionada().getSequencial());
87
                if (VerificadorUtil.naoEstaNulo(avaliacaoDTO)) {
92
                if (VerificadorUtil.naoEstaNulo(avaliacaoDTO)) {
88
                        setFolhaPagamentoDTO(folhaPagamentoService.detalharFolhaPagamento(avaliacaoDTO));
93
                        setFolhaPagamentoDTO(folhaPagamentoService.detalharFolhaPagamento(avaliacaoDTO));
89
                }
94
                }
90
        }
95
        }
Line 249... Line 254...
249
                new VerificadorLancamentoException().tratarIhRelancarExcecaoSemLimparEntidade(new CommandBean() {
254
                new VerificadorLancamentoException().tratarIhRelancarExcecaoSemLimparEntidade(new CommandBean() {
250
                        public void execute() {
255
                        public void execute() {
251
                                for (FolhaPagamentoFuncionarioDTO folhaPagamentoFuncionario : getFolhaPagamentoDTO().getFuncionarios()) {
256
                                for (FolhaPagamentoFuncionarioDTO folhaPagamentoFuncionario : getFolhaPagamentoDTO().getFuncionarios()) {
252
                                        if (!VerificadorUtil.isListaNulaOuVazia(folhaPagamentoFuncionario.getParcelas())) {
257
                                        if (!VerificadorUtil.isListaNulaOuVazia(folhaPagamentoFuncionario.getParcelas())) {
253
                                                parcelaService.efetuarPagamentoRecebimento(folhaPagamentoFuncionario.getParcelas().get(0), getDataPagamento());
258
                                                parcelaService.efetuarPagamentoRecebimento(folhaPagamentoFuncionario.getParcelas().get(0), getDataPagamento());
-
 
259
                                                vigenciaService.alterarSituacaoFolha(getVigenciaSelecionada().getSequencial(), TipoSituacoesVigencia.EM_ANDAMENTO_A.getValor());
254
                                        }
260
                                        }
255
                                }
261
                                }
256
                                setArquivoParaImportacao(null);
262
                                setArquivoParaImportacao(null);
-
 
263
                                detalharFolhaPagamento();
257
                                LancadorMensagem.lancarSucesso("PAGAMENTOS EFETUADOS COM SUCESSO");
264
                                LancadorMensagem.lancarSucesso("PAGAMENTOS EFETUADOS COM SUCESSO");
-
 
265
                        }
-
 
266
                });
-
 
267
        }
-
 
268
       
-
 
269
        public void finalizarFolhaPagamento() {
-
 
270
                new VerificadorLancamentoException().tratarIhRelancarExcecaoSemLimparEntidade(new CommandBean() {
-
 
271
                        public void execute() {
-
 
272
                                vigenciaService.alterarSituacaoFolha(getVigenciaSelecionada().getSequencial(), TipoSituacoesVigencia.FINALIZADO_F.getValor());
-
 
273
                                setArquivoParaImportacao(null);
-
 
274
                                redirecionarGestaoMensal();
-
 
275
                                LancadorMensagem.lancarSucesso("FOLHA DE PAGAMENTO FINALIZADA COM SUCESSO");
258
                        }
276
                        }
259
                });
277
                });
260
        }
278
        }
261
       
279
       
262
        public StreamedContent downloadRecibos() throws Exception {
280
        public StreamedContent downloadRecibos() throws Exception {