use JdbcSupport throughout backend.
This commit is contained in:
@@ -3,12 +3,9 @@ package org.mifosng.data;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
|
||||
import org.codehaus.jackson.map.annotate.JsonFilter;
|
||||
|
||||
@XmlRootElement(name = "user")
|
||||
@JsonIgnoreProperties({ "orgId" })
|
||||
@JsonFilter("userFilter")
|
||||
public class AppUserData {
|
||||
|
||||
@@ -4,11 +4,8 @@ import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
import org.codehaus.jackson.map.annotate.JsonFilter;
|
||||
|
||||
@XmlRootElement(name = "configuration")
|
||||
@JsonFilter("myFilter")
|
||||
public class ConfigurationData implements Serializable {
|
||||
|
||||
|
||||
+3
-3
@@ -5,16 +5,16 @@ import java.io.Serializable;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
@XmlRootElement(name = "option")
|
||||
public class EnumOptionReadModel implements Serializable {
|
||||
public class EnumOptionData implements Serializable {
|
||||
|
||||
private Long id;
|
||||
private String value;
|
||||
|
||||
public EnumOptionReadModel() {
|
||||
public EnumOptionData() {
|
||||
//
|
||||
}
|
||||
|
||||
public EnumOptionReadModel(final String value, final Long id) {
|
||||
public EnumOptionData(final String value, final Long id) {
|
||||
this.value = value;
|
||||
this.id = id;
|
||||
}
|
||||
@@ -9,21 +9,21 @@ import javax.xml.bind.annotation.XmlRootElement;
|
||||
@XmlRootElement
|
||||
public class EnumOptionList {
|
||||
|
||||
private Collection<EnumOptionReadModel> options = new ArrayList<EnumOptionReadModel>();
|
||||
private Collection<EnumOptionData> options = new ArrayList<EnumOptionData>();
|
||||
|
||||
protected EnumOptionList() {
|
||||
//
|
||||
}
|
||||
|
||||
public EnumOptionList(final List<EnumOptionReadModel> options) {
|
||||
public EnumOptionList(final List<EnumOptionData> options) {
|
||||
this.options = options;
|
||||
}
|
||||
|
||||
public Collection<EnumOptionReadModel> getOptions() {
|
||||
public Collection<EnumOptionData> getOptions() {
|
||||
return this.options;
|
||||
}
|
||||
|
||||
public void setOptions(final Collection<EnumOptionReadModel> options) {
|
||||
public void setOptions(final Collection<EnumOptionData> options) {
|
||||
this.options = options;
|
||||
}
|
||||
}
|
||||
@@ -5,12 +5,9 @@ import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
import org.codehaus.jackson.map.annotate.JsonFilter;
|
||||
import org.joda.time.DateTime;
|
||||
|
||||
@XmlRootElement(name = "loanProduct")
|
||||
@JsonFilter("myFilter")
|
||||
public class LoanProductData implements Serializable {
|
||||
|
||||
@@ -34,11 +31,11 @@ public class LoanProductData implements Serializable {
|
||||
private DateTime lastModifedOn;
|
||||
|
||||
private List<CurrencyData> possibleCurrencies = new ArrayList<CurrencyData>();
|
||||
private List<EnumOptionReadModel> possibleAmortizationOptions = new ArrayList<EnumOptionReadModel>();
|
||||
private List<EnumOptionReadModel> possibleInterestOptions = new ArrayList<EnumOptionReadModel>();
|
||||
private List<EnumOptionReadModel> possibleInterestRateCalculatedInPeriodOptions = new ArrayList<EnumOptionReadModel>();
|
||||
private List<EnumOptionReadModel> repaymentFrequencyOptions = new ArrayList<EnumOptionReadModel>();
|
||||
private List<EnumOptionReadModel> interestFrequencyOptions = new ArrayList<EnumOptionReadModel>();
|
||||
private List<EnumOptionData> possibleAmortizationOptions = new ArrayList<EnumOptionData>();
|
||||
private List<EnumOptionData> possibleInterestOptions = new ArrayList<EnumOptionData>();
|
||||
private List<EnumOptionData> possibleInterestRateCalculatedInPeriodOptions = new ArrayList<EnumOptionData>();
|
||||
private List<EnumOptionData> repaymentFrequencyOptions = new ArrayList<EnumOptionData>();
|
||||
private List<EnumOptionData> interestFrequencyOptions = new ArrayList<EnumOptionData>();
|
||||
|
||||
public LoanProductData() {
|
||||
//
|
||||
@@ -199,39 +196,39 @@ public class LoanProductData implements Serializable {
|
||||
this.possibleCurrencies = possibleCurrencies;
|
||||
}
|
||||
|
||||
public List<EnumOptionReadModel> getPossibleAmortizationOptions() {
|
||||
public List<EnumOptionData> getPossibleAmortizationOptions() {
|
||||
return possibleAmortizationOptions;
|
||||
}
|
||||
|
||||
public void setPossibleAmortizationOptions(
|
||||
List<EnumOptionReadModel> possibleAmortizationOptions) {
|
||||
List<EnumOptionData> possibleAmortizationOptions) {
|
||||
this.possibleAmortizationOptions = possibleAmortizationOptions;
|
||||
}
|
||||
|
||||
public List<EnumOptionReadModel> getPossibleInterestOptions() {
|
||||
public List<EnumOptionData> getPossibleInterestOptions() {
|
||||
return possibleInterestOptions;
|
||||
}
|
||||
|
||||
public void setPossibleInterestOptions(
|
||||
List<EnumOptionReadModel> possibleInterestOptions) {
|
||||
List<EnumOptionData> possibleInterestOptions) {
|
||||
this.possibleInterestOptions = possibleInterestOptions;
|
||||
}
|
||||
|
||||
public List<EnumOptionReadModel> getRepaymentFrequencyOptions() {
|
||||
public List<EnumOptionData> getRepaymentFrequencyOptions() {
|
||||
return repaymentFrequencyOptions;
|
||||
}
|
||||
|
||||
public void setRepaymentFrequencyOptions(
|
||||
List<EnumOptionReadModel> repaymentFrequencyOptions) {
|
||||
List<EnumOptionData> repaymentFrequencyOptions) {
|
||||
this.repaymentFrequencyOptions = repaymentFrequencyOptions;
|
||||
}
|
||||
|
||||
public List<EnumOptionReadModel> getInterestFrequencyOptions() {
|
||||
public List<EnumOptionData> getInterestFrequencyOptions() {
|
||||
return interestFrequencyOptions;
|
||||
}
|
||||
|
||||
public void setInterestFrequencyOptions(
|
||||
List<EnumOptionReadModel> interestFrequencyOptions) {
|
||||
List<EnumOptionData> interestFrequencyOptions) {
|
||||
this.interestFrequencyOptions = interestFrequencyOptions;
|
||||
}
|
||||
|
||||
@@ -251,12 +248,12 @@ public class LoanProductData implements Serializable {
|
||||
this.interestRateCalculatedInPeriod = interestRateCalculatedInPeriod;
|
||||
}
|
||||
|
||||
public List<EnumOptionReadModel> getPossibleInterestRateCalculatedInPeriodOptions() {
|
||||
public List<EnumOptionData> getPossibleInterestRateCalculatedInPeriodOptions() {
|
||||
return possibleInterestRateCalculatedInPeriodOptions;
|
||||
}
|
||||
|
||||
public void setPossibleInterestRateCalculatedInPeriodOptions(
|
||||
List<EnumOptionReadModel> possibleInterestRateCalculatedInPeriodOptions) {
|
||||
List<EnumOptionData> possibleInterestRateCalculatedInPeriodOptions) {
|
||||
this.possibleInterestRateCalculatedInPeriodOptions = possibleInterestRateCalculatedInPeriodOptions;
|
||||
}
|
||||
}
|
||||
@@ -4,12 +4,9 @@ import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
import org.codehaus.jackson.map.annotate.JsonFilter;
|
||||
import org.joda.time.LocalDate;
|
||||
|
||||
@XmlRootElement(name = "office")
|
||||
@JsonFilter("myFilter")
|
||||
public class OfficeData implements Serializable {
|
||||
|
||||
|
||||
@@ -3,12 +3,9 @@ package org.mifosng.data;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
|
||||
import org.codehaus.jackson.map.annotate.JsonFilter;
|
||||
|
||||
@XmlRootElement(name = "role")
|
||||
@JsonIgnoreProperties({ "orgId" })
|
||||
@JsonFilter("roleFilter")
|
||||
public class RoleData {
|
||||
|
||||
+19
-21
@@ -19,6 +19,7 @@ import org.mifosng.data.NoteData;
|
||||
import org.mifosng.data.OfficeData;
|
||||
import org.mifosng.data.OfficeLookup;
|
||||
import org.mifosng.platform.exceptions.ClientNotFoundException;
|
||||
import org.mifosng.platform.infrastructure.JdbcSupport;
|
||||
import org.mifosng.platform.organisation.domain.Organisation;
|
||||
import org.mifosng.platform.organisation.service.OfficeReadPlatformService;
|
||||
import org.mifosng.platform.security.PlatformSecurityContext;
|
||||
@@ -131,16 +132,16 @@ public class ClientReadPlatformServiceImpl implements ClientReadPlatformService
|
||||
public ClientData mapRow(final ResultSet rs, final int rowNum)
|
||||
throws SQLException {
|
||||
|
||||
Long orgId = rs.getLong("orgId");
|
||||
Long officeId = rs.getLong("officeId");
|
||||
Long id = rs.getLong("id");
|
||||
Long orgId = JdbcSupport.getLong(rs, "orgId");
|
||||
Long officeId = JdbcSupport.getLong(rs, "officeId");
|
||||
Long id = JdbcSupport.getLong(rs, "id");
|
||||
String firstname = rs.getString("firstname");
|
||||
if (StringUtils.isBlank(firstname)) {
|
||||
firstname = "";
|
||||
}
|
||||
String lastname = rs.getString("lastname");
|
||||
String externalId = rs.getString("externalId");
|
||||
LocalDate joinedDate = new LocalDate(rs.getDate("joinedDate"));
|
||||
LocalDate joinedDate = JdbcSupport.getLocalDate(rs, "joinedDate");
|
||||
|
||||
String officeName = fromOfficeList(this.offices, officeId);
|
||||
|
||||
@@ -149,8 +150,7 @@ public class ClientReadPlatformServiceImpl implements ClientReadPlatformService
|
||||
orgname = organisation.getName();
|
||||
}
|
||||
|
||||
return new ClientData(orgId, orgname, officeId, officeName, id,
|
||||
firstname, lastname, externalId, joinedDate);
|
||||
return new ClientData(orgId, orgname, officeId, officeName, id, firstname, lastname, externalId, joinedDate);
|
||||
}
|
||||
|
||||
private String fromOfficeList(final List<OfficeData> officeList,
|
||||
@@ -220,11 +220,11 @@ public class ClientReadPlatformServiceImpl implements ClientReadPlatformService
|
||||
@Override
|
||||
public ClientLoanAccountSummaryData mapRow(final ResultSet rs, final int rowNum) throws SQLException {
|
||||
|
||||
Long id = rs.getLong("id");
|
||||
Long id = JdbcSupport.getLong(rs, "id");
|
||||
String externalId = rs.getString("externalId");
|
||||
Long productId = rs.getLong("productId");
|
||||
Long productId = JdbcSupport.getLong(rs, "productId");
|
||||
String loanProductName = rs.getString("productName");
|
||||
Integer loanStatusId = rs.getInt("statusId");
|
||||
Integer loanStatusId = JdbcSupport.getInteger(rs, "statusId");
|
||||
String lifeCycleStatusText = rs.getString("statusName");
|
||||
|
||||
LoanStatusMapper statusMapper = new LoanStatusMapper(loanStatusId);
|
||||
@@ -297,20 +297,19 @@ public class ClientReadPlatformServiceImpl implements ClientReadPlatformService
|
||||
public NoteData mapRow(final ResultSet rs, final int rowNum)
|
||||
throws SQLException {
|
||||
|
||||
Long id = rs.getLong("id");
|
||||
Long clientId = rs.getLong("clientId");
|
||||
Long loanId = rs.getLong("loanId");
|
||||
Long transactionId = rs.getLong("transactionId");
|
||||
Integer noteTypeId = rs.getInt("noteTypeEnum");
|
||||
Long id = JdbcSupport.getLong(rs, "id");
|
||||
Long clientId = JdbcSupport.getLong(rs, "clientId");
|
||||
Long loanId = JdbcSupport.getLong(rs, "loanId");
|
||||
Long transactionId = JdbcSupport.getLong(rs, "transactionId");
|
||||
Integer noteTypeId = JdbcSupport.getInteger(rs, "noteTypeEnum");
|
||||
String note = rs.getString("note");
|
||||
|
||||
DateTime createdDate = new DateTime(rs.getTimestamp("createdDate"));
|
||||
Long createdById = rs.getLong("createdById");
|
||||
DateTime createdDate = JdbcSupport.getDateTime(rs, "createdDate");
|
||||
Long createdById = JdbcSupport.getLong(rs, "createdById");
|
||||
String createdByUsername = findUserById(createdById, allUsers);
|
||||
|
||||
DateTime lastModifiedDate = new DateTime(
|
||||
rs.getTimestamp("lastModifiedDate"));
|
||||
Long lastModifiedById = rs.getLong("lastModifiedById");
|
||||
DateTime lastModifiedDate = JdbcSupport.getDateTime(rs, "lastModifiedDate");
|
||||
Long lastModifiedById = JdbcSupport.getLong(rs, "lastModifiedById");
|
||||
String updatedByUsername = findUserById(createdById, allUsers);
|
||||
|
||||
return new NoteData(id, clientId, loanId, transactionId,
|
||||
@@ -319,8 +318,7 @@ public class ClientReadPlatformServiceImpl implements ClientReadPlatformService
|
||||
updatedByUsername);
|
||||
}
|
||||
|
||||
private String findUserById(Long createdById,
|
||||
Collection<AppUserData> allUsers) {
|
||||
private String findUserById(Long createdById, Collection<AppUserData> allUsers) {
|
||||
String username = "";
|
||||
for (AppUserData appUserData : allUsers) {
|
||||
if (appUserData.getId().equals(createdById)) {
|
||||
|
||||
+3
-3
@@ -7,6 +7,7 @@ import java.util.List;
|
||||
import javax.sql.DataSource;
|
||||
|
||||
import org.mifosng.data.CurrencyData;
|
||||
import org.mifosng.platform.infrastructure.JdbcSupport;
|
||||
import org.mifosng.platform.security.PlatformSecurityContext;
|
||||
import org.mifosng.platform.user.domain.AppUser;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -57,12 +58,11 @@ public class CurrencyReadPlatformServiceImpl implements CurrencyReadPlatformServ
|
||||
|
||||
String code = rs.getString("code");
|
||||
String name = rs.getString("name");
|
||||
int decimalPlaces = rs.getInt("decimalPlaces");
|
||||
int decimalPlaces = JdbcSupport.getInteger(rs, "decimalPlaces");
|
||||
String displaySymbol = rs.getString("displaySymbol");
|
||||
String nameCode = rs.getString("nameCode");
|
||||
|
||||
return new CurrencyData(code, name, decimalPlaces, displaySymbol,
|
||||
nameCode);
|
||||
return new CurrencyData(code, name, decimalPlaces, displaySymbol, nameCode);
|
||||
}
|
||||
}
|
||||
}
|
||||
+6
-6
@@ -2,17 +2,17 @@ package org.mifosng.platform.loanproduct.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.mifosng.data.EnumOptionReadModel;
|
||||
import org.mifosng.data.EnumOptionData;
|
||||
|
||||
public interface LoanDropdownReadPlatformService {
|
||||
|
||||
List<EnumOptionReadModel> retrieveLoanAmortizationMethodOptions();
|
||||
List<EnumOptionData> retrieveLoanAmortizationMethodOptions();
|
||||
|
||||
List<EnumOptionReadModel> retrieveLoanInterestMethodOptions();
|
||||
List<EnumOptionData> retrieveLoanInterestMethodOptions();
|
||||
|
||||
List<EnumOptionReadModel> retrieveLoanInterestRateCalculatedInPeriodOptions();
|
||||
List<EnumOptionData> retrieveLoanInterestRateCalculatedInPeriodOptions();
|
||||
|
||||
List<EnumOptionReadModel> retrieveRepaymentFrequencyOptions();
|
||||
List<EnumOptionData> retrieveRepaymentFrequencyOptions();
|
||||
|
||||
List<EnumOptionReadModel> retrieveInterestFrequencyOptions();
|
||||
List<EnumOptionData> retrieveInterestFrequencyOptions();
|
||||
}
|
||||
+22
-22
@@ -5,7 +5,7 @@ import java.util.List;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
import org.mifosng.data.EnumOptionReadModel;
|
||||
import org.mifosng.data.EnumOptionData;
|
||||
import org.mifosng.platform.loan.domain.AmortizationMethod;
|
||||
import org.mifosng.platform.loan.domain.PeriodFrequencyType;
|
||||
import org.mifosng.platform.security.PlatformSecurityContext;
|
||||
@@ -30,28 +30,28 @@ public class LoanDropdownReadPlatformServiceImpl implements LoanDropdownReadPlat
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EnumOptionReadModel> retrieveLoanAmortizationMethodOptions() {
|
||||
EnumOptionReadModel equalInstallments = new EnumOptionReadModel(
|
||||
public List<EnumOptionData> retrieveLoanAmortizationMethodOptions() {
|
||||
EnumOptionData equalInstallments = new EnumOptionData(
|
||||
"Equal installments", AmortizationMethod.EQUAL_INSTALLMENTS
|
||||
.getValue().longValue());
|
||||
EnumOptionReadModel equalPrinciplePayments = new EnumOptionReadModel(
|
||||
EnumOptionData equalPrinciplePayments = new EnumOptionData(
|
||||
"Equal principle payments", AmortizationMethod.EQUAL_PRINCIPAL
|
||||
.getValue().longValue());
|
||||
|
||||
List<EnumOptionReadModel> allowedAmortizationMethods = Arrays.asList(
|
||||
List<EnumOptionData> allowedAmortizationMethods = Arrays.asList(
|
||||
equalInstallments, equalPrinciplePayments);
|
||||
|
||||
return allowedAmortizationMethods;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EnumOptionReadModel> retrieveLoanInterestMethodOptions() {
|
||||
EnumOptionReadModel interestRateCalculationMethod2 = new EnumOptionReadModel(
|
||||
public List<EnumOptionData> retrieveLoanInterestMethodOptions() {
|
||||
EnumOptionData interestRateCalculationMethod2 = new EnumOptionData(
|
||||
"Declining Balance", Long.valueOf(0));
|
||||
EnumOptionReadModel interestRateCalculationMethod1 = new EnumOptionReadModel(
|
||||
EnumOptionData interestRateCalculationMethod1 = new EnumOptionData(
|
||||
"Flat", Long.valueOf(1));
|
||||
|
||||
List<EnumOptionReadModel> allowedRepaymentScheduleCalculationMethods = Arrays
|
||||
List<EnumOptionData> allowedRepaymentScheduleCalculationMethods = Arrays
|
||||
.asList(interestRateCalculationMethod2,
|
||||
interestRateCalculationMethod1);
|
||||
|
||||
@@ -59,40 +59,40 @@ public class LoanDropdownReadPlatformServiceImpl implements LoanDropdownReadPlat
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EnumOptionReadModel> retrieveLoanInterestRateCalculatedInPeriodOptions() {
|
||||
public List<EnumOptionData> retrieveLoanInterestRateCalculatedInPeriodOptions() {
|
||||
|
||||
EnumOptionReadModel option1 = new EnumOptionReadModel("Daily",
|
||||
EnumOptionData option1 = new EnumOptionData("Daily",
|
||||
Long.valueOf(0));
|
||||
EnumOptionReadModel option2 = new EnumOptionReadModel(
|
||||
EnumOptionData option2 = new EnumOptionData(
|
||||
"Same as repayment period", Long.valueOf(1));
|
||||
|
||||
List<EnumOptionReadModel> allowedOptions = Arrays.asList(option1,
|
||||
List<EnumOptionData> allowedOptions = Arrays.asList(option1,
|
||||
option2);
|
||||
|
||||
return allowedOptions;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EnumOptionReadModel> retrieveRepaymentFrequencyOptions() {
|
||||
EnumOptionReadModel frequency1 = new EnumOptionReadModel("Days",
|
||||
public List<EnumOptionData> retrieveRepaymentFrequencyOptions() {
|
||||
EnumOptionData frequency1 = new EnumOptionData("Days",
|
||||
Long.valueOf(0));
|
||||
EnumOptionReadModel frequency2 = new EnumOptionReadModel("Weeks",
|
||||
EnumOptionData frequency2 = new EnumOptionData("Weeks",
|
||||
Long.valueOf(1));
|
||||
EnumOptionReadModel frequency3 = new EnumOptionReadModel("Months",
|
||||
EnumOptionData frequency3 = new EnumOptionData("Months",
|
||||
Long.valueOf(2));
|
||||
List<EnumOptionReadModel> repaymentFrequencyOptions = Arrays.asList(
|
||||
List<EnumOptionData> repaymentFrequencyOptions = Arrays.asList(
|
||||
frequency1, frequency2, frequency3);
|
||||
return repaymentFrequencyOptions;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EnumOptionReadModel> retrieveInterestFrequencyOptions() {
|
||||
public List<EnumOptionData> retrieveInterestFrequencyOptions() {
|
||||
// support for monthly and annual percentage rate (MPR) and (APR)
|
||||
EnumOptionReadModel perMonth = new EnumOptionReadModel("Per month",
|
||||
EnumOptionData perMonth = new EnumOptionData("Per month",
|
||||
PeriodFrequencyType.MONTHS.getValue().longValue());
|
||||
EnumOptionReadModel perYear = new EnumOptionReadModel("Per year",
|
||||
EnumOptionData perYear = new EnumOptionData("Per year",
|
||||
PeriodFrequencyType.YEARS.getValue().longValue());
|
||||
List<EnumOptionReadModel> repaymentFrequencyOptions = Arrays.asList(
|
||||
List<EnumOptionData> repaymentFrequencyOptions = Arrays.asList(
|
||||
perMonth, perYear);
|
||||
return repaymentFrequencyOptions;
|
||||
}
|
||||
|
||||
+6
-6
@@ -10,7 +10,7 @@ import javax.sql.DataSource;
|
||||
|
||||
import org.joda.time.DateTime;
|
||||
import org.mifosng.data.CurrencyData;
|
||||
import org.mifosng.data.EnumOptionReadModel;
|
||||
import org.mifosng.data.EnumOptionData;
|
||||
import org.mifosng.data.LoanProductData;
|
||||
import org.mifosng.data.MoneyData;
|
||||
import org.mifosng.platform.currency.service.CurrencyReadPlatformService;
|
||||
@@ -180,11 +180,11 @@ public class LoanProductReadPlatformServiceImpl implements LoanProductReadPlatfo
|
||||
|
||||
List<CurrencyData> possibleCurrencies = currencyReadPlatformService.retrieveAllowedCurrencies();
|
||||
|
||||
List<EnumOptionReadModel> possibleAmortizationOptions = dropdownReadPlatformService.retrieveLoanAmortizationMethodOptions();
|
||||
List<EnumOptionReadModel> possibleInterestOptions = dropdownReadPlatformService.retrieveLoanInterestMethodOptions();
|
||||
List<EnumOptionReadModel> possibleInterestRateCalculatedInPeriodOptions = dropdownReadPlatformService.retrieveLoanInterestRateCalculatedInPeriodOptions();
|
||||
List<EnumOptionReadModel> repaymentFrequencyOptions = dropdownReadPlatformService.retrieveRepaymentFrequencyOptions();
|
||||
List<EnumOptionReadModel> interestFrequencyOptions = dropdownReadPlatformService.retrieveInterestFrequencyOptions();
|
||||
List<EnumOptionData> possibleAmortizationOptions = dropdownReadPlatformService.retrieveLoanAmortizationMethodOptions();
|
||||
List<EnumOptionData> possibleInterestOptions = dropdownReadPlatformService.retrieveLoanInterestMethodOptions();
|
||||
List<EnumOptionData> possibleInterestRateCalculatedInPeriodOptions = dropdownReadPlatformService.retrieveLoanInterestRateCalculatedInPeriodOptions();
|
||||
List<EnumOptionData> repaymentFrequencyOptions = dropdownReadPlatformService.retrieveRepaymentFrequencyOptions();
|
||||
List<EnumOptionData> interestFrequencyOptions = dropdownReadPlatformService.retrieveInterestFrequencyOptions();
|
||||
|
||||
productData.setPossibleCurrencies(possibleCurrencies);
|
||||
productData.setPossibleAmortizationOptions(possibleAmortizationOptions);
|
||||
|
||||
+6
-5
@@ -16,6 +16,7 @@ import org.mifosng.data.OfficeData;
|
||||
import org.mifosng.data.OfficeLookup;
|
||||
import org.mifosng.data.RoleData;
|
||||
import org.mifosng.platform.exceptions.PlatformResourceNotFoundException;
|
||||
import org.mifosng.platform.infrastructure.JdbcSupport;
|
||||
import org.mifosng.platform.organisation.service.OfficeReadPlatformService;
|
||||
import org.mifosng.platform.security.PlatformSecurityContext;
|
||||
import org.mifosng.platform.user.domain.AppUser;
|
||||
@@ -143,13 +144,13 @@ public class AppUserReadPlatformServiceImpl implements AppUserReadPlatformServic
|
||||
String firstname = rs.getString("firstname");
|
||||
String lastname = rs.getString("lastname");
|
||||
String email = rs.getString("email");
|
||||
Long orgId = rs.getLong("orgId");
|
||||
Long officeId = rs.getLong("officeId");
|
||||
|
||||
Long orgId = JdbcSupport.getLong(rs, "orgId");
|
||||
Long officeId = JdbcSupport.getLong(rs, "officeId");
|
||||
|
||||
// FIXME - change sql query to join to get office id and name information.
|
||||
String officeName = fromOfficeList(this.offices, officeId);
|
||||
|
||||
AppUserData user = new AppUserData(id, username, email, orgId,
|
||||
officeId, officeName);
|
||||
AppUserData user = new AppUserData(id, username, email, orgId, officeId, officeName);
|
||||
user.setLastname(lastname);
|
||||
user.setFirstname(firstname);
|
||||
|
||||
|
||||
+4
-3
@@ -7,6 +7,7 @@ import java.util.Collection;
|
||||
import javax.sql.DataSource;
|
||||
|
||||
import org.mifosng.data.PermissionData;
|
||||
import org.mifosng.platform.infrastructure.JdbcSupport;
|
||||
import org.mifosng.platform.security.PlatformSecurityContext;
|
||||
import org.mifosng.platform.user.domain.AppUser;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -43,12 +44,12 @@ public class PermissionReadPlatformServiceImpl implements PermissionReadPlatform
|
||||
@Override
|
||||
public PermissionData mapRow(final ResultSet rs, final int rowNum) throws SQLException {
|
||||
|
||||
Long id = rs.getLong("id");
|
||||
Long orgId = rs.getLong("orgId");
|
||||
Long id = JdbcSupport.getLong(rs, "id");
|
||||
Long orgId = JdbcSupport.getLong(rs, "orgId");
|
||||
String name = rs.getString("name");
|
||||
String description = rs.getString("description");
|
||||
String code = rs.getString("code");
|
||||
int groupType = rs.getInt("groupType");
|
||||
Integer groupType = JdbcSupport.getInteger(rs, "groupType");
|
||||
|
||||
return new PermissionData(id, orgId, name, description, code, groupType);
|
||||
}
|
||||
|
||||
+4
-4
@@ -7,6 +7,7 @@ import java.util.Collection;
|
||||
import javax.sql.DataSource;
|
||||
|
||||
import org.mifosng.data.RoleData;
|
||||
import org.mifosng.platform.infrastructure.JdbcSupport;
|
||||
import org.mifosng.platform.security.PlatformSecurityContext;
|
||||
import org.mifosng.platform.user.domain.AppUser;
|
||||
import org.mifosng.platform.user.domain.Role;
|
||||
@@ -37,8 +38,7 @@ public class RoleReadPlatformServiceImpl implements RoleReadPlatformService {
|
||||
RoleMapper mapper = new RoleMapper();
|
||||
String sql = "select " + mapper.schema() + " where r.org_id = ?";
|
||||
|
||||
return this.jdbcTemplate.query(sql, mapper, new Object[] { currentUser
|
||||
.getOrganisation().getId() });
|
||||
return this.jdbcTemplate.query(sql, mapper, new Object[] {currentUser.getOrganisation().getId() });
|
||||
}
|
||||
|
||||
// FIXME - does it make sense to use JDBC over repository for this?
|
||||
@@ -56,8 +56,8 @@ public class RoleReadPlatformServiceImpl implements RoleReadPlatformService {
|
||||
public RoleData mapRow(final ResultSet rs, final int rowNum)
|
||||
throws SQLException {
|
||||
|
||||
Long id = rs.getLong("id");
|
||||
Long orgId = rs.getLong("orgId");
|
||||
Long id = JdbcSupport.getLong(rs, "id");
|
||||
Long orgId = JdbcSupport.getLong(rs, "orgId");
|
||||
String name = rs.getString("name");
|
||||
String description = rs.getString("description");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user