bug#al-2855
Aguia Branca - GLPI - 64914 [PROJETO] - ADM - ERRO AO SELECIONAR FLAG PRICING NO CADASTRO DE CONEXOES ENTRE LINHAS dev: qua: Melhoria de desempenho ao salvar as conexoes.master
parent
fe08dfc0f3
commit
7cd693c584
4
pom.xml
4
pom.xml
|
@ -4,11 +4,11 @@
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>br.com.rjconsultores</groupId>
|
<groupId>br.com.rjconsultores</groupId>
|
||||||
<artifactId>ventaboletosadm</artifactId>
|
<artifactId>ventaboletosadm</artifactId>
|
||||||
<version>1.8.1</version>
|
<version>1.8.2</version>
|
||||||
<packaging>war</packaging>
|
<packaging>war</packaging>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<modelWeb.version>1.6.1</modelWeb.version>
|
<modelWeb.version>1.6.2</modelWeb.version>
|
||||||
<flyway.version>1.5.0</flyway.version>
|
<flyway.version>1.5.0</flyway.version>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||||
|
|
|
@ -54,6 +54,7 @@ import com.rjconsultores.ventaboletos.service.ConexionService;
|
||||||
import com.rjconsultores.ventaboletos.service.RutaEmpresaService;
|
import com.rjconsultores.ventaboletos.service.RutaEmpresaService;
|
||||||
import com.rjconsultores.ventaboletos.service.RutaService;
|
import com.rjconsultores.ventaboletos.service.RutaService;
|
||||||
import com.rjconsultores.ventaboletos.service.TipoPuntoVentaService;
|
import com.rjconsultores.ventaboletos.service.TipoPuntoVentaService;
|
||||||
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
import com.rjconsultores.ventaboletos.vo.parada.ConexionCtrlVO;
|
import com.rjconsultores.ventaboletos.vo.parada.ConexionCtrlVO;
|
||||||
import com.rjconsultores.ventaboletos.vo.parada.ConexionRutaConfVO;
|
import com.rjconsultores.ventaboletos.vo.parada.ConexionRutaConfVO;
|
||||||
import com.rjconsultores.ventaboletos.vo.parada.ConexionRutaCtrlVO;
|
import com.rjconsultores.ventaboletos.vo.parada.ConexionRutaCtrlVO;
|
||||||
|
@ -425,17 +426,9 @@ public class GerarConexionPorRutaController extends MyGenericForwardComposer {
|
||||||
adicionaLocalidadesExcluidas();
|
adicionaLocalidadesExcluidas();
|
||||||
|
|
||||||
removeLocalidadesExcluidas();
|
removeLocalidadesExcluidas();
|
||||||
|
|
||||||
//Atualizar o indPricing alterado pela tabela
|
//Atualizar o indPricing alterado pela tabela
|
||||||
localidades: for(ConexionCtrl conCtrl : conexoesCtrl) {
|
atualizarIndPricing();
|
||||||
for(ParadaVOConexionRuta loc : localidadesGeradas ) {
|
|
||||||
if(isMesmaConexao(loc, conCtrl)) {
|
|
||||||
conCtrl.setIndPricing(loc.getConexionCtrl().getIndPricing());
|
|
||||||
continue localidades;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
conexionCtrlService.suscribirTodos(conexoesCtrl);
|
|
||||||
|
|
||||||
List<ConexionDescuento> conexionDescontos = new ArrayList<>();
|
List<ConexionDescuento> conexionDescontos = new ArrayList<>();
|
||||||
|
|
||||||
|
@ -468,30 +461,40 @@ public class GerarConexionPorRutaController extends MyGenericForwardComposer {
|
||||||
|
|
||||||
closeWindow();
|
closeWindow();
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isMesmaConexao(ParadaVOConexionRuta loc, ConexionCtrl conCtrl) {
|
private void atualizarIndPricing() {
|
||||||
|
List<Long> conexoesVerificadas = new ArrayList<>();
|
||||||
|
|
||||||
if(conCtrl.getConexionctrlId() != null && conCtrl.getConexionctrlId().equals(loc.getConexionCtrl().getConexionctrlId())) {
|
localidades: for(ConexionCtrl conCtrl : conexoesCtrl) {
|
||||||
return true;
|
|
||||||
}
|
//Para evitar que registros antigos deem problema no banco de dados ao salvar
|
||||||
|
if(conexoesVerificadas.contains(conCtrl.getConexionctrlId())) {
|
||||||
List<Conexion> conec = conexionService.buscarPorConexionCtrl(conCtrl.getConexionctrlId());
|
continue localidades;
|
||||||
|
} else {
|
||||||
for(Conexion con : conec) {
|
conexoesVerificadas.add(conCtrl.getConexionctrlId());
|
||||||
if (isMesmaConexao(loc, con)){
|
}
|
||||||
return true;
|
|
||||||
|
for(ParadaVOConexionRuta loc : localidadesGeradas ) {
|
||||||
|
|
||||||
|
if(isMesmaConexao(loc, conCtrl)) {
|
||||||
|
//So atualizar quando os valores forem alterados
|
||||||
|
if(!conCtrl.getIndPricing().equals(loc.getConexionCtrl().getIndPricing())) {
|
||||||
|
conCtrl.setIndPricing(loc.getConexionCtrl().getIndPricing());
|
||||||
|
conCtrl.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
conCtrl.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
conCtrl.setActivo(true);
|
||||||
|
|
||||||
|
conexionCtrlService.actualizacion(conCtrl);
|
||||||
|
}
|
||||||
|
|
||||||
|
continue localidades;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isMesmaConexao(ParadaVOConexionRuta loc, Conexion con) {
|
private boolean isMesmaConexao(ParadaVOConexionRuta loc, ConexionCtrl conCtrl) {
|
||||||
return loc.getRutaId() == con.getRutaId() &&
|
return conCtrl.getConexionctrlId() != null && loc.getConexionCtrl().getConexionctrlId() != null && conCtrl.getConexionctrlId().equals(loc.getConexionCtrl().getConexionctrlId());
|
||||||
loc.getGrupo() == con.getNumgrupo() &&
|
|
||||||
loc.getSecuencia() == con.getNumsecuencia() &&
|
|
||||||
loc.getParadaOrigemTrecho().getParadaId() == con.getOrigenId() &&
|
|
||||||
loc.getParadaDestinoTrecho().getParadaId() == con.getDestinoId();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void desativarDescontosAnteriores(List<ConexionDescuento> conexionDescontos) {
|
private void desativarDescontosAnteriores(List<ConexionDescuento> conexionDescontos) {
|
||||||
|
|
Loading…
Reference in New Issue