FINERACT-1087: Fixing date issues with bulk import templates

This commit is contained in:
Petri Tuomola
2020-07-20 11:42:33 +02:00
committed by Michael Vorburger ⛑️
parent 563d294938
commit e06b3447b9
2 changed files with 5 additions and 4 deletions
@@ -66,9 +66,9 @@ public abstract class AbstractWorkbookPopulator implements WorkbookPopulator {
try {
SimpleDateFormat formatinDB = null;
if (value.matches("\\d{4}-\\d{1,2}-\\d{1,2}")) {
formatinDB = new SimpleDateFormat("yyyy-mm-dd");
formatinDB = new SimpleDateFormat("yyyy-MM-dd");
} else if (value.matches("\\d{1,2}/\\d{1,2}/\\d{4}")) {
formatinDB = new SimpleDateFormat("dd/mm/yyyy");
formatinDB = new SimpleDateFormat("dd/MM/yyyy");
} else if (value.matches("\\d{1,2} \\w{3,12} \\d{4}")) {
formatinDB = new SimpleDateFormat("dd MMMM yyyy");
}
@@ -478,12 +478,13 @@ public class BulkImportWorkbookPopulatorServiceImpl implements BulkImportWorkboo
private List<SavingsAccountData> fetchSavingsAccounts(Long officeId) {
List<SavingsAccountData> savingsAccounts = null;
String activeAccounts = "sa.status_enum = 300";
if (officeId != null) {
String activeAccounts = "sa.status_enum = 300";
SearchParameters searchParameters = SearchParameters.from(activeAccounts, officeId, null, null, null);
savingsAccounts = savingsAccountReadPlatformService.retrieveAll(searchParameters).getPageItems();
} else {
savingsAccounts = savingsAccountReadPlatformService.retrieveAll(null).getPageItems();
SearchParameters searchParameters = SearchParameters.from(activeAccounts, null, null, null, null);
savingsAccounts = savingsAccountReadPlatformService.retrieveAll(searchParameters).getPageItems();
}
return savingsAccounts;
}