19 package org.turro.documentation;
21 import java.util.stream.Stream;
22 import org.turro.action.MailSenders;
23 import org.turro.action.PushSenders;
24 import org.turro.attach.db.AttachPU;
25 import org.turro.attach.entity.EntityDocumentation;
26 import org.turro.attach.entity.EntityDocumentationStatus;
27 import org.turro.i18n.I_;
28 import org.turro.scheduler.task.AbstractTask;
29 import org.turro.sql.SqlClause;
30 import org.turro.time.Time;
31 import org.turro.util.Converter;
41 Time time = Time.now().addDays((Converter.STANDARD.convert(
getSettings().getData(), Long.class)));
42 try(Stream<EntityDocumentation> documentation = SqlClause.select(
"d").from(
"EntityDocumentation d")
43 .where().isNotNull(
"deadline")
44 .and().smallerOrEqual(
"deadline", time.getDate())
48 documentation.forEach((ed) -> {
51 .addContact(ed.getRequester())
52 .send(I_.get(
"Documentation"), I_.get(
"Pending to validate"), ed.getEntity().getEntityUrl());
53 MailSenders.getPool().setRoot(
"/documentation")
55 .addContact(ed.getRequester())
56 .silentSendTemplate(ed,
"uploaded", I_.get(
"Pending to validate"));
59 .addContact(ed.getContact())
60 .addContact(ed.getRequester())
61 .send(I_.get(
"Documentation"), I_.get(
"Pending upload documents"), ed.getEntity().getEntityUrl());
62 MailSenders.getPool().setRoot(
"/documentation")
63 .addContact(ed.getContact())
64 .addContact(ed.getRequester())
65 .silentSendTemplate(ed,
"required", I_.get(
"Pending upload documents"));
78 return I_.
get(
"Documentation deadline check");
83 return "Days before deadline";
static String get(String msg)
TaskSettings getSettings()
static List< EntityDocumentationStatus > pendingStatusList()