dbmsv2_init...1

This commit is contained in:
choi.jh 2025-09-25 13:19:06 +09:00
parent 5bdd84ea19
commit 6de94c5607
84 changed files with 2403 additions and 618 deletions

View File

@ -405,9 +405,9 @@ define("SERVICE", [
define("SERVERPART", [
"CNT_RANGE" => array_combine(range(1, 10), range(1, 10)),
"STOCK_PARTTYPES" => ['CPU', 'RAM', 'DISK'],
"SERVER_PARTTYPES" => ['CPU', 'RAM', 'DISK', 'ETC'],
"SERVICE_PARTTYPES" => ['SWITCH', 'IP', 'OS', 'SOFTWARE', 'CS', 'ETC'],
"ALL_PARTTYPES" => ['CPU', 'RAM', 'DISK', 'OS', 'DB', 'SOFTWARE', 'SWITCH', 'IP', 'CS', 'ETC'],
"SERVER_PARTTYPES" => ['CPU', 'RAM', 'DISK'],
"SERVICE_PARTTYPES" => ['Switch', 'IP', 'OS', 'SOFTWARE', 'CS'],
"ALL_PARTTYPES" => ['CPU', 'RAM', 'DISK', 'OS', 'SOFTWARE', 'Switch', 'IP', 'CS'],
]);
//결제 관련
define("PAYMENT", [

View File

@ -125,19 +125,6 @@ $routes->group('admin', ['namespace' => 'App\Controllers\Admin', 'filter' => 'au
$routes->get('download/(:alpha)', 'ServiceController::download/$1');
$routes->post('history/(:num)', 'ServiceController::history/$1');
});
$routes->group('serviceitem', ['namespace' => 'App\Controllers\Admin\Customer'], function ($routes) {
$routes->get('/', 'ServiceItemController::index');
$routes->get('create', 'ServiceItemController::create_form');
$routes->post('create', 'ServiceItemController::create');
$routes->get('modify/(:num)', 'ServiceItemController::modify_form/$1');
$routes->post('modify/(:num)', 'ServiceItemController::modify/$1');
$routes->get('view/(:num)', 'ServiceItemController::view/$1');
$routes->get('delete/(:num)', 'ServiceItemController::delete/$1');
$routes->get('toggle/(:num)/(:any)', 'ServiceItemController::toggle/$1/$2');
$routes->post('batchjob', 'ServiceItemController::batchjob');
$routes->post('batchjob_delete', 'ServiceItemController::batchjob_delete');
$routes->get('download/(:alpha)', 'ServiceItemController::download/$1');
});
$routes->group('payment', ['namespace' => 'App\Controllers\Admin\Customer'], function ($routes) {
$routes->get('/', 'PaymentController::index');
$routes->get('create', 'PaymentController::create_form');
@ -156,18 +143,18 @@ $routes->group('admin', ['namespace' => 'App\Controllers\Admin', 'filter' => 'au
//Customer 관련
//Equipment 관련
$routes->group('equipment', ['namespace' => 'App\Controllers\Admin\Equipment'], function ($routes) {
$routes->group('switch', ['namespace' => 'App\Controllers\Admin\Equipment'], function ($routes) {
$routes->get('/', 'SwitchController::index');
$routes->get('create', 'SwitchController::create_form');
$routes->post('create', 'SwitchController::create');
$routes->get('modify/(:alphanum)', 'SwitchController::modify_form/$1');
$routes->post('modify/(:alphanum)', 'SwitchController::modify/$1');
$routes->get('view/(:alphanum)', 'SwitchController::view/$1');
$routes->get('delete/(:alphanum)', 'SwitchController::delete/$1');
$routes->get('toggle/(:alphanum)/(:any)', 'SwitchController::toggle/$1/$2');
$routes->post('batchjob', 'SwitchController::batchjob');
$routes->post('batchjob_delete', 'SwitchController::batchjob_delete');
$routes->get('download/(:alpha)', 'SwitchController::download/$1');
$routes->group('line', ['namespace' => 'App\Controllers\Admin\Equipment'], function ($routes) {
$routes->get('/', 'LineController::index');
$routes->get('create', 'LineController::create_form');
$routes->post('create', 'LineController::create');
$routes->get('modify/(:num)', 'LineController::modify_form/$1');
$routes->post('modify/(:num)', 'LineController::modify/$1');
$routes->get('view/(:num)', 'LineController::view/$1');
$routes->get('delete/(:num)', 'LineController::delete/$1');
$routes->get('toggle/(:num)/(:any)', 'LineController::toggle/$1/$2');
$routes->post('batchjob', 'LineController::batchjob');
$routes->post('batchjob_delete', 'LineController::batchjob_delete');
$routes->get('download/(:alpha)', 'LineController::download/$1');
});
$routes->group('server', ['namespace' => 'App\Controllers\Admin\Equipment'], function ($routes) {
$routes->get('/', 'ServerController::index');
@ -194,20 +181,24 @@ $routes->group('admin', ['namespace' => 'App\Controllers\Admin', 'filter' => 'au
$routes->post('batchjob_delete', 'ServerPartController::batchjob_delete');
$routes->get('download/(:alpha)', 'ServerPartController::download/$1');
});
$routes->group('line', ['namespace' => 'App\Controllers\Admin\Equipment'], function ($routes) {
$routes->get('/', 'LineController::index');
$routes->get('create', 'LineController::create_form');
$routes->post('create', 'LineController::create');
$routes->get('modify/(:num)', 'LineController::modify_form/$1');
$routes->post('modify/(:num)', 'LineController::modify/$1');
$routes->get('view/(:num)', 'LineController::view/$1');
$routes->get('delete/(:num)', 'LineController::delete/$1');
$routes->get('toggle/(:num)/(:any)', 'LineController::toggle/$1/$2');
$routes->post('batchjob', 'LineController::batchjob');
$routes->post('batchjob_delete', 'LineController::batchjob_delete');
$routes->get('download/(:alpha)', 'LineController::download/$1');
});
$routes->group('ip', ['namespace' => 'App\Controllers\Admin\Equipment'], function ($routes) {
//Equipment 관련
//Part 관련
$routes->group('part', ['namespace' => 'App\Controllers\Admin\Part'], function ($routes) {
$routes->group('switch', ['namespace' => 'App\Controllers\Admin\Part'], function ($routes) {
$routes->get('/', 'SwitchController::index');
$routes->get('create', 'SwitchController::create_form');
$routes->post('create', 'SwitchController::create');
$routes->get('modify/(:alphanum)', 'SwitchController::modify_form/$1');
$routes->post('modify/(:alphanum)', 'SwitchController::modify/$1');
$routes->get('view/(:alphanum)', 'SwitchController::view/$1');
$routes->get('delete/(:alphanum)', 'SwitchController::delete/$1');
$routes->get('toggle/(:alphanum)/(:any)', 'SwitchController::toggle/$1/$2');
$routes->post('batchjob', 'SwitchController::batchjob');
$routes->post('batchjob_delete', 'SwitchController::batchjob_delete');
$routes->get('download/(:alpha)', 'SwitchController::download/$1');
});
$routes->group('ip', ['namespace' => 'App\Controllers\Admin\Part'], function ($routes) {
$routes->get('/', 'IPController::index');
$routes->get('create', 'IPController::create_form');
$routes->post('create', 'IPController::create');
@ -220,7 +211,7 @@ $routes->group('admin', ['namespace' => 'App\Controllers\Admin', 'filter' => 'au
$routes->post('batchjob_delete', 'IPController::batchjob_delete');
$routes->get('download/(:alpha)', 'IPController::download/$1');
});
$routes->group('cs', ['namespace' => 'App\Controllers\Admin\Equipment'], function ($routes) {
$routes->group('cs', ['namespace' => 'App\Controllers\Admin\Part'], function ($routes) {
$routes->get('/', 'CSController::index');
$routes->get('create', 'CSController::create_form');
$routes->post('create', 'CSController::create');
@ -233,32 +224,71 @@ $routes->group('admin', ['namespace' => 'App\Controllers\Admin', 'filter' => 'au
$routes->post('batchjob_delete', 'CSController::batchjob_delete');
$routes->get('download/(:alpha)', 'CSController::download/$1');
});
$routes->group('part', ['namespace' => 'App\Controllers\Admin\Equipment'], function ($routes) {
$routes->get('/', 'PartController::index');
$routes->get('create', 'PartController::create_form');
$routes->post('create', 'PartController::create');
$routes->get('modify/(:num)', 'PartController::modify_form/$1');
$routes->post('modify/(:num)', 'PartController::modify/$1');
$routes->get('view/(:num)', 'PartController::view/$1');
$routes->get('delete/(:num)', 'PartController::delete/$1');
$routes->get('toggle/(:num)/(:any)', 'PartController::toggle/$1/$2');
$routes->post('batchjob', 'PartController::batchjob');
$routes->post('batchjob_delete', 'PartController::batchjob_delete');
$routes->get('download/(:alpha)', 'PartController::download/$1');
$routes->group('cpu', ['namespace' => 'App\Controllers\Admin\Part'], function ($routes) {
$routes->get('/', 'CPUController::index');
$routes->get('create', 'CPUController::create_form');
$routes->post('create', 'CPUController::create');
$routes->get('modify/(:num)', 'CPUController::modify_form/$1');
$routes->post('modify/(:num)', 'CPUController::modify/$1');
$routes->get('view/(:num)', 'CPUController::view/$1');
$routes->get('delete/(:num)', 'CPUController::delete/$1');
$routes->get('toggle/(:num)/(:any)', 'CPUController::toggle/$1/$2');
$routes->post('batchjob', 'CPUController::batchjob');
$routes->post('batchjob_delete', 'CPUController::batchjob_delete');
$routes->get('download/(:alpha)', 'CPUController::download/$1');
});
$routes->group('onetime', ['namespace' => 'App\Controllers\Admin\Equipment'], function ($routes) {
$routes->get('/', 'OnetimeController::index');
$routes->get('create', 'OnetimeController::create_form');
$routes->post('create', 'OnetimeController::create');
$routes->get('modify/(:num)', 'OnetimeController::modify_form/$1');
$routes->post('modify/(:num)', 'OnetimeController::modify/$1');
$routes->get('view/(:num)', 'OnetimeController::view/$1');
$routes->get('delete/(:num)', 'OnetimeController::delete/$1');
$routes->get('toggle/(:num)/(:any)', 'OnetimeController::toggle/$1/$2');
$routes->post('batchjob', 'OnetimeController::batchjob');
$routes->post('batchjob_delete', 'OnetimeController::batchjob_delete');
$routes->get('download/(:alpha)', 'OnetimeController::download/$1');
$routes->group('ram', ['namespace' => 'App\Controllers\Admin\Part'], function ($routes) {
$routes->get('/', 'RAMController::index');
$routes->get('create', 'RAMController::create_form');
$routes->post('create', 'RAMController::create');
$routes->get('modify/(:num)', 'RAMController::modify_form/$1');
$routes->post('modify/(:num)', 'RAMController::modify/$1');
$routes->get('view/(:num)', 'RAMController::view/$1');
$routes->get('delete/(:num)', 'RAMController::delete/$1');
$routes->get('toggle/(:num)/(:any)', 'RAMController::toggle/$1/$2');
$routes->post('batchjob', 'RAMController::batchjob');
$routes->post('batchjob_delete', 'RAMController::batchjob_delete');
$routes->get('download/(:alpha)', 'RAMController::download/$1');
});
$routes->group('disk', ['namespace' => 'App\Controllers\Admin\Part'], function ($routes) {
$routes->get('/', 'DISKController::index');
$routes->get('create', 'DISKController::create_form');
$routes->post('create', 'DISKController::create');
$routes->get('modify/(:num)', 'DISKController::modify_form/$1');
$routes->post('modify/(:num)', 'DISKController::modify/$1');
$routes->get('view/(:num)', 'DISKController::view/$1');
$routes->get('delete/(:num)', 'DISKController::delete/$1');
$routes->get('toggle/(:num)/(:any)', 'DISKController::toggle/$1/$2');
$routes->post('batchjob', 'DISKController::batchjob');
$routes->post('batchjob_delete', 'DISKController::batchjob_delete');
$routes->get('download/(:alpha)', 'DISKController::download/$1');
});
$routes->group('os', ['namespace' => 'App\Controllers\Admin\Part'], function ($routes) {
$routes->get('/', 'OSController::index');
$routes->get('create', 'OSController::create_form');
$routes->post('create', 'OSController::create');
$routes->get('modify/(:num)', 'OSController::modify_form/$1');
$routes->post('modify/(:num)', 'OSController::modify/$1');
$routes->get('view/(:num)', 'OSController::view/$1');
$routes->get('delete/(:num)', 'OSController::delete/$1');
$routes->get('toggle/(:num)/(:any)', 'OSController::toggle/$1/$2');
$routes->post('batchjob', 'OSController::batchjob');
$routes->post('batchjob_delete', 'OSController::batchjob_delete');
$routes->get('download/(:alpha)', 'OSController::download/$1');
});
$routes->group('software', ['namespace' => 'App\Controllers\Admin\Part'], function ($routes) {
$routes->get('/', 'SOFTWAREController::index');
$routes->get('create', 'SOFTWAREController::create_form');
$routes->post('create', 'SOFTWAREController::create');
$routes->get('modify/(:num)', 'SOFTWAREController::modify_form/$1');
$routes->post('modify/(:num)', 'SOFTWAREController::modify/$1');
$routes->get('view/(:num)', 'SOFTWAREController::view/$1');
$routes->get('delete/(:num)', 'SOFTWAREController::delete/$1');
$routes->get('toggle/(:num)/(:any)', 'SOFTWAREController::toggle/$1/$2');
$routes->post('batchjob', 'SOFTWAREController::batchjob');
$routes->post('batchjob_delete', 'SOFTWAREController::batchjob_delete');
$routes->get('download/(:alpha)', 'SOFTWAREController::download/$1');
});
});
//Equipment 관련
//Part 관련
});

View File

@ -1,55 +0,0 @@
<?php
namespace App\Controllers\Admin\Equipment;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use Psr\Log\LoggerInterface;
use App\Helpers\Equipment\PartHelper;
use App\Services\Equipment\PartService;
class PartController extends EquipmentController
{
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{
parent::initController($request, $response, $logger);
$this->content_title = lang("{$this->getService()->getClassName()}.title");
$this->class_path .= $this->getService()->getClassName();
$this->uri_path .= strtolower($this->getService()->getClassName('/')) . '/';
// $this->view_path .= strtolower($this->getService()->getClassName()) . DIRECTORY_SEPARATOR;
}
public function getService(): PartService
{
if (!$this->_service) {
$this->_service = new PartService();
}
return $this->_service;
}
//Index,FieldForm관
// protected function index_process(array $entities = []): array
// {
// $where = null;
// $columns = [
// "uid",
// "code",
// "CASE
// WHEN code LIKE 'CPU%' THEN 'CPU'
// WHEN code LIKE 'RAM%' THEN 'RAM'
// WHEN code LIKE 'DISK%' THEN 'DISK'
// WHEN code LIKE 'OS%' THEN 'OS'
// WHEN code LIKE 'DB%' THEN 'DB'
// WHEN code LIKE 'SOFTWARE%' THEN 'SOFTWARE'
// ELSE 'UNKNOWN'
// END AS type",
// "title",
// "price",
// "status",
// ];
// foreach ($this->getService()->getEntities($where, $columns) as $entity) {
// $entities[] = $entity;
// }
// return $entities;
// }
}

View File

@ -0,0 +1,29 @@
<?php
namespace App\Controllers\Admin\Part;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use Psr\Log\LoggerInterface;
use App\Services\Part\CPUService;
class CPUController extends PartController
{
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{
parent::initController($request, $response, $logger);
$this->content_title = lang("{$this->getService()->getClassName()}.title");
$this->class_path .= $this->getService()->getClassName();
$this->uri_path .= strtolower($this->getService()->getClassName('/')) . '/';
// $this->view_path .= strtolower($this->getService()->getClassName()) . DIRECTORY_SEPARATOR;
}
public function getService(): CPUService
{
if (!$this->_service) {
$this->_service = new CPUService();
}
return $this->_service;
}
}

View File

@ -1,15 +1,14 @@
<?php
namespace App\Controllers\Admin\Equipment;
namespace App\Controllers\Admin\Part;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use Psr\Log\LoggerInterface;
use App\Helpers\Equipment\CSHelper;
use App\Services\Equipment\CSService;
use App\Services\Part\CSService;
class CSController extends EquipmentController
class CSController extends PartController
{
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{

View File

@ -0,0 +1,30 @@
<?php
namespace App\Controllers\Admin\Part;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use Psr\Log\LoggerInterface;
use App\Services\Part\DISKService;
class DISKController extends PartController
{
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{
parent::initController($request, $response, $logger);
$this->content_title = lang("{$this->getService()->getClassName()}.title");
$this->class_path .= $this->getService()->getClassName();
$this->uri_path .= strtolower($this->getService()->getClassName('/')) . '/';
// $this->view_path .= strtolower($this->getService()->getClassName()) . DIRECTORY_SEPARATOR;
}
public function getService(): DISKService
{
if (!$this->_service) {
$this->_service = new DISKService();
}
return $this->_service;
}
//Index,FieldForm관
}

View File

@ -1,9 +1,8 @@
<?php
namespace App\Controllers\Admin\Equipment;
namespace App\Controllers\Admin\Part;
use App\Helpers\Equipment\IPHelper;
use App\Services\Equipment\IPService;
use App\Services\Part\IPService;
use App\Services\Equipment\LineService;
use CodeIgniter\HTTP\RequestInterface;
@ -11,7 +10,7 @@ use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use Psr\Log\LoggerInterface;
class IPController extends EquipmentController
class IPController extends PartController
{
private ?LineService $_lineService = null;
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)

View File

@ -0,0 +1,30 @@
<?php
namespace App\Controllers\Admin\Part;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use Psr\Log\LoggerInterface;
use App\Services\Part\OSService;
class OSController extends PartController
{
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{
parent::initController($request, $response, $logger);
$this->content_title = lang("{$this->getService()->getClassName()}.title");
$this->class_path .= $this->getService()->getClassName();
$this->uri_path .= strtolower($this->getService()->getClassName('/')) . '/';
// $this->view_path .= strtolower($this->getService()->getClassName()) . DIRECTORY_SEPARATOR;
}
public function getService(): OSService
{
if (!$this->_service) {
$this->_service = new OSService();
}
return $this->_service;
}
//Index,FieldForm관
}

View File

@ -0,0 +1,26 @@
<?php
namespace App\Controllers\Admin\Part;
use App\Controllers\Admin\AdminController;
use App\Services\Equipment\ServerService;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use Psr\Log\LoggerInterface;
abstract class PartController extends AdminController
{
private ?ServerService $_serverService = null;
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{
parent::initController($request, $response, $logger);
}
final public function getServerService(): ServerService
{
if (!$this->_serverService) {
$this->_serverService = new ServerService();
}
return $this->_serverService;
}
//Index,FieldForm관련
}

View File

@ -0,0 +1,28 @@
<?php
namespace App\Controllers\Admin\Part;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use Psr\Log\LoggerInterface;
use App\Services\Part\RAMService;
class RAMController extends PartController
{
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{
parent::initController($request, $response, $logger);
$this->content_title = lang("{$this->getService()->getClassName()}.title");
$this->class_path .= $this->getService()->getClassName();
$this->uri_path .= strtolower($this->getService()->getClassName('/')) . '/';
// $this->view_path .= strtolower($this->getService()->getClassName()) . DIRECTORY_SEPARATOR;
}
public function getService(): RAMService
{
if (!$this->_service) {
$this->_service = new RAMService();
}
return $this->_service;
}
}

View File

@ -0,0 +1,30 @@
<?php
namespace App\Controllers\Admin\Part;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use Psr\Log\LoggerInterface;
use App\Services\Part\SOFTWAREService;
class SOFTWAREController extends PartController
{
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{
parent::initController($request, $response, $logger);
$this->content_title = lang("{$this->getService()->getClassName()}.title");
$this->class_path .= $this->getService()->getClassName();
$this->uri_path .= strtolower($this->getService()->getClassName('/')) . '/';
// $this->view_path .= strtolower($this->getService()->getClassName()) . DIRECTORY_SEPARATOR;
}
public function getService(): SOFTWAREService
{
if (!$this->_service) {
$this->_service = new SOFTWAREService();
}
return $this->_service;
}
//Index,FieldForm관
}

View File

@ -1,14 +1,14 @@
<?php
namespace App\Controllers\Admin\Equipment;
namespace App\Controllers\Admin\Part;
use App\Services\Equipment\SwitchService;
use App\Services\Part\SwitchService;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use Psr\Log\LoggerInterface;
class SwitchController extends EquipmentController
class SwitchController extends PartController
{
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{

View File

@ -7,11 +7,6 @@ use CodeIgniter\Database\BaseConnection;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use Psr\Log\LoggerInterface;
use App\Libraries\DBMigration\Process\ClientProcess;
use App\Libraries\DBMigration\Process\LineProcess;
use App\Libraries\DBMigration\Process\ServerCodeProcess;
use App\Libraries\DBMigration\Process\SwitchCodeProcess;
use App\Libraries\DBMigration\Process\PartCodeProcess;
use App\Libraries\DBMigration\Process\MigrationProcessInterface;
abstract class DBMigration extends BaseController
@ -41,7 +36,7 @@ abstract class DBMigration extends BaseController
/**
* 공통 마이그레이션 처리 로직
*/
private function migration(MigrationProcessInterface $processor, array $rows, string $functionName): void
final protected function migration(MigrationProcessInterface $processor, array $rows, string $functionName): void
{
$this->getTargetDB()->transStart();
try {
@ -57,48 +52,4 @@ abstract class DBMigration extends BaseController
echo "{$functionName} 작업을 실패하였습니다.\n--------------\n" . $e->getMessage() . "\n--------------\n";
}
}
final public function client(): void
{
$this->migration(
new ClientProcess($this->getTargetDB()),
$this->getClient(),
__FUNCTION__
);
}
final public function line(): void
{
$this->migration(
new LineProcess($this->getTargetDB()),
$this->getLine(),
__FUNCTION__
);
}
final public function servercode(): void
{
$this->migration(
new ServerCodeProcess($this->getTargetDB()),
$this->getServerCode(),
__FUNCTION__
);
}
final public function switchcode(): void
{
$this->migration(
new SwitchCodeProcess($this->getTargetDB()),
$this->getSwitchCode(),
__FUNCTION__
);
}
final public function partcode(): void
{
$this->migration(
new PartCodeProcess($this->getTargetDB()),
$this->getPartCode(),
__FUNCTION__
);
}
}

View File

@ -6,7 +6,11 @@ use CodeIgniter\Database\BaseConnection;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use Psr\Log\LoggerInterface;
use App\Config\SourceDatabase;
use App\Libraries\DBMigration\Process\ClientProcess;
use App\Libraries\DBMigration\Process\LineProcess;
use App\Libraries\DBMigration\Process\ServerCodeProcess;
use App\Libraries\DBMigration\Process\SwitchCodeProcess;
use App\Libraries\DBMigration\Process\PartCodeProcess;
class SourceDB extends DBMigration
{
@ -99,4 +103,47 @@ class SourceDB extends DBMigration
{
return $this->executeFile('/home/donfig/dbmsv2/app/Database/dbmsv2_part.txt');
}
final public function client(): void
{
$this->migration(
new ClientProcess($this->getTargetDB()),
$this->getClient(),
__FUNCTION__
);
}
final public function line(): void
{
$this->migration(
new LineProcess($this->getTargetDB()),
$this->getLine(),
__FUNCTION__
);
}
final public function servercode(): void
{
$this->migration(
new ServerCodeProcess($this->getTargetDB()),
$this->getServerCode(),
__FUNCTION__
);
}
final public function switchcode(): void
{
$this->migration(
new SwitchCodeProcess($this->getTargetDB()),
$this->getSwitchCode(),
__FUNCTION__
);
}
final public function partcode(): void
{
$this->migration(
new PartCodeProcess($this->getTargetDB()),
$this->getPartCode(),
__FUNCTION__
);
}
}

File diff suppressed because it is too large Load Diff

View File

@ -128,6 +128,37 @@ LOCK TABLES `couponinfo` WRITE;
/*!40000 ALTER TABLE `couponinfo` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `cpuinfo`
--
DROP TABLE IF EXISTS `cpuinfo`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `cpuinfo` (
`uid` int(11) NOT NULL AUTO_INCREMENT COMMENT 'CPU정보',
`title` varchar(50) NOT NULL,
`price` int(11) NOT NULL DEFAULT 0 COMMENT '기본금액',
`stock` int(11) NOT NULL DEFAULT 0 COMMENT '재고',
`status` varchar(20) NOT NULL DEFAULT 'available',
`updated_at` timestamp NULL DEFAULT NULL,
`created_at` timestamp NOT NULL DEFAULT current_timestamp(),
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`uid`),
UNIQUE KEY `UQ_title` (`title`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COMMENT='CPU정보';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `cpuinfo`
--
LOCK TABLES `cpuinfo` WRITE;
/*!40000 ALTER TABLE `cpuinfo` DISABLE KEYS */;
INSERT INTO `cpuinfo` VALUES (1,'Xeon E5530 2.4Ghz 4Core',50000,97,'available','2025-09-25 04:13:04','2025-09-25 01:15:29',NULL),(2,'Xeon E5540 2.4Ghz 4Core',50000,100,'available',NULL,'2025-09-25 01:15:29',NULL),(3,'Xeon X5560 2.8Ghz 8Core',80000,99,'available','2025-09-25 04:14:07','2025-09-25 01:15:29',NULL),(4,'Xeon X5650 2.6Ghz 12Core',100000,99,'available','2025-09-25 04:15:13','2025-09-25 01:15:29',NULL),(5,'Xeon E5-2690v2 2.6Ghz 12Core',100000,99,'available','2025-09-25 04:08:25','2025-09-25 01:15:29',NULL),(6,'Xeon E5-2690v4 3.0Ghz 20Core',150000,99,'available','2025-09-25 04:10:09','2025-09-25 01:15:29',NULL);
/*!40000 ALTER TABLE `cpuinfo` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `csinfo`
--
@ -170,6 +201,38 @@ INSERT INTO `csinfo` VALUES (4,NULL,NULL,NULL,'VPC-CS','10.22.22.11',NULL,NULL,1
/*!40000 ALTER TABLE `csinfo` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `diskinfo`
--
DROP TABLE IF EXISTS `diskinfo`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `diskinfo` (
`uid` int(11) NOT NULL AUTO_INCREMENT COMMENT 'DISK정보',
`title` varchar(50) NOT NULL,
`price` int(11) NOT NULL DEFAULT 0 COMMENT '기본금액',
`stock` int(11) NOT NULL DEFAULT 0 COMMENT '재고',
`format` int(11) NOT NULL DEFAULT 0 COMMENT '포맷수',
`status` varchar(20) NOT NULL DEFAULT 'available',
`updated_at` timestamp NULL DEFAULT NULL,
`created_at` timestamp NOT NULL DEFAULT current_timestamp(),
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`uid`),
UNIQUE KEY `UQ_title` (`title`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8 COMMENT='DISK정보';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `diskinfo`
--
LOCK TABLES `diskinfo` WRITE;
/*!40000 ALTER TABLE `diskinfo` DISABLE KEYS */;
INSERT INTO `diskinfo` VALUES (1,'SATA 128G',50000,100,0,'available',NULL,'2025-09-25 01:15:29',NULL),(2,'SATA 256G',70000,100,0,'available',NULL,'2025-09-25 01:15:29',NULL),(3,'SATA 512G',90000,100,0,'available',NULL,'2025-09-25 01:15:29',NULL),(4,'SAS 128G',60000,100,0,'available',NULL,'2025-09-25 01:15:29',NULL),(5,'SAS 256G',80000,100,0,'available',NULL,'2025-09-25 01:15:29',NULL),(6,'SAS 512G',100000,100,0,'available',NULL,'2025-09-25 01:15:29',NULL),(7,'SSD 128G',60000,99,0,'available','2025-09-25 04:09:52','2025-09-25 01:15:29',NULL),(8,'SSD 256G',80000,97,0,'available','2025-09-25 04:12:06','2025-09-25 01:15:29',NULL),(9,'SSD 512G',100000,98,0,'available','2025-09-25 04:14:51','2025-09-25 01:15:29',NULL),(10,'SSD 1T',120000,99,0,'available','2025-09-25 04:15:53','2025-09-25 01:15:29',NULL),(11,'SSD 2T',150000,100,0,'available',NULL,'2025-09-25 01:15:29',NULL),(12,'NVME 512G',120000,100,0,'available',NULL,'2025-09-25 01:15:29',NULL),(13,'NVME 1T',150000,100,0,'available',NULL,'2025-09-25 01:15:29',NULL),(14,'NVME 2T',180000,100,0,'available',NULL,'2025-09-25 01:15:29',NULL);
/*!40000 ALTER TABLE `diskinfo` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `ipinfo`
--
@ -249,35 +312,34 @@ INSERT INTO `lineinfo` VALUES (1,'normal','Softbank 10G','23.125.207.0/24','2025
UNLOCK TABLES;
--
-- Table structure for table `partinfo`
-- Table structure for table `osinfo`
--
DROP TABLE IF EXISTS `partinfo`;
DROP TABLE IF EXISTS `osinfo`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `partinfo` (
`uid` int(11) NOT NULL AUTO_INCREMENT COMMENT 'PART정보',
`type` varchar(20) NOT NULL COMMENT '부품구분',
CREATE TABLE `osinfo` (
`uid` int(11) NOT NULL AUTO_INCREMENT COMMENT 'DISK정보',
`title` varchar(50) NOT NULL,
`price` int(11) NOT NULL DEFAULT 0 COMMENT '기본금액',
`stock` int(11) NOT NULL DEFAULT 0 COMMENT '재고',
`stock` int(11) NOT NULL DEFAULT 0 COMMENT '재고',
`status` varchar(20) NOT NULL DEFAULT 'available',
`updated_at` timestamp NULL DEFAULT NULL,
`created_at` timestamp NOT NULL DEFAULT current_timestamp(),
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`uid`),
UNIQUE KEY `UQ_title` (`title`)
) ENGINE=InnoDB AUTO_INCREMENT=45 DEFAULT CHARSET=utf8 COMMENT='PART정보';
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8 COMMENT='OS정보';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `partinfo`
-- Dumping data for table `osinfo`
--
LOCK TABLES `partinfo` WRITE;
/*!40000 ALTER TABLE `partinfo` DISABLE KEYS */;
INSERT INTO `partinfo` VALUES (1,'CPU','Xeon E5530 2.4Ghz 4Core',50000,99,'available','2025-09-22 02:25:05','2025-09-04 04:54:34',NULL),(2,'CPU','Xeon E5540 2.4Ghz 4Core',50000,100,'available',NULL,'2025-09-04 04:54:34',NULL),(3,'CPU','Xeon X5560 2.8Ghz 8Core',80000,99,'available','2025-09-22 02:29:43','2025-09-04 04:54:34',NULL),(4,'CPU','Xeon X5650 2.6Ghz 12Core',100000,99,'available','2025-09-22 02:30:46','2025-09-04 04:54:34',NULL),(5,'CPU','Xeon E5-2690v2 2.6Ghz 12Core',100000,95,'available','2025-09-22 02:35:58','2025-09-04 04:54:34',NULL),(6,'CPU','Xeon E5-2690v4 3.0Ghz 20Core',150000,100,'available','2025-09-05 00:04:09','2025-09-04 04:54:34',NULL),(7,'RAM','2G',20000,99,'available','2025-09-22 02:28:56','2025-09-04 04:54:34',NULL),(8,'RAM','4G',30000,99,'available','2025-09-22 02:30:01','2025-09-04 04:54:34',NULL),(9,'RAM','8G',40000,99,'available','2025-09-22 02:31:04','2025-09-04 04:54:34',NULL),(10,'RAM','16G',60000,97,'available','2025-09-22 02:35:08','2025-09-04 04:54:34',NULL),(11,'RAM','32G',100000,99,'available','2025-09-22 02:36:15','2025-09-04 04:54:34',NULL),(12,'RAM','64G',100000,100,'available',NULL,'2025-09-04 04:54:34',NULL),(13,'DISK','SATA 128G',50000,99,'available','2025-09-22 02:29:14','2025-09-04 04:54:34',NULL),(14,'DISK','SATA 256G',70000,99,'available','2025-09-22 02:30:26','2025-09-04 04:54:34',NULL),(15,'DISK','SATA 512G',90000,99,'available','2025-09-22 02:33:05','2025-09-04 04:54:34',NULL),(16,'DISK','SAS 128G',60000,100,'available',NULL,'2025-09-04 04:54:34',NULL),(17,'DISK','SAS 256G',80000,100,'available','2025-09-22 02:33:05','2025-09-04 04:54:34',NULL),(18,'DISK','SAS 512G',100000,98,'available','2025-09-22 02:35:34','2025-09-04 04:54:34',NULL),(19,'DISK','SSD 128G',60000,100,'available',NULL,'2025-09-04 04:54:34',NULL),(20,'DISK','SSD 256G',80000,99,'available','2025-09-22 02:34:23','2025-09-04 04:54:34',NULL),(21,'DISK','SSD 512G',100000,100,'available',NULL,'2025-09-04 04:54:34',NULL),(22,'DISK','SSD 1T',120000,100,'available','2025-09-05 00:04:09','2025-09-04 04:54:34',NULL),(23,'DISK','SSD 2T',150000,100,'available',NULL,'2025-09-04 04:54:34',NULL),(24,'DISK','NVME 512G',120000,99,'available','2025-09-22 02:36:30','2025-09-04 04:54:34',NULL),(25,'DISK','NVME 1T',150000,100,'available',NULL,'2025-09-04 04:54:34',NULL),(26,'DISK','NVME 2T',180000,100,'available',NULL,'2025-09-04 04:54:34',NULL),(27,'OS','Windows 10',10000,100,'available',NULL,'2025-09-04 04:54:34',NULL),(28,'OS','Windows 11',20000,100,'available',NULL,'2025-09-04 04:54:34',NULL),(29,'OS','Windows NT 2008R2',30000,100,'available',NULL,'2025-09-04 04:54:34',NULL),(30,'OS','Windows NT 2012R2',30000,100,'available',NULL,'2025-09-04 04:54:34',NULL),(31,'OS','Windows NT 2016R2',30000,100,'available',NULL,'2025-09-04 04:54:34',NULL),(32,'OS','Windows NT 2019R2',30000,100,'available',NULL,'2025-09-04 04:54:34',NULL),(33,'OS','CentOS 7',10000,100,'available',NULL,'2025-09-04 04:54:34',NULL),(34,'OS','CentOS 8',10000,100,'available',NULL,'2025-09-04 04:54:34',NULL),(35,'OS','CentOS 9',10000,100,'available',NULL,'2025-09-04 04:54:34',NULL),(36,'OS','Ununtu 20.04',10000,100,'available',NULL,'2025-09-04 04:54:34',NULL),(37,'OS','Ununtu 21.04',10000,100,'available',NULL,'2025-09-04 04:54:34',NULL),(38,'OS','Ununtu 22.04',10000,100,'available',NULL,'2025-09-04 04:54:34',NULL),(39,'DB','Windows MSSQL 2008',10000,100,'available',NULL,'2025-09-04 04:54:34',NULL),(40,'DB','Windows MSSQL 2012',10000,100,'available',NULL,'2025-09-04 04:54:34',NULL),(41,'DB','Mysql',10000,100,'available',NULL,'2025-09-04 04:54:34',NULL),(42,'DB','Postgress',10000,100,'available',NULL,'2025-09-04 04:54:34',NULL),(43,'SOFTWARE','닷디펜더',50000,100,'available','2025-09-18 03:12:40','2025-09-04 04:54:34',NULL),(44,'SOFTWARE','딥파인더',50000,100,'available',NULL,'2025-09-04 04:54:34',NULL);
/*!40000 ALTER TABLE `partinfo` ENABLE KEYS */;
LOCK TABLES `osinfo` WRITE;
/*!40000 ALTER TABLE `osinfo` DISABLE KEYS */;
INSERT INTO `osinfo` VALUES (1,'Windows 10',10000,100,'available',NULL,'2025-09-25 01:15:29',NULL),(2,'Windows 11',20000,100,'available',NULL,'2025-09-25 01:15:29',NULL),(3,'Windows NT 2008R2',30000,100,'available',NULL,'2025-09-25 01:15:29',NULL),(4,'Windows NT 2012R2',30000,100,'available',NULL,'2025-09-25 01:15:29',NULL),(5,'Windows NT 2016R2',30000,100,'available',NULL,'2025-09-25 01:15:29',NULL),(6,'Windows NT 2019R2',30000,100,'available',NULL,'2025-09-25 01:15:29',NULL),(7,'CentOS 7',10000,100,'available',NULL,'2025-09-25 01:15:29',NULL),(8,'CentOS 8',10000,100,'available',NULL,'2025-09-25 01:15:29',NULL),(9,'CentOS 9',10000,100,'available',NULL,'2025-09-25 01:15:29',NULL),(10,'Ununtu 20.04',10000,100,'available',NULL,'2025-09-25 01:15:29',NULL),(11,'Ununtu 21.04',10000,100,'available',NULL,'2025-09-25 01:15:29',NULL),(12,'Ununtu 22.04',10000,100,'available',NULL,'2025-09-25 01:15:29',NULL);
/*!40000 ALTER TABLE `osinfo` ENABLE KEYS */;
UNLOCK TABLES;
--
@ -354,6 +416,37 @@ LOCK TABLES `pointinfo` WRITE;
/*!40000 ALTER TABLE `pointinfo` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `raminfo`
--
DROP TABLE IF EXISTS `raminfo`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `raminfo` (
`uid` int(11) NOT NULL AUTO_INCREMENT COMMENT 'RAM정보',
`title` varchar(50) NOT NULL,
`price` int(11) NOT NULL DEFAULT 0 COMMENT '기본금액',
`stock` int(11) NOT NULL DEFAULT 0 COMMENT '재고',
`status` varchar(20) NOT NULL DEFAULT 'available',
`updated_at` timestamp NULL DEFAULT NULL,
`created_at` timestamp NOT NULL DEFAULT current_timestamp(),
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`uid`),
UNIQUE KEY `UQ_title` (`title`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COMMENT='RAM정보';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `raminfo`
--
LOCK TABLES `raminfo` WRITE;
/*!40000 ALTER TABLE `raminfo` DISABLE KEYS */;
INSERT INTO `raminfo` VALUES (1,'2G',20000,99,'available','2025-09-25 04:09:26','2025-09-25 01:15:29',NULL),(2,'4G',30000,97,'available','2025-09-25 04:11:36','2025-09-25 01:15:29',NULL),(3,'8G',40000,99,'available','2025-09-25 04:13:26','2025-09-25 01:15:29',NULL),(4,'16G',60000,99,'available','2025-09-25 04:14:28','2025-09-25 01:15:29',NULL),(5,'32G',100000,99,'available','2025-09-25 04:15:33','2025-09-25 01:15:29',NULL),(6,'64G',100000,100,'available',NULL,'2025-09-25 01:15:29',NULL);
/*!40000 ALTER TABLE `raminfo` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `serverinfo`
--
@ -423,7 +516,7 @@ CREATE TABLE `serverpartinfo` (
CONSTRAINT `FK_payment_TO_serverpartinfo` FOREIGN KEY (`payment_uid`) REFERENCES `payment` (`uid`),
CONSTRAINT `FK_serverinfo_TO_serverpartinfo` FOREIGN KEY (`serverinfo_uid`) REFERENCES `serverinfo` (`uid`),
CONSTRAINT `FK_serviceinfo_TO_serverpartinfo` FOREIGN KEY (`serviceinfo_uid`) REFERENCES `serviceinfo` (`uid`)
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8 COMMENT='서버파트정보';
) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=utf8 COMMENT='서버파트정보';
/*!40101 SET character_set_client = @saved_cs_client */;
--
@ -432,7 +525,7 @@ CREATE TABLE `serverpartinfo` (
LOCK TABLES `serverpartinfo` WRITE;
/*!40000 ALTER TABLE `serverpartinfo` DISABLE KEYS */;
INSERT INTO `serverpartinfo` VALUES (1,NULL,NULL,1,17,NULL,'Xeon E5530 2.4Ghz 4Core','CPU','base',50000,1,NULL,NULL,'2025-09-22 02:25:05'),(2,NULL,NULL,7,17,NULL,'2G','RAM','base',20000,1,NULL,NULL,'2025-09-22 02:28:56'),(3,NULL,NULL,13,17,NULL,'SATA 128G','DISK','base',50000,1,NULL,NULL,'2025-09-22 02:29:14'),(4,NULL,NULL,3,18,NULL,'Xeon X5560 2.8Ghz 8Core','CPU','base',80000,1,NULL,NULL,'2025-09-22 02:29:43'),(5,NULL,NULL,8,18,NULL,'4G','RAM','base',30000,1,NULL,NULL,'2025-09-22 02:30:01'),(6,NULL,NULL,14,18,NULL,'SATA 256G','DISK','base',70000,1,NULL,NULL,'2025-09-22 02:30:26'),(7,NULL,NULL,4,19,NULL,'Xeon X5650 2.6Ghz 12Core','CPU','base',100000,1,NULL,NULL,'2025-09-22 02:30:46'),(8,NULL,NULL,9,19,NULL,'8G','RAM','base',40000,1,NULL,NULL,'2025-09-22 02:31:04'),(9,NULL,NULL,15,19,NULL,'SATA 512G','DISK','base',90000,1,NULL,'2025-09-22 02:33:05','2025-09-22 02:31:29'),(10,NULL,NULL,5,20,NULL,'Xeon E5-2690v2 2.6Ghz 12Core','CPU','base',100000,1,NULL,NULL,'2025-09-22 02:33:29'),(11,NULL,NULL,10,20,NULL,'16G','RAM','base',60000,1,NULL,NULL,'2025-09-22 02:33:54'),(12,NULL,NULL,20,20,NULL,'SSD 256G','DISK','base',80000,1,NULL,NULL,'2025-09-22 02:34:23'),(13,NULL,NULL,5,21,NULL,'Xeon E5-2690v2 2.6Ghz 12Core','CPU','base',100000,2,NULL,NULL,'2025-09-22 02:34:47'),(14,NULL,NULL,10,21,NULL,'16G','RAM','base',60000,2,NULL,NULL,'2025-09-22 02:35:08'),(15,NULL,NULL,18,21,NULL,'SAS 512G','DISK','base',100000,2,'RAID1',NULL,'2025-09-22 02:35:34'),(16,NULL,NULL,5,22,NULL,'Xeon E5-2690v2 2.6Ghz 12Core','CPU','base',100000,2,NULL,NULL,'2025-09-22 02:35:58'),(17,NULL,NULL,11,22,NULL,'32G','RAM','base',100000,1,NULL,NULL,'2025-09-22 02:36:15'),(18,NULL,NULL,24,22,NULL,'NVME 512G','DISK','base',120000,1,NULL,NULL,'2025-09-22 02:36:30');
INSERT INTO `serverpartinfo` VALUES (19,NULL,NULL,5,17,NULL,'Xeon E5-2690v2 2.6Ghz 12Core','CPU','base',100000,1,NULL,NULL,'2025-09-25 04:08:25'),(20,NULL,NULL,1,17,NULL,'2G','RAM','base',20000,1,NULL,NULL,'2025-09-25 04:09:26'),(21,NULL,NULL,7,17,NULL,'SSD 128G','DISK','base',60000,1,NULL,NULL,'2025-09-25 04:09:52'),(22,NULL,NULL,6,18,NULL,'Xeon E5-2690v4 3.0Ghz 20Core','CPU','base',150000,1,NULL,NULL,'2025-09-25 04:10:09'),(23,NULL,NULL,2,18,NULL,'4G','RAM','base',30000,1,NULL,NULL,'2025-09-25 04:10:27'),(24,NULL,NULL,8,18,NULL,'SSD 256G','DISK','base',80000,1,NULL,NULL,'2025-09-25 04:10:49'),(25,NULL,NULL,1,19,NULL,'Xeon E5530 2.4Ghz 4Core','CPU','base',50000,2,NULL,'2025-09-25 04:12:26','2025-09-25 04:11:12'),(26,NULL,NULL,2,19,NULL,'4G','RAM','base',30000,2,NULL,NULL,'2025-09-25 04:11:36'),(27,NULL,NULL,8,19,NULL,'SSD 256G','DISK','base',80000,2,'RAID1',NULL,'2025-09-25 04:12:06'),(28,NULL,NULL,1,20,NULL,'Xeon E5530 2.4Ghz 4Core','CPU','base',50000,1,NULL,NULL,'2025-09-25 04:13:04'),(29,NULL,NULL,3,20,NULL,'8G','RAM','base',40000,1,NULL,NULL,'2025-09-25 04:13:26'),(30,NULL,NULL,9,20,NULL,'SSD 512G','DISK','base',100000,1,NULL,NULL,'2025-09-25 04:13:45'),(31,NULL,NULL,3,21,NULL,'Xeon X5560 2.8Ghz 8Core','CPU','base',80000,1,NULL,NULL,'2025-09-25 04:14:07'),(32,NULL,NULL,4,21,NULL,'16G','RAM','base',60000,1,NULL,NULL,'2025-09-25 04:14:28'),(33,NULL,NULL,9,21,NULL,'SSD 512G','DISK','base',100000,1,NULL,NULL,'2025-09-25 04:14:51'),(34,NULL,NULL,4,22,NULL,'Xeon X5650 2.6Ghz 12Core','CPU','base',100000,1,NULL,NULL,'2025-09-25 04:15:13'),(35,NULL,NULL,5,22,NULL,'32G','RAM','base',100000,1,NULL,NULL,'2025-09-25 04:15:33'),(36,NULL,NULL,10,22,NULL,'SSD 1T','DISK','base',120000,1,NULL,NULL,'2025-09-25 04:15:53');
/*!40000 ALTER TABLE `serverpartinfo` ENABLE KEYS */;
UNLOCK TABLES;
@ -486,6 +579,37 @@ LOCK TABLES `serviceinfo` WRITE;
/*!40000 ALTER TABLE `serviceinfo` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `softwareinfo`
--
DROP TABLE IF EXISTS `softwareinfo`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `softwareinfo` (
`uid` int(11) NOT NULL AUTO_INCREMENT COMMENT 'PART정보',
`title` varchar(50) NOT NULL,
`price` int(11) NOT NULL DEFAULT 0 COMMENT '기본금액',
`stock` int(11) NOT NULL DEFAULT 0 COMMENT '재고',
`status` varchar(20) NOT NULL DEFAULT 'available',
`updated_at` timestamp NULL DEFAULT NULL,
`created_at` timestamp NOT NULL DEFAULT current_timestamp(),
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`uid`),
UNIQUE KEY `UQ_title` (`title`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='소프트웨어정보';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `softwareinfo`
--
LOCK TABLES `softwareinfo` WRITE;
/*!40000 ALTER TABLE `softwareinfo` DISABLE KEYS */;
INSERT INTO `softwareinfo` VALUES (1,'닷디펜더',50000,100,'available',NULL,'2025-09-25 01:15:29',NULL),(2,'딥파인더',50000,100,'available',NULL,'2025-09-25 01:15:29',NULL);
/*!40000 ALTER TABLE `softwareinfo` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `switchinfo`
--
@ -600,4 +724,4 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2025-09-23 17:57:24
-- Dump completed on 2025-09-25 13:16:08

View File

@ -36,9 +36,5 @@ OS,CentOS 9,10000
OS,Ununtu 20.04,10000
OS,Ununtu 21.04,10000
OS,Ununtu 22.04,10000
DB,Windows MSSQL 2008,10000
DB,Windows MSSQL 2012,10000
DB,Mysql,10000
DB,Postgress,10000
SOFTWARE,닷디펜더,50000
SOFTWARE,딥파인더,50000

View File

@ -433,7 +433,7 @@ CREATE TABLE `serverpartinfo` (
LOCK TABLES `serverpartinfo` WRITE;
/*!40000 ALTER TABLE `serverpartinfo` DISABLE KEYS */;
INSERT INTO `serverpartinfo` VALUES (1,NULL,NULL,1,17,NULL,'Xeon E5530 2.4Ghz 4Core','CPU','base',50000,1,NULL,NULL,'2025-09-22 02:25:05'),(2,NULL,NULL,7,17,NULL,'2G','RAM','base',20000,1,NULL,NULL,'2025-09-22 02:28:56'),(3,NULL,NULL,13,17,NULL,'SATA 128G','DISK','base',50000,1,NULL,NULL,'2025-09-22 02:29:14'),(4,NULL,NULL,3,18,NULL,'Xeon X5560 2.8Ghz 8Core','CPU','base',80000,1,NULL,NULL,'2025-09-22 02:29:43'),(5,NULL,NULL,8,18,NULL,'4G','RAM','base',30000,1,NULL,NULL,'2025-09-22 02:30:01'),(6,NULL,NULL,14,18,NULL,'SATA 256G','DISK','base',70000,1,NULL,NULL,'2025-09-22 02:30:26'),(7,NULL,NULL,4,19,NULL,'Xeon X5650 2.6Ghz 12Core','CPU','base',100000,1,NULL,NULL,'2025-09-22 02:30:46'),(8,NULL,NULL,9,19,NULL,'8G','RAM','base',40000,1,NULL,NULL,'2025-09-22 02:31:04'),(9,NULL,NULL,15,19,NULL,'SATA 512G','DISK','base',90000,1,NULL,'2025-09-22 02:33:05','2025-09-22 02:31:29'),(10,NULL,NULL,5,20,NULL,'Xeon E5-2690v2 2.6Ghz 12Core','CPU','base',100000,1,NULL,NULL,'2025-09-22 02:33:29'),(11,NULL,NULL,10,20,NULL,'16G','RAM','base',60000,1,NULL,NULL,'2025-09-22 02:33:54'),(12,NULL,NULL,20,20,NULL,'SSD 256G','DISK','base',80000,1,NULL,NULL,'2025-09-22 02:34:23'),(13,NULL,NULL,5,21,NULL,'Xeon E5-2690v2 2.6Ghz 12Core','CPU','base',100000,2,NULL,NULL,'2025-09-22 02:34:47'),(14,NULL,NULL,10,21,NULL,'16G','RAM','base',60000,2,NULL,NULL,'2025-09-22 02:35:08'),(15,NULL,NULL,18,21,NULL,'SAS 512G','DISK','base',100000,2,'RAID1',NULL,'2025-09-22 02:35:34'),(16,NULL,NULL,5,22,NULL,'Xeon E5-2690v2 2.6Ghz 12Core','CPU','base',100000,2,NULL,NULL,'2025-09-22 02:35:58'),(17,NULL,NULL,11,22,NULL,'32G','RAM','base',100000,1,NULL,NULL,'2025-09-22 02:36:15'),(18,NULL,NULL,24,22,NULL,'NVME 512G','DISK','base',120000,1,NULL,NULL,'2025-09-22 02:36:30'),(19,772,NULL,661,17,30,'C01PA46','SWITCH','base',0,1,NULL,NULL,'2025-09-23 23:57:41'),(20,772,NULL,261,17,30,'13.220.20.4','IP','base',0,1,NULL,'2025-09-24 00:37:51','2025-09-23 23:58:13'),(21,772,NULL,27,17,30,'Windows 10','OS','base',0,1,NULL,NULL,'2025-09-23 23:58:38'),(22,790,NULL,40,18,31,'C02PA09','SWITCH','base',0,1,NULL,NULL,'2025-09-24 00:07:56'),(23,790,NULL,128,18,31,'23.125.207.127','IP','base',0,1,NULL,'2025-09-24 00:37:40','2025-09-24 00:08:38'),(24,790,NULL,35,18,31,'CentOS 9','OS','base',10000,1,NULL,NULL,'2025-09-24 00:08:59'),(25,820,NULL,466,22,32,'C03PA08','SWITCH','base',0,1,NULL,NULL,'2025-09-24 00:10:14'),(26,820,NULL,269,22,32,'13.220.20.12','IP','base',0,1,NULL,'2025-09-24 00:37:27','2025-09-24 00:10:44'),(27,820,NULL,32,22,32,'Windows NT 2019R2','OS','base',30000,1,NULL,NULL,'2025-09-24 00:11:05'),(28,820,NULL,43,22,32,'닷디펜더','SOFTWARE','month',100000,1,NULL,'2025-09-24 01:07:32','2025-09-24 00:11:39'),(29,820,NULL,264,22,32,'13.220.20.7','IP','month',50000,1,NULL,NULL,'2025-09-24 01:08:14');
INSERT INTO `serverpartinfo` VALUES (1,NULL,NULL,1,17,NULL,'Xeon E5530 2.4Ghz 4Core','CPU','base',50000,1,NULL,NULL,'2025-09-22 02:25:05'),(2,NULL,NULL,7,17,NULL,'2G','RAM','base',20000,1,NULL,NULL,'2025-09-22 02:28:56'),(3,NULL,NULL,13,17,NULL,'SATA 128G','DISK','base',50000,1,NULL,NULL,'2025-09-22 02:29:14'),(4,NULL,NULL,3,18,NULL,'Xeon X5560 2.8Ghz 8Core','CPU','base',80000,1,NULL,NULL,'2025-09-22 02:29:43'),(5,NULL,NULL,8,18,NULL,'4G','RAM','base',30000,1,NULL,NULL,'2025-09-22 02:30:01'),(6,NULL,NULL,14,18,NULL,'SATA 256G','DISK','base',70000,1,NULL,NULL,'2025-09-22 02:30:26'),(7,NULL,NULL,4,19,NULL,'Xeon X5650 2.6Ghz 12Core','CPU','base',100000,1,NULL,NULL,'2025-09-22 02:30:46'),(8,NULL,NULL,9,19,NULL,'8G','RAM','base',40000,1,NULL,NULL,'2025-09-22 02:31:04'),(9,NULL,NULL,15,19,NULL,'SATA 512G','DISK','base',90000,1,NULL,'2025-09-22 02:33:05','2025-09-22 02:31:29'),(10,NULL,NULL,5,20,NULL,'Xeon E5-2690v2 2.6Ghz 12Core','CPU','base',100000,1,NULL,NULL,'2025-09-22 02:33:29'),(11,NULL,NULL,10,20,NULL,'16G','RAM','base',60000,1,NULL,NULL,'2025-09-22 02:33:54'),(12,NULL,NULL,20,20,NULL,'SSD 256G','DISK','base',80000,1,NULL,NULL,'2025-09-22 02:34:23'),(13,NULL,NULL,5,21,NULL,'Xeon E5-2690v2 2.6Ghz 12Core','CPU','base',100000,2,NULL,NULL,'2025-09-22 02:34:47'),(14,NULL,NULL,10,21,NULL,'16G','RAM','base',60000,2,NULL,NULL,'2025-09-22 02:35:08'),(15,NULL,NULL,18,21,NULL,'SAS 512G','DISK','base',100000,2,'RAID1',NULL,'2025-09-22 02:35:34'),(16,NULL,NULL,5,22,NULL,'Xeon E5-2690v2 2.6Ghz 12Core','CPU','base',100000,2,NULL,NULL,'2025-09-22 02:35:58'),(17,NULL,NULL,11,22,NULL,'32G','RAM','base',100000,1,NULL,NULL,'2025-09-22 02:36:15'),(18,NULL,NULL,24,22,NULL,'NVME 512G','DISK','base',120000,1,NULL,NULL,'2025-09-22 02:36:30'),(19,772,NULL,661,17,30,'C01PA46','Switch','base',0,1,NULL,NULL,'2025-09-23 23:57:41'),(20,772,NULL,261,17,30,'13.220.20.4','IP','base',0,1,NULL,'2025-09-24 00:37:51','2025-09-23 23:58:13'),(21,772,NULL,27,17,30,'Windows 10','OS','base',0,1,NULL,NULL,'2025-09-23 23:58:38'),(22,790,NULL,40,18,31,'C02PA09','Switch','base',0,1,NULL,NULL,'2025-09-24 00:07:56'),(23,790,NULL,128,18,31,'23.125.207.127','IP','base',0,1,NULL,'2025-09-24 00:37:40','2025-09-24 00:08:38'),(24,790,NULL,35,18,31,'CentOS 9','OS','base',10000,1,NULL,NULL,'2025-09-24 00:08:59'),(25,820,NULL,466,22,32,'C03PA08','Switch','base',0,1,NULL,NULL,'2025-09-24 00:10:14'),(26,820,NULL,269,22,32,'13.220.20.12','IP','base',0,1,NULL,'2025-09-24 00:37:27','2025-09-24 00:10:44'),(27,820,NULL,32,22,32,'Windows NT 2019R2','OS','base',30000,1,NULL,NULL,'2025-09-24 00:11:05'),(28,820,NULL,43,22,32,'닷디펜더','SOFTWARE','month',100000,1,NULL,'2025-09-24 01:07:32','2025-09-24 00:11:39'),(29,820,NULL,264,22,32,'13.220.20.7','IP','month',50000,1,NULL,NULL,'2025-09-24 01:08:14');
/*!40000 ALTER TABLE `serverpartinfo` ENABLE KEYS */;
UNLOCK TABLES;

View File

@ -1,33 +0,0 @@
<?php
namespace App\Entities\Equipment;
use App\Models\Equipment\CSModel;
class CSEntity extends EquipmentEntity
{
const PK = CSModel::PK;
const TITLE = CSModel::TITLE;
const DEFAULT_STATUS = STATUS['AVAILABLE'];
final public function getClientInfoUID(): string|null
{
return $this->attributes['clientinfo_uid'];
}
final public function getServiceInfoUID(): string|null
{
return $this->attributes['serviceinfo_uid'];
}
final public function getServerInfoUID(): string|null
{
return $this->attributes['serverinfo_uid'];
}
//기본기능
public function getPrice(): int
{
return $this->attributes['price'];
}
public function getCustomTitle(): string
{
return $this->getTitle() . " " . number_format($this->getPrice()) . "";
}
}

View File

@ -1,29 +0,0 @@
<?php
namespace App\Entities\Equipment;
use App\Models\Equipment\PartModel;
class PartEntity extends EquipmentEntity
{
const PK = PartModel::PK;
const TITLE = PartModel::TITLE;
const DEFAULT_STATUS = STATUS['AVAILABLE'];
public function getType(): string
{
return $this->attributes['type'];
}
public function getPrice(): int
{
return $this->attributes['price'];
}
public function getStock(): int
{
return $this->attributes['stock'];
}
public function getCustomTitle(): string
{
return $this->getTitle() . " " . number_format($this->getPrice()) . "";
}
}

View File

@ -1,29 +0,0 @@
<?php
namespace App\Entities\Equipment;
use App\Models\Equipment\SwitchModel;
class SwitchEntity extends EquipmentEntity
{
const PK = SwitchModel::PK;
const TITLE = SwitchModel::TITLE;
const DEFAULT_STATUS = STATUS['AVAILABLE'];
final public function getClientInfoUID(): string|null
{
return $this->attributes['clientinfo_uid'];
}
final public function getServiceInfoUID(): string|null
{
return $this->attributes['serviceinfo_uid'];
}
final public function getServerInfoUID(): string|null
{
return $this->attributes['serverinfo_uid'];
}
//기본기능
public function getPrice(): int
{
return $this->attributes['price'] ?? 0;
}
}

View File

@ -0,0 +1,12 @@
<?php
namespace App\Entities\Part;
use App\Models\Part\CPUModel;
class CPUEntity extends PartEntity
{
const PK = CPUModel::PK;
const TITLE = CPUModel::TITLE;
const DEFAULT_STATUS = STATUS['AVAILABLE'];
}

View File

@ -0,0 +1,12 @@
<?php
namespace App\Entities\Part;
use App\Models\Part\CSModel;
class CSEntity extends PartEntity
{
const PK = CSModel::PK;
const TITLE = CSModel::TITLE;
const DEFAULT_STATUS = STATUS['AVAILABLE'];
}

View File

@ -0,0 +1,12 @@
<?php
namespace App\Entities\Part;
use App\Models\Part\DISKModel;
class DISKEntity extends PartEntity
{
const PK = DISKModel::PK;
const TITLE = DISKModel::TITLE;
const DEFAULT_STATUS = STATUS['AVAILABLE'];
}

View File

@ -0,0 +1,21 @@
<?php
namespace App\Entities\Part;
use App\Models\Part\IPModel;
class IPEntity extends PartEntity
{
const PK = IPModel::PK;
const TITLE = IPModel::TITLE;
const DEFAULT_STATUS = STATUS['AVAILABLE'];
final public function getOldClientInfoUID(): string|null
{
return $this->attributes['old_clientinfo_uid'];
}
//기본기능
public function getIP(): string
{
return $this->attributes['ip'];
}
}

View File

@ -0,0 +1,12 @@
<?php
namespace App\Entities\Part;
use App\Models\Part\OSModel;
class OSEntity extends PartEntity
{
const PK = OSModel::PK;
const TITLE = OSModel::TITLE;
const DEFAULT_STATUS = STATUS['AVAILABLE'];
}

View File

@ -1,22 +1,19 @@
<?php
namespace App\Entities\Equipment;
namespace App\Entities\Part;
use App\Models\Equipment\IPModel;
use App\Entities\CommonEntity;
class IPEntity extends EquipmentEntity
abstract class PartEntity extends CommonEntity
{
const PK = IPModel::PK;
const TITLE = IPModel::TITLE;
const DEFAULT_STATUS = STATUS['AVAILABLE'];
public function __construct(array|null $data = null)
{
parent::__construct($data);
}
final public function getClientInfoUID(): string|null
{
return $this->attributes['clientinfo_uid'];
}
final public function getOldClientInfoUID(): string|null
{
return $this->attributes['old_clientinfo_uid'];
}
final public function getServiceInfoUID(): string|null
{
return $this->attributes['serviceinfo_uid'];
@ -29,16 +26,15 @@ class IPEntity extends EquipmentEntity
{
return $this->attributes['lineinfo_uid'];
}
//기본기능
public function getIP(): string
{
return $this->attributes['ip'];
}
public function getPrice(): int
final public function getPrice(): int
{
return $this->attributes['price'];
}
public function getCustomTitle(): string
final public function getStock(): int
{
return $this->attributes['stock'];
}
final public function getCustomTitle(): string
{
return $this->getTitle() . " " . number_format($this->getPrice()) . "";
}

View File

@ -0,0 +1,12 @@
<?php
namespace App\Entities\Part;
use App\Models\Part\RAMModel;
class RAMEntity extends PartEntity
{
const PK = RAMModel::PK;
const TITLE = RAMModel::TITLE;
const DEFAULT_STATUS = STATUS['AVAILABLE'];
}

View File

@ -0,0 +1,12 @@
<?php
namespace App\Entities\Part;
use App\Models\Part\SOFTWAREModel;
class SOFTWAREEntity extends PartEntity
{
const PK = SOFTWAREModel::PK;
const TITLE = SOFTWAREModel::TITLE;
const DEFAULT_STATUS = STATUS['AVAILABLE'];
}

View 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'];
}

View File

@ -1,14 +0,0 @@
<?php
namespace App\Helpers\Equipment;
use App\Models\Equipment\PartModel;
class PartHelper extends EquipmentHelper
{
public function __construct()
{
parent::__construct();
$this->setTitleField(field: PartModel::TITLE);
}
}

View File

@ -105,14 +105,12 @@ class ServerPartHelper extends EquipmentHelper
case 'RAM':
case 'DISK':
case 'OS':
case 'DB':
case 'SOFTWARE':
case 'SWITCH':
case 'Switch':
case 'IP':
case 'CS':
case 'ETC':
//파트 Entity
$title = $field === 'ETC' ? $viewDatas['entity']->getTitle() : $viewDatas['entity']->getPartEntity()->getTitle();
$title = $viewDatas['entity']->getPartEntity()->getTitle();
$title .= $viewDatas['entity']->getCnt() > 1 ? "*" . $viewDatas['entity']->getCnt() . "" : "";
$title .= $viewDatas['entity']->getExtra() !== "" ? "[" . $viewDatas['entity']->getExtra() . "]" : "";
if (array_key_exists('return', $extras) && $extras['return'] == 'onlyText') {
@ -144,16 +142,14 @@ class ServerPartHelper extends EquipmentHelper
public function getListButton(string $action, string $label, array $viewDatas, array $extras = []): string
{
switch ($action) {
case 'SWITCH':
case 'Switch':
case 'IP':
case 'CS':
case 'CPU':
case 'RAM':
case 'DISK':
case 'OS':
case 'DB':
case 'SOFTWARE':
case 'ETC':
$extras = [
"class" => "btn btn-sm btn-outline btn-circle",
"target" => "_self",

View File

@ -0,0 +1,14 @@
<?php
namespace App\Helpers\Part;
use App\Models\Part\CPUModel;
class CPUHelper extends PartHelper
{
public function __construct()
{
parent::__construct();
$this->setTitleField(field: CPUModel::TITLE);
}
}

View File

@ -1,10 +1,10 @@
<?php
namespace App\Helpers\Equipment;
namespace App\Helpers\Part;
use App\Models\Equipment\CSModel;
use App\Models\Part\CSModel;
class CSHelper extends EquipmentHelper
class CSHelper extends PartHelper
{
public function __construct()
{

View File

@ -0,0 +1,14 @@
<?php
namespace App\Helpers\Part;
use App\Models\Part\DISKModel;
class DISKHelper extends PartHelper
{
public function __construct()
{
parent::__construct();
$this->setTitleField(field: DISKModel::TITLE);
}
}

View File

@ -1,10 +1,10 @@
<?php
namespace App\Helpers\Equipment;
namespace App\Helpers\Part;
use App\Models\Equipment\IPModel;
use App\Models\Part\IPModel;
class IPHelper extends EquipmentHelper
class IPHelper extends PartHelper
{
public function __construct()
{

View File

@ -0,0 +1,14 @@
<?php
namespace App\Helpers\Part;
use App\Models\Part\OSModel;
class OSHelper extends PartHelper
{
public function __construct()
{
parent::__construct();
$this->setTitleField(field: OSModel::TITLE);
}
}

View File

@ -0,0 +1,13 @@
<?php
namespace App\Helpers\Part;
use App\Helpers\CommonHelper;
abstract class PartHelper extends CommonHelper
{
public function __construct()
{
parent::__construct();
}
}

View File

@ -0,0 +1,14 @@
<?php
namespace App\Helpers\Part;
use App\Models\Part\RAMModel;
class RAMHelper extends PartHelper
{
public function __construct()
{
parent::__construct();
$this->setTitleField(field: RAMModel::TITLE);
}
}

View File

@ -0,0 +1,14 @@
<?php
namespace App\Helpers\Part;
use App\Models\Part\SOFTWAREModel;
class SOFTWAREHelper extends PartHelper
{
public function __construct()
{
parent::__construct();
$this->setTitleField(field: SOFTWAREModel::TITLE);
}
}

View File

@ -1,10 +1,10 @@
<?php
namespace App\Helpers\Equipment;
namespace App\Helpers\Part;
use App\Models\Equipment\SwitchModel;
use App\Models\Part\SwitchModel;
class SwitchHelper extends EquipmentHelper
class SwitchHelper extends PartHelper
{
public function __construct()
{

View File

@ -31,7 +31,6 @@ return [
"SWITCH" => "스위치",
"IP" => "IP",
"CS" => "CS",
"ETC" => "기타",
],
"EXTRA" => [
'DISK' => [

View File

@ -1,8 +1,7 @@
<?php
return [
'title' => "부품정보",
'title' => "CPU정보",
'label' => [
'type' => "종류",
'title' => "모델명",
'price' => "기본가",
'stock' => "재고",
@ -11,14 +10,6 @@ return [
'created_at' => "작성일",
'deleted_at' => "삭제일",
],
"TYPE" => [
"CPU" => "CPU",
"RAM" => "메모리",
"DISK" => "저장장치",
"OS" => "운영체제",
"DB" => "데이터베이스",
"SOFTWARE" => "소프트웨어",
],
"STATUS" => [
STATUS['AVAILABLE'] => "사용가능",
STATUS['FORBIDDEN'] => "사용불가",

View File

@ -1,6 +1,6 @@
<?php
return [
'title' => "CS(VPN)정보",
'title' => "CS정보",
'label' => [
'' => "서버",
'clientinfo_uid' => "고객",

View File

@ -0,0 +1,17 @@
<?php
return [
'title' => "DISK정보",
'label' => [
'title' => "모델명",
'price' => "기본가",
'stock' => "재고",
'status' => "상태",
'updated_at' => "수정일",
'created_at' => "작성일",
'deleted_at' => "삭제일",
],
"STATUS" => [
STATUS['AVAILABLE'] => "사용가능",
STATUS['FORBIDDEN'] => "사용불가",
],
];

View File

@ -0,0 +1,17 @@
<?php
return [
'title' => "OS정보",
'label' => [
'title' => "모델명",
'price' => "기본가",
'stock' => "재고",
'status' => "상태",
'updated_at' => "수정일",
'created_at' => "작성일",
'deleted_at' => "삭제일",
],
"STATUS" => [
STATUS['AVAILABLE'] => "사용가능",
STATUS['FORBIDDEN'] => "사용불가",
],
];

View File

@ -0,0 +1,17 @@
<?php
return [
'title' => "RAM정보",
'label' => [
'title' => "모델명",
'price' => "기본가",
'stock' => "재고",
'status' => "상태",
'updated_at' => "수정일",
'created_at' => "작성일",
'deleted_at' => "삭제일",
],
"STATUS" => [
STATUS['AVAILABLE'] => "사용가능",
STATUS['FORBIDDEN'] => "사용불가",
],
];

View File

@ -0,0 +1,17 @@
<?php
return [
'title' => "SOFTWARE정보",
'label' => [
'title' => "모델명",
'price' => "기본가",
'stock' => "재고",
'status' => "상태",
'updated_at' => "수정일",
'created_at' => "작성일",
'deleted_at' => "삭제일",
],
"STATUS" => [
STATUS['AVAILABLE'] => "사용가능",
STATUS['FORBIDDEN'] => "사용불가",
],
];

View File

@ -2,7 +2,6 @@
namespace App\Libraries\DBMigration\Process;
use App\Entities\Equipment\PartEntity;
use CodeIgniter\Database\BaseConnection;
class PartCodeProcess implements MigrationProcessInterface
@ -20,30 +19,32 @@ class PartCodeProcess implements MigrationProcessInterface
}
$temps = [];
$temps['type'] = trim($row[0]);
$temps['title'] = trim($row[1]);
$temps['price'] = trim($row[2]);
$temps['status'] = PartEntity::DEFAULT_STATUS;
// INSERT
$result = $this->db->table('partinfo')->insert($temps);
$temps['stock'] = 100;
$temps['status'] = "available";
switch (trim($row[0])) {
case 'CPU':
$table = 'cpuinfo';
break;
case 'RAM':
$table = 'raminfo';
break;
case 'DISK':
$table = 'diskinfo';
break;
case 'OS':
$table = 'osinfo';
break;
case 'SOFTWARE':
$table = 'softwareinfo';
break;
}
$result = $this->db->table($table)->insert($temps);
if (!$result) {
throw new \Exception($this->db->error()['message']);
}
// 방금 insert된 uid 가져오기
$insertId = $this->db->insertID();
// code 값 생성 (예: CPU123)
$code = $row[0] . $insertId;
// code 업데이트
$this->db->table('partinfo')
->where('uid', $insertId)
->update(['code' => $code]);
echo "{$cnt} -> {$temps['title']} ({$code}) PARTCODE 완료.\n";
echo "{$cnt} -> {$temps['title']} 완료.\n";
} catch (\Exception $e) {
echo $e->getMessage();
}

View File

@ -1,47 +0,0 @@
<?php
namespace App\Models\Equipment;
use App\Entities\Equipment\PartEntity;
class PartModel extends EquipmentModel
{
const TABLE = "partinfo";
const PK = "uid";
const TITLE = "title";
protected $table = self::TABLE;
protected $primaryKey = self::PK;
protected $returnType = PartEntity::class;
protected $allowedFields = [
"type",
"title",
"price",
"stock",
"status",
"updated_at"
];
public function __construct()
{
parent::__construct();
}
final public function getFormRule(string $action, string $field): string
{
if (is_array($field)) {
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
}
switch ($field) {
case "type":
case "status":
$rule = "required|trim|string";
break;
case "price":
case "stock":
$rule = "required|numeric";
break;
default:
$rule = parent::getFormRule($action, $field);
break;
}
return $rule;
}
}

View File

@ -0,0 +1,27 @@
<?php
namespace App\Models\Part;
use App\Entities\Part\CPUEntity;
class CPUModel extends PartModel
{
const TABLE = "cpuinfo";
const PK = "uid";
const TITLE = "title";
protected $table = self::TABLE;
protected $primaryKey = self::PK;
// protected $useAutoIncrement = false;
protected $returnType = CPUEntity::class;
protected $allowedFields = [
"title",
"price",
"stock",
"status",
"updated_at"
];
public function __construct()
{
parent::__construct();
}
}

View File

@ -1,10 +1,10 @@
<?php
namespace App\Models\Equipment;
namespace App\Models\Part;
use App\Entities\Equipment\CSEntity;
use App\Entities\Part\CSEntity;
class CSModel extends EquipmentModel
class CSModel extends PartModel
{
const TABLE = "csinfo";
const PK = "uid";
@ -41,13 +41,13 @@ class CSModel extends EquipmentModel
$rule = "required|trim|valid_ip[both]"; //ipv4 , ipv6 , both(ipv4,ipv6)
$rule .= in_array($action, ["create", "create_form"]) ? "|is_unique[" . $this->getTable() . "." . $field . "]" : "";
break;
case "price":
$rule = "required|numeric";
break;
case "accountid":
case "domain":
$rule = "permit_empty|trim|string";
break;
case "status":
$rule = "required|trim|string";
break;
default:
$rule = parent::getFormRule($action, $field);
break;

View File

@ -0,0 +1,27 @@
<?php
namespace App\Models\Part;
use App\Entities\Part\DISKEntity;
class DISKModel extends PartModel
{
const TABLE = "diskinfo";
const PK = "uid";
const TITLE = "title";
protected $table = self::TABLE;
protected $primaryKey = self::PK;
// protected $useAutoIncrement = false;
protected $returnType = DISKEntity::class;
protected $allowedFields = [
"title",
"price",
"stock",
"status",
"updated_at"
];
public function __construct()
{
parent::__construct();
}
}

View File

@ -1,10 +1,10 @@
<?php
namespace App\Models\Equipment;
namespace App\Models\Part;
use App\Entities\Equipment\IPEntity;
use App\Entities\Part\IPEntity;
class IPModel extends EquipmentModel
class IPModel extends PartModel
{
const TABLE = "ipinfo";
const PK = "uid";
@ -34,19 +34,18 @@ class IPModel extends EquipmentModel
}
switch ($field) {
case "lineinfo_uid":
case "price":
$rule = "required|numeric";
break;
case "old_clientinfo_uid":
$rule = "permit_empty|numeric";
break;
case "status":
$rule = "permit_empty|trim|string";
break;
case "ip":
$rule = "required|trim|valid_ip[both]"; //ipv4 , ipv6 , both(ipv4,ipv6)
$rule .= in_array($action, ["create", "create_form"]) ? "|is_unique[{$this->table}.{$field}]" : "";
break;
case "status":
$rule = "required|trim|string";
break;
default:
$rule = parent::getFormRule($action, $field);
break;

View File

@ -0,0 +1,27 @@
<?php
namespace App\Models\Part;
use App\Entities\Part\OSEntity;
class OSModel extends PartModel
{
const TABLE = "osinfo";
const PK = "uid";
const TITLE = "title";
protected $table = self::TABLE;
protected $primaryKey = self::PK;
// protected $useAutoIncrement = false;
protected $returnType = OSEntity::class;
protected $allowedFields = [
"title",
"price",
"stock",
"status",
"updated_at"
];
public function __construct()
{
parent::__construct();
}
}

View File

@ -0,0 +1,42 @@
<?php
namespace App\Models\Part;
use App\Models\CommonModel;
abstract class PartModel extends CommonModel
{
protected function __construct()
{
parent::__construct();
}
public function getFormRule(string $action, string $field): string
{
if (is_array($field)) {
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
}
switch ($field) {
case "title":
$rule = "required|trim|string";
$rule .= in_array($action, ["create", "create_form"]) ? "|is_unique[" . $this->getTable() . "." . $field . "]" : "";
break;
case "clientinfo_uid":
case "serviceinfo_uid":
case "serverinfo_uid":
$rule = "permit_empty|trim|string";
break;
case "price":
case "stock":
$rule = "required|numeric";
break;
case "status":
$rule = "permit_empty|trim|string";
break;
default:
$rule = parent::getFormRule($action, $field);
break;
}
return $rule;
}
}

View File

@ -0,0 +1,27 @@
<?php
namespace App\Models\Part;
use App\Entities\Part\RAMEntity;
class RAMModel extends PartModel
{
const TABLE = "raminfo";
const PK = "uid";
const TITLE = "title";
protected $table = self::TABLE;
protected $primaryKey = self::PK;
// protected $useAutoIncrement = false;
protected $returnType = RAMEntity::class;
protected $allowedFields = [
"title",
"price",
"stock",
"status",
"updated_at"
];
public function __construct()
{
parent::__construct();
}
}

View File

@ -0,0 +1,27 @@
<?php
namespace App\Models\Part;
use App\Entities\Part\SOFTWAREEntity;
class SOFTWAREModel extends PartModel
{
const TABLE = "softwareinfo";
const PK = "uid";
const TITLE = "title";
protected $table = self::TABLE;
protected $primaryKey = self::PK;
// protected $useAutoIncrement = false;
protected $returnType = SOFTWAREEntity::class;
protected $allowedFields = [
"title",
"price",
"stock",
"status",
"updated_at"
];
public function __construct()
{
parent::__construct();
}
}

View File

@ -1,10 +1,10 @@
<?php
namespace App\Models\Equipment;
namespace App\Models\Part;
use App\Entities\Equipment\SwitchEntity;
use App\Entities\Part\SwitchEntity;
class SwitchModel extends EquipmentModel
class SwitchModel extends PartModel
{
const TABLE = "switchinfo";
const PK = "uid";
@ -35,9 +35,6 @@ class SwitchModel extends EquipmentModel
case "status":
$rule = "required|trim|string";
break;
case "price":
$rule = "permit_empty|numeric";
break;
default:
$rule = parent::getFormRule($action, $field);
break;

View File

@ -239,9 +239,8 @@ class ServiceService extends CustomerService
case 'RAM':
case 'DISK':
case 'OS':
case 'DB':
case 'SOFTWARE':
case 'SWITCH':
case 'Switch':
case 'IP':
case 'CS':
$options = $this->getServerService()->getFormOption($field, $options);

View File

@ -0,0 +1,53 @@
<?php
namespace App\Services\Equipment\ServerPart;
use App\Entities\Equipment\ServerPartEntity;
use App\Interfaces\Equipment\ServerPartInterface;
use App\Services\Part\CPUService as ParentService;
use App\Entities\Part\CPUEntity;
class CPUService extends ParentService implements ServerPartInterface
{
public function __construct()
{
parent::__construct();
}
//서버연결정보용 등록
private function action_process(ServerPartEntity $serverPartEntity, string $action): CPUEntity
{
//부품정보가져오기
$entity = $this->getEntity($serverPartEntity->getPartUID());
if (!$entity instanceof CPUEntity) {
throw new \Exception("{$serverPartEntity->getPartUID()}에 해당하는 부품정보를 찾을수없습니다.");
}
//부품정보에 서버정보 설정 및 서비스,고객정보 정의
$formDatas = [];
if ($action === "return") { //해지된 부품 재고 반납 처리
$formDatas['stock'] = $entity->getStock() + $serverPartEntity->getCnt();
}
if ($action === "use") { //사용된 부품 재고 사용처리
if ($entity->getStock() < $serverPartEntity->getCnt()) {
throw new \Exception("현재 재고수[{$entity->getStock()}]보다 지정하신 갯수({$serverPartEntity->getCnt()})가 더 많습니다.");
}
$formDatas['stock'] = $entity->getStock() - $serverPartEntity->getCnt();
}
return parent::modify($entity, $formDatas);
}
public function createServerPart(ServerPartEntity $serverPartEntity): ServerPartEntity
{
$entity = $this->action_process($serverPartEntity, "use");
return $serverPartEntity->setPartEntity($entity);
}
public function modifyServerPart(ServerPartEntity $serverPartEntity): ServerPartEntity
{
return $this->createServerPart($serverPartEntity,);
}
public function deleteServerPart(ServerPartEntity $serverPartEntity): ServerPartEntity
{
$entity = $this->action_process($serverPartEntity, "return");
return $serverPartEntity->setPartEntity($entity);
}
}

View File

@ -3,9 +3,9 @@
namespace App\Services\Equipment\ServerPart;
use App\Entities\Equipment\ServerPartEntity;
use App\Entities\Equipment\CSEntity;
use App\Interfaces\Equipment\ServerPartInterface;
use App\Services\Equipment\CSService as ParentService;
use App\Entities\Part\CSEntity;
use App\Services\Part\CSService as ParentService;
class CSService extends ParentService implements ServerPartInterface
{

View File

@ -2,12 +2,12 @@
namespace App\Services\Equipment\ServerPart;
use App\Entities\Equipment\PartEntity;
use App\Entities\Equipment\ServerPartEntity;
use App\Interfaces\Equipment\ServerPartInterface;
use App\Services\Equipment\PartService as ParentService;
use App\Services\Part\DISKService as ParentService;
use App\Entities\Part\DISKEntity;
class PartService extends ParentService implements ServerPartInterface
class DISKService extends ParentService implements ServerPartInterface
{
public function __construct()
{
@ -15,11 +15,11 @@ class PartService extends ParentService implements ServerPartInterface
}
//서버연결정보용 등록
private function action_process(ServerPartEntity $serverPartEntity, string $action): PartEntity
private function action_process(ServerPartEntity $serverPartEntity, string $action): DISKEntity
{
//부품정보가져오기
$entity = $this->getEntity($serverPartEntity->getPartUID());
if (!$entity instanceof PartEntity) {
if (!$entity instanceof DISKEntity) {
throw new \Exception("{$serverPartEntity->getPartUID()}에 해당하는 부품정보를 찾을수없습니다.");
}
//부품정보에 서버정보 설정 및 서비스,고객정보 정의

View File

@ -3,9 +3,9 @@
namespace App\Services\Equipment\ServerPart;
use App\Entities\Equipment\ServerPartEntity;
use App\Entities\Equipment\IPEntity;
use App\Interfaces\Equipment\ServerPartInterface;
use App\Services\Equipment\IPService as ParentService;
use App\Entities\Part\IPEntity;
use App\Services\Part\IPService as ParentService;
class IPService extends ParentService implements ServerPartInterface
{

View File

@ -0,0 +1,53 @@
<?php
namespace App\Services\Equipment\ServerPart;
use App\Entities\Equipment\ServerPartEntity;
use App\Interfaces\Equipment\ServerPartInterface;
use App\Services\Part\OSService as ParentService;
use App\Entities\Part\OSEntity;
class OSService extends ParentService implements ServerPartInterface
{
public function __construct()
{
parent::__construct();
}
//서버연결정보용 등록
private function action_process(ServerPartEntity $serverPartEntity, string $action): OSEntity
{
//부품정보가져오기
$entity = $this->getEntity($serverPartEntity->getPartUID());
if (!$entity instanceof OSEntity) {
throw new \Exception("{$serverPartEntity->getPartUID()}에 해당하는 부품정보를 찾을수없습니다.");
}
//부품정보에 서버정보 설정 및 서비스,고객정보 정의
$formDatas = [];
if ($action === "return") { //해지된 부품 재고 반납 처리
$formDatas['stock'] = $entity->getStock() + $serverPartEntity->getCnt();
}
if ($action === "use") { //사용된 부품 재고 사용처리
if ($entity->getStock() < $serverPartEntity->getCnt()) {
throw new \Exception("현재 재고수[{$entity->getStock()}]보다 지정하신 갯수({$serverPartEntity->getCnt()})가 더 많습니다.");
}
$formDatas['stock'] = $entity->getStock() - $serverPartEntity->getCnt();
}
return parent::modify($entity, $formDatas);
}
public function createServerPart(ServerPartEntity $serverPartEntity): ServerPartEntity
{
$entity = $this->action_process($serverPartEntity, "use");
return $serverPartEntity->setPartEntity($entity);
}
public function modifyServerPart(ServerPartEntity $serverPartEntity): ServerPartEntity
{
return $this->createServerPart($serverPartEntity,);
}
public function deleteServerPart(ServerPartEntity $serverPartEntity): ServerPartEntity
{
$entity = $this->action_process($serverPartEntity, "return");
return $serverPartEntity->setPartEntity($entity);
}
}

View File

@ -28,7 +28,7 @@ class PaymentService extends ParentService implements ServerPartInterface
$formDatas['serviceinfo_uid'] = $serverPartEntity->getServiceInfoUID();
$formDatas['serverinfo_uid'] = $serverPartEntity->getServerInfoUID(); //서버연결정보 수정시에 필요함
//타이틀은 기타의 경우 직접작성한 제목을 등록하고 아닌경우는 Part의 Title을 사용한다.
$formDatas['title'] = $serverPartEntity->getType() === 'ETC' ? $serverPartEntity->getTitle() : $serverPartEntity->getPartEntity()->getTitle();
$formDatas['title'] = $serverPartEntity->getPartEntity()->getTitle();
$formDatas['amount'] = $serverPartEntity->getCaculatedAmount(); //단가*cnt
$formDatas['billing'] = $serverPartEntity->getBilling();
return $formDatas;

View File

@ -0,0 +1,53 @@
<?php
namespace App\Services\Equipment\ServerPart;
use App\Entities\Equipment\ServerPartEntity;
use App\Interfaces\Equipment\ServerPartInterface;
use App\Services\Part\RAMService as ParentService;
use App\Entities\Part\RAMEntity;
class RAMService extends ParentService implements ServerPartInterface
{
public function __construct()
{
parent::__construct();
}
//서버연결정보용 등록
private function action_process(ServerPartEntity $serverPartEntity, string $action): RAMEntity
{
//부품정보가져오기
$entity = $this->getEntity($serverPartEntity->getPartUID());
if (!$entity instanceof RAMEntity) {
throw new \Exception("{$serverPartEntity->getPartUID()}에 해당하는 부품정보를 찾을수없습니다.");
}
//부품정보에 서버정보 설정 및 서비스,고객정보 정의
$formDatas = [];
if ($action === "return") { //해지된 부품 재고 반납 처리
$formDatas['stock'] = $entity->getStock() + $serverPartEntity->getCnt();
}
if ($action === "use") { //사용된 부품 재고 사용처리
if ($entity->getStock() < $serverPartEntity->getCnt()) {
throw new \Exception("현재 재고수[{$entity->getStock()}]보다 지정하신 갯수({$serverPartEntity->getCnt()})가 더 많습니다.");
}
$formDatas['stock'] = $entity->getStock() - $serverPartEntity->getCnt();
}
return parent::modify($entity, $formDatas);
}
public function createServerPart(ServerPartEntity $serverPartEntity): ServerPartEntity
{
$entity = $this->action_process($serverPartEntity, "use");
return $serverPartEntity->setPartEntity($entity);
}
public function modifyServerPart(ServerPartEntity $serverPartEntity): ServerPartEntity
{
return $this->createServerPart($serverPartEntity,);
}
public function deleteServerPart(ServerPartEntity $serverPartEntity): ServerPartEntity
{
$entity = $this->action_process($serverPartEntity, "return");
return $serverPartEntity->setPartEntity($entity);
}
}

View File

@ -0,0 +1,53 @@
<?php
namespace App\Services\Equipment\ServerPart;
use App\Entities\Equipment\ServerPartEntity;
use App\Interfaces\Equipment\ServerPartInterface;
use App\Services\Part\SOFTWAREService as ParentService;
use App\Entities\Part\SOFTWAREEntity;
class SOFTWAREService extends ParentService implements ServerPartInterface
{
public function __construct()
{
parent::__construct();
}
//서버연결정보용 등록
private function action_process(ServerPartEntity $serverPartEntity, string $action): SOFTWAREEntity
{
//부품정보가져오기
$entity = $this->getEntity($serverPartEntity->getPartUID());
if (!$entity instanceof SOFTWAREEntity) {
throw new \Exception("{$serverPartEntity->getPartUID()}에 해당하는 부품정보를 찾을수없습니다.");
}
//부품정보에 서버정보 설정 및 서비스,고객정보 정의
$formDatas = [];
if ($action === "return") { //해지된 부품 재고 반납 처리
$formDatas['stock'] = $entity->getStock() + $serverPartEntity->getCnt();
}
if ($action === "use") { //사용된 부품 재고 사용처리
if ($entity->getStock() < $serverPartEntity->getCnt()) {
throw new \Exception("현재 재고수[{$entity->getStock()}]보다 지정하신 갯수({$serverPartEntity->getCnt()})가 더 많습니다.");
}
$formDatas['stock'] = $entity->getStock() - $serverPartEntity->getCnt();
}
return parent::modify($entity, $formDatas);
}
public function createServerPart(ServerPartEntity $serverPartEntity): ServerPartEntity
{
$entity = $this->action_process($serverPartEntity, "use");
return $serverPartEntity->setPartEntity($entity);
}
public function modifyServerPart(ServerPartEntity $serverPartEntity): ServerPartEntity
{
return $this->createServerPart($serverPartEntity,);
}
public function deleteServerPart(ServerPartEntity $serverPartEntity): ServerPartEntity
{
$entity = $this->action_process($serverPartEntity, "return");
return $serverPartEntity->setPartEntity($entity);
}
}

View File

@ -3,9 +3,9 @@
namespace App\Services\Equipment\ServerPart;
use App\Entities\Equipment\ServerPartEntity;
use App\Entities\Equipment\SwitchEntity;
use App\Interfaces\Equipment\ServerPartInterface;
use App\Services\Equipment\SwitchService as ParentService;
use App\Entities\Part\SwitchEntity;
use App\Services\Part\SwitchService as ParentService;
class SwitchService extends ParentService implements ServerPartInterface
{

View File

@ -7,24 +7,17 @@ use App\Entities\Equipment\ServerPartEntity;
use App\Entities\PaymentEntity;
use App\Helpers\Equipment\ServerPartHelper;
use App\Models\Equipment\ServerPartModel;
use App\Services\Equipment\EquipmentService;
use App\Services\Equipment\ServerPart\CSService;
use App\Services\Equipment\ServerPart\IPService;
use App\Services\Equipment\ServerPart\PartService;
use App\Services\Equipment\ServerPart\PaymentService;
use App\Services\Equipment\ServerPart\ServiceService;
use App\Services\Equipment\ServerPart\SwitchService;
use App\Services\Equipment\ServerService;
use App\Services\Equipment\EquipmentService;
use App\Services\Equipment\ServerPart\ServiceService;
use App\Services\Equipment\ServerPart\PaymentService;
class ServerPartService extends EquipmentService
{
private ?ServiceService $_serviceService = null;
private ?ServerService $_serverService = null;
private ?SwitchService $_switchService = null;
private ?PartService $_partService = null;
private ?IPService $_ipService = null;
private ?CSService $_csService = null;
private ?PaymentService $_paymentService = null;
private $_partServices = [];
public function __construct()
{
parent::__construct(new ServerPartModel(), new ServerPartHelper());
@ -92,34 +85,6 @@ class ServerPartService extends EquipmentService
}
return $this->_serverService;
}
final public function getPartService(): PartService
{
if (!$this->_partService) {
$this->_partService = new PartService();
}
return $this->_partService;
}
final public function getSwitchService(): SwitchService
{
if (!$this->_switchService) {
$this->_switchService = new SwitchService();
}
return $this->_switchService;
}
final public function getIPService(): IPService
{
if (!$this->_ipService) {
$this->_ipService = new IPService();
}
return $this->_ipService;
}
final public function getCSService(): CSService
{
if (!$this->_csService) {
$this->_csService = new CSService();
}
return $this->_csService;
}
final public function getPaymentService(): PaymentService
{
if (!$this->_paymentService) {
@ -127,31 +92,25 @@ class ServerPartService extends EquipmentService
}
return $this->_paymentService;
}
final public function getPartService(string $type): object
{
if (!array_key_exists($type, $this->_partServices)) {
$class = "App\\Services\\Equipment\\ServerPart\\{$type}Service";
if (!class_exists($class)) {
throw new \Exception("{$class} 클래스가 존재하지 않습니다.");
}
$this->_partServices[$type] = new $class();
}
return $this->_partServices[$type];
}
//partEntity 정보 추가
protected function getEntity_process(mixed $entity): ServerPartEntity
{
if (!$entity instanceof ServerPartEntity) {
throw new \Exception(__METHOD__ . "에서 형식오류:ServicePartEntity만 허용됩니다.");
}
switch ($entity->getType()) {
case 'CPU':
case 'RAM':
case 'DISK':
case 'OS':
case 'DB':
case 'SOFTWARE':
$entity->setPartEntity($this->getPartService()->getEntity($entity->getPartUID()));
break;
case 'SWITCH':
$entity->setPartEntity($this->getSwitchService()->getEntity($entity->getPartUID()));
break;
case 'IP':
$entity->setPartEntity($this->getIPService()->getEntity($entity->getPartUID()));
break;
case 'CS':
$entity->setPartEntity($this->getCSService()->getEntity($entity->getPartUID()));
break;
}
//각 파트서비스 정의
$entity->setPartEntity($this->getPartService($entity->getType())->getEntity($entity->getPartUID()));
//결제정보 정의
if ($entity->getPaymentUID()) {
$paymentEntity = $this->getPaymentService()->getEntity($entity->getPaymentUID());
@ -172,28 +131,7 @@ class ServerPartService extends EquipmentService
case 'part_uid':
$partOptions = [];
foreach (SERVERPART['ALL_PARTTYPES'] as $partType) {
switch ($partType) {
case 'CPU':
case 'RAM':
case 'DISK':
case 'OS':
case 'DB':
case 'SOFTWARE':
$partOptions[$partType] = $this->getPartService()->getEntities(['type' => $partType]);
break;
case 'SWITCH':
$partOptions[$partType] = $this->getSwitchService()->getEntities();
break;
case 'IP':
$partOptions[$partType] = $this->getIPService()->getEntities();
break;
case 'CS':
$partOptions[$partType] = $this->getCSService()->getEntities();
break;
default:
$partOptions[$partType] = [];
break;
}
$partOptions[$partType] = $this->getPartService($partType)->getEntities();
}
$options = $partOptions;
// dd($options);
@ -211,25 +149,7 @@ class ServerPartService extends EquipmentService
private function action_process(ServerPartEntity $entity, string $action): ServerPartEntity
{
//Type에 따른 부품서비스 정의
switch ($entity->getType()) {
case 'CPU':
case 'RAM':
case 'DISK':
case 'OS':
case 'DB':
case 'SOFTWARE': //재고수 처리 필요
$entity = $this->getPartService()->$action($entity);
break;
case 'SWITCH': //사용여부 처리 필요
$entity = $this->getSwitchService()->$action($entity);
break;
case 'IP': //사용여부 처리 필요
$entity = $this->getIPService()->$action($entity);
break;
case 'CS': //사용여부 처리 필요
$entity = $this->getCSService()->$action($entity);
break;
}
$this->getPartService($entity->getType())->$action($entity);
//서비스 및 결제정보 처리
switch ($entity->getBilling()) {
case PAYMENT['BILLING']['MONTH']: //월별과금일때만 처리

View File

@ -1,23 +1,22 @@
<?php
namespace App\Services\Equipment;
namespace App\Services\Part;
use App\Entities\Equipment\PartEntity;
use App\Helpers\Equipment\PartHelper;
use App\Models\Equipment\PartModel;
use App\Entities\Part\CPUEntity;
use App\Helpers\Part\CPUHelper;
use App\Models\Part\CPUModel;
class PartService extends EquipmentService
class CPUService extends PartService
{
public function __construct()
{
parent::__construct(new PartModel(), new PartHelper());
$this->addClassName('Part');
parent::__construct(new CPUModel(), new CPUHelper());
$this->addClassName('CPU');
}
public function getFormFields(): array
{
return [
"type",
"title",
"price",
"stock",
@ -27,14 +26,12 @@ class PartService extends EquipmentService
public function getFormFilters(): array
{
return [
'type',
'status',
];
}
public function getIndexFields(): array
{
return [
"type",
"title",
"price",
"stock",
@ -43,14 +40,14 @@ class PartService extends EquipmentService
}
public function getBatchjobFields(): array
{
return ['type', 'status'];
return ['status'];
}
//기본 기능부분
//FieldForm관련용
//OrderBy 처리
public function setOrderBy(mixed $field = null, mixed $value = null): void
{
$this->getModel()->orderBy('type ASC,uid ASC');
$this->getModel()->orderBy('title ASC');
parent::setOrderBy($field, $value);
}
}

View File

@ -1,13 +1,14 @@
<?php
namespace App\Services\Equipment;
namespace App\Services\Part;
use App\Helpers\Equipment\CSHelper;
use App\Models\Equipment\CSModel;
use App\Helpers\Part\CSHelper;
use App\Models\Part\CSModel;
use App\Services\Customer\ClientService;
use App\Services\Customer\ServiceService;
use App\Services\Equipment\ServerService;
class CSService extends EquipmentService
class CSService extends PartService
{
private ?ClientService $_clientService = null;
private ?ServiceService $_serviceService = null;

View File

@ -0,0 +1,53 @@
<?php
namespace App\Services\Part;
use App\Entities\Part\DISKEntity;
use App\Helpers\Part\DISKHelper;
use App\Models\Part\DISKModel;
class DISKService extends PartService
{
public function __construct()
{
parent::__construct(new DISKModel(), new DISKHelper());
$this->addClassName('DISK');
}
public function getFormFields(): array
{
return [
"title",
"price",
"stock",
"status",
];
}
public function getFormFilters(): array
{
return [
'status',
];
}
public function getIndexFields(): array
{
return [
"title",
"price",
"stock",
"status",
];
}
public function getBatchjobFields(): array
{
return ['status'];
}
//기본 기능부분
//FieldForm관련용
//OrderBy 처리
public function setOrderBy(mixed $field = null, mixed $value = null): void
{
$this->getModel()->orderBy('title ASC');
parent::setOrderBy($field, $value);
}
}

View File

@ -1,15 +1,16 @@
<?php
namespace App\Services\Equipment;
namespace App\Services\Part;
use App\Helpers\Equipment\IPHelper;
use App\Models\Equipment\IPModel;
use App\Helpers\Part\IPHelper;
use App\Models\Part\IPModel;
use App\Services\Customer\ClientService;
use App\Services\Customer\ServiceService;
use App\Services\Equipment\EquipmentService;
use App\Services\Equipment\LineService;
use App\Services\Equipment\ServerService;
use App\Services\Part\PartService;
class IPService extends EquipmentService
class IPService extends PartService
{
private ?LineService $_lineService = null;
private ?ClientService $_clientService = null;

View File

@ -0,0 +1,53 @@
<?php
namespace App\Services\Part;
use App\Entities\Part\OSEntity;
use App\Helpers\Part\OSHelper;
use App\Models\Part\OSModel;
class OSService extends PartService
{
public function __construct()
{
parent::__construct(new OSModel(), new OSHelper());
$this->addClassName('OS');
}
public function getFormFields(): array
{
return [
"title",
"price",
"stock",
"status",
];
}
public function getFormFilters(): array
{
return [
'status',
];
}
public function getIndexFields(): array
{
return [
"title",
"price",
"stock",
"status",
];
}
public function getBatchjobFields(): array
{
return ['status'];
}
//기본 기능부분
//FieldForm관련용
//OrderBy 처리
public function setOrderBy(mixed $field = null, mixed $value = null): void
{
$this->getModel()->orderBy('title ASC');
parent::setOrderBy($field, $value);
}
}

View File

@ -0,0 +1,18 @@
<?php
namespace App\Services\Part;
use App\Entities\Customer\ClientEntity;
use App\Helpers\CommonHelper;
use App\Models\CommonModel;
use App\Services\CommonService;
abstract class PartService extends CommonService
{
protected function __construct(CommonModel $model, CommonHelper $helper)
{
parent::__construct($model, $helper);
$this->addClassName('Part');
}
}

View File

@ -0,0 +1,53 @@
<?php
namespace App\Services\Part;
use App\Entities\Part\RAMEntity;
use App\Helpers\Part\RAMHelper;
use App\Models\Part\RAMModel;
class RAMService extends PartService
{
public function __construct()
{
parent::__construct(new RAMModel(), new RAMHelper());
$this->addClassName('RAM');
}
public function getFormFields(): array
{
return [
"title",
"price",
"stock",
"status",
];
}
public function getFormFilters(): array
{
return [
'status',
];
}
public function getIndexFields(): array
{
return [
"title",
"price",
"stock",
"status",
];
}
public function getBatchjobFields(): array
{
return ['status'];
}
//기본 기능부분
//FieldForm관련용
//OrderBy 처리
public function setOrderBy(mixed $field = null, mixed $value = null): void
{
$this->getModel()->orderBy('title ASC');
parent::setOrderBy($field, $value);
}
}

View File

@ -0,0 +1,53 @@
<?php
namespace App\Services\Part;
use App\Entities\Part\SOFTWAREEntity;
use App\Helpers\Part\SOFTWAREHelper;
use App\Models\Part\SOFTWAREModel;
class SOFTWAREService extends PartService
{
public function __construct()
{
parent::__construct(new SOFTWAREModel(), new SOFTWAREHelper());
$this->addClassName('SOFTWARE');
}
public function getFormFields(): array
{
return [
"title",
"price",
"stock",
"status",
];
}
public function getFormFilters(): array
{
return [
'status',
];
}
public function getIndexFields(): array
{
return [
"title",
"price",
"stock",
"status",
];
}
public function getBatchjobFields(): array
{
return ['status'];
}
//기본 기능부분
//FieldForm관련용
//OrderBy 처리
public function setOrderBy(mixed $field = null, mixed $value = null): void
{
$this->getModel()->orderBy('title ASC');
parent::setOrderBy($field, $value);
}
}

View File

@ -1,13 +1,14 @@
<?php
namespace App\Services\Equipment;
namespace App\Services\Part;
use App\Helpers\Equipment\SwitchHelper;
use App\Models\Equipment\SwitchModel;
use App\Helpers\Part\SwitchHelper;
use App\Models\Part\SwitchModel;
use App\Services\Customer\ServiceService;
use App\Services\Equipment\EquipmentService;
use App\Services\Equipment\ServerService;
use App\Services\Part\PartService;
class SwitchService extends EquipmentService
class SwitchService extends PartService
{
private ?ServiceService $_serviceService = null;
private ?ServerService $_serverService = null;

View File

@ -9,6 +9,7 @@
<?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/left_menu/base'); ?>
<?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/left_menu/customer'); ?>
<?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/left_menu/equipment'); ?>
<?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/left_menu/part'); ?>
</div>
<div id="menu_button">메뉴열기</div>
</div>

View File

@ -5,22 +5,13 @@
</button>
</h2>
<div id="flush-equipment" class="accordion-collapse collapse" aria-labelledby="flush-equipment">
<div class="accordion-item">
<a href="/admin/equipment/switch"><?= ICONS['SETUP'] ?>Switch정보</a>
</div>
<div class="accordion-item">
<a href="/admin/equipment/line"><?= ICONS['SERVICE_ITEM_LINE'] ?>회선정보</a>
</div>
<div class="accordion-item">
<a href="/admin/equipment/ip"><?= ICONS['SERVICE_ITEM_IP'] ?>IP정보</a>
</div>
<div class="accordion-item">
<a href="/admin/equipment/cs"><?= ICONS['SERVICE_ITEM_DEFENCE'] ?>CS정보</a>
</div>
<div class="accordion-item">
<a href="/admin/equipment/server"><?= ICONS['SERVICE_ITEM_SERVER'] ?>Server정보</a>
</div>
<div class="accordion-item">
<a href="/admin/equipment/part"><?= ICONS['SERVICE_ITEM_SOFTWARE'] ?>부품정보</a>
<a href="/admin/equipment/serverpart"><?= ICONS['SERVICE_ITEM_SERVER'] ?>Server부품연결정보</a>
</div>
</div>

View File

@ -0,0 +1,32 @@
<h2 class="accordion-header">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse"
data-bs-target="#flush-part" aria-expanded="true"
aria-controls="flush-part"><b><?= ICONS['DEVICE'] ?> 파트관리 </b>
</button>
</h2>
<div id="flush-part" class="accordion-collapse collapse" aria-labelledby="flush-part">
<div class="accordion-item">
<a href="/admin/part/switch"><?= ICONS['SETUP'] ?>Switch정보</a>
</div>
<div class="accordion-item">
<a href="/admin/part/ip"><?= ICONS['SERVICE_ITEM_IP'] ?>IP정보</a>
</div>
<div class="accordion-item">
<a href="/admin/part/cs"><?= ICONS['SERVICE_ITEM_DEFENCE'] ?>CS정보</a>
</div>
<div class="accordion-item">
<a href="/admin/part/cpu"><?= ICONS['SERVER_ITEM_CPU'] ?>CPU정보</a>
</div>
<div class="accordion-item">
<a href="/admin/part/ram"><?= ICONS['SERVER_ITEM_RAM'] ?>RAM정보</a>
</div>
<div class="accordion-item">
<a href="/admin/part/disk"><?= ICONS['SERVER_ITEM_DISK'] ?>DISK정보</a>
</div>
<div class="accordion-item">
<a href="/admin/part/os"><?= ICONS['SERVER_ITEM_OS'] ?>OS정보</a>
</div>
<div class="accordion-item">
<a href="/admin/part/software"><?= ICONS['SERVER_ITEM_SOFTWARE'] ?>Software정보</a>
</div>
</div>