Consulta de base local personas y empresas
This commit is contained in:
parent
9956a2df61
commit
b5732f1ead
|
|
@ -16,7 +16,10 @@ import com.fp.dto.query.SubQuery;
|
|||
import com.fp.dto.save.DtoSave;
|
||||
import com.fp.frontend.controller.AbstractController;
|
||||
import com.fp.frontend.helper.MessageHelper;
|
||||
import com.fp.persistence.commondb.PersistenceHelper;
|
||||
import com.fp.persistence.pcustomer.gene.TcustPersonDetail;
|
||||
import java.sql.Timestamp;
|
||||
import javax.persistence.Query;
|
||||
|
||||
/**
|
||||
* Clase controladora del bean TcustPersonDetail.
|
||||
|
|
@ -42,8 +45,7 @@ public class PersonDetailController extends AbstractController<TcustPersonDetail
|
|||
}
|
||||
|
||||
/**
|
||||
* Incializa el controlador, cuando se esta utilizando una pagina que utliza
|
||||
* el controlador.
|
||||
* Incializa el controlador, cuando se esta utilizando una pagina que utliza el controlador.
|
||||
*/
|
||||
private void init() {
|
||||
try {
|
||||
|
|
@ -209,8 +211,7 @@ public class PersonDetailController extends AbstractController<TcustPersonDetail
|
|||
*
|
||||
* @param identificacion
|
||||
* @param tipoidentificacion
|
||||
* @return Find para encontrar una persona por su identificacion y tipo de
|
||||
* identificacion
|
||||
* @return Find para encontrar una persona por su identificacion y tipo de identificacion
|
||||
*/
|
||||
public static TcustPersonDetail findxidentification(String identificacion, String tipoidentificacion) {
|
||||
try {
|
||||
|
|
@ -231,6 +232,31 @@ public class PersonDetailController extends AbstractController<TcustPersonDetail
|
|||
}
|
||||
}
|
||||
|
||||
public static TcustPersonDetail buscarLocal(String identificacion) {
|
||||
TcustPersonDetail detail = null;
|
||||
if (identificacion == null || identificacion.isEmpty() || identificacion.trim().length() < 10) {
|
||||
return detail;
|
||||
}
|
||||
try {
|
||||
String select = "select identificacion,id_rep_legal,rep_legal,nombre,razon_social,direccion,profesion,estado_civil,genero,descripcion"
|
||||
+ " from comaco.tmp_identificaciones where identificacion=:identificacion;";
|
||||
Query query = PersistenceHelper.getEntityManager().createQuery(select);
|
||||
query.setParameter("identificacion", identificacion);
|
||||
List<Object[]> temp = query.getResultList();
|
||||
for (Object[] fila : temp) {
|
||||
detail = new TcustPersonDetail();
|
||||
detail.setIdentification((String) fila[0]);
|
||||
detail.setName(identificacion.length() == 13?(String) fila[4]: (String) fila[3]);
|
||||
detail.setIdentificationcatalog(identificacion.length() == 10 ? "CED" : "RUC");
|
||||
detail.setIdentificationcatalogcode("IDENTIFICATION");
|
||||
detail.setDatefrom(new Timestamp(System.currentTimeMillis()));
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
MessageHelper.setMessageError(e);
|
||||
}
|
||||
return detail;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param identificacion
|
||||
* @param tipoidentificacion
|
||||
|
|
|
|||
Loading…
Reference in New Issue