Rev 740 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 740 | Rev 742 | ||
|---|---|---|---|
| Line 50... | Line 50... | ||
| 50 | private FolhaPagamentoService folhaPagamentoService; |
50 | private FolhaPagamentoService folhaPagamentoService; |
| 51 | private VigenciaService vigenciaService; |
51 | private VigenciaService vigenciaService; |
| 52 | private AvaliacaoService avaliacaoService; |
52 | private AvaliacaoService avaliacaoService; |
| 53 | 53 | ||
| 54 | private UploadedFile arquivoParaImportacao; |
54 | private UploadedFile arquivoParaImportacao; |
| - | 55 | private List<byte[]> arquivosImportados; |
|
| - | 56 | ||
| 55 | private String tituloEmail = "CONTRACHEQUE"; |
57 | private String tituloEmail = "CONTRACHEQUE"; |
| 56 | private Date dataPagamento = new Date(); |
58 | private Date dataPagamento = new Date(); |
| 57 | 59 | ||
| 58 | private ParcelaService parcelaService; |
60 | private ParcelaService parcelaService; |
| 59 | 61 | ||
| Line 90... | Line 92... | ||
| 90 | 92 | ||
| 91 | private void detalharFolhaPagamento() { |
93 | private void detalharFolhaPagamento() { |
| 92 | AvaliacaoDTO avaliacaoDTO = avaliacaoService.consultarAvaliacao(getVigenciaSelecionada().getSequencial()); |
94 | AvaliacaoDTO avaliacaoDTO = avaliacaoService.consultarAvaliacao(getVigenciaSelecionada().getSequencial()); |
| 93 | if (VerificadorUtil.naoEstaNulo(avaliacaoDTO)) { |
95 | if (VerificadorUtil.naoEstaNulo(avaliacaoDTO)) { |
| 94 | setFolhaPagamentoDTO(folhaPagamentoService.detalharFolhaPagamento(avaliacaoDTO)); |
96 | setFolhaPagamentoDTO(folhaPagamentoService.detalharFolhaPagamento(avaliacaoDTO)); |
| - | 97 | }
|
|
| - | 98 | if (VerificadorUtil.naoEstaNuloOuVazio(getArquivosImportados())) { |
|
| - | 99 | setFolhaPagamentoDTO(folhaPagamentoService.importarFolhaPagamento(getArquivosImportados(), getFolhaPagamentoDTO())); |
|
| 95 | }
|
100 | }
|
| 96 | }
|
101 | }
|
| 97 | 102 | ||
| 98 | @Override |
103 | @Override |
| 99 | public void limparEntidade() { |
104 | public void limparEntidade() { |
| Line 160... | Line 165... | ||
| 160 | public UploadedFile getArquivoParaImportacao() { |
165 | public UploadedFile getArquivoParaImportacao() { |
| 161 | return arquivoParaImportacao; |
166 | return arquivoParaImportacao; |
| 162 | }
|
167 | }
|
| 163 | public void setArquivoParaImportacao(UploadedFile arquivoParaImportacao) { |
168 | public void setArquivoParaImportacao(UploadedFile arquivoParaImportacao) { |
| 164 | this.arquivoParaImportacao = arquivoParaImportacao; |
169 | this.arquivoParaImportacao = arquivoParaImportacao; |
| - | 170 | }
|
|
| - | 171 | ||
| - | 172 | public List<byte[]> getArquivosImportados() { |
|
| - | 173 | return arquivosImportados; |
|
| - | 174 | }
|
|
| - | 175 | public void setArquivosImportados(List<byte[]> arquivosImportados) { |
|
| - | 176 | this.arquivosImportados = arquivosImportados; |
|
| 165 | }
|
177 | }
|
| 166 | 178 | ||
| 167 | public String getTituloEmail() { |
179 | public String getTituloEmail() { |
| 168 | return tituloEmail; |
180 | return tituloEmail; |
| 169 | }
|
181 | }
|
| Line 222... | Line 234... | ||
| 222 | }
|
234 | }
|
| 223 | 235 | ||
| 224 | public void uploadArquivoEspacoCase() { |
236 | public void uploadArquivoEspacoCase() { |
| 225 | new VerificadorLancamentoException().tratarIhRelancarExcecaoSemLimparEntidade(new CommandBean() { |
237 | new VerificadorLancamentoException().tratarIhRelancarExcecaoSemLimparEntidade(new CommandBean() { |
| 226 | public void execute() { |
238 | public void execute() { |
| 227 | setFolhaPagamentoDTO(folhaPagamentoService.importarFolhaPagamento(getArquivoParaImportacao().getContent(), getFolhaPagamentoDTO())); |
- | |
| - | 239 | setArquivosImportados(folhaPagamentoService.uploadArquivo(getArquivoParaImportacao().getContent())); |
|
| - | 240 | setFolhaPagamentoDTO(folhaPagamentoService.importarFolhaPagamento(getArquivosImportados(), getFolhaPagamentoDTO())); |
|
| 228 | setTituloEmail(getTituloEmail() + " " + getFolhaPagamentoDTO().getAvaliacaoDTO().getVigenciaDTO().getDescricao()); |
241 | setTituloEmail(getTituloEmail() + " " + getFolhaPagamentoDTO().getAvaliacaoDTO().getVigenciaDTO().getDescricao()); |
| 229 | LancadorMensagem.lancarSucesso("ARQUIVO IMPORTADO COM SUCESSO!"); |
242 | LancadorMensagem.lancarSucesso("ARQUIVO IMPORTADO COM SUCESSO!"); |
| 230 | }
|
243 | }
|
| 231 | }); |
244 | }); |
| 232 | }
|
245 | }
|
| - | 246 | ||
| - | 247 | public void uploadArquivoEspacoCase(final FileUploadEvent e) { |
|
| - | 248 | new VerificadorLancamentoException().tratarIhRelancarExcecaoSemLimparEntidade(new CommandBean() { |
|
| - | 249 | public void execute() { |
|
| - | 250 | setArquivosImportados(folhaPagamentoService.uploadArquivo(e.getFile().getContent())); |
|
| - | 251 | setFolhaPagamentoDTO(folhaPagamentoService.importarFolhaPagamento(getArquivosImportados(), getFolhaPagamentoDTO())); |
|
| - | 252 | }
|
|
| - | 253 | }); |
|
| - | 254 | }
|
|
| 233 | 255 | ||
| 234 | public void selecionarTodosParaEnviarEmail() { |
256 | public void selecionarTodosParaEnviarEmail() { |
| 235 | new VerificadorLancamentoException().tratarIhRelancarExcecaoSemLimparEntidade(new CommandBean() { |
257 | new VerificadorLancamentoException().tratarIhRelancarExcecaoSemLimparEntidade(new CommandBean() { |
| 236 | public void execute() { |
258 | public void execute() { |
| 237 | for (FolhaPagamentoFuncionarioDTO folhaPagamentoFuncionario : getFolhaPagamentoDTO().getFuncionarios()) { |
259 | for (FolhaPagamentoFuncionarioDTO folhaPagamentoFuncionario : getFolhaPagamentoDTO().getFuncionarios()) { |
| Line 242... | Line 264... | ||
| 242 | }
|
264 | }
|
| 243 | }
|
265 | }
|
| 244 | }
|
266 | }
|
| 245 | }); |
267 | }); |
| 246 | }
|
268 | }
|
| 247 | - | ||
| 248 | public void uploadArquivoEspacoCase(final FileUploadEvent e) { |
- | |
| 249 | new VerificadorLancamentoException().tratarIhRelancarExcecaoSemLimparEntidade(new CommandBean() { |
- | |
| 250 | public void execute() { |
- | |
| 251 | setFolhaPagamentoDTO(folhaPagamentoService.importarFolhaPagamento(e.getFile().getContent(), getFolhaPagamentoDTO())); |
- | |
| 252 | }
|
- | |
| 253 | }); |
- | |
| 254 | }
|
- | |
| 255 | 269 | ||
| 256 | public void atualizarValoresImportados() { |
270 | public void atualizarValoresImportados() { |
| 257 | new VerificadorLancamentoException().tratarIhRelancarExcecaoSemLimparEntidade(new CommandBean() { |
271 | new VerificadorLancamentoException().tratarIhRelancarExcecaoSemLimparEntidade(new CommandBean() { |
| 258 | public void execute() { |
272 | public void execute() { |
| 259 | for (FolhaPagamentoFuncionarioDTO folhaPagamentoFuncionario : getFolhaPagamentoDTO().getFuncionarios()) { |
273 | for (FolhaPagamentoFuncionarioDTO folhaPagamentoFuncionario : getFolhaPagamentoDTO().getFuncionarios()) { |
| Line 279... | Line 293... | ||
| 279 | folhaPagamentoService.atualizarCentroDeCustos(sequencialConta, folhaPagamentoFuncionario.getAvaliacaoFuncionarioDTO().getSequencialDaLoja()); |
293 | folhaPagamentoService.atualizarCentroDeCustos(sequencialConta, folhaPagamentoFuncionario.getAvaliacaoFuncionarioDTO().getSequencialDaLoja()); |
| 280 | }
|
294 | }
|
| 281 | }
|
295 | }
|
| 282 | }
|
296 | }
|
| 283 | detalharFolhaPagamento(); |
297 | detalharFolhaPagamento(); |
| 284 | setArquivoParaImportacao(null); |
- | |
| 285 | LancadorMensagem.lancarSucesso("CENTROS DE CUSTOS ATUALIZADOS COM SUCESSO"); |
298 | LancadorMensagem.lancarSucesso("CENTROS DE CUSTOS ATUALIZADOS COM SUCESSO"); |
| 286 | }
|
299 | }
|
| 287 | }); |
300 | }); |
| 288 | }
|
301 | }
|
| 289 | 302 | ||
| Line 295... | Line 308... | ||
| 295 | parcelaService.efetuarPagamentoRecebimento(folhaPagamentoFuncionario.getParcelas().get(0), getDataPagamento()); |
308 | parcelaService.efetuarPagamentoRecebimento(folhaPagamentoFuncionario.getParcelas().get(0), getDataPagamento()); |
| 296 | vigenciaService.alterarSituacaoFolha(getVigenciaSelecionada().getSequencial(), TipoSituacoesVigencia.EM_ANDAMENTO_A.getValor()); |
309 | vigenciaService.alterarSituacaoFolha(getVigenciaSelecionada().getSequencial(), TipoSituacoesVigencia.EM_ANDAMENTO_A.getValor()); |
| 297 | }
|
310 | }
|
| 298 | }
|
311 | }
|
| 299 | detalharFolhaPagamento(); |
312 | detalharFolhaPagamento(); |
| 300 | setArquivoParaImportacao(null); |
- | |
| 301 | LancadorMensagem.lancarSucesso("PAGAMENTOS EFETUADOS COM SUCESSO"); |
313 | LancadorMensagem.lancarSucesso("PAGAMENTOS EFETUADOS COM SUCESSO"); |
| 302 | }
|
314 | }
|
| 303 | }); |
315 | }); |
| 304 | }
|
316 | }
|
| 305 | 317 | ||
| Line 321... | Line 333... | ||
| 321 | return folhaPagamentoService.downloadRecibos(getFolhaPagamentoDTO()); |
333 | return folhaPagamentoService.downloadRecibos(getFolhaPagamentoDTO()); |
| 322 | }
|
334 | }
|
| 323 | }); |
335 | }); |
| 324 | }
|
336 | }
|
| 325 | 337 | ||
| 326 | public void enviarRecibos() throws Exception { |
- | |
| - | 338 | public void enviarRecibosSeparadamente() throws Exception { |
|
| 327 | new VerificadorLancamentoException().tratarIhRelancarExcecaoSemLimparEntidade(new CommandBean() { |
339 | new VerificadorLancamentoException().tratarIhRelancarExcecaoSemLimparEntidade(new CommandBean() { |
| 328 | public void execute() { |
340 | public void execute() { |
| 329 | folhaPagamentoService.enviarRecibosPorEmail(getFolhaPagamentoDTO(), getTituloEmail()); |
341 | folhaPagamentoService.enviarRecibosPorEmail(getFolhaPagamentoDTO(), getTituloEmail()); |
| 330 | LancadorMensagem.lancarSucesso("RECIBOS ENVIADOS COM SUCESSO!"); |
342 | LancadorMensagem.lancarSucesso("RECIBOS ENVIADOS COM SUCESSO!"); |
| 331 | }
|
343 | }
|