utn-cli 2.0.22 → 2.0.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "utn-cli",
3
- "version": "2.0.22",
3
+ "version": "2.0.24",
4
4
  "description": "Herramienta CLI unificada para la gestión de plantillas en SIGU.",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -60,6 +60,12 @@ Authorization: Bearer {{ AUTH_TOKEN }}
60
60
  Content-Type: application/json
61
61
  Origin: {{ BASE_URL }}
62
62
 
63
+ ###
64
+ GET {{ BASE_URL }}/misc/obtenerMensajesModulares HTTP/1.1
65
+ Authorization: Bearer {{ AUTH_TOKEN }}
66
+ Content-Type: application/json
67
+ Origin: {{ BASE_URL }}
68
+
63
69
  ###
64
70
  GET {{ BASE_URL }}/misc/obtenerMensajesInstitucionales HTTP/1.1
65
71
  Authorization: Bearer {{ AUTH_TOKEN }}
@@ -168,6 +168,23 @@ Router.get('/obtenerDatosDelUsuario', async (solicitud, respuesta, next) => {
168
168
  }
169
169
  });
170
170
 
171
+ Router.get('/obtenerMensajesModulares', async (solicitud, respuesta, next) => {
172
+ try {
173
+ if (await Miscelaneo.validarTokenV2(solicitud.headers.authorization) && await Miscelaneo.validarAccesoDelOrigen(solicitud)) {
174
+ try {
175
+ return respuesta.json({ body: await Miscelaneo.obtenerMensajesModulares(), error: undefined });
176
+ } catch (error) {
177
+ const MensajeDeError = 'No fue posible obtener los mensajes modulares';
178
+ console.error(new ManejadorDeErrores(MensajeDeError, ManejadorDeErrores.obtenerNumeroDeLinea(), true, `Dirección IP: ${solicitud.ip}`));
179
+ return respuesta.status(500).json({ body: undefined, error: MensajeDeError });
180
+ }
181
+ }
182
+ return respuesta.status(401).json({ body: undefined, error: ManejadorDeErrores.mensajeDeError401() });
183
+ } catch (error) {
184
+ next(error);
185
+ }
186
+ });
187
+
171
188
  Router.get('/obtenerMensajesInstitucionales', async (solicitud, respuesta, next) => {
172
189
  try {
173
190
  if (await Miscelaneo.validarTokenV2(solicitud.headers.authorization) && await Miscelaneo.validarAccesoDelOrigen(solicitud)) {
@@ -428,6 +428,11 @@ class Miscelaneo {
428
428
  });
429
429
  }
430
430
 
431
+ async obtenerMensajesModulares() {
432
+ return await ejecutarConsultaSIGU("SELECT `MensajeModularId`, `Titulo`, `Texto`, `FechaYHoraDeInicio`, `FechaYHoraDeFinalizacion` FROM `SIGU`.`SIGU_MensajesModulares` WHERE NOW(4) BETWEEN `FechaYHoraDeInicio` AND `FechaYHoraDeFinalizacion` AND `Modulo` = ?"
433
+ , [this.NombreCanonicoDelModulo]);
434
+ }
435
+
431
436
  async obtenerMensajesInstitucionales() {
432
437
  return await ejecutarConsultaSIGU("SELECT `MensajeInstitucionalId`, `Titulo`, `Texto`, `FechaYHoraDeInicio`, `FechaYHoraDeFinalizacion` FROM `SIGU`.`SIGU_MensajesInstitucionales` WHERE NOW(4) BETWEEN `FechaYHoraDeInicio` AND `FechaYHoraDeFinalizacion`");
433
438
  }
@@ -677,11 +682,11 @@ class Miscelaneo {
677
682
  `SegundoApellido`", [await this.perfilGeneralId()]);
678
683
  }
679
684
 
680
- async rolPermisoIdDelMenuPadre() {
681
- const rolPermisoIdDelMenuPadre = await ejecutarConsultaSIGU("SELECT `RolPermisoId` FROM `SIGU`.`SIGU_RolesPermisos` WHERE\
682
- `PermisoId` = (SELECT `PermisoId` FROM `SIGU`.`SIGU_Menu` WHERE `Nombre` = ?)", [this.MenuPadre]);
683
- return rolPermisoIdDelMenuPadre[0]['RolPermisoId'];
684
- }
685
+ // async rolPermisoIdDelMenuPadre() {
686
+ // const rolPermisoIdDelMenuPadre = await ejecutarConsultaSIGU("SELECT `RolPermisoId` FROM `SIGU`.`SIGU_RolesPermisos` WHERE\
687
+ // `PermisoId` = (SELECT `PermisoId` FROM `SIGU`.`SIGU_Menu` WHERE `Nombre` = ?)", [this.MenuPadre]);
688
+ // return rolPermisoIdDelMenuPadre[0]['RolPermisoId'];
689
+ // }
685
690
 
686
691
  async getUUID() {
687
692
  const Identificador = await ejecutarConsultaSIGU("SELECT `Identificador` FROM `SIGU`.`SIGU_Repositorios` WHERE `Repositorio` = ?", [this.NombreDelRepositorioDelBackend]);
@@ -693,15 +698,15 @@ class Miscelaneo {
693
698
  return PerfilGeneralId[0]['PerfilGeneralId'];
694
699
  }
695
700
 
696
- async rolIdDelModulo() {
697
- const RolId = await ejecutarConsultaSIGU("SELECT `RolId` FROM `SIGU`.`SIGU_Roles` WHERE `Descripcion` = ?", [this.NombreDelRol]);
698
- return RolId[0]['RolId'];
699
- }
701
+ // async rolIdDelModulo() {
702
+ // const RolId = await ejecutarConsultaSIGU("SELECT `RolId` FROM `SIGU`.`SIGU_Roles` WHERE `Descripcion` = ?", [this.NombreDelRol]);
703
+ // return RolId[0]['RolId'];
704
+ // }
700
705
 
701
- async permisoIdDelModulo() {
702
- const PermisoId = await ejecutarConsultaSIGU("SELECT `PermisoId` FROM `SIGU`.`SIGU_Permisos` WHERE `Nombre` = ?", [this.NombreDelPermiso]);
703
- return PermisoId[0]['PermisoId'];
704
- }
706
+ // async permisoIdDelModulo() {
707
+ // const PermisoId = await ejecutarConsultaSIGU("SELECT `PermisoId` FROM `SIGU`.`SIGU_Permisos` WHERE `Nombre` = ?", [this.NombreDelPermiso]);
708
+ // return PermisoId[0]['PermisoId'];
709
+ // }
705
710
 
706
711
  async rolPermisoIdDelModulo() {
707
712
  this.RolId = await this.rolIdDelModulo();
@@ -711,15 +716,15 @@ class Miscelaneo {
711
716
  return RolPermisoId[0]['RolPermisoId'];
712
717
  }
713
718
 
714
- async idDelMenuPadre() {
715
- const IdDelMenuPadre = await ejecutarConsultaSIGU("SELECT `MenuId` FROM `SIGU`.`SIGU_Menu` WHERE `Nombre` = ?", [this.MenuPadre]);
716
- return IdDelMenuPadre[0]['MenuId'];
717
- }
719
+ // async idDelMenuPadre() {
720
+ // const IdDelMenuPadre = await ejecutarConsultaSIGU("SELECT `MenuId` FROM `SIGU`.`SIGU_Menu` WHERE `Nombre` = ?", [this.MenuPadre]);
721
+ // return IdDelMenuPadre[0]['MenuId'];
722
+ // }
718
723
 
719
- async idDelMenuDelModulo() {
720
- const IdDelMenuDelModulo = await ejecutarConsultaSIGU("SELECT `MenuId` FROM `SIGU`.`SIGU_Menu` WHERE `Nombre` = ?", [this.NombreCanonicoDelModulo]);
721
- return IdDelMenuDelModulo[0]['MenuId'];
722
- }
724
+ // async idDelMenuDelModulo() {
725
+ // const IdDelMenuDelModulo = await ejecutarConsultaSIGU("SELECT `MenuId` FROM `SIGU`.`SIGU_Menu` WHERE `Nombre` = ?", [this.NombreCanonicoDelModulo]);
726
+ // return IdDelMenuDelModulo[0]['MenuId'];
727
+ // }
723
728
 
724
729
  generarEnlace(Modulo) {
725
730
  return ((process.env.ENV || 'local') === 'production' ? 'https' : 'http')
@@ -742,71 +747,71 @@ class Miscelaneo {
742
747
  // Creación del enlace a acceso
743
748
  this.EnlaceDeAcceso = this.generarEnlace('accesov2-frontend');
744
749
 
745
- // Creación del Rol
746
- const RolId = await ejecutarConsultaSIGU("SELECT (MAX(`RolId`) + 1) AS `RolId` FROM `SIGU`.`SIGU_Roles` WHERE `RolId` < 1000");
747
- await ejecutarConsultaSIGU("INSERT INTO `SIGU`.`SIGU_Roles` VALUES (?, ?, NOW(4), USER()) ON DUPLICATE KEY UPDATE `LastUpdate` = NOW(4)", [RolId[0]['RolId'], this.NombreDelRol]);
748
- this.RolId = await this.rolIdDelModulo();
749
-
750
- // Creación del Módulo
751
- await ejecutarConsultaSIGU("INSERT INTO `SIGU`.`SIGU_Modulos` VALUES (?, ?, ?, ?, ?, 1, ?, ?\
752
- , (SELECT `Identificador` FROM `SIGU`.`SIGU_Personas` WHERE `Identificacion` = '111050570')\
753
- , (SELECT `Identificador` FROM `SIGU`.`SIGU_Personas` WHERE `Identificacion` = '111050570')\
754
- , (SELECT `Identificador` FROM `SIGU`.`SIGU_Personas` WHERE `Identificacion` = '111050570')\
755
- , ?, '1.0.0', NOW(4), 'ANS', '/', ?, '1', NOW(4), USER()) ON DUPLICATE KEY UPDATE `LastUpdate` = NOW(4)"
756
- , [this.NombreDelModulo, this.DescripcionDelModulo, this.NombreCanonicoDelModulo, this.TipoDeCard, this.IconoDelModulo
757
- , this.ColorDelModulo, this.RolId, this.CorreoParaReportes, this.Repositorios]);
758
-
759
- // Creación del Permiso
760
- await ejecutarConsultaSIGU("INSERT INTO `SIGU`.`SIGU_Permisos` VALUES (NULL, ?, ?, NOW(4), USER()) ON DUPLICATE KEY UPDATE `LastUpdate` = NOW(4)"
761
- , [this.NombreDelPermiso, this.DescripcionDelPermiso]);
762
- this.PermisoId = await this.permisoIdDelModulo();
750
+ // // Creación del Rol
751
+ // const RolId = await ejecutarConsultaSIGU("SELECT (MAX(`RolId`) + 1) AS `RolId` FROM `SIGU`.`SIGU_Roles` WHERE `RolId` < 1000");
752
+ // await ejecutarConsultaSIGU("INSERT INTO `SIGU`.`SIGU_Roles` VALUES (?, ?, NOW(4), USER()) ON DUPLICATE KEY UPDATE `LastUpdate` = NOW(4)", [RolId[0]['RolId'], this.NombreDelRol]);
753
+ // this.RolId = await this.rolIdDelModulo();
754
+
755
+ // // Creación del Módulo
756
+ // await ejecutarConsultaSIGU("INSERT INTO `SIGU`.`SIGU_Modulos` VALUES (?, ?, ?, ?, ?, 1, ?, ?\
757
+ // , (SELECT `Identificador` FROM `SIGU`.`SIGU_Personas` WHERE `Identificacion` = '111050570')\
758
+ // , (SELECT `Identificador` FROM `SIGU`.`SIGU_Personas` WHERE `Identificacion` = '111050570')\
759
+ // , (SELECT `Identificador` FROM `SIGU`.`SIGU_Personas` WHERE `Identificacion` = '111050570')\
760
+ // , ?, '1.0.0', NOW(4), 'ANS', '/', ?, '1', NOW(4), USER()) ON DUPLICATE KEY UPDATE `LastUpdate` = NOW(4)"
761
+ // , [this.NombreDelModulo, this.DescripcionDelModulo, this.NombreCanonicoDelModulo, this.TipoDeCard, this.IconoDelModulo
762
+ // , this.ColorDelModulo, this.RolId, this.CorreoParaReportes, this.Repositorios]);
763
+
764
+ // // Creación del Permiso
765
+ // await ejecutarConsultaSIGU("INSERT INTO `SIGU`.`SIGU_Permisos` VALUES (NULL, ?, ?, NOW(4), USER()) ON DUPLICATE KEY UPDATE `LastUpdate` = NOW(4)"
766
+ // , [this.NombreDelPermiso, this.DescripcionDelPermiso]);
767
+ // this.PermisoId = await this.permisoIdDelModulo();
768
+
769
+ // // Creación del Rol-Permiso
770
+ // await ejecutarConsultaSIGU("INSERT INTO `SIGU`.`SIGU_RolesPermisos` VALUES (NULL, ?, ?, NOW(4), USER()) ON DUPLICATE KEY UPDATE `LastUpdate` = NOW(4)"
771
+ // , [this.RolId, this.PermisoId]);
772
+ // this.RolPermisoId = await this.rolPermisoIdDelModulo();
773
+
774
+ // // Asignación del permiso a dvillalobos
775
+ // const perfilGeneralId = await this.perfilGeneralId();
776
+ // await ejecutarConsultaSIGU("INSERT INTO `SIGU`.`SIGU_RolesPersonas` VALUES (?, ?,\
777
+ // (SELECT `Identificador` FROM `SIGU`.`SIGU_Personas` WHERE `Identificacion` = '111050570'), NOW(4), USER())\
778
+ // ON DUPLICATE KEY UPDATE `LastUpdate` = NOW(4)"
779
+ // , [this.RolPermisoId, perfilGeneralId]);
780
+
781
+ // // Creación de los menús
782
+ // this.IdDelMenuPadre = await this.idDelMenuPadre();
783
+ // await ejecutarConsultaSIGU("INSERT INTO `SIGU`.`SIGU_Menu` VALUES (NULL, ?, ?, ?, 'Módulo', 'opciones', ?\
784
+ // , ?, ?, 0, 1, NOW(4), USER()) ON DUPLICATE KEY UPDATE `LastUpdate` = NOW(4)"
785
+ // , [this.PermisoId, this.NombreCanonicoDelModulo, this.DescripcionDelModulo, this.NombreCanonicoDelModulo, this.Enlace, this.IdDelMenuPadre]);
786
+ // this.IdDelMenuDelModulo = await this.idDelMenuDelModulo();
787
+
788
+ // let IdDelMenuAreas = await ejecutarConsultaSIGU("SELECT `MenuId` FROM `SIGU`.`SIGU_Menu` WHERE `Nombre` = 'Menú principal de áreas'\
789
+ // AND `Padre` = ?", [this.IdDelMenuDelModulo]);
790
+ // if (IdDelMenuAreas.length === 0) {
791
+ // IdDelMenuAreas = await ejecutarConsultaSIGU("SELECT MAX(`MenuId`) + 1 AS `MenuId` FROM `SIGU`.`SIGU_Menu`");
792
+ // await ejecutarConsultaSIGU("INSERT INTO `SIGU`.`SIGU_Menu` VALUES (?, ?, 'Menú principal de áreas', 'Regreso al menú principal de áreas', 'Opción Menú', 'inicio'\
793
+ // , NULL, '/modulos', ?, 0, 1, NOW(4), USER())"
794
+ // , [IdDelMenuAreas[0]['MenuId'], this.PermisoId, this.IdDelMenuDelModulo]);
795
+ // }
763
796
 
764
- // Creación del Rol-Permiso
765
- await ejecutarConsultaSIGU("INSERT INTO `SIGU`.`SIGU_RolesPermisos` VALUES (NULL, ?, ?, NOW(4), USER()) ON DUPLICATE KEY UPDATE `LastUpdate` = NOW(4)"
766
- , [this.RolId, this.PermisoId]);
767
- this.RolPermisoId = await this.rolPermisoIdDelModulo();
797
+ // let IdDelMenuRegreso1 = await ejecutarConsultaSIGU("SELECT `MenuId` FROM `SIGU`.`SIGU_Menu` WHERE `Nombre` = CONCAT('Regreso a ', ?)\
798
+ // AND `Padre` = ?", [this.MenuPadre, this.IdDelMenuDelModulo]);
799
+ // if (IdDelMenuRegreso1.length === 0) {
800
+ // IdDelMenuRegreso1 = await ejecutarConsultaSIGU("SELECT MAX(`MenuId`) + 1 AS `MenuId` FROM `SIGU`.`SIGU_Menu`");
801
+ // await ejecutarConsultaSIGU("INSERT INTO `SIGU`.`SIGU_Menu` VALUES (?, ?, CONCAT('Regreso a ', ?), CONCAT('Regreso a ', ?), 'Opción Menú', 'opciones'\
802
+ // , NULL, CONCAT('/modulos/', ?), ?, 0, 1, NOW(4), USER())"
803
+ // , [IdDelMenuRegreso1[0]['MenuId'], this.PermisoId, this.MenuPadre, this.MenuPadre, this.IdDelMenuPadre, this.IdDelMenuDelModulo]);
804
+ // }
768
805
 
769
- // Asignación del permiso a dvillalobos
770
- const perfilGeneralId = await this.perfilGeneralId();
771
- await ejecutarConsultaSIGU("INSERT INTO `SIGU`.`SIGU_RolesPersonas` VALUES (?, ?,\
772
- (SELECT `Identificador` FROM `SIGU`.`SIGU_Personas` WHERE `Identificacion` = '111050570'), NOW(4), USER())\
773
- ON DUPLICATE KEY UPDATE `LastUpdate` = NOW(4)"
774
- , [this.RolPermisoId, perfilGeneralId]);
775
-
776
- // Creación de los menús
777
- this.IdDelMenuPadre = await this.idDelMenuPadre();
778
- await ejecutarConsultaSIGU("INSERT INTO `SIGU`.`SIGU_Menu` VALUES (NULL, ?, ?, ?, 'Módulo', 'opciones', ?\
779
- , ?, ?, 0, 1, NOW(4), USER()) ON DUPLICATE KEY UPDATE `LastUpdate` = NOW(4)"
780
- , [this.PermisoId, this.NombreCanonicoDelModulo, this.DescripcionDelModulo, this.NombreCanonicoDelModulo, this.Enlace, this.IdDelMenuPadre]);
781
- this.IdDelMenuDelModulo = await this.idDelMenuDelModulo();
782
-
783
- let IdDelMenuAreas = await ejecutarConsultaSIGU("SELECT `MenuId` FROM `SIGU`.`SIGU_Menu` WHERE `Nombre` = 'Menú principal de áreas'\
784
- AND `Padre` = ?", [this.IdDelMenuDelModulo]);
785
- if (IdDelMenuAreas.length === 0) {
786
- IdDelMenuAreas = await ejecutarConsultaSIGU("SELECT MAX(`MenuId`) + 1 AS `MenuId` FROM `SIGU`.`SIGU_Menu`");
787
- await ejecutarConsultaSIGU("INSERT INTO `SIGU`.`SIGU_Menu` VALUES (?, ?, 'Menú principal de áreas', 'Regreso al menú principal de áreas', 'Opción Menú', 'inicio'\
788
- , NULL, '/modulos', ?, 0, 1, NOW(4), USER())"
789
- , [IdDelMenuAreas[0]['MenuId'], this.PermisoId, this.IdDelMenuDelModulo]);
790
- }
791
-
792
- let IdDelMenuRegreso1 = await ejecutarConsultaSIGU("SELECT `MenuId` FROM `SIGU`.`SIGU_Menu` WHERE `Nombre` = CONCAT('Regreso a ', ?)\
793
- AND `Padre` = ?", [this.MenuPadre, this.IdDelMenuDelModulo]);
794
- if (IdDelMenuRegreso1.length === 0) {
795
- IdDelMenuRegreso1 = await ejecutarConsultaSIGU("SELECT MAX(`MenuId`) + 1 AS `MenuId` FROM `SIGU`.`SIGU_Menu`");
796
- await ejecutarConsultaSIGU("INSERT INTO `SIGU`.`SIGU_Menu` VALUES (?, ?, CONCAT('Regreso a ', ?), CONCAT('Regreso a ', ?), 'Opción Menú', 'opciones'\
797
- , NULL, CONCAT('/modulos/', ?), ?, 0, 1, NOW(4), USER())"
798
- , [IdDelMenuRegreso1[0]['MenuId'], this.PermisoId, this.MenuPadre, this.MenuPadre, this.IdDelMenuPadre, this.IdDelMenuDelModulo]);
799
- }
800
-
801
- let IdDelMenuRegreso2 = await ejecutarConsultaSIGU("SELECT `MenuId` FROM `SIGU`.`SIGU_Menu` WHERE `Nombre` = CONCAT('Regreso a ', ?)\
802
- AND `Padre` = ?", [this.NombreCanonicoDelModulo, this.IdDelMenuDelModulo]);
803
- if (IdDelMenuRegreso2.length === 0) {
804
- IdDelMenuRegreso2 = await ejecutarConsultaSIGU("SELECT MAX(`MenuId`) + 1 AS `MenuId` FROM `SIGU`.`SIGU_Menu`");
805
- await ejecutarConsultaSIGU("INSERT INTO `SIGU`.`SIGU_Menu` VALUES (?, ?, CONCAT('Regreso a ', ?), CONCAT('Regreso a ', ?), 'Opción Menú', 'menus'\
806
- , NULL, CONCAT('/enlace/', ?, '/', ?), ?, 0, 1, NOW(4), USER())"
807
- , [IdDelMenuRegreso2[0]['MenuId'], this.PermisoId, this.NombreCanonicoDelModulo, this.NombreCanonicoDelModulo
808
- , this.IdDelMenuDelModulo, Buffer.from(this.Enlace.split('//')[1]).toString('base64'), this.IdDelMenuDelModulo]);
809
- }
806
+ // let IdDelMenuRegreso2 = await ejecutarConsultaSIGU("SELECT `MenuId` FROM `SIGU`.`SIGU_Menu` WHERE `Nombre` = CONCAT('Regreso a ', ?)\
807
+ // AND `Padre` = ?", [this.NombreCanonicoDelModulo, this.IdDelMenuDelModulo]);
808
+ // if (IdDelMenuRegreso2.length === 0) {
809
+ // IdDelMenuRegreso2 = await ejecutarConsultaSIGU("SELECT MAX(`MenuId`) + 1 AS `MenuId` FROM `SIGU`.`SIGU_Menu`");
810
+ // await ejecutarConsultaSIGU("INSERT INTO `SIGU`.`SIGU_Menu` VALUES (?, ?, CONCAT('Regreso a ', ?), CONCAT('Regreso a ', ?), 'Opción Menú', 'menus'\
811
+ // , NULL, CONCAT('/enlace/', ?, '/', ?), ?, 0, 1, NOW(4), USER())"
812
+ // , [IdDelMenuRegreso2[0]['MenuId'], this.PermisoId, this.NombreCanonicoDelModulo, this.NombreCanonicoDelModulo
813
+ // , this.IdDelMenuDelModulo, Buffer.from(this.Enlace.split('//')[1]).toString('base64'), this.IdDelMenuDelModulo]);
814
+ // }
810
815
 
811
816
  // Creación del UUID del módulo
812
817
  const uuidTemporal = await ejecutarConsultaSIGU("SELECT UUID() AS `UUID`");
@@ -822,33 +827,33 @@ class Miscelaneo {
822
827
  });
823
828
  }
824
829
 
825
- // Asginación inicial de permisos
826
- if (this.UsuariosConAccesoInicial.length > 0) {
827
- const rolPermisoIdDelPadre = await this.rolPermisoIdDelMenuPadre();
828
- this.UsuariosConAccesoInicial.forEach(async (dato) => {
829
- await ejecutarConsultaSIGU("INSERT INTO `SIGU`.`SIGU_RolesPersonas` VALUES (?, ?,\
830
- (SELECT `Identificador` FROM `SIGU`.`SIGU_Personas` WHERE `Identificacion` = ?), NOW(4), USER())\
831
- ON DUPLICATE KEY UPDATE `LastUpdate` = NOW(4)"
832
- , [this.RolPermisoId, perfilGeneralId, dato]);
833
- await ejecutarConsultaSIGU("INSERT INTO `SIGU`.`SIGU_RolesPersonas` VALUES (?, ?,\
834
- (SELECT `Identificador` FROM `SIGU`.`SIGU_Personas` WHERE `Identificacion` = ?), NOW(4), USER())\
835
- ON DUPLICATE KEY UPDATE `LastUpdate` = NOW(4)"
836
- , [rolPermisoIdDelPadre, perfilGeneralId, dato]);
837
- });
838
- }
830
+ // // Asginación inicial de permisos
831
+ // if (this.UsuariosConAccesoInicial.length > 0) {
832
+ // const rolPermisoIdDelPadre = await this.rolPermisoIdDelMenuPadre();
833
+ // this.UsuariosConAccesoInicial.forEach(async (dato) => {
834
+ // await ejecutarConsultaSIGU("INSERT INTO `SIGU`.`SIGU_RolesPersonas` VALUES (?, ?,\
835
+ // (SELECT `Identificador` FROM `SIGU`.`SIGU_Personas` WHERE `Identificacion` = ?), NOW(4), USER())\
836
+ // ON DUPLICATE KEY UPDATE `LastUpdate` = NOW(4)"
837
+ // , [this.RolPermisoId, perfilGeneralId, dato]);
838
+ // await ejecutarConsultaSIGU("INSERT INTO `SIGU`.`SIGU_RolesPersonas` VALUES (?, ?,\
839
+ // (SELECT `Identificador` FROM `SIGU`.`SIGU_Personas` WHERE `Identificacion` = ?), NOW(4), USER())\
840
+ // ON DUPLICATE KEY UPDATE `LastUpdate` = NOW(4)"
841
+ // , [rolPermisoIdDelPadre, perfilGeneralId, dato]);
842
+ // });
843
+ // }
839
844
 
840
- // Impresión de la información de registro
841
- console.log(new Date());
842
- console.log(`Módulo registrado correctamente en SIGU. Módulo: ${this.NombreCanonicoDelModulo}`);
843
- console.log(`Identificador de rol a utilizar (RolId): ${this.RolId}`);
844
- console.log(`Identificador de permiso a utilizar (PermisoId): ${this.PermisoId}`);
845
- console.log(`Identificador de Rol-Permiso a utilizar (RolPermisoId): ${this.RolPermisoId}`);
846
- console.log(`Identificador del menú padre (MenuId del padre): ${this.IdDelMenuPadre}`);
847
- console.log(`Identificador del menú (MenuId del módulo): ${this.IdDelMenuDelModulo}`);
848
- // console.log(`Identificador del flujo de aprobación: ${await this.idDelFlujoDeAprobacion()}`);
849
- console.log(`Enlace del módulo: ${this.Enlace}`);
850
- this.creacionDeldirectorioParaElAlmacenamientoDeArchivos();
851
- console.log(`Versión del núcleo: ${this.versionDelNucleo()}`);
845
+ // // Impresión de la información de registro
846
+ // console.log(new Date());
847
+ // console.log(`Módulo registrado correctamente en SIGU. Módulo: ${this.NombreCanonicoDelModulo}`);
848
+ // console.log(`Identificador de rol a utilizar (RolId): ${this.RolId}`);
849
+ // console.log(`Identificador de permiso a utilizar (PermisoId): ${this.PermisoId}`);
850
+ // console.log(`Identificador de Rol-Permiso a utilizar (RolPermisoId): ${this.RolPermisoId}`);
851
+ // console.log(`Identificador del menú padre (MenuId del padre): ${this.IdDelMenuPadre}`);
852
+ // console.log(`Identificador del menú (MenuId del módulo): ${this.IdDelMenuDelModulo}`);
853
+ // // console.log(`Identificador del flujo de aprobación: ${await this.idDelFlujoDeAprobacion()}`);
854
+ // console.log(`Enlace del módulo: ${this.Enlace}`);
855
+ // this.creacionDeldirectorioParaElAlmacenamientoDeArchivos();
856
+ // console.log(`Versión del núcleo: ${this.versionDelNucleo()}`);
852
857
 
853
858
  // Creación de variables de entorno
854
859
  process.env.SERVIDORSMTP = await this.servidorSMTP();
@@ -1916,12 +1921,12 @@ class Miscelaneo {
1916
1921
  }
1917
1922
  }
1918
1923
 
1919
- async obtenerEnlaceDelModuloPadre() {
1920
- const Ruta = await ejecutarConsultaSIGU("SELECT CONCAT('modulos/', `MenuId`) AS `Ruta` FROM `SIGU`.`SIGU_Menu`\
1921
- WHERE `MenuId` = (SELECT `Padre` FROM `SIGU`.`SIGU_Menu` WHERE `Nombre` = ?)"
1922
- , [this.NombreCanonicoDelModulo]);
1923
- return await this.obtenerEnlaceDePortal() + "/" + Ruta[0]['Ruta'];
1924
- }
1924
+ // async obtenerEnlaceDelModuloPadre() {
1925
+ // const Ruta = await ejecutarConsultaSIGU("SELECT CONCAT('modulos/', `MenuId`) AS `Ruta` FROM `SIGU`.`SIGU_Menu`\
1926
+ // WHERE `MenuId` = (SELECT `Padre` FROM `SIGU`.`SIGU_Menu` WHERE `Nombre` = ?)"
1927
+ // , [this.NombreCanonicoDelModulo]);
1928
+ // return await this.obtenerEnlaceDePortal() + "/" + Ruta[0]['Ruta'];
1929
+ // }
1925
1930
 
1926
1931
  async obtenerEnlaceDePortal() {
1927
1932
  return this.EnlaceDePortal;
@@ -33,6 +33,11 @@ export class ContenedorComponentesComponent {
33
33
  }
34
34
  }
35
35
 
36
+ obtenerMensajesModularesVisualizados(): string[] {
37
+ const datos = localStorage.getItem('MensajesModularesVisualizados');
38
+ return datos ? JSON.parse(datos) : [];
39
+ }
40
+
36
41
  ngOnInit() {
37
42
  const url = window.location.href.toLowerCase();
38
43
  if (url.includes('calidad')) {
@@ -79,7 +84,7 @@ export class ContenedorComponentesComponent {
79
84
  onClose: () => { this.datosGlobalesService.RedirigirALogin() },
80
85
  onAccept: () => {
81
86
  this.http.post(`${this.datosGlobalesService.ObtenerURL()}ConsentimientoInformado/AceptarConsentimientoInformado`
82
- , { ConsentimientoInformadoId })
87
+ , { ConsentimientoInformadoId })
83
88
  .subscribe({
84
89
  next: (datos: any) => {
85
90
  // this.obtenerDatosParaPoblarLaTabla();
@@ -93,6 +98,27 @@ export class ContenedorComponentesComponent {
93
98
  });
94
99
  }
95
100
  });
101
+ this.http.get(this.datosGlobalesService.ObtenerURL() + 'misc/obtenerMensajesModulares').subscribe((datos: any) => {
102
+ let mensajesVisualizados = this.obtenerMensajesModularesVisualizados();
103
+ for (let contador = 0; contador < datos.body.length; contador++) {
104
+ const index = mensajesVisualizados.indexOf(datos.body[contador]['MensajeModularlId']);
105
+ if (index === -1) {
106
+ this.dialog.open(MensajeConfirmacionHTMLComponent, {
107
+ data: {
108
+ titulo: datos.body[contador]['Titulo'],
109
+ mensaje: datos.body[contador]['Texto'],
110
+ textoAceptar: 'Cerrar',
111
+ onClose: () => { },
112
+ onAccept: () => {
113
+ let mensajesVisualizados = this.obtenerMensajesModularesVisualizados();
114
+ mensajesVisualizados.push(datos.body[contador]['MensajeModularlId']);
115
+ localStorage.setItem('MensajesModularesVisualizados', JSON.stringify(mensajesVisualizados));
116
+ },
117
+ },
118
+ });
119
+ }
120
+ }
121
+ });
96
122
  }
97
123
 
98
124
  irAtras(): void {