-CORRECCIÓN DE HORAS EN LOS NEW DATE() PARA LOS REGISTROS EN EL WS
This commit is contained in:
parent
78d9e09391
commit
25fde10e97
@ -113,7 +113,7 @@ public class ExchangeEnebledUsersController implements Serializable {
|
|||||||
Date date = new Date();
|
Date date = new Date();
|
||||||
Calendar calendar = Calendar.getInstance();
|
Calendar calendar = Calendar.getInstance();
|
||||||
calendar.setTime(date);
|
calendar.setTime(date);
|
||||||
calendar.add(Calendar.HOUR, -7);
|
calendar.add(Calendar.HOUR_OF_DAY, -7);
|
||||||
date = calendar.getTime();
|
date = calendar.getTime();
|
||||||
parameters.add(new ModelParameter(TransferCfg.FIELD_LAST_UPDATED_ON, date));
|
parameters.add(new ModelParameter(TransferCfg.FIELD_LAST_UPDATED_ON, date));
|
||||||
parameters.add(new ModelParameter(TransferCfg.FIELD_ID, transerId));
|
parameters.add(new ModelParameter(TransferCfg.FIELD_ID, transerId));
|
||||||
|
@ -284,6 +284,12 @@ public class LoanController implements Serializable {
|
|||||||
|
|
||||||
String comments = "Se pago " + precio + texto;
|
String comments = "Se pago " + precio + texto;
|
||||||
|
|
||||||
|
Date date = new Date();
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.setTime(date);
|
||||||
|
calendar.add(Calendar.HOUR_OF_DAY, -7);
|
||||||
|
date = calendar.getTime();
|
||||||
|
|
||||||
LoanDetails details = new LoanDetails(
|
LoanDetails details = new LoanDetails(
|
||||||
UUID.randomUUID().toString(),
|
UUID.randomUUID().toString(),
|
||||||
new Loan(feesToPayByLoanRequestJaxb.getIdLoan()),
|
new Loan(feesToPayByLoanRequestJaxb.getIdLoan()),
|
||||||
@ -294,7 +300,7 @@ public class LoanController implements Serializable {
|
|||||||
LoanDetailsType.PAYMENT,
|
LoanDetailsType.PAYMENT,
|
||||||
comments,
|
comments,
|
||||||
feesToPayByLoanRequestJaxb.getIdUser(),
|
feesToPayByLoanRequestJaxb.getIdUser(),
|
||||||
new Date());
|
date);
|
||||||
|
|
||||||
parameters.add(new ModelParameter(LoanDetailsCfg.FIELD_ID, ids));
|
parameters.add(new ModelParameter(LoanDetailsCfg.FIELD_ID, ids));
|
||||||
|
|
||||||
@ -408,9 +414,6 @@ public class LoanController implements Serializable {
|
|||||||
throw new Exception(user_unavailable);
|
throw new Exception(user_unavailable);
|
||||||
}
|
}
|
||||||
|
|
||||||
//DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
||||||
Date date = new Date();//dateFormat.parse(jaxb.getStrDate());
|
|
||||||
|
|
||||||
LoanByUser loanByUser = new LoanByUser(
|
LoanByUser loanByUser = new LoanByUser(
|
||||||
new LoanByUserId(null, jaxb.getUserId()),
|
new LoanByUserId(null, jaxb.getUserId()),
|
||||||
LoanStatus.PENDING,
|
LoanStatus.PENDING,
|
||||||
@ -420,6 +423,12 @@ public class LoanController implements Serializable {
|
|||||||
LoanType loanType = loanTypeRepository.findLoanType(jaxb.getLoanTypeId());
|
LoanType loanType = loanTypeRepository.findLoanType(jaxb.getLoanTypeId());
|
||||||
RouteCtlg routeCtlg = new RouteCtlg(jaxb.getRouteId());
|
RouteCtlg routeCtlg = new RouteCtlg(jaxb.getRouteId());
|
||||||
|
|
||||||
|
Date date = new Date();
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.setTime(date);
|
||||||
|
calendar.add(Calendar.HOUR_OF_DAY, -7);
|
||||||
|
date = calendar.getTime();
|
||||||
|
|
||||||
Loan loan = new Loan(
|
Loan loan = new Loan(
|
||||||
new LoanType(loanType.getId()),
|
new LoanType(loanType.getId()),
|
||||||
null,
|
null,
|
||||||
@ -548,7 +557,13 @@ public class LoanController implements Serializable {
|
|||||||
|
|
||||||
LoanFeeNotification notification = null;
|
LoanFeeNotification notification = null;
|
||||||
try {
|
try {
|
||||||
|
|
||||||
Date date = new Date();
|
Date date = new Date();
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.setTime(date);
|
||||||
|
calendar.add(Calendar.HOUR_OF_DAY, -7);
|
||||||
|
date = calendar.getTime();
|
||||||
|
|
||||||
List<ModelParameter> parameters = new ArrayList<>();
|
List<ModelParameter> parameters = new ArrayList<>();
|
||||||
|
|
||||||
Loan loan = loanRepository.findLoanById(transfer.getLoanId());
|
Loan loan = loanRepository.findLoanById(transfer.getLoanId());
|
||||||
@ -712,7 +727,12 @@ public class LoanController implements Serializable {
|
|||||||
PersonJaxb endorsement) throws Exception {
|
PersonJaxb endorsement) throws Exception {
|
||||||
logger.debug("renovation");
|
logger.debug("renovation");
|
||||||
try {
|
try {
|
||||||
|
|
||||||
Date date = new Date();
|
Date date = new Date();
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.setTime(date);
|
||||||
|
calendar.add(Calendar.HOUR_OF_DAY, -7);
|
||||||
|
date = calendar.getTime();
|
||||||
|
|
||||||
Loan currentLoan = loanRepository.findLoanById(loan);
|
Loan currentLoan = loanRepository.findLoanById(loan);
|
||||||
LoanType newCredit = loanTypeRepository.findLoanType(credit);
|
LoanType newCredit = loanTypeRepository.findLoanType(credit);
|
||||||
@ -844,7 +864,12 @@ public class LoanController implements Serializable {
|
|||||||
PersonJaxb endorsement) throws Exception {
|
PersonJaxb endorsement) throws Exception {
|
||||||
logger.debug("renovationHasPaymentToday");
|
logger.debug("renovationHasPaymentToday");
|
||||||
try {
|
try {
|
||||||
|
|
||||||
Date date = new Date();
|
Date date = new Date();
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.setTime(date);
|
||||||
|
calendar.add(Calendar.HOUR_OF_DAY, -7);
|
||||||
|
date = calendar.getTime();
|
||||||
|
|
||||||
Loan currentLoan = loanRepository.findLoanById(loan);
|
Loan currentLoan = loanRepository.findLoanById(loan);
|
||||||
LoanType newCredit = loanTypeRepository.findLoanType(credit);
|
LoanType newCredit = loanTypeRepository.findLoanType(credit);
|
||||||
@ -972,6 +997,12 @@ public class LoanController implements Serializable {
|
|||||||
totalAmountPaid = loan.getAmountPaid().add(discount);
|
totalAmountPaid = loan.getAmountPaid().add(discount);
|
||||||
newLastReferenceNumber = loan.getLastReferenceNumber() + 1;
|
newLastReferenceNumber = loan.getLastReferenceNumber() + 1;
|
||||||
|
|
||||||
|
Date date = new Date();
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.setTime(date);
|
||||||
|
calendar.add(Calendar.HOUR_OF_DAY, -7);
|
||||||
|
date = calendar.getTime();
|
||||||
|
|
||||||
loanDetails = new LoanDetails(
|
loanDetails = new LoanDetails(
|
||||||
new Loan(loanByRenovation.getLoanOld().getId()),
|
new Loan(loanByRenovation.getLoanOld().getId()),
|
||||||
new User(user),
|
new User(user),
|
||||||
@ -980,7 +1011,7 @@ public class LoanController implements Serializable {
|
|||||||
newLastReferenceNumber,
|
newLastReferenceNumber,
|
||||||
LoanDetailsType.RENOVATION_PAYMENT,
|
LoanDetailsType.RENOVATION_PAYMENT,
|
||||||
user,
|
user,
|
||||||
new Date(),
|
date,
|
||||||
"Retención de " + discount + " el la entrega del crédito renovado");
|
"Retención de " + discount + " el la entrega del crédito renovado");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1055,6 +1086,12 @@ public class LoanController implements Serializable {
|
|||||||
totalAmountPaid = loan.getAmountPaid().add(discount);
|
totalAmountPaid = loan.getAmountPaid().add(discount);
|
||||||
newLastReferenceNumber = loan.getLastReferenceNumber() + 1;
|
newLastReferenceNumber = loan.getLastReferenceNumber() + 1;
|
||||||
|
|
||||||
|
Date date = new Date();
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.setTime(date);
|
||||||
|
calendar.add(Calendar.HOUR_OF_DAY, -7);
|
||||||
|
date = calendar.getTime();
|
||||||
|
|
||||||
loanDetails = new LoanDetails(
|
loanDetails = new LoanDetails(
|
||||||
new Loan(loanByRenovation.getLoanOld().getId()),
|
new Loan(loanByRenovation.getLoanOld().getId()),
|
||||||
new User(user),
|
new User(user),
|
||||||
@ -1063,7 +1100,7 @@ public class LoanController implements Serializable {
|
|||||||
newLastReferenceNumber,
|
newLastReferenceNumber,
|
||||||
LoanDetailsType.RENOVATION_PAYMENT,
|
LoanDetailsType.RENOVATION_PAYMENT,
|
||||||
user,
|
user,
|
||||||
new Date(),
|
date,
|
||||||
"Retención de " + discount + " el la entrega del crédito renovado");
|
"Retención de " + discount + " el la entrega del crédito renovado");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1269,11 +1306,17 @@ public class LoanController implements Serializable {
|
|||||||
loans.add(new Loan(row.getIdLoan()));
|
loans.add(new Loan(row.getIdLoan()));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Date date = new Date();
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.setTime(date);
|
||||||
|
calendar.add(Calendar.HOUR_OF_DAY, -7);
|
||||||
|
date = calendar.getTime();
|
||||||
|
|
||||||
loanParams.add(new ModelParameter(LoanCfg.FIELD_LOAN_STATUS, loanStatus));
|
loanParams.add(new ModelParameter(LoanCfg.FIELD_LOAN_STATUS, loanStatus));
|
||||||
loanParams.add(new ModelParameter(LoanCfg.FIELD_AMOUNT_PAID, new BigDecimal(0)));
|
loanParams.add(new ModelParameter(LoanCfg.FIELD_AMOUNT_PAID, new BigDecimal(0)));
|
||||||
loanParams.add(new ModelParameter(LoanCfg.FIELD_LAST_REFERENCE_NUMBER, 0));
|
loanParams.add(new ModelParameter(LoanCfg.FIELD_LAST_REFERENCE_NUMBER, 0));
|
||||||
loanParams.add(new ModelParameter(LoanCfg.FIELD_LAST_UPDATED_BY, updateLoanToDeliveryStatusList.getIdUpdateUser()));
|
loanParams.add(new ModelParameter(LoanCfg.FIELD_LAST_UPDATED_BY, updateLoanToDeliveryStatusList.getIdUpdateUser()));
|
||||||
loanParams.add(new ModelParameter(LoanCfg.FIELD_LAST_UPDATED_ON, new Date()));
|
loanParams.add(new ModelParameter(LoanCfg.FIELD_LAST_UPDATED_ON, date));
|
||||||
loanParams.add(new ModelParameter(LoanCfg.FIELD_ID, ids));
|
loanParams.add(new ModelParameter(LoanCfg.FIELD_ID, ids));
|
||||||
|
|
||||||
loanByUserParams.add(new ModelParameter(LoanByUserCfg.FIELD_LOAN_BY_USER_STATUS, loanStatus));
|
loanByUserParams.add(new ModelParameter(LoanByUserCfg.FIELD_LOAN_BY_USER_STATUS, loanStatus));
|
||||||
@ -1300,7 +1343,12 @@ public class LoanController implements Serializable {
|
|||||||
logger.debug("updateLoanByIdFromCertifiedView");
|
logger.debug("updateLoanByIdFromCertifiedView");
|
||||||
try {
|
try {
|
||||||
List<ModelParameter> parameters = new ArrayList<>();
|
List<ModelParameter> parameters = new ArrayList<>();
|
||||||
|
|
||||||
Date date = new Date();
|
Date date = new Date();
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.setTime(date);
|
||||||
|
calendar.add(Calendar.HOUR_OF_DAY, -7);
|
||||||
|
date = calendar.getTime();
|
||||||
|
|
||||||
parameters.add(
|
parameters.add(
|
||||||
new ModelParameter(LoanCfg.FIELD_LOAN_STATUS, action ? LoanStatus.APPROVED : LoanStatus.REJECTED)
|
new ModelParameter(LoanCfg.FIELD_LOAN_STATUS, action ? LoanStatus.APPROVED : LoanStatus.REJECTED)
|
||||||
|
@ -23,6 +23,7 @@ import com.arrebol.apc.model.loan.LoanDetails;
|
|||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Calendar;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
@ -94,7 +95,13 @@ public class LoanByRenovationRepository extends GenericRepository implements Ser
|
|||||||
try {
|
try {
|
||||||
openConnection();
|
openConnection();
|
||||||
|
|
||||||
Date lastUpdatedOn = new Date();
|
Date date2 = new Date();
|
||||||
|
Calendar calendar2 = Calendar.getInstance();
|
||||||
|
calendar2.setTime(date2);
|
||||||
|
calendar2.add(Calendar.HOUR_OF_DAY, -7);
|
||||||
|
date2 = calendar2.getTime();
|
||||||
|
|
||||||
|
Date lastUpdatedOn = date2;
|
||||||
List<ModelParameter> parameters = new ArrayList<>();
|
List<ModelParameter> parameters = new ArrayList<>();
|
||||||
|
|
||||||
// Update loanByRenovation details in Renovation table
|
// Update loanByRenovation details in Renovation table
|
||||||
@ -172,13 +179,19 @@ public class LoanByRenovationRepository extends GenericRepository implements Ser
|
|||||||
getSession().save(loanDetails);
|
getSession().save(loanDetails);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Date date = new Date();
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.setTime(date);
|
||||||
|
calendar.add(Calendar.HOUR_OF_DAY, -7);
|
||||||
|
date = calendar.getTime();
|
||||||
|
|
||||||
// Insert delivery details (To know cash that certifier deliveried) in Delivery Table
|
// Insert delivery details (To know cash that certifier deliveried) in Delivery Table
|
||||||
Delivery delivery = new Delivery(
|
Delivery delivery = new Delivery(
|
||||||
new User(userId),
|
new User(userId),
|
||||||
new Loan(loanByRenovation.getLoanNew().getId()),
|
new Loan(loanByRenovation.getLoanNew().getId()),
|
||||||
amount,
|
amount,
|
||||||
userId,
|
userId,
|
||||||
new Date(),
|
date,
|
||||||
comission
|
comission
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@ import com.arrebol.apc.model.loan.LoanDetails;
|
|||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Calendar;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.persistence.Tuple;
|
import javax.persistence.Tuple;
|
||||||
@ -122,7 +123,13 @@ public class LoanDetailsRepository extends GenericRepository implements Serializ
|
|||||||
loan.setAmountPaid(totalFees);
|
loan.setAmountPaid(totalFees);
|
||||||
loan.setLastReferenceNumber(loan.getLastReferenceNumber() + 1);
|
loan.setLastReferenceNumber(loan.getLastReferenceNumber() + 1);
|
||||||
loan.setLastUpdatedBy(loanDetails.getCreatedBy());
|
loan.setLastUpdatedBy(loanDetails.getCreatedBy());
|
||||||
loan.setLastUpdatedOn(new Date());
|
|
||||||
|
Date date = new Date();
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.setTime(date);
|
||||||
|
calendar.add(Calendar.HOUR_OF_DAY, -7);
|
||||||
|
date = calendar.getTime();
|
||||||
|
loan.setLastUpdatedOn(date);
|
||||||
|
|
||||||
sssn.update(loan);
|
sssn.update(loan);
|
||||||
|
|
||||||
|
@ -14,6 +14,7 @@ import com.arrebol.apc.model.core.User;
|
|||||||
import com.arrebol.apc.model.enums.GenericStatus;
|
import com.arrebol.apc.model.enums.GenericStatus;
|
||||||
import com.arrebol.apc.model.gasoline.Gasoline;
|
import com.arrebol.apc.model.gasoline.Gasoline;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.Calendar;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import javax.ws.rs.FormParam;
|
import javax.ws.rs.FormParam;
|
||||||
@ -46,6 +47,12 @@ public class GasolineWS implements Serializable {
|
|||||||
try {
|
try {
|
||||||
GasolineController controller = new GasolineController();
|
GasolineController controller = new GasolineController();
|
||||||
|
|
||||||
|
Date date = new Date();
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.setTime(date);
|
||||||
|
calendar.add(Calendar.HOUR_OF_DAY, -7);
|
||||||
|
date = calendar.getTime();
|
||||||
|
|
||||||
Gasoline gasoline = new Gasoline(
|
Gasoline gasoline = new Gasoline(
|
||||||
UUID.randomUUID().toString(),
|
UUID.randomUUID().toString(),
|
||||||
new User(idUser),
|
new User(idUser),
|
||||||
@ -57,7 +64,7 @@ public class GasolineWS implements Serializable {
|
|||||||
GenericStatus.ENABLED,
|
GenericStatus.ENABLED,
|
||||||
description,
|
description,
|
||||||
idUser,
|
idUser,
|
||||||
new Date());
|
date);
|
||||||
|
|
||||||
if (controller.saveNewGasolinePayment(gasoline)) {
|
if (controller.saveNewGasolinePayment(gasoline)) {
|
||||||
response = Response.ok().build();
|
response = Response.ok().build();
|
||||||
|
@ -22,12 +22,12 @@ import com.arrebol.apc.model.enums.TransferStatus;
|
|||||||
import com.arrebol.apc.model.loan.Loan;
|
import com.arrebol.apc.model.loan.Loan;
|
||||||
import com.arrebol.apc.model.loan.LoanDetails;
|
import com.arrebol.apc.model.loan.LoanDetails;
|
||||||
import com.arrebol.apc.model.system.logs.Bitacora;
|
import com.arrebol.apc.model.system.logs.Bitacora;
|
||||||
import com.arrebol.apc.model.ws.parsed.LoanRequestedJaxb;
|
|
||||||
import com.arrebol.apc.model.views.AvailableCustomersView;
|
import com.arrebol.apc.model.views.AvailableCustomersView;
|
||||||
import com.arrebol.apc.model.views.AvailableEndorsementsView;
|
import com.arrebol.apc.model.views.AvailableEndorsementsView;
|
||||||
import com.arrebol.apc.model.views.LoanToDeliveryByCertifierView;
|
import com.arrebol.apc.model.views.LoanToDeliveryByCertifierView;
|
||||||
import com.arrebol.apc.model.ws.parsed.FeesToPayByLoanRequestJaxb;
|
import com.arrebol.apc.model.ws.parsed.FeesToPayByLoanRequestJaxb;
|
||||||
import com.arrebol.apc.model.ws.parsed.LoanDetailJaxb;
|
import com.arrebol.apc.model.ws.parsed.LoanDetailJaxb;
|
||||||
|
import com.arrebol.apc.model.ws.parsed.LoanRequestedJaxb;
|
||||||
import com.arrebol.apc.model.ws.parsed.NewAmountJaxb;
|
import com.arrebol.apc.model.ws.parsed.NewAmountJaxb;
|
||||||
import com.arrebol.apc.model.ws.parsed.NewTransferAccountJaxb;
|
import com.arrebol.apc.model.ws.parsed.NewTransferAccountJaxb;
|
||||||
import com.arrebol.apc.model.ws.parsed.RenovationWithEndorsementJaxb;
|
import com.arrebol.apc.model.ws.parsed.RenovationWithEndorsementJaxb;
|
||||||
@ -314,9 +314,8 @@ public class LoanWS implements Serializable {
|
|||||||
Response response;
|
Response response;
|
||||||
try {
|
try {
|
||||||
/**
|
/**
|
||||||
* This method is for get all loan types applying some business
|
* This method is for get all loan types applying some business rules,
|
||||||
* rules, like number of Fees and if you are ok in 100% you can get
|
* like number of Fees and if you are ok in 100% you can get next loan.
|
||||||
* next loan.
|
|
||||||
*/
|
*/
|
||||||
//response = Response.ok(loanController.findNewCreditLimit(office, loan)).build();
|
//response = Response.ok(loanController.findNewCreditLimit(office, loan)).build();
|
||||||
response = Response.ok(loanController.findAllLoansTypeByOffice(office)).build();
|
response = Response.ok(loanController.findAllLoansTypeByOffice(office)).build();
|
||||||
|
Loading…
Reference in New Issue
Block a user