dbmsv2_init...1
This commit is contained in:
parent
4f99fda98e
commit
2c27bbf09f
@ -1,10 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Cells\Equipment;
|
namespace App\Cells\Part;
|
||||||
|
|
||||||
use App\Services\Part\DISKService;
|
use App\Services\Part\DISKService;
|
||||||
|
|
||||||
class DISKCell extends EquipmentCell
|
class DISKCell extends PartCell
|
||||||
{
|
{
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
|
|||||||
15
app/Cells/Part/PartCell.php
Normal file
15
app/Cells/Part/PartCell.php
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Cells\Part;
|
||||||
|
|
||||||
|
use App\Cells\CommonCell;
|
||||||
|
use App\Services\CommonService;
|
||||||
|
|
||||||
|
abstract class PartCell extends CommonCell
|
||||||
|
{
|
||||||
|
|
||||||
|
protected function __construct(CommonService $service)
|
||||||
|
{
|
||||||
|
parent::__construct($service);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,10 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Cells\Equipment;
|
namespace App\Cells\Part;
|
||||||
|
|
||||||
use App\Services\Part\RAMService;
|
use App\Services\Part\RAMService;
|
||||||
|
|
||||||
class RAMCell extends EquipmentCell
|
class RAMCell extends PartCell
|
||||||
{
|
{
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -234,7 +234,7 @@ define('ICONS', [
|
|||||||
'SERVER_ITEM_CPU' => '<i class="bi bi-cpu"></i>',
|
'SERVER_ITEM_CPU' => '<i class="bi bi-cpu"></i>',
|
||||||
'SERVER_ITEM_RAM' => '<i class="bi bi-memory"></i>',
|
'SERVER_ITEM_RAM' => '<i class="bi bi-memory"></i>',
|
||||||
'SERVER_ITEM_DISK' => '<i class="bi bi-device-hdd"></i>',
|
'SERVER_ITEM_DISK' => '<i class="bi bi-device-hdd"></i>',
|
||||||
'SERVER_ITEM_Switch' => '<i class="bi bi-diagram-3"></i>',
|
'SERVER_ITEM_SWITCH' => '<i class="bi bi-diagram-3"></i>',
|
||||||
'SERVER_ITEM_OS' => '<i class="bi bi-microsoft"></i>',
|
'SERVER_ITEM_OS' => '<i class="bi bi-microsoft"></i>',
|
||||||
'SERVER_ITEM_DB' => '<i class="bi bi-database"></i>',
|
'SERVER_ITEM_DB' => '<i class="bi bi-database"></i>',
|
||||||
'SERVER_ITEM_SOFTWARE' => '<i class="bi bi-window-sidebar"></i>',
|
'SERVER_ITEM_SOFTWARE' => '<i class="bi bi-window-sidebar"></i>',
|
||||||
@ -406,8 +406,8 @@ define("SERVERPART", [
|
|||||||
"CNT_RANGE" => array_combine(range(1, 10), range(1, 10)),
|
"CNT_RANGE" => array_combine(range(1, 10), range(1, 10)),
|
||||||
"STOCK_PARTTYPES" => ['RAM', 'DISK'],
|
"STOCK_PARTTYPES" => ['RAM', 'DISK'],
|
||||||
"SERVER_PARTTYPES" => ['CPU', 'RAM', 'DISK'],
|
"SERVER_PARTTYPES" => ['CPU', 'RAM', 'DISK'],
|
||||||
"SERVICE_PARTTYPES" => ['Switch', 'IP', 'OS', 'SOFTWARE', 'CS'],
|
"SERVICE_PARTTYPES" => ['SWITCH', 'IP', 'OS', 'SOFTWARE', 'CS'],
|
||||||
"ALL_PARTTYPES" => ['CPU', 'RAM', 'DISK', 'OS', 'SOFTWARE', 'Switch', 'IP', 'CS'],
|
"ALL_PARTTYPES" => ['CPU', 'RAM', 'DISK', 'OS', 'SOFTWARE', 'SWITCH', 'IP', 'CS'],
|
||||||
]);
|
]);
|
||||||
//결제 관련
|
//결제 관련
|
||||||
define("PAYMENT", [
|
define("PAYMENT", [
|
||||||
|
|||||||
@ -186,17 +186,17 @@ $routes->group('admin', ['namespace' => 'App\Controllers\Admin', 'filter' => 'au
|
|||||||
//Part 관련
|
//Part 관련
|
||||||
$routes->group('part', ['namespace' => 'App\Controllers\Admin\Part'], function ($routes) {
|
$routes->group('part', ['namespace' => 'App\Controllers\Admin\Part'], function ($routes) {
|
||||||
$routes->group('switch', ['namespace' => 'App\Controllers\Admin\Part'], function ($routes) {
|
$routes->group('switch', ['namespace' => 'App\Controllers\Admin\Part'], function ($routes) {
|
||||||
$routes->get('/', 'SwitchController::index');
|
$routes->get('/', 'SWITCHController::index');
|
||||||
$routes->get('create', 'SwitchController::create_form');
|
$routes->get('create', 'SWITCHController::create_form');
|
||||||
$routes->post('create', 'SwitchController::create');
|
$routes->post('create', 'SWITCHController::create');
|
||||||
$routes->get('modify/(:alphanum)', 'SwitchController::modify_form/$1');
|
$routes->get('modify/(:alphanum)', 'SWITCHController::modify_form/$1');
|
||||||
$routes->post('modify/(:alphanum)', 'SwitchController::modify/$1');
|
$routes->post('modify/(:alphanum)', 'SWITCHController::modify/$1');
|
||||||
$routes->get('view/(:alphanum)', 'SwitchController::view/$1');
|
$routes->get('view/(:alphanum)', 'SWITCHController::view/$1');
|
||||||
$routes->get('delete/(:alphanum)', 'SwitchController::delete/$1');
|
$routes->get('delete/(:alphanum)', 'SWITCHController::delete/$1');
|
||||||
$routes->get('toggle/(:alphanum)/(:any)', 'SwitchController::toggle/$1/$2');
|
$routes->get('toggle/(:alphanum)/(:any)', 'SWITCHController::toggle/$1/$2');
|
||||||
$routes->post('batchjob', 'SwitchController::batchjob');
|
$routes->post('batchjob', 'SWITCHController::batchjob');
|
||||||
$routes->post('batchjob_delete', 'SwitchController::batchjob_delete');
|
$routes->post('batchjob_delete', 'SWITCHController::batchjob_delete');
|
||||||
$routes->get('download/(:alpha)', 'SwitchController::download/$1');
|
$routes->get('download/(:alpha)', 'SWITCHController::download/$1');
|
||||||
});
|
});
|
||||||
$routes->group('ip', ['namespace' => 'App\Controllers\Admin\Part'], function ($routes) {
|
$routes->group('ip', ['namespace' => 'App\Controllers\Admin\Part'], function ($routes) {
|
||||||
$routes->get('/', 'IPController::index');
|
$routes->get('/', 'IPController::index');
|
||||||
|
|||||||
@ -2,13 +2,13 @@
|
|||||||
|
|
||||||
namespace App\Controllers\Admin\Part;
|
namespace App\Controllers\Admin\Part;
|
||||||
|
|
||||||
use App\Services\Part\SwitchService;
|
use App\Services\Part\SWITCHService;
|
||||||
|
|
||||||
use CodeIgniter\HTTP\RequestInterface;
|
use CodeIgniter\HTTP\RequestInterface;
|
||||||
use CodeIgniter\HTTP\ResponseInterface;
|
use CodeIgniter\HTTP\ResponseInterface;
|
||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
|
|
||||||
class SwitchController extends PartController
|
class SWITCHController extends PartController
|
||||||
{
|
{
|
||||||
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
||||||
{
|
{
|
||||||
@ -19,10 +19,10 @@ class SwitchController extends PartController
|
|||||||
// $this->view_path .= strtolower($this->getService()->getClassName()) . DIRECTORY_SEPARATOR;
|
// $this->view_path .= strtolower($this->getService()->getClassName()) . DIRECTORY_SEPARATOR;
|
||||||
|
|
||||||
}
|
}
|
||||||
public function getService(): SwitchService
|
public function getService(): SWITCHService
|
||||||
{
|
{
|
||||||
if (!$this->_service) {
|
if (!$this->_service) {
|
||||||
$this->_service = new SwitchService();
|
$this->_service = new SWITCHService();
|
||||||
}
|
}
|
||||||
return $this->_service;
|
return $this->_service;
|
||||||
}
|
}
|
||||||
@ -22,7 +22,7 @@ abstract class DBMigration extends BaseController
|
|||||||
abstract protected function getClient(): array;
|
abstract protected function getClient(): array;
|
||||||
abstract protected function getLine(): array;
|
abstract protected function getLine(): array;
|
||||||
abstract protected function getServerCode(): array;
|
abstract protected function getServerCode(): array;
|
||||||
abstract protected function getSwitchCode(): array;
|
abstract protected function getSWITCHCode(): array;
|
||||||
abstract protected function getPartCode(): array;
|
abstract protected function getPartCode(): array;
|
||||||
|
|
||||||
final protected function getTargetDB(): BaseConnection
|
final protected function getTargetDB(): BaseConnection
|
||||||
|
|||||||
@ -9,7 +9,7 @@ use Psr\Log\LoggerInterface;
|
|||||||
use App\Libraries\DBMigration\Process\ClientProcess;
|
use App\Libraries\DBMigration\Process\ClientProcess;
|
||||||
use App\Libraries\DBMigration\Process\LineProcess;
|
use App\Libraries\DBMigration\Process\LineProcess;
|
||||||
use App\Libraries\DBMigration\Process\ServerCodeProcess;
|
use App\Libraries\DBMigration\Process\ServerCodeProcess;
|
||||||
use App\Libraries\DBMigration\Process\SwitchCodeProcess;
|
use App\Libraries\DBMigration\Process\SWITCHCodeProcess;
|
||||||
use App\Libraries\DBMigration\Process\PartCodeProcess;
|
use App\Libraries\DBMigration\Process\PartCodeProcess;
|
||||||
|
|
||||||
class SourceDB extends DBMigration
|
class SourceDB extends DBMigration
|
||||||
@ -95,7 +95,7 @@ class SourceDB extends DBMigration
|
|||||||
return $this->executeQuery(self::SQL_GET_SERVER_CODE, ['%일회성%']);
|
return $this->executeQuery(self::SQL_GET_SERVER_CODE, ['%일회성%']);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getSwitchCode(): array
|
protected function getSWITCHCode(): array
|
||||||
{
|
{
|
||||||
return $this->executeQuery(self::SQL_GET_SWITCH_CODE, ['%일회성%']);
|
return $this->executeQuery(self::SQL_GET_SWITCH_CODE, ['%일회성%']);
|
||||||
}
|
}
|
||||||
@ -133,8 +133,8 @@ class SourceDB extends DBMigration
|
|||||||
final public function switchcode(): void
|
final public function switchcode(): void
|
||||||
{
|
{
|
||||||
$this->migration(
|
$this->migration(
|
||||||
new SwitchCodeProcess($this->getTargetDB()),
|
new SWITCHCodeProcess($this->getTargetDB()),
|
||||||
$this->getSwitchCode(),
|
$this->getSWITCHCode(),
|
||||||
__FUNCTION__
|
__FUNCTION__
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,13 +4,13 @@
|
|||||||
"settings": {
|
"settings": {
|
||||||
"width": 3000,
|
"width": 3000,
|
||||||
"height": 3000,
|
"height": 3000,
|
||||||
"scrollTop": -1894.7873,
|
"scrollTop": -1298.7873,
|
||||||
"scrollLeft": -297.3986,
|
"scrollLeft": -287.741,
|
||||||
"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
12
app/Entities/Part/SWITCHEntity.php
Normal file
12
app/Entities/Part/SWITCHEntity.php
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Entities\Part;
|
||||||
|
|
||||||
|
use App\Models\Part\SWITCHModel;
|
||||||
|
|
||||||
|
class SWITCHEntity extends PartEntity
|
||||||
|
{
|
||||||
|
const PK = SWITCHModel::PK;
|
||||||
|
const TITLE = SWITCHModel::TITLE;
|
||||||
|
const DEFAULT_STATUS = STATUS['AVAILABLE'];
|
||||||
|
}
|
||||||
@ -1,12 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Entities\Part;
|
|
||||||
|
|
||||||
use App\Models\Part\SwitchModel;
|
|
||||||
|
|
||||||
class SwitchEntity extends PartEntity
|
|
||||||
{
|
|
||||||
const PK = SwitchModel::PK;
|
|
||||||
const TITLE = SwitchModel::TITLE;
|
|
||||||
const DEFAULT_STATUS = STATUS['AVAILABLE'];
|
|
||||||
}
|
|
||||||
@ -57,18 +57,18 @@ class ServerPartHelper extends EquipmentHelper
|
|||||||
$attributes = ['data-title' => 'getTitle', 'data-price' => 'getPrice'];
|
$attributes = ['data-title' => 'getTitle', 'data-price' => 'getPrice'];
|
||||||
$form = $this->form_dropdown_common($field, $value, $viewDatas, $extras, $attributes);
|
$form = $this->form_dropdown_common($field, $value, $viewDatas, $extras, $attributes);
|
||||||
break;
|
break;
|
||||||
case 'billing':
|
// case 'billing':
|
||||||
//결제방식이 항상 매월지급으로 설정되는 항목형식(IP,CS)
|
// //결제방식이 항상 매월지급으로 설정되는 항목형식(IP,CS)
|
||||||
if (array_key_exists('type', $viewDatas['control']['form_datas'])) {
|
// if (array_key_exists('type', $viewDatas['control']['form_datas'])) {
|
||||||
switch ($viewDatas['control']['form_datas']['type']) {
|
// switch ($viewDatas['control']['form_datas']['type']) {
|
||||||
case 'IP':
|
// case 'IP':
|
||||||
case 'CS':
|
// case 'CS':
|
||||||
$value = PAYMENT['BILLING']['MONTH'];
|
// $value = PAYMENT['BILLING']['MONTH'];
|
||||||
break;
|
// break;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
$form = parent::getFieldForm($field, $value, $viewDatas, $extras);;
|
// $form = parent::getFieldForm($field, $value, $viewDatas, $extras);;
|
||||||
break;
|
// break;
|
||||||
case 'extra':
|
case 'extra':
|
||||||
if (array_key_exists('type', $viewDatas['control']['form_datas']) && $viewDatas['control']['form_datas']['type'] === 'DISK') {
|
if (array_key_exists('type', $viewDatas['control']['form_datas']) && $viewDatas['control']['form_datas']['type'] === 'DISK') {
|
||||||
$options = ["" => lang("{$viewDatas['class_path']}.label.{$field}") . " 선택", ...lang("{$viewDatas['class_path']}.EXTRA.{$viewDatas['control']['form_datas']['type']}")];
|
$options = ["" => lang("{$viewDatas['class_path']}.label.{$field}") . " 선택", ...lang("{$viewDatas['class_path']}.EXTRA.{$viewDatas['control']['form_datas']['type']}")];
|
||||||
@ -106,7 +106,7 @@ class ServerPartHelper extends EquipmentHelper
|
|||||||
case 'DISK':
|
case 'DISK':
|
||||||
case 'OS':
|
case 'OS':
|
||||||
case 'SOFTWARE':
|
case 'SOFTWARE':
|
||||||
case 'Switch':
|
case 'SWITCH':
|
||||||
case 'IP':
|
case 'IP':
|
||||||
case 'CS':
|
case 'CS':
|
||||||
//파트 Entity
|
//파트 Entity
|
||||||
@ -142,7 +142,7 @@ class ServerPartHelper extends EquipmentHelper
|
|||||||
public function getListButton(string $action, string $label, array $viewDatas, array $extras = []): string
|
public function getListButton(string $action, string $label, array $viewDatas, array $extras = []): string
|
||||||
{
|
{
|
||||||
switch ($action) {
|
switch ($action) {
|
||||||
case 'Switch':
|
case 'SWITCH':
|
||||||
case 'IP':
|
case 'IP':
|
||||||
case 'CS':
|
case 'CS':
|
||||||
case 'CPU':
|
case 'CPU':
|
||||||
|
|||||||
@ -2,14 +2,14 @@
|
|||||||
|
|
||||||
namespace App\Helpers\Part;
|
namespace App\Helpers\Part;
|
||||||
|
|
||||||
use App\Models\Part\SwitchModel;
|
use App\Models\Part\SWITCHModel;
|
||||||
|
|
||||||
class SwitchHelper extends PartHelper
|
class SWITCHHelper extends PartHelper
|
||||||
{
|
{
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
$this->setTitleField(field: SwitchModel::TITLE);
|
$this->setTitleField(field: SWITCHModel::TITLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getListButton(string $action, string $label, array $viewDatas, array $extras = []): string
|
public function getListButton(string $action, string $label, array $viewDatas, array $extras = []): string
|
||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
return [
|
return [
|
||||||
'title' => "Switch정보",
|
'title' => "SWITCH정보",
|
||||||
'label' => [
|
'label' => [
|
||||||
'clientinfo_uid' => "고객",
|
'clientinfo_uid' => "고객",
|
||||||
'serviceinfo_uid' => "서비스",
|
'serviceinfo_uid' => "서비스",
|
||||||
@ -2,10 +2,10 @@
|
|||||||
|
|
||||||
namespace App\Libraries\DBMigration\Process;
|
namespace App\Libraries\DBMigration\Process;
|
||||||
|
|
||||||
use App\Entities\Equipment\SwitchEntity;
|
use App\Entities\Part\SWITCHEntity;
|
||||||
use CodeIgniter\Database\BaseConnection;
|
use CodeIgniter\Database\BaseConnection;
|
||||||
|
|
||||||
class SwitchCodeProcess implements MigrationProcessInterface
|
class SWITCHCodeProcess implements MigrationProcessInterface
|
||||||
{
|
{
|
||||||
private $db;
|
private $db;
|
||||||
public function __construct(BaseConnection $db)
|
public function __construct(BaseConnection $db)
|
||||||
@ -16,7 +16,7 @@ class SwitchCodeProcess implements MigrationProcessInterface
|
|||||||
{
|
{
|
||||||
$temps = [];
|
$temps = [];
|
||||||
$temps['code'] = trim($row['service_sw']);
|
$temps['code'] = trim($row['service_sw']);
|
||||||
$temps['status'] = SwitchEntity::DEFAULT_STATUS; // Assuming SwitchEntity has a STATUS_DEFAULT constant
|
$temps['status'] = SWITCHEntity::DEFAULT_STATUS; // Assuming SWITCHEntity has a STATUS_DEFAULT constant
|
||||||
if (!$this->db->table('switchinfo')->insert($temps)) {
|
if (!$this->db->table('switchinfo')->insert($temps)) {
|
||||||
throw new \Exception($this->db->error()['message']);
|
throw new \Exception($this->db->error()['message']);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -37,6 +37,9 @@ class IPModel extends PartModel
|
|||||||
$rule = "required|numeric";
|
$rule = "required|numeric";
|
||||||
break;
|
break;
|
||||||
case "old_clientinfo_uid":
|
case "old_clientinfo_uid":
|
||||||
|
case "clientinfo_uid":
|
||||||
|
case "serviceinfo_uid":
|
||||||
|
case "serverinfo_uid":
|
||||||
$rule = "permit_empty|numeric";
|
$rule = "permit_empty|numeric";
|
||||||
break;
|
break;
|
||||||
case "ip":
|
case "ip":
|
||||||
|
|||||||
@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
namespace App\Models\Part;
|
namespace App\Models\Part;
|
||||||
|
|
||||||
use App\Entities\Part\SwitchEntity;
|
use App\Entities\Part\SWITCHEntity;
|
||||||
|
|
||||||
class SwitchModel extends PartModel
|
class SWITCHModel extends PartModel
|
||||||
{
|
{
|
||||||
const TABLE = "switchinfo";
|
const TABLE = "switchinfo";
|
||||||
const PK = "uid";
|
const PK = "uid";
|
||||||
@ -12,7 +12,7 @@ class SwitchModel extends PartModel
|
|||||||
protected $table = self::TABLE;
|
protected $table = self::TABLE;
|
||||||
protected $primaryKey = self::PK;
|
protected $primaryKey = self::PK;
|
||||||
// protected $useAutoIncrement = false;
|
// protected $useAutoIncrement = false;
|
||||||
protected $returnType = SwitchEntity::class;
|
protected $returnType = SWITCHEntity::class;
|
||||||
protected $allowedFields = [
|
protected $allowedFields = [
|
||||||
"clientinfo_uid",
|
"clientinfo_uid",
|
||||||
"serviceinfo_uid",
|
"serviceinfo_uid",
|
||||||
@ -223,6 +223,21 @@ class ServiceService extends CustomerService
|
|||||||
}
|
}
|
||||||
return $caculatedAmount;
|
return $caculatedAmount;
|
||||||
}
|
}
|
||||||
|
//조정된 금액 설정
|
||||||
|
final public function setAmount(ServiceEntity $entity): ServiceEntity
|
||||||
|
{
|
||||||
|
$caculatedAmount = $this->getCaculatedAmount($entity);
|
||||||
|
if ($entity->getAmount() !== $caculatedAmount) {
|
||||||
|
$paymentEntity = $entity->getPaymentEntity();
|
||||||
|
if (!$paymentEntity instanceof PaymentEntity) {
|
||||||
|
throw new \Exception(__METHOD__ . "에서 오류발생: 결제정보가 정의되지 않았습니다.");
|
||||||
|
}
|
||||||
|
//금액설정
|
||||||
|
$entity = parent::modify($entity, ['amount' => $caculatedAmount]);
|
||||||
|
$this->getPaymentService()->setAmount($entity->getPaymentEntity(), $caculatedAmount);
|
||||||
|
}
|
||||||
|
return $entity;
|
||||||
|
}
|
||||||
//기본 기능부분
|
//기본 기능부분
|
||||||
//FieldForm관련용
|
//FieldForm관련용
|
||||||
public function getFormOption(string $field, array $options = []): array
|
public function getFormOption(string $field, array $options = []): array
|
||||||
@ -236,7 +251,7 @@ class ServiceService extends CustomerService
|
|||||||
case 'DISK':
|
case 'DISK':
|
||||||
case 'OS':
|
case 'OS':
|
||||||
case 'SOFTWARE':
|
case 'SOFTWARE':
|
||||||
case 'Switch':
|
case 'SWITCH':
|
||||||
case 'IP':
|
case 'IP':
|
||||||
case 'CS':
|
case 'CS':
|
||||||
$options = $this->getServerService()->getFormOption($field, $options);
|
$options = $this->getServerService()->getFormOption($field, $options);
|
||||||
@ -252,8 +267,8 @@ class ServiceService extends CustomerService
|
|||||||
{
|
{
|
||||||
//서버정보수정
|
//서버정보수정
|
||||||
$entity = $this->getServerService()->$action($entity);
|
$entity = $this->getServerService()->$action($entity);
|
||||||
|
//결제정보수정 및 결제정보 PK값정의
|
||||||
$entity = $this->getPaymentService()->$action($entity);
|
$entity = $this->getPaymentService()->$action($entity);
|
||||||
//결제정보PK정의
|
|
||||||
$entity = parent::modify($entity, ['payment_uid' => $entity->getPaymentEntity()->getPK()]);
|
$entity = parent::modify($entity, ['payment_uid' => $entity->getPaymentEntity()->getPK()]);
|
||||||
return $entity;
|
return $entity;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,8 +21,8 @@ class ServiceService extends ParentService implements ServerInterface
|
|||||||
if (!$entity instanceof ServiceEntity) {
|
if (!$entity instanceof ServiceEntity) {
|
||||||
throw new \Exception("[{$serverEntity->getServiceInfoUID()}]에 대한 서비스정보를 찾을수 없습니다.");
|
throw new \Exception("[{$serverEntity->getServiceInfoUID()}]에 대한 서비스정보를 찾을수 없습니다.");
|
||||||
}
|
}
|
||||||
//서비스금액은 modify 함수내에서 재계산을 하므로 여기서는 modify만 호출함
|
//서비스금액변경 사항이 있는지 확인후 처리
|
||||||
return $this->getModel()->modify($entity, []);
|
return $this->setAmount($entity);
|
||||||
}
|
}
|
||||||
public function createServer(ServerEntity $serverEntity): ServerEntity
|
public function createServer(ServerEntity $serverEntity): ServerEntity
|
||||||
{
|
{
|
||||||
@ -36,9 +36,11 @@ class ServiceService extends ParentService implements ServerInterface
|
|||||||
}
|
}
|
||||||
public function deleteServer(ServerEntity $serverEntity): ServerEntity
|
public function deleteServer(ServerEntity $serverEntity): ServerEntity
|
||||||
{
|
{
|
||||||
|
//서비스중인지 확인
|
||||||
if ($serverEntity->getServiceInfoUID() !== null || $serverEntity->getStatus() === STATUS['OCCUPIED']) {
|
if ($serverEntity->getServiceInfoUID() !== null || $serverEntity->getStatus() === STATUS['OCCUPIED']) {
|
||||||
throw new \Exception("서비스중이 서버는 삭제하실수 없습니다.");
|
throw new \Exception("서비스중이 서버는 삭제하실수 없습니다.");
|
||||||
}
|
}
|
||||||
|
//아무것도 하지 않음
|
||||||
return $serverEntity;
|
return $serverEntity;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,10 +4,10 @@ namespace App\Services\Equipment\ServerPart;
|
|||||||
|
|
||||||
use App\Entities\Equipment\ServerPartEntity;
|
use App\Entities\Equipment\ServerPartEntity;
|
||||||
use App\Interfaces\Equipment\ServerPartInterface;
|
use App\Interfaces\Equipment\ServerPartInterface;
|
||||||
use App\Entities\Part\SwitchEntity;
|
use App\Entities\Part\SWITCHEntity;
|
||||||
use App\Services\Part\SwitchService as ParentService;
|
use App\Services\Part\SWITCHService as ParentService;
|
||||||
|
|
||||||
class SwitchService extends ParentService implements ServerPartInterface
|
class SWITCHService extends ParentService implements ServerPartInterface
|
||||||
{
|
{
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
@ -15,17 +15,17 @@ class SwitchService extends ParentService implements ServerPartInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
//서버연결정보용 등록
|
//서버연결정보용 등록
|
||||||
private function action_process(ServerPartEntity $serverPartEntity, array $formDatas = []): SwitchEntity
|
private function action_process(ServerPartEntity $serverPartEntity, array $formDatas = []): SWITCHEntity
|
||||||
{
|
{
|
||||||
if (!array_key_exists('status', $formDatas)) {
|
if (!array_key_exists('status', $formDatas)) {
|
||||||
throw new \Exception(__METHOD__ . "에서 오류발생: Switch상태가 설정되지 않았습니다.");
|
throw new \Exception(__METHOD__ . "에서 오류발생: SWITCH상태가 설정되지 않았습니다.");
|
||||||
}
|
}
|
||||||
//Switch정보가져오기
|
//SWITCH정보가져오기
|
||||||
$entity = $this->getEntity($serverPartEntity->getPartUID());
|
$entity = $this->getEntity($serverPartEntity->getPartUID());
|
||||||
if (!$entity instanceof SwitchEntity) {
|
if (!$entity instanceof SWITCHEntity) {
|
||||||
throw new \Exception("{$serverPartEntity->getPartUID()}에 해당하는 Switch정보를 찾을수없습니다.");
|
throw new \Exception("{$serverPartEntity->getPartUID()}에 해당하는 SWITCH정보를 찾을수없습니다.");
|
||||||
}
|
}
|
||||||
//Switch정보 수정
|
//SWITCH정보 수정
|
||||||
return $this->getModel()->modify($entity, $formDatas);
|
return $this->getModel()->modify($entity, $formDatas);
|
||||||
}
|
}
|
||||||
public function createServerPart(ServerPartEntity $serverPartEntity): ServerPartEntity
|
public function createServerPart(ServerPartEntity $serverPartEntity): ServerPartEntity
|
||||||
@ -21,8 +21,8 @@ class ServiceService extends ParentService implements ServerPartInterface
|
|||||||
if (!$entity instanceof ServiceEntity) {
|
if (!$entity instanceof ServiceEntity) {
|
||||||
throw new \Exception("[{$serverPartEntity->getServiceInfoUID()}]에 대한 서비스정보를 찾을수 없습니다.");
|
throw new \Exception("[{$serverPartEntity->getServiceInfoUID()}]에 대한 서비스정보를 찾을수 없습니다.");
|
||||||
}
|
}
|
||||||
//서비스금액은 modify 함수내에서 재계산을 하므로 여기서는 modify만 호출함
|
//서비스금액변경 사항이 있는지 확인후 처리
|
||||||
return $this->getModel()->modify($entity, []);
|
return $this->setAmount($entity);
|
||||||
}
|
}
|
||||||
public function createServerPart(ServerPartEntity $serverPartEntity): ServerPartEntity
|
public function createServerPart(ServerPartEntity $serverPartEntity): ServerPartEntity
|
||||||
{
|
{
|
||||||
|
|||||||
@ -25,7 +25,6 @@ class IPService extends PartService
|
|||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
"lineinfo_uid",
|
"lineinfo_uid",
|
||||||
"serverinfo_uid",
|
|
||||||
"ip",
|
"ip",
|
||||||
"price",
|
"price",
|
||||||
"status",
|
"status",
|
||||||
|
|||||||
@ -2,20 +2,20 @@
|
|||||||
|
|
||||||
namespace App\Services\Part;
|
namespace App\Services\Part;
|
||||||
|
|
||||||
use App\Helpers\Part\SwitchHelper;
|
use App\Helpers\Part\SWITCHHelper;
|
||||||
use App\Models\Part\SwitchModel;
|
use App\Models\Part\SWITCHModel;
|
||||||
use App\Services\Customer\ServiceService;
|
use App\Services\Customer\ServiceService;
|
||||||
use App\Services\Equipment\ServerService;
|
use App\Services\Equipment\ServerService;
|
||||||
use App\Services\Part\PartService;
|
use App\Services\Part\PartService;
|
||||||
|
|
||||||
class SwitchService extends PartService
|
class SWITCHService extends PartService
|
||||||
{
|
{
|
||||||
private ?ServiceService $_serviceService = null;
|
private ?ServiceService $_serviceService = null;
|
||||||
private ?ServerService $_serverService = null;
|
private ?ServerService $_serverService = null;
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
parent::__construct(new SwitchModel(), new SwitchHelper());
|
parent::__construct(new SWITCHModel(), new SWITCHHelper());
|
||||||
$this->addClassName('Switch');
|
$this->addClassName('SWITCH');
|
||||||
}
|
}
|
||||||
public function getFormFields(): array
|
public function getFormFields(): array
|
||||||
{
|
{
|
||||||
@ -116,6 +116,16 @@ class PaymentService extends CommonService
|
|||||||
}
|
}
|
||||||
return $unPaids;
|
return $unPaids;
|
||||||
}
|
}
|
||||||
|
final public function setAmount(PaymentEntity $entity, int $amount): PaymentEntity
|
||||||
|
{
|
||||||
|
if ($entity->getStatus() !== STATUS['UNPAID']) {
|
||||||
|
throw new \Exception(__METHOD__ . "에서 오류발생: 지급이 완료된 결제정보는 수정할 수 없습니다.");
|
||||||
|
}
|
||||||
|
if ($entity->getAmount() !== $amount) {
|
||||||
|
$this->getModel()->modify($entity, ['amount' => $amount]);
|
||||||
|
}
|
||||||
|
return $entity;
|
||||||
|
}
|
||||||
//기본 기능부분
|
//기본 기능부분
|
||||||
//FieldForm관련용
|
//FieldForm관련용
|
||||||
final public function getFormOption(string $field, array $options = []): array
|
final public function getFormOption(string $field, array $options = []): array
|
||||||
|
|||||||
@ -23,6 +23,7 @@ class UserService extends CommonService
|
|||||||
'email',
|
'email',
|
||||||
'mobile',
|
'mobile',
|
||||||
'role',
|
'role',
|
||||||
|
'status',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
public function getFormFilters(): array
|
public function getFormFilters(): array
|
||||||
|
|||||||
@ -11,7 +11,4 @@
|
|||||||
<div class="accordion-item">
|
<div class="accordion-item">
|
||||||
<a href="/admin/equipment/server"><?= ICONS['SERVICE_ITEM_SERVER'] ?>Server정보</a>
|
<a href="/admin/equipment/server"><?= ICONS['SERVICE_ITEM_SERVER'] ?>Server정보</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="accordion-item">
|
|
||||||
<a href="/admin/equipment/serverpart"><?= ICONS['SERVICE_ITEM_SERVER'] ?>Server부품연결정보</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
@ -6,7 +6,7 @@
|
|||||||
</h2>
|
</h2>
|
||||||
<div id="flush-part" class="accordion-collapse collapse" aria-labelledby="flush-part">
|
<div id="flush-part" class="accordion-collapse collapse" aria-labelledby="flush-part">
|
||||||
<div class="accordion-item">
|
<div class="accordion-item">
|
||||||
<a href="/admin/part/switch"><?= ICONS['SETUP'] ?>Switch정보</a>
|
<a href="/admin/part/switch"><?= ICONS['SETUP'] ?>SWITCH정보</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="accordion-item">
|
<div class="accordion-item">
|
||||||
<a href="/admin/part/ip"><?= ICONS['SERVICE_ITEM_IP'] ?>IP정보</a>
|
<a href="/admin/part/ip"><?= ICONS['SERVICE_ITEM_IP'] ?>IP정보</a>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user