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 76 77 78
|
public void retardInventaire(ResultSet rs, MiniTable input,MiniTable abs,int j,Time lastday,Heures lasthour)
{
SimpleDateFormat form= new SimpleDateFormat("dd/MM/yyyy");
Vector vect= new Vector(12);
try{
Heure retard= null;
int i=0;
while (rs.getDate(1).equals(input.getValueAt(i,1)))
i++;
/**
* h1 heure entrée*/
java.sql.Time t = rs.getTime(3);
Heures h1 = new Heures(t.getHours(),t.getMinutes(),t.getSeconds());
//java.util.Date t2 =new java.util.Date();
/**
* h3 heure début pause régime*/
t.setTime(((Time)input.getValueAt(i,5)).getTime());/////////////////////////Là ça marche
Heures h3=new Heures(t.getHours(),t.getMinutes(),t.getSeconds());
/*quand il s'agit de 1ère séance*/
if(h1.before(h3))
{ /**
* h2 heure début 1ère séance régime*/
t.setTime(((Time)input.getValueAt(i,4)).getTime());/////////////////////////Là aussi ça marche
Heures h2=new Heures(t.getHours(),t.getMinutes(),t.getSeconds());
/*quand il s'agit d'un retard à l'arrivée*/
if (h1.after(h2))
{
retard = Heures.minus(h1,h2);
}
}
/*quand il s'agit de la 2ième séance*/
else
{ /**
* h4 heure fin pause régime*/
t.setTime(((Time)input.getValueAt(i,6)).getTime());//////////////////Là ça marche pas!!!!!!!!!!!!!!!
Heures h4=new Heures(t.getHours(),t.getMinutes(),t.getSeconds());
/*quand il s'agit de deux séances par jour*/
if (h1.after(h3) && h1.before(h4))
{
if (test)
{
traitement
}
else
{
traitement
}
}
else if (h1.after(h4))
{
retard = Heure.addition(retard,Heures.minus(h1,h4));
}
}
traitement
}
catch (Exception e)
{
e.printStackTrace();
}
} |
Partager