Se agrega error generico para front, cambios en Exception en back y codigo...

Se agrega error generico para front, cambios en Exception en back y codigo muerto y revision de excepciones genericas en js y jsp
parent 9cbfcfde
...@@ -21,18 +21,9 @@ ...@@ -21,18 +21,9 @@
<link rel="stylesheet" href="${contextPath}/design/css/basic.css"> <link rel="stylesheet" href="${contextPath}/design/css/basic.css">
<link rel="stylesheet" href="${contextPath}/design/css/general.css"> <link rel="stylesheet" href="${contextPath}/design/css/general.css">
<link rel="stylesheet" href="${contextPath}/design/css/theme.css" class="style-theme"> <link rel="stylesheet" href="${contextPath}/design/css/theme.css" class="style-theme">
<!--[if lt IE 9]>
<script src="${contextPath}/design/js/basic/respond.min.js"></script>
<script src="${contextPath}/design/js/basic/html5shiv.min.js"></script>
<![endif]-->
</head> </head>
<body class="login-bg"> <body class="login-bg">
<!--[if lt IE 9]>
<p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
<![endif]-->
<!--SECTION--> <!--SECTION-->
<section class="l-main-container"> <section class="l-main-container">
<!--Main Content--> <!--Main Content-->
...@@ -79,22 +70,7 @@ ...@@ -79,22 +70,7 @@
<script src="${contextPath}/design/js/shared/jquery.asonWidget.js"></script> <script src="${contextPath}/design/js/shared/jquery.asonWidget.js"></script>
<script src="${contextPath}/design/js/plugins/plugins.js"></script> <script src="${contextPath}/design/js/plugins/plugins.js"></script>
<script src="${contextPath}/design/js/general.js"></script> <script src="${contextPath}/design/js/general.js"></script>
<!-- Semi general-->
<!-- <script type="text/javascript">
var paceSemiGeneral = { restartOnPushState: false };
if (typeof paceSpecific != 'undefined'){
var paceOptions = $.extend( {}, paceSemiGeneral, paceSpecific );
paceOptions = paceOptions;
}else{
paceOptions = paceSemiGeneral;
}
</script> -->
<!--
<script src="${contextPath}/design/js/plugins/pageprogressbar/pace.min.js"></script>
-->
<!-- Specific-->
<script src="${contextPath}/design/js/plugins/forms/validation/jquery.validate.min.js"></script> <script src="${contextPath}/design/js/plugins/forms/validation/jquery.validate.min.js"></script>
<script <script
src="${contextPath}/design/js/plugins/forms/validation/jquery.validate.additional.min.js"></script> src="${contextPath}/design/js/plugins/forms/validation/jquery.validate.additional.min.js"></script>
...@@ -107,73 +83,4 @@ ...@@ -107,73 +83,4 @@
</script> </script>
</body> </body>
</html> </html>
\ No newline at end of file
<%--
<script>
function fValidarForma(pobForma) {
var login = pobForma.j_username.value;
var pass = pobForma.j_password.value;
if (login.length == 0) {
$('#pMensajeError').html('<fmt:message key="error.003"/>');
} else if (pass.length == 0) {
$('#pMensajeError').html('<fmt:message key="error.004"/>');
} else {
var cadSinEsp = /[^A-Za-z0-9$]/;
var errorMessage = '<fmt:message key="error.005"/>: ';
if (cadSinEsp.test(login)) {
$('#pMensajeError')
.html(
errorMessage
+ '\"<fmt:message key="gral.login.usuario"/>\"');
} else if (cadSinEsp.test(pass)) {
$('#pMensajeError')
.html(
errorMessage
+ '\"<fmt:message key="gral.login.password"/>\"');
} else {
pobForma.submit();
}
}
return false;
}
</script>
<form action="<c:url value='j_spring_security_check'/>" method="post"
onSubmit="return fValidarForma(document.forms[0])">
<table class="tbLogin">
<tr>
<td class="clInputLabel"><fmt:message key="gral.login.usuario" />:</td>
<td class="clInputElement"><input class="login" type="text"
name="j_username" /></td>
</tr>
<tr>
<td class="clInputLabel"><fmt:message key="gral.login.password" />:</td>
<td class="clInputElement"><input class="login" type="password"
name="j_password" />
</tr>
<tr>
<td colspan="2" align="center" height="30"><input
class="clButtonActive" type="submit"
value='<fmt:message key="gral.login.ingresar"/>' /></td>
</tr>
<tr>
<td>
<div id="msg_error">
<p id="pMensajeError">
<c:if test="${param.login_error eq 1}">
<fmt:message key="error.001" />
</c:if>
</p>
</div>
</td>
</tr>
</table>
</form>
<%@include file="/jsp/common/defaultBottom.jsp"%>
--%>
\ No newline at end of file
...@@ -20,7 +20,7 @@ public class ErrorAction extends BaseAction { ...@@ -20,7 +20,7 @@ public class ErrorAction extends BaseAction {
private HashMap< String, String > urlHM; private HashMap< String, String > urlHM;
private ErrorAction() throws Exception { private ErrorAction() {
super(); super();
urlHM = new HashMap< String, String >(); urlHM = new HashMap< String, String >();
...@@ -29,7 +29,7 @@ public class ErrorAction extends BaseAction { ...@@ -29,7 +29,7 @@ public class ErrorAction extends BaseAction {
} }
@Override @Override
public String execute() throws Exception { public String execute() {
this.descripcion = "error_" + this.clave; this.descripcion = "error_" + this.clave;
this.url = urlHM.get( this.clave ); this.url = urlHM.get( this.clave );
......
package com.mx.dla.admin.actions; package com.mx.dla.admin.actions;
import java.sql.SQLException;
import java.util.List; import java.util.List;
import org.apache.ibatis.executor.result.ResultMapException;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope; import org.springframework.context.annotation.Scope;
import org.springframework.security.core.Authentication; import org.springframework.security.core.Authentication;
...@@ -15,77 +17,80 @@ import com.mx.dla.admin.dtos.MenuDTO; ...@@ -15,77 +17,80 @@ import com.mx.dla.admin.dtos.MenuDTO;
import com.mx.dla.admin.dtos.PerfilDTO; import com.mx.dla.admin.dtos.PerfilDTO;
import com.mx.dla.admin.dtos.UsuarioDTO; import com.mx.dla.admin.dtos.UsuarioDTO;
import com.mx.dla.dda.contrato.common.actions.BaseContratoAction; import com.mx.dla.dda.contrato.common.actions.BaseContratoAction;
import com.mx.dla.dda.contrato.transaccion.exceptions.dtos.TransaccionException;
import com.opensymphony.xwork2.ActionContext; import com.opensymphony.xwork2.ActionContext;
@Controller @Controller
@Scope("request") @Scope("request")
public class InicioAction extends BaseContratoAction { public class InicioAction extends BaseContratoAction {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@Autowired @Autowired
private UsuarioDAO usuarioDAO; private UsuarioDAO usuarioDAO;
@Autowired @Autowired
private PerfilDAO perfilDAO; private PerfilDAO perfilDAO;
@Autowired @Autowired
private MenuBO menuBO; private MenuBO menuBO;
List<MenuDTO> menusUsuario = null; List<MenuDTO> menusUsuario = null;
@Override @Override
public String execute() throws Exception { public String execute() throws TransaccionException {
Authentication autenticacion = SecurityContextHolder.getContext().getAuthentication();
UsuarioDTO usuario = usuarioDAO.obtenerUsuario( autenticacion.getName() );
ActionContext.getContext().getSession().remove("pmn");
ActionContext.getContext().getSession().remove("pmnReturn");
String retorno = SUCCESS; String retorno = SUCCESS;
try {
if( !this.getPmn().equals("0") ) Authentication autenticacion = SecurityContextHolder.getContext().getAuthentication();
retorno = "menu_" + this.getPmn(); UsuarioDTO usuario = usuarioDAO.obtenerUsuario(autenticacion.getName());
if( usuario != null ) ActionContext.getContext().getSession().remove("pmn");
{ ActionContext.getContext().getSession().remove("pmnReturn");
getSession().put("permisos", menuBO.obtenPermisosPerfil(usuario.getPerfil().getIdPerfil()));
String idPerfil = usuario.getPerfil().getIdPerfil(); if (!this.getPmn().equals("0"))
retorno = "menu_" + this.getPmn();
if( idPerfil != null )
{ if (usuario != null) {
PerfilDTO perfil = perfilDAO.obtenerPerfil( idPerfil );
getSession().put("permisos", menuBO.obtenPermisosPerfil(usuario.getPerfil().getIdPerfil()));
logger.debug("PerfilDTO : [{}]", perfil);
String idPerfil = usuario.getPerfil().getIdPerfil();
if( perfil != null ) if (idPerfil != null) {
{ PerfilDTO perfil = perfilDAO.obtenerPerfil(idPerfil);
getSession().put("usuario", usuario);
logger.debug("PerfilDTO : [{}]", perfil);
List<MenuDTO> menusPerfil = perfil.getMenus();
if (perfil != null) {
if( menusPerfil != null ){ getSession().put("usuario", usuario);
menusUsuario = menuBO.armarArbolMenus( menusPerfil, idPerfil );
getSession().put("menus", perfil.getMenus() ); List<MenuDTO> menusPerfil = perfil.getMenus();
}
} else if (menusPerfil != null) {
{ menusUsuario = menuBO.armarArbolMenus(menusPerfil, idPerfil);
getSession().put("menus", perfil.getMenus());
}
} else {
retorno = "error_002";
}
} else {
retorno = "error_002"; retorno = "error_002";
} }
} else } else {
{ retorno = "error_001";
retorno = "error_002";
} }
} else { } catch (ResultMapException e) {
retorno = "error_001"; logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) {
logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) {
logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
return retorno; return retorno;
} }
}
}
...@@ -32,7 +32,7 @@ public class UsuarioPerfilAction extends BaseContratoAction { ...@@ -32,7 +32,7 @@ public class UsuarioPerfilAction extends BaseContratoAction {
return SUCCESS; return SUCCESS;
} }
public String actulizaPropiedadesUsuario() { public String actulizaPropiedadesUsuario() throws TransaccionException {
setUsuario((UsuarioDTO) this.getSession().get("usuario")); setUsuario((UsuarioDTO) this.getSession().get("usuario"));
try { try {
...@@ -41,12 +41,16 @@ public class UsuarioPerfilAction extends BaseContratoAction { ...@@ -41,12 +41,16 @@ public class UsuarioPerfilAction extends BaseContratoAction {
setUsuario(usuarioPerfilBO.obtenerUsuario(usuario.getExpediente())); setUsuario(usuarioPerfilBO.obtenerUsuario(usuario.getExpediente()));
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (PersistenceException e) { } catch (PersistenceException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
this.getSession().put("usuario", usuario); this.getSession().put("usuario", usuario);
return SUCCESS; return SUCCESS;
......
...@@ -30,10 +30,22 @@ public class BloqueoSAPAction extends BaseAction { ...@@ -30,10 +30,22 @@ public class BloqueoSAPAction extends BaseAction {
private String fecha; private String fecha;
@Override @Override
public String execute() throws Exception { public String execute() throws TransaccionException {
LocalDate currentDate = LocalDate.now(); LocalDate currentDate = LocalDate.now();
FechaBloqueoDTO fecha = bdsp.consultaMesActual(String.valueOf(currentDate.getYear()), FechaBloqueoDTO fecha;
String.valueOf(currentDate.getMonthValue())); try {
fecha = bdsp.consultaMesActual(String.valueOf(currentDate.getYear()),
String.valueOf(currentDate.getMonthValue()));
} catch (ResultMapException e) {
logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) {
logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) {
logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
}
setAnio(fecha.getAnio()); setAnio(fecha.getAnio());
setMes(fecha.getMes()); setMes(fecha.getMes());
setDia(fecha.getDia()); setDia(fecha.getDia());
......
...@@ -66,7 +66,7 @@ public class CatalogoAddOnsAction extends BaseAction { ...@@ -66,7 +66,7 @@ public class CatalogoAddOnsAction extends BaseAction {
private EstudioAddonBO estudioAddonBO; private EstudioAddonBO estudioAddonBO;
@Override @Override
public String execute() throws Exception { public String execute() {
setPmns(); setPmns();
return SUCCESS; return SUCCESS;
} }
...@@ -96,10 +96,21 @@ public class CatalogoAddOnsAction extends BaseAction { ...@@ -96,10 +96,21 @@ public class CatalogoAddOnsAction extends BaseAction {
this.setPmnReturn("205"); this.setPmnReturn("205");
} }
public String dirigirAgregarAddOn() throws Exception { public String dirigirAgregarAddOn() throws TransaccionException {
setPmns(); setPmns();
setEstudios(estudioAddonBO.getEstudios()); try {
setPaises(addOnBO.obtenerPaisesAddOn()); setEstudios(estudioAddonBO.getEstudios());
setPaises(addOnBO.obtenerPaisesAddOn());
} catch (ResultMapException e) {
logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) {
logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) {
logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
}
return SUCCESS; return SUCCESS;
} }
...@@ -141,7 +152,6 @@ public class CatalogoAddOnsAction extends BaseAction { ...@@ -141,7 +152,6 @@ public class CatalogoAddOnsAction extends BaseAction {
addOn.setIdAddOn(idAddOn); addOn.setIdAddOn(idAddOn);
logger.debug("[{}]", addOn); logger.debug("[{}]", addOn);
addOnBO.updateAddOn(addOn); addOnBO.updateAddOn(addOn);
// String idAddOn = this.addOn.getIdAddOn();
this.addOn = addOnBO.catalogoAddOnsPorId(idAddOn); this.addOn = addOnBO.catalogoAddOnsPorId(idAddOn);
this.addOnActualizado = true; this.addOnActualizado = true;
setIdAddOn(addOn.getIdAddOn()); setIdAddOn(addOn.getIdAddOn());
......
...@@ -46,7 +46,7 @@ public class EstudiosAddOnAction extends BaseAction { ...@@ -46,7 +46,7 @@ public class EstudiosAddOnAction extends BaseAction {
private EstudioBO estudioBO; private EstudioBO estudioBO;
@Override @Override
public String execute() throws Exception { public String execute() {
return SUCCESS; return SUCCESS;
} }
...@@ -66,7 +66,7 @@ public class EstudiosAddOnAction extends BaseAction { ...@@ -66,7 +66,7 @@ public class EstudiosAddOnAction extends BaseAction {
return SUCCESS; return SUCCESS;
} }
public String dirigirAgregarEstudio() throws Exception { public String dirigirAgregarEstudio() {
try { try {
setReportes(reporteAddOnsBO.getTiposReporte(StringUtils.EMPTY)); setReportes(reporteAddOnsBO.getTiposReporte(StringUtils.EMPTY));
} catch (ResultMapException e) { } catch (ResultMapException e) {
......
...@@ -22,18 +22,22 @@ public class AgregarEstudioAction extends BaseContratoAction { ...@@ -22,18 +22,22 @@ public class AgregarEstudioAction extends BaseContratoAction {
private GrupoEstudioBO grupoEstudioBO; private GrupoEstudioBO grupoEstudioBO;
@Override @Override
public String execute() { public String execute() throws TransaccionException {
logger.debug("In AgregarEstudioAction."); logger.debug("In AgregarEstudioAction.");
try { try {
setGrupos(grupoEstudioBO.obtenerGrupoEstudio(null)); setGrupos(grupoEstudioBO.obtenerGrupoEstudio(null));
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Ocurri un error al obtener los datos.", e); logger.error("Ocurri un error al obtener los datos.", e);
} catch (PersistenceException ibe) { throw new TransaccionException("Ocurrio un error", e);
logger.error("Ocurri un error al obtener los datos.", ibe); } catch (PersistenceException e) {
logger.error("Ocurri un error al obtener los datos.", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Ocurri un error al obtener los datos.", e); logger.error("Ocurri un error al obtener los datos.", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("Ocurri un error al obtener los datos.", e); logger.error("Ocurri un error al obtener los datos.", e);
throw new TransaccionException("Ocurrio un error", e);
} }
this.getSession().put("pmn", this.getPmn()); this.getSession().put("pmn", this.getPmn());
this.getSession().put("pmnReturn", this.getPmnReturn()); this.getSession().put("pmnReturn", this.getPmnReturn());
......
...@@ -41,24 +41,28 @@ public class CatalogoEstudiosAction extends BaseAction { ...@@ -41,24 +41,28 @@ public class CatalogoEstudiosAction extends BaseAction {
private GrupoEstudioBO GrupoEstudioBO; private GrupoEstudioBO GrupoEstudioBO;
@Override @Override
public String execute() throws Exception { public String execute() {
setPmns(); setPmns();
return SUCCESS; return SUCCESS;
} }
public String listadoEstudios() { public String listadoEstudios() throws TransaccionException {
try { try {
catalogoEstudios = new ArrayList<CatalogoEstudioDTO>(); catalogoEstudios = new ArrayList<CatalogoEstudioDTO>();
catalogoEstudios = estudioBO.catalogoEstudios(); catalogoEstudios = estudioBO.catalogoEstudios();
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
} catch (PersistenceException ibe) { throw new TransaccionException("Ocurrio un error", e);
logger.error("Error. {}", ibe); } catch (PersistenceException e) {
logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
return Action.SUCCESS; return Action.SUCCESS;
} }
...@@ -71,12 +75,12 @@ public class CatalogoEstudiosAction extends BaseAction { ...@@ -71,12 +75,12 @@ public class CatalogoEstudiosAction extends BaseAction {
this.setPmnReturn("42"); this.setPmnReturn("42");
} }
public String dirigirAgregar() throws Exception { public String dirigirAgregar() {
setPmns(); setPmns();
return SUCCESS; return SUCCESS;
} }
public String guardaEstudio() { public String guardaEstudio() throws TransaccionException {
try { try {
...@@ -86,21 +90,25 @@ public class CatalogoEstudiosAction extends BaseAction { ...@@ -86,21 +90,25 @@ public class CatalogoEstudiosAction extends BaseAction {
} catch (ResultMapException e) { } catch (ResultMapException e) {
this.estudioActualizado = false; this.estudioActualizado = false;
logger.error("Error. {}", e); logger.error("Error. {}", e);
} catch (PersistenceException ibe) { throw new TransaccionException("Ocurrio un error", e);
} catch (PersistenceException e) {
this.estudioActualizado = false; this.estudioActualizado = false;
logger.error("Error. {}", ibe); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
this.estudioActualizado = false; this.estudioActualizado = false;
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
this.estudioActualizado = false; this.estudioActualizado = false;
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
setPmns(); setPmns();
return Action.SUCCESS; return Action.SUCCESS;
} }
public String actualizaEstudio() { public String actualizaEstudio() throws TransaccionException {
try { try {
...@@ -115,55 +123,67 @@ public class CatalogoEstudiosAction extends BaseAction { ...@@ -115,55 +123,67 @@ public class CatalogoEstudiosAction extends BaseAction {
} catch (ResultMapException e) { } catch (ResultMapException e) {
this.estudioActualizado = false; this.estudioActualizado = false;
logger.error("Error. {}", e); logger.error("Error. {}", e);
} catch (PersistenceException ibe) { throw new TransaccionException("Ocurrio un error", e);
} catch (PersistenceException e) {
this.estudioActualizado = false; this.estudioActualizado = false;
logger.error("Error. {}", ibe); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
this.estudioActualizado = false; this.estudioActualizado = false;
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
this.estudioActualizado = false; this.estudioActualizado = false;
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
setPmns(); setPmns();
return "estudioActualizado"; return "estudioActualizado";
} }
public String buscaEstudio() { public String buscaEstudio() throws TransaccionException {
try { try {
setGrupos(GrupoEstudioBO.obtenerGrupoEstudio(null)); setGrupos(GrupoEstudioBO.obtenerGrupoEstudio(null));
this.estudio = estudioBO.catalogoEstudiosPorId(idEstudio.intValue()); this.estudio = estudioBO.catalogoEstudiosPorId(idEstudio.intValue());
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
} catch (PersistenceException ibe) { throw new TransaccionException("Ocurrio un error", e);
logger.error("Error. {}", ibe); } catch (PersistenceException e) {
logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
return "estudioConsultado"; return "estudioConsultado";
} }
public String obtneEstudio() { public String obtneEstudio() throws TransaccionException {
try { try {
setEstudio(estudioBO.catalogoEstudiosPorId(idEstudio.intValue())); setEstudio(estudioBO.catalogoEstudiosPorId(idEstudio.intValue()));
setGrupos(GrupoEstudioBO.obtenerGrupoEstudio(idEstudio)); setGrupos(GrupoEstudioBO.obtenerGrupoEstudio(idEstudio));
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
} catch (PersistenceException ibe) { throw new TransaccionException("Ocurrio un error", e);
logger.error("Error. {}", ibe); } catch (PersistenceException e) {
logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
return SUCCESS; return SUCCESS;
} }
public String actualizaEstudioMod() { public String actualizaEstudioMod() throws TransaccionException {
setSeRepiteSigla(estudioBO.seRepiteSigla(idEstudio, sigla)); setSeRepiteSigla(estudioBO.seRepiteSigla(idEstudio, sigla));
try { try {
if (!getSeRepiteSigla()) { if (!getSeRepiteSigla()) {
...@@ -174,15 +194,19 @@ public class CatalogoEstudiosAction extends BaseAction { ...@@ -174,15 +194,19 @@ public class CatalogoEstudiosAction extends BaseAction {
} catch (ResultMapException e) { } catch (ResultMapException e) {
this.estudioActualizado = false; this.estudioActualizado = false;
logger.error("Error. {}", e); logger.error("Error. {}", e);
} catch (PersistenceException ibe) { throw new TransaccionException("Ocurrio un error", e);
} catch (PersistenceException e) {
this.estudioActualizado = false; this.estudioActualizado = false;
logger.error("Error. {}", ibe); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
this.estudioActualizado = false; this.estudioActualizado = false;
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
this.estudioActualizado = false; this.estudioActualizado = false;
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
return SUCCESS; return SUCCESS;
......
...@@ -32,47 +32,59 @@ public class GrupoEstudioAction extends BaseContratoAction { ...@@ -32,47 +32,59 @@ public class GrupoEstudioAction extends BaseContratoAction {
return SUCCESS; return SUCCESS;
} }
public String obtnerGrupos() { public String obtnerGrupos() throws TransaccionException {
try { try {
setGrupos(grupoEstudioBO.obtenerGrupoEstudio(null)); setGrupos(grupoEstudioBO.obtenerGrupoEstudio(null));
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
} catch (PersistenceException ibe) { throw new TransaccionException("Ocurrio un error", e);
logger.error("Error. {}", ibe); } catch (PersistenceException e) {
logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
return "regresaInformacion"; return "regresaInformacion";
} }
public String obtneGrupo() { public String obtneGrupo() throws TransaccionException {
try { try {
setGrupo(grupoEstudioBO.obtenerGrupo(idGrupo)); setGrupo(grupoEstudioBO.obtenerGrupo(idGrupo));
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
} catch (PersistenceException ibe) { throw new TransaccionException("Ocurrio un error", e);
logger.error("Error. {}", ibe); } catch (PersistenceException e) {
logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
return SUCCESS; return SUCCESS;
} }
public String registraActualiza() { public String registraActualiza() throws TransaccionException {
try { try {
grupoEstudioBO.registraActualizaGrupo(operacion, idGrupo, descripcion, estatus, orden, colapsa); grupoEstudioBO.registraActualizaGrupo(operacion, idGrupo, descripcion, estatus, orden, colapsa);
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
} catch (PersistenceException ibe) { throw new TransaccionException("Ocurrio un error", e);
logger.error("Error. {}", ibe); } catch (PersistenceException e) {
logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
return SUCCESS; return SUCCESS;
......
...@@ -10,34 +10,35 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -10,34 +10,35 @@ import org.springframework.beans.factory.annotation.Autowired;
import com.mx.dla.dda.admin.catalogos.materiales.daos.CatalogoMaterialesDAO; import com.mx.dla.dda.admin.catalogos.materiales.daos.CatalogoMaterialesDAO;
import com.mx.dla.dda.admin.catalogos.materiales.dtos.CatalogoMaterialDTO; import com.mx.dla.dda.admin.catalogos.materiales.dtos.CatalogoMaterialDTO;
import com.mx.dla.dda.contrato.transaccion.exceptions.dtos.TransaccionException;
import com.mx.dla.global.actions.BaseAction; import com.mx.dla.global.actions.BaseAction;
public class CatalogoMaterialesAction extends BaseAction { public class CatalogoMaterialesAction extends BaseAction {
private static final long serialVersionUID = -4856342072710036099L; private static final long serialVersionUID = -4856342072710036099L;
private static Logger log= Logger.getLogger(CatalogoMaterialesAction.class); private static Logger log = Logger.getLogger(CatalogoMaterialesAction.class);
private List<CatalogoMaterialDTO> catalogoMateriales; private List<CatalogoMaterialDTO> catalogoMateriales;
@Autowired @Autowired
private CatalogoMaterialesDAO catalogoMaterialesDAO; private CatalogoMaterialesDAO catalogoMaterialesDAO;
@Override @Override
public String execute() throws Exception { public String execute() {
log.info("in execute()...");
return SUCCESS; return SUCCESS;
} }
public String listadoMateriales(){
try{ public String listadoMateriales() throws TransaccionException {
try {
catalogoMateriales = new ArrayList<CatalogoMaterialDTO>(); catalogoMateriales = new ArrayList<CatalogoMaterialDTO>();
catalogoMateriales = catalogoMaterialesDAO.catalogoMateriales(); catalogoMateriales = catalogoMaterialesDAO.catalogoMateriales();
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
} catch (PersistenceException ibe) { throw new TransaccionException("Ocurrio un error", e);
logger.error("Error. {}", ibe); } catch (PersistenceException e) {
logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
log.info("Catalogo de materiales"); log.info("Catalogo de materiales");
...@@ -58,5 +59,4 @@ public class CatalogoMaterialesAction extends BaseAction { ...@@ -58,5 +59,4 @@ public class CatalogoMaterialesAction extends BaseAction {
this.catalogoMateriales = catalogoMateriales; this.catalogoMateriales = catalogoMateriales;
} }
} }
...@@ -37,28 +37,32 @@ public class CatalogoPaisAction extends BaseAction { ...@@ -37,28 +37,32 @@ public class CatalogoPaisAction extends BaseAction {
private CatalogosBO catalogosBO; private CatalogosBO catalogosBO;
@Override @Override
public String execute() throws Exception { public String execute() {
return SUCCESS; return SUCCESS;
} }
public String listadoPais() { public String listadoPais() throws TransaccionException {
try { try {
catalogoPais = new ArrayList<CatalogoPaisDTO>(); catalogoPais = new ArrayList<CatalogoPaisDTO>();
catalogoPais = catalogoPaisBO.getCatalogoPais(); catalogoPais = catalogoPaisBO.getCatalogoPais();
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
} catch (PersistenceException ibe) { throw new TransaccionException("Ocurrio un error", e);
logger.error("Error. {}", ibe); } catch (PersistenceException e) {
logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
return "catalogoPaisLista"; return "catalogoPaisLista";
} }
public String guardaPais() { public String guardaPais() throws TransaccionException {
try { try {
regresoAction = true; regresoAction = true;
...@@ -68,9 +72,9 @@ public class CatalogoPaisAction extends BaseAction { ...@@ -68,9 +72,9 @@ public class CatalogoPaisAction extends BaseAction {
} catch (ResultMapException e) { } catch (ResultMapException e) {
this.paisActualizado = false; this.paisActualizado = false;
logger.error("Error. {}", e); logger.error("Error. {}", e);
} catch (PersistenceException ibe) { } catch (PersistenceException e) {
this.paisActualizado = false; this.paisActualizado = false;
logger.error("Error. {}", ibe); logger.error("Error. {}", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
this.paisActualizado = false; this.paisActualizado = false;
logger.error("Error. {}", e); logger.error("Error. {}", e);
...@@ -89,7 +93,7 @@ public class CatalogoPaisAction extends BaseAction { ...@@ -89,7 +93,7 @@ public class CatalogoPaisAction extends BaseAction {
return "irCrearPais"; return "irCrearPais";
} }
public String buscaPais() { public String buscaPais() throws TransaccionException {
try { try {
log.info("*************Busca pais: " + this.pais.getNombre()); log.info("*************Busca pais: " + this.pais.getNombre());
...@@ -102,12 +106,16 @@ public class CatalogoPaisAction extends BaseAction { ...@@ -102,12 +106,16 @@ public class CatalogoPaisAction extends BaseAction {
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
} catch (PersistenceException ibe) { throw new TransaccionException("Ocurrio un error", e);
logger.error("Error. {}", ibe); } catch (PersistenceException e) {
logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
return "paisConsultado"; return "paisConsultado";
} }
......
...@@ -32,7 +32,7 @@ public class TipoCambioAction extends BaseContratoAction { ...@@ -32,7 +32,7 @@ public class TipoCambioAction extends BaseContratoAction {
private TipoCambioBO tipoCambioBO; private TipoCambioBO tipoCambioBO;
@Override @Override
public String execute() throws Exception { public String execute() {
return SUCCESS; return SUCCESS;
} }
......
...@@ -34,16 +34,15 @@ public class TipoCambioAddOnsAction extends BaseContratoAction { ...@@ -34,16 +34,15 @@ public class TipoCambioAddOnsAction extends BaseContratoAction {
private boolean exito; private boolean exito;
private String mensaje; private String mensaje;
private String error; private String error;
private File file; private File file;
private String fileContentType; private String fileContentType;
private String fileFileName; private String fileFileName;
private InputStream fileInputStream; private InputStream fileInputStream;
@Autowired @Autowired
private EstudioBO estudioBO; private EstudioBO estudioBO;
@Autowired @Autowired
private TipoCambioAddOnsBO tipoCambioAddOnsBO; private TipoCambioAddOnsBO tipoCambioAddOnsBO;
...@@ -53,28 +52,33 @@ public class TipoCambioAddOnsAction extends BaseContratoAction { ...@@ -53,28 +52,33 @@ public class TipoCambioAddOnsAction extends BaseContratoAction {
return SUCCESS; return SUCCESS;
} }
public String obtenerLista() { public String obtenerLista() throws TransaccionException {
try { try {
annios = tipoCambioAddOnsBO.obtenerAnnios(); annios = tipoCambioAddOnsBO.obtenerAnnios();
estudios = estudioBO.catalogoEstudiosAddOn(); estudios = estudioBO.catalogoEstudiosAddOn();
}catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
} catch (PersistenceException ibe) { throw new TransaccionException("Ocurrio un error", e);
logger.error("Error. {}", ibe); } catch (PersistenceException e) {
logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
return SUCCESS; return SUCCESS;
} }
public String cargaMasiva() throws ExcelMapperException, IOException { public String cargaMasiva() throws ExcelMapperException, IOException {
try{ try {
nombreTipos = tipoCambioAddOnsBO.obtenerNombreMeses(); nombreTipos = tipoCambioAddOnsBO.obtenerNombreMeses();
tipoCambioAddOnsBO.cargaMasivaTipoCambioAddOn(Long.valueOf(annio), Long.parseLong(estudio), file, fileFileName, nombreTipos); tipoCambioAddOnsBO.cargaMasivaTipoCambioAddOn(Long.valueOf(annio), Long.parseLong(estudio), file,
}catch (ResultMapException e) { fileFileName, nombreTipos);
} catch (ResultMapException e) {
error = "Ocurrio un error."; error = "Ocurrio un error.";
logger.error("Error. {}", e); logger.error("Error. {}", e);
} catch (PersistenceException ibe) { } catch (PersistenceException ibe) {
...@@ -87,42 +91,48 @@ public class TipoCambioAddOnsAction extends BaseContratoAction { ...@@ -87,42 +91,48 @@ public class TipoCambioAddOnsAction extends BaseContratoAction {
error = "Ocurrio un error."; error = "Ocurrio un error.";
logger.error("Error. {}", e); logger.error("Error. {}", e);
} }
return SUCCESS; return SUCCESS;
} }
public String exportarReporte() throws TransaccionException {
public String exportarReporte() { try {
try {
fileInputStream = tipoCambioAddOnsBO.obtenerStreamReporte(Long.parseLong(estudio), annio);
fileInputStream = tipoCambioAddOnsBO.obtenerStreamReporte(Long.parseLong(estudio),annio); logger.info("ao para descarga" + annio);
logger.info("ao para descarga" + annio); } catch (ResultMapException e) {
} catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
} catch (PersistenceException ibe) { throw new TransaccionException("Ocurrio un error", e);
logger.error("Error. {}", ibe); } catch (PersistenceException e) {
logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (IllegalAccessException e) { } catch (IllegalAccessException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (ParseException e) { } catch (ParseException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (ExcelMapperException e) { } catch (ExcelMapperException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (IOException e) { } catch (IOException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (ReportCostPerViewException e) { } catch (ReportCostPerViewException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
} throw new TransaccionException("Ocurrio un error", e);
return SUCCESS; }
} return SUCCESS;
}
public String obtenerMesTipo() { public String obtenerMesTipo() {
try { try {
nombreTipos = tipoCambioAddOnsBO.obtenerNombreMeses(); nombreTipos = tipoCambioAddOnsBO.obtenerNombreMeses();
mesesTipos = tipoCambioAddOnsBO.obtenerMesTipo(Long.valueOf(estudio), annio, nombreTipos); mesesTipos = tipoCambioAddOnsBO.obtenerMesTipo(Long.valueOf(estudio), annio, nombreTipos);
}catch (ResultMapException e) { } catch (ResultMapException e) {
error = "Ocurrio un error."; error = "Ocurrio un error.";
logger.error("Error. {}", e); logger.error("Error. {}", e);
} catch (PersistenceException ibe) { } catch (PersistenceException ibe) {
...@@ -135,16 +145,16 @@ public class TipoCambioAddOnsAction extends BaseContratoAction { ...@@ -135,16 +145,16 @@ public class TipoCambioAddOnsAction extends BaseContratoAction {
error = "Ocurrio un error."; error = "Ocurrio un error.";
logger.error("Error. {}", e); logger.error("Error. {}", e);
} }
return SUCCESS; return SUCCESS;
} }
public String guardarCambio() { public String guardarCambio() {
try{ try {
exito = tipoCambioAddOnsBO.guardarCambios(mesesTipos); exito = tipoCambioAddOnsBO.guardarCambios(mesesTipos);
mensaje = "Se actualizaron los cambios."; mensaje = "Se actualizaron los cambios.";
}catch (ResultMapException e) { } catch (ResultMapException e) {
error = "Ocurrio un error."; error = "Ocurrio un error.";
mensaje = "Ocurrio un error."; mensaje = "Ocurrio un error.";
logger.error("Error. {}", e); logger.error("Error. {}", e);
...@@ -161,7 +171,7 @@ public class TipoCambioAddOnsAction extends BaseContratoAction { ...@@ -161,7 +171,7 @@ public class TipoCambioAddOnsAction extends BaseContratoAction {
mensaje = "Ocurrio un error."; mensaje = "Ocurrio un error.";
logger.error("Error. {}", e); logger.error("Error. {}", e);
} }
return SUCCESS; return SUCCESS;
} }
...@@ -172,7 +182,7 @@ public class TipoCambioAddOnsAction extends BaseContratoAction { ...@@ -172,7 +182,7 @@ public class TipoCambioAddOnsAction extends BaseContratoAction {
public void setAnnios(List<Integer> annios) { public void setAnnios(List<Integer> annios) {
this.annios = annios; this.annios = annios;
} }
public Integer getAnnio() { public Integer getAnnio() {
return annio; return annio;
} }
......
...@@ -29,41 +29,45 @@ public class CategoriasAction extends BaseAction { ...@@ -29,41 +29,45 @@ public class CategoriasAction extends BaseAction {
private TransaccionesBO transacciones; private TransaccionesBO transacciones;
@Override @Override
public String execute() throws Exception { public String execute() {
setPmns(); setPmns();
return SUCCESS; return SUCCESS;
} }
public String listadoCategorias() { public String listadoCategorias() throws TransaccionException {
try { try {
setCategorias(transacciones.getCategorias()); setCategorias(transacciones.getCategorias());
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
} catch (PersistenceException ibe) { throw new TransaccionException("Ocurrio un error", e);
logger.error("Error. {}", ibe); } catch (PersistenceException e) {
logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
return SUCCESS; return SUCCESS;
} }
public void setPmns() { public void setPmns() {
logger.debug("pmn : " + this.getPmn() + "pmnReturn : " + this.getPmnReturn()); logger.info("pmn : " + this.getPmn() + "pmnReturn : " + this.getPmnReturn());
this.getSession().put("pmn", 212); this.getSession().put("pmn", 212);
this.getSession().put("pmnReturn", 212); this.getSession().put("pmnReturn", 212);
this.setPmn("212"); this.setPmn("212");
this.setPmnReturn("212"); this.setPmnReturn("212");
} }
public String dirigirAgregar() throws Exception { public String dirigirAgregar() {
setPmns(); setPmns();
return SUCCESS; return SUCCESS;
} }
public String guardaCategoria() { public String guardaCategoria() throws TransaccionException {
CategoriasDTO categoria = new CategoriasDTO(); CategoriasDTO categoria = new CategoriasDTO();
categoria.setNombre(nombreCategoria.toUpperCase()); categoria.setNombre(nombreCategoria.toUpperCase());
...@@ -71,18 +75,22 @@ public class CategoriasAction extends BaseAction { ...@@ -71,18 +75,22 @@ public class CategoriasAction extends BaseAction {
transacciones.agregarCategoria(categoria); transacciones.agregarCategoria(categoria);
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
} catch (PersistenceException ibe) { throw new TransaccionException("Ocurrio un error", e);
logger.error("Error. {}", ibe); } catch (PersistenceException e) {
logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
setPmns(); setPmns();
return SUCCESS; return SUCCESS;
} }
public String eliminaCategoria() { public String eliminaCategoria() throws TransaccionException {
CategoriasDTO categoria = new CategoriasDTO(); CategoriasDTO categoria = new CategoriasDTO();
categoria.setIdCategoria(idCategoria); categoria.setIdCategoria(idCategoria);
categoria.setBorrado("0"); categoria.setBorrado("0");
...@@ -91,35 +99,43 @@ public class CategoriasAction extends BaseAction { ...@@ -91,35 +99,43 @@ public class CategoriasAction extends BaseAction {
transacciones.eliminarCategoria(categoria); transacciones.eliminarCategoria(categoria);
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
} catch (PersistenceException ibe) { throw new TransaccionException("Ocurrio un error", e);
logger.error("Error. {}", ibe); } catch (PersistenceException e) {
logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
setPmns(); setPmns();
return SUCCESS; return SUCCESS;
} }
public String llamaObtenCategorias() throws Exception { public String llamaObtenCategorias() throws TransaccionException {
try { try {
setCategoria(transacciones.getCategoriaById(idCategoria)); setCategoria(transacciones.getCategoriaById(idCategoria));
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
} catch (PersistenceException ibe) { throw new TransaccionException("Ocurrio un error", e);
logger.error("Error. {}", ibe); } catch (PersistenceException e) {
logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
setPmns(); setPmns();
return SUCCESS; return SUCCESS;
} }
public String llamaActualizaCategoria() throws Exception { public String llamaActualizaCategoria() throws TransaccionException {
CategoriasDTO categoria = new CategoriasDTO(); CategoriasDTO categoria = new CategoriasDTO();
categoria.setIdCategoria(idCategoria); categoria.setIdCategoria(idCategoria);
categoria.setNombre(nombreCategoria.toUpperCase()); categoria.setNombre(nombreCategoria.toUpperCase());
...@@ -128,12 +144,16 @@ public class CategoriasAction extends BaseAction { ...@@ -128,12 +144,16 @@ public class CategoriasAction extends BaseAction {
transacciones.updateCategoria(categoria); transacciones.updateCategoria(categoria);
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
} catch (PersistenceException ibe) { throw new TransaccionException("Ocurrio un error", e);
logger.error("Error. {}", ibe); } catch (PersistenceException e) {
logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
setPmns(); setPmns();
return SUCCESS; return SUCCESS;
......
...@@ -18,7 +18,7 @@ import lombok.Setter; ...@@ -18,7 +18,7 @@ import lombok.Setter;
@Getter @Getter
@Setter @Setter
public class EstudiosTransAction extends BaseAction { public class EstudiosTransAction extends BaseAction {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private List<EstudiosTransDTO> estudiosTrans; private List<EstudiosTransDTO> estudiosTrans;
private EstudiosTransDTO estudio; private EstudiosTransDTO estudio;
...@@ -31,23 +31,27 @@ public class EstudiosTransAction extends BaseAction { ...@@ -31,23 +31,27 @@ public class EstudiosTransAction extends BaseAction {
private TransaccionesBO transacciones; private TransaccionesBO transacciones;
@Override @Override
public String execute() throws Exception { public String execute() {
setPmns(); setPmns();
return SUCCESS; return SUCCESS;
} }
public String listadoEstudiosTrans() { public String listadoEstudiosTrans() throws TransaccionException {
try { try {
setEstudiosTrans(transacciones.getEstudiosTrans()); setEstudiosTrans(transacciones.getEstudiosTrans());
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
} catch (PersistenceException ibe) { throw new TransaccionException("Ocurrio un error", e);
logger.error("Error. {}", ibe); } catch (PersistenceException e) {
logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
return SUCCESS; return SUCCESS;
} }
...@@ -60,12 +64,12 @@ public class EstudiosTransAction extends BaseAction { ...@@ -60,12 +64,12 @@ public class EstudiosTransAction extends BaseAction {
this.setPmnReturn("211"); this.setPmnReturn("211");
} }
public String dirigirAgregar() throws Exception { public String dirigirAgregar() {
setPmns(); setPmns();
return SUCCESS; return SUCCESS;
} }
public String guardaEstudioTrans() { public String guardaEstudioTrans() throws TransaccionException {
EstudiosTransDTO estudio = new EstudiosTransDTO(); EstudiosTransDTO estudio = new EstudiosTransDTO();
estudio.setNombre(nombreEstudio); estudio.setNombre(nombreEstudio);
estudio.setRevenueShare(revenueShare); estudio.setRevenueShare(revenueShare);
...@@ -74,18 +78,22 @@ public class EstudiosTransAction extends BaseAction { ...@@ -74,18 +78,22 @@ public class EstudiosTransAction extends BaseAction {
transacciones.agregarEstudioTrans(estudio); transacciones.agregarEstudioTrans(estudio);
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
} catch (PersistenceException ibe) { throw new TransaccionException("Ocurrio un error", e);
logger.error("Error. {}", ibe); } catch (PersistenceException e) {
logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
setPmns(); setPmns();
return SUCCESS; return SUCCESS;
} }
public String eliminaEstudioTrans() { public String eliminaEstudioTrans() throws TransaccionException {
EstudiosTransDTO estudio = new EstudiosTransDTO(); EstudiosTransDTO estudio = new EstudiosTransDTO();
estudio.setIdEstudio(idEstudio); estudio.setIdEstudio(idEstudio);
estudio.setBorrado("0"); estudio.setBorrado("0");
...@@ -94,35 +102,43 @@ public class EstudiosTransAction extends BaseAction { ...@@ -94,35 +102,43 @@ public class EstudiosTransAction extends BaseAction {
transacciones.eliminarEstudio(estudio); transacciones.eliminarEstudio(estudio);
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
} catch (PersistenceException ibe) { throw new TransaccionException("Ocurrio un error", e);
logger.error("Error. {}", ibe); } catch (PersistenceException e) {
logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
setPmns(); setPmns();
return SUCCESS; return SUCCESS;
} }
public String llamaObtenEstudio() throws Exception { public String llamaObtenEstudio() throws TransaccionException {
try { try {
setEstudio(transacciones.getEstudioTransById(idEstudio)); setEstudio(transacciones.getEstudioTransById(idEstudio));
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
} catch (PersistenceException ibe) { throw new TransaccionException("Ocurrio un error", e);
logger.error("Error. {}", ibe); } catch (PersistenceException e) {
logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
setPmns(); setPmns();
return SUCCESS; return SUCCESS;
} }
public String llamaActualizaEstudio() throws Exception { public String llamaActualizaEstudio() throws TransaccionException {
EstudiosTransDTO estudio = new EstudiosTransDTO(); EstudiosTransDTO estudio = new EstudiosTransDTO();
estudio.setIdEstudio(idEstudio); estudio.setIdEstudio(idEstudio);
estudio.setNombre(nombreEstudio); estudio.setNombre(nombreEstudio);
...@@ -133,12 +149,16 @@ public class EstudiosTransAction extends BaseAction { ...@@ -133,12 +149,16 @@ public class EstudiosTransAction extends BaseAction {
transacciones.updateEstudioTrans(estudio); transacciones.updateEstudioTrans(estudio);
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
} catch (PersistenceException ibe) { throw new TransaccionException("Ocurrio un error", e);
logger.error("Error. {}", ibe); } catch (PersistenceException e) {
logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
setPmns(); setPmns();
return SUCCESS; return SUCCESS;
......
...@@ -37,24 +37,28 @@ public class ExcepcionesTransAction extends BaseAction { ...@@ -37,24 +37,28 @@ public class ExcepcionesTransAction extends BaseAction {
private TransaccionesBO transacciones; private TransaccionesBO transacciones;
@Override @Override
public String execute() throws Exception { public String execute() {
setPmns(); setPmns();
excepcionActualizada = true; excepcionActualizada = true;
return SUCCESS; return SUCCESS;
} }
public String listadoExcepciones() { public String listadoExcepciones() throws TransaccionException {
try { try {
setExcepciones(transacciones.getExcepciones()); setExcepciones(transacciones.getExcepciones());
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
} catch (PersistenceException ibe) { throw new TransaccionException("Ocurrio un error", e);
logger.error("Error. {}", ibe); } catch (PersistenceException e) {
logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
return SUCCESS; return SUCCESS;
} }
...@@ -67,7 +71,7 @@ public class ExcepcionesTransAction extends BaseAction { ...@@ -67,7 +71,7 @@ public class ExcepcionesTransAction extends BaseAction {
this.setPmnReturn("213"); this.setPmnReturn("213");
} }
public String dirigirAgregar() throws Exception { public String dirigirAgregar() {
try { try {
setEstudiosTrans(transacciones.getEstudiosTrans()); setEstudiosTrans(transacciones.getEstudiosTrans());
...@@ -75,9 +79,9 @@ public class ExcepcionesTransAction extends BaseAction { ...@@ -75,9 +79,9 @@ public class ExcepcionesTransAction extends BaseAction {
} catch (ResultMapException e) { } catch (ResultMapException e) {
excepcionActualizada = false; excepcionActualizada = false;
logger.error("Error. {}", e); logger.error("Error. {}", e);
} catch (PersistenceException ibe) { } catch (PersistenceException e) {
excepcionActualizada = false; excepcionActualizada = false;
logger.error("Error. {}", ibe); logger.error("Error. {}", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
excepcionActualizada = false; excepcionActualizada = false;
logger.error("Error. {}", e); logger.error("Error. {}", e);
...@@ -124,7 +128,7 @@ public class ExcepcionesTransAction extends BaseAction { ...@@ -124,7 +128,7 @@ public class ExcepcionesTransAction extends BaseAction {
return SUCCESS; return SUCCESS;
} }
public String eliminaExcepcion() { public String eliminaExcepcion() throws TransaccionException {
ExcepcionesTransDTO excepcion = new ExcepcionesTransDTO(); ExcepcionesTransDTO excepcion = new ExcepcionesTransDTO();
excepcion.setIdExcepcion(idExcepcion); excepcion.setIdExcepcion(idExcepcion);
excepcion.setBorrado("0"); excepcion.setBorrado("0");
...@@ -133,36 +137,44 @@ public class ExcepcionesTransAction extends BaseAction { ...@@ -133,36 +137,44 @@ public class ExcepcionesTransAction extends BaseAction {
transacciones.eliminarExcepcion(excepcion); transacciones.eliminarExcepcion(excepcion);
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
} catch (PersistenceException ibe) { throw new TransaccionException("Ocurrio un error", e);
logger.error("Error. {}", ibe); } catch (PersistenceException e) {
logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
setPmns(); setPmns();
return SUCCESS; return SUCCESS;
} }
public String llamaObtenExcepcion() throws Exception { public String llamaObtenExcepcion() throws TransaccionException {
try { try {
setEstudiosTrans(transacciones.getEstudiosTrans()); setEstudiosTrans(transacciones.getEstudiosTrans());
setExcepcion(transacciones.getExcepcionesById(idExcepcion)); setExcepcion(transacciones.getExcepcionesById(idExcepcion));
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
} catch (PersistenceException ibe) { throw new TransaccionException("Ocurrio un error", e);
logger.error("Error. {}", ibe); } catch (PersistenceException e) {
logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
setPmns(); setPmns();
return SUCCESS; return SUCCESS;
} }
public String llamaActualizaExcepcion() throws Exception { public String llamaActualizaExcepcion() {
ExcepcionesTransDTO excepcion = new ExcepcionesTransDTO(); ExcepcionesTransDTO excepcion = new ExcepcionesTransDTO();
excepcion.setIdExcepcion(idExcepcion); excepcion.setIdExcepcion(idExcepcion);
excepcion.setEstudio(nombreEstudio); excepcion.setEstudio(nombreEstudio);
......
...@@ -37,19 +37,23 @@ public class ReporteGeneralAction extends BaseAction { ...@@ -37,19 +37,23 @@ public class ReporteGeneralAction extends BaseAction {
private TransaccionesBO transacciones; private TransaccionesBO transacciones;
@Override @Override
public String execute() throws Exception { public String execute() throws TransaccionException {
setPmns(); setPmns();
try { try {
setEstudiosTrans(transacciones.getEstudiosTrans()); setEstudiosTrans(transacciones.getEstudiosTrans());
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
} catch (PersistenceException ibe) { throw new TransaccionException("Ocurrio un error", e);
logger.error("Error. {}", ibe); } catch (PersistenceException e) {
logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
return SUCCESS; return SUCCESS;
} }
...@@ -62,7 +66,7 @@ public class ReporteGeneralAction extends BaseAction { ...@@ -62,7 +66,7 @@ public class ReporteGeneralAction extends BaseAction {
this.setPmnReturn("215"); this.setPmnReturn("215");
} }
public String generarReporte() throws Exception { public String generarReporte() throws TransaccionException {
logger.info("Datos para reporte Fecha: " + fecha + " Estudio: " + estudio); logger.info("Datos para reporte Fecha: " + fecha + " Estudio: " + estudio);
String[] date = fecha.split("/"); String[] date = fecha.split("/");
...@@ -70,19 +74,23 @@ public class ReporteGeneralAction extends BaseAction { ...@@ -70,19 +74,23 @@ public class ReporteGeneralAction extends BaseAction {
setReporteGeneral(transacciones.reporteGeneral(date[0], date[1], estudio)); setReporteGeneral(transacciones.reporteGeneral(date[0], date[1], estudio));
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
} catch (PersistenceException ibe) { throw new TransaccionException("Ocurrio un error", e);
logger.error("Error. {}", ibe); } catch (PersistenceException e) {
logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
setPmns(); setPmns();
logger.info("Recuperando reporte: " + getReporteGeneral().size()); logger.info("Recuperando reporte: " + getReporteGeneral().size());
return SUCCESS; return SUCCESS;
} }
public String generarExcel() throws Exception { public String generarExcel() throws TransaccionException {
logger.info("Datos para reporte Fecha: " + fecha + " Estudio: " + estudio); logger.info("Datos para reporte Fecha: " + fecha + " Estudio: " + estudio);
String[] date = fecha.split("/"); String[] date = fecha.split("/");
...@@ -90,46 +98,58 @@ public class ReporteGeneralAction extends BaseAction { ...@@ -90,46 +98,58 @@ public class ReporteGeneralAction extends BaseAction {
setFileInputStream(transacciones.obtenerReporteEnExcel(date[0], date[1], estudio)); setFileInputStream(transacciones.obtenerReporteEnExcel(date[0], date[1], estudio));
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
} catch (PersistenceException ibe) { throw new TransaccionException("Ocurrio un error", e);
logger.error("Error. {}", ibe); } catch (PersistenceException e) {
logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
setFileName(date[0] + "-" + date[1] + "-01"); setFileName(date[0] + "-" + date[1] + "-01");
setPmns(); setPmns();
return SUCCESS; return SUCCESS;
} }
public String cerrarReporte() { public String cerrarReporte() throws TransaccionException {
try { try {
transacciones.cerrarRporte(getfecha()); transacciones.cerrarRporte(getfecha());
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
} catch (PersistenceException ibe) { throw new TransaccionException("Ocurrio un error", e);
logger.error("Error. {}", ibe); } catch (PersistenceException e) {
logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
return SUCCESS; return SUCCESS;
} }
public String reabrirReporte() { public String reabrirReporte() throws TransaccionException {
try { try {
transacciones.reabrirReporte(mes, anio); transacciones.reabrirReporte(mes, anio);
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
} catch (PersistenceException ibe) { throw new TransaccionException("Ocurrio un error", e);
logger.error("Error. {}", ibe); } catch (PersistenceException e) {
logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
return SUCCESS; return SUCCESS;
} }
......
...@@ -63,9 +63,7 @@ public class PresupuestosAction extends BaseContratoAction { ...@@ -63,9 +63,7 @@ public class PresupuestosAction extends BaseContratoAction {
public String cargarPresupuestos() { public String cargarPresupuestos() {
try { try {
logger.debug("Obteniendo presupuestos");
presupuestos = presupuestoBO.obtenerPresptoXTipo(tipo); presupuestos = presupuestoBO.obtenerPresptoXTipo(tipo);
logger.debug("Obtenido presupuestos");
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
mensaje = "Ocurrio un error en la operacion."; mensaje = "Ocurrio un error en la operacion.";
...@@ -96,12 +94,9 @@ public class PresupuestosAction extends BaseContratoAction { ...@@ -96,12 +94,9 @@ public class PresupuestosAction extends BaseContratoAction {
public String guardarPresupuesto() { public String guardarPresupuesto() {
ObjectMapper mapper = new ObjectMapper(); ObjectMapper mapper = new ObjectMapper();
try { try {
logger.debug("Se inicia guarda presupuestos.");
presupuesto = mapper.readValue(mensaje, PresupuestoDTO.class); presupuesto = mapper.readValue(mensaje, PresupuestoDTO.class);
mensaje = null; mensaje = null;
mensaje = presupuestoBO.guardarApartados(presupuesto.getApartados(), presupuesto.getAnio()); mensaje = presupuestoBO.guardarApartados(presupuesto.getApartados(), presupuesto.getAnio());
logger.debug("Se terminaguardar presupuestos.");
} catch (JsonParseException | JsonGenerationException | JsonMappingException je) { } catch (JsonParseException | JsonGenerationException | JsonMappingException je) {
logger.error("Error. {}", je); logger.error("Error. {}", je);
mensaje = "Ocurrio un error en la operacion."; mensaje = "Ocurrio un error en la operacion.";
...@@ -126,9 +121,7 @@ public class PresupuestosAction extends BaseContratoAction { ...@@ -126,9 +121,7 @@ public class PresupuestosAction extends BaseContratoAction {
public String cargarApartadosAnio() { public String cargarApartadosAnio() {
try { try {
logger.info("Se obtiene apartado x anio");
presupuesto = presupuestoBO.obtenerApartadosPresptoXAnio(this.tipo, this.anio.intValue()); presupuesto = presupuestoBO.obtenerApartadosPresptoXAnio(this.tipo, this.anio.intValue());
logger.info("Se termina obtener apartado x anio");
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
mensaje = "Ocurrio un error en la operacion."; mensaje = "Ocurrio un error en la operacion.";
...@@ -148,15 +141,11 @@ public class PresupuestosAction extends BaseContratoAction { ...@@ -148,15 +141,11 @@ public class PresupuestosAction extends BaseContratoAction {
public String redistribuirPresupuesto() { public String redistribuirPresupuesto() {
ObjectMapper mapper = new ObjectMapper(); ObjectMapper mapper = new ObjectMapper();
try { try {
logger.debug("Se inicia redistribucion");
List<PresupuestoApartadoDTO> apartados = mapper.readValue(mensaje, List<PresupuestoApartadoDTO> apartados = mapper.readValue(mensaje,
new TypeReference<List<PresupuestoApartadoDTO>>() { new TypeReference<List<PresupuestoApartadoDTO>>() {
}); });
mensaje = null; mensaje = null;
mensaje = presupuestoBO.redistribuirApartados(apartados, Integer.parseInt(tipo)); mensaje = presupuestoBO.redistribuirApartados(apartados, Integer.parseInt(tipo));
logger.debug("Se termina redistribucion");
} catch (JsonParseException | JsonGenerationException | JsonMappingException je) { } catch (JsonParseException | JsonGenerationException | JsonMappingException je) {
logger.error("Error. {}", je); logger.error("Error. {}", je);
mensaje = "Ocurrio un error en la operacion."; mensaje = "Ocurrio un error en la operacion.";
...@@ -182,15 +171,11 @@ public class PresupuestosAction extends BaseContratoAction { ...@@ -182,15 +171,11 @@ public class PresupuestosAction extends BaseContratoAction {
public String redistribuirPresupuestoMontoDisp() { public String redistribuirPresupuestoMontoDisp() {
ObjectMapper mapper = new ObjectMapper(); ObjectMapper mapper = new ObjectMapper();
try { try {
logger.debug("Se inicia redistribucion con monto disponible");
List<PresupuestoApartadoDTO> apartados = mapper.readValue(mensaje, List<PresupuestoApartadoDTO> apartados = mapper.readValue(mensaje,
new TypeReference<List<PresupuestoApartadoDTO>>() { new TypeReference<List<PresupuestoApartadoDTO>>() {
}); });
mensaje = null; mensaje = null;
mensaje = presupuestoBO.redistribuirApartadosMontoDispo(apartados, Integer.parseInt(tipo)); mensaje = presupuestoBO.redistribuirApartadosMontoDispo(apartados, Integer.parseInt(tipo));
logger.debug("Se termina redistribucion");
} catch (JsonParseException | JsonGenerationException | JsonMappingException je) { } catch (JsonParseException | JsonGenerationException | JsonMappingException je) {
logger.error("Error. {}", je); logger.error("Error. {}", je);
mensaje = "Ocurrio un error en la operacion."; mensaje = "Ocurrio un error en la operacion.";
......
...@@ -16,42 +16,41 @@ public class RevenuePorcAction extends BaseAction { ...@@ -16,42 +16,41 @@ public class RevenuePorcAction extends BaseAction {
private static final long serialVersionUID = -1L; private static final long serialVersionUID = -1L;
private static Logger log = Logger.getLogger(RevenuePorcAction.class); private static Logger log = Logger.getLogger(RevenuePorcAction.class);
@Autowired @Autowired
private CargaTransaccionesBO bdsp; private CargaTransaccionesBO bdsp;
private String fecha; private String fecha;
@Override @Override
public String execute() throws Exception { public String execute() {
return SUCCESS; return SUCCESS;
} }
public String ejecutaSP() throws TransaccionException {
public String ejecutaSP() {
try { try {
bdsp.ejecutaSP_porcR(fecha); bdsp.ejecutaSP_porcR(fecha);
} catch (ResultMapException e) { } catch (ResultMapException e) {
log.error("Error. {}", e); log.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (PersistenceException e) { } catch (PersistenceException e) {
log.error("Error. {}", e); log.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
log.error("Error. {}", e); log.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
log.error("Error. {}", e); log.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
return Action.SUCCESS; return Action.SUCCESS;
} }
public String getFecha() { public String getFecha() {
return fecha; return fecha;
} }
public void setFecha(String fecha) { public void setFecha(String fecha) {
this.fecha = fecha; this.fecha = fecha;
} }
} }
...@@ -45,16 +45,16 @@ public class CargaSuscriptoresAction extends BaseContratoAction { ...@@ -45,16 +45,16 @@ public class CargaSuscriptoresAction extends BaseContratoAction {
try { try {
listado = cargaSuscriptorBO.getDatosSuscripcion(mes, annio); listado = cargaSuscriptorBO.getDatosSuscripcion(mes, annio);
} catch (ResultMapException e) { } catch (ResultMapException e) {
this.msgError = "Ocurrió un error al obtener los datos."; this.msgError = "Ocurri un error al obtener los datos.";
logger.error("Error en [" + this.getClass() + "]", e); logger.error("Error en [" + this.getClass() + "]", e);
} catch (PersistenceException e) { } catch (PersistenceException e) {
this.msgError = "Ocurrió un error al obtener los datos."; this.msgError = "Ocurri un error al obtener los datos.";
logger.error("Error en [" + this.getClass() + "]", e); logger.error("Error en [" + this.getClass() + "]", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
this.msgError = "Ocurrió un error al obtener los datos."; this.msgError = "Ocurri un error al obtener los datos.";
logger.error("Error en [" + this.getClass() + "]", e); logger.error("Error en [" + this.getClass() + "]", e);
} catch (SQLException e) { } catch (SQLException e) {
this.msgError = "Ocurrió un error al obtener los datos."; this.msgError = "Ocurri un error al obtener los datos.";
logger.error("Error en [" + this.getClass() + "]", e); logger.error("Error en [" + this.getClass() + "]", e);
} }
...@@ -66,14 +66,10 @@ public class CargaSuscriptoresAction extends BaseContratoAction { ...@@ -66,14 +66,10 @@ public class CargaSuscriptoresAction extends BaseContratoAction {
ObjectMapper mapper = new ObjectMapper(); ObjectMapper mapper = new ObjectMapper();
try { try {
logger.debug("Actualizacion Carga:" + request);
listado = mapper.readValue(request, new TypeReference<List<CargaSuscripcionDTO>>() { listado = mapper.readValue(request, new TypeReference<List<CargaSuscripcionDTO>>() {
}); });
cargaSuscriptorBO.actualizarSuscriptores(listado); cargaSuscriptorBO.actualizarSuscriptores(listado);
logger.debug("Se actulizaron valores carga");
msgExito = "Los datos fueron guardados con Exito"; msgExito = "Los datos fueron guardados con Exito";
...@@ -104,12 +100,10 @@ public class CargaSuscriptoresAction extends BaseContratoAction { ...@@ -104,12 +100,10 @@ public class CargaSuscriptoresAction extends BaseContratoAction {
try { try {
setInformacionExcel(cargaSuscriptorBO.obtenInformacionExcel(fileUpload, fileUploadFileName)); setInformacionExcel(cargaSuscriptorBO.obtenInformacionExcel(fileUpload, fileUploadFileName));
logger.debug("Se leyo la informacion.");
} catch (TransaccionException e) { } catch (TransaccionException e) {
this.msgError = "Ocurrió un error al obtener los datos."; this.msgError = "Ocurrió un error al obtener los datos.";
logger.error("Error en [" + this.getClass() + "]", e); logger.error("Error en [" + this.getClass() + "]", e);
} }
logger.debug("Se termino el action");
return Action.SUCCESS; return Action.SUCCESS;
} }
......
...@@ -21,16 +21,14 @@ public class DescargaPlantillaAction extends BaseContratoAction{ ...@@ -21,16 +21,14 @@ public class DescargaPlantillaAction extends BaseContratoAction{
@Autowired @Autowired
private CargaSuscriptorBO cargaSuscriptorBO; private CargaSuscriptorBO cargaSuscriptorBO;
public String execute() throws Exception { public String execute() {
String[] empresasSplited = {"Clarovideo Brazil", "Net Servicios", "Clarovideo Argentina", "Clarovideo Chile", String[] empresasSplited = {"Clarovideo Brazil", "Net Servicios", "Clarovideo Argentina", "Clarovideo Chile",
"Clarovideo Colombia", "Clarovideo Costa Rica", "Clarovideo Dominicana", "Clarovideo Ecuador", "Clarovideo Colombia", "Clarovideo Costa Rica", "Clarovideo Dominicana", "Clarovideo Ecuador",
"Clarovideo El Salvador", "Clarovideo Guatemala", "Clarovideo Honduras", "Clarovideo Mxico", "Clarovideo El Salvador", "Clarovideo Guatemala", "Clarovideo Honduras", "Clarovideo Mxico",
"Clarovideo Nicaragua", "Clarovideo Per", "Clarovideo Uruguay"}; "Clarovideo Nicaragua", "Clarovideo Per", "Clarovideo Uruguay"};
logger.debug(empresas);
if(empresas != null && !empresas.equals("")){ if(empresas != null && !empresas.equals("")){
empresasSplited = empresas.split(","); empresasSplited = empresas.split(",");
} }
logger.debug("[{}]", empresasSplited);
fileInputStream = new ByteArrayInputStream(cargaSuscriptorBO.obtenPlantilla(empresasSplited)); fileInputStream = new ByteArrayInputStream(cargaSuscriptorBO.obtenPlantilla(empresasSplited));
fileName = "nombre"; fileName = "nombre";
return SUCCESS; return SUCCESS;
......
...@@ -63,7 +63,7 @@ public class CargaTransaccionesAction extends BaseContratoAction { ...@@ -63,7 +63,7 @@ public class CargaTransaccionesAction extends BaseContratoAction {
private CargaTransaccionesBO cargaTransaccionesBO; private CargaTransaccionesBO cargaTransaccionesBO;
@Override @Override
public String execute() throws Exception { public String execute() {
return SUCCESS; return SUCCESS;
} }
...@@ -85,7 +85,7 @@ public class CargaTransaccionesAction extends BaseContratoAction { ...@@ -85,7 +85,7 @@ public class CargaTransaccionesAction extends BaseContratoAction {
return SUCCESS; return SUCCESS;
} }
public String obtenerVistaPrevia() { public String obtenerVistaPrevia() throws TransaccionException {
try { try {
String fileFileName = "vistaprevia"; String fileFileName = "vistaprevia";
...@@ -96,24 +96,31 @@ public class CargaTransaccionesAction extends BaseContratoAction { ...@@ -96,24 +96,31 @@ public class CargaTransaccionesAction extends BaseContratoAction {
vistaPrevia = cargaTransaccionesBO.obtenerVistaPrevia(fileFileName, idCarga); vistaPrevia = cargaTransaccionesBO.obtenerVistaPrevia(fileFileName, idCarga);
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("error CargaTransaccionesAction: " + e); logger.error("error CargaTransaccionesAction: " + e);
throw new TransaccionException("Ocurrio un error", e);
} catch (PersistenceException e) { } catch (PersistenceException e) {
logger.error("error CargaTransaccionesAction: " + e); logger.error("error CargaTransaccionesAction: " + e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("error CargaTransaccionesAction: " + e); logger.error("error CargaTransaccionesAction: " + e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("error CargaTransaccionesAction: " + e); logger.error("error CargaTransaccionesAction: " + e);
throw new TransaccionException("Ocurrio un error", e);
} catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) {
logger.error("error CargaTransaccionesAction: " + e); logger.error("error CargaTransaccionesAction: " + e);
throw new TransaccionException("Ocurrio un error", e);
} catch (IllegalAccessException e) { } catch (IllegalAccessException e) {
logger.error("error CargaTransaccionesAction: " + e); logger.error("error CargaTransaccionesAction: " + e);
throw new TransaccionException("Ocurrio un error", e);
} catch (IOException e) { } catch (IOException e) {
logger.error("error CargaTransaccionesAction: " + e); logger.error("error CargaTransaccionesAction: " + e);
throw new TransaccionException("Ocurrio un error", e);
} }
return SUCCESS; return SUCCESS;
} }
// nuevo reporte excel vista previa jul2017 // nuevo reporte excel vista previa jul2017
public String generaReporteVistaPreviaAction() { public String generaReporteVistaPreviaAction() throws TransaccionException {
try { try {
UsuarioDTO usuario = (UsuarioDTO) getSession().get("usuario"); UsuarioDTO usuario = (UsuarioDTO) getSession().get("usuario");
...@@ -131,39 +138,52 @@ public class CargaTransaccionesAction extends BaseContratoAction { ...@@ -131,39 +138,52 @@ public class CargaTransaccionesAction extends BaseContratoAction {
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("error generaReporteVistaPreviaAction: " + e); logger.error("error generaReporteVistaPreviaAction: " + e);
throw new TransaccionException("Ocurrio un error", e);
} catch (PersistenceException e) { } catch (PersistenceException e) {
logger.error("error generaReporteVistaPreviaAction: " + e); logger.error("error generaReporteVistaPreviaAction: " + e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("error generaReporteVistaPreviaAction: " + e); logger.error("error generaReporteVistaPreviaAction: " + e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("error generaReporteVistaPreviaAction: " + e); logger.error("error generaReporteVistaPreviaAction: " + e);
throw new TransaccionException("Ocurrio un error", e);
} catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) {
logger.error("error generaReporteVistaPreviaAction: " + e); logger.error("error generaReporteVistaPreviaAction: " + e);
throw new TransaccionException("Ocurrio un error", e);
} catch (IllegalAccessException e) { } catch (IllegalAccessException e) {
logger.error("error generaReporteVistaPreviaAction: " + e); logger.error("error generaReporteVistaPreviaAction: " + e);
throw new TransaccionException("Ocurrio un error", e);
} catch (IOException e) { } catch (IOException e) {
logger.error("error generaReporteVistaPreviaAction: " + e); logger.error("error generaReporteVistaPreviaAction: " + e);
throw new TransaccionException("Ocurrio un error", e);
} }
return SUCCESS; return SUCCESS;
} }
// rediseo vistaprevia jul2017 // rediseo vistaprevia jul2017
public String reporteVistaPrevia() { public String reporteVistaPrevia() throws TransaccionException {
try { try {
listaPaises = cargaTransaccionesBO.obtenListaPaises(); listaPaises = cargaTransaccionesBO.obtenListaPaises();
repvistaprevia = cargaTransaccionesBO.generaRepVistaPrevia(idCarga); repvistaprevia = cargaTransaccionesBO.generaRepVistaPrevia(idCarga);
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("error al obtener action reporteVistaPrevia: " + e); logger.error("error al obtener action reporteVistaPrevia: " + e);
throw new TransaccionException("Ocurrio un error", e);
} catch (PersistenceException e) { } catch (PersistenceException e) {
logger.error("error al obtener action reporteVistaPrevia: " + e); logger.error("error al obtener action reporteVistaPrevia: " + e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("error al obtener action reporteVistaPrevia: " + e); logger.error("error al obtener action reporteVistaPrevia: " + e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("error al obtener action reporteVistaPrevia: " + e); logger.error("error al obtener action reporteVistaPrevia: " + e);
throw new TransaccionException("Ocurrio un error", e);
} catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) {
logger.error("error al obtener action reporteVistaPrevia: " + e); logger.error("error al obtener action reporteVistaPrevia: " + e);
throw new TransaccionException("Ocurrio un error", e);
} catch (IllegalAccessException e) { } catch (IllegalAccessException e) {
logger.error("error al obtener action reporteVistaPrevia: " + e); logger.error("error al obtener action reporteVistaPrevia: " + e);
throw new TransaccionException("Ocurrio un error", e);
} }
return SUCCESS; return SUCCESS;
} }
...@@ -440,19 +460,23 @@ public class CargaTransaccionesAction extends BaseContratoAction { ...@@ -440,19 +460,23 @@ public class CargaTransaccionesAction extends BaseContratoAction {
return SUCCESS; return SUCCESS;
} }
public String descargaPlantillaTransacciones() { public String descargaPlantillaTransacciones() throws TransaccionException {
try { try {
fileInputStream = new ByteArrayInputStream(cargaTransaccionesBO.obtenPlantilla()); fileInputStream = new ByteArrayInputStream(cargaTransaccionesBO.obtenPlantilla());
setFileName("nombre"); setFileName("nombre");
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error_Action_descargaPlantillaTransacciones: [{}],", e); logger.error("Error_Action_descargaPlantillaTransacciones: [{}],", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (PersistenceException e) { } catch (PersistenceException e) {
logger.error("Error_Action_descargaPlantillaTransacciones: [{}],", e); logger.error("Error_Action_descargaPlantillaTransacciones: [{}],", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error_Action_descargaPlantillaTransacciones: [{}],", e); logger.error("Error_Action_descargaPlantillaTransacciones: [{}],", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("Error_Action_descargaPlantillaTransacciones: [{}],", e); logger.error("Error_Action_descargaPlantillaTransacciones: [{}],", e);
throw new TransaccionException("Ocurrio un error", e);
} }
return SUCCESS; return SUCCESS;
} }
......
...@@ -23,48 +23,54 @@ public class DescargaArchivoVistaPreviaAction extends BaseContratoAction { ...@@ -23,48 +23,54 @@ public class DescargaArchivoVistaPreviaAction extends BaseContratoAction {
String algo; String algo;
private static final long serialVersionUID = 281552368437405368L; private static final long serialVersionUID = 281552368437405368L;
private String error; private String error;
private List<RowReporteCargaDTO> vistaPrevia; private List<RowReporteCargaDTO> vistaPrevia;
@Autowired @Autowired
private CargaTransaccionesBO cargaTransaccionesBO; private CargaTransaccionesBO cargaTransaccionesBO;
public String descargaArchivoVistaPrevia(){ public String descargaArchivoVistaPrevia() throws TransaccionException {
logger.info("se : [{}]", error); logger.info("se : [{}]", error);
logger.info(algo); logger.info(algo);
String nombre; String nombre;
byte[] vistaPreviac; byte[] vistaPreviac;
try { try {
vistaPreviac = cargaTransaccionesBO.descargaArchivoVistaPrevia(vistaPrevia); vistaPreviac = cargaTransaccionesBO.descargaArchivoVistaPrevia(vistaPrevia);
nombre = "reporteVistaPreviaCargaTransacciones"; nombre = "reporteVistaPreviaCargaTransacciones";
HttpServletResponse response = ServletActionContext.getResponse(); HttpServletResponse response = ServletActionContext.getResponse();
response.setContentLength(vistaPreviac.length); response.setContentLength(vistaPreviac.length);
response.setContentType(ContentType.EXCELX.name()); response.setContentType(ContentType.EXCELX.name());
response.setHeader("Content-Disposition","attachment;filename="+nombre+".xlsx"); response.setHeader("Content-Disposition", "attachment;filename=" + nombre + ".xlsx");
ServletOutputStream out = response.getOutputStream(); ServletOutputStream out = response.getOutputStream();
out.write(vistaPreviac); out.write(vistaPreviac);
out.flush(); out.flush();
out.close(); out.close();
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error al invocar descargaArchivoVistaPrevia : " + error); logger.error("Error al invocar descargaArchivoVistaPrevia : " + error);
throw new TransaccionException("Ocurrio un error", e);
} catch (PersistenceException e) { } catch (PersistenceException e) {
logger.error("Error al invocar descargaArchivoVistaPrevia : " + error); logger.error("Error al invocar descargaArchivoVistaPrevia : " + error);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error al invocar descargaArchivoVistaPrevia : " + error); logger.error("Error al invocar descargaArchivoVistaPrevia : " + error);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("Error al invocar descargaArchivoVistaPrevia : " + error); logger.error("Error al invocar descargaArchivoVistaPrevia : " + error);
throw new TransaccionException("Ocurrio un error", e);
} catch (IOException e) { } catch (IOException e) {
logger.error("Error al invocar descargaArchivoVistaPrevia : " + error); logger.error("Error al invocar descargaArchivoVistaPrevia : " + error);
throw new TransaccionException("Ocurrio un error", e);
} }
return SUCCESS; return SUCCESS;
} }
public void setError(String error) { public void setError(String error) {
this.error = error; this.error = error;
} }
public String getError() { public String getError() {
return error; return error;
} }
...@@ -72,10 +78,9 @@ public class DescargaArchivoVistaPreviaAction extends BaseContratoAction { ...@@ -72,10 +78,9 @@ public class DescargaArchivoVistaPreviaAction extends BaseContratoAction {
public void setVistaPrevia(List<RowReporteCargaDTO> vistaPrevia) { public void setVistaPrevia(List<RowReporteCargaDTO> vistaPrevia) {
this.vistaPrevia = vistaPrevia; this.vistaPrevia = vistaPrevia;
} }
public List<RowReporteCargaDTO> getVistaPrevia() { public List<RowReporteCargaDTO> getVistaPrevia() {
return vistaPrevia; return vistaPrevia;
} }
} }
...@@ -25,23 +25,22 @@ public class CatalogosAction extends BaseAction { ...@@ -25,23 +25,22 @@ public class CatalogosAction extends BaseAction {
private String tipoOperacion; private String tipoOperacion;
private int idContrato; private int idContrato;
private List<EstudioDTO> estudios; private List<EstudioDTO> estudios;
private List<CategoriaDTO> categorias; private List<CategoriaDTO> categorias;
private List<ServicioDTO> servicios; private List<ServicioDTO> servicios;
private List<TerritorioDTO> territorios; private List<TerritorioDTO> territorios;
private List<MedioEntregaDTO> mediosEntrega; private List<MedioEntregaDTO> mediosEntrega;
@Autowired @Autowired
private CatalogosBO catalogosBO; private CatalogosBO catalogosBO;
@Override @Override
public String execute() throws Exception { public String execute() {
return SUCCESS; return SUCCESS;
} }
public String metodo() { public String metodo() throws TransaccionException {
try { try {
setIdContrato(catalogosBO.obtenSqIdContrato(tipoOperacion, idContrato)); setIdContrato(catalogosBO.obtenSqIdContrato(tipoOperacion, idContrato));
setEstudios(catalogosBO.obtenListaEstudios()); setEstudios(catalogosBO.obtenListaEstudios());
...@@ -51,10 +50,13 @@ public class CatalogosAction extends BaseAction { ...@@ -51,10 +50,13 @@ public class CatalogosAction extends BaseAction {
setMediosEntrega(catalogosBO.obtenListaMediosEntrega()); setMediosEntrega(catalogosBO.obtenListaMediosEntrega());
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error al invocar CatalogosAction.metodo : ", e); logger.error("Error al invocar CatalogosAction.metodo : ", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("Error al invocar CatalogosAction.metodo : ", e); logger.error("Error al invocar CatalogosAction.metodo : ", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error al invocar CatalogosAction.metodo : ", e); logger.error("Error al invocar CatalogosAction.metodo : ", e);
throw new TransaccionException("Ocurrio un error", e);
} }
return "OK"; return "OK";
} }
......
...@@ -19,25 +19,25 @@ import com.mx.dla.dda.contrato.titulo.exception.TituloException; ...@@ -19,25 +19,25 @@ import com.mx.dla.dda.contrato.titulo.exception.TituloException;
import com.mx.dla.dda.contrato.transaccion.exceptions.dtos.TransaccionException; import com.mx.dla.dda.contrato.transaccion.exceptions.dtos.TransaccionException;
public class AmortizacionAction extends BaseContratoAction { public class AmortizacionAction extends BaseContratoAction {
private static final long serialVersionUID = -1880333104009351799L; private static final long serialVersionUID = -1880333104009351799L;
@Autowired @Autowired
private AmortizacionBO amortizacionBO; private AmortizacionBO amortizacionBO;
@Autowired @Autowired
private GeneralesBO generalesBO; private GeneralesBO generalesBO;
private Lista lista; private Lista lista;
private List<Titulo> titulos; private List<Titulo> titulos;
private Titulo titulo; private Titulo titulo;
private String error; private String error;
@Override @Override
public String execute() { public String execute() throws TransaccionException {
Long idC = (Long) getSession().get(ContratoConstats.ID_CONTRATO_SESSION); Long idC = (Long) getSession().get(ContratoConstats.ID_CONTRATO_SESSION);
ContratoDTO ct; ContratoDTO ct;
try { try {
...@@ -45,22 +45,22 @@ public class AmortizacionAction extends BaseContratoAction { ...@@ -45,22 +45,22 @@ public class AmortizacionAction extends BaseContratoAction {
getSession().put(ContratoConstats.CONTRATO_SESSION, ct); getSession().put(ContratoConstats.CONTRATO_SESSION, ct);
lista = amortizacionBO.buscarListaActual(ct); lista = amortizacionBO.buscarListaActual(ct);
getSession().put(ContratoConstats.LISTA_SESSION, lista); getSession().put(ContratoConstats.LISTA_SESSION, lista);
logger.debug("sube objetos a la sesion");
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
return SUCCESS; return SUCCESS;
} }
public String busqueda() {
public String busqueda() ContratoDTO ct = (ContratoDTO) getSession().get(ContratoConstats.CONTRATO_SESSION);
{ Lista li = (Lista) getSession().get(ContratoConstats.LISTA_SESSION);
ContratoDTO ct = (ContratoDTO) getSession().get( ContratoConstats.CONTRATO_SESSION);
Lista li = (Lista) getSession().get( ContratoConstats.LISTA_SESSION);
try { try {
titulos = amortizacionBO.busqueda(ct, li, titulo); titulos = amortizacionBO.busqueda(ct, li, titulo);
} catch (TituloException e) { } catch (TituloException e) {
...@@ -74,11 +74,10 @@ public class AmortizacionAction extends BaseContratoAction { ...@@ -74,11 +74,10 @@ public class AmortizacionAction extends BaseContratoAction {
} }
return SUCCESS; return SUCCESS;
} }
public String busquedaDetalle() public String busquedaDetalle() {
{
try { try {
titulos = amortizacionBO.busquedaDetalle( titulo); titulos = amortizacionBO.busquedaDetalle(titulo);
} catch (TituloException e) { } catch (TituloException e) {
setError(e.getMessage()); setError(e.getMessage());
} }
...@@ -88,26 +87,27 @@ public class AmortizacionAction extends BaseContratoAction { ...@@ -88,26 +87,27 @@ public class AmortizacionAction extends BaseContratoAction {
public String find() { public String find() {
return SUCCESS; return SUCCESS;
} }
public Lista getLista() { public Lista getLista() {
return lista; return lista;
} }
public void setLista(Lista lista) { public void setLista(Lista lista) {
this.lista = lista; this.lista = lista;
} }
public Titulo getTitulo() { public Titulo getTitulo() {
return titulo; return titulo;
} }
public void setTitulo(Titulo titulo) { public void setTitulo(Titulo titulo) {
this.titulo = titulo; this.titulo = titulo;
} }
public List<Titulo> getTitulos() { public List<Titulo> getTitulos() {
return titulos; return titulos;
} }
public void setTitulos(List<Titulo> titulos) { public void setTitulos(List<Titulo> titulos) {
this.titulos = titulos; this.titulos = titulos;
} }
...@@ -115,7 +115,7 @@ public class AmortizacionAction extends BaseContratoAction { ...@@ -115,7 +115,7 @@ public class AmortizacionAction extends BaseContratoAction {
public String getError() { public String getError() {
return error; return error;
} }
public void setError(String error) { public void setError(String error) {
this.error = error; this.error = error;
} }
......
...@@ -10,47 +10,49 @@ import com.mx.dla.dda.contrato.generales.bos.GeneralesBO; ...@@ -10,47 +10,49 @@ import com.mx.dla.dda.contrato.generales.bos.GeneralesBO;
import com.mx.dla.dda.contrato.generales.dtos.ContratoDTO; import com.mx.dla.dda.contrato.generales.dtos.ContratoDTO;
import com.mx.dla.dda.contrato.transaccion.exceptions.dtos.TransaccionException; import com.mx.dla.dda.contrato.transaccion.exceptions.dtos.TransaccionException;
public class BdealAction extends BaseContratoAction{ public class BdealAction extends BaseContratoAction {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@Autowired @Autowired
private GeneralesBO generalesBO; private GeneralesBO generalesBO;
private Long idContrato; private Long idContrato;
private Long estatus; private Long estatus;
public String execute() { public String execute() throws TransaccionException {
ContratoDTO contrato = null; ContratoDTO contrato = null;
setIdContrato((Long)this.getSession().get("idContrato")); setIdContrato((Long) this.getSession().get("idContrato"));
try { try {
contrato = generalesBO.obtenContrato(idContrato); contrato = generalesBO.obtenContrato(idContrato);
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
setEstatus(contrato.getIdEstatus()); setEstatus(contrato.getIdEstatus());
return SUCCESS; return SUCCESS;
} }
public void setIdContrato(Long idContrato) { public void setIdContrato(Long idContrato) {
this.idContrato = idContrato; this.idContrato = idContrato;
} }
public Long getIdContrato() { public Long getIdContrato() {
return idContrato; return idContrato;
} }
public void setEstatus(Long estatus) { public void setEstatus(Long estatus) {
this.estatus = estatus; this.estatus = estatus;
} }
public Long getEstatus() { public Long getEstatus() {
return estatus; return estatus;
} }
} }
package com.mx.dla.dda.contrato.condicionesLicense.actions; package com.mx.dla.dda.contrato.condicionesLicense.actions;
import java.sql.SQLException;
import java.text.ParseException; import java.text.ParseException;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import org.apache.ibatis.executor.result.ResultMapException;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import com.mx.dla.dda.catalogos.dtos.CatalogoDTO; import com.mx.dla.dda.catalogos.dtos.CatalogoDTO;
...@@ -17,6 +19,7 @@ import com.mx.dla.dda.contrato.condicionesLicense.dtos.PlicenseDTO; ...@@ -17,6 +19,7 @@ import com.mx.dla.dda.contrato.condicionesLicense.dtos.PlicenseDTO;
import com.mx.dla.dda.contrato.condicionesLicense.exception.CondicionesLicenseException; import com.mx.dla.dda.contrato.condicionesLicense.exception.CondicionesLicenseException;
import com.mx.dla.dda.contrato.generales.bos.GeneralesBO; import com.mx.dla.dda.contrato.generales.bos.GeneralesBO;
import com.mx.dla.dda.contrato.generales.dtos.ContratoDTO; import com.mx.dla.dda.contrato.generales.dtos.ContratoDTO;
import com.mx.dla.dda.contrato.transaccion.exceptions.dtos.TransaccionException;
public class CondicionesLicenseAction extends BaseContratoAction { public class CondicionesLicenseAction extends BaseContratoAction {
...@@ -31,17 +34,36 @@ public class CondicionesLicenseAction extends BaseContratoAction { ...@@ -31,17 +34,36 @@ public class CondicionesLicenseAction extends BaseContratoAction {
private PlicenseDTO condiciones; private PlicenseDTO condiciones;
@Override @Override
public String execute() throws Exception { public String execute() throws TransaccionException {
Long idC = (Long) getSession().get(ContratoConstats.ID_CONTRATO_SESSION); Long idC = (Long) getSession().get(ContratoConstats.ID_CONTRATO_SESSION);
setIdContrato(idC); setIdContrato(idC);
ContratoDTO ct = generalesBO.obtenContrato(idC); ContratoDTO ct = null;
getSession().put(ContratoConstats.CONTRATO_SESSION, ct); try {
setEstatusContrato(ct.getIdEstatus()); ct = generalesBO.obtenContrato(idC);
getSession().put(ContratoConstats.CONTRATO_SESSION, ct);
setEstatusContrato(ct.getIdEstatus());
buscarCondiciones(ct); buscarCondiciones(ct);
buscarJustificaciones(); buscarJustificaciones();
return super.execute(); return super.execute();
} catch (ResultMapException e) {
logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) {
logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) {
logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (ParseException e) {
logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (Exception e) {
logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
}
} }
public String save() { public String save() {
...@@ -63,9 +85,9 @@ public class CondicionesLicenseAction extends BaseContratoAction { ...@@ -63,9 +85,9 @@ public class CondicionesLicenseAction extends BaseContratoAction {
buscarCondiciones(ct); buscarCondiciones(ct);
buscarJustificaciones(); buscarJustificaciones();
} catch (CondicionesLicenseException e) { } catch (CondicionesLicenseException e) {
addActionError("Ocurrió un error al guardar los datos"); addActionError("Ocurri un error al guardar los datos");
} catch (ParseException e) { } catch (ParseException e) {
addActionError("Ocurrió un error al guardar los datos"); addActionError("Ocurri un error al guardar los datos");
} }
return SUCCESS; return SUCCESS;
} }
......
...@@ -45,7 +45,7 @@ public class CatalogosTransaccionAction extends BaseContratoAction ...@@ -45,7 +45,7 @@ public class CatalogosTransaccionAction extends BaseContratoAction
@Autowired @Autowired
private CondicionesTransaccionBO transaccionBO; private CondicionesTransaccionBO transaccionBO;
public String execute() { public String execute() throws TransaccionException {
ObjectMapper mapper = new ObjectMapper(); ObjectMapper mapper = new ObjectMapper();
try { try {
...@@ -100,20 +100,28 @@ public class CatalogosTransaccionAction extends BaseContratoAction ...@@ -100,20 +100,28 @@ public class CatalogosTransaccionAction extends BaseContratoAction
} catch (JsonParseException e) { } catch (JsonParseException e) {
log.error("Error CatalogosListadoAction.", e); log.error("Error CatalogosListadoAction.", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (JsonGenerationException e) { } catch (JsonGenerationException e) {
log.error("Error CatalogosListadoAction.", e); log.error("Error CatalogosListadoAction.", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (JsonMappingException e) { } catch (JsonMappingException e) {
log.error("Error CatalogosListadoAction.", e); log.error("Error CatalogosListadoAction.", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (IOException e) { } catch (IOException e) {
log.error("Error CatalogosListadoAction.", e); log.error("Error CatalogosListadoAction.", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (ResultMapException e) { } catch (ResultMapException e) {
log.error("Error CatalogosListadoAction.", e); log.error("Error CatalogosListadoAction.", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (PersistenceException e) { } catch (PersistenceException e) {
log.error("Error CatalogosListadoAction.", e); log.error("Error CatalogosListadoAction.", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
log.error("Error CatalogosListadoAction.", e); log.error("Error CatalogosListadoAction.", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
log.error("Error CatalogosListadoAction.", e); log.error("Error CatalogosListadoAction.", e);
throw new TransaccionException("Ocurrio un error", e);
} }
return Action.SUCCESS; return Action.SUCCESS;
......
package com.mx.dla.dda.contrato.condicionesTransaccion.actions; package com.mx.dla.dda.contrato.condicionesTransaccion.actions;
import java.sql.SQLException;
import org.apache.ibatis.executor.result.ResultMapException;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import com.mx.dla.dda.contrato.common.actions.BaseContratoAction; import com.mx.dla.dda.contrato.common.actions.BaseContratoAction;
import com.mx.dla.dda.contrato.generales.bos.GeneralesBO; import com.mx.dla.dda.contrato.generales.bos.GeneralesBO;
import com.mx.dla.dda.contrato.generales.dtos.ContratoDTO; import com.mx.dla.dda.contrato.generales.dtos.ContratoDTO;
import com.mx.dla.dda.contrato.transaccion.exceptions.dtos.TransaccionException;
public class CondicionesTransaccionAction extends BaseContratoAction { public class CondicionesTransaccionAction extends BaseContratoAction {
...@@ -16,11 +20,22 @@ public class CondicionesTransaccionAction extends BaseContratoAction { ...@@ -16,11 +20,22 @@ public class CondicionesTransaccionAction extends BaseContratoAction {
private GeneralesBO generales; private GeneralesBO generales;
@Override @Override
public String execute() throws Exception { public String execute() throws TransaccionException {
this.setIdContrato((Long) this.getSession().get("idContrato")); this.setIdContrato((Long) this.getSession().get("idContrato"));
buscarJustificaciones(); buscarJustificaciones();
contrato = generales.obtenContrato(getIdContrato()); try {
contrato = generales.obtenContrato(getIdContrato());
} catch (ResultMapException e) {
logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) {
logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) {
logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
}
getSession().put("contrato", contrato); getSession().put("contrato", contrato);
return SUCCESS; return SUCCESS;
......
package com.mx.dla.dda.contrato.condicionesTransaccion.actions; package com.mx.dla.dda.contrato.condicionesTransaccion.actions;
import java.io.IOException;
import java.sql.SQLException; import java.sql.SQLException;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
...@@ -10,6 +11,8 @@ import org.apache.ibatis.executor.result.ResultMapException; ...@@ -10,6 +11,8 @@ import org.apache.ibatis.executor.result.ResultMapException;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import org.apache.struts2.interceptor.ServletRequestAware; import org.apache.struts2.interceptor.ServletRequestAware;
import org.apache.struts2.interceptor.ServletResponseAware; import org.apache.struts2.interceptor.ServletResponseAware;
import org.codehaus.jackson.JsonParseException;
import org.codehaus.jackson.map.JsonMappingException;
import org.codehaus.jackson.map.ObjectMapper; import org.codehaus.jackson.map.ObjectMapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -34,7 +37,7 @@ public class GuardarTransaccionAction extends BaseContratoAction implements Serv ...@@ -34,7 +37,7 @@ public class GuardarTransaccionAction extends BaseContratoAction implements Serv
private HttpServletRequest request; private HttpServletRequest request;
@Override @Override
public String execute() throws Exception { public String execute() throws TransaccionException {
try { try {
transaccionDTO = mapper.readValue(data, CondicionesTransaccionDTO.class); transaccionDTO = mapper.readValue(data, CondicionesTransaccionDTO.class);
transaccionBO.guardar(transaccionDTO); transaccionBO.guardar(transaccionDTO);
...@@ -47,15 +50,31 @@ public class GuardarTransaccionAction extends BaseContratoAction implements Serv ...@@ -47,15 +50,31 @@ public class GuardarTransaccionAction extends BaseContratoAction implements Serv
} catch (ResultMapException e) { } catch (ResultMapException e) {
log.error("ERROR:", e); log.error("ERROR:", e);
log.error("Causa: " + e.getCause()); log.error("Causa: " + e.getCause());
throw new TransaccionException("Ocurrio un error", e);
} catch (PersistenceException e) { } catch (PersistenceException e) {
log.error("ERROR:", e); log.error("ERROR:", e);
log.error("Causa: " + e.getCause()); log.error("Causa: " + e.getCause());
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
log.error("ERROR:", e); log.error("ERROR:", e);
log.error("Causa: " + e.getCause()); log.error("Causa: " + e.getCause());
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
log.error("ERROR:", e); log.error("ERROR:", e);
log.error("Causa: " + e.getCause()); log.error("Causa: " + e.getCause());
throw new TransaccionException("Ocurrio un error", e);
} catch (JsonParseException e) {
log.error("ERROR:", e);
log.error("Causa: " + e.getCause());
throw new TransaccionException("Ocurrio un error", e);
} catch (JsonMappingException e) {
log.error("ERROR:", e);
log.error("Causa: " + e.getCause());
throw new TransaccionException("Ocurrio un error", e);
} catch (IOException e) {
log.error("ERROR:", e);
log.error("Causa: " + e.getCause());
throw new TransaccionException("Ocurrio un error", e);
} }
return SUCCESS; return SUCCESS;
......
...@@ -19,7 +19,7 @@ public class FacturasAction extends BaseContratoAction { ...@@ -19,7 +19,7 @@ public class FacturasAction extends BaseContratoAction {
private static final long serialVersionUID = 3027003012196187865L; private static final long serialVersionUID = 3027003012196187865L;
@Override @Override
public String execute() throws Exception { public String execute() {
this.setIdContrato((Long)this.getSession().get("idContrato")); this.setIdContrato((Long)this.getSession().get("idContrato"));
......
...@@ -115,7 +115,7 @@ public class FeesAction extends BaseContratoAction { ...@@ -115,7 +115,7 @@ public class FeesAction extends BaseContratoAction {
this.msgError = "Ocurri un error al obtener los datos."; this.msgError = "Ocurri un error al obtener los datos.";
logger.error("Error. {}", e); logger.error("Error. {}", e);
} }
return Action.SUCCESS; return Action.SUCCESS;
} }
...@@ -199,15 +199,18 @@ public class FeesAction extends BaseContratoAction { ...@@ -199,15 +199,18 @@ public class FeesAction extends BaseContratoAction {
return Action.SUCCESS; return Action.SUCCESS;
} }
private void getCatalogos() { private void getCatalogos() throws TransaccionException {
try { try {
tipoSuscriptorLista = catalogosBO.obtenerTipoSuscriptor(); tipoSuscriptorLista = catalogosBO.obtenerTipoSuscriptor();
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
anioTipo = new ArrayList<CatalogoDTO>(); anioTipo = new ArrayList<CatalogoDTO>();
CatalogoDTO cat1 = new CatalogoDTO("Contractual", "Contractual"); CatalogoDTO cat1 = new CatalogoDTO("Contractual", "Contractual");
......
...@@ -30,19 +30,23 @@ public class CambiarAddendumAction extends BaseContratoAction { ...@@ -30,19 +30,23 @@ public class CambiarAddendumAction extends BaseContratoAction {
private GeneralesBO generalesBO; private GeneralesBO generalesBO;
@Override @Override
public String execute() { public String execute() throws TransaccionException {
try { try {
logger.info("idContrato a cambiar : [{}]", idContrato); logger.info("idContrato a cambiar : [{}]", idContrato);
generalesBO.cambiarAddendum(idContrato, numeroContrato); generalesBO.cambiarAddendum(idContrato, numeroContrato);
logger.info("Contrato virtual No. " + idContrato + " actualizado a addendum."); logger.info("Contrato virtual No. " + idContrato + " actualizado a addendum.");
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (PersistenceException e) { } catch (PersistenceException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
return SUCCESS; return SUCCESS;
} }
......
...@@ -25,7 +25,7 @@ public class EliminaContratoAction extends BaseContratoAction { ...@@ -25,7 +25,7 @@ public class EliminaContratoAction extends BaseContratoAction {
private GeneralesBO generalesBO; private GeneralesBO generalesBO;
@Override @Override
public String execute() { public String execute() throws TransaccionException {
try { try {
logger.debug("idContrato a eliminar : [{}]", idContratoP); logger.debug("idContrato a eliminar : [{}]", idContratoP);
...@@ -33,12 +33,16 @@ public class EliminaContratoAction extends BaseContratoAction { ...@@ -33,12 +33,16 @@ public class EliminaContratoAction extends BaseContratoAction {
logger.debug("respuesta de eliminar contrato : [{}]", seElimino); logger.debug("respuesta de eliminar contrato : [{}]", seElimino);
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (PersistenceException e) { } catch (PersistenceException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
return SUCCESS; return SUCCESS;
} }
......
...@@ -22,19 +22,22 @@ public class ExponerApartadosAction extends BaseContratoAction { ...@@ -22,19 +22,22 @@ public class ExponerApartadosAction extends BaseContratoAction {
private Long idEstudio; private Long idEstudio;
private Long idApartado; private Long idApartado;
private List<ApartadoDTO> apartados; private List<ApartadoDTO> apartados;
@Autowired @Autowired
private PoblarGeneralesBO poblarGeneralesBO; private PoblarGeneralesBO poblarGeneralesBO;
public String execute() { public String execute() throws TransaccionException {
try { try {
setApartados(poblarGeneralesBO.obtenerApartados(idEstudio, idApartado)); setApartados(poblarGeneralesBO.obtenerApartados(idEstudio, idApartado));
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
return SUCCESS; return SUCCESS;
} }
...@@ -54,11 +57,11 @@ public class ExponerApartadosAction extends BaseContratoAction { ...@@ -54,11 +57,11 @@ public class ExponerApartadosAction extends BaseContratoAction {
public List<ApartadoDTO> getApartados() { public List<ApartadoDTO> getApartados() {
return apartados; return apartados;
} }
public void setIdApartado(Long idApartado) { public void setIdApartado(Long idApartado) {
this.idApartado = idApartado; this.idApartado = idApartado;
} }
public Long getIdApartado() { public Long getIdApartado() {
return idApartado; return idApartado;
} }
......
...@@ -17,20 +17,23 @@ public class InfoContratoAction extends BaseContratoAction { ...@@ -17,20 +17,23 @@ public class InfoContratoAction extends BaseContratoAction {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private InputStream fileInputStream; private InputStream fileInputStream;
private String fileName; private String fileName;
@Autowired @Autowired
private GeneralesBO generalesBO; private GeneralesBO generalesBO;
public String execute() { public String execute() throws TransaccionException {
Long idContrato = (Long)this.getSession().get("idContrato"); Long idContrato = (Long) this.getSession().get("idContrato");
try { try {
fileInputStream = generalesBO.h(idContrato); fileInputStream = generalesBO.h(idContrato);
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
fileName = "detalle_contrato_" + idContrato; fileName = "detalle_contrato_" + idContrato;
return SUCCESS; return SUCCESS;
...@@ -52,6 +55,4 @@ public class InfoContratoAction extends BaseContratoAction { ...@@ -52,6 +55,4 @@ public class InfoContratoAction extends BaseContratoAction {
this.fileName = fileName; this.fileName = fileName;
} }
} }
...@@ -24,23 +24,26 @@ public class ObtenerPermisosAction extends BaseContratoAction { ...@@ -24,23 +24,26 @@ public class ObtenerPermisosAction extends BaseContratoAction {
private List<PermisoDTO> permisos; private List<PermisoDTO> permisos;
private AreaDTO area; private AreaDTO area;
private UsuarioDTO usuario; private UsuarioDTO usuario;
@Autowired @Autowired
private GeneralesBO generalesBO; private GeneralesBO generalesBO;
@Override @Override
public String execute() { public String execute() throws TransaccionException {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
List<PermisoDTO> permisosS = (List<PermisoDTO>) this.getSession().get("permisos"); List<PermisoDTO> permisosS = (List<PermisoDTO>) this.getSession().get("permisos");
setUsuario((UsuarioDTO)this.getSession().get("usuario")); setUsuario((UsuarioDTO) this.getSession().get("usuario"));
try { try {
setArea(generalesBO.obtenerAreaPorExpediente(getUsuario().getExpediente())); setArea(generalesBO.obtenerAreaPorExpediente(getUsuario().getExpediente()));
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
setPermisos(permisosS); setPermisos(permisosS);
return SUCCESS; return SUCCESS;
...@@ -61,11 +64,11 @@ public class ObtenerPermisosAction extends BaseContratoAction { ...@@ -61,11 +64,11 @@ public class ObtenerPermisosAction extends BaseContratoAction {
public AreaDTO getArea() { public AreaDTO getArea() {
return area; return area;
} }
public void setUsuario(UsuarioDTO usuario) { public void setUsuario(UsuarioDTO usuario) {
this.usuario = usuario; this.usuario = usuario;
} }
public UsuarioDTO getUsuario() { public UsuarioDTO getUsuario() {
return usuario; return usuario;
} }
......
...@@ -68,17 +68,20 @@ public class ObtenerTitulosBroadViewAction extends BaseContratoAction { ...@@ -68,17 +68,20 @@ public class ObtenerTitulosBroadViewAction extends BaseContratoAction {
@Autowired @Autowired
protected ListaDAO listaDAO; protected ListaDAO listaDAO;
public String buscar() { public String buscar() throws TransaccionException {
DLARestClient c = dlaRestClientFactory.getClient(DLARestServices.TITULOS_BROAD_VIEW); DLARestClient c = dlaRestClientFactory.getClient(DLARestServices.TITULOS_BROAD_VIEW);
String request = contratoBv.toString() + "?formato=oracle&contrato_dda=" + contratoDda.toString(); String request = contratoBv.toString() + "?formato=oracle&contrato_dda=" + contratoDda.toString();
try { try {
c.getBv(request, ResponseTitulosBroadViewDTO.class); c.getBv(request, ResponseTitulosBroadViewDTO.class);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SocketTimeoutException e) { } catch (SocketTimeoutException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (IOException e) { } catch (IOException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
logger.info("Tipo contrato: " + tipoContrato); logger.info("Tipo contrato: " + tipoContrato);
logger.info("Comenzando busqueda"); logger.info("Comenzando busqueda");
...@@ -94,7 +97,7 @@ public class ObtenerTitulosBroadViewAction extends BaseContratoAction { ...@@ -94,7 +97,7 @@ public class ObtenerTitulosBroadViewAction extends BaseContratoAction {
return SUCCESS; return SUCCESS;
} }
public String insertar() { public String insertar() throws TransaccionException {
logger.info("Insertando Titulos para contratoBv: " + contratoBv + " y contratoDda: " + contratoDda); logger.info("Insertando Titulos para contratoBv: " + contratoBv + " y contratoDda: " + contratoDda);
try { try {
if (tipoContrato != 2) { if (tipoContrato != 2) {
...@@ -109,10 +112,13 @@ public class ObtenerTitulosBroadViewAction extends BaseContratoAction { ...@@ -109,10 +112,13 @@ public class ObtenerTitulosBroadViewAction extends BaseContratoAction {
} }
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
return SUCCESS; return SUCCESS;
} }
......
...@@ -27,7 +27,7 @@ public class ValidaComboAction extends BaseContratoAction { ...@@ -27,7 +27,7 @@ public class ValidaComboAction extends BaseContratoAction {
@Autowired @Autowired
PoblarGeneralesBO poblarGeneralesBO; PoblarGeneralesBO poblarGeneralesBO;
public String execute() { public String execute() throws TransaccionException {
if (idContratoCat == null) { if (idContratoCat == null) {
idContratoCat = 0L; idContratoCat = 0L;
...@@ -36,12 +36,16 @@ public class ValidaComboAction extends BaseContratoAction { ...@@ -36,12 +36,16 @@ public class ValidaComboAction extends BaseContratoAction {
setNoQuitar(poblarGeneralesBO.validaIdsCatalogo(idsCatalogo, idContratoCat, tipoCatalogo)); setNoQuitar(poblarGeneralesBO.validaIdsCatalogo(idsCatalogo, idContratoCat, tipoCatalogo));
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (PersistenceException e) { } catch (PersistenceException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
return SUCCESS; return SUCCESS;
......
...@@ -51,18 +51,18 @@ public class TituloFeeAction extends BaseContratoAction { ...@@ -51,18 +51,18 @@ public class TituloFeeAction extends BaseContratoAction {
private String btnAmortizacion; private String btnAmortizacion;
public String execute(){ public String execute() throws TransaccionException{
Long idC = (Long) getSession().get(ContratoConstats.ID_CONTRATO_SESSION); Long idC = (Long) getSession().get(ContratoConstats.ID_CONTRATO_SESSION);
ContratoDTO ct = null; ContratoDTO ct = null;
try { try {
ct = generalesBO.obtenContrato(idC); ct = generalesBO.obtenContrato(idC);
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);throw new TransaccionException("Ocurrio un error", e);
} }
getSession().put(ContratoConstats.CONTRATO_SESSION, ct); getSession().put(ContratoConstats.CONTRATO_SESSION, ct);
......
...@@ -64,19 +64,23 @@ public class TituloFeeAsyncAction extends BaseAction { ...@@ -64,19 +64,23 @@ public class TituloFeeAsyncAction extends BaseAction {
return SUCCESS; return SUCCESS;
} }
public String buscarPresupuesto() { public String buscarPresupuesto() throws TransaccionException {
try { try {
Lista li = (Lista) getSession().get(ContratoConstats.LISTA_SESSION); Lista li = (Lista) getSession().get(ContratoConstats.LISTA_SESSION);
ContratoDTO ct = (ContratoDTO) getSession().get(ContratoConstats.CONTRATO_SESSION); ContratoDTO ct = (ContratoDTO) getSession().get(ContratoConstats.CONTRATO_SESSION);
presupuesto = tituloAsyncBO.buscarPresupuesto(ct, li, "REAL"); presupuesto = tituloAsyncBO.buscarPresupuesto(ct, li, "REAL");
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SocketTimeoutException e) { } catch (SocketTimeoutException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (IOException e) { } catch (IOException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
return SUCCESS; return SUCCESS;
} }
......
...@@ -56,10 +56,10 @@ public class ListadoAction extends BaseAction { ...@@ -56,10 +56,10 @@ public class ListadoAction extends BaseAction {
try { try {
logger.debug("Inicia obtencion listado. " + request); logger.info("Inicia obtencion listado. " + request);
requestListadoDTO = mapper.readValue(request, RequestListadoDTO.class); requestListadoDTO = mapper.readValue(request, RequestListadoDTO.class);
listado = listadoContratoBO.getListadoContratos(requestListadoDTO); listado = listadoContratoBO.getListadoContratos(requestListadoDTO);
logger.debug("Fin obtencion listado"); logger.info("Fin obtencion listado");
} catch (JsonParseException | JsonGenerationException | JsonMappingException je) { } catch (JsonParseException | JsonGenerationException | JsonMappingException je) {
this.msgError = ERROR_MESSAGE_1; this.msgError = ERROR_MESSAGE_1;
...@@ -84,7 +84,6 @@ public class ListadoAction extends BaseAction { ...@@ -84,7 +84,6 @@ public class ListadoAction extends BaseAction {
try { try {
requestListadoDTO = mapper.readValue(request, RequestListadoDTO.class); requestListadoDTO = mapper.readValue(request, RequestListadoDTO.class);
logger.debug(requestListadoDTO.toString());
listado = listadoContratoBO.getDocumentos(requestListadoDTO.getIdContrato()); listado = listadoContratoBO.getDocumentos(requestListadoDTO.getIdContrato());
} catch (JsonParseException | JsonGenerationException | JsonMappingException e) { } catch (JsonParseException | JsonGenerationException | JsonMappingException e) {
......
...@@ -19,7 +19,7 @@ public class MaterialesAction extends BaseContratoAction { ...@@ -19,7 +19,7 @@ public class MaterialesAction extends BaseContratoAction {
private static final long serialVersionUID = 3027003012196187865L; private static final long serialVersionUID = 3027003012196187865L;
@Override @Override
public String execute() throws Exception { public String execute() {
this.setIdContrato((Long)this.getSession().get("idContrato")); this.setIdContrato((Long)this.getSession().get("idContrato"));
......
...@@ -12,7 +12,6 @@ import com.mx.dla.dda.contrato.minimoseleccion.bos.MinimoSeleccionBO; ...@@ -12,7 +12,6 @@ import com.mx.dla.dda.contrato.minimoseleccion.bos.MinimoSeleccionBO;
import com.mx.dla.dda.contrato.minimoseleccion.dtos.AnnioPeriodoDTO; import com.mx.dla.dda.contrato.minimoseleccion.dtos.AnnioPeriodoDTO;
import com.mx.dla.dda.contrato.transaccion.exceptions.dtos.TransaccionException; import com.mx.dla.dda.contrato.transaccion.exceptions.dtos.TransaccionException;
@Controller @Controller
@Scope("request") @Scope("request")
public class AnniosPeriodosAction extends BaseContratoAction { public class AnniosPeriodosAction extends BaseContratoAction {
...@@ -25,20 +24,23 @@ public class AnniosPeriodosAction extends BaseContratoAction { ...@@ -25,20 +24,23 @@ public class AnniosPeriodosAction extends BaseContratoAction {
private String tipoPago; private String tipoPago;
private Long idContratoPago; private Long idContratoPago;
private Integer annio; private Integer annio;
@Autowired @Autowired
MinimoSeleccionBO minimoSeleccionBO; MinimoSeleccionBO minimoSeleccionBO;
public String execute() { public String execute() throws TransaccionException {
try { try {
setAnnioPeriodo(minimoSeleccionBO.obtenAnnioPeriodo(idContratoPago, annio, tipoPago, idContrato)); setAnnioPeriodo(minimoSeleccionBO.obtenAnnioPeriodo(idContratoPago, annio, tipoPago, idContrato));
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
return SUCCESS; return SUCCESS;
......
...@@ -22,37 +22,40 @@ public class CambioMinimoAction extends BaseContratoAction { ...@@ -22,37 +22,40 @@ public class CambioMinimoAction extends BaseContratoAction {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private List<CategoriaMinimoDTO> campoPeriodos; private List<CategoriaMinimoDTO> campoPeriodos;
private Long idContrato; private Long idContrato;
private String justificacion; private String justificacion;
@Autowired @Autowired
private MinimoSeleccionBO minimoSeleccionBO; private MinimoSeleccionBO minimoSeleccionBO;
@Autowired @Autowired
private JustificacionBO justificacionBO; private JustificacionBO justificacionBO;
@Override @Override
public String execute() { public String execute() throws TransaccionException {
logger.info("In execute of CambioMinimoAction"); logger.info("In execute of CambioMinimoAction");
try { try {
minimoSeleccionBO.cambiaMinimoCategoria(campoPeriodos); minimoSeleccionBO.cambiaMinimoCategoria(campoPeriodos);
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
getSession().put("idContrato", getIdContrato()); getSession().put("idContrato", getIdContrato());
if(justificacion != null){ if (justificacion != null) {
UsuarioDTO usuario = (UsuarioDTO) getSession().get("usuario"); UsuarioDTO usuario = (UsuarioDTO) getSession().get("usuario");
justificacionBO.insertarJustificacion(justificacion, idContrato, usuario); justificacionBO.insertarJustificacion(justificacion, idContrato, usuario);
} }
return SUCCESS; return SUCCESS;
} }
...@@ -63,11 +66,11 @@ public class CambioMinimoAction extends BaseContratoAction { ...@@ -63,11 +66,11 @@ public class CambioMinimoAction extends BaseContratoAction {
public List<CategoriaMinimoDTO> getCampoPeriodos() { public List<CategoriaMinimoDTO> getCampoPeriodos() {
return campoPeriodos; return campoPeriodos;
} }
public void setIdContrato(Long idContrato) { public void setIdContrato(Long idContrato) {
this.idContrato = idContrato; this.idContrato = idContrato;
} }
public Long getIdContrato() { public Long getIdContrato() {
return idContrato; return idContrato;
} }
......
...@@ -36,32 +36,35 @@ public class MinSeleccionAction extends BaseContratoAction { ...@@ -36,32 +36,35 @@ public class MinSeleccionAction extends BaseContratoAction {
private List<ContratoPagoCostoDTO> costosSuscriptores; private List<ContratoPagoCostoDTO> costosSuscriptores;
private List<ContratoMinimoSeleccionDTO> minimosSeleccion; private List<ContratoMinimoSeleccionDTO> minimosSeleccion;
private List<MontoRealDTO> montosReales; private List<MontoRealDTO> montosReales;
private Integer guardadoStatus; private Integer guardadoStatus;
private String mensajeExcepcion; private String mensajeExcepcion;
@Autowired @Autowired
private MinimoSeleccionBO minimoSeleccionBO; private MinimoSeleccionBO minimoSeleccionBO;
@Autowired @Autowired
private GeneralesBO generalesBO; private GeneralesBO generalesBO;
public String primeraCarga(){ public String primeraCarga() throws TransaccionException {
Long idContrato = (Long) this.getSession().get("idContrato"); Long idContrato = (Long) this.getSession().get("idContrato");
ContratoDTO ct = null; ContratoDTO ct = null;
try { try {
ct = generalesBO.obtenContrato(idContrato); ct = generalesBO.obtenContrato(idContrato);
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
} throw new TransaccionException("Ocurrio un error", e);
}
setEstatusContrato(ct.getIdEstatus()); setEstatusContrato(ct.getIdEstatus());
buscarJustificaciones(); buscarJustificaciones();
return SUCCESS; return SUCCESS;
...@@ -70,14 +73,13 @@ public class MinSeleccionAction extends BaseContratoAction { ...@@ -70,14 +73,13 @@ public class MinSeleccionAction extends BaseContratoAction {
public String obtenInformacion() { public String obtenInformacion() {
try { try {
Long idContrato = (Long) this.getSession().get("idContrato"); Long idContrato = (Long) this.getSession().get("idContrato");
ContratoDTO ct = generalesBO.obtenContrato(idContrato); ContratoDTO ct = generalesBO.obtenContrato(idContrato);
setEstatusContrato(ct.getIdEstatus()); setEstatusContrato(ct.getIdEstatus());
periodos = minimoSeleccionBO.consultaInformacionPeriodos(idContrato); periodos = minimoSeleccionBO.consultaInformacionPeriodos(idContrato);
categorias = minimoSeleccionBO.consultaInformacionCategorias(idContrato); categorias = minimoSeleccionBO.consultaInformacionCategorias(idContrato);
annios = minimoSeleccionBO.consultaInformacionAnnios(idContrato); annios = minimoSeleccionBO.consultaInformacionAnnios(idContrato);
...@@ -85,7 +87,7 @@ public class MinSeleccionAction extends BaseContratoAction { ...@@ -85,7 +87,7 @@ public class MinSeleccionAction extends BaseContratoAction {
costosSuscriptores = minimoSeleccionBO.consultaInformacionCostoSubscriptores(idContrato); costosSuscriptores = minimoSeleccionBO.consultaInformacionCostoSubscriptores(idContrato);
minimosSeleccion = minimoSeleccionBO.consultaInformacionMinimos(idContrato); minimosSeleccion = minimoSeleccionBO.consultaInformacionMinimos(idContrato);
anniosPeriodo = minimoSeleccionBO.consultaInformacionAnniosPorPeriodo(idContrato); anniosPeriodo = minimoSeleccionBO.consultaInformacionAnniosPorPeriodo(idContrato);
montosReales = minimoSeleccionBO.consultaInformacionMontosReales(idContrato); montosReales = minimoSeleccionBO.consultaInformacionMontosReales(idContrato);
guardadoStatus = 0; guardadoStatus = 0;
} catch (ResultMapException e) { } catch (ResultMapException e) {
...@@ -107,17 +109,16 @@ public class MinSeleccionAction extends BaseContratoAction { ...@@ -107,17 +109,16 @@ public class MinSeleccionAction extends BaseContratoAction {
logger.info("minimosSeleccion: " + minimosSeleccion); logger.info("minimosSeleccion: " + minimosSeleccion);
try { try {
Long idContrato = (Long) this.getSession().get("idContrato"); Long idContrato = (Long) this.getSession().get("idContrato");
ContratoDTO ct = generalesBO.obtenContrato(idContrato); ContratoDTO ct = generalesBO.obtenContrato(idContrato);
setEstatusContrato(ct.getIdEstatus()); setEstatusContrato(ct.getIdEstatus());
for (ContratoMinimoSeleccionDTO item : minimosSeleccion) for (ContratoMinimoSeleccionDTO item : minimosSeleccion)
minimoSeleccionBO.actualizaMinimoMonto( minimoSeleccionBO.actualizaMinimoMonto(item.getIdContratoPago(), item.getIdPagoCategoria(),
item.getIdContratoPago(), item.getIdPagoCategoria(),
item.getAnnio(), item.getMinimoSeleccion()); item.getAnnio(), item.getMinimoSeleccion());
if (getJustificacion() != null && !"".equals(getJustificacion())) { if (getJustificacion() != null && !"".equals(getJustificacion())) {
guardarJustificacion(); guardarJustificacion();
setJustificacion(""); setJustificacion("");
...@@ -130,15 +131,15 @@ public class MinSeleccionAction extends BaseContratoAction { ...@@ -130,15 +131,15 @@ public class MinSeleccionAction extends BaseContratoAction {
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.debug("Exception : [{}]", e); logger.debug("Exception : [{}]", e);
setMensajeExcepcion("Fallo al guardar informacin."); setMensajeExcepcion("Fallo al guardar informacin.");
guardadoStatus = -1; guardadoStatus = -1;
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.debug("Exception : [{}]", e); logger.debug("Exception : [{}]", e);
setMensajeExcepcion("Fallo al guardar informacin."); setMensajeExcepcion("Fallo al guardar informacin.");
guardadoStatus = -1; guardadoStatus = -1;
} catch (SQLException e) { } catch (SQLException e) {
logger.debug("Exception : [{}]", e); logger.debug("Exception : [{}]", e);
setMensajeExcepcion("Fallo al guardar informacin."); setMensajeExcepcion("Fallo al guardar informacin.");
guardadoStatus = -1; guardadoStatus = -1;
} }
return SUCCESS; return SUCCESS;
...@@ -181,8 +182,7 @@ public class MinSeleccionAction extends BaseContratoAction { ...@@ -181,8 +182,7 @@ public class MinSeleccionAction extends BaseContratoAction {
return costosSuscriptores; return costosSuscriptores;
} }
public void setCostosSuscriptores( public void setCostosSuscriptores(List<ContratoPagoCostoDTO> costosSuscriptores) {
List<ContratoPagoCostoDTO> costosSuscriptores) {
this.costosSuscriptores = costosSuscriptores; this.costosSuscriptores = costosSuscriptores;
} }
...@@ -190,8 +190,7 @@ public class MinSeleccionAction extends BaseContratoAction { ...@@ -190,8 +190,7 @@ public class MinSeleccionAction extends BaseContratoAction {
return minimosSeleccion; return minimosSeleccion;
} }
public void setMinimosSeleccion( public void setMinimosSeleccion(List<ContratoMinimoSeleccionDTO> minimosSeleccion) {
List<ContratoMinimoSeleccionDTO> minimosSeleccion) {
this.minimosSeleccion = minimosSeleccion; this.minimosSeleccion = minimosSeleccion;
} }
...@@ -210,19 +209,19 @@ public class MinSeleccionAction extends BaseContratoAction { ...@@ -210,19 +209,19 @@ public class MinSeleccionAction extends BaseContratoAction {
public void setGuardadoStatus(Integer guardadoStatus) { public void setGuardadoStatus(Integer guardadoStatus) {
this.guardadoStatus = guardadoStatus; this.guardadoStatus = guardadoStatus;
} }
public void setMontosReales(List<MontoRealDTO> montosReales) { public void setMontosReales(List<MontoRealDTO> montosReales) {
this.montosReales = montosReales; this.montosReales = montosReales;
} }
public List<MontoRealDTO> getMontosReales() { public List<MontoRealDTO> getMontosReales() {
return montosReales; return montosReales;
} }
public void setMensajeExcepcion(String mensajeExcepcion) { public void setMensajeExcepcion(String mensajeExcepcion) {
this.mensajeExcepcion = mensajeExcepcion; this.mensajeExcepcion = mensajeExcepcion;
} }
public String getMensajeExcepcion() { public String getMensajeExcepcion() {
return mensajeExcepcion; return mensajeExcepcion;
} }
......
...@@ -40,7 +40,7 @@ public class MinimoSeleccionAction extends BaseContratoAction { ...@@ -40,7 +40,7 @@ public class MinimoSeleccionAction extends BaseContratoAction {
private List<PeriodoDTO> periodos; private List<PeriodoDTO> periodos;
@Override @Override
public String execute() { public String execute() throws TransaccionException {
// el idContrato vendra de la sesion, por el momento llega del request // el idContrato vendra de la sesion, por el momento llega del request
if (getSession().get("idContrato") == null) { if (getSession().get("idContrato") == null) {
...@@ -70,10 +70,13 @@ public class MinimoSeleccionAction extends BaseContratoAction { ...@@ -70,10 +70,13 @@ public class MinimoSeleccionAction extends BaseContratoAction {
setEstatus(minimoSeleccionBO.obtenerEstatusContrato(getIdContrato())); setEstatus(minimoSeleccionBO.obtenerEstatusContrato(getIdContrato()));
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
return SUCCESS; return SUCCESS;
} }
......
...@@ -35,7 +35,7 @@ public class ModificaCategoriasAction extends BaseContratoAction { ...@@ -35,7 +35,7 @@ public class ModificaCategoriasAction extends BaseContratoAction {
@Autowired @Autowired
private JustificacionBO justificacionBO; private JustificacionBO justificacionBO;
public String execute() { public String execute() throws TransaccionException {
try { try {
if (minimoSeleccionBO.actualizaCategoriasMonto(idContratoPago, minimoMonto, categoriasMod, annio, if (minimoSeleccionBO.actualizaCategoriasMonto(idContratoPago, minimoMonto, categoriasMod, annio,
...@@ -52,10 +52,13 @@ public class ModificaCategoriasAction extends BaseContratoAction { ...@@ -52,10 +52,13 @@ public class ModificaCategoriasAction extends BaseContratoAction {
} }
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
return SUCCESS; return SUCCESS;
......
...@@ -26,20 +26,24 @@ public class PrecioAnualMinimoAction extends BaseContratoAction { ...@@ -26,20 +26,24 @@ public class PrecioAnualMinimoAction extends BaseContratoAction {
private Integer noTitulos; private Integer noTitulos;
private String precioAnual; private String precioAnual;
private String minimo; private String minimo;
@Autowired @Autowired
MinimoSeleccionBO minimoSeleccionBO; MinimoSeleccionBO minimoSeleccionBO;
public String execute() { public String execute() throws TransaccionException {
String precio_minimo = null; String precio_minimo = null;
try { try {
precio_minimo = minimoSeleccionBO.obtenPrecioAnualAndMinimo(tipoPago, idContratoPago, annio, idPagoCategoria, noTitulos, idContrato); precio_minimo = minimoSeleccionBO.obtenPrecioAnualAndMinimo(tipoPago, idContratoPago, annio,
idPagoCategoria, noTitulos, idContrato);
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
String[] precio_minimo_array = precio_minimo.split("_"); String[] precio_minimo_array = precio_minimo.split("_");
setPrecioAnual(precio_minimo_array[0]); setPrecioAnual(precio_minimo_array[0]);
...@@ -58,7 +62,7 @@ public class PrecioAnualMinimoAction extends BaseContratoAction { ...@@ -58,7 +62,7 @@ public class PrecioAnualMinimoAction extends BaseContratoAction {
public void setTipoPago(String tipoPago) { public void setTipoPago(String tipoPago) {
this.tipoPago = tipoPago; this.tipoPago = tipoPago;
} }
public String getTipoPago() { public String getTipoPago() {
return tipoPago; return tipoPago;
} }
...@@ -94,11 +98,11 @@ public class PrecioAnualMinimoAction extends BaseContratoAction { ...@@ -94,11 +98,11 @@ public class PrecioAnualMinimoAction extends BaseContratoAction {
public void setIdMinimoSeleccion(Long idMinimoSeleccion) { public void setIdMinimoSeleccion(Long idMinimoSeleccion) {
this.idMinimoSeleccion = idMinimoSeleccion; this.idMinimoSeleccion = idMinimoSeleccion;
} }
public void setNoTitulos(Integer noTitulos) { public void setNoTitulos(Integer noTitulos) {
this.noTitulos = noTitulos; this.noTitulos = noTitulos;
} }
public Integer getNoTitulos() { public Integer getNoTitulos() {
return noTitulos; return noTitulos;
} }
...@@ -118,6 +122,5 @@ public class PrecioAnualMinimoAction extends BaseContratoAction { ...@@ -118,6 +122,5 @@ public class PrecioAnualMinimoAction extends BaseContratoAction {
public void setMinimo(String minimo) { public void setMinimo(String minimo) {
this.minimo = minimo; this.minimo = minimo;
} }
} }
...@@ -19,9 +19,7 @@ public class NotasDeCreditoAction extends BaseContratoAction { ...@@ -19,9 +19,7 @@ public class NotasDeCreditoAction extends BaseContratoAction {
private static final long serialVersionUID = 3027003012196187865L; private static final long serialVersionUID = 3027003012196187865L;
@Override @Override
public String execute() throws Exception { public String execute() {
logger.debug("entro al init materiales");
this.setIdContrato((Long)this.getSession().get("idContrato")); this.setIdContrato((Long)this.getSession().get("idContrato"));
logger.info("entro al init materiales contrato {}",getIdContrato()); logger.info("entro al init materiales contrato {}",getIdContrato());
......
...@@ -38,11 +38,11 @@ public class DescargaMasivaTitulosAction extends BaseContratoAction { ...@@ -38,11 +38,11 @@ public class DescargaMasivaTitulosAction extends BaseContratoAction {
@Autowired @Autowired
private BaseActivosBO baseActivosBO; private BaseActivosBO baseActivosBO;
public String execute() throws Exception { public String execute() {
return SUCCESS; return SUCCESS;
} }
public String generarReporte() { public String generarReporte() throws TransaccionException {
try { try {
DateFormat formatoEntrada = new SimpleDateFormat("dd/MM/yyyy"); DateFormat formatoEntrada = new SimpleDateFormat("dd/MM/yyyy");
Date date = formatoEntrada.parse(fecha); Date date = formatoEntrada.parse(fecha);
...@@ -58,17 +58,20 @@ public class DescargaMasivaTitulosAction extends BaseContratoAction { ...@@ -58,17 +58,20 @@ public class DescargaMasivaTitulosAction extends BaseContratoAction {
respuesta = baseActivosBO.generaReporteBaseActivos(fileFileName, anio, anioFin, vigente); respuesta = baseActivosBO.generaReporteBaseActivos(fileFileName, anio, anioFin, vigente);
} catch (IOException e) { } catch (IOException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (ParseException e) { } catch (ParseException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
return SUCCESS; return SUCCESS;
} }
public String descargarArchivo() { public String descargarArchivo() throws TransaccionException {
byte[] result = null; byte[] result = null;
...@@ -100,6 +103,7 @@ public class DescargaMasivaTitulosAction extends BaseContratoAction { ...@@ -100,6 +103,7 @@ public class DescargaMasivaTitulosAction extends BaseContratoAction {
out.flush(); out.flush();
} catch (IOException e) { } catch (IOException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
return null; return null;
......
...@@ -4,10 +4,12 @@ import java.io.ByteArrayInputStream; ...@@ -4,10 +4,12 @@ import java.io.ByteArrayInputStream;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.sql.SQLException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import org.apache.ibatis.executor.result.ResultMapException;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import com.mx.dla.admin.dtos.UsuarioDTO; import com.mx.dla.admin.dtos.UsuarioDTO;
...@@ -22,6 +24,7 @@ import com.mx.dla.dda.contrato.titulo.dtos.Lista; ...@@ -22,6 +24,7 @@ import com.mx.dla.dda.contrato.titulo.dtos.Lista;
import com.mx.dla.dda.contrato.titulo.dtos.RespuestaCargaExcel; import com.mx.dla.dda.contrato.titulo.dtos.RespuestaCargaExcel;
import com.mx.dla.dda.contrato.titulo.dtos.Titulo; import com.mx.dla.dda.contrato.titulo.dtos.Titulo;
import com.mx.dla.dda.contrato.titulo.exception.TituloException; import com.mx.dla.dda.contrato.titulo.exception.TituloException;
import com.mx.dla.dda.contrato.transaccion.exceptions.dtos.TransaccionException;
import com.mx.dla.dda.excelMapper.exceptions.ExcelMapperException; import com.mx.dla.dda.excelMapper.exceptions.ExcelMapperException;
public class TituloAction extends BaseContratoAction { public class TituloAction extends BaseContratoAction {
...@@ -49,10 +52,22 @@ public class TituloAction extends BaseContratoAction { ...@@ -49,10 +52,22 @@ public class TituloAction extends BaseContratoAction {
private String btnAmortizacion; private String btnAmortizacion;
private List<CatalogoDTO> tiposCarga; private List<CatalogoDTO> tiposCarga;
public String execute() throws Exception { public String execute() throws TransaccionException {
Long idC = (Long) getSession().get(ContratoConstats.ID_CONTRATO_SESSION); Long idC = (Long) getSession().get(ContratoConstats.ID_CONTRATO_SESSION);
ContratoDTO ct = generalesBO.obtenContrato(idC); ContratoDTO ct = null;
try {
ct = generalesBO.obtenContrato(idC);
} catch (ResultMapException e) {
logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) {
logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) {
logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
}
getSession().put(ContratoConstats.CONTRATO_SESSION, ct); getSession().put(ContratoConstats.CONTRATO_SESSION, ct);
setIdContrato(idC); setIdContrato(idC);
......
...@@ -118,16 +118,19 @@ public class TituloGridAction extends BaseAction { ...@@ -118,16 +118,19 @@ public class TituloGridAction extends BaseAction {
return SUCCESS; return SUCCESS;
} }
public String consultaContrato() { public String consultaContrato() throws TransaccionException {
Long idC = (Long) getSession().get(ContratoConstats.ID_CONTRATO_SESSION); Long idC = (Long) getSession().get(ContratoConstats.ID_CONTRATO_SESSION);
try { try {
contrato = generalesBO.obtenContrato(idC); contrato = generalesBO.obtenContrato(idC);
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
return SUCCESS; return SUCCESS;
......
...@@ -40,7 +40,7 @@ public class FeesCargaTAction extends BaseContratoAction { ...@@ -40,7 +40,7 @@ public class FeesCargaTAction extends BaseContratoAction {
@Autowired @Autowired
private FeesTransaccioBO fees; private FeesTransaccioBO fees;
public String cargaArchivo() { public String cargaArchivo() throws TransaccionException {
try { try {
logger.info(tipoFees + ":" + operacion); logger.info(tipoFees + ":" + operacion);
logger.info("Type [{}] name [{}]", fileContentType, fileFileName); logger.info("Type [{}] name [{}]", fileContentType, fileFileName);
...@@ -50,13 +50,15 @@ public class FeesCargaTAction extends BaseContratoAction { ...@@ -50,13 +50,15 @@ public class FeesCargaTAction extends BaseContratoAction {
logger.info("Se termina de cargar los datos de excel."); logger.info("Se termina de cargar los datos de excel.");
} catch (ExcelMapperException e) { } catch (ExcelMapperException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (IOException e) { } catch (IOException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
return SUCCESS; return SUCCESS;
} }
public String descargar() { public String descargar() throws TransaccionException {
String nombre = null; String nombre = null;
byte[] result = null; byte[] result = null;
...@@ -75,12 +77,16 @@ public class FeesCargaTAction extends BaseContratoAction { ...@@ -75,12 +77,16 @@ public class FeesCargaTAction extends BaseContratoAction {
out.flush(); out.flush();
} catch (IOException e) { } catch (IOException e) {
logger.error("{}", e); logger.error("{}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("{}", e); logger.error("{}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
return null; return null;
} }
......
...@@ -46,7 +46,6 @@ public class TerminosPremierAction extends BaseContratoAction { ...@@ -46,7 +46,6 @@ public class TerminosPremierAction extends BaseContratoAction {
public String guardar() { public String guardar() {
try { try {
logger.debug("par {}", premium.toString());
comun.guardarDatosComun(premium.getComun(), this.idContrato); comun.guardarDatosComun(premium.getComun(), this.idContrato);
service.guardarPremium(premium, this.idContrato); service.guardarPremium(premium, this.idContrato);
comun.calculaPagoMinGarantizado(this.idContrato); comun.calculaPagoMinGarantizado(this.idContrato);
......
...@@ -46,7 +46,6 @@ public class TerminosPremiumAction extends BaseContratoAction { ...@@ -46,7 +46,6 @@ public class TerminosPremiumAction extends BaseContratoAction {
public String guardar() { public String guardar() {
try { try {
logger.debug("par {}", premium.toString());
comun.guardarDatosComun(premium.getComun(), this.idContrato); comun.guardarDatosComun(premium.getComun(), this.idContrato);
service.guardarPremium(premium, this.idContrato); service.guardarPremium(premium, this.idContrato);
comun.calculaPagoMinGarantizado(this.idContrato); comun.calculaPagoMinGarantizado(this.idContrato);
......
...@@ -81,7 +81,7 @@ public class TerminosTransaccionAction extends BaseContratoAction { ...@@ -81,7 +81,7 @@ public class TerminosTransaccionAction extends BaseContratoAction {
return SUCCESS; return SUCCESS;
} }
public String descargar() { public String descargar() throws TransaccionException {
String nombre = null; String nombre = null;
byte[] result = null; byte[] result = null;
...@@ -99,8 +99,10 @@ public class TerminosTransaccionAction extends BaseContratoAction { ...@@ -99,8 +99,10 @@ public class TerminosTransaccionAction extends BaseContratoAction {
out.flush(); out.flush();
} catch (IOException e) { } catch (IOException e) {
logger.error("{}", e); logger.error("{}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("{}", e); logger.error("{}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
return null; return null;
} }
......
...@@ -5,6 +5,7 @@ import java.io.File; ...@@ -5,6 +5,7 @@ import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.sql.SQLException; import java.sql.SQLException;
import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
...@@ -59,10 +60,21 @@ public class TituloTransAction extends BaseContratoAction { ...@@ -59,10 +60,21 @@ public class TituloTransAction extends BaseContratoAction {
private String tipoCarga; private String tipoCarga;
private RespuestaCargaExcel respuestaExcel; private RespuestaCargaExcel respuestaExcel;
public String execute() throws Exception { public String execute() throws TransaccionException {
ContratoDTO cto = this.inicializarContrato(); ContratoDTO cto = this.inicializarContrato();
tituloBO.init(cto.getIdContrato(), cto.getFechaInicio(), false); try {
this.tipoCargas = tituloBO.buscaTipoCargaDocumento(cto.getIdContrato()); tituloBO.init(cto.getIdContrato(), cto.getFechaInicio(), false);
this.tipoCargas = tituloBO.buscaTipoCargaDocumento(cto.getIdContrato());
} catch (ResultMapException e) {
logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) {
logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) {
logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
}
this.getServletRequest().setAttribute("tipoCargas", this.tipoCargas); this.getServletRequest().setAttribute("tipoCargas", this.tipoCargas);
return SUCCESS; return SUCCESS;
} }
...@@ -133,7 +145,16 @@ public class TituloTransAction extends BaseContratoAction { ...@@ -133,7 +145,16 @@ public class TituloTransAction extends BaseContratoAction {
} catch (TituloException e) { } catch (TituloException e) {
logger.error("Error ", e); logger.error("Error ", e);
error = e.getMessage(); error = e.getMessage();
} catch (Exception e) { } catch (ResultMapException e) {
logger.error("Error ", e);
error = "Ocurrio un error al subir el documento";
} catch (ParseException e) {
logger.error("Error ", e);
error = "Ocurrio un error al subir el documento";
} catch (TransaccionException e) {
logger.error("Error ", e);
error = "Ocurrio un error al subir el documento";
} catch (SQLException e) {
logger.error("Error ", e); logger.error("Error ", e);
error = "Ocurrio un error al subir el documento"; error = "Ocurrio un error al subir el documento";
} }
...@@ -144,7 +165,13 @@ public class TituloTransAction extends BaseContratoAction { ...@@ -144,7 +165,13 @@ public class TituloTransAction extends BaseContratoAction {
try { try {
Long idContrato = (Long) this.getSession().get("idContrato"); Long idContrato = (Long) this.getSession().get("idContrato");
this.listas = tituloBO.buscaListas(idContrato); this.listas = tituloBO.buscaListas(idContrato);
} catch (Exception e) { } catch (TransaccionException e) {
logger.error("Error ", e);
error = "Ocurrio un error al subir el documento";
} catch (ResultMapException e) {
logger.error("Error ", e);
error = "Ocurrio un error al subir el documento";
} catch (SQLException e) {
logger.error("Error ", e); logger.error("Error ", e);
error = "Ocurrio un error al subir el documento"; error = "Ocurrio un error al subir el documento";
} }
...@@ -173,23 +200,26 @@ public class TituloTransAction extends BaseContratoAction { ...@@ -173,23 +200,26 @@ public class TituloTransAction extends BaseContratoAction {
} }
private ContratoDTO inicializarContrato() { private ContratoDTO inicializarContrato() throws TransaccionException {
this.setIdContrato((Long) this.getSession().get("idContrato")); this.setIdContrato((Long) this.getSession().get("idContrato"));
ContratoDTO ct = null; ContratoDTO ct = null;
try { try {
ct = generalesBO.obtenContrato(this.getIdContrato()); ct = generalesBO.obtenContrato(this.getIdContrato());
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
setEstatusContrato(ct.getIdEstatus()); setEstatusContrato(ct.getIdEstatus());
return ct; return ct;
} }
private void inicializarCatalogos(Long idContrato) { private void inicializarCatalogos(Long idContrato) throws TransaccionException {
tituloTranGridBO.obtenerCatalogos(idContrato); tituloTranGridBO.obtenerCatalogos(idContrato);
this.filiales = tituloTranGridBO.getFiliales(); this.filiales = tituloTranGridBO.getFiliales();
this.categorias = tituloTranGridBO.getCategorias(); this.categorias = tituloTranGridBO.getCategorias();
...@@ -201,10 +231,13 @@ public class TituloTransAction extends BaseContratoAction { ...@@ -201,10 +231,13 @@ public class TituloTransAction extends BaseContratoAction {
this.listasValidas = tituloBO.buscaListasValidas(idContrato); this.listasValidas = tituloBO.buscaListasValidas(idContrato);
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
} }
......
package com.mx.dla.dda.excelMapper.action; package com.mx.dla.dda.excelMapper.action;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import org.codehaus.jackson.JsonParseException;
import org.codehaus.jackson.map.JsonMappingException;
import org.codehaus.jackson.map.ObjectMapper; import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.type.TypeReference; import org.codehaus.jackson.type.TypeReference;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import com.mx.dla.dda.contrato.transaccion.exceptions.dtos.TransaccionException;
import com.mx.dla.dda.excelMapper.bos.ExcelMapperTransform; import com.mx.dla.dda.excelMapper.bos.ExcelMapperTransform;
import com.mx.dla.dda.excelMapper.constants.ExcelMapperConstants; import com.mx.dla.dda.excelMapper.constants.ExcelMapperConstants;
import com.mx.dla.dda.excelMapper.exceptions.ExcelMapperException;
import com.mx.dla.global.actions.BaseAction; import com.mx.dla.global.actions.BaseAction;
public class ExcelMapperAction extends BaseAction { public class ExcelMapperAction extends BaseAction {
/** /**
* *
*/ */
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private InputStream fileInputStream; private InputStream fileInputStream;
private String elements; private String elements;
@Autowired @Autowired
private ExcelMapperTransform excelMapperTransform; private ExcelMapperTransform excelMapperTransform;
@Override @Override
public String execute() throws Exception { public String execute()
throws TransaccionException, JsonParseException, JsonMappingException, IOException, ExcelMapperException {
if( elements != null) {
logger.trace("Datos recividos [{}]",elements); if (elements != null) {
getSession().put(ExcelMapperConstants.MAP_SESSION,elements); logger.trace("Datos recividos [{}]", elements);
getSession().put(ExcelMapperConstants.MAP_SESSION, elements);
fileInputStream = new ByteArrayInputStream(new byte[1]); fileInputStream = new ByteArrayInputStream(new byte[1]);
return SUCCESS; return SUCCESS;
} } else {
else { String map = (String) getSession().get(ExcelMapperConstants.MAP_SESSION);
String map = (String) getSession().get(ExcelMapperConstants.MAP_SESSION); if (map == null) {
if(map == null) throw new TransaccionException("No existen datos para generar el reporte");
{
throw new Exception("No existen datos para generar el reporte");
} }
logger.trace("Datos para genrerar excel [{}]",map); logger.trace("Datos para genrerar excel [{}]", map);
ObjectMapper mapper = new ObjectMapper(); ObjectMapper mapper = new ObjectMapper();
Map<String, Object> toExcel = mapper.readValue( map, Map<String, Object> toExcel = mapper.readValue(map, new TypeReference<Map<String, Object>>() {
new TypeReference<Map<String, Object>>() {
}); });
List<HashMap> rows = (List<HashMap>) toExcel.get(ExcelMapperConstants.ROOT_ELEMENT); List<HashMap> rows = (List<HashMap>) toExcel.get(ExcelMapperConstants.ROOT_ELEMENT);
byte [] bytes = excelMapperTransform.transformMapToExcel(rows); byte[] bytes = excelMapperTransform.transformMapToExcel(rows);
fileInputStream = new ByteArrayInputStream(bytes); fileInputStream = new ByteArrayInputStream(bytes);
return SUCCESS; return SUCCESS;
} }
} }
public InputStream getFileInputStream() { public InputStream getFileInputStream() {
return fileInputStream; return fileInputStream;
} }
public void setFileInputStream(InputStream fileInputStream) { public void setFileInputStream(InputStream fileInputStream) {
this.fileInputStream = fileInputStream; this.fileInputStream = fileInputStream;
} }
public String getElements() { public String getElements() {
return elements; return elements;
} }
public void setElements(String elements) { public void setElements(String elements) {
this.elements = elements; this.elements = elements;
} }
......
...@@ -56,7 +56,7 @@ public class FacturacionAction extends BaseContratoAction { ...@@ -56,7 +56,7 @@ public class FacturacionAction extends BaseContratoAction {
return Action.SUCCESS; return Action.SUCCESS;
} }
public String cargaFacturaDetalle() { public String cargaFacturaDetalle() throws TransaccionException {
try { try {
Long idEst = new Long(Long.parseLong(idEstudio)); Long idEst = new Long(Long.parseLong(idEstudio));
...@@ -77,17 +77,20 @@ public class FacturacionAction extends BaseContratoAction { ...@@ -77,17 +77,20 @@ public class FacturacionAction extends BaseContratoAction {
logger.info("cargaFacturaDetalle COMPLETE: " + factura); logger.info("cargaFacturaDetalle COMPLETE: " + factura);
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
bajaInfoDeSession(); bajaInfoDeSession();
return Action.SUCCESS; return Action.SUCCESS;
} }
public String guardaFactura() { public String guardaFactura() throws TransaccionException {
try { try {
ObjectMapper mapper = new ObjectMapper(); ObjectMapper mapper = new ObjectMapper();
...@@ -104,16 +107,22 @@ public class FacturacionAction extends BaseContratoAction { ...@@ -104,16 +107,22 @@ public class FacturacionAction extends BaseContratoAction {
} catch (JsonParseException e) { } catch (JsonParseException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (JsonMappingException e) { } catch (JsonMappingException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (IOException e) { } catch (IOException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
this.getSession().put("idFactura", String.valueOf(factura.getIdFactura())); this.getSession().put("idFactura", String.valueOf(factura.getIdFactura()));
......
...@@ -40,12 +40,12 @@ public class ReporteAcumulateBuysAction extends BaseContratoAction { ...@@ -40,12 +40,12 @@ public class ReporteAcumulateBuysAction extends BaseContratoAction {
private ReporteAcumulateBuysBO reporteacumulatebuyBO; private ReporteAcumulateBuysBO reporteacumulatebuyBO;
@Override @Override
public String execute() throws Exception { public String execute() {
return SUCCESS; return SUCCESS;
} }
public String reporteAcumulateBuys() { public String reporteAcumulateBuys() throws TransaccionException {
try { try {
header = reporteacumulatebuyBO.obtenerHeader(fechaInicio, fechaFin, id_estudio); header = reporteacumulatebuyBO.obtenerHeader(fechaInicio, fechaFin, id_estudio);
...@@ -54,18 +54,25 @@ public class ReporteAcumulateBuysAction extends BaseContratoAction { ...@@ -54,18 +54,25 @@ public class ReporteAcumulateBuysAction extends BaseContratoAction {
fechaInicio, fechaFin); fechaInicio, fechaFin);
} catch (ParseException e) { } catch (ParseException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (IllegalAccessException e) { } catch (IllegalAccessException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (Exception e) { } catch (Exception e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
return SUCCESS; return SUCCESS;
......
...@@ -31,60 +31,71 @@ public class ExcelAmortizacionAction extends BaseContratoAction { ...@@ -31,60 +31,71 @@ public class ExcelAmortizacionAction extends BaseContratoAction {
return SUCCESS; return SUCCESS;
} }
public String descargarArchivo() { public String descargarArchivo() throws TransaccionException {
byte[] bytes = null;
try {
bytes = reporteExcelAmortizacionBO.generaReporteAmortizacion(idEstudio, fecha);
} catch (ResultMapException e) {
logger.error("Error. {}", e);
} catch (SQLException e) {
logger.error("Error. {}", e);
} catch (TransaccionException e) {
logger.error("Error. {}", e);
} catch (ExcelMapperException e) {
logger.error("Error. {}", e);
} catch (IOException e) {
logger.error("Error. {}", e);
}
fileInputStream = new ByteArrayInputStream(bytes);
byte[] bytes = null;
try {
bytes = reporteExcelAmortizacionBO.generaReporteAmortizacion(idEstudio, fecha);
} catch (ResultMapException e) {
logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) {
logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) {
logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (ExcelMapperException e) {
logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (IOException e) {
logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
}
fileInputStream = new ByteArrayInputStream(bytes);
return SUCCESS; return SUCCESS;
} }
public String descargarArchivoSAP() { public String descargarArchivoSAP() throws TransaccionException {
try { try {
byte[] bytes = reporteExcelAmortizacionBO.generaReporteAmortizacionSAP(idEstudio, fecha); byte[] bytes = reporteExcelAmortizacionBO.generaReporteAmortizacionSAP(idEstudio, fecha);
fileInputStream = new ByteArrayInputStream(bytes); fileInputStream = new ByteArrayInputStream(bytes);
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (ExcelMapperException e) { } catch (ExcelMapperException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (IOException e) { } catch (IOException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
return SUCCESS; return SUCCESS;
} }
public String descargarArchivoSAPDLA() { public String descargarArchivoSAPDLA() throws TransaccionException {
try { try {
byte[] bytes = reporteExcelAmortizacionBO.generaReporteAmortizacionSAPDLA(idEstudio, fecha); byte[] bytes = reporteExcelAmortizacionBO.generaReporteAmortizacionSAPDLA(idEstudio, fecha);
fileInputStream = new ByteArrayInputStream(bytes); fileInputStream = new ByteArrayInputStream(bytes);
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
return SUCCESS; return SUCCESS;
......
...@@ -61,28 +61,34 @@ public class ReporteAmortizacionAction extends BaseContratoAction { ...@@ -61,28 +61,34 @@ public class ReporteAmortizacionAction extends BaseContratoAction {
@Autowired @Autowired
private ReporteAmortizacionDAO reporteAmortizacionDAO; private ReporteAmortizacionDAO reporteAmortizacionDAO;
public String obtenerContratos() { public String obtenerContratos() throws TransaccionException {
try { try {
contratos = catalogosBO.getContratosByEstudio(idEstudio); contratos = catalogosBO.getContratosByEstudio(idEstudio);
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
return Action.SUCCESS; return Action.SUCCESS;
} }
public String obtenerEstudios() { public String obtenerEstudios() throws TransaccionException {
try { try {
estudios = catalogosBO.obtenListaEstudios(); estudios = catalogosBO.obtenListaEstudios();
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error en [" + this.getClass() + "]", e); logger.error("Error en [" + this.getClass() + "]", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("Error en [" + this.getClass() + "]", e); logger.error("Error en [" + this.getClass() + "]", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error en [" + this.getClass() + "]", e); logger.error("Error en [" + this.getClass() + "]", e);
throw new TransaccionException("Ocurrio un error", e);
} }
return Action.SUCCESS; return Action.SUCCESS;
} }
...@@ -213,20 +219,14 @@ public class ReporteAmortizacionAction extends BaseContratoAction { ...@@ -213,20 +219,14 @@ public class ReporteAmortizacionAction extends BaseContratoAction {
addActionError("Ha ocurrido un error"); addActionError("Ha ocurrido un error");
} }
return Action.SUCCESS; return Action.SUCCESS;
} }
public String cargaMontoTitulosPorContratoSAP() { public String cargaMontoTitulosPorContratoSAP() {
logger.debug("ID!!! idContrato: " + idContrato + "::: fecha: " + fecha);
try { try {
montosTitulos = reporteAmortizacionBO.obtenListaMontoTitulosPorContratoSAP(idContrato, fecha); montosTitulos = reporteAmortizacionBO.obtenListaMontoTitulosPorContratoSAP(idContrato, fecha);
logger.debug("montosTitulos !!!!: " + montosTitulos);
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error en [" + this.getClass() + "]", e); logger.error("Error en [" + this.getClass() + "]", e);
addActionError("Ha ocurrido un error"); addActionError("Ha ocurrido un error");
...@@ -235,14 +235,10 @@ public class ReporteAmortizacionAction extends BaseContratoAction { ...@@ -235,14 +235,10 @@ public class ReporteAmortizacionAction extends BaseContratoAction {
addActionError("Ha ocurrido un error"); addActionError("Ha ocurrido un error");
} }
return Action.SUCCESS; return Action.SUCCESS;
} }
public String cargaMontoTitulosPorContratoSAPDLA() { public String cargaMontoTitulosPorContratoSAPDLA() {
logger.debug("ID!!! idContrato: " + idContrato + "::: fecha: " + fecha);
try { try {
year = Integer.parseInt(fecha.substring(3)); year = Integer.parseInt(fecha.substring(3));
Integer month = Integer.parseInt(fecha.substring(0, 2)); Integer month = Integer.parseInt(fecha.substring(0, 2));
...@@ -301,8 +297,6 @@ public class ReporteAmortizacionAction extends BaseContratoAction { ...@@ -301,8 +297,6 @@ public class ReporteAmortizacionAction extends BaseContratoAction {
} }
} }
} }
logger.debug("montosTitulos !!!!: " + montosTitulos);
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error en [" + this.getClass() + "]", e); logger.error("Error en [" + this.getClass() + "]", e);
addActionError("Ha ocurrido un error"); addActionError("Ha ocurrido un error");
...@@ -311,7 +305,6 @@ public class ReporteAmortizacionAction extends BaseContratoAction { ...@@ -311,7 +305,6 @@ public class ReporteAmortizacionAction extends BaseContratoAction {
addActionError("Ha ocurrido un error"); addActionError("Ha ocurrido un error");
} }
return Action.SUCCESS; return Action.SUCCESS;
} }
......
package com.mx.dla.dda.reporte.amortizacion.baseActivos.actions; package com.mx.dla.dda.reporte.amortizacion.baseActivos.actions;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.IOException; import java.io.IOException;
...@@ -29,24 +29,22 @@ public class BaseActivosAction extends BaseContratoAction { ...@@ -29,24 +29,22 @@ public class BaseActivosAction extends BaseContratoAction {
private static final long serialVersionUID = 4698989047503278255L; private static final long serialVersionUID = 4698989047503278255L;
private ResponseGeneraReporteDTO respuesta; private ResponseGeneraReporteDTO respuesta;
private String mensajeExcepcion; private String mensajeExcepcion;
private String fecha; private String fecha;
private String fechaFin; private String fechaFin;
private String rutaArchivo; private String rutaArchivo;
private String contentType; private String contentType;
@Autowired @Autowired
private BaseActivosBO baseActivosBO; private BaseActivosBO baseActivosBO;
public String primeraCarga(){ public String primeraCarga() {
return SUCCESS; return SUCCESS;
} }
public String generarReporte() public String generarReporte() throws TransaccionException {
{ try {
try
{
DateFormat formatoEntrada = new SimpleDateFormat("yyyy"); DateFormat formatoEntrada = new SimpleDateFormat("yyyy");
Date date = formatoEntrada.parse(fecha); Date date = formatoEntrada.parse(fecha);
Date dateFin = formatoEntrada.parse(fechaFin); Date dateFin = formatoEntrada.parse(fechaFin);
...@@ -54,67 +52,71 @@ public class BaseActivosAction extends BaseContratoAction { ...@@ -54,67 +52,71 @@ public class BaseActivosAction extends BaseContratoAction {
SimpleDateFormat formatoAnio = new SimpleDateFormat("yyyy"); SimpleDateFormat formatoAnio = new SimpleDateFormat("yyyy");
Long anio = Long.parseLong(formatoAnio.format(date)); Long anio = Long.parseLong(formatoAnio.format(date));
Long anioFin = Long.parseLong(formatoAnio.format(dateFin)); Long anioFin = Long.parseLong(formatoAnio.format(dateFin));
UsuarioDTO usuario = (UsuarioDTO) getSession().get("usuario"); UsuarioDTO usuario = (UsuarioDTO) getSession().get("usuario");
String fileFileName = "rba" + usuario.getExpediente() + "" + anio; String fileFileName = "rba" + usuario.getExpediente() + "" + anio;
respuesta = baseActivosBO.generaReporteBaseActivos( fileFileName, anio, anioFin); respuesta = baseActivosBO.generaReporteBaseActivos(fileFileName, anio, anioFin);
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (IOException e) { } catch (IOException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (ParseException e) { } catch (ParseException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
return SUCCESS; return SUCCESS;
} }
public String descargarArchivo() throws TransaccionException {
public String descargarArchivo(){
byte[] result = null; byte[] result = null;
logger.info("ruta archivo: " + rutaArchivo ); logger.info("ruta archivo: " + rutaArchivo);
try try {
{ String[] layRuta = rutaArchivo.split("\\/");
String [] layRuta = rutaArchivo.split("\\/");
Long lnuTotalRuta = (long) layRuta.length; Long lnuTotalRuta = (long) layRuta.length;
String nombre = layRuta[ (int) ( lnuTotalRuta - 1 ) ]; String nombre = layRuta[(int) (lnuTotalRuta - 1)];
File file = new File(rutaArchivo); File file = new File(rutaArchivo);
logger.info("nombre archivo: " + nombre ); logger.info("nombre archivo: " + nombre);
logger.info("descar: " + rutaArchivo); logger.info("descar: " + rutaArchivo);
result = IOUtils.toByteArray(new FileInputStream(file)); result = IOUtils.toByteArray(new FileInputStream(file));
contentType = ContentType.getType(FilenameUtils.getExtension(rutaArchivo)); contentType = ContentType.getType(FilenameUtils.getExtension(rutaArchivo));
HttpServletResponse response = ServletActionContext.getResponse(); HttpServletResponse response = ServletActionContext.getResponse();
response.setContentLength(result.length); response.setContentLength(result.length);
response.setContentType(this.contentType); response.setContentType(this.contentType);
response.setHeader("Content-Disposition", "attachment; filename="+ nombre); response.setHeader("Content-Disposition", "attachment; filename=" + nombre);
logger.info("response [{}] :" + response ); logger.info("response [{}] :" + response);
ServletOutputStream out = response.getOutputStream(); ServletOutputStream out = response.getOutputStream();
out.write(result); out.write(result);
out.flush(); out.flush();
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error en [" + this.getClass() +"]", e); logger.error("Error en [" + this.getClass() + "]", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (IOException e) { } catch (IOException e) {
logger.error("Error en [" + this.getClass() +"]", e); logger.error("Error en [" + this.getClass() + "]", e);
throw new TransaccionException("Ocurrio un error", e);
} }
return null; return null;
} }
public ResponseGeneraReporteDTO getRespuesta() { public ResponseGeneraReporteDTO getRespuesta() {
return respuesta; return respuesta;
} }
...@@ -130,7 +132,7 @@ public class BaseActivosAction extends BaseContratoAction { ...@@ -130,7 +132,7 @@ public class BaseActivosAction extends BaseContratoAction {
public void setMensajeExcepcion(String mensajeExcepcion) { public void setMensajeExcepcion(String mensajeExcepcion) {
this.mensajeExcepcion = mensajeExcepcion; this.mensajeExcepcion = mensajeExcepcion;
} }
public String getRutaArchivo() { public String getRutaArchivo() {
return rutaArchivo; return rutaArchivo;
} }
...@@ -154,5 +156,5 @@ public class BaseActivosAction extends BaseContratoAction { ...@@ -154,5 +156,5 @@ public class BaseActivosAction extends BaseContratoAction {
public void setFechaFin(String fechaFin) { public void setFechaFin(String fechaFin) {
this.fechaFin = fechaFin; this.fechaFin = fechaFin;
} }
} }
...@@ -175,8 +175,8 @@ public class ReporteDatosContratoAction extends BaseContratoAction { ...@@ -175,8 +175,8 @@ public class ReporteDatosContratoAction extends BaseContratoAction {
errorMensaje = e.getMessage(); errorMensaje = e.getMessage();
logger.error("Error. {}", e); logger.error("Error. {}", e);
} catch (ReportCostPerViewException e) { } catch (ReportCostPerViewException e) {
// TODO Auto-generated catch block errorMensaje = e.getMessage();
e.printStackTrace(); logger.error("Error. {}", e);
} }
return SUCCESS; return SUCCESS;
} }
......
...@@ -34,26 +34,29 @@ public class ReporteMovimientosAction extends BaseContratoAction { ...@@ -34,26 +34,29 @@ public class ReporteMovimientosAction extends BaseContratoAction {
@Autowired @Autowired
private ReporteMovimientosBO reporteMovimientos; private ReporteMovimientosBO reporteMovimientos;
public String execute() { public String execute() throws TransaccionException {
try { try {
setEstudios(poblarGeneralesBO.obtenListaEstudios()); setEstudios(poblarGeneralesBO.obtenListaEstudios());
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
return SUCCESS; return SUCCESS;
} }
public String generaReporte() { public String generaReporte() {
if (mes.isEmpty()){ if (mes.isEmpty()) {
mes = null; mes = null;
} else{ } else {
mes = mes.substring(0,3) + mes.substring(6); mes = mes.substring(0, 3) + mes.substring(6);
} }
if(contrato.isEmpty()){ if (contrato.isEmpty()) {
contrato = null; contrato = null;
} }
setReporte(reporteMovimientos.obtenerDatosReporte(contrato, estudio, mes)); setReporte(reporteMovimientos.obtenerDatosReporte(contrato, estudio, mes));
......
...@@ -8,6 +8,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -8,6 +8,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import com.mx.dla.dda.catalogos.dtos.CatalogoDTO; import com.mx.dla.dda.catalogos.dtos.CatalogoDTO;
import com.mx.dla.dda.contrato.titulos.constants.TipoOrden; import com.mx.dla.dda.contrato.titulos.constants.TipoOrden;
import com.mx.dla.dda.contrato.titulos.constants.TipoTitulo; import com.mx.dla.dda.contrato.titulos.constants.TipoTitulo;
import com.mx.dla.dda.contrato.transaccion.exceptions.dtos.TransaccionException;
import com.mx.dla.dda.reporte.pagosTransaccion.bos.PagoTransaccionHistoricoBO; import com.mx.dla.dda.reporte.pagosTransaccion.bos.PagoTransaccionHistoricoBO;
import com.mx.dla.dda.reporte.pagosTransaccion.dtos.PagoTransaccion; import com.mx.dla.dda.reporte.pagosTransaccion.dtos.PagoTransaccion;
import com.mx.dla.dda.reporte.pagosTransaccion.dtos.PagoTransaccionFiltros; import com.mx.dla.dda.reporte.pagosTransaccion.dtos.PagoTransaccionFiltros;
...@@ -24,8 +25,13 @@ public class PagoTransaccionHistoricoAction extends BaseAction{ ...@@ -24,8 +25,13 @@ public class PagoTransaccionHistoricoAction extends BaseAction{
private PagoTransaccionHistoricoBO pagoTransaccionBO; private PagoTransaccionHistoricoBO pagoTransaccionBO;
@Override @Override
public String execute() throws Exception { public String execute() throws TransaccionException {
return super.execute(); try {
return super.execute();
} catch (Exception e) {
logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
}
} }
public String buscaPagos() public String buscaPagos()
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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