inserimento promozioni
Some checks failed
IntegryManagementSystem_Multi/pipeline/head There was a failure building this commit

This commit is contained in:
2025-05-09 10:42:34 +02:00
parent 44cc11ce15
commit 4fdd5b86cb
5 changed files with 45 additions and 10 deletions

View File

@@ -850,8 +850,8 @@ public class SalesRules extends QueryRules {
return campi;
}
public static Boolean checkArtEquiLisv(VtbListData vtbListData) throws Exception {
boolean bloccaDiff = setupGest.getSetupBoolean("vtb_list", "ART_EQUIVALENTI", "LOCK_DIFF");
public static Boolean checkArtEquiLisv(Connection connection, VtbListData vtbListData) throws Exception {
boolean bloccaDiff = setupGest.getSetupBoolean(connection, "vtb_list", "ART_EQUIVALENTI", "LOCK_DIFF");
if (!bloccaDiff)
return false;

View File

@@ -343,7 +343,7 @@ public class VtbListData extends EntityBase {
@Override
public void checkPreSave() throws Exception {
SalesRules.checkArtEquiLisv(this);
SalesRules.checkArtEquiLisv(connection, this);
}
public VtbList getVtbList() {

View File

@@ -5,7 +5,6 @@ import it.integry.ems.product.dto.DuplicaListinoDTO;
import it.integry.ems.product.dto.InsertPromoRequestDTO;
import it.integry.ems.product.dto.InsertPromoResponseDTO;
import it.integry.ems.product.service.ListiniVenditaServices;
import it.integry.ems.response.EsitoType;
import it.integry.ems.response.ServiceRestResponse;
import it.integry.ems.response.StatusResponse;
import it.integry.ems.status.ServiceChecker;

View File

@@ -95,8 +95,14 @@ public class InsertPromoRequestDTO {
public static class Articolo{
@JsonProperty("codmart")
private String codMart;
@JsonProperty("descrizione")
private String descrizione;
@JsonProperty("przvendiva")
private BigDecimal przVendIva;
@JsonProperty("note")
private String note;
@JsonProperty("giacenza")
private BigDecimal giacenza;
public String getCodMart() {
return codMart;
@@ -107,6 +113,15 @@ public class InsertPromoRequestDTO {
return this;
}
public String getDescrizione() {
return descrizione;
}
public Articolo setDescrizione(String descrizione) {
this.descrizione = descrizione;
return this;
}
public BigDecimal getPrzVendIva() {
return przVendIva;
}
@@ -115,5 +130,23 @@ public class InsertPromoRequestDTO {
this.przVendIva = przVendIva;
return this;
}
public String getNote() {
return note;
}
public Articolo setNote(String note) {
this.note = note;
return this;
}
public BigDecimal getGiacenza() {
return giacenza;
}
public Articolo setGiacenza(BigDecimal giacenza) {
this.giacenza = giacenza;
return this;
}
}
}

View File

@@ -869,9 +869,11 @@ public class ListiniVenditaServices {
vtbListData.setOperation(OperationType.INSERT);
for (InsertPromoRequestDTO.Articolo articolo : insertPromoRequest.getArticoli()) {
MtbLisvData mtbLisvData = new MtbLisvData();
mtbLisvData.setCodMart(articolo.getCodMart());
mtbLisvData.setPrzVendIva(articolo.getPrzVendIva());
MtbLisvData mtbLisvData = new MtbLisvData()
.setCodMart(articolo.getCodMart())
.setPrzVendIva(articolo.getPrzVendIva())
.setNote(articolo.getNote())
.setGiacenza(articolo.getGiacenza());
mtbLisvData.setOperation(OperationType.INSERT);
vtbListData.getMtbLisvData().add(mtbLisvData);
}
@@ -879,7 +881,7 @@ public class ListiniVenditaServices {
entityToProcess.add(vtbListData);
}
List<Callable<EntityBase>> calls = new ArrayList<>();
/*List<Callable<EntityBase>> calls = new ArrayList<>();
for (EntityBase entity : entityToProcess) {
Callable<EntityBase> callable = () -> {
@@ -890,10 +892,11 @@ public class ListiniVenditaServices {
}
};
calls.add(callable);
}
}*/
try {
List<EntityBase> entityRet = taskExecutorService.executeTasks(calls);
//List<EntityBase> entityRet = taskExecutorService.executeTasks(calls);
List<EntityBase> entityRet = entityProcessor.processEntityList(entityToProcess, true);
UtilityEntity.throwEntitiesException(entityRet);
InsertPromoResponse.setEntityBases(entityRet);
} catch (Exception e) {