Commit 8cca72681efe39b3601eef9cf5e7638350f88d50
1 parent
ca4ef3f8
Exists in
master
and in
1 other branch
Refatora serviço de consulta a processo
- Cria parâmetro que desabilita consulta ao SIPAR - Consulta ao SIPAR deixa de ser realizada caso processo exista no SEI - Move algumas classes para novos pacotes
Showing
14 changed files
with
428 additions
and
383 deletions
Show diff stats
src/main/java/br/gov/ans/integracao/sei/dao/SiparDAO.java
| ... | ... | @@ -1,80 +0,0 @@ |
| 1 | -package br.gov.ans.integracao.sei.dao; | |
| 2 | - | |
| 3 | -import java.math.BigDecimal; | |
| 4 | -import java.util.HashMap; | |
| 5 | -import java.util.List; | |
| 6 | -import java.util.Map; | |
| 7 | - | |
| 8 | -import javax.ejb.Stateful; | |
| 9 | -import javax.inject.Inject; | |
| 10 | -import javax.persistence.EntityManager; | |
| 11 | -import javax.persistence.PersistenceContext; | |
| 12 | -import javax.persistence.PersistenceContextType; | |
| 13 | -import javax.persistence.Query; | |
| 14 | - | |
| 15 | -import br.gov.ans.dao.DAO; | |
| 16 | -import br.gov.ans.integracao.sipar.dao.ControleMigracao; | |
| 17 | -import br.gov.ans.integracao.sipar.dao.ControleMigracaoId; | |
| 18 | -import br.gov.ans.integracao.sipar.dao.DocumentoSipar; | |
| 19 | - | |
| 20 | -@Stateful | |
| 21 | -public class SiparDAO { | |
| 22 | - | |
| 23 | - @PersistenceContext(unitName = "sei_broker_pu", type = PersistenceContextType.EXTENDED) | |
| 24 | - private EntityManager em; | |
| 25 | - | |
| 26 | - @SuppressWarnings("cdi-ambiguous-dependency") | |
| 27 | - @Inject | |
| 28 | - private DAO<DocumentoSipar> daoDocumento; | |
| 29 | - | |
| 30 | - @Inject | |
| 31 | - private DAO<ControleMigracao> daoMigracao; | |
| 32 | - | |
| 33 | - public DocumentoSipar getDocumento(String numeroDocumento, String anoDocumento, String digitoDocumento){ | |
| 34 | - | |
| 35 | - Map<String, Object> params = new HashMap<String, Object>(); | |
| 36 | - params.put("numeroDocumento", numeroDocumento); | |
| 37 | - params.put("anoDocumento", anoDocumento); | |
| 38 | - params.put("digitoDocumento", digitoDocumento); | |
| 39 | - | |
| 40 | - List<DocumentoSipar> resultado = daoDocumento.executeNamedQuery("documentoPorNumeroAnoDigito", params); | |
| 41 | - | |
| 42 | - if(resultado.isEmpty()){ | |
| 43 | - return null; | |
| 44 | - } | |
| 45 | - | |
| 46 | - return resultado.get(0); | |
| 47 | - } | |
| 48 | - | |
| 49 | - public ControleMigracao buscaProcessoImportado(ControleMigracaoId id){ | |
| 50 | - return daoMigracao.findById(id); | |
| 51 | - } | |
| 52 | - | |
| 53 | - public boolean isProcessoEmTramitacao(String numero, String ano){ | |
| 54 | - | |
| 55 | - String sql = "SELECT count(*) FROM DBPSIPAR.TB_TRAMITACAO TR " | |
| 56 | - + "WHERE " | |
| 57 | - + "TR.DT_RECEBIMENTO IS NULL " | |
| 58 | - + "AND TR.CO_DOCUMENTO = :numero " | |
| 59 | - + "AND TR.NU_ANO_DOCUMENTO = :ano " | |
| 60 | - + "AND TR.DT_ENVIO = (" | |
| 61 | - + " SELECT MAX(TR2.DT_ENVIO) FROM DBPSIPAR.TB_TRAMITACAO TR2 WHERE TR2.CO_DOCUMENTO = :numero AND TR2.NU_ANO_DOCUMENTO = :ano" | |
| 62 | - + ")"; | |
| 63 | - | |
| 64 | - Query query = em.createNativeQuery(sql); | |
| 65 | - query.setParameter("numero", numero); | |
| 66 | - query.setParameter("ano", ano); | |
| 67 | - | |
| 68 | - Long count = ((BigDecimal) query.getSingleResult()).longValue(); | |
| 69 | - | |
| 70 | - if(count > 0L){ | |
| 71 | - return true; | |
| 72 | - } | |
| 73 | - return false; | |
| 74 | - } | |
| 75 | - | |
| 76 | - public void merge(ControleMigracao controleMigracao){ | |
| 77 | - daoMigracao.merge(controleMigracao); | |
| 78 | - } | |
| 79 | - | |
| 80 | -} |
src/main/java/br/gov/ans/integracao/sei/modelo/ResultadoConsultaDocumento.java
| ... | ... | @@ -6,7 +6,7 @@ import org.codehaus.jackson.annotate.JsonIgnoreProperties; |
| 6 | 6 | import org.codehaus.jackson.map.annotate.JsonSerialize; |
| 7 | 7 | |
| 8 | 8 | import br.gov.ans.integracao.sei.client.RetornoConsultaDocumento; |
| 9 | -import br.gov.ans.integracao.sipar.dao.DocumentoSipar; | |
| 9 | +import br.gov.ans.integracao.sipar.modelo.DocumentoSipar; | |
| 10 | 10 | |
| 11 | 11 | @JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL) |
| 12 | 12 | @JsonIgnoreProperties(ignoreUnknown = true) | ... | ... |
src/main/java/br/gov/ans/integracao/sei/modelo/ResultadoConsultaProcesso.java
| ... | ... | @@ -6,7 +6,7 @@ import org.codehaus.jackson.annotate.JsonIgnoreProperties; |
| 6 | 6 | import org.codehaus.jackson.map.annotate.JsonSerialize; |
| 7 | 7 | |
| 8 | 8 | import br.gov.ans.integracao.sei.client.RetornoConsultaProcedimento; |
| 9 | -import br.gov.ans.integracao.sipar.dao.DocumentoSipar; | |
| 9 | +import br.gov.ans.integracao.sipar.modelo.DocumentoSipar; | |
| 10 | 10 | |
| 11 | 11 | @JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL) |
| 12 | 12 | @JsonIgnoreProperties(ignoreUnknown = true) | ... | ... |
src/main/java/br/gov/ans/integracao/sei/rest/ProcessoResource.java
| ... | ... | @@ -46,7 +46,6 @@ import br.gov.ans.integracao.sei.client.TipoProcedimento; |
| 46 | 46 | import br.gov.ans.integracao.sei.client.Unidade; |
| 47 | 47 | import br.gov.ans.integracao.sei.dao.DocumentoDAO; |
| 48 | 48 | import br.gov.ans.integracao.sei.dao.ProcessoDAO; |
| 49 | -import br.gov.ans.integracao.sei.dao.SiparDAO; | |
| 50 | 49 | import br.gov.ans.integracao.sei.dao.UnidadeDAO; |
| 51 | 50 | import br.gov.ans.integracao.sei.exceptions.BusinessException; |
| 52 | 51 | import br.gov.ans.integracao.sei.exceptions.ResourceNotFoundException; |
| ... | ... | @@ -63,15 +62,12 @@ import br.gov.ans.integracao.sei.modelo.ProcessoResumido; |
| 63 | 62 | import br.gov.ans.integracao.sei.modelo.ResultadoConsultaProcesso; |
| 64 | 63 | import br.gov.ans.integracao.sei.modelo.SobrestamentoProcesso; |
| 65 | 64 | import br.gov.ans.integracao.sei.utils.Constantes; |
| 66 | -import br.gov.ans.integracao.sipar.dao.DocumentoSipar; | |
| 65 | +import br.gov.ans.integracao.sipar.modelo.DocumentoSipar; | |
| 67 | 66 | import br.gov.ans.utils.MessageUtils; |
| 68 | 67 | |
| 69 | 68 | |
| 70 | 69 | @Path("") |
| 71 | 70 | public class ProcessoResource { |
| 72 | - | |
| 73 | - @Inject | |
| 74 | - private SiparDAO documentoSiparDAO; | |
| 75 | 71 | |
| 76 | 72 | @Inject |
| 77 | 73 | private ProcessoDAO processoDAO; |
| ... | ... | @@ -87,7 +83,10 @@ public class ProcessoResource { |
| 87 | 83 | |
| 88 | 84 | @Inject |
| 89 | 85 | private UnidadeResource unidadeResource; |
| 90 | - | |
| 86 | + | |
| 87 | + @Inject | |
| 88 | + private SiparResource siparResource; | |
| 89 | + | |
| 91 | 90 | @Inject |
| 92 | 91 | private MessageUtils messages; |
| 93 | 92 | |
| ... | ... | @@ -103,61 +102,74 @@ public class ProcessoResource { |
| 103 | 102 | @GET |
| 104 | 103 | @Path("{unidade}/processos/{processo:\\d+}") |
| 105 | 104 | @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) |
| 106 | - public ResultadoConsultaProcesso consultarProcesso(@PathParam("unidade") String unidade, @PathParam("processo") String processo, | |
| 107 | - @QueryParam("assuntos") String exibirAssuntos, @QueryParam("interessados") String exibirInteressados, @QueryParam("observacoes") String exibirObservacoes, | |
| 108 | - @QueryParam("andamento") String exibirAndamento, @QueryParam("andamento-conclusao") String exibirAndamentoConclusao, @QueryParam("ultimo-andamento") String exibirUltimoAndamento, | |
| 109 | - @QueryParam("unidades") String exibirUnidadesAberto, @QueryParam("relacionados") String exibirProcessosRelacionados, @QueryParam("anexados") String exibirProcessosAnexados, | |
| 110 | - @QueryParam("auto-formatacao") String autoFormatar) throws Exception{ | |
| 105 | + public Response ConsultarProcessoV2(@PathParam("unidade") String unidade, @PathParam("processo") String processo, | |
| 106 | + @QueryParam("assuntos") String exibirAssuntos, @QueryParam("interessados") String exibirInteressados, | |
| 107 | + @QueryParam("observacoes") String exibirObservacoes, @QueryParam("andamento") String exibirAndamento, | |
| 108 | + @QueryParam("andamento-conclusao") String exibirAndamentoConclusao, | |
| 109 | + @QueryParam("ultimo-andamento") String exibirUltimoAndamento, | |
| 110 | + @QueryParam("unidades") String exibirUnidadesAberto, | |
| 111 | + @QueryParam("relacionados") String exibirProcessosRelacionados, | |
| 112 | + @QueryParam("anexados") String exibirProcessosAnexados, | |
| 113 | + @QueryParam("auto-formatacao") String autoFormatar) throws RemoteException, Exception { | |
| 114 | + | |
| 115 | + if (Constantes.IS_CONSULTA_SIPAR_HABILITADA) { | |
| 116 | + return Response.ok(consultarProcessoANS(unidade, processo, exibirAssuntos, exibirInteressados, | |
| 117 | + exibirObservacoes, exibirAndamento, exibirAndamentoConclusao, exibirUltimoAndamento, | |
| 118 | + exibirUnidadesAberto, exibirProcessosRelacionados, exibirProcessosAnexados, autoFormatar)).build(); | |
| 119 | + } | |
| 111 | 120 | |
| 112 | - ResultadoConsultaProcesso resultado = null; | |
| 113 | - | |
| 114 | - RetornoConsultaProcedimento processoSEI = consultarProcessoSEI(unidade, processo, exibirAssuntos, exibirInteressados, exibirObservacoes, exibirAndamento, exibirAndamentoConclusao, | |
| 115 | - exibirUltimoAndamento, exibirUnidadesAberto, exibirProcessosRelacionados, exibirProcessosAnexados, autoFormatar); | |
| 116 | - | |
| 117 | - DocumentoSipar processoSIPAR = consultarProcessoSIPAR(processo); | |
| 121 | + return Response.ok(consultarProcessoSEI(unidade, processo, exibirAssuntos, exibirInteressados, | |
| 122 | + exibirObservacoes, exibirAndamento, exibirAndamentoConclusao, exibirUltimoAndamento, | |
| 123 | + exibirUnidadesAberto, exibirProcessosRelacionados, exibirProcessosAnexados)).build(); | |
| 124 | + } | |
| 125 | + | |
| 126 | + public ResultadoConsultaProcesso consultarProcessoANS(String unidade, String processo, String exibirAssuntos, | |
| 127 | + String exibirInteressados, String exibirObservacoes, String exibirAndamento, | |
| 128 | + String exibirAndamentoConclusao, String exibirUltimoAndamento, String exibirUnidadesAberto, | |
| 129 | + String exibirProcessosRelacionados, String exibirProcessosAnexados, String autoFormatar) throws Exception { | |
| 118 | 130 | |
| 119 | - if(processoSEI != null || processoSIPAR != null){ | |
| 120 | - resultado = new ResultadoConsultaProcesso(); | |
| 121 | - resultado.setSei(processoSEI); | |
| 122 | - resultado.setSipar(processoSIPAR); | |
| 123 | - }else{ | |
| 131 | + ResultadoConsultaProcesso resultado = new ResultadoConsultaProcesso(); | |
| 132 | + | |
| 133 | + try{ | |
| 134 | + resultado.setSei(consultarProcessoSEI(unidade, | |
| 135 | + isAutoFormatar(autoFormatar) ? formatarNumeroProcesso(processo) : processo, exibirAssuntos, | |
| 136 | + exibirInteressados, exibirObservacoes, exibirAndamento, exibirAndamentoConclusao, | |
| 137 | + exibirUltimoAndamento, exibirUnidadesAberto, exibirProcessosRelacionados, exibirProcessosAnexados)); | |
| 138 | + | |
| 139 | + return resultado; | |
| 140 | + }catch (AxisFault ex) { | |
| 141 | + logger.error(ex); | |
| 142 | + logger.debug(ex, ex); | |
| 143 | + } | |
| 144 | + | |
| 145 | + resultado.setSipar(consultarProcessoSIPAR(processo)); | |
| 146 | + | |
| 147 | + if(resultado.getSei() == null && resultado.getSipar() == null){ | |
| 124 | 148 | throw new ResourceNotFoundException(messages.getMessage("erro.processo.nao.encontrado", processo)); |
| 125 | 149 | } |
| 126 | 150 | |
| 127 | 151 | return resultado; |
| 128 | 152 | } |
| 129 | - | |
| 153 | + | |
| 130 | 154 | public RetornoConsultaProcedimento consultarProcessoSEI(String unidade, String processo, String exibirAssuntos, String exibirInteressados, |
| 131 | 155 | String exibirObservacoes, String exibirAndamento, String exibirAndamentoConclusao, String exibirUltimoAndamento, String exibirUnidadesAberto, |
| 132 | - String exibirProcessosRelacionados, String exibirProcessosAnexados, String autoFormatar) throws RemoteException, Exception{ | |
| 133 | - if(isAutoFormatar(autoFormatar)){ | |
| 134 | - processo = formatarNumeroProcesso(processo); | |
| 135 | - } | |
| 136 | - | |
| 137 | - try{ | |
| 138 | - return seiNativeService.consultarProcedimento(Constantes.SIGLA_SEI_BROKER, Constantes.CHAVE_IDENTIFICACAO, unidadeResource.consultarCodigo(unidade), processo, getSOuN(exibirAssuntos), | |
| 139 | - getSOuN(exibirInteressados), getSOuN(exibirObservacoes), getSOuN(exibirAndamento), getSOuN(exibirAndamentoConclusao), getSOuN(exibirUltimoAndamento), getSOuN(exibirUnidadesAberto), | |
| 140 | - getSOuN(exibirProcessosRelacionados), getSOuN(exibirProcessosAnexados)); | |
| 141 | - }catch(AxisFault ex){ | |
| 142 | - logger.error(ex); | |
| 143 | - logger.debug(ex, ex); | |
| 144 | - return null; | |
| 145 | - } | |
| 156 | + String exibirProcessosRelacionados, String exibirProcessosAnexados) throws RemoteException, Exception{ | |
| 157 | + | |
| 158 | + return seiNativeService.consultarProcedimento(Constantes.SIGLA_SEI_BROKER, Constantes.CHAVE_IDENTIFICACAO, unidadeResource.consultarCodigo(unidade), processo, getSOuN(exibirAssuntos), | |
| 159 | + getSOuN(exibirInteressados), getSOuN(exibirObservacoes), getSOuN(exibirAndamento), getSOuN(exibirAndamentoConclusao), getSOuN(exibirUltimoAndamento), getSOuN(exibirUnidadesAberto), | |
| 160 | + getSOuN(exibirProcessosRelacionados), getSOuN(exibirProcessosAnexados)); | |
| 146 | 161 | } |
| 147 | - | |
| 162 | + | |
| 148 | 163 | public DocumentoSipar consultarProcessoSIPAR(String processo){ |
| 149 | - String documento, ano, digito; | |
| 150 | - | |
| 151 | - try{ | |
| 152 | - documento = processo.substring(0,(processo.length() - 6)); | |
| 153 | - ano = processo.substring((processo.length() - 6), (processo.length() - 2)); | |
| 154 | - digito = processo.substring((processo.length() - 2), processo.length()); | |
| 155 | - }catch(Exception e){ | |
| 156 | - logger.error(messages.getMessage("erro.numero.sipar")); | |
| 157 | - return null; | |
| 164 | + DocumentoSipar documentoSipar = null; | |
| 165 | + | |
| 166 | + try { | |
| 167 | + documentoSipar = siparResource.consultarProcesso(processo); | |
| 168 | + } catch (BusinessException ex) { | |
| 169 | + logger.error(ex); | |
| 158 | 170 | } |
| 159 | 171 | |
| 160 | - return documentoSiparDAO.getDocumento(documento, ano, digito); | |
| 172 | + return documentoSipar; | |
| 161 | 173 | } |
| 162 | 174 | |
| 163 | 175 | @POST | ... | ... |
src/main/java/br/gov/ans/integracao/sei/rest/SiparResource.java
| ... | ... | @@ -6,9 +6,11 @@ import java.util.Date; |
| 6 | 6 | import javax.inject.Inject; |
| 7 | 7 | import javax.ws.rs.Consumes; |
| 8 | 8 | import javax.ws.rs.DELETE; |
| 9 | +import javax.ws.rs.GET; | |
| 9 | 10 | import javax.ws.rs.POST; |
| 10 | 11 | import javax.ws.rs.Path; |
| 11 | 12 | import javax.ws.rs.PathParam; |
| 13 | +import javax.ws.rs.Produces; | |
| 12 | 14 | import javax.ws.rs.core.Context; |
| 13 | 15 | import javax.ws.rs.core.MediaType; |
| 14 | 16 | import javax.ws.rs.core.Response; |
| ... | ... | @@ -17,12 +19,13 @@ import javax.ws.rs.core.UriInfo; |
| 17 | 19 | |
| 18 | 20 | import org.jboss.logging.Logger; |
| 19 | 21 | |
| 20 | -import br.gov.ans.integracao.sei.dao.SiparDAO; | |
| 21 | 22 | import br.gov.ans.integracao.sei.exceptions.BusinessException; |
| 22 | 23 | import br.gov.ans.integracao.sei.exceptions.ResourceConflictException; |
| 23 | 24 | import br.gov.ans.integracao.sei.exceptions.ResourceNotFoundException; |
| 24 | -import br.gov.ans.integracao.sipar.dao.ControleMigracao; | |
| 25 | -import br.gov.ans.integracao.sipar.dao.ControleMigracaoId; | |
| 25 | +import br.gov.ans.integracao.sipar.dao.SiparDAO; | |
| 26 | +import br.gov.ans.integracao.sipar.modelo.ControleMigracao; | |
| 27 | +import br.gov.ans.integracao.sipar.modelo.ControleMigracaoId; | |
| 28 | +import br.gov.ans.integracao.sipar.modelo.DocumentoSipar; | |
| 26 | 29 | import br.gov.ans.utils.MessageUtils; |
| 27 | 30 | |
| 28 | 31 | @Path("/sipar") |
| ... | ... | @@ -100,6 +103,35 @@ public class SiparResource { |
| 100 | 103 | |
| 101 | 104 | } |
| 102 | 105 | |
| 106 | + @GET | |
| 107 | + @Path("{processo:\\d+}") | |
| 108 | + @Produces(MediaType.APPLICATION_JSON) | |
| 109 | + public DocumentoSipar consultarProcessoSIPAR(@PathParam("processo") String processo) throws BusinessException, ResourceNotFoundException{ | |
| 110 | + DocumentoSipar documento = consultarProcesso(processo); | |
| 111 | + | |
| 112 | + if(documento == null){ | |
| 113 | + throw new ResourceNotFoundException(messages.getMessage("erro.processo.nao.encontrado", processo)); | |
| 114 | + } | |
| 115 | + | |
| 116 | + return documento; | |
| 117 | + } | |
| 118 | + | |
| 119 | + public DocumentoSipar consultarProcesso(String processo) throws BusinessException{ | |
| 120 | + String numero, ano, digito; | |
| 121 | + | |
| 122 | + try{ | |
| 123 | + numero = extraiNumero(processo); | |
| 124 | + ano = extraiAno(processo); | |
| 125 | + digito = extraiDigitoVerificador(processo); | |
| 126 | + }catch(Exception ex){ | |
| 127 | + logger.error(ex); | |
| 128 | + | |
| 129 | + throw new BusinessException(messages.getMessage("erro.numero.sipar",processo)); | |
| 130 | + } | |
| 131 | + | |
| 132 | + return dao.getDocumento(numero, ano, digito); | |
| 133 | + } | |
| 134 | + | |
| 103 | 135 | private void importarProcesso(String numeroDocumento, String anoDocumento){ |
| 104 | 136 | ControleMigracao controle = new ControleMigracao(); |
| 105 | 137 | controle.setId(getControleMigracaoID(numeroDocumento, anoDocumento)); | ... | ... |
src/main/java/br/gov/ans/integracao/sei/utils/Constantes.java
| ... | ... | @@ -15,10 +15,11 @@ public class Constantes { |
| 15 | 15 | public static final String CHAVE_IDENTIFICACAO = "REALIZAR_INTEGRACAO"; |
| 16 | 16 | public static final String CODIGO_BRASIL = "76"; |
| 17 | 17 | public static final String CODIGO_ORGAO_ANS = "0"; |
| 18 | - public static final String CONTENT_TYPE_HEADER_KEY= "Content-Type"; | |
| 18 | + public static final String CONTENT_TYPE_HEADER_KEY= "Content-Type"; | |
| 19 | 19 | public static final String DATE_PATTERN = "dd/MM/yyyy"; |
| 20 | 20 | public static final String DOCUMENTO_GERAL = "G"; |
| 21 | 21 | public static final String DOCUMENTO_RECEBIDO = "R"; |
| 22 | + public static final boolean IS_CONSULTA_SIPAR_HABILITADA = true; | |
| 22 | 23 | public static final String JBOSS_HOME = System.getProperty("jboss.home.dir"); |
| 23 | 24 | public static final String MASCARA_PROCESSO_17 = "#####.######/####-##"; |
| 24 | 25 | public static final String MASCARA_PROCESSO_21 = "#######.########/####-##"; | ... | ... |
src/main/java/br/gov/ans/integracao/sipar/dao/ControleMigracao.java
| ... | ... | @@ -1,56 +0,0 @@ |
| 1 | -package br.gov.ans.integracao.sipar.dao; | |
| 2 | - | |
| 3 | -import java.io.Serializable; | |
| 4 | -import java.util.Date; | |
| 5 | - | |
| 6 | -import javax.persistence.Column; | |
| 7 | -import javax.persistence.EmbeddedId; | |
| 8 | -import javax.persistence.Entity; | |
| 9 | -import javax.persistence.Table; | |
| 10 | -import javax.persistence.Temporal; | |
| 11 | -import javax.persistence.TemporalType; | |
| 12 | - | |
| 13 | -@Entity | |
| 14 | -@Table(schema="DBPSIPAR", name="TB_CONTROLE_MIGRACAO_SIPAR_SEI") | |
| 15 | -public class ControleMigracao implements Serializable { | |
| 16 | - | |
| 17 | - private static final long serialVersionUID = 1L; | |
| 18 | - | |
| 19 | - @EmbeddedId | |
| 20 | - private ControleMigracaoId id; | |
| 21 | - | |
| 22 | - @Temporal(TemporalType.TIMESTAMP) | |
| 23 | - @Column(name = "DT_ULTIMA_ALTERACAO_CONTROLE") | |
| 24 | - private Date dataUltimaAlteracao; | |
| 25 | - | |
| 26 | - @Column(name="LG_DOCUMENTO_MIGRACAO_SEI") | |
| 27 | - private Integer migrado; | |
| 28 | - | |
| 29 | - public ControleMigracaoId getId() { | |
| 30 | - return id; | |
| 31 | - } | |
| 32 | - | |
| 33 | - public void setId(ControleMigracaoId id) { | |
| 34 | - this.id = id; | |
| 35 | - } | |
| 36 | - | |
| 37 | - public Date getDataUltimaAlteracao() { | |
| 38 | - return dataUltimaAlteracao; | |
| 39 | - } | |
| 40 | - | |
| 41 | - public void setDataUltimaAlteracao(Date dataUltimaAlteracao) { | |
| 42 | - this.dataUltimaAlteracao = dataUltimaAlteracao; | |
| 43 | - } | |
| 44 | - | |
| 45 | - public Integer getMigrado() { | |
| 46 | - return migrado; | |
| 47 | - } | |
| 48 | - | |
| 49 | - public void setMigrado(Integer migrado) { | |
| 50 | - this.migrado = migrado; | |
| 51 | - } | |
| 52 | - | |
| 53 | - public boolean isProcessoMigrado() { | |
| 54 | - return this.migrado == 1 ? true : false; | |
| 55 | - } | |
| 56 | -} |
src/main/java/br/gov/ans/integracao/sipar/dao/ControleMigracaoId.java
| ... | ... | @@ -1,61 +0,0 @@ |
| 1 | -package br.gov.ans.integracao.sipar.dao; | |
| 2 | - | |
| 3 | -import java.io.Serializable; | |
| 4 | - | |
| 5 | -import javax.persistence.Column; | |
| 6 | -import javax.persistence.Embeddable; | |
| 7 | - | |
| 8 | -@Embeddable | |
| 9 | -public class ControleMigracaoId implements Serializable { | |
| 10 | - | |
| 11 | - private static final long serialVersionUID = 1L; | |
| 12 | - | |
| 13 | - @Column(name = "CD_SEQ_DOCUMENTO") | |
| 14 | - private String numero; | |
| 15 | - | |
| 16 | - @Column(name = "NR_ANO_DOCUMENTO") | |
| 17 | - private String ano; | |
| 18 | - | |
| 19 | - public ControleMigracaoId() { | |
| 20 | - } | |
| 21 | - | |
| 22 | - public ControleMigracaoId(String numero, String ano) { | |
| 23 | - this.numero = numero; | |
| 24 | - this.ano = ano; | |
| 25 | - } | |
| 26 | - | |
| 27 | - public String getNumero() { | |
| 28 | - return numero; | |
| 29 | - } | |
| 30 | - | |
| 31 | - public void setNumero(String numero) { | |
| 32 | - this.numero = numero; | |
| 33 | - } | |
| 34 | - | |
| 35 | - public String getAno() { | |
| 36 | - return ano; | |
| 37 | - } | |
| 38 | - | |
| 39 | - public void setAno(String ano) { | |
| 40 | - this.ano = ano; | |
| 41 | - } | |
| 42 | - | |
| 43 | - @Override | |
| 44 | - public boolean equals(Object obj) { | |
| 45 | - if (obj instanceof ControleMigracaoId) { | |
| 46 | - ControleMigracaoId controleMigracao = (ControleMigracaoId) obj; | |
| 47 | - return (this.numero != null && this.numero.equals(controleMigracao.getNumero()) && | |
| 48 | - this.ano != null && this.ano.equals(controleMigracao.getAno())); | |
| 49 | - } | |
| 50 | - return false; | |
| 51 | - } | |
| 52 | - | |
| 53 | - @Override | |
| 54 | - public int hashCode() { | |
| 55 | - final int numeroPrimo = 31; | |
| 56 | - int resultado = 1; | |
| 57 | - resultado = (numeroPrimo * resultado) + ((this.numero == null) ? 0 : this.numero.hashCode()); | |
| 58 | - resultado = (numeroPrimo * resultado) + ((this.ano == null) ? 0 : this.ano.hashCode()); | |
| 59 | - return resultado; | |
| 60 | - } | |
| 61 | -} |
src/main/java/br/gov/ans/integracao/sipar/dao/DocumentoSipar.java
| ... | ... | @@ -1,131 +0,0 @@ |
| 1 | -package br.gov.ans.integracao.sipar.dao; | |
| 2 | - | |
| 3 | -import java.io.Serializable; | |
| 4 | -import java.util.Date; | |
| 5 | - | |
| 6 | -import javax.persistence.Entity; | |
| 7 | -import javax.persistence.EntityResult; | |
| 8 | -import javax.persistence.FieldResult; | |
| 9 | -import javax.persistence.Id; | |
| 10 | -import javax.persistence.NamedNativeQuery; | |
| 11 | -import javax.persistence.SqlResultSetMapping; | |
| 12 | - | |
| 13 | -@Entity | |
| 14 | -@SqlResultSetMapping(name="DocumentoSiparMapping", entities={ | |
| 15 | - @EntityResult(entityClass = DocumentoSipar.class, | |
| 16 | - fields = { | |
| 17 | - @FieldResult(name = "digito", column = "NU_DIGITO_DOCUMENTO"), | |
| 18 | - @FieldResult(name = "operadora", column = "CO_OPERADORA"), | |
| 19 | - @FieldResult(name = "emissao", column = "DT_EMISSAO_DOCUMENTO"), | |
| 20 | - @FieldResult(name = "registro", column = "DT_REGISTRO"), | |
| 21 | - @FieldResult(name = "tipo", column = "CO_TIPO_DOCUMENTO"), | |
| 22 | - @FieldResult(name = "resumo", column = "DS_RESUMO_DOCUMENTO"), | |
| 23 | - @FieldResult(name = "orgaoPosse", column = "CO_ORGAO_POSSE"), | |
| 24 | - @FieldResult(name = "orgaoOrigem", column = "CO_ORGAO_ORIGEM"), | |
| 25 | - @FieldResult(name = "orgaoRegistro", column = "CO_ORGAO_REGISTRO"), | |
| 26 | - @FieldResult(name = "assunto", column = "CO_ASSUNTO") | |
| 27 | - }) | |
| 28 | -}) | |
| 29 | -@NamedNativeQuery(name = "documentoPorNumeroAnoDigito", resultSetMapping = "DocumentoSiparMapping", | |
| 30 | -query = "SELECT TB.NU_DIGITO_DOCUMENTO, TB.CO_OPERADORA, TB.DT_EMISSAO_DOCUMENTO, TB.DT_REGISTRO, TB.CO_TIPO_DOCUMENTO, " | |
| 31 | - + "TB.DS_RESUMO_DOCUMENTO, TB.CO_ORGAO_POSSE, TB.CO_ORGAO_ORIGEM, TB.CO_ORGAO_REGISTRO, RL.CO_ASSUNTO " | |
| 32 | - + "FROM DBPSIPAR.TB_DOCUMENTO TB " | |
| 33 | - + "LEFT JOIN DBPSIPAR.RL_ASSUNTO_DOCUMENTO RL ON RL.CO_DOCUMENTO = TB.CO_SEQ_DOCUMENTO " | |
| 34 | - + "AND RL.NU_ANO_DOCUMENTO = TB.NU_ANO_DOCUMENTO " | |
| 35 | - + "WHERE TB.CO_SEQ_DOCUMENTO = :numeroDocumento " | |
| 36 | - + "AND TB.NU_ANO_DOCUMENTO = :anoDocumento " | |
| 37 | - + "AND TB.NU_DIGITO_DOCUMENTO = :digitoDocumento") | |
| 38 | -public class DocumentoSipar implements Serializable{ | |
| 39 | - @Id | |
| 40 | - private String digito; | |
| 41 | - private String operadora; | |
| 42 | - private Date emissao; | |
| 43 | - private Date registro; | |
| 44 | - private String tipo; | |
| 45 | - private String resumo; | |
| 46 | - private Long orgaoPosse; | |
| 47 | - private Long orgaoOrigem; | |
| 48 | - private Long orgaoRegistro; | |
| 49 | - private Long assunto; | |
| 50 | - | |
| 51 | - public String getDigito() { | |
| 52 | - return digito; | |
| 53 | - } | |
| 54 | - | |
| 55 | - public void setDigito(String digito) { | |
| 56 | - this.digito = digito; | |
| 57 | - } | |
| 58 | - | |
| 59 | - public Long getAssunto() { | |
| 60 | - return assunto; | |
| 61 | - } | |
| 62 | - | |
| 63 | - public void setAssunto(Long assunto) { | |
| 64 | - this.assunto = assunto; | |
| 65 | - } | |
| 66 | - | |
| 67 | - public String getOperadora() { | |
| 68 | - return operadora; | |
| 69 | - } | |
| 70 | - | |
| 71 | - public void setOperadora(String operadora) { | |
| 72 | - this.operadora = operadora; | |
| 73 | - } | |
| 74 | - | |
| 75 | - public Date getEmissao() { | |
| 76 | - return emissao; | |
| 77 | - } | |
| 78 | - | |
| 79 | - public void setEmissao(Date emissao) { | |
| 80 | - this.emissao = emissao; | |
| 81 | - } | |
| 82 | - | |
| 83 | - public String getTipo() { | |
| 84 | - return tipo; | |
| 85 | - } | |
| 86 | - | |
| 87 | - public void setTipo(String tipo) { | |
| 88 | - this.tipo = tipo; | |
| 89 | - } | |
| 90 | - | |
| 91 | - public String getResumo() { | |
| 92 | - return resumo; | |
| 93 | - } | |
| 94 | - | |
| 95 | - public void setResumo(String resumo) { | |
| 96 | - this.resumo = resumo; | |
| 97 | - } | |
| 98 | - | |
| 99 | - public Long getOrgaoPosse() { | |
| 100 | - return orgaoPosse; | |
| 101 | - } | |
| 102 | - | |
| 103 | - public void setOrgaoPosse(Long orgaoPosse) { | |
| 104 | - this.orgaoPosse = orgaoPosse; | |
| 105 | - } | |
| 106 | - | |
| 107 | - public Long getOrgaoOrigem() { | |
| 108 | - return orgaoOrigem; | |
| 109 | - } | |
| 110 | - | |
| 111 | - public void setOrgaoOrigem(Long orgaoOrigem) { | |
| 112 | - this.orgaoOrigem = orgaoOrigem; | |
| 113 | - } | |
| 114 | - | |
| 115 | - public Long getOrgaoRegistro() { | |
| 116 | - return orgaoRegistro; | |
| 117 | - } | |
| 118 | - | |
| 119 | - public void setOrgaoRegistro(Long orgaoRegistro) { | |
| 120 | - this.orgaoRegistro = orgaoRegistro; | |
| 121 | - } | |
| 122 | - | |
| 123 | - public Date getRegistro() { | |
| 124 | - return registro; | |
| 125 | - } | |
| 126 | - | |
| 127 | - public void setRegistro(Date registro) { | |
| 128 | - this.registro = registro; | |
| 129 | - } | |
| 130 | - | |
| 131 | -} |
src/main/java/br/gov/ans/integracao/sipar/dao/SiparDAO.java
0 → 100644
| ... | ... | @@ -0,0 +1,80 @@ |
| 1 | +package br.gov.ans.integracao.sipar.dao; | |
| 2 | + | |
| 3 | +import java.math.BigDecimal; | |
| 4 | +import java.util.HashMap; | |
| 5 | +import java.util.List; | |
| 6 | +import java.util.Map; | |
| 7 | + | |
| 8 | +import javax.ejb.Stateful; | |
| 9 | +import javax.inject.Inject; | |
| 10 | +import javax.persistence.EntityManager; | |
| 11 | +import javax.persistence.PersistenceContext; | |
| 12 | +import javax.persistence.PersistenceContextType; | |
| 13 | +import javax.persistence.Query; | |
| 14 | + | |
| 15 | +import br.gov.ans.dao.DAO; | |
| 16 | +import br.gov.ans.integracao.sipar.modelo.ControleMigracao; | |
| 17 | +import br.gov.ans.integracao.sipar.modelo.ControleMigracaoId; | |
| 18 | +import br.gov.ans.integracao.sipar.modelo.DocumentoSipar; | |
| 19 | + | |
| 20 | +@Stateful | |
| 21 | +public class SiparDAO { | |
| 22 | + | |
| 23 | + @PersistenceContext(unitName = "sei_broker_pu", type = PersistenceContextType.EXTENDED) | |
| 24 | + private EntityManager em; | |
| 25 | + | |
| 26 | + @SuppressWarnings("cdi-ambiguous-dependency") | |
| 27 | + @Inject | |
| 28 | + private DAO<DocumentoSipar> daoDocumento; | |
| 29 | + | |
| 30 | + @Inject | |
| 31 | + private DAO<ControleMigracao> daoMigracao; | |
| 32 | + | |
| 33 | + public DocumentoSipar getDocumento(String numeroDocumento, String anoDocumento, String digitoDocumento){ | |
| 34 | + | |
| 35 | + Map<String, Object> params = new HashMap<String, Object>(); | |
| 36 | + params.put("numeroDocumento", numeroDocumento); | |
| 37 | + params.put("anoDocumento", anoDocumento); | |
| 38 | + params.put("digitoDocumento", digitoDocumento); | |
| 39 | + | |
| 40 | + List<DocumentoSipar> resultado = daoDocumento.executeNamedQuery("documentoPorNumeroAnoDigito", params); | |
| 41 | + | |
| 42 | + if(resultado.isEmpty()){ | |
| 43 | + return null; | |
| 44 | + } | |
| 45 | + | |
| 46 | + return resultado.get(0); | |
| 47 | + } | |
| 48 | + | |
| 49 | + public ControleMigracao buscaProcessoImportado(ControleMigracaoId id){ | |
| 50 | + return daoMigracao.findById(id); | |
| 51 | + } | |
| 52 | + | |
| 53 | + public boolean isProcessoEmTramitacao(String numero, String ano){ | |
| 54 | + | |
| 55 | + String sql = "SELECT count(*) FROM DBPSIPAR.TB_TRAMITACAO TR " | |
| 56 | + + "WHERE " | |
| 57 | + + "TR.DT_RECEBIMENTO IS NULL " | |
| 58 | + + "AND TR.CO_DOCUMENTO = :numero " | |
| 59 | + + "AND TR.NU_ANO_DOCUMENTO = :ano " | |
| 60 | + + "AND TR.DT_ENVIO = (" | |
| 61 | + + " SELECT MAX(TR2.DT_ENVIO) FROM DBPSIPAR.TB_TRAMITACAO TR2 WHERE TR2.CO_DOCUMENTO = :numero AND TR2.NU_ANO_DOCUMENTO = :ano" | |
| 62 | + + ")"; | |
| 63 | + | |
| 64 | + Query query = em.createNativeQuery(sql); | |
| 65 | + query.setParameter("numero", numero); | |
| 66 | + query.setParameter("ano", ano); | |
| 67 | + | |
| 68 | + Long count = ((BigDecimal) query.getSingleResult()).longValue(); | |
| 69 | + | |
| 70 | + if(count > 0L){ | |
| 71 | + return true; | |
| 72 | + } | |
| 73 | + return false; | |
| 74 | + } | |
| 75 | + | |
| 76 | + public void merge(ControleMigracao controleMigracao){ | |
| 77 | + daoMigracao.merge(controleMigracao); | |
| 78 | + } | |
| 79 | + | |
| 80 | +} | ... | ... |
src/main/java/br/gov/ans/integracao/sipar/modelo/ControleMigracao.java
0 → 100644
| ... | ... | @@ -0,0 +1,56 @@ |
| 1 | +package br.gov.ans.integracao.sipar.modelo; | |
| 2 | + | |
| 3 | +import java.io.Serializable; | |
| 4 | +import java.util.Date; | |
| 5 | + | |
| 6 | +import javax.persistence.Column; | |
| 7 | +import javax.persistence.EmbeddedId; | |
| 8 | +import javax.persistence.Entity; | |
| 9 | +import javax.persistence.Table; | |
| 10 | +import javax.persistence.Temporal; | |
| 11 | +import javax.persistence.TemporalType; | |
| 12 | + | |
| 13 | +@Entity | |
| 14 | +@Table(schema="DBPSIPAR", name="TB_CONTROLE_MIGRACAO_SIPAR_SEI") | |
| 15 | +public class ControleMigracao implements Serializable { | |
| 16 | + | |
| 17 | + private static final long serialVersionUID = 1L; | |
| 18 | + | |
| 19 | + @EmbeddedId | |
| 20 | + private ControleMigracaoId id; | |
| 21 | + | |
| 22 | + @Temporal(TemporalType.TIMESTAMP) | |
| 23 | + @Column(name = "DT_ULTIMA_ALTERACAO_CONTROLE") | |
| 24 | + private Date dataUltimaAlteracao; | |
| 25 | + | |
| 26 | + @Column(name="LG_DOCUMENTO_MIGRACAO_SEI") | |
| 27 | + private Integer migrado; | |
| 28 | + | |
| 29 | + public ControleMigracaoId getId() { | |
| 30 | + return id; | |
| 31 | + } | |
| 32 | + | |
| 33 | + public void setId(ControleMigracaoId id) { | |
| 34 | + this.id = id; | |
| 35 | + } | |
| 36 | + | |
| 37 | + public Date getDataUltimaAlteracao() { | |
| 38 | + return dataUltimaAlteracao; | |
| 39 | + } | |
| 40 | + | |
| 41 | + public void setDataUltimaAlteracao(Date dataUltimaAlteracao) { | |
| 42 | + this.dataUltimaAlteracao = dataUltimaAlteracao; | |
| 43 | + } | |
| 44 | + | |
| 45 | + public Integer getMigrado() { | |
| 46 | + return migrado; | |
| 47 | + } | |
| 48 | + | |
| 49 | + public void setMigrado(Integer migrado) { | |
| 50 | + this.migrado = migrado; | |
| 51 | + } | |
| 52 | + | |
| 53 | + public boolean isProcessoMigrado() { | |
| 54 | + return this.migrado == 1 ? true : false; | |
| 55 | + } | |
| 56 | +} | ... | ... |
src/main/java/br/gov/ans/integracao/sipar/modelo/ControleMigracaoId.java
0 → 100644
| ... | ... | @@ -0,0 +1,61 @@ |
| 1 | +package br.gov.ans.integracao.sipar.modelo; | |
| 2 | + | |
| 3 | +import java.io.Serializable; | |
| 4 | + | |
| 5 | +import javax.persistence.Column; | |
| 6 | +import javax.persistence.Embeddable; | |
| 7 | + | |
| 8 | +@Embeddable | |
| 9 | +public class ControleMigracaoId implements Serializable { | |
| 10 | + | |
| 11 | + private static final long serialVersionUID = 1L; | |
| 12 | + | |
| 13 | + @Column(name = "CD_SEQ_DOCUMENTO") | |
| 14 | + private String numero; | |
| 15 | + | |
| 16 | + @Column(name = "NR_ANO_DOCUMENTO") | |
| 17 | + private String ano; | |
| 18 | + | |
| 19 | + public ControleMigracaoId() { | |
| 20 | + } | |
| 21 | + | |
| 22 | + public ControleMigracaoId(String numero, String ano) { | |
| 23 | + this.numero = numero; | |
| 24 | + this.ano = ano; | |
| 25 | + } | |
| 26 | + | |
| 27 | + public String getNumero() { | |
| 28 | + return numero; | |
| 29 | + } | |
| 30 | + | |
| 31 | + public void setNumero(String numero) { | |
| 32 | + this.numero = numero; | |
| 33 | + } | |
| 34 | + | |
| 35 | + public String getAno() { | |
| 36 | + return ano; | |
| 37 | + } | |
| 38 | + | |
| 39 | + public void setAno(String ano) { | |
| 40 | + this.ano = ano; | |
| 41 | + } | |
| 42 | + | |
| 43 | + @Override | |
| 44 | + public boolean equals(Object obj) { | |
| 45 | + if (obj instanceof ControleMigracaoId) { | |
| 46 | + ControleMigracaoId controleMigracao = (ControleMigracaoId) obj; | |
| 47 | + return (this.numero != null && this.numero.equals(controleMigracao.getNumero()) && | |
| 48 | + this.ano != null && this.ano.equals(controleMigracao.getAno())); | |
| 49 | + } | |
| 50 | + return false; | |
| 51 | + } | |
| 52 | + | |
| 53 | + @Override | |
| 54 | + public int hashCode() { | |
| 55 | + final int numeroPrimo = 31; | |
| 56 | + int resultado = 1; | |
| 57 | + resultado = (numeroPrimo * resultado) + ((this.numero == null) ? 0 : this.numero.hashCode()); | |
| 58 | + resultado = (numeroPrimo * resultado) + ((this.ano == null) ? 0 : this.ano.hashCode()); | |
| 59 | + return resultado; | |
| 60 | + } | |
| 61 | +} | ... | ... |
src/main/java/br/gov/ans/integracao/sipar/modelo/DocumentoSipar.java
0 → 100644
| ... | ... | @@ -0,0 +1,131 @@ |
| 1 | +package br.gov.ans.integracao.sipar.modelo; | |
| 2 | + | |
| 3 | +import java.io.Serializable; | |
| 4 | +import java.util.Date; | |
| 5 | + | |
| 6 | +import javax.persistence.Entity; | |
| 7 | +import javax.persistence.EntityResult; | |
| 8 | +import javax.persistence.FieldResult; | |
| 9 | +import javax.persistence.Id; | |
| 10 | +import javax.persistence.NamedNativeQuery; | |
| 11 | +import javax.persistence.SqlResultSetMapping; | |
| 12 | + | |
| 13 | +@Entity | |
| 14 | +@SqlResultSetMapping(name="DocumentoSiparMapping", entities={ | |
| 15 | + @EntityResult(entityClass = DocumentoSipar.class, | |
| 16 | + fields = { | |
| 17 | + @FieldResult(name = "digito", column = "NU_DIGITO_DOCUMENTO"), | |
| 18 | + @FieldResult(name = "operadora", column = "CO_OPERADORA"), | |
| 19 | + @FieldResult(name = "emissao", column = "DT_EMISSAO_DOCUMENTO"), | |
| 20 | + @FieldResult(name = "registro", column = "DT_REGISTRO"), | |
| 21 | + @FieldResult(name = "tipo", column = "CO_TIPO_DOCUMENTO"), | |
| 22 | + @FieldResult(name = "resumo", column = "DS_RESUMO_DOCUMENTO"), | |
| 23 | + @FieldResult(name = "orgaoPosse", column = "CO_ORGAO_POSSE"), | |
| 24 | + @FieldResult(name = "orgaoOrigem", column = "CO_ORGAO_ORIGEM"), | |
| 25 | + @FieldResult(name = "orgaoRegistro", column = "CO_ORGAO_REGISTRO"), | |
| 26 | + @FieldResult(name = "assunto", column = "CO_ASSUNTO") | |
| 27 | + }) | |
| 28 | +}) | |
| 29 | +@NamedNativeQuery(name = "documentoPorNumeroAnoDigito", resultSetMapping = "DocumentoSiparMapping", | |
| 30 | +query = "SELECT TB.NU_DIGITO_DOCUMENTO, TB.CO_OPERADORA, TB.DT_EMISSAO_DOCUMENTO, TB.DT_REGISTRO, TB.CO_TIPO_DOCUMENTO, " | |
| 31 | + + "TB.DS_RESUMO_DOCUMENTO, TB.CO_ORGAO_POSSE, TB.CO_ORGAO_ORIGEM, TB.CO_ORGAO_REGISTRO, RL.CO_ASSUNTO " | |
| 32 | + + "FROM DBPSIPAR.TB_DOCUMENTO TB " | |
| 33 | + + "LEFT JOIN DBPSIPAR.RL_ASSUNTO_DOCUMENTO RL ON RL.CO_DOCUMENTO = TB.CO_SEQ_DOCUMENTO " | |
| 34 | + + "AND RL.NU_ANO_DOCUMENTO = TB.NU_ANO_DOCUMENTO " | |
| 35 | + + "WHERE TB.CO_SEQ_DOCUMENTO = :numeroDocumento " | |
| 36 | + + "AND TB.NU_ANO_DOCUMENTO = :anoDocumento " | |
| 37 | + + "AND TB.NU_DIGITO_DOCUMENTO = :digitoDocumento") | |
| 38 | +public class DocumentoSipar implements Serializable{ | |
| 39 | + @Id | |
| 40 | + private String digito; | |
| 41 | + private String operadora; | |
| 42 | + private Date emissao; | |
| 43 | + private Date registro; | |
| 44 | + private String tipo; | |
| 45 | + private String resumo; | |
| 46 | + private Long orgaoPosse; | |
| 47 | + private Long orgaoOrigem; | |
| 48 | + private Long orgaoRegistro; | |
| 49 | + private Long assunto; | |
| 50 | + | |
| 51 | + public String getDigito() { | |
| 52 | + return digito; | |
| 53 | + } | |
| 54 | + | |
| 55 | + public void setDigito(String digito) { | |
| 56 | + this.digito = digito; | |
| 57 | + } | |
| 58 | + | |
| 59 | + public Long getAssunto() { | |
| 60 | + return assunto; | |
| 61 | + } | |
| 62 | + | |
| 63 | + public void setAssunto(Long assunto) { | |
| 64 | + this.assunto = assunto; | |
| 65 | + } | |
| 66 | + | |
| 67 | + public String getOperadora() { | |
| 68 | + return operadora; | |
| 69 | + } | |
| 70 | + | |
| 71 | + public void setOperadora(String operadora) { | |
| 72 | + this.operadora = operadora; | |
| 73 | + } | |
| 74 | + | |
| 75 | + public Date getEmissao() { | |
| 76 | + return emissao; | |
| 77 | + } | |
| 78 | + | |
| 79 | + public void setEmissao(Date emissao) { | |
| 80 | + this.emissao = emissao; | |
| 81 | + } | |
| 82 | + | |
| 83 | + public String getTipo() { | |
| 84 | + return tipo; | |
| 85 | + } | |
| 86 | + | |
| 87 | + public void setTipo(String tipo) { | |
| 88 | + this.tipo = tipo; | |
| 89 | + } | |
| 90 | + | |
| 91 | + public String getResumo() { | |
| 92 | + return resumo; | |
| 93 | + } | |
| 94 | + | |
| 95 | + public void setResumo(String resumo) { | |
| 96 | + this.resumo = resumo; | |
| 97 | + } | |
| 98 | + | |
| 99 | + public Long getOrgaoPosse() { | |
| 100 | + return orgaoPosse; | |
| 101 | + } | |
| 102 | + | |
| 103 | + public void setOrgaoPosse(Long orgaoPosse) { | |
| 104 | + this.orgaoPosse = orgaoPosse; | |
| 105 | + } | |
| 106 | + | |
| 107 | + public Long getOrgaoOrigem() { | |
| 108 | + return orgaoOrigem; | |
| 109 | + } | |
| 110 | + | |
| 111 | + public void setOrgaoOrigem(Long orgaoOrigem) { | |
| 112 | + this.orgaoOrigem = orgaoOrigem; | |
| 113 | + } | |
| 114 | + | |
| 115 | + public Long getOrgaoRegistro() { | |
| 116 | + return orgaoRegistro; | |
| 117 | + } | |
| 118 | + | |
| 119 | + public void setOrgaoRegistro(Long orgaoRegistro) { | |
| 120 | + this.orgaoRegistro = orgaoRegistro; | |
| 121 | + } | |
| 122 | + | |
| 123 | + public Date getRegistro() { | |
| 124 | + return registro; | |
| 125 | + } | |
| 126 | + | |
| 127 | + public void setRegistro(Date registro) { | |
| 128 | + this.registro = registro; | |
| 129 | + } | |
| 130 | + | |
| 131 | +} | ... | ... |
src/main/resources/META-INF/persistence.xml
| ... | ... | @@ -7,7 +7,7 @@ |
| 7 | 7 | |
| 8 | 8 | <jta-data-source>jdbc/sei-broker</jta-data-source> |
| 9 | 9 | |
| 10 | - <class>br.gov.ans.integracao.sipar.dao.DocumentoSipar</class> | |
| 10 | + <class>br.gov.ans.integracao.sipar.modelo.DocumentoSipar</class> | |
| 11 | 11 | <class>br.gov.ans.integracao.sei.modelo.InclusaoDocumento</class> |
| 12 | 12 | <class>br.gov.ans.modelo.LogIntegracaoSistemica</class> |
| 13 | 13 | ... | ... |