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>
|
||||
<groupId>br.com.rjconsultores</groupId>
|
||||
<artifactId>ventaboletosadm</artifactId>
|
||||
<version>1.8.1</version>
|
||||
<version>1.8.2</version>
|
||||
<packaging>war</packaging>
|
||||
|
||||
<properties>
|
||||
<modelWeb.version>1.6.1</modelWeb.version>
|
||||
<modelWeb.version>1.6.2</modelWeb.version>
|
||||
<flyway.version>1.5.0</flyway.version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<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.RutaService;
|
||||
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.ConexionRutaConfVO;
|
||||
import com.rjconsultores.ventaboletos.vo.parada.ConexionRutaCtrlVO;
|
||||
|
@ -425,17 +426,9 @@ public class GerarConexionPorRutaController extends MyGenericForwardComposer {
|
|||
adicionaLocalidadesExcluidas();
|
||||
|
||||
removeLocalidadesExcluidas();
|
||||
//Atualizar o indPricing alterado pela tabela
|
||||
localidades: for(ConexionCtrl conCtrl : conexoesCtrl) {
|
||||
for(ParadaVOConexionRuta loc : localidadesGeradas ) {
|
||||
if(isMesmaConexao(loc, conCtrl)) {
|
||||
conCtrl.setIndPricing(loc.getConexionCtrl().getIndPricing());
|
||||
continue localidades;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
conexionCtrlService.suscribirTodos(conexoesCtrl);
|
||||
//Atualizar o indPricing alterado pela tabela
|
||||
atualizarIndPricing();
|
||||
|
||||
List<ConexionDescuento> conexionDescontos = new ArrayList<>();
|
||||
|
||||
|
@ -469,29 +462,39 @@ public class GerarConexionPorRutaController extends MyGenericForwardComposer {
|
|||
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())) {
|
||||
return true;
|
||||
}
|
||||
localidades: for(ConexionCtrl conCtrl : conexoesCtrl) {
|
||||
|
||||
List<Conexion> conec = conexionService.buscarPorConexionCtrl(conCtrl.getConexionctrlId());
|
||||
//Para evitar que registros antigos deem problema no banco de dados ao salvar
|
||||
if(conexoesVerificadas.contains(conCtrl.getConexionctrlId())) {
|
||||
continue localidades;
|
||||
} else {
|
||||
conexoesVerificadas.add(conCtrl.getConexionctrlId());
|
||||
}
|
||||
|
||||
for(Conexion con : conec) {
|
||||
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) {
|
||||
return loc.getRutaId() == con.getRutaId() &&
|
||||
loc.getGrupo() == con.getNumgrupo() &&
|
||||
loc.getSecuencia() == con.getNumsecuencia() &&
|
||||
loc.getParadaOrigemTrecho().getParadaId() == con.getOrigenId() &&
|
||||
loc.getParadaDestinoTrecho().getParadaId() == con.getDestinoId();
|
||||
private boolean isMesmaConexao(ParadaVOConexionRuta loc, ConexionCtrl conCtrl) {
|
||||
return conCtrl.getConexionctrlId() != null && loc.getConexionCtrl().getConexionctrlId() != null && conCtrl.getConexionctrlId().equals(loc.getConexionCtrl().getConexionctrlId());
|
||||
}
|
||||
|
||||
private void desativarDescontosAnteriores(List<ConexionDescuento> conexionDescontos) {
|
||||
|
|
Loading…
Reference in New Issue