dbmsv2 init...1
This commit is contained in:
parent
6215425f05
commit
1abad587a1
@ -4,13 +4,13 @@
|
||||
"settings": {
|
||||
"width": 3000,
|
||||
"height": 3000,
|
||||
"scrollTop": -1869.8503,
|
||||
"scrollLeft": -1623,
|
||||
"scrollTop": -1069.8503,
|
||||
"scrollLeft": -549.5033,
|
||||
"zoomLevel": 0.79,
|
||||
"show": 511,
|
||||
"database": 4,
|
||||
"databaseName": "",
|
||||
"canvasType": "@dineug/erd-editor/builtin-schema-sql",
|
||||
"canvasType": "ERD",
|
||||
"language": 1,
|
||||
"tableNameCase": 4,
|
||||
"columnNameCase": 2,
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -42,10 +42,6 @@ class ServiceEntity extends CustomerEntity
|
||||
{
|
||||
return $this->attributes['payment_uid'] ?? null;
|
||||
}
|
||||
final public function getServerInfoUID(): string
|
||||
{
|
||||
return $this->attributes['serverinfo_uid'];
|
||||
}
|
||||
//기본기능용
|
||||
|
||||
final public function getSite(): string
|
||||
|
||||
@ -9,15 +9,15 @@ class CSEntity extends EquipmentEntity
|
||||
const PK = CSModel::PK;
|
||||
const TITLE = CSModel::TITLE;
|
||||
const DEFAULT_STATUS = STATUS['AVAILABLE'];
|
||||
final public function getClientInfoUID(): string
|
||||
final public function getClientInfoUID(): string|null
|
||||
{
|
||||
return $this->attributes['clientinfo_uid'];
|
||||
}
|
||||
final public function getServiceInfoUID(): string
|
||||
final public function getServiceInfoUID(): string|null
|
||||
{
|
||||
return $this->attributes['serviceinfo_uid'];
|
||||
}
|
||||
final public function getServerInfoUID(): string
|
||||
final public function getServerInfoUID(): string|null
|
||||
{
|
||||
return $this->attributes['serverinfo_uid'];
|
||||
}
|
||||
|
||||
@ -9,15 +9,19 @@ class IPEntity extends EquipmentEntity
|
||||
const PK = IPModel::PK;
|
||||
const TITLE = IPModel::TITLE;
|
||||
const DEFAULT_STATUS = STATUS['AVAILABLE'];
|
||||
final public function getClientInfoUID(): string
|
||||
final public function getClientInfoUID(): string|null
|
||||
{
|
||||
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'];
|
||||
}
|
||||
final public function getServerInfoUID(): string
|
||||
final public function getServerInfoUID(): string|null
|
||||
{
|
||||
return $this->attributes['serverinfo_uid'];
|
||||
}
|
||||
@ -25,10 +29,6 @@ class IPEntity extends EquipmentEntity
|
||||
{
|
||||
return $this->attributes['lineinfo_uid'];
|
||||
}
|
||||
final public function getOldClientInfoUID(): string
|
||||
{
|
||||
return $this->attributes['old_clientinfo_uid'];
|
||||
}
|
||||
//기본기능
|
||||
public function getIP(): string
|
||||
{
|
||||
|
||||
@ -9,15 +9,11 @@ class ServerEntity extends EquipmentEntity
|
||||
const PK = ServerModel::PK;
|
||||
const TITLE = ServerModel::TITLE;
|
||||
const DEFAULT_STATUS = STATUS['AVAILABLE'];
|
||||
final public function getUserUID(): string
|
||||
{
|
||||
return $this->attributes['user_uid'];
|
||||
}
|
||||
final public function getClientInfoUID(): string
|
||||
final public function getClientInfoUID(): string|null
|
||||
{
|
||||
return $this->attributes['clientinfo_uid'];
|
||||
}
|
||||
final public function getServiceInfoUID(): string
|
||||
final public function getServiceInfoUID(): string|null
|
||||
{
|
||||
return $this->attributes['serviceinfo_uid'];
|
||||
}
|
||||
|
||||
@ -32,15 +32,15 @@ class ServerPartEntity extends EquipmentEntity
|
||||
{
|
||||
return intval($this->attributes['part_uid']) ?? 0;
|
||||
}
|
||||
final public function getUserUID(): string
|
||||
final public function getUserUID(): string|null
|
||||
{
|
||||
return $this->attributes['user_uid'];
|
||||
}
|
||||
final public function getClientInfoUID(): string
|
||||
final public function getClientInfoUID(): string|null
|
||||
{
|
||||
return $this->attributes['clientinfo_uid'];
|
||||
}
|
||||
final public function getServiceInfoUID(): string
|
||||
final public function getServiceInfoUID(): string|null
|
||||
{
|
||||
return $this->attributes['serviceinfo_uid'];
|
||||
}
|
||||
|
||||
@ -9,15 +9,15 @@ class SwitchEntity extends EquipmentEntity
|
||||
const PK = SwitchModel::PK;
|
||||
const TITLE = SwitchModel::TITLE;
|
||||
const DEFAULT_STATUS = STATUS['AVAILABLE'];
|
||||
final public function getClientInfoUID(): string
|
||||
final public function getClientInfoUID(): string|null
|
||||
{
|
||||
return $this->attributes['clientinfo_uid'];
|
||||
}
|
||||
final public function getServiceInfoUID(): string
|
||||
final public function getServiceInfoUID(): string|null
|
||||
{
|
||||
return $this->attributes['serviceinfo_uid'];
|
||||
}
|
||||
final public function getServerInfoUID(): string
|
||||
final public function getServerInfoUID(): string|null
|
||||
{
|
||||
return $this->attributes['serverinfo_uid'];
|
||||
}
|
||||
|
||||
@ -143,13 +143,19 @@ abstract class CommonService
|
||||
{
|
||||
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 {
|
||||
$entity = is_array($where) ? $this->getModel()->where($where)->first() : $this->getModel()->find($where);
|
||||
if (!$entity) {
|
||||
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);
|
||||
} catch (\Exception $e) {
|
||||
$message = sprintf(
|
||||
|
||||
@ -108,9 +108,11 @@ class ServiceService extends CustomerService
|
||||
$entity->setServerEntity($serverEntity);
|
||||
}
|
||||
//결제정보 정의
|
||||
$paymentEntity = $this->getPaymentService()->getEntity(['uid' => $entity->getPaymentInfoUID()]);
|
||||
if ($paymentEntity instanceof PaymentEntity) {
|
||||
$entity->setPaymentEntity($paymentEntity);
|
||||
if ($entity->getPaymentInfoUID()) {
|
||||
$paymentEntity = $this->getPaymentService()->getEntity($entity->getPaymentInfoUID());
|
||||
if ($paymentEntity instanceof PaymentEntity) {
|
||||
$entity->setPaymentEntity($paymentEntity);
|
||||
}
|
||||
}
|
||||
return $entity;
|
||||
}
|
||||
@ -235,7 +237,7 @@ class ServiceService extends CustomerService
|
||||
//신규등록
|
||||
$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');
|
||||
return $entity;
|
||||
}
|
||||
|
||||
@ -19,9 +19,9 @@ class Service extends ServerService implements ServiceInterface
|
||||
throw new \Exception(__METHOD__ . "에서 오류발생: 서버상태가 설정되지 않았습니다.");
|
||||
}
|
||||
//서버정보 가져오기
|
||||
$entity = $this->getEntity($serviceEntity->getServerInfoUID());
|
||||
$entity = $this->getEntity(['serviceinfo_uid' => $serviceEntity->getPK()]);
|
||||
if (!$entity instanceof ServerEntity) {
|
||||
throw new \Exception("{$serviceEntity->getServerInfoUID()}에 해당하는 서버정보를 찾을수없습니다.");
|
||||
throw new \Exception("서비스정보[{$serviceEntity->getPK()}]에 해당하는 서버정보를 찾을수없습니다.");
|
||||
}
|
||||
//서버정보 수정
|
||||
return $this->modify($entity, $formDatas);
|
||||
|
||||
@ -2,16 +2,17 @@
|
||||
|
||||
namespace App\Services\Equipment;
|
||||
|
||||
use App\Services\Payment\ServerPart as PaymentService;
|
||||
use App\Services\Equipment\Switch\ServerPart as SwitchService;
|
||||
use App\Services\Equipment\Part\ServerPart as PartService;
|
||||
use App\Services\Equipment\IP\ServerPart as IPService;
|
||||
use App\Entities\Equipment\ServerEntity;
|
||||
use App\Entities\Equipment\ServerPartEntity;
|
||||
use App\Entities\PaymentEntity;
|
||||
use App\Helpers\Equipment\ServerPartHelper;
|
||||
use App\Models\Equipment\ServerPartModel;
|
||||
use App\Services\Equipment\CS\ServerPart as CSService;
|
||||
use App\Services\Equipment\EquipmentService;
|
||||
use App\Models\Equipment\ServerPartModel;
|
||||
use App\Helpers\Equipment\ServerPartHelper;
|
||||
use App\Entities\Equipment\ServerPartEntity;
|
||||
use App\Entities\Equipment\ServerEntity;
|
||||
use App\Services\Equipment\IP\ServerPart as IPService;
|
||||
use App\Services\Equipment\Part\ServerPart as PartService;
|
||||
use App\Services\Equipment\Switch\ServerPart as SwitchService;
|
||||
use App\Services\Payment\ServerPart as PaymentService;
|
||||
|
||||
class ServerPartService extends EquipmentService
|
||||
{
|
||||
@ -135,7 +136,13 @@ class ServerPartService extends EquipmentService
|
||||
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관련용
|
||||
|
||||
Loading…
Reference in New Issue
Block a user