Skip to content

Commit

Permalink
[SDIS 973] Ajout de la numérotation du SDIS 973
Browse files Browse the repository at this point in the history
Issue: #226839
Change-Id: I22764cde2565e20db63069bd1b6c48dbc572d6d9
  • Loading branch information
Clément GRENOT committed Nov 6, 2024
1 parent 6e0895e commit dbac69e
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ public enum MethodeNumerotation {
M_86,
M_89,
M_91,
M_95
M_95,
M_973
}

public static MethodeNumerotation getHydrantNumerotationMethode() {
Expand Down Expand Up @@ -82,7 +83,8 @@ public enum MethodeNumerotationInterne {
M_83,
M_86,
M_91,
M_95
M_95,
M_973
}

public static MethodeNumerotationInterne getHydrantNumerotationInterneMethode() {
Expand Down Expand Up @@ -149,6 +151,8 @@ public static String computeNumero(Hydrant hydrant) {
return NumeroUtilRepository.computeNumero91(hydrant);
case M_95:
return NumeroUtilRepository.computeNumero95(hydrant);
case M_973:
return NumeroUtilRepository.computeNumero973(hydrant);
case M_83:
default:
return NumeroUtilRepository.computeNumero83(hydrant);
Expand Down Expand Up @@ -586,6 +590,26 @@ protected static String computeNumero95(Hydrant hydrant) {
return sb.append(String.format("%04d", hydrant.getNumeroInterne())).toString();
}

/**
* <code insee commune><PI.BI.PA><numéro interne>
* sans espace
* Exemple : 97309PI10, 97304PI122, 97314PA1
*
* @param hydrant
* @return
*/
protected static String computeNumero973(Hydrant hydrant) {
StringBuilder sb = new StringBuilder();
sb.append(getHydrantCommune(hydrant).getInsee());
sb.append(
context
.select(TYPE_HYDRANT_NATURE.CODE)
.from(TYPE_HYDRANT_NATURE)
.where(TYPE_HYDRANT_NATURE.ID.eq(hydrant.getNature()))
.fetchOneInto(String.class));
return sb.append(hydrant.getNumeroInterne()).toString();
}

// ******************************
// ** Zone spéciale
// ******************************
Expand Down Expand Up @@ -679,6 +703,7 @@ public static Integer computeNumeroInterne(Hydrant hydrant) {
case M_58:
return NumeroUtilRepository.computeNumeroInterne58(hydrant);
case M_77:
case M_973:
return NumeroUtilRepository.computeNumeroInterne77(hydrant);
case M_86:
return NumeroUtilRepository.computeNumeroInterne86(hydrant);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ public enum MethodeNumerotation {
M_86,
M_89,
M_91,
M_95
M_95,
M_973
}

public static NumeroUtilRepository.MethodeNumerotation getHydrantNumerotationMethode() {
Expand Down Expand Up @@ -83,7 +84,8 @@ public enum MethodeNumerotationInterne {
M_83,
M_86,
M_91,
M_95
M_95,
M_973
}

public static NumeroUtilRepository.MethodeNumerotationInterne
Expand Down Expand Up @@ -150,6 +152,8 @@ public static String computeNumero(Hydrant hydrant) {
return NumeroUtilRepository.computeNumero91(hydrant);
case M_95:
return NumeroUtilRepository.computeNumero95(hydrant);
case M_973:
return NumeroUtilRepository.computeNumero973(hydrant);
case M_83:
default:
return NumeroUtilRepository.computeNumero83(hydrant);
Expand Down Expand Up @@ -587,6 +591,26 @@ protected static String computeNumero95(Hydrant hydrant) {
return sb.append(String.format("%04d", hydrant.getNumeroInterne())).toString();
}

/**
* <code insee commune><PI.BI.PA><numéro interne>
* sans espace
* Exemple : 97309PI10, 97304PI122, 97314PA1
*
* @param hydrant
* @return
*/
protected static String computeNumero973(Hydrant hydrant) {
StringBuilder sb = new StringBuilder();
sb.append(getHydrantCommune(hydrant).getInsee());
sb.append(
context
.select(TYPE_HYDRANT_NATURE.CODE)
.from(TYPE_HYDRANT_NATURE)
.where(TYPE_HYDRANT_NATURE.ID.eq(hydrant.getNature()))
.fetchOneInto(String.class));
return sb.append(hydrant.getNumeroInterne()).toString();
}

// ******************************
// ** Zone spéciale
// ******************************
Expand Down Expand Up @@ -679,6 +703,7 @@ public static Integer computeNumeroInterne(Hydrant hydrant) {
case M_58:
return NumeroUtilRepository.computeNumeroInterne58(hydrant);
case M_77:
case M_973:
return NumeroUtilRepository.computeNumeroInterne77(hydrant);
case M_86:
return NumeroUtilRepository.computeNumeroInterne86(hydrant);
Expand Down

0 comments on commit dbac69e

Please sign in to comment.