dbms_init...1
This commit is contained in:
parent
5522f5f484
commit
50092c4686
@ -6,7 +6,6 @@ use App\Entities\Customer\ClientEntity;
|
|||||||
use App\Services\CommonService;
|
use App\Services\CommonService;
|
||||||
|
|
||||||
use App\Services\Customer\ClientService;
|
use App\Services\Customer\ClientService;
|
||||||
use App\Services\Customer\ServiceItemLink\ServiceItemIpService;
|
|
||||||
use App\Services\Equipment\DomainService;
|
use App\Services\Equipment\DomainService;
|
||||||
use App\Services\Equipment\ServerService;
|
use App\Services\Equipment\ServerService;
|
||||||
use App\Services\Equipment\Part\IpService;
|
use App\Services\Equipment\Part\IpService;
|
||||||
@ -66,7 +65,6 @@ abstract class CustomerService extends CommonService
|
|||||||
break;
|
break;
|
||||||
case 'IP':
|
case 'IP':
|
||||||
if (!array_key_exists($key, $this->_equipmentService)) {
|
if (!array_key_exists($key, $this->_equipmentService)) {
|
||||||
// $this->_equipmentService[$key] = new ServiceItemIpService();
|
|
||||||
$this->_equipmentService[$key] = new IpService();
|
$this->_equipmentService[$key] = new IpService();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -1,53 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Services\Customer\ServiceItemLink;
|
|
||||||
|
|
||||||
use App\Entities\Customer\ServiceItemEntity;
|
|
||||||
use App\Entities\Equipment\Part\IpEntity;
|
|
||||||
use App\Services\Equipment\Part\IpService;
|
|
||||||
|
|
||||||
class ServiceItemLinkIpService extends ServiceItemLinkService
|
|
||||||
{
|
|
||||||
private ?IpService $_ipService = null;
|
|
||||||
public function __construct(mixed $request = null)
|
|
||||||
{
|
|
||||||
parent::__construct($request);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getIpService(): IpService
|
|
||||||
{
|
|
||||||
if (!$this->_ipService) {
|
|
||||||
$this->_ipService = new IpService($this->request);
|
|
||||||
}
|
|
||||||
return $this->_ipService;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getFormFieldOption(string $field, array $options = []): array
|
|
||||||
{
|
|
||||||
return $this->getIpService()->getEntities();
|
|
||||||
}
|
|
||||||
|
|
||||||
public function create(array $formDatas, mixed $entity = null): ServiceItemEntity
|
|
||||||
{
|
|
||||||
//ip의 경우 서비스중으로 설정작업
|
|
||||||
$this->getIpService()->setStatus($formDatas['item_uid'], IpEntity::STATUS_OCCUPIED);
|
|
||||||
return parent::create($formDatas, $entity);;
|
|
||||||
}
|
|
||||||
public function modify(mixed $entity, array $formDatas): ServiceItemEntity
|
|
||||||
{
|
|
||||||
//item_uid가 기존과 다를경우 //toggle,batchjob의 경우 $formDatas에 item_uid가 없을수도 있음
|
|
||||||
if (array_key_exists('item_uid', $formDatas) && $formDatas['item_uid'] !== $entity->getItemUid()) {
|
|
||||||
//item_uid의 경우 기존item_uid는 사용가능으로 설정작업
|
|
||||||
$this->getIpService()->setStatus($entity->getItemUid(), IpEntity::STATUS_AVAILABLE);
|
|
||||||
//item_uidd의 경우 변경된 item_uid는 서비스중으로 설정작업
|
|
||||||
$this->getIpService()->setStatus($formDatas['item_uid'], IpEntity::STATUS_OCCUPIED);
|
|
||||||
}
|
|
||||||
return parent::modify($entity, $formDatas);
|
|
||||||
}
|
|
||||||
public function delete(mixed $entity): bool
|
|
||||||
{
|
|
||||||
//item_uid의 경우 기존item_uid는 사용가능으로 설정작업
|
|
||||||
$this->getIpService()->setStatus($entity->getItemUid(), IpEntity::STATUS_AVAILABLE);
|
|
||||||
return parent::delete($entity);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,13 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Services\Customer\ServiceItemLink;
|
|
||||||
|
|
||||||
use App\Services\Customer\ServiceItemService;
|
|
||||||
|
|
||||||
abstract class ServiceItemLinkService extends ServiceItemService
|
|
||||||
{
|
|
||||||
public function __construct(mixed $request = null)
|
|
||||||
{
|
|
||||||
parent::__construct($request);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue
Block a user