Compare commits

...

3 Commits

22 changed files with 1970 additions and 1587 deletions

View File

@ -7,10 +7,13 @@
*/
package com.arrebol.apc.controller.mobile.controller.customer;
import com.arrebol.apc.controller.mobile.repository.views.CustomerWithoutRenovationViewRepository;
import com.arrebol.apc.controller.mobile.repository.views.LoanByUserViewRepository;
import com.arrebol.apc.model.ModelParameter;
import com.arrebol.apc.model.core.constance.CustomerWithoutRenovationViewCfg;
import com.arrebol.apc.model.core.constance.LoanByUserViewCfg;
import com.arrebol.apc.model.enums.PreferenceValue;
import com.arrebol.apc.model.views.CustomerWithoutRenovationView;
import com.arrebol.apc.model.views.LoanByUserView;
import java.io.Serializable;
import java.util.ArrayList;
@ -52,12 +55,37 @@ public class CustomerController implements Serializable {
}
}
/**
*
* @param idRoute
* @return
* @throws Exception
*/
public List<CustomerWithoutRenovationView> findAllNonRenewingCustomersByRuteId(String idRoute) throws Exception {
try {
List<ModelParameter> parameters = new ArrayList<>();
parameters.add(new ModelParameter(CustomerWithoutRenovationViewCfg.FIELD_RUTE_ID, idRoute));
return customerWithoutRenovationViewRepository
.nonRenewingCustomersByRuteId(
CustomerWithoutRenovationViewCfg.QUERY_FIND_ALL_UNRENEWED_CUSTOMERS_BY_ROUTE,
parameters
);
} catch (Exception e) {
logger.error("findAllLoansByUserId", e);
throw e;
}
}
private static final long serialVersionUID = -6689182942800786108L;
final Logger logger = LogManager.getLogger(CustomerController.class);
private final LoanByUserViewRepository loanByUserViewRepository;
private final CustomerWithoutRenovationViewRepository customerWithoutRenovationViewRepository;
public CustomerController() {
this.loanByUserViewRepository = new LoanByUserViewRepository();
this.customerWithoutRenovationViewRepository = new CustomerWithoutRenovationViewRepository();
}
}

View File

@ -22,6 +22,7 @@ import com.arrebol.apc.model.ws.parsed.Exchange;
import com.arrebol.apc.model.ws.parsed.ExchangeJaxb;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import org.apache.logging.log4j.LogManager;
@ -109,7 +110,12 @@ public class ExchangeEnebledUsersController implements Serializable {
parameters.add(new ModelParameter(TransferCfg.FIELD_ACTION_STATUS, isApproved ? ActionStatus.APPROVED : ActionStatus.REJECTED));
parameters.add(new ModelParameter(TransferCfg.FIELD_LAST_UPDATED_BY, userId));
parameters.add(new ModelParameter(TransferCfg.FIELD_LAST_UPDATED_ON, 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(new ModelParameter(TransferCfg.FIELD_LAST_UPDATED_ON, date));
parameters.add(new ModelParameter(TransferCfg.FIELD_ID, transerId));
return transferRepository.updateTransfer(TransferCfg.QUERY_UPDATE_TRANSFER_BY_ACTION, parameters);

View File

@ -284,6 +284,12 @@ public class LoanController implements Serializable {
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(
UUID.randomUUID().toString(),
new Loan(feesToPayByLoanRequestJaxb.getIdLoan()),
@ -294,7 +300,7 @@ public class LoanController implements Serializable {
LoanDetailsType.PAYMENT,
comments,
feesToPayByLoanRequestJaxb.getIdUser(),
new Date());
date);
parameters.add(new ModelParameter(LoanDetailsCfg.FIELD_ID, ids));
@ -408,9 +414,6 @@ public class LoanController implements Serializable {
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(
new LoanByUserId(null, jaxb.getUserId()),
LoanStatus.PENDING,
@ -420,6 +423,12 @@ public class LoanController implements Serializable {
LoanType loanType = loanTypeRepository.findLoanType(jaxb.getLoanTypeId());
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(
new LoanType(loanType.getId()),
null,
@ -548,7 +557,13 @@ public class LoanController implements Serializable {
LoanFeeNotification notification = null;
try {
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<>();
Loan loan = loanRepository.findLoanById(transfer.getLoanId());
@ -712,7 +727,12 @@ public class LoanController implements Serializable {
PersonJaxb endorsement) throws Exception {
logger.debug("renovation");
try {
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);
LoanType newCredit = loanTypeRepository.findLoanType(credit);
@ -844,7 +864,12 @@ public class LoanController implements Serializable {
PersonJaxb endorsement) throws Exception {
logger.debug("renovationHasPaymentToday");
try {
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);
LoanType newCredit = loanTypeRepository.findLoanType(credit);
@ -972,6 +997,12 @@ public class LoanController implements Serializable {
totalAmountPaid = loan.getAmountPaid().add(discount);
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(
new Loan(loanByRenovation.getLoanOld().getId()),
new User(user),
@ -980,7 +1011,7 @@ public class LoanController implements Serializable {
newLastReferenceNumber,
LoanDetailsType.RENOVATION_PAYMENT,
user,
new Date(),
date,
"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);
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(
new Loan(loanByRenovation.getLoanOld().getId()),
new User(user),
@ -1063,7 +1100,7 @@ public class LoanController implements Serializable {
newLastReferenceNumber,
LoanDetailsType.RENOVATION_PAYMENT,
user,
new Date(),
date,
"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()));
});
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_AMOUNT_PAID, new BigDecimal(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_ON, new Date()));
loanParams.add(new ModelParameter(LoanCfg.FIELD_LAST_UPDATED_ON, date));
loanParams.add(new ModelParameter(LoanCfg.FIELD_ID, ids));
loanByUserParams.add(new ModelParameter(LoanByUserCfg.FIELD_LOAN_BY_USER_STATUS, loanStatus));
@ -1300,7 +1343,12 @@ public class LoanController implements Serializable {
logger.debug("updateLoanByIdFromCertifiedView");
try {
List<ModelParameter> parameters = new ArrayList<>();
Date date = new Date();
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
calendar.add(Calendar.HOUR_OF_DAY, -7);
date = calendar.getTime();
parameters.add(
new ModelParameter(LoanCfg.FIELD_LOAN_STATUS, action ? LoanStatus.APPROVED : LoanStatus.REJECTED)

View File

@ -23,6 +23,7 @@ import com.arrebol.apc.model.loan.LoanDetails;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import org.apache.logging.log4j.LogManager;
@ -94,7 +95,13 @@ public class LoanByRenovationRepository extends GenericRepository implements Ser
try {
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<>();
// Update loanByRenovation details in Renovation table
@ -172,13 +179,19 @@ public class LoanByRenovationRepository extends GenericRepository implements Ser
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
Delivery delivery = new Delivery(
new User(userId),
new Loan(loanByRenovation.getLoanNew().getId()),
amount,
userId,
new Date(),
date,
comission
);

View File

@ -16,6 +16,7 @@ import com.arrebol.apc.model.loan.LoanDetails;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import javax.persistence.Tuple;
@ -122,7 +123,13 @@ public class LoanDetailsRepository extends GenericRepository implements Serializ
loan.setAmountPaid(totalFees);
loan.setLastReferenceNumber(loan.getLastReferenceNumber() + 1);
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);

View File

@ -0,0 +1,54 @@
/*
* Arrebol Consultancy copyright.
*
* This code belongs to Arrebol Consultancy
* its use, redistribution or modification are prohibited
* without written authorization from Arrebol Consultancy.
*/
package com.arrebol.apc.controller.mobile.repository.views;
import com.arrebol.apc.controller.mobile.repository.GenericRepository;
import com.arrebol.apc.model.ModelParameter;
import com.arrebol.apc.model.views.CustomerWithoutRenovationView;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
/**
*
* @author Carlos Janitzio Zavala Lopez <janitzio.zavala@arrebol.com.mx>
*/
public class CustomerWithoutRenovationViewRepository extends GenericRepository implements Serializable {
/**
*
* @param xmlQuery
* @param parameters
* @return
* @throws Exception
*/
public List<CustomerWithoutRenovationView> nonRenewingCustomersByRuteId(String xmlQuery, List<ModelParameter> parameters) throws Exception {
logger.debug("nonRenewingCustomersByRuteId");
List<CustomerWithoutRenovationView> results = new ArrayList<>();
try {
results = createNamedQueryResultList(
CustomerWithoutRenovationView.class,
xmlQuery,
parameters
);
} catch (Exception e) {
logger.error("nonRenewingCustomersByRuteId", e);
throw e;
}
return results;
}
private static final long serialVersionUID = 5669198954766725476L;
final Logger logger = LogManager.getLogger(CustomerWithoutRenovationViewRepository.class);
}

View File

@ -220,6 +220,7 @@
<mapping resource="com/arrebol/apc/model/queries/mobile/views/loan.in.pending.status.to.delivery.view.hbm.xml" />
<mapping resource="com/arrebol/apc/model/queries/loan/loan.employee.hbm.xml" />
<mapping resource="com/arrebol/apc/model/queries/mobile/views/current.customer.by.loan.view.hbm.xml" />
<mapping resource="com/arrebol/apc/model/queries/mobile/views/customer.without.renovation.view.queries.hbm.xml" />
<mapping resource="com/arrebol/apc/model/queries/mobile/views/availables.owners.view.hbm.xml" />
<mapping resource="com/arrebol/apc/model/queries/mobile/reports/user.week.report.hbm.xml" />
<mapping resource="com/arrebol/apc/model/queries/mobile/gasoline/gasoline.hbm.xml" />

View File

@ -216,6 +216,7 @@
<mapping resource="com/arrebol/apc/model/queries/mobile/views/loan.in.pending.status.to.delivery.view.hbm.xml" />
<mapping resource="com/arrebol/apc/model/queries/loan/loan.employee.hbm.xml" />
<mapping resource="com/arrebol/apc/model/queries/mobile/views/current.customer.by.loan.view.hbm.xml" />
<mapping resource="com/arrebol/apc/model/queries/mobile/views/customer.without.renovation.view.queries.hbm.xml" />
<mapping resource="com/arrebol/apc/model/queries/mobile/views/availables.owners.view.hbm.xml" />
<mapping resource="com/arrebol/apc/model/queries/mobile/reports/user.week.report.hbm.xml" />
<mapping resource="com/arrebol/apc/model/queries/mobile/gasoline/gasoline.hbm.xml" />

View File

@ -80,8 +80,8 @@
<id>Localhost</id>
<properties>
<hibernate.connection.url>jdbc:mysql://localhost:3306/apo_pro_com_april_ten?serverTimezone=GMT-5</hibernate.connection.url>
<hibernate.connection.username>apoprocomlocalhost</hibernate.connection.username>
<hibernate.connection.password>Yj$2Da0z!</hibernate.connection.password>
<hibernate.connection.username>root</hibernate.connection.username>
<hibernate.connection.password>root</hibernate.connection.password>
<hibernate.connection.min_size>10</hibernate.connection.min_size>
<hibernate.connection.max_size>40</hibernate.connection.max_size>
<hibernate.connection.timeout>1800</hibernate.connection.timeout>

View File

@ -113,7 +113,7 @@ public class OtherExpense implements Serializable {
Date date = new Date();
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
calendar.add(Calendar.DAY_OF_YEAR, -1);
calendar.add(Calendar.HOUR, -7);
date = calendar.getTime();
this.createdOn = date;
}

View File

@ -13,8 +13,8 @@ import com.arrebol.apc.model.enums.ActionStatus;
import com.arrebol.apc.model.enums.ActiveStatus;
import java.io.Serializable;
import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.logging.Level;
import java.util.logging.Logger;
@ -120,7 +120,12 @@ public class Transfer implements Serializable {
this.amountToTransfer = amountToTransfer;
this.office = office;
this.createdBy = createdBy;
this.createdOn = new Date();
Date date = new Date();
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
calendar.add(Calendar.HOUR, -7);
date = calendar.getTime();
this.createdOn = date;
}
/**
@ -243,14 +248,14 @@ public class Transfer implements Serializable {
this.office = office;
}
public String getUserReceiverRoutes(){
public String getUserReceiverRoutes() {
String routes = "";
routes = userReceiver.getHumanResource().getHumanResourceHasRoutes().stream().map((py) -> py.getRouteCtlg().getRoute()).collect(Collectors.joining(", "));
return routes;
}
public String getUserTransmitterRoutes(){
public String getUserTransmitterRoutes() {
String routes = "";
routes = userTransmitter.getHumanResource().getHumanResourceHasRoutes().stream().map((py) -> py.getRouteCtlg().getRoute()).collect(Collectors.joining(", "));
@ -283,11 +288,12 @@ public class Transfer implements Serializable {
}
public String conditionEnabled() {
if(getActiveStatus() == ActiveStatus.DISABLED)
if (getActiveStatus() == ActiveStatus.DISABLED) {
return "grayRow";
else
} else {
return null;
}
}
@Override
public String toString() {

View File

@ -0,0 +1,19 @@
/*
* Arrebol Consultancy copyright.
*
* This code belongs to Arrebol Consultancy
* its use, redistribution or modification are prohibited
* without written authorization from Arrebol Consultancy.
*/
package com.arrebol.apc.model.core.constance;
/**
*
* @author Carlos Janitzio Zavala Lopez <janitzio.zavala@arrebol.com.mx>
*/
public interface CustomerWithoutRenovationViewCfg extends GenericCfg {
String QUERY_FIND_ALL_UNRENEWED_CUSTOMERS_BY_ROUTE = "findAllNonRenewingCustomersByRuteIdList";
String FIELD_RUTE_ID = "idRoute";
}

View File

@ -0,0 +1,137 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.arrebol.apc.model.views;
import java.io.Serializable;
import java.util.Date;
/**
*
* @author Oscar
*/
public class CustomerWithoutRenovationSimpleDTO implements Serializable {
private static final long serialVersionUID = 1L;
private String personName;
private Date lastLoan;
private String amountPaid;
private String amountToPay;
private String saldoInsoluto;
private String actionNumber;
private String numFee;
private String addressHome;
private String addressBusiness;
private String companyName;
private String strPaymentDate;
// Constructor
public CustomerWithoutRenovationSimpleDTO() {
}
// Constructor desde entidad
public CustomerWithoutRenovationSimpleDTO(CustomerWithoutRenovationView entity) {
this.personName = entity.getPersonName();
this.lastLoan = entity.getLastLoan();
this.amountPaid = entity.getAmountPaid();
this.amountToPay = entity.getAmountToPay();
this.saldoInsoluto = entity.getSaldoInsoluto();
this.actionNumber = entity.getActionNumber();
this.numFee = entity.getNumFee();
this.addressHome = entity.getAddressHome();
this.addressBusiness = entity.getAddressBusiness();
this.companyName = entity.getCompanyName();
this.strPaymentDate = entity.getStrPaymentDate();
}
public String getPersonName() {
return personName;
}
public void setPersonName(String personName) {
this.personName = personName;
}
public Date getLastLoan() {
return lastLoan;
}
public void setLastLoan(Date lastLoan) {
this.lastLoan = lastLoan;
}
public String getAmountPaid() {
return amountPaid;
}
public void setAmountPaid(String amountPaid) {
this.amountPaid = amountPaid;
}
public String getAmountToPay() {
return amountToPay;
}
public void setAmountToPay(String amountToPay) {
this.amountToPay = amountToPay;
}
public String getSaldoInsoluto() {
return saldoInsoluto;
}
public void setSaldoInsoluto(String saldoInsoluto) {
this.saldoInsoluto = saldoInsoluto;
}
public String getActionNumber() {
return actionNumber;
}
public void setActionNumber(String actionNumber) {
this.actionNumber = actionNumber;
}
public String getNumFee() {
return numFee;
}
public void setNumFee(String numFee) {
this.numFee = numFee;
}
public String getAddressHome() {
return addressHome;
}
public void setAddressHome(String addressHome) {
this.addressHome = addressHome;
}
public String getAddressBusiness() {
return addressBusiness;
}
public void setAddressBusiness(String addressBusiness) {
this.addressBusiness = addressBusiness;
}
public String getCompanyName() {
return companyName;
}
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
public String getStrPaymentDate() {
return strPaymentDate;
}
public void setStrPaymentDate(String strPaymentDate) {
this.strPaymentDate = strPaymentDate;
}
}

View File

@ -42,6 +42,9 @@ public class CustomerWithoutRenovationView implements Serializable {
@Column(name = "route_name")
private String routeName;
@Column(name = "id_route")
private String idRoute;
@Column(name = "last_loan")
@Temporal(javax.persistence.TemporalType.DATE)
private Date lastLoan;
@ -70,9 +73,6 @@ public class CustomerWithoutRenovationView implements Serializable {
@Column(name = "company_name")
private String companyName;
@ManyToOne(fetch = FetchType.LAZY, optional = false)
@JoinColumn(
name = "id_office",
@ -196,7 +196,13 @@ public class CustomerWithoutRenovationView implements Serializable {
this.companyName = companyName;
}
public String getIdRoute() {
return idRoute;
}
public void setIdRoute(String idRoute) {
this.idRoute = idRoute;
}
@Override
public int hashCode() {

View File

@ -222,6 +222,7 @@
<mapping resource="com/arrebol/apc/model/queries/mobile/views/loan.in.pending.status.to.delivery.view.hbm.xml" />
<mapping resource="com/arrebol/apc/model/queries/loan/loan.employee.hbm.xml" />
<mapping resource="com/arrebol/apc/model/queries/mobile/views/current.customer.by.loan.view.hbm.xml" />
<mapping resource="com/arrebol/apc/model/queries/mobile/views/customer.without.renovation.view.queries.hbm.xml" />
<mapping resource="com/arrebol/apc/model/queries/mobile/views/availables.owners.view.hbm.xml" />
<mapping resource="com/arrebol/apc/model/queries/mobile/reports/user.week.report.hbm.xml" />
<mapping resource="com/arrebol/apc/model/queries/mobile/gasoline/gasoline.hbm.xml" />

View File

@ -0,0 +1,17 @@
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"https://hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<query name="findAllNonRenewingCustomersByRuteIdList">
<![CDATA[
SELECT
view
FROM CustomerWithoutRenovationView view
WHERE
idRoute = :idRoute
ORDER BY personName DESC
]]>
</query>
</hibernate-mapping>

View File

@ -140,8 +140,8 @@
<id>Localhost</id>
<properties>
<hibernate.connection.url>jdbc:mysql://localhost:3306/apo_pro_com_april_ten?serverTimezone=GMT-5</hibernate.connection.url>
<hibernate.connection.username>apoprocomlocalhost</hibernate.connection.username>
<hibernate.connection.password>Yj$2Da0z!</hibernate.connection.password>
<hibernate.connection.username>root</hibernate.connection.username>
<hibernate.connection.password>root</hibernate.connection.password>
</properties>
</profile>
<profile>

View File

@ -206,11 +206,11 @@
</properties>
</profile>
<profile>
<id>Localhost-Mobile-APP</id>
<id>Localhost</id>
<properties>
<hibernate.connection.url>jdbc:mysql://localhost:3306/apo_pro_com_april_ten?serverTimezone=GMT-5</hibernate.connection.url>
<hibernate.connection.username>apoprocommobilelocalhost</hibernate.connection.username>
<hibernate.connection.password>0Ps$6%q8</hibernate.connection.password>
<hibernate.connection.username>root</hibernate.connection.username>
<hibernate.connection.password>root</hibernate.connection.password>
</properties>
</profile>
<profile>

View File

@ -8,13 +8,18 @@
package com.arrebol.apc.ws.customer;
import com.arrebol.apc.controller.mobile.controller.customer.CustomerController;
import com.arrebol.apc.model.views.CustomerWithoutRenovationSimpleDTO;
import com.arrebol.apc.model.views.CustomerWithoutRenovationView;
import com.arrebol.apc.model.views.LoanByUserView;
import java.io.Serializable;
import java.util.List;
import java.util.stream.Collectors;
import javax.ws.rs.FormParam;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.GenericEntity;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
@ -49,6 +54,33 @@ public class CustomerWS implements Serializable {
return response;
}
@GET
@Path("nonRenewingCustomersByRuteId")
@Produces(MediaType.APPLICATION_JSON)
public Response findAllNonRenewingCustomersByRuteId(@QueryParam("idRoute") String idRoute) {
logger.debug("findAllNonRenewingCustomersByRuteId");
Response response;
try {
List<CustomerWithoutRenovationView> originalList = controller.findAllNonRenewingCustomersByRuteId(idRoute);
// Convertir a DTOs
List<CustomerWithoutRenovationSimpleDTO> simplifiedList = originalList.stream()
.map(CustomerWithoutRenovationSimpleDTO::new)
.collect(Collectors.toList());
GenericEntity<List<CustomerWithoutRenovationSimpleDTO>> list
= new GenericEntity<List<CustomerWithoutRenovationSimpleDTO>>(simplifiedList) {
};
response = Response.ok(list).build();
} catch (Exception e) {
logger.error("findAllNonRenewingCustomersByRuteId", e);
response = Response.status(Response.Status.NOT_ACCEPTABLE).build();
}
return response;
}
final Logger logger = LogManager.getLogger(CustomerWS.class);
private final CustomerController controller;

View File

@ -14,6 +14,7 @@ import com.arrebol.apc.model.core.User;
import com.arrebol.apc.model.enums.GenericStatus;
import com.arrebol.apc.model.gasoline.Gasoline;
import java.io.Serializable;
import java.util.Calendar;
import java.util.Date;
import java.util.UUID;
import javax.ws.rs.FormParam;
@ -46,6 +47,12 @@ public class GasolineWS implements Serializable {
try {
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(
UUID.randomUUID().toString(),
new User(idUser),
@ -57,7 +64,7 @@ public class GasolineWS implements Serializable {
GenericStatus.ENABLED,
description,
idUser,
new Date());
date);
if (controller.saveNewGasolinePayment(gasoline)) {
response = Response.ok().build();

View File

@ -22,12 +22,12 @@ import com.arrebol.apc.model.enums.TransferStatus;
import com.arrebol.apc.model.loan.Loan;
import com.arrebol.apc.model.loan.LoanDetails;
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.AvailableEndorsementsView;
import com.arrebol.apc.model.views.LoanToDeliveryByCertifierView;
import com.arrebol.apc.model.ws.parsed.FeesToPayByLoanRequestJaxb;
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.NewTransferAccountJaxb;
import com.arrebol.apc.model.ws.parsed.RenovationWithEndorsementJaxb;
@ -314,9 +314,8 @@ public class LoanWS implements Serializable {
Response response;
try {
/**
* This method is for get all loan types applying some business
* rules, like number of Fees and if you are ok in 100% you can get
* next loan.
* This method is for get all loan types applying some business rules,
* like number of Fees and if you are ok in 100% you can get next loan.
*/
//response = Response.ok(loanController.findNewCreditLimit(office, loan)).build();
response = Response.ok(loanController.findAllLoansTypeByOffice(office)).build();

View File

@ -216,6 +216,7 @@
<mapping resource="com/arrebol/apc/model/queries/mobile/views/loan.in.pending.status.to.delivery.view.hbm.xml" />
<mapping resource="com/arrebol/apc/model/queries/loan/loan.employee.hbm.xml" />
<mapping resource="com/arrebol/apc/model/queries/mobile/views/current.customer.by.loan.view.hbm.xml" />
<mapping resource="com/arrebol/apc/model/queries/mobile/views/customer.without.renovation.view.queries.hbm.xml" />
<mapping resource="com/arrebol/apc/model/queries/mobile/views/availables.owners.view.hbm.xml" />
<mapping resource="com/arrebol/apc/model/queries/mobile/reports/user.week.report.hbm.xml" />
<mapping resource="com/arrebol/apc/model/queries/mobile/gasoline/gasoline.hbm.xml" />