- APARTADO PARA CAPTURAR EL IDENTIFICADOR DE FOLIOS POR EMPLEADO EN EL REGISTRO

- APARTADO PARA PODER EDITAR EL IDENTIFICADOR DE FOLIOS. 
- ACTUALIZACIÓN DEL WEB SERVIRSE PARA EL MANEJO DE LOS NUEVOS DATOS DE CAPTURA PARA LAS VENTAS "FACHADA DE LA CASA", "DESCRIPCIÓN", "LONGITUD" Y "LATITUD
- CORRECCIÓN DE ERROR AL CAPTURAR LOS PAGOS POR TRANSFERENCIA
- INVENTARIO DE PRODUCTOS SE AGREGARÁ USUARIO QUE HIZO EL MOVIMIENTO Y FECHA. TENDRA UNA EXPORTACION EN EXCEL.
This commit is contained in:
Brayan.Gonzalez 2025-07-28 12:19:25 -06:00
parent c25d8fb371
commit 0d10bf21e2
26 changed files with 3518 additions and 2836 deletions

View File

@ -10,7 +10,6 @@ package com.arrebol.apc.controller.mobile.controller.loan;
import com.arrebol.apc.controller.mobile.json.loan.AuthorizeTransferList; import com.arrebol.apc.controller.mobile.json.loan.AuthorizeTransferList;
import com.arrebol.apc.controller.mobile.json.loan.AuthorizeTransferPaymentsDto; import com.arrebol.apc.controller.mobile.json.loan.AuthorizeTransferPaymentsDto;
import com.arrebol.apc.controller.mobile.json.loan.DeleteLoanDetailsJaxb; import com.arrebol.apc.controller.mobile.json.loan.DeleteLoanDetailsJaxb;
import com.arrebol.apc.model.ws.parsed.LoanRequestedJaxb;
import com.arrebol.apc.controller.mobile.json.loan.LoanTypeJaxb; import com.arrebol.apc.controller.mobile.json.loan.LoanTypeJaxb;
import com.arrebol.apc.controller.mobile.json.loan.LoanTypeListJaxb; import com.arrebol.apc.controller.mobile.json.loan.LoanTypeListJaxb;
import com.arrebol.apc.controller.mobile.json.loan.UpdateLoanToDeliveryStatusDTO; import com.arrebol.apc.controller.mobile.json.loan.UpdateLoanToDeliveryStatusDTO;
@ -65,6 +64,7 @@ import com.arrebol.apc.model.views.constance.LoanInPendingStatusToDeliveryViewCf
import com.arrebol.apc.model.views.constance.TransferInPendingStatusViewCfg; import com.arrebol.apc.model.views.constance.TransferInPendingStatusViewCfg;
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.PersonJaxb; import com.arrebol.apc.model.ws.parsed.PersonJaxb;
@ -407,8 +407,7 @@ 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();
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()),
@ -431,7 +430,11 @@ public class LoanController implements Serializable {
jaxb.getUserId(), jaxb.getUserId(),
date, date,
jaxb.getCustomer().isCreatePerson() ? ActiveStatus.ENEBLED : ActiveStatus.DISABLED, jaxb.getCustomer().isCreatePerson() ? ActiveStatus.ENEBLED : ActiveStatus.DISABLED,
ActiveStatus.DISABLED // FROZEN funcationality ActiveStatus.DISABLED,
jaxb.getFachadaCasa(),
jaxb.getDescripcion(),
jaxb.getLatitud(),
jaxb.getLongitud()
); );
return loanRepository.createLoan( return loanRepository.createLoan(
loan, loan,
@ -496,7 +499,8 @@ public class LoanController implements Serializable {
newAmountJaxb.isFee() ? LoanDetailsType.FEE : LoanDetailsType.PAYMENT, newAmountJaxb.isFee() ? LoanDetailsType.FEE : LoanDetailsType.PAYMENT,
newAmountJaxb.getUserId(), newAmountJaxb.getUserId(),
date, date,
newAmountJaxb.getComments() newAmountJaxb.getComments(),
newAmountJaxb.getFolio()
); );
BigDecimal newAmountPaid, newAmountToPay; BigDecimal newAmountPaid, newAmountToPay;
@ -550,7 +554,7 @@ public class LoanController implements Serializable {
Loan loan = loanRepository.findLoanById(transfer.getLoanId()); Loan loan = loanRepository.findLoanById(transfer.getLoanId());
int referenceNumber = loan.getLastReferenceNumber() + 1; int referenceNumber = loan.getLastReferenceNumber() + 1;
BigDecimal amountWithoutIVA = transfer.getAmount().divide(new BigDecimal(1.16)); BigDecimal amountWithoutIVA = transfer.getAmount().divide(new BigDecimal(1.16), RoundingMode.FLOOR);
amountWithoutIVA = amountWithoutIVA.setScale(2, RoundingMode.FLOOR); amountWithoutIVA = amountWithoutIVA.setScale(2, RoundingMode.FLOOR);
@ -572,7 +576,8 @@ public class LoanController implements Serializable {
date, date,
transfer.getComments(), transfer.getComments(),
null == transfer.getTransferReference() || transfer.getTransferReference().trim().equals("") ? "Asesor no guardo la referencia de la transferencia. Rechar directamente o solicitar con el administrador la aclaración." : transfer.getTransferReference(), null == transfer.getTransferReference() || transfer.getTransferReference().trim().equals("") ? "Asesor no guardo la referencia de la transferencia. Rechar directamente o solicitar con el administrador la aclaración." : transfer.getTransferReference(),
TransferStatus.PENDING TransferStatus.PENDING,
transfer.getFolio()
); );
BigDecimal newAmountPaid = loan.getAmountPaid().add(amountWithoutIVA); BigDecimal newAmountPaid = loan.getAmountPaid().add(amountWithoutIVA);
@ -1128,6 +1133,48 @@ public class LoanController implements Serializable {
} }
} }
/**
*
* @param idUser
* @return
* @throws Exception
*/
public List<LoanDetailJaxb> latestFolioByUser(String idUser) throws Exception {
logger.debug("latestFolioByUser");
try {
List<ModelParameter> parameters = new ArrayList<>();
parameters.add(new ModelParameter(LoanDetailsCfg.FIELD_USER, new User(idUser)));
return loanApprovedDetailViewRepository.findLoanDetailsFromTikedByLoan(
LoanDetailsCfg.QUERY_FIND_LAST_LOAN_BY_USER,
parameters
);
} catch (Exception e) {
logger.error("approvedDetailsFromTiketByIdLoan", e);
throw e;
}
}
/**
*
* @param idLoan
* @return
* @throws Exception
*/
public LoanRequestedJaxb loanById(String idLoan) throws Exception {
logger.debug("loanById");
try {
List<ModelParameter> parameters = new ArrayList<>();
parameters.add(new ModelParameter("id", idLoan));
return loanApprovedDetailViewRepository.findLoanById(
LoanCfg.QUERY_FIND_LOAN_BY_ID,
parameters
);
} catch (Exception e) {
logger.error("loanById", e);
throw e;
}
}
/** /**
* Searching all loan details by id. * Searching all loan details by id.
* *

View File

@ -42,7 +42,8 @@ public class LoginWSController implements Serializable {
mobileUser.getOfficeId(), mobileUser.getOfficeId(),
mobileUser.getRouteId(), mobileUser.getRouteId(),
mobileUser.getCertifier(), mobileUser.getCertifier(),
mobileUser.getManagement().toString() mobileUser.getManagement().toString(),
mobileUser.getIdentificadorFolio()
); );
} }

View File

@ -21,6 +21,7 @@ public class UserMxy extends PersonMxy {
private String routeId; private String routeId;
private String certifier; private String certifier;
private String management; private String management;
private String identificadorFolio;
private List<UserPreferenceMxy> preferences; private List<UserPreferenceMxy> preferences;
@ -54,8 +55,9 @@ public class UserMxy extends PersonMxy {
* @param routeId * @param routeId
* @param certifier * @param certifier
* @param management * @param management
* @param identificadorFolio
*/ */
public UserMxy(String id, String userName, String thumbnail, String officeId, String routeId, String certifier, String management) { public UserMxy(String id, String userName, String thumbnail, String officeId, String routeId, String certifier, String management, String identificadorFolio) {
this.id = id; this.id = id;
this.userName = userName; this.userName = userName;
this.thumbnail = thumbnail; this.thumbnail = thumbnail;
@ -63,6 +65,7 @@ public class UserMxy extends PersonMxy {
this.routeId = routeId; this.routeId = routeId;
this.certifier = certifier; this.certifier = certifier;
this.management = management; this.management = management;
this.identificadorFolio = identificadorFolio;
} }
public String getUserName() { public String getUserName() {
@ -113,6 +116,14 @@ public class UserMxy extends PersonMxy {
this.management = management; this.management = management;
} }
public String getIdentificadorFolio() {
return identificadorFolio;
}
public void setIdentificadorFolio(String identificadorFolio) {
this.identificadorFolio = identificadorFolio;
}
@Override @Override
public String toString() { public String toString() {
return "UserMxy{" + "userName=" + userName + ", preferences=" + preferences + '}'; return "UserMxy{" + "userName=" + userName + ", preferences=" + preferences + '}';

View File

@ -12,9 +12,14 @@ import com.arrebol.apc.model.ModelParameter;
import com.arrebol.apc.model.enums.LoanDetailsType; import com.arrebol.apc.model.enums.LoanDetailsType;
import com.arrebol.apc.model.views.LoanApprovedDetailView; import com.arrebol.apc.model.views.LoanApprovedDetailView;
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.PersonJaxb;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.security.Timestamp;
import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.List; import java.util.List;
import javax.persistence.Tuple; import javax.persistence.Tuple;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
@ -145,7 +150,8 @@ public class LoanApprovedDetailViewRepository extends GenericRepository implemen
tuple.get("fullNameVendedor", String.class), tuple.get("fullNameVendedor", String.class),
tuple.get("fullNameCliente", String.class), tuple.get("fullNameCliente", String.class),
tuple.get("numeroCuenta", String.class), tuple.get("numeroCuenta", String.class),
tuple.get("fullNameCrobrador", String.class) tuple.get("fullNameCrobrador", String.class),
tuple.get("folio", String.class)
); );
results.add(detail); results.add(detail);
@ -158,6 +164,73 @@ public class LoanApprovedDetailViewRepository extends GenericRepository implemen
} }
} }
/**
*
* @param xmlQuery
* @param parameters
* @return
* @throws Exception
*/
public LoanRequestedJaxb findLoanById(String xmlQuery, List<ModelParameter> parameters) throws Exception {
logger.debug("Consulta actual recibida: {}", xmlQuery);
logger.debug("findLoanById");
try {
List<Tuple> tuples = xmlQueryTuple(xmlQuery, parameters);
logger.info("Número de resultados: {}", tuples.size());
if (tuples.isEmpty()) {
return null;
}
Tuple tuple = tuples.get(0);
PersonJaxb customer = new PersonJaxb(tuple.get("customerName", String.class));
PersonJaxb endorsement = new PersonJaxb(tuple.get("endorsementName", String.class));
Object dateValue = tuple.get("strDate");
String formattedDate = null;
if (dateValue != null) {
if (dateValue instanceof Timestamp) {
formattedDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")
.format((Timestamp) dateValue);
} else if (dateValue instanceof Date) {
formattedDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")
.format((Date) dateValue);
} else if (dateValue instanceof String) {
formattedDate = (String) dateValue;
} else {
formattedDate = dateValue.toString();
}
}
String fachadaCasa = tuple.get("fachadaCasa") != null
? tuple.get("fachadaCasa", String.class) : "";
String descripcion = tuple.get("descripcion") != null
? tuple.get("descripcion", String.class) : "";
String latitud = tuple.get("latitud") != null
? tuple.get("latitud", String.class) : "";
String longitud = tuple.get("longitud") != null
? tuple.get("longitud", String.class) : "";
return new LoanRequestedJaxb(
customer,
endorsement,
formattedDate,
fachadaCasa,
descripcion,
latitud,
longitud,
tuple.get("loanDescription", String.class)
);
} catch (Exception e) {
logger.error("findLoanById", e);
throw e;
}
}
/** /**
* *
* @param idLoan * @param idLoan

View File

@ -105,6 +105,11 @@ public class EmployeeController implements Serializable {
return humanResourceRepository.updateByHumanResourceId(hr, updateAvatar); return humanResourceRepository.updateByHumanResourceId(hr, updateAvatar);
} }
public boolean updateHumanResource(HumanResource hr) {
logger.debug("updateHumanResource");
return genericEntityRepository.updateAPCEntity(hr);
}
/** /**
* *
* @param status * @param status

View File

@ -115,6 +115,20 @@ public class HumanResource implements Serializable {
@Column(name = "created_by", nullable = false, length = 36) @Column(name = "created_by", nullable = false, length = 36)
private String createdBy; private String createdBy;
@Column(name = "identificador_folio", nullable = false, length = 36)
private String identificadorFolio;
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "ultima_modificacion_folio", length = 19)
private Date ultimaModificacionFolio;
@OneToOne(fetch = FetchType.LAZY)
@JoinColumn(
name = "usuario_ultima_modificacion_folio",
referencedColumnName = "id"
)
private User usuarioUltimaModificacionFolio;
@Temporal(TemporalType.TIMESTAMP) @Temporal(TemporalType.TIMESTAMP)
@Column(name = "created_on", length = 19) @Column(name = "created_on", length = 19)
private Date createdOn; private Date createdOn;
@ -420,6 +434,30 @@ public class HumanResource implements Serializable {
this.fullName = fullName; this.fullName = fullName;
} }
public String getIdentificadorFolio() {
return identificadorFolio;
}
public void setIdentificadorFolio(String identificadorFolio) {
this.identificadorFolio = identificadorFolio;
}
public Date getUltimaModificacionFolio() {
return ultimaModificacionFolio;
}
public void setUltimaModificacionFolio(Date ultimaModificacionFolio) {
this.ultimaModificacionFolio = ultimaModificacionFolio;
}
public User getUsuarioUltimaModificacionFolio() {
return usuarioUltimaModificacionFolio;
}
public void setUsuarioUltimaModificacionFolio(User usuarioUltimaModificacionFolio) {
this.usuarioUltimaModificacionFolio = usuarioUltimaModificacionFolio;
}
@Override @Override
public String toString() { public String toString() {
return "HumanResource{" + "firstName=" + firstName + ", secondName=" + secondName + ", lastName=" + lastName + ", middleName=" + middleName + '}'; return "HumanResource{" + "firstName=" + firstName + ", secondName=" + secondName + ", lastName=" + lastName + ", middleName=" + middleName + '}';

View File

@ -17,6 +17,7 @@ public interface LoanCfg extends GenericCfg {
String QUERY_UPDATE_LOAN_FROM_RENOVATION = "updateLoanFromRenovation"; String QUERY_UPDATE_LOAN_FROM_RENOVATION = "updateLoanFromRenovation";
String QUERY_UPDATE_LOAN_STATUS_WHERE_ID_IN = "updateLoanStatusWhereIdIn"; String QUERY_UPDATE_LOAN_STATUS_WHERE_ID_IN = "updateLoanStatusWhereIdIn";
String QUERY_UPDATE_LOAN_FROM_WEB = "updateLoanFromWeb"; String QUERY_UPDATE_LOAN_FROM_WEB = "updateLoanFromWeb";
String QUERY_FIND_LOAN_BY_ID = "findLoansById";
String QUERY_FIND_LOAN_BY_CUSTOMER = "findLoansByCustomer"; String QUERY_FIND_LOAN_BY_CUSTOMER = "findLoansByCustomer";
String QUERY_FIND_LOAN_JURIDICAL = "findLoansJuridical"; String QUERY_FIND_LOAN_JURIDICAL = "findLoansJuridical";
String QUERY_FIND_LOAN_ZERO = "findLoansZero"; String QUERY_FIND_LOAN_ZERO = "findLoansZero";

View File

@ -15,6 +15,7 @@ public interface LoanDetailsCfg extends GenericCfg {
String QUERY_FIND_LOAN_DETAILS_BY_LOAN = "findLoanDetailsByLoan"; String QUERY_FIND_LOAN_DETAILS_BY_LOAN = "findLoanDetailsByLoan";
String QUERY_FIND_LOAN_DETAILS_FROM_TIKET_BY_LOAN = "findLoanDetailsFromTikedByLoan"; String QUERY_FIND_LOAN_DETAILS_FROM_TIKET_BY_LOAN = "findLoanDetailsFromTikedByLoan";
String QUERY_FIND_LAST_LOAN_BY_USER = "findLatestFolioByUser";
String QUERY_FIND_FEES_TO_PAY_BY_LOAN_ID = "findFeesToPayByLoanId"; String QUERY_FIND_FEES_TO_PAY_BY_LOAN_ID = "findFeesToPayByLoanId";
String QUERY_FIND_ALL_FEES_BY_LOAN_ID = "findAllFeesByLoanId"; String QUERY_FIND_ALL_FEES_BY_LOAN_ID = "findAllFeesByLoanId";
String QUERY_UPDATE_PAID_FEES_STATUS_IN_LOAN_DETAILS_IDS = "updatePaidFeesStatusInLoanDetailIds"; String QUERY_UPDATE_PAID_FEES_STATUS_IN_LOAN_DETAILS_IDS = "updatePaidFeesStatusInLoanDetailIds";

View File

@ -121,6 +121,18 @@ public class Loan implements Serializable {
@Column(name = "frozen") @Column(name = "frozen")
private ActiveStatus frozen; private ActiveStatus frozen;
@Column(name = "fachada_casa", length = 200)
private String fachadaCasa;
@Column(name = "descripcion", length = 200)
private String descripcion;
@Column(name = "latitud", length = 200)
private String latitud;
@Column(name = "longitud", length = 200)
private String longitud;
@OneToMany( @OneToMany(
mappedBy = "loan", mappedBy = "loan",
cascade = CascadeType.ALL, cascade = CascadeType.ALL,
@ -230,6 +242,44 @@ public class Loan implements Serializable {
this.frozen = frozen; this.frozen = frozen;
} }
/**
*
* @param loanType
* @param customer
* @param endorsement
* @param routeCtlg
* @param loanStatus
* @param amountPaid
* @param amountToPay
* @param lastReferenceNumber
* @param createdBy
* @param createdOn
* @param newCustomer
* @param frozen
* @param fachadaCasa
* @param descripcion
* @param latitud
* @param longitud
*/
public Loan(LoanType loanType, People customer, People endorsement, RouteCtlg routeCtlg, LoanStatus loanStatus, BigDecimal amountPaid, BigDecimal amountToPay, Integer lastReferenceNumber, String createdBy, Date createdOn, ActiveStatus newCustomer, ActiveStatus frozen, String fachadaCasa, String descripcion, String latitud, String longitud) {
this.loanType = loanType;
this.customer = customer;
this.endorsement = endorsement;
this.routeCtlg = routeCtlg;
this.loanStatus = loanStatus;
this.amountPaid = amountPaid;
this.amountToPay = amountToPay;
this.lastReferenceNumber = lastReferenceNumber;
this.createdBy = createdBy;
this.createdOn = createdOn;
this.newCustomer = newCustomer;
this.fachadaCasa = fachadaCasa;
this.frozen = frozen;
this.descripcion = descripcion;
this.latitud = latitud;
this.longitud = longitud;
}
/** /**
* *
* @param id * @param id
@ -511,6 +561,38 @@ public class Loan implements Serializable {
this.frozen = frozen; this.frozen = frozen;
} }
public String getFachadaCasa() {
return fachadaCasa;
}
public void setFachadaCasa(String fachadaCasa) {
this.fachadaCasa = fachadaCasa;
}
public String getDescripcion() {
return descripcion;
}
public void setDescripcion(String descripcion) {
this.descripcion = descripcion;
}
public String getLatitud() {
return latitud;
}
public void setLatitud(String latitud) {
this.latitud = latitud;
}
public String getLongitud() {
return longitud;
}
public void setLongitud(String longitud) {
this.longitud = longitud;
}
@Override @Override
public String toString() { public String toString() {
return "Loan{" + "loanType=" + loanType + ", createdBy=" + createdBy + '}'; return "Loan{" + "loanType=" + loanType + ", createdBy=" + createdBy + '}';

View File

@ -83,6 +83,9 @@ public class LoanDetails implements Serializable {
@Column(name = "loan_comments", length = 150) @Column(name = "loan_comments", length = 150)
private String comments; private String comments;
@Column(name = "folio", length = 150)
private String folio;
@Enumerated(EnumType.STRING) @Enumerated(EnumType.STRING)
@Column(name = "fee_status") @Column(name = "fee_status")
private FeeStatus feeStatus; private FeeStatus feeStatus;
@ -193,6 +196,33 @@ public class LoanDetails implements Serializable {
this.comments = comments; this.comments = comments;
} }
/**
* Add new amount.
*
* @param loan
* @param user
* @param peopleType
* @param paymentAmount
* @param referenceNumber
* @param loanDetailsType
* @param createdBy
* @param createdOn
* @param comments
* @param folio
*/
public LoanDetails(Loan loan, User user, PeopleType peopleType, BigDecimal paymentAmount, Integer referenceNumber, LoanDetailsType loanDetailsType, String createdBy, Date createdOn, String comments, String folio) {
this.loan = loan;
this.user = user;
this.peopleType = peopleType;
this.paymentAmount = paymentAmount;
this.referenceNumber = referenceNumber;
this.loanDetailsType = loanDetailsType;
this.createdBy = createdBy;
this.createdOn = createdOn;
this.comments = comments;
this.folio = folio;
}
/** /**
* *
* @param loan * @param loan
@ -221,6 +251,36 @@ public class LoanDetails implements Serializable {
this.transferStatus = transferStatus; this.transferStatus = transferStatus;
} }
/**
*
* @param loan
* @param user
* @param peopleType
* @param paymentAmount
* @param referenceNumber
* @param loanDetailsType
* @param createdBy
* @param createdOn
* @param comments
* @param transferNumber
* @param transferStatus
* @param folio
*/
public LoanDetails(Loan loan, User user, PeopleType peopleType, BigDecimal paymentAmount, Integer referenceNumber, LoanDetailsType loanDetailsType, String createdBy, Date createdOn, String comments, String transferNumber, TransferStatus transferStatus, String folio) {
this.loan = loan;
this.user = user;
this.peopleType = peopleType;
this.paymentAmount = paymentAmount;
this.referenceNumber = referenceNumber;
this.loanDetailsType = loanDetailsType;
this.createdBy = createdBy;
this.createdOn = createdOn;
this.comments = comments;
this.transferNumber = transferNumber;
this.transferStatus = transferStatus;
this.folio = folio;
}
public String getId() { public String getId() {
return id; return id;
} }
@ -337,6 +397,14 @@ public class LoanDetails implements Serializable {
return getPaymentAmount().doubleValue(); return getPaymentAmount().doubleValue();
} }
public String getFolio() {
return folio;
}
public void setFolio(String folio) {
this.folio = folio;
}
@Override @Override
public String toString() { public String toString() {
return "LoanDetails{" + "referenceNumber=" + referenceNumber + ", comments=" + comments + ", createdBy=" + createdBy + '}'; return "LoanDetails{" + "referenceNumber=" + referenceNumber + ", comments=" + comments + ", createdBy=" + createdBy + '}';

View File

@ -8,6 +8,7 @@
package com.arrebol.apc.model.loan; package com.arrebol.apc.model.loan;
import com.arrebol.apc.model.core.Office; import com.arrebol.apc.model.core.Office;
import com.arrebol.apc.model.core.User;
import com.arrebol.apc.model.enums.ActiveStatus; import com.arrebol.apc.model.enums.ActiveStatus;
import com.arrebol.apc.model.enums.DaysInWeekend; import com.arrebol.apc.model.enums.DaysInWeekend;
import java.io.Serializable; import java.io.Serializable;
@ -120,6 +121,16 @@ public class LoanType implements Serializable {
@Column(name = "last_updated_by", length = 36) @Column(name = "last_updated_by", length = 36)
private String lastUpdatedBy; private String lastUpdatedBy;
@ManyToOne(fetch = FetchType.LAZY, optional = true)
@JoinColumn(
name = "last_updated_by",
referencedColumnName = "id",
nullable = true,
insertable = false,
updatable = false
)
private User lastUserModified;
@Temporal(TemporalType.TIMESTAMP) @Temporal(TemporalType.TIMESTAMP)
@Column(name = "last_updated_on", length = 19) @Column(name = "last_updated_on", length = 19)
private Date lastUpdatedOn; private Date lastUpdatedOn;
@ -325,6 +336,14 @@ public class LoanType implements Serializable {
this.lastUpdatedBy = lastUpdatedBy; this.lastUpdatedBy = lastUpdatedBy;
} }
public User getLastUserModified() {
return lastUserModified;
}
public void setLastUserModified(User lastUserModified) {
this.lastUserModified = lastUserModified;
}
public Date getLastUpdatedOn() { public Date getLastUpdatedOn() {
return lastUpdatedOn; return lastUpdatedOn;
} }

View File

@ -54,6 +54,9 @@ public class MobileUser implements Serializable {
@Column(name = "management", nullable = false) @Column(name = "management", nullable = false)
private ActiveStatus management; private ActiveStatus management;
@Column(name = "identificador_folio", length = 25)
private String identificadorFolio;
public MobileUser() { public MobileUser() {
} }
@ -126,6 +129,14 @@ public class MobileUser implements Serializable {
this.management = management; this.management = management;
} }
public String getIdentificadorFolio() {
return identificadorFolio;
}
public void setIdentificadorFolio(String identificadorFolio) {
this.identificadorFolio = identificadorFolio;
}
@Override @Override
public String toString() { public String toString() {
return "Authentication{" + "userName=" + userName + '}'; return "Authentication{" + "userName=" + userName + '}';

View File

@ -28,6 +28,7 @@ public class LoanDetailJaxb {
private String fullNameCliente; private String fullNameCliente;
private String numeroCuenta; private String numeroCuenta;
private String fullNameCrobrador; private String fullNameCrobrador;
private String folio;
public LoanDetailJaxb() { public LoanDetailJaxb() {
} }
@ -45,7 +46,7 @@ public class LoanDetailJaxb {
* @param numeroCuenta * @param numeroCuenta
* @param fullNameCrobrador * @param fullNameCrobrador
*/ */
public LoanDetailJaxb(String paymentDate, double paymentOfDay, double toPay, String comment, String paymentType, String fullNameVendedor, String fullNameCliente, String numeroCuenta, String fullNameCrobrador) { public LoanDetailJaxb(String paymentDate, double paymentOfDay, double toPay, String comment, String paymentType, String fullNameVendedor, String fullNameCliente, String numeroCuenta, String fullNameCrobrador, String folio) {
this.paymentDate = paymentDate; this.paymentDate = paymentDate;
this.paymentOfDay = paymentOfDay; this.paymentOfDay = paymentOfDay;
this.toPay = toPay; this.toPay = toPay;
@ -55,6 +56,7 @@ public class LoanDetailJaxb {
this.fullNameCliente = fullNameCliente; this.fullNameCliente = fullNameCliente;
this.numeroCuenta = numeroCuenta; this.numeroCuenta = numeroCuenta;
this.fullNameCrobrador = fullNameCrobrador; this.fullNameCrobrador = fullNameCrobrador;
this.folio = folio;
} }
/** /**
@ -180,6 +182,15 @@ public class LoanDetailJaxb {
this.fullNameCrobrador = fullNameCrobrador; this.fullNameCrobrador = fullNameCrobrador;
} }
@XmlElement(name = "folio")
public String getFolio() {
return folio;
}
public void setFolio(String folio) {
this.folio = folio;
}
@Override @Override
public String toString() { public String toString() {
return "LoanDetailJaxb{" + "paymentDate=" + paymentDate + ", paymentOfDay=" + paymentOfDay + ", toPay=" + toPay + ", payment=" + payment + '}'; return "LoanDetailJaxb{" + "paymentDate=" + paymentDate + ", paymentOfDay=" + paymentOfDay + ", toPay=" + toPay + ", payment=" + payment + '}';

View File

@ -25,6 +25,22 @@ public class LoanRequestedJaxb {
private PersonJaxb endorsement; private PersonJaxb endorsement;
private String strDate; private String strDate;
private String routeIdNewClient; private String routeIdNewClient;
private String fachadaCasa;
private String descripcion;
private String latitud;
private String longitud;
private String loanDescription;
public LoanRequestedJaxb(PersonJaxb customer, PersonJaxb endorsement, String strDate, String fachadaCasa, String descripcion, String latitud, String longitud, String loanDescription) {
this.customer = customer;
this.endorsement = endorsement;
this.strDate = strDate;
this.fachadaCasa = fachadaCasa;
this.descripcion = descripcion;
this.latitud = latitud;
this.longitud = longitud;
this.loanDescription = loanDescription;
}
public LoanRequestedJaxb() { public LoanRequestedJaxb() {
} }
@ -109,4 +125,49 @@ public class LoanRequestedJaxb {
this.routeIdNewClient = routeIdNewClient; this.routeIdNewClient = routeIdNewClient;
} }
@XmlElement(name = "fachadaCasa")
public String getFachadaCasa() {
return fachadaCasa;
}
public void setFachadaCasa(String fachadaCasa) {
this.fachadaCasa = fachadaCasa;
}
@XmlElement(name = "descripcion")
public String getDescripcion() {
return descripcion;
}
public void setDescripcion(String descripcion) {
this.descripcion = descripcion;
}
@XmlElement(name = "latitud")
public String getLatitud() {
return latitud;
}
public void setLatitud(String latitud) {
this.latitud = latitud;
}
@XmlElement(name = "longitud")
public String getLongitud() {
return longitud;
}
public void setLongitud(String longitud) {
this.longitud = longitud;
}
@XmlElement(name = "loanDescription")
public String getLoanDescription() {
return loanDescription;
}
public void setLoanDescription(String loanDescription) {
this.loanDescription = loanDescription;
}
} }

View File

@ -27,6 +27,7 @@ public class NewAmountJaxb {
private boolean fee; private boolean fee;
private String comments; private String comments;
private Boolean manager; private Boolean manager;
private String folio;
public NewAmountJaxb() { public NewAmountJaxb() {
} }
@ -115,4 +116,13 @@ public class NewAmountJaxb {
this.manager = manager; this.manager = manager;
} }
@XmlAttribute(name = "folio")
public String getFolio() {
return folio;
}
public void setFolio(String folio) {
this.folio = folio;
}
} }

View File

@ -25,6 +25,7 @@ public class NewTransferAccountJaxb {
private String comments; private String comments;
private String transferReference; private String transferReference;
private Boolean manager; private Boolean manager;
private String folio;
public NewTransferAccountJaxb() { public NewTransferAccountJaxb() {
} }
@ -95,4 +96,12 @@ public class NewTransferAccountJaxb {
this.manager = manager; this.manager = manager;
} }
@XmlAttribute(name = "folio")
public String getFolio() {
return folio;
}
public void setFolio(String folio) {
this.folio = folio;
}
} }

View File

@ -30,6 +30,10 @@ public class PersonJaxb {
private String companyName; private String companyName;
private boolean createPerson; private boolean createPerson;
public PersonJaxb(String firstName) {
this.firstName = firstName;
}
public PersonJaxb() { public PersonJaxb() {
} }

View File

@ -43,7 +43,8 @@
CONCAT(perv.firstName, ' ', CONCAT(perv.firstName, ' ',
IFNULL(CONCAT(perv.secondName, ' '), ''), IFNULL(CONCAT(perv.secondName, ' '), ''),
perv.lastName, ' ', perv.lastName, ' ',
perv.middleName) AS fullNameCrobrador perv.middleName) AS fullNameCrobrador,
ld.folio AS folio
FROM FROM
LoanDetails ld LoanDetails ld
INNER JOIN Loan l ON ld.loan = l.id INNER JOIN Loan l ON ld.loan = l.id
@ -62,6 +63,46 @@
]]> ]]>
</query> </query>
<query name="findLatestFolioByUser">
<![CDATA[
SELECT
DATE_FORMAT(ld.createdOn, '%d-%m-%Y') AS createdOn,
ld.paymentAmount AS paymentAmount,
ld.loanDetailsType AS loanDetailsType,
lt.paymentTotal AS amountToPay,
ld.comments AS comments,
CONCAT(per.firstName, ' ',
IFNULL(CONCAT(per.secondName, ' '), ''),
per.lastName, ' ',
per.middleName) AS fullNameVendedor,
CONCAT(peo.firstName, ' ',
IFNULL(CONCAT(peo.secondName, ' '), ''),
peo.lastName, ' ',
IFNULL(peo.middleName, '')) AS fullNameCliente,
CONCAT(IFNULL(peo.contrato, ''), ' - ', IFNULL(rut.route, '')) AS numeroCuenta,
CONCAT(perv.firstName, ' ',
IFNULL(CONCAT(perv.secondName, ' '), ''),
perv.lastName, ' ',
perv.middleName) AS fullNameCrobrador,
ld.folio AS folio
FROM
LoanDetails ld
INNER JOIN Loan l ON ld.loan = l.id
INNER JOIN LoanType lt ON l.loanType = lt.id
INNER JOIN People peo ON l.customer.id = peo.id
INNER JOIN RouteCtlg rut ON peo.routeCtlg.id = rut.id
INNER JOIN User us ON ld.user.id = us.id
LEFT JOIN HumanResource per ON us.humanResource.id = per.id
INNER JOIN User ven ON ld.createdBy = ven.id
LEFT JOIN HumanResource perv ON ven.humanResource.id = perv.id
WHERE
ld.user = :user
ORDER BY
ld.createdOn,
ld.referenceNumber
]]>
</query>
<query name="findLoanDetailsPaymentCurdateByLoan"> <query name="findLoanDetailsPaymentCurdateByLoan">
<![CDATA[ <![CDATA[
SELECT SELECT

View File

@ -272,6 +272,71 @@
]]> ]]>
</query> </query>
<query name="findLoansById">
<![CDATA[
SELECT
CONCAT(
CASE
WHEN cstmr.firstName IS NOT NULL
THEN CONCAT(SUBSTR(UPPER(cstmr.firstName), 1, 1),SUBSTR(LOWER(cstmr.firstName), 2), ' ')
ELSE ''
END,
CASE
WHEN cstmr.secondName IS NOT NULL
THEN CONCAT(SUBSTR(UPPER(cstmr.secondName), 1, 1),SUBSTR(LOWER(cstmr.secondName), 2), ' ')
ELSE ''
END,
CASE
WHEN cstmr.lastName IS NOT NULL
THEN CONCAT(SUBSTR(UPPER(cstmr.lastName), 1, 1),SUBSTR(LOWER(cstmr.lastName), 2), ' ')
ELSE ''
END,
CASE
WHEN cstmr.middleName IS NOT NULL
THEN CONCAT(SUBSTR(UPPER(cstmr.middleName), 1, 1),SUBSTR(LOWER(cstmr.middleName), 2))
ELSE ''
END
) AS customerName,
CONCAT(
CASE
WHEN ndrsmnt.firstName IS NOT NULL
THEN CONCAT(SUBSTR(UPPER(ndrsmnt.firstName), 1, 1),SUBSTR(LOWER(ndrsmnt.firstName), 2), ' ')
ELSE ''
END,
CASE
WHEN ndrsmnt.secondName IS NOT NULL
THEN CONCAT(SUBSTR(UPPER(ndrsmnt.secondName), 1, 1),SUBSTR(LOWER(ndrsmnt.secondName), 2), ' ')
ELSE ''
END,
CASE
WHEN ndrsmnt.lastName IS NOT NULL
THEN CONCAT(SUBSTR(UPPER(ndrsmnt.lastName), 1, 1),SUBSTR(LOWER(ndrsmnt.lastName), 2), ' ')
ELSE ''
END,
CASE
WHEN ndrsmnt.middleName IS NOT NULL
THEN CONCAT(SUBSTR(UPPER(ndrsmnt.middleName), 1, 1),SUBSTR(LOWER(ndrsmnt.middleName), 2))
ELSE ''
END
) AS endorsementName,
lo.createdOn AS strDate,
lo.fachadaCasa AS fachadaCasa,
lo.descripcion AS descripcion,
lo.latitud AS latitud,
lo.longitud AS longitud,
CONCAT(CAST(lt.payment AS string), ' - ', lt.loanTypeName) AS loanDescription
FROM
Loan lo
INNER JOIN LoanType lt ON lo.loanType = lt.id
INNER JOIN People cstmr ON lo.customer = cstmr.id
INNER JOIN People ndrsmnt ON lo.endorsement = ndrsmnt.id
WHERE
lo.id = :id
ORDER BY
lo.createdOn
]]>
</query>
<query name="searchPaymentDetails"> <query name="searchPaymentDetails">
<![CDATA[ <![CDATA[
SELECT SELECT

View File

@ -7,17 +7,18 @@ package com.arrebol.apc.web.beans.admin;
import com.arrebol.apc.controller.system.employee.EmployeeController; import com.arrebol.apc.controller.system.employee.EmployeeController;
import com.arrebol.apc.model.core.HumanResource; import com.arrebol.apc.model.core.HumanResource;
import com.arrebol.apc.model.core.Office;
import com.arrebol.apc.model.enums.HumanResourceStatus; import com.arrebol.apc.model.enums.HumanResourceStatus;
import com.arrebol.apc.web.beans.Datatable; import com.arrebol.apc.web.beans.Datatable;
import com.arrebol.apc.web.beans.GenericBean; import com.arrebol.apc.web.beans.GenericBean;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal; import java.util.Date;
import java.util.List; import java.util.List;
import javax.annotation.PostConstruct; import javax.annotation.PostConstruct;
import javax.faces.application.FacesMessage; import javax.faces.application.FacesMessage;
import javax.faces.view.ViewScoped; import javax.faces.view.ViewScoped;
import javax.inject.Named; import javax.inject.Named;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.primefaces.event.ReorderEvent; import org.primefaces.event.ReorderEvent;
import org.primefaces.event.RowEditEvent; import org.primefaces.event.RowEditEvent;
@ -29,16 +30,24 @@ import org.primefaces.event.RowEditEvent;
@ViewScoped @ViewScoped
public class EmployeeListBean extends GenericBean implements Serializable, Datatable { public class EmployeeListBean extends GenericBean implements Serializable, Datatable {
public void editarIndetificadorDeFolios() {
try {
getSelectedHumanResource().setUltimaModificacionFolio(new Date());
public List<HumanResource> fillDatatableEmployee() { getSelectedHumanResource().setUsuarioUltimaModificacionFolio(getLoggedUser().getUser());
return getController().findEmployeesByType( getController().updateHumanResource(getSelectedHumanResource());
getLoggedUser().getOffice(), logger.info("Se actualizó el identificador de folios correctamente");
HumanResourceStatus.ENEBLED, showMessage(FacesMessage.SEVERITY_INFO, "Registro actualizado", "Se actualizó el identificador de folios correctamente");
getLoggedUser().getUser().getHumanResource().getId()); setSelectedHumanResource(null);
fillDatatableEmployee();
} catch (Exception e) {
logger.error("editarIndetificadorDeFolios(): " + e);
showMessage(FacesMessage.SEVERITY_ERROR, "Error", "Ocurrió un error al tratar de editar el identificador de  folios");
}
} }
public List<HumanResource> fillDatatableEmployee() {
return getController().findEmployeesByType(getLoggedUser().getOffice(), HumanResourceStatus.ENEBLED, getLoggedUser().getUser().getHumanResource().getId());
}
@Override @Override
public void editRow(RowEditEvent event) { public void editRow(RowEditEvent event) {
@ -81,19 +90,24 @@ public class EmployeeListBean extends GenericBean implements Serializable, Datat
this.humanResource = humanResource; this.humanResource = humanResource;
} }
public HumanResource getSelectedHumanResource() {
return selectedHumanResource;
}
public void setSelectedHumanResource(HumanResource selectedHumanResource) {
this.selectedHumanResource = selectedHumanResource;
}
final Logger logger = LogManager.getLogger(EmployeeListBean.class);
private EmployeeController controller; private EmployeeController controller;
private List<HumanResource> humanResource; private List<HumanResource> humanResource;
private HumanResource selectedHumanResource;
@PostConstruct() @PostConstruct()
public void init() { public void init() {
loadBundlePropertyFile(); loadBundlePropertyFile();
controller = new EmployeeController(); controller = new EmployeeController();
setHumanResource(fillDatatableEmployee()); setHumanResource(fillDatatableEmployee());
} }

View File

@ -47,6 +47,18 @@ public class EmployeeBean extends GenericBean implements Serializable {
getSaveHumanResource().setCreatedBy(getLoggedUser().getUser().getId()); getSaveHumanResource().setCreatedBy(getLoggedUser().getUser().getId());
getSaveHumanResource().setBalance(BigDecimal.ZERO); getSaveHumanResource().setBalance(BigDecimal.ZERO);
//Se valida si el identificador del folio
if (getSaveHumanResource().getIdentificadorFolio() == null || !getSaveHumanResource().getIdentificadorFolio().equals(getIdentificadorFolio())) {
if (getController().verificarIdentificadorFolio(getIdentificadorFolio())) {
logger.error("Identificador de folio ya asignado");
buildAndSendMessage(null, "El identificador del folio ya ha sido asignado a otro usuario", FacesMessage.SEVERITY_WARN, "Error");
return;
}
getSaveHumanResource().setIdentificadorFolio(getIdentificadorFolio());
getSaveHumanResource().setUltimaModificacionFolio(new Date());
getSaveHumanResource().setUsuarioUltimaModificacionFolio(getLoggedUser().getUser());
}
if (getSaveHumanResource().getEmployeeSaving() == null) { if (getSaveHumanResource().getEmployeeSaving() == null) {
getSaveHumanResource().setEmployeeSaving(BigDecimal.ZERO); getSaveHumanResource().setEmployeeSaving(BigDecimal.ZERO);
} }
@ -398,6 +410,7 @@ public class EmployeeBean extends GenericBean implements Serializable {
private String bonusId; private String bonusId;
private List<Bonus> bonuses; private List<Bonus> bonuses;
private String identificadorFolio;
private String updateBonusId; private String updateBonusId;
@PostConstruct() @PostConstruct()
@ -619,4 +632,12 @@ public class EmployeeBean extends GenericBean implements Serializable {
this.updateBonusId = updateBonusId; this.updateBonusId = updateBonusId;
} }
public String getIdentificadorFolio() {
return identificadorFolio;
}
public void setIdentificadorFolio(String identificadorFolio) {
this.identificadorFolio = identificadorFolio;
}
} }

View File

@ -28,6 +28,15 @@
<f:facet name="header"> <f:facet name="header">
<p:commandButton id="toggler" type="button" value="Columnas" style="float:left;" styleClass="amber-btn flat" icon="ui-icon-calendar"/> <p:commandButton id="toggler" type="button" value="Columnas" style="float:left;" styleClass="amber-btn flat" icon="ui-icon-calendar"/>
<p:columnToggler datasource="dtLoanType" trigger="toggler" /> <p:columnToggler datasource="dtLoanType" trigger="toggler" />
<div style="float:right;padding-top: 5px;padding-left: 5px;padding-right: 5px">
<h:commandLink title="Exportar a Excel">
<p:graphicImage name="images/excel-xls-icon.png" library="serenity-layout" width="48"/>
<p:dataExporter type="xls" target="dtLoanType" fileName="Listado de productos" />
</h:commandLink>
</div>
<p:button outcome="#{i18n['outcome.catalog.typeLoan.add']}" value="#{i18n['button.add']}" styleClass="amber-btn flat" style="float: right;" icon="ui-icon-plus" rendered="#{loginBean.isUserInRole('catalog.typeLoan.add')}"/> <p:button outcome="#{i18n['outcome.catalog.typeLoan.add']}" value="#{i18n['button.add']}" styleClass="amber-btn flat" style="float: right;" icon="ui-icon-plus" rendered="#{loginBean.isUserInRole('catalog.typeLoan.add')}"/>
<p:outputPanel> <p:outputPanel>
@ -93,6 +102,16 @@
<h:outputText value="#{loanType.cantidadExistente}" /> <h:outputText value="#{loanType.cantidadExistente}" />
</p:column> </p:column>
<p:column headerText="Última modificación" sortBy="#{loanType.lastUpdatedOn}" style="width: 7em; text-align: center" filterBy="#{loanType.lastUpdatedOn}">
<h:outputText value="#{loanType.lastUpdatedOn}">
<f:convertDateTime type="date" locale="es" pattern="dd - MMMM - yyyy"/>
</h:outputText>
</p:column>
<p:column headerText="Usuario modifico" sortBy="#{loanType.lastUserModified.userName}" style="width: 7em; text-align: center" filterBy="#{loanType.lastUserModified.userName}">
<h:outputText value="#{loanType.lastUserModified.userName}" />
</p:column>
<p:column style="width:40px" headerText="Editar"> <p:column style="width:40px" headerText="Editar">
<p:rowEditor editTitle="#{i18n['button.edit']}" rendered="#{loginBean.isUserInRole('catalog.typeLoan.updated')}"/> <p:rowEditor editTitle="#{i18n['button.edit']}" rendered="#{loginBean.isUserInRole('catalog.typeLoan.updated')}"/>
</p:column> </p:column>

View File

@ -38,8 +38,11 @@
</p:panelGrid> </p:panelGrid>
<p:dataTable widgetVar="dtEmployee" id="dtEmployee" var="humanResource" value="#{employeeListManager.humanResource}" style="margin-bottom:20px" reflow="true" rowsPerPageTemplate="5,10,25,50,100" emptyMessage="#{i18n['admin.loans.datatable.empty']}" <p:dataTable widgetVar="dtEmployee" id="dtEmployee" var="humanResource" value="#{employeeListManager.humanResource}"
rowKey="#{humanResource.id}" editable="true" paginator="true" rows="10" paginatorTemplate="{RowsPerPageDropdown} {FirstPageLink} {PreviousPageLink} {CurrentPageReport} {NextPageLink} {LastPageLink}"> selection="#{employeeListManager.selectedHumanResource}"
style="margin-bottom:20px" reflow="true" rowsPerPageTemplate="5,10,25,50,100" emptyMessage="#{i18n['admin.loans.datatable.empty']}"
rowKey="#{humanResource.id}" editable="true" paginator="true" rows="10"
paginatorTemplate="{RowsPerPageDropdown} {FirstPageLink} {PreviousPageLink} {CurrentPageReport} {NextPageLink} {LastPageLink}">
<f:facet name="header"> <f:facet name="header">
<p:commandButton id="toggler" type="button" value="Columnas" style="float:left;" styleClass="amber-btn flat" icon="ui-icon-calendar"/> <p:commandButton id="toggler" type="button" value="Columnas" style="float:left;" styleClass="amber-btn flat" icon="ui-icon-calendar"/>
@ -76,19 +79,42 @@
<h:outputText value="#{humanResource.roleCtlg.role}" /> <h:outputText value="#{humanResource.roleCtlg.role}" />
</p:column> </p:column>
<p:column headerText="Identificador de folios" sortBy="#{humanResource.identificadorFolio}" filterBy="#{humanResource.identificadorFolio}">
<h:outputText value="#{humanResource.identificadorFolio}" />
</p:column>
<p:column headerText="Acciones" style="text-align: center">
<p:commandButton
icon="ui-icon-pencil"
title="Folios"
value="Editar identificador de folios"
id="ctxMenuItem3"
update="editarFolioForm"
oncomplete="PF('editarFolioDialog').show();">
<f:setPropertyActionListener value="#{humanResource}" target="#{employeeListManager.selectedHumanResource}" />
</p:commandButton>
</p:column>
</p:dataTable> </p:dataTable>
</h:form> </h:form>
<h:form id="editarFolioForm">
<p:growl id="msgsDialog" showDetail="true"/>
<p:dialog widgetVar="editarFolioDialog" width="30em" height="6em" id="editarFolioDialog" header="Editar identificador de folios" modal="true" responsive="true" showEffect="clip" hideEffect="clip">
<h:panelGroup styleClass="md-inputfield" style="margin-top: 1em">
<p:inputText id="identificadorFolio" value="#{employeeListManager.selectedHumanResource.identificadorFolio}" style="width: 100%;"/>
<label>Identificador de folios</label>
<p:message for="identificadorFolio" display="text"/>
</h:panelGroup>
<h:panelGroup styleClass="md-inputfield" >
<p:commandButton id="addButton" value="Actualizar" actionListener="#{employeeListManager.editarIndetificadorDeFolios()}" update="editarFolioForm,form"/>
</h:panelGroup>
</p:dialog>
</h:form>
</div> </div>
</div> </div>
<!-- Left Side -->
<!-- Popup -->
</div> </div>
</ui:define> </ui:define>

View File

@ -77,6 +77,14 @@
<label>#{i18n['middle.name']}</label> <label>#{i18n['middle.name']}</label>
<p:message for="middleName" display="icon"/> <p:message for="middleName" display="icon"/>
</h:panelGroup> </h:panelGroup>
<h:panelGroup id="identificadorFolioPnlGrp" styleClass="md-inputfield">
<p:inputText id="identificadorFolio"
style="width: 100%"
value="#{employeeBean.identificadorFolio}"
autocomplete="off"/>
<label>Identificador de folios </label>
<p:message for="middleName" display="icon"/>
</h:panelGroup>
</p:panelGrid> </p:panelGrid>
<p:panelGrid columns="4" layout="grid" styleClass="ui-panelgrid-blank form-group"> <p:panelGrid columns="4" layout="grid" styleClass="ui-panelgrid-blank form-group">

View File

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

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.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();
@ -521,6 +520,43 @@ public class LoanWS implements Serializable {
return response; return response;
} }
@GET
@Path("latest-folio-by-user")
@Produces(MediaType.APPLICATION_JSON)
public Response getLatestFolioByUser(@QueryParam("id") String idUSer) {
logger.debug("getLatestFolioByUser");
Response response;
try {
GenericEntity<List<LoanDetailJaxb>> results
= new GenericEntity< List< LoanDetailJaxb>>(
loanController.latestFolioByUser(idUSer)
) {
};
response = Response.ok(results).build();
} catch (Exception e) {
logger.error("getLatestFolioByUser", e);
response = Response.status(Response.Status.NOT_ACCEPTABLE).build();
}
return response;
}
@GET
@Path("loan-by-id")
@Produces(MediaType.APPLICATION_JSON)
public Response getLoanById(@QueryParam("id") String idLoan) {
logger.info("getLoanById(" + idLoan + ")");
try {
LoanRequestedJaxb loan = loanController.loanById(idLoan);
if (loan == null) {
return Response.status(Response.Status.NOT_FOUND).build();
}
return Response.ok(loan).build();
} catch (Exception e) {
logger.error("getLoanById", e);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
}
}
@PUT @PUT
@Path("renovation-with-endorsement") @Path("renovation-with-endorsement")
@Consumes(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON)