diff --git a/app/Database/dbmsv3_test1.sql b/app/Database/dbmsv3_test1.sql index e016236..38834c6 100644 --- a/app/Database/dbmsv3_test1.sql +++ b/app/Database/dbmsv3_test1.sql @@ -190,7 +190,7 @@ CREATE TABLE `cpuinfo` ( LOCK TABLES `cpuinfo` WRITE; /*!40000 ALTER TABLE `cpuinfo` DISABLE KEYS */; -INSERT INTO `cpuinfo` VALUES (1,'Xeon E5530 2.4Ghz 4Core',50000,0,99,'available','2025-10-13 08:00:10','2025-09-25 01:15:29',NULL),(2,'Xeon E5540 2.4Ghz 4Core',50000,0,97,'available','2025-10-02 15:16:14','2025-09-25 01:15:29',NULL),(3,'Xeon X5560 2.8Ghz 8Core',80000,0,102,'available','2025-10-22 09:50:40','2025-09-25 01:15:29',NULL),(4,'Xeon X5650 2.6Ghz 12Core',100000,0,95,'available','2025-10-30 06:33:11','2025-09-25 01:15:29',NULL),(5,'Xeon E5-2690v2 2.6Ghz 12Core',100000,0,93,'available','2025-10-16 06:58:58','2025-09-25 01:15:29',NULL),(6,'Xeon E5-2690v4 3.0Ghz 20Core',150000,0,97,'available','2025-10-22 09:47:49','2025-09-25 01:15:29',NULL),(7,'Intel I5 9세대',100000,0,99,'available','2025-10-28 07:56:29','2025-10-28 04:17:23',NULL),(8,'Intel I5 10세대',100000,0,97,'available','2025-10-28 07:52:09','2025-10-28 04:18:17',NULL),(9,'Intel I5 12세대',100000,0,99,'available','2025-10-28 07:53:17','2025-10-28 04:18:32',NULL),(10,'Intel I7 9세대',100000,0,100,'available',NULL,'2025-10-28 04:18:59',NULL),(11,'Intel I7 10세대',100000,0,100,'available',NULL,'2025-10-28 04:19:19',NULL),(12,'InteL I7 12세대',100000,0,100,'available','2025-10-28 04:20:29','2025-10-28 04:19:44',NULL); +INSERT INTO `cpuinfo` VALUES (1,'Xeon E5530 2.4Ghz 4Core',50000,1,100,'available','2025-10-13 08:00:10','2025-09-25 01:15:29',NULL),(2,'Xeon E5540 2.4Ghz 4Core',50000,3,100,'available','2025-10-02 15:16:14','2025-09-25 01:15:29',NULL),(3,'Xeon X5560 2.8Ghz 8Core',80000,2,100,'available','2025-10-22 09:50:40','2025-09-25 01:15:29',NULL),(4,'Xeon X5650 2.6Ghz 12Core',100000,5,100,'available','2025-10-30 06:33:11','2025-09-25 01:15:29',NULL),(5,'Xeon E5-2690v2 2.6Ghz 12Core',100000,7,100,'available','2025-10-16 06:58:58','2025-09-25 01:15:29',NULL),(6,'Xeon E5-2690v4 3.0Ghz 20Core',150000,3,100,'available','2025-10-22 09:47:49','2025-09-25 01:15:29',NULL),(7,'Intel I5 9세대',100000,1,100,'available','2025-10-28 07:56:29','2025-10-28 04:17:23',NULL),(8,'Intel I5 10세대',100000,3,100,'available','2025-10-28 07:52:09','2025-10-28 04:18:17',NULL),(9,'Intel I5 12세대',100000,1,100,'available','2025-10-28 07:53:17','2025-10-28 04:18:32',NULL),(10,'Intel I7 9세대',100000,0,100,'available',NULL,'2025-10-28 04:18:59',NULL),(11,'Intel I7 10세대',100000,0,100,'available',NULL,'2025-10-28 04:19:19',NULL),(12,'InteL I7 12세대',100000,0,100,'available','2025-10-28 04:20:29','2025-10-28 04:19:44',NULL); /*!40000 ALTER TABLE `cpuinfo` ENABLE KEYS */; UNLOCK TABLES; @@ -265,7 +265,7 @@ CREATE TABLE `diskinfo` ( LOCK TABLES `diskinfo` WRITE; /*!40000 ALTER TABLE `diskinfo` DISABLE KEYS */; -INSERT INTO `diskinfo` VALUES (1,'SATA 128G',50000,0,100,0,'available',NULL,'2025-09-25 01:15:29',NULL),(2,'SATA 256G',70000,0,100,0,'available',NULL,'2025-09-25 01:15:29',NULL),(3,'SATA 512G',90000,0,100,0,'available',NULL,'2025-09-25 01:15:29',NULL),(4,'SAS 128G',60000,0,99,0,'available','2025-10-28 07:53:37','2025-09-25 01:15:29',NULL),(5,'SAS 256G',80000,0,100,0,'available',NULL,'2025-09-25 01:15:29',NULL),(6,'SAS 512G',100000,0,99,0,'available','2025-10-28 07:56:51','2025-09-25 01:15:29',NULL),(7,'SSD 128G',60000,0,88,8,'available','2025-10-30 06:48:21','2025-09-25 01:15:29',NULL),(8,'SSD 256G',80000,0,31,47,'available','2025-10-30 06:42:21','2025-09-25 01:15:29',NULL),(9,'SSD 512G',100000,0,32,46,'available','2025-10-30 06:42:06','2025-09-25 01:15:29',NULL),(10,'SSD 1T',120000,0,97,1,'available','2025-10-06 08:31:15','2025-09-25 01:15:29',NULL),(11,'SSD 2T',150000,0,96,2,'available','2025-10-06 08:25:57','2025-09-25 01:15:29',NULL),(12,'NVME 512G',120000,0,100,0,'available','2025-10-02 14:17:18','2025-09-25 01:15:29',NULL),(13,'NVME 1T',150000,0,97,2,'available','2025-10-30 08:09:16','2025-09-25 01:15:29',NULL),(14,'NVME 2T',180000,0,99,0,'available','2025-10-02 14:17:07','2025-09-25 01:15:29',NULL); +INSERT INTO `diskinfo` VALUES (1,'SATA 128G',50000,0,100,0,'available',NULL,'2025-09-25 01:15:29',NULL),(2,'SATA 256G',70000,0,100,0,'available',NULL,'2025-09-25 01:15:29',NULL),(3,'SATA 512G',90000,0,100,0,'available',NULL,'2025-09-25 01:15:29',NULL),(4,'SAS 128G',60000,1,100,0,'available','2025-10-28 07:53:37','2025-09-25 01:15:29',NULL),(5,'SAS 256G',80000,0,100,0,'available',NULL,'2025-09-25 01:15:29',NULL),(6,'SAS 512G',100000,1,100,0,'available','2025-10-28 07:56:51','2025-09-25 01:15:29',NULL),(7,'SSD 128G',60000,4,100,8,'available','2025-10-30 06:48:21','2025-09-25 01:15:29',NULL),(8,'SSD 256G',80000,22,100,47,'available','2025-10-30 06:42:21','2025-09-25 01:15:29',NULL),(9,'SSD 512G',100000,22,100,46,'available','2025-10-30 06:42:06','2025-09-25 01:15:29',NULL),(10,'SSD 1T',120000,2,100,1,'available','2025-10-06 08:31:15','2025-09-25 01:15:29',NULL),(11,'SSD 2T',150000,2,100,2,'available','2025-10-06 08:25:57','2025-09-25 01:15:29',NULL),(12,'NVME 512G',120000,0,100,0,'available','2025-10-02 14:17:18','2025-09-25 01:15:29',NULL),(13,'NVME 1T',150000,1,100,2,'available','2025-10-30 08:09:16','2025-09-25 01:15:29',NULL),(14,'NVME 2T',180000,1,100,0,'available','2025-10-02 14:17:07','2025-09-25 01:15:29',NULL); /*!40000 ALTER TABLE `diskinfo` ENABLE KEYS */; UNLOCK TABLES; @@ -484,7 +484,7 @@ CREATE TABLE `raminfo` ( LOCK TABLES `raminfo` WRITE; /*!40000 ALTER TABLE `raminfo` DISABLE KEYS */; -INSERT INTO `raminfo` VALUES (1,'ECC DDR3 2G',20000,0,99,'available','2025-10-28 04:24:06','2025-09-25 01:15:29',NULL),(2,'ECC DDR3 4G',30000,0,99,'available','2025-10-28 07:53:27','2025-09-25 01:15:29',NULL),(3,'ECC DDR3 8G',40000,0,75,'available','2025-10-30 06:33:11','2025-09-25 01:15:29',NULL),(4,'ECC DDR4 8G',60000,0,99,'available','2025-10-28 04:25:05','2025-09-25 01:15:29',NULL),(5,'ECC DDR3 16G',100000,0,99,'available','2025-10-28 04:25:16','2025-09-25 01:15:29',NULL),(6,'ECC DDR4 16G',100000,0,100,'available','2025-10-28 04:26:01','2025-09-25 01:15:29',NULL),(7,'ECC DDR3 32G',100000,0,100,'available',NULL,'2025-10-28 04:25:54',NULL),(8,'ECC DDR4 32G',100000,0,100,'available',NULL,'2025-10-28 04:26:21',NULL),(9,'DDR3 8G',50000,0,98,'available','2025-10-28 07:30:05','2025-10-28 04:26:53',NULL),(10,'DDR4 8G',60000,0,100,'available',NULL,'2025-10-28 04:27:17',NULL),(11,'DDR3 16G',90000,0,100,'available',NULL,'2025-10-28 04:27:39',NULL),(12,'DDR4 16G',90000,0,100,'available',NULL,'2025-10-28 04:28:06',NULL); +INSERT INTO `raminfo` VALUES (1,'ECC DDR3 2G',20000,1,100,'available','2025-10-28 04:24:06','2025-09-25 01:15:29',NULL),(2,'ECC DDR3 4G',30000,1,100,'available','2025-10-28 07:53:27','2025-09-25 01:15:29',NULL),(3,'ECC DDR3 8G',40000,15,100,'available','2025-10-30 06:33:11','2025-09-25 01:15:29',NULL),(4,'ECC DDR4 8G',60000,1,100,'available','2025-10-28 04:25:05','2025-09-25 01:15:29',NULL),(5,'ECC DDR3 16G',100000,1,100,'available','2025-10-28 04:25:16','2025-09-25 01:15:29',NULL),(6,'ECC DDR4 16G',100000,0,100,'available','2025-10-28 04:26:01','2025-09-25 01:15:29',NULL),(7,'ECC DDR3 32G',100000,0,100,'available',NULL,'2025-10-28 04:25:54',NULL),(8,'ECC DDR4 32G',100000,0,100,'available',NULL,'2025-10-28 04:26:21',NULL),(9,'DDR3 8G',50000,2,100,'available','2025-10-28 07:30:05','2025-10-28 04:26:53',NULL),(10,'DDR4 8G',60000,0,100,'available',NULL,'2025-10-28 04:27:17',NULL),(11,'DDR3 16G',90000,0,100,'available',NULL,'2025-10-28 04:27:39',NULL),(12,'DDR4 16G',90000,0,100,'available',NULL,'2025-10-28 04:28:06',NULL); /*!40000 ALTER TABLE `raminfo` ENABLE KEYS */; UNLOCK TABLES; @@ -655,7 +655,7 @@ CREATE TABLE `softwareinfo` ( LOCK TABLES `softwareinfo` WRITE; /*!40000 ALTER TABLE `softwareinfo` DISABLE KEYS */; -INSERT INTO `softwareinfo` VALUES (1,'닷디펜더',50000,0,91,'available','2025-10-30 08:11:33','2025-09-25 01:15:29',NULL),(2,'딥파인더',50000,0,97,'available','2025-10-15 07:31:44','2025-09-25 01:15:29',NULL); +INSERT INTO `softwareinfo` VALUES (1,'닷디펜더',50000,9,100,'available','2025-10-30 08:11:33','2025-09-25 01:15:29',NULL),(2,'딥파인더',50000,3,100,'available','2025-10-15 07:31:44','2025-09-25 01:15:29',NULL); /*!40000 ALTER TABLE `softwareinfo` ENABLE KEYS */; UNLOCK TABLES; @@ -742,4 +742,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2025-10-30 18:03:02 +-- Dump completed on 2025-10-30 18:57:16 diff --git a/app/Entities/Part/CPUEntity.php b/app/Entities/Part/CPUEntity.php index 5143657..d83eb1b 100644 --- a/app/Entities/Part/CPUEntity.php +++ b/app/Entities/Part/CPUEntity.php @@ -18,4 +18,8 @@ class CPUEntity extends PartEntity { return $this->attributes['stock']; } + final public function getAvailable(): int + { + return $this->getStock() - $this->getUsed(); + } } diff --git a/app/Entities/Part/DISKEntity.php b/app/Entities/Part/DISKEntity.php index 3aeabe8..9fa437e 100644 --- a/app/Entities/Part/DISKEntity.php +++ b/app/Entities/Part/DISKEntity.php @@ -22,4 +22,8 @@ class DISKEntity extends PartEntity { return intval($this->attributes['format'] ?? 0); } + final public function getAvailable(): int + { + return $this->getStock() - $this->getUsed(); + } } diff --git a/app/Entities/Part/RAMEntity.php b/app/Entities/Part/RAMEntity.php index 91c01be..43058bf 100644 --- a/app/Entities/Part/RAMEntity.php +++ b/app/Entities/Part/RAMEntity.php @@ -18,4 +18,8 @@ class RAMEntity extends PartEntity { return $this->attributes['stock']; } + final public function getAvailable(): int + { + return $this->getStock() - $this->getUsed(); + } } diff --git a/app/Entities/Part/SOFTWAREEntity.php b/app/Entities/Part/SOFTWAREEntity.php index 0ac7283..9a0ff26 100644 --- a/app/Entities/Part/SOFTWAREEntity.php +++ b/app/Entities/Part/SOFTWAREEntity.php @@ -18,4 +18,8 @@ class SOFTWAREEntity extends PartEntity { return $this->attributes['stock']; } + final public function getAvailable(): int + { + return $this->getStock() - $this->getUsed(); + } } diff --git a/app/Language/en/Part/CPU.php b/app/Language/en/Part/CPU.php index 17e55a9..056fcc3 100644 --- a/app/Language/en/Part/CPU.php +++ b/app/Language/en/Part/CPU.php @@ -4,6 +4,7 @@ return [ 'label' => [ 'title' => "모델명", 'price' => "기본가", + 'used' => "사용", 'stock' => "재고", 'status' => "상태", 'updated_at' => "수정일", diff --git a/app/Language/en/Part/DISK.php b/app/Language/en/Part/DISK.php index 4449cd7..7e8360b 100644 --- a/app/Language/en/Part/DISK.php +++ b/app/Language/en/Part/DISK.php @@ -4,6 +4,7 @@ return [ 'label' => [ 'title' => "모델명", 'price' => "기본가", + 'used' => "사용", 'stock' => "재고", 'format' => "포맷", 'status' => "상태", diff --git a/app/Language/en/Part/RAM.php b/app/Language/en/Part/RAM.php index 793d51b..2db6c8b 100644 --- a/app/Language/en/Part/RAM.php +++ b/app/Language/en/Part/RAM.php @@ -4,6 +4,7 @@ return [ 'label' => [ 'title' => "모델명", 'price' => "기본가", + 'used' => "사용", 'stock' => "재고", 'status' => "상태", 'updated_at' => "수정일", diff --git a/app/Language/en/Part/SOFTWARE.php b/app/Language/en/Part/SOFTWARE.php index 1e038b4..629e731 100644 --- a/app/Language/en/Part/SOFTWARE.php +++ b/app/Language/en/Part/SOFTWARE.php @@ -4,6 +4,7 @@ return [ 'label' => [ 'title' => "모델명", 'price' => "기본가", + 'used' => "사용", 'stock' => "재고", 'status' => "상태", 'updated_at' => "수정일", diff --git a/app/Models/Part/CPUModel.php b/app/Models/Part/CPUModel.php index 958a10e..83dccca 100644 --- a/app/Models/Part/CPUModel.php +++ b/app/Models/Part/CPUModel.php @@ -17,6 +17,7 @@ class CPUModel extends PartModel "uid", "title", "price", + "used", "stock", "status", "updated_at" diff --git a/app/Models/Part/DISKModel.php b/app/Models/Part/DISKModel.php index 857e405..4bf45a5 100644 --- a/app/Models/Part/DISKModel.php +++ b/app/Models/Part/DISKModel.php @@ -17,6 +17,7 @@ class DISKModel extends PartModel "uid", "title", "price", + "used", "stock", "format", "status", diff --git a/app/Models/Part/RAMModel.php b/app/Models/Part/RAMModel.php index 62004b7..b37601f 100644 --- a/app/Models/Part/RAMModel.php +++ b/app/Models/Part/RAMModel.php @@ -17,6 +17,7 @@ class RAMModel extends PartModel "uid", "title", "price", + "used", "stock", "status", "updated_at" diff --git a/app/Models/Part/SOFTWAREModel.php b/app/Models/Part/SOFTWAREModel.php index 9a2c0b6..766a81a 100644 --- a/app/Models/Part/SOFTWAREModel.php +++ b/app/Models/Part/SOFTWAREModel.php @@ -17,6 +17,7 @@ class SOFTWAREModel extends PartModel "uid", "title", "price", + "used", "stock", "status", "updated_at" diff --git a/app/Services/Part/CPUService.php b/app/Services/Part/CPUService.php index dc880be..5eec537 100644 --- a/app/Services/Part/CPUService.php +++ b/app/Services/Part/CPUService.php @@ -34,6 +34,7 @@ class CPUService extends PartService return [ "title", "price", + "used", "stock", "status", ]; diff --git a/app/Services/Part/DISKService.php b/app/Services/Part/DISKService.php index 3712346..9b6c203 100644 --- a/app/Services/Part/DISKService.php +++ b/app/Services/Part/DISKService.php @@ -37,6 +37,7 @@ class DISKService extends PartService return [ "title", "price", + "used", "stock", "format", "status", diff --git a/app/Services/Part/PartService.php b/app/Services/Part/PartService.php index a1540d5..7b20f1f 100644 --- a/app/Services/Part/PartService.php +++ b/app/Services/Part/PartService.php @@ -15,7 +15,6 @@ abstract class PartService extends CommonService implements PartInterface parent::__construct($model, $helper); $this->addClassName('Part'); } - //서버파트관련 작업 public function attachToServerPart(ServerPartEntity $serverPartEntity): mixed { @@ -25,9 +24,8 @@ abstract class PartService extends CommonService implements PartInterface throw new \Exception("{$serverPartEntity->getPartUID()}에 해당하는 부품정보를 찾을수없습니다."); } //부품정보에 서버정보 설정 및 서비스,고객정보 정의 - $available = $entity->getStock() - $entity->getUsed(); - if ($available < $serverPartEntity->getCnt()) { - throw new \Exception("현재 재고수[{$available}]보다 지정하신 갯수({$serverPartEntity->getCnt()})가 더 많습니다."); + if ($entity->getAvailable() < $serverPartEntity->getCnt()) { + throw new \Exception("현재 재고수[{$entity->getAvailable()}]보다 지정하신 갯수({$serverPartEntity->getCnt()})가 더 많습니다."); } return $this->getModel()->modify($entity, ['used' => $entity->getUsed() + $serverPartEntity->getCnt()]); } diff --git a/app/Services/Part/RAMService.php b/app/Services/Part/RAMService.php index 8873036..6cbd42b 100644 --- a/app/Services/Part/RAMService.php +++ b/app/Services/Part/RAMService.php @@ -33,6 +33,7 @@ class RAMService extends PartService return [ "title", "price", + "used", "stock", "status", ]; diff --git a/app/Services/Part/SOFTWAREService.php b/app/Services/Part/SOFTWAREService.php index 665433f..1c5c86c 100644 --- a/app/Services/Part/SOFTWAREService.php +++ b/app/Services/Part/SOFTWAREService.php @@ -33,6 +33,7 @@ class SOFTWAREService extends PartService return [ "title", "price", + "used", "stock", "status", ]; diff --git a/app/Views/cells/part/disk_stock.php b/app/Views/cells/part/disk_stock.php index 215cd13..6dd2e77 100644 --- a/app/Views/cells/part/disk_stock.php +++ b/app/Views/cells/part/disk_stock.php @@ -21,7 +21,7 @@ ); ?> - getStock() ?> + getAvailable() ?> getHelper()->getFieldView('format', $entity->format, $partCellDatas) ?> diff --git a/app/Views/cells/part/ram_stock.php b/app/Views/cells/part/ram_stock.php index 9208cb5..c49f7e1 100644 --- a/app/Views/cells/part/ram_stock.php +++ b/app/Views/cells/part/ram_stock.php @@ -20,7 +20,7 @@ ); ?> - getStock() ?> + getAvailable() ?> \ No newline at end of file diff --git a/app/Views/templates/admin/index_header.php b/app/Views/templates/admin/index_header.php index 59ba873..d2b830f 100644 --- a/app/Views/templates/admin/index_header.php +++ b/app/Views/templates/admin/index_header.php @@ -46,4 +46,7 @@ + \ No newline at end of file