Foi criado um metodo para selecionar a moeda da nova tarifa de acordo com a descricao da moeda colocada no arquivo.
fixes bug#11328 dev:thiago qua:jose git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@82556 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
6da96717b7
commit
6b1e3edb9e
|
@ -16,6 +16,7 @@ import java.text.SimpleDateFormat;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.apache.poi.ss.usermodel.Cell;
|
import org.apache.poi.ss.usermodel.Cell;
|
||||||
import org.apache.poi.ss.usermodel.Row;
|
import org.apache.poi.ss.usermodel.Row;
|
||||||
|
@ -45,6 +46,7 @@ import com.rjconsultores.ventaboletos.entidad.Tarifa;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Tramo;
|
import com.rjconsultores.ventaboletos.entidad.Tramo;
|
||||||
import com.rjconsultores.ventaboletos.entidad.VigenciaTarifa;
|
import com.rjconsultores.ventaboletos.entidad.VigenciaTarifa;
|
||||||
import com.rjconsultores.ventaboletos.service.MercadoCompetidoService;
|
import com.rjconsultores.ventaboletos.service.MercadoCompetidoService;
|
||||||
|
import com.rjconsultores.ventaboletos.service.MonedaService;
|
||||||
import com.rjconsultores.ventaboletos.service.TarifaService;
|
import com.rjconsultores.ventaboletos.service.TarifaService;
|
||||||
import com.rjconsultores.ventaboletos.service.VigenciaTarifaService;
|
import com.rjconsultores.ventaboletos.service.VigenciaTarifaService;
|
||||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
|
@ -67,14 +69,16 @@ public class ModificacionMasivaTarifasUploadController extends MyGenericForwardC
|
||||||
private final Integer CELL_NOVO_TX_EMBARQUE = 14;
|
private final Integer CELL_NOVO_TX_EMBARQUE = 14;
|
||||||
private final Integer CELL_NOVO_SEGURO = 16;
|
private final Integer CELL_NOVO_SEGURO = 16;
|
||||||
private final Integer CELL_NOVO_TPP = 18;
|
private final Integer CELL_NOVO_TPP = 18;
|
||||||
|
private final Integer CELL_NOVO_MONEDA = 22;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private TarifaService tarifaService;
|
private TarifaService tarifaService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private VigenciaTarifaService vigenciaTarifaService;
|
private VigenciaTarifaService vigenciaTarifaService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private MercadoCompetidoService mercadoCompetidoService;
|
private MercadoCompetidoService mercadoCompetidoService;
|
||||||
|
@Autowired
|
||||||
|
private MonedaService monedaService;
|
||||||
private List<VigenciaTarifa> lsVigenciaTarifa;
|
private List<VigenciaTarifa> lsVigenciaTarifa;
|
||||||
private VigenciaTarifa vigenciaTarifaArquivoExcel;
|
private VigenciaTarifa vigenciaTarifaArquivoExcel;
|
||||||
private Media mExcel;
|
private Media mExcel;
|
||||||
|
@ -429,9 +433,9 @@ public class ModificacionMasivaTarifasUploadController extends MyGenericForwardC
|
||||||
|
|
||||||
tarifaNueva.setClaseServicio(tarifa.getClaseServicio());
|
tarifaNueva.setClaseServicio(tarifa.getClaseServicio());
|
||||||
tarifaNueva.setMarca(tarifa.getMarca());
|
tarifaNueva.setMarca(tarifa.getMarca());
|
||||||
tarifaNueva.setMoneda(tarifa.getMoneda());
|
tarifaNueva.setMoneda(verificaMonedaASerInserida((row.getCell(CELL_NOVO_MONEDA) != null? row.getCell(CELL_NOVO_MONEDA).getStringCellValue():null), tarifa.getMoneda()));
|
||||||
tarifaNueva.setPreciooriginal(tarifa.getPreciooriginal());
|
tarifaNueva.setPreciooriginal(tarifa.getPreciooriginal());
|
||||||
|
|
||||||
if (componentePreco.equals(EnumTarifaPedagio.TARIFA.getDescricao()) ||
|
if (componentePreco.equals(EnumTarifaPedagio.TARIFA.getDescricao()) ||
|
||||||
(componentePreco.equals(EnumTarifaPedagio.TODOS.getDescricao()) && (row.getCell(CELL_NOVO_PRECIO) != null))) {
|
(componentePreco.equals(EnumTarifaPedagio.TODOS.getDescricao()) && (row.getCell(CELL_NOVO_PRECIO) != null))) {
|
||||||
cellNovoPrecio = row.getCell(CELL_NOVO_PRECIO);
|
cellNovoPrecio = row.getCell(CELL_NOVO_PRECIO);
|
||||||
|
@ -625,4 +629,18 @@ public class ModificacionMasivaTarifasUploadController extends MyGenericForwardC
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Moneda verificaMonedaASerInserida(String descMoedaNova, Moneda atual ) {
|
||||||
|
Moneda nova = atual;
|
||||||
|
if (!StringUtils.isBlank(descMoedaNova)) {
|
||||||
|
if(!descMoedaNova.equals(atual.getDescmoneda())) {
|
||||||
|
List<Moneda> monedas = monedaService.buscar(descMoedaNova);
|
||||||
|
if(monedas !=null && !monedas.isEmpty()){
|
||||||
|
nova = monedas.get(0);
|
||||||
|
}
|
||||||
|
return nova;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nova;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue