Merge branch 'master' into feature/RefactoringGestioneColli
Some checks failed
IntegryManagementSystem_Multi/pipeline/head There was a failure building this commit
Some checks failed
IntegryManagementSystem_Multi/pipeline/head There was a failure building this commit
This commit is contained in:
@@ -8,7 +8,7 @@ public enum IntegryCustomer {
|
|||||||
IntegryCustomerDB.Agricoper_IlVisone,
|
IntegryCustomerDB.Agricoper_IlVisone,
|
||||||
IntegryCustomerDB.Agricoper_Luva),
|
IntegryCustomerDB.Agricoper_Luva),
|
||||||
|
|
||||||
ATI(IntegryCustomerDB.ATI_Finpart),
|
ATI(IntegryCustomerDB.ATI, IntegryCustomerDB.ATI_Finpart),
|
||||||
Auricchio(IntegryCustomerDB.Auricchio_Auricchio,
|
Auricchio(IntegryCustomerDB.Auricchio_Auricchio,
|
||||||
IntegryCustomerDB.Auricchio_AuricchioMiki,
|
IntegryCustomerDB.Auricchio_AuricchioMiki,
|
||||||
IntegryCustomerDB.Auricchio_AuricchioSrl,
|
IntegryCustomerDB.Auricchio_AuricchioSrl,
|
||||||
|
|||||||
@@ -9,7 +9,9 @@ public enum IntegryCustomerDB {
|
|||||||
Agricoper_IlVisone("ilvisone"),
|
Agricoper_IlVisone("ilvisone"),
|
||||||
Agricoper_Luva("luva"),
|
Agricoper_Luva("luva"),
|
||||||
|
|
||||||
|
ATI("atisrl"),
|
||||||
ATI_Finpart("Finpart"),
|
ATI_Finpart("Finpart"),
|
||||||
|
|
||||||
Auricchio_Auricchio("auricchio"),
|
Auricchio_Auricchio("auricchio"),
|
||||||
Auricchio_AuricchioMiki("auricchio_miki"),
|
Auricchio_AuricchioMiki("auricchio_miki"),
|
||||||
Auricchio_AuricchioSrl("auricchiosrl"),
|
Auricchio_AuricchioSrl("auricchiosrl"),
|
||||||
@@ -31,6 +33,7 @@ public enum IntegryCustomerDB {
|
|||||||
Carelli_Chiuso("chiuso"),
|
Carelli_Chiuso("chiuso"),
|
||||||
Carelli_Format("format"),
|
Carelli_Format("format"),
|
||||||
Carelli_Murgia("murgia"),
|
Carelli_Murgia("murgia"),
|
||||||
|
Carelli_MurgiaTest("murgia_test"),
|
||||||
Carelli_Panimal("panimal"),
|
Carelli_Panimal("panimal"),
|
||||||
Carelli_Winact("winact"),
|
Carelli_Winact("winact"),
|
||||||
Carelli_Csgr("csgr"),
|
Carelli_Csgr("csgr"),
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package it.integry.ems.migration.model;
|
||||||
|
|
||||||
|
import it.integry.ems.migration._base.BaseMigration;
|
||||||
|
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||||
|
|
||||||
|
public class Migration_20251114150912 extends BaseMigration implements MigrationModelInterface {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void up() throws Exception {
|
||||||
|
if (isHistoryDB())
|
||||||
|
return;
|
||||||
|
|
||||||
|
executeStatement("ALTER TABLE jtb_comt ADD data_mod DATETIME");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void down() throws Exception {
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package it.integry.ems.migration.model;
|
||||||
|
|
||||||
|
import it.integry.ems.migration._base.BaseMigration;
|
||||||
|
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||||
|
|
||||||
|
public class Migration_20251114163222 extends BaseMigration implements MigrationModelInterface {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void up() throws Exception {
|
||||||
|
if (isHistoryDB())
|
||||||
|
return;
|
||||||
|
|
||||||
|
executeStatement("ALTER TABLE vtb_dest ADD data_mod DATETIME");
|
||||||
|
executeStatement("ALTER TABLE ptb_pros ADD data_mod DATETIME");
|
||||||
|
executeStatement("ALTER TABLE ptb_pros_rif ADD data_mod DATETIME");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void down() throws Exception {
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package it.integry.ems.migration.model;
|
||||||
|
|
||||||
|
import it.integry.ems.migration._base.BaseMigration;
|
||||||
|
import it.integry.ems.migration._base.IntegryCustomer;
|
||||||
|
import it.integry.ems.migration._base.IntegryCustomerDB;
|
||||||
|
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||||
|
|
||||||
|
public class Migration_20251117142928 extends BaseMigration implements MigrationModelInterface {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void up() throws Exception {
|
||||||
|
if (isHistoryDB())
|
||||||
|
return;
|
||||||
|
|
||||||
|
createSetupQuery("SI_NO", "SI_NO", "SELECT 'S' UNION ALL SELECT 'N'");
|
||||||
|
createSetup("W_jriep_presenze_dip_disp", "SETUP", "SET_DATA_FINE", "N",
|
||||||
|
"imposta data fine = fine mese", false, "SI_NO", false, false,
|
||||||
|
false, false, false, null, false, "SELECT 'S' UNION ALL SELECT 'N'");
|
||||||
|
|
||||||
|
if (isCustomer(IntegryCustomer.Integry))
|
||||||
|
updateSetupValue("W_jriep_presenze_dip_disp", "SETUP", "SET_DATA_FINE", "S");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void down() throws Exception {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
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_20251117170957 extends BaseMigration implements MigrationModelInterface {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void up() throws Exception {
|
||||||
|
if (isHistoryDB())
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!isCustomerDb(IntegryCustomerDB.Gramm_Gramm))
|
||||||
|
return;
|
||||||
|
|
||||||
|
executeStatement("update stb_gest_setup set value = 'S' where gest_name = 'DTB_ORDT' and key_section in ('NUOVA_PROCEDURA','DISABLE_TRIGGER_ORDL')");
|
||||||
|
executeStatement("update stb_gest_sync set syncronize = 'R' where gest_name like 'lord%'");
|
||||||
|
executeStatement("update stb_gest_sync set syncronize = 'R' where gest_name like 'pord%'");
|
||||||
|
executeStatement("insert into stb_abil \n" +
|
||||||
|
"select case when gest_name = 'lordi' then 'LG081' else 'AG031' end , user_name, 'S', case when gest_name = 'lordi' then 'lordi_tab' else 'pordi_tab' end from stb_abil \n" +
|
||||||
|
"where gest_name in ('lordi','pordi') and case when gest_name = 'lordi' then 'LG081' else 'AG031' end + user_name not in (select cod_opz + user_name from stb_abil where cod_opz in ('LG081','AG031'))");
|
||||||
|
executeStatement("update stb_abil set flag_abil = 'N' where gest_name in ('lordi','pordi')");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void down() throws Exception {
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -165,13 +165,13 @@ public class GeneraOrdLav {
|
|||||||
|
|
||||||
String activityID = dtbOrdt.getActivityId();
|
String activityID = dtbOrdt.getActivityId();
|
||||||
boolean existActivity = !UtilityString.isNullOrEmpty(activityID);
|
boolean existActivity = !UtilityString.isNullOrEmpty(activityID);
|
||||||
HashMap<String, Object> datiOrdine = null;
|
|
||||||
if (existOrd && row.getOperation() == OperationType.UPDATE) {
|
if (existOrd && row.getOperation() == OperationType.UPDATE) {
|
||||||
datiOrdine = checkOrdLav(conn, ordProdSetupDTO.isCheckLockProd(), row.getGestione(), row.getDataOrd(), row.getNumOrd(), row.getRigaOrd());
|
datiOrdLav = checkOrdLav(conn, ordProdSetupDTO.isCheckLockProd(), row.getGestione(), row.getDataOrd(), row.getNumOrd(), row.getRigaOrd());
|
||||||
activityID = UtilityHashMap.getValueIfExists(datiOrdine, "activity_id");
|
activityID = UtilityHashMap.getValueIfExists(datiOrdLav, "activity_id");
|
||||||
// Verifica su è stato passato l'operatore dall'esterno
|
// Verifica su è stato passato l'operatore dall'esterno
|
||||||
if (codJflavLav == null) {
|
if (codJflavLav == null) {
|
||||||
codJflavLav = UtilityHashMap.getValueIfExists(datiOrdine, "cod_jflav");
|
codJflavLav = UtilityHashMap.getValueIfExists(datiOrdLav, "cod_jflav");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -230,8 +230,8 @@ public class GeneraOrdLav {
|
|||||||
if (!existOrd) {
|
if (!existOrd) {
|
||||||
numOrdLav = OrderRules.completeNumOrd(conn, gestioneLav, dataOrd, null);
|
numOrdLav = OrderRules.completeNumOrd(conn, gestioneLav, dataOrd, null);
|
||||||
} else {
|
} else {
|
||||||
numOrdLav = UtilityHashMap.getValueIfExists(datiOrdine, "num_ord");
|
numOrdLav = UtilityHashMap.getValueIfExists(datiOrdLav, "num_ord");
|
||||||
dataOrd = UtilityHashMap.getValueIfExists(datiOrdine, "data_ord");
|
dataOrd = UtilityHashMap.getValueIfExists(datiOrdLav, "data_ord");
|
||||||
}
|
}
|
||||||
|
|
||||||
row.setNumOrdRif(numOrdLav);
|
row.setNumOrdRif(numOrdLav);
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import it.integry.ems_model.annotation.*;
|
|||||||
import it.integry.ems_model.base.EntityBase;
|
import it.integry.ems_model.base.EntityBase;
|
||||||
import org.kie.api.definition.type.PropertyReactive;
|
import org.kie.api.definition.type.PropertyReactive;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -132,6 +133,9 @@ public class JtbComt extends EntityBase {
|
|||||||
@SqlField(value = "rif_comm", maxLength = 255)
|
@SqlField(value = "rif_comm", maxLength = 255)
|
||||||
private String rifComm;
|
private String rifComm;
|
||||||
|
|
||||||
|
@SqlField(value = "data_mod", defaultObjectValue = CommonConstants.TIMESTAMP)
|
||||||
|
private LocalDateTime dataMod;
|
||||||
|
|
||||||
@EntityChild
|
@EntityChild
|
||||||
private List<JrlDisOrd> jrlDisOrd = new ArrayList<>();
|
private List<JrlDisOrd> jrlDisOrd = new ArrayList<>();
|
||||||
|
|
||||||
@@ -468,6 +472,15 @@ public class JtbComt extends EntityBase {
|
|||||||
this.rifComm = rifComm;
|
this.rifComm = rifComm;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public LocalDateTime getDataMod() {
|
||||||
|
return dataMod;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JtbComt setDataMod(LocalDateTime dataMod) {
|
||||||
|
this.dataMod = dataMod;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public List<JrlDisOrd> getJrlDisOrd() {
|
public List<JrlDisOrd> getJrlDisOrd() {
|
||||||
return jrlDisOrd;
|
return jrlDisOrd;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import it.integry.ems_model.annotation.*;
|
|||||||
import it.integry.ems_model.base.EntityBase;
|
import it.integry.ems_model.base.EntityBase;
|
||||||
import org.kie.api.definition.type.PropertyReactive;
|
import org.kie.api.definition.type.PropertyReactive;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -153,6 +154,9 @@ public class PtbPros extends EntityBase {
|
|||||||
@SqlField(value = "flag_stato_pros", nullable = false, defaultObjectValue = "1")
|
@SqlField(value = "flag_stato_pros", nullable = false, defaultObjectValue = "1")
|
||||||
private Boolean flagStatoPros;
|
private Boolean flagStatoPros;
|
||||||
|
|
||||||
|
@SqlField(value = "data_mod", defaultObjectValue = CommonConstants.TIMESTAMP)
|
||||||
|
private LocalDateTime dataMod;
|
||||||
|
|
||||||
@EntityChild
|
@EntityChild
|
||||||
private List<PtbProsRif> ptbProsRif = new ArrayList<>();
|
private List<PtbProsRif> ptbProsRif = new ArrayList<>();
|
||||||
|
|
||||||
@@ -558,6 +562,15 @@ public class PtbPros extends EntityBase {
|
|||||||
this.flagStatoPros = flagStatoPros;
|
this.flagStatoPros = flagStatoPros;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public LocalDateTime getDataMod() {
|
||||||
|
return dataMod;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PtbPros setDataMod(LocalDateTime dataMod) {
|
||||||
|
this.dataMod = dataMod;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public List<PtbDest> getPtbDest() {
|
public List<PtbDest> getPtbDest() {
|
||||||
return ptbDest;
|
return ptbDest;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package it.integry.ems_model.entity;
|
package it.integry.ems_model.entity;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||||
|
import it.integry.common.var.CommonConstants;
|
||||||
import it.integry.ems_model.annotation.PK;
|
import it.integry.ems_model.annotation.PK;
|
||||||
import it.integry.ems_model.annotation.SqlDetailId;
|
import it.integry.ems_model.annotation.SqlDetailId;
|
||||||
import it.integry.ems_model.annotation.SqlField;
|
import it.integry.ems_model.annotation.SqlField;
|
||||||
@@ -10,6 +11,8 @@ import org.kie.api.definition.type.PropertyReactive;
|
|||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
@PropertyReactive
|
@PropertyReactive
|
||||||
@Table(PtbProsRif.ENTITY)
|
@Table(PtbProsRif.ENTITY)
|
||||||
@JsonTypeName(PtbProsRif.ENTITY)
|
@JsonTypeName(PtbProsRif.ENTITY)
|
||||||
@@ -48,6 +51,9 @@ public class PtbProsRif extends EntityBase {
|
|||||||
@SqlField(value = "telefono", maxLength = 40)
|
@SqlField(value = "telefono", maxLength = 40)
|
||||||
private String telefono;
|
private String telefono;
|
||||||
|
|
||||||
|
@SqlField(value = "data_mod", defaultObjectValue = CommonConstants.TIMESTAMP)
|
||||||
|
private LocalDateTime dataMod;
|
||||||
|
|
||||||
public PtbProsRif() {
|
public PtbProsRif() {
|
||||||
super(logger);
|
super(logger);
|
||||||
}
|
}
|
||||||
@@ -123,4 +129,13 @@ public class PtbProsRif extends EntityBase {
|
|||||||
this.telefono = telefono;
|
this.telefono = telefono;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public LocalDateTime getDataMod() {
|
||||||
|
return dataMod;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PtbProsRif setDataMod(LocalDateTime dataMod) {
|
||||||
|
this.dataMod = dataMod;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package it.integry.ems_model.entity;
|
package it.integry.ems_model.entity;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||||
|
import it.integry.common.var.CommonConstants;
|
||||||
import it.integry.ems_model.annotation.EntityChild;
|
import it.integry.ems_model.annotation.EntityChild;
|
||||||
import it.integry.ems_model.annotation.PK;
|
import it.integry.ems_model.annotation.PK;
|
||||||
import it.integry.ems_model.annotation.SqlField;
|
import it.integry.ems_model.annotation.SqlField;
|
||||||
@@ -12,6 +13,7 @@ import org.apache.logging.log4j.Logger;
|
|||||||
import org.kie.api.definition.type.PropertyReactive;
|
import org.kie.api.definition.type.PropertyReactive;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -225,6 +227,9 @@ public class VtbDest extends EntityBase implements EquatableEntityInterface<VtbD
|
|||||||
@SqlField(value = "stampa_doc_cons", nullable = false, defaultObjectValue = "0")
|
@SqlField(value = "stampa_doc_cons", nullable = false, defaultObjectValue = "0")
|
||||||
private Boolean stampaDocCons;
|
private Boolean stampaDocCons;
|
||||||
|
|
||||||
|
@SqlField(value = "data_mod", defaultObjectValue = CommonConstants.TIMESTAMP)
|
||||||
|
private LocalDateTime dataMod;
|
||||||
|
|
||||||
private String precode;
|
private String precode;
|
||||||
|
|
||||||
@EntityChild
|
@EntityChild
|
||||||
@@ -828,6 +833,15 @@ public class VtbDest extends EntityBase implements EquatableEntityInterface<VtbD
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public LocalDateTime getDataMod() {
|
||||||
|
return dataMod;
|
||||||
|
}
|
||||||
|
|
||||||
|
public VtbDest setDataMod(LocalDateTime dataMod) {
|
||||||
|
this.dataMod = dataMod;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void insertChilds() throws Exception {
|
protected void insertChilds() throws Exception {
|
||||||
for (VtbDestIntercode vtbDestIntercode : getVtbDestIntercode()) {
|
for (VtbDestIntercode vtbDestIntercode : getVtbDestIntercode()) {
|
||||||
|
|||||||
@@ -175,3 +175,27 @@ when
|
|||||||
then
|
then
|
||||||
modify ( $entity ) { setDataIns(UtilityLocalDate.getNow()) }
|
modify ( $entity ) { setDataIns(UtilityLocalDate.getNow()) }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
rule "completeDataModVtbDest"
|
||||||
|
when
|
||||||
|
eval(completeRulesEnabled)
|
||||||
|
$entity : VtbDest(operation != OperationType.DELETE)
|
||||||
|
then
|
||||||
|
modify ( $entity ) { setDataMod(LocalDateTime.now()) }
|
||||||
|
end
|
||||||
|
|
||||||
|
rule "completeDataModPtbPros"
|
||||||
|
when
|
||||||
|
eval(completeRulesEnabled)
|
||||||
|
$entity : PtbPros(operation != OperationType.DELETE)
|
||||||
|
then
|
||||||
|
modify ( $entity ) { setDataMod(LocalDateTime.now()) }
|
||||||
|
end
|
||||||
|
|
||||||
|
rule "completeDataModPtbProsRif"
|
||||||
|
when
|
||||||
|
eval(completeRulesEnabled)
|
||||||
|
$entity : PtbProsRif(operation != OperationType.DELETE)
|
||||||
|
then
|
||||||
|
modify ( $entity ) { setDataMod(LocalDateTime.now()) }
|
||||||
|
end
|
||||||
@@ -65,3 +65,13 @@ then
|
|||||||
String tipoAnag = CommesseRules.completeTipoAnag(conn, $comT.getCodAnag());
|
String tipoAnag = CommesseRules.completeTipoAnag(conn, $comT.getCodAnag());
|
||||||
modify($comT) {setTipoAnag(tipoAnag)}
|
modify($comT) {setTipoAnag(tipoAnag)}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
rule "completeDataMod"
|
||||||
|
when
|
||||||
|
eval(completeRulesEnabled)
|
||||||
|
$entity : JtbComt(operation != OperationType.DELETE)
|
||||||
|
then
|
||||||
|
modify ( $entity ) {
|
||||||
|
setDataMod(LocalDateTime.now())
|
||||||
|
}
|
||||||
|
end
|
||||||
@@ -416,7 +416,7 @@ public class Slim2kLogisticService {
|
|||||||
@NotNull
|
@NotNull
|
||||||
private MtbPartitaMag getMtbPartitaMag(String codMart, String partitaMag, LocalDate dataScad) throws SQLException, DataConverterNotFoundException, InstantiationException, IllegalAccessException, PrimaryDatabaseNotPresentException {
|
private MtbPartitaMag getMtbPartitaMag(String codMart, String partitaMag, LocalDate dataScad) throws SQLException, DataConverterNotFoundException, InstantiationException, IllegalAccessException, PrimaryDatabaseNotPresentException {
|
||||||
String q = Query.format(
|
String q = Query.format(
|
||||||
"SELECT partita_mag, data_scad FROM mtb_partita_mag WHERE cod_mart = %s AND IsNull(partita_mag, partita_mag_prod) = %s ",
|
"SELECT cod_mart, partita_mag, data_scad FROM mtb_partita_mag WHERE cod_mart = %s AND IsNull(partita_mag, partita_mag_prod) = %s ",
|
||||||
codMart, partitaMag, dataScad
|
codMart, partitaMag, dataScad
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -436,7 +436,9 @@ public class Slim2kLogisticService {
|
|||||||
if (first.isPresent()) {
|
if (first.isPresent()) {
|
||||||
mtbPartitaMag = first.get();
|
mtbPartitaMag = first.get();
|
||||||
if (mtbPartitaMag.getDataScad() == null) {
|
if (mtbPartitaMag.getDataScad() == null) {
|
||||||
mtbPartitaMag.setDataScad(dataScad);
|
mtbPartitaMag
|
||||||
|
.setCodMart(codMart)
|
||||||
|
.setDataScad(dataScad);
|
||||||
mtbPartitaMag.setOperation(OperationType.UPDATE);
|
mtbPartitaMag.setOperation(OperationType.UPDATE);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
package it.integry.ems.order.crm.dto;
|
package it.integry.ems.order.crm.dto;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
public class CRMAnagRequestDTO {
|
public class CRMAnagRequestDTO {
|
||||||
|
|
||||||
private Date filterDate;
|
private LocalDateTime filterDate;
|
||||||
|
|
||||||
private String flagStato;
|
private String flagStato;
|
||||||
private String partitaIva;
|
private String partitaIva;
|
||||||
@@ -12,11 +13,11 @@ public class CRMAnagRequestDTO {
|
|||||||
|
|
||||||
private boolean returnPersRif;
|
private boolean returnPersRif;
|
||||||
|
|
||||||
public Date getFilterDate() {
|
public LocalDateTime getFilterDate() {
|
||||||
return filterDate;
|
return filterDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
public CRMAnagRequestDTO setFilterDate(Date filterDate) {
|
public CRMAnagRequestDTO setFilterDate(LocalDateTime filterDate) {
|
||||||
this.filterDate = filterDate;
|
this.filterDate = filterDate;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -527,7 +527,7 @@ public class CrmService {
|
|||||||
Connection conn = multiDBTransactionManager.getPrimaryConnection();
|
Connection conn = multiDBTransactionManager.getPrimaryConnection();
|
||||||
CRMTransferProspectResponseDTO transferProspectResponse =
|
CRMTransferProspectResponseDTO transferProspectResponse =
|
||||||
CRMUtility.prospectToClie(
|
CRMUtility.prospectToClie(
|
||||||
conn , request.getCodAnag(), request.getCodPpro()
|
conn, request.getCodAnag(), request.getCodPpro()
|
||||||
);
|
);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -542,7 +542,7 @@ public class CrmService {
|
|||||||
);
|
);
|
||||||
|
|
||||||
CRMSyncResponseDTO crmSyncResponse = retrieveClienti(new CRMAnagRequestDTO().setCodAnag(codAnag));
|
CRMSyncResponseDTO crmSyncResponse = retrieveClienti(new CRMAnagRequestDTO().setCodAnag(codAnag));
|
||||||
if (!crmSyncResponse.getAnagClie().isEmpty()){
|
if (!crmSyncResponse.getAnagClie().isEmpty()) {
|
||||||
transferProspectResponse.setAnagClie(crmSyncResponse.getAnagClie().get(0));
|
transferProspectResponse.setAnagClie(crmSyncResponse.getAnagClie().get(0));
|
||||||
}
|
}
|
||||||
transferProspectResponse.setVtbDest(crmSyncResponse.getVtbDest());
|
transferProspectResponse.setVtbDest(crmSyncResponse.getVtbDest());
|
||||||
@@ -855,10 +855,12 @@ public class CrmService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public List<JtbComt> retrieveCommesse(LocalDate dateFilter) throws Exception {
|
public List<JtbComt> retrieveCommesse(LocalDate dateFilter) throws Exception {
|
||||||
if (dateFilter != null) return null;
|
if (dateFilter == null)
|
||||||
|
return UtilityDB.executeSimpleQueryDTO(
|
||||||
String sql = "SELECT * FROM jtb_comt";
|
multiDBTransactionManager.getPrimaryConnection(),
|
||||||
|
"SELECT * FROM jtb_comt", JtbComt.class);
|
||||||
|
|
||||||
|
String sql = "SELECT * FROM jtb_comt WHERE data_mod >= " + UtilityDB.valueToString(dateFilter);
|
||||||
return UtilityDB.executeSimpleQueryDTO(multiDBTransactionManager.getPrimaryConnection(), sql, JtbComt.class);
|
return UtilityDB.executeSimpleQueryDTO(multiDBTransactionManager.getPrimaryConnection(), sql, JtbComt.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -867,7 +869,11 @@ public class CrmService {
|
|||||||
|
|
||||||
String sql = "SELECT * FROM ptb_pros WHERE cod_anag IS NULL";
|
String sql = "SELECT * FROM ptb_pros WHERE cod_anag IS NULL";
|
||||||
if (requestDTO.getFilterDate() != null)
|
if (requestDTO.getFilterDate() != null)
|
||||||
sql = UtilityDB.addwhereCond(sql, "data_ins >= " + UtilityDB.valueToString(requestDTO.getFilterDate()), false);
|
sql = UtilityDB.addwhereCond(
|
||||||
|
sql,
|
||||||
|
"data_ins >= " + UtilityDB.valueToString(requestDTO.getFilterDate()) + " OR data_mod >= " + UtilityDB.valueToString(requestDTO.getFilterDate()),
|
||||||
|
true
|
||||||
|
);
|
||||||
|
|
||||||
if (requestDTO.getPartitaIva() != null)
|
if (requestDTO.getPartitaIva() != null)
|
||||||
sql = UtilityDB.addwhereCond(sql, "part_iva = " + UtilityDB.valueToString(requestDTO.getPartitaIva()), false);
|
sql = UtilityDB.addwhereCond(sql, "part_iva = " + UtilityDB.valueToString(requestDTO.getPartitaIva()), false);
|
||||||
@@ -880,19 +886,13 @@ public class CrmService {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (requestDTO.ReturnPersRif()) {
|
if (requestDTO.ReturnPersRif()) {
|
||||||
if (requestDTO.getFilterDate() == null) {
|
sql = "SELECT *\n" +
|
||||||
sql = "SELECT *\n" +
|
"FROM ptb_pros_rif\n" +
|
||||||
"FROM ptb_pros_rif\n" +
|
"WHERE EXISTS(SELECT * FROM ptb_pros WHERE ptb_pros.cod_anag IS NULL AND ptb_pros.cod_ppro = ptb_pros_rif.cod_ppro)";
|
||||||
"WHERE EXISTS(SELECT * FROM ptb_pros WHERE ptb_pros.cod_anag IS NULL AND ptb_pros.cod_ppro = ptb_pros_rif.cod_ppro)";
|
|
||||||
} else {
|
if (requestDTO.getFilterDate() != null) {
|
||||||
sql = Query.format(
|
sql = UtilityDB.addwhereCond(
|
||||||
"SELECT *\n" +
|
sql, "data_mod >= " + UtilityDB.valueToString(requestDTO.getFilterDate()), false);
|
||||||
"FROM ptb_pros_rif\n" +
|
|
||||||
"WHERE EXISTS(SELECT * FROM ptb_pros WHERE ptb_pros.cod_anag IS NULL\n" +
|
|
||||||
" AND data_ins >= %s\n" +
|
|
||||||
" AND ptb_pros.cod_ppro = ptb_pros_rif.cod_ppro)",
|
|
||||||
requestDTO.getFilterDate()
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
taskSyncResponse.setPtbProsRif(
|
taskSyncResponse.setPtbProsRif(
|
||||||
@@ -961,6 +961,11 @@ public class CrmService {
|
|||||||
"FROM vtb_dest\n" +
|
"FROM vtb_dest\n" +
|
||||||
"WHERE EXISTS(SELECT * FROM vtb_clie WHERE vtb_clie.cod_anag = vtb_dest.cod_anag)";
|
"WHERE EXISTS(SELECT * FROM vtb_clie WHERE vtb_clie.cod_anag = vtb_dest.cod_anag)";
|
||||||
|
|
||||||
|
if (requestDTO.getFilterDate() != null) {
|
||||||
|
sql = UtilityDB.addwhereCond(
|
||||||
|
sql, "data_mod >= " + UtilityDB.valueToString(requestDTO.getFilterDate()), false);
|
||||||
|
}
|
||||||
|
|
||||||
if (requestDTO.getCodAnag() != null)
|
if (requestDTO.getCodAnag() != null)
|
||||||
sql = UtilityDB.addwhereCond(sql, "cod_anag = " + UtilityDB.valueToString(requestDTO.getCodAnag()), false);
|
sql = UtilityDB.addwhereCond(sql, "cod_anag = " + UtilityDB.valueToString(requestDTO.getCodAnag()), false);
|
||||||
|
|
||||||
@@ -972,6 +977,11 @@ public class CrmService {
|
|||||||
"FROM vtb_clie_pers_rif\n" +
|
"FROM vtb_clie_pers_rif\n" +
|
||||||
"WHERE EXISTS(SELECT * FROM vtb_clie WHERE vtb_clie.cod_anag = vtb_clie_pers_rif.cod_anag)";
|
"WHERE EXISTS(SELECT * FROM vtb_clie WHERE vtb_clie.cod_anag = vtb_clie_pers_rif.cod_anag)";
|
||||||
|
|
||||||
|
if (requestDTO.getFilterDate() != null) {
|
||||||
|
sql = UtilityDB.addwhereCond(
|
||||||
|
sql, "data_ult_agg >= " + UtilityDB.valueToString(requestDTO.getFilterDate()), false);
|
||||||
|
}
|
||||||
|
|
||||||
if (requestDTO.getCodAnag() != null)
|
if (requestDTO.getCodAnag() != null)
|
||||||
sql = UtilityDB.addwhereCond(sql, "cod_anag = " + UtilityDB.valueToString(requestDTO.getCodAnag()), false);
|
sql = UtilityDB.addwhereCond(sql, "cod_anag = " + UtilityDB.valueToString(requestDTO.getCodAnag()), false);
|
||||||
|
|
||||||
|
|||||||
@@ -34,12 +34,10 @@ public class OrdiniVSlim2kService {
|
|||||||
public List<EntityBase> modificaQtaCnf(MultiDBTransactionManager multiDBTransactionManager, List<DtbOrdr> ordini) throws Exception {
|
public List<EntityBase> modificaQtaCnf(MultiDBTransactionManager multiDBTransactionManager, List<DtbOrdr> ordini) throws Exception {
|
||||||
List<EntityBase> entities = new ArrayList<>();
|
List<EntityBase> entities = new ArrayList<>();
|
||||||
Map<DtbOrdt, List<DtbOrdr>> groupOrdini = ordini.stream()
|
Map<DtbOrdt, List<DtbOrdr>> groupOrdini = ordini.stream()
|
||||||
.collect(Collectors.groupingBy(x -> {
|
.collect(Collectors.groupingBy(x -> new DtbOrdt()
|
||||||
return new DtbOrdt()
|
.setGestione(x.getGestione())
|
||||||
.setGestione(x.getGestione())
|
.setDataOrd(x.getDataOrd())
|
||||||
.setDataOrd(x.getDataOrd())
|
.setNumOrd(x.getNumOrd())
|
||||||
.setNumOrd(x.getNumOrd());
|
|
||||||
}
|
|
||||||
));
|
));
|
||||||
|
|
||||||
List<HashMap<String, Object>> articoli = new ArrayList<>();
|
List<HashMap<String, Object>> articoli = new ArrayList<>();
|
||||||
@@ -47,12 +45,17 @@ public class OrdiniVSlim2kService {
|
|||||||
|
|
||||||
for(DtbOrdt ord : groupOrdini.keySet()) {
|
for(DtbOrdt ord : groupOrdini.keySet()) {
|
||||||
for (DtbOrdr dtbOrdr : groupOrdini.get(ord)) {
|
for (DtbOrdr dtbOrdr : groupOrdini.get(ord)) {
|
||||||
|
String sql =
|
||||||
|
Query.format("SELECT * FROM dtb_ordt WHERE gestione = %s AND data_ord = %s AND num_ord = %s",
|
||||||
|
ord.getGestione(), ord.getDataOrd(), ord.getNumOrd());
|
||||||
|
|
||||||
|
ord = UtilityDB.executeSimpleQueryOnlyFirstRowDTO(multiDBTransactionManager.getPrimaryConnection(), sql, DtbOrdt.class);
|
||||||
BigDecimal qtaCnf;
|
BigDecimal qtaCnf;
|
||||||
Optional<HashMap<String, Object>> articolo = articoli.stream().filter(x -> ((String) x.get("cod_mart")).equalsIgnoreCase(dtbOrdr.getCodMart())).findFirst();
|
Optional<HashMap<String, Object>> articolo = articoli.stream().filter(x -> ((String) x.get("cod_mart")).equalsIgnoreCase(dtbOrdr.getCodMart())).findFirst();
|
||||||
if (articolo.isPresent()) {
|
if (articolo.isPresent()) {
|
||||||
qtaCnf = (BigDecimal) articolo.get().get("qta_cnf");
|
qtaCnf = (BigDecimal) articolo.get().get("qta_cnf");
|
||||||
} else {
|
} else {
|
||||||
String sql = Query.format("SELECT cod_mart, qta_cnf FROM mtb_aart WHERE cod_mart = %s", dtbOrdr.getCodMart());
|
sql = Query.format("SELECT cod_mart, qta_cnf FROM mtb_aart WHERE cod_mart = %s", dtbOrdr.getCodMart());
|
||||||
HashMap<String, Object> datiArt = UtilityDB.executeSimpleQueryOnlyFirstRow(multiDBTransactionManager.getPrimaryConnection(), sql);
|
HashMap<String, Object> datiArt = UtilityDB.executeSimpleQueryOnlyFirstRow(multiDBTransactionManager.getPrimaryConnection(), sql);
|
||||||
articoli.add(datiArt);
|
articoli.add(datiArt);
|
||||||
qtaCnf = (BigDecimal) datiArt.get("qta_cnf");
|
qtaCnf = (BigDecimal) datiArt.get("qta_cnf");
|
||||||
@@ -64,13 +67,16 @@ public class OrdiniVSlim2kService {
|
|||||||
} else {
|
} else {
|
||||||
dtbOrdr.setQtaOrd(dtbOrdr.getNumCnf().multiply(qtaCnf));
|
dtbOrdr.setQtaOrd(dtbOrdr.getNumCnf().multiply(qtaCnf));
|
||||||
}
|
}
|
||||||
|
|
||||||
dtbOrdr.setOperation(OperationType.UPDATE);
|
dtbOrdr.setOperation(OperationType.UPDATE);
|
||||||
ord.getDtbOrdr().add(dtbOrdr);
|
ord.getDtbOrdr().add(dtbOrdr);
|
||||||
}
|
}
|
||||||
|
|
||||||
entityProcessor.processEntity(ord, multiDBTransactionManager);
|
entityProcessor.processEntity(ord, multiDBTransactionManager, false);
|
||||||
|
|
||||||
Optional<HashMap<String, Object>> exportOpt = export.stream().filter(x -> ((String) x.get("cod_anag")).equalsIgnoreCase(ord.getCodAnag())).findFirst();
|
DtbOrdt finalOrd = ord;
|
||||||
|
Optional<HashMap<String, Object>> exportOpt = export.stream()
|
||||||
|
.filter(x -> ((String) x.get("cod_anag")).equalsIgnoreCase(finalOrd.getCodAnag())).findFirst();
|
||||||
HashMap<String, Object> datiExport;
|
HashMap<String, Object> datiExport;
|
||||||
if ( exportOpt.isPresent() ) {
|
if ( exportOpt.isPresent() ) {
|
||||||
datiExport = exportOpt.get();
|
datiExport = exportOpt.get();
|
||||||
|
|||||||
@@ -415,6 +415,7 @@ public class ProductionOrdersLifecycleService {
|
|||||||
.setGestioneRif(dtbOrdtP.getGestione())
|
.setGestioneRif(dtbOrdtP.getGestione())
|
||||||
.setDataOrdRif(dtbOrdtP.getDataOrd())
|
.setDataOrdRif(dtbOrdtP.getDataOrd())
|
||||||
.setNumOrdRif(dtbOrdtP.getNumOrd())
|
.setNumOrdRif(dtbOrdtP.getNumOrd())
|
||||||
|
.setDataConsProd(dataOrd)
|
||||||
.setRigaOrdRif(rigaOrdProd);
|
.setRigaOrdRif(rigaOrdProd);
|
||||||
if (!oldPk.isEmpty()) {
|
if (!oldPk.isEmpty()) {
|
||||||
dtbOrdl.setOldPk(oldPk);
|
dtbOrdl.setOldPk(oldPk);
|
||||||
@@ -437,7 +438,7 @@ public class ProductionOrdersLifecycleService {
|
|||||||
DtbOrdSteps lastStep = UtilityDB.executeSimpleQueryOnlyFirstRowDTO(multiDBTransactionManager.getPrimaryConnection(), sql, DtbOrdSteps.class);
|
DtbOrdSteps lastStep = UtilityDB.executeSimpleQueryOnlyFirstRowDTO(multiDBTransactionManager.getPrimaryConnection(), sql, DtbOrdSteps.class);
|
||||||
|
|
||||||
lastStep.setFlagStepAttivo("N");
|
lastStep.setFlagStepAttivo("N");
|
||||||
lastStep.setOperation(OperationType.UPDATE);
|
lastStep.setOperation(OperationType.INSERT_OR_UPDATE);
|
||||||
dtbOrdl.getDtbOrdSteps().add(lastStep);
|
dtbOrdl.getDtbOrdSteps().add(lastStep);
|
||||||
|
|
||||||
DtbOrdSteps dtbOrdSteps = (DtbOrdSteps) lastStep.deepClone();
|
DtbOrdSteps dtbOrdSteps = (DtbOrdSteps) lastStep.deepClone();
|
||||||
|
|||||||
Reference in New Issue
Block a user