Gestita creazione vettori, aggiunta pk identity in mtblisvdataspese e flagAddTrasp in vtblist
This commit is contained in:
@@ -6,6 +6,7 @@ import it.integry.ems.service.comuni.Comune;
|
||||
import it.integry.ems.service.comuni.service.ComuniService;
|
||||
import it.integry.ems_model.entity.*;
|
||||
import it.integry.ems_model.types.OperationType;
|
||||
import it.integry.ems_model.utility.Query;
|
||||
import it.integry.ems_model.utility.UtilityDB;
|
||||
import it.integry.ems_model.utility.UtilityDate;
|
||||
import it.integry.ems_model.utility.UtilityString;
|
||||
@@ -120,7 +121,7 @@ public class AnagRules extends QueryRules {
|
||||
|
||||
public static String completeCodVdes(Connection connection, String codAnag, String placeholder) throws Exception {
|
||||
String sql = "SELECT DBO.f_suggestCodeCodVdes(" + UtilityDB.valueToString(codAnag) + ", " + UtilityDB.valueToString(placeholder) + ") as 'max' ";
|
||||
String codVdes = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(connection, sql);
|
||||
String codVdes = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(connection, sql);
|
||||
return codVdes;
|
||||
}
|
||||
|
||||
@@ -230,9 +231,15 @@ public class AnagRules extends QueryRules {
|
||||
gtbAnagNote.getGrlAnagNoteFiles().add(grlAnagNoteFiles);
|
||||
gtbAnagNote.setOperation(OperationType.INSERT_OR_UPDATE);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public static String completeCodVvet(Connection connection, VtbVett vtbVett) throws Exception {
|
||||
String sql = Query.format(
|
||||
"SELECT dbo.f_suggestCodeCodVvet(%s)",
|
||||
vtbVett.getPrecode()
|
||||
);
|
||||
|
||||
return UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(connection, sql);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
package it.integry.ems_model.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import it.integry.ems_model.annotation.ImportFromParent;
|
||||
import it.integry.ems_model.annotation.PK;
|
||||
import it.integry.ems_model.annotation.SqlField;
|
||||
import it.integry.ems_model.annotation.Table;
|
||||
import it.integry.ems_model.annotation.*;
|
||||
import it.integry.ems_model.base.EntityBase;
|
||||
import org.kie.api.definition.type.PropertyReactive;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import it.integry.ems_model.annotation.FK;
|
||||
|
||||
@PropertyReactive
|
||||
@Table(MtbLisvDataSpese.ENTITY)
|
||||
@@ -20,28 +18,46 @@ public class MtbLisvDataSpese extends EntityBase {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@PK
|
||||
@SqlField(value = "id", nullable = false)
|
||||
@Identity
|
||||
private Long id;
|
||||
|
||||
@ImportFromParent
|
||||
@SqlField(value = "cod_vlis", maxLength = 5, nullable = false)
|
||||
private String codVlis;
|
||||
|
||||
@PK
|
||||
@ImportFromParent
|
||||
@SqlField(value = "versione", nullable = false)
|
||||
private Integer versione;
|
||||
|
||||
@PK
|
||||
@SqlField(value = "cod_spes", maxLength = 5, nullable = false)
|
||||
private String codSpes;
|
||||
|
||||
@SqlField(value = "perc_ricarico", nullable = false, defaultObjectValue = "0")
|
||||
private String percRicarico;
|
||||
private BigDecimal percRicarico;
|
||||
|
||||
@SqlField(value = "val_ricarico", nullable = false, defaultObjectValue = "0")
|
||||
private String valRicarico;
|
||||
private BigDecimal valRicarico;
|
||||
|
||||
@SqlField(value = "perc_sconto", nullable = false, defaultObjectValue = "0")
|
||||
private BigDecimal percSconto;
|
||||
|
||||
@SqlField(value = "da", nullable = false, defaultObjectValue = "0")
|
||||
private Integer da;
|
||||
|
||||
@SqlField(value = "a", nullable = false, defaultObjectValue = "0")
|
||||
private Integer a;
|
||||
|
||||
@ImportFromParent
|
||||
private Date dataIniz;
|
||||
|
||||
public MtbLisvDataSpese() {
|
||||
super();
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public MtbLisvDataSpese setId(Long id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodVlis() {
|
||||
@@ -68,22 +84,49 @@ public class MtbLisvDataSpese extends EntityBase {
|
||||
this.codSpes = codSpes;
|
||||
}
|
||||
|
||||
public String getPercRicarico() {
|
||||
public BigDecimal getPercRicarico() {
|
||||
return percRicarico;
|
||||
}
|
||||
|
||||
public void setPercRicarico(String percRicarico) {
|
||||
public void setPercRicarico(BigDecimal percRicarico) {
|
||||
this.percRicarico = percRicarico;
|
||||
}
|
||||
|
||||
public String getValRicarico() {
|
||||
public BigDecimal getValRicarico() {
|
||||
return valRicarico;
|
||||
}
|
||||
|
||||
public void setValRicarico(String valRicarico) {
|
||||
public void setValRicarico(BigDecimal valRicarico) {
|
||||
this.valRicarico = valRicarico;
|
||||
}
|
||||
|
||||
public BigDecimal getPercSconto() {
|
||||
return percSconto;
|
||||
}
|
||||
|
||||
public MtbLisvDataSpese setPercSconto(BigDecimal percSconto) {
|
||||
this.percSconto = percSconto;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getDa() {
|
||||
return da;
|
||||
}
|
||||
|
||||
public MtbLisvDataSpese setDa(Integer da) {
|
||||
this.da = da;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getA() {
|
||||
return a;
|
||||
}
|
||||
|
||||
public MtbLisvDataSpese setA(Integer a) {
|
||||
this.a = a;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Date getDataIniz() {
|
||||
return dataIniz;
|
||||
}
|
||||
|
||||
@@ -102,6 +102,9 @@ public class VtbList extends EntityBase {
|
||||
@SqlField(value = "flag_add_sfrido", maxLength = 1, nullable = false, defaultObjectValue = "true")
|
||||
private Boolean flagAddSfrido;
|
||||
|
||||
@SqlField(value = "flag_add_trasp", maxLength = 1, nullable = false, defaultObjectValue = "true")
|
||||
private Boolean flagAddTrasp;
|
||||
|
||||
@Priority(101)
|
||||
private List<VtbList> vtbList;
|
||||
|
||||
@@ -305,6 +308,15 @@ public class VtbList extends EntityBase {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Boolean getFlagAddTrasp() {
|
||||
return flagAddTrasp;
|
||||
}
|
||||
|
||||
public VtbList setFlagAddTrasp(Boolean flagAddTrasp) {
|
||||
this.flagAddTrasp = flagAddTrasp;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkPreSave() throws Exception {
|
||||
}
|
||||
|
||||
@@ -78,6 +78,9 @@ public class VtbListPremi extends EntityBase {
|
||||
@SqlField(value = "note", maxLength = 255, nullable = true)
|
||||
private String note;
|
||||
|
||||
@SqlField(value = "fatturato_bdg", defaultObjectValue = "0")
|
||||
private BigDecimal fatturatoBdg;
|
||||
|
||||
public VtbListPremi() {
|
||||
super();
|
||||
}
|
||||
@@ -234,6 +237,15 @@ public class VtbListPremi extends EntityBase {
|
||||
this.note = note;
|
||||
}
|
||||
|
||||
public BigDecimal getFatturatoBdg() {
|
||||
return fatturatoBdg;
|
||||
}
|
||||
|
||||
public VtbListPremi setFatturatoBdg(BigDecimal fatturatoBdg) {
|
||||
this.fatturatoBdg = fatturatoBdg;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkPreSave() throws Exception {
|
||||
}
|
||||
|
||||
@@ -75,6 +75,8 @@ public class VtbVett extends EntityBase {
|
||||
@EntityChild
|
||||
private List<VtbVetr> vtbVetr;
|
||||
|
||||
private String precode;
|
||||
|
||||
public VtbVett() {
|
||||
super();
|
||||
}
|
||||
@@ -232,6 +234,15 @@ public class VtbVett extends EntityBase {
|
||||
this.vtbVetr = vtbVetr;
|
||||
}
|
||||
|
||||
public String getPrecode() {
|
||||
return precode;
|
||||
}
|
||||
|
||||
public VtbVett setPrecode(String precode) {
|
||||
this.precode = precode;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkPreSave() throws Exception {
|
||||
}
|
||||
|
||||
@@ -121,6 +121,11 @@ public class UtilityString {
|
||||
|
||||
public static Date parseDate(String value) throws IOException {
|
||||
String format = determineDateFormat(value);
|
||||
|
||||
if (format == null) {
|
||||
throw new IOException("Formato data non riconosciuto");
|
||||
}
|
||||
|
||||
SimpleDateFormat sdf = new SimpleDateFormat(format);
|
||||
try {
|
||||
//logger.debug("FORMATO DATA: " + format);
|
||||
|
||||
@@ -146,3 +146,13 @@ then
|
||||
Integer idRigaFido = (Integer) AnagRules.completeIdRigaFido(conn, $vtbClieFido.getCodAnag());
|
||||
modify ( $vtbClieFido ) { setIdRigaFido(idRigaFido) }
|
||||
end
|
||||
|
||||
rule "completeCodVvet"
|
||||
no-loop
|
||||
when
|
||||
eval(completeRulesEnabled)
|
||||
$vtbVett: VtbVett(codVvet == null)
|
||||
then
|
||||
String codVvet = AnagRules.completeCodVvet(conn, $vtbVett);
|
||||
modify ( $vtbVett ) { setCodVvet(codVvet) }
|
||||
end
|
||||
Reference in New Issue
Block a user