Commit e6fd2a6b12dc8d497be3972af8a6d99769c237a9
1 parent
c5c3452a
Exists in
master
[Redmine Atendimento #4166]Correção consulta termo
Showing
2 changed files
with
11 additions
and
5 deletions
Show diff stats
cit-contratos-web/src/main/java/br/com/centralit/controller/ContratoEventoController.java
... | ... | @@ -137,8 +137,8 @@ public class ContratoEventoController extends GenericController<ContratoEvento> |
137 | 137 | |
138 | 138 | List<ContratoEventosVH> lista = new ArrayList<ContratoEventosVH>(); |
139 | 139 | |
140 | - Date dataInicial = dataInicio != null ? UtilDate.jsonToDate(dataInicio) : null; | |
141 | - Date dateFinal = dataFim != null ? UtilDate.jsonToDate(dataFim) : null; | |
140 | + Date dataInicial = StringUtils.isNotBlank(dataInicio) ? UtilDate.jsonToDate(dataInicio) : null; | |
141 | + Date dateFinal = StringUtils.isNotBlank(dataFim) ? UtilDate.jsonToDate(dataFim) : null; | |
142 | 142 | |
143 | 143 | Collection<ContratoEvento> listaEventos = this.contratoEventoService.findAllByContratoIntervalDataEmissao(contratoId, dataInicial, dateFinal); |
144 | 144 | ... | ... |
cit-contratos-web/src/main/webapp/assets/js/angular/custom/controller/TermoEventoContratoController.js
... | ... | @@ -80,9 +80,15 @@ citApp.controller('TermoEventoContratoController', ['$scope', |
80 | 80 | }); |
81 | 81 | |
82 | 82 | if(codigoTermoChecked.length == 0){ |
83 | - angular.forEach($scope.termosTemp, function(termo) { | |
84 | - codigoTermoChecked.push(termo.tipoEvento.codigo); | |
85 | - }); | |
83 | + if($scope.contrato){ | |
84 | + angular.forEach($scope.termos, function(termo) { | |
85 | + codigoTermoChecked.push(termo.tipoEvento.codigo); | |
86 | + }); | |
87 | + }else{ | |
88 | + angular.forEach($scope.termosTemp, function(termo) { | |
89 | + codigoTermoChecked.push(termo.tipoEvento.codigo); | |
90 | + }); | |
91 | + } | |
86 | 92 | } |
87 | 93 | |
88 | 94 | if(!$scope.dataInicio){ | ... | ... |