Fixes Bug #0009192
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@71387 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
65def499d3
commit
142477475c
|
@ -6,6 +6,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
|
||||
import com.rjconsultores.ventaboletos.constantes.Constantes;
|
||||
import com.rjconsultores.ventaboletos.constantes.TipoSeguro;
|
||||
import com.rjconsultores.ventaboletos.dao.sqlbuilder.SQLBuilder;
|
||||
import com.rjconsultores.ventaboletos.dao.util.DBUtil;
|
||||
import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties;import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||
|
@ -576,9 +577,13 @@ public class SQLBuilderOracle implements SQLBuilder {
|
|||
|
||||
@Override
|
||||
public String getSQLAtualizarSeguroPorKm(final Integer rutaId, final Integer usuarioId,
|
||||
final Integer orgaoConcedenteId) {
|
||||
final Integer orgaoConcedenteId, TipoSeguro tipoSeguro) {
|
||||
StringBuilder sb = new StringBuilder("");
|
||||
sb.append("update tarifa_oficial set IMPORTESEGURO = ");
|
||||
if (tipoSeguro.equals(TipoSeguro.SEGURO)) {
|
||||
sb.append("update tarifa_oficial set IMPORTESEGURO = ");
|
||||
} else {
|
||||
sb.append("update tarifa_oficial set IMPORTETPP = ");
|
||||
}
|
||||
sb.append("( ");
|
||||
sb.append("select ");
|
||||
sb.append(" sk.VALORTAXA ");
|
||||
|
@ -589,6 +594,7 @@ public class SQLBuilderOracle implements SQLBuilder {
|
|||
sb.append(" sk.KMATE >= t.CANTKMREAL and sk.activo = 1 ");
|
||||
sb.append(" and tao.ORGAOCONCEDENTE_ID = sk.ORGAOCONCEDENTE_ID ");
|
||||
sb.append("where ");
|
||||
sb.append(" sk.tipo_seguro = '").append(tipoSeguro).append("' and ");
|
||||
sb.append(" sk.kmate= ");
|
||||
sb.append(" (select min(sk1.KMATE) ");
|
||||
sb.append(" from ");
|
||||
|
@ -617,6 +623,23 @@ public class SQLBuilderOracle implements SQLBuilder {
|
|||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSQLAtualizarPrecioPorTPP(final Integer rutaId, final Integer usuarioId,
|
||||
final Integer orgaoConcedenteId, TipoSeguro tipoSeguro) {
|
||||
StringBuilder sb = new StringBuilder("");
|
||||
sb.append("update tarifa_oficial set PRECIO = PRECIO + IMPORTETPP ");
|
||||
sb.append(" where ");
|
||||
sb.append(" tarifa_oficial.activo = 1 ");
|
||||
if (rutaId != null) {
|
||||
sb.append(" and tarifa_oficial.ruta_id = ").append(rutaId);
|
||||
}
|
||||
if (orgaoConcedenteId != null) {
|
||||
sb.append(" and tarifa_oficial.orgaoconcedente_id = ").append(orgaoConcedenteId);
|
||||
}
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSQLAtualizarSeguroPorTarifa(final Integer rutaId, final Integer usuarioId,
|
||||
|
@ -671,6 +694,7 @@ public class SQLBuilderOracle implements SQLBuilder {
|
|||
sb.append(" tao.PRECIOORIGINAL AS \"taopreciooriginal\", ");
|
||||
sb.append(" tao.IMPORTETAXAEMBARQUE AS \"taoimportetaxaembarque\", ");
|
||||
sb.append(" tao.IMPORTESEGURO AS \"taoimporteseguro\", ");
|
||||
sb.append(" tao.IMPORTETPP AS \"taoimportetpp\", ");
|
||||
sb.append(" tao.IMPORTEOUTROS AS \"taoimporteoutros\", ");
|
||||
sb.append(" ta.TARIFA_ID AS \"tarifaId\" ");
|
||||
|
||||
|
@ -700,7 +724,7 @@ public class SQLBuilderOracle implements SQLBuilder {
|
|||
|
||||
@Override
|
||||
public String getSQLAtualizarTarifaPorTarifaOfical(Map<String,Object> dados, Integer usuarioId, Boolean calculaPegagio,
|
||||
Boolean calculaTarifa, Boolean calculaTaxaEmbarque, Boolean calculaSeguro){
|
||||
Boolean calculaTarifa, Boolean calculaTaxaEmbarque, Boolean calculaSeguro, Boolean calculaTPP){
|
||||
|
||||
StringBuilder sb = new StringBuilder("");
|
||||
sb.append("UPDATE TARIFA SET ");
|
||||
|
@ -717,6 +741,9 @@ public class SQLBuilderOracle implements SQLBuilder {
|
|||
if(calculaSeguro){
|
||||
sb.append("IMPORTESEGURO=").append(dados.get("taoimporteseguro")).append(",");
|
||||
}
|
||||
if(calculaTPP){
|
||||
sb.append("IMPORTETPP=").append(dados.get("taoimportetpp")).append(",");
|
||||
}
|
||||
sb.append("IMPORTEOUTROS=").append(dados.get("taoimporteoutros")).append(",");
|
||||
sb.append("FECMODIF= current_timestamp, USUARIO_ID=").append(usuarioId);
|
||||
sb.append(" WHERE TARIFA_ID = ").append(dados.get("tarifaId"));
|
||||
|
@ -734,7 +761,7 @@ public class SQLBuilderOracle implements SQLBuilder {
|
|||
sb.append(" MARCA_ID, CLASESERVICIO_ID, PRECIOORIGINAL, MONEDA_ID, ");
|
||||
sb.append(" VIGENCIATARIFA_ID, STATUSTARIFA, ACTIVO, FECMODIF, ");
|
||||
sb.append(" USUARIO_ID, IMPORTETAXAEMBARQUE, IMPORTEPEDAGIO, IMPORTEOUTROS, ");
|
||||
sb.append(" IMPORTESEGURO, ORGAOCONCEDENTE_ID, RUTA_ID, ORIGEN_ID, DESTINO_ID ) ");
|
||||
sb.append(" IMPORTESEGURO, IMPORTETPP, ORGAOCONCEDENTE_ID, RUTA_ID, ORIGEN_ID, DESTINO_ID ) ");
|
||||
sb.append(" select ");
|
||||
sb.append(" TARIFA_SEQ.nextval, ");
|
||||
sb.append(" tao.PRECIO , ");
|
||||
|
@ -753,6 +780,7 @@ public class SQLBuilderOracle implements SQLBuilder {
|
|||
sb.append(" tao.IMPORTEPEDAGIO , ");
|
||||
sb.append(" tao.IMPORTEOUTROS , ");
|
||||
sb.append(" tao.IMPORTESEGURO , ");
|
||||
sb.append(" tao.IMPORTETPP , ");
|
||||
sb.append(" tao.ORGAOCONCEDENTE_ID , ");
|
||||
sb.append(" tao.RUTA_ID , ");
|
||||
sb.append(" tao.ORIGEN_ID , ");
|
||||
|
|
Loading…
Reference in New Issue