bug #6255
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@43743 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
9c9df7e9b9
commit
5089a1e704
|
@ -825,10 +825,11 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|||
|
||||
DAO.getInstance().setDBConnection(myConn);
|
||||
String strEmpresas = DAO.getInstance().obterConstante("EMPRESAS_INTEGRACAO");
|
||||
if (checkTodosPuntosVenta.isChecked()){
|
||||
for (Integer puntoventaId : DAO.getInstance().obterListaPuntoVenta()){
|
||||
for (String empresaId : strEmpresas.split(",")){
|
||||
TotvsService.cadastrarTituloAReceber(checkTodosPuntosVenta.isChecked() ? null : puntoVenta.getPuntoventaId(), dateInicio, dateFim, myConn, Integer.parseInt(empresaId));
|
||||
}
|
||||
|
||||
try{
|
||||
TotvsService.cadastrarTituloAReceber(puntoventaId, dateInicio, dateFim, myConn, Integer.parseInt(empresaId));
|
||||
if (!checkSimulaIntegracion.isChecked()) {
|
||||
myConn.commit();
|
||||
} else {
|
||||
|
@ -837,7 +838,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|||
myConn.rollback();
|
||||
}
|
||||
}catch (Exception e){
|
||||
log.error("Erro ao integrar",e);
|
||||
log.error("Erro ao integrar Empresa " + empresaId + " - Ponto de venda " + puntoventaId,e);
|
||||
|
||||
if (myConn != null) {
|
||||
try {
|
||||
|
@ -846,6 +847,53 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|||
log.error("Erro rollback", e1);
|
||||
}
|
||||
}
|
||||
}finally {
|
||||
if (myConn != null) {
|
||||
try {
|
||||
myConn.close();
|
||||
} catch (SQLException e) {
|
||||
log.error("Erro ao fechar a conexão", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (String empresaId : strEmpresas.split(",")){
|
||||
try{
|
||||
TotvsService.cadastrarTituloAReceber(puntoVenta.getPuntoventaId(), dateInicio, dateFim, myConn, Integer.parseInt(empresaId));
|
||||
if (!checkSimulaIntegracion.isChecked()) {
|
||||
myConn.commit();
|
||||
} else {
|
||||
logResult.setText(sb != null ? sb.toString() : "");
|
||||
TotvsService.setSb(null);
|
||||
myConn.rollback();
|
||||
}
|
||||
}catch (Exception e){
|
||||
log.error("Erro ao integrar Empresa " + empresaId + " - Ponto de venda " + puntoVenta.getPuntoventaId(),e);
|
||||
|
||||
if (myConn != null) {
|
||||
try {
|
||||
myConn.rollback();
|
||||
} catch (SQLException e1) {
|
||||
log.error("Erro rollback", e1);
|
||||
}
|
||||
}
|
||||
}finally {
|
||||
if (myConn != null) {
|
||||
try {
|
||||
myConn.close();
|
||||
} catch (SQLException e) {
|
||||
log.error("Erro ao fechar a conexão", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("Erro ao integrar",e);
|
||||
|
||||
if (e instanceof WrongValueException) {
|
||||
throw (WrongValueException) e;
|
||||
|
@ -858,14 +906,6 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|||
Labels.getLabel("editarPuntoVentaController.window.title"),
|
||||
Messagebox.OK, Messagebox.ERROR);
|
||||
|
||||
} finally {
|
||||
if (myConn != null) {
|
||||
try {
|
||||
myConn.close();
|
||||
} catch (SQLException e) {
|
||||
log.error("Erro ao fechar a conexão", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue