fixes bug#14828
qua:wallysson dev:alberto git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@95805 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
2ece2a0faf
commit
d3250cdbe0
|
@ -5,6 +5,7 @@ import java.util.List;
|
|||
|
||||
import javax.mail.SendFailedException;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
@ -32,6 +33,8 @@ public class ContingenciaServiceImpl implements ContingenciaService {
|
|||
|
||||
private static final String EMAIL_COPIA_OCULTA = "suportesco@rjconsultores.com.br";
|
||||
|
||||
private static Logger log = Logger.getLogger(ContingenciaServiceImpl.class);
|
||||
|
||||
@Autowired
|
||||
private LogHistoricoContingenciaDAO histContingenciaDAO;
|
||||
|
||||
|
@ -46,7 +49,7 @@ public class ContingenciaServiceImpl implements ContingenciaService {
|
|||
}
|
||||
|
||||
@Transactional
|
||||
public LogHistoricoContingencia salvarHistoricoContingencia(LogHistoricoContingencia historicoCont) throws BusinessException, SendFailedException {
|
||||
public LogHistoricoContingencia salvarHistoricoContingencia(LogHistoricoContingencia historicoCont) throws BusinessException{
|
||||
historicoCont.setUsuario(UsuarioLogado.getUsuarioLogado());
|
||||
historicoCont.setDataHora(Calendar.getInstance().getTime());
|
||||
|
||||
|
@ -69,9 +72,12 @@ public class ContingenciaServiceImpl implements ContingenciaService {
|
|||
enviaEmail(historicoCont);
|
||||
}
|
||||
} catch (SendFailedException e) {
|
||||
historicoCont.setStatus(EStatusContingencia.NORMAL.getId().toString());
|
||||
definirStatusContingencia(historicoCont);
|
||||
throw e;
|
||||
log.error(String.format("Erro no envio de e-mail de contingência da empresa %s para o estado %s.", historicoCont.getEmpresa().getEmpresaId(),historicoCont.getEstado()),e);
|
||||
|
||||
String motivo = historicoCont.getMotivo();
|
||||
motivo = motivo.concat("**Problema no envio de E-mail de notificação. Favor checar.");
|
||||
|
||||
historicoCont.setMotivo(motivo);
|
||||
}
|
||||
|
||||
return histContingenciaDAO.suscribir(historicoCont);
|
||||
|
|
Loading…
Reference in New Issue