diff --git a/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/AnalyseSachpruefungController.java b/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/AnalyseSachpruefungController.java new file mode 100644 index 0000000..8980ef4 --- /dev/null +++ b/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/AnalyseSachpruefungController.java @@ -0,0 +1,144 @@ +package com.alexanderlogistics; + +import java.io.Serializable; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.logging.Logger; + +import javax.enterprise.context.SessionScoped; +import javax.inject.Inject; +import javax.inject.Named; + +import org.imixs.workflow.ItemCollection; +import org.imixs.workflow.engine.DocumentService; +import org.imixs.workflow.engine.index.Category; +import org.imixs.workflow.engine.index.SearchService; + +/** + * AnalyseSachpruefungController dient zur Auswertung der Sachprüfungs WOrklfow + * Schritte. Die Analyse Seite ist büer das Admin Menü erreichbar. + * + * @author rsoika + * + */ +@Named +@SessionScoped +public class AnalyseSachpruefungController implements Serializable { + + private static final long serialVersionUID = 1L; + private static Logger logger = Logger.getLogger(AnalyseSachpruefungController.class.getName()); + + @Inject + protected DocumentService documentService; + + @Inject + SearchService searchService; + + + Category sachpruefung; + Category verteilung; + + private ItemCollection filter; + + public ItemCollection getFilter() { + if (filter == null) { + filter = new ItemCollection(); + } + return filter; + } + + public void setFilter(ItemCollection filter) { + this.filter = filter; + } + + + + public Category getSachpruefung() { + return sachpruefung; + } + + public Category getVerteilung() { + return verteilung; + } + + /** + * Fuert verschiedene Queries aus um eine Analyse der Sachprufung durchzuführen. + */ + public void analyse() { + + logger.info("start analyse...."); + verteilung=null; + sachpruefung=null; + Date start = filter.getItemValueDate("start"); + Date stop = filter.getItemValueDate("stop"); + + logger.info("...daterange=" + start + " - "+stop); + + // serach date range? + String sDateFrom = "191401070000"; // because * did not work here + String sDateTo = "211401070000"; + SimpleDateFormat dateformat = new SimpleDateFormat("yyyyMMddHHmm"); + + if (start != null) { + Calendar cal = Calendar.getInstance(); + cal.setTime(start); + sDateFrom = dateformat.format(cal.getTime()); + } + if (stop != null) { + Calendar cal = Calendar.getInstance(); + cal.setTime(stop); + cal.add(Calendar.DATE, 1); + sDateTo = dateformat.format(cal.getTime()); + } + + String query = "(type:workitem OR type:workitemarchive) "; + if (start != null || stop != null) { + query += "AND ($created:[" + sDateFrom + " TO " + sDateTo + "]) "; + } + + logger.info(query); + List taxResult = searchService.getTaxonomyByQuery(query, "taxonomy.verteilung.stop.by", + "taxonomy.sachpruefung.stop.by"); + + + if (taxResult.size() > 0) { + + + + for (Category cat : taxResult) { + logger.info("category: " + cat.getName() + " = " + cat.getCount()); + + if (cat.getName().contains("verteilung")) { + verteilung=cat; + } + + if (cat.getName().contains("sachpruefung")) { + sachpruefung=cat; + + } + + Map labelMap = cat.getLabels(); + + for (String id : labelMap.keySet()) { + logger.info(".....sub-category: " + id + " = " + labelMap.get(id)); + } + + } + } + + } + + /** + * This method reset the search and input state. + */ + public void reset() { + filter = new ItemCollection(); + sachpruefung=null; + verteilung=null; + logger.fine("reset"); + } + +} diff --git a/office-alexander-logistics-app/src/main/webapp/layout/commandbox_admin_custom.xhtml b/office-alexander-logistics-app/src/main/webapp/layout/commandbox_admin_custom.xhtml index 06ecc67..c8c7fba 100644 --- a/office-alexander-logistics-app/src/main/webapp/layout/commandbox_admin_custom.xhtml +++ b/office-alexander-logistics-app/src/main/webapp/layout/commandbox_admin_custom.xhtml @@ -6,6 +6,7 @@ diff --git a/office-alexander-logistics-app/src/main/webapp/pages/admin/analyse_sachpruefung.xhtml b/office-alexander-logistics-app/src/main/webapp/pages/admin/analyse_sachpruefung.xhtml new file mode 100644 index 0000000..a95dcd3 --- /dev/null +++ b/office-alexander-logistics-app/src/main/webapp/pages/admin/analyse_sachpruefung.xhtml @@ -0,0 +1,182 @@ + + + + + + + + + + + + + + + + + + + + + +
+
+

Analyse Verteilung / Sachprüfung

+
+ + + + +
+ + +
+
+
+ Von:* +
+
+ + + + + + +
+
+ +
+
+ Bis:* +
+
+ + + +
+
+ + + +
+ +
+ + + + + + +
+ + +
+ +
+ + + +

Verteilung zur Prüfung

+ + + + + + + + + + + + + +
Mitarbeiter
#{entry.key}#{entry.value}
+ +
+
+
+ + +

Sachprüfung

+ + + + + + + + + + + + + +
Mitarbeiter
#{entry.key}#{entry.value}
+ +
+
+ +
+ + + +
+ +
+ +
+ + + + + +
+
+
+ + + +
diff --git a/workflow/rechnungseingang-de-1.2.14.bpmn b/workflow/rechnungseingang-de-1.2.14.bpmn index e9b3e97..1cdc145 100644 --- a/workflow/rechnungseingang-de-1.2.14.bpmn +++ b/workflow/rechnungseingang-de-1.2.14.bpmn @@ -335,7 +335,7 @@ Bei Fragen wenden Sie sich bitte an info@imixs.com home start - true + false ]]>