Line 73... |
Line 73... |
73 |
observation.setDateReleve(getValeurOuVide(observationJson, "date_observation"));
|
73 |
observation.setDateReleve(getValeurOuVide(observationJson, "date_observation"));
|
74 |
observation.setFamille(getValeurOuVide(observationJson, "determination.famille"));
|
74 |
observation.setFamille(getValeurOuVide(observationJson, "determination.famille"));
|
75 |
observation.setId(getValeurOuVide(observationJson, "id_observation"));
|
75 |
observation.setId(getValeurOuVide(observationJson, "id_observation"));
|
76 |
observation.setIdLocalite(getValeurOuVide(observationJson, "id_zone_geo"));
|
76 |
observation.setIdLocalite(getValeurOuVide(observationJson, "id_zone_geo"));
|
77 |
observation.setLocalite(getValeurOuVide(observationJson, "zone_geo"));
|
77 |
observation.setLocalite(getValeurOuVide(observationJson, "zone_geo"));
|
- |
|
78 |
|
- |
|
79 |
String nomRetenu = getValeurOuVide(observationJson, "determination.ns");
|
78 |
observation.setNomRetenu(getValeurOuVide(observationJson, "determination.ns"));
|
80 |
observation.setNomRetenu(getValeurOuVide(observationJson, "determination.ns"));
|
79 |
observation.setMilieu(getValeurOuVide(observationJson, "milieu"));
|
81 |
observation.setMilieu(getValeurOuVide(observationJson, "milieu"));
|
80 |
observation.setLieuDit(getValeurOuVide(observationJson, "lieudit"));
|
82 |
observation.setLieuDit(getValeurOuVide(observationJson, "lieudit"));
|
81 |
observation.setNumNomenclatural(getValeurOuVide(observationJson, "determination.nn"));
|
83 |
observation.setNumNomenclatural(getValeurOuVide(observationJson, "determination.nn"));
|
82 |
// TODO: renvoyer les mots clés des observations
|
84 |
// TODO: renvoyer les mots clés des observations
|
83 |
// observation.setMotsClefs(parserMotsCles(UtilitairesServiceResultat.getValeurOuVide(observationJson,
|
85 |
// observation.setMotsClefs(parserMotsCles(UtilitairesServiceResultat.getValeurOuVide(observationJson,
|
84 |
// "mots_cles_texte")));
|
86 |
// "mots_cles_texte")));
|
85 |
JSONValue propositions = observationJson.get("commentaires");
|
87 |
JSONValue propositions = observationJson.get("commentaires");
|
- |
|
88 |
|
- |
|
89 |
boolean creerPropositionAPartirObs = true;
|
Line 86... |
Line 90... |
86 |
|
90 |
|
87 |
if (propositions != null && propositions.isObject() != null) {
|
91 |
if (propositions != null && propositions.isObject() != null) {
|
88 |
List<InterventionForum> interventions = parserInterventions(propositions.isObject());
|
92 |
List<InterventionForum> interventions = parserInterventions(propositions.isObject());
|
89 |
for (InterventionForum interventionForum : interventions) {
|
93 |
for (InterventionForum interventionForum : interventions) {
|
- |
|
94 |
interventionForum.setObservation(observation);
|
- |
|
95 |
// Si une proposition avec le même nom retenu que l'observation est déjà présente,
|
- |
|
96 |
// alors il n'est pas nécessaire de créer la proposition "factice"
|
- |
|
97 |
if(interventionForum instanceof PropositionDetermination) {
|
- |
|
98 |
PropositionDetermination proposition = (PropositionDetermination)interventionForum;
|
- |
|
99 |
if(!nomRetenu.equals("") && proposition.getEspece().equals(nomRetenu)) {
|
- |
|
100 |
creerPropositionAPartirObs = false;
|
- |
|
101 |
}
|
90 |
interventionForum.setObservation(observation);
|
102 |
}
|
91 |
}
|
103 |
}
|
92 |
observation.setInterventionsForum(interventions);
|
104 |
observation.setInterventionsForum(interventions);
|
- |
|
105 |
}
|
- |
|
106 |
|
- |
|
107 |
if(creerPropositionAPartirObs) {
|
93 |
} else {
|
108 |
// Si elle est nécessaire, la proposition factice est ajoutée au début
|
94 |
observation.ajouterPropositionDetermination(creerPropositionDeterminationAPartirObservation(observation));
|
109 |
observation.getInterventionsForum().add(0, creerPropositionDeterminationAPartirObservation(observation));
|
95 |
}
|
110 |
}
|
96 |
return observation;
|
111 |
return observation;
|
Line 97... |
Line 112... |
97 |
}
|
112 |
}
|