Merge branch 'master' of http://157.245.125.231/QSoftTechnologies/werp-services
This commit is contained in:
commit
64f21fcfaa
|
|
@ -0,0 +1 @@
|
|||
/target/
|
||||
|
|
@ -24,6 +24,6 @@ Any value defined here will override the pom.xml file value but is only applicab
|
|||
<org-netbeans-modules-css-prep.less_2e_compiler_2e_options/>
|
||||
<org-netbeans-modules-css-prep.sass_2e_mappings>/scss:/css</org-netbeans-modules-css-prep.sass_2e_mappings>
|
||||
<org-netbeans-modules-web-clientproject-api.js_2e_libs_2e_folder>js/libs</org-netbeans-modules-web-clientproject-api.js_2e_libs_2e_folder>
|
||||
<org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_deploy_2e_server>pfv5ee8</org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_deploy_2e_server>
|
||||
<org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_deploy_2e_server>pfv3ee6</org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_deploy_2e_server>
|
||||
</properties>
|
||||
</project-shared-configuration>
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ public class ApplicationConfig extends Application {
|
|||
resources.add(com.qsoft.wmp.filter.CorsFilter.class);
|
||||
resources.add(com.qsoft.wmp.services.rest.AccionResource.class);
|
||||
resources.add(com.qsoft.wmp.services.rest.ConsultaResource.class);
|
||||
resources.add(com.qsoft.wmp.services.rest.FarmaenlaceResource.class);
|
||||
resources.add(com.qsoft.wmp.services.rest.MultipartResource.class);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import com.qsoft.erp.dominio.ConsultaGenerica;
|
|||
import com.qsoft.erp.dominio.exception.DominioExcepcion;
|
||||
import com.qsoft.erp.dominio.util.AuditoriaUtil;
|
||||
import com.qsoft.wmp.services.util.ServiceUtil;
|
||||
import com.qsoft.wmp.services.xsd.BodyEntradaConsulta;
|
||||
import com.qsoft.wmp.services.xsd.EntradaConsulta;
|
||||
import com.qsoft.wmp.services.xsd.SalidaConsulta;
|
||||
import java.util.List;
|
||||
|
|
@ -82,8 +83,9 @@ public class ConsultaResource {
|
|||
// this.auditoria.AddAuditoria(dto);
|
||||
try {
|
||||
List resultado = null;
|
||||
BodyEntradaConsulta body = entrada.getBodyIn();
|
||||
resultado = consulta.consultaGenerica(entrada.getHeaderIn(), entrada.getBodyIn().getEntidad(),
|
||||
entrada.getBodyIn().getParametros(), entrada.getBodyIn().getMaximoRegistros(), entrada.getBodyIn().getTipoConsulta());
|
||||
body.getParametros(), body.getMaximoRegistros(), body.getRegistroInicio(), body.getTipoConsulta());
|
||||
|
||||
HeaderMS header = entrada.getHeaderIn();
|
||||
header.setFechaHora(DominioConstantes.getDateTime());
|
||||
|
|
|
|||
|
|
@ -0,0 +1,190 @@
|
|||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package com.qsoft.wmp.services.rest;
|
||||
|
||||
import com.qsoft.dao.exception.DaoException;
|
||||
import com.qsoft.erp.constantes.DominioConstantes;
|
||||
import com.qsoft.erp.constantes.EntidadEnum;
|
||||
import com.qsoft.erp.dominio.AccionGenerica;
|
||||
import com.qsoft.erp.dominio.ConsultaGenerica;
|
||||
import com.qsoft.erp.dominio.exception.DominioExcepcion;
|
||||
import com.qsoft.erp.dto.PersonaPolizaDTO;
|
||||
import com.qsoft.util.constantes.CodigoRespuesta;
|
||||
import com.qsoft.util.constantes.ErrorTipo;
|
||||
import com.qsoft.util.ms.pojo.HeaderMS;
|
||||
import com.qsoft.wmp.services.util.ServiceUtil;
|
||||
import com.qsoft.wmp.services.xsd.EntradaAccion;
|
||||
import com.qsoft.wmp.services.xsd.EntradaConsulta;
|
||||
import com.qsoft.wmp.services.xsd.EntradaRecetas;
|
||||
import com.qsoft.wmp.services.xsd.SalidaAccion;
|
||||
import com.qsoft.wmp.services.xsd.SalidaAccionFarmaEnlace;
|
||||
import com.qsoft.wmp.services.xsd.SalidaConsulta;
|
||||
import java.util.HashMap;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.inject.Inject;
|
||||
import javax.ws.rs.Consumes;
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.PathParam;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
|
||||
/**
|
||||
* REST Web Service
|
||||
*
|
||||
* @author james
|
||||
*/
|
||||
@Path("ServicioConvenioExterno")
|
||||
public class FarmaenlaceResource {
|
||||
|
||||
@Inject
|
||||
private ConsultaGenerica consulta;
|
||||
|
||||
@Inject
|
||||
private AccionGenerica accion;
|
||||
|
||||
@PostConstruct
|
||||
public void postConstructor() {
|
||||
System.out.println("======> POST CONTRUCTOR " + consulta);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return an instance of java.lang.String
|
||||
*/
|
||||
@GET
|
||||
@Path("/cedula={cedula}&diagnostico={diagnostico}")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public Map<String, Object> getJson(@PathParam("cedula") String cedula,
|
||||
@PathParam("diagnostico") String diagnostico) {
|
||||
Map<String, Object> mapFarmaenlace = new HashMap<String, Object>();
|
||||
|
||||
|
||||
SalidaConsulta salida = null;
|
||||
List resultado = null;
|
||||
String message = "Mensaje OK";
|
||||
Boolean status = true;
|
||||
byte[] bytes = { 'c', 'd' };
|
||||
String autorizacion = UUID.nameUUIDFromBytes(bytes).toString().replace("-", "");
|
||||
Integer receta = 0;
|
||||
if (cedula == null || cedula.trim().equals("")) {
|
||||
salida = ServiceUtil.crearSalidaConsultaError(ErrorTipo.WARNING, CodigoRespuesta.CODIGO_IN_NULO, "La entrada no puede ser nula");
|
||||
}else{
|
||||
try {
|
||||
resultado = this.consulta.consultaGet(cedula, diagnostico);
|
||||
|
||||
} catch (DominioExcepcion ex) {
|
||||
Logger.getLogger(FarmaenlaceResource.class.getName()).log(Level.SEVERE, null, ex);
|
||||
} catch (DaoException ex) {
|
||||
Logger.getLogger(FarmaenlaceResource.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
}
|
||||
if(resultado.size()<=0){
|
||||
message = "No se encontraron resultados correspondientes a la cedula ".concat(cedula);
|
||||
status = false;
|
||||
}
|
||||
mapFarmaenlace.put("rec_titular", resultado);
|
||||
Map<String, Object> mapResult = new HashMap<String, Object>();
|
||||
mapResult.put("status", status);
|
||||
mapResult.put("mensaje", message);
|
||||
mapResult.put("autorizacion", autorizacion);
|
||||
mapResult.put("receta", 0);
|
||||
|
||||
mapFarmaenlace.put("result", mapResult);
|
||||
mapFarmaenlace.put("tipo_facturacion", "TOTAL");
|
||||
|
||||
return mapFarmaenlace;
|
||||
/** SalidaConsulta salida = ServiceUtil.crearSalidaConsultaError(CodigoRespuesta.CODIGO_ERROR_GENERICO,
|
||||
"Acción no soportada por favor ejecute la consulta via POST");*/
|
||||
}
|
||||
|
||||
/**
|
||||
* PUT method for updating or creating an instance of ConsultaResource
|
||||
*
|
||||
* @param entrada
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/Confirmacion_Datos")
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public Map<String, Object> postJson(EntradaRecetas entrada) {
|
||||
Map<String, Object> salida = null;
|
||||
if (entrada == null) {
|
||||
//salida = ServiceUtil.crearSalidaAccionError(ErrorTipo.WARNING, CodigoRespuesta.CODIGO_IN_NULO, "La entrada no puede ser nula");
|
||||
} else {
|
||||
//EntidadEnum entidad = Enum.valueOf(EntidadEnum.class, entrada.getBodyIn().getEntidad());
|
||||
|
||||
try {
|
||||
|
||||
salida = ejecutarAccionFarmaenlace(entrada);
|
||||
|
||||
} catch (DominioExcepcion ex) {
|
||||
|
||||
//salida = ServiceUtil.crearSalidaAccionError(ex.getTipo(), ex.getCodigo(), ex.getMensaje());
|
||||
} catch (Exception ex) {
|
||||
System.out.println("============ ERROR NO CONTROLADO ==============");
|
||||
ex.printStackTrace(System.err);
|
||||
String msg = getCauses(ex, new StringBuilder());
|
||||
if (msg.contains("Duplicate entry")) {
|
||||
//salida = ServiceUtil.crearSalidaAccionError(ErrorTipo.ERROR, CodigoRespuesta.CODIGO_ERROR_GUARDA_BDD, "Error el registro " + entrada.getBodyIn().getEntidad() + " ya existe en la Base de datos");
|
||||
} else {
|
||||
//salida = ServiceUtil.crearSalidaAccionError(ErrorTipo.ERROR, CodigoRespuesta.CODIGO_ERROR_GENERICO, "ERROR NO CONTROLADO: " + msg);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return salida;
|
||||
}
|
||||
/**
|
||||
* @param e
|
||||
* @param build
|
||||
* @return
|
||||
*/
|
||||
private String getCauses(Throwable e, StringBuilder build) {
|
||||
build.append("\n").append(e.toString());
|
||||
for (Throwable t : e.getSuppressed()) {
|
||||
System.out.println("SUPRESS =====> " + t);
|
||||
build.append("\n").append(t.toString());
|
||||
getCauses(t, build);
|
||||
}
|
||||
System.out.println("CAUSE =====> " + e);
|
||||
if (e.getCause() != null) {
|
||||
getCauses(e.getCause(), build);
|
||||
}
|
||||
return build.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Ejecuta la accion
|
||||
*
|
||||
* @param entrada
|
||||
* @param entidad
|
||||
* @return
|
||||
* @throws DominioExcepcion
|
||||
*/
|
||||
public Map<String, Object> ejecutarAccionFarmaenlace(EntradaRecetas entrada) throws DominioExcepcion {
|
||||
//SalidaAccionFarmaEnlace salida = new SalidaAccionFarmaEnlace();
|
||||
Map<String, Object> salida = new HashMap<String, Object>();
|
||||
try {
|
||||
Map<String, Object> resultado = accion.accionFarmaenlace(entrada.getReceta(), entrada.getRec_items(), entrada.getRec_facturacion(), entrada.getRec_credito(), entrada.getTipo_facturacion());
|
||||
salida = ServiceUtil.crearSalidaAccionOkFarmaenlace(resultado);
|
||||
|
||||
} catch (Exception e) {
|
||||
}
|
||||
//String msg = "A continuacion se muestra el resultado de la accion.";
|
||||
//HeaderMS header = entrada.getHeaderIn();
|
||||
//header.setFechaHora(DominioConstantes.getDateTime());
|
||||
return salida;
|
||||
}
|
||||
}
|
||||
|
|
@ -15,6 +15,7 @@ import com.qsoft.util.ms.pojo.HeaderMS;
|
|||
import com.qsoft.wmp.services.xsd.SalidaAccion;
|
||||
import com.qsoft.wmp.services.xsd.SalidaConsulta;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
|
|
@ -111,11 +112,25 @@ public class ServiceUtil {
|
|||
/**
|
||||
* Crear salida ok
|
||||
*
|
||||
* @param <error>
|
||||
* @param header
|
||||
* @param estado
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
public static Map<String, Object> crearSalidaAccionOkFarmaenlace(Map<String, Object> resultado) {
|
||||
//SalidaAccionFarmaEnlace salida = new SalidaAccionFarmaEnlace();
|
||||
//salida.setStatus((Boolean) resultado.get("status"));
|
||||
//salida.setMensaje((String) resultado.get("mensaje"));
|
||||
//salida.setAutorizacion((String) resultado.get("autorizacion"));
|
||||
//salida.setReceta((Integer) resultado.get("receta"));
|
||||
|
||||
|
||||
//return salida;
|
||||
return resultado;
|
||||
}
|
||||
|
||||
|
||||
public static SalidaAccion crearSalidaAccionOk(HeaderMS header, String estado, List<Object> data) {
|
||||
SalidaAccion salida = new SalidaAccion();
|
||||
salida.setHeaderOut(header);
|
||||
|
|
@ -180,6 +195,7 @@ public class ServiceUtil {
|
|||
auditoria.setAudTransaccion(header.getTipoTransaccion());
|
||||
auditoria.setAudUsuario(header.getUsuario());
|
||||
return auditoria;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,62 @@
|
|||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package com.qsoft.wmp.services.xsd;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author james
|
||||
*/
|
||||
public class BodyRecetas {
|
||||
|
||||
private Integer tipoConsulta;
|
||||
private Integer maximoRegistros;
|
||||
private Integer registroInicio;
|
||||
private String entidad;
|
||||
private Map<String, Object> parametros;
|
||||
|
||||
public Integer getTipoConsulta() {
|
||||
return tipoConsulta;
|
||||
}
|
||||
|
||||
public void setTipoConsulta(Integer tipoConsulta) {
|
||||
this.tipoConsulta = tipoConsulta;
|
||||
}
|
||||
|
||||
public Map<String, Object> getParametros() {
|
||||
return parametros;
|
||||
}
|
||||
|
||||
public void setParametros(Map<String, Object> parametros) {
|
||||
this.parametros = parametros;
|
||||
}
|
||||
|
||||
public String getEntidad() {
|
||||
return entidad;
|
||||
}
|
||||
|
||||
public void setEntidad(String entidad) {
|
||||
this.entidad = entidad;
|
||||
}
|
||||
|
||||
public Integer getMaximoRegistros() {
|
||||
return maximoRegistros;
|
||||
}
|
||||
|
||||
public void setMaximoRegistros(Integer maximoRegistros) {
|
||||
this.maximoRegistros = maximoRegistros;
|
||||
}
|
||||
|
||||
public Integer getRegistroInicio() {
|
||||
return registroInicio;
|
||||
}
|
||||
|
||||
public void setRegistroInicio(Integer registroInicio) {
|
||||
this.registroInicio = registroInicio;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,92 @@
|
|||
/*
|
||||
* EntradaConsulta.java
|
||||
* 15 de feb. de 2017
|
||||
* Copyright 2017 TCS.
|
||||
* Todos los derechos reservados.
|
||||
*/
|
||||
package com.qsoft.wmp.services.xsd;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonAlias;
|
||||
import com.qsoft.util.ms.pojo.HeaderMS;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlSeeAlso;
|
||||
|
||||
/**
|
||||
* <b> Entrada del servicio web. </b>
|
||||
*
|
||||
* @author jaime Ruales
|
||||
* @version $1.0$
|
||||
*/
|
||||
@XmlSeeAlso({HeaderMS.class})
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class EntradaRecetas implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 8142263336233087792L;
|
||||
@XmlElement(name = "receta")
|
||||
@JsonAlias("receta")
|
||||
private Map<String, Object> receta;
|
||||
|
||||
@XmlElement(name = "rec_items")
|
||||
@JsonAlias("rec_items")
|
||||
private List<Map<String, Object>> rec_items;
|
||||
|
||||
@XmlElement(name = "rec_facturacion")
|
||||
@JsonAlias("rec_facturacion")
|
||||
private Map<String, Object> rec_facturacion;
|
||||
|
||||
@XmlElement(name = "rec_credito")
|
||||
@JsonAlias("rec_credito")
|
||||
private Map<String, Object> rec_credito;
|
||||
|
||||
@XmlElement(name = "tipo_facturacion")
|
||||
@JsonAlias("tipo_facturacion")
|
||||
private String tipo_facturacion;
|
||||
|
||||
public Map<String, Object> getReceta() {
|
||||
return receta;
|
||||
}
|
||||
|
||||
public void setReceta(Map<String, Object> receta) {
|
||||
this.receta = receta;
|
||||
}
|
||||
|
||||
public List<Map<String, Object>> getRec_items() {
|
||||
return rec_items;
|
||||
}
|
||||
|
||||
public void setRec_items(List<Map<String, Object>> rec_items) {
|
||||
this.rec_items = rec_items;
|
||||
}
|
||||
|
||||
public Map<String, Object> getRec_facturacion() {
|
||||
return rec_facturacion;
|
||||
}
|
||||
|
||||
public void setRec_facturacion(Map<String, Object> rec_facturacion) {
|
||||
this.rec_facturacion = rec_facturacion;
|
||||
}
|
||||
|
||||
public Map<String, Object> getRec_credito() {
|
||||
return rec_credito;
|
||||
}
|
||||
|
||||
public void setRec_credito(Map<String, Object> rec_credito) {
|
||||
this.rec_credito = rec_credito;
|
||||
}
|
||||
|
||||
public String getTipo_facturacion() {
|
||||
return tipo_facturacion;
|
||||
}
|
||||
|
||||
public void setTipo_facturacion(String tipo_facturacion) {
|
||||
this.tipo_facturacion = tipo_facturacion;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
package com.qsoft.wmp.services.xsd;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonAlias;
|
||||
import com.qsoft.util.ms.pojo.ErrorMS;
|
||||
import com.qsoft.util.ms.pojo.HeaderMS;
|
||||
import java.io.Serializable;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlSeeAlso;
|
||||
|
||||
|
||||
/**
|
||||
* <b> Salida del Servicio Web. </b>
|
||||
*
|
||||
* @author Jaime Ruales.
|
||||
* @version $1.0$
|
||||
*/
|
||||
@XmlSeeAlso({HeaderMS.class, ErrorMS.class})
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class SalidaAccionFarmaEnlace implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 5403227918589158188L;
|
||||
|
||||
@XmlElement(name = "status")
|
||||
@JsonAlias("status")
|
||||
protected Boolean status;
|
||||
|
||||
@XmlElement(name = "mensaje")
|
||||
@JsonAlias("mensaje")
|
||||
protected String mensaje;
|
||||
|
||||
@XmlElement(name = "autorizacion")
|
||||
@JsonAlias("autorizacion")
|
||||
protected String autorizacion;
|
||||
|
||||
@XmlElement(name = "receta")
|
||||
@JsonAlias("receta")
|
||||
protected Integer receta;
|
||||
|
||||
public static long getSerialVersionUID() {
|
||||
return serialVersionUID;
|
||||
}
|
||||
|
||||
public void setStatus(Boolean status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
|
||||
public void setMensaje(String mensaje) {
|
||||
this.mensaje = mensaje;
|
||||
}
|
||||
|
||||
public String getMensaje() {
|
||||
return mensaje;
|
||||
}
|
||||
|
||||
public void setAutorizacion(String autorizacion) {
|
||||
this.autorizacion = autorizacion;
|
||||
}
|
||||
|
||||
public String getAutorizacion() {
|
||||
return autorizacion;
|
||||
}
|
||||
|
||||
public void setReceta(Integer receta) {
|
||||
this.receta = receta;
|
||||
}
|
||||
|
||||
public Integer getReceta() {
|
||||
return receta;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,4 +1,16 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
|
||||
|
||||
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
|
||||
<servlet>
|
||||
<servlet-name>com.qsoft.wmp.services.rest.ApplicationConfig</servlet-name>
|
||||
<init-param>
|
||||
<param-name>jersey.config.server.provider.classnames</param-name>
|
||||
<param-value>org.glassfish.jersey.jackson.JacksonFeature</param-value>
|
||||
</init-param>
|
||||
<load-on-startup>1</load-on-startup>
|
||||
</servlet>
|
||||
<servlet-mapping>
|
||||
<servlet-name>com.qsoft.wmp.services.rest.ApplicationConfig</servlet-name>
|
||||
<url-pattern>/servicios/*</url-pattern>
|
||||
</servlet-mapping>
|
||||
</web-app>
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
"canal": null,
|
||||
"medio": null,
|
||||
"aplicacion": "WeERPV1.0",
|
||||
"tipoTransaccion": "0101151",
|
||||
"tipoTransaccion": "0101150",
|
||||
"usuario": "james",
|
||||
"uuid": "2e25aed60f2d4c63e33864a638b906f2df987a9b37ce3f8dafde7b565b2a6c41",
|
||||
"fechaHora": "20/05/2020 23:55:36",
|
||||
|
|
@ -14,45 +14,79 @@
|
|||
},
|
||||
"bodyIn": {
|
||||
"tipoAccion": 1,
|
||||
"entidad": "FacturaCompra",
|
||||
"entidad": "DetalleLiquidacion",
|
||||
"entidades": [
|
||||
{
|
||||
"facEstablecimiento": "001",
|
||||
"facPtoEmision": "001",
|
||||
"facSecuencial": "00000001",
|
||||
"facClaveAcceso": null,
|
||||
"facAutorizacion": null,
|
||||
"facTotalDescuentos": null,
|
||||
"facTotalImpuestos": null,
|
||||
"facTotalOtros": null,
|
||||
"facImporte": null,
|
||||
"facTotal": null,
|
||||
"facAdelanto": null,
|
||||
"facPendiente": null,
|
||||
"facReferencia": null,
|
||||
"facPropina": null,
|
||||
"facFechaRegistro": null,
|
||||
"facFechaAutorizacion": null,
|
||||
"facDescripcion": null,
|
||||
"facObservacion": null,
|
||||
"facDetalle": null,
|
||||
"facDinamico": "CUANDO SE ADQUIERE SERVICIOS O CONSUMIBLES QUE NO GENERAN ENTRADA SE AGREGA AQUI",
|
||||
"ejeCodigo": null,
|
||||
"empCodigo": null,
|
||||
"proCodigo": 1,
|
||||
{
|
||||
"favCodigo": null,
|
||||
"favEstablecimiento": "001",
|
||||
"favPtoEmision": "001",
|
||||
"favSecuencial": "00000095",
|
||||
"favReferencia": null,
|
||||
"favClaveAcceso": null,
|
||||
"favAutorizacion": null,
|
||||
"favFechaRegistro": null,
|
||||
"favFechaAutorizacion": null,
|
||||
"favTotalImpuestos": null,
|
||||
"favTotalDescuentos": null,
|
||||
"favAdelanto": null,
|
||||
"favPendiente": null,
|
||||
"favTotalOtros": null,
|
||||
"favPropina": null,
|
||||
"favImporte": 50.2,
|
||||
"favTotal": null,
|
||||
"favDescripcion": null,
|
||||
"favObservacion": "Factura de prueba",
|
||||
"favDinamico": null,
|
||||
"detEstado": null,
|
||||
"detTipo": null,
|
||||
"cliCodigo": 1,
|
||||
"ejeCodigo": null,
|
||||
"sucCodigo": null,
|
||||
"usuCodigo": null,
|
||||
"cliMailNotifica": "test@qsoftec.com",
|
||||
"favFechaPago": null,
|
||||
"favFechaEmision": "2020-07-12 13:19:16",
|
||||
"detalle": [
|
||||
{
|
||||
"denCantidad": 2.0,
|
||||
"denPrecioCompra": 89.3,
|
||||
"denFecProduccion": 1590073789081,
|
||||
"denFecCaducidad": 1590073789081,
|
||||
"artCodigo": 1,
|
||||
"bodCodigo": 1,
|
||||
"detUnidad": null,
|
||||
"entCodigo": null
|
||||
"defOrden": null,
|
||||
"defCantidad": null,
|
||||
"defPrecioUnitario": null,
|
||||
"defValorDescuentos": null,
|
||||
"defValorImpuestos": null,
|
||||
"defValorOtros": null,
|
||||
"defDetalleAd": null,
|
||||
"defImporte": null,
|
||||
"defTotal": null,
|
||||
"defDescripcion": null,
|
||||
"artCodigo": null,
|
||||
"impuesto": [
|
||||
{
|
||||
"imfValor": null,
|
||||
"imfEstado": null,
|
||||
"rubCodigo": null
|
||||
}
|
||||
],
|
||||
"descuento": [
|
||||
{
|
||||
"dsfValor": null,
|
||||
"dsfEstado": null,
|
||||
"rubCodigo": null
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"impuesto": [
|
||||
{
|
||||
"imfValor": null,
|
||||
"imfEstado": null,
|
||||
"rubCodigo": null
|
||||
}
|
||||
],
|
||||
"descuento": [
|
||||
{
|
||||
"dsfValor": null,
|
||||
"dsfEstado": null,
|
||||
"rubCodigo": null
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,10 +9,16 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
|||
import com.qsoft.erp.constantes.DominioConstantes;
|
||||
import com.qsoft.erp.constantes.EntidadEnum;
|
||||
import com.qsoft.erp.dominio.AccionGenerica;
|
||||
import com.qsoft.erp.dto.DescuentoFacturaDTO;
|
||||
import com.qsoft.erp.dto.DetalleEntradaDTO;
|
||||
import com.qsoft.erp.dto.DetalleFacturaDTO;
|
||||
import com.qsoft.erp.dto.DocumentoDTO;
|
||||
import com.qsoft.erp.dto.EstadoLiquidacionDTO;
|
||||
import com.qsoft.erp.dto.FacturaCompraDTO;
|
||||
import com.qsoft.erp.dto.FacturaVentaDTO;
|
||||
import com.qsoft.erp.dto.ImpuestoFacturaDTO;
|
||||
import com.qsoft.erp.dto.LiquidacionDTO;
|
||||
import com.qsoft.erp.dto.PolizaDTO;
|
||||
import com.qsoft.erp.model.FacturaCompra;
|
||||
import com.qsoft.wmp.services.rest.AccionResource;
|
||||
import com.qsoft.wmp.services.rest.ConsultaResource;
|
||||
import com.qsoft.wmp.services.xsd.EntradaAccion;
|
||||
|
|
@ -20,6 +26,7 @@ import com.qsoft.wmp.services.xsd.EntradaConsulta;
|
|||
import com.qsoft.wmp.services.xsd.SalidaConsulta;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
|
@ -35,6 +42,7 @@ public class Tester {
|
|||
testAccionService();
|
||||
}
|
||||
|
||||
|
||||
public static void testConsultaService() throws IOException {
|
||||
ObjectMapper maper = new ObjectMapper();
|
||||
EntradaConsulta entrada = new EntradaConsulta();
|
||||
|
|
@ -67,7 +75,7 @@ public class Tester {
|
|||
ObjectMapper maper = new ObjectMapper();
|
||||
EntradaAccion entrada = new EntradaAccion();
|
||||
entrada.getBodyIn().setTipoAccion(AccionGenerica.GUARDA);
|
||||
entrada.getBodyIn().setEntidad(EntidadEnum.DetalleLiquidacion.name());
|
||||
entrada.getBodyIn().setEntidad(EntidadEnum.FacturaCompra.name());
|
||||
List<Map<String, Object>> entidades = new ArrayList<>();
|
||||
//TODO: agregar entidades
|
||||
entrada.getBodyIn().setEntidades(entidades);
|
||||
|
|
@ -76,24 +84,24 @@ public class Tester {
|
|||
System.out.println("JSON=> " + s);
|
||||
AccionResource ar = new AccionResource();
|
||||
System.out.println("POSTING....");
|
||||
List<PolizaDTO> data = new ArrayList<>();
|
||||
PolizaDTO pol = new PolizaDTO();
|
||||
pol.setDetTipoIdentificacion(3);
|
||||
pol.setPerCedulaTitular("1715060073");
|
||||
pol.setDetModalidad(25);
|
||||
pol.setDetPeriodicidad(17200);
|
||||
pol.setDetFormaPago(23516);
|
||||
pol.setDetIfi(17205);
|
||||
pol.setDetSucursalIfi(23484);
|
||||
pol.setDetPromocion(23584);
|
||||
pol.setDetTipoCuenta(17187);
|
||||
pol.setEmpCodigo(2);
|
||||
pol.setCedulaDebito("1715060012");
|
||||
pol.setCuentaDebito("123456789");
|
||||
pol.setPolBroker("Asesor CPN");
|
||||
List<FacturaCompraDTO> data = new ArrayList<>();
|
||||
|
||||
FacturaCompraDTO factura = new FacturaCompraDTO();
|
||||
factura.setFacEstablecimiento("001");
|
||||
factura.setFacPtoEmision("001");
|
||||
factura.setFacSecuencial("00000095");
|
||||
factura.setFacFechaEmision(new Date());
|
||||
factura.setProCodigo(1);
|
||||
factura.setFacImporte(50.20);
|
||||
factura.setFacObservacion("Factura de prueba");
|
||||
|
||||
List<DetalleEntradaDTO> detalle = new ArrayList<>();
|
||||
|
||||
detalle.add(new DetalleEntradaDTO());
|
||||
factura.setDetalle(detalle);
|
||||
|
||||
data.add(factura);
|
||||
|
||||
data.add(pol);
|
||||
|
||||
s = maper.writeValueAsString(data);
|
||||
System.out.println("JSON=> " + s);
|
||||
// SalidaAccion salida = ar.postJson(entrada);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,48 @@
|
|||
{
|
||||
"headerIn": {
|
||||
"dispositivo": "WeLaptop",
|
||||
"canal": "01",
|
||||
"medio": "01",
|
||||
"aplicacion": "WeMedicalProV1.0",
|
||||
"tipoTransaccion": "0101110",
|
||||
"usuario": "james",
|
||||
"uuid": "ALGUN TOKEN",
|
||||
"fechaHora": null,
|
||||
"idioma": null,
|
||||
"empresa": null,
|
||||
"geolocalizacion": null
|
||||
},
|
||||
"bodyIn": {
|
||||
"tipoNotificacion": 1,
|
||||
"parametros": {
|
||||
"[ADJUNTO]": "/data/wmp/poliza/PREMIUM-signed.pdf",
|
||||
"[ASUNTO]": "Bienvenido al servicio de medicina Prepagada de Caridel",
|
||||
"[CLIENTE]": "EDISON RAMIRO",
|
||||
"[COBERTURA]": "25000.0",
|
||||
"[COMPROBANTE]": "POLIZA",
|
||||
"[EMAIL]": "karito_634@yahoo.es",
|
||||
"[EMISOR]": "CARIDEL S.A.",
|
||||
"[EMISOR_MAIL]": "notificaciones@caridelsa.com",
|
||||
"[EMISOR_WEB]": "http://cpnsalud.caridel.net/",
|
||||
"[FECHAEMI]": "01/04/2020 23:40:30",
|
||||
"[IDENTIFICACION]": "1002366654",
|
||||
"[NUMDOC]": "POL0000000332",
|
||||
"[PLAN]": "MASIVOS PREMIUN CPN"
|
||||
},
|
||||
"adjuntos": [
|
||||
{
|
||||
"nombre": "archivo1.pdf",
|
||||
"archivo": "UklGRoJgAABXRUJQVlA4IHZgAADQAwGdASoAAQABPjEUiEKiISEXq+4MIAMEtQBYU7REd+X/vH7S/lv8ndg......."
|
||||
},
|
||||
{
|
||||
"nombre": "archivo2.txt",
|
||||
"archivo": "zU4pk7xWlI3KLzi7huKBDIulPve0zFmNc30vUd3a29NIcoHBLRNxzamSywbh1dGBh2drEZI5qvE4WEvRutK5...."
|
||||
},
|
||||
{
|
||||
"nombre": "archivo3.jpg",
|
||||
"archivo": "3qwduvkya8kAXnvUbjh4X7oXRWt59pAIq+77Awuqo6CtaYmslelq0WZP9YG69Ons09NkwRKf5KFfEezMo+6VRyzpEln6qTMMUH0..."
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -4,20 +4,25 @@
|
|||
"canal": null,
|
||||
"medio": null,
|
||||
"aplicacion": "WeMedicalProV1.0",
|
||||
"tipoTransaccion": "0101000",
|
||||
"usuario": "james",
|
||||
"uuid": "7cbec0b8ec642ddbd7b9b24a35e39b70938d",
|
||||
"tipoTransaccion": "0101110",
|
||||
"usuario": "1715060073",
|
||||
"uuid": "483983e305e3a278255bc5e95942ee35d48b9b2c58fea756d3d234f3695ce198",
|
||||
"fechaHora": null,
|
||||
"idioma": null,
|
||||
"empresa": null,
|
||||
"geolocalizacion": null
|
||||
},
|
||||
"bodyIn": {
|
||||
"maximoRegistros": 10,
|
||||
"tipoConsulta": 1,
|
||||
"entidad": "Empresa",
|
||||
"entidad": "Liquidacion",
|
||||
"parametros": {
|
||||
"tipoNemonico": "COMERC"
|
||||
"Liquidacion": {
|
||||
"liqCodigo": "235",
|
||||
"estados": [{
|
||||
"usuCodigo": 1
|
||||
}]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue