From 2be7270c05be49588704937699de72fd83dd3de8 Mon Sep 17 00:00:00 2001 From: Emilio Date: Wed, 19 Nov 2025 09:59:16 -0600 Subject: [PATCH] =?UTF-8?q?creaci=C3=B2n=20de=20runas=20nuevas=20para=20re?= =?UTF-8?q?portes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mariadb/aria_log.00000001 | Bin 5095424 -> 5128192 bytes mariadb/aria_log_control | Bin 52 -> 52 bytes src/equipo/equipo.controller.ts | 188 ++++++++++++++++++++++++++++++++ src/equipo/equipo.service.ts | 5 +- 4 files changed, 190 insertions(+), 3 deletions(-) diff --git a/mariadb/aria_log.00000001 b/mariadb/aria_log.00000001 index ac18968a3accb2d3f86547abc71734a9c810cd71..860bfcc3dc6ef7c5bce5c0e06ff99c882499ab87 100644 GIT binary patch delta 17343 zcmZA8aa7;){=o6JHf?LGZEb5?+uFoJ2yF|Y5n`FpC4>+{2qA>V-h>dhdvEvN?!Dc6 zyZ3hQ?Gi!=A%qY@7}|so8X<)4?`P+pJ&x~R-}8CA-{QkWdJ2~lB6m>Q;q=rBFZ2r(fx%nY-_><|~`gt=i}h!69_g0L_oghgR- zSP~M$(y%OS8_fE46DQb;ee184h#o{gF|*WBpe#ngq(2LJ!`XWuiN;-nyIl_x37(eh#24U z8J<;l+mab`wn(Y6S*ce(SGtrhlo4e_NxXxCFO?kSE2UidT4_{9l^*3AWlZ^2Np7L- zJ0(vUQ!173m1gA!rBC@$iM*47aU>>HiKyGOa>d-AZd^=(Faf9%CIYQOB+xHR0;2CC zYch~7Yy%VtQ9z9_1!xzh0)xUdAntCeqJd0dI#43a0P2Jopi_tihJ~3xLMv6XfNWtl zP$t9y4Z<9tTbK)s3iE)Zd#H*Ba)tRog|Gl<5*7lzLIN-@ECN#QrD`#dFDwDp3yDCB zuoT!JECZtMWB9f}nvet(3flqI!uCL$upAf=l7ZMZs&)V}gdKrmVJDzgNC7&8oq-`? z7a;zAs&)mkgjAqZ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}sSGPm zC<#B(_N0=nJf)N=T}p%Uw9>6Sql_xgDoNwCbt}2bb4rEsywaq+p!6y|TV(0@`9DAJ za@C9OPm4Hw>uUioDTT_*O109fv?;GB1InvP>;wv4Q!%BV7^e51rg(e|y9seGrDC}T>U^1afj{GbdgKPm}RXd6djvXzLsO{@O*icFa> z0ca2=0^LF+Fe*#}lBSY18ORm30V;$jph=hl^a@jfabX&eGL5QeAYYgctQTegEkX>i zL5KySq8UCDNE2oOg~Dv0T8IPMggL-~Fc*lOPSrdhLx=~8h510OumI=~76L;;0uVog zszpGSuox&6mH_oaBG4r)1xAErKw=D4+X6X45>PH|2Q&)X13kiWU`$8`l4Ggb0mu_} z1S*A{fMy{D=o5AZB4;vu7a&#G6(|r=fhu7)pjFr%=oj|b3NxZ-QB}8b)&KtKpYHV) zTQ|fM2`hmbVHMCWqyvM(oVzwRPT@*mShxyESVC1LkS(kO%7m+d2H_f@ zTUZZ_3IRw;r0QBASGW$S5UPMC;d-D~xZx*A9KYb_hfFTIk=8JDO8F!6|LH%XhH7u`|$42DST+AnWkGgg7-rBk3#s1f|y9$ zj9GK$B`jE!l#;e&Sw>dQio8{83f65XDk>Qw>dL&Rw{4 rW;rB?L_9MGtNx`Z;m_? diff --git a/mariadb/aria_log_control b/mariadb/aria_log_control index 9647dda39b3a7278b838073ae77fb44cbd1a5d87..ad151838de525a60ac073e0732df4021f9dc827d 100644 GIT binary patch delta 27 fcmXppnII?jHT*y=BLf4!q8|g0VwfNTBp4U~U0Vd& delta 27 gcmXppnII?jQ|B)qBLjo@T3-er#qdrLNH8z}0AWT2ZvX%Q diff --git a/src/equipo/equipo.controller.ts b/src/equipo/equipo.controller.ts index 4ec8af7..b56e13f 100644 --- a/src/equipo/equipo.controller.ts +++ b/src/equipo/equipo.controller.ts @@ -35,6 +35,7 @@ export class EquipoController { ) { return this.equipoService.buscarEquipos(filtros, +page, +limit); } + @UseGuards(AuthGuard('jwt')) @Get('buscar/:inv') async serch(@Param('inv') inv: string) { @@ -137,4 +138,191 @@ export class EquipoController { throw new BadRequestException('Error al generar el reporte:', error); } } + + @UseGuards(AuthGuard('jwt')) + @Get('reporte/tipoEquipos_tipoUso') + async reportetipoEquipos_tipoUso() { + try { + return await this.equipoService.contar_tipoEquipos_tipoUso(); + } catch (error) { + throw new BadRequestException( + 'Error al generar el reporte tipoEquipos_tipoUso:', + error, + ); + } + } + + @UseGuards(AuthGuard('jwt')) + @Get('reporte/tipoEquipos_sistemasOperativos') + async reportetipoEquipos_sistemasOperativos() { + try { + return await Promise.all([ + this.equipoService.contar_tipoEquipos_sistemasOperativos(equpos_pc), + this.equipoService.contar_tipoEquipos_sistemasOperativos([ + estritorio_mac, + ]), + this.equipoService.contar_tipoEquipos_sistemasOperativos(portatiles), + this.equipoService.contar_tipoEquipos_sistemasOperativos([ + portatiles_mac, + ]), + this.equipoService.contar_tipoEquipos_sistemasOperativos([servidor]), + ]); + } catch (error) { + throw new BadRequestException( + 'Error al generar el reporte tipoEquipos_sistemasOperativos:', + error, + ); + } + } + + @UseGuards(AuthGuard('jwt')) + @Get('reporte/tipoEquipos_procesador') + async reportetipoEquipos_procesador() { + try { + return await Promise.all([ + this.equipoService.contar_tipoEquipos_procesador(equpos_pc), + this.equipoService.contar_tipoEquipos_procesador([estritorio_mac]), + this.equipoService.contar_tipoEquipos_procesador(portatiles), + this.equipoService.contar_tipoEquipos_procesador([portatiles_mac]), + this.equipoService.contar_tipoEquipos_procesador([servidor]), + ]); + } catch (error) { + throw new BadRequestException( + 'Error al generar el reporte tipoEquipos_procesador:', + error, + ); + } + } + + @UseGuards(AuthGuard('jwt')) + @Get('reporte/tipoEquipos_antiguedad') + async reportetipoEquipos_antiguedad() { + try { + return await this.equipoService.contar_tipoEquipos_antiguedad(); + } catch (error) { + throw new BadRequestException( + 'Error al generar el reporte contar_tipoEquipos_antiguedad:', + error, + ); + } + } + + @UseGuards(AuthGuard('jwt')) + @Get('reporte/garantia') + async reportegarantia() { + try { + return await Promise.all([ + this.equipoService.garantia(escritorio), + this.equipoService.garantia(portatil), + this.equipoService.garantia([servidor]), + ]); + } catch (error) { + throw new BadRequestException( + 'Error al generar el reporte garantia:', + error, + ); + } + } + + @UseGuards(AuthGuard('jwt')) + @Get('reporte/equipos_impesion_group/impresoras') + async reporteequipos_impesion_group() { + try { + return await this.equipoService.equipos_impesion_group(impresoras); + } catch (error) { + throw new BadRequestException( + 'Error al generar el reporte impesion_group impresoras:', + error, + ); + } + } + + @UseGuards(AuthGuard('jwt')) + @Get('reporte/equipos_impesion_group/dijitales') + async reporteequipos_impesion_group_dijitales() { + try { + return await this.equipoService.equipos_impesion_group(dijitales); + } catch (error) { + throw new BadRequestException( + 'Error al generar el reporte impesion_group dijitales:', + error, + ); + } + } + + @UseGuards(AuthGuard('jwt')) + @Get('reporte/contar_periferico_tipoUso/impresoras') + async reporte_contar_periferico_tipoUso_impresoras() { + try { + return await this.equipoService.contar_periferico_tipoUso(impresoras); + } catch (error) { + throw new BadRequestException( + 'Error al generar el reporte periferico_tipoUso impresoras:', + error, + ); + } + } + + @UseGuards(AuthGuard('jwt')) + @Get('reporte/contar_periferico_tipoUso/dijtales') + async reporte_contar_periferico_tipoUso_dijtales() { + try { + return await this.equipoService.contar_periferico_tipoUso(dijitales); + } catch (error) { + throw new BadRequestException( + 'Error al generar el reporte periferico_tipoUso dijtales:', + error, + ); + } + } + + @UseGuards(AuthGuard('jwt')) + @Get('reporte/contar_perifericos_antiguedad') + async reporte_contar_perifericos_antiguedad() { + try { + return await this.equipoService.contar_perifericos_antiguedad( + impresoras, + dijitales, + ); + } catch (error) { + throw new BadRequestException( + 'Error al generar el reporte perifericos_antiguedad:', + error, + ); + } + } } + +let escritorio = ['ESCRITORIO PC', 'ESCRITORIO MAC OS ', 'ESCRITORIO LINUX']; +let portatil = [ + 'PORTÁTILES WINDOWS', + 'PORTÁTILES CHROMEBOOK', + 'PORTÁTILES MAC OS', +]; + +let equipos_mac = ['ESCRITORIO MAC OS ', 'PORTÁTILES MAC OS']; + +let equpos_pc = ['ESCRITORIO PC', 'ESCRITORIO LINUX']; +let estritorio_mac = 'ESCRITORIO MAC OS '; +let portatiles_mac = 'PORTÁTILES MAC OS'; + +let portatiles = ['PORTÁTILES WINDOWS', 'PORTÁTILES CHROMEBOOK']; + +let tabletas = ['TABLETA ANDROID', 'TABLETA iPAD OS']; + +let impresoras = [ + 'INYECCIÓN TINTA', + 'LÁSER DE ALTO VOLUMEN B/N', + 'LÁSER PEQUEÑA B/N', + 'LÁSER PEQUEÑA COLOR', + 'MATRIZ DE PUNTOS', + 'MULTIFUNCIONALES', +]; + +let dijitales = [ + '3D', + 'DIGITALIZADOR DE CAMA PLANA PARA OFICINA', + 'DIGITALIZADOR CON ALIMENTADOR DE HOJAS PARA OFICINA', +]; + +let servidor = 'SERVIDOR'; diff --git a/src/equipo/equipo.service.ts b/src/equipo/equipo.service.ts index 4f4af5a..9d26923 100644 --- a/src/equipo/equipo.service.ts +++ b/src/equipo/equipo.service.ts @@ -394,9 +394,8 @@ export class EquipoService { try { const count = await this.equipoRepository .createQueryBuilder('e') - .innerJoin('e.procesador_tipoequipo', 'pt') - .innerJoin('pt.tipoEquipo', 't') - .innerJoin('pt.procesador', 'p') + .innerJoin('e.procesador', 'p') + .innerJoin('e.tipoEquipo', 't') .where('t.tipo_equipo IN (:...tipo_equipo)', { tipo_equipo }) .select(['p.procesador AS procesador']) .addSelect('COUNT(*) AS total')