Fix flagsezione
This commit is contained in:
@@ -1,24 +1,56 @@
|
|||||||
package it.integry.ems.rules.businessLogic.enums;
|
package it.integry.ems.rules.businessLogic.enums;
|
||||||
|
|
||||||
public enum FlagSezione {
|
import com.fasterxml.jackson.annotation.JsonValue;
|
||||||
|
import it.integry.ems_model.entity._enum.IBaseEnum;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
public enum FlagSezione implements IBaseEnum<FlagSezione> {
|
||||||
RIGHE_INTRA(1),
|
RIGHE_INTRA(1),
|
||||||
RIGHE_COLLO(2);
|
RIGHE_COLLO(2);
|
||||||
|
|
||||||
private Integer value;
|
private final Integer value;
|
||||||
|
|
||||||
FlagSezione(Integer value) {
|
FlagSezione(Integer value) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static FlagSezione fromValue(Integer value) {
|
public static FlagSezione from(Object value) {
|
||||||
|
Integer castValue;
|
||||||
|
|
||||||
|
if (value instanceof Character)
|
||||||
|
castValue = Integer.parseInt(((Character) value).toString());
|
||||||
|
else if (value instanceof String)
|
||||||
|
castValue = Integer.parseInt((String) value);
|
||||||
|
else
|
||||||
|
castValue = (Integer) value;
|
||||||
|
|
||||||
for (FlagSezione flagSezione : FlagSezione.values()) {
|
for (FlagSezione flagSezione : FlagSezione.values()) {
|
||||||
if (flagSezione.value == value) {
|
if (Objects.equals(flagSezione.value, castValue)) {
|
||||||
return flagSezione;
|
return flagSezione;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@JsonValue
|
||||||
public Integer getValue() {
|
public Integer getValue() {
|
||||||
return this.value;
|
return this.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object get() {
|
||||||
|
return this.value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FlagSezione fromInternal(Object val) {
|
||||||
|
return from(val);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return String.valueOf(value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -265,7 +265,7 @@ public class DtbDocr extends DtbBaseDocR implements EquatableEntityInterface<Dtb
|
|||||||
|
|
||||||
/*Flag_sezione vale 1 per le righe dei riepilogo INTRa, mentre per tutte le altre righe vale null */
|
/*Flag_sezione vale 1 per le righe dei riepilogo INTRa, mentre per tutte le altre righe vale null */
|
||||||
@SqlField(value = "flag_sezione")
|
@SqlField(value = "flag_sezione")
|
||||||
private Integer flagSezione;
|
private FlagSezione flagSezione;
|
||||||
|
|
||||||
@JsonProperty(value = "pesoNetto")
|
@JsonProperty(value = "pesoNetto")
|
||||||
private BigDecimal pesoNetto;
|
private BigDecimal pesoNetto;
|
||||||
@@ -1169,19 +1169,15 @@ public class DtbDocr extends DtbBaseDocR implements EquatableEntityInterface<Dtb
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getFlagSezione() {
|
public FlagSezione getFlagSezione() {
|
||||||
return flagSezione;
|
return flagSezione;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DtbDocr setFlagSezione(Integer flagSezione) {
|
public DtbDocr setFlagSezione(FlagSezione flagSezione) {
|
||||||
this.flagSezione = flagSezione;
|
this.flagSezione = flagSezione;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DtbDocr setFlagSezione (FlagSezione flagSezione) {
|
|
||||||
return setFlagSezione(flagSezione.getValue());
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getReso() {
|
public String getReso() {
|
||||||
return reso;
|
return reso;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user