mirror of
https://git.imnavajas.es/jjimenez/erp-imprimelibros.git
synced 2026-01-18 23:00:21 +00:00
añadidos acabados
This commit is contained in:
@ -10,6 +10,7 @@ import java.util.stream.Collectors;
|
||||
import java.util.Locale;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.MessageSource;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.imprimelibros.erp.configurationERP.VariableService;
|
||||
@ -23,6 +24,9 @@ public class PresupuestoService {
|
||||
@Autowired
|
||||
protected VariableService variableService;
|
||||
|
||||
@Autowired
|
||||
protected MessageSource messageSource;
|
||||
|
||||
private final PresupuestadorItems presupuestadorItems;
|
||||
|
||||
public PresupuestoService(PresupuestadorItems presupuestadorItems) {
|
||||
@ -60,16 +64,16 @@ public class PresupuestoService {
|
||||
opciones.add(opcionColor);
|
||||
}
|
||||
ImagenPresupuesto opcionColorHq = this.presupuestadorItems.getImpresionColorPremium(locale);
|
||||
if(Presupuesto.TipoImpresion.colorhq.equals(presupuesto.getTipoImpresion()))
|
||||
if (Presupuesto.TipoImpresion.colorhq.equals(presupuesto.getTipoImpresion()))
|
||||
opcionColorHq.setSelected(true);
|
||||
opciones.add(opcionColorHq);
|
||||
} else {
|
||||
ImagenPresupuesto opcionNegro = this.presupuestadorItems.getImpresionNegro(locale);
|
||||
if(Presupuesto.TipoImpresion.negro.equals(presupuesto.getTipoImpresion()))
|
||||
if (Presupuesto.TipoImpresion.negro.equals(presupuesto.getTipoImpresion()))
|
||||
opcionNegro.setSelected(true);
|
||||
opciones.add(opcionNegro);
|
||||
ImagenPresupuesto opcionNegroHq = this.presupuestadorItems.getImpresionNegroPremium(locale);
|
||||
if(Presupuesto.TipoImpresion.negrohq.equals(presupuesto.getTipoImpresion()))
|
||||
if (Presupuesto.TipoImpresion.negrohq.equals(presupuesto.getTipoImpresion()))
|
||||
opcionNegroHq.setSelected(true);
|
||||
opciones.add(opcionNegroHq);
|
||||
}
|
||||
@ -342,7 +346,63 @@ public class PresupuestoService {
|
||||
} else {
|
||||
return 0; // Default case, no valid type
|
||||
}
|
||||
}
|
||||
|
||||
public Map<String, Object> obtenerOpcionesAcabadosCubierta(Presupuesto presupuesto, Locale locale) {
|
||||
Map<String, Object> resultado = new HashMap<>();
|
||||
List<Object> opciones = new ArrayList<>();
|
||||
|
||||
opciones.add(new HashMap<>() {
|
||||
{
|
||||
put("name", messageSource.getMessage("presupuesto.acabado-ninguno", null, locale));
|
||||
put("sk-id", 0);
|
||||
}
|
||||
});
|
||||
opciones.add(new HashMap<>() {
|
||||
{
|
||||
put("name", messageSource.getMessage("presupuesto.acabado-plastificado-brillo-1c", null, locale));
|
||||
put("sk-id", 1);
|
||||
}
|
||||
});
|
||||
opciones.add(new HashMap<>() {
|
||||
{
|
||||
put("name", messageSource.getMessage("presupuesto.acabado-plastificado-mate-1c", null, locale));
|
||||
put("sk-id", 5);
|
||||
}
|
||||
});
|
||||
opciones.add(new HashMap<>() {
|
||||
{
|
||||
put("name", messageSource.getMessage("presupuesto.acabado-plastificado-mate-1c-antirrayado", null, locale));
|
||||
put("sk-id", 8);
|
||||
}
|
||||
});
|
||||
opciones.add(new HashMap<>() {
|
||||
{
|
||||
put("name", messageSource.getMessage("presupuesto.acabado-plastificado-mate-uvi", null, locale));
|
||||
put("sk-id", 2);
|
||||
}
|
||||
});
|
||||
opciones.add(new HashMap<>() {
|
||||
{
|
||||
put("name", messageSource.getMessage("presupuesto.acabado-plastificado-mate-uvi3d", null, locale));
|
||||
put("sk-id", 3);
|
||||
}
|
||||
});
|
||||
opciones.add(new HashMap<>() {
|
||||
{
|
||||
put("name", messageSource.getMessage("presupuesto.acabado-plastificado-mate-uvi-braile", null, locale));
|
||||
put("sk-id", 4);
|
||||
}
|
||||
});
|
||||
opciones.add(new HashMap<>() {
|
||||
{
|
||||
put("name", messageSource.getMessage("presupuesto.acabado-plastificado-sandy-1c", null, locale));
|
||||
put("sk-id", 9);
|
||||
}
|
||||
});
|
||||
|
||||
resultado.put("opciones_acabados_cubierta", opciones);
|
||||
return resultado;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user