dbmsv2_init...1

This commit is contained in:
choi.jh 2025-09-30 16:03:31 +09:00
parent d84c355c59
commit 0b46189461
28 changed files with 135 additions and 41 deletions

View File

@ -4,8 +4,8 @@
"settings": {
"width": 3000,
"height": 3000,
"scrollTop": -1581.7873,
"scrollLeft": -576.9398,
"scrollTop": -538.7873,
"scrollLeft": -1597,
"zoomLevel": 0.79,
"show": 511,
"database": 4,
@ -615,6 +615,7 @@
"vxhl-9RMNJ8zU9oqzEWo8",
"d4HxTQuDbI7SN2qBS84s2",
"vbPIGWHquXROtCfId6RVF",
"4YV8pFzwxVMlQJfHF6NyI",
"FhnUrn_dOrdhaBe_P3ty-",
"SA3xJ9nRW8EWDCFoMjnj3",
"T8UART66GUy4LWDk0yUxl",
@ -643,6 +644,7 @@
"vxhl-9RMNJ8zU9oqzEWo8",
"d4HxTQuDbI7SN2qBS84s2",
"vbPIGWHquXROtCfId6RVF",
"4YV8pFzwxVMlQJfHF6NyI",
"FhnUrn_dOrdhaBe_P3ty-",
"SA3xJ9nRW8EWDCFoMjnj3",
"T8UART66GUy4LWDk0yUxl",
@ -662,7 +664,7 @@
"color": ""
},
"meta": {
"updateAt": 1758175481304,
"updateAt": 1759211433149,
"createAt": 1748484896313
}
},
@ -683,6 +685,7 @@
"MPV_aB_fuEXdco5eTWdEP",
"SrCfFg0KgEamhUOVqGiPE",
"hQ5EOPiUpDbVpWQwawtw4",
"zMpap7_wfBGVf2ZtONK0r",
"hK2hK1Xs1GrDW5nUTroIR",
"9o7wfPp7WK2nZoxkDZ9Y1",
"ualEjhI_OuUVdgH7dSzma",
@ -738,6 +741,7 @@
"RpyPtXKwtu3XFr5BM61TA",
"FJtEzmrQUsMMbrWbzr8IR",
"hQ5EOPiUpDbVpWQwawtw4",
"zMpap7_wfBGVf2ZtONK0r",
"hK2hK1Xs1GrDW5nUTroIR",
"9o7wfPp7WK2nZoxkDZ9Y1",
"ualEjhI_OuUVdgH7dSzma",
@ -759,7 +763,7 @@
"color": ""
},
"meta": {
"updateAt": 1758513287204,
"updateAt": 1759209589117,
"createAt": 1748485662214
}
},
@ -9479,6 +9483,46 @@
"updateAt": 1758871910233,
"createAt": 1758871910232
}
},
"zMpap7_wfBGVf2ZtONK0r": {
"id": "zMpap7_wfBGVf2ZtONK0r",
"tableId": "B8haiEbPc1lRBWTv1g25G",
"name": "sale",
"comment": "할인액",
"dataType": "INT",
"default": "0",
"options": 8,
"ui": {
"keys": 0,
"widthName": 60,
"widthComment": 60,
"widthDataType": 60,
"widthDefault": 60
},
"meta": {
"updateAt": 1759209609427,
"createAt": 1759209583630
}
},
"4YV8pFzwxVMlQJfHF6NyI": {
"id": "4YV8pFzwxVMlQJfHF6NyI",
"tableId": "QCNA57Pi6A9dJDgybxS5v",
"name": "content",
"comment": "내용",
"dataType": "TEXT",
"default": "",
"options": 0,
"ui": {
"keys": 0,
"widthName": 60,
"widthComment": 60,
"widthDataType": 60,
"widthDefault": 60
},
"meta": {
"updateAt": 1759211445971,
"createAt": 1759211431057
}
}
},
"relationshipEntities": {
@ -9558,7 +9602,7 @@
"s1Az-lXWK0NlVQqFEEK8o"
],
"x": 2338.5336,
"y": 575.633,
"y": 578.633,
"direction": 1
},
"meta": {
@ -9810,7 +9854,7 @@
"8mPFhDdUY8QLPvc8rNw1B"
],
"x": 2338.5336,
"y": 869.633,
"y": 890.633,
"direction": 1
},
"meta": {
@ -9838,7 +9882,7 @@
"N-2m8O_JzS6-sDEcL5zTv"
],
"x": 1807.3602,
"y": 1250.9431,
"y": 1256.9431,
"direction": 1
},
"meta": {
@ -9866,7 +9910,7 @@
"vxhl-9RMNJ8zU9oqzEWo8"
],
"x": 2338.5336,
"y": 673.633,
"y": 682.633,
"direction": 1
},
"meta": {
@ -9941,7 +9985,7 @@
"nNWsAWbHfKWqx8EwxvuM1"
],
"x": 1889.3602,
"y": 1652.9431,
"y": 1676.9431,
"direction": 8
},
"end": {
@ -10081,7 +10125,7 @@
"nNWsAWbHfKWqx8EwxvuM1"
],
"x": 1807.3602,
"y": 1518.9431,
"y": 1536.9431,
"direction": 1
},
"end": {
@ -10137,7 +10181,7 @@
"nNWsAWbHfKWqx8EwxvuM1"
],
"x": 2217.3602,
"y": 1652.9431,
"y": 1676.9431,
"direction": 8
},
"end": {
@ -10165,7 +10209,7 @@
"nNWsAWbHfKWqx8EwxvuM1"
],
"x": 2381.3602,
"y": 1652.9431,
"y": 1676.9431,
"direction": 8
},
"end": {
@ -10305,7 +10349,7 @@
"GMPyqxaroK2OjQZnoCRwn"
],
"x": 2338.5336,
"y": 771.633,
"y": 786.633,
"direction": 1
},
"end": {
@ -10333,7 +10377,7 @@
"GMPyqxaroK2OjQZnoCRwn"
],
"x": 2657.5336,
"y": 918.633,
"y": 942.633,
"direction": 8
},
"end": {
@ -10370,7 +10414,7 @@
"y6WzFGCw3VEqa06ops3EC"
],
"x": 2053.3602,
"y": 1652.9431,
"y": 1676.9431,
"direction": 8
},
"meta": {

File diff suppressed because one or more lines are too long

View File

@ -60,7 +60,11 @@ class ServiceEntity extends CustomerEntity
{
return $this->attributes['billing_at'] ?? "";
}
//청구금액->기본:상면비+회선비+서버금액(price)+서버파트연결(월비용)
//청구금액->기본:상면비+회선비+서버금액(price)+서버파트연결(월비용)-할인액
final public function getSale(): int
{
return $this->attributes['sale'] ?? 0;
}
final public function getAmount(): int
{
return $this->attributes['amount'] ?? 0;
@ -75,6 +79,10 @@ class ServiceEntity extends CustomerEntity
{
return $this->attributes['line'] ?? 0;
}
final public function getStartAt(): string
{
return $this->attributes['start_at'] ?? "";
}
public function getHistory(): string
{
return $this->attributes['history'] ?? "";

View File

@ -75,6 +75,7 @@ class ServiceHelper extends CustomerHelper
{
switch ($field) {
case 'amount':
case 'sale':
$value = number_format($value) . "";
break;
case 'billing_at':

View File

@ -11,6 +11,7 @@ return [
'rack' => "상면비",
'line' => "회선비",
'billing_at' => "결제일",
'sale' => "할인액",
'amount' => "월청구액",
'start_at' => "시작일",
'end_at' => "해지일",

View File

@ -13,6 +13,7 @@ class AccountModel extends CustomerModel
protected $primaryKey = self::PK;
protected $returnType = AccountEntity::class;
protected $allowedFields = [
"uid",
"user_uid",
"clientinfo_uid",
"bank",

View File

@ -14,6 +14,7 @@ class ClientModel extends CustomerModel
protected $primaryKey = self::PK;
protected $returnType = ClientEntity::class;
protected $allowedFields = [
"uid",
"user_uid",
"code",
"site",

View File

@ -13,6 +13,7 @@ class CouponModel extends CustomerModel
protected $primaryKey = self::PK;
protected $returnType = CouponEntity::class;
protected $allowedFields = [
"uid",
"user_uid",
"clientinfo_uid",
"title",

View File

@ -13,6 +13,7 @@ class PointModel extends CustomerModel
protected $primaryKey = self::PK;
protected $returnType = PointEntity::class;
protected $allowedFields = [
"uid",
"user_uid",
"clientinfo_uid",
"title",

View File

@ -15,6 +15,7 @@ class ServiceModel extends CustomerModel
protected $primaryKey = self::PK;
protected $returnType = ServiceEntity::class;
protected $allowedFields = [
"uid",
"user_uid",
"clientinfo_uid",
"serverinfo_uid",
@ -25,6 +26,7 @@ class ServiceModel extends CustomerModel
"rack",
"line",
"billing_at",
"sale",
"amount",
"start_at",
"end_at",
@ -50,6 +52,7 @@ class ServiceModel extends CustomerModel
case "line":
$rule = "required|numeric";
break;
case "sale":
case "payment_uid":
$rule = "permit_empty|numeric";
break;

View File

@ -13,6 +13,7 @@ class LineModel extends EquipmentModel
protected $primaryKey = self::PK;
protected $returnType = LineEntity::class;
protected $allowedFields = [
"uid",
"type",
"title",
"bandwith",

View File

@ -14,6 +14,7 @@ class ServerModel extends EquipmentModel
protected $primaryKey = self::PK;
protected $returnType = ServerEntity::class;
protected $allowedFields = [
"uid",
"clientinfo_uid",
"serviceinfo_uid",
"code",

View File

@ -13,6 +13,7 @@ class ServerPartModel extends EquipmentModel
protected $primaryKey = self::PK;
protected $returnType = ServerPartEntity::class;
protected $allowedFields = [
"uid",
"part_uid",
"clientinfo_uid",
"serverinfo_uid",

View File

@ -13,6 +13,7 @@ class MyLogModel extends CommonModel
protected $primaryKey = self::PK;
protected $returnType = MyLogEntity::class;
protected $allowedFields = [
"uid",
"user_uid",
"title",
"content",

View File

@ -14,6 +14,7 @@ class CPUModel extends PartModel
// protected $useAutoIncrement = false;
protected $returnType = CPUEntity::class;
protected $allowedFields = [
"uid",
"title",
"price",
"stock",

View File

@ -13,6 +13,7 @@ class CSModel extends PartModel
protected $primaryKey = self::PK;
protected $returnType = CSEntity::class;
protected $allowedFields = [
"uid",
"clientinfo_uid",
"serviceinfo_uid",
"serverinfo_uid",

View File

@ -14,6 +14,7 @@ class DISKModel extends PartModel
// protected $useAutoIncrement = false;
protected $returnType = DISKEntity::class;
protected $allowedFields = [
"uid",
"title",
"price",
"stock",

View File

@ -13,6 +13,7 @@ class IPModel extends PartModel
protected $primaryKey = self::PK;
protected $returnType = IPEntity::class;
protected $allowedFields = [
"uid",
"lineinfo_uid",
"old_clientinfo_uid",
"clientinfo_uid",

View File

@ -14,6 +14,7 @@ class OSModel extends PartModel
// protected $useAutoIncrement = false;
protected $returnType = OSEntity::class;
protected $allowedFields = [
"uid",
"title",
"price",
"stock",

View File

@ -14,6 +14,7 @@ class RAMModel extends PartModel
// protected $useAutoIncrement = false;
protected $returnType = RAMEntity::class;
protected $allowedFields = [
"uid",
"title",
"price",
"stock",

View File

@ -14,6 +14,7 @@ class SOFTWAREModel extends PartModel
// protected $useAutoIncrement = false;
protected $returnType = SOFTWAREEntity::class;
protected $allowedFields = [
"uid",
"title",
"price",
"stock",

View File

@ -14,6 +14,7 @@ class SWITCHModel extends PartModel
// protected $useAutoIncrement = false;
protected $returnType = SWITCHEntity::class;
protected $allowedFields = [
"uid",
"clientinfo_uid",
"serviceinfo_uid",
"serverinfo_uid",

View File

@ -13,6 +13,7 @@ class PaymentModel extends CommonModel
protected $primaryKey = self::PK;
protected $returnType = PaymentEntity::class;
protected $allowedFields = [
"uid",
"user_uid",
"clientinfo_uid",
"serviceinfo_uid",

View File

@ -13,6 +13,7 @@ class UserModel extends CommonModel
protected $primaryKey = self::PK;
protected $returnType = UserEntity::class;
protected $allowedFields = [
"uid",
"id",
"passwd",
"name",

View File

@ -15,6 +15,7 @@ class UserSNSModel extends CommonModel
protected $primaryKey = self::PK;
protected $returnType = UserSNSEntity::class;
protected $allowedFields = [
"uid",
"site",
"user_uid",
"id",

View File

@ -36,6 +36,7 @@ class ServiceService extends CustomerService implements ServerInterface, ServerP
"start_at",
"billing_at",
"status",
'sale',
'amount',
"history",
];
@ -59,6 +60,7 @@ class ServiceService extends CustomerService implements ServerInterface, ServerP
'location',
'clientinfo_uid',
'serverinfo_uid',
'sale',
'amount',
'billing_at',
'status',
@ -167,14 +169,15 @@ class ServiceService extends CustomerService implements ServerInterface, ServerP
final public function getCaculatedAmount(ServiceEntity $entity): int
{
//총서비스금액 계산
$caculatedAmount = $entity->getRack() + $entity->getLine() + $entity->getServerEntity()->getPrice(); //기본:상면비+회선비+서버금액(price)+서버파트연결(월비용)
//기본:상면비+회선비+서버금액(price)+서버파트연결(월비용)-할인액
$caculatedAmount = $entity->getRack() + $entity->getLine() + $entity->getServerEntity()->getPrice();
//해당 서비스(서버) 관련 결제방식(Billing)이 Month인 ServerPart 전체를 다시 검사하여 월청구액을 합산한다.
foreach ($this->getServerPartService()->getEntities(['serverinfo_uid' => $entity->getServerEntity()->getPK()]) as $serverPartEntity) {
if ($serverPartEntity->getBilling() === PAYMENT['BILLING']['MONTH']) { //월비용일때만 적용
$caculatedAmount += $serverPartEntity->getTotalAmount(); //단가*Cnt
}
}
return $caculatedAmount;
return $caculatedAmount - $entity->getSale();
}
final public function setAmount(ServiceEntity $entity): ServiceEntity
{
@ -199,13 +202,19 @@ class ServiceService extends CustomerService implements ServerInterface, ServerP
//대체 서버를 메인서버로 설정
final public function changeAlternativeServer(ServiceEntity $entity, array $formDatas): ServiceEntity
{
// //기존메인서버 정보
// $oldServerEntity = $entity->getServerEntity();
// //메인서버로 선정된 대체서버정보
$serverEntity = $this->getServerService()->getEntity($formDatas['serverinfo_uid']);
if (!$serverEntity instanceof ServerEntity) {
throw new \Exception("{$formDatas['serverinfo_uid']}에 대한 서버정보를 찾을수 없습니다.");
}
//수정전 정보
// //메인서버로 선정된 서버의 형식을 기존메인서버의 형식으로 바꿈
// $serverEntity = $this->getServerService()->modify($serverEntity, ['type' => $oldServerEntity->getType()]);
//수정전 서비스정보
$oldEntity = $entity;
//메인서버 변경
//메인서버 변경(메인서버를 선정된 대체서버로 바꾼다.)
$entity = parent::modify($entity, ['serverinfo_uid' => $serverEntity->getPK()]);
//전체 서비스금액 설정
$entity = $this->setAmount($entity);

View File

@ -188,7 +188,8 @@ class PaymentService extends CommonService implements ServiceInterface, ServerPa
$formDatas['billing'] = PAYMENT['BILLING']['MONTH'];
$formDatas['billing_at'] = $serviceEntity->getBillingAt();
//필수정보처리 후 결제정보수정 후 서비스정보 Entity에 결제정보 설정
return $serviceEntity->setPaymentEntity($this->getModel()->modify($entity, $formDatas));
$entity = $this->getModel()->modify($entity, $formDatas);
return $serviceEntity->setPaymentEntity($entity);
}
public function unsetService(ServiceEntity $serviceEntity, array $serviceDatas): ServiceEntity
{

View File

@ -44,6 +44,9 @@
<th class="index_head_short_column" style="width:650px;">
<span class="float-start rounded border border-primary" style="cursor:pointer;" onclick="copyServerPartsToClipboard()">ALL 📋</span>서버정보
</th>
<th class="index_head_short_column">
<?= $viewDatas['service']->getHelper()->getListLabel('amount', lang("{$viewDatas['class_path']}.label.sale"), $viewDatas) ?>
</th>
<th class="index_head_short_column">
<?= $viewDatas['service']->getHelper()->getListLabel('amount', lang("{$viewDatas['class_path']}.label.amount"), $viewDatas) ?>
</th>
@ -67,22 +70,25 @@
<td nowrap><?= $viewDatas['service']->getHelper()->getListButton('modify', $num, $viewDatas) ?></td>
<td nowrap>
<?= $viewDatas['service']->getHelper()->getFieldView('site', $entity->site, $viewDatas) ?>
/ <?= $viewDatas['service']->getHelper()->getFieldView('location', $entity->location, $viewDatas) ?>
/ <?= $viewDatas['service']->getHelper()->getFieldView('location', $entity->getLocation(), $viewDatas) ?>
</td>
<td nowrap>
<?= $viewDatas['service']->getHelper()->getFieldView('clientinfo_uid', $entity->clientinfo_uid, $viewDatas) ?>
<?= $viewDatas['service']->getHelper()->getFieldView('clientinfo_uid', $entity->getClientInfoUID(), $viewDatas) ?>
</td>
<td nowrap><?= implode("", $viewDatas['childServers'][$entity->getPK()]) ?></td>
<td nowrap>
<?= $viewDatas['service']->getHelper()->getFieldView('amount', $entity->amount, $viewDatas) ?>
<td nowrap class="text-end">
<?= $viewDatas['service']->getHelper()->getFieldView('sale', $entity->getSale(), $viewDatas) ?>
</td>
<td nowrap class="text-end">
<?= $viewDatas['service']->getHelper()->getFieldView('amount', $entity->getAmount(), $viewDatas) ?>
</td>
<td nowrap>
<?= $viewDatas['service']->getHelper()->getFieldView('billing_at', $entity->billing_at, $viewDatas) ?>
<?= $viewDatas['service']->getHelper()->getFieldView('billing_at', $entity->getBillingAt(), $viewDatas) ?>
</td>
<td nowrap>
<?= $viewDatas['service']->getHelper()->getFieldView('status', $entity->status, $viewDatas) ?>
<?= $viewDatas['service']->getHelper()->getFieldView('status', $entity->getStatus(), $viewDatas) ?>
</td>
<td nowrap><?= $viewDatas['service']->getHelper()->getFieldView('start_at', $entity->start_at, $viewDatas) ?></td>
<td nowrap><?= $viewDatas['service']->getHelper()->getFieldView('start_at', $entity->getStartAt(), $viewDatas) ?></td>
<td nowrap>
<?= $viewDatas['service']->getHelper()->getListButton('alternative', '', $viewDatas) ?>&nbsp;
<?= $viewDatas['service']->getHelper()->getListButton('onetime', '', $viewDatas) ?>&nbsp;