Commit 6f2828f18d0a6b54d26545755d021d8018a0c2e5
Exists in
master
Merge branch 'desenvolvimento' into tarefa-4583
# Conflicts: # cit-ecm-api/src/main/java/br/com/centralit/api/model/DocumentoGed.java # cit-ecm-web/src/main/java/br/com/centralit/listener/StartupListenerEcm.java # cit-ecm-web/src/main/webapp/assets/css/gerenciarProcesso.css
Showing
58 changed files
with
2647 additions
and
1337 deletions
Show diff stats
cit-ecm-api/pom.xml
| 1 | 1 | <?xml version="1.0" encoding="UTF-8"?> |
| 2 | -<!-- ******************************************************************************************************************** --> | |
| 3 | -<!-- * LICENCA*GPLv2 * --> | |
| 4 | -<!-- * Copyright [2011,2012,2013,2014,2015] da CentralIT Tecnologia da Informação | |
| 5 | - Ltda (www.centralit.com.br) * --> | |
| 6 | -<!-- * * --> | |
| 7 | -<!-- * Este arquivo é parte do programa/software: Citsmart (www.citsmart.com.br) | |
| 8 | - * --> | |
| 9 | -<!-- * * --> | |
| 10 | -<!-- * O Citsmart é um software livre; você pode redistribui-lo e/ou modificá-lo | |
| 11 | - dentro dos termos da Licença * --> | |
| 12 | -<!-- * Pública Geral GNU como publicada pela Fundação do Software Livre (FSF); | |
| 13 | - na versão 2 da Licença. * --> | |
| 14 | -<!-- * * --> | |
| 15 | -<!-- * Este programa/software é distribuído na esperança que possa ser útil, | |
| 16 | - mas SEM NENHUMA GARANTIA; sem uma * --> | |
| 17 | -<!-- * garantia implícita de ADEQUAÇÃO a qualquer MERCADO ou APLICAÇÃO EM | |
| 18 | - PARTICULAR. Veja a Licença Pública Geral * --> | |
| 19 | -<!-- * GNU/GPL em português para maiores detalhes. * --> | |
| 20 | -<!-- * * --> | |
| 21 | -<!-- * Você deve ter recebido uma cópia da Licença Pública Geral GNU, sob | |
| 22 | - o título 'LICENCA.txt', junto com este * --> | |
| 23 | -<!-- * programa/software, se não, acesse o Portal do Software Público Brasileiro | |
| 24 | - no endereço www.softwarepublico.gov.br * --> | |
| 25 | -<!-- * ou escreva para a Fundação do Software Livre (FSF) Inc., 51 Franklin | |
| 26 | - St, Fifth Floor, Boston, MA 02110-1301,USA * --> | |
| 27 | -<!-- ******************************************************************************************************************** --> | |
| 2 | +<!-- ******************************************************************************************************************** --> | |
| 3 | +<!-- * LICENCA*GPLv2 * --> | |
| 4 | +<!-- * Copyright [2011,2012,2013,2014,2015] da CentralIT Tecnologia da Informação Ltda (www.centralit.com.br) * --> | |
| 5 | +<!-- * * --> | |
| 6 | +<!-- * Este arquivo é parte do programa/software: Citsmart (www.citsmart.com.br) * --> | |
| 7 | +<!-- * * --> | |
| 8 | +<!-- * O Citsmart é um software livre; você pode redistribui-lo e/ou modificá-lo dentro dos termos da Licença * --> | |
| 9 | +<!-- * Pública Geral GNU como publicada pela Fundação do Software Livre (FSF); na versão 2 da Licença. * --> | |
| 10 | +<!-- * * --> | |
| 11 | +<!-- * Este programa/software é distribuído na esperança que possa ser útil, mas SEM NENHUMA GARANTIA; sem uma * --> | |
| 12 | +<!-- * garantia implícita de ADEQUAÇÃO a qualquer MERCADO ou APLICAÇÃO EM PARTICULAR. Veja a Licença Pública Geral * --> | |
| 13 | +<!-- * GNU/GPL em português para maiores detalhes. * --> | |
| 14 | +<!-- * * --> | |
| 15 | +<!-- * Você deve ter recebido uma cópia da Licença Pública Geral GNU, sob o título 'LICENCA.txt', junto com este * --> | |
| 16 | +<!-- * programa/software, se não, acesse o Portal do Software Público Brasileiro no endereço www.softwarepublico.gov.br * --> | |
| 17 | +<!-- * ou escreva para a Fundação do Software Livre (FSF) Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,USA * --> | |
| 18 | +<!-- ******************************************************************************************************************** --> | |
| 28 | 19 | <project |
| 29 | 20 | xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" |
| 30 | 21 | xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> |
| ... | ... | @@ -49,17 +40,17 @@ |
| 49 | 40 | <dependency> |
| 50 | 41 | <groupId>br.com.centralit</groupId> |
| 51 | 42 | <artifactId>cit-core</artifactId> |
| 52 | - <version>${project.version}</version> | |
| 43 | + <version>${cit-core.version}</version> | |
| 53 | 44 | </dependency> |
| 54 | 45 | <dependency> |
| 55 | 46 | <groupId>br.com.centralit</groupId> |
| 56 | 47 | <artifactId>cit-portal-api</artifactId> |
| 57 | - <version>${project.version}</version> | |
| 48 | + <version>${cit-portal.version}</version> | |
| 58 | 49 | </dependency> |
| 59 | 50 | <dependency> |
| 60 | 51 | <groupId>br.com.centralit</groupId> |
| 61 | 52 | <artifactId>cit-tabelas-corp-api</artifactId> |
| 62 | - <version>${project.version}</version> | |
| 53 | + <version>${cit-tabelas-corp.version}</version> | |
| 63 | 54 | </dependency> |
| 64 | 55 | <dependency> |
| 65 | 56 | <groupId>org.json</groupId> |
| ... | ... | @@ -90,6 +81,11 @@ |
| 90 | 81 | <groupId>com.googlecode.json-simple</groupId> |
| 91 | 82 | <artifactId>json-simple</artifactId> |
| 92 | 83 | <version>1.1</version> |
| 84 | + </dependency> | |
| 85 | + <dependency> | |
| 86 | + <groupId>org.jsoup</groupId> | |
| 87 | + <artifactId>jsoup</artifactId> | |
| 88 | + <version>1.8.3</version> | |
| 93 | 89 | </dependency> |
| 94 | 90 | </dependencies> |
| 95 | 91 | </project> | ... | ... |
cit-ecm-api/src/main/java/br/com/centralit/api/dao/DocumentoGedDao.java
| ... | ... | @@ -120,34 +120,43 @@ public interface DocumentoGedDao extends CitGenericDAO { |
| 120 | 120 | * @return Collection<Processo> |
| 121 | 121 | */ |
| 122 | 122 | Collection<DocumentoGed> findPorPlanoClassificacao(Long idPlanoClassificacao); |
| 123 | - | |
| 123 | + | |
| 124 | 124 | /** |
| 125 | 125 | * |
| 126 | - * <p><b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a></p> | |
| 127 | - * | |
| 128 | - * <p><b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a></p> | |
| 129 | - * | |
| 126 | + * <p> | |
| 127 | + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a> | |
| 128 | + * </p> | |
| 129 | + * | |
| 130 | + * <p> | |
| 131 | + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> | |
| 132 | + * </p> | |
| 133 | + * | |
| 130 | 134 | * Método responsável por |
| 131 | - * | |
| 135 | + * | |
| 132 | 136 | * @author andre.silva |
| 133 | - * | |
| 137 | + * | |
| 134 | 138 | * @param idProcesso |
| 135 | 139 | * @return |
| 136 | 140 | */ |
| 137 | 141 | Collection<DocumentoGed> findByProcessoSigilo(Long idProcesso); |
| 138 | 142 | |
| 139 | 143 | /** |
| 144 | + * <p> | |
| 145 | + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a> | |
| 146 | + * </p> | |
| 140 | 147 | * |
| 141 | - * <p><b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a></p> | |
| 142 | - * | |
| 143 | - * <p><b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a></p> | |
| 144 | - * | |
| 145 | - * Método responsável por | |
| 146 | - * | |
| 147 | - * @author andre.silva | |
| 148 | - * | |
| 149 | - * @param documentoGed | |
| 150 | - * @return | |
| 148 | + * <p> | |
| 149 | + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> | |
| 150 | + * </p> | |
| 151 | + * | |
| 152 | + * Método responsável por verificar se o documento é sigiloso através do id | |
| 153 | + * | |
| 154 | + * @author rogerio.costa | |
| 155 | + * | |
| 156 | + * @param id | |
| 157 | + * | |
| 158 | + * @return Sigilo | |
| 151 | 159 | */ |
| 152 | - Boolean isDocumentoAbertoEmOutrasUnidades(DocumentoGed documentoGed); | |
| 160 | + Boolean isSigiloso(Long id); | |
| 161 | + | |
| 153 | 162 | } | ... | ... |
cit-ecm-api/src/main/java/br/com/centralit/api/dao/ProcessoDao.java
| ... | ... | @@ -155,5 +155,23 @@ public interface ProcessoDao extends CitGenericDAO { |
| 155 | 155 | * @return <RT> SearchResult<RT> |
| 156 | 156 | */ |
| 157 | 157 | <RT> SearchResult<RT> searchAndCountPorSigilo(ISearch search); |
| 158 | - | |
| 158 | + | |
| 159 | + /** | |
| 160 | + * <p> | |
| 161 | + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a> | |
| 162 | + * </p> | |
| 163 | + * | |
| 164 | + * <p> | |
| 165 | + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> | |
| 166 | + * </p> | |
| 167 | + * | |
| 168 | + * Método responsável por verificar se o processo é sigiloso | |
| 169 | + * | |
| 170 | + * @author rogerio.costa | |
| 171 | + * | |
| 172 | + * @param id | |
| 173 | + * @return | |
| 174 | + */ | |
| 175 | + boolean isSigiloso(Long id); | |
| 176 | + | |
| 159 | 177 | } | ... | ... |
cit-ecm-api/src/main/java/br/com/centralit/api/dao/TarjaAssinaturaDao.java
0 → 100644
| ... | ... | @@ -0,0 +1,19 @@ |
| 1 | +package br.com.centralit.api.dao; | |
| 2 | + | |
| 3 | +import br.com.centralit.framework.dao.arquitetura.CitGenericDAO; | |
| 4 | + | |
| 5 | + | |
| 6 | +/** | |
| 7 | + * <p><img src="http://centralit.com.br/images/logo_central.png"></p> | |
| 8 | + * | |
| 9 | + * <p><b>Company: </b> Central IT - Governança Corporativa - </p> | |
| 10 | + * | |
| 11 | + * <p><b>Description: </b></p> | |
| 12 | + * Interface DAO para iteração com banco de dados para os objetos de {@link TarjaAssinaturaDao} | |
| 13 | + * | |
| 14 | + * @since 14 de abr de 2016 - 10:21:47 | |
| 15 | + * @version 1.0.0 | |
| 16 | + * @author ciro.junior (<a href="mailto:ciro.junior@centralit.com.br">ciro.junior@centralit.com.br</a>) | |
| 17 | + * | |
| 18 | + */ | |
| 19 | +public interface TarjaAssinaturaDao extends CitGenericDAO {} | ... | ... |
cit-ecm-api/src/main/java/br/com/centralit/api/dao/TarjaAssinaturaDaoHibernate.java
0 → 100644
| ... | ... | @@ -0,0 +1,28 @@ |
| 1 | +package br.com.centralit.api.dao; | |
| 2 | + | |
| 3 | +import org.springframework.stereotype.Repository; | |
| 4 | + | |
| 5 | +import br.com.centralit.api.model.TarjaAssinatura; | |
| 6 | +import br.com.centralit.framework.dao.arquitetura.CitGenericDAOImpl; | |
| 7 | + | |
| 8 | +/** | |
| 9 | + * <p><img src="http://centralit.com.br/images/logo_central.png"></p> | |
| 10 | + * | |
| 11 | + * <p><b>Company: </b> Central IT - Governança Corporativa - </p> | |
| 12 | + * | |
| 13 | + * <p><b>Description: </b></p> | |
| 14 | + * Interface DAO para iteração com banco de dados para os objetos de {@link TarjaAssinaturaDao} | |
| 15 | + * | |
| 16 | + * @since 14 de abr de 2016 - 10:21:47 | |
| 17 | + * @version 1.0.0 | |
| 18 | + * @author ciro.junior (<a href="mailto:ciro.junior@centralit.com.br">ciro.junior@centralit.com.br</a>) | |
| 19 | + * | |
| 20 | + */ | |
| 21 | +@Repository("tarjaAssinaturaDao") | |
| 22 | +public class TarjaAssinaturaDaoHibernate extends CitGenericDAOImpl implements TarjaAssinaturaDao { | |
| 23 | + | |
| 24 | + public TarjaAssinaturaDaoHibernate() { | |
| 25 | + super(TarjaAssinatura.class); | |
| 26 | + } | |
| 27 | + | |
| 28 | +} | ... | ... |
cit-ecm-api/src/main/java/br/com/centralit/api/dao/UnidadeProcessoDao.java
| ... | ... | @@ -2,14 +2,14 @@ package br.com.centralit.api.dao; |
| 2 | 2 | |
| 3 | 3 | import java.util.Collection; |
| 4 | 4 | |
| 5 | -import com.googlecode.genericdao.search.ISearch; | |
| 6 | -import com.googlecode.genericdao.search.SearchResult; | |
| 7 | - | |
| 8 | 5 | import br.com.centralit.api.model.Processo; |
| 9 | 6 | import br.com.centralit.api.model.UnidadeProcesso; |
| 10 | 7 | import br.com.centralit.framework.dao.arquitetura.CitGenericDAO; |
| 11 | 8 | import br.com.centralit.framework.model.Usuario; |
| 12 | 9 | |
| 10 | +import com.googlecode.genericdao.search.ISearch; | |
| 11 | +import com.googlecode.genericdao.search.SearchResult; | |
| 12 | + | |
| 13 | 13 | /** |
| 14 | 14 | * <p> |
| 15 | 15 | * <img src="http://centralit.com.br/images/logo_central.png"> |
| ... | ... | @@ -118,9 +118,10 @@ public interface UnidadeProcessoDao extends CitGenericDAO { |
| 118 | 118 | * @return UnidadeProcesso |
| 119 | 119 | */ |
| 120 | 120 | UnidadeProcesso obterPorUnidadeEProcesso(Long idProcesso, Long idUnidade); |
| 121 | - | |
| 121 | + | |
| 122 | 122 | /** |
| 123 | 123 | * Método responsável por listar processos através da unidade do usuário |
| 124 | + * | |
| 124 | 125 | * @author rogerio.cassimiro |
| 125 | 126 | * @param search |
| 126 | 127 | * @param usuario |
| ... | ... | @@ -128,5 +129,24 @@ public interface UnidadeProcessoDao extends CitGenericDAO { |
| 128 | 129 | * @return <RT> SearchResult<RT> |
| 129 | 130 | */ |
| 130 | 131 | <RT> SearchResult<RT> searchAndCountPorUnidade(ISearch search, Usuario usuario, Long idStatus); |
| 131 | - | |
| 132 | + | |
| 133 | + /** | |
| 134 | + * <p> | |
| 135 | + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a> | |
| 136 | + * </p> | |
| 137 | + * | |
| 138 | + * <p> | |
| 139 | + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> | |
| 140 | + * </p> | |
| 141 | + * | |
| 142 | + * Método responsável por verificar se o processo foi enviado para outra unidade | |
| 143 | + * | |
| 144 | + * @author rogerio.costa | |
| 145 | + * | |
| 146 | + * @param idProcesso | |
| 147 | + * | |
| 148 | + * @return Boolean | |
| 149 | + */ | |
| 150 | + Boolean isProcessoEnviado(Long idProcesso); | |
| 151 | + | |
| 132 | 152 | } | ... | ... |
cit-ecm-api/src/main/java/br/com/centralit/api/dao/impl/DocumentoGedDaoHibernate.java
| ... | ... | @@ -16,13 +16,50 @@ import br.com.centralit.api.model.SigiloPrivilegio; |
| 16 | 16 | import br.com.centralit.framework.dao.arquitetura.CitGenericDAOImpl; |
| 17 | 17 | import br.com.centralit.framework.dao.arquitetura.SearchSeven; |
| 18 | 18 | import br.com.centralit.framework.model.Usuario; |
| 19 | +import br.com.centralit.framework.util.UtilObjeto; | |
| 19 | 20 | |
| 20 | 21 | import com.googlecode.genericdao.search.Filter; |
| 21 | 22 | import com.googlecode.genericdao.search.Sort; |
| 22 | 23 | |
| 24 | +/** | |
| 25 | + * <p> | |
| 26 | + * <img src="http://centralit.com.br/images/logo_central.png"> | |
| 27 | + * </p> | |
| 28 | + * | |
| 29 | + * <p> | |
| 30 | + * <b>Company: </b> Central IT - Governança Corporativa - | |
| 31 | + * </p> | |
| 32 | + * | |
| 33 | + * <p> | |
| 34 | + * <b>Title: </b> | |
| 35 | + * </p> | |
| 36 | + * | |
| 37 | + * <p> | |
| 38 | + * <b>Description: </b> | |
| 39 | + * </p> | |
| 40 | + * | |
| 41 | + * <p> | |
| 42 | + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a> | |
| 43 | + * </p> | |
| 44 | + * | |
| 45 | + * <p> | |
| 46 | + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> | |
| 47 | + * </p> | |
| 48 | + * | |
| 49 | + * @since 23/04/2016 - 16:52:47 | |
| 50 | + * | |
| 51 | + * @version 1.0.0 | |
| 52 | + * | |
| 53 | + * @author rogerio.costa | |
| 54 | + * | |
| 55 | + */ | |
| 23 | 56 | @Repository("documentoGedDao") |
| 57 | +@SuppressWarnings("unchecked") | |
| 24 | 58 | public class DocumentoGedDaoHibernate extends CitGenericDAOImpl implements DocumentoGedDao { |
| 25 | 59 | |
| 60 | + /** | |
| 61 | + * Responsável pela criação de novas instâncias desta classe. | |
| 62 | + */ | |
| 26 | 63 | public DocumentoGedDaoHibernate() { |
| 27 | 64 | |
| 28 | 65 | super(DocumentoGed.class); |
| ... | ... | @@ -69,6 +106,7 @@ public class DocumentoGedDaoHibernate extends CitGenericDAOImpl implements Docum |
| 69 | 106 | searchSeven.addFilterOr(Filter.equal("id", id), Filter.equal("idRaiz", id)); |
| 70 | 107 | |
| 71 | 108 | searchSeven.addSort(Sort.asc("versaoDocumento")); |
| 109 | + | |
| 72 | 110 | searchSeven.addFilterNotEmpty("dataInativo"); |
| 73 | 111 | |
| 74 | 112 | return this.search(searchSeven); |
| ... | ... | @@ -168,25 +206,38 @@ public class DocumentoGedDaoHibernate extends CitGenericDAOImpl implements Docum |
| 168 | 206 | } |
| 169 | 207 | |
| 170 | 208 | /** |
| 209 | + * <p> | |
| 210 | + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a> | |
| 211 | + * </p> | |
| 212 | + * | |
| 213 | + * <p> | |
| 214 | + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> | |
| 215 | + * </p> | |
| 216 | + * | |
| 217 | + * Método responsável por verificar se o documento é sigiloso através do id | |
| 218 | + * | |
| 219 | + * @author rogerio.costa | |
| 171 | 220 | * |
| 221 | + * @param id | |
| 222 | + * | |
| 223 | + * @return Sigilo | |
| 172 | 224 | */ |
| 173 | - @Override | |
| 174 | - public Boolean isDocumentoAbertoEmOutrasUnidades(DocumentoGed documentoGed) { | |
| 225 | + public Boolean isSigiloso(Long id) { | |
| 175 | 226 | |
| 176 | - Session session = (Session) this.em().getDelegate(); | |
| 227 | + Criteria criteria = this.newCriteria(); | |
| 177 | 228 | |
| 178 | - Criteria criteria = session.createCriteria(persistentClass); | |
| 229 | + criteria.setProjection(Projections.id()); | |
| 179 | 230 | |
| 180 | - criteria.setProjection(Projections.rowCount()); | |
| 231 | + criteria.add(Restrictions.eq("id", id)); | |
| 232 | + | |
| 233 | + criteria.add(Restrictions.isNotNull("sigilo")); | |
| 181 | 234 | |
| 182 | - criteria.add(Restrictions.eq("id", documentoGed.getId())); | |
| 183 | - criteria.add(Restrictions.ne("unidade.id", documentoGed.getUnidade().getId())); | |
| 235 | + criteria.setMaxResults(1); | |
| 184 | 236 | |
| 185 | - return (Long) criteria.uniqueResult() > 0; | |
| 237 | + return UtilObjeto.isReferencia(criteria.uniqueResult()); | |
| 186 | 238 | |
| 187 | 239 | } |
| 188 | 240 | |
| 189 | - @SuppressWarnings("unchecked") | |
| 190 | 241 | @Override |
| 191 | 242 | public Collection<DocumentoGed> findByProcessoSigilo(Long idProcesso) { |
| 192 | 243 | |
| ... | ... | @@ -206,11 +257,16 @@ public class DocumentoGedDaoHibernate extends CitGenericDAOImpl implements Docum |
| 206 | 257 | |
| 207 | 258 | criteriaPrivilegio.add(Restrictions.eq("grupoUsuario.usuario.id", idUsuario)); |
| 208 | 259 | |
| 209 | - Session session = (Session) this.em().getDelegate(); | |
| 210 | - | |
| 211 | - Criteria criteria = session.createCriteria(persistentClass); | |
| 260 | + Criteria criteria = this.newCriteria(); | |
| 212 | 261 | |
| 213 | 262 | criteria.add(Restrictions.eq("processo.id", idProcesso)); |
| 263 | + | |
| 264 | + criteria.add(Restrictions.isNull("dataInativo")); | |
| 265 | + | |
| 266 | + criteria.createAlias("status", "status"); | |
| 267 | + | |
| 268 | + criteria.add(Restrictions.eq("status.codigo", 0L)); | |
| 269 | + | |
| 214 | 270 | criteria.add(Restrictions.in("sigilo.id", criteriaPrivilegio.list())); |
| 215 | 271 | |
| 216 | 272 | return criteria.list(); | ... | ... |
cit-ecm-api/src/main/java/br/com/centralit/api/dao/impl/NivelAcessoTipoProcessoDaoHibernate.java
| ... | ... | @@ -73,7 +73,8 @@ public class NivelAcessoTipoProcessoDaoHibernate extends CitGenericDAOImpl imple |
| 73 | 73 | SearchSeven search = new SearchSeven(); |
| 74 | 74 | |
| 75 | 75 | search.addFilterEqual("tipoProcesso.id", idTipoProcesso); |
| 76 | - | |
| 76 | + search.addSortAsc("nivelAcesso.nome"); | |
| 77 | + | |
| 77 | 78 | return this.search(search); |
| 78 | 79 | |
| 79 | 80 | } | ... | ... |
cit-ecm-api/src/main/java/br/com/centralit/api/dao/impl/ProcessoDaoHibernate.java
| ... | ... | @@ -3,10 +3,16 @@ package br.com.centralit.api.dao.impl; |
| 3 | 3 | import java.util.Calendar; |
| 4 | 4 | import java.util.Collection; |
| 5 | 5 | |
| 6 | +import javax.persistence.FetchType; | |
| 7 | + | |
| 6 | 8 | import org.hibernate.Criteria; |
| 7 | 9 | import org.hibernate.Session; |
| 10 | +import org.hibernate.criterion.DetachedCriteria; | |
| 8 | 11 | import org.hibernate.criterion.Projections; |
| 9 | 12 | import org.hibernate.criterion.Restrictions; |
| 13 | +import org.hibernate.criterion.Subqueries; | |
| 14 | +import org.hibernate.sql.JoinType; | |
| 15 | +import org.hibernate.transform.ResultTransformer; | |
| 10 | 16 | import org.springframework.security.core.context.SecurityContextHolder; |
| 11 | 17 | import org.springframework.stereotype.Repository; |
| 12 | 18 | |
| ... | ... | @@ -16,6 +22,7 @@ import br.com.centralit.api.model.SigiloPrivilegio; |
| 16 | 22 | import br.com.centralit.framework.dao.arquitetura.CitGenericDAOImpl; |
| 17 | 23 | import br.com.centralit.framework.dao.arquitetura.SearchSeven; |
| 18 | 24 | import br.com.centralit.framework.model.Usuario; |
| 25 | +import br.com.centralit.framework.util.UtilObjeto; | |
| 19 | 26 | |
| 20 | 27 | import com.googlecode.genericdao.search.Filter; |
| 21 | 28 | import com.googlecode.genericdao.search.ISearch; |
| ... | ... | @@ -191,25 +198,53 @@ public class ProcessoDaoHibernate extends CitGenericDAOImpl implements ProcessoD |
| 191 | 198 | |
| 192 | 199 | Long idUsuario = ( (Usuario) SecurityContextHolder.getContext().getAuthentication().getPrincipal() ).getId(); |
| 193 | 200 | |
| 194 | - Criteria criteriaPrivilegio = this.newCriteria(SigiloPrivilegio.class); | |
| 201 | + Criteria criteria = this.newCriteria(); | |
| 202 | + | |
| 203 | + DetachedCriteria detachedCriteriaPrivilegio = DetachedCriteria.forClass(SigiloPrivilegio.class); | |
| 204 | + | |
| 205 | + detachedCriteriaPrivilegio.setProjection(Projections.property("sigilo.id")); | |
| 206 | + | |
| 207 | + detachedCriteriaPrivilegio.createAlias("privilegio", "privilegio"); | |
| 195 | 208 | |
| 196 | - criteriaPrivilegio.setProjection(Projections.property("sigilo.id")); | |
| 209 | + detachedCriteriaPrivilegio.createAlias("privilegio.grupoPrivilegios", "grupoPrivilegio"); | |
| 197 | 210 | |
| 198 | - criteriaPrivilegio.createAlias("privilegio", "privilegio"); | |
| 211 | + detachedCriteriaPrivilegio.add(Restrictions.isNull("grupoPrivilegio.dataInativo")); | |
| 199 | 212 | |
| 200 | - criteriaPrivilegio.createAlias("privilegio.grupoPrivilegios", "grupoPrivilegio"); | |
| 213 | + detachedCriteriaPrivilegio.createCriteria("grupoPrivilegio.grupo").createAlias("grupoUsuarios", "grupoUsuario"); | |
| 201 | 214 | |
| 202 | - criteriaPrivilegio.add(Restrictions.isNull("grupoPrivilegio.dataInativo")); | |
| 215 | + detachedCriteriaPrivilegio.add(Restrictions.isNull("grupoUsuario.dataInativo")); | |
| 203 | 216 | |
| 204 | - criteriaPrivilegio.createCriteria("grupoPrivilegio.grupo").createAlias("grupoUsuarios", "grupoUsuario"); | |
| 217 | + detachedCriteriaPrivilegio.add(Restrictions.eq("grupoUsuario.usuario.id", idUsuario)); | |
| 205 | 218 | |
| 206 | - criteriaPrivilegio.add(Restrictions.isNull("grupoUsuario.dataInativo")); | |
| 219 | + criteria.add(Subqueries.propertyIn("sigilo.id", detachedCriteriaPrivilegio)); | |
| 207 | 220 | |
| 208 | - criteriaPrivilegio.add(Restrictions.eq("grupoUsuario.usuario.id", idUsuario)); | |
| 221 | + criteria.createAlias("documentos", "documentos", JoinType.LEFT_OUTER_JOIN); | |
| 222 | + | |
| 223 | + criteria.createAlias("documentos.status", "statusDocumento", JoinType.LEFT_OUTER_JOIN); | |
| 224 | + | |
| 225 | + criteria.add(Restrictions.or(Restrictions.eq("statusDocumento.codigo", 0L), Restrictions.isNull("validado"), Restrictions.eq("validado", false))); | |
| 209 | 226 | |
| 210 | - search.getFilters().add(Filter.in("sigilo.id", criteriaPrivilegio.list())); | |
| 227 | + criteria.setProjection(Projections.distinct(Projections.property("id"))); | |
| 228 | + | |
| 229 | + search.getFilters().add(Filter.in("id", criteria.list())); | |
| 211 | 230 | |
| 212 | 231 | return super.searchAndCount(search); |
| 213 | 232 | } |
| 214 | - | |
| 233 | + | |
| 234 | + @Override | |
| 235 | + public boolean isSigiloso(Long id) { | |
| 236 | + | |
| 237 | + Criteria criteria = this.newCriteria(); | |
| 238 | + | |
| 239 | + criteria.setProjection(Projections.id()); | |
| 240 | + | |
| 241 | + criteria.add(Restrictions.eq("id", id)); | |
| 242 | + | |
| 243 | + criteria.add(Restrictions.isNotNull("sigilo")); | |
| 244 | + | |
| 245 | + criteria.setMaxResults(1); | |
| 246 | + | |
| 247 | + return UtilObjeto.isReferencia(criteria.uniqueResult()); | |
| 248 | + } | |
| 249 | + | |
| 215 | 250 | } | ... | ... |
cit-ecm-api/src/main/java/br/com/centralit/api/dao/impl/UnidadeProcessoDaoHibernate.java
| ... | ... | @@ -3,11 +3,15 @@ package br.com.centralit.api.dao.impl; |
| 3 | 3 | import java.util.Collection; |
| 4 | 4 | |
| 5 | 5 | import org.hibernate.Criteria; |
| 6 | +import org.hibernate.criterion.DetachedCriteria; | |
| 6 | 7 | import org.hibernate.criterion.Projections; |
| 7 | 8 | import org.hibernate.criterion.Restrictions; |
| 9 | +import org.hibernate.criterion.Subqueries; | |
| 10 | +import org.hibernate.sql.JoinType; | |
| 8 | 11 | import org.springframework.stereotype.Repository; |
| 9 | 12 | |
| 10 | 13 | import br.com.centralit.api.dao.UnidadeProcessoDao; |
| 14 | +import br.com.centralit.api.model.CredencialProcesso; | |
| 11 | 15 | import br.com.centralit.api.model.Processo; |
| 12 | 16 | import br.com.centralit.api.model.SigiloPrivilegio; |
| 13 | 17 | import br.com.centralit.api.model.UnidadeProcesso; |
| ... | ... | @@ -15,6 +19,7 @@ import br.com.centralit.framework.dao.arquitetura.CitGenericDAOImpl; |
| 15 | 19 | import br.com.centralit.framework.dao.arquitetura.SearchSeven; |
| 16 | 20 | import br.com.centralit.framework.model.Usuario; |
| 17 | 21 | import br.com.centralit.framework.util.UtilColecao; |
| 22 | +import br.com.centralit.framework.util.UtilObjeto; | |
| 18 | 23 | |
| 19 | 24 | import com.googlecode.genericdao.search.Filter; |
| 20 | 25 | import com.googlecode.genericdao.search.ISearch; |
| ... | ... | @@ -154,6 +159,35 @@ public class UnidadeProcessoDaoHibernate extends CitGenericDAOImpl implements Un |
| 154 | 159 | * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> |
| 155 | 160 | * </p> |
| 156 | 161 | * |
| 162 | + * Método responsável por verificar se o processo foi enviado para outra unidade | |
| 163 | + * | |
| 164 | + * @author rogerio.costa | |
| 165 | + * | |
| 166 | + * @param idProcesso | |
| 167 | + * | |
| 168 | + * @return Boolean | |
| 169 | + */ | |
| 170 | + public Boolean isProcessoEnviado(Long idProcesso) { | |
| 171 | + | |
| 172 | + Criteria criteria = this.newCriteria(); | |
| 173 | + | |
| 174 | + criteria.setProjection(Projections.id()); | |
| 175 | + criteria.add(Restrictions.eq("processo.id", idProcesso)); | |
| 176 | + criteria.add(Restrictions.isNull("dataInativo")); | |
| 177 | + | |
| 178 | + return criteria.list().size() > 1; | |
| 179 | + | |
| 180 | + } | |
| 181 | + | |
| 182 | + /** | |
| 183 | + * <p> | |
| 184 | + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a> | |
| 185 | + * </p> | |
| 186 | + * | |
| 187 | + * <p> | |
| 188 | + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> | |
| 189 | + * </p> | |
| 190 | + * | |
| 157 | 191 | * Método responsável por obter através da unidade e processo |
| 158 | 192 | * |
| 159 | 193 | * @author rogerio.costa |
| ... | ... | @@ -178,6 +212,7 @@ public class UnidadeProcessoDaoHibernate extends CitGenericDAOImpl implements Un |
| 178 | 212 | |
| 179 | 213 | /** |
| 180 | 214 | * Método responsável por listar processos através da unidade do usuário |
| 215 | + * | |
| 181 | 216 | * @author rogerio.cassimiro |
| 182 | 217 | * @param search |
| 183 | 218 | * @param usuario |
| ... | ... | @@ -186,25 +221,104 @@ public class UnidadeProcessoDaoHibernate extends CitGenericDAOImpl implements Un |
| 186 | 221 | */ |
| 187 | 222 | @Override |
| 188 | 223 | public <RT> SearchResult<RT> searchAndCountPorUnidade(ISearch search, Usuario usuario, Long idStatus) { |
| 189 | - | |
| 224 | + | |
| 225 | + // Filtro de permissões herdadas através de grupos | |
| 226 | + DetachedCriteria detachedCriteriaPrivilegio = findSigiloUsuarioContemPermissaoAtravesDosGrupos(usuario); | |
| 227 | + | |
| 228 | + // Filtro da credencial do processo | |
| 229 | + DetachedCriteria detachedCredencialProcesso = findProcessoSigilosoPorCredencial(usuario); | |
| 230 | + | |
| 231 | + // Filtro da unidade, para processos públicos e restritos. | |
| 190 | 232 | search.getFilters().add(Filter.or(Filter.not(Filter.equal("processo.status.id", idStatus)), Filter.isEmpty("processo.status.id"))); |
| 191 | - | |
| 192 | - Criteria criteriaPrivilegio = this.newCriteria(SigiloPrivilegio.class); | |
| 193 | - criteriaPrivilegio.setProjection(Projections.property("sigilo.id")); | |
| 194 | - criteriaPrivilegio.createAlias("privilegio", "privilegio"); | |
| 195 | - criteriaPrivilegio.createAlias("privilegio.grupoPrivilegios", "grupoPrivilegio"); | |
| 196 | - criteriaPrivilegio.add(Restrictions.isNull("grupoPrivilegio.dataInativo")); | |
| 197 | - criteriaPrivilegio.createCriteria("grupoPrivilegio.grupo").createAlias("grupoUsuarios", "grupoUsuario"); | |
| 198 | - criteriaPrivilegio.add(Restrictions.isNull("grupoUsuario.dataInativo")); | |
| 199 | - criteriaPrivilegio.add(Restrictions.eq("grupoUsuario.usuario.id", usuario.getId())); | |
| 200 | - | |
| 201 | - search.getFilters().add(Filter.equal("processo.autor.id", usuario.getId())); | |
| 233 | + | |
| 234 | + // Verifica se o usuario está lotado na unidade | |
| 235 | + if (UtilObjeto.isReferencia(usuario.getUnidade())) { | |
| 236 | + | |
| 237 | + search.getFilters().add(Filter.equal("unidade.id", usuario.getUnidade().getId())); | |
| 238 | + } | |
| 239 | + | |
| 240 | + Criteria criteriaProcessoSigiloso = this.newCriteria(Processo.class); | |
| 241 | + | |
| 242 | + criteriaProcessoSigiloso.setProjection(Projections.property("id")); | |
| 243 | + | |
| 244 | + criteriaProcessoSigiloso.add(Restrictions.or(Subqueries.propertyIn("sigilo.id", detachedCriteriaPrivilegio), Subqueries.propertyIn("id", detachedCredencialProcesso))); | |
| 245 | + | |
| 202 | 246 | search.getFilters().add(Filter.isNotNull("processo.idProcessInstance")); |
| 203 | -// search.getFilters().add(Filter.or( | |
| 204 | -// Filter.in("processo.autor.id", usuario.getId()), | |
| 205 | -// Filter.in("unidade.id", usuario.getUnidade().getId()), | |
| 206 | -// Filter.in("processo.sigilo.id", criteriaPrivilegio.list()))); | |
| 207 | -// | |
| 247 | + | |
| 248 | + search.getFilters().add(Filter.or(Filter.equal("processo.autor.id", usuario.getId()), Filter.isNull("processo.sigilo"), Filter.in("processo.id", criteriaProcessoSigiloso.list()))); | |
| 249 | + | |
| 208 | 250 | return super.searchAndCount(search); |
| 209 | 251 | } |
| 252 | + | |
| 253 | + /** | |
| 254 | + * <p> | |
| 255 | + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a> | |
| 256 | + * </p> | |
| 257 | + * | |
| 258 | + * <p> | |
| 259 | + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> | |
| 260 | + * </p> | |
| 261 | + * | |
| 262 | + * Método responsável por retornar os ids dos processo sigilosos que o usuário tem permissão, adicionado diretamente para o usuário e grupo que o mesmo está vinculado. | |
| 263 | + * | |
| 264 | + * @author rogerio.costa | |
| 265 | + * | |
| 266 | + * @param usuario | |
| 267 | + * @return DetachedCriteria/ Processo.id | |
| 268 | + */ | |
| 269 | + private DetachedCriteria findProcessoSigilosoPorCredencial(Usuario usuario) { | |
| 270 | + | |
| 271 | + DetachedCriteria detachedCredencialProcesso = DetachedCriteria.forClass(CredencialProcesso.class); | |
| 272 | + | |
| 273 | + detachedCredencialProcesso.setProjection(Projections.property("processo.id")); | |
| 274 | + | |
| 275 | + detachedCredencialProcesso.createAlias("grupo", "grupo", JoinType.LEFT_OUTER_JOIN); | |
| 276 | + | |
| 277 | + detachedCredencialProcesso.createAlias("grupo.grupoUsuarios", "grupoUsuario", JoinType.LEFT_OUTER_JOIN); | |
| 278 | + | |
| 279 | + detachedCredencialProcesso.add(Restrictions.isNull("grupoUsuario.dataInativo")); | |
| 280 | + | |
| 281 | + detachedCredencialProcesso.add(Restrictions.or(Restrictions.eq("grupoUsuario.usuario.id", usuario.getId()), Restrictions.eq("usuario.id", usuario.getId()))); | |
| 282 | + | |
| 283 | + detachedCredencialProcesso.add(Restrictions.isNull("dataInativo")); | |
| 284 | + | |
| 285 | + return detachedCredencialProcesso; | |
| 286 | + } | |
| 287 | + | |
| 288 | + /** | |
| 289 | + * <p> | |
| 290 | + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a> | |
| 291 | + * </p> | |
| 292 | + * | |
| 293 | + * <p> | |
| 294 | + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> | |
| 295 | + * </p> | |
| 296 | + * | |
| 297 | + * Método responsável por retornar um detachedCriteria com os ids dos sigilos que o usuário tem permissão. O mesmo é consultado através dos grupos que o usuário pertence. | |
| 298 | + * | |
| 299 | + * @author rogerio.costa | |
| 300 | + * | |
| 301 | + * @param usuario | |
| 302 | + * @return DetachedCriteria/Sigilo.id | |
| 303 | + */ | |
| 304 | + private DetachedCriteria findSigiloUsuarioContemPermissaoAtravesDosGrupos(Usuario usuario) { | |
| 305 | + | |
| 306 | + DetachedCriteria detachedCriteriaPrivilegio = DetachedCriteria.forClass(SigiloPrivilegio.class); | |
| 307 | + | |
| 308 | + detachedCriteriaPrivilegio.setProjection(Projections.property("sigilo.id")); | |
| 309 | + | |
| 310 | + detachedCriteriaPrivilegio.createAlias("privilegio", "privilegio"); | |
| 311 | + | |
| 312 | + detachedCriteriaPrivilegio.createAlias("privilegio.grupoPrivilegios", "grupoPrivilegio"); | |
| 313 | + | |
| 314 | + detachedCriteriaPrivilegio.add(Restrictions.isNull("grupoPrivilegio.dataInativo")); | |
| 315 | + | |
| 316 | + detachedCriteriaPrivilegio.createCriteria("grupoPrivilegio.grupo").createAlias("grupoUsuarios", "grupoUsuario"); | |
| 317 | + | |
| 318 | + detachedCriteriaPrivilegio.add(Restrictions.isNull("grupoUsuario.dataInativo")); | |
| 319 | + | |
| 320 | + detachedCriteriaPrivilegio.add(Restrictions.eq("grupoUsuario.usuario.id", usuario.getId())); | |
| 321 | + | |
| 322 | + return detachedCriteriaPrivilegio; | |
| 323 | + } | |
| 210 | 324 | } | ... | ... |
cit-ecm-api/src/main/java/br/com/centralit/api/framework/json/ViewsEcm.java
| ... | ... | @@ -6,104 +6,109 @@ import br.com.centralit.framework.json.Views; |
| 6 | 6 | * <p> |
| 7 | 7 | * <img src="http://centralit.com.br/images/logo_central.png"> |
| 8 | 8 | * </p> |
| 9 | - * | |
| 9 | + * | |
| 10 | 10 | * <p> |
| 11 | 11 | * <b>Company: </b> Central IT - Governança Corporativa - |
| 12 | 12 | * </p> |
| 13 | - * | |
| 13 | + * | |
| 14 | 14 | * <p> |
| 15 | 15 | * <b>Title: </b> |
| 16 | 16 | * </p> |
| 17 | - * | |
| 17 | + * | |
| 18 | 18 | * <p> |
| 19 | 19 | * <b>Description: </b> |
| 20 | 20 | * </p> |
| 21 | - * | |
| 21 | + * | |
| 22 | 22 | * <p> |
| 23 | 23 | * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a> |
| 24 | 24 | * </p> |
| 25 | - * | |
| 25 | + * | |
| 26 | 26 | * <p> |
| 27 | 27 | * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> |
| 28 | 28 | * </p> |
| 29 | - * | |
| 29 | + * | |
| 30 | 30 | * @since 22/06/2015 - 15:10:43 |
| 31 | - * | |
| 31 | + * | |
| 32 | 32 | * @version 1.0.0 |
| 33 | - * | |
| 33 | + * | |
| 34 | 34 | * @author lucas.ribeiro - (<a href="mailto:lucas.ribeiro@centralit.com.br">lucas.ribeiro@centralit.com.br</a>) |
| 35 | - * | |
| 35 | + * | |
| 36 | 36 | */ |
| 37 | 37 | public class ViewsEcm extends Views { |
| 38 | 38 | |
| 39 | 39 | public static class PlanoClassificacaoListView extends Views.GenericView {}; |
| 40 | 40 | |
| 41 | 41 | public static class PlanoClassificacaoEditView extends PlanoClassificacaoListView {}; |
| 42 | - | |
| 42 | + | |
| 43 | 43 | public static class PlanoClassificacaoParent extends Views.GenericView {}; |
| 44 | - | |
| 44 | + | |
| 45 | 45 | public static class PlanoClassificacaoFilho extends Views.GenericView{}; |
| 46 | - | |
| 46 | + | |
| 47 | 47 | public static class PlanoClassificacaoAutocompleteRecursive extends Views.GenericView{}; |
| 48 | - | |
| 48 | + | |
| 49 | 49 | public static class PlanoCLassificacaoAutoComplete extends Views.GenericView{}; |
| 50 | - | |
| 50 | + | |
| 51 | 51 | public static class TipoDocumentoList extends Views.GenericView{}; |
| 52 | - | |
| 52 | + | |
| 53 | 53 | public static class TipoDocumentoEdit extends TipoDocumentoList {}; |
| 54 | - | |
| 54 | + | |
| 55 | 55 | public static class HipoteseLegalList extends Views.GenericView{}; |
| 56 | - | |
| 56 | + | |
| 57 | 57 | public static class HipoteseLegalEdit extends HipoteseLegalList {}; |
| 58 | - | |
| 58 | + | |
| 59 | 59 | public static class TipoProcessoList extends Views.GenericView{}; |
| 60 | - | |
| 60 | + | |
| 61 | 61 | public static class TipoProcessoEdit extends TipoProcessoList {}; |
| 62 | - | |
| 62 | + | |
| 63 | 63 | public static class NivelAcessoTipoDocumentoList extends Views.GenericView{}; |
| 64 | - | |
| 64 | + | |
| 65 | 65 | public static class NivelAcessoTipoDocumentoEdit extends NivelAcessoTipoDocumentoList{}; |
| 66 | - | |
| 66 | + | |
| 67 | 67 | public static class ClassificarProcessoDocumentoList extends Views.GenericView{}; |
| 68 | - | |
| 68 | + | |
| 69 | 69 | public static class ClassificarProcessoDocumento extends ClassificarProcessoDocumentoList{}; |
| 70 | - | |
| 70 | + | |
| 71 | 71 | public static class NivelAcessoTipoProcessoList extends Views.GenericView{}; |
| 72 | - | |
| 72 | + | |
| 73 | 73 | public static class NivelAcessoTipoProcessoEdit extends NivelAcessoTipoProcessoList{}; |
| 74 | - | |
| 74 | + | |
| 75 | 75 | public static class InteressadoProcessoList extends Views.GenericView{}; |
| 76 | - | |
| 76 | + | |
| 77 | 77 | public static class InteressadoProcessoEdit extends InteressadoProcessoList{}; |
| 78 | - | |
| 78 | + | |
| 79 | 79 | public static class HistoricoProcessoView extends Views.GenericView{}; |
| 80 | - | |
| 80 | + | |
| 81 | 81 | public static class CancelamentoDocumentoView extends Views.GenericView{}; |
| 82 | - | |
| 82 | + | |
| 83 | 83 | public static class TemplatePadraoListView extends Views.GenericView{}; |
| 84 | - | |
| 84 | + | |
| 85 | 85 | public static class TemplatePadraoEditView extends ViewsEcm.TemplatePadraoListView{}; |
| 86 | - | |
| 86 | + | |
| 87 | 87 | public static class CabecalhoListView extends Views.GenericView{}; |
| 88 | - | |
| 88 | + | |
| 89 | 89 | public static class CabecalhoEditView extends ViewsEcm.CabecalhoListView{}; |
| 90 | - | |
| 90 | + | |
| 91 | 91 | public static class CabecalhoAutoCompleteView extends Views.GenericView{}; |
| 92 | - | |
| 92 | + | |
| 93 | 93 | public static class RodapeListView extends Views.GenericView{}; |
| 94 | - | |
| 94 | + | |
| 95 | 95 | public static class RodapeEditView extends ViewsEcm.RodapeListView{}; |
| 96 | - | |
| 96 | + | |
| 97 | 97 | public static class RodapeAutoCompleteView extends Views.GenericView{}; |
| 98 | - | |
| 98 | + | |
| 99 | 99 | public static class TipoDocumentoPlanoClassificacaoAutoCompleteView extends Views.GenericView{}; |
| 100 | 100 | |
| 101 | 101 | public static class ClassificacaoDocumentoGedView extends Views.GenericView{}; |
| 102 | 102 | |
| 103 | 103 | public static class HistoricoAtribuicaoProcessoView extends Views.GenericView{}; |
| 104 | - | |
| 104 | + | |
| 105 | 105 | public static class TipoSuporteDocumentoListView extends Views.GenericView{}; |
| 106 | - | |
| 106 | + | |
| 107 | 107 | public static class TipoSuporteDocumentoEdit extends TipoSuporteDocumentoListView{}; |
| 108 | + | |
| 109 | + public static class TarjaAssinaturaListview extends Views.GenericView{}; | |
| 110 | + | |
| 111 | + public static class TarjaAssinaturaEditview extends ViewsEcm.TarjaAssinaturaListview{}; | |
| 108 | 112 | |
| 113 | + | |
| 109 | 114 | } | ... | ... |
cit-ecm-api/src/main/java/br/com/centralit/api/model/DocumentoGed.java
| ... | ... | @@ -151,6 +151,11 @@ public class DocumentoGed extends PersistentObjectUnidade implements Cloneable { |
| 151 | 151 | @JsonView({ ViewsEcm.DocumentoGedEdit.class, Views.ProcessoEdit.class }) |
| 152 | 152 | private Dominio status; |
| 153 | 153 | |
| 154 | + /** Atributo estado. */ | |
| 155 | + @ManyToOne(fetch = FetchType.LAZY) | |
| 156 | + @JsonView({ ViewsEcm.DocumentoGedEdit.class, Views.ProcessoEdit.class }) | |
| 157 | + private Dominio estado; | |
| 158 | + | |
| 154 | 159 | /** Atributo tramitarDocumento. */ |
| 155 | 160 | @ManyToOne(fetch = FetchType.LAZY) |
| 156 | 161 | @JsonView({ ViewsEcm.DocumentoGedEdit.class, Views.ProcessoEdit.class }) |
| ... | ... | @@ -978,6 +983,14 @@ public class DocumentoGed extends PersistentObjectUnidade implements Cloneable { |
| 978 | 983 | } |
| 979 | 984 | |
| 980 | 985 | /** |
| 986 | + * Retorna o valor do atributo <code>estado</code> | |
| 987 | + * | |
| 988 | + * @return <code>Dominio</code> | |
| 989 | + */ | |
| 990 | + public Dominio getEstado() { | |
| 991 | + | |
| 992 | + return estado; | |
| 993 | + /** | |
| 981 | 994 | * Retorna o valor do atributo <code>assinaturas</code> |
| 982 | 995 | * |
| 983 | 996 | * @return <code>Collection<Assinatura></code> |
| ... | ... | @@ -988,6 +1001,18 @@ public class DocumentoGed extends PersistentObjectUnidade implements Cloneable { |
| 988 | 1001 | } |
| 989 | 1002 | |
| 990 | 1003 | /** |
| 1004 | + * Define o valor do atributo <code>estado</code>. | |
| 1005 | + * | |
| 1006 | + * @param estado | |
| 1007 | + */ | |
| 1008 | + public void setEstado(Dominio estado) { | |
| 1009 | + | |
| 1010 | + this.estado = estado; | |
| 1011 | + } | |
| 1012 | + | |
| 1013 | +} | |
| 1014 | + | |
| 1015 | + /** | |
| 991 | 1016 | * Define o valor do atributo <code>assinaturas</code>. |
| 992 | 1017 | * |
| 993 | 1018 | * @param assinaturas | ... | ... |
cit-ecm-api/src/main/java/br/com/centralit/api/model/Processo.java
| ... | ... | @@ -27,6 +27,7 @@ import br.com.centralit.framework.json.JsonCalendarSimpleDateSerializer; |
| 27 | 27 | import br.com.centralit.framework.json.Views; |
| 28 | 28 | import br.com.centralit.framework.model.Dominio; |
| 29 | 29 | import br.com.centralit.framework.util.UtilColecao; |
| 30 | +import br.com.centralit.framework.util.UtilObjeto; | |
| 30 | 31 | |
| 31 | 32 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; |
| 32 | 33 | import com.fasterxml.jackson.annotation.JsonView; |
| ... | ... | @@ -70,9 +71,9 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| 70 | 71 | public class Processo extends PersistentObjectUnidade { |
| 71 | 72 | |
| 72 | 73 | public static final String GRID_PROCESSO_NA_UNIDADE = "GRID_PROCESSO_NA_UNIDADE"; |
| 73 | - | |
| 74 | + | |
| 74 | 75 | public static final String GRID_CLASSIFICACAO_PROCESSO_DOCUMENTO = "GRID_CLASSIFICACAO_PROCESSO_DOCUMENTO"; |
| 75 | - | |
| 76 | + | |
| 76 | 77 | /** Atributo serialVersionUID. */ |
| 77 | 78 | private static final long serialVersionUID = -6167513900417461697L; |
| 78 | 79 | |
| ... | ... | @@ -90,7 +91,7 @@ public class Processo extends PersistentObjectUnidade { |
| 90 | 91 | @Temporal(TemporalType.TIMESTAMP) |
| 91 | 92 | @JsonSerialize(using = JsonCalendarSimpleDateSerializer.class) |
| 92 | 93 | @JsonDeserialize(using = JsonCalendarSimpleDateDeserializer.class) |
| 93 | - @JsonView({Views.UnidadeProcessoListView.class}) | |
| 94 | + @JsonView({ Views.UnidadeProcessoListView.class }) | |
| 94 | 95 | private Calendar dataReferencia; |
| 95 | 96 | |
| 96 | 97 | /** Atributo dataConclusao. */ |
| ... | ... | @@ -110,14 +111,33 @@ public class Processo extends PersistentObjectUnidade { |
| 110 | 111 | @Transient |
| 111 | 112 | private Long idTask; |
| 112 | 113 | |
| 113 | - /** Atributo nup. */ | |
| 114 | - @JsonView({ Views.ProcessoEdit.class}) | |
| 115 | - private Dominio tipoProtocolo; | |
| 116 | - | |
| 117 | 114 | /** Atributo observacaoGeral. */ |
| 118 | 115 | @JsonView({ Views.ProcessoEdit.class }) |
| 119 | 116 | private String observacaoGeral; |
| 120 | 117 | |
| 118 | + @JsonView({ Views.ProcessoEdit.class }) | |
| 119 | + private String tipoAssunto; | |
| 120 | + | |
| 121 | + /** Atributo idProcessInstance. */ | |
| 122 | + @JsonView({ Views.ProcessoList.class, Views.UnidadeProcessoListView.class }) | |
| 123 | + private Long idProcessInstance; | |
| 124 | + | |
| 125 | + /** Atributo aprovado. */ | |
| 126 | + @JsonView({ ViewsEcm.ProcessoList.class }) | |
| 127 | + private Boolean validado; | |
| 128 | + | |
| 129 | + /** Atributo prazoSigilo. */ | |
| 130 | + @Temporal(TemporalType.TIMESTAMP) | |
| 131 | + @JsonSerialize(using = JsonCalendarSimpleDateSerializer.class) | |
| 132 | + @JsonDeserialize(using = JsonCalendarSimpleDateDeserializer.class) | |
| 133 | + @JsonView({ ViewsEcm.ProcessoList.class }) | |
| 134 | + private Calendar prazoSigilo; | |
| 135 | + | |
| 136 | + /** Atributo nup. */ | |
| 137 | + @JsonView({ Views.ProcessoEdit.class }) | |
| 138 | + @ManyToOne(fetch = FetchType.LAZY) | |
| 139 | + private Dominio tipoProtocolo; | |
| 140 | + | |
| 121 | 141 | /** Atributo status. */ |
| 122 | 142 | @ManyToOne(fetch = FetchType.LAZY) |
| 123 | 143 | @JsonView({ Views.ProcessoEdit.class, Views.UnidadeProcessoListView.class }) |
| ... | ... | @@ -138,16 +158,9 @@ public class Processo extends PersistentObjectUnidade { |
| 138 | 158 | @JsonView({ Views.ProcessoList.class, Views.UnidadeProcessoListView.class }) |
| 139 | 159 | private PlanoClassificacao assunto; |
| 140 | 160 | |
| 141 | - @JsonView({ Views.ProcessoEdit.class }) | |
| 142 | - private String tipoAssunto; | |
| 143 | - | |
| 144 | - /** Atributo idProcessInstance. */ | |
| 145 | - @JsonView({ Views.ProcessoList.class, Views.UnidadeProcessoListView.class }) | |
| 146 | - private Long idProcessInstance; | |
| 147 | - | |
| 148 | 161 | /** Atributo nivelAcesso. */ |
| 149 | 162 | @ManyToOne(fetch = FetchType.LAZY) |
| 150 | - @JsonView({ Views.ProcessoList.class, Views.UnidadeProcessoListView.class }) | |
| 163 | + @JsonView({ Views.ProcessoList.class, Views.UnidadeProcessoListView.class }) | |
| 151 | 164 | private NivelAcessoTipoProcesso nivelAcesso; |
| 152 | 165 | |
| 153 | 166 | @ManyToOne(fetch = FetchType.LAZY) |
| ... | ... | @@ -208,17 +221,6 @@ public class Processo extends PersistentObjectUnidade { |
| 208 | 221 | @JoinTable(name = "processo_anexado", joinColumns = { @JoinColumn(name = "processo_id") }, inverseJoinColumns = { @JoinColumn(name = "processo_anexado_id") }) |
| 209 | 222 | private Collection<AnexoProcesso> anexados; |
| 210 | 223 | |
| 211 | - /** Atributo prazoSigilo. */ | |
| 212 | - @Temporal(TemporalType.TIMESTAMP) | |
| 213 | - @JsonSerialize(using = JsonCalendarSimpleDateSerializer.class) | |
| 214 | - @JsonDeserialize(using = JsonCalendarSimpleDateDeserializer.class) | |
| 215 | - @JsonView({ ViewsEcm.ProcessoList.class }) | |
| 216 | - private Calendar prazoSigilo; | |
| 217 | - | |
| 218 | - /** Atributo aprovado. */ | |
| 219 | - @JsonView({ ViewsEcm.ProcessoList.class }) | |
| 220 | - private Boolean aprovado; | |
| 221 | - | |
| 222 | 224 | /** Atributo credenciais. */ |
| 223 | 225 | @OneToMany(fetch = FetchType.LAZY, mappedBy = "processo", cascade = CascadeType.ALL) |
| 224 | 226 | private Collection<CredencialProcesso> credenciais; |
| ... | ... | @@ -813,23 +815,29 @@ public class Processo extends PersistentObjectUnidade { |
| 813 | 815 | } |
| 814 | 816 | |
| 815 | 817 | /** |
| 816 | - * Retorna o valor do atributo <code>aprovado</code> | |
| 818 | + * Retorna o valor do atributo <code>validado</code> | |
| 817 | 819 | * |
| 818 | 820 | * @return <code>Boolean</code> |
| 819 | 821 | */ |
| 820 | - public Boolean getAprovado() { | |
| 822 | + public Boolean getValidado() { | |
| 823 | + | |
| 824 | + if (!UtilObjeto.isReferencia(this.validado)) { | |
| 821 | 825 | |
| 822 | - return aprovado; | |
| 826 | + this.validado = Boolean.FALSE; | |
| 827 | + | |
| 828 | + } | |
| 829 | + | |
| 830 | + return validado; | |
| 823 | 831 | } |
| 824 | 832 | |
| 825 | 833 | /** |
| 826 | - * Define o valor do atributo <code>aprovado</code>. | |
| 834 | + * Define o valor do atributo <code>validado</code>. | |
| 827 | 835 | * |
| 828 | - * @param aprovado | |
| 836 | + * @param validado | |
| 829 | 837 | */ |
| 830 | - public void setAprovado(Boolean aprovado) { | |
| 838 | + public void setValidado(Boolean validado) { | |
| 831 | 839 | |
| 832 | - this.aprovado = aprovado; | |
| 840 | + this.validado = validado; | |
| 833 | 841 | } |
| 834 | 842 | |
| 835 | 843 | /** |
| ... | ... | @@ -853,17 +861,21 @@ public class Processo extends PersistentObjectUnidade { |
| 853 | 861 | } |
| 854 | 862 | |
| 855 | 863 | /** |
| 856 | - * <p><b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a></p> | |
| 857 | - * | |
| 858 | - * <p><b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a></p> | |
| 859 | - * | |
| 864 | + * <p> | |
| 865 | + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a> | |
| 866 | + * </p> | |
| 867 | + * | |
| 868 | + * <p> | |
| 869 | + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> | |
| 870 | + * </p> | |
| 871 | + * | |
| 860 | 872 | * Verifica se o processo foi tramitado. Levando em consideração a unidadeProcesso criada apartir da criação do processo. |
| 861 | - * | |
| 873 | + * | |
| 862 | 874 | * @author maycon.silva |
| 863 | - * | |
| 875 | + * | |
| 864 | 876 | * @return boolean |
| 865 | 877 | */ |
| 866 | - /*@JsonView({ Views.ProcessoEdit.class })*/ | |
| 878 | + /* @JsonView({ Views.ProcessoEdit.class }) */ | |
| 867 | 879 | public boolean isTramitado() { |
| 868 | 880 | |
| 869 | 881 | return !UtilColecao.isVazio(this.getUnidadesProcesso()) && this.getUnidadesProcesso().size() > 1; | ... | ... |
cit-ecm-api/src/main/java/br/com/centralit/api/model/TarjaAssinatura.java
0 → 100644
| ... | ... | @@ -0,0 +1,96 @@ |
| 1 | +package br.com.centralit.api.model; | |
| 2 | + | |
| 3 | +import javax.persistence.Column; | |
| 4 | +import javax.persistence.Entity; | |
| 5 | +import javax.persistence.FetchType; | |
| 6 | +import javax.persistence.GeneratedValue; | |
| 7 | +import javax.persistence.GenerationType; | |
| 8 | +import javax.persistence.Id; | |
| 9 | +import javax.persistence.ManyToOne; | |
| 10 | +import javax.persistence.OneToOne; | |
| 11 | + | |
| 12 | +import com.fasterxml.jackson.annotation.JsonView; | |
| 13 | + | |
| 14 | +import br.com.centralit.api.framework.json.ViewsEcm; | |
| 15 | +import br.com.centralit.framework.json.Views; | |
| 16 | +import br.com.centralit.framework.model.AnexoImagem; | |
| 17 | +import br.com.centralit.framework.model.Dominio; | |
| 18 | +import br.com.centralit.framework.model.arquitetura.PersistentObjectAudit; | |
| 19 | + | |
| 20 | +@Entity | |
| 21 | +public class TarjaAssinatura extends PersistentObjectAudit{ | |
| 22 | + | |
| 23 | + private static final long serialVersionUID = -7187159662335439914L; | |
| 24 | + | |
| 25 | + @Id | |
| 26 | + @GeneratedValue(strategy = GenerationType.AUTO) | |
| 27 | + @JsonView({ Views.GenericView.class }) | |
| 28 | + private Long id; | |
| 29 | + | |
| 30 | + @JsonView({ ViewsEcm.TarjaAssinaturaEditview.class }) | |
| 31 | + @Column (length=100, nullable = false) | |
| 32 | + private String descricao; | |
| 33 | + | |
| 34 | + @ManyToOne(fetch = FetchType.LAZY) | |
| 35 | + @JsonView({ ViewsEcm.TarjaAssinaturaEditview.class }) | |
| 36 | + private Dominio tipoAssinatura; | |
| 37 | + | |
| 38 | + /** Conteúdo em HTML*/ | |
| 39 | + @JsonView({ ViewsEcm.TarjaAssinaturaEditview.class }) | |
| 40 | + @Column (length=1000, nullable = false) | |
| 41 | + private String conteudo; | |
| 42 | + | |
| 43 | + @OneToOne | |
| 44 | + @JsonView({ ViewsEcm.TarjaAssinaturaEditview.class }) | |
| 45 | + private AnexoImagem anexoImagem; | |
| 46 | + | |
| 47 | + public Long getId() { | |
| 48 | + | |
| 49 | + return id; | |
| 50 | + } | |
| 51 | + | |
| 52 | + public void setId(Long id) { | |
| 53 | + | |
| 54 | + this.id = id; | |
| 55 | + } | |
| 56 | + | |
| 57 | + public String getDescricao() { | |
| 58 | + | |
| 59 | + return descricao; | |
| 60 | + } | |
| 61 | + | |
| 62 | + public void setDescricao(String descricao) { | |
| 63 | + | |
| 64 | + this.descricao = descricao; | |
| 65 | + } | |
| 66 | + | |
| 67 | + public Dominio getTipoAssinatura() { | |
| 68 | + | |
| 69 | + return tipoAssinatura; | |
| 70 | + } | |
| 71 | + | |
| 72 | + public void setTipoAssinatura(Dominio tipoAssinatura) { | |
| 73 | + | |
| 74 | + this.tipoAssinatura = tipoAssinatura; | |
| 75 | + } | |
| 76 | + | |
| 77 | + public String getConteudo() { | |
| 78 | + | |
| 79 | + return conteudo; | |
| 80 | + } | |
| 81 | + | |
| 82 | + public void setConteudo(String conteudo) { | |
| 83 | + | |
| 84 | + this.conteudo = conteudo; | |
| 85 | + } | |
| 86 | + | |
| 87 | + public AnexoImagem getAnexoImagem() { | |
| 88 | + | |
| 89 | + return anexoImagem; | |
| 90 | + } | |
| 91 | + | |
| 92 | + public void setAnexoImagem(AnexoImagem anexoImagem) { | |
| 93 | + | |
| 94 | + this.anexoImagem = anexoImagem; | |
| 95 | + } | |
| 96 | +} | ... | ... |
cit-ecm-api/src/main/java/br/com/centralit/api/service/CredencialProcessoService.java
| ... | ... | @@ -4,8 +4,10 @@ import java.util.Collection; |
| 4 | 4 | |
| 5 | 5 | import br.com.centralit.api.model.CredencialProcesso; |
| 6 | 6 | import br.com.centralit.api.model.Processo; |
| 7 | +import br.com.centralit.api.model.Sigilo; | |
| 7 | 8 | import br.com.centralit.api.viewHelper.GrupoUsuarioVH; |
| 8 | 9 | import br.com.centralit.api.viewHelper.HerancaSistemaVH; |
| 10 | +import br.com.centralit.framework.model.Grupo; | |
| 9 | 11 | import br.com.centralit.framework.service.arquitetura.GenericService; |
| 10 | 12 | |
| 11 | 13 | /** |
| ... | ... | @@ -200,4 +202,23 @@ public interface CredencialProcessoService extends GenericService<CredencialProc |
| 200 | 202 | */ |
| 201 | 203 | boolean contemPermissaoProcesso(Long idProcesso); |
| 202 | 204 | |
| 205 | + /** | |
| 206 | + * <p> | |
| 207 | + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a> | |
| 208 | + * </p> | |
| 209 | + * | |
| 210 | + * <p> | |
| 211 | + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> | |
| 212 | + * </p> | |
| 213 | + * | |
| 214 | + * Método responsável por obter grupos através do sigilo | |
| 215 | + * | |
| 216 | + * @author rogerio.costa | |
| 217 | + * | |
| 218 | + * @param sigilo | |
| 219 | + * | |
| 220 | + * @return Collection<Grupo> | |
| 221 | + */ | |
| 222 | + Collection<Grupo> findGrupoPorSigilo(Sigilo sigilo); | |
| 223 | + | |
| 203 | 224 | } | ... | ... |
cit-ecm-api/src/main/java/br/com/centralit/api/service/DocumentoGedService.java
| ... | ... | @@ -3,9 +3,7 @@ package br.com.centralit.api.service; |
| 3 | 3 | import java.util.Collection; |
| 4 | 4 | |
| 5 | 5 | import br.com.centralit.api.model.DocumentoGed; |
| 6 | -import br.com.centralit.framework.model.Dominio; | |
| 7 | 6 | import br.com.centralit.api.model.Processo; |
| 8 | -import br.com.centralit.api.viewHelper.AnexarProcessoVH; | |
| 9 | 7 | import br.com.centralit.framework.model.Dominio; |
| 10 | 8 | import br.com.centralit.framework.service.arquitetura.GenericService; |
| 11 | 9 | |
| ... | ... | @@ -40,7 +38,7 @@ public interface DocumentoGedService extends GenericService<DocumentoGed, Long> |
| 40 | 38 | void saveIconeDocumento(DocumentoGed documentoGed, Dominio tipoAnexo); |
| 41 | 39 | |
| 42 | 40 | void anexarDocumento(Processo processoDestinoAnexo, Processo processoOrigem); |
| 43 | - | |
| 41 | + | |
| 44 | 42 | Collection<DocumentoGed> findByProcessoSigilo(Long idProcesso); |
| 45 | 43 | |
| 46 | 44 | /** |
| ... | ... | @@ -61,19 +59,23 @@ public interface DocumentoGedService extends GenericService<DocumentoGed, Long> |
| 61 | 59 | * @return Collection<Processo> |
| 62 | 60 | */ |
| 63 | 61 | Collection<DocumentoGed> findPorPlanoClassificacao(Long idPlanoClassificacao); |
| 64 | - | |
| 62 | + | |
| 65 | 63 | /** |
| 66 | 64 | * |
| 67 | - * <p><b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a></p> | |
| 68 | - * | |
| 69 | - * <p><b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a></p> | |
| 70 | - * | |
| 65 | + * <p> | |
| 66 | + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a> | |
| 67 | + * </p> | |
| 68 | + * | |
| 69 | + * <p> | |
| 70 | + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> | |
| 71 | + * </p> | |
| 72 | + * | |
| 71 | 73 | * Método responsável por |
| 72 | - * | |
| 74 | + * | |
| 73 | 75 | * @author andre.silva |
| 74 | - * | |
| 76 | + * | |
| 75 | 77 | * @param listaDocumentos |
| 76 | 78 | */ |
| 77 | - void atualizarSigiloDocumentos(Collection<DocumentoGed> listaDocumentos); | |
| 79 | + Collection<DocumentoGed> atualizarSigiloDocumentos(Collection<DocumentoGed> listaDocumentos); | |
| 78 | 80 | |
| 79 | 81 | } | ... | ... |
cit-ecm-api/src/main/java/br/com/centralit/api/service/TarjaAssinaturaService.java
0 → 100644
| ... | ... | @@ -0,0 +1,57 @@ |
| 1 | +package br.com.centralit.api.service; | |
| 2 | + | |
| 3 | +import org.springframework.web.multipart.MultipartFile; | |
| 4 | + | |
| 5 | +import br.com.centralit.api.model.TarjaAssinatura; | |
| 6 | +import br.com.centralit.framework.service.arquitetura.GenericService; | |
| 7 | + | |
| 8 | +/** | |
| 9 | + * <p><img src="http://centralit.com.br/images/logo_central.png"></p> | |
| 10 | + * | |
| 11 | + * <p><b>Company: </b> Central IT - Governança Corporativa - </p> | |
| 12 | + * | |
| 13 | + * <p><b>Description: </b></p> | |
| 14 | + * Classe de serviços para a entidade TarjaAssinatura, a qual mantém as regras de negócio. | |
| 15 | + * | |
| 16 | + * @since 13 de abr de 2016 - 13:40:36 | |
| 17 | + * @version 1.0.0 | |
| 18 | + * @author ciro.junior (<a href="mailto:ciro.junior@centralit.com.br">ciro.junior@centralit.com.br</a>) | |
| 19 | + * | |
| 20 | + */ | |
| 21 | +public interface TarjaAssinaturaService extends GenericService<TarjaAssinatura, Long> { | |
| 22 | + | |
| 23 | + /** | |
| 24 | + * | |
| 25 | + * Método responsável por fazer o upload da imagem do logotipo de uma tarja de assinatura. | |
| 26 | + * | |
| 27 | + * @author ciro.junior (<a href="mailto:ciro.junior@centralit.com.br">ciro.junior@centralit.com.br</a>) | |
| 28 | + * | |
| 29 | + * @param file | |
| 30 | + * @param idOrganizacao | |
| 31 | + * @param idConfiguracao | |
| 32 | + */ | |
| 33 | + void uploadAnexoImagemTarja(MultipartFile file, Long idOrganizacao, Long idConfiguracao); | |
| 34 | + | |
| 35 | + /** | |
| 36 | + * | |
| 37 | + * Método responsável por salvar os dois tipos de tarjas de assinatura ao mesmo tempo | |
| 38 | + * | |
| 39 | + * @author ciro.junior (<a href="mailto:ciro.junior@centralit.com.br">ciro.junior@centralit.com.br</a>) | |
| 40 | + * | |
| 41 | + * @param tarjaAssinaturaVH | |
| 42 | + * @return | |
| 43 | + */ | |
| 44 | + TarjaAssinatura save (TarjaAssinatura tarjaAssinatura); | |
| 45 | + | |
| 46 | + | |
| 47 | + /** | |
| 48 | + * | |
| 49 | + * Método responsável por remover a imagem associada a uma tarja de assinatura. | |
| 50 | + * | |
| 51 | + * @author ciro.junior (<a href="mailto:ciro.junior@centralit.com.br">ciro.junior@centralit.com.br</a>) | |
| 52 | + * | |
| 53 | + * @param tarjaAssinatura | |
| 54 | + * @return | |
| 55 | + */ | |
| 56 | + TarjaAssinatura removeImagem (TarjaAssinatura tarjaAssinatura); | |
| 57 | +} | ... | ... |
cit-ecm-api/src/main/java/br/com/centralit/api/service/UnidadeProcessoService.java
| ... | ... | @@ -174,10 +174,30 @@ public interface UnidadeProcessoService extends GenericService<UnidadeProcesso, |
| 174 | 174 | |
| 175 | 175 | /** |
| 176 | 176 | * Método responsável por listar processos através da unidade do usuário |
| 177 | + * | |
| 177 | 178 | * @author rogerio.cassimiro |
| 178 | 179 | * @param search |
| 179 | 180 | * @return <RT> SearchResult<RT> |
| 180 | 181 | */ |
| 181 | 182 | <RT> SearchResult<RT> searchAndCountPorUnidade(ISearch search); |
| 182 | - | |
| 183 | + | |
| 184 | + /** | |
| 185 | + * <p> | |
| 186 | + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a> | |
| 187 | + * </p> | |
| 188 | + * | |
| 189 | + * <p> | |
| 190 | + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> | |
| 191 | + * </p> | |
| 192 | + * | |
| 193 | + * Método responsável por verificar se o processo foi enviado para outra unidade | |
| 194 | + * | |
| 195 | + * @author rogerio.costa | |
| 196 | + * | |
| 197 | + * @param idProcesso | |
| 198 | + * | |
| 199 | + * @return Boolean | |
| 200 | + */ | |
| 201 | + Boolean isProcessoEnviado(Long idProcesso); | |
| 202 | + | |
| 183 | 203 | } | ... | ... |
cit-ecm-api/src/main/java/br/com/centralit/api/service/impl/AnexoGedServiceImpl.java
| ... | ... | @@ -105,9 +105,9 @@ public class AnexoGedServiceImpl extends GenericServiceImpl<AnexoGed, Long> impl |
| 105 | 105 | |
| 106 | 106 | // FAZ OCR DO DOCUMENTO ANEXADO E JÁ MANDA PARA INDEXAÇÃO |
| 107 | 107 | |
| 108 | -// documentoGed.setConteudo(this.gedFileService.doOcr(anexo)); | |
| 108 | + documentoGed.setConteudo(this.gedFileService.doOcr(anexo)); | |
| 109 | 109 | |
| 110 | -// this.solrService.addDocumento(documentoGed); | |
| 110 | + this.solrService.addDocumento(documentoGed); | |
| 111 | 111 | |
| 112 | 112 | anexo.setDocumentoGed(documentoGed); |
| 113 | 113 | ... | ... |
cit-ecm-api/src/main/java/br/com/centralit/api/service/impl/CredencialProcessoServiceImpl.java
| ... | ... | @@ -543,7 +543,7 @@ public class CredencialProcessoServiceImpl extends GenericServiceImpl<Credencial |
| 543 | 543 | * |
| 544 | 544 | * @return Collection<Grupo> |
| 545 | 545 | */ |
| 546 | - private Collection<Grupo> findGrupoPorSigilo(Sigilo sigilo) { | |
| 546 | + public Collection<Grupo> findGrupoPorSigilo(Sigilo sigilo) { | |
| 547 | 547 | |
| 548 | 548 | Collection<Long> idPrivilegios = this.getPrivilegios(sigilo); |
| 549 | 549 | ... | ... |
cit-ecm-api/src/main/java/br/com/centralit/api/service/impl/DocumentoGedServiceImpl.java
| ... | ... | @@ -34,6 +34,7 @@ import br.com.centralit.api.service.ProcessoService; |
| 34 | 34 | import br.com.centralit.api.service.SigiloService; |
| 35 | 35 | import br.com.centralit.api.service.SolrService; |
| 36 | 36 | import br.com.centralit.api.service.TipoDocumentoService; |
| 37 | +import br.com.centralit.api.service.UnidadeProcessoService; | |
| 37 | 38 | import br.com.centralit.framework.exception.BusinessException; |
| 38 | 39 | import br.com.centralit.framework.exception.CodigoErro; |
| 39 | 40 | import br.com.centralit.framework.model.Dominio; |
| ... | ... | @@ -82,7 +83,7 @@ public class DocumentoGedServiceImpl extends GenericServiceImpl<DocumentoGed, Lo |
| 82 | 83 | |
| 83 | 84 | private static final String VALIDAR_NIVEL_ACESSO = "ECM.VALIDACAO.VALIDAR_NIVEL_ACESSO"; |
| 84 | 85 | |
| 85 | - private static final String VALIDAR_OUTRAS_UNIDADES = "ECM.VALIDACAO.VALIDAR_OUTRAS_UNIDADES"; | |
| 86 | + private static final String VALIDAR_OUTRAS_UNIDADES = "ECM.VALIDACAO.VALIDAR_ALTERACAO_NIVEL_ACESSO_OUTRAS_UNIDADES"; | |
| 86 | 87 | |
| 87 | 88 | /** Atributo documentoGedDao. */ |
| 88 | 89 | private DocumentoGedDao documentoGedDao; |
| ... | ... | @@ -119,6 +120,10 @@ public class DocumentoGedServiceImpl extends GenericServiceImpl<DocumentoGed, Lo |
| 119 | 120 | @Autowired |
| 120 | 121 | private SigiloService sigiloService; |
| 121 | 122 | |
| 123 | + /** Atributo unidadeProcessoService. */ | |
| 124 | + @Autowired | |
| 125 | + private UnidadeProcessoService unidadeProcessoService; | |
| 126 | + | |
| 122 | 127 | /** Atributo solrService. */ |
| 123 | 128 | @Autowired |
| 124 | 129 | private SolrService solrService; |
| ... | ... | @@ -222,8 +227,11 @@ public class DocumentoGedServiceImpl extends GenericServiceImpl<DocumentoGed, Lo |
| 222 | 227 | private void saveSolr(DocumentoGed entity) { |
| 223 | 228 | |
| 224 | 229 | try { |
| 230 | + // Verifica se o documento é sigiloso | |
| 231 | + if (!UtilObjeto.isReferencia(entity.getSigilo())) { | |
| 225 | 232 | |
| 226 | -// this.solrService.addDocumento(entity); | |
| 233 | + this.solrService.addDocumento(entity); | |
| 234 | + } | |
| 227 | 235 | |
| 228 | 236 | } catch (Exception e) { |
| 229 | 237 | |
| ... | ... | @@ -266,6 +274,7 @@ public class DocumentoGedServiceImpl extends GenericServiceImpl<DocumentoGed, Lo |
| 266 | 274 | if (UtilObjeto.isReferencia(entity.getSigilo()) && UtilObjeto.isReferencia(entity.getSigilo().getId())) { |
| 267 | 275 | |
| 268 | 276 | entity.setSigilo(this.sigiloService.getReference(entity.getSigilo().getId())); |
| 277 | + entity.setStatus(this.dominioService.findByChaveAndCodigo("statusDocumentoGed", 0L)); | |
| 269 | 278 | this.atribuirPrazoPadraoDocumento(entity); |
| 270 | 279 | } else { |
| 271 | 280 | |
| ... | ... | @@ -377,11 +386,12 @@ public class DocumentoGedServiceImpl extends GenericServiceImpl<DocumentoGed, Lo |
| 377 | 386 | */ |
| 378 | 387 | private void validarAbertosEmOutrasUnidades(DocumentoGed entity) { |
| 379 | 388 | |
| 380 | - if (UtilObjeto.isReferencia(entity.getNivelAcesso().getNivelAcesso())) { | |
| 381 | - if (entity.getNivelAcesso().getNivelAcesso().getCodigo() == 0L) { | |
| 382 | - if (this.documentoGedDao.isDocumentoAbertoEmOutrasUnidades(entity)) { | |
| 383 | - throw new BusinessException(DocumentoGedServiceImpl.VALIDAR_OUTRAS_UNIDADES, CodigoErro.REGRA_NEGOCIO.getValue()); | |
| 384 | - } | |
| 389 | + // verifica se o documento está passando a ser sigiloso | |
| 390 | + if (UtilObjeto.isReferencia(entity.getSigilo()) && !this.documentoGedDao.isSigiloso(entity.getId())) { | |
| 391 | + | |
| 392 | + if (this.unidadeProcessoService.isProcessoEnviado(entity.getProcesso().getId())) { | |
| 393 | + | |
| 394 | + throw new BusinessException(DocumentoGedServiceImpl.VALIDAR_OUTRAS_UNIDADES, CodigoErro.REGRA_NEGOCIO.getValue()); | |
| 385 | 395 | } |
| 386 | 396 | } |
| 387 | 397 | } |
| ... | ... | @@ -572,7 +582,7 @@ public class DocumentoGedServiceImpl extends GenericServiceImpl<DocumentoGed, Lo |
| 572 | 582 | |
| 573 | 583 | this.validarEntidade(entity, this.validator); |
| 574 | 584 | AnexoGed anexo = null; |
| 575 | - | |
| 585 | + | |
| 576 | 586 | if (entity.getAnexo() != null) { |
| 577 | 587 | anexo = this.anexoGedService.getReference(entity.getAnexo().getId()); |
| 578 | 588 | } |
| ... | ... | @@ -595,7 +605,7 @@ public class DocumentoGedServiceImpl extends GenericServiceImpl<DocumentoGed, Lo |
| 595 | 605 | |
| 596 | 606 | entity.setConteudo(this.decrypted(entity.getConteudoCriptografado())); |
| 597 | 607 | |
| 598 | - // this.saveSolr(entity); | |
| 608 | + this.saveSolr(entity); | |
| 599 | 609 | |
| 600 | 610 | try { |
| 601 | 611 | if (anexo != null) { |
| ... | ... | @@ -799,25 +809,25 @@ public class DocumentoGedServiceImpl extends GenericServiceImpl<DocumentoGed, Lo |
| 799 | 809 | * @param listaDocumentos |
| 800 | 810 | */ |
| 801 | 811 | @Override |
| 802 | - public void atualizarSigiloDocumentos(Collection<DocumentoGed> listaDocumentos) { | |
| 812 | + public Collection<DocumentoGed> atualizarSigiloDocumentos(Collection<DocumentoGed> listaDocumentos) { | |
| 813 | + | |
| 814 | + Collection<DocumentoGed> documentosAlterados = new LinkedList<DocumentoGed>(); | |
| 803 | 815 | |
| 804 | 816 | if (!UtilColecao.isVazio(listaDocumentos)) { |
| 805 | 817 | for (DocumentoGed documento : listaDocumentos) { |
| 806 | 818 | DocumentoGed entity = (DocumentoGed) this.documentoGedDao.getReference(documento.getId()); |
| 807 | - if (documento.getSigilo() == null) { | |
| 808 | - entity.setAprovado(Boolean.TRUE); | |
| 809 | - } else { | |
| 810 | - entity.setSigiloOriginal(documento.getSigilo()); | |
| 811 | - entity.setNivelAcessoOriginal(documento.getNivelAcesso()); | |
| 812 | - entity.setSigilo(documento.getSigilo()); | |
| 813 | - entity.setNivelAcesso(documento.getNivelAcesso()); | |
| 814 | - } | |
| 815 | - | |
| 816 | - super.merge(entity); | |
| 819 | + entity.setSigiloOriginal(documento.getSigilo()); | |
| 820 | + entity.setNivelAcessoOriginal(documento.getNivelAcesso()); | |
| 821 | + entity.setSigilo(documento.getSigilo()); | |
| 822 | + entity.setNivelAcesso(documento.getNivelAcesso()); | |
| 823 | + entity.setStatus(this.dominioService.findByChaveAndCodigo("statusDocumentoGed", 1L)); | |
| 824 | + documentosAlterados.add(entity); | |
| 817 | 825 | } |
| 818 | 826 | |
| 819 | 827 | } |
| 820 | 828 | |
| 829 | + return documentosAlterados; | |
| 830 | + | |
| 821 | 831 | } |
| 822 | 832 | |
| 823 | 833 | /** |
| ... | ... | @@ -839,11 +849,10 @@ public class DocumentoGedServiceImpl extends GenericServiceImpl<DocumentoGed, Lo |
| 839 | 849 | */ |
| 840 | 850 | private void vincularAnexo(DocumentoGed documentoGedOrigem, Processo processoDestinoAnexo, Processo processoOrigem) { |
| 841 | 851 | |
| 842 | -/* Processo processoDestinoAnexo = this.processoService.getReference(anexarProcessoVH.getProcesso().getId());*/ | |
| 852 | + /* Processo processoDestinoAnexo = this.processoService.getReference(anexarProcessoVH.getProcesso().getId()); */ | |
| 843 | 853 | |
| 844 | 854 | AnexoGed anexoDocumentoOrigem = null; |
| 845 | 855 | |
| 846 | - | |
| 847 | 856 | DocumentoGed documentoGed = new DocumentoGed(); |
| 848 | 857 | |
| 849 | 858 | documentoGed = documentoGedOrigem.clone(); |
| ... | ... | @@ -857,26 +866,26 @@ public class DocumentoGedServiceImpl extends GenericServiceImpl<DocumentoGed, Lo |
| 857 | 866 | |
| 858 | 867 | documentoGed.setInteressados(new LinkedList<InteressadoDocumento>()); |
| 859 | 868 | |
| 860 | - //Monta os dados do novo interessado para o novo documento. | |
| 861 | - for(InteressadoDocumento interessadoDocumento : documentoGedOrigem.getInteressados()){ | |
| 862 | - | |
| 869 | + // Monta os dados do novo interessado para o novo documento. | |
| 870 | + for (InteressadoDocumento interessadoDocumento : documentoGedOrigem.getInteressados()) { | |
| 871 | + | |
| 863 | 872 | InteressadoDocumento interessadoDocumentoDestino = new InteressadoDocumento(); |
| 864 | 873 | interessadoDocumentoDestino.setInteressado(interessadoDocumento.getInteressado()); |
| 865 | 874 | interessadoDocumentoDestino.setDocumentoGed(documentoGed); |
| 866 | 875 | documentoGed.getInteressados().add(interessadoDocumentoDestino); |
| 867 | 876 | } |
| 868 | - | |
| 877 | + | |
| 869 | 878 | } |
| 870 | 879 | |
| 871 | 880 | documentoGed = super.save(documentoGed); |
| 872 | 881 | |
| 873 | 882 | if (documentoGedOrigem.getFormaCriacao() != null && !documentoGedOrigem.getFormaCriacao().getCodigo().equals(1L)) { |
| 874 | - | |
| 883 | + | |
| 875 | 884 | if (documentoGedOrigem.getAnexo() != null) { |
| 876 | 885 | anexoDocumentoOrigem = this.anexoGedService.getReference(documentoGedOrigem.getAnexo().getId()); |
| 877 | 886 | } |
| 878 | 887 | } |
| 879 | - | |
| 888 | + | |
| 880 | 889 | try { |
| 881 | 890 | if (anexoDocumentoOrigem != null) { |
| 882 | 891 | File file = this.gedFileService.restoreFile(anexoDocumentoOrigem); | ... | ... |
cit-ecm-api/src/main/java/br/com/centralit/api/service/impl/InicializarEcmServiceImpl.java
| ... | ... | @@ -21,33 +21,33 @@ import br.com.centralit.framework.model.UtilStartup; |
| 21 | 21 | * <p> |
| 22 | 22 | * <img src="http://centralit.com.br/images/logo_central.png"> |
| 23 | 23 | * </p> |
| 24 | - * | |
| 24 | + * | |
| 25 | 25 | * <p> |
| 26 | 26 | * <b>Company: </b> Central IT - Governança Corporativa - |
| 27 | 27 | * </p> |
| 28 | - * | |
| 28 | + * | |
| 29 | 29 | * <p> |
| 30 | 30 | * <b>Title: </b> |
| 31 | 31 | * </p> |
| 32 | - * | |
| 32 | + * | |
| 33 | 33 | * <p> |
| 34 | 34 | * <b>Description: </b> |
| 35 | 35 | * </p> |
| 36 | - * | |
| 36 | + * | |
| 37 | 37 | * <p> |
| 38 | 38 | * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a> |
| 39 | 39 | * </p> |
| 40 | - * | |
| 40 | + * | |
| 41 | 41 | * <p> |
| 42 | 42 | * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> |
| 43 | 43 | * </p> |
| 44 | - * | |
| 44 | + * | |
| 45 | 45 | * @since 22/10/2015 - 08:54:55 |
| 46 | - * | |
| 46 | + * | |
| 47 | 47 | * @version 1.0.0 |
| 48 | - * | |
| 48 | + * | |
| 49 | 49 | * @author rogerio.costa |
| 50 | - * | |
| 50 | + * | |
| 51 | 51 | */ |
| 52 | 52 | @Service("inicializarEcmService") |
| 53 | 53 | public class InicializarEcmServiceImpl extends UtilStartup { |
| ... | ... | @@ -74,15 +74,15 @@ public class InicializarEcmServiceImpl extends UtilStartup { |
| 74 | 74 | * <p> |
| 75 | 75 | * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a> |
| 76 | 76 | * </p> |
| 77 | - * | |
| 77 | + * | |
| 78 | 78 | * <p> |
| 79 | 79 | * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> |
| 80 | 80 | * </p> |
| 81 | - * | |
| 81 | + * | |
| 82 | 82 | * Método responsável por gerar a carga inicial |
| 83 | - * | |
| 83 | + * | |
| 84 | 84 | * @author rogerio.costa |
| 85 | - * | |
| 85 | + * | |
| 86 | 86 | */ |
| 87 | 87 | public void gerarCarga() { |
| 88 | 88 | |
| ... | ... | @@ -93,15 +93,15 @@ public class InicializarEcmServiceImpl extends UtilStartup { |
| 93 | 93 | * <p> |
| 94 | 94 | * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a> |
| 95 | 95 | * </p> |
| 96 | - * | |
| 96 | + * | |
| 97 | 97 | * <p> |
| 98 | 98 | * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> |
| 99 | 99 | * </p> |
| 100 | - * | |
| 100 | + * | |
| 101 | 101 | * Método responsável por |
| 102 | - * | |
| 102 | + * | |
| 103 | 103 | * @author rogerio.costa |
| 104 | - * | |
| 104 | + * | |
| 105 | 105 | * @param modulo |
| 106 | 106 | */ |
| 107 | 107 | private void criarPaginasMenus() { |
| ... | ... | @@ -248,7 +248,7 @@ public class InicializarEcmServiceImpl extends UtilStartup { |
| 248 | 248 | pgProcessoDocumentoSigiloso = this.paginaService.saveIfNotExist(pgProcessoDocumentoSigiloso); |
| 249 | 249 | |
| 250 | 250 | Menu menuProcessoDocumentoSigiloso = new Menu("Processos e Documentos Sigilosos", pgProcessoDocumentoSigiloso, menuProcesso, 2, 5, null, null, null, null, modulo, "CLASSIFICAR_PROCESSO_DOCUMENTO"); |
| 251 | - menuProcessoDocumentoSigiloso.setIncludes(this.gerarArquivosMenu(menuProcessoDocumentoSigiloso, this.CIT_ECM_WEB_ANGULAR, "ClassificarDocumentoProcesso", true, true, true)); | |
| 251 | + menuProcessoDocumentoSigiloso.setIncludes(this.gerarArquivosMenu(menuProcessoDocumentoSigiloso, this.CIT_ECM_WEB_ANGULAR, "ClassificarDocumentoProcesso", true, true, false)); | |
| 252 | 252 | this.menuService.mergeIfNotExist(menuProcessoDocumentoSigiloso); |
| 253 | 253 | |
| 254 | 254 | Pagina pgGerenciarProcessoListUnidade = new Pagina("Processos Abertos na Unidade", "/cit-ecm-web/html/gerenciarProcesso/gerenciarProcessoListUnidade.html"); |
| ... | ... | @@ -341,6 +341,13 @@ public class InicializarEcmServiceImpl extends UtilStartup { |
| 341 | 341 | menuSuporteDocumento.setIncludes(this.gerarArquivosMenu(menuSuporteDocumento, this.CIT_ECM_WEB_ANGULAR, "TipoSuporteDocumento", true, true, true)); |
| 342 | 342 | this.menuService.mergeIfNotExist(menuSuporteDocumento); |
| 343 | 343 | |
| 344 | + // Submenu Tarja de assinatura | |
| 345 | + Pagina pgTarjaAssinatura = new Pagina("Tarja de Assinatura", "/cit-ecm-web/html/tarjaAssinatura/tarjaAssinatura.html"); | |
| 346 | + pgTarjaAssinatura = this.paginaService.saveIfNotExist(pgTarjaAssinatura); | |
| 347 | + | |
| 348 | + Menu menuTarjaAssinatura = new Menu("Tarja de Assinatura", pgTarjaAssinatura, menuCadastroBasico, 0, 9, null, null, null, null, modulo); | |
| 349 | + menuTarjaAssinatura.setIncludes(this.gerarArquivosMenu(menuTarjaAssinatura, this.CIT_ECM_WEB_ANGULAR, "TarjaAssinatura", true, true, true)); | |
| 350 | + this.menuService.mergeIfNotExist(menuTarjaAssinatura); | |
| 344 | 351 | } |
| 345 | 352 | |
| 346 | 353 | } | ... | ... |
cit-ecm-api/src/main/java/br/com/centralit/api/service/impl/ProcessoServiceImpl.java
| ... | ... | @@ -34,6 +34,7 @@ import br.com.centralit.api.service.DocumentoGedService; |
| 34 | 34 | import br.com.centralit.api.service.DominioService; |
| 35 | 35 | import br.com.centralit.api.service.GrupoService; |
| 36 | 36 | import br.com.centralit.api.service.HistoricoAtribuicaoProcessoService; |
| 37 | +import br.com.centralit.api.service.NotificacaoService; | |
| 37 | 38 | import br.com.centralit.api.service.PlanoClassificacaoService; |
| 38 | 39 | import br.com.centralit.api.service.ProcessoService; |
| 39 | 40 | import br.com.centralit.api.service.SigiloService; |
| ... | ... | @@ -46,9 +47,13 @@ import br.com.centralit.framework.esi.environment.EnvironmentOutput; |
| 46 | 47 | import br.com.centralit.framework.esi.environment.EnvironmentVariable; |
| 47 | 48 | import br.com.centralit.framework.exception.BusinessException; |
| 48 | 49 | import br.com.centralit.framework.exception.CodigoErro; |
| 50 | +import br.com.centralit.framework.model.Dominio; | |
| 49 | 51 | import br.com.centralit.framework.model.Grupo; |
| 52 | +import br.com.centralit.framework.model.Notificacao; | |
| 53 | +import br.com.centralit.framework.model.NotificacaoGrupo; | |
| 50 | 54 | import br.com.centralit.framework.model.Unidade; |
| 51 | 55 | import br.com.centralit.framework.service.arquitetura.GenericServiceImpl; |
| 56 | +import br.com.centralit.framework.util.Util; | |
| 52 | 57 | import br.com.centralit.framework.util.UtilColecao; |
| 53 | 58 | import br.com.centralit.framework.util.UtilDate; |
| 54 | 59 | import br.com.centralit.framework.util.UtilObjeto; |
| ... | ... | @@ -91,7 +96,8 @@ import com.googlecode.genericdao.search.SearchResult; |
| 91 | 96 | @Service("processoService") |
| 92 | 97 | public class ProcessoServiceImpl extends GenericServiceImpl<Processo, Long> implements ProcessoService { |
| 93 | 98 | |
| 94 | - private static final String VALIDAR_PROCESSOS_OUTRAS_UNIDADES = "ECM.VALIDACAO.VALIDAR_PROCESSOS_OUTRAS_UNIDADES"; | |
| 99 | + /** Cosntante VALIDAR_OUTRAS_UNIDADES. */ | |
| 100 | + private static final String VALIDAR_OUTRAS_UNIDADES = "ECM.VALIDACAO.VALIDAR_ALTERACAO_NIVEL_ACESSO_OUTRAS_UNIDADES"; | |
| 95 | 101 | |
| 96 | 102 | private final ProcessoDao processoDao; |
| 97 | 103 | |
| ... | ... | @@ -141,6 +147,10 @@ public class ProcessoServiceImpl extends GenericServiceImpl<Processo, Long> impl |
| 141 | 147 | @Autowired |
| 142 | 148 | private HttpServletRequest request; |
| 143 | 149 | |
| 150 | + /** Atributo notificacaoService. */ | |
| 151 | + @Autowired | |
| 152 | + private NotificacaoService notificacaoService; | |
| 153 | + | |
| 144 | 154 | @Autowired |
| 145 | 155 | public ProcessoServiceImpl( final ProcessoDao processoDao, @Qualifier("processoValidator") final Validator validator ) { |
| 146 | 156 | |
| ... | ... | @@ -153,6 +163,7 @@ public class ProcessoServiceImpl extends GenericServiceImpl<Processo, Long> impl |
| 153 | 163 | public Processo save(Processo entity) { |
| 154 | 164 | |
| 155 | 165 | this.validarEntidade(entity, this.validator); |
| 166 | + this.validarUnidade(); | |
| 156 | 167 | |
| 157 | 168 | this.montarEntidade(entity); |
| 158 | 169 | entity.setSigiloOriginal(entity.getSigilo()); |
| ... | ... | @@ -166,21 +177,117 @@ public class ProcessoServiceImpl extends GenericServiceImpl<Processo, Long> impl |
| 166 | 177 | this.gerarNUP(processo); |
| 167 | 178 | } |
| 168 | 179 | |
| 169 | - try { | |
| 180 | + this.saveSolr(processo); | |
| 170 | 181 | |
| 171 | -// this.solrService.addProcesso(processo); | |
| 172 | - } catch (final Exception e) { | |
| 182 | + // Verifica se o processo é sigiloso, verdadeiro sejá estarta o businessProcess, falso envia uma notificação para os grupos responsáeis. | |
| 183 | + if (!UtilObjeto.isReferencia(processo.getSigilo())) { | |
| 173 | 184 | |
| 174 | - e.printStackTrace(); | |
| 175 | - } | |
| 176 | - if (entity.getSigilo() == null) { | |
| 177 | 185 | this.startBusinessProcess(processo); |
| 186 | + } else { | |
| 187 | + | |
| 188 | + this.enviarNotificacaoProcessoSigiloso(processo); | |
| 178 | 189 | } |
| 179 | 190 | |
| 180 | 191 | return processo; |
| 181 | 192 | } |
| 182 | 193 | |
| 183 | 194 | /** |
| 195 | + * <p> | |
| 196 | + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a> | |
| 197 | + * </p> | |
| 198 | + * | |
| 199 | + * <p> | |
| 200 | + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> | |
| 201 | + * </p> | |
| 202 | + * | |
| 203 | + * Método responsável por enviar notificação para os responsável sobre a criação do processo sigiloso | |
| 204 | + * | |
| 205 | + * @author rogerio.costa | |
| 206 | + * | |
| 207 | + * @param processo | |
| 208 | + */ | |
| 209 | + private void enviarNotificacaoProcessoSigiloso(Processo processo) { | |
| 210 | + | |
| 211 | + StringBuilder sb = new StringBuilder(); | |
| 212 | + | |
| 213 | + sb.append("O processo ").append(processo.getNup()).append(" foi criado como ").append(processo.getSigilo().getTipoSigilo().getDescricao()); | |
| 214 | + | |
| 215 | + Dominio tipoNotificacao = this.dominioService.findByChaveAndCodigo("tipoNotificacao", 4L); | |
| 216 | + | |
| 217 | + Dominio tipoPrioridade = this.dominioService.findByChaveAndCodigo("tipoPrioridade", 2L); | |
| 218 | + | |
| 219 | + Notificacao notificacao = new Notificacao("Processo sigiloso", sb.toString(), tipoNotificacao, tipoPrioridade, null, null, null); | |
| 220 | + | |
| 221 | + Collection<Grupo> grupos = this.credencialProcessoService.findGrupoPorSigilo(processo.getSigilo()); | |
| 222 | + | |
| 223 | + if (!UtilColecao.isVazio(grupos)) { | |
| 224 | + | |
| 225 | + notificacao.setNotificacaoGrupos(new LinkedList<NotificacaoGrupo>()); | |
| 226 | + | |
| 227 | + for (Grupo grupo : grupos) { | |
| 228 | + | |
| 229 | + NotificacaoGrupo notificacaoGrupo = new NotificacaoGrupo(grupo, notificacao); | |
| 230 | + | |
| 231 | + notificacao.getNotificacaoGrupos().add(notificacaoGrupo); | |
| 232 | + } | |
| 233 | + | |
| 234 | + } | |
| 235 | + | |
| 236 | + this.notificacaoService.save(notificacao); | |
| 237 | + } | |
| 238 | + | |
| 239 | + /** | |
| 240 | + * <p> | |
| 241 | + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a> | |
| 242 | + * </p> | |
| 243 | + * | |
| 244 | + * <p> | |
| 245 | + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> | |
| 246 | + * </p> | |
| 247 | + * | |
| 248 | + * Método responsável por validar a unidade vigente | |
| 249 | + * | |
| 250 | + * @author rogerio.costa | |
| 251 | + * | |
| 252 | + */ | |
| 253 | + private void validarUnidade() { | |
| 254 | + | |
| 255 | + if (!UtilObjeto.isReferencia(this.getUsuario().getUnidade())) { | |
| 256 | + throw new BusinessException("ECM.VALIDACAO.ERRO_UNIDADE_ECM_VIGENTE_USUARIO", CodigoErro.REGRA_NEGOCIO.getValue()); | |
| 257 | + } | |
| 258 | + } | |
| 259 | + | |
| 260 | + /** | |
| 261 | + * <p> | |
| 262 | + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a> | |
| 263 | + * </p> | |
| 264 | + * | |
| 265 | + * <p> | |
| 266 | + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> | |
| 267 | + * </p> | |
| 268 | + * | |
| 269 | + * Método responsável por | |
| 270 | + * | |
| 271 | + * @author rogerio.costa | |
| 272 | + * | |
| 273 | + * @param processo | |
| 274 | + */ | |
| 275 | + private void saveSolr(Processo processo) { | |
| 276 | + | |
| 277 | + try { | |
| 278 | + | |
| 279 | + if (!UtilObjeto.isReferencia(processo.getSigilo())) { | |
| 280 | + | |
| 281 | + this.solrService.addProcesso(processo); | |
| 282 | + } | |
| 283 | + | |
| 284 | + } catch (final Exception e) { | |
| 285 | + | |
| 286 | + e.printStackTrace(); | |
| 287 | + } | |
| 288 | + } | |
| 289 | + | |
| 290 | + /** | |
| 184 | 291 | * |
| 185 | 292 | * <p> |
| 186 | 293 | * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a> |
| ... | ... | @@ -202,25 +309,28 @@ public class ProcessoServiceImpl extends GenericServiceImpl<Processo, Long> impl |
| 202 | 309 | |
| 203 | 310 | Processo processo = (Processo) this.processoDao.getReference(entity.getId()); |
| 204 | 311 | |
| 205 | - this.validarEntidade(entity, this.validator); | |
| 312 | + if (entity.getStatus().getCodigo() == 3L) { | |
| 206 | 313 | |
| 207 | - this.montarEntidade(processo); | |
| 208 | - | |
| 209 | - processo.setSigiloOriginal(processo.getSigilo()); | |
| 210 | - processo.setNivelAcessoOriginal(processo.getNivelAcesso()); | |
| 314 | + this.validarEntidade(entity, this.validator); | |
| 211 | 315 | |
| 212 | - processo.setSigilo(entity.getSigilo()); | |
| 213 | - processo.setNivelAcesso(entity.getNivelAcesso()); | |
| 214 | - processo.setAprovado(entity.getAprovado()); | |
| 316 | + this.montarEntidade(processo); | |
| 215 | 317 | |
| 216 | - processo = super.merge(processo); | |
| 318 | + processo.setSigiloOriginal(processo.getSigilo()); | |
| 319 | + processo.setNivelAcessoOriginal(processo.getNivelAcesso()); | |
| 320 | + processo.setSigilo(entity.getSigilo()); | |
| 321 | + processo.setNivelAcesso(entity.getNivelAcesso()); | |
| 322 | + processo.setValidado(entity.getValidado()); | |
| 323 | + processo.setStatus(this.dominioService.findByChaveAndCodigo("statusProcesso", 4L)); | |
| 217 | 324 | |
| 218 | - this.documentoGedService.atualizarSigiloDocumentos(entity.getDocumentos()); | |
| 325 | + if (UtilObjeto.isReferencia(processo.getValidado()) && processo.getValidado()) { | |
| 219 | 326 | |
| 220 | - if (UtilObjeto.isReferencia(processo.getAprovado()) && processo.getAprovado()) { | |
| 327 | + this.startBusinessProcess(processo); | |
| 328 | + } | |
| 221 | 329 | |
| 222 | - this.startBusinessProcess(processo); | |
| 223 | 330 | } |
| 331 | + | |
| 332 | + processo.setDocumentos(this.documentoGedService.atualizarSigiloDocumentos(entity.getDocumentos())); | |
| 333 | + | |
| 224 | 334 | return processo; |
| 225 | 335 | } |
| 226 | 336 | |
| ... | ... | @@ -231,11 +341,9 @@ public class ProcessoServiceImpl extends GenericServiceImpl<Processo, Long> impl |
| 231 | 341 | |
| 232 | 342 | this.montarEntidade(processo); |
| 233 | 343 | |
| 234 | - try { | |
| 235 | -// this.solrService.addProcesso(processo); | |
| 236 | - } catch (Exception e) { | |
| 237 | - e.printStackTrace(); | |
| 238 | - } | |
| 344 | + // this.saveSolr(processo); | |
| 345 | + | |
| 346 | + this.validarAbertosEmOutrasUnidades(processo); | |
| 239 | 347 | |
| 240 | 348 | return super.merge(processo); |
| 241 | 349 | } |
| ... | ... | @@ -386,9 +494,18 @@ public class ProcessoServiceImpl extends GenericServiceImpl<Processo, Long> impl |
| 386 | 494 | } |
| 387 | 495 | } |
| 388 | 496 | |
| 497 | + if (UtilObjeto.isReferencia(processo.getTipoProtocolo())) { | |
| 498 | + | |
| 499 | + processo.setTipoProtocolo(this.dominioService.findByChaveAndCodigo("tipoProtocoloNup", processo.getTipoProtocolo().getCodigo())); | |
| 500 | + | |
| 501 | + } | |
| 502 | + | |
| 389 | 503 | // Verifica se o sigilo foi selecionado |
| 390 | 504 | if (UtilObjeto.isReferencia(processo.getSigilo()) && UtilObjeto.isReferencia(processo.getSigilo().getId())) { |
| 391 | 505 | processo.setSigilo(this.sigiloService.getReference(processo.getSigilo().getId())); |
| 506 | + // Processo sigiloso inicia com o status Aguardando validação. | |
| 507 | + processo.setStatus(this.dominioService.findByChaveAndCodigo("statusProcesso", 3L)); | |
| 508 | + | |
| 392 | 509 | this.atribuirPrazoPadraoProcesso(processo); |
| 393 | 510 | } else { |
| 394 | 511 | processo.setSigilo(null); |
| ... | ... | @@ -938,15 +1055,14 @@ public class ProcessoServiceImpl extends GenericServiceImpl<Processo, Long> impl |
| 938 | 1055 | * @param entity |
| 939 | 1056 | * História de usuário #3216_CA007 |
| 940 | 1057 | */ |
| 941 | - @SuppressWarnings("unused") | |
| 942 | 1058 | private void validarAbertosEmOutrasUnidades(Processo entity) { |
| 943 | 1059 | |
| 944 | - if (UtilObjeto.isReferencia(entity.getNivelAcesso().getNivelAcesso())) { | |
| 945 | - if (entity.getNivelAcesso().getNivelAcesso().getCodigo() == 0L) { | |
| 946 | - Collection<UnidadeProcesso> listaUnidades = this.unidadeProcessoService.findProcesso(entity); | |
| 947 | - if (listaUnidades != null && listaUnidades.size() > 0) { | |
| 948 | - throw new BusinessException(ProcessoServiceImpl.VALIDAR_PROCESSOS_OUTRAS_UNIDADES, CodigoErro.REGRA_NEGOCIO.getValue()); | |
| 949 | - } | |
| 1060 | + // verifica se o documento está passando a ser sigiloso | |
| 1061 | + if (UtilObjeto.isReferencia(entity.getSigilo()) && !this.processoDao.isSigiloso(entity.getId())) { | |
| 1062 | + | |
| 1063 | + if (this.unidadeProcessoService.isProcessoEnviado(entity.getId())) { | |
| 1064 | + | |
| 1065 | + throw new BusinessException(VALIDAR_OUTRAS_UNIDADES, CodigoErro.REGRA_NEGOCIO.getValue()); | |
| 950 | 1066 | } |
| 951 | 1067 | } |
| 952 | 1068 | } |
| ... | ... | @@ -1067,5 +1183,5 @@ public class ProcessoServiceImpl extends GenericServiceImpl<Processo, Long> impl |
| 1067 | 1183 | |
| 1068 | 1184 | return this.processoDao.getProcessoByProtocolo(nup); |
| 1069 | 1185 | } |
| 1070 | - | |
| 1186 | + | |
| 1071 | 1187 | } | ... | ... |
cit-ecm-api/src/main/java/br/com/centralit/api/service/impl/SolrServiceImpl.java
| ... | ... | @@ -7,12 +7,14 @@ import org.apache.solr.client.solrj.SolrClient; |
| 7 | 7 | import org.apache.solr.client.solrj.SolrServerException; |
| 8 | 8 | import org.apache.solr.client.solrj.impl.HttpSolrClient; |
| 9 | 9 | import org.apache.solr.common.SolrInputDocument; |
| 10 | +import org.jsoup.Jsoup; | |
| 10 | 11 | import org.springframework.beans.factory.annotation.Value; |
| 11 | 12 | import org.springframework.stereotype.Service; |
| 12 | 13 | |
| 13 | 14 | import br.com.centralit.api.model.DocumentoGed; |
| 14 | 15 | import br.com.centralit.api.model.Processo; |
| 15 | 16 | import br.com.centralit.api.service.SolrService; |
| 17 | +import br.com.centralit.framework.util.UtilObjeto; | |
| 16 | 18 | |
| 17 | 19 | /** |
| 18 | 20 | * <p> |
| ... | ... | @@ -62,6 +64,8 @@ import br.com.centralit.api.service.SolrService; |
| 62 | 64 | @Service("solrService") |
| 63 | 65 | public class SolrServiceImpl implements SolrService { |
| 64 | 66 | |
| 67 | + private static final String INFORMAÇÃO_RESTRITA = "Informação restrita"; | |
| 68 | + | |
| 65 | 69 | @Value("${ecm.solr.server}") |
| 66 | 70 | public String solrServer; |
| 67 | 71 | |
| ... | ... | @@ -87,7 +91,6 @@ public class SolrServiceImpl implements SolrService { |
| 87 | 91 | processoDoc.setField("unidadeGeradora", processo.getUnidade().getNome()); |
| 88 | 92 | processoDoc.setField("dataCriacao", out.format(processo.getDataCriacao().getTime())); |
| 89 | 93 | processoDoc.setField("situacao", ""); |
| 90 | - | |
| 91 | 94 | processoDoc.setField("nivelAcesso", processo.getNivelAcesso().getNivelAcesso().getDescricao()); |
| 92 | 95 | processoDoc.setField("formatoDocumento", ""); |
| 93 | 96 | |
| ... | ... | @@ -108,31 +111,36 @@ public class SolrServiceImpl implements SolrService { |
| 108 | 111 | SolrClient solrClient = new HttpSolrClient(solrServer); |
| 109 | 112 | |
| 110 | 113 | // Add some example docs |
| 111 | - SolrInputDocument processoDoc = new SolrInputDocument(); | |
| 114 | + SolrInputDocument documentoDoc = new SolrInputDocument(); | |
| 112 | 115 | |
| 113 | 116 | StringBuilder sb = new StringBuilder(); |
| 114 | 117 | |
| 115 | 118 | sb.append("doc_").append(documentoGed.getIdRaiz() != null ? documentoGed.getIdRaiz() : documentoGed.getId()); |
| 116 | 119 | |
| 117 | - processoDoc.setField("id", "doc_" + sb.toString()); | |
| 118 | - processoDoc.setField("nup", documentoGed.getNumero()); | |
| 119 | - processoDoc.setField("objeto", "Documento"); | |
| 120 | - processoDoc.setField("tipoProcesso", ""); | |
| 121 | - processoDoc.setField("tipoDocumento", documentoGed.getTipoDocumento().getNome()); | |
| 122 | - processoDoc.setField("assunto", documentoGed.getPlanoClassificacao().getNome()); | |
| 123 | - processoDoc.setField("assuntoComplementar", documentoGed.getAssuntoComplementar()); | |
| 124 | - processoDoc.setField("autor", documentoGed.getAutor().getUsername()); | |
| 125 | - processoDoc.setField("destinatario", ""); | |
| 126 | - processoDoc.setField("atribuidoA", ""); | |
| 127 | - processoDoc.setField("unidadeGeradora", documentoGed.getUnidade().getNome()); | |
| 128 | - processoDoc.setField("dataCriacao", out.format(documentoGed.getDataCriacao().getTime())); | |
| 129 | - processoDoc.setField("situacao", ""); | |
| 130 | - | |
| 131 | - // processoDoc.setField("nivelAcesso", documentoGed.getNivelAcesso().getNivelAcessoDescricao()); | |
| 132 | - processoDoc.setField("formatoDocumento", ""); | |
| 133 | - processoDoc.setField("conteudo", documentoGed.getConteudo()); | |
| 134 | - | |
| 135 | - solrClient.add(processoDoc); | |
| 120 | + documentoDoc.setField("id", "doc_" + sb.toString()); | |
| 121 | + documentoDoc.setField("nup", documentoGed.getNumero()); | |
| 122 | + documentoDoc.setField("objeto", "Documento"); | |
| 123 | + documentoDoc.setField("tipoDocumento", documentoGed.getTipoDocumento().getNome()); | |
| 124 | + documentoDoc.setField("assunto", documentoGed.getPlanoClassificacao().getNome()); | |
| 125 | + documentoDoc.setField("assuntoComplementar", documentoGed.getAssuntoComplementar()); | |
| 126 | + documentoDoc.setField("autor", documentoGed.getAutor().getUsername()); | |
| 127 | + documentoDoc.setField("destinatario", UtilObjeto.isReferencia(documentoGed.getDestinatario()) ? documentoGed.getDestinatario().getNome() : ""); | |
| 128 | + documentoDoc.setField("atribuidoA", ""); | |
| 129 | + documentoDoc.setField("unidadeGeradora", documentoGed.getUnidade().getNome()); | |
| 130 | + documentoDoc.setField("dataCriacao", out.format(documentoGed.getDataCriacao().getTime())); | |
| 131 | + documentoDoc.setField("situacao", ""); | |
| 132 | + documentoDoc.setField("nivelAcesso", documentoGed.getNivelAcesso().getNivelAcesso().getDescricao()); | |
| 133 | + documentoDoc.setField("formatoDocumento", documentoGed.getFormaCriacao().getDescricao()); | |
| 134 | + // verifica se o nivel de acesso é restrito | |
| 135 | + if (!documentoGed.getNivelAcesso().getNivelAcesso().getCodigo().equals(1L)) { | |
| 136 | + | |
| 137 | + documentoDoc.setField("conteudo", documentoGed.getFormaCriacao().getCodigo().equals(1L) ? Jsoup.parse(documentoGed.getConteudo()).text() : documentoGed.getConteudo()); | |
| 138 | + } else { | |
| 139 | + | |
| 140 | + documentoDoc.setField("conteudo", INFORMAÇÃO_RESTRITA); | |
| 141 | + } | |
| 142 | + | |
| 143 | + solrClient.add(documentoDoc); | |
| 136 | 144 | |
| 137 | 145 | // Make the docs we just added searchable using a "hard" commit |
| 138 | 146 | solrClient.commit(true, true); | ... | ... |
cit-ecm-api/src/main/java/br/com/centralit/api/service/impl/TarjaAssinaturaServiceImpl.java
0 → 100644
| ... | ... | @@ -0,0 +1,93 @@ |
| 1 | +package br.com.centralit.api.service.impl; | |
| 2 | + | |
| 3 | +import java.io.IOException; | |
| 4 | + | |
| 5 | +import org.apache.log4j.Logger; | |
| 6 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 7 | +import org.springframework.beans.factory.annotation.Qualifier; | |
| 8 | +import org.springframework.stereotype.Service; | |
| 9 | +import org.springframework.validation.Validator; | |
| 10 | +import org.springframework.web.multipart.MultipartFile; | |
| 11 | + | |
| 12 | +import br.com.centralit.api.dao.TarjaAssinaturaDao; | |
| 13 | +import br.com.centralit.api.model.TarjaAssinatura; | |
| 14 | +import br.com.centralit.api.service.AnexoImagemService; | |
| 15 | +import br.com.centralit.api.service.OrganizacaoService; | |
| 16 | +import br.com.centralit.api.service.TarjaAssinaturaService; | |
| 17 | +import br.com.centralit.framework.model.AnexoImagem; | |
| 18 | +import br.com.centralit.framework.model.Organizacao; | |
| 19 | +import br.com.centralit.framework.service.arquitetura.GenericServiceImpl; | |
| 20 | + | |
| 21 | +/** | |
| 22 | + * <p><img src="http://centralit.com.br/images/logo_central.png"></p> | |
| 23 | + * | |
| 24 | + * <p><b>Company: </b> Central IT - Governança Corporativa - </p> | |
| 25 | + * | |
| 26 | + * <p><b>Description: </b></p> | |
| 27 | + * Classe de serviços para a entidade TarjaAssinatura, a qual mantém as regras de negócio. | |
| 28 | + * | |
| 29 | + * @since 13 de abr de 2016 - 13:40:36 | |
| 30 | + * @version 1.0.0 | |
| 31 | + * @author ciro.junior (<a href="mailto:ciro.junior@centralit.com.br">ciro.junior@centralit.com.br</a>) | |
| 32 | + * | |
| 33 | + */ | |
| 34 | +@Service("tarjaAssinaturaService") | |
| 35 | +public class TarjaAssinaturaServiceImpl extends GenericServiceImpl<TarjaAssinatura, Long> implements TarjaAssinaturaService { | |
| 36 | + | |
| 37 | + private static final Logger LOG = Logger.getLogger(TarjaAssinaturaServiceImpl.class); | |
| 38 | + | |
| 39 | + @Autowired | |
| 40 | + private OrganizacaoService organizacaoService; | |
| 41 | + | |
| 42 | + @Autowired | |
| 43 | + private AnexoImagemService anexoImagemService; | |
| 44 | + | |
| 45 | + private TarjaAssinaturaDao tarjaAssinaturaDao; | |
| 46 | + | |
| 47 | + @Autowired | |
| 48 | + public TarjaAssinaturaServiceImpl (TarjaAssinaturaDao tarjaAssinaturaDao, @Qualifier("tarjaAssinaturaValidator") Validator validator) { | |
| 49 | + this.dao = tarjaAssinaturaDao; | |
| 50 | + this.tarjaAssinaturaDao = tarjaAssinaturaDao; | |
| 51 | + this.validator = validator; | |
| 52 | + } | |
| 53 | + | |
| 54 | + public TarjaAssinatura save (TarjaAssinatura tarjaAssinatura){ | |
| 55 | + return this.merge(tarjaAssinatura); | |
| 56 | + } | |
| 57 | + | |
| 58 | + @Override | |
| 59 | + public TarjaAssinatura merge(TarjaAssinatura tarjaAssinatura) { | |
| 60 | + this.validarEntidade(tarjaAssinatura, this.validator); | |
| 61 | + return super.merge(tarjaAssinatura); | |
| 62 | + } | |
| 63 | + | |
| 64 | + @Override | |
| 65 | + public TarjaAssinatura removeImagem (TarjaAssinatura tarjaAssinatura) { | |
| 66 | + if(tarjaAssinatura.getAnexoImagem() != null) { | |
| 67 | + anexoImagemService.removeById(tarjaAssinatura.getAnexoImagem().getId()); | |
| 68 | + tarjaAssinatura.setAnexoImagem(null); | |
| 69 | + } | |
| 70 | + return this.merge(tarjaAssinatura); | |
| 71 | + } | |
| 72 | + | |
| 73 | + /**{@inheritDoc}*/ | |
| 74 | + @Override | |
| 75 | + public void uploadAnexoImagemTarja(MultipartFile file, Long idOrganizacao, Long idTarjaAssinatura) { | |
| 76 | + | |
| 77 | + AnexoImagem anexoImagem = new AnexoImagem (); | |
| 78 | + try { | |
| 79 | + Organizacao organizacao = (Organizacao) this.organizacaoService.find(idOrganizacao); | |
| 80 | + anexoImagem.setAnexo(file.getBytes()); | |
| 81 | + anexoImagem.setDescricao(file.getOriginalFilename()); | |
| 82 | + anexoImagem.setOrganizacao(organizacao); | |
| 83 | + | |
| 84 | + AnexoImagem anexoImagemSaved = anexoImagemService.save(anexoImagem); | |
| 85 | + TarjaAssinatura tarjaAssinatura = (TarjaAssinatura) this.tarjaAssinaturaDao.find(idTarjaAssinatura); | |
| 86 | + tarjaAssinatura.setAnexoImagem(anexoImagemSaved); | |
| 87 | + this.merge(tarjaAssinatura); | |
| 88 | + } catch (IOException ioe) { | |
| 89 | + LOG.error("N\u00e3o consegui anexar a imagem \u00e0 entidade TarjaAssinatura. Verifique a exce\u00e7\u00e3o para " | |
| 90 | + + "identificar a causa: ", ioe.getCause()); | |
| 91 | + } | |
| 92 | + } | |
| 93 | +} | ... | ... |
cit-ecm-api/src/main/java/br/com/centralit/api/service/impl/UnidadeProcessoServiceImpl.java
| ... | ... | @@ -105,7 +105,7 @@ public class UnidadeProcessoServiceImpl extends GenericServiceImpl<UnidadeProces |
| 105 | 105 | /** Atributo historicoAtribuicaoProcessoService. */ |
| 106 | 106 | @Autowired |
| 107 | 107 | private HistoricoAtribuicaoProcessoService historicoAtribuicaoProcessoService; |
| 108 | - | |
| 108 | + | |
| 109 | 109 | /** |
| 110 | 110 | * Responsável pela criação de novas instâncias desta classe. |
| 111 | 111 | * |
| ... | ... | @@ -325,18 +325,43 @@ public class UnidadeProcessoServiceImpl extends GenericServiceImpl<UnidadeProces |
| 325 | 325 | |
| 326 | 326 | return this.unidadeProcessoDao.obterPorUnidadeEProcesso(idProcesso, idUnidade); |
| 327 | 327 | } |
| 328 | - | |
| 328 | + | |
| 329 | 329 | /** |
| 330 | 330 | * Método responsável por listar processos através da unidade do usuário |
| 331 | + * | |
| 331 | 332 | * @author rogerio.cassimiro |
| 332 | 333 | * @param search |
| 333 | 334 | * @return <RT> SearchResult<RT> |
| 334 | 335 | */ |
| 335 | 336 | @Override |
| 336 | 337 | public <RT> SearchResult<RT> searchAndCountPorUnidade(ISearch search) { |
| 338 | + | |
| 337 | 339 | Dominio dominioStatusProcesso = dominioService.findByChaveAndCodigo(Dominio.TIPO_STATUS_PROCESSO_ECM, Dominio.TIPO_STATUS_PROCESSO_ECM_CONCLUIDO); |
| 338 | 340 | Usuario usuario = ( (Usuario) SecurityContextHolder.getContext().getAuthentication().getPrincipal() ); |
| 339 | 341 | return this.unidadeProcessoDao.searchAndCountPorUnidade(search, usuario, dominioStatusProcesso.getId()); |
| 340 | 342 | } |
| 341 | - | |
| 342 | -} | |
| 343 | 343 | \ No newline at end of file |
| 344 | + | |
| 345 | + /** | |
| 346 | + * <p> | |
| 347 | + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a> | |
| 348 | + * </p> | |
| 349 | + * | |
| 350 | + * <p> | |
| 351 | + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> | |
| 352 | + * </p> | |
| 353 | + * | |
| 354 | + * Método responsável por verificar se o processo foi enviado para outra unidade | |
| 355 | + * | |
| 356 | + * @author rogerio.costa | |
| 357 | + * | |
| 358 | + * @param idProcesso | |
| 359 | + * | |
| 360 | + * @return Boolean | |
| 361 | + */ | |
| 362 | + public Boolean isProcessoEnviado(Long idProcesso) { | |
| 363 | + | |
| 364 | + return this.unidadeProcessoDao.isProcessoEnviado(idProcesso); | |
| 365 | + | |
| 366 | + } | |
| 367 | + | |
| 368 | +} | ... | ... |
cit-ecm-api/src/main/java/br/com/centralit/api/service/validation/TarjaAssinaturaValidator.java
0 → 100644
| ... | ... | @@ -0,0 +1,29 @@ |
| 1 | +package br.com.centralit.api.service.validation; | |
| 2 | + | |
| 3 | +import org.springframework.stereotype.Component; | |
| 4 | +import org.springframework.validation.Errors; | |
| 5 | +import org.springframework.validation.ValidationUtils; | |
| 6 | +import org.springframework.validation.Validator; | |
| 7 | + | |
| 8 | +import br.com.centralit.api.model.TarjaAssinatura; | |
| 9 | +import br.com.centralit.framework.exception.CodigoErro; | |
| 10 | + | |
| 11 | +@Component("tarjaAssinaturaValidator") | |
| 12 | +public class TarjaAssinaturaValidator implements Validator{ | |
| 13 | + | |
| 14 | + @Override | |
| 15 | + public boolean supports(Class<?> clazz) { | |
| 16 | + | |
| 17 | + return TarjaAssinatura.class.isAssignableFrom(clazz); | |
| 18 | + } | |
| 19 | + | |
| 20 | + @Override | |
| 21 | + public void validate(Object target, Errors errors) { | |
| 22 | + | |
| 23 | + ValidationUtils.rejectIfEmpty(errors, "descricao", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "LABEL.DESCRICAO"); | |
| 24 | + ValidationUtils.rejectIfEmpty(errors, "conteudo", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "ECM.LABEL.CONTEUDO_HTML"); | |
| 25 | + | |
| 26 | + } | |
| 27 | + | |
| 28 | + | |
| 29 | +} | ... | ... |
cit-ecm-api/src/main/resources/scripts/v1.0.0-alpha9/01-cit-ecm-1.0.0-ALFA-3-postgres.sql
0 → 100644
| ... | ... | @@ -0,0 +1,39 @@ |
| 1 | +-- CIRO - 18/04/2016 - INICIO | |
| 2 | + | |
| 3 | +ALTER TABLE anexoimagem DROP CONSTRAINT fk_jrmn20bykidk1pkxu492d4bmx; | |
| 4 | +DROP TABLE anexoimagem; | |
| 5 | + | |
| 6 | +CREATE TABLE anexoimagem | |
| 7 | +( | |
| 8 | + id bigint NOT NULL, | |
| 9 | + databloqueio date, | |
| 10 | + datainativo date, | |
| 11 | + datacriacao timestamp without time zone NOT NULL, | |
| 12 | + dataedicao timestamp without time zone NOT NULL, | |
| 13 | + version bigint, | |
| 14 | + anexo bytea, | |
| 15 | + descricao character varying(300), | |
| 16 | + inativador_id bigint, | |
| 17 | + autor_id bigint, | |
| 18 | + editor_id bigint, | |
| 19 | + organizacao_id bigint, | |
| 20 | + CONSTRAINT anexoimagem_pkey PRIMARY KEY (id), | |
| 21 | + CONSTRAINT fk_5hyw0geaeeh6hnssbssi7htvb FOREIGN KEY (editor_id) | |
| 22 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
| 23 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
| 24 | + CONSTRAINT fk_76rf21tx2q8px4fjbsavu4kva FOREIGN KEY (inativador_id) | |
| 25 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
| 26 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
| 27 | + CONSTRAINT fk_cx5i3h3y5675r622to4rddra3 FOREIGN KEY (autor_id) | |
| 28 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
| 29 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
| 30 | + CONSTRAINT fk_few35t9tvbqe49wakqts3mt4l FOREIGN KEY (organizacao_id) | |
| 31 | + REFERENCES organizacao (id) MATCH SIMPLE | |
| 32 | + ON UPDATE NO ACTION ON DELETE NO ACTION | |
| 33 | +); | |
| 34 | + | |
| 35 | +INSERT INTO tarjaassinatura(id, databloqueio, datainativo, datacriacao, dataedicao, version, conteudo, descricao, inativador_id, autor_id, editor_id, anexoimagem_id, tipoassinatura_id) | |
| 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 | +INSERT INTO tarjaassinatura(id, databloqueio, datainativo, datacriacao, dataedicao, version, conteudo, descricao, inativador_id, autor_id, editor_id, anexoimagem_id, tipoassinatura_id) | |
| 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 | |
| 0 | 40 | \ No newline at end of file | ... | ... |
cit-ecm-web/pom.xml
| ... | ... | @@ -31,22 +31,16 @@ |
| 31 | 31 | <packaging>war</packaging> |
| 32 | 32 | <name>cit-ecm-web</name> |
| 33 | 33 | |
| 34 | - <properties> | |
| 35 | - <findbugs.config.path>${project.parent.parent.parent.basedir}/filterfile.xml</findbugs.config.path> | |
| 36 | - <license.config.path>${project.parent.parent.basedir}/src/licensing</license.config.path> | |
| 37 | - <maven-antrun-plugin.phase>package</maven-antrun-plugin.phase> | |
| 38 | - <minify-maven-plugin.phase>prepare-package</minify-maven-plugin.phase> | |
| 39 | - </properties> | |
| 34 | + <properties> | |
| 35 | + <findbugs.config.path>${project.parent.parent.parent.basedir}/filterfile.xml</findbugs.config.path> | |
| 36 | + <license.config.path>${project.parent.parent.basedir}/src/licensing</license.config.path> | |
| 37 | + <maven-antrun-plugin.phase>package</maven-antrun-plugin.phase> | |
| 38 | + <minify-maven-plugin.phase>prepare-package</minify-maven-plugin.phase> | |
| 39 | + </properties> | |
| 40 | 40 | |
| 41 | 41 | <dependencies> |
| 42 | 42 | <dependency> |
| 43 | 43 | <groupId>br.com.centralit</groupId> |
| 44 | - <artifactId>cit-core</artifactId> | |
| 45 | - <version>${cit-core.version}</version> | |
| 46 | - </dependency> | |
| 47 | - | |
| 48 | - <dependency> | |
| 49 | - <groupId>br.com.centralit</groupId> | |
| 50 | 44 | <artifactId>cit-ecm-api</artifactId> |
| 51 | 45 | </dependency> |
| 52 | 46 | </dependencies> | ... | ... |
cit-ecm-web/src/main/java/br/com/centralit/controller/DocumentoGedController.java
| ... | ... | @@ -16,12 +16,50 @@ import br.com.centralit.framework.controller.GenericController; |
| 16 | 16 | import br.com.centralit.framework.json.ResponseBodyWrapper; |
| 17 | 17 | import br.com.centralit.framework.view.ResultResponseVH; |
| 18 | 18 | |
| 19 | +/** | |
| 20 | + * <p> | |
| 21 | + * <img src="http://centralit.com.br/images/logo_central.png"> | |
| 22 | + * </p> | |
| 23 | + * | |
| 24 | + * <p> | |
| 25 | + * <b>Company: </b> Central IT - Governança Corporativa - | |
| 26 | + * </p> | |
| 27 | + * | |
| 28 | + * <p> | |
| 29 | + * <b>Title: </b> | |
| 30 | + * </p> | |
| 31 | + * | |
| 32 | + * <p> | |
| 33 | + * <b>Description: </b> | |
| 34 | + * </p> | |
| 35 | + * | |
| 36 | + * <p> | |
| 37 | + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a> | |
| 38 | + * </p> | |
| 39 | + * | |
| 40 | + * <p> | |
| 41 | + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> | |
| 42 | + * </p> | |
| 43 | + * | |
| 44 | + * @since 25/04/2016 - 09:18:05 | |
| 45 | + * | |
| 46 | + * @version 1.0.0 | |
| 47 | + * | |
| 48 | + * @author rogerio.costa | |
| 49 | + * | |
| 50 | + */ | |
| 19 | 51 | @Controller |
| 20 | 52 | @RequestMapping("/rest/documentoGed") |
| 21 | 53 | public class DocumentoGedController extends GenericController<DocumentoGed> { |
| 22 | 54 | |
| 55 | + /** Atributo documentoGedService. */ | |
| 23 | 56 | private DocumentoGedService documentoGedService; |
| 24 | 57 | |
| 58 | + /** | |
| 59 | + * Responsável pela criação de novas instâncias desta classe. | |
| 60 | + * | |
| 61 | + * @param documentoGedService | |
| 62 | + */ | |
| 25 | 63 | @Autowired |
| 26 | 64 | public DocumentoGedController( DocumentoGedService documentoGedService ) { |
| 27 | 65 | ... | ... |
cit-ecm-web/src/main/java/br/com/centralit/controller/TarjaAssinaturaController.java
0 → 100644
| ... | ... | @@ -0,0 +1,65 @@ |
| 1 | +package br.com.centralit.controller; | |
| 2 | + | |
| 3 | +import javax.servlet.http.HttpServletRequest; | |
| 4 | + | |
| 5 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 6 | +import org.springframework.stereotype.Controller; | |
| 7 | +import org.springframework.web.bind.annotation.RequestBody; | |
| 8 | +import org.springframework.web.bind.annotation.RequestMapping; | |
| 9 | +import org.springframework.web.bind.annotation.RequestMethod; | |
| 10 | +import org.springframework.web.bind.annotation.RequestParam; | |
| 11 | +import org.springframework.web.bind.annotation.ResponseBody; | |
| 12 | +import org.springframework.web.multipart.MultipartFile; | |
| 13 | + | |
| 14 | +import br.com.centralit.api.framework.json.ViewsEcm; | |
| 15 | +import br.com.centralit.api.model.TarjaAssinatura; | |
| 16 | +import br.com.centralit.api.service.TarjaAssinaturaService; | |
| 17 | +import br.com.centralit.framework.controller.GenericController; | |
| 18 | +import br.com.centralit.framework.json.ResponseBodyWrapper; | |
| 19 | + | |
| 20 | +@Controller | |
| 21 | +@RequestMapping("/rest/tarjaAssinatura") | |
| 22 | +public class TarjaAssinaturaController extends GenericController<TarjaAssinatura> { | |
| 23 | + | |
| 24 | + private TarjaAssinaturaService tarjaAssinaturaService; | |
| 25 | + | |
| 26 | + @Override | |
| 27 | + public Class<ViewsEcm.TarjaAssinaturaEditview> getEditView() { | |
| 28 | + return ViewsEcm.TarjaAssinaturaEditview.class; | |
| 29 | + } | |
| 30 | + | |
| 31 | + @Autowired | |
| 32 | + public TarjaAssinaturaController( TarjaAssinaturaService tarjaAssinaturaService ) { | |
| 33 | + super(tarjaAssinaturaService); | |
| 34 | + this.tarjaAssinaturaService = tarjaAssinaturaService; | |
| 35 | + } | |
| 36 | + | |
| 37 | + @ResponseBody | |
| 38 | + @RequestMapping(value = "/uploadFileLogo", method = RequestMethod.POST) | |
| 39 | + public void uploadFileHandle(@RequestParam(value = "filename", required = false) String name, | |
| 40 | + @RequestParam("file") MultipartFile file, HttpServletRequest request, | |
| 41 | + @RequestParam("idOrganizacao") Long idOrganizacao, | |
| 42 | + @RequestParam("idTarjaAssinatura") String idTarjaAssinatura) { | |
| 43 | + | |
| 44 | + this.tarjaAssinaturaService.uploadAnexoImagemTarja(file, idOrganizacao, Long.parseLong(idTarjaAssinatura)); | |
| 45 | + } | |
| 46 | + | |
| 47 | + @ResponseBody | |
| 48 | + @RequestMapping(value = "/saveTarjaAssinatura", method = RequestMethod.POST, produces = "application/json") | |
| 49 | + public ResponseBodyWrapper save(@RequestBody TarjaAssinatura tarjaAssinatura) throws Exception { | |
| 50 | + | |
| 51 | + ResponseBodyWrapper responseBody = new ResponseBodyWrapper(this.tarjaAssinaturaService.save(tarjaAssinatura), getEditView()); | |
| 52 | + | |
| 53 | + return responseBody; | |
| 54 | + } | |
| 55 | + | |
| 56 | + @ResponseBody | |
| 57 | + @RequestMapping(value = "/removeImagem", method = RequestMethod.POST, produces = "application/json") | |
| 58 | + public ResponseBodyWrapper removeImagem(@RequestBody TarjaAssinatura tarjaAssinatura) throws Exception { | |
| 59 | + | |
| 60 | + ResponseBodyWrapper responseBody = new ResponseBodyWrapper(this.tarjaAssinaturaService.removeImagem(tarjaAssinatura), getEditView()); | |
| 61 | + | |
| 62 | + return responseBody; | |
| 63 | + } | |
| 64 | + | |
| 65 | +} | ... | ... |
cit-ecm-web/src/main/java/br/com/centralit/listener/StartupListenerEcm.java
| ... | ... | @@ -168,9 +168,9 @@ public class StartupListenerEcm extends UtilStartup implements ApplicationListen |
| 168 | 168 | |
| 169 | 169 | List<Dominio> list = new ArrayList<Dominio>(); |
| 170 | 170 | |
| 171 | - list.add(new Dominio("statusDocumentoGed", "Minuta", "MINUTA", 1L)); | |
| 172 | - list.add(new Dominio("statusDocumentoGed", "Original", "ORIGINAL", 2L)); | |
| 173 | - list.add(new Dominio("statusDocumentoGed", "Cópia", "COPIA", 3L)); | |
| 171 | + list.add(new Dominio("estadoDocumentoGed", "Minuta", "MINUTA", 1L)); | |
| 172 | + list.add(new Dominio("estadoDocumentoGed", "Original", "ORIGINAL", 2L)); | |
| 173 | + list.add(new Dominio("estadoDocumentoGed", "Cópia", "COPIA", 3L)); | |
| 174 | 174 | |
| 175 | 175 | list.add(new Dominio("tipoDestinacao", "Guardar Permanente", "GUARDAR_PERMANENTE", 1L)); |
| 176 | 176 | list.add(new Dominio("tipoDestinacao", "Eliminação", "ELIMINAR", 2L)); |
| ... | ... | @@ -204,6 +204,26 @@ public class StartupListenerEcm extends UtilStartup implements ApplicationListen |
| 204 | 204 | |
| 205 | 205 | list.add(new Dominio("statusProcesso", "Concluído", "CONCLUIDO", 1L)); |
| 206 | 206 | list.add(new Dominio("statusProcesso", "Em andamento", "EM_ANDAMENTO", 2L)); |
| 207 | + list.add(new Dominio("statusProcesso", "Aguardando Validação", "AGUARDANDO_VALIDACAO", 3L)); | |
| 208 | + list.add(new Dominio("statusProcesso", "Validado", "VALIDADO", 4L)); | |
| 209 | + | |
| 210 | + list.add(new Dominio("statusDocumentoGed", "Aguardando Validação", "AGUARDANDO_VALIDACAO", 0L)); | |
| 211 | + list.add(new Dominio("statusDocumentoGed", "Validado", "VALIDADO", 1L)); | |
| 212 | + | |
| 213 | + list.add(new Dominio("filtroPesquisa", "Ambos", "AMBOS", 0L)); | |
| 214 | + list.add(new Dominio("filtroPesquisa", "Processo", "PROCESSO", 1L)); | |
| 215 | + list.add(new Dominio("filtroPesquisa", "Documento", "DOCUMENTO", 2L)); | |
| 216 | + | |
| 217 | + list.add(new Dominio("filtroData", "Em qualquer data", "QUAL_QUER_DATA", 0L)); | |
| 218 | + list.add(new Dominio("filtroData", "Na última hora", "ULTIMA_HORA", 1L)); | |
| 219 | + list.add(new Dominio("filtroData", "Nas últimas 24 horas", "ULTIMAS_24_HORA", 2L)); | |
| 220 | + list.add(new Dominio("filtroData", "Na última semana", "ULTIMA_SEMANA", 3L)); | |
| 221 | + list.add(new Dominio("filtroData", "No último mês", "ULTIMO_MES", 4L)); | |
| 222 | + list.add(new Dominio("filtroData", "No último ano", "ULTIMO_ANO", 5L)); | |
| 223 | + list.add(new Dominio("filtroData", "Intervalo personalizado", "INTERVALO_PERSONALIZADO", 6L)); | |
| 224 | + | |
| 225 | + list.add(new Dominio("tipoAssinatura", "Assinatura interna", "ASSINATURA_INTERNA", 1L)); | |
| 226 | + list.add(new Dominio("tipoAssinatura", "Assinatura por certificado digital", "ASSINATURA_CERTIFICADO_DIGITAL", 2L)); | |
| 207 | 227 | |
| 208 | 228 | this.dominioService.saveListIfNotExist(list); |
| 209 | 229 | |
| ... | ... | @@ -403,7 +423,13 @@ public class StartupListenerEcm extends UtilStartup implements ApplicationListen |
| 403 | 423 | internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.NOME_NOVO_SUPORTE ", "Nome do suporte", dominio, modulo)); |
| 404 | 424 | internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.NOVO_TIPO_SUPORTE ", "Novo tipo suporte de documento", dominio, modulo)); |
| 405 | 425 | internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.TIPO_SUPORTE_DOCUMENTO ", "Tipo suporte de documento", dominio, modulo)); |
| 406 | - internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.DIGITE_PROTOCOLO", "Digite o potocolo", dominio, modulo)); | |
| 426 | + internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.TARJAS_ASSINATURA", "Tarjas de assinatura", dominio, modulo)); | |
| 427 | + internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.LOGO_TARJA_ASSINATURA", "Logotipo da tarja de assinatura", dominio, modulo)); | |
| 428 | + internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.DADOS_TARJA_ASSINATURA", "Dados da tarja de assinatura", dominio, modulo)); | |
| 429 | + internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.TIPO_ASSINATURA", "Tipo de assinatura", dominio, modulo)); | |
| 430 | + internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.CONTEUDO_HTML", "Conteúdo HTML", dominio, modulo)); | |
| 431 | + internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.REMOVER_IMAGEM", "Remover imagem", dominio, modulo)); | |
| 432 | + internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.CAMPOS_DINAMICOS", "Campos Dinâmicos", dominio, modulo)); | |
| 407 | 433 | internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.SOBRESTAR_SEM", "Sobrestar", dominio, modulo)); |
| 408 | 434 | internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.SOBRESTADA", "Sobrestada", dominio, modulo)); |
| 409 | 435 | internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.SITUACAO_INSTANCIA_TAREFA", "Situação instância tarefa", dominio, modulo)); |
| ... | ... | @@ -416,11 +442,19 @@ public class StartupListenerEcm extends UtilStartup implements ApplicationListen |
| 416 | 442 | internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.CERTIFICADO_DIGITAL", "Certificado Digital", dominio, modulo)); |
| 417 | 443 | internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.ASSINATURA_DOCUMENTO", "Assinatura de Documento", dominio, modulo)); |
| 418 | 444 | internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.ASSINAR", "Assinar", dominio, modulo)); |
| 445 | + internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.UNIDADE_GESTORA ", "Unidade gestora", dominio, modulo)); | |
| 446 | + internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.DATA_CRIACAO ", "Data criação", dominio, modulo)); | |
| 447 | + internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.PLACEHOLDER_PESQUISA ", "Digite o Nup, tipo de processo, tipo de documento, conteúdo do documento, autor, assunto, destinatário...", dominio, modulo)); | |
| 448 | + internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.ATE", "Até", dominio, modulo)); | |
| 449 | + internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.VALIDADO", "Validado", dominio, modulo)); | |
| 450 | + internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.ESTADO", "Estado", dominio, modulo)); | |
| 451 | + internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.VALIDAR", "Validar", dominio, modulo)); | |
| 452 | + internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.NAO_CONTEM_DOCUMENTOS", "Não contém documentos", dominio, modulo)); | |
| 419 | 453 | internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.DATA_DA_ASSINATURA", "Data da assinatura", dominio, modulo)); |
| 420 | 454 | internacionalizacaoList.add(new Internacionalizacao("ECM.ASSINADO_SUCESSO", "Documento assinado com sucesso!", dominio, modulo)); |
| 421 | 455 | internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.ASSINATURA_DO_DOCUMENTO", "Assinatura do Documento", dominio, modulo)); |
| 422 | 456 | internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.DOCUMENTO_SEM_ASSINATURA", "Documento sem assinaturas!", dominio, modulo)); |
| 423 | - | |
| 457 | + | |
| 424 | 458 | } |
| 425 | 459 | |
| 426 | 460 | /** |
| ... | ... | @@ -453,6 +487,9 @@ public class StartupListenerEcm extends UtilStartup implements ApplicationListen |
| 453 | 487 | internacionalizacaoList.add(new Internacionalizacao("ECM.VALIDACAO.REMOCAO_COM_VINCULO", "Não é possível excluir pois o mesmo encontra-se em uso por outro cadastro no sistema!", dominio, modulo)); |
| 454 | 488 | internacionalizacaoList.add(new Internacionalizacao("ECM.VALIDACAO.PERMISSAO_OPERACAO", "Você não tem permissão para executar a operação.", dominio, modulo)); |
| 455 | 489 | internacionalizacaoList.add(new Internacionalizacao("ECM.VALIDACAO.GRUPO_PADRAO_EM_OUTRA_UNIDADE", "O grupo selecionado como padrão está sendo usado como grupo padrão da unidade ", dominio, modulo)); |
| 490 | + internacionalizacaoList.add(new Internacionalizacao("ECM.VALIDACAO.VALIDAR_ALTERACAO_NIVEL_ACESSO_OUTRAS_UNIDADES", "Não é possível alterar o nível de acesso para sigiloso, pois o processo foi enviado para outra unidade.", dominio, modulo)); | |
| 491 | + internacionalizacaoList.add(new Internacionalizacao("ECM.VALIDACAO.VALIDAR_NIVEL_ACESSO", "Não é possível incluir documento com o nível de acesso menor que o do processo.", dominio, modulo)); | |
| 492 | + | |
| 456 | 493 | internacionalizacaoList.add(new Internacionalizacao("ECM.VALIDACAO.SENHA_ASSINATURA", "Informe sua senha para assinar!", dominio, modulo)); |
| 457 | 494 | } |
| 458 | 495 | |
| ... | ... | @@ -523,12 +560,15 @@ public class StartupListenerEcm extends UtilStartup implements ApplicationListen |
| 523 | 560 | internacionalizacaoList.add(new Internacionalizacao("ECM.MSG.CAPTURADO_SUCESSO", "Processo capturado com sucesso!", dominio, modulo)); |
| 524 | 561 | internacionalizacaoList.add(new Internacionalizacao("ECM.MSG.LEGENDA_CAMPO_DINAMICO_NUMERO_DOCUMENTO", "Use: @numeroDocumento@ para adicionar o número do documento", dominio, modulo)); |
| 525 | 562 | internacionalizacaoList.add(new Internacionalizacao("ECM.MSG.PROCESSO_CONCLUIDO_SUCESSO", "Processo concluído com sucesso!", dominio, modulo)); |
| 526 | - internacionalizacaoList.add(new Internacionalizacao("ECM.MSG.PROCESSO_SALVO_SUCESSO", "O processo !", dominio, modulo)); | |
| 563 | + internacionalizacaoList.add(new Internacionalizacao("ECM.MSG.O_PROCESSO", "O processo", dominio, modulo)); | |
| 564 | + internacionalizacaoList.add(new Internacionalizacao("ECM.MSG.SALVO_SUCESSO", "Foi salvo com sucesso!", dominio, modulo)); | |
| 527 | 565 | internacionalizacaoList.add(new Internacionalizacao("ECM.MSG.NAO_EXISTE_TAREFA_EXECUTAR", "Não existem tarefas a serem executadas!", dominio, modulo)); |
| 528 | 566 | internacionalizacaoList.add(new Internacionalizacao("ECM.MSG.CONFIRMA_SOBRESTAMENTO_TAREFA", "Confirma o sobrestamento da tarefa?", dominio, modulo)); |
| 529 | 567 | internacionalizacaoList.add(new Internacionalizacao("ECM.MSG.TAREFA_SOBRESTADA_SUCESSO", "Tarefa sobrestada com sucesso!", dominio, modulo)); |
| 530 | 568 | internacionalizacaoList.add(new Internacionalizacao("ECM.MSG.CONFIRMA_REATIVACAO_TAREFA", "Confirma reativação da tarefa?", dominio, modulo)); |
| 531 | 569 | internacionalizacaoList.add(new Internacionalizacao("ECM.MSG.TAREFA_REATIVADA", "Tarefa reativada com sucesso", dominio, modulo)); |
| 570 | + internacionalizacaoList.add(new Internacionalizacao("ECM.MSG.VALIDADO", "Validado com sucesso!", dominio, modulo)); | |
| 571 | + internacionalizacaoList.add(new Internacionalizacao("ECM.MSG.SELECIONE_UM_ITEM_PARA_VALIDACAO", "Selecione um item para validar.", dominio, modulo)); | |
| 532 | 572 | internacionalizacaoList.add(new Internacionalizacao("ECM.MSG.ERRO_PERMISSAO_ASSINAR", "Erro! Para assinar documentos é necessário possuir o papel “Servidor” ou “Terceirizado” com “Função” preenchida no Cadastro de Pessoas!", dominio, modulo)); |
| 533 | 573 | internacionalizacaoList.add(new Internacionalizacao("ECM.MSG.USUARIO_SEM_PESSOA", "Usuário não está presente no Cadastro de Pessoa!", dominio, modulo)); |
| 534 | 574 | internacionalizacaoList.add(new Internacionalizacao("ECM.MSG.DOCUMENTO_SEM_ASSINATURAS", "Esta versão do Documento não possui assinaturas!", dominio, modulo)); | ... | ... |
cit-ecm-web/src/main/resources/spring/applicationContext.xml
| 1 | 1 | <beans xmlns="http://www.springframework.org/schema/beans" |
| 2 | - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx" | |
| 3 | - xmlns:context="http://www.springframework.org/schema/context" | |
| 4 | - xmlns:aop="http://www.springframework.org/schema/aop" xmlns:faces="http://www.springframework.org/schema/faces" | |
| 5 | - xmlns:int-security="http://www.springframework.org/schema/integration/security" | |
| 6 | - xmlns:sec="http://www.springframework.org/schema/security" xmlns:task="http://www.springframework.org/schema/task" | |
| 7 | - xmlns:util="http://www.springframework.org/schema/util" xmlns:p="http://www.springframework.org/schema/p" | |
| 8 | - xsi:schemaLocation="http://www.springframework.org/schema/beans | |
| 9 | - http://www.springframework.org/schema/beans/spring-beans-3.1.xsd | |
| 10 | - http://www.springframework.org/schema/faces | |
| 11 | - http://www.springframework.org/schema/faces/spring-faces-3.1.xsd | |
| 12 | - http://www.springframework.org/schema/tx | |
| 13 | - http://www.springframework.org/schema/tx/spring-tx-3.1.xsd | |
| 14 | - http://www.springframework.org/schema/context | |
| 15 | - http://www.springframework.org/schema/context/spring-context-3.1.xsd | |
| 16 | - http://www.springframework.org/schema/aop | |
| 17 | - http://www.springframework.org/schema/aop/spring-aop-3.1.xsd | |
| 18 | - http://www.springframework.org/schema/task | |
| 19 | - http://www.springframework.org/schema/task/spring-task-3.1.xsd | |
| 20 | - http://www.springframework.org/schema/security | |
| 21 | - http://www.springframework.org/schema/security/spring-security-3.1.xsd | |
| 22 | - http://www.springframework.org/schema/util | |
| 23 | - http://www.springframework.org/schema/util/spring-util-3.1.xsd | |
| 24 | - http://www.springframework.org/schema/integration | |
| 25 | - http://www.springframework.org/schema/integration/spring-integration.xsd | |
| 26 | - http://www.springframework.org/schema/integration/security | |
| 27 | - http://www.springframework.org/schema/integration/security/spring-integration-security-3.1.xsd"> | |
| 2 | + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
| 3 | + xmlns:context="http://www.springframework.org/schema/context" | |
| 4 | + xmlns:util="http://www.springframework.org/schema/util" | |
| 5 | + xmlns:p="http://www.springframework.org/schema/p" | |
| 6 | + xsi:schemaLocation="http://www.springframework.org/schema/beans | |
| 7 | + http://www.springframework.org/schema/beans/spring-beans-3.1.xsd | |
| 8 | + http://www.springframework.org/schema/context | |
| 9 | + http://www.springframework.org/schema/context/spring-context-3.1.xsd | |
| 10 | + http://www.springframework.org/schema/util | |
| 11 | + http://www.springframework.org/schema/util/spring-util-3.1.xsd"> | |
| 28 | 12 | |
| 29 | 13 | <bean id="citPortalDataSource" class="org.springframework.jndi.JndiObjectFactoryBean"> |
| 30 | 14 | <property name="jndiName" value="java:/env/jdbc/cit-ecm" /> |
| 31 | 15 | </bean> |
| 32 | 16 | |
| 33 | 17 | <bean id="entityManagerFactory" |
| 34 | - class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean" | |
| 35 | - p:packagesToScan="br.com.centralit.framework.model, br.com.centralit.api.model" p:dataSource-ref="citPortalDataSource" | |
| 36 | - p:jpaPropertyMap-ref="jpaPropertyMap" p:jpaVendorAdapter-ref="jpaVendorAdapter" /> | |
| 18 | + class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean" | |
| 19 | + p:packagesToScan="br.com.centralit.framework.model, br.com.centralit.api.model" | |
| 20 | + p:dataSource-ref="citPortalDataSource" p:jpaPropertyMap-ref="jpaPropertyMap" | |
| 21 | + p:jpaVendorAdapter-ref="jpaVendorAdapter" /> | |
| 37 | 22 | |
| 38 | 23 | <bean id="jpaVendorAdapter" class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter" /> |
| 39 | - | |
| 40 | - <bean id="webExpressionHandler" class="br.com.centralit.api.security.CustomExpressionHandler"/> | |
| 41 | - | |
| 24 | + | |
| 25 | + <bean id="webExpressionHandler" class="br.com.centralit.api.security.CustomExpressionHandler" /> | |
| 26 | + | |
| 42 | 27 | <util:map id="jpaPropertyMap"> |
| 43 | 28 | <entry key="generateDdl" value="${hibernate.generate.ddl}" /> |
| 44 | 29 | <entry key="hibernate.hbm2ddl.auto" value="${hibernate.hbm2ddl.auto}" /> | ... | ... |
cit-ecm-web/src/main/webapp/assets/css/gerenciarProcesso.css
| ... | ... | @@ -93,6 +93,13 @@ |
| 93 | 93 | vertical-align: middle; |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | +.profile-info-label { | |
| 97 | + | |
| 98 | + font-weight: 400; | |
| 99 | + color: #667E99; | |
| 100 | + background-color: transparent; | |
| 101 | +} | |
| 102 | + | |
| 96 | 103 | .profile-info-row:first-child .profile-info-name,.profile-info-row:first-child .profile-info-value |
| 97 | 104 | { |
| 98 | 105 | border-top: none; |
| ... | ... | @@ -143,7 +150,69 @@ |
| 143 | 150 | margin-top: 10px; |
| 144 | 151 | } |
| 145 | 152 | |
| 146 | -.versoes { | |
| 153 | +.filters{ | |
| 154 | + border-radius: .3em; | |
| 155 | + background-clip: padding-box; | |
| 156 | + background: #fff; | |
| 157 | + left: 0; | |
| 158 | + top: -0.1em; | |
| 159 | + display: block; | |
| 160 | + content: ""; | |
| 161 | +} | |
| 162 | + | |
| 163 | +.itens{ | |
| 164 | + color: #757575; | |
| 165 | + padding: 0 | |
| 166 | +} | |
| 167 | + | |
| 168 | +.qtd{ | |
| 169 | + | |
| 170 | + background: #fff; | |
| 171 | + border-radius: 5px; | |
| 172 | + background-clip: padding-box; | |
| 173 | + float: right; | |
| 174 | + font-size: 1em; | |
| 175 | + font-weight: normal; | |
| 176 | + color: #ccc; | |
| 177 | + text-align: right; | |
| 178 | +} | |
| 179 | + | |
| 180 | +.filters_list { | |
| 181 | + color: #757575; | |
| 182 | + margin: 0; | |
| 183 | + list-style: none; | |
| 184 | + padding: 0 0 1em 0; | |
| 185 | +} | |
| 186 | + | |
| 187 | +.result_pesquisa{ | |
| 188 | + | |
| 189 | + color: #545454; | |
| 190 | + padding-bottom: 20px; | |
| 191 | + padding-top: 20px; | |
| 192 | +} | |
| 193 | + | |
| 194 | +.result_metadado{ | |
| 195 | + font-weight: bold; | |
| 196 | +} | |
| 197 | +.result_metadado_restrito{ | |
| 198 | + color: #F0AD4E; | |
| 199 | +} | |
| 200 | + | |
| 201 | +.odd_result_metadado{ | |
| 202 | + background-color: #f4f4f4; | |
| 203 | +} | |
| 204 | + | |
| 205 | +.even_result_metadado{ | |
| 206 | + | |
| 207 | +background-color: #f2f2f2; | |
| 208 | +} | |
| 209 | + | |
| 210 | +.filter_list_layout{ | |
| 211 | + | |
| 212 | +background-color: rgba(245, 245, 245, 0.61); | |
| 213 | +} | |
| 214 | + | |
| 215 | + .versoes { | |
| 147 | 216 | font-size : x-small; |
| 148 | 217 | font-weight : bold; |
| 149 | 218 | text-align : right !important; | ... | ... |
cit-ecm-web/src/main/webapp/assets/js/angular/custom/controller/ClassificarDocumentoProcessoController.js
| 1 | 1 | 'use strict'; |
| 2 | 2 | |
| 3 | 3 | citApp.controller('ClassificarDocumentoProcessoController', ['$scope', 'ProcessoRepository', '$translate', '$timeout', 'DominioRepository', '$compile', '$injector', 'DocumentoGedRepository', 'appService', 'NivelAcessoTipoProcessoRepository', 'HipoteseLegalRepository', 'NivelAcessoTipoDocumentoRepository', 'HistoricoAlteracaoProcessoRepository', 'SigiloRepository', function ClassificarDocumentoProcessoController($scope, ProcessoRepository, $translate, $timeout, DominioRepository, $compile, $injector, DocumentoGedRepository, appService, NivelAcessoTipoProcessoRepository, HipoteseLegalRepository, NivelAcessoTipoDocumentoRepository, HistoricoAlteracaoProcessoRepository, SigiloRepository) { |
| 4 | - $scope.$showAdvancedFilters = false; | |
| 5 | 4 | |
| 6 | - $scope.totalPages = 10; | |
| 7 | - $scope.totalItens = 0; | |
| 8 | - $scope.limit = 10; | |
| 9 | - $scope.processos = []; | |
| 10 | - $scope.businessProcess = null; | |
| 11 | - $scope.indexProcessoNegocio = null; | |
| 12 | - | |
| 13 | - $scope.idPainelItem = 0; | |
| 14 | - | |
| 15 | - $scope.tabAtual = 0; | |
| 16 | - | |
| 17 | - $scope.aprovado = null; | |
| 18 | - | |
| 19 | - $scope.tabs = [ {active: true} | |
| 20 | - ,{active: false} | |
| 21 | - ]; | |
| 22 | - | |
| 23 | - $scope.showTaskTab = true; | |
| 24 | - $scope.init = function(showTaskTab) { | |
| 25 | - $scope.showTaskTab = showTaskTab; | |
| 26 | - }; | |
| 27 | - | |
| 28 | - $scope.setCurrentTab = function(tab) { | |
| 29 | - $scope.tabAtual = tab; | |
| 30 | - for (var i = 0; i < $scope.tabs.length; i++) { | |
| 31 | - $scope.tabs[i].active = i == tab; | |
| 32 | - } | |
| 33 | - }; | |
| 34 | - | |
| 35 | - $scope.resetForm = function() { | |
| 36 | - angular.element("#editProcessoEcm").scope().resetForm(); | |
| 37 | - }; | |
| 38 | - | |
| 39 | - $scope.headers = [{title : $translate.instant('ECM.LABEL.PROTOCOLO'), value : 'nup' }, | |
| 40 | - {title : $translate.instant('ECM.LABEL.NIVEL_FINAL'), value : 'nivelAcesso.nivelAcesso.descricao'} , | |
| 41 | - {title : $translate.instant('ECM.LABEL.PROPOSTA'), value : 'sigilo.tipoSigilo.descricao'}, | |
| 42 | - {title : $translate.instant('ECM.LABEL.PRAZO_SIGILO'), value : 'prazoSigilo', filter : 'dateBR' }]; | |
| 43 | - | |
| 44 | - $scope.filterCriteria = { | |
| 45 | - start : 1, | |
| 46 | - dir : 'asc', | |
| 47 | - sort : 'id', | |
| 48 | - limit : 10, | |
| 49 | - fields: ['id', 'nup', 'nivelAcesso.nivelAcesso.descricao', 'sigilo.tipoSigilo.descricao', 'nivelAcesso.nivelAcesso.descricao', 'prazoSigilo'], | |
| 50 | - filters : [{type : 'string', field : 'nup' }, | |
| 51 | - {type : 'string', field : 'nivelAcesso.nivelAcesso.descricao' } , | |
| 52 | - {type : 'string', field : 'sigilo.tipoSigilo.descricao', comparison : 'nn'}, | |
| 53 | - {type : 'date', field : 'prazoSigilo' }] | |
| 54 | - }; | |
| 55 | - | |
| 56 | - // Will be called when filtering the grid, will reset the page number to one | |
| 57 | - $scope.filterResult = function() { | |
| 58 | - | |
| 59 | - //Timeout adicionado para que os filtros de pesquisa funcionem | |
| 60 | - $timeout(function(){ | |
| 61 | - $scope.filterCriteria.start = 1; | |
| 62 | - $scope.fetchResult().then(function() { | |
| 63 | - // The request fires correctly but sometimes the ui doesn't update, | |
| 64 | - // that's a fix | |
| 65 | - $scope.filterCriteria.start = 1; | |
| 66 | - }); | |
| 67 | - | |
| 68 | - }); | |
| 69 | - }; | |
| 70 | - | |
| 71 | - // call back function that we passed to our custom directive sortBy, will be | |
| 72 | - // called when clicking on any field to sort | |
| 73 | - $scope.onSort = function(sortedBy, sortDir) { | |
| 74 | - $scope.filterCriteria.dir = sortDir; | |
| 75 | - $scope.filterCriteria.sort = sortedBy; | |
| 76 | - $scope.filterCriteria.start = 1; | |
| 77 | - $scope.fetchResult().then(function() { | |
| 78 | - // The request fires correctly but sometimes the ui doesn't update, | |
| 79 | - // that's a fix | |
| 80 | - $scope.filterCriteria.start = 1; | |
| 81 | - }); | |
| 82 | - }; | |
| 83 | - | |
| 84 | - | |
| 85 | - // RECUPERA LISTA DE TAREFAS E SETA RESULTADO NA GRID | |
| 86 | - $scope.fetchResult = function(page) { | |
| 87 | - | |
| 88 | - $scope.setCurrentTab(0); | |
| 89 | - $scope.setLoading(true); | |
| 90 | - | |
| 91 | - return ProcessoRepository.getListPage($scope.filterCriteria).then(function(result) { | |
| 92 | - $scope.processos = result.originalElement.objects; | |
| 93 | - $scope.totalPages = result.originalElement.totalPages; | |
| 94 | - $scope.totalItens = result.originalElement.totalItens; | |
| 95 | - $scope.setLoading(false); | |
| 96 | - }, function() { | |
| 97 | - $scope.totalPages = 0; | |
| 98 | - $scope.totalItens = 0; | |
| 99 | - $scope.setLoading(false); | |
| 100 | - }); | |
| 101 | - }; | |
| 5 | + //Iniciar classificação | |
| 6 | + $scope.iniciar = function(processo){ | |
| 7 | + | |
| 8 | + $scope.setLoading(true); | |
| 9 | + | |
| 10 | + $scope.processoValidacao = processo; | |
| 11 | + | |
| 12 | + $scope.validado = $scope.processoValidacao.validado; | |
| 13 | + | |
| 14 | + $scope.contemDocumentoParaValidar = $.grep($scope.processoValidacao.documentos, function(e){ return e.status.codigo == 0; })[0] != null; | |
| 15 | + | |
| 16 | + $scope.findPorIdTipoProcesso(processo.tipoProcesso.id); | |
| 17 | + | |
| 18 | + if($scope.processoValidacao.documentos){ | |
| 19 | + | |
| 20 | + angular.forEach($scope.processoValidacao.documentos, function (item) { | |
| 21 | + | |
| 22 | + $scope.findNivelAcessoTipoDocumento(item); | |
| 23 | + | |
| 24 | + }); | |
| 25 | + }; | |
| 26 | + | |
| 27 | + $scope.setLoading(false); | |
| 28 | + | |
| 29 | + }; | |
| 102 | 30 | |
| 103 | 31 | $scope.removerAtributos = function(){ |
| 104 | - angular.forEach($scope.processo.documentos, function (item) { | |
| 32 | + angular.forEach($scope.processoValidacao.documentos, function (item) { | |
| 105 | 33 | delete item.autorUserName; |
| 106 | 34 | delete item.unidadeNome; |
| 107 | 35 | delete item.documentoVersao; |
| 108 | 36 | delete item.originalElement; |
| 37 | + delete item.nivelAcessoList; | |
| 109 | 38 | |
| 110 | 39 | if(item.nivelAcesso != undefined && item.nivelAcesso.sigilos != null){ |
| 111 | 40 | angular.forEach(item.nivelAcesso.sigilos, function (item) { |
| ... | ... | @@ -132,22 +61,19 @@ citApp.controller('ClassificarDocumentoProcessoController', ['$scope', 'Processo |
| 132 | 61 | if($scope.classificarDocumentoProcessoForm.$valid){ |
| 133 | 62 | |
| 134 | 63 | $scope.setLoadingSalva(true); |
| 135 | - | |
| 136 | 64 | $scope.removerAtributos(); |
| 137 | - | |
| 138 | - $scope.processo.aprovado = $scope.aprovado; | |
| 139 | - ProcessoRepository.atualizarSigiloProcesso($scope.processo).then(function(result) { | |
| 140 | - $scope.showAlert("success", $translate.instant('MSG.REGISTRO_SALVO')); | |
| 65 | + $scope.processoValidacao.validado = $scope.validado; | |
| 66 | + ProcessoRepository.atualizarSigiloProcesso($scope.processoValidacao).then(function(result) { | |
| 141 | 67 | $scope.historicoAlteracao(result.originalElement); |
| 142 | - ProcessoRepository.get($scope.processo.id).then(function(result){ | |
| 143 | - $scope.processo = result.originalElement; | |
| 144 | - $scope.aprovado = result.originalElement.aprovado; | |
| 145 | - $scope.carregarListaDocumentos($scope.processo.id); | |
| 146 | - }); | |
| 147 | 68 | $scope.classificarDocumentoProcessoForm.$submitted = false; |
| 148 | 69 | $scope.atualizaProcesso(); |
| 70 | + $scope.showAlert("success", $translate.instant('ECM.MSG.VALIDADO')); | |
| 71 | + $scope.setLoading(false); | |
| 72 | + | |
| 73 | + $timeout(function(){ | |
| 74 | + $scope.$parent.$parent.closeWidget(); | |
| 75 | + }); | |
| 149 | 76 | }); |
| 150 | - $scope.setLoading(false); | |
| 151 | 77 | }else{ |
| 152 | 78 | //Mensagem de erro de campos obrigatorios não preenchidos |
| 153 | 79 | $scope.showAlert('error', $translate.instant('MSG.MN001'), " ", false); |
| ... | ... | @@ -173,70 +99,44 @@ citApp.controller('ClassificarDocumentoProcessoController', ['$scope', 'Processo |
| 173 | 99 | $scope.closeWidget = function() { |
| 174 | 100 | angular.element("#searchGerenciarProcesso").scope().closeWidget(); |
| 175 | 101 | }; |
| 176 | - | |
| 177 | - $scope.initializeNivelAcessoDocumento = function(){ | |
| 178 | - $scope.nivelAcessoTipoDocumentoList = []; | |
| 179 | - NivelAcessoTipoDocumentoRepository.findAll().then(function(result) { | |
| 180 | - $scope.nivelAcessoTipoDocumentoList = result; | |
| 181 | - }); | |
| 182 | - }; | |
| 183 | - | |
| 184 | - | |
| 185 | - $scope.initializeSigiloDocumento = function(){ | |
| 186 | - $scope.sigiloDocumentoList = [ ]; | |
| 187 | - SigiloRepository.getList().then(function(result) { | |
| 188 | - $scope.sigilos = result; | |
| 189 | - }); | |
| 190 | - }; | |
| 191 | 102 | |
| 192 | - $scope.iniciar = function(processo){ | |
| 103 | + //Listar nivelAcessoTipoDocumento | |
| 104 | + $scope.findNivelAcessoTipoDocumento = function(documento){ | |
| 193 | 105 | |
| 194 | - ProcessoRepository.get(processo.id).then(function(result) { | |
| 195 | - $scope.processo = result.originalElement; | |
| 196 | - $scope.aprovado = result.originalElement.aprovado; | |
| 197 | - $scope.carregarListaDocumentos(processo.id); | |
| 198 | - }); | |
| 199 | - | |
| 200 | - $scope.findNivelPorIdProcesso(processo.tipoProcesso.id); | |
| 201 | - | |
| 106 | + documento.nivelAcessoList = []; | |
| 107 | + | |
| 108 | + return NivelAcessoTipoDocumentoRepository.findPorIdTipoDocumento(documento.tipoDocumento.id).then(function(result) { | |
| 109 | + | |
| 110 | + angular.forEach(result, function (nivelAcesso) { | |
| 111 | + //seta o originalElement do result | |
| 112 | + documento.nivelAcessoList.push(nivelAcesso.originalElement); | |
| 113 | + //substitui o nivelAcesso do documento | |
| 114 | + if(documento.nivelAcesso.id === nivelAcesso.originalElement.id){ | |
| 115 | + | |
| 116 | + documento.nivelAcesso = nivelAcesso.originalElement; | |
| 117 | + | |
| 118 | + } | |
| 119 | + | |
| 120 | + }); | |
| 121 | + }); | |
| 202 | 122 | }; |
| 203 | 123 | |
| 204 | - $scope.carregarListaDocumentos = function(idProcesso){ | |
| 205 | - $scope.processo.documentos = []; | |
| 206 | - DocumentoGedRepository.findByProcessoSigilo(idProcesso).then(function(result) { | |
| 207 | - angular.forEach(result, function(item) { | |
| 208 | - | |
| 209 | - var documento = item.originalElement; | |
| 210 | - $scope.processo.documentos.push(documento); | |
| 211 | - | |
| 212 | - }); | |
| 213 | - }); | |
| 214 | - } ; | |
| 215 | - | |
| 216 | - | |
| 217 | - $scope.findNivelPorIdProcesso = function(idTipoProcesso){ | |
| 124 | + $scope.limparSigilo = function(documento){ | |
| 125 | + | |
| 126 | + $timeout(function(){ | |
| 127 | + if(documento.nivelAcesso.nivelAcesso.codigo != 0){ | |
| 128 | + | |
| 129 | + documento.sigilo = null; | |
| 130 | + | |
| 131 | + } | |
| 132 | + }); | |
| 133 | + }; | |
| 134 | + | |
| 135 | + $scope.findPorIdTipoProcesso = function(idTipoProcesso){ | |
| 218 | 136 | |
| 219 | 137 | NivelAcessoTipoProcessoRepository.findPorIdTipoProcesso(idTipoProcesso).then(function(result) { |
| 220 | 138 | $scope.nivelAcessoList = result; |
| 221 | 139 | }); |
| 222 | 140 | }; |
| 223 | 141 | |
| 224 | - | |
| 225 | - // Consulta entidade e mostra no formulario | |
| 226 | - $scope.getProcesso = function(processo){ | |
| 227 | - $scope.setLoadingGet(true); | |
| 228 | - | |
| 229 | - ProcessoRepository.get(processo.id).then(function(result) { | |
| 230 | - $scope.processo = result.originalElement; | |
| 231 | - $scope.aprovado = result.originalElement.aprovado; | |
| 232 | - $scope.setLoading(false); | |
| 233 | - $scope.constroiRelacionamentoTipoProcesso($scope.processo.tipoProcesso); | |
| 234 | - | |
| 235 | - }); | |
| 236 | - }; | |
| 237 | - | |
| 238 | - | |
| 239 | - $scope.initializeNivelAcessoDocumento(); | |
| 240 | - $scope.initializeSigiloDocumento(); | |
| 241 | - $scope.fetchResult(); | |
| 242 | 142 | }]); | ... | ... |
cit-ecm-web/src/main/webapp/assets/js/angular/custom/controller/ClassificarDocumentoProcessoListController.js
| 1 | 1 | 'use strict'; |
| 2 | 2 | |
| 3 | 3 | citApp.controller('ClassificarDocumentoProcessoListController', ['$scope', 'ProcessoRepository', '$translate', '$timeout', 'DominioRepository', '$compile', '$injector', 'DocumentoGedRepository', 'appService', function ClassificarDocumentoProcessoListController($scope, ProcessoRepository, $translate, $timeout, DominioRepository, $compile, $injector, DocumentoGedRepository, appService) { |
| 4 | - $scope.$showAdvancedFilters = false; | |
| 5 | 4 | |
| 6 | - $scope.totalPages = 10; | |
| 7 | - $scope.totalItens = 0; | |
| 8 | - $scope.limit = 10; | |
| 9 | - $scope.processos = []; | |
| 10 | - $scope.businessProcess = null; | |
| 11 | - $scope.indexProcessoNegocio = null; | |
| 12 | - | |
| 13 | - $scope.idPainelItem = 0; | |
| 14 | - | |
| 15 | - $scope.tabAtual = 0; | |
| 16 | - | |
| 17 | - $scope.tabs = [ {active: true} | |
| 18 | - ,{active: false} | |
| 19 | - ]; | |
| 20 | - | |
| 21 | - $scope.showTaskTab = true; | |
| 22 | - $scope.init = function(showTaskTab) { | |
| 23 | - $scope.showTaskTab = showTaskTab; | |
| 24 | - }; | |
| 25 | - | |
| 26 | - $scope.setCurrentTab = function(tab) { | |
| 27 | - $scope.tabAtual = tab; | |
| 28 | - for (var i = 0; i < $scope.tabs.length; i++) { | |
| 29 | - $scope.tabs[i].active = i == tab; | |
| 30 | - } | |
| 31 | - }; | |
| 32 | - | |
| 33 | - $scope.resetForm = function() { | |
| 34 | - angular.element("#editProcessoEcm").scope().resetForm(); | |
| 35 | - }; | |
| 36 | - | |
| 37 | - $scope.headers = [{title : $translate.instant('LABEL.PROTOCOLO'), value : 'nup' }, | |
| 38 | - {title : $translate.instant('LABEL.PROPOSTA'), value : 'sigiloOriginal.tipoSigilo.descricao'}, | |
| 39 | - {title : $translate.instant('LABEL.NIVEL_FINAL'), value : 'sigilo.tipoSigilo.descricao'} , | |
| 40 | - {title : $translate.instant('LABEL.PRAZO_SIGILO'), value : 'prazoSigilo', filter : 'dateBR' }]; | |
| 5 | + | |
| 6 | + $scope.headers = [{title : $translate.instant('ECM.LABEL.PROTOCOLO'), value : 'nup' }, | |
| 7 | + {title : $translate.instant('ECM.LABEL.PROPOSTA'), value : 'sigiloOriginal.tipoSigilo.descricao'}, | |
| 8 | + {title : $translate.instant('ECM.LABEL.NIVEL_FINAL'), value : 'sigilo.tipoSigilo.descricao'} , | |
| 9 | + {title : $translate.instant('ECM.LABEL.PRAZO_SIGILO'), value : 'prazoSigilo', filter : 'dateBR' }]; | |
| 41 | 10 | |
| 42 | 11 | $scope.filterCriteria = { |
| 43 | 12 | start : 1, |
| ... | ... | @@ -52,115 +21,68 @@ citApp.controller('ClassificarDocumentoProcessoListController', ['$scope', 'Proc |
| 52 | 21 | {type : 'date', field : 'prazoSigilo' }] |
| 53 | 22 | }; |
| 54 | 23 | |
| 55 | - // Will be called when filtering the grid, will reset the page number to one | |
| 56 | - $scope.filterResult = function() { | |
| 57 | - | |
| 58 | - //Timeout adicionado para que os filtros de pesquisa funcionem | |
| 59 | - $timeout(function(){ | |
| 60 | - $scope.filterCriteria.start = 1; | |
| 61 | - $scope.fetchResult().then(function() { | |
| 62 | - // The request fires correctly but sometimes the ui doesn't update, | |
| 63 | - // that's a fix | |
| 64 | - $scope.filterCriteria.start = 1; | |
| 65 | - }); | |
| 66 | - | |
| 67 | - }); | |
| 68 | - }; | |
| 69 | - | |
| 70 | - // call back function that we passed to our custom directive sortBy, will be | |
| 71 | - // called when clicking on any field to sort | |
| 72 | - $scope.onSort = function(sortedBy, sortDir) { | |
| 73 | - $scope.filterCriteria.dir = sortDir; | |
| 74 | - $scope.filterCriteria.sort = sortedBy; | |
| 75 | - $scope.filterCriteria.start = 1; | |
| 76 | - $scope.fetchResult().then(function() { | |
| 77 | - // The request fires correctly but sometimes the ui doesn't update, | |
| 78 | - // that's a fix | |
| 79 | - $scope.filterCriteria.start = 1; | |
| 80 | - }); | |
| 81 | - }; | |
| 82 | - | |
| 83 | - | |
| 84 | - // RECUPERA LISTA DE TAREFAS E SETA RESULTADO NA GRID | |
| 85 | - $scope.fetchResult = function(page) { | |
| 86 | - | |
| 87 | - $scope.setCurrentTab(0); | |
| 88 | - $scope.setLoading(true); | |
| 89 | - | |
| 90 | - return ProcessoRepository.getListPage($scope.filterCriteria).then(function(result) { | |
| 91 | - $scope.processos = result.originalElement.objects; | |
| 92 | - $scope.totalPages = result.originalElement.totalPages; | |
| 93 | - $scope.totalItens = result.originalElement.totalItens; | |
| 94 | - $scope.setLoading(false); | |
| 95 | - }, function() { | |
| 96 | - $scope.totalPages = 0; | |
| 97 | - $scope.totalItens = 0; | |
| 98 | - $scope.setLoading(false); | |
| 99 | - }); | |
| 24 | + $scope.atualizarGrid = function() { | |
| 25 | + $scope.filterResult(); | |
| 100 | 26 | }; |
| 101 | - | |
| 27 | + | |
| 102 | 28 | |
| 103 | 29 | // ABRI Processo SELECIONADA |
| 104 | - $scope.abrirVisualizar = function(processo){ | |
| 105 | - | |
| 106 | - var pagina = '/cit-ecm-web/html/gerenciarProcesso/gerenciarProcesso.html'; | |
| 30 | + $scope.abreValidar = function(){ | |
| 107 | 31 | |
| 108 | - ProcessoRepository.get(processo.id).then(function(result){ | |
| 109 | - processo = result.originalElement; | |
| 110 | - DocumentoGedRepository.findByProcessoSigilo(processo.id).then(function(result) { | |
| 111 | - processo.documentos = result; | |
| 112 | - }); | |
| 113 | - }); | |
| 114 | - | |
| 115 | - if (appService.existsWorkspace(pagina)) { | |
| 116 | - $scope.$openModalConfirm({message:$translate.instant('ECM.MSG.EXISTE_PROCESSO_ABERTO'), callback: function(){ | |
| 117 | - $scope.$modalConfirmInstance.dismiss('cancel'); | |
| 118 | - $scope.setLoading(true); | |
| 32 | + if($scope.modelSelecionado && $scope.modelSelecionado.id){ | |
| 33 | + | |
| 34 | + var pagina = '/cit-ecm-web/html/gerenciarProcesso/gerenciarProcesso.html'; | |
| 35 | + | |
| 36 | + if (appService.existsWorkspace(pagina)) { | |
| 37 | + $scope.$openModalConfirm({message:$translate.instant('ECM.MSG.EXISTE_PROCESSO_ABERTO'), callback: function(){ | |
| 38 | + $scope.$modalConfirmInstance.dismiss('cancel'); | |
| 39 | + $scope.setLoading(true); | |
| 40 | + $scope.openWorkspaceIfNotOpen($translate.instant('ECM.LABEL.PROCESSO'), pagina, 'mod-orange'); | |
| 41 | + $timeout(function() { | |
| 42 | + angular.element('#searchGerenciarProcesso').scope().getProcesso($scope.modelSelecionado); | |
| 43 | + | |
| 44 | + }, 100); | |
| 45 | + $scope.setLoading(false); | |
| 46 | + }}); | |
| 47 | + }else{ | |
| 119 | 48 | $scope.openWorkspaceIfNotOpen($translate.instant('ECM.LABEL.PROCESSO'), pagina, 'mod-orange'); |
| 120 | 49 | $timeout(function() { |
| 121 | - angular.element('#searchGerenciarProcesso').scope().getProcesso(processo); | |
| 50 | + angular.element('#searchGerenciarProcesso').scope().getProcesso($scope.modelSelecionado); | |
| 122 | 51 | |
| 123 | 52 | }, 100); |
| 124 | - $scope.setLoading(false); | |
| 125 | - }}); | |
| 126 | - }else{ | |
| 127 | - $scope.openWorkspaceIfNotOpen($translate.instant('ECM.LABEL.PROCESSO'), pagina, 'mod-orange'); | |
| 128 | - $timeout(function() { | |
| 129 | - angular.element('#searchGerenciarProcesso').scope().getProcesso(processo); | |
| 130 | - | |
| 131 | - }, 100); | |
| 132 | - } | |
| 53 | + } | |
| 54 | + }else{ | |
| 55 | + $scope.showAlert('warning', $translate.instant('ECM.MSG.SELECIONE_UM_ITEM_PARA_VALIDACAO')); | |
| 56 | + } | |
| 133 | 57 | |
| 134 | 58 | }; |
| 135 | 59 | |
| 136 | 60 | //adiciona a lista de documentos ao processo |
| 137 | - $scope.retrieveAditionalHtml = function(processo) { | |
| 138 | - processo.$show = !processo.$show; | |
| 139 | - if (!processo.$show) | |
| 140 | - return; | |
| 61 | + $scope.findDocumentos = function() { | |
| 141 | 62 | |
| 142 | - if(!processo.documentos){ | |
| 143 | - DocumentoGedRepository.findByProcessoSigilo(processo.id).then(function(result) { | |
| 144 | - processo.documentos = result; | |
| 145 | - $scope.showAditionalHtml(processo); | |
| 146 | - }); | |
| 147 | - }else{ | |
| 148 | - $scope.showAditionalHtml(processo); | |
| 63 | + _getProcesso(); | |
| 64 | + | |
| 65 | + if($scope.modelSelecionado.id){ | |
| 66 | + | |
| 67 | + DocumentoGedRepository.findByProcessoSigilo($scope.modelSelecionado.id).then(function(result) { | |
| 68 | + $scope.modelSelecionado.documentos = result; | |
| 69 | + }); | |
| 149 | 70 | } |
| 150 | 71 | |
| 72 | + $scope.modelSelecionado.$expandido = !$scope.modelSelecionado.$expandido; | |
| 73 | + | |
| 74 | + | |
| 151 | 75 | }; |
| 76 | + | |
| 77 | + function _getProcesso(){ | |
| 78 | + $scope.modelSelecionado = {}; | |
| 79 | + for(var count = 0; count < $scope.processos.length; count++){ | |
| 80 | + if($scope.processos[count].$show) { | |
| 81 | + $scope.modelSelecionado = $scope.processos[count]; | |
| 82 | + break; | |
| 83 | + }; | |
| 84 | + }; | |
| 152 | 85 | |
| 153 | - //abre a div com os documentos | |
| 154 | - $scope.showAditionalHtml = function(processo) { | |
| 155 | - var id = "divHtmlAdicional_" + $scope.idPainelItem + "_" + processo.id; | |
| 156 | - | |
| 157 | - var el = document.getElementById(id); | |
| 158 | - if (!el || el.innerHTML != '') | |
| 159 | - return; | |
| 160 | - | |
| 161 | - var element = angular.element("#"+id); | |
| 162 | - el.focus(); | |
| 163 | 86 | }; |
| 164 | - | |
| 165 | - $scope.fetchResult(); | |
| 87 | + | |
| 166 | 88 | }]); | ... | ... |
cit-ecm-web/src/main/webapp/assets/js/angular/custom/controller/DocumentoGedController.js
| ... | ... | @@ -190,7 +190,7 @@ citApp.controller('DocumentoGedController', ['$scope', 'DocumentoGedRepository', |
| 190 | 190 | processo : $scope.documentoGed.processo, |
| 191 | 191 | autor : $scope.usuarioLogado, |
| 192 | 192 | acaoAlteracao : "INCLUSAO_DOCUMENTO", |
| 193 | - idTask : $scope.task.id, | |
| 193 | + idTask : $scope.task ? $scope.task.id : null, | |
| 194 | 194 | mapaAtributos : {"tipo_documento" : $scope.documentoGed.tipoDocumento.nome, "numero_documento" : $scope.documentoGed.numero} |
| 195 | 195 | }; |
| 196 | 196 | HistoricoAlteracaoProcessoRepository.saveParams(historicoAlteracaoProcesso).then(function(result){ |
| ... | ... | @@ -203,7 +203,7 @@ citApp.controller('DocumentoGedController', ['$scope', 'DocumentoGedRepository', |
| 203 | 203 | processo : $scope.documentoGed.processo, |
| 204 | 204 | autor : $scope.usuarioLogado, |
| 205 | 205 | acaoAlteracao : "CRIACAO_NOVA_VERSAO_DOCUMENTO", |
| 206 | - idTask : $scope.task.id, | |
| 206 | + idTask : $scope.task ? $scope.task.id : null, | |
| 207 | 207 | mapaAtributos : {"tipo_documento" : $scope.documentoGed.tipoDocumento.nome, "numero_documento" : $scope.documentoGed.numero, "numero_versao" : $scope.documentoGed.versaoDocumento.toFixed(1)} |
| 208 | 208 | }; |
| 209 | 209 | HistoricoAlteracaoProcessoRepository.saveParams(historicoAlteracaoProcesso).then(function(result){ |
| ... | ... | @@ -241,17 +241,17 @@ citApp.controller('DocumentoGedController', ['$scope', 'DocumentoGedRepository', |
| 241 | 241 | $scope.mantido = false; |
| 242 | 242 | $scope.documentoGed.localizacao = null; |
| 243 | 243 | $scope.documentoGed.numero = null; |
| 244 | - DominioRepository.findAllDominio('statusDocumentoGed').then(function(result) { | |
| 245 | - $scope.statusList = result; | |
| 244 | + DominioRepository.findAllDominio('estadoDocumentoGed').then(function(result) { | |
| 245 | + $scope.estadoList = result; | |
| 246 | 246 | }); |
| 247 | 247 | |
| 248 | 248 | }else{ |
| 249 | 249 | |
| 250 | 250 | $scope.documentoGed.conteudo = {}; |
| 251 | 251 | |
| 252 | - if($.grep($scope.statusList, function(e){ return e.codigo === 3; })[0]){ | |
| 252 | + if($.grep($scope.estadoList, function(e){ return e.codigo === 3; })[0]){ | |
| 253 | 253 | |
| 254 | - $scope.statusList.splice($.grep($scope.statusList, function(e){ return e.codigo === 3; })[0].$index, 1); | |
| 254 | + $scope.estadoList.splice($.grep($scope.estadoList, function(e){ return e.codigo === 3; })[0].$index, 1); | |
| 255 | 255 | } |
| 256 | 256 | } |
| 257 | 257 | |
| ... | ... | @@ -323,8 +323,8 @@ citApp.controller('DocumentoGedController', ['$scope', 'DocumentoGedRepository', |
| 323 | 323 | }); |
| 324 | 324 | }; |
| 325 | 325 | |
| 326 | - DominioRepository.findAllDominio('statusDocumentoGed').then(function(result) { | |
| 327 | - $scope.statusList = result; | |
| 326 | + DominioRepository.findAllDominio('estadoDocumentoGed').then(function(result) { | |
| 327 | + $scope.estadoList = result; | |
| 328 | 328 | }); |
| 329 | 329 | |
| 330 | 330 | //SET HIPOTESE LEGAL #INICIO | ... | ... |
cit-ecm-web/src/main/webapp/assets/js/angular/custom/controller/GerenciarProcessoController.js
| ... | ... | @@ -13,7 +13,6 @@ citApp.controller('GerenciarProcessoController', [ '$scope', '$translate', '$tim |
| 13 | 13 | |
| 14 | 14 | //INICIALIZA VARIAVEIS PARA HABILITAR E FECHAR DIVS DE AÇÕES DO PROCESSO |
| 15 | 15 | |
| 16 | - $scope.isHistoricoProcesso = true; | |
| 17 | 16 | $scope.fecharPagina = function() { |
| 18 | 17 | $scope.isProcessoRelacionado = false; |
| 19 | 18 | $scope.isDocumentoEdit = false; |
| ... | ... | @@ -340,9 +339,21 @@ citApp.controller('GerenciarProcessoController', [ '$scope', '$translate', '$tim |
| 340 | 339 | $scope.classificarDocumentoProceso = function () { |
| 341 | 340 | $scope.fecharPagina(); |
| 342 | 341 | $scope.isClassificarProcessoDocumento = true; |
| 342 | + var processo = {}; | |
| 343 | + angular.copy($scope.processo, processo); | |
| 344 | + if($scope.processo.documentos){ | |
| 345 | + processo.documentos = []; | |
| 346 | + angular.forEach($scope.processo.documentos, function(item) { | |
| 347 | + if(item.status.codigo == 0){ | |
| 348 | + var documento = item; | |
| 349 | + processo.documentos.push(documento); | |
| 350 | + } | |
| 351 | + }); | |
| 352 | + | |
| 353 | + } | |
| 343 | 354 | $timeout( function () { |
| 344 | - angular.element( "#classificarDocumento" ).scope().getProcesso( $scope.processo ); | |
| 345 | - } ); | |
| 355 | + angular.element( "#classificarDocumento" ).scope().iniciar(processo); | |
| 356 | + }); | |
| 346 | 357 | }; |
| 347 | 358 | |
| 348 | 359 | // REMOVER DOCUMENTO |
| ... | ... | @@ -637,26 +648,34 @@ citApp.controller('GerenciarProcessoController', [ '$scope', '$translate', '$tim |
| 637 | 648 | if ( $scope.task != null ) { |
| 638 | 649 | $scope.initialize(); |
| 639 | 650 | } |
| 651 | + | |
| 652 | + $scope.getProcesso = function (processo) { | |
| 640 | 653 | |
| 641 | - $scope.getProcesso = function ( processo ) { | |
| 642 | - | |
| 643 | - $scope.setLoadingGet( true ); | |
| 654 | + $scope.setLoadingGet(true); | |
| 644 | 655 | |
| 645 | 656 | ProcessoRepository.getProcessoGerenciamento(processo.id).then(function(result) { |
| 646 | - $scope.processo = result.originalElement; | |
| 647 | - | |
| 648 | - | |
| 657 | + //Processo do scopo do gerenciamento | |
| 658 | + $scope.processo = result.originalElement; | |
| 659 | + //Processo que sera avaliado | |
| 660 | + var processo = result.originalElement; | |
| 661 | + processo.documentos = []; | |
| 649 | 662 | DocumentoGedRepository.findByProcessoSigilo(processo.id).then(function(result) { |
| 650 | - $scope.processo.documentos = result; | |
| 663 | + | |
| 664 | + angular.forEach(result, function(item) { | |
| 665 | + | |
| 666 | + var documento = item.originalElement; | |
| 667 | + | |
| 668 | + processo.documentos.push(documento); | |
| 669 | + }); | |
| 670 | + | |
| 671 | + $timeout( function () { | |
| 672 | + angular.element( "#classificarDocumento" ).scope().iniciar(processo); | |
| 673 | + } ); | |
| 651 | 674 | }); |
| 652 | 675 | |
| 653 | 676 | $scope.setLoading(false); |
| 654 | 677 | }); |
| 655 | 678 | |
| 656 | - $timeout( function () { | |
| 657 | - angular.element( "#classificarDocumento" ).scope().iniciar(processo); | |
| 658 | - } ); | |
| 659 | - | |
| 660 | 679 | |
| 661 | 680 | $scope.isHistoricoProcesso = false; |
| 662 | 681 | $scope.isClassificarProcessoDocumento = true; | ... | ... |
cit-ecm-web/src/main/webapp/assets/js/angular/custom/controller/GerenciarProcessoViewController.js
| 1 | 1 | 'use strict'; |
| 2 | 2 | |
| 3 | -citApp.controller('GerenciarProcessoViewController', [ '$scope', '$translate', '$timeout', 'GerenciarProcessoRepository', '$rootScope', 'DocumentoGedRepository', 'ProcessoRepository', 'NivelAcessoTipoDocumentoRepository', | |
| 4 | - function GerenciarProcessoController($scope, $translate, $timeout, GerenciarProcessoRepository, $rootScope, DocumentoGedRepository, ProcessoRepository, NivelAcessoTipoDocumentoRepository ) { | |
| 3 | +citApp.controller('GerenciarProcessoViewController', [ '$scope', '$translate', '$timeout', 'GerenciarProcessoRepository', '$rootScope', 'DocumentoGedRepository', 'ProcessoRepository', 'NivelAcessoTipoDocumentoRepository','UnidadeProcessoRepository', | |
| 4 | + function GerenciarProcessoController($scope, $translate, $timeout, GerenciarProcessoRepository, $rootScope, DocumentoGedRepository, ProcessoRepository, NivelAcessoTipoDocumentoRepository, UnidadeProcessoRepository ) { | |
| 5 | 5 | |
| 6 | 6 | $scope.processo = {}; |
| 7 | 7 | |
| 8 | 8 | $scope.isDocumentoEdit = false; |
| 9 | + | |
| 10 | + $scope.isHistoricoProcesso = true; | |
| 9 | 11 | |
| 10 | 12 | $scope.getProcessoRelacionado = function(processoView){ |
| 11 | 13 | |
| 12 | 14 | $scope.isProcessoView = true; |
| 15 | + | |
| 16 | + $scope.isHistoricoProcessoView = true; | |
| 13 | 17 | |
| 14 | 18 | $scope.processo = processoView; |
| 15 | 19 | |
| 16 | 20 | $scope.setLoadingGet(true); |
| 21 | + | |
| 22 | + | |
| 17 | 23 | |
| 18 | 24 | $timeout(function(){ |
| 19 | 25 | ProcessoRepository.get($scope.processo.id).then(function(result) { |
| 20 | 26 | $scope.processo = result.originalElement; |
| 21 | 27 | }); |
| 22 | 28 | }, 100); |
| 29 | + | |
| 30 | + $scope.atualizarAtribuicaoProcesso($scope.processo.id); | |
| 23 | 31 | |
| 32 | + angular.element( "#widget-historico" ).scope().atualizar($scope.processo.id); | |
| 24 | 33 | $scope.setLoading(false); |
| 25 | 34 | }; |
| 26 | 35 | |
| 27 | - // FECHA WIDGET E INICIA WIDGET PADRÃO | |
| 36 | + // FECHA WIDGET E INICIA WIDGET PADR�O | |
| 28 | 37 | $scope.closeWidget = function() { |
| 29 | 38 | $scope.widgetExemploIsCollapsed = false; |
| 30 | 39 | //WIDGET PRADAO |
| 31 | - $scope.isHistoricoProcesso = true; | |
| 32 | - $scope.isDocumentoEdit = false; | |
| 33 | - $scope.isCancelarDocumento = false; | |
| 40 | + $scope.isHistoricoProcessoView = true; | |
| 41 | + $scope.isDocumentoEditView = false; | |
| 42 | + $scope.isCancelarDocumentoView = false; | |
| 34 | 43 | }; |
| 35 | 44 | |
| 36 | 45 | $scope.editDocument = function(editarDocumento, edit){ |
| 37 | 46 | |
| 38 | - $scope.isDocumentoEdit = true; | |
| 39 | - $scope.isCancelarDocumento = false; | |
| 47 | + $scope.isDocumentoEditView = true; | |
| 48 | + $scope.isCancelarDocumentoView = false; | |
| 40 | 49 | |
| 41 | 50 | $timeout(function() { |
| 42 | 51 | angular.element("#editDocumentoViewGed").scope().getDocumentoGedView(editarDocumento.id, false); |
| ... | ... | @@ -47,12 +56,10 @@ citApp.controller('GerenciarProcessoViewController', [ '$scope', '$translate', ' |
| 47 | 56 | $scope.getCancelamentoDocumento = function(documento){ |
| 48 | 57 | |
| 49 | 58 | angular.element("#cancelarDocumentoView").scope().getCancelamentoDocumentoView(documento.cancelamentoDocumentoGed.id); |
| 50 | - $scope.isCancelarDocumento = true; | |
| 51 | - $scope.isDocumentoEdit = false; | |
| 59 | + $scope.isCancelarDocumentoView = true; | |
| 60 | + $scope.isDocumentoEditView = false; | |
| 52 | 61 | }; |
| 53 | - | |
| 54 | - | |
| 55 | - | |
| 62 | + | |
| 56 | 63 | $scope.getProcessoAnexado = function(processoView){ |
| 57 | 64 | $scope.processo = processoView; |
| 58 | 65 | |
| ... | ... | @@ -66,5 +73,35 @@ citApp.controller('GerenciarProcessoViewController', [ '$scope', '$translate', ' |
| 66 | 73 | |
| 67 | 74 | $scope.setLoading(false); |
| 68 | 75 | }; |
| 76 | + | |
| 77 | + $scope.atualizarAtribuicaoProcesso = function (idProcesso){ | |
| 78 | + | |
| 79 | + $scope.idProcesso = idProcesso; | |
| 80 | + ProcessoRepository.verificarAtribuicaoProcessoPrimeiroAcesso(idProcesso).then( function ( result ) { | |
| 81 | + | |
| 82 | + if(result){ | |
| 83 | + | |
| 84 | + $scope.showAlert('warning', $translate.instant('ECM.MSG.ATRIBUICAO_PRIMEIRO_ACESSO')); | |
| 85 | + } | |
| 86 | + if($scope.usuarioLogado.unidade){ | |
| 87 | + | |
| 88 | + UnidadeProcessoRepository.findByIdProcesso($scope.idProcesso).then(function(result){ | |
| 89 | + | |
| 90 | + $scope.processoUnidades = result; | |
| 91 | + | |
| 92 | + angular.forEach(result, function (item) { | |
| 93 | + | |
| 94 | + if($scope.usuarioLogado.unidade && item.unidade.id === $scope.usuarioLogado.unidade.id){ | |
| 95 | + | |
| 96 | + $scope.unidadeProcesso = item.originalElement; | |
| 97 | + } | |
| 98 | + | |
| 99 | + }); | |
| 100 | + | |
| 101 | + }); | |
| 102 | + } | |
| 103 | + | |
| 104 | + }); | |
| 105 | + } | |
| 69 | 106 | |
| 70 | 107 | }]); | ... | ... |
cit-ecm-web/src/main/webapp/assets/js/angular/custom/controller/HistoricoAlteracaoProcessoController.js
| ... | ... | @@ -21,6 +21,12 @@ citApp.controller('HistoricoAlteracaoProcessoController', ['$scope', 'HistoricoA |
| 21 | 21 | $scope.findByProcessoPaginado($scope.idProcesso, 0, 5); |
| 22 | 22 | $scope.countByProcesso($scope.idProcesso); |
| 23 | 23 | }; |
| 24 | + | |
| 25 | + $scope.atualizar = function (idProcesso){ | |
| 26 | + $scope.idProcesso = $scope.idProcesso; | |
| 27 | + $scope.findByProcessoPaginado($scope.idProcesso, 0, 5); | |
| 28 | + $scope.countByProcesso($scope.idProcesso); | |
| 29 | + }; | |
| 24 | 30 | |
| 25 | 31 | |
| 26 | 32 | $scope.verMais = function() { | ... | ... |
cit-ecm-web/src/main/webapp/assets/js/angular/custom/controller/ProcessoController.js
| ... | ... | @@ -62,7 +62,7 @@ citApp.controller('ProcessoController', ['$scope', 'ProcessoRepository', 'Domini |
| 62 | 62 | |
| 63 | 63 | ProcessoRepository.save($scope.processo).then(function(result) { |
| 64 | 64 | $scope.processo = result.originalElement; |
| 65 | - $scope.showAlert("success", $translate.instant('MSG.REGISTRO_SALVO')); | |
| 65 | + $scope.showAlert("success", $translate.instant('ECM.MSG.SALVO_SUCESSO'), $translate.instant('ECM.MSG.O_PROCESSO') + " " + $scope.processo.nup); | |
| 66 | 66 | |
| 67 | 67 | if(isNew){ |
| 68 | 68 | var historicoAlteracaoProcesso = { |
| ... | ... | @@ -170,9 +170,8 @@ citApp.controller('ProcessoController', ['$scope', 'ProcessoRepository', 'Domini |
| 170 | 170 | |
| 171 | 171 | $scope.findAutoCompleteAssunto = function(value){ |
| 172 | 172 | |
| 173 | - return PlanoClassificacaoRepository.findAssuntoAutoComplete(value).then(function(result) { | |
| 174 | - | |
| 175 | - return result; | |
| 173 | + return PlanoClassificacaoRepository.findAssuntoAutoComplete(value).then(function(result) { | |
| 174 | + return result; | |
| 176 | 175 | }); |
| 177 | 176 | }; |
| 178 | 177 | |
| ... | ... | @@ -298,9 +297,9 @@ citApp.controller('ProcessoController', ['$scope', 'ProcessoRepository', 'Domini |
| 298 | 297 | |
| 299 | 298 | }; |
| 300 | 299 | |
| 301 | - $scope.update_select = function(sugestao) { | |
| 300 | +/* $scope.update_select = function(sugestao) { | |
| 302 | 301 | console.log($scope.selection); |
| 303 | - }; | |
| 302 | + };*/ | |
| 304 | 303 | |
| 305 | 304 | $scope.setAssunto = function(itens){ |
| 306 | 305 | ... | ... |
cit-ecm-web/src/main/webapp/assets/js/angular/custom/controller/SolrSearchController.js
| ... | ... | @@ -26,15 +26,10 @@ |
| 26 | 26 | * @param Utils |
| 27 | 27 | */ |
| 28 | 28 | |
| 29 | -citApp.controller('SolrSearchController', ['$scope','$attrs','$location','$route','$routeParams','$window','$timeout','SolrSearchService','Utils', | |
| 30 | - function SolrSearchController($scope, $attrs, $location, $route, $routeParams, $window, $timeout, SolrSearchService, Utils) { | |
| 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) { | |
| 31 | 31 | |
| 32 | 32 | $scope.searchHintsField = 'tipoProcesso,tipoDocumento,objeto,assunto,autor,atribuidoA,destinatario,unidadeGeradora,situacao,nivelAcesso,dataCriacao'; |
| 33 | - | |
| 34 | - var KEY_ENTER = '13'; | |
| 35 | - var KEY_ESCAPE = '27'; | |
| 36 | - var KEY_ARROW_UP = '38'; | |
| 37 | - var KEY_ARROW_DOWN = '40'; | |
| 38 | 33 | |
| 39 | 34 | // instructional message to aid the user in constructing a query |
| 40 | 35 | $scope.messages = [ |
| ... | ... | @@ -99,8 +94,16 @@ citApp.controller('SolrSearchController', ['$scope','$attrs','$location','$route |
| 99 | 94 | |
| 100 | 95 | // user query |
| 101 | 96 | $scope.userquery = ''; |
| 97 | + | |
| 98 | + //parametro para pesquisa | |
| 99 | + $scope.parameterPesquisa = {}; | |
| 100 | + | |
| 101 | + //Parameters | |
| 102 | + $scope.queryParameters = []; | |
| 102 | 103 | |
| 103 | - /////////////////////////////////////////////////////////////////////////// | |
| 104 | + //Date parameter | |
| 105 | + $scope.dateMathFilter = ""; | |
| 106 | + | |
| 104 | 107 | |
| 105 | 108 | /** |
| 106 | 109 | * A page in a pagination list |
| ... | ... | @@ -120,11 +123,17 @@ citApp.controller('SolrSearchController', ['$scope','$attrs','$location','$route |
| 120 | 123 | $scope.handleSetPage = function() { |
| 121 | 124 | |
| 122 | 125 | $scope.timeout = $timeout(function () { |
| 123 | - var query = SolrSearchService.createQuery("https://localhost:8983/solr/jcg"); | |
| 126 | + var query = SolrSearchService.createQuery("https://172.20.0.74:8983/solr/jcg"); | |
| 124 | 127 | query.setOption("rows", "10"); |
| 125 | 128 | query.setOption("facet", "true"); |
| 126 | 129 | query.setOption("facet.limit", $scope.maxHints); |
| 127 | - query.setOption('start', $scope.start * $scope.documentsPerPage); | |
| 130 | + query.setOption('start', $scope.start * $scope.documentsPerPage - 10); | |
| 131 | + | |
| 132 | + //Verifica se foi selecionado filtro de data | |
| 133 | + if($scope.dateMathFilter != ""){ | |
| 134 | + | |
| 135 | + query.setOption("fq", $scope.dateMathFilter); | |
| 136 | + } | |
| 128 | 137 | |
| 129 | 138 | var hints = $scope.searchHintsField.split(','); |
| 130 | 139 | for(var i = 0; i < hints.length; i++){ |
| ... | ... | @@ -133,6 +142,7 @@ citApp.controller('SolrSearchController', ['$scope','$attrs','$location','$route |
| 133 | 142 | |
| 134 | 143 | query.setNearMatch($scope.nearMatch); |
| 135 | 144 | query.setUserQuery($scope.userQuery); |
| 145 | + query.setQueryParameters($scope.queryParameters); | |
| 136 | 146 | SolrSearchService.setQuery($scope.queryName, query); |
| 137 | 147 | SolrSearchService.updateQuery($scope.queryName); |
| 138 | 148 | }, 350); |
| ... | ... | @@ -152,6 +162,7 @@ citApp.controller('SolrSearchController', ['$scope','$attrs','$location','$route |
| 152 | 162 | // get new results |
| 153 | 163 | var results = SolrSearchService.getResponse($scope.queryName); |
| 154 | 164 | if (results && results.docs) { |
| 165 | + | |
| 155 | 166 | $scope.totalResults = results.numFound; |
| 156 | 167 | // calculate the total number of pages and sets |
| 157 | 168 | $scope.totalPages = Math.ceil($scope.totalResults / $scope.documentsPerPage); |
| ... | ... | @@ -161,6 +172,24 @@ citApp.controller('SolrSearchController', ['$scope','$attrs','$location','$route |
| 161 | 172 | // clean up document fields |
| 162 | 173 | results.docs[i].fromDate = Utils.formatDate(results.docs[i].fromDate); |
| 163 | 174 | results.docs[i].toDate = Utils.formatDate(results.docs[i].toDate); |
| 175 | + | |
| 176 | + if(results.docs[i].objeto == 'Documento' && SolrSearchService.queries.defaultQuery.highlighting){ | |
| 177 | + | |
| 178 | + var object = results.docs[i].id; | |
| 179 | + | |
| 180 | + if(SolrSearchService.queries.defaultQuery.highlighting[object].conteudo){ | |
| 181 | + | |
| 182 | + var highlightings = SolrSearchService.queries.defaultQuery.highlighting[object]; | |
| 183 | + | |
| 184 | + results.docs[i].conteudo = ""; | |
| 185 | + | |
| 186 | + angular.forEach(highlightings, function (item) { | |
| 187 | + results.docs[i].conteudo = results.docs[i].conteudo + item; | |
| 188 | + }); | |
| 189 | + | |
| 190 | + } | |
| 191 | + } | |
| 192 | + | |
| 164 | 193 | // add to result list |
| 165 | 194 | $scope.documents.push(results.docs[i]); |
| 166 | 195 | } |
| ... | ... | @@ -187,23 +216,37 @@ citApp.controller('SolrSearchController', ['$scope','$attrs','$location','$route |
| 187 | 216 | if (result) { |
| 188 | 217 | var myArray = new Array(); |
| 189 | 218 | for (var i = 0; i < result.length; i += 2) { |
| 190 | - var hint = { | |
| 219 | + //Verifica se o filtro está vazio | |
| 220 | + if(result[i] != "" && result[i + 1] > 0){ | |
| 221 | + var hint = { | |
| 191 | 222 | name: Object.keys(results.facet_fields)[j], |
| 192 | 223 | title: result[i], |
| 193 | 224 | quantidade: result[i + 1], |
| 194 | 225 | selected: false |
| 195 | - }; | |
| 196 | - myArray.push(hint); | |
| 226 | + }; | |
| 227 | + myArray.push(hint); | |
| 228 | + } | |
| 197 | 229 | } |
| 198 | 230 | |
| 199 | 231 | $scope.hints[$scope.hintFields[j]] = myArray; |
| 200 | 232 | } |
| 201 | 233 | } |
| 202 | 234 | } |
| 235 | + | |
| 203 | 236 | }else{ |
| 204 | 237 | |
| 205 | 238 | $scope.apresentarMsgSemResultado = true; |
| 206 | 239 | } |
| 240 | + $timeout(function(){ | |
| 241 | + angular.forEach($scope.documents, function (item) { | |
| 242 | + | |
| 243 | + if(item.objeto == 'Documento'){ | |
| 244 | + | |
| 245 | + document.getElementById(item.id).innerHTML = item.conteudo ; | |
| 246 | + } | |
| 247 | + | |
| 248 | + }); | |
| 249 | + }); | |
| 207 | 250 | |
| 208 | 251 | // update the page index |
| 209 | 252 | $scope.updatePageIndex(); |
| ... | ... | @@ -283,60 +326,38 @@ citApp.controller('SolrSearchController', ['$scope','$attrs','$location','$route |
| 283 | 326 | * @param event |
| 284 | 327 | */ |
| 285 | 328 | $scope.onkeyup = function (event) { |
| 286 | - $scope.showHints = true; | |
| 287 | - if (event.keyCode == KEY_ENTER) { | |
| 288 | - if ($scope.selectedHint != -1) { | |
| 289 | - $scope.selectHint($scope.selectedHint); | |
| 290 | - } | |
| 291 | - $scope.handleSubmit(); | |
| 292 | - $scope.onblur(); | |
| 293 | - } | |
| 294 | - else if (event.keyCode == KEY_ESCAPE) { | |
| 295 | - $scope.showHints = false; | |
| 296 | - $scope.resetHintSelection(); | |
| 297 | - $scope.$apply(); | |
| 298 | - } | |
| 299 | - else if (event.keyCode == KEY_ARROW_UP) { | |
| 300 | - $scope.clearHintSelection(); | |
| 301 | - if ($scope.selectedHint < 1) { | |
| 302 | - $scope.selectedHint = $scope.hints.length - 1; | |
| 303 | - } else { | |
| 304 | - $scope.selectedHint -= 1; | |
| 305 | - } | |
| 306 | - $scope.highlightHint($scope.selectedHint); | |
| 307 | - } | |
| 308 | - else if (event.keyCode == KEY_ARROW_DOWN) { | |
| 309 | - $scope.clearHintSelection(); | |
| 310 | - if ($scope.selectedHint < $scope.hints.length - 1) { | |
| 311 | - $scope.selectedHint += 1; | |
| 312 | - } else { | |
| 313 | - $scope.selectedHint = 0; | |
| 314 | - } | |
| 315 | - $scope.highlightHint($scope.selectedHint); | |
| 316 | - } | |
| 317 | - // if the current query meets the minimum requirements, | |
| 318 | - // get the list of search hints | |
| 319 | - else if ($scope.userQuery.length >= $scope.minSearchLength) { | |
| 329 | + | |
| 330 | + if ($scope.userQuery && $scope.userQuery.length >= $scope.minSearchLength) { | |
| 320 | 331 | if ($scope.timeout) $timeout.cancel($scope.timeout); |
| 321 | - $scope.timeout = $timeout(function () { | |
| 322 | - var query = SolrSearchService.createQuery("https://localhost:8983/solr/jcg"); | |
| 323 | - query.setOption("rows", "10"); | |
| 324 | - query.setOption("facet", "true"); | |
| 325 | - query.setOption("facet.limit", $scope.maxHints); | |
| 326 | - | |
| 327 | - var hints = $scope.searchHintsField.split(','); | |
| 328 | - for(var i = 0; i < hints.length; i++){ | |
| 329 | - query.setOption("facet.field#" + i, hints[i]); | |
| 330 | - } | |
| 331 | - | |
| 332 | - query.setNearMatch($scope.nearMatch); | |
| 333 | - query.setUserQuery($scope.userQuery); | |
| 334 | - SolrSearchService.setQuery($scope.queryName, query); | |
| 335 | - SolrSearchService.updateQuery($scope.queryName); | |
| 332 | + $scope.timeout = $timeout(function () { | |
| 333 | + var query = SolrSearchService.createQuery("https://172.20.0.74:8983/solr/jcg"); | |
| 334 | + query.setOption("rows", "10"); | |
| 335 | + query.setOption("facet", "true"); | |
| 336 | + query.setOption("facet.limit", $scope.maxHints); | |
| 337 | + | |
| 338 | + //Verifica se foi selecionado filtro de data | |
| 339 | + if($scope.dateMathFilter != ""){ | |
| 340 | + | |
| 341 | + query.setOption("fq", $scope.dateMathFilter); | |
| 342 | + } | |
| 343 | + | |
| 344 | + var hints = $scope.searchHintsField.split(','); | |
| 345 | + for(var i = 0; i < hints.length; i++){ | |
| 346 | + query.setOption("facet.field#" + i, hints[i]); | |
| 347 | + } | |
| 348 | + | |
| 349 | + query.setNearMatch($scope.nearMatch); | |
| 350 | + query.setUserQuery($scope.userQuery); | |
| 351 | + query.setQueryParameters($scope.queryParameters); | |
| 352 | + | |
| 353 | + SolrSearchService.setQuery($scope.queryName, query); | |
| 354 | + SolrSearchService.updateQuery($scope.queryName); | |
| 336 | 355 | }, 350); |
| 337 | 356 | }else{ |
| 338 | 357 | |
| 339 | 358 | $scope.apresentarMsgSemResultado = false; |
| 359 | + | |
| 360 | + $scope.documents = []; | |
| 340 | 361 | } |
| 341 | 362 | }; |
| 342 | 363 | |
| ... | ... | @@ -388,7 +409,7 @@ citApp.controller('SolrSearchController', ['$scope','$attrs','$location','$route |
| 388 | 409 | $scope.userQuery = "*:*"; |
| 389 | 410 | } |
| 390 | 411 | $scope.timeout = $timeout(function () { |
| 391 | - var query = SolrSearchService.createQuery("https://localhost:8983/solr/jcg"); | |
| 412 | + var query = SolrSearchService.createQuery("https://172.20.0.74:8983/solr/jcg"); | |
| 392 | 413 | query.setOption("rows", "10"); |
| 393 | 414 | query.setOption("facet", "true"); |
| 394 | 415 | query.setOption("facet.limit", $scope.maxHints); |
| ... | ... | @@ -404,14 +425,183 @@ citApp.controller('SolrSearchController', ['$scope','$attrs','$location','$route |
| 404 | 425 | SolrSearchService.updateQuery($scope.queryName); |
| 405 | 426 | }, 350); |
| 406 | 427 | |
| 407 | - console.log("ally "+ query) | |
| 408 | 428 | }; |
| 409 | 429 | |
| 410 | 430 | $scope.selectHint = function (nameIndex, index) { |
| 411 | 431 | var hint = $scope.hints[nameIndex][index]; |
| 412 | - $scope.userQuery = hint.title; | |
| 432 | + var userQuery = hint.title; | |
| 433 | + $scope.aplicarFilter(userQuery); | |
| 434 | + }; | |
| 435 | + | |
| 436 | + $scope.aplicarFilter = function(valueFilter){ | |
| 437 | + // clean up the user query | |
| 438 | + var trimmed = Utils.trim(valueFilter); | |
| 439 | + if (trimmed === '') { | |
| 440 | + valueFilter = "*:*"; | |
| 441 | + } | |
| 442 | + $scope.timeout = $timeout(function () { | |
| 443 | + var query = SolrSearchService.createQuery("https://172.20.0.74:8983/solr/jcg"); | |
| 444 | + query.setOption("rows", "10"); | |
| 445 | + query.setOption("facet", "true"); | |
| 446 | + query.setOption("facet.limit", $scope.maxHints); | |
| 447 | + | |
| 448 | + var hints = $scope.searchHintsField.split(','); | |
| 449 | + for(var i = 0; i < hints.length; i++){ | |
| 450 | + query.setOption("facet.field#" + i, hints[i]); | |
| 451 | + } | |
| 452 | + | |
| 453 | + query.setNearMatch($scope.nearMatch); | |
| 454 | + query.setUserQuery(valueFilter); | |
| 455 | + SolrSearchService.setQuery($scope.queryName, query); | |
| 456 | + SolrSearchService.updateQuery($scope.queryName); | |
| 457 | + }, 350); | |
| 458 | + }; | |
| 459 | + | |
| 460 | + //limpar os filtros da tela | |
| 461 | + $scope.cleanFilters = function(){ | |
| 462 | + | |
| 463 | + $scope.documents = []; | |
| 464 | + $scope.userQuery = ""; | |
| 465 | + $scope.hints = []; | |
| 466 | + $scope.parameterDatePesquisa = $.grep($scope.filtroDateList, function(e){ return e.codigo == 0; })[0].originalElement; | |
| 467 | + }; | |
| 468 | + | |
| 469 | + //Adicionar os parametro processo | |
| 470 | + $scope.addParameter = function(){ | |
| 471 | + | |
| 472 | + $timeout(function () { | |
| 473 | + //verifica se o parametro é ambos | |
| 474 | + if($scope.parameterPesquisa.codigo == 0){ | |
| 475 | + | |
| 476 | + $scope.removeQueryParameter("AND objeto: Processo "); | |
| 477 | + | |
| 478 | + $scope.removeQueryParameter("AND objeto: Documento "); | |
| 479 | + $scope.onkeyup(); | |
| 480 | + | |
| 481 | + //verifica se o parametro é processo | |
| 482 | + }else if($scope.parameterPesquisa.codigo == 1){ | |
| 483 | + | |
| 484 | + $scope.addQueryParameter("AND objeto: Processo "); | |
| 485 | + $scope.removeQueryParameter("AND objeto: Documento "); | |
| 486 | + $scope.onkeyup(); | |
| 487 | + //verifica se o parametro é documento | |
| 488 | + }else if($scope.parameterPesquisa.codigo == 2){ | |
| 489 | + | |
| 490 | + $scope.addQueryParameter("AND objeto: Documento "); | |
| 491 | + $scope.removeQueryParameter("AND objeto: Processo "); | |
| 492 | + $scope.onkeyup(); | |
| 493 | + } | |
| 494 | + }); | |
| 495 | + | |
| 496 | + }; | |
| 497 | + | |
| 498 | + //adicionar o parametro de data | |
| 499 | + $scope.addParameterDate = function(){ | |
| 500 | + | |
| 501 | + $timeout(function () { | |
| 502 | + | |
| 503 | + if($scope.parameterDatePesquisa.codigo == 0){ | |
| 504 | + | |
| 505 | + $scope.dateMathFilter = ""; | |
| 506 | + | |
| 507 | + $scope.onkeyup(); | |
| 508 | + | |
| 509 | + //Última Hora | |
| 510 | + }else if($scope.parameterDatePesquisa.codigo == 1){ | |
| 511 | + | |
| 512 | + var date = new Date(); | |
| 513 | + date.setHours(date.getHours() - 1); | |
| 514 | + | |
| 515 | + var dataUltimaHora = $filter('date')(date, "yyyy-MM-dd'T'HH:mm:ss'Z'"); | |
| 516 | + | |
| 517 | + $scope.dateMathFilter = "dataCriacao:["+dataUltimaHora+" TO NOW]"; | |
| 518 | + $scope.onkeyup(); | |
| 519 | + //Útimas 24 horas | |
| 520 | + }else if($scope.parameterDatePesquisa.codigo == 2){ | |
| 521 | + | |
| 522 | + $scope.dateMathFilter = "dataCriacao:[NOW-1DAY TO NOW]"; | |
| 523 | + $scope.onkeyup(); | |
| 524 | + //Última semana | |
| 525 | + }else if($scope.parameterDatePesquisa.codigo == 3){ | |
| 526 | + | |
| 527 | + $scope.dateMathFilter = "dataCriacao:[NOW-7DAY TO NOW]"; | |
| 528 | + $scope.onkeyup(); | |
| 529 | + //Último mês | |
| 530 | + }else if($scope.parameterDatePesquisa.codigo == 4){ | |
| 531 | + | |
| 532 | + $scope.dateMathFilter = "dataCriacao:[NOW-31DAY TO NOW]"; | |
| 533 | + $scope.onkeyup(); | |
| 534 | + //Útimo ano | |
| 535 | + }else if($scope.parameterDatePesquisa.codigo == 5){ | |
| 536 | + | |
| 537 | + $scope.dateMathFilter = "dataCriacao:[NOW-365DAY TO NOW]"; | |
| 538 | + $scope.onkeyup(); | |
| 539 | + } | |
| 540 | + }); | |
| 541 | + | |
| 542 | + }; | |
| 543 | + | |
| 544 | + //adiciona o filtro entre datas | |
| 545 | + $scope.addParameterDatePersonalisada = function(){ | |
| 546 | + | |
| 547 | + var dataInicioFormat = $filter('date')($scope.dataInicioFiltro, "yyyy-MM-dd'T'HH:mm:ss'Z'"); | |
| 548 | + | |
| 549 | + var dataFimFormat = $filter('date')($scope.dataFimFiltro, "yyyy-MM-dd'T'HH:mm:ss'Z'"); | |
| 550 | + | |
| 551 | + if($scope.dataInicioFiltro && $scope.dataFimFiltro){ | |
| 552 | + | |
| 553 | + $scope.dateMathFilter = "dataCriacao:["+dataInicioFormat+" TO "+dataFimFormat+ "]"; | |
| 554 | + | |
| 555 | + $scope.onkeyup(); | |
| 556 | + }else{ | |
| 557 | + | |
| 558 | + $scope.dateMathFilter = ""; | |
| 559 | + } | |
| 560 | + | |
| 561 | + | |
| 413 | 562 | }; |
| 414 | 563 | |
| 564 | + /** | |
| 565 | + * Add a query parameter. The parameter setting is added only if it is | |
| 566 | + * unique. | |
| 567 | + * @param Parameter | |
| 568 | + */ | |
| 569 | + $scope.addQueryParameter = function(Parameter) { | |
| 570 | + for (var i=0; i<$scope.queryParameters.length;i++) { | |
| 571 | + if ($scope.queryParameters[i] == Parameter) { | |
| 572 | + return; | |
| 573 | + } | |
| 574 | + } | |
| 575 | + $scope.queryParameters.push(Parameter); | |
| 576 | + }; | |
| 577 | + | |
| 578 | + /** | |
| 579 | + * remove a query parameter | |
| 580 | + * unique. | |
| 581 | + * @param Parameter | |
| 582 | + */ | |
| 583 | + $scope.removeQueryParameter = function(Parameter) { | |
| 584 | + for (var i=0;i<$scope.queryParameters.length;i++) { | |
| 585 | + if ($scope.queryParameters[i] == Parameter) { | |
| 586 | + $scope.queryParameters.splice(i, 1); | |
| 587 | + } | |
| 588 | + } | |
| 589 | + }; | |
| 590 | + | |
| 591 | + DominioRepository.findAllDominio('filtroPesquisa').then(function(result) { | |
| 592 | + $scope.filtroPesquisaList = result; | |
| 593 | + | |
| 594 | + $scope.parameterPesquisa = $.grep($scope.filtroPesquisaList, function(e){ return e.codigo == 0; })[0].originalElement; | |
| 595 | + }); | |
| 596 | + | |
| 597 | + DominioRepository.findAllDominio('filtroData').then(function(result) { | |
| 598 | + $scope.filtroDateList = $filter('orderBy')(result, "codigo"); | |
| 599 | + | |
| 600 | + $scope.parameterDatePesquisa = $.grep($scope.filtroDateList, function(e){ return e.codigo == 0; })[0].originalElement; | |
| 601 | + | |
| 602 | + }); | |
| 603 | + | |
| 604 | + | |
| 415 | 605 | $scope.init(); |
| 416 | 606 | }]); |
| 417 | 607 | ... | ... |
cit-ecm-web/src/main/webapp/assets/js/angular/custom/controller/TarjaAssinaturaController.js
0 → 100644
| ... | ... | @@ -0,0 +1,173 @@ |
| 1 | +'use strict'; | |
| 2 | + | |
| 3 | +citApp.controller('TarjaAssinaturaController', | |
| 4 | + ['$scope', | |
| 5 | + '$filter', | |
| 6 | + '$translate', | |
| 7 | + '$timeout', | |
| 8 | + 'TarjaAssinaturaRepository', | |
| 9 | + 'DominioRepository', | |
| 10 | + 'FileUploader', | |
| 11 | + function TarjaAssinaturaController($scope, | |
| 12 | + $filter, | |
| 13 | + $translate, | |
| 14 | + $timeout, | |
| 15 | + TarjaAssinaturaRepository, | |
| 16 | + DominioRepository, | |
| 17 | + FileUploader) { | |
| 18 | + | |
| 19 | + $scope.resetForm = function() { | |
| 20 | + | |
| 21 | + if($scope.tarjaAssinatura) { | |
| 22 | + var originalTipoAssinatura = $scope.tarjaAssinatura.tipoAssinatura; | |
| 23 | + $scope.tarjaAssinatura = { | |
| 24 | + tipoAssinatura : originalTipoAssinatura | |
| 25 | + } | |
| 26 | + } | |
| 27 | + | |
| 28 | + if ($scope.uploaderLogo){ | |
| 29 | + $scope.uploaderLogo.clearQueue(); | |
| 30 | + $scope.uploaderLogo.url = '/cit-ecm-web/rest/tarjaAssinatura/uploadFileLogo?idOrganizacao=' + $scope.usuarioLogado.organizacao.id + '&idTarjaAssinatura='; | |
| 31 | + } | |
| 32 | + | |
| 33 | +// $scope.edit = true; | |
| 34 | + $timeout(function(){ | |
| 35 | + if($scope.tarjaAssinaturaForm){ | |
| 36 | + $scope.tarjaAssinaturaForm.$submitted = false; | |
| 37 | + $scope.tarjaAssinaturaForm.$setPristine(); | |
| 38 | + } | |
| 39 | + }); | |
| 40 | + }; | |
| 41 | + | |
| 42 | + DominioRepository.buscaDominioByCodigoAndChave(1, 'tipoAssinatura').then(function(result) { | |
| 43 | + $scope.tipoAssinaturaInterna = result.originalElement; | |
| 44 | + }); | |
| 45 | + DominioRepository.buscaDominioByCodigoAndChave(2, 'tipoAssinatura').then(function(result) { | |
| 46 | + $scope.tipoAssinaturaCertificado = result.originalElement; | |
| 47 | + }); | |
| 48 | + | |
| 49 | + $scope.saveOrUpdate = function(form){ | |
| 50 | + | |
| 51 | + form.$submitted = true; | |
| 52 | + | |
| 53 | + if(form.$invalid){ | |
| 54 | + $scope.showAlert('error', $translate.instant('MSG.MN001'), " ", false); | |
| 55 | + return; | |
| 56 | + } | |
| 57 | + | |
| 58 | + $scope.setLoadingSalva(true); | |
| 59 | + | |
| 60 | + TarjaAssinaturaRepository.save($scope.tarjaAssinatura).then(function(result) { | |
| 61 | + $scope.tarjaAssinatura = result.originalElement; | |
| 62 | + $scope.showAlert("success", $translate.instant('MSG.REGISTRO_SALVO')); | |
| 63 | + form.$submitted = false; | |
| 64 | + $scope.setLoading(false); | |
| 65 | + if($scope.uploaderLogo.queue.length > 0){ | |
| 66 | + $scope.uploaderLogo.uploadAll(); | |
| 67 | + } | |
| 68 | + $scope.$showPageSearchWorkspace($scope.workspace); | |
| 69 | + $scope.fetchResult(); | |
| 70 | + }); | |
| 71 | + }; | |
| 72 | + | |
| 73 | + $scope.cancelarEdicao = function () { | |
| 74 | + $scope.resetForm(); | |
| 75 | + $scope.$showPageSearchWorkspace($scope.workspace); | |
| 76 | + $scope.fetchResult(); | |
| 77 | + $scope.edit= false | |
| 78 | + } | |
| 79 | + | |
| 80 | + $scope.fetchResult = function(){ | |
| 81 | + angular.element('#searchTarjaAssinatura').scope().fetchResult(); | |
| 82 | + }; | |
| 83 | + | |
| 84 | + $scope.removeImagem = function (){ | |
| 85 | + if($scope.tarjaAssinatura.anexoImagem){ | |
| 86 | + TarjaAssinaturaRepository.removeImagem($scope.tarjaAssinatura).then(function (result) { | |
| 87 | + $scope.tarjaAssinatura = result.originalElement; | |
| 88 | + if($scope.uploaderLogo.queue.length > 0){ | |
| 89 | + $scope.uploaderLogo.clearQueue(); | |
| 90 | + } | |
| 91 | + }) | |
| 92 | + } | |
| 93 | + } | |
| 94 | + $scope.openFile = function () { | |
| 95 | + if($scope.edit){ | |
| 96 | + angular.element('#uploadLogoTarjaAssinatura').trigger('click'); | |
| 97 | + } | |
| 98 | + } | |
| 99 | + | |
| 100 | +//INSTANCIA DO OBJETO PARA FAZER UPLOAD | |
| 101 | + $scope.uploaderLogo = new FileUploader({ | |
| 102 | + autoUpload: false, | |
| 103 | + queueLimit: 1, | |
| 104 | + url : '/cit-ecm-web/rest/tarjaAssinatura/uploadFileLogo?idOrganizacao=' + $scope.usuarioLogado.organizacao.id + '&idTarjaAssinatura=' | |
| 105 | + }); | |
| 106 | + | |
| 107 | + // FILTERS | |
| 108 | + $scope.uploaderLogo.filters.push({ | |
| 109 | + name: 'imageFilter', | |
| 110 | + fn: function(item , options) { | |
| 111 | + var type = '|' + item.type.slice(item.type.lastIndexOf('/') + 1) + '|'; | |
| 112 | + return '|jpg|png|jpeg|bmp|gif|'.indexOf(type) !== -1; | |
| 113 | + } | |
| 114 | + }); | |
| 115 | + | |
| 116 | + // CALLBACKS | |
| 117 | + $scope.uploaderLogo.onWhenAddingFileFailed = function(item , filter, options) { | |
| 118 | + $scope.uploaderLogo.clearQueue(); | |
| 119 | +// console.info('onWhenAddingFileFailed', item, filter, options); | |
| 120 | + }; | |
| 121 | + $scope.uploaderLogo.onAfterAddingFile = function(fileItem) { | |
| 122 | +// console.info('onAfterAddingFile', fileItem); | |
| 123 | + }; | |
| 124 | + $scope.uploaderLogo.onAfterAddingAll = function(addedFileItems) { | |
| 125 | +// console.info('onAfterAddingAll', addedFileItems); | |
| 126 | + }; | |
| 127 | + $scope.uploaderLogo.onBeforeUploadItem = function(item) { | |
| 128 | +// console.info('onBeforeUploadItem', item); | |
| 129 | + }; | |
| 130 | + $scope.uploaderLogo.onProgressItem = function(fileItem, progress) { | |
| 131 | +// console.info('onProgressItem', fileItem, progress); | |
| 132 | + }; | |
| 133 | + $scope.uploaderLogo.onProgressAll = function(progress) { | |
| 134 | +// console.info('onProgressAll', progress); | |
| 135 | + }; | |
| 136 | + $scope.uploaderLogo.onSuccessItem = function(fileItem, response, status, headers) { | |
| 137 | +// console.info('onSuccessItem', fileItem, response, status, headers); | |
| 138 | + }; | |
| 139 | + $scope.uploaderLogo.onErrorItem = function(fileItem, response, status, headers) { | |
| 140 | +// console.info('onErrorItem', fileItem, response, status, headers); | |
| 141 | + }; | |
| 142 | + $scope.uploaderLogo.onCancelItem = function(fileItem, response, status, headers) { | |
| 143 | +// console.info('onCancelItem', fileItem, response, status, headers); | |
| 144 | + }; | |
| 145 | + $scope.uploaderLogo.onCompleteItem = function(fileItem, response, status, headers) { | |
| 146 | +// console.info('onCompleteItem', fileItem, response, status, headers); | |
| 147 | + }; | |
| 148 | + $scope.uploaderLogo.onCompleteAll = function() { | |
| 149 | + $scope.uploaderLogo.clearQueue(); | |
| 150 | + $scope.getTarjaAssinatura($scope.tarjaAssinatura.id, $scope.edit) | |
| 151 | +// console.info('onCompleteAll'); | |
| 152 | + }; | |
| 153 | + | |
| 154 | + $scope.getTarjaAssinatura = function(id, edit) { | |
| 155 | + $scope.setLoadingGet(true); | |
| 156 | + TarjaAssinaturaRepository.get(id).then(function(result) { | |
| 157 | + $scope.tarjaAssinatura = result.originalElement; | |
| 158 | + vincularIdTarjaUploader(); | |
| 159 | + $scope.edit = edit; | |
| 160 | + $scope.setLoading(false); | |
| 161 | + }); | |
| 162 | + }; | |
| 163 | + | |
| 164 | + var vincularIdTarjaUploader = function () { | |
| 165 | + if($scope.tarjaAssinatura.id){ | |
| 166 | + $scope.uploaderLogo.url += $scope.tarjaAssinatura.id; | |
| 167 | + } | |
| 168 | + }; | |
| 169 | + | |
| 170 | + $scope.insertTextEditor = function(button){ | |
| 171 | + CKEDITOR.instances.editorConteudo.insertText(button); | |
| 172 | + } | |
| 173 | +}]); | ... | ... |
cit-ecm-web/src/main/webapp/assets/js/angular/custom/controller/TarjaAssinaturaListController.js
0 → 100644
| ... | ... | @@ -0,0 +1,48 @@ |
| 1 | +'use strict'; | |
| 2 | + | |
| 3 | +citApp.controller('TarjaAssinaturaListController', | |
| 4 | + ['$scope', | |
| 5 | + '$translate', | |
| 6 | + '$timeout', | |
| 7 | + 'TarjaAssinaturaRepository', | |
| 8 | + 'DominioRepository', | |
| 9 | + function ListController($scope, | |
| 10 | + $translate, | |
| 11 | + $timeout, | |
| 12 | + TarjaAssinaturaRepository, | |
| 13 | + DominioRepository) { | |
| 14 | + $scope.$showAdvancedFilters = false; | |
| 15 | + | |
| 16 | + $scope.resetForm = function() { | |
| 17 | + angular.element("#editTarjaAssinatura").scope().resetForm(); | |
| 18 | + }; | |
| 19 | + | |
| 20 | + $scope.headers = [ {title : $translate.instant('LABEL.DESCRICAO'), value : 'descricao' }, | |
| 21 | + {title : $translate.instant('ECM.LABEL.TIPO_ASSINATURA'), value : 'tipoAssinatura.descricao' }]; | |
| 22 | + | |
| 23 | + $scope.filterCriteria = { | |
| 24 | + start : 1, | |
| 25 | + dir : 'asc', | |
| 26 | + sort : 'id', | |
| 27 | + limit : 10, | |
| 28 | + fields: ['id', 'descricao', 'tipoAssinatura.descricao'], | |
| 29 | + filters : [{type : 'string', field : 'descricao' }, | |
| 30 | + {type : 'string', field : 'tipoAssinatura.descricao', listaDominio : [] }] | |
| 31 | + }; | |
| 32 | + | |
| 33 | + DominioRepository.findAllDominio('tipoAssinatura').then(function(result) { | |
| 34 | + $scope.filterCriteria.filters[0].listaDominio = result; | |
| 35 | + }); | |
| 36 | + | |
| 37 | + $scope.editarVisualizarTarjaAssinatura = function(edit){ | |
| 38 | + var tarjaAssinatura = $scope.tarjaAssinaturaChecked; | |
| 39 | + | |
| 40 | + if(!tarjaAssinatura) { | |
| 41 | + $scope.showAlert('warning', !edit ? $translate.instant('MSG.SELECIONE_UM_ITEM_PARA_VISUALIZACAO') : | |
| 42 | + $translate.instant('MSG.SELECIONE_UM_ITEM_PARA_EDICAO')); | |
| 43 | + return; | |
| 44 | + } | |
| 45 | + angular.element('#editTarjaAssinatura').scope().getTarjaAssinatura(tarjaAssinatura.id, edit); | |
| 46 | + $scope.$showPageEditWorkspace($scope.workspace); | |
| 47 | + }; | |
| 48 | +}]); | ... | ... |
cit-ecm-web/src/main/webapp/assets/js/angular/custom/repository/TarjaAssinaturaRepository.js
0 → 100644
| ... | ... | @@ -0,0 +1,19 @@ |
| 1 | +'use strict'; | |
| 2 | + | |
| 3 | +citApp.factory('TarjaAssinaturaRepository', ['RestangularEcm', 'AbstractRepository', function (restangularEcm, AbstractRepository) { | |
| 4 | + | |
| 5 | + function TarjaAssinaturaRepository() { | |
| 6 | + AbstractRepository.call(this, restangularEcm, 'rest/tarjaAssinatura'); | |
| 7 | + | |
| 8 | + this.save = function(tarjaAssinatura) { | |
| 9 | + return restangularEcm.all(this.route + "/saveTarjaAssinatura").post(tarjaAssinatura).then(); | |
| 10 | + }; | |
| 11 | + this.removeImagem = function(tarjaAssinatura) { | |
| 12 | + return restangularEcm.all(this.route + "/removeImagem").post(tarjaAssinatura).then(); | |
| 13 | + }; | |
| 14 | + } | |
| 15 | + | |
| 16 | + AbstractRepository.extend(TarjaAssinaturaRepository); | |
| 17 | + | |
| 18 | + return new TarjaAssinaturaRepository(); | |
| 19 | +}]); | ... | ... |
cit-ecm-web/src/main/webapp/assets/js/angular/custom/service/solr.js
| ... | ... | @@ -135,6 +135,19 @@ function SolrQuery(Url) { |
| 135 | 135 | } |
| 136 | 136 | self.queryParameters.push(Parameter); |
| 137 | 137 | }; |
| 138 | + | |
| 139 | + /** | |
| 140 | + * remove a query parameter | |
| 141 | + * unique. | |
| 142 | + * @param Parameter | |
| 143 | + */ | |
| 144 | + self.removeQueryParameter = function(Parameter) { | |
| 145 | + for (var i=0;i<self.queryParameters.length;i++) { | |
| 146 | + if (self.queryParameters[i] == Parameter) { | |
| 147 | + self.queryParameters.splice(i, 1); | |
| 148 | + } | |
| 149 | + } | |
| 150 | + }; | |
| 138 | 151 | |
| 139 | 152 | /** |
| 140 | 153 | * Create a new facet. |
| ... | ... | @@ -611,6 +624,7 @@ citApp.provider('SolrSearchService', function solrSearchServiceProvider() { |
| 611 | 624 | // get the named query, reset error state, get the query url |
| 612 | 625 | var query = svc.queries[QueryName]; |
| 613 | 626 | var url = query.getSolrQueryUrl(); |
| 627 | + url = url + "&hl=true&hl.fl=conteudo&hl.fragsize=300" | |
| 614 | 628 | $log.debug("GET " + QueryName + ": " + url); |
| 615 | 629 | // execute the query |
| 616 | 630 | return $http.jsonp(url).then( | ... | ... |
cit-ecm-web/src/main/webapp/html/classificarProcessoDocumento/classificarDocumentos.html
0 → 100644
| ... | ... | @@ -0,0 +1,39 @@ |
| 1 | +<div class="row" ng-if="modelSelecionado.documentos.length > 0"> | |
| 2 | + <div class="col-md-12"> | |
| 3 | + <div class="widget-main clearfix" style="width: 91%; margin-left: auto;"> | |
| 4 | + <div class="itemdiv commentdiv" ng-repeat="documento in modelSelecionado.documentos | orderBy:'-dataCriacao'" style="background-color: rgb(253, 253, 253);"> | |
| 5 | + | |
| 6 | + <div class="user"> | |
| 7 | + <i class="{{documento.icon}}" title="{{documento.anexo.dominioTipoAnexo.descricao}}"></i> | |
| 8 | + </div> | |
| 9 | + | |
| 10 | + <div class="body"> | |
| 11 | + <div class="text ellipsis"> | |
| 12 | + <span class="black">{{documento.tipoDocumento.nome}} - {{documento.numero}}</span> | |
| 13 | + </div> | |
| 14 | + | |
| 15 | + <div class="time hidden-md"> | |
| 16 | + <i class="ace-icon fa fa-clock-o"></i> <span class="blue">{{documento.dataCriacao | date: 'dd/MM/yyyy HH:mm:ss'}}</span> | |
| 17 | + </div> | |
| 18 | + | |
| 19 | + <div class="text ellipsis" tooltip="{{documento.assuntoComplementar}}">{{documento.assuntoComplementar}}</div> | |
| 20 | + | |
| 21 | + <div class="itemdiv-informacoes"> | |
| 22 | + <span class="label label-gray" ng-show="documento.sigilo.tipoSigilo.codigo == 0 ">{{documento.sigilo.tipoSigilo.descricao}}</span> <span class="label label-danger" | |
| 23 | + ng-show="documento.sigilo.tipoSigilo.codigo == 1 ">{{documento.sigilo.tipoSigilo.descricao}}</span> <span class="label label-black" ng-show="documento.sigilo.tipoSigilo.codigo == 2 ">{{documento.sigilo.tipoSigilo.descricao}}</span> | |
| 24 | + <span class="label label-warning" ng-show="documento.nivelAcesso.nivelAcesso.codigo == 1">{{documento.nivelAcesso.nivelAcesso.descricao}}</span> <span class="label label-success" | |
| 25 | + ng-show="documento.nivelAcesso.nivelAcesso.codigo == 2">{{documento.nivelAcesso.nivelAcesso.descricao}}</span> <span class="label label-info" ng-show="documento.origem">Anexado</span> <span | |
| 26 | + class="label label-info" ng-show="false">Assinado</span> <span class="label label-success" ng-show="false">Habilitado</span> <span class="label label-warning" ng-show="false">Ciência</span> | |
| 27 | + <span class="label label-danger" ng-show="documento.cancelado">Cancelado</span> | |
| 28 | + </div> | |
| 29 | + </div> | |
| 30 | + </div> | |
| 31 | + </div> | |
| 32 | + </div> | |
| 33 | +</div> | |
| 34 | + | |
| 35 | +<div class="row" ng-if="modelSelecionado.documentos.length < 1"> | |
| 36 | + <div class="col-md-12" style="text-align: center"> | |
| 37 | + <label><translate>ECM.LABEL.NAO_CONTEM_DOCUMENTOS</translate></label> | |
| 38 | + </div> | |
| 39 | +</div> | |
| 0 | 40 | \ No newline at end of file | ... | ... |
cit-ecm-web/src/main/webapp/html/classificarProcessoDocumento/classificarProcessoDocumento.html
| 1 | 1 | |
| 2 | - | |
| 3 | 2 | <div id="classificarDocumento" ng-controller="ClassificarDocumentoProcessoController as classificarDocumentoProcessoController"> |
| 4 | 3 | <form name="classificarDocumentoProcessoForm" novalidate autocomplete="off"> |
| 5 | 4 | |
| ... | ... | @@ -19,89 +18,77 @@ |
| 19 | 18 | <!-- Informações do processo --> |
| 20 | 19 | <fieldset> |
| 21 | 20 | <legend> |
| 22 | - <h5> | |
| 23 | - <translate>ECM.LABEL.INFORMACAODOPROCESSO</translate> | |
| 24 | - </h5> | |
| 21 | + <translate>ECM.LABEL.INFORMACAODOPROCESSO</translate> | |
| 25 | 22 | </legend> |
| 26 | 23 | |
| 27 | 24 | <!-- <div class="profile-user-info"> --> |
| 28 | - <div class="row"> | |
| 29 | - <div class="col-md-12"> | |
| 30 | - <span class="text-bold"><translate>ECM.LABEL.PROTOCOLO</translate></span> | |
| 31 | - <span>{{processo.nup}}</span> | |
| 32 | - </div> | |
| 25 | + <div class="row"> | |
| 26 | + <div class="col-md-12"> | |
| 27 | + <span class="text-bold"><translate>ECM.LABEL.PROTOCOLO</translate></span> <span>{{processoValidacao.nup}}</span> | |
| 33 | 28 | </div> |
| 29 | + </div> | |
| 34 | 30 | |
| 35 | - <div class="row"> | |
| 36 | - <div class="col-md-6"> | |
| 37 | - <span class="text-bold"><translate>ECM.LABEL.NIVEL_ACESSO_ORIGINAL</translate></span> | |
| 38 | - <span>{{processo.nivelAcessoOriginal.nivelAcesso.descricao}}</span> | |
| 39 | - </div> | |
| 40 | - | |
| 41 | - <div class="col-md-6"> | |
| 42 | - <span class="text-bold" ><translate>ECM.LABEL.NIVEL_SIGILO_ORIGINAL</translate></span> | |
| 43 | - <span>{{processo.sigiloOriginal.tipoSigilo.descricao}}</span> | |
| 44 | - </div> | |
| 45 | - | |
| 31 | + <div class="row"> | |
| 32 | + <div class="col-md-6"> | |
| 33 | + <span class="text-bold"><translate>ECM.LABEL.NIVEL_ACESSO_ORIGINAL</translate></span> <span>{{processoValidacao.nivelAcessoOriginal.nivelAcesso.descricao}}</span> | |
| 34 | + </div> | |
| 35 | + | |
| 36 | + <div class="col-md-6"> | |
| 37 | + <span class="text-bold"><translate>ECM.LABEL.NIVEL_SIGILO_ORIGINAL</translate></span> <span>{{processoValidacao.sigiloOriginal.tipoSigilo.descricao}}</span> | |
| 46 | 38 | </div> |
| 47 | 39 | |
| 40 | + </div> | |
| 41 | + | |
| 48 | 42 | <!-- </div> --> |
| 49 | 43 | |
| 50 | 44 | <br></br> |
| 51 | - | |
| 52 | - <div ng-show='processo.aprovado'> | |
| 45 | + | |
| 46 | + <div ng-show='processoValidacao.validado'> | |
| 53 | 47 | <div class="row"> |
| 54 | 48 | <div class="col-md-6"> |
| 55 | - <span class="text-bold"><translate>ECM.LABEL.NIVEL_ACESSO</translate></span> | |
| 56 | - <span>{{processo.nivelAcesso.nivelAcesso.descricao}}</span> | |
| 49 | + <span class="text-bold"><translate>ECM.LABEL.NIVEL_ACESSO</translate></span> <span>{{processoValidacao.nivelAcesso.nivelAcesso.descricao}}</span> | |
| 57 | 50 | </div> |
| 58 | - | |
| 51 | + | |
| 59 | 52 | <div class="col-md-6"> |
| 60 | - <span class="text-bold" ><translate>ECM.LABEL.NIVEL_SIGILO</translate></span> | |
| 61 | - <span>{{processo.sigilo.tipoSigilo.descricao}}</span> | |
| 53 | + <span class="text-bold"><translate>ECM.LABEL.NIVEL_SIGILO</translate></span> <span>{{processoValidacao.sigilo.tipoSigilo.descricao}}</span> | |
| 62 | 54 | </div> |
| 63 | - | |
| 55 | + | |
| 64 | 56 | </div> |
| 65 | 57 | </div> |
| 66 | 58 | |
| 67 | - <div class="row" ng-show='!processo.aprovado'> | |
| 68 | - <div class="col-md-6"> | |
| 69 | - <label-select ng-id="processo.nivelAcesso" ng-label="ECM.LABEL.NIVEL_ACESSO" ng-model="processo.nivelAcesso" | |
| 59 | + <div class="row" ng-show='!processoValidacao.validado'> | |
| 60 | + <div class="col-md-4"> | |
| 61 | + <label-select ng-id="processoValidacao.nivelAcesso" ng-label="ECM.LABEL.NIVEL_ACESSO" ng-disabled="aprovado" ng-model="processoValidacao.nivelAcesso" | |
| 70 | 62 | form="classificarDocumentoclassificarDocumentoProcessoForm" ng-obrigatorio="true" |
| 71 | 63 | ng-custom-options="nivelAcessoTipoProcesso.originalElement as nivelAcessoTipoProcesso.nivelAcesso.descricao for nivelAcessoTipoProcesso" track-by="track by nivelAcessoTipoProcesso.id" |
| 72 | 64 | ng-list="nivelAcessoList" /> |
| 73 | 65 | </div> |
| 74 | 66 | |
| 75 | - <div class="col-md-6" ng-show="processo.nivelAcesso.nivelAcesso.codigo == 0"> | |
| 67 | + <div class="col-md-4" ng-show="processoValidacao.nivelAcesso.nivelAcesso.codigo == 0"> | |
| 76 | 68 | <div class="form-group"> |
| 77 | 69 | <label class="control-label block" |
| 78 | - ng-class="{'has-error': classificarDocumentoProcessoForm['processo.sigilo.id'].$error.required && (!classificarDocumentoProcessoForm['processo.sigilo.id'].$pristine || classificarDocumentoProcessoForm.$submitted)}"> | |
| 70 | + ng-class="{'has-error': classificarDocumentoProcessoForm['processoValidacao.sigilo.id'].$error.required && (!classificarDocumentoProcessoForm['processoValidacao.sigilo.id'].$pristine || classificarDocumentoProcessoForm.$submitted)}"> | |
| 79 | 71 | <translate>ECM.LABEL.SIGILO</translate> <span class="red">*</span> <i |
| 80 | - ng-show="classificarDocumentoProcessoForm['processo.sigilo.id'].$error.required && (!classificarDocumentoProcessoForm['processo.sigilo.id'].$pristine || classificarDocumentoProcessoForm.$submitted)" | |
| 72 | + ng-show="classificarDocumentoProcessoForm['processoValidacao.sigilo.id'].$error.required && (!classificarDocumentoProcessoForm['processoValidacao.sigilo.id'].$pristine || classificarDocumentoProcessoForm.$submitted)" | |
| 81 | 73 | class='fa fa-warning red' tooltip="{{$translate.instant('LABEL.SIGILO') + ' ' +$translate.instant('LABEL.CAMPO_OBRIGATORIO')}}" tooltip-placement='top'></i> |
| 82 | 74 | </label> |
| 83 | - | |
| 84 | - <div class="col-md-6"> | |
| 85 | - <label-select ng-id="processo.sigilo" ng-model="processo.sigilo" form="classificarDocumentoProcessoForm" | |
| 86 | - ng-custom-options="sigilo.originalElement as sigilo.tipoSigilo.descricao for sigilo" | |
| 87 | - track-by="track by sigilo.id" ng-list="sigilos" /> | |
| 88 | - </div> | |
| 75 | + | |
| 76 | + <label-select ng-id="processoValidacao.sigilo" ng-model="processoValidacao.sigilo" form="classificarDocumentoProcessoForm" | |
| 77 | + ng-custom-options="sigilo.originalElement as sigilo.tipoSigilo.descricao for sigilo" track-by="track by sigilo.id" ng-list="sigilos" ng-disabled="aprovado" /> | |
| 89 | 78 | </div> |
| 90 | 79 | </div> |
| 91 | - | |
| 92 | - <div class="col-md-6"> | |
| 93 | - <label-input-checkbox ng-model="aprovado" ng-label="ECM.LABEL.APROVAR"></label-input-checkbox> | |
| 94 | - </div> | |
| 95 | 80 | |
| 81 | + <div class="col-md-4"> | |
| 82 | + <label-input-checkbox ng-model="validado" ng-label="ECM.LABEL.VALIDADO"></label-input-checkbox> | |
| 83 | + </div> | |
| 96 | 84 | </div> |
| 85 | + | |
| 97 | 86 | </fieldset> |
| 98 | 87 | <!-- fim informações do processo --> |
| 99 | 88 | |
| 100 | 89 | <fieldset> |
| 101 | 90 | <legend> |
| 102 | - <h5> | |
| 103 | - <translate>ECM.LABEL.DOCUMENTOS</translate> | |
| 104 | - </h5> | |
| 91 | + <translate>ECM.LABEL.DOCUMENTOS</translate> | |
| 105 | 92 | </legend> |
| 106 | 93 | |
| 107 | 94 | <div class="row"> |
| ... | ... | @@ -113,35 +100,34 @@ |
| 113 | 100 | <table class="table table-striped table-bordered table-hover"> |
| 114 | 101 | <thead> |
| 115 | 102 | <tr> |
| 116 | - <th style="width: 20%;" class="text-center"><translate>ECM.LABEL.PROTOCOLO</translate></th> | |
| 117 | 103 | <th style="width: 15%;" class="text-center"><translate>ECM.LABEL.NUM_DOCUMENTO</translate></th> |
| 104 | + <th style="width: 20%;" class="text-center"><translate>ECM.LABEL.TIPODOCUMENTO</translate></th> | |
| 118 | 105 | <th class="text-center"><translate>ECM.LABEL.NIVEL_PROPOSTO</translate></th> |
| 119 | 106 | <th class="text-center"><translate>ECM.LABEL.NIVEL_REVISADO</translate></th> |
| 120 | 107 | |
| 121 | 108 | </tr> |
| 122 | 109 | </thead> |
| 123 | 110 | <tbody> |
| 124 | - <tr ng-repeat="documento in processo.documentos"> | |
| 125 | - <td class="text-center">{{processo.nup}}</td> | |
| 126 | - <td class="text-center">{{processo.id}}</td> | |
| 127 | - <td class="text-center" ng-show="documento.aprovado">{{documento.nivelAcesso.nivelAcesso.descricao}}</td> | |
| 128 | - <td ng-show="!documento.aprovado"> | |
| 111 | + <tr ng-repeat="documentoValidacao in processoValidacao.documentos"> | |
| 112 | + <td class="text-center">{{documentoValidacao.numero}}</td> | |
| 113 | + <td class="text-center">{{documentoValidacao.tipoDocumento.nome}}</td> | |
| 114 | + <td> | |
| 129 | 115 | <div class="row"> |
| 130 | 116 | <div class="col-md-6"> |
| 131 | - <label-select ng-id="documento.nivelAcesso" ng-model="documento.nivelAcesso" form="classificarDocumentoProcessoForm" | |
| 132 | - ng-custom-options="nivelAcessoTipoDocumento.originalElement as nivelAcessoTipoDocumento.nivelAcesso.descricao for nivelAcessoTipoDocumento" | |
| 133 | - track-by="track by nivelAcessoTipoDocumento.id" ng-list="nivelAcessoTipoDocumentoList" /> | |
| 117 | + <label-select ng-id="documentoValidacao.nivelAcesso" ng-model="documentoValidacao.nivelAcesso" form="classificarDocumentoProcessoForm" | |
| 118 | + ng-custom-options="nivelAcessoTipoDocumento as nivelAcessoTipoDocumento.nivelAcesso.descricao for nivelAcessoTipoDocumento" | |
| 119 | + track-by="track by nivelAcessoTipoDocumento.id" ng-list="documentoValidacao.nivelAcessoList" ng-custom-change="limparSigilo(documentoValidacao)"/> | |
| 134 | 120 | </div> |
| 135 | - <div class="col-md-6"> | |
| 136 | - <label-select ng-id="documento.sigilo" ng-model="documento.sigilo" form="classificarDocumentoProcessoForm" ng-show="documento.nivelAcesso.nivelAcesso.codigo == 0" | |
| 137 | - ng-custom-options="sigilo.originalElement as sigilo.tipoSigilo.descricao for sigilo" | |
| 138 | - track-by="track by sigilo.id" ng-list="sigilos" /> | |
| 121 | + <div class="col-md-6" ng-show='documentoValidacao.nivelAcesso.nivelAcesso.codigo == 0'> | |
| 122 | + <label-select ng-id="documentoValidacao.sigilo" ng-model="documentoValidacao.sigilo" form="classificarDocumentoProcessoForm" | |
| 123 | + ng-custom-options="sigiloTipoDocumento.sigilo as sigiloTipoDocumento.tipoSigiloDescricao for sigiloTipoDocumento" track-by="track by sigiloTipoDocumento.sigilo.id" ng-list="documentoValidacao.nivelAcesso.sigilos" /> | |
| 124 | + | |
| 139 | 125 | </div> |
| 140 | - | |
| 126 | + </div> | |
| 141 | 127 | </td> |
| 142 | - <td class="text-center">{{documento.sigilo.tipoSigilo.descricao}}</td> | |
| 128 | + <td class="text-center"><span ng-if="documentoValidacao.nivelAcesso.nivelAcesso.codigo == 0">{{documentoValidacao.sigilo.tipoSigilo.descricao}}</span> <span ng-if="documentoValidacao.nivelAcesso.nivelAcesso.codigo != 0"> {{documentoValidacao.nivelAcesso.nivelAcesso.descricao}}</span></td> | |
| 143 | 129 | </tr> |
| 144 | - <tr ng-hide="processo.documentos.length > 0"> | |
| 130 | + <tr ng-hide="processoValidacao.documentos.length > 0"> | |
| 145 | 131 | <td colspan="5" class="text-center"><translate>LABEL.TABELA_VAZIA</translate></td> |
| 146 | 132 | </tr> |
| 147 | 133 | </tbody> |
| ... | ... | @@ -156,7 +142,8 @@ |
| 156 | 142 | |
| 157 | 143 | <div class="row"> |
| 158 | 144 | <div class="col-md-12"> |
| 159 | - <button class="btn btn-sm btn-primary" ng-click="saveOrUpdate()" type="button"> | |
| 145 | + <button class="btn btn-sm btn-primary" ng-click="saveOrUpdate()" ng-if="processoValidacao.validado == false || contemDocumentoParaValidar" ng-disabled="!validado && !contemDocumentoParaValidar" | |
| 146 | + type="button"> | |
| 160 | 147 | <translate>LABEL.SALVAR</translate> |
| 161 | 148 | </button> |
| 162 | 149 | ... | ... |
cit-ecm-web/src/main/webapp/html/classificarProcessoDocumento/classificarProcessoDocumentoList.html
| 1 | - | |
| 2 | -<style type="text/css"> | |
| 3 | -/* | |
| 4 | - * Os códigos abaixo devem ser colocados nos devidos lugares e/ou utilizados dos css corretos do template, utilizem assim por não conhecer onde estão os css da arquitetura. | |
| 5 | - */ | |
| 6 | -.itemdiv { | |
| 7 | - min-height: 66px; | |
| 8 | - border: 1px solid #ccc; | |
| 9 | - padding: 10px; | |
| 10 | - position: relative; | |
| 11 | - border-radius: 5px; | |
| 12 | - margin-bottom: 5px; | |
| 13 | -} | |
| 14 | - | |
| 15 | -.itemdiv>.user { | |
| 16 | - display: inline-block; | |
| 17 | - width: 42px; | |
| 18 | - position: absolute; | |
| 19 | - left: 10px; | |
| 20 | -} | |
| 21 | - | |
| 22 | -.itemdiv .itemdiv-informacoes .label { | |
| 23 | - margin-left: 2px; | |
| 24 | -} | |
| 25 | - | |
| 26 | -.itemdiv>.body { | |
| 27 | - width: auto; | |
| 28 | - margin-left: 40px; | |
| 29 | - margin-right: 12px; | |
| 30 | - position: relative; | |
| 31 | -} | |
| 32 | - | |
| 33 | -.itemdiv>.body>.name { | |
| 34 | - display: block; | |
| 35 | - color: #999; | |
| 36 | -} | |
| 37 | - | |
| 38 | -.itemdiv>.body>.time { | |
| 39 | - display: block; | |
| 40 | - font-size: 11px; | |
| 41 | - font-weight: 700; | |
| 42 | - color: #666; | |
| 43 | - position: absolute; | |
| 44 | - right: 0; | |
| 45 | - top: 0; | |
| 46 | -} | |
| 47 | - | |
| 48 | -.itemdiv>.body>.text { | |
| 49 | - display: block; | |
| 50 | - position: relative; | |
| 51 | - margin-top: 2px; | |
| 52 | - font-size: 13px; | |
| 53 | -} | |
| 54 | - | |
| 55 | -.itemdiv.commentdiv .tools { | |
| 56 | - right: 15px; | |
| 57 | -} | |
| 58 | - | |
| 59 | -.itemdiv .tools { | |
| 60 | - position: absolute; | |
| 61 | - top: 32px; | |
| 62 | -} | |
| 63 | - | |
| 64 | -.itemdiv .tools a:hover { | |
| 65 | - text-decoration: none; | |
| 66 | -} | |
| 67 | - | |
| 68 | -.profile-user-info { | |
| 69 | - display: table; | |
| 70 | - width: 98%; | |
| 71 | - width: calc(100% - 24px); | |
| 72 | - margin: 0 auto; | |
| 73 | -} | |
| 74 | - | |
| 75 | -.profile-info-row { | |
| 76 | - display: table-row; | |
| 77 | -} | |
| 78 | - | |
| 79 | -.profile-info-row:first-child .profile-info-name,.profile-info-row:first-child .profile-info-value | |
| 80 | - { | |
| 81 | - border-top: none; | |
| 82 | -} | |
| 83 | - | |
| 84 | -.profile-info-name { | |
| 85 | - text-align: right; | |
| 86 | - padding: 6px 10px 6px 4px; | |
| 87 | - font-weight: 400; | |
| 88 | - color: #667E99; | |
| 89 | - background-color: transparent; | |
| 90 | - border-top: 1px dotted #D5E4F1; | |
| 91 | - display: table-cell; | |
| 92 | - width: 110px; | |
| 93 | - vertical-align: middle; | |
| 94 | -} | |
| 95 | - | |
| 96 | -.profile-info-row:first-child .profile-info-name,.profile-info-row:first-child .profile-info-value | |
| 97 | - { | |
| 98 | - border-top: none; | |
| 99 | -} | |
| 100 | - | |
| 101 | -.profile-info-value { | |
| 102 | - display: table-cell; | |
| 103 | - padding: 6px 4px 6px 6px; | |
| 104 | - border-top: 1px dotted #D5E4F1; | |
| 105 | -} | |
| 106 | - | |
| 107 | -.ellipsis { | |
| 108 | - white-space: nowrap; | |
| 109 | - overflow: hidden; | |
| 110 | - text-overflow: ellipsis; | |
| 111 | - max-width: 65%; | |
| 112 | -} | |
| 113 | - | |
| 114 | -.btn-group .btn { | |
| 115 | - padding-top: 0; | |
| 116 | - padding-bottom: 0; | |
| 117 | -} | |
| 118 | - | |
| 119 | -#widget-historico .widget-main { | |
| 120 | - padding: 0 16px 16px 0; | |
| 121 | -} | |
| 122 | - | |
| 123 | -#painelProcesso .situacaoProcesso { | |
| 124 | - background-color: red; | |
| 125 | -} | |
| 126 | - | |
| 127 | -.documentos .widget-header .btn-group { | |
| 128 | - margin: 6px 6px 0 0; | |
| 129 | -} | |
| 130 | - | |
| 131 | -.labelOverflowLimit { | |
| 132 | - text-overflow: ellipsis; | |
| 133 | - overflow: hidden; | |
| 134 | - white-space: nowrap; | |
| 135 | - font-weight: bold; | |
| 136 | -} | |
| 137 | - | |
| 138 | -#searchGerenciarProcesso { | |
| 139 | - margin-top: 10px; | |
| 140 | -} | |
| 141 | -</style> | |
| 142 | - | |
| 143 | -<meta charset="UTF-8"> | |
| 1 | +<link rel="stylesheet" href="/cit-ecm-web/assets/css/gerenciarProcesso.css" /> | |
| 144 | 2 | <div id="idClassificarDocumentoProcesso" class="page-content" ng-controller="ClassificarDocumentoProcessoListController"> |
| 145 | 3 | <div class="bar-buttons-action fixed"> |
| 146 | 4 | <div class="row"> |
| 147 | 5 | <div class="col-sm-9 text-left"> |
| 148 | - <button class="btn btn-clear" title="{{$translate.instant('LABEL.ATUALIZAR')}}" alt="{{$translate.instant('LABEL.ATUALIZAR')}}" ng-click="fetchResult()"> | |
| 6 | + <button class="btn btn-clear" title="{{$translate.instant('LABEL.ATUALIZAR')}}" alt="{{$translate.instant('LABEL.ATUALIZAR')}}" ng-click="atualizarGrid();"> | |
| 149 | 7 | <i class="fa fa-refresh purple"></i> |
| 150 | 8 | <translate>LABEL.ATUALIZAR</translate> |
| 151 | 9 | </button> |
| 152 | - </div> | |
| 153 | 10 | |
| 11 | + <button class="btn btn-clear" title="{{$translate.instant('LABEL.VALIDAR')}}" alt="{{$translate.instant('LABEL.VALIDAR')}}" ng-click="abreValidar();"> | |
| 12 | + <i class="fa fa-check"></i> | |
| 13 | + <translate>ECM.LABEL.VALIDAR</translate> | |
| 14 | + </button> | |
| 15 | + </div> | |
| 154 | 16 | <div class="col-sm-3 text-right"> |
| 155 | 17 | <favorito /> |
| 156 | - | |
| 157 | 18 | <help-button workspace="workspace" /> |
| 158 | 19 | </div> |
| 159 | - <!-- .col --> | |
| 160 | 20 | </div> |
| 161 | - <!-- .row --> | |
| 162 | 21 | </div> |
| 163 | - <!-- .bar-buttons-action --> | |
| 164 | 22 | |
| 165 | 23 | <breadcrumb ng-workspace="workspace"></breadcrumb> |
| 166 | - <div class="row"> | |
| 167 | - <div class="col-sm-12"> | |
| 168 | - <div class="table-container"> | |
| 169 | - <div class="table-header clearfix"> | |
| 170 | - <div class="table-header-right"> | |
| 171 | - <button class="btn btn-primary btn-inline btn-white table-header-item" ng-click="$showAdvancedFilters = !$showAdvancedFilters"> | |
| 172 | - <i class="fa fa-filter"></i> | |
| 173 | - <translate>LABEL.FILTROS_AVANCADOS</translate> | |
| 174 | - </button> | |
| 175 | - </div> | |
| 176 | - <!-- .table-header-right --> | |
| 177 | 24 | |
| 178 | - <div class="table-header-left"> | |
| 179 | - <div class="form-group"> | |
| 180 | - <div class="input-group"> | |
| 181 | - <input type="text" class="form-control" placeholder="Digite uma palavra chave" on-enter-blur on-blur-change="filterResult(true)" ng-model="filterCriteria.keywordValue" /> <span | |
| 182 | - class="input-group-addon"> <i class="fa fa-search fa-lg"></i> | |
| 183 | - </span> | |
| 184 | - </div> | |
| 185 | - </div> | |
| 186 | - <!-- .form-group --> | |
| 187 | - </div> | |
| 188 | - <!-- .table-header-left --> | |
| 189 | - </div> | |
| 190 | - <!-- .table-header --> | |
| 191 | - | |
| 192 | - <table class="table table-striped table-bordered table-hover"> | |
| 193 | - | |
| 194 | - | |
| 195 | - <thead> | |
| 196 | - <tr> | |
| 197 | - <th style="width: 5%;"><small><translate>ECM.LABEL.PROTOCOLO</translate></small></th> | |
| 198 | - <th style="align: center; width: 5%;"><small><translate>ECM.LABEL.PROPOSTA</translate></small></th> | |
| 199 | - <th style="width: 15%;"><small><translate>ECM.LABEL.NIVEL_FINAL</translate></small></th> | |
| 200 | - <th style="align: center; width: 5%;"><small><translate>ECM.LABEL.PRAZO_SIGILO</translate></small></th> | |
| 201 | - </tr> | |
| 202 | - </thead> | |
| 203 | - | |
| 204 | - | |
| 205 | - <tfoot ng-show="totalItens > 0"> | |
| 206 | - <tr> | |
| 207 | - <td colspan="9"> | |
| 208 | - <div class="row"> | |
| 209 | - <div class='col-sm-4 table-showing'> | |
| 210 | - <translate>LABEL.MOSTRANDO</translate> | |
| 211 | - {{filterCriteria.start}} | |
| 212 | - <translate>LABEL.ATE</translate> | |
| 213 | - {{filterCriteria.limit > totalItens ? totalItens : filterCriteria.limit}} | |
| 214 | - <translate>LABEL.DE</translate> | |
| 215 | - ({{totalItens}}) | |
| 216 | - <translate>ESI.TAREFAS</translate> | |
| 217 | - . | |
| 218 | - </div> | |
| 219 | - <div class="col-sm-8 text-right"> | |
| 220 | - <pagination rotate="true" total-items="totalItens" num-pages="totalPages" ng-model="filterCriteria.start" items-per-page="filterCriteria.limit" class="pagination-sm" boundary-links="true" | |
| 221 | - ng-change="fetchResult()"></pagination> | |
| 222 | - </div> | |
| 223 | - <!-- .col --> | |
| 224 | - </div> <!-- .row --> | |
| 225 | - </td> | |
| 226 | - </tr> | |
| 227 | - </tfoot> | |
| 228 | - | |
| 229 | - | |
| 230 | - <tbody> | |
| 231 | - <tr ng-show="$showAdvancedFilters"> | |
| 232 | - <td style="width: 5%;"> | |
| 233 | - <div class="row"> | |
| 234 | - <div class="col-sm-12"> | |
| 235 | - <input class="form-control" ng-change="filterResult()" ng-model="filterCriteria.filters[0].value" type="text" integer /> | |
| 236 | - </div> | |
| 237 | - <!-- .col --> | |
| 238 | - </div> <!-- .row --> | |
| 239 | - </td> | |
| 240 | - <td> | |
| 241 | - <div class="row"> | |
| 242 | - <div class="col-sm-12"> | |
| 243 | - <input class="form-control" ng-change="filterResult()" ng-model="filterCriteria.filters[1].value" type="text" /> | |
| 244 | - </div> | |
| 245 | - <!-- .col --> | |
| 246 | - </div> <!-- .row --> | |
| 247 | - </td> | |
| 248 | - <td style="width: 5%;"> | |
| 249 | - <div class="row"> | |
| 250 | - <div class="col-sm-12"> | |
| 251 | - <input class="form-control" ng-change="filterResult()" ng-model="filterCriteria.filters[2].value" type="text" /> | |
| 252 | - </div> | |
| 253 | - <!-- .col --> | |
| 254 | - </div> <!-- .row --> | |
| 255 | - </td> | |
| 256 | - <td> | |
| 257 | - <div class="row"> | |
| 258 | - <div class="col-sm-12"> | |
| 259 | - <input class="form-control" ng-change="filterResult()" ng-model="filterCriteria.filters[3].value" type="date" /> | |
| 260 | - </div> | |
| 261 | - <!-- .col --> | |
| 262 | - </div> <!-- .row --> | |
| 263 | - </td> | |
| 264 | - | |
| 265 | - </tr> | |
| 266 | - | |
| 267 | - | |
| 268 | - <tr ng-repeat-start="processo in processos"> | |
| 269 | - | |
| 270 | - <td style="width: 25%;"> | |
| 271 | - <a href="#void" ng-click="abrirVisualizar(processo)"> | |
| 272 | - <span class="small green">{{processo.nup}} | |
| 273 | - <a href="javascript:;" class="blue" ng-click="retrieveAditionalHtml(processo)"> | |
| 274 | - <i class="fa fa-lg" ng-class="{'fa-caret-right': !processo.$show, 'fa-caret-down': processo.$show}"></i> | |
| 275 | - </a> | |
| 276 | - </span> | |
| 277 | - </a> | |
| 278 | - </td> | |
| 279 | - | |
| 280 | - | |
| 281 | - <td style="width: 25%;"><span class="small green">{{processo['sigiloOriginal.tipoSigilo.descricao']}}</span></td> | |
| 282 | - | |
| 283 | - <td style="width: 25%;"><span class="small green">{{processo['sigilo.tipoSigilo.descricao']}}</span></td> | |
| 284 | - | |
| 285 | - <td style="width: 25%;"><span class="small green">{{processo.prazoSigilo | date:'dd-MM-yyyy'}}</span></td> | |
| 286 | - | |
| 287 | - </tr> | |
| 288 | - | |
| 289 | - <tr ng-show="processo.$show" ng-repeat-end> | |
| 290 | - <td> </td> | |
| 291 | - | |
| 292 | - <td colspan="8"> | |
| 293 | - | |
| 294 | - <div class="media media-card" id="divHtmlAdicional_{{idPainelItem}}_{{processo.id}}"> | |
| 295 | - <small ng-show="!processo.documentos"><font color="red"><b><translate>MSG.AGUARDE</translate></b></font></small> | |
| 296 | - <!-- <a href="#void" ng-click="abrirVisualizar(processo)">{{processo.nup}}</a> --> | |
| 297 | - <div class="widget-main clearfix" > | |
| 298 | - <div class="itemdiv commentdiv" ng-repeat="documento in processo.documentos | orderBy:'-dataCriacao'" > | |
| 299 | - | |
| 300 | - <div class="user"> | |
| 301 | - <i class="{{documento.icon}}" title="{{documento.anexo.dominioTipoAnexo.descricao}}"></i> | |
| 302 | - </div> | |
| 303 | - | |
| 304 | - <div class="body"> | |
| 305 | - <div class="text ellipsis"> | |
| 306 | - <span class="black">{{documento.tipoDocumento.nome}} - {{documento.numero}}</span> | |
| 307 | - </div> | |
| 308 | - | |
| 309 | - <div class="time hidden-md"> | |
| 310 | - <i class="ace-icon fa fa-clock-o"></i> <span class="blue">{{documento.dataCriacao | date: 'dd/MM/yyyy HH:mm:ss'}}</span> | |
| 311 | - </div> | |
| 312 | - | |
| 313 | - <div class="text ellipsis" tooltip="{{documento.assuntoComplementar}}">{{documento.assuntoComplementar}}</div> | |
| 314 | - | |
| 315 | - <div class="itemdiv-informacoes"> | |
| 316 | - <span class="label label-gray" ng-show="documento.sigilo.tipoSigilo.codigo == 0 ">{{documento.sigilo.tipoSigilo.descricao}}</span> <span class="label label-danger" | |
| 317 | - ng-show="documento.sigilo.tipoSigilo.codigo == 1 ">{{documento.sigilo.tipoSigilo.descricao}}</span> <span class="label label-black" ng-show="documento.sigilo.tipoSigilo.codigo == 2 ">{{documento.sigilo.tipoSigilo.descricao}}</span> | |
| 318 | - <span class="label label-warning" ng-show="documento.nivelAcesso.nivelAcesso.codigo == 1">{{documento.nivelAcesso.nivelAcesso.descricao}}</span> <span class="label label-success" | |
| 319 | - ng-show="documento.nivelAcesso.nivelAcesso.codigo == 2">{{documento.nivelAcesso.nivelAcesso.descricao}}</span> <span class="label label-info" ng-show="documento.origem">Anexado</span> <span | |
| 320 | - class="label label-info" ng-show="false">Assinado</span> <span class="label label-success" ng-show="false">Habilitado</span> <span class="label label-warning" ng-show="false">Ciência</span> | |
| 321 | - <span class="label label-danger" ng-show="documento.cancelado">Cancelado</span> | |
| 322 | - </div> | |
| 323 | - </div> | |
| 324 | - </div> | |
| 325 | - </div> | |
| 326 | - </div> | |
| 327 | - </td> | |
| 328 | - </tr> | |
| 329 | - | |
| 330 | - <tr ng-show="totalItens <= 0"> | |
| 331 | - <td colspan="9"><strong><translate>MSG.NENHUM_REGISTRO_ENCONTRADO</translate></strong></td> | |
| 332 | - </tr> | |
| 333 | - | |
| 334 | - </tbody> | |
| 335 | - | |
| 336 | - </table> | |
| 337 | - | |
| 338 | - </div> | |
| 339 | - </div> | |
| 340 | - </div> | |
| 341 | - </tabset> | |
| 342 | -</div> | |
| 343 | -<!-- .table-container --> | |
| 344 | -</div> | |
| 345 | -<!-- .page-content --> | |
| 25 | + <list-view ng-lista="processos" ng-repository="ProcessoRepository" ng-headers="headers" ng-filter-criteria="filterCriteria" ng-item-selecionado="modelSelecionado" transclude="classificarDocumentos.html" | |
| 26 | + ng-custom-transclude="findDocumentos()" ng-model-parent="modelSelecionado"> | |
| 27 | + <div ng-include src="'/cit-ecm-web/html/classificarProcessoDocumento/classificarDocumentos.html'"></div> | |
| 28 | + </list-view> | |
| 29 | +</div> | |
| 346 | 30 | \ No newline at end of file | ... | ... |
cit-ecm-web/src/main/webapp/html/documentoGed/metadadosDocumentoEdit.html
| ... | ... | @@ -63,8 +63,8 @@ |
| 63 | 63 | <div class="row"> |
| 64 | 64 | |
| 65 | 65 | <div class="col-md-4"> |
| 66 | - <label-select ng-id="documentoGed.status" ng-model="documentoGed.status" ng-label="ECM.LABEL.STATUS" ng-obrigatorio='true' form="documentoGedForm" ng-list="statusList" | |
| 67 | - ng-custom-options="dominioStatus.originalElement as dominioStatus.descricao for dominioStatus" track-by="track by dominioStatus.id" ng-disabled='!edit'> </label-select> | |
| 66 | + <label-select ng-id="documentoGed.estado" ng-model="documentoGed.estado" ng-label="ECM.LABEL.ESTADO" ng-obrigatorio='true' form="documentoGedForm" ng-list="estadoList" | |
| 67 | + ng-custom-options="dominioEstado.originalElement as dominioEstado.descricao for dominioEstado" track-by="track by dominioEstado.id" ng-disabled='!edit'> </label-select> | |
| 68 | 68 | </div> |
| 69 | 69 | |
| 70 | 70 | <div class="col-md-8"> |
| ... | ... | @@ -128,8 +128,8 @@ |
| 128 | 128 | |
| 129 | 129 | <div class="row"> |
| 130 | 130 | <div class="col-sm-6" ng-show='documentoGed.nivelAcesso.nivelAcesso.codigo == 1 || documentoGed.sigilo.id'> |
| 131 | - <label-select ng-id="documentoGed.hipoteseLegal" ng-model="documentoGed.hipoteseLegal" ng-label="ECM.LABEL.HIPOTESELEGAL" ng-obrigatorio='false' form="documentoGedForm" ng-list="hipoteses" | |
| 132 | - ng-custom-options="hipoteseLegal.originalElement as hipoteseLegal.nome for hipoteseLegal" ng-obrigatorio='true' track-by="track by hipoteseLegal.id" ng-disabled='!edit'> </label-select> | |
| 131 | + <label-select ng-id="documentoGed.hipoteseLegal" ng-model="documentoGed.hipoteseLegal" ng-label="ECM.LABEL.HIPOTESELEGAL" ng-obrigatorio='documentoGed.nivelAcesso.nivelAcesso.codigo == 1 || documentoGed.sigilo.id' form="documentoGedForm" ng-list="hipoteses" | |
| 132 | + ng-custom-options="hipoteseLegal.originalElement as hipoteseLegal.nome for hipoteseLegal" track-by="track by hipoteseLegal.id" ng-disabled='!edit'> </label-select> | |
| 133 | 133 | </div> |
| 134 | 134 | </div> |
| 135 | 135 | ... | ... |
cit-ecm-web/src/main/webapp/html/gerenciarProcesso/gerenciarProcessoList.html
cit-ecm-web/src/main/webapp/html/gerenciarProcesso/includeDocumentosProcesso.html
| ... | ... | @@ -35,7 +35,7 @@ |
| 35 | 35 | </button> |
| 36 | 36 | |
| 37 | 37 | <ul class="dropdown-menu-center dropdown-menu dropdown-caret" role="menu"> |
| 38 | - <li ng-if='!documento.cancelado'><a href="#void" ng-click="editDocument(documento, true);"><translate>LABEL.EDITAR</translate></a></li> | |
| 38 | + <li ng-if='!documento.cancelado && documento.status.codigo != 0'><a href="#void" ng-click="editDocument(documento, true);"><translate>LABEL.EDITAR</translate></a></li> | |
| 39 | 39 | <li ng-if='!processo.isTramitado && (!documento.cancelado && documento.unidade.id === usuarioLogado.unidade.id)'><a href="#void" ng-click="removeDocumento(documento, $index);"><translate>LABEL.REMOVER</translate></a></li> |
| 40 | 40 | <li ng-if='processo.isTramitado && (!documento.cancelado && documento.unidade.id === usuarioLogado.unidade.id)'><a href="#void" ng-click='cancelarDocumento(documento)'> <translate>ECM.LABEL.CANCELARDOCUMENTO</translate></a></li> |
| 41 | 41 | <li ng-if='!documento.cancelado'><a href="#void" ng-click="visualizarVersoes(documento);"> <translate>ECM.LABEL.VERSOESDODOCUMENTO</translate></a></li> | ... | ... |
cit-ecm-web/src/main/webapp/html/gerenciarProcessoView/gerenciarProcessoView.html
| ... | ... | @@ -60,9 +60,11 @@ |
| 60 | 60 | |
| 61 | 61 | <div id="content-container" class="col-md-8"> |
| 62 | 62 | |
| 63 | - <div ng-include src="'/cit-ecm-web/html/documentoGed/documentoGedView.html'" ng-show="isDocumentoEdit" /> | |
| 63 | + <div ng-include src="'/cit-ecm-web/html/documentoGed/documentoGedView.html'" ng-show="isDocumentoEditView" /> | |
| 64 | 64 | |
| 65 | - <div ng-include src="'/cit-ecm-web/html/documentoGed/cancelarDocumentoView.html'" ng-show="isCancelarDocumento" /> | |
| 65 | + <div ng-include src="'/cit-ecm-web/html/documentoGed/cancelarDocumentoView.html'" ng-show="isCancelarDocumentoView" /> | |
| 66 | + | |
| 67 | + <div ng-include src="'/cit-ecm-web/html/historicoAlteracaoProcesso/historicoAlteracaoProcesso.html'" ng-show="isHistoricoProcessoView" /> | |
| 66 | 68 | |
| 67 | 69 | </div> |
| 68 | 70 | ... | ... |
cit-ecm-web/src/main/webapp/html/pesquisa/pesquisa.html
| 1 | +<link rel="stylesheet" href="/cit-ecm-web/assets/css/gerenciarProcesso.css" /> | |
| 1 | 2 | <div id="searchProcesso" class="page-content" ng-controller="SolrSearchController as solrController"> |
| 2 | 3 | <div class="bar-buttons-action fixed"> |
| 3 | 4 | <div class="row"> |
| 4 | 5 | <div class="col-sm-8 text-left"></div> |
| 5 | - <!-- .col --> | |
| 6 | 6 | |
| 7 | 7 | <div class="col-sm-4 text-right"> |
| 8 | 8 | <favorito /> |
| 9 | 9 | <help-button workspace="workspace" /> |
| 10 | 10 | </div> |
| 11 | - <!-- .col --> | |
| 12 | 11 | </div> |
| 13 | - <!-- .row --> | |
| 14 | 12 | </div> |
| 15 | - <!-- .bar-buttons-action --> | |
| 16 | - | |
| 17 | - <h1 class="title" align="center"> | |
| 18 | - <translate>ECM.LABEL.SOLR_SEARCH_INTERFACE</translate> | |
| 19 | - </h1> | |
| 20 | - | |
| 21 | 13 | <div class="row"> |
| 22 | - <div class="col-sm-12"> | |
| 23 | - <form class="searchbox" name="solrForm"> | |
| 24 | - <div class="input-group" id="inputs"> | |
| 25 | - <input type="text" class="form-control" id="query" type="text" placeholder="{{placeHolder}}" ng-model="userQuery" autocomplete="off" ng-focus="onfocus()" ng-blur="onblur()" | |
| 26 | - ng-keyup="onkeyup($event)"> | |
| 27 | - <div class="input-group-btn"> | |
| 28 | - <button class="btn btn-default" type="button" id="submit" name="submit" ng-click="handleSubmit()"> | |
| 29 | - <i class="ace-icon fa fa-search icon-on-right bigger-110"></i> | |
| 30 | - </button> | |
| 14 | + <div class="col-sm-12" style="text-align: center;"> | |
| 15 | + <h3> | |
| 16 | + <translate>ECM.LABEL.SOLR_SEARCH_INTERFACE</translate> | |
| 17 | + </h3> | |
| 18 | + </div> | |
| 19 | + </div> | |
| 20 | + <div class="widget-main clearfix"> | |
| 21 | + <form class="searchbox" name="solrForm"> | |
| 22 | + <div class="row"> | |
| 23 | + <div class="col-sm-10"> | |
| 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)"> | |
| 27 | + <div class="input-group-btn"> | |
| 28 | + <button class="btn btn-default" type="button" id="submit" name="submit" ng-click="handleSubmit()"> | |
| 29 | + <i class="ace-icon fa fa-search icon-on-right bigger-110"></i> | |
| 30 | + </button> | |
| 31 | + </div> | |
| 31 | 32 | </div> |
| 32 | 33 | </div> |
| 33 | - | |
| 34 | - <div class="row"> | |
| 35 | - <div class="col-md-8" ng-show='userQuery != "" && apresentarMsgSemResultado'> | |
| 36 | - </p><translate>ECM.LABEL.SUA_PESQUISA</translate>: <label style="font-weight: bold;">{{userQuery}} </label> | |
| 37 | - </p><translate>ECM.LABEL.NENHUM_DOCUMENTO_CORRESPONDENTE</translate> | |
| 38 | - </p><translate>ECM.LABEL.SUGESTOES</translate> | |
| 39 | - <ul> | |
| 40 | - <li style="list-style-type: disc;"><translate>ECM.LABEL.CERTIFIQUE_PALAVRAS_ESCRITAS_CORRETAMENTE</translate></li> | |
| 41 | - <li style="list-style-type: disc;"> <translate>ECM.LABEL.TENTE_PALAVRAS_CHAVES_DIFERENTE</translate></li> | |
| 42 | - <li style="list-style-type: disc;"><translate>ECM.LABEL.TENTE_PALAVRAS_CHAVES_MAIS_GENERICAS</translate></li> | |
| 43 | - <li style="list-style-type: disc;"><translate>ECM.LABEL.TENTE_MENOS_PALAVRAS_CHAVES</translate></li> | |
| 44 | - </ul> | |
| 45 | - </div> | |
| 34 | + <div class="col-sm-2"> | |
| 35 | + <button class="btn btn-primary btn-inline btn-white table-header-item" ng-click="$showAdvancedFilters = !$showAdvancedFilters" type="button"> | |
| 36 | + <i class="fa fa-filter"></i> | |
| 37 | + <translate>LABEL.FILTROS_AVANCADOS</translate> | |
| 38 | + </button> | |
| 39 | + <button class="btn btn-primary btn-inline btn-white table-header-item" ng-click="cleanFilters()" type="button"> | |
| 40 | + <i class="fa fa-eraser"></i> | |
| 41 | + </button> | |
| 46 | 42 | </div> |
| 47 | - | |
| 48 | - <!-- div class="alert alert-warning" ng-show="loading" ng-cloak> | |
| 49 | - <img | |
| 50 | - src="http://upload.wikimedia.org/wikipedia/commons/4/42/Loading.gif" | |
| 51 | - class="icon" /> | |
| 52 | - <h5> | |
| 53 | - Processing... | |
| 54 | - <button type="button" class="close" style="float: none;" | |
| 55 | - data-dismiss="modal" aria-hidden="true">�</button> | |
| 56 | - </h5> | |
| 57 | 43 | </div> |
| 58 | 44 | |
| 59 | - <div class="summary" ng-show="documents.length > 0" ng-cloak> | |
| 60 | - <div style="padding-bottom: 20px;"> | |
| 61 | - Search Results <span class="badge">{{totalResults}}</span> found | |
| 62 | - </div> | |
| 63 | - <div class="alert alert-warning" ng-show="error">{{error}}</div> | |
| 64 | - <div class="alert alert-info" ng-show="message">{{message}}</div> | |
| 65 | - </div--> | |
| 66 | - | |
| 67 | - </form> | |
| 68 | - </div> | |
| 69 | - </div> | |
| 45 | + <div class="row"> | |
| 70 | 46 | |
| 71 | - <div class="row"> | |
| 72 | - <div class="col-sm-2"> | |
| 73 | - <div class="ecm-search-wrapper"> | |
| 74 | - <div class="ecm-content-wrapper"> | |
| 75 | - <ul class="list-group"> | |
| 76 | - <li class="list-group-item document" ng-show="hints['tipoProcesso']"> | |
| 77 | - <h5> | |
| 78 | - <b translate>ECM.LABEL.DATACRIACAO</b> | |
| 79 | - </h5> | |
| 80 | - <ul> | |
| 81 | - <li ng-repeat="hint in hints['dataCriacao']" ng-class="{'selected' : hint.selected}"><a ng-click="selectHint('dataCriacao',$index);handleSubmit()">{{hint.title | date:'dd/MM/yyyy | |
| 82 | - HH:mm:ss'}}</a> {{hint.quantidade}}</li> | |
| 83 | - </ul> | |
| 84 | - </li> | |
| 85 | - <li class="list-group-item document" ng-show="hints['tipoProcesso']"> | |
| 86 | - <h5> | |
| 87 | - <b translate>ECM.LABEL.TIPOPROCESSO</b> | |
| 88 | - </h5> | |
| 89 | - <ul> | |
| 90 | - <li ng-repeat="hint in hints['tipoProcesso']" ng-class="{'selected' : hint.selected}"><a ng-click="selectHint('tipoProcesso',$index);handleSubmit()">{{hint.title}}</a> {{hint.quantidade}} | |
| 47 | + <div class="col-sm-2" ng-if="documents.length > 0"> | |
| 48 | + <div class="ecm-search-wrapper"> | |
| 49 | + <div class="ecm-content-wrapper"> | |
| 50 | + <ul class="list-group"> | |
| 51 | + <li class="list-group-item document" ng-show="hints['objeto']"> | |
| 52 | + <h5> | |
| 53 | + <b translate>ECM.LABEL.OBJETO</b> | |
| 54 | + </h5> | |
| 55 | + <ul class="filters_list"> | |
| 56 | + <li ng-repeat="hint in hints['objeto']" ng-class="{'selected' : hint.selected}"><a href="javascript: return false" ng-click="selectHint('objeto',$index);" class="filters" | |
| 57 | + ng-show="hint.quantidade > 0"> <span class="itens">{{hint.title}}</span> <span class="qtd">{{hint.quantidade}}</span> | |
| 58 | + </a></li> | |
| 59 | + </ul> | |
| 91 | 60 | </li> |
| 92 | - </ul> | |
| 93 | - </li> | |
| 94 | - <li class="list-group-item document" ng-show="hints['tipoDocumento']"> | |
| 95 | - <h5> | |
| 96 | - <b translate>ECM.LABEL.DADOS_TIPODOCUMENTO</b> | |
| 97 | - </h5> | |
| 98 | - <ul> | |
| 99 | - <li ng-repeat="hint in hints['tipoDocumento']" ng-class="{'selected' : hint.selected}"><a ng-click="selectHint('tipoDocumento',$index);handleSubmit()">{{hint.title}}</a> {{hint.quantidade}} | |
| 61 | + | |
| 62 | + <li class="list-group-item document" ng-show="hints['tipoProcesso'].length > 0"> | |
| 63 | + <h5> | |
| 64 | + <b translate>ECM.LABEL.TIPOPROCESSO</b> | |
| 65 | + </h5> | |
| 66 | + <ul class="filters_list"> | |
| 67 | + <li ng-repeat="hint in hints['tipoProcesso']" ng-class="{'selected' : hint.selected}"><a href="javascript: return false" ng-click="selectHint('tipoProcesso',$index);" class="filters"> | |
| 68 | + <span class="itens" ng-show="hint.quantidade > 0">{{hint.title}}</span> <span class="qtd" ng-show="hint.quantidade > 0">{{hint.quantidade}}</span> | |
| 69 | + </a></li> | |
| 70 | + </ul> | |
| 100 | 71 | </li> |
| 101 | - </ul> | |
| 102 | - </li> | |
| 103 | - <li class="list-group-item document" ng-show="hints['objeto']"> | |
| 104 | - <h5> | |
| 105 | - <b translate>ECM.LABEL.OBJETO</b> | |
| 106 | - </h5> | |
| 107 | - <ul> | |
| 108 | - <li ng-repeat="hint in hints['objeto']" ng-class="{'selected' : hint.selected}"><a ng-click="selectHint('objeto',$index);handleSubmit()">{{hint.title}}</a> {{hint.quantidade}} | |
| 72 | + | |
| 73 | + <li class="list-group-item document" ng-show="hints['tipoDocumento'].length > 0"> | |
| 74 | + <h5> | |
| 75 | + <b translate>ECM.LABEL.TIPODOCUMENTO</b> | |
| 76 | + </h5> | |
| 77 | + <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> | |
| 80 | + </a></li> | |
| 81 | + </ul> | |
| 109 | 82 | </li> |
| 110 | - </ul> | |
| 111 | - </li> | |
| 112 | - <li class="list-group-item document" ng-show="hints['assunto']"> | |
| 113 | - <h5> | |
| 114 | - <b translate>ECM.LABEL.ASSUNTO</b> | |
| 115 | - </h5> | |
| 116 | - <ul> | |
| 117 | - <li ng-repeat="hint in hints['assunto']" ng-class="{'selected' : hint.selected}"><a ng-click="selectHint('assunto',$index);handleSubmit()">{{hint.title}}</a> {{hint.quantidade}} | |
| 83 | + | |
| 84 | + <li class="list-group-item document" ng-show="hints['assunto'].length > 0"> | |
| 85 | + <h5> | |
| 86 | + <b translate>ECM.LABEL.ASSUNTO</b> | |
| 87 | + </h5> | |
| 88 | + <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> | |
| 92 | + </ul> | |
| 118 | 93 | </li> |
| 119 | - </ul> | |
| 120 | - </li> | |
| 121 | - <li class="list-group-item document" ng-show="hints['autor']"> | |
| 122 | - <h5> | |
| 123 | - <b translate>ECM.LABEL.AUTOR</b> | |
| 124 | - </h5> | |
| 125 | - <ul> | |
| 126 | - <li ng-repeat="hint in hints['autor']" ng-class="{'selected' : hint.selected}"><a ng-click="selectHint('autor',$index);handleSubmit()">{{hint.title}}</a> {{hint.quantidade}} | |
| 94 | + | |
| 95 | + <li class="list-group-item document" ng-show="hints['autor'].length > 0"> | |
| 96 | + <h5> | |
| 97 | + <b translate>ECM.LABEL.AUTOR</b> | |
| 98 | + </h5> | |
| 99 | + <ul class="filters_list"> | |
| 100 | + <li ng-repeat="hint in hints['autor']" ng-class="{'selected' : hint.selected}"><a href="javascript: return false" ng-click="selectHint('autor',$index)" class="filters"> <span | |
| 101 | + class="itens" ng-show="hint.quantidade > 0">{{hint.title}}</span> <span class="qtd" ng-show="hint.quantidade > 0">{{hint.quantidade}}</span> | |
| 102 | + </a></li> | |
| 103 | + </ul> | |
| 127 | 104 | </li> |
| 128 | - </ul> | |
| 129 | - </li> | |
| 130 | - <li class="list-group-item document" ng-show="hints['atribuidoA']"> | |
| 131 | - <h5> | |
| 132 | - <b translate>ECM.LABEL.ATRIBUIDOA</b> | |
| 133 | - </h5> | |
| 134 | - <ul> | |
| 135 | - <li ng-repeat="hint in hints['atribuidoA']" ng-class="{'selected' : hint.selected}"><a ng-click="selectHint('atribuidoA',$index);handleSubmit()">{{hint.title}}</a> {{hint.quantidade}} | |
| 105 | + | |
| 106 | + <li class="list-group-item document" ng-show="hints['destinatario'].length > 0"> | |
| 107 | + <h5> | |
| 108 | + <b translate>ECM.LABEL.DESTINATARIO</b> | |
| 109 | + </h5> | |
| 110 | + <ul class="filters_list"> | |
| 111 | + <li ng-repeat="hint in hints['destinatario']" ng-class="{'selected' : hint.selected}"><a href="javascript: return false" ng-click="selectHint('destinatario',$index)" class="filters"> | |
| 112 | + <span class="itens" ng-show="hint.quantidade > 0">{{hint.title}}</span> <span class="qtd" ng-show="hint.quantidade > 0">{{hint.quantidade}}</span> | |
| 113 | + </a></li> | |
| 114 | + </ul> | |
| 136 | 115 | </li> |
| 137 | - </ul> | |
| 138 | - </li> | |
| 139 | - <li class="list-group-item document" ng-show="hints['destinatario']"> | |
| 140 | - <h5> | |
| 141 | - <b translate>ECM.LABEL.DESTINATARIO</b> | |
| 142 | - </h5> | |
| 143 | - <ul> | |
| 144 | - <li ng-repeat="hint in hints['destinatario']" ng-class="{'selected' : hint.selected}"><a ng-click="selectHint('destinatario',$index);handleSubmit()">{{hint.title}}</a> {{hint.quantidade}} | |
| 116 | + | |
| 117 | + <li class="list-group-item document" ng-show="hints['atribuidoA'].length > 0"> | |
| 118 | + <h5> | |
| 119 | + <b translate>ECM.LABEL.ATRIBUIDOA</b> | |
| 120 | + </h5> | |
| 121 | + <ul class="filters_list"> | |
| 122 | + <li ng-repeat="hint in hints['atribuidoA']" ng-class="{'selected' : hint.selected}"><a href="javascript: return false" ng-click="selectHint('atribuidoA',$index)" class="filters"> <span | |
| 123 | + class="itens" ng-show="hint.quantidade > 0">{{hint.title}}</span> <span class="qtd" ng-show="hint.quantidade > 0">{{hint.quantidade}}</span> | |
| 124 | + </a></li> | |
| 125 | + </ul> | |
| 145 | 126 | </li> |
| 146 | - </ul> | |
| 147 | - </li> | |
| 148 | - <li class="list-group-item document" ng-show="hints['unidadeGeradora']"> | |
| 149 | - <h5> | |
| 150 | - <b translate>ECM.LABEL.UNIDADE_GERADORA</b> | |
| 151 | - </h5> | |
| 152 | - <ul> | |
| 153 | - <li ng-repeat="hint in hints['unidadeGeradora']" ng-class="{'selected' : hint.selected}"><a ng-click="selectHint('unidadeGeradora',$index);handleSubmit()">{{hint.title}}</a> {{hint.quantidade}} | |
| 127 | + | |
| 128 | + <li class="list-group-item document" ng-show="hints['unidadeGeradora'].length > 0"> | |
| 129 | + <h5> | |
| 130 | + <b translate>ECM.LABEL.UNIDADE_GERADORA</b> | |
| 131 | + </h5> | |
| 132 | + <ul class="filters_list"> | |
| 133 | + <li ng-repeat="hint in hints['unidadeGeradora']" ng-class="{'selected' : hint.selected}"><a href="javascript: return false" ng-click="selectHint('unidadeGeradora',$index)" | |
| 134 | + class="filters"> <span class="itens" ng-show="hint.quantidade > 0">{{hint.title}}</span> <span class="qtd" ng-show="hint.quantidade > 0">{{hint.quantidade}}</span> | |
| 135 | + </a></li> | |
| 136 | + </ul> | |
| 154 | 137 | </li> |
| 155 | - </ul> | |
| 156 | - </li> | |
| 157 | - <li class="list-group-item document" ng-show="hints['situacao']"> | |
| 158 | - <h5> | |
| 159 | - <b translate>LABEL.SITUACAO</b> | |
| 160 | - </h5> | |
| 161 | - <ul> | |
| 162 | - <li ng-repeat="hint in hints['situacao']" ng-class="{'selected' : hint.selected}"><a ng-click="selectHint('situacao',$index);handleSubmit()">{{hint.title}}</a> {{hint.quantidade}} | |
| 138 | + | |
| 139 | + <li class="list-group-item document" ng-show="hints['situacao'].length > 0"> | |
| 140 | + <h5> | |
| 141 | + <b translate>LABEL.SITUACAO</b> | |
| 142 | + </h5> | |
| 143 | + <ul class="filters_list"> | |
| 144 | + <li ng-repeat="hint in hints['situacao']" ng-class="{'selected' : hint.selected}"><a href="javascript: return false" ng-click="selectHint('situacao',$index)" class="filters"> <span | |
| 145 | + class="itens" ng-show="hint.quantidade > 0">{{hint.title}}</span> <span class="qtd" ng-show="hint.quantidade > 0">{{hint.quantidade}}</span> | |
| 146 | + </a></li> | |
| 147 | + </ul> | |
| 163 | 148 | </li> |
| 164 | - </ul> | |
| 165 | - </li> | |
| 166 | - <li class="list-group-item document" ng-show="hints['nivelAcesso']"> | |
| 167 | - <h5> | |
| 168 | - <b translate>ECM.LABEL.NIVELACESSO</b> | |
| 169 | - </h5> | |
| 170 | - <ul> | |
| 171 | - <li ng-repeat="hint in hints['nivelAcesso']" ng-class="{'selected' : hint.selected}"><a ng-click="selectHint('nivelAcesso',$index);handleSubmit()">{{hint.title}}</a> {{hint.quantidade}} | |
| 149 | + | |
| 150 | + <li class="list-group-item document" ng-show="hints['nivelAcesso'].length > 0"> | |
| 151 | + <h5> | |
| 152 | + <b translate>ECM.LABEL.NIVELACESSO</b> | |
| 153 | + </h5> | |
| 154 | + <ul class="filters_list"> | |
| 155 | + <li ng-repeat="hint in hints['nivelAcesso']" ng-class="{'selected' : hint.selected}"><a href="javascript: return false" ng-click="selectHint('nivelAcesso',$index)" class="filters"> | |
| 156 | + <span class="itens" ng-show="hint.quantidade > 0">{{hint.title}}</span> <span class="qtd" ng-show="hint.quantidade > 0">{{hint.quantidade}}</span> | |
| 157 | + </a></li> | |
| 158 | + </ul> | |
| 172 | 159 | </li> |
| 160 | + | |
| 173 | 161 | </ul> |
| 174 | - </li> | |
| 175 | - </ul> | |
| 162 | + </div> | |
| 163 | + </div> | |
| 176 | 164 | </div> |
| 177 | - </div> | |
| 178 | - </div> | |
| 179 | - <div id="search-results" class="col-sm-10" ng-cloak> | |
| 180 | - <!--Show documents--> | |
| 181 | - <div class="ecm-content-wrapper"> | |
| 182 | - <ul class="list-group"> | |
| 183 | - <li class="list-group-item document" ng-repeat="doc in documents" ng-cloak> | |
| 184 | - <div class="row"> | |
| 185 | - <div class="col-md-12"> | |
| 186 | - <a href="">{{doc.objeto == 'Documento' ? doc.numero : doc.nup}} - {{doc.objeto == 'Documento' ? doc.tipoDocumento : doc.tipoProcesso}}</a> <span class="label label-success pull-right" | |
| 187 | - ng-show="doc.nivelAcesso == 'Publico' || doc.nivelAcesso == 'Público'">{{doc.nivelAcesso}}</span> <span class="label label-warning pull-right" ng-show="doc.nivelAcesso =='Restrito'">{{doc.nivelAcesso}}</span> | |
| 188 | - <span class="label label-danger pull-right" ng-show="doc.nivelAcesso == 'Secreto'">{{doc.nivelAcesso}}</span> <span class="label label-gray pull-right" ng-show="doc.nivelAcesso == 'Reservado'">{{doc.nivelAcesso}}</span> | |
| 189 | - <span class="label label-black pull-right" ng-show="doc.nivelAcesso == 'Ultrassecreto'">{{doc.nivelAcesso}}</span> | |
| 190 | - </div> | |
| 165 | + | |
| 166 | + <div class="col-sm-10"> | |
| 167 | + | |
| 168 | + <div class="row" ng-show="$showAdvancedFilters" style="padding-top: 10px;"> | |
| 169 | + <div class="col-sm-2"> | |
| 170 | + <label-select ng-id="parameterPesquisa" ng-model="parameterPesquisa" ng-label="ECM.LABEL.OBJETO" form="solrForm" ng-list="filtroPesquisaList" | |
| 171 | + ng-custom-options="dominio.originalElement as dominio.descricao for dominio" show-selecione='false' ng-custom-change="addParameter()"> </label-select> | |
| 172 | + </div> | |
| 173 | + | |
| 174 | + <div class="col-sm-2"> | |
| 175 | + <label-select ng-id="parameterDatePesquisa" ng-label="ECM.LABEL.DATA_CRIACAO" ng-model="parameterDatePesquisa" form="solrForm" ng-list="filtroDateList" | |
| 176 | + ng-custom-options="dominio.originalElement as dominio.descricao for dominio" show-selecione='false' ng-custom-change="addParameterDate()"> </label-select> | |
| 191 | 177 | </div> |
| 192 | - <div class="row"> | |
| 193 | - <div class="col-md-12"> | |
| 194 | - <a href="">{{doc.assunto}}</a> | |
| 178 | + | |
| 179 | + <div class='col-sm-2' ng-show="parameterDatePesquisa.codigo == 6"> | |
| 180 | + <div class="form-group"> | |
| 181 | + <label for="date-birth" class="control-label">De</label> | |
| 182 | + <div class="control"> | |
| 183 | + <input id="date-birth" class="form-control" type="date" ng-model="dataInicioFiltro" ng-change="addParameterDatePersonalisada();"> | |
| 184 | + </div> | |
| 195 | 185 | </div> |
| 196 | 186 | </div> |
| 197 | - <div class="row"> | |
| 198 | - <div class="col-md-12"> | |
| 199 | - <pre>{{doc.objeto == 'Documento' ? doc.conteudo :doc.assuntoComplementar}}</pre> | |
| 187 | + | |
| 188 | + <div class='col-sm-2' ng-show="parameterDatePesquisa.codigo == 6"> | |
| 189 | + <div class="form-group"> | |
| 190 | + <label for="date-birth" class="control-label"><translate>ECM.LABEL.ATE</translate></label> | |
| 191 | + <div class="control"> | |
| 192 | + <input id="date-birth" class="form-control" type="date" ng-model="dataFimFiltro" ng-change="addParameterDatePersonalisada();"> | |
| 193 | + </div> | |
| 200 | 194 | </div> |
| 201 | 195 | </div> |
| 196 | + </div> | |
| 202 | 197 | |
| 198 | + <div class="row"> | |
| 199 | + <div class="col-md-8" ng-show='userQuery != "" && apresentarMsgSemResultado'> | |
| 200 | + </p> | |
| 201 | + <translate>ECM.LABEL.SUA_PESQUISA</translate> | |
| 202 | + : <label style="font-weight: bold;">{{userQuery}} </label> | |
| 203 | + </p> | |
| 204 | + <translate>ECM.LABEL.NENHUM_DOCUMENTO_CORRESPONDENTE</translate> | |
| 205 | + </p> | |
| 206 | + <translate>ECM.LABEL.SUGESTOES</translate> | |
| 207 | + <ul> | |
| 208 | + <li style="list-style-type: disc;"><translate>ECM.LABEL.CERTIFIQUE_PALAVRAS_ESCRITAS_CORRETAMENTE</translate></li> | |
| 209 | + <li style="list-style-type: disc;"><translate>ECM.LABEL.TENTE_PALAVRAS_CHAVES_DIFERENTE</translate></li> | |
| 210 | + <li style="list-style-type: disc;"><translate>ECM.LABEL.TENTE_PALAVRAS_CHAVES_MAIS_GENERICAS</translate></li> | |
| 211 | + <li style="list-style-type: disc;"><translate>ECM.LABEL.TENTE_MENOS_PALAVRAS_CHAVES</translate></li> | |
| 212 | + </ul> | |
| 213 | + </div> | |
| 214 | + </div> | |
| 203 | 215 | |
| 204 | - <div class="row"> | |
| 205 | - <div class="col-md-6">Unidade Geradora</div> | |
| 206 | - <div class="col-md-4">Autor</div> | |
| 207 | - <div class='col-sm-2'>Data Criação</div> | |
| 208 | - </div> <!-- .row --> | |
| 209 | - <div class="row"> | |
| 210 | - <div class="col-md-6">{{doc.unidadeGeradora}}</div> | |
| 211 | - <div class="col-md-4">{{doc.autor}}</div> | |
| 212 | - <div class='col-sm-2'>{{doc.dataCriacao | date:'dd/MM/yyyy HH:mm:ss'}}</div> | |
| 213 | - </div> <!-- .row --> | |
| 214 | - </li> | |
| 215 | - </ul> | |
| 216 | - </div> | |
| 216 | + <div id="search-results" class="row" ng-cloak> | |
| 217 | + <!--Show documents--> | |
| 218 | + <div class="ecm-content-wrapper"> | |
| 219 | + <ul class="list-group"> | |
| 220 | + <li class="list-group-item document" ng-class-odd="'odd_result_metadado'" ng-class-even="'background-color'" ng-repeat="doc in documents" ng-cloak> | |
| 221 | + <div class="row"> | |
| 222 | + <div class="col-md-12"> | |
| 223 | + <label class="result_metadado">{{doc.nup}} - {{doc.objeto == 'Documento' ? doc.tipoDocumento : doc.tipoProcesso}}</label> <span class="label label-success pull-right" | |
| 224 | + style="font-size: 13px;" ng-show="doc.nivelAcesso == 'Publico' || doc.nivelAcesso == 'Público'">{{doc.nivelAcesso}}</span> <span class="label label-warning pull-right" | |
| 225 | + style="font-size: 13px;" ng-show="doc.nivelAcesso =='Restrito'">{{doc.nivelAcesso}}</span> <span class="label label-danger pull-right" style="font-size: 13px;" | |
| 226 | + ng-show="doc.nivelAcesso == 'Secreto'">{{doc.nivelAcesso}}</span> <span class="label label-gray pull-right" style="font-size: 13px;" ng-show="doc.nivelAcesso == 'Reservado'">{{doc.nivelAcesso}}</span> | |
| 227 | + <span class="label label-black pull-right" style="font-size: 13px;" ng-show="doc.nivelAcesso == 'Ultrassecreto'">{{doc.nivelAcesso}}</span> | |
| 228 | + </div> | |
| 229 | + </div> | |
| 230 | + <div class="row"> | |
| 231 | + <div class="col-md-12"> | |
| 232 | + <label class="result_metadado">{{doc.assunto}}</label> | |
| 233 | + </div> | |
| 234 | + </div> | |
| 235 | + <div class="row"> | |
| 236 | + <div class="col-md-12"> | |
| 237 | + <div ng-show="doc.objeto == 'Processo'">{{doc.assuntoComplementar}}</div> | |
| 217 | 238 | |
| 218 | - <!--Show Pagination--> | |
| 219 | - <div class="col-sm-6 text-right" ng-show="totalPages > 1"> | |
| 220 | - <pagination rotate="true" max-size="10" total-items="totalResults" num-pages="totalPages" ng-model="start" items-per-page="10" class="pagination-sm" boundary-links="true" | |
| 221 | - ng-change="handleSetPage()" previous-text="‹" next-text="›" first-text="«" last-text="»"></pagination> | |
| 239 | + <div class="result_pesquisa" id="{{doc.id}}"></div> | |
| 240 | + </div> | |
| 241 | + </div> | |
| 242 | + | |
| 243 | + <div class="row"> | |
| 244 | + <div class="col-md-6"> | |
| 245 | + <label class="profile-info-label"><translate>ECM.LABEL.UNIDADE_GESTORA</translate></label> | |
| 246 | + </div> | |
| 247 | + <div class="col-md-4"> | |
| 248 | + <label class="profile-info-label"><translate>ECM.LABEL.AUTOR</translate></label> | |
| 249 | + </div> | |
| 250 | + <div class='col-sm-2'> | |
| 251 | + <label class="profile-info-label"><translate>ECM.LABEL.DATA_CRIACAO</translate></label> | |
| 252 | + </div> | |
| 253 | + </div> <!-- .row --> | |
| 254 | + <div class="row"> | |
| 255 | + <div class="col-md-6">{{doc.unidadeGeradora}}</div> | |
| 256 | + <div class="col-md-4">{{doc.autor}}</div> | |
| 257 | + <div class='col-sm-2'>{{doc.dataCriacao | date: 'dd/MM/yyyy HH:mm:ss': 'UTC'}}</div> | |
| 258 | + </div> <!-- .row --> | |
| 259 | + </li> | |
| 260 | + </ul> | |
| 261 | + </div> | |
| 262 | + | |
| 263 | + <!--Show Pagination--> | |
| 264 | + <div class="col-sm-6 text-right" ng-show="documents.length > 0 && totalPages > 1"> | |
| 265 | + <pagination rotate="true" max-size="10" total-items="totalResults" num-pages="totalPages" ng-model="start" items-per-page="10" class="pagination-sm" boundary-links="true" | |
| 266 | + ng-change="handleSetPage()" previous-text="‹" next-text="›" first-text="«" last-text="»"></pagination> | |
| 267 | + </div> | |
| 268 | + | |
| 269 | + </div> | |
| 270 | + </div> | |
| 222 | 271 | </div> |
| 223 | - <!-- .col --> | |
| 224 | - </div> | |
| 272 | + </form> | |
| 225 | 273 | </div> |
| 226 | 274 | </div> |
| 227 | 275 | <!-- .page-content --> |
| 228 | 276 | \ No newline at end of file | ... | ... |
cit-ecm-web/src/main/webapp/html/processo/processoEdit.html
| ... | ... | @@ -81,26 +81,27 @@ |
| 81 | 81 | |
| 82 | 82 | </div> |
| 83 | 83 | </div> |
| 84 | - | |
| 84 | + | |
| 85 | 85 | <div class="row" ng-show='processo.tipoProcesso.id'> |
| 86 | 86 | <div class="col-md-6"> |
| 87 | 87 | <div class="form-group"> |
| 88 | 88 | <div class="input-group"> |
| 89 | - <select class="form-control typeahead-wide" ng-model="sugestoes" ng-change="setAssunto(sugestoes)" multiple ng-id="sugestao" ng-disabled='assuntoSelecionado.id' ng-multiple="true" | |
| 90 | - ng-options="sugestao as sugestao.assunto for sugestao in assuntos" track-by="track by sugestao.id"> | |
| 91 | - </select> <span ng-show="sugestoes" ng-if="!processo.id" class="input-group-addon" ng-click="sugestoes = null" ng-class="{'hover-directive' : (($hover == true) && !disabled)}" | |
| 92 | - ng-mouseover="$hover = true" ng-mouseout="$hover = false"> <i class="fa fa-eraser bigger-110"></i> | |
| 93 | - </span> <span class="input-group-addon" style="visibility: hidden;"> <i class="fa fa-search bigger-110"></i> | |
| 94 | - </span> | |
| 89 | + <select class="form-control typeahead-wide" ng-model="sugestoes" ng-change="setAssunto(sugestoes)" multiple id="sugestoes" ng-disabled='assuntoSelecionado.id' ng-multiple="false" | |
| 90 | + ng-options="sugestao as sugestao.assunto for sugestao in assuntos track by sugestao.id"> | |
| 91 | + </select> <span ng-show="sugestoes" class="input-group-addon" ng-click="sugestoes = null" ng-class="{'hover-directive' : (($hover == true) && !disabled)}" ng-mouseover="$hover = true" | |
| 92 | + ng-mouseout="$hover = false"> <i class="fa fa-eraser bigger-110"></i> | |
| 93 | + </span> <span class="input-group-addon" style="visibility: hidden;"> <i class="fa fa-search bigger-110"></i></span> | |
| 95 | 94 | </div> |
| 95 | + | |
| 96 | 96 | </div> |
| 97 | 97 | </div> |
| 98 | 98 | </div> |
| 99 | + | |
| 99 | 100 | <div class="row" ng-show='processo.tipoProcesso.id'> |
| 100 | 101 | |
| 101 | 102 | <div class="col-md-6"> |
| 102 | 103 | <label-select ng-id="processo.nivelAcesso" ng-label="ECM.LABEL.NIVEL_ACESSO" ng-model="processo.nivelAcesso" ng-custom-change='setHipoteseLegal(processo.nivelAcesso.id)' form="processoForm" |
| 103 | - ng-obrigatorio="true" ng-disabled="!edit" ng-custom-options="nivelAcessoTipoProcesso.originalElement as nivelAcessoTipoProcesso.nivelAcesso.descricao for nivelAcessoTipoProcesso" | |
| 104 | + ng-obrigatorio="true" ng-disabled="!edit" ng-custom-options="nivelAcessoTipoProcesso.originalElement as nivelAcessoTipoProcesso.nivelAcesso.descricao for nivelAcessoTipoProcesso " | |
| 104 | 105 | track-by="track by nivelAcessoTipoProcesso.id" ng-list="nivelAcessoList" show-selecione='false'/> |
| 105 | 106 | </div> |
| 106 | 107 | |
| ... | ... | @@ -124,7 +125,7 @@ |
| 124 | 125 | |
| 125 | 126 | <div class="row"> |
| 126 | 127 | <div class="col-sm-6" ng-show='processo.nivelAcesso.nivelAcesso.codigo == 1 || processo.sigilo.id'> |
| 127 | - <label-select ng-id="processo.hipoteseLegal" ng-model="processo.hipoteseLegal" ng-label="ECM.LABEL.HIPOTESELEGAL" ng-obrigatorio='false' form="processoForm" ng-list="hipoteses" | |
| 128 | + <label-select ng-id="processo.hipoteseLegal" ng-model="processo.hipoteseLegal" ng-label="ECM.LABEL.HIPOTESELEGAL" ng-obrigatorio='processo.nivelAcesso.nivelAcesso.codigo == 1 || processo.sigilo.id' form="processoForm" ng-list="hipoteses" | |
| 128 | 129 | ng-custom-options="hipoteseLegal.originalElement as hipoteseLegal.nome for hipoteseLegal" ng-obrigatorio='true' track-by="track by hipoteseLegal.id" ng-disabled='!edit'> </label-select> |
| 129 | 130 | </div> |
| 130 | 131 | </div> | ... | ... |
cit-ecm-web/src/main/webapp/html/tarjaAssinatura/tarjaAssinatura.html
0 → 100644
cit-ecm-web/src/main/webapp/html/tarjaAssinatura/tarjaAssinaturaEdit.html
0 → 100644
| ... | ... | @@ -0,0 +1,137 @@ |
| 1 | +<div id="editTarjaAssinatura" class="page-content clearfix" ng-controller="TarjaAssinaturaController"> | |
| 2 | + <div class="bar-buttons-action fixed"> | |
| 3 | + <div class="row"> | |
| 4 | + <div class="col-sm-8 text-left"> | |
| 5 | + <button class="btn btn-clear" ng-click="saveOrUpdate(tarjaAssinaturaForm)" ng-show="edit" type="button"> | |
| 6 | + <i class="fa fa-save green"></i> | |
| 7 | + <translate>LABEL.SALVAR</translate> | |
| 8 | + </button> | |
| 9 | + <button class="btn btn-clear" ng-click="resetForm()" ng-show="edit"type="button"> | |
| 10 | + <i class="fa fa-eraser yellow-dark"></i> | |
| 11 | + <translate>LABEL.LIMPAR</translate> | |
| 12 | + </button> | |
| 13 | + <button class="btn btn-clear" ng-click="edit = true" ng-show="!edit" type="button"> | |
| 14 | + <i class="fa fa-pencil blue"></i> | |
| 15 | + <translate>LABEL.EDITAR</translate> | |
| 16 | + </button> | |
| 17 | + <button class="btn btn-clear" ng-click="cancelarEdicao()" ng-show="edit" type="button"> | |
| 18 | + <i class="fa fa-times"></i> | |
| 19 | + <translate>LABEL.CANCELAR</translate> | |
| 20 | + </button> | |
| 21 | + <button class="btn btn-clear" ng-click="cancelarEdicao()" ng-hide="edit" type="button" > | |
| 22 | + <i class="fa fa-search"></i> | |
| 23 | + <translate>LABEL.PESQUISAR</translate> | |
| 24 | + </button> | |
| 25 | + </div> | |
| 26 | + <!-- .col --> | |
| 27 | + | |
| 28 | + <div class="col-sm-4 text-right"> | |
| 29 | + <favorito /> | |
| 30 | + <help-button workspace="workspace" /> | |
| 31 | + </div><!-- .col --> | |
| 32 | + </div><!-- .row --> | |
| 33 | + </div><!-- .bar-buttons-action --> | |
| 34 | + | |
| 35 | + <breadcrumb ng-workspace="workspace"></breadcrumb> | |
| 36 | + <form name="tarjaAssinaturaForm"> | |
| 37 | + <fieldset> | |
| 38 | + <legend> | |
| 39 | + <translate>ECM.LABEL.DADOS_TARJA_ASSINATURA</translate> | |
| 40 | + </legend> | |
| 41 | + | |
| 42 | + <p><small>( <span class="red">*</span> ) <translate>LABEL.CAMPOS_OBRIGATORIOS</translate></small></p> | |
| 43 | + <div class="row"> | |
| 44 | + <div class="col-md-6"> | |
| 45 | + <label-input ng-id="tarjaAssinatura.descricao" ng-label="LABEL.DESCRICAO" ng-type="text" | |
| 46 | + ng-model="tarjaAssinatura.descricao" form="tarjaAssinaturaForm" ng-obrigatorio="true" | |
| 47 | + ng-custom-maxlength="100" ng-type="text" ng-disabled="!edit" /> | |
| 48 | + </div> | |
| 49 | + <div class="col-md-4"> | |
| 50 | + <label-input ng-id="tarjaAssinatura.tipoAssinatura" ng-label="ECM.LABEL.TIPO_ASSINATURA" ng-type="text" | |
| 51 | + ng-disabled="true" ng-model="tarjaAssinatura.tipoAssinatura.descricao" form="tarjaAssinaturaForm" | |
| 52 | + ng-obrigatorio="false" ng-type="text" /> | |
| 53 | + </div> | |
| 54 | + </div> | |
| 55 | + <div class="row"> | |
| 56 | + <div class="col-sm-12"> | |
| 57 | + <div class="form-group" ng-disable="!edit"> | |
| 58 | + <label class="control-label"><translate>ECM.LABEL.LOGO_TARJA_ASSINATURA</translate></label> | |
| 59 | + <div ng-if="tarjaAssinatura.anexoImagem.anexo == undefined" nv-file-drop="" uploader="uploaderLogo" ng-click="openFile();"> | |
| 60 | + <div nv-file-over="" uploader="uploaderLogo" over-class="another-file-over-class" class="well my-drop-zone"> | |
| 61 | + <span ng-show="uploaderLogo.queue.length <= 0"><translate>MSG.ARRASTE_SOLTE_ARQUIVO</translate></span> | |
| 62 | + <span ng-show="uploaderLogo.queue.length > 0">{{uploaderLogo.queue[0].file.name}}</span> | |
| 63 | + </div> | |
| 64 | + </div> | |
| 65 | + <input id="uploadLogoTarjaAssinatura" type="file" nv-file-select="" uploader="uploaderLogo" ng-show="false" /> | |
| 66 | + </div><!-- .form-group --> | |
| 67 | + </div> | |
| 68 | + </div> | |
| 69 | + <div class="row" > | |
| 70 | + <div class="col-sm-12" ng-show="tarjaAssinatura.anexoImagem.anexo"> | |
| 71 | + <img ng-src="data:image/JPEG;base64,{{tarjaAssinatura.anexoImagem.anexo}}" class="img-thumbnail" style="max-width: 300px; height: auto;"> | |
| 72 | + </div> | |
| 73 | + </div> | |
| 74 | + <div class="row" style="margin-top: 10px;"> | |
| 75 | + <div class="col-sm-2" ng-show="tarjaAssinatura.anexoImagem.anexo && edit"> | |
| 76 | + <button class="btn btn-warning" ng-click="removeImagem()"> | |
| 77 | + <translate>ECM.LABEL.REMOVER_IMAGEM</translate> | |
| 78 | + </button> | |
| 79 | + </div> | |
| 80 | + </div> | |
| 81 | + <div class="row" style="margin-top: 10px;" ng-show="edit"> | |
| 82 | + <div class="col-md-12"> | |
| 83 | + <label class="control-label"><translate>ECM.LABEL.CAMPOS_DINAMICOS</translate></label> | |
| 84 | + </div> | |
| 85 | + </div> | |
| 86 | + <div class="row" style="margin-top: 10px;" ng-show="edit"> | |
| 87 | + <div class="col-md-2"> | |
| 88 | + <div ng-init="btnLogo='@logo@';"> | |
| 89 | + <button ng-attr-id="btnLogo" class="btn btn-default btn-block" ng-click="insertTextEditor(btnLogo)">@logo@</button> | |
| 90 | + </div> | |
| 91 | + </div> | |
| 92 | + <div class="col-md-2"> | |
| 93 | + <div ng-init="btnNomeAssinante='@nome_assinante@';"> | |
| 94 | + <button ng-attr-id="btnNomeAssinante" class="btn btn-default btn-block" ng-click="insertTextEditor(btnNomeAssinante)">@nome_assinante@</button> | |
| 95 | + </div> | |
| 96 | + </div> | |
| 97 | + <div class="col-md-2"> | |
| 98 | + <div ng-init="btnFuncaoAssinante='@funcao_assinante@';"> | |
| 99 | + <button ng-attr-id="btnFuncaoAssinante" class="btn btn-default btn-block" ng-click="insertTextEditor(btnFuncaoAssinante)">@funcao_assinante@</button> | |
| 100 | + </div> | |
| 101 | + </div> | |
| 102 | + </div> | |
| 103 | + <div class="row" style="margin-top: 10px;" ng-show="edit"> | |
| 104 | + <div class="col-md-2"> | |
| 105 | + <div ng-init="btnDataAssinatura='@data_assinatura@';"> | |
| 106 | + <button ng-attr-id="btnDataAssinatura" class="btn btn-default btn-block" ng-click="insertTextEditor(btnDataAssinatura)">@data_assinatura@</button> | |
| 107 | + </div> | |
| 108 | + </div> | |
| 109 | + <div class="col-md-2"> | |
| 110 | + <div ng-init="btnHoraAssinatura='@hora_assinatura@';"> | |
| 111 | + <button ng-attr-id="btnHoraAssinatura" class="btn btn-default btn-block" ng-click="insertTextEditor(btnHoraAssinatura)">@hora_assinatura@</button> | |
| 112 | + </div> | |
| 113 | + </div> | |
| 114 | + <div class="col-md-2"> | |
| 115 | + <div ng-init="btnCodigoAssinatura='@codigo_assinatura@';"> | |
| 116 | + <button ng-attr-id="btnCodigoAssinatura" class="btn btn-default btn-block" ng-click="insertTextEditor(btnCodigoAssinatura)">@codigo_assinatura@</button> | |
| 117 | + </div> | |
| 118 | + </div> | |
| 119 | + </div> | |
| 120 | + <div class="row" style="margin-top: 10px;"> | |
| 121 | + <div class="col-md-12"> | |
| 122 | + <div class="form-group"> | |
| 123 | + <label class="control-label block" ng-class="{'has-error': !tarjaAssinatura.conteudo && tarjaAssinaturaForm.$submitted}"> | |
| 124 | + <translate>ECM.LABEL.CONTEUDO_HTML</translate> <span class="red">*</span> | |
| 125 | + <i ng-show="!tarjaAssinatura.conteudo && tarjaAssinaturaForm.$submitted" class='fa fa-warning red' | |
| 126 | + tooltip="{{$translate.instant('ECM.LABEL.CONTEUDO_HTML') + ' ' +$translate.instant('LABEL.CAMPO_OBRIGATORIO')}}" | |
| 127 | + tooltip-placement='top'></i> | |
| 128 | + </label> | |
| 129 | + <div id="editorConteudo" ckeditor="options" ng-if='edit' ready="onReady()" ng-model="tarjaAssinatura.conteudo" ></div> | |
| 130 | + <iframe id="visualizacaoConteudoTarjaAssinatura" srcdoc="{{tarjaAssinatura.conteudo}}" | |
| 131 | + allowfullscreen class="iframe-report" ng-show="!edit" style="min-height: 100px !important;"></iframe> | |
| 132 | + </div> | |
| 133 | + </div> | |
| 134 | + </div> | |
| 135 | + </fieldset> | |
| 136 | + </form> | |
| 137 | +</div><!-- .page-content --> | ... | ... |
cit-ecm-web/src/main/webapp/html/tarjaAssinatura/tarjaAssinaturaList.html
0 → 100644
| ... | ... | @@ -0,0 +1,32 @@ |
| 1 | +<div id="searchTarjaAssinatura" class="page-content" ng-controller="TarjaAssinaturaListController"> | |
| 2 | + <div class="bar-buttons-action fixed"> | |
| 3 | + <div class="row"> | |
| 4 | + <div class="col-sm-8 text-left"> | |
| 5 | + <button class="btn btn-clear" ng-click="editarVisualizarTarjaAssinatura(false);"> | |
| 6 | + <i class="fa fa-search blue"></i> | |
| 7 | + <translate>LABEL.VISUALIZAR</translate> | |
| 8 | + </button> | |
| 9 | + <button class="btn btn-clear" ng-click="editarVisualizarTarjaAssinatura(true);"> | |
| 10 | + <i class="fa fa-pencil blue"></i> | |
| 11 | + <translate>LABEL.EDITAR</translate> | |
| 12 | + </button> | |
| 13 | + <span class="divider-vertical"></span> | |
| 14 | + <filtros ng-filter="filterCriteria" ng-workspace="workspace"></filtros> | |
| 15 | + </div> | |
| 16 | + <!-- .col --> | |
| 17 | + | |
| 18 | + <div class="col-sm-4 text-right"> | |
| 19 | + <favorito /> | |
| 20 | + <help-button workspace="workspace" /> | |
| 21 | + </div> | |
| 22 | + <!-- .col --> | |
| 23 | + </div> | |
| 24 | + <!-- .row --> | |
| 25 | + </div> | |
| 26 | + <!-- .bar-buttons-action --> | |
| 27 | + | |
| 28 | + <breadcrumb ng-workspace="workspace"></breadcrumb> | |
| 29 | + | |
| 30 | + <list-view ng-lista="tarjaAssinaturaList" ng-repository="TarjaAssinaturaRepository" ng-use-custom-remove="false" | |
| 31 | + ng-headers="headers" ng-filter-criteria="filterCriteria" ng-item-selecionado="tarjaAssinaturaChecked"></list-view> | |
| 32 | +</div><!-- .page-content --> | ... | ... |