primera versión de pedido realizada

This commit is contained in:
2025-11-10 21:06:53 +01:00
parent cc696d7a99
commit 4ceb4fb8e4
14 changed files with 436 additions and 101 deletions

View File

@ -47,6 +47,26 @@ public class Utils {
this.messageSource = messageSource;
}
public static List<Map<String, Object>> decodeJsonList(String json) {
ObjectMapper mapper = new ObjectMapper();
try {
return mapper.readValue(json, new TypeReference<List<Map<String, Object>>>() {
});
} catch (JsonProcessingException e) {
return new ArrayList<>();
}
}
public static Map<String, Object> decodeJsonMap(String json) {
ObjectMapper mapper = new ObjectMapper();
try {
return mapper.readValue(json, new TypeReference<Map<String, Object>>() {
});
} catch (JsonProcessingException e) {
return new HashMap<>();
}
}
public static double round2(double value) {
return BigDecimal.valueOf(value)
.setScale(2, RoundingMode.HALF_UP)