Commit 43cd5d456014a2af3e2cab878e114cd84c80215b
1 parent
25d5149a
Exists in
master
redmine #4583 exibição assinaturas por versões; criação de histórico de alteraçã…
…o de processo para assinaturas de documentos;
Showing
15 changed files
with
141 additions
and
126 deletions
Show diff stats
cit-ecm-api/src/main/java/br/com/centralit/api/model/AcaoHistoricoAlteracaoProcesso.java
... | ... | @@ -59,6 +59,10 @@ public class AcaoHistoricoAlteracaoProcesso extends PersistentObject { |
59 | 59 | private String acao; |
60 | 60 | |
61 | 61 | private String descricao; |
62 | + | |
63 | + public static String ASSINAR_DOCUMENTO_CHAVE = "ASSINAR_DOCUMENTO"; | |
64 | + public static String ASSINAR_DOCUMENTO_ACAO = "Assinatura de documento"; | |
65 | + public static String ASSINAR_DOCUMENTO_DESCRICAO = "O documento <<tipo_documento>> <<numero_documento>> foi assinado por <<usuario>>."; | |
62 | 66 | |
63 | 67 | public AcaoHistoricoAlteracaoProcesso() { |
64 | 68 | ... | ... |
cit-ecm-api/src/main/java/br/com/centralit/api/model/Assinatura.java
... | ... | @@ -6,7 +6,9 @@ import javax.persistence.GeneratedValue; |
6 | 6 | import javax.persistence.GenerationType; |
7 | 7 | import javax.persistence.Id; |
8 | 8 | import javax.persistence.ManyToOne; |
9 | +import javax.persistence.Transient; | |
9 | 10 | |
11 | +import br.com.centralit.api.framework.json.ViewsEcm; | |
10 | 12 | import br.com.centralit.framework.json.Views; |
11 | 13 | import br.com.centralit.framework.model.Dominio; |
12 | 14 | import br.com.centralit.framework.model.Usuario; |
... | ... | @@ -59,7 +61,7 @@ public class Assinatura extends PersistentObjectAudit { |
59 | 61 | private Long id; |
60 | 62 | |
61 | 63 | /** Atributo usuario. */ |
62 | - @JsonView({ Views.DocumentoGedEdit.class }) | |
64 | + @JsonView({ Views.DocumentoGedEdit.class, ViewsEcm.DocumentoGedEdit.class }) | |
63 | 65 | @ManyToOne(fetch = FetchType.LAZY) |
64 | 66 | private Usuario usuario; |
65 | 67 | |
... | ... | @@ -68,15 +70,18 @@ public class Assinatura extends PersistentObjectAudit { |
68 | 70 | private DocumentoGed documentoGed; |
69 | 71 | |
70 | 72 | /** Atributo tipoAssinatura. */ |
71 | - @JsonView({ Views.DocumentoGedEdit.class }) | |
73 | + @JsonView({ Views.DocumentoGedEdit.class, ViewsEcm.DocumentoGedEdit.class }) | |
72 | 74 | @ManyToOne(fetch = FetchType.LAZY) |
73 | 75 | private Dominio tipoAssinatura; |
74 | 76 | |
75 | 77 | /** Atributo funcao. */ |
76 | 78 | @ManyToOne(fetch = FetchType.LAZY) |
77 | - @JsonView({ Views.DocumentoGedEdit.class }) | |
79 | + @JsonView({ Views.DocumentoGedEdit.class, ViewsEcm.DocumentoGedEdit.class }) | |
78 | 80 | private Funcao funcao; |
79 | 81 | |
82 | + @Transient | |
83 | + private Long idTask; | |
84 | + | |
80 | 85 | /** |
81 | 86 | * Retorna o valor do atributo <code>id</code> |
82 | 87 | * |
... | ... | @@ -177,4 +182,24 @@ public class Assinatura extends PersistentObjectAudit { |
177 | 182 | this.funcao = funcao; |
178 | 183 | } |
179 | 184 | |
185 | + /** | |
186 | + * Retorna o valor do atributo <code>idTask</code> | |
187 | + * | |
188 | + * @return <code>Long</code> | |
189 | + */ | |
190 | + public Long getIdTask() { | |
191 | + | |
192 | + return idTask; | |
193 | + } | |
194 | + | |
195 | + /** | |
196 | + * Define o valor do atributo <code>idTask</code>. | |
197 | + * | |
198 | + * @param idTask | |
199 | + */ | |
200 | + public void setIdTask(Long idTask) { | |
201 | + | |
202 | + this.idTask = idTask; | |
203 | + } | |
204 | + | |
180 | 205 | } | ... | ... |
cit-ecm-api/src/main/java/br/com/centralit/api/model/DocumentoGed.java
... | ... | @@ -95,7 +95,7 @@ public class DocumentoGed extends PersistentObjectUnidade implements Cloneable { |
95 | 95 | private Boolean novaVersao; |
96 | 96 | |
97 | 97 | /** Atributo versaoDocumento. */ |
98 | - @JsonView({ Views.DocumentoGedEdit.class }) | |
98 | + @JsonView({ Views.DocumentoGedEdit.class, Views.ProcessoEdit.class }) | |
99 | 99 | private Double versaoDocumento; |
100 | 100 | |
101 | 101 | /** Atributo cancelado. */ |
... | ... | @@ -235,8 +235,8 @@ public class DocumentoGed extends PersistentObjectUnidade implements Cloneable { |
235 | 235 | @JsonView({ ViewsEcm.DocumentoGedEdit.class, Views.ProcessoEdit.class }) |
236 | 236 | private Collection<InteressadoDocumento> interessados; |
237 | 237 | |
238 | - @OneToMany(fetch = FetchType.LAZY, mappedBy = "documentoGed", cascade = CascadeType.ALL, orphanRemoval = true) | |
239 | - @JsonView({ Views.DocumentoGedEdit.class }) | |
238 | + @OneToMany(fetch = FetchType.LAZY, mappedBy = "documentoGed") | |
239 | + @JsonView({ Views.DocumentoGedEdit.class, ViewsEcm.DocumentoGedEdit.class, Views.ProcessoEdit.class }) | |
240 | 240 | private Collection<Assinatura> assinaturas; |
241 | 241 | |
242 | 242 | /** | ... | ... |
cit-ecm-api/src/main/java/br/com/centralit/api/model/HistoricoAlteracaoProcesso.java
... | ... | @@ -101,6 +101,24 @@ public class HistoricoAlteracaoProcesso extends PersistentObjectAudit { |
101 | 101 | |
102 | 102 | @Transient |
103 | 103 | private Map<String, String> mapaAtributos; |
104 | + | |
105 | + public HistoricoAlteracaoProcesso(){ | |
106 | + super(); | |
107 | + } | |
108 | + | |
109 | + public HistoricoAlteracaoProcesso( Processo processo, Calendar dataRegistro, String nomeUnidadeVigente, String nomeUsuario, Long idTask, String descricaoAcao, String acaoAlteracao, DocumentoGed documentoGed, Map<String, String> mapaAtributos) { | |
110 | + | |
111 | + super(); | |
112 | + this.processo = processo; | |
113 | + this.dataRegistro = dataRegistro; | |
114 | + this.nomeUnidadeVigente = nomeUnidadeVigente; | |
115 | + this.nomeUsuario = nomeUsuario; | |
116 | + this.idTask = idTask; | |
117 | + this.descricaoAcao = descricaoAcao; | |
118 | + this.acaoAlteracao = acaoAlteracao; | |
119 | + this.documentoGed = documentoGed; | |
120 | + this.mapaAtributos = mapaAtributos; | |
121 | + } | |
104 | 122 | |
105 | 123 | public Calendar getDataRegistro() { |
106 | 124 | ... | ... |
cit-ecm-api/src/main/java/br/com/centralit/api/service/impl/AssinaturaServiceImpl.java
1 | 1 | package br.com.centralit.api.service.impl; |
2 | 2 | |
3 | +import java.util.Calendar; | |
4 | +import java.util.HashMap; | |
5 | +import java.util.Map; | |
6 | + | |
3 | 7 | import org.springframework.beans.factory.annotation.Autowired; |
4 | 8 | import org.springframework.security.core.context.SecurityContextHolder; |
5 | 9 | import org.springframework.stereotype.Service; |
6 | 10 | |
7 | 11 | import br.com.centralit.api.dao.AssinaturaDao; |
12 | +import br.com.centralit.api.model.AcaoHistoricoAlteracaoProcesso; | |
8 | 13 | import br.com.centralit.api.model.Assinatura; |
14 | +import br.com.centralit.api.model.HistoricoAlteracaoProcesso; | |
9 | 15 | import br.com.centralit.api.service.AssinaturaService; |
10 | 16 | import br.com.centralit.api.service.DocumentoGedService; |
11 | 17 | import br.com.centralit.api.service.DominioService; |
12 | 18 | import br.com.centralit.api.service.FuncaoService; |
19 | +import br.com.centralit.api.service.HistoricoAlteracaoProcessoService; | |
13 | 20 | import br.com.centralit.api.service.UsuarioService; |
14 | 21 | import br.com.centralit.framework.model.Dominio; |
15 | 22 | import br.com.centralit.framework.model.Usuario; |
... | ... | @@ -43,17 +50,39 @@ public class AssinaturaServiceImpl extends GenericServiceImpl<Assinatura, Long> |
43 | 50 | private FuncaoService funcaoService; |
44 | 51 | |
45 | 52 | @Autowired |
53 | + private HistoricoAlteracaoProcessoService historicoAlteracaoProcessoService; | |
54 | + | |
55 | + @Autowired | |
46 | 56 | public AssinaturaServiceImpl( AssinaturaDao assinaturaDao) { |
47 | 57 | this.dao = assinaturaDao; |
48 | 58 | } |
49 | 59 | |
50 | 60 | @Override |
51 | - public Assinatura saveAssinaturaInterna(Assinatura entity) { | |
52 | - entity.setDocumentoGed(this.documentoGedService.getReference(entity.getDocumentoGed().getId())); | |
53 | - entity.setUsuario((Usuario) SecurityContextHolder.getContext().getAuthentication().getPrincipal()); | |
54 | - entity.setTipoAssinatura(dominioService.findByChaveAndCodigo(Dominio.TIPO_ASSINATURA, Dominio.TIPO_ASSINATURA_INTERNA)); | |
55 | - entity.setFuncao(funcaoService.getReference(entity.getFuncao().getId())); | |
56 | - return super.save(entity); | |
61 | + public Assinatura saveAssinaturaInterna(Assinatura assinatura) { | |
62 | + assinatura.setDocumentoGed(this.documentoGedService.getReference(assinatura.getDocumentoGed().getId())); | |
63 | + assinatura.setUsuario((Usuario) SecurityContextHolder.getContext().getAuthentication().getPrincipal()); | |
64 | + assinatura.setTipoAssinatura(dominioService.findByChaveAndCodigo(Dominio.TIPO_ASSINATURA, Dominio.TIPO_ASSINATURA_INTERNA)); | |
65 | + assinatura.setFuncao(funcaoService.getReference(assinatura.getFuncao().getId())); | |
66 | + gerarHistorico(assinatura); | |
67 | + return super.save(assinatura); | |
68 | + } | |
69 | + | |
70 | + /** | |
71 | + * Método responsável por gerar histórico de alteração do processo | |
72 | + * @author rogerio.cassimiro | |
73 | + * @param assinatura | |
74 | + */ | |
75 | + private void gerarHistorico(Assinatura assinatura) { | |
76 | + | |
77 | + Usuario usuario = (Usuario) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); | |
78 | + Map<String, String> mapaAtributos = new HashMap<String, String>(); | |
79 | + mapaAtributos.put("tipo_documento", null); | |
80 | + mapaAtributos.put("numero_documento", null); | |
81 | + HistoricoAlteracaoProcesso hap = new HistoricoAlteracaoProcesso(assinatura.getDocumentoGed().getProcesso(), Calendar.getInstance(), | |
82 | + usuario.getUnidade().getNome(), usuario.getUsername(), assinatura.getIdTask(), AcaoHistoricoAlteracaoProcesso.ASSINAR_DOCUMENTO_DESCRICAO, | |
83 | + AcaoHistoricoAlteracaoProcesso.ASSINAR_DOCUMENTO_CHAVE, assinatura.getDocumentoGed(), mapaAtributos); | |
84 | + hap.setAutor(usuario); | |
85 | + historicoAlteracaoProcessoService.saveWithParams(hap); | |
57 | 86 | } |
58 | 87 | |
59 | 88 | /** | ... | ... |
cit-ecm-api/src/main/java/br/com/centralit/api/service/impl/HistoricoAlteracaoProcessoServiceImpl.java
... | ... | @@ -105,6 +105,7 @@ public class HistoricoAlteracaoProcessoServiceImpl extends GenericServiceImpl<Hi |
105 | 105 | toSave.setIdTask(historicoView.getIdTask()); |
106 | 106 | toSave.setAcaoAlteracao(acao.getAcao()); |
107 | 107 | toSave.setDataRegistro(Calendar.getInstance()); |
108 | + toSave.setDocumentoGed(historicoView.getDocumentoGed()); | |
108 | 109 | |
109 | 110 | toSave = (HistoricoAlteracaoProcesso) historicoAlteracaoProcessoDao.save(toSave); |
110 | 111 | |
... | ... | @@ -118,7 +119,7 @@ public class HistoricoAlteracaoProcessoServiceImpl extends GenericServiceImpl<Hi |
118 | 119 | |
119 | 120 | return ( (HistoricoAlteracaoProcesso) historicoAlteracaoProcessoDao.save(toSave) ) != null ? true : false; |
120 | 121 | } |
121 | - | |
122 | + | |
122 | 123 | private void produceViewParams(HistoricoAlteracaoProcesso historico, HistoricoAlteracaoProcesso toSave) { |
123 | 124 | |
124 | 125 | Map<String, String> mapaAtributos; | ... | ... |
cit-ecm-api/src/main/java/br/com/centralit/api/service/impl/InicializarEcmServiceImpl.java
... | ... | @@ -140,7 +140,8 @@ public class InicializarEcmServiceImpl extends UtilStartup { |
140 | 140 | filesProcesso.add(new MenuFile("/cit-ecm-web/assets/js/angular/custom/repository/ConfiguracaoUsuarioUnidadeRepository.js", this.dominioJS, menuCadastroProcesso)); |
141 | 141 | filesProcesso.add(new MenuFile("/cit-ecm-web/assets/js/angular/custom/repository/EstruturaOrganizacionalECMRepository.js", this.dominioJS, menuCadastroProcesso)); |
142 | 142 | filesProcesso.add(new MenuFile("/cit-ecm-web/assets/js/angular/custom/repository/ConfiguracaoUsuarioUnidadeRepository.min.js", this.dominioJS, menuCadastroProcesso)); |
143 | - | |
143 | + | |
144 | + filesProcesso.add(new MenuFile("/cit-ecm-web/assets/js/angular/custom/controller/AssinarDocumentoController.js", this.dominioJS, menuCadastroProcesso)); | |
144 | 145 | filesProcesso.add(new MenuFile("/cit-ecm-web/assets/js/angular/custom/repository/AssinaturaRepository.js", this.dominioJS, menuCadastroProcesso)); |
145 | 146 | filesProcesso.add(new MenuFile("/cit-ecm-web/assets/js/angular/custom/repository/DocumentoGedRepository.js", this.dominioJS, menuCadastroProcesso)); |
146 | 147 | filesProcesso.add(new MenuFile("/cit-ecm-web/assets/js/angular/custom/repository/DocumentoGedRepository.min.js", this.dominioJS, menuCadastroProcesso)); | ... | ... |
cit-ecm-web/src/main/java/br/com/centralit/listener/StartupListenerEcm.java
... | ... | @@ -141,6 +141,7 @@ public class StartupListenerEcm extends UtilStartup implements ApplicationListen |
141 | 141 | list.add(new AcaoHistoricoAlteracaoProcesso("ACAO_PROCESSO", "Ação", "<<acao>> , protocolo <<protocolo>>.")); |
142 | 142 | list.add(new AcaoHistoricoAlteracaoProcesso("VALIDAR_PROCESSO", "Validar Processo", "O processo <<protocolo>> foi validado e seus documentos.")); |
143 | 143 | list.add(new AcaoHistoricoAlteracaoProcesso("ATRIBUICAO_PROCESSO", "Atribuição de processo", "O processo <<protocolo>> foi atribuido para <<usuario>>.")); |
144 | + list.add(new AcaoHistoricoAlteracaoProcesso("ASSINAR_DOCUMENTO", "Assinatura de documento", "O documento <<tipo_documento>> <<numero_documento>> foi assinado por <<usuario>>.")); | |
144 | 145 | |
145 | 146 | try { |
146 | 147 | this.acaoHistoricoAlteracaoProcessoService.saveListIfNotExist(list); |
... | ... | @@ -418,6 +419,7 @@ public class StartupListenerEcm extends UtilStartup implements ApplicationListen |
418 | 419 | internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.DATA_DA_ASSINATURA", "Data da assinatura", dominio, modulo)); |
419 | 420 | internacionalizacaoList.add(new Internacionalizacao("ECM.ASSINADO_SUCESSO", "Documento assinado com sucesso!", dominio, modulo)); |
420 | 421 | internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.ASSINATURA_DO_DOCUMENTO", "Assinatura do Documento", dominio, modulo)); |
422 | + internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.DOCUMENTO_SEM_ASSINATURA", "Documento sem assinaturas!", dominio, modulo)); | |
421 | 423 | |
422 | 424 | } |
423 | 425 | |
... | ... | @@ -529,7 +531,7 @@ public class StartupListenerEcm extends UtilStartup implements ApplicationListen |
529 | 531 | internacionalizacaoList.add(new Internacionalizacao("ECM.MSG.TAREFA_REATIVADA", "Tarefa reativada com sucesso", dominio, modulo)); |
530 | 532 | internacionalizacaoList.add(new Internacionalizacao("ECM.MSG.ERRO_PERMISSAO_ASSINAR", "Erro! Para assinar documentos é necessário possuir o papel “Servidor” ou “Terceirizado” com “Função” preenchida no Cadastro de Pessoas!", dominio, modulo)); |
531 | 533 | internacionalizacaoList.add(new Internacionalizacao("ECM.MSG.USUARIO_SEM_PESSOA", "Usuário não está presente no Cadastro de Pessoa!", dominio, modulo)); |
532 | - internacionalizacaoList.add(new Internacionalizacao("ECM.MSG.DOCUMENTO_SEM_ASSINATURAS", "Documento selecionado não possui assinaturas!", dominio, modulo)); | |
534 | + internacionalizacaoList.add(new Internacionalizacao("ECM.MSG.DOCUMENTO_SEM_ASSINATURAS", "Esta versão do Documento não possui assinaturas!", dominio, modulo)); | |
533 | 535 | internacionalizacaoList.add(new Internacionalizacao("ECM.MSG.DOCUMENTO_JA_ASSINADO", "Documento já foi assinado por este usuário!", dominio, modulo)); |
534 | 536 | } |
535 | 537 | } | ... | ... |
cit-ecm-web/src/main/webapp/assets/css/gerenciarProcesso.css
... | ... | @@ -4,7 +4,7 @@ |
4 | 4 | * Os códigos abaixo devem ser colocados nos devidos lugares e/ou utilizados dos css corretos do template, utilizem assim por não conhecer onde estão os css da arquitetura. |
5 | 5 | */ |
6 | 6 | .itemdiv { |
7 | - min-height: 66px; | |
7 | + min-height: 80px; | |
8 | 8 | border: 1px solid #ccc; |
9 | 9 | padding: 10px; |
10 | 10 | position: relative; |
... | ... | @@ -143,3 +143,9 @@ |
143 | 143 | margin-top: 10px; |
144 | 144 | } |
145 | 145 | |
146 | +.versoes { | |
147 | + font-size : x-small; | |
148 | + font-weight : bold; | |
149 | + text-align : right !important; | |
150 | +} | |
151 | + | ... | ... |
cit-ecm-web/src/main/webapp/assets/js/angular/custom/controller/GerenciarProcessoController.js
1 | 1 | 'use strict'; |
2 | 2 | |
3 | 3 | |
4 | -citApp.controller('GerenciarProcessoController', [ '$scope', '$translate', '$timeout','GerenciarProcessoRepository', 'ProcessoRepository', 'RuntimeManagerRepository','$rootScope', 'DocumentoGedRepository', 'HistoricoAlteracaoProcessoRepository','UnidadeRepository','UnidadeProcessoRepository','CredencialProcessoRepository', 'PessoaRepository', '$q', 'AssinaturaRepository', | |
5 | - function GerenciarProcessoController($scope, $translate, $timeout, GerenciarProcessoRepository, ProcessoRepository, RuntimeManagerRepository,$rootScope, DocumentoGedRepository, HistoricoAlteracaoProcessoRepository,UnidadeRepository, UnidadeProcessoRepository,CredencialProcessoRepository, PessoaRepository, $q, AssinaturaRepository) { | |
4 | +citApp.controller('GerenciarProcessoController', [ '$scope', '$translate', '$timeout','GerenciarProcessoRepository', 'ProcessoRepository', 'RuntimeManagerRepository','$rootScope', 'DocumentoGedRepository', 'HistoricoAlteracaoProcessoRepository','UnidadeRepository','UnidadeProcessoRepository','CredencialProcessoRepository', 'PessoaRepository', | |
5 | + function GerenciarProcessoController($scope, $translate, $timeout, GerenciarProcessoRepository, ProcessoRepository, RuntimeManagerRepository,$rootScope, DocumentoGedRepository, HistoricoAlteracaoProcessoRepository,UnidadeRepository, UnidadeProcessoRepository,CredencialProcessoRepository, PessoaRepository) { | |
6 | 6 | |
7 | 7 | $scope.processo = {}; |
8 | 8 | $scope.iconAnexo = {}; |
... | ... | @@ -695,60 +695,8 @@ citApp.controller('GerenciarProcessoController', [ '$scope', '$translate', '$tim |
695 | 695 | }); |
696 | 696 | }; |
697 | 697 | |
698 | - /* | |
699 | - * Abre panel assinar documento | |
700 | - */ | |
701 | 698 | $scope.abrirAssinarDocumento = function(documento) { |
702 | 699 | $scope.fecharPagina(); |
703 | - $scope.numeroDocumento = documento.numero ? documento.numero : ''; | |
704 | - $scope.exibirAssinarDocAnexo = false; | |
705 | - $scope.documentoSelecionado = null; | |
706 | - $scope.exibirDocJaAssinado = false; | |
707 | - if(documento.formaCriacao.codigo === 1){ | |
708 | - __abrirAssinarDocOnline(documento) | |
709 | - } else if(documento.formaCriacao.codigo === 2){ | |
710 | - __abrirAssinarDocAnexo(documento) | |
711 | - } | |
712 | - }; | |
713 | - | |
714 | - function __abrirAssinarDocOnline(documento){ | |
715 | - _obterAssinaturasDocumento(documento.id).then(function(documentoSelecionado){ | |
716 | - $scope.documentoSelecionado = documentoSelecionado; | |
717 | - _validarAssinaturaPorUsuario(documento.id).then(function(exibirIncluirAssinatura){ | |
718 | - $scope.exibirIncluirAssinatura = !(exibirIncluirAssinatura == true); | |
719 | - _obterPermissaoAssinaturaDocumentoExterno(); | |
720 | - }); | |
721 | - }); | |
722 | - } | |
723 | - | |
724 | - function __abrirAssinarDocAnexo(documento){ | |
725 | - _obterAssinaturasDocumento(documento.id).then(function(documentoSelecionado){ | |
726 | - $scope.documentoSelecionado = documentoSelecionado; | |
727 | - _validarAssinaturaPorUsuario(documento.id).then(function(exibirIncluirAssinatura){ | |
728 | - $scope.exibirIncluirAssinatura = !(exibirIncluirAssinatura == true); | |
729 | - $scope.exibirDocJaAssinado = !$scope.exibirIncluirAssinatura; | |
730 | - _obterPermissaoAssinaturaDocumentoExterno(); | |
731 | - }); | |
732 | - }); | |
733 | - }; | |
734 | - | |
735 | - function _validarAssinaturaPorUsuario(idDocumento){ | |
736 | - var deferred = $q.defer(); | |
737 | - AssinaturaRepository.validarAssinaturaPorUsuario(idDocumento).then(function(result){ | |
738 | - deferred.resolve(result); | |
739 | - }); | |
740 | - return deferred.promise; | |
741 | - } | |
742 | - | |
743 | - function _obterAssinaturasDocumento(idDocumento) { | |
744 | - var deferred = $q.defer(); | |
745 | - DocumentoGedRepository.get(idDocumento).then(function(result){ | |
746 | - deferred.resolve(result.originalElement); | |
747 | - }); | |
748 | - return deferred.promise; | |
749 | - } | |
750 | - | |
751 | - function _obterPermissaoAssinaturaDocumentoExterno(){ | |
752 | 700 | $scope.pessoa = {}; |
753 | 701 | PessoaRepository.getPermissaoAssinaturaDocumento().then(function(result){ |
754 | 702 | $scope.exibirAssinarDocAnexo = result.originalElement.exibirAssinarDocAnexo; |
... | ... | @@ -758,6 +706,9 @@ citApp.controller('GerenciarProcessoController', [ '$scope', '$translate', '$tim |
758 | 706 | return; |
759 | 707 | } |
760 | 708 | _montarParceiros(); |
709 | + $timeout( function () { | |
710 | + angular.element( "#documentoAssinatura" ).scope().abrirAssinarDocumento(documento); | |
711 | + } ); | |
761 | 712 | }); |
762 | 713 | }; |
763 | 714 | |
... | ... | @@ -786,51 +737,15 @@ citApp.controller('GerenciarProcessoController', [ '$scope', '$translate', '$tim |
786 | 737 | else |
787 | 738 | funcao.nome = funcao.nome.concat(parceiro.funcao.nome); |
788 | 739 | return funcao; |
789 | - } | |
790 | - | |
791 | - $scope.assinar = function() { | |
792 | - if(!$scope.autenticacao){ | |
793 | - $scope.showAlert("error", $translate.instant('ECM.VALIDACAO.SENHA_ASSINATURA')); | |
794 | - return; | |
795 | - } | |
796 | - | |
797 | - AssinaturaRepository.saveAssinaturaInterna(_getAssinatura()).then(function(result){ | |
798 | - if($scope.documentoSelecionado.assinaturas) | |
799 | - $scope.documentoSelecionado.assinaturas.push(result.originalElement); | |
800 | - $scope.autenticacao = null; | |
801 | - $scope.exibirIncluirAssinatura = false; | |
802 | - $scope.showAlert("success", $translate.instant('ECM.ASSINADO_SUCESSO')); | |
803 | - }); | |
804 | - }; | |
805 | - | |
806 | - function _getAssinatura(){ | |
807 | - return {documentoGed : { id : $scope.documentoSelecionado.id }, funcao : {id : _getFuncaoChecked()} }; | |
808 | 740 | }; |
809 | 741 | |
810 | - function _getFuncaoChecked(){ | |
811 | - for(var pos = 0; pos < $scope.funcoes.length; pos++){ | |
812 | - if($scope.funcoes[pos].isServidor) | |
813 | - return $scope.funcoes[pos].id; | |
814 | - } | |
815 | - }; | |
816 | - | |
817 | - /* | |
818 | - * Abre panel visualizar assinaturas | |
819 | - */ | |
820 | 742 | $scope.visualizarAssinaturasDocumento = function(documento){ |
821 | 743 | $scope.fecharPagina(); |
822 | - $scope.numeroDocumento = documento.numero ? documento.numero : ''; | |
823 | - $scope.exibirAssinarDocAnexo = false; | |
824 | - $scope.documentoSelecionado = null; | |
825 | - $scope.exibirIncluirAssinatura = false; | |
826 | - $scope.exibirDocJaAssinado = false; | |
827 | - _obterAssinaturasDocumento(documento.id).then(function(documentoSelecionado){ | |
828 | - $scope.documentoSelecionado = documentoSelecionado; | |
829 | - if($scope.documentoSelecionado.assinaturas.length >0) | |
830 | - $scope.exibirAssinarDocAnexo = true; | |
831 | - else | |
832 | - $scope.showAlert("warning", $translate.instant('ECM.MSG.DOCUMENTO_SEM_ASSINATURAS')); | |
833 | - }); | |
744 | + $scope.exibirAssinarDocAnexo = true; | |
745 | + $timeout( function () { | |
746 | + angular.element( "#documentoAssinatura" ).scope().visualizarAssinaturasDocumento(documento); | |
747 | + } ); | |
834 | 748 | }; |
835 | 749 | |
750 | + | |
836 | 751 | }] ); | ... | ... |
cit-ecm-web/src/main/webapp/assets/js/angular/custom/controller/GerenciarProcessoListUnidadeController.js
... | ... | @@ -29,8 +29,8 @@ citApp.controller('GerenciarProcessoListUnidadeController', ['$scope', 'workflow |
29 | 29 | $scope.filterCriteria = { |
30 | 30 | nome : 'GRID_PROCESSO_NA_UNIDADE', |
31 | 31 | start : 1, |
32 | - dir : 'asc', | |
33 | - sort : 'processo.nup', | |
32 | + dir : 'desc', | |
33 | + sort : 'processo.dataCriacao', | |
34 | 34 | limit : 10, |
35 | 35 | fields: ['id', 'processo.nup', 'processo.tipoProcesso.descricao', 'processo.assuntoComplementar','usuarioResponsavel.username', 'processo.status.descricao', 'processo.nivelAcesso.nivelAcesso.descricao', 'processo.dataCriacao', 'processo.idProcessInstance', 'processo.dataReferencia', 'processo.assunto'], |
36 | 36 | filters : [ | ... | ... |
cit-ecm-web/src/main/webapp/html/assinatura/documentoAssinaturaView.html
1 | -<div id="documentoAssinatura" class="widget-box margin-bottom" ng-controller="GerenciarProcessoController"> | |
1 | +<div id="documentoAssinatura" class="widget-box margin-bottom" ng-controller="AssinarDocumentoController as assinarDocumentoController"> | |
2 | 2 | <div class="widget-header"> |
3 | 3 | <h2 class="widget-title"> |
4 | 4 | <div ng-if="exibirIncluirAssinatura"> |
5 | - <translate>ECM.LABEL.ASSINATURA_DO_DOCUMENTO</translate> : {{numeroDocumento}} | |
5 | + <translate>ECM.LABEL.ASSINATURA_DO_DOCUMENTO</translate> : {{documentoSelecionado.numero}} | |
6 | + <translate style="margin-left: 20px;">ECM.LABEL.VERSAO_ATUAL</translate> : {{documentoSelecionado.versaoDocumento | limitTo:3}} | |
6 | 7 | </div> |
7 | 8 | <div ng-if="!exibirIncluirAssinatura"> |
8 | - <translate>ECM.LABEL.ASSINATURAS_DOCUMENTO</translate> : {{numeroDocumento}} | |
9 | + <translate>ECM.LABEL.ASSINATURAS_DOCUMENTO</translate> : {{documentoSelecionado.numero}} | |
10 | + <translate style="margin-left: 20px;">ECM.LABEL.VERSAO_ATUAL</translate> : {{documentoSelecionado.versaoDocumento | limitTo:3}} | |
9 | 11 | </div> |
10 | 12 | </h2> |
11 | 13 | <div class="widget-toolbar"> |
12 | 14 | <a href="#void" ng-click="widgetAssinarDocIsCollapsed = !widgetAssinarDocIsCollapsed"> |
13 | 15 | <i class="fa" ng-class="{'fa-chevron-up': !widgetAssinarDocIsCollapsed, 'fa-chevron-down': widgetAssinarDocIsCollapsed}"></i> |
14 | 16 | </a> |
17 | + <a href="#void" ng-click="$parent.closeWidget('documentoAssinatura');"> <i class="fa fa-close"></i></a> | |
15 | 18 | </div> |
16 | 19 | </div> |
20 | + | |
17 | 21 | <div class="widget-body" collapse="widgetAssinarDocIsCollapsed"> |
18 | 22 | <div class="widget-main clearfix"> |
19 | 23 | <div class="page-content clearfix"> | ... | ... |
cit-ecm-web/src/main/webapp/html/assinatura/documentoAssinaturas.html
1 | -<div class="row" ng-if="documentoSelecionado.assinaturas.length > 0"> | |
1 | +<div class="row" ng-if="documentosSelecionados.length > 0"> | |
2 | 2 | <div class="col-sm-12"> |
3 | 3 | <table class="table table-striped table-bordered table-hover"> |
4 | 4 | <thead> |
... | ... | @@ -11,10 +11,10 @@ |
11 | 11 | <th><small><translate>ECM.LABEL.DATA_DA_ASSINATURA</translate></small></th> |
12 | 12 | </tr> |
13 | 13 | </thead> |
14 | - <tbody> | |
15 | - <tr ng-repeat="assinatura in documentoSelecionado.assinaturas"> | |
14 | + <tbody ng-repeat="docSelecionado in documentosSelecionados"> | |
15 | + <tr ng-repeat="assinatura in docSelecionado.assinaturas"> | |
16 | 16 | <td> |
17 | - <small>{{documentoSelecionado.versaoDocumento}}</small> | |
17 | + <small>{{docSelecionado.versaoDocumento}}</small> | |
18 | 18 | </td> |
19 | 19 | <td> |
20 | 20 | <small>{{assinatura.usuario.username}}</small> |
... | ... | @@ -23,7 +23,7 @@ |
23 | 23 | <small>{{assinatura.funcao.nome}}</small> |
24 | 24 | </td> |
25 | 25 | <td> |
26 | - <small>{{documentoSelecionado.unidadeNome}}</small> | |
26 | + <small>{{docSelecionado.unidadeNome}}</small> | |
27 | 27 | </td> |
28 | 28 | <td> |
29 | 29 | <small>{{assinatura.tipoAssinatura.descricao}}</small> |
... | ... | @@ -31,8 +31,15 @@ |
31 | 31 | <td> |
32 | 32 | <small>{{assinatura.dataCriacao | date : 'dd/MM/yyyy HH:mm:ss'}}</small> |
33 | 33 | </td> |
34 | - </tr> | |
34 | + </tr> | |
35 | 35 | </tbody> |
36 | + <tfoot> | |
37 | + <tr ng-hide="nenhumaAssinatura"> | |
38 | + <td colspan="6"> | |
39 | + <strong><translate>ECM.LABEL.DOCUMENTO_SEM_ASSINATURA</translate></strong> | |
40 | + </td> | |
41 | + </tr> | |
42 | + </tfoot> | |
36 | 43 | </table> |
37 | 44 | </div> |
38 | 45 | </div> |
39 | 46 | \ No newline at end of file | ... | ... |
cit-ecm-web/src/main/webapp/html/gerenciarProcesso/includeAcaoProcesso.html
... | ... | @@ -23,8 +23,6 @@ |
23 | 23 | |
24 | 24 | <div ng-include src="'/cit-ecm-web/html/atribuirProcesso/atribuir.html'" ng-show="isAtribuirProcesso" /> |
25 | 25 | |
26 | -<div ng-include src="'/cit-ecm-web/html/atribuirProcesso/atribuir.html'" ng-show="isAtribuirProcesso" /> | |
27 | - | |
28 | 26 | <!-- Assinatura documento --> |
29 | 27 | <div ng-include src="'/cit-ecm-web/html/assinatura/documentoAssinaturaView.html'" ng-show="exibirAssinarDocAnexo" /> |
30 | 28 | ... | ... |
cit-ecm-web/src/main/webapp/html/gerenciarProcesso/includeDocumentosProcesso.html
... | ... | @@ -21,12 +21,13 @@ |
21 | 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 | 22 | <span class="label label-warning" ng-show="documento.nivelAcesso.nivelAcesso.codigo == 1">{{documento.nivelAcesso.nivelAcesso.descricao}}</span> <span class="label label-success" |
23 | 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ência</span> <span | |
24 | + class="label label-info" ng-show="documento.assinaturas && documento.assinaturas.length > 0">Assinado</span> <span class="label label-success" ng-show="false">Habilitado</span> <span class="label label-warning" ng-show="false">Ciência</span> <span | |
25 | 25 | class="label label-danger" ng-show="documento.cancelado">Cancelado</span> |
26 | + | |
26 | 27 | </div> |
28 | + | |
27 | 29 | </div> |
28 | 30 | |
29 | - | |
30 | 31 | <div ng-if="!isProcessoView" class="tools btn-group dropdown" role="group" dropdown> |
31 | 32 | <button type="button" class="btn btn-success btn-xs" dropdown-toggle> |
32 | 33 | <translate>LABEL.ACOES</translate> |
... | ... | @@ -44,4 +45,8 @@ |
44 | 45 | </ul> |
45 | 46 | |
46 | 47 | </div> |
48 | + | |
49 | + <div class="versoes"> | |
50 | + <span><translate>ECM.LABEL.VERSAO_ATUAL</translate>: {{documento.versaoDocumento | limitTo:3}}</span> | |
51 | + </div> | |
47 | 52 | </div> |
48 | 53 | \ No newline at end of file | ... | ... |