Subversion Repositories eFlore/Applications.del

Rev

Rev 602 | Rev 658 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 602 Rev 629
Line 69... Line 69...
69
		propositionDetermination.setEspece(observationJson.get("nom_ret").isString().stringValue());
69
		propositionDetermination.setEspece(observationJson.get("nom_ret").isString().stringValue());
Line 70... Line 70...
70
		
70
		
71
		return propositionDetermination;
71
		return propositionDetermination;
Line 72... Line 72...
72
	}
72
	}
Line 73... Line 73...
73
	
73
	
74
	public static Map<String, List<VoteProtocole>> parserVotesProtocoles(JSONArray votes) {
74
	public static HashMap<String, HashMap<String,VoteProtocole>> parserVotesProtocoles(JSONArray votes) {
75
		
75
		
76
		int nbVotes = votes.size();
76
		int nbVotes = votes.size();
77
		Map<String, List<VoteProtocole>> votesProtocoles = new HashMap<String, List<VoteProtocole>>();
77
		HashMap<String, HashMap<String,VoteProtocole>> votesProtocoles = new HashMap<String, HashMap<String,VoteProtocole>>();
Line 78... Line 78...
78
		for (int j = 0; j < nbVotes; j++) {
78
		for (int j = 0; j < nbVotes; j++) {
Line 84... Line 84...
84
			vd.setDate(new Date());
84
			vd.setDate(new Date());
85
			int valeurVote = Math.round((int)vote.get("vote").isNumber().doubleValue());
85
			int valeurVote = Math.round((int)vote.get("vote").isNumber().doubleValue());
86
			vd.setVote(valeurVote);
86
			vd.setVote(valeurVote);
Line 87... Line 87...
87
			
87
			
88
			if(!votesProtocoles.containsKey(idProtocoleVote)) {
88
			if(!votesProtocoles.containsKey(idProtocoleVote)) {
89
				votesProtocoles.put(idProtocoleVote, new ArrayList<VoteProtocole>());
89
				votesProtocoles.put(idProtocoleVote, new HashMap<String,VoteProtocole>());
90
			}
90
			}
91
			votesProtocoles.get(idProtocoleVote).add(vd);
91
			votesProtocoles.get(idProtocoleVote).put(vd.getContributeur(), vd);
Line 92... Line 92...
92
		}
92
		}
93
		
93