dbmsv2 init...1

This commit is contained in:
choi.jh 2025-09-22 11:57:09 +09:00
parent 6215425f05
commit 1abad587a1
13 changed files with 96 additions and 74 deletions

View File

@ -4,13 +4,13 @@
"settings": { "settings": {
"width": 3000, "width": 3000,
"height": 3000, "height": 3000,
"scrollTop": -1869.8503, "scrollTop": -1069.8503,
"scrollLeft": -1623, "scrollLeft": -549.5033,
"zoomLevel": 0.79, "zoomLevel": 0.79,
"show": 511, "show": 511,
"database": 4, "database": 4,
"databaseName": "", "databaseName": "",
"canvasType": "@dineug/erd-editor/builtin-schema-sql", "canvasType": "ERD",
"language": 1, "language": 1,
"tableNameCase": 4, "tableNameCase": 4,
"columnNameCase": 2, "columnNameCase": 2,

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -42,10 +42,6 @@ class ServiceEntity extends CustomerEntity
{ {
return $this->attributes['payment_uid'] ?? null; return $this->attributes['payment_uid'] ?? null;
} }
final public function getServerInfoUID(): string
{
return $this->attributes['serverinfo_uid'];
}
//기본기능용 //기본기능용
final public function getSite(): string final public function getSite(): string

View File

@ -9,15 +9,15 @@ class CSEntity extends EquipmentEntity
const PK = CSModel::PK; const PK = CSModel::PK;
const TITLE = CSModel::TITLE; const TITLE = CSModel::TITLE;
const DEFAULT_STATUS = STATUS['AVAILABLE']; const DEFAULT_STATUS = STATUS['AVAILABLE'];
final public function getClientInfoUID(): string final public function getClientInfoUID(): string|null
{ {
return $this->attributes['clientinfo_uid']; return $this->attributes['clientinfo_uid'];
} }
final public function getServiceInfoUID(): string final public function getServiceInfoUID(): string|null
{ {
return $this->attributes['serviceinfo_uid']; return $this->attributes['serviceinfo_uid'];
} }
final public function getServerInfoUID(): string final public function getServerInfoUID(): string|null
{ {
return $this->attributes['serverinfo_uid']; return $this->attributes['serverinfo_uid'];
} }

View File

@ -9,15 +9,19 @@ class IPEntity extends EquipmentEntity
const PK = IPModel::PK; const PK = IPModel::PK;
const TITLE = IPModel::TITLE; const TITLE = IPModel::TITLE;
const DEFAULT_STATUS = STATUS['AVAILABLE']; const DEFAULT_STATUS = STATUS['AVAILABLE'];
final public function getClientInfoUID(): string final public function getClientInfoUID(): string|null
{ {
return $this->attributes['clientinfo_uid']; return $this->attributes['clientinfo_uid'];
} }
final public function getServiceInfoUID(): string final public function getOldClientInfoUID(): string|null
{
return $this->attributes['old_clientinfo_uid'];
}
final public function getServiceInfoUID(): string|null
{ {
return $this->attributes['serviceinfo_uid']; return $this->attributes['serviceinfo_uid'];
} }
final public function getServerInfoUID(): string final public function getServerInfoUID(): string|null
{ {
return $this->attributes['serverinfo_uid']; return $this->attributes['serverinfo_uid'];
} }
@ -25,10 +29,6 @@ class IPEntity extends EquipmentEntity
{ {
return $this->attributes['lineinfo_uid']; return $this->attributes['lineinfo_uid'];
} }
final public function getOldClientInfoUID(): string
{
return $this->attributes['old_clientinfo_uid'];
}
//기본기능 //기본기능
public function getIP(): string public function getIP(): string
{ {

View File

@ -9,15 +9,11 @@ class ServerEntity extends EquipmentEntity
const PK = ServerModel::PK; const PK = ServerModel::PK;
const TITLE = ServerModel::TITLE; const TITLE = ServerModel::TITLE;
const DEFAULT_STATUS = STATUS['AVAILABLE']; const DEFAULT_STATUS = STATUS['AVAILABLE'];
final public function getUserUID(): string final public function getClientInfoUID(): string|null
{
return $this->attributes['user_uid'];
}
final public function getClientInfoUID(): string
{ {
return $this->attributes['clientinfo_uid']; return $this->attributes['clientinfo_uid'];
} }
final public function getServiceInfoUID(): string final public function getServiceInfoUID(): string|null
{ {
return $this->attributes['serviceinfo_uid']; return $this->attributes['serviceinfo_uid'];
} }

View File

@ -32,15 +32,15 @@ class ServerPartEntity extends EquipmentEntity
{ {
return intval($this->attributes['part_uid']) ?? 0; return intval($this->attributes['part_uid']) ?? 0;
} }
final public function getUserUID(): string final public function getUserUID(): string|null
{ {
return $this->attributes['user_uid']; return $this->attributes['user_uid'];
} }
final public function getClientInfoUID(): string final public function getClientInfoUID(): string|null
{ {
return $this->attributes['clientinfo_uid']; return $this->attributes['clientinfo_uid'];
} }
final public function getServiceInfoUID(): string final public function getServiceInfoUID(): string|null
{ {
return $this->attributes['serviceinfo_uid']; return $this->attributes['serviceinfo_uid'];
} }

View File

@ -9,15 +9,15 @@ class SwitchEntity extends EquipmentEntity
const PK = SwitchModel::PK; const PK = SwitchModel::PK;
const TITLE = SwitchModel::TITLE; const TITLE = SwitchModel::TITLE;
const DEFAULT_STATUS = STATUS['AVAILABLE']; const DEFAULT_STATUS = STATUS['AVAILABLE'];
final public function getClientInfoUID(): string final public function getClientInfoUID(): string|null
{ {
return $this->attributes['clientinfo_uid']; return $this->attributes['clientinfo_uid'];
} }
final public function getServiceInfoUID(): string final public function getServiceInfoUID(): string|null
{ {
return $this->attributes['serviceinfo_uid']; return $this->attributes['serviceinfo_uid'];
} }
final public function getServerInfoUID(): string final public function getServerInfoUID(): string|null
{ {
return $this->attributes['serverinfo_uid']; return $this->attributes['serverinfo_uid'];
} }

View File

@ -143,13 +143,19 @@ abstract class CommonService
{ {
return $entity; return $entity;
} }
final public function getEntity(mixed $where, ?string $message = null): mixed final public function getEntity(string|int|array $where, ?string $message = null): mixed
{ {
try { try {
$entity = is_array($where) ? $this->getModel()->where($where)->first() : $this->getModel()->find($where); $entity = is_array($where) ? $this->getModel()->where($where)->first() : $this->getModel()->find($where);
if (!$entity) { if (!$entity) {
return null; return null;
} }
if (is_array($entity)) {
var_export($where);
echo $this->getModel()->getLastQuery();
dd($entity);
throw new \Exception("오류결과:\n" . var_export($entity));
}
return $this->getEntity_process($entity); return $this->getEntity_process($entity);
} catch (\Exception $e) { } catch (\Exception $e) {
$message = sprintf( $message = sprintf(

View File

@ -108,9 +108,11 @@ class ServiceService extends CustomerService
$entity->setServerEntity($serverEntity); $entity->setServerEntity($serverEntity);
} }
//결제정보 정의 //결제정보 정의
$paymentEntity = $this->getPaymentService()->getEntity(['uid' => $entity->getPaymentInfoUID()]); if ($entity->getPaymentInfoUID()) {
if ($paymentEntity instanceof PaymentEntity) { $paymentEntity = $this->getPaymentService()->getEntity($entity->getPaymentInfoUID());
$entity->setPaymentEntity($paymentEntity); if ($paymentEntity instanceof PaymentEntity) {
$entity->setPaymentEntity($paymentEntity);
}
} }
return $entity; return $entity;
} }
@ -235,7 +237,7 @@ class ServiceService extends CustomerService
//신규등록 //신규등록
$entity = parent::create($formDatas); $entity = parent::create($formDatas);
//월청구액계산 후 서비스정보에 수정 //월청구액계산 후 서비스정보에 수정
$entity = parent::modify($entity, ['amount' => $this->getServerService()->getTotalAmount($entity->getServerInfoUID())]); $entity = parent::modify($entity, ['amount' => $this->getServerService()->getTotalAmount($formDatas['serverinfo_uid'])]);
$this->action_process($entity, __FUNCTION__ . 'Service'); $this->action_process($entity, __FUNCTION__ . 'Service');
return $entity; return $entity;
} }

View File

@ -19,9 +19,9 @@ class Service extends ServerService implements ServiceInterface
throw new \Exception(__METHOD__ . "에서 오류발생: 서버상태가 설정되지 않았습니다."); throw new \Exception(__METHOD__ . "에서 오류발생: 서버상태가 설정되지 않았습니다.");
} }
//서버정보 가져오기 //서버정보 가져오기
$entity = $this->getEntity($serviceEntity->getServerInfoUID()); $entity = $this->getEntity(['serviceinfo_uid' => $serviceEntity->getPK()]);
if (!$entity instanceof ServerEntity) { if (!$entity instanceof ServerEntity) {
throw new \Exception("{$serviceEntity->getServerInfoUID()}에 해당하는 서버정보를 찾을수없습니다."); throw new \Exception("서비스정보[{$serviceEntity->getPK()}]에 해당하는 서버정보를 찾을수없습니다.");
} }
//서버정보 수정 //서버정보 수정
return $this->modify($entity, $formDatas); return $this->modify($entity, $formDatas);

View File

@ -2,16 +2,17 @@
namespace App\Services\Equipment; namespace App\Services\Equipment;
use App\Services\Payment\ServerPart as PaymentService; use App\Entities\Equipment\ServerEntity;
use App\Services\Equipment\Switch\ServerPart as SwitchService; use App\Entities\Equipment\ServerPartEntity;
use App\Services\Equipment\Part\ServerPart as PartService; use App\Entities\PaymentEntity;
use App\Services\Equipment\IP\ServerPart as IPService; use App\Helpers\Equipment\ServerPartHelper;
use App\Models\Equipment\ServerPartModel;
use App\Services\Equipment\CS\ServerPart as CSService; use App\Services\Equipment\CS\ServerPart as CSService;
use App\Services\Equipment\EquipmentService; use App\Services\Equipment\EquipmentService;
use App\Models\Equipment\ServerPartModel; use App\Services\Equipment\IP\ServerPart as IPService;
use App\Helpers\Equipment\ServerPartHelper; use App\Services\Equipment\Part\ServerPart as PartService;
use App\Entities\Equipment\ServerPartEntity; use App\Services\Equipment\Switch\ServerPart as SwitchService;
use App\Entities\Equipment\ServerEntity; use App\Services\Payment\ServerPart as PaymentService;
class ServerPartService extends EquipmentService class ServerPartService extends EquipmentService
{ {
@ -135,7 +136,13 @@ class ServerPartService extends EquipmentService
break; break;
} }
//결제정보 정의 //결제정보 정의
return $entity->setPaymentEntity($this->getPaymentService()->getEntity(['uid' => $entity->getPaymentInfoUID()])); if ($entity->getPaymentInfoUID()) {
$paymentEntity = $this->getPaymentService()->getEntity($entity->getPaymentInfoUID());
if ($paymentEntity instanceof PaymentEntity) {
$entity->setPaymentEntity($paymentEntity);
}
}
return $entity;
} }
//기본 기능부분 //기본 기능부분
// FieldForm관련용 // FieldForm관련용