fixes op listen
This commit is contained in:
parent
61a7fa8399
commit
a715e00a1d
3 changed files with 27 additions and 9 deletions
|
|
@ -5,6 +5,7 @@ import java.util.List;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
|
import org.eclipse.microprofile.config.inject.ConfigProperty;
|
||||||
import org.eclipse.microprofile.metrics.Metadata;
|
import org.eclipse.microprofile.metrics.Metadata;
|
||||||
import org.eclipse.microprofile.metrics.MetricRegistry;
|
import org.eclipse.microprofile.metrics.MetricRegistry;
|
||||||
import org.eclipse.microprofile.metrics.Tag;
|
import org.eclipse.microprofile.metrics.Tag;
|
||||||
|
|
@ -59,6 +60,10 @@ public class MetricDebitorService {
|
||||||
@Inject
|
@Inject
|
||||||
DocumentService documentService;
|
DocumentService documentService;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
@ConfigProperty(name = "metrics.enabled", defaultValue = "false")
|
||||||
|
private boolean metricsEnabled;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Process Metric only if some data has changed....
|
* Process Metric only if some data has changed....
|
||||||
*
|
*
|
||||||
|
|
@ -66,6 +71,10 @@ public class MetricDebitorService {
|
||||||
* @throws PluginException
|
* @throws PluginException
|
||||||
*/
|
*/
|
||||||
public void onProcessingEvent(@Observes ProcessingEvent processingEvent) throws PluginException {
|
public void onProcessingEvent(@Observes ProcessingEvent processingEvent) throws PluginException {
|
||||||
|
|
||||||
|
if (!metricsEnabled) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
double debitorSaldo = 0;
|
double debitorSaldo = 0;
|
||||||
ItemCollection invoice = processingEvent.getDocument();
|
ItemCollection invoice = processingEvent.getDocument();
|
||||||
if (!invoice.getModelVersion().startsWith("rechnungsausgang-")) {
|
if (!invoice.getModelVersion().startsWith("rechnungsausgang-")) {
|
||||||
|
|
|
||||||
|
|
@ -283,8 +283,6 @@ public class OPListExportAdapterByWeek extends POIFindReplaceAdapter {
|
||||||
} else {
|
} else {
|
||||||
currentWeekCategory = currentWeekCategory + currentWeekNumber;
|
currentWeekCategory = currentWeekCategory + currentWeekNumber;
|
||||||
}
|
}
|
||||||
logger.info("----------HACK");
|
|
||||||
currentWeekCategory = "2023/06";
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* --- Phase 1 -------------------------------------------------------
|
* --- Phase 1 -------------------------------------------------------
|
||||||
|
|
@ -342,7 +340,7 @@ public class OPListExportAdapterByWeek extends POIFindReplaceAdapter {
|
||||||
for (String week : sortedWeekList) {
|
for (String week : sortedWeekList) {
|
||||||
// now create a new line..
|
// now create a new line..
|
||||||
rowPos++;
|
rowPos++;
|
||||||
logger.info("--> Zeile " + rowPos + " Week=" + week);
|
logger.fine("--> Zeile " + rowPos + " Week=" + week);
|
||||||
XSSFRow row = sheet.createRow(rowPos);
|
XSSFRow row = sheet.createRow(rowPos);
|
||||||
|
|
||||||
if (week.equals(currentWeekCategory)) {
|
if (week.equals(currentWeekCategory)) {
|
||||||
|
|
@ -361,7 +359,7 @@ public class OPListExportAdapterByWeek extends POIFindReplaceAdapter {
|
||||||
WeekInvoiceData weekDataTotal = weekDataMap.get("TOTAL/" + week);
|
WeekInvoiceData weekDataTotal = weekDataMap.get("TOTAL/" + week);
|
||||||
for (String name : spaceNames) {
|
for (String name : spaceNames) {
|
||||||
String key = name + "/" + week;
|
String key = name + "/" + week;
|
||||||
logger.info("search WeekInvoiceData for " + key);
|
logger.fine("search WeekInvoiceData for " + key);
|
||||||
// list of invoices
|
// list of invoices
|
||||||
WeekInvoiceData weekData = weekDataMap.get(key);
|
WeekInvoiceData weekData = weekDataMap.get(key);
|
||||||
|
|
||||||
|
|
@ -371,7 +369,7 @@ public class OPListExportAdapterByWeek extends POIFindReplaceAdapter {
|
||||||
// + weekData.totalCurrency2);
|
// + weekData.totalCurrency2);
|
||||||
|
|
||||||
for (String currency : currencyList) {
|
for (String currency : currencyList) {
|
||||||
logger.info("-- Col Number=" + column);
|
logger.fine("-- Col Number=" + column);
|
||||||
double betrag = weekData.getTotal(currency);
|
double betrag = weekData.getTotal(currency);
|
||||||
row.getCell(column).setCellValue(betrag);
|
row.getCell(column).setCellValue(betrag);
|
||||||
|
|
||||||
|
|
@ -385,7 +383,7 @@ public class OPListExportAdapterByWeek extends POIFindReplaceAdapter {
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
logger.info("...... NOT FOUND");
|
logger.fine("...... NOT FOUND");
|
||||||
// skip columns
|
// skip columns
|
||||||
for (String currency : currencyList) {
|
for (String currency : currencyList) {
|
||||||
column++;
|
column++;
|
||||||
|
|
@ -473,7 +471,7 @@ public class OPListExportAdapterByWeek extends POIFindReplaceAdapter {
|
||||||
private void groupInvoicesByWeek(String spaceID, String spaceName,
|
private void groupInvoicesByWeek(String spaceID, String spaceName,
|
||||||
Map<String, WeekInvoiceData> weekDataCache) {
|
Map<String, WeekInvoiceData> weekDataCache) {
|
||||||
|
|
||||||
logger.info("...group invoices (DEBUG) for " + spaceName + "/" + spaceID);
|
logger.info("...group invoices for " + spaceName + "/" + spaceID);
|
||||||
try {
|
try {
|
||||||
List<ItemCollection> invoices = documentService.find(
|
List<ItemCollection> invoices = documentService.find(
|
||||||
"$modelversion:rechnungsausgang-* AND type:workitem AND $uniqueidref:" + spaceID, 9999, 0,
|
"$modelversion:rechnungsausgang-* AND type:workitem AND $uniqueidref:" + spaceID, 9999, 0,
|
||||||
|
|
|
||||||
|
|
@ -381,7 +381,18 @@ if (workitem.get(refField) == null || ''==workitem.get(refField)[0]) {
|
||||||
<target-name>op-liste_<itemvalue>dbtr.number</itemvalue>_<itemvalue format="yyyy-MM-dd">$lasteventdate</itemvalue>.xlsx</target-name>
|
<target-name>op-liste_<itemvalue>dbtr.number</itemvalue>_<itemvalue format="yyyy-MM-dd">$lasteventdate</itemvalue>.xlsx</target-name>
|
||||||
</opliste>
|
</opliste>
|
||||||
<poi-update name="findreplace">
|
<poi-update name="findreplace">
|
||||||
<find>A8</find>
|
<find>C6</find>
|
||||||
|
<replace><itemvalue>sequencenumber</itemvalue></replace>
|
||||||
|
<type>text</type>
|
||||||
|
</poi-update>
|
||||||
|
<poi-update name="findreplace">
|
||||||
|
<find>B7</find>
|
||||||
|
<replace><itemvalue>space.name</itemvalue></replace>
|
||||||
|
<type>text</type>
|
||||||
|
</poi-update>
|
||||||
|
|
||||||
|
<poi-update name="findreplace">
|
||||||
|
<find>F6</find>
|
||||||
<replace><itemvalue format="dd.MM.yyyy">$lasteventdate</itemvalue></replace>
|
<replace><itemvalue format="dd.MM.yyyy">$lasteventdate</itemvalue></replace>
|
||||||
<type>date</type>
|
<type>date</type>
|
||||||
</poi-update>]]></imixs:value>
|
</poi-update>]]></imixs:value>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue