Commit 680b056f637d4271324b50e0989c6f5ff7040e3b
1 parent
61359a85
Exists in
master
and in
1 other branch
Ajustes em identação e flexibilização da passagem do parâmetro unidade.
Showing
3 changed files
with
8 additions
and
3 deletions
Show diff stats
src/main/java/br/gov/ans/integracao/sei/rest/ArquivoResource.java
| ... | ... | @@ -96,8 +96,8 @@ public class ArquivoResource { |
| 96 | 96 | public Response adicionarArquivo(@PathParam("unidade") String unidade, Arquivo arquivo) throws RemoteException, Exception{ |
| 97 | 97 | validarTamanhoArquivo(arquivo); |
| 98 | 98 | |
| 99 | - String identificador = seiNativeService.adicionarArquivo(Constantes.SEI_BROKER, Operacao.ADICIONAR_ARQUIVO, unidadeResource.consultarCodigo(unidade), arquivo.getNome(), arquivo.getTamanho(), | |
| 100 | - arquivo.getHash(), arquivo.getConteudo()); | |
| 99 | + String identificador = seiNativeService.adicionarArquivo(Constantes.SEI_BROKER, Operacao.ADICIONAR_ARQUIVO, | |
| 100 | + unidadeResource.consultarCodigo(unidade), arquivo.getNome(), arquivo.getTamanho(), arquivo.getHash(), arquivo.getConteudo()); | |
| 101 | 101 | |
| 102 | 102 | return Response.created(getResourcePath(identificador)).entity(new ArquivoCriado(identificador)).build(); |
| 103 | 103 | } | ... | ... |
src/main/java/br/gov/ans/integracao/sei/rest/BlocoResource.java
| ... | ... | @@ -170,7 +170,8 @@ public class BlocoResource { |
| 170 | 170 | @Path("{unidade}/blocos/disponibilizados/{bloco}") |
| 171 | 171 | @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) |
| 172 | 172 | public String cancelarDisponibilizacaoBloco(@PathParam("unidade") String unidade, @PathParam("bloco") String bloco) throws Exception{ |
| 173 | - String resultado = seiNativeService.cancelarDisponibilizacaoBloco(Constantes.SEI_BROKER, Operacao.CANCELAR_DISPONIBILIZACAO_BLOCO, unidadeResource.consultarCodigo(unidade), bloco); | |
| 173 | + String resultado = seiNativeService.cancelarDisponibilizacaoBloco(Constantes.SEI_BROKER, Operacao.CANCELAR_DISPONIBILIZACAO_BLOCO, | |
| 174 | + unidadeResource.consultarCodigo(unidade), bloco); | |
| 174 | 175 | |
| 175 | 176 | return trueOrFalse(resultado) + ""; |
| 176 | 177 | } | ... | ... |
src/main/java/br/gov/ans/integracao/sei/rest/UnidadeResource.java
| ... | ... | @@ -111,6 +111,10 @@ public class UnidadeResource { |
| 111 | 111 | public String consultarCodigo(@PathParam("chave") String chave) throws Exception{ |
| 112 | 112 | logger.debug(messages.getMessage("consultando.unidade",chave)); |
| 113 | 113 | |
| 114 | + if(isInteger(chave)){ | |
| 115 | + return chave; | |
| 116 | + } | |
| 117 | + | |
| 114 | 118 | if(!getUnidades().containsKey(chave.toUpperCase())){ |
| 115 | 119 | throw new BusinessException(messages.getMessage("erro.unidade.nao.encontrada", chave)); |
| 116 | 120 | } | ... | ... |