Commit dc81a567e41e19e842f81eec42e59f7438597014

Authored by gabriel.damasceno
2 parents aac7891d e3bcbeb6
Exists in master

Merge branch 'desenvolvimento' into tarefa-3216

Showing 45 changed files with 2133 additions and 1112 deletions   Show diff stats
cit-ecm-api/src/main/java/br/com/centralit/api/dao/CredencialProcessoDao.java
@@ -95,4 +95,41 @@ public interface CredencialProcessoDao extends CitGenericDAO { @@ -95,4 +95,41 @@ public interface CredencialProcessoDao extends CitGenericDAO {
95 */ 95 */
96 CredencialProcesso obterPorGrupoEProcesso(Long idProcesso, Long idGrupo); 96 CredencialProcesso obterPorGrupoEProcesso(Long idProcesso, Long idGrupo);
97 97
  98 + /**
  99 + * <p>
  100 + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a>
  101 + * </p>
  102 + *
  103 + * <p>
  104 + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a>
  105 + * </p>
  106 + *
  107 + * Método responsável por verificar se o usuario contem credencial
  108 + *
  109 + * @author rogerio.costa
  110 + *
  111 + * @param idUsuario
  112 + * @param idProcesso
  113 + * @return Boolean
  114 + */
  115 + Boolean contemCredencial(Long idUsuario, Long idProcesso);
  116 +
  117 + /**
  118 + * <p>
  119 + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a>
  120 + * </p>
  121 + *
  122 + * <p>
  123 + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a>
  124 + * </p>
  125 + *
  126 + * Método responsável por listar através do id do processo
  127 + *
  128 + * @author rogerio.costa
  129 + *
  130 + * @param idProcesso
  131 + * @return Collection<CredencialProcesso>
  132 + */
  133 + Collection<CredencialProcesso> findByIdProcesso(Long idProcesso);
  134 +
98 } 135 }
cit-ecm-api/src/main/java/br/com/centralit/api/dao/HistoricoCredencialProcessoDao.java
@@ -2,6 +2,7 @@ package br.com.centralit.api.dao; @@ -2,6 +2,7 @@ package br.com.centralit.api.dao;
2 2
3 import java.util.Collection; 3 import java.util.Collection;
4 4
  5 +import br.com.centralit.api.model.CredencialProcesso;
5 import br.com.centralit.api.model.HistoricoCredencialProcesso; 6 import br.com.centralit.api.model.HistoricoCredencialProcesso;
6 import br.com.centralit.framework.dao.arquitetura.CitGenericDAO; 7 import br.com.centralit.framework.dao.arquitetura.CitGenericDAO;
7 8
@@ -58,4 +59,23 @@ public interface HistoricoCredencialProcessoDao extends CitGenericDAO { @@ -58,4 +59,23 @@ public interface HistoricoCredencialProcessoDao extends CitGenericDAO {
58 */ 59 */
59 Collection<HistoricoCredencialProcesso> findByIdProcessoAndIdProcessoRemocao(Long idProcesso); 60 Collection<HistoricoCredencialProcesso> findByIdProcessoAndIdProcessoRemocao(Long idProcesso);
60 61
  62 + /**
  63 + * <p>
  64 + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a>
  65 + * </p>
  66 + *
  67 + * <p>
  68 + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a>
  69 + * </p>
  70 + *
  71 + * Método responsável por listar através da credencial e credenciado
  72 + *
  73 + * @author rogerio.costa
  74 + *
  75 + * @param credencialProcesso
  76 + *
  77 + * @return HistoricoCredencialProcesso
  78 + */
  79 + HistoricoCredencialProcesso findByCredencialAndCredenciado(CredencialProcesso credencialProcesso);
  80 +
61 } 81 }
cit-ecm-api/src/main/java/br/com/centralit/api/dao/ProcessoDao.java
@@ -91,5 +91,34 @@ public interface ProcessoDao extends CitGenericDAO { @@ -91,5 +91,34 @@ public interface ProcessoDao extends CitGenericDAO {
91 * @return 91 * @return
92 */ 92 */
93 Boolean isProcessoAbertoEmOutrasUnidades(Processo processo); 93 Boolean isProcessoAbertoEmOutrasUnidades(Processo processo);
  94 +
  95 + /**
  96 + * <p><b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a></p>
  97 + *
  98 + * <p><b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a></p>
  99 + *
  100 + * Método responsável por
  101 + *
  102 + * @author maycon.silva
  103 + *
  104 + * @param idProcessInstance
  105 + * @return
  106 + */
  107 + Processo getProcessoByIdProcessInstance(Long idProcessInstance);
  108 +
  109 +
  110 + /**
  111 + * <p><b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a></p>
  112 + *
  113 + * <p><b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a></p>
  114 + *
  115 + * Método responsável por
  116 + *
  117 + * @author maycon.silva
  118 + *
  119 + * @param nup
  120 + * @return
  121 + */
  122 + Processo getProcessoByProtocolo(String nup);
94 123
95 } 124 }
cit-ecm-api/src/main/java/br/com/centralit/api/dao/impl/CredencialProcessoDaoHibernate.java
@@ -3,9 +3,6 @@ package br.com.centralit.api.dao.impl; @@ -3,9 +3,6 @@ package br.com.centralit.api.dao.impl;
3 import java.util.Collection; 3 import java.util.Collection;
4 import java.util.LinkedList; 4 import java.util.LinkedList;
5 5
6 -import org.hibernate.Criteria;  
7 -import org.hibernate.Session;  
8 -import org.hibernate.criterion.Restrictions;  
9 import org.springframework.stereotype.Repository; 6 import org.springframework.stereotype.Repository;
10 7
11 import br.com.centralit.api.dao.CredencialProcessoDao; 8 import br.com.centralit.api.dao.CredencialProcessoDao;
@@ -14,9 +11,7 @@ import br.com.centralit.api.viewHelper.GrupoUsuarioVH; @@ -14,9 +11,7 @@ import br.com.centralit.api.viewHelper.GrupoUsuarioVH;
14 import br.com.centralit.framework.dao.arquitetura.CitGenericDAOImpl; 11 import br.com.centralit.framework.dao.arquitetura.CitGenericDAOImpl;
15 import br.com.centralit.framework.dao.arquitetura.SearchSeven; 12 import br.com.centralit.framework.dao.arquitetura.SearchSeven;
16 import br.com.centralit.framework.model.Grupo; 13 import br.com.centralit.framework.model.Grupo;
17 -import br.com.centralit.framework.model.Privilegio;  
18 import br.com.centralit.framework.model.Usuario; 14 import br.com.centralit.framework.model.Usuario;
19 -import br.com.centralit.framework.util.UtilColecao;  
20 import br.com.centralit.framework.util.UtilObjeto; 15 import br.com.centralit.framework.util.UtilObjeto;
21 16
22 /** 17 /**
@@ -144,7 +139,7 @@ public class CredencialProcessoDaoHibernate extends CitGenericDAOImpl implements @@ -144,7 +139,7 @@ public class CredencialProcessoDaoHibernate extends CitGenericDAOImpl implements
144 139
145 return this.searchUnique(searchSeven, persistentClass); 140 return this.searchUnique(searchSeven, persistentClass);
146 } 141 }
147 - 142 +
148 /** 143 /**
149 * <p> 144 * <p>
150 * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a> 145 * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a>
@@ -175,4 +170,58 @@ public class CredencialProcessoDaoHibernate extends CitGenericDAOImpl implements @@ -175,4 +170,58 @@ public class CredencialProcessoDaoHibernate extends CitGenericDAOImpl implements
175 return this.searchUnique(searchSeven, persistentClass); 170 return this.searchUnique(searchSeven, persistentClass);
176 } 171 }
177 172
  173 + /**
  174 + * <p>
  175 + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a>
  176 + * </p>
  177 + *
  178 + * <p>
  179 + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a>
  180 + * </p>
  181 + *
  182 + * Método responsável por verificar se o usuario contem credencial
  183 + *
  184 + * @author rogerio.costa
  185 + *
  186 + * @param idUsuario
  187 + * @param idProcesso
  188 + * @return Boolean
  189 + */
  190 + public Boolean contemCredencial(Long idUsuario, Long idProcesso) {
  191 +
  192 + SearchSeven searchSeven = new SearchSeven();
  193 +
  194 + searchSeven.addFilterEqual("processo.id", idProcesso);
  195 +
  196 + searchSeven.addFilterEqual("usuario.id", idUsuario);
  197 +
  198 + return UtilObjeto.isReferencia(this.searchUnique(searchSeven));
  199 + }
  200 +
  201 + /**
  202 + * <p>
  203 + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a>
  204 + * </p>
  205 + *
  206 + * <p>
  207 + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a>
  208 + * </p>
  209 + *
  210 + * Método responsável por listar através do id do processo
  211 + *
  212 + * @author rogerio.costa
  213 + *
  214 + * @param idProcesso
  215 + * @return Collection<CredencialProcesso>
  216 + */
  217 + public Collection<CredencialProcesso> findByIdProcesso(Long idProcesso) {
  218 +
  219 + SearchSeven searchSeven = new SearchSeven();
  220 +
  221 + searchSeven.addFilterEqual("processo.id", idProcesso);
  222 +
  223 + return this.search(searchSeven);
  224 +
  225 + }
  226 +
178 } 227 }
cit-ecm-api/src/main/java/br/com/centralit/api/dao/impl/HistoricoCredencialProcessoDaoHibernate.java
@@ -5,9 +5,11 @@ import java.util.Collection; @@ -5,9 +5,11 @@ import java.util.Collection;
5 import org.springframework.stereotype.Repository; 5 import org.springframework.stereotype.Repository;
6 6
7 import br.com.centralit.api.dao.HistoricoCredencialProcessoDao; 7 import br.com.centralit.api.dao.HistoricoCredencialProcessoDao;
  8 +import br.com.centralit.api.model.CredencialProcesso;
8 import br.com.centralit.api.model.HistoricoCredencialProcesso; 9 import br.com.centralit.api.model.HistoricoCredencialProcesso;
9 import br.com.centralit.framework.dao.arquitetura.CitGenericDAOImpl; 10 import br.com.centralit.framework.dao.arquitetura.CitGenericDAOImpl;
10 import br.com.centralit.framework.dao.arquitetura.SearchSeven; 11 import br.com.centralit.framework.dao.arquitetura.SearchSeven;
  12 +import br.com.centralit.framework.util.UtilObjeto;
11 13
12 import com.googlecode.genericdao.search.Filter; 14 import com.googlecode.genericdao.search.Filter;
13 15
@@ -81,4 +83,38 @@ public class HistoricoCredencialProcessoDaoHibernate extends CitGenericDAOImpl i @@ -81,4 +83,38 @@ public class HistoricoCredencialProcessoDaoHibernate extends CitGenericDAOImpl i
81 83
82 } 84 }
83 85
  86 + /**
  87 + * <p>
  88 + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a>
  89 + * </p>
  90 + *
  91 + * <p>
  92 + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a>
  93 + * </p>
  94 + *
  95 + * Método responsável por listar através da credencial e credenciado
  96 + *
  97 + * @author rogerio.costa
  98 + *
  99 + * @param credencialProcesso
  100 + *
  101 + * @return HistoricoCredencialProcesso
  102 + */
  103 + public HistoricoCredencialProcesso findByCredencialAndCredenciado(CredencialProcesso credencialProcesso) {
  104 +
  105 + SearchSeven searchSeven = new SearchSeven();
  106 +
  107 + searchSeven.addFilterEqual("credencialProcesso.id", credencialProcesso.getId());
  108 +
  109 + if (UtilObjeto.isReferencia(credencialProcesso.getGrupo())) {
  110 +
  111 + searchSeven.addFilterEqual("grupo.id", credencialProcesso.getGrupo().getId());
  112 + } else {
  113 +
  114 + searchSeven.addFilterEqual("usuario.id", credencialProcesso.getUsuario().getId());
  115 + }
  116 +
  117 + return this.searchUnique(searchSeven);
  118 + }
  119 +
84 } 120 }
cit-ecm-api/src/main/java/br/com/centralit/api/dao/impl/ProcessoDaoHibernate.java
@@ -83,7 +83,7 @@ public class ProcessoDaoHibernate extends CitGenericDAOImpl implements ProcessoD @@ -83,7 +83,7 @@ public class ProcessoDaoHibernate extends CitGenericDAOImpl implements ProcessoD
83 return this.search(searchSeven); 83 return this.search(searchSeven);
84 84
85 } 85 }
86 - 86 +
87 /** 87 /**
88 * 88 *
89 */ 89 */
@@ -98,25 +98,29 @@ public class ProcessoDaoHibernate extends CitGenericDAOImpl implements ProcessoD @@ -98,25 +98,29 @@ public class ProcessoDaoHibernate extends CitGenericDAOImpl implements ProcessoD
98 98
99 criteria.add(Restrictions.eq("id", processo.getId())); 99 criteria.add(Restrictions.eq("id", processo.getId()));
100 criteria.add(Restrictions.ne("unidade.id", processo.getUnidade().getId())); 100 criteria.add(Restrictions.ne("unidade.id", processo.getUnidade().getId()));
101 - 101 +
102 Long quantidade = (Long) criteria.uniqueResult(); 102 Long quantidade = (Long) criteria.uniqueResult();
103 -  
104 - if(quantidade > 0) 103 +
  104 + if (quantidade > 0)
105 return Boolean.TRUE; 105 return Boolean.TRUE;
106 - 106 +
107 return Boolean.FALSE; 107 return Boolean.FALSE;
108 } 108 }
109 - 109 +
110 /** 110 /**
111 * 111 *
112 - * <p><b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a></p>  
113 - *  
114 - * <p><b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a></p>  
115 - * 112 + * <p>
  113 + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a>
  114 + * </p>
  115 + *
  116 + * <p>
  117 + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a>
  118 + * </p>
  119 + *
116 * Método responsável por 120 * Método responsável por
117 - * 121 + *
118 * @author andre.silva 122 * @author andre.silva
119 - * 123 + *
120 * @param idProcesso 124 * @param idProcesso
121 * @param data 125 * @param data
122 * @return 126 * @return
@@ -130,12 +134,39 @@ public class ProcessoDaoHibernate extends CitGenericDAOImpl implements ProcessoD @@ -130,12 +134,39 @@ public class ProcessoDaoHibernate extends CitGenericDAOImpl implements ProcessoD
130 134
131 criteria.setProjection(Projections.rowCount()); 135 criteria.setProjection(Projections.rowCount());
132 136
133 -  
134 criteria.add(Restrictions.between("dataCriacao", dataInicial, dataFinal)); 137 criteria.add(Restrictions.between("dataCriacao", dataInicial, dataFinal));
135 138
136 return (Long) criteria.uniqueResult(); 139 return (Long) criteria.uniqueResult();
137 } 140 }
138 -  
139 141
  142 + /**
  143 + *
  144 + */
  145 + @Override
  146 + public Processo getProcessoByIdProcessInstance(Long idProcessInstance) {
  147 +
  148 + SearchSeven search = new SearchSeven(persistentClass);
  149 +
  150 + search.addFilterEqual("idProcessInstance", idProcessInstance);
  151 +
  152 + search(search, Processo.class);
  153 +
  154 + return searchUnique(search);
  155 + }
  156 +
  157 + /**
  158 + *
  159 + */
  160 + @Override
  161 + public Processo getProcessoByProtocolo(String nup) {
  162 +
  163 + SearchSeven search = new SearchSeven(persistentClass);
  164 +
  165 + search.addFilterEqual("nup", nup);
  166 +
  167 + search(search, Processo.class);
  168 +
  169 + return searchUnique(search);
  170 + }
140 171
141 } 172 }
cit-ecm-api/src/main/java/br/com/centralit/api/model/CredencialProcesso.java
@@ -10,11 +10,13 @@ import javax.persistence.GenerationType; @@ -10,11 +10,13 @@ import javax.persistence.GenerationType;
10 import javax.persistence.Id; 10 import javax.persistence.Id;
11 import javax.persistence.ManyToOne; 11 import javax.persistence.ManyToOne;
12 import javax.persistence.OneToMany; 12 import javax.persistence.OneToMany;
  13 +import javax.persistence.Transient;
13 14
14 import br.com.centralit.framework.json.Views; 15 import br.com.centralit.framework.json.Views;
15 import br.com.centralit.framework.model.Grupo; 16 import br.com.centralit.framework.model.Grupo;
16 import br.com.centralit.framework.model.Usuario; 17 import br.com.centralit.framework.model.Usuario;
17 import br.com.centralit.framework.model.arquitetura.PersistentObjectAudit; 18 import br.com.centralit.framework.model.arquitetura.PersistentObjectAudit;
  19 +import br.com.centralit.framework.util.UtilObjeto;
18 20
19 import com.fasterxml.jackson.annotation.JsonView; 21 import com.fasterxml.jackson.annotation.JsonView;
20 22
@@ -70,9 +72,18 @@ public class CredencialProcesso extends PersistentObjectAudit { @@ -70,9 +72,18 @@ public class CredencialProcesso extends PersistentObjectAudit {
70 @JsonView({ Views.CredencialProcessoView.class }) 72 @JsonView({ Views.CredencialProcessoView.class })
71 private String icon; 73 private String icon;
72 74
  75 + /** Atributo idTask. */
  76 + @JsonView({ Views.CredencialProcessoView.class })
  77 + private Long idTask;
  78 +
  79 + /** Atributo permiteEdicao. */
  80 + @Transient
  81 + @JsonView({ Views.CredencialProcessoView.class })
  82 + private Boolean permiteEdicao;
  83 +
73 /** Atributo processo. */ 84 /** Atributo processo. */
74 @ManyToOne(fetch = FetchType.LAZY) 85 @ManyToOne(fetch = FetchType.LAZY)
75 - @JsonView({ Views.CredencialProcessoView.class}) 86 + @JsonView({ Views.CredencialProcessoView.class })
76 private Processo processo; 87 private Processo processo;
77 88
78 /** Atributo processoRemocao. */ 89 /** Atributo processoRemocao. */
@@ -193,6 +204,12 @@ public class CredencialProcesso extends PersistentObjectAudit { @@ -193,6 +204,12 @@ public class CredencialProcesso extends PersistentObjectAudit {
193 */ 204 */
194 public Boolean getPermiteCredenciar() { 205 public Boolean getPermiteCredenciar() {
195 206
  207 + if (!UtilObjeto.isReferencia(permiteCredenciar)) {
  208 +
  209 + return Boolean.FALSE;
  210 +
  211 + }
  212 +
196 return permiteCredenciar; 213 return permiteCredenciar;
197 } 214 }
198 215
@@ -286,4 +303,44 @@ public class CredencialProcesso extends PersistentObjectAudit { @@ -286,4 +303,44 @@ public class CredencialProcesso extends PersistentObjectAudit {
286 this.historicoCredencialProcessos = historicoCredencialProcessos; 303 this.historicoCredencialProcessos = historicoCredencialProcessos;
287 } 304 }
288 305
  306 + /**
  307 + * Retorna o valor do atributo <code>idTask</code>
  308 + *
  309 + * @return <code>Long</code>
  310 + */
  311 + public Long getIdTask() {
  312 +
  313 + return idTask;
  314 + }
  315 +
  316 + /**
  317 + * Define o valor do atributo <code>idTask</code>.
  318 + *
  319 + * @param idTask
  320 + */
  321 + public void setIdTask(Long idTask) {
  322 +
  323 + this.idTask = idTask;
  324 + }
  325 +
  326 + /**
  327 + * Retorna o valor do atributo <code>permiteEdicao</code>
  328 + *
  329 + * @return <code>Boolean</code>
  330 + */
  331 + public Boolean getPermiteEdicao() {
  332 +
  333 + return permiteEdicao;
  334 + }
  335 +
  336 + /**
  337 + * Define o valor do atributo <code>permiteEdicao</code>.
  338 + *
  339 + * @param permiteEdicao
  340 + */
  341 + public void setPermiteEdicao(Boolean permiteEdicao) {
  342 +
  343 + this.permiteEdicao = permiteEdicao;
  344 + }
  345 +
289 } 346 }
cit-ecm-api/src/main/java/br/com/centralit/api/model/HistoricoCredencialProcesso.java
@@ -14,6 +14,7 @@ import javax.persistence.TemporalType; @@ -14,6 +14,7 @@ import javax.persistence.TemporalType;
14 import br.com.centralit.framework.json.JsonCalendarSimpleDateDeserializer; 14 import br.com.centralit.framework.json.JsonCalendarSimpleDateDeserializer;
15 import br.com.centralit.framework.json.JsonCalendarSimpleDateSerializer; 15 import br.com.centralit.framework.json.JsonCalendarSimpleDateSerializer;
16 import br.com.centralit.framework.json.Views; 16 import br.com.centralit.framework.json.Views;
  17 +import br.com.centralit.framework.model.Grupo;
17 import br.com.centralit.framework.model.Usuario; 18 import br.com.centralit.framework.model.Usuario;
18 import br.com.centralit.framework.model.arquitetura.PersistentObjectAudit; 19 import br.com.centralit.framework.model.arquitetura.PersistentObjectAudit;
19 import br.com.centralit.framework.util.UtilObjeto; 20 import br.com.centralit.framework.util.UtilObjeto;
@@ -73,6 +74,13 @@ public class HistoricoCredencialProcesso extends PersistentObjectAudit { @@ -73,6 +74,13 @@ public class HistoricoCredencialProcesso extends PersistentObjectAudit {
73 @JsonView({ Views.HistoricoCredencialProcesso.class }) 74 @JsonView({ Views.HistoricoCredencialProcesso.class })
74 private Calendar dataDescredenciado; 75 private Calendar dataDescredenciado;
75 76
  77 + /** Atributo dataDescredenciamento. */
  78 + @Temporal(TemporalType.TIMESTAMP)
  79 + @JsonSerialize(using = JsonCalendarSimpleDateSerializer.class)
  80 + @JsonDeserialize(using = JsonCalendarSimpleDateDeserializer.class)
  81 + @JsonView({ Views.HistoricoCredencialProcesso.class })
  82 + private Calendar dataDescredenciamento;
  83 +
76 /** Atributo credencialProcesso. */ 84 /** Atributo credencialProcesso. */
77 @ManyToOne(fetch = FetchType.LAZY) 85 @ManyToOne(fetch = FetchType.LAZY)
78 @JsonView({ Views.HistoricoCredencialProcesso.class }) 86 @JsonView({ Views.HistoricoCredencialProcesso.class })
@@ -83,6 +91,38 @@ public class HistoricoCredencialProcesso extends PersistentObjectAudit { @@ -83,6 +91,38 @@ public class HistoricoCredencialProcesso extends PersistentObjectAudit {
83 @JsonView({ Views.HistoricoCredencialProcesso.class }) 91 @JsonView({ Views.HistoricoCredencialProcesso.class })
84 private Usuario descredenciador; 92 private Usuario descredenciador;
85 93
  94 + @ManyToOne(fetch = FetchType.LAZY)
  95 + @JsonView({ Views.HistoricoCredencialProcesso.class })
  96 + private Grupo grupo;
  97 +
  98 + /** Atributo usuario. */
  99 + @ManyToOne(fetch = FetchType.LAZY)
  100 + @JsonView({ Views.HistoricoCredencialProcesso.class })
  101 + private Usuario usuario;
  102 +
  103 + /**
  104 + * Responsável pela criação de novas instâncias desta classe.
  105 + */
  106 + public HistoricoCredencialProcesso() {
  107 +
  108 + super();
  109 + }
  110 +
  111 + /**
  112 + * Responsável pela criação de novas instâncias desta classe.
  113 + *
  114 + * @param dataDescredenciado
  115 + * @param credencialProcesso
  116 + * @param descredenciador
  117 + */
  118 + public HistoricoCredencialProcesso( Calendar dataDescredenciado, CredencialProcesso credencialProcesso, Usuario descredenciador ) {
  119 +
  120 + this.dataDescredenciado = dataDescredenciado;
  121 + this.credencialProcesso = credencialProcesso;
  122 + this.descredenciador = descredenciador;
  123 +
  124 + }
  125 +
86 /** 126 /**
87 * Retorna o valor do atributo <code>id</code> 127 * Retorna o valor do atributo <code>id</code>
88 * 128 *
@@ -163,6 +203,66 @@ public class HistoricoCredencialProcesso extends PersistentObjectAudit { @@ -163,6 +203,66 @@ public class HistoricoCredencialProcesso extends PersistentObjectAudit {
163 this.descredenciador = descredenciador; 203 this.descredenciador = descredenciador;
164 } 204 }
165 205
  206 + /**
  207 + * Retorna o valor do atributo <code>dataDescredenciamento</code>
  208 + *
  209 + * @return <code>Calendar</code>
  210 + */
  211 + public Calendar getDataDescredenciamento() {
  212 +
  213 + return dataDescredenciamento;
  214 + }
  215 +
  216 + /**
  217 + * Define o valor do atributo <code>dataDescredenciamento</code>.
  218 + *
  219 + * @param dataDescredenciamento
  220 + */
  221 + public void setDataDescredenciamento(Calendar dataDescredenciamento) {
  222 +
  223 + this.dataDescredenciamento = dataDescredenciamento;
  224 + }
  225 +
  226 + /**
  227 + * Retorna o valor do atributo <code>grupo</code>
  228 + *
  229 + * @return <code>Grupo</code>
  230 + */
  231 + public Grupo getGrupo() {
  232 +
  233 + return grupo;
  234 + }
  235 +
  236 + /**
  237 + * Define o valor do atributo <code>grupo</code>.
  238 + *
  239 + * @param grupo
  240 + */
  241 + public void setGrupo(Grupo grupo) {
  242 +
  243 + this.grupo = grupo;
  244 + }
  245 +
  246 + /**
  247 + * Retorna o valor do atributo <code>usuario</code>
  248 + *
  249 + * @return <code>Usuario</code>
  250 + */
  251 + public Usuario getUsuario() {
  252 +
  253 + return usuario;
  254 + }
  255 +
  256 + /**
  257 + * Define o valor do atributo <code>usuario</code>.
  258 + *
  259 + * @param usuario
  260 + */
  261 + public void setUsuario(Usuario usuario) {
  262 +
  263 + this.usuario = usuario;
  264 + }
  265 +
166 @JsonView({ Views.HistoricoCredencialProcesso.class }) 266 @JsonView({ Views.HistoricoCredencialProcesso.class })
167 public String getUnidadeUsuarioCredenciado() { 267 public String getUnidadeUsuarioCredenciado() {
168 268
cit-ecm-api/src/main/java/br/com/centralit/api/model/Processo.java
@@ -136,13 +136,14 @@ public class Processo extends PersistentObjectUnidade { @@ -136,13 +136,14 @@ public class Processo extends PersistentObjectUnidade {
136 private String tipoAssunto; 136 private String tipoAssunto;
137 137
138 /** Atributo idProcessInstance. */ 138 /** Atributo idProcessInstance. */
  139 + @JsonView({ Views.ProcessoList.class })
139 private Long idProcessInstance; 140 private Long idProcessInstance;
140 141
141 /** Atributo nivelAcesso. */ 142 /** Atributo nivelAcesso. */
142 @ManyToOne(fetch = FetchType.LAZY) 143 @ManyToOne(fetch = FetchType.LAZY)
143 @JsonView({ Views.ProcessoList.class }) 144 @JsonView({ Views.ProcessoList.class })
144 private NivelAcessoTipoProcesso nivelAcesso; 145 private NivelAcessoTipoProcesso nivelAcesso;
145 - 146 +
146 @ManyToOne(fetch = FetchType.LAZY) 147 @ManyToOne(fetch = FetchType.LAZY)
147 @JsonView({ Views.ProcessoList.class }) 148 @JsonView({ Views.ProcessoList.class })
148 private NivelAcessoTipoProcesso nivelAcessoOriginal; 149 private NivelAcessoTipoProcesso nivelAcessoOriginal;
cit-ecm-api/src/main/java/br/com/centralit/api/model/TipoProcesso.java
@@ -70,9 +70,6 @@ public class TipoProcesso extends PersistentObjectUnidade { @@ -70,9 +70,6 @@ public class TipoProcesso extends PersistentObjectUnidade {
70 @JsonView({ ViewsEcm.TipoProcessoList.class, Views.ProcessoList.class, Views.ProcessoRelacionadoList.class }) 70 @JsonView({ ViewsEcm.TipoProcessoList.class, Views.ProcessoList.class, Views.ProcessoRelacionadoList.class })
71 private String nome; 71 private String nome;
72 72
73 - @Field  
74 - private String name;  
75 -  
76 /** Atributo nome. */ 73 /** Atributo nome. */
77 @JsonView({ ViewsEcm.TipoProcessoList.class, Views.ProcessoEdit.class }) 74 @JsonView({ ViewsEcm.TipoProcessoList.class, Views.ProcessoEdit.class })
78 private String processoNegocio; 75 private String processoNegocio;
@@ -207,24 +204,4 @@ public class TipoProcesso extends PersistentObjectUnidade { @@ -207,24 +204,4 @@ public class TipoProcesso extends PersistentObjectUnidade {
207 this.processoNegocio = processoNegocio; 204 this.processoNegocio = processoNegocio;
208 } 205 }
209 206
210 - /**  
211 - * Retorna o valor do atributo <code>name</code>  
212 - *  
213 - * @return <code>String</code>  
214 - */  
215 - public String getName() {  
216 -  
217 - return name;  
218 - }  
219 -  
220 - /**  
221 - * Define o valor do atributo <code>name</code>.  
222 - *  
223 - * @param name  
224 - */  
225 - public void setName(String name) {  
226 -  
227 - this.name = name;  
228 - }  
229 -  
230 } 207 }
cit-ecm-api/src/main/java/br/com/centralit/api/model/UnidadeProcesso.java
@@ -9,6 +9,7 @@ import javax.persistence.ManyToOne; @@ -9,6 +9,7 @@ import javax.persistence.ManyToOne;
9 9
10 import br.com.centralit.framework.json.Views; 10 import br.com.centralit.framework.json.Views;
11 import br.com.centralit.framework.model.Unidade; 11 import br.com.centralit.framework.model.Unidade;
  12 +import br.com.centralit.framework.model.Usuario;
12 import br.com.centralit.framework.model.arquitetura.PersistentObjectAudit; 13 import br.com.centralit.framework.model.arquitetura.PersistentObjectAudit;
13 14
14 import com.fasterxml.jackson.annotation.JsonView; 15 import com.fasterxml.jackson.annotation.JsonView;
@@ -57,6 +58,14 @@ public class UnidadeProcesso extends PersistentObjectAudit { @@ -57,6 +58,14 @@ public class UnidadeProcesso extends PersistentObjectAudit {
57 @JsonView({ Views.GenericView.class }) 58 @JsonView({ Views.GenericView.class })
58 private Long id; 59 private Long id;
59 60
  61 + /** Atributo eviarEmail. */
  62 + @JsonView({ Views.EnviarProcessoView.class })
  63 + private Boolean enviarEmail;
  64 +
  65 + /** Atributo concluido. */
  66 + @JsonView({ Views.EnviarProcessoView.class })
  67 + private Boolean concluido;
  68 +
60 /** Atributo processo. */ 69 /** Atributo processo. */
61 @ManyToOne(fetch = FetchType.LAZY) 70 @ManyToOne(fetch = FetchType.LAZY)
62 @JsonView({ Views.EnviarProcessoView.class }) 71 @JsonView({ Views.EnviarProcessoView.class })
@@ -67,12 +76,10 @@ public class UnidadeProcesso extends PersistentObjectAudit { @@ -67,12 +76,10 @@ public class UnidadeProcesso extends PersistentObjectAudit {
67 @JsonView({ Views.EnviarProcessoView.class }) 76 @JsonView({ Views.EnviarProcessoView.class })
68 private Unidade unidade; 77 private Unidade unidade;
69 78
70 - /** Atributo eviarEmail. */  
71 - @JsonView({ Views.EnviarProcessoView.class })  
72 - private Boolean enviarEmail;  
73 - 79 + /** Atributo usuarioResponsavel. */
  80 + @ManyToOne(fetch = FetchType.LAZY)
74 @JsonView({ Views.EnviarProcessoView.class }) 81 @JsonView({ Views.EnviarProcessoView.class })
75 - private Boolean concluido; 82 + private Usuario usuarioResponsavel;
76 83
77 /** 84 /**
78 * Retorna o valor do atributo <code>id</code> 85 * Retorna o valor do atributo <code>id</code>
cit-ecm-api/src/main/java/br/com/centralit/api/security/CustomExpressionHandler.java 0 → 100644
@@ -0,0 +1,30 @@ @@ -0,0 +1,30 @@
  1 +package br.com.centralit.api.security;
  2 +
  3 +import org.springframework.beans.factory.annotation.Autowired;
  4 +import org.springframework.security.access.expression.SecurityExpressionOperations;
  5 +import org.springframework.security.authentication.AuthenticationTrustResolverImpl;
  6 +import org.springframework.security.core.Authentication;
  7 +import org.springframework.security.web.FilterInvocation;
  8 +import org.springframework.security.web.access.expression.DefaultWebSecurityExpressionHandler;
  9 +import org.springframework.security.web.access.expression.WebSecurityExpressionRoot;
  10 +
  11 +import br.com.centralit.api.service.CredencialProcessoService;
  12 +
  13 +/**
  14 + * @author Rob Winch
  15 + */
  16 +public class CustomExpressionHandler extends DefaultWebSecurityExpressionHandler {
  17 +
  18 + @Autowired
  19 + private CredencialProcessoService credencialProcessoService;
  20 +
  21 + @Override
  22 + protected SecurityExpressionOperations createSecurityExpressionRoot(Authentication authentication, FilterInvocation fi) {
  23 +
  24 + WebSecurityExpressionRoot root = new CustomWebSecurityExpresssionRoot(authentication, fi, credencialProcessoService);
  25 + root.setPermissionEvaluator(this.getPermissionEvaluator());
  26 + root.setTrustResolver(new AuthenticationTrustResolverImpl());
  27 + root.setRoleHierarchy(this.getRoleHierarchy());
  28 + return root;
  29 + }
  30 +}
cit-ecm-api/src/main/java/br/com/centralit/api/security/CustomWebSecurityExpresssionRoot.java 0 → 100644
@@ -0,0 +1,104 @@ @@ -0,0 +1,104 @@
  1 +package br.com.centralit.api.security;
  2 +
  3 +import org.springframework.security.core.Authentication;
  4 +import org.springframework.security.web.FilterInvocation;
  5 +import org.springframework.security.web.access.expression.WebSecurityExpressionRoot;
  6 +
  7 +import br.com.centralit.api.service.CredencialProcessoService;
  8 +
  9 +/**
  10 + * <p>
  11 + * <img src="http://centralit.com.br/images/logo_central.png">
  12 + * </p>
  13 + *
  14 + * <p>
  15 + * <b>Company: </b> Central IT - Governança Corporativa -
  16 + * </p>
  17 + *
  18 + * <p>
  19 + * <b>Title: </b>
  20 + * </p>
  21 + *
  22 + * <p>
  23 + * <b>Description: </b>
  24 + * </p>
  25 + *
  26 + * <p>
  27 + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a>
  28 + * </p>
  29 + *
  30 + * <p>
  31 + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a>
  32 + * </p>
  33 + *
  34 + * @since 30/03/2016 - 10:43:40
  35 + *
  36 + * @version 1.0.0
  37 + *
  38 + * @author rogerio.costa
  39 + *
  40 + */
  41 +public class CustomWebSecurityExpresssionRoot extends WebSecurityExpressionRoot {
  42 +
  43 + /** Atributo credencialProcessoService. */
  44 + private CredencialProcessoService credencialProcessoService;
  45 +
  46 + /**
  47 + * Responsável pela criação de novas instâncias desta classe.
  48 + *
  49 + * @param authentication
  50 + * @param filterInvocation
  51 + * @param credencialProcessoService
  52 + */
  53 + public CustomWebSecurityExpresssionRoot( Authentication authentication, FilterInvocation filterInvocation, CredencialProcessoService credencialProcessoService ) {
  54 +
  55 + super(authentication, filterInvocation);
  56 +
  57 + this.credencialProcessoService = credencialProcessoService;
  58 + }
  59 +
  60 + /**
  61 + * <p>
  62 + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a>
  63 + * </p>
  64 + *
  65 + * <p>
  66 + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a>
  67 + * </p>
  68 + *
  69 + * Método responsável por verificar se o usuario tem permissão para credenciar
  70 + *
  71 + * @author rogerio.costa
  72 + *
  73 + * @return boolean
  74 + */
  75 + public boolean permiteCredenciar() {
  76 +
  77 + Long idProcesso = (Long) this.request.getSession().getAttribute("idProcesso");
  78 +
  79 + return this.credencialProcessoService.permiteCredenciar(idProcesso);
  80 + }
  81 +
  82 + /**
  83 + * <p>
  84 + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a>
  85 + * </p>
  86 + *
  87 + * <p>
  88 + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a>
  89 + * </p>
  90 + *
  91 + * Método responsável por verificar se o usuario logado não é o criador do processo, e se contem uma credencial para o mesmo
  92 + *
  93 + * @author rogerio.costa
  94 + *
  95 + * @return boolean
  96 + */
  97 + public boolean permiteRenunciar() {
  98 +
  99 + Long idProcesso = (Long) this.request.getSession().getAttribute("idProcesso");
  100 +
  101 + return this.credencialProcessoService.permiteRenunciar(idProcesso);
  102 + }
  103 +
  104 +}
cit-ecm-api/src/main/java/br/com/centralit/api/service/CredencialProcessoService.java
@@ -4,7 +4,6 @@ import java.util.Collection; @@ -4,7 +4,6 @@ import java.util.Collection;
4 4
5 import br.com.centralit.api.model.CredencialProcesso; 5 import br.com.centralit.api.model.CredencialProcesso;
6 import br.com.centralit.api.model.Processo; 6 import br.com.centralit.api.model.Processo;
7 -import br.com.centralit.api.viewHelper.CredencialUsuarioVH;  
8 import br.com.centralit.api.viewHelper.GrupoUsuarioVH; 7 import br.com.centralit.api.viewHelper.GrupoUsuarioVH;
9 import br.com.centralit.api.viewHelper.HerancaSistemaVH; 8 import br.com.centralit.api.viewHelper.HerancaSistemaVH;
10 import br.com.centralit.framework.service.arquitetura.GenericService; 9 import br.com.centralit.framework.service.arquitetura.GenericService;
@@ -123,14 +122,82 @@ public interface CredencialProcessoService extends GenericService&lt;CredencialProc @@ -123,14 +122,82 @@ public interface CredencialProcessoService extends GenericService&lt;CredencialProc
123 * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> 122 * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a>
124 * </p> 123 * </p>
125 * 124 *
126 - * Método responsável por montar um objeto com a credencial do usuario com base nas funcionalidades do sistema 125 + * Método responsável por verificar se o usuario tem permissão para credenciar
  126 + *
  127 + * @author rogerio.costa
  128 + *
  129 + */
  130 + Boolean permiteCredenciar(Long idProcesso);
  131 +
  132 + /**
  133 + * <p>
  134 + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a>
  135 + * </p>
  136 + *
  137 + * <p>
  138 + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a>
  139 + * </p>
  140 + *
  141 + * Método responsável por verificar se o usuario logado não é o criador do processo, e se contem uma credencial para o mesmo
  142 + *
  143 + * @author rogerio.costa
  144 + *
  145 + * @param idProcesso
  146 + * @return boolean
  147 + */
  148 + Boolean permiteRenunciar(Long idProcesso);
  149 +
  150 + /**
  151 + * <p>
  152 + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a>
  153 + * </p>
  154 + *
  155 + * <p>
  156 + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a>
  157 + * </p>
  158 + *
  159 + * Método responsável por renunciar credencial.
127 * 160 *
128 * @author rogerio.costa 161 * @author rogerio.costa
129 * 162 *
130 * @param idProcesso 163 * @param idProcesso
  164 + */
  165 + Boolean renunciar(Long idProcesso);
  166 +
  167 + /**
  168 + * <p>
  169 + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a>
  170 + * </p>
131 * 171 *
132 - * @return CredencialUsuarioVH 172 + * <p>
  173 + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a>
  174 + * </p>
  175 + *
  176 + * Método responsável por listar através do id do processo
  177 + *
  178 + * @author rogerio.costa
  179 + *
  180 + * @param idProcesso
  181 + * @return Collection<CredencialProcesso>
  182 + */
  183 + Collection<CredencialProcesso> findByIdProcesso(Long id);
  184 +
  185 + /**
  186 + * <p>
  187 + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a>
  188 + * </p>
  189 + *
  190 + * <p>
  191 + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a>
  192 + * </p>
  193 + *
  194 + * Método responsável por verificar se o usuarioLogado tem permissão no processo
  195 + *
  196 + * @author rogerio.costa
  197 + *
  198 + * @param idProcesso
  199 + * @return boolean
133 */ 200 */
134 - CredencialUsuarioVH obterCredencialUsuarioLogado(Long idProcesso); 201 + boolean contemPermissaoProcesso(Long idProcesso);
135 202
136 } 203 }
cit-ecm-api/src/main/java/br/com/centralit/api/service/HistoricoCredencialProcessoService.java
@@ -2,6 +2,7 @@ package br.com.centralit.api.service; @@ -2,6 +2,7 @@ package br.com.centralit.api.service;
2 2
3 import java.util.Collection; 3 import java.util.Collection;
4 4
  5 +import br.com.centralit.api.model.CredencialProcesso;
5 import br.com.centralit.api.model.HistoricoCredencialProcesso; 6 import br.com.centralit.api.model.HistoricoCredencialProcesso;
6 import br.com.centralit.framework.service.arquitetura.GenericService; 7 import br.com.centralit.framework.service.arquitetura.GenericService;
7 8
@@ -58,4 +59,23 @@ public interface HistoricoCredencialProcessoService extends GenericService&lt;Histo @@ -58,4 +59,23 @@ public interface HistoricoCredencialProcessoService extends GenericService&lt;Histo
58 */ 59 */
59 Collection<HistoricoCredencialProcesso> findByIdProcessoAndIdProcessoRemocao(Long idProcesso); 60 Collection<HistoricoCredencialProcesso> findByIdProcessoAndIdProcessoRemocao(Long idProcesso);
60 61
  62 + /**
  63 + * <p>
  64 + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a>
  65 + * </p>
  66 + *
  67 + * <p>
  68 + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a>
  69 + * </p>
  70 + *
  71 + * Método responsável por listar através da credencial e credenciado
  72 + *
  73 + * @author rogerio.costa
  74 + *
  75 + * @param credencialProcesso
  76 + *
  77 + * @return HistoricoCredencialProcesso
  78 + */
  79 + HistoricoCredencialProcesso findByCredencialAndCredenciado(CredencialProcesso credencialProcesso);
  80 +
61 } 81 }
cit-ecm-api/src/main/java/br/com/centralit/api/service/ProcessoService.java
@@ -4,6 +4,26 @@ import br.com.centralit.api.model.PlanoClassificacao; @@ -4,6 +4,26 @@ import br.com.centralit.api.model.PlanoClassificacao;
4 import br.com.centralit.api.model.Processo; 4 import br.com.centralit.api.model.Processo;
5 import br.com.centralit.framework.service.arquitetura.GenericService; 5 import br.com.centralit.framework.service.arquitetura.GenericService;
6 6
  7 +/**
  8 + * <p><img src="http://centralit.com.br/images/logo_central.png"></p>
  9 + *
  10 + * <p><b>Company: </b> Central IT - Governança Corporativa - </p>
  11 + *
  12 + * <p><b>Title: </b></p>
  13 + *
  14 + * <p><b>Description: </b></p>
  15 + *
  16 + * <p><b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a></p>
  17 + *
  18 + * <p><b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a></p>
  19 + *
  20 + * @since 28/03/2016 - 09:15:34
  21 + *
  22 + * @version 1.0.0
  23 + *
  24 + * @author maycon.silva
  25 + *
  26 + */
7 public interface ProcessoService extends GenericService<Processo, Long> { 27 public interface ProcessoService extends GenericService<Processo, Long> {
8 28
9 /** 29 /**
@@ -94,6 +114,35 @@ public interface ProcessoService extends GenericService&lt;Processo, Long&gt; { @@ -94,6 +114,35 @@ public interface ProcessoService extends GenericService&lt;Processo, Long&gt; {
94 */ 114 */
95 Processo atualizarSigiloProcesso(Processo entity); 115 Processo atualizarSigiloProcesso(Processo entity);
96 116
  117 +
  118 + /**
  119 + * <p><b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a></p>
  120 + *
  121 + * <p><b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a></p>
  122 + *
  123 + * Método responsável por devolver o processoSigad passando como parametro o id da instancia do BPE
  124 + *
  125 + * @author maycon.silva
  126 + *
  127 + * @param idProcessInstance
  128 + * @return
  129 + */
  130 + Processo getProcessoByIdProcessInstance(Long idProcessInstance);
  131 +
  132 + /**
  133 + * <p><b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a></p>
  134 + *
  135 + * <p><b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a></p>
  136 + *
  137 + * Método responsável por
  138 + *
  139 + * @author maycon.silva
  140 + *
  141 + * @param nup
  142 + * @return
  143 + */
  144 + Processo getProcessoByProtocolo(String nup);
  145 +
97 146
98 147
99 148
cit-ecm-api/src/main/java/br/com/centralit/api/service/impl/AnexarProcessoServiceImpl.java
@@ -16,6 +16,9 @@ import br.com.centralit.api.service.AnexoGedService; @@ -16,6 +16,9 @@ import br.com.centralit.api.service.AnexoGedService;
16 import br.com.centralit.api.service.DocumentoGedService; 16 import br.com.centralit.api.service.DocumentoGedService;
17 import br.com.centralit.api.service.ProcessoService; 17 import br.com.centralit.api.service.ProcessoService;
18 import br.com.centralit.api.viewHelper.AnexarProcessoVH; 18 import br.com.centralit.api.viewHelper.AnexarProcessoVH;
  19 +import br.com.centralit.framework.esi.enumerated.EventTargetEnum;
  20 +import br.com.centralit.framework.esi.environment.EnvironmentVariable;
  21 +import br.com.centralit.framework.esi.environment.SignalEventInput;
19 import br.com.centralit.framework.exception.BusinessException; 22 import br.com.centralit.framework.exception.BusinessException;
20 import br.com.centralit.framework.exception.CodigoErro; 23 import br.com.centralit.framework.exception.CodigoErro;
21 import br.com.centralit.framework.service.arquitetura.GedFileService; 24 import br.com.centralit.framework.service.arquitetura.GedFileService;
@@ -129,23 +132,20 @@ public class AnexarProcessoServiceImpl extends GenericServiceImpl&lt;AnexoProcesso, @@ -129,23 +132,20 @@ public class AnexarProcessoServiceImpl extends GenericServiceImpl&lt;AnexoProcesso,
129 listProcesso.add(processoFilho); 132 listProcesso.add(processoFilho);
130 } 133 }
131 134
132 - if (listProcesso.isEmpty()) {  
133 - // Vincula o processo filho ao pai  
134 - this.vincularProcesso(processoPai, processoFilho); 135 + if (!listProcesso.isEmpty()) {
  136 + if (!UtilColecao.isVazio(processoFilho.getDocumentos())) {
  137 + // Vincula o processo filho ao pai
  138 + this.vincularProcesso(processoPai, processoFilho);
135 139
136 - // Realiza o vinculo inverso, o pai vira filho e o filho vira pai.  
137 - this.vincularProcesso(processoFilho, processoPai); 140 + // Realiza o vinculo inverso, o pai vira filho e o filho vira pai.
  141 + this.vincularProcesso(processoFilho, processoPai);
138 142
139 - if (!UtilColecao.isVazio(processoFilho.getDocumentos())) {  
140 documentoGedService.anexarDocumento(processoFilho, anexarProcessoVH); 143 documentoGedService.anexarDocumento(processoFilho, anexarProcessoVH);
141 -// SignalEventInput input = new SignalEventInput(EventTargetEnum.PROCESS_INSTANCE, "FINALIZAR_PROCESSO_SIGAD", "PROGRESSAOCLASSE", null, false);  
142 -//  
143 -// input.setProcessInstanceId(Long.valueOf("61857"));  
144 -// this.signalEvent(input);  
145 - 144 +
146 } 145 }
147 } 146 }
148 147
  148 + this.finalizeProcesso("FINALIZAR_PROCESSO_SIGAD", false, processoFilho.getIdProcessInstance());
149 this.processoService.atualizarTemporalidadeProcessoAnexado(processoPai, processoFilho); 149 this.processoService.atualizarTemporalidadeProcessoAnexado(processoPai, processoFilho);
150 150
151 } 151 }
@@ -157,6 +157,33 @@ public class AnexarProcessoServiceImpl extends GenericServiceImpl&lt;AnexoProcesso, @@ -157,6 +157,33 @@ public class AnexarProcessoServiceImpl extends GenericServiceImpl&lt;AnexoProcesso,
157 } 157 }
158 return anexarProcessoVH; 158 return anexarProcessoVH;
159 } 159 }
  160 +
  161 +
  162 + /**
  163 + *
  164 + * <p><b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a></p>
  165 + *
  166 + * <p><b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a></p>
  167 + *
  168 + * Método responsável por finalizar o processo
  169 + *
  170 + * @author andre.silva
  171 + *
  172 + * @param eventTarget
  173 + * @param eventName
  174 + * @param flowName
  175 + * @param inputVariables
  176 + * @param synchronous
  177 + * @param processId
  178 + */
  179 + private void finalizeProcesso(String eventName, boolean synchronous, Long processId){
  180 + this.startNodeWithSignalEvent(eventName, processId, false, null);
  181 +// SignalEventInput input = new SignalEventInput(eventTarget, eventName, flowName, null, false);
  182 +// input.setProcessInstanceId(processId);
  183 +// this.signalEvent(input);
  184 + }
  185 +
  186 +
160 187
161 /** 188 /**
162 * <p> 189 * <p>
cit-ecm-api/src/main/java/br/com/centralit/api/service/impl/AnexoGedServiceImpl.java
@@ -107,7 +107,8 @@ public class AnexoGedServiceImpl extends GenericServiceImpl&lt;AnexoGed, Long&gt; impl @@ -107,7 +107,8 @@ public class AnexoGedServiceImpl extends GenericServiceImpl&lt;AnexoGed, Long&gt; impl
107 107
108 documentoGed.setConteudo(this.gedFileService.doOcr(anexo)); 108 documentoGed.setConteudo(this.gedFileService.doOcr(anexo));
109 109
110 -// solrService.addDocumento(documentoGed); 110 +
  111 + this.solrService.addDocumento(documentoGed);
111 112
112 anexo.setDocumentoGed(documentoGed); 113 anexo.setDocumentoGed(documentoGed);
113 114
cit-ecm-api/src/main/java/br/com/centralit/api/service/impl/CredencialProcessoServiceImpl.java
1 package br.com.centralit.api.service.impl; 1 package br.com.centralit.api.service.impl;
2 2
3 -import java.util.ArrayList;  
4 import java.util.Collection; 3 import java.util.Collection;
5 -import java.util.HashMap;  
6 import java.util.LinkedList; 4 import java.util.LinkedList;
7 import java.util.List; 5 import java.util.List;
8 -import java.util.Map;  
9 6
10 -import org.json.JSONObject;  
11 import org.springframework.beans.factory.annotation.Autowired; 7 import org.springframework.beans.factory.annotation.Autowired;
12 import org.springframework.stereotype.Service; 8 import org.springframework.stereotype.Service;
13 9
@@ -23,11 +19,8 @@ import br.com.centralit.api.service.HistoricoCredencialProcessoService; @@ -23,11 +19,8 @@ import br.com.centralit.api.service.HistoricoCredencialProcessoService;
23 import br.com.centralit.api.service.ProcessoService; 19 import br.com.centralit.api.service.ProcessoService;
24 import br.com.centralit.api.service.SigiloService; 20 import br.com.centralit.api.service.SigiloService;
25 import br.com.centralit.api.service.UsuarioService; 21 import br.com.centralit.api.service.UsuarioService;
26 -import br.com.centralit.api.viewHelper.CredencialUsuarioVH;  
27 import br.com.centralit.api.viewHelper.GrupoUsuarioVH; 22 import br.com.centralit.api.viewHelper.GrupoUsuarioVH;
28 import br.com.centralit.api.viewHelper.HerancaSistemaVH; 23 import br.com.centralit.api.viewHelper.HerancaSistemaVH;
29 -import br.com.centralit.framework.esi.enumerated.VariableTypeEnum;  
30 -import br.com.centralit.framework.esi.environment.EnvironmentVariable;  
31 import br.com.centralit.framework.exception.BusinessException; 24 import br.com.centralit.framework.exception.BusinessException;
32 import br.com.centralit.framework.exception.CodigoErro; 25 import br.com.centralit.framework.exception.CodigoErro;
33 import br.com.centralit.framework.model.Grupo; 26 import br.com.centralit.framework.model.Grupo;
@@ -95,8 +88,12 @@ public class CredencialProcessoServiceImpl extends GenericServiceImpl&lt;Credencial @@ -95,8 +88,12 @@ public class CredencialProcessoServiceImpl extends GenericServiceImpl&lt;Credencial
95 @Autowired 88 @Autowired
96 private SigiloService sigiloService; 89 private SigiloService sigiloService;
97 90
98 - /** Atributo historicos. */  
99 - private Collection<HistoricoCredencialProcesso> historicos; 91 + /**
  92 + * Responsável pela criação de novas instâncias desta classe.
  93 + *
  94 + * @param credencialProcessoDao
  95 + */
  96 + private static final String SEM_PERMISSAO_OPERACAO = "ECM.VALIDACAO.PERMISSAO_OPERACAO";
100 97
101 /** 98 /**
102 * Responsável pela criação de novas instâncias desta classe. 99 * Responsável pela criação de novas instâncias desta classe.
@@ -133,7 +130,9 @@ public class CredencialProcessoServiceImpl extends GenericServiceImpl&lt;Credencial @@ -133,7 +130,9 @@ public class CredencialProcessoServiceImpl extends GenericServiceImpl&lt;Credencial
133 130
134 this.resolveTransiente(credenciais); 131 this.resolveTransiente(credenciais);
135 132
136 - return super.saveList((List<CredencialProcesso>) credenciais); 133 + credenciais = super.saveList((List<CredencialProcesso>) credenciais);
  134 +
  135 + return this.montarPermissaoEdicao(credenciais);
137 136
138 } 137 }
139 138
@@ -176,52 +175,9 @@ public class CredencialProcessoServiceImpl extends GenericServiceImpl&lt;Credencial @@ -176,52 +175,9 @@ public class CredencialProcessoServiceImpl extends GenericServiceImpl&lt;Credencial
176 } 175 }
177 // Gera a credencial do usuario que crio o processo 176 // Gera a credencial do usuario que crio o processo
178 super.save(new CredencialProcesso(processo, getUsuario())); 177 super.save(new CredencialProcesso(processo, getUsuario()));
179 -  
180 -  
181 - }  
182 -  
183 - }  
184 -  
185 - /**  
186 - * <p>  
187 - * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a>  
188 - * </p>  
189 - *  
190 - * <p>  
191 - * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a>  
192 - * </p>  
193 - *  
194 - * Método responsável por startar o BusinessProcess do tipo sigiloso  
195 - *  
196 - * @author rogerio.costa  
197 - *  
198 - * @param processo  
199 - */  
200 - private void startBusinessProcessSigiloso(Processo processo, Grupo grupoPadrao) {  
201 -  
202 - final List<EnvironmentVariable> variaveis = new ArrayList<EnvironmentVariable>();  
203 -  
204 - final Map<String, Object> mapProcesso = new HashMap<String, Object>();  
205 -  
206 - mapProcesso.put("nivelAcesso", processo.getNivelAcesso().getNivelAcesso().getDescricao());  
207 - mapProcesso.put("nup", processo.getNup());  
208 - mapProcesso.put("assunto", processo.getAssunto().getCodigo() + '/' + processo.getAssunto().getNome());  
209 - final JSONObject processoJSON = new JSONObject(mapProcesso);  
210 -  
211 - variaveis.add(new EnvironmentVariable("idProcesso", VariableTypeEnum.LONG, processo.getId(), false));  
212 - variaveis.add(new EnvironmentVariable("solicitante", VariableTypeEnum.TEXT, processo.getAutor().getUsername(), false));  
213 - variaveis.add(new EnvironmentVariable("nup", VariableTypeEnum.JSON, processo.getNup(), false));  
214 178
215 - variaveis.add(new EnvironmentVariable("grupoPadrao", VariableTypeEnum.TEXT, grupoPadrao.getSigla(), false));  
216 -  
217 - variaveis.add(new EnvironmentVariable("processoSIGAD", VariableTypeEnum.JSON, processoJSON, false));  
218 -  
219 - if (processo.getTipoProcesso().getProcessoNegocio() == null) {  
220 - // O processo deverá estar vinculado a um fluxo no BPE/ESI  
221 - throw new BusinessException("ECM.VALIDACAO.ERRO_VINCULO_FLUXO_BPE_ESI", CodigoErro.REGRA_NEGOCIO.getValue());  
222 } 179 }
223 180
224 - this.startBusinessProcess(processo.getTipoProcesso().getProcessoNegocio(), variaveis);  
225 } 181 }
226 182
227 /** 183 /**
@@ -268,7 +224,8 @@ public class CredencialProcessoServiceImpl extends GenericServiceImpl&lt;Credencial @@ -268,7 +224,8 @@ public class CredencialProcessoServiceImpl extends GenericServiceImpl&lt;Credencial
268 */ 224 */
269 private void resolveTransiente(Collection<CredencialProcesso> credenciais) { 225 private void resolveTransiente(Collection<CredencialProcesso> credenciais) {
270 226
271 - this.historicos = new LinkedList<HistoricoCredencialProcesso>(); 227 + List<String> grupos = new LinkedList<String>();
  228 + List<String> usuarios = new LinkedList<String>();
272 229
273 for (CredencialProcesso credencialProcesso : credenciais) { 230 for (CredencialProcesso credencialProcesso : credenciais) {
274 231
@@ -277,9 +234,11 @@ public class CredencialProcessoServiceImpl extends GenericServiceImpl&lt;Credencial @@ -277,9 +234,11 @@ public class CredencialProcessoServiceImpl extends GenericServiceImpl&lt;Credencial
277 if (UtilObjeto.isReferencia(credencialProcesso.getGrupo())) { 234 if (UtilObjeto.isReferencia(credencialProcesso.getGrupo())) {
278 235
279 credencialProcesso.setGrupo(this.grupoService.getReference(credencialProcesso.getGrupo().getId())); 236 credencialProcesso.setGrupo(this.grupoService.getReference(credencialProcesso.getGrupo().getId()));
  237 + grupos.add(credencialProcesso.getGrupo().getSigla());
280 } else { 238 } else {
281 239
282 credencialProcesso.setUsuario(this.usuarioService.find(credencialProcesso.getUsuario().getId())); 240 credencialProcesso.setUsuario(this.usuarioService.find(credencialProcesso.getUsuario().getId()));
  241 + usuarios.add(credencialProcesso.getUsuario().getUsername());
283 242
284 } 243 }
285 // Verifica se a credencial é nova, caso seja cria um histórico 244 // Verifica se a credencial é nova, caso seja cria um histórico
@@ -287,8 +246,39 @@ public class CredencialProcessoServiceImpl extends GenericServiceImpl&lt;Credencial @@ -287,8 +246,39 @@ public class CredencialProcessoServiceImpl extends GenericServiceImpl&lt;Credencial
287 246
288 credencialProcesso.setHistoricoCredencialProcessos(new LinkedList<HistoricoCredencialProcesso>()); 247 credencialProcesso.setHistoricoCredencialProcessos(new LinkedList<HistoricoCredencialProcesso>());
289 credencialProcesso.getHistoricoCredencialProcessos().add(this.addHistorico(credencialProcesso)); 248 credencialProcesso.getHistoricoCredencialProcessos().add(this.addHistorico(credencialProcesso));
  249 + // Delega o processo para os grupos e usuario credenciados
  250 + this.delegateUserTask(credencialProcesso.getIdTask(), grupos, usuarios);
290 } 251 }
291 } 252 }
  253 +
  254 + }
  255 +
  256 + /**
  257 + * <p>
  258 + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a>
  259 + * </p>
  260 + *
  261 + * <p>
  262 + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a>
  263 + * </p>
  264 + *
  265 + * Método responsável por verificar se o usuario logado não é o criador do processo, e se contem uma credencial para o mesmo
  266 + *
  267 + * @author rogerio.costa
  268 + *
  269 + * @param idProcesso
  270 + * @return boolean
  271 + */
  272 + public Boolean permiteRenunciar(Long idProcesso) {
  273 +
  274 + Processo processo = this.processoService.getReference(idProcesso);
  275 +
  276 + if (!this.getUsuario().getId().equals(processo.getAutor().getId())) {
  277 +
  278 + return this.credencialProcessoDao.contemCredencial(this.getUsuario().getId(), idProcesso);
  279 + }
  280 +
  281 + return Boolean.FALSE;
292 } 282 }
293 283
294 /** 284 /**
@@ -313,6 +303,13 @@ public class CredencialProcessoServiceImpl extends GenericServiceImpl&lt;Credencial @@ -313,6 +303,13 @@ public class CredencialProcessoServiceImpl extends GenericServiceImpl&lt;Credencial
313 303
314 historicoCredencialProcesso.setCredencialProcesso(credencialProcesso); 304 historicoCredencialProcesso.setCredencialProcesso(credencialProcesso);
315 305
  306 + if (UtilObjeto.isReferencia(credencialProcesso.getGrupo())) {
  307 +
  308 + historicoCredencialProcesso.setGrupo(credencialProcesso.getGrupo());
  309 + } else {
  310 + historicoCredencialProcesso.setUsuario(credencialProcesso.getUsuario());
  311 + }
  312 +
316 return historicoCredencialProcesso; 313 return historicoCredencialProcesso;
317 } 314 }
318 315
@@ -321,10 +318,9 @@ public class CredencialProcessoServiceImpl extends GenericServiceImpl&lt;Credencial @@ -321,10 +318,9 @@ public class CredencialProcessoServiceImpl extends GenericServiceImpl&lt;Credencial
321 318
322 CredencialProcesso credencialProcesso = this.getReference(id); 319 CredencialProcesso credencialProcesso = this.getReference(id);
323 320
324 - credencialProcesso.setProcessoRemocao(credencialProcesso.getProcesso());  
325 - credencialProcesso.setProcesso(null); 321 + this.validarPermissaoRemover(credencialProcesso);
326 322
327 - this.saveHistoricoDescredenciado(credencialProcesso); 323 + this.executarAcoesRemocao(credencialProcesso);
328 324
329 return super.removeById(id); 325 return super.removeById(id);
330 } 326 }
@@ -338,6 +334,87 @@ public class CredencialProcessoServiceImpl extends GenericServiceImpl&lt;Credencial @@ -338,6 +334,87 @@ public class CredencialProcessoServiceImpl extends GenericServiceImpl&lt;Credencial
338 * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> 334 * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a>
339 * </p> 335 * </p>
340 * 336 *
  337 + * Método responsável por validar a permissão
  338 + *
  339 + * @author rogerio.costa
  340 + *
  341 + * @param credencialProcesso
  342 + */
  343 + private void validarPermissaoRemover(CredencialProcesso credencialProcesso) {
  344 +
  345 + if (!credencialProcesso.getAutor().getId().equals(this.getUsuario().getId()) && !this.contemPermissaoHerdada(credencialProcesso.getProcesso().getSigilo())) {
  346 +
  347 + throw new BusinessException(SEM_PERMISSAO_OPERACAO, CodigoErro.REGRA_NEGOCIO.getValue());
  348 +
  349 + }
  350 + }
  351 +
  352 + /**
  353 + * <p>
  354 + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a>
  355 + * </p>
  356 + *
  357 + * <p>
  358 + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a>
  359 + * </p>
  360 + *
  361 + * Método responsável por executar ações da remoção
  362 + *
  363 + * @author rogerio.costa
  364 + *
  365 + * @param credencialProcesso
  366 + */
  367 + private void executarAcoesRemocao(CredencialProcesso credencialProcesso) {
  368 +
  369 + this.removeDelegacao(credencialProcesso);
  370 + Processo processo = this.processoService.getReference(credencialProcesso.getProcesso().getId());
  371 + credencialProcesso.setProcessoRemocao(processo);
  372 + credencialProcesso.setProcesso(null);
  373 + this.saveHistoricoDescredenciado(credencialProcesso);
  374 + }
  375 +
  376 + /**
  377 + * <p>
  378 + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a>
  379 + * </p>
  380 + *
  381 + * <p>
  382 + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a>
  383 + * </p>
  384 + *
  385 + * Método responsável por remover a delegação do grupo/usuario no processo
  386 + *
  387 + * @author rogerio.costa
  388 + *
  389 + * @param credencialProcesso
  390 + */
  391 + private void removeDelegacao(CredencialProcesso credencialProcesso) {
  392 +
  393 + List<String> listGrupoUsuarioRemocao = new LinkedList<String>();
  394 +
  395 + if (UtilObjeto.isReferencia(credencialProcesso.getGrupo())) {
  396 +
  397 + listGrupoUsuarioRemocao.add(credencialProcesso.getGrupo().getSigla());
  398 +
  399 + this.removeUserTaskDelegation(credencialProcesso.getIdTask(), listGrupoUsuarioRemocao, null);
  400 + } else {
  401 +
  402 + listGrupoUsuarioRemocao.add(credencialProcesso.getUsuario().getUsername());
  403 +
  404 + this.removeUserTaskDelegation(credencialProcesso.getIdTask(), null, listGrupoUsuarioRemocao);
  405 +
  406 + }
  407 + }
  408 +
  409 + /**
  410 + * <p>
  411 + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a>
  412 + * </p>
  413 + *
  414 + * <p>
  415 + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a>
  416 + * </p>
  417 + *
341 * Método responsável por salvar o histórico do descredenciamento 418 * Método responsável por salvar o histórico do descredenciamento
342 * 419 *
343 * @author rogerio.costa 420 * @author rogerio.costa
@@ -346,10 +423,9 @@ public class CredencialProcessoServiceImpl extends GenericServiceImpl&lt;Credencial @@ -346,10 +423,9 @@ public class CredencialProcessoServiceImpl extends GenericServiceImpl&lt;Credencial
346 */ 423 */
347 private void saveHistoricoDescredenciado(CredencialProcesso credencialProcesso) { 424 private void saveHistoricoDescredenciado(CredencialProcesso credencialProcesso) {
348 425
349 - HistoricoCredencialProcesso historicoCredencialProcesso = new HistoricoCredencialProcesso(); 426 + HistoricoCredencialProcesso historicoCredencialProcesso = this.historicoCredencialProcessoService.findByCredencialAndCredenciado(credencialProcesso);
350 427
351 historicoCredencialProcesso.setDataDescredenciado(UtilDate.getDataAtualCalendar()); 428 historicoCredencialProcesso.setDataDescredenciado(UtilDate.getDataAtualCalendar());
352 - historicoCredencialProcesso.setCredencialProcesso(credencialProcesso);  
353 historicoCredencialProcesso.setDescredenciador(getUsuario()); 429 historicoCredencialProcesso.setDescredenciador(getUsuario());
354 430
355 this.historicoCredencialProcessoService.save(historicoCredencialProcesso); 431 this.historicoCredencialProcessoService.save(historicoCredencialProcesso);
@@ -364,6 +440,30 @@ public class CredencialProcessoServiceImpl extends GenericServiceImpl&lt;Credencial @@ -364,6 +440,30 @@ public class CredencialProcessoServiceImpl extends GenericServiceImpl&lt;Credencial
364 * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> 440 * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a>
365 * </p> 441 * </p>
366 * 442 *
  443 + * Método responsável por renunciar credencial.
  444 + *
  445 + * @author rogerio.costa
  446 + *
  447 + * @param idProcesso
  448 + */
  449 + public Boolean renunciar(Long idProcesso) {
  450 +
  451 + CredencialProcesso credencialProcesso = this.credencialProcessoDao.obterPorUsuarioEProcesso(idProcesso, this.getUsuario().getId());
  452 +
  453 + this.executarAcoesRemocao(credencialProcesso);
  454 +
  455 + return super.removeById(credencialProcesso.getId());
  456 + }
  457 +
  458 + /**
  459 + * <p>
  460 + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a>
  461 + * </p>
  462 + *
  463 + * <p>
  464 + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a>
  465 + * </p>
  466 + *
367 * Método responsável por listar grupo e usuarios que tem credenciais herdadas do sistema. 467 * Método responsável por listar grupo e usuarios que tem credenciais herdadas do sistema.
368 * 468 *
369 * @author rogerio.costa 469 * @author rogerio.costa
@@ -388,11 +488,11 @@ public class CredencialProcessoServiceImpl extends GenericServiceImpl&lt;Credencial @@ -388,11 +488,11 @@ public class CredencialProcessoServiceImpl extends GenericServiceImpl&lt;Credencial
388 488
389 for (Grupo grupo : grupos) { 489 for (Grupo grupo : grupos) {
390 490
391 - herancaList.add(new HerancaSistemaVH(grupo.getNome(), "-")); 491 + herancaList.add(new HerancaSistemaVH(grupo.getId(), grupo.getNome(), "-"));
392 } 492 }
393 } 493 }
394 494
395 - herancaList.add(new HerancaSistemaVH(processo.getAutor().getUsername(), UtilObjeto.isReferencia(processo.getAutor().getUnidade()) ? processo.getAutor().getUnidade().getNome() : "-")); 495 + herancaList.add(new HerancaSistemaVH(processo.getAutor().getId(), processo.getAutor().getUsername(), UtilObjeto.isReferencia(processo.getAutor().getUnidade()) ? processo.getAutor().getUnidade().getNome() : "-"));
396 } 496 }
397 497
398 return herancaList; 498 return herancaList;
@@ -433,60 +533,142 @@ public class CredencialProcessoServiceImpl extends GenericServiceImpl&lt;Credencial @@ -433,60 +533,142 @@ public class CredencialProcessoServiceImpl extends GenericServiceImpl&lt;Credencial
433 * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> 533 * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a>
434 * </p> 534 * </p>
435 * 535 *
436 - * Método responsável por montar um objeto com a credencial do usuario com base nas funcionalidades do sistema 536 + * Método responsável por verificar se o usuarioLogado tem permissão herdadas do sistema para o sigilo
437 * 537 *
438 * @author rogerio.costa 538 * @author rogerio.costa
439 * 539 *
440 - * @param idProcesso 540 + * @param sigilo
  541 + */
  542 + public Boolean contemPermissaoHerdada(Sigilo sigilo) {
  543 +
  544 + Collection<Grupo> gruposHerdados = this.findGrupoPorSigilo(sigilo);
  545 +
  546 + for (Grupo grupo : gruposHerdados) {
  547 +
  548 + if (contemUsuarioLogadoNoGrupo(grupo))
  549 +
  550 + return Boolean.TRUE;
  551 +
  552 + }
  553 +
  554 + return Boolean.FALSE;
  555 + }
  556 +
  557 + /**
  558 + * <p>
  559 + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a>
  560 + * </p>
  561 + *
  562 + * <p>
  563 + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a>
  564 + * </p>
  565 + *
  566 + * Método responsável por verificar se o usuario logado está alocado no grupo
  567 + *
  568 + * @author rogerio.costa
441 * 569 *
442 - * @return CredencialUsuarioVH 570 + * @param grupo
  571 + *
  572 + * @return Boolean
443 */ 573 */
444 - public CredencialUsuarioVH obterCredencialUsuarioLogado(Long idProcesso) { 574 + private Boolean contemUsuarioLogadoNoGrupo(Grupo grupo) {
445 575
446 - CredencialUsuarioVH credencialUsuarioVH = new CredencialUsuarioVH(); 576 + for (GrupoUsuario grupoUsuario : grupo.getGrupoUsuarios()) {
447 577
448 - Processo processo = this.processoService.getReference(idProcesso); 578 + if (grupoUsuario.getUsuario().getId().equals(this.getUsuario().getId())) {
449 579
450 - Sigilo sigilo = this.sigiloService.getReference(processo.getSigilo().getId()); 580 + return Boolean.TRUE;
451 581
452 - // valida de se o usuario logado é autor do processo  
453 - if (processo.getAutor().getId().equals(this.getUsuario().getId())) { 582 + }
  583 + }
454 584
455 - credencialUsuarioVH.setPermiteAtribuirCredencial(Boolean.TRUE);  
456 - credencialUsuarioVH.setPermiteRemoverCredencial(Boolean.FALSE); 585 + return Boolean.FALSE;
  586 + }
457 587
458 - } else { 588 + /**
  589 + * <p>
  590 + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a>
  591 + * </p>
  592 + *
  593 + * <p>
  594 + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a>
  595 + * </p>
  596 + *
  597 + * Método responsável por listar grupos e usuarios do sistema
  598 + *
  599 + * @author rogerio.costa
  600 + *
  601 + * @return Collection<GrupoUsuarioVH>
  602 + */
  603 + @Override
  604 + public Collection<GrupoUsuarioVH> findGrupoUsuarioByName(String nome) {
  605 +
  606 + return this.credencialProcessoDao.findGrupoUsuarioByName(nome);
  607 + }
  608 +
  609 + /**
  610 + * <p>
  611 + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a>
  612 + * </p>
  613 + *
  614 + * <p>
  615 + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a>
  616 + * </p>
  617 + *
  618 + * Método responsável por verificar se o usuario tem permissão para credenciar
  619 + *
  620 + * @author rogerio.costa
  621 + *
  622 + */
  623 + @Override
  624 + public Boolean permiteCredenciar(Long idProcesso) {
  625 +
  626 + Processo processo = this.processoService.getReference(idProcesso);
  627 +
  628 + if (UtilObjeto.isReferencia(processo.getSigilo())) {
459 629
460 - CredencialProcesso credencialProcesso = this.credencialProcessoDao.obterPorUsuarioEProcesso(idProcesso, this.getUsuario().getId()); 630 + Sigilo sigilo = this.sigiloService.getReference(processo.getSigilo().getId());
461 631
462 - // Verifica se o usuario contem credencial no processo.  
463 - if (UtilObjeto.isReferencia(credencialProcesso)) { 632 + // valida de se o usuario logado é autor do processo
  633 + if (processo.getAutor().getId().equals(this.getUsuario().getId())) {
464 634
465 - credencialUsuarioVH.setPermiteAtribuirCredencial(credencialProcesso.getPermiteCredenciar());  
466 - credencialUsuarioVH.setId(credencialProcesso.getId());  
467 - // Verifica se o usuario tem permissão herdada.  
468 - } else if (contemPermissaoHerdada(sigilo)) { 635 + return Boolean.TRUE;
469 636
470 - credencialUsuarioVH.setPermiteAtribuirCredencial(Boolean.TRUE);  
471 - credencialUsuarioVH.setPermiteRemoverCredencial(Boolean.TRUE);  
472 } else { 637 } else {
473 - // Verifica as credenciais vinculadas no processo  
474 - for (CredencialProcesso credencialProcessoVinculada : processo.getCredenciais()) {  
475 638
476 - if (UtilObjeto.isReferencia(credencialProcessoVinculada.getGrupo())) { 639 + CredencialProcesso credencialProcesso = this.credencialProcessoDao.obterPorUsuarioEProcesso(idProcesso, this.getUsuario().getId());
477 640
478 - Grupo grupo = this.grupoService.getReference(credencialProcessoVinculada.getGrupo().getId()); 641 + // Verifica se o usuario contem credencial no processo.
  642 + if (UtilObjeto.isReferencia(credencialProcesso)) {
479 643
480 - if (this.contemUsuarioLogadoNoGrupo(grupo)) { 644 + return credencialProcesso.getPermiteCredenciar();
  645 +
  646 + // Verifica se o usuario tem permissão herdada.
  647 + } else if (contemPermissaoHerdada(sigilo)) {
  648 +
  649 + return Boolean.TRUE;
  650 +
  651 + } else {
  652 + // Verifica as credenciais vinculadas no processo
  653 + for (CredencialProcesso credencialProcessoVinculada : processo.getCredenciais()) {
481 654
482 - credencialUsuarioVH.setPermiteAtribuirCredencial(credencialProcessoVinculada.getPermiteCredenciar()); 655 + if (UtilObjeto.isReferencia(credencialProcessoVinculada.getGrupo())) {
  656 +
  657 + Grupo grupo = this.grupoService.getReference(credencialProcessoVinculada.getGrupo().getId());
  658 +
  659 + if (this.contemUsuarioLogadoNoGrupo(grupo)) {
  660 +
  661 + return credencialProcessoVinculada.getPermiteCredenciar();
  662 + }
483 } 663 }
484 } 664 }
  665 +
485 } 666 }
486 667
487 } 668 }
488 } 669 }
489 - return credencialUsuarioVH; 670 +
  671 + return Boolean.FALSE;
490 } 672 }
491 673
492 /** 674 /**
@@ -498,25 +680,19 @@ public class CredencialProcessoServiceImpl extends GenericServiceImpl&lt;Credencial @@ -498,25 +680,19 @@ public class CredencialProcessoServiceImpl extends GenericServiceImpl&lt;Credencial
498 * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> 680 * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a>
499 * </p> 681 * </p>
500 * 682 *
501 - * Método responsável por verificar se o usuarioLogado tem permissão herdadas do sistema para o sigilo 683 + * Método responsável por listar através do id do processo
502 * 684 *
503 * @author rogerio.costa 685 * @author rogerio.costa
504 * 686 *
505 - * @param sigilo 687 + * @param idProcesso
  688 + * @return Collection<CredencialProcesso>
506 */ 689 */
507 - private Boolean contemPermissaoHerdada(Sigilo sigilo) { 690 + public Collection<CredencialProcesso> findByIdProcesso(Long id) {
508 691
509 - Collection<Grupo> gruposHerdados = this.findGrupoPorSigilo(sigilo);  
510 -  
511 - for (Grupo grupo : gruposHerdados) {  
512 -  
513 - if (contemUsuarioLogadoNoGrupo(grupo)) 692 + Collection<CredencialProcesso> credenciais = this.credencialProcessoDao.findByIdProcesso(id);
514 693
515 - return Boolean.TRUE;  
516 -  
517 - } 694 + return this.montarPermissaoEdicao(credenciais);
518 695
519 - return Boolean.FALSE;  
520 } 696 }
521 697
522 /** 698 /**
@@ -528,26 +704,24 @@ public class CredencialProcessoServiceImpl extends GenericServiceImpl&lt;Credencial @@ -528,26 +704,24 @@ public class CredencialProcessoServiceImpl extends GenericServiceImpl&lt;Credencial
528 * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> 704 * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a>
529 * </p> 705 * </p>
530 * 706 *
531 - * Método responsável por verificar se o usuario logado está alocado no grupo 707 + * Método responsável por montar a parmissão de edição do usuarioLogado
532 * 708 *
533 * @author rogerio.costa 709 * @author rogerio.costa
534 * 710 *
535 - * @param grupo  
536 - *  
537 - * @return Boolean 711 + * @param credenciais
  712 + * @return
538 */ 713 */
539 - private Boolean contemUsuarioLogadoNoGrupo(Grupo grupo) {  
540 -  
541 - for (GrupoUsuario grupoUsuario : grupo.getGrupoUsuarios()) { 714 + private Collection<CredencialProcesso> montarPermissaoEdicao(Collection<CredencialProcesso> credenciais) {
542 715
543 - if (grupoUsuario.getUsuario().getId().equals(this.getUsuario().getId())) { 716 + if (!UtilColecao.isVazio(credenciais)) {
544 717
545 - return Boolean.TRUE; 718 + for (CredencialProcesso credencialProcesso : credenciais) {
546 719
  720 + credencialProcesso.setPermiteEdicao(credencialProcesso.getAutor().getId().equals(this.getUsuario().getId()) || this.contemPermissaoHerdada(credencialProcesso.getProcesso().getSigilo()));
547 } 721 }
548 - }  
549 722
550 - return Boolean.FALSE; 723 + }
  724 + return credenciais;
551 } 725 }
552 726
553 /** 727 /**
@@ -559,16 +733,55 @@ public class CredencialProcessoServiceImpl extends GenericServiceImpl&lt;Credencial @@ -559,16 +733,55 @@ public class CredencialProcessoServiceImpl extends GenericServiceImpl&lt;Credencial
559 * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> 733 * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a>
560 * </p> 734 * </p>
561 * 735 *
562 - * Método responsável por listar grupos e usuarios do sistema 736 + * Método responsável por verificar se o usuarioLogado tem permissão no processo
563 * 737 *
564 * @author rogerio.costa 738 * @author rogerio.costa
565 * 739 *
566 - * @return Collection<GrupoUsuarioVH> 740 + * @param idProcesso
  741 + * @return boolean
567 */ 742 */
568 @Override 743 @Override
569 - public Collection<GrupoUsuarioVH> findGrupoUsuarioByName(String nome) { 744 + public boolean contemPermissaoProcesso(Long idProcesso) {
570 745
571 - return this.credencialProcessoDao.findGrupoUsuarioByName(nome); 746 + if (UtilObjeto.isReferencia(idProcesso)) {
  747 +
  748 + Processo processo = this.processoService.getReference(idProcesso);
  749 +
  750 + if (UtilObjeto.isReferencia(processo.getSigilo())) {
  751 +
  752 + CredencialProcesso credencialProcesso = this.credencialProcessoDao.obterPorUsuarioEProcesso(idProcesso, this.getUsuario().getId());
  753 +
  754 + if (UtilObjeto.isReferencia(credencialProcesso)) {
  755 +
  756 + return Boolean.TRUE;
  757 + }
  758 +
  759 + Sigilo sigilo = this.sigiloService.getReference(processo.getSigilo().getId());
  760 +
  761 + if (contemPermissaoHerdada(sigilo)) {
  762 +
  763 + return Boolean.TRUE;
  764 + }
  765 +
  766 + // Verifica as credenciais vinculadas no processo
  767 + for (CredencialProcesso credencialProcessoVinculada : processo.getCredenciais()) {
  768 +
  769 + if (UtilObjeto.isReferencia(credencialProcessoVinculada.getGrupo())) {
  770 +
  771 + Grupo grupo = this.grupoService.getReference(credencialProcessoVinculada.getGrupo().getId());
  772 +
  773 + if (this.contemUsuarioLogadoNoGrupo(grupo)) {
  774 +
  775 + return Boolean.TRUE;
  776 + }
  777 + }
  778 + }
  779 +
  780 + }
  781 +
  782 + }
  783 +
  784 + return Boolean.FALSE;
572 } 785 }
573 786
574 } 787 }
cit-ecm-api/src/main/java/br/com/centralit/api/service/impl/DocumentoGedServiceImpl.java
@@ -139,6 +139,8 @@ public class DocumentoGedServiceImpl extends GenericServiceImpl&lt;DocumentoGed, Lo @@ -139,6 +139,8 @@ public class DocumentoGedServiceImpl extends GenericServiceImpl&lt;DocumentoGed, Lo
139 139
140 private static final String ICON_PICTURE = "glyphicon glyphicon-picture fa-2x"; 140 private static final String ICON_PICTURE = "glyphicon glyphicon-picture fa-2x";
141 141
  142 + private static final String ICON_PLAY = "fa fa-file-audio-o fa-2x";
  143 +
142 /** 144 /**
143 * quantidade de documentos que podem ser incluídos. 145 * quantidade de documentos que podem ser incluídos.
144 */ 146 */
@@ -174,7 +176,9 @@ public class DocumentoGedServiceImpl extends GenericServiceImpl&lt;DocumentoGed, Lo @@ -174,7 +176,9 @@ public class DocumentoGedServiceImpl extends GenericServiceImpl&lt;DocumentoGed, Lo
174 entity.setConteudo(this.decrypted(entity.getConteudoCriptografado())); 176 entity.setConteudo(this.decrypted(entity.getConteudoCriptografado()));
175 } 177 }
176 178
177 - // this.saveSolr(entity); 179 +
  180 + this.saveSolr(entity);
  181 +
178 182
179 this.verificaTemporalidadeProcesso(entity); 183 this.verificaTemporalidadeProcesso(entity);
180 184
@@ -565,7 +569,7 @@ public class DocumentoGedServiceImpl extends GenericServiceImpl&lt;DocumentoGed, Lo @@ -565,7 +569,7 @@ public class DocumentoGedServiceImpl extends GenericServiceImpl&lt;DocumentoGed, Lo
565 569
566 entity.setConteudo(this.decrypted(entity.getConteudoCriptografado())); 570 entity.setConteudo(this.decrypted(entity.getConteudoCriptografado()));
567 571
568 -// this.saveSolr(entity); 572 + // this.saveSolr(entity);
569 573
570 try { 574 try {
571 if (anexo != null) { 575 if (anexo != null) {
@@ -944,6 +948,8 @@ public class DocumentoGedServiceImpl extends GenericServiceImpl&lt;DocumentoGed, Lo @@ -944,6 +948,8 @@ public class DocumentoGedServiceImpl extends GenericServiceImpl&lt;DocumentoGed, Lo
944 948
945 return DocumentoGedServiceImpl.ICON_CODE; 949 return DocumentoGedServiceImpl.ICON_CODE;
946 950
  951 + } else if (Dominio.TIPO_ANEXO_MP3_CODIGO.equals(tipoAnexo.getCodigo()) || Dominio.TIPO_ANEXO_WMA_CODIGO.equals(tipoAnexo.getCodigo()) || Dominio.TIPO_ANEXO_WAV_CODIGO.equals(tipoAnexo.getCodigo()) || Dominio.TIPO_ANEXO_AAC_CODIGO.equals(tipoAnexo.getCodigo()) || Dominio.TIPO_ANEXO_OGG_CODIGO.equals(tipoAnexo.getCodigo()) || Dominio.TIPO_ANEXO_M4A_CODIGO.equals(tipoAnexo.getCodigo()) || Dominio.TIPO_ANEXO_FLAC_CODIGO.equals(tipoAnexo.getCodigo())) {
  952 + return DocumentoGedServiceImpl.ICON_PLAY;
947 } 953 }
948 954
949 return DocumentoGedServiceImpl.ICON_FILE_SEM_FORMATO; 955 return DocumentoGedServiceImpl.ICON_FILE_SEM_FORMATO;
cit-ecm-api/src/main/java/br/com/centralit/api/service/impl/HistoricoCredencialProcessoServiceImpl.java
@@ -6,6 +6,7 @@ import org.springframework.beans.factory.annotation.Autowired; @@ -6,6 +6,7 @@ import org.springframework.beans.factory.annotation.Autowired;
6 import org.springframework.stereotype.Service; 6 import org.springframework.stereotype.Service;
7 7
8 import br.com.centralit.api.dao.HistoricoCredencialProcessoDao; 8 import br.com.centralit.api.dao.HistoricoCredencialProcessoDao;
  9 +import br.com.centralit.api.model.CredencialProcesso;
9 import br.com.centralit.api.model.HistoricoCredencialProcesso; 10 import br.com.centralit.api.model.HistoricoCredencialProcesso;
10 import br.com.centralit.api.service.HistoricoCredencialProcessoService; 11 import br.com.centralit.api.service.HistoricoCredencialProcessoService;
11 import br.com.centralit.framework.service.arquitetura.GenericServiceImpl; 12 import br.com.centralit.framework.service.arquitetura.GenericServiceImpl;
@@ -76,9 +77,31 @@ public class HistoricoCredencialProcessoServiceImpl extends GenericServiceImpl&lt;H @@ -76,9 +77,31 @@ public class HistoricoCredencialProcessoServiceImpl extends GenericServiceImpl&lt;H
76 * 77 *
77 * @return Collection<HistoricoCredencialProcesso> 78 * @return Collection<HistoricoCredencialProcesso>
78 */ 79 */
79 - public Collection<HistoricoCredencialProcesso> findByIdProcessoAndIdProcessoRemocao(Long idProcesso){  
80 - 80 + public Collection<HistoricoCredencialProcesso> findByIdProcessoAndIdProcessoRemocao(Long idProcesso) {
  81 +
81 return this.historicoCredencialProcessoDao.findByIdProcessoAndIdProcessoRemocao(idProcesso); 82 return this.historicoCredencialProcessoDao.findByIdProcessoAndIdProcessoRemocao(idProcesso);
82 } 83 }
83 84
  85 + /**
  86 + * <p>
  87 + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a>
  88 + * </p>
  89 + *
  90 + * <p>
  91 + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a>
  92 + * </p>
  93 + *
  94 + * Método responsável por listar através da credencial e credenciado
  95 + *
  96 + * @author rogerio.costa
  97 + *
  98 + * @param credencialProcesso
  99 + *
  100 + * @return HistoricoCredencialProcesso
  101 + */
  102 + public HistoricoCredencialProcesso findByCredencialAndCredenciado(CredencialProcesso credencialProcesso) {
  103 +
  104 + return this.historicoCredencialProcessoDao.findByCredencialAndCredenciado(credencialProcesso);
  105 + }
  106 +
84 } 107 }
cit-ecm-api/src/main/java/br/com/centralit/api/service/impl/InicializarEcmServiceImpl.java
@@ -228,7 +228,7 @@ public class InicializarEcmServiceImpl extends UtilStartup { @@ -228,7 +228,7 @@ public class InicializarEcmServiceImpl extends UtilStartup {
228 pgProcessoDocumentoSigiloso = this.paginaService.saveIfNotExist(pgProcessoDocumentoSigiloso); 228 pgProcessoDocumentoSigiloso = this.paginaService.saveIfNotExist(pgProcessoDocumentoSigiloso);
229 229
230 Menu menuProcessoDocumentoSigiloso = new Menu("Processos e Documentos Sigilosos", pgProcessoDocumentoSigiloso, menuProcesso, 2, 4, null, null, null, null, modulo, "CLASSIFICAR_PROCESSO_DOCUMENTO"); 230 Menu menuProcessoDocumentoSigiloso = new Menu("Processos e Documentos Sigilosos", pgProcessoDocumentoSigiloso, menuProcesso, 2, 4, null, null, null, null, modulo, "CLASSIFICAR_PROCESSO_DOCUMENTO");
231 - menuProcessoDocumentoSigiloso.setIncludes(this.gerarArquivosMenu(menuProcessoDocumentoSigiloso, this.CIT_ECM_WEB_ANGULAR, "ClassificarDocumentoProcesso", false, true, false)); 231 + menuProcessoDocumentoSigiloso.setIncludes(this.gerarArquivosMenu(menuProcessoDocumentoSigiloso, this.CIT_ECM_WEB_ANGULAR, "ClassificarDocumentoProcesso", true, true, true));
232 this.menuService.mergeIfNotExist(menuProcessoDocumentoSigiloso); 232 this.menuService.mergeIfNotExist(menuProcessoDocumentoSigiloso);
233 233
234 } 234 }
cit-ecm-api/src/main/java/br/com/centralit/api/service/impl/ProcessoServiceImpl.java
@@ -6,9 +6,12 @@ import java.util.Calendar; @@ -6,9 +6,12 @@ import java.util.Calendar;
6 import java.util.Collection; 6 import java.util.Collection;
7 import java.util.GregorianCalendar; 7 import java.util.GregorianCalendar;
8 import java.util.HashMap; 8 import java.util.HashMap;
  9 +import java.util.LinkedList;
9 import java.util.List; 10 import java.util.List;
10 import java.util.Map; 11 import java.util.Map;
11 12
  13 +import javax.servlet.http.HttpServletRequest;
  14 +
12 import org.apache.commons.lang.StringUtils; 15 import org.apache.commons.lang.StringUtils;
13 import org.json.JSONObject; 16 import org.json.JSONObject;
14 import org.springframework.beans.factory.annotation.Autowired; 17 import org.springframework.beans.factory.annotation.Autowired;
@@ -22,6 +25,8 @@ import br.com.centralit.api.model.EstruturaOrganizacionalECM; @@ -22,6 +25,8 @@ import br.com.centralit.api.model.EstruturaOrganizacionalECM;
22 import br.com.centralit.api.model.InteressadoProcesso; 25 import br.com.centralit.api.model.InteressadoProcesso;
23 import br.com.centralit.api.model.PlanoClassificacao; 26 import br.com.centralit.api.model.PlanoClassificacao;
24 import br.com.centralit.api.model.Processo; 27 import br.com.centralit.api.model.Processo;
  28 +import br.com.centralit.api.model.Sigilo;
  29 +import br.com.centralit.api.model.SigiloPrivilegio;
25 import br.com.centralit.api.model.Temporalidade; 30 import br.com.centralit.api.model.Temporalidade;
26 import br.com.centralit.api.model.UnidadeProcesso; 31 import br.com.centralit.api.model.UnidadeProcesso;
27 import br.com.centralit.api.service.CredencialProcessoService; 32 import br.com.centralit.api.service.CredencialProcessoService;
@@ -36,9 +41,11 @@ import br.com.centralit.api.service.TemporalidadeService; @@ -36,9 +41,11 @@ import br.com.centralit.api.service.TemporalidadeService;
36 import br.com.centralit.api.service.UnidadeProcessoService; 41 import br.com.centralit.api.service.UnidadeProcessoService;
37 import br.com.centralit.api.service.UnidadeService; 42 import br.com.centralit.api.service.UnidadeService;
38 import br.com.centralit.framework.esi.enumerated.VariableTypeEnum; 43 import br.com.centralit.framework.esi.enumerated.VariableTypeEnum;
  44 +import br.com.centralit.framework.esi.environment.EnvironmentOutput;
39 import br.com.centralit.framework.esi.environment.EnvironmentVariable; 45 import br.com.centralit.framework.esi.environment.EnvironmentVariable;
40 import br.com.centralit.framework.exception.BusinessException; 46 import br.com.centralit.framework.exception.BusinessException;
41 import br.com.centralit.framework.exception.CodigoErro; 47 import br.com.centralit.framework.exception.CodigoErro;
  48 +import br.com.centralit.framework.model.Grupo;
42 import br.com.centralit.framework.model.Unidade; 49 import br.com.centralit.framework.model.Unidade;
43 import br.com.centralit.framework.service.arquitetura.GenericServiceImpl; 50 import br.com.centralit.framework.service.arquitetura.GenericServiceImpl;
44 import br.com.centralit.framework.util.UtilColecao; 51 import br.com.centralit.framework.util.UtilColecao;
@@ -122,6 +129,10 @@ public class ProcessoServiceImpl extends GenericServiceImpl&lt;Processo, Long&gt; impl @@ -122,6 +129,10 @@ public class ProcessoServiceImpl extends GenericServiceImpl&lt;Processo, Long&gt; impl
122 @Autowired 129 @Autowired
123 private CredencialProcessoService credencialProcessoService; 130 private CredencialProcessoService credencialProcessoService;
124 131
  132 + /** Atributo request. */
  133 + @Autowired
  134 + private HttpServletRequest request;
  135 +
125 @Autowired 136 @Autowired
126 public ProcessoServiceImpl( final ProcessoDao processoDao, @Qualifier("processoValidator") final Validator validator ) { 137 public ProcessoServiceImpl( final ProcessoDao processoDao, @Qualifier("processoValidator") final Validator validator ) {
127 138
@@ -141,15 +152,15 @@ public class ProcessoServiceImpl extends GenericServiceImpl&lt;Processo, Long&gt; impl @@ -141,15 +152,15 @@ public class ProcessoServiceImpl extends GenericServiceImpl&lt;Processo, Long&gt; impl
141 152
142 final Processo processo = super.save(entity); 153 final Processo processo = super.save(entity);
143 154
144 - /* this.gerarCredenciais(processo); */ 155 +// this.credencialProcessoService.saveCredenciais(processo);
145 156
146 - if (processo.getTipoProtocolo().getNome().equalsIgnoreCase("NUP_NOVO")) { 157 + if (processo.getTipoProtocolo().getCodigo().equals(1L)) {
147 this.gerarNUP(processo); 158 this.gerarNUP(processo);
148 } 159 }
149 160
150 try { 161 try {
151 162
152 - // this.solrService.addProcesso(processo); 163 + this.solrService.addProcesso(processo);
153 } catch (final Exception e) { 164 } catch (final Exception e) {
154 165
155 e.printStackTrace(); 166 e.printStackTrace();
@@ -193,11 +204,11 @@ public class ProcessoServiceImpl extends GenericServiceImpl&lt;Processo, Long&gt; impl @@ -193,11 +204,11 @@ public class ProcessoServiceImpl extends GenericServiceImpl&lt;Processo, Long&gt; impl
193 processo.setNivelAcesso(entity.getNivelAcesso()); 204 processo.setNivelAcesso(entity.getNivelAcesso());
194 processo.setAprovado(entity.getAprovado()); 205 processo.setAprovado(entity.getAprovado());
195 206
  207 +
196 processo = super.merge(processo); 208 processo = super.merge(processo);
197 209
198 documentoGedService.atualizarSigiloDocumentos(entity.getDocumentos()); 210 documentoGedService.atualizarSigiloDocumentos(entity.getDocumentos());
199 -  
200 - 211 +
201 return processo; 212 return processo;
202 } 213 }
203 214
@@ -273,11 +284,23 @@ public class ProcessoServiceImpl extends GenericServiceImpl&lt;Processo, Long&gt; impl @@ -273,11 +284,23 @@ public class ProcessoServiceImpl extends GenericServiceImpl&lt;Processo, Long&gt; impl
273 final JSONObject processoJSON = new JSONObject(mapProcesso); 284 final JSONObject processoJSON = new JSONObject(mapProcesso);
274 285
275 variaveis.add(new EnvironmentVariable("idProcesso", VariableTypeEnum.LONG, processo.getId(), false)); 286 variaveis.add(new EnvironmentVariable("idProcesso", VariableTypeEnum.LONG, processo.getId(), false));
276 - variaveis.add(new EnvironmentVariable("solicitante", VariableTypeEnum.TEXT, processo.getAutor().getUsername(), false));  
277 variaveis.add(new EnvironmentVariable("nup", VariableTypeEnum.JSON, processo.getNup(), false)); 287 variaveis.add(new EnvironmentVariable("nup", VariableTypeEnum.JSON, processo.getNup(), false));
  288 + variaveis.add(new EnvironmentVariable("solicitante", VariableTypeEnum.TEXT, processo.getAutor().getUsername(), false));
278 289
279 - // Verifica se foi configurado um grupo padrão para unidade o usuario.  
280 - if (UtilObjeto.isReferencia(unidade.getGrupo())) { 290 + // Verifica se o processo é sigiloso.
  291 + if (UtilObjeto.isReferencia(processo.getSigilo())) {
  292 +
  293 + variaveis.add(new EnvironmentVariable("usuario_criador_processo_sigiloso", VariableTypeEnum.JSON, processo.getAutor().getUsername(), false));
  294 +
  295 + List<Grupo> gruposPadraoSigilo = (List<Grupo>) this.findGrupoPorSigilo(processo.getSigilo());
  296 +
  297 + if (!UtilColecao.isVazio(gruposPadraoSigilo)) {
  298 + //No momento o sistema está aceitando somente um grupo para gerenciar cada nivel de sigilo.
  299 + variaveis.add(new EnvironmentVariable("grupoPadrao", VariableTypeEnum.TEXT, gruposPadraoSigilo.get(0).getSigla(), false));
  300 + }
  301 +
  302 + // Verifica se foi configurado um grupo padrão para unidade o usuario.
  303 + } else if (UtilObjeto.isReferencia(unidade.getGrupo())) {
281 304
282 variaveis.add(new EnvironmentVariable("grupoPadrao", VariableTypeEnum.TEXT, unidade.getGrupo().getSigla(), false)); 305 variaveis.add(new EnvironmentVariable("grupoPadrao", VariableTypeEnum.TEXT, unidade.getGrupo().getSigla(), false));
283 } else { 306 } else {
@@ -290,7 +313,63 @@ public class ProcessoServiceImpl extends GenericServiceImpl&lt;Processo, Long&gt; impl @@ -290,7 +313,63 @@ public class ProcessoServiceImpl extends GenericServiceImpl&lt;Processo, Long&gt; impl
290 throw new BusinessException("ECM.VALIDACAO.ERRO_VINCULO_FLUXO_BPE_ESI", CodigoErro.REGRA_NEGOCIO.getValue()); 313 throw new BusinessException("ECM.VALIDACAO.ERRO_VINCULO_FLUXO_BPE_ESI", CodigoErro.REGRA_NEGOCIO.getValue());
291 } 314 }
292 315
293 - this.startBusinessProcess(processo.getTipoProcesso().getProcessoNegocio(), variaveis); 316 + EnvironmentOutput environmentOutput = this.startBusinessProcess(processo.getTipoProcesso().getProcessoNegocio(), variaveis);
  317 +
  318 + processo.setIdProcessInstance(environmentOutput.getProcessInstanceId());
  319 +
  320 + }
  321 +
  322 + /**
  323 + * <p>
  324 + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a>
  325 + * </p>
  326 + *
  327 + * <p>
  328 + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a>
  329 + * </p>
  330 + *
  331 + * Método responsável por retornar os privilegios através do sigilo
  332 + *
  333 + * @author rogerio.costa
  334 + *
  335 + * @param sigilo
  336 + * @return Collection<Privilegio>
  337 + */
  338 + private Collection<Long> getPrivilegios(Sigilo sigilo) {
  339 +
  340 + Collection<Long> listIdsPrivilegio = new LinkedList<Long>();
  341 + // Cria uma lista de privilegios relacionados ao sigilo do processo
  342 + for (SigiloPrivilegio sigiloPrivilegio : sigilo.getSigiloPrivilegios()) {
  343 +
  344 + listIdsPrivilegio.add(sigiloPrivilegio.getPrivilegio().getId());
  345 + }
  346 + return listIdsPrivilegio;
  347 + }
  348 +
  349 + /**
  350 + * <p>
  351 + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a>
  352 + * </p>
  353 + *
  354 + * <p>
  355 + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a>
  356 + * </p>
  357 + *
  358 + * Método responsável por obter grupos através do sigilo
  359 + *
  360 + * @author rogerio.costa
  361 + *
  362 + * @param sigilo
  363 + *
  364 + * @return Collection<Grupo>
  365 + */
  366 + private Collection<Grupo> findGrupoPorSigilo(Sigilo sigilo) {
  367 +
  368 + Collection<Long> idPrivilegios = this.getPrivilegios(sigilo);
  369 +
  370 + Collection<Grupo> grupos = this.grupoService.findByPrivilegio(idPrivilegios);
  371 +
  372 + return grupos;
294 } 373 }
295 374
296 /** 375 /**
@@ -494,6 +573,8 @@ public class ProcessoServiceImpl extends GenericServiceImpl&lt;Processo, Long&gt; impl @@ -494,6 +573,8 @@ public class ProcessoServiceImpl extends GenericServiceImpl&lt;Processo, Long&gt; impl
494 573
495 final Processo processo = super.getReference(id); 574 final Processo processo = super.getReference(id);
496 575
  576 + request.getSession().setAttribute("idProcesso", id);
  577 +
497 processo.setDocumentos(this.documentoGedService.findByIdProcessoUltimaVersao(id)); 578 processo.setDocumentos(this.documentoGedService.findByIdProcessoUltimaVersao(id));
498 579
499 return processo; 580 return processo;
@@ -888,4 +969,25 @@ public class ProcessoServiceImpl extends GenericServiceImpl&lt;Processo, Long&gt; impl @@ -888,4 +969,25 @@ public class ProcessoServiceImpl extends GenericServiceImpl&lt;Processo, Long&gt; impl
888 } 969 }
889 } 970 }
890 } 971 }
  972 +
  973 + /**
  974 + *
  975 + */
  976 + @Override
  977 + public Processo getProcessoByIdProcessInstance(Long idProcessInstance) {
  978 +
  979 + // TODO Auto-generated method stub
  980 + return this.processoDao.getProcessoByIdProcessInstance(idProcessInstance);
  981 + }
  982 +
  983 + @Override
  984 + public Processo getProcessoByProtocolo(String nup) {
  985 +
  986 + // TODO Auto-generated method stub
  987 + return this.processoDao.getProcessoByProtocolo(nup);
  988 + }
  989 +
  990 +
  991 +
  992 +
891 } 993 }
cit-ecm-api/src/main/java/br/com/centralit/api/viewHelper/HerancaSistemaVH.java
@@ -38,6 +38,10 @@ import br.com.centralit.framework.json.Views; @@ -38,6 +38,10 @@ import br.com.centralit.framework.json.Views;
38 */ 38 */
39 public class HerancaSistemaVH { 39 public class HerancaSistemaVH {
40 40
  41 + /** Atributo id. */
  42 + @JsonView({ Views.GenericView.class })
  43 + private Long id;
  44 +
41 /** Atributo nome. */ 45 /** Atributo nome. */
42 @JsonView({ Views.GenericView.class }) 46 @JsonView({ Views.GenericView.class })
43 private String nome; 47 private String nome;
@@ -51,9 +55,11 @@ public class HerancaSistemaVH { @@ -51,9 +55,11 @@ public class HerancaSistemaVH {
51 * 55 *
52 * @param nome 56 * @param nome
53 * @param nomeUnidade 57 * @param nomeUnidade
  58 + * @param id
54 */ 59 */
55 - public HerancaSistemaVH( String nome, String nomeUnidade ) { 60 + public HerancaSistemaVH( Long id, String nome, String nomeUnidade ) {
56 61
  62 + this.id = id;
57 this.nome = nome; 63 this.nome = nome;
58 this.nomeUnidade = nomeUnidade; 64 this.nomeUnidade = nomeUnidade;
59 } 65 }
cit-ecm-web/src/main/java/br/com/centralit/controller/CredencialProcessoController.java
@@ -4,12 +4,14 @@ import java.util.Collection; @@ -4,12 +4,14 @@ import java.util.Collection;
4 4
5 import org.springframework.beans.factory.annotation.Autowired; 5 import org.springframework.beans.factory.annotation.Autowired;
6 import org.springframework.stereotype.Controller; 6 import org.springframework.stereotype.Controller;
  7 +import org.springframework.web.bind.annotation.PathVariable;
7 import org.springframework.web.bind.annotation.RequestBody; 8 import org.springframework.web.bind.annotation.RequestBody;
8 import org.springframework.web.bind.annotation.RequestMapping; 9 import org.springframework.web.bind.annotation.RequestMapping;
9 import org.springframework.web.bind.annotation.RequestMethod; 10 import org.springframework.web.bind.annotation.RequestMethod;
10 import org.springframework.web.bind.annotation.RequestParam; 11 import org.springframework.web.bind.annotation.RequestParam;
11 import org.springframework.web.bind.annotation.ResponseBody; 12 import org.springframework.web.bind.annotation.ResponseBody;
12 13
  14 +import br.com.centralit.api.framework.json.ViewsEcm;
13 import br.com.centralit.api.model.CredencialProcesso; 15 import br.com.centralit.api.model.CredencialProcesso;
14 import br.com.centralit.api.service.CredencialProcessoService; 16 import br.com.centralit.api.service.CredencialProcessoService;
15 import br.com.centralit.api.viewHelper.GrupoUsuarioVH; 17 import br.com.centralit.api.viewHelper.GrupoUsuarioVH;
@@ -122,18 +124,31 @@ public class CredencialProcessoController extends GenericController&lt;CredencialPr @@ -122,18 +124,31 @@ public class CredencialProcessoController extends GenericController&lt;CredencialPr
122 } 124 }
123 125
124 /** 126 /**
125 - * <p><b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a></p>  
126 - *  
127 - * <p><b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a></p>  
128 - * 127 + * <p>
  128 + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a>
  129 + * </p>
  130 + *
  131 + * <p>
  132 + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a>
  133 + * </p>
  134 + *
129 * Método responsável por listar as credenciais herdadas 135 * Método responsável por listar as credenciais herdadas
130 - * 136 + *
131 * @author rogerio.costa 137 * @author rogerio.costa
132 - * 138 + *
133 * @param idProcesso 139 * @param idProcesso
134 * @return 140 * @return
135 * @throws Exception 141 * @throws Exception
136 */ 142 */
  143 + @RequestMapping(value = "/findByIdProcesso", method = RequestMethod.GET, produces = "application/json")
  144 + @ResponseBody
  145 + public ResponseBodyWrapper findByIdProcesso(@RequestParam(value = "idProcesso") Long idProcesso) throws Exception {
  146 +
  147 + ResponseBodyWrapper responseBody = new ResponseBodyWrapper(this.credencialProcessoService.findByIdProcesso(idProcesso), Views.CredencialProcessoView.class);
  148 +
  149 + return responseBody;
  150 + }
  151 +
137 @RequestMapping(value = "/findCredenciaisHerdadas", method = RequestMethod.GET, produces = "application/json") 152 @RequestMapping(value = "/findCredenciaisHerdadas", method = RequestMethod.GET, produces = "application/json")
138 @ResponseBody 153 @ResponseBody
139 public ResponseBodyWrapper findCredenciaisHerdadas(@RequestParam(value = "idProcesso") Long idProcesso) throws Exception { 154 public ResponseBodyWrapper findCredenciaisHerdadas(@RequestParam(value = "idProcesso") Long idProcesso) throws Exception {
@@ -143,24 +158,11 @@ public class CredencialProcessoController extends GenericController&lt;CredencialPr @@ -143,24 +158,11 @@ public class CredencialProcessoController extends GenericController&lt;CredencialPr
143 return responseBody; 158 return responseBody;
144 } 159 }
145 160
146 - /**  
147 - * <p><b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a></p>  
148 - *  
149 - * <p><b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a></p>  
150 - *  
151 - * Método responsável por obter as credenciais do usuario logado  
152 - *  
153 - * @author rogerio.costa  
154 - *  
155 - * @param idProcesso  
156 - * @return  
157 - * @throws Exception  
158 - */  
159 - @RequestMapping(value = "/obterCredencialUsuarioLogado", method = RequestMethod.GET, produces = "application/json") 161 + @RequestMapping(method = RequestMethod.DELETE, value = "/renunciar/{idProcesso}")
160 @ResponseBody 162 @ResponseBody
161 - public ResponseBodyWrapper obterCredencialUsuarioLogado(@RequestParam(value = "idProcesso") Long idProcesso) throws Exception { 163 + public ResponseBodyWrapper renunciar(@PathVariable("idProcesso") Long idProcesso) {
162 164
163 - ResponseBodyWrapper responseBody = new ResponseBodyWrapper(this.credencialProcessoService.obterCredencialUsuarioLogado(idProcesso), Views.GenericView.class); 165 + ResponseBodyWrapper responseBody = new ResponseBodyWrapper(this.credencialProcessoService.renunciar(idProcesso), getEditView());
164 166
165 return responseBody; 167 return responseBody;
166 } 168 }
cit-ecm-web/src/main/java/br/com/centralit/controller/ProcessoController.java
@@ -63,6 +63,24 @@ public class ProcessoController extends GenericController&lt;Processo&gt; { @@ -63,6 +63,24 @@ public class ProcessoController extends GenericController&lt;Processo&gt; {
63 public ResponseBodyWrapper atualizarSigiloProcesso(@RequestBody Processo processo) throws Exception { 63 public ResponseBodyWrapper atualizarSigiloProcesso(@RequestBody Processo processo) throws Exception {
64 64
65 ResponseBodyWrapper responseBody = new ResponseBodyWrapper(this.processoService.atualizarSigiloProcesso(processo), GenericView.class); 65 ResponseBodyWrapper responseBody = new ResponseBodyWrapper(this.processoService.atualizarSigiloProcesso(processo), GenericView.class);
  66 +
  67 + return responseBody;
  68 + }
  69 +
  70 + @RequestMapping(method = RequestMethod.GET, value = "/getProcessoByIdProcessInstance")
  71 + @ResponseBody
  72 + public ResponseBodyWrapper getProcessoByIdProcessInstance(@RequestParam(value = "idProcessInstance") Long idProcessInstance) {
  73 +
  74 + ResponseBodyWrapper responseBody = new ResponseBodyWrapper(this.processoService.getProcessoByIdProcessInstance(idProcessInstance), this.getListView());
  75 +
  76 + return responseBody;
  77 + }
  78 +
  79 + @RequestMapping(method = RequestMethod.GET, value = "/getProcessoByProtocolo")
  80 + @ResponseBody
  81 + public ResponseBodyWrapper getProcessoByProtocolo(@RequestParam(value = "nup") String nup) {
  82 +
  83 + ResponseBodyWrapper responseBody = new ResponseBodyWrapper(this.processoService.getProcessoByProtocolo(nup), this.getListView());
66 84
67 return responseBody; 85 return responseBody;
68 } 86 }
cit-ecm-web/src/main/java/br/com/centralit/listener/StartupListenerEcm.java
@@ -376,7 +376,8 @@ public class StartupListenerEcm extends UtilStartup implements ApplicationListen @@ -376,7 +376,8 @@ public class StartupListenerEcm extends UtilStartup implements ApplicationListen
376 internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.NUM_DOCUMENTO", "Número Documento", dominio, modulo)); 376 internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.NUM_DOCUMENTO", "Número Documento", dominio, modulo));
377 internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.RENUNCIAR_CREDENCIAL", "Renunciar credencial", dominio, modulo)); 377 internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.RENUNCIAR_CREDENCIAL", "Renunciar credencial", dominio, modulo));
378 internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.APROVAR", "Aprovar", dominio, modulo)); 378 internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.APROVAR", "Aprovar", dominio, modulo));
379 - 379 + internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.AVANCAR_FLUXO", "Avançar no Fluxo", dominio, modulo));
  380 + internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.JUSTIFICATIVA_CANCELAMENTO", "Justificativa Cancelado", dominio, modulo));
380 } 381 }
381 382
382 /** 383 /**
@@ -407,6 +408,7 @@ public class StartupListenerEcm extends UtilStartup implements ApplicationListen @@ -407,6 +408,7 @@ public class StartupListenerEcm extends UtilStartup implements ApplicationListen
407 internacionalizacaoList.add(new Internacionalizacao("ECM.VALIDACAO.ERRO_UNIDADE_ECM_VIGENTE_USUARIO", "O usuário vigente não possui unidade organizacional ECM vinculada!", dominio, modulo)); 408 internacionalizacaoList.add(new Internacionalizacao("ECM.VALIDACAO.ERRO_UNIDADE_ECM_VIGENTE_USUARIO", "O usuário vigente não possui unidade organizacional ECM vinculada!", dominio, modulo));
408 internacionalizacaoList.add(new Internacionalizacao("ECM.VALIDACAO.ERRO_CONFIGURACAO_GRUPO_PADRAO_USUARIO", "O grupo padrão não foi configurado para unidade vigente", dominio, modulo)); 409 internacionalizacaoList.add(new Internacionalizacao("ECM.VALIDACAO.ERRO_CONFIGURACAO_GRUPO_PADRAO_USUARIO", "O grupo padrão não foi configurado para unidade vigente", dominio, modulo));
409 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)); 410 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));
  411 + internacionalizacaoList.add(new Internacionalizacao("ECM.VALIDACAO.PERMISSAO_OPERACAO", "Você não tem permissão para executar a operação.", dominio, modulo));
410 412
411 } 413 }
412 414
cit-ecm-web/src/main/resources/spring/applicationContext.xml
@@ -36,7 +36,9 @@ @@ -36,7 +36,9 @@
36 p:jpaPropertyMap-ref="jpaPropertyMap" p:jpaVendorAdapter-ref="jpaVendorAdapter" /> 36 p:jpaPropertyMap-ref="jpaPropertyMap" p:jpaVendorAdapter-ref="jpaVendorAdapter" />
37 37
38 <bean id="jpaVendorAdapter" class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter" /> 38 <bean id="jpaVendorAdapter" class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter" />
39 - 39 +
  40 + <bean id="webExpressionHandler" class="br.com.centralit.api.security.CustomExpressionHandler"/>
  41 +
40 <util:map id="jpaPropertyMap"> 42 <util:map id="jpaPropertyMap">
41 <entry key="generateDdl" value="${hibernate.generate.ddl}" /> 43 <entry key="generateDdl" value="${hibernate.generate.ddl}" />
42 <entry key="hibernate.hbm2ddl.auto" value="${hibernate.hbm2ddl.auto}" /> 44 <entry key="hibernate.hbm2ddl.auto" value="${hibernate.hbm2ddl.auto}" />
cit-ecm-web/src/main/webapp/assets/js/angular/custom/controller/CredencialProcessoController.js
@@ -8,19 +8,19 @@ citApp.controller(&#39;CredencialProcessoController&#39;, [&#39;$scope&#39;, &#39;CredencialProcesso @@ -8,19 +8,19 @@ citApp.controller(&#39;CredencialProcessoController&#39;, [&#39;$scope&#39;, &#39;CredencialProcesso
8 8
9 9
10 //Iniciar credencial de acesso 10 //Iniciar credencial de acesso
11 - $scope.iniciarCredencial = function(idProcesso, credencialUsuarioProcesso){ 11 + $scope.iniciarCredencial = function(processo){
12 this.credenciarProcessoForm = $scope.credencialProcessoController.credenciarProcessoForm; 12 this.credenciarProcessoForm = $scope.credencialProcessoController.credenciarProcessoForm;
13 $scope.credenciais = []; 13 $scope.credenciais = [];
14 - $scope.idProcesso = idProcesso; 14 + $scope.processo = processo;
15 $scope.herdadas = []; 15 $scope.herdadas = [];
16 - $scope.credencialUsuarioProcesso = credencialUsuarioProcesso;  
17 - CredencialProcessoRepository.findByIdJoin('processo.id', $scope.idProcesso).then(function(result) { 16 + $scope.credencialProcesso.grupoUsuario = null;
  17 + CredencialProcessoRepository.findByIdProcesso($scope.processo.id).then(function(result) {
18 result.forEach(function (credencialProcesso) { 18 result.forEach(function (credencialProcesso) {
19 19
20 $scope.credenciais.push(credencialProcesso.originalElement); 20 $scope.credenciais.push(credencialProcesso.originalElement);
21 }); 21 });
22 22
23 - CredencialProcessoRepository.findCredenciaisHerdadas($scope.idProcesso).then(function(result) { 23 + CredencialProcessoRepository.findCredenciaisHerdadas($scope.processo.id).then(function(result) {
24 $scope.herdadas = result; 24 $scope.herdadas = result;
25 }); 25 });
26 26
@@ -39,7 +39,7 @@ citApp.controller(&#39;CredencialProcessoController&#39;, [&#39;$scope&#39;, &#39;CredencialProcesso @@ -39,7 +39,7 @@ citApp.controller(&#39;CredencialProcessoController&#39;, [&#39;$scope&#39;, &#39;CredencialProcesso
39 39
40 $scope.historicos = []; 40 $scope.historicos = [];
41 41
42 - HistoricoCredencialProcessoRepository.findByIdProcessoAndIdProcessoRemocao($scope.idProcesso).then(function(result) { 42 + HistoricoCredencialProcessoRepository.findByIdProcessoAndIdProcessoRemocao($scope.processo.id).then(function(result) {
43 result.forEach(function (historico) { 43 result.forEach(function (historico) {
44 44
45 $scope.historicos.push(historico.originalElement); 45 $scope.historicos.push(historico.originalElement);
@@ -81,7 +81,9 @@ citApp.controller(&#39;CredencialProcessoController&#39;, [&#39;$scope&#39;, &#39;CredencialProcesso @@ -81,7 +81,9 @@ citApp.controller(&#39;CredencialProcessoController&#39;, [&#39;$scope&#39;, &#39;CredencialProcesso
81 81
82 var listSemGrupoAdicionado = $filter('idNotEqualObj')(result, $scope.credenciais, 'grupo'); 82 var listSemGrupoAdicionado = $filter('idNotEqualObj')(result, $scope.credenciais, 'grupo');
83 83
84 - return $filter('idNotEqualObj')(listSemGrupoAdicionado, $scope.credenciais, 'usuario'); 84 + var credenciadosFiltrados = $filter('idNotEqualObj')(listSemGrupoAdicionado, $scope.credenciais, 'usuario');
  85 +
  86 + return $filter('idNotEqual')(credenciadosFiltrados, $scope.herdadas);
85 }); 87 });
86 }; 88 };
87 89
@@ -99,9 +101,8 @@ citApp.controller(&#39;CredencialProcessoController&#39;, [&#39;$scope&#39;, &#39;CredencialProcesso @@ -99,9 +101,8 @@ citApp.controller(&#39;CredencialProcessoController&#39;, [&#39;$scope&#39;, &#39;CredencialProcesso
99 var credencialProcesso = {}; 101 var credencialProcesso = {};
100 credencialProcesso.id = $scope.credencialProcesso.id; 102 credencialProcesso.id = $scope.credencialProcesso.id;
101 credencialProcesso.permiteCredenciar = $scope.credencialProcesso.permiteCredenciar; 103 credencialProcesso.permiteCredenciar = $scope.credencialProcesso.permiteCredenciar;
102 - credencialProcesso.processo = {  
103 - id : $scope.idProcesso  
104 - }; 104 + credencialProcesso.processo = $scope.processo;
  105 + credencialProcesso.idTask = $scope.processo.idTask;
105 106
106 //Verifica se o grupUsuario é um grupo, codigo 1 é grupo e 2 usuário 107 //Verifica se o grupUsuario é um grupo, codigo 1 é grupo e 2 usuário
107 if($scope.credencialProcesso.grupoUsuario.codigo == 1){ 108 if($scope.credencialProcesso.grupoUsuario.codigo == 1){
@@ -144,66 +145,59 @@ citApp.controller(&#39;CredencialProcessoController&#39;, [&#39;$scope&#39;, &#39;CredencialProcesso @@ -144,66 +145,59 @@ citApp.controller(&#39;CredencialProcessoController&#39;, [&#39;$scope&#39;, &#39;CredencialProcesso
144 }; 145 };
145 146
146 //Editar credencial 147 //Editar credencial
147 - $scope.editCredencial = function(){ 148 + $scope.editCredencial = function(credencialProcesso){
148 //prepara objeto edição 149 //prepara objeto edição
149 $scope.credencialProcesso = { 150 $scope.credencialProcesso = {
150 edit : true, 151 edit : true,
151 - $$hashKey : $scope.credencialProcessoChecked.$$hashKey,  
152 - permiteCredenciar : $scope.credencialProcessoChecked.permiteCredenciar, 152 + $$hashKey : credencialProcesso.$$hashKey,
  153 + permiteCredenciar : credencialProcesso.permiteCredenciar,
153 grupoUsuario : { 154 grupoUsuario : {
154 - nome : $scope.credencialProcessoChecked.grupo ? $scope.credencialProcessoChecked.grupo.nome : $scope.credencialProcessoChecked.usuario.username,  
155 - id : $scope.credencialProcessoChecked.grupo ? $scope.credencialProcessoChecked.grupo.id : $scope.credencialProcessoChecked.usuario.id 155 + nome : credencialProcesso.grupo ? credencialProcesso.grupo.nome : credencialProcesso.usuario.username,
  156 + id : credencialProcesso.grupo ? credencialProcesso.grupo.id : credencialProcesso.usuario.id
156 } 157 }
157 }; 158 };
158 159
159 - $scope.credencialProcessoChecked = null;  
160 -  
161 }; 160 };
162 161
163 //Exibir o dialog de confirmação de exclusão 162 //Exibir o dialog de confirmação de exclusão
164 - $scope.exibirDialogRemocao = function(){  
165 - //Verifica se alguma credencial foi selecioanda  
166 - if(!$scope.credencialProcessoChecked){  
167 -  
168 - $scope.showAlert('warning', $translate.instant('MSG.SELECIONE_UM_ITEM_PARA_SER_REMOVIDO'));  
169 -  
170 - }else{ 163 + $scope.exibirDialogRemocao = function(credencialProcesso){
171 164
172 - $scope.$openModalConfirm({message: $translate.instant('LABEL.CONFIRMA_EXCLUSAO'), callback: $scope.remove});  
173 - }  
174 - 165 + $scope.$openModalConfirm({message: $translate.instant('LABEL.CONFIRMA_EXCLUSAO'), callback: $scope.remove, item : credencialProcesso});
175 }; 166 };
176 167
177 //Remover credencial 168 //Remover credencial
178 $scope.remove = function(){ 169 $scope.remove = function(){
179 170
180 //Obter o index do elemento 171 //Obter o index do elemento
181 - var index = $scope.credenciais.indexOf($scope.credencialProcessoChecked);  
182 -  
183 - $scope.showAlert("success", $translate.instant('MSG.EXCLUSAO_SUCESSO'));  
184 - 172 + var index = $scope.credenciais.indexOf(this.item);
  173 +
185 //Verifica se a credencial selecionada já foi persistida 174 //Verifica se a credencial selecionada já foi persistida
186 - if($scope.credencialProcessoChecked.id){ 175 + if(this.item.id){
187 176
188 - CredencialProcessoRepository.remove($scope.credencialProcessoChecked).then(function() {  
189 - 177 + CredencialProcessoRepository.remove(this.item).then(function() {
  178 + $scope.showAlert("success", $translate.instant('MSG.EXCLUSAO_SUCESSO'));
  179 + //Remove a credencial da lista de credenciais
  180 + $scope.credenciais.splice(index , 1);
  181 + $scope.credencialProcessoChecked = null;
190 $scope.findHistorico(); 182 $scope.findHistorico();
191 183
192 }); 184 });
193 185
  186 + }else{
  187 + $scope.showAlert("success", $translate.instant('MSG.EXCLUSAO_SUCESSO'));
  188 + //Remove a credencial da lista de credenciais
  189 + $scope.credenciais.splice(index , 1);
  190 +
  191 + $scope.credencialProcessoChecked = null;
  192 +
194 } 193 }
195 - //Remove a credencial da lista de credenciais  
196 - $scope.credenciais.splice(index , 1);  
197 -  
198 - $scope.credencialProcessoChecked = null;  
199 -  
200 $scope.$modalConfirmInstance.dismiss('cancel'); 194 $scope.$modalConfirmInstance.dismiss('cancel');
201 }; 195 };
202 196
203 //Verifica se o usuario logado tem permissão de remover a credencial 197 //Verifica se o usuario logado tem permissão de remover a credencial
204 $scope.verificarPermissaoRemover = function(){ 198 $scope.verificarPermissaoRemover = function(){
205 199
206 - $scope.permiteRemoverCredencial = $scope.usuarioLogado.id === $scope.credencialProcessoChecked.autor.id || $scope.credencialUsuarioProcesso.permiteRemoverCredencial; 200 + $scope.permiteRemoverCredencial = $scope.usuarioLogado.id === $scope.credencialProcessoChecked.autor.id;
207 }; 201 };
208 202
209 203
cit-ecm-web/src/main/webapp/assets/js/angular/custom/controller/DocumentoGedController.js
@@ -633,5 +633,12 @@ citApp.controller(&#39;DocumentoGedController&#39;, [&#39;$scope&#39;, &#39;DocumentoGedRepository&#39;, @@ -633,5 +633,12 @@ citApp.controller(&#39;DocumentoGedController&#39;, [&#39;$scope&#39;, &#39;DocumentoGedRepository&#39;,
633 }); 633 });
634 634
635 }; 635 };
  636 +
  637 + $scope.downloadArquivo = function(idDocumento){
  638 + href = "/cit-ecm-web/rest/anexoGed/visualizar?idAnexo="+idDocumento;
  639 +
  640 + $window.location.href = (href);
  641 +
  642 + }
636 643
637 }]); 644 }]);
cit-ecm-web/src/main/webapp/assets/js/angular/custom/controller/GerenciarProcessoController.js
@@ -9,6 +9,8 @@ citApp.controller(&#39;GerenciarProcessoController&#39;, [ &#39;$scope&#39;, &#39;$translate&#39;, &#39;$tim @@ -9,6 +9,8 @@ citApp.controller(&#39;GerenciarProcessoController&#39;, [ &#39;$scope&#39;, &#39;$translate&#39;, &#39;$tim
9 $scope.taskVariables = []; 9 $scope.taskVariables = [];
10 $scope.unidades = []; 10 $scope.unidades = [];
11 11
  12 + $scope.urlCabecalho = '/cit-ecm-web/html/gerenciarProcesso/includeCabecalhoGerenciarProcesso.jsp?i=' + (new Date).getTime();
  13 +
12 //INICIALIZA VARIAVEIS PARA HABILITAR E FECHAR DIVS DE AÇÕES DO PROCESSO 14 //INICIALIZA VARIAVEIS PARA HABILITAR E FECHAR DIVS DE AÇÕES DO PROCESSO
13 15
14 $scope.isHistoricoProcesso = true; 16 $scope.isHistoricoProcesso = true;
@@ -27,585 +29,583 @@ citApp.controller(&#39;GerenciarProcessoController&#39;, [ &#39;$scope&#39;, &#39;$translate&#39;, &#39;$tim @@ -27,585 +29,583 @@ citApp.controller(&#39;GerenciarProcessoController&#39;, [ &#39;$scope&#39;, &#39;$translate&#39;, &#39;$tim
27 $scope.tratimitado(); 29 $scope.tratimitado();
28 $scope.isGerenciarCredencialProcesso = false; 30 $scope.isGerenciarCredencialProcesso = false;
29 $scope.isClassificarProcessoDocumento = false; 31 $scope.isClassificarProcessoDocumento = false;
30 -  
31 }; 32 };
32 33
33 - //CRIAR RELACIONAMENTO DE PROCESSO  
34 - $scope.editProcessoRelacionado = function(){  
35 -  
36 - $scope.fecharPagina(); 34 + // CRIAR RELACIONAMENTO DE PROCESSO
  35 + $scope.editProcessoRelacionado = function () {
  36 +
  37 + $scope.fecharPagina();
37 $scope.isProcessoRelacionado = true; 38 $scope.isProcessoRelacionado = true;
38 -  
39 - $timeout(function() {  
40 - angular.element("#editProcessoRelacionado").scope().getProcessoRelacionado();  
41 - }); 39 +
  40 + $timeout( function () {
  41 + angular.element( "#editProcessoRelacionado" ).scope().getProcessoRelacionado();
  42 + } );
42 43
43 }; 44 };
44 -  
45 - $scope.historicoJustificativa = function(){ 45 +
  46 + $scope.historicoJustificativa = function () {
46 $scope.fecharPagina(); 47 $scope.fecharPagina();
47 $scope.isHistoricoJustificativa = true; 48 $scope.isHistoricoJustificativa = true;
48 - $timeout(function() {  
49 - angular.element("#justificativaAcaoProcessoList").scope().inicializarJustificativa();  
50 - }); 49 + $timeout( function () {
  50 + angular.element( "#justificativaAcaoProcessoList" ).scope().inicializarJustificativa();
  51 + } );
51 }; 52 };
52 -  
53 - $scope.abrirJustificativa = function(acao){ 53 +
  54 + $scope.abrirJustificativa = function ( acao ) {
54 $scope.fecharPagina(); 55 $scope.fecharPagina();
55 $scope.isCancelarDocumento = true; 56 $scope.isCancelarDocumento = true;
56 }; 57 };
57 -  
58 - 58 +
59 // CRIA NOVO DOCUMENTO 59 // CRIA NOVO DOCUMENTO
60 - $scope.newDocument = function() { 60 + $scope.newDocument = function () {
61 61
62 $scope.fecharPagina(); 62 $scope.fecharPagina();
63 $scope.isDocumentoEdit = true; 63 $scope.isDocumentoEdit = true;
64 $scope.isVersoesDocumento = false; 64 $scope.isVersoesDocumento = false;
65 - $timeout(function() {  
66 - angular.element("#editDocumentoGed").scope().resetForm();  
67 - }); 65 + $timeout( function () {
  66 + angular.element( "#editDocumentoGed" ).scope().resetForm();
  67 + } );
68 }; 68 };
69 - 69 +
70 // Abre a tela de edição do documento 70 // Abre a tela de edição do documento
71 - $scope.editDocument = function(editarDocumento, edit) {  
72 - 71 + $scope.editDocument = function ( editarDocumento, edit ) {
  72 +
73 $scope.fecharPagina(); 73 $scope.fecharPagina();
74 $scope.isDocumentoEdit = true; 74 $scope.isDocumentoEdit = true;
75 $scope.isVersoesDocumento = false; 75 $scope.isVersoesDocumento = false;
76 -  
77 - $timeout(function() {  
78 - angular.element("#editDocumentoGed").scope().getDocumentoGed(editarDocumento.id, edit);  
79 - }); 76 +
  77 + $timeout( function () {
  78 + angular.element( "#editDocumentoGed" ).scope().getDocumentoGed( editarDocumento.id, edit );
  79 + } );
80 }; 80 };
81 - 81 +
82 // ABRE ABA PARA CRIAR NOVO PROCESSO 82 // ABRE ABA PARA CRIAR NOVO PROCESSO
83 - $scope.novoProcesso = function() {  
84 -  
85 - var workspace = angular.element('#editProcessoEcm').scope().workspace;  
86 - if (workspace) {  
87 - angular.element("#citapp-controller").scope().removeWorkspace(workspace.id); 83 + $scope.novoProcesso = function () {
  84 +
  85 + var workspace = angular.element( '#editProcessoEcm' ).scope().workspace;
  86 + if ( workspace ) {
  87 + angular.element( "#citapp-controller" ).scope().removeWorkspace( workspace.id );
88 } 88 }
89 -  
90 - $scope.openWorkspaceIfNotOpen($translate.instant('ECM.LABEL.PROCESSO'), '/cit-ecm-web/html/processo/processo.html', 'mod-orange');  
91 89
92 - $timeout(function() {  
93 - angular.element('#editProcessoEcm').scope().$showPageEditWorkspace(angular.element('#editProcessoEcm').scope().workspace);  
94 - angular.element('#editProcessoEcm').scope().resetForm(); 90 + $scope.openWorkspaceIfNotOpen( $translate.instant( 'ECM.LABEL.PROCESSO' ), '/cit-ecm-web/html/processo/processo.html', 'mod-orange' );
  91 +
  92 + $timeout( function () {
  93 + angular.element( '#editProcessoEcm' ).scope().$showPageEditWorkspace( angular.element( '#editProcessoEcm' ).scope().workspace );
  94 + angular.element( '#editProcessoEcm' ).scope().resetForm();
  95 +
  96 + }, 600 );
95 97
96 - }, 600);  
97 -  
98 }; 98 };
99 -  
100 - //Gerenciar as credenciais do processo  
101 - $scope.gerenciarCredenciaisProcesso = function() {  
102 - 99 +
  100 + // Gerenciar as credenciais do processo
  101 + $scope.gerenciarCredenciaisProcesso = function () {
  102 +
103 $scope.fecharPagina(); 103 $scope.fecharPagina();
104 $scope.isGerenciarCredencialProcesso = true; 104 $scope.isGerenciarCredencialProcesso = true;
105 -  
106 - $timeout(function() {  
107 - angular.element("#credencialProcessoEdit").scope().iniciarCredencial($scope.processo.id, $scope.credencialUsuarioProcesso);  
108 - }); 105 +
  106 + $timeout( function () {
  107 + angular.element( "#credencialProcessoEdit" ).scope().iniciarCredencial( $scope.processo);
  108 + } );
109 }; 109 };
110 -  
111 110
112 - //EXECUÇÃO PROCESSO  
113 - $scope.executarProcesso = function(action){ 111 + // EXECUÇÃO PROCESSO
  112 + $scope.executarProcesso = function ( action ) {
114 $scope.flowAction = action; 113 $scope.flowAction = action;
115 -  
116 - if(action.requireReason){ 114 +
  115 + if ( action.requireReason ) {
117 $scope.fecharPagina(); 116 $scope.fecharPagina();
118 $scope.isJustificativaAcaoProcesso = true; 117 $scope.isJustificativaAcaoProcesso = true;
119 - $timeout(function() {  
120 - angular.element("#justificativaAcaoProcesso").scope().resetForm();  
121 - });  
122 - }else{  
123 - $scope.closeWidget();  
124 -  
125 - DocumentoGedRepository.existeVinculo({'joinClass' : 'processo.id', 'id': $scope.processo.id}).then(function(result) {  
126 - if(!result){  
127 - var mensagem = $translate.instant('ECM.MSG.PROCESSO_SEM_DOCUMENTO') + $scope.flowAction.name;  
128 - $scope.showAlert("warning", mensagem );  
129 - } else{  
130 - var mensagem = $translate.instant('ECM.MSG.CONFIRMA_EXECUCAO_FLUXO');  
131 - mensagem += $scope.flowAction.name;  
132 - $scope.$openModalConfirm({message: mensagem, callback: $scope.avancarFluxo});  
133 - }  
134 - });  
135 -  
136 - $scope.saveHistoricoProcessoAcao(); 118 + $timeout( function () {
  119 + angular.element( "#justificativaAcaoProcesso" ).scope().resetForm();
  120 + } );
  121 + } else {
  122 + $scope.closeWidget();
  123 +
  124 + DocumentoGedRepository.existeVinculo( {
  125 + 'joinClass' : 'processo.id',
  126 + 'id' : $scope.processo.id
  127 + } ).then( function ( result ) {
  128 + if ( !result ) {
  129 + var mensagem = $translate.instant( 'ECM.MSG.PROCESSO_SEM_DOCUMENTO' ) + $scope.flowAction.name;
  130 + $scope.showAlert( "warning", mensagem );
  131 + } else {
  132 + var mensagem = $translate.instant( 'ECM.MSG.CONFIRMA_EXECUCAO_FLUXO' );
  133 + mensagem += $scope.flowAction.name;
  134 + $scope.$openModalConfirm( {
  135 + message : mensagem,
  136 + callback : $scope.avancarFluxo
  137 + } );
  138 + }
  139 + } );
  140 +
  141 + $scope.saveHistoricoProcessoAcao();
137 } 142 }
138 }; 143 };
139 -  
140 - $scope.avancarFluxo = function (){  
141 - $scope.$modalConfirmInstance.dismiss('cancel');  
142 - $scope.updateTask(true);  
143 - 144 +
  145 + $scope.avancarFluxo = function () {
  146 + $scope.$modalConfirmInstance.dismiss( 'cancel' );
  147 + $scope.updateTask( true );
  148 +
144 }; 149 };
145 150
146 - //Salvar Historico Execução Processo  
147 - $scope.saveHistoricoProcessoAcao = function(){  
148 -  
149 - var historicoAlteracaoProcesso = {  
150 - descricaoAcao : $translate.instant('ECM.MSG_HISTORICO_ECM.ACAO_PROCESSO'),  
151 - processo : $scope.processo,  
152 - autor : $scope.usuarioLogado,  
153 - acaoAlteracao : "ACAO_PROCESSO",  
154 - mapaAtributos : {"protocolo" : $scope.processo.nup, "acao" : $scope.flowAction.name}  
155 - };  
156 -  
157 - HistoricoAlteracaoProcessoRepository.saveParams(historicoAlteracaoProcesso).then(function(result){  
158 - });  
159 - };  
160 -  
161 -  
162 - //Conclui o proceso  
163 - $scope.concluir = function(){  
164 -  
165 - DocumentoGedRepository.existeVinculo({'joinClass' : 'processo.id', 'id': $scope.processo.id}).then(function(result) {  
166 - if(!result){  
167 - var mensagem = $translate.instant('ECM.MSG.PROCESSO_SEM_DOCUMENTO') +" " +$translate.instant('ECM.LABEL.CONCLUIR') ;  
168 - $scope.showAlert("warning", mensagem );  
169 - } else{  
170 -  
171 - $scope.$openModalConfirm({message: $translate.instant('ECM.MSG.CONFIRMA_CONCLUIR_PROCESSO'), callback: $scope.saveConcluir});  
172 - }  
173 - }); 151 + // Salvar Historico Execução Processo
  152 + $scope.saveHistoricoProcessoAcao = function () {
  153 +
  154 + var historicoAlteracaoProcesso = {
  155 + descricaoAcao : $translate.instant( 'ECM.MSG_HISTORICO_ECM.ACAO_PROCESSO' ),
  156 + processo : $scope.processo,
  157 + autor : $scope.usuarioLogado,
  158 + acaoAlteracao : "ACAO_PROCESSO",
  159 + mapaAtributos : {
  160 + "protocolo" : $scope.processo.nup,
  161 + "acao" : $scope.flowAction.name
  162 + }
  163 + };
  164 +
  165 + HistoricoAlteracaoProcessoRepository.saveParams( historicoAlteracaoProcesso ).then( function ( result ) {
  166 + } );
174 }; 167 };
175 -  
176 - $scope.saveConcluir = function(){  
177 -  
178 - ProcessoRepository.concluir({"idProcesso" : $scope.processo.id, "idTask" : $scope.task.id}).then(function(result) {  
179 168
180 - //Verifica se foi concluido em todas unidades.  
181 - $timeout(function() {  
182 - if(result){  
183 - if($scope.task.flowElement.actions && $scope.task.flowElement.actions.length == 1){  
184 - $scope.executarProcesso($scope.task.flowElement.actions[0]); 169 + // Conclui o proceso
  170 + $scope.concluir = function () {
  171 +
  172 + DocumentoGedRepository.existeVinculo( {
  173 + 'joinClass' : 'processo.id',
  174 + 'id' : $scope.processo.id
  175 + } ).then( function ( result ) {
  176 + if ( !result ) {
  177 + var mensagem = $translate.instant( 'ECM.MSG.PROCESSO_SEM_DOCUMENTO' ) + " " + $translate.instant( 'ECM.LABEL.CONCLUIR' );
  178 + $scope.showAlert( "warning", mensagem );
  179 + } else {
  180 +
  181 + $scope.$openModalConfirm( {
  182 + message : $translate.instant( 'ECM.MSG.CONFIRMA_CONCLUIR_PROCESSO' ),
  183 + callback : $scope.saveConcluir
  184 + } );
  185 + }
  186 + } );
  187 + };
  188 +
  189 + $scope.saveConcluir = function () {
  190 +
  191 + ProcessoRepository.concluir( {"idProcesso" : $scope.processo.id, "idTask" : $scope.task.id} ).then( function ( result ) {
  192 +
  193 + // Verifica se foi concluido em todas unidades.
  194 + $timeout( function () {
  195 + if ( result ) {
  196 + if ( $scope.task.flowElement.actions && $scope.task.flowElement.actions.length == 1 ) {
  197 + $scope.executarProcesso( $scope.task.flowElement.actions[ 0 ] );
  198 + }
  199 + } else {
  200 + var workspace = angular.element( '#editProcessoEcm' ).scope().workspace;
  201 + if ( workspace ) {
  202 + $scope.$modalConfirmInstance.dismiss( 'cancel' );
  203 + angular.element( "#citapp-controller" ).scope().removeWorkspace( workspace.id );
  204 +
  205 + angular.element( "#citapp-controller" ).scope().showAlert( "success", $translate.instant( 'MSG.PROCESSO_ENVIADO_SUCESSO' ) );
185 } 206 }
186 - }else{  
187 - var workspace = angular.element('#editProcessoEcm').scope().workspace;  
188 - if (workspace) {  
189 - $scope.$modalConfirmInstance.dismiss('cancel');  
190 - angular.element("#citapp-controller").scope().removeWorkspace(workspace.id);  
191 -  
192 - angular.element("#citapp-controller").scope().showAlert("success", $translate.instant('MSG.PROCESSO_ENVIADO_SUCESSO'));  
193 - }  
194 } 207 }
195 -  
196 - }, 100);  
197 208
198 - $scope.showAlert("success", $translate.instant('ECM.MSG.SUCESSO_CONCLUIR_PROCESSO'));  
199 -  
200 - $scope.$modalConfirmInstance.dismiss('cancel');  
201 - 209 + }, 100 );
  210 +
  211 + $scope.showAlert( "success", $translate.instant( 'ECM.MSG.SUCESSO_CONCLUIR_PROCESSO' ) );
  212 +
  213 + $scope.$modalConfirmInstance.dismiss( 'cancel' );
  214 +
202 $scope.saveHistoricoProcesso(); 215 $scope.saveHistoricoProcesso();
203 - }); 216 + } );
  217 + };
  218 +
  219 + // Salvar Historico processo UNIDADE
  220 + $scope.saveHistoricoProcesso = function ( unidadesProcessoList ) {
  221 +
  222 + var historicoAlteracaoProcesso = {
  223 + descricaoAcao : $translate.instant( 'ECM.MSG_HISTORICO_ECM.CONCLUSAO_PROCESSO_UNIDADE' ),
  224 + processo : $scope.processo,
  225 + autor : $scope.usuarioLogado,
  226 + acaoAlteracao : "CONCLUSAO_PROCESSO_UNIDADE"
  227 + };
  228 +
  229 + HistoricoAlteracaoProcessoRepository.saveParams( historicoAlteracaoProcesso ).then( function ( result ) {
  230 +
  231 + } );
204 }; 232 };
205 -  
206 - //Salvar Historico processo UNIDADE  
207 - $scope.saveHistoricoProcesso = function(unidadesProcessoList){  
208 -  
209 - var historicoAlteracaoProcesso = {  
210 - descricaoAcao : $translate.instant('ECM.MSG_HISTORICO_ECM.CONCLUSAO_PROCESSO_UNIDADE'),  
211 - processo : $scope.processo,  
212 - autor : $scope.usuarioLogado,  
213 - acaoAlteracao : "CONCLUSAO_PROCESSO_UNIDADE"  
214 - };  
215 -  
216 - HistoricoAlteracaoProcessoRepository.saveParams(historicoAlteracaoProcesso).then(function(result){  
217 -  
218 - });  
219 -  
220 - };  
221 233
222 // MONTA O EDITAR DO PROCESSO 234 // MONTA O EDITAR DO PROCESSO
223 - $scope.editProcessoECM = function() {  
224 - 235 + $scope.editProcessoECM = function () {
  236 +
225 $scope.fecharPagina(); 237 $scope.fecharPagina();
226 $scope.isProcessoEdit = true; 238 $scope.isProcessoEdit = true;
227 $scope.isVersoesDocumento = false; 239 $scope.isVersoesDocumento = false;
228 -  
229 - $timeout(function() {  
230 - angular.element('#editProcessoEcm').scope().getProcesso($scope.processo, true);  
231 - angular.element(document.querySelector('#topoMenu')).remove();  
232 - angular.element(document.querySelector('#cabecalhoProcesso')).remove();  
233 - });  
234 -  
235 - 240 +
  241 + $timeout( function () {
  242 + angular.element( '#editProcessoEcm' ).scope().getProcesso( $scope.processo, true );
  243 + angular.element( document.querySelector( '#topoMenu' ) ).remove();
  244 + angular.element( document.querySelector( '#cabecalhoProcesso' ) ).remove();
  245 + } );
  246 +
236 }; 247 };
237 -  
238 - //ATUALIZAR PADRÃO DE PROCESSO  
239 - $scope.atualizaProcesso = function() {  
240 -  
241 - $timeout(function(){  
242 - ProcessoRepository.get($scope.processo.id).then(function(result) {  
243 - $scope.processo = result.originalElement;  
244 - });  
245 - }, 100);  
246 - 248 +
  249 + // ATUALIZAR PADRÃO DE PROCESSO
  250 + $scope.atualizaProcesso = function () {
  251 +
  252 + $timeout( function () {
  253 + ProcessoRepository.get( $scope.processo.id ).then( function ( result ) {
  254 + $scope.processo = result.originalElement;
  255 + } );
  256 + }, 100 );
247 }; 257 };
248 -  
249 - //VERSOES DO DOCUMENTO  
250 - $scope.visualizarVersoes = function(documento){  
251 - 258 +
  259 + // VERSOES DO DOCUMENTO
  260 + $scope.visualizarVersoes = function ( documento ) {
252 $scope.fecharPagina(); 261 $scope.fecharPagina();
253 $scope.isVersoesDocumento = true; 262 $scope.isVersoesDocumento = true;
254 $scope.idDocumento = documento.id; 263 $scope.idDocumento = documento.id;
255 var idRaiz = documento.idRaiz; 264 var idRaiz = documento.idRaiz;
256 - if(!idRaiz){ 265 + if ( !idRaiz ) {
257 idRaiz = documento.id; 266 idRaiz = documento.id;
258 } 267 }
259 - DocumentoGedRepository.findByIdDocumentoTodasVersoes(idRaiz).then(function(result) { 268 + DocumentoGedRepository.findByIdDocumentoTodasVersoes( idRaiz ).then( function ( result ) {
260 $scope.listVersoes = result; 269 $scope.listVersoes = result;
261 - });  
262 - 270 + } );
  271 +
263 }; 272 };
264 -  
265 - //ENVIAR PROCESSO  
266 - $scope.enviarProcesso = function(){  
267 -  
268 - DocumentoGedRepository.existeVinculo({'joinClass' : 'processo.id', 'id': $scope.processo.id}).then(function(result) {  
269 - if(result){ 273 +
  274 + // ENVIAR PROCESSO
  275 + $scope.enviarProcesso = function () {
  276 + DocumentoGedRepository.existeVinculo( {'joinClass' : 'processo.id', 'id' : $scope.processo.id} ).then( function ( result ) {
  277 + if ( result ) {
270 $scope.fecharPagina(); 278 $scope.fecharPagina();
271 $scope.isEnviarProcesso = true; 279 $scope.isEnviarProcesso = true;
272 -  
273 - $timeout(function() {  
274 - angular.element("#enviarProcessoEdit").scope().iniciarEnvio($scope.processo.id, $scope.task.id);  
275 - });  
276 - }else{  
277 - $scope.showAlert("warning", $translate.instant('ECM.MSG.PROCESSO_SEM_DOCUMENTO_ENVIO_UNIDADE')); 280 +
  281 + $timeout( function () {
  282 + angular.element( "#enviarProcessoEdit" ).scope().iniciarEnvio( $scope.processo.id, $scope.task.id );
  283 + } );
  284 + } else {
  285 + $scope.showAlert( "warning", $translate.instant( 'ECM.MSG.PROCESSO_SEM_DOCUMENTO_ENVIO_UNIDADE' ) );
278 } 286 }
279 - }); 287 + } );
280 }; 288 };
281 -  
282 - //ANEXAR PROCESSO  
283 - $scope.anexarProcesso = function(){ 289 +
  290 + // ANEXAR PROCESSO
  291 + $scope.anexarProcesso = function () {
284 $scope.fecharPagina(); 292 $scope.fecharPagina();
285 $scope.isAnexarProcesso = true; 293 $scope.isAnexarProcesso = true;
286 - $timeout(function() {  
287 - angular.element("#anexarProcessoEdit").scope().getProcessoAnexado();  
288 - }); 294 + $timeout( function () {
  295 + angular.element( "#anexarProcessoEdit" ).scope().getProcessoAnexado();
  296 + } );
289 }; 297 };
290 -  
291 -  
292 - //CLASSIFICAR PROCESSO E DOCUMENTO  
293 - $scope.classificarDocumentoProceso = function(){ 298 +
  299 + // CLASSIFICAR PROCESSO E DOCUMENTO
  300 + $scope.classificarDocumentoProceso = function () {
294 $scope.fecharPagina(); 301 $scope.fecharPagina();
295 $scope.isClassificarProcessoDocumento = true; 302 $scope.isClassificarProcessoDocumento = true;
296 - $timeout(function() {  
297 - angular.element("#classificarDocumento").scope().getProcesso($scope.processo);  
298 - }); 303 + $timeout( function () {
  304 + angular.element( "#classificarDocumento" ).scope().getProcesso( $scope.processo );
  305 + } );
299 }; 306 };
300 -  
301 - //REMOVER DOCUMENTO  
302 - $scope.removeDocumento = function(documento, index){  
303 - $scope.$openModalConfirm({  
304 - message: $translate.instant('MSG.CONFIRMA_EXCLUSAO'),  
305 - callback: function () {  
306 - DocumentoGedRepository.remove(documento).then(function() {  
307 -  
308 - $scope.$modalConfirmInstance.dismiss('cancel');  
309 - $scope.showAlert("success", $translate.instant('MSG.SUCESSO_EXCLUIR')); 307 +
  308 + // REMOVER DOCUMENTO
  309 + $scope.removeDocumento = function ( documento, index ) {
  310 + $scope.$openModalConfirm( {
  311 + message : $translate.instant( 'MSG.CONFIRMA_EXCLUSAO' ),
  312 + callback : function () {
  313 + DocumentoGedRepository.remove( documento ).then( function () {
  314 +
  315 + $scope.$modalConfirmInstance.dismiss( 'cancel' );
  316 + $scope.showAlert( "success", $translate.instant( 'MSG.SUCESSO_EXCLUIR' ) );
310 $scope.isDocumentoEdit = false; 317 $scope.isDocumentoEdit = false;
311 - $scope.processo.documentos.splice(index , 1);  
312 -  
313 - var historicoAlteracaoProcesso = {  
314 - documentoGed : $scope.documentoGed,  
315 - descricaoAcao : $translate.instant('ECM.MSG_HISTORICO_ECM.REMOCAO_DOCUMENTO'),  
316 - processo : $scope.processo,  
317 - autor : $scope.usuarioLogado,  
318 - idTask : $scope.task.id,  
319 - acaoAlteracao : "REMOCAO_DOCUMENTO"  
320 - };  
321 - HistoricoAlteracaoProcessoRepository.saveParams(historicoAlteracaoProcesso).then(function(result){  
322 -  
323 - });  
324 - }); 318 + $scope.processo.documentos.splice( index, 1 );
  319 +
  320 + var historicoAlteracaoProcesso = {
  321 + documentoGed : $scope.documentoGed,
  322 + descricaoAcao : $translate.instant( 'ECM.MSG_HISTORICO_ECM.REMOCAO_DOCUMENTO' ),
  323 + processo : $scope.processo,
  324 + autor : $scope.usuarioLogado,
  325 + idTask : $scope.task.id,
  326 + acaoAlteracao : "REMOCAO_DOCUMENTO"
  327 + };
  328 + HistoricoAlteracaoProcessoRepository.saveParams( historicoAlteracaoProcesso ).then( function ( result ) {
  329 +
  330 + } );
  331 + } );
325 } 332 }
326 - }); 333 + } );
327 }; 334 };
328 - 335 +
329 //Exibir dialog para remover credencial do usuário 336 //Exibir dialog para remover credencial do usuário
330 $scope.exibirDialogConfirmacaoRemoverCredencial = function(){ 337 $scope.exibirDialogConfirmacaoRemoverCredencial = function(){
331 338
332 - $scope.$openModalConfirm({message: $translate.instant('ECM.MSG.CONFIRMA_RENUNCIAR_CREDENCIAL'), callback: $scope.removeCredemcial}); 339 + $scope.$openModalConfirm({message: $translate.instant('ECM.MSG.CONFIRMA_RENUNCIAR_CREDENCIAL'), callback: $scope.renunciarCredencial});
333 340
334 }; 341 };
335 342
336 //Remover a credencial do usuário 343 //Remover a credencial do usuário
337 - $scope.removeCredemcial = function(){ 344 + $scope.renunciarCredencial = function(){
338 345
339 - CredencialProcessoRepository.remove($scope.credencialUsuarioProcesso).then(function() {  
340 -  
341 - $scope.credencialUsuarioProcesso = null; 346 + CredencialProcessoRepository.renunciar($scope.processo.id).then(function() {
342 347
343 $scope.voltarGerenciamentoTarefa(); 348 $scope.voltarGerenciamentoTarefa();
344 349
345 }); 350 });
346 }; 351 };
347 -  
348 - //Voltar para tela de gerenciamento de tarefa  
349 - $scope.voltarGerenciamentoTarefa = function(){  
350 -  
351 - var workspace = angular.element('#searchGerenciarProcesso').scope().workspace;  
352 - if (workspace) {  
353 - $scope.$modalConfirmInstance.dismiss('cancel');  
354 - angular.element("#citapp-controller").scope().removeWorkspace(workspace.id);  
355 -  
356 - angular.element("#citapp-controller").scope().showAlert("success", $translate.instant('ECM.MSG.CREDENCIAL_REMOVIDA_SUCESSO'));  
357 - }  
358 -  
359 - $timeout(function(){  
360 - angular.element('#idGerenciamentoTarefas').scope().fetchResult();  
361 - });  
362 -  
363 - };  
364 -  
365 - //Cancelar documento  
366 - $scope.cancelarDocumento = function(documento){  
367 - 352 +
  353 + // Voltar para tela de gerenciamento de tarefa
  354 + $scope.voltarGerenciamentoTarefa = function () {
  355 +
  356 + var workspace = angular.element( '#searchGerenciarProcesso' ).scope().workspace;
  357 + if ( workspace ) {
  358 + $scope.$modalConfirmInstance.dismiss( 'cancel' );
  359 + angular.element( "#citapp-controller" ).scope().removeWorkspace( workspace.id );
  360 +
  361 + angular.element( "#citapp-controller" ).scope().showAlert( "success", $translate.instant( 'ECM.MSG.CREDENCIAL_REMOVIDA_SUCESSO' ) );
  362 + }
  363 +
  364 + $timeout( function () {
  365 + angular.element( '#idGerenciamentoTarefas' ).scope().fetchResult();
  366 + } );
  367 +
  368 + };
  369 +
  370 + // Cancelar documento
  371 + $scope.cancelarDocumento = function ( documento ) {
  372 +
368 $scope.fecharPagina(); 373 $scope.fecharPagina();
369 $scope.isCancelarDocumento = true; 374 $scope.isCancelarDocumento = true;
370 - $timeout(function() {  
371 - angular.element("#cancelarDocumento").scope().resetForm(documento, $scope.task.id);  
372 - }); 375 + $timeout( function () {
  376 + angular.element( "#cancelarDocumento" ).scope().resetForm( documento, $scope.task.id );
  377 + } );
373 }; 378 };
374 -  
375 - $scope.getCancelamentoDocumento = function(documento){  
376 - 379 +
  380 + $scope.getCancelamentoDocumento = function ( documento ) {
  381 +
377 $scope.fecharPagina(); 382 $scope.fecharPagina();
378 $scope.isCancelarDocumento = true; 383 $scope.isCancelarDocumento = true;
379 - $timeout(function() {  
380 - angular.element("#cancelarDocumento").scope().getCancelamentoDocumento(documento.cancelamentoDocumentoGed.id);  
381 - }); 384 + $timeout( function () {
  385 + angular.element( "#cancelarDocumento" ).scope().getCancelamentoDocumento( documento.cancelamentoDocumentoGed.id );
  386 + } );
382 }; 387 };
383 - 388 +
384 // SALVA PROCESSO 389 // SALVA PROCESSO
385 - $scope.saveOrUpdateProcessoECM = function() {  
386 - 390 + $scope.saveOrUpdateProcessoECM = function () {
  391 +
387 // CHAMA GRAVAR DO PROCESSOCONTROLLER.JS 392 // CHAMA GRAVAR DO PROCESSOCONTROLLER.JS
388 - angular.element('#editProcessoEcm').scope().saveOrUpdate();  
389 - 393 + angular.element( '#editProcessoEcm' ).scope().saveOrUpdate();
  394 +
390 $scope.closeWidget(); 395 $scope.closeWidget();
391 $scope.atualizaProcesso(); 396 $scope.atualizaProcesso();
392 }; 397 };
393 -  
394 398
395 // ABRE A VIEW DE GERENCIAR PROCESSO ANEXO 399 // ABRE A VIEW DE GERENCIAR PROCESSO ANEXO
396 - $scope.viewProcessoAnexo = function (processoViewAnexo){  
397 - if(processoViewAnexo != null){  
398 -  
399 - var pagina = '/cit-ecm-web/html/gerenciarProcesso/gerenciarProcessoView.html';  
400 -  
401 - $scope.openWorkspaceIfNotOpen($translate.instant('ECM.LABEL.PROCESSO'), pagina, 'mod-orange');  
402 -  
403 - $timeout(function() {  
404 - angular.element('#viewGerenciarProcesso').scope().getProcessoRelacionado(processoViewAnexo);  
405 -  
406 - }, 400);  
407 - }  
408 - };  
409 - //FIM  
410 - 400 + $scope.viewProcessoAnexo = function ( processoViewAnexo ) {
  401 + if ( processoViewAnexo != null ) {
  402 +
  403 + var pagina = '/cit-ecm-web/html/gerenciarProcesso/gerenciarProcessoView.html';
  404 +
  405 + $scope.openWorkspaceIfNotOpen( $translate.instant( 'ECM.LABEL.PROCESSO' ), pagina, 'mod-orange' );
  406 +
  407 + $timeout( function () {
  408 + angular.element( '#viewGerenciarProcesso' ).scope().getProcessoRelacionado( processoViewAnexo );
  409 +
  410 + }, 400 );
  411 + }
  412 + };
  413 + // FIM
  414 +
411 // FECHA WIDGET E INICIA WIDGET PADRÃO 415 // FECHA WIDGET E INICIA WIDGET PADRÃO
412 - $scope.closeWidget = function() {  
413 - angular.element("#widget-historico").scope().atualizar();  
414 - 416 + $scope.closeWidget = function () {
  417 + angular.element( "#widget-historico" ).scope().atualizar();
  418 +
415 $scope.fecharPagina(); 419 $scope.fecharPagina();
416 $scope.widgetExemploIsCollapsed = false; 420 $scope.widgetExemploIsCollapsed = false;
417 - //WIDGET PRADAO 421 + // WIDGET PRADAO
418 $scope.isHistoricoProcesso = true; 422 $scope.isHistoricoProcesso = true;
419 }; 423 };
420 -  
421 - $scope.tratimitado = function(){  
422 - UnidadeProcessoRepository.existeVinculo({'joinClass' : 'processo.id', 'id': $scope.processo.id}).then(function(result) {  
423 - if(result){  
424 - $scope.isTramitado = true;  
425 - }else{  
426 - $scope.isTramitado = false;  
427 - }  
428 - }); 424 +
  425 + $scope.tratimitado = function () {
  426 + UnidadeProcessoRepository.existeVinculo( {
  427 + 'joinClass' : 'processo.id',
  428 + 'id' : $scope.processo.id
  429 + } ).then( function ( result ) {
  430 + if ( result ) {
  431 + $scope.isTramitado = true;
  432 + } else {
  433 + $scope.isTramitado = false;
  434 + }
  435 + } );
429 }; 436 };
430 -  
431 -  
432 -  
433 - // ------------------------------EXECUTA BPE------------------------------------  
434 -  
435 - // ATUALIZAR TASK BPE  
436 - $scope.updateTask = function(complete) {  
437 - if ($scope.updateAction && (!$scope.flowAction || !$scope.flowAction.id)) {  
438 - $scope.showAlert("error", $translate.instant('ESI.MSG.SELECIONE_ACAO')); 437 +
  438 + // ------------------------------EXECUTA BPE------------------------------------
  439 +
  440 + // ATUALIZAR TASK BPE
  441 + $scope.updateTask = function ( complete ) {
  442 + if ( $scope.updateAction && ( !$scope.flowAction || !$scope.flowAction.id ) ) {
  443 + $scope.showAlert( "error", $translate.instant( 'ESI.MSG.SELECIONE_ACAO' ) );
439 return; 444 return;
440 } 445 }
441 446
442 -  
443 // Executa regras criadas 447 // Executa regras criadas
444 - if ($scope.businessRule && $scope.businessRule != '') { 448 + if ( $scope.businessRule && $scope.businessRule != '' ) {
445 $scope.buildBusinessRuleVariables(); 449 $scope.buildBusinessRuleVariables();
446 - $scope[$scope.businessRule] = undefined;  
447 - RuntimeManagerRepository.executeBusinessRule($scope.businessRule, $scope.businessRuleVariables).then(function(result) {  
448 - $scope[$scope.businessRule] = result.originalElement.businessRule;  
449 - if ($scope[$scope.businessRule] && $scope[$scope.businessRule].valid) {  
450 - $scope.execute(complete);  
451 - }  
452 - });  
453 - }else{  
454 - $scope.execute(complete); 450 + $scope[ $scope.businessRule ] = undefined;
  451 + RuntimeManagerRepository.executeBusinessRule( $scope.businessRule, $scope.businessRuleVariables ).then( function ( result ) {
  452 + $scope[ $scope.businessRule ] = result.originalElement.businessRule;
  453 + if ( $scope[ $scope.businessRule ] && $scope[ $scope.businessRule ].valid ) {
  454 + $scope.execute( complete );
  455 + }
  456 + } );
  457 + } else {
  458 + $scope.execute( complete );
455 } 459 }
456 - 460 +
457 }; 461 };
458 - 462 +
459 // FIM 463 // FIM
460 464
461 - $scope.hasTaskVariable = function(name) {  
462 - for (var i = 0; i < $scope.taskVariables.length; i++) {  
463 - if ($scope.taskVariables[i].name == name) { 465 + $scope.hasTaskVariable = function ( name ) {
  466 + for ( var i = 0; i < $scope.taskVariables.length; i++ ) {
  467 + if ( $scope.taskVariables[ i ].name == name ) {
464 return true; 468 return true;
465 } 469 }
466 } 470 }
467 return false; 471 return false;
468 }; 472 };
469 -  
470 - 473 +
471 // EXCUTA TAREFA BPE 474 // EXCUTA TAREFA BPE
472 - $scope.execute = function(complete) {  
473 - $scope.setLoading(true,$translate.instant('ESI.EXECUTANDO_TAREFA')+" "+$scope.task.flowElement.name);  
474 - $scope.runtimeManagerUtils.executeCode("beforeUpdate"); 475 + $scope.execute = function ( complete ) {
  476 + $scope.setLoading( true, $translate.instant( 'ESI.EXECUTANDO_TAREFA' ) + " " + $scope.task.flowElement.name );
  477 + $scope.runtimeManagerUtils.executeCode( "beforeUpdate" );
475 478
476 - var idRetorno = ESI_RETURN+$scope.flowName;  
477 - var idParam = ESI_PARAM+$scope.flowName;  
478 - $scope[idParam] = new RuntimeEnvironmentInput($scope.flowName,$scope.taskVariables);  
479 - $scope[idParam].workItemId = $scope.task.id;  
480 - $scope[idParam].updateFlowAction = $scope.updateAction; 479 + var idRetorno = ESI_RETURN + $scope.flowName;
  480 + var idParam = ESI_PARAM + $scope.flowName;
  481 + $scope[ idParam ] = new RuntimeEnvironmentInput( $scope.flowName, $scope.taskVariables );
  482 + $scope[ idParam ].workItemId = $scope.task.id;
  483 + $scope[ idParam ].updateFlowAction = $scope.updateAction;
481 484
482 // ADICIONA ACÃO DO FLUXO NO SCOPO 485 // ADICIONA ACÃO DO FLUXO NO SCOPO
483 - if ($scope.updateAction) {  
484 - $scope[idParam].flowAction = $scope.flowAction; 486 + if ( $scope.updateAction ) {
  487 + $scope[ idParam ].flowAction = $scope.flowAction;
485 } 488 }
486 489
487 - $scope[idRetorno] = new RuntimeEnvironmentOutput(null); 490 + $scope[ idRetorno ] = new RuntimeEnvironmentOutput( null );
488 491
489 - RuntimeManagerRepository.updateTask($scope[idParam], complete).then(function(result) {  
490 - $scope[idRetorno] = new RuntimeEnvironmentOutput(result.originalElement);  
491 - $scope.runtimeManagerUtils.setObjectValues($scope[idRetorno]); 492 + RuntimeManagerRepository.updateTask( $scope[ idParam ], complete ).then( function ( result ) {
  493 + $scope[ idRetorno ] = new RuntimeEnvironmentOutput( result.originalElement );
  494 + $scope.runtimeManagerUtils.setObjectValues( $scope[ idRetorno ] );
492 495
493 $scope.processInstance = result.originalElement.processInstance; 496 $scope.processInstance = result.originalElement.processInstance;
494 497
495 - $scope.runtimeManagerUtils.saveDocuments($scope[idRetorno].processInstance, $scope.task); 498 + $scope.runtimeManagerUtils.saveDocuments( $scope[ idRetorno ].processInstance, $scope.task );
496 499
497 - $scope.runtimeManagerUtils.executeCode("afterUpdate");  
498 - $scope.setLoading(false); 500 + $scope.runtimeManagerUtils.executeCode( "afterUpdate" );
  501 + $scope.setLoading( false );
499 $scope.showExecuteButton = false; 502 $scope.showExecuteButton = false;
500 - if ($scope.callbackFunction != null) 503 + if ( $scope.callbackFunction != null )
501 $scope.callbackFunction(); 504 $scope.callbackFunction();
502 $rootScope.controllerScope.fetchResult(); 505 $rootScope.controllerScope.fetchResult();
503 - if ($scope.removeWorkspace) 506 + if ( $scope.removeWorkspace )
504 $scope.close(); 507 $scope.close();
505 - $scope.showAlert("success","ESI.MSG.TAREFA_EXECUTADA","");  
506 -  
507 - }); 508 + $scope.showAlert( "success", "ESI.MSG.TAREFA_EXECUTADA", "" );
  509 +
  510 + } );
508 }; 511 };
509 - 512 +
510 // FIM 513 // FIM
511 -  
512 - $scope.close = function() {  
513 - var workspace = angular.element('#searchGerenciarProcesso').scope().workspace;  
514 - if (workspace) {  
515 - angular.element("#citapp-controller").scope().removeWorkspace(workspace.id);  
516 - }  
517 - };  
518 -  
519 - 514 +
  515 + $scope.close = function () {
  516 + var workspace = angular.element( '#searchGerenciarProcesso' ).scope().workspace;
  517 + if ( workspace ) {
  518 + angular.element( "#citapp-controller" ).scope().removeWorkspace( workspace.id );
  519 + }
  520 + };
  521 +
520 // RETORNA VARIAVEIS DA TASK BPE 522 // RETORNA VARIAVEIS DA TASK BPE
521 - $scope.buildTaskVariables = function() {  
522 - if ($scope.task.flowElement.variables) {  
523 - for (var i = 0; i < $scope.task.flowElement.variables.length; i++) {  
524 - var taskVariable = $scope.task.flowElement.variables[i];  
525 - if (taskVariable.output) {  
526 - if ($scope[taskVariable.flowVariable.variable.name] != undefined && !$scope.hasTaskVariable(taskVariable.flowVariable.variable.name)) {  
527 - $scope.taskVariables.push(new RuntimeVariable(taskVariable.flowVariable.variable.name , taskVariable.flowVariable.variable.variableType, $scope[taskVariable.flowVariable.variable.name]));  
528 - } 523 + $scope.buildTaskVariables = function () {
  524 + if ( $scope.task.flowElement.variables ) {
  525 + for ( var i = 0; i < $scope.task.flowElement.variables.length; i++ ) {
  526 + var taskVariable = $scope.task.flowElement.variables[ i ];
  527 + if ( taskVariable.output ) {
  528 + if ( $scope[ taskVariable.flowVariable.variable.name ] != undefined && !$scope.hasTaskVariable( taskVariable.flowVariable.variable.name ) ) {
  529 + $scope.taskVariables.push( new RuntimeVariable( taskVariable.flowVariable.variable.name, taskVariable.flowVariable.variable.variableType,
  530 + $scope[ taskVariable.flowVariable.variable.name ] ) );
529 } 531 }
530 } 532 }
531 - };  
532 - }; 533 + }
  534 + }
  535 + ;
  536 + };
533 // FIM 537 // FIM
534 -  
535 - // METODOS DE INICIACAO DO BPE  
536 - $scope.initialize = function() {  
537 - $scope.setLoading(true);  
538 538
539 - RuntimeManagerRepository.initializeUserTask($scope.task.id).then(function(result) {  
540 - $scope.task = result.originalElement.workItem;  
541 -  
542 - //VERIFICA SE A TASK(WORKITEM) JÁ FOI EXECULTADO  
543 - if ($scope.task.status == 'CANCELLED' || $scope.task.status == 'COMPLETED') {  
544 - $scope.setLoading(false);  
545 - $scope.showAlert('error', $translate.instant('ESI.MSG.TAREFA_JA_EXECUTADA'));  
546 - return ;  
547 - }  
548 -  
549 - // COLOCA AS VARIAVEIS DE RETORNO NO SCOPO  
550 - $scope.runtimeManagerUtils = new RuntimeManagerUtils($scope, $scope, $translate, RuntimeManagerRepository);  
551 - var idRetorno = ESI_RETURN+$scope.task.processInstance.id;  
552 - $scope[idRetorno] = new RuntimeEnvironmentOutput(result.originalElement);  
553 - $scope.runtimeManagerUtils.setObjectValues($scope[idRetorno]);  
554 - // FIM  
555 -  
556 - //VERIFICA SE EXISTE MAIS DE UMA AÇÃO NA EXECUÇÃO DO WORK ITEM  
557 - $scope.updateAction = $scope.task.flowElement.actions && $scope.task.flowElement.actions.length > 0;  
558 - if ($scope.task.flowElement.actions.length == 1) {  
559 - $scope.flowAction = $scope.task.flowElement.actions[0];  
560 - }  
561 - $scope.siglas = [];  
562 -  
563 -  
564 - // CARREGA O PROCESSO VINCULADO A TAREFA  
565 - $timeout(function(){  
566 - // console.log('idProcesso:' + $scope.idProcesso);  
567 - ProcessoRepository.get($scope.idProcesso).then(function(result) {  
568 - $scope.processo = result.originalElement;  
569 -  
570 - CredencialProcessoRepository.obterCredencialUsuarioLogado($scope.idProcesso).then(function(result) {  
571 - $scope.credencialUsuarioProcesso = result.originalElement;  
572 - });  
573 -  
574 - if ($scope.$parent != undefined) {  
575 - $scope.$parent.idProcesso = $scope.idProcesso;  
576 - }  
577 -  
578 - if (angular.element('#viewGerenciarProcesso').scope() != undefined) {  
579 - var workspace = angular.element('#viewGerenciarProcesso').scope().workspace;  
580 - angular.element("#citapp-controller").scope().removeWorkspace(workspace.id);  
581 - }  
582 -  
583 - $scope.tratimitado();  
584 -  
585 - $scope.setLoading(false);  
586 - });  
587 -  
588 - }, 400);  
589 - });  
590 - };  
591 - // FIM EXECUTAR BPE  
592 -  
593 - if($scope.task != null){  
594 - $scope.initialize();  
595 - } 539 + // METODOS DE INICIACAO DO BPE
  540 + $scope.initialize = function () {
  541 + $scope.setLoading( true );
596 542
597 - $scope.getProcesso = function(processo){ 543 + RuntimeManagerRepository.initializeUserTask( $scope.task.id ).then( function ( result ) {
  544 + $scope.task = result.originalElement.workItem;
598 545
599 - $scope.setLoadingGet(true);  
600 -  
601 - $scope.isHistoricoProcesso = true;  
602 -  
603 - $scope.processo = processo;  
604 - $scope.idProcesso = $scope.processo.id; 546 + // VERIFICA SE A TASK(WORKITEM) JÁ FOI EXECULTADO
  547 + if ( $scope.task.status == 'CANCELLED' || $scope.task.status == 'COMPLETED' ) {
  548 + $scope.setLoading( false );
  549 + $scope.showAlert( 'error', $translate.instant( 'ESI.MSG.TAREFA_JA_EXECUTADA' ) );
  550 + return;
  551 + }
605 552
606 - $scope.setLoading(false); 553 + // COLOCA AS VARIAVEIS DE RETORNO NO SCOPO
  554 + $scope.runtimeManagerUtils = new RuntimeManagerUtils( $scope, $scope, $translate, RuntimeManagerRepository );
  555 + var idRetorno = ESI_RETURN + $scope.task.processInstance.id;
  556 + $scope[ idRetorno ] = new RuntimeEnvironmentOutput( result.originalElement );
  557 + $scope.runtimeManagerUtils.setObjectValues( $scope[ idRetorno ] );
  558 + // FIM
  559 +
  560 + // VERIFICA SE EXISTE MAIS DE UMA AÇÃO NA EXECUÇÃO DO WORK ITEM
  561 + $scope.updateAction = $scope.task.flowElement.actions && $scope.task.flowElement.actions.length > 0;
  562 + if ( $scope.task.flowElement.actions.length == 1 ) {
  563 + $scope.flowAction = $scope.task.flowElement.actions[ 0 ];
  564 + }
  565 + $scope.siglas = [];
607 566
608 - };  
609 - 567 + // CARREGA O PROCESSO VINCULADO A TAREFA
  568 + $timeout( function () {
610 569
611 -}]); 570 + ProcessoRepository.get( $scope.idProcesso ).then( function ( result ) {
  571 + $scope.processo = result.originalElement;
  572 + $scope.apresentarCabecalho = true;
  573 + $scope.processo.idTask = $scope.task.id;
  574 +
  575 + if ( $scope.$parent != undefined ) {
  576 + $scope.$parent.idProcesso = $scope.idProcesso;
  577 + }
  578 +
  579 + if ( angular.element( '#viewGerenciarProcesso' ).scope() != undefined ) {
  580 + var workspace = angular.element( '#viewGerenciarProcesso' ).scope().workspace;
  581 + angular.element( "#citapp-controller" ).scope().removeWorkspace( workspace.id );
  582 + }
  583 +
  584 + $scope.tratimitado();
  585 +
  586 + $scope.setLoading( false );
  587 + } );
  588 +
  589 + }, 400 );
  590 + } );
  591 + };
  592 + // FIM EXECUTAR BPE
  593 +
  594 + if ( $scope.task != null ) {
  595 + $scope.initialize();
  596 + }
  597 +
  598 + $scope.getProcesso = function ( processo ) {
  599 +
  600 + $scope.setLoadingGet( true );
  601 +
  602 + $scope.isHistoricoProcesso = true;
  603 +
  604 + $scope.processo = processo;
  605 + $scope.idProcesso = $scope.processo.id;
  606 +
  607 + $scope.setLoading( false );
  608 +
  609 + };
  610 +
  611 +}] );
cit-ecm-web/src/main/webapp/assets/js/angular/custom/repository/CredencialProcessoRepository.js
@@ -17,10 +17,14 @@ citApp.factory(&#39;CredencialProcessoRepository&#39;, [&#39;RestangularEcm&#39;, &#39;AbstractRepos @@ -17,10 +17,14 @@ citApp.factory(&#39;CredencialProcessoRepository&#39;, [&#39;RestangularEcm&#39;, &#39;AbstractRepos
17 return restangularEcm.one(this.route).getList("findCredenciaisHerdadas", {idProcesso : idProcesso}).then(); 17 return restangularEcm.one(this.route).getList("findCredenciaisHerdadas", {idProcesso : idProcesso}).then();
18 }; 18 };
19 19
20 - this.obterCredencialUsuarioLogado = function(idProcesso) {  
21 - return restangularEcm.one(this.route + "/obterCredencialUsuarioLogado").get({idProcesso : idProcesso}); 20 + this.findByIdProcesso = function(idProcesso) {
  21 + return restangularEcm.one(this.route).getList("findByIdProcesso", {idProcesso : idProcesso}).then();
22 }; 22 };
23 23
  24 + this.renunciar = function (idProcesso) {
  25 + return restangularEcm.one(this.route + "/renunciar", idProcesso).remove();
  26 + };
  27 +
24 } 28 }
25 29
26 AbstractRepository.extend(CredencialProcessoRepository); 30 AbstractRepository.extend(CredencialProcessoRepository);
cit-ecm-web/src/main/webapp/assets/js/angular/custom/repository/ProcessoRepository.js
@@ -13,9 +13,19 @@ citApp.factory(&#39;ProcessoRepository&#39;, [&#39;RestangularEcm&#39;, &#39;AbstractRepository&#39;, fu @@ -13,9 +13,19 @@ citApp.factory(&#39;ProcessoRepository&#39;, [&#39;RestangularEcm&#39;, &#39;AbstractRepository&#39;, fu
13 return restangularEcm.one(this.route + "/concluir").get(paramsGet); 13 return restangularEcm.one(this.route + "/concluir").get(paramsGet);
14 }; 14 };
15 15
  16 +
16 this.atualizarSigiloProcesso = function(paramsGet) { 17 this.atualizarSigiloProcesso = function(paramsGet) {
17 return restangularEcm.all(this.route + '/atualizarSigiloProcesso').post(paramsGet); 18 return restangularEcm.all(this.route + '/atualizarSigiloProcesso').post(paramsGet);
18 }; 19 };
  20 +
  21 + this.getProcessoByIdProcessInstance = function (idProcessInstance){
  22 + return restangularEcm.one(this.route + '/getProcessoByIdProcessInstance').get({"idProcessInstance": idProcessInstance}).then();
  23 + };
  24 +
  25 + this.getProcessoByProtocolo = function (nup){
  26 + return restangularEcm.one(this.route + '/getProcessoByProtocolo').get({"nup": nup}).then();
  27 +
  28 + };
19 } 29 }
20 30
21 AbstractRepository.extend(ProcessoRepository); 31 AbstractRepository.extend(ProcessoRepository);
cit-ecm-web/src/main/webapp/html/credencialProcesso/credencialProcesso.html
@@ -1,212 +0,0 @@ @@ -1,212 +0,0 @@
1 -  
2 -<div ng-controller="CredencialProcessoController as credencialProcessoController">  
3 - <form name="credencialProcessoController.credenciarProcessoForm" novalidate autocomplete="off">  
4 -  
5 - <div id="widget-credenciarProcesso" class="widget-box margin-bottom">  
6 - <div class="widget-header">  
7 - <h2 class="widget-title">  
8 - <translate>ECM.LABEL.GERENCIAR_CREDENCIAIS_ACESSO</translate>  
9 - </h2>  
10 -  
11 - <div class="widget-toolbar">  
12 - <a href="#void" ng-click="closeWidget('widget-credenciarProcesso')"> <i class="fa fa-close"></i>  
13 - </a>  
14 - </div>  
15 - </div>  
16 - <div class="widget-main clearfix">  
17 - <div id="credencialProcessoEdit" class="page-content clearfix">  
18 -  
19 - <p>  
20 - <small>( <span class="red">*</span> ) <translate>LABEL.CAMPOS_OBRIGATORIOS</translate></small>  
21 - </p>  
22 -  
23 - <fieldset>  
24 - <legend>  
25 - <label ng-class="{'has-error' : credenciarProcessoForm.$submitted && credencialProcessoList.length < 1}"> <translate>ECM.LABEL.CREDENCIAR_USUARIO_GRUPO</translate> <span class='red'>*</span>  
26 - <i ng-show="credenciarProcessoForm.$submitted && credencialProcessoList.length < 1" class='fa fa-warning red'  
27 - tooltip="{{$translate.instant('ECM.LABEL.CREDENCIAR_USUARIO_GRUPO') + ' ' +$translate.instant('LABEL.CAMPO_OBRIGATORIO')}}" tooltip-placement='top'></i>  
28 - </label>  
29 - </legend>  
30 -  
31 -  
32 - <div class="row">  
33 -  
34 - <div class="col-md-8">  
35 - <auto-complete ng-id="credencialProcesso.grupoUsuario" ng-label="ECM.LABEL.USUARIO_GRUPO" ng-model="credencialProcesso.grupoUsuario" ng-find="findAutoCompleteGrupoUsuario(value)"  
36 - ng-item="item.nome" />  
37 - </div>  
38 -  
39 - <div class="col-sm-4">  
40 - <label-input-checkbox ng-id="credencialProcesso.permiteCredenciar" ng-model="credencialProcesso.permiteCredenciar" ng-label="ECM.LABEL.PODE_CREDENCIAR"></label-input-checkbox>  
41 - </div>  
42 -  
43 - </div>  
44 -  
45 - <div class="row">  
46 -  
47 - <div class="col-md-12">  
48 - <div class="row">  
49 - <div class="col-sm-12">  
50 - <div class="panel panel-default">  
51 - <div class="panel-heading clearfix">  
52 - <button title="{{$translate.instant('LABEL.ADICIONAR')}}" alt="{{$translate.instant('LABEL.ADICIONAR')}}" class="btn btn-clear" ng-click="addCredencial()"  
53 - ng-disabled="!credencialProcesso.grupoUsuario.id" type="button">  
54 - <i class="fa fa-plus-circle yellow-dark"></i>  
55 - <translate>LABEL.ADICIONAR</translate>  
56 - </a>  
57 - </button>  
58 -  
59 - <button type="button" class="btn btn-clear" ng-disabled="!credencialProcessoChecked" ng-click="editCredencial();">  
60 - <i class="fa fa-pencil blue"></i>  
61 - <translate>LABEL.EDITAR</translate>  
62 - </button>  
63 -  
64 - <button class="btn btn-clear" type="button" ng-click="exibirDialogRemocao()" ng-if="permiteRemoverCredencial">  
65 - <i class="fa fa-times red"></i>  
66 - <translate>LABEL.REMOVER</translate>  
67 - </button>  
68 - </div>  
69 - <table class="table table-striped table-bordered table-hover">  
70 - <thead>  
71 - <tr>  
72 - <th width="5%" class="text-center"></th>  
73 - <th width="5%" class="text-center"></th>  
74 - <th width="35%" class="text-center"><translate>LABEL.NOME</translate></th>  
75 - <th width="20%" class="text-center"><translate>LABEL.UNIDADE</translate></th>  
76 - <th width="20%" class="text-center"><translate>ECM.LABEL.PODE_CREDENCIAR</translate></th>  
77 -  
78 - </tr>  
79 - </thead>  
80 - <tbody>  
81 - <tr ng-repeat="credencialProcesso in credenciais">  
82 -  
83 - <td class="text-center"><input type="radio" name="credencialProcessoChecked" ng-click="verificarPermissaoRemover()" ng-value="credencialProcesso" ng-model="$parent.credencialProcessoChecked" /></td>  
84 - <td class="text-center"><i class="{{credencialProcesso.icon}}" title="{{credencialProcesso.grupo ? $translate.instant('LABEL.GRUPO') : $translate.instant('LABEL.USUARIO')}}"></i></td>  
85 - <td class="text-center">{{credencialProcesso.grupo.nome}}{{credencialProcesso.usuario.username}}</td>  
86 - <td class="text-center">{{credencialProcesso.usuario.unidade.nome}}</td>  
87 - <td class="text-center">{{credencialProcesso.permiteCredenciar ? $translate.instant('LABEL.SIM') : $translate.instant('LABEL.NAO')}}</td>  
88 -  
89 - </tr>  
90 - <tr ng-hide="credenciais.length > 0">  
91 - <td colspan="5" class="text-center"><translate>LABEL.TABELA_VAZIA</translate></td>  
92 - </tr>  
93 - </tbody>  
94 - </table>  
95 - </div>  
96 - </div>  
97 - </div>  
98 - </div>  
99 - </div>  
100 -  
101 - </fieldset>  
102 -  
103 - <fieldset>  
104 -  
105 - <legend>  
106 - <translate>ECM.LABEL.HERANCA_SISTEMA</translate>  
107 - </legend>  
108 -  
109 - <div class="col-md-12">  
110 - <div class="row">  
111 - <div class="col-sm-12">  
112 - <div class="panel panel-default">  
113 - <div class="panel-heading clearfix"></div>  
114 - <table class="table table-striped table-bordered table-hover">  
115 - <thead>  
116 - <tr>  
117 - <th class="text-center"><translate>ECM.LABEL.USUARIO_GRUPO</translate></th>  
118 - <th class="text-center"><translate>LABEL.UNIDADE</translate></th>  
119 - </tr>  
120 - </thead>  
121 - <tbody>  
122 - <tr ng-repeat="hecanca in herdadas">  
123 - <td class="text-center">{{hecanca.nome}}</td>  
124 - <td class="text-center">{{hecanca.nomeUnidade}}</td>  
125 - </tr>  
126 - <tr ng-hide="historicos.length > 0">  
127 - <td colspan="2" class="text-center"><translate>LABEL.TABELA_VAZIA</translate></td>  
128 - </tr>  
129 - </tbody>  
130 - </table>  
131 - </div>  
132 - </div>  
133 - </div>  
134 - </div>  
135 -  
136 - </fieldset>  
137 -  
138 - <div class="row">  
139 - <div class="col-md-12">  
140 - <button class="btn btn-sm btn-primary" ng-click="saveOrUpdate()" type="button">  
141 - <translate>LABEL.SALVAR</translate>  
142 - </button>  
143 -  
144 - <button class="btn btn-sm btn-primary" ng-click="closeWidget('widget-credenciarProcesso')" type="button">  
145 - <translate>LABEL.CANCELAR</translate>  
146 - </button>  
147 - </div>  
148 - </div>  
149 - </div>  
150 - </div>  
151 - </div>  
152 -  
153 - <div id="widget-historicoCredenciarProcesso" class="widget-box margin-bottom">  
154 - <div class="widget-header">  
155 - <h2 class="widget-title">  
156 - <translate>ECM.LABEL.HISTORICO_CREDENCIAL</translate>  
157 - </h2>  
158 -  
159 - <div class="widget-toolbar">  
160 - <a href="#void" ng-click="closeWidget('widget-historicoCredenciarProcesso')"> <i class="fa fa-close"></i> <a href="#void"  
161 - ng-click="widgetCredencialProcessoIsCollapsed = !widgetCredencialProcessoIsCollapsed"> <i class="fa"  
162 - ng-class="{'fa-chevron-up': !widgetCredencialProcessoIsCollapsed, 'fa-chevron-down': widgetCredencialProcessoIsCollapsed}"></i>  
163 - </a>  
164 - </div>  
165 - </div>  
166 - <div id="metadadosDocumentoGedCollapsed" collapse="widgetCredencialProcessoIsCollapsed" class="widget-body">  
167 - <div class="widget-main clearfix">  
168 - <div id="historicoCredencialProcesso" class="page-content clearfix">  
169 - <div class="col-md-12">  
170 - <div class="row">  
171 - <div class="col-sm-12">  
172 - <div class="panel panel-default">  
173 - <div class="panel-heading clearfix"></div>  
174 - <table class="table table-striped table-bordered table-hover">  
175 - <thead>  
176 - <tr>  
177 - <th class="text-center"><translate>ECM.LABEL.USUARIO_GRUPO</translate></th>  
178 - <th class="text-center"><translate>LABEL.UNIDADE</translate></th>  
179 - <th class="text-center"><translate>ECM.LABEL.CREDENCIADOR</translate></th>  
180 - <th class="text-center"><translate>ECM.LABEL.CREDENCIADO_EM</translate></th>  
181 - <th class="text-center"><translate>ECM.LABEL.DESCREDENCIADOR</translate></th>  
182 - <th class="text-center"><translate>ECM.LABEL.DATA_DESCREDENCIAMENTO</translate></th>  
183 - </tr>  
184 - </thead>  
185 - <tbody>  
186 - <tr ng-repeat="historicoCredencialProcesso in historicos">  
187 -  
188 - <td class="text-center">{{historicoCredencialProcesso.credencialProcesso.grupo.nome}} {{historicoCredencialProcesso.credencialProcesso.usuario.username}}</td>  
189 - <td class="text-center">{{historicoCredencialProcesso.unidadeUsuarioCredenciado}}</td>  
190 - <td class="text-center">{{historicoCredencialProcesso.credencialProcesso.autor.username}}</td>  
191 - <td class="text-center">{{historicoCredencialProcesso.credencialProcesso.dataCriacao | date:'dd-MM-yyyy HH:mm'}}</td>  
192 - <td class="text-center">{{historicoCredencialProcesso.descredenciador.username}}</td>  
193 - <td class="text-center">{{historicoCredencialProcesso.dataDescredenciado | date:'dd-MM-yyyy HH:mm'}}</td>  
194 -  
195 - </tr>  
196 - <tr ng-hide="historicos.length > 0">  
197 - <td colspan="6" class="text-center"><translate>LABEL.TABELA_VAZIA</translate></td>  
198 - </tr>  
199 - </tbody>  
200 - </table>  
201 - </div>  
202 - </div>  
203 - </div>  
204 - </div>  
205 - </div>  
206 - </div>  
207 - </div>  
208 - </div>  
209 -  
210 - </form>  
211 -  
212 -</div>  
cit-ecm-web/src/main/webapp/html/credencialProcesso/credencialProcesso.jsp 0 → 100644
@@ -0,0 +1,211 @@ @@ -0,0 +1,211 @@
  1 +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
  2 +<%@taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>
  3 +
  4 +<div ng-controller="CredencialProcessoController as credencialProcessoController">
  5 + <form name="credencialProcessoController.credenciarProcessoForm" novalidate autocomplete="off">
  6 +
  7 + <div id="widget-credenciarProcesso" class="widget-box margin-bottom">
  8 + <div class="widget-header">
  9 + <h2 class="widget-title">
  10 + <translate>ECM.LABEL.GERENCIAR_CREDENCIAIS_ACESSO</translate>
  11 + </h2>
  12 +
  13 + <div class="widget-toolbar">
  14 + <a href="#void" ng-click="closeWidget('widget-credenciarProcesso')"> <i class="fa fa-close"></i>
  15 + </a>
  16 + </div>
  17 + </div>
  18 + <div class="widget-main clearfix">
  19 + <div id="credencialProcessoEdit" class="page-content clearfix">
  20 +
  21 + <p>
  22 + <small>( <span class="red">*</span> ) <translate>LABEL.CAMPOS_OBRIGATORIOS</translate></small>
  23 + </p>
  24 +
  25 + <fieldset>
  26 + <legend>
  27 + <label ng-class="{'has-error' : credenciarProcessoForm.$submitted && credencialProcessoList.length < 1}"> <translate>ECM.LABEL.CREDENCIAR_USUARIO_GRUPO</translate> <span class='red'>*</span>
  28 + <i ng-show="credenciarProcessoForm.$submitted && credencialProcessoList.length < 1" class='fa fa-warning red'
  29 + tooltip="{{$translate.instant('ECM.LABEL.CREDENCIAR_USUARIO_GRUPO') + ' ' +$translate.instant('LABEL.CAMPO_OBRIGATORIO')}}" tooltip-placement='top'></i>
  30 + </label>
  31 + </legend>
  32 +
  33 +
  34 + <div class="row">
  35 +
  36 + <div class="col-md-8">
  37 + <auto-complete ng-id="credencialProcesso.grupoUsuario" ng-label="ECM.LABEL.USUARIO_GRUPO" ng-model="credencialProcesso.grupoUsuario" ng-find="findAutoCompleteGrupoUsuario(value)"
  38 + ng-item="item.nome" />
  39 + </div>
  40 +
  41 + <div class="col-sm-4">
  42 + <label-input-checkbox ng-id="credencialProcesso.permiteCredenciar" ng-model="credencialProcesso.permiteCredenciar" ng-label="ECM.LABEL.PODE_CREDENCIAR"></label-input-checkbox>
  43 + </div>
  44 +
  45 + </div>
  46 +
  47 + <div class="row">
  48 +
  49 + <div class="col-md-12">
  50 + <div class="row">
  51 + <div class="col-sm-12">
  52 + <div class="panel panel-default">
  53 + <div class="panel-heading clearfix">
  54 + <button title="{{$translate.instant('LABEL.ADICIONAR')}}" alt="{{$translate.instant('LABEL.ADICIONAR')}}" class="btn btn-clear" ng-click="addCredencial()"
  55 + ng-disabled="!credencialProcesso.grupoUsuario.id" type="button">
  56 + <i class="fa fa-plus-circle yellow-dark"></i>
  57 + <translate>LABEL.ADICIONAR</translate>
  58 + </a>
  59 + </button>
  60 +
  61 + </div>
  62 + <table class="table table-striped table-bordered table-hover">
  63 + <thead>
  64 + <tr>
  65 + <th width="5%" class="text-center"></th>
  66 + <th width="35%" class="text-center"><translate>LABEL.NOME</translate></th>
  67 + <th width="20%" class="text-center"><translate>LABEL.UNIDADE</translate></th>
  68 + <th width="20%" class="text-center"><translate>ECM.LABEL.PODE_CREDENCIAR</translate></th>
  69 + <th width="10%" class="text-center"><translate>LABEL.ACOES</translate></th>
  70 + </tr>
  71 + </thead>
  72 + <tbody>
  73 + <tr ng-repeat="credencialProcesso in credenciais">
  74 +
  75 + <td class="text-center"><i class="{{credencialProcesso.icon}}" title="{{credencialProcesso.grupo ? $translate.instant('LABEL.GRUPO') : $translate.instant('LABEL.USUARIO')}}"></i></td>
  76 + <td class="text-center">{{credencialProcesso.grupo.nome}}{{credencialProcesso.usuario.username}}</td>
  77 + <td class="text-center">{{credencialProcesso.usuario.unidade.nome}}</td>
  78 + <td class="text-center">{{credencialProcesso.permiteCredenciar ? $translate.instant('LABEL.SIM') : $translate.instant('LABEL.NAO')}}</td>
  79 + <td class="text-center">
  80 + <button class="btn btn-clear" type="button" ng-if="!credencialProcesso.id || credencialProcesso.permiteEdicao" title="{{$translate.instant('LABEL.REMOVER')}}" ng-click="exibirDialogRemocao(credencialProcesso)">
  81 + <i class="fa fa-times red"></i>
  82 + </button>
  83 + <button type="button" class="btn btn-clear" ng-if="!credencialProcesso.id || credencialProcesso.permiteEdicao" title="{{$translate.instant('LABEL.EDITAR')}}" ng-click="editCredencial(credencialProcesso);">
  84 + <i class="fa fa-pencil blue"></i>
  85 + </button>
  86 + </td>
  87 +
  88 + </tr>
  89 + <tr ng-hide="credenciais.length > 0">
  90 + <td colspan="5" class="text-center"><translate>LABEL.TABELA_VAZIA</translate></td>
  91 + </tr>
  92 + </tbody>
  93 + </table>
  94 + </div>
  95 + </div>
  96 + </div>
  97 + </div>
  98 + </div>
  99 +
  100 + </fieldset>
  101 +
  102 + <fieldset>
  103 +
  104 + <legend>
  105 + <translate>ECM.LABEL.HERANCA_SISTEMA</translate>
  106 + </legend>
  107 +
  108 + <div class="col-md-12">
  109 + <div class="row">
  110 + <div class="col-sm-12">
  111 + <div class="panel panel-default">
  112 + <div class="panel-heading clearfix"></div>
  113 + <table class="table table-striped table-bordered table-hover">
  114 + <thead>
  115 + <tr>
  116 + <th class="text-center"><translate>ECM.LABEL.USUARIO_GRUPO</translate></th>
  117 + <th class="text-center"><translate>LABEL.UNIDADE</translate></th>
  118 + </tr>
  119 + </thead>
  120 + <tbody>
  121 + <tr ng-repeat="hecanca in herdadas">
  122 + <td class="text-center">{{hecanca.nome}}</td>
  123 + <td class="text-center">{{hecanca.nomeUnidade}}</td>
  124 + </tr>
  125 + <tr ng-hide="historicos.length > 0">
  126 + <td colspan="2" class="text-center"><translate>LABEL.TABELA_VAZIA</translate></td>
  127 + </tr>
  128 + </tbody>
  129 + </table>
  130 + </div>
  131 + </div>
  132 + </div>
  133 + </div>
  134 +
  135 + </fieldset>
  136 +
  137 + <div class="row">
  138 + <div class="col-md-12">
  139 + <button class="btn btn-sm btn-primary" ng-click="saveOrUpdate()" type="button" ng-disabled="credencialProcesso.grupoUsuario.id || credenciais.length == 0">
  140 + <translate>LABEL.SALVAR</translate>
  141 + </button>
  142 +
  143 + <button class="btn btn-sm btn-primary" ng-click="closeWidget('widget-credenciarProcesso')" type="button">
  144 + <translate>LABEL.CANCELAR</translate>
  145 + </button>
  146 + </div>
  147 + </div>
  148 + </div>
  149 + </div>
  150 + </div>
  151 +
  152 + <div id="widget-historicoCredenciarProcesso" class="widget-box margin-bottom">
  153 + <div class="widget-header">
  154 + <h2 class="widget-title">
  155 + <translate>ECM.LABEL.HISTORICO_CREDENCIAL</translate>
  156 + </h2>
  157 +
  158 + <div class="widget-toolbar">
  159 + <a href="#void" ng-click="closeWidget('widget-historicoCredenciarProcesso')"> <i class="fa fa-close"></i> <a href="#void"
  160 + ng-click="widgetCredencialProcessoIsCollapsed = !widgetCredencialProcessoIsCollapsed"> <i class="fa"
  161 + ng-class="{'fa-chevron-up': !widgetCredencialProcessoIsCollapsed, 'fa-chevron-down': widgetCredencialProcessoIsCollapsed}"></i>
  162 + </a>
  163 + </div>
  164 + </div>
  165 + <div id="metadadosDocumentoGedCollapsed" collapse="widgetCredencialProcessoIsCollapsed" class="widget-body">
  166 + <div class="widget-main clearfix">
  167 + <div id="historicoCredencialProcesso" class="page-content clearfix">
  168 + <div class="col-md-12">
  169 + <div class="row">
  170 + <div class="col-sm-12">
  171 + <div class="panel panel-default">
  172 + <div class="panel-heading clearfix"></div>
  173 + <table class="table table-striped table-bordered table-hover">
  174 + <thead>
  175 + <tr>
  176 + <th class="text-center"><translate>ECM.LABEL.USUARIO_GRUPO</translate></th>
  177 + <th class="text-center"><translate>LABEL.UNIDADE</translate></th>
  178 + <th class="text-center"><translate>ECM.LABEL.CREDENCIADOR</translate></th>
  179 + <th class="text-center"><translate>ECM.LABEL.CREDENCIADO_EM</translate></th>
  180 + <th class="text-center"><translate>ECM.LABEL.DESCREDENCIADOR</translate></th>
  181 + <th class="text-center"><translate>ECM.LABEL.DATA_DESCREDENCIAMENTO</translate></th>
  182 + </tr>
  183 + </thead>
  184 + <tbody>
  185 + <tr ng-repeat="historicoCredencialProcesso in historicos">
  186 +
  187 + <td class="text-center">{{historicoCredencialProcesso.credencialProcesso.grupo.nome}} {{historicoCredencialProcesso.credencialProcesso.usuario.username}}</td>
  188 + <td class="text-center">{{historicoCredencialProcesso.unidadeUsuarioCredenciado}}</td>
  189 + <td class="text-center">{{historicoCredencialProcesso.credencialProcesso.autor.username}}</td>
  190 + <td class="text-center">{{historicoCredencialProcesso.credencialProcesso.dataCriacao | date:'dd-MM-yyyy HH:mm'}}</td>
  191 + <td class="text-center">{{historicoCredencialProcesso.descredenciador.username}}</td>
  192 + <td class="text-center">{{historicoCredencialProcesso.dataDescredenciado | date:'dd-MM-yyyy HH:mm'}}</td>
  193 +
  194 + </tr>
  195 + <tr ng-hide="historicos.length > 0">
  196 + <td colspan="6" class="text-center"><translate>LABEL.TABELA_VAZIA</translate></td>
  197 + </tr>
  198 + </tbody>
  199 + </table>
  200 + </div>
  201 + </div>
  202 + </div>
  203 + </div>
  204 + </div>
  205 + </div>
  206 + </div>
  207 + </div>
  208 +
  209 + </form>
  210 +
  211 +</div>
cit-ecm-web/src/main/webapp/html/documentoGed/documentoAnexoVisualizacao.html
@@ -16,14 +16,6 @@ @@ -16,14 +16,6 @@
16 <div collapse="widgetAnexoIsCollapsed" class="widget-body"> 16 <div collapse="widgetAnexoIsCollapsed" class="widget-body">
17 <div class="widget-main clearfix"> 17 <div class="widget-main clearfix">
18 <div id="anexoGed" class="page-content clearfix"> 18 <div id="anexoGed" class="page-content clearfix">
19 - <div class="row">  
20 - <div class="col-md-4">  
21 - <div class="form-group">  
22 - <label class='control-label'><translate>ECM.LABEL.DATA_REFERENCIA</translate></label>  
23 - <label>{{documentoGed.dataReferencia | date:'dd-MM-yyyy'}}</label>  
24 - </div>  
25 - </div>  
26 - </div>  
27 <div class="row" ng-show='documentoGed.anexo.id && !edit'> 19 <div class="row" ng-show='documentoGed.anexo.id && !edit'>
28 <div class="col-sm-6"> 20 <div class="col-sm-6">
29 <strong><label>{{ documentoGed.anexo.descricao}}</label></strong> 21 <strong><label>{{ documentoGed.anexo.descricao}}</label></strong>
cit-ecm-web/src/main/webapp/html/documentoGed/documentoGedEdit.html
1 1
2 <div ng-controller="DocumentoGedController as documentoGedController"> 2 <div ng-controller="DocumentoGedController as documentoGedController">
3 <form name="documentoGedController.documentoGedForm" novalidate autocomplete="off"> 3 <form name="documentoGedController.documentoGedForm" novalidate autocomplete="off">
4 - 4 +
5 <div ng-if="!edit"> 5 <div ng-if="!edit">
6 <div ng-include src="'/cit-ecm-web/html/documentoGed/documentoAnexoVisualizacao.html'" /> 6 <div ng-include src="'/cit-ecm-web/html/documentoGed/documentoAnexoVisualizacao.html'" />
7 7
cit-ecm-web/src/main/webapp/html/documentoGed/metadadosDocumentoEdit.html
@@ -5,9 +5,8 @@ @@ -5,9 +5,8 @@
5 </h2> 5 </h2>
6 6
7 <div class="widget-toolbar"> 7 <div class="widget-toolbar">
8 - <a href="#void" ng-click="widgetDocumentoIsCollapsed = !widgetDocumentoIsCollapsed">  
9 - <i class="fa" ng-class="{'fa-chevron-up': !widgetDocumentoIsCollapsed, 'fa-chevron-down': widgetDocumentoIsCollapsed}"></i></a>  
10 - <a href="#void" ng-click="closeWidget('widget-processo')"> <i class="fa fa-close"></i></a> 8 + <a href="#void" ng-click="widgetDocumentoIsCollapsed = !widgetDocumentoIsCollapsed"> <i class="fa"
  9 + ng-class="{'fa-chevron-up': !widgetDocumentoIsCollapsed, 'fa-chevron-down': widgetDocumentoIsCollapsed}"></i></a> <a href="#void" ng-click="closeWidget('widget-processo')"> <i class="fa fa-close"></i></a>
11 </div> 10 </div>
12 </div> 11 </div>
13 <div id="metadadosDocumentoGedCollapsed" collapse="widgetDocumentoIsCollapsed" class="widget-body"> 12 <div id="metadadosDocumentoGedCollapsed" collapse="widgetDocumentoIsCollapsed" class="widget-body">
@@ -36,12 +35,8 @@ @@ -36,12 +35,8 @@
36 35
37 </div> 36 </div>
38 </div> 37 </div>
39 - 38 +
40 <div class="row"> 39 <div class="row">
41 - <div class="col-md-4">  
42 - <label-input ng-id="documentoGed.numero" ng-label="LABEL.NUMERO" ng-type="numerico" ng-model="documentoGed.numero" form="documentoGedForm" ng-obrigatorio="documentoGed.formaCriacao.codigo == 2"  
43 - ng-custom-maxlength="255" ng-type="text" ng-disabled="!edit || documentoGed.formaCriacao.codigo == 1" />  
44 - </div>  
45 40
46 <div class="col-md-8"> 41 <div class="col-md-8">
47 <auto-complete ng-id="documentoGed.tipoDocumento" ng-set-result="construirRelacionamento(item)" ng-label="ECM.LABEL.TIPODOCUMENTO" ng-model="documentoGed.tipoDocumento" form="documentoGedForm" 42 <auto-complete ng-id="documentoGed.tipoDocumento" ng-set-result="construirRelacionamento(item)" ng-label="ECM.LABEL.TIPODOCUMENTO" ng-model="documentoGed.tipoDocumento" form="documentoGedForm"
@@ -52,6 +47,22 @@ @@ -52,6 +47,22 @@
52 </div> 47 </div>
53 48
54 <div class="row"> 49 <div class="row">
  50 + <div class="col-md-4">
  51 + <label-input ng-id="documentoGed.numero" ng-label="LABEL.NUMERO" ng-type="numerico" ng-model="documentoGed.numero" form="documentoGedForm" ng-obrigatorio="documentoGed.formaCriacao.codigo == 2"
  52 + ng-custom-maxlength="255" ng-type="text" ng-disabled="!edit || documentoGed.formaCriacao.codigo == 1" />
  53 + </div>
  54 +
  55 + <div class="row" ng-show='documentoGed.formaCriacao.codigo == 2'>
  56 + <div class="col-md-4">
  57 + <label-input-data ng-id="documentoGed.dataReferencia" form="documentoGedForm" ng-label="ECM.LABEL.DATA_REFERENCIA" ng-obrigatorio="documentoGed.formaCriacao.codigo == 2" ng-disabled="!edit"
  58 + ng-model="documentoGed.dataReferencia" />
  59 + </div>
  60 + </div>
  61 + </div>
  62 +
  63 +
  64 +
  65 + <div class="row">
55 66
56 <div class="col-md-4"> 67 <div class="col-md-4">
57 <label-select ng-id="documentoGed.status" ng-model="documentoGed.status" ng-label="ECM.LABEL.STATUS" ng-obrigatorio='true' form="documentoGedForm" ng-list="statusList" 68 <label-select ng-id="documentoGed.status" ng-model="documentoGed.status" ng-label="ECM.LABEL.STATUS" ng-obrigatorio='true' form="documentoGedForm" ng-list="statusList"
@@ -153,7 +164,8 @@ @@ -153,7 +164,8 @@
153 <div class="row"> 164 <div class="row">
154 165
155 <div class="col-md-10"> 166 <div class="col-md-10">
156 - <auto-complete ng-id="interessado" ng-label="ECM.LABEL.INTERESSADO" ng-disabled="!edit" form='documentoGedForm' ng-model="interessado" ng-find="findAutoCompleteInteressados(value)" ng-item="item.nome" ng-set-result="setInteressados(item)" /> 167 + <auto-complete ng-id="interessado" ng-label="ECM.LABEL.INTERESSADO" ng-disabled="!edit" form='documentoGedForm' ng-model="interessado" ng-find="findAutoCompleteInteressados(value)"
  168 + ng-item="item.nome" ng-set-result="setInteressados(item)" />
157 </div> 169 </div>
158 170
159 <div class="col-md-12"> 171 <div class="col-md-12">
@@ -176,9 +188,8 @@ @@ -176,9 +188,8 @@
176 </thead> 188 </thead>
177 <tbody> 189 <tbody>
178 <tr ng-repeat="interessado in documentoGed.interessados"> 190 <tr ng-repeat="interessado in documentoGed.interessados">
179 - <td class="text-center">  
180 - <input type="radio" name="interessadoChecked" id="interessadoChecked" ng-value="interessado" ng-model="$parent.interessadoChecked" ng-click="setInteressadoRemocao(interessado, $index)" />  
181 - </td> 191 + <td class="text-center"><input type="radio" name="interessadoChecked" id="interessadoChecked" ng-value="interessado" ng-model="$parent.interessadoChecked"
  192 + ng-click="setInteressadoRemocao(interessado, $index)" /></td>
182 193
183 <td class="text-center">{{interessado.interessado.nome}}</td> 194 <td class="text-center">{{interessado.interessado.nome}}</td>
184 195
@@ -219,13 +230,6 @@ @@ -219,13 +230,6 @@
219 </label> 230 </label>
220 </legend> 231 </legend>
221 232
222 - <div class="row">  
223 - <div class="col-md-6">  
224 - <label-input-data ng-id="documentoGed.dataReferencia" form="documentoGedForm" ng-label="ECM.LABEL.DATA_REFERENCIA" ng-obrigatorio="documentoGed.formaCriacao.codigo == 2" ng-disabled="!edit"  
225 - ng-model="documentoGed.dataReferencia" />  
226 - </div>  
227 - </div>  
228 -  
229 <div class="row" style="padding: 0px 12px 0px 12px !important;" ng-show='uploader.queue < 1 && !documentoGed.anexo.id'> 233 <div class="row" style="padding: 0px 12px 0px 12px !important;" ng-show='uploader.queue < 1 && !documentoGed.anexo.id'>
230 <div nv-file-drop="" uploader="uploader" id="actionUploadArquivos" onclick="$('#uploadArquivos').click();"> 234 <div nv-file-drop="" uploader="uploader" id="actionUploadArquivos" onclick="$('#uploadArquivos').click();">
231 <div nv-file-over="" uploader="uploader" over-class="another-file-over-class" class="well my-drop-zone"> 235 <div nv-file-over="" uploader="uploader" over-class="another-file-over-class" class="well my-drop-zone">
cit-ecm-web/src/main/webapp/html/gerenciarProcesso/gerenciarProcessoList.html
1 <div id="searchGerenciarProcesso" class="page-content" ng-controller="GerenciarProcessoController"> 1 <div id="searchGerenciarProcesso" class="page-content" ng-controller="GerenciarProcessoController">
2 2
3 - <div id="cabecalhoGerenciarProcesso"> 3 + <div id="cabecalhoGerenciarProcesso" ng-if="apresentarCabecalho">
4 <div class="bar-buttons-action fixed"> 4 <div class="bar-buttons-action fixed">
5 <div class="row"> 5 <div class="row">
6 <div class="col-sm-12 text-left"> 6 <div class="col-sm-12 text-left">
7 - <div ng-include src="'/cit-ecm-web/html/gerenciarProcesso/includeCabecalhoGerenciarProcesso.html'" /> </div> 7 + <div ng-include src="urlCabecalho" /> </div>
8 8
9 </div> 9 </div>
10 </div> 10 </div>
11 </div> 11 </div>
12 - 12 +
13 <div id="informacaoProcesso"> 13 <div id="informacaoProcesso">
14 <div class="row"> 14 <div class="row">
15 <div class="col-md-12"> 15 <div class="col-md-12">
cit-ecm-web/src/main/webapp/html/gerenciarProcesso/includeAcaoProcesso.html
1 -  
2 - <div ng-include src="'/cit-ecm-web/html/processoRelacionado/processoRelacionadoEdit.html'" ng-if="isProcessoRelacionado" />  
3 1
4 - <div ng-include src="'/cit-ecm-web/html/documentoGed/documentoGedEdit.html'" ng-show="isDocumentoEdit" /> 2 +<div ng-include src="'/cit-ecm-web/html/processoRelacionado/processoRelacionadoEdit.html'" ng-show="isProcessoRelacionado" />
5 3
6 - <div ng-include src="'/cit-ecm-web/html/grupoProcesso/enviarProcesso.html'" ng-if="isEnviarProcesso" /> 4 +<div ng-include src="'/cit-ecm-web/html/documentoGed/documentoGedEdit.html'" ng-show="isDocumentoEdit" />
7 5
8 - <div ng-include src="'/cit-ecm-web/html/anexarProcesso/anexarProcesso.html'" ng-if="isAnexarProcesso" /> 6 +<div ng-include src="'/cit-ecm-web/html/grupoProcesso/enviarProcesso.html'" ng-show="isEnviarProcesso" />
9 7
10 - <div ng-include src="'/cit-ecm-web/html/versaoDocumentoGed/versaoDocumentoGedList.html'" ng-if="isVersoesDocumento" /> 8 +<div ng-include src="'/cit-ecm-web/html/anexarProcesso/anexarProcesso.html'" ng-show="isAnexarProcesso" />
11 9
12 - <div ng-include src="'/cit-ecm-web/html/historicoAlteracaoProcesso/historicoAlteracaoProcesso.html'" ng-show="isHistoricoProcesso" /> 10 +<div ng-include src="'/cit-ecm-web/html/versaoDocumentoGed/versaoDocumentoGedList.html'" ng-show="isVersoesDocumento" />
13 11
14 - <div ng-include src="'/cit-ecm-web/html/documentoGed/cancelarDocumento.html'" ng-if="isCancelarDocumento" /> 12 +<div ng-include src="'/cit-ecm-web/html/historicoAlteracaoProcesso/historicoAlteracaoProcesso.html'" ng-show="isHistoricoProcesso" />
15 13
16 - <div ng-include src="'/cit-ecm-web/html/justificativaProcesso/justificativaAcaoProcesso.html'" ng-if="isJustificativaAcaoProcesso" /> 14 +<div ng-include src="'/cit-ecm-web/html/documentoGed/cancelarDocumento.html'" ng-show="isCancelarDocumento" />
17 15
18 - <div ng-include src="'/cit-ecm-web/html/justificativaProcesso/justificativaAcaoProcessoList.html'" ng-if="isHistoricoJustificativa" />  
19 -  
20 - <div ng-include src="'/cit-ecm-web/html/credencialProcesso/credencialProcesso.html'" ng-show="isGerenciarCredencialProcesso" /> 16 +<div ng-include src="'/cit-ecm-web/html/justificativaProcesso/justificativaAcaoProcesso.html'" ng-show="isJustificativaAcaoProcesso" />
21 17
22 - <div ng-include src="'/cit-ecm-web/html/classificarProcessoDocumento/classificarProcessoDocumento.html'" ng-if="isClassificarProcessoDocumento" /> 18 +<div ng-include src="'/cit-ecm-web/html/justificativaProcesso/justificativaAcaoProcessoList.html'" ng-show="isHistoricoJustificativa" />
23 19
24 - 20 +<div ng-include src="'/cit-ecm-web/html/credencialProcesso/credencialProcesso.jsp'" ng-show="isGerenciarCredencialProcesso" />
25 21
26 - <div id="widget-processo" ng-show="isProcessoEdit" class="widget-box margin-bottom">  
27 - <div class="widget-header">  
28 - <h2 class="widget-title">  
29 - <translate>ECM.LABEL.PROCESSO</translate>  
30 - </h2> 22 +<div ng-include src="'/cit-ecm-web/html/classificarProcessoDocumento/classificarProcessoDocumento.html'" ng-show="isClassificarProcessoDocumento" />
31 23
32 - <div class="widget-toolbar">  
33 - <a href="#void" ng-click="closeWidget('widget-processo')"> <i class="fa fa-close"></i>  
34 - </a>  
35 - </div>  
36 - </div>  
37 - <div class="widget-body">  
38 - <div class="widget-main clearfix">  
39 - <div ng-include src="'/cit-ecm-web/html/processo/processoEdit.html'" />  
40 - </div>  
41 - </div>  
42 24
43 - <div class="row">  
44 - <div style="margin-top: -38px; margin-left: 17px;" class="col-md-12">  
45 - <button class="btn btn-sm btn-primary" ng-click="saveOrUpdateProcessoECM()" ng-show="true">  
46 - <translate>LABEL.SALVAR</translate>  
47 - </button>  
48 25
49 - <button class="btn btn-sm btn-primary" ng-click="closeWidget('widget-processo')" ng-show="true">  
50 - <translate>LABEL.CANCELAR</translate>  
51 - </button>  
52 - </div>  
53 - </div>  
54 - </div>  
55 \ No newline at end of file 26 \ No newline at end of file
  27 +<div id="widget-processo" ng-show="isProcessoEdit" class="widget-box margin-bottom">
  28 + <div class="widget-header">
  29 + <h2 class="widget-title">
  30 + <translate>ECM.LABEL.PROCESSO</translate>
  31 + </h2>
  32 +
  33 + <div class="widget-toolbar">
  34 + <a href="#void" ng-click="closeWidget('widget-processo')"> <i class="fa fa-close"></i>
  35 + </a>
  36 + </div>
  37 + </div>
  38 + <div class="widget-body">
  39 + <div class="widget-main clearfix">
  40 + <div ng-include src="'/cit-ecm-web/html/processo/processoEdit.html'" />
  41 + </div>
  42 + </div>
  43 +
  44 + <div class="row">
  45 + <div style="margin-top: -38px; margin-left: 17px;" class="col-md-12">
  46 + <button class="btn btn-sm btn-primary" ng-click="saveOrUpdateProcessoECM()" ng-show="true">
  47 + <translate>LABEL.SALVAR</translate>
  48 + </button>
  49 +
  50 + <button class="btn btn-sm btn-primary" ng-click="closeWidget('widget-processo')" ng-show="true">
  51 + <translate>LABEL.CANCELAR</translate>
  52 + </button>
  53 + </div>
  54 + </div>
  55 +</div>
56 \ No newline at end of file 56 \ No newline at end of file
cit-ecm-web/src/main/webapp/html/gerenciarProcesso/includeCabecalhoGerenciarProcesso.html
@@ -1,79 +0,0 @@ @@ -1,79 +0,0 @@
1 -  
2 - <button ng-show="task.flowElement.actions && task.flowElement.actions.length == 1" title="{{$translate.instant('ESI.EXECUCAO_TAREFA.GRAVAR_TAREFA_AVANCAR')}}"  
3 - alt="{{$translate.instant('ESI.EXECUCAO_TAREFA.GRAVAR_TAREFA_AVANCAR')}}" class="btn btn-clear" ng-click="executarProcesso(task.flowElement.actions[0])">  
4 - <i class="fa fa-play-circle green"></i>  
5 - <translate>LABEL.AVANCAR_FLUXO</translate>  
6 - </button>  
7 -  
8 - <div class="btn-group dropdown" role="group" dropdown ng-show=" task.flowElement.actions && task.flowElement.actions.length > 1">  
9 - <button type="button" class="btn btn-clear" dropdown-toggle>  
10 - <i class="fa fa-play-circle green"></i>  
11 - <translate>LABEL.AVANCAR_FLUXO</translate>  
12 - <span class="fa fa-caret-down icon-on-right"></span>  
13 - </button>  
14 -  
15 - <ul class="dropdown-menu-center dropdown-menu dropdown-caret" role="menu" ng-repeat="action in task.flowElement.actions">  
16 - <li ng-repeat="action in task.flowElement.actions"><a href="javascript: return false;" ng-click='executarProcesso(action);'><i class="fa fa-circle"> <translate>{{action.name}}</translate></i></a>  
17 - </li>  
18 -  
19 - </ul>  
20 - </div>  
21 -  
22 - <span class="divider-vertical"></span>  
23 -  
24 - <button type="button" class="btn btn-clear" ng-click="novoProcesso();">  
25 - <i class="fa fa-plus-circle yellow-dark"></i>  
26 - <translate>ECM.LABEL.NOVOPROCESSO</translate>  
27 - </button>  
28 -  
29 - <button type="button" class="btn btn-clear" ng-click="editProcessoECM()">  
30 - <i class="fa fa-pencil blue"></i>  
31 - <translate>LABEL.EDITAR</translate>  
32 - </button>  
33 -  
34 - <button type="button" class="btn btn-clear" ng-click="concluir()">  
35 - <i class="ace-icon fa fa-check green"></i>  
36 - <translate>ECM.LABEL.CONCLUIR</translate>  
37 - </button>  
38 -  
39 -  
40 - <button type="button" class="btn btn-clear" ng-click="newDocument()">  
41 - <i class="fa fa-book blue"></i>  
42 - <translate>ECM.LABEL.INCLUIRDOCUMENTO</translate>  
43 - </button>  
44 -  
45 - <span class="divider-vertical"></span>  
46 -  
47 - <div class="btn-group dropdown" role="group" dropdown>  
48 - <button type="button" class="btn btn-clear" dropdown-toggle>  
49 - <i class="fa fa-list"></i>  
50 - <translate>ECM.LABEL.ACAODEPROCESSO</translate>  
51 - <span class="fa fa-caret-down icon-on-right"></span>  
52 - </button>  
53 -  
54 - <ul class="dropdown-menu-center dropdown-menu dropdown-caret" role="menu">  
55 - <li><a href="#void" ng-click="editProcessoRelacionado();"><i class="fa fa-link"></i>  
56 - <translate>ECM.LABEL.PROCESSORELACIONADOS</translate></a></li>  
57 - <li><a href="#void" ng-click='enviarProcesso();'><i class="fa fa-share-square-o">&nbsp </i>  
58 - <translate>ECM.LABEL.ENVIAR_PROCESSO</translate> </a></li>  
59 - <li><a href="#void" ng-click='anexarProcesso();'><i class="fa fa-paperclip">&nbsp </i>  
60 - <translate>ECM.LABEL.ANEXAR_ESTE_PROCESSO</translate> </a></li>  
61 - <li><a href="#void;" ng-click='gerenciarCredenciaisProcesso();'><i class="fa fa-user-plus">&nbsp </i>  
62 - <translate>ECM.LABEL.GERENCIAR_CREDENCIAIS_ACESSO</translate> </a></li>  
63 - <li><a href="javascript: return false;" ng-click='exibirDialogConfirmacaoRemoverCredencial()' ng-if="credencialUsuarioProcesso.id"><i class="fa fa-user-plus">&nbsp </i>  
64 - <translate>ECM.LABEL.RENUNCIAR_CREDENCIAL</translate> </a></li>  
65 - <li><a href="#void" ng-click='classificarDocumentoProceso();'><i class="fa fa fa-eye">&nbsp </i>  
66 - <translate>ECM.LABEL.VALIDAR_NIVEL_ACESSO</translate> </a></li>  
67 -  
68 -  
69 - <!-- <li><a href="#void"><i class="fa fa-file-o"></i> <translate>LABEL.ENVIARCORRESPONDENCIA</translate></a></li>  
70 - <li><a href="#void"><i class="fa fa-file-o"></i> <translate>LABEL.CIENCIA</translate></a></li>  
71 - <li><a href="#void"><i class="fa fa-file-o"></i> <translate>LABEL.DUPLICARPROCESSO</translate></a></li> </a></li>  
72 - <li><a href="#void"><i class="fa fa-file-o"></i> <translate>LABEL.GERENCIARDISPONIBILIZACAOACESSOEXTERNO</translate></a></li>  
73 - <li><a href="#void"><i class="fa fa-file-o"></i> <translate>LABEL.ACOMPANHAMENTOESPECIAL</translate> </a></li>  
74 - <li><a href="#void"><i class="fa fa-file-o"></i> <translate>LABEL.ANEXARPROCESSO</translate> </a></li>  
75 - <li><a href="#void"><i class="fa fa-file-o"></i> <translate>LABEL.GERARARQUIVOPROCESSO</translate></a></li> -->  
76 - </ul>  
77 - </div>  
78 -  
79 -  
cit-ecm-web/src/main/webapp/html/gerenciarProcesso/includeCabecalhoGerenciarProcesso.jsp 0 → 100644
@@ -0,0 +1,73 @@ @@ -0,0 +1,73 @@
  1 +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
  2 +<%@taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>
  3 +
  4 +<button ng-show="task.flowElement.actions && task.flowElement.actions.length == 1" title="{{$translate.instant('ESI.EXECUCAO_TAREFA.GRAVAR_TAREFA_AVANCAR')}}"
  5 + alt="{{$translate.instant('ESI.EXECUCAO_TAREFA.GRAVAR_TAREFA_AVANCAR')}}" class="btn btn-clear" ng-click="executarProcesso(task.flowElement.actions[0])">
  6 + <i class="fa fa-play-circle green"></i>
  7 + <translate>LABEL.AVANCAR_FLUXO</translate>
  8 +</button>
  9 +
  10 +<div class="btn-group dropdown" role="group" dropdown ng-show=" task.flowElement.actions && task.flowElement.actions.length > 1">
  11 + <button type="button" class="btn btn-clear" dropdown-toggle>
  12 + <i class="fa fa-play-circle green"></i>
  13 + <translate>LABEL.AVANCAR_FLUXO</translate>
  14 + <span class="fa fa-caret-down icon-on-right"></span>
  15 + </button>
  16 +
  17 + <ul class="dropdown-menu-center dropdown-menu dropdown-caret" role="menu" ng-repeat="action in task.flowElement.actions">
  18 + <li ng-repeat="action in task.flowElement.actions"><a href="javascript: return false;" ng-click='executarProcesso(action);'><i class="fa fa-circle"> <translate>{{action.name}}</translate></i></a>
  19 + </li>
  20 +
  21 + </ul>
  22 +</div>
  23 +
  24 +<span class="divider-vertical"></span>
  25 +
  26 +<button type="button" class="btn btn-clear" ng-click="novoProcesso();">
  27 + <i class="fa fa-plus-circle yellow-dark"></i>
  28 + <translate>ECM.LABEL.NOVOPROCESSO</translate>
  29 +</button>
  30 +
  31 +<button type="button" class="btn btn-clear" ng-click="editProcessoECM()">
  32 + <i class="fa fa-pencil blue"></i>
  33 + <translate>LABEL.EDITAR</translate>
  34 +</button>
  35 +
  36 +<button type="button" class="btn btn-clear" ng-click="concluir()">
  37 + <i class="ace-icon fa fa-check green"></i>
  38 + <translate>ECM.LABEL.CONCLUIR</translate>
  39 +</button>
  40 +
  41 +
  42 +<button type="button" class="btn btn-clear" ng-click="newDocument()">
  43 + <i class="fa fa-book blue"></i>
  44 + <translate>ECM.LABEL.INCLUIRDOCUMENTO</translate>
  45 +</button>
  46 +
  47 +<span class="divider-vertical"></span>
  48 +
  49 +<div class="btn-group dropdown" role="group" dropdown>
  50 + <button type="button" class="btn btn-clear" dropdown-toggle>
  51 + <i class="fa fa-list"></i>
  52 + <translate>ECM.LABEL.ACAODEPROCESSO</translate>
  53 + <span class="fa fa-caret-down icon-on-right"></span>
  54 + </button>
  55 +
  56 + <ul class="dropdown-menu-center dropdown-menu dropdown-caret" role="menu">
  57 + <li><a href="#void" ng-click="editProcessoRelacionado();"><i class="fa fa-link"></i> <translate>ECM.LABEL.PROCESSORELACIONADOS</translate></a></li>
  58 + <li><a href="#void" ng-click='enviarProcesso();'><i class="fa fa-share-square-o">&nbsp </i> <translate>ECM.LABEL.ENVIAR_PROCESSO</translate> </a></li>
  59 + <li><a href="#void" ng-click='anexarProcesso();'><i class="fa fa-paperclip">&nbsp </i> <translate>ECM.LABEL.ANEXAR_ESTE_PROCESSO</translate> </a></li>
  60 +
  61 + <sec:authorize access="permiteCredenciar()">
  62 + <li><a href="#void;" ng-click='gerenciarCredenciaisProcesso();'><i class="fa fa-user-plus">&nbsp </i> <translate>ECM.LABEL.GERENCIAR_CREDENCIAIS_ACESSO</translate> </a></li>
  63 + </sec:authorize>
  64 +
  65 + <sec:authorize access="permiteRenunciar()">
  66 + <li><a href="javascript: return false;" ng-click='exibirDialogConfirmacaoRemoverCredencial()'><i class="fa fa-user-times">&nbsp </i> <translate>ECM.LABEL.RENUNCIAR_CREDENCIAL</translate> </a></li>
  67 + </sec:authorize>
  68 +<!-- <li><a href="#void" ng-click='classificarDocumentoProceso();'><i class="fa fa fa-eye">&nbsp </i> <translate>ECM.LABEL.VALIDAR_NIVEL_ACESSO</translate> </a></li> -->
  69 +
  70 + </ul>
  71 +</div>
  72 +
  73 +
cit-ecm-web/src/main/webapp/html/gerenciarProcesso/includeDocumentosProcesso.html
1 <div class="itemdiv commentdiv" ng-repeat="documento in processo.documentos | orderBy:'-dataCriacao'"> 1 <div class="itemdiv commentdiv" ng-repeat="documento in processo.documentos | orderBy:'-dataCriacao'">
2 2
3 - <div class="user">  
4 - <i class="{{documento.icon}}" title="{{documento.anexo.dominioTipoAnexo.descricao}}"></i> 3 + <div class="user">
  4 + <i class="{{documento.icon}}" title="{{documento.anexo.dominioTipoAnexo.descricao}}"></i>
  5 + </div>
  6 +
  7 + <div class="body">
  8 + <div class="text ellipsis" tooltip="{{documento.tipoDocumento.nome}} - {{documento.numero}}">
  9 + <a ng-show='!documento.cancelado' href="#void" ng-click="editDocument(documento, false)">{{documento.tipoDocumento.nome}} - {{documento.numero}}</a> <a ng-show='documento.cancelado' href="#void"
  10 + ng-click="getCancelamentoDocumento(documento);"> {{documento.tipoDocumento.nome}} - {{documento.numero}}</a>
5 </div> 11 </div>
6 12
7 - <div class="body">  
8 - <div class="text ellipsis" tooltip="{{documento.tipoDocumento.nome}} - {{documento.numero}}">  
9 - <a ng-show='!documento.cancelado' href="#void" ng-click="editDocument(documento, false)">{{documento.tipoDocumento.nome}} - {{documento.numero}}</a>  
10 - <a ng-show='documento.cancelado' href="#void" ng-click="getCancelamentoDocumento(documento);"> {{documento.tipoDocumento.nome}} - {{documento.numero}}</a>  
11 - </div>  
12 -  
13 - <div class="time hidden-md">  
14 - <i class="ace-icon fa fa-clock-o"></i> <span class="blue">{{documento.dataCriacao | date: 'dd/MM/yyyy HH:mm:ss'}} </span>  
15 - </div>  
16 -  
17 - <div class="text ellipsis" tooltip="{{documento.assuntoComplementar}}">{{documento.assuntoComplementar}} </div>  
18 -  
19 - <div class="itemdiv-informacoes" >  
20 - <span class="label label-gray" ng-show="documento.sigilo.tipoSigilo.codigo == 0 ">{{documento.sigilo.tipoSigilo.descricao}}</span>  
21 - <span class="label label-danger" ng-show="documento.sigilo.tipoSigilo.codigo == 1 ">{{documento.sigilo.tipoSigilo.descricao}}</span>  
22 - <span class="label label-black" ng-show="documento.sigilo.tipoSigilo.codigo == 2 ">{{documento.sigilo.tipoSigilo.descricao}}</span>  
23 - <span class="label label-warning" ng-show="documento.nivelAcesso.nivelAcesso.codigo == 1">{{documento.nivelAcesso.nivelAcesso.descricao}}</span>  
24 - <span class="label label-success" ng-show="documento.nivelAcesso.nivelAcesso.codigo == 2">{{documento.nivelAcesso.nivelAcesso.descricao}}</span>  
25 - <span class="label label-info" ng-show="documento.origem">Anexado</span> <span class="label label-info" ng-show="false">Assinado</span>  
26 - <span class="label label-success" ng-show="false">Habilitado</span> <span class="label label-warning" ng-show="false">Ci&#xEA;ncia</span>  
27 - <span class="label label-danger" ng-show="documento.cancelado">Cancelado</span>  
28 - </div> 13 + <div class="time hidden-md">
  14 + <i class="ace-icon fa fa-clock-o"></i> <span class="blue">{{documento.dataCriacao | date: 'dd/MM/yyyy HH:mm:ss'}} </span>
29 </div> 15 </div>
30 16
31 -  
32 - <div ng-if = "!isProcessoView" class="tools btn-group dropdown" role="group" dropdown > 17 + <div class="text ellipsis" tooltip="{{documento.assuntoComplementar}}">{{documento.assuntoComplementar}}</div>
  18 +
  19 + <div class="itemdiv-informacoes">
  20 + <span class="label label-gray" ng-show="documento.sigilo.tipoSigilo.codigo == 0 ">{{documento.sigilo.tipoSigilo.descricao}}</span> <span class="label label-danger"
  21 + 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>
  22 + <span class="label label-warning" ng-show="documento.nivelAcesso.nivelAcesso.codigo == 1">{{documento.nivelAcesso.nivelAcesso.descricao}}</span> <span class="label label-success"
  23 + ng-show="documento.nivelAcesso.nivelAcesso.codigo == 2">{{documento.nivelAcesso.nivelAcesso.descricao}}</span> <span class="label label-info" ng-show="documento.origem">Anexado</span> <span
  24 + 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&#xEA;ncia</span> <span
  25 + class="label label-danger" ng-show="documento.cancelado">Cancelado</span>
  26 + </div>
  27 + </div>
  28 +
  29 +
  30 + <div ng-if="!isProcessoView" class="tools btn-group dropdown" role="group" dropdown>
33 <button type="button" class="btn btn-success btn-xs" dropdown-toggle> 31 <button type="button" class="btn btn-success btn-xs" dropdown-toggle>
34 <translate>LABEL.ACOES</translate> 32 <translate>LABEL.ACOES</translate>
35 <span class="fa fa-caret-down icon-on-right"></span> 33 <span class="fa fa-caret-down icon-on-right"></span>
36 </button> 34 </button>
37 35
38 - <ul class="dropdown-menu-center dropdown-menu dropdown-caret" role="menu">  
39 - <li ng-if='!documento.cancelado'><a href="#void" ng-click="editDocument(documento, true);"><translate>LABEL.EDITAR</translate></a></li>  
40 - <li ng-if='!isTramitado || (documento.cancelado && documento.unidade.id === usuarioLogado.unidade.id) '><a href="#void" ng-click="removeDocumento(documento, $index);"><translate>LABEL.REMOVER</translate></a></li>  
41 - <li ng-if='isTramitado || (!documento.cancelado && documento.unidade.id === usuarioLogado.unidade.id)'><a href="#void" ng-click='cancelarDocumento(documento)'> <translate>LABEL.CANCELARDOCUMENTO</translate></a></li>  
42 - <li ng-if='!documento.cancelado'><a href="#void" ng-click="visualizarVersoes(documento);"> <translate>LABEL.VERSOESDODOCUMENTO</translate></a></li>  
43 - <li ng-if='documento.cancelado'><a href="#void" ng-click="getCancelamentoDocumento(documento);"> <translate>LABEL.CANCELAMENTO</translate></a></li> 36 + <ul class="dropdown-menu-center dropdown-menu dropdown-caret" role="menu">
  37 + <li ng-if='!documento.cancelado'><a href="#void" ng-click="editDocument(documento, true);"><translate>LABEL.EDITAR</translate></a></li>
  38 + <li ng-if='!isTramitado && (!documento.cancelado && documento.unidade.id === usuarioLogado.unidade.id)'><a href="#void" ng-click="removeDocumento(documento, $index);"><translate>LABEL.REMOVER</translate></a></li>
  39 + <li ng-if='isTramitado && (!documento.cancelado && documento.unidade.id === usuarioLogado.unidade.id)'><a href="#void" ng-click='cancelarDocumento(documento)'> <translate>ECM.LABEL.CANCELARDOCUMENTO</translate></a></li>
  40 + <li ng-if='!documento.cancelado'><a href="#void" ng-click="visualizarVersoes(documento);"> <translate>ECM.LABEL.VERSOESDODOCUMENTO</translate></a></li>
  41 + <li ><a ng-if='documento.cancelado'href="#void" ng-click="getCancelamentoDocumento(documento);"> <translate>ECM.LABEL.JUSTIFICATIVA_CANCELAMENTO</translate></a></li>
44 </ul> 42 </ul>
  43 +
45 </div> 44 </div>
46 </div> 45 </div>
47 \ No newline at end of file 46 \ No newline at end of file
cit-ecm-web/src/main/webapp/html/gerenciarProcesso/includeInformacaoProcesso.html
@@ -108,7 +108,7 @@ @@ -108,7 +108,7 @@
108 <div class="profile-info-value"> 108 <div class="profile-info-value">
109 <span class="label label-success" ng-show="processo.nivelAcesso.nivelAcesso.nome =='PUBLICO'">{{processo.nivelAcesso.nivelAcesso.descricao}}</span> 109 <span class="label label-success" ng-show="processo.nivelAcesso.nivelAcesso.nome =='PUBLICO'">{{processo.nivelAcesso.nivelAcesso.descricao}}</span>
110 <span class="label label-warning" ng-show="processo.nivelAcesso.nivelAcesso.nome =='RESTRITO'">{{processo.nivelAcesso.nivelAcesso.descricao}}</span> 110 <span class="label label-warning" ng-show="processo.nivelAcesso.nivelAcesso.nome =='RESTRITO'">{{processo.nivelAcesso.nivelAcesso.descricao}}</span>
111 - <span class="label label-danger" ng-show="processo.nivelAcesso.nivelAcesso.nome =='SIGILOSO'">{{processo.sigilo.descricao}}</span> 111 + <span class="label label-danger" ng-show="processo.nivelAcesso.nivelAcesso.nome =='SIGILOSO'">{{processo.sigilo.tipoSigilo.descricao}}</span>
112 112
113 </div> 113 </div>
114 </div> 114 </div>
cit-ecm-web/src/main/webapp/html/gerenciarProcessoView/gerenciarProcessoView.html
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 2
3 <div id="viewGerenciarProcesso" class="page-content" ng-controller="GerenciarProcessoViewController"> 3 <div id="viewGerenciarProcesso" class="page-content" ng-controller="GerenciarProcessoViewController">
4 <div class="bar-buttons-action fixed"> 4 <div class="bar-buttons-action fixed">
5 - <span class="divider-vertical"></span> 5 + <span class="divider-vertical"></span>
6 </div> 6 </div>
7 7
8 <div id="informacaoProcesso"> 8 <div id="informacaoProcesso">
@@ -13,18 +13,18 @@ @@ -13,18 +13,18 @@
13 <div class="widget-box margin-bottom"> 13 <div class="widget-box margin-bottom">
14 <div class="widget-header"> 14 <div class="widget-header">
15 <h2 class="widget-title"> 15 <h2 class="widget-title">
16 - <translate>LABEL.INFORMACAODOPROCESSO</translate> 16 + <translate>ECM.LABEL.INFORMACAODOPROCESSO</translate>
17 - {{processo.nup}} 17 - {{processo.nup}}
18 </h2> 18 </h2>
19 19
20 <div class="widget-toolbar"> 20 <div class="widget-toolbar">
21 - <a href="#void" ng-click="widgetExemploIsCollapsed = !widgetExemploIsCollapsed">  
22 - <i class="fa" ng-class="{'fa-chevron-up': !widgetExemploIsCollapsed, 'fa-chevron-down': widgetExemploIsCollapsed}"></i> 21 + <a href="#void" ng-click="widgetExemploIsCollapsed = !widgetExemploIsCollapsed"> <i class="fa"
  22 + ng-class="{'fa-chevron-up': !widgetExemploIsCollapsed, 'fa-chevron-down': widgetExemploIsCollapsed}"></i>
23 </a> 23 </a>
24 </div> 24 </div>
25 - </div>  
26 - <div collapse="widgetExemploIsCollapsed" class="widget-body">  
27 - <div ng-include src="'/cit-ecm-web/html/gerenciarProcesso/includeInformacaoProcesso.html'" /> 25 + </div>
  26 + <div collapse="widgetExemploIsCollapsed" class="widget-body">
  27 + <div ng-include src="'/cit-ecm-web/html/gerenciarProcesso/includeInformacaoProcesso.html'" />
28 </div> 28 </div>
29 </div> 29 </div>
30 </div> 30 </div>
@@ -39,17 +39,19 @@ @@ -39,17 +39,19 @@
39 <div class="widget-box documentos margin-bottom"> 39 <div class="widget-box documentos margin-bottom">
40 <div class="widget-header"> 40 <div class="widget-header">
41 <h2 class="widget-title"> 41 <h2 class="widget-title">
42 - <translate>LABEL.DOCUMENTOS</translate> 42 + <translate>ECM.LABEL.DOCUMENTOS</translate>
43 </h2> 43 </h2>
44 -  
45 - </div> 44 +
  45 + </div>
46 <div class="widget-body"> 46 <div class="widget-body">
47 -  
48 - 47 +
  48 +
49 <div class="widget-main clearfix"> 49 <div class="widget-main clearfix">
50 -  
51 - <div id="documentoProcesso"> <div ng-include src="'/cit-ecm-web/html/gerenciarProcesso/includeDocumentosProcesso.html'" /> </div>  
52 - 50 +
  51 + <div id="documentoProcesso">
  52 + <div ng-include src="'/cit-ecm-web/html/gerenciarProcesso/includeDocumentosProcesso.html'" />
  53 + </div>
  54 +
53 </div> 55 </div>
54 </div> 56 </div>
55 </div> 57 </div>
@@ -57,11 +59,11 @@ @@ -57,11 +59,11 @@
57 </div> 59 </div>
58 60
59 <div id="content-container" class="col-md-8"> 61 <div id="content-container" class="col-md-8">
60 - 62 +
61 <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="isDocumentoEdit" />
62 64
63 - <div ng-include src="'/cit-ecm-web/html/documentoGed/cancelarDocumentoView.html'" ng-show="isCancelarDocumento" />  
64 - 65 + <div ng-include src="'/cit-ecm-web/html/documentoGed/cancelarDocumentoView.html'" ng-show="isCancelarDocumento" />
  66 +
65 </div> 67 </div>
66 68
67 </div> 69 </div>