Skip to content

Commit

Permalink
Merge "Merge 2.2.5.5 (unstable) dans maintenance"
Browse files Browse the repository at this point in the history
  • Loading branch information
Myriam Labbé committed Nov 7, 2023
2 parents 6914b7c + f29369b commit dd8a6d2
Showing 1 changed file with 35 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ protected static String computeNumero53(Hydrant hydrant) {
suffixe = "D";
break;
case "SECTEUR CHANGE RIVE GAUCHE": // Rive gauche
suffixe = "D";
suffixe = "G";
break;
case "SECTEUR CHANGE 1":
if ("PRIVE".equalsIgnoreCase(natureDeci)) {
Expand Down Expand Up @@ -804,7 +804,7 @@ public static Integer computeNumeroInterne53(Hydrant hydrant) {
case "SECTEUR CHANGE PRIVE":
case "SECTEUR CHANGE RIVE DROITE":
case "SECTEUR CHANGE RIVE GAUCHE":
numInterne = computeNumeroInterne53Private(hydrant);
numInterne = computeNumeroInterne53Private(hydrant, true);
return numInterne;
}
}
Expand Down Expand Up @@ -867,21 +867,41 @@ private static Integer computeNumeroInterne53Public(
}

private static Integer computeNumeroInterne53Private(Hydrant hydrant) {
return computeNumeroInterne53Private(hydrant, false);
}

private static Integer computeNumeroInterne53Private(Hydrant hydrant, boolean ignoreDECI) {
Integer numInterne = null;
if ("PIBI".equalsIgnoreCase(hydrant.getCode())) {
numInterne =
context
.resultQuery(
"select remocra.nextNumeroInterne(null, {0}, {1}, {2}, {3}, null, null, true)",
DSL.val(hydrant.getCode(), SQLDataType.VARCHAR),
DSL.val(hydrant.getNatureDeci(), SQLDataType.BIGINT),
(hydrant.getZoneSpeciale() == null)
? hydrant.getCommune()
: DSL.val(null, SQLDataType.BIGINT),
(hydrant.getZoneSpeciale() != null)
? hydrant.getZoneSpeciale()
: DSL.val(null, SQLDataType.BIGINT))
.fetchOneInto(Integer.class);
if (ignoreDECI) { // si on ignore la nature DECI ; Cas des secteurs Changé Rive Gauche/Droite
// Et Changé Privé
numInterne =
context
.resultQuery(
"select remocra.nextNumeroInterne(null, {0}, null, {1}, {2}, null, null, true)",
DSL.val(hydrant.getCode(), SQLDataType.VARCHAR),
(hydrant.getZoneSpeciale() == null)
? hydrant.getCommune()
: DSL.val(null, SQLDataType.BIGINT),
(hydrant.getZoneSpeciale() != null)
? hydrant.getZoneSpeciale()
: DSL.val(null, SQLDataType.BIGINT))
.fetchOneInto(Integer.class);
} else {
numInterne =
context
.resultQuery(
"select remocra.nextNumeroInterne(null, {0}, {1}, {2}, {3}, null, null, true)",
DSL.val(hydrant.getCode(), SQLDataType.VARCHAR),
DSL.val(hydrant.getNatureDeci(), SQLDataType.BIGINT),
(hydrant.getZoneSpeciale() == null)
? hydrant.getCommune()
: DSL.val(null, SQLDataType.BIGINT),
(hydrant.getZoneSpeciale() != null)
? hydrant.getZoneSpeciale()
: DSL.val(null, SQLDataType.BIGINT))
.fetchOneInto(Integer.class);
}
} else {
numInterne =
context
Expand Down

0 comments on commit dd8a6d2

Please sign in to comment.