Rev 195 | Rev 288 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 195 | Rev 286 | ||
|---|---|---|---|
| Line 15... | Line 15... | ||
| 15 | import br.com.ec.domain.model.Conta; |
15 | import br.com.ec.domain.model.Conta; |
| 16 | import br.com.ec.domain.model.ContaBancaria; |
16 | import br.com.ec.domain.model.ContaBancaria; |
| 17 | import br.com.ec.domain.model.Pagamento; |
17 | import br.com.ec.domain.model.Pagamento; |
| 18 | import br.com.ec.domain.model.Parcela; |
18 | import br.com.ec.domain.model.Parcela; |
| 19 | import br.com.ec.domain.model.Pessoa; |
19 | import br.com.ec.domain.model.Pessoa; |
| - | 20 | import br.com.ec.domain.model.TransferenciaContaBancaria; |
|
| 20 | import br.com.ec.domain.model.tipos.TipoConta; |
21 | import br.com.ec.domain.model.tipos.TipoConta; |
| 21 | import br.com.ec.domain.service.conta.ContaService; |
22 | import br.com.ec.domain.service.conta.ContaService; |
| 22 | import br.com.ec.domain.service.pagamento.PagamentoService; |
23 | import br.com.ec.domain.service.pagamento.PagamentoService; |
| 23 | import br.com.ec.domain.service.parcela.ParcelaService; |
24 | import br.com.ec.domain.service.parcela.ParcelaService; |
| 24 | import br.com.ec.web.exception.VerificadorLancamentoException; |
25 | import br.com.ec.web.exception.VerificadorLancamentoException; |
| 25 | import br.com.ec.web.exception.VerificadorLancamentoException.CommandBean; |
26 | import br.com.ec.web.exception.VerificadorLancamentoException.CommandBean; |
| 26 | import br.com.ec.web.generic.AbstractBean; |
27 | import br.com.ec.web.generic.AbstractBean; |
| 27 | import br.com.ec.web.message.LancadorMensagem; |
28 | import br.com.ec.web.message.LancadorMensagem; |
| - | 29 | import br.com.ec.web.util.DataUtil; |
|
| 28 | 30 | ||
| 29 | @Named |
31 | @Named |
| 30 | @Scope("view") |
32 | @Scope("view") |
| 31 | public class ParcelaBean extends AbstractBean<Parcela> implements Serializable { |
33 | public class ParcelaBean extends AbstractBean<Parcela> implements Serializable { |
| 32 | 34 | ||
| 33 | private static final long serialVersionUID = 1L; |
35 | private static final long serialVersionUID = 1L; |
| - | 36 | ||
| - | 37 | private TransferenciaContaBancaria transferenciaContaBancaria; |
|
| 34 | 38 | ||
| 35 | private ParcelaService parcelaService; |
39 | private ParcelaService parcelaService; |
| 36 | private ContaService contaService; |
40 | private ContaService contaService; |
| 37 | private PagamentoService pagamentoService; |
41 | private PagamentoService pagamentoService; |
| 38 | 42 | ||
| Line 71... | Line 75... | ||
| 71 | }
|
75 | }
|
| 72 | 76 | ||
| 73 | public void onRowSelect(SelectEvent event) { |
77 | public void onRowSelect(SelectEvent event) { |
| 74 | setEntidade(parcelaService.consultarPorId((Parcela) event.getObject())); |
78 | setEntidade(parcelaService.consultarPorId((Parcela) event.getObject())); |
| 75 | }
|
79 | }
|
| - | 80 | ||
| - | 81 | public TransferenciaContaBancaria getTransferenciaContaBancaria() { |
|
| - | 82 | return transferenciaContaBancaria; |
|
| - | 83 | }
|
|
| - | 84 | public void setTransferenciaContaBancaria(TransferenciaContaBancaria transferenciaContaBancaria) { |
|
| - | 85 | this.transferenciaContaBancaria = transferenciaContaBancaria; |
|
| - | 86 | }
|
|
| 76 | 87 | ||
| 77 | /***************************************************************/
|
88 | /***************************************************************/
|
| 78 | 89 | ||
| 79 | public void iniciarParcelaAReceber(ContaBancaria contaBancaria) { |
90 | public void iniciarParcelaAReceber(ContaBancaria contaBancaria) { |
| 80 | entidade = new Parcela(); |
91 | entidade = new Parcela(); |
| Line 200... | Line 211... | ||
| 200 | pagamentoService.alterar(pagamento); |
211 | pagamentoService.alterar(pagamento); |
| 201 | LancadorMensagem.lancarSucesso("Conta lançada e pagamento finalizado com sucesso!"); |
212 | LancadorMensagem.lancarSucesso("Conta lançada e pagamento finalizado com sucesso!"); |
| 202 | }
|
213 | }
|
| 203 | }); |
214 | }); |
| 204 | }
|
215 | }
|
| - | 216 | ||
| - | 217 | public void iniciarTransferenciaContaBancaria(final ContaBancaria contaBancaria) { |
|
| - | 218 | new VerificadorLancamentoException().tratarIhRelancarExcecaoSemLimparEntidade(new CommandBean() { |
|
| - | 219 | public void execute() { |
|
| - | 220 | TransferenciaContaBancaria transferenciaContaBancaria = new TransferenciaContaBancaria(); |
|
| - | 221 | transferenciaContaBancaria.setContaBancariaSaida(contaBancaria); |
|
| - | 222 | transferenciaContaBancaria.setDataOperacao(DataUtils.getDataAtual()); |
|
| - | 223 | setTransferenciaContaBancaria(transferenciaContaBancaria); |
|
| - | 224 | }
|
|
| - | 225 | }); |
|
| - | 226 | }
|
|
| - | 227 | ||
| - | 228 | public void transferirContaBancaria() { |
|
| - | 229 | new VerificadorLancamentoException().tratarIhRelancarExcecaoSemLimparEntidade(new CommandBean() { |
|
| - | 230 | public void execute() { |
|
| - | 231 | // parcelaService.lancarParcela(getEntidade());
|
|
| - | 232 | ||
| - | 233 | LancadorMensagem.lancarSucesso("TRANSFERÊNCIA REALIZADA COM SUCESSO!"); |
|
| - | 234 | }
|
|
| - | 235 | }); |
|
| - | 236 | }
|
|
| 205 | 237 | ||
| 206 | }
|
238 | }
|