Commit 51d4806b36d91484923cb943086384f21bc17453

Authored by rogerio.costa
2 parents c557401c 7f85e06a
Exists in master

Merge branch 'tarefa-4393' of http://ferramentasgo.centralit.com.br:8080/scm/git…

…/cit-grp-ecm into tarefa-4393
cit-ecm-api/src/main/java/br/com/centralit/api/dao/AnexarProcessoDao.java
@@ -100,7 +100,7 @@ public interface AnexarProcessoDao extends CitGenericDAO { @@ -100,7 +100,7 @@ public interface AnexarProcessoDao extends CitGenericDAO {
100 Collection<AnexoProcesso> findByIdAnexoProcesso(Long id); 100 Collection<AnexoProcesso> findByIdAnexoProcesso(Long id);
101 101
102 102
103 - AnexoProcesso verificarUnicidadeAnexoProcesso(Long idProcessoAnexado); 103 + boolean isExisteAnexoProcesso(Long idProcessoAnexado);
104 104
105 105
106 } 106 }
cit-ecm-api/src/main/java/br/com/centralit/api/dao/impl/AnexarProcessoDaoHibernate.java
@@ -11,6 +11,7 @@ import br.com.centralit.api.dao.AnexarProcessoDao; @@ -11,6 +11,7 @@ import br.com.centralit.api.dao.AnexarProcessoDao;
11 import br.com.centralit.api.model.AnexoProcesso; 11 import br.com.centralit.api.model.AnexoProcesso;
12 import br.com.centralit.framework.dao.arquitetura.CitGenericDAOImpl; 12 import br.com.centralit.framework.dao.arquitetura.CitGenericDAOImpl;
13 import br.com.centralit.framework.dao.arquitetura.SearchSeven; 13 import br.com.centralit.framework.dao.arquitetura.SearchSeven;
  14 +import br.com.centralit.framework.util.UtilColecao;
14 15
15 /** 16 /**
16 * 17 *
@@ -103,15 +104,14 @@ public class AnexarProcessoDaoHibernate extends CitGenericDAOImpl implements Ane @@ -103,15 +104,14 @@ public class AnexarProcessoDaoHibernate extends CitGenericDAOImpl implements Ane
103 104
104 105
105 @Override 106 @Override
106 - public AnexoProcesso verificarUnicidadeAnexoProcesso(Long idProcessoAnexado) {  
107 -  
108 - SearchSeven search = new SearchSeven(persistentClass);  
109 -  
110 - search.addFilterEqual("processoAnexado.id", idProcessoAnexado);  
111 -  
112 - search(search, AnexoProcesso.class);  
113 -  
114 - return searchUnique(search); 107 + public boolean isExisteAnexoProcesso(Long idProcessoAnexado) {
  108 +
  109 + SearchSeven searchSeven = new SearchSeven();
  110 +
  111 + searchSeven.addFilterEqual("processoAnexado.id", idProcessoAnexado);
  112 +
  113 + return !UtilColecao.isVazio(this.search(searchSeven));
  114 +
115 } 115 }
116 116
117 } 117 }
cit-ecm-api/src/main/java/br/com/centralit/api/model/Processo.java
@@ -26,6 +26,7 @@ import br.com.centralit.framework.json.JsonCalendarSimpleDateDeserializer; @@ -26,6 +26,7 @@ import br.com.centralit.framework.json.JsonCalendarSimpleDateDeserializer;
26 import br.com.centralit.framework.json.JsonCalendarSimpleDateSerializer; 26 import br.com.centralit.framework.json.JsonCalendarSimpleDateSerializer;
27 import br.com.centralit.framework.json.Views; 27 import br.com.centralit.framework.json.Views;
28 import br.com.centralit.framework.model.Dominio; 28 import br.com.centralit.framework.model.Dominio;
  29 +import br.com.centralit.framework.util.UtilColecao;
29 30
30 import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 31 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
31 import com.fasterxml.jackson.annotation.JsonView; 32 import com.fasterxml.jackson.annotation.JsonView;
@@ -217,6 +218,10 @@ public class Processo extends PersistentObjectUnidade { @@ -217,6 +218,10 @@ public class Processo extends PersistentObjectUnidade {
217 @OneToMany(fetch = FetchType.LAZY, mappedBy = "processo", cascade = CascadeType.ALL) 218 @OneToMany(fetch = FetchType.LAZY, mappedBy = "processo", cascade = CascadeType.ALL)
218 private Collection<CredencialProcesso> credenciais; 219 private Collection<CredencialProcesso> credenciais;
219 220
  221 + /** Atributo unidadesProcesso. */
  222 + @OneToMany(fetch = FetchType.LAZY, mappedBy = "processo", cascade = CascadeType.ALL)
  223 + private Collection<UnidadeProcesso> unidadesProcesso;
  224 +
220 /** 225 /**
221 * Retorna o valor do atributo <code>id</code> 226 * Retorna o valor do atributo <code>id</code>
222 * 227 *
@@ -822,4 +827,41 @@ public class Processo extends PersistentObjectUnidade { @@ -822,4 +827,41 @@ public class Processo extends PersistentObjectUnidade {
822 this.aprovado = aprovado; 827 this.aprovado = aprovado;
823 } 828 }
824 829
  830 + /**
  831 + * Retorna o valor do atributo <code>unidadesProcesso</code>
  832 + *
  833 + * @return <code>Collection<UnidadeProcesso></code>
  834 + */
  835 + public Collection<UnidadeProcesso> getUnidadesProcesso() {
  836 +
  837 + return unidadesProcesso;
  838 + }
  839 +
  840 + /**
  841 + * Define o valor do atributo <code>unidadesProcesso</code>.
  842 + *
  843 + * @param unidadesProcesso
  844 + */
  845 + public void setUnidadesProcesso(Collection<UnidadeProcesso> unidadesProcesso) {
  846 +
  847 + this.unidadesProcesso = unidadesProcesso;
  848 + }
  849 +
  850 + /**
  851 + * <p><b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a></p>
  852 + *
  853 + * <p><b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a></p>
  854 + *
  855 + * Verifica se o processo foi tramitado. Levando em consideração a unidadeProcesso criada apartir da criação do processo.
  856 + *
  857 + * @author maycon.silva
  858 + *
  859 + * @return boolean
  860 + */
  861 + /*@JsonView({ Views.ProcessoEdit.class })*/
  862 + public boolean isTramitado() {
  863 +
  864 + return !UtilColecao.isVazio(this.getUnidadesProcesso()) && this.getUnidadesProcesso().size() > 1;
  865 + }
  866 +
825 } 867 }
cit-ecm-api/src/main/java/br/com/centralit/api/service/AnexoGedService.java
@@ -3,6 +3,7 @@ package br.com.centralit.api.service; @@ -3,6 +3,7 @@ package br.com.centralit.api.service;
3 import org.springframework.web.multipart.MultipartFile; 3 import org.springframework.web.multipart.MultipartFile;
4 4
5 import br.com.centralit.api.model.AnexoGed; 5 import br.com.centralit.api.model.AnexoGed;
  6 +
6 import br.com.centralit.framework.service.arquitetura.GenericService; 7 import br.com.centralit.framework.service.arquitetura.GenericService;
7 8
8 /** 9 /**
@@ -55,7 +56,7 @@ public interface AnexoGedService extends GenericService&lt;AnexoGed, Long&gt; { @@ -55,7 +56,7 @@ public interface AnexoGedService extends GenericService&lt;AnexoGed, Long&gt; {
55 * @param file 56 * @param file
56 * @param idDocumento 57 * @param idDocumento
57 */ 58 */
58 - void saveAnexo(MultipartFile file, Long idDocumento); 59 + void saveAnexo(MultipartFile file, Long idDocumentoGed);
59 60
60 /** 61 /**
61 * <p> 62 * <p>
cit-ecm-api/src/main/java/br/com/centralit/api/service/DocumentoGedService.java
@@ -39,7 +39,7 @@ public interface DocumentoGedService extends GenericService&lt;DocumentoGed, Long&gt; @@ -39,7 +39,7 @@ public interface DocumentoGedService extends GenericService&lt;DocumentoGed, Long&gt;
39 */ 39 */
40 void saveIconeDocumento(DocumentoGed documentoGed, Dominio tipoAnexo); 40 void saveIconeDocumento(DocumentoGed documentoGed, Dominio tipoAnexo);
41 41
42 - void anexarDocumento(Processo processoOrigem, AnexarProcessoVH anexarProcessoVH); 42 + void anexarDocumento(Processo processoDestinoAnexo, Processo processoOrigem);
43 43
44 Collection<DocumentoGed> findByProcessoSigilo(Long idProcesso); 44 Collection<DocumentoGed> findByProcessoSigilo(Long idProcesso);
45 45
cit-ecm-api/src/main/java/br/com/centralit/api/service/impl/AnexarProcessoServiceImpl.java
@@ -128,33 +128,35 @@ public class AnexarProcessoServiceImpl extends GenericServiceImpl&lt;AnexoProcesso, @@ -128,33 +128,35 @@ public class AnexarProcessoServiceImpl extends GenericServiceImpl&lt;AnexoProcesso,
128 128
129 Processo processoFilho = this.processoService.getReference(anexoProcesso.getProcessoAnexado().getId()); 129 Processo processoFilho = this.processoService.getReference(anexoProcesso.getProcessoAnexado().getId());
130 130
131 - if (!UtilDate.isDataMenor(processoPai.getDataCriacao().getTime(), processoFilho.getDataCriacao().getTime())) { 131 + if (UtilDate.diferencaHoras(processoPai.getDataCriacao().getTime(), processoFilho.getDataCriacao().getTime()) < 0) {
  132 +
132 listProcesso.add(processoFilho); 133 listProcesso.add(processoFilho);
133 - }  
134 -  
135 - if (!listProcesso.isEmpty()) { 134 +
  135 + }else{
  136 +
  137 + // Vincula o processo filho ao pai
  138 + this.vincularProcesso(processoPai, processoFilho);
  139 +
  140 + // Realiza o vinculo inverso, o pai vira filho e o filho vira pai.
  141 + this.vincularProcesso(processoFilho, processoPai);
  142 +
  143 +
136 if (!UtilColecao.isVazio(processoFilho.getDocumentos())) { 144 if (!UtilColecao.isVazio(processoFilho.getDocumentos())) {
137 - // Vincula o processo filho ao pai  
138 - this.vincularProcesso(processoPai, processoFilho);  
139 -  
140 - // Realiza o vinculo inverso, o pai vira filho e o filho vira pai.  
141 - this.vincularProcesso(processoFilho, processoPai);  
142 -  
143 - documentoGedService.anexarDocumento(processoFilho, anexarProcessoVH);  
144 - 145 + documentoGedService.anexarDocumento(processoPai, processoFilho);
145 } 146 }
  147 +
  148 + this.finalizeProcesso("FINALIZAR_PROCESSO_SIGAD", false, processoFilho.getIdProcessInstance());
  149 + this.processoService.atualizarTemporalidadeProcessoAnexado(processoPai, processoFilho);
146 } 150 }
147 -  
148 - this.finalizeProcesso("FINALIZAR_PROCESSO_SIGAD", false, processoFilho.getIdProcessInstance());  
149 - this.processoService.atualizarTemporalidadeProcessoAnexado(processoPai, processoFilho);  
150 -  
151 } 151 }
  152 +
152 if (!UtilColecao.isVazio(listProcesso)) { 153 if (!UtilColecao.isVazio(listProcesso)) {
153 this.validarTempoCriacaoProcesso(listProcesso, processoPai); 154 this.validarTempoCriacaoProcesso(listProcesso, processoPai);
154 return null; 155 return null;
155 } 156 }
156 157
157 } 158 }
  159 +
158 return anexarProcessoVH; 160 return anexarProcessoVH;
159 } 161 }
160 162
@@ -194,7 +196,7 @@ public class AnexarProcessoServiceImpl extends GenericServiceImpl&lt;AnexoProcesso, @@ -194,7 +196,7 @@ public class AnexarProcessoServiceImpl extends GenericServiceImpl&lt;AnexoProcesso,
194 * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> 196 * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a>
195 * </p> 197 * </p>
196 * 198 *
197 - * Método responsável por criar o vinculo do processo com processoRelacionado 199 + * Método responsável por criar o vinculo do processo com
198 * 200 *
199 * 201 *
200 * @param processoPrincipal 202 * @param processoPrincipal
@@ -346,10 +348,11 @@ public class AnexarProcessoServiceImpl extends GenericServiceImpl&lt;AnexoProcesso, @@ -346,10 +348,11 @@ public class AnexarProcessoServiceImpl extends GenericServiceImpl&lt;AnexoProcesso,
346 348
347 for (AnexoProcesso processoAnexado : anexarProcessoVH.getListaProcessoAnexado()) { 349 for (AnexoProcesso processoAnexado : anexarProcessoVH.getListaProcessoAnexado()) {
348 350
349 - AnexoProcesso anexoProcesso = this.anexarProcessoDao.verificarUnicidadeAnexoProcesso(processoAnexado.getProcessoAnexado().getId()); 351 + /*AnexoProcesso anexoProcesso = this.anexarProcessoDao.verificarUnicidadeAnexoProcesso(processoAnexado.getProcessoAnexado().getId());*/
  352 +
350 353
351 - if (anexoProcesso != null && anexoProcesso.getAnexado()) {  
352 - mensagem.append(anexoProcesso.getProcessoAnexado().getNup()).append(","); 354 + if (this.anexarProcessoDao.isExisteAnexoProcesso(processoAnexado.getProcessoAnexado().getId())) {
  355 + mensagem.append(processoAnexado.getProcessoAnexado().getNup()).append(",");
353 } 356 }
354 357
355 } 358 }
cit-ecm-api/src/main/java/br/com/centralit/api/service/impl/AnexoGedServiceImpl.java
@@ -91,7 +91,7 @@ public class AnexoGedServiceImpl extends GenericServiceImpl&lt;AnexoGed, Long&gt; impl @@ -91,7 +91,7 @@ public class AnexoGedServiceImpl extends GenericServiceImpl&lt;AnexoGed, Long&gt; impl
91 91
92 if (UtilObjeto.isReferencia(multipartFile)) { 92 if (UtilObjeto.isReferencia(multipartFile)) {
93 93
94 - DocumentoGed documentoGed = this.documentoGedService.getReference(idDocumento); 94 + DocumentoGed documentoGed = this.documentoGedService.find(idDocumento);
95 95
96 StringBuilder sb = new StringBuilder(); 96 StringBuilder sb = new StringBuilder();
97 97
cit-ecm-api/src/main/java/br/com/centralit/api/service/impl/DocumentoGedServiceImpl.java
@@ -5,6 +5,7 @@ import java.io.FileInputStream; @@ -5,6 +5,7 @@ import java.io.FileInputStream;
5 import java.security.Key; 5 import java.security.Key;
6 import java.util.Calendar; 6 import java.util.Calendar;
7 import java.util.Collection; 7 import java.util.Collection;
  8 +import java.util.LinkedList;
8 import java.util.List; 9 import java.util.List;
9 10
10 import javax.crypto.Cipher; 11 import javax.crypto.Cipher;
@@ -33,7 +34,6 @@ import br.com.centralit.api.service.ProcessoService; @@ -33,7 +34,6 @@ import br.com.centralit.api.service.ProcessoService;
33 import br.com.centralit.api.service.SigiloService; 34 import br.com.centralit.api.service.SigiloService;
34 import br.com.centralit.api.service.SolrService; 35 import br.com.centralit.api.service.SolrService;
35 import br.com.centralit.api.service.TipoDocumentoService; 36 import br.com.centralit.api.service.TipoDocumentoService;
36 -import br.com.centralit.api.viewHelper.AnexarProcessoVH;  
37 import br.com.centralit.framework.exception.BusinessException; 37 import br.com.centralit.framework.exception.BusinessException;
38 import br.com.centralit.framework.exception.CodigoErro; 38 import br.com.centralit.framework.exception.CodigoErro;
39 import br.com.centralit.framework.model.Dominio; 39 import br.com.centralit.framework.model.Dominio;
@@ -572,6 +572,7 @@ public class DocumentoGedServiceImpl extends GenericServiceImpl&lt;DocumentoGed, Lo @@ -572,6 +572,7 @@ public class DocumentoGedServiceImpl extends GenericServiceImpl&lt;DocumentoGed, Lo
572 572
573 this.validarEntidade(entity, this.validator); 573 this.validarEntidade(entity, this.validator);
574 AnexoGed anexo = null; 574 AnexoGed anexo = null;
  575 +
575 if (entity.getAnexo() != null) { 576 if (entity.getAnexo() != null) {
576 anexo = this.anexoGedService.getReference(entity.getAnexo().getId()); 577 anexo = this.anexoGedService.getReference(entity.getAnexo().getId());
577 } 578 }
@@ -770,12 +771,12 @@ public class DocumentoGedServiceImpl extends GenericServiceImpl&lt;DocumentoGed, Lo @@ -770,12 +771,12 @@ public class DocumentoGedServiceImpl extends GenericServiceImpl&lt;DocumentoGed, Lo
770 * @param anexarProcessoVH 771 * @param anexarProcessoVH
771 */ 772 */
772 @Override 773 @Override
773 - public void anexarDocumento(Processo processoOrigem, AnexarProcessoVH anexarProcessoVH) { 774 + public void anexarDocumento(Processo processoDestinoAnexo, Processo processoOrigem) {
774 775
775 if (!UtilColecao.isVazio(processoOrigem.getDocumentos())) { 776 if (!UtilColecao.isVazio(processoOrigem.getDocumentos())) {
776 777
777 for (DocumentoGed documentoGedOrigem : processoOrigem.getDocumentos()) { 778 for (DocumentoGed documentoGedOrigem : processoOrigem.getDocumentos()) {
778 - vincularAnexo(documentoGedOrigem, anexarProcessoVH, processoOrigem); 779 + vincularAnexo(documentoGedOrigem, processoDestinoAnexo, processoOrigem);
779 } 780 }
780 } 781 }
781 782
@@ -836,19 +837,12 @@ public class DocumentoGedServiceImpl extends GenericServiceImpl&lt;DocumentoGed, Lo @@ -836,19 +837,12 @@ public class DocumentoGedServiceImpl extends GenericServiceImpl&lt;DocumentoGed, Lo
836 * @param documentoGedOrigem 837 * @param documentoGedOrigem
837 * @param anexarProcessoVH 838 * @param anexarProcessoVH
838 */ 839 */
839 - private void vincularAnexo(DocumentoGed documentoGedOrigem, AnexarProcessoVH anexarProcessoVH, Processo processoOrigem) { 840 + private void vincularAnexo(DocumentoGed documentoGedOrigem, Processo processoDestinoAnexo, Processo processoOrigem) {
840 841
841 - Processo processoDestinoAnexo = this.processoService.getReference(anexarProcessoVH.getProcesso().getId()); 842 +/* Processo processoDestinoAnexo = this.processoService.getReference(anexarProcessoVH.getProcesso().getId());*/
842 843
843 - AnexoGed anexo = null;  
844 -  
845 - if (documentoGedOrigem.getFormaCriacao() != null && !documentoGedOrigem.getFormaCriacao().getCodigo().equals(1L)) {  
846 -  
847 - if (documentoGedOrigem.getAnexo() != null) {  
848 - anexo = this.anexoGedService.getReference(documentoGedOrigem.getAnexo().getId());  
849 - } 844 + AnexoGed anexoDocumentoOrigem = null;
850 845
851 - }  
852 846
853 DocumentoGed documentoGed = new DocumentoGed(); 847 DocumentoGed documentoGed = new DocumentoGed();
854 848
@@ -859,20 +853,36 @@ public class DocumentoGedServiceImpl extends GenericServiceImpl&lt;DocumentoGed, Lo @@ -859,20 +853,36 @@ public class DocumentoGedServiceImpl extends GenericServiceImpl&lt;DocumentoGed, Lo
859 documentoGed.setAnexo(null); 853 documentoGed.setAnexo(null);
860 documentoGed.setId(null); 854 documentoGed.setId(null);
861 855
862 - if (UtilColecao.isVazio(documentoGed.getInteressados())) { 856 + if (!UtilColecao.isVazio(documentoGedOrigem.getInteressados())) {
863 857
864 - documentoGed.setInteressados(null); 858 + documentoGed.setInteressados(new LinkedList<InteressadoDocumento>());
865 859
  860 + //Monta os dados do novo interessado para o novo documento.
  861 + for(InteressadoDocumento interessadoDocumento : documentoGedOrigem.getInteressados()){
  862 +
  863 + InteressadoDocumento interessadoDocumentoDestino = new InteressadoDocumento();
  864 + interessadoDocumentoDestino.setInteressado(interessadoDocumento.getInteressado());
  865 + interessadoDocumentoDestino.setDocumentoGed(documentoGed);
  866 + documentoGed.getInteressados().add(interessadoDocumentoDestino);
  867 + }
  868 +
866 } 869 }
867 870
868 documentoGed = super.save(documentoGed); 871 documentoGed = super.save(documentoGed);
869 872
  873 + if (documentoGedOrigem.getFormaCriacao() != null && !documentoGedOrigem.getFormaCriacao().getCodigo().equals(1L)) {
  874 +
  875 + if (documentoGedOrigem.getAnexo() != null) {
  876 + anexoDocumentoOrigem = this.anexoGedService.getReference(documentoGedOrigem.getAnexo().getId());
  877 + }
  878 + }
  879 +
870 try { 880 try {
871 - if (anexo != null) {  
872 - File file = this.gedFileService.restoreFile(anexo); 881 + if (anexoDocumentoOrigem != null) {
  882 + File file = this.gedFileService.restoreFile(anexoDocumentoOrigem);
873 file.length(); 883 file.length();
874 FileInputStream input = new FileInputStream(file); 884 FileInputStream input = new FileInputStream(file);
875 - MultipartFile multipartFile = new MockMultipartFile("file", anexo.getDescricao(), "text/plain", IOUtils.toByteArray(input)); 885 + MultipartFile multipartFile = new MockMultipartFile("file", anexoDocumentoOrigem.getDescricao(), "text/plain", IOUtils.toByteArray(input));
876 886
877 this.anexoGedService.saveAnexo(multipartFile, documentoGed.getId()); 887 this.anexoGedService.saveAnexo(multipartFile, documentoGed.getId());
878 } 888 }
cit-ecm-api/src/main/java/br/com/centralit/api/viewHelper/AnexarProcessoVH.java
@@ -55,7 +55,7 @@ public class AnexarProcessoVH implements Serializable { @@ -55,7 +55,7 @@ public class AnexarProcessoVH implements Serializable {
55 @JsonView({ Views.AnexarProcesso.class }) 55 @JsonView({ Views.AnexarProcesso.class })
56 private Collection<AnexoProcesso> listRemoverAnexado; 56 private Collection<AnexoProcesso> listRemoverAnexado;
57 57
58 - /** Atributo Proceso. */ 58 + /** Atributo Proceso Pai */
59 @JsonView({ Views.AnexarProcesso.class }) 59 @JsonView({ Views.AnexarProcesso.class })
60 private Processo processo; 60 private Processo processo;
61 61
cit-ecm-web/src/main/webapp/assets/js/angular/custom/controller/AnexarProcessoController.js
@@ -59,7 +59,8 @@ citApp.controller(&#39;AnexarProcessoController&#39;, [&#39;$scope&#39;, &#39;UnidadeProcessoReposit @@ -59,7 +59,8 @@ citApp.controller(&#39;AnexarProcessoController&#39;, [&#39;$scope&#39;, &#39;UnidadeProcessoReposit
59 //Buscar processo através do nup 59 //Buscar processo através do nup
60 $scope.findAutoCompleteProcesso = function(value){ 60 $scope.findAutoCompleteProcesso = function(value){
61 return ProcessoRepository.findAutoComplete('nup', value).then(function(result) { 61 return ProcessoRepository.findAutoComplete('nup', value).then(function(result) {
62 - return $filter('idNotEqualProcessoAnexadoAndProcessoPai')(result, $scope.anexarProcessoVH.listaProcessoAnexado, $scope.$parent.$parent.processo); 62 +
  63 + return $filter('idNotEqualProcessoAnexadoAndProcessoPai')(result, $scope.anexarProcessoVH.listaProcessoAnexado, $scope.$parent.$parent.processo);
63 }); 64 });
64 }; 65 };
65 66
cit-ecm-web/src/main/webapp/assets/js/angular/custom/controller/GerenciarProcessoController.js
@@ -460,15 +460,10 @@ citApp.controller(&#39;GerenciarProcessoController&#39;, [ &#39;$scope&#39;, &#39;$translate&#39;, &#39;$tim @@ -460,15 +460,10 @@ citApp.controller(&#39;GerenciarProcessoController&#39;, [ &#39;$scope&#39;, &#39;$translate&#39;, &#39;$tim
460 }; 460 };
461 461
462 $scope.tratimitado = function () { 462 $scope.tratimitado = function () {
463 - UnidadeProcessoRepository.existeVinculo( {  
464 - 'joinClass' : 'processo.id',  
465 - 'id' : $scope.processo.id  
466 - } ).then( function ( result ) { 463 + UnidadeProcessoRepository.existeVinculo( { 'joinClass' : 'processo.id', 'id' : $scope.processo.id } ).then( function ( result ) {
467 if ( result ) { 464 if ( result ) {
468 $scope.isTramitado = true; 465 $scope.isTramitado = true;
469 - } else {  
470 - $scope.isTramitado = false;  
471 - } 466 + }
472 } ); 467 } );
473 }; 468 };
474 469
cit-ecm-web/src/main/webapp/html/anexarProcesso/anexarProcesso.html
@@ -89,47 +89,6 @@ @@ -89,47 +89,6 @@
89 </div> 89 </div>
90 </fieldset> 90 </fieldset>
91 91
92 - <!-- <fieldset>  
93 -  
94 - <legend>  
95 - <translate>LABEL.HISTORICO_DE_ANEXACOES</translate>  
96 - </legend>  
97 -  
98 - <div class="col-md-12">  
99 - <div class="row">  
100 - <div class="col-sm-12">  
101 - <div class="panel panel-default">  
102 - <div class="panel-heading clearfix"></div>  
103 - <table class="table table-striped table-bordered table-hover">  
104 - <thead>  
105 - <tr>  
106 - <th class="text-center"><translate>LABEL.PROCESSO</translate></th>  
107 - <th class="text-center"><translate>LABEL.USUARIO</translate></th>  
108 - <th class="text-center"><translate>LABEL.UNIDADE</translate></th>  
109 - <th class="text-center"><translate>LABEL.DATACRIACAO</translate></th>  
110 - </tr>  
111 - </thead>  
112 - <tbody>  
113 - <tr ng-repeat="historico in listaHistoricos">  
114 -  
115 - <td class="text-center">{{historico.processoAnexado.nup}}</td>  
116 - <td class="text-center">{{historico.unidade.nome}}</td>  
117 - <td class="text-center">{{historico.autor.username}}</td>  
118 - <td class="text-center">{{historico.dataCriacao | date: 'dd/MM/yyyy HH:mm:ss' }}</td>  
119 -  
120 - </tr>  
121 - <tr ng-hide="listaHistorico.length > 0">  
122 - <td colspan="3" class="text-center"><translate>LABEL.TABELA_VAZIA</translate></td>  
123 - </tr>  
124 - </tbody>  
125 - </table>  
126 - </div>  
127 - </div>  
128 - </div>  
129 - </div>  
130 -  
131 - </fieldset> -->  
132 -  
133 <div class="row"> 92 <div class="row">
134 <div class="col-md-12"> 93 <div class="col-md-12">
135 <button class="btn btn-sm btn-primary" ng-click="saveOrUpdate()" type="button"> 94 <button class="btn btn-sm btn-primary" ng-click="saveOrUpdate()" type="button">
cit-ecm-web/src/main/webapp/html/gerenciarProcesso/includeDocumentosProcesso.html
@@ -37,8 +37,8 @@ @@ -37,8 +37,8 @@
37 37
38 <ul class="dropdown-menu-center dropdown-menu dropdown-caret" role="menu"> 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> 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>ECM.LABEL.CANCELARDOCUMENTO</translate></a></li> 40 + <li ng-if='!processo.isTramitado && (!documento.cancelado && documento.unidade.id === usuarioLogado.unidade.id)'><a href="#void" ng-click="removeDocumento(documento, $index);"><translate>LABEL.REMOVER</translate></a></li>
  41 + <li ng-if='processo.isTramitado && (!documento.cancelado && documento.unidade.id === usuarioLogado.unidade.id)'><a href="#void" ng-click='cancelarDocumento(documento)'> <translate>ECM.LABEL.CANCELARDOCUMENTO</translate></a></li>
42 <li ng-if='!documento.cancelado'><a href="#void" ng-click="visualizarVersoes(documento);"> <translate>ECM.LABEL.VERSOESDODOCUMENTO</translate></a></li> 42 <li ng-if='!documento.cancelado'><a href="#void" ng-click="visualizarVersoes(documento);"> <translate>ECM.LABEL.VERSOESDODOCUMENTO</translate></a></li>
43 <li ><a ng-if='documento.cancelado'href="#void" ng-click="getCancelamentoDocumento(documento);"> <translate>ECM.LABEL.JUSTIFICATIVA_CANCELAMENTO</translate></a></li> 43 <li ><a ng-if='documento.cancelado'href="#void" ng-click="getCancelamentoDocumento(documento);"> <translate>ECM.LABEL.JUSTIFICATIVA_CANCELAMENTO</translate></a></li>
44 </ul> 44 </ul>