Cambios de ultimas correcciones a dda

parent e4eb0858
Manifest-Version: 1.0
Built-By: jfmj_
Build-Jdk: 17.0.2
Created-By: Maven Integration for Eclipse
#Generated by Maven Integration for Eclipse
#Mon Dec 12 23:09:04 CST 2022
#Wed May 24 17:45:51 CDT 2023
m2e.projectLocation=C\:\\Users\\jfmj_\\Documents\\DDA\\Githg\\dda-front\\dominio
m2e.projectName=dominio
groupId=com.mx.dla
......
......@@ -2,7 +2,7 @@
#Development version
ordenInterna.idPosicion=00010
ordenInterna.idMaterial.suscripcion=300000000
ordenInterna.idMaterial.suscripcion=400000010
ordenInterna.idMaterial.transaccines=300000004
ordenInterna.idMaterial.licenseFee=300000104
......@@ -24,7 +24,7 @@ ordenInterna.claseDoc.t=NT08
ordenInterna.claseDoc.a=CD06
ordenInterna.claseDoc.na=CD06
ordenInterna.idProveedor=0030800000
ordenInterna.idProveedor=3001000056
ordenInterna.orgCompras=AMCO
ordenInterna.grupoCompras=N06
......@@ -76,7 +76,7 @@ uri.rest.reporte.amortizacion.baseActivos = http://${servidor.rest.ws}/DDA_WSB_P
uri.ws.carga.visualizaciones.procesa = http://${servidor.rest.ws}/DDA_WSB_Procesos/services/proceso/procesarCargaTitulosVS
uri.rest.titulosBroadView = http://localhost:5000/v1/broadview/titulos/
uri.rest.titulosBroadView = http://localhost:5001/v1/broadview/titulos/
#*************************Propiedades para Facturacion*******************
#sociedad tambien se usa en Nota Credito
......
No preview for this file type
#Generated by Maven
#Mon Dec 05 14:50:17 CST 2022
#Fri May 12 12:25:11 CDT 2023
version=1.1
groupId=com.mx.dla
artifactId=dominio
......@@ -290,6 +290,7 @@ com\mx\dla\dda\catalogos\dtos\ServicioDTO.class
com\mx\dla\dda\catalogos\dtos\PaisVentaDTO.class
com\mx\dla\dda\contrato\generales\dtos\CambioEstatusDTO.class
com\mx\dla\dda\contrato\ws\cargaTitulos\ResponseTitulosBroadViewDTO.class
com\mx\dla\dda\admin\catalogos\transacciones\dtos\ConfiguracionesDTO.class
com\mx\dla\dda\contrato\transaccion\ws\titulos\dtos\CargaPrincipalTRDTO.class
com\mx\dla\dda\contrato\minimoseleccion\dtos\AnnioPeriodoDTO.class
com\mx\dla\dda\factura\general\dtos\FacturacionKeysDTO.class
......
......@@ -189,6 +189,7 @@ C:\Users\jfmj_\Documents\DDA\Githg\dda-front\dominio\src\main\java\com\mx\dla\dd
C:\Users\jfmj_\Documents\DDA\Githg\dda-front\dominio\src\main\java\com\mx\dla\dda\contrato\fees\dtos\FeesPagoFlat.java
C:\Users\jfmj_\Documents\DDA\Githg\dda-front\dominio\src\main\java\com\mx\dla\dda\reporte\amortizacion\dtos\MesesAmortizacionDTO.java
C:\Users\jfmj_\Documents\DDA\Githg\dda-front\dominio\src\main\java\com\mx\dla\dda\contrato\condicionesTransaccion\dtos\ContratoPtrsPrecioDTO.java
C:\Users\jfmj_\Documents\DDA\Githg\dda-front\dominio\src\main\java\com\mx\dla\dda\admin\catalogos\transacciones\dtos\ConfiguracionesDTO.java
C:\Users\jfmj_\Documents\DDA\Githg\dda-front\dominio\src\main\java\com\mx\dla\dda\ordenesinternas\dtos\PresupuestoOrdenDTO.java
C:\Users\jfmj_\Documents\DDA\Githg\dda-front\dominio\src\main\java\com\mx\dla\dda\admin\catalogos\tipoCambioAddOns\dtos\TipoCambioPorPaisAddOnsDTO.java
C:\Users\jfmj_\Documents\DDA\Githg\dda-front\dominio\src\main\java\com\mx\dla\dda\contrato\titulos\constants\TipoOrden.java
......
......@@ -33,12 +33,12 @@ public class ReporteContingenciaExcelAction extends BaseContratoAction {
//System.out.print("Action Excel ...2");
setFileName( idCon != null ? idEstudio + "_" + idCon : idEstudio + "");
try {
/*try {
bdsp.ejecutaSP_MarcaCont(idCon, idEstudio.toString());
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}*/
return SUCCESS;
}
......
$().ready(function() {
//console.log('Iniciando pantalla');
$("#loadingDiv").hide();
$("#labelDiv").hide();
});
function callActionAjax(actionRoute, jsonActionParameter, functionProcessor){
......@@ -156,6 +157,7 @@ function procesaReportePrincipal(jsonData) {
jQuery('#reporteTable').jqGrid('clearGridData').jqGrid('setGridParam', {colNames:colNamesVar, colModel:colModelVar ,data: datos, datatype: 'local'}).trigger('reloadGrid');
$("#botonExportar").prop( "disabled", true);
$("#botonNotificar").prop( "disabled", true);
$("#labelDiv").hide();
}
$("#loadingDiv").hide();
......@@ -178,6 +180,8 @@ function colocaFechaFin(){
function llamaReporteInfoAction(){ //Funcion de boton Consultar
$("#loadingDiv").show();
textoLabel();
$("#labelDiv").show();
$("#reporteTableDiv").hide();
var jsonString = '{"idCon" : "' + $("#campoContrato").val() + '", "fechaInicio":"01/01/2021", "fechaFin":"01/01/2022", "idEstudio":"'+ $("#campoEstudio").val() +'"}';
var stringJson = JSON.parse(jsonString);
......@@ -193,10 +197,54 @@ function descargarReporteEnExcel() {
window.open(url);
}
function textoLabel(){
const str2 = $("#campoContrato option:selected").text();
console.log("hola" + str2)
if(str2.endsWith('A')){
$("#tipoContrato").text("Contrato Addendum");
} else {
if(str2.endsWith('O')){
$("#tipoContrato").text("Contrato Original");
} else {
if(str2.endsWith('V')){
$("#tipoContrato").text("Contrato Virtual");
} else {
$("#tipoContrato").text("Contrato Enmienda");
}
}
}
}
function notificarSAP(){
var jsonString = '{"idCon" : "' + $("#campoContrato").val() + '", "fechaInicio":"01/01/2021", "fechaFin":"01/01/2022", "idEstudio":"'+ $("#campoEstudio").val() +'"}';
var stringJson = JSON.parse(jsonString);
callActionAjax( "/admin/reporteContingencia/notificaSAP", stringJson, procesaReportePrincipal);
const str2 = $("#campoContrato option:selected").text();
if(str2.endsWith('A') || str2.endsWith('O') || str2.endsWith('V')){
$.ajax({
url: 'http://localhost:5000/DDA_CRN_Exhibicion/servicio',
type: 'GET',
dataType: "json",
success:function(response){
console.log("Servicio ejecutado correctamente ");
},
error:function(jqXhr, textStatus, errorThrown){
console.error("Error: " + textStatus + " ::: " + errorThrown + " ::: " + jqXhr);
}
});
} else {
$.ajax({
url: 'http://localhost:5000/DDA_CRN_ClienteSAP/servicioEnmienda',
type: 'GET',
dataType: "json",
success:function(response){
console.log("Servicio ejecutado correctamente ");
},
error:function(jqXhr, textStatus, errorThrown){
console.error("Error: " + textStatus + " ::: " + errorThrown + " ::: " + jqXhr);
}
});
}
showMessage("Se a ejecutado el prodeso de Notificacion SAP");
}
......@@ -62,6 +62,11 @@
</div>
</br>
</br>
<div id="labelDiv" style="display: block;">
<label class="control-label" id="tipoContrato">Contrato Addendum</label>
</div>
</br>
</br>
<div class='alert alert-dismissible alert-warning' id="loadingDiv" style="display: block;">
......
package com.mx.dla.dda.admin.catalogos.usuario.actions;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import com.mx.dla.dda.admin.catalogos.usuario.bos.CatalogoUsuarioBO;
import com.mx.dla.dda.admin.catalogos.usuario.dtos.CatalogoUsuarioDTO;
import com.mx.dla.dda.catalogos.dtos.CatalogoDTO;
import com.mx.dla.global.actions.BaseAction;
public class CatalogoUsuarioAction extends BaseAction {
private static final long serialVersionUID = -7755051578399274173L;
private List<CatalogoUsuarioDTO> usuarios;
private List<CatalogoDTO> empresas;
private List<CatalogoDTO> areas;
private List<CatalogoDTO> perfiles;
private List<CatalogoDTO> estudios;
private CatalogoUsuarioDTO usuario;
private String errorMensaje;
@Autowired
private CatalogoUsuarioBO catalogoUsuarioBO;
@Override
public String execute() throws Exception {
return SUCCESS;
}
public String obtenerListaUsuarios() {
try {
logger.info("obtenerListaUsuarios");
usuarios = catalogoUsuarioBO.obtenListadoUsuarios();
logger.info("usuarios: {}", usuarios);
} catch (Exception e) {
errorMensaje = e.getMessage();
}
return SUCCESS;
}
public String obtenerCatalogos() {
try {
logger.info("obtenerCatalogos");
empresas = catalogoUsuarioBO.obtenCatalogoEmpresas();
areas = catalogoUsuarioBO.obtenCatalogoAreas();
perfiles = catalogoUsuarioBO.obtenCatalogoPerfiles();
// estudios = catalogoUsuarioBO.obtenCatalogoEstudios();
logger.info("empresas: {}", empresas);
logger.info("areas: {}", areas);
logger.info("perfiles: {}", perfiles);
// logger.info("estudios: {}", estudios);
} catch (Exception e) {
errorMensaje = e.getMessage();
}
return SUCCESS;
}
public String obtenerEstudiosDisponibles() {
try {
logger.info("obtenerEstudiosDisponibles");
logger.info("usuario: {}", usuario);
estudios = catalogoUsuarioBO.obtenEstudiosPorUsuario(usuario, false);
logger.info("estudios: {}", estudios);
} catch (Exception e) {
errorMensaje = e.getMessage();
}
return SUCCESS;
}
public String obtenerEstudiosElegidos() {
try {
logger.info("obtenerEstudiosElegidos");
logger.info("usuario: {}", usuario);
estudios = catalogoUsuarioBO.obtenEstudiosPorUsuario(usuario, true);
logger.info("estudios: {}", estudios);
} catch (Exception e) {
errorMensaje = e.getMessage();
}
return SUCCESS;
}
public String guardarUsuario() {
try {
logger.info("guardaUsuario");
logger.info("usuario: {}", usuario);
logger.info("estudios: {}", estudios);
catalogoUsuarioBO.guardaUsuario(usuario, estudios);
logger.info("Done!");
} catch (Exception e) {
errorMensaje = e.getMessage();
}
return SUCCESS;
}
public List<CatalogoUsuarioDTO> getUsuarios() {
return usuarios;
}
public void setUsuarios(List<CatalogoUsuarioDTO> usuarios) {
this.usuarios = usuarios;
}
public List<CatalogoDTO> getEmpresas() {
return empresas;
}
public void setEmpresas(List<CatalogoDTO> empresas) {
this.empresas = empresas;
}
public List<CatalogoDTO> getAreas() {
return areas;
}
public void setAreas(List<CatalogoDTO> areas) {
this.areas = areas;
}
public List<CatalogoDTO> getPerfiles() {
return perfiles;
}
public void setPerfiles(List<CatalogoDTO> perfiles) {
this.perfiles = perfiles;
}
public List<CatalogoDTO> getEstudios() {
return estudios;
}
public void setEstudios(List<CatalogoDTO> estudios) {
this.estudios = estudios;
}
public String getErrorMensaje() {
return errorMensaje;
}
public void setErrorMensaje(String errorMensaje) {
this.errorMensaje = errorMensaje;
}
public CatalogoUsuarioDTO getUsuario() {
return usuario;
}
public void setUsuario(CatalogoUsuarioDTO usuario) {
this.usuario = usuario;
}
}
\ No newline at end of file
package com.mx.dla.dda.reporte.cpview.actions;
import java.io.File;
import java.io.InputStream;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import com.mx.dla.admin.dtos.UsuarioDTO;
import com.mx.dla.dda.catalogos.bos.CatalogosBO;
import com.mx.dla.dda.catalogos.dtos.CatalogoDTO;
import com.mx.dla.dda.contrato.common.actions.BaseContratoAction;
import com.mx.dla.dda.reporte.cpview.bos.ReporteCostoPerViewBO;
import com.mx.dla.dda.reporte.cpview.dtos.ReporteCostPerViewVistaDTO;
import com.mx.dla.dda.reporte.cpview.dtos.VisualizacionesCostPerViewVistaDTO;
public class ReporteCostoPerViewAction extends BaseContratoAction {
private static final long serialVersionUID = -8363640992586901052L;
private String fecha;
private ReporteCostPerViewVistaDTO reporteVista;
private VisualizacionesCostPerViewVistaDTO visualizacionesVista;
private InputStream fileInputStream;
private String fileName;
private String tipoReporte;
private File file;
private String fileFileName;
private String errorMensaje;
private Long idEstudio;
private List<CatalogoDTO> estudios;
@Autowired
private ReporteCostoPerViewBO reporteCostoPerViewBO;
@Autowired
private CatalogosBO catalogosBO;
public String execute() {
return SUCCESS;
}
public String obtenerDatosReporteMensual() {
try {
logger.info("fecha: {}", fecha, idEstudio);
reporteVista = reporteCostoPerViewBO.obtenerReporteMensualVista(fecha, idEstudio, true);
logger.info("getTabla: {}", reporteVista.getTabla());
logger.info("getPheader: {}", reporteVista.getPheader());
logger.info("getRheader: {}", reporteVista.getRheader());
} catch (Exception e) {
errorMensaje = e.getMessage();
}
return SUCCESS;
}
public String obtenerDatosReporteAnual() {
try {
logger.info("fecha: {} idEstudio: {}", fecha, idEstudio);
reporteVista = reporteCostoPerViewBO.obtenerReporteAnualVista(fecha, idEstudio, true);
logger.info("getTabla: {}", reporteVista.getTabla());
logger.info("getPheader: {}", reporteVista.getPheader());
logger.info("getRheader: {}", reporteVista.getRheader());
} catch (Exception e) {
errorMensaje = e.getMessage();
}
return SUCCESS;
}
public String exportarReporte() {
try {
logger.info("{} {}", tipoReporte, fecha);
logger.info("{}", idEstudio);
fileInputStream = reporteCostoPerViewBO.obtenerStreamReporte(tipoReporte, fecha, idEstudio);
} catch (Exception e) {
errorMensaje = e.getMessage();
}
return SUCCESS;
}
public String procesarArchivoVisualizacionesCarga() {
logger.info("{} {}", file, fileFileName);
logger.info("{}", fileName);
UsuarioDTO usuario = (UsuarioDTO) getSession().get("usuario");
try {
logger.info("{}", usuario);
reporteCostoPerViewBO.procesarStreamArchivoCarga(file, fileFileName, fecha, usuario.getExpediente());
} catch (Exception e) {
errorMensaje = e.getMessage();
}
return SUCCESS;
}
public String obtenerDatosCargaVisualizacionesMensual() {
try {
logger.info("fecha: {}", fecha);
visualizacionesVista = reporteCostoPerViewBO.obtenerCargaVisualizacionesMensualVista(fecha);
logger.info("getTabla: {}", visualizacionesVista.getTabla());
logger.info("getCorrectos: {}, getErroneos: {}", visualizacionesVista.getCorrectos(), visualizacionesVista.getErroneos());
logger.info("getLeidos: {}", visualizacionesVista.getLeidos());
} catch (Exception e) {
errorMensaje = e.getMessage();
}
return SUCCESS;
}
public String obtenerDatosCargaVisualizacionesPrincipal() {
try {
logger.info("fecha: {}", fecha);
visualizacionesVista = reporteCostoPerViewBO.obtenCargaVisualizacionesPrincipalTabla(fecha);
logger.info("getTabla: {}", visualizacionesVista.getTabla());
logger.info("getCorrectos: {}, getErroneos: {}", visualizacionesVista.getCorrectos(), visualizacionesVista.getErroneos());
logger.info("getLeidos: {}", visualizacionesVista.getLeidos());
} catch (Exception e) {
errorMensaje = e.getMessage();
}
return SUCCESS;
}
public String descargarVisualizaciones() {
try {
logger.info("{} {}", tipoReporte, fecha);
fileInputStream = reporteCostoPerViewBO.obtenerStreamVisualizaciones(fecha);
} catch (Exception e) {
errorMensaje = e.getMessage();
}
return SUCCESS;
}
public String descargarPlantilla() {
try {
logger.info("{} {}", tipoReporte, fecha);
fileInputStream = reporteCostoPerViewBO.obtenerStreamPlantilla();
} catch (Exception e) {
errorMensaje = e.getMessage();
}
return SUCCESS;
}
public String inicializaCatalogos() {
try {
logger.info("{}", estudios);
estudios = catalogosBO.obtenCatalogoEstudios(null, null, null, null, null, null, null, null, null, null);
} catch (Exception e) {
errorMensaje = e.getMessage();
}
return SUCCESS;
}
public String exportarZip() {
try {
logger.info("{} {}", tipoReporte, fecha);
logger.info("{}", idEstudio);
fileInputStream = reporteCostoPerViewBO.obtenerStreamZipReporte(tipoReporte, fecha);
} catch (Exception e) {
errorMensaje = e.getMessage();
}
return SUCCESS;
}
public String getFecha() {
return fecha;
}
public void setFecha(String fecha) {
this.fecha = fecha;
}
public InputStream getFileInputStream() {
return fileInputStream;
}
public void setFileInputStream(InputStream fileInputStream) {
this.fileInputStream = fileInputStream;
}
public String getFileName() {
return fileName;
}
public void setFileName(String fileName) {
this.fileName = fileName;
}
public String getTipoReporte() {
return tipoReporte;
}
public void setTipoReporte(String tipoReporte) {
this.tipoReporte = tipoReporte;
}
public ReporteCostPerViewVistaDTO getReporteVista() {
return reporteVista;
}
public void setReporteVista(ReporteCostPerViewVistaDTO reporteVista) {
this.reporteVista = reporteVista;
}
public File getFile() {
return file;
}
public void setFile(File file) {
this.file = file;
}
public String getFileFileName() {
return fileFileName;
}
public void setFileFileName(String fileFileName) {
this.fileFileName = fileFileName;
}
public VisualizacionesCostPerViewVistaDTO getVisualizacionesVista() {
return visualizacionesVista;
}
public void setVisualizacionesVista(VisualizacionesCostPerViewVistaDTO visualizacionesVista) {
this.visualizacionesVista = visualizacionesVista;
}
public String getErrorMensaje() {
return errorMensaje;
}
public void setErrorMensaje(String errorMensaje) {
this.errorMensaje = errorMensaje;
}
public Long getIdEstudio() {
return idEstudio;
}
public void setIdEstudio(Long idEstudio) {
this.idEstudio = idEstudio;
}
public List<CatalogoDTO> getEstudios() {
return estudios;
}
public void setEstudios(List<CatalogoDTO> estudios) {
this.estudios = estudios;
}
}
\ No newline at end of file
......@@ -7,7 +7,7 @@ error.002 = DLA-002: El usuario no tiene un perfil definido
error.003 = DLA-003: Proporcione un usuario v&aacute;lido
error.004 = DLA-004: Proporcione una contrase&ntilde;a v&aacute;lida
cooking.date=@cooking.date@
cooking.date=05-12-2023
#sociedad = NT07
#centro.de.costos = 07A01US602
......
......@@ -2,7 +2,7 @@
#Development version
ordenInterna.idPosicion=00010
ordenInterna.idMaterial.suscripcion=300000000
ordenInterna.idMaterial.suscripcion=400000010
ordenInterna.idMaterial.transaccines=300000004
ordenInterna.idMaterial.licenseFee=300000104
......@@ -24,7 +24,7 @@ ordenInterna.claseDoc.t=NT08
ordenInterna.claseDoc.a=CD06
ordenInterna.claseDoc.na=CD06
ordenInterna.idProveedor=0030800000
ordenInterna.idProveedor=3001000056
ordenInterna.orgCompras=AMCO
ordenInterna.grupoCompras=N06
......@@ -76,7 +76,7 @@ uri.rest.reporte.amortizacion.baseActivos = http://${servidor.rest.ws}/DDA_WSB_P
uri.ws.carga.visualizaciones.procesa = http://${servidor.rest.ws}/DDA_WSB_Procesos/services/proceso/procesarCargaTitulosVS
uri.rest.titulosBroadView = http://localhost:5000/v1/broadview/titulos/
uri.rest.titulosBroadView = http://localhost:5001/v1/broadview/titulos/
#*************************Propiedades para Facturacion*******************
#sociedad tambien se usa en Nota Credito
......
No preview for this file type
......@@ -7,7 +7,7 @@ error.002 = DLA-002: El usuario no tiene un perfil definido
error.003 = DLA-003: Proporcione un usuario v&aacute;lido
error.004 = DLA-004: Proporcione una contrase&ntilde;a v&aacute;lida
cooking.date=12-05-2022
cooking.date=05-12-2023
#sociedad = NT07
#centro.de.costos = 07A01US602
......
......@@ -1834,6 +1834,10 @@
<result type="json"></result>
</action>
<action name="validaExcepcion" class="com.mx.dla.dda.admin.catalogos.transacciones.actions.ExcepcionesTransAction" method="validaExcepcion">
<result type="json"></result>
</action>
<action name="llamaObtenExcepcion" class="com.mx.dla.dda.admin.catalogos.transacciones.actions.ExcepcionesTransAction" method="llamaObtenExcepcion">
<result type="json"></result>
</action>
......@@ -1863,6 +1867,12 @@
<param name="contentDisposition">attachment;filename="reporteTransaccionesGeneral_${fileName}.xlsx"</param>
</result>
</action>
<action name="cerrar" class="com.mx.dla.dda.admin.catalogos.transacciones.actions.ReporteGeneralAction" method="cerrarReporte">
<result type="json"></result>
</action>
<action name="reabrir" class="com.mx.dla.dda.admin.catalogos.transacciones.actions.ReporteGeneralAction" method="reabrirReporte">
<result type="json"></result>
</action>
</package>
......
......@@ -2,7 +2,7 @@
#Development version
ordenInterna.idPosicion=00010
ordenInterna.idMaterial.suscripcion=300000000
ordenInterna.idMaterial.suscripcion=400000010
ordenInterna.idMaterial.transaccines=300000004
ordenInterna.idMaterial.licenseFee=300000104
......@@ -24,7 +24,7 @@ ordenInterna.claseDoc.t=NT08
ordenInterna.claseDoc.a=CD06
ordenInterna.claseDoc.na=CD06
ordenInterna.idProveedor=0030800000
ordenInterna.idProveedor=3001000056
ordenInterna.orgCompras=AMCO
ordenInterna.grupoCompras=N06
......@@ -76,7 +76,7 @@ uri.rest.reporte.amortizacion.baseActivos = http://${servidor.rest.ws}/DDA_WSB_P
uri.ws.carga.visualizaciones.procesa = http://${servidor.rest.ws}/DDA_WSB_Procesos/services/proceso/procesarCargaTitulosVS
uri.rest.titulosBroadView = http://localhost:5000/v1/broadview/titulos/
uri.rest.titulosBroadView = http://localhost:5001/v1/broadview/titulos/
#*************************Propiedades para Facturacion*******************
#sociedad tambien se usa en Nota Credito
......
......@@ -198,14 +198,14 @@ function llamaActualizaEstudio() {
function procesaRespuestaActualiza(jsonData) {
var seRepite = jsonData.seRepiteSigla;
var seRepite = jsonData.excepcionActualizada;
$('#modalAgregaActualiza').modal('hide');
if(!seRepite) {
if(seRepite) {
showMessage("Actualizado con exito");
}else {
showError("La sigla se repite en otro Estudio.");
showError("No se pueden actualizar excepciones de meses cerrados.");
}
inicial();
......
$().ready(function() {
//console.log('Iniciando pantalla');
$("#loadingDiv").hide();
$("#labelDiv").hide();
});
function callActionAjax(actionRoute, jsonActionParameter, functionProcessor){
......@@ -156,6 +157,7 @@ function procesaReportePrincipal(jsonData) {
jQuery('#reporteTable').jqGrid('clearGridData').jqGrid('setGridParam', {colNames:colNamesVar, colModel:colModelVar ,data: datos, datatype: 'local'}).trigger('reloadGrid');
$("#botonExportar").prop( "disabled", true);
$("#botonNotificar").prop( "disabled", true);
$("#labelDiv").hide();
}
$("#loadingDiv").hide();
......@@ -178,6 +180,8 @@ function colocaFechaFin(){
function llamaReporteInfoAction(){ //Funcion de boton Consultar
$("#loadingDiv").show();
textoLabel();
$("#labelDiv").show();
$("#reporteTableDiv").hide();
var jsonString = '{"idCon" : "' + $("#campoContrato").val() + '", "fechaInicio":"01/01/2021", "fechaFin":"01/01/2022", "idEstudio":"'+ $("#campoEstudio").val() +'"}';
var stringJson = JSON.parse(jsonString);
......@@ -193,10 +197,54 @@ function descargarReporteEnExcel() {
window.open(url);
}
function textoLabel(){
const str2 = $("#campoContrato option:selected").text();
console.log("hola" + str2)
if(str2.endsWith('A')){
$("#tipoContrato").text("Contrato Addendum");
} else {
if(str2.endsWith('O')){
$("#tipoContrato").text("Contrato Original");
} else {
if(str2.endsWith('V')){
$("#tipoContrato").text("Contrato Virtual");
} else {
$("#tipoContrato").text("Contrato Enmienda");
}
}
}
}
function notificarSAP(){
var jsonString = '{"idCon" : "' + $("#campoContrato").val() + '", "fechaInicio":"01/01/2021", "fechaFin":"01/01/2022", "idEstudio":"'+ $("#campoEstudio").val() +'"}';
var stringJson = JSON.parse(jsonString);
callActionAjax( "/admin/reporteContingencia/notificaSAP", stringJson, procesaReportePrincipal);
const str2 = $("#campoContrato option:selected").text();
if(str2.endsWith('A') || str2.endsWith('O') || str2.endsWith('V')){
$.ajax({
url: 'http://localhost:5000/DDA_CRN_Exhibicion/servicio',
type: 'GET',
dataType: "json",
success:function(response){
console.log("Servicio ejecutado correctamente ");
},
error:function(jqXhr, textStatus, errorThrown){
console.error("Error: " + textStatus + " ::: " + errorThrown + " ::: " + jqXhr);
}
});
} else {
$.ajax({
url: 'http://localhost:5000/DDA_CRN_ClienteSAP/servicioEnmienda',
type: 'GET',
dataType: "json",
success:function(response){
console.log("Servicio ejecutado correctamente ");
},
error:function(jqXhr, textStatus, errorThrown){
console.error("Error: " + textStatus + " ::: " + errorThrown + " ::: " + jqXhr);
}
});
}
showMessage("Se a ejecutado el prodeso de Notificacion SAP");
}
......@@ -38,6 +38,17 @@ function inicializarBotones(){
window.open(url);
}
});
$("#cerrar").click(function()
{
callActionAjax("/reporte/reportesTransacciones/cerrar", "", procesaRespuestaCierre);
showMessage("Se cerro el mes ");
});
$("#reabrir").click(function()
{
callActionAjax("/reporte/reportesTransacciones/reabrir", "", procesaRespuestaCierre);
});
}
function limpiarTabla(){
......@@ -230,6 +241,12 @@ function procesaRespuestaActualiza(jsonData) {
inicial();
}
function procesaRespuestaCierre(jsonData) {
showMessage("Se actualizaron las fechas exitosamente");
}
function callActionAjax(actionRoute, jsonActionParameter, functionProcessor){
console.log(actionRoute);
$.ajax({
......
......@@ -80,14 +80,14 @@
</div>
<s:if test="estudioActualizado">
<s:if test="excepcion != null && excepcionActualizada">
<script type="text/javascript">
showMessage("Addon Guardado");
showMessage("Excepcion Guardada");
</script>
</s:if>
<s:elseif test="estudio != null && !estudioActualizado">
<s:elseif test="!excepcionActualizada">
<script type="text/javascript">
showError("Error al agregar el addon");
showError("Error al agregar la excepcion, ya existe un registro con los mismos datos.");
</script>
</s:elseif>
......
......@@ -5,7 +5,11 @@
<script>
</script>
<s:if test="!excepcionActualizada">
<script type="text/javascript">
showError("Error al agregar la excepcion, ya existe un registro con los mismos datos.");
</script>
</s:if>
<input type="hidden" id="pmn" name="pmn" value="${pmn}" />
<div id="divElemetos" class ="row">
<div class="col-xs-10"></div>
......
......@@ -62,6 +62,11 @@
</div>
</br>
</br>
<div id="labelDiv" style="display: block;">
<label class="control-label" id="tipoContrato">Contrato Addendum</label>
</div>
</br>
</br>
<div class='alert alert-dismissible alert-warning' id="loadingDiv" style="display: block;">
......
......@@ -28,16 +28,22 @@
</select>
</div>
<div class="col-xs-2">
<div class="col-xs-1">
<button id="botonConsultar" class="btn btn-info" type="button" >Consultar</button>
</div>
<div class="col-xs-1 centrar-elemento">
<div class="col-xs-1">
<button id="generarExcel" class="btn btn-info" type="button" >Generar Reporte</button>
</div>
<div class="col-xs-2">
<button id="generarExcel" class="btn btn-info" type="button" >Generar Reporte</button>
<div class="col-xs-1">
<button id="cerrar" class="btn btn-info" type="button" >Cerrar mes</button>
</div>
<div class="col-xs-1">
<button id="reabrir" class="btn btn-info" type="button" >Reabrir mes</button>
</div>
</div>
<div id="divTablaExt">
......
#Generated by Maven Integration for Eclipse
#Mon Dec 12 23:09:11 CST 2022
#Tue May 30 17:09:31 CDT 2023
m2e.projectLocation=C\:\\Users\\jfmj_\\Documents\\DDA\\Githg\\dda-front\\front
m2e.projectName=front
groupId=com.mx.dla
......
#Generated by Maven
#Mon Dec 05 14:51:03 CST 2022
#Fri May 12 12:25:32 CDT 2023
version=1.1
groupId=com.mx.dla
artifactId=front
......@@ -7,11 +7,14 @@ import java.util.Map;
import com.mx.dla.dda.reporte.pago.dtos.DetalleContratoDTO;
import com.mx.dla.dda.reporte.pago.dtos.ReporteAddOnRowDTO;
import com.mx.dla.dda.reporte.pago.dtos.ReporteCRowDTO;
import com.mx.dla.dda.reporte.pago.dtos.ReporteInterfazContingenciaDTO;
import com.mx.dla.dda.reporte.pago.dtos.ReporteRowDTO;
public interface ReportePagoAlternoDAO {
public List<DetalleContratoDTO> detalleDontratos();
public List<ReporteRowDTO> obtenerReporteRows(Long idContrato, Long idEstudio, Map<String, String> parametros);
public List<ReporteInterfazContingenciaDTO> obtenerReporteRowsC(String idContrato, Long idEstudio);
public List<ReporteInterfazContingenciaDTO> obtenerReporteRowsEnmienda(String idContrato);
public List<ReporteCRowDTO> obtenerReporteRowsCExcel(String idContrato, Long idEstudio) ;
public List<Map<String, String>> obtenerListaMapas();
public List<ReporteCRowDTO> obtenerReporteRowsS(Date fechaInicio);
......
......@@ -24,7 +24,7 @@
(ID_TITULO_CNT,DESC_TITULO,ID_CONTRATO,ID_LISTA,ID_TITULO, ID_CATEGORIA, ID_RELEASE, ID_PAGO_CATEG, ID_CATEGORIA_TIT, FECHA_INICIO,FECHA_FIN,
BRIEFCASE,DTO,DTR,COSTO,VIDA_UTIL,ID_SAP,ESTATUS,ID_TITULO_CNTNVO,HVRD,ID_TERRITORIO,ID_TITULO_CNTORIG, FECHA_NOTIFSAP,ID_SAP_ANT,ID_TITULO_CNTANT,
NOTA_CREDITO,FACTURA_CREDITO,AJUSTO_TITULO,AJUSTO_VALOR,AJUSTO_VU,BAJA_PERDIDA, FECHA_AJUSTOTITULO,FECHA_AJUSTOVALOR,FECHA_AJUSTOVU,FECHA_BAJA,FECHA_WS,
TIPO_TITULO,PRECIO_ANUAL,NOMBRE_UNICO,EPISODIO,TEMPORADA,ID_BV,MESES_VU,PJE_EXCLUSIVO,MESES_EXCLUSIVO, FLGCALCULO_PRECIO)
TIPO_TITULO,PRECIO_ANUAL,NOMBRE_UNICO,EPISODIO,TEMPORADA,ID_BV,MESES_VU,PJE_EXCLUSIVO,MESES_EXCLUSIVO, FLGCALCULO_PRECIO,SUBNUMERO)
select
ID_TITULO_CNT
......@@ -33,7 +33,7 @@
ID_TITULO_CNTORIG
, FECHA_NOTIFSAP,ID_SAP_ANT,
ID_TITULO_CNTANT,NOTA_CREDITO,FACTURA_CREDITO,AJUSTO_TITULO,AJUSTO_VALOR,AJUSTO_VU,BAJA_PERDIDA, FECHA_AJUSTOTITULO,FECHA_AJUSTOVALOR,FECHA_AJUSTOVU,FECHA_BAJA,FECHA_WS,TIPO_TITULO,PRECIO_ANUAL,NOMBRE_UNICO,EPISODIO,
TEMPORADA,ID_BV,MESES_VU,PJE_EXCLUSIVO,MESES_EXCLUSIVO, FLGCALCULO_PRECIO
TEMPORADA,ID_BV,MESES_VU,PJE_EXCLUSIVO,MESES_EXCLUSIVO, FLGCALCULO_PRECIO,SUBNUMERO
from DDA_T_CONTRATO_TITULO t
......@@ -60,7 +60,7 @@
(ID_TITULO_CNT,DESC_TITULO,ID_CONTRATO,ID_LISTA,ID_TITULO, ID_CATEGORIA, ID_RELEASE, ID_PAGO_CATEG, ID_CATEGORIA_TIT, FECHA_INICIO,FECHA_FIN,
BRIEFCASE,DTO,DTR,COSTO,VIDA_UTIL,ID_SAP,ESTATUS,ID_TITULO_CNTNVO,HVRD,ID_TERRITORIO,ID_TITULO_CNTORIG, FECHA_NOTIFSAP,ID_SAP_ANT,ID_TITULO_CNTANT,
NOTA_CREDITO,FACTURA_CREDITO,AJUSTO_TITULO,AJUSTO_VALOR,AJUSTO_VU,BAJA_PERDIDA, FECHA_AJUSTOTITULO,FECHA_AJUSTOVALOR,FECHA_AJUSTOVU,FECHA_BAJA,FECHA_WS,
TIPO_TITULO,PRECIO_ANUAL,NOMBRE_UNICO,EPISODIO,TEMPORADA,ID_BV,MESES_VU,PJE_EXCLUSIVO,MESES_EXCLUSIVO, FLGCALCULO_PRECIO)
TIPO_TITULO,PRECIO_ANUAL,NOMBRE_UNICO,EPISODIO,TEMPORADA,ID_BV,MESES_VU,PJE_EXCLUSIVO,MESES_EXCLUSIVO, FLGCALCULO_PRECIO, SUBNUMERO)
select
ID_TITULO_CNT
......@@ -69,7 +69,7 @@
ID_TITULO_CNTORIG
, FECHA_NOTIFSAP,ID_SAP_ANT,
ID_TITULO_CNTANT,NOTA_CREDITO,FACTURA_CREDITO,AJUSTO_TITULO,AJUSTO_VALOR,AJUSTO_VU,BAJA_PERDIDA, FECHA_AJUSTOTITULO,FECHA_AJUSTOVALOR,FECHA_AJUSTOVU,FECHA_BAJA,
FECHA_WS,TIPO_TITULO,PRECIO_ANUAL,NOMBRE_UNICO,EPISODIO,TEMPORADA,ID_BV,MESES_VU,PJE_EXCLUSIVO,MESES_EXCLUSIVO, FLGCALCULO_PRECIO
FECHA_WS,TIPO_TITULO,PRECIO_ANUAL,NOMBRE_UNICO,EPISODIO,TEMPORADA,ID_BV,MESES_VU,PJE_EXCLUSIVO,MESES_EXCLUSIVO, FLGCALCULO_PRECIO, SUBNUMERO
from DDA_M_CONTRATO_TITULO t
......
......@@ -108,7 +108,7 @@
(ID_TITULO_CNT,DESC_TITULO,ID_CONTRATO,ID_LISTA,ID_TITULO, ID_CATEGORIA, ID_RELEASE, ID_PAGO_CATEG, ID_CATEGORIA_TIT, FECHA_INICIO,FECHA_FIN,
BRIEFCASE,DTO,DTR,COSTO,VIDA_UTIL,ID_SAP,ESTATUS,ID_TITULO_CNTNVO,HVRD,ID_TERRITORIO,ID_TITULO_CNTORIG, FECHA_NOTIFSAP,ID_SAP_ANT,ID_TITULO_CNTANT,
NOTA_CREDITO,FACTURA_CREDITO,AJUSTO_TITULO,AJUSTO_VALOR,AJUSTO_VU,BAJA_PERDIDA, FECHA_AJUSTOTITULO,FECHA_AJUSTOVALOR,FECHA_AJUSTOVU,FECHA_BAJA,FECHA_WS,
TIPO_TITULO,PRECIO_ANUAL,NOMBRE_UNICO,EPISODIO,TEMPORADA,ID_BV,MESES_VU,PJE_EXCLUSIVO,MESES_EXCLUSIVO, FLGCALCULO_PRECIO, ANIO_CONTRATO, FECHA_CONTABILIZACION)
TIPO_TITULO,PRECIO_ANUAL,NOMBRE_UNICO,EPISODIO,TEMPORADA,ID_BV,MESES_VU,PJE_EXCLUSIVO,MESES_EXCLUSIVO, FLGCALCULO_PRECIO, ANIO_CONTRATO, FECHA_CONTABILIZACION, SUBNUMERO)
select
ID_TITULO_CNT
......@@ -117,7 +117,7 @@
ID_TITULO_CNTORIG
, FECHA_NOTIFSAP,ID_SAP_ANT,
ID_TITULO_CNTANT,NOTA_CREDITO,FACTURA_CREDITO,AJUSTO_TITULO,AJUSTO_VALOR,AJUSTO_VU,BAJA_PERDIDA, FECHA_AJUSTOTITULO,FECHA_AJUSTOVALOR,FECHA_AJUSTOVU,FECHA_BAJA,FECHA_WS,TIPO_TITULO,PRECIO_ANUAL,NOMBRE_UNICO,EPISODIO,
TEMPORADA,ID_BV,MESES_VU,PJE_EXCLUSIVO,MESES_EXCLUSIVO, FLGCALCULO_PRECIO, ANIO_CONTRATO, FECHA_CONTABILIZACION
TEMPORADA,ID_BV,MESES_VU,PJE_EXCLUSIVO,MESES_EXCLUSIVO, FLGCALCULO_PRECIO, ANIO_CONTRATO, FECHA_CONTABILIZACION, SUBNUMERO
from DDA_T_CONTRATO_TITULO t
......@@ -133,7 +133,7 @@
(ID_TITULO_CNT,DESC_TITULO,ID_CONTRATO,ID_LISTA,ID_TITULO, ID_CATEGORIA, ID_RELEASE, ID_PAGO_CATEG, ID_CATEGORIA_TIT, FECHA_INICIO,FECHA_FIN,
BRIEFCASE,DTO,DTR,COSTO,VIDA_UTIL,ID_SAP,ESTATUS,ID_TITULO_CNTNVO,HVRD,ID_TERRITORIO,ID_TITULO_CNTORIG, FECHA_NOTIFSAP,ID_SAP_ANT,ID_TITULO_CNTANT,
NOTA_CREDITO,FACTURA_CREDITO,AJUSTO_TITULO,AJUSTO_VALOR,AJUSTO_VU,BAJA_PERDIDA, FECHA_AJUSTOTITULO,FECHA_AJUSTOVALOR,FECHA_AJUSTOVU,FECHA_BAJA,FECHA_WS,
TIPO_TITULO,PRECIO_ANUAL,NOMBRE_UNICO,EPISODIO,TEMPORADA,ID_BV,MESES_VU,PJE_EXCLUSIVO,MESES_EXCLUSIVO, FLGCALCULO_PRECIO, ANIO_CONTRATO, FECHA_CONTABILIZACION)
TIPO_TITULO,PRECIO_ANUAL,NOMBRE_UNICO,EPISODIO,TEMPORADA,ID_BV,MESES_VU,PJE_EXCLUSIVO,MESES_EXCLUSIVO, FLGCALCULO_PRECIO, ANIO_CONTRATO, FECHA_CONTABILIZACION, SUBNUMERO)
select
ID_TITULO_CNT
......@@ -142,7 +142,7 @@
ID_TITULO_CNTORIG
, FECHA_NOTIFSAP,ID_SAP_ANT,
ID_TITULO_CNTANT,NOTA_CREDITO,FACTURA_CREDITO,AJUSTO_TITULO,AJUSTO_VALOR,AJUSTO_VU,BAJA_PERDIDA, FECHA_AJUSTOTITULO,FECHA_AJUSTOVALOR,FECHA_AJUSTOVU,FECHA_BAJA,
FECHA_WS,TIPO_TITULO,PRECIO_ANUAL,NOMBRE_UNICO,EPISODIO,TEMPORADA,ID_BV,MESES_VU,PJE_EXCLUSIVO,MESES_EXCLUSIVO, FLGCALCULO_PRECIO, ANIO_CONTRATO, FECHA_CONTABILIZACION
FECHA_WS,TIPO_TITULO,PRECIO_ANUAL,NOMBRE_UNICO,EPISODIO,TEMPORADA,ID_BV,MESES_VU,PJE_EXCLUSIVO,MESES_EXCLUSIVO, FLGCALCULO_PRECIO, ANIO_CONTRATO, FECHA_CONTABILIZACION, SUBNUMERO
from DDA_M_CONTRATO_TITULO t
......
Manifest-Version: 1.0
Built-By: jfmj_
Build-Jdk: 17.0.2
Created-By: Maven Integration for Eclipse
#Generated by Maven Integration for Eclipse
#Mon Dec 12 23:09:06 CST 2022
#Wed May 24 17:45:52 CDT 2023
m2e.projectLocation=C\:\\Users\\jfmj_\\Documents\\DDA\\Githg\\dda-front\\persistencia
m2e.projectName=persistencia
groupId=com.mx.dla
......
......@@ -24,7 +24,7 @@
(ID_TITULO_CNT,DESC_TITULO,ID_CONTRATO,ID_LISTA,ID_TITULO, ID_CATEGORIA, ID_RELEASE, ID_PAGO_CATEG, ID_CATEGORIA_TIT, FECHA_INICIO,FECHA_FIN,
BRIEFCASE,DTO,DTR,COSTO,VIDA_UTIL,ID_SAP,ESTATUS,ID_TITULO_CNTNVO,HVRD,ID_TERRITORIO,ID_TITULO_CNTORIG, FECHA_NOTIFSAP,ID_SAP_ANT,ID_TITULO_CNTANT,
NOTA_CREDITO,FACTURA_CREDITO,AJUSTO_TITULO,AJUSTO_VALOR,AJUSTO_VU,BAJA_PERDIDA, FECHA_AJUSTOTITULO,FECHA_AJUSTOVALOR,FECHA_AJUSTOVU,FECHA_BAJA,FECHA_WS,
TIPO_TITULO,PRECIO_ANUAL,NOMBRE_UNICO,EPISODIO,TEMPORADA,ID_BV,MESES_VU,PJE_EXCLUSIVO,MESES_EXCLUSIVO, FLGCALCULO_PRECIO)
TIPO_TITULO,PRECIO_ANUAL,NOMBRE_UNICO,EPISODIO,TEMPORADA,ID_BV,MESES_VU,PJE_EXCLUSIVO,MESES_EXCLUSIVO, FLGCALCULO_PRECIO,SUBNUMERO)
select
ID_TITULO_CNT
......@@ -33,7 +33,7 @@
ID_TITULO_CNTORIG
, FECHA_NOTIFSAP,ID_SAP_ANT,
ID_TITULO_CNTANT,NOTA_CREDITO,FACTURA_CREDITO,AJUSTO_TITULO,AJUSTO_VALOR,AJUSTO_VU,BAJA_PERDIDA, FECHA_AJUSTOTITULO,FECHA_AJUSTOVALOR,FECHA_AJUSTOVU,FECHA_BAJA,FECHA_WS,TIPO_TITULO,PRECIO_ANUAL,NOMBRE_UNICO,EPISODIO,
TEMPORADA,ID_BV,MESES_VU,PJE_EXCLUSIVO,MESES_EXCLUSIVO, FLGCALCULO_PRECIO
TEMPORADA,ID_BV,MESES_VU,PJE_EXCLUSIVO,MESES_EXCLUSIVO, FLGCALCULO_PRECIO,SUBNUMERO
from DDA_T_CONTRATO_TITULO t
......@@ -60,7 +60,7 @@
(ID_TITULO_CNT,DESC_TITULO,ID_CONTRATO,ID_LISTA,ID_TITULO, ID_CATEGORIA, ID_RELEASE, ID_PAGO_CATEG, ID_CATEGORIA_TIT, FECHA_INICIO,FECHA_FIN,
BRIEFCASE,DTO,DTR,COSTO,VIDA_UTIL,ID_SAP,ESTATUS,ID_TITULO_CNTNVO,HVRD,ID_TERRITORIO,ID_TITULO_CNTORIG, FECHA_NOTIFSAP,ID_SAP_ANT,ID_TITULO_CNTANT,
NOTA_CREDITO,FACTURA_CREDITO,AJUSTO_TITULO,AJUSTO_VALOR,AJUSTO_VU,BAJA_PERDIDA, FECHA_AJUSTOTITULO,FECHA_AJUSTOVALOR,FECHA_AJUSTOVU,FECHA_BAJA,FECHA_WS,
TIPO_TITULO,PRECIO_ANUAL,NOMBRE_UNICO,EPISODIO,TEMPORADA,ID_BV,MESES_VU,PJE_EXCLUSIVO,MESES_EXCLUSIVO, FLGCALCULO_PRECIO)
TIPO_TITULO,PRECIO_ANUAL,NOMBRE_UNICO,EPISODIO,TEMPORADA,ID_BV,MESES_VU,PJE_EXCLUSIVO,MESES_EXCLUSIVO, FLGCALCULO_PRECIO, SUBNUMERO)
select
ID_TITULO_CNT
......@@ -69,7 +69,7 @@
ID_TITULO_CNTORIG
, FECHA_NOTIFSAP,ID_SAP_ANT,
ID_TITULO_CNTANT,NOTA_CREDITO,FACTURA_CREDITO,AJUSTO_TITULO,AJUSTO_VALOR,AJUSTO_VU,BAJA_PERDIDA, FECHA_AJUSTOTITULO,FECHA_AJUSTOVALOR,FECHA_AJUSTOVU,FECHA_BAJA,
FECHA_WS,TIPO_TITULO,PRECIO_ANUAL,NOMBRE_UNICO,EPISODIO,TEMPORADA,ID_BV,MESES_VU,PJE_EXCLUSIVO,MESES_EXCLUSIVO, FLGCALCULO_PRECIO
FECHA_WS,TIPO_TITULO,PRECIO_ANUAL,NOMBRE_UNICO,EPISODIO,TEMPORADA,ID_BV,MESES_VU,PJE_EXCLUSIVO,MESES_EXCLUSIVO, FLGCALCULO_PRECIO, SUBNUMERO
from DDA_M_CONTRATO_TITULO t
......
......@@ -108,7 +108,7 @@
(ID_TITULO_CNT,DESC_TITULO,ID_CONTRATO,ID_LISTA,ID_TITULO, ID_CATEGORIA, ID_RELEASE, ID_PAGO_CATEG, ID_CATEGORIA_TIT, FECHA_INICIO,FECHA_FIN,
BRIEFCASE,DTO,DTR,COSTO,VIDA_UTIL,ID_SAP,ESTATUS,ID_TITULO_CNTNVO,HVRD,ID_TERRITORIO,ID_TITULO_CNTORIG, FECHA_NOTIFSAP,ID_SAP_ANT,ID_TITULO_CNTANT,
NOTA_CREDITO,FACTURA_CREDITO,AJUSTO_TITULO,AJUSTO_VALOR,AJUSTO_VU,BAJA_PERDIDA, FECHA_AJUSTOTITULO,FECHA_AJUSTOVALOR,FECHA_AJUSTOVU,FECHA_BAJA,FECHA_WS,
TIPO_TITULO,PRECIO_ANUAL,NOMBRE_UNICO,EPISODIO,TEMPORADA,ID_BV,MESES_VU,PJE_EXCLUSIVO,MESES_EXCLUSIVO, FLGCALCULO_PRECIO, ANIO_CONTRATO, FECHA_CONTABILIZACION)
TIPO_TITULO,PRECIO_ANUAL,NOMBRE_UNICO,EPISODIO,TEMPORADA,ID_BV,MESES_VU,PJE_EXCLUSIVO,MESES_EXCLUSIVO, FLGCALCULO_PRECIO, ANIO_CONTRATO, FECHA_CONTABILIZACION, SUBNUMERO)
select
ID_TITULO_CNT
......@@ -117,7 +117,7 @@
ID_TITULO_CNTORIG
, FECHA_NOTIFSAP,ID_SAP_ANT,
ID_TITULO_CNTANT,NOTA_CREDITO,FACTURA_CREDITO,AJUSTO_TITULO,AJUSTO_VALOR,AJUSTO_VU,BAJA_PERDIDA, FECHA_AJUSTOTITULO,FECHA_AJUSTOVALOR,FECHA_AJUSTOVU,FECHA_BAJA,FECHA_WS,TIPO_TITULO,PRECIO_ANUAL,NOMBRE_UNICO,EPISODIO,
TEMPORADA,ID_BV,MESES_VU,PJE_EXCLUSIVO,MESES_EXCLUSIVO, FLGCALCULO_PRECIO, ANIO_CONTRATO, FECHA_CONTABILIZACION
TEMPORADA,ID_BV,MESES_VU,PJE_EXCLUSIVO,MESES_EXCLUSIVO, FLGCALCULO_PRECIO, ANIO_CONTRATO, FECHA_CONTABILIZACION, SUBNUMERO
from DDA_T_CONTRATO_TITULO t
......@@ -133,7 +133,7 @@
(ID_TITULO_CNT,DESC_TITULO,ID_CONTRATO,ID_LISTA,ID_TITULO, ID_CATEGORIA, ID_RELEASE, ID_PAGO_CATEG, ID_CATEGORIA_TIT, FECHA_INICIO,FECHA_FIN,
BRIEFCASE,DTO,DTR,COSTO,VIDA_UTIL,ID_SAP,ESTATUS,ID_TITULO_CNTNVO,HVRD,ID_TERRITORIO,ID_TITULO_CNTORIG, FECHA_NOTIFSAP,ID_SAP_ANT,ID_TITULO_CNTANT,
NOTA_CREDITO,FACTURA_CREDITO,AJUSTO_TITULO,AJUSTO_VALOR,AJUSTO_VU,BAJA_PERDIDA, FECHA_AJUSTOTITULO,FECHA_AJUSTOVALOR,FECHA_AJUSTOVU,FECHA_BAJA,FECHA_WS,
TIPO_TITULO,PRECIO_ANUAL,NOMBRE_UNICO,EPISODIO,TEMPORADA,ID_BV,MESES_VU,PJE_EXCLUSIVO,MESES_EXCLUSIVO, FLGCALCULO_PRECIO, ANIO_CONTRATO, FECHA_CONTABILIZACION)
TIPO_TITULO,PRECIO_ANUAL,NOMBRE_UNICO,EPISODIO,TEMPORADA,ID_BV,MESES_VU,PJE_EXCLUSIVO,MESES_EXCLUSIVO, FLGCALCULO_PRECIO, ANIO_CONTRATO, FECHA_CONTABILIZACION, SUBNUMERO)
select
ID_TITULO_CNT
......@@ -142,7 +142,7 @@
ID_TITULO_CNTORIG
, FECHA_NOTIFSAP,ID_SAP_ANT,
ID_TITULO_CNTANT,NOTA_CREDITO,FACTURA_CREDITO,AJUSTO_TITULO,AJUSTO_VALOR,AJUSTO_VU,BAJA_PERDIDA, FECHA_AJUSTOTITULO,FECHA_AJUSTOVALOR,FECHA_AJUSTOVU,FECHA_BAJA,
FECHA_WS,TIPO_TITULO,PRECIO_ANUAL,NOMBRE_UNICO,EPISODIO,TEMPORADA,ID_BV,MESES_VU,PJE_EXCLUSIVO,MESES_EXCLUSIVO, FLGCALCULO_PRECIO, ANIO_CONTRATO, FECHA_CONTABILIZACION
FECHA_WS,TIPO_TITULO,PRECIO_ANUAL,NOMBRE_UNICO,EPISODIO,TEMPORADA,ID_BV,MESES_VU,PJE_EXCLUSIVO,MESES_EXCLUSIVO, FLGCALCULO_PRECIO, ANIO_CONTRATO, FECHA_CONTABILIZACION, SUBNUMERO
from DDA_M_CONTRATO_TITULO t
......
......@@ -2,7 +2,7 @@
#Development version
ordenInterna.idPosicion=00010
ordenInterna.idMaterial.suscripcion=300000000
ordenInterna.idMaterial.suscripcion=400000010
ordenInterna.idMaterial.transaccines=300000004
ordenInterna.idMaterial.licenseFee=300000104
......@@ -24,7 +24,7 @@ ordenInterna.claseDoc.t=NT08
ordenInterna.claseDoc.a=CD06
ordenInterna.claseDoc.na=CD06
ordenInterna.idProveedor=0030800000
ordenInterna.idProveedor=3001000056
ordenInterna.orgCompras=AMCO
ordenInterna.grupoCompras=N06
......@@ -76,7 +76,7 @@ uri.rest.reporte.amortizacion.baseActivos = http://${servidor.rest.ws}/DDA_WSB_P
uri.ws.carga.visualizaciones.procesa = http://${servidor.rest.ws}/DDA_WSB_Procesos/services/proceso/procesarCargaTitulosVS
uri.rest.titulosBroadView = http://localhost:5000/v1/broadview/titulos/
uri.rest.titulosBroadView = http://localhost:5001/v1/broadview/titulos/
#*************************Propiedades para Facturacion*******************
#sociedad tambien se usa en Nota Credito
......
DEBUG - [05 dic 2022 14:50:32,290] - [DelegatingSmartContextLoader: 75] - Delegating to GenericXmlContextLoader to process context configuration [ContextConfigurationAttributes@731a74c declaringClass = 'com.mx.dla.dda.common.test.BaseDaoTest', locations = '{classpath:dbms-connect-dao-test-context.xml, classpath:spring-datasource.xml}', classes = '{}', inheritLocations = true, contextLoaderClass = 'org.springframework.test.context.ContextLoader'].
DEBUG - [05 dic 2022 14:50:32,295] - [ ContextLoaderUtils: 236] - Could not find an 'annotation declaring class' for annotation type [interface org.springframework.test.context.ActiveProfiles] and class [class com.mx.dla.dda.admin.presupuesto.PresupuestoTest]
DEBUG - [05 dic 2022 14:50:32,304] - [DelegatingSmartContextLoader: 75] - Delegating to GenericXmlContextLoader to process context configuration [ContextConfigurationAttributes@72b6cbcc declaringClass = 'com.mx.dla.dda.common.test.BaseDaoTest', locations = '{classpath:dbms-connect-dao-test-context.xml, classpath:spring-datasource.xml}', classes = '{}', inheritLocations = true, contextLoaderClass = 'org.springframework.test.context.ContextLoader'].
DEBUG - [05 dic 2022 14:50:32,305] - [ ContextLoaderUtils: 236] - Could not find an 'annotation declaring class' for annotation type [interface org.springframework.test.context.ActiveProfiles] and class [class com.mx.dla.dda.carga.transaccion.test.CargaTransaccionesTest]
DEBUG - [05 dic 2022 14:50:32,306] - [DelegatingSmartContextLoader: 75] - Delegating to GenericXmlContextLoader to process context configuration [ContextConfigurationAttributes@4f063c0a declaringClass = 'com.mx.dla.dda.common.test.BaseDaoTest', locations = '{classpath:dbms-connect-dao-test-context.xml, classpath:spring-datasource.xml}', classes = '{}', inheritLocations = true, contextLoaderClass = 'org.springframework.test.context.ContextLoader'].
DEBUG - [05 dic 2022 14:50:32,306] - [ ContextLoaderUtils: 236] - Could not find an 'annotation declaring class' for annotation type [interface org.springframework.test.context.ActiveProfiles] and class [class com.mx.dla.dda.contrato.amortizacion.AmortizacionTest]
DEBUG - [05 dic 2022 14:50:32,307] - [DelegatingSmartContextLoader: 75] - Delegating to GenericXmlContextLoader to process context configuration [ContextConfigurationAttributes@1e6d1014 declaringClass = 'com.mx.dla.dda.common.test.BaseDaoTest', locations = '{classpath:dbms-connect-dao-test-context.xml, classpath:spring-datasource.xml}', classes = '{}', inheritLocations = true, contextLoaderClass = 'org.springframework.test.context.ContextLoader'].
DEBUG - [05 dic 2022 14:50:32,307] - [ ContextLoaderUtils: 236] - Could not find an 'annotation declaring class' for annotation type [interface org.springframework.test.context.ActiveProfiles] and class [class com.mx.dla.dda.contrato.fees.bos.FeesTest]
DEBUG - [05 dic 2022 14:50:32,308] - [DelegatingSmartContextLoader: 75] - Delegating to GenericXmlContextLoader to process context configuration [ContextConfigurationAttributes@614ddd49 declaringClass = 'com.mx.dla.dda.common.test.BaseDaoTest', locations = '{classpath:dbms-connect-dao-test-context.xml, classpath:spring-datasource.xml}', classes = '{}', inheritLocations = true, contextLoaderClass = 'org.springframework.test.context.ContextLoader'].
DEBUG - [05 dic 2022 14:50:32,308] - [ ContextLoaderUtils: 236] - Could not find an 'annotation declaring class' for annotation type [interface org.springframework.test.context.ActiveProfiles] and class [class com.mx.dla.dda.contrato.generales.OpcionesContratoDAOTest]
DEBUG - [05 dic 2022 14:50:32,309] - [DelegatingSmartContextLoader: 75] - Delegating to GenericXmlContextLoader to process context configuration [ContextConfigurationAttributes@1f554b06 declaringClass = 'com.mx.dla.dda.common.test.BaseDaoTest', locations = '{classpath:dbms-connect-dao-test-context.xml, classpath:spring-datasource.xml}', classes = '{}', inheritLocations = true, contextLoaderClass = 'org.springframework.test.context.ContextLoader'].
DEBUG - [05 dic 2022 14:50:32,310] - [ ContextLoaderUtils: 236] - Could not find an 'annotation declaring class' for annotation type [interface org.springframework.test.context.ActiveProfiles] and class [class com.mx.dla.dda.contrato.generales.PoblarGeneralesDAOTest]
DEBUG - [05 dic 2022 14:50:32,310] - [DelegatingSmartContextLoader: 75] - Delegating to GenericXmlContextLoader to process context configuration [ContextConfigurationAttributes@694e1548 declaringClass = 'com.mx.dla.dda.common.test.BaseDaoTest', locations = '{classpath:dbms-connect-dao-test-context.xml, classpath:spring-datasource.xml}', classes = '{}', inheritLocations = true, contextLoaderClass = 'org.springframework.test.context.ContextLoader'].
DEBUG - [05 dic 2022 14:50:32,310] - [ ContextLoaderUtils: 236] - Could not find an 'annotation declaring class' for annotation type [interface org.springframework.test.context.ActiveProfiles] and class [class com.mx.dla.dda.contrato.terminos.TerminoTest]
DEBUG - [05 dic 2022 14:50:32,311] - [DelegatingSmartContextLoader: 75] - Delegating to GenericXmlContextLoader to process context configuration [ContextConfigurationAttributes@1c3a4799 declaringClass = 'com.mx.dla.dda.common.test.BaseDaoTest', locations = '{classpath:dbms-connect-dao-test-context.xml, classpath:spring-datasource.xml}', classes = '{}', inheritLocations = true, contextLoaderClass = 'org.springframework.test.context.ContextLoader'].
DEBUG - [05 dic 2022 14:50:32,311] - [ ContextLoaderUtils: 236] - Could not find an 'annotation declaring class' for annotation type [interface org.springframework.test.context.ActiveProfiles] and class [class com.mx.dla.dda.contrato.titulos.bos.TituloDAOTest]
DEBUG - [05 dic 2022 14:50:32,312] - [DelegatingSmartContextLoader: 75] - Delegating to GenericXmlContextLoader to process context configuration [ContextConfigurationAttributes@71bbf57e declaringClass = 'com.mx.dla.dda.common.test.BaseDaoTest', locations = '{classpath:dbms-connect-dao-test-context.xml, classpath:spring-datasource.xml}', classes = '{}', inheritLocations = true, contextLoaderClass = 'org.springframework.test.context.ContextLoader'].
DEBUG - [05 dic 2022 14:50:32,312] - [ ContextLoaderUtils: 236] - Could not find an 'annotation declaring class' for annotation type [interface org.springframework.test.context.ActiveProfiles] and class [class com.mx.dla.dda.contrato.titulos.bos.TituloTest]
DEBUG - [05 dic 2022 14:50:32,313] - [DelegatingSmartContextLoader: 75] - Delegating to GenericXmlContextLoader to process context configuration [ContextConfigurationAttributes@7f13d6e declaringClass = 'com.mx.dla.dda.common.test.BaseDaoTest', locations = '{classpath:dbms-connect-dao-test-context.xml, classpath:spring-datasource.xml}', classes = '{}', inheritLocations = true, contextLoaderClass = 'org.springframework.test.context.ContextLoader'].
DEBUG - [05 dic 2022 14:50:32,313] - [ ContextLoaderUtils: 236] - Could not find an 'annotation declaring class' for annotation type [interface org.springframework.test.context.ActiveProfiles] and class [class com.mx.dla.dda.factura.FacturaGeneralTest]
DEBUG - [05 dic 2022 14:50:32,313] - [DelegatingSmartContextLoader: 75] - Delegating to GenericXmlContextLoader to process context configuration [ContextConfigurationAttributes@51cdd8a declaringClass = 'com.mx.dla.dda.common.test.BaseDaoTest', locations = '{classpath:dbms-connect-dao-test-context.xml, classpath:spring-datasource.xml}', classes = '{}', inheritLocations = true, contextLoaderClass = 'org.springframework.test.context.ContextLoader'].
DEBUG - [05 dic 2022 14:50:32,314] - [ ContextLoaderUtils: 236] - Could not find an 'annotation declaring class' for annotation type [interface org.springframework.test.context.ActiveProfiles] and class [class com.mx.dla.dda.ncredito.NotaCreditoTest]
DEBUG - [12 may 2023 12:25:18,440] - [DelegatingSmartContextLoader: 75] - Delegating to GenericXmlContextLoader to process context configuration [ContextConfigurationAttributes@731a74c declaringClass = 'com.mx.dla.dda.common.test.BaseDaoTest', locations = '{classpath:dbms-connect-dao-test-context.xml, classpath:spring-datasource.xml}', classes = '{}', inheritLocations = true, contextLoaderClass = 'org.springframework.test.context.ContextLoader'].
DEBUG - [12 may 2023 12:25:18,445] - [ ContextLoaderUtils: 236] - Could not find an 'annotation declaring class' for annotation type [interface org.springframework.test.context.ActiveProfiles] and class [class com.mx.dla.dda.admin.presupuesto.PresupuestoTest]
DEBUG - [12 may 2023 12:25:18,453] - [DelegatingSmartContextLoader: 75] - Delegating to GenericXmlContextLoader to process context configuration [ContextConfigurationAttributes@72b6cbcc declaringClass = 'com.mx.dla.dda.common.test.BaseDaoTest', locations = '{classpath:dbms-connect-dao-test-context.xml, classpath:spring-datasource.xml}', classes = '{}', inheritLocations = true, contextLoaderClass = 'org.springframework.test.context.ContextLoader'].
DEBUG - [12 may 2023 12:25:18,454] - [ ContextLoaderUtils: 236] - Could not find an 'annotation declaring class' for annotation type [interface org.springframework.test.context.ActiveProfiles] and class [class com.mx.dla.dda.carga.transaccion.test.CargaTransaccionesTest]
DEBUG - [12 may 2023 12:25:18,455] - [DelegatingSmartContextLoader: 75] - Delegating to GenericXmlContextLoader to process context configuration [ContextConfigurationAttributes@4f063c0a declaringClass = 'com.mx.dla.dda.common.test.BaseDaoTest', locations = '{classpath:dbms-connect-dao-test-context.xml, classpath:spring-datasource.xml}', classes = '{}', inheritLocations = true, contextLoaderClass = 'org.springframework.test.context.ContextLoader'].
DEBUG - [12 may 2023 12:25:18,456] - [ ContextLoaderUtils: 236] - Could not find an 'annotation declaring class' for annotation type [interface org.springframework.test.context.ActiveProfiles] and class [class com.mx.dla.dda.contrato.amortizacion.AmortizacionTest]
DEBUG - [12 may 2023 12:25:18,456] - [DelegatingSmartContextLoader: 75] - Delegating to GenericXmlContextLoader to process context configuration [ContextConfigurationAttributes@1e6d1014 declaringClass = 'com.mx.dla.dda.common.test.BaseDaoTest', locations = '{classpath:dbms-connect-dao-test-context.xml, classpath:spring-datasource.xml}', classes = '{}', inheritLocations = true, contextLoaderClass = 'org.springframework.test.context.ContextLoader'].
DEBUG - [12 may 2023 12:25:18,457] - [ ContextLoaderUtils: 236] - Could not find an 'annotation declaring class' for annotation type [interface org.springframework.test.context.ActiveProfiles] and class [class com.mx.dla.dda.contrato.fees.bos.FeesTest]
DEBUG - [12 may 2023 12:25:18,457] - [DelegatingSmartContextLoader: 75] - Delegating to GenericXmlContextLoader to process context configuration [ContextConfigurationAttributes@614ddd49 declaringClass = 'com.mx.dla.dda.common.test.BaseDaoTest', locations = '{classpath:dbms-connect-dao-test-context.xml, classpath:spring-datasource.xml}', classes = '{}', inheritLocations = true, contextLoaderClass = 'org.springframework.test.context.ContextLoader'].
DEBUG - [12 may 2023 12:25:18,458] - [ ContextLoaderUtils: 236] - Could not find an 'annotation declaring class' for annotation type [interface org.springframework.test.context.ActiveProfiles] and class [class com.mx.dla.dda.contrato.generales.OpcionesContratoDAOTest]
DEBUG - [12 may 2023 12:25:18,458] - [DelegatingSmartContextLoader: 75] - Delegating to GenericXmlContextLoader to process context configuration [ContextConfigurationAttributes@1f554b06 declaringClass = 'com.mx.dla.dda.common.test.BaseDaoTest', locations = '{classpath:dbms-connect-dao-test-context.xml, classpath:spring-datasource.xml}', classes = '{}', inheritLocations = true, contextLoaderClass = 'org.springframework.test.context.ContextLoader'].
DEBUG - [12 may 2023 12:25:18,459] - [ ContextLoaderUtils: 236] - Could not find an 'annotation declaring class' for annotation type [interface org.springframework.test.context.ActiveProfiles] and class [class com.mx.dla.dda.contrato.generales.PoblarGeneralesDAOTest]
DEBUG - [12 may 2023 12:25:18,459] - [DelegatingSmartContextLoader: 75] - Delegating to GenericXmlContextLoader to process context configuration [ContextConfigurationAttributes@694e1548 declaringClass = 'com.mx.dla.dda.common.test.BaseDaoTest', locations = '{classpath:dbms-connect-dao-test-context.xml, classpath:spring-datasource.xml}', classes = '{}', inheritLocations = true, contextLoaderClass = 'org.springframework.test.context.ContextLoader'].
DEBUG - [12 may 2023 12:25:18,460] - [ ContextLoaderUtils: 236] - Could not find an 'annotation declaring class' for annotation type [interface org.springframework.test.context.ActiveProfiles] and class [class com.mx.dla.dda.contrato.terminos.TerminoTest]
DEBUG - [12 may 2023 12:25:18,460] - [DelegatingSmartContextLoader: 75] - Delegating to GenericXmlContextLoader to process context configuration [ContextConfigurationAttributes@1c3a4799 declaringClass = 'com.mx.dla.dda.common.test.BaseDaoTest', locations = '{classpath:dbms-connect-dao-test-context.xml, classpath:spring-datasource.xml}', classes = '{}', inheritLocations = true, contextLoaderClass = 'org.springframework.test.context.ContextLoader'].
DEBUG - [12 may 2023 12:25:18,460] - [ ContextLoaderUtils: 236] - Could not find an 'annotation declaring class' for annotation type [interface org.springframework.test.context.ActiveProfiles] and class [class com.mx.dla.dda.contrato.titulos.bos.TituloDAOTest]
DEBUG - [12 may 2023 12:25:18,461] - [DelegatingSmartContextLoader: 75] - Delegating to GenericXmlContextLoader to process context configuration [ContextConfigurationAttributes@71bbf57e declaringClass = 'com.mx.dla.dda.common.test.BaseDaoTest', locations = '{classpath:dbms-connect-dao-test-context.xml, classpath:spring-datasource.xml}', classes = '{}', inheritLocations = true, contextLoaderClass = 'org.springframework.test.context.ContextLoader'].
DEBUG - [12 may 2023 12:25:18,462] - [ ContextLoaderUtils: 236] - Could not find an 'annotation declaring class' for annotation type [interface org.springframework.test.context.ActiveProfiles] and class [class com.mx.dla.dda.contrato.titulos.bos.TituloTest]
DEBUG - [12 may 2023 12:25:18,462] - [DelegatingSmartContextLoader: 75] - Delegating to GenericXmlContextLoader to process context configuration [ContextConfigurationAttributes@7f13d6e declaringClass = 'com.mx.dla.dda.common.test.BaseDaoTest', locations = '{classpath:dbms-connect-dao-test-context.xml, classpath:spring-datasource.xml}', classes = '{}', inheritLocations = true, contextLoaderClass = 'org.springframework.test.context.ContextLoader'].
DEBUG - [12 may 2023 12:25:18,462] - [ ContextLoaderUtils: 236] - Could not find an 'annotation declaring class' for annotation type [interface org.springframework.test.context.ActiveProfiles] and class [class com.mx.dla.dda.factura.FacturaGeneralTest]
DEBUG - [12 may 2023 12:25:18,463] - [DelegatingSmartContextLoader: 75] - Delegating to GenericXmlContextLoader to process context configuration [ContextConfigurationAttributes@51cdd8a declaringClass = 'com.mx.dla.dda.common.test.BaseDaoTest', locations = '{classpath:dbms-connect-dao-test-context.xml, classpath:spring-datasource.xml}', classes = '{}', inheritLocations = true, contextLoaderClass = 'org.springframework.test.context.ContextLoader'].
DEBUG - [12 may 2023 12:25:18,463] - [ ContextLoaderUtils: 236] - Could not find an 'annotation declaring class' for annotation type [interface org.springframework.test.context.ActiveProfiles] and class [class com.mx.dla.dda.ncredito.NotaCreditoTest]
#Generated by Maven
#Mon Dec 05 14:50:32 CST 2022
#Fri May 12 12:25:18 CDT 2023
version=1.1
groupId=com.mx.dla
artifactId=persistencia
......@@ -57,9 +57,9 @@ function toggleAllBoxes() {
<tr>
<td>Tests passed/Failed/Skipped:</td><td>0/0/0</td>
</tr><tr>
<td>Started on:</td><td>Mon Dec 05 14:50:32 CST 2022</td>
<td>Started on:</td><td>Fri May 12 12:25:18 CDT 2023</td>
</tr>
<tr><td>Total time:</td><td>0 seconds (2 ms)</td>
<tr><td>Total time:</td><td>0 seconds (1 ms)</td>
</tr><tr>
<td>Included groups:</td><td></td>
</tr><tr>
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated by org.testng.reporters.JUnitXMLReporter -->
<testsuite hostname="LAPTOP-HHND8GT5" tests="0" failures="0" timestamp="5 Dec 2022 20:50:32 GMT" time="0.002" errors="0">
<testsuite hostname="LAPTOP-HHND8GT5" tests="0" failures="0" timestamp="12 May 2023 17:25:18 GMT" time="0.001" errors="0">
</testsuite>
......@@ -27,22 +27,22 @@
<property name="java.vm.specification.vendor" value="Oracle Corporation"/>
<property name="user.variant" value=""/>
<property name="os.name" value="Windows 10"/>
<property name="classworlds.conf" value="D:\apache-maven-3.8.4\bin\m2.conf"/>
<property name="classworlds.conf" value="D:\apache-maven-3.8.7\bin\m2.conf"/>
<property name="sun.jnu.encoding" value="Cp1252"/>
<property name="java.library.path" value="C:\Program Files\Java\jdk1.8.0_202\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\Program Files\Microsoft\jdk-11.0.12.7-hotspot\bin;C:\Program Files\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Git\cmd;D:\apache-maven-3.8.4\bin;C:\Program Files\Java\jdk1.8.0_202;D:\sonar-scanner-4.6.2.2472-windows\bin;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files\dotnet\;C:\Program Files (x86)\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\Microsoft SQL Server\150\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\150\DTS\Binn\;C:\Program Files\Azure Data Studio\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Users\jfmj_\AppData\Local\Microsoft\WindowsApps;;C:\Users\jfmj_\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\jfmj_\.dotnet\tools;C:\Program Files\Azure Data Studio\bin;."/>
<property name="maven.conf" value="D:\apache-maven-3.8.4/conf"/>
<property name="java.library.path" value="C:\Program Files\Java\jdk1.8.0_202\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\Program Files\Microsoft\jdk-11.0.12.7-hotspot\bin;C:\Program Files\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Git\cmd;D:\apache-maven-3.8.7\bin;C:\Program Files\Java\jdk1.8.0_202;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files\dotnet\;C:\Program Files (x86)\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\Microsoft SQL Server\150\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\150\DTS\Binn\;C:\Program Files\Azure Data Studio\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Users\jfmj_\AppData\Local\Microsoft\WindowsApps;;C:\Users\jfmj_\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\jfmj_\.dotnet\tools;C:\Program Files\Azure Data Studio\bin;."/>
<property name="maven.conf" value="D:\apache-maven-3.8.7/conf"/>
<property name="java.specification.name" value="Java Platform API Specification"/>
<property name="java.class.version" value="52.0"/>
<property name="sun.management.compiler" value="HotSpot 64-Bit Tiered Compilers"/>
<property name="os.version" value="10.0"/>
<property name="library.jansi.path" value="D:\apache-maven-3.8.4\lib\jansi-native"/>
<property name="library.jansi.path" value="D:\apache-maven-3.8.7\lib\jansi-native"/>
<property name="user.home" value="C:\Users\jfmj_"/>
<property name="user.timezone" value="America/Mexico_City"/>
<property name="java.awt.printerjob" value="sun.awt.windows.WPrinterJob"/>
<property name="java.specification.version" value="1.8"/>
<property name="file.encoding" value="Cp1252"/>
<property name="user.name" value="jfmj_"/>
<property name="java.class.path" value="D:\apache-maven-3.8.4\boot\plexus-classworlds-2.6.0.jar"/>
<property name="java.class.path" value="D:\apache-maven-3.8.7\boot\plexus-classworlds-2.6.0.jar"/>
<property name="java.vm.specification.version" value="1.8"/>
<property name="sun.arch.data.model" value="64"/>
<property name="java.home" value="C:\Program Files\Java\jdk1.8.0_202\jre"/>
......@@ -56,7 +56,7 @@
<property name="sun.boot.class.path" value="C:\Program Files\Java\jdk1.8.0_202\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_202\jre\lib\rt.jar;C:\Program Files\Java\jdk1.8.0_202\jre\lib\sunrsasign.jar;C:\Program Files\Java\jdk1.8.0_202\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_202\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_202\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_202\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_202\jre\classes"/>
<property name="sun.stderr.encoding" value="cp850"/>
<property name="java.vendor" value="Oracle Corporation"/>
<property name="maven.home" value="D:\apache-maven-3.8.4"/>
<property name="maven.home" value="D:\apache-maven-3.8.7"/>
<property name="file.separator" value="\"/>
<property name="java.vendor.url.bug" value="http://bugreport.sun.com/bugreport/"/>
<property name="sun.cpu.endian" value="little"/>
......
-------------------------------------------------------------------------------
Test set: TestSuite
-------------------------------------------------------------------------------
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.528 sec
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.501 sec
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>TestNG Report</title><style type="text/css">table {margin-bottom:10px;border-collapse:collapse;empty-cells:show}th,td {border:1px solid #009;padding:.25em .5em}th {vertical-align:bottom}td {vertical-align:top}table a {font-weight:bold}.stripe td {background-color: #E6EBF9}.num {text-align:right}.passedodd td {background-color: #3F3}.passedeven td {background-color: #0A0}.skippedodd td {background-color: #DDD}.skippedeven td {background-color: #CCC}.failedodd td,.attn {background-color: #F33}.failedeven td,.stripe .attn {background-color: #D00}.stacktrace {white-space:pre;font-family:monospace}.totop {font-size:85%;text-align:center;border-bottom:2px solid #000}</style></head><body><table><tr><th>Test</th><th># Passed</th><th># Skipped</th><th># Failed</th><th>Time (ms)</th><th>Included Groups</th><th>Excluded Groups</th></tr><tr><th colspan="7">Command line suite</th></tr><tr><td><a href="#t0">Command line test</a></td><td class="num">0</td><td class="num">0</td><td class="num">0</td><td class="num">2</td><td></td><td></td></tr></table><table><thead><tr><th>Class</th><th>Method</th><th>Start</th><th>Time (ms)</th></tr></thead><tbody><tr><th colspan="4">Command line suite</th></tr></tbody><tbody id="t0"></tbody></table><h2>Command line test</h2></body></html>
\ No newline at end of file
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>TestNG Report</title><style type="text/css">table {margin-bottom:10px;border-collapse:collapse;empty-cells:show}th,td {border:1px solid #009;padding:.25em .5em}th {vertical-align:bottom}td {vertical-align:top}table a {font-weight:bold}.stripe td {background-color: #E6EBF9}.num {text-align:right}.passedodd td {background-color: #3F3}.passedeven td {background-color: #0A0}.skippedodd td {background-color: #DDD}.skippedeven td {background-color: #CCC}.failedodd td,.attn {background-color: #F33}.failedeven td,.stripe .attn {background-color: #D00}.stacktrace {white-space:pre;font-family:monospace}.totop {font-size:85%;text-align:center;border-bottom:2px solid #000}</style></head><body><table><tr><th>Test</th><th># Passed</th><th># Skipped</th><th># Failed</th><th>Time (ms)</th><th>Included Groups</th><th>Excluded Groups</th></tr><tr><th colspan="7">Command line suite</th></tr><tr><td><a href="#t0">Command line test</a></td><td class="num">0</td><td class="num">0</td><td class="num">0</td><td class="num">1</td><td></td><td></td></tr></table><table><thead><tr><th>Class</th><th>Method</th><th>Start</th><th>Time (ms)</th></tr></thead><tbody><tr><th colspan="4">Command line suite</th></tr></tbody><tbody id="t0"></tbody></table><h2>Command line test</h2></body></html>
\ No newline at end of file
......@@ -2,10 +2,10 @@
<testng-results skipped="0" failed="0" total="0" passed="0">
<reporter-output>
</reporter-output>
<suite name="Command line suite" duration-ms="2" started-at="2022-12-05T20:50:32Z" finished-at="2022-12-05T20:50:32Z">
<suite name="Command line suite" duration-ms="1" started-at="2023-05-12T17:25:18Z" finished-at="2023-05-12T17:25:18Z">
<groups>
</groups>
<test name="Command line test" duration-ms="2" started-at="2022-12-05T20:50:32Z" finished-at="2022-12-05T20:50:32Z">
<test name="Command line test" duration-ms="1" started-at="2023-05-12T17:25:18Z" finished-at="2023-05-12T17:25:18Z">
</test> <!-- Command line test -->
</suite> <!-- Command line suite -->
</testng-results>
......@@ -2,7 +2,7 @@
#Development version
ordenInterna.idPosicion=00010
ordenInterna.idMaterial.suscripcion=300000000
ordenInterna.idMaterial.suscripcion=400000010
ordenInterna.idMaterial.transaccines=300000004
ordenInterna.idMaterial.licenseFee=300000104
......@@ -24,7 +24,7 @@ ordenInterna.claseDoc.t=NT08
ordenInterna.claseDoc.a=CD06
ordenInterna.claseDoc.na=CD06
ordenInterna.idProveedor=0030800000
ordenInterna.idProveedor=3001000056
ordenInterna.orgCompras=AMCO
ordenInterna.grupoCompras=N06
......@@ -76,7 +76,7 @@ uri.rest.reporte.amortizacion.baseActivos = http://${servidor.rest.ws}/DDA_WSB_P
uri.ws.carga.visualizaciones.procesa = http://${servidor.rest.ws}/DDA_WSB_Procesos/services/proceso/procesarCargaTitulosVS
uri.rest.titulosBroadView = http://localhost:5000/v1/broadview/titulos/
uri.rest.titulosBroadView = http://localhost:5001/v1/broadview/titulos/
#*************************Propiedades para Facturacion*******************
#sociedad tambien se usa en Nota Credito
......
......@@ -336,7 +336,7 @@ public class TipoCambioAddOnsBO extends BaseBO {
if(mesesTipos != null) {
for(MesTiposAddOnsCTDTO mt : mesesTipos) {
logger.info("mes : [{}]", mt.getNombre());
if(mt.getTipos() != null) {
for(TipoCambioAddOnsDTO tcp : mt.getTipos()){
if(tcp.getRecuperado()){
tipoCambioAddOnsDAO.actualizaTipoCambio(tcp);
......@@ -346,6 +346,7 @@ public class TipoCambioAddOnsBO extends BaseBO {
}
}
}
}
respuesta = true;
}
......@@ -422,7 +423,7 @@ public class TipoCambioAddOnsBO extends BaseBO {
tipoCambio.setNombre(pais.getNombre());
if(row != null){
if(row != null && idRelacion != null){
for(int i = 1; i <= 12; i++){
if(row.getCell(i).toString() != null && !(row.getCell(i).toString()).trim().equals("")){
calendar.set(Calendar.YEAR, Integer.valueOf(String.valueOf(anio)));
......@@ -479,7 +480,7 @@ public class TipoCambioAddOnsBO extends BaseBO {
pais = tipoCambioAddOnsDAO.obtenerPaisXSigla(sigla);
idRelacion = catalogoAddOnsDAO.obtenerIdRelacion(idEstudio, pais.getIdPaisAddOn());
if(row != null){
if(row != null && idRelacion != null){
for(int i = 1; i <= 12; i++){
Double datoNum = null;
......
......@@ -510,7 +510,8 @@ public class ReporteDatosContratosBO extends BaseBO {
ExcelRule rule = new ExcelRule();
List<String> headers = new ArrayList<String>();
rule.setColumn(getExcelColumnName(i + 1));
System.out.println("Dato: " + tabla[0][i]);
if(tabla[0][i] != null) {
headers.add(rheader[i]);
rule.setHeaders(headers);
......@@ -521,6 +522,7 @@ public class ReporteDatosContratosBO extends BaseBO {
rules.add(rule);
}
}
mapper.setRules(rules);
......
......@@ -12,6 +12,9 @@ import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.mx.dla.dda.catalogos.daos.CatalogosDAO;
import com.mx.dla.dda.contrato.generales.daos.GeneralesDAO;
import com.mx.dla.dda.contrato.generales.dtos.ContratoDTO;
import com.mx.dla.dda.excelMapper.bos.ExcelMapperTransform;
import com.mx.dla.dda.excelMapper.context.ExcelMapperContext;
import com.mx.dla.dda.excelMapper.dtos.ExcelMapper;
......@@ -42,6 +45,9 @@ public class ReporteContingenciaBO extends BaseBO{
@Autowired
protected ExcelMapperTransform excelMapperTransform;
@Autowired
private GeneralesDAO generalesDAO;
public void obtenInfoReporte() {
try{
List<ReportePagoBaseDTO> infos = reportePagoDAO.obtenerReportePagoTitulos(24L, new Date(), new Date());
......@@ -316,7 +322,12 @@ public class ReporteContingenciaBO extends BaseBO{
try {
logger.debug("antes de reporte");
//reporte = reportePagoAlterno.obtenerReporteRowsC( idContrato, idEstudio);
ContratoDTO contrato = generalesDAO.obtenerContrato(Long.parseLong(idContrato));
if(contrato.getNumeroContrato().endsWith("E") || contrato.getNumeroContrato().endsWith("C")) {
reporte = reportePagoAlterno.obtenerReporteRowsEnmienda(idContrato);
} else {
reporte = reportePagoAlterno.obtenerReporteRowsC( idContrato, idEstudio);
}
logger.debug("Regresando reporte");
}catch(Exception ex){
logger.error("[{}]", ex);
......
......@@ -13,6 +13,7 @@ import java.util.Map;
import javax.sql.DataSource;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.RowMapper;
......@@ -20,6 +21,7 @@ import com.mx.dla.dda.reporte.pago.daos.ReportePagoAlternoDAO;
import com.mx.dla.dda.reporte.pago.dtos.DetalleContratoDTO;
import com.mx.dla.dda.reporte.pago.dtos.ReporteAddOnRowDTO;
import com.mx.dla.dda.reporte.pago.dtos.ReporteCRowDTO;
import com.mx.dla.dda.reporte.pago.dtos.ReporteInterfazContingenciaDTO;
import com.mx.dla.dda.reporte.pago.dtos.ReporteRowDTO;
import com.mx.dla.global.bos.BaseBO;
......@@ -175,6 +177,56 @@ public class ReportePagoAlternoImpl extends BaseBO implements ReportePagoAlterno
return listaMapas;
}
@Override
public List<ReporteInterfazContingenciaDTO> obtenerReporteRowsC(String idContrato, Long idEstudio) {
JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
StringBuilder query = new StringBuilder();
query.append("select dtct.DESC_TITULO AS titulo, dtct.id_bv AS idBroadview, dtct.fecha_inicio AS fechaInicio,dtct.fecha_fin AS fechaFin, ");
query.append("SUBSTR(dtct.VIDA_UTIL ,0,2) anio, SUBSTR(dtct.VIDA_UTIL ,3) meses, dtct.costo, dtc.ID_CONTRATO AS idContrato ");
query.append("FROM DDA_T_CONTRATO_TITULO dtct ");
query.append("INNER JOIN DDA_T_CONTRATO dtc ON dtct.ID_CONTRATO = dtc.ID_CONTRATO ");
query.append("where dtc.ID_ESTATUS = 5 ");
query.append("and to_date(dtct.FECHA_INICIO,'dd/mm/yyyy') <= to_date(SYSDATE,'dd/mm/yyyy') ");
query.append("and dtct.ID_SAP is null or dtct.FECHA_NOTIFSAP is NULL ");
if(idEstudio>0) {
query.append("AND dtc.id_estudio = ");
query.append(idEstudio);
}
if(!idContrato.isEmpty()&&idContrato.length()>0) {
query.append(" AND dtc.ID_CONTRATO = ");
query.append(idContrato);
}
query.append(" order by dtct.FECHA_INICIO desc");
System.out.println(query.toString());
List<ReporteInterfazContingenciaDTO> listaReporteRows = jdbcTemplate.query(query.toString(),
new BeanPropertyRowMapper<ReporteInterfazContingenciaDTO>(ReporteInterfazContingenciaDTO.class));
return listaReporteRows;
}
@Override
public List<ReporteInterfazContingenciaDTO> obtenerReporteRowsEnmienda(String idContrato) {
JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
StringBuilder query = new StringBuilder();
query.append("SELECT DESC_TITULO AS titulo, ID_BV AS idBroadview, a.FECHA_INICIO AS fechaInicio, a.FECHA_FIN AS fechaFin, COSTO, ");
query.append(" SUBSTR(VIDA_UTIL ,0,2) AS anio, SUBSTR(VIDA_UTIL ,3) AS meses, b.ID_CONTRATO AS idContrato FROM DDA_T_CONTRATO_TITULO a ");
query.append(" JOIN DDA_T_CRN_CLIENTESAP b ON a.ID_TITULO_CNT = b.ID_TITULO_CNT WHERE a.ID_CONTRATO = ");
query.append(idContrato);
query.append(" AND to_date(a.FECHA_CONTABILIZACION,'dd/mm/yyyy') <= to_date(sysdate,'dd/mm/yyyy') ");
query.append(" and FECHA_ENVIO_OK is NULL ");
query.append(" order by a.FECHA_INICIO DESC ");
System.out.println(query.toString());
List<ReporteInterfazContingenciaDTO> listaReporteRows = jdbcTemplate.query(query.toString(),
new BeanPropertyRowMapper<ReporteInterfazContingenciaDTO>(ReporteInterfazContingenciaDTO.class));
return listaReporteRows;
}
@Override
public List<ReporteCRowDTO> obtenerReporteRowsS(Date fechaInicio) {
JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
......
#Generated by Maven Integration for Eclipse
#Mon Dec 12 23:09:09 CST 2022
#Tue May 30 21:43:02 CDT 2023
m2e.projectLocation=C\:\\Users\\jfmj_\\Documents\\DDA\\Githg\\dda-front\\servicios
m2e.projectName=servicios
groupId=com.mx.dla
......
package com.mx.dla.dda.contrato.generales.bos;
import java.text.DecimalFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import com.dla.dda.domain.constants.Operacion;
import com.dla.dda.domain.constants.OrigenCodes;
import com.dla.dda.domain.model.email.DetalleCorreoVO;
import com.dla.dda.domain.model.request.EmailRequest;
import com.dla.dda.domain.model.response.EmailResponse;
import com.mx.dla.admin.dtos.UsuarioDTO;
import com.mx.dla.dda.contrato.common.bos.CommonRestBO;
import com.mx.dla.dda.contrato.common.bos.DocumentoBO;
import com.mx.dla.dda.contrato.common.bos.JustificacionBO;
import com.mx.dla.dda.contrato.common.dtos.DocumentoDTO;
import com.mx.dla.dda.contrato.generales.daos.ValidacionGeneralesDAO;
import com.mx.dla.dda.contrato.generales.dtos.AreaDTO;
import com.mx.dla.dda.contrato.generales.dtos.AutorizadorDTO;
import com.mx.dla.dda.contrato.generales.dtos.BundleReturn;
import com.mx.dla.dda.contrato.generales.dtos.ContratoDTO;
import com.mx.dla.dda.contrato.generales.dtos.CorreoExternoDTO;
import com.mx.dla.dda.contrato.generales.dtos.DetalleCorreoDTO;
import com.mx.dla.dda.contrato.generales.dtos.WFPasoDTO;
import com.mx.dla.dda.contrato.generales.dtos.WFSeguimientoDTO;
import com.mx.dla.dda.contrato.generales.enums.Estatus;
import com.mx.dla.dda.contrato.generales.enums.MensajeTexto;
import com.mx.dla.dda.contrato.generales.enums.TipoMensaje;
import com.mx.dla.dda.contrato.transaccion.titulos.daos.TituloLoteTransDAO;
import com.mx.dla.dda.contrato.ws.amortizacioncontrato.ContratoTituloDTO;
import com.mx.dla.dda.contrato.ws.amortizacioncontrato.ParamCalcAmortCntDTO;
import com.mx.dla.dda.contrato.ws.amortizacioncontrato.ResponseCalcAmortCntDTO;
import com.mx.dla.dda.contrato.ws.dtos.ItemOrdenCompraDTO;
import com.mx.dla.dda.contrato.ws.dtos.ParamAdendumEnmiendaDTO;
import com.mx.dla.dda.contrato.ws.dtos.ParamOrdenCompraDTO;
import com.mx.dla.dda.contrato.ws.dtos.ResponseAdendumEnmiendaDTO;
import com.mx.dla.dda.contrato.ws.dtos.ResponseOrdenCompraDTO;
import com.mx.dla.dda.contrato.ws.validapresupuesto.ParamValidaPresupuestoCntDTO;
import com.mx.dla.dda.contrato.ws.validapresupuesto.ResponseValidaPresupuestoCntDTO;
import com.mx.dla.dda.contrato.ws.validarMinimoSeleccion.ParamValidaMinimoSeleccionDTO;
import com.mx.dla.dda.contrato.ws.validarMinimoSeleccion.ResponseValidaMinimoSeleccionDTO;
import com.mx.dla.dda.rest.services.client.JsonConverter;
import com.mx.dla.dda.restClient.bos.DLARestClient;
import com.mx.dla.dda.restClient.bos.DLARestClientFactory;
import com.mx.dla.dda.restClient.constants.DLARestServices;
import com.mx.dla.global.bos.BaseBO;
@Component
public class ValidacionGeneralesBO extends BaseBO{
@Autowired
private ValidacionGeneralesDAO validacionGeneralesDAO;
@Autowired
private DLARestClientFactory dlaRestClientFactory;
@Autowired
private OpcionesContratoBO opcionesContratoBO;
@Autowired
private ParametersWebService parametersWebService;
@Autowired
private CommonRestBO commonRestBO;
@Autowired
private JustificacionBO justificacionBO;
@Autowired
private GeneralesBO generalesBO;
@Autowired
private DocumentoBO documentoBO;
@Autowired
private TituloLoteTransDAO tituloLoteDAO;
@Value("${ordenInterna.idPosicion}")
private String idPosicionOrdInt;
/*
public BundleReturn notificacionSAP(ContratoDTO contrato, String expedienteUsuario){
BundleReturn respuesta = new BundleReturn();
respuesta.setNumero(TipoMensaje.ERROR.getValor());
respuesta.setEstado(false);
boolean desicion = false;
ResponseOrdenCompraDTO responseDTO = null;
ResponseAdendumEnmiendaDTO responseAdendumDTO = null;
//ContratoDTO contrato = generalesBO.obtenContrato(idContrato);
if(contrato.getAmortizable().equals("SI")) { //Amortizable
if(contrato.getIdTipoMovimiento() == 1) {//Nuevo
try {
logger.info("antes de llamarCrearOrdenCompra.");
responseDTO = llamaCrearOrdenCompra(contrato, expedienteUsuario);
logger.info("despues de llamarCrearOrdenCompra.");
desicion = responseDTO.getResultado();
respuesta.setCadena(responseDTO.getMensaje());//informacion = responseDTO.getMensaje();
}catch (Exception ex){
logger.debug(ex.toString());
respuesta.setCadena(MensajeTexto.TIEMPO_AGOTADO.getTexto()); //informacion = "Timepo agotado";
}
if(desicion){
opcionesContratoBO.actulizaEstatus(Estatus.Vigente.getValor(), contrato.getIdContrato(), expedienteUsuario);
respuesta.setCadena(MensajeTexto.LLAMADA_EXITOSA.getTexto()); //noMensaje = NumeroMensaje.OKLLAMADA.getValue() ;
respuesta.setEstado(true);
respuesta.setNumero(TipoMensaje.EXITO.getValor());
opcionesContratoBO.llamarAjustaAddendum(contrato.getIdContrato());
opcionesContratoBO.llamarReportePagos(contrato.getIdContrato());
logger.info("antes de llamarAmortizacionInicial Original.");
opcionesContratoBO.llamarAmortizacionInicial(contrato.getIdContrato());
logger.info("despues de llamarAmortizacionInicial Original.");
//logger.debug(" value: " + NumeroMensaje.OKLLAMADA.getValue());
}else{
respuesta.setCadena(MensajeTexto.LLAMADA_NO_EXITOSA.getTexto());//noMensaje = NumeroMensaje.NOOKLLAMADA.getValue() ;
//logger.debug(" value: " + NumeroMensaje.NOOKLLAMADA.getValue());
}
logger.debug("Se termino de llamar a creaOrdenCompra(SUSCRIPCIN)");
}else {//Adendum o Enmienda
try {
responseAdendumDTO = llamaCrearAdendumEnmienda(contrato, expedienteUsuario);
desicion = responseAdendumDTO.getResultado();
respuesta.setCadena(responseAdendumDTO.getMensaje());//;informacion = responseAdendumDTO.getMensaje();
}catch(Exception ex) {
logger.debug(ex.toString());
respuesta.setCadena(MensajeTexto.TIEMPO_AGOTADO.getTexto()); //informacion = "Tiempo agotado";
}
if(desicion){
opcionesContratoBO.actulizaEstatus(Estatus.Vigente.getValor(), contrato.getIdContrato(), expedienteUsuario);
respuesta.setCadena(MensajeTexto.LLAMADA_EXITOSA.getTexto()); //noMensaje = NumeroMensaje.OKLLAMADA.getValue() ;
respuesta.setEstado(true);
respuesta.setNumero(TipoMensaje.EXITO.getValor());
opcionesContratoBO.llamarAjustaAddendum(contrato.getIdContrato());
opcionesContratoBO.llamarReportePagos(contrato.getIdContrato());
logger.info("antes de llamarAmortizacionInicial Enmienda.");
opcionesContratoBO.llamarAmortizacionInicial(contrato.getIdContrato());
logger.info("despues de llamarAmortizacionInicial Enmienda.");
//logger.debug(" value: " + NumeroMensaje.OKLLAMADA.getValue());
}else{
respuesta.setCadena(MensajeTexto.LLAMADA_NO_EXITOSA.getTexto());//noMensaje = NumeroMensaje.NOOKLLAMADA.getValue();
//logger.debug(" value: " + NumeroMensaje.NOOKLLAMADA.getValue());
}
logger.debug("Se termino de llamar a crearAdendunEnmienda (SUSCRIPCIN)");
}
}else {// No Amortizable
if(contrato.getIdTipoMovimiento() == 1) {//Nuevo
try {
responseDTO = llamaRegistrarSAPNoAmortizable(contrato, expedienteUsuario);//llamar a registroSAPNoAmortizable
desicion = responseDTO.getResultado();
respuesta.setCadena(responseDTO.getMensaje()); //informacion = responseDTO.getMensaje();
}catch (Exception ex){
logger.debug(ex.toString());
respuesta.setCadena(MensajeTexto.TIEMPO_AGOTADO.getTexto());
}
if(desicion){
opcionesContratoBO.actulizaEstatus(Estatus.Vigente.getValor(), contrato.getIdContrato(), expedienteUsuario);
respuesta.setCadena(MensajeTexto.LLAMADA_EXITOSA.getTexto()); //noMensaje = NumeroMensaje.OKLLAMADA.getValue() ;
respuesta.setEstado(true);
respuesta.setNumero(TipoMensaje.EXITO.getValor());
opcionesContratoBO.llamarAjustaAddendum(contrato.getIdContrato());
opcionesContratoBO.llamarReportePagos(contrato.getIdContrato());
//logger.debug(" value: " + NumeroMensaje.OKLLAMADA.getValue());
}else{
respuesta.setCadena(MensajeTexto.LLAMADA_NO_EXITOSA.getTexto());//noMensaje = NumeroMensaje.NOOKLLAMADA.getValue();
//logger.debug(" value: " + NumeroMensaje.NOOKLLAMADA.getValue());
}
logger.debug("Se termino de llamar a registroSAPNoAmortizable (TRANSACCIONAL - LINCESE FEE)");
}else {//Adendum o Enmienda
try {
responseAdendumDTO = llamaAdendumEnmiendaNoAmortizable(contrato, expedienteUsuario); //llamar a registroAdendumEnmiendaNoAmortizable
desicion = responseAdendumDTO.getResultado();
respuesta.setCadena(responseAdendumDTO.getMensaje()); //informacion = responseAdendumDTO.getMensaje();
}catch(Exception ex) {
logger.debug(ex.toString());
respuesta.setCadena(MensajeTexto.TIEMPO_AGOTADO.getTexto());
}
if(desicion){
opcionesContratoBO.actulizaEstatus(Estatus.Vigente.getValor(), contrato.getIdContrato(), expedienteUsuario);
respuesta.setCadena(MensajeTexto.LLAMADA_EXITOSA.getTexto()); //noMensaje = NumeroMensaje.OKLLAMADA.getValue() ;
respuesta.setEstado(true);
respuesta.setNumero(TipoMensaje.EXITO.getValor());
opcionesContratoBO.llamarAjustaAddendum(contrato.getIdContrato());
opcionesContratoBO.llamarReportePagos(contrato.getIdContrato());
//logger.debug(" value: " + NumeroMensaje.OKLLAMADA.getValue());
}else{
respuesta.setCadena(MensajeTexto.LLAMADA_NO_EXITOSA.getTexto());//noMensaje = NumeroMensaje.NOOKLLAMADA.getValue();
//logger.debug(" value: " + NumeroMensaje.NOOKLLAMADA.getValue());
}
logger.debug("Se termino de llamar a registroAdendumEnmiendaNoAmortizable (TRANSACCIONAL - LINCESE FEE)");
}
//setNmensaje(NumeroMensaje.NOVALIDAWSOC.getValue());
}
//return noMensaje + "_" + informacion;
return respuesta;
}
*/
public BundleReturn notificacionSAP(ContratoDTO contrato, String expedienteUsuario){
BundleReturn respuesta = new BundleReturn();
respuesta.setNumero(TipoMensaje.ERROR.getValor());
respuesta.setEstado(false);
boolean desicion = false;
ResponseOrdenCompraDTO responseDTO = null;
ResponseAdendumEnmiendaDTO responseAdendumDTO = null;
if(contrato.getAmortizable().equals("SI")) { //Amortizable (Suscripcin o License Fee )
if(contrato.getIdTipoMovimiento() == 1) {//Contrato Original o Addendum
try {
logger.info("antes de llamarCrearOrdenCompra.");
responseDTO = llamaCrearOrdenCompra(contrato, expedienteUsuario);
logger.info("despues de llamarCrearOrdenCompra.");
desicion = responseDTO.getResultado();
respuesta.setCadena(responseDTO.getMensaje());
}catch (Exception ex){
logger.debug(ex.toString());
respuesta.setCadena(MensajeTexto.TIEMPO_AGOTADO.getTexto());
}
if(desicion){
respuesta.setCadena(MensajeTexto.LLAMADA_EXITOSA.getTexto()); //noMensaje = NumeroMensaje.OKLLAMADA.getValue() ;
respuesta.setEstado(true);
respuesta.setNumero(TipoMensaje.EXITO.getValor());
procesarResultadosPorContrato(contrato.getIdContrato());
}else{
respuesta.setCadena(MensajeTexto.LLAMADA_NO_EXITOSA.getTexto());
//logger.debug(" value: " + NumeroMensaje.NOOKLLAMADA.getValue());
}
//logger.debug("Se termino de llamar a creaOrdenCompra(SUSCRIPCIN)");
}else {//Enmienda
try {
logger.info("antes de llamaCrearEnmienda.");
responseAdendumDTO = llamaCrearEnmienda(contrato, expedienteUsuario);
logger.info("despues de llamaCrearEnmienda.");
desicion = responseAdendumDTO.getResultado();
respuesta.setCadena(responseAdendumDTO.getMensaje());
}catch(Exception ex) {
logger.debug(ex.toString());
respuesta.setCadena(MensajeTexto.TIEMPO_AGOTADO.getTexto());
}
if(desicion){
respuesta.setCadena(MensajeTexto.LLAMADA_EXITOSA.getTexto()); //noMensaje = NumeroMensaje.OKLLAMADA.getValue() ;
respuesta.setEstado(true);
respuesta.setNumero(TipoMensaje.EXITO.getValor());
procesarResultadosPorContrato(contrato.getIdContrato());
}else{
respuesta.setCadena(MensajeTexto.LLAMADA_NO_EXITOSA.getTexto());//noMensaje = NumeroMensaje.NOOKLLAMADA.getValue();
//logger.debug(" value: " + NumeroMensaje.NOOKLLAMADA.getValue());
}
logger.debug("Se termino de llamar a crearAdendunEnmienda (SUSCRIPCIN)");
}
}else {// No Amortizable (Transaccional)
if(contrato.getIdTipoMovimiento() == 1) {//Contrato Original o Addendum
try {
responseDTO = llamaRegistrarSAPNoAmortizable(contrato, expedienteUsuario);
desicion = responseDTO.getResultado();
respuesta.setCadena(responseDTO.getMensaje());
}catch (Exception ex){
logger.debug(ex.toString());
respuesta.setCadena(MensajeTexto.TIEMPO_AGOTADO.getTexto());
}
if(desicion){
respuesta.setCadena(MensajeTexto.LLAMADA_EXITOSA.getTexto()); //noMensaje = NumeroMensaje.OKLLAMADA.getValue() ;
respuesta.setEstado(true);
respuesta.setNumero(TipoMensaje.EXITO.getValor());
procesarResultadosPorContrato(contrato.getIdContrato());
}else{
respuesta.setCadena(MensajeTexto.LLAMADA_NO_EXITOSA.getTexto());//noMensaje = NumeroMensaje.NOOKLLAMADA.getValue();
//logger.debug(" value: " + NumeroMensaje.NOOKLLAMADA.getValue());
}
logger.debug("Se termino de llamar a registroSAPNoAmortizable (TRANSACCIONAL - LINCESE FEE)");
}else {//Enmienda
try {
responseAdendumDTO = llamaEnmiendaNoAmortizable(contrato, expedienteUsuario); //llamar a registroAdendumEnmiendaNoAmortizable
desicion = responseAdendumDTO.getResultado();
respuesta.setCadena(responseAdendumDTO.getMensaje()); //informacion = responseAdendumDTO.getMensaje();
}catch(Exception ex) {
logger.debug(ex.toString());
respuesta.setCadena(MensajeTexto.TIEMPO_AGOTADO.getTexto());
}
if(desicion){
respuesta.setCadena(MensajeTexto.LLAMADA_EXITOSA.getTexto()); //noMensaje = NumeroMensaje.OKLLAMADA.getValue() ;
respuesta.setEstado(true);
respuesta.setNumero(TipoMensaje.EXITO.getValor());
procesarResultadosPorContrato(contrato.getIdContrato());
}else{
respuesta.setCadena(MensajeTexto.LLAMADA_NO_EXITOSA.getTexto());//noMensaje = NumeroMensaje.NOOKLLAMADA.getValue();
//logger.debug(" value: " + NumeroMensaje.NOOKLLAMADA.getValue());
}
logger.debug("Se termino de llamar a registroAdendumEnmiendaNoAmortizable (TRANSACCIONAL - LINCESE FEE)");
}
//setNmensaje(NumeroMensaje.NOVALIDAWSOC.getValue());
}
//return noMensaje + "_" + informacion;
return respuesta;
}
public boolean validaEstudioContrato(Long idContrato) {
String estudio = null;
try {
estudio = validacionGeneralesDAO.obtenerIdSapEstudioContrato(idContrato);
} catch(Exception ex) {
logger.error("", ex);
}
if(estudio == null) {
return false;
} else {
return true;
}
}
public ResponseValidaPresupuestoCntDTO obtenValidacionPresupuesto(Date fechaInicio, Long idContrato, String origen){
DLARestClient client = dlaRestClientFactory.getClient(DLARestServices.VALIDAR_PRESUPUESTO_POR_CONTRATO);
ParamValidaPresupuestoCntDTO req = new ParamValidaPresupuestoCntDTO();
ResponseValidaPresupuestoCntDTO resp = null;
//PresupuestoRequest req = new PresupuestoRequest();
//PresupuestoResponse resp = null;
//int annioActual = 0;
//int annioInicioContrato = 0;
//Calendar cal = Calendar.getInstance();
//cal.setTime(fechaInicio);
//annioInicioContrato = cal.get(Calendar.YEAR);
//cal.setTime(new Date());
//annioActual = cal.get(Calendar.YEAR);
req.setIdContrato(idContrato.toString());
//req.setAnnio(annioActual >= annioInicioContrato ? (annioActual+"") : (annioInicioContrato+""));
//req.setOrigen(origen);
//req.setAnnio(annio);
//req.setAnio(annioActual >= annioInicioContrato ? annioActual : annioInicioContrato);
//req.setAnio(annioInicioContrato);
//req.setContrato(idContrato);
//req.setOrigenTitulos(origen);
//logger.info("Generales - Ao : [{}]", annioInicioContrato);
logger.debug("request : [{}]", req);
try {
resp = client.get(req, ResponseValidaPresupuestoCntDTO.class);
logger.debug("response : [{}]", resp);
}catch(Exception ex) {
logger.error("", ex);
}
return resp;
}
public ResponseValidaMinimoSeleccionDTO obtenValidacionMinimoSeleccion(Long idContrato, String origen) {
DLARestClient client = dlaRestClientFactory.getClient(DLARestServices.VALIDA_MINIMO_SELECCION);
ParamValidaMinimoSeleccionDTO req = new ParamValidaMinimoSeleccionDTO();
ResponseValidaMinimoSeleccionDTO resp = null;
req.setIdContrato(idContrato.toString());
req.setOrigenTitulos(origen);
logger.debug("request : [{}]", req);
try{
resp = client.get(req, ResponseValidaMinimoSeleccionDTO.class);
logger.debug("response : [{}]", resp);
}catch(Exception ex){
logger.error("", ex);
}
return resp;
}
public boolean llamdaCalcularAmortizacionPorContrato(Long idContrato) {
boolean respuesta = false;
DLARestClient client = dlaRestClientFactory.getClient(DLARestServices.CALCULAR_AMORTIZACION_POR_CONTRATO);
ParamCalcAmortCntDTO req = new ParamCalcAmortCntDTO();
ResponseCalcAmortCntDTO resp = null;
req.setIdContrato(idContrato.toString());
String modulo = "AMORTIZACION"; //verificar si se cuenta con un enum para esta cadena
//req.setModulo(modulo);
//req.setLobTitulos(new ArrayList<ContratoTituloDTO>());
logger.debug("request : [{}]", req);
try {
resp = client.get(req, ResponseCalcAmortCntDTO.class);
logger.debug("response : [{}]", resp);
respuesta = resp.getResultado();
if(!respuesta) {
opcionesContratoBO.registraProcesoPendiente(idContrato, modulo , 1);
}
}catch(Exception ex) {
opcionesContratoBO.registraProcesoPendiente(idContrato, modulo, 1);
logger.error("", ex);
}
return respuesta;
}
public BundleReturn validacionesParaFinalizarRegistro(Long idContrato, Long tipoContrato, Date fechaInicio, String origen, String expediente) {
logger.info("Validando, idContrato : [{}] -- tipoContrato [{}]", idContrato, tipoContrato);
String infoRespuesta = "";
//Integer numeroMensaje = NumeroMensaje.NOFINALIZA.getValue();
BundleReturn respuesta = new BundleReturn();
respuesta.setCadena(MensajeTexto.CONTRATO_NO_FINALIZADO.getTexto() + "_");//respuesta.setCadena("OK");
respuesta.setNumero(TipoMensaje.ERROR.getValor());//respuesta.setNumero(NumeroMensaje.NOFINALIZA.getValue());
respuesta.setEstado(false);
//--Banderas para las reglas de Finalizacin
boolean esEstudioOficial = false;
Integer numeroDocumentos = 0;
Integer numeroTerminos = 0;
Integer numeroCondicionesPago = 0;
Integer numeroTitulos = 0;
Integer totalTitulos = 0;
Long apartado = null;
Integer sinSubnumero = 0;
Integer erroresMG = 0;
//boolean esMontoMayorLF = false;
Double costoSAP = 0.0;
Double costoContrato = 0.0;
WFSeguimientoDTO wfSeguimiento = new WFSeguimientoDTO();
wfSeguimiento.setIdContrato(idContrato);
wfSeguimiento.setIdPasoWF(1);
wfSeguimiento.setFecha1(new Date());
wfSeguimiento.setEstaAutorizado(0);
//--- Estas validacines aplica para los 3 tipos de Contratos (Suscripcin, Transaccional y License Fee )
//--- Estudio Oficial
//--- Documentos Asociados al Contrato
try{
//--- Se valida que el estudio sea Oficial
esEstudioOficial = validaEstudioContrato(idContrato);//--- Se valida que sea un estudio oficial
//--- Se valida que tenga documentos
numeroDocumentos = 1; // validacionGeneralesDAO.contarDocumentosContrato(idContrato); por el momento se comento que no es necesario validar que haya un documento asociado al contrato
}catch(Exception e){
logger.error("Erro : [{}]", e);
}
if( tipoContrato == 1 ) //--Es Suscripcin
{
try{
//--- Se validan los Terminos Comerciales
numeroTerminos = validacionGeneralesDAO.contarTerminosContrato(idContrato);
//--- Se validan las Condiciones de Pago
numeroCondicionesPago = validacionGeneralesDAO.contarCondicionesPagoContrato(idContrato);
//--- Se validan las disminuciones que no tienen Subnumero
sinSubnumero = validacionGeneralesDAO.contarSinSubnumero(idContrato);
//--- Se valida el Apartado
apartado = validacionGeneralesDAO.obtenerApartadoContrato(idContrato);
}catch(Exception e){
logger.error("Erro : [{}]", e);
}
//--- Se valida Presupuesto
ResponseValidaPresupuestoCntDTO respuestaPresupuesto = null;
respuestaPresupuesto = commonRestBO.validaPresupuesto(fechaInicio, idContrato, origen);
//--- Se validan los Minimos de Seleccin
ResponseValidaMinimoSeleccionDTO respuestaMinimos = null;
respuestaMinimos = obtenValidacionMinimoSeleccion(idContrato, origen);
if(esEstudioOficial)
{
if(numeroDocumentos > 0)
{
if(numeroTerminos > 0)
{
if(numeroCondicionesPago > 0)
{
if(sinSubnumero == 0)
{
if(apartado != null)
{
if(respuestaPresupuesto.getResultado())
{
infoRespuesta = revisaMinimoCorreo(idContrato, expediente, fechaInicio, respuestaMinimos.getResultado(), respuesta, wfSeguimiento, infoRespuesta);
}else{
infoRespuesta += respuestaPresupuesto.getMensaje() + "_";
}
}else {
infoRespuesta += MensajeTexto.CONTRATO_NO_TIENE_APARTADOS.getTexto() + "_";
}
}else{
infoRespuesta += MensajeTexto.CONTRATO_CON_SINSUBNUMERO.getTexto() + "_";
}
}else {
infoRespuesta += MensajeTexto.CONTRATO_NO_TIENE_CONDICIONES_PAGO.getTexto() + "_";
}
}else {
infoRespuesta += MensajeTexto.CONTRATO_NO_TIENE_TERMINOS.getTexto() + "_";
}
}else {
infoRespuesta += MensajeTexto.CONTRATO_NO_TIENE_DOCUMENTOS.getTexto() + "_";
}
}else {
infoRespuesta += MensajeTexto.CONTRATO_NO_ESTUDIO_OFICIAL.getTexto() + "_";//hacer un append al final
}
}//Termina if( tipoContrato == 1 ) //--Es Suscripcin
if( tipoContrato == 2 )//-- Es Transaccional
{
//--- Se validan que no existan errores en el calculo del minimo garantizado ---//
erroresMG = validacionGeneralesDAO.ObtenerErroresCalculoMinimoGarantizado(idContrato);
logger.info( "Transaccional: Total Errores en calculo MG" + erroresMG);
if(esEstudioOficial)
{
logger.info( "Transaccional: es estudio oficial " + esEstudioOficial);
if(numeroDocumentos > 0)
{
logger.info( "Transaccional: numero de documentos " + numeroDocumentos);
//if( erroresMG == 0 || erroresMG == null )
if(true)
{
logger.info( "Transaccional: No existen Errores en calculo" + erroresMG);
infoRespuesta = revisaMinimoCorreo(idContrato, expediente, fechaInicio, true, respuesta, wfSeguimiento, infoRespuesta);
}else{
infoRespuesta += MensajeTexto.ERROR_CALCULO_MINIMO_GARANTIZADO.getTexto() + "_";
}
}else {
infoRespuesta += MensajeTexto.CONTRATO_NO_TIENE_DOCUMENTOS.getTexto() + "_";
}
}else {
infoRespuesta += MensajeTexto.CONTRATO_NO_ESTUDIO_OFICIAL.getTexto() + "_";//hacer un append al final
}
}//Termina if( tipoContrato == 2 )//-- Es Transaccional
if( tipoContrato == 3 )//-- Es License Fee
{
try{
//-- Para validar que el monto sea mayor al contrato anterior
numeroTitulos = validacionGeneralesDAO.contarTitulosActivosContrato(idContrato);
totalTitulos = validacionGeneralesDAO.obtenerTotalTitulosEnTerminos(idContrato);
//-- Para validar que el monto sea mayor al contrato anterior
costoSAP = validacionGeneralesDAO.obtenMontoContratoSAP(idContrato);
costoContrato = validacionGeneralesDAO.obtenCantidad(idContrato);
}catch(Exception e){
logger.error("Erro : [{}]", e);
}
if(esEstudioOficial)
{
logger.info( "License Fee: es estudio oficial " + esEstudioOficial);
if(numeroDocumentos > 0)
{
logger.info( "License Fee: numero de documentos " + numeroDocumentos);
if( numeroTitulos == totalTitulos )
{
logger.info( "License Fee: numero de titulos y total de titulos " + numeroTitulos + "=" + totalTitulos );
if( costoSAP <= costoContrato )
{
infoRespuesta = revisaMinimoCorreo(idContrato, expediente, fechaInicio, true, respuesta, wfSeguimiento, infoRespuesta);
}else{
logger.info( "License Fee: costo SAP y costo Contraro " + costoSAP + "<" + costoContrato);
infoRespuesta += MensajeTexto.CONTRATO_COSTO_NO_DISMINUIR.getTexto() + "_";
}
}else {
infoRespuesta += MensajeTexto.CONTRATO_NO_TITULOS_ESPECIFICADOS.getTexto() + "_";
}
}else {
infoRespuesta += MensajeTexto.CONTRATO_NO_TIENE_DOCUMENTOS.getTexto() + "_";
}
}else {
infoRespuesta += MensajeTexto.CONTRATO_NO_ESTUDIO_OFICIAL.getTexto() + "_";//hacer un append al final
}
}//Termina if( tipoContrato == 3 )//-- Es License Fee
if(!respuesta.getEstado()) {
respuesta.setCadena(infoRespuesta);
}
return respuesta;
}
public String revisaMinimoCorreo(Long idContrato, String expediente,Date fechaInicio, boolean respuestaMinimos, BundleReturn respuesta, WFSeguimientoDTO wfSeguimiento, String infoRespuesta ){
Map<String, Object> respuestaEnvioCorreo;
if(respuestaMinimos) {
respuestaEnvioCorreo = notificaFinalizacionRegistro(idContrato);
//if((Boolean) respuestaEnvioCorreo.get("respuesta")) {
if(true) {
respuesta.setCadena(MensajeTexto.CONTRATO_FINALIZADO.getTexto() + "_" + (String) respuestaEnvioCorreo.get("mensaje"));
respuesta.setNumero(TipoMensaje.EXITO.getValor());
respuesta.setEstado(true);
opcionesContratoBO.actulizaEstatus(Estatus.Revision.getValor(), idContrato, expediente);
validacionGeneralesDAO.registraWFSeguimiento(wfSeguimiento);
esContratoSuscripcion(fechaInicio, idContrato);
}else {
infoRespuesta += (String) respuestaEnvioCorreo.get("mensaje");
}
}else {
infoRespuesta += MensajeTexto.CONTRATO_NO_CUMPLE_MINIMOS.getTexto() + "_";
}
return infoRespuesta;
}
public String uneListaErrores(List<String> errores) {
String cadenaErrores = "";
if(errores.size() > 0) {
for(int i = 0; i < errores.size(); i++) {
cadenaErrores += "Error " + (i + 1) + " : " + errores.get(i) + ".";
if(i < errores.size() - 1){
cadenaErrores += "_";
}
}
}
return cadenaErrores;
}
public BundleReturn validaWorkFlow(Long idContrato, String expedienteUsuario, Integer ordenPasoWF, Integer noPasosWF, Date fechaInicioContrato , String fechaSincronizacionSAP, Long tipoContrato) {
WFPasoDTO pasoActual = null;
WFPasoDTO pasoSiguiente = null;
List<AutorizadorDTO> autorizadores = null;
List<CorreoExternoDTO> correosExternos = null;
Long idMenu = null; // = 65L; //verificar como obtner o cual sera su id definitivamente
boolean seEnviaronCorreos = false;
BundleReturn respuesta = new BundleReturn();
String etiqueta = null;
respuesta.setEstado(false);
respuesta.setNumero(TipoMensaje.ERROR.getValor());
SimpleDateFormat sdf = null;
String sFechaInicio = null;
Date fechaSAP = null;
Date dFechaInicio = null;
boolean seCambioEstatusPorFechas = false;
String seccionExternos = "AUTORIZACION_WF_CEO"; //si se dese enviar a otro grupo de correos se debera definir en dda_t_correo_externo
Date fechaRegistro = null;
WFSeguimientoDTO wfSeguimiento = new WFSeguimientoDTO();
Operacion tipo = null;
try {
pasoActual = validacionGeneralesDAO.obtnerWFPaso(ordenPasoWF);//generalesBO.obtenerAreaPorOrdenWF(noAreaWF);
idMenu = 65L; //idMenu = validacionGeneralesDAO.obtenIdMenuParaAutorizarContrato("Autorizar contrato");
logger.info("Area Actual : [{}]", pasoActual);
if(ordenPasoWF < noPasosWF) {
pasoSiguiente = validacionGeneralesDAO.obtnerWFPaso(ordenPasoWF + 1);//generalesBO.obtenerAreaPorOrdenWF(ordenPasoWF + 1);
autorizadores = validacionGeneralesDAO.obtenerAutorizador(idMenu, pasoSiguiente.getIdArea());//obtener correos de autorizadores de la siguiente area
etiqueta = MensajeTexto.ETIQUETA_AUTORIZACION_WF.getTexto();
tipo = Operacion.CONTRATO;
}else {
autorizadores = validacionGeneralesDAO.obtenerTodosAreas();//validacionGeneralesDAO.obtenerAutorizador(idMenu, null);//obtener corrreos de autorizadores de todas las areas
etiqueta = "Se ha autorizado ";
seccionExternos = "AUTORIZACION_WF_CEO";
etiqueta = MensajeTexto.ETIQUETA_FINALIZA_AUTORIZACION_WF.getTexto();
tipo = Operacion.FINALIZO_AUTORIZACION;
}
logger.info("Area Siguiente : [{}] - autorizadores : [{}]", pasoSiguiente, autorizadores);
if(autorizadores.size() > 0) {
seEnviaronCorreos = mandaCorreo(idContrato, autorizadores, null, etiqueta, tipo);
if(seEnviaronCorreos) {
fechaRegistro = new Date();
validacionGeneralesDAO.registraPasoWF(idContrato, pasoActual.getOrdenWF(), expedienteUsuario, fechaRegistro); //registraAutorizacion(idContrato, pasoActual.getOrdenWF(), expedienteUsuario, fechaRegistro);
//marcar al registro anterior como esta autorizado
validacionGeneralesDAO.actualizaEstaAutorizado(idContrato, pasoActual.getOrdenWF());
// anexar el siguiente en la flujo de workflow
if(pasoSiguiente != null) { //si el pasoSiguiente no es null registra en seguimiento WF
wfSeguimiento.setIdContrato(idContrato);
wfSeguimiento.setIdPasoWF(pasoSiguiente.getOrdenWF());
wfSeguimiento.setFecha1(fechaRegistro);
wfSeguimiento.setEstaAutorizado(0);
validacionGeneralesDAO.registraWFSeguimiento(wfSeguimiento);
}
respuesta.setEstado(true);
respuesta.setCadena(MensajeTexto.AUTORIZACION_REGISTRADA.getTexto());
respuesta.setNumero(TipoMensaje.EXITO.getValor());
if(ordenPasoWF == noPasosWF) {
if(! opcionesContratoBO.tieneFechaAutorizacion(idContrato)) {
opcionesContratoBO.actualizaFechaAutorizacion(new Date(), idContrato);
}
if(opcionesContratoBO.esContratoAmortizable(idContrato)) {
llamdaCalcularAmortizacionPorContrato(idContrato);
}
try {
logger.debug("dateInicio [{}]", fechaInicioContrato);
logger.debug("fecha Sincronizacion [{}]", fechaSincronizacionSAP);
sdf = new SimpleDateFormat("MM/dd/yyyy");
sFechaInicio = sdf.format(fechaInicioContrato);
fechaSAP = sdf.parse(fechaSincronizacionSAP);
dFechaInicio = sdf.parse(sFechaInicio);
logger.debug("fechaInicio : [{}], fechaSAP [{}]", dFechaInicio, fechaSAP);
if(dFechaInicio.compareTo(fechaSAP) < 0) {
logger.debug("No entrara a notificar a SAP[{}]", idContrato);
opcionesContratoBO.actulizaEstatus(Estatus.Vigente.getValor(), idContrato, expedienteUsuario);
opcionesContratoBO.actualizaEstatusPadreContrato(idContrato, expedienteUsuario);
seCambioEstatusPorFechas = true;
procesarResultadosPorContrato(idContrato);
/*opcionesContratoBO.llamarAjustaAddendum(idContrato);
if(tipoContrato != 2)
opcionesContratoBO.llamarReportePagos(idContrato);
logger.debug("Se paso el contrato a Vigente.");*/
}
}catch(ParseException e) {
logger.error("Error : [{}]", e);
}
}
}else {
respuesta.setCadena(MensajeTexto.AUTORIZACION_NO_REGISTRADA.getTexto());
}
}else {
respuesta.setCadena(MensajeTexto.AUTORIZACION_VERIFICA.getTexto());
}
seEnviaronCorreos = false;
if(pasoActual.getEnviaExterno() == 1){
logger.debug("Se debera enviar correos externos.");
//if()
correosExternos = validacionGeneralesDAO.obtenerCorreoExterno(seccionExternos);
seEnviaronCorreos = mandaCorreo(idContrato, null, correosExternos, etiqueta, tipo);
}
logger.debug("valores de estatus area : [{}], seCambioEstatusPorFechas : [{}]",pasoActual.getIdEstatus(), seCambioEstatusPorFechas);
if(pasoActual.getIdEstatus() != null && !seCambioEstatusPorFechas) {
logger.info("se debera cambiar estatus : [{}]", pasoActual.getIdEstatus());
opcionesContratoBO.actulizaEstatus(pasoActual.getIdEstatus(), idContrato, expedienteUsuario);
}
}catch(Exception ex) {
logger.error("Error : [{}]", ex);
}
return respuesta;
}
public boolean procesarResultadosPorContrato(Long idContrato){
boolean resultado = true;
ContratoDTO contrato = generalesBO.obtenContrato(idContrato);
//--- Se ejecuta el Store Procedure DDA_AJUSTARADDENDUM que ajusta los catlogos del Contrato Original
logger.info("Se ejecuta SP Ajusta Addendum." + idContrato );
opcionesContratoBO.llamarAjustaAddendum(idContrato);
try{
if( contrato.getIdTipoContrato() != 2 ) { //-- Si es Suscripcin o License Fee
//--- Se ejecuta el Store Procedure DDA_REPORTEPAGOS
logger.info("Se ejecuta SP Reporte Pago [{}]:" + idContrato);
opcionesContratoBO.llamarReportePagos(idContrato);
}else{
//--- Se ejecuta el Store Procedure DDA_CNT_CALCULAR_MG
logger.info("Se ejecuta SP Calculo de Minimo Garantizado");
tituloLoteDAO.calcularMG(idContrato);
}
if( contrato.getIdTipoContrato() == 1 ){ //-- Si es Suscripcin por lo tanto es amortizable
//--- Se ejecuta el Store Procedure DDA_AMORTIZACIONINICIAL
logger.info("Se ejecuta SP Amortizacion Inicial.");
opcionesContratoBO.llamarAmortizacionInicial(idContrato);
}
if(contrato.getIdTipoMovimiento() == 1) //--- Si es contrato Original o Addendum
{
//--- Se registra el monto y ao del contrato en DDA_T_CONTRATO_SAP ---//
//---------------------------------------------------------------------//
Date fechaInicio = contrato.getFechaInicio();
SimpleDateFormat formatoAnio = new SimpleDateFormat("yyyy");
Long anio = Long.parseLong(formatoAnio.format(fechaInicio));
Double cantidadContrato = validacionGeneralesDAO.obtenCantidad(contrato.getIdContrato());
String cantidad;
if( contrato.getIdTipoContrato() == 1 || contrato.getIdTipoContrato() == 3 )//Si es Suscripcin o License Fee
{
if(cantidadContrato != null){
cantidad = String.format("%.2f", cantidadContrato);// SUMA DE LOS VALORES DE TITULOS
}
else{
cantidad = "1";
}
}
else{ // Si es Transaccional
cantidad = "1";
}
try{
logger.info("Se registra el monto y ao del contrato en DDA_T_CONTRATO_SAP cantidad : " + cantidad + "-> anio :" + anio + "-> idPosicionOrdInt :" + idPosicionOrdInt);
validacionGeneralesDAO.registraContratoSAP(idContrato, anio, idPosicionOrdInt, cantidad);
}catch(Exception ex) {
logger.error("Error : ", ex);
}
}
}catch(Exception ex) {
logger.error("Error : ", ex);
}
return resultado;
}
public boolean mandaCorreo(Long idContrato, List<AutorizadorDTO> autorizadores, List<CorreoExternoDTO> correosExternos, String etiqueta, Operacion tipo){
boolean seEnvio = false;
DetalleCorreoDTO detalleCorreo = null;
String[] destinatarios = null;
DecimalFormat decimalFormatterS = new DecimalFormat("$###,###.##");
DecimalFormat decimalFormatter = new DecimalFormat("###,###.##");
SimpleDateFormat formatoDeFecha = new SimpleDateFormat("MM/dd/yyyy");
DetalleCorreoVO detalleCorreoVO = new DetalleCorreoVO();
//String etiqueta =
try {
detalleCorreo = validacionGeneralesDAO.obtenerDetalleParaCorreo(idContrato);
logger.info("Detalle Correo : [{}]", detalleCorreo);
detalleCorreoVO.setNumeroContrato(detalleCorreo.getNumeroContrato());
detalleCorreoVO.setDescripcionEstudio(detalleCorreo.getDescripcionEstudio());
detalleCorreoVO.setMonto(decimalFormatterS.format(detalleCorreo.getMonto()));
detalleCorreoVO.setNoTitulos(decimalFormatter.format(detalleCorreo.getNoTitulos()));
detalleCorreoVO.setVigencia(formatoDeFecha.format(detalleCorreo.getFechaInicio()) + " - " + formatoDeFecha.format(detalleCorreo.getFechaFin()));
etiqueta = etiqueta.replace("nctoremp", detalleCorreoVO.getNumeroContrato());
logger.info("Detalle Correo Formato : [{}]", detalleCorreoVO);
if(autorizadores != null) {
destinatarios = new String[autorizadores.size()];
for(int i = 0; i < autorizadores.size(); i++) {
destinatarios[i] = autorizadores.get(i).getEmail();
}
seEnvio = llamaServicioEnviaCorreo(idContrato, destinatarios, detalleCorreoVO, etiqueta, tipo, MensajeTexto.EMAIL_SUBJECT_AUTORIZACION.getTexto().replace("&oacute;", ""));
}else {
destinatarios = new String[correosExternos.size()];
for(int i = 0; i < correosExternos.size(); i++) {
destinatarios[i] = correosExternos.get(i).getCorreo();
}
seEnvio = llamaServicioEnviaCorreo(idContrato, destinatarios, detalleCorreoVO, etiqueta, tipo, MensajeTexto.EMAIL_SUBJECT_AUTORIZACION.getTexto());
}
}catch(Exception ex) {
logger.error("Error : ", ex);
}
return seEnvio;
}
public boolean mandaCorreoRechazo(Long idContrato, List<AutorizadorDTO> autorizadores, String etiqueta, String motivo) {
//logger.debug("Etiqueta : [{}] - Motivo : [{}]", etiqueta, motivo);
DetalleCorreoVO detalleCorreoVO = new DetalleCorreoVO();
boolean seEnvio = false;
String[] destinatarios = null;
detalleCorreoVO.setMotivo(motivo);
detalleCorreoVO.setNumeroContrato(opcionesContratoBO.obtenerNumeroContrato(idContrato));
etiqueta = etiqueta.replace("nctoremp", detalleCorreoVO.getNumeroContrato());
if(autorizadores != null) {
destinatarios = new String[autorizadores.size()];
for(int i = 0; i < autorizadores.size(); i++) {
destinatarios[i] = autorizadores.get(i).getEmail();
}
seEnvio = llamaServicioEnviaCorreo(idContrato, destinatarios, detalleCorreoVO, etiqueta, Operacion.NOAUTORIZA, MensajeTexto.EMAIL_SUBJECT_NO_AUTORIZACION.getTexto().replace("&oacute;", ""));
}
return seEnvio;
}
public boolean mandaCorreoNotificacionCreacionContrato(Long idContrato, String numeroContrato, Long idEstudio, Date fechaInicio, Date fechaFin) {
DetalleCorreoVO detalleCorreoVO = new DetalleCorreoVO();
boolean seEnvio = false;
List<CorreoExternoDTO> correosExternos = validacionGeneralesDAO.obtenerCorreoExterno("CREACION_CONTRATO");
String[] destinatarios;
SimpleDateFormat formatoDeFecha = new SimpleDateFormat("MM/dd/yyyy");
detalleCorreoVO.setNumeroContrato(numeroContrato);
detalleCorreoVO.setDescripcionEstudio(validacionGeneralesDAO.obtenerDescripcionEstudio(idEstudio));
detalleCorreoVO.setVigencia(formatoDeFecha.format(fechaInicio) + " - " + formatoDeFecha.format(fechaFin));
String etiqueta = MensajeTexto.ETIQUETA_CREACION_CONTRATO.getTexto();
etiqueta = etiqueta.replace("nctoremp", detalleCorreoVO.getNumeroContrato());
if(correosExternos != null) {
destinatarios = new String[correosExternos.size()];
for(int i = 0; i < correosExternos.size(); i++){
destinatarios[i] = correosExternos.get(i).getCorreo();
}
seEnvio = llamaServicioEnviaCorreo(idContrato, destinatarios, detalleCorreoVO, etiqueta, Operacion.CREACION_CONTRATO, "Notificacin de creacin del contrato ");
}
return seEnvio;
}
public boolean llamaServicioEnviaCorreo(Long idContrato, String[] destinatarios, DetalleCorreoVO detalleCorreo, String etiqueta , Operacion tipo, String subject) {
String body = null;
EmailRequest request = new EmailRequest();
EmailResponse response = null;
boolean exito = false;
DocumentoDTO documento = null;
Map<String, String> destina = new HashMap<String, String>();
try {
for(String dest : destinatarios){
destina.put(dest, dest);
}
documento = documentoBO.obtenerUltimoDocumento(idContrato);
if(documento != null){
detalleCorreo.setIdDocumento(documento.getIdContratoDocto());
}
body = JsonConverter.toJson(detalleCorreo);
logger.debug("body [{}]",body);
request.setDate((new Date()).toString());
request.setName("yussel luna");
request.setToCompany("Derechos de Autor");
request.setUserName("administrador@dladda.com");
request.setDestinatarios(destina.values().toArray(new String[0]));//(destinatarios);
request.setSubject(subject + detalleCorreo.getNumeroContrato());
request.setBody(body);
request.setOperacion(tipo);
request.setEtiqueta(etiqueta);
//request.setT
//logger.debug("request [{}]",JsonConverter.toJson(request));
dLARestClient = dlaRestClientFactory.getClient(DLARestServices.ENVIA_CORREO);
response = dLARestClient.get(request, EmailResponse.class);
logger.debug("response : [{}]", response);
if(response.getRespuesta().equals("true")) {
exito = true;
}
}catch (Exception ex) {
logger.error("Error : [{}]", ex);
exito = false;
}
return exito;
}
//----->
public Map<String, Object> notificaFinalizacionRegistro(Long idContrato) {
WFPasoDTO primerPaso = null;
List<AutorizadorDTO> autorizadores;
Boolean correoEnviado = false;
String mensaje = "";
Map<String, Object> respuesta = new HashMap<String, Object>();
try {
primerPaso = validacionGeneralesDAO.obtnerWFPaso(1); //generalesBO.obtenerAreaPorOrdenWF(1);
autorizadores = validacionGeneralesDAO.obtenerAutorizador(65L, primerPaso.getIdArea());
respuesta.put("respuesta", correoEnviado);
if(autorizadores.size() > 0) {
correoEnviado = mandaCorreo(idContrato, autorizadores, null, MensajeTexto.ETIQUETE_FINALIA_REGISTRO.getTexto(), Operacion.CONTRATO);
respuesta.put("respuesta", correoEnviado);
if(correoEnviado) {
mensaje = MensajeTexto.NOTIFICACION_FINALIZO_REGISTRO.getTexto();
respuesta.put("mensaje", mensaje);
}else {
mensaje = MensajeTexto.NOTIFICACION_NO_FINALIZO_REGISTRO.getTexto();
respuesta.put("mensaje", mensaje);
}
}else {
respuesta.put("mensaje", MensajeTexto.AUTORIZACION_VERIFICA.getTexto());
}
}catch(Exception ex) {
logger.error("Error :_ [{}]", ex);
}
return respuesta;
}
public BundleReturn noAceptarAutorizacion(Long idContrato, String motivo, Integer noPaso, UsuarioDTO usuario) {
WFPasoDTO pasoActual = null;
WFPasoDTO pasoAnterior = null;
List<AutorizadorDTO> autorizadoresPrevios = null;
Boolean seMandoCorreo = false;
BundleReturn respuesta = new BundleReturn();
String sarea = "";
respuesta.setEstado(false);
respuesta.setCadena(MensajeTexto.RECHAZO_NO_NOTIFICADO.getTexto());
respuesta.setNumero(TipoMensaje.ERROR.getValor());
String etiqueta = MensajeTexto.ETIQUETA_RECHAZO_AUTORIZACION_WF.getTexto();
try {
logger.debug("noPaso : [{}]", noPaso);
pasoActual = validacionGeneralesDAO.obtnerWFPaso(noPaso); //generalesBO.obtenerAreaPorOrdenWF(noPaso);
if(noPaso == 1) {
//areaAnterior = generalesBO.obtenerAreaPorOrden(2);//especificar que area notifica a la primera
pasoAnterior = validacionGeneralesDAO.obtnerWFPaso(2);
autorizadoresPrevios = obtenerAutorizadorAreas();
}else {
pasoAnterior = validacionGeneralesDAO.obtnerWFPaso(noPaso - 1); //generalesBO.obtenerAreaPorOrdenWF(noPaso - 1);
autorizadoresPrevios = validacionGeneralesDAO.obtenerAutorizador(65L, pasoAnterior.getIdArea());
}
logger.debug("pasoAnterior : [{}]", pasoAnterior);
logger.debug("autorizadores anteriores : [{}]", autorizadoresPrevios);
sarea = pasoActual.getDescripcionArea().replaceAll("", "&oacute;");
etiqueta = etiqueta.replace("sarea", sarea);
seMandoCorreo = mandaCorreoRechazo(idContrato, autorizadoresPrevios, etiqueta, motivo);
if(seMandoCorreo) {
justificacionBO.insertarJustificacion(motivo, idContrato, usuario);
switch(noPaso){
case 1 :
opcionesContratoBO.actulizaEstatus(Estatus.Registro.getValor(), idContrato, usuario.getExpediente());
break;
case 2 :
opcionesContratoBO.actulizaEstatus(Estatus.Revision.getValor(), idContrato, usuario.getExpediente());
default:
validacionGeneralesDAO.eliminaAutorizacionRegistrada(idContrato, pasoAnterior.getOrdenWF());
}
validacionGeneralesDAO.actualizaEstaAutorizado(idContrato, pasoActual.getOrdenWF());
respuesta.setEstado(true);
respuesta.setCadena(MensajeTexto.RECHAZO_NOTIFICADO.getTexto());
respuesta.setNumero(TipoMensaje.EXITO.getValor());
}
}catch(Exception ex) {
logger.error("Error : [{}]", ex);
}
return respuesta;
}
public List<AutorizadorDTO> obtenerAutorizadorAreas() {
List<AutorizadorDTO> autorizadores = new ArrayList<AutorizadorDTO>();
List<AutorizadorDTO> autorizadoresAux = null;
List<AreaDTO> areas;
try {
areas = generalesBO.obtenerAreasFinalizadoras();
for(AreaDTO area : areas) {
autorizadoresAux = validacionGeneralesDAO.obtenerAutorizador(65L, area.getIdArea());
for(AutorizadorDTO autorizador : autorizadoresAux) {
autorizadores.add(autorizador);
}
autorizadoresAux = null;
}
}catch(Exception ex) {
logger.error("Error : [{}]", ex);
}
return autorizadores;
}
//----->
public boolean esContratoSuscripcion(Date fechaInicio ,Long idContrato) {
boolean respuesta = false;
String tipoFees = null;
try {
tipoFees = validacionGeneralesDAO.obtenerTipoFees(idContrato);
if(tipoFees != null) {
if(tipoFees.equals("ESCALA")) {
respuesta = true;
commonRestBO.llamadaCostoTitulo(fechaInicio, idContrato, OrigenCodes.REAL.name());
}
}
}catch(Exception ex) {
logger.error("Error : [{}]", ex);
}
return respuesta;
}
//---------------
// private RestTemplate restTemplate;
// private HttpHeaders headers;
// private ClientHttpRequestFactory factory;
//
// public void configuraPlantilla(){
//
// restTemplate = new RestTemplate();
// headers = new HttpHeaders();
// factory = restTemplate.getRequestFactory();
//
// if(factory instanceof SimpleClientHttpRequestFactory){
//
// ((SimpleClientHttpRequestFactory) factory).setConnectTimeout(30 * 1000);
// ((SimpleClientHttpRequestFactory) factory).setReadTimeout(30 * 1000);
// log.debug("Inicilizando rest template");
//
// }else if(factory instanceof HttpComponentsClientHttpRequestFactory){
// ((HttpComponentsClientHttpRequestFactory) factory).setConnectTimeout(30 * 1000);
// ((HttpComponentsClientHttpRequestFactory) factory).setReadTimeout(30 * 1000);
// log.debug("Inicilizando rest template");
//
// }
//
// restTemplate.setRequestFactory(factory);
// headers.setContentType(MediaType.APPLICATION_JSON);
// }
private DLARestClient dLARestClient;
public ResponseOrdenCompraDTO llamaCrearOrdenCompra(ContratoDTO contrato, String expediente) {
// configuraPlantilla();
// String url = env.getProperty("service.ordenInterna.url");
// String metodo = env.getProperty("service.ordenInterna.metodo");
logger.info("idContrato : " + contrato.getIdContrato() + ", expediente : " + expediente +" en llamarCrearOrdenCompra");
ParamOrdenCompraDTO paramDTO = null;
ResponseOrdenCompraDTO responseDTO = new ResponseOrdenCompraDTO();
//logger.info("Antes de configurar parmetros.");
paramDTO = parametersWebService.obtenParametroOrdenCompra(contrato, expediente);
//logger.info("Despues de configurar parmetros.");
logger.info("{}", printOrdenCompraRequest(paramDTO));
//HttpEntity<ParamOrdenCompraDTO> entity = new HttpEntity<ParamOrdenCompraDTO>(paramDTO, headers);
dLARestClient = dlaRestClientFactory.getClient(DLARestServices.REGISTRAR_SAP_SUSCRIPCION);
responseDTO = dLARestClient.get(paramDTO, ResponseOrdenCompraDTO.class); //(ResponseOrdenCompraDTO) restTemplate.postForObject((url += metodo), entity, ResponseOrdenCompraDTO.class);
logger.debug("Request : " + paramDTO + " Response : " + responseDTO);
/*if(responseDTO.getResultado()) {
Date fechaInicio = contrato.getFechaInicio();
SimpleDateFormat formatoAnio = new SimpleDateFormat("yyyy");
Long anio = Long.parseLong(formatoAnio.format(fechaInicio));
//logger.info("Entro a registras en Suscripcion el anio en SAP{}"+ anio );
//Se debera verificar que si el parametro llevara mas de un item de cual se tomara la informacion para este registro
//validacionGeneralesDAO.registraContratoSAP(contrato.getIdContrato(), anio, paramDTO.getItems().get(0).getIdPosicion(), paramDTO.getItems().get(0).getCantidad());
}
*/
return responseDTO;
}
public ResponseAdendumEnmiendaDTO llamaCrearEnmienda(ContratoDTO contrato, String expediente) {
ParamAdendumEnmiendaDTO paramDTO = null;
ResponseAdendumEnmiendaDTO responseDTO = new ResponseAdendumEnmiendaDTO();
//paramDTO = parametersWebService.obtenParametroAdendumEnmienda(contrato, expediente);
paramDTO = parametersWebService.obtenParametroEnmienda(contrato, expediente);
dLARestClient = dlaRestClientFactory.getClient(DLARestServices.REGISTRAR_SAP_ENMIENDA_SUSCRIPCION);
responseDTO = dLARestClient.get(paramDTO, ResponseAdendumEnmiendaDTO.class);
logger.debug("Request: " + paramDTO + " Resonse: " + responseDTO);
return responseDTO;
}
/*
public ResponseAdendumEnmiendaDTO llamaCrearAdendumEnmienda(ContratoDTO contrato, String expediente) {
//configuraPlantilla();
//String url = env.getProperty("service.adendumEnmienda.url");
//String metodo = env.getProperty("service.adendumEnmienda.metodo");
ParamAdendumEnmiendaDTO paramDTO = null;
ResponseAdendumEnmiendaDTO responseDTO = new ResponseAdendumEnmiendaDTO();
paramDTO = parametersWebService.obtenParametroAdendumEnmienda(contrato, expediente);
dLARestClient = dlaRestClientFactory.getClient(DLARestServices.REGISTRAR_SAP_ENMIENDA_SUSCRIPCION);
responseDTO = dLARestClient.get(paramDTO, ResponseAdendumEnmiendaDTO.class);
//HttpEntity<ParamAdendumEnmiendaDTO> entity = new HttpEntity<ParamAdendumEnmiendaDTO>(paramDTO, headers);
//responseDTO = (ResponseAdendumEnmiendaDTO) restTemplate.postForObject((url += metodo), entity, ResponseAdendumEnmiendaDTO.class);
logger.debug("Request: " + paramDTO + " Resonse: " + responseDTO);
//if(responseDTO.getResultado())
//{
//actualiza
// validacionGeneralesDAO.actualizaContratoSAP(contrato.getIdContratoOriginal(), paramDTO.getPosiciones().get(0).getCantidad());
//}
return responseDTO;
}
*/
public ResponseOrdenCompraDTO llamaRegistrarSAPNoAmortizable(ContratoDTO contrato, String expediente) {
// configuraPlantilla();
//
// String url = env.getProperty("service.noAmortizable.url");
// String metodo = env.getProperty("service.noAmortizable.metodo");
ParamOrdenCompraDTO paramDTO = null;
ResponseOrdenCompraDTO responseDTO = new ResponseOrdenCompraDTO();
paramDTO = parametersWebService.obtenParametroOrdenCompra(contrato, expediente);
logger.info("{}", printOrdenCompraRequest(paramDTO));
//dLARestClient = dlaRestClientFactory.getClient(DLARestServices.CREA_ORDEN_COMPRA_NO_AMORTIZABLE);
if(contrato.getIdTipoContrato() == 2){//Transaccional
dLARestClient = dlaRestClientFactory.getClient(DLARestServices.REGISTRAR_SAP_TRANSACCIONAL);
}else{
dLARestClient = dlaRestClientFactory.getClient(DLARestServices.REGISTRAR_SAP_LICENSE_FEE);
}
responseDTO = dLARestClient.get(paramDTO, ResponseOrdenCompraDTO.class);
// HttpEntity<ParamOrdenCompraDTO> entity = new HttpEntity<ParamOrdenCompraDTO>(paramDTO, headers);
// responseDTO = (ResponseOrdenCompraDTO) restTemplate.postForObject((url += metodo), entity, ResponseOrdenCompraDTO.class);
logger.debug("Request: " + paramDTO + " Response: " + responseDTO);
/*if(responseDTO.getResultado() ) {
logger.info(contrato.getIdTipoContrato() + "->entra a validacionGeneralesDAO.registraContratoSAP");
Date fechaInicio = contrato.getFechaInicio();
SimpleDateFormat formatoAnio = new SimpleDateFormat("yyyy");
Long anio = Long.parseLong(formatoAnio.format(fechaInicio));
//logger.info("Entro a registras en no amortizable el anio en SAP{}"+ anio );
//Se debera verificar que si el parametro llevara mas de un item de cual se tomara la informacion para este registro
//validacionGeneralesDAO.registraContratoSAP(contrato.getIdContrato(), anio, paramDTO.getItems().get(0).getIdPosicion(), paramDTO.getItems().get(0).getCantidad());
}*/
return responseDTO;
}
public ResponseAdendumEnmiendaDTO llamaEnmiendaNoAmortizable(ContratoDTO contrato, String expediente) {
ParamAdendumEnmiendaDTO paramDTO = null;
ResponseAdendumEnmiendaDTO responseDTO = new ResponseAdendumEnmiendaDTO();
//paramDTO = parametersWebService.obtenParametroAdendumEnmienda(contrato, expediente);
paramDTO = parametersWebService.obtenParametroEnmienda(contrato, expediente);
if(contrato.getIdTipoContrato() == 2){//Transaccional
dLARestClient = dlaRestClientFactory.getClient(DLARestServices.REGISTRAR_SAP_ENMIENDA_TRANSACCIONAL);
}else{
dLARestClient = dlaRestClientFactory.getClient(DLARestServices.REGISTRAR_SAP_ENMIENDA_LICENSE_FEE);
}
responseDTO = dLARestClient.get(paramDTO, ResponseAdendumEnmiendaDTO.class);
logger.debug("Request: " + paramDTO + " Resonse: " + responseDTO);
return responseDTO;
}
/*
public ResponseAdendumEnmiendaDTO llamaAdendumEnmiendaNoAmortizable(ContratoDTO contrato, String expediente) {
//
// configuraPlantilla();
//
// String url = env.getProperty("service.adendumEnmiendaNoAmortizable.url");
// String metodo = env.getProperty("service.adendumEnmiendaNoAmortizable.metodo");
//
ParamAdendumEnmiendaDTO paramDTO = null;
ResponseAdendumEnmiendaDTO responseDTO = new ResponseAdendumEnmiendaDTO();
//paramDTO = parametersWebService.obtenParametroAdendumEnmienda(contrato, expediente);
paramDTO = parametersWebService.obtenParametroEnmienda(contrato, expediente);
if(contrato.getIdTipoContrato() == 2){//Transaccional
dLARestClient = dlaRestClientFactory.getClient(DLARestServices.REGISTRAR_SAP_ENMIENDA_TRANSACCIONAL);
}else{
dLARestClient = dlaRestClientFactory.getClient(DLARestServices.REGISTRAR_SAP_ENMIENDA_LICENSE_FEE);
}
responseDTO = dLARestClient.get(paramDTO, ResponseAdendumEnmiendaDTO.class);
//HttpEntity<ParamAdendumEnmiendaDTO> entity = new HttpEntity<ParamAdendumEnmiendaDTO>(paramDTO, headers);
//responseDTO = (ResponseAdendumEnmiendaDTO) restTemplate.postForObject((url += metodo), entity, ResponseAdendumEnmiendaDTO.class);
logger.debug("Request: " + paramDTO + " Resonse: " + responseDTO);
//if(responseDTO.getResultado()) {
// //actualiza
// validacionGeneralesDAO.actualizaContratoSAP(contrato.getIdContratoOriginal(), paramDTO.getPosiciones().get(0).getCantidad());
//}
return responseDTO;
}
*/
public String printOrdenCompraRequest(ParamOrdenCompraDTO request) {
if (request != null) {
StringBuilder result = new StringBuilder();
String SEPARATOR_LINE = ", ";
String NEW_LINE = System.getProperty("line.separator");
result.append(NEW_LINE);
result.append(" [Header] ");
result.append(" sociedad: " + request.getSociedad() + SEPARATOR_LINE);
result.append(" claseDoc: " + request.getClaseDoc() + SEPARATOR_LINE);
result.append(" idProveedor: " + request.getIdProveedor() + SEPARATOR_LINE);
result.append(" orgCompras: " + request.getOrgCompras() + SEPARATOR_LINE);
result.append(" grupoCompras: " + request.getGrupoCompras() + SEPARATOR_LINE);
result.append(" fechaDoc: " + request.getFechaDoc() + SEPARATOR_LINE);
result.append(" referencia: " + request.getReferencia() + SEPARATOR_LINE);
result.append(" idContrato: " + request.getIdContrato() + SEPARATOR_LINE);
result.append(" expediente: " + request.getExpediente());
result.append(" [/Header] ");
result.append(NEW_LINE);
result.append(" [Body] ");
List<ItemOrdenCompraDTO> items = request.getItems();
if (items != null && items.size() > 0) {
for (ItemOrdenCompraDTO item : items) {
result.append(NEW_LINE);
result.append(" [Item] ");
result.append(" idPosicion: " + item.getIdPosicion() + SEPARATOR_LINE);
result.append(" idMaterial: " + item.getIdMaterial() + SEPARATOR_LINE);
result.append(" centro: " + item.getCentro() + SEPARATOR_LINE);
result.append(" cantidad: " + item.getCantidad() + SEPARATOR_LINE);
result.append(" precio: " + item.getPrecio() + SEPARATOR_LINE);
result.append(" indicadorIVA: " + item.getIndicadorIVA() + SEPARATOR_LINE);
result.append(" tipoImputacion: " + item.getTipoImputacion() + SEPARATOR_LINE);
result.append(" idPosicionAcc: " + item.getIdPosicionAcc() + SEPARATOR_LINE);
result.append(" centroCostos: " + item.getCentroCostos() + SEPARATOR_LINE);
result.append(" idOrden: " + item.getIdOrden());
result.append(" [/Item] ");
}
}
result.append(NEW_LINE);
result.append(" [/Body] ");
NEW_LINE = null;
return result.toString();
}
else
return null;
}
}
\ No newline at end of file
package com.mx.dla.dda.reporte.amortizacion.baseActivos.bos;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import org.apache.commons.io.FileUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import com.mx.dla.dda.reporte.ws.dtos.ParamGeneraReporteDTO;
import com.mx.dla.dda.reporte.ws.dtos.ResponseGeneraReporteDTO;
import com.mx.dla.dda.restClient.bos.DLARestClient;
import com.mx.dla.dda.restClient.bos.DLARestClientFactory;
import com.mx.dla.dda.restClient.constants.DLARestServices;
import com.mx.dla.global.bos.BaseBO;
@Component
public class BaseActivosBO extends BaseBO{
@Value("${uri.file.reporte.baseActivosSQL}")
protected String uriSQL;
@Autowired
private DLARestClientFactory dlaRestClientFactory;
ArrayList<String> textoSQLReporte = new ArrayList<String>();
ResponseGeneraReporteDTO responseDTO = null;
public ResponseGeneraReporteDTO generaReporteBaseActivos(String fileName, Long anio ) throws IOException
{
//--------- Se crea el archivo .sql en el servidor -------//
//--- Variable con el Query en un String ----------//
String fecha = anio.toString();
textoSQLReporte.clear();
textoSQLReporte.add("--[BEGIN]");
textoSQLReporte.add("select 'GRUPO|APARTADO|ID_SAP|ESTUDIO|CONTRATO|CONT_INICIO|CONT_FIN|ID|ID_BV|TITULO|TEMPORADA|EPISODIO|FECHA_INICIO|FECHA_FIN|COSTO|ANNIO|ENERO|FEBRERO|MARZO|ABRIL|MAYO|JUNIO|JULIO|AGOSTO|SEPTIEMBRE|OCTUBRE|NOVIEMBRE|DICIEMBRE|TOTAL|' as X from dual;");
textoSQLReporte.add("--[END_HEADER]");
textoSQLReporte.add("select GRUPO||'|'||APARTADO||'|'||ID_SAP||'|'||ESTUDIO||'|'||NUMERO_CONTRATO||'|'||C_FECHA_INICIO||'|'||C_FECHA_FIN||'|'||ID||'|'||ID_BV||'|'||TITULO||'|'||TEMPORADA||'|'||EPISODIO||'|'||FECHA_INICIO||'|'||FECHA_FIN||'|'||COSTO||'|'|| ");
textoSQLReporte.add(" ANNIO||'|'||MES_1||'|'||MES_2||'|'||MES_3||'|'||MES_4||'|'||MES_5||'|'||MES_6||'|'||MES_7||'|'||MES_8||'|'||MES_9||'|'||MES_10||'|'||MES_11||'|'||MES_12||'|'||(MES_1 + MES_2 + MES_3 + MES_4 + MES_5 + MES_6 + MES_7 + MES_8 + MES_9 + MES_10 + MES_11 + MES_12)||'|' as X");
textoSQLReporte.add(" from ( select NVL( GRUPO, '' ) as GRUPO, APARTADO, ID_SAP, NVL( ESTUDIO, 'Total' ) as ESTUDIO, NUMERO_CONTRATO, C_FECHA_INICIO, C_FECHA_FIN, ID_TITULO_CNTORIG as ID, ID_BV, TITULO, TEMPORADA, EPISODIO, FECHA_INICIO, FECHA_FIN, COSTO, ANNIO, ");
textoSQLReporte.add(" ROUND( SUM(MES_1), 4 ) as MES_1, ROUND( SUM(MES_2), 4 ) as MES_2, ROUND( SUM(MES_3), 4 ) as MES_3, ROUND( SUM(MES_4), 4 ) as MES_4, ROUND( SUM(MES_5), 4 ) as MES_5, ROUND( SUM(MES_6), 4 ) as MES_6, ROUND( SUM(MES_7), 4 ) as MES_7, ");
textoSQLReporte.add(" ROUND( SUM(MES_8), 4 ) as MES_8, ROUND( SUM(MES_9), 4 ) as MES_9, ROUND( SUM(MES_10), 4 ) as MES_10, ROUND( SUM(MES_11), 4 ) as MES_11, ROUND( SUM(MES_12), 4 ) as MES_12 ");
textoSQLReporte.add(" from ( select grp.DESC_GRUPO as GRUPO, ado.DESC_APARTADO as APARTADO, est.ID_SAP, est.DESC_ESTUDIO as ESTUDIO, sub.ID_CONTRATO_ORIGINAL, cnt.NUMERO_CONTRATO, to_char( cnt.FECHA_INICIO, 'dd/mm/yyyy' ) as C_FECHA_INICIO, to_char( cnt.FECHA_FIN, 'dd/mm/yyyy' ) as C_FECHA_FIN, ");
textoSQLReporte.add(" sub.ID_TITULO_CNTORIG, tit.TITULO, tit.TEMPORADA, tit.EPISODIO, tit.ID_BV, tit.COSTO, to_char( tit.FECHA_INICIO, 'dd/mm/yyyy' ) as FECHA_INICIO, to_char( tit.FECHA_FIN, 'dd/mm/yyyy' ) as FECHA_FIN, sub.ANNIO, sub.MES_1, sub.MES_2, sub.MES_3, sub.MES_4, sub.MES_5, sub.MES_6, sub.MES_7, sub.MES_8, sub.MES_9, sub.MES_10, sub.MES_11, sub.MES_12 ");
textoSQLReporte.add(" from ( select ID_CONTRATO_ORIGINAL, ID_TITULO_CNTORIG, ANNIO, SUM( MES_1 ) as MES_1, SUM( MES_2 ) as MES_2, SUM( MES_3 ) as MES_3, SUM( MES_4 ) as MES_4, SUM( MES_5 ) as MES_5, SUM( MES_6 ) as MES_6, SUM( MES_7 ) as MES_7, SUM( MES_8 ) as MES_8, SUM( MES_9 ) as MES_9, SUM( MES_10 ) as MES_10, SUM( MES_11 ) as MES_11, SUM( MES_12 ) as MES_12 ");
textoSQLReporte.add(" from ( select ID_CONTRATO_ORIGINAL, ID_TITULO_CNTORIG, ANNIO, NVL( MES_1, 0 ) as MES_1, NVL( MES_2, 0 ) as MES_2, NVL( MES_3, 0 ) as MES_3, NVL( MES_4, 0 ) as MES_4, NVL( MES_5, 0 ) as MES_5, NVL( MES_6, 0 ) as MES_6, NVL( MES_7, 0 ) as MES_7, NVL( MES_8, 0 ) as MES_8, NVL( MES_9, 0 ) as MES_9, NVL( MES_10, 0 ) as MES_10, NVL( MES_11, 0 ) as MES_11, NVL( MES_12, 0 ) as MES_12 ");
textoSQLReporte.add(" from ( select distinct amor.ID_CONTRATO_ORIGINAL, amor.ID_TITULO_CNTORIG, TO_NUMBER( TO_CHAR( amor.MES, 'yyyy' ) ) as ANNIO, TO_NUMBER( TO_CHAR( amor.MES, 'mm' ) ) as MESES, amor.MES, TO_NUMBER( amor.MONTO ) as MONTO from DDA_T_AMORTIZACION amor where TO_NUMBER( TO_CHAR( amor.MES, 'yyyy' ) ) = ");
textoSQLReporte.add( fecha );
textoSQLReporte.add(" ) PIVOT( SUM( MONTO ) FOR MESES in ( 1 as MES_1, 2 as MES_2, 3 as MES_3, 4 as MES_4, 5 as MES_5, 6 as MES_6, 7 as MES_7, 8 as MES_8, 9 as MES_9, 10 as MES_10, 11 as MES_11, 12 as MES_12 ) ) ) group by ID_CONTRATO_ORIGINAL, ID_TITULO_CNTORIG, ANNIO ) sub, ");
textoSQLReporte.add(" ( SELECT scnt.ID_CONTRATO_ORIGINAL as ID_CONTRATO, ct.ID_TITULO_CNTORIG, ct.ID_BV, ct.DESC_TITULO AS TITULO, ct.TEMPORADA, ct.EPISODIO, ct.FECHA_INICIO, ct.FECHA_FIN, ct.COSTO FROM DDA_T_CONTRATO_TITULO ct, ( SELECT ID_CONTRATO_ORIGINAL, MAX( ID_CONTRATO ) AS ID_CONTRATO FROM DDA_T_CONTRATO WHERE ID_TIPO_CONTRATO = 1 GROUP BY ID_CONTRATO_ORIGINAL ) scnt WHERE ct.ID_CONTRATO = scnt.ID_CONTRATO ) tit, ");
textoSQLReporte.add(" DDA_T_CONTRATO cnt, DDA_C_ESTUDIO est, DDA_C_ESTUDIO_GRUPO grp, DDA_T_APARTADO ado where sub.ID_CONTRATO_ORIGINAL = cnt.ID_CONTRATO and cnt.ID_ESTUDIO = est.ID_ESTUDIO and est.ID_GRUPO = grp.ID_GRUPO and sub.ID_TITULO_CNTORIG = tit.ID_TITULO_CNTORIG and cnt.ID_CONTRATO = tit.ID_CONTRATO ");
textoSQLReporte.add(" and cnt.ID_APARTADO = ado.ID_APARTADO and cnt.ID_ESTATUS in ( 4, 5, 6 ) ) group by grouping sets ( ( ANNIO ), ( GRUPO, APARTADO, ID_SAP, ESTUDIO, NUMERO_CONTRATO, C_FECHA_INICIO, C_FECHA_FIN, ID_TITULO_CNTORIG, ID_BV, TITULO, TEMPORADA, EPISODIO, FECHA_INICIO, FECHA_FIN, COSTO, ANNIO ) ) ORDER BY ANNIO, GRUPO nulls last, ESTUDIO nulls last, TITULO );");
textoSQLReporte.add("--[END]");
logger.info("Archivo: [{}]", fileName);
//File file = new File("C:\\Software\\apache-tomcat-7.0.67\\" + fileName + ".sql" );
File file = new File( uriSQL + fileName + ".sql" );
FileUtils.writeLines(file, textoSQLReporte);
logger.debug("busca archivo en [{}]",file.getAbsolutePath());
if( file.exists() )//-- Si se crea el archivo se ejecuta el WS
{
try{
logger.info("se envia el WS generaReporteWS.");
responseDTO = generaReporteWS(fileName);
}catch (Exception e){
logger.debug(e.toString());
}
}//Termina if( file.exists() )
return responseDTO;
}
public ResponseGeneraReporteDTO generaReporteWS( String archivo ) {
DLARestClient client = dlaRestClientFactory.getClient(DLARestServices.GENERA_REPORTE_AMORTIZACION_BA);
ParamGeneraReporteDTO request = new ParamGeneraReporteDTO();
logger.info("Antes de configurar parmetros.");
request.setNombreArchivo(archivo);
request.setFormato("txt");
request.setComprimir("y");
logger.info("Despues de configurar parmetros.");
logger.info("Request rest ReporteAmortBaseActivos [{}]",request);
ResponseGeneraReporteDTO response = client.get(request, ResponseGeneraReporteDTO.class);
logger.info("Response rest ReporteAmortBaseActivos [{}]",response);
return response;
}
}
\ No newline at end of file
package com.mx.dla.dda.reporte.cpview.bos;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import com.mx.dla.dda.excelMapper.bos.ExcelMapperTransform;
import com.mx.dla.dda.excelMapper.constants.ExcelMapperDataType;
import com.mx.dla.dda.excelMapper.context.ExcelMapperContext;
import com.mx.dla.dda.excelMapper.dtos.ExcelMapper;
import com.mx.dla.dda.excelMapper.dtos.ExcelRule;
import com.mx.dla.dda.excelMapper.exceptions.ExcelMapperException;
import com.mx.dla.dda.general.constants.MesesAnio;
import com.mx.dla.dda.general.utilerias.FechaUtilerias;
import com.mx.dla.dda.reporte.amortizacion.baseActivos.bos.BaseActivosBO;
import com.mx.dla.dda.reporte.cpview.daos.ReporteCostPerViewDAO;
import com.mx.dla.dda.reporte.cpview.dtos.CargaVisualizacionesDetalleDTO;
import com.mx.dla.dda.reporte.cpview.dtos.CargaVisualizacionesPrincipalDTO;
import com.mx.dla.dda.reporte.cpview.dtos.CostPerViewEstudioAnualDatosDTO;
import com.mx.dla.dda.reporte.cpview.dtos.CostPerViewEstudioMensualDatosDTO;
import com.mx.dla.dda.reporte.cpview.dtos.ParamCargaTitulosVSDTO;
import com.mx.dla.dda.reporte.cpview.dtos.ReporteCostPerViewVistaDTO;
import com.mx.dla.dda.reporte.cpview.dtos.ResponseCargaTitulosVSDTO;
import com.mx.dla.dda.reporte.cpview.dtos.VisualizacionesCostPerViewVistaDTO;
import com.mx.dla.dda.reporte.cpview.exception.ReportCostPerViewException;
import com.mx.dla.dda.reporte.ws.dtos.ResponseGeneraReporteDTO;
import com.mx.dla.dda.restClient.bos.DLARestClient;
import com.mx.dla.dda.restClient.bos.DLARestClientFactory;
import com.mx.dla.dda.restClient.constants.DLARestServices;
import com.mx.dla.global.bos.BaseBO;
import com.mx.dla.global.bos.CustomResourceLoader;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
@Service
public class ReporteCostoPerViewBO extends BaseBO {
@Autowired
private ReporteCostPerViewDAO reporteCostPerViewDAO;
@Autowired
protected ExcelMapperTransform excelMapperTransform;
@Autowired
private ExcelMapperContext excelMapperContext;
@Autowired
private DLARestClientFactory dlaRestClientFactory;
@Value("${uri.file.carga.visualizaciones}")
private String uriCarga;
@Autowired
private CustomResourceLoader customResourceLoader;
@Autowired
private BaseActivosBO baseActivosBO;
@Value("${uri.file.reporte.baseActivosSQL}")
protected String uriSQL;
public String[][] obtenReporteMensualTabla(Long anio, Long mes, Long idEstudio, Boolean consulta) throws IllegalArgumentException, IllegalAccessException {
String[][] tabla = null;
int tamanio = (3 * (mes.intValue())) + 1;
Comparator<CostPerViewEstudioMensualDatosDTO> comparator = new Comparator<CostPerViewEstudioMensualDatosDTO>() {
public int compare(CostPerViewEstudioMensualDatosDTO o1, CostPerViewEstudioMensualDatosDTO o2) {
return o1.getEstudio().compareTo(o2.getEstudio());
}
};
List<CostPerViewEstudioMensualDatosDTO> datos = null;
List<CostPerViewEstudioMensualDatosDTO> diciembre = null;
if (idEstudio == null) {
if (consulta) {
datos = reporteCostPerViewDAO.obtenerCostPerViewMensualDatosEstudioNivel(mes, anio);
diciembre = reporteCostPerViewDAO.obtenerCostPerViewDiciembreDatosEstudioNivel(anio - 1);
} else {
datos = reporteCostPerViewDAO.obtenerCostPerViewMensualDatosTituloNivel(mes, anio, idEstudio);
diciembre = reporteCostPerViewDAO.obtenerCostPerViewDiciembreDatosTituloNivel(anio - 1, idEstudio);
}
} else {
datos = reporteCostPerViewDAO.obtenerCostPerViewMensualDatosTituloNivel(mes, anio, idEstudio);
diciembre = reporteCostPerViewDAO.obtenerCostPerViewDiciembreDatosTituloNivel(anio - 1, idEstudio);
}
boolean dicFlag = diciembre != null && !diciembre.isEmpty();
Integer amorIdxEnero = 0;
Integer visIdxEnero = 1;
Integer cpvIdxEnero = 2;
Integer amorIdxDiciembre = 34;
if (datos != null && !datos.isEmpty()) {
if (dicFlag) {
Collections.sort(diciembre, comparator);
}
for (CostPerViewEstudioMensualDatosDTO item : datos) {
String[] fila = item.getFieldsAsRow();
String[] tfila = Arrays.copyOfRange(fila, 0, 1);
String[] sfila = Arrays.copyOfRange(fila, 1, tamanio);
String[] afila = Arrays.copyOfRange(fila, fila.length - 4, fila.length);
if (dicFlag) {
int i = Collections.binarySearch(diciembre, item, comparator);
if (i >= 0) {
CostPerViewEstudioMensualDatosDTO found = diciembre.get(i);
String[] arowDic = found.getFieldsAsRow();
if (sfila[visIdxEnero] == null || new Double(sfila[visIdxEnero]) == 0) {
sfila[cpvIdxEnero] = "0.0";
} else if (sfila[amorIdxEnero] == null || new Double(sfila[amorIdxEnero]) == 0) {
if (arowDic[amorIdxDiciembre] != null) {
sfila[cpvIdxEnero] = new Double(new Double(arowDic[amorIdxDiciembre]) / new Double(sfila[visIdxEnero])).toString();
}
}
}
}
Double sumatoriaAmor = 0.0;
Double sumatoriaVis = 0.0;
for (int i = 0; i < sfila.length; i++) {
if (i % 3 == 0) {
sumatoriaAmor = sumatoriaAmor + new Double(sfila[i]);
}
if (i % 3 == 1) {
sumatoriaVis = sumatoriaVis + new Double(sfila[i]);
}
}
afila[0] = String.format("%.2f", sumatoriaAmor);
afila[1] = String.format("%.2f", sumatoriaVis);
Double cpv = sumatoriaAmor / sumatoriaVis;
if (!cpv.isInfinite()) {
afila[2] = String.format("%.2f", cpv);
} else {
afila[2] = "";
}
String[] row = ArrayUtils.addAll(ArrayUtils.addAll(tfila, sfila), afila);
if (tabla == null) {
tabla = new String[1][row.length];
} else {
tabla = Arrays.copyOf(tabla, tabla.length + 1);
}
tabla[tabla.length - 1] = row;
}
}
return tabla;
}
public String[][] obtenReporteAnualTabla(Long anio, Long mes, Long idEstudio, Boolean consulta) throws IllegalArgumentException, IllegalAccessException {
String[][] tabla = null;
String pivot_date = "";
Integer fanio = anio.intValue();
for (int anios = (fanio - 4), i = 0; anios <= fanio; anios++, i++) {
pivot_date = pivot_date + anios + " AS ANIO_" + i + ",";
}
List<CostPerViewEstudioAnualDatosDTO> datos = null;
if (idEstudio == null) {
if (consulta) {
datos = reporteCostPerViewDAO.obtenerCostPerViewAnualDatosEstudioNivel(anio - 4, anio, mes, pivot_date.substring(0, pivot_date.length() - 1));
} else {
datos = reporteCostPerViewDAO.obtenerCostPerViewAnualDatosTituloNivel(anio - 4, anio, mes, pivot_date.substring(0, pivot_date.length() - 1), idEstudio);
}
} else {
datos = reporteCostPerViewDAO.obtenerCostPerViewAnualDatosTituloNivel(anio - 4, anio, mes, pivot_date.substring(0, pivot_date.length() - 1), idEstudio);
}
if (datos != null && !datos.isEmpty()) {
for (CostPerViewEstudioAnualDatosDTO item : datos) {
String[] fila = item.getFieldsAsRow();
String[] tfila = Arrays.copyOfRange(fila, 0, 1);
String[] sfila = Arrays.copyOfRange(fila, 1, fila.length - 4);
String[] afila = Arrays.copyOfRange(fila, fila.length - 4, fila.length);
Double sumatoriaAmor = 0.0;
Double sumatoriaVis = 0.0;
for (int i = 0; i < sfila.length; i++) {
if (i % 3 == 0) {
sumatoriaAmor = sumatoriaAmor + new Double(sfila[i]);
}
if (i % 3 == 1) {
sumatoriaVis = sumatoriaVis + new Double(sfila[i]);
}
}
afila[0] = String.format("%.2f", sumatoriaAmor);
afila[1] = String.format("%.2f", sumatoriaVis);
Double cpv = sumatoriaAmor / sumatoriaVis;
if (!cpv.isInfinite()) {
afila[2] = String.format("%.2f", cpv);
} else {
afila[2] = "";
}
String[] row = ArrayUtils.addAll(ArrayUtils.addAll(tfila, sfila), afila);
if (tabla == null) {
tabla = new String[1][row.length];
} else {
tabla = Arrays.copyOf(tabla, tabla.length + 1);
}
tabla[tabla.length - 1] = row;
}
}
return tabla;
}
public String[] obtenerMesesTabla(Long anio, Long mes) {
List<String> meses = new ArrayList<String>();
for (int i = 1; i <= mes.intValue(); i++) {
MesesAnio ames = MesesAnio.parse("" + i);
meses.add(ames.getDesc() + " - " + anio);
}
meses.add("ACUMULADO");
String[] mesesArr = new String[meses.size()];
mesesArr = meses.toArray(mesesArr);
return mesesArr;
}
public String[] obtenerAniosTabla(Long anio) {
List<String> anios = new ArrayList<String>();
for (int i = anio.intValue() - 4; i <= anio.intValue(); i++) {
anios.add("" + i);
}
anios.add("ACUMULADO");
String[] aniosArr = new String[anios.size()];
aniosArr = anios.toArray(aniosArr);
return aniosArr;
}
public String[] obtenerHeaderRubro(Long tamanio) {
List<String> rubros = new ArrayList<String>();
for (int i = 0; i < tamanio + 1; i++) {
rubros.add("Amortizacin");
rubros.add("Visualizaciones");
rubros.add("CPV");
}
String[] rubrosArr = new String[rubros.size()];
rubrosArr = rubros.toArray(rubrosArr);
return rubrosArr;
}
public ReporteCostPerViewVistaDTO obtenerReporteMensualVista(String fecha, Long idEstudio, Boolean consulta) throws ParseException, IllegalArgumentException, IllegalAccessException {
ReporteCostPerViewVistaDTO reporte = new ReporteCostPerViewVistaDTO();
HashMap<String, Long> fechaSplit = FechaUtilerias.getFechaValores(fecha, "MM/yyyy");
Long mes = fechaSplit.get("Month");
Long anio = fechaSplit.get("Year");
reporte.setTabla(obtenReporteMensualTabla(anio, mes, idEstudio, consulta));
reporte.setPheader(obtenerMesesTabla(anio, mes));
reporte.setRheader(obtenerHeaderRubro(mes));
return reporte;
}
public ReporteCostPerViewVistaDTO obtenerReporteAnualVista(String fecha, Long idEstudio, Boolean consulta) throws ParseException, IllegalArgumentException, IllegalAccessException {
ReporteCostPerViewVistaDTO reporte = new ReporteCostPerViewVistaDTO();
HashMap<String, Long> fechaSplit = FechaUtilerias.getFechaValores(fecha, "MM/yyyy");
Long mes = fechaSplit.get("Month");
Long anio = fechaSplit.get("Year");
reporte.setTabla(obtenReporteAnualTabla(anio, mes, idEstudio, consulta));
reporte.setPheader(obtenerAniosTabla(anio));
reporte.setRheader(obtenerHeaderRubro(5L));
return reporte;
}
public InputStream obtenerStreamReporte(String tipoReporte, String fecha, Long idEstudio)
throws IllegalArgumentException, IllegalAccessException, ParseException, ExcelMapperException, IOException, ReportCostPerViewException {
ReporteCostPerViewVistaDTO reporte = null;
ExcelMapper mapper = new ExcelMapper();
List<ExcelRule> rules = new ArrayList<ExcelRule>();
InputStream stream = null;
byte[] info = null;
if (tipoReporte.equals("mensual")) {
reporte = obtenerReporteMensualVista(fecha, idEstudio, false);
}
if (tipoReporte.equals("anual")) {
reporte = obtenerReporteAnualVista(fecha, idEstudio, false);
}
String[][] tabla = reporte.getTabla();
String[] rheader = reporte.getRheader();
String[] pheader = reporte.getPheader();
String[] apheader = new String[rheader.length + 1];
String[] arheader = new String[rheader.length + 1];
int j = 0;
for (int i = 0; i < rheader.length; i++) {
if (i == 0) {
apheader[i] = "Estudio";
} else if ((i - 1) % 3 == 0) {
apheader[i] = pheader[j];
j++;
} else {
apheader[i] = "";
}
}
for (int i = 0; i < arheader.length; i++) {
if (i == 0) {
arheader[i] = "";
} else {
arheader[i] = rheader[i - 1];
}
}
mapper.setClassName(ReporteCostPerViewVistaDTO.class.getName());
mapper.setFirstRow(2);
mapper.setId("reporteCostPerView");
mapper.setParent(null);
mapper.setSkipErrors(true);
mapper.setStartRowIndex(0);
for (int i = 0; i < tabla[0].length - 1; i++) {
ExcelRule rule = new ExcelRule();
List<String> headers = new ArrayList<String>();
rule.setColumn(getExcelColumnName(i + 1));
headers.add(apheader[i]);
headers.add(arheader[i]);
rule.setHeaders(headers);
if (i > 0) {
rule.setType(ExcelMapperDataType.numeric);
}
rules.add(rule);
}
mapper.setRules(rules);
info = excelMapperTransform.transformObjectToExcel(tabla, mapper, String.class);
stream = new ByteArrayInputStream(info);
return stream;
}
public HashMap<String, HashMap<String, String>> obtenerDataQueryDetalleMensual(String fecha) throws IOException, ParseException, InvalidFormatException {
String header_1 = "SELECT '";
String header_2 = "SELECT 'Estudio";
String detalleMensual = "SELECT ESTUDIO";
String amortizaciones = "";
String visualizaciones = "";
HashMap<String, Long> fechaSplit = FechaUtilerias.getFechaValores(fecha, "MM/yyyy");
Long mes = fechaSplit.get("Month");
Long anio = fechaSplit.get("Year");
logger.info("{}", mes);
logger.info("{}", anio);
SimpleDateFormat formater = new SimpleDateFormat("MM/yyyy");
Calendar beginCalendar = Calendar.getInstance();
Calendar finishCalendar = Calendar.getInstance();
beginCalendar.setTime(formater.parse("1" + "/" + anio));
finishCalendar.setTime(formater.parse(mes + "/" + anio));
Integer index = 1;
while (beginCalendar.before(finishCalendar) || beginCalendar.equals(finishCalendar)) {
MesesAnio ames = MesesAnio.parse("" + index);
header_1 = header_1 + "|||" + ames.getDesc();
header_2 = header_2 + "|Amortizacion_" + index + "|Visualizaciones_" + index + "|CPV_" + index;
detalleMensual = detalleMensual + "||'|'||AMOR_" + index + "||'|'||VIS_" + index + "||'|'||CPV_" + index;
amortizaciones = amortizaciones + "AMOR_" + index + "+";
visualizaciones = visualizaciones + "VIS_" + index + "+";
beginCalendar.add(Calendar.MONTH, 1);
index++;
}
header_1 = header_1 + "|||ACUMULADO|' as X from dual;";
header_2 = header_2 + "|AmortizacionT|VisualizacionesT|CPVT|' as X from dual;";
amortizaciones = amortizaciones.substring(0, amortizaciones.length() - 1);
visualizaciones = visualizaciones.substring(0, visualizaciones.length() - 1);
detalleMensual = detalleMensual + "|| '|' || (" + amortizaciones + ") || '|' || (" + visualizaciones + ") || '|' || ROUND((" + amortizaciones + ")/(" + visualizaciones + "), 2) FROM (";
logger.info("{}", header_1);
logger.info("{}", header_2);
logger.info("{}", amortizaciones);
logger.info("{}", visualizaciones);
logger.info("{}", detalleMensual);
HashMap<String, String> headers = new HashMap<String, String>();
headers.put("header_0", header_1);
headers.put("header_1", header_2);
HashMap<String, String> bheaders = new HashMap<String, String>();
bheaders.put("bheader_0", detalleMensual);
HashMap<String, String> parameters = new HashMap<String, String>();
parameters.put("anio", anio.toString());
parameters.put("mes", mes.toString());
HashMap<String, HashMap<String, String>> customData = new HashMap<String, HashMap<String, String>>();
customData.put("HEADERS", headers);
customData.put("BHEADERS", bheaders);
customData.put("PARAMETERS", parameters);
return customData;
}
public HashMap<String, HashMap<String, String>> obtenerDataQueryDetalleAnual(String fecha) throws IOException, ParseException, InvalidFormatException {
String header_1 = "SELECT '";
String header_2 = "SELECT 'Estudio";
String detalleMensual = "SELECT ESTUDIO";
String amortizaciones = "";
String visualizaciones = "";
String pivot_data = "";
HashMap<String, Long> fechaSplit = FechaUtilerias.getFechaValores(fecha, "MM/yyyy");
Long mes = fechaSplit.get("Month");
Long anio = fechaSplit.get("Year");
logger.info("{}", mes);
logger.info("{}", anio);
SimpleDateFormat formater = new SimpleDateFormat("MM/yyyy");
Calendar beginCalendar = Calendar.getInstance();
Calendar finishCalendar = Calendar.getInstance();
beginCalendar.setTime(formater.parse("1" + "/" + anio));
finishCalendar.setTime(formater.parse(mes + "/" + anio));
Integer fanio = anio.intValue();
Integer index = 1;
for (int anios = (fanio - 4), i = 0; anios <= fanio; anios++, i++) {
header_1 = header_1 + "|||" + anios;
header_2 = header_2 + "|Amortizacion_" + index + "|Visualizaciones_" + index + "|CPV_" + index;
detalleMensual = detalleMensual + "||'|'||AMOR_ANIO_" + index + "||'|'||VIS_ANIO_" + index + "||'|'||CPV_ANIO_" + index;
amortizaciones = amortizaciones + "AMOR_ANIO_" + index + "+";
visualizaciones = visualizaciones + "VIS_ANIO_" + index + "+";
pivot_data = pivot_data + anios + " AS ANIO_" + i + ",";
beginCalendar.add(Calendar.MONTH, 1);
index++;
}
header_1 = header_1 + "|||ACUMULADO|' as X from dual;";
header_2 = header_2 + "|AmortizacionT|VisualizacionesT|CPVT|' as X from dual;";
amortizaciones = amortizaciones.substring(0, amortizaciones.length() - 1);
visualizaciones = visualizaciones.substring(0, visualizaciones.length() - 1);
pivot_data = pivot_data.substring(0, pivot_data.length() - 1);
detalleMensual = detalleMensual + "|| '|' || (" + amortizaciones + ") || '|' || (" + visualizaciones + ") || '|' || ROUND((" + amortizaciones + ")/(" + visualizaciones + "), 2) FROM (";
logger.info("{}", header_1);
logger.info("{}", header_2);
logger.info("{}", amortizaciones);
logger.info("{}", visualizaciones);
logger.info("{}", detalleMensual);
HashMap<String, String> headers = new HashMap<String, String>();
headers.put("header_0", header_1);
headers.put("header_1", header_2);
HashMap<String, String> bheaders = new HashMap<String, String>();
bheaders.put("bheader_0", detalleMensual);
HashMap<String, String> parameters = new HashMap<String, String>();
parameters.put("anio_final", anio.toString());
parameters.put("anio_inicial", new Long(fanio - 4).toString());
parameters.put("mes", mes.toString());
parameters.put("pivot_data", pivot_data);
HashMap<String, HashMap<String, String>> customData = new HashMap<String, HashMap<String, String>>();
customData.put("HEADERS", headers);
customData.put("BHEADERS", bheaders);
customData.put("PARAMETERS", parameters);
return customData;
}
public InputStream obtenerStreamZipReporte(String tipoReporte, String fecha) throws InvalidFormatException, IOException, ParseException {
String finalQueryNameFile = "cpvDetalle";
String baseQueryNameFile = "";
HashMap<String, HashMap<String, String>> customData = obtenerDataQueryDetalleMensual(fecha);
if (tipoReporte.equals("mensual")) {
baseQueryNameFile = "queryCpvDetalleMensual.txt";
customData = obtenerDataQueryDetalleMensual(fecha);
}
if (tipoReporte.equals("anual")) {
baseQueryNameFile = "queryCpvDetalleAnual.txt";
customData = obtenerDataQueryDetalleAnual(fecha);
}
if (creaQueryDetalleCpv(customData, baseQueryNameFile, finalQueryNameFile)) {
return creaStreamZipFileCpv(finalQueryNameFile);
} else {
return null;
}
}
private Boolean creaQueryDetalleCpv(HashMap<String, HashMap<String, String>> customData, String baseQueryNameFile, String finalQueryNameFile) {
try {
InputStream queryStream;
queryStream = customResourceLoader.getFile2ItputStream("classpath:templateFees/" + baseQueryNameFile);
FileWriter fw = new FileWriter(uriSQL + finalQueryNameFile + ".sql");
String lineSeparador = System.getProperty("line.separator");
fw.write("--[BEGIN]");
fw.write(lineSeparador);
HashMap<String, String> headers = customData.get("HEADERS");
for (int i = 0; i < headers.size(); i++) {
fw.write(headers.get("header_" + i));
fw.write(lineSeparador);
}
fw.write("--[END_HEADER]");
fw.write(lineSeparador);
HashMap<String, String> bheaders = customData.get("BHEADERS");
for (int i = 0; i < bheaders.size(); i++) {
fw.write(bheaders.get("bheader_" + i));
fw.write(lineSeparador);
}
BufferedReader in = new BufferedReader(new InputStreamReader(queryStream));
String line = null;
HashMap<String, String> parameters = customData.get("PARAMETERS");
while ((line = in.readLine()) != null) {
if (line != null) {
for (Map.Entry<String, String> entry : parameters.entrySet()) {
line = line.replace("#{" + entry.getKey() + "}", entry.getValue());
}
fw.write(line);
fw.write(lineSeparador);
}
}
if (bheaders.size() > 0) {
for (int i = 0; i < bheaders.size(); i++) {
fw.write(")");
}
fw.write(";");
fw.write(lineSeparador);
}
fw.write("--[END]");
fw.write(lineSeparador);
fw.close();
} catch (InvalidFormatException | IOException e) {
return false;
}
return true;
}
private InputStream creaStreamZipFileCpv(String finalQueryNameFile) {
File file = new File(uriSQL + finalQueryNameFile + ".sql");
InputStream zipStream = null;
ResponseGeneraReporteDTO responseDTO = new ResponseGeneraReporteDTO();
if (file.exists()) {
try {
responseDTO = baseActivosBO.generaReporteWS(finalQueryNameFile);
if (responseDTO != null && responseDTO.getMensaje().contains("OK") && responseDTO.getRuta() != null) {
File zipFile = new File(responseDTO.getRuta());
if (zipFile != null && zipFile.exists()) {
zipStream = new FileInputStream(zipFile);
}
}
} catch (Exception e) {
logger.debug(e.toString());
}
}
return zipStream;
}
public void procesarStreamArchivoCarga(File archivo, String nombreArchivo, String fecha, String expediente) throws ParseException, IOException, ReportCostPerViewException {
logger.info("Procesando ...");
logger.info("{}", archivo);
logger.info("{}", nombreArchivo);
HashMap<String, Long> fechaSplit = FechaUtilerias.getFechaValores(fecha, "MM/yyyy");
Long mes = fechaSplit.get("Month");
Long anio = fechaSplit.get("Year");
ParamCargaTitulosVSDTO request = new ParamCargaTitulosVSDTO();
ResponseCargaTitulosVSDTO response = null;
DLARestClient client = null;
String fileName = StringUtils.leftPad(String.valueOf(mes), 2, "0") + StringUtils.leftPad(String.valueOf(anio), 4, "0") + expediente + nombreArchivo;
String absoluteFileName = uriCarga + fileName;
byte[] file = FileUtils.readFileToByteArray(archivo);
File d = new File(absoluteFileName);
d.setExecutable(true, false);
d.setReadable(true, false);
d.setWritable(true, false);
FileUtils.writeByteArrayToFile(d, file);
logger.info("Archivo: [{}]", absoluteFileName);
String separador = "/";
client = dlaRestClientFactory.getClient(DLARestServices.WS_CARGA_ARCHIVO_VISUALIZACIONES);
request.setNombreArchivo(fileName);
request.setExpediente(expediente);
request.setMesCarga("01" + separador + StringUtils.leftPad(String.valueOf(mes), 2, "0") + separador + StringUtils.leftPad(String.valueOf(anio), 4, "0"));
logger.debug("request : [{}]", request);
logger.debug("client!!! : [{}]", client);
response = client.get(request, ResponseCargaTitulosVSDTO.class);
logger.debug("response : [{}]", response);
if (response != null && !response.isResultado()) {
throw new ReportCostPerViewException("Error servicio carga: " + response.getMensaje());
}
}
public static String getExcelColumnName(int number) {
final StringBuilder sb = new StringBuilder();
int num = number - 1;
while (num >= 0) {
int numChar = (num % 26) + 65;
sb.append((char) numChar);
num = (num / 26) - 1;
}
return sb.reverse().toString();
}
public VisualizacionesCostPerViewVistaDTO obtenerCargaVisualizacionesMensualVista(String fecha)
throws ParseException, IllegalArgumentException, IllegalAccessException, ReportCostPerViewException {
VisualizacionesCostPerViewVistaDTO reporte = new VisualizacionesCostPerViewVistaDTO();
VisualizacionesCostPerViewVistaDTO response = new VisualizacionesCostPerViewVistaDTO();
HashMap<String, Long> fechaSplit = FechaUtilerias.getFechaValores(fecha, "MM/yyyy");
Long mes = fechaSplit.get("Month");
Long anio = fechaSplit.get("Year");
DateFormat formatoEntrada = new SimpleDateFormat("MM/yyyy");
Date date = formatoEntrada.parse(fecha);
if (FechaUtilerias.monthGreatherThan(date, new Date())) {
throw new ReportCostPerViewException("Mes elegido es mayor al mes actual");
}
response = obtenCargaVisualizacionesPrincipalTabla(fecha);
reporte.setHeader(obtenerHeaderTablaCargaVisualizaciones());
if (response != null) {
reporte.setTabla(obtenCargaVisualizacionesDetalleTabla(anio, mes));
reporte.setCorrectos(response.getCorrectos());
reporte.setErroneos(response.getErroneos());
reporte.setLeidos(response.getLeidos());
}
return reporte;
}
public String[][] obtenCargaVisualizacionesDetalleTabla(Long anio, Long mes) throws IllegalArgumentException, IllegalAccessException {
String[][] tabla = null;
List<CargaVisualizacionesDetalleDTO> datos = reporteCostPerViewDAO.obtenerVisualizaciones(mes, anio);
if (datos != null && !datos.isEmpty()) {
for (CargaVisualizacionesDetalleDTO item : datos) {
String[] arow = item.getFieldsAsRow();
String[] row = {arow[2], arow[3], arow[4]};
if (tabla == null) {
tabla = new String[1][row.length];
} else {
tabla = Arrays.copyOf(tabla, tabla.length + 1);
}
tabla[tabla.length - 1] = row;
}
}
return tabla;
}
public VisualizacionesCostPerViewVistaDTO obtenCargaVisualizacionesPrincipalTabla(String fecha)
throws ParseException, IllegalArgumentException, IllegalAccessException, ReportCostPerViewException {
VisualizacionesCostPerViewVistaDTO reporte = null;
HashMap<String, Long> fechaSplit = FechaUtilerias.getFechaValores(fecha, "MM/yyyy");
Long mes = fechaSplit.get("Month");
Long anio = fechaSplit.get("Year");
DateFormat formatoEntrada = new SimpleDateFormat("MM/yyyy");
Date date = formatoEntrada.parse(fecha);
if (FechaUtilerias.monthGreatherThan(date, new Date())) {
throw new ReportCostPerViewException("Mes elegido es mayor al mes actual");
}
List<CargaVisualizacionesPrincipalDTO> datos = reporteCostPerViewDAO.obtenerVisualizacionesPrincipal(mes, anio);
if (datos != null && !datos.isEmpty()) {
reporte = new VisualizacionesCostPerViewVistaDTO();
LinkedList<CargaVisualizacionesPrincipalDTO> lista = new LinkedList<CargaVisualizacionesPrincipalDTO>(datos);
reporte.setLeidos(lista.getFirst().getTotalRegistros());
reporte.setCorrectos(lista.getFirst().getTotalCargados());
reporte.setErroneos(lista.getFirst().getTotalError());
}
return reporte;
}
public String[] obtenerHeaderTablaCargaVisualizaciones() {
String[] header = {"Id Broadview", "Nombre del Ttulo", "Visualizaciones"};
return header;
}
public InputStream obtenerStreamVisualizaciones(String fecha) throws IllegalArgumentException, IllegalAccessException, ParseException, ExcelMapperException, IOException {
List<CargaVisualizacionesDetalleDTO> reporte = null;
ExcelRule newRule = new ExcelRule();
InputStream stream = null;
byte[] info = null;
ExcelMapper mapper = excelMapperContext.getExcelMapper("plantillaVisualizacionesCostPerView");
newRule.setAttribute("comentarios");
newRule.setColumn("E");
newRule.setHeader("Comentarios");
mapper.getRules().add(newRule);
HashMap<String, Long> fechaSplit = FechaUtilerias.getFechaValores(fecha, "MM/yyyy");
Long mes = fechaSplit.get("Month");
Long anio = fechaSplit.get("Year");
reporte = reporteCostPerViewDAO.obtenerVisualizacionesDetalle(mes, anio);
info = excelMapperTransform.transformObjectToExcel(reporte, mapper, CargaVisualizacionesDetalleDTO.class);
stream = new ByteArrayInputStream(info);
return stream;
}
public InputStream obtenerStreamPlantilla() throws IllegalArgumentException, IllegalAccessException, ParseException, ExcelMapperException, IOException, InvalidFormatException {
InputStream stream = null;
byte[] info = null;
info = customResourceLoader.getFile2ByteArray("classpath:templateFees/plantillaCargaVS.xlsx");
stream = new ByteArrayInputStream(info);
return stream;
}
public String logStringArray(String[] array) {
String log = "";
if (array != null && array.length != 0) {
for (String item : array) {
log = log + "[" + item + "] ";
}
}
return log;
}
}
\ No newline at end of file
......@@ -2,7 +2,7 @@
#Development version
ordenInterna.idPosicion=00010
ordenInterna.idMaterial.suscripcion=300000000
ordenInterna.idMaterial.suscripcion=400000010
ordenInterna.idMaterial.transaccines=300000004
ordenInterna.idMaterial.licenseFee=300000104
......@@ -24,7 +24,7 @@ ordenInterna.claseDoc.t=NT08
ordenInterna.claseDoc.a=CD06
ordenInterna.claseDoc.na=CD06
ordenInterna.idProveedor=0030800000
ordenInterna.idProveedor=3001000056
ordenInterna.orgCompras=AMCO
ordenInterna.grupoCompras=N06
......@@ -76,7 +76,7 @@ uri.rest.reporte.amortizacion.baseActivos = http://${servidor.rest.ws}/DDA_WSB_P
uri.ws.carga.visualizaciones.procesa = http://${servidor.rest.ws}/DDA_WSB_Procesos/services/proceso/procesarCargaTitulosVS
uri.rest.titulosBroadView = http://localhost:5000/v1/broadview/titulos/
uri.rest.titulosBroadView = http://localhost:5001/v1/broadview/titulos/
#*************************Propiedades para Facturacion*******************
#sociedad tambien se usa en Nota Credito
......
No preview for this file type
#Generated by Maven
#Mon Dec 05 14:50:45 CST 2022
#Fri May 12 12:25:24 CDT 2023
version=1.1
groupId=com.mx.dla
artifactId=servicios
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment