fixes bug#8405
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@63522 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
2c3164c6de
commit
93856ed471
|
@ -269,7 +269,7 @@ public class BusquedaDatosTicketHibernateDAO extends GenericHibernateDAO<Pacote,
|
||||||
|
|
||||||
private void carregarDadosPassageiros(List<PacoteVO> pacotes) {
|
private void carregarDadosPassageiros(List<PacoteVO> pacotes) {
|
||||||
StringBuilder sQuery = new StringBuilder();
|
StringBuilder sQuery = new StringBuilder();
|
||||||
sQuery.append("SELECT DISTINCT VP.VENDAPACOTE_ID, TVP.TARIFAVENDAPACOTE_ID, TVP.NOMEPASSAGEIRO, CONCAT(CONCAT(TVP.TIPODOC,' - '), TVP.DOCUMENTO) AS DOCUMENTO, B.NUMASIENTO, C.CATEGORIA_ID, C.DESCCATEGORIA, B.BOLETO_ID ")
|
sQuery.append("SELECT DISTINCT VP.VENDAPACOTE_ID, TVP.TARIFAVENDAPACOTE_ID, TVP.NOMEPASSAGEIRO, CONCAT(CONCAT(TVP.TIPODOC,' - '), TVP.DOCUMENTO) AS DOCUMENTO, B.NUMASIENTO, C.CATEGORIA_ID, C.DESCCATEGORIA, B.BOLETO_ID,C.CVECATEGORIA ")
|
||||||
.append("FROM VENDA_PACOTE VP ")
|
.append("FROM VENDA_PACOTE VP ")
|
||||||
.append("JOIN TARIFA_VENDA_PACOTE TVP ON TVP.VENDAPACOTE_ID = VP.VENDAPACOTE_ID ")
|
.append("JOIN TARIFA_VENDA_PACOTE TVP ON TVP.VENDAPACOTE_ID = VP.VENDAPACOTE_ID ")
|
||||||
.append("LEFT JOIN BOLETO B ON B.BOLETO_ID = TVP.BOLETO_ID ")
|
.append("LEFT JOIN BOLETO B ON B.BOLETO_ID = TVP.BOLETO_ID ")
|
||||||
|
@ -284,6 +284,7 @@ public class BusquedaDatosTicketHibernateDAO extends GenericHibernateDAO<Pacote,
|
||||||
.addScalar("DOCUMENTO", StringType.INSTANCE)
|
.addScalar("DOCUMENTO", StringType.INSTANCE)
|
||||||
.addScalar("NUMASIENTO", StringType.INSTANCE)
|
.addScalar("NUMASIENTO", StringType.INSTANCE)
|
||||||
.addScalar("CATEGORIA_ID", IntegerType.INSTANCE)
|
.addScalar("CATEGORIA_ID", IntegerType.INSTANCE)
|
||||||
|
.addScalar("CVECATEGORIA", StringType.INSTANCE)
|
||||||
.addScalar("DESCCATEGORIA", StringType.INSTANCE);
|
.addScalar("DESCCATEGORIA", StringType.INSTANCE);
|
||||||
|
|
||||||
query.setResultTransformer(new DatosPassageiroResultTransformer());
|
query.setResultTransformer(new DatosPassageiroResultTransformer());
|
||||||
|
|
|
@ -8,65 +8,6 @@ import javax.xml.bind.annotation.XmlType;
|
||||||
@XmlType(propOrder = { "nome", "documento", "categoria", "assento", "boletoId" })
|
@XmlType(propOrder = { "nome", "documento", "categoria", "assento", "boletoId" })
|
||||||
public class PassageiroVO {
|
public class PassageiroVO {
|
||||||
|
|
||||||
public static final String CATEGORIA_ADULT = "ADT";
|
|
||||||
public static final String CATEGORIA_CHILD = "CHD";
|
|
||||||
public static final String CATEGORIA_INFANT = "INF";
|
|
||||||
public static final String CATEGORIA_SENIOR = "SEN";
|
|
||||||
|
|
||||||
public static final int CATEGORIA_NORMAL=1;
|
|
||||||
|
|
||||||
public static final int CATEGORIA_CRIANCA_GRATUIDADE=52;
|
|
||||||
|
|
||||||
public static final int CATEGORIA_ESTUDANTE=22;
|
|
||||||
public static final int CATEGORIA_ESTUDANTE_PB=38;
|
|
||||||
public static final int CATEGORIA_ESTUDANTE_CE_LIBERCAD=49;
|
|
||||||
|
|
||||||
public static final int CATEGORIA_CORTESIA_AFETIVIDADE=20;
|
|
||||||
public static final int CATEGORIA_CORTESIA_EMPRESA=21;
|
|
||||||
|
|
||||||
public static final int CATEGORIA_FISCAL_DO_TRABALHO=24;
|
|
||||||
public static final int CATEGORIA_OPERADOR_A_TRABALHO=29;
|
|
||||||
|
|
||||||
public static final int CATEGORIA_PRF=23;
|
|
||||||
public static final int CATEGORIA_POL_MILITAR_MA=32;
|
|
||||||
public static final int CATEGORIA_MILITAR_PI_POL=37;
|
|
||||||
public static final int CATEGORIA_CE_PM_BOMBEIRO=46;
|
|
||||||
public static final int CATEGORIA_CE_DETRAN=48;
|
|
||||||
public static final int CATEGORIA_MA_OFI_JUSTICA=30;
|
|
||||||
|
|
||||||
public static final int CATEGORIA_ERFP=25;
|
|
||||||
|
|
||||||
public static final int CATEGORIA_MA_SINFRA=31;
|
|
||||||
|
|
||||||
public static final int CATEGORIA_SINDICATO_PB=40;
|
|
||||||
public static final int CATEGORIA_SINDICATO_CE=50;
|
|
||||||
public static final int CATEGORIA_SINDICATO_PI=51;
|
|
||||||
|
|
||||||
public static final int CATEGORIA_PB_PORTADOR_DE_CA=43;
|
|
||||||
public static final int CATEGORIA_PB_ACOMP_PORT_CA=44;
|
|
||||||
public static final int CATEGORIA_PB_INTEG_PARAIBA=45;
|
|
||||||
|
|
||||||
public static final int CATEGORIA_IDOSO_100=12;
|
|
||||||
public static final int CATEGORIA_IDOSO_50=13;
|
|
||||||
public static final int CATEGORIA_IDOSO_CE=47;
|
|
||||||
public static final int CATEGORIA_IDOSO_MA=34;
|
|
||||||
public static final int CATEGORIA_IDOSO_50_MA=35;
|
|
||||||
public static final int CATEGORIA_IDOSO_100_PB_BIL=41;
|
|
||||||
public static final int CATEGORIA_IDOSO_50_PB_BIL=42;
|
|
||||||
public static final int CATEGORIA_IDOSO_100_SP=27;
|
|
||||||
public static final int CATEGORIA_IDOSO_100_GO=15;
|
|
||||||
public static final int CATEGORIA_IDOSO_50_GO=16;
|
|
||||||
public static final int CATEGORIA_IDOSO_100_TO=18;
|
|
||||||
public static final int CATEGORIA_IDOSO_50_TO=19;
|
|
||||||
|
|
||||||
public static final int CATEGORIA_DEFICIENTE=11;
|
|
||||||
public static final int CATEGORIA_DEFICIENTE_GO=14;
|
|
||||||
public static final int CATEGORIA_DEFICIENTE_TO=17;
|
|
||||||
public static final int CATEGORIA_DEFICIENTE_PB=39;
|
|
||||||
public static final int CATEGORIA_DEFICIENTE_BA=26;
|
|
||||||
public static final int CATEGORIA_DEFICIENTE_MA=33;
|
|
||||||
public static final int CATEGORIA_DEFICIENTE_PI=36;
|
|
||||||
|
|
||||||
private Long vendapacoteId;
|
private Long vendapacoteId;
|
||||||
private Long tarifavendapacoteId;
|
private Long tarifavendapacoteId;
|
||||||
private Long boletoId;
|
private Long boletoId;
|
||||||
|
|
|
@ -55,93 +55,8 @@ public class DatosPassageiroResultTransformer implements ResultTransformer {
|
||||||
passageiro.setNome((String) tupleMap.get("NOMEPASSAGEIRO"));
|
passageiro.setNome((String) tupleMap.get("NOMEPASSAGEIRO"));
|
||||||
passageiro.setBoletoId((Long) tupleMap.get("BOLETO_ID"));
|
passageiro.setBoletoId((Long) tupleMap.get("BOLETO_ID"));
|
||||||
passageiro.setAssento((String) tupleMap.get("NUMASIENTO"));
|
passageiro.setAssento((String) tupleMap.get("NUMASIENTO"));
|
||||||
|
passageiro.setCategoria((String) tupleMap.get("CVECATEGORIA"));
|
||||||
setCategoriaPassageiro(passageiro, tupleMap);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setCategoriaPassageiro(PassageiroVO passageiro, Map<String, Object> tupleMap){
|
|
||||||
|
|
||||||
Integer categoriaId = (Integer) tupleMap.get("CATEGORIA_ID");
|
|
||||||
String categoria = (String) tupleMap.get("DESCCATEGORIA");
|
|
||||||
|
|
||||||
if(categoriaId != null) {
|
|
||||||
String categoriaWS = "";
|
|
||||||
|
|
||||||
if(isCategoriaAdult(categoriaId)) {
|
|
||||||
categoriaWS = PassageiroVO.CATEGORIA_ADULT;
|
|
||||||
} else if(isCategoriaInfant(categoriaId)) {
|
|
||||||
categoriaWS = PassageiroVO.CATEGORIA_INFANT;
|
|
||||||
} else if(isCategoriaChild(categoriaId)) {
|
|
||||||
categoriaWS = PassageiroVO.CATEGORIA_CHILD;
|
|
||||||
} else if(isCategoriaSenior(categoriaId)) {
|
|
||||||
categoriaWS = PassageiroVO.CATEGORIA_SENIOR;
|
|
||||||
} else {
|
|
||||||
categoriaWS = String.format("%s-%s", categoriaId.toString(), categoria);
|
|
||||||
}
|
|
||||||
|
|
||||||
passageiro.setCategoria(categoriaWS);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean isCategoriaSenior(Integer categoriaId){
|
|
||||||
|
|
||||||
return (PassageiroVO.CATEGORIA_IDOSO_100 == categoriaId
|
|
||||||
|| PassageiroVO.CATEGORIA_IDOSO_50 == categoriaId
|
|
||||||
|| PassageiroVO.CATEGORIA_IDOSO_CE == categoriaId
|
|
||||||
|| PassageiroVO.CATEGORIA_IDOSO_MA == categoriaId
|
|
||||||
|| PassageiroVO.CATEGORIA_IDOSO_50_MA == categoriaId
|
|
||||||
|| PassageiroVO.CATEGORIA_IDOSO_100_PB_BIL == categoriaId
|
|
||||||
|| PassageiroVO.CATEGORIA_IDOSO_50_PB_BIL == categoriaId
|
|
||||||
|| PassageiroVO.CATEGORIA_IDOSO_100_SP == categoriaId
|
|
||||||
|| PassageiroVO.CATEGORIA_IDOSO_100_GO == categoriaId
|
|
||||||
|| PassageiroVO.CATEGORIA_IDOSO_50_GO == categoriaId
|
|
||||||
|| PassageiroVO.CATEGORIA_IDOSO_100_TO == categoriaId
|
|
||||||
|| PassageiroVO.CATEGORIA_IDOSO_50_TO == categoriaId);
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean isCategoriaAdult(Integer categoriaId){
|
|
||||||
|
|
||||||
return (PassageiroVO.CATEGORIA_DEFICIENTE == categoriaId
|
|
||||||
|| PassageiroVO.CATEGORIA_DEFICIENTE_GO == categoriaId
|
|
||||||
|| PassageiroVO.CATEGORIA_DEFICIENTE_TO == categoriaId
|
|
||||||
|| PassageiroVO.CATEGORIA_DEFICIENTE_PB == categoriaId
|
|
||||||
|| PassageiroVO.CATEGORIA_DEFICIENTE_BA == categoriaId
|
|
||||||
|| PassageiroVO.CATEGORIA_DEFICIENTE_MA == categoriaId
|
|
||||||
|| PassageiroVO.CATEGORIA_DEFICIENTE_PI == categoriaId
|
|
||||||
|| PassageiroVO.CATEGORIA_ESTUDANTE == categoriaId
|
|
||||||
|| PassageiroVO.CATEGORIA_ESTUDANTE_PB == categoriaId
|
|
||||||
|| PassageiroVO.CATEGORIA_ESTUDANTE_CE_LIBERCAD == categoriaId
|
|
||||||
|| PassageiroVO.CATEGORIA_FISCAL_DO_TRABALHO == categoriaId
|
|
||||||
|| PassageiroVO.CATEGORIA_OPERADOR_A_TRABALHO == categoriaId
|
|
||||||
|| PassageiroVO.CATEGORIA_PRF == categoriaId
|
|
||||||
|| PassageiroVO.CATEGORIA_POL_MILITAR_MA == categoriaId
|
|
||||||
|| PassageiroVO.CATEGORIA_MILITAR_PI_POL == categoriaId
|
|
||||||
|| PassageiroVO.CATEGORIA_CE_PM_BOMBEIRO == categoriaId
|
|
||||||
|| PassageiroVO.CATEGORIA_CE_DETRAN == categoriaId
|
|
||||||
|| PassageiroVO.CATEGORIA_MA_OFI_JUSTICA == categoriaId
|
|
||||||
|| PassageiroVO.CATEGORIA_ERFP == categoriaId
|
|
||||||
|| PassageiroVO.CATEGORIA_MA_SINFRA == categoriaId
|
|
||||||
|| PassageiroVO.CATEGORIA_SINDICATO_PB == categoriaId
|
|
||||||
|| PassageiroVO.CATEGORIA_SINDICATO_CE == categoriaId
|
|
||||||
|| PassageiroVO.CATEGORIA_SINDICATO_PI == categoriaId
|
|
||||||
|| PassageiroVO.CATEGORIA_PB_PORTADOR_DE_CA == categoriaId
|
|
||||||
|| PassageiroVO.CATEGORIA_PB_ACOMP_PORT_CA == categoriaId
|
|
||||||
|| PassageiroVO.CATEGORIA_PB_INTEG_PARAIBA == categoriaId
|
|
||||||
|| PassageiroVO.CATEGORIA_CORTESIA_AFETIVIDADE == categoriaId
|
|
||||||
|| PassageiroVO.CATEGORIA_CORTESIA_EMPRESA == categoriaId
|
|
||||||
|| PassageiroVO.CATEGORIA_NORMAL == categoriaId );
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean isCategoriaInfant(Integer categoriaId){
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean isCategoriaChild(Integer categoriaId){
|
|
||||||
|
|
||||||
return (PassageiroVO.CATEGORIA_CRIANCA_GRATUIDADE == categoriaId);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue