Commit 11b2ba6dd5d1347831097c5256bbffb1ec740401
1 parent
cbea19fd
Exists in
master
and in
1 other branch
[Fix] Adicionando tratamento para mimetype de documento
Showing
1 changed file
with
24 additions
and
15 deletions
Show diff stats
rn/MdWsSeiDocumentoRN.php
... | ... | @@ -16,6 +16,12 @@ class MdWsSeiDocumentoRN extends DocumentoRN { |
16 | 16 | */ |
17 | 17 | protected function listarDocumentosProcessoConectado(DocumentoDTO $documentoDTOParam){ |
18 | 18 | try{ |
19 | + $arrDocHtml = array( | |
20 | + DocumentoRN::$TD_EDITOR_EDOC, | |
21 | + DocumentoRN::$TD_FORMULARIO_AUTOMATICO, | |
22 | + DocumentoRN::$TD_FORMULARIO_GERADO, | |
23 | + DocumentoRN::$TD_EDITOR_INTERNO | |
24 | + ); | |
19 | 25 | $result = array(); |
20 | 26 | $relProtocoloProtocoloDTOConsulta = new RelProtocoloProtocoloDTO(); |
21 | 27 | if(!$documentoDTOParam->isSetDblIdProcedimento()){ |
... | ... | @@ -93,20 +99,23 @@ class MdWsSeiDocumentoRN extends DocumentoRN { |
93 | 99 | $documentoCancelado = $documentoDTO->getStrStaEstadoProtocolo() == ProtocoloRN::$TE_DOCUMENTO_CANCELADO |
94 | 100 | ? 'S' : 'N'; |
95 | 101 | |
96 | - $anexoDTOConsulta = new AnexoDTO(); | |
97 | - $anexoDTOConsulta->retStrNome(); | |
98 | - $anexoDTOConsulta->retNumTamanho(); | |
99 | - $anexoDTOConsulta->setDblIdProtocolo($documentoDTO->getDblIdDocumento()); | |
100 | - $anexoDTOConsulta->setStrSinAtivo('S'); | |
101 | - $anexoDTOConsulta->setNumMaxRegistrosRetorno(1); | |
102 | - $resultAnexo = $anexoRN->listarRN0218($anexoDTOConsulta); | |
103 | - if($resultAnexo){ | |
104 | - /** @var AnexoDTO $anexoDTO */ | |
105 | - $anexoDTO = $resultAnexo[0]; | |
106 | - $mimetype = $anexoDTO->getStrNome(); | |
107 | - $mimetype = substr($mimetype, strrpos($mimetype, '.')+1); | |
108 | - $nomeAnexo = $anexoDTO->getStrNome(); | |
109 | - $tamanhoAnexo = $anexoDTO->getNumTamanho(); | |
102 | + if(!in_array($documentoDTO->getStrStaDocumento(), $arrDocHtml)){ | |
103 | + | |
104 | + $anexoDTOConsulta = new AnexoDTO(); | |
105 | + $anexoDTOConsulta->retStrNome(); | |
106 | + $anexoDTOConsulta->retNumTamanho(); | |
107 | + $anexoDTOConsulta->setDblIdProtocolo($documentoDTO->getDblIdDocumento()); | |
108 | + $anexoDTOConsulta->setStrSinAtivo('S'); | |
109 | + $anexoDTOConsulta->setNumMaxRegistrosRetorno(1); | |
110 | + $resultAnexo = $anexoRN->listarRN0218($anexoDTOConsulta); | |
111 | + if($resultAnexo){ | |
112 | + /** @var AnexoDTO $anexoDTO */ | |
113 | + $anexoDTO = $resultAnexo[0]; | |
114 | + $mimetype = $anexoDTO->getStrNome(); | |
115 | + $mimetype = substr($mimetype, strrpos($mimetype, '.')+1); | |
116 | + $nomeAnexo = $anexoDTO->getStrNome(); | |
117 | + $tamanhoAnexo = $anexoDTO->getNumTamanho(); | |
118 | + } | |
110 | 119 | } |
111 | 120 | $observacaoDTOConsulta = new ObservacaoDTO(); |
112 | 121 | $observacaoDTOConsulta->setNumMaxRegistrosRetorno(1); |
... | ... | @@ -171,7 +180,7 @@ class MdWsSeiDocumentoRN extends DocumentoRN { |
171 | 180 | * @param int $idUsuario |
172 | 181 | * @return array |
173 | 182 | */ |
174 | - public function apiAssinarDocumentos($arrIdDocumento, $idOrgao, $strCargoFuncao, $siglaUsuario, $senhaUsuario, $idUsuario){ | |
183 | + public function apiAssinarDocumentos($arrIdDocumento, $idOrgao, $strCargoFuncao, $siglaUsuario, $senhaUsuario, $idUsuario){ | |
175 | 184 | //transforma os dados no array |
176 | 185 | if(strpos($arrIdDocumento, ',') !== false) { |
177 | 186 | $arrDocs = explode(',', $arrIdDocumento); | ... | ... |