1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
|
String[] heurJour={"05:00","05:15","05:30","05:45","06:00","06:15","06:30","06:45","07:00","07:15","07:30","07:45","08:00","08:15","08:30","08:45","09:00","09:15","09:30","09:45","10:00","10:15","10:30","10:45","11:00","11:15","11:30","11:45","12:00","12:15","12:30","12:45","13:00","13:15","13:30","13:45","14:00","14:15","14:30","14:45","15:00","15:15","15:30","15:45","16:00","16:15","16:30","16:45","17:00","17:15","17:30","17:45","18:00","18:15","18:30","18:45","19:00","19:15","19:30","19:45","20:00","20:15","20:30","20:45","21:00","21:15","21:30","21:45","22:00","22:15","22:30","22:45","23:00","23:15","23:30","23:45","24:00"};
......
for (JourDTO mapKey : hashMap.keySet()) {
//Horaire de Debut du salarié
String getDebutHoraire = ""+mapKey.getDebutHoraire();
String HeureDebutAdecoupe[] = getDebutHoraire.split(":");
String heureDebutTravail = HeureDebutAdecoupe[0];
String minuteDebutTravail = HeureDebutAdecoupe[1];
String heureTravailDebut = heureDebutTravail+":"+minuteDebutTravail;
//Horaire de Fin Debut du salarié
String getFinHoraire = ""+mapKey.getFinHoraire();
String HeureFintAdecoupe[] = getFinHoraire.split(":");
String heureFinTravail = HeureFintAdecoupe[0];
String minuteFinTravail = HeureFintAdecoupe[1];
String heureTravailFin = heureFinTravail+":"+minuteFinTravail;
//Horaire Tableau
String HeureTableauAdecoupe[] = heurJour[i].split(":");
String heureTableau = HeureTableauAdecoupe[0];
String minuteTableau = HeureTableauAdecoupe[1];
//int heure début
int intHeureDebut = Integer.parseInt(heureDebutTravail);
int intMinuteDebut = Integer.parseInt(minuteDebutTravail);
//int heure fin
int intHeureFin = Integer.parseInt(heureFinTravail);
int intMinuteFin = Integer.parseInt(minuteFinTravail);
// int heure tableau
int intHeureTableau = Integer.parseInt(heureTableau);
int intMinuteTableau = Integer.parseInt(minuteTableau);
//Affichage Tableau
if(intHeureDebut == intHeureTableau){
if(intMinuteDebut == intMinuteTableau){
%>
<td style="text-align: center; vertical-align: center;"> <%=heureTravailDebut%> </td>
<%
c = true;
b = true;
break;
//Affichage heure fin
}
}else if(intHeureFin == intHeureTableau){
if(intMinuteFin == intMinuteTableau){
%>
<td style="text-align: center; vertical-align: center;"> <%=heureTravailFin%> </td>
<%
c = true;
b = true;
break;
}
} if(intHeureTableau >= intHeureDebut && intHeureTableau < intHeureFin){
if((intHeureTableau == intHeureDebut && intMinuteTableau >= intMinuteDebut) ||
(intHeureTableau == intHeureFin && intMinuteTableau >= intMinuteFin)||
(intHeureTableau >= intHeureDebut && intHeureTableau <= intHeureFin)){
%>
<td style="text-align: center; vertical-align: center; background-color: #E8B866;"> <%=intMinuteTableau%> - <%=intMinuteDebut%> - <%=intMinuteFin%> </td>
<%
c = true;
b = true;
break;
}
}else{
b = false;
}
} |
Partager