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>
...@@ -108,72 +84,3 @@ ...@@ -108,72 +84,3 @@
</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,6 +17,7 @@ import com.mx.dla.admin.dtos.MenuDTO; ...@@ -15,6 +17,7 @@ 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
...@@ -35,57 +38,59 @@ public class InicioAction extends BaseContratoAction { ...@@ -35,57 +38,59 @@ public class InicioAction extends BaseContratoAction {
List<MenuDTO> menusUsuario = null; List<MenuDTO> menusUsuario = null;
@Override @Override
public String execute() throws Exception { public String execute() throws TransaccionException {
String retorno = SUCCESS;
try {
Authentication autenticacion = SecurityContextHolder.getContext().getAuthentication(); Authentication autenticacion = SecurityContextHolder.getContext().getAuthentication();
UsuarioDTO usuario = usuarioDAO.obtenerUsuario( autenticacion.getName() ); UsuarioDTO usuario = usuarioDAO.obtenerUsuario(autenticacion.getName());
ActionContext.getContext().getSession().remove("pmn"); ActionContext.getContext().getSession().remove("pmn");
ActionContext.getContext().getSession().remove("pmnReturn"); ActionContext.getContext().getSession().remove("pmnReturn");
String retorno = SUCCESS; if (!this.getPmn().equals("0"))
if( !this.getPmn().equals("0") )
retorno = "menu_" + this.getPmn(); retorno = "menu_" + this.getPmn();
if( usuario != null ) if (usuario != null) {
{
getSession().put("permisos", menuBO.obtenPermisosPerfil(usuario.getPerfil().getIdPerfil())); getSession().put("permisos", menuBO.obtenPermisosPerfil(usuario.getPerfil().getIdPerfil()));
String idPerfil = usuario.getPerfil().getIdPerfil(); String idPerfil = usuario.getPerfil().getIdPerfil();
if( idPerfil != null ) if (idPerfil != null) {
{ PerfilDTO perfil = perfilDAO.obtenerPerfil(idPerfil);
PerfilDTO perfil = perfilDAO.obtenerPerfil( idPerfil );
logger.debug("PerfilDTO : [{}]", perfil); logger.debug("PerfilDTO : [{}]", perfil);
if (perfil != null) {
if( perfil != null )
{
getSession().put("usuario", usuario); getSession().put("usuario", usuario);
List<MenuDTO> menusPerfil = perfil.getMenus(); List<MenuDTO> menusPerfil = perfil.getMenus();
if( menusPerfil != null ){ if (menusPerfil != null) {
menusUsuario = menuBO.armarArbolMenus( menusPerfil, idPerfil ); menusUsuario = menuBO.armarArbolMenus(menusPerfil, idPerfil);
getSession().put("menus", perfil.getMenus() ); getSession().put("menus", perfil.getMenus());
} }
} else } else {
{
retorno = "error_002"; retorno = "error_002";
} }
} else } else {
{
retorno = "error_002"; retorno = "error_002";
} }
} else { } else {
retorno = "error_001"; retorno = "error_001";
} }
} catch (ResultMapException 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 (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;
try {
fecha = bdsp.consultaMesActual(String.valueOf(currentDate.getYear()),
String.valueOf(currentDate.getMonthValue())); 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();
try {
setEstudios(estudioAddonBO.getEstudios()); setEstudios(estudioAddonBO.getEstudios());
setPaises(addOnBO.obtenerPaisesAddOn()); 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(){ public String listadoMateriales() throws TransaccionException {
try{ 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;
} }
......
...@@ -35,7 +35,6 @@ public class TipoCambioAddOnsAction extends BaseContratoAction { ...@@ -35,7 +35,6 @@ public class TipoCambioAddOnsAction extends BaseContratoAction {
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;
...@@ -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) {
...@@ -91,38 +95,44 @@ public class TipoCambioAddOnsAction extends BaseContratoAction { ...@@ -91,38 +95,44 @@ public class TipoCambioAddOnsAction extends BaseContratoAction {
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) {
...@@ -141,10 +151,10 @@ public class TipoCambioAddOnsAction extends BaseContratoAction { ...@@ -141,10 +151,10 @@ public class TipoCambioAddOnsAction extends BaseContratoAction {
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);
......
...@@ -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;
......
...@@ -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.";
......
...@@ -17,36 +17,35 @@ public class RevenuePorcAction extends BaseAction { ...@@ -17,36 +17,35 @@ 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;
} }
......
...@@ -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;
} }
......
...@@ -29,7 +29,7 @@ public class DescargaArchivoVistaPreviaAction extends BaseContratoAction { ...@@ -29,7 +29,7 @@ public class DescargaArchivoVistaPreviaAction extends BaseContratoAction {
@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;
...@@ -41,7 +41,7 @@ public class DescargaArchivoVistaPreviaAction extends BaseContratoAction { ...@@ -41,7 +41,7 @@ public class DescargaArchivoVistaPreviaAction extends BaseContratoAction {
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);
...@@ -49,14 +49,19 @@ public class DescargaArchivoVistaPreviaAction extends BaseContratoAction { ...@@ -49,14 +49,19 @@ public class DescargaArchivoVistaPreviaAction extends BaseContratoAction {
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;
...@@ -65,6 +70,7 @@ public class DescargaArchivoVistaPreviaAction extends BaseContratoAction { ...@@ -65,6 +70,7 @@ public class DescargaArchivoVistaPreviaAction extends BaseContratoAction {
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;
} }
...@@ -77,5 +83,4 @@ public class DescargaArchivoVistaPreviaAction extends BaseContratoAction { ...@@ -77,5 +83,4 @@ public class DescargaArchivoVistaPreviaAction extends BaseContratoAction {
return vistaPrevia; return vistaPrevia;
} }
} }
...@@ -32,16 +32,15 @@ public class CatalogosAction extends BaseAction { ...@@ -32,16 +32,15 @@ public class CatalogosAction extends BaseAction {
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";
} }
......
...@@ -37,7 +37,7 @@ public class AmortizacionAction extends BaseContratoAction { ...@@ -37,7 +37,7 @@ public class AmortizacionAction extends BaseContratoAction {
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) {
...@@ -75,10 +75,9 @@ public class AmortizacionAction extends BaseContratoAction { ...@@ -75,10 +75,9 @@ 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());
} }
...@@ -92,6 +91,7 @@ public class AmortizacionAction extends BaseContratoAction { ...@@ -92,6 +91,7 @@ public class AmortizacionAction extends BaseContratoAction {
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;
} }
......
...@@ -10,7 +10,7 @@ import com.mx.dla.dda.contrato.generales.bos.GeneralesBO; ...@@ -10,7 +10,7 @@ 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;
...@@ -19,17 +19,20 @@ public class BdealAction extends BaseContratoAction{ ...@@ -19,17 +19,20 @@ public class BdealAction extends BaseContratoAction{
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());
...@@ -52,5 +55,4 @@ public class BdealAction extends BaseContratoAction{ ...@@ -52,5 +55,4 @@ public class BdealAction extends BaseContratoAction{
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;
try {
ct = generalesBO.obtenContrato(idC);
getSession().put(ContratoConstats.CONTRATO_SESSION, ct); getSession().put(ContratoConstats.CONTRATO_SESSION, ct);
setEstatusContrato(ct.getIdEstatus()); 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();
try {
contrato = generales.obtenContrato(getIdContrato()); 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"));
......
...@@ -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;
} }
......
...@@ -26,15 +26,18 @@ public class ExponerApartadosAction extends BaseContratoAction { ...@@ -26,15 +26,18 @@ public class ExponerApartadosAction extends BaseContratoAction {
@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;
} }
......
...@@ -21,16 +21,19 @@ public class InfoContratoAction extends BaseContratoAction { ...@@ -21,16 +21,19 @@ public class InfoContratoAction extends BaseContratoAction {
@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;
} }
} }
...@@ -29,18 +29,21 @@ public class ObtenerPermisosAction extends BaseContratoAction { ...@@ -29,18 +29,21 @@ public class ObtenerPermisosAction extends BaseContratoAction {
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;
......
...@@ -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 {
...@@ -29,16 +28,19 @@ public class AnniosPeriodosAction extends BaseContratoAction { ...@@ -29,16 +28,19 @@ public class AnniosPeriodosAction extends BaseContratoAction {
@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;
......
...@@ -34,21 +34,24 @@ public class CambioMinimoAction extends BaseContratoAction { ...@@ -34,21 +34,24 @@ public class CambioMinimoAction extends BaseContratoAction {
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);
} }
......
...@@ -49,7 +49,7 @@ public class MinSeleccionAction extends BaseContratoAction { ...@@ -49,7 +49,7 @@ public class MinSeleccionAction extends BaseContratoAction {
@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;
...@@ -57,10 +57,13 @@ public class MinSeleccionAction extends BaseContratoAction { ...@@ -57,10 +57,13 @@ public class MinSeleccionAction extends BaseContratoAction {
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();
...@@ -70,7 +73,6 @@ public class MinSeleccionAction extends BaseContratoAction { ...@@ -70,7 +73,6 @@ 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");
...@@ -114,8 +116,7 @@ public class MinSeleccionAction extends BaseContratoAction { ...@@ -114,8 +116,7 @@ public class MinSeleccionAction extends BaseContratoAction {
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())) {
...@@ -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;
} }
......
...@@ -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;
......
...@@ -30,16 +30,20 @@ public class PrecioAnualMinimoAction extends BaseContratoAction { ...@@ -30,16 +30,20 @@ public class PrecioAnualMinimoAction extends BaseContratoAction {
@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]);
...@@ -119,5 +123,4 @@ public class PrecioAnualMinimoAction extends BaseContratoAction { ...@@ -119,5 +123,4 @@ public class PrecioAnualMinimoAction extends BaseContratoAction {
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());
......
...@@ -11,6 +11,7 @@ import com.mx.dla.dda.contrato.promociones.dtos.PaisesPromocionesDTO; ...@@ -11,6 +11,7 @@ import com.mx.dla.dda.contrato.promociones.dtos.PaisesPromocionesDTO;
import com.mx.dla.dda.contrato.promociones.dtos.PromocionDTO; import com.mx.dla.dda.contrato.promociones.dtos.PromocionDTO;
import com.mx.dla.dda.contrato.promociones.dtos.PromocionTitulosDTO; import com.mx.dla.dda.contrato.promociones.dtos.PromocionTitulosDTO;
import com.mx.dla.dda.contrato.promociones.dtos.TitulosPromocionesDTO; import com.mx.dla.dda.contrato.promociones.dtos.TitulosPromocionesDTO;
import com.mx.dla.dda.contrato.transaccion.exceptions.dtos.TransaccionException;
public class PromocionesAction extends BaseContratoAction { public class PromocionesAction extends BaseContratoAction {
...@@ -32,201 +33,208 @@ public class PromocionesAction extends BaseContratoAction { ...@@ -32,201 +33,208 @@ public class PromocionesAction extends BaseContratoAction {
private String tipo_descuento; private String tipo_descuento;
private String descuento; private String descuento;
@Autowired @Autowired
private PromocionesBO promocionesBO; private PromocionesBO promocionesBO;
@Override @Override
public String execute() throws Exception { public String execute() {
return SUCCESS; return SUCCESS;
} }
public String obtenerPromociones(){ public String obtenerPromociones() throws TransaccionException {
logger.info("Inicia.PromocionesAction.obtenerPromociones- : [{}]"); logger.info("Inicia.PromocionesAction.obtenerPromociones- : [{}]");
try{ try {
promociones = promocionesBO.obtenPromociones(); promociones = promocionesBO.obtenPromociones();
logger.info("PromocionesAction.obtenerPromociones- : [{}]"+promociones); logger.info("PromocionesAction.obtenerPromociones- : [{}]" + promociones);
}catch(Exception e){ } catch (TransaccionException e) {
System.out.println("Error.PromocionesAction.obtenerPromociones- "+e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
return SUCCESS; return SUCCESS;
} }
public String obtenerPromocionesVigentes(){ public String obtenerPromocionesVigentes() throws TransaccionException {
logger.info("Inicia.PromocionesAction.obtenPromocionesVigentes - [{}]"); logger.info("Inicia.PromocionesAction.obtenPromocionesVigentes - [{}]");
try{ try {
promociones = promocionesBO.obtenPromocionesVigentes(); promociones = promocionesBO.obtenPromocionesVigentes();
logger.info("PromocionesAction.obtenPromocionesVigentes : [{}]"+promociones); logger.info("PromocionesAction.obtenPromocionesVigentes : [{}]" + promociones);
}catch(Exception e){ } catch (TransaccionException e) {
System.out.println("Error.PromocionesAction.obtenPromocionesVigentes - "+e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
return SUCCESS; return SUCCESS;
} }
public String eliminaPromocion(){ public String eliminaPromocion() {
try{ try {
logger.info("Inicia eliminaPromocion - [{}]"+id_promocion); logger.info("Inicia eliminaPromocion - [{}]" + id_promocion);
promocionesBO.eliminarPromocion(id_promocion); promocionesBO.eliminarPromocion(id_promocion);
return SUCCESS; return SUCCESS;
}catch(Exception e){ } catch (TransaccionException e) {
logger.error("ERROR - ACTION eliminaPromocion [{}]"+e); logger.error("ERROR - ACTION eliminaPromocion [{}]" + e);
return ERROR; return ERROR;
} }
} }
public String eliminaTitulosPromocion(){ public String eliminaTitulosPromocion() {
try{ try {
logger.info("Inicia eliminaTitulosPromocion - [{}]"+id_promocion); logger.info("Inicia eliminaTitulosPromocion - [{}]" + id_promocion);
promocionesBO.eliminaTitulosPromocion(id_promocion); promocionesBO.eliminaTitulosPromocion(id_promocion);
return SUCCESS; return SUCCESS;
}catch(Exception e){ } catch (TransaccionException e) {
logger.error("ERROR - ACTION: eliminaTitulosPromocion [{}]"+e); logger.error("ERROR - ACTION: eliminaTitulosPromocion [{}]" + e);
return ERROR; return ERROR;
} }
} }
public String obtenerPromocionTitulos(){ public String obtenerPromocionTitulos() {
try{ try {
logger.info("Inicia obtenerPromocionTitulos - [{}]"+id_promocion); logger.info("Inicia obtenerPromocionTitulos - [{}]" + id_promocion);
promociontitulos = promocionesBO.obtenerPromocionTitulos(id_promocion); promociontitulos = promocionesBO.obtenerPromocionTitulos(id_promocion);
return SUCCESS; return SUCCESS;
}catch(Exception e){ } catch (TransaccionException e) {
logger.error("ERROR - obtenerPromocionTitulos [{}]"+e); logger.error("ERROR - obtenerPromocionTitulos [{}]" + e);
return ERROR; return ERROR;
} }
} }
public String obtenerEstudios(){ public String obtenerEstudios() throws TransaccionException {
logger.info("Inicia.PromocionesAction.obtenerEstudios - [{}]"); logger.info("Inicia.PromocionesAction.obtenerEstudios - [{}]");
try{ try {
estudios = promocionesBO.obtenerEstudios(); estudios = promocionesBO.obtenerEstudios();
logger.info("PromocionesAction.obtenerEstudios : [{}]"+estudios); logger.info("PromocionesAction.obtenerEstudios : [{}]" + estudios);
}catch(Exception e){ } catch (TransaccionException e) {
logger.error("ERROR - PromocionesAction.obtenerEstudios [{}]"+e); logger.error("ERROR - PromocionesAction.obtenerEstudios [{}]" + e);
throw new TransaccionException("Ocurrio un error", e);
} }
return SUCCESS; return SUCCESS;
} }
public String obtenerPaises(){ public String obtenerPaises() throws TransaccionException {
logger.info("Inicia.PromocionesAction.obtenerPaises - [{}]"); logger.info("Inicia.PromocionesAction.obtenerPaises - [{}]");
try{ try {
paises = promocionesBO.obtenerPaises(); paises = promocionesBO.obtenerPaises();
logger.info("PromocionesAction.obtenerPaises : [{}]"+paises); logger.info("PromocionesAction.obtenerPaises : [{}]" + paises);
}catch(Exception e){ } catch (TransaccionException e) {
logger.error("ERROR - PromocionesAction.obtenerPaises [{}]"+e); logger.error("ERROR - PromocionesAction.obtenerPaises [{}]" + e);
throw new TransaccionException("Ocurrio un error", e);
} }
return SUCCESS; return SUCCESS;
} }
public String obtenerTitulos(){ public String obtenerTitulos() throws TransaccionException {
logger.info("Inicia.PromocionesAction.obtenerTitulos - [{}]"); logger.info("Inicia.PromocionesAction.obtenerTitulos - [{}]");
try{ try {
titulos = promocionesBO.obtenerTitulos(id_pais,id_estudio); titulos = promocionesBO.obtenerTitulos(id_pais, id_estudio);
logger.info("PromocionesAction.obtenerTitulos : [{}]"+titulos); logger.info("PromocionesAction.obtenerTitulos : [{}]" + titulos);
}catch(Exception e){ } catch (TransaccionException e) {
logger.error("ERROR - PromocionesAction.obtenerTitulos [{}]"+e); logger.error("ERROR - PromocionesAction.obtenerTitulos [{}]" + e);
throw new TransaccionException("Ocurrio un error", e);
} }
return SUCCESS; return SUCCESS;
} }
public String obtenerTitulosTodos(){ public String obtenerTitulosTodos() throws TransaccionException {
logger.info("Inicia.PromocionesAction.obtenerTitulos - [{}]"); logger.info("Inicia.PromocionesAction.obtenerTitulos - [{}]");
try{ try {
titulos = promocionesBO.obtenerTitulosTodos(id_estudio); titulos = promocionesBO.obtenerTitulosTodos(id_estudio);
logger.info("PromocionesAction.obtenerTitulos : [{}]"+titulos); logger.info("PromocionesAction.obtenerTitulos : [{}]" + titulos);
}catch(Exception e){ } catch (TransaccionException e) {
logger.error("ERROR - PromocionesAction.obtenerTitulos [{}]"+e); logger.error("ERROR - PromocionesAction.obtenerTitulos [{}]" + e);
throw new TransaccionException("Ocurrio un error", e);
} }
return SUCCESS; return SUCCESS;
} }
public String creaPromocion(){ public String creaPromocion() throws TransaccionException {
logger.info("Inicia.PromocionesAction.creaPromocion - [{}]"); logger.info("Inicia.PromocionesAction.creaPromocion - [{}]");
try{ try {
promocion = promocionesBO.creaPromocion(id_estudio, id_pais, nombre_promocion, fecha_inicio, fecha_fin, tipo_descuento, descuento); promocion = promocionesBO.creaPromocion(id_estudio, id_pais, nombre_promocion, fecha_inicio, fecha_fin,
tipo_descuento, descuento);
logger.info("PromocionesAction.creaPromocion : [{}]"+titulos); logger.info("PromocionesAction.creaPromocion : [{}]" + titulos);
}catch(Exception e){ } catch (TransaccionException e) {
logger.error("ERROR - PromocionesAction.creaPromocion [{}]"+e); logger.error("ERROR - PromocionesAction.creaPromocion [{}]" + e);
throw new TransaccionException("Ocurrio un error", e);
} }
return SUCCESS; return SUCCESS;
} }
public String actualizaPromocion(){ public String actualizaPromocion() throws TransaccionException {
logger.info("Inicia.PromocionesAction.actualizaPromocion - [{}]"); logger.info("Inicia.PromocionesAction.actualizaPromocion - [{}]");
try{ try {
promocion = promocionesBO.actualizaPromocion(id_promocion, id_pais, nombre_promocion, fecha_inicio, fecha_fin, tipo_descuento, descuento); promocion = promocionesBO.actualizaPromocion(id_promocion, id_pais, nombre_promocion, fecha_inicio,
fecha_fin, tipo_descuento, descuento);
logger.info("PromocionesAction.actualizaPromocion : [{}]"+titulos); logger.info("PromocionesAction.actualizaPromocion : [{}]" + titulos);
}catch(Exception e){ } catch (TransaccionException e) {
logger.error("ERROR - PromocionesAction.actualizaPromocion [{}]"+e); logger.error("ERROR - PromocionesAction.actualizaPromocion [{}]" + e);
throw new TransaccionException("Ocurrio un error", e);
} }
return SUCCESS; return SUCCESS;
} }
public String registraPromocionTitulos(){ public String registraPromocionTitulos() throws TransaccionException {
logger.info("Inicia.PromocionesAction.registraPromocionTitulos - [{}]"); logger.info("Inicia.PromocionesAction.registraPromocionTitulos - [{}]");
try{ try {
promocionesBO.registraPromocionTitulos(id_promocion, id_bv); promocionesBO.registraPromocionTitulos(id_promocion, id_bv);
logger.info("PromocionesAction.registraPromocionTitulos : [{}]"+titulos); logger.info("PromocionesAction.registraPromocionTitulos : [{}]" + titulos);
}catch(Exception e){ } catch (TransaccionException e) {
logger.error("ERROR - PromocionesAction.registraPromocionTitulos [{}]"+e); logger.error("ERROR - PromocionesAction.registraPromocionTitulos [{}]" + e);
throw new TransaccionException("Ocurrio un error", e);
} }
return SUCCESS; return SUCCESS;
} }
public Long getId_promocion() { public Long getId_promocion() {
return id_promocion; return id_promocion;
} }
...@@ -347,6 +355,4 @@ public class PromocionesAction extends BaseContratoAction { ...@@ -347,6 +355,4 @@ public class PromocionesAction extends BaseContratoAction {
this.promociontitulos = promociontitulos; this.promociontitulos = promociontitulos;
} }
} }
...@@ -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();
try {
tituloBO.init(cto.getIdContrato(), cto.getFechaInicio(), false); tituloBO.init(cto.getIdContrato(), cto.getFechaInicio(), false);
this.tipoCargas = tituloBO.buscaTipoCargaDocumento(cto.getIdContrato()); 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 {
...@@ -29,29 +34,27 @@ public class ExcelMapperAction extends BaseAction { ...@@ -29,29 +34,27 @@ public class ExcelMapperAction extends BaseAction {
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) { if (elements != null) {
logger.trace("Datos recividos [{}]",elements); logger.trace("Datos recividos [{}]", elements);
getSession().put(ExcelMapperConstants.MAP_SESSION,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;
} }
......
...@@ -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; byte[] bytes = null;
try { try {
bytes = reporteExcelAmortizacionBO.generaReporteAmortizacion(idEstudio, fecha); bytes = reporteExcelAmortizacionBO.generaReporteAmortizacion(idEstudio, fecha);
} 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);
} }
fileInputStream = new ByteArrayInputStream(bytes); 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;
} }
......
...@@ -39,14 +39,12 @@ public class BaseActivosAction extends BaseContratoAction { ...@@ -39,14 +39,12 @@ public class BaseActivosAction extends BaseContratoAction {
@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);
...@@ -58,38 +56,40 @@ public class BaseActivosAction extends BaseContratoAction { ...@@ -58,38 +56,40 @@ public class BaseActivosAction extends BaseContratoAction {
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));
...@@ -98,18 +98,20 @@ public class BaseActivosAction extends BaseContratoAction { ...@@ -98,18 +98,20 @@ public class BaseActivosAction extends BaseContratoAction {
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;
......
...@@ -38,12 +38,12 @@ public class ReporteAmortvsPptoAction extends BaseContratoAction { ...@@ -38,12 +38,12 @@ public class ReporteAmortvsPptoAction extends BaseContratoAction {
private ReporteAmortvsPptoBO reporteAmortPptoBO; private ReporteAmortvsPptoBO reporteAmortPptoBO;
@Override @Override
public String execute() throws Exception { public String execute() {
return SUCCESS; return SUCCESS;
} }
public String obtenerReporteAmortPpto() { public String obtenerReporteAmortPpto() throws TransaccionException {
try { try {
logger.info("Inicia obtenReporteAmortPpto - [{}]" + fecha); logger.info("Inicia obtenReporteAmortPpto - [{}]" + fecha);
...@@ -63,16 +63,19 @@ public class ReporteAmortvsPptoAction extends BaseContratoAction { ...@@ -63,16 +63,19 @@ public class ReporteAmortvsPptoAction extends BaseContratoAction {
} 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 (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 descargaReporte() { public String descargaReporte() throws TransaccionException {
String nombre = "reporteAmortizacion.xlsx"; String nombre = "reporteAmortizacion.xlsx";
try { try {
byte[] bytes = reporteAmortPptoBO.descargaArchivoReporte(fecha); byte[] bytes = reporteAmortPptoBO.descargaArchivoReporte(fecha);
...@@ -80,17 +83,21 @@ public class ReporteAmortvsPptoAction extends BaseContratoAction { ...@@ -80,17 +83,21 @@ public class ReporteAmortvsPptoAction extends BaseContratoAction {
fileFileName = nombre; fileFileName = nombre;
} 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 (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 descargaObjArchivo() { public String descargaObjArchivo() throws TransaccionException {
String nombre; String nombre;
byte[] rep; byte[] rep;
...@@ -114,12 +121,16 @@ public class ReporteAmortvsPptoAction extends BaseContratoAction { ...@@ -114,12 +121,16 @@ public class ReporteAmortvsPptoAction extends BaseContratoAction {
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("ERROR - reporte amortizacion : [{}]", e); logger.error("ERROR - reporte amortizacion : [{}]", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (TransaccionException e) { } catch (TransaccionException e) {
logger.error("ERROR - reporte amortizacion : [{}]", e); logger.error("ERROR - reporte amortizacion : [{}]", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (IOException e) { } catch (IOException e) {
logger.error("ERROR - reporte amortizacion : [{}]", e); logger.error("ERROR - reporte amortizacion : [{}]", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (ExcelMapperException e) { } catch (ExcelMapperException e) {
logger.error("ERROR - reporte amortizacion : [{}]", e); logger.error("ERROR - reporte amortizacion : [{}]", e);
throw new TransaccionException("Ocurrio un error", e);
} }
return SUCCESS; return SUCCESS;
......
...@@ -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));
......
...@@ -14,6 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -14,6 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import com.mx.dla.admin.dtos.UsuarioDTO; import com.mx.dla.admin.dtos.UsuarioDTO;
import com.mx.dla.dda.catalogos.dtos.EstudioDTO; import com.mx.dla.dda.catalogos.dtos.EstudioDTO;
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.mx.dla.dda.excelMapper.exceptions.ExcelMapperException; import com.mx.dla.dda.excelMapper.exceptions.ExcelMapperException;
import com.mx.dla.dda.reporte.cpview.exception.ReportCostPerViewException; import com.mx.dla.dda.reporte.cpview.exception.ReportCostPerViewException;
import com.mx.dla.dda.reporte.oyp.bos.ReporteOveragesYPaymentsBO; import com.mx.dla.dda.reporte.oyp.bos.ReporteOveragesYPaymentsBO;
...@@ -36,7 +37,7 @@ public class ReporteOveragesYPaymentsViewAction extends BaseContratoAction { ...@@ -36,7 +37,7 @@ public class ReporteOveragesYPaymentsViewAction extends BaseContratoAction {
@Autowired @Autowired
private ReporteOveragesYPaymentsBO reporteOveragesYPaymentsBO; private ReporteOveragesYPaymentsBO reporteOveragesYPaymentsBO;
public String obtenerDatosReporte() { public String obtenerDatosReporte() throws TransaccionException {
try { try {
...@@ -47,26 +48,35 @@ public class ReporteOveragesYPaymentsViewAction extends BaseContratoAction { ...@@ -47,26 +48,35 @@ public class ReporteOveragesYPaymentsViewAction extends BaseContratoAction {
logger.info("idEstudio: {}", idEstudio); logger.info("idEstudio: {}", idEstudio);
logger.info("validaEstatusCarga: {}", validaEstatusCarga); logger.info("validaEstatusCarga: {}", validaEstatusCarga);
reporteVista = reporteOveragesYPaymentsBO.obtenerReporteOveragesYPaymentsVista(fechaInicial, fechaFinal, tipoPago, claveReporte, idEstudio, validaEstatusCarga); reporteVista = reporteOveragesYPaymentsBO.obtenerReporteOveragesYPaymentsVista(fechaInicial, fechaFinal,
tipoPago, claveReporte, idEstudio, validaEstatusCarga);
logger.info("getTabla: {}", reporteVista.getTabla()); logger.info("getTabla: {}", reporteVista.getTabla());
} catch (ResultMapException e) { } catch (ResultMapException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (InstantiationException e) { } catch (InstantiationException 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 (IllegalArgumentException e) { } catch (IllegalArgumentException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (InvocationTargetException e) { } catch (InvocationTargetException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (NoSuchMethodException e) { } catch (NoSuchMethodException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SecurityException e) { } catch (SecurityException 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;
...@@ -84,7 +94,7 @@ public class ReporteOveragesYPaymentsViewAction extends BaseContratoAction { ...@@ -84,7 +94,7 @@ public class ReporteOveragesYPaymentsViewAction extends BaseContratoAction {
return SUCCESS; return SUCCESS;
} }
public String exportarReporte() { public String exportarReporte() throws TransaccionException {
try { try {
logger.info("fechaInicial: {}", fechaInicial); logger.info("fechaInicial: {}", fechaInicial);
...@@ -95,32 +105,45 @@ public class ReporteOveragesYPaymentsViewAction extends BaseContratoAction { ...@@ -95,32 +105,45 @@ public class ReporteOveragesYPaymentsViewAction extends BaseContratoAction {
logger.info("validaEstatusCarga: {}", validaEstatusCarga); logger.info("validaEstatusCarga: {}", validaEstatusCarga);
UsuarioDTO usuario = (UsuarioDTO) getSession().get("usuario"); UsuarioDTO usuario = (UsuarioDTO) getSession().get("usuario");
fileInputStream = reporteOveragesYPaymentsBO.obtenerStreamReporte(fechaInicial, fechaFinal, tipoPago, claveReporte, idEstudio, usuario.getExpediente(), validaEstatusCarga); fileInputStream = reporteOveragesYPaymentsBO.obtenerStreamReporte(fechaInicial, fechaFinal, tipoPago,
claveReporte, idEstudio, usuario.getExpediente(), validaEstatusCarga);
} 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 (InstantiationException e) { } catch (InstantiationException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (InvocationTargetException e) { } catch (InvocationTargetException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (NoSuchMethodException e) { } catch (NoSuchMethodException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} catch (SecurityException e) { } catch (SecurityException 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);
} catch (XMLStreamException e) { } catch (XMLStreamException e) {
logger.error("Error. {}", e); logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
} }
return SUCCESS; return SUCCESS;
} }
...@@ -205,6 +228,4 @@ public class ReporteOveragesYPaymentsViewAction extends BaseContratoAction { ...@@ -205,6 +228,4 @@ public class ReporteOveragesYPaymentsViewAction extends BaseContratoAction {
this.validaEstatusCarga = validaEstatusCarga; this.validaEstatusCarga = validaEstatusCarga;
} }
} }
...@@ -29,7 +29,7 @@ public class ReportePagoAction extends BaseContratoAction { ...@@ -29,7 +29,7 @@ public class ReportePagoAction extends BaseContratoAction {
@Autowired @Autowired
private EstudioAddonBO estudioAddonBO; private EstudioAddonBO estudioAddonBO;
public String execute() { public String execute() throws TransaccionException {
try { try {
setEstudiosAddon(estudioAddonBO.getEstudios()); setEstudiosAddon(estudioAddonBO.getEstudios());
setEstudios(poblarGeneralesBO.obtenListaEstudios()); setEstudios(poblarGeneralesBO.obtenListaEstudios());
...@@ -37,10 +37,13 @@ public class ReportePagoAction extends BaseContratoAction { ...@@ -37,10 +37,13 @@ public class ReportePagoAction extends BaseContratoAction {
setFechaFin(poblarGeneralesBO.formateaFecha(new Date())); setFechaFin(poblarGeneralesBO.formateaFecha(new Date()));
} 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;
......
...@@ -7,12 +7,13 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -7,12 +7,13 @@ 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.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.PagoTransaccionBO; import com.mx.dla.dda.reporte.pagosTransaccion.bos.PagoTransaccionBO;
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;
import com.mx.dla.global.actions.BaseAction; import com.mx.dla.global.actions.BaseAction;
public class PagoTransaccionAction extends BaseAction{ public class PagoTransaccionAction extends BaseAction {
private static final long serialVersionUID = 127647227585669066L; private static final long serialVersionUID = 127647227585669066L;
private List<PagoTransaccion> pagos; private List<PagoTransaccion> pagos;
...@@ -24,21 +25,24 @@ public class PagoTransaccionAction extends BaseAction{ ...@@ -24,21 +25,24 @@ public class PagoTransaccionAction extends BaseAction{
private PagoTransaccionBO pagoTransaccionBO; private PagoTransaccionBO pagoTransaccionBO;
@Override @Override
public String execute() throws Exception { public String execute() throws TransaccionException {
try {
return super.execute(); return super.execute();
} catch (Exception e) {
logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
}
} }
public String buscaPagos() public String buscaPagos() {
{ logger.info("filtros [{}]", filtros);
logger.info("filtros [{}]",filtros);
pagos = pagoTransaccionBO.buscarPagos(filtros); pagos = pagoTransaccionBO.buscarPagos(filtros);
pendientesPorNotificar = pagoTransaccionBO.tieneTransaccionesSAPPendientes(filtros); pendientesPorNotificar = pagoTransaccionBO.tieneTransaccionesSAPPendientes(filtros);
return SUCCESS; return SUCCESS;
} }
public String notificarTransaccionSAP() public String notificarTransaccionSAP() {
{ logger.info("filtros [{}]", filtros);
logger.info("filtros [{}]",filtros);
pagos = pagoTransaccionBO.buscarPagos(filtros); pagos = pagoTransaccionBO.buscarPagos(filtros);
return SUCCESS; return SUCCESS;
} }
...@@ -54,21 +58,23 @@ public class PagoTransaccionAction extends BaseAction{ ...@@ -54,21 +58,23 @@ public class PagoTransaccionAction extends BaseAction{
public PagoTransaccionFiltros getFiltros() { public PagoTransaccionFiltros getFiltros() {
return filtros; return filtros;
} }
public void setFiltros(PagoTransaccionFiltros filtros) { public void setFiltros(PagoTransaccionFiltros filtros) {
this.filtros = filtros; this.filtros = filtros;
} }
public List<CatalogoDTO> getEstudios() public List<CatalogoDTO> getEstudios() {
{
return pagoTransaccionBO.buscarEstudios(); return pagoTransaccionBO.buscarEstudios();
} }
public List<TipoTitulo> getTipoTitulos() { public List<TipoTitulo> getTipoTitulos() {
return Arrays.asList(TipoTitulo.values()); return Arrays.asList(TipoTitulo.values());
} }
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;
} }
......
...@@ -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 {
try {
return super.execute(); return super.execute();
} catch (Exception e) {
logger.error("Error. {}", e);
throw new TransaccionException("Ocurrio un error", e);
}
} }
public String buscaPagos() public String buscaPagos()
......
...@@ -47,7 +47,7 @@ public class BaseAction extends ActionSupport implements SessionAware,ServletReq ...@@ -47,7 +47,7 @@ public class BaseAction extends ActionSupport implements SessionAware,ServletReq
} }
@Override @Override
public void destroy() throws Exception { public void destroy() {
} }
......
...@@ -65,4 +65,5 @@ ...@@ -65,4 +65,5 @@
<taglib-location>/WEB-INF/tld/dlaFunctions.tld</taglib-location> <taglib-location>/WEB-INF/tld/dlaFunctions.tld</taglib-location>
</taglib> </taglib>
</jsp-config> </jsp-config>
<error-page> <exception-type>java.lang.Throwable</exception-type> <location>/jsp/errorGeneral.jsp</location> </error-page>
</web-app> </web-app>
\ No newline at end of file
This diff is collapsed.
...@@ -302,7 +302,6 @@ function PerfilController() { ...@@ -302,7 +302,6 @@ function PerfilController() {
this.activarPerfilTitulosTransaccion = function(permiso) { this.activarPerfilTitulosTransaccion = function(permiso) {
console.log(permiso);
$('div[id="divBotonesTitulo"] button[id="bAceptar"]').prop("disabled", false); $('div[id="divBotonesTitulo"] button[id="bAceptar"]').prop("disabled", false);
if(permiso.idMenu == 94) if(permiso.idMenu == 94)
...@@ -423,7 +422,6 @@ PerfilController.prototype.ejecutarPerfil = function(pmn) { ...@@ -423,7 +422,6 @@ PerfilController.prototype.ejecutarPerfil = function(pmn) {
var varea = data.area; var varea = data.area;
var vusuario = data.usuario; var vusuario = data.usuario;
//console.log(vpermisos);
//INICIAN permisos para Carga Transacciones y Promociones... //INICIAN permisos para Carga Transacciones y Promociones...
$('#bValidar').hide(); $('#bValidar').hide();
...@@ -561,15 +559,10 @@ PerfilController.prototype.ejecutarPerfil = function(pmn) { ...@@ -561,15 +559,10 @@ PerfilController.prototype.ejecutarPerfil = function(pmn) {
this.activarPerfilListadoTransaccion(vpermisos[i]); this.activarPerfilListadoTransaccion(vpermisos[i]);
} }
break; break;
case 26: //fees transaccion case 26:
//for(var i = 0; i < vpermisos.length; i++)
//if(vpermisos[i].idMenuPadre == pmn)
//this.activarPerfilFeesTransaccion(vpermisos[i]);
break; break;
case 29: //titulos transaccion case 29: //titulos transaccion
console.log(vpermisos);
for(var i = 0; i < vpermisos.length; i++){ for(var i = 0; i < vpermisos.length; i++){
if(vpermisos[i].idMenuPadre == pmn){ if(vpermisos[i].idMenuPadre == pmn){
this.activarPerfilTitulosTransaccion(vpermisos[i]); this.activarPerfilTitulosTransaccion(vpermisos[i]);
......
...@@ -20,7 +20,7 @@ PerfilService.prototype.ajaxCall = function(action, data, success) { ...@@ -20,7 +20,7 @@ PerfilService.prototype.ajaxCall = function(action, data, success) {
//se puede definir un unsuccess apartir de la respuesta del action //se puede definir un unsuccess apartir de la respuesta del action
}, },
error : function ( jqXHR, textStatus, errorThrown ) { error : function ( jqXHR, textStatus, errorThrown ) {
showError("Error: " + textStatus + " ::: " + errorThrown + " ::: " + jqXhr); showError("Ocurri&oacute; un error.");
} }
}); });
} }
\ No newline at end of file
function FileUploader(uploaderName, uploadProcesorAction, dynamicFormDataFunction, onSuccessFunction, onErrorFunction) { function FileUploader(uploaderName, uploadProcesorAction, dynamicFormDataFunction, onSuccessFunction, onErrorFunction) {
console.log(uploaderName);
console.log(uploadProcesorAction);
//var me = this;
//me.mesCarga = null;
//me.idCarga = null;
//me.scope = null;
//console.log("datos a pasar como parametros en Carga Trnasacciones: id_carga:"+me.idCarga);
this.uploader = $("#"+uploaderName).uploadFile({ this.uploader = $("#"+uploaderName).uploadFile({
//url: contextPath + "/carga/transacciones/cargaArchivo.action",
url: contextPath + uploadProcesorAction, url: contextPath + uploadProcesorAction,
fileName:"file", fileName:"file",
dragDrop:true, dragDrop:true,
...@@ -20,14 +9,6 @@ function FileUploader(uploaderName, uploadProcesorAction, dynamicFormDataFunctio ...@@ -20,14 +9,6 @@ function FileUploader(uploaderName, uploadProcesorAction, dynamicFormDataFunctio
maxFileCount:1, maxFileCount:1,
maxFileSize: 15728640, maxFileSize: 15728640,
dynamicFormData: dynamicFormDataFunction, dynamicFormData: dynamicFormDataFunction,
/* dynamicFormData: function()
{
var data ={
"mesCarga" : me.mesCarga,
"idCarga":me.idCarga
};
return data;
},*/
dragDropStr: "<span><b>Arrastra aqui el archivo a subir</b></span>", dragDropStr: "<span><b>Arrastra aqui el archivo a subir</b></span>",
uploadStr:"Subir", uploadStr:"Subir",
abortStr: "Abortar", abortStr: "Abortar",
...@@ -44,26 +25,10 @@ function FileUploader(uploaderName, uploadProcesorAction, dynamicFormDataFunctio ...@@ -44,26 +25,10 @@ function FileUploader(uploaderName, uploadProcesorAction, dynamicFormDataFunctio
acceptFiles:" .xls, .xlsx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel ", acceptFiles:" .xls, .xlsx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel ",
onSubmit:function(files) onSubmit:function(files)
{ {
//$("#esperaDiv").html("<h4 class='text-primary'> Procesando </h4>");
}, },
onSuccess: onSuccessFunction, onSuccess: onSuccessFunction,
/* onSuccess:function(files,data,xhr,pd)
{
$("#esperaDiv").html("<h4 class='text-primary'> Terminado </h4>");
$('#modalCargarArchivo').modal('hide');
me.scope.RecuperaIdReporteError(data.cargaPrincipal);
me.scope.consultarCarga();
showMessage("Carga exitosa.");
},*/
onError: onErrorFunction onError: onErrorFunction
/* onError: function(files,status,errMsg,pd)
{
showError("Ocurrio un error al subir el documento");
$('#modalCargarArchivo').modal('hide');
}*/
}); });
this.getFileName = function (nameModal) { this.getFileName = function (nameModal) {
......
...@@ -2,7 +2,6 @@ var utileriasService = function($filter, $http, $q) { ...@@ -2,7 +2,6 @@ var utileriasService = function($filter, $http, $q) {
return { return {
actionCall: function(action, data){ actionCall: function(action, data){
var defered = $q.defer(); var defered = $q.defer();
//var data = {fecha : amfecha};
$http.post(contextPath + action, data) $http.post(contextPath + action, data)
.success(function(data) { .success(function(data) {
......
...@@ -10,7 +10,7 @@ function callActionAjax(actionRoute, jsonActionParameter, functionProcessor){ ...@@ -10,7 +10,7 @@ function callActionAjax(actionRoute, jsonActionParameter, functionProcessor){
}, },
error:function(jqXhr, textStatus, errorThrown){ error:function(jqXhr, textStatus, errorThrown){
alert("Error: " + textStatus + " ::: " + errorThrown + " ::: " + jqXhr); alert("Ocurri&oacute; un error.");
} }
}); });
...@@ -30,16 +30,10 @@ function validaNuloUndefinido(variable){ ...@@ -30,16 +30,10 @@ function validaNuloUndefinido(variable){
function validaParametrosEntrada(estudioEleccion, mesEleccion){ function validaParametrosEntrada(estudioEleccion, mesEleccion){
console.log("estudioEleccion: " + estudioEleccion + " mesEleccion: " + mesEleccion);
var estudioNoValida = validaNuloUndefinido(estudioEleccion); var estudioNoValida = validaNuloUndefinido(estudioEleccion);
var mesNoValida = validaNuloUndefinido(mesEleccion); var mesNoValida = validaNuloUndefinido(mesEleccion);
var fechaValida = validaFechaMesAnio(mesEleccion); var fechaValida = validaFechaMesAnio(mesEleccion);
console.log("estudioValida: " + estudioNoValida + " mesValida: " + mesNoValida);
if (estudioNoValida == 0 || mesNoValida == 0 || fechaValida == 0) if (estudioNoValida == 0 || mesNoValida == 0 || fechaValida == 0)
return 0; return 0;
return 1; return 1;
......
...@@ -5,7 +5,6 @@ $(document).ready( ...@@ -5,7 +5,6 @@ $(document).ready(
inicial(); inicial();
$('#inpPais').on('change', function() { $('#inpPais').on('change', function() {
console.log($(this).text());
if( $( "#inpPais option:selected" ).text() == 'ARGENTINA'){ if( $( "#inpPais option:selected" ).text() == 'ARGENTINA'){
$('#divArgentinaVat').show(); $('#divArgentinaVat').show();
$('#divArgentinaPrecio').show(); $('#divArgentinaPrecio').show();
...@@ -127,7 +126,7 @@ function validarAgregar(){ ...@@ -127,7 +126,7 @@ function validarAgregar(){
{ {
required: "Nombre del Pais es obligatorio.", required: "Nombre del Pais es obligatorio.",
maxlength: "Nombre no debe exceder 150 caracteres", maxlength: "Nombre no debe exceder 150 caracteres",
regex: "Nombre debe ser con caracteres alfanumericos" regex: "Nombre debe ser con caracteres alfanum\u00E9ricos"
} }
} }
}); });
...@@ -164,14 +163,11 @@ function llamaObtenAddOn(id) { ...@@ -164,14 +163,11 @@ function llamaObtenAddOn(id) {
} }
function procesaRespuestaObtenAddOn(jsonData) { function procesaRespuestaObtenAddOn(jsonData) {
//console.info(JSON.stringify(jsonData));
var addon = jsonData.addOn; var addon = jsonData.addOn;
var stdios = jsonData.estudios; var stdios = jsonData.estudios;
var stdio; var stdio;
var paisesList = jsonData.paises; var paisesList = jsonData.paises;
var paisTemp; var paisTemp;
console.log('its here');
console.log(jsonData.estudios);
//debugger //debugger
$('#inpEstudio') .val(addon.idEstudio); $('#inpEstudio') .val(addon.idEstudio);
$('#inpPais') .val(addon.idPaisAddOn); $('#inpPais') .val(addon.idPaisAddOn);
...@@ -204,7 +200,6 @@ function procesaRespuestaObtenAddOn(jsonData) { ...@@ -204,7 +200,6 @@ function procesaRespuestaObtenAddOn(jsonData) {
if(addon.idPaisAddOn == paisTemp.idPaisAddOn) { if(addon.idPaisAddOn == paisTemp.idPaisAddOn) {
$('#inpPais').append('<option value="'+ paisTemp.idPaisAddOn +'" selected> '+ paisTemp.nombre +' </option>'); $('#inpPais').append('<option value="'+ paisTemp.idPaisAddOn +'" selected> '+ paisTemp.nombre +' </option>');
console.log(paisTemp.nombre);
if( paisTemp.nombre == 'ARGENTINA'){ if( paisTemp.nombre == 'ARGENTINA'){
$('#divArgentinaVat').show(); $('#divArgentinaVat').show();
$('#divArgentinaPrecio').show(); $('#divArgentinaPrecio').show();
...@@ -309,32 +304,32 @@ function validaCampos(){ ...@@ -309,32 +304,32 @@ function validaCampos(){
var strTarMin = $("#inpTarifaMinima").val(); var strTarMin = $("#inpTarifaMinima").val();
if(!esPorcentaje(strRev)){ if(!esPorcentaje(strRev)){
showError("Revenue Share invalido, formato de porcentaje"); showError("Revenue Share inv\u00E1lido, formato de porcentaje");
showErrorModal("Revenue Share invalido, formato de porcentaje"); showErrorModal("Revenue Share inv\u00E1lido, formato de porcentaje");
return false; return false;
} }
if(!esNumero(strPre)){ if(!esNumero(strPre)){
showError("Precio invalido, formato numerico"); showError("Precio inv\u00E1lido, formato num\u00E9rico");
showErrorModal("Precio invalido, formato numerico"); showErrorModal("Precio inv\u00E1lido, formato num\u00E9rico");
return false; return false;
} }
if(!esPorcentaje(inpVat)){ if(!esPorcentaje(inpVat)){
showError("Vat invalido, formato de porcentaje"); showError("Vat inv\u00E1lido, formato de porcentaje");
showErrorModal("Vat invalido, formato de porcentaje"); showErrorModal("Vat inv\u00E1lido, formato de porcentaje");
return false return false
} }
if(!esNumero(strPreNeto)){ if(!esNumero(strPreNeto)){
showError("Precio Neto invalido, formato numerico"); showError("Precio Neto inv\u00E1lido, formato num\u00E9rico");
showErrorModal("Precio Neto invalido, formato numerico"); showErrorModal("Precio Neto inv\u00E1lido, formato num\u00E9rico");
return false; return false;
} }
if(!esNumero(strTarMin)){ if(!esNumero(strTarMin)){
showError("Tarifa minima invalido, formato numerico"); showError("Tarifa minima inv\u00E1lido, formato num\u00E9rico");
showErrorModal("Tarifa minima invalido, formato numerico"); showErrorModal("Tarifa minima inv\u00E1lido, formato num\u00E9rico");
return false; return false;
} }
...@@ -346,7 +341,6 @@ function procesaRespuestaActualiza(jsonData){ ...@@ -346,7 +341,6 @@ function procesaRespuestaActualiza(jsonData){
var seRepite = jsonData.addOnActualizado; var seRepite = jsonData.addOnActualizado;
$('#modalAgregaActualizaAddOn').modal('hide'); $('#modalAgregaActualizaAddOn').modal('hide');
console.log("Terminando proceso");
if(seRepite){ if(seRepite){
showMessage("Actualizado con exito"); showMessage("Actualizado con exito");
}else{ }else{
...@@ -366,7 +360,6 @@ function callActionAjax(actionRoute, jsonActionParameter, functionProcessor){ ...@@ -366,7 +360,6 @@ function callActionAjax(actionRoute, jsonActionParameter, functionProcessor){
functionProcessor(response); functionProcessor(response);
}, },
error:function(jqXhr, textStatus, errorThrown){ error:function(jqXhr, textStatus, errorThrown){
console.error("Error: " + textStatus + " ::: " + errorThrown + " ::: " + jqXhr);
showError("Problemas al enviar los datos."); showError("Problemas al enviar los datos.");
} }
}); });
......
...@@ -14,7 +14,6 @@ function inicializarBotones(){ ...@@ -14,7 +14,6 @@ function inicializarBotones(){
var menu = $("#pmn").val(); var menu = $("#pmn").val();
var menuRegreso = $("#pmnReturn").val(); var menuRegreso = $("#pmnReturn").val();
window.location.href = contextPath + '/catalogos/bolsas/altaApartado.action?pmn='+menu+'&pmnReturn='+menuRegreso+ '&idApartado=' + null; window.location.href = contextPath + '/catalogos/bolsas/altaApartado.action?pmn='+menu+'&pmnReturn='+menuRegreso+ '&idApartado=' + null;
//window.location.href = contextPath + '/catalogos/bolsas/altaApartado.action?pmn=44' + '&idApartado=' + null;
}); });
} }
...@@ -50,7 +49,7 @@ function crearTablaApartados(datos){ ...@@ -50,7 +49,7 @@ function crearTablaApartados(datos){
columns: [ columns: [
{ title: "Apartado" }, { title: "Apartado" },
{ title: "Tipo Amortizable" }, { title: "Tipo Amortizable" },
{ title: "Codigo SAP" } { title: "C&oacute;digo SAP" }
], ],
createdRow: function ( row, data, index ) { createdRow: function ( row, data, index ) {
//Se agrega el link pare ver el apartado //Se agrega el link pare ver el apartado
......
...@@ -53,7 +53,7 @@ function inicializarBotones(){ ...@@ -53,7 +53,7 @@ function inicializarBotones(){
} }
else else
{ {
$("#notiSap").find("div.modal-body").html("&#191;Esta seguro que desea Notificar a SAP el apartado: "+$("#des").val()+" &#63;"); $("#notiSap").find("div.modal-body").html("&#191;Est&aacute; seguro que desea Notificar a SAP el apartado: "+$("#des").val()+" &#63;");
$("#notiSap").modal("show"); $("#notiSap").modal("show");
} }
} }
......
...@@ -138,7 +138,6 @@ function llamaObtenCategorias(idCategoria) { ...@@ -138,7 +138,6 @@ function llamaObtenCategorias(idCategoria) {
} }
function procesaRespuestaObtenCategoria(jsonData) { function procesaRespuestaObtenCategoria(jsonData) {
//console.info(JSON.stringify(jsonData));
var est = jsonData.categoria; var est = jsonData.categoria;
//debugger //debugger
$('#inpCategoria').val(est.nombre); $('#inpCategoria').val(est.nombre);
...@@ -147,7 +146,6 @@ function procesaRespuestaObtenCategoria(jsonData) { ...@@ -147,7 +146,6 @@ function procesaRespuestaObtenCategoria(jsonData) {
function llamaActualizaCategoria() { function llamaActualizaCategoria() {
var nombre = $('#inpCategoria').val(); var nombre = $('#inpCategoria').val();
var jsonString = '{"idCategoria" : "'+ idCategoria + '", "nombreCategoria" : "' + nombre +'"}'; var jsonString = '{"idCategoria" : "'+ idCategoria + '", "nombreCategoria" : "' + nombre +'"}';
console.log(jsonString);
var stringJson = JSON.parse(jsonString); var stringJson = JSON.parse(jsonString);
callActionAjax( "/catalogos/categorias/llamaActualizaCategoria", stringJson, procesaRespuestaActualiza); callActionAjax( "/catalogos/categorias/llamaActualizaCategoria", stringJson, procesaRespuestaActualiza);
...@@ -160,7 +158,7 @@ function procesaRespuestaActualiza(jsonData) { ...@@ -160,7 +158,7 @@ function procesaRespuestaActualiza(jsonData) {
$('#modalAgregaActualiza').modal('hide'); $('#modalAgregaActualiza').modal('hide');
if(!seRepite) { if(!seRepite) {
showMessage("Actualizado con exito"); showMessage("Actualizado con \u00E9xito");
}else { }else {
showError("La sigla se repite en otro Estudio."); showError("La sigla se repite en otro Estudio.");
} }
...@@ -169,7 +167,6 @@ function procesaRespuestaActualiza(jsonData) { ...@@ -169,7 +167,6 @@ function procesaRespuestaActualiza(jsonData) {
} }
function callActionAjax(actionRoute, jsonActionParameter, functionProcessor){ function callActionAjax(actionRoute, jsonActionParameter, functionProcessor){
console.log(actionRoute);
$.ajax({ $.ajax({
url: contextPath + actionRoute, url: contextPath + actionRoute,
type: 'POST', type: 'POST',
...@@ -179,7 +176,6 @@ function callActionAjax(actionRoute, jsonActionParameter, functionProcessor){ ...@@ -179,7 +176,6 @@ function callActionAjax(actionRoute, jsonActionParameter, functionProcessor){
functionProcessor(response); functionProcessor(response);
}, },
error:function(jqXhr, textStatus, errorThrown){ error:function(jqXhr, textStatus, errorThrown){
console.error("Error: " + textStatus + " ::: " + errorThrown + " ::: " + jqXhr);
showError("Problemas al enviar los datos."); showError("Problemas al enviar los datos.");
} }
}); });
......
...@@ -72,7 +72,7 @@ function realizaConsulta(){ ...@@ -72,7 +72,7 @@ function realizaConsulta(){
$(nRow).attr("id",aData["idEstudio"]); $(nRow).attr("id",aData["idEstudio"]);
$('td:eq(0)', nRow).html(aData["idSap"]); $('td:eq(0)', nRow).html(aData["idSap"]);
$('td:eq(1)', nRow).html(link);//urlModificar.replace("#value", aData["idEstudio"] )); $('td:eq(1)', nRow).html(link);
$('td:eq(2)', nRow).html(aData["siglaDda"]); $('td:eq(2)', nRow).html(aData["siglaDda"]);
$('td:eq(3)', nRow).html(aData["descripcionGrupo"]); $('td:eq(3)', nRow).html(aData["descripcionGrupo"]);
$('td:eq(4)', nRow).html(aData["moneda"]); $('td:eq(4)', nRow).html(aData["moneda"]);
...@@ -103,7 +103,7 @@ function validarAgregar(){ ...@@ -103,7 +103,7 @@ function validarAgregar(){
{ {
required: "Nombre del Estudio es obligatorio.", required: "Nombre del Estudio es obligatorio.",
maxlength: "Nombre no debe exceder 50 caracteres", maxlength: "Nombre no debe exceder 50 caracteres",
regex: "Nombre debe ser con caracteres alfanumericos" regex: "Nombre debe ser con caracteres alfanum\u00E9ricos"
} }
} }
}); });
...@@ -140,7 +140,6 @@ function llamaObtenEstudio(idEstudio) { ...@@ -140,7 +140,6 @@ function llamaObtenEstudio(idEstudio) {
} }
function procesaRespuestaObtenEstudio(jsonData) { function procesaRespuestaObtenEstudio(jsonData) {
//console.info(JSON.stringify(jsonData));
var est = jsonData.estudio; var est = jsonData.estudio;
var grups = jsonData.grupos; var grups = jsonData.grupos;
var grup; var grup;
...@@ -153,9 +152,6 @@ function procesaRespuestaObtenEstudio(jsonData) { ...@@ -153,9 +152,6 @@ function procesaRespuestaObtenEstudio(jsonData) {
$('#inpIdSap') .val(est.idSap); $('#inpIdSap') .val(est.idSap);
$('#inpSiglaDDA') .val(est.siglaDda); $('#inpSiglaDDA') .val(est.siglaDda);
console.log(est.addOn);
console.log(est.nombreAddOn);
$('#inpNombreAddon').val(est.addOn); $('#inpNombreAddon').val(est.addOn);
var cb = document.querySelector('#checkAddOn'); var cb = document.querySelector('#checkAddOn');
...@@ -199,7 +195,6 @@ function llamaActualizaEstudio() { ...@@ -199,7 +195,6 @@ function llamaActualizaEstudio() {
var sigla = $('#inpSiglaDDA').val(); var sigla = $('#inpSiglaDDA').val();
var jsonString = '{"idEstudio" : "'+ idEstudio + '", "sigla" : "' + sigla + '", "campoGrupo" : "' + $('#campoGrupo').val() + '", "esAddOn" : "' + esAddOnVal+ '", "nombreAddOn" : "' + $('#inpNombreAddon').val() +'"}'; var jsonString = '{"idEstudio" : "'+ idEstudio + '", "sigla" : "' + sigla + '", "campoGrupo" : "' + $('#campoGrupo').val() + '", "esAddOn" : "' + esAddOnVal+ '", "nombreAddOn" : "' + $('#inpNombreAddon').val() +'"}';
var patron = /^[A-z\d_]{2,3}$/; var patron = /^[A-z\d_]{2,3}$/;
//console.log("evaluacion : " + patron.test("1114"));
if(patron.test(sigla)) { if(patron.test(sigla)) {
var stringJson = JSON.parse(jsonString); var stringJson = JSON.parse(jsonString);
callActionAjax( "/catalogos/estudios/llamaActualizaEstudio", stringJson, procesaRespuestaActualiza); callActionAjax( "/catalogos/estudios/llamaActualizaEstudio", stringJson, procesaRespuestaActualiza);
...@@ -217,7 +212,7 @@ function procesaRespuestaActualiza(jsonData) { ...@@ -217,7 +212,7 @@ function procesaRespuestaActualiza(jsonData) {
$('#modalAgregaActualiza').modal('hide'); $('#modalAgregaActualiza').modal('hide');
if(!seRepite) { if(!seRepite) {
showMessage("Actualizado con exito"); showMessage("Actualizado con \u00E9xito");
}else { }else {
showError("La sigla se repite en otro Estudio."); showError("La sigla se repite en otro Estudio.");
} }
...@@ -236,7 +231,6 @@ function callActionAjax(actionRoute, jsonActionParameter, functionProcessor){ ...@@ -236,7 +231,6 @@ function callActionAjax(actionRoute, jsonActionParameter, functionProcessor){
functionProcessor(response); functionProcessor(response);
}, },
error:function(jqXhr, textStatus, errorThrown){ error:function(jqXhr, textStatus, errorThrown){
console.error("Error: " + textStatus + " ::: " + errorThrown + " ::: " + jqXhr);
showError("Problemas al enviar los datos."); showError("Problemas al enviar los datos.");
} }
}); });
......
...@@ -95,7 +95,7 @@ function validarAgregar(){ ...@@ -95,7 +95,7 @@ function validarAgregar(){
{ {
required: "Nombre del Estudio es obligatorio.", required: "Nombre del Estudio es obligatorio.",
maxlength: "Nombre no debe exceder 50 caracteres", maxlength: "Nombre no debe exceder 50 caracteres",
regex: "Nombre debe ser con caracteres alfanumericos" regex: "Nombre debe ser con caracteres alfanum\u00E9ricos"
} }
} }
}); });
...@@ -132,7 +132,6 @@ function llamaObtenEstudio(idEstudio) { ...@@ -132,7 +132,6 @@ function llamaObtenEstudio(idEstudio) {
} }
function procesaRespuestaObtenEstudio(jsonData) { function procesaRespuestaObtenEstudio(jsonData) {
//console.info(JSON.stringify(jsonData));
var est = jsonData.estudio; var est = jsonData.estudio;
var reps = jsonData.reportes; var reps = jsonData.reportes;
var rep; var rep;
...@@ -146,11 +145,9 @@ function procesaRespuestaObtenEstudio(jsonData) { ...@@ -146,11 +145,9 @@ function procesaRespuestaObtenEstudio(jsonData) {
var option; var option;
for(var i = 0; i < reps.length; i++){ for(var i = 0; i < reps.length; i++){
rep = reps[i]; rep = reps[i];
console.log('**************' + rep.idReporte + '******************' + est.idReporte);
if(est.idReporte == rep.idReporte) { if(est.idReporte == rep.idReporte) {
$('#campoReporte').append('<option value="'+ rep.idReporte +'" selected> '+ rep.descFormula +' </option>'); $('#campoReporte').append('<option value="'+ rep.idReporte +'" selected> '+ rep.descFormula +' </option>');
}else { }else {
console.log(rep.idReporte);
$('#campoReporte').append('<option value="'+ rep.idReporte +'"> '+ rep.descFormula +' </option>'); $('#campoReporte').append('<option value="'+ rep.idReporte +'"> '+ rep.descFormula +' </option>');
} }
} }
...@@ -163,7 +160,6 @@ function llamaActualizaEstudio() { ...@@ -163,7 +160,6 @@ function llamaActualizaEstudio() {
var reduclientes = $('#inpReduClientes').val(); var reduclientes = $('#inpReduClientes').val();
var jsonString = '{"idEstudio" : "'+ idEstudio + '", "adon" : "' + adon + '", "nombreEstudio" : "' + nombre var jsonString = '{"idEstudio" : "'+ idEstudio + '", "adon" : "' + adon + '", "nombreEstudio" : "' + nombre
+ '", "redClientes" : "' + reduclientes+ '", "reporte" : "' + $('#campoReporte').val() +'"}'; + '", "redClientes" : "' + reduclientes+ '", "reporte" : "' + $('#campoReporte').val() +'"}';
console.log(jsonString);
var stringJson = JSON.parse(jsonString); var stringJson = JSON.parse(jsonString);
callActionAjax( "/catalogos/addons/llamaActualizaAddon", stringJson, procesaRespuestaActualiza); callActionAjax( "/catalogos/addons/llamaActualizaAddon", stringJson, procesaRespuestaActualiza);
...@@ -176,7 +172,7 @@ function procesaRespuestaActualiza(jsonData) { ...@@ -176,7 +172,7 @@ function procesaRespuestaActualiza(jsonData) {
$('#modalAgregaActualiza').modal('hide'); $('#modalAgregaActualiza').modal('hide');
if(!seRepite) { if(!seRepite) {
showMessage("Actualizado con exito"); showMessage("Actualizado con \u00E9xito");
}else { }else {
showError("La sigla se repite en otro Estudio."); showError("La sigla se repite en otro Estudio.");
} }
...@@ -185,7 +181,6 @@ function procesaRespuestaActualiza(jsonData) { ...@@ -185,7 +181,6 @@ function procesaRespuestaActualiza(jsonData) {
} }
function callActionAjax(actionRoute, jsonActionParameter, functionProcessor){ function callActionAjax(actionRoute, jsonActionParameter, functionProcessor){
console.log(actionRoute);
$.ajax({ $.ajax({
url: contextPath + actionRoute, url: contextPath + actionRoute,
type: 'POST', type: 'POST',
...@@ -195,7 +190,6 @@ function callActionAjax(actionRoute, jsonActionParameter, functionProcessor){ ...@@ -195,7 +190,6 @@ function callActionAjax(actionRoute, jsonActionParameter, functionProcessor){
functionProcessor(response); functionProcessor(response);
}, },
error:function(jqXhr, textStatus, errorThrown){ error:function(jqXhr, textStatus, errorThrown){
console.error("Error: " + textStatus + " ::: " + errorThrown + " ::: " + jqXhr);
showError("Problemas al enviar los datos."); showError("Problemas al enviar los datos.");
} }
}); });
......
...@@ -86,9 +86,7 @@ function validar(){ ...@@ -86,9 +86,7 @@ function validar(){
}, },
"pais.impuesto": "pais.impuesto":
{ {
//required: true,
number: true, number: true,
//maxlength: 3,
range:[1, 50] range:[1, 50]
}, },
"pais.idTerritorio": "pais.idTerritorio":
...@@ -114,8 +112,6 @@ function validar(){ ...@@ -114,8 +112,6 @@ function validar(){
}, },
"pais.impuesto": "pais.impuesto":
{ {
// required: "El impuesto es obligatorio.",
//maxlength: "Nombre no debe exceder 3 caracteres"
range: "Impuesto no debe ser mayor a 50" range: "Impuesto no debe ser mayor a 50"
}, },
"pais.idTerritorio": "pais.idTerritorio":
......
...@@ -37,7 +37,7 @@ var tipoCambioController = function($scope, $filter, tipoCambioService){ ...@@ -37,7 +37,7 @@ var tipoCambioController = function($scope, $filter, tipoCambioService){
var texto = newValue; var texto = newValue;
if(texto !== null) { if(texto !== null) {
if(!patron.test(texto)) if(!patron.test(texto))
showWarn("Esta colocando caracteres en un campo n\u00FAmerico."); showWarn("Esta colocando caracteres en un campo num\u00E9rico.");
} }
} }
......
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