diff --git a/app/Database/dbmsv2.vuerd.json b/app/Database/dbmsv2.vuerd.json index 572aff9..143d3f7 100644 --- a/app/Database/dbmsv2.vuerd.json +++ b/app/Database/dbmsv2.vuerd.json @@ -4,8 +4,8 @@ "settings": { "width": 3000, "height": 3000, - "scrollTop": 0, - "scrollLeft": -690, + "scrollTop": -1180, + "scrollLeft": -205, "zoomLevel": 1, "show": 511, "database": 4, @@ -147,9 +147,9 @@ "n61V7aSxLmcIeQqsYgAEE", "5hP5ZiQGWDGf4HJrOiFb6", "XPpipgVUsGKsXCW5YNg1X", + "eg4YJaXvxIwKhydn4tKEC", "fMx3gLKi1fsfp7g26-QA9", "xEoc72X0ErdGKU7rMzenm", - "eg4YJaXvxIwKhydn4tKEC", "zFbEbi2-nyWp4zEvOHsUG", "02r_3OPPiD_vAgD7rmZK4", "Vb_CyMe0qvi7oxda4dUVW", @@ -172,7 +172,7 @@ "color": "" }, "meta": { - "updateAt": 1755592426935, + "updateAt": 1755596145096, "createAt": 1745819764137 } }, diff --git a/app/Language/en/Equipment/Server.php b/app/Language/en/Equipment/Server.php index f64dd7c..1de3317 100644 --- a/app/Language/en/Equipment/Server.php +++ b/app/Language/en/Equipment/Server.php @@ -8,7 +8,7 @@ return [ 'type' => "장비종류", 'title' => "장비명", 'price' => "기본금액", - 'amount' => "서비스금액", + 'total_price' => "최종금액", 'manufactur_at' => "입고일", 'format_at' => "포맷보유", 'status' => "상태", diff --git a/app/Libraries/DBMigration/Process/SwitchCodeProcess.php b/app/Libraries/DBMigration/Process/SwitchCodeProcess.php index 8046654..20f0654 100644 --- a/app/Libraries/DBMigration/Process/SwitchCodeProcess.php +++ b/app/Libraries/DBMigration/Process/SwitchCodeProcess.php @@ -2,6 +2,7 @@ namespace App\Libraries\DBMigration\Process; +use App\Entities\Equipment\SwitchEntity; use CodeIgniter\Database\BaseConnection; class SwitchCodeProcess implements MigrationProcessInterface @@ -13,9 +14,13 @@ class SwitchCodeProcess implements MigrationProcessInterface } public function process(array $row, int $cnt): void { + if (empty($row['service_sw']) || strlen($row['service_sw']) <= 4 || $row['service_sw'] === '1회성 장비') { + echo "{$cnt} -> SKIP SWITCHCODE\n"; + return; + } $temps = []; $temps['code'] = trim($row['service_sw']); - $temps['status'] = 'default'; + $temps['status'] = SwitchEntity::DEFAULT_STATUS; // Assuming SwitchEntity has a STATUS_DEFAULT constant if (!$this->db->table('switchinfo')->insert($temps)) { throw new \Exception($this->db->error()['message']); } diff --git a/app/Services/Customer/CustomerService.php b/app/Services/Customer/CustomerService.php index 41a1a81..1422bf6 100644 --- a/app/Services/Customer/CustomerService.php +++ b/app/Services/Customer/CustomerService.php @@ -6,14 +6,6 @@ use App\Entities\Customer\ClientEntity; use App\Services\CommonService; use App\Services\Customer\ClientService; -use App\Services\Equipment\Part\CpuService; -use App\Services\Equipment\Part\DefenceService; -use App\Services\Equipment\Part\DomainService; -use App\Services\Equipment\Part\IpService; -use App\Services\Equipment\Part\LineService; -use App\Services\Equipment\Part\RamService; -use App\Services\Equipment\Part\SoftwareService; -use App\Services\Equipment\Part\StorageService; use App\Services\Equipment\ServerService; use App\Services\UserService; use CodeIgniter\Model; @@ -63,14 +55,17 @@ abstract class CustomerService extends CommonService public function getFormFieldOption(string $field, array $options = []): array { switch ($field) { + case 'user_uid': + $options = $this->getUserService()->getEntities(); + break; case 'clientinfo_code': $options = $this->getClientService()->getEntities(); break; case 'serviceinfo_code': $options = $this->getServiceService()->getEntities(); break; - case 'user_uid': - $options = $this->getUserService()->getEntities(); + case 'serverinfo_code': + $options = $this->getServerService()->getEntities(); break; default: $options = parent::getFormFieldOption($field, $options); @@ -83,7 +78,7 @@ abstract class CustomerService extends CommonService { $entity = $this->getClientService()->getEntity($uid); if (!$entity) { - throw new \Exception("{$uid}에 해당하는 고객/관리자 정보가 존재하지 않습니다. uid: {$uid}"); + throw new \Exception("{$uid}에 해당하는 고객정보가 존재하지 않습니다. uid: {$uid}"); } return $entity; } diff --git a/app/Services/Customer/ServiceService.php b/app/Services/Customer/ServiceService.php index 5ef0943..4067835 100644 --- a/app/Services/Customer/ServiceService.php +++ b/app/Services/Customer/ServiceService.php @@ -63,24 +63,6 @@ class ServiceService extends CustomerService // } //기본 기능부분 //FieldForm관련용 - public function getFormFieldOption(string $field, array $options = []): array - { - switch ($field) { - case 'user_uid': - $options = $this->getUserService()->getEntities(); - break; - case 'clientinfo_code': - $options = $this->getClientService()->getEntities(); - break; - case 'serverinfo_code': - $options = $this->getServerService()->getEntities(['status' => ServerEntity::DEFAULT_STATUS]); - break; - default: - $options = parent::getFormFieldOption($field, $options); - break; - } - return $options; - } //interval을 기준으로 최근 신규 서비스정보 가져오기 final public function getEntitiesByNewService(int $interval, string $status = ServiceEntity::DEFAULT_STATUS): array { diff --git a/app/Services/Equipment/EquipmentService.php b/app/Services/Equipment/EquipmentService.php index 8757c6a..e995a2e 100644 --- a/app/Services/Equipment/EquipmentService.php +++ b/app/Services/Equipment/EquipmentService.php @@ -3,20 +3,25 @@ namespace App\Services\Equipment; use App\Services\CommonService; + use App\Services\Customer\ClientService; +use App\Services\Customer\ServiceService; +use App\Entities\Customer\ClientEntity; use App\Services\Equipment\ServerService; +use App\Services\UserService; use CodeIgniter\Model; abstract class EquipmentService extends CommonService { + private ?UserService $_userService = null; private ?ClientService $_clientService = null; private ?ServerService $_serverService = null; + private $_equipmentService = []; protected function __construct(Model $model) { parent::__construct($model); $this->addClassName('Equipment'); } - final public function getClientService(): ClientService { if (!$this->_clientService) { @@ -24,6 +29,20 @@ abstract class EquipmentService extends CommonService } return $this->_clientService; } + final public function getUSerService(): UserService + { + if (!$this->_userService) { + $this->_userService = new UserService(); + } + return $this->_userService; + } + final public function getServiceService(): ServiceService + { + if (!$this->_serviceService) { + $this->_serviceService = new ServiceService(); + } + return $this->_serviceService; + } final public function getServerService(): ServerService { if (!$this->_serverService) { @@ -31,17 +50,37 @@ abstract class EquipmentService extends CommonService } return $this->_serverService; } + //ServiceItemController,ServiceController에서 사용 + //기본기능 //FieldForm관련용 public function getFormFieldOption(string $field, array $options = []): array { switch ($field) { + case 'user_uid': + $options = $this->getUserService()->getEntities(); + break; case 'clientinfo_code': $options = $this->getClientService()->getEntities(); break; + case 'serviceinfo_code': + $options = $this->getServiceService()->getEntities(); + break; + case 'serverinfo_code': + $options = $this->getServerService()->getEntities(); + break; default: $options = parent::getFormFieldOption($field, $options); break; } return $options; } + //ItemType에 따른 FilterOption 설정용 + final public function getClient(int $uid): ClientEntity + { + $entity = $this->getClientService()->getEntity($uid); + if (!$entity) { + throw new \Exception("{$uid}에 해당하는 고객정보가 존재하지 않습니다. uid: {$uid}"); + } + return $entity; + } } diff --git a/app/Services/Equipment/ServerService.php b/app/Services/Equipment/ServerService.php index 2b64909..fbf2337 100644 --- a/app/Services/Equipment/ServerService.php +++ b/app/Services/Equipment/ServerService.php @@ -22,7 +22,7 @@ class ServerService extends EquipmentService "type", "title", "price", - "amount", + "total_price", "manufactur_at", "format_at", "status", @@ -38,8 +38,10 @@ class ServerService extends EquipmentService } public function getIndexFields(): array { - return ['clientinfo_code', 'serviceinfo_code', "type", 'title', 'price', 'amount', 'manufactur_at', "format_at", 'status']; + return ['clientinfo_code', 'serviceinfo_code', "type", 'title', 'price', 'total_price', 'manufactur_at', "format_at", 'status']; } + //기본 기능부분 + //FieldForm관련용 //List 검색용 //OrderBy 처리 public function setOrderBy(mixed $field = null, mixed $value = null): void