Skip to content

Commit

Permalink
Aggiunta tabella tipo finanziamento
Browse files Browse the repository at this point in the history
  • Loading branch information
mspasiano committed Sep 27, 2018
1 parent 1f881ea commit 21d76d0
Show file tree
Hide file tree
Showing 51 changed files with 4,379 additions and 35 deletions.
6 changes: 6 additions & 0 deletions sigla-backend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,11 @@
<version>${spring.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc7</artifactId>
<version>12.1.0.2.0</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,80 @@
<column header="utuv" name="utuv" type="STRING"/>
<column header="pg_ver_rec" name="pg_ver_rec" type="NUMERIC"/>
</loadData>
</changeSet>
</changeSet>

<changeSet author="marco.spasiano" id="create-table-tipologia-finanziamento">
<createTable remarks="Tabella contenente le tipologie di finanziamento." tableName="tipo_finanziamento">
<column name="id" remarks="Chiave Primaria." type="INT">
<constraints nullable="false"/>
</column>
<column name="codice" remarks="Codice identificativo dell tipo di finanziamento dominio (
'FOE'=FOE,
'FOE_PRO'=FOE progetti,
'AUT'=Autofinanziamento,
'AUT_AREE'=Autofinanziamento AREE,
'RIM'=Rimborsi da soggetti terzi,
'COF'=Cofinanziamento,
'FIN'=Finanziamento,
'ATT_COM'=Attività Commerciale pura,
'ATT_COMM_TAR'=Attività commerciale a tariffario
)" type="VARCHAR(25)">
<constraints nullable="false"/>
</column>
<column name="descrizione" remarks="Descrizione della tipologia di finanziamento" type="VARCHAR(1000)">
<constraints nullable="false"/>
</column>
<column name="fl_piano_eco_fin" remarks="Piano economico-finanziario" type="CHAR(1)">
<constraints nullable="false"/>
</column>
<column name="fl_ass_cat_voci_ind" remarks="Associazione categoria-voci per il personale tempo indeterminato consentita" type="CHAR(1)">
<constraints nullable="false"/>
</column>
<column name="fl_ass_cat_voci_det" remarks="Associazione categoria-voci per il personale tempo determinato consentita" type="CHAR(1)">
<constraints nullable="false"/>
</column>
<column name="fl_ass_cat_voci_altro" remarks="Associazione categoria-voci per altre spese del personale" type="CHAR(1)">
<constraints nullable="false"/>
</column>
<column name="fl_prev_ent_spesa" remarks="Previsione Entrata/Spesa consentita" type="CHAR(1)">
<constraints nullable="false"/>
</column>
<column name="fl_rip_costi_pers" remarks="Ripartizione costi del personale" type="CHAR(1)">
<constraints nullable="false"/>
</column>
<column name="fl_quad_pdgp_econom" remarks="Quadratura pdgp con quota annuale del piano economico" type="CHAR(1)">
<constraints nullable="false"/>
</column>
<column name="fl_contr_val_prog" remarks="Controllo validità del Progetto" type="CHAR(1)">
<constraints nullable="false"/>
</column>
<column name="fl_piano_rend" remarks="Piano delle rendicontazioni" type="CHAR(1)">
<constraints nullable="false"/>
</column>
<column name="fl_var_cons" remarks="Variazioni consentite" type="CHAR(1)">
<constraints nullable="false"/>
</column>
<column name="fl_inc_cons" remarks="Incassi consentiti" type="CHAR(1)">
<constraints nullable="false"/>
</column>
<column name="dacr" type="${date.type}">
<constraints nullable="false"/>
</column>
<column name="utcr" type="VARCHAR(20)">
<constraints nullable="false"/>
</column>
<column name="duva" type="${date.type}">
<constraints nullable="false"/>
</column>
<column name="utuv" type="VARCHAR(20)">
<constraints nullable="false"/>
</column>
<column name="pg_ver_rec" type="BIGINT">
<constraints nullable="false"/>
</column>
</createTable>
<addPrimaryKey columnNames="id" constraintName="tipo_finanziamento_pkey" tableName="tipo_finanziamento"/>
</changeSet>
</databaseChangeLog>


21 changes: 0 additions & 21 deletions sigla-backend/src/main/resources/sigep/db-changelog-master.xml

This file was deleted.

160 changes: 160 additions & 0 deletions sigla-backend/src/test/java/it/cnr/contab/generator/ArtifactNames.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
package it.cnr.contab.generator;

import it.cnr.contab.generator.artifacts.*;
import it.cnr.contab.generator.model.GeneratorBean;
import it.cnr.contab.generator.properties.Generation;

/**
* Incapsula i nomi degli artifatti da generare
*
* @author Marco Spasiano
* @version 2.0 [22-Aug-2006] - utilizzo di BulkGeneratorDefaults
*/
public class ArtifactNames {
public final static String
JAVA_EXT = Generation.java_ext.trim(),
BIXML_EXT = Generation.bixml_ext.trim(),
BPIXML_EXT = Generation.bpixml_ext.trim();
public final static int
JAVA_BASE = 0,
JAVA_KEY = 1,
JAVA_HOME = 2,
JAVA_BULK = 3,
XML_BASE = 4,
XML_KEY = 5,
XML_BULK = 6,
XML_INFO = 7;
public final String[] artifactNames = new String[8];
private GeneratorBean bean;

public ArtifactNames(GeneratorBean bean) {
this.bean = bean;

artifactNames[JAVA_BASE] = getJavaName(Generation.java_base.trim());
artifactNames[JAVA_KEY] = getJavaName(Generation.java_key.trim());
artifactNames[JAVA_HOME] = getJavaName(Generation.java_home.trim());
artifactNames[JAVA_BULK] = getJavaName(Generation.java_bulk.trim());

artifactNames[XML_BASE] = getBulkPersistentInfoXmlName(Generation.xml_base);
artifactNames[XML_KEY] = getBulkPersistentInfoXmlName(Generation.xml_key);
artifactNames[XML_BULK] = getBulkPersistentInfoXmlName(Generation.xml_bulk);
artifactNames[XML_INFO] = getBulkInfoXmlName(Generation.xml_info);
}

public static String getName(String fullName) {
if (fullName.endsWith(JAVA_EXT)) {
int from = fullName.length() - (JAVA_EXT.length() + 1);
int index = fullName.lastIndexOf('.', from);
if (index >= 0)
return fullName.substring(index + 1);
}
return fullName;
}

// aggiunge al prefisso del nome il suffisso indicato e l'estensione
private String getJavaName(String suffix) {
return getPrefix(suffix.trim() + JAVA_EXT);
}

// aggiunge al prefisso del nome il suffisso indicato e l'estensione
private String getBulkInfoXmlName(String suffix) {
String result = bean.getPrefix();
String pack = bean.getPackageName();
StringBuffer name = new StringBuffer(bean.getTargetXMLFolder() + "/");
if (pack != null)
name.append(pack.replace('.', '/') + "/");
name.append(result.replace('.', '/') + suffix + BIXML_EXT);
return name.toString();
}

private String getBulkPersistentInfoXmlName(String suffix) {
String result = bean.getPrefix();
String pack = bean.getPackageName();
StringBuffer name = new StringBuffer(bean.getTargetXMLFolder() + "/");
if (pack != null)
name.append(pack.replace('.', '/') + "/");
name.append(result.replace('.', '/') + suffix + BPIXML_EXT);
return name.toString();
}

/**
* ritorna l'array dei nomi
*/
public String[] getArtifactNames() {
return artifactNames;
}

/**
* ritorna il nome dell'artefatto corrispondente
*/
public String getArtifactName(int i) {
return artifactNames[i];
}

/**
* ritorna il nome completo della classe (package + name)
*/
public String getJavaClass(int i) {
String temp = artifactNames[i];
if (temp.endsWith(JAVA_EXT)) {
int end = temp.length() - (JAVA_EXT.length());
return temp.substring(0, end);
} else {
return null;
}
}

private String getPrefix(String s) {
StringBuffer sb = new StringBuffer();
String pack = bean.getPackageName();
if (pack != null && pack.trim().length() > 0) {
sb.append(bean.getPackageName());
sb.append('.');
}
sb.append(bean.getPrefix());
sb.append(s);
return sb.toString();
}

/**
* ritorna il generatore associato all'indice indicato
*/
public ArtifactContents getGenerator(int i) {
switch (i) {
case JAVA_BASE:
return new JavaBase(bean);
case JAVA_BULK:
return new JavaBulk(bean);
case JAVA_HOME:
return new JavaHome(bean);
case JAVA_KEY:
return new JavaKey(bean);
case XML_BASE:
return new XMLBasePersistentInfo(bean);
case XML_BULK:
return new XMLBulkPersistentInfo(bean);
case XML_INFO:
return new XMLBulkInfo(bean);
case XML_KEY:
return new XMLKeyPersistentInfo(bean);
default:
return null;
}
}

public boolean isJavaName(int i) {
if (i < 0 || i > artifactNames.length)
return false;
if (artifactNames[i].endsWith(JAVA_EXT))
return true;
return false;
}

public boolean isXMLName(int i) {
if (i < 0 || i > artifactNames.length)
return false;
if (artifactNames[i].endsWith(BIXML_EXT) || artifactNames[i].endsWith(BPIXML_EXT))
return true;
return false;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package it.cnr.contab.generator.artifacts;

import java.util.List;

/**
* Provvede i metodi di generazione e di accesso al contenuto generato
*
* @author Marco Spasiano
* @version 1.0
* [21-Aug-2006] creazione
* [22-Aug-2006] aggiunto contratto generate(List columns)
*/
public interface ArtifactContents {

public String getContents();

public void generate(List columns) throws Exception;
}
Loading

0 comments on commit 21d76d0

Please sign in to comment.