dbmsv4 init...3

This commit is contained in:
최준흠 2025-12-24 15:14:46 +09:00
parent 397c9b4f78
commit 7083471fbb

View File

@ -155,8 +155,7 @@ class ServiceService extends CustomerService
} }
//생성폼에는 없는 필수항목 지정용(code) //생성폼에는 없는 필수항목 지정용(code)
$formDatas['code'] = $formDatas['site'] . "_s" . uniqid(); $formDatas['code'] = $formDatas['site'] . "_s" . uniqid();
//정의된 서버로 서비스금액 계산 $formDatas['amount'] = 0; //임시정의 후 Update
$formDatas['amount'] = $this->getCalculatedAmount($formDatas['rack'], $formDatas['line'], $formDatas['sale'], $formDatas['serverinfo_uid']);
//서비스 생성 //서비스 생성
$entity = parent::create_process($formDatas); $entity = parent::create_process($formDatas);
if (!$entity instanceof ServiceEntity) { if (!$entity instanceof ServiceEntity) {
@ -176,19 +175,20 @@ class ServiceService extends CustomerService
$oldEntity = clone $entity; $oldEntity = clone $entity;
//수정폼에는 없는 필수항목 지정용(code) //수정폼에는 없는 필수항목 지정용(code)
$formDatas['code'] = $entity->getCode(); $formDatas['code'] = $entity->getCode();
//정의된 서버로 서비스금액 계산 $formDatas['amount'] = 0; //임시정의 후 Update
$formDatas['amount'] = $this->getCalculatedAmount($formDatas['rack'], $formDatas['line'], $formDatas['sale'], $formDatas['serverinfo_uid']);
//서비스 수정 //서비스 수정
$entity = parent::modify_process($entity, $formDatas); $entity = parent::modify_process($entity, $formDatas);
if (!$entity instanceof ServiceEntity) { if (!$entity instanceof ServiceEntity) {
throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 오류발생:Return Type은 ServiceEntity만 가능"); throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 오류발생:Return Type은 ServiceEntity만 가능");
} }
//기존 서비스용 결제비용 과 신규 서버스용으로 결제비용이 다르면 수정
service('paymentservice')->modifyByService($oldEntity, $entity);
//서버정보 연결 신규서버로 변경 //서버정보 연결 신규서버로 변경
if ($oldEntity->getServerInfoUid() !== $entity->getServerInfoUid()) { if ($oldEntity->getServerInfoUid() !== $entity->getServerInfoUid()) {
service('equipment_serverservice')->modifyByService($oldEntity, $entity); service('equipment_serverservice')->modifyByService($oldEntity, $entity);
} }
//서비스비용 설정
$entity = $this->updateAmount($entity);
//기존 서비스용 결제비용 과 신규 서버스용으로 결제비용이 다르면 수정
service('paymentservice')->modifyByService($oldEntity, $entity);
return $entity; return $entity;
} }
//List 검색용 //List 검색용