Merge branch 'master' 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,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 {
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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()) {
|
||||||
|
|||||||
@@ -174,4 +174,28 @@ when
|
|||||||
$entity: GtbAnagNote(dataIns == null)
|
$entity: GtbAnagNote(dataIns == null)
|
||||||
then
|
then
|
||||||
modify ( $entity ) { setDataIns(UtilityLocalDate.getNow()) }
|
modify ( $entity ) { setDataIns(UtilityLocalDate.getNow()) }
|
||||||
|
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
|
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
|
||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -530,7 +530,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 {
|
||||||
@@ -545,7 +545,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());
|
||||||
@@ -858,10 +858,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);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -870,7 +872,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);
|
||||||
@@ -883,19 +889,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(
|
||||||
@@ -964,6 +964,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);
|
||||||
|
|
||||||
@@ -975,6 +980,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);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user