Ajout méthode getIndiscore, issue #0000379 - Retour de la méthode en tableau, non finalisé
This commit is contained in:
parent
f84d95820a
commit
95bc395703
@ -51,3 +51,4 @@ Type.49 = "RechercheAnnonceReturn"
|
||||
Type.50 = "RechercheAnnonceResult"
|
||||
Type.51 = "RechercheAnnonceCriteres"
|
||||
Type.52 = "RechercheAnnonce"
|
||||
Type.53 = "IndiscoreReturn"
|
@ -1610,3 +1610,116 @@ class RechercheAnnonce
|
||||
public $Annonce;
|
||||
}
|
||||
|
||||
class IndiscoreReturn
|
||||
{
|
||||
/** @var ErrorType */
|
||||
public $error;
|
||||
/** @var array */
|
||||
public $result;
|
||||
}
|
||||
|
||||
class Indiscore
|
||||
{
|
||||
public $id;
|
||||
public $Siret;
|
||||
public $Actif;
|
||||
public $AutreId;
|
||||
public $Nom;
|
||||
public $Sigle;
|
||||
public $Enseigne;
|
||||
public $Adresse;
|
||||
public $Adresse2;
|
||||
public $AdresseNum;
|
||||
public $AdresseBtq;
|
||||
public $AdresseVoie;
|
||||
public $AdresseRue;
|
||||
public $CP;
|
||||
public $Ville;
|
||||
public $Civilite;
|
||||
public $NbEtab;
|
||||
public $Tel;
|
||||
public $Fax;
|
||||
public $Web;
|
||||
public $Mail;
|
||||
public $FJ;
|
||||
public $FJ_lib;
|
||||
public $Siren;
|
||||
public $Nic;
|
||||
public $NafEtab;
|
||||
public $NafEnt;
|
||||
public $NafEntLib;
|
||||
public $Activite;
|
||||
public $Capital;
|
||||
public $CapitalDev;
|
||||
public $DateCreaEt;
|
||||
public $DateCreaEn;
|
||||
public $DateClotEt;
|
||||
public $EffEnTr;
|
||||
public $EffEnTrLib;
|
||||
public $Effectif;
|
||||
public $Dept;
|
||||
public $codeCommune;
|
||||
public $TrancheCA;
|
||||
public $TrancheCALib;
|
||||
public $dir1Titre;
|
||||
public $dir1NomPrenom;
|
||||
public $dir1DateFct;
|
||||
public $dir2Titre;
|
||||
public $dir2NomPrenom;
|
||||
public $dir2DateFct;
|
||||
public $Rivoli;
|
||||
public $NbBilansScore;
|
||||
public $Bilans;
|
||||
public $Note_Structure;
|
||||
public $Notes_Structure;
|
||||
public $Note_Financiere;
|
||||
public $Indiscore;
|
||||
public $Indiscore20;
|
||||
public $TendanceIndiscore;
|
||||
public $DevraitPublier;
|
||||
public $ScoreSolvabilite;
|
||||
public $AnalyseSolvabilite;
|
||||
public $ScoreDirigeance;
|
||||
public $AnalyseDirigeance;
|
||||
public $ScoreConfor;
|
||||
public $AnalyseConfor;
|
||||
public $LibSecteur;
|
||||
public $tabBilans;
|
||||
public $tabBilan;
|
||||
public $encours;
|
||||
public $encoursIni;
|
||||
public $encoursStat;
|
||||
public $infoEncours;
|
||||
public $infoPaiement;
|
||||
public $classeRisque;
|
||||
public $AdresseDom;
|
||||
public $scores;
|
||||
public $paiements;
|
||||
public $cs;
|
||||
public $csMoisMaj;
|
||||
public $csMoisFin;
|
||||
public $SituationJuridique;
|
||||
public $tabInfosNotations;
|
||||
public $tabImportExport;
|
||||
public $tabCommentaires;
|
||||
public $tabVariables;
|
||||
}
|
||||
|
||||
class Scores
|
||||
{
|
||||
public $ConanH;
|
||||
public $Afdcc1;
|
||||
public $Afdcc2;
|
||||
public $Afdcc2note;
|
||||
public $Z;
|
||||
public $Altman;
|
||||
public $AltmanCote;
|
||||
//public $36mois;
|
||||
public $CCF;
|
||||
public $NOTECAP; // Capitalisation
|
||||
public $NOTELED; // Levier Endettement
|
||||
public $NOTERBT; // Capa. Remboursement
|
||||
public $NOTECFI; // Couv. Charges Finan.
|
||||
public $NOTETRES; // Tresorerie
|
||||
public $NOTEMEX; // Marge Exploitation
|
||||
}
|
||||
|
@ -793,7 +793,6 @@ class WsEntreprise
|
||||
*/
|
||||
protected function getIndiScore($siren, $nic=0, $accesDist=true, $niveau=2)
|
||||
{
|
||||
//@todo
|
||||
//Authentification
|
||||
if (!$this->checkAuth($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW'], $_SERVER['REMOTE_ADDR']))
|
||||
{
|
||||
@ -806,25 +805,29 @@ class WsEntreprise
|
||||
if (empty($niveau)) { $niveau = 2; }
|
||||
if ( !in_array($niveau, array(0,1,2,3,4,5)) ) { $niveau = 2; }
|
||||
$error = new ErrorType();
|
||||
$tabRet = array();
|
||||
|
||||
debugLog('I',"IndiScore demandée pour $siren en niveau $niveau",__LINE__,__FILE__, __FUNCTION__, __CLASS__);
|
||||
$tabRet=array();
|
||||
|
||||
if (strlen($siren)>9 || (substr($siren,0,9)*1)<100 )
|
||||
{
|
||||
debugLog('W', "Siren $siren incorrect", __LINE__, __FILE__, __FUNCTION__, __CLASS__);
|
||||
$error->errnum = 102;
|
||||
$error->errmsg = 'Siren incorrect';
|
||||
}
|
||||
$tDeb = microtime(true);
|
||||
require_once 'Metier/scores/classMScores.php';
|
||||
$tabRet = calculIndiScore($siren, $nic, $accesDist, $niveau);
|
||||
$duree = round(microtime(true)-$tDeb,3);
|
||||
debugLog('W', "indiscore DUREE = $duree s", __LINE__, __FILE__, __FUNCTION__, __CLASS__);
|
||||
wsLog('indiscore',$siren);
|
||||
else
|
||||
{
|
||||
$tDeb = microtime(true);
|
||||
require_once 'Metier/scores/classMScores.php';
|
||||
$tabRet = calculIndiScore($siren, $nic, $accesDist, $niveau);
|
||||
$duree = round(microtime(true)-$tDeb,3);
|
||||
debugLog('W', "indiscore DUREE = $duree s", __LINE__, __FILE__, __FUNCTION__, __CLASS__);
|
||||
wsLog('indiscore',$siren);
|
||||
|
||||
|
||||
|
||||
return array('error'=>array('errnum'=>0, 'errmsg'=>''), 'result'=>$tabRet);
|
||||
}
|
||||
$output = new IndiscoreReturn();
|
||||
$output->error = $error;
|
||||
$output->result = $tabRet;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1342,6 +1345,7 @@ class WsEntreprise
|
||||
* @param string $siren
|
||||
* @param bool $detail
|
||||
* @param array $tabTypes
|
||||
* @return array
|
||||
*/
|
||||
protected function getPrivileges($siren, $detail=false, $tabTypes=array('03','04'))
|
||||
{
|
||||
@ -1352,18 +1356,28 @@ class WsEntreprise
|
||||
exit;
|
||||
}
|
||||
//Initialisation
|
||||
if (empty($detail)) $detail = false;
|
||||
if (empty($tabTypes)) $tabTypes = array('03','04');
|
||||
|
||||
$error = new ErrorType();
|
||||
|
||||
debugLog('I',"Liste des privilèges $detail sur $siren ".print_r($tabTypes, true),__LINE__,__FILE__, __FUNCTION__, __CLASS__);
|
||||
|
||||
$iPriv=new MPrivileges();
|
||||
$iPriv = new MPrivileges();
|
||||
if ($detail)
|
||||
$ret=$iPriv->getPrivilegesDetail($siren, $tabTypes);
|
||||
{
|
||||
$ret = $iPriv->getPrivilegesDetail($siren, $tabTypes);
|
||||
}
|
||||
else
|
||||
$ret=$iPriv->getPrivilegesCumul($siren, $tabTypes);
|
||||
{
|
||||
$ret = $iPriv->getPrivilegesCumul($siren, $tabTypes);
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Ajout d'une surveillance
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user