mirror of
https://git.imnavajas.es/jjimenez/erp-imprimelibros.git
synced 2026-01-22 08:40:22 +00:00
tengo el texto del resumen final
This commit is contained in:
@ -0,0 +1,43 @@
|
||||
package com.imprimelibros.erp.presupuesto.classes;
|
||||
|
||||
import org.springframework.context.MessageSource;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
@Component
|
||||
public class PresupuestoPapeles {
|
||||
|
||||
private final MessageSource messageSource;
|
||||
|
||||
public PresupuestoPapeles(MessageSource messageSource) {
|
||||
this.messageSource = messageSource;
|
||||
}
|
||||
|
||||
private static final Map<Integer, String> PAPEL_KEYS = Map.of(
|
||||
2, "presupuesto.estucado-mate",
|
||||
3, "presupuesto.offset-blanco",
|
||||
4, "presupuesto.offset-ahuesado",
|
||||
5, "presupuesto.cartulina-grafica-cubierta",
|
||||
6, "presupuesto.offset-ahuesado-volumen",
|
||||
7, "presupuesto.offset-blanco-volumen"
|
||||
);
|
||||
|
||||
private static final Map<String, String> CABEZADA_COLOR_KEYS = Map.of(
|
||||
"WHI", "presupuesto.cabezada-blanca",
|
||||
"GRE", "presupuesto.cabezada-verde",
|
||||
"BLUE", "presupuesto.cabezada-azul",
|
||||
"REDYEL", "presupuesto.cabezada-roja-amarilla"
|
||||
);
|
||||
|
||||
public String labelPapel(int id, Locale locale) {
|
||||
String key = PAPEL_KEYS.get(id);
|
||||
return key != null ? messageSource.getMessage(key, null, locale) : String.valueOf(id);
|
||||
}
|
||||
|
||||
public String labelCabezada(String code, Locale locale) {
|
||||
String key = CABEZADA_COLOR_KEYS.get(code);
|
||||
return key != null ? messageSource.getMessage(key, null, locale) : code;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user