dbmsv3 init...1

This commit is contained in:
choi.jh 2025-10-28 14:42:32 +09:00
parent 377a08ecad
commit 07c98fa942
7 changed files with 28 additions and 30 deletions

File diff suppressed because one or more lines are too long

View File

@ -200,7 +200,6 @@ class ServerPartService extends EquipmentService implements ServerPartInterface
$partEntity = $this->getPartService($parttype)->getEntity($part['UID']);
//해당 파트정보 가져오기
$formDatas = [];
$formDatas['serverinfo_uid'] = $serverEntity->getPK();
$formDatas["part_uid"] = $partEntity->getPK();
$formDatas['billing'] = PAYMENT['BILLING']['BASE'];
$formDatas['type'] = $parttype;
@ -208,9 +207,7 @@ class ServerPartService extends EquipmentService implements ServerPartInterface
$formDatas['amount'] = $partEntity->getPrice(); //파트 금액
$formDatas['cnt'] = $part["CNT"];
$formDatas['extra'] = $part["EXTRA"];
//서버연결정보 생성
$serverPartEntity = parent::create($formDatas);
$partEntity = $this->getPartService($parttype)->attachToServerPart($serverPartEntity);
$this->create($formDatas);
}
}
}

View File

@ -117,7 +117,7 @@ class CSService extends PartService
if ($entity->getStatus() !== STATUS['AVAILABLE']) {
throw new \Exception(__METHOD__ . ":에서 오류발생: {$serverPartEntity->getTitle()}는 사용중입니다.");
}
$entity = parent::modify($entity, $formDatas);
$entity = $this->modify($entity, $formDatas);
}
return $entity;
}
@ -137,6 +137,6 @@ class CSService extends PartService
throw new \Exception("{$serverPartEntity->getPartUID()}에 해당하는 CS정보를 찾을수없습니다.");
}
//CS정보 수정
return parent::modify($entity, $formDatas);
return $this->modify($entity, $formDatas);
}
}

View File

@ -67,6 +67,6 @@ class DISKService extends PartService
if ($entity->getStock() < $serverPartEntity->getCnt()) {
throw new \Exception("현재 재고수[{$entity->getStock()}]보다 지정하신 갯수({$serverPartEntity->getCnt()})가 더 많습니다.");
}
return parent::modify($entity, ['format' => $entity->getFormat() + $serverPartEntity->getCnt()]);
return $this->modify($entity, ['format' => $entity->getFormat() + $serverPartEntity->getCnt()]);
}
}

View File

@ -127,7 +127,7 @@ class IPService extends PartService implements IPInterface
if ($entity->getStatus() !== STATUS['AVAILABLE']) {
throw new \Exception(__METHOD__ . ":에서 오류발생: {$serverEntity->getTitle()}는 사용중입니다.");
}
return parent::modify($entity, $formDatas);
return $this->modify($entity, $formDatas);
}
public function detachFromServer(ServerEntity $serverEntity): IPEntity
{
@ -143,7 +143,7 @@ class IPService extends PartService implements IPInterface
throw new \Exception("{$serverEntity->getIP()}에 해당하는 IP정보를 찾을수없습니다.");
}
//IP정보 수정
return parent::modify($entity, $formDatas);
return $this->modify($entity, $formDatas);
}
//서버파트관련 작업
public function attachToServerPart(ServerPartEntity $serverPartEntity): IPEntity
@ -159,7 +159,7 @@ class IPService extends PartService implements IPInterface
if ($entity->getStatus() !== STATUS['AVAILABLE']) {
throw new \Exception(__METHOD__ . ":에서 오류발생: {$entity->getTitle()}는 사용중입니다.");
}
$entity = parent::modify($entity, $formDatas);
$entity = $this->modify($entity, $formDatas);
}
return $entity;
}
@ -177,6 +177,6 @@ class IPService extends PartService implements IPInterface
throw new \Exception("{$serverPartEntity->getPartUID()}에 해당하는 IP정보를 찾을수없습니다.");
}
//IP정보 수정
return parent::modify($entity, $formDatas);
return $this->modify($entity, $formDatas);
}
}

View File

@ -28,7 +28,7 @@ abstract class PartService extends CommonService implements PartInterface
if ($entity->getStock() < $serverPartEntity->getCnt()) {
throw new \Exception("현재 재고수[{$entity->getStock()}]보다 지정하신 갯수({$serverPartEntity->getCnt()})가 더 많습니다.");
}
return parent::modify($entity, ['stock' => $entity->getStock() - $serverPartEntity->getCnt()]);
return $this->modify($entity, ['stock' => $entity->getStock() - $serverPartEntity->getCnt()]);
}
public function detachFromServerPart(ServerPartEntity $serverPartEntity): mixed
{
@ -41,6 +41,6 @@ abstract class PartService extends CommonService implements PartInterface
if ($entity->getStock() < $serverPartEntity->getCnt()) {
throw new \Exception("현재 재고수[{$entity->getStock()}]보다 지정하신 갯수({$serverPartEntity->getCnt()})가 더 많습니다.");
}
return parent::modify($entity, ['stock' => $entity->getStock() + $serverPartEntity->getCnt()]);
return $this->modify($entity, ['stock' => $entity->getStock() + $serverPartEntity->getCnt()]);
}
}

View File

@ -109,7 +109,7 @@ class SWITCHService extends PartService implements SWITCHInterface
if ($entity->getStatus() !== STATUS['AVAILABLE']) {
throw new \Exception(__METHOD__ . ":에서 오류발생: {$serverEntity->getTitle()}는 사용중입니다.");
}
return parent::modify($entity, $formDatas);
return $this->modify($entity, $formDatas);
}
public function detachFromServer(ServerEntity $serverEntity): SWITCHEntity
{
@ -128,7 +128,7 @@ class SWITCHService extends PartService implements SWITCHInterface
throw new \Exception("{$serverEntity->getSwitch()}에 해당하는 Switch정보를 찾을수없습니다.");
}
//Switch정보 수정
return parent::modify($entity, $formDatas);
return $this->modify($entity, $formDatas);
}
//서버파트관련 작업
public function attachToServerPart(ServerPartEntity $serverPartEntity): SWITCHEntity
@ -147,7 +147,7 @@ class SWITCHService extends PartService implements SWITCHInterface
if ($entity->getStatus() !== STATUS['AVAILABLE']) {
throw new \Exception(__METHOD__ . ":에서 오류발생: {$entity->getTitle()}는 사용중입니다.");
}
$entity = parent::modify($entity, $formDatas);
$entity = $this->modify($entity, $formDatas);
}
return $entity;
}
@ -167,6 +167,7 @@ class SWITCHService extends PartService implements SWITCHInterface
if (!$entity instanceof SWITCHEntity) {
throw new \Exception("{$serverPartEntity->getPartUID()}에 해당하는 Switch정보를 찾을수없습니다.");
}
return $entity;
//Switch정보 수정
return $this->modify($entity, $formDatas);
}
}