Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/fiscal' into desenv
Browse files Browse the repository at this point in the history
  • Loading branch information
marcio committed Apr 24, 2019
2 parents 879e7a7 + 97fa27b commit 0e6edd3
Show file tree
Hide file tree
Showing 9 changed files with 214 additions and 126 deletions.
2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
web: java -Dserver.port=$PORT -jar target/gesthor.jar
web: java -Dserver.port=$PORT -Dspring.profiles.active=prd -jar target/gesthor.jar
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# gesthor
Gesthor - Gestão de Contratos Centralizados

O Gesthor é uma webapp para gestão centralizada de contratos. Para maior informação, verifique o projeto e os cards de evolução do sistema.

1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
theme: jekyll-theme-slate
10 changes: 8 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

Expand Down Expand Up @@ -112,7 +113,12 @@
<artifactId>jigsaw</artifactId>
<version>2.2.6</version>
</dependency>


<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
</dependency>

</dependencies>

<build>
Expand Down
278 changes: 156 additions & 122 deletions src/main/java/br/net/globotecnologia/gesthor/modelo/Contrato.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,138 +22,172 @@
@Entity
public class Contrato {

@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;

@Column(unique = true, nullable = false, length = 7)
private Integer numero;
@Column(unique = true, nullable = false, length = 7)
private Integer numero;

@Column(length = 4, nullable = false)
private Integer ano;
@Column(length = 4, nullable = false)
private Integer ano;

@Column(nullable = false)
@Temporal(TemporalType.DATE)
@DateTimeFormat(pattern="dd/MM/yyyy")
private Date dataAssinatura;
@Column(nullable = false)
@Temporal(TemporalType.DATE)
@DateTimeFormat(pattern = "dd/MM/yyyy")
private Date dataAssinatura;

@Column(nullable = false)
@Temporal(TemporalType.DATE)
@DateTimeFormat(pattern="dd/MM/yyyy")
private Date inicioVigencia;
@Column(nullable = false)
@Temporal(TemporalType.DATE)
@DateTimeFormat(pattern = "dd/MM/yyyy")
private Date inicioVigencia;

@Column(nullable = false)
@Temporal(TemporalType.DATE)
@DateTimeFormat(pattern="dd/MM/yyyy")
private Date finalVigencia;
@Column(nullable = false)
@Temporal(TemporalType.DATE)
@DateTimeFormat(pattern = "dd/MM/yyyy")
private Date finalVigencia;

@Column(precision=2,scale=3, length = 10, columnDefinition="DECIMAL", nullable = false)
@NumberFormat(style=Style.NUMBER, pattern="#.###.###.###,##")
private BigDecimal valor;
@Column(precision = 2, scale = 3, length = 10, columnDefinition = "DECIMAL", nullable = false)
@NumberFormat(style = Style.NUMBER, pattern = "#.###.###.###,##")
private BigDecimal valor;

@Column(nullable = false)
@Enumerated(EnumType.STRING)
private Status status;

@Column(nullable = false, length = 200)
private String objeto;

@ManyToOne
@JoinColumn(nullable = false)
private Empresa empresa;

@ManyToOne
@JoinColumn(nullable = false)
private Gestor gestor;

public Long getId() {
return id;
}

public void setId(Long id) {
this.id = id;
}

public Integer getNumero() {
return numero;
}

public void setNumero(Integer numero) {
this.numero = numero;
}

public Integer getAno() {
return ano;
}

public void setAno(Integer ano) {
this.ano = ano;
}

public Date getDataAssinatura() {
return dataAssinatura;
}

public void setDataAssinatura(Date dataAssinatura) {
this.dataAssinatura = dataAssinatura;
}

public Date getInicioVigencia() {
return inicioVigencia;
}

public void setInicioVigencia(Date inicioVigencia) {
this.inicioVigencia = inicioVigencia;
}

public Date getFinalVigencia() {
return finalVigencia;
}

public void setFinalVigencia(Date finalVigencia) {
this.finalVigencia = finalVigencia;
}

public BigDecimal getValor() {
return valor;
}

public void setValor(BigDecimal valor) {
this.valor = valor;
}

public Status getStatus() {
return status;
}
@Column(nullable = false)
@Enumerated(EnumType.STRING)
private Status status;

public void setStatus(Status status) {
this.status = status;
}

public String getObjeto() {
return objeto;
}

public void setObjeto(String objeto) {
this.objeto = objeto;
}

public Empresa getEmpresa() {
return empresa;
}
@Column(nullable = false, length = 200)
private String objeto;

public void setEmpresa(Empresa empresa) {
this.empresa = empresa;
}
@ManyToOne
@JoinColumn(nullable = false)
private Empresa empresa;

public Gestor getGestor() {
return gestor;
}
@ManyToOne
@JoinColumn(nullable = false)
private Gestor gestor;

public void setGestor(Gestor gestor) {
this.gestor = gestor;
}


@ManyToOne
@JoinColumn(nullable = false)
private Gestor fiscal;

public Long getId() {

return this.id;
}

public void setId(final Long id) {

this.id = id;
}

public Integer getNumero() {

return this.numero;
}

public void setNumero(final Integer numero) {

this.numero = numero;
}

public Integer getAno() {

return this.ano;
}

public void setAno(final Integer ano) {

this.ano = ano;
}

public Date getDataAssinatura() {

return this.dataAssinatura;
}

public void setDataAssinatura(final Date dataAssinatura) {

this.dataAssinatura = dataAssinatura;
}

public Date getInicioVigencia() {

return this.inicioVigencia;
}

public void setInicioVigencia(final Date inicioVigencia) {

this.inicioVigencia = inicioVigencia;
}

public Date getFinalVigencia() {

return this.finalVigencia;
}

public void setFinalVigencia(final Date finalVigencia) {

this.finalVigencia = finalVigencia;
}

public BigDecimal getValor() {

return this.valor;
}

public void setValor(final BigDecimal valor) {

this.valor = valor;
}

public Status getStatus() {

return this.status;
}

public void setStatus(final Status status) {

this.status = status;
}

public String getObjeto() {

return this.objeto;
}

public void setObjeto(final String objeto) {

this.objeto = objeto;
}

public Empresa getEmpresa() {

return this.empresa;
}

public void setEmpresa(final Empresa empresa) {

this.empresa = empresa;
}

public Gestor getGestor() {

return this.gestor;
}

public void setGestor(final Gestor gestor) {

this.gestor = gestor;
}

public Gestor getFiscal() {

return this.fiscal;
}

public void setFiscal(final Gestor fiscal) {

this.fiscal = fiscal;
}

}
14 changes: 14 additions & 0 deletions src/main/resources/application-prd.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
spring.datasource.url=jdbc:postgresql://Host:Port/DatabaseName?ssl=true&sslfactory=org.postgresql.ssl.NonValidatingFactory
spring.datasource.username=User
spring.datasource.password=Password
spring.datasource.driver-class-name=org.postgresql.Driver


spring.jpa.database=postgresql
spring.jpa.hibernate.ddl-auto=update
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQL95Dialect
spring.jpa.show-sql=true

spring.thymeleaf.cache=true
server.port=8180

21 changes: 20 additions & 1 deletion src/main/resources/templates/contrato/fragments/formulario.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
xmlns:th="http://www.thymealeaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

</head>
<body>
<div th:fragment="formulario">
Expand All @@ -17,7 +18,7 @@
for="numero" class="">Número</label> <input type="text"
class="form-control" id="numero" name="contrato.numero"
th:field="*{numero}" placeholder="Número do Contrato"
maxlength="7" required/>
maxlength="7" required />
</div>
</div>

Expand Down Expand Up @@ -45,6 +46,23 @@

</div>
</div>

<div class="row" >
<div class="form-group col-xs-6" id="divFical" hidden>

<label for="gestor">Fiscal</label> <select name="contrato.fiscal"
class="form-control" id="fiscal" th:field="*{fiscal}" required>

<option value="">Selecione...</option>

<th:block th:each="fiscal : ${gestores}">
<option th:value="${fiscal.id}" th:text="${fiscal.nome}"></option>
</th:block>

</select>

</div>
</div>

<div class="row">
<div class="form-group col-xs-6">
Expand Down Expand Up @@ -135,6 +153,7 @@
</form>




</div>
</body>
Expand Down
Loading

0 comments on commit 0e6edd3

Please sign in to comment.