Commit 540e6077f229b128d6ceaf56b186e57a205ea12d
Exists in
master
Merge branch 'cnt-1.0.0-alfa11'
Showing
27 changed files
with
830 additions
and
746 deletions
Show diff stats
cit-contratos-api/src/main/java/br/com/centralit/api/dao/EventoAditivoDao.java
@@ -7,7 +7,7 @@ import br.com.centralit.api.model.EventoAditivo; | @@ -7,7 +7,7 @@ import br.com.centralit.api.model.EventoAditivo; | ||
7 | import br.com.centralit.framework.dao.arquitetura.CitGenericDAO; | 7 | import br.com.centralit.framework.dao.arquitetura.CitGenericDAO; |
8 | 8 | ||
9 | /** | 9 | /** |
10 | - * | 10 | + * |
11 | * <p><img src="http://centralit.com.br/images/logo_central.png"></p> | 11 | * <p><img src="http://centralit.com.br/images/logo_central.png"></p> |
12 | * | 12 | * |
13 | * <p><b>Company: </b> Central IT - Governança Corporativa - </p> | 13 | * <p><b>Company: </b> Central IT - Governança Corporativa - </p> |
@@ -15,11 +15,11 @@ import br.com.centralit.framework.dao.arquitetura.CitGenericDAO; | @@ -15,11 +15,11 @@ import br.com.centralit.framework.dao.arquitetura.CitGenericDAO; | ||
15 | * <p><b>Title: </b></p> | 15 | * <p><b>Title: </b></p> |
16 | * | 16 | * |
17 | * <p><b>Description: </b></p> | 17 | * <p><b>Description: </b></p> |
18 | - * | 18 | + * |
19 | * <p><b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a></p> | 19 | * <p><b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a></p> |
20 | * | 20 | * |
21 | - * <p><b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a></p> | ||
22 | - * | 21 | + * <p><b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a></p> |
22 | + * | ||
23 | * @since 15/03/2016 - 18:35:42 | 23 | * @since 15/03/2016 - 18:35:42 |
24 | * | 24 | * |
25 | * @version 1.0.0 | 25 | * @version 1.0.0 |
@@ -30,10 +30,10 @@ import br.com.centralit.framework.dao.arquitetura.CitGenericDAO; | @@ -30,10 +30,10 @@ import br.com.centralit.framework.dao.arquitetura.CitGenericDAO; | ||
30 | public interface EventoAditivoDao extends CitGenericDAO { | 30 | public interface EventoAditivoDao extends CitGenericDAO { |
31 | 31 | ||
32 | /** | 32 | /** |
33 | - * | 33 | + * |
34 | * <p><b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a></p> | 34 | * <p><b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a></p> |
35 | * | 35 | * |
36 | - * <p><b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a></p> | 36 | + * <p><b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a></p> |
37 | * | 37 | * |
38 | * Método responsável por | 38 | * Método responsável por |
39 | * | 39 | * |
@@ -45,10 +45,10 @@ public interface EventoAditivoDao extends CitGenericDAO { | @@ -45,10 +45,10 @@ public interface EventoAditivoDao extends CitGenericDAO { | ||
45 | Collection<EventoAditivo> findAllByContrato(Long contratoId); | 45 | Collection<EventoAditivo> findAllByContrato(Long contratoId); |
46 | 46 | ||
47 | /** | 47 | /** |
48 | - * | 48 | + * |
49 | * <p><b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a></p> | 49 | * <p><b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a></p> |
50 | * | 50 | * |
51 | - * <p><b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a></p> | 51 | + * <p><b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a></p> |
52 | * | 52 | * |
53 | * Método responsável por buscar o último registro de aditivo de um determinado contrato no ano da data de emissão | 53 | * Método responsável por buscar o último registro de aditivo de um determinado contrato no ano da data de emissão |
54 | * | 54 | * |
@@ -61,4 +61,6 @@ public interface EventoAditivoDao extends CitGenericDAO { | @@ -61,4 +61,6 @@ public interface EventoAditivoDao extends CitGenericDAO { | ||
61 | * @return | 61 | * @return |
62 | */ | 62 | */ |
63 | EventoAditivo buscarUltimoRegistroPorDataEmissaoEContrato(String property, Calendar dataEmissao, Long contratoId, Long organizacaoId); | 63 | EventoAditivo buscarUltimoRegistroPorDataEmissaoEContrato(String property, Calendar dataEmissao, Long contratoId, Long organizacaoId); |
64 | + | ||
65 | + boolean existeAditivoPosterior(Calendar dataInicioAditivo, Long idContrato); | ||
64 | } | 66 | } |
cit-contratos-api/src/main/java/br/com/centralit/api/dao/impl/EventoAditivoDaoHibernate.java
@@ -2,6 +2,7 @@ package br.com.centralit.api.dao.impl; | @@ -2,6 +2,7 @@ package br.com.centralit.api.dao.impl; | ||
2 | 2 | ||
3 | import java.util.Calendar; | 3 | import java.util.Calendar; |
4 | import java.util.Collection; | 4 | import java.util.Collection; |
5 | +import java.util.List; | ||
5 | 6 | ||
6 | import org.springframework.stereotype.Repository; | 7 | import org.springframework.stereotype.Repository; |
7 | 8 | ||
@@ -13,37 +14,37 @@ import br.com.centralit.framework.dao.arquitetura.SearchSeven; | @@ -13,37 +14,37 @@ import br.com.centralit.framework.dao.arquitetura.SearchSeven; | ||
13 | import com.googlecode.genericdao.search.Search; | 14 | import com.googlecode.genericdao.search.Search; |
14 | 15 | ||
15 | /** | 16 | /** |
16 | - * | 17 | + * |
17 | * <p> | 18 | * <p> |
18 | * <img src="http://centralit.com.br/images/logo_central.png"> | 19 | * <img src="http://centralit.com.br/images/logo_central.png"> |
19 | * </p> | 20 | * </p> |
20 | - * | 21 | + * |
21 | * <p> | 22 | * <p> |
22 | * <b>Company: </b> Central IT - Governança Corporativa - | 23 | * <b>Company: </b> Central IT - Governança Corporativa - |
23 | * </p> | 24 | * </p> |
24 | - * | 25 | + * |
25 | * <p> | 26 | * <p> |
26 | * <b>Title: </b> | 27 | * <b>Title: </b> |
27 | * </p> | 28 | * </p> |
28 | - * | 29 | + * |
29 | * <p> | 30 | * <p> |
30 | * <b>Description: </b> | 31 | * <b>Description: </b> |
31 | * </p> | 32 | * </p> |
32 | - * | 33 | + * |
33 | * <p> | 34 | * <p> |
34 | * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a> | 35 | * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a> |
35 | * </p> | 36 | * </p> |
36 | - * | 37 | + * |
37 | * <p> | 38 | * <p> |
38 | * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> | 39 | * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> |
39 | * </p> | 40 | * </p> |
40 | - * | 41 | + * |
41 | * @since 15/03/2016 - 18:36:13 | 42 | * @since 15/03/2016 - 18:36:13 |
42 | - * | 43 | + * |
43 | * @version 1.0.0 | 44 | * @version 1.0.0 |
44 | - * | 45 | + * |
45 | * @author geovane.filho | 46 | * @author geovane.filho |
46 | - * | 47 | + * |
47 | */ | 48 | */ |
48 | @Repository("eventoAditivoDao") | 49 | @Repository("eventoAditivoDao") |
49 | public class EventoAditivoDaoHibernate extends CitGenericDAOImpl implements EventoAditivoDao { | 50 | public class EventoAditivoDaoHibernate extends CitGenericDAOImpl implements EventoAditivoDao { |
@@ -100,4 +101,16 @@ public class EventoAditivoDaoHibernate extends CitGenericDAOImpl implements Even | @@ -100,4 +101,16 @@ public class EventoAditivoDaoHibernate extends CitGenericDAOImpl implements Even | ||
100 | return searchUnique(search); | 101 | return searchUnique(search); |
101 | } | 102 | } |
102 | 103 | ||
104 | + @Override | ||
105 | + public boolean existeAditivoPosterior(Calendar dataInicioAditivo, Long idContrato) { | ||
106 | + SearchSeven search = new SearchSeven(); | ||
107 | + | ||
108 | + search.addFilterIn("contrato.id", idContrato); | ||
109 | + search.addFilterGreaterThan("dataEmissao", dataInicioAditivo); | ||
110 | + | ||
111 | + List<Object> list = this.search(search); | ||
112 | + | ||
113 | + return list != null && list.size() > 0 ? true : false; | ||
114 | + } | ||
115 | + | ||
103 | } | 116 | } |
cit-contratos-api/src/main/java/br/com/centralit/api/model/Contrato.java
@@ -66,8 +66,7 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize; | @@ -66,8 +66,7 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize; | ||
66 | */ | 66 | */ |
67 | @Entity | 67 | @Entity |
68 | @Table(name = "cnt_contrato") | 68 | @Table(name = "cnt_contrato") |
69 | -@JsonIgnoreProperties({ "valorTotalItens", "cnpjFornecedor", | ||
70 | - "valorTotalLiberado", "ultimaDataVigenciaFinal" }) | 69 | +@JsonIgnoreProperties({ "valorTotalItens", "cnpjFornecedor", "valorTotalLiberado", "ultimaDataVigenciaFinal" }) |
71 | public class Contrato extends PersistentObjectAuditOrganizacao { | 70 | public class Contrato extends PersistentObjectAuditOrganizacao { |
72 | 71 | ||
73 | /** Atributo serialVersionUID. */ | 72 | /** Atributo serialVersionUID. */ |
@@ -87,13 +86,13 @@ public class Contrato extends PersistentObjectAuditOrganizacao { | @@ -87,13 +86,13 @@ public class Contrato extends PersistentObjectAuditOrganizacao { | ||
87 | /** Atributo numeroProcesso. */ | 86 | /** Atributo numeroProcesso. */ |
88 | @Column(length = 30, nullable = false) | 87 | @Column(length = 30, nullable = false) |
89 | @JsonView({ ViewsContrato.ContratoEditView.class, | 88 | @JsonView({ ViewsContrato.ContratoEditView.class, |
90 | - ViewsContrato.ContratoAutoCompleteView.class, | ||
91 | - ViewsContrato.OrdemFornecimentoEditView.class, | ||
92 | - ViewsContrato.EncerramentoContratoEditView.class, | ||
93 | - ViewsContrato.ContratoEventoEditView.class, | ||
94 | - ViewsContrato.EventoApostilamentoEditView.class, | ||
95 | - ViewsContrato.EventoPenalidadeEditView.class, | ||
96 | - ViewsContrato.EventoRecebimentoObjetoEditView.class }) | 89 | + ViewsContrato.ContratoAutoCompleteView.class, |
90 | + ViewsContrato.OrdemFornecimentoEditView.class, | ||
91 | + ViewsContrato.EncerramentoContratoEditView.class, | ||
92 | + ViewsContrato.ContratoEventoEditView.class, | ||
93 | + ViewsContrato.EventoApostilamentoEditView.class, | ||
94 | + ViewsContrato.EventoPenalidadeEditView.class, | ||
95 | + ViewsContrato.EventoRecebimentoObjetoEditView.class }) | ||
97 | private Long numeroProcesso; | 96 | private Long numeroProcesso; |
98 | 97 | ||
99 | /** Atributo exercicio. */ | 98 | /** Atributo exercicio. */ |
@@ -106,46 +105,46 @@ public class Contrato extends PersistentObjectAuditOrganizacao { | @@ -106,46 +105,46 @@ public class Contrato extends PersistentObjectAuditOrganizacao { | ||
106 | /** Atributo numeroAnoContrato. */ | 105 | /** Atributo numeroAnoContrato. */ |
107 | @Column(length = 30, nullable = false) | 106 | @Column(length = 30, nullable = false) |
108 | @JsonView({ ViewsContrato.ContratoEditView.class, | 107 | @JsonView({ ViewsContrato.ContratoEditView.class, |
109 | - ViewsContrato.ContratoAutoCompleteView.class, | ||
110 | - ViewsContrato.CronogramaExecucaoEditView.class, | ||
111 | - ViewsContrato.OrdemFornecimentoListView.class, | ||
112 | - ViewsContrato.RegistroOcorrenciaEditView.class, | ||
113 | - ViewsContrato.NotificacaoContratoEditView.class, | ||
114 | - ViewsContrato.ContratoEventoEditView.class, | ||
115 | - ViewsContrato.EventoApostilamentoEditView.class, | ||
116 | - ViewsContrato.EventoPenalidadeEditView.class, | ||
117 | - ViewsContrato.EventoRecebimentoObjetoEditView.class }) | 108 | + ViewsContrato.ContratoAutoCompleteView.class, |
109 | + ViewsContrato.CronogramaExecucaoEditView.class, | ||
110 | + ViewsContrato.OrdemFornecimentoListView.class, | ||
111 | + ViewsContrato.RegistroOcorrenciaEditView.class, | ||
112 | + ViewsContrato.NotificacaoContratoEditView.class, | ||
113 | + ViewsContrato.ContratoEventoEditView.class, | ||
114 | + ViewsContrato.EventoApostilamentoEditView.class, | ||
115 | + ViewsContrato.EventoPenalidadeEditView.class, | ||
116 | + ViewsContrato.EventoRecebimentoObjetoEditView.class }) | ||
118 | private String numeroAnoContrato; | 117 | private String numeroAnoContrato; |
119 | 118 | ||
120 | /** Atributo numeroAnoContrato. */ | 119 | /** Atributo numeroAnoContrato. */ |
121 | @Transient | 120 | @Transient |
122 | @JsonView({ ViewsContrato.ContratoEditView.class, | 121 | @JsonView({ ViewsContrato.ContratoEditView.class, |
123 | - ViewsContrato.OrdemFornecimentoListView.class, | ||
124 | - ViewsContrato.ContratoAutoCompleteView.class, | ||
125 | - ViewsContrato.CronogramaExecucaoEditView.class, | ||
126 | - ViewsContrato.RegistroOcorrenciaEditView.class, | ||
127 | - ViewsContrato.NotificacaoContratoEditView.class, | ||
128 | - ViewsContrato.EncerramentoContratoListView.class, | ||
129 | - ViewsContrato.ContratoEventoEditView.class, | ||
130 | - ViewsContrato.EventoApostilamentoEditView.class, | ||
131 | - ViewsContrato.EventoPenalidadeEditView.class, | ||
132 | - ViewsContrato.EventoRecebimentoObjetoEditView.class }) | 122 | + ViewsContrato.OrdemFornecimentoListView.class, |
123 | + ViewsContrato.ContratoAutoCompleteView.class, | ||
124 | + ViewsContrato.CronogramaExecucaoEditView.class, | ||
125 | + ViewsContrato.RegistroOcorrenciaEditView.class, | ||
126 | + ViewsContrato.NotificacaoContratoEditView.class, | ||
127 | + ViewsContrato.EncerramentoContratoListView.class, | ||
128 | + ViewsContrato.ContratoEventoEditView.class, | ||
129 | + ViewsContrato.EventoApostilamentoEditView.class, | ||
130 | + ViewsContrato.EventoPenalidadeEditView.class, | ||
131 | + ViewsContrato.EventoRecebimentoObjetoEditView.class }) | ||
133 | private String numeroAnoContratoFormatado; | 132 | private String numeroAnoContratoFormatado; |
134 | 133 | ||
135 | /** Atributo dominioTipoContrato. */ | 134 | /** Atributo dominioTipoContrato. */ |
136 | @ManyToOne(fetch = FetchType.LAZY, optional = false) | 135 | @ManyToOne(fetch = FetchType.LAZY, optional = false) |
137 | @JsonView({ ViewsContrato.ContratoEditView.class, | 136 | @JsonView({ ViewsContrato.ContratoEditView.class, |
138 | - ViewsContrato.ContratoAutoCompleteView.class, | ||
139 | - ViewsContrato.EncerramentoContratoEditView.class, | ||
140 | - ViewsContrato.RegistroOcorrenciaEditView.class }) | 137 | + ViewsContrato.ContratoAutoCompleteView.class, |
138 | + ViewsContrato.EncerramentoContratoEditView.class, | ||
139 | + ViewsContrato.RegistroOcorrenciaEditView.class }) | ||
141 | private Dominio dominioTipoContrato; | 140 | private Dominio dominioTipoContrato; |
142 | 141 | ||
143 | /** Atributo dominioTipoAquisicao. */ | 142 | /** Atributo dominioTipoAquisicao. */ |
144 | @ManyToOne(fetch = FetchType.LAZY, optional = false) | 143 | @ManyToOne(fetch = FetchType.LAZY, optional = false) |
145 | @JsonView({ ViewsContrato.ContratoEditView.class, | 144 | @JsonView({ ViewsContrato.ContratoEditView.class, |
146 | - ViewsContrato.ContratoAutoCompleteView.class, | ||
147 | - ViewsContrato.OrdemFornecimentoEditView.class, | ||
148 | - ViewsContrato.EncerramentoContratoEditView.class }) | 145 | + ViewsContrato.ContratoAutoCompleteView.class, |
146 | + ViewsContrato.OrdemFornecimentoEditView.class, | ||
147 | + ViewsContrato.EncerramentoContratoEditView.class }) | ||
149 | private Dominio dominioTipoAquisicao; | 148 | private Dominio dominioTipoAquisicao; |
150 | 149 | ||
151 | /** Atributo dataCelebracao. */ | 150 | /** Atributo dataCelebracao. */ |
@@ -154,8 +153,8 @@ public class Contrato extends PersistentObjectAuditOrganizacao { | @@ -154,8 +153,8 @@ public class Contrato extends PersistentObjectAuditOrganizacao { | ||
154 | @JsonSerialize(using = JsonCalendarSimpleDateSerializer.class) | 153 | @JsonSerialize(using = JsonCalendarSimpleDateSerializer.class) |
155 | @JsonDeserialize(using = JsonCalendarSimpleDateDeserializer.class) | 154 | @JsonDeserialize(using = JsonCalendarSimpleDateDeserializer.class) |
156 | @JsonView({ ViewsContrato.ContratoEditView.class, | 155 | @JsonView({ ViewsContrato.ContratoEditView.class, |
157 | - ViewsContrato.ContratoAutoCompleteView.class, | ||
158 | - ViewsContrato.EncerramentoContratoEditView.class }) | 156 | + ViewsContrato.ContratoAutoCompleteView.class, |
157 | + ViewsContrato.EncerramentoContratoEditView.class }) | ||
159 | private Calendar dataCelebracao; | 158 | private Calendar dataCelebracao; |
160 | 159 | ||
161 | /** Atributo dataVigenciaInicial. */ | 160 | /** Atributo dataVigenciaInicial. */ |
@@ -164,14 +163,14 @@ public class Contrato extends PersistentObjectAuditOrganizacao { | @@ -164,14 +163,14 @@ public class Contrato extends PersistentObjectAuditOrganizacao { | ||
164 | @JsonSerialize(using = JsonCalendarSimpleDateSerializer.class) | 163 | @JsonSerialize(using = JsonCalendarSimpleDateSerializer.class) |
165 | @JsonDeserialize(using = JsonCalendarSimpleDateDeserializer.class) | 164 | @JsonDeserialize(using = JsonCalendarSimpleDateDeserializer.class) |
166 | @JsonView({ ViewsContrato.ContratoEditView.class, | 165 | @JsonView({ ViewsContrato.ContratoEditView.class, |
167 | - ViewsContrato.ContratoAutoCompleteView.class, | ||
168 | - ViewsContrato.OrdemFornecimentoEditView.class, | ||
169 | - ViewsContrato.CronogramaExecucaoEditView.class, | ||
170 | - ViewsContrato.RegistroOcorrenciaEditView.class, | ||
171 | - ViewsContrato.NotificacaoContratoEditView.class, | ||
172 | - ViewsContrato.EncerramentoContratoEditView.class, | ||
173 | - ViewsContrato.EventoApostilamentoEditView.class, | ||
174 | - ViewsContrato.EventoRecebimentoObjetoEditView.class }) | 166 | + ViewsContrato.ContratoAutoCompleteView.class, |
167 | + ViewsContrato.OrdemFornecimentoEditView.class, | ||
168 | + ViewsContrato.CronogramaExecucaoEditView.class, | ||
169 | + ViewsContrato.RegistroOcorrenciaEditView.class, | ||
170 | + ViewsContrato.NotificacaoContratoEditView.class, | ||
171 | + ViewsContrato.EncerramentoContratoEditView.class, | ||
172 | + ViewsContrato.EventoApostilamentoEditView.class, | ||
173 | + ViewsContrato.EventoRecebimentoObjetoEditView.class }) | ||
175 | private Calendar dataVigenciaInicial; | 174 | private Calendar dataVigenciaInicial; |
176 | 175 | ||
177 | /** Atributo dataVigenciaFinal. */ | 176 | /** Atributo dataVigenciaFinal. */ |
@@ -180,51 +179,51 @@ public class Contrato extends PersistentObjectAuditOrganizacao { | @@ -180,51 +179,51 @@ public class Contrato extends PersistentObjectAuditOrganizacao { | ||
180 | @JsonSerialize(using = JsonCalendarSimpleDateSerializer.class) | 179 | @JsonSerialize(using = JsonCalendarSimpleDateSerializer.class) |
181 | @JsonDeserialize(using = JsonCalendarSimpleDateDeserializer.class) | 180 | @JsonDeserialize(using = JsonCalendarSimpleDateDeserializer.class) |
182 | @JsonView({ ViewsContrato.ContratoEditView.class, | 181 | @JsonView({ ViewsContrato.ContratoEditView.class, |
183 | - ViewsContrato.ContratoAutoCompleteView.class, | ||
184 | - ViewsContrato.OrdemFornecimentoEditView.class, | ||
185 | - ViewsContrato.CronogramaExecucaoEditView.class, | ||
186 | - ViewsContrato.RegistroOcorrenciaEditView.class, | ||
187 | - ViewsContrato.NotificacaoContratoEditView.class, | ||
188 | - ViewsContrato.EncerramentoContratoEditView.class, | ||
189 | - ViewsContrato.EventoApostilamentoEditView.class, | ||
190 | - ViewsContrato.EventoRecebimentoObjetoEditView.class }) | 182 | + ViewsContrato.ContratoAutoCompleteView.class, |
183 | + ViewsContrato.OrdemFornecimentoEditView.class, | ||
184 | + ViewsContrato.CronogramaExecucaoEditView.class, | ||
185 | + ViewsContrato.RegistroOcorrenciaEditView.class, | ||
186 | + ViewsContrato.NotificacaoContratoEditView.class, | ||
187 | + ViewsContrato.EncerramentoContratoEditView.class, | ||
188 | + ViewsContrato.EventoApostilamentoEditView.class, | ||
189 | + ViewsContrato.EventoRecebimentoObjetoEditView.class }) | ||
191 | private Calendar dataVigenciaFinal; | 190 | private Calendar dataVigenciaFinal; |
192 | 191 | ||
193 | @Transient | 192 | @Transient |
194 | @JsonSerialize(using = JsonCalendarSimpleDateSerializer.class) | 193 | @JsonSerialize(using = JsonCalendarSimpleDateSerializer.class) |
195 | @JsonDeserialize(using = JsonCalendarSimpleDateDeserializer.class) | 194 | @JsonDeserialize(using = JsonCalendarSimpleDateDeserializer.class) |
196 | @JsonView({ ViewsContrato.ContratoEditView.class, | 195 | @JsonView({ ViewsContrato.ContratoEditView.class, |
197 | - ViewsContrato.ContratoAutoCompleteView.class, | ||
198 | - ViewsContrato.OrdemFornecimentoEditView.class, | ||
199 | - ViewsContrato.CronogramaExecucaoEditView.class, | ||
200 | - ViewsContrato.RegistroOcorrenciaEditView.class, | ||
201 | - ViewsContrato.NotificacaoContratoEditView.class, | ||
202 | - ViewsContrato.EncerramentoContratoEditView.class, | ||
203 | - ViewsContrato.EventoApostilamentoEditView.class, | ||
204 | - ViewsContrato.EventoRecebimentoObjetoEditView.class }) | 196 | + ViewsContrato.ContratoAutoCompleteView.class, |
197 | + ViewsContrato.OrdemFornecimentoEditView.class, | ||
198 | + ViewsContrato.CronogramaExecucaoEditView.class, | ||
199 | + ViewsContrato.RegistroOcorrenciaEditView.class, | ||
200 | + ViewsContrato.NotificacaoContratoEditView.class, | ||
201 | + ViewsContrato.EncerramentoContratoEditView.class, | ||
202 | + ViewsContrato.EventoApostilamentoEditView.class, | ||
203 | + ViewsContrato.EventoRecebimentoObjetoEditView.class }) | ||
205 | private Calendar dataUltimaVigenciaFinal; | 204 | private Calendar dataUltimaVigenciaFinal; |
206 | 205 | ||
207 | /** Atributo dominioSituacaoAtual. */ | 206 | /** Atributo dominioSituacaoAtual. */ |
208 | @ManyToOne(fetch = FetchType.LAZY, optional = false) | 207 | @ManyToOne(fetch = FetchType.LAZY, optional = false) |
209 | @JsonView({ ViewsContrato.ContratoEditView.class, | 208 | @JsonView({ ViewsContrato.ContratoEditView.class, |
210 | - ViewsContrato.ContratoAutoCompleteView.class, | ||
211 | - ViewsContrato.OrdemFornecimentoEditView.class, | ||
212 | - ViewsContrato.RegistroOcorrenciaEditView.class, | ||
213 | - ViewsContrato.ContratoEventoEditView.class, | ||
214 | - ViewsContrato.EventoApostilamentoEditView.class }) | 209 | + ViewsContrato.ContratoAutoCompleteView.class, |
210 | + ViewsContrato.OrdemFornecimentoEditView.class, | ||
211 | + ViewsContrato.RegistroOcorrenciaEditView.class, | ||
212 | + ViewsContrato.ContratoEventoEditView.class, | ||
213 | + ViewsContrato.EventoApostilamentoEditView.class }) | ||
215 | private Dominio dominioSituacaoAtual; | 214 | private Dominio dominioSituacaoAtual; |
216 | 215 | ||
217 | /** Atributo fornecedor. */ | 216 | /** Atributo fornecedor. */ |
218 | @ManyToOne(fetch = FetchType.LAZY, optional = false) | 217 | @ManyToOne(fetch = FetchType.LAZY, optional = false) |
219 | @JsonView({ ViewsContrato.ContratoEditView.class, | 218 | @JsonView({ ViewsContrato.ContratoEditView.class, |
220 | - ViewsContrato.ContratoAutoCompleteView.class, | ||
221 | - ViewsContrato.OrdemFornecimentoEditView.class, | ||
222 | - ViewsContrato.CronogramaExecucaoEditView.class, | ||
223 | - ViewsContrato.RegistroOcorrenciaEditView.class, | ||
224 | - ViewsContrato.NotificacaoContratoEditView.class, | ||
225 | - ViewsContrato.EncerramentoContratoListView.class, | ||
226 | - ViewsContrato.EventoApostilamentoEditView.class, | ||
227 | - ViewsContrato.EventoPenalidadeEditView.class }) | 219 | + ViewsContrato.ContratoAutoCompleteView.class, |
220 | + ViewsContrato.OrdemFornecimentoEditView.class, | ||
221 | + ViewsContrato.CronogramaExecucaoEditView.class, | ||
222 | + ViewsContrato.RegistroOcorrenciaEditView.class, | ||
223 | + ViewsContrato.NotificacaoContratoEditView.class, | ||
224 | + ViewsContrato.EncerramentoContratoListView.class, | ||
225 | + ViewsContrato.EventoApostilamentoEditView.class, | ||
226 | + ViewsContrato.EventoPenalidadeEditView.class }) | ||
228 | private Fornecedor fornecedor; | 227 | private Fornecedor fornecedor; |
229 | 228 | ||
230 | /** Atributo disponivel. */ | 229 | /** Atributo disponivel. */ |
@@ -233,9 +232,10 @@ public class Contrato extends PersistentObjectAuditOrganizacao { | @@ -233,9 +232,10 @@ public class Contrato extends PersistentObjectAuditOrganizacao { | ||
233 | 232 | ||
234 | /** Atributo objetoContratacao. */ | 233 | /** Atributo objetoContratacao. */ |
235 | @JsonView({ ViewsContrato.ContratoEditView.class, | 234 | @JsonView({ ViewsContrato.ContratoEditView.class, |
236 | - ViewsContrato.ContratoAutoCompleteView.class, | ||
237 | - ViewsContrato.EncerramentoContratoEditView.class, | ||
238 | - ViewsContrato.EventoApostilamentoEditView.class }) | 235 | + ViewsContrato.ContratoAutoCompleteView.class, |
236 | + ViewsContrato.EncerramentoContratoEditView.class, | ||
237 | + ViewsContrato.EventoApostilamentoEditView.class, | ||
238 | + ViewsContrato.EventoRecebimentoObjetoEditView.class }) | ||
239 | @Column(length = 1024, nullable = false) | 239 | @Column(length = 1024, nullable = false) |
240 | private String objetoContratacao; | 240 | private String objetoContratacao; |
241 | 241 | ||
@@ -243,20 +243,20 @@ public class Contrato extends PersistentObjectAuditOrganizacao { | @@ -243,20 +243,20 @@ public class Contrato extends PersistentObjectAuditOrganizacao { | ||
243 | @Column(precision = 20, scale = 4) | 243 | @Column(precision = 20, scale = 4) |
244 | @JsonDeserialize(using = MoneyDeserializer.class) | 244 | @JsonDeserialize(using = MoneyDeserializer.class) |
245 | @JsonView({ ViewsContrato.ContratoEditView.class, | 245 | @JsonView({ ViewsContrato.ContratoEditView.class, |
246 | - ViewsContrato.ContratoAutoCompleteView.class, | ||
247 | - ViewsContrato.CronogramaExecucaoEditView.class, | ||
248 | - ViewsContrato.EncerramentoContratoEditView.class, | ||
249 | - ViewsContrato.RegistroOcorrenciaEditView.class, | ||
250 | - ViewsContrato.ContratoEventoEditView.class }) | 246 | + ViewsContrato.ContratoAutoCompleteView.class, |
247 | + ViewsContrato.CronogramaExecucaoEditView.class, | ||
248 | + ViewsContrato.EncerramentoContratoEditView.class, | ||
249 | + ViewsContrato.RegistroOcorrenciaEditView.class, | ||
250 | + ViewsContrato.ContratoEventoEditView.class }) | ||
251 | private BigDecimal valorContrato; | 251 | private BigDecimal valorContrato; |
252 | 252 | ||
253 | @Transient | 253 | @Transient |
254 | @JsonView({ ViewsContrato.ContratoEditView.class, | 254 | @JsonView({ ViewsContrato.ContratoEditView.class, |
255 | - ViewsContrato.ContratoAutoCompleteView.class, | ||
256 | - ViewsContrato.CronogramaExecucaoEditView.class, | ||
257 | - ViewsContrato.EncerramentoContratoEditView.class, | ||
258 | - ViewsContrato.RegistroOcorrenciaEditView.class, | ||
259 | - ViewsContrato.ContratoEventoEditView.class }) | 255 | + ViewsContrato.ContratoAutoCompleteView.class, |
256 | + ViewsContrato.CronogramaExecucaoEditView.class, | ||
257 | + ViewsContrato.EncerramentoContratoEditView.class, | ||
258 | + ViewsContrato.RegistroOcorrenciaEditView.class, | ||
259 | + ViewsContrato.ContratoEventoEditView.class }) | ||
260 | private BigDecimal valorTotalContrato; | 260 | private BigDecimal valorTotalContrato; |
261 | 261 | ||
262 | /** Atributo dominioFormaPagamentoContrato. */ | 262 | /** Atributo dominioFormaPagamentoContrato. */ |
@@ -287,8 +287,8 @@ public class Contrato extends PersistentObjectAuditOrganizacao { | @@ -287,8 +287,8 @@ public class Contrato extends PersistentObjectAuditOrganizacao { | ||
287 | /** Atributo ctrtEmpenhos. */ | 287 | /** Atributo ctrtEmpenhos. */ |
288 | @OneToMany(fetch = FetchType.LAZY, mappedBy = "contratoAditivo", cascade = CascadeType.ALL, targetEntity = EventoAditivo.class) | 288 | @OneToMany(fetch = FetchType.LAZY, mappedBy = "contratoAditivo", cascade = CascadeType.ALL, targetEntity = EventoAditivo.class) |
289 | @JsonView({ ViewsContrato.EventoAditivoEditView.class, | 289 | @JsonView({ ViewsContrato.EventoAditivoEditView.class, |
290 | - ViewsContrato.ContratoEventoEditView.class, | ||
291 | - ViewsContrato.ContratoEditView.class }) | 290 | + ViewsContrato.ContratoEventoEditView.class, |
291 | + ViewsContrato.ContratoEditView.class }) | ||
292 | private Collection<EventoAditivo> aditivos; | 292 | private Collection<EventoAditivo> aditivos; |
293 | 293 | ||
294 | /** Atributo valorGarantia. */ | 294 | /** Atributo valorGarantia. */ |
@@ -321,8 +321,7 @@ public class Contrato extends PersistentObjectAuditOrganizacao { | @@ -321,8 +321,7 @@ public class Contrato extends PersistentObjectAuditOrganizacao { | ||
321 | 321 | ||
322 | /** Atributo ctrtEmpenhos. */ | 322 | /** Atributo ctrtEmpenhos. */ |
323 | @OneToMany(fetch = FetchType.LAZY, mappedBy = "contrato", cascade = CascadeType.ALL) | 323 | @OneToMany(fetch = FetchType.LAZY, mappedBy = "contrato", cascade = CascadeType.ALL) |
324 | - @JsonView({ ViewsContrato.ContratoEditView.class, | ||
325 | - ViewsContrato.CronogramaExecucaoEditView.class }) | 324 | + @JsonView({ ViewsContrato.ContratoEditView.class, ViewsContrato.CronogramaExecucaoEditView.class }) |
326 | private Collection<ContratoItem> ctrtItens; | 325 | private Collection<ContratoItem> ctrtItens; |
327 | 326 | ||
328 | /** Atributo garantias. ctrtEnvolvidos */ | 327 | /** Atributo garantias. ctrtEnvolvidos */ |
@@ -330,10 +329,6 @@ public class Contrato extends PersistentObjectAuditOrganizacao { | @@ -330,10 +329,6 @@ public class Contrato extends PersistentObjectAuditOrganizacao { | ||
330 | @JsonView({ ViewsContrato.ContratoEditView.class }) | 329 | @JsonView({ ViewsContrato.ContratoEditView.class }) |
331 | private Collection<ContratoEnvolvido> ctrtEnvolvidos; | 330 | private Collection<ContratoEnvolvido> ctrtEnvolvidos; |
332 | 331 | ||
333 | - @OneToMany(fetch = FetchType.LAZY, mappedBy = "contrato", cascade = CascadeType.ALL) | ||
334 | - @JsonView({ ViewsContrato.ContratoEditView.class }) | ||
335 | - private Collection<ContratoEnvolvidoJustificativa> justificativas; | ||
336 | - | ||
337 | /** Atributo dominioModalidadeGarantia. */ | 332 | /** Atributo dominioModalidadeGarantia. */ |
338 | @ManyToOne(fetch = FetchType.LAZY) | 333 | @ManyToOne(fetch = FetchType.LAZY) |
339 | @JsonView({ ViewsContrato.ContratoEditView.class }) | 334 | @JsonView({ ViewsContrato.ContratoEditView.class }) |
@@ -593,6 +588,7 @@ public class Contrato extends PersistentObjectAuditOrganizacao { | @@ -593,6 +588,7 @@ public class Contrato extends PersistentObjectAuditOrganizacao { | ||
593 | * @return <code>Calendar</code> | 588 | * @return <code>Calendar</code> |
594 | */ | 589 | */ |
595 | public Calendar getDataUltimaVigenciaFinal() { | 590 | public Calendar getDataUltimaVigenciaFinal() { |
591 | + | ||
596 | if (this.aditivos == null || this.aditivos.isEmpty()) { | 592 | if (this.aditivos == null || this.aditivos.isEmpty()) { |
597 | return this.dataVigenciaFinal; | 593 | return this.dataVigenciaFinal; |
598 | } else { | 594 | } else { |
@@ -724,6 +720,7 @@ public class Contrato extends PersistentObjectAuditOrganizacao { | @@ -724,6 +720,7 @@ public class Contrato extends PersistentObjectAuditOrganizacao { | ||
724 | * @return <code>BigDecimal</code> | 720 | * @return <code>BigDecimal</code> |
725 | */ | 721 | */ |
726 | public BigDecimal getValorTotalContrato() { | 722 | public BigDecimal getValorTotalContrato() { |
723 | + | ||
727 | if (this.aditivos == null || this.aditivos.isEmpty()) { | 724 | if (this.aditivos == null || this.aditivos.isEmpty()) { |
728 | return this.valorContrato; | 725 | return this.valorContrato; |
729 | } else { | 726 | } else { |
@@ -1005,6 +1002,7 @@ public class Contrato extends PersistentObjectAuditOrganizacao { | @@ -1005,6 +1002,7 @@ public class Contrato extends PersistentObjectAuditOrganizacao { | ||
1005 | * @return the ordensFornecimento | 1002 | * @return the ordensFornecimento |
1006 | */ | 1003 | */ |
1007 | public Collection<OrdemFornecimento> getOrdensFornecimento() { | 1004 | public Collection<OrdemFornecimento> getOrdensFornecimento() { |
1005 | + | ||
1008 | return ordensFornecimento; | 1006 | return ordensFornecimento; |
1009 | } | 1007 | } |
1010 | 1008 | ||
@@ -1012,18 +1010,9 @@ public class Contrato extends PersistentObjectAuditOrganizacao { | @@ -1012,18 +1010,9 @@ public class Contrato extends PersistentObjectAuditOrganizacao { | ||
1012 | * @param ordensFornecimento | 1010 | * @param ordensFornecimento |
1013 | * the ordensFornecimento to set | 1011 | * the ordensFornecimento to set |
1014 | */ | 1012 | */ |
1015 | - public void setOrdensFornecimento( | ||
1016 | - Collection<OrdemFornecimento> ordensFornecimento) { | ||
1017 | - this.ordensFornecimento = ordensFornecimento; | ||
1018 | - } | 1013 | + public void setOrdensFornecimento(Collection<OrdemFornecimento> ordensFornecimento) { |
1019 | 1014 | ||
1020 | - public Collection<ContratoEnvolvidoJustificativa> getJustificativas() { | ||
1021 | - return justificativas; | ||
1022 | - } | ||
1023 | - | ||
1024 | - public void setJustificativas( | ||
1025 | - Collection<ContratoEnvolvidoJustificativa> justificativas) { | ||
1026 | - this.justificativas = justificativas; | 1015 | + this.ordensFornecimento = ordensFornecimento; |
1027 | } | 1016 | } |
1028 | 1017 | ||
1029 | /** | 1018 | /** |
cit-contratos-api/src/main/java/br/com/centralit/api/model/ContratoEnvolvido.java
1 | package br.com.centralit.api.model; | 1 | package br.com.centralit.api.model; |
2 | 2 | ||
3 | +import java.util.Collection; | ||
4 | + | ||
5 | +import javax.persistence.CascadeType; | ||
3 | import javax.persistence.Entity; | 6 | import javax.persistence.Entity; |
4 | import javax.persistence.FetchType; | 7 | import javax.persistence.FetchType; |
5 | import javax.persistence.GeneratedValue; | 8 | import javax.persistence.GeneratedValue; |
@@ -7,29 +10,41 @@ import javax.persistence.GenerationType; | @@ -7,29 +10,41 @@ import javax.persistence.GenerationType; | ||
7 | import javax.persistence.Id; | 10 | import javax.persistence.Id; |
8 | import javax.persistence.JoinColumn; | 11 | import javax.persistence.JoinColumn; |
9 | import javax.persistence.ManyToOne; | 12 | import javax.persistence.ManyToOne; |
13 | +import javax.persistence.OneToMany; | ||
10 | import javax.persistence.Table; | 14 | import javax.persistence.Table; |
11 | 15 | ||
16 | +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
17 | +import com.fasterxml.jackson.annotation.JsonView; | ||
18 | + | ||
12 | import br.com.centralit.api.viewHelper.ViewsContrato; | 19 | import br.com.centralit.api.viewHelper.ViewsContrato; |
13 | import br.com.centralit.framework.json.Views; | 20 | import br.com.centralit.framework.json.Views; |
14 | import br.com.centralit.framework.model.Dominio; | 21 | import br.com.centralit.framework.model.Dominio; |
15 | import br.com.centralit.framework.model.arquitetura.PersistentObjectAudit; | 22 | import br.com.centralit.framework.model.arquitetura.PersistentObjectAudit; |
16 | 23 | ||
17 | -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
18 | -import com.fasterxml.jackson.annotation.JsonView; | ||
19 | - | ||
20 | - | ||
21 | /** | 24 | /** |
22 | - * <p><img src="http://centralit.com.br/images/logo_central.png"></p> | 25 | + * <p> |
26 | + * <img src="http://centralit.com.br/images/logo_central.png"> | ||
27 | + * </p> | ||
23 | * | 28 | * |
24 | - * <p><b>Company: </b> Central IT - Governança Corporativa - </p> | 29 | + * <p> |
30 | + * <b>Company: </b> Central IT - Governança Corporativa - | ||
31 | + * </p> | ||
25 | * | 32 | * |
26 | - * <p><b>Title: </b></p> | 33 | + * <p> |
34 | + * <b>Title: </b> | ||
35 | + * </p> | ||
27 | * | 36 | * |
28 | - * <p><b>Description: </b></p> | 37 | + * <p> |
38 | + * <b>Description: </b> | ||
39 | + * </p> | ||
29 | * | 40 | * |
30 | - * <p><b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a></p> | 41 | + * <p> |
42 | + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a> | ||
43 | + * </p> | ||
31 | * | 44 | * |
32 | - * <p><b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a></p> | 45 | + * <p> |
46 | + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> | ||
47 | + * </p> | ||
33 | * | 48 | * |
34 | * @since 19/01/2016 - 16:47:54 | 49 | * @since 19/01/2016 - 16:47:54 |
35 | * | 50 | * |
@@ -39,18 +54,18 @@ import com.fasterxml.jackson.annotation.JsonView; | @@ -39,18 +54,18 @@ import com.fasterxml.jackson.annotation.JsonView; | ||
39 | * | 54 | * |
40 | */ | 55 | */ |
41 | @Entity | 56 | @Entity |
42 | -@Table(name="cnt_cn_envolvido") | ||
43 | -@JsonIgnoreProperties({ "$checked" }) | 57 | +@Table(name = "cnt_cn_envolvido") |
58 | +@JsonIgnoreProperties({ "$checked", "justificativasAnterioresLength" }) | ||
44 | public class ContratoEnvolvido extends PersistentObjectAudit { | 59 | public class ContratoEnvolvido extends PersistentObjectAudit { |
45 | 60 | ||
46 | - /** Atributo serialVersionUID. */ | ||
47 | - private static final long serialVersionUID = 1L; | 61 | + /** Atributo serialVersionUID. */ |
62 | + private static final long serialVersionUID = 1L; | ||
48 | 63 | ||
49 | - /** Atributo id. */ | ||
50 | - @Id | ||
51 | - @GeneratedValue(strategy = GenerationType.AUTO) | ||
52 | - @JsonView({ Views.GenericView.class }) | ||
53 | - private Long id; | 64 | + /** Atributo id. */ |
65 | + @Id | ||
66 | + @GeneratedValue(strategy = GenerationType.AUTO) | ||
67 | + @JsonView({ Views.GenericView.class }) | ||
68 | + private Long id; | ||
54 | 69 | ||
55 | /** Atributo contrato. */ | 70 | /** Atributo contrato. */ |
56 | @ManyToOne(fetch = FetchType.LAZY, optional = true) | 71 | @ManyToOne(fetch = FetchType.LAZY, optional = true) |
@@ -61,15 +76,19 @@ public class ContratoEnvolvido extends PersistentObjectAudit { | @@ -61,15 +76,19 @@ public class ContratoEnvolvido extends PersistentObjectAudit { | ||
61 | private Contrato contratoInativo; | 76 | private Contrato contratoInativo; |
62 | 77 | ||
63 | /** Atributo colaborador. */ | 78 | /** Atributo colaborador. */ |
64 | - @ManyToOne(fetch = FetchType.LAZY, optional=false) | ||
65 | - @JsonView({ ViewsContrato.ContratoEditView.class, Views.ContratoView.class }) | 79 | + @ManyToOne(fetch = FetchType.LAZY, optional = false) |
80 | + @JsonView({ ViewsContrato.ContratoEditView.class, Views.ContratoView.class }) | ||
66 | private Colaborador envolvido; | 81 | private Colaborador envolvido; |
67 | 82 | ||
68 | /** Atributo dominioFormaPagamentoContrato. */ | 83 | /** Atributo dominioFormaPagamentoContrato. */ |
69 | - @ManyToOne(fetch = FetchType.LAZY, optional=false) | ||
70 | - @JoinColumn(name = "papelenvolvidocontrato_id") | ||
71 | - @JsonView({ ViewsContrato.ContratoEditView.class }) | ||
72 | - private Dominio dominioPapelEnvolvidoContrato; | 84 | + @ManyToOne(fetch = FetchType.LAZY, optional = false) |
85 | + @JoinColumn(name = "papelenvolvidocontrato_id") | ||
86 | + @JsonView({ ViewsContrato.ContratoEditView.class }) | ||
87 | + private Dominio dominioPapelEnvolvidoContrato; | ||
88 | + | ||
89 | + @OneToMany(fetch = FetchType.LAZY, mappedBy = "contratoEnvolvido", cascade = CascadeType.ALL) | ||
90 | + @JsonView({ ViewsContrato.ContratoEditView.class }) | ||
91 | + private Collection<ContratoEnvolvidoJustificativa> justificativas; | ||
73 | 92 | ||
74 | /** | 93 | /** |
75 | * Retorna o valor do atributo <code>id</code> | 94 | * Retorna o valor do atributo <code>id</code> |
@@ -81,7 +100,6 @@ public class ContratoEnvolvido extends PersistentObjectAudit { | @@ -81,7 +100,6 @@ public class ContratoEnvolvido extends PersistentObjectAudit { | ||
81 | return id; | 100 | return id; |
82 | } | 101 | } |
83 | 102 | ||
84 | - | ||
85 | /** | 103 | /** |
86 | * Define o valor do atributo <code>id</code>. | 104 | * Define o valor do atributo <code>id</code>. |
87 | * | 105 | * |
@@ -92,7 +110,6 @@ public class ContratoEnvolvido extends PersistentObjectAudit { | @@ -92,7 +110,6 @@ public class ContratoEnvolvido extends PersistentObjectAudit { | ||
92 | this.id = id; | 110 | this.id = id; |
93 | } | 111 | } |
94 | 112 | ||
95 | - | ||
96 | /** | 113 | /** |
97 | * Retorna o valor do atributo <code>contrato</code> | 114 | * Retorna o valor do atributo <code>contrato</code> |
98 | * | 115 | * |
@@ -103,7 +120,6 @@ public class ContratoEnvolvido extends PersistentObjectAudit { | @@ -103,7 +120,6 @@ public class ContratoEnvolvido extends PersistentObjectAudit { | ||
103 | return contrato; | 120 | return contrato; |
104 | } | 121 | } |
105 | 122 | ||
106 | - | ||
107 | /** | 123 | /** |
108 | * Define o valor do atributo <code>contrato</code>. | 124 | * Define o valor do atributo <code>contrato</code>. |
109 | * | 125 | * |
@@ -114,7 +130,6 @@ public class ContratoEnvolvido extends PersistentObjectAudit { | @@ -114,7 +130,6 @@ public class ContratoEnvolvido extends PersistentObjectAudit { | ||
114 | this.contrato = contrato; | 130 | this.contrato = contrato; |
115 | } | 131 | } |
116 | 132 | ||
117 | - | ||
118 | /** | 133 | /** |
119 | * Retorna o valor do atributo <code>contratoInativo</code> | 134 | * Retorna o valor do atributo <code>contratoInativo</code> |
120 | * | 135 | * |
@@ -125,7 +140,6 @@ public class ContratoEnvolvido extends PersistentObjectAudit { | @@ -125,7 +140,6 @@ public class ContratoEnvolvido extends PersistentObjectAudit { | ||
125 | return contratoInativo; | 140 | return contratoInativo; |
126 | } | 141 | } |
127 | 142 | ||
128 | - | ||
129 | /** | 143 | /** |
130 | * Define o valor do atributo <code>contratoInativo</code>. | 144 | * Define o valor do atributo <code>contratoInativo</code>. |
131 | * | 145 | * |
@@ -136,25 +150,34 @@ public class ContratoEnvolvido extends PersistentObjectAudit { | @@ -136,25 +150,34 @@ public class ContratoEnvolvido extends PersistentObjectAudit { | ||
136 | this.contratoInativo = contratoInativo; | 150 | this.contratoInativo = contratoInativo; |
137 | } | 151 | } |
138 | 152 | ||
139 | - | ||
140 | public Colaborador getEnvolvido() { | 153 | public Colaborador getEnvolvido() { |
154 | + | ||
141 | return envolvido; | 155 | return envolvido; |
142 | } | 156 | } |
143 | 157 | ||
144 | - | ||
145 | public void setEnvolvido(Colaborador envolvido) { | 158 | public void setEnvolvido(Colaborador envolvido) { |
159 | + | ||
146 | this.envolvido = envolvido; | 160 | this.envolvido = envolvido; |
147 | } | 161 | } |
148 | 162 | ||
149 | - | ||
150 | public Dominio getDominioPapelEnvolvidoContrato() { | 163 | public Dominio getDominioPapelEnvolvidoContrato() { |
164 | + | ||
151 | return dominioPapelEnvolvidoContrato; | 165 | return dominioPapelEnvolvidoContrato; |
152 | } | 166 | } |
153 | 167 | ||
168 | + public void setDominioPapelEnvolvidoContrato(Dominio dominioPapelEnvolvidoContrato) { | ||
154 | 169 | ||
155 | - public void setDominioPapelEnvolvidoContrato( | ||
156 | - Dominio dominioPapelEnvolvidoContrato) { | ||
157 | this.dominioPapelEnvolvidoContrato = dominioPapelEnvolvidoContrato; | 170 | this.dominioPapelEnvolvidoContrato = dominioPapelEnvolvidoContrato; |
158 | } | 171 | } |
159 | 172 | ||
173 | + public Collection<ContratoEnvolvidoJustificativa> getJustificativas() { | ||
174 | + | ||
175 | + return justificativas; | ||
176 | + } | ||
177 | + | ||
178 | + public void setJustificativas(Collection<ContratoEnvolvidoJustificativa> justificativas) { | ||
179 | + | ||
180 | + this.justificativas = justificativas; | ||
181 | + } | ||
182 | + | ||
160 | } | 183 | } |
cit-contratos-api/src/main/java/br/com/centralit/api/model/ContratoEnvolvidoJustificativa.java
@@ -52,7 +52,7 @@ public class ContratoEnvolvidoJustificativa extends PersistentObjectAudit { | @@ -52,7 +52,7 @@ public class ContratoEnvolvidoJustificativa extends PersistentObjectAudit { | ||
52 | private String descricao; | 52 | private String descricao; |
53 | 53 | ||
54 | @ManyToOne(fetch = FetchType.LAZY, optional = true) | 54 | @ManyToOne(fetch = FetchType.LAZY, optional = true) |
55 | - private Contrato contrato; | 55 | + private ContratoEnvolvido contratoEnvolvido; |
56 | 56 | ||
57 | public Long getId() { | 57 | public Long getId() { |
58 | 58 | ||
@@ -67,17 +67,21 @@ public class ContratoEnvolvidoJustificativa extends PersistentObjectAudit { | @@ -67,17 +67,21 @@ public class ContratoEnvolvidoJustificativa extends PersistentObjectAudit { | ||
67 | public String getDescricao() { | 67 | public String getDescricao() { |
68 | return descricao; | 68 | return descricao; |
69 | } | 69 | } |
70 | - | 70 | + |
71 | public void setDescricao(String descricao) { | 71 | public void setDescricao(String descricao) { |
72 | this.descricao = descricao; | 72 | this.descricao = descricao; |
73 | } | 73 | } |
74 | - | ||
75 | - public Contrato getContrato() { | ||
76 | - return contrato; | 74 | + |
75 | + | ||
76 | + public ContratoEnvolvido getContratoEnvolvido() { | ||
77 | + | ||
78 | + return contratoEnvolvido; | ||
77 | } | 79 | } |
78 | 80 | ||
79 | - public void setContrato(Contrato contrato) { | ||
80 | - this.contrato = contrato; | 81 | + |
82 | + public void setContratoEnvolvido(ContratoEnvolvido contratoEnvolvido) { | ||
83 | + | ||
84 | + this.contratoEnvolvido = contratoEnvolvido; | ||
81 | } | 85 | } |
82 | 86 | ||
83 | } | 87 | } |
cit-contratos-api/src/main/java/br/com/centralit/api/model/EventoRecebimentoObjeto.java
@@ -97,11 +97,6 @@ public class EventoRecebimentoObjeto extends ContratoEvento { | @@ -97,11 +97,6 @@ public class EventoRecebimentoObjeto extends ContratoEvento { | ||
97 | @JsonView({ ViewsContrato.EventoRecebimentoObjetoEditView.class }) | 97 | @JsonView({ ViewsContrato.EventoRecebimentoObjetoEditView.class }) |
98 | private Dominio tipoAvaliacaoAdesao; | 98 | private Dominio tipoAvaliacaoAdesao; |
99 | 99 | ||
100 | - /** Atributo nomeObjeto. */ | ||
101 | - @Column(length = 200, nullable = false) | ||
102 | - @JsonView({ ViewsContrato.EventoRecebimentoObjetoEditView.class }) | ||
103 | - private String nomeObjeto; | ||
104 | - | ||
105 | /** Atributo justificativa. */ | 100 | /** Atributo justificativa. */ |
106 | @Column(length = 2000, nullable = true) | 101 | @Column(length = 2000, nullable = true) |
107 | @JsonView({ ViewsContrato.EventoRecebimentoObjetoEditView.class }) | 102 | @JsonView({ ViewsContrato.EventoRecebimentoObjetoEditView.class }) |
@@ -177,27 +172,6 @@ public class EventoRecebimentoObjeto extends ContratoEvento { | @@ -177,27 +172,6 @@ public class EventoRecebimentoObjeto extends ContratoEvento { | ||
177 | this.tipoStatus = tipoStatus; | 172 | this.tipoStatus = tipoStatus; |
178 | } | 173 | } |
179 | 174 | ||
180 | - | ||
181 | - /** | ||
182 | - * Retorna o valor do atributo <code>nomeObjeto</code> | ||
183 | - * | ||
184 | - * @return <code>String</code> | ||
185 | - */ | ||
186 | - public String getNomeObjeto() { | ||
187 | - | ||
188 | - return nomeObjeto; | ||
189 | - } | ||
190 | - | ||
191 | - /** | ||
192 | - * Define o valor do atributo <code>nomeObjeto</code>. | ||
193 | - * | ||
194 | - * @param nomeObjeto | ||
195 | - */ | ||
196 | - public void setNomeObjeto(String nomeObjeto) { | ||
197 | - | ||
198 | - this.nomeObjeto = nomeObjeto; | ||
199 | - } | ||
200 | - | ||
201 | public Dominio getTipoAvaliacaoPrazo() { | 175 | public Dominio getTipoAvaliacaoPrazo() { |
202 | 176 | ||
203 | return tipoAvaliacaoPrazo; | 177 | return tipoAvaliacaoPrazo; |
cit-contratos-api/src/main/java/br/com/centralit/api/model/RegistroSequencial.java
@@ -39,7 +39,7 @@ public class RegistroSequencial { | @@ -39,7 +39,7 @@ public class RegistroSequencial { | ||
39 | @Transient | 39 | @Transient |
40 | @JsonView({ ViewsContrato.EventoPenalidadeEditView.class, Views.GenericView.class }) | 40 | @JsonView({ ViewsContrato.EventoPenalidadeEditView.class, Views.GenericView.class }) |
41 | private String sequencialAnoFormatado; | 41 | private String sequencialAnoFormatado; |
42 | - | 42 | + |
43 | public RegistroSequencial() {}; | 43 | public RegistroSequencial() {}; |
44 | 44 | ||
45 | public RegistroSequencial( Long numeroSequencial, String sequencialAno ) { | 45 | public RegistroSequencial( Long numeroSequencial, String sequencialAno ) { |
@@ -70,12 +70,12 @@ public class RegistroSequencial { | @@ -70,12 +70,12 @@ public class RegistroSequencial { | ||
70 | 70 | ||
71 | public String getSequencialAnoFormatado() { | 71 | public String getSequencialAnoFormatado() { |
72 | if (StringUtils.isNotEmpty(sequencialAno)) { | 72 | if (StringUtils.isNotEmpty(sequencialAno)) { |
73 | - sequencialAnoFormatado = StringUtils.leftPad(sequencialAno, 7, '0'); | ||
74 | - sequencialAnoFormatado = sequencialAnoFormatado.substring(0, 3).concat("/").concat(sequencialAnoFormatado.substring(3)); | 73 | + sequencialAnoFormatado = StringUtils.leftPad(sequencialAno, 9, '0'); |
74 | + sequencialAnoFormatado = sequencialAnoFormatado.substring(0, 5).concat("/").concat(sequencialAnoFormatado.substring(5)); | ||
75 | } | 75 | } |
76 | return sequencialAnoFormatado; | 76 | return sequencialAnoFormatado; |
77 | } | 77 | } |
78 | - | 78 | + |
79 | public void setSequencialAnoFormatado(String sequencialAnoFormatado) { | 79 | public void setSequencialAnoFormatado(String sequencialAnoFormatado) { |
80 | this.sequencialAnoFormatado = sequencialAnoFormatado; | 80 | this.sequencialAnoFormatado = sequencialAnoFormatado; |
81 | } | 81 | } |
cit-contratos-api/src/main/java/br/com/centralit/api/service/EventoAditivoService.java
1 | package br.com.centralit.api.service; | 1 | package br.com.centralit.api.service; |
2 | 2 | ||
3 | -import java.io.InputStream; | ||
4 | import java.sql.Connection; | 3 | import java.sql.Connection; |
5 | import java.util.Collection; | 4 | import java.util.Collection; |
6 | 5 | ||
@@ -28,4 +27,8 @@ public interface EventoAditivoService extends GenericService<EventoAditivo, Long | @@ -28,4 +27,8 @@ public interface EventoAditivoService extends GenericService<EventoAditivo, Long | ||
28 | Collection<EventoAditivo> findAllByContrato(Long contratoId); | 27 | Collection<EventoAditivo> findAllByContrato(Long contratoId); |
29 | 28 | ||
30 | JasperPrint getJasperPrintAditivo(Long idAditivo, Connection conn, Usuario user, String titulo) throws JRException; | 29 | JasperPrint getJasperPrintAditivo(Long idAditivo, Connection conn, Usuario user, String titulo) throws JRException; |
30 | + | ||
31 | + Boolean permiteExclusaoAditivo(Long idAditivo); | ||
32 | + | ||
33 | + Boolean existeAditivoPrazoPosterior(Long idAditivo); | ||
31 | } | 34 | } |
cit-contratos-api/src/main/java/br/com/centralit/api/service/impl/ContratoServiceImpl.java
@@ -8,6 +8,7 @@ import java.util.Currency; | @@ -8,6 +8,7 @@ import java.util.Currency; | ||
8 | import java.util.Iterator; | 8 | import java.util.Iterator; |
9 | import java.util.List; | 9 | import java.util.List; |
10 | 10 | ||
11 | +import org.apache.commons.collections.CollectionUtils; | ||
11 | import org.springframework.beans.factory.annotation.Autowired; | 12 | import org.springframework.beans.factory.annotation.Autowired; |
12 | import org.springframework.beans.factory.annotation.Qualifier; | 13 | import org.springframework.beans.factory.annotation.Qualifier; |
13 | import org.springframework.security.core.context.SecurityContextHolder; | 14 | import org.springframework.security.core.context.SecurityContextHolder; |
@@ -38,7 +39,6 @@ import br.com.centralit.api.service.EstudoTecnicoService; | @@ -38,7 +39,6 @@ import br.com.centralit.api.service.EstudoTecnicoService; | ||
38 | import br.com.centralit.api.service.EventoAditivoService; | 39 | import br.com.centralit.api.service.EventoAditivoService; |
39 | import br.com.centralit.api.service.FornecedorService; | 40 | import br.com.centralit.api.service.FornecedorService; |
40 | import br.com.centralit.api.service.InternacionalizacaoService; | 41 | import br.com.centralit.api.service.InternacionalizacaoService; |
41 | -import br.com.centralit.api.service.OrdemFornecimentoService; | ||
42 | import br.com.centralit.api.service.ParceiroService; | 42 | import br.com.centralit.api.service.ParceiroService; |
43 | import br.com.centralit.api.service.UsuarioService; | 43 | import br.com.centralit.api.service.UsuarioService; |
44 | import br.com.centralit.framework.exception.CodigoErro; | 44 | import br.com.centralit.framework.exception.CodigoErro; |
@@ -115,9 +115,6 @@ public class ContratoServiceImpl extends GenericServiceImpl<Contrato, Long> impl | @@ -115,9 +115,6 @@ public class ContratoServiceImpl extends GenericServiceImpl<Contrato, Long> impl | ||
115 | @Autowired | 115 | @Autowired |
116 | private EventoAditivoService aditivoService; | 116 | private EventoAditivoService aditivoService; |
117 | 117 | ||
118 | - @Autowired | ||
119 | - private OrdemFornecimentoService ordemFornecimentoService; | ||
120 | - | ||
121 | /** | 118 | /** |
122 | * Responsável pela criação de novas instâncias desta classe. | 119 | * Responsável pela criação de novas instâncias desta classe. |
123 | * @param contratoDao | 120 | * @param contratoDao |
@@ -277,25 +274,19 @@ public class ContratoServiceImpl extends GenericServiceImpl<Contrato, Long> impl | @@ -277,25 +274,19 @@ public class ContratoServiceImpl extends GenericServiceImpl<Contrato, Long> impl | ||
277 | } | 274 | } |
278 | } | 275 | } |
279 | 276 | ||
280 | - // cria vinculo do contrato com as ctrtItens | ||
281 | - if (!UtilColecao.isVazio(contrato.getCtrtEnvolvidos())){ | ||
282 | - | 277 | + // cria vinculo do contrato com os envolvidos |
278 | + if (CollectionUtils.isNotEmpty(contrato.getCtrtEnvolvidos())){ | ||
283 | for (ContratoEnvolvido contratoEnvolvido : contrato.getCtrtEnvolvidos()) { | 279 | for (ContratoEnvolvido contratoEnvolvido : contrato.getCtrtEnvolvidos()) { |
284 | - | ||
285 | contratoEnvolvido.setEnvolvido(this.colaboradorService.find(contratoEnvolvido.getEnvolvido().getId())); | 280 | contratoEnvolvido.setEnvolvido(this.colaboradorService.find(contratoEnvolvido.getEnvolvido().getId())); |
286 | - | ||
287 | contratoEnvolvido.setContrato(contrato); | 281 | contratoEnvolvido.setContrato(contrato); |
282 | + if (CollectionUtils.isNotEmpty(contratoEnvolvido.getJustificativas())){ | ||
283 | + for(ContratoEnvolvidoJustificativa justificativa : contratoEnvolvido.getJustificativas()){ | ||
284 | + justificativa.setContratoEnvolvido(contratoEnvolvido); | ||
285 | + justificativa.setAutor(this.usuarioService.find(justificativa.getAutor().getId())); | ||
286 | + } | ||
287 | + } | ||
288 | } | 288 | } |
289 | - } | ||
290 | - | ||
291 | - // cria vinculo do contrato com as justificativas de alterções dos envolvidos | ||
292 | - if (!UtilColecao.isVazio(contrato.getJustificativas())){ | ||
293 | - | ||
294 | - for (ContratoEnvolvidoJustificativa justificativa : contrato.getJustificativas()) { | ||
295 | - | ||
296 | - justificativa.setContrato(contrato); | ||
297 | } | 289 | } |
298 | - } | ||
299 | 290 | ||
300 | if (!UtilColecao.isVazio(contrato.getAditivos())){ | 291 | if (!UtilColecao.isVazio(contrato.getAditivos())){ |
301 | for (EventoAditivo aditivo : contrato.getAditivos()) { | 292 | for (EventoAditivo aditivo : contrato.getAditivos()) { |
cit-contratos-api/src/main/java/br/com/centralit/api/service/impl/EventoAditivoServiceImpl.java
@@ -6,6 +6,7 @@ import java.text.DecimalFormat; | @@ -6,6 +6,7 @@ import java.text.DecimalFormat; | ||
6 | import java.text.SimpleDateFormat; | 6 | import java.text.SimpleDateFormat; |
7 | import java.util.Calendar; | 7 | import java.util.Calendar; |
8 | import java.util.Collection; | 8 | import java.util.Collection; |
9 | +import java.util.GregorianCalendar; | ||
9 | import java.util.HashMap; | 10 | import java.util.HashMap; |
10 | import java.util.Map; | 11 | import java.util.Map; |
11 | 12 | ||
@@ -40,6 +41,7 @@ import br.com.centralit.framework.model.Usuario; | @@ -40,6 +41,7 @@ import br.com.centralit.framework.model.Usuario; | ||
40 | import br.com.centralit.framework.service.arquitetura.GenericServiceImpl; | 41 | import br.com.centralit.framework.service.arquitetura.GenericServiceImpl; |
41 | import br.com.centralit.framework.util.Util; | 42 | import br.com.centralit.framework.util.Util; |
42 | import br.com.centralit.framework.util.UtilDataBase; | 43 | import br.com.centralit.framework.util.UtilDataBase; |
44 | +import br.com.centralit.framework.util.UtilDate; | ||
43 | import br.com.centralit.framework.util.UtilObjeto; | 45 | import br.com.centralit.framework.util.UtilObjeto; |
44 | 46 | ||
45 | /** | 47 | /** |
@@ -257,4 +259,32 @@ public class EventoAditivoServiceImpl extends GenericServiceImpl<EventoAditivo, | @@ -257,4 +259,32 @@ public class EventoAditivoServiceImpl extends GenericServiceImpl<EventoAditivo, | ||
257 | } | 259 | } |
258 | } | 260 | } |
259 | 261 | ||
262 | + @Override | ||
263 | + public Boolean permiteExclusaoAditivo(Long idAditivo) { | ||
264 | + EventoAditivo aditivo = this.find(idAditivo); | ||
265 | + | ||
266 | + if(aditivo.getDataInicio().before(GregorianCalendar.getInstance()) ){ | ||
267 | + return false; | ||
268 | + } | ||
269 | + | ||
270 | + if(UtilDate.isMesmaData(aditivo.getDataInicio(), GregorianCalendar.getInstance())){ | ||
271 | + return false; | ||
272 | + } | ||
273 | + | ||
274 | + if(this.eventoAditivoDao.existeAditivoPosterior(aditivo.getDataInicio(), aditivo.getContrato().getId())){ | ||
275 | + return false; | ||
276 | + } | ||
277 | + | ||
278 | + return true; | ||
279 | + } | ||
280 | + | ||
281 | + @Override | ||
282 | + public Boolean existeAditivoPrazoPosterior(Long idAditivo) { | ||
283 | + EventoAditivo aditivo = this.find(idAditivo); | ||
284 | + if(this.eventoAditivoDao.existeAditivoPosterior(aditivo.getDataInicio(), aditivo.getContrato().getId())){ | ||
285 | + return true; | ||
286 | + } | ||
287 | + return false; | ||
288 | + } | ||
289 | + | ||
260 | } | 290 | } |
cit-contratos-api/src/main/java/br/com/centralit/api/service/impl/InicializarContratosServiceImpl.java
@@ -60,11 +60,11 @@ public class InicializarContratosServiceImpl extends UtilStartup { | @@ -60,11 +60,11 @@ public class InicializarContratosServiceImpl extends UtilStartup { | ||
60 | this.menuContratos = this.menuService.mergeIfNotExist(this.menuContratos); | 60 | this.menuContratos = this.menuService.mergeIfNotExist(this.menuContratos); |
61 | 61 | ||
62 | // Submenu Demandas | 62 | // Submenu Demandas |
63 | - criarSubMenuDemandas(moduloSelecionado); | 63 | +// criarSubMenuDemandas(moduloSelecionado); |
64 | // Submenu Planejamento da contratação | 64 | // Submenu Planejamento da contratação |
65 | criarSubMenuPlanejamentoContratacao(moduloSelecionado); | 65 | criarSubMenuPlanejamentoContratacao(moduloSelecionado); |
66 | // Submenu Seleção de fornecedor | 66 | // Submenu Seleção de fornecedor |
67 | - criarSubMenuSelecaoFornecedor(moduloSelecionado); | 67 | +// criarSubMenuSelecaoFornecedor(moduloSelecionado); |
68 | // Submenu Gestão e fiscalização de contrato | 68 | // Submenu Gestão e fiscalização de contrato |
69 | criarSubMenuGestaoFiscalizacaoContrato(moduloSelecionado); | 69 | criarSubMenuGestaoFiscalizacaoContrato(moduloSelecionado); |
70 | // Submenu Controles | 70 | // Submenu Controles |
@@ -98,7 +98,7 @@ public class InicializarContratosServiceImpl extends UtilStartup { | @@ -98,7 +98,7 @@ public class InicializarContratosServiceImpl extends UtilStartup { | ||
98 | // Menu Termo de referência / Projeto básico | 98 | // Menu Termo de referência / Projeto básico |
99 | criarOpcaoTermoReferenciaProjetoBasico(modulo, menuPlanejamentoContrat); | 99 | criarOpcaoTermoReferenciaProjetoBasico(modulo, menuPlanejamentoContrat); |
100 | // Menu Gestão de riscos | 100 | // Menu Gestão de riscos |
101 | - criarOpcaoGestaoRiscos(modulo, menuPlanejamentoContrat); | 101 | +// criarOpcaoGestaoRiscos(modulo, menuPlanejamentoContrat); |
102 | } | 102 | } |
103 | 103 | ||
104 | private void criarSubMenuSelecaoFornecedor(Modulo modulo) { | 104 | private void criarSubMenuSelecaoFornecedor(Modulo modulo) { |
@@ -136,17 +136,17 @@ public class InicializarContratosServiceImpl extends UtilStartup { | @@ -136,17 +136,17 @@ public class InicializarContratosServiceImpl extends UtilStartup { | ||
136 | menuControles = this.menuService.mergeIfNotExist(menuControles); | 136 | menuControles = this.menuService.mergeIfNotExist(menuControles); |
137 | 137 | ||
138 | // Menu Controle de registro de preços | 138 | // Menu Controle de registro de preços |
139 | - criarOpcaoControleRegistroPrecos(modulo, menuControles); | 139 | +// criarOpcaoControleRegistroPrecos(modulo, menuControles); |
140 | // Menu Checklist de verificação do planejamento da contratação | 140 | // Menu Checklist de verificação do planejamento da contratação |
141 | - criarOpcaoChecklistVerificacaoPlanejamentoContratacao(modulo, menuControles); | 141 | +// criarOpcaoChecklistVerificacaoPlanejamentoContratacao(modulo, menuControles); |
142 | // Menu Questionarios | 142 | // Menu Questionarios |
143 | criarOpcaoQuestionario(modulo, menuControles); | 143 | criarOpcaoQuestionario(modulo, menuControles); |
144 | // Menu Alertas | 144 | // Menu Alertas |
145 | - criarOpcaoAlertas(modulo, menuControles); | 145 | +// criarOpcaoAlertas(modulo, menuControles); |
146 | // Menu Indicadores | 146 | // Menu Indicadores |
147 | - criarOpcaoIndicacores(modulo, menuControles); | 147 | +// criarOpcaoIndicacores(modulo, menuControles); |
148 | // Menu Definições de contratos | 148 | // Menu Definições de contratos |
149 | - criarOpcaoDefinicoesContratos(modulo, menuControles); | 149 | +// criarOpcaoDefinicoesContratos(modulo, menuControles); |
150 | } | 150 | } |
151 | 151 | ||
152 | private void criarSubMenuTermosRelatorios(Modulo modulo) { | 152 | private void criarSubMenuTermosRelatorios(Modulo modulo) { |
@@ -287,23 +287,8 @@ public class InicializarContratosServiceImpl extends UtilStartup { | @@ -287,23 +287,8 @@ public class InicializarContratosServiceImpl extends UtilStartup { | ||
287 | paginaGestaoRisco = this.paginaService.saveIfNotExist(paginaGestaoRisco); | 287 | paginaGestaoRisco = this.paginaService.saveIfNotExist(paginaGestaoRisco); |
288 | Menu menuGestaoRisco = new Menu("Gestão de riscos", paginaGestaoRisco, menuPlanejamentoContrat, null, 5, null, null, null, null, modulo, "GESTAO_RISCOS"); | 288 | Menu menuGestaoRisco = new Menu("Gestão de riscos", paginaGestaoRisco, menuPlanejamentoContrat, null, 5, null, null, null, null, modulo, "GESTAO_RISCOS"); |
289 | 289 | ||
290 | - List<MenuFile> filesMenuFileTermo = new ArrayList<MenuFile>(); | ||
291 | - filesMenuFileTermo.add(new MenuFile(CIT_CONTRATOS_WEB_ANGULAR_CUSTOM + "controller/TermoReferenciaListController.js", this.dominioJS, menuGestaoRisco)); | ||
292 | - filesMenuFileTermo.add(new MenuFile(CIT_CONTRATOS_WEB_ANGULAR_CUSTOM + "controller/TermoReferenciaListController.min.js", this.dominioJS, menuGestaoRisco)); | ||
293 | - filesMenuFileTermo.add(new MenuFile(CIT_CONTRATOS_WEB_ANGULAR_CUSTOM + "controller/TermoReferenciaController.js", this.dominioJS, menuGestaoRisco)); | ||
294 | - filesMenuFileTermo.add(new MenuFile(CIT_CONTRATOS_WEB_ANGULAR_CUSTOM + "controller/TermoReferenciaController.min.js", this.dominioJS, menuGestaoRisco)); | ||
295 | - filesMenuFileTermo.add(new MenuFile(CIT_CONTRATOS_WEB_ANGULAR_CUSTOM + "repository/TermoReferenciaRepository.js", this.dominioJS, menuGestaoRisco)); | ||
296 | - filesMenuFileTermo.add(new MenuFile(CIT_CONTRATOS_WEB_ANGULAR_CUSTOM + "repository/TermoReferenciaRepository.min.js", this.dominioJS, menuGestaoRisco)); | ||
297 | - | ||
298 | - filesMenuFileTermo.add(new MenuFile(CIT_CONTRATOS_WEB_ANGULAR_CUSTOM + "repository/TermoReferenciaSancaoRepository.js", this.dominioJS, menuGestaoRisco)); | ||
299 | - filesMenuFileTermo.add(new MenuFile(CIT_CONTRATOS_WEB_ANGULAR_CUSTOM + "repository/TermoReferenciaSancaoRepository.min.js", this.dominioJS, menuGestaoRisco)); | ||
300 | - | ||
301 | - filesMenuFileTermo.add(new MenuFile(CIT_CONTRATOS_WEB_ANGULAR_CUSTOM + "repository/TermoReferenciaPenalidadeRepository.js", this.dominioJS, menuGestaoRisco)); | ||
302 | - filesMenuFileTermo.add(new MenuFile(CIT_CONTRATOS_WEB_ANGULAR_CUSTOM + "repository/TermoReferenciaPenalidadeRepository.min.js", this.dominioJS, menuGestaoRisco)); | ||
303 | - | ||
304 | - filesMenuFileTermo.add(new MenuFile(CIT_CONTRATOS_WEB_ANGULAR_CUSTOM + "repository/TermoReferenciaDetalhamentoSolucaoRepository.js", this.dominioJS, menuGestaoRisco)); | ||
305 | - filesMenuFileTermo.add(new MenuFile(CIT_CONTRATOS_WEB_ANGULAR_CUSTOM + "repository/TermoReferenciaDetalhamentoSolucaoRepository.min.js", this.dominioJS, menuGestaoRisco)); | ||
306 | - menuGestaoRisco.setIncludes(filesMenuFileTermo); | 290 | + List<MenuFile> filesMenuFileGestao = new ArrayList<MenuFile>(); |
291 | + menuGestaoRisco.setIncludes(filesMenuFileGestao); | ||
307 | 292 | ||
308 | this.menuService.mergeIfNotExist(menuGestaoRisco); | 293 | this.menuService.mergeIfNotExist(menuGestaoRisco); |
309 | } | 294 | } |
cit-contratos-api/src/main/java/br/com/centralit/api/service/validation/EventoAditivoValidator.java
1 | package br.com.centralit.api.service.validation; | 1 | package br.com.centralit.api.service.validation; |
2 | 2 | ||
3 | import java.math.BigDecimal; | 3 | import java.math.BigDecimal; |
4 | +import java.sql.Timestamp; | ||
4 | import java.util.Calendar; | 5 | import java.util.Calendar; |
5 | 6 | ||
6 | import org.springframework.stereotype.Component; | 7 | import org.springframework.stereotype.Component; |
@@ -11,11 +12,12 @@ import org.springframework.validation.Validator; | @@ -11,11 +12,12 @@ import org.springframework.validation.Validator; | ||
11 | import br.com.centralit.api.model.DominioContrato; | 12 | import br.com.centralit.api.model.DominioContrato; |
12 | import br.com.centralit.api.model.EventoAditivo; | 13 | import br.com.centralit.api.model.EventoAditivo; |
13 | import br.com.centralit.framework.exception.CodigoErro; | 14 | import br.com.centralit.framework.exception.CodigoErro; |
15 | +import br.com.centralit.framework.util.UtilDate; | ||
14 | import br.com.centralit.framework.util.UtilObjeto; | 16 | import br.com.centralit.framework.util.UtilObjeto; |
15 | 17 | ||
16 | 18 | ||
17 | /** | 19 | /** |
18 | - * | 20 | + * |
19 | * <p><img src="http://centralit.com.br/images/logo_central.png"></p> | 21 | * <p><img src="http://centralit.com.br/images/logo_central.png"></p> |
20 | * | 22 | * |
21 | * <p><b>Company: </b> Central IT - Governança Corporativa - </p> | 23 | * <p><b>Company: </b> Central IT - Governança Corporativa - </p> |
@@ -23,11 +25,11 @@ import br.com.centralit.framework.util.UtilObjeto; | @@ -23,11 +25,11 @@ import br.com.centralit.framework.util.UtilObjeto; | ||
23 | * <p><b>Title: </b></p> | 25 | * <p><b>Title: </b></p> |
24 | * | 26 | * |
25 | * <p><b>Description: </b></p> | 27 | * <p><b>Description: </b></p> |
26 | - * | 28 | + * |
27 | * <p><b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a></p> | 29 | * <p><b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a></p> |
28 | * | 30 | * |
29 | - * <p><b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a></p> | ||
30 | - * | 31 | + * <p><b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a></p> |
32 | + * | ||
31 | * @since 16/03/2016 - 11:10:02 | 33 | * @since 16/03/2016 - 11:10:02 |
32 | * | 34 | * |
33 | * @version 1.0.0 | 35 | * @version 1.0.0 |
@@ -56,98 +58,115 @@ public class EventoAditivoValidator implements Validator{ | @@ -56,98 +58,115 @@ public class EventoAditivoValidator implements Validator{ | ||
56 | 58 | ||
57 | EventoAditivo aditivo = (EventoAditivo) target; | 59 | EventoAditivo aditivo = (EventoAditivo) target; |
58 | Calendar dataFinal = null; | 60 | Calendar dataFinal = null; |
59 | - | ||
60 | - ValidationUtils.rejectIfEmpty(errors, "contrato", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "LABEL.CONTRATO"); | ||
61 | - | ||
62 | - if (UtilObjeto.isReferencia(aditivo.getContrato())) { | 61 | + if(UtilObjeto.isReferencia(aditivo.getContrato())){ |
63 | dataFinal = aditivo.getContrato().getDataVigenciaFinal(); | 62 | dataFinal = aditivo.getContrato().getDataVigenciaFinal(); |
64 | - | 63 | + } |
64 | + ValidationUtils.rejectIfEmpty(errors, "contrato", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "LABEL.CONTRATO"); | ||
65 | + | ||
66 | + if (UtilObjeto.isReferencia(aditivo.getContrato()) && !UtilObjeto.isReferencia(aditivo.getId())) { | ||
67 | + dataFinal = aditivo.getContrato().getDataUltimaVigenciaFinal(); | ||
68 | + }else{ | ||
65 | if (UtilObjeto.isReferencia(aditivo.getContrato().getAditivos())) { | 69 | if (UtilObjeto.isReferencia(aditivo.getContrato().getAditivos())) { |
66 | for (EventoAditivo adContrato : aditivo.getContrato().getAditivos()) { | 70 | for (EventoAditivo adContrato : aditivo.getContrato().getAditivos()) { |
67 | - if (((!UtilObjeto.isReferencia(aditivo.getId())) || (UtilObjeto.isReferencia(aditivo.getId()) && !adContrato.getId().equals(aditivo.getId()))) && adContrato.getAditivoDePrazo() && adContrato.getDataFim().after(dataFinal)) { | 71 | + if( adContrato.getAditivoDePrazo() && adContrato.getDataFim().before(aditivo.getDataInicio()) && adContrato.getDataFim().after(dataFinal)){ |
68 | dataFinal = adContrato.getDataFim(); | 72 | dataFinal = adContrato.getDataFim(); |
69 | } | 73 | } |
70 | } | 74 | } |
71 | } | 75 | } |
72 | } | 76 | } |
73 | 77 | ||
78 | + if(aditivo.getDataEmissao().after(aditivo.getDataInicio())){ | ||
79 | + errors.rejectValue("dataEmissao", CodigoErro.VALIDACAO_CAMPOS.getValue().toString(), "CONTRATOS.MSG.ADITIVO_DATA_EMISSAO_MAIOR_DATA_INICIO"); | ||
80 | + } | ||
81 | + | ||
74 | ValidationUtils.rejectIfEmpty(errors, "registroSequencial", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "CONTRATOS.LABEL.NUM_ADITIVO"); | 82 | ValidationUtils.rejectIfEmpty(errors, "registroSequencial", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "CONTRATOS.LABEL.NUM_ADITIVO"); |
75 | - | 83 | + |
76 | ValidationUtils.rejectIfEmpty(errors, "dataEmissao", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "LABEL.DATA_EMISSAO_OCORRENCIA"); | 84 | ValidationUtils.rejectIfEmpty(errors, "dataEmissao", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "LABEL.DATA_EMISSAO_OCORRENCIA"); |
77 | - | 85 | + |
78 | if (UtilObjeto.isReferencia(aditivo.getDataEmissao()) && UtilObjeto.isReferencia(aditivo.getContrato()) && | 86 | if (UtilObjeto.isReferencia(aditivo.getDataEmissao()) && UtilObjeto.isReferencia(aditivo.getContrato()) && |
79 | (aditivo.getDataEmissao().before(aditivo.getContrato().getDataVigenciaInicial()) || aditivo.getDataEmissao().after(dataFinal))) { | 87 | (aditivo.getDataEmissao().before(aditivo.getContrato().getDataVigenciaInicial()) || aditivo.getDataEmissao().after(dataFinal))) { |
80 | errors.rejectValue("dataEmissao", CodigoErro.VALIDACAO_CAMPOS.getValue().toString(), "CONTRATOS.MSG.DATA_EMISSAO_DENTRO_REFERENCIA"); | 88 | errors.rejectValue("dataEmissao", CodigoErro.VALIDACAO_CAMPOS.getValue().toString(), "CONTRATOS.MSG.DATA_EMISSAO_DENTRO_REFERENCIA"); |
81 | } | 89 | } |
82 | - | 90 | + |
83 | ValidationUtils.rejectIfEmpty(errors, "tipoAlteracao", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "LABEL.TIPO_ALTERACAO"); | 91 | ValidationUtils.rejectIfEmpty(errors, "tipoAlteracao", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "LABEL.TIPO_ALTERACAO"); |
84 | - | 92 | + |
85 | if (!(aditivo.getAditivoDeValor() || aditivo.getAditivoDePrazo() || aditivo.getAditivoDeClausula())) { | 93 | if (!(aditivo.getAditivoDeValor() || aditivo.getAditivoDePrazo() || aditivo.getAditivoDeClausula())) { |
86 | errors.rejectValue("aditivoDePrazo", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "CONTRATOS.LABEL.TIPO_ADITIVO"); | 94 | errors.rejectValue("aditivoDePrazo", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "CONTRATOS.LABEL.TIPO_ADITIVO"); |
87 | errors.rejectValue("aditivoDeValor", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "CONTRATOS.LABEL.TIPO_ADITIVO"); | 95 | errors.rejectValue("aditivoDeValor", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "CONTRATOS.LABEL.TIPO_ADITIVO"); |
88 | errors.rejectValue("aditivoDeClausula", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "CONTRATOS.LABEL.TIPO_ADITIVO"); | 96 | errors.rejectValue("aditivoDeClausula", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "CONTRATOS.LABEL.TIPO_ADITIVO"); |
89 | } | 97 | } |
90 | - | 98 | + |
91 | if (aditivo.getAditivoDePrazo()) { | 99 | if (aditivo.getAditivoDePrazo()) { |
92 | if (UtilObjeto.isReferencia(aditivo.getDataEmissao())) { | 100 | if (UtilObjeto.isReferencia(aditivo.getDataEmissao())) { |
93 | - Calendar ultimaDataEmissao = null; | 101 | + Calendar ultimaDataEmissaoAditivoAnterior = null; |
102 | + Calendar ultimaDataEmissaoAditivoPosterior = null; | ||
94 | int qntAditivoPrazo = 0; | 103 | int qntAditivoPrazo = 0; |
95 | if (UtilObjeto.isReferencia(aditivo.getContrato().getAditivos())) { | 104 | if (UtilObjeto.isReferencia(aditivo.getContrato().getAditivos())) { |
96 | for (EventoAditivo adContrato : aditivo.getContrato().getAditivos()) { | 105 | for (EventoAditivo adContrato : aditivo.getContrato().getAditivos()) { |
97 | if (((!UtilObjeto.isReferencia(aditivo.getId())) || (UtilObjeto.isReferencia(aditivo.getId()) && !adContrato.getId().equals(aditivo.getId()))) && adContrato.getAditivoDePrazo()) { | 106 | if (((!UtilObjeto.isReferencia(aditivo.getId())) || (UtilObjeto.isReferencia(aditivo.getId()) && !adContrato.getId().equals(aditivo.getId()))) && adContrato.getAditivoDePrazo()) { |
98 | qntAditivoPrazo++; | 107 | qntAditivoPrazo++; |
99 | - if (!UtilObjeto.isReferencia(ultimaDataEmissao)) { | ||
100 | - ultimaDataEmissao = adContrato.getDataEmissao(); | ||
101 | - } else { | ||
102 | - if (adContrato.getDataEmissao().after(ultimaDataEmissao)) { | ||
103 | - ultimaDataEmissao = adContrato.getDataEmissao(); | ||
104 | - } | 108 | + if (adContrato.getDataEmissao().before(aditivo.getDataEmissao())) { |
109 | + ultimaDataEmissaoAditivoAnterior = adContrato.getDataEmissao(); | ||
110 | + } | ||
111 | + if(adContrato.getDataEmissao().after(aditivo.getDataEmissao())){ | ||
112 | + ultimaDataEmissaoAditivoPosterior = adContrato.getDataEmissao(); | ||
105 | } | 113 | } |
106 | } | 114 | } |
107 | } | 115 | } |
108 | } | 116 | } |
109 | - | 117 | + |
110 | if (qntAditivoPrazo >= MAXIMO_ADITIVO_PRAZO) { | 118 | if (qntAditivoPrazo >= MAXIMO_ADITIVO_PRAZO) { |
111 | errors.rejectValue("aditivoDePrazo", CodigoErro.VALIDACAO_CAMPOS.getValue().toString(), "CONTRATOS.MSG.MAXIMO_ADITIVO_PRAZO"); | 119 | errors.rejectValue("aditivoDePrazo", CodigoErro.VALIDACAO_CAMPOS.getValue().toString(), "CONTRATOS.MSG.MAXIMO_ADITIVO_PRAZO"); |
112 | } | 120 | } |
113 | - | ||
114 | - if (UtilObjeto.isReferencia(ultimaDataEmissao)) { | ||
115 | - if (ultimaDataEmissao.get(Calendar.YEAR) < aditivo.getDataEmissao().get(Calendar.YEAR)) { | ||
116 | - if (ultimaDataEmissao.get(Calendar.MONTH) <= aditivo.getDataEmissao().get(Calendar.MONTH)) { | ||
117 | - if ((ultimaDataEmissao.get(Calendar.MONTH) == aditivo.getDataEmissao().get(Calendar.MONTH)) && | ||
118 | - ultimaDataEmissao.get(Calendar.DAY_OF_MONTH) >= aditivo.getDataEmissao().get(Calendar.DAY_OF_MONTH)) { | 121 | + |
122 | + if (UtilObjeto.isReferencia(ultimaDataEmissaoAditivoAnterior)) { | ||
123 | + | ||
124 | + if (ultimaDataEmissaoAditivoAnterior.get(Calendar.YEAR) < aditivo.getDataEmissao().get(Calendar.YEAR)) { | ||
125 | + if ( ultimaDataEmissaoAditivoAnterior.get(Calendar.MONTH) <= aditivo.getDataEmissao().get(Calendar.MONTH)) { | ||
126 | + if ((ultimaDataEmissaoAditivoAnterior.get(Calendar.MONTH) == aditivo.getDataEmissao().get(Calendar.MONTH)) && | ||
127 | + ultimaDataEmissaoAditivoAnterior.get(Calendar.DAY_OF_MONTH) > aditivo.getDataEmissao().get(Calendar.DAY_OF_MONTH)) { | ||
119 | errors.rejectValue("dataEmissao", CodigoErro.VALIDACAO_CAMPOS.getValue().toString(), "CONTRATOS.MSG.DATA_EMISSAO_12_MESES"); | 128 | errors.rejectValue("dataEmissao", CodigoErro.VALIDACAO_CAMPOS.getValue().toString(), "CONTRATOS.MSG.DATA_EMISSAO_12_MESES"); |
120 | } | 129 | } |
121 | - } else { | ||
122 | - errors.rejectValue("dataEmissao", CodigoErro.VALIDACAO_CAMPOS.getValue().toString(), "CONTRATOS.MSG.DATA_EMISSAO_12_MESES"); | ||
123 | } | 130 | } |
124 | } else { | 131 | } else { |
125 | errors.rejectValue("dataEmissao", CodigoErro.VALIDACAO_CAMPOS.getValue().toString(), "CONTRATOS.MSG.DATA_EMISSAO_12_MESES"); | 132 | errors.rejectValue("dataEmissao", CodigoErro.VALIDACAO_CAMPOS.getValue().toString(), "CONTRATOS.MSG.DATA_EMISSAO_12_MESES"); |
126 | } | 133 | } |
127 | } | 134 | } |
135 | + if (UtilObjeto.isReferencia(ultimaDataEmissaoAditivoPosterior)) { | ||
136 | + if (ultimaDataEmissaoAditivoPosterior.get(Calendar.YEAR) > aditivo.getDataEmissao().get(Calendar.YEAR)) { | ||
137 | + if (ultimaDataEmissaoAditivoPosterior.get(Calendar.MONTH) >= aditivo.getDataEmissao().get(Calendar.MONTH)) { | ||
138 | + if ((ultimaDataEmissaoAditivoPosterior.get(Calendar.MONTH) == aditivo.getDataEmissao().get(Calendar.MONTH)) && | ||
139 | + ultimaDataEmissaoAditivoPosterior.get(Calendar.DAY_OF_MONTH) < aditivo.getDataEmissao().get(Calendar.DAY_OF_MONTH)) { | ||
140 | + errors.rejectValue("dataEmissao", CodigoErro.VALIDACAO_CAMPOS.getValue().toString(), "CONTRATOS.MSG.DATA_EMISSAO_12_MESES_POSTERIOR"); | ||
141 | + } | ||
142 | + } | ||
143 | + } else { | ||
144 | + errors.rejectValue("dataEmissao", CodigoErro.VALIDACAO_CAMPOS.getValue().toString(), "CONTRATOS.MSG.DATA_EMISSAO_12_MESES_POSTERIOR"); | ||
145 | + } | ||
146 | + } | ||
128 | } | 147 | } |
129 | - | 148 | + |
130 | ValidationUtils.rejectIfEmpty(errors, "dataInicio", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "CONTRATOS.LABEL.DATA_INICIO_ADITIVO"); | 149 | ValidationUtils.rejectIfEmpty(errors, "dataInicio", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "CONTRATOS.LABEL.DATA_INICIO_ADITIVO"); |
131 | ValidationUtils.rejectIfEmpty(errors, "dataFim", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "CONTRATOS.LABEL.DATA_FINAL_ADITIVO"); | 150 | ValidationUtils.rejectIfEmpty(errors, "dataFim", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "CONTRATOS.LABEL.DATA_FINAL_ADITIVO"); |
132 | - | 151 | + |
133 | if (UtilObjeto.isReferencia(aditivo.getDataInicio()) && dataFinal.compareTo(aditivo.getDataInicio()) >= 0){ | 152 | if (UtilObjeto.isReferencia(aditivo.getDataInicio()) && dataFinal.compareTo(aditivo.getDataInicio()) >= 0){ |
134 | errors.rejectValue("dataInicio", CodigoErro.VALIDACAO_CAMPOS.getValue().toString(), "CONTRATOS.MSG.DATA_INICIO_ADITIVO_MAIOR_DATA_FINAL"); | 153 | errors.rejectValue("dataInicio", CodigoErro.VALIDACAO_CAMPOS.getValue().toString(), "CONTRATOS.MSG.DATA_INICIO_ADITIVO_MAIOR_DATA_FINAL"); |
135 | } | 154 | } |
136 | - | 155 | + |
137 | if (UtilObjeto.isReferencia(aditivo.getDataInicio()) && UtilObjeto.isReferencia(aditivo.getDataFim()) && aditivo.getDataInicio().compareTo(aditivo.getDataFim()) >= 0) { | 156 | if (UtilObjeto.isReferencia(aditivo.getDataInicio()) && UtilObjeto.isReferencia(aditivo.getDataFim()) && aditivo.getDataInicio().compareTo(aditivo.getDataFim()) >= 0) { |
138 | errors.rejectValue("dataInicio", CodigoErro.VALIDACAO_CAMPOS.getValue().toString(), "CONTRATOS.MSG.DATA_INICIO_ADITIVO_MAIOR_DATA_FIM_ADITIVO"); | 157 | errors.rejectValue("dataInicio", CodigoErro.VALIDACAO_CAMPOS.getValue().toString(), "CONTRATOS.MSG.DATA_INICIO_ADITIVO_MAIOR_DATA_FIM_ADITIVO"); |
139 | } | 158 | } |
140 | } | 159 | } |
141 | - | 160 | + |
142 | if (aditivo.getAditivoDeValor()) { | 161 | if (aditivo.getAditivoDeValor()) { |
143 | ValidationUtils.rejectIfEmpty(errors, "tipoAlteracaoValor", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "LABEL.TIPO_ALTERACAO"); | 162 | ValidationUtils.rejectIfEmpty(errors, "tipoAlteracaoValor", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "LABEL.TIPO_ALTERACAO"); |
144 | ValidationUtils.rejectIfEmpty(errors, "tipoObjeto", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "CONTRATOS.LABEL.TIPO_OBJETO"); | 163 | ValidationUtils.rejectIfEmpty(errors, "tipoObjeto", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "CONTRATOS.LABEL.TIPO_OBJETO"); |
145 | ValidationUtils.rejectIfEmpty(errors, "valorAditivo", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "CONTRATOS.LABEL.VALOR_ADITIVO"); | 164 | ValidationUtils.rejectIfEmpty(errors, "valorAditivo", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "CONTRATOS.LABEL.VALOR_ADITIVO"); |
146 | ValidationUtils.rejectIfEmpty(errors, "percentualAditivo", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "CONTRATOS.LABEL.PERCENTUAL_ADITIVO"); | 165 | ValidationUtils.rejectIfEmpty(errors, "percentualAditivo", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "CONTRATOS.LABEL.PERCENTUAL_ADITIVO"); |
147 | - | 166 | + |
148 | Calendar dataInicioPrazo = null; | 167 | Calendar dataInicioPrazo = null; |
149 | Calendar dataFimPrazo = null; | 168 | Calendar dataFimPrazo = null; |
150 | - | 169 | + |
151 | if (UtilObjeto.isReferencia(aditivo.getContrato())) { | 170 | if (UtilObjeto.isReferencia(aditivo.getContrato())) { |
152 | if (dataDentroPrazo(aditivo.getDataEmissao(), aditivo.getContrato().getDataVigenciaInicial(), aditivo.getContrato().getDataVigenciaFinal())) { | 171 | if (dataDentroPrazo(aditivo.getDataEmissao(), aditivo.getContrato().getDataVigenciaInicial(), aditivo.getContrato().getDataVigenciaFinal())) { |
153 | dataInicioPrazo = aditivo.getContrato().getDataVigenciaInicial(); | 172 | dataInicioPrazo = aditivo.getContrato().getDataVigenciaInicial(); |
@@ -164,16 +183,16 @@ public class EventoAditivoValidator implements Validator{ | @@ -164,16 +183,16 @@ public class EventoAditivoValidator implements Validator{ | ||
164 | } | 183 | } |
165 | } | 184 | } |
166 | } | 185 | } |
167 | - | 186 | + |
168 | if (UtilObjeto.isReferencia(dataInicioPrazo) && UtilObjeto.isReferencia(dataFimPrazo)) { | 187 | if (UtilObjeto.isReferencia(dataInicioPrazo) && UtilObjeto.isReferencia(dataFimPrazo)) { |
169 | BigDecimal percentualTotalAditivo = BigDecimal.ZERO; | 188 | BigDecimal percentualTotalAditivo = BigDecimal.ZERO; |
170 | - | 189 | + |
171 | if (aditivo.getTipoAlteracaoValor().getCodigo().equals(DominioContrato.CODIGO_TIPO_ALTERACAO_VALOR_ACRESCIMO)) { | 190 | if (aditivo.getTipoAlteracaoValor().getCodigo().equals(DominioContrato.CODIGO_TIPO_ALTERACAO_VALOR_ACRESCIMO)) { |
172 | percentualTotalAditivo = percentualTotalAditivo.add(aditivo.getPercentualAditivo()); | 191 | percentualTotalAditivo = percentualTotalAditivo.add(aditivo.getPercentualAditivo()); |
173 | } else if (aditivo.getTipoAlteracaoValor().getCodigo().equals(DominioContrato.CODIGO_TIPO_ALTERACAO_VALOR_SUPRESSAO)) { | 192 | } else if (aditivo.getTipoAlteracaoValor().getCodigo().equals(DominioContrato.CODIGO_TIPO_ALTERACAO_VALOR_SUPRESSAO)) { |
174 | percentualTotalAditivo = percentualTotalAditivo.subtract(aditivo.getPercentualAditivo()); | 193 | percentualTotalAditivo = percentualTotalAditivo.subtract(aditivo.getPercentualAditivo()); |
175 | } | 194 | } |
176 | - | 195 | + |
177 | if (UtilObjeto.isReferencia(aditivo.getContrato().getAditivos())) { | 196 | if (UtilObjeto.isReferencia(aditivo.getContrato().getAditivos())) { |
178 | for (EventoAditivo adContrato : aditivo.getContrato().getAditivos()) { | 197 | for (EventoAditivo adContrato : aditivo.getContrato().getAditivos()) { |
179 | if (((!UtilObjeto.isReferencia(aditivo.getId())) || (UtilObjeto.isReferencia(aditivo.getId()) && !adContrato.getId().equals(aditivo.getId()))) && adContrato.getAditivoDeValor() && dataDentroPrazo(adContrato.getDataEmissao(), dataInicioPrazo, dataFimPrazo) && | 198 | if (((!UtilObjeto.isReferencia(aditivo.getId())) || (UtilObjeto.isReferencia(aditivo.getId()) && !adContrato.getId().equals(aditivo.getId()))) && adContrato.getAditivoDeValor() && dataDentroPrazo(adContrato.getDataEmissao(), dataInicioPrazo, dataFimPrazo) && |
@@ -186,7 +205,7 @@ public class EventoAditivoValidator implements Validator{ | @@ -186,7 +205,7 @@ public class EventoAditivoValidator implements Validator{ | ||
186 | } | 205 | } |
187 | } | 206 | } |
188 | } | 207 | } |
189 | - | 208 | + |
190 | if (aditivo.getTipoObjeto().getCodigo().equals(DominioContrato.CODIGO_TIPO_OBJETO_OBRAS_SERVICOS_COMPRAS)) { | 209 | if (aditivo.getTipoObjeto().getCodigo().equals(DominioContrato.CODIGO_TIPO_OBJETO_OBRAS_SERVICOS_COMPRAS)) { |
191 | if (percentualTotalAditivo.abs().compareTo(PERCENTAGEM_MAXIMA_OBRAS_SERVICOS_COMPRAS) > 0) { | 210 | if (percentualTotalAditivo.abs().compareTo(PERCENTAGEM_MAXIMA_OBRAS_SERVICOS_COMPRAS) > 0) { |
192 | errors.rejectValue("percentualAditivo", CodigoErro.VALIDACAO_CAMPOS.getValue().toString(), "CONTRATOS.MSG.PERCENTAGEM_MAIOR_OBRAS_SERVICOS_COMPRAS"); | 211 | errors.rejectValue("percentualAditivo", CodigoErro.VALIDACAO_CAMPOS.getValue().toString(), "CONTRATOS.MSG.PERCENTAGEM_MAIOR_OBRAS_SERVICOS_COMPRAS"); |
@@ -196,22 +215,22 @@ public class EventoAditivoValidator implements Validator{ | @@ -196,22 +215,22 @@ public class EventoAditivoValidator implements Validator{ | ||
196 | errors.rejectValue("percentualAditivo", CodigoErro.VALIDACAO_CAMPOS.getValue().toString(), "CONTRATOS.MSG.PERCENTAGEM_MAIOR_REFORMA_IMOVEIS"); | 215 | errors.rejectValue("percentualAditivo", CodigoErro.VALIDACAO_CAMPOS.getValue().toString(), "CONTRATOS.MSG.PERCENTAGEM_MAIOR_REFORMA_IMOVEIS"); |
197 | } | 216 | } |
198 | } | 217 | } |
199 | - | 218 | + |
200 | } | 219 | } |
201 | } | 220 | } |
202 | - | 221 | + |
203 | if (aditivo.getAditivoDeClausula()) { | 222 | if (aditivo.getAditivoDeClausula()) { |
204 | ValidationUtils.rejectIfEmpty(errors, "descricao", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "CONTRATOS.LABEL.DESCRICAO_ADITIVO"); | 223 | ValidationUtils.rejectIfEmpty(errors, "descricao", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "CONTRATOS.LABEL.DESCRICAO_ADITIVO"); |
205 | } | 224 | } |
206 | - | 225 | + |
207 | ValidationUtils.rejectIfEmpty(errors, "justificativa", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "CONTRATOS.LABEL.JUSTIFICATIVA_ADITIVO"); | 226 | ValidationUtils.rejectIfEmpty(errors, "justificativa", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "CONTRATOS.LABEL.JUSTIFICATIVA_ADITIVO"); |
208 | } | 227 | } |
209 | - | 228 | + |
210 | /** | 229 | /** |
211 | - * | 230 | + * |
212 | * <p><b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a></p> | 231 | * <p><b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a></p> |
213 | * | 232 | * |
214 | - * <p><b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a></p> | 233 | + * <p><b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a></p> |
215 | * | 234 | * |
216 | * Método responsável por verificar se uma determinada data esta dentro de um determinado prazo definido | 235 | * Método responsável por verificar se uma determinada data esta dentro de um determinado prazo definido |
217 | * | 236 | * |
cit-contratos-api/src/main/java/br/com/centralit/api/service/validation/EventoRecebimentoObjetoValidator.java
@@ -37,7 +37,6 @@ public class EventoRecebimentoObjetoValidator implements Validator{ | @@ -37,7 +37,6 @@ public class EventoRecebimentoObjetoValidator implements Validator{ | ||
37 | 37 | ||
38 | ValidationUtils.rejectIfEmpty(errors, "contrato", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "LABEL.CONTRATO"); | 38 | ValidationUtils.rejectIfEmpty(errors, "contrato", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "LABEL.CONTRATO"); |
39 | ValidationUtils.rejectIfEmpty(errors, "tipoRecebimento", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "CONTRATOS.LABEL.TIPO_RECEBIMENTO"); | 39 | ValidationUtils.rejectIfEmpty(errors, "tipoRecebimento", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "CONTRATOS.LABEL.TIPO_RECEBIMENTO"); |
40 | - ValidationUtils.rejectIfEmpty(errors, "nomeObjeto", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "CONTRATOS.LABEL.NOME_OBJETO"); | ||
41 | ValidationUtils.rejectIfEmpty(errors, "tipoStatus", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "LABEL.STATUS"); | 40 | ValidationUtils.rejectIfEmpty(errors, "tipoStatus", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "LABEL.STATUS"); |
42 | ValidationUtils.rejectIfEmpty(errors, "tipoAvaliacaoPrazo", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "CONTRATOS.LABEL.AVALIACAO_OBJETO"); | 41 | ValidationUtils.rejectIfEmpty(errors, "tipoAvaliacaoPrazo", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "CONTRATOS.LABEL.AVALIACAO_OBJETO"); |
43 | ValidationUtils.rejectIfEmpty(errors, "tipoAvaliacaoAdesao", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "CONTRATOS.LABEL.AVALIACAO_OBJETO"); | 42 | ValidationUtils.rejectIfEmpty(errors, "tipoAvaliacaoAdesao", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "CONTRATOS.LABEL.AVALIACAO_OBJETO"); |
cit-contratos-api/src/main/resources/script-bd/v1.0.0-alpha11/01-cit-contratos-1.0.0-ALFA-11-postgres.sql
@@ -11,3 +11,20 @@ INSERT INTO menufile (id, datacriacao, dataedicao, version, ativo, caminho, domi | @@ -11,3 +11,20 @@ INSERT INTO menufile (id, datacriacao, dataedicao, version, ativo, caminho, domi | ||
11 | VALUES (NEXTVAL('hibernate_sequence'), LOCALTIMESTAMP, LOCALTIMESTAMP, 0, true, '/cit-contratos-web/assets/js/angular/custom/repository/EventoLiberacaoPagamentoEmpenhoRepository.min.js', | 11 | VALUES (NEXTVAL('hibernate_sequence'), LOCALTIMESTAMP, LOCALTIMESTAMP, 0, true, '/cit-contratos-web/assets/js/angular/custom/repository/EventoLiberacaoPagamentoEmpenhoRepository.min.js', |
12 | (SELECT id FROM dominio WHERE chave = 'tipoFile' AND codigo = 2), (SELECT id FROM menu WHERE chave = 'ACOMPANHAMENTO')); | 12 | (SELECT id FROM dominio WHERE chave = 'tipoFile' AND codigo = 2), (SELECT id FROM menu WHERE chave = 'ACOMPANHAMENTO')); |
13 | -- LUÍS CÉSAR FIM 05/04/2016 | 13 | -- LUÍS CÉSAR FIM 05/04/2016 |
14 | + | ||
15 | +-- LUÍS CÉSAR INÍCIO 06/04/2016 | ||
16 | +ALTER TABLE cnt_ev_recebimentoobjeto DROP COLUMN nomeobjeto; | ||
17 | +TRUNCATE CASCADE MENU; | ||
18 | +TRUNCATE PAGINA; | ||
19 | +-- LUÍS CÉSRA FIM 06/04/2016 | ||
20 | + | ||
21 | +-- CIRO INICIO 07/04/2016 | ||
22 | +ALTER TABLE cnt_en_justificativa DROP CONSTRAINT fk_fa7tb16mca69yyhv2uvi4qd63; | ||
23 | +ALTER TABLE cnt_en_justificativa DROP COLUMN contrato_id; | ||
24 | + | ||
25 | +ALTER TABLE cnt_en_justificativa ADD COLUMN contratoenvolvido_id bigint; | ||
26 | +ALTER TABLE cnt_en_justificativa ADD CONSTRAINT fk_qgt7nl7x7xlduo7mysfv2lkqi FOREIGN KEY (contratoenvolvido_id) | ||
27 | +REFERENCES cnt_cn_envolvido (id) MATCH SIMPLE | ||
28 | +ON UPDATE NO ACTION | ||
29 | +ON DELETE NO ACTION; | ||
30 | +-- CIRO FIM 07/04/2016 |
cit-contratos-web/src/main/java/br/com/centralit/controller/EventoAditivoController.java
@@ -129,4 +129,17 @@ public class EventoAditivoController extends GenericController<EventoAditivo>{ | @@ -129,4 +129,17 @@ public class EventoAditivoController extends GenericController<EventoAditivo>{ | ||
129 | 129 | ||
130 | } | 130 | } |
131 | 131 | ||
132 | + | ||
133 | + @RequestMapping(value = "/permiteExclusaoAditivo", method = RequestMethod.GET) | ||
134 | + @ResponseBody | ||
135 | + public Boolean permiteExclusaoAditivo(@RequestParam(value="aditivoId") Long idAditivo) { | ||
136 | + return this.eventoAditivoService.permiteExclusaoAditivo(idAditivo); | ||
137 | + } | ||
138 | + | ||
139 | + @RequestMapping(value = "/existeAditivoPrazoPosterior", method = RequestMethod.GET) | ||
140 | + @ResponseBody | ||
141 | + public Boolean existeAditivoPrazoPosterior(@RequestParam(value="aditivoId") Long idAditivo) { | ||
142 | + return this.eventoAditivoService.existeAditivoPrazoPosterior(idAditivo); | ||
143 | + } | ||
144 | + | ||
132 | } | 145 | } |
cit-contratos-web/src/main/java/br/com/centralit/listener/StartupListenerContratos.java
@@ -981,10 +981,15 @@ public class StartupListenerContratos extends UtilStartup implements Application | @@ -981,10 +981,15 @@ public class StartupListenerContratos extends UtilStartup implements Application | ||
981 | internacionalizacaoList.add(new Internacionalizacao("CONTRATOS.LABEL.RELATORIO_PENALIDADE_APLICADA", "Relatório de penalidades aplicadas", dominio, modulo)); | 981 | internacionalizacaoList.add(new Internacionalizacao("CONTRATOS.LABEL.RELATORIO_PENALIDADE_APLICADA", "Relatório de penalidades aplicadas", dominio, modulo)); |
982 | 982 | ||
983 | internacionalizacaoList.add(new Internacionalizacao("CONTRATOS.LABEL.RELATORIOS", "Relatórios do contrato", dominio, modulo)); | 983 | internacionalizacaoList.add(new Internacionalizacao("CONTRATOS.LABEL.RELATORIOS", "Relatórios do contrato", dominio, modulo)); |
984 | + internacionalizacaoList.add(new Internacionalizacao("CONTRATOS.LABEL.ADICIONAR_JUSTIFICATIVA", "Adicionar Justificativa", dominio, modulo)); | ||
984 | 985 | ||
985 | internacionalizacaoList.add(new Internacionalizacao("CONTRATOS.LABEL.TERMO_REFERENCIA_PROJETO_BASICO", "Termo de referência/Projeto Básico", dominio, modulo)); | 986 | internacionalizacaoList.add(new Internacionalizacao("CONTRATOS.LABEL.TERMO_REFERENCIA_PROJETO_BASICO", "Termo de referência/Projeto Básico", dominio, modulo)); |
986 | internacionalizacaoList.add(new Internacionalizacao("CONTRATOS.LABEL.CONTRATO_SEM_VINCULO_TERMO", "Contrato selecionado está sem vínculo a um termo de referência.", dominio, modulo)); | 987 | internacionalizacaoList.add(new Internacionalizacao("CONTRATOS.LABEL.CONTRATO_SEM_VINCULO_TERMO", "Contrato selecionado está sem vínculo a um termo de referência.", dominio, modulo)); |
987 | internacionalizacaoList.add(new Internacionalizacao("CONTRATOS.LABEL.ENCERRAMENTO_CONTRATO", "Encerramento de contrato", dominio, modulo)); | 988 | internacionalizacaoList.add(new Internacionalizacao("CONTRATOS.LABEL.ENCERRAMENTO_CONTRATO", "Encerramento de contrato", dominio, modulo)); |
989 | + | ||
990 | + internacionalizacaoList.add(new Internacionalizacao("CONTRATOS.MSG.EXCLUSAO_ADITIVO_NEGADA", "Exclusão não permitida, o aditivo de prazo já está vigente ou há aditivos de prazo subsequentes a este.", dominio, modulo)); | ||
991 | + internacionalizacaoList.add(new Internacionalizacao("CONTRATOS.MSG.DATA_EMISSAO_12_MESES_POSTERIOR", "Data de emissão não permitida, pois infere intervalo de 12 meses em relação ao aditivo subsequente.", dominio, modulo)); | ||
992 | + internacionalizacaoList.add(new Internacionalizacao("CONTRATOS.MSG.ADITIVO_DATA_EMISSAO_MAIOR_DATA_INICIO", "Data de emissão deve ser menor que a data de início do aditivo.", dominio, modulo)); | ||
988 | } | 993 | } |
989 | 994 | ||
990 | private void gerarMensagem(Dominio dominio, Modulo modulo, List<Internacionalizacao> internacionalizacaoList) { | 995 | private void gerarMensagem(Dominio dominio, Modulo modulo, List<Internacionalizacao> internacionalizacaoList) { |
cit-contratos-web/src/main/resources/reports/eventoRecebimentoObjeto.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 --> | ||
3 | -<!-- 2016-04-01T17:16:34 --> | ||
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="eventoRecebimentoObjeto" language="groovy" pageWidth="555" pageHeight="802" columnWidth="555" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" uuid="e04cf746-a11a-488e-9c73-7c7069a15371"> | 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="eventoRecebimentoObjeto" language="groovy" pageWidth="555" pageHeight="802" columnWidth="555" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" uuid="e04cf746-a11a-488e-9c73-7c7069a15371"> |
5 | <property name="com.jaspersoft.studio.data.sql.tables" value=""/> | 3 | <property name="com.jaspersoft.studio.data.sql.tables" value=""/> |
6 | <property name="com.jaspersoft.studio.data.defaultdataadapter" value="Postgres citgrpdb"/> | 4 | <property name="com.jaspersoft.studio.data.defaultdataadapter" value="Postgres citgrpdb"/> |
7 | <property name="ireport.zoom" value="1.7715610000000062"/> | 5 | <property name="ireport.zoom" value="1.7715610000000062"/> |
8 | <property name="ireport.x" value="0"/> | 6 | <property name="ireport.x" value="0"/> |
9 | - <property name="ireport.y" value="0"/> | 7 | + <property name="ireport.y" value="11"/> |
10 | <style name="Table_TH" mode="Opaque" backcolor="#F0F8FF"> | 8 | <style name="Table_TH" mode="Opaque" backcolor="#F0F8FF"> |
11 | <box> | 9 | <box> |
12 | <pen lineWidth="0.5" lineColor="#000000"/> | 10 | <pen lineWidth="0.5" lineColor="#000000"/> |
@@ -39,6 +37,7 @@ | @@ -39,6 +37,7 @@ | ||
39 | <![CDATA[select | 37 | <![CDATA[select |
40 | contrato.numeroanocontrato as numeroAnoContrato, | 38 | contrato.numeroanocontrato as numeroAnoContrato, |
41 | contrato.numeroprocesso AS numeroProcesso, | 39 | contrato.numeroprocesso AS numeroProcesso, |
40 | +contrato.objetocontratacao, | ||
42 | pesForn.nome AS contratada, | 41 | pesForn.nome AS contratada, |
43 | pesJForn.cnpj AS cnpjcontratado, | 42 | pesJForn.cnpj AS cnpjcontratado, |
44 | ro.sequencialano as numeroRecebimento, | 43 | ro.sequencialano as numeroRecebimento, |
@@ -47,7 +46,6 @@ ro.datarecebimento as dataRecebimento, | @@ -47,7 +46,6 @@ ro.datarecebimento as dataRecebimento, | ||
47 | (SELECT dominio.descricao FROM dominio WHERE dominio.id = ro.tipostatus_id) AS tipoStatus, | 46 | (SELECT dominio.descricao FROM dominio WHERE dominio.id = ro.tipostatus_id) AS tipoStatus, |
48 | (SELECT dominio.descricao FROM dominio WHERE dominio.id = ro.tipoavaliacaoprazo_id) AS tipoAvaliacaoPrazo, | 47 | (SELECT dominio.descricao FROM dominio WHERE dominio.id = ro.tipoavaliacaoprazo_id) AS tipoAvaliacaoPrazo, |
49 | (SELECT dominio.descricao FROM dominio WHERE dominio.id = ro.tipoavaliacaoadesao_id) AS tipoAvaliacaoAdesao, | 48 | (SELECT dominio.descricao FROM dominio WHERE dominio.id = ro.tipoavaliacaoadesao_id) AS tipoAvaliacaoAdesao, |
50 | -ro.nomeObjeto as nomeObjeto, | ||
51 | ro.justificativa as justificativa, | 49 | ro.justificativa as justificativa, |
52 | pesGestor.nome AS gestor, | 50 | pesGestor.nome AS gestor, |
53 | cGestor.matricula AS gestorMatricula, | 51 | cGestor.matricula AS gestorMatricula, |
@@ -76,6 +74,7 @@ where ro.id = $P{RECEBIMENTO_ID}]]> | @@ -76,6 +74,7 @@ where ro.id = $P{RECEBIMENTO_ID}]]> | ||
76 | </queryString> | 74 | </queryString> |
77 | <field name="numeroanocontrato" class="java.lang.String"/> | 75 | <field name="numeroanocontrato" class="java.lang.String"/> |
78 | <field name="numeroprocesso" class="java.lang.Long"/> | 76 | <field name="numeroprocesso" class="java.lang.Long"/> |
77 | + <field name="objetocontratacao" class="java.lang.String"/> | ||
79 | <field name="contratada" class="java.lang.String"/> | 78 | <field name="contratada" class="java.lang.String"/> |
80 | <field name="cnpjcontratado" class="java.lang.String"/> | 79 | <field name="cnpjcontratado" class="java.lang.String"/> |
81 | <field name="numerorecebimento" class="java.lang.String"/> | 80 | <field name="numerorecebimento" class="java.lang.String"/> |
@@ -84,7 +83,6 @@ where ro.id = $P{RECEBIMENTO_ID}]]> | @@ -84,7 +83,6 @@ where ro.id = $P{RECEBIMENTO_ID}]]> | ||
84 | <field name="tipostatus" class="java.lang.String"/> | 83 | <field name="tipostatus" class="java.lang.String"/> |
85 | <field name="tipoavaliacaoprazo" class="java.lang.String"/> | 84 | <field name="tipoavaliacaoprazo" class="java.lang.String"/> |
86 | <field name="tipoavaliacaoadesao" class="java.lang.String"/> | 85 | <field name="tipoavaliacaoadesao" class="java.lang.String"/> |
87 | - <field name="nomeobjeto" class="java.lang.String"/> | ||
88 | <field name="justificativa" class="java.lang.String"/> | 86 | <field name="justificativa" class="java.lang.String"/> |
89 | <field name="gestor" class="java.lang.String"/> | 87 | <field name="gestor" class="java.lang.String"/> |
90 | <field name="gestormatricula" class="java.lang.String"/> | 88 | <field name="gestormatricula" class="java.lang.String"/> |
@@ -452,7 +450,7 @@ $F{cnpjcontratado}.substring(12, 14)]]></textFieldExpression> | @@ -452,7 +450,7 @@ $F{cnpjcontratado}.substring(12, 14)]]></textFieldExpression> | ||
452 | <rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> | 450 | <rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> |
453 | </box> | 451 | </box> |
454 | <textElement verticalAlignment="Middle"/> | 452 | <textElement verticalAlignment="Middle"/> |
455 | - <textFieldExpression><![CDATA[$F{nomeobjeto}]]></textFieldExpression> | 453 | + <textFieldExpression><![CDATA[$F{objetocontratacao}]]></textFieldExpression> |
456 | </textField> | 454 | </textField> |
457 | <textField isStretchWithOverflow="true"> | 455 | <textField isStretchWithOverflow="true"> |
458 | <reportElement stretchType="RelativeToBandHeight" mode="Opaque" x="0" y="0" width="220" height="25" isPrintWhenDetailOverflows="true" backcolor="#CCCCCC" uuid="2a73e93e-b151-4d8a-be9d-32a7c4bb9c46"/> | 456 | <reportElement stretchType="RelativeToBandHeight" mode="Opaque" x="0" y="0" width="220" height="25" isPrintWhenDetailOverflows="true" backcolor="#CCCCCC" uuid="2a73e93e-b151-4d8a-be9d-32a7c4bb9c46"/> |
cit-contratos-web/src/main/resources/reports/relatorioEventoNaoConformidade.jrxml
@@ -52,12 +52,12 @@ evNaoConformidade.respostacontratada as resposta | @@ -52,12 +52,12 @@ evNaoConformidade.respostacontratada as resposta | ||
52 | 52 | ||
53 | from cnt_cn_evento as eventos | 53 | from cnt_cn_evento as eventos |
54 | 54 | ||
55 | -left join cnt_ev_registro_nc as evNaoConformidade on evNaoConformidade.id = eventos.id | ||
56 | -left join cnt_tr_sancao as trSancao on trSancao.id = evNaoConformidade.tiponaoconformidade_id | ||
57 | -left join dominio as tipoEvento on tipoEvento.id = eventos.tipoevento_id | 55 | +inner join cnt_ev_registro_nc as evNaoConformidade on evNaoConformidade.id = eventos.id |
56 | +inner join cnt_tr_sancao as trSancao on trSancao.id = evNaoConformidade.tiponaoconformidade_id | ||
57 | +inner join dominio as tipoEvento on tipoEvento.id = eventos.tipoevento_id | ||
58 | 58 | ||
59 | where eventos.contrato_id = $P{contratoId} | 59 | where eventos.contrato_id = $P{contratoId} |
60 | -and tipoEvento.chave = 'tipoEventoContrato' and tipoEvento.codigo = '7' | 60 | + |
61 | $P!{DATA_INICIAL} | 61 | $P!{DATA_INICIAL} |
62 | $P!{DATA_FINAL} | 62 | $P!{DATA_FINAL} |
63 | 63 | ||
@@ -90,9 +90,6 @@ left join cnt_contrato as contrato on contrato.id = eventos.contrato_id | @@ -90,9 +90,6 @@ left join cnt_contrato as contrato on contrato.id = eventos.contrato_id | ||
90 | left join dominio as tipoEvento on tipoEvento.id = eventos.tipoevento_id | 90 | left join dominio as tipoEvento on tipoEvento.id = eventos.tipoevento_id |
91 | 91 | ||
92 | where eventos.contrato_id = $P{contratoId} | 92 | where eventos.contrato_id = $P{contratoId} |
93 | -and tipoEvento.chave = 'tipoEventoContrato' | ||
94 | -and tipoEvento.codigo = '7' | ||
95 | - | ||
96 | group by contrato.id, tipoEvento.id, eventos.id | 93 | group by contrato.id, tipoEvento.id, eventos.id |
97 | limit 1]]> | 94 | limit 1]]> |
98 | </queryString> | 95 | </queryString> |
@@ -172,7 +169,7 @@ $P{dataFinal} != null ? "Até " + new SimpleDateFormat("dd/MM/yyyy").format($P{d | @@ -172,7 +169,7 @@ $P{dataFinal} != null ? "Até " + new SimpleDateFormat("dd/MM/yyyy").format($P{d | ||
172 | <text><![CDATA[1. Relatórios]]></text> | 169 | <text><![CDATA[1. Relatórios]]></text> |
173 | </staticText> | 170 | </staticText> |
174 | <componentElement> | 171 | <componentElement> |
175 | - <reportElement x="15" y="40" width="534" height="30" uuid="687f8495-5035-426f-8cde-dfbd8bfae41d"> | 172 | + <reportElement x="15" y="40" width="534" height="30" isPrintWhenDetailOverflows="true" uuid="687f8495-5035-426f-8cde-dfbd8bfae41d"> |
176 | <property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.VerticalRowLayout"/> | 173 | <property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.VerticalRowLayout"/> |
177 | </reportElement> | 174 | </reportElement> |
178 | <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" whenNoDataType="AllSectionsNoDetail"> | 175 | <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" whenNoDataType="AllSectionsNoDetail"> |
cit-contratos-web/src/main/webapp/assets/js/angular/custom/controller/ContratoController.js
@@ -87,14 +87,13 @@ citApp.controller('ContratoController', ['$scope', '$filter', 'FileUploader', 'C | @@ -87,14 +87,13 @@ citApp.controller('ContratoController', ['$scope', '$filter', 'FileUploader', 'C | ||
87 | }; | 87 | }; |
88 | // ###################### FIM: INICIALIZACAO DE VARIAVEIS ########################### | 88 | // ###################### FIM: INICIALIZACAO DE VARIAVEIS ########################### |
89 | 89 | ||
90 | - // Limpa formul�rio para novo cadastro | 90 | + // Limpa formulario para novo cadastro |
91 | $scope.resetForm = function() { | 91 | $scope.resetForm = function() { |
92 | 92 | ||
93 | $scope.contrato = { | 93 | $scope.contrato = { |
94 | ctrtEmpenhos : [], | 94 | ctrtEmpenhos : [], |
95 | ctrtItens : [], | 95 | ctrtItens : [], |
96 | ctrtEnvolvidos : [], | 96 | ctrtEnvolvidos : [], |
97 | - justificativas : [], | ||
98 | ctrtValoresPagamento : [], | 97 | ctrtValoresPagamento : [], |
99 | dominioSituacaoAtual : {codigo : 1}, | 98 | dominioSituacaoAtual : {codigo : 1}, |
100 | valorTotalEmpenhado : 0.0, | 99 | valorTotalEmpenhado : 0.0, |
@@ -243,83 +242,79 @@ citApp.controller('ContratoController', ['$scope', '$filter', 'FileUploader', 'C | @@ -243,83 +242,79 @@ citApp.controller('ContratoController', ['$scope', '$filter', 'FileUploader', 'C | ||
243 | $scope.contratoForm.anexosObservacoesContratoForm.$submitted = true; | 242 | $scope.contratoForm.anexosObservacoesContratoForm.$submitted = true; |
244 | 243 | ||
245 | // verifica formulario valido | 244 | // verifica formulario valido |
246 | - if ($scope.contratoForm.$valid) { | ||
247 | - | ||
248 | - // data da celebracao nao pode ser maior que a data de vigencia inicial do contrato | ||
249 | - if(!isPeriodoValido($scope.contrato.dataCelebracao, $scope.contrato.dataVigenciaInicial)){ | ||
250 | - | ||
251 | - $scope.showAlert('error', $translate.instant('VALIDACAO.DATA_CELEBRACAO_MAIOR_DATA_VIGENCIA_INICIAL')); | ||
252 | - return; | ||
253 | - } | ||
254 | - | ||
255 | - // data de vigencia inicial nao pode ser maior que a data de vigencia final do contrato | ||
256 | - if(!isPeriodoValido($scope.contrato.dataVigenciaInicial, $scope.contrato.dataVigenciaFinal)){ | 245 | + if ($scope.contratoForm.$invalid) { |
246 | + $scope.showAlert('error', $translate.instant('VALIDACAO.ALERTA_OBRIGATORIOS')); | ||
247 | + return; | ||
248 | + } | ||
257 | 249 | ||
258 | - $scope.showAlert('error', $translate.instant('VALIDACAO.DATA_VIGENCIA_INICIAL_MAIOR_DATA_VIGENCIA_FINAL_CONTRATO')); | ||
259 | - return; | ||
260 | - } | 250 | + if(!$scope.informacoesValidas()){ |
251 | + return; | ||
252 | + }; | ||
261 | 253 | ||
262 | - // data de vigencia inicial nao pode ser maior que a data de vigencia final do contrato | ||
263 | - if($scope.contrato.ctrtEnvolvidos && $scope.contrato.ctrtEnvolvidos.length > 0 && $scope.contrato.ctrtEnvolvidos.length < 3){ | 254 | + if ($scope.contrato.id && $scope.contrato.ctrtEnvolvidos){ |
255 | + angular.forEach($scope.contrato.ctrtEnvolvidos, function(envolvido){ | ||
256 | + if (envolvido.justificativas){ | ||
257 | + angular.forEach(envolvido.justificativas, function(justificativa){ | ||
258 | + delete justificativa.autor.permissoes; | ||
259 | + delete justificativa.dataCriacao; | ||
260 | + }); | ||
261 | + } | ||
262 | + }); | ||
263 | + } | ||
264 | 264 | ||
265 | - $scope.showAlert('error', $translate.instant('VALIDACAO.CONTRATO_EXIGE_MINIMO_TRES_ENVOLVIDOS')); | 265 | + if ($scope.contrato.ctrtValoresPagamento && $scope.contrato.ctrtValoresPagamento.length > 0){ |
266 | + if (!validarContratoValoresPagamento()){ | ||
266 | return; | 267 | return; |
267 | } | 268 | } |
269 | + angular.forEach($scope.contrato.ctrtValoresPagamento, function(parcelaValorPagamento){ | ||
270 | + if (parcelaValorPagamento.seguencia){ | ||
271 | + delete parcelaValorPagamento.seguencia; | ||
272 | + } | ||
273 | + }); | ||
274 | + } | ||
268 | 275 | ||
269 | - if($scope.contrato.id && $scope.hasAlteracaoEnvolvido){ | 276 | + $scope.contratoTemp = { |
277 | + documentos: [] | ||
278 | + }; | ||
270 | 279 | ||
271 | - $scope.showAlert('error', $translate.instant('CONTRATOS.VALIDACAO.ALTERACAO_ENVOLVIDOS_EXIGE_JUSTIFICATIVA')); | ||
272 | - return; | ||
273 | - } else { | ||
274 | - angular.forEach($scope.contrato.justificativas, function(justificativa){ | ||
275 | - delete justificativa.autor; | ||
276 | - delete justificativa.dataCriacao; | 280 | + // preencher lista de documentos temporarios para verificacao dos anexos. verificar qual anexo e de qual documento pelo numero do documento |
281 | + angular.forEach($scope.contrato.documentos, function(documento, key) { | ||
282 | + if (documento.uploadsDocumento) { | ||
283 | + $scope.contratoTemp.documentos.push({ | ||
284 | + uploadsDocumento: clone(documento.uploadsDocumento), | ||
285 | + numero: clone(documento.numero) | ||
277 | }); | 286 | }); |
287 | + // deleta esse atributo por causa de um erro de ciclo no json | ||
288 | + delete documento.uploadsDocumento; | ||
278 | } | 289 | } |
290 | + }); | ||
279 | 291 | ||
280 | - if ($scope.contrato.ctrtValoresPagamento && $scope.contrato.ctrtValoresPagamento.length > 0){ | ||
281 | - | ||
282 | - if (!validarContratoValoresPagamento()){ | ||
283 | - | ||
284 | - return; | ||
285 | - | ||
286 | - } else { | ||
287 | - | ||
288 | - angular.forEach($scope.contrato.ctrtValoresPagamento, function(parcelaValorPagamento){ | ||
289 | - | ||
290 | - if (parcelaValorPagamento.seguencia){ | ||
291 | - | ||
292 | - delete parcelaValorPagamento.seguencia; | ||
293 | - } | ||
294 | - }); | ||
295 | - } | ||
296 | - } | ||
297 | - | ||
298 | - $scope.contratoTemp = { | ||
299 | - documentos: [] | ||
300 | - }; | 292 | + if ($scope.contrato.programaAcao && $scope.contrato.programaAcao.originalElement) { |
293 | + $scope.contrato.programaAcao = $scope.contrato.programaAcao.originalElement; | ||
294 | + } | ||
295 | + verificarValorTotalEmpenhado(); | ||
296 | + }; | ||
301 | 297 | ||
302 | - // preencher lista de documentos temporarios para verificacao dos anexos. verificar qual anexo e de qual documento pelo numero do documento | ||
303 | - angular.forEach($scope.contrato.documentos, function(documento, key) { | ||
304 | - if (documento.uploadsDocumento) { | ||
305 | - $scope.contratoTemp.documentos.push({ | ||
306 | - uploadsDocumento: clone(documento.uploadsDocumento), | ||
307 | - numero: clone(documento.numero) | ||
308 | - }); | ||
309 | - // deleta esse atributo por causa de um erro de ciclo no json | ||
310 | - delete documento.uploadsDocumento; | ||
311 | - } | ||
312 | - }); | 298 | + $scope.informacoesValidas = function () { |
313 | 299 | ||
314 | - if ($scope.contrato.programaAcao && $scope.contrato.programaAcao.originalElement) { | ||
315 | - $scope.contrato.programaAcao = $scope.contrato.programaAcao.originalElement; | ||
316 | - } | 300 | + // data da celebracao nao pode ser maior que a data de vigencia inicial do contrato |
301 | + if(!isPeriodoValido($scope.contrato.dataCelebracao, $scope.contrato.dataVigenciaInicial)){ | ||
302 | + $scope.showAlert('error', $translate.instant('VALIDACAO.DATA_CELEBRACAO_MAIOR_DATA_VIGENCIA_INICIAL')); | ||
303 | + return false; | ||
304 | + } | ||
317 | 305 | ||
318 | - verificarValorTotalEmpenhado(); | ||
319 | - } else { | 306 | + // data de vigencia inicial nao pode ser maior que a data de vigencia final do contrato |
307 | + if(!isPeriodoValido($scope.contrato.dataVigenciaInicial, $scope.contrato.dataVigenciaFinal)){ | ||
308 | + $scope.showAlert('error', $translate.instant('VALIDACAO.DATA_VIGENCIA_INICIAL_MAIOR_DATA_VIGENCIA_FINAL_CONTRATO')); | ||
309 | + return false; | ||
310 | + } | ||
320 | 311 | ||
321 | - $scope.showAlert('error', $translate.instant('VALIDACAO.ALERTA_OBRIGATORIOS')); | 312 | + // data de vigencia inicial nao pode ser maior que a data de vigencia final do contrato |
313 | + if($scope.contrato.ctrtEnvolvidos && $scope.contrato.ctrtEnvolvidos.length > 0 && $scope.contrato.ctrtEnvolvidos.length < 3){ | ||
314 | + $scope.showAlert('error', $translate.instant('VALIDACAO.CONTRATO_EXIGE_MINIMO_TRES_ENVOLVIDOS')); | ||
315 | + return false; | ||
322 | } | 316 | } |
317 | + return true; | ||
323 | }; | 318 | }; |
324 | 319 | ||
325 | function save() { | 320 | function save() { |
@@ -1369,10 +1364,8 @@ citApp.controller('ContratoController', ['$scope', '$filter', 'FileUploader', 'C | @@ -1369,10 +1364,8 @@ citApp.controller('ContratoController', ['$scope', '$filter', 'FileUploader', 'C | ||
1369 | }); | 1364 | }); |
1370 | 1365 | ||
1371 | if (contratoEnvolvidosChecked.length > 1){ | 1366 | if (contratoEnvolvidosChecked.length > 1){ |
1372 | - | ||
1373 | $scope.acaoEmMassaEnvolvido = true; | 1367 | $scope.acaoEmMassaEnvolvido = true; |
1374 | } else { | 1368 | } else { |
1375 | - | ||
1376 | $scope.acaoEmMassaEnvolvido = false; | 1369 | $scope.acaoEmMassaEnvolvido = false; |
1377 | } | 1370 | } |
1378 | }; | 1371 | }; |
@@ -1380,79 +1373,77 @@ citApp.controller('ContratoController', ['$scope', '$filter', 'FileUploader', 'C | @@ -1380,79 +1373,77 @@ citApp.controller('ContratoController', ['$scope', '$filter', 'FileUploader', 'C | ||
1380 | // responsavel por abrir modal de adicao de um contratoEnvolvido | 1373 | // responsavel por abrir modal de adicao de um contratoEnvolvido |
1381 | $scope.openModalContratoEnvolvido = function() { | 1374 | $scope.openModalContratoEnvolvido = function() { |
1382 | 1375 | ||
1383 | - filtrarPapeisSelecionados(); | ||
1384 | - | ||
1385 | - $scope.contratoEnvolvidoTemp = {}; | ||
1386 | $scope.editEnvolvido = true; | 1376 | $scope.editEnvolvido = true; |
1387 | - $scope.$openModal('modal-envolvido.html', 'lg'); | 1377 | + $scope.contratoEnvolvidoTemp = {justificativas : []}; |
1378 | + $scope.contrato.ctrtEnvolvidos.forEach(function(item){ | ||
1379 | + if(item.$checked){ | ||
1380 | + item.$checked = false; | ||
1381 | + } | ||
1382 | + }); | ||
1383 | + filtrarPapeisSelecionados(); | ||
1384 | + $scope.$openModal('dialog_envolvido.html', 'lg'); | ||
1388 | }; | 1385 | }; |
1389 | 1386 | ||
1390 | - // responsavel por abrir modal de adicao de uma justificativa | ||
1391 | - $scope.openModalJustificativa = function() { | ||
1392 | - | ||
1393 | - $scope.justificativaTemp = {}; | ||
1394 | - $scope.editEnvolvido = true; | ||
1395 | - $scope.$openModal('modal-justificativa.html', 'lg'); | 1387 | + $scope.closeModalContratoEvolvido = function(formDialogEnvolvido) { |
1388 | + $scope.hasAlteracaoEnvolvido = false; | ||
1389 | + formDialogEnvolvido.$submitted = false; | ||
1390 | + $scope.$modalInstance.dismiss('cancel'); | ||
1396 | }; | 1391 | }; |
1397 | 1392 | ||
1398 | $scope.adicionarContratoEnvolvido = function (formDialogEnvolvido, continuarEditando) { | 1393 | $scope.adicionarContratoEnvolvido = function (formDialogEnvolvido, continuarEditando) { |
1399 | 1394 | ||
1400 | formDialogEnvolvido.$submitted = true; | 1395 | formDialogEnvolvido.$submitted = true; |
1396 | + if($scope.contrato.id && $scope.hasAlteracaoEnvolvido){ | ||
1397 | + if($scope.contratoEnvolvidoTemp.justificativas.length === 0 || | ||
1398 | + $scope.contratoEnvolvidoTemp.justificativas.length === $scope.contratoEnvolvidoTemp.justificativasAnterioresLength){ | ||
1399 | + $scope.showAlert('error', $translate.instant('CONTRATOS.VALIDACAO.ALTERACAO_ENVOLVIDOS_EXIGE_JUSTIFICATIVA')); | ||
1400 | + return; | ||
1401 | + } | ||
1402 | + } | ||
1401 | 1403 | ||
1402 | - if (formDialogEnvolvido.$valid) { | ||
1403 | - if ($scope.contrato.ctrtEnvolvidos){ | ||
1404 | - if ($scope.contratoEnvolvidoTemp.$checked) { | ||
1405 | - for (var i = 0; i < $scope.contrato.ctrtEnvolvidos.length; i++) { | ||
1406 | - if ($scope.contrato.ctrtEnvolvidos[i].$checked) { | ||
1407 | - $scope.contrato.ctrtEnvolvidos[i] = $scope.contratoEnvolvidoTemp; | ||
1408 | - } | 1404 | + if (formDialogEnvolvido.$invalid) { |
1405 | + //Mensagem de erro de campos obrigatorios nao preenchidos | ||
1406 | + $scope.showAlert('error', $translate.instant('VALIDACAO.ALERTA_OBRIGATORIOS'), " ", false); | ||
1407 | + return; | ||
1408 | + } | ||
1409 | + if ($scope.contrato.ctrtEnvolvidos){ | ||
1410 | + if ($scope.contratoEnvolvidoTemp.$checked) { | ||
1411 | + for (var i = 0; i < $scope.contrato.ctrtEnvolvidos.length; i++) { | ||
1412 | + if ($scope.contrato.ctrtEnvolvidos[i].$checked) { | ||
1413 | + $scope.contrato.ctrtEnvolvidos[i] = $scope.contratoEnvolvidoTemp; | ||
1409 | } | 1414 | } |
1410 | - } else { | ||
1411 | - $scope.contrato.ctrtEnvolvidos.push($scope.contratoEnvolvidoTemp); | ||
1412 | } | 1415 | } |
1413 | - } | ||
1414 | - | ||
1415 | - $scope.contratoEnvolvidoTemp = {}; | ||
1416 | - if (continuarEditando) { | ||
1417 | - formDialogEnvolvido.$submitted = false; | ||
1418 | - formDialogEnvolvido.$setPristine(); | ||
1419 | - filtrarPapeisSelecionados(); | ||
1420 | } else { | 1416 | } else { |
1421 | - $scope.$modalInstance.dismiss('cancel'); | 1417 | + $scope.contrato.ctrtEnvolvidos.push($scope.contratoEnvolvidoTemp); |
1422 | } | 1418 | } |
1419 | + } | ||
1423 | 1420 | ||
1424 | - if ($scope.contrato.id){ | ||
1425 | - $scope.hasAlteracaoEnvolvido = true; | ||
1426 | - } | 1421 | + $scope.contratoEnvolvidoTemp = {justificativas : []}; |
1422 | + $scope.justificativaTemp = {}; | ||
1423 | + $scope.hasAlteracaoEnvolvido = false; | ||
1424 | + if (continuarEditando) { | ||
1425 | + formDialogEnvolvido.$submitted = false; | ||
1426 | + formDialogEnvolvido.$setPristine(); | ||
1427 | + filtrarPapeisSelecionados(); | ||
1427 | } else { | 1428 | } else { |
1428 | - //Mensagem de erro de campos obrigatorios n�o preenchidos | ||
1429 | - $scope.showAlert('error', $translate.instant('VALIDACAO.ALERTA_OBRIGATORIOS'), " ", false); | 1429 | + $scope.$modalInstance.dismiss('cancel'); |
1430 | } | 1430 | } |
1431 | }; | 1431 | }; |
1432 | 1432 | ||
1433 | - $scope.adicionarJustificativa = function (formDialogJustificativa, continuarEditando) { | 1433 | + $scope.adicionarJustificativa = function (form) { |
1434 | 1434 | ||
1435 | - formDialogJustificativa.$submitted = true; | 1435 | + form.$submitted = true; |
1436 | 1436 | ||
1437 | - if (formDialogJustificativa.$valid) { | ||
1438 | - if ($scope.contrato.justificativas){ | ||
1439 | - $scope.justificativaTemp.autor = $scope.usuarioLogado; | ||
1440 | - $scope.justificativaTemp.dataCriacao = new Date(); | ||
1441 | - $scope.contrato.justificativas.push($scope.justificativaTemp); | ||
1442 | - } | ||
1443 | - | ||
1444 | - $scope.justificativaTemp = {}; | ||
1445 | - if (continuarEditando) { | ||
1446 | - formDialogJustificativa.$submitted = false; | ||
1447 | - formDialogJustificativa.$setPristine(); | ||
1448 | - } else { | ||
1449 | - $scope.$modalInstance.dismiss('cancel'); | ||
1450 | - } | ||
1451 | - $scope.hasAlteracaoEnvolvido = false; | ||
1452 | - } else { | ||
1453 | - //Mensagem de erro de campos obrigatorios n�o preenchidos | ||
1454 | - $scope.showAlert('error', $translate.instant('VALIDACAO.ALERTA_OBRIGATORIOS'), " ", false); | 1437 | + if ($scope.justificativaTemp.descricao === '' || $scope.justificativaTemp.descricao == undefined) { |
1438 | + $scope.showAlert('error', $translate.instant('CONTRATOS.VALIDACAO.ALTERACAO_ENVOLVIDOS_EXIGE_JUSTIFICATIVA')); | ||
1439 | + return; | ||
1440 | + } | ||
1441 | + if ($scope.contratoEnvolvidoTemp.justificativas){ | ||
1442 | + $scope.justificativaTemp.autor = $scope.usuarioLogado; | ||
1443 | + $scope.justificativaTemp.dataCriacao = new Date(); | ||
1444 | + $scope.contratoEnvolvidoTemp.justificativas.push($scope.justificativaTemp); | ||
1455 | } | 1445 | } |
1446 | + $scope.justificativaTemp = {}; | ||
1456 | }; | 1447 | }; |
1457 | 1448 | ||
1458 | function filtrarPapeisSelecionados() { | 1449 | function filtrarPapeisSelecionados() { |
@@ -1460,16 +1451,18 @@ citApp.controller('ContratoController', ['$scope', '$filter', 'FileUploader', 'C | @@ -1460,16 +1451,18 @@ citApp.controller('ContratoController', ['$scope', '$filter', 'FileUploader', 'C | ||
1460 | 1451 | ||
1461 | var dominiosPapelEnvolvidoContrato = []; | 1452 | var dominiosPapelEnvolvidoContrato = []; |
1462 | $scope.contrato.ctrtEnvolvidos.forEach(function(item){ | 1453 | $scope.contrato.ctrtEnvolvidos.forEach(function(item){ |
1463 | - | ||
1464 | - dominiosPapelEnvolvidoContrato.push(item.dominioPapelEnvolvidoContrato); | 1454 | + if(!item.$checked){ |
1455 | + dominiosPapelEnvolvidoContrato.push(item.dominioPapelEnvolvidoContrato); | ||
1456 | + } | ||
1465 | }); | 1457 | }); |
1466 | 1458 | ||
1467 | $scope.dominioPapelEnvolvidoList = $filter('idNotEqualDominio')($scope.dominioPapelEnvolvidoListFixa, dominiosPapelEnvolvidoContrato); | 1459 | $scope.dominioPapelEnvolvidoList = $filter('idNotEqualDominio')($scope.dominioPapelEnvolvidoListFixa, dominiosPapelEnvolvidoContrato); |
1468 | 1460 | ||
1469 | - if ($scope.dominioPapelEnvolvidoList && $scope.dominioPapelEnvolvidoList.length === 0){ | ||
1470 | - | ||
1471 | - $scope.showAlert('warning', $translate.instant('CONTRATOS.MSG.TODOS_PAPEIS_ENVOLVIDOS_ADICIONADOS')); | ||
1472 | - return; | 1461 | + if($scope.editEnvolvido){ |
1462 | + if ($scope.dominioPapelEnvolvidoList && $scope.dominioPapelEnvolvidoList.length === 0){ | ||
1463 | + $scope.showAlert('warning', $translate.instant('CONTRATOS.MSG.TODOS_PAPEIS_ENVOLVIDOS_ADICIONADOS')); | ||
1464 | + return; | ||
1465 | + } | ||
1473 | } | 1466 | } |
1474 | } | 1467 | } |
1475 | }; | 1468 | }; |
@@ -1519,10 +1512,6 @@ citApp.controller('ContratoController', ['$scope', '$filter', 'FileUploader', 'C | @@ -1519,10 +1512,6 @@ citApp.controller('ContratoController', ['$scope', '$filter', 'FileUploader', 'C | ||
1519 | } | 1512 | } |
1520 | 1513 | ||
1521 | $scope.dominioPapelEnvolvidoList.push(papelExcluido); | 1514 | $scope.dominioPapelEnvolvidoList.push(papelExcluido); |
1522 | - | ||
1523 | - if ($scope.contrato.id) { | ||
1524 | - $scope.hasAlteracaoEnvolvido = true; | ||
1525 | - } | ||
1526 | } | 1515 | } |
1527 | }); | 1516 | }); |
1528 | }; | 1517 | }; |
@@ -1558,25 +1547,29 @@ citApp.controller('ContratoController', ['$scope', '$filter', 'FileUploader', 'C | @@ -1558,25 +1547,29 @@ citApp.controller('ContratoController', ['$scope', '$filter', 'FileUploader', 'C | ||
1558 | }; | 1547 | }; |
1559 | 1548 | ||
1560 | // Responsavel por abrir modal de envolvido para edicao ou visualizacao do item selecionado | 1549 | // Responsavel por abrir modal de envolvido para edicao ou visualizacao do item selecionado |
1561 | - $scope.abrirContratoEnvolvido = function(edit) { | ||
1562 | - | ||
1563 | - filtrarPapeisSelecionados(); | 1550 | + $scope.visualizarEditarContratoEnvolvido = function(edit) { |
1564 | 1551 | ||
1565 | $scope.editEnvolvido = edit; | 1552 | $scope.editEnvolvido = edit; |
1566 | - | ||
1567 | $scope.contratoEnvolvidoTemp = null; | 1553 | $scope.contratoEnvolvidoTemp = null; |
1568 | - | ||
1569 | // recupera o item de contrato selecionado | 1554 | // recupera o item de contrato selecionado |
1570 | $scope.contratoEnvolvidoTemp = $scope.getCheckedContratoEnvolvido(); | 1555 | $scope.contratoEnvolvidoTemp = $scope.getCheckedContratoEnvolvido(); |
1571 | - | ||
1572 | if(!$scope.contratoEnvolvidoTemp) { | 1556 | if(!$scope.contratoEnvolvidoTemp) { |
1573 | - | ||
1574 | $scope.showAlert('warning', !edit ? $translate.instant('MSG.SELECIONE_UM_ITEM_PARA_VISUALIZACAO') : $translate.instant('MSG.SELECIONE_UM_ITEM_PARA_EDICAO')); | 1557 | $scope.showAlert('warning', !edit ? $translate.instant('MSG.SELECIONE_UM_ITEM_PARA_VISUALIZACAO') : $translate.instant('MSG.SELECIONE_UM_ITEM_PARA_EDICAO')); |
1575 | return; | 1558 | return; |
1576 | } | 1559 | } |
1577 | - | 1560 | + $scope.justificativaTemp = {}; |
1561 | + if($scope.contratoEnvolvidoTemp.justificativas){ | ||
1562 | + $scope.contratoEnvolvidoTemp.justificativasAnterioresLength = $scope.contratoEnvolvidoTemp.justificativas.length; | ||
1563 | + } else { | ||
1564 | + $scope.contratoEnvolvidoTemp.justificativasAnterioresLength = 0; | ||
1565 | + $scope.contratoEnvolvidoTemp.justificativas = []; | ||
1566 | + } | ||
1567 | + if($scope.contrato.id){ | ||
1568 | + $scope.hasAlteracaoEnvolvido = edit; | ||
1569 | + } | ||
1570 | + filtrarPapeisSelecionados(); | ||
1578 | $timeout(function() { | 1571 | $timeout(function() { |
1579 | - $scope.$openModal('modal-envolvido.html', 'lg'); | 1572 | + $scope.$openModal('dialog_envolvido.html', 'lg'); |
1580 | }); | 1573 | }); |
1581 | }; | 1574 | }; |
1582 | 1575 |
cit-contratos-web/src/main/webapp/assets/js/angular/custom/controller/EventoPenalidadeController.js
@@ -49,23 +49,23 @@ citApp.controller('EventoPenalidadeController', ['$scope', '$filter', '$timeout' | @@ -49,23 +49,23 @@ citApp.controller('EventoPenalidadeController', ['$scope', '$filter', '$timeout' | ||
49 | RegistroOcorrenciaRepository.findAllOcorrenciasPorContrato($scope.contrato.id).then(function(result) { | 49 | RegistroOcorrenciaRepository.findAllOcorrenciasPorContrato($scope.contrato.id).then(function(result) { |
50 | $timeout(function (){ | 50 | $timeout(function (){ |
51 | $scope.listaOcorrenciasFixa = result; | 51 | $scope.listaOcorrenciasFixa = result; |
52 | - | ||
53 | - removerOcorrenciasExistentes(); | ||
54 | - | ||
55 | $scope.listaOcorrencias = angular.copy($scope.listaOcorrenciasFixa); | 52 | $scope.listaOcorrencias = angular.copy($scope.listaOcorrenciasFixa); |
53 | + | ||
54 | + removerOcorrenciasExistentes(); | ||
55 | + | ||
56 | }); | 56 | }); |
57 | }); | 57 | }); |
58 | 58 | ||
59 | function removerOcorrenciasExistentes() { | 59 | function removerOcorrenciasExistentes() { |
60 | for(var i = $scope.eventoPenalidade.ocorrencias.length - 1; i >= 0; i--) { | 60 | for(var i = $scope.eventoPenalidade.ocorrencias.length - 1; i >= 0; i--) { |
61 | - for (var j = $scope.listaOcorrenciasFixa.length -1; j >= 0; j--) { | ||
62 | - if ($scope.listaOcorrenciasFixa[j].id === $scope.eventoPenalidade.ocorrencias[i].registroOcorrencia.id) { | ||
63 | - $scope.listaOcorrenciasFixa.splice(j, 1); | 61 | + for (var j = $scope.listaOcorrencias.length -1; j >= 0; j--) { |
62 | + if ($scope.listaOcorrencias[j].id === $scope.eventoPenalidade.ocorrencias[i].registroOcorrencia.id) { | ||
63 | + $scope.listaOcorrencias.splice(j, 1); | ||
64 | } | 64 | } |
65 | } | 65 | } |
66 | } | 66 | } |
67 | }; | 67 | }; |
68 | - | 68 | + |
69 | $scope.addRegistroOcorrencia = function(){ | 69 | $scope.addRegistroOcorrencia = function(){ |
70 | 70 | ||
71 | if($scope.eventoPenalidade.registroOcorrencia){ | 71 | if($scope.eventoPenalidade.registroOcorrencia){ |
cit-contratos-web/src/main/webapp/assets/js/angular/custom/controller/EventoRecebimentoObjetoController.js
@@ -20,171 +20,169 @@ citApp.controller('EventoRecebimentoObjetoController', ['$scope', | @@ -20,171 +20,169 @@ citApp.controller('EventoRecebimentoObjetoController', ['$scope', | ||
20 | FileUploader) { | 20 | FileUploader) { |
21 | 21 | ||
22 | 22 | ||
23 | - $scope.getRecebimentoObjeto = function(){ | ||
24 | - var idRecebimentoObjeto = $scope.evento.id; | ||
25 | - $scope.setLoadingGet(true); | ||
26 | - EventoRecebimentoObjetoRepository.get(idRecebimentoObjeto).then(function(result) { | ||
27 | - $scope.recebimentoObjeto = result.originalElement; | ||
28 | - if($scope.contratoTemp == undefined){ | ||
29 | - $scope.contratoTemp= angular.copy($scope.recebimentoObjeto.contrato); | ||
30 | - } | ||
31 | - $scope.setLoading(false); | ||
32 | - }); | ||
33 | - }; | ||
34 | - | ||
35 | - $scope.resetForm = function(form) { | ||
36 | - | ||
37 | - if($scope.contratoTemp == undefined){ | ||
38 | - $scope.contratoTemp= angular.copy($scope.contrato); | ||
39 | - } | ||
40 | - if($scope.evento){ | ||
41 | - $scope.recebimentoObjeto.dataRecebimento = null; | ||
42 | - $scope.recebimentoObjeto.nomeObjeto = ""; | ||
43 | - $scope.recebimentoObjeto.justificativa = ""; | ||
44 | - } else { | ||
45 | - $scope.recebimentoObjeto = { | ||
46 | - contrato: $scope.contratoTemp, | ||
47 | - dataRecebimento : $filter('date')(new Date(), "dd/MM/yyyy"), | ||
48 | - tipoStatus : null, | ||
49 | - tipoRecebimento : null, | ||
50 | - tipoAvaliacaoPrazo : null, | ||
51 | - tipoAvaliacaoAdesao : null, | ||
52 | - nomeObjeto : "", | ||
53 | - justificativa : "" | ||
54 | - }; | ||
55 | - } | ||
56 | - if(form != undefined){ | ||
57 | - $timeout(function(){ | ||
58 | - form.$submitted = true; | ||
59 | - form.$setPristine(); | ||
60 | - }); | ||
61 | - }; | ||
62 | - }; | ||
63 | - | ||
64 | - $scope.carregarDominios = function(){ | ||
65 | - DominioRepository.findAllDominio('tipoEventoContratoRecebimentoObjeto').then(function(result) { | ||
66 | - angular.forEach(result, function(item, key){ | ||
67 | - switch (item.codigo){ | ||
68 | - case 1 : | ||
69 | - $scope.dominiosRecebimentoObjeto.tiposRecebimentos.push(item.originalElement); | ||
70 | - break; | ||
71 | - case 2 : | ||
72 | - $scope.dominiosRecebimentoObjeto.tiposRecebimentos.push(item.originalElement); | ||
73 | - break; | ||
74 | - case 3 : | ||
75 | - $scope.dominiosRecebimentoObjeto.tiposStatus.push(item.originalElement); | ||
76 | - break; | ||
77 | - case 4 : | ||
78 | - $scope.dominiosRecebimentoObjeto.tiposStatus.push(item.originalElement); | ||
79 | - break; | ||
80 | - } | ||
81 | - }); | ||
82 | - }); | ||
83 | - | ||
84 | - DominioRepository.findAllDominio('tipoEventoContratoRecebimentoObjetoAvaliacaoPrazo').then(function(result) { | ||
85 | - angular.forEach(result, function(item, key){ | ||
86 | - $scope.dominiosRecebimentoObjeto.tiposAvaliacaoPrazo.push(item.originalElement); | ||
87 | - }); | ||
88 | - }); | ||
89 | - DominioRepository.findAllDominio('tipoEventoContratoRecebimentoObjetoAvaliacaoAdesao').then(function(result) { | ||
90 | - angular.forEach(result, function(item, key){ | ||
91 | - $scope.dominiosRecebimentoObjeto.tiposAvaliacaoAdesao.push(item.originalElement); | ||
92 | - }); | ||
93 | - }); | ||
94 | - }; | ||
95 | - | ||
96 | - $scope.uploader = new FileUploader({ | ||
97 | - autoUpload: false, | ||
98 | - queueLimit: 1, | ||
99 | - url : '/cit-tabelas-corp-web/rest/anexo/uploadAnexo?idDocumento=' | ||
100 | - }); | ||
101 | - | ||
102 | - $scope.salvarEvento = function(form){ | ||
103 | - | ||
104 | - form.$submitted = true; | ||
105 | - if(form && !form.$invalid) { | ||
106 | - if ($scope.isInformacoesValidas()){ | ||
107 | - $scope.setLoadingSalva(true); | ||
108 | - | ||
109 | - if($scope.recebimentoObjetoTemp == null){ | ||
110 | - $scope.recebimentoObjetoTemp = { | ||
111 | - documentos : [] | ||
112 | - }; | ||
113 | - angular.forEach($scope.recebimentoObjeto.documentos, function(documento, key) { | ||
114 | - $scope.recebimentoObjetoTemp.documentos.push({ | ||
115 | - uploadsDocumento : clone(documento.uploadsDocumento), | ||
116 | - numero : clone(documento.numero) | ||
117 | - }); | ||
118 | - delete documento.uploadsDocumento; | ||
119 | - }); | ||
120 | - }; | ||
121 | - | ||
122 | - EventoRecebimentoObjetoRepository.save($scope.recebimentoObjeto).then(function(result) { | ||
123 | - $scope.recebimentoObjeto = result.originalElement; | ||
124 | - | ||
125 | - angular.forEach($scope.recebimentoObjeto.documentos, function(documentoSalvo, key) { | ||
126 | - if(documentoSalvo !== undefined && documentoSalvo.id !== undefined){ | ||
127 | - angular.forEach($scope.recebimentoObjetoTemp.documentos, function(documentoTransient, key) { | ||
128 | - if(documentoSalvo.numero === documentoTransient.numero){ | ||
129 | - salvarUpload(documentoSalvo, documentoTransient.uploadsDocumento); | ||
130 | - } | ||
131 | - }); | ||
132 | - }; | ||
133 | - }); | ||
134 | - $scope.setLoading(false); | ||
135 | - $scope.$modalInstance.dismiss('cancel'); | ||
136 | - $scope.showAlert("success", $translate.instant("MSG.MG001")); | ||
137 | - $scope.buscaOcorrencias($scope.contratoTemp); | ||
138 | - }); | ||
139 | - }; | ||
140 | - } else { | ||
141 | - $scope.showAlert('error', $translate.instant('MSG.MN001')); | ||
142 | - } | ||
143 | - }; | ||
144 | - | ||
145 | - $scope.isInformacoesValidas = function () { | ||
146 | - | ||
147 | - var valido = true; | ||
148 | - | ||
149 | - if(!isDataDentroPeriodo($scope.contratoTemp.dataVigenciaInicial, $scope.contratoTemp.dataUltimaVigenciaFinal, | ||
150 | - $scope.recebimentoObjeto.dataRecebimento)){ | ||
151 | - $scope.showAlert('warning', $translate.instant('MSG.DATA_RECEBIMENTO_INVALIDA')); | ||
152 | - valido = false; | ||
153 | - } | ||
154 | - return valido; | ||
155 | - }; | ||
156 | - | ||
157 | - var salvarUpload = function(documento, uploadsDocumento){ | ||
158 | - if (uploadsDocumento != undefined && uploadsDocumento != null) { | ||
159 | - $scope.uploader.queue = uploadsDocumento; | ||
160 | - angular.forEach($scope.uploader.queue, function(item, key) { | ||
161 | - item.url = item.url + documento.id; | ||
162 | - }); | ||
163 | - $scope.uploader.uploadAll(); | ||
164 | - $scope.uploader.isUploading = false; | ||
165 | - }; | ||
166 | - }; | ||
167 | - | ||
168 | - $scope.gerarRelatorioRecebimentoObjeto = function(){ | ||
169 | - $scope.url = '/cit-contratos-web/rest/eventoRecebimentoObjeto/pdfGerarRecebimentoObjeto?idRecebimentoObjeto=' + $scope.recebimentoObjeto.id; | ||
170 | - $scope.visualizarRelatorio($scope.url, $translate.instant('LABEL.TITULO_DOCUMENTO_RECEBIMENTO')); | ||
171 | - $scope.$modalInstance.dismiss('cancel'); | ||
172 | - | ||
173 | - }; | ||
174 | - | ||
175 | - (function init(){ | ||
176 | - $scope.dominiosRecebimentoObjeto = { | ||
177 | - tiposStatus: [], | ||
178 | - tiposRecebimentos : [], | ||
179 | - tiposAvaliacaoPrazo : [], | ||
180 | - tiposAvaliacaoAdesao : [], | ||
181 | - }; | ||
182 | - $scope.carregarDominios(); | ||
183 | - if($scope.evento){ | ||
184 | - $scope.getRecebimentoObjeto(); | ||
185 | - } else { | ||
186 | - $scope.resetForm(); | ||
187 | - } | ||
188 | - })(); | 23 | + $scope.getRecebimentoObjeto = function(){ |
24 | + var idRecebimentoObjeto = $scope.evento.id; | ||
25 | + $scope.setLoadingGet(true); | ||
26 | + EventoRecebimentoObjetoRepository.get(idRecebimentoObjeto).then(function(result) { | ||
27 | + $scope.recebimentoObjeto = result.originalElement; | ||
28 | + if($scope.contratoTemp == undefined){ | ||
29 | + $scope.contratoTemp= angular.copy($scope.recebimentoObjeto.contrato); | ||
30 | + } | ||
31 | + $scope.setLoading(false); | ||
32 | + }); | ||
33 | + }; | ||
34 | + | ||
35 | + $scope.resetForm = function(form) { | ||
36 | + | ||
37 | + if($scope.contratoTemp == undefined){ | ||
38 | + $scope.contratoTemp= angular.copy($scope.contrato); | ||
39 | + } | ||
40 | + if($scope.evento){ | ||
41 | + $scope.recebimentoObjeto.dataRecebimento = null; | ||
42 | + $scope.recebimentoObjeto.justificativa = ""; | ||
43 | + } else { | ||
44 | + $scope.recebimentoObjeto = { | ||
45 | + contrato: $scope.contratoTemp, | ||
46 | + dataRecebimento : $filter('date')(new Date(), "dd/MM/yyyy"), | ||
47 | + tipoStatus : null, | ||
48 | + tipoRecebimento : null, | ||
49 | + tipoAvaliacaoPrazo : null, | ||
50 | + tipoAvaliacaoAdesao : null, | ||
51 | + justificativa : "" | ||
52 | + }; | ||
53 | + } | ||
54 | + if(form != undefined){ | ||
55 | + $timeout(function(){ | ||
56 | + form.$submitted = true; | ||
57 | + form.$setPristine(); | ||
58 | + }); | ||
59 | + }; | ||
60 | + }; | ||
61 | + | ||
62 | + $scope.carregarDominios = function(){ | ||
63 | + DominioRepository.findAllDominio('tipoEventoContratoRecebimentoObjeto').then(function(result) { | ||
64 | + angular.forEach(result, function(item, key){ | ||
65 | + switch (item.codigo){ | ||
66 | + case 1 : | ||
67 | + $scope.dominiosRecebimentoObjeto.tiposRecebimentos.push(item.originalElement); | ||
68 | + break; | ||
69 | + case 2 : | ||
70 | + $scope.dominiosRecebimentoObjeto.tiposRecebimentos.push(item.originalElement); | ||
71 | + break; | ||
72 | + case 3 : | ||
73 | + $scope.dominiosRecebimentoObjeto.tiposStatus.push(item.originalElement); | ||
74 | + break; | ||
75 | + case 4 : | ||
76 | + $scope.dominiosRecebimentoObjeto.tiposStatus.push(item.originalElement); | ||
77 | + break; | ||
78 | + } | ||
79 | + }); | ||
80 | + }); | ||
81 | + | ||
82 | + DominioRepository.findAllDominio('tipoEventoContratoRecebimentoObjetoAvaliacaoPrazo').then(function(result) { | ||
83 | + angular.forEach(result, function(item, key){ | ||
84 | + $scope.dominiosRecebimentoObjeto.tiposAvaliacaoPrazo.push(item.originalElement); | ||
85 | + }); | ||
86 | + }); | ||
87 | + DominioRepository.findAllDominio('tipoEventoContratoRecebimentoObjetoAvaliacaoAdesao').then(function(result) { | ||
88 | + angular.forEach(result, function(item, key){ | ||
89 | + $scope.dominiosRecebimentoObjeto.tiposAvaliacaoAdesao.push(item.originalElement); | ||
90 | + }); | ||
91 | + }); | ||
92 | + }; | ||
93 | + | ||
94 | + $scope.uploader = new FileUploader({ | ||
95 | + autoUpload: false, | ||
96 | + queueLimit: 1, | ||
97 | + url : '/cit-tabelas-corp-web/rest/anexo/uploadAnexo?idDocumento=' | ||
98 | + }); | ||
99 | + | ||
100 | + $scope.salvarEvento = function(form){ | ||
101 | + | ||
102 | + form.$submitted = true; | ||
103 | + if(form && !form.$invalid) { | ||
104 | + if ($scope.isInformacoesValidas()){ | ||
105 | + $scope.setLoadingSalva(true); | ||
106 | + | ||
107 | + if($scope.recebimentoObjetoTemp == null){ | ||
108 | + $scope.recebimentoObjetoTemp = { | ||
109 | + documentos : [] | ||
110 | + }; | ||
111 | + angular.forEach($scope.recebimentoObjeto.documentos, function(documento, key) { | ||
112 | + $scope.recebimentoObjetoTemp.documentos.push({ | ||
113 | + uploadsDocumento : clone(documento.uploadsDocumento), | ||
114 | + numero : clone(documento.numero) | ||
115 | + }); | ||
116 | + delete documento.uploadsDocumento; | ||
117 | + }); | ||
118 | + }; | ||
119 | + | ||
120 | + EventoRecebimentoObjetoRepository.save($scope.recebimentoObjeto).then(function(result) { | ||
121 | + $scope.recebimentoObjeto = result.originalElement; | ||
122 | + | ||
123 | + angular.forEach($scope.recebimentoObjeto.documentos, function(documentoSalvo, key) { | ||
124 | + if(documentoSalvo !== undefined && documentoSalvo.id !== undefined){ | ||
125 | + angular.forEach($scope.recebimentoObjetoTemp.documentos, function(documentoTransient, key) { | ||
126 | + if(documentoSalvo.numero === documentoTransient.numero){ | ||
127 | + salvarUpload(documentoSalvo, documentoTransient.uploadsDocumento); | ||
128 | + } | ||
129 | + }); | ||
130 | + }; | ||
131 | + }); | ||
132 | + $scope.setLoading(false); | ||
133 | + $scope.$modalInstance.dismiss('cancel'); | ||
134 | + $scope.showAlert("success", $translate.instant("MSG.MG001")); | ||
135 | + $scope.buscaOcorrencias($scope.contratoTemp); | ||
136 | + }); | ||
137 | + }; | ||
138 | + } else { | ||
139 | + $scope.showAlert('error', $translate.instant('MSG.MN001')); | ||
140 | + } | ||
141 | + }; | ||
142 | + | ||
143 | + $scope.isInformacoesValidas = function () { | ||
144 | + | ||
145 | + var valido = true; | ||
146 | + | ||
147 | + if(!isDataDentroPeriodo($scope.contratoTemp.dataVigenciaInicial, $scope.contratoTemp.dataUltimaVigenciaFinal, | ||
148 | + $scope.recebimentoObjeto.dataRecebimento)){ | ||
149 | + $scope.showAlert('warning', $translate.instant('MSG.DATA_RECEBIMENTO_INVALIDA')); | ||
150 | + valido = false; | ||
151 | + } | ||
152 | + return valido; | ||
153 | + }; | ||
154 | + | ||
155 | + var salvarUpload = function(documento, uploadsDocumento){ | ||
156 | + if (uploadsDocumento != undefined && uploadsDocumento != null) { | ||
157 | + $scope.uploader.queue = uploadsDocumento; | ||
158 | + angular.forEach($scope.uploader.queue, function(item, key) { | ||
159 | + item.url = item.url + documento.id; | ||
160 | + }); | ||
161 | + $scope.uploader.uploadAll(); | ||
162 | + $scope.uploader.isUploading = false; | ||
163 | + }; | ||
164 | + }; | ||
165 | + | ||
166 | + $scope.gerarRelatorioRecebimentoObjeto = function(){ | ||
167 | + $scope.url = '/cit-contratos-web/rest/eventoRecebimentoObjeto/pdfGerarRecebimentoObjeto?idRecebimentoObjeto=' + $scope.recebimentoObjeto.id; | ||
168 | + $scope.visualizarRelatorio($scope.url, $translate.instant('LABEL.TITULO_DOCUMENTO_RECEBIMENTO')); | ||
169 | + $scope.$modalInstance.dismiss('cancel'); | ||
170 | + | ||
171 | + }; | ||
172 | + | ||
173 | + (function init(){ | ||
174 | + $scope.dominiosRecebimentoObjeto = { | ||
175 | + tiposStatus: [], | ||
176 | + tiposRecebimentos : [], | ||
177 | + tiposAvaliacaoPrazo : [], | ||
178 | + tiposAvaliacaoAdesao : [], | ||
179 | + }; | ||
180 | + $scope.carregarDominios(); | ||
181 | + if($scope.evento){ | ||
182 | + $scope.getRecebimentoObjeto(); | ||
183 | + } else { | ||
184 | + $scope.resetForm(); | ||
185 | + } | ||
186 | + })(); | ||
189 | 187 | ||
190 | }]); | 188 | }]); |
cit-contratos-web/src/main/webapp/assets/js/angular/custom/controller/VisaoContratoController.js
@@ -160,17 +160,27 @@ citApp.controller('VisaoContratoController', ['$scope', | @@ -160,17 +160,27 @@ citApp.controller('VisaoContratoController', ['$scope', | ||
160 | }; | 160 | }; |
161 | 161 | ||
162 | $scope.editarModal = function (evento) { | 162 | $scope.editarModal = function (evento) { |
163 | - $scope.edit = true; | ||
164 | - $scope.abreModal(evento.tipoEvento.nome); | 163 | + $scope.edit = true; |
164 | + | ||
165 | + if($scope.evento.aditivoDePrazo){ | ||
166 | + EventoAditivoRepository.existeAditivoPrazoPosterior($scope.evento.id).then(function (result) { | ||
167 | + $scope.naoPermiteAlterarDataFim = result; | ||
168 | + $scope.abreModal(evento.tipoEvento.nome); | ||
169 | + }); | ||
170 | + }else{ | ||
171 | + $scope.abreModal(evento.tipoEvento.nome); | ||
172 | + } | ||
173 | + | ||
165 | }; | 174 | }; |
166 | 175 | ||
167 | $scope.criarEvento = function () { | 176 | $scope.criarEvento = function () { |
168 | - $scope.evento = null; | ||
169 | - $timeout(function () { | ||
170 | - $scope.edit = true; | ||
171 | - $scope.abreModal($scope.contrato.contratoEvento.tipoEventoId); | ||
172 | - delete $scope.contrato.contratoEvento; | ||
173 | - }); | 177 | + $scope.naoPermiteAlterarDataFim = false; |
178 | + $scope.evento = null; | ||
179 | + $timeout(function () { | ||
180 | + $scope.edit = true; | ||
181 | + $scope.abreModal($scope.contrato.contratoEvento.tipoEventoId); | ||
182 | + delete $scope.contrato.contratoEvento; | ||
183 | + }); | ||
174 | }; | 184 | }; |
175 | 185 | ||
176 | var eventoClasses = { | 186 | var eventoClasses = { |
@@ -519,8 +529,19 @@ citApp.controller('VisaoContratoController', ['$scope', | @@ -519,8 +529,19 @@ citApp.controller('VisaoContratoController', ['$scope', | ||
519 | }; | 529 | }; |
520 | 530 | ||
521 | $scope.removerEvento = function(){ | 531 | $scope.removerEvento = function(){ |
522 | - $scope.evento.justificativaExclusao = ''; | ||
523 | - $scope.$openModal('modal-justificativa-exclusao.html', 'lg'); | 532 | + if($scope.evento.aditivoDePrazo){ |
533 | + EventoAditivoRepository.permiteExclusaoAditivo($scope.evento.id).then(function (result) { | ||
534 | + if(result){ | ||
535 | + $scope.evento.justificativaExclusao = ''; | ||
536 | + $scope.$openModal('modal-justificativa-exclusao.html', 'lg'); | ||
537 | + }else{ | ||
538 | + $scope.showAlert('warning', $translate.instant('CONTRATOS.MSG.EXCLUSAO_ADITIVO_NEGADA')); | ||
539 | + } | ||
540 | + }); | ||
541 | + }else{ | ||
542 | + $scope.evento.justificativaExclusao = ''; | ||
543 | + $scope.$openModal('modal-justificativa-exclusao.html', 'lg'); | ||
544 | + } | ||
524 | }; | 545 | }; |
525 | 546 | ||
526 | $scope.salvarJustificativaExclusao = function(form){ | 547 | $scope.salvarJustificativaExclusao = function(form){ |
cit-contratos-web/src/main/webapp/assets/js/angular/custom/repository/EventoAditivoRepository.js
@@ -4,10 +4,18 @@ citApp.factory('EventoAditivoRepository', ['RestangularContratos', 'AbstractRepo | @@ -4,10 +4,18 @@ citApp.factory('EventoAditivoRepository', ['RestangularContratos', 'AbstractRepo | ||
4 | 4 | ||
5 | function EventoAditivoRepository() { | 5 | function EventoAditivoRepository() { |
6 | AbstractRepository.call(this, restangularContratos, 'rest/eventoAditivo'); | 6 | AbstractRepository.call(this, restangularContratos, 'rest/eventoAditivo'); |
7 | - | 7 | + |
8 | this.findAllByContrato = function(contratoId) { | 8 | this.findAllByContrato = function(contratoId) { |
9 | return restangularContratos.all(this.route+'/findAllByContrato').post(contratoId); | 9 | return restangularContratos.all(this.route+'/findAllByContrato').post(contratoId); |
10 | - }; | 10 | + }; |
11 | + | ||
12 | + this.permiteExclusaoAditivo = function(aditivoId) { | ||
13 | + return restangularContratos.one(this.route + "/permiteExclusaoAditivo").get({"aditivoId": aditivoId}).then(); | ||
14 | + }; | ||
15 | + this.existeAditivoPrazoPosterior = function(aditivoId) { | ||
16 | + return restangularContratos.one(this.route + "/existeAditivoPrazoPosterior").get({"aditivoId": aditivoId}).then(); | ||
17 | + }; | ||
18 | + | ||
11 | } | 19 | } |
12 | 20 | ||
13 | AbstractRepository.extend(EventoAditivoRepository); | 21 | AbstractRepository.extend(EventoAditivoRepository); |
cit-contratos-web/src/main/webapp/html/contrato/contratoPg5.html
@@ -9,11 +9,11 @@ | @@ -9,11 +9,11 @@ | ||
9 | tooltip="{{$translate.instant('VALIDACAO.CONTRATO_EXIGE_MINIMO_TRES_ENVOLVIDOS')}}" tooltip-placement='top'/> | 9 | tooltip="{{$translate.instant('VALIDACAO.CONTRATO_EXIGE_MINIMO_TRES_ENVOLVIDOS')}}" tooltip-placement='top'/> |
10 | </label> | 10 | </label> |
11 | </legend> | 11 | </legend> |
12 | - | ||
13 | - <script type="text/ng-template" id="modal-envolvido.html"> | 12 | + |
13 | + <script type="text/ng-template" id="dialog_envolvido.html"> | ||
14 | <div ng-include src="'/cit-contratos-web/html/contrato/dialog_envolvido.html'" /> | 14 | <div ng-include src="'/cit-contratos-web/html/contrato/dialog_envolvido.html'" /> |
15 | </script> | 15 | </script> |
16 | - | 16 | + |
17 | <div class="row margin-top"> | 17 | <div class="row margin-top"> |
18 | <div class="col-sm-12"> | 18 | <div class="col-sm-12"> |
19 | <div class="panel panel-default"> | 19 | <div class="panel panel-default"> |
@@ -23,15 +23,15 @@ | @@ -23,15 +23,15 @@ | ||
23 | <i class="fa fa-plus-circle yellow-dark"></i> | 23 | <i class="fa fa-plus-circle yellow-dark"></i> |
24 | <translate>LABEL.ADICIONAR</translate> | 24 | <translate>LABEL.ADICIONAR</translate> |
25 | </button> | 25 | </button> |
26 | - | 26 | + |
27 | <button title="{{$translate.instant('LABEL.VISUALIZAR')}}" alt="{{$translate.instant('LABEL.VISUALIZAR')}}" class="btn btn-clear" type="button" | 27 | <button title="{{$translate.instant('LABEL.VISUALIZAR')}}" alt="{{$translate.instant('LABEL.VISUALIZAR')}}" class="btn btn-clear" type="button" |
28 | - ng-click="abrirContratoEnvolvido(false);" ng-disabled="acaoEmMassaEnvolvido"> | 28 | + ng-click="visualizarEditarContratoEnvolvido(false);" ng-if="!acaoEmMassaEnvolvido"> |
29 | <i class="fa fa-search blue"></i> | 29 | <i class="fa fa-search blue"></i> |
30 | <translate>LABEL.VISUALIZAR</translate> | 30 | <translate>LABEL.VISUALIZAR</translate> |
31 | </button> | 31 | </button> |
32 | - | 32 | + |
33 | <button title="{{$translate.instant('LABEL.EDITAR')}}" alt="{{$translate.instant('LABEL.EDITAR')}}" ng-show="edit" class="btn btn-clear" type="button" | 33 | <button title="{{$translate.instant('LABEL.EDITAR')}}" alt="{{$translate.instant('LABEL.EDITAR')}}" ng-show="edit" class="btn btn-clear" type="button" |
34 | - ng-click="abrirContratoEnvolvido(true);" ng-if="!acaoEmMassaEnvolvido"> | 34 | + ng-click="visualizarEditarContratoEnvolvido(true);" ng-if="!acaoEmMassaEnvolvido"> |
35 | <i class="fa fa-pencil blue"></i> | 35 | <i class="fa fa-pencil blue"></i> |
36 | <translate>LABEL.EDITAR</translate> | 36 | <translate>LABEL.EDITAR</translate> |
37 | </button> | 37 | </button> |
@@ -65,55 +65,5 @@ | @@ -65,55 +65,5 @@ | ||
65 | </div><!-- .col --> | 65 | </div><!-- .col --> |
66 | </div> <!-- .row --> | 66 | </div> <!-- .row --> |
67 | </fieldset><!-- .fieldset --> | 67 | </fieldset><!-- .fieldset --> |
68 | - | ||
69 | - <fieldset ng-if="(contrato.id && hasAlteracaoEnvolvido) || (contrato.id && contrato.justificativas.length > 0)"> | ||
70 | - <legend> | ||
71 | - <label ng-class="{'has-error' : informacoesEnvolvidosContratoForm.$submitted && hasAlteracaoEnvolvido && (!contrato.justificativas || contrato.justificativas.length < 1)}"> | ||
72 | - <translate>LABEL.JUSTIFICATIVAS</translate> | ||
73 | - <span class='red' ng-show="true">*</span> | ||
74 | - <i ng-show="informacoesEnvolvidosContratoForm.$submitted && hasAlteracaoEnvolvido && (!contrato.justificativas || contrato.justificativas.length < 1)" class='fa fa-warning red' | ||
75 | - tooltip="{{$translate.instant('CONTRATOS.VALIDACAO.ALTERACAO_ENVOLVIDOS_EXIGE_JUSTIFICATIVA')}}" tooltip-placement='top'/> | ||
76 | - </label> | ||
77 | - </legend> | ||
78 | - | ||
79 | - <script type="text/ng-template" id="modal-justificativa.html"> | ||
80 | - <div ng-include src="'/cit-contratos-web/html/contrato/dialog_justificativa.html'" /> | ||
81 | - </script> | ||
82 | - | ||
83 | - <div class="row margin-top"> | ||
84 | - <div class="col-sm-12"> | ||
85 | - <div class="panel panel-default"> | ||
86 | - <div class="panel-heading clearfix"> | ||
87 | - <button title="{{$translate.instant('LABEL.ADICIONAR')}}" alt="{{$translate.instant('LABEL.ADICIONAR')}}" class="btn btn-clear" type="button" ng-show="true" | ||
88 | - ng-click="openModalJustificativa();"> | ||
89 | - <i class="fa fa-plus-circle yellow-dark"></i> | ||
90 | - <translate>LABEL.ADICIONAR</translate> | ||
91 | - </button> | ||
92 | - </div><!-- .panel-heading --> | ||
93 | - <table class="table table-bordered table-striped"> | ||
94 | - <thead> | ||
95 | - <tr> | ||
96 | - <th style="width: 5%;" class="text-center">#</th> | ||
97 | - <th style="width: 15%;" class="text-center"><translate>LABEL.DATA</translate></th> | ||
98 | - <th style="width: 65%;" class="text-center"><translate>LABEL.JUSTIFICATIVA</translate></th> | ||
99 | - <th style="width: 15%;" class="text-center"><translate>LABEL.USUARIO</translate></th> | ||
100 | - </tr> | ||
101 | - </thead> | ||
102 | - <tbody> | ||
103 | - <tr ng-hide="(contrato.justificativas && contrato.justificativas.length != 0)"> | ||
104 | - <td colspan="4" class="text-center"><translate>LABEL.TABELA_VAZIA</translate></td> | ||
105 | - </tr> | ||
106 | - <tr ng-repeat="justificativa in contrato.justificativas"> | ||
107 | - <td class="text-center">{{$index +1}}</td> | ||
108 | - <td class="text-center">{{ justificativa.dataCriacao | date : 'dd/MM/yyyy' }}</td> | ||
109 | - <td class="text-justify">{{ justificativa.descricao }}</td> | ||
110 | - <td class="text-center">{{ justificativa.autor.username }}</td> | ||
111 | - </tr> | ||
112 | - </tbody> | ||
113 | - </table> | ||
114 | - </div><!-- .painel --> | ||
115 | - </div><!-- .col --> | ||
116 | - </div> <!-- .row --> | ||
117 | - </fieldset><!-- .fieldset --> | ||
118 | </div><!-- /.page-content --> | 68 | </div><!-- /.page-content --> |
119 | </ng-form> | 69 | </ng-form> |
120 | \ No newline at end of file | 70 | \ No newline at end of file |
cit-contratos-web/src/main/webapp/html/contrato/dialog_envolvido.html
1 | <ng-form name="formDialogEnvolvido" autocomplete="off"> | 1 | <ng-form name="formDialogEnvolvido" autocomplete="off"> |
2 | <div class="modal-header"> | 2 | <div class="modal-header"> |
3 | - <button title="{{$translate.instant('LABEL.ADICIONAR')}}" alt="{{$translate.instant('LABEL.ADICIONAR')}}" | ||
4 | - ng-click="adicionarContratoEnvolvido(formDialogEnvolvido, false)" ng-if="editEnvolvido" class="btn btn-clear" type="button"> | ||
5 | - <i class="fa fa-save green"></i> | ||
6 | - <translate>LABEL.ADICIONAR</translate> | ||
7 | - </button> | ||
8 | - <button title="{{$translate.instant('LABEL.ADICIONAR_NOVO')}}" alt="{{$translate.instant('LABEL.ADICIONAR_NOVO')}}" | ||
9 | - ng-click="adicionarContratoEnvolvido(formDialogEnvolvido, true)" ng-if="editEnvolvido" class="btn btn-clear" type="button"> | ||
10 | - <i class="fa fa-save green"></i> | ||
11 | - <translate>LABEL.ADICIONAR_CONTINUAR</translate> | ||
12 | - </button> | ||
13 | - | ||
14 | - <button title="{{$translate.instant('LABEL.FECHAR')}}" alt="{{$translate.instant('LABEL.FECHAR')}}" | ||
15 | - ng-click="$dismiss('cancel');" class="btn btn-clear" type="button"> | ||
16 | - <i class="fa fa-times red"></i> | ||
17 | - <translate>LABEL.FECHAR</translate> | ||
18 | - </button> | 3 | + <button title="{{$translate.instant('LABEL.ADICIONAR')}}" alt="{{$translate.instant('LABEL.ADICIONAR')}}" |
4 | + ng-click="adicionarContratoEnvolvido(formDialogEnvolvido, false)" ng-if="editEnvolvido" class="btn btn-clear" type="button"> | ||
5 | + <i class="fa fa-save green"></i> | ||
6 | + <translate>LABEL.ADICIONAR</translate> | ||
7 | + </button> | ||
8 | + <button title="{{$translate.instant('LABEL.ADICIONAR_NOVO')}}" alt="{{$translate.instant('LABEL.ADICIONAR_NOVO')}}" | ||
9 | + ng-click="adicionarContratoEnvolvido(formDialogEnvolvido, true)" ng-show="editEnvolvido && !hasAlteracaoEnvolvido" class="btn btn-clear" type="button"> | ||
10 | + <i class="fa fa-save green"></i> | ||
11 | + <translate>LABEL.ADICIONAR_CONTINUAR</translate> | ||
12 | + </button> | ||
13 | + | ||
14 | + <button title="{{$translate.instant('LABEL.FECHAR')}}" alt="{{$translate.instant('LABEL.FECHAR')}}" | ||
15 | + ng-click="closeModalContratoEvolvido(formDialogEnvolvido);" class="btn btn-clear" type="button"> | ||
16 | + <i class="fa fa-times red"></i> | ||
17 | + <translate>LABEL.FECHAR</translate> | ||
18 | + </button> | ||
19 | </div> | 19 | </div> |
20 | 20 | ||
21 | <div class="modal-body"> | 21 | <div class="modal-body"> |
22 | - <h2 class="title-modal"><translate>LABEL.ENVOLVIDO</translate></h2> | ||
23 | - <p ng-show="editEnvolvido"> | ||
24 | - <small>( <span class="red">*</span> ) <translate>LABEL.CAMPOS_OBRIGATORIOS</translate></small> | ||
25 | - </p> | ||
26 | - | 22 | + <h2 class="title-modal"><translate>LABEL.ENVOLVIDO</translate></h2> |
23 | + <p ng-show="editEnvolvido"> | ||
24 | + <small>( <span class="red">*</span> ) <translate>LABEL.CAMPOS_OBRIGATORIOS</translate></small> | ||
25 | + </p> | ||
26 | + | ||
27 | <fieldset> | 27 | <fieldset> |
28 | <div class="row"> | 28 | <div class="row"> |
29 | - <div class="col-sm-4"> | ||
30 | - <auto-complete ng-find="findEnvolvido(value)" ng-item="item.pessoa.nome" | ||
31 | - ng-id="contratoEnvolvidoTemp.envolvido" ng-label="LABEL.NOME_ENVOLVIDO" ng-model="contratoEnvolvidoTemp.envolvido" | ||
32 | - ng-disabled="!edit" form="formDialogEnvolvido" ng-obrigatorio="true"/> | 29 | + <div class="col-sm-6"> |
30 | + <auto-complete ng-find="findEnvolvido(value)" ng-item="item.pessoa.nome" ng-disabled="!editEnvolvido" | ||
31 | + ng-id="contratoEnvolvidoTemp.envolvido" ng-label="LABEL.NOME_ENVOLVIDO" ng-model="contratoEnvolvidoTemp.envolvido" | ||
32 | + ng-disabled="!edit" form="formDialogEnvolvido" ng-obrigatorio="true" /> | ||
33 | </div> | 33 | </div> |
34 | - | ||
35 | - <div class="col-sm-4"> | ||
36 | - <label-input ng-type="text" ng-id="contratoEnvolvidoTemp.envolvido.matricula" ng-label="LABEL.MATRICULA" | ||
37 | - ng-model="contratoEnvolvidoTemp.envolvido.matricula" ng-custom-maxlength="30" form="formDialogEnvolvido" | 34 | + |
35 | + <div class="col-sm-3"> | ||
36 | + <label-input ng-type="text" ng-id="contratoEnvolvidoTemp.envolvido.matricula" ng-label="LABEL.MATRICULA" | ||
37 | + ng-model="contratoEnvolvidoTemp.envolvido.matricula" ng-custom-maxlength="30" form="formDialogEnvolvido" | ||
38 | ng-disabled="true" ng-obrigatorio="false"/> | 38 | ng-disabled="true" ng-obrigatorio="false"/> |
39 | </div><!-- .col-sm-4 --> | 39 | </div><!-- .col-sm-4 --> |
40 | - | ||
41 | - <div class="col-sm-4"> | ||
42 | - <label-select ng-label="LABEL.PAPEL" ng-id="contratoEnvolvidoTemp.dominioPapelEnvolvidoContrato" | ||
43 | - ng-model="contratoEnvolvidoTemp.dominioPapelEnvolvidoContrato" ng-list="dominioPapelEnvolvidoList" | ||
44 | - form="formDialogEnvolvido" ng-obrigatorio="editEnvolvido" ng-disabled="!editEnvolvido" | 40 | + |
41 | + <div class="col-sm-3" > | ||
42 | + <label-select ng-label="LABEL.PAPEL" ng-id="contratoEnvolvidoTemp.dominioPapelEnvolvidoContrato" | ||
43 | + ng-model="contratoEnvolvidoTemp.dominioPapelEnvolvidoContrato" ng-list="dominioPapelEnvolvidoList" | ||
44 | + form="formDialogEnvolvido" ng-obrigatorio="editEnvolvido && dominioPapelEnvolvidoList.length > 0" | ||
45 | + ng-disabled="!editEnvolvido || dominioPapelEnvolvidoList.length == 0" | ||
45 | ng-custom-options="dominioPapelEnvolvido.originalElement as dominioPapelEnvolvido.descricao for dominioPapelEnvolvido" | 46 | ng-custom-options="dominioPapelEnvolvido.originalElement as dominioPapelEnvolvido.descricao for dominioPapelEnvolvido" |
46 | track-by="track by dominioPapelEnvolvido.id"/> | 47 | track-by="track by dominioPapelEnvolvido.id"/> |
47 | </div><!-- .col-sm-4 --> | 48 | </div><!-- .col-sm-4 --> |
48 | </div><!-- .row --> | 49 | </div><!-- .row --> |
50 | + </fieldset> | ||
51 | + <fieldset ng-if="(contrato.id && hasAlteracaoEnvolvido) || (contrato.id && contratoEnvolvidoTemp.justificativas.length > 0)"> | ||
52 | + <div class="row"> | ||
53 | + <div class="col-sm-12"> | ||
54 | + <h2 class="title-modal"><translate>LABEL.JUSTIFICATIVA</translate></h2> | ||
55 | + <p ng-show="editEnvolvido"> | ||
56 | + <small>( <span class="red">*</span> ) <translate>LABEL.CAMPOS_OBRIGATORIOS</translate></small> | ||
57 | + </p> | ||
58 | + </div> | ||
59 | + </div> | ||
60 | + <div class="row"> | ||
61 | + <div class="col-sm-12"> | ||
62 | + <label-text-area ng-id="justificativaTemp.descricao" ng-label="LABEL.JUSTIFICATIVA" ng-hide="!editEnvolvido" | ||
63 | + form="formDialogJustificativa" rows="3" ng-custom-maxlength="500" | ||
64 | + ng-model="justificativaTemp.descricao" ></label-text-area> | ||
65 | + </div> | ||
66 | + </div><!-- .row --> | ||
67 | + <div class="row"> | ||
68 | + <div class="col-sm-4"> | ||
69 | + <button title="{{$translate.instant('CONTRATOS.LABEL.ADICIONAR_JUSTIFICATIVA')}}" alt="{{$translate.instant('CONTRATOS.LABEL.ADICIONAR_JUSTIFICATIVA')}}" | ||
70 | + ng-click="adicionarJustificativa(formDialogEnvolvido)" ng-hide="!editEnvolvido" class="btn btn-success" type="button"> | ||
71 | + <i class="fa fa-save white"></i> | ||
72 | + <translate>CONTRATOS.LABEL.ADICIONAR_JUSTIFICATIVA</translate> | ||
73 | + </button> | ||
74 | + </div> | ||
75 | + </div><!-- .row --> | ||
76 | + </br> | ||
77 | + <div class="row"> | ||
78 | + <div class="col-sm-12"> | ||
79 | + <table class="table table-bordered table-striped"> | ||
80 | + <thead> | ||
81 | + <tr> | ||
82 | + <th style="width: 5%;" class="text-center">#</th> | ||
83 | + <th style="width: 15%;" class="text-center"><translate>LABEL.DATA</translate></th> | ||
84 | + <th style="width: 65%;" class="text-center"><translate>LABEL.JUSTIFICATIVA</translate></th> | ||
85 | + <th style="width: 15%;" class="text-center"><translate>LABEL.USUARIO</translate></th> | ||
86 | + </tr> | ||
87 | + </thead> | ||
88 | + <tbody> | ||
89 | + <tr ng-hide="(contratoEnvolvidoTemp.justificativas && contratoEnvolvidoTemp.justificativas.length != 0)"> | ||
90 | + <td colspan="4" class="text-center"><translate>LABEL.TABELA_VAZIA</translate></td> | ||
91 | + </tr> | ||
92 | + <tr ng-repeat="justificativa in contratoEnvolvidoTemp.justificativas"> | ||
93 | + <td class="text-center">{{$index +1}}</td> | ||
94 | + <td class="text-center">{{ justificativa.dataCriacao | date : 'dd/MM/yyyy' }}</td> | ||
95 | + <td class="text-justify">{{ justificativa.descricao }}</td> | ||
96 | + <td class="text-center">{{ justificativa.autor.username }}</td> | ||
97 | + </tr> | ||
98 | + </tbody> | ||
99 | + </table> | ||
100 | + </div><!-- .<!-- .col --> | ||
101 | + </div><!-- .<!-- .row --> | ||
49 | </fieldset><!-- .fieldset --> | 102 | </fieldset><!-- .fieldset --> |
50 | </div><!-- .<!-- .modal-body --> | 103 | </div><!-- .<!-- .modal-body --> |
51 | -</ng-form> | ||
52 | \ No newline at end of file | 104 | \ No newline at end of file |
105 | +</ng-form> |
cit-contratos-web/src/main/webapp/html/eventos/cnt_ev_aditivo.html
@@ -61,12 +61,12 @@ | @@ -61,12 +61,12 @@ | ||
61 | </div> | 61 | </div> |
62 | <div class="col-sm-4"> | 62 | <div class="col-sm-4"> |
63 | <label-input-data ng-id="aditivo.dataEmissao" ng-label="LABEL.DATA_EMISSAO_OCORRENCIA" ng-obrigatorio="true" ng-model="aditivo.dataEmissao" form="formDialogAditivo" | 63 | <label-input-data ng-id="aditivo.dataEmissao" ng-label="LABEL.DATA_EMISSAO_OCORRENCIA" ng-obrigatorio="true" ng-model="aditivo.dataEmissao" form="formDialogAditivo" |
64 | - ng-disabled="!edit || aditivo.id" ng-format="dd/MM/yyyy"> | 64 | + ng-disabled="!edit || (aditivo.aditivoDeClausula && aditivo.id)" ng-format="dd/MM/yyyy"> |
65 | </label-input-data> | 65 | </label-input-data> |
66 | </div> | 66 | </div> |
67 | <div class="col-sm-4"> | 67 | <div class="col-sm-4"> |
68 | <label-select ng-label="LABEL.TIPO_ALTERACAO" ng-id="aditivo.tipoAlteracao" ng-model="aditivo.tipoAlteracao" form="formDialogAditivo" ng-list="tiposAlteracaoContrato" | 68 | <label-select ng-label="LABEL.TIPO_ALTERACAO" ng-id="aditivo.tipoAlteracao" ng-model="aditivo.tipoAlteracao" form="formDialogAditivo" ng-list="tiposAlteracaoContrato" |
69 | - ng-custom-options="item.originalElement as item.descricao for item" track-by="track by item.id" ng-disabled="!edit || aditivo.id" ng-obrigatorio="true"> | 69 | + ng-custom-options="item.originalElement as item.descricao for item" track-by="track by item.id" ng-disabled="!edit || (aditivo.aditivoDeClausula && aditivo.id)" ng-obrigatorio="true"> |
70 | </label-select> | 70 | </label-select> |
71 | </div> | 71 | </div> |
72 | </div> | 72 | </div> |
@@ -107,7 +107,7 @@ | @@ -107,7 +107,7 @@ | ||
107 | ng-model="aditivo.dataInicio" form="formDialogAditivo" /> | 107 | ng-model="aditivo.dataInicio" form="formDialogAditivo" /> |
108 | </div> | 108 | </div> |
109 | <div class="col-sm-3"> | 109 | <div class="col-sm-3"> |
110 | - <label-input-data ng-id="aditivo.dataFim" ng-label="CONTRATOS.LABEL.DATA_FINAL_ADITIVO" ng-obrigatorio="aditivo.aditivoDePrazo" ng-disabled="!edit" | 110 | + <label-input-data ng-id="aditivo.dataFim" ng-label="CONTRATOS.LABEL.DATA_FINAL_ADITIVO" ng-obrigatorio="aditivo.aditivoDePrazo" ng-disabled="!edit || naoPermiteAlterarDataFim" |
111 | ng-model="aditivo.dataFim" form="formDialogAditivo" /> | 111 | ng-model="aditivo.dataFim" form="formDialogAditivo" /> |
112 | </div> | 112 | </div> |
113 | </div> | 113 | </div> |
@@ -117,14 +117,14 @@ | @@ -117,14 +117,14 @@ | ||
117 | <div class="row"> | 117 | <div class="row"> |
118 | <div class="col-sm-6"> | 118 | <div class="col-sm-6"> |
119 | <label-input-radio ng-id="aditivo.tipoAlteracaoValor.codigo" ng-label="LABEL.TIPO_ALTERACAO" list="tiposAlteracaoValor" ng-model="aditivo.tipoAlteracaoValor.codigo" | 119 | <label-input-radio ng-id="aditivo.tipoAlteracaoValor.codigo" ng-label="LABEL.TIPO_ALTERACAO" list="tiposAlteracaoValor" ng-model="aditivo.tipoAlteracaoValor.codigo" |
120 | - ng-obrigatorio="aditivo.aditivoDeValor" text="descricao" value="codigo" form="formDialogAditivo" ng-disabled="!edit || aditivo.id"> | 120 | + ng-obrigatorio="aditivo.aditivoDeValor" text="descricao" value="codigo" form="formDialogAditivo" ng-disabled="!edit"> |
121 | </label-input-radio> | 121 | </label-input-radio> |
122 | </div> | 122 | </div> |
123 | </div> | 123 | </div> |
124 | <div class="row"> | 124 | <div class="row"> |
125 | <div class="col-sm-4"> | 125 | <div class="col-sm-4"> |
126 | <label-select ng-label="CONTRATOS.LABEL.TIPO_OBJETO" ng-id="aditivo.tipoObjeto" ng-model="aditivo.tipoObjeto" form="formDialogAditivo" ng-list="tiposObjeto" | 126 | <label-select ng-label="CONTRATOS.LABEL.TIPO_OBJETO" ng-id="aditivo.tipoObjeto" ng-model="aditivo.tipoObjeto" form="formDialogAditivo" ng-list="tiposObjeto" |
127 | - ng-custom-options="item.originalElement as item.descricao for item" track-by="track by item.id" ng-disabled="!edit || aditivo.id" ng-obrigatorio="true"> | 127 | + ng-custom-options="item.originalElement as item.descricao for item" track-by="track by item.id" ng-disabled="!edit" ng-obrigatorio="true"> |
128 | </label-select> | 128 | </label-select> |
129 | </div> | 129 | </div> |
130 | <div class="col-sm-3"> | 130 | <div class="col-sm-3"> |
cit-contratos-web/src/main/webapp/html/eventos/cnt_ev_recebimentoobjeto.html
@@ -79,6 +79,18 @@ | @@ -79,6 +79,18 @@ | ||
79 | ng-mask="99999/9999" | 79 | ng-mask="99999/9999" |
80 | form="formDialogRecebimentoObjeto"/> | 80 | form="formDialogRecebimentoObjeto"/> |
81 | </div><!-- .col --> | 81 | </div><!-- .col --> |
82 | + <div class="col-sm-9"> | ||
83 | + <label-input ng-type="text" | ||
84 | + ng-id="contrato.objetoContratacao" | ||
85 | + ng-label="LABEL.OBJETO_CONTRATACAO" | ||
86 | + ng-disabled="true" | ||
87 | + ng-custom-maxlength="150" | ||
88 | + ng-model="contrato.objetoContratacao" | ||
89 | + form="formDialogRecebimentoObjeto"/> | ||
90 | + </div><!-- .col --> | ||
91 | + </div><!-- .row --> | ||
92 | + | ||
93 | + <div class="row"> | ||
82 | <div class="col-sm-3"> | 94 | <div class="col-sm-3"> |
83 | <label-input-data ng-id="recebimentoObjeto.dataRecebimento" | 95 | <label-input-data ng-id="recebimentoObjeto.dataRecebimento" |
84 | ng-label="LABEL.DATA_RECEBIMENTO_OBJETO" | 96 | ng-label="LABEL.DATA_RECEBIMENTO_OBJETO" |
@@ -102,18 +114,18 @@ | @@ -102,18 +114,18 @@ | ||
102 | </select> | 114 | </select> |
103 | </div><!--.col --> | 115 | </div><!--.col --> |
104 | <div class="col-sm-3"> | 116 | <div class="col-sm-3"> |
105 | - <label-input ng-type="text" | ||
106 | - ng-id="recebimentoObjeto.nomeObjeto" | ||
107 | - ng-label="LABEL.NOME_OBJETO" | ||
108 | - ng-disabled="!edit" | ||
109 | - ng-custom-maxlength="150" | ||
110 | - ng-obrigatorio="true" | ||
111 | - ng-model="recebimentoObjeto.nomeObjeto" | ||
112 | - form="formDialogRecebimentoObjeto"/> | ||
113 | - </div><!-- .col --> | ||
114 | - </div><!-- .row --> | ||
115 | - | ||
116 | - <div class="row"> | 117 | + <label-select ng-id="recebimentoObjeto.tiposStatus" |
118 | + ng-label="LABEL.STATUS" | ||
119 | + ng-model="recebimentoObjeto.tipoStatus" | ||
120 | + form="formDialogRecebimentoObjeto" | ||
121 | + ng-obrigatorio="true" | ||
122 | + ng-disabled="!edit" | ||
123 | + ng-list="dominiosRecebimentoObjeto.tiposStatus" | ||
124 | + ng-custom-options="tipoStatus as tipoStatus.descricao for tipoStatus" | ||
125 | + track-by="track by tipoStatus.id"/> | ||
126 | + <option value="">Selecione</option> | ||
127 | + </select> | ||
128 | + </div><!-- .col --> | ||
117 | <div class="col-sm-3"> | 129 | <div class="col-sm-3"> |
118 | <div class="row"> | 130 | <div class="row"> |
119 | <div class="col-sm-12"> | 131 | <div class="col-sm-12"> |
@@ -150,20 +162,7 @@ | @@ -150,20 +162,7 @@ | ||
150 | </select> | 162 | </select> |
151 | </div> | 163 | </div> |
152 | </div> | 164 | </div> |
153 | - </div> | ||
154 | - <div class="col-sm-3"> | ||
155 | - <label-select ng-id="recebimentoObjeto.tiposStatus" | ||
156 | - ng-label="LABEL.STATUS" | ||
157 | - ng-model="recebimentoObjeto.tipoStatus" | ||
158 | - form="formDialogRecebimentoObjeto" | ||
159 | - ng-obrigatorio="true" | ||
160 | - ng-disabled="!edit" | ||
161 | - ng-list="dominiosRecebimentoObjeto.tiposStatus" | ||
162 | - ng-custom-options="tipoStatus as tipoStatus.descricao for tipoStatus" | ||
163 | - track-by="track by tipoStatus.id"/> | ||
164 | - <option value="">Selecione</option> | ||
165 | - </select> | ||
166 | - </div><!-- .col --> | 165 | + </div> |
167 | </div><!-- .row --> | 166 | </div><!-- .row --> |
168 | 167 | ||
169 | <div class="row"> | 168 | <div class="row"> |