Commit 2b0dc33347ced86bd216a40818780cf91afc5688

Authored by gabriel.damasceno
2 parents 4fc955b4 391de7fa
Exists in master

Merge branch 'desenvolvimento' of http://ferramentasgo.centralit.com.br:8080/scm…

…/git/cit-grp-ecm into desenvolvimento
cit-ecm-api/src/main/java/br/com/centralit/api/model/SigiloTipoDocumento.java
@@ -130,7 +130,7 @@ public class SigiloTipoDocumento extends PersistentObjectAudit { @@ -130,7 +130,7 @@ public class SigiloTipoDocumento extends PersistentObjectAudit {
130 this.nivelAcessoTipoDocumentoRemocao = nivelAcessoTipoDocumentoRemocao; 130 this.nivelAcessoTipoDocumentoRemocao = nivelAcessoTipoDocumentoRemocao;
131 } 131 }
132 132
133 - @JsonView({ ViewsEcm.NivelAcessoTipoDocumentoEdit.class, Views.DocumentoGedEdit.class }) 133 + @JsonView({ ViewsEcm.NivelAcessoTipoDocumentoEdit.class})
134 public String getTipoSigiloDescricao() { 134 public String getTipoSigiloDescricao() {
135 135
136 return this.sigilo.getTipoSigilo().getDescricao(); 136 return this.sigilo.getTipoSigilo().getDescricao();
cit-ecm-api/src/main/java/br/com/centralit/api/service/impl/DocumentoGedServiceImpl.java
@@ -287,7 +287,11 @@ public class DocumentoGedServiceImpl extends GenericServiceImpl<DocumentoGed, Lo @@ -287,7 +287,11 @@ public class DocumentoGedServiceImpl extends GenericServiceImpl<DocumentoGed, Lo
287 if (UtilObjeto.isReferencia(entity.getSigilo()) && UtilObjeto.isReferencia(entity.getSigilo().getId())) { 287 if (UtilObjeto.isReferencia(entity.getSigilo()) && UtilObjeto.isReferencia(entity.getSigilo().getId())) {
288 288
289 entity.setSigilo(this.sigiloService.getReference(entity.getSigilo().getId())); 289 entity.setSigilo(this.sigiloService.getReference(entity.getSigilo().getId()));
290 - entity.setStatus(this.dominioService.findByChaveAndCodigo("statusDocumentoGed", 0L)); 290 +
  291 + if (entity.isNew()) {
  292 + entity.setStatus(this.dominioService.findByChaveAndCodigo("statusDocumentoGed", 0L));
  293 +
  294 + }
291 this.atribuirPrazoPadraoDocumento(entity); 295 this.atribuirPrazoPadraoDocumento(entity);
292 this.enviarNotificacaoDocumentoSigiloso(entity); 296 this.enviarNotificacaoDocumentoSigiloso(entity);
293 } else { 297 } else {
cit-ecm-api/src/main/java/br/com/centralit/api/service/impl/ProcessoServiceImpl.java
@@ -53,7 +53,6 @@ import br.com.centralit.framework.model.Notificacao; @@ -53,7 +53,6 @@ import br.com.centralit.framework.model.Notificacao;
53 import br.com.centralit.framework.model.NotificacaoGrupo; 53 import br.com.centralit.framework.model.NotificacaoGrupo;
54 import br.com.centralit.framework.model.Unidade; 54 import br.com.centralit.framework.model.Unidade;
55 import br.com.centralit.framework.service.arquitetura.GenericServiceImpl; 55 import br.com.centralit.framework.service.arquitetura.GenericServiceImpl;
56 -import br.com.centralit.framework.util.Util;  
57 import br.com.centralit.framework.util.UtilColecao; 56 import br.com.centralit.framework.util.UtilColecao;
58 import br.com.centralit.framework.util.UtilDate; 57 import br.com.centralit.framework.util.UtilDate;
59 import br.com.centralit.framework.util.UtilObjeto; 58 import br.com.centralit.framework.util.UtilObjeto;
@@ -341,7 +340,7 @@ public class ProcessoServiceImpl extends GenericServiceImpl<Processo, Long> impl @@ -341,7 +340,7 @@ public class ProcessoServiceImpl extends GenericServiceImpl<Processo, Long> impl
341 340
342 this.montarEntidade(processo); 341 this.montarEntidade(processo);
343 342
344 - // this.saveSolr(processo); 343 + this.saveSolr(processo);
345 344
346 this.validarAbertosEmOutrasUnidades(processo); 345 this.validarAbertosEmOutrasUnidades(processo);
347 346
@@ -503,8 +502,11 @@ public class ProcessoServiceImpl extends GenericServiceImpl<Processo, Long> impl @@ -503,8 +502,11 @@ public class ProcessoServiceImpl extends GenericServiceImpl<Processo, Long> impl
503 // Verifica se o sigilo foi selecionado 502 // Verifica se o sigilo foi selecionado
504 if (UtilObjeto.isReferencia(processo.getSigilo()) && UtilObjeto.isReferencia(processo.getSigilo().getId())) { 503 if (UtilObjeto.isReferencia(processo.getSigilo()) && UtilObjeto.isReferencia(processo.getSigilo().getId())) {
505 processo.setSigilo(this.sigiloService.getReference(processo.getSigilo().getId())); 504 processo.setSigilo(this.sigiloService.getReference(processo.getSigilo().getId()));
506 - // Processo sigiloso inicia com o status Aguardando validação.  
507 - processo.setStatus(this.dominioService.findByChaveAndCodigo("statusProcesso", 3L)); 505 +
  506 + if (processo.isNew()) {
  507 + // Processo sigiloso inicia com o status Aguardando validação.
  508 + processo.setStatus(this.dominioService.findByChaveAndCodigo("statusProcesso", 3L));
  509 + }
508 510
509 this.atribuirPrazoPadraoProcesso(processo); 511 this.atribuirPrazoPadraoProcesso(processo);
510 } else { 512 } else {
cit-ecm-web/src/main/webapp/assets/js/angular/custom/controller/DocumentoGedController.js
@@ -19,6 +19,8 @@ citApp.controller('DocumentoGedController', ['$scope', 'DocumentoGedRepository', @@ -19,6 +19,8 @@ citApp.controller('DocumentoGedController', ['$scope', 'DocumentoGedRepository',
19 $scope.changeWatch = false; 19 $scope.changeWatch = false;
20 $scope.mantido = false; 20 $scope.mantido = false;
21 $scope.sugestoes = null; 21 $scope.sugestoes = null;
  22 + angular.element('#sugestoes').scope().model = null;
  23 + angular.element('#assuntoSelecionado').scope().model = null;
22 $scope.documentoGed.formaCriacao = { 24 $scope.documentoGed.formaCriacao = {
23 codigo : 2 25 codigo : 2
24 }; 26 };
@@ -264,44 +266,48 @@ citApp.controller('DocumentoGedController', ['$scope', 'DocumentoGedRepository', @@ -264,44 +266,48 @@ citApp.controller('DocumentoGedController', ['$scope', 'DocumentoGedRepository',
264 }; 266 };
265 267
266 $scope.construirRelacionamento = function(item){ 268 $scope.construirRelacionamento = function(item){
267 - $scope.nivelAcessoTipoDocumentoList = [];  
268 269
269 - if(!$scope.documentoGed.id) {  
270 - $scope.documentoGed.conteudo = "";  
271 - $scope.sugestoes = null;  
272 - if( $scope.documentoGed.formaCriacao.codigo === 1){ 270 + if(!$scope.documentoGed.id){
  271 +
  272 + $scope.nivelAcessoTipoDocumentoList = [];
273 273
274 - $scope.setLoadingGet(true); 274 + if(!$scope.documentoGed.id) {
  275 + $scope.documentoGed.conteudo = "";
  276 + $scope.sugestoes = null;
  277 + if( $scope.documentoGed.formaCriacao.codigo === 1){
  278 +
  279 + $scope.setLoadingGet(true);
  280 +
  281 + TemplatePadraoRepository.get(item.templatePadrao.id).then(function(result) {
  282 +
  283 + $scope.documentoGed.conteudo += result.cabecalho.texto + result.conteudo + result.rodape.texto;
  284 +
  285 + $scope.setLoadingGet(false);
  286 + });
  287 + }
  288 + }
  289 + $scope.findNivelAcessoPorTipoDocumento(item);
275 290
276 - TemplatePadraoRepository.get(item.templatePadrao.id).then(function(result) {  
277 -  
278 - $scope.documentoGed.conteudo += result.cabecalho.texto + result.conteudo + result.rodape.texto;  
279 -  
280 - $scope.setLoadingGet(false); 291 + $scope.findSugestaoAssunto(item);
  292 +
  293 + //Limpar o assuntoSelecionado e as sugestões.
  294 + $timeout(function(){
  295 + $scope.assuntoSelecionado = null;
  296 + if($scope.documentoGedForm && $scope.documentoGedForm['assuntoSelecionado']) {
  297 + $scope.documentoGedForm['assuntoSelecionado'].$setViewValue('');
  298 + $scope.documentoGedForm['assuntoSelecionado'].$render();
  299 + $scope.documentoGedForm.$submitted = false;
  300 + $scope.documentoGedForm.$setPristine();
  301 +
  302 + }
  303 + if($scope.documentoGedForm && $scope.documentoGedForm['sugestoes']) {
  304 + $scope.documentoGedForm['sugestoes'].$setViewValue('');
  305 + $scope.documentoGedForm['sugestoes'].$render();
  306 + }
281 }); 307 });
282 - }  
283 - }  
284 - $scope.findNivelAcessoPorTipoDocumento(item);  
285 -  
286 - $scope.findSugestaoAssunto(item);  
287 -  
288 - //Limpar o assuntoSelecionado e as sugestões.  
289 - $timeout(function(){  
290 - $scope.assuntoSelecionado = null;  
291 - if($scope.documentoGedForm && $scope.documentoGedForm['assuntoSelecionado']) {  
292 - $scope.documentoGedForm['assuntoSelecionado'].$setViewValue('');  
293 - $scope.documentoGedForm['assuntoSelecionado'].$render();  
294 - $scope.documentoGedForm.$submitted = false;  
295 - $scope.documentoGedForm.$setPristine();  
296 -  
297 - }  
298 - if($scope.documentoGedForm && $scope.documentoGedForm['sugestoes']) {  
299 - $scope.documentoGedForm['sugestoes'].$setViewValue('');  
300 - $scope.documentoGedForm['sugestoes'].$render();  
301 - }  
302 - });  
303 -  
304 - }; 308 +
  309 + };
  310 + };
305 311
306 $scope.findNivelAcessoPorTipoDocumento = function(tipoDocumento){ 312 $scope.findNivelAcessoPorTipoDocumento = function(tipoDocumento){
307 313
@@ -431,6 +437,7 @@ citApp.controller('DocumentoGedController', ['$scope', 'DocumentoGedRepository', @@ -431,6 +437,7 @@ citApp.controller('DocumentoGedController', ['$scope', 'DocumentoGedRepository',
431 uploader.clearQueue(); 437 uploader.clearQueue();
432 $scope.assuntoSelecionado = null; 438 $scope.assuntoSelecionado = null;
433 $scope.assuntos = null; 439 $scope.assuntos = null;
  440 + $scope.sugestoes = null;
434 DocumentoGedRepository.get(idDocumento).then(function(result) { 441 DocumentoGedRepository.get(idDocumento).then(function(result) {
435 $scope.documentoGed = result.originalElement; 442 $scope.documentoGed = result.originalElement;
436 $scope.edit = edit; 443 $scope.edit = edit;
@@ -441,7 +448,6 @@ citApp.controller('DocumentoGedController', ['$scope', 'DocumentoGedRepository', @@ -441,7 +448,6 @@ citApp.controller('DocumentoGedController', ['$scope', 'DocumentoGedRepository',
441 $scope.widgetDocumentoIsCollapsed = !edit; 448 $scope.widgetDocumentoIsCollapsed = !edit;
442 449
443 $timeout(function(){ 450 $timeout(function(){
444 -  
445 //Verifica se o documento é do tipo anexo 451 //Verifica se o documento é do tipo anexo
446 if(!edit && $scope.documentoGed.formaCriacao.codigo == 2){ 452 if(!edit && $scope.documentoGed.formaCriacao.codigo == 2){
447 453
@@ -643,14 +649,24 @@ citApp.controller('DocumentoGedController', ['$scope', 'DocumentoGedRepository', @@ -643,14 +649,24 @@ citApp.controller('DocumentoGedController', ['$scope', 'DocumentoGedRepository',
643 $scope.setAssuntoModelByTipoAssunto = function(){ 649 $scope.setAssuntoModelByTipoAssunto = function(){
644 $scope.sugestoes = []; 650 $scope.sugestoes = [];
645 $scope.assuntos = []; 651 $scope.assuntos = [];
  652 + angular.element('#sugestoes').scope().model = null;
  653 + angular.element('#sugestoes').scope().sugestoes = null;
  654 + angular.element('#assuntoSelecionado').scope().model = null;
  655 + angular.element('#assuntoSelecionado').scope().assuntoSelecionado = null;
646 TipoDocumentoPlanoClassificacaoRepository.findByIdJoin('tipoDocumento.id', $scope.documentoGed.tipoDocumento.id).then(function(result){ 656 TipoDocumentoPlanoClassificacaoRepository.findByIdJoin('tipoDocumento.id', $scope.documentoGed.tipoDocumento.id).then(function(result){
647 angular.forEach(result, function (item) { 657 angular.forEach(result, function (item) {
648 $scope.assuntos.push(item.planoClassificacao); 658 $scope.assuntos.push(item.planoClassificacao);
649 }); 659 });
650 - if($scope.documentoGed.tipoAssunto == 1){  
651 - $scope.sugestoes.push($scope.documentoGed.planoClassificacao); 660 +
  661 + if($scope.documentoGed.tipoAssunto == 1){
  662 + $scope.sugestoes.push($scope.documentoGed.planoClassificacao);
  663 + angular.element('#sugestoes').scope().sugestoes = [];
  664 + angular.element('#sugestoes').scope().sugestoes.push($scope.documentoGed.planoClassificacao);
652 }else if($scope.documentoGed.tipoAssunto == 2 ) { 665 }else if($scope.documentoGed.tipoAssunto == 2 ) {
653 - $scope.assuntoSelecionado = $scope.documentoGed.planoClassificacao; 666 +
  667 + $scope.assuntoSelecionado = $scope.documentoGed.planoClassificacao;
  668 + angular.element('#assuntoSelecionado').scope().model = $scope.assuntoSelecionado;
  669 +
654 } 670 }
655 }); 671 });
656 672
cit-ecm-web/src/main/webapp/assets/js/angular/custom/controller/GerenciarProcessoController.js
@@ -653,6 +653,10 @@ citApp.controller('GerenciarProcessoController', [ '$scope', '$translate', '$tim @@ -653,6 +653,10 @@ citApp.controller('GerenciarProcessoController', [ '$scope', '$translate', '$tim
653 653
654 $scope.setLoadingGet(true); 654 $scope.setLoadingGet(true);
655 655
  656 + $scope.fecharPagina();
  657 +
  658 + $scope.task = {};
  659 +
656 ProcessoRepository.getProcessoGerenciamento(processo.id).then(function(result) { 660 ProcessoRepository.getProcessoGerenciamento(processo.id).then(function(result) {
657 //Processo do scopo do gerenciamento 661 //Processo do scopo do gerenciamento
658 $scope.processo = result.originalElement; 662 $scope.processo = result.originalElement;
cit-ecm-web/src/main/webapp/html/documentoGed/metadadosDocumentoEdit.html
@@ -118,7 +118,7 @@ @@ -118,7 +118,7 @@
118 118
119 <div class="radio-inline" ng-repeat="sigiloTipoDocumento in documentoGed.nivelAcesso.sigilos"> 119 <div class="radio-inline" ng-repeat="sigiloTipoDocumento in documentoGed.nivelAcesso.sigilos">
120 <label> <input type="radio" required="documentoGed.nivelAcesso.nivelAcesso.codigo == 1" name="documentoGed.tipoSigiloDocumento.id" id="documentoGed.tipoSigiloDocumento.id" 120 <label> <input type="radio" required="documentoGed.nivelAcesso.nivelAcesso.codigo == 1" name="documentoGed.tipoSigiloDocumento.id" id="documentoGed.tipoSigiloDocumento.id"
121 - ng-disabled="!edit" ng-value="sigiloTipoDocumento.sigilo.id" ng-model="documentoGed.sigilo.id" ng-change='setHipoteseLegal()' /> {{sigiloTipoDocumento.tipoSigiloDescricao}} 121 + ng-disabled="!edit" ng-value="sigiloTipoDocumento.sigilo.id" ng-model="documentoGed.sigilo.id" ng-change='setHipoteseLegal()' /> {{sigiloTipoDocumento.sigilo.tipoSigilo.descricao}}
122 </label> 122 </label>
123 </div> 123 </div>
124 </div> 124 </div>
cit-ecm-web/src/main/webapp/html/gerenciarProcesso/includeCabecalhoGerenciarProcesso.jsp
@@ -33,7 +33,7 @@ @@ -33,7 +33,7 @@
33 <translate>LABEL.EDITAR</translate> 33 <translate>LABEL.EDITAR</translate>
34 </button> 34 </button>
35 35
36 -<button type="button" class="btn btn-clear" ng-click="concluir()"> 36 +<button type="button" class="btn btn-clear" ng-click="concluir()" ng-if="task.id">
37 <i class="ace-icon fa fa-check green"></i> 37 <i class="ace-icon fa fa-check green"></i>
38 <translate>ECM.LABEL.CONCLUIR</translate> 38 <translate>ECM.LABEL.CONCLUIR</translate>
39 </button> 39 </button>
@@ -43,7 +43,7 @@ @@ -43,7 +43,7 @@
43 <translate>ECM.LABEL.INCLUIRDOCUMENTO</translate> 43 <translate>ECM.LABEL.INCLUIRDOCUMENTO</translate>
44 </button> 44 </button>
45 45
46 -<button type="button" ng-if="unidadeProcesso.usuarioResponsavel.id != usuarioLogado.id" class="btn btn-clear" ng-click="exibirAlertaCapturar()"> 46 +<button type="button" ng-if="unidadeProcesso.usuarioResponsavel.id != usuarioLogado.id && task.id" class="btn btn-clear" ng-click="exibirAlertaCapturar()">
47 <i class="fa fa-thumb-tack"></i> 47 <i class="fa fa-thumb-tack"></i>
48 <translate>ECM.LABEL.CAPTURAR</translate> 48 <translate>ECM.LABEL.CAPTURAR</translate>
49 </button> 49 </button>
@@ -58,23 +58,23 @@ @@ -58,23 +58,23 @@
58 </button> 58 </button>
59 59
60 <ul class="dropdown-menu-center dropdown-menu dropdown-caret" role="menu"> 60 <ul class="dropdown-menu-center dropdown-menu dropdown-caret" role="menu">
61 - <li><a href="#void" ng-click="editProcessoRelacionado();"><i class="fa fa-link"></i> <translate>ECM.LABEL.PROCESSORELACIONADOS</translate></a></li>  
62 - <li><a href="#void" ng-click='enviarProcesso();'><i class="fa fa-share-square-o">&nbsp </i> <translate>ECM.LABEL.ENVIAR_PROCESSO</translate> </a></li>  
63 - <li><a href="#void" ng-click='anexarProcesso();'><i class="fa fa-paperclip">&nbsp </i> <translate>ECM.LABEL.ANEXAR_ESTE_PROCESSO</translate> </a></li> 61 + <li><a href="#void" ng-click="editProcessoRelacionado();" ng-if="task.id"><i class="fa fa-link"></i> <translate>ECM.LABEL.PROCESSORELACIONADOS</translate></a></li>
  62 + <li><a href="#void" ng-click='enviarProcesso();' ng-if="task.id"><i class="fa fa-share-square-o">&nbsp </i> <translate>ECM.LABEL.ENVIAR_PROCESSO</translate> </a></li>
  63 + <li><a href="#void" ng-click='anexarProcesso();' ng-if="task.id"><i class="fa fa-paperclip">&nbsp </i> <translate>ECM.LABEL.ANEXAR_ESTE_PROCESSO</translate> </a></li>
64 64
65 <sec:authorize access="permiteCredenciar()"> 65 <sec:authorize access="permiteCredenciar()">
66 - <li><a href="#void;" ng-click='gerenciarCredenciaisProcesso();'><i class="fa fa-user-plus">&nbsp </i> <translate>ECM.LABEL.GERENCIAR_CREDENCIAIS_ACESSO</translate> </a></li> 66 + <li><a href="#void;" ng-click='gerenciarCredenciaisProcesso();' ng-if="task.id"><i class="fa fa-user-plus">&nbsp </i> <translate>ECM.LABEL.GERENCIAR_CREDENCIAIS_ACESSO</translate> </a></li>
67 </sec:authorize> 67 </sec:authorize>
68 68
69 <sec:authorize access="permiteRenunciar()"> 69 <sec:authorize access="permiteRenunciar()">
70 - <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> 70 + <li><a href="javascript: return false;" ng-click='exibirDialogConfirmacaoRemoverCredencial()' ng-if="task.id"><i class="fa fa-user-times">&nbsp </i> <translate>ECM.LABEL.RENUNCIAR_CREDENCIAL</translate> </a></li>
71 </sec:authorize> 71 </sec:authorize>
72 72
73 <sec:authorize access="hasAnyRole('USER_RESERVADO', 'USER_SECRETO', 'USER_ULTRASSECRETO')"> 73 <sec:authorize access="hasAnyRole('USER_RESERVADO', 'USER_SECRETO', 'USER_ULTRASSECRETO')">
74 <li><a href="#void" ng-click='classificarDocumentoProceso();'><i class="fa fa fa-eye">&nbsp </i> <translate>ECM.LABEL.VALIDAR_NIVEL_ACESSO</translate> </a></li> 74 <li><a href="#void" ng-click='classificarDocumentoProceso();'><i class="fa fa fa-eye">&nbsp </i> <translate>ECM.LABEL.VALIDAR_NIVEL_ACESSO</translate> </a></li>
75 </sec:authorize> 75 </sec:authorize>
76 76
77 - <li><a href="javascript: return false;" ng-click='atribuirProcesso()' ng-if="unidadeProcesso.id"><i class="fa fa-male">&nbsp </i> <translate>ECM.LABEL.ATRIBUIR_PROCESSO</translate> </a></li> 77 + <li><a href="javascript: return false;" ng-click='atribuirProcesso()' ng-if="unidadeProcesso.id && task.id"><i class="fa fa-male">&nbsp </i> <translate>ECM.LABEL.ATRIBUIR_PROCESSO</translate> </a></li>
78 78
79 </ul> 79 </ul>
80 </div> 80 </div>