From 53f22f3b210347ee155aaebce22c4a6f403b3a05 Mon Sep 17 00:00:00 2001 From: jmbardallo Date: Fri, 8 May 2026 10:37:41 +0200 Subject: [PATCH] =?UTF-8?q?eliminada=20relaci=C3=B3n=20de=20los=20perfiles?= =?UTF-8?q?=20software=20y=20los=20softwares=20con=20las=20OU,=20en=20la?= =?UTF-8?q?=20nueva=20version=20no=20existe=20dicha=20relacion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...grateSoftwareAndSoftwareProfileCommand.php | 37 +++---------------- 1 file changed, 5 insertions(+), 32 deletions(-) diff --git a/src/Command/Migration/MigrateSoftwareAndSoftwareProfileCommand.php b/src/Command/Migration/MigrateSoftwareAndSoftwareProfileCommand.php index 0ae8aac..a3ce7e7 100644 --- a/src/Command/Migration/MigrateSoftwareAndSoftwareProfileCommand.php +++ b/src/Command/Migration/MigrateSoftwareAndSoftwareProfileCommand.php @@ -71,18 +71,6 @@ class MigrateSoftwareAndSoftwareProfileCommand extends Command $softwareEntity->setType($type); } - $migrationId = match ($software['softwares.grupoid']) { - 0 => OrganizationalUnitTypes::ORGANIZATIONAL_UNIT . '-' . $software['softwares.idcentro'], - default => OrganizationalUnitTypes::CLASSROOMS_GROUP . '-' . $software['softwares.grupoid'], - }; - - $organizationalUnit = $organizationalUnitRepository->findOneBy(['migrationId' => $migrationId]); - - /* - if ($organizationalUnit){ - $softwareEntity->setOrganizationalUnit($organizationalUnit); - }*/ - $this->entityManager->persist($softwareEntity); } @@ -90,13 +78,10 @@ class MigrateSoftwareAndSoftwareProfileCommand extends Command $rsmSoftwareProfiles = new ResultSetMapping(); $rsmSoftwareProfiles->addScalarResult('idperfilsoft', 'idperfilsoft'); $rsmSoftwareProfiles->addScalarResult('descripcion', 'descripcion'); - $rsmSoftwareProfiles->addScalarResult('comentarios', 'perfilessoft.comentarios'); - $rsmSoftwareProfiles->addScalarResult('grupoid', 'perfilessoft.grupoid'); - $rsmSoftwareProfiles->addScalarResult('idcentro', 'perfilessoft.idcentro'); - $rsmSoftwareProfiles->addScalarResult('idnombreso', 'perfilessoft.idnombreso'); + $rsmSoftwareProfiles->addScalarResult('comentarios', 'comentarios'); + $rsmSoftwareProfiles->addScalarResult('idnombreso', 'idnombreso'); - - $softwareProfilesQuery = $oldDatabaseEntityManager->createNativeQuery('SELECT idperfilsoft, descripcion, grupos.comentarios, perfilessoft.grupoid, perfilessoft.idcentro, perfilessoft.idnombreso FROM perfilessoft LEFT JOIN grupos ON perfilessoft.grupoid = grupos.idgrupo', $rsmSoftwareProfiles); + $softwareProfilesQuery = $oldDatabaseEntityManager->createNativeQuery('SELECT idperfilsoft, descripcion, comentarios, idnombreso FROM perfilessoft', $rsmSoftwareProfiles); $softwareProfiles = $softwareProfilesQuery->getResult(); /** Perfiles software **/ @@ -108,22 +93,10 @@ class MigrateSoftwareAndSoftwareProfileCommand extends Command $softwareProfileEntity = new SoftwareProfile(); $softwareProfileEntity->setMigrationId($softwareProfile['idperfilsoft']); $softwareProfileEntity->setDescription($softwareProfile['descripcion']); - $softwareProfileEntity->setComments($softwareProfile['perfilessoft.comentarios']); + $softwareProfileEntity->setComments($softwareProfile['comentarios']); } - $migrationId = match ($softwareProfile['perfilessoft.grupoid']) { - 0 => OrganizationalUnitTypes::ORGANIZATIONAL_UNIT . '-' . $softwareProfile['perfilessoft.idcentro'], - default => OrganizationalUnitTypes::CLASSROOMS_GROUP . '-' . $softwareProfile['perfilessoft.grupoid'], - }; - - $organizationalUnit = $organizationalUnitRepository->findOneBy(['migrationId' => $migrationId]); - - /* - if ($organizationalUnit){ - $softwareProfileEntity->setOrganizationalUnit($organizationalUnit); - }*/ - - $operativeSystem = $operativeSystemRepository->findOneBy(['migrationId' => $softwareProfile['perfilessoft.idnombreso']]); + $operativeSystem = $operativeSystemRepository->findOneBy(['migrationId' => $softwareProfile['idnombreso']]); if ($operativeSystem){ $softwareProfileEntity->setOperativeSystem($operativeSystem);