Cambios ultimas correcciones sap

parent b439c59e
# Created by https://www.toptal.com/developers/gitignore/api/maven,netbeans,java,eclipse
# Edit at https://www.toptal.com/developers/gitignore?templates=maven,netbeans,java,eclipse
### Eclipse ###
.metadata
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.settings/
.loadpath
.recommenders
# External tool builders
.externalToolBuilders/
# Locally stored "Eclipse launch configurations"
*.launch
# PyDev specific (Python IDE for Eclipse)
*.pydevproject
# CDT-specific (C/C++ Development Tooling)
.cproject
# CDT- autotools
.autotools
# Java annotation processor (APT)
.factorypath
# PDT-specific (PHP Development Tools)
.buildpath
# sbteclipse plugin
.target
# Tern plugin
.tern-project
# TeXlipse plugin
.texlipse
# STS (Spring Tool Suite)
.springBeans
# Code Recommenders
.recommenders/
# Annotation Processing
.apt_generated/
.apt_generated_test/
# Scala IDE specific (Scala & Java development for Eclipse)
.cache-main
.scala_dependencies
.worksheet
# Uncomment this line if you wish to ignore the project description file.
# Typically, this file would be tracked if it contains build/dependency configurations:
#.project
### Eclipse Patch ###
# Spring Boot Tooling
.sts4-cache/
### Java ###
# Compiled class file
*.class
# Log file
*.log
# BlueJ files
*.ctxt
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
### Maven ###
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
# https://github.com/takari/maven-wrapper#usage-without-binary-jar
.mvn/wrapper/maven-wrapper.jar
### Maven Patch ###
# Eclipse m2e generated files
# Eclipse Core
.project
# JDT-specific (Eclipse Java Development Tools)
.classpath
### NetBeans ###
**/nbproject/private/
**/nbproject/Makefile-*.mk
**/nbproject/Package-*.bash
build/
nbbuild/
dist/
nbdist/
.nb-gradle/
# End of https://www.toptal.com/developers/gitignore/api/maven,netbeans,java,eclipse
......@@ -130,7 +130,7 @@
<bean id="triggerExhibicion_DDA" class="org.springframework.scheduling.quartz.CronTriggerBean"
p:jobDetail-ref="cronExhibicion_DDA"
p:startDelay="1000"
p:cronExpression="0 0 10 * * ? *">
p:cronExpression="0 5 13 * * ? *">
<!-- p:cronExpression="0 0 4,5,6,7 * * ? *" -->
<!-- Seconds Minutes Hours Day-Month Month Day-Week Year -->
......
......@@ -574,8 +574,7 @@ or ant -Dj2ee.platform.classpath=&lt;server_classpath&gt; (where no properties f
<formatter type="brief" usefile="false"/>
<formatter type="xml"/>
<jvmarg value="-ea"/>
<jvmarg line="${debug-args-line}"/>
<jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
<jvmarg value="-agentlib:jdwp=transport=${debug-transport},address=${jpda.address}"/>
<customize/>
</junit>
</sequential>
......@@ -604,8 +603,7 @@ or ant -Dj2ee.platform.classpath=&lt;server_classpath&gt; (where no properties f
<formatter type="xml"/>
<jvmarg value="-ea"/>
<jvmarg line="${run.jvmargs.ide}"/>
<jvmarg line="${debug-args-line}"/>
<jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
<jvmarg value="-agentlib:jdwp=transport=${debug-transport},address=${jpda.address}"/>
<customize/>
</junit>
</sequential>
......@@ -763,18 +761,6 @@ or ant -Dj2ee.platform.classpath=&lt;server_classpath&gt; (where no properties f
</macrodef>
</target>
<target name="-init-debug-args">
<property name="version-output" value="java version &quot;${ant.java.version}"/>
<condition property="have-jdk-older-than-1.4">
<or>
<contains string="${version-output}" substring="java version &quot;1.0"/>
<contains string="${version-output}" substring="java version &quot;1.1"/>
<contains string="${version-output}" substring="java version &quot;1.2"/>
<contains string="${version-output}" substring="java version &quot;1.3"/>
</or>
</condition>
<condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
<istrue value="${have-jdk-older-than-1.4}"/>
</condition>
<condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem">
<os family="windows"/>
</condition>
......@@ -791,8 +777,7 @@ or ant -Dj2ee.platform.classpath=&lt;server_classpath&gt; (where no properties f
<sequential>
<java classname="@{classname}" fork="true">
<jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
<jvmarg line="${debug-args-line}"/>
<jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
<jvmarg value="-agentlib:jdwp=transport=${debug-transport},address=${jpda.address}"/>
<jvmarg line="${runmain.jvmargs}"/>
<classpath>
<path path="@{classpath}"/>
......@@ -1545,6 +1530,7 @@ exists or setup the property manually. For example like this:
</target>
<target depends="init,compile-test,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
<target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test-method" name="debug-test-method"/>
<target depends="debug-test-method" name="debug-single-method"/>
<target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
<webproject1:nbjpdareload dir="${build.test.classes.dir}"/>
</target>
......
build.xml.data.CRC32=19afd040
build.xml.script.CRC32=4631037c
build.xml.stylesheet.CRC32=651128d4@1.77.1.1
build.xml.stylesheet.CRC32=1707db4f@1.89.0.1
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
nbproject/build-impl.xml.data.CRC32=19afd040
nbproject/build-impl.xml.script.CRC32=0def5d00
nbproject/build-impl.xml.stylesheet.CRC32=99ea4b56@1.77.1.1
nbproject/build-impl.xml.script.CRC32=ec03d845
nbproject/build-impl.xml.stylesheet.CRC32=334708a0@1.89.0.1
nbproject/jaxws-build.xml.stylesheet.CRC32=6608c2cf
<?xml version="1.0" encoding="UTF-8"?><!--
*** GENERATED FROM jax-ws.xml - DO NOT EDIT ! ***
*** TO MODIFY wsimport options USE Web Service node -> Edit WS Attributes ***
*** TO CHANGE TARGETS GENERATED TO jaxws-build.xml COPY THOSE ***
*** TARGETS TO ../build.xml AND MODIFY THAT FILE INSTEAD ***
--><project xmlns:xalan="http://xml.apache.org/xslt" xmlns:webproject2="http://www.netbeans.org/ns/web-project/2" xmlns:jaxws="http://www.netbeans.org/ns/jax-ws/1">
<!--
===================
JAX-WS WSGEN SECTION
===================
-->
<!--
===================
JAX-WS WSIMPORT SECTION
===================
-->
</project>
......@@ -2,6 +2,10 @@
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
<group/>
<group>
<file>file:/C:/Users/jfmj_/Documents/DDA/Githg/DDA_CRN_Exhibicion/src/mx/com/amx/mx/dda/crn/DDAExhibicion.java</file>
<file>file:/C:/Users/jfmj_/Documents/DDA/Githg/DDA_CRN_Exhibicion/src/mx/com/amx/mx/dda/crn/bo/DDAExhibicionBO.java</file>
<file>file:/C:/Users/jfmj_/Documents/DDA/Githg/DDA_CRN_Exhibicion/src/mx/com/amx/mx/dda/crn/dao/DDAExhibicionDAO.java</file>
</group>
</open-files>
</project-private>
......@@ -130,7 +130,7 @@
<bean id="triggerExhibicion_DDA" class="org.springframework.scheduling.quartz.CronTriggerBean"
p:jobDetail-ref="cronExhibicion_DDA"
p:startDelay="1000"
p:cronExpression="0 0 10 * * ? *">
p:cronExpression="0 5 13 * * ? *">
<!-- p:cronExpression="0 0 4,5,6,7 * * ? *" -->
<!-- Seconds Minutes Hours Day-Month Month Day-Week Year -->
......
......@@ -186,7 +186,7 @@ public class DDAExhibicion implements ApplicationContextAware {
else if (Objects.nonNull(rWS_Notifica.getTransFault()) && !rWS_Notifica.getResultado()) {
//-- Tracking
LOG.error("Error al llamar el WS Notifica Activo Fijo: " + rWS_Notifica.getTransFault().toString());
LOG.error("Datos recibidos de la interfaz 12: " + rWS_Notifica.getNotificaciones().size() + " Datos enviados a la interfaz 12 " + lobTitulos.size());
bo.actualizarEjecutandoProcesoNotificacion("0");
LOG.info("Apaga bandera de proceso Notifica.[Caso TransFault]");
}
......
......@@ -28,6 +28,7 @@ import java.util.stream.Collectors;
import mx.com.amx.mx.dda.crn.dao.DDAExhibicionDAO;
import mx.com.amx.mx.dda.crn.dto.ContratoDTO;
import mx.com.amx.mx.dda.crn.dto.ContratoPagoDTO;
import mx.com.amx.mx.dda.crn.dto.ContratoTituloDTO;
import mx.com.amx.mx.dda.crn.dto.DatosCntTituloExhibicionDTO;
import mx.com.amx.mx.dda.crn.dto.ItemActivoFijoDTO;
......@@ -365,6 +366,7 @@ public class DDAExhibicionBO {
LOG.info(" Url Srv. Activo Fijo primer llamado: " + this.getUrlServicio(TERMINOS));
try {
Map<String,DatosCntTituloExhibicionDTO> map = new HashMap<>();
LOG.info(" Entrando try: " );
for(DatosCntTituloExhibicionDTO titulo : titulos){
if (Objects.isNull(map.get(titulo.getNUMERO_CONTRATO()))){
map.put(titulo.getNUMERO_CONTRATO(), new DatosCntTituloExhibicionDTO());
......@@ -375,18 +377,50 @@ public class DDAExhibicionBO {
}
}
List<ContratoDTO> contratos = dao.obtenerContratos();
LOG.info(" Contratos encontrado: " + contratos.size() );
for(ContratoDTO contrato : contratos){
if (Objects.nonNull(map.get(contrato.getContratoDDA()))){
DTTerminosComerciales params = new DTTerminosComerciales();
params.setContratoDDA(contrato.getContratoDDA());
//params.setOrdenCompra("6200000007");
params.setOrdenCompra(contrato.getOrdenCompra());
params.setIdentificadorInt(IDENTIFICADOR);
LOG.info(" Se envia contrato: " + contrato.getContratoDDA() + " con orden de compra: " + contrato.getOrdenCompra() + " e identificador: " + IDENTIFICADOR);
DTTerminosComerciales.Condicionescomerciales condicion = new DTTerminosComerciales.Condicionescomerciales();
condicion.setValorcondicion(map.get(contrato.getContratoDDA()).getCOSTO());
condicion.setFechavencimiento(contrato.getFechavencimiento());
params.getCondicionescomerciales().add(condicion);
List<ContratoPagoDTO> pagos = dao.obtenerCondicionesComerciales(contrato.getIdcontratoDDA());
List<ContratoPagoDTO> anticipo = dao.obtenerAnticipo(contrato.getIdcontratoDDA());
if(Objects.isNull(pagos) || pagos.isEmpty()){
if(Objects.nonNull(anticipo) && Objects.nonNull(anticipo.get(0).getMonto()) && !anticipo.get(0).getMonto().isEmpty()){
DTTerminosComerciales.Condicionescomerciales condicion = new DTTerminosComerciales.Condicionescomerciales();
condicion.setValorcondicion(anticipo.get(0).getMonto());
condicion.setFechavencimiento(anticipo.get(0).getFecha());
params.getCondicionescomerciales().add(condicion);
Double total = Double.parseDouble(map.get(contrato.getContratoDDA()).getCOSTO()) - (Double.parseDouble(anticipo.get(0).getMonto()));
if(total > 0){
DTTerminosComerciales.Condicionescomerciales ant = new DTTerminosComerciales.Condicionescomerciales();
ant.setValorcondicion(total.toString());
ant.setFechavencimiento(contrato.getFechavencimiento());
params.getCondicionescomerciales().add(ant);
}
} else {
DTTerminosComerciales.Condicionescomerciales condicion = new DTTerminosComerciales.Condicionescomerciales();
condicion.setValorcondicion(map.get(contrato.getContratoDDA()).getCOSTO());
condicion.setFechavencimiento(contrato.getFechavencimiento());
params.getCondicionescomerciales().add(condicion);
}
} else {
if(Objects.nonNull(anticipo) && Objects.nonNull(anticipo.get(0).getMonto()) && !anticipo.get(0).getMonto().isEmpty()){
DTTerminosComerciales.Condicionescomerciales ant = new DTTerminosComerciales.Condicionescomerciales();
ant.setValorcondicion(anticipo.get(0).getMonto());
ant.setFechavencimiento(anticipo.get(0).getFecha());
params.getCondicionescomerciales().add(ant);
}
for(ContratoPagoDTO pago : pagos){
DTTerminosComerciales.Condicionescomerciales condicion = new DTTerminosComerciales.Condicionescomerciales();
condicion.setValorcondicion(pago.getMonto());
condicion.setFechavencimiento(pago.getFecha());
params.getCondicionescomerciales().add(condicion);
}
}
DTTerminosComercialesRes response = (DTTerminosComercialesRes) wsNotificaAFijoSAP.marshalSendAndReceive(this.getUrlServicio(TERMINOS), params);
if(!response.getESTPROC().equals("OK")){
LOG.info(" Fallo el contrato " + contrato.getContratoDDA() + " al enviarlo a " + this.getUrlServicio(TERMINOS) + " se daran de baja los titulos en la BD.");
......@@ -398,6 +432,9 @@ public class DDAExhibicionBO {
}
}
} catch (Exception ex) {
LOG.info(" Prueba SAP erronea: " + ex.getMessage());
LOG.info(ex);
ex.printStackTrace();
java.util.logging.Logger.getLogger(DDAExhibicionBO.class.getName()).log(Level.SEVERE, null, ex);
}
}
......@@ -425,6 +462,7 @@ public class DDAExhibicionBO {
ResultadoNotificacionDTO resultado = new ResultadoNotificacionDTO();
TransactionFaultDTO tf = resultado.getTransFault();
List<RespSAPNotificaAFijoDTO> not = resultado.getNotificaciones();
Map<String, List<RespSAPNotificaAFijoDTO>> mapNot = new HashMap<>();
try {
DTContenido params = new DTContenido();
......@@ -484,8 +522,10 @@ public class DDAExhibicionBO {
respNotificaAFijo.setStatus(respuesta.getStatus());
respNotificaAFijo.setMensaje(respuesta.getMensaje());
LOG.info(" <CodigoDDA:[" + respuesta.getCodigoDDA() + "], Status:[" + respuesta.getStatus() + "], Mensaje:[" + respuesta.getMensaje() + "]>");
not.add(respNotificaAFijo);
if(Objects.isNull(mapNot.get(respuesta.getCodigoDDA()))){
not.add(respNotificaAFijo);
mapNot.put(respuesta.getCodigoDDA(), new ArrayList());
}
}
LOG.info(" [FIN] Detalle respuesta devuelta por SAP [Notificados]:");
LOG.info(" ");
......
......@@ -8,6 +8,7 @@ import mx.com.amx.mx.dda.crn.dto.DatosCntTituloExhibicionDTO;
import mx.com.amx.mx.dda.crn.dto.ItemActivoFijoDTO;
import mx.com.amx.mx.dda.crn.dto.ParametroDTO;
import mx.com.amx.mx.dda.crn.dto.RespSAPActivoFijoDTO;
import mx.com.amx.mx.dda.crn.dto.ContratoPagoDTO;
public interface IDDAExhibicionDAO
{
......@@ -23,5 +24,6 @@ public interface IDDAExhibicionDAO
public boolean ejecutarSPAmortizacionReal() throws Exception;
public List<ContratoDTO> obtenerContratos() throws Exception;
public boolean eliminarIdSAPCntTitulo(String idcontrato) throws Exception;
//public List<DTTerminosComerciales.Condicionescomerciales> obtenerCondicionesComerciales(String numeroContrato) throws Exception;
public List<ContratoPagoDTO> obtenerCondicionesComerciales(String idContrato) throws Exception;
public List<ContratoPagoDTO> obtenerAnticipo(String idContrato) throws Exception;
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package mx.com.amx.mx.dda.crn.dto;
/**
*
* @author jfmj_
*/
public class ContratoPagoDTO {
private String monto;
private String fecha;
public String getMonto() {
return monto;
}
public void setMonto(String monto) {
this.monto = monto;
}
public String getFecha() {
return fecha;
}
public void setFecha(String fecha) {
this.fecha = fecha;
}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package mx.com.mx.dda.msjb;
/**
*
* @author albarranoi
*/
import java.io.*;
import java.util.concurrent.Callable;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
import javax.servlet.*;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.*;
import mx.com.amx.mx.dda.crn.DDAExhibicion;
import mx.com.amx.mx.dda.crn.bo.DDAExhibicionBO;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
@WebServlet(name="service", urlPatterns={"/servicio"})
public class service extends HttpServlet {
private DDAExhibicion ex;
private DDAExhibicionBO bo;
@Override
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException {
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("<html>");
out.println("<head>");
out.println("<title>Ejecucion Notificacion SAP</title>");
out.println("</head>");
out.println("<body>");
out.println("<h1>Ejecucion Notificacion SAP<</h1>");
out.println("</body>");
out.println("</html>");
ejec();
}
public void ejec() {
ScheduledExecutorService se = Executors.newScheduledThreadPool(5);
ScheduledFuture sf = se.schedule(new Callable() {
@Override
public Object call() throws Exception {
// System.out.println("##################################_______________AQUI_______________");
ApplicationContext context = new ClassPathXmlApplicationContext("ApplicationContext.xml");
setEx((DDAExhibicion) context.getBean("exhibicion_DDA"));
getEx().ejecutaProceso();
// System.out.println("##################################_______________AQUI2_______________");
return "Done";
}
}, 1, TimeUnit.SECONDS);//Retrazo de tiempo
// System.out.println("Result of ScheduledFuture: " );
se.shutdown();
}
/**
* @return the ex
*/
public DDAExhibicion getEx() {
return ex;
}
/**
* @param ex the ex to set
*/
public void setEx(DDAExhibicion ex) {
this.ex = ex;
}
}
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