Marquage des siren impossible à calculer juste avant le traitement
This commit is contained in:
parent
6762a4090d
commit
ca8668f3b0
@ -1,8 +1,8 @@
|
||||
<?php
|
||||
/*
|
||||
* Crontab
|
||||
* 00 20 * * 1-6 scores php /home/scores/batch/scripts/clients/SfrIndicateur.php --cron --load >> /home/scores/log/SfrIndicateur.log
|
||||
* 30 22 * * 1-6 scores php /home/scores/batch/scripts/clients/SfrIndicateur.php --cron --evaluate >> /home/scores/log/SfrIndicateur.log
|
||||
* 01 19 * * 1-6 scores php /home/scores/batch/scripts/clients/SfrIndicateur.php --cron --load >> /home/scores/log/SfrIndicateur.log
|
||||
* 01 00 * * 1-6 scores php /home/scores/batch/scripts/clients/SfrIndicateur.php --cron --evaluate >> /home/scores/log/SfrIndicateur.log
|
||||
*/
|
||||
error_reporting(E_ALL ^ E_STRICT ^ E_NOTICE ^ E_WARNING);
|
||||
|
||||
@ -252,7 +252,7 @@ if ($opts->load && !$opts->evaluate) {
|
||||
|
||||
//Marquer les SIREN qui n'existe pas dans la bdd
|
||||
echo date('Y-m-d H:i:s')." - Marquage des SIREN inexistant" . PHP_EOL;
|
||||
$sql = "UPDATE jo.sfr_data SET error=1020 WHERE NumSeq='".$seq."' AND siren NOT IN (SELECT DISTINCT siren FROM jo.etablissements_old)";
|
||||
$sql = "UPDATE jo.sfr_data SET error=1020 WHERE NumSeq='".$seq."' AND error=0 AND siren NOT IN (SELECT DISTINCT siren FROM jo.etablissements_old)";
|
||||
$result = $db->query($sql);
|
||||
|
||||
//Ajouter les SIREN valide qui ne sont pas en surveillance
|
||||
@ -261,9 +261,9 @@ if ($opts->load && !$opts->evaluate) {
|
||||
$result = $db->query($sql);
|
||||
|
||||
//Marquer les SIREN qui ne seront pas calculé
|
||||
echo date('Y-m-d H:i:s')." - Marquage des SIREN imposssible à calculer" . PHP_EOL;
|
||||
$sql = "UPDATE jo.sfr_data SET error=2020 WHERE NumSeq='".$seq."' AND siren IN (SELECT siren FROM jo.scores_surveillance WHERE naf='' OR CJ IS NULL OR dateCrea IS NULL OR indiScoreDate='0000-00-00')";
|
||||
$result = $db->query($sql);
|
||||
/*echo date('Y-m-d H:i:s')." - Marquage des SIREN imposssible à calculer" . PHP_EOL;
|
||||
$sql = "UPDATE jo.sfr_data SET error=2020 WHERE NumSeq='".$seq."' AND error=0 AND siren IN (SELECT siren FROM jo.scores_surveillance WHERE naf='' OR CJ IS NULL OR dateCrea IS NULL OR indiScoreDate='0000-00-00')";
|
||||
$result = $db->query($sql);*/
|
||||
}
|
||||
|
||||
}
|
||||
@ -312,6 +312,13 @@ if ( $opts->evaluate ) {
|
||||
//Génération des fichiers
|
||||
$db->setFetchMode(Zend_Db::FETCH_OBJ);
|
||||
|
||||
if ( $opts->cron ) {
|
||||
//Marquer les SIREN qui ne seront pas calculé
|
||||
echo date('Y-m-d H:i:s')." - Marquage des SIREN imposssible à calculer" . PHP_EOL;
|
||||
$sql = "UPDATE jo.sfr_data SET error=2020 WHERE NumSeq='".$seq."' AND error=0 AND siren IN (SELECT siren FROM jo.scores_surveillance WHERE naf='' OR CJ IS NULL OR dateCrea IS NULL OR indiScoreDate='0000-00-00')";
|
||||
$result = $db->query($sql);
|
||||
}
|
||||
|
||||
//Recherche des siren valides ainsi que leur scores
|
||||
$sql = 'SELECT sfr.siren, sfr.DateContrat, sfr.IR,' .
|
||||
' surv.actif, surv.procol, surv.naf, surv.CJ, surv.dateImmat, surv.dateCrea, surv.effectif, surv.indiScore20, surv.indiScoreDate, surv.dateUpdate' .
|
||||
@ -493,8 +500,8 @@ if ( $opts->evaluate ) {
|
||||
}
|
||||
fclose($fp);
|
||||
if ($fileErrorOptionsOut['encoding']) {
|
||||
exec("iconv -f UTF-8 -t ".$fileErrorOptionsOut['encoding']." -o ".$file.".enc ".$file);
|
||||
exec("mv -fv ".$file.".enc ".$file);
|
||||
passthru("iconv -f UTF-8 -t ISO-8859-15 ".$file." -o ".$file.".enc");
|
||||
passthru("cp -fv ".$file.".enc ".$file);
|
||||
}
|
||||
|
||||
$nbLines = $row;
|
||||
@ -594,8 +601,8 @@ if ( $opts->evaluate ) {
|
||||
|
||||
fclose($fp);
|
||||
if ($filePortefeuilleOptionsOut['encoding']) {
|
||||
exec("iconv -f UTF-8 -t ".$filePortefeuilleOptionsOut['encoding']." -o ".$file.".enc ".$file);
|
||||
exec("mv -fv ".$file.".enc ".$file);
|
||||
passthru("iconv -f UTF-8 -t ISO-8859-15 ".$file." -o ".$file.".enc");
|
||||
passthru("cp -fv ".$file.".enc ".$file);
|
||||
}
|
||||
|
||||
if ( $opts->cron ) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user