Commit a4991e79eb1712dbf518da492b83a842182eaed3
1 parent
77b80c91
Exists in
master
and in
1 other branch
[FEAT] Alterando download do documento em HTML para a mesma implementação feita no CORE do SEI.
Showing
1 changed file
with
22 additions
and
4 deletions
Show diff stats
rn/MdWsSeiDocumentoRN.php
... | ... | @@ -234,10 +234,28 @@ class MdWsSeiDocumentoRN extends InfraRN { |
234 | 234 | if(!empty($resultDocumento)){ |
235 | 235 | /** @var DocumentoDTO $documentoDTO */ |
236 | 236 | $documentoDTO = $resultDocumento[0]; |
237 | - if ($documentoDTO->getStrConteudo()) { | |
238 | - $html = $documentoDTO->getStrConteudo() . $documentoDTO->getStrConteudoAssinatura(); | |
239 | - return MdWsSeiRest::formataRetornoSucessoREST(null, array('html' => $html)); | |
240 | - } | |
237 | + $editorDTOConsulta = new EditorDTO(); | |
238 | + $editorDTOConsulta->setDblIdDocumento($documentoDTO->getDblIdDocumento()); | |
239 | + $editorDTOConsulta->setNumIdBaseConhecimento(null); | |
240 | + $editorDTOConsulta->setStrSinCabecalho('S'); | |
241 | + $editorDTOConsulta->setStrSinRodape('S'); | |
242 | + $editorDTOConsulta->setStrSinIdentificacaoVersao('S'); | |
243 | + $editorDTOConsulta->setStrSinProcessarLinks('S'); | |
244 | + $editorRN = new EditorRN(); | |
245 | + $html = $editorRN->consultarHtmlVersao($editorDTOConsulta); | |
246 | + | |
247 | + $auditoriaProtocoloDTO = new AuditoriaProtocoloDTO(); | |
248 | + $auditoriaProtocoloDTO->setStrRecurso('documento_visualizar'); | |
249 | + $auditoriaProtocoloDTO->setNumIdUsuario(SessaoSEI::getInstance()->getNumIdUsuario()); | |
250 | + $auditoriaProtocoloDTO->setDblIdProtocolo($documentoDTO->getDblIdDocumento()); | |
251 | + $auditoriaProtocoloDTO->setNumIdAnexo(null); | |
252 | + $auditoriaProtocoloDTO->setDtaAuditoria(InfraData::getStrDataAtual()); | |
253 | + $auditoriaProtocoloDTO->setNumVersao($editorDTOConsulta->getNumVersao()); | |
254 | + | |
255 | + $auditoriaProtocoloRN = new AuditoriaProtocoloRN(); | |
256 | + $auditoriaProtocoloRN->auditarVisualizacao($auditoriaProtocoloDTO); | |
257 | + | |
258 | + return MdWsSeiRest::formataRetornoSucessoREST(null, array('html' => $html)); | |
241 | 259 | } |
242 | 260 | |
243 | 261 | $anexoDTO = new AnexoDTO(); | ... | ... |