Commit 86d165456d3faf500bf495e1311551d64641d63c
1 parent
91a8b074
Exists in
master
redmine #4115 Construção da história;
Showing
18 changed files
with
219 additions
and
27 deletions
Show diff stats
cit-contratos-api/src/main/java/br/com/centralit/api/model/DominioContrato.java
... | ... | @@ -106,6 +106,13 @@ public class DominioContrato { |
106 | 106 | public static final Long CODIGO_TIPO_EVENTO_RECEBIMENTO_AVALIACAO_DESCUMPRIMENTO = 2L; |
107 | 107 | public static final Long CODIGO_TIPO_EVENTO_RECEBIMENTO_AVALIACAO_PASSIVEL_CORRECAO = 3L; |
108 | 108 | public static final Long CODIGO_TIPO_EVENTO_RECEBIMENTO_AVALIACAO_OUTROS = 4L; |
109 | + | |
110 | + public static final Long CODIGO_TIPO_RELATORIO_CONTRATO_REGISTRO_EMPENHO = 1L; | |
111 | + public static final Long CODIGO_TIPO_RELATORIO_CONTRATO_LIBERACAO_PAGAMENTO = 2L; | |
112 | + public static final Long CODIGO_TIPO_RELATORIO_CONTRATO_REPACTUACAO = 3L; | |
113 | + public static final Long CODIGO_TIPO_RELATORIO_CONTRATO_NAO_CONFORMIDADE = 4L; | |
114 | + public static final Long CODIGO_TIPO_RELATORIO_CONTRATO_PENALIDADES_APLICADAS = 5L; | |
115 | + | |
109 | 116 | //===================================================================================================================================== |
110 | 117 | // TIPO_RESPOSTA_QUESTAO_CHAVE |
111 | 118 | public static final String TIPO_RESPOSTA_QUESTAO = "tipoRespostaQuestao"; | ... | ... |
cit-contratos-api/src/main/java/br/com/centralit/api/service/ContratoEmpenhoService.java
... | ... | @@ -2,6 +2,7 @@ package br.com.centralit.api.service; |
2 | 2 | |
3 | 3 | import java.sql.Connection; |
4 | 4 | import java.util.Collection; |
5 | +import java.util.Date; | |
5 | 6 | |
6 | 7 | import javax.servlet.http.HttpServletResponse; |
7 | 8 | |
... | ... | @@ -34,4 +35,7 @@ public interface ContratoEmpenhoService extends GenericService<ContratoEmpenho, |
34 | 35 | |
35 | 36 | JasperPrint getJasperPrintEmpenho(Long id, Connection conn, Usuario usuarioLogado, String titulo) throws JRException; |
36 | 37 | |
38 | + JasperPrint getJasperPrintRelatorioEmpenho(Long idContrato, Date dataInicial, Date dataFinal, | |
39 | + Connection conn, Usuario usuarioLogado, String titulo) throws JRException; | |
40 | + | |
37 | 41 | } | ... | ... |
cit-contratos-api/src/main/java/br/com/centralit/api/service/ContratoEventoService.java
... | ... | @@ -55,4 +55,7 @@ public interface ContratoEventoService extends GenericService<ContratoEvento, Lo |
55 | 55 | void gerarTermos(Long[] arrayLong, boolean download,HttpServletResponse response); |
56 | 56 | |
57 | 57 | Collection<ContratoEvento> findAllByContratoTipoTermoDataEmissao(Long[] codigosTermo,Date dataInicial, Date dateFinal); |
58 | + | |
59 | + void gerarRelatorios(Long[] idsTiposRelatorios, Long idContrato, Date dataInicial, Date dataFinal, boolean download, | |
60 | + HttpServletResponse response); | |
58 | 61 | } | ... | ... |
cit-contratos-api/src/main/java/br/com/centralit/api/service/EventoLiberacaoPagamentoService.java
1 | 1 | package br.com.centralit.api.service; |
2 | 2 | |
3 | 3 | import java.math.BigDecimal; |
4 | +import java.sql.Connection; | |
5 | +import java.util.Date; | |
4 | 6 | |
7 | +import net.sf.jasperreports.engine.JRException; | |
8 | +import net.sf.jasperreports.engine.JasperPrint; | |
5 | 9 | import br.com.centralit.api.model.EventoLiberacaoPagamento; |
10 | +import br.com.centralit.framework.model.Usuario; | |
6 | 11 | import br.com.centralit.framework.service.arquitetura.GenericService; |
7 | 12 | |
8 | 13 | public interface EventoLiberacaoPagamentoService extends GenericService<EventoLiberacaoPagamento, Long> { |
9 | 14 | |
10 | 15 | BigDecimal getValorTotalLiberado(Long contratoId); |
11 | 16 | |
17 | + JasperPrint getJasperPrintRelatorioLiberacaoPagamento(Long idContrato, Date dataInicial, Date dataFinal, | |
18 | + Connection conn, Usuario usuarioLogado, String titulo) throws JRException; | |
19 | + | |
12 | 20 | } | ... | ... |
cit-contratos-api/src/main/java/br/com/centralit/api/service/EventoPenalidadeService.java
1 | 1 | package br.com.centralit.api.service; |
2 | 2 | |
3 | +import java.sql.Connection; | |
4 | +import java.util.Date; | |
5 | + | |
6 | +import net.sf.jasperreports.engine.JRException; | |
7 | +import net.sf.jasperreports.engine.JasperPrint; | |
3 | 8 | import br.com.centralit.api.model.EventoPenalidade; |
9 | +import br.com.centralit.framework.model.Usuario; | |
4 | 10 | import br.com.centralit.framework.service.arquitetura.GenericService; |
5 | 11 | |
6 | 12 | |
... | ... | @@ -18,4 +24,7 @@ import br.com.centralit.framework.service.arquitetura.GenericService; |
18 | 24 | */ |
19 | 25 | public interface EventoPenalidadeService extends GenericService<EventoPenalidade, Long> { |
20 | 26 | |
27 | + JasperPrint getJasperPrintRelatorioPenalidade(Long idContrato, Date dataInicial, Date dataFinal, | |
28 | + Connection conn, Usuario usuarioLogado, String titulo) throws JRException; | |
29 | + | |
21 | 30 | } | ... | ... |
cit-contratos-api/src/main/java/br/com/centralit/api/service/EventoRegistroNaoConformidadeService.java
1 | 1 | package br.com.centralit.api.service; |
2 | 2 | |
3 | +import java.sql.Connection; | |
4 | +import java.util.Date; | |
3 | 5 | import java.util.List; |
4 | 6 | |
7 | +import net.sf.jasperreports.engine.JRException; | |
8 | +import net.sf.jasperreports.engine.JasperPrint; | |
5 | 9 | import br.com.centralit.api.model.EventoRegistroNaoConformidade; |
10 | +import br.com.centralit.framework.model.Usuario; | |
6 | 11 | import br.com.centralit.framework.service.arquitetura.GenericService; |
7 | 12 | |
8 | 13 | public interface EventoRegistroNaoConformidadeService extends GenericService<EventoRegistroNaoConformidade, Long> { |
... | ... | @@ -11,4 +16,7 @@ public interface EventoRegistroNaoConformidadeService extends GenericService<Eve |
11 | 16 | |
12 | 17 | Boolean existeVinculoSancoesComNaoConformidade(Long sancaoId); |
13 | 18 | |
19 | + JasperPrint getJasperPrintRelatorioRegistroNaoConformidade(Long idContrato, Date dataInicial, Date dataFinal, | |
20 | + Connection conn, Usuario usuarioLogado, String titulo) throws JRException; | |
21 | + | |
14 | 22 | } | ... | ... |
cit-contratos-api/src/main/java/br/com/centralit/api/service/EventoRepactuacaoService.java
1 | 1 | package br.com.centralit.api.service; |
2 | 2 | |
3 | 3 | import java.sql.Connection; |
4 | +import java.util.Date; | |
4 | 5 | |
5 | 6 | import net.sf.jasperreports.engine.JRException; |
6 | 7 | import net.sf.jasperreports.engine.JasperPrint; |
... | ... | @@ -34,4 +35,7 @@ public interface EventoRepactuacaoService extends GenericService<EventoRepactuac |
34 | 35 | |
35 | 36 | JasperPrint getJasperPrintRepactuacao(Long id, Connection conn, Usuario usuarioLogado, String titulo) throws JRException; |
36 | 37 | |
38 | + JasperPrint getJasperPrintRelatorioRepactuacao(Long idContrato, Date dataInicial, Date dataFinal, | |
39 | + Connection conn, Usuario usuarioLogado, String titulo) throws JRException; | |
40 | + | |
37 | 41 | } | ... | ... |
cit-contratos-api/src/main/java/br/com/centralit/api/service/impl/ContratoEmpenhoServiceImpl.java
... | ... | @@ -5,12 +5,21 @@ import java.io.InputStream; |
5 | 5 | import java.sql.Connection; |
6 | 6 | import java.util.ArrayList; |
7 | 7 | import java.util.Collection; |
8 | +import java.util.Date; | |
8 | 9 | import java.util.HashMap; |
9 | 10 | import java.util.List; |
10 | 11 | import java.util.Map; |
11 | 12 | |
12 | 13 | import javax.servlet.http.HttpServletResponse; |
13 | 14 | |
15 | +import net.sf.jasperreports.engine.JRException; | |
16 | +import net.sf.jasperreports.engine.JasperCompileManager; | |
17 | +import net.sf.jasperreports.engine.JasperFillManager; | |
18 | +import net.sf.jasperreports.engine.JasperPrint; | |
19 | +import net.sf.jasperreports.engine.JasperReport; | |
20 | +import net.sf.jasperreports.engine.design.JasperDesign; | |
21 | +import net.sf.jasperreports.engine.xml.JRXmlLoader; | |
22 | + | |
14 | 23 | import org.springframework.beans.factory.annotation.Autowired; |
15 | 24 | import org.springframework.security.core.context.SecurityContextHolder; |
16 | 25 | import org.springframework.stereotype.Service; |
... | ... | @@ -38,13 +47,6 @@ import br.com.centralit.framework.util.UtilColecao; |
38 | 47 | import br.com.centralit.framework.util.UtilDataBase; |
39 | 48 | import br.com.centralit.framework.util.UtilDate; |
40 | 49 | import br.com.centralit.framework.util.UtilObjeto; |
41 | -import net.sf.jasperreports.engine.JRException; | |
42 | -import net.sf.jasperreports.engine.JasperCompileManager; | |
43 | -import net.sf.jasperreports.engine.JasperFillManager; | |
44 | -import net.sf.jasperreports.engine.JasperPrint; | |
45 | -import net.sf.jasperreports.engine.JasperReport; | |
46 | -import net.sf.jasperreports.engine.design.JasperDesign; | |
47 | -import net.sf.jasperreports.engine.xml.JRXmlLoader; | |
48 | 50 | |
49 | 51 | /** |
50 | 52 | * |
... | ... | @@ -231,4 +233,11 @@ public class ContratoEmpenhoServiceImpl extends GenericServiceImpl<ContratoEmpen |
231 | 233 | } |
232 | 234 | } |
233 | 235 | |
236 | + @Override | |
237 | + public JasperPrint getJasperPrintRelatorioEmpenho(Long idContrato, Date dataInicial, Date dataFinal, | |
238 | + Connection conn, Usuario usuarioLogado, String titulo) throws JRException { | |
239 | + // TODO Auto-generated method stub | |
240 | + return null; | |
241 | + } | |
242 | + | |
234 | 243 | } | ... | ... |
cit-contratos-api/src/main/java/br/com/centralit/api/service/impl/ContratoEventoServiceImpl.java
... | ... | @@ -29,7 +29,10 @@ import br.com.centralit.api.service.ContratoEventoService; |
29 | 29 | import br.com.centralit.api.service.DominioService; |
30 | 30 | import br.com.centralit.api.service.EventoAditivoService; |
31 | 31 | import br.com.centralit.api.service.EventoApostilamentoService; |
32 | +import br.com.centralit.api.service.EventoLiberacaoPagamentoService; | |
33 | +import br.com.centralit.api.service.EventoPenalidadeService; | |
32 | 34 | import br.com.centralit.api.service.EventoRecebimentoObjetoService; |
35 | +import br.com.centralit.api.service.EventoRegistroNaoConformidadeService; | |
33 | 36 | import br.com.centralit.api.service.EventoRepactuacaoService; |
34 | 37 | import br.com.centralit.api.service.EventoRescisaoContratoService; |
35 | 38 | import br.com.centralit.api.service.InternacionalizacaoService; |
... | ... | @@ -103,6 +106,15 @@ public class ContratoEventoServiceImpl extends GenericServiceImpl<ContratoEvento |
103 | 106 | @Autowired |
104 | 107 | private EventoApostilamentoService apostilamentoService; |
105 | 108 | |
109 | + @Autowired | |
110 | + private EventoLiberacaoPagamentoService eventoLiberacaoPagamentoService; | |
111 | + | |
112 | + @Autowired | |
113 | + private EventoRegistroNaoConformidadeService eventoRegistroNaoConformidadeService; | |
114 | + | |
115 | + @Autowired | |
116 | + private EventoPenalidadeService eventoPenalidadeService; | |
117 | + | |
106 | 118 | private Dominio idioma; |
107 | 119 | |
108 | 120 | /** |
... | ... | @@ -246,4 +258,70 @@ public class ContratoEventoServiceImpl extends GenericServiceImpl<ContratoEvento |
246 | 258 | return this.contratoEventoDao.findAllByContratoTipoTermoDataEmissao(Arrays.asList(codigosTermo), dataInicial, dateFinal); |
247 | 259 | } |
248 | 260 | |
261 | + @Override | |
262 | + public void gerarRelatorios(Long[] idsTiposRelatorios, Long idContrato, Date dataInicial, Date dataFinal, boolean download, HttpServletResponse response) { | |
263 | + | |
264 | + Connection conn = null; | |
265 | + ByteArrayOutputStream baos = null; | |
266 | + InputStream inputCabecalho = null; | |
267 | + JasperPrint jasperPrint = null; | |
268 | + | |
269 | + try { | |
270 | + conn = reportService.getConnection(); | |
271 | + | |
272 | + Usuario usuarioLogado = (Usuario) usuarioService.find(( (Usuario) SecurityContextHolder.getContext().getAuthentication().getPrincipal() ).getId()); | |
273 | + | |
274 | + List<JasperPrint> jasperPrints = new ArrayList<JasperPrint>(); | |
275 | + JasperPrint jasperPrincipal = new JasperPrint(); | |
276 | + | |
277 | + if (UtilObjeto.isReferencia(idsTiposRelatorios)){ | |
278 | + Integer index = 1; | |
279 | + for (Long idTipoRelatorio : idsTiposRelatorios) { | |
280 | + Dominio dominioTipoRelatorio = dominioService.find(idTipoRelatorio); | |
281 | + | |
282 | + if(dominioTipoRelatorio.getCodigo() == DominioContrato.CODIGO_TIPO_RELATORIO_CONTRATO_REGISTRO_EMPENHO){ | |
283 | + String titulo = this.internacionalizacaoService.getTranslate("CONTRATOS.LABEL.RELATORIO_REGISTRO_EMPENHO", this.getIdioma()); | |
284 | + jasperPrint = this.contratoEmpenhoService.getJasperPrintRelatorioEmpenho(idContrato, dataInicial, dataFinal, conn, usuarioLogado, titulo); | |
285 | + | |
286 | + } else if(dominioTipoRelatorio.getCodigo() == DominioContrato.CODIGO_TIPO_RELATORIO_CONTRATO_LIBERACAO_PAGAMENTO){ | |
287 | + String titulo = this.internacionalizacaoService.getTranslate("CONTRATOS.LABEL.RELATORIO_LIBERACAO_PAGAMENTO", this.getIdioma()); | |
288 | + jasperPrint = this.eventoLiberacaoPagamentoService.getJasperPrintRelatorioLiberacaoPagamento(idContrato, dataInicial, dataFinal, conn, usuarioLogado, titulo); | |
289 | + | |
290 | + } else if(dominioTipoRelatorio.getCodigo() == DominioContrato.CODIGO_TIPO_RELATORIO_CONTRATO_REPACTUACAO){ | |
291 | + String titulo = this.internacionalizacaoService.getTranslate("CONTRATOS.LABEL.RELATORIO_REPACTUACAO", this.getIdioma()); | |
292 | + jasperPrint = this.repactuacaoService.getJasperPrintRelatorioRepactuacao(idContrato, dataInicial, dataFinal, conn, usuarioLogado, titulo); | |
293 | + | |
294 | + } else if(dominioTipoRelatorio.getCodigo() == DominioContrato.CODIGO_TIPO_RELATORIO_CONTRATO_NAO_CONFORMIDADE){ | |
295 | + String titulo = this.internacionalizacaoService.getTranslate("CONTRATOS.LABEL.RELATORIO_NAO_CONFORMIDADE", this.getIdioma()); | |
296 | + jasperPrint = this.eventoRegistroNaoConformidadeService.getJasperPrintRelatorioRegistroNaoConformidade(idContrato, dataInicial, dataFinal, conn, usuarioLogado, titulo); | |
297 | + | |
298 | + } else if(dominioTipoRelatorio.getCodigo() == DominioContrato.CODIGO_TIPO_RELATORIO_CONTRATO_PENALIDADES_APLICADAS){ | |
299 | + String titulo = this.internacionalizacaoService.getTranslate("CONTRATOS.LABEL.RELATORIO_PENALIDADE_APLICADA", this.getIdioma()); | |
300 | + jasperPrint = this.eventoPenalidadeService.getJasperPrintRelatorioPenalidade(idContrato, dataInicial, dataFinal, conn, usuarioLogado, titulo); | |
301 | + } | |
302 | + | |
303 | + jasperPrincipal = addJasperPrint(jasperPrint,jasperPrints, jasperPrincipal, index); | |
304 | + index ++; | |
305 | + continue; | |
306 | + | |
307 | + } | |
308 | + if (!UtilColecao.isVazio(jasperPrints)){ | |
309 | + for (JasperPrint jasper : jasperPrints) { | |
310 | + for (int j = 0; j < jasper.getPages().size(); j++) { | |
311 | + JRPrintPage object = (JRPrintPage) jasper.getPages().get(j); | |
312 | + jasperPrincipal.addPage(object); | |
313 | + } | |
314 | + } | |
315 | + | |
316 | + } | |
317 | + reportService.gerarRelatorio(download, "pdf", jasperPrincipal, response, baos, ""); | |
318 | + } | |
319 | + | |
320 | + } catch (JRException jre) { | |
321 | + throw new RuntimeException(jre); | |
322 | + } finally { | |
323 | + UtilDataBase.closeResources(conn, inputCabecalho, baos); | |
324 | + } | |
325 | + | |
326 | + } | |
249 | 327 | } | ... | ... |
cit-contratos-api/src/main/java/br/com/centralit/api/service/impl/EventoLiberacaoPagamentoServiceImpl.java
1 | 1 | package br.com.centralit.api.service.impl; |
2 | 2 | |
3 | 3 | import java.math.BigDecimal; |
4 | +import java.sql.Connection; | |
4 | 5 | import java.util.ArrayList; |
6 | +import java.util.Date; | |
5 | 7 | import java.util.List; |
6 | 8 | |
9 | +import net.sf.jasperreports.engine.JRException; | |
10 | +import net.sf.jasperreports.engine.JasperPrint; | |
11 | + | |
7 | 12 | import org.springframework.beans.factory.annotation.Autowired; |
8 | 13 | import org.springframework.beans.factory.annotation.Qualifier; |
9 | 14 | import org.springframework.security.core.context.SecurityContextHolder; |
... | ... | @@ -198,4 +203,11 @@ public class EventoLiberacaoPagamentoServiceImpl extends GenericServiceImpl<Even |
198 | 203 | return liberacaoPagamentoDao.getValorTotalLiberado(contratoId); |
199 | 204 | } |
200 | 205 | |
206 | + @Override | |
207 | + public JasperPrint getJasperPrintRelatorioLiberacaoPagamento(Long idContrato, Date dataInicial, Date dataFinal, | |
208 | + Connection conn, Usuario usuarioLogado, String titulo) throws JRException { | |
209 | + // TODO Auto-generated method stub | |
210 | + return null; | |
211 | + } | |
212 | + | |
201 | 213 | } | ... | ... |
cit-contratos-api/src/main/java/br/com/centralit/api/service/impl/EventoPenalidadeServiceImpl.java
1 | 1 | package br.com.centralit.api.service.impl; |
2 | 2 | |
3 | +import java.sql.Connection; | |
3 | 4 | import java.text.SimpleDateFormat; |
4 | 5 | import java.util.Collection; |
5 | 6 | import java.util.Date; |
6 | 7 | |
8 | +import net.sf.jasperreports.engine.JRException; | |
9 | +import net.sf.jasperreports.engine.JasperPrint; | |
10 | + | |
7 | 11 | import org.apache.commons.collections.CollectionUtils; |
8 | 12 | import org.apache.commons.lang3.StringUtils; |
9 | 13 | import org.apache.log4j.Logger; |
... | ... | @@ -25,6 +29,7 @@ import br.com.centralit.api.service.InternacionalizacaoService; |
25 | 29 | import br.com.centralit.api.service.ParceiroService; |
26 | 30 | import br.com.centralit.api.service.UsuarioService; |
27 | 31 | import br.com.centralit.framework.model.Dominio; |
32 | +import br.com.centralit.framework.model.Usuario; | |
28 | 33 | import br.com.centralit.framework.service.arquitetura.GenericServiceImpl; |
29 | 34 | |
30 | 35 | |
... | ... | @@ -141,4 +146,11 @@ public class EventoPenalidadeServiceImpl extends GenericServiceImpl<EventoPenali |
141 | 146 | return dominioService.findByChaveAndCodigo("tipoIdioma", Dominio.TIPO_IDIOMA_PT_BR_CODIGO); |
142 | 147 | } |
143 | 148 | |
149 | + @Override | |
150 | + public JasperPrint getJasperPrintRelatorioPenalidade(Long idContrato, Date dataInicial, Date dataFinal, | |
151 | + Connection conn, Usuario usuarioLogado, String titulo) throws JRException { | |
152 | + // TODO Auto-generated method stub | |
153 | + return null; | |
154 | + } | |
155 | + | |
144 | 156 | } | ... | ... |
cit-contratos-api/src/main/java/br/com/centralit/api/service/impl/EventoRegistroNaoConformidadeServiceImpl.java
1 | 1 | package br.com.centralit.api.service.impl; |
2 | 2 | |
3 | +import java.sql.Connection; | |
3 | 4 | import java.text.SimpleDateFormat; |
4 | 5 | import java.util.ArrayList; |
5 | 6 | import java.util.Date; |
6 | 7 | import java.util.List; |
7 | 8 | |
9 | +import net.sf.jasperreports.engine.JRException; | |
10 | +import net.sf.jasperreports.engine.JasperPrint; | |
11 | + | |
8 | 12 | import org.apache.commons.lang3.StringUtils; |
9 | 13 | import org.springframework.beans.factory.annotation.Autowired; |
10 | 14 | import org.springframework.beans.factory.annotation.Qualifier; |
... | ... | @@ -164,4 +168,11 @@ public class EventoRegistroNaoConformidadeServiceImpl extends GenericServiceImpl |
164 | 168 | public Boolean existeVinculoSancoesComNaoConformidade(Long sancaoId) { |
165 | 169 | return this.eventoRegistroNaoConformidadeDao.existeVinculoSancoesComNaoConformidade(sancaoId); |
166 | 170 | } |
171 | + | |
172 | + @Override | |
173 | + public JasperPrint getJasperPrintRelatorioRegistroNaoConformidade(Long idContrato, Date dataInicial, Date dataFinal, | |
174 | + Connection conn, Usuario usuarioLogado, String titulo) throws JRException { | |
175 | + // TODO Auto-generated method stub | |
176 | + return null; | |
177 | + } | |
167 | 178 | } | ... | ... |
cit-contratos-api/src/main/java/br/com/centralit/api/service/impl/EventoRepactuacaoServiceImpl.java
... | ... | @@ -4,6 +4,7 @@ import java.io.InputStream; |
4 | 4 | import java.sql.Connection; |
5 | 5 | import java.text.SimpleDateFormat; |
6 | 6 | import java.util.Collection; |
7 | +import java.util.Date; | |
7 | 8 | import java.util.HashMap; |
8 | 9 | import java.util.Map; |
9 | 10 | |
... | ... | @@ -187,4 +188,11 @@ public class EventoRepactuacaoServiceImpl extends GenericServiceImpl<EventoRepac |
187 | 188 | } |
188 | 189 | } |
189 | 190 | |
191 | + @Override | |
192 | + public JasperPrint getJasperPrintRelatorioRepactuacao(Long idContrato, Date dataInicial, Date dataFinal, | |
193 | + Connection conn, Usuario usuarioLogado, String titulo) throws JRException { | |
194 | + // TODO Auto-generated method stub | |
195 | + return null; | |
196 | + } | |
197 | + | |
190 | 198 | } | ... | ... |
cit-contratos-web/src/main/java/br/com/centralit/controller/ContratoEventoController.java
... | ... | @@ -220,4 +220,17 @@ public class ContratoEventoController extends GenericController<ContratoEvento> |
220 | 220 | |
221 | 221 | } |
222 | 222 | |
223 | + @ResponseBody | |
224 | + @RequestMapping(method = RequestMethod.GET, value = "/pdfGerarRelatorios") | |
225 | + public void gerarGerarRelatorios( | |
226 | + @RequestParam(value = "idsTiposRelatorio") String idsRelatoriosSelecionados, | |
227 | + @RequestParam(value = "idContrato") Long idContrato, | |
228 | + @RequestParam(value = "dataInicial", required = false) String dataInicial, | |
229 | + @RequestParam(value = "dataFinal", required = false) String dataFinal, | |
230 | + @RequestParam(value = "download") boolean download, HttpServletResponse response) throws SQLException, JRException, IOException { | |
231 | + | |
232 | + Long[] arrayLong = getArrayLong(idsRelatoriosSelecionados); | |
233 | + this.contratoEventoService.gerarTermos(arrayLong, download, response); | |
234 | + } | |
235 | + | |
223 | 236 | } | ... | ... |
cit-contratos-web/src/main/java/br/com/centralit/listener/StartupListenerContratos.java
... | ... | @@ -290,10 +290,10 @@ public class StartupListenerContratos extends UtilStartup implements Application |
290 | 290 | |
291 | 291 | //CHAVE tipoRelatorioContrato |
292 | 292 | list.add(new Dominio("tipoRelatorioContrato", "Relatório de registro de empenho", "RELATORIO_REGISTRO_EMPENHO", 1L)); |
293 | - list.add(new Dominio("tipoRelatorioContrato", "Relatório de ocorrências", "RELATORIO_OCORRENCIAS", 2L)); | |
294 | - list.add(new Dominio("tipoRelatorioContrato", "Relatório de liberação de pagamento", "RELATORIO_LIBERACAO_PAGAMENTO", 3L)); | |
295 | - list.add(new Dominio("tipoRelatorioContrato", "Relatório de repactuação", "RELATORIO_REPACTUACAO", 4L)); | |
296 | - list.add(new Dominio("tipoRelatorioContrato", "Relatório de rescisão", "RELATORIO_RESCISAO", 5L)); | |
293 | + list.add(new Dominio("tipoRelatorioContrato", "Relatório de liberação de pagamento", "RELATORIO_LIBERACAO_PAGAMENTO", 2L)); | |
294 | + list.add(new Dominio("tipoRelatorioContrato", "Relatório de repactuação", "RELATORIO_REPACTUACAO", 3L)); | |
295 | + list.add(new Dominio("tipoRelatorioContrato", "Relatório de não conformidade", "RELATORIO_NAO_CONFORMIDADE", 4L)); | |
296 | + list.add(new Dominio("tipoRelatorioContrato", "Relatório de penalidades aplicadas", "RELATORIO_PENALIDADES_APLICADAS", 5L)); | |
297 | 297 | |
298 | 298 | |
299 | 299 | this.dominioService.saveListIfNotExist(list); |
... | ... | @@ -997,6 +997,12 @@ public class StartupListenerContratos extends UtilStartup implements Application |
997 | 997 | |
998 | 998 | internacionalizacaoList.add(new Internacionalizacao("CONTRATOS.LABEL.EMITIR_CONSULTA_RELATORIOS", "Emitir consulta relatórios", dominio, modulo)); |
999 | 999 | internacionalizacaoList.add(new Internacionalizacao("CONTRATOS.LABEL.TIPO_RELATORIOS", "Tipo de relatórios", dominio, modulo)); |
1000 | + internacionalizacaoList.add(new Internacionalizacao("CONTRATOS.LABEL.RELATORIO_REGISTRO_EMPENHO", "Relatório de registro de empenho", dominio, modulo)); | |
1001 | + internacionalizacaoList.add(new Internacionalizacao("CONTRATOS.LABEL.RELATORIO_LIBERACAO_PAGAMENTO", "Relatório de liberação de pagamento", dominio, modulo)); | |
1002 | + internacionalizacaoList.add(new Internacionalizacao("CONTRATOS.LABEL.RELATORIO_REPACTUACAO", "Relatório de repactuação", dominio, modulo)); | |
1003 | + internacionalizacaoList.add(new Internacionalizacao("CONTRATOS.LABEL.RELATORIO_NAO_CONFORMIDADE", "Relatório de não conformidade", dominio, modulo)); | |
1004 | + internacionalizacaoList.add(new Internacionalizacao("CONTRATOS.LABEL.RELATORIO_PENALIDADE_APLICADA", "Relatório de penalidades aplicadas", dominio, modulo)); | |
1005 | + | |
1000 | 1006 | } |
1001 | 1007 | |
1002 | 1008 | private void gerarMensagem(Dominio dominio, Modulo modulo, List<Internacionalizacao> internacionalizacaoList) { | ... | ... |
cit-contratos-web/src/main/webapp/assets/js/angular/custom/controller/ConsultaRelatoriosController.js
... | ... | @@ -35,7 +35,7 @@ citApp.controller('ConsultaRelatoriosController', ['$scope', '$filter', '$timeou |
35 | 35 | }); |
36 | 36 | $scope.atualizaTiposRelatorioSelecionado(); |
37 | 37 | }; |
38 | - | |
38 | + | |
39 | 39 | $scope.atualizaTiposRelatorioSelecionado = function() { |
40 | 40 | $scope.isTiposRelatorioSelecionado = false; |
41 | 41 | angular.forEach($scope.tiposRelatorios, function (item) { |
... | ... | @@ -50,13 +50,20 @@ citApp.controller('ConsultaRelatoriosController', ['$scope', '$filter', '$timeou |
50 | 50 | |
51 | 51 | if($scope.consultaRelatoriosForm.$valid && $scope.isTiposRelatorioSelecionado) { |
52 | 52 | |
53 | - $scope.setLoadingSalva(true); | |
53 | + $scope.setLoading(true); | |
54 | + var idsRelatoriosSelecionados = ''; | |
55 | + angular.forEach($scope.tiposRelatorios, function(relatorio) { | |
56 | + if(relatorio.$selected){ | |
57 | + idsRelatoriosSelecionados += relatorio.id + ','; | |
58 | + } | |
59 | + }); | |
54 | 60 | |
55 | -// ContratoEventoRepository.gerarRelatorios(???).then(function(result) { | |
56 | -// }); | |
61 | + $scope.url = '/cit-contratos-web/rest/contratoEvento/pdfGerarRelatorios?idsTiposRelatorio=' | |
62 | + + idsRelatoriosSelecionados + '&idContrato=' + $scope.contrato.id + '&dataInicial=' + $scope.dataInicial + '&dataFinal=' + $scope.dataFinal; | |
63 | + $scope.visualizarRelatorio($scope.url,$translate.instant('CONTRATOS.LABEL.TERMOS')); | |
64 | + $scope.setLoadingGet(false); | |
57 | 65 | |
58 | - $scope.setLoading(false); | |
59 | - }else{ | |
66 | + } else { | |
60 | 67 | //Mensagem de erro de campos obrigatorios não preenchidos |
61 | 68 | $scope.showAlert('error', $translate.instant('VALIDACAO.ALERTA_OBRIGATORIOS'), " ", false); |
62 | 69 | } | ... | ... |
cit-contratos-web/src/main/webapp/html/consultaRelatorios/consultaRelatorios.html
0 → 100644
cit-contratos-web/src/main/webapp/html/consultaRelatorios/consultaRelatoriosList.html
... | ... | @@ -70,16 +70,7 @@ |
70 | 70 | <div class="row"> |
71 | 71 | <div class="col-sm-4"> |
72 | 72 | <div class="panel panel-default"> |
73 | - <div class="panel-heading clearfix"> | |
74 | - <!-- | |
75 | - <button title="{{$translate.instant('LABEL.REMOVER')}}" alt="{{$translate.instant('LABEL.REMOVER')}}" class="btn btn-clear" type="button" | |
76 | - ng-show="edit && programa.acoes.length > 0" ng-click="excluirAcoesSelecionados()"> | |
77 | - <i class="fa fa-times red"></i> | |
78 | - <translate>LABEL.REMOVER</translate> | |
79 | - </button> | |
80 | - --> | |
81 | - </div> | |
82 | - | |
73 | + | |
83 | 74 | <table class="table table-striped table-bordered table-hover"> |
84 | 75 | <thead> |
85 | 76 | <tr> | ... | ... |