236 |
236 |
|
237 |
237 |
Date _dateTo = format.parse(dateTo);
|
238 |
238 |
|
239 |
|
String last_interaction_date = (format.format(notification.getDate()));
|
|
239 |
Date _last_interaction_date = notification.getDate();
|
|
240 |
Calendar cal = Calendar.getInstance();
|
|
241 |
cal.setTime(_last_interaction_date);
|
|
242 |
cal.add(Calendar.SECOND, 1);
|
|
243 |
_last_interaction_date = cal.getTime();
|
240 |
244 |
|
|
245 |
String last_interaction_date = (format.format(_last_interaction_date));
|
|
246 |
|
241 |
247 |
long diff = _dateTo.getTime() - notification.getDate().getTime();
|
242 |
248 |
diff = diff / 1000;
|
243 |
249 |
|
... | ... | |
252 |
258 |
|
253 |
259 |
//send(project.getOpenaireId(), project.getName(), "project", managersByNotification);
|
254 |
260 |
}
|
255 |
|
Calendar cal = Calendar.getInstance();
|
|
261 |
/*Calendar cal = Calendar.getInstance();
|
256 |
262 |
cal.setTime(_dateTo);
|
257 |
263 |
cal.add(Calendar.SECOND, 1);
|
258 |
|
_dateTo = cal.getTime();
|
|
264 |
_dateTo = cal.getTime();*/
|
259 |
265 |
notificationHandler.updateNotificationLastInteractionDate(notification.getOpenaireId(), notification.getUserMail(), _dateTo);
|
260 |
266 |
//update last interaction date (db)
|
261 |
267 |
}
|
... | ... | |
295 |
301 |
if(managers != null && managers.contains(notification.getUserMail())) {
|
296 |
302 |
Date _dateTo = format.parse(dateTo);
|
297 |
303 |
|
298 |
|
String last_interaction_date = (format.format(notification.getDate()));
|
|
304 |
Date _last_interaction_date = notification.getDate();
|
|
305 |
Calendar cal = Calendar.getInstance();
|
|
306 |
cal.setTime(_last_interaction_date);
|
|
307 |
cal.add(Calendar.SECOND, 1);
|
|
308 |
_last_interaction_date = cal.getTime();
|
|
309 |
|
|
310 |
String last_interaction_date = (format.format(_last_interaction_date));
|
299 |
311 |
long diff = _dateTo.getTime() - notification.getDate().getTime();
|
300 |
312 |
diff = diff / 1000;
|
301 |
|
//if dateTo - last_interaction_date >= notification.getFrequency//last_interaction_date.compareTo(dateFrom) == -1 &&
|
302 |
313 |
|
303 |
314 |
if (diff >= (notification.getFrequency() * 3600)) {
|
304 |
315 |
if (fetchClaimHandler.fetchNumberOfClaimsByDateAndOpenaireId(last_interaction_date, dateTo, notification.getOpenaireId(), null, null, "", "source", true, types, false) > 0) {
|
... | ... | |
312 |
323 |
|
313 |
324 |
//send(context.getOpenaireId().split("::")[0], context.getTitle().split(">")[0], "community", managersByNotification);
|
314 |
325 |
}
|
315 |
|
Calendar cal = Calendar.getInstance();
|
|
326 |
/*Calendar cal = Calendar.getInstance();
|
316 |
327 |
cal.setTime(_dateTo);
|
317 |
328 |
cal.add(Calendar.SECOND, 1);
|
318 |
|
_dateTo = cal.getTime();
|
|
329 |
_dateTo = cal.getTime();*/
|
319 |
330 |
notificationHandler.updateNotificationLastInteractionDate(notification.getOpenaireId(), notification.getUserMail(), _dateTo);
|
320 |
331 |
//update last interaction date (db)
|
321 |
332 |
}
|
NotificationHandler.java & EmailSender.java: bug fix in calculating seconds (store 12:00 and add 1 sec to last_interaction_date when sending email).