dbms_init...1
This commit is contained in:
parent
62883a4321
commit
eee680feb0
@ -7,12 +7,14 @@ use CodeIgniter\HTTP\RequestInterface;
|
|||||||
use CodeIgniter\HTTP\ResponseInterface;
|
use CodeIgniter\HTTP\ResponseInterface;
|
||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
|
|
||||||
|
use App\Services\Customer\ServiceService;
|
||||||
use App\Services\Customer\AccountService;
|
use App\Services\Customer\AccountService;
|
||||||
use App\Services\Customer\CouponService;
|
use App\Services\Customer\CouponService;
|
||||||
use App\Services\Customer\PointService;
|
use App\Services\Customer\PointService;
|
||||||
|
|
||||||
abstract class CustomerController extends AdminController
|
abstract class CustomerController extends AdminController
|
||||||
{
|
{
|
||||||
|
private ?ServiceService $_serviceService = null;
|
||||||
private ?AccountService $_accountService = null;
|
private ?AccountService $_accountService = null;
|
||||||
private ?CouponService $_couponService = null;
|
private ?CouponService $_couponService = null;
|
||||||
private ?PointService $_pointService = null;
|
private ?PointService $_pointService = null;
|
||||||
@ -22,6 +24,14 @@ abstract class CustomerController extends AdminController
|
|||||||
$this->uri_path .= 'customer/';
|
$this->uri_path .= 'customer/';
|
||||||
// $this->view_path .= "customer" . DIRECTORY_SEPARATOR;
|
// $this->view_path .= "customer" . DIRECTORY_SEPARATOR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final public function getServiceService(): ServiceService
|
||||||
|
{
|
||||||
|
if (!$this->_serviceService) {
|
||||||
|
$this->_serviceService = new ServiceService($this->request);
|
||||||
|
}
|
||||||
|
return $this->_serviceService;
|
||||||
|
}
|
||||||
final public function getAccountService(): AccountService
|
final public function getAccountService(): AccountService
|
||||||
{
|
{
|
||||||
if (!$this->_accountService) {
|
if (!$this->_accountService) {
|
||||||
|
|||||||
@ -2,23 +2,28 @@
|
|||||||
|
|
||||||
namespace App\Controllers\Admin\Customer;
|
namespace App\Controllers\Admin\Customer;
|
||||||
|
|
||||||
use App\Services\Equipment\ServerService;
|
|
||||||
use CodeIgniter\HTTP\RequestInterface;
|
use CodeIgniter\HTTP\RequestInterface;
|
||||||
use CodeIgniter\HTTP\ResponseInterface;
|
use CodeIgniter\HTTP\ResponseInterface;
|
||||||
use CodeIgniter\Validation\Validation;
|
|
||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
|
|
||||||
use App\Entities\Customer\ServicePartEntity;
|
use App\Entities\Customer\ServiceEntity;
|
||||||
use App\Services\Customer\ServicePartService;
|
|
||||||
use App\Helpers\Customer\ServiceHelper;
|
use App\Helpers\Customer\ServiceHelper;
|
||||||
use App\Services\Customer\ServiceService;
|
use App\Services\Customer\ServiceService;
|
||||||
|
|
||||||
|
use App\Services\Equipment\ServerService;
|
||||||
|
use App\Entities\Customer\ServiceServerEntity;
|
||||||
|
use App\Services\Customer\ServiceServerService;
|
||||||
use App\Services\Equipment\PartService;
|
use App\Services\Equipment\PartService;
|
||||||
|
use App\Services\Customer\ServicePartService;
|
||||||
use App\Services\Equipment\IpService;
|
use App\Services\Equipment\IpService;
|
||||||
|
|
||||||
|
|
||||||
class ServiceController extends CustomerController
|
class ServiceController extends CustomerController
|
||||||
{
|
{
|
||||||
private ?ServerService $_serverService = null;
|
private ?ServerService $_serverService = null;
|
||||||
|
private ?ServiceServerService $_serviceServerService = null;
|
||||||
private ?PartService $_partService = null;
|
private ?PartService $_partService = null;
|
||||||
|
private ?ServicePartService $_servicePartService = null;
|
||||||
private ?IpService $_ipService = null;
|
private ?IpService $_ipService = null;
|
||||||
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
||||||
{
|
{
|
||||||
@ -28,8 +33,8 @@ class ServiceController extends CustomerController
|
|||||||
$this->class_path = $this->getService()->getClassPath();
|
$this->class_path = $this->getService()->getClassPath();
|
||||||
$this->title = lang("{$this->getService()->getClassPath()}.title");
|
$this->title = lang("{$this->getService()->getClassPath()}.title");
|
||||||
$this->helper = $this->getHelper();
|
$this->helper = $this->getHelper();
|
||||||
$this->individualStylesheets = ['server_partinfo.css'];
|
// $this->individualStylesheets = ['server_partinfo.css'];
|
||||||
$this->individualScripts = ['server_partinfo.js'];
|
// $this->individualScripts = ['server_partinfo.js'];
|
||||||
}
|
}
|
||||||
public function getService(): ServiceService
|
public function getService(): ServiceService
|
||||||
{
|
{
|
||||||
@ -52,6 +57,13 @@ class ServiceController extends CustomerController
|
|||||||
}
|
}
|
||||||
return $this->_serverService;
|
return $this->_serverService;
|
||||||
}
|
}
|
||||||
|
final public function getServiceServerService(): ServiceServerService
|
||||||
|
{
|
||||||
|
if (!$this->_serviceServerService) {
|
||||||
|
$this->_serviceServerService = new ServiceServerService($this->request);
|
||||||
|
}
|
||||||
|
return $this->_serviceServerService;
|
||||||
|
}
|
||||||
final public function getPartService(): PartService
|
final public function getPartService(): PartService
|
||||||
{
|
{
|
||||||
if (!$this->_partService) {
|
if (!$this->_partService) {
|
||||||
@ -59,6 +71,13 @@ class ServiceController extends CustomerController
|
|||||||
}
|
}
|
||||||
return $this->_partService;
|
return $this->_partService;
|
||||||
}
|
}
|
||||||
|
final public function getServicePartService(): ServicePartService
|
||||||
|
{
|
||||||
|
if (!$this->_servicePartService) {
|
||||||
|
$this->_servicePartService = new ServicePartService($this->request);
|
||||||
|
}
|
||||||
|
return $this->_servicePartService;
|
||||||
|
}
|
||||||
final public function getIpService(): IpService
|
final public function getIpService(): IpService
|
||||||
{
|
{
|
||||||
if (!$this->_ipService) {
|
if (!$this->_ipService) {
|
||||||
@ -81,7 +100,7 @@ class ServiceController extends CustomerController
|
|||||||
protected function index_process(): array
|
protected function index_process(): array
|
||||||
{
|
{
|
||||||
$fields = [
|
$fields = [
|
||||||
'fields' => ['type', 'model', 'IP', 'SERVER', 'CPU', 'RAM', 'DISK', 'status'],
|
'fields' => ['type', 'billing_at', 'rack', 'SERVER', 'IP', 'CPU', 'RAM', 'DISK', 'SOFTWARE', 'DEFENCE', 'start_at', 'status'],
|
||||||
];
|
];
|
||||||
$this->init('index', $fields);
|
$this->init('index', $fields);
|
||||||
$this->modal_type = 'modal_iframe';
|
$this->modal_type = 'modal_iframe';
|
||||||
|
|||||||
@ -46,7 +46,7 @@ class ServicePartController extends CustomerController
|
|||||||
protected function getFormFieldOption(string $field, array $options = []): array
|
protected function getFormFieldOption(string $field, array $options = []): array
|
||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
case 'serverinfo_uid':
|
case 'serviceinfo_uid':
|
||||||
$options[$field] = $this->getServiceService()->getFormFieldOption($field);
|
$options[$field] = $this->getServiceService()->getFormFieldOption($field);
|
||||||
break;
|
break;
|
||||||
case 'partinfo_uid':
|
case 'partinfo_uid':
|
||||||
@ -78,13 +78,13 @@ class ServicePartController extends CustomerController
|
|||||||
protected function setOrderByForList()
|
protected function setOrderByForList()
|
||||||
{
|
{
|
||||||
//OrderBy 처리
|
//OrderBy 처리
|
||||||
$this->getService()->getModel()->orderBy('serverinfo_uid', 'ASC', false);
|
$this->getService()->getModel()->orderBy('serviceinfo_uid', 'ASC', false);
|
||||||
parent::setOrderByForList();
|
parent::setOrderByForList();
|
||||||
}
|
}
|
||||||
protected function index_process(): array
|
protected function index_process(): array
|
||||||
{
|
{
|
||||||
$fields = [
|
$fields = [
|
||||||
'fields' => ['serverinfo_uid', 'type', 'partinfo_uid'],
|
'fields' => ['serviceinfo_uid', 'type', 'partinfo_uid'],
|
||||||
];
|
];
|
||||||
$this->init('index', $fields);
|
$this->init('index', $fields);
|
||||||
$this->modal_type = 'modal_iframe';
|
$this->modal_type = 'modal_iframe';
|
||||||
|
|||||||
@ -13,7 +13,6 @@ use App\Services\Equipment\ServerService;
|
|||||||
abstract class EquipmentController extends AdminController
|
abstract class EquipmentController extends AdminController
|
||||||
{
|
{
|
||||||
private ?ServerService $_serverService = null;
|
private ?ServerService $_serverService = null;
|
||||||
private ?LineService $_lineService = null;
|
|
||||||
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
||||||
{
|
{
|
||||||
parent::initController($request, $response, $logger);
|
parent::initController($request, $response, $logger);
|
||||||
@ -27,26 +26,5 @@ abstract class EquipmentController extends AdminController
|
|||||||
}
|
}
|
||||||
return $this->_serverService;
|
return $this->_serverService;
|
||||||
}
|
}
|
||||||
final public function getLineService(): LineService
|
|
||||||
{
|
|
||||||
if (!$this->_lineService) {
|
|
||||||
$this->_lineService = new LineService($this->request);
|
|
||||||
}
|
|
||||||
return $this->_lineService;
|
|
||||||
}
|
|
||||||
//Index,FieldForm관련
|
//Index,FieldForm관련
|
||||||
protected function getFormFieldOption(string $field, array $options = []): array
|
|
||||||
{
|
|
||||||
switch ($field) {
|
|
||||||
case 'lineinfo_uid':
|
|
||||||
$options[$field] = $this->getLineService()->getFormFieldOption($field);
|
|
||||||
// echo $this->getUserModel()->getLastQuery();
|
|
||||||
// dd($options);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$options = parent::getFormFieldOption($field, $options);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return $options;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,13 +6,11 @@ use App\Entities\Equipment\ServerEntity;
|
|||||||
use CodeIgniter\HTTP\RequestInterface;
|
use CodeIgniter\HTTP\RequestInterface;
|
||||||
use CodeIgniter\HTTP\ResponseInterface;
|
use CodeIgniter\HTTP\ResponseInterface;
|
||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
use CodeIgniter\Validation\Validation;
|
|
||||||
|
|
||||||
use App\Helpers\Equipment\ServerHelper;
|
use App\Helpers\Equipment\ServerHelper;
|
||||||
use App\Services\Equipment\ServerService;
|
use App\Services\Equipment\ServerService;
|
||||||
use App\Services\Equipment\PartService;
|
use App\Services\Equipment\PartService;
|
||||||
use App\Services\Equipment\ServerPartService;
|
use App\Services\Equipment\ServerPartService;
|
||||||
use App\Entities\Equipment\ServerPartEntity;
|
|
||||||
|
|
||||||
class ServerController extends EquipmentController
|
class ServerController extends EquipmentController
|
||||||
{
|
{
|
||||||
@ -26,8 +24,8 @@ class ServerController extends EquipmentController
|
|||||||
$this->class_path = $this->getService()->getClassPath();
|
$this->class_path = $this->getService()->getClassPath();
|
||||||
$this->title = lang("{$this->getService()->getClassPath()}.title");
|
$this->title = lang("{$this->getService()->getClassPath()}.title");
|
||||||
$this->helper = $this->getHelper();
|
$this->helper = $this->getHelper();
|
||||||
$this->individualStylesheets = ['server_partinfo.css'];
|
// $this->individualStylesheets = ['server_partinfo.css'];
|
||||||
$this->individualScripts = ['server_partinfo.js'];
|
// $this->individualScripts = ['server_partinfo.js'];
|
||||||
}
|
}
|
||||||
public function getService(): ServerService
|
public function getService(): ServerService
|
||||||
{
|
{
|
||||||
|
|||||||
@ -4,9 +4,9 @@
|
|||||||
"settings": {
|
"settings": {
|
||||||
"width": 4000,
|
"width": 4000,
|
||||||
"height": 4000,
|
"height": 4000,
|
||||||
"scrollTop": -2252.9128,
|
"scrollTop": -1517.2462,
|
||||||
"scrollLeft": -992.9859,
|
"scrollLeft": -620.6366,
|
||||||
"zoomLevel": 0.88,
|
"zoomLevel": 0.73,
|
||||||
"show": 511,
|
"show": 511,
|
||||||
"database": 4,
|
"database": 4,
|
||||||
"databaseName": "",
|
"databaseName": "",
|
||||||
@ -385,6 +385,7 @@
|
|||||||
"columnIds": [
|
"columnIds": [
|
||||||
"nb5CGzskl3_LIRA0yyede",
|
"nb5CGzskl3_LIRA0yyede",
|
||||||
"sscrxOdwLlx94tx1j_MrH",
|
"sscrxOdwLlx94tx1j_MrH",
|
||||||
|
"jN2378kieoBKN-G1x8myT",
|
||||||
"iM3NfWTfO6qrXv94EUFgk",
|
"iM3NfWTfO6qrXv94EUFgk",
|
||||||
"lwr6RuK8OGKJNLdd70NGS",
|
"lwr6RuK8OGKJNLdd70NGS",
|
||||||
"qnVCOfUyejx2ToAQhkmu0",
|
"qnVCOfUyejx2ToAQhkmu0",
|
||||||
@ -400,6 +401,7 @@
|
|||||||
"JXFtN33CEiVr8DDSQay0k",
|
"JXFtN33CEiVr8DDSQay0k",
|
||||||
"CY-ZAs3Ns1YhoxL9UiCee",
|
"CY-ZAs3Ns1YhoxL9UiCee",
|
||||||
"UKMpq-uPW9JhNhwRMtBmC",
|
"UKMpq-uPW9JhNhwRMtBmC",
|
||||||
|
"jN2378kieoBKN-G1x8myT",
|
||||||
"iM3NfWTfO6qrXv94EUFgk",
|
"iM3NfWTfO6qrXv94EUFgk",
|
||||||
"CITRNBpXOZqGM6gHy5MlB",
|
"CITRNBpXOZqGM6gHy5MlB",
|
||||||
"lwr6RuK8OGKJNLdd70NGS",
|
"lwr6RuK8OGKJNLdd70NGS",
|
||||||
@ -421,7 +423,7 @@
|
|||||||
"color": ""
|
"color": ""
|
||||||
},
|
},
|
||||||
"meta": {
|
"meta": {
|
||||||
"updateAt": 1747727821087,
|
"updateAt": 1747733939677,
|
||||||
"createAt": 1745819764139
|
"createAt": 1745819764139
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -2155,7 +2157,7 @@
|
|||||||
"widthDefault": 60
|
"widthDefault": 60
|
||||||
},
|
},
|
||||||
"meta": {
|
"meta": {
|
||||||
"updateAt": 1747125258424,
|
"updateAt": 1747733895712,
|
||||||
"createAt": 1745819764139
|
"createAt": 1745819764139
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -5006,7 +5008,7 @@
|
|||||||
"comment": "종료일",
|
"comment": "종료일",
|
||||||
"dataType": "DATE",
|
"dataType": "DATE",
|
||||||
"default": "",
|
"default": "",
|
||||||
"options": 0,
|
"options": 5,
|
||||||
"ui": {
|
"ui": {
|
||||||
"keys": 0,
|
"keys": 0,
|
||||||
"widthName": 60,
|
"widthName": 60,
|
||||||
@ -5015,7 +5017,7 @@
|
|||||||
"widthDefault": 60
|
"widthDefault": 60
|
||||||
},
|
},
|
||||||
"meta": {
|
"meta": {
|
||||||
"updateAt": 1747371193639,
|
"updateAt": 1747733901576,
|
||||||
"createAt": 1747277755303
|
"createAt": 1747277755303
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -6418,6 +6420,26 @@
|
|||||||
"updateAt": 1747638862777,
|
"updateAt": 1747638862777,
|
||||||
"createAt": 1747632565731
|
"createAt": 1747632565731
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"jN2378kieoBKN-G1x8myT": {
|
||||||
|
"id": "jN2378kieoBKN-G1x8myT",
|
||||||
|
"tableId": "kc1EFvFhlBSc0B0bDgX28",
|
||||||
|
"name": "rack",
|
||||||
|
"comment": "Rack번호",
|
||||||
|
"dataType": "VARCHAR(10)",
|
||||||
|
"default": "",
|
||||||
|
"options": 8,
|
||||||
|
"ui": {
|
||||||
|
"keys": 0,
|
||||||
|
"widthName": 60,
|
||||||
|
"widthComment": 60,
|
||||||
|
"widthDataType": 75,
|
||||||
|
"widthDefault": 60
|
||||||
|
},
|
||||||
|
"meta": {
|
||||||
|
"updateAt": 1747733996079,
|
||||||
|
"createAt": 1747733912998
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"relationshipEntities": {
|
"relationshipEntities": {
|
||||||
@ -6469,7 +6491,7 @@
|
|||||||
"sscrxOdwLlx94tx1j_MrH"
|
"sscrxOdwLlx94tx1j_MrH"
|
||||||
],
|
],
|
||||||
"x": 686.1378,
|
"x": 686.1378,
|
||||||
"y": 1674.3461,
|
"y": 1678.488957142857,
|
||||||
"direction": 2
|
"direction": 2
|
||||||
},
|
},
|
||||||
"meta": {
|
"meta": {
|
||||||
@ -6488,7 +6510,7 @@
|
|||||||
"nb5CGzskl3_LIRA0yyede"
|
"nb5CGzskl3_LIRA0yyede"
|
||||||
],
|
],
|
||||||
"x": 686.1378,
|
"x": 686.1378,
|
||||||
"y": 1810.3461,
|
"y": 1847.631814285714,
|
||||||
"direction": 2
|
"direction": 2
|
||||||
},
|
},
|
||||||
"end": {
|
"end": {
|
||||||
@ -6516,7 +6538,7 @@
|
|||||||
"nb5CGzskl3_LIRA0yyede"
|
"nb5CGzskl3_LIRA0yyede"
|
||||||
],
|
],
|
||||||
"x": 686.1378,
|
"x": 686.1378,
|
||||||
"y": 1844.3461,
|
"y": 1889.9175285714282,
|
||||||
"direction": 2
|
"direction": 2
|
||||||
},
|
},
|
||||||
"end": {
|
"end": {
|
||||||
@ -6572,7 +6594,7 @@
|
|||||||
"nb5CGzskl3_LIRA0yyede"
|
"nb5CGzskl3_LIRA0yyede"
|
||||||
],
|
],
|
||||||
"x": 686.1378,
|
"x": 686.1378,
|
||||||
"y": 1776.3461,
|
"y": 1805.3460999999998,
|
||||||
"direction": 2
|
"direction": 2
|
||||||
},
|
},
|
||||||
"end": {
|
"end": {
|
||||||
@ -6737,9 +6759,9 @@
|
|||||||
"columnIds": [
|
"columnIds": [
|
||||||
"nb5CGzskl3_LIRA0yyede"
|
"nb5CGzskl3_LIRA0yyede"
|
||||||
],
|
],
|
||||||
"x": 686.1378,
|
"x": 432.13779999999997,
|
||||||
"y": 1912.3461,
|
"y": 1953.3461,
|
||||||
"direction": 2
|
"direction": 8
|
||||||
},
|
},
|
||||||
"end": {
|
"end": {
|
||||||
"tableId": "gYqhvNLZjWrQk8LNKH3il",
|
"tableId": "gYqhvNLZjWrQk8LNKH3il",
|
||||||
@ -6878,7 +6900,7 @@
|
|||||||
"nb5CGzskl3_LIRA0yyede"
|
"nb5CGzskl3_LIRA0yyede"
|
||||||
],
|
],
|
||||||
"x": 686.1378,
|
"x": 686.1378,
|
||||||
"y": 1742.3461,
|
"y": 1763.0603857142855,
|
||||||
"direction": 2
|
"direction": 2
|
||||||
},
|
},
|
||||||
"end": {
|
"end": {
|
||||||
@ -6934,7 +6956,7 @@
|
|||||||
"nb5CGzskl3_LIRA0yyede"
|
"nb5CGzskl3_LIRA0yyede"
|
||||||
],
|
],
|
||||||
"x": 686.1378,
|
"x": 686.1378,
|
||||||
"y": 1708.3461,
|
"y": 1720.7746714285713,
|
||||||
"direction": 2
|
"direction": 2
|
||||||
},
|
},
|
||||||
"end": {
|
"end": {
|
||||||
@ -7018,7 +7040,7 @@
|
|||||||
"nb5CGzskl3_LIRA0yyede"
|
"nb5CGzskl3_LIRA0yyede"
|
||||||
],
|
],
|
||||||
"x": 686.1378,
|
"x": 686.1378,
|
||||||
"y": 1878.3461,
|
"y": 1932.2032428571424,
|
||||||
"direction": 2
|
"direction": 2
|
||||||
},
|
},
|
||||||
"end": {
|
"end": {
|
||||||
|
|||||||
@ -2,10 +2,24 @@
|
|||||||
|
|
||||||
namespace App\Entities\Customer;
|
namespace App\Entities\Customer;
|
||||||
|
|
||||||
|
use App\Entities\Equipment\PartEntity;
|
||||||
use App\Models\Customer\ServiceModel;
|
use App\Models\Customer\ServiceModel;
|
||||||
|
|
||||||
class ServiceEntity extends CustomerEntity
|
class ServiceEntity extends CustomerEntity
|
||||||
{
|
{
|
||||||
const PK = ServiceModel::PK;
|
const PK = ServiceModel::PK;
|
||||||
const TITLE = ServiceModel::TITLE;
|
const TITLE = ServiceModel::TITLE;
|
||||||
|
public function getPartEntities(string $type): array
|
||||||
|
{
|
||||||
|
return $this->attributes[$type] ?? [];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function addPartEntity(string $type, PartEntity $partEntity): void
|
||||||
|
{
|
||||||
|
if (!isset($this->attributes[$type])) {
|
||||||
|
$this->attributes[$type] = [];
|
||||||
|
}
|
||||||
|
$this->attributes[$type][] = $partEntity;
|
||||||
|
// $this->attributes[$type] = array_unique($this->attributes[$type], SORT_REGULAR);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,7 +11,7 @@ class ServicePartEntity extends CustomerEntity
|
|||||||
|
|
||||||
public function getServiceInfo()
|
public function getServiceInfo()
|
||||||
{
|
{
|
||||||
return $this->attributes['erviceinfo_uid'];
|
return $this->attributes['serviceinfo_uid'];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPartInfo()
|
public function getPartInfo()
|
||||||
|
|||||||
21
app/Entities/Customer/ServiceServerEntity.php
Normal file
21
app/Entities/Customer/ServiceServerEntity.php
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Entities\Customer;
|
||||||
|
|
||||||
|
use App\Models\Customer\ServiceServerModel;
|
||||||
|
|
||||||
|
class ServiceServerEntity extends CustomerEntity
|
||||||
|
{
|
||||||
|
const PK = ServiceServerModel::PK;
|
||||||
|
const TITLE = ServiceServerModel::TITLE;
|
||||||
|
|
||||||
|
public function getServiceInfo()
|
||||||
|
{
|
||||||
|
return $this->attributes['serviceinfo_uid'];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getServerInfo()
|
||||||
|
{
|
||||||
|
return $this->attributes['serverinfo_uid'];
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -13,43 +13,38 @@ class ServiceHelper extends CustomerHelper
|
|||||||
parent::__construct($request);
|
parent::__construct($request);
|
||||||
$this->setTitleField(field: ServiceModel::TITLE);
|
$this->setTitleField(field: ServiceModel::TITLE);
|
||||||
}
|
}
|
||||||
public function getFieldForm(string $field, mixed $value, array $viewDatas, array $extras = []): string
|
public function getFieldView(string $field, array $viewDatas, array $extras = []): string
|
||||||
{
|
{
|
||||||
if (in_array($viewDatas['action'], ['create', 'modify'])) {
|
$value = $viewDatas['entity']->$field ?? "";
|
||||||
$extras = (strpos($viewDatas['field_rules'][$field], 'required') !== false) ? ["class" => "form-control", "required" => "", ...$extras] : ["class" => "form-control", ...$extras];
|
|
||||||
}
|
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
case 'CPU':
|
case "SERVER":
|
||||||
case 'RAM':
|
case "IP":
|
||||||
case 'DISK':
|
case "CPU":
|
||||||
if (!is_array($viewDatas['field_options'][$field])) {
|
case "RAM":
|
||||||
throw new \Exception(__METHOD__ . "에서 {$field}의 field_options가 array형태가 아닙니다.");
|
case "DISK":
|
||||||
}
|
case "DEFENCE":
|
||||||
if (in_array($viewDatas['action'], ['create_form', 'modify_form'])) {
|
case "SOFTWARE":
|
||||||
$form = " <button type=\"button\" class=\"server_partinfo_layer_btn\" onclick=\"openLayer('{$field}')\">" . lang($viewDatas['class_path'] . '.label.' . $field) . " 추가</button>";
|
$temps = [];
|
||||||
$form .= "<div id=\"{$field}_layer\" class=\"server_partinfo_layer\" style=\"display: none;\">";
|
foreach ($viewDatas['entity']->getPartEntities($field) as $partEntity) {
|
||||||
$form .= "<div class=\"server_partinfo_layer_inner\">";
|
$temps[] = "<div>" . $partEntity->getTitle() . "</div>";
|
||||||
$form .= "<ul class=\"server_partinfo_item_list\">";
|
|
||||||
foreach ($viewDatas['field_options'][$field] as $key => $label) {
|
|
||||||
$form .= "<li><label onclick=\"addComponentFromLabel('{$field}', {$key},'{$label}')\">{$label}</label></li>";
|
|
||||||
}
|
|
||||||
$form .= "</ul>";
|
|
||||||
$form .= "<button type=\"button\" onclick=\"closeLayer('{$field}')\">닫기</button>";
|
|
||||||
$form .= "</div></div>";
|
|
||||||
$form .= "<div id=\"{$field}_list\" class=\"server_partinfo_items\" style=\"border:1px solid silver\"></div>";
|
|
||||||
} else {
|
|
||||||
$extra_class = isset($extras['class']) ? $extras['class'] . ' select-field' : 'select-field';
|
|
||||||
$formOptions = ["" => lang($viewDatas['class_path'] . '.label.' . $field) . ' 선택'];
|
|
||||||
foreach ($viewDatas['field_options'][$field] as $key => $label) {
|
|
||||||
$formOptions[$key] = $label;
|
|
||||||
}
|
|
||||||
$form = form_dropdown($field, $formOptions, $value, ['class' => $extra_class, ...array_diff_key($extras, ['class' => ''])]);
|
|
||||||
}
|
}
|
||||||
|
$extras = ["class" => "btn btn-outline btn-primary btn-circle", "target" => "_self", ...$extras];
|
||||||
|
$temps[] = form_label(
|
||||||
|
'변경',
|
||||||
|
$field,
|
||||||
|
[
|
||||||
|
"data-src" => "/admin/equipment/serverpart?type={$field}&serverinfo_uid={$viewDatas['entity']->getPK()}",
|
||||||
|
"data-bs-toggle" => "modal",
|
||||||
|
"data-bs-target" => "#index_action_form",
|
||||||
|
...$extras
|
||||||
|
]
|
||||||
|
);
|
||||||
|
$value = implode("", $temps);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$form = parent::getFieldForm($field, $value, $viewDatas, $extras);
|
$value = parent::getFieldView($field, $viewDatas, $extras);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $form;
|
return $value;
|
||||||
} //
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
22
app/Helpers/Customer/ServicePartHelper.php
Normal file
22
app/Helpers/Customer/ServicePartHelper.php
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Helpers\Customer;
|
||||||
|
|
||||||
|
use App\Models\Customer\ServicePartModel;
|
||||||
|
use CodeIgniter\HTTP\IncomingRequest;
|
||||||
|
|
||||||
|
class ServicePartHelper extends CustomerHelper
|
||||||
|
{
|
||||||
|
protected ?IncomingRequest $request = null;
|
||||||
|
public function __construct(?IncomingRequest $request = null)
|
||||||
|
{
|
||||||
|
parent::__construct($request);
|
||||||
|
$this->setTitleField(field: ServicePartModel::TITLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getListRowColor(mixed $entity, string $field = 'status', string $value = 'use'): string
|
||||||
|
{
|
||||||
|
return "";
|
||||||
|
// return $entity->isMatched($field, $value) ? "" : 'class="table-danger"';
|
||||||
|
}
|
||||||
|
}
|
||||||
22
app/Helpers/Customer/ServiceServerHelper.php
Normal file
22
app/Helpers/Customer/ServiceServerHelper.php
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Helpers\Customer;
|
||||||
|
|
||||||
|
use App\Models\Customer\ServiceServerModel;
|
||||||
|
use CodeIgniter\HTTP\IncomingRequest;
|
||||||
|
|
||||||
|
class ServiceServerHelper extends CustomerHelper
|
||||||
|
{
|
||||||
|
protected ?IncomingRequest $request = null;
|
||||||
|
public function __construct(?IncomingRequest $request = null)
|
||||||
|
{
|
||||||
|
parent::__construct($request);
|
||||||
|
$this->setTitleField(field: ServiceServerModel::TITLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getListRowColor(mixed $entity, string $field = 'status', string $value = 'use'): string
|
||||||
|
{
|
||||||
|
return "";
|
||||||
|
// return $entity->isMatched($field, $value) ? "" : 'class="table-danger"';
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -3,20 +3,21 @@ return [
|
|||||||
'title' => "고객서비스정보",
|
'title' => "고객서비스정보",
|
||||||
'label' => [
|
'label' => [
|
||||||
'clientinfo_uid' => "고객명",
|
'clientinfo_uid' => "고객명",
|
||||||
'code' => "Rack코드",
|
'rack' => "Rack번호",
|
||||||
'type' => "종류",
|
'type' => "종류",
|
||||||
'title' => "제목",
|
|
||||||
'billing_at' => "청구일",
|
'billing_at' => "청구일",
|
||||||
'start_at' => "개통일",
|
'start_at' => "개통일",
|
||||||
'end_at' => "해지일",
|
'end_at' => "해지일",
|
||||||
'status' => "상태",
|
'status' => "상태",
|
||||||
'updated_at' => "수정일",
|
'updated_at' => "수정일",
|
||||||
'created_at' => "신청일",
|
'created_at' => "신청일",
|
||||||
|
'DEFENCE' => "방어",
|
||||||
'SERVER' => "서버",
|
'SERVER' => "서버",
|
||||||
|
'IP' => "IP",
|
||||||
'CPU' => "CPU",
|
'CPU' => "CPU",
|
||||||
'RAM' => "RAM",
|
'RAM' => "RAM",
|
||||||
'DISK' => "DISK",
|
'DISK' => "DISK",
|
||||||
'IP' => "IP",
|
'SOFTWARE' => "SOFTWARE",
|
||||||
],
|
],
|
||||||
'DEFAULTS' => [
|
'DEFAULTS' => [
|
||||||
'type' => "hosting",
|
'type' => "hosting",
|
||||||
|
|||||||
18
app/Language/en/Customer/ServicePart.php
Normal file
18
app/Language/en/Customer/ServicePart.php
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<?php
|
||||||
|
return [
|
||||||
|
'title' => "서비스부품연결",
|
||||||
|
'label' => [
|
||||||
|
'serviceinfo_uid' => "서비스",
|
||||||
|
'partinfo_uid' => "장비부품",
|
||||||
|
'billing_type' => "청구유형",
|
||||||
|
'amount' => "금액",
|
||||||
|
'created_at' => "작성일",
|
||||||
|
],
|
||||||
|
'DEFAULTS' => [
|
||||||
|
'billing_type' => 'month',
|
||||||
|
],
|
||||||
|
"BILLING_TYPE" => [
|
||||||
|
"month" => "월별",
|
||||||
|
"onetime" => "일회성",
|
||||||
|
],
|
||||||
|
];
|
||||||
18
app/Language/en/Customer/ServiceServer.php
Normal file
18
app/Language/en/Customer/ServiceServer.php
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<?php
|
||||||
|
return [
|
||||||
|
'title' => "서비스서버연결",
|
||||||
|
'label' => [
|
||||||
|
'serviceinfo_uid' => "서비스",
|
||||||
|
'serverinfo_uid' => "서버",
|
||||||
|
'billing_type' => "청구유형",
|
||||||
|
'amount' => "금액",
|
||||||
|
'created_at' => "작성일",
|
||||||
|
],
|
||||||
|
'DEFAULTS' => [
|
||||||
|
'billing_type' => 'month',
|
||||||
|
],
|
||||||
|
"BILLING_TYPE" => [
|
||||||
|
"month" => "월별",
|
||||||
|
"onetime" => "일회성",
|
||||||
|
],
|
||||||
|
];
|
||||||
@ -8,15 +8,14 @@ class ServiceModel extends CustomerModel
|
|||||||
{
|
{
|
||||||
const TABLE = "serviceinfo";
|
const TABLE = "serviceinfo";
|
||||||
const PK = "uid";
|
const PK = "uid";
|
||||||
const TITLE = "title";
|
const TITLE = "rack";
|
||||||
protected $table = self::TABLE;
|
protected $table = self::TABLE;
|
||||||
protected $primaryKey = self::PK;
|
protected $primaryKey = self::PK;
|
||||||
protected $returnType = ServiceEntity::class;
|
protected $returnType = ServiceEntity::class;
|
||||||
protected $allowedFields = [
|
protected $allowedFields = [
|
||||||
"clientinfo_uid",
|
"clientinfo_uid",
|
||||||
"code",
|
"rack",
|
||||||
"type",
|
"type",
|
||||||
"title",
|
|
||||||
"billing_at",
|
"billing_at",
|
||||||
"start_at",
|
"start_at",
|
||||||
"end_at",
|
"end_at",
|
||||||
@ -36,18 +35,17 @@ class ServiceModel extends CustomerModel
|
|||||||
case "clientinfo_uid":
|
case "clientinfo_uid":
|
||||||
$rule = "required|numeric";
|
$rule = "required|numeric";
|
||||||
break;
|
break;
|
||||||
case "code":
|
case "rack":
|
||||||
$rule = "required|trim|min_length[4]|max_length[20]";
|
$rule = "required|trim|min_length[4]|max_length[20]";
|
||||||
$rule .= in_array($action, ["create", "create_form"]) ? "|is_unique[{$this->table}.{$field}]" : "";
|
$rule .= in_array($action, ["create", "create_form"]) ? "|is_unique[{$this->table}.{$field}]" : "";
|
||||||
break;
|
break;
|
||||||
case "title":
|
|
||||||
case "type":
|
case "type":
|
||||||
$rule = "required|trim|string";
|
$rule = "required|trim|string";
|
||||||
break;
|
break;
|
||||||
case "billing_at":
|
case "billing_at":
|
||||||
|
case "start_at":
|
||||||
$rule = "required|valid_date";
|
$rule = "required|valid_date";
|
||||||
break;
|
break;
|
||||||
case "start_at":
|
|
||||||
case "end_at":
|
case "end_at":
|
||||||
$rule = "if_exist|valid_date";
|
$rule = "if_exist|valid_date";
|
||||||
default:
|
default:
|
||||||
|
|||||||
@ -6,22 +6,17 @@ use App\Entities\Customer\ServicePartEntity;
|
|||||||
|
|
||||||
class ServicePartModel extends CustomerModel
|
class ServicePartModel extends CustomerModel
|
||||||
{
|
{
|
||||||
const TABLE = "serviceinfo";
|
const TABLE = "serviceinfos_partinfos";
|
||||||
const PK = "uid";
|
const PK = "uid";
|
||||||
const TITLE = "title";
|
const TITLE = "uid";
|
||||||
protected $table = self::TABLE;
|
protected $table = self::TABLE;
|
||||||
protected $primaryKey = self::PK;
|
protected $primaryKey = self::PK;
|
||||||
protected $returnType = ServicePartEntity::class;
|
protected $returnType = ServicePartEntity::class;
|
||||||
protected $allowedFields = [
|
protected $allowedFields = [
|
||||||
"clientinfo_uid",
|
"serviceinfo_uid",
|
||||||
"code",
|
"partinfo_uid",
|
||||||
"type",
|
"billing_type",
|
||||||
"title",
|
"amount",
|
||||||
"billing_at",
|
|
||||||
"start_at",
|
|
||||||
"end_at",
|
|
||||||
"status",
|
|
||||||
"updated_at"
|
|
||||||
];
|
];
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
@ -33,23 +28,14 @@ class ServicePartModel extends CustomerModel
|
|||||||
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
|
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
|
||||||
}
|
}
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
case "clientinfo_uid":
|
case "serviceinfo_uid":
|
||||||
|
case "partinfo_uid":
|
||||||
|
case "amount":
|
||||||
$rule = "required|numeric";
|
$rule = "required|numeric";
|
||||||
break;
|
break;
|
||||||
case "code":
|
case "billing_type":
|
||||||
$rule = "required|trim|min_length[4]|max_length[20]";
|
|
||||||
$rule .= in_array($action, ["create", "create_form"]) ? "|is_unique[{$this->table}.{$field}]" : "";
|
|
||||||
break;
|
|
||||||
case "title":
|
|
||||||
case "type":
|
|
||||||
$rule = "required|trim|string";
|
$rule = "required|trim|string";
|
||||||
break;
|
break;
|
||||||
case "billing_at":
|
|
||||||
$rule = "required|valid_date";
|
|
||||||
break;
|
|
||||||
case "start_at":
|
|
||||||
case "end_at":
|
|
||||||
$rule = "if_exist|valid_date";
|
|
||||||
default:
|
default:
|
||||||
$rule = parent::getFieldRule($action, $field);
|
$rule = parent::getFieldRule($action, $field);
|
||||||
break;
|
break;
|
||||||
|
|||||||
45
app/Models/Customer/ServiceServerModel.php
Normal file
45
app/Models/Customer/ServiceServerModel.php
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models\Customer;
|
||||||
|
|
||||||
|
use App\Entities\Customer\ServiceServerEntity;
|
||||||
|
|
||||||
|
class ServiceServerModel extends CustomerModel
|
||||||
|
{
|
||||||
|
const TABLE = "serviceinfos_partinfos";
|
||||||
|
const PK = "uid";
|
||||||
|
const TITLE = "uid";
|
||||||
|
protected $table = self::TABLE;
|
||||||
|
protected $primaryKey = self::PK;
|
||||||
|
protected $returnType = ServiceServerEntity::class;
|
||||||
|
protected $allowedFields = [
|
||||||
|
"serviceinfo_uid",
|
||||||
|
"partinfo_uid",
|
||||||
|
"billing_type",
|
||||||
|
"amount",
|
||||||
|
];
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
parent::__construct();
|
||||||
|
}
|
||||||
|
public function getFieldRule(string $action, string $field): string
|
||||||
|
{
|
||||||
|
if (is_array($field)) {
|
||||||
|
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
|
||||||
|
}
|
||||||
|
switch ($field) {
|
||||||
|
case "serviceinfo_uid":
|
||||||
|
case "partinfo_uid":
|
||||||
|
case "amount":
|
||||||
|
$rule = "required|numeric";
|
||||||
|
break;
|
||||||
|
case "billing_type":
|
||||||
|
$rule = "required|trim|string";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$rule = parent::getFieldRule($action, $field);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return $rule;
|
||||||
|
}
|
||||||
|
}
|
||||||
46
app/Services/Customer/ServiceServerService.php
Normal file
46
app/Services/Customer/ServiceServerService.php
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Services\Customer;
|
||||||
|
|
||||||
|
use CodeIgniter\HTTP\IncomingRequest;
|
||||||
|
|
||||||
|
use App\Entities\Customer\ServiceServerEntity;
|
||||||
|
use App\Models\Customer\ServiceServerModel;
|
||||||
|
|
||||||
|
class ServiceServerService extends CustomerService
|
||||||
|
{
|
||||||
|
protected ?IncomingRequest $request = null;
|
||||||
|
public function __construct(?IncomingRequest $request = null)
|
||||||
|
{
|
||||||
|
parent::__construct($request);
|
||||||
|
}
|
||||||
|
public function getClassName(): string
|
||||||
|
{
|
||||||
|
return parent::getClassName() . DIRECTORY_SEPARATOR . "ServiceServer";
|
||||||
|
}
|
||||||
|
public function getModelClass(): ServiceServerModel
|
||||||
|
{
|
||||||
|
return new ServiceServerModel();
|
||||||
|
}
|
||||||
|
public function getEntityClass(): ServiceServerEntity
|
||||||
|
{
|
||||||
|
return new ServiceServerEntity();
|
||||||
|
}
|
||||||
|
public function getFields(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
"serviceinfo_uid",
|
||||||
|
"partinfo_uid",
|
||||||
|
"billing_type",
|
||||||
|
"amount",
|
||||||
|
];
|
||||||
|
}
|
||||||
|
public function getFilterFields(): array
|
||||||
|
{
|
||||||
|
return ["serviceinfo_uid", "type", "partinfo_uid"];
|
||||||
|
}
|
||||||
|
public function getBatchJobFields(): array
|
||||||
|
{
|
||||||
|
return ["type", "partinfo_uid"];
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -29,22 +29,17 @@ class ServiceService extends CustomerService
|
|||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
"clientinfo_uid",
|
"clientinfo_uid",
|
||||||
"code",
|
|
||||||
"type",
|
"type",
|
||||||
"title",
|
"rack",
|
||||||
"billing_at",
|
"billing_at",
|
||||||
"start_at",
|
"start_at",
|
||||||
"SERVER",
|
"end_at",
|
||||||
"CPU",
|
|
||||||
"RAM",
|
|
||||||
"DISK",
|
|
||||||
"IP",
|
|
||||||
"status",
|
"status",
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
public function getFilterFields(): array
|
public function getFilterFields(): array
|
||||||
{
|
{
|
||||||
return ["clientinfo_uid", 'type', "SERVER", "CPU", "RAM", "DISK", "IP", 'status'];
|
return ["clientinfo_uid", 'type', 'status'];
|
||||||
}
|
}
|
||||||
public function getBatchJobFields(): array
|
public function getBatchJobFields(): array
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user