Skip to content

Commit

Permalink
Filter Refacturing (#221)
Browse files Browse the repository at this point in the history
* Filter Refacturing

* Update MitgliedAuswertungPDF.java

* Vereinfachung DateInput

* Update FilterControl.java

* Speichern Button fuer Filter

* Kleiner Fix

* Mailauswahl links bei AuswertungNichtMitgliedView
  • Loading branch information
JohannMaierhofer authored Jun 3, 2024
1 parent ea88a2a commit 9d436b0
Show file tree
Hide file tree
Showing 13 changed files with 1,672 additions and 1,700 deletions.
35 changes: 13 additions & 22 deletions src/de/jost_net/JVerein/Queries/MitgliedQuery.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ public class MitgliedQuery

private MitgliedControl control;

private boolean batch = false;

private boolean and = false;

private String sql = "";
Expand All @@ -55,25 +53,18 @@ public class MitgliedQuery

String zusatzfelder = null;

public MitgliedQuery(MitgliedControl control, boolean batch)
public MitgliedQuery(MitgliedControl control)
{
this.control = control;
this.batch = batch;
}

@SuppressWarnings("unchecked")
public ArrayList<Mitglied> get(int adresstyp) throws RemoteException
{
if (adresstyp == 1)
{
zusatzfeld = "zusatzfeld.";
zusatzfelder = "zusatzfelder.";
}
else
{
zusatzfeld = "nichtzusatzfeld.";
zusatzfelder = "nichtzusatzfelder.";
}

zusatzfeld = control.getAdditionalparamprefix1();
zusatzfelder = control.getAdditionalparamprefix2();

final DBService service = Einstellungen.getDBService();
ArrayList<Object> bedingungen = new ArrayList<>();

Expand Down Expand Up @@ -218,7 +209,7 @@ public ArrayList<Mitglied> get(int adresstyp) throws RemoteException
{
if (control.getMitgliedStatus().getValue().equals("Angemeldet"))
{
if (control.getStichtag().getValue() != null)
if (control.isStichtagAktiv() && control.getStichtag().getValue() != null)
{
addCondition("(eintritt is null or eintritt <= ?)");
bedingungen.add(control.getStichtag().getValue());
Expand All @@ -232,7 +223,7 @@ public ArrayList<Mitglied> get(int adresstyp) throws RemoteException
}
else if (control.getMitgliedStatus().getValue().equals("Abgemeldet"))
{
if (control.getStichtag().getValue() != null)
if (control.isStichtagAktiv() && control.getStichtag().getValue() != null)
{
addCondition("austritt is not null and austritt <= ?");
bedingungen.add(control.getStichtag(false).getValue());
Expand All @@ -246,11 +237,11 @@ else if (control.getMitgliedStatus().getValue().equals("Abgemeldet"))
if (control.isMailauswahlAktiv())
{
int mailauswahl = (Integer) control.getMailauswahl().getValue();
if (batch && mailauswahl == MailAuswertungInput.OHNE)
if (mailauswahl == MailAuswertungInput.OHNE)
{
addCondition("(email is null or length(email) = 0)");
}
if (batch && mailauswahl == MailAuswertungInput.MIT)
if (mailauswahl == MailAuswertungInput.MIT)
{
addCondition("(email is not null and length(email) > 0)");
}
Expand Down Expand Up @@ -306,10 +297,10 @@ else if (control.getMitgliedStatus().getValue().equals("Abgemeldet"))
}
}
}
if (control.isSuchnameAktiv())
if (control.isSuchnameAktiv() && control.getSuchname().getValue() != null)
{
String tmpSuchname = (String) control.getSuchname().getValue();
if (!batch && tmpSuchname.length() > 0)
if (tmpSuchname.length() > 0)
{
addCondition("(lower(name) like ?)");
bedingungen.add(tmpSuchname.toLowerCase() + "%");
Expand All @@ -329,13 +320,13 @@ else if (control.getMitgliedStatus().getValue().equals("Abgemeldet"))
bedingungen.add(new java.sql.Date(d.getTime()));
}

if (batch && control.isSterbedatumvonAktiv() && control.getSterbedatumvon().getValue() != null)
if (control.isSterbedatumvonAktiv() && control.getSterbedatumvon().getValue() != null)
{
addCondition("sterbetag >= ?");
Date d = (Date) control.getSterbedatumvon().getValue();
bedingungen.add(new java.sql.Date(d.getTime()));
}
if (batch && control.isSterbedatumbisAktiv() && control.getSterbedatumbis().getValue() != null)
if (control.isSterbedatumbisAktiv() && control.getSterbedatumbis().getValue() != null)
{
addCondition("sterbetag <= ?");
Date d = (Date) control.getSterbedatumbis().getValue();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.sql.SQLException;

import de.jost_net.JVerein.Einstellungen;
import de.jost_net.JVerein.gui.control.MitgliedControl;
import de.jost_net.JVerein.gui.dialogs.EigenschaftenAuswahlDialog;
import de.jost_net.JVerein.gui.dialogs.EigenschaftenAuswahlParameter;
import de.jost_net.JVerein.rmi.Eigenschaften;
Expand Down Expand Up @@ -58,7 +59,7 @@ else if (context instanceof Mitglied[])
try
{
EigenschaftenAuswahlDialog ead = new EigenschaftenAuswahlDialog("", true,
false);
false, new MitgliedControl(null));
EigenschaftenAuswahlParameter param = ead.open();
for (EigenschaftenNode en : param.getEigenschaften())
{
Expand Down
Loading

0 comments on commit 9d436b0

Please sign in to comment.