DBCFX_RU_372 - GATEWAY DBCFX : DBCFXGO ordinamento viste uscite del. 82
This commit is contained in:
@@ -186,9 +186,17 @@ public class RichiesteD82Bean implements Serializable{
|
|||||||
if (criterion.isEmpty()) {
|
if (criterion.isEmpty()) {
|
||||||
listaTestate = testataDAO.findAll();
|
listaTestate = testataDAO.findAll();
|
||||||
testataSize = listaTestate.size();
|
testataSize = listaTestate.size();
|
||||||
|
// DBCFX_RU_372 - GATEWAY DBCFX : DBCFXGO ordinamento viste uscite del. 82
|
||||||
|
if(testataSize>=2){
|
||||||
|
Collections.sort(listaTestate, new DataOrdineComparator());
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
listaTestate = testataDAO.findByCriteria(criterion);
|
listaTestate = testataDAO.findByCriteria(criterion);
|
||||||
testataSize = listaTestate.size();
|
testataSize = listaTestate.size();
|
||||||
|
// DBCFX_RU_372 - GATEWAY DBCFX : DBCFXGO ordinamento viste uscite del. 82
|
||||||
|
if(testataSize>=2){
|
||||||
|
Collections.sort(listaTestate, new DataOrdineComparator());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -240,13 +248,30 @@ public class RichiesteD82Bean implements Serializable{
|
|||||||
}
|
}
|
||||||
richiesteSize = 0;
|
richiesteSize = 0;
|
||||||
|
|
||||||
|
|
||||||
if (listaTestate != null) {
|
if (listaTestate != null) {
|
||||||
listaTestate.clear();
|
listaTestate.clear();
|
||||||
}
|
}
|
||||||
testataSize = 0;
|
testataSize = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***
|
||||||
|
* DBCFX_RU_372 - GATEWAY DBCFX : DBCFXGO ordinamento viste uscite del. 82
|
||||||
|
* Classe Comparator per l'ordinamento DataOrdine GnpgoGestioneRichiesteD82
|
||||||
|
* */
|
||||||
|
class DataOrdineComparator implements Comparator{
|
||||||
|
|
||||||
|
public int compare(Object arg0, Object arg1) {
|
||||||
|
GnpgoGestioneRichiesteD82 richiesta1 = (GnpgoGestioneRichiesteD82) arg0;
|
||||||
|
GnpgoGestioneRichiesteD82 richiesta2 = (GnpgoGestioneRichiesteD82) arg1;
|
||||||
|
if(richiesta1.getDataCreazione().after(richiesta2.getDataCreazione())){
|
||||||
|
return -1;
|
||||||
|
}else if (richiesta1.getDataCreazione().before(richiesta2.getDataCreazione())){
|
||||||
|
return 1;
|
||||||
|
}else
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user