* deploy script updated

* xsl parser year updated
* tree type switched from closure table to nested set
This commit is contained in:
Danyi Dávid 2018-11-17 22:42:01 +01:00
parent 8f843a8194
commit 99c10e94e1
4 changed files with 42 additions and 42 deletions

View File

@ -7,7 +7,7 @@ set('ssh_multiplexing', true);
// Configuration // Configuration
set('repository', 'ssh://gogs@gogs.ragnarok.yvan.hu:2206/Laterex/webnaplo-gul-api.git'); set('repository', 'ssh://gogs@gogs.ragnarok.yvan.hu:2206/Laterex/webnaplo-gulbaba-api.git');
set('shared_files', [ set('shared_files', [
'config/autoload/local.php', 'config/autoload/local.php',
'config/autoload/doctrine.local.php', 'config/autoload/doctrine.local.php',
@ -27,12 +27,12 @@ set('default_stage', 'production');
host('lxuz.hu') host('lxuz.hu')
->stage('production') ->stage('production')
->user('latuzcs_beik_api_access') ->user('benkeg_gulbaba_api_access')
->forwardAgent() ->forwardAgent()
->set('bin/php', '/usr/bin/php7.1') ->set('bin/php', '/usr/bin/php7.1')
->set('bin/composer', '{{bin/php}} /var/www/clients/client5/web20/bin/composer') ->set('bin/composer', '{{bin/php}} /var/www/clients/client4/web38/bin/composer')
->set('php_service_name', 'php7.1-fpm') ->set('php_service_name', 'php7.1-fpm')
->set('deploy_path', '/var/www/clients/client5/web20/deploy'); ->set('deploy_path', '/var/www/clients/client4/web38/deploy');
// Tasks // Tasks

View File

@ -2,14 +2,14 @@
namespace App\Entity; namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo; use Gedmo\Mapping\Annotation as Gedmo;
use JsonSerializable; use JsonSerializable;
/** /**
* @Gedmo\Tree(type="closure") * @Gedmo\Tree(type="nested")
* @Gedmo\TreeClosure(class="App\Entity\FacilityLocationClosure") * @ORM\Entity(repositoryClass="Gedmo\Tree\Entity\Repository\NestedTreeRepository")
* @ORM\Entity(repositoryClass="Gedmo\Tree\Entity\Repository\ClosureTreeRepository")
* @ORM\Table( * @ORM\Table(
* name="facility_locations", * name="facility_locations",
* indexes={ * indexes={
@ -54,18 +54,38 @@ class FacilityLocation implements JsonSerializable
*/ */
private $level; private $level;
/**
* @Gedmo\TreeLeft
* @ORM\Column(name="lft", type="integer")
*/
private $lft;
/**
* @Gedmo\TreeRight
* @ORM\Column(name="rgt", type="integer")
*/
private $rgt;
/**
* @Gedmo\TreeRoot
* @ORM\ManyToOne(targetEntity="FacilityLocation")
* @ORM\JoinColumn(name="tree_root", referencedColumnName="id", onDelete="CASCADE")
*/
private $root;
/** /**
* @Gedmo\TreeParent * @Gedmo\TreeParent
* @ORM\JoinColumn(referencedColumnName="id", onDelete="CASCADE") * @ORM\JoinColumn(name="parent_id", referencedColumnName="id", onDelete="CASCADE")
* @ORM\ManyToOne(targetEntity="FacilityLocation", inversedBy="children") * @ORM\ManyToOne(targetEntity="FacilityLocation", inversedBy="children")
* @var FacilityLocation * @var FacilityLocation
*/ */
private $parent; private $parent;
/** /**
* @var FacilityLocationClosure[] * @ORM\OneToMany(targetEntity="FacilityLocation", mappedBy="parent")
* @ORM\OrderBy({"lft" = "ASC"})
*/ */
private $closures = []; private $children;
/** /**
* @ORM\Column(name="active", type="boolean", options={"default": true}) * @ORM\Column(name="active", type="boolean", options={"default": true})
@ -73,6 +93,11 @@ class FacilityLocation implements JsonSerializable
*/ */
private $active = true; private $active = true;
public function __construct()
{
$this->children = new ArrayCollection();
}
/** /**
* @return int * @return int
*/ */
@ -153,16 +178,6 @@ class FacilityLocation implements JsonSerializable
return $this->level; return $this->level;
} }
/**
* @param mixed $level
* @return FacilityLocation
*/
public function setLevel($level)
{
$this->level = $level;
return $this;
}
/** /**
* @return mixed * @return mixed
*/ */
@ -182,11 +197,11 @@ class FacilityLocation implements JsonSerializable
} }
/** /**
* @param FacilityLocationClosure $closure * @return FacilityLocation[]|ArrayCollection
*/ */
public function addClosure(FacilityLocationClosure $closure) public function getChildren(): ?ArrayCollection
{ {
$this->closures[] = $closure; return $this->children;
} }
/** /**

View File

@ -1,15 +0,0 @@
<?php
namespace App\Entity;
use Gedmo\Tree\Entity\MappedSuperclass\AbstractClosure;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Table(name="facility_locations__closure")
*/
class FacilityLocationClosure extends AbstractClosure
{
}

View File

@ -12,7 +12,7 @@ class XlsxParserService
{ {
const XLSX_SHEET_NAME = "karbantartás"; const XLSX_SHEET_NAME = "karbantartás";
const XLSX_TIMESTAMP = 'data/cache/xlsx-lastmod_%s.dat'; const XLSX_TIMESTAMP = 'data/cache/xlsx-lastmod_%s.dat';
const XLSX_FILE_NAME = 'data/user-upload/beik%s.xlsx'; const XLSX_FILE_NAME = 'data/user-upload/webnaplo_%s.xlsx';
const XLSX_CACHE_FILE = 'data/cache/xlsx-full-cache_%s.dat'; const XLSX_CACHE_FILE = 'data/cache/xlsx-full-cache_%s.dat';
/** /**
@ -31,8 +31,8 @@ class XlsxParserService
public function __construct() public function __construct()
{ {
$this->deviceGroups = new ArrayCollection(); $this->deviceGroups = new ArrayCollection();
// $this->year = date("Y"); $this->year = date("Y");
$this->year = 2018; // $this->year = 2018;
} }
/** /**
@ -99,7 +99,7 @@ class XlsxParserService
$sheet = $objPHPExcel->getSheetByName(self::XLSX_SHEET_NAME); $sheet = $objPHPExcel->getSheetByName(self::XLSX_SHEET_NAME);
$totalRows = $sheet->getHighestRow(); $totalRows = $sheet->getHighestRow();
$monthColumns = $this->year == 2017 $monthColumns = $this->year == 2018
? range(43, 58) ? range(43, 58)
: range(11, 58); : range(11, 58);
$rowCursor = 7; $rowCursor = 7;