Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
pierre committed Nov 17, 2017
2 parents c3919ec + bd736a2 commit 1b4b62f
Show file tree
Hide file tree
Showing 24 changed files with 544 additions and 167 deletions.
15 changes: 15 additions & 0 deletions addons/cadastrapp/css/cadastrapp.css
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,20 @@
margin:5px 2px;
}

.profDetails{
text-align: right;
}

.profDetailsLabel{
float: left;
padding-right: 15px;
}

.profCategorie{
width: 25em;
padding-bottom: 5px;
}

.add-button {
background-image: url(../img/famfamfam/add.png)
}
Expand Down Expand Up @@ -104,3 +118,4 @@
overflow: auto;
}


13 changes: 11 additions & 2 deletions addons/cadastrapp/js/habitationDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,18 @@ GEOR.Addons.Cadastre.showHabitationDetails = function(batiment, niveau, porte, a
GEOR.Addons.Cadastre.createArcticle50Panel = function(article50Details) {

if(article50Details){

var details50 = '<div class=\'profCategorie\'>' +article50Details.ccocac_lib + '</div>';
details50 = details50 + '<div class=\'profDetails\'><span class=\'profDetailsLabel\'>Surface pondérée </span>' + article50Details.dsupot + ' m²</div>';
details50 = details50 + '<div class=\'profDetails\'><span class=\'profDetailsLabel\'>Surface des parties principales </span>' + article50Details.dsup1 + ' m²</div>';
details50 = details50 + '<div class=\'profDetails\'><span class=\'profDetailsLabel\'>Surface des parties secondaires couvertes </span>' + article50Details.dsup2 + ' m²</div>';
details50 = details50 + '<div class=\'profDetails\'><span class=\'profDetailsLabel\'>Surface des parties secondaires non couvertes </span>' + article50Details.dsup3 + ' m²</div>';
details50 = details50 + '<div class=\'profDetails\'><span class=\'profDetailsLabel\'>Surface des stationnements couverts </span>' + article50Details.dsupk1 + ' m²</div>';
details50 = details50 + '<div class=\'profDetails\'><span class=\'profDetailsLabel\'>Surface des stationnements non couverts </span>' + article50Details.dsupk2 + ' m²</div>';

return new Ext.Panel({
title: 'Partie professionelle ' + article50Details.dnudes,
html:'<div>Surface réelle ' + article50Details.vsurzt + ' m²</div>',
title: 'Partie professionelle - ' + article50Details.ccocac,
html: details50,
layout: 'fit'
});
}
Expand Down
9 changes: 7 additions & 2 deletions addons/cadastrapp/js/searchParcelleByRef.js
Original file line number Diff line number Diff line change
Expand Up @@ -475,8 +475,13 @@ GEOR.Addons.Cadastre.initRechercheParcelle = function() {
if (record.data.parcelle != undefined && record.data.parcelle > 0 && record.data.section != undefined && record.data.section.length > 0) {

params.dnupla = record.data.parcelle;
params.ccopre = record.data.section.substring(0, record.data.section.length - 2);
params.ccosec = record.data.section.substring(record.data.section.length - 2, record.data.section.length);
params.ccopre = '';
params.ccosec = record.data.section;
// section has a 3-digit prefix
if (record.data.section.length > 2) {
params.ccopre = record.data.section.substring(0, 3);
params.ccosec = record.data.section.substring(3);
}

//envoi la liste de resultat
Ext.Ajax.request({
Expand Down
13 changes: 9 additions & 4 deletions addons/cadastrapp/js/searchUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,17 @@ GEOR.Addons.Cadastre.initParcelleStore = function() {
*/
GEOR.Addons.Cadastre.loadParcelleStore = function(parcelleStore, cgocommune, sectionId) {

console.log("loadParcelleStore : " + parcelleStore + ""+ cgocommune + ""+ sectionId);
console.log("loadParcelleStore : " + parcelleStore + " commune="+ cgocommune + " sectionId="+ sectionId);

if (parcelleStore!=null && cgocommune!=null && sectionId!=null) {
// parse sectionID to set params for request
var prefix = sectionId.substring(0, sectionId.length-2);
var section = sectionId.substring(sectionId.length-2, sectionId.length);
var prefix = '';
var section = sectionId;
// sectionId has 3 digits as prefix
if (sectionId.length > 2) {
prefix = sectionId.substring(0, 3);
section = sectionId.substring(3);
}

parcelleStore.load({params: {
cgocommune: cgocommune,
Expand Down Expand Up @@ -301,4 +306,4 @@ GEOR.Addons.Cadastre.getResultParcelleStore = function (result, fromForm) {





Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public class Imposition {
private float departementRevenuImposable;

private float groupementCommuneRevenuImposable;

private float tseRevenuImposable;

/**
* @return the revenuImposable
Expand Down Expand Up @@ -125,5 +127,19 @@ public void setGroupementCommuneRevenuImposable(float groupementCommuneRevenuImp
this.groupementCommuneRevenuImposable = groupementCommuneRevenuImposable;
}

/**
* @return the revenuImposable
*/
public float getTseRevenuImposable() {
return tseRevenuImposable;
}

@XmlAttribute
/**
* @param revenuImposable the revenuImposable to set
*/
public void setTseRevenuImposable(float tseRevenuImposable) {
this.tseRevenuImposable = tseRevenuImposable;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ public class ProprieteBatie extends Propriete{
// Nature du local
private String cconlc;

// Nature du local professionel
private String ccocac;

// Catégorie
private String dcapec;

Expand All @@ -44,6 +47,9 @@ public class ProprieteBatie extends Propriete{

// Liste de lots
private List<Lot> lots;

// Imposition
private Imposition imposition;

/**
* @return the dnubat
Expand Down Expand Up @@ -164,6 +170,21 @@ public String getCconlc() {
public void setCconlc(String cconlc) {
this.cconlc = cconlc;
}

/**
* @return the cconlc
*/
public String getCcocac() {
return ccocac;
}

@XmlAttribute
/**
* @param cconlc the cconlc to set
*/
public void setCcocac(String ccocac) {
this.ccocac = ccocac;
}

/**
* @return the dcapec
Expand Down Expand Up @@ -209,6 +230,21 @@ public String getGtauom() {
public void setGtauom(String gtauom) {
this.gtauom = gtauom;
}

/**
* @return the imposition
*/
public Imposition getImposition() {
return imposition;
}

@XmlElement(name = "imposition")
/**
* @param imposition the imposition to set
*/
public void setImposition(Imposition imposition) {
this.imposition = imposition;
}

/**
* @return the lots
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,9 @@ public Response exportProprietaireByParcelles(
// User need to be at least CNIL1 level
if (getUserCNILLevel(headers)>0){

//TODO externalize entete
String entete = "Compte communal;Civilité;Nom;Prénom;Nom d'usage;Prénom d'usage;Dénominiation;Nom d'usage;Adresse ligne 3;Adresse ligne 4;Adresse ligne 5;Adresse ligne 6;Identitifiants de parcelles;ccodro_lib";
String entete = "proprio_id;droit_reel_libelle;denomination_usage;parcelles;civilite;nom_usage;prenom_usage;denomination_naissance;nom_naissance;prenom_naissance;adresse_ligne3;adresse_ligne4;adresse_ligne5;adresse_ligne6";
if(getUserCNILLevel(headers)>1){
entete = entete + ";Lieu de naissance; Date de naissance";
entete = entete + ";lieu_naissance; date_naissance";
}

String[] parcelleList = StringUtils.split(parcelles, ',');
Expand All @@ -218,8 +217,7 @@ public Response exportProprietaireByParcelles(
List<Map<String,Object>> coproprietaires = new ArrayList<Map<String,Object>>();

StringBuilder queryBuilder = new StringBuilder();
queryBuilder.append("select prop.comptecommunal, ccoqua_lib, dnomus, dprnus, dnomlp, dprnlp, ddenom, app_nom_usage, dlign3, dlign4, dlign5, dlign6, ");
queryBuilder.append("string_agg(parcelle, ','), ccodro_lib ");
queryBuilder.append("select prop.comptecommunal, ccodro_lib, app_nom_usage, string_agg(parcelle, ','), ccoqua_lib, dnomus, dprnus, ddenom, dnomlp, dprnlp, dlign3, dlign4, dlign5, dlign6 ");

// If user is CNIL2 add birth information
if(getUserCNILLevel(headers)>1){
Expand All @@ -233,7 +231,7 @@ public Response exportProprietaireByParcelles(
queryBuilder.append(createWhereInQuery(parcelleList.length, "proparc.parcelle"));
queryBuilder.append(" and prop.comptecommunal = proparc.comptecommunal ");
queryBuilder.append(addAuthorizationFiltering(headers));
queryBuilder.append("GROUP BY prop.comptecommunal, ccoqua_lib, dnomus, dprnus, dnomlp, dprnlp, ddenom, app_nom_usage, dlign3, dlign4, dlign5, dlign6, ccodro_lib ");
queryBuilder.append("GROUP BY prop.comptecommunal, ccodro_lib, app_nom_usage, ccoqua_lib, dnomus, dprnus, ddenom, dnomlp, dprnlp, dlign3, dlign4, dlign5, dlign6");
// If user is CNIL2 add birth information
if(getUserCNILLevel(headers)>1){
queryBuilder.append(", dldnss, jdatnss ");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,17 @@
import org.slf4j.LoggerFactory;
import org.springframework.jdbc.core.JdbcTemplate;


/**
* HabitationController
*
* Used to get article 40, 50 and 60 informations from cadastrapp database
*
* @author pierre
*
*/
public class HabitationController extends CadController {

final static Logger logger = LoggerFactory.getLogger(HabitationController.class);
static final Logger logger = LoggerFactory.getLogger(HabitationController.class);


@GET
Expand All @@ -29,11 +36,13 @@ public class HabitationController extends CadController {
/**
* Returns information about habitation
*
* @param headers http headers used
* @param annee
* @param invar id habitation
* @param headers HttpHeaders http headers used
* information will only be return if user is CNIL2
* @param annee String corresponding to year of wanted information (normally only current year available)
* @param invar String id habitation
*
* @return JSON list
* @return Map<String, Object> containing informations from article 40 50 and 60,
* empty list if missing input parameter or if user doesn't have privilege
*/
public Map<String, Object> getHabitationDetails(@Context HttpHeaders headers,
@QueryParam("annee") String annee,
Expand All @@ -60,9 +69,10 @@ else if(annee != null && invar != null)
}

/**
* getArticle40Details
*
* @param queryParams
* @return
* @param queryParams List composed with year and invar information
* @return List<Map<String, Object>>
*/
private List<Map<String, Object>> getArticle40Details(List<String> queryParams){

Expand All @@ -88,9 +98,10 @@ private List<Map<String, Object>> getArticle40Details(List<String> queryParams){
}

/**
* getArticle50Details
*
* @param queryParams
* @return
* @param ueryParams List composed with year and invar information
* @return List<Map<String, Object>>
*/
private List<Map<String, Object>> getArticle50Details(List<String> queryParams){

Expand All @@ -99,21 +110,24 @@ private List<Map<String, Object>> getArticle50Details(List<String> queryParams){
StringBuilder queryBuilder = new StringBuilder();

// CNIL Niveau 2
queryBuilder.append("select pro.dnudes, pro.vsurzt");
queryBuilder.append("select pro.dnudes, pro.vsurzt, pro.dsupot, pro.dsup1, pro.dsup2, pro.dsup3, pro.dsupk1, pro.dsupk2, pro.ccocac, cco.ccocac_lib");
queryBuilder.append(" from ");
queryBuilder.append(databaseSchema);
queryBuilder.append(".descproffessionnel pro ");
queryBuilder.append(" where pro.annee = ? and pro.invar = ? ;");
queryBuilder.append(".descproffessionnel pro , ");
queryBuilder.append(databaseSchema);
queryBuilder.append(".prop_ccocac cco");
queryBuilder.append(" where pro.annee = ? and pro.invar = ? and pro.ccocac=cco.ccocac;");

JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);

return jdbcTemplate.queryForList(queryBuilder.toString(), queryParams.toArray());
}

/**
* getArticle60Details
*
* @param queryParams
* @return
* @param queryParams List composed with year and invar information
* @return List<Map<String, Object>>
*/
private List<Map<String, Object>> getArticle60Details(List<String> queryParams){

Expand All @@ -134,7 +148,6 @@ private List<Map<String, Object>> getArticle60Details(List<String> queryParams){
queryBuilder.append(" where dep.annee = ? and dep.invar = ? ");
queryBuilder.append(" and dep.dmatgm = mur.code and dep.dmatto = toit.code ;");


JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);

return jdbcTemplate.queryForList(queryBuilder.toString(), queryParams.toArray());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ public Response exportParcellesAsSCV(
// Create empty content
ResponseBuilder response = Response.noContent();

String entete = "Identifiant de parcelle;Commune;dnvoiri;dindic;cconvo;dvoilib;ccopre;ccosec;N° de plan;Contenance DGFiP en m²";
String entete = "parcelle; commune;voie_adr;voie_adr_cplmt;voie_type;voie_nom;section_prefixe;section;parcelle_num;contenance";

String[] parcelleArray = StringUtils.split(parcelles, ',');
List<String> parcelleList = new ArrayList<String>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,11 +327,9 @@ public Response exportProprietaireByParcelles(
// User need to be at least CNIL1 level
if (getUserCNILLevel(headers)>0){

// TODO externalize
// final String entete = "comptecommunal;ccoqua_lib;dnomus;dprnus;dnomlp;dprnlp;ddenom;app_nom_usage;app_nom_naissance;dlign3;dling4;dling5;dling6;identitifiantsparcelles;ccodro_lib";
String entete = "Compte communal;Civilité;Nom;Prénom;Nom d'usage;Prénom d'usage;Dénominiation;Nom d'usage;Adresse ligne 3;Adresse ligne 4;Adresse ligne 5;Adresse ligne 6;Identitifiants de parcelles;ccodro_lib";
String entete = "proprio_id;droit_reel_libelle;denomination_usage;parcelles;civilite;nom_usage;prenom_usage;denomination_naissance;nom_naissance;prenom_naissance;adresse_ligne3;adresse_ligne4;adresse_ligne5;adresse_ligne6";
if(getUserCNILLevel(headers)>1){
entete = entete + ";Lieu de naissance; Date de naissance";
entete = entete + ";lieu_naissance; date_naissance";
}

String[] parcelleList = StringUtils.split(parcelles, ',');
Expand All @@ -344,8 +342,8 @@ public Response exportProprietaireByParcelles(
List<Map<String,Object>> proprietaires = new ArrayList<Map<String,Object>>();

StringBuilder queryBuilder = new StringBuilder();
queryBuilder.append("select prop.comptecommunal, ccoqua_lib, dnomus, dprnus, dnomlp, dprnlp, ddenom, app_nom_usage, dlign3, dlign4, dlign5, dlign6, ");
queryBuilder.append("string_agg(parcelle, ','), ccodro_lib ");
queryBuilder.append("select prop.comptecommunal, ccodro_lib, app_nom_usage, string_agg(parcelle, ','), ccoqua_lib, dnomus, dprnus, ddenom, dnomlp, dprnlp, dlign3, dlign4, dlign5, dlign6 ");

// If user is CNIL2 add birth information
if(getUserCNILLevel(headers)>1){
queryBuilder.append(", dldnss, jdatnss ");
Expand All @@ -358,7 +356,7 @@ public Response exportProprietaireByParcelles(
queryBuilder.append(createWhereInQuery(parcelleList.length, "proparc.parcelle"));
queryBuilder.append(" and prop.comptecommunal = proparc.comptecommunal ");
queryBuilder.append(addAuthorizationFiltering(headers));
queryBuilder.append("GROUP BY prop.comptecommunal, ccoqua_lib, dnomus, dprnus, dnomlp, dprnlp, ddenom, app_nom_usage, dlign3, dlign4, dlign5, dlign6, ccodro_lib ");
queryBuilder.append("GROUP BY prop.comptecommunal, ccodro_lib, app_nom_usage, ccoqua_lib, dnomus, dprnus, ddenom, dnomlp, dprnlp, dlign3, dlign4, dlign5, dlign6");
// If user is CNIL2 add birth information
if(getUserCNILLevel(headers)>1){
queryBuilder.append(", dldnss, jdatnss ");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ private CadastrappConstants() {
public static final String PB_CODE_EVAL = "ccoeva";
public static final String PB_AFFECTATION_PEV = "ccoaff";
public static final String PB_NATURE_LOCAL = "cconlc";
public static final String PB_NATURE_LOCAL_PRO = "ccocac";
public static final String PB_CATEGORIE = "dcapec";
public static final String PB_VAL_LOCAT_TOTAL = "revcad";
public static final String PB_CODE_COLL_EXO = "ccolloc";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@

public class ReleveProprieteController extends CadController {

final static Logger logger = LoggerFactory.getLogger(ReleveProprieteController.class);

final String xslTemplate = "xsl/relevePropriete.xsl";
final String xslTemplateMinimal = "xsl/releveProprieteMinimal.xsl";
static final Logger logger = LoggerFactory.getLogger(ReleveProprieteController.class);

@Autowired
ReleveProprieteHelper releveProprieteHelper;
Expand Down Expand Up @@ -54,7 +51,6 @@ public Response createRelevePDFPropriete(@Context HttpHeaders headers, @QueryPar
comptesCommunaux = Arrays.asList(comptesCommunaux.get(0).split(","));
}
// Get information about releve de propriete
//RelevePropriete relevePropriete = getReleveProprieteInformation(comptesCommunaux, headers);
RelevePropriete relevePropriete = releveProprieteHelper.getReleveProprieteInformation(comptesCommunaux, headers, idParcelle);

File pdfResult = releveProprieteHelper.generatePDF(relevePropriete, false, false);
Expand Down
Loading

0 comments on commit 1b4b62f

Please sign in to comment.