Merge branch 'hotfix/Hotfix-1' into develop
All checks were successful
IntegryManagementSystem_Multi/pipeline/head This commit looks good
All checks were successful
IntegryManagementSystem_Multi/pipeline/head This commit looks good
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.IntegryCustomerDB;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20250522102552 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isCustomerDb(IntegryCustomerDB.IntegryDemo_Menu)){
|
||||
executeStatement("create table dbo.mtb_depo_area\n" +
|
||||
"(\n" +
|
||||
" cod_mdep varchar(5) not null,\n" +
|
||||
" cod_area varchar(15) not null,\n" +
|
||||
" descrizione varchar(255)\n" +
|
||||
");",
|
||||
"alter table dbo.mtb_depo_posizioni add cod_area varchar(15);");
|
||||
return;
|
||||
}
|
||||
|
||||
executeStatement("create table dbo.mtb_depo_area\n" +
|
||||
"(\n" +
|
||||
" cod_mdep varchar(5) not null\n" +
|
||||
" constraint mtb_depo_area_mtb_depo_cod_mdep_fk\n" +
|
||||
" references dbo.mtb_depo,\n" +
|
||||
" cod_area varchar(15) not null,\n" +
|
||||
" descrizione varchar(255),\n" +
|
||||
" constraint pk__mtb_depo_area\n" +
|
||||
" primary key (cod_mdep, cod_area)\n" +
|
||||
");",
|
||||
|
||||
"alter table dbo.mtb_depo_posizioni add cod_area varchar(15);",
|
||||
|
||||
"alter table dbo.mtb_depo_posizioni\n" +
|
||||
" add constraint fk__mtb_depo_posizioni_mtb_depo_area_cod_mdep_cod_area\n" +
|
||||
" foreign key (cod_mdep, cod_area) references dbo.mtb_depo_area");
|
||||
|
||||
executeStatement("alter table dbo.mtb_depo_posizioni add tipo_prelievo smallint default 0 not null");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
}
|
||||
}
|
||||
@@ -140,6 +140,9 @@ public class MtbDepo extends EntityBase {
|
||||
@EntityChild
|
||||
private List<MtbDepoPosizioni> mtbDepoPosizioni = new ArrayList<>();
|
||||
|
||||
@EntityChild
|
||||
private List<MtbDepoArea> mtbDepoArea = new ArrayList<>();
|
||||
|
||||
@EntityChild
|
||||
private List<MtbDepoMarcatempo> mtbDepoMarcatempo = new ArrayList<>();
|
||||
|
||||
@@ -512,6 +515,23 @@ public class MtbDepo extends EntityBase {
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<MtbDepoArea> getMtbDepoArea() {
|
||||
return mtbDepoArea;
|
||||
}
|
||||
|
||||
public MtbDepo setMtbDepoArea(List<MtbDepoArea> mtbDepoArea) {
|
||||
this.mtbDepoArea = mtbDepoArea;
|
||||
return this;
|
||||
}
|
||||
|
||||
public MtbDepo addMtbDepoArea(MtbDepoArea mtbDepoArea) {
|
||||
if (this.mtbDepoArea == null) {
|
||||
this.mtbDepoArea = new ArrayList<>();
|
||||
}
|
||||
this.mtbDepoArea.add(mtbDepoArea);
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<MtbDepoMarcatempo> getMtbDepoMarcatempo() {
|
||||
return mtbDepoMarcatempo;
|
||||
}
|
||||
@@ -544,6 +564,9 @@ public class MtbDepo extends EntityBase {
|
||||
for (MtbDepoPosizioni mtbDepoPosizioni : getMtbDepoPosizioni()) {
|
||||
mtbDepoPosizioni.manageWithParentConnection(connection, mtbDepoPosizioni.getOperation(), dataCompleting, entityHolder);
|
||||
}
|
||||
for (MtbDepoArea mtbDepoArea : getMtbDepoArea()) {
|
||||
mtbDepoArea.manageWithParentConnection(connection, mtbDepoArea.getOperation(), dataCompleting, entityHolder);
|
||||
}
|
||||
for (MtbDepoCasse mtbDepoCasse : getMtbDepoCasse()) {
|
||||
mtbDepoCasse.manageWithParentConnection(connection, mtbDepoCasse.getOperation(), dataCompleting, entityHolder);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
package it.integry.ems_model.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import it.integry.ems_model.annotation.*;
|
||||
import it.integry.ems_model.base.EntityBase;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.kie.api.definition.type.PropertyReactive;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@PropertyReactive
|
||||
@Table(MtbDepoArea.ENTITY)
|
||||
@JsonTypeName(MtbDepoArea.ENTITY)
|
||||
public class MtbDepoArea extends EntityBase {
|
||||
|
||||
private final static Logger logger = LogManager.getLogger();
|
||||
|
||||
public static final String ENTITY = "mtb_depo_area";
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@PK
|
||||
@SqlField(value = "cod_mdep", maxLength = 5, nullable = false)
|
||||
private String codMdep;
|
||||
|
||||
@SqlField(value = "descrizione", maxLength = 255)
|
||||
private String descrizione;
|
||||
|
||||
@SqlField(value = "cod_area", maxLength = 15)
|
||||
private String codArea;
|
||||
|
||||
|
||||
|
||||
public MtbDepoArea() {
|
||||
super(logger);
|
||||
}
|
||||
|
||||
public String getCodMdep() {
|
||||
return codMdep;
|
||||
}
|
||||
|
||||
public MtbDepoArea setCodMdep(String codMdep) {
|
||||
this.codMdep = codMdep;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public String getDescrizione() {
|
||||
return descrizione;
|
||||
}
|
||||
|
||||
public MtbDepoArea setDescrizione(String descrizione) {
|
||||
this.descrizione = descrizione;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getCodArea() {
|
||||
return codArea;
|
||||
}
|
||||
|
||||
public MtbDepoArea setCodArea(String codArea) {
|
||||
this.codArea = codArea;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
protected void insertChilds() throws Exception {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,10 @@
|
||||
package it.integry.ems_model.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import it.integry.ems_model.annotation.*;
|
||||
import it.integry.ems_model.base.EntityBase;
|
||||
import it.integry.ems_model.entity._enum.IBaseEnum;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.kie.api.definition.type.PropertyReactive;
|
||||
@@ -54,6 +56,12 @@ public class MtbDepoPosizioni extends EntityBase {
|
||||
@SqlField(value = "posti_pallet", nullable = false, defaultObjectValue = "0")
|
||||
private Integer postiPallet;
|
||||
|
||||
@SqlField(value = "cod_area", maxLength = 15)
|
||||
private String codArea;
|
||||
|
||||
@SqlField(value = "tipo_prelievo")
|
||||
private TipoPrelievo tipoPrelievo;
|
||||
|
||||
@Priority(1)
|
||||
private StbPosizioni stbPosizioni;
|
||||
|
||||
@@ -154,6 +162,24 @@ public class MtbDepoPosizioni extends EntityBase {
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodArea() {
|
||||
return codArea;
|
||||
}
|
||||
|
||||
public MtbDepoPosizioni setCodArea(String codArea) {
|
||||
this.codArea = codArea;
|
||||
return this;
|
||||
}
|
||||
|
||||
public TipoPrelievo getTipoPrelievo() {
|
||||
return tipoPrelievo;
|
||||
}
|
||||
|
||||
public MtbDepoPosizioni setTipoPrelievo(TipoPrelievo tipoPrelievo) {
|
||||
this.tipoPrelievo = tipoPrelievo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public StbPosizioni getStbPosizioni() {
|
||||
return stbPosizioni;
|
||||
}
|
||||
@@ -169,4 +195,39 @@ public class MtbDepoPosizioni extends EntityBase {
|
||||
//
|
||||
// this.setIdPosizione(stbPosizioni.getId());
|
||||
}
|
||||
|
||||
public enum TipoPrelievo implements IBaseEnum {
|
||||
|
||||
PRELIEVO_LIBERO((short) 0), PRELIEVO_FIFO((short) 1), PRELIEVO_LIFO((short) 2);
|
||||
|
||||
private final short value;
|
||||
|
||||
TipoPrelievo(short value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public static TipoPrelievo from(Object value) {
|
||||
short castValue = (short) value;
|
||||
for (TipoPrelievo b : TipoPrelievo.values()) {
|
||||
if (b.value == castValue)
|
||||
return b;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public short getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object get() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object fromInternal(Object val) {
|
||||
return from(val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4081,7 +4081,7 @@ public class DocumentProdService {
|
||||
if (!materiale.getQtaProdOrd().equals(BigDecimal.ZERO)) {
|
||||
/*Se si tratta di una materia prima di tipo IMBALLAGGIO ed è stata passata la quantità in confezioni dal servizio,
|
||||
allora il rapporto deve essere calcolato in base al numero di confezioni realizzate */
|
||||
if (materiale.getGruppoContoMp() != null && tipoImballaggi.compareTo(materiale.getGruppoContoMp()) == 0 && !UtilityBigDecimal.isNullOrZero(datiScarico.getNumCnf())) {
|
||||
if (materiale.getGruppoContoMp() != null && tipoImballaggi.equalsIgnoreCase(materiale.getGruppoContoMp()) && !UtilityBigDecimal.isNullOrZero(datiScarico.getNumCnf())) {
|
||||
rapporto = datiScarico.getNumCnf().divide(dettaglioScaricoDTO.getNumCnf(), 10, RoundingMode.HALF_UP);
|
||||
} else {
|
||||
rapporto = qtaProdUMMag.divide(materiale.getQtaProdOrd(), 5, RoundingMode.HALF_UP);
|
||||
|
||||
Reference in New Issue
Block a user