From f5dec0c746be725a56227b18532f93be5af8a3df Mon Sep 17 00:00:00 2001 From: "choi.jh" Date: Tue, 23 Sep 2025 11:46:29 +0900 Subject: [PATCH] dbmsv2 init...1 --- app/Services/Customer/Service/PaymentService.php | 6 +++--- app/Services/Customer/Service/ServerService.php | 6 +++--- app/Services/Customer/ServiceService.php | 1 + app/Services/Equipment/ServerPart/CSService.php | 2 +- app/Services/Equipment/ServerPart/IPService.php | 2 +- app/Services/Equipment/ServerPart/PartService.php | 2 +- app/Services/Equipment/ServerPart/PaymentService.php | 4 ++-- app/Services/Equipment/ServerPart/SwitchService.php | 2 +- app/Services/Equipment/ServerPartService.php | 3 +++ app/Services/Equipment/ServerService.php | 5 ----- 10 files changed, 16 insertions(+), 17 deletions(-) diff --git a/app/Services/Customer/Service/PaymentService.php b/app/Services/Customer/Service/PaymentService.php index 5782050..b8862b4 100644 --- a/app/Services/Customer/Service/PaymentService.php +++ b/app/Services/Customer/Service/PaymentService.php @@ -28,7 +28,7 @@ class PaymentService extends ParentService implements ServiceInterface public function createService(ServiceEntity $serviceEntity): ServiceEntity { //필수정보처리 후 결제정보등록 - $entity = $this->create($this->action_process($serviceEntity)); + $entity = parent::create($this->action_process($serviceEntity)); //서비스정보 Entity에 결제정보 설정 return $serviceEntity->setPaymentEntity($entity); } @@ -37,14 +37,14 @@ class PaymentService extends ParentService implements ServiceInterface //결제정보 가져오기 $entity = $serviceEntity->getPaymentEntity(); if (!$entity instanceof PaymentEntity) { - throw new \Exception(__METHOD__ . "에서 오류발생: {$serviceEntity->getPK()}에 해당하는 결제정보를 찾을수 없습니다."); + throw new \Exception(__METHOD__ . "에서 오류발생: 서비스정보[{$serviceEntity->getPK()}]에 해당하는 결제정보를 찾을수 없습니다."); } //미납상태확인 if ($entity->getStatus() !== STATUS['UNPAID']) { throw new \Exception(__METHOD__ . "에서 오류발생: 완료된 결제는 수정이 불가합니다."); } //필수정보처리 후 결제정보수정 - $entity = $this->modify($entity, $this->action_process($serviceEntity)); + $entity = parent::modify($entity, $this->action_process($serviceEntity)); //서비스정보 Entity에 결제정보 설정 return $serviceEntity->setPaymentEntity($entity); } diff --git a/app/Services/Customer/Service/ServerService.php b/app/Services/Customer/Service/ServerService.php index 31e5eef..bf9387d 100644 --- a/app/Services/Customer/Service/ServerService.php +++ b/app/Services/Customer/Service/ServerService.php @@ -20,12 +20,12 @@ class ServerService extends ParentService implements ServiceInterface throw new \Exception(__METHOD__ . "에서 오류발생: 서버상태가 설정되지 않았습니다."); } //서버정보 가져오기 - $entity = $this->getEntity(['serviceinfo_uid' => $serviceEntity->getPK()]); + $entity = $serviceEntity->getServerEntity(); if (!$entity instanceof ServerEntity) { - throw new \Exception("서비스정보[{$serviceEntity->getPK()}]에 해당하는 서버정보를 찾을수없습니다."); + throw new \Exception(__METHOD__ . "에서 오류발생: 서비스정보[{$serviceEntity->getPK()}]에 해당하는 서버정보를 찾을수없습니다."); } //서버정보 수정 - return $this->modify($entity, $formDatas); + return parent::modify($entity, $formDatas); } public function createService(ServiceEntity $serviceEntity): ServiceEntity { diff --git a/app/Services/Customer/ServiceService.php b/app/Services/Customer/ServiceService.php index 957a2e3..d6fc256 100644 --- a/app/Services/Customer/ServiceService.php +++ b/app/Services/Customer/ServiceService.php @@ -221,6 +221,7 @@ class ServiceService extends CustomerService $entity = $this->getServerService()->$action($entity); $entity = $this->getPaymentService()->$action($entity); //결제정보PK정의 + dd($entity); $entity = parent::modify($entity, ['payment_uid' => $entity->getPaymentEntity()->getPK()]); return $entity; } diff --git a/app/Services/Equipment/ServerPart/CSService.php b/app/Services/Equipment/ServerPart/CSService.php index 1a0be2c..66599d1 100644 --- a/app/Services/Equipment/ServerPart/CSService.php +++ b/app/Services/Equipment/ServerPart/CSService.php @@ -26,7 +26,7 @@ class CSService extends ParentService implements ServerPartInterface throw new \Exception("{$serverPartEntity->getPartUID()}에 해당하는 CS정보를 찾을수없습니다."); } //CS정보 수정 - return $this->modify($entity, $formDatas); + return parent::modify($entity, $formDatas); } public function createServerPart(ServerPartEntity $serverPartEntity): ServerPartEntity { diff --git a/app/Services/Equipment/ServerPart/IPService.php b/app/Services/Equipment/ServerPart/IPService.php index 0e9f737..1034760 100644 --- a/app/Services/Equipment/ServerPart/IPService.php +++ b/app/Services/Equipment/ServerPart/IPService.php @@ -26,7 +26,7 @@ class IPService extends ParentService implements ServerPartInterface throw new \Exception("{$serverPartEntity->getPartUID()}에 해당하는 IP정보를 찾을수없습니다."); } //IP정보 수정 - return $this->modify($entity, $formDatas); + return parent::modify($entity, $formDatas); } public function createServerPart(ServerPartEntity $serverPartEntity): ServerPartEntity { diff --git a/app/Services/Equipment/ServerPart/PartService.php b/app/Services/Equipment/ServerPart/PartService.php index daee1af..e28c946 100644 --- a/app/Services/Equipment/ServerPart/PartService.php +++ b/app/Services/Equipment/ServerPart/PartService.php @@ -33,7 +33,7 @@ class PartService extends ParentService implements ServerPartInterface } $formDatas['stock'] = $entity->getStock() - $serverPartEntity->getCnt(); } - return $this->modify($entity, $formDatas); + return parent::modify($entity, $formDatas); } public function createServerPart(ServerPartEntity $serverPartEntity): ServerPartEntity diff --git a/app/Services/Equipment/ServerPart/PaymentService.php b/app/Services/Equipment/ServerPart/PaymentService.php index 136a29d..4595492 100644 --- a/app/Services/Equipment/ServerPart/PaymentService.php +++ b/app/Services/Equipment/ServerPart/PaymentService.php @@ -40,7 +40,7 @@ class PaymentService extends ParentService implements ServerPartInterface //당일결체일로 설정 $formDatas['billing_at'] = date("Y-m-d"); //결제정보등록 - $entity = $this->create($formDatas); + $entity = parent::create($formDatas); //서버연결정보 Entity에 결제정보 설정 return $serverPartEntity->setPaymentEntity($entity); } @@ -54,7 +54,7 @@ class PaymentService extends ParentService implements ServerPartInterface //필수정보처리 후 FormData 가져오기 $formDatas = $this->action_process($serverPartEntity); //결제정보수정 - $entity = $this->modify($entity, $formDatas); + $entity = parent::modify($entity, $formDatas); //서버연결정보 Entity에 결제정보 설정 return $serverPartEntity->setPaymentEntity($entity); } diff --git a/app/Services/Equipment/ServerPart/SwitchService.php b/app/Services/Equipment/ServerPart/SwitchService.php index c13837a..12fa329 100644 --- a/app/Services/Equipment/ServerPart/SwitchService.php +++ b/app/Services/Equipment/ServerPart/SwitchService.php @@ -26,7 +26,7 @@ class SwitchService extends ParentService implements ServerPartInterface throw new \Exception("{$serverPartEntity->getPartUID()}에 해당하는 Switch정보를 찾을수없습니다."); } //Switch정보 수정 - return $this->modify($entity, $formDatas); + return parent::modify($entity, $formDatas); } public function createServerPart(ServerPartEntity $serverPartEntity): ServerPartEntity { diff --git a/app/Services/Equipment/ServerPartService.php b/app/Services/Equipment/ServerPartService.php index c30fa1e..ed298d5 100644 --- a/app/Services/Equipment/ServerPartService.php +++ b/app/Services/Equipment/ServerPartService.php @@ -166,6 +166,9 @@ class ServerPartService extends EquipmentService public function getFormOption(string $field, array $options = []): array { switch ($field) { + case 'serverinfo_uid': + $options = $this->getServerService()->getEntities(); + break; case 'part_uid': $partOptions = []; foreach (SERVERPART['ALL_PARTTYPES'] as $partType) { diff --git a/app/Services/Equipment/ServerService.php b/app/Services/Equipment/ServerService.php index 716120f..0ddb581 100644 --- a/app/Services/Equipment/ServerService.php +++ b/app/Services/Equipment/ServerService.php @@ -157,11 +157,6 @@ class ServerService extends EquipmentService } return $formDatas; } - // 수정 - public function modify(mixed $entity, array $formDatas): ServerEntity - { - return parent::modify($entity, $formDatas); - } //삭제 public function delete(mixed $entity): ServerEntity {