◆ AgreementsUtil() [1/2]
org.turro.agreements.AgreementsUtil.AgreementsUtil |
( |
IContact |
contact | ) |
|
◆ AgreementsUtil() [2/2]
org.turro.agreements.AgreementsUtil.AgreementsUtil |
( |
String |
idContact | ) |
|
◆ canAccess()
boolean org.turro.agreements.AgreementsUtil.canAccess |
( |
| ) |
|
Definition at line 82 of file AgreementsUtil.java.
83 return getSignatures(
null).stream().noneMatch((as) -> (as.getAgreement().isRequiredToAccess() && !as.doesAgree()));
List< AgreementSignature > getSignatures(String action)
◆ canAct()
boolean org.turro.agreements.AgreementsUtil.canAct |
( |
String |
action | ) |
|
Definition at line 86 of file AgreementsUtil.java.
87 return getSignatures(action).stream().noneMatch((as) -> (as.getAgreement().isRequiredToAction() && action.equals(as.getAgreement().getAction()) && !as.doesAgree()));
◆ canNotify()
boolean org.turro.agreements.AgreementsUtil.canNotify |
( |
| ) |
|
◆ declinedAccessing()
boolean org.turro.agreements.AgreementsUtil.declinedAccessing |
( |
| ) |
|
Definition at line 94 of file AgreementsUtil.java.
95 return getSignatures(
null).stream().anyMatch((as) -> (as.getAgreement().isRequiredToAccess() && as.isSigned() && !as.isAgreed()));
◆ declinedActing()
boolean org.turro.agreements.AgreementsUtil.declinedActing |
( |
String |
action | ) |
|
Definition at line 98 of file AgreementsUtil.java.
99 return getSignatures(action).stream().anyMatch((as) -> (as.getAgreement().isRequiredToAction() && action.equals(as.getAgreement().getAction()) && as.isSigned() && !as.isAgreed()));
◆ declinedNotifications()
boolean org.turro.agreements.AgreementsUtil.declinedNotifications |
( |
| ) |
|
Definition at line 90 of file AgreementsUtil.java.
91 return getSignatures(
null).stream().anyMatch((as) -> (as.getAgreement().isRequiredToNotify() && as.isSigned() && !as.isAgreed()));
◆ deleteAgreement()
static boolean org.turro.agreements.AgreementsUtil.deleteAgreement |
( |
Agreement |
agreement | ) |
|
|
static |
Definition at line 46 of file AgreementsUtil.java.
47 if(agreement !=
null && agreement.getSignatures().isEmpty()) {
48 new ElephantPU().deleteObject(agreement);
◆ getAgreements()
static List<Agreement> org.turro.agreements.AgreementsUtil.getAgreements |
( |
| ) |
|
|
static |
Definition at line 40 of file AgreementsUtil.java.
41 WhereClause wc =
new WhereClause();
42 wc.addClause(
"select a from Agreement a");
43 return new ElephantPU().getResultList(wc);
◆ getContact()
IContact org.turro.agreements.AgreementsUtil.getContact |
( |
| ) |
|
◆ getNotSigned()
◆ getPeremptories()
◆ getSignatures()
List<AgreementSignature> org.turro.agreements.AgreementsUtil.getSignatures |
( |
String |
action | ) |
|
Definition at line 106 of file AgreementsUtil.java.
107 if(signatures ==
null) {
108 signatures =
new ArrayList<>();
109 if(Contacts.isValid(contact)) {
110 signatures.addAll(getAgreementSignatures());
111 notCreated(action).stream().map((a) -> {
112 AgreementSignature as =
new AgreementSignature();
113 as.setIdContact(contact.
getId());
117 as.setSignedDate(
null);
118 return getDao().saveObject(as);
119 }).forEachOrdered((as) -> {
◆ getSigned()
◆ isValid()
boolean org.turro.agreements.AgreementsUtil.isValid |
( |
| ) |
|
◆ markAsSent()
Definition at line 162 of file AgreementsUtil.java.
163 if(as.getId() !=
null) {
164 WhereClause wc =
new WhereClause();
165 wc.addClause(
"update AgreementSignature");
166 wc.addClause(
"set sentCount = sentCount + 1");
167 wc.addClause(
"where agreement = :agreement");
168 wc.addNamedValue(
"agreement", as.getAgreement());
169 wc.addClause(
"and idContact = :contact");
170 wc.addNamedValue(
"contact", as.getIdContact());
174 getDao().saveObject(as);
int executeUpdate(String query)
◆ notSigned()
◆ sign() [1/2]
void org.turro.agreements.AgreementsUtil.sign |
( |
Agreement |
agreement, |
|
|
boolean |
agreed |
|
) |
| |
Definition at line 135 of file AgreementsUtil.java.
136 if(agreement !=
null) {
137 WhereClause wc =
new WhereClause();
138 wc.addClause(
"select asig from AgreementSignature asig");
139 wc.addClause(
"where asig.agreement = :agreement");
140 wc.addNamedValue(
"agreement", agreement);
141 wc.addClause(
"and asig.idContact = :contact");
142 wc.addNamedValue(
"contact", contact.
getId());
145 as =
new AgreementSignature();
146 as.setIdContact(contact.
getId());
147 as.setAgreement(agreement);
150 if(!as.doesAgree()) {
151 as.setAgreed(agreed);
152 as.setSignedDate(
new Date());
153 getDao().saveObject(as);
Object getSingleResultOrNull(SqlClause sc)
◆ sign() [2/2]
void org.turro.agreements.AgreementsUtil.sign |
( |
Long |
agreementId, |
|
|
boolean |
agreed |
|
) |
| |
Definition at line 158 of file AgreementsUtil.java.
159 sign(getDao().find(Agreement.class, agreementId), agreed);
void sign(Agreement agreement, boolean agreed)
The documentation for this class was generated from the following file: