Skip to content

Commit

Permalink
Fixing bugs with updating BigDecimal fields
Browse files Browse the repository at this point in the history
  • Loading branch information
computate committed Jun 8, 2023
1 parent 20071fd commit f7d8353
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/main/java/org/computate/frFR/java/EcrireApiClasse.java
Original file line number Diff line number Diff line change
Expand Up @@ -3060,7 +3060,7 @@ else if(StringUtils.contains(classeApiMethode, "PATCH")) {
tl(8, "if(", classeLangueConfig.getString(ConfigCles.var_requeteApi), " != null) {");
tl(9, classeLangueConfig.getString(ConfigCles.var_requeteApi), ".setNumPATCH(", classeLangueConfig.getString(ConfigCles.var_requeteApi), ".getNumPATCH() + ", classeLangueConfig.getString(ConfigCles.var_liste), classeNomSimple, ".getResponse().getResponse().getDocs().size());");
tl(9, "if(", classeLangueConfig.getString(ConfigCles.var_requeteApi), ".getNumFound() == 1L)");
tl(10, "o2.", classeLangueConfig.getString(ConfigCles.var_requeteApi), classeNomSimple, "();");
tl(10, "o", classeSauvegarde ? "2" : "", ".", classeLangueConfig.getString(ConfigCles.var_requeteApi), classeNomSimple, "();");
tl(9, "eventBus.publish(\"websocket", classeNomSimple, "\", JsonObject.mapFrom(", classeLangueConfig.getString(ConfigCles.var_requeteApi), ").toString());");
tl(8, "}");
tl(8, classeLangueConfig.getString(ConfigCles.var_gestionnaireEvenements), ".handle(Future.succeededFuture(ServiceResponse.completedWithJson(Buffer.buffer(new JsonObject().encodePrettily()))));");
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/org/computate/frFR/java/EcrireGenClasse.java
Original file line number Diff line number Diff line change
Expand Up @@ -5293,6 +5293,9 @@ else if(entiteIndexe
// requeteApi //
//////////////////

if(entiteNomSimple.toString().equals("BigDecimal"))
wRequeteApi.tl(3, "if(!Objects.equals(", entiteVar, ", original.get", entiteVarCapitalise, "()) && ", entiteVar, " != null && ", entiteVar, ".compareTo(original.get", entiteVarCapitalise, "()) != 0)");
else
wRequeteApi.tl(3, "if(!Objects.equals(", entiteVar, ", original.get", entiteVarCapitalise, "()))");
wRequeteApi.tl(4, langueConfig.getString(ConfigCles.var_requeteApi), ".addVars(\"", entiteVar, "\");");

Expand Down
9 changes: 6 additions & 3 deletions src/main/java/org/computate/frFR/java/EcrirePageClasse.java
Original file line number Diff line number Diff line change
Expand Up @@ -526,16 +526,17 @@ else if("LocalTime".equals(entiteNomSimple)) {
} else {
wWebsocketInput.tl(6, "$(this).val(val);");
}
wWebsocketInput.tl(6, langueConfig.getString(ConfigCles.var_ajouterLueur), "($(this));");
wWebsocketInput.tl(4, "});");
wWebsocketInput.tl(4, "$('.var", classeNomSimple, "' + pk + '", entiteVarCapitalise, "').each(function() {");
wWebsocketInput.tl(5, "if(val !== $(this).text())");
if(entiteNomSimple.startsWith("Json")) {
wWebsocketInput.tl(6, "$(this).val(JSON.stringify(val));");
} else {
wWebsocketInput.tl(6, "$(this).val(val);");
wWebsocketInput.tl(6, "$(this).text(val);");
}
wWebsocketInput.tl(6, langueConfig.getString(ConfigCles.var_ajouterLueur), "($(this));");
wWebsocketInput.tl(4, "});");
wWebsocketInput.tl(4, langueConfig.getString(ConfigCles.var_ajouterLueur), "($('.input", classeNomSimple, "' + pk + '", entiteVarCapitalise, "'));");
wWebsocketInput.tl(3, "}");
}
}
Expand Down Expand Up @@ -1761,7 +1762,9 @@ else if("LocalDate".equals(entiteNomSimple)) {
String classeApiTypeMediaMethode = classeDoc.getString("classeApiTypeMedia200" + classeApiMethode + "_" + langueNom + "_stored_string");
String classeApiMethodeMethode = classeDoc.getString("classeApiMethode" + classeApiMethode + "_" + langueNom + "_stored_string");

if(classeApiMethode.equals(langueConfig.getString(ConfigCles.var_PageRecherche)) || classeApiMethode.equals("PATCH") || classeApiMethode.equals("POST") || classeApiMethode.equals(langueConfig.getString(ConfigCles.var_PUTCopie)) || classeApiMethode.equals(langueConfig.getString(ConfigCles.var_PUTFusion)) || classeApiMethode.equals("PUTImport")) {
if(classeApiMethode.equals(langueConfig.getString(ConfigCles.var_PageRecherche))) {
l("{{#partial \"htm", langueConfig.getString(ConfigCles.var_Formulaire), "_", classeApiOperationIdMethode, "\"}}{{> htm", langueConfig.getString(ConfigCles.var_Formulaire), classePageNomSimple, "_", classeApiOperationIdMethode, " classApiMethodMethod=\"Page\"}}{{/partial}}");
} else if(classeApiMethode.equals("PATCH") || classeApiMethode.equals("POST") || classeApiMethode.equals(langueConfig.getString(ConfigCles.var_PUTCopie)) || classeApiMethode.equals(langueConfig.getString(ConfigCles.var_PUTFusion)) || classeApiMethode.equals("PUTImport")) {
l("{{#partial \"htm", langueConfig.getString(ConfigCles.var_Formulaire), "_", classeApiOperationIdMethode, "\"}}{{> htm", langueConfig.getString(ConfigCles.var_Formulaire), classePageNomSimple, "_", classeApiOperationIdMethode, " classApiMethodMethod=\"", classeApiMethodeMethode, "\"}}{{/partial}}");
}
}
Expand Down

0 comments on commit f7d8353

Please sign in to comment.