Rev 507 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 507 | Rev 520 | ||
|---|---|---|---|
| Line 17... | Line 17... | ||
| 17 | 17 | ||
| 18 | import br.com.ec.core.generic.identidade.Identidade; |
18 | import br.com.ec.core.generic.identidade.Identidade; |
| 19 | import br.com.ec.core.interfaces.Alterar; |
19 | import br.com.ec.core.interfaces.Alterar; |
| 20 | import br.com.ec.core.interfaces.Cadastrar; |
20 | import br.com.ec.core.interfaces.Cadastrar; |
| 21 | import br.com.ec.core.util.VerificadorUtil; |
21 | import br.com.ec.core.util.VerificadorUtil; |
| - | 22 | import br.com.ec.domain.dto.TransferenciaProdutoDTO; |
|
| 22 | 23 | ||
| 23 | @Entity |
24 | @Entity |
| 24 | @Table(name="sec_transferencia_produto", schema="sc_sec") |
25 | @Table(name="sec_transferencia_produto", schema="sc_sec") |
| 25 | public class TransferenciaProduto implements Serializable, Identidade { |
26 | public class TransferenciaProduto implements Serializable, Identidade { |
| 26 | 27 | ||
| Line 46... | Line 47... | ||
| 46 | this.transferenciaProdutoId = transferenciaProdutoId; |
47 | this.transferenciaProdutoId = transferenciaProdutoId; |
| 47 | }
|
48 | }
|
| 48 | 49 | ||
| 49 | public TransferenciaProduto(Produto produto, Loja loja) { |
50 | public TransferenciaProduto(Produto produto, Loja loja) { |
| 50 | this.indicadorAlterarEstoque = true; |
51 | this.indicadorAlterarEstoque = true; |
| 51 | transferenciaProdutoId = new TransferenciaProdutoId(); |
- | |
| - | 52 | this.transferenciaProdutoId = new TransferenciaProdutoId(); |
|
| 52 | setTransferencia(transferencia); |
53 | setTransferencia(transferencia); |
| 53 | setProduto(produto); |
54 | setProduto(produto); |
| 54 | }
|
55 | }
|
| 55 | 56 | ||
| 56 | public TransferenciaProduto(Long sequencialProduto, Long sequencialTransferencia) { |
57 | public TransferenciaProduto(Long sequencialProduto, Long sequencialTransferencia) { |
| 57 | this.indicadorAlterarEstoque = true; |
58 | this.indicadorAlterarEstoque = true; |
| 58 | transferenciaProdutoId = new TransferenciaProdutoId(); |
- | |
| 59 | transferenciaProdutoId.setSequencialProduto(sequencialProduto); |
- | |
| 60 | transferenciaProdutoId.setSequencialTransferencia(sequencialTransferencia); |
- | |
| - | 59 | this.transferenciaProdutoId = new TransferenciaProdutoId(); |
|
| - | 60 | this.transferenciaProdutoId.setSequencialProduto(sequencialProduto); |
|
| - | 61 | this.transferenciaProdutoId.setSequencialTransferencia(sequencialTransferencia); |
|
| - | 62 | }
|
|
| - | 63 | ||
| - | 64 | public TransferenciaProduto(TransferenciaProdutoDTO transferenciaProdutoDTO) { |
|
| - | 65 | this.transferenciaProdutoId = new TransferenciaProdutoId(); |
|
| - | 66 | this.transferenciaProdutoId.setSequencialProduto(transferenciaProdutoDTO.getSequencialDoProduto()); |
|
| - | 67 | this.transferenciaProdutoId.setSequencialTransferencia(transferenciaProdutoDTO.getSequencialDaTransferencia()); |
|
| - | 68 | this.transferencia = new Transferencia(transferenciaProdutoDTO.getTransferenciaDTO()); |
|
| - | 69 | this.produto = new Produto(transferenciaProdutoDTO.getSequencialDoProduto()); |
|
| - | 70 | this.quantidadeTransferir = transferenciaProdutoDTO.getQuantidadeTransferir(); |
|
| - | 71 | this.indicadorRecebido = transferenciaProdutoDTO.getIndicadorRecebido(); |
|
| - | 72 | this.indicadorAlterarEstoque = transferenciaProdutoDTO.getIndicadorAlterarEstoque(); |
|
| - | 73 | if (VerificadorUtil.naoEstaNulo(transferenciaProdutoDTO.getUsuarioSaidaDTO())) { |
|
| - | 74 | this.usuarioSaida = new Usuario(transferenciaProdutoDTO.getUsuarioSaidaDTO()); |
|
| - | 75 | }
|
|
| - | 76 | if (VerificadorUtil.naoEstaNulo(transferenciaProdutoDTO.getUsuarioEntradaDTO())) { |
|
| - | 77 | this.usuarioEntrada = new Usuario(transferenciaProdutoDTO.getUsuarioEntradaDTO()); |
|
| - | 78 | }
|
|
| 61 | }
|
79 | }
|
| 62 | 80 | ||
| 63 | @Override |
81 | @Override |
| 64 | @Transient |
82 | @Transient |
| 65 | public Object getId() { |
83 | public Object getId() { |