dbmsv2 init...1

This commit is contained in:
choi.jh 2025-09-15 11:00:16 +09:00
parent 3c3861c3e3
commit b1df9e946c
14 changed files with 68 additions and 64 deletions

View File

@ -4,7 +4,6 @@ namespace App\Cells\Customer;
use App\Services\Customer\PaymentService; use App\Services\Customer\PaymentService;
use App\Services\Customer\ServiceService; use App\Services\Customer\ServiceService;
use App\Services\Equipment\ServerPartService;
class ServiceCell extends CustomerCell class ServiceCell extends CustomerCell
{ {

View File

@ -40,7 +40,7 @@ class ClientController extends CustomerController
// 생성 후, Client 코드값 재정의 // 생성 후, Client 코드값 재정의
$format = env("Client.Prefix.{$formDatas['site']}.code.format", false); $format = env("Client.Prefix.{$formDatas['site']}.code.format", false);
if (!$format) { if (!$format) {
throw new \Exception(__METHOD__ . "에서 code의 prefix가 정의되지 않았습니다."); throw new \Exception(__METHOD__ . "에서 code의 code의 format[Client.Prefix.{$formDatas['site']}.code.format] 정의되지 않았습니다.");
} }
$this->getService()->modify( $this->getService()->modify(
$entity, $entity,

View File

@ -64,11 +64,11 @@ class ServiceController extends CustomerController
//생성관련 //생성관련
protected function create_form_process(): void protected function create_form_process(): void
{ {
//Form 기본값정의
$format = env("Server.Prefix.code.format", false); $format = env("Server.Prefix.code.format", false);
if (!$format) { if (!$format) {
throw new \Exception(__METHOD__ . "에서 code의 format[Server.Prefix.code.format]이 정의되지 않았습니다."); throw new \Exception(__METHOD__ . "에서 code의 format[Server.Prefix.code.format]이 정의되지 않았습니다.");
} }
//기본값정의
$this->getService()->setFormDatas([ $this->getService()->setFormDatas([
'location' => 'chiba', 'location' => 'chiba',
'type' => 'normal', 'type' => 'normal',

View File

@ -52,11 +52,11 @@ class ServerController extends EquipmentController
//생성 //생성
protected function create_form_process(): void protected function create_form_process(): void
{ {
//Form 기본값정의
$format = env("Server.Prefix.code.format", false); $format = env("Server.Prefix.code.format", false);
if (!$format) { if (!$format) {
throw new \Exception(__METHOD__ . "에서 code의 format[Server.Prefix.code.format]이 정의되지 않았습니다."); throw new \Exception(__METHOD__ . "에서 code의 format[Server.Prefix.code.format]이 정의되지 않았습니다.");
} }
//기본값정의
$this->getService()->setFormDatas([ $this->getService()->setFormDatas([
'code' => $this->getService()->getLastestCode( 'code' => $this->getService()->getLastestCode(
$format, $format,

View File

@ -63,8 +63,11 @@ class Home extends AdminController
public function index(): RedirectResponse|string public function index(): RedirectResponse|string
{ {
$this->getService()->setAction(__FUNCTION__); $this->getService()->setAction(__FUNCTION__);
//기본전달값정의
$this->getService()->setFormDatas($this->request->getGet());
$this->getService()->setFormFields(); $this->getService()->setFormFields();
$this->getService()->setFormFilters(); $this->getService()->setFormFilters();
$this->getService()->setFormRules();
$this->getService()->setFormOptions(); $this->getService()->setFormOptions();
//Total 서버 현황 //Total 서버 현황
$this->totalCounts = $this->getService()->getTotalCountsByType(); $this->totalCounts = $this->getService()->getTotalCountsByType();

View File

@ -143,7 +143,7 @@ abstract class CommonController extends BaseController
//초기화 //초기화
$this->getService()->setAction(__FUNCTION__); $this->getService()->setAction(__FUNCTION__);
$this->getService()->setFormFields(); $this->getService()->setFormFields();
//기본전달값정의 //전달값정의
$this->getService()->setFormDatas($this->request->getGet()); $this->getService()->setFormDatas($this->request->getGet());
$this->getService()->setFormFilters(); $this->getService()->setFormFilters();
$this->getService()->setFormRules(); $this->getService()->setFormRules();
@ -153,7 +153,6 @@ abstract class CommonController extends BaseController
$this->forms = ['attributes' => ['method' => "post",], 'hiddens' => []]; $this->forms = ['attributes' => ['method' => "post",], 'hiddens' => []];
return $this->getResultSuccess(); return $this->getResultSuccess();
} catch (\Exception $e) { } catch (\Exception $e) {
// dd($e->getMessage());
return $this->getResultFail($e->getMessage()); return $this->getResultFail($e->getMessage());
} }
} }
@ -168,7 +167,7 @@ abstract class CommonController extends BaseController
try { try {
$this->getService()->setAction(__FUNCTION__); $this->getService()->setAction(__FUNCTION__);
$this->getService()->setFormFields(); $this->getService()->setFormFields();
//기본전달값정의 //전달값정의
$this->getService()->setFormDatas($this->request->getPost()); $this->getService()->setFormDatas($this->request->getPost());
$this->getService()->setFormFilters(); $this->getService()->setFormFilters();
$this->getService()->setFormRules(); $this->getService()->setFormRules();
@ -191,7 +190,7 @@ abstract class CommonController extends BaseController
try { try {
$this->getService()->setAction(__FUNCTION__); $this->getService()->setAction(__FUNCTION__);
$this->getService()->setFormFields(); $this->getService()->setFormFields();
//기본전달값정의 //전달값정의
$this->getService()->setFormDatas($this->request->getGet()); $this->getService()->setFormDatas($this->request->getGet());
$this->getService()->setFormFilters(); $this->getService()->setFormFilters();
$this->getService()->setFormRules(); $this->getService()->setFormRules();
@ -221,7 +220,7 @@ abstract class CommonController extends BaseController
try { try {
$this->getService()->setAction(__FUNCTION__); $this->getService()->setAction(__FUNCTION__);
$this->getService()->setFormFields(); $this->getService()->setFormFields();
//기본전달값정의 //전달값정의
$this->getService()->setFormDatas($this->request->getPost()); $this->getService()->setFormDatas($this->request->getPost());
$this->getService()->setFormFilters(); $this->getService()->setFormFilters();
$this->getService()->setFormRules(); $this->getService()->setFormRules();
@ -252,7 +251,7 @@ abstract class CommonController extends BaseController
try { try {
$this->getService()->setAction(__FUNCTION__); $this->getService()->setAction(__FUNCTION__);
$this->getService()->setFormFields([$field]); $this->getService()->setFormFields([$field]);
//기본전달값정의 //전달값정의
$this->getService()->setFormDatas($this->request->getGet()); $this->getService()->setFormDatas($this->request->getGet());
$this->getService()->setFormFilters(); $this->getService()->setFormFilters();
$this->getService()->setFormRules(); $this->getService()->setFormRules();
@ -306,7 +305,7 @@ abstract class CommonController extends BaseController
$this->getService()->setAction(__FUNCTION__); $this->getService()->setAction(__FUNCTION__);
list($selectedFields, $formDatas, $uids) = $this->batchjob_pre_process(); list($selectedFields, $formDatas, $uids) = $this->batchjob_pre_process();
$this->getService()->setFormFields($selectedFields); $this->getService()->setFormFields($selectedFields);
//기본전달값정의 //전달값정의
$this->getService()->setFormDatas($this->request->getPost()); $this->getService()->setFormDatas($this->request->getPost());
$this->getService()->setFormFilters(); $this->getService()->setFormFilters();
$this->getService()->setFormRules(); $this->getService()->setFormRules();
@ -405,7 +404,7 @@ abstract class CommonController extends BaseController
try { try {
$this->getService()->setAction(__FUNCTION__); $this->getService()->setAction(__FUNCTION__);
$this->getService()->setFormFields(); $this->getService()->setFormFields();
//기본전달값정의 //전달값정의
$this->getService()->setFormDatas($this->request->getGet()); $this->getService()->setFormDatas($this->request->getGet());
$this->getService()->setFormFilters(); $this->getService()->setFormFilters();
$this->getService()->setFormRules(); $this->getService()->setFormRules();
@ -430,7 +429,7 @@ abstract class CommonController extends BaseController
//Filter조건절 처리 //Filter조건절 처리
$index_filters = []; $index_filters = [];
foreach ($this->getService()->getControlDatas('actionFilters') as $field) { foreach ($this->getService()->getControlDatas('actionFilters') as $field) {
$value = $this->request->getGet($field); $value = $this->getService()->getFormDatas()[$field] ?? null;
if ($value) { if ($value) {
$this->getService()->index_condition_filterField($field, $value); $this->getService()->index_condition_filterField($field, $value);
$index_filters[$field] = $value; $index_filters[$field] = $value;
@ -490,7 +489,7 @@ abstract class CommonController extends BaseController
try { try {
$this->getService()->setAction(__FUNCTION__); $this->getService()->setAction(__FUNCTION__);
$this->getService()->setFormFields(); $this->getService()->setFormFields();
//기본전달값정의 //전달값정의
$this->getService()->setFormDatas($this->request->getGet()); $this->getService()->setFormDatas($this->request->getGet());
$this->getService()->setFormFilters(); $this->getService()->setFormFilters();
$this->getService()->setFormRules(); $this->getService()->setFormRules();
@ -549,7 +548,7 @@ abstract class CommonController extends BaseController
try { try {
$this->getService()->setAction(__FUNCTION__); $this->getService()->setAction(__FUNCTION__);
$this->getService()->setFormFields(); $this->getService()->setFormFields();
//기본전달값정의 //전달값정의
$this->getService()->setFormDatas($this->request->getGet()); $this->getService()->setFormDatas($this->request->getGet());
$this->getService()->setFormFilters(); $this->getService()->setFormFilters();
$this->getService()->setFormRules(); $this->getService()->setFormRules();

View File

@ -342,7 +342,8 @@ class CommonHelper
case 'clientinfo_uid': case 'clientinfo_uid':
case 'serviceinfo_uid': case 'serviceinfo_uid':
case 'serverinfo_uid': case 'serverinfo_uid':
$value = array_key_exists($value, $viewDatas['control']['field_optons'][$field]) && $viewDatas['control']['field_optons'][$field][$value] ? $viewDatas['control']['field_optons'][$field][$value]->getTitle() : ""; $value = array_key_exists($value, $viewDatas['control']['field_optons'][$field]) &&
$viewDatas['control']['field_optons'][$field][$value] ? $viewDatas['control']['field_optons'][$field][$value]->getTitle() : "";
break; break;
default: default:
if (in_array($field, $viewDatas['control']['actionFilters'])) { if (in_array($field, $viewDatas['control']['actionFilters'])) {

View File

@ -27,12 +27,12 @@ abstract class CommonService
} }
return $this->_helper; return $this->_helper;
} }
final public function getControlDatas(?string $key = null): mixed final public function getControlDatas(?string $key = null): string|array
{ {
if (!$key) { if (!$key) {
return $this->_control; return $this->_control;
} }
return array_key_exists($key, $this->_control) ? $this->_control[$key] : null; return array_key_exists($key, $this->_control) ? $this->_control[$key] : [];
} }
final public function setControlDatas(string $key, mixed $values): void final public function setControlDatas(string $key, mixed $values): void
{ {

View File

@ -69,6 +69,7 @@ class ServiceService extends CustomerService
'type', 'type',
'clientinfo_uid', 'clientinfo_uid',
'serverinfo_uid', 'serverinfo_uid',
'user_uid', //home의 최신신규서버현황에서 사용
'status', 'status',
]; ];
} }

View File

@ -122,34 +122,29 @@ class ServerPartService extends EquipmentService
{ {
switch ($field) { switch ($field) {
case 'part_uid': case 'part_uid':
$options = $this->getPartService()->getEntities(); $type = $this->getFormDatas()['type'] ?? null;
break; switch ($type) {
case 'CPU': case 'CPU':
$options = $this->getPartService()->getEntities(['type' => 'CPU']); case 'RAM':
break; case 'DISK':
case 'RAM': case 'OS':
$options = $this->getPartService()->getEntities(['type' => 'RAM']); case 'DB':
break; case 'SOFTWARE':
case 'DISK': $options = $this->getPartService()->getEntities(['type' => $type]);
$options = $this->getPartService()->getEntities(['type' => 'DISK']); break;
break; case 'SWITCH':
case 'OS': $options = $this->getSwitchService()->getEntities();
$options = $this->getPartService()->getEntities(['type' => 'OS']); break;
break; case 'IP':
case 'DB': $options = $this->getIPService()->getEntities();
$options = $this->getPartService()->getEntities(['type' => 'DB']); break;
break; case 'CS':
case 'SOFTWARE': $options = $this->getCSService()->getEntities();
$options = $this->getPartService()->getEntities(['type' => 'SOFTWARE']); break;
break; default:
case 'SWITCH': $options = [];
$options = $this->getSwitchService()->getEntities(); break;
break; }
case 'IP':
$options = $this->getIPService()->getEntities();
break;
case 'CS':
$options = $this->getCSService()->getEntities();
break; break;
default: default:
$options = parent::getFormOption($field, $options); $options = parent::getFormOption($field, $options);

View File

@ -13,14 +13,13 @@
<td class="layout_right"> <td class="layout_right">
<!-- Layout Right Start --> <!-- Layout Right Start -->
<?= $this->include("{$viewDatas['layout']}/welcome/banner"); ?> <?= $this->include("{$viewDatas['layout']}/welcome/banner"); ?>
<div class="row align-items-start" style="padding-top:20px;"> <div class="row align-items-start mt-3">
<div class="col"> <div class="col-8">
<?= $this->include("{$viewDatas['layout']}/welcome/total"); ?> <?= $this->include("{$viewDatas['layout']}/welcome/total_service"); ?>
<?= $this->include("{$viewDatas['layout']}/welcome/new_service"); ?>
</div> </div>
</div> <div class="col-4">
<div class="row align-items-start" style="padding-top:20px;"> <?= $this->include("{$viewDatas['layout']}/welcome/user_history"); ?>
<div class="col">
<?= $this->include("{$viewDatas['layout']}/welcome/new"); ?>
</div> </div>
</div> </div>
<!-- Layout Right End --> <!-- Layout Right End -->

View File

@ -1,8 +1,8 @@
<div class="layout_header"> <div class="layout_header mt-3">
<ul class="nav nav-tabs"> <ul class="nav nav-tabs">
<li class="nav-item"> <li class="nav-item">
<span class="nav-item navbar-brand" aria-current="page"> <span class="nav-item navbar-brand" aria-current="page">
<h4>&nbsp;&nbsp;<?= ICONS['CHART'] ?> 최신 신규 서 현황&nbsp;&nbsp;</h4> <h4>&nbsp;&nbsp;<?= ICONS['CHART'] ?> 최신 신규 서비스 현황&nbsp;&nbsp;</h4>
</span> </span>
</li> </li>
</ul> </ul>
@ -15,11 +15,8 @@
<th>업체명</th> <th>업체명</th>
<th>구분</th> <th>구분</th>
<th>장비번호</th> <th>장비번호</th>
<th>스위치정보</th> <th>스위치정보 / IP정보 / CS정보</th>
<th>IP정보</th>
<th>CS정보</th>
<th>등록자</th> <th>등록자</th>
<th>비고</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -30,11 +27,8 @@
<td><?= $viewDatas['service']->getHelper()->getFieldView('clientinfo_uid', $entity->getClientInfoUID(), $viewDatas) ?></td> <td><?= $viewDatas['service']->getHelper()->getFieldView('clientinfo_uid', $entity->getClientInfoUID(), $viewDatas) ?></td>
<td><?= $viewDatas['service']->getHelper()->getFieldView('type', $entity->getType(), $viewDatas) ?></td> <td><?= $viewDatas['service']->getHelper()->getFieldView('type', $entity->getType(), $viewDatas) ?></td>
<td><?= $viewDatas['service']->getHelper()->getFieldView('serveripinfo_uid', $entity->getServerEntity()->getCode(), $viewDatas) ?></td> <td><?= $viewDatas['service']->getHelper()->getFieldView('serveripinfo_uid', $entity->getServerEntity()->getCode(), $viewDatas) ?></td>
<td><?= $viewDatas['service']->getHelper()->getFieldView('SWITCH', null, $viewDatas) ?></td> <td><?= view_cell("\App\Cells\Equipment\ServerPartCell::parttable", ['serverinfo_uid' => $entity->getServerEntity()->getPK(), 'types' => SERVERPART['SERVICE_PARTTYPES'], 'template' => 'part_service']) ?></td>
<td><?= $viewDatas['service']->getHelper()->getFieldView('IP', null, $viewDatas) ?></td>
<td><?= $viewDatas['service']->getHelper()->getFieldView('CS', null, $viewDatas) ?></td>
<td><?= $viewDatas['service']->getHelper()->getFieldView('user_uid', $entity->getUserUID(), $viewDatas) ?></td> <td><?= $viewDatas['service']->getHelper()->getFieldView('user_uid', $entity->getUserUID(), $viewDatas) ?></td>
<td><?= $viewDatas['service']->getHelper()->getFieldView('history', "", $viewDatas) ?></td>
</tr> </tr>
<?php endforeach ?> <?php endforeach ?>
</tbody> </tbody>

View File

@ -2,7 +2,7 @@
<ul class="nav nav-tabs"> <ul class="nav nav-tabs">
<li class="nav-item"> <li class="nav-item">
<span class="nav-item navbar-brand" aria-current="page"> <span class="nav-item navbar-brand" aria-current="page">
<h4>&nbsp;&nbsp;<?= ICONS['CHART'] ?> 최신 신규 서버 현황&nbsp;&nbsp;</h4> <h4>&nbsp;&nbsp;<?= ICONS['CHART'] ?> 전체 서비스 현황&nbsp;&nbsp;</h4>
</span> </span>
</li> </li>
</ul> </ul>

View File

@ -0,0 +1,13 @@
<div class="layout_header">
<ul class="nav nav-tabs">
<li class="nav-item">
<span class="nav-item navbar-brand" aria-current="page">
<h4>&nbsp;&nbsp;<?= ICONS['SETUP'] ?>작업내역&nbsp;&nbsp;</h4>
</span>
</li>
</ul>
</div>
<div style="border-left: 1px solid black; border-right: 1px solid black; padding:20px;">
준비중....
</div>
<div class="layout_footer"></div>