Adicionado a tabela de partição do GED

This commit is contained in:
Kenio 2025-09-08 15:50:10 -03:00
parent 29bcfabc70
commit 7c6b9ce672
2 changed files with 14 additions and 8 deletions

View file

@ -84,6 +84,9 @@ try {
/** Exclui antigas unidades */
$StationDisk->Delete($clientId);
/** Exclui as antigas pastas */
$StationFolder->Delete($clientId);
/** Exclui todas as estações de um determinado cliente */
$Station->Delete($clientId);
@ -158,9 +161,6 @@ try {
}
}
/** Exclui as antigas pastas */
$StationFolder->Delete($stationId);
// Percorre a pasta Ged
foreach ($jsonLog->ged as $path => $details) {
@ -173,6 +173,7 @@ try {
/** Grava uma nova pasta ou atualiza o atual */
if (!$StationFolder->Save(
0,
$clientId,
$stationId,
$path,
$value,

View file

@ -177,6 +177,7 @@ class StationFolder
/** Insere um novo registro no banco */
public function Save(? int $stationFolderId,
? int $clientId,
? int $stationId,
? string $folderPath,
? int $amountOfFiles,
@ -186,6 +187,7 @@ class StationFolder
/** Parametros */
$this->stationFolderId = $stationFolderId;
$this->clientId = $clientId;
$this->stationId = $stationId;
$this->folderPath = $folderPath;
$this->amountOfFiles = $amountOfFiles;
@ -232,10 +234,12 @@ class StationFolder
}else{//Se o ID não foi informado, grava-se um novo registro
/** Consulta SQL */
$this->sql = 'insert into station_folder(station_id,
$this->sql = 'insert into station_folder(station_id,
client_id,
folder_path,
amount_of_files
) values (:station_id,
:client_id,
:folder_path,
:amount_of_files)';
@ -248,6 +252,7 @@ class StationFolder
$this->connection->connect()->beginTransaction();
/** Preencho os parâmetros do SQL */
$this->stmt->bindParam('client_id', $this->clientId);
$this->stmt->bindParam('station_id', $this->stationId);
$this->stmt->bindParam('folder_path', $this->folderPath);
$this->stmt->bindParam('amount_of_files', $this->amountOfFiles);
@ -289,20 +294,20 @@ class StationFolder
}
/** Deleta um determinado registro no banco de dados */
function Delete(int $stationId)
function Delete(int $clientId)
{
/** Parametros de entrada */
$this->stationId = $stationId;
$this->clientId = $clientId;
/** Consulta SQL */
$this->sql = 'delete from station_folder
where station_id = :station_id';
where client_id = :client_id';
/** Preparo o sql para receber os valores */
$this->stmt = $this->connection->connect()->prepare($this->sql);
/** Preencho os parâmetros do SQL */
$this->stmt->bindParam(':station_id', $this->stationId);
$this->stmt->bindParam(':client_id', $this->clientId);
/** Executo o SQL */
return $this->stmt->execute();