我需要帮助,我有一个对象数组列表。该对象包含多个字段,我对此问题感兴趣的两个日期字段(date_panne date_mise and running)
和两个其他时间字段(heure_panne and time start)
,并且我想获得两者之间的差异总和,(date_panne, heure_panne)
并(date_mise_en_marche; heure_mise_en_marche)
给出失败的总时间。如果有人可以帮助我,我将不胜感激这是我的功能:
public String disponibile() throws Exception {
int nbreArrets = 0;
List<Intervention> allInterventions = interventionDAO.fetchAllIntervention();
List<Intervention> listInterventions = new ArrayList<Intervention>();
for (Intervention currentIntervention : allInterventions) {
if (currentIntervention.getId_machine() == this.intervention.getId_machine()
&& currentIntervention.getDate_panne().compareTo(getProductionStartDate()) >= 0
&& currentIntervention.getDate_panne().compareTo(getProductionEndDate()) <= 0) {
listInterventions.add(currentIntervention);
}
}
savedInterventionList = listInterventions;
return "successView" ;
}