diff --git a/app/Database/dbmsv2.vuerd.json b/app/Database/dbmsv2.vuerd.json
index 79f5b75..6eb7adb 100644
--- a/app/Database/dbmsv2.vuerd.json
+++ b/app/Database/dbmsv2.vuerd.json
@@ -4,8 +4,8 @@
"settings": {
"width": 3000,
"height": 3000,
- "scrollTop": -1726.3031,
- "scrollLeft": -455.9114,
+ "scrollTop": -1512.3031,
+ "scrollLeft": -1646.9114,
"zoomLevel": 0.76,
"show": 511,
"database": 4,
diff --git a/app/Models/CommonModel.php b/app/Models/CommonModel.php
index c1065a0..872ed2a 100644
--- a/app/Models/CommonModel.php
+++ b/app/Models/CommonModel.php
@@ -44,7 +44,7 @@ abstract class CommonModel extends Model
protected $afterFind = [];
protected $beforeDelete = [];
protected $afterDelete = [];
-
+ protected $isDebug = false;
protected function __construct()
{
parent::__construct();
@@ -149,7 +149,7 @@ abstract class CommonModel extends Model
}
return $value;
}
- public function create(array $formDatas): mixed
+ public function create(array $formDatas, bool $isDebug = false): mixed
{
// LogCollector::debug("입력내용");
// LogCollector::debug(var_export($formDatas, true));
@@ -164,6 +164,9 @@ abstract class CommonModel extends Model
$convertedFormDatas[$field] = $value;
}
}
+ if ($this->isDebug) {
+ dd($convertedFormDatas);
+ }
// 최종 저장 시 오류 발생하면
if (!$this->save($convertedFormDatas)) {
$message = sprintf(
@@ -187,7 +190,7 @@ abstract class CommonModel extends Model
}
return $entity;
}
- public function modify(mixed $entity, array $formDatas): mixed
+ public function modify(mixed $entity, array $formDatas, bool $isDebug = false): mixed
{
// 저장하기 전에 데이터 값 변경이 필요한 Field
// LogCollector::debug("[{$entity->getPK()}/{$entity->getTitle()}] 변경 전 내용");
@@ -204,6 +207,9 @@ abstract class CommonModel extends Model
$entity->$field = $value;
}
}
+ if ($this->isDebug) {
+ dd($entity);
+ }
//수정일추가
$entity->setUpdatedAt(date("Y-m-d H:i:s"));
// 최종 저장 시 오류 발생하면
diff --git a/app/Models/Equipment/ServerModel.php b/app/Models/Equipment/ServerModel.php
index 3f2545e..9fc9b53 100644
--- a/app/Models/Equipment/ServerModel.php
+++ b/app/Models/Equipment/ServerModel.php
@@ -40,6 +40,9 @@ class ServerModel extends EquipmentModel
case "serviceinfo_uid":
$rule = "permit_empty|numeric";
break;
+ case "title":
+ $rule = "required|trim|string";
+ break;
case "price":
case "amount":
$rule = "required|numeric";
diff --git a/app/Services/CommonService.php b/app/Services/CommonService.php
index a4119df..11b5840 100644
--- a/app/Services/CommonService.php
+++ b/app/Services/CommonService.php
@@ -11,6 +11,7 @@ abstract class CommonService
private $_model = null;
private $_classNames = [];
private $_serviceDatas = [];
+ protected $isDebug = false;
protected function __construct(Model $model)
{
$this->_model = $model;
@@ -196,14 +197,28 @@ abstract class CommonService
//생성
public function create(array $formDatas): mixed
{
+ if ($this->isDebug) {
+ echo $this->getClassName() . "=>" . __METHOD__;
+ echo var_dump($formDatas);
+ }
$entity = $this->getModel()->create($formDatas);
+ if ($this->isDebug) {
+ dd($entity);
+ }
LogCollector::info("[{$entity->getTitle()}]" . MESSAGES["CREATED"] . ":");
return $entity;
}
//수정
public function modify(mixed $entity, array $formDatas): mixed
{
+ if ($this->isDebug) {
+ echo $this->getClassName() . "=>" . __METHOD__;
+ echo var_dump($formDatas);
+ }
$entity = $this->getModel()->modify($entity, $formDatas);
+ if ($this->isDebug) {
+ dd($entity);
+ }
LogCollector::info("[{$entity->getTitle()}]" . MESSAGES["UPDATED"] . ":");
return $entity;
}
diff --git a/app/Services/Equipment/ServerPartService.php b/app/Services/Equipment/ServerPartService.php
index 05f59ce..62447c8 100644
--- a/app/Services/Equipment/ServerPartService.php
+++ b/app/Services/Equipment/ServerPartService.php
@@ -109,13 +109,13 @@ class ServerPartService extends EquipmentService
{
$entities = [];
foreach (SERVER['PARTTYPES'] as $partType) {
- $entities[] = parent::create(
- $this->getFormDatasByServer(
- $serverEntity,
- $partType,
- $formDatas
- )
+ $serverPartFormDatas = $this->getFormDatasByServer(
+ $serverEntity,
+ $partType,
+ $formDatas
);
+ $this->isDebug = true;
+ $entities[] = parent::create($serverPartFormDatas);
}
return $entities;
}
diff --git a/app/Services/Equipment/ServerService.php b/app/Services/Equipment/ServerService.php
index 1d890ab..4ae481d 100644
--- a/app/Services/Equipment/ServerService.php
+++ b/app/Services/Equipment/ServerService.php
@@ -179,7 +179,6 @@ class ServerService extends EquipmentService
public function create(array $formDatas): ServerEntity
{
$entity = parent::create($formDatas);
- dd($entity);
//ServerPart정보 생성
foreach ($this->getServerPartService()->createByServer($entity, $formDatas) as $serverPartEntity) {
$entity->addServerPartEntity($serverPartEntity->getType(), $serverPartEntity);
diff --git a/app/Views/admin/server/create_form.php b/app/Views/admin/server/create_form.php
index 90f4dd0..37ee1a4 100644
--- a/app/Views/admin/server/create_form.php
+++ b/app/Views/admin/server/create_form.php
@@ -15,19 +15,26 @@
-
-
- | = $viewDatas['helper']->getFieldLabel("partinfo_uid_{$type}", lang("{$viewDatas['class_path']}.label.partinfo_uid_{$type}"), $viewDatas) ?> |
-
- = $viewDatas['helper']->getFieldForm("partinfo_uid_{$type}", old("partinfo_uid_{$type}") ?? ($viewDatas['control']['field_default_values']["partinfo_uid_{$type}"] ?? null), $viewDatas) ?>
- = form_dropdown("partinfo_uid_{$type}_cnt", $viewDatas['serverinfopartinfo_cnt_range'], old("partinfo_uid_{$type}_cnt") ?? 1) . "개" ?>
-
- = form_dropdown("partinfo_uid_{$type}_extra", $viewDatas['serverinfopartinfo_extra_options'], old("partinfo_uid_{$type}_extra") ?? null) ?>
-
- = validation_show_error("partinfo_uid_{$type}"); ?>
- |
-
-
+
+ | 부품정보 |
+
+
+
+
+ | = $viewDatas['helper']->getFieldLabel("partinfo_uid_{$type}", lang("{$viewDatas['class_path']}.label.partinfo_uid_{$type}"), $viewDatas) ?> |
+
+ = $viewDatas['helper']->getFieldForm("partinfo_uid_{$type}", old("partinfo_uid_{$type}") ?? ($viewDatas['control']['field_default_values']["partinfo_uid_{$type}"] ?? null), $viewDatas) ?>
+ = form_dropdown("partinfo_uid_{$type}_cnt", $viewDatas['serverinfopartinfo_cnt_range'], old("partinfo_uid_{$type}_cnt") ?? 1) . "개" ?>
+
+ = form_dropdown("partinfo_uid_{$type}_extra", $viewDatas['serverinfopartinfo_extra_options'], old("partinfo_uid_{$type}_extra") ?? null) ?>
+
+ = validation_show_error("partinfo_uid_{$type}"); ?>
+ |
+
+
+
+ |
+
= form_submit('', '입력', array("class" => "btn btn-outline btn-primary")); ?>
= form_close(); ?>
diff --git a/app/Views/admin/server/modify_form.php b/app/Views/admin/server/modify_form.php
index d99de5c..cc60ab9 100644
--- a/app/Views/admin/server/modify_form.php
+++ b/app/Views/admin/server/modify_form.php
@@ -15,19 +15,26 @@
-
-
- | = $viewDatas['helper']->getFieldLabel("partinfo_uid_{$type}", lang("{$viewDatas['class_path']}.label.partinfo_uid_{$type}"), $viewDatas) ?> |
-
- = $viewDatas['helper']->getFieldForm("partinfo_uid_{$type}", old("partinfo_uid_{$type}") ?? ($viewDatas['entity']->getServerPartEntity($type)->getPartInfoUID()), $viewDatas) ?>
- = form_dropdown("partinfo_uid_{$type}_cnt", $viewDatas['serverinfopartinfo_cnt_range'], old("partinfo_uid_{$type}_cnt") ?? $viewDatas['entity']->getServerPartEntity($type)->getCnt()) . "개" ?>
-
- = form_dropdown("partinfo_uid_{$type}_extra", $viewDatas['serverinfopartinfo_extra_options'], old("partinfo_uid_{$type}_extra") ?? $viewDatas['entity']->getServerPartEntity($type)->getExtra()) ?>
-
- = validation_show_error("partinfo_uid_{$type}"); ?>
- |
-
-
+
+ | 부품정보 |
+
+
+
+
+ | = $viewDatas['helper']->getFieldLabel("partinfo_uid_{$type}", lang("{$viewDatas['class_path']}.label.partinfo_uid_{$type}"), $viewDatas) ?> |
+
+ = $viewDatas['helper']->getFieldForm("partinfo_uid_{$type}", old("partinfo_uid_{$type}") ?? ($viewDatas['entity']->getServerPartEntity($type)->getPartInfoUID()), $viewDatas) ?>
+ = form_dropdown("partinfo_uid_{$type}_cnt", $viewDatas['serverinfopartinfo_cnt_range'], old("partinfo_uid_{$type}_cnt") ?? $viewDatas['entity']->getServerPartEntity($type)->getCnt()) . "개" ?>
+
+ = form_dropdown("partinfo_uid_{$type}_extra", $viewDatas['serverinfopartinfo_extra_options'], old("partinfo_uid_{$type}_extra") ?? $viewDatas['entity']->getServerPartEntity($type)->getExtra()) ?>
+
+ = validation_show_error("partinfo_uid_{$type}"); ?>
+ |
+
+
+
+ |
+
= form_submit('', '입력', array("class" => "btn btn-outline btn-primary")); ?>
= form_close(); ?>