Commit 3a88e82168bad6b6d53771c8bf8e1d9e9ac6a120
1 parent
875701b7
Exists in
master
Redmine #tarefa-4936
Showing
7 changed files
with
45 additions
and
27 deletions
Show diff stats
cit-almoxarifado-api/src/main/java/br/com/centralit/api/dao/RequisicaoConsumoDao.java
... | ... | @@ -8,6 +8,7 @@ import br.com.centralit.api.model.MaterialConsumo; |
8 | 8 | import br.com.centralit.api.model.RequisicaoConsumo; |
9 | 9 | import br.com.centralit.api.viewHelper.RequisicaoVH; |
10 | 10 | import br.com.centralit.framework.dao.arquitetura.CitGenericDAO; |
11 | +import br.com.centralit.framework.model.Dominio; | |
11 | 12 | |
12 | 13 | /** |
13 | 14 | * <p> |
... | ... | @@ -110,4 +111,5 @@ public interface RequisicaoConsumoDao extends CitGenericDAO { |
110 | 111 | * @return |
111 | 112 | */ |
112 | 113 | RequisicaoConsumo findRequisicaoAnteriorPorMaterial(MaterialConsumo materialConsumo, EstruturaOrganizacional unidadeRequisitante); |
114 | + | |
113 | 115 | } | ... | ... |
cit-almoxarifado-api/src/main/java/br/com/centralit/api/dao/impl/RequisicaoConsumoDaoHibernate.java
... | ... | @@ -19,6 +19,7 @@ import br.com.centralit.api.model.RequisicaoConsumoItem; |
19 | 19 | import br.com.centralit.api.viewHelper.RequisicaoVH; |
20 | 20 | import br.com.centralit.framework.dao.arquitetura.CitGenericDAOImpl; |
21 | 21 | import br.com.centralit.framework.dao.arquitetura.SearchSeven; |
22 | +import br.com.centralit.framework.model.Dominio; | |
22 | 23 | import br.com.centralit.framework.util.UtilColecao; |
23 | 24 | import br.com.centralit.framework.util.UtilObjeto; |
24 | 25 | import br.com.centralit.framework.util.UtilString; | ... | ... |
cit-almoxarifado-api/src/main/java/br/com/centralit/api/service/RequisicaoConsumoService.java
... | ... | @@ -7,6 +7,7 @@ import br.com.centralit.api.model.EstruturaOrganizacional; |
7 | 7 | import br.com.centralit.api.model.MaterialConsumo; |
8 | 8 | import br.com.centralit.api.model.RequisicaoConsumo; |
9 | 9 | import br.com.centralit.api.viewHelper.RequisicaoVH; |
10 | +import br.com.centralit.framework.model.Dominio; | |
10 | 11 | import br.com.centralit.framework.service.arquitetura.GenericService; |
11 | 12 | |
12 | 13 | /** | ... | ... |
cit-almoxarifado-api/src/main/java/br/com/centralit/api/service/impl/RequisicaoConsumoServiceImpl.java
cit-almoxarifado-web/src/main/java/br/com/centralit/controller/BeanRequisicaoSubReport.java
... | ... | @@ -24,8 +24,8 @@ public class BeanRequisicaoSubReport { |
24 | 24 | this.requisitante = (String) objArray[4]; |
25 | 25 | this.atendidaPor = (String) objArray[5]; |
26 | 26 | this.centroCustos = (String) objArray[6]; |
27 | - this.atendidaEm = UtilDate.formatarData(objArray[7]); | |
28 | - this.cadEm = UtilDate.formatarData(objArray[8]); | |
27 | + this.cadEm = UtilDate.formatarData(objArray[7]); | |
28 | + this.atendidaEm = UtilDate.formatarData(objArray[8]); | |
29 | 29 | } |
30 | 30 | |
31 | 31 | public String getNumeroRequisicao() { | ... | ... |
cit-almoxarifado-web/src/main/java/br/com/centralit/controller/ReportGuiaRemessaAtendimentoConsumoController.java
... | ... | @@ -30,6 +30,7 @@ import org.springframework.web.bind.annotation.RequestParam; |
30 | 30 | import org.springframework.web.bind.annotation.ResponseBody; |
31 | 31 | |
32 | 32 | import br.com.centralit.api.model.Entrada; |
33 | +import br.com.centralit.api.model.RequisicaoConsumo; | |
33 | 34 | import br.com.centralit.api.service.ConfiguracaoParametroSistemaService; |
34 | 35 | import br.com.centralit.api.service.ConfiguracaoService; |
35 | 36 | import br.com.centralit.api.service.DominioService; |
... | ... | @@ -76,6 +77,9 @@ public class ReportGuiaRemessaAtendimentoConsumoController extends GenericContro |
76 | 77 | private InternacionalizacaoService internacionalizacaoService; |
77 | 78 | |
78 | 79 | @Autowired |
80 | + private RequisicaoConsumoService requisicaoConsumoService; | |
81 | + | |
82 | + @Autowired | |
79 | 83 | private ConfiguracaoService configuracaoService; |
80 | 84 | |
81 | 85 | @Autowired |
... | ... | @@ -128,6 +132,8 @@ public class ReportGuiaRemessaAtendimentoConsumoController extends GenericContro |
128 | 132 | try { |
129 | 133 | AV_MONETARIA = configuracaoParametroSistemaService.getParametro("TIPO_AVALIACAO_MONETARIA_ESTOQUE").getValor(); |
130 | 134 | |
135 | + final String tipoStatusRequisicao = (String)requisicaoConsumoService.singleResultNativeQuery("select nome from alm_requisicaoconsumo req left join dominio as dominio on dominio.id = req.tipostatusrequisicao_id where req.id = "+requisicaoId); | |
136 | + | |
131 | 137 | Usuario usuarioLogado = (Usuario) usuarioService.find(((Usuario) SecurityContextHolder.getContext().getAuthentication().getPrincipal() ).getId()); |
132 | 138 | Long organizacaoId = usuarioLogado.getOrganizacao().getId(); |
133 | 139 | input = this.getClass().getResourceAsStream("/reports/templatePaisagemRepeat.jrxml"); |
... | ... | @@ -160,6 +166,7 @@ public class ReportGuiaRemessaAtendimentoConsumoController extends GenericContro |
160 | 166 | |
161 | 167 | parameters.put("BEAN_SUB_REPORT",new JRBeanCollectionDataSource(beanReqSubList)); |
162 | 168 | parametersSubReport.put("REQ_CONSUMO", getResumoContabil(requisicaoId)); |
169 | + parametersSubReport.put("is_asterisco",!tipoStatusRequisicao.equals("ATENDIDA")); | |
163 | 170 | |
164 | 171 | parameters.put("SUBREPORT_PARAMETERS_MAP",parametersSubReport); |
165 | 172 | ... | ... |
cit-almoxarifado-web/src/main/resources/reports/guiaRemessaAtendimentoConsumoMaterial.jrxml
1 | 1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | -<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="guiaRemessa" language="groovy" pageWidth="802" pageHeight="555" orientation="Landscape" columnWidth="802" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" uuid="ad8f14cf-4bc6-4008-beb0-a366c90e1c3f"> | |
2 | +<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="guiaRemessa" pageWidth="802" pageHeight="555" orientation="Landscape" columnWidth="802" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" uuid="ad8f14cf-4bc6-4008-beb0-a366c90e1c3f"> | |
3 | 3 | <property name="ireport.zoom" value="1.3636363636363635"/> |
4 | 4 | <property name="ireport.x" value="0"/> |
5 | 5 | <property name="ireport.y" value="0"/> |
... | ... | @@ -64,6 +64,7 @@ |
64 | 64 | </box> |
65 | 65 | </style> |
66 | 66 | <subDataset name="materiais" uuid="b41cbe9c-3e55-4766-aa1c-a4fd2f482b42"> |
67 | + <parameter name="is_asterisco" class="java.lang.Boolean"/> | |
67 | 68 | <field name="item" class="java.lang.Integer"/> |
68 | 69 | <field name="nome" class="java.lang.String"/> |
69 | 70 | <field name="unidade" class="java.lang.String"/> |
... | ... | @@ -98,6 +99,7 @@ |
98 | 99 | <parameter name="codigoOrganizacao" class="java.lang.String"/> |
99 | 100 | <parameter name="SUBREPORT_GUIA_REMESSA_DIR" class="java.lang.Object"/> |
100 | 101 | <parameter name="REQ_CONSUMO" class="java.lang.Object" isForPrompting="false"/> |
102 | + <parameter name="is_asterisco" class="java.lang.Boolean"/> | |
101 | 103 | <queryString language="SQL"> |
102 | 104 | <![CDATA[]]> |
103 | 105 | </queryString> |
... | ... | @@ -117,11 +119,14 @@ |
117 | 119 | <group name="materiais"> |
118 | 120 | <groupExpression><![CDATA[$P{REQ_CONSUMO}]]></groupExpression> |
119 | 121 | <groupHeader> |
120 | - <band height="50"> | |
122 | + <band height="36"> | |
121 | 123 | <componentElement> |
122 | 124 | <reportElement key="tableMateriais" style="table 1" x="0" y="0" width="792" height="35" uuid="663710cd-ac4c-4c98-befa-db08105f0c5c"/> |
123 | 125 | <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"> |
124 | - <datasetRun subDataset="materiais" uuid="be7a6527-2715-455b-a126-1984beb4e72c"> | |
126 | + <datasetRun subDataset="materiais" uuid="4dc261e1-e4b1-4d0b-87fd-854cc68a637f"> | |
127 | + <datasetParameter name="is_asterisco"> | |
128 | + <datasetParameterExpression><![CDATA[$P{is_asterisco}]]></datasetParameterExpression> | |
129 | + </datasetParameter> | |
125 | 130 | <dataSourceExpression><![CDATA[$F{materiais}]]></dataSourceExpression> |
126 | 131 | </datasetRun> |
127 | 132 | <jr:column width="30" uuid="32eac3fb-5bb0-47e2-8ac0-1510fe6d3b93"> |
... | ... | @@ -310,19 +315,13 @@ |
310 | 315 | </jr:column> |
311 | 316 | <jr:column width="70" uuid="04b2e9e5-8727-4d8c-b587-b5877584771a"> |
312 | 317 | <jr:columnHeader style="table 1" height="20" rowSpan="1"> |
313 | - <staticText> | |
314 | - <reportElement x="0" y="0" width="70" height="20" uuid="b7198712-f444-4fd2-82c2-2e11779f2c29"/> | |
315 | - <box> | |
316 | - <topPen lineWidth="0.25"/> | |
317 | - <leftPen lineWidth="0.25"/> | |
318 | - <bottomPen lineWidth="0.25"/> | |
319 | - <rightPen lineWidth="0.25"/> | |
320 | - </box> | |
318 | + <textField isBlankWhenNull="true"> | |
319 | + <reportElement x="0" y="0" width="70" height="20" uuid="d3204721-2c8f-4b99-9450-70a37ab78679"/> | |
321 | 320 | <textElement textAlignment="Center" verticalAlignment="Middle"> |
322 | 321 | <font size="7" isBold="true"/> |
323 | 322 | </textElement> |
324 | - <text><![CDATA[Preço Unitario]]></text> | |
325 | - </staticText> | |
323 | + <textFieldExpression><![CDATA[($P{is_asterisco} ? "* " : "")+"Preço Unitário" ]]></textFieldExpression> | |
324 | + </textField> | |
326 | 325 | </jr:columnHeader> |
327 | 326 | <jr:detailCell style="table 1" height="15" rowSpan="1"> |
328 | 327 | <textField isBlankWhenNull="true"> |
... | ... | @@ -336,19 +335,13 @@ |
336 | 335 | </jr:column> |
337 | 336 | <jr:column width="70" uuid="0c419f29-aeb5-4812-ae92-e8e864d4b849"> |
338 | 337 | <jr:columnHeader style="table 1" height="20" rowSpan="1"> |
339 | - <staticText> | |
340 | - <reportElement x="0" y="0" width="70" height="20" uuid="b553dba2-4cca-4f4a-bf39-e4591029b344"/> | |
341 | - <box> | |
342 | - <topPen lineWidth="0.25"/> | |
343 | - <leftPen lineWidth="0.25"/> | |
344 | - <bottomPen lineWidth="0.25"/> | |
345 | - <rightPen lineWidth="0.25"/> | |
346 | - </box> | |
338 | + <textField isBlankWhenNull="true"> | |
339 | + <reportElement x="0" y="0" width="70" height="20" uuid="989b5504-7203-4adb-830e-c2a96f9222e7"/> | |
347 | 340 | <textElement textAlignment="Center" verticalAlignment="Middle"> |
348 | 341 | <font size="7" isBold="true"/> |
349 | 342 | </textElement> |
350 | - <text><![CDATA[Preço Total]]></text> | |
351 | - </staticText> | |
343 | + <textFieldExpression><![CDATA[($P{is_asterisco} ? "* " : "")+"Preço Total" ]]></textFieldExpression> | |
344 | + </textField> | |
352 | 345 | </jr:columnHeader> |
353 | 346 | <jr:detailCell style="table 1" height="15" rowSpan="1"> |
354 | 347 | <textField isBlankWhenNull="true"> |
... | ... | @@ -365,6 +358,21 @@ |
365 | 358 | </band> |
366 | 359 | </groupHeader> |
367 | 360 | </group> |
361 | + <group name="resumoContabil"> | |
362 | + <groupHeader> | |
363 | + <band height="33"> | |
364 | + <staticText> | |
365 | + <reportElement x="0" y="10" width="792" height="20" uuid="044fb4cf-5b85-485e-9a98-20bcd9832b67"> | |
366 | + <printWhenExpression><![CDATA[$P{is_asterisco}]]></printWhenExpression> | |
367 | + </reportElement> | |
368 | + <textElement textAlignment="Left" verticalAlignment="Middle"> | |
369 | + <font size="8" isBold="true"/> | |
370 | + </textElement> | |
371 | + <text><![CDATA[Obs.: Os campos destacados com asterisco (*) calculados com base nos valores dos materiais existentes no estoque no momento da emissão.]]></text> | |
372 | + </staticText> | |
373 | + </band> | |
374 | + </groupHeader> | |
375 | + </group> | |
368 | 376 | <pageHeader> |
369 | 377 | <band height="135" splitType="Stretch"> |
370 | 378 | <staticText> |
... | ... | @@ -486,7 +494,7 @@ |
486 | 494 | </textElement> |
487 | 495 | <textFieldExpression><![CDATA[$F{cadEm}]]></textFieldExpression> |
488 | 496 | </textField> |
489 | - <textField isBlankWhenNull="false"> | |
497 | + <textField isBlankWhenNull="true"> | |
490 | 498 | <reportElement x="602" y="100" width="129" height="20" uuid="91f7b413-be6f-4ee9-968f-1322e9a9d70f"/> |
491 | 499 | <textElement verticalAlignment="Middle"> |
492 | 500 | <font size="7"/> | ... | ... |