aggiunto setup
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
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_20240812105709 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isCustomerDb(IntegryCustomerDB.Carelli_Format))
|
||||
updateSetupValue("PVM","DOC_INTERNI", "FILTRO_ARTICOLI", "[{\"codDtip\":\"DDTTR\",\"codMdep\":\"07\", \"whereCond\":\"mtb_aart.cod_mart in (select cod_mart from jtb_dist_mate where cod_mart is not null)\"}]");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package it.integry.ems.retail.pvmRetail.dto;
|
||||
|
||||
public class FiltroArtDTO {
|
||||
String codDtip, whereCond;
|
||||
private String codDtip, whereCond, codMdep;
|
||||
|
||||
public String getCodDtip() {
|
||||
return codDtip;
|
||||
@@ -20,4 +20,13 @@ public class FiltroArtDTO {
|
||||
this.whereCond = whereCond;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodMdep() {
|
||||
return codMdep;
|
||||
}
|
||||
|
||||
public FiltroArtDTO setCodMdep(String codMdep) {
|
||||
this.codMdep = codMdep;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -677,7 +677,7 @@ public class PvmService {
|
||||
|
||||
} else if (gestione == GestioneEnum.LAVORAZIONE) {
|
||||
chkTipoDocUser(requestDataDTO.getUsername(), codDtip);
|
||||
whereCondArticoli = getFiltroArticoli(multiDBTransactionManager.getPrimaryConnection(), codDtip, valoreFiltroArt);
|
||||
whereCondArticoli = getFiltroArticoli(multiDBTransactionManager.getPrimaryConnection(), codDtip, codMdep, valoreFiltroArt);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -761,11 +761,10 @@ public class PvmService {
|
||||
return grigliaAcquistiDTO;
|
||||
}
|
||||
|
||||
private String getFiltroArticoli(Connection conn, final String codDtip, String valoreFiltro) throws Exception {
|
||||
private String getFiltroArticoli(Connection conn, final String codDtip, String codMdep, String valoreFiltro) throws Exception {
|
||||
String whereCondArticoli = null;
|
||||
String filtroArticoli = null;
|
||||
List<FiltroArtDTO> filtroDTO = new ArrayList<FiltroArtDTO>();
|
||||
filtroArticoli = setupGest.getSetup(conn, "PVM", "DOC_INTERNI", "FILTRO_ARTICOLI");
|
||||
List<FiltroArtDTO> filtroDTO;
|
||||
String filtroArticoli = setupGest.getSetup(conn, "PVM", "DOC_INTERNI", "FILTRO_ARTICOLI");
|
||||
String campoFiltro = setupGest.getSetup(conn, "PVM", "DOC_INTERNI", "CAMPO_FILTRO_ARTICOLI");
|
||||
if (!UtilityString.isNullOrEmpty(filtroArticoli)) {
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
@@ -773,7 +772,8 @@ public class PvmService {
|
||||
};
|
||||
filtroDTO = objectMapper.readValue(filtroArticoli, mapType);
|
||||
final Optional<FiltroArtDTO> filtro = Stream.of(filtroDTO)
|
||||
.filter(filtroArtDTO -> filtroArtDTO.getCodDtip().equalsIgnoreCase(codDtip))
|
||||
.filter(filtroArtDTO -> filtroArtDTO.getCodDtip().equalsIgnoreCase(codDtip) &&
|
||||
filtroArtDTO.getCodMdep() == null || filtroArtDTO.getCodMdep().equalsIgnoreCase(codMdep))
|
||||
.findFirst();
|
||||
if (filtro.isPresent()) {
|
||||
whereCondArticoli = filtro.get().getWhereCond();
|
||||
|
||||
Reference in New Issue
Block a user