Commit c557401c015033b493e60410880d3d08b45455c4

Authored by rogerio.costa
1 parent 8e59a33e
Exists in master

#4393 Correção de defeitos encontrados em homologação

cit-ecm-api/src/main/java/br/com/centralit/api/dao/ProcessoDao.java
@@ -6,6 +6,9 @@ import java.util.Collection; @@ -6,6 +6,9 @@ import java.util.Collection;
6 import br.com.centralit.api.model.Processo; 6 import br.com.centralit.api.model.Processo;
7 import br.com.centralit.framework.dao.arquitetura.CitGenericDAO; 7 import br.com.centralit.framework.dao.arquitetura.CitGenericDAO;
8 8
  9 +import com.googlecode.genericdao.search.ISearch;
  10 +import com.googlecode.genericdao.search.SearchResult;
  11 +
9 /** 12 /**
10 * <p> 13 * <p>
11 * <img src="http://centralit.com.br/images/logo_central.png"> 14 * <img src="http://centralit.com.br/images/logo_central.png">
@@ -58,67 +61,99 @@ public interface ProcessoDao extends CitGenericDAO { @@ -58,67 +61,99 @@ public interface ProcessoDao extends CitGenericDAO {
58 * @return Collection<Processo> 61 * @return Collection<Processo>
59 */ 62 */
60 Collection<Processo> findPorPlanoClassificacao(Long idPlanoClassificacao); 63 Collection<Processo> findPorPlanoClassificacao(Long idPlanoClassificacao);
61 -  
62 - 64 +
63 /** 65 /**
64 * 66 *
65 - * <p><b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a></p>  
66 - *  
67 - * <p><b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a></p>  
68 - * 67 + * <p>
  68 + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a>
  69 + * </p>
  70 + *
  71 + * <p>
  72 + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a>
  73 + * </p>
  74 + *
69 * Método responsável por 75 * Método responsável por
70 - * 76 + *
71 * @author andre.silva 77 * @author andre.silva
72 - * 78 + *
73 * @param idProcesso 79 * @param idProcesso
74 * @param data 80 * @param data
75 * @return 81 * @return
76 */ 82 */
77 Long obterQuantidadePorProcessoEDataCriacao(Calendar dataInicial, Calendar dataFinal); 83 Long obterQuantidadePorProcessoEDataCriacao(Calendar dataInicial, Calendar dataFinal);
78 -  
79 - 84 +
80 /** 85 /**
81 * 86 *
82 - * <p><b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a></p>  
83 - *  
84 - * <p><b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a></p>  
85 - * 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 + *
86 * Método responsável por 95 * Método responsável por
87 - * 96 + *
88 * @author andre.silva 97 * @author andre.silva
89 - * 98 + *
90 * @param processo 99 * @param processo
91 * @return 100 * @return
92 */ 101 */
93 Boolean isProcessoAbertoEmOutrasUnidades(Processo processo); 102 Boolean isProcessoAbertoEmOutrasUnidades(Processo processo);
94 - 103 +
95 /** 104 /**
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 - * 105 + * <p>
  106 + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a>
  107 + * </p>
  108 + *
  109 + * <p>
  110 + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a>
  111 + * </p>
  112 + *
100 * Método responsável por 113 * Método responsável por
101 - * 114 + *
102 * @author maycon.silva 115 * @author maycon.silva
103 - * 116 + *
104 * @param idProcessInstance 117 * @param idProcessInstance
105 * @return 118 * @return
106 */ 119 */
107 Processo getProcessoByIdProcessInstance(Long idProcessInstance); 120 Processo getProcessoByIdProcessInstance(Long idProcessInstance);
108 121
109 -  
110 /** 122 /**
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 - * 123 + * <p>
  124 + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a>
  125 + * </p>
  126 + *
  127 + * <p>
  128 + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a>
  129 + * </p>
  130 + *
115 * Método responsável por 131 * Método responsável por
116 - * 132 + *
117 * @author maycon.silva 133 * @author maycon.silva
118 - * 134 + *
119 * @param nup 135 * @param nup
120 * @return 136 * @return
121 */ 137 */
122 Processo getProcessoByProtocolo(String nup); 138 Processo getProcessoByProtocolo(String nup);
123 139
  140 + /**
  141 + * <p>
  142 + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a>
  143 + * </p>
  144 + *
  145 + * <p>
  146 + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a>
  147 + * </p>
  148 + *
  149 + * Método responsável por listar através da permissão que o usuario tem
  150 + *
  151 + * @author rogerio.costa
  152 + *
  153 + * @param search
  154 + *
  155 + * @return <RT> SearchResult<RT>
  156 + */
  157 + <RT> SearchResult<RT> searchAndCountPorSigilo(ISearch search);
  158 +
124 } 159 }
cit-ecm-api/src/main/java/br/com/centralit/api/dao/impl/ProcessoDaoHibernate.java
@@ -170,8 +170,24 @@ public class ProcessoDaoHibernate extends CitGenericDAOImpl implements ProcessoD @@ -170,8 +170,24 @@ public class ProcessoDaoHibernate extends CitGenericDAOImpl implements ProcessoD
170 return searchUnique(search); 170 return searchUnique(search);
171 } 171 }
172 172
173 - @Override  
174 - public <RT> SearchResult<RT> searchAndCount(ISearch search) { 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 listar através da permissão que o usuario tem
  183 + *
  184 + * @author rogerio.costa
  185 + *
  186 + * @param search
  187 + *
  188 + * @return <RT> SearchResult<RT>
  189 + */
  190 + public <RT> SearchResult<RT> searchAndCountPorSigilo(ISearch search) {
175 191
176 Long idUsuario = ( (Usuario) SecurityContextHolder.getContext().getAuthentication().getPrincipal() ).getId(); 192 Long idUsuario = ( (Usuario) SecurityContextHolder.getContext().getAuthentication().getPrincipal() ).getId();
177 193
cit-ecm-api/src/main/java/br/com/centralit/api/service/ProcessoService.java
@@ -4,6 +4,9 @@ import br.com.centralit.api.model.PlanoClassificacao; @@ -4,6 +4,9 @@ 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 +import com.googlecode.genericdao.search.ISearch;
  8 +import com.googlecode.genericdao.search.SearchResult;
  9 +
7 /** 10 /**
8 * <p> 11 * <p>
9 * <img src="http://centralit.com.br/images/logo_central.png"> 12 * <img src="http://centralit.com.br/images/logo_central.png">
@@ -200,4 +203,23 @@ public interface ProcessoService extends GenericService&lt;Processo, Long&gt; { @@ -200,4 +203,23 @@ public interface ProcessoService extends GenericService&lt;Processo, Long&gt; {
200 */ 203 */
201 Boolean verificarAtribuicaoProcessoPrimeiroAcesso(Long idProcesso); 204 Boolean verificarAtribuicaoProcessoPrimeiroAcesso(Long idProcesso);
202 205
  206 + /**
  207 + * <p>
  208 + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a>
  209 + * </p>
  210 + *
  211 + * <p>
  212 + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a>
  213 + * </p>
  214 + *
  215 + * Método responsável por listar através da permissão que o usuario tem
  216 + *
  217 + * @author rogerio.costa
  218 + *
  219 + * @param search
  220 + *
  221 + * @return <RT> SearchResult<RT>
  222 + */
  223 + <RT> SearchResult<RT> searchAndCountPorSigilo(ISearch search);
  224 +
203 } 225 }
cit-ecm-api/src/main/java/br/com/centralit/api/service/impl/ProcessoServiceImpl.java
@@ -19,6 +19,9 @@ import org.springframework.beans.factory.annotation.Qualifier; @@ -19,6 +19,9 @@ import org.springframework.beans.factory.annotation.Qualifier;
19 import org.springframework.stereotype.Service; 19 import org.springframework.stereotype.Service;
20 import org.springframework.validation.Validator; 20 import org.springframework.validation.Validator;
21 21
  22 +import com.googlecode.genericdao.search.ISearch;
  23 +import com.googlecode.genericdao.search.SearchResult;
  24 +
22 import br.com.centralit.api.dao.ProcessoDao; 25 import br.com.centralit.api.dao.ProcessoDao;
23 import br.com.centralit.api.model.DocumentoGed; 26 import br.com.centralit.api.model.DocumentoGed;
24 import br.com.centralit.api.model.EstruturaOrganizacionalECM; 27 import br.com.centralit.api.model.EstruturaOrganizacionalECM;
@@ -165,7 +168,7 @@ public class ProcessoServiceImpl extends GenericServiceImpl&lt;Processo, Long&gt; impl @@ -165,7 +168,7 @@ public class ProcessoServiceImpl extends GenericServiceImpl&lt;Processo, Long&gt; impl
165 168
166 try { 169 try {
167 170
168 - this.solrService.addProcesso(processo); 171 + this.solrService.addProcesso(processo);
169 } catch (final Exception e) { 172 } catch (final Exception e) {
170 173
171 e.printStackTrace(); 174 e.printStackTrace();
@@ -215,7 +218,7 @@ public class ProcessoServiceImpl extends GenericServiceImpl&lt;Processo, Long&gt; impl @@ -215,7 +218,7 @@ public class ProcessoServiceImpl extends GenericServiceImpl&lt;Processo, Long&gt; impl
215 this.documentoGedService.atualizarSigiloDocumentos(entity.getDocumentos()); 218 this.documentoGedService.atualizarSigiloDocumentos(entity.getDocumentos());
216 219
217 if (UtilObjeto.isReferencia(processo.getAprovado()) && processo.getAprovado()) { 220 if (UtilObjeto.isReferencia(processo.getAprovado()) && processo.getAprovado()) {
218 - 221 +
219 this.startBusinessProcess(processo); 222 this.startBusinessProcess(processo);
220 } 223 }
221 return processo; 224 return processo;
@@ -1029,6 +1032,28 @@ public class ProcessoServiceImpl extends GenericServiceImpl&lt;Processo, Long&gt; impl @@ -1029,6 +1032,28 @@ public class ProcessoServiceImpl extends GenericServiceImpl&lt;Processo, Long&gt; impl
1029 } 1032 }
1030 1033
1031 /** 1034 /**
  1035 + * <p>
  1036 + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a>
  1037 + * </p>
  1038 + *
  1039 + * <p>
  1040 + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a>
  1041 + * </p>
  1042 + *
  1043 + * Método responsável por listar através da permissão que o usuario tem
  1044 + *
  1045 + * @author rogerio.costa
  1046 + *
  1047 + * @param search
  1048 + *
  1049 + * @return <RT> SearchResult<RT>
  1050 + */
  1051 + public <RT> SearchResult<RT> searchAndCountPorSigilo(ISearch search) {
  1052 +
  1053 + return this.processoDao.searchAndCountPorSigilo(search);
  1054 + }
  1055 +
  1056 + /**
1032 * 1057 *
1033 */ 1058 */
1034 @Override 1059 @Override
cit-ecm-web/src/main/java/br/com/centralit/controller/ProcessoController.java
1 package br.com.centralit.controller; 1 package br.com.centralit.controller;
2 2
3 import org.springframework.beans.factory.annotation.Autowired; 3 import org.springframework.beans.factory.annotation.Autowired;
  4 +import org.springframework.security.core.context.SecurityContextHolder;
4 import org.springframework.stereotype.Controller; 5 import org.springframework.stereotype.Controller;
5 import org.springframework.web.bind.annotation.RequestBody; 6 import org.springframework.web.bind.annotation.RequestBody;
6 import org.springframework.web.bind.annotation.RequestMapping; 7 import org.springframework.web.bind.annotation.RequestMapping;
@@ -10,10 +11,20 @@ import org.springframework.web.bind.annotation.ResponseBody; @@ -10,10 +11,20 @@ import org.springframework.web.bind.annotation.ResponseBody;
10 11
11 import br.com.centralit.api.model.Processo; 12 import br.com.centralit.api.model.Processo;
12 import br.com.centralit.api.service.ProcessoService; 13 import br.com.centralit.api.service.ProcessoService;
  14 +import br.com.centralit.api.service.UsuarioService;
13 import br.com.centralit.framework.controller.GenericController; 15 import br.com.centralit.framework.controller.GenericController;
  16 +import br.com.centralit.framework.dao.arquitetura.SearchSeven;
14 import br.com.centralit.framework.json.ResponseBodyWrapper; 17 import br.com.centralit.framework.json.ResponseBodyWrapper;
15 import br.com.centralit.framework.json.Views; 18 import br.com.centralit.framework.json.Views;
16 import br.com.centralit.framework.json.Views.GenericView; 19 import br.com.centralit.framework.json.Views.GenericView;
  20 +import br.com.centralit.framework.model.SearchParams;
  21 +import br.com.centralit.framework.model.Usuario;
  22 +import br.com.centralit.framework.util.UtilString;
  23 +import br.com.centralit.framework.view.GridVH;
  24 +import br.com.centralit.framework.view.ResultResponseVH;
  25 +
  26 +import com.googlecode.genericdao.search.Search;
  27 +import com.googlecode.genericdao.search.SearchResult;
17 28
18 @Controller 29 @Controller
19 @RequestMapping("/rest/processo") 30 @RequestMapping("/rest/processo")
@@ -23,6 +34,10 @@ public class ProcessoController extends GenericController&lt;Processo&gt; { @@ -23,6 +34,10 @@ public class ProcessoController extends GenericController&lt;Processo&gt; {
23 @Autowired 34 @Autowired
24 private ProcessoService processoService; 35 private ProcessoService processoService;
25 36
  37 + /** Atributo usuarioService. */
  38 + @Autowired
  39 + private UsuarioService usuarioService;
  40 +
26 @Autowired 41 @Autowired
27 public ProcessoController( ProcessoService processoService ) { 42 public ProcessoController( ProcessoService processoService ) {
28 43
@@ -133,6 +148,40 @@ public class ProcessoController extends GenericController&lt;Processo&gt; { @@ -133,6 +148,40 @@ public class ProcessoController extends GenericController&lt;Processo&gt; {
133 return responseBody; 148 return responseBody;
134 } 149 }
135 150
  151 + @RequestMapping(value = "/getPage", method = RequestMethod.POST)
  152 + @ResponseBody
  153 + @SuppressWarnings("rawtypes")
  154 + public ResponseBodyWrapper findGrid(@RequestBody SearchParams searchParams) {
  155 +
  156 + SearchSeven search;
  157 +
  158 + search = new SearchSeven(searchParams);
  159 +
  160 + search.setResultMode(Search.RESULT_MAP);
  161 +
  162 + SearchResult searchResult = null;
  163 +
  164 + if (!UtilString.isNullOrEmpty(searchParams.getNome()) && searchParams.getNome().equals("GRID_CLASSIFICACAO_PROCESSO_DOCUMENTO")) {
  165 +
  166 + searchResult = this.processoService.searchAndCountPorSigilo(search);
  167 +
  168 + } else {
  169 +
  170 + searchResult = genericService.searchAndCount(search);
  171 + }
  172 +
  173 + // DETERMINA QUAIS OS CAMPOS VAI CONSULTAR
  174 + GridVH gridVH = new GridVH();
  175 + gridVH.setObjects(searchResult.getResult());
  176 + gridVH.addTotalItensTotalPages(searchParams, Long.valueOf(searchResult.getTotalCount()));
  177 +
  178 + ResultResponseVH resultResponseVH = new ResultResponseVH(gridVH);
  179 +
  180 + ResponseBodyWrapper responseBody = new ResponseBodyWrapper(resultResponseVH, this.getListView());
  181 +
  182 + return responseBody;
  183 + }
  184 +
136 @Override 185 @Override
137 public Class<Views.ProcessoEdit> getEditView() { 186 public Class<Views.ProcessoEdit> getEditView() {
138 187
cit-ecm-web/src/main/java/br/com/centralit/listener/StartupListenerEcm.java
@@ -357,7 +357,7 @@ public class StartupListenerEcm extends UtilStartup implements ApplicationListen @@ -357,7 +357,7 @@ public class StartupListenerEcm extends UtilStartup implements ApplicationListen
357 internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.PRAZO_TEMPORALIDADE", "Unidade gestora", dominio, modulo)); 357 internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.PRAZO_TEMPORALIDADE", "Unidade gestora", dominio, modulo));
358 internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.CLASSIFICACAO_ARQUIVISTICA", "Classificação Arquivística (Assunto)", dominio, modulo)); 358 internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.CLASSIFICACAO_ARQUIVISTICA", "Classificação Arquivística (Assunto)", dominio, modulo));
359 internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.CRIADO_EM", "Criado em", dominio, modulo)); 359 internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.CRIADO_EM", "Criado em", dominio, modulo));
360 - internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.DATA_CONCLUSAO", "Criado em", dominio, modulo)); 360 + internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.DATA_CONCLUSAO", "Data conclusão", dominio, modulo));
361 internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.SIGILO", "Sigilo", dominio, modulo)); 361 internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.SIGILO", "Sigilo", dominio, modulo));
362 internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.TEXTO", "Texto", dominio, modulo)); 362 internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.TEXTO", "Texto", dominio, modulo));
363 internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.PADRAO", "Padrão", dominio, modulo)); 363 internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.PADRAO", "Padrão", dominio, modulo));
cit-ecm-web/src/main/webapp/assets/js/angular/custom/controller/ClassificarDocumentoProcessoListController.js
@@ -41,6 +41,7 @@ citApp.controller(&#39;ClassificarDocumentoProcessoListController&#39;, [&#39;$scope&#39;, &#39;Proc @@ -41,6 +41,7 @@ citApp.controller(&#39;ClassificarDocumentoProcessoListController&#39;, [&#39;$scope&#39;, &#39;Proc
41 41
42 $scope.filterCriteria = { 42 $scope.filterCriteria = {
43 start : 1, 43 start : 1,
  44 + nome : "GRID_CLASSIFICACAO_PROCESSO_DOCUMENTO",
44 dir : 'asc', 45 dir : 'asc',
45 sort : 'id', 46 sort : 'id',
46 limit : 10, 47 limit : 10,
cit-ecm-web/src/main/webapp/assets/js/angular/custom/controller/DocumentoGedController.js
@@ -155,11 +155,8 @@ citApp.controller(&#39;DocumentoGedController&#39;, [&#39;$scope&#39;, &#39;DocumentoGedRepository&#39;, @@ -155,11 +155,8 @@ citApp.controller(&#39;DocumentoGedController&#39;, [&#39;$scope&#39;, &#39;DocumentoGedRepository&#39;,
155 }; 155 };
156 156
157 $scope.saveDocumento = function(){ 157 $scope.saveDocumento = function(){
158 - var processo = {  
159 - id : $scope.$parent.$parent.processo.id  
160 - };  
161 -  
162 - var isNew = $scope.documentoGed.id; 158 +
  159 + var isNew = $scope.documentoGed.id;
163 160
164 //Remove as propriedades para realizar a requisição do ducmentoGed 161 //Remove as propriedades para realizar a requisição do ducmentoGed
165 $scope.removePropriedades(); 162 $scope.removePropriedades();
@@ -167,38 +164,13 @@ citApp.controller(&#39;DocumentoGedController&#39;, [&#39;$scope&#39;, &#39;DocumentoGedRepository&#39;, @@ -167,38 +164,13 @@ citApp.controller(&#39;DocumentoGedController&#39;, [&#39;$scope&#39;, &#39;DocumentoGedRepository&#39;,
167 DocumentoGedRepository.save($scope.documentoGed).then(function(result) { 164 DocumentoGedRepository.save($scope.documentoGed).then(function(result) {
168 165
169 $scope.documentoGed = result.originalElement; 166 $scope.documentoGed = result.originalElement;
170 - 167 + $scope.saveHistorico(isNew);
171 $scope.saveUpload(); 168 $scope.saveUpload();
172 $scope.showAlert("success", $translate.instant('MSG.REGISTRO_SALVO')); 169 $scope.showAlert("success", $translate.instant('MSG.REGISTRO_SALVO'));
173 $scope.documentoGedForm.$submitted = false; 170 $scope.documentoGedForm.$submitted = false;
174 //Remove as propriedades para realizar a requisição do ducmentoGed 171 //Remove as propriedades para realizar a requisição do ducmentoGed
175 $scope.removePropriedades(); 172 $scope.removePropriedades();
176 -  
177 - if(!isNew){  
178 - var historicoAlteracaoProcesso = {  
179 - descricaoAcao : $translate.instant('ECM.MSG_HISTORICO_ECM.INCLUSAO_DOCUMENTO'),  
180 - processo : processo,  
181 - autor : $scope.usuarioLogado,  
182 - acaoAlteracao : "INCLUSAO_DOCUMENTO",  
183 - idTask : $scope.task.id,  
184 - mapaAtributos : {"tipo_documento" : $scope.documentoGed.tipoDocumento.nome, "numero_documento" : $scope.documentoGed.numero}  
185 - };  
186 - HistoricoAlteracaoProcessoRepository.saveParams(historicoAlteracaoProcesso).then(function(result){  
187 -  
188 - });  
189 -  
190 - } else {  
191 - var historicoAlteracaoProcesso = {  
192 - descricaoAcao : $translate.instant('ECM.MSG_HISTORICO_ECM.CRIACAO_NOVA_VERSAO_DOCUMENTO'),  
193 - processo : processo,  
194 - autor : $scope.usuarioLogado,  
195 - acaoAlteracao : "CRIACAO_NOVA_VERSAO_DOCUMENTO",  
196 - idTask : $scope.task.id,  
197 - mapaAtributos : {"tipo_documento" : $scope.documentoGed.tipoDocumento.nome, "numero_documento" : $scope.documentoGed.numero, "numero_versao" : $scope.documentoGed.versaoDocumento.toFixed(1)}  
198 - };  
199 - HistoricoAlteracaoProcessoRepository.saveParams(historicoAlteracaoProcesso).then(function(result){  
200 - });  
201 - } 173 +
202 $timeout(function(){ 174 $timeout(function(){
203 $scope.$parent.$parent.closeWidget(); 175 $scope.$parent.$parent.closeWidget();
204 $scope.atualizaProcesso(); 176 $scope.atualizaProcesso();
@@ -209,6 +181,36 @@ citApp.controller(&#39;DocumentoGedController&#39;, [&#39;$scope&#39;, &#39;DocumentoGedRepository&#39;, @@ -209,6 +181,36 @@ citApp.controller(&#39;DocumentoGedController&#39;, [&#39;$scope&#39;, &#39;DocumentoGedRepository&#39;,
209 181
210 }; 182 };
211 183
  184 + //Salvar o histórico do documento
  185 + $scope.saveHistorico = function(isNew){
  186 +
  187 + if(!isNew){
  188 + var historicoAlteracaoProcesso = {
  189 + descricaoAcao : $translate.instant('ECM.MSG_HISTORICO_ECM.INCLUSAO_DOCUMENTO'),
  190 + processo : $scope.documentoGed.processo,
  191 + autor : $scope.usuarioLogado,
  192 + acaoAlteracao : "INCLUSAO_DOCUMENTO",
  193 + idTask : $scope.task.id,
  194 + mapaAtributos : {"tipo_documento" : $scope.documentoGed.tipoDocumento.nome, "numero_documento" : $scope.documentoGed.numero}
  195 + };
  196 + HistoricoAlteracaoProcessoRepository.saveParams(historicoAlteracaoProcesso).then(function(result){
  197 +
  198 + });
  199 +
  200 + } else {
  201 + var historicoAlteracaoProcesso = {
  202 + descricaoAcao : $translate.instant('ECM.MSG_HISTORICO_ECM.CRIACAO_NOVA_VERSAO_DOCUMENTO'),
  203 + processo : $scope.documentoGed.processo,
  204 + autor : $scope.usuarioLogado,
  205 + acaoAlteracao : "CRIACAO_NOVA_VERSAO_DOCUMENTO",
  206 + idTask : $scope.task.id,
  207 + mapaAtributos : {"tipo_documento" : $scope.documentoGed.tipoDocumento.nome, "numero_documento" : $scope.documentoGed.numero, "numero_versao" : $scope.documentoGed.versaoDocumento.toFixed(1)}
  208 + };
  209 + HistoricoAlteracaoProcessoRepository.saveParams(historicoAlteracaoProcesso).then(function(result){
  210 + });
  211 + }
  212 + };
  213 +
212 // Limpa o formulario preenchido 214 // Limpa o formulario preenchido
213 $scope.limparDocumentoGed = function(){ 215 $scope.limparDocumentoGed = function(){
214 $scope.documentoGed = { 216 $scope.documentoGed = {
cit-ecm-web/src/main/webapp/html/gerenciarProcesso/gerenciarProcessoListUnidade.html
1 <meta charset="UTF-8"> 1 <meta charset="UTF-8">
2 -<div id="idGerenciamentoTarefas" class="page-content" ng-controller="GerenciarProcessoListUnidadeController"> 2 +<div id="idGerenciamentoTarefas" class="page-content" ng-controller="GerenciarProcessoListUnidadeController" ng-init="init(workflowFilterCriteriaService.getSIGADFilterCriteria())">
3 <div class="bar-buttons-action fixed"> 3 <div class="bar-buttons-action fixed">
4 <div class="row"> 4 <div class="row">
5 <div class="col-sm-9 text-left"> 5 <div class="col-sm-9 text-left">
cit-ecm-web/src/main/webapp/html/gerenciarProcesso/includeDocumentosProcesso.html
@@ -3,6 +3,8 @@ @@ -3,6 +3,8 @@
3 <div class="user"> 3 <div class="user">
4 <i class="{{documento.icon}}" title="{{documento.anexo.dominioTipoAnexo.descricao}}"></i> 4 <i class="{{documento.icon}}" title="{{documento.anexo.dominioTipoAnexo.descricao}}"></i>
5 </div> 5 </div>
  6 +
  7 + <pre>{{documento.icon}}</pre>
6 8
7 <div class="body"> 9 <div class="body">
8 <div class="text ellipsis" tooltip="{{documento.tipoDocumento.nome}} - {{documento.numero}}"> 10 <div class="text ellipsis" tooltip="{{documento.tipoDocumento.nome}} - {{documento.numero}}">