Commit 3285929ad6991141d2f289b68b93f82cc9ba1834
1 parent
36fde9ef
Exists in
master
[Redmine #4466
Commit parcial.
Showing
15 changed files
with
742 additions
and
89 deletions
Show diff stats
cit-ecm-api/src/main/java/br/com/centralit/api/dao/TarjaAssinaturaDao.java
0 → 100644
cit-ecm-api/src/main/java/br/com/centralit/api/framework/json/ViewsEcm.java
@@ -6,105 +6,107 @@ import br.com.centralit.framework.json.Views; | @@ -6,105 +6,107 @@ import br.com.centralit.framework.json.Views; | ||
6 | * <p> | 6 | * <p> |
7 | * <img src="http://centralit.com.br/images/logo_central.png"> | 7 | * <img src="http://centralit.com.br/images/logo_central.png"> |
8 | * </p> | 8 | * </p> |
9 | - * | 9 | + * |
10 | * <p> | 10 | * <p> |
11 | * <b>Company: </b> Central IT - Governança Corporativa - | 11 | * <b>Company: </b> Central IT - Governança Corporativa - |
12 | * </p> | 12 | * </p> |
13 | - * | 13 | + * |
14 | * <p> | 14 | * <p> |
15 | * <b>Title: </b> | 15 | * <b>Title: </b> |
16 | * </p> | 16 | * </p> |
17 | - * | 17 | + * |
18 | * <p> | 18 | * <p> |
19 | * <b>Description: </b> | 19 | * <b>Description: </b> |
20 | * </p> | 20 | * </p> |
21 | - * | 21 | + * |
22 | * <p> | 22 | * <p> |
23 | * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a> | 23 | * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a> |
24 | * </p> | 24 | * </p> |
25 | - * | 25 | + * |
26 | * <p> | 26 | * <p> |
27 | * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> | 27 | * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> |
28 | * </p> | 28 | * </p> |
29 | - * | 29 | + * |
30 | * @since 22/06/2015 - 15:10:43 | 30 | * @since 22/06/2015 - 15:10:43 |
31 | - * | 31 | + * |
32 | * @version 1.0.0 | 32 | * @version 1.0.0 |
33 | - * | 33 | + * |
34 | * @author lucas.ribeiro - (<a href="mailto:lucas.ribeiro@centralit.com.br">lucas.ribeiro@centralit.com.br</a>) | 34 | * @author lucas.ribeiro - (<a href="mailto:lucas.ribeiro@centralit.com.br">lucas.ribeiro@centralit.com.br</a>) |
35 | - * | 35 | + * |
36 | */ | 36 | */ |
37 | public class ViewsEcm extends Views { | 37 | public class ViewsEcm extends Views { |
38 | 38 | ||
39 | public static class PlanoClassificacaoListView extends Views.GenericView {}; | 39 | public static class PlanoClassificacaoListView extends Views.GenericView {}; |
40 | 40 | ||
41 | public static class PlanoClassificacaoEditView extends PlanoClassificacaoListView {}; | 41 | public static class PlanoClassificacaoEditView extends PlanoClassificacaoListView {}; |
42 | - | 42 | + |
43 | public static class PlanoClassificacaoParent extends Views.GenericView {}; | 43 | public static class PlanoClassificacaoParent extends Views.GenericView {}; |
44 | - | 44 | + |
45 | public static class PlanoClassificacaoFilho extends Views.GenericView{}; | 45 | public static class PlanoClassificacaoFilho extends Views.GenericView{}; |
46 | - | 46 | + |
47 | public static class PlanoClassificacaoAutocompleteRecursive extends Views.GenericView{}; | 47 | public static class PlanoClassificacaoAutocompleteRecursive extends Views.GenericView{}; |
48 | - | 48 | + |
49 | public static class PlanoCLassificacaoAutoComplete extends Views.GenericView{}; | 49 | public static class PlanoCLassificacaoAutoComplete extends Views.GenericView{}; |
50 | - | 50 | + |
51 | public static class TipoDocumentoList extends Views.GenericView{}; | 51 | public static class TipoDocumentoList extends Views.GenericView{}; |
52 | - | 52 | + |
53 | public static class TipoDocumentoEdit extends TipoDocumentoList {}; | 53 | public static class TipoDocumentoEdit extends TipoDocumentoList {}; |
54 | - | 54 | + |
55 | public static class HipoteseLegalList extends Views.GenericView{}; | 55 | public static class HipoteseLegalList extends Views.GenericView{}; |
56 | - | 56 | + |
57 | public static class HipoteseLegalEdit extends HipoteseLegalList {}; | 57 | public static class HipoteseLegalEdit extends HipoteseLegalList {}; |
58 | - | 58 | + |
59 | public static class TipoProcessoList extends Views.GenericView{}; | 59 | public static class TipoProcessoList extends Views.GenericView{}; |
60 | - | 60 | + |
61 | public static class TipoProcessoEdit extends TipoProcessoList {}; | 61 | public static class TipoProcessoEdit extends TipoProcessoList {}; |
62 | - | 62 | + |
63 | public static class NivelAcessoTipoDocumentoList extends Views.GenericView{}; | 63 | public static class NivelAcessoTipoDocumentoList extends Views.GenericView{}; |
64 | - | 64 | + |
65 | public static class NivelAcessoTipoDocumentoEdit extends NivelAcessoTipoDocumentoList{}; | 65 | public static class NivelAcessoTipoDocumentoEdit extends NivelAcessoTipoDocumentoList{}; |
66 | - | 66 | + |
67 | public static class ClassificarProcessoDocumentoList extends Views.GenericView{}; | 67 | public static class ClassificarProcessoDocumentoList extends Views.GenericView{}; |
68 | - | 68 | + |
69 | public static class ClassificarProcessoDocumento extends ClassificarProcessoDocumentoList{}; | 69 | public static class ClassificarProcessoDocumento extends ClassificarProcessoDocumentoList{}; |
70 | - | 70 | + |
71 | public static class NivelAcessoTipoProcessoList extends Views.GenericView{}; | 71 | public static class NivelAcessoTipoProcessoList extends Views.GenericView{}; |
72 | - | 72 | + |
73 | public static class NivelAcessoTipoProcessoEdit extends NivelAcessoTipoProcessoList{}; | 73 | public static class NivelAcessoTipoProcessoEdit extends NivelAcessoTipoProcessoList{}; |
74 | - | 74 | + |
75 | public static class InteressadoProcessoList extends Views.GenericView{}; | 75 | public static class InteressadoProcessoList extends Views.GenericView{}; |
76 | - | 76 | + |
77 | public static class InteressadoProcessoEdit extends InteressadoProcessoList{}; | 77 | public static class InteressadoProcessoEdit extends InteressadoProcessoList{}; |
78 | - | 78 | + |
79 | public static class HistoricoProcessoView extends Views.GenericView{}; | 79 | public static class HistoricoProcessoView extends Views.GenericView{}; |
80 | - | 80 | + |
81 | public static class CancelamentoDocumentoView extends Views.GenericView{}; | 81 | public static class CancelamentoDocumentoView extends Views.GenericView{}; |
82 | - | 82 | + |
83 | public static class TemplatePadraoListView extends Views.GenericView{}; | 83 | public static class TemplatePadraoListView extends Views.GenericView{}; |
84 | - | 84 | + |
85 | public static class TemplatePadraoEditView extends ViewsEcm.TemplatePadraoListView{}; | 85 | public static class TemplatePadraoEditView extends ViewsEcm.TemplatePadraoListView{}; |
86 | - | 86 | + |
87 | public static class CabecalhoListView extends Views.GenericView{}; | 87 | public static class CabecalhoListView extends Views.GenericView{}; |
88 | - | 88 | + |
89 | public static class CabecalhoEditView extends ViewsEcm.CabecalhoListView{}; | 89 | public static class CabecalhoEditView extends ViewsEcm.CabecalhoListView{}; |
90 | - | 90 | + |
91 | public static class CabecalhoAutoCompleteView extends Views.GenericView{}; | 91 | public static class CabecalhoAutoCompleteView extends Views.GenericView{}; |
92 | - | 92 | + |
93 | public static class RodapeListView extends Views.GenericView{}; | 93 | public static class RodapeListView extends Views.GenericView{}; |
94 | - | 94 | + |
95 | public static class RodapeEditView extends ViewsEcm.RodapeListView{}; | 95 | public static class RodapeEditView extends ViewsEcm.RodapeListView{}; |
96 | - | 96 | + |
97 | public static class RodapeAutoCompleteView extends Views.GenericView{}; | 97 | public static class RodapeAutoCompleteView extends Views.GenericView{}; |
98 | - | 98 | + |
99 | public static class TipoDocumentoPlanoClassificacaoAutoCompleteView extends Views.GenericView{}; | 99 | public static class TipoDocumentoPlanoClassificacaoAutoCompleteView extends Views.GenericView{}; |
100 | 100 | ||
101 | public static class ClassificacaoDocumentoGedView extends Views.GenericView{}; | 101 | public static class ClassificacaoDocumentoGedView extends Views.GenericView{}; |
102 | 102 | ||
103 | public static class HistoricoAtribuicaoProcessoView extends Views.GenericView{}; | 103 | public static class HistoricoAtribuicaoProcessoView extends Views.GenericView{}; |
104 | - | 104 | + |
105 | public static class TipoSuporteDocumentoListView extends Views.GenericView{}; | 105 | public static class TipoSuporteDocumentoListView extends Views.GenericView{}; |
106 | - | 106 | + |
107 | public static class TipoSuporteDocumentoEdit extends TipoSuporteDocumentoListView{}; | 107 | public static class TipoSuporteDocumentoEdit extends TipoSuporteDocumentoListView{}; |
108 | - | ||
109 | - | 108 | + |
109 | + public static class TarjaAssinaturaListview extends Views.GenericView{}; | ||
110 | + | ||
111 | + public static class TarjaAssinaturaEditview extends ViewsEcm.TarjaAssinaturaListview{}; | ||
110 | } | 112 | } |
cit-ecm-api/src/main/java/br/com/centralit/api/model/TarjaAssinatura.java
0 → 100644
@@ -0,0 +1,97 @@ | @@ -0,0 +1,97 @@ | ||
1 | +package br.com.centralit.api.model; | ||
2 | + | ||
3 | +import javax.persistence.Column; | ||
4 | +import javax.persistence.Entity; | ||
5 | +import javax.persistence.FetchType; | ||
6 | +import javax.persistence.GeneratedValue; | ||
7 | +import javax.persistence.GenerationType; | ||
8 | +import javax.persistence.Id; | ||
9 | +import javax.persistence.ManyToOne; | ||
10 | +import javax.persistence.OneToOne; | ||
11 | + | ||
12 | +import com.fasterxml.jackson.annotation.JsonView; | ||
13 | + | ||
14 | +import br.com.centralit.api.framework.json.ViewsEcm; | ||
15 | +import br.com.centralit.framework.json.Views; | ||
16 | +import br.com.centralit.framework.model.AnexoImagem; | ||
17 | +import br.com.centralit.framework.model.Dominio; | ||
18 | +import br.com.centralit.framework.model.arquitetura.PersistentObjectAudit; | ||
19 | + | ||
20 | +@Entity | ||
21 | +public class TarjaAssinatura extends PersistentObjectAudit{ | ||
22 | + | ||
23 | + private static final long serialVersionUID = -7187159662335439914L; | ||
24 | + | ||
25 | + @Id | ||
26 | + @GeneratedValue(strategy = GenerationType.AUTO) | ||
27 | + @JsonView({ Views.GenericView.class }) | ||
28 | + private Long id; | ||
29 | + | ||
30 | + @JsonView({ ViewsEcm.TarjaAssinaturaEditview.class }) | ||
31 | + @Column (length=100, nullable = false) | ||
32 | + private String descricao; | ||
33 | + | ||
34 | + @ManyToOne(fetch = FetchType.LAZY) | ||
35 | + @Column (nullable = false) | ||
36 | + @JsonView({ ViewsEcm.TarjaAssinaturaEditview.class }) | ||
37 | + private Dominio tipoAssinatura; | ||
38 | + | ||
39 | + /** Conteúdo em HTML*/ | ||
40 | + @JsonView({ ViewsEcm.TarjaAssinaturaEditview.class }) | ||
41 | + @Column (length=1000, nullable = false) | ||
42 | + private String conteudo; | ||
43 | + | ||
44 | + @OneToOne | ||
45 | + @JsonView({ ViewsEcm.TarjaAssinaturaEditview.class }) | ||
46 | + private AnexoImagem anexoImagem; | ||
47 | + | ||
48 | + public Long getId() { | ||
49 | + | ||
50 | + return id; | ||
51 | + } | ||
52 | + | ||
53 | + public void setId(Long id) { | ||
54 | + | ||
55 | + this.id = id; | ||
56 | + } | ||
57 | + | ||
58 | + public String getDescricao() { | ||
59 | + | ||
60 | + return descricao; | ||
61 | + } | ||
62 | + | ||
63 | + public void setDescricao(String descricao) { | ||
64 | + | ||
65 | + this.descricao = descricao; | ||
66 | + } | ||
67 | + | ||
68 | + public Dominio getTipoAssinatura() { | ||
69 | + | ||
70 | + return tipoAssinatura; | ||
71 | + } | ||
72 | + | ||
73 | + public void setTipoAssinatura(Dominio tipoAssinatura) { | ||
74 | + | ||
75 | + this.tipoAssinatura = tipoAssinatura; | ||
76 | + } | ||
77 | + | ||
78 | + public String getConteudo() { | ||
79 | + | ||
80 | + return conteudo; | ||
81 | + } | ||
82 | + | ||
83 | + public void setConteudo(String conteudo) { | ||
84 | + | ||
85 | + this.conteudo = conteudo; | ||
86 | + } | ||
87 | + | ||
88 | + public AnexoImagem getAnexoImagem() { | ||
89 | + | ||
90 | + return anexoImagem; | ||
91 | + } | ||
92 | + | ||
93 | + public void setAnexoImagem(AnexoImagem anexoImagem) { | ||
94 | + | ||
95 | + this.anexoImagem = anexoImagem; | ||
96 | + } | ||
97 | +} |
cit-ecm-api/src/main/java/br/com/centralit/api/service/TarjaAssinaturaService.java
0 → 100644
@@ -0,0 +1,34 @@ | @@ -0,0 +1,34 @@ | ||
1 | +package br.com.centralit.api.service; | ||
2 | + | ||
3 | +import org.springframework.web.multipart.MultipartFile; | ||
4 | + | ||
5 | +import br.com.centralit.api.model.TarjaAssinatura; | ||
6 | +import br.com.centralit.framework.service.arquitetura.GenericService; | ||
7 | + | ||
8 | + | ||
9 | +/** | ||
10 | + * <p><img src="http://centralit.com.br/images/logo_central.png"></p> | ||
11 | + * | ||
12 | + * <p><b>Company: </b> Central IT - Governança Corporativa - </p> | ||
13 | + * | ||
14 | + * <p><b>Description: </b></p> | ||
15 | + * | ||
16 | + * @since 13 de abr de 2016 - 13:40:36 | ||
17 | + * @version 1.0.0 | ||
18 | + * @author ciro.junior (<a href="mailto:ciro.junior@centralit.com.br">ciro.junior@centralit.com.br</a>) | ||
19 | + * | ||
20 | + */ | ||
21 | +public interface TarjaAssinaturaService extends GenericService<TarjaAssinatura, Long> { | ||
22 | + | ||
23 | + /** | ||
24 | + * | ||
25 | + * Método responsável por fazer o upload da imagem do logotipo de uma tarja de assinatura. | ||
26 | + * | ||
27 | + * @author ciro.junior (<a href="mailto:ciro.junior@centralit.com.br">ciro.junior@centralit.com.br</a>) | ||
28 | + * | ||
29 | + * @param file | ||
30 | + * @param idOrganizacao | ||
31 | + * @param idConfiguracao | ||
32 | + */ | ||
33 | + void uploadAnexoImagemTarja(MultipartFile file, Long idOrganizacao, Long idConfiguracao); | ||
34 | +} |
cit-ecm-api/src/main/java/br/com/centralit/api/service/impl/InicializarEcmServiceImpl.java
@@ -21,33 +21,33 @@ import br.com.centralit.framework.model.UtilStartup; | @@ -21,33 +21,33 @@ import br.com.centralit.framework.model.UtilStartup; | ||
21 | * <p> | 21 | * <p> |
22 | * <img src="http://centralit.com.br/images/logo_central.png"> | 22 | * <img src="http://centralit.com.br/images/logo_central.png"> |
23 | * </p> | 23 | * </p> |
24 | - * | 24 | + * |
25 | * <p> | 25 | * <p> |
26 | * <b>Company: </b> Central IT - Governança Corporativa - | 26 | * <b>Company: </b> Central IT - Governança Corporativa - |
27 | * </p> | 27 | * </p> |
28 | - * | 28 | + * |
29 | * <p> | 29 | * <p> |
30 | * <b>Title: </b> | 30 | * <b>Title: </b> |
31 | * </p> | 31 | * </p> |
32 | - * | 32 | + * |
33 | * <p> | 33 | * <p> |
34 | * <b>Description: </b> | 34 | * <b>Description: </b> |
35 | * </p> | 35 | * </p> |
36 | - * | 36 | + * |
37 | * <p> | 37 | * <p> |
38 | * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a> | 38 | * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a> |
39 | * </p> | 39 | * </p> |
40 | - * | 40 | + * |
41 | * <p> | 41 | * <p> |
42 | * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> | 42 | * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> |
43 | * </p> | 43 | * </p> |
44 | - * | 44 | + * |
45 | * @since 22/10/2015 - 08:54:55 | 45 | * @since 22/10/2015 - 08:54:55 |
46 | - * | 46 | + * |
47 | * @version 1.0.0 | 47 | * @version 1.0.0 |
48 | - * | 48 | + * |
49 | * @author rogerio.costa | 49 | * @author rogerio.costa |
50 | - * | 50 | + * |
51 | */ | 51 | */ |
52 | @Service("inicializarEcmService") | 52 | @Service("inicializarEcmService") |
53 | public class InicializarEcmServiceImpl extends UtilStartup { | 53 | public class InicializarEcmServiceImpl extends UtilStartup { |
@@ -74,15 +74,15 @@ public class InicializarEcmServiceImpl extends UtilStartup { | @@ -74,15 +74,15 @@ public class InicializarEcmServiceImpl extends UtilStartup { | ||
74 | * <p> | 74 | * <p> |
75 | * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a> | 75 | * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a> |
76 | * </p> | 76 | * </p> |
77 | - * | 77 | + * |
78 | * <p> | 78 | * <p> |
79 | * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> | 79 | * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> |
80 | * </p> | 80 | * </p> |
81 | - * | 81 | + * |
82 | * Método responsável por gerar a carga inicial | 82 | * Método responsável por gerar a carga inicial |
83 | - * | 83 | + * |
84 | * @author rogerio.costa | 84 | * @author rogerio.costa |
85 | - * | 85 | + * |
86 | */ | 86 | */ |
87 | public void gerarCarga() { | 87 | public void gerarCarga() { |
88 | 88 | ||
@@ -93,15 +93,15 @@ public class InicializarEcmServiceImpl extends UtilStartup { | @@ -93,15 +93,15 @@ public class InicializarEcmServiceImpl extends UtilStartup { | ||
93 | * <p> | 93 | * <p> |
94 | * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a> | 94 | * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a> |
95 | * </p> | 95 | * </p> |
96 | - * | 96 | + * |
97 | * <p> | 97 | * <p> |
98 | * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> | 98 | * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> |
99 | * </p> | 99 | * </p> |
100 | - * | 100 | + * |
101 | * Método responsável por | 101 | * Método responsável por |
102 | - * | 102 | + * |
103 | * @author rogerio.costa | 103 | * @author rogerio.costa |
104 | - * | 104 | + * |
105 | * @param modulo | 105 | * @param modulo |
106 | */ | 106 | */ |
107 | private void criarPaginasMenus() { | 107 | private void criarPaginasMenus() { |
@@ -339,6 +339,13 @@ public class InicializarEcmServiceImpl extends UtilStartup { | @@ -339,6 +339,13 @@ public class InicializarEcmServiceImpl extends UtilStartup { | ||
339 | menuSuporteDocumento.setIncludes(this.gerarArquivosMenu(menuSuporteDocumento, this.CIT_ECM_WEB_ANGULAR, "TipoSuporteDocumento", true, true, true)); | 339 | menuSuporteDocumento.setIncludes(this.gerarArquivosMenu(menuSuporteDocumento, this.CIT_ECM_WEB_ANGULAR, "TipoSuporteDocumento", true, true, true)); |
340 | this.menuService.mergeIfNotExist(menuSuporteDocumento); | 340 | this.menuService.mergeIfNotExist(menuSuporteDocumento); |
341 | 341 | ||
342 | + // Submenu Tarja de assinatura | ||
343 | + Pagina pgTarjaAssinatura = new Pagina("Tarja de Assinatura", "/cit-ecm-web/html/tarjaAssinatura/tarjaAssinatura.html"); | ||
344 | + pgTarjaAssinatura = this.paginaService.saveIfNotExist(pgTarjaAssinatura); | ||
345 | + | ||
346 | + Menu menuTarjaAssinatura = new Menu("Tarja de Assinatura", pgTarjaAssinatura, menuCadastroBasico, 0, 9, null, null, null, null, modulo); | ||
347 | + menuTarjaAssinatura.setIncludes(this.gerarArquivosMenu(menuTarjaAssinatura, this.CIT_ECM_WEB_ANGULAR, "Tarja de Assinatura", true, true, true)); | ||
348 | + this.menuService.mergeIfNotExist(menuTarjaAssinatura); | ||
342 | } | 349 | } |
343 | 350 | ||
344 | } | 351 | } |
cit-ecm-api/src/main/java/br/com/centralit/api/service/impl/TarjaAssinaturaServiceImpl.java
0 → 100644
@@ -0,0 +1,63 @@ | @@ -0,0 +1,63 @@ | ||
1 | +package br.com.centralit.api.service.impl; | ||
2 | + | ||
3 | +import java.io.IOException; | ||
4 | + | ||
5 | +import org.apache.log4j.Logger; | ||
6 | +import org.springframework.beans.factory.annotation.Autowired; | ||
7 | +import org.springframework.beans.factory.annotation.Qualifier; | ||
8 | +import org.springframework.stereotype.Service; | ||
9 | +import org.springframework.validation.Validator; | ||
10 | +import org.springframework.web.multipart.MultipartFile; | ||
11 | + | ||
12 | +import br.com.centralit.api.dao.TarjaAssinaturaDao; | ||
13 | +import br.com.centralit.api.model.TarjaAssinatura; | ||
14 | +import br.com.centralit.api.service.OrganizacaoService; | ||
15 | +import br.com.centralit.api.service.TarjaAssinaturaService; | ||
16 | +import br.com.centralit.framework.model.AnexoImagem; | ||
17 | +import br.com.centralit.framework.model.Organizacao; | ||
18 | +import br.com.centralit.framework.service.arquitetura.GenericServiceImpl; | ||
19 | + | ||
20 | +@Service("tarjaAssinaturaService") | ||
21 | +public class TarjaAssinaturaServiceImpl extends GenericServiceImpl<TarjaAssinatura, Long> implements TarjaAssinaturaService { | ||
22 | + | ||
23 | + private static final Logger LOG = Logger.getLogger(TarjaAssinaturaServiceImpl.class); | ||
24 | + | ||
25 | + @Autowired | ||
26 | + private OrganizacaoService organizacaoService; | ||
27 | + | ||
28 | + private TarjaAssinaturaDao tarjaAssinaturaDao; | ||
29 | + | ||
30 | + @Autowired | ||
31 | + public TarjaAssinaturaServiceImpl (TarjaAssinaturaDao tarjaAssinaturaDao, @Qualifier("tarjaAssinaturaValidator") Validator validator) { | ||
32 | + this.dao = tarjaAssinaturaDao; | ||
33 | + this.tarjaAssinaturaDao = tarjaAssinaturaDao; | ||
34 | + this.validator = validator; | ||
35 | + } | ||
36 | + | ||
37 | + @Override | ||
38 | + public TarjaAssinatura merge(TarjaAssinatura tarjaAssinatura) { | ||
39 | + this.validarEntidade(tarjaAssinatura, this.validator); | ||
40 | + return super.merge(tarjaAssinatura); | ||
41 | + } | ||
42 | + | ||
43 | + /**{@inheritDoc}*/ | ||
44 | + @Override | ||
45 | + public void uploadAnexoImagemTarja(MultipartFile file, Long idOrganizacao, Long idTarjaAssinatura) { | ||
46 | + | ||
47 | + AnexoImagem anexoImagem = new AnexoImagem (); | ||
48 | + try { | ||
49 | + Organizacao organizacao = (Organizacao) this.organizacaoService.find(idOrganizacao); | ||
50 | + anexoImagem.setAnexo(file.getBytes()); | ||
51 | + anexoImagem.setDescricao(file.getOriginalFilename()); | ||
52 | + anexoImagem.setOrganizacao(organizacao); | ||
53 | + | ||
54 | + TarjaAssinatura tarjaAssinatura = (TarjaAssinatura) this.tarjaAssinaturaDao.getReference(idTarjaAssinatura); | ||
55 | + tarjaAssinatura.setAnexoImagem(anexoImagem); | ||
56 | + this.merge(tarjaAssinatura); | ||
57 | + } catch (IOException ioe) { | ||
58 | + LOG.error("N\u00e3o consegui anexar a imagem \u00e0 entidade TarjaAssinatura. Verifique a exce\u00e7\u00e3o para " | ||
59 | + + "identificar a causa: ", ioe.getCause()); | ||
60 | + } | ||
61 | + } | ||
62 | + | ||
63 | +} |
cit-ecm-api/src/main/java/br/com/centralit/api/service/validation/TarjaAssinaturaValidator.java
0 → 100644
@@ -0,0 +1,29 @@ | @@ -0,0 +1,29 @@ | ||
1 | +package br.com.centralit.api.service.validation; | ||
2 | + | ||
3 | +import org.springframework.stereotype.Component; | ||
4 | +import org.springframework.validation.Errors; | ||
5 | +import org.springframework.validation.ValidationUtils; | ||
6 | +import org.springframework.validation.Validator; | ||
7 | + | ||
8 | +import br.com.centralit.api.model.TarjaAssinatura; | ||
9 | +import br.com.centralit.framework.exception.CodigoErro; | ||
10 | + | ||
11 | +@Component("tarjaAssinaturaValidator") | ||
12 | +public class TarjaAssinaturaValidator implements Validator{ | ||
13 | + | ||
14 | + @Override | ||
15 | + public boolean supports(Class<?> clazz) { | ||
16 | + | ||
17 | + return TarjaAssinatura.class.isAssignableFrom(clazz); | ||
18 | + } | ||
19 | + | ||
20 | + @Override | ||
21 | + public void validate(Object target, Errors errors) { | ||
22 | + | ||
23 | + ValidationUtils.rejectIfEmpty(errors, "descricao", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "LABEL.DESCRICAO"); | ||
24 | + ValidationUtils.rejectIfEmpty(errors, "conteudo", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "ECM.LABEL.CONTEUDO_HTML"); | ||
25 | + | ||
26 | + } | ||
27 | + | ||
28 | + | ||
29 | +} |
cit-ecm-web/src/main/java/br/com/centralit/controller/TarjaAssinaturaController.java
0 → 100644
@@ -0,0 +1,31 @@ | @@ -0,0 +1,31 @@ | ||
1 | +package br.com.centralit.controller; | ||
2 | + | ||
3 | +import javax.servlet.http.HttpServletRequest; | ||
4 | + | ||
5 | +import org.springframework.beans.factory.annotation.Autowired; | ||
6 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
7 | +import org.springframework.web.bind.annotation.RequestMethod; | ||
8 | +import org.springframework.web.bind.annotation.RequestParam; | ||
9 | +import org.springframework.web.bind.annotation.ResponseBody; | ||
10 | +import org.springframework.web.multipart.MultipartFile; | ||
11 | + | ||
12 | +import br.com.centralit.api.model.TarjaAssinatura; | ||
13 | +import br.com.centralit.api.service.TarjaAssinaturaService; | ||
14 | +import br.com.centralit.framework.controller.GenericController; | ||
15 | + | ||
16 | +@RequestMapping("/rest/tarjaAssinatura") | ||
17 | +public class TarjaAssinaturaController extends GenericController<TarjaAssinatura> { | ||
18 | + | ||
19 | + @Autowired | ||
20 | + private TarjaAssinaturaService tarjaAssinaturaService; | ||
21 | + | ||
22 | + @ResponseBody | ||
23 | + @RequestMapping(value = "/uploadFileLogo", method = RequestMethod.POST) | ||
24 | + public void uploadFileHandle(@RequestParam(value = "filename", required = false) String name, | ||
25 | + @RequestParam("file") MultipartFile file, HttpServletRequest request, | ||
26 | + @RequestParam("idOrganizacao") Long idOrganizacao, | ||
27 | + @RequestParam("idTarjaAssinatura") String idTarjaAssinatura) { | ||
28 | + | ||
29 | + this.tarjaAssinaturaService.uploadAnexoImagemTarja(file, idOrganizacao, Long.parseLong(idTarjaAssinatura)); | ||
30 | + } | ||
31 | +} |
cit-ecm-web/src/main/java/br/com/centralit/listener/StartupListenerEcm.java
@@ -76,15 +76,15 @@ public class StartupListenerEcm extends UtilStartup implements ApplicationListen | @@ -76,15 +76,15 @@ public class StartupListenerEcm extends UtilStartup implements ApplicationListen | ||
76 | * <p> | 76 | * <p> |
77 | * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a> | 77 | * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a> |
78 | * </p> | 78 | * </p> |
79 | - * | 79 | + * |
80 | * <p> | 80 | * <p> |
81 | * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> | 81 | * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> |
82 | * </p> | 82 | * </p> |
83 | - * | 83 | + * |
84 | * Método responsável por criar as regras de acesso | 84 | * Método responsável por criar as regras de acesso |
85 | - * | 85 | + * |
86 | * @author rogerio.costa | 86 | * @author rogerio.costa |
87 | - * | 87 | + * |
88 | */ | 88 | */ |
89 | private void criarRegraDeAcesso() { | 89 | private void criarRegraDeAcesso() { |
90 | 90 | ||
@@ -107,9 +107,9 @@ public class StartupListenerEcm extends UtilStartup implements ApplicationListen | @@ -107,9 +107,9 @@ public class StartupListenerEcm extends UtilStartup implements ApplicationListen | ||
107 | 107 | ||
108 | /** | 108 | /** |
109 | * Método responsável por criar domínios específicos ECM | 109 | * Método responsável por criar domínios específicos ECM |
110 | - * | 110 | + * |
111 | * @author halan.lima | 111 | * @author halan.lima |
112 | - * | 112 | + * |
113 | */ | 113 | */ |
114 | protected void popularAcoesAlteracaoProcesso() { | 114 | protected void popularAcoesAlteracaoProcesso() { |
115 | 115 | ||
@@ -153,15 +153,15 @@ public class StartupListenerEcm extends UtilStartup implements ApplicationListen | @@ -153,15 +153,15 @@ public class StartupListenerEcm extends UtilStartup implements ApplicationListen | ||
153 | * <p> | 153 | * <p> |
154 | * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a> | 154 | * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a> |
155 | * </p> | 155 | * </p> |
156 | - * | 156 | + * |
157 | * <p> | 157 | * <p> |
158 | * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> | 158 | * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> |
159 | * </p> | 159 | * </p> |
160 | - * | 160 | + * |
161 | * Método responsável por incluir dominios | 161 | * Método responsável por incluir dominios |
162 | - * | 162 | + * |
163 | * @author rogerio.costa | 163 | * @author rogerio.costa |
164 | - * | 164 | + * |
165 | */ | 165 | */ |
166 | private void criarDominios() { | 166 | private void criarDominios() { |
167 | 167 | ||
@@ -197,20 +197,23 @@ public class StartupListenerEcm extends UtilStartup implements ApplicationListen | @@ -197,20 +197,23 @@ public class StartupListenerEcm extends UtilStartup implements ApplicationListen | ||
197 | 197 | ||
198 | list.add(new Dominio("tipoProtocoloNup", "Automático", "EXTERNO", 1L, Boolean.FALSE)); | 198 | list.add(new Dominio("tipoProtocoloNup", "Automático", "EXTERNO", 1L, Boolean.FALSE)); |
199 | list.add(new Dominio("tipoProtocoloNup", "Informado", "NUP_NOVO", 2L, Boolean.FALSE)); | 199 | list.add(new Dominio("tipoProtocoloNup", "Informado", "NUP_NOVO", 2L, Boolean.FALSE)); |
200 | - | 200 | + |
201 | list.add(new Dominio("formaNumeracao", "Sequencial por ano", "SEQUENCIAL_ANO", 1L)); | 201 | list.add(new Dominio("formaNumeracao", "Sequencial por ano", "SEQUENCIAL_ANO", 1L)); |
202 | list.add(new Dominio("formaNumeracao", "Sequencial único", "SEQUENCIAL_UNICO", 2L)); | 202 | list.add(new Dominio("formaNumeracao", "Sequencial único", "SEQUENCIAL_UNICO", 2L)); |
203 | 203 | ||
204 | + list.add(new Dominio("tipoAssinatura", "Assinatura interna", "ASSINATURA_INTERNA", 1L)); | ||
205 | + list.add(new Dominio("tipoAssinatura", "Assinatura por certificado digital", "ASSINATURA_INTERNA", 2L)); | ||
206 | + | ||
204 | this.dominioService.saveListIfNotExist(list); | 207 | this.dominioService.saveListIfNotExist(list); |
205 | 208 | ||
206 | } | 209 | } |
207 | 210 | ||
208 | /** | 211 | /** |
209 | - * | 212 | + * |
210 | * Método responsável por gerar internacionalização do módulo ECM | 213 | * Método responsável por gerar internacionalização do módulo ECM |
211 | - * | 214 | + * |
212 | * @author rogerio.cassimiro | 215 | * @author rogerio.cassimiro |
213 | - * | 216 | + * |
214 | */ | 217 | */ |
215 | private void gerarInternacionalizacao() { | 218 | private void gerarInternacionalizacao() { |
216 | 219 | ||
@@ -230,15 +233,15 @@ public class StartupListenerEcm extends UtilStartup implements ApplicationListen | @@ -230,15 +233,15 @@ public class StartupListenerEcm extends UtilStartup implements ApplicationListen | ||
230 | * <p> | 233 | * <p> |
231 | * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a> | 234 | * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a> |
232 | * </p> | 235 | * </p> |
233 | - * | 236 | + * |
234 | * <p> | 237 | * <p> |
235 | * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> | 238 | * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> |
236 | * </p> | 239 | * </p> |
237 | - * | 240 | + * |
238 | * Método responsável por criar labels | 241 | * Método responsável por criar labels |
239 | - * | 242 | + * |
240 | * @author Rogério Gomes | 243 | * @author Rogério Gomes |
241 | - * | 244 | + * |
242 | * @param dominio | 245 | * @param dominio |
243 | * @param modulo | 246 | * @param modulo |
244 | * @param internacionalizacaoList | 247 | * @param internacionalizacaoList |
@@ -399,23 +402,23 @@ public class StartupListenerEcm extends UtilStartup implements ApplicationListen | @@ -399,23 +402,23 @@ public class StartupListenerEcm extends UtilStartup implements ApplicationListen | ||
399 | internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.NOME_NOVO_SUPORTE ", "Nome do suporte", dominio, modulo)); | 402 | internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.NOME_NOVO_SUPORTE ", "Nome do suporte", dominio, modulo)); |
400 | internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.NOVO_TIPO_SUPORTE ", "Novo tipo suporte de documento", dominio, modulo)); | 403 | internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.NOVO_TIPO_SUPORTE ", "Novo tipo suporte de documento", dominio, modulo)); |
401 | internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.TIPO_SUPORTE_DOCUMENTO ", "Tipo suporte de documento", dominio, modulo)); | 404 | internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.TIPO_SUPORTE_DOCUMENTO ", "Tipo suporte de documento", dominio, modulo)); |
402 | - | ||
403 | - | 405 | + |
406 | + | ||
404 | } | 407 | } |
405 | 408 | ||
406 | /** | 409 | /** |
407 | * <p> | 410 | * <p> |
408 | * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a> | 411 | * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a> |
409 | * </p> | 412 | * </p> |
410 | - * | 413 | + * |
411 | * <p> | 414 | * <p> |
412 | * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> | 415 | * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> |
413 | * </p> | 416 | * </p> |
414 | - * | 417 | + * |
415 | * Método responsável por | 418 | * Método responsável por |
416 | - * | 419 | + * |
417 | * @author Rogério Gomes | 420 | * @author Rogério Gomes |
418 | - * | 421 | + * |
419 | * @param dominio | 422 | * @param dominio |
420 | * @param modulo | 423 | * @param modulo |
421 | * @param internacionalizacaoList | 424 | * @param internacionalizacaoList |
@@ -439,15 +442,15 @@ public class StartupListenerEcm extends UtilStartup implements ApplicationListen | @@ -439,15 +442,15 @@ public class StartupListenerEcm extends UtilStartup implements ApplicationListen | ||
439 | * <p> | 442 | * <p> |
440 | * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a> | 443 | * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a> |
441 | * </p> | 444 | * </p> |
442 | - * | 445 | + * |
443 | * <p> | 446 | * <p> |
444 | * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> | 447 | * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> |
445 | * </p> | 448 | * </p> |
446 | - * | 449 | + * |
447 | * Método responsável por | 450 | * Método responsável por |
448 | - * | 451 | + * |
449 | * @author Rogério Gomes | 452 | * @author Rogério Gomes |
450 | - * | 453 | + * |
451 | * @param dominio | 454 | * @param dominio |
452 | * @param modulo | 455 | * @param modulo |
453 | * @param internacionalizacaoList | 456 | * @param internacionalizacaoList |
@@ -501,8 +504,8 @@ public class StartupListenerEcm extends UtilStartup implements ApplicationListen | @@ -501,8 +504,8 @@ public class StartupListenerEcm extends UtilStartup implements ApplicationListen | ||
501 | internacionalizacaoList.add(new Internacionalizacao("ECM.MSG.DESEJA_CAPTURAR", "Desejá capturar o processo?", dominio, modulo)); | 504 | internacionalizacaoList.add(new Internacionalizacao("ECM.MSG.DESEJA_CAPTURAR", "Desejá capturar o processo?", dominio, modulo)); |
502 | internacionalizacaoList.add(new Internacionalizacao("ECM.MSG.CAPTURADO_SUCESSO", "Processo capturado com sucesso!", dominio, modulo)); | 505 | internacionalizacaoList.add(new Internacionalizacao("ECM.MSG.CAPTURADO_SUCESSO", "Processo capturado com sucesso!", dominio, modulo)); |
503 | internacionalizacaoList.add(new Internacionalizacao("ECM.MSG.LEGENDA_CAMPO_DINAMICO_NUMERO_DOCUMENTO", "Use: @numeroDocumento@ para adicionar o número do documento", dominio, modulo)); | 506 | internacionalizacaoList.add(new Internacionalizacao("ECM.MSG.LEGENDA_CAMPO_DINAMICO_NUMERO_DOCUMENTO", "Use: @numeroDocumento@ para adicionar o número do documento", dominio, modulo)); |
504 | - | ||
505 | - | 507 | + |
508 | + | ||
506 | 509 | ||
507 | } | 510 | } |
508 | } | 511 | } |
cit-ecm-web/src/main/webapp/assets/js/angular/custom/controller/TarjaAssinaturaController.js
0 → 100644
@@ -0,0 +1,191 @@ | @@ -0,0 +1,191 @@ | ||
1 | +'use strict'; | ||
2 | + | ||
3 | +citApp.controller('TarjaAssinaturaController', | ||
4 | + ['$scope', | ||
5 | + '$filter', | ||
6 | + '$translate', | ||
7 | + '$timeout', | ||
8 | + 'TarjaAssinaturaRepository', | ||
9 | + 'DominioRepository', | ||
10 | + function TarjaAssinaturaController($scope, | ||
11 | + $filter, | ||
12 | + $translate, | ||
13 | + $timeout, | ||
14 | + TarjaAssinaturaRepository, | ||
15 | + DominioRepository) { | ||
16 | + | ||
17 | + $scope.resetForm = function() { | ||
18 | + $scope.tarjaAssinatura = { | ||
19 | + assinaturaInterna : {}, | ||
20 | + assinaturaCertificado : {} | ||
21 | + }; | ||
22 | + $scope.tipoAssinaturaInterna = {}; | ||
23 | + $scope.tipoAssinaturaCertificado = {}; | ||
24 | + | ||
25 | + $scope.edit = true; | ||
26 | + $timeout(function(){ | ||
27 | + $scope.tarjaAssinaturaForm.$submitted = false; | ||
28 | + $scope.tarjaAssinaturaForm.$setPristine(); | ||
29 | + }); | ||
30 | + }; | ||
31 | + | ||
32 | + DominioRepository.buscaDominioByCodigoAndChave('tipoAssinatura', 1).then(function(result) { | ||
33 | + $scope.tipoAssinaturaInterna = result.originalElement; | ||
34 | + }); | ||
35 | + DominioRepository.buscaDominioByCodigoAndChave('tipoAssinatura', 2).then(function(result) { | ||
36 | + $scope.tipoAssinaturaCertificado = result.originalElement; | ||
37 | + }); | ||
38 | + | ||
39 | + // Atualiza pagina de pesquisa | ||
40 | + $scope.atualizaPaginaPesquisa = function () { | ||
41 | + angular.element('#searchTarjaAssinatura').scope().fetchResult(); | ||
42 | + }; | ||
43 | + | ||
44 | + $scope.saveOrUpdate = function(){ | ||
45 | + | ||
46 | + $scope.tarjaAssinaturaInternaForm.$submitted = true; | ||
47 | + $scope.tarjaAssinaturaCertificadoForm.$submitted = true; | ||
48 | + | ||
49 | + if($scope.tarjaAssinaturaInternaForm.$invalid || $scope.tarjaAssinaturaCertificadoForm.$invalid){ | ||
50 | + $scope.showAlert('error', $translate.instant('MSG.MN001'), " ", false); | ||
51 | + return; | ||
52 | + } | ||
53 | + | ||
54 | + $scope.setLoadingSalva(true); | ||
55 | + | ||
56 | + TarjaAssinaturaRepository.save($scope.tarjaAssinatura).then(function(result) { | ||
57 | + $scope.tarjaAssinatura = result.originalElement; | ||
58 | + $scope.showAlert("success", $translate.instant('MSG.REGISTRO_SALVO')); | ||
59 | + form.$submitted = false; | ||
60 | + $scope.setLoading(false); | ||
61 | + }); | ||
62 | + if(uploaderLogoTarja.queue.length > 0){ | ||
63 | + uploaderLogoTarja.uploadAll(); | ||
64 | + } | ||
65 | + }; | ||
66 | + | ||
67 | + $scope.getAllTarjas = function(){ | ||
68 | + $scope.setLoadingGet(true); | ||
69 | + TarjaAssinaturaRepository.findAllTarjas().then(function(result) { | ||
70 | + angular.forEach(result, function(item){ | ||
71 | + $scope.contrato.valorTotalItens += item.valorTotalItem; | ||
72 | + }); | ||
73 | + $scope.tarjaAssinatura = result.originalElement; | ||
74 | + $scope.edit = edit; | ||
75 | + $scope.setLoading(false); | ||
76 | + }); | ||
77 | + }; | ||
78 | + | ||
79 | + $scope.getAllTarjas(); | ||
80 | + | ||
81 | +//INSTANCIA DO OBJETO PARA FAZER UPLOAD | ||
82 | + var uploaderLogoTarjaAssinaturaInterna = $scope.uploaderLogoTarjaAssinaturaInterna = new FileUploader({ | ||
83 | + autoUpload: false, | ||
84 | + queueLimit: 1, | ||
85 | + url : '/cit-ecm-web/rest/tarjaAssinatura/uploadFileLogo?idOrganizacao=' + $scope.usuarioLogado.organizacao.id + | ||
86 | + '&idTarjaAssinatura=' + $scope.tarjaAssinatura.assinaturaInterna.id | ||
87 | + }); | ||
88 | + | ||
89 | + // FILTERS | ||
90 | + uploaderLogoTarjaAssinaturaInterna.filters.push({ | ||
91 | + name: 'imageFilter', | ||
92 | + fn: function(item , options) { | ||
93 | + var type = '|' + item.type.slice(item.type.lastIndexOf('/') + 1) + '|'; | ||
94 | + return '|jpg|png|jpeg|bmp|gif|'.indexOf(type) !== -1; | ||
95 | + } | ||
96 | + }); | ||
97 | + | ||
98 | + // CALLBACKS | ||
99 | + uploaderLogoTarjaAssinaturaInterna.onWhenAddingFileFailed = function(item , filter, options) { | ||
100 | + uploaderLogoTarjaAssinaturaInterna.clearQueue(); | ||
101 | + console.info('onWhenAddingFileFailed', item, filter, options); | ||
102 | + }; | ||
103 | + uploaderLogoTarjaAssinaturaInterna.onAfterAddingFile = function(fileItem) { | ||
104 | + console.info('onAfterAddingFile', fileItem); | ||
105 | + }; | ||
106 | + uploaderLogoTarjaAssinaturaInterna.onAfterAddingAll = function(addedFileItems) { | ||
107 | + console.info('onAfterAddingAll', addedFileItems); | ||
108 | + }; | ||
109 | + uploaderLogoTarjaAssinaturaInterna.onBeforeUploadItem = function(item) { | ||
110 | + console.info('onBeforeUploadItem', item); | ||
111 | + }; | ||
112 | + uploaderLogoTarjaAssinaturaInterna.onProgressItem = function(fileItem, progress) { | ||
113 | + console.info('onProgressItem', fileItem, progress); | ||
114 | + }; | ||
115 | + uploaderLogoTarjaAssinaturaInterna.onProgressAll = function(progress) { | ||
116 | + console.info('onProgressAll', progress); | ||
117 | + }; | ||
118 | + uploaderLogoTarjaAssinaturaInterna.onSuccessItem = function(fileItem, response, status, headers) { | ||
119 | + console.info('onSuccessItem', fileItem, response, status, headers); | ||
120 | + }; | ||
121 | + uploaderLogoTarjaAssinaturaInterna.onErrorItem = function(fileItem, response, status, headers) { | ||
122 | + console.info('onErrorItem', fileItem, response, status, headers); | ||
123 | + }; | ||
124 | + uploaderLogoTarjaAssinaturaInterna.onCancelItem = function(fileItem, response, status, headers) { | ||
125 | + console.info('onCancelItem', fileItem, response, status, headers); | ||
126 | + }; | ||
127 | + uploaderLogoTarjaAssinaturaInterna.onCompleteItem = function(fileItem, response, status, headers) { | ||
128 | + console.info('onCompleteItem', fileItem, response, status, headers); | ||
129 | + }; | ||
130 | + uploaderLogoTarjaAssinaturaInterna.onCompleteAll = function() { | ||
131 | + uploaderLogoTarjaAssinaturaInterna.clearQueue(); | ||
132 | + $scope.getTarjaAssinatura($scope.tarjaAssinatura); | ||
133 | + console.info('onCompleteAll'); | ||
134 | + }; | ||
135 | + | ||
136 | +//INSTANCIA DO OBJETO PARA FAZER UPLOAD | ||
137 | + var uploaderLogoTarjaAssinaturaCertificado = $scope.uploaderLogoTarjaAssinaturaCertificado = new FileUploader({ | ||
138 | + autoUpload: false, | ||
139 | + queueLimit: 1, | ||
140 | + url : '/cit-ecm-web/rest/tarjaAssinatura/uploadFileLogo?idOrganizacao=' + $scope.usuarioLogado.organizacao.id + | ||
141 | + '&idTarjaAssinatura=' + $scope.tarjaAssinatura.assinaturaCertificado.id | ||
142 | + }); | ||
143 | + | ||
144 | + // FILTERS | ||
145 | + uploaderLogoTarjaAssinaturaCertificado.filters.push({ | ||
146 | + name: 'imageFilter', | ||
147 | + fn: function(item , options) { | ||
148 | + var type = '|' + item.type.slice(item.type.lastIndexOf('/') + 1) + '|'; | ||
149 | + return '|jpg|png|jpeg|bmp|gif|'.indexOf(type) !== -1; | ||
150 | + } | ||
151 | + }); | ||
152 | + | ||
153 | + // CALLBACKS | ||
154 | + uploaderLogoTarjaAssinaturaCertificado.onWhenAddingFileFailed = function(item , filter, options) { | ||
155 | + uploaderLogoTarjaAssinaturaCertificado.clearQueue(); | ||
156 | + console.info('onWhenAddingFileFailed', item, filter, options); | ||
157 | + }; | ||
158 | + uploaderLogoTarjaAssinaturaCertificado.onAfterAddingFile = function(fileItem) { | ||
159 | + console.info('onAfterAddingFile', fileItem); | ||
160 | + }; | ||
161 | + uploaderLogoTarjaAssinaturaCertificado.onAfterAddingAll = function(addedFileItems) { | ||
162 | + console.info('onAfterAddingAll', addedFileItems); | ||
163 | + }; | ||
164 | + uploaderLogoTarjaAssinaturaCertificado.onBeforeUploadItem = function(item) { | ||
165 | + console.info('onBeforeUploadItem', item); | ||
166 | + }; | ||
167 | + uploaderLogoTarjaAssinaturaCertificado.onProgressItem = function(fileItem, progress) { | ||
168 | + console.info('onProgressItem', fileItem, progress); | ||
169 | + }; | ||
170 | + uploaderLogoTarjaAssinaturaCertificado.onProgressAll = function(progress) { | ||
171 | + console.info('onProgressAll', progress); | ||
172 | + }; | ||
173 | + uploaderLogoTarjaAssinaturaCertificado.onSuccessItem = function(fileItem, response, status, headers) { | ||
174 | + console.info('onSuccessItem', fileItem, response, status, headers); | ||
175 | + }; | ||
176 | + uploaderLogoTarjaAssinaturaCertificado.onErrorItem = function(fileItem, response, status, headers) { | ||
177 | + console.info('onErrorItem', fileItem, response, status, headers); | ||
178 | + }; | ||
179 | + uploaderLogoTarjaAssinaturaCertificado.onCancelItem = function(fileItem, response, status, headers) { | ||
180 | + console.info('onCancelItem', fileItem, response, status, headers); | ||
181 | + }; | ||
182 | + uploaderLogoTarjaAssinaturaCertificado.onCompleteItem = function(fileItem, response, status, headers) { | ||
183 | + console.info('onCompleteItem', fileItem, response, status, headers); | ||
184 | + }; | ||
185 | + uploaderLogoTarjaAssinaturaCertificado.onCompleteAll = function() { | ||
186 | + uploaderLogoTarjaAssinaturaCertificado.clearQueue(); | ||
187 | + $scope.getTarjaAssinatura($scope.tarjaAssinatura); | ||
188 | + console.info('onCompleteAll'); | ||
189 | + }; | ||
190 | + | ||
191 | +}]); |
cit-ecm-web/src/main/webapp/assets/js/angular/custom/controller/TarjaAssinaturaListController.js
0 → 100644
@@ -0,0 +1,47 @@ | @@ -0,0 +1,47 @@ | ||
1 | +'use strict'; | ||
2 | + | ||
3 | +citApp.controller('TarjaAssinaturaListController', | ||
4 | + ['$scope', | ||
5 | + '$translate', | ||
6 | + '$timeout', | ||
7 | + 'TarjaAssinaturaRepository', | ||
8 | + 'DominioRepository', | ||
9 | + function ListController($scope, | ||
10 | + $translate, | ||
11 | + $timeout, | ||
12 | + TarjaAssinaturaRepository, | ||
13 | + DominioRepository) { | ||
14 | + $scope.$showAdvancedFilters = false; | ||
15 | + | ||
16 | + $scope.resetForm = function() { | ||
17 | + angular.element("#editTarjaAssinatura").scope().resetForm(); | ||
18 | + }; | ||
19 | + | ||
20 | + $scope.headers = [ {title : $translate.instant('LABEL.TIPO_ASSINATURA'), value : 'dominio.tipoAssinatura' }, | ||
21 | + {title : $translate.instant('LABEL.DESCRICAO'), value : 'descricao' }]; | ||
22 | + | ||
23 | + $scope.filterCriteria = { | ||
24 | + start : 1, | ||
25 | + dir : 'asc', | ||
26 | + sort : 'id', | ||
27 | + limit : 10, | ||
28 | + fields: ['id', 'tipoAssinatura.descricao', 'descricao'], | ||
29 | + filters : [ {type : 'string', field : 'tipoAssinatura.descricao', listaDominio : [] }, | ||
30 | + {type : 'string', field : 'descricao' }] | ||
31 | + }; | ||
32 | + | ||
33 | + DominioRepository.findAllDominio('tipoAssinatura').then(function(result) { | ||
34 | + $scope.filterCriteria.filters[0].listaDominio = result; | ||
35 | + }); | ||
36 | + | ||
37 | + $scope.abrirVisualizar = function(edit){ | ||
38 | + var tarjaAssinatura = $scope.tarjaAssinaturaChecked; | ||
39 | + | ||
40 | + if(!tarjaAssinatura) { | ||
41 | + $scope.showAlert('warning', !edit ? $translate.instant('MSG.SELECIONE_UM_ITEM_PARA_VISUALIZACAO') : $translate.instant('MSG.SELECIONE_UM_ITEM_PARA_EDICAO')); | ||
42 | + return; | ||
43 | + } | ||
44 | + angular.element('#editTarjaAssinatura').scope().getTarjaAssinatura(tarjaAssinatura, edit); | ||
45 | + $scope.$showPageEditWorkspace($scope.workspace); | ||
46 | + }; | ||
47 | +}]); |
cit-ecm-web/src/main/webapp/assets/js/angular/custom/repository/TarjaAssinaturaRepository.js
0 → 100644
@@ -0,0 +1,16 @@ | @@ -0,0 +1,16 @@ | ||
1 | +'use strict'; | ||
2 | + | ||
3 | +citApp.factory('TarjaAssinaturaRepository', ['RestangularEcm', 'AbstractRepository', function (restangularEcm, AbstractRepository) { | ||
4 | + | ||
5 | + function TarjaAssinaturaRepository() { | ||
6 | + AbstractRepository.call(this, restangularEcm, 'rest/tarjaAssinatura'); | ||
7 | + | ||
8 | + this.findAllTarjas = function() { | ||
9 | + return restangular.one(this.route).getList("findAllTarjas").then(); | ||
10 | + }; | ||
11 | + } | ||
12 | + | ||
13 | + AbstractRepository.extend(TarjaAssinaturaRepository); | ||
14 | + | ||
15 | + return new TarjaAssinaturaRepository(); | ||
16 | +}]); |
cit-ecm-web/src/main/webapp/html/tarjaAssinatura/tarjaAssinatura.html
0 → 100644
cit-ecm-web/src/main/webapp/html/tarjaAssinatura/tarjaAssinaturaEdit.html
0 → 100644
@@ -0,0 +1,90 @@ | @@ -0,0 +1,90 @@ | ||
1 | +<div id="editTarjaAssinatura" class="page-content clearfix" | ||
2 | + ng-controller="TarjaAssinaturaController"> | ||
3 | + <div class="bar-buttons-action fixed"> | ||
4 | + <div class="row"> | ||
5 | + <div class="col-sm-8 text-left"> | ||
6 | + <button class="btn btn-clear" ng-click="saveOrUpdate(tarjaAssinaturaForm)" ng-show="edit"> | ||
7 | + <i class="fa fa-save green"></i> | ||
8 | + <translate>LABEL.SALVAR</translate> | ||
9 | + </button> | ||
10 | + <button class="btn btn-clear" ng-click="resetForm()" ng-show="edit"> | ||
11 | + <i class="fa fa-eraser yellow-dark"></i> | ||
12 | + <translate>LABEL.LIMPAR</translate> | ||
13 | + </button> | ||
14 | + <button class="btn btn-clear" ng-show="!edit" ng-click="edit = true"> | ||
15 | + <i class="fa fa-pencil blue"></i> | ||
16 | + <translate>LABEL.EDITAR</translate> | ||
17 | + </button> | ||
18 | + <button class="btn btn-clear" ng-click="$showPageSearchWorkspace(workspace); atualizaPaginaPesquisa();"> | ||
19 | + <i class="fa fa-search"></i> | ||
20 | + <translate>LABEL.PESQUISAR</translate> | ||
21 | + </button> | ||
22 | + </div> | ||
23 | + <!-- .col --> | ||
24 | + | ||
25 | + <div class="col-sm-4 text-right"> | ||
26 | + <favorito /> | ||
27 | + <help-button workspace="workspace" /> | ||
28 | + </div><!-- .col --> | ||
29 | + </div><!-- .row --> | ||
30 | + </div><!-- .bar-buttons-action --> | ||
31 | + | ||
32 | + <h1 class="title"><translate>ECM.LABEL.TARJAS_ASSINATURA</translate></h1> | ||
33 | + </br> | ||
34 | + <breadcrumb ng-workspace="workspace"></breadcrumb> | ||
35 | + | ||
36 | + <form name="tarjaAssinaturaForm"> | ||
37 | + <p><small>( <span class="red">*</span> ) <translate>LABEL.CAMPOS_OBRIGATORIOS</translate></small></p> | ||
38 | + <fieldset> | ||
39 | + <legend> | ||
40 | + <translate>ECM.LABEL.DADOS_TARJA_ASSINATURA</translate> | ||
41 | + </legend> | ||
42 | + </fieldset> | ||
43 | + <div class="row"> | ||
44 | + <div class="col-md-6"> | ||
45 | + <label-input ng-id="tarjaAssinatura.descricao" ng-label="LABEL.DESCRICAO" ng-type="text" ng-model="tarjaAssinatura.descricao" | ||
46 | + form="tarjaAssinaturaForm" ng-obrigatorio="true" ng-custom-maxlength="100" ng-type="text" ng-disabled="!edit" /> | ||
47 | + </div> | ||
48 | + <div class="col-md-4"> | ||
49 | + <label-input ng-id="tarjaAssinatura.tipoAssinatura" ng-label="LABEL.TIPO_ASSINATURA" ng-type="text" ng-disabled="true" | ||
50 | + ng-model="tarjaAssinatura.tipoAssinatura" form="tarjaAssinaturaForm" ng-obrigatorio="false" ng-type="text" /> | ||
51 | + </div> | ||
52 | + </div> | ||
53 | + <div class="row"> | ||
54 | + <div class="col-md-12"> | ||
55 | + <div class="form-group"> | ||
56 | + <label class="control-label block" ng-class="{'has-error': !tarjaAssinatura.conteudo && tarjaAssinaturaForm.$submitted}"> | ||
57 | + <translate>ECM.LABEL.CONTEUDO_HTML</translate> <span class="red">*</span> | ||
58 | + <i ng-show="!tarjaAssinatura.conteudo && tarjaAssinaturaForm.$submitted" class='fa fa-warning red' | ||
59 | + tooltip="{{$translate.instant('ECM.LABEL.CONTEUDO_HTML') + ' ' +$translate.instant('LABEL.CAMPO_OBRIGATORIO')}}" | ||
60 | + tooltip-placement='top'></i> | ||
61 | + </label> | ||
62 | + <div id="tarjaAssinatura.conteudo" ckeditor="options" ng-if='edit' ng-model="tarjaAssinatura.conteudo" ready="onReady()"></div> | ||
63 | + <iframe id="visualizacaoConteudoTarjaAssinatura" allowfullscreen class="iframe-report" ng-show="!edit"></iframe> | ||
64 | + </div> | ||
65 | + </div> | ||
66 | + </div> | ||
67 | + <div class="row"> | ||
68 | + <div class="col-sm-12"> | ||
69 | + <div class="form-group"> | ||
70 | + <label class="control-label"><translate>ECM.LABEL.LOGO_TARJA_ASSINATURA</translate></label> | ||
71 | + <div nv-file-drop="" uploader="uploaderLogoTarja" onclick="$('#uploadLogoTarjaAssinatura').click();"> | ||
72 | + <div nv-file-over="" uploader="uploaderLogoTarja" over-class="another-file-over-class" class="well my-drop-zone"> | ||
73 | + <span ng-show="uploaderLogoTarja.queue.length <= 0"><translate>MSG.ARRASTE_SOLTE_ARQUIVO</translate></span> | ||
74 | + <span ng-show="uploaderLogoTarja.queue.length > 0">{{uploaderLogoTarja.queue[0].file.name}}</span> | ||
75 | + </div> | ||
76 | + </div> | ||
77 | + <input id="uploadLogoTarjaAssinatura" type="file" nv-file-select="" uploader="uploaderLogoTarja" ng-show="false" /> | ||
78 | + <div ng-show="uploaderLogoTarja.queue.length > 0 && tarjaAssinatura.anexoImagem.anexo == undefined"> | ||
79 | + <div ng-thumb="{ file: uploaderLogoTarja.queue._file, width: auto, height: auto }"></div> | ||
80 | + </div> | ||
81 | + </div><!-- .form-group --> | ||
82 | + <div> | ||
83 | + <img ng-src="data:image/JPEG;base64,{{tarjaAssinatura.anexoImagem.anexo}}" class="img-thumbnail" style="max-width: 300px; height: auto;"> | ||
84 | + </div> | ||
85 | + | ||
86 | + </div> | ||
87 | + </div> | ||
88 | + </form> | ||
89 | +</div> | ||
90 | +<!-- .page-content --> |
cit-ecm-web/src/main/webapp/html/tarjaAssinatura/tarjaAssinaturaList.html
0 → 100644
@@ -0,0 +1,33 @@ | @@ -0,0 +1,33 @@ | ||
1 | +<div id="searchTarjaAssinatura" class="page-content" ng-controller="TarjaAssinaturaListController"> | ||
2 | + <div class="bar-buttons-action fixed"> | ||
3 | + <div class="row"> | ||
4 | + <div class="col-sm-8 text-left"> | ||
5 | + <button class="btn btn-clear" ng-click="abrirVisualizar(false);"> | ||
6 | + <i class="fa fa-search blue"></i> | ||
7 | + <translate>LABEL.VISUALIZAR</translate> | ||
8 | + </button> | ||
9 | + <button class="btn btn-clear" ng-click="abrirVisualizar(true);"> | ||
10 | + <i class="fa fa-pencil blue"></i> | ||
11 | + <translate>LABEL.EDITAR</translate> | ||
12 | + </button> | ||
13 | + <span class="divider-vertical"></span> | ||
14 | + <filtros ng-filter="filterCriteria" ng-workspace="workspace"></filtros> | ||
15 | + </div> | ||
16 | + <!-- .col --> | ||
17 | + | ||
18 | + <div class="col-sm-4 text-right"> | ||
19 | + <favorito /> | ||
20 | + <help-button workspace="workspace" /> | ||
21 | + </div> | ||
22 | + <!-- .col --> | ||
23 | + </div> | ||
24 | + <!-- .row --> | ||
25 | + </div> | ||
26 | + <!-- .bar-buttons-action --> | ||
27 | + | ||
28 | + <breadcrumb ng-workspace="workspace"></breadcrumb> | ||
29 | + | ||
30 | + <list-view ng-lista="tarjaAssinaturaList" ng-repository="TarjaAssinaturaRepository" ng-use-custom-remove="false" ng-headers="headers" | ||
31 | + ng-filter-criteria="filterCriteria" ng-item-selecionado="tarjaAssinaturaChecked"></list-view> | ||
32 | +</div> | ||
33 | +<!-- .page-content --> |