dbmsv4 init...1
This commit is contained in:
parent
11708086c6
commit
f89cbea0cd
@ -27,7 +27,7 @@ class ServiceController extends CustomerController
|
||||
$formDatas['location'] = 'chiba';
|
||||
$formDatas['rack'] = '100000';
|
||||
$formDatas['line'] = '300000';
|
||||
$formDatas['type'] = 'normal';
|
||||
$formDatas['sale'] = 0;
|
||||
$formDatas['billing_at'] = date("Y-m-d");
|
||||
$formDatas['start_at'] = date("Y-m-d");
|
||||
$formDatas['status'] = STATUS['AVAILABLE'];
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -54,8 +54,8 @@ class ServiceForm extends CustomerForm
|
||||
foreach ($this->getFormOption_process(service('equipment_serverservice'), $action, $field, $formDatas) as $tempEntity) {
|
||||
$tempOptions[$tempEntity->getPK()] = [
|
||||
'value' => $tempEntity->getPK(),
|
||||
'text' => $tempEntity->getTitle(),
|
||||
'data-title' => $tempEntity->getTitle(),
|
||||
'text' => $tempEntity->getCustomTitle(),
|
||||
'data-title' => $tempEntity->getCustomTitle(),
|
||||
'data-price' => $tempEntity->getPrice()
|
||||
];
|
||||
}
|
||||
|
||||
@ -137,6 +137,9 @@ class ServiceService extends CustomerService
|
||||
if (!$entity instanceof ServiceEntity) {
|
||||
throw new RuntimeException(__METHOD__ . "에서 오류발생:Return Type은 ServiceEntity만 가능");
|
||||
}
|
||||
//서비스추가시 자동추가용
|
||||
service('equipment_serverservice')->attachToService($entity);
|
||||
service('paymentservice')->attachToService($entity);
|
||||
return $entity;
|
||||
}
|
||||
protected function modify_process($uid, array $formDatas): ServiceEntity
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
namespace App\Services\Equipment;
|
||||
|
||||
use App\DTOs\Equipment\ServerDTO;
|
||||
use App\Entities\Customer\ServiceEntity;
|
||||
use App\Entities\Equipment\ServerEntity;
|
||||
use App\Forms\Equipment\ServerForm;
|
||||
use App\Helpers\Equipment\ServerHelper;
|
||||
@ -249,4 +250,23 @@ class ServerService extends EquipmentService
|
||||
parent::setSearchWord($word);
|
||||
}
|
||||
//OrderBy 처리
|
||||
|
||||
//서비스추가시 서버정보 자동추가용
|
||||
public function attachToService(ServiceEntity $serviceEntity): void
|
||||
{
|
||||
//서버파트정보 생성
|
||||
$formDatas = [];
|
||||
$formDatas['serviceinfo_uid'] = $serviceEntity->getPK();
|
||||
$formDatas["clientinfo_uid"] = $serviceEntity->getClientInfoUID();
|
||||
$formDatas['user_uid'] = $this->getAuthContext()->getUID();
|
||||
$formDatas['status'] = STATUS['OCCUPIED'];
|
||||
//action 초기화
|
||||
$fields = array_keys($formDatas);
|
||||
$this->getFormService()->setFormFields($fields);
|
||||
$this->getFormService()->setFormRules('modify', $fields);
|
||||
$entity = $this->modify_process($serviceEntity->getServerInfoUID(), $formDatas);
|
||||
if (!$entity instanceof ServerEntity) {
|
||||
throw new \Exception(__METHOD__ . "에서 오류발생: Return Type은 ServerEntity만 가능합니다.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -220,4 +220,31 @@ class PaymentService extends CommonService
|
||||
$rows[$clientEntity->getPK()]['total_amount'] += $entity->getAmount();
|
||||
return $rows;
|
||||
}
|
||||
|
||||
//서비스추가시 결제정보 자동추가용
|
||||
public function attachToService(ServiceEntity $serviceEntity): void
|
||||
{
|
||||
//서버파트정보 생성
|
||||
$formDatas = [];
|
||||
$formDatas['serviceinfo_uid'] = $serviceEntity->getPK();
|
||||
$formDatas["clientinfo_uid"] = $serviceEntity->getClientInfoUID();
|
||||
$formDatas['user_uid'] = $this->getAuthContext()->getUID();
|
||||
$formDatas['title'] = sprintf(
|
||||
"%s %s 서비스비용",
|
||||
$serviceEntity->getClientInfoUID(),
|
||||
date("Y-m")
|
||||
);
|
||||
$formDatas['amount'] = $serviceEntity->getAmount();
|
||||
$formDatas['billing'] = PAYMENT['BILLING']['MONTH'];
|
||||
$formDatas['billing_at'] = $serviceEntity->getBillingAt();
|
||||
$formDatas['status'] = STATUS['UNPAID'];
|
||||
//action 초기화
|
||||
$fields = array_keys($formDatas);
|
||||
$this->getFormService()->setFormFields($fields);
|
||||
$this->getFormService()->setFormRules('create', $fields);
|
||||
$entity = $this->create_process($formDatas);
|
||||
if (!$entity instanceof PaymentEntity) {
|
||||
throw new \Exception(__METHOD__ . "에서 오류발생: Return Type은 PaymentEntity만 가능합니다.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user