Commit b4b11331ef2a24d4896f7631e72bdc5732bd984d

Authored by Ciro Junior
1 parent c8b72244
Exists in master

[Redmine #4115]

Adicionando relatorio de nao conformidades.
cit-contratos-api/src/main/java/br/com/centralit/api/dao/impl/RegistroOcorrenciaDaoHibernate.java
@@ -44,22 +44,17 @@ public class RegistroOcorrenciaDaoHibernate extends CitGenericDAOImpl implements @@ -44,22 +44,17 @@ public class RegistroOcorrenciaDaoHibernate extends CitGenericDAOImpl implements
44 return this.search(search, this.persistentClass); 44 return this.search(search, this.persistentClass);
45 } 45 }
46 46
  47 + @Override
47 public PersistentObject buscarUltimoRegistroPorDataEmissao(String property, Calendar dataEmissaoOcorrencia, Long idOrganizacao) { 48 public PersistentObject buscarUltimoRegistroPorDataEmissao(String property, Calendar dataEmissaoOcorrencia, Long idOrganizacao) {
48 49
49 int anoInformado = dataEmissaoOcorrencia.get(Calendar.YEAR); 50 int anoInformado = dataEmissaoOcorrencia.get(Calendar.YEAR);
50 51
51 Calendar dataInicial = Calendar.getInstance(); 52 Calendar dataInicial = Calendar.getInstance();
52 - dataInicial.set(anoInformado, Calendar.JANUARY, 1);  
53 - dataInicial.set(Calendar.HOUR_OF_DAY,00);  
54 - dataInicial.set(Calendar.MINUTE,00);  
55 - dataInicial.set(Calendar.SECOND,00); 53 + dataInicial.set(anoInformado, Calendar.JANUARY, 1, 00, 00, 00);
56 dataInicial.set(Calendar.MILLISECOND,0); 54 dataInicial.set(Calendar.MILLISECOND,0);
57 55
58 Calendar dataFinal = Calendar.getInstance(); 56 Calendar dataFinal = Calendar.getInstance();
59 - dataFinal.set(anoInformado, Calendar.DECEMBER, 31);  
60 - dataFinal.set(Calendar.HOUR_OF_DAY,23);  
61 - dataFinal.set(Calendar.MINUTE,59);  
62 - dataFinal.set(Calendar.SECOND,59); 57 + dataFinal.set(anoInformado, Calendar.DECEMBER, 31, 23, 59, 59);
63 dataFinal.set(Calendar.MILLISECOND,999); 58 dataFinal.set(Calendar.MILLISECOND,999);
64 59
65 Search search = new Search(); 60 Search search = new Search();
@@ -91,4 +86,4 @@ public class RegistroOcorrenciaDaoHibernate extends CitGenericDAOImpl implements @@ -91,4 +86,4 @@ public class RegistroOcorrenciaDaoHibernate extends CitGenericDAOImpl implements
91 return totalGlosa; 86 return totalGlosa;
92 } 87 }
93 88
94 -} 89 -}
  90 +}
95 \ No newline at end of file 91 \ No newline at end of file
cit-contratos-api/src/main/java/br/com/centralit/api/service/impl/EventoRegistroNaoConformidadeServiceImpl.java
1 package br.com.centralit.api.service.impl; 1 package br.com.centralit.api.service.impl;
2 2
  3 +import java.io.InputStream;
3 import java.sql.Connection; 4 import java.sql.Connection;
4 import java.text.SimpleDateFormat; 5 import java.text.SimpleDateFormat;
5 import java.util.ArrayList; 6 import java.util.ArrayList;
6 import java.util.Date; 7 import java.util.Date;
  8 +import java.util.HashMap;
7 import java.util.List; 9 import java.util.List;
  10 +import java.util.Map;
8 11
9 import net.sf.jasperreports.engine.JRException; 12 import net.sf.jasperreports.engine.JRException;
  13 +import net.sf.jasperreports.engine.JasperCompileManager;
  14 +import net.sf.jasperreports.engine.JasperFillManager;
10 import net.sf.jasperreports.engine.JasperPrint; 15 import net.sf.jasperreports.engine.JasperPrint;
  16 +import net.sf.jasperreports.engine.JasperReport;
  17 +import net.sf.jasperreports.engine.design.JasperDesign;
  18 +import net.sf.jasperreports.engine.xml.JRXmlLoader;
11 19
12 import org.apache.commons.lang3.StringUtils; 20 import org.apache.commons.lang3.StringUtils;
13 import org.springframework.beans.factory.annotation.Autowired; 21 import org.springframework.beans.factory.annotation.Autowired;
@@ -33,6 +41,7 @@ import br.com.centralit.framework.model.Dominio; @@ -33,6 +41,7 @@ import br.com.centralit.framework.model.Dominio;
33 import br.com.centralit.framework.model.Usuario; 41 import br.com.centralit.framework.model.Usuario;
34 import br.com.centralit.framework.service.arquitetura.GenericServiceImpl; 42 import br.com.centralit.framework.service.arquitetura.GenericServiceImpl;
35 import br.com.centralit.framework.util.UtilColecao; 43 import br.com.centralit.framework.util.UtilColecao;
  44 +import br.com.centralit.framework.util.UtilDataBase;
36 import br.com.centralit.framework.util.UtilObjeto; 45 import br.com.centralit.framework.util.UtilObjeto;
37 46
38 /** 47 /**
@@ -141,7 +150,7 @@ public class EventoRegistroNaoConformidadeServiceImpl extends GenericServiceImpl @@ -141,7 +150,7 @@ public class EventoRegistroNaoConformidadeServiceImpl extends GenericServiceImpl
141 } 150 }
142 151
143 if (!UtilColecao.isVazio(documento.getAnexos())){ 152 if (!UtilColecao.isVazio(documento.getAnexos())){
144 - Anexo anexo = (Anexo) ((List)documento.getAnexos()).get(0); 153 + Anexo anexo = ((List<Anexo>)documento.getAnexos()).get(0);
145 List<Anexo> listaAnexo = new ArrayList<Anexo>(); 154 List<Anexo> listaAnexo = new ArrayList<Anexo>();
146 listaAnexo.add(this.anexoService.getReference(anexo.getId())); 155 listaAnexo.add(this.anexoService.getReference(anexo.getId()));
147 documento.setAnexos(listaAnexo); 156 documento.setAnexos(listaAnexo);
@@ -170,9 +179,37 @@ public class EventoRegistroNaoConformidadeServiceImpl extends GenericServiceImpl @@ -170,9 +179,37 @@ public class EventoRegistroNaoConformidadeServiceImpl extends GenericServiceImpl
170 } 179 }
171 180
172 @Override 181 @Override
173 - public JasperPrint getJasperPrintRelatorioRegistroNaoConformidade(Long idContrato, Date dataInicial, Date dataFinal, 182 + public JasperPrint getJasperPrintRelatorioRegistroNaoConformidade(Long idContrato, Date dataInicial, Date dataFinal,
174 Connection conn, Usuario usuarioLogado, String titulo) throws JRException { 183 Connection conn, Usuario usuarioLogado, String titulo) throws JRException {
175 - // TODO Auto-generated method stub  
176 - return null; 184 +
  185 + InputStream input = null;
  186 + InputStream inputSub = null;
  187 + JasperPrint jasperPrint = null;
  188 + try {
  189 + input = this.getClass().getResourceAsStream("/reports/templateRetrato.jrxml");
  190 + inputSub = this.getClass().getResourceAsStream("/reports/relatorioEventoNaoConformidade.jrxml");
  191 +
  192 + JasperDesign jasperDesign = JRXmlLoader.load(input);
  193 + JasperDesign jasperDesignSub = JRXmlLoader.load(inputSub);
  194 + JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign);
  195 + JasperReport jasperReportSub = JasperCompileManager.compileReport(jasperDesignSub);
  196 +
  197 + Map<String, Object> subReportParameters = new HashMap<String, Object>();
  198 + subReportParameters.put("contratoId", idContrato);
  199 + subReportParameters.put("dataInicial", dataInicial);
  200 + subReportParameters.put("dataFinal", dataFinal);
  201 +
  202 + Map<String, Object> parameters = new HashMap<String, Object>();
  203 + parameters.put("ORGANIZACAO_ID", usuarioLogado.getOrganizacao().getId());
  204 + parameters.put("TITULO", titulo);
  205 + parameters.put("SUBREPORT_DIR", jasperReportSub);
  206 + parameters.put("SUBREPORT_PARAMETERS_MAP", subReportParameters);
  207 + parameters.put("REPORT_CONNECTION", conn);
  208 +
  209 + jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, conn);
  210 + } finally {
  211 + UtilDataBase.closeResources(inputSub);
  212 + }
  213 + return jasperPrint;
177 } 214 }
178 } 215 }
cit-contratos-web/src/main/java/br/com/centralit/controller/ContratoEventoController.java
@@ -136,8 +136,8 @@ public class ContratoEventoController extends GenericController&lt;ContratoEvento&gt; @@ -136,8 +136,8 @@ public class ContratoEventoController extends GenericController&lt;ContratoEvento&gt;
136 136
137 List<ContratoEventosVH> lista = new ArrayList<ContratoEventosVH>(); 137 List<ContratoEventosVH> lista = new ArrayList<ContratoEventosVH>();
138 138
139 - Date dataInicial = dataInicio != null ? UtilDate.jsonToDate(dataInicio) : null;  
140 - Date dateFinal = dataFim != null ? UtilDate.jsonToDate(dataFim) : null; 139 + Date dataInicial = StringUtils.isNotBlank(dataInicio) ? UtilDate.jsonToDate(dataInicio) : null;
  140 + Date dateFinal = StringUtils.isNotBlank(dataFim) ? UtilDate.jsonToDate(dataFim) : null;
141 141
142 Collection<ContratoEvento> listaEventos = this.contratoEventoService.findAllByContratoIntervalDataEmissao(contratoId, dataInicial, dateFinal); 142 Collection<ContratoEvento> listaEventos = this.contratoEventoService.findAllByContratoIntervalDataEmissao(contratoId, dataInicial, dateFinal);
143 143
@@ -224,17 +224,17 @@ public class ContratoEventoController extends GenericController&lt;ContratoEvento&gt; @@ -224,17 +224,17 @@ public class ContratoEventoController extends GenericController&lt;ContratoEvento&gt;
224 @ResponseBody 224 @ResponseBody
225 @RequestMapping(method = RequestMethod.GET, value = "/pdfGerarRelatorios") 225 @RequestMapping(method = RequestMethod.GET, value = "/pdfGerarRelatorios")
226 public void gerarRelatorios( 226 public void gerarRelatorios(
227 - @RequestParam(value = "idsTiposRelatorio") String idsRelatoriosSelecionados, 227 + @RequestParam(value = "idsTiposRelatorio") String idsRelatoriosSelecionados,
228 @RequestParam(value = "idContrato") Long idContrato, 228 @RequestParam(value = "idContrato") Long idContrato,
229 - @RequestParam(value = "dataInicial", required = false) String dataInicial, 229 + @RequestParam(value = "dataInicial", required = false) String dataInicial,
230 @RequestParam(value = "dataFinal", required = false) String dataFinal, 230 @RequestParam(value = "dataFinal", required = false) String dataFinal,
231 @RequestParam(value = "download") boolean download, HttpServletResponse response) throws SQLException, JRException, IOException { 231 @RequestParam(value = "download") boolean download, HttpServletResponse response) throws SQLException, JRException, IOException {
232 - 232 +
233 Long[] arrayLong = getArrayLong(idsRelatoriosSelecionados); 233 Long[] arrayLong = getArrayLong(idsRelatoriosSelecionados);
234 234
235 - Date dataInicio = StringUtils.isEmpty(dataInicial) || dataInicial.equalsIgnoreCase("null") ? null : UtilDate.jsonToDate(UtilDate.dataInicioFormatada(dataInicial));  
236 - Date dataFim = StringUtils.isEmpty(dataFinal) || dataFinal.equalsIgnoreCase("null") ? null : UtilDate.jsonToDate(UtilDate.dataInicioFormatada(dataFinal));  
237 - 235 + Date dataInicio = StringUtils.isBlank(dataInicial) ? null : UtilDate.jsonToDate(UtilDate.dataInicioFormatada(dataInicial));
  236 + Date dataFim = StringUtils.isBlank(dataFinal) ? null : UtilDate.jsonToDate(UtilDate.dataInicioFormatada(dataFinal));
  237 +
238 this.contratoEventoService.gerarRelatorios(arrayLong, idContrato, dataInicio, dataFim, download, response); 238 this.contratoEventoService.gerarRelatorios(arrayLong, idContrato, dataInicio, dataFim, download, response);
239 } 239 }
240 240
cit-contratos-web/src/main/resources/reports/relatorioEventoEmpenho.jrxml
1 <?xml version="1.0" encoding="UTF-8"?> 1 <?xml version="1.0" encoding="UTF-8"?>
2 <!-- Created with Jaspersoft Studio version 6.2.0.final using JasperReports Library version 6.2.0 --> 2 <!-- Created with Jaspersoft Studio version 6.2.0.final using JasperReports Library version 6.2.0 -->
3 -<!-- 2016-03-30T19:10:52 --> 3 +<!-- 2016-03-31T16:41:15 -->
4 <jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="relatorioEventoEmpenho" language="groovy" pageWidth="555" pageHeight="802" columnWidth="555" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" isFloatColumnFooter="true" whenResourceMissingType="Empty" uuid="d74b4c6b-2cfa-4211-acc4-a49eb0fe52fc"> 4 <jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="relatorioEventoEmpenho" language="groovy" pageWidth="555" pageHeight="802" columnWidth="555" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" isFloatColumnFooter="true" whenResourceMissingType="Empty" uuid="d74b4c6b-2cfa-4211-acc4-a49eb0fe52fc">
5 <property name="com.jaspersoft.studio.data.sql.tables" value=""/> 5 <property name="com.jaspersoft.studio.data.sql.tables" value=""/>
6 <property name="com.jaspersoft.studio.data.defaultdataadapter" value="citgrpdb"/> 6 <property name="com.jaspersoft.studio.data.defaultdataadapter" value="citgrpdb"/>
@@ -83,16 +83,16 @@ order by evEmpenho.id asc]]&gt; @@ -83,16 +83,16 @@ order by evEmpenho.id asc]]&gt;
83 contrato.numeroanocontrato as numeroanocontrato, 83 contrato.numeroanocontrato as numeroanocontrato,
84 (contrato.valorcontrato + 84 (contrato.valorcontrato +
85 (CASE WHEN 85 (CASE WHEN
86 -(SELECT count(valoraditivo) FROM cnt_ev_aditivo WHERE contratoaditivo_id = $P{contratoId} AND tipoalteracaovalor_id = (SELECT id FROM dominio WHERE chave = 'tipoAlteracaoValor' AND codigo = 1)) > 0 86 +(SELECT count(valoraditivo) FROM cnt_ev_aditivo WHERE contratoaditivo_id = evEmpenho.contrato_id AND tipoalteracaovalor_id = (SELECT id FROM dominio WHERE chave = 'tipoAlteracaoValor' AND codigo = 1)) > 0
87 THEN 87 THEN
88 -(SELECT sum(valoraditivo) FROM cnt_ev_aditivo WHERE contratoaditivo_id = $P{contratoId} AND tipoalteracaovalor_id = (SELECT id FROM dominio WHERE chave = 'tipoAlteracaoValor' AND codigo = 1)) 88 +(SELECT sum(valoraditivo) FROM cnt_ev_aditivo WHERE contratoaditivo_id = evEmpenho.contrato_id AND tipoalteracaovalor_id = (SELECT id FROM dominio WHERE chave = 'tipoAlteracaoValor' AND codigo = 1))
89 ELSE 0 89 ELSE 0
90 END) 90 END)
91 - 91 -
92 (CASE WHEN 92 (CASE WHEN
93 -(SELECT count(valoraditivo) FROM cnt_ev_aditivo WHERE contratoaditivo_id = $P{contratoId} AND tipoalteracaovalor_id = (SELECT id FROM dominio WHERE chave = 'tipoAlteracaoValor' AND codigo = 2)) > 0 93 +(SELECT count(valoraditivo) FROM cnt_ev_aditivo WHERE contratoaditivo_id = evEmpenho.contrato_id AND tipoalteracaovalor_id = (SELECT id FROM dominio WHERE chave = 'tipoAlteracaoValor' AND codigo = 2)) > 0
94 THEN 94 THEN
95 -(SELECT sum(valoraditivo) FROM cnt_ev_aditivo WHERE contratoaditivo_id = contrato.id AND tipoalteracaovalor_id = (SELECT id FROM dominio WHERE chave = 'tipoAlteracaoValor' AND codigo = 2)) 95 +(SELECT sum(valoraditivo) FROM cnt_ev_aditivo WHERE contratoaditivo_id = evEmpenho.contrato_id AND tipoalteracaovalor_id = (SELECT id FROM dominio WHERE chave = 'tipoAlteracaoValor' AND codigo = 2))
96 ELSE 0 96 ELSE 0
97 END)) as valorContrato 97 END)) as valorContrato
98 98
@@ -104,21 +104,16 @@ left join dominio as tipoEvento on tipoEvento.id = evEmpenho.tipoevento_id @@ -104,21 +104,16 @@ left join dominio as tipoEvento on tipoEvento.id = evEmpenho.tipoevento_id
104 104
105 where evEmpenho.contrato_id = $P{contratoId} and 105 where evEmpenho.contrato_id = $P{contratoId} and
106 tipoEvento.chave = 'tipoEventoContrato' and 106 tipoEvento.chave = 'tipoEventoContrato' and
107 -tipoEvento.codigo = '6']]> 107 +tipoEvento.codigo = '6'
  108 +
  109 +limit 1]]>
108 </queryString> 110 </queryString>
109 <field name="numeroanocontrato" class="java.lang.String"/> 111 <field name="numeroanocontrato" class="java.lang.String"/>
110 <field name="valorcontrato" class="java.math.BigDecimal"/> 112 <field name="valorcontrato" class="java.math.BigDecimal"/>
111 <pageHeader> 113 <pageHeader>
112 - <band height="79">  
113 - <staticText>  
114 - <reportElement x="0" y="6" width="555" height="30" uuid="bf46ddbd-7f34-4527-8170-6208b2527208"/>  
115 - <textElement textAlignment="Center" verticalAlignment="Middle">  
116 - <font size="16" isBold="true"/>  
117 - </textElement>  
118 - <text><![CDATA[Consulta de relatórios]]></text>  
119 - </staticText> 114 + <band height="83">
120 <staticText> 115 <staticText>
121 - <reportElement x="20" y="50" width="60" height="25" uuid="9ede57f9-e6f1-474e-b69b-f7962867927d"> 116 + <reportElement x="20" y="1" width="60" height="25" uuid="9ede57f9-e6f1-474e-b69b-f7962867927d">
122 <property name="com.jaspersoft.studio.unit.height" value="pixel"/> 117 <property name="com.jaspersoft.studio.unit.height" value="pixel"/>
123 </reportElement> 118 </reportElement>
124 <textElement textAlignment="Left" verticalAlignment="Middle"> 119 <textElement textAlignment="Left" verticalAlignment="Middle">
@@ -127,52 +122,79 @@ tipoEvento.codigo = &#39;6&#39;]]&gt; @@ -127,52 +122,79 @@ tipoEvento.codigo = &#39;6&#39;]]&gt;
127 <text><![CDATA[Período:]]></text> 122 <text><![CDATA[Período:]]></text>
128 </staticText> 123 </staticText>
129 <textField> 124 <textField>
130 - <reportElement x="80" y="50" width="475" height="25" uuid="0fe71459-79b7-429e-bd18-4309f83c70b3"> 125 + <reportElement x="80" y="1" width="475" height="25" uuid="0fe71459-79b7-429e-bd18-4309f83c70b3">
131 <property name="com.jaspersoft.studio.unit.height" value="pixel"/> 126 <property name="com.jaspersoft.studio.unit.height" value="pixel"/>
132 </reportElement> 127 </reportElement>
133 <textElement verticalAlignment="Middle"/> 128 <textElement verticalAlignment="Middle"/>
134 - <textFieldExpression><![CDATA[($P{dataInicial} == null && $P{dataFinal} == null) ? "Não informado" :  
135 -($P{dataInicial} == null ? "Não informado" : new SimpleDateFormat("dd/MM/yyyy").format($P{dataInicial})) + " à " +  
136 -($P{dataFinal} == null ? "Não informado" : new SimpleDateFormat("dd/MM/yyyy").format($P{dataFinal}))]]></textFieldExpression> 129 + <textFieldExpression><![CDATA[($P{dataInicial} != null && $P{dataFinal} != null) ? (new SimpleDateFormat("dd/MM/yyyy").format($P{dataInicial}) + " a " + new SimpleDateFormat("dd/MM/yyyy").format($P{dataFinal})) :
  130 +$P{dataInicial} != null ? "Apartir de " + new SimpleDateFormat("dd/MM/yyyy").format($P{dataInicial}) :
  131 +$P{dataFinal} != null ? "Até " + new SimpleDateFormat("dd/MM/yyyy").format($P{dataFinal}) :
  132 +"Não informado"]]></textFieldExpression>
137 </textField> 133 </textField>
138 - </band>  
139 - </pageHeader>  
140 - <detail>  
141 - <band height="155" splitType="Stretch">  
142 <staticText> 134 <staticText>
143 - <reportElement x="20" y="0" width="500" height="25" uuid="525f239d-ae8a-4237-adff-731b29b36af1">  
144 - <property name="com.jaspersoft.studio.unit.height" value="pixel"/> 135 + <reportElement x="20" y="26" width="160" height="25" uuid="29d0c9a4-2635-4ef8-b257-3e8d5d2006ec">
145 <property name="com.jaspersoft.studio.unit.x" value="pixel"/> 136 <property name="com.jaspersoft.studio.unit.x" value="pixel"/>
146 - <property name="com.jaspersoft.studio.unit.width" value="pixel"/> 137 + <property name="com.jaspersoft.studio.unit.height" value="pixel"/>
147 </reportElement> 138 </reportElement>
148 - <textElement textAlignment="Left" verticalAlignment="Middle"> 139 + <box padding="0"/>
  140 + <textElement verticalAlignment="Middle">
149 <font isBold="true"/> 141 <font isBold="true"/>
150 </textElement> 142 </textElement>
151 - <text><![CDATA[1. Relatório de registro de empenho]]></text> 143 + <text><![CDATA[Número / ano do contrato:]]></text>
152 </staticText> 144 </staticText>
  145 + <textField isBlankWhenNull="true">
  146 + <reportElement x="180" y="26" width="375" height="25" uuid="6492b8bb-061a-4c97-9f17-84773a127db4">
  147 + <property name="com.jaspersoft.studio.unit.height" value="pixel"/>
  148 + </reportElement>
  149 + <box padding="0"/>
  150 + <textElement textAlignment="Left" verticalAlignment="Middle"/>
  151 + <textFieldExpression><![CDATA[$F{numeroanocontrato}.substring(0, $F{numeroanocontrato}.length() - 4)
  152 +.concat("/")
  153 +.concat($F{numeroanocontrato}.substring($F{numeroanocontrato}.length() - 4))]]></textFieldExpression>
  154 + </textField>
153 <staticText> 155 <staticText>
154 - <reportElement x="20" y="25" width="160" height="25" uuid="29d0c9a4-2635-4ef8-b257-3e8d5d2006ec">  
155 - <property name="com.jaspersoft.studio.unit.x" value="pixel"/> 156 + <reportElement x="20" y="51" width="160" height="25" uuid="baf877b5-16f3-4e94-9bcb-623905f58c29">
156 <property name="com.jaspersoft.studio.unit.height" value="pixel"/> 157 <property name="com.jaspersoft.studio.unit.height" value="pixel"/>
157 </reportElement> 158 </reportElement>
158 <box padding="0"/> 159 <box padding="0"/>
159 - <textElement verticalAlignment="Middle"> 160 + <textElement textAlignment="Left" verticalAlignment="Middle">
160 <font isBold="true"/> 161 <font isBold="true"/>
161 </textElement> 162 </textElement>
162 - <text><![CDATA[Número / ano do contrato:]]></text> 163 + <text><![CDATA[Valor total do contrato:]]></text>
163 </staticText> 164 </staticText>
164 - <staticText>  
165 - <reportElement x="20" y="50" width="160" height="25" uuid="baf877b5-16f3-4e94-9bcb-623905f58c29"> 165 + <textField pattern="¤#,##0.00;¤-#,##0.00" isBlankWhenNull="true">
  166 + <reportElement x="180" y="51" width="375" height="25" uuid="61434fec-2f9f-4b7c-b53a-8c3c37744334">
166 <property name="com.jaspersoft.studio.unit.height" value="pixel"/> 167 <property name="com.jaspersoft.studio.unit.height" value="pixel"/>
167 </reportElement> 168 </reportElement>
168 <box padding="0"/> 169 <box padding="0"/>
  170 + <textElement textAlignment="Left" verticalAlignment="Middle"/>
  171 + <textFieldExpression><![CDATA[$F{valorcontrato}]]></textFieldExpression>
  172 + </textField>
  173 + <line>
  174 + <reportElement x="0" y="80" width="555" height="1" uuid="183040b3-7cc8-4d05-b417-03aa04eab538">
  175 + <property name="com.jaspersoft.studio.unit.height" value="pixel"/>
  176 + <property name="com.jaspersoft.studio.unit.width" value="pixel"/>
  177 + <property name="com.jaspersoft.studio.unit.x" value="pixel"/>
  178 + </reportElement>
  179 + </line>
  180 + </band>
  181 + </pageHeader>
  182 + <detail>
  183 + <band height="94" splitType="Stretch">
  184 + <property name="com.jaspersoft.studio.unit.height" value="pixel"/>
  185 + <staticText>
  186 + <reportElement x="20" y="5" width="535" height="25" uuid="525f239d-ae8a-4237-adff-731b29b36af1">
  187 + <property name="com.jaspersoft.studio.unit.height" value="pixel"/>
  188 + <property name="com.jaspersoft.studio.unit.x" value="pixel"/>
  189 + <property name="com.jaspersoft.studio.unit.width" value="pixel"/>
  190 + </reportElement>
169 <textElement textAlignment="Left" verticalAlignment="Middle"> 191 <textElement textAlignment="Left" verticalAlignment="Middle">
170 <font isBold="true"/> 192 <font isBold="true"/>
171 </textElement> 193 </textElement>
172 - <text><![CDATA[Valor total do contrato:]]></text> 194 + <text><![CDATA[1. Relatório de registro de empenho]]></text>
173 </staticText> 195 </staticText>
174 <componentElement> 196 <componentElement>
175 - <reportElement x="0" y="95" width="555" height="60" uuid="daece71a-c857-4368-833f-95e7841c2392"> 197 + <reportElement x="0" y="34" width="555" height="60" uuid="daece71a-c857-4368-833f-95e7841c2392">
176 <property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.VerticalRowLayout"/> 198 <property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.VerticalRowLayout"/>
177 <property name="net.sf.jasperreports.export.headertoolbar.table.name" value=""/> 199 <property name="net.sf.jasperreports.export.headertoolbar.table.name" value=""/>
178 </reportElement> 200 </reportElement>
@@ -355,24 +377,6 @@ tipoEvento.codigo = &#39;6&#39;]]&gt; @@ -355,24 +377,6 @@ tipoEvento.codigo = &#39;6&#39;]]&gt;
355 </jr:column> 377 </jr:column>
356 </jr:table> 378 </jr:table>
357 </componentElement> 379 </componentElement>
358 - <textField pattern="¤#,##0.00;¤-#,##0.00" isBlankWhenNull="true">  
359 - <reportElement x="180" y="50" width="160" height="25" uuid="61434fec-2f9f-4b7c-b53a-8c3c37744334">  
360 - <property name="com.jaspersoft.studio.unit.height" value="pixel"/>  
361 - </reportElement>  
362 - <box padding="0"/>  
363 - <textElement textAlignment="Left" verticalAlignment="Middle"/>  
364 - <textFieldExpression><![CDATA[$F{valorcontrato}]]></textFieldExpression>  
365 - </textField>  
366 - <textField isBlankWhenNull="true">  
367 - <reportElement x="180" y="25" width="160" height="25" uuid="6492b8bb-061a-4c97-9f17-84773a127db4">  
368 - <property name="com.jaspersoft.studio.unit.height" value="pixel"/>  
369 - </reportElement>  
370 - <box padding="0"/>  
371 - <textElement textAlignment="Left" verticalAlignment="Middle"/>  
372 - <textFieldExpression><![CDATA[$F{numeroanocontrato}.substring(0, $F{numeroanocontrato}.length() - 4)  
373 -.concat("/")  
374 -.concat($F{numeroanocontrato}.substring($F{numeroanocontrato}.length() - 4))]]></textFieldExpression>  
375 - </textField>  
376 </band> 380 </band>
377 </detail> 381 </detail>
378 </jasperReport> 382 </jasperReport>
cit-contratos-web/src/main/resources/reports/relatorioEventoNaoConformidade.jrxml 0 → 100644
@@ -0,0 +1,353 @@ @@ -0,0 +1,353 @@
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!-- Created with Jaspersoft Studio version 6.2.0.final using JasperReports Library version 6.2.0 -->
  3 +<!-- 2016-03-31T16:41:15 -->
  4 +<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="relatorioEventoNaoConformidade" pageWidth="555" pageHeight="802" columnWidth="555" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" uuid="78f13db4-6ced-46df-8bfd-074b8436fa4b">
  5 + <property name="com.jaspersoft.studio.data.sql.tables" value=""/>
  6 + <style name="Table_TH" mode="Opaque" backcolor="#A9A9A9">
  7 + <box>
  8 + <pen lineWidth="0.5" lineColor="#000000"/>
  9 + <topPen lineWidth="0.5" lineColor="#000000"/>
  10 + <leftPen lineWidth="0.5" lineColor="#000000"/>
  11 + <bottomPen lineWidth="0.5" lineColor="#000000"/>
  12 + <rightPen lineWidth="0.5" lineColor="#000000"/>
  13 + </box>
  14 + </style>
  15 + <style name="Table_CH" mode="Opaque" backcolor="#CCCCCC">
  16 + <box>
  17 + <pen lineWidth="0.5" lineColor="#000000"/>
  18 + <topPen lineWidth="0.5" lineColor="#000000"/>
  19 + <leftPen lineWidth="0.5" lineColor="#000000"/>
  20 + <bottomPen lineWidth="0.5" lineColor="#000000"/>
  21 + <rightPen lineWidth="0.5" lineColor="#000000"/>
  22 + </box>
  23 + </style>
  24 + <style name="Table_TD" mode="Opaque" backcolor="#FFFFFF">
  25 + <box>
  26 + <pen lineWidth="0.5" lineColor="#000000"/>
  27 + <topPen lineWidth="0.5" lineColor="#000000"/>
  28 + <leftPen lineWidth="0.5" lineColor="#000000"/>
  29 + <bottomPen lineWidth="0.5" lineColor="#000000"/>
  30 + <rightPen lineWidth="0.5" lineColor="#000000"/>
  31 + </box>
  32 + </style>
  33 + <subDataset name="naoConformidade" uuid="8d076663-9b03-4973-983c-475015a20c62">
  34 + <property name="com.jaspersoft.studio.data.defaultdataadapter" value="citgrpdb"/>
  35 + <property name="com.jaspersoft.studio.data.sql.tables" value=""/>
  36 + <parameter name="contratoId" class="java.lang.Long"/>
  37 + <parameter name="dataInicial" class="java.util.Date">
  38 + <parameterDescription><![CDATA[]]></parameterDescription>
  39 + </parameter>
  40 + <parameter name="dataFinal" class="java.util.Date">
  41 + <parameterDescription><![CDATA[]]></parameterDescription>
  42 + </parameter>
  43 + <parameter name="DATA_INICIAL" class="java.lang.String"/>
  44 + <parameter name="DATA_FINAL" class="java.lang.String"/>
  45 + <queryString>
  46 + <![CDATA[select
  47 +evNaoConformidade.datanaoconformidade as dataNaoConformidade,
  48 +trSancao.sancao as naoConformidadeAplicavel,
  49 +trSancao.descricao as descricao,
  50 +evNaoConformidade.respostacontratada as resposta
  51 +
  52 +from cnt_cn_evento as eventos
  53 +
  54 +left join cnt_ev_registro_nc as evNaoConformidade on evNaoConformidade.id = eventos.id
  55 +left join cnt_tr_sancao as trSancao on trSancao.id = evNaoConformidade.tiponaoconformidade_id
  56 +left join dominio as tipoEvento on tipoEvento.id = eventos.tipoevento_id
  57 +
  58 +where eventos.contrato_id = $P{contratoId}
  59 +and tipoEvento.chave = 'tipoEventoContrato' and tipoEvento.codigo = '7'
  60 +$P!{DATA_INICIAL}
  61 +$P!{DATA_FINAL}
  62 +
  63 +group by evNaoConformidade.id, trSancao.id, tipoEvento.id
  64 +order by evNaoConformidade.id]]>
  65 + </queryString>
  66 + <field name="datanaoconformidade" class="java.sql.Timestamp"/>
  67 + <field name="naoconformidadeaplicavel" class="java.lang.String"/>
  68 + <field name="descricao" class="java.lang.String"/>
  69 + <field name="resposta" class="java.lang.String"/>
  70 + </subDataset>
  71 + <parameter name="contratoId" class="java.lang.Long"/>
  72 + <parameter name="dataInicial" class="java.util.Date">
  73 + <parameterDescription><![CDATA[]]></parameterDescription>
  74 + </parameter>
  75 + <parameter name="dataFinal" class="java.util.Date"/>
  76 + <parameter name="DATA_INICIAL" class="java.lang.String" isForPrompting="false">
  77 + <defaultValueExpression><![CDATA[($P{dataInicial} != null ? " and eventos.dataevento <= '" + $P{dataInicial} + "'" : "")]]></defaultValueExpression>
  78 + </parameter>
  79 + <parameter name="DATA_FINAL" class="java.lang.String" isForPrompting="false">
  80 + <defaultValueExpression><![CDATA[($P{dataFinal} != null ? " and eventos.dataevento <= '" + $P{dataFinal} + "'" : "")]]></defaultValueExpression>
  81 + </parameter>
  82 + <queryString>
  83 + <![CDATA[select
  84 +contrato.numeroanocontrato as numeroanocontrato
  85 +
  86 +from cnt_cn_evento as eventos
  87 +
  88 +left join cnt_contrato as contrato on contrato.id = eventos.contrato_id
  89 +left join dominio as tipoEvento on tipoEvento.id = eventos.tipoevento_id
  90 +
  91 +where eventos.contrato_id = $P{contratoId}
  92 +and tipoEvento.chave = 'tipoEventoContrato'
  93 +and tipoEvento.codigo = '7'
  94 +
  95 +group by contrato.id, tipoEvento.id, eventos.id
  96 +limit 1]]>
  97 + </queryString>
  98 + <field name="numeroanocontrato" class="java.lang.String"/>
  99 + <pageHeader>
  100 + <band height="58" splitType="Stretch">
  101 + <staticText>
  102 + <reportElement x="20" y="2" width="60" height="25" uuid="967d8fd8-d42e-4294-ae3f-8e9e9cc75a11">
  103 + <property name="com.jaspersoft.studio.unit.width" value="pixel"/>
  104 + <property name="com.jaspersoft.studio.unit.height" value="pixel"/>
  105 + <property name="com.jaspersoft.studio.unit.x" value="pixel"/>
  106 + <property name="com.jaspersoft.studio.unit.y" value="pixel"/>
  107 + </reportElement>
  108 + <textElement textAlignment="Left" verticalAlignment="Middle">
  109 + <font isBold="true"/>
  110 + </textElement>
  111 + <text><![CDATA[Período:]]></text>
  112 + </staticText>
  113 + <staticText>
  114 + <reportElement x="20" y="27" width="160" height="25" uuid="a6eead87-8e02-41a7-9499-59b318edef85">
  115 + <property name="com.jaspersoft.studio.unit.x" value="pixel"/>
  116 + <property name="com.jaspersoft.studio.unit.height" value="pixel"/>
  117 + </reportElement>
  118 + <box padding="0"/>
  119 + <textElement textAlignment="Left" verticalAlignment="Middle">
  120 + <font isBold="true"/>
  121 + </textElement>
  122 + <text><![CDATA[Número / ano do contrato:]]></text>
  123 + </staticText>
  124 + <textField isBlankWhenNull="true">
  125 + <reportElement x="180" y="27" width="375" height="25" uuid="a0057589-19f8-437d-b135-9da3b94a8f28">
  126 + <property name="com.jaspersoft.studio.unit.height" value="pixel"/>
  127 + </reportElement>
  128 + <box padding="0"/>
  129 + <textElement textAlignment="Left" verticalAlignment="Middle"/>
  130 + <textFieldExpression><![CDATA[$F{numeroanocontrato}.substring(0, $F{numeroanocontrato}.length() - 4)
  131 +.concat("/")
  132 +.concat($F{numeroanocontrato}.substring($F{numeroanocontrato}.length() - 4))]]></textFieldExpression>
  133 + </textField>
  134 + <line>
  135 + <reportElement x="0" y="57" width="555" height="1" uuid="d11d5dc2-5b37-419a-a86c-53f374300d94">
  136 + <property name="com.jaspersoft.studio.unit.height" value="pixel"/>
  137 + </reportElement>
  138 + </line>
  139 + <textField>
  140 + <reportElement x="80" y="2" width="475" height="25" uuid="1fb03a9d-ef90-4c2f-8da0-c9d02834b531">
  141 + <property name="com.jaspersoft.studio.unit.height" value="pixel"/>
  142 + </reportElement>
  143 + <textElement verticalAlignment="Middle"/>
  144 + <textFieldExpression><![CDATA[($P{dataInicial} != null && $P{dataFinal} != null) ? (new SimpleDateFormat("dd/MM/yyyy").format($P{dataInicial}) + " a " + new SimpleDateFormat("dd/MM/yyyy").format($P{dataFinal})) :
  145 +$P{dataInicial} != null ? "Apartir de " + new SimpleDateFormat("dd/MM/yyyy").format($P{dataInicial}) :
  146 +$P{dataFinal} != null ? "Até " + new SimpleDateFormat("dd/MM/yyyy").format($P{dataFinal}) :
  147 +"Não informado"]]></textFieldExpression>
  148 + </textField>
  149 + </band>
  150 + </pageHeader>
  151 + <detail>
  152 + <band height="110" splitType="Stretch">
  153 + <staticText>
  154 + <reportElement x="20" y="0" width="535" height="25" uuid="699d764a-311e-4534-8606-9f3589ef7aa8">
  155 + <property name="com.jaspersoft.studio.unit.height" value="pixel"/>
  156 + <property name="com.jaspersoft.studio.unit.x" value="pixel"/>
  157 + <property name="com.jaspersoft.studio.unit.width" value="pixel"/>
  158 + </reportElement>
  159 + <textElement textAlignment="Left" verticalAlignment="Middle">
  160 + <font isBold="true"/>
  161 + </textElement>
  162 + <text><![CDATA[1. Relatório de registro de empenho]]></text>
  163 + </staticText>
  164 + <componentElement>
  165 + <reportElement x="0" y="50" width="555" height="60" uuid="687f8495-5035-426f-8cde-dfbd8bfae41d">
  166 + <property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.VerticalRowLayout"/>
  167 + </reportElement>
  168 + <jr:table xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd">
  169 + <datasetRun subDataset="naoConformidade" uuid="cb840415-cc30-4246-bf34-2ce599102802">
  170 + <datasetParameter name="REPORT_CONNECTION">
  171 + <datasetParameterExpression><![CDATA[$P{REPORT_CONNECTION}]]></datasetParameterExpression>
  172 + </datasetParameter>
  173 + <datasetParameter name="contratoId">
  174 + <datasetParameterExpression><![CDATA[$P{contratoId}]]></datasetParameterExpression>
  175 + </datasetParameter>
  176 + <datasetParameter name="dataInicial">
  177 + <datasetParameterExpression><![CDATA[$P{dataInicial}]]></datasetParameterExpression>
  178 + </datasetParameter>
  179 + <datasetParameter name="dataFinal">
  180 + <datasetParameterExpression><![CDATA[$P{dataFinal}]]></datasetParameterExpression>
  181 + </datasetParameter>
  182 + <datasetParameter name="DATA_INICIAL">
  183 + <datasetParameterExpression><![CDATA[$P{DATA_INICIAL}]]></datasetParameterExpression>
  184 + </datasetParameter>
  185 + <datasetParameter name="DATA_FINAL">
  186 + <datasetParameterExpression><![CDATA[$P{DATA_FINAL}]]></datasetParameterExpression>
  187 + </datasetParameter>
  188 + <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
  189 + </datasetRun>
  190 + <jr:column width="90" uuid="407635d7-42da-4179-9431-a025caf11fbd">
  191 + <property name="com.jaspersoft.studio.components.table.model.column.name" value="Column1"/>
  192 + <property name="com.jaspersoft.studio.unit.width" value="pixel"/>
  193 + <jr:columnHeader style="Table_CH" height="30" rowSpan="1">
  194 + <property name="com.jaspersoft.studio.unit.width" value="px"/>
  195 + <staticText>
  196 + <reportElement x="0" y="0" width="90" height="30" uuid="1f98eb0c-6f4a-4af7-9425-586f89befa01"/>
  197 + <box padding="0">
  198 + <topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  199 + <leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  200 + <bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  201 + <rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  202 + </box>
  203 + <textElement textAlignment="Center" verticalAlignment="Middle">
  204 + <font isBold="true"/>
  205 + </textElement>
  206 + <text><![CDATA[Data]]></text>
  207 + </staticText>
  208 + </jr:columnHeader>
  209 + <jr:detailCell style="Table_TD" height="30">
  210 + <box padding="0">
  211 + <topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  212 + <leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  213 + <bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  214 + <rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  215 + </box>
  216 + <textField isStretchWithOverflow="true" isBlankWhenNull="true">
  217 + <reportElement x="0" y="0" width="90" height="30" isPrintWhenDetailOverflows="true" uuid="17e1d601-2f4b-4a1f-b380-1494c8286bb0"/>
  218 + <box padding="3">
  219 + <topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  220 + <leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  221 + <bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  222 + <rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  223 + </box>
  224 + <textElement textAlignment="Center" verticalAlignment="Middle"/>
  225 + <textFieldExpression><![CDATA[new SimpleDateFormat("dd/MM/yyyy").format($F{datanaoconformidade})]]></textFieldExpression>
  226 + </textField>
  227 + </jr:detailCell>
  228 + </jr:column>
  229 + <jr:column width="100" uuid="0283b8c0-e839-4788-b019-aaece0882599">
  230 + <property name="com.jaspersoft.studio.components.table.model.column.name" value="Column2"/>
  231 + <property name="com.jaspersoft.studio.unit.width" value="pixel"/>
  232 + <jr:columnHeader style="Table_CH" height="30" rowSpan="1">
  233 + <property name="com.jaspersoft.studio.unit.width" value="px"/>
  234 + <staticText>
  235 + <reportElement x="0" y="0" width="100" height="30" uuid="974e758a-8bf7-4952-999f-ce9618f47caa"/>
  236 + <box padding="0">
  237 + <topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  238 + <leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  239 + <bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  240 + <rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  241 + </box>
  242 + <textElement textAlignment="Center" verticalAlignment="Middle">
  243 + <font isBold="true"/>
  244 + </textElement>
  245 + <text><![CDATA[Não conformidade aplicável]]></text>
  246 + </staticText>
  247 + </jr:columnHeader>
  248 + <jr:detailCell style="Table_TD" height="30">
  249 + <property name="com.jaspersoft.studio.unit.width" value="px"/>
  250 + <box padding="0">
  251 + <topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  252 + <leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  253 + <bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  254 + <rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  255 + </box>
  256 + <textField isStretchWithOverflow="true" isBlankWhenNull="true">
  257 + <reportElement x="0" y="0" width="100" height="30" isPrintWhenDetailOverflows="true" uuid="210d7971-8daf-455b-a85c-321bda7fb0b5"/>
  258 + <box padding="3">
  259 + <topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  260 + <leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  261 + <bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  262 + <rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  263 + </box>
  264 + <textElement textAlignment="Left" verticalAlignment="Middle"/>
  265 + <textFieldExpression><![CDATA[$F{naoconformidadeaplicavel}]]></textFieldExpression>
  266 + </textField>
  267 + </jr:detailCell>
  268 + </jr:column>
  269 + <jr:column width="182" uuid="c1974531-3543-43df-aa80-bb50a6da10fe">
  270 + <property name="com.jaspersoft.studio.components.table.model.column.name" value="Column3"/>
  271 + <property name="com.jaspersoft.studio.unit.width" value="pixel"/>
  272 + <jr:columnHeader style="Table_CH" height="30" rowSpan="1">
  273 + <property name="com.jaspersoft.studio.unit.width" value="px"/>
  274 + <staticText>
  275 + <reportElement x="0" y="0" width="182" height="30" uuid="861458cb-d5e8-4899-a0e7-2bfb6a35cfd2"/>
  276 + <box padding="0">
  277 + <topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  278 + <leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  279 + <bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  280 + <rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  281 + </box>
  282 + <textElement textAlignment="Center" verticalAlignment="Middle">
  283 + <font isBold="true"/>
  284 + </textElement>
  285 + <text><![CDATA[Descrição]]></text>
  286 + </staticText>
  287 + </jr:columnHeader>
  288 + <jr:detailCell style="Table_TD" height="30">
  289 + <property name="com.jaspersoft.studio.unit.width" value="px"/>
  290 + <box padding="0">
  291 + <topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  292 + <leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  293 + <bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  294 + <rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  295 + </box>
  296 + <textField isStretchWithOverflow="true" isBlankWhenNull="true">
  297 + <reportElement x="0" y="0" width="182" height="30" isPrintWhenDetailOverflows="true" uuid="9fb27778-d8ca-4ca3-8050-afbf4ef71f2e"/>
  298 + <box padding="3">
  299 + <topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  300 + <leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  301 + <bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  302 + <rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  303 + </box>
  304 + <textElement textAlignment="Left" verticalAlignment="Middle"/>
  305 + <textFieldExpression><![CDATA[$F{descricao}]]></textFieldExpression>
  306 + </textField>
  307 + </jr:detailCell>
  308 + </jr:column>
  309 + <jr:column width="182" uuid="1a9d9d9a-960c-4941-9117-8661ba8362bf">
  310 + <property name="com.jaspersoft.studio.components.table.model.column.name" value="Column4"/>
  311 + <property name="com.jaspersoft.studio.unit.width" value="pixel"/>
  312 + <jr:columnHeader style="Table_CH" height="30" rowSpan="1">
  313 + <property name="com.jaspersoft.studio.unit.width" value="px"/>
  314 + <staticText>
  315 + <reportElement x="0" y="0" width="182" height="30" uuid="88c4c49d-2a32-4a3b-afd4-99977d3a707b"/>
  316 + <box padding="0">
  317 + <topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  318 + <leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  319 + <bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  320 + <rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  321 + </box>
  322 + <textElement textAlignment="Center" verticalAlignment="Middle">
  323 + <font isBold="true"/>
  324 + </textElement>
  325 + <text><![CDATA[Resposta da contratada]]></text>
  326 + </staticText>
  327 + </jr:columnHeader>
  328 + <jr:detailCell style="Table_TD" height="30">
  329 + <property name="com.jaspersoft.studio.unit.width" value="px"/>
  330 + <box padding="0">
  331 + <topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  332 + <leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  333 + <bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  334 + <rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  335 + </box>
  336 + <textField isStretchWithOverflow="true" isBlankWhenNull="true">
  337 + <reportElement x="0" y="0" width="182" height="30" isPrintWhenDetailOverflows="true" uuid="8578f83b-3f28-4045-bbb5-9981bf617ee4"/>
  338 + <box padding="3">
  339 + <topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  340 + <leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  341 + <bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  342 + <rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
  343 + </box>
  344 + <textElement textAlignment="Left" verticalAlignment="Middle"/>
  345 + <textFieldExpression><![CDATA[$F{resposta}]]></textFieldExpression>
  346 + </textField>
  347 + </jr:detailCell>
  348 + </jr:column>
  349 + </jr:table>
  350 + </componentElement>
  351 + </band>
  352 + </detail>
  353 +</jasperReport>
cit-contratos-web/src/main/webapp/assets/js/angular/custom/controller/ConsultaRelatoriosController.js
@@ -59,25 +59,28 @@ citApp.controller(&#39;ConsultaRelatoriosController&#39;, [&#39;$scope&#39;, &#39;$filter&#39;, &#39;$timeou @@ -59,25 +59,28 @@ citApp.controller(&#39;ConsultaRelatoriosController&#39;, [&#39;$scope&#39;, &#39;$filter&#39;, &#39;$timeou
59 } 59 }
60 } 60 }
61 $scope.setLoadingGet(true); 61 $scope.setLoadingGet(true);
62 - if($scope.consultaRelatoriosForm.$valid && $scope.isTiposRelatorioSelecionado) {  
63 -  
64 - var idsRelatoriosSelecionados = '';  
65 - angular.forEach($scope.tiposRelatorios, function(relatorio) {  
66 - if(relatorio.$selected){  
67 - idsRelatoriosSelecionados += relatorio.id + ',';  
68 - }  
69 - });  
70 -  
71 - $scope.url = '/cit-contratos-web/rest/contratoEvento/pdfGerarRelatorios?idsTiposRelatorio='  
72 - + idsRelatoriosSelecionados + '&idContrato=' + $scope.contrato.id + '&dataInicial=' + $scope.dataInicial + '&dataFinal=' + $scope.dataFinal;  
73 - $scope.visualizarRelatorio($scope.url, $translate.instant('CONTRATOS.LABEL.RELATORIOS'));  
74 - $scope.setLoading(false);  
75 -  
76 - } else { 62 + if($scope.consultaRelatoriosForm.$invalid && !$scope.isTiposRelatorioSelecionado) {
77 $scope.setLoading(false); 63 $scope.setLoading(false);
78 //Mensagem de erro de campos obrigatorios não preenchidos 64 //Mensagem de erro de campos obrigatorios não preenchidos
79 $scope.showAlert('error', $translate.instant('VALIDACAO.ALERTA_OBRIGATORIOS'), " ", false); 65 $scope.showAlert('error', $translate.instant('VALIDACAO.ALERTA_OBRIGATORIOS'), " ", false);
  66 + return;
80 } 67 }
  68 + var idsRelatoriosSelecionados = '';
  69 + angular.forEach($scope.tiposRelatorios, function(relatorio) {
  70 + if(relatorio.$selected){
  71 + idsRelatoriosSelecionados += relatorio.id + ',';
  72 + }
  73 + });
  74 +
  75 + var dataInicial = $scope.dataInicial == null ? '' : $scope.dataInicial;
  76 + var dataFinal = $scope.dataFinal == null ? '' : $scope.dataFinal;
  77 + $scope.url = '/cit-contratos-web/rest/contratoEvento/pdfGerarRelatorios?' +
  78 + 'idsTiposRelatorio='+ idsRelatoriosSelecionados +
  79 + '&idContrato=' + $scope.contrato.id +
  80 + '&dataInicial=' + dataInicial +
  81 + '&dataFinal=' + dataFinal;
  82 + $scope.visualizarRelatorio($scope.url, $translate.instant('CONTRATOS.LABEL.RELATORIOS'));
  83 + $scope.setLoading(false);
81 }; 84 };
82 85
83 }]); 86 }]);
84 \ No newline at end of file 87 \ No newline at end of file