dbmsv4 init...1

This commit is contained in:
최준흠 2025-11-21 17:50:55 +09:00
parent 224bcb11a6
commit a21ad6be09
53 changed files with 248 additions and 498 deletions

View File

@ -30,7 +30,7 @@ abstract class AbstractCRUDController extends AbstractWebController
return $this->action_render_process($action, $this->getViewDatas(), $this->request->getVar('ActionTemplate'));
}
final public function create_form(): string|RedirectResponse
public function create_form(): string|RedirectResponse
{
try {
$action = __FUNCTION__;

View File

@ -23,4 +23,19 @@ class ServerPartController extends EquipmentController
}
//기본 함수 작업
//Custom 추가 함수
protected function create_form_process(array $formDatas = []): array
{
// Form Default값 설정 (오버라이드 포인트)
$formDatas = parent::create_form_process($formDatas);
$formDatas['serverinfo_uid'] = $this->request->getVar('serverinfo_uid') ?? throw new \Exception("ServerPart는 반드시 서버정보가 필요합니다.");
$formDatas['type'] = $this->request->getVar('type') ?? throw new \Exception("ServerPart는 반드시 파트형식 필요합니다.");
//type : CS,IP이면 월비용 기본처리
switch ($formDatas['type']) {
case 'CS':
case 'IP':
$formDatas['billing'] = PAYMENT['BILLING']['MONTH'];
break;
}
return $formDatas;
}
}

View File

@ -146,6 +146,7 @@ abstract class CommonController extends AbstractCRUDController
{
// Filter조건절 처리
$index_filters = [];
// dd($this->service->getFormService()->getIndexFilters($action));
foreach ($this->service->getFormService()->getIndexFilters($action) as $field) {
$value = $this->request->getVar($field) ?? null;
if ($value) {

View File

@ -9,7 +9,6 @@ class BoardEntity extends CommonEntity
{
const PK = Model::PK;
const TITLE = Model::TITLE;
const DEFAULT_STATUS = STATUS['AVAILABLE'];
final public function getUserUID(): int|null
{
return $this->attributes['user_uid'] ?? null;

View File

@ -8,7 +8,6 @@ class AccountEntity extends CustomerEntity
{
const PK = AccountModel::PK;
const TITLE = AccountModel::TITLE;
const DEFAULT_STATUS = STATUS['DEPOSIT'];
final public function getUserUID(): int|null
{
return $this->attributes['user_uid'] ?? null;

View File

@ -8,7 +8,6 @@ class ClientEntity extends CustomerEntity
{
const PK = ClientModel::PK;
const TITLE = ClientModel::TITLE;
const DEFAULT_STATUS = STATUS['AVAILABLE'];
final public function getUserUID(): int|null
{
return $this->attributes['user_uid'] ?? null;

View File

@ -8,7 +8,6 @@ class CouponEntity extends CustomerEntity
{
const PK = CouponModel::PK;
const TITLE = CouponModel::TITLE;
const DEFAULT_STATUS = STATUS['DEPOSIT'];
final public function getUserUID(): int|null
{
return $this->attributes['user_uid'] ?? null;

View File

@ -8,7 +8,6 @@ class PointEntity extends CustomerEntity
{
const PK = PointModel::PK;
const TITLE = PointModel::TITLE;
const DEFAULT_STATUS = STATUS['DEPOSIT'];
final public function getUserUID(): int|null
{
return $this->attributes['user_uid'];

View File

@ -8,7 +8,6 @@ class ServiceEntity extends CustomerEntity
{
const PK = ServiceModel::PK;
const TITLE = ServiceModel::TITLE;
const DEFAULT_STATUS = STATUS['AVAILABLE'];
final public function getUserUID(): int|null
{
return $this->attributes['user_uid'] ?? null;

View File

@ -8,7 +8,6 @@ class LineEntity extends EquipmentEntity
{
const PK = LineModel::PK;
const TITLE = LineModel::TITLE;
const DEFAULT_STATUS = STATUS['AVAILABLE'];
public function getBandwith(): string
{
return $this->attributes['bandwith'];

View File

@ -8,7 +8,6 @@ class ServerEntity extends EquipmentEntity
{
const PK = ServerModel::PK;
const TITLE = ServerModel::TITLE;
const DEFAULT_STATUS = STATUS['AVAILABLE'];
final public function getClientInfoUID(): int|null
{
return $this->attributes['clientinfo_uid'] ?? null;

View File

@ -53,9 +53,4 @@ class ServerPartEntity extends EquipmentEntity
{
return $this->attributes['extra'];
}
//리스트에서 상태표시용
public function getStatus(): string
{
return self::DEFAULT_STATUS;
}
}

View File

@ -8,7 +8,6 @@ class CPUEntity extends PartEntity
{
const PK = CPUModel::PK;
const TITLE = CPUModel::TITLE;
const DEFAULT_STATUS = STATUS['AVAILABLE'];
//기본기능
final public function getUsed(): int
{

View File

@ -8,7 +8,6 @@ class CSEntity extends PartEntity
{
const PK = CSModel::PK;
const TITLE = CSModel::TITLE;
const DEFAULT_STATUS = STATUS['AVAILABLE'];
//기본기능
public function getIP(): string
{

View File

@ -8,7 +8,6 @@ class DISKEntity extends PartEntity
{
const PK = DISKModel::PK;
const TITLE = DISKModel::TITLE;
const DEFAULT_STATUS = STATUS['AVAILABLE'];
//기본기능
final public function getUsed(): int
{

View File

@ -8,7 +8,6 @@ class IPEntity extends PartEntity
{
const PK = IPModel::PK;
const TITLE = IPModel::TITLE;
const DEFAULT_STATUS = STATUS['AVAILABLE'];
final public function getLineInfoUID(): int|null
{
return $this->attributes['lineinfo_uid'] ?? null;

View File

@ -8,7 +8,6 @@ class RAMEntity extends PartEntity
{
const PK = RAMModel::PK;
const TITLE = RAMModel::TITLE;
const DEFAULT_STATUS = STATUS['AVAILABLE'];
//기본기능
final public function getUsed(): int
{

View File

@ -8,7 +8,6 @@ class SOFTWAREEntity extends PartEntity
{
const PK = SOFTWAREModel::PK;
const TITLE = SOFTWAREModel::TITLE;
const DEFAULT_STATUS = STATUS['AVAILABLE'];
//기본기능
final public function getUsed(): int
{

View File

@ -8,8 +8,6 @@ class SWITCHEntity extends PartEntity
{
const PK = SWITCHModel::PK;
const TITLE = SWITCHModel::TITLE;
const DEFAULT_STATUS = STATUS['AVAILABLE'];
final public function getCode(): string
{
return $this->attributes['code'] ?? "";

View File

@ -9,7 +9,6 @@ class PaymentEntity extends CommonEntity
{
const PK = PaymentModel::PK;
const TITLE = PaymentModel::TITLE;
const DEFAULT_STATUS = STATUS['UNPAID'];
final public function getUserUID(): int|null
{
return $this->attributes['user_uid'] ?? null;
@ -46,7 +45,7 @@ class PaymentEntity extends CommonEntity
public function getCountDueAt(): string
{
$result = "";
if ($this->getStatus() === self::DEFAULT_STATUS) {
if ($this->getStatus() === STATUS['UNPAID']) {
$now = new DateTime(); // 오늘 날짜
$due = new DateTime($this->getBillingAt());
if ($due < $now) {

View File

@ -9,7 +9,6 @@ class UserSNSEntity extends CommonEntity
{
const PK = Model::PK;
const TITLE = Model::TITLE;
const DEFAULT_STATUS = STATUS['AVAILABLE'];
//Common Function
public function getParent(): int|null
{

View File

@ -49,7 +49,7 @@ class BoardForm extends CommonForm
$tempOptions = ['' => lang("{$this->getAttribute('class_path')}.label.{$field}") . " 선택"];
switch ($field) {
case 'worker_uid':
foreach (service('userservice')->getEntities() as $entity) {
foreach (service('userservice')->getEntities(['status' => STATUS['AVAILABLE']]) as $entity) {
$tempOptions[$entity->getPK()] = $entity->getTitle();
// $options['attributes'][$entity->getPK()] = ['data-role' => implode(DEFAULTS['DELIMITER_ROLE'], $entity->getRole())];
}

View File

@ -188,14 +188,14 @@ abstract class CommonForm
$tempOptions = ['' => lang("{$this->getAttribute('class_path')}.label.{$field}") . " 선택"];
switch ($field) {
case 'user_uid':
foreach (service('userservice')->getEntities() as $entity) {
foreach (service('userservice')->getEntities(['status' => STATUS['AVAILABLE']]) as $entity) {
$tempOptions[$entity->getPK()] = $entity->getTitle();
// $options['attributes'][$entity->getPK()] = ['data-role' => implode(DEFAULTS['DELIMITER_ROLE'], $entity->getRole())];
}
$options['options'] = $tempOptions;
break;
case 'clientinfo_uid':
foreach (service('customer_clientservice')->getEntities() as $entity) {
foreach (service('customer_clientservice')->getEntities(['status' => STATUS['AVAILABLE']]) as $entity) {
$tempOptions[$entity->getPK()] = $entity->getTitle();
// $options['attributes'][$entity->getPK()] = ['data-role' => implode(DEFAULTS['DELIMITER_ROLE'], $entity->getRole())];
}

View File

@ -45,4 +45,23 @@ class ServerForm extends EquipmentForm
}
return $rule;
}
public function getFormOption(string $field, array $options = ['options' => [], 'extras' => [], 'atttributes' => []]): array
{
$tempOptions = ['' => lang("{$this->getAttribute('class_path')}.label.{$field}") . " 선택"];
switch ($field) {
case 'serviceinfo_uid':
foreach (
service('customer_serviceservice')->getEntities(['status' => STATUS['AVAILABLE']]) as $entity
) {
$tempOptions[$entity->getPK()] = $entity->getTitle();
// $options['attributes'][$entity->getPK()] = ['data-role' => implode(DEFAULTS['DELIMITER_ROLE'], $entity->getRole())];
}
$options['options'] = $tempOptions;
break;
default:
$options = parent::getFormOption($field, $options);
break;
}
return $options;
}
}

View File

@ -2,6 +2,8 @@
namespace App\Forms\Equipment;
use App\Services\CommonService;
class ServerPartForm extends EquipmentForm
{
public function __construct()
@ -36,19 +38,38 @@ class ServerPartForm extends EquipmentForm
}
return $rule;
}
private function getPartService(string $type): CommonService
{
return service('part_' . strtolower($type) . 'service');
}
public function getFormOption(string $field, array $options = ['options' => [], 'extras' => [], 'atttributes' => []]): array
{
$tempOptions = ['' => lang("{$this->getAttribute('class_path')}.label.{$field}") . " 선택"];
switch ($field) {
case 'part_uid':
foreach (service('equipment_serverpartservice')->getEntities() as $entity) {
foreach (SERVERPART['ALL_PARTTYPES'] as $type) {
$partService = $this->getPartService($type);
$tempOptions[$type] = [lang("{$this->getAttribute('class_path')}.TYPE.{$type}") . " 선택"];
foreach ($partService->getEntities(['status' => STATUS['AVAILABLE']]) as $entity) {
$tempOptions[$type][$entity->getPK()] = $entity->getTitle();
// $options['attributes'][$type][$entity->getPK()] = ['data-role' => implode(DEFAULTS['DELIMITER_ROLE'], $entity->getRole())];
}
}
$options['options'] = $tempOptions;
break;
case 'serverinfo_uid':
foreach (
service('equipment_serverservice')->getEntities(['status' => STATUS['AVAILABLE']]) as $entity
) {
$tempOptions[$entity->getPK()] = $entity->getTitle();
// $options['attributes'][$entity->getPK()] = ['data-role' => implode(DEFAULTS['DELIMITER_ROLE'], $entity->getRole())];
}
$options['options'] = $tempOptions;
break;
case 'serverinfo_uid':
foreach (service('equipment_serverservice')->getEntities() as $entity) {
case 'serviceinfo_uid':
foreach (
service('customer_serviceservice')->getEntities(['status' => STATUS['AVAILABLE']]) as $entity
) {
$tempOptions[$entity->getPK()] = $entity->getTitle();
// $options['attributes'][$entity->getPK()] = ['data-role' => implode(DEFAULTS['DELIMITER_ROLE'], $entity->getRole())];
}

View File

@ -31,21 +31,4 @@ class CSForm extends PartForm
}
return $rule;
}
public function getFormOption(string $field, array $options = ['options' => [], 'extras' => [], 'atttributes' => []]): array
{
$tempOptions = ['' => lang("{$this->getAttribute('class_path')}.label.{$field}") . " 선택"];
switch ($field) {
case 'serverinfo_uid':
foreach (service('equipment_serverservice')->getEntities() as $entity) {
$tempOptions[$entity->getPK()] = $entity->getTitle();
// $options['attributes'][$entity->getPK()] = ['data-role' => implode(DEFAULTS['DELIMITER_ROLE'], $entity->getRole())];
}
$options['options'] = $tempOptions;
break;
default:
$options = parent::getFormOption($field, $options);
break;
}
return $options;
}
}

View File

@ -46,13 +46,6 @@ class IPForm extends PartForm
// dd($tempOptions);
$options['options'] = $tempOptions;
break;
case 'serverinfo_uid':
foreach (service('equipment_serverservice')->getEntities() as $entity) {
$tempOptions[$entity->getPK()] = $entity->getTitle();
// $options['attributes'][$entity->getPK()] = ['data-role' => implode(DEFAULTS['DELIMITER_ROLE'], $entity->getRole())];
}
$options['options'] = $tempOptions;
break;
default:
$options = parent::getFormOption($field, $options);
break;

View File

@ -35,4 +35,28 @@ abstract class PartForm extends CommonForm
}
return $rule;
}
public function getFormOption(string $field, array $options = ['options' => [], 'extras' => [], 'atttributes' => []]): array
{
$tempOptions = ['' => lang("{$this->getAttribute('class_path')}.label.{$field}") . " 선택"];
switch ($field) {
case 'serviceinfo_uid':
foreach (service('customer_serviceservice')->getEntities(['status' => STATUS['AVAILABLE']]) as $entity) {
$tempOptions[$entity->getPK()] = $entity->getTitle();
// $options['attributes'][$entity->getPK()] = ['data-role' => implode(DEFAULTS['DELIMITER_ROLE'], $entity->getRole())];
}
$options['options'] = $tempOptions;
break;
case 'serverinfo_uid':
foreach (service('equipment_serverservice')->getEntities(['status' => STATUS['AVAILABLE']]) as $entity) {
$tempOptions[$entity->getPK()] = $entity->getTitle();
// $options['attributes'][$entity->getPK()] = ['data-role' => implode(DEFAULTS['DELIMITER_ROLE'], $entity->getRole())];
}
$options['options'] = $tempOptions;
break;
default:
$options = parent::getFormOption($field, $options);
break;
}
return $options;
}
}

View File

@ -20,28 +20,4 @@ class SWITCHForm extends PartForm
}
return $rule;
}
public function getFormOption(string $field, array $options = ['options' => [], 'extras' => [], 'atttributes' => []]): array
{
$tempOptions = ['' => lang("{$this->getAttribute('class_path')}.label.{$field}") . " 선택"];
switch ($field) {
case 'serviceinfo_uid':
foreach (service('customer_serviceservice')->getEntities() as $entity) {
$tempOptions[$entity->getPK()] = $entity->getTitle();
// $options['attributes'][$entity->getPK()] = ['data-role' => implode(DEFAULTS['DELIMITER_ROLE'], $entity->getRole())];
}
$options['options'] = $tempOptions;
break;
case 'serverinfo_uid':
foreach (service('equipment_serverservice')->getEntities() as $entity) {
$tempOptions[$entity->getPK()] = $entity->getTitle();
// $options['attributes'][$entity->getPK()] = ['data-role' => implode(DEFAULTS['DELIMITER_ROLE'], $entity->getRole())];
}
$options['options'] = $tempOptions;
break;
default:
$options = parent::getFormOption($field, $options);
break;
}
return $options;
}
}

View File

@ -122,6 +122,7 @@ abstract class CommonHelper
break;
case 'status':
$forms = [];
// dd($viewDatas['formOptions']);
array_shift($viewDatas['formOptions'][$field]['options']);
foreach ($viewDatas['formOptions'][$field]['options'] as $key => $label)
$forms[] = form_radio($field, $key, $key == $value, $extras) . $label;

View File

@ -78,7 +78,7 @@ class ServiceHelper extends CustomerHelper
$label ? $label : ICONS['ONETIME'],
$action,
[
"data-src" => "/admin/customer/payment/create?serviceinfo_uid={$viewDatas['entity']->getPK()}",
"data-src" => "/admin/payment/create?serviceinfo_uid={$viewDatas['entity']->getPK()}",
"data-bs-toggle" => "modal",
"data-bs-target" => "#modal_action_form",
"class" => "btn btn-sm form-label-sm",

View File

@ -11,19 +11,23 @@ class ServerPartHelper extends EquipmentHelper
public function getFieldForm(string $field, mixed $value, array $viewDatas, array $extras = []): string
{
switch ($field) {
case 'billing':
$forms = [];
// dd($viewDatas['formOptions']);
array_shift($viewDatas['formOptions'][$field]['options']);
foreach ($viewDatas['formOptions'][$field]['options'] as $key => $label)
$forms[] = form_radio($field, $key, $key == $value, $extras) . $label;
$form = implode(" ", $forms);
break;
case 'part_uid':
// dd($viewDatas);
$type = array_key_exists('entity', $viewDatas) ? $viewDatas['entity']->getType() : $viewDatas['formDatas']['type'];
$extras['class'] = array_key_exists('class', $extras) ? $extras['class'] . ' select-field' : 'select-field';
$extras['onChange'] = "document.querySelector('input[name=\'title\']').value = this.options[this.selectedIndex].getAttribute('data-title'); document.querySelector('input[name=\'amount\']').value = this.options[this.selectedIndex].getAttribute('data-price')";
// $attributes = ['data-title' => 'title', 'data-price' => 'price'];
$form = form_dropdown($field, $value, $viewDatas, $extras);
break;
case 'extra':
if (array_key_exists('type', $viewDatas['control']['form_datas']) && $viewDatas['control']['form_datas']['type'] === 'DISK') {
$options = ["" => lang("{$viewDatas['class_path']}.label.{$field}") . " 선택", ...lang("{$viewDatas['class_path']}.EXTRA.{$viewDatas['control']['form_datas']['type']}")];
$form = form_dropdown($field, $options, $value, $extras);
} else {
$form = parent::getFieldForm($field, $value, $viewDatas, $extras);;
if (array_key_exists('extras', $viewDatas['formOptions'][$field])) {
$extras = array_merge($extras, $viewDatas['formOptions'][$field]['extras']);
}
$form = form_dropdown($field, $viewDatas['formOptions'][$field]['options'][$type], $value, $extras);
break;
default:
$form = parent::getFieldForm($field, $value, $viewDatas, $extras);

View File

@ -7,7 +7,6 @@ use App\Entities\BoardEntity;
use App\Forms\BoardForm;
use App\Helpers\BoardHelper;
use App\Models\BoardModel;
use RuntimeException;
class BoardService extends CommonService
{
@ -18,6 +17,10 @@ class BoardService extends CommonService
parent::__construct($model);
$this->addClassPaths('Board');
}
protected function getDTOClass(): string
{
return BOARDDTO::class;
}
public function createDTO(array $formDatas): BoardDTO
{
return new BoardDTO($formDatas);
@ -121,24 +124,10 @@ class BoardService extends CommonService
{
return new BoardEntity($formDatas);
}
public function create(object $dto): BoardEntity
{
if (!$dto instanceof BoardDTO) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:" . get_class($dto) . "는 사용할수 없습니다.");
}
return parent::create($dto);
}
protected function modify_process($uid, array $formDatas): BoardEntity
{
return parent::modify_process($uid, $formDatas);
}
public function modify($uid, object $dto): BoardEntity
{
if (!$dto instanceof BoardDTO) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:" . get_class($dto) . "는 사용할수 없습니다.");
}
return parent::modify($uid, $dto);
}
//List 검색용
//FormFilter 조건절 처리
//검색어조건절처리

View File

@ -9,11 +9,16 @@ use CodeIgniter\Database\Exceptions\DatabaseException;
use CodeIgniter\Validation\Exceptions\ValidationException;
use RuntimeException;
/**
* @template TEntity of CommonEntity
* @template TDto of CommonDTO
*/
abstract class CommonService
{
private array $_classPaths = [];
protected $title = null;
protected function __construct(protected CommonModel $model) {}
abstract protected function getDTOClass(): string;
abstract public function createDTO(array $formDatas): CommonDTO;
abstract public function getFormService(): mixed;
abstract public function getHelper(): mixed;
@ -59,7 +64,7 @@ abstract class CommonService
throw new \Exception($errorMessage, $e->getCode(), $e);
}
}
final public function getEntities(mixed $where = null, array $columns = ['*']): array
final public function getEntities(?array $where = null, array $columns = ['*']): array
{
try {
$entities = $this->getEntities_process($where, $columns);
@ -158,8 +163,14 @@ abstract class CommonService
//생성용
abstract protected function create_process(array $formDatas): CommonEntity;
public function create(object $dto): CommonEntity
final public function create(object $dto): CommonEntity
{
//DTO 타입 체크 로직을 일반화
$dtoClass = $this->getDTOClass();
if (!$dto instanceof $dtoClass) {
throw new RuntimeException(__METHOD__ . "에서 오류발생: " . get_class($dto) . "는 사용할 수 없습니다. ({$dtoClass} 필요)");
}
$formDatas = $dto->toArray();
if (!$this->getFormService()->validate($formDatas)) {
throw new ValidationException(implode("\n", service('validation')->getErrors()));
@ -201,8 +212,14 @@ abstract class CommonService
return $entity;
}
public function modify(string|int $uid, object $dto): CommonEntity
final public function modify(string|int $uid, object $dto): CommonEntity
{
//DTO 타입 체크 로직을 일반화
$dtoClass = $this->getDTOClass();
if (!$dto instanceof $dtoClass) {
throw new RuntimeException(__METHOD__ . "에서 오류발생: " . get_class($dto) . "는 사용할 수 없습니다. ({$dtoClass} 필요)");
}
$formDatas = $dto->toArray();
if (!$this->getFormService()->validate($formDatas)) {
throw new ValidationException(implode("\n", service('validation')->getErrors()));
@ -218,8 +235,14 @@ abstract class CommonService
$entity = $this->modify_process($uid, $formDatas);
return $entity;
}
public function batchjob(string|int $uid, object $dto): CommonEntity
final public function batchjob(string|int $uid, object $dto): CommonEntity
{
//DTO 타입 체크 로직을 일반화
$dtoClass = $this->getDTOClass();
if (!$dto instanceof $dtoClass) {
throw new RuntimeException(__METHOD__ . "에서 오류발생: " . get_class($dto) . "는 사용할 수 없습니다. ({$dtoClass} 필요)");
}
$formDatas = $dto->toArray();
if (!$this->getFormService()->validate($formDatas)) {
throw new ValidationException(implode("\n", service('validation')->getErrors()));

View File

@ -18,6 +18,10 @@ class AccountService extends CustomerService
parent::__construct($model);
$this->addClassPaths('Account');
}
protected function getDTOClass(): string
{
return AccountDTO::class;
}
public function createDTO(array $formDatas): AccountDTO
{
return new AccountDTO($formDatas);
@ -101,17 +105,6 @@ class AccountService extends CustomerService
{
return new AccountEntity($formDatas);
}
public function create(object $dto): AccountEntity
{
if (!$dto instanceof AccountDTO) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:" . get_class($dto) . "는 사용할수 없습니다.");
}
$entity = parent::create($dto);
if (!$entity instanceof AccountEntity) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:Return Type은 AccountEntity만 가능");
}
return $entity;
}
protected function modify_process($uid, array $formDatas): AccountEntity
{
$entity = parent::modify_process($uid, $formDatas);
@ -120,17 +113,6 @@ class AccountService extends CustomerService
}
return $entity;
}
public function modify($uid, object $dto): AccountEntity
{
if (!$dto instanceof AccountDTO) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:" . get_class($dto) . "는 사용할수 없습니다.");
}
$entity = parent::modify($uid, $dto);
if (!$entity instanceof AccountEntity) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:Return Type은 AccountEntity만 가능");
}
return $entity;
}
//List 검색용
//FormFilter 조건절 처리
//검색어조건절처리

View File

@ -18,6 +18,10 @@ class ClientService extends CustomerService
parent::__construct($model);
$this->addClassPaths('Client');
}
protected function getDTOClass(): string
{
return ClientDTO::class;
}
public function createDTO(array $formDatas): ClientDTO
{
return new ClientDTO($formDatas);
@ -110,17 +114,6 @@ class ClientService extends CustomerService
{
return new ClientEntity($formDatas);
}
public function create(object $dto): ClientEntity
{
if (!$dto instanceof ClientDTO) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:" . get_class($dto) . "는 사용할수 없습니다.");
}
$entity = parent::create($dto);
if (!$entity instanceof ClientEntity) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:Return Type은 ClientEntity만 가능");
}
return $entity;
}
protected function modify_process($uid, array $formDatas): ClientEntity
{
$entity = parent::modify_process($uid, $formDatas);
@ -129,17 +122,6 @@ class ClientService extends CustomerService
}
return $entity;
}
public function modify($uid, object $dto): ClientEntity
{
if (!$dto instanceof ClientDTO) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:" . get_class($dto) . "는 사용할수 없습니다.");
}
$entity = parent::modify($uid, $dto);
if (!$entity instanceof ClientEntity) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:Return Type은 ClientEntity만 가능");
}
return $entity;
}
//List 검색용
//FormFilter 조건절 처리
//검색어조건절처리

View File

@ -18,6 +18,10 @@ class CouponService extends CustomerService
parent::__construct($model);
$this->addClassPaths('Coupon');
}
protected function getDTOClass(): string
{
return CouponDTO::class;
}
public function createDTO(array $formDatas): CouponDTO
{
return new CouponDTO($formDatas);
@ -95,17 +99,6 @@ class CouponService extends CustomerService
{
return new CouponEntity($formDatas);
}
public function create(object $dto): CouponEntity
{
if (!$dto instanceof CouponDTO) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:" . get_class($dto) . "는 사용할수 없습니다.");
}
$entity = parent::create($dto);
if (!$entity instanceof CouponEntity) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:Return Type은 CouponEntity만 가능");
}
return $entity;
}
protected function modify_process($uid, array $formDatas): CouponEntity
{
$entity = parent::modify_process($uid, $formDatas);
@ -114,17 +107,6 @@ class CouponService extends CustomerService
}
return $entity;
}
public function modify($uid, object $dto): CouponEntity
{
if (!$dto instanceof CouponDTO) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:" . get_class($dto) . "는 사용할수 없습니다.");
}
$entity = parent::modify($uid, $dto);
if (!$entity instanceof CouponEntity) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:Return Type은 CouponEntity만 가능");
}
return $entity;
}
//List 검색용
//FormFilter 조건절 처리
//검색어조건절처리

View File

@ -18,6 +18,10 @@ class PointService extends CustomerService
parent::__construct($model);
$this->addClassPaths('Point');
}
protected function getDTOClass(): string
{
return PointDTO::class;
}
public function createDTO(array $formDatas): PointDTO
{
return new PointDTO($formDatas);
@ -95,17 +99,6 @@ class PointService extends CustomerService
{
return new PointEntity($formDatas);
}
public function create(object $dto): PointEntity
{
if (!$dto instanceof PointDTO) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:" . get_class($dto) . "는 사용할수 없습니다.");
}
$entity = parent::create($dto);
if (!$entity instanceof PointEntity) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:Return Type은 PointEntity만 가능");
}
return $entity;
}
protected function modify_process($uid, array $formDatas): PointEntity
{
$entity = parent::modify_process($uid, $formDatas);
@ -114,17 +107,6 @@ class PointService extends CustomerService
}
return $entity;
}
public function modify($uid, object $dto): PointEntity
{
if (!$dto instanceof PointDTO) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:" . get_class($dto) . "는 사용할수 없습니다.");
}
$entity = parent::modify($uid, $dto);
if (!$entity instanceof PointEntity) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:Return Type은 PointEntity만 가능");
}
return $entity;
}
//List 검색용
//FormFilter 조건절 처리
//검색어조건절처리

View File

@ -20,6 +20,10 @@ class ServiceService extends CustomerService
parent::__construct($model);
$this->addClassPaths('Service');
}
protected function getDTOClass(): string
{
return ServiceDTO::class;
}
public function createDTO(array $formDatas): ServiceDTO
{
return new ServiceDTO($formDatas);
@ -125,17 +129,6 @@ class ServiceService extends CustomerService
{
return new ServiceEntity($formDatas);
}
public function create(object $dto): ServiceEntity
{
if (!$dto instanceof ServiceDTO) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:" . get_class($dto) . "는 사용할수 없습니다.");
}
$entity = parent::create($dto);
if (!$entity instanceof ServiceEntity) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:Return Type은 ServiceEntity만 가능");
}
return $entity;
}
protected function modify_process($uid, array $formDatas): ServiceEntity
{
$entity = parent::modify_process($uid, $formDatas);
@ -144,25 +137,14 @@ class ServiceService extends CustomerService
}
return $entity;
}
public function modify($uid, object $dto): ServiceEntity
{
if (!$dto instanceof ServiceDTO) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:" . get_class($dto) . "는 사용할수 없습니다.");
}
$entity = parent::modify($uid, $dto);
if (!$entity instanceof ServiceEntity) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:Return Type은 ServiceEntity만 가능");
}
return $entity;
}
//List 검색용
//FormFilter 조건절 처리
//검색어조건절처리
//추가 기능
//interval을 기준으로 최근 신규 서비스정보 가져오기
final public function getNewServiceEntities(int $interval, string $status = ServiceEntity::DEFAULT_STATUS): array
final public function getNewServiceEntities(int $interval, string $status = STATUS['AVAILABLE']): array
{
return $this->getEntities(sprintf("start_at >= NOW()-INTERVAL {$interval} DAY AND status = '%s'", $status));
return $this->getEntities(["start_at >= NOW()-INTERVAL {$interval} DAY" => null, "status" => $status]);
}
//서비스별 총 금액
final public function getTotalAmounts($where = []): array

View File

@ -18,6 +18,10 @@ class LineService extends EquipmentService
parent::__construct($model);
$this->addClassPaths('Line');
}
protected function getDTOClass(): string
{
return LineDTO::class;
}
public function createDTO(array $formDatas): LineDTO
{
return new LineDTO($formDatas);
@ -96,17 +100,6 @@ class LineService extends EquipmentService
{
return new LineEntity($formDatas);
}
public function create(object $dto): LineEntity
{
if (!$dto instanceof LineDTO) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:" . get_class($dto) . "는 사용할수 없습니다.");
}
$entity = parent::create($dto);
if (!$entity instanceof LineEntity) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:Return Type은 LineEntity만 가능");
}
return $entity;
}
protected function modify_process($uid, array $formDatas): LineEntity
{
$entity = parent::modify_process($uid, $formDatas);
@ -115,17 +108,6 @@ class LineService extends EquipmentService
}
return $entity;
}
public function modify($uid, object $dto): LineEntity
{
if (!$dto instanceof LineDTO) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:" . get_class($dto) . "는 사용할수 없습니다.");
}
$entity = parent::modify($uid, $dto);
if (!$entity instanceof LineEntity) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:Return Type은 LineEntity만 가능");
}
return $entity;
}
//List 검색용
//FormFilter 조건절 처리
//검색어조건절처리

View File

@ -3,10 +3,12 @@
namespace App\Services\Equipment;
use App\DTOs\Equipment\ServerPartDTO;
use App\DTOs\UserDTO;
use App\Entities\Equipment\ServerPartEntity;
use App\Forms\Equipment\ServerPartForm;
use App\Helpers\Equipment\ServerPartHelper;
use App\Models\Equipment\ServerPartModel;
use App\Services\CommonService;
use RuntimeException;
class ServerPartService extends EquipmentService
@ -18,6 +20,10 @@ class ServerPartService extends EquipmentService
parent::__construct($model);
$this->addClassPaths('ServerPart');
}
protected function getDTOClass(): string
{
return ServerPartDTO::class;
}
public function createDTO(array $formDatas): ServerPartDTO
{
return new ServerPartDTO($formDatas);
@ -57,7 +63,6 @@ class ServerPartService extends EquipmentService
"type",
"billing",
"part_uid",
"title",
"cnt",
"extra",
"amount",
@ -68,21 +73,24 @@ class ServerPartService extends EquipmentService
"part_uid",
"billing",
];
$indexFilter = $filters;
$indexFilter = [
"serverinfo_uid",
"type",
"billing",
];
$batchjobFilters = ['billing', 'type'];
switch ($action) {
case 'create':
case 'create_form':
case 'modify':
case 'modify_form':
$fields = [...$fields, 'status'];
break;
case 'view':
$fields = [...$fields, 'status', 'created_at'];
$fields = [...$fields, 'created_at'];
break;
case 'index':
case 'download':
$fields = [...$fields, 'status', 'created_at'];
$fields = [...$fields, 'created_at'];
break;
}
$this->getFormService()->setFormFields($fields);
@ -93,44 +101,38 @@ class ServerPartService extends EquipmentService
$this->getFormService()->setBatchjobFilters($batchjobFilters);
}
//기본 기능부분
private function getPartService(string $type): CommonService
{
return service('part_' . strtolower($type) . 'service');
}
protected function getEntity_process(mixed $entity): ServerPartEntity
{
return $entity;
}
protected function create_process(array $formDatas): ServerPartEntity
{
if (!array_key_exists('title', $formDatas)) {
if (!array_key_exists('type', $formDatas)) {
throw new \Exception(__METHOD__ . "에서 오류발생:부품형식이 지정되지 않았습니다.");
}
$formDatas['title'] = $this->getPartService($formDatas['type']->getTitle());
}
return new ServerPartEntity($formDatas);
}
public function create(object $dto): ServerPartEntity
{
if (!$dto instanceof ServerPartDTO) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:" . get_class($dto) . "는 사용할수 없습니다.");
}
$entity = parent::create($dto);
if (!$entity instanceof ServerPartEntity) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:Return Type은 ServerPartEntity만 가능");
}
return $entity;
}
protected function modify_process($uid, array $formDatas): ServerPartEntity
{
if (!array_key_exists('title', $formDatas)) {
if (!array_key_exists('type', $formDatas)) {
throw new \Exception(__METHOD__ . "에서 오류발생:부품형식이 지정되지 않았습니다.");
}
$formDatas['title'] = $this->getPartService($formDatas['type']->getTitle());
}
$entity = parent::modify_process($uid, $formDatas);
if (!$entity instanceof ServerPartEntity) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:Return Type은 ServerPartEntity만 가능");
}
return $entity;
}
public function modify($uid, object $dto): ServerPartEntity
{
if (!$dto instanceof ServerPartDTO) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:" . get_class($dto) . "는 사용할수 없습니다.");
}
$entity = parent::modify($uid, $dto);
if (!$entity instanceof ServerPartEntity) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:Return Type은 ServerPartEntity만 가능");
}
return $entity;
}
//List 검색용
//FormFilter 조건절 처리
//검색어조건절처리

View File

@ -18,6 +18,10 @@ class ServerService extends EquipmentService
parent::__construct($model);
$this->addClassPaths('Server');
}
protected function getDTOClass(): string
{
return ServerDTO::class;
}
public function createDTO(array $formDatas): ServerDTO
{
return new ServerDTO($formDatas);
@ -103,17 +107,6 @@ class ServerService extends EquipmentService
{
return new ServerEntity($formDatas);
}
public function create(object $dto): ServerEntity
{
if (!$dto instanceof ServerDTO) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:" . get_class($dto) . "는 사용할수 없습니다.");
}
$entity = parent::create($dto);
if (!$entity instanceof ServerEntity) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:Return Type은 ServerEntity만 가능");
}
return $entity;
}
protected function modify_process($uid, array $formDatas): ServerEntity
{
$entity = parent::modify_process($uid, $formDatas);
@ -122,17 +115,6 @@ class ServerService extends EquipmentService
}
return $entity;
}
public function modify($uid, object $dto): ServerEntity
{
if (!$dto instanceof ServerDTO) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:" . get_class($dto) . "는 사용할수 없습니다.");
}
$entity = parent::modify($uid, $dto);
if (!$entity instanceof ServerEntity) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:Return Type은 ServerEntity만 가능");
}
return $entity;
}
//List 검색용
//FormFilter 조건절 처리
//검색어조건절처리

View File

@ -20,6 +20,10 @@ class MylogService extends CommonService implements PipelineStepInterface
parent::__construct($model);
$this->addClassPaths('Mylog');
}
protected function getDTOClass(): string
{
return MylogDTO::class;
}
public function createDTO(array $formDatas): MylogDTO
{
return new MylogDTO($formDatas);
@ -111,22 +115,8 @@ class MylogService extends CommonService implements PipelineStepInterface
{
return new MylogEntity($formDatas);
}
public function create(object $dto): MylogEntity
{
if (!$dto instanceof MylogDTO) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:" . get_class($dto) . "는 사용할수 없습니다.");
}
return parent::create($dto);
}
protected function modify_process($uid, array $formDatas): MyLogEntity
{
return parent::modify_process($uid, $formDatas);
}
public function modify($uid, object $dto): MyLogEntity
{
if (!$dto instanceof MylogDTO) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:" . get_class($dto) . "는 사용할수 없습니다.");
}
return parent::modify($uid, $dto);
}
}

View File

@ -18,6 +18,10 @@ class CPUService extends PartService
parent::__construct($model);
$this->addClassPaths('CPU');
}
protected function getDTOClass(): string
{
return CPUDTO::class;
}
public function createDTO(array $formDatas): CPUDTO
{
return new CPUDTO($formDatas);
@ -93,17 +97,6 @@ class CPUService extends PartService
{
return new CPUEntity($formDatas);
}
public function create(object $dto): CPUEntity
{
if (!$dto instanceof CPUDTO) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:" . get_class($dto) . "는 사용할수 없습니다.");
}
$entity = parent::create($dto);
if (!$entity instanceof CPUEntity) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:Return Type은 CPUEntity만 가능");
}
return $entity;
}
protected function modify_process($uid, array $formDatas): CPUEntity
{
$entity = parent::modify_process($uid, $formDatas);
@ -112,17 +105,6 @@ class CPUService extends PartService
}
return $entity;
}
public function modify($uid, object $dto): CPUEntity
{
if (!$dto instanceof CPUDTO) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:" . get_class($dto) . "는 사용할수 없습니다.");
}
$entity = parent::modify($uid, $dto);
if (!$entity instanceof CPUEntity) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:Return Type은 CPUEntity만 가능");
}
return $entity;
}
//List 검색용
//FormFilter 조건절 처리
//검색어조건절처리

View File

@ -18,6 +18,10 @@ class CSService extends PartService
parent::__construct($model);
$this->addClassPaths('CS');
}
protected function getDTOClass(): string
{
return CSDTO::class;
}
public function createDTO(array $formDatas): CSDTO
{
return new CSDTO($formDatas);
@ -120,17 +124,6 @@ class CSService extends PartService
{
return new CSEntity($formDatas);
}
public function create(object $dto): CSEntity
{
if (!$dto instanceof CSDTO) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:" . get_class($dto) . "는 사용할수 없습니다.");
}
$entity = parent::create($dto);
if (!$entity instanceof CSEntity) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:Return Type은 CSEntity만 가능");
}
return $entity;
}
protected function modify_process($uid, array $formDatas): CSEntity
{
$entity = parent::modify_process($uid, $formDatas);
@ -139,18 +132,13 @@ class CSService extends PartService
}
return $entity;
}
public function modify($uid, object $dto): CSEntity
{
if (!$dto instanceof CSDTO) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:" . get_class($dto) . "는 사용할수 없습니다.");
}
$entity = parent::modify($uid, $dto);
if (!$entity instanceof CSEntity) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:Return Type은 CSEntity만 가능");
}
return $entity;
}
//List 검색용
//FormFilter 조건절 처리
//검색어조건절처리
//OrderBy 처리(INET_ATON() 함수를 사용)
public function setOrderBy(mixed $field = null, mixed $value = null): void
{
$this->model->orderBy("INET_ATON(ip) ASC");
parent::setOrderBy($field, $value);
}
}

View File

@ -18,6 +18,10 @@ class DISKService extends PartService
parent::__construct($model);
$this->addClassPaths('DISK');
}
protected function getDTOClass(): string
{
return DISKDTO::class;
}
public function createDTO(array $formDatas): DISKDTO
{
return new DISKDTO($formDatas);
@ -95,17 +99,6 @@ class DISKService extends PartService
{
return new DISKEntity($formDatas);
}
public function create(object $dto): DISKEntity
{
if (!$dto instanceof DISKDTO) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:" . get_class($dto) . "는 사용할수 없습니다.");
}
$entity = parent::create($dto);
if (!$entity instanceof DISKEntity) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:Return Type은 DISKEntity만 가능");
}
return $entity;
}
protected function modify_process($uid, array $formDatas): DISKEntity
{
$entity = parent::modify_process($uid, $formDatas);
@ -114,17 +107,6 @@ class DISKService extends PartService
}
return $entity;
}
public function modify($uid, object $dto): DISKEntity
{
if (!$dto instanceof DISKDTO) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:" . get_class($dto) . "는 사용할수 없습니다.");
}
$entity = parent::modify($uid, $dto);
if (!$entity instanceof DISKEntity) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:Return Type은 DISKEntity만 가능");
}
return $entity;
}
//List 검색용
//FormFilter 조건절 처리
//검색어조건절처리

View File

@ -18,6 +18,10 @@ class IPService extends PartService
parent::__construct($model);
$this->addClassPaths('IP');
}
protected function getDTOClass(): string
{
return IPDTO::class;
}
public function createDTO(array $formDatas): IPDTO
{
return new IPDTO($formDatas);
@ -111,17 +115,6 @@ class IPService extends PartService
{
return new IPEntity($formDatas);
}
public function create(object $dto): IPEntity
{
if (!$dto instanceof IPDTO) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:" . get_class($dto) . "는 사용할수 없습니다.");
}
$entity = parent::create($dto);
if (!$entity instanceof IPEntity) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:Return Type은 IPEntity만 가능");
}
return $entity;
}
protected function modify_process($uid, array $formDatas): IPEntity
{
$entity = parent::modify_process($uid, $formDatas);
@ -130,18 +123,13 @@ class IPService extends PartService
}
return $entity;
}
public function modify($uid, object $dto): IPEntity
{
if (!$dto instanceof IPDTO) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:" . get_class($dto) . "는 사용할수 없습니다.");
}
$entity = parent::modify($uid, $dto);
if (!$entity instanceof IPEntity) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:Return Type은 IPEntity만 가능");
}
return $entity;
}
//List 검색용
//FormFilter 조건절 처리
//검색어조건절처리
//OrderBy 처리(INET_ATON() 함수를 사용)
public function setOrderBy(mixed $field = null, mixed $value = null): void
{
$this->model->orderBy("INET_ATON(ip) ASC");
parent::setOrderBy($field, $value);
}
}

View File

@ -18,6 +18,10 @@ class RAMService extends PartService
parent::__construct($model);
$this->addClassPaths('RAM');
}
protected function getDTOClass(): string
{
return RAMDTO::class;
}
public function createDTO(array $formDatas): RAMDTO
{
return new RAMDTO($formDatas);
@ -93,17 +97,6 @@ class RAMService extends PartService
{
return new RAMEntity($formDatas);
}
public function create(object $dto): RAMEntity
{
if (!$dto instanceof RAMDTO) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:" . get_class($dto) . "는 사용할수 없습니다.");
}
$entity = parent::create($dto);
if (!$entity instanceof RAMEntity) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:Return Type은 RAMEntity만 가능");
}
return $entity;
}
protected function modify_process($uid, array $formDatas): RAMEntity
{
$entity = parent::modify_process($uid, $formDatas);
@ -112,17 +105,6 @@ class RAMService extends PartService
}
return $entity;
}
public function modify($uid, object $dto): RAMEntity
{
if (!$dto instanceof RAMDTO) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:" . get_class($dto) . "는 사용할수 없습니다.");
}
$entity = parent::modify($uid, $dto);
if (!$entity instanceof RAMEntity) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:Return Type은 RAMEntity만 가능");
}
return $entity;
}
//List 검색용
//FormFilter 조건절 처리
//검색어조건절처리

View File

@ -18,6 +18,10 @@ class SOFTWAREService extends PartService
parent::__construct($model);
$this->addClassPaths('SOFTWARE');
}
protected function getDTOClass(): string
{
return SOFTWAREDTO::class;
}
public function createDTO(array $formDatas): SOFTWAREDTO
{
return new SOFTWAREDTO($formDatas);
@ -93,17 +97,6 @@ class SOFTWAREService extends PartService
{
return new SOFTWAREEntity($formDatas);
}
public function create(object $dto): SOFTWAREEntity
{
if (!$dto instanceof SOFTWAREDTO) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:" . get_class($dto) . "는 사용할수 없습니다.");
}
$entity = parent::create($dto);
if (!$entity instanceof SOFTWAREEntity) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:Return Type은 SOFTWAREEntity만 가능");
}
return $entity;
}
protected function modify_process($uid, array $formDatas): SOFTWAREEntity
{
$entity = parent::modify_process($uid, $formDatas);
@ -112,17 +105,6 @@ class SOFTWAREService extends PartService
}
return $entity;
}
public function modify($uid, object $dto): SOFTWAREEntity
{
if (!$dto instanceof SOFTWAREDTO) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:" . get_class($dto) . "는 사용할수 없습니다.");
}
$entity = parent::modify($uid, $dto);
if (!$entity instanceof SOFTWAREEntity) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:Return Type은 SOFTWAREEntity만 가능");
}
return $entity;
}
//List 검색용
//FormFilter 조건절 처리
//검색어조건절처리

View File

@ -18,6 +18,10 @@ class SWITCHService extends PartService
parent::__construct($model);
$this->addClassPaths('SWITCH');
}
protected function getDTOClass(): string
{
return SWITCHDTO::class;
}
public function createDTO(array $formDatas): SWITCHDTO
{
return new SWITCHDTO($formDatas);
@ -112,17 +116,6 @@ class SWITCHService extends PartService
{
return new SWITCHEntity($formDatas);
}
public function create(object $dto): SWITCHEntity
{
if (!$dto instanceof SWITCHDTO) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:" . get_class($dto) . "는 사용할수 없습니다.");
}
$entity = parent::create($dto);
if (!$entity instanceof SWITCHEntity) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:Return Type은 SWITCHEntity만 가능");
}
return $entity;
}
protected function modify_process($uid, array $formDatas): SWITCHEntity
{
$entity = parent::modify_process($uid, $formDatas);
@ -131,17 +124,6 @@ class SWITCHService extends PartService
}
return $entity;
}
public function modify($uid, object $dto): SWITCHEntity
{
if (!$dto instanceof SWITCHDTO) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:" . get_class($dto) . "는 사용할수 없습니다.");
}
$entity = parent::modify($uid, $dto);
if (!$entity instanceof SWITCHEntity) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:Return Type은 SWITCHEntity만 가능");
}
return $entity;
}
//List 검색용
//FormFilter 조건절 처리
//검색어조건절처리

View File

@ -18,6 +18,10 @@ class PaymentService extends CommonService
parent::__construct($model);
$this->addClassPaths('Payment');
}
protected function getDTOClass(): string
{
return PaymentDTO::class;
}
public function createDTO(array $formDatas): PaymentDTO
{
return new PaymentDTO($formDatas);
@ -61,7 +65,7 @@ class PaymentService extends CommonService
"content",
];
$filters = ['user_uid', 'clientinfo_uid', 'serviceinfo_uid', 'status', 'billing', 'pay'];
$indexFilter = ['serviceinfo_uid', 'status', 'billing'];
$indexFilter = ['clientinfo_uid', 'serviceinfo_uid', 'status', 'billing'];
$batchjobFilters = ['status'];
switch ($action) {
case 'create':
@ -129,34 +133,12 @@ class PaymentService extends CommonService
}
protected function create_process(array $formDatas): PaymentEntity
{
//confirmpassword 필드는 Entity에 필요없으므로 제거
if (isset($formDatas['confirmpassword'])) {
unset($formDatas['confirmpassword']);
}
return new PaymentEntity($formDatas);
}
public function create(object $dto): PaymentEntity
{
if (!$dto instanceof PaymentDTO) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:" . get_class($dto) . "는 사용할수 없습니다.");
}
return parent::create($dto);
}
protected function modify_process($uid, array $formDatas): PaymentEntity
{
//confirmpassword 필드는 Entity에 필요없으므로 제거
if (isset($formDatas['confirmpassword'])) {
unset($formDatas['confirmpassword']);
}
return parent::modify_process($uid, $formDatas);
}
public function modify($uid, object $dto): PaymentEntity
{
if (!$dto instanceof PaymentDTO) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:" . get_class($dto) . "는 사용할수 없습니다.");
}
return parent::modify($uid, $dto);
}
//List 검색용
//FormFilter 조건절 처리
public function setFilter(string $field, mixed $filter_value): void

View File

@ -18,6 +18,10 @@ class UserService extends CommonService
parent::__construct($model);
$this->addClassPaths('User');
}
protected function getDTOClass(): string
{
return UserDTO::class;
}
public function createDTO(array $formDatas): UserDTO
{
return new UserDTO($formDatas);
@ -100,13 +104,6 @@ class UserService extends CommonService
}
return new UserEntity($formDatas);
}
public function create(object $dto): UserEntity
{
if (!$dto instanceof UserDTO) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:" . get_class($dto) . "는 사용할수 없습니다.");
}
return parent::create($dto);
}
protected function modify_process($uid, array $formDatas): UserEntity
{
//confirmpassword 필드는 Entity에 필요없으므로 제거
@ -115,13 +112,6 @@ class UserService extends CommonService
}
return parent::modify_process($uid, $formDatas);
}
public function modify($uid, object $dto): UserEntity
{
if (!$dto instanceof UserDTO) {
throw new RuntimeException(__METHOD__ . "에서 오류발생:" . get_class($dto) . "는 사용할수 없습니다.");
}
return parent::modify($uid, $dto);
}
//List 검색용
//FormFilter 조건절 처리
public function setFilter(string $field, mixed $filter_value): void

View File

@ -38,7 +38,7 @@
"[청구서발행]",
'payment_invoice',
[
"data-src" => "/admin/customer/payment?clientinfo_uid=" . $viewDatas['entity']->getPK() . "&ActionTemplate=popup",
"data-src" => "/admin/payment?clientinfo_uid=" . $viewDatas['entity']->getPK() . "&ActionTemplate=popup",
"data-bs-toggle" => "modal",
"data-bs-target" => "#modal_action_form",
"class" => "text-primary form-label-sm",
@ -97,7 +97,7 @@
sprintf("총:%s건/%s원", $viewDatas['unPaids'][$viewDatas['entity']->getPK()]['cnt'], number_format($viewDatas['unPaids'][$viewDatas['entity']->getPK()]['amount'])),
'payment_unpaid',
[
"data-src" => "/admin/customer/payment?clientinfo_uid={$viewDatas['entity']->getPK()}&status=unpaid&ActionTemplate=popup",
"data-src" => "/admin/payment?clientinfo_uid={$viewDatas['entity']->getPK()}&status=unpaid&ActionTemplate=popup",
"data-bs-toggle" => "modal",
"data-bs-target" => "#modal_action_form",
"class" => "text-primary form-label-sm",