dbmsv3 init...1

This commit is contained in:
choi.jh 2025-10-30 18:58:54 +09:00
parent 3b878ff21b
commit e81d4a78b2
21 changed files with 40 additions and 11 deletions

View File

@ -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

View File

@ -18,4 +18,8 @@ class CPUEntity extends PartEntity
{
return $this->attributes['stock'];
}
final public function getAvailable(): int
{
return $this->getStock() - $this->getUsed();
}
}

View File

@ -22,4 +22,8 @@ class DISKEntity extends PartEntity
{
return intval($this->attributes['format'] ?? 0);
}
final public function getAvailable(): int
{
return $this->getStock() - $this->getUsed();
}
}

View File

@ -18,4 +18,8 @@ class RAMEntity extends PartEntity
{
return $this->attributes['stock'];
}
final public function getAvailable(): int
{
return $this->getStock() - $this->getUsed();
}
}

View File

@ -18,4 +18,8 @@ class SOFTWAREEntity extends PartEntity
{
return $this->attributes['stock'];
}
final public function getAvailable(): int
{
return $this->getStock() - $this->getUsed();
}
}

View File

@ -4,6 +4,7 @@ return [
'label' => [
'title' => "모델명",
'price' => "기본가",
'used' => "사용",
'stock' => "재고",
'status' => "상태",
'updated_at' => "수정일",

View File

@ -4,6 +4,7 @@ return [
'label' => [
'title' => "모델명",
'price' => "기본가",
'used' => "사용",
'stock' => "재고",
'format' => "포맷",
'status' => "상태",

View File

@ -4,6 +4,7 @@ return [
'label' => [
'title' => "모델명",
'price' => "기본가",
'used' => "사용",
'stock' => "재고",
'status' => "상태",
'updated_at' => "수정일",

View File

@ -4,6 +4,7 @@ return [
'label' => [
'title' => "모델명",
'price' => "기본가",
'used' => "사용",
'stock' => "재고",
'status' => "상태",
'updated_at' => "수정일",

View File

@ -17,6 +17,7 @@ class CPUModel extends PartModel
"uid",
"title",
"price",
"used",
"stock",
"status",
"updated_at"

View File

@ -17,6 +17,7 @@ class DISKModel extends PartModel
"uid",
"title",
"price",
"used",
"stock",
"format",
"status",

View File

@ -17,6 +17,7 @@ class RAMModel extends PartModel
"uid",
"title",
"price",
"used",
"stock",
"status",
"updated_at"

View File

@ -17,6 +17,7 @@ class SOFTWAREModel extends PartModel
"uid",
"title",
"price",
"used",
"stock",
"status",
"updated_at"

View File

@ -34,6 +34,7 @@ class CPUService extends PartService
return [
"title",
"price",
"used",
"stock",
"status",
];

View File

@ -37,6 +37,7 @@ class DISKService extends PartService
return [
"title",
"price",
"used",
"stock",
"format",
"status",

View File

@ -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()]);
}

View File

@ -33,6 +33,7 @@ class RAMService extends PartService
return [
"title",
"price",
"used",
"stock",
"status",
];

View File

@ -33,6 +33,7 @@ class SOFTWAREService extends PartService
return [
"title",
"price",
"used",
"stock",
"status",
];

View File

@ -21,7 +21,7 @@
);
?>
</td>
<td class="text-center" nowrap width="20%"><?= $entity->getStock() ?></td>
<td class="text-center" nowrap width="20%"><?= $entity->getAvailable() ?></td>
<td nowrap width="20%"><?= $partCellDatas['service']->getHelper()->getFieldView('format', $entity->format, $partCellDatas) ?></td>
</tr>
<?php endforeach ?>

View File

@ -20,7 +20,7 @@
);
?>
</td>
<td class="text-center" nowrap width="30%"><?= $entity->getStock() ?></td>
<td class="text-center" nowrap width="30%"><?= $entity->getAvailable() ?></td>
</tr>
<?php endforeach ?>
</table>

View File

@ -46,4 +46,7 @@
<li class="nav-item">
<span class="nav-link active" aria-current="page" style="cursor:pointer;"><a href="/admin/part/disk">DISK정보</a></span>
</li>
<li class="nav-item">
<span class="nav-link active" aria-current="page" style="cursor:pointer;"><a href="/admin/part/software">SOFTWARE정보</a></span>
</li>
</ul>