Commit ad86a75b4ad131aaf43078d3e2fafc2a5240b540
1 parent
2b0dc333
Exists in
master
#268 Pesquisar Documentos e Processos
Showing
33 changed files
with
644 additions
and
78 deletions
Show diff stats
cit-ecm-api/src/main/java/br/com/centralit/api/dao/UnidadeProcessoDao.java
... | ... | @@ -149,4 +149,23 @@ public interface UnidadeProcessoDao extends CitGenericDAO { |
149 | 149 | */ |
150 | 150 | Boolean isProcessoEnviado(Long idProcesso); |
151 | 151 | |
152 | + /** | |
153 | + * <p> | |
154 | + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a> | |
155 | + * </p> | |
156 | + * | |
157 | + * <p> | |
158 | + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> | |
159 | + * </p> | |
160 | + * | |
161 | + * Método responsável por verificar se o processo pertence a unidade | |
162 | + * | |
163 | + * @author rogerio.costa | |
164 | + * | |
165 | + * @param idProcesso | |
166 | + * @param idUnidade | |
167 | + * @return boolean | |
168 | + */ | |
169 | + boolean isProcessoNaUnidadeUsuarioLogado(Long idProcesso, Long idUnidade); | |
170 | + | |
152 | 171 | } | ... | ... |
cit-ecm-api/src/main/java/br/com/centralit/api/dao/impl/UnidadeProcessoDaoHibernate.java
... | ... | @@ -321,4 +321,35 @@ public class UnidadeProcessoDaoHibernate extends CitGenericDAOImpl implements Un |
321 | 321 | |
322 | 322 | return detachedCriteriaPrivilegio; |
323 | 323 | } |
324 | + | |
325 | + /** | |
326 | + * <p> | |
327 | + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a> | |
328 | + * </p> | |
329 | + * | |
330 | + * <p> | |
331 | + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> | |
332 | + * </p> | |
333 | + * | |
334 | + * Método responsável por verificar se o processo pertence a unidade | |
335 | + * | |
336 | + * @author rogerio.costa | |
337 | + * | |
338 | + * @param idProcesso | |
339 | + * @param idUnidade | |
340 | + * @return boolean | |
341 | + */ | |
342 | + public boolean isProcessoNaUnidadeUsuarioLogado(Long idProcesso, Long idUnidade) { | |
343 | + | |
344 | + Criteria criteria = this.newCriteria(); | |
345 | + | |
346 | + criteria.setProjection(Projections.id()); | |
347 | + criteria.add(Restrictions.eq("processo.id", idProcesso)); | |
348 | + criteria.add(Restrictions.eq("unidade.id", idUnidade)); | |
349 | + criteria.add(Restrictions.isNull("dataInativo")); | |
350 | + criteria.setMaxResults(1); | |
351 | + | |
352 | + return UtilObjeto.isReferencia(criteria.uniqueResult()); | |
353 | + | |
354 | + } | |
324 | 355 | } | ... | ... |
cit-ecm-api/src/main/java/br/com/centralit/api/model/AnexoGed.java
... | ... | @@ -94,7 +94,7 @@ public class AnexoGed extends PersistentObjectUnidade implements DocumentoGedInt |
94 | 94 | |
95 | 95 | /** Atributo dominioTipoAnexo. */ |
96 | 96 | @ManyToOne(fetch = FetchType.EAGER, optional = true) |
97 | - @JsonView({ ViewsEcm.DocumentoGedEdit.class, Views.ProcessoEdit.class }) | |
97 | + @JsonView({ ViewsEcm.DocumentoGedEdit.class, Views.ProcessoEdit.class, Views.processoVHview.class}) | |
98 | 98 | private Dominio dominioTipoAnexo; |
99 | 99 | |
100 | 100 | /** Atributo MultipartFile. */ | ... | ... |
cit-ecm-api/src/main/java/br/com/centralit/api/model/DocumentoGed.java
... | ... | @@ -79,11 +79,11 @@ public class DocumentoGed extends PersistentObjectUnidade implements Cloneable { |
79 | 79 | private Long id; |
80 | 80 | |
81 | 81 | /** Atributo assuntoComplementar. */ |
82 | - @JsonView({ ViewsEcm.DocumentoGedEdit.class, Views.ProcessoEdit.class, ViewsEcm.ClassificacaoDocumentoGedView.class }) | |
82 | + @JsonView({ ViewsEcm.DocumentoGedEdit.class, Views.ProcessoEdit.class, ViewsEcm.ClassificacaoDocumentoGedView.class, Views.processoVHview.class}) | |
83 | 83 | private String assuntoComplementar; |
84 | 84 | |
85 | 85 | /** Atributo numero. */ |
86 | - @JsonView({ ViewsEcm.DocumentoGedEdit.class, Views.ProcessoEdit.class, ViewsEcm.ClassificacaoDocumentoGedView.class }) | |
86 | + @JsonView({ ViewsEcm.DocumentoGedEdit.class, Views.ProcessoEdit.class, ViewsEcm.ClassificacaoDocumentoGedView.class, Views.processoVHview.class}) | |
87 | 87 | private String numero; |
88 | 88 | |
89 | 89 | /** Atributo idRaiz. */ |
... | ... | @@ -95,23 +95,23 @@ public class DocumentoGed extends PersistentObjectUnidade implements Cloneable { |
95 | 95 | private Boolean novaVersao; |
96 | 96 | |
97 | 97 | /** Atributo versaoDocumento. */ |
98 | - @JsonView({ Views.DocumentoGedEdit.class, Views.ProcessoEdit.class }) | |
98 | + @JsonView({ Views.DocumentoGedEdit.class, Views.ProcessoEdit.class, Views.processoVHview.class}) | |
99 | 99 | private Double versaoDocumento; |
100 | 100 | |
101 | 101 | /** Atributo cancelado. */ |
102 | - @JsonView({ Views.ProcessoEdit.class }) | |
102 | + @JsonView({ Views.ProcessoEdit.class, Views.processoVHview.class}) | |
103 | 103 | private Boolean cancelado; |
104 | 104 | |
105 | 105 | @JsonView({ Views.DocumentoGedEdit.class }) |
106 | 106 | private String localizacao; |
107 | 107 | |
108 | 108 | /** Atributo conteudo. */ |
109 | - @JsonView({ ViewsEcm.DocumentoGedEdit.class }) | |
109 | + @JsonView({ ViewsEcm.DocumentoGedEdit.class, Views.processoVHview.class}) | |
110 | 110 | @Transient |
111 | 111 | private String conteudo; |
112 | 112 | |
113 | 113 | /** Atributo tipoAssunto. */ |
114 | - @JsonView({ Views.DocumentoGedEdit.class }) | |
114 | + @JsonView({ Views.DocumentoGedEdit.class, Views.processoVHview.class }) | |
115 | 115 | private String tipoAssunto; |
116 | 116 | |
117 | 117 | /** Atributo conteudoCriptografado. */ |
... | ... | @@ -121,7 +121,7 @@ public class DocumentoGed extends PersistentObjectUnidade implements Cloneable { |
121 | 121 | private byte[] conteudoCriptografado; |
122 | 122 | |
123 | 123 | /** Atributo icon. */ |
124 | - @JsonView({ ViewsEcm.DocumentoGedEdit.class, Views.ProcessoEdit.class, ViewsEcm.ClassificacaoDocumentoGedView.class }) | |
124 | + @JsonView({ ViewsEcm.DocumentoGedEdit.class, Views.ProcessoEdit.class, ViewsEcm.ClassificacaoDocumentoGedView.class, Views.processoVHview.class}) | |
125 | 125 | private String icon; |
126 | 126 | |
127 | 127 | @Temporal(TemporalType.TIMESTAMP) |
... | ... | @@ -143,7 +143,7 @@ public class DocumentoGed extends PersistentObjectUnidade implements Cloneable { |
143 | 143 | |
144 | 144 | /** Atributo formaCriacao. */ |
145 | 145 | @ManyToOne(fetch = FetchType.LAZY) |
146 | - @JsonView({ ViewsEcm.DocumentoGedEdit.class, Views.ProcessoEdit.class }) | |
146 | + @JsonView({ ViewsEcm.DocumentoGedEdit.class, Views.ProcessoEdit.class, Views.processoVHview.class}) | |
147 | 147 | private Dominio formaCriacao; |
148 | 148 | |
149 | 149 | /** Atributo status. */ |
... | ... | @@ -177,12 +177,12 @@ public class DocumentoGed extends PersistentObjectUnidade implements Cloneable { |
177 | 177 | |
178 | 178 | /** Atributo tipoDocumento. */ |
179 | 179 | @ManyToOne(fetch = FetchType.LAZY) |
180 | - @JsonView({ ViewsEcm.DocumentoGedEdit.class, Views.ProcessoEdit.class }) | |
180 | + @JsonView({ ViewsEcm.DocumentoGedEdit.class, Views.ProcessoEdit.class, Views.processoVHview.class}) | |
181 | 181 | private TipoDocumento tipoDocumento; |
182 | 182 | |
183 | 183 | /** Atributo nivelAcesso. */ |
184 | 184 | @ManyToOne(fetch = FetchType.EAGER) |
185 | - @JsonView({ ViewsEcm.DocumentoGedEdit.class, Views.ProcessoEdit.class, ViewsEcm.ClassificacaoDocumentoGedView.class }) | |
185 | + @JsonView({ ViewsEcm.DocumentoGedEdit.class, Views.ProcessoEdit.class, ViewsEcm.ClassificacaoDocumentoGedView.class, Views.processoVHview.class }) | |
186 | 186 | private NivelAcessoTipoDocumento nivelAcesso; |
187 | 187 | |
188 | 188 | @ManyToOne(fetch = FetchType.EAGER) |
... | ... | @@ -191,7 +191,7 @@ public class DocumentoGed extends PersistentObjectUnidade implements Cloneable { |
191 | 191 | |
192 | 192 | /** Atributo sigilo. */ |
193 | 193 | @ManyToOne(fetch = FetchType.LAZY) |
194 | - @JsonView({ ViewsEcm.DocumentoGedEdit.class, Views.ProcessoEdit.class, ViewsEcm.ClassificacaoDocumentoGedView.class }) | |
194 | + @JsonView({ ViewsEcm.DocumentoGedEdit.class, Views.ProcessoEdit.class, ViewsEcm.ClassificacaoDocumentoGedView.class, Views.processoVHview.class}) | |
195 | 195 | private Sigilo sigilo; |
196 | 196 | |
197 | 197 | @ManyToOne(fetch = FetchType.LAZY) |
... | ... | @@ -220,7 +220,7 @@ public class DocumentoGed extends PersistentObjectUnidade implements Cloneable { |
220 | 220 | |
221 | 221 | /** Atributo anexo. */ |
222 | 222 | @OneToOne(mappedBy = "documentoGed", fetch = FetchType.EAGER) |
223 | - @JsonView({ ViewsEcm.DocumentoGedEdit.class, Views.ProcessoEdit.class, ViewsEcm.ClassificacaoDocumentoGedView.class }) | |
223 | + @JsonView({ ViewsEcm.DocumentoGedEdit.class, Views.ProcessoEdit.class, ViewsEcm.ClassificacaoDocumentoGedView.class, Views.processoVHview.class}) | |
224 | 224 | private AnexoGed anexo; |
225 | 225 | |
226 | 226 | /** Atributo versaoAnterior. */ | ... | ... |
cit-ecm-api/src/main/java/br/com/centralit/api/model/HipoteseLegal.java
... | ... | @@ -69,7 +69,8 @@ public class HipoteseLegal extends PersistentObjectAudit { |
69 | 69 | private String descricao; |
70 | 70 | |
71 | 71 | /** Atributo nome. */ |
72 | - @JsonView({ ViewsEcm.HipoteseLegalList.class, ViewsEcm.TipoProcessoList.class, ViewsEcm.TipoDocumentoEdit.class, ViewsEcm.NivelAcessoTipoDocumentoEdit.class, ViewsEcm.DocumentoGedEdit.class, ViewsEcm.ProcessoEdit.class, ViewsEcm.NivelAcessoTipoProcessoEdit.class }) | |
72 | + @JsonView({ ViewsEcm.HipoteseLegalList.class, ViewsEcm.TipoProcessoList.class, ViewsEcm.TipoDocumentoEdit.class, ViewsEcm.NivelAcessoTipoDocumentoEdit.class, ViewsEcm.DocumentoGedEdit.class, ViewsEcm.ProcessoEdit.class, ViewsEcm.NivelAcessoTipoProcessoEdit.class, | |
73 | + Views.processoVHview.class}) | |
73 | 74 | private String nome; |
74 | 75 | |
75 | 76 | /** Atributo fundamentacaoLegal. */ | ... | ... |
cit-ecm-api/src/main/java/br/com/centralit/api/model/InteressadoProcesso.java
... | ... | @@ -63,7 +63,7 @@ public class InteressadoProcesso extends PersistentObjectAudit { |
63 | 63 | |
64 | 64 | /** Atributo interessado. */ |
65 | 65 | @ManyToOne(fetch = FetchType.LAZY) |
66 | - @JsonView({ ViewsEcm.ProcessoEdit.class }) | |
66 | + @JsonView({ ViewsEcm.ProcessoEdit.class, Views.processoVHview.class}) | |
67 | 67 | private Pessoa interessado; |
68 | 68 | |
69 | 69 | /** | ... | ... |
cit-ecm-api/src/main/java/br/com/centralit/api/model/NivelAcessoTipoDocumento.java
... | ... | @@ -64,7 +64,7 @@ public class NivelAcessoTipoDocumento extends PersistentObjectAudit { |
64 | 64 | |
65 | 65 | /** Atributo tipoAcesso. */ |
66 | 66 | @ManyToOne(fetch = FetchType.LAZY) |
67 | - @JsonView({ ViewsEcm.TipoDocumentoEdit.class, ViewsEcm.NivelAcessoTipoDocumentoEdit.class, ViewsEcm.DocumentoGedEdit.class, Views.ProcessoEdit.class }) | |
67 | + @JsonView({ ViewsEcm.TipoDocumentoEdit.class, ViewsEcm.NivelAcessoTipoDocumentoEdit.class, ViewsEcm.DocumentoGedEdit.class, Views.ProcessoEdit.class, Views.processoVHview.class }) | |
68 | 68 | private Dominio nivelAcesso; |
69 | 69 | |
70 | 70 | /** Atributo tipoDocumento. */ | ... | ... |
cit-ecm-api/src/main/java/br/com/centralit/api/model/NivelAcessoTipoProcesso.java
... | ... | @@ -72,7 +72,7 @@ public class NivelAcessoTipoProcesso extends PersistentObjectAudit { |
72 | 72 | |
73 | 73 | /** Atributo tipoAcesso. */ |
74 | 74 | @ManyToOne(fetch = FetchType.LAZY) |
75 | - @JsonView({ ViewsEcm.TipoProcessoEdit.class, ViewsEcm.NivelAcessoTipoProcessoEdit.class, Views.ProcessoList.class, Views.UnidadeProcessoListView.class }) | |
75 | + @JsonView({ ViewsEcm.TipoProcessoEdit.class, ViewsEcm.NivelAcessoTipoProcessoEdit.class, Views.ProcessoList.class, Views.UnidadeProcessoListView.class, Views.processoVHview.class}) | |
76 | 76 | private Dominio nivelAcesso; |
77 | 77 | |
78 | 78 | @OneToMany(fetch = FetchType.LAZY, mappedBy = "nivelAcessoTipoProcesso", cascade = CascadeType.ALL) | ... | ... |
cit-ecm-api/src/main/java/br/com/centralit/api/model/PlanoClassificacao.java
... | ... | @@ -77,7 +77,8 @@ public class PlanoClassificacao extends PersistentObjectAuditOrganizacao impleme |
77 | 77 | private String codigo; |
78 | 78 | |
79 | 79 | /** Atributo nome. */ |
80 | - @JsonView({ ViewsEcm.PlanoClassificacaoListView.class, ViewsEcm.PlanoClassificacaoParent.class, ViewsEcm.PlanoClassificacaoAutocompleteRecursive.class, ViewsEcm.PlanoCLassificacaoAutoComplete.class, ViewsEcm.TipoDocumentoEdit.class, ViewsEcm.PlanoCLassificacaoAutoComplete.class, ViewsEcm.TipoProcessoEdit.class, ViewsEcm.DocumentoGedEdit.class, ViewsEcm.ProcessoEdit.class }) | |
80 | + @JsonView({ ViewsEcm.PlanoClassificacaoListView.class, ViewsEcm.PlanoClassificacaoParent.class, ViewsEcm.PlanoClassificacaoAutocompleteRecursive.class, ViewsEcm.PlanoCLassificacaoAutoComplete.class, ViewsEcm.TipoDocumentoEdit.class, ViewsEcm.PlanoCLassificacaoAutoComplete.class, ViewsEcm.TipoProcessoEdit.class, ViewsEcm.DocumentoGedEdit.class, ViewsEcm.ProcessoEdit.class, | |
81 | + Views.processoVHview.class}) | |
81 | 82 | private String nome; |
82 | 83 | |
83 | 84 | /** Atributo observacao. */ |
... | ... | @@ -100,7 +101,8 @@ public class PlanoClassificacao extends PersistentObjectAuditOrganizacao impleme |
100 | 101 | private Boolean permitirUsarComoClassificacao; |
101 | 102 | |
102 | 103 | @Transient |
103 | - @JsonView({ ViewsEcm.PlanoCLassificacaoAutoComplete.class, ViewsEcm.TipoDocumentoEdit.class, ViewsEcm.TipoProcessoEdit.class, Views.ProcessoList.class, Views.DocumentoGedEdit.class, ViewsEcm.TipoDocumentoPlanoClassificacaoAutoCompleteView.class, Views.UnidadeProcessoListView.class }) | |
104 | + @JsonView({ ViewsEcm.PlanoCLassificacaoAutoComplete.class, ViewsEcm.TipoDocumentoEdit.class, ViewsEcm.TipoProcessoEdit.class, Views.ProcessoList.class, Views.DocumentoGedEdit.class, ViewsEcm.TipoDocumentoPlanoClassificacaoAutoCompleteView.class, Views.UnidadeProcessoListView.class, | |
105 | + Views.processoVHview.class}) | |
104 | 106 | private String assunto; |
105 | 107 | |
106 | 108 | /** Atributo tipoDestinacao. */ | ... | ... |
cit-ecm-api/src/main/java/br/com/centralit/api/model/Processo.java
... | ... | @@ -80,11 +80,11 @@ public class Processo extends PersistentObjectUnidade { |
80 | 80 | /** Atributo id. */ |
81 | 81 | @Id |
82 | 82 | @GeneratedValue(strategy = GenerationType.AUTO) |
83 | - @JsonView({ Views.GenericView.class, Views.UnidadeProcessoListView.class }) | |
83 | + @JsonView({ Views.GenericView.class }) | |
84 | 84 | private Long id; |
85 | 85 | |
86 | 86 | /** Atributo assuntoComplementar. */ |
87 | - @JsonView({ Views.ProcessoList.class, Views.UnidadeProcessoListView.class }) | |
87 | + @JsonView({ Views.ProcessoList.class, Views.UnidadeProcessoListView.class, Views.processoVHview.class }) | |
88 | 88 | private String assuntoComplementar; |
89 | 89 | |
90 | 90 | /** Atributo dataReferencia. */ |
... | ... | @@ -101,7 +101,7 @@ public class Processo extends PersistentObjectUnidade { |
101 | 101 | private Calendar dataConclusao; |
102 | 102 | |
103 | 103 | /** Atributo nup. */ |
104 | - @JsonView({ Views.ProcessoList.class, Views.ProcessoRelacionadoList.class, Views.AnexarProcesso.class, Views.ProcessoAutoCompleteView.class, Views.UnidadeProcessoListView.class }) | |
104 | + @JsonView({ Views.ProcessoList.class, Views.ProcessoRelacionadoList.class, Views.AnexarProcesso.class, Views.ProcessoAutoCompleteView.class, Views.UnidadeProcessoListView.class, Views.processoVHview.class }) | |
105 | 105 | private String nup; |
106 | 106 | |
107 | 107 | /** Atributo nome. */ |
... | ... | @@ -112,14 +112,14 @@ public class Processo extends PersistentObjectUnidade { |
112 | 112 | private Long idTask; |
113 | 113 | |
114 | 114 | /** Atributo observacaoGeral. */ |
115 | - @JsonView({ Views.ProcessoEdit.class }) | |
115 | + @JsonView({ Views.ProcessoEdit.class, Views.processoVHview.class }) | |
116 | 116 | private String observacaoGeral; |
117 | 117 | |
118 | 118 | @JsonView({ Views.ProcessoEdit.class }) |
119 | 119 | private String tipoAssunto; |
120 | 120 | |
121 | 121 | /** Atributo idProcessInstance. */ |
122 | - @JsonView({ Views.ProcessoList.class, Views.UnidadeProcessoListView.class }) | |
122 | + @JsonView({ Views.ProcessoList.class, Views.UnidadeProcessoListView.class, Views.processoVHview.class }) | |
123 | 123 | private Long idProcessInstance; |
124 | 124 | |
125 | 125 | /** Atributo aprovado. */ |
... | ... | @@ -140,7 +140,7 @@ public class Processo extends PersistentObjectUnidade { |
140 | 140 | |
141 | 141 | /** Atributo status. */ |
142 | 142 | @ManyToOne(fetch = FetchType.LAZY) |
143 | - @JsonView({ Views.ProcessoEdit.class, Views.UnidadeProcessoListView.class }) | |
143 | + @JsonView({ Views.ProcessoEdit.class, Views.UnidadeProcessoListView.class, Views.processoVHview.class }) | |
144 | 144 | private Dominio status; |
145 | 145 | |
146 | 146 | /** Atributo tramitarDocumento. */ |
... | ... | @@ -149,18 +149,18 @@ public class Processo extends PersistentObjectUnidade { |
149 | 149 | private TramitarDocumento tramitarDocumento; |
150 | 150 | |
151 | 151 | /** Atributo tipoProcesso. */ |
152 | - @JsonView({ Views.ProcessoList.class, Views.ProcessoRelacionadoList.class, Views.AnexarProcesso.class, Views.UnidadeProcessoListView.class }) | |
152 | + @JsonView({ Views.ProcessoList.class, Views.ProcessoRelacionadoList.class, Views.AnexarProcesso.class, Views.UnidadeProcessoListView.class, Views.processoVHview.class }) | |
153 | 153 | @ManyToOne(fetch = FetchType.LAZY) |
154 | 154 | private TipoProcesso tipoProcesso; |
155 | 155 | |
156 | 156 | /** Atributo assunto. */ |
157 | 157 | @ManyToOne(fetch = FetchType.LAZY) |
158 | - @JsonView({ Views.ProcessoList.class, Views.UnidadeProcessoListView.class }) | |
158 | + @JsonView({ Views.ProcessoList.class, Views.UnidadeProcessoListView.class, Views.processoVHview.class }) | |
159 | 159 | private PlanoClassificacao assunto; |
160 | 160 | |
161 | 161 | /** Atributo nivelAcesso. */ |
162 | 162 | @ManyToOne(fetch = FetchType.LAZY) |
163 | - @JsonView({ Views.ProcessoList.class, Views.UnidadeProcessoListView.class }) | |
163 | + @JsonView({ Views.ProcessoList.class, Views.UnidadeProcessoListView.class, Views.processoVHview.class }) | |
164 | 164 | private NivelAcessoTipoProcesso nivelAcesso; |
165 | 165 | |
166 | 166 | @ManyToOne(fetch = FetchType.LAZY) |
... | ... | @@ -174,7 +174,7 @@ public class Processo extends PersistentObjectUnidade { |
174 | 174 | |
175 | 175 | /** Atributo hipoteseLegal. */ |
176 | 176 | @ManyToOne(fetch = FetchType.LAZY) |
177 | - @JsonView({ Views.ProcessoEdit.class }) | |
177 | + @JsonView({ Views.ProcessoEdit.class, Views.processoVHview.class }) | |
178 | 178 | private HipoteseLegal hipoteseLegal; |
179 | 179 | |
180 | 180 | /** Atributo cienciaProcesso. */ |
... | ... | @@ -199,12 +199,12 @@ public class Processo extends PersistentObjectUnidade { |
199 | 199 | |
200 | 200 | /** Atributo Interessados. */ |
201 | 201 | @OneToMany(fetch = FetchType.LAZY, mappedBy = "processo", cascade = CascadeType.ALL, orphanRemoval = true) |
202 | - @JsonView({ Views.ProcessoEdit.class }) | |
202 | + @JsonView({ Views.ProcessoEdit.class, Views.processoVHview.class }) | |
203 | 203 | private Collection<InteressadoProcesso> interessados; |
204 | 204 | |
205 | 205 | /** Atributo documentos. */ |
206 | 206 | @OneToMany(fetch = FetchType.LAZY, mappedBy = "processo", cascade = CascadeType.ALL) |
207 | - @JsonView({ Views.ProcessoEdit.class }) | |
207 | + @JsonView({ Views.ProcessoEdit.class, Views.processoVHview.class}) | |
208 | 208 | private Collection<DocumentoGed> documentos; |
209 | 209 | |
210 | 210 | /** Atributo relacionados. */ |
... | ... | @@ -226,6 +226,7 @@ public class Processo extends PersistentObjectUnidade { |
226 | 226 | private Collection<CredencialProcesso> credenciais; |
227 | 227 | |
228 | 228 | /** Atributo unidadesProcesso. */ |
229 | + @JsonView({ Views.processoVHview.class }) | |
229 | 230 | @OneToMany(fetch = FetchType.LAZY, mappedBy = "processo", cascade = CascadeType.ALL) |
230 | 231 | private Collection<UnidadeProcesso> unidadesProcesso; |
231 | 232 | ... | ... |
cit-ecm-api/src/main/java/br/com/centralit/api/model/TipoDocumento.java
... | ... | @@ -67,7 +67,7 @@ public class TipoDocumento extends PersistentObjectAudit { |
67 | 67 | private String descricao; |
68 | 68 | |
69 | 69 | /** Atributo nome. */ |
70 | - @JsonView({ ViewsEcm.TipoDocumentoList.class, ViewsEcm.DocumentoGedEdit.class, Views.ProcessoEdit.class }) | |
70 | + @JsonView({ ViewsEcm.TipoDocumentoList.class, ViewsEcm.DocumentoGedEdit.class, Views.ProcessoEdit.class, Views.processoVHview.class }) | |
71 | 71 | private String nome; |
72 | 72 | |
73 | 73 | /** Atributo formaCriacao. */ | ... | ... |
cit-ecm-api/src/main/java/br/com/centralit/api/model/TipoProcesso.java
... | ... | @@ -63,11 +63,11 @@ public class TipoProcesso extends PersistentObjectUnidade { |
63 | 63 | private Long id; |
64 | 64 | |
65 | 65 | /** Atributo descricao. */ |
66 | - @JsonView({ ViewsEcm.TipoProcessoList.class, Views.UnidadeProcessoListView.class }) | |
66 | + @JsonView({ ViewsEcm.TipoProcessoList.class, Views.UnidadeProcessoListView.class}) | |
67 | 67 | private String descricao; |
68 | 68 | |
69 | 69 | /** Atributo nome. */ |
70 | - @JsonView({ ViewsEcm.TipoProcessoList.class, Views.ProcessoList.class, Views.ProcessoRelacionadoList.class }) | |
70 | + @JsonView({ ViewsEcm.TipoProcessoList.class, Views.ProcessoList.class, Views.ProcessoRelacionadoList.class, Views.processoVHview.class}) | |
71 | 71 | private String nome; |
72 | 72 | |
73 | 73 | /** Atributo nome. */ | ... | ... |
cit-ecm-api/src/main/java/br/com/centralit/api/model/UnidadeProcesso.java
... | ... | @@ -77,12 +77,12 @@ public class UnidadeProcesso extends PersistentObjectAudit { |
77 | 77 | |
78 | 78 | /** Atributo grupo. */ |
79 | 79 | @ManyToOne(fetch = FetchType.LAZY) |
80 | - @JsonView({ Views.EnviarProcessoView.class}) | |
80 | + @JsonView({ Views.EnviarProcessoView.class, Views.processoVHview.class}) | |
81 | 81 | private Unidade unidade; |
82 | 82 | |
83 | 83 | /** Atributo usuarioResponsavel. */ |
84 | 84 | @ManyToOne(fetch = FetchType.LAZY) |
85 | - @JsonView({ Views.EnviarProcessoView.class, Views.UnidadeProcessoListView.class }) | |
85 | + @JsonView({ Views.EnviarProcessoView.class, Views.UnidadeProcessoListView.class, Views.processoVHview.class}) | |
86 | 86 | private Usuario usuarioResponsavel; |
87 | 87 | |
88 | 88 | /** | ... | ... |
cit-ecm-api/src/main/java/br/com/centralit/api/security/CustomWebSecurityExpresssionRoot.java
... | ... | @@ -100,5 +100,27 @@ public class CustomWebSecurityExpresssionRoot extends WebSecurityExpressionRoot |
100 | 100 | |
101 | 101 | return this.credencialProcessoService.permiteRenunciar(idProcesso); |
102 | 102 | } |
103 | + | |
104 | + /** | |
105 | + * <p> | |
106 | + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a> | |
107 | + * </p> | |
108 | + * | |
109 | + * <p> | |
110 | + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> | |
111 | + * </p> | |
112 | + * | |
113 | + * Método responsável por verificar se o usuario tem permissão para executar o processo | |
114 | + * | |
115 | + * @author rogerio.costa | |
116 | + * | |
117 | + * @return boolean | |
118 | + */ | |
119 | + public boolean permiteExecutar() { | |
120 | + | |
121 | + Long idProcesso = (Long) this.request.getSession().getAttribute("idProcesso"); | |
122 | + | |
123 | + return this.credencialProcessoService.permiteExecutar(idProcesso); | |
124 | + } | |
103 | 125 | |
104 | 126 | } | ... | ... |
cit-ecm-api/src/main/java/br/com/centralit/api/service/CredencialProcessoService.java
... | ... | @@ -221,4 +221,40 @@ public interface CredencialProcessoService extends GenericService<CredencialProc |
221 | 221 | */ |
222 | 222 | Collection<Grupo> findGrupoPorSigilo(Sigilo sigilo); |
223 | 223 | |
224 | + /** | |
225 | + * <p> | |
226 | + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a> | |
227 | + * </p> | |
228 | + * | |
229 | + * <p> | |
230 | + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> | |
231 | + * </p> | |
232 | + * | |
233 | + * Método responsável por validar acesso para o processo | |
234 | + * | |
235 | + * @author rogerio.costa | |
236 | + * | |
237 | + * @param idProcessInstance | |
238 | + */ | |
239 | + void validarAcessoPesquisa(Long idProcessInstance); | |
240 | + | |
241 | + /** | |
242 | + * <p> | |
243 | + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a> | |
244 | + * </p> | |
245 | + * | |
246 | + * <p> | |
247 | + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> | |
248 | + * </p> | |
249 | + * | |
250 | + * Método responsável por verificar se o usuario tem permissão para executar o processo | |
251 | + * | |
252 | + * @author rogerio.costa | |
253 | + * | |
254 | + * @param idProcesso | |
255 | + * | |
256 | + * @return Boolean | |
257 | + */ | |
258 | + Boolean permiteExecutar(Long idProcesso); | |
259 | + | |
224 | 260 | } | ... | ... |
cit-ecm-api/src/main/java/br/com/centralit/api/service/ProcessoService.java
... | ... | @@ -2,6 +2,7 @@ package br.com.centralit.api.service; |
2 | 2 | |
3 | 3 | import br.com.centralit.api.model.PlanoClassificacao; |
4 | 4 | import br.com.centralit.api.model.Processo; |
5 | +import br.com.centralit.api.viewHelper.ProcessoVH; | |
5 | 6 | import br.com.centralit.framework.service.arquitetura.GenericService; |
6 | 7 | |
7 | 8 | import com.googlecode.genericdao.search.ISearch; |
... | ... | @@ -222,4 +223,22 @@ public interface ProcessoService extends GenericService<Processo, Long> { |
222 | 223 | */ |
223 | 224 | <RT> SearchResult<RT> searchAndCountPorSigilo(ISearch search); |
224 | 225 | |
226 | + /** | |
227 | + * <p> | |
228 | + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a> | |
229 | + * </p> | |
230 | + * | |
231 | + * <p> | |
232 | + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> | |
233 | + * </p> | |
234 | + * | |
235 | + * Método responsável por obter o processo. | |
236 | + * | |
237 | + * @author rogerio.costa | |
238 | + * | |
239 | + * @param id | |
240 | + * @return | |
241 | + */ | |
242 | + ProcessoVH getProcessoView(Long id); | |
243 | + | |
225 | 244 | } | ... | ... |
cit-ecm-api/src/main/java/br/com/centralit/api/service/UnidadeProcessoService.java
... | ... | @@ -200,4 +200,23 @@ public interface UnidadeProcessoService extends GenericService<UnidadeProcesso, |
200 | 200 | */ |
201 | 201 | Boolean isProcessoEnviado(Long idProcesso); |
202 | 202 | |
203 | + /** | |
204 | + * <p> | |
205 | + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a> | |
206 | + * </p> | |
207 | + * | |
208 | + * <p> | |
209 | + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> | |
210 | + * </p> | |
211 | + * | |
212 | + * Método responsável por verificar se o processo pertence a unidade | |
213 | + * | |
214 | + * @author rogerio.costa | |
215 | + * | |
216 | + * @param idProcesso | |
217 | + * @param idUnidade | |
218 | + * @return boolean | |
219 | + */ | |
220 | + boolean isProcessoNaUnidadeUsuarioLogado(Long idProcesso); | |
221 | + | |
203 | 222 | } | ... | ... |
cit-ecm-api/src/main/java/br/com/centralit/api/service/impl/CredencialProcessoServiceImpl.java
... | ... | @@ -5,6 +5,8 @@ import java.util.Collection; |
5 | 5 | import java.util.LinkedList; |
6 | 6 | import java.util.List; |
7 | 7 | |
8 | +import javax.servlet.http.HttpServletRequest; | |
9 | + | |
8 | 10 | import org.springframework.beans.factory.annotation.Autowired; |
9 | 11 | import org.springframework.stereotype.Service; |
10 | 12 | |
... | ... | @@ -19,6 +21,7 @@ import br.com.centralit.api.service.GrupoService; |
19 | 21 | import br.com.centralit.api.service.HistoricoCredencialProcessoService; |
20 | 22 | import br.com.centralit.api.service.ProcessoService; |
21 | 23 | import br.com.centralit.api.service.SigiloService; |
24 | +import br.com.centralit.api.service.UnidadeProcessoService; | |
22 | 25 | import br.com.centralit.api.service.UsuarioService; |
23 | 26 | import br.com.centralit.api.viewHelper.GrupoUsuarioVH; |
24 | 27 | import br.com.centralit.api.viewHelper.HerancaSistemaVH; |
... | ... | @@ -89,6 +92,14 @@ public class CredencialProcessoServiceImpl extends GenericServiceImpl<Credencial |
89 | 92 | @Autowired |
90 | 93 | private SigiloService sigiloService; |
91 | 94 | |
95 | + /** Atributo unidadeProcessoService. */ | |
96 | + @Autowired | |
97 | + private UnidadeProcessoService unidadeProcessoService; | |
98 | + | |
99 | + /** Atributo request. */ | |
100 | + @Autowired | |
101 | + private HttpServletRequest request; | |
102 | + | |
92 | 103 | /** |
93 | 104 | * Responsável pela criação de novas instâncias desta classe. |
94 | 105 | * |
... | ... | @@ -812,4 +823,44 @@ public class CredencialProcessoServiceImpl extends GenericServiceImpl<Credencial |
812 | 823 | return Boolean.FALSE; |
813 | 824 | } |
814 | 825 | |
826 | + @Override | |
827 | + public void validarAcessoPesquisa(Long idProcessInstance) { | |
828 | + | |
829 | + Processo processo = (Processo) this.processoService.findByKeyValueUnique("idProcessInstance", idProcessInstance.toString()); | |
830 | + | |
831 | + this.request.getSession().setAttribute("idProcesso", processo.getId()); | |
832 | + | |
833 | + } | |
834 | + | |
835 | + /** | |
836 | + * <p> | |
837 | + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a> | |
838 | + * </p> | |
839 | + * | |
840 | + * <p> | |
841 | + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> | |
842 | + * </p> | |
843 | + * | |
844 | + * Método responsável por verificar se o usuario tem permissão para executar o processo | |
845 | + * | |
846 | + * @author rogerio.costa | |
847 | + * | |
848 | + * @param idProcesso | |
849 | + * | |
850 | + * @return Boolean | |
851 | + */ | |
852 | + public Boolean permiteExecutar(Long idProcesso) { | |
853 | + | |
854 | + Processo processo = this.processoService.find(idProcesso); | |
855 | + | |
856 | + if (processo.getNivelAcesso().getNivelAcesso().getCodigo().equals(2L)) { | |
857 | + | |
858 | + return Boolean.TRUE; | |
859 | + | |
860 | + } | |
861 | + | |
862 | + return this.unidadeProcessoService.isProcessoNaUnidadeUsuarioLogado(idProcesso); | |
863 | + | |
864 | + } | |
865 | + | |
815 | 866 | } | ... | ... |
cit-ecm-api/src/main/java/br/com/centralit/api/service/impl/ProcessoServiceImpl.java
... | ... | @@ -42,6 +42,7 @@ import br.com.centralit.api.service.SolrService; |
42 | 42 | import br.com.centralit.api.service.TemporalidadeService; |
43 | 43 | import br.com.centralit.api.service.UnidadeProcessoService; |
44 | 44 | import br.com.centralit.api.service.UnidadeService; |
45 | +import br.com.centralit.api.viewHelper.ProcessoVH; | |
45 | 46 | import br.com.centralit.framework.esi.enumerated.VariableTypeEnum; |
46 | 47 | import br.com.centralit.framework.esi.environment.EnvironmentOutput; |
47 | 48 | import br.com.centralit.framework.esi.environment.EnvironmentVariable; |
... | ... | @@ -95,6 +96,8 @@ import com.googlecode.genericdao.search.SearchResult; |
95 | 96 | @Service("processoService") |
96 | 97 | public class ProcessoServiceImpl extends GenericServiceImpl<Processo, Long> implements ProcessoService { |
97 | 98 | |
99 | + private static final String ECM_VALIDACAO_PERMISSAO_OPERACAO = "ECM.VALIDACAO.PERMISSAO_OPERACAO"; | |
100 | + | |
98 | 101 | /** Cosntante VALIDAR_OUTRAS_UNIDADES. */ |
99 | 102 | private static final String VALIDAR_OUTRAS_UNIDADES = "ECM.VALIDACAO.VALIDAR_ALTERACAO_NIVEL_ACESSO_OUTRAS_UNIDADES"; |
100 | 103 | |
... | ... | @@ -176,12 +179,13 @@ public class ProcessoServiceImpl extends GenericServiceImpl<Processo, Long> impl |
176 | 179 | this.gerarNUP(processo); |
177 | 180 | } |
178 | 181 | |
179 | - this.saveSolr(processo); | |
180 | - | |
181 | 182 | // Verifica se o processo é sigiloso, verdadeiro sejá estarta o businessProcess, falso envia uma notificação para os grupos responsáeis. |
182 | 183 | if (!UtilObjeto.isReferencia(processo.getSigilo())) { |
183 | 184 | |
184 | 185 | this.startBusinessProcess(processo); |
186 | + | |
187 | + this.saveSolr(processo); | |
188 | + | |
185 | 189 | } else { |
186 | 190 | |
187 | 191 | this.enviarNotificacaoProcessoSigiloso(processo); |
... | ... | @@ -275,10 +279,7 @@ public class ProcessoServiceImpl extends GenericServiceImpl<Processo, Long> impl |
275 | 279 | |
276 | 280 | try { |
277 | 281 | |
278 | - if (!UtilObjeto.isReferencia(processo.getSigilo())) { | |
279 | - | |
280 | - this.solrService.addProcesso(processo); | |
281 | - } | |
282 | + this.solrService.addProcesso(processo); | |
282 | 283 | |
283 | 284 | } catch (final Exception e) { |
284 | 285 | |
... | ... | @@ -697,6 +698,72 @@ public class ProcessoServiceImpl extends GenericServiceImpl<Processo, Long> impl |
697 | 698 | * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> |
698 | 699 | * </p> |
699 | 700 | * |
701 | + * Método responsável por obter o processo. | |
702 | + * | |
703 | + * @author rogerio.costa | |
704 | + * | |
705 | + * @param id | |
706 | + * @return | |
707 | + */ | |
708 | + public ProcessoVH getProcessoView(Long id) { | |
709 | + | |
710 | + Processo processo = super.getReference(id); | |
711 | + | |
712 | + this.verificarPermissaoAcessoProcesso(id, processo); | |
713 | + | |
714 | + processo.setDocumentos(this.documentoGedService.findByIdProcessoUltimaVersao(id)); | |
715 | + | |
716 | + ProcessoVH processoVH = new ProcessoVH(); | |
717 | + | |
718 | + processoVH.setProcesso(processo); | |
719 | + | |
720 | + return processoVH; | |
721 | + } | |
722 | + | |
723 | + /** | |
724 | + * <p> | |
725 | + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a> | |
726 | + * </p> | |
727 | + * | |
728 | + * <p> | |
729 | + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> | |
730 | + * </p> | |
731 | + * | |
732 | + * Método responsável por verificar se o usuario contem permissão para acessar o processo | |
733 | + * | |
734 | + * @author rogerio.costa | |
735 | + * | |
736 | + * @param id | |
737 | + * @param processo | |
738 | + */ | |
739 | + private void verificarPermissaoAcessoProcesso(Long id, Processo processo) { | |
740 | + | |
741 | + if (processo.getNivelAcesso().getNivelAcesso().getCodigo().equals(0L)) { | |
742 | + | |
743 | + if (!this.credencialProcessoService.contemPermissaoProcesso(id)) { | |
744 | + | |
745 | + throw new BusinessException(ECM_VALIDACAO_PERMISSAO_OPERACAO, CodigoErro.REGRA_NEGOCIO.getValue()); | |
746 | + } | |
747 | + | |
748 | + } else if (processo.getNivelAcesso().getNivelAcesso().getCodigo().equals(1L)) { | |
749 | + | |
750 | + if (!this.unidadeProcessoService.isProcessoNaUnidadeUsuarioLogado(id)) { | |
751 | + | |
752 | + throw new BusinessException(ECM_VALIDACAO_PERMISSAO_OPERACAO, CodigoErro.REGRA_NEGOCIO.getValue()); | |
753 | + | |
754 | + } | |
755 | + } | |
756 | + } | |
757 | + | |
758 | + /** | |
759 | + * <p> | |
760 | + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a> | |
761 | + * </p> | |
762 | + * | |
763 | + * <p> | |
764 | + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> | |
765 | + * </p> | |
766 | + * | |
700 | 767 | * Método responsável por iniciar o gerenciamento do processo |
701 | 768 | * |
702 | 769 | * @author rogerio.costa | ... | ... |
cit-ecm-api/src/main/java/br/com/centralit/api/service/impl/SolrServiceImpl.java
... | ... | @@ -78,7 +78,7 @@ public class SolrServiceImpl implements SolrService { |
78 | 78 | |
79 | 79 | // Add some example docs |
80 | 80 | SolrInputDocument processoDoc = new SolrInputDocument(); |
81 | - processoDoc.setField("id", "proc_" + processo.getId()); | |
81 | + processoDoc.setField("id", processo.getId()); | |
82 | 82 | processoDoc.setField("nup", processo.getNup()); |
83 | 83 | processoDoc.setField("objeto", "Processo"); |
84 | 84 | processoDoc.setField("tipoProcesso", processo.getTipoProcesso().getNome()); |
... | ... | @@ -93,6 +93,7 @@ public class SolrServiceImpl implements SolrService { |
93 | 93 | processoDoc.setField("situacao", ""); |
94 | 94 | processoDoc.setField("nivelAcesso", processo.getNivelAcesso().getNivelAcesso().getDescricao()); |
95 | 95 | processoDoc.setField("formatoDocumento", ""); |
96 | + processoDoc.setField("idProcessInstance", processo.getIdProcessInstance().toString()); | |
96 | 97 | |
97 | 98 | solrClient.add(processoDoc); |
98 | 99 | |
... | ... | @@ -117,7 +118,7 @@ public class SolrServiceImpl implements SolrService { |
117 | 118 | |
118 | 119 | sb.append("doc_").append(documentoGed.getIdRaiz() != null ? documentoGed.getIdRaiz() : documentoGed.getId()); |
119 | 120 | |
120 | - documentoDoc.setField("id", "doc_" + sb.toString()); | |
121 | + documentoDoc.setField("id", sb.toString()); | |
121 | 122 | documentoDoc.setField("nup", documentoGed.getNumero()); |
122 | 123 | documentoDoc.setField("objeto", "Documento"); |
123 | 124 | documentoDoc.setField("tipoDocumento", documentoGed.getTipoDocumento().getNome()); |
... | ... | @@ -131,6 +132,8 @@ public class SolrServiceImpl implements SolrService { |
131 | 132 | documentoDoc.setField("situacao", ""); |
132 | 133 | documentoDoc.setField("nivelAcesso", documentoGed.getNivelAcesso().getNivelAcesso().getDescricao()); |
133 | 134 | documentoDoc.setField("formatoDocumento", documentoGed.getFormaCriacao().getDescricao()); |
135 | + documentoDoc.setField("idProcessInstance", documentoGed.getProcesso().getIdProcessInstance().toString()); | |
136 | + documentoDoc.setField("idProcesso", documentoGed.getProcesso().getId().toString()); | |
134 | 137 | // verifica se o nivel de acesso é restrito |
135 | 138 | if (!documentoGed.getNivelAcesso().getNivelAcesso().getCodigo().equals(1L)) { |
136 | 139 | ... | ... |
cit-ecm-api/src/main/java/br/com/centralit/api/service/impl/UnidadeProcessoServiceImpl.java
... | ... | @@ -364,4 +364,32 @@ public class UnidadeProcessoServiceImpl extends GenericServiceImpl<UnidadeProces |
364 | 364 | |
365 | 365 | } |
366 | 366 | |
367 | + /** | |
368 | + * <p> | |
369 | + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a> | |
370 | + * </p> | |
371 | + * | |
372 | + * <p> | |
373 | + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> | |
374 | + * </p> | |
375 | + * | |
376 | + * Método responsável por verificar se o processo pertence a unidade | |
377 | + * | |
378 | + * @author rogerio.costa | |
379 | + * | |
380 | + * @param idProcesso | |
381 | + * @param idUnidade | |
382 | + * @return boolean | |
383 | + */ | |
384 | + public boolean isProcessoNaUnidadeUsuarioLogado(Long idProcesso) { | |
385 | + | |
386 | + if (UtilObjeto.isReferencia(this.getUsuario().getUnidade())) { | |
387 | + | |
388 | + return this.unidadeProcessoDao.isProcessoNaUnidadeUsuarioLogado(idProcesso, this.getUsuario().getUnidade().getId()); | |
389 | + } | |
390 | + | |
391 | + return Boolean.FALSE; | |
392 | + | |
393 | + } | |
394 | + | |
367 | 395 | } | ... | ... |
cit-ecm-api/src/main/resources/scripts/v1.0.0-alpha9/01-cit-ecm-1.0.0-ALFA-3-postgres.sql
... | ... | @@ -36,4 +36,9 @@ INSERT INTO tarjaassinatura(id, databloqueio, datainativo, datacriacao, dataedic |
36 | 36 | VALUES (NEXTVAL('hibernate_sequence'), LOCALTIMESTAMP, NULL, LOCALTIMESTAMP, LOCALTIMESTAMP, 0, '', '', null, (select id from seguranca_usuario where username = 'admin'), null, null, (select id from dominio where chave = 'tipoAssinatura' and codigo = 1)); |
37 | 37 | INSERT INTO tarjaassinatura(id, databloqueio, datainativo, datacriacao, dataedicao, version, conteudo, descricao, inativador_id, autor_id, editor_id, anexoimagem_id, tipoassinatura_id) |
38 | 38 | VALUES (NEXTVAL('hibernate_sequence'), LOCALTIMESTAMP, NULL, LOCALTIMESTAMP, LOCALTIMESTAMP, 0, '', '', null, (select id from seguranca_usuario where username = 'admin'), null, null, (select id from dominio where chave = 'tipoAssinatura' and codigo = 2)); |
39 | --- CIRO - 18/04/2016 - FIM | |
40 | 39 | \ No newline at end of file |
40 | + | |
41 | +update dominio set chave='estadoDocumentoGed' where chave = 'statusDocumentoGed'; | |
42 | +-- CIRO - 18/04/2016 - FIM | |
43 | + | |
44 | + | |
45 | + | ... | ... |
cit-ecm-web/src/main/java/br/com/centralit/controller/CredencialProcessoController.java
... | ... | @@ -11,7 +11,6 @@ import org.springframework.web.bind.annotation.RequestMethod; |
11 | 11 | import org.springframework.web.bind.annotation.RequestParam; |
12 | 12 | import org.springframework.web.bind.annotation.ResponseBody; |
13 | 13 | |
14 | -import br.com.centralit.api.framework.json.ViewsEcm; | |
15 | 14 | import br.com.centralit.api.model.CredencialProcesso; |
16 | 15 | import br.com.centralit.api.service.CredencialProcessoService; |
17 | 16 | import br.com.centralit.api.viewHelper.GrupoUsuarioVH; |
... | ... | @@ -167,6 +166,18 @@ public class CredencialProcessoController extends GenericController<CredencialPr |
167 | 166 | return responseBody; |
168 | 167 | } |
169 | 168 | |
169 | + @RequestMapping(method = RequestMethod.POST, value = "/validarAcessoPesquisa") | |
170 | + @ResponseBody | |
171 | + public ResponseBodyWrapper validarAcessoPesquisa(@RequestBody String idProcessInstance) { | |
172 | + | |
173 | + this.credencialProcessoService.validarAcessoPesquisa(Long.parseLong(idProcessInstance)); | |
174 | + | |
175 | + ResponseBodyWrapper responseBody = new ResponseBodyWrapper(Boolean.TRUE, Views.GenericView.class); | |
176 | + | |
177 | + return responseBody; | |
178 | + | |
179 | + } | |
180 | + | |
170 | 181 | @Override |
171 | 182 | public Class<Views.CredencialProcessoView> getEditView() { |
172 | 183 | ... | ... |
cit-ecm-web/src/main/java/br/com/centralit/controller/ProcessoController.java
... | ... | @@ -122,6 +122,15 @@ public class ProcessoController extends GenericController<Processo> { |
122 | 122 | return responseBody; |
123 | 123 | } |
124 | 124 | |
125 | + @RequestMapping(method = RequestMethod.GET, value = "/getProcessoVH") | |
126 | + @ResponseBody | |
127 | + public ResponseBodyWrapper getProcessoVH(@RequestParam(value = "idProcesso") Long idProcesso) { | |
128 | + | |
129 | + ResponseBodyWrapper responseBody = new ResponseBodyWrapper(this.processoService.getProcessoView(idProcesso), Views.processoVHview.class); | |
130 | + | |
131 | + return responseBody; | |
132 | + } | |
133 | + | |
125 | 134 | /** |
126 | 135 | * <p> |
127 | 136 | * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a> |
... | ... | @@ -159,9 +168,9 @@ public class ProcessoController extends GenericController<Processo> { |
159 | 168 | search.setResultMode(Search.RESULT_MAP); |
160 | 169 | |
161 | 170 | SearchResult searchResult = null; |
162 | - | |
171 | + | |
163 | 172 | String nomeGrid = UtilString.isNullOrEmpty(searchParams.getNome()) ? "" : searchParams.getNome(); |
164 | - | |
173 | + | |
165 | 174 | switch (nomeGrid) { |
166 | 175 | case Processo.GRID_CLASSIFICACAO_PROCESSO_DOCUMENTO: |
167 | 176 | searchResult = this.processoService.searchAndCountPorSigilo(search); | ... | ... |
cit-ecm-web/src/main/java/br/com/centralit/controller/UnidadeProcessoController.java
... | ... | @@ -58,7 +58,7 @@ import br.com.centralit.framework.view.ResultResponseVH; |
58 | 58 | * @author rogerio.costa |
59 | 59 | * |
60 | 60 | */ |
61 | -@SuppressWarnings({"unchecked", "rawtypes"}) | |
61 | +@SuppressWarnings({ "unchecked", "rawtypes" }) | |
62 | 62 | @Controller |
63 | 63 | @RequestMapping("/rest/unidadeProcesso") |
64 | 64 | public class UnidadeProcessoController extends GenericController<UnidadeProcesso> { |
... | ... | @@ -127,6 +127,32 @@ public class UnidadeProcessoController extends GenericController<UnidadeProcesso |
127 | 127 | return responseBody; |
128 | 128 | } |
129 | 129 | |
130 | + /** | |
131 | + * <p> | |
132 | + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a> | |
133 | + * </p> | |
134 | + * | |
135 | + * <p> | |
136 | + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> | |
137 | + * </p> | |
138 | + * | |
139 | + * Método responsável por | |
140 | + * | |
141 | + * @author rogerio.costa | |
142 | + * | |
143 | + * @param idProcesso | |
144 | + * @param idUnidade | |
145 | + * @return | |
146 | + */ | |
147 | + @RequestMapping(value = "/isProcessoNaUnidadeUsuarioLogado", method = RequestMethod.GET, produces = "application/json") | |
148 | + @ResponseBody | |
149 | + public ResponseBodyWrapper isProcessoNaUnidadeUsuarioLogado(@RequestParam(value = "idProcesso") Long idProcesso) { | |
150 | + | |
151 | + ResponseBodyWrapper responseBody = new ResponseBodyWrapper(this.unidadeProcessoService.isProcessoNaUnidadeUsuarioLogado(idProcesso), Views.GenericView.class); | |
152 | + | |
153 | + return responseBody; | |
154 | + } | |
155 | + | |
130 | 156 | @RequestMapping(value = "/getPage", method = RequestMethod.POST) |
131 | 157 | @ResponseBody |
132 | 158 | public ResponseBodyWrapper findGrid(@RequestBody SearchParams searchParams) { |
... | ... | @@ -138,13 +164,13 @@ public class UnidadeProcessoController extends GenericController<UnidadeProcesso |
138 | 164 | search.setResultMode(Search.RESULT_MAP); |
139 | 165 | |
140 | 166 | SearchResult searchResult = null; |
141 | - | |
167 | + | |
142 | 168 | String nomeGrid = UtilString.isNullOrEmpty(searchParams.getNome()) ? "" : searchParams.getNome(); |
143 | - | |
169 | + | |
144 | 170 | switch (nomeGrid) { |
145 | 171 | case Processo.GRID_PROCESSO_NA_UNIDADE: |
146 | - searchResult = this.unidadeProcessoService.searchAndCountPorUnidade(search); | |
147 | - break; | |
172 | + searchResult = this.unidadeProcessoService.searchAndCountPorUnidade(search); | |
173 | + break; | |
148 | 174 | default: |
149 | 175 | searchResult = genericService.searchAndCount(search); |
150 | 176 | break; |
... | ... | @@ -162,7 +188,6 @@ public class UnidadeProcessoController extends GenericController<UnidadeProcesso |
162 | 188 | return responseBody; |
163 | 189 | } |
164 | 190 | |
165 | - | |
166 | 191 | @Override |
167 | 192 | public Class<Views.EnviarProcessoView> getEditView() { |
168 | 193 | ... | ... |
cit-ecm-web/src/main/java/br/com/centralit/listener/StartupListenerEcm.java
... | ... | @@ -454,6 +454,7 @@ public class StartupListenerEcm extends UtilStartup implements ApplicationListen |
454 | 454 | internacionalizacaoList.add(new Internacionalizacao("ECM.ASSINADO_SUCESSO", "Documento assinado com sucesso!", dominio, modulo)); |
455 | 455 | internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.ASSINATURA_DO_DOCUMENTO", "Assinatura do Documento", dominio, modulo)); |
456 | 456 | internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.DOCUMENTO_SEM_ASSINATURA", "Documento sem assinaturas!", dominio, modulo)); |
457 | + | |
457 | 458 | |
458 | 459 | } |
459 | 460 | |
... | ... | @@ -573,5 +574,6 @@ public class StartupListenerEcm extends UtilStartup implements ApplicationListen |
573 | 574 | internacionalizacaoList.add(new Internacionalizacao("ECM.MSG.USUARIO_SEM_PESSOA", "Usuário não está presente no Cadastro de Pessoa!", dominio, modulo)); |
574 | 575 | internacionalizacaoList.add(new Internacionalizacao("ECM.MSG.DOCUMENTO_SEM_ASSINATURAS", "Esta versão do Documento não possui assinaturas!", dominio, modulo)); |
575 | 576 | internacionalizacaoList.add(new Internacionalizacao("ECM.MSG.DOCUMENTO_JA_ASSINADO", "Documento já foi assinado por este usuário!", dominio, modulo)); |
577 | + internacionalizacaoList.add(new Internacionalizacao("ECM.MSG.INFORMACAO_RESTRITA", "Informação restrita", dominio, modulo)); | |
576 | 578 | } |
577 | 579 | } | ... | ... |
cit-ecm-web/src/main/webapp/assets/js/angular/custom/controller/GerenciarProcessoController.js
... | ... | @@ -615,7 +615,7 @@ citApp.controller('GerenciarProcessoController', [ '$scope', '$translate', '$tim |
615 | 615 | $scope.siglas = []; |
616 | 616 | |
617 | 617 | // CARREGA O PROCESSO VINCULADO A TAREFA |
618 | - $timeout( function () { | |
618 | + $timeout(function() { | |
619 | 619 | |
620 | 620 | ProcessoRepository.getProcessoGerenciamento($scope.idProcesso).then( function ( result ) { |
621 | 621 | $scope.processo = result.originalElement; |
... | ... | @@ -638,10 +638,10 @@ citApp.controller('GerenciarProcessoController', [ '$scope', '$translate', '$tim |
638 | 638 | |
639 | 639 | $scope.setLoading( false ); |
640 | 640 | |
641 | - } ); | |
641 | + }); | |
642 | 642 | |
643 | - }, 400 ); | |
644 | - } ); | |
643 | + }, 400); | |
644 | + }); | |
645 | 645 | }; |
646 | 646 | // FIM EXECUTAR BPE |
647 | 647 | |
... | ... | @@ -689,6 +689,29 @@ citApp.controller('GerenciarProcessoController', [ '$scope', '$translate', '$tim |
689 | 689 | |
690 | 690 | }; |
691 | 691 | |
692 | + //Obter o processoVH | |
693 | + $scope.getProcessoVH = function (idProcesso) { | |
694 | + | |
695 | + $scope.setLoadingGet(true); | |
696 | + | |
697 | + ProcessoRepository.getProcessoVH(idProcesso).then(function(result) { | |
698 | + //Processo do scopo do gerenciamento | |
699 | + $scope.processoVH = result.originalElement; | |
700 | + | |
701 | + $scope.processo = $scope.processoVH.processo; | |
702 | + $scope.idProcesso = $scope.processo.id; | |
703 | + | |
704 | + $scope.fecharPagina(); | |
705 | + | |
706 | + $scope.apresentarCabecalho = true; | |
707 | + | |
708 | + $scope.widgetExemploIsCollapsed = false; | |
709 | + | |
710 | + $scope.setLoading(false); | |
711 | + }); | |
712 | + | |
713 | + }; | |
714 | + | |
692 | 715 | $scope.atualizarAtribuicaoProcesso = function (idProcesso){ |
693 | 716 | |
694 | 717 | ProcessoRepository.verificarAtribuicaoProcessoPrimeiroAcesso(idProcesso).then( function ( result ) { | ... | ... |
cit-ecm-web/src/main/webapp/assets/js/angular/custom/controller/SolrSearchController.js
... | ... | @@ -26,11 +26,13 @@ |
26 | 26 | * @param Utils |
27 | 27 | */ |
28 | 28 | |
29 | -citApp.controller('SolrSearchController', ['$scope','$attrs','$location','$route','$routeParams','$window','$timeout','SolrSearchService','Utils', "$compile", 'DominioRepository', '$filter', | |
30 | - function SolrSearchController($scope, $attrs, $location, $route, $routeParams, $window, $timeout, SolrSearchService, Utils, $compile, DominioRepository, $filter) { | |
29 | +citApp.controller('SolrSearchController', ['$scope','$attrs','$location','$route','$routeParams','$window','$timeout','SolrSearchService','Utils', "$compile", 'DominioRepository', '$filter', "workflowFilterCriteriaService", | |
30 | + "BusinessProcessRepository", "appService", "$rootScope", "$translate", 'UnidadeProcessoRepository', 'CredencialProcessoRepository', | |
31 | + function SolrSearchController($scope, $attrs, $location, $route, $routeParams, $window, $timeout, SolrSearchService, Utils, $compile, DominioRepository, $filter, workflowFilterCriteriaService, BusinessProcessRepository, | |
32 | + appService, $rootScope, $translate, UnidadeProcessoRepository, CredencialProcessoRepository) { | |
31 | 33 | |
32 | 34 | $scope.searchHintsField = 'tipoProcesso,tipoDocumento,objeto,assunto,autor,atribuidoA,destinatario,unidadeGeradora,situacao,nivelAcesso,dataCriacao'; |
33 | - | |
35 | + | |
34 | 36 | // instructional message to aid the user in constructing a query |
35 | 37 | $scope.messages = [ |
36 | 38 | "Enter one or more search terms. Press Enter to search.", |
... | ... | @@ -123,7 +125,7 @@ citApp.controller('SolrSearchController', ['$scope','$attrs','$location','$route |
123 | 125 | $scope.handleSetPage = function() { |
124 | 126 | |
125 | 127 | $scope.timeout = $timeout(function () { |
126 | - var query = SolrSearchService.createQuery("https://172.20.0.74:8983/solr/jcg"); | |
128 | + var query = SolrSearchService.createQuery("https://localhost:8983/solr/jcg"); | |
127 | 129 | query.setOption("rows", "10"); |
128 | 130 | query.setOption("facet", "true"); |
129 | 131 | query.setOption("facet.limit", $scope.maxHints); |
... | ... | @@ -187,6 +189,8 @@ citApp.controller('SolrSearchController', ['$scope','$attrs','$location','$route |
187 | 189 | results.docs[i].conteudo = results.docs[i].conteudo + item; |
188 | 190 | }); |
189 | 191 | |
192 | + }else{ | |
193 | + results.docs[i].conteudo = ""; | |
190 | 194 | } |
191 | 195 | } |
192 | 196 | |
... | ... | @@ -330,7 +334,7 @@ citApp.controller('SolrSearchController', ['$scope','$attrs','$location','$route |
330 | 334 | if ($scope.userQuery && $scope.userQuery.length >= $scope.minSearchLength) { |
331 | 335 | if ($scope.timeout) $timeout.cancel($scope.timeout); |
332 | 336 | $scope.timeout = $timeout(function () { |
333 | - var query = SolrSearchService.createQuery("https://172.20.0.74:8983/solr/jcg"); | |
337 | + var query = SolrSearchService.createQuery("https://localhost:8983/solr/jcg"); | |
334 | 338 | query.setOption("rows", "10"); |
335 | 339 | query.setOption("facet", "true"); |
336 | 340 | query.setOption("facet.limit", $scope.maxHints); |
... | ... | @@ -409,7 +413,7 @@ citApp.controller('SolrSearchController', ['$scope','$attrs','$location','$route |
409 | 413 | $scope.userQuery = "*:*"; |
410 | 414 | } |
411 | 415 | $scope.timeout = $timeout(function () { |
412 | - var query = SolrSearchService.createQuery("https://172.20.0.74:8983/solr/jcg"); | |
416 | + var query = SolrSearchService.createQuery("https://localhost:8983/solr/jcg"); | |
413 | 417 | query.setOption("rows", "10"); |
414 | 418 | query.setOption("facet", "true"); |
415 | 419 | query.setOption("facet.limit", $scope.maxHints); |
... | ... | @@ -440,7 +444,7 @@ citApp.controller('SolrSearchController', ['$scope','$attrs','$location','$route |
440 | 444 | valueFilter = "*:*"; |
441 | 445 | } |
442 | 446 | $scope.timeout = $timeout(function () { |
443 | - var query = SolrSearchService.createQuery("https://172.20.0.74:8983/solr/jcg"); | |
447 | + var query = SolrSearchService.createQuery("https://localhost:8983/solr/jcg"); | |
444 | 448 | query.setOption("rows", "10"); |
445 | 449 | query.setOption("facet", "true"); |
446 | 450 | query.setOption("facet.limit", $scope.maxHints); |
... | ... | @@ -600,8 +604,162 @@ citApp.controller('SolrSearchController', ['$scope','$attrs','$location','$route |
600 | 604 | $scope.parameterDatePesquisa = $.grep($scope.filtroDateList, function(e){ return e.codigo == 0; })[0].originalElement; |
601 | 605 | |
602 | 606 | }); |
603 | - | |
604 | - | |
607 | + | |
608 | + $scope.obterTransclude = function(doc) { | |
609 | + | |
610 | + doc.$show = !doc.$show; | |
611 | + $scope.documents.forEach(function(item){ | |
612 | + if(item.id != doc.id){ | |
613 | + item.$expandido = false; | |
614 | + item.$show = false; | |
615 | + } | |
616 | + }); | |
617 | + | |
618 | + $scope.docSelecionado = doc; | |
619 | + if(doc.$show){ | |
620 | + _getFilterCriteriaTarefa(); | |
621 | + _fetchBusinessProcess(doc); | |
622 | + }else{ | |
623 | + doc.$expandido = false; | |
624 | + doc.$show = false; | |
625 | + }; | |
626 | + }; | |
627 | + | |
628 | + function _getFilterCriteriaTarefa(){ | |
629 | + var filterService = workflowFilterCriteriaService.getDefaultFilterCriteria(); | |
630 | + $scope.filterCriteriaBusinessProcess = { | |
631 | + start : 1, | |
632 | + sort : 'workItem.processInstance.id', | |
633 | + limit : 10, | |
634 | + deadline : 1, | |
635 | + processDeadline : 1, | |
636 | + timeManagementStatus : "", | |
637 | + fields : [ 'workItem.id', 'workItem.processInstance.id'], | |
638 | + filters : [{type: 'numeric', field: 'workItem.processInstance.id', value : $scope.docSelecionado.idProcessInstance} | |
639 | + , {type: 'string', field: 'workItem.flowElement.name'} | |
640 | + , {type: 'string', field: 'workItem.processInstance.businessProcess.description'} | |
641 | + , {type: 'string', field: 'workItem.processInstance.flowStatus.name'}] | |
642 | + }; | |
643 | + $scope.filterCriteriaBusinessProcess.username = filterService.username; | |
644 | + $scope.filterCriteriaBusinessProcess.groups = filterService.groups; | |
645 | + } | |
646 | + | |
647 | + function _fetchBusinessProcess(doc) { | |
648 | + $scope.assignments = []; | |
649 | + $scope.btnAction = false; | |
650 | + $scope.workItem = null; | |
651 | + $scope.setLoadingGet(true); | |
652 | + BusinessProcessRepository.tasksByParam($scope.filterCriteriaBusinessProcess).then(function(result) { | |
653 | + $scope.assignments = result.originalElement.objects; | |
654 | + | |
655 | + if($scope.docSelecionado.idProcessInstance){ | |
656 | + CredencialProcessoRepository.validarAcessoPesquisa($scope.docSelecionado.idProcessInstance).then(function(result) { | |
657 | + | |
658 | + $scope.urlInclude= '/cit-ecm-web/html/pesquisa/tarefasProcesso.jsp?i=' + $scope.docSelecionado.id; | |
659 | + doc.$expandido = !doc.$expandido; | |
660 | + }); | |
661 | + | |
662 | + } | |
663 | + if($scope.assignments.length > 0){ | |
664 | + _recuperarPermissoes($scope.assignments[0].id, doc); | |
665 | + }; | |
666 | + $scope.setLoadingGet(false); | |
667 | + }); | |
668 | + }; | |
669 | + | |
670 | + function _recuperarPermissoes(idAssignment, doc){ | |
671 | + BusinessProcessRepository.getPermissions({id: idAssignment}).then(function(result) { | |
672 | + $scope.workItem = result.originalElement; | |
673 | + vincularWorkItemAssignments(); | |
674 | + $scope.btnAction = !(!$scope.workItem.execute && !$scope.workItem.suspend && !$scope.workItem.delegate && !$scope.workItem.restart && !$scope.workItem.visualize); | |
675 | + $scope.docSelecionado.workItem = $scope.workItem; | |
676 | + $scope.setLoadingGet(false); | |
677 | + }); | |
678 | + }; | |
679 | + | |
680 | + function vincularWorkItemAssignments(){ | |
681 | + $scope.assignments.forEach(function(assignment){ | |
682 | + assignment.workItem = $scope.workItem; | |
683 | + assignment.checked = false; | |
684 | + }); | |
685 | + if($scope.assignments.length > 0){ | |
686 | + $scope.assignments[0].checked = true; | |
687 | + } | |
688 | + }; | |
689 | + | |
690 | + $scope.executarTarefa = function(){ | |
691 | + _getAssignmentSelected(); | |
692 | + if($scope.workItem){ | |
693 | + var pagina = '/cit-esi-web/assets/js/angular/custom/directive/html/userTask.html'; | |
694 | + if ($scope.workItem.flowElement.userInterface && $scope.workItem.flowElement.userInterface.executeCustomPage) { | |
695 | + pagina = $scope.workItem.flowElement.userInterface.URLCustomPage; | |
696 | + _abrirPaginaTarefa(pagina); | |
697 | + }else if ($scope.workItem.flowElement.userInterface && $scope.workItem.flowElement.userInterface.resource && $scope.workItem.flowElement.userInterface.resourceName) { | |
698 | + FormBuilderRepository.getByName($scope.workItem.flowElement.userInterface.resourceName).then(function(result) { | |
699 | + pagina = '/cit-esi-web/forms/'+result.originalElement.path+'/'+result.originalElement.resource.name+"_task.html"; | |
700 | + _abrirPaginaTarefa(pagina); | |
701 | + }); | |
702 | + }else{ | |
703 | + _abrirPaginaTarefa(pagina); | |
704 | + } | |
705 | + } | |
706 | + }; | |
707 | + | |
708 | + function _abrirPaginaTarefa(pagina){ | |
709 | + if (appService.existsWorkspace(pagina)) { | |
710 | + $scope.showAlert('warning', $translate.instant('ESI.MSG.JA_EXISTE_TELA_TAREFA')); | |
711 | + return ; | |
712 | + } | |
713 | + $scope.processInstance = $scope.docSelecionado.workItem.processInstance; | |
714 | + $scope.processInstance.collapsed = true; | |
715 | + $scope.processInstance.collapsedError = true; | |
716 | + $rootScope.task = $scope.workItem; | |
717 | + $rootScope.processInstance = $scope.processInstance; | |
718 | + $rootScope.controllerScope = $scope; | |
719 | + | |
720 | + var nome = $scope.task.flowElement.description; | |
721 | + if (!nome || nome == '') | |
722 | + nome = $scope.workItem.flowElement.name; | |
723 | + | |
724 | + $scope.addNewWorkspace($translate.instant('ESI.PERMISSAO.EXECUTAR')+" "+$translate.instant('ESI.TAREFA').toLowerCase()+" '"+nome+"'", pagina, true, 'mod-red-dark', $scope.workItem); | |
725 | + }; | |
726 | + | |
727 | + function _getAssignmentSelected() { | |
728 | + for(var pos = 0; pos < $scope.assignments.length; pos++){ | |
729 | + if($scope.assignments[pos].checked){ | |
730 | + $scope.docSelecionado.workItem = $scope.assignments[pos]; | |
731 | + break; | |
732 | + } | |
733 | + } | |
734 | + }; | |
735 | + | |
736 | + //Abre a tela de visualização de processo e documentos | |
737 | + $scope.abreVisualizar = function(){ | |
738 | + | |
739 | + var pagina = '/cit-ecm-web/html/processoVisualizacao/processoView.html'; | |
740 | + | |
741 | + var paginaGerenciamento = '/cit-ecm-web/html/gerenciarProcesso/gerenciarProcesso.html'; | |
742 | + | |
743 | + if (appService.existsWorkspace(paginaGerenciamento)) { | |
744 | + $scope.$openModalConfirm({message:$translate.instant('ECM.MSG.EXISTE_PROCESSO_ABERTO'), callback: function(){ | |
745 | + $scope.$modalConfirmInstance.dismiss('cancel'); | |
746 | + $scope.setLoading(true); | |
747 | + $scope.openWorkspaceIfNotOpen($translate.instant('ECM.LABEL.PROCESSO'), pagina, 'mod-orange'); | |
748 | + $timeout(function() { | |
749 | + angular.element('#visualizarGerenciarProcesso').scope().getProcessoVH($scope.docSelecionado.objeto === 'Processo'? $scope.docSelecionado.id : $scope.docSelecionado.idProcesso); | |
750 | + | |
751 | + }, 100); | |
752 | + $scope.setLoading(false); | |
753 | + }}); | |
754 | + }else{ | |
755 | + $scope.openWorkspaceIfNotOpen($translate.instant('ECM.LABEL.PROCESSO'), pagina, 'mod-orange'); | |
756 | + $timeout(function() { | |
757 | + angular.element('#visualizarGerenciarProcesso').scope().getProcessoVH($scope.docSelecionado.objeto === 'Processo'? $scope.docSelecionado.id : $scope.docSelecionado.idProcesso); | |
758 | + | |
759 | + }, 100); | |
760 | + }; | |
761 | + }; | |
762 | + | |
605 | 763 | $scope.init(); |
606 | 764 | }]); |
607 | 765 | ... | ... |
cit-ecm-web/src/main/webapp/assets/js/angular/custom/repository/CredencialProcessoRepository.js
... | ... | @@ -21,8 +21,12 @@ citApp.factory('CredencialProcessoRepository', ['RestangularEcm', 'AbstractRepos |
21 | 21 | return restangularEcm.one(this.route).getList("findByIdProcesso", {idProcesso : idProcesso}).then(); |
22 | 22 | }; |
23 | 23 | |
24 | - this.renunciar = function (idProcesso) { | |
25 | - return restangularEcm.one(this.route + "/renunciar", idProcesso).remove(); | |
24 | + this.findByIdProcesso = function(idProcesso) { | |
25 | + return restangularEcm.one(this.route).getList("findByIdProcesso", {idProcesso : idProcesso}).then(); | |
26 | + }; | |
27 | + | |
28 | + this.validarAcessoPesquisa = function (idProcessInstance) { | |
29 | + return restangularEcm.all(this.route + '/validarAcessoPesquisa').post(idProcessInstance); | |
26 | 30 | }; |
27 | 31 | |
28 | 32 | } | ... | ... |
cit-ecm-web/src/main/webapp/assets/js/angular/custom/repository/ProcessoRepository.js
... | ... | @@ -32,6 +32,11 @@ citApp.factory('ProcessoRepository', ['RestangularEcm', 'AbstractRepository', fu |
32 | 32 | |
33 | 33 | }; |
34 | 34 | |
35 | + this.getProcessoVH = function (idProcesso){ | |
36 | + return restangularEcm.one(this.route + '/getProcessoVH').get({"idProcesso": idProcesso}); | |
37 | + | |
38 | + }; | |
39 | + | |
35 | 40 | this.verificarAtribuicaoProcessoPrimeiroAcesso = function (idProcesso){ |
36 | 41 | return restangularEcm.one(this.route + '/verificarAtribuicaoProcessoPrimeiroAcesso').get({"idProcesso": idProcesso}); |
37 | 42 | ... | ... |
cit-ecm-web/src/main/webapp/assets/js/angular/custom/repository/UnidadeProcessoRepository.js
... | ... | @@ -18,6 +18,11 @@ citApp.factory('UnidadeProcessoRepository', ['RestangularEcm', 'AbstractReposito |
18 | 18 | |
19 | 19 | }; |
20 | 20 | |
21 | + this.isProcessoNaUnidadeUsuarioLogado = function(idProcesso) { | |
22 | + return restangularEcm.one(this.route + "/isProcessoNaUnidadeUsuarioLogado").get({"idProcesso" : idProcesso}); | |
23 | + | |
24 | + }; | |
25 | + | |
21 | 26 | } |
22 | 27 | |
23 | 28 | AbstractRepository.extend(UnidadeProcessoRepository); | ... | ... |
cit-ecm-web/src/main/webapp/html/gerenciarProcesso/includeInformacaoProcesso.html
... | ... | @@ -142,12 +142,18 @@ |
142 | 142 | </div> |
143 | 143 | <div class="profile-info-value"> |
144 | 144 | <br> |
145 | - <div class="row"> | |
145 | + <div class="row" ng-if="processoUnidades.length > 0"> | |
146 | 146 | <ul style="list-style-type: disc; margin-bottom: 3px" ng-repeat="processoUnidade in processoUnidades"> |
147 | 147 | <li>{{processoUnidade.unidade.sigla}} <span ng-if="processoUnidade.usuarioResponsavel">- {{processoUnidade.usuarioResponsavel.username}}</span></li> |
148 | 148 | </ul> |
149 | 149 | |
150 | 150 | </div> |
151 | + <div class="row" ng-if="processo.unidadesProcesso.length > 0"> | |
152 | + <ul style="list-style-type: disc; margin-bottom: 3px" ng-repeat="processoUnidade in processo.unidadesProcesso"> | |
153 | + <li>{{processoUnidade.unidade.sigla}} <span ng-if="processoUnidade.usuarioResponsavel">- {{processoUnidade.usuarioResponsavel.username}}</span></li> | |
154 | + </ul> | |
155 | + | |
156 | + </div> | |
151 | 157 | </div> |
152 | 158 | </div> |
153 | 159 | </div> | ... | ... |
cit-ecm-web/src/main/webapp/html/pesquisa/pesquisa.html
... | ... | @@ -22,8 +22,7 @@ |
22 | 22 | <div class="row"> |
23 | 23 | <div class="col-sm-10"> |
24 | 24 | <div class="input-group" id="inputs"> |
25 | - <input type="text" class="form-control" id="query" type="text" placeholder="{{$translate.instant('ECM.LABEL.PLACEHOLDER_PESQUISA')}}" ng-model="userQuery" autocomplete="off" ng-focus="onfocus()" | |
26 | - ng-keyup="onkeyup($event)"> | |
25 | + <input type="text" class="form-control" id="query" type="text" placeholder="{{$translate.instant('ECM.LABEL.PLACEHOLDER_PESQUISA')}}" ng-model="userQuery" autocomplete="off" ng-keyup="onkeyup($event)"> | |
27 | 26 | <div class="input-group-btn"> |
28 | 27 | <button class="btn btn-default" type="button" id="submit" name="submit" ng-click="handleSubmit()"> |
29 | 28 | <i class="ace-icon fa fa-search icon-on-right bigger-110"></i> |
... | ... | @@ -75,8 +74,10 @@ |
75 | 74 | <b translate>ECM.LABEL.TIPODOCUMENTO</b> |
76 | 75 | </h5> |
77 | 76 | <ul class="filters_list"> |
78 | - <li ng-repeat="hint in hints['tipoDocumento']" ng-class="{'selected' : hint.selected}"><a href="javascript: return false" ng-click="selectHint('tipoDocumento',$index);" class="filters"> | |
79 | - <span class="itens" ng-show="hint.quantidade > 0">{{hint.title}}</span> <span class="qtd" ng-show="hint.quantidade > 0">{{hint.quantidade}}</span> | |
77 | + <li ng-repeat="hint in hints['tipoDocumento']" ng-class="{'selected' : hint.selected}"> | |
78 | + <a href="javascript: return false" ng-click="selectHint('tipoDocumento',$index);" class="filters"> | |
79 | + <span class="itens" ng-show="hint.quantidade > 0">{{hint.title}}</span> | |
80 | + <span class="qtd" ng-show="hint.quantidade > 0">{{hint.quantidade}}</span> | |
80 | 81 | </a></li> |
81 | 82 | </ul> |
82 | 83 | </li> |
... | ... | @@ -86,9 +87,12 @@ |
86 | 87 | <b translate>ECM.LABEL.ASSUNTO</b> |
87 | 88 | </h5> |
88 | 89 | <ul class="filters_list"> |
89 | - <li ng-repeat="hint in hints['assunto']" ng-class="{'selected' : hint.selected}"><a href="javascript: return false" ng-click="selectHint('assunto',$index)" class="filters"> <span | |
90 | - class="itens" ng-show="hint.quantidade > 0">{{hint.title}}</span> <span class="qtd" ng-show="hint.quantidade > 0">{{hint.quantidade}}</span> | |
91 | - </a></li> | |
90 | + <li ng-repeat="hint in hints['assunto']" ng-class="{'selected' : hint.selected}"> | |
91 | + <a href="javascript: return false" ng-click="selectHint('assunto',$index)" class="filters"> | |
92 | + <span class="itens" ng-show="hint.quantidade > 0">{{hint.title}}</span> | |
93 | + <span class="qtd" ng-show="hint.quantidade > 0">{{hint.quantidade}}</span> | |
94 | + </a> | |
95 | + </li> | |
92 | 96 | </ul> |
93 | 97 | </li> |
94 | 98 | |
... | ... | @@ -232,13 +236,23 @@ |
232 | 236 | <label class="result_metadado">{{doc.assunto}}</label> |
233 | 237 | </div> |
234 | 238 | </div> |
235 | - <div class="row"> | |
239 | + <div class="row" ng-show="doc.assuntoComplementar.length > 0 || doc.conteudo.length > 0"> | |
236 | 240 | <div class="col-md-12"> |
237 | 241 | <div ng-show="doc.objeto == 'Processo'">{{doc.assuntoComplementar}}</div> |
238 | 242 | |
239 | 243 | <div class="result_pesquisa" id="{{doc.id}}"></div> |
240 | 244 | </div> |
241 | 245 | </div> |
246 | + | |
247 | + <div class="row" style="padding-bottom: 15px;"> | |
248 | + <div class="col-md-12"> | |
249 | + <hr style="margin-top: 8px; margin-bottom: -6px; border: 0; border-bottom: 1px dotted #aaa; margin-left: 22px;"> | |
250 | + <a href="javascript: return false" class="green" title="{{$translate.instant('LABEL.EXPANDIR')}}" ng-click="obterTransclude(doc)"> | |
251 | + <i class="ace-icon fa fa-2x" ng-class="{'fa-angle-double-down': doc.$expandido, 'fa-angle-double-right': !doc.$expandido}"></i> | |
252 | + </a> | |
253 | + <div ng-if="doc.$expandido" ng-include src="urlInclude"></div> | |
254 | + </div> | |
255 | + </div> | |
242 | 256 | |
243 | 257 | <div class="row"> |
244 | 258 | <div class="col-md-6"> | ... | ... |