dbms_init...1

This commit is contained in:
최준흠 2025-05-23 17:58:44 +09:00
parent 92b916f8ec
commit 98071d7468
7 changed files with 123 additions and 309 deletions

View File

@ -106,6 +106,38 @@ $routes->group('admin', ['namespace' => 'App\Controllers\Admin', 'filter' => 'au
$routes->post('batchjob_delete', 'ServiceController::batchjob_delete');
$routes->get('download/(:alpha)', 'ServiceController::download/$1');
});
$routes->group('link', ['namespace' => 'App\Controllers\Admin\Customer\Link'], function ($routes) {
$routes->group('cpu', ['namespace' => 'App\Controllers\Admin\Customer\Link'], 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->group('ram', ['namespace' => 'App\Controllers\Admin\Customer\Link'], 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->group('disk', ['namespace' => 'App\Controllers\Admin\Customer\Link'], 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->group('equipment', ['namespace' => 'App\Controllers\Admin\Equipment'], function ($routes) {
$routes->group('line', ['namespace' => 'App\Controllers\Admin\Equipment'], function ($routes) {

View File

@ -64,13 +64,13 @@ class ServiceController extends CustomerController
}
//Index,FieldForm관련
protected function create_process(): mixed
{
$entity = parent::create_process();
//사용중인 서버로 변경
$this->getServerService()->setOccupied($this->getServerService()->getEntity($entity->getServerInfoUID()));
return $entity;
}
// protected function create_process(): mixed
// {
// $entity = parent::create_process();
// //사용중인 서버로 변경
// $this->getServerService()->setOccupied($this->getServerService()->getEntity($entity->getServerInfoUID()));
// return $entity;
// }
protected function index_process(): array
{
$fields = [
@ -78,13 +78,14 @@ class ServiceController extends CustomerController
];
$this->init('index', $fields);
// $this->modal_type = 'modal_fetch_v2'; //기본은 modal_iframe임
// return parent::index_process();
$entities = [];
// foreach (parent::index_process() as $entity) {
// $entity->setPartEntities("CPU", $this->getCpuService()->getPartEntities($entity));
// $entity->setPartEntities("RAM", $this->getRamService()->getPartEntities($entity));
// $entity->setPartEntities("DISK", $this->getDiskService()->getPartEntities($entity));
// $entities[] = $entity;
// }
foreach (parent::index_process() as $entity) {
$entity->setPartEntities("CPU", $this->getCpuService()->getPartEntities($entity));
$entity->setPartEntities("RAM", $this->getRamService()->getPartEntities($entity));
$entity->setPartEntities("DISK", $this->getDiskService()->getPartEntities($entity));
$entities[] = $entity;
}
return $entities;
}
}

View File

@ -4,9 +4,9 @@
"settings": {
"width": 4000,
"height": 4000,
"scrollTop": -1726.0313,
"scrollLeft": -1275.3014,
"zoomLevel": 0.82,
"scrollTop": -1591.3904,
"scrollLeft": -1236.9436,
"zoomLevel": 0.19,
"show": 511,
"database": 4,
"databaseName": "",
@ -86,7 +86,8 @@
"jbt6QJ9O_QehKL5KVdR0m",
"iwjg9CNlhsFlN9G8CLujv",
"w_YPvdI0fCn6dNnp_aD9t",
"mG0FZojEdcRWkLpO5Zm08"
"mG0FZojEdcRWkLpO5Zm08",
"aRre0Gt6aw2zeW8Ib15Me"
],
"indexIds": [],
"memoIds": []
@ -860,39 +861,6 @@
"createAt": 1747374666215
}
},
"3RJ8qxNNqL7eCvBmmqzpd": {
"id": "3RJ8qxNNqL7eCvBmmqzpd",
"name": "serviceinfos_lineinfos",
"comment": "",
"columnIds": [
"_oIE_aDPjyuwPZo2h8QUJ",
"i_tL8EWzsKz8Q6TjEkdFG",
"0rvNoG9MrbN-6-6iDdw3K",
"fGzuo5ZiUU8JjFLpx83H_",
"s2DxySreFcYw4F8pTrtik",
"NwGV49CLzr1A-dxD3tBmJ"
],
"seqColumnIds": [
"_oIE_aDPjyuwPZo2h8QUJ",
"i_tL8EWzsKz8Q6TjEkdFG",
"0rvNoG9MrbN-6-6iDdw3K",
"fGzuo5ZiUU8JjFLpx83H_",
"s2DxySreFcYw4F8pTrtik",
"NwGV49CLzr1A-dxD3tBmJ"
],
"ui": {
"x": 1166.2223,
"y": 1698.7022,
"zIndex": 835,
"widthName": 113,
"widthComment": 60,
"color": ""
},
"meta": {
"updateAt": 1747631850407,
"createAt": 1747625827836
}
},
"Btzrm5KCDr_59gZoXRXol": {
"id": "Btzrm5KCDr_59gZoXRXol",
"name": "serviceinfos_serverinfos",
@ -1213,6 +1181,7 @@
"columnIds": [
"7H1dMNV2UxOx8O6DD_fv3",
"nL-8jbbaXLAxQmwKmxwVp",
"COpm-00QT2DzD70f8srX-",
"A5jE2aplbrccrkErwht-L",
"xXf6S4ALrDaYympxFLecy",
"xVa4vn9BzbObswNs0nbUQ",
@ -1223,6 +1192,7 @@
"7H1dMNV2UxOx8O6DD_fv3",
"quc3ij2-2WjckJbeT42jS",
"nL-8jbbaXLAxQmwKmxwVp",
"COpm-00QT2DzD70f8srX-",
"A5jE2aplbrccrkErwht-L",
"xXf6S4ALrDaYympxFLecy",
"xVa4vn9BzbObswNs0nbUQ",
@ -1231,14 +1201,14 @@
],
"ui": {
"x": 1171.6967,
"y": 1168.2415,
"y": 1137.7536,
"zIndex": 1250,
"widthName": 65,
"widthComment": 88,
"color": ""
},
"meta": {
"updateAt": 1747876955698,
"updateAt": 1747990531189,
"createAt": 1747809933290
}
}
@ -5764,126 +5734,6 @@
"createAt": 1747621930444
}
},
"_oIE_aDPjyuwPZo2h8QUJ": {
"id": "_oIE_aDPjyuwPZo2h8QUJ",
"tableId": "3RJ8qxNNqL7eCvBmmqzpd",
"name": "uid",
"comment": "",
"dataType": "INT",
"default": "",
"options": 11,
"ui": {
"keys": 1,
"widthName": 60,
"widthComment": 60,
"widthDataType": 60,
"widthDefault": 60
},
"meta": {
"updateAt": 1747625897775,
"createAt": 1747625895255
}
},
"fGzuo5ZiUU8JjFLpx83H_": {
"id": "fGzuo5ZiUU8JjFLpx83H_",
"tableId": "3RJ8qxNNqL7eCvBmmqzpd",
"name": "billing_type",
"comment": "",
"dataType": "VARCHAR(20)",
"default": "'month'",
"options": 8,
"ui": {
"keys": 0,
"widthName": 63,
"widthComment": 60,
"widthDataType": 75,
"widthDefault": 60
},
"meta": {
"updateAt": 1747625895256,
"createAt": 1747625895256
}
},
"s2DxySreFcYw4F8pTrtik": {
"id": "s2DxySreFcYw4F8pTrtik",
"tableId": "3RJ8qxNNqL7eCvBmmqzpd",
"name": "amount",
"comment": "",
"dataType": "INT",
"default": "0",
"options": 8,
"ui": {
"keys": 0,
"widthName": 60,
"widthComment": 60,
"widthDataType": 60,
"widthDefault": 60
},
"meta": {
"updateAt": 1747625895256,
"createAt": 1747625895256
}
},
"NwGV49CLzr1A-dxD3tBmJ": {
"id": "NwGV49CLzr1A-dxD3tBmJ",
"tableId": "3RJ8qxNNqL7eCvBmmqzpd",
"name": "created_at",
"comment": "",
"dataType": "TIMESTAMP",
"default": "CURRENT_TIMESTAMP",
"options": 8,
"ui": {
"keys": 0,
"widthName": 60,
"widthComment": 60,
"widthDataType": 65,
"widthDefault": 122
},
"meta": {
"updateAt": 1747625895256,
"createAt": 1747625895256
}
},
"i_tL8EWzsKz8Q6TjEkdFG": {
"id": "i_tL8EWzsKz8Q6TjEkdFG",
"tableId": "3RJ8qxNNqL7eCvBmmqzpd",
"name": "serviceinfo_uid",
"comment": "",
"dataType": "INT",
"default": "",
"options": 8,
"ui": {
"keys": 0,
"widthName": 80,
"widthComment": 60,
"widthDataType": 60,
"widthDefault": 60
},
"meta": {
"updateAt": 1747625924136,
"createAt": 1747625914064
}
},
"0rvNoG9MrbN-6-6iDdw3K": {
"id": "0rvNoG9MrbN-6-6iDdw3K",
"tableId": "3RJ8qxNNqL7eCvBmmqzpd",
"name": "lineinfo_uid",
"comment": "",
"dataType": "INT",
"default": "",
"options": 8,
"ui": {
"keys": 0,
"widthName": 63,
"widthComment": 60,
"widthDataType": 60,
"widthDefault": 60
},
"meta": {
"updateAt": 1747625938005,
"createAt": 1747625932404
}
},
"uodvC_rgsnCqB65A3uZYW": {
"id": "uodvC_rgsnCqB65A3uZYW",
"tableId": "R4reSshLxH3DQW6fUfSPa",
@ -7583,6 +7433,26 @@
"updateAt": 1747888103295,
"createAt": 1747888079555
}
},
"COpm-00QT2DzD70f8srX-": {
"id": "COpm-00QT2DzD70f8srX-",
"tableId": "KjMkfDhEIFtqzt24wZL_o",
"name": "serverinfo_uid",
"comment": "",
"dataType": "INT",
"default": "",
"options": 8,
"ui": {
"keys": 2,
"widthName": 76,
"widthComment": 60,
"widthDataType": 60,
"widthDefault": 60
},
"meta": {
"updateAt": 1747990527059,
"createAt": 1747990514880
}
}
},
"relationshipEntities": {
@ -8032,118 +7902,6 @@
"createAt": 1747626605945
}
},
"xnvl_tBcFrTl87jBGDW08": {
"id": "xnvl_tBcFrTl87jBGDW08",
"identification": false,
"relationshipType": 16,
"startRelationshipType": 2,
"start": {
"tableId": "kc1EFvFhlBSc0B0bDgX28",
"columnIds": [
"nb5CGzskl3_LIRA0yyede"
],
"x": 686.1378,
"y": 1844.0127666666663,
"direction": 2
},
"end": {
"tableId": "Btzrm5KCDr_59gZoXRXol",
"columnIds": [
"aVHpSwITyNUlzw2eRHocV"
],
"x": 1165.5062,
"y": 1891.573,
"direction": 1
},
"meta": {
"updateAt": 1747631603773,
"createAt": 1747631603773
}
},
"xYyFwSIzfn3RPzA8eaJoV": {
"id": "xYyFwSIzfn3RPzA8eaJoV",
"identification": false,
"relationshipType": 16,
"startRelationshipType": 2,
"start": {
"tableId": "B4qGh3KZsXHQ3_4EOgwJZ",
"columnIds": [
"F9EPb6nsDx6Tf3GG8rvP1"
],
"x": 2377.7654,
"y": 1770.2772,
"direction": 1
},
"end": {
"tableId": "Btzrm5KCDr_59gZoXRXol",
"columnIds": [
"stEdaFSZ8RZorO2WI_W2Z"
],
"x": 1680.5062,
"y": 1891.573,
"direction": 2
},
"meta": {
"updateAt": 1747631627547,
"createAt": 1747631627547
}
},
"KMa7J50RT1ImakceLy9iZ": {
"id": "KMa7J50RT1ImakceLy9iZ",
"identification": false,
"relationshipType": 16,
"startRelationshipType": 2,
"start": {
"tableId": "B4qGh3KZsXHQ3_4EOgwJZ",
"columnIds": [
"F9EPb6nsDx6Tf3GG8rvP1"
],
"x": 2671.2456,
"y": 1841.4543333333336,
"direction": 2
},
"end": {
"tableId": "BoXnD7ITrjdXuJVzpiLoN",
"columnIds": [
"LHHK0n71w3kZmkJRraK-4"
],
"x": 3174.0523,
"y": 1982.7913,
"direction": 1
},
"meta": {
"updateAt": 1747632330203,
"createAt": 1747632330203
}
},
"bVmMQk7Qb5kh6yURDiOLx": {
"id": "bVmMQk7Qb5kh6yURDiOLx",
"identification": false,
"relationshipType": 16,
"startRelationshipType": 2,
"start": {
"tableId": "RMhrLs7bOaopKmKt9YKHQ",
"columnIds": [
"Jh6e_-9QYe1Tqve0PE3kT"
],
"x": 2693.9786,
"y": 2382.1577,
"direction": 2
},
"end": {
"tableId": "BoXnD7ITrjdXuJVzpiLoN",
"columnIds": [
"Ba036rLR2vRLjGURehMqM"
],
"x": 3174.0523,
"y": 2058.7913,
"direction": 1
},
"meta": {
"updateAt": 1747632352018,
"createAt": 1747632352018
}
},
"yRqdBlk02rkPXWzAwo7fw": {
"id": "yRqdBlk02rkPXWzAwo7fw",
"identification": false,
@ -8491,7 +8249,7 @@
"F9EPb6nsDx6Tf3GG8rvP1"
],
"x": 2174.2456,
"y": 1853.263857142857,
"y": 1877.621,
"direction": 1
},
"end": {
@ -8528,7 +8286,7 @@
"nL-8jbbaXLAxQmwKmxwVp"
],
"x": 1171.6967,
"y": 1280.2415,
"y": 1261.7536,
"direction": 1
},
"meta": {
@ -8556,7 +8314,7 @@
"A5jE2aplbrccrkErwht-L"
],
"x": 1686.6967,
"y": 1280.2415,
"y": 1199.7536,
"direction": 2
},
"meta": {
@ -8575,7 +8333,7 @@
"F9EPb6nsDx6Tf3GG8rvP1"
],
"x": 2174.2456,
"y": 1888.6924285714283,
"y": 1908.621,
"direction": 1
},
"end": {
@ -8603,7 +8361,7 @@
"F9EPb6nsDx6Tf3GG8rvP1"
],
"x": 2174.2456,
"y": 1924.1209999999996,
"y": 1939.621,
"direction": 1
},
"end": {
@ -8631,7 +8389,7 @@
"F9EPb6nsDx6Tf3GG8rvP1"
],
"x": 2174.2456,
"y": 1959.549571428571,
"y": 1970.621,
"direction": 1
},
"end": {
@ -8715,7 +8473,7 @@
"F9EPb6nsDx6Tf3GG8rvP1"
],
"x": 2174.2456,
"y": 1817.8352857142856,
"y": 1846.621,
"direction": 1
},
"end": {
@ -8743,7 +8501,7 @@
"F9EPb6nsDx6Tf3GG8rvP1"
],
"x": 2174.2456,
"y": 1994.9781428571423,
"y": 2001.621,
"direction": 1
},
"end": {
@ -8771,7 +8529,7 @@
"F9EPb6nsDx6Tf3GG8rvP1"
],
"x": 2174.2456,
"y": 2030.4067142857136,
"y": 2032.621,
"direction": 1
},
"end": {
@ -8787,6 +8545,34 @@
"updateAt": 1747876435580,
"createAt": 1747876435580
}
},
"aRre0Gt6aw2zeW8Ib15Me": {
"id": "aRre0Gt6aw2zeW8Ib15Me",
"identification": false,
"relationshipType": 16,
"startRelationshipType": 2,
"start": {
"tableId": "B4qGh3KZsXHQ3_4EOgwJZ",
"columnIds": [
"F9EPb6nsDx6Tf3GG8rvP1"
],
"x": 2174.2456,
"y": 1815.621,
"direction": 1
},
"end": {
"tableId": "KjMkfDhEIFtqzt24wZL_o",
"columnIds": [
"COpm-00QT2DzD70f8srX-"
],
"x": 1686.6967,
"y": 1323.7536,
"direction": 2
},
"meta": {
"updateAt": 1747990514880,
"createAt": 1747990514880
}
}
},
"indexEntities": {},

View File

@ -10,20 +10,16 @@ class ServiceEntity extends CustomerEntity
const PK = ServiceModel::PK;
const TITLE = ServiceModel::TITLE;
public function getServerInfoUID()
{
return $this->attributes['serverinfo_uid'];
}
public function getPartEntities(string $type): array
{
return $this->attributes[$type] ?? [];
}
public function addPartEntity(string $type, PartEntity $partEntity): void
public function setPartEntities(string $type, array $partEntities): void
{
if (!isset($this->attributes[$type])) {
$this->attributes[$type] = [];
}
$this->attributes[$type][] = $partEntity;
$this->attributes[$type] = $partEntities;
// $this->attributes[$type] = array_unique($this->attributes[$type], SORT_REGULAR);
}
}

View File

@ -17,12 +17,14 @@ class ServiceHelper extends CustomerHelper
{
$value = $viewDatas['entity']->$field ?? "";
switch ($field) {
case "LINE":
case "SERVER":
case "IP":
case "DEFENCE":
case "SOFTWARE":
case "CPU":
case "RAM":
case "DISK":
case "DEFENCE":
case "SOFTWARE":
$temps = [];
foreach ($viewDatas['entity']->getPartEntities($field) as $partEntity) {
$temps[] = "<div>" . $partEntity->getTitle() . "</div>";
@ -32,7 +34,7 @@ class ServiceHelper extends CustomerHelper
'변경',
$field,
[
"data-src" => "/admin/customer/servicepart?type={$field}&serviceinfo_uid={$viewDatas['entity']->getPK()}",
"data-src" => "/admin/customer/link/" . strtolower($field) . "?&serviceinfo_uid={$viewDatas['entity']->getPK()}",
"data-bs-toggle" => "modal",
"data-bs-target" => "#index_action_form",
...$extras

View File

@ -3,9 +3,7 @@ return [
'title' => "고객서비스정보",
'label' => [
'clientinfo_uid' => "고객명",
'lineinfo_uid' => "회선정보",
'serverinfo_uid' => "서버정보",
'rack' => "Rack번호",
'rack' => "Rack",
'type' => "종류",
'billing_at' => "청구일",
'start_at' => "개통일",
@ -13,6 +11,9 @@ return [
'status' => "상태",
'updated_at' => "수정일",
'created_at' => "신청일",
'SERVICE' => "서비스",
'SERVER' => "서버",
'LINE' => "회선",
'IP' => "IP",
'CPU' => "CPU",
'RAM' => "RAM",

View File

@ -14,8 +14,6 @@ class ServiceModel extends CustomerModel
protected $returnType = ServiceEntity::class;
protected $allowedFields = [
"clientinfo_uid",
"lineinfo_uid",
"serverinfo_uid",
"rack",
"type",
"billing_at",
@ -35,8 +33,6 @@ class ServiceModel extends CustomerModel
}
switch ($field) {
case "clientinfo_uid":
case "lineinfo_uid":
case "serverinfo_uid":
$rule = "required|numeric";
break;
case "rack":