cambios para sap contratos originales y adendums

parent 5b739a79
......@@ -3,6 +3,7 @@
<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>
<file>file:/C:/Users/jfmj_/Documents/DDA/Githg/DDA_CRN_Exhibicion/resources/general.properties</file>
<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>
......
......@@ -449,8 +449,6 @@ public class DDAExhibicionDAO implements IDDAExhibicionDAO {
try {
String lstFechaReferencia = (pstFechaReferencia != null && pstFechaReferencia.length() > 0) ? pstFechaReferencia : "";
//--Ejecucion
sb.append("SELECT ordenCompra,proveedor,descripcion,MIN(codigoDDA) as codigoDDA,centroCosto,");
sb.append("MIN(programID) as programID, contratoDDA, inicioAmortizacion, temporada, SUM(costo) as costo FROM (");
......@@ -500,6 +498,58 @@ public class DDAExhibicionDAO implements IDDAExhibicionDAO {
return lobResultado;
}
@Override
public List<ItemActivoFijoDTO> obtenerContratosConTitulosSinIdSAP_RecienExhibidos(String pstFechaReferencia) throws Exception {
List<ItemActivoFijoDTO> lobResultado = new ArrayList<>();
StringBuilder sb = new StringBuilder();
List<Object> qryParams = new ArrayList<>();
try {
//--Ejecucion
sb.append("select ");
sb.append("contrato.ID_SAP as ordenCompra, ");
sb.append("estudio.ID_SAP as proveedor, ");
sb.append("'ACTIVO PRINCIPAL' as descripcion, ");
sb.append("MIN(cnttit.ID_TITULO_CNTORIG) as codigoDDA, ");
sb.append("'");
sb.append(CENTRO_COSTO);
sb.append("' as centroCosto, ");
sb.append("MIN(cnttit.ID_BV) as programID, ");
sb.append("contrato.NUMERO_CONTRATO AS contratoDDA, ");
sb.append("REPLACE(to_char(MIN(cnttit.FECHA_INICIO),'yyyy-mm-dd') ,'-','') AS inicioAmortizacion, ");
sb.append("SUM(cnttit.COSTO) AS costo ");
sb.append("from ");
sb.append("DDA_T_CONTRATO_TITULO cnttit, ");
sb.append("DDA_T_CONTRATO contrato, ");
sb.append("DDA_C_ESTUDIO estudio ");
sb.append("where ");
sb.append("cnttit.ID_CONTRATO = contrato.ID_CONTRATO ");
sb.append("and contrato.ID_ESTUDIO = estudio.ID_ESTUDIO ");
sb.append("and cnttit.ID_SAP is null ");
sb.append("and contrato.ID_ESTATUS = ? ");
sb.append("and estudio.ID_SAP is not null ");
sb.append("and contrato.ID_SAP is not null ");
sb.append("and contrato.ID_TIPO_CONTRATO = 1 ");
sb.append("GROUP BY contrato.ID_SAP, estudio.ID_SAP, contrato.NUMERO_CONTRATO, contrato.ID_CONTRATO_BV, contrato.NUMERO_CONTRATO ");
sb.append("ORDER BY ordenCompra, inicioAmortizacion DESC ");
//--Debug
LOG.debug(">Sql_D [obtenerTitulosSinIdSAP_RecienExhibidos]:" + sb.toString());
final String lstSQL = sb.toString();
qryParams.add(ESTATUS_VIGENTE);
//qryParams.add(lstFechaReferencia);
lobResultado = getJdbcTemplate().query(lstSQL, qryParams.toArray(), new BeanPropertyRowMapper<>(ItemActivoFijoDTO.class));
} catch (Exception e) {
LOG.error("Exception[" + this.getClass().getSimpleName() + "::obtenerTitulosRecienExhibidos]: " + e.getMessage());
throw new Exception(e.getMessage());
}
return lobResultado;
}
@Override
public boolean actualizaIdSAPCntTitulo(RespSAPActivoFijoDTO dto) throws Exception {
......@@ -636,6 +686,45 @@ public class DDAExhibicionDAO implements IDDAExhibicionDAO {
return lobResultado;
}
@Override
public List<ContratoDTO> obtenerContratosCandidatos() throws Exception {
List<ContratoDTO> lobResultado = new ArrayList<>();
StringBuilder sb = new StringBuilder();
List<Object> qryParams = new ArrayList<>();
try {
//--Ejecucion
sb.append("select ");
sb.append("cnt.ID_SAP AS ordenCompra, ");
sb.append("cnt.ID_CONTRATO AS idcontratoDDA, ");
sb.append("cnt.NUMERO_CONTRATO AS contratoDDA, ");
sb.append("ROUND(SUM(cnttit.COSTO),2) AS valorcondicion, ");
sb.append("REPLACE(to_char(MIN(cnt.FECHA_FIN),'yyyy-mm-dd') ,'-','') AS fechavencimiento ");
sb.append("from ");
sb.append("DDA_T_CONTRATO_TITULO cnttit, ");
sb.append("DDA_T_CONTRATO cnt ");
sb.append("where ");
sb.append("cnttit.ID_CONTRATO = cnt.ID_CONTRATO ");
sb.append("and cnt.ID_ESTATUS = ? ");
sb.append("and (cnttit.ID_SAP is null ");
sb.append("or cnttit.FECHA_NOTIFSAP is null )");
sb.append("GROUP BY cnt.ID_SAP, cnt.ID_CONTRATO, cnt.NUMERO_CONTRATO ");
//--Debug
LOG.debug(">Sql_D [obtenerContratos]:" + sb.toString());
final String lstSQL = sb.toString();
qryParams.add(ESTATUS_VIGENTE);
lobResultado = (ArrayList<ContratoDTO>) getJdbcTemplate().query(lstSQL, qryParams.toArray(), new BeanPropertyRowMapper<>(ContratoDTO.class));
} catch (Exception e) {
LOG.error("Exception[" + this.getClass().getSimpleName() + "::obtenerTitulosRecienExhibidos]: " + e.getMessage());
throw new Exception(e.getMessage());
}
return lobResultado;
}
public List<ContratoPagoDTO> obtenerCondicionesComerciales(String idContrato) throws Exception{
List<ContratoPagoDTO> lobResultado = new ArrayList<>();
StringBuilder sb = new StringBuilder();
......@@ -719,5 +808,66 @@ public class DDAExhibicionDAO implements IDDAExhibicionDAO {
return resultado;
}
@Override
public void actualizarEstatusSapTitulosByContrato(String mensaje, String idContrato) {
StringBuffer sb = new StringBuffer();
StringBuffer sbD = new StringBuffer();
List<Object> qryParams = new ArrayList<Object>();
try {
//--Debug
sbD.append("UPDATE DDA_T_CONTRATO_TITULO SET ESTATUS_SAP =' ");
sbD.append(mensaje);
sbD.append("' WHERE ID_CONTRATO = ");
sbD.append(idContrato);
LOG.debug(">Sql_D [actualizarEstatusSapTitulosByContrato]:" + sbD.toString());
//--Ejecucion
sb.append("UPDATE DDA_T_CONTRATO_TITULO SET ESTATUS_SAP =' ");
sb.append(mensaje);
sb.append("' WHERE ID_CONTRATO = ");
sb.append(idContrato);
final String lstSQL = sb.toString();
jdbcTemplate.update(lstSQL, qryParams.toArray());
} catch (Exception e) {
LOG.error("Exception[" + this.getClass().getSimpleName() + "::actualizarEstatusSapTitulosByContrato]: " + e.getMessage());
}
}
@Override
public void actualizarEstatusSapTitulosByTitulo(String mensaje, String idtitulo) {
StringBuffer sb = new StringBuffer();
StringBuffer sbD = new StringBuffer();
List<Object> qryParams = new ArrayList<Object>();
try {
//--Debug
sbD.append("UPDATE DDA_T_CONTRATO_TITULO SET ESTATUS_SAP =' ");
sbD.append(mensaje);
sbD.append("' WHERE ID_TITULO_CNT = ");
sbD.append(idtitulo);
LOG.debug(">Sql_D [actualizarEstatusSapTitulos]:" + sbD.toString());
//--Ejecucion
sb.append("UPDATE DDA_T_CONTRATO_TITULO SET ESTATUS_SAP = ? ");
sb.append(" WHERE ID_TITULO_CNT = ? ");
sb.append(idtitulo);
final String lstSQL = sb.toString();
qryParams.add(mensaje);
qryParams.add(idtitulo);
jdbcTemplate.update(lstSQL, qryParams.toArray());
} catch (Exception e) {
LOG.error("Exception[" + this.getClass().getSimpleName() + "::ejecutarSPAmortizacionAjustada]: " + e.getMessage());
}
}
}
......@@ -20,10 +20,14 @@ public interface IDDAExhibicionDAO
public boolean actualizaFechaNotificacion(ContratoTituloDTO dto) throws Exception;
public boolean insertarRegistroSubnum(String pstIdTituloCnt) throws Exception;
public List<ItemActivoFijoDTO> obtenerTitulosSinIdSAP_RecienExhibidos(String pstFechaReferencia) throws Exception;
public List<ItemActivoFijoDTO> obtenerContratosConTitulosSinIdSAP_RecienExhibidos(String pstFechaReferencia) throws Exception;
public boolean actualizaIdSAPCntTitulo(RespSAPActivoFijoDTO dto) throws Exception;
public boolean ejecutarSPAmortizacionReal() throws Exception;
public List<ContratoDTO> obtenerContratos() throws Exception;
public List<ContratoDTO> obtenerContratosCandidatos() throws Exception;
public boolean eliminarIdSAPCntTitulo(String idcontrato) throws Exception;
public List<ContratoPagoDTO> obtenerCondicionesComerciales(String idContrato) throws Exception;
public List<ContratoPagoDTO> obtenerAnticipo(String idContrato) throws Exception;
public void actualizarEstatusSapTitulosByContrato(String mensaje, String idContrato);
public void actualizarEstatusSapTitulosByTitulo(String mensaje, String idContrato);
}
......@@ -9,27 +9,36 @@ import java.util.List;
*/
public class ParamActivoFijoDTO implements Serializable
{
private static final long serialVersionUID = 1L;
private List<ItemActivoFijoDTO> titulos;
public List<ItemActivoFijoDTO> getTitulos() {
return titulos;
}
public void setTitulos(List<ItemActivoFijoDTO> titulos) {
this.titulos = titulos;
}
private static final long serialVersionUID = 1L;
private List<ItemActivoFijoDTO> titulos;
private List<ItemActivoFijoDTO> contratos;
public String toString()
{
StringBuilder result = new StringBuilder();
String NEW_LINE = System.getProperty("line.separator");
result.append(" [Begin of Class] " + NEW_LINE);
result.append(this.getClass().getSimpleName() + " Object {" + NEW_LINE);
result.append(" items: _" + this.getTitulos().size() + "_" + NEW_LINE);
result.append(" [End of Class] " + NEW_LINE);
result.append("}");
NEW_LINE = null;
public List<ItemActivoFijoDTO> getTitulos() {
return titulos;
}
public void setTitulos(List<ItemActivoFijoDTO> titulos) {
this.titulos = titulos;
}
return result.toString();
}
public List<ItemActivoFijoDTO> getContratos() {
return contratos;
}
public void setContratos(List<ItemActivoFijoDTO> contratos) {
this.contratos = contratos;
}
public String toString()
{
StringBuilder result = new StringBuilder();
String NEW_LINE = System.getProperty("line.separator");
result.append(" [Begin of Class] " + NEW_LINE);
result.append(this.getClass().getSimpleName() + " Object {" + NEW_LINE);
result.append(" items: _" + this.getTitulos().size() + "_" + NEW_LINE);
result.append(" [End of Class] " + NEW_LINE);
result.append("}");
NEW_LINE = null;
return result.toString();
}
}
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