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);
|
DAO.getInstance().setDBConnection(myConn);
|
||||||
String strEmpresas = DAO.getInstance().obterConstante("EMPRESAS_INTEGRACAO");
|
String strEmpresas = DAO.getInstance().obterConstante("EMPRESAS_INTEGRACAO");
|
||||||
|
if (checkTodosPuntosVenta.isChecked()){
|
||||||
|
for (Integer puntoventaId : DAO.getInstance().obterListaPuntoVenta()){
|
||||||
for (String empresaId : strEmpresas.split(",")){
|
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()) {
|
if (!checkSimulaIntegracion.isChecked()) {
|
||||||
myConn.commit();
|
myConn.commit();
|
||||||
} else {
|
} else {
|
||||||
|
@ -836,8 +837,8 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
TotvsService.setSb(null);
|
TotvsService.setSb(null);
|
||||||
myConn.rollback();
|
myConn.rollback();
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
}catch (Exception e){
|
||||||
log.error("Erro ao integrar",e);
|
log.error("Erro ao integrar Empresa " + empresaId + " - Ponto de venda " + puntoventaId,e);
|
||||||
|
|
||||||
if (myConn != null) {
|
if (myConn != null) {
|
||||||
try {
|
try {
|
||||||
|
@ -846,6 +847,53 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
log.error("Erro rollback", 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} 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) {
|
if (e instanceof WrongValueException) {
|
||||||
throw (WrongValueException) e;
|
throw (WrongValueException) e;
|
||||||
|
@ -858,14 +906,6 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
Labels.getLabel("editarPuntoVentaController.window.title"),
|
Labels.getLabel("editarPuntoVentaController.window.title"),
|
||||||
Messagebox.OK, Messagebox.ERROR);
|
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