181,8 → 181,7 |
String courriel = getValeurOuVide(jsonIntervention, "auteur.courriel"); |
Contributeur contributeur = new Contributeur(idUtilisateur, nom, prenom, courriel); |
|
// TODO : parser date |
Date date = new Date(); |
Date date = parserDateObservation(getValeurOuVide(jsonIntervention, "date")); |
|
if (!nomSel.equals("")) { |
String nom_sel = getValeurOuVide(jsonIntervention, "nom_sel"); |
304,7 → 303,7 |
JSONObject vote = votes.get(itVotes.next()).isObject(); |
VoteDetermination vd = new VoteDetermination(); |
vd.setContributeur(getValeurOuVide(vote, "auteur.id")); |
vd.setDate(new Date()); |
vd.setDate(parserDateObservation(getValeurOuVide(vote, "date"))); |
vd.setId(getValeurOuVide(vote, "vote.id")); |
vd.setVote(Integer.parseInt(getValeurOuVide(vote, "vote"))); |
vd.setContributeur(getValeurOuVide(vote, "auteur.id")); |
339,7 → 338,7 |
VoteProtocole vd = new VoteProtocole(); |
vd.setContributeur(voteEnCours.get("auteur.id").isString().stringValue()); |
// TODO récupérer la date du vote et la parser |
vd.setDate(new Date()); |
vd.setDate(parserDateObservation(getValeurOuVide(voteEnCours, "date"))); |
int valeurVote = Integer.parseInt(voteEnCours.get("vote").isString().stringValue()); |
vd.setVote(valeurVote); |
if (!votesProtocoles.containsKey(idProtocoleVote)) { |
360,7 → 359,7 |
*/ |
public static Date parserDateObservation(String date) { |
Date dateParsee = new Date(); |
DateTimeFormat formatDateObs = DateTimeFormat.getFormat("dd/MM/yyyy"); |
DateTimeFormat formatDateObs = DateTimeFormat.getFormat("yyyy-MM-dd HH:mm:ss"); |
try { |
dateParsee = formatDateObs.parse(date); |
} catch (IllegalArgumentException e) { |