Commit 732125ce47c834519b3240e73022a5d23c8626e9
1 parent
fad686d2
Exists in
master
and in
1 other branch
Indicador 11 - Obtendo quantidade de documentos externos por tamanho
Showing
1 changed file
with
27 additions
and
0 deletions
Show diff stats
rn/MdEstatisticasColetarRN.php
... | ... | @@ -37,6 +37,7 @@ class MdEstatisticasColetarRN extends InfraRN { |
37 | 37 | 'navegadores' => $this->obterNavegadores(), |
38 | 38 | 'modulos' => $this->obterPlugins(), |
39 | 39 | 'tamanhoFilesystem' => $this->obterTamanhoFileSystem(), |
40 | + 'tamanhoDocumentosExternos' => $this->obterTamanhoDocumentosExternos(), | |
40 | 41 | 'extensoes' => $this->obterQuantidadeDocumentosExternosPorExtensao() |
41 | 42 | ); |
42 | 43 | |
... | ... | @@ -288,5 +289,31 @@ class MdEstatisticasColetarRN extends InfraRN { |
288 | 289 | return $dataColeta; |
289 | 290 | } |
290 | 291 | |
292 | + private function obterTamanhoDocumentosExternos(){ | |
293 | + $resultado = array(); | |
294 | + # 0MB - !MB | |
295 | + $query = "SELECT count(*) as quantidade FROM anexo WHERE sin_ativo = 'S' AND tamanho >= 0 AND tamanho < 1000"; | |
296 | + $rs = BancoSEI::getInstance()->consultarSql($query); | |
297 | + $resultado['0MB - 1MB'] = (count($rs) && isset($rs[0]['quantidade'])) ? $rs[0]['quantidade'] : 0; | |
298 | + | |
299 | + # 1MB - 10MB | |
300 | + $query = "SELECT count(*) as quantidade FROM anexo WHERE sin_ativo = 'S' AND tamanho >= 1000 AND tamanho < 10000"; | |
301 | + $rs = BancoSEI::getInstance()->consultarSql($query); | |
302 | + $resultado['1MB - 10MB'] = (count($rs) && isset($rs[0]['quantidade'])) ? $rs[0]['quantidade'] : 0; | |
303 | + | |
304 | + # 10MB - 100MB | |
305 | + $query = "SELECT count(*) as quantidade FROM anexo WHERE sin_ativo = 'S' AND tamanho >= 10000 AND tamanho < 100000"; | |
306 | + $rs = BancoSEI::getInstance()->consultarSql($query); | |
307 | + $resultado['10MB - 100MB'] = (count($rs) && isset($rs[0]['quantidade'])) ? $rs[0]['quantidade'] : 0; | |
308 | + | |
309 | + # > 100MB | |
310 | + $query = "SELECT count(*) as quantidade FROM anexo WHERE sin_ativo = 'S' AND tamanho >= 100000"; | |
311 | + $rs = BancoSEI::getInstance()->consultarSql($query); | |
312 | + $resultado['Maior que 100MB'] = (count($rs) && isset($rs[0]['quantidade'])) ? $rs[0]['quantidade'] : 0; | |
313 | + | |
314 | + InfraDebug::getInstance()->gravar('SEI11 - Tamanho dos documentos externos: ' . json_encode($resultado), InfraLog::$INFORMACAO); | |
315 | + return $resultado; | |
316 | + } | |
317 | + | |
291 | 318 | } |
292 | 319 | ?> | ... | ... |