Commit 1f160a6ee1d34c944a7a633e1a7fd601edf5e695
1 parent
f7975d3e
Exists in
master
and in
1 other branch
Indicador 7: QUantidade de documentos externos por extensao
Showing
1 changed file
with
27 additions
and
1 deletions
Show diff stats
rn/MdEstatisticasColetarRN.php
... | ... | @@ -28,7 +28,8 @@ class MdEstatisticasColetarRN extends InfraRN { |
28 | 28 | 'tamanhoFilesystem' => $this->obterTamanhoFileSystem(), |
29 | 29 | 'bancoSEI' => $this->obterTipoSGBD(), |
30 | 30 | 'quantidadeDocumentosInternos' => $this->obterQuantidadeDocumentosInternos(), |
31 | - 'quantidadeDocumentosExternos' => $this->obterQuantidadeDocumentosExternos() | |
31 | + 'quantidadeDocumentosExternos' => $this->obterQuantidadeDocumentosExternos(), | |
32 | + 'quantidadeDocumentosExternosPorExtensao' => $this->obterQuantidadeDocumentosExternosPorExtensao() | |
32 | 33 | ); |
33 | 34 | |
34 | 35 | return $indicadores; |
... | ... | @@ -182,5 +183,30 @@ class MdEstatisticasColetarRN extends InfraRN { |
182 | 183 | return $quantidade; |
183 | 184 | } |
184 | 185 | |
186 | + private function obterQuantidadeDocumentosExternosPorExtensao(){ | |
187 | + $query = "SELECT nome FROM anexo WHERE sin_ativo = 'S'"; | |
188 | + $rs = BancoSEI::getInstance()->consultarSql($query); | |
189 | + $extensoes = array(); | |
190 | + # Calculando na aplicacao para funcionar independente do banco | |
191 | + foreach($rs as $r) { | |
192 | + $extensao =pathinfo($r['nome'], PATHINFO_EXTENSION); | |
193 | + $qtd = $extensoes[$extensao]; | |
194 | + if (!$qtd) { | |
195 | + $qtd = 0; | |
196 | + } | |
197 | + $extensoes[$extensao] = $qtd + 1; | |
198 | + } | |
199 | + $lista = array(); | |
200 | + foreach($extensoes as $key => $value) { | |
201 | + $result = array( | |
202 | + 'extensao' => $key, | |
203 | + 'quantidade' => $value | |
204 | + ); | |
205 | + array_push($lista, $result); | |
206 | + } | |
207 | + | |
208 | + InfraDebug::getInstance()->gravar('SEI07 - Quantidade de extensoes de documentos externos: ' . json_encode($lista), InfraLog::$INFORMACAO); | |
209 | + return $lista; | |
210 | + } | |
185 | 211 | } |
186 | 212 | ?> | ... | ... |