Merge branch 'develop' into feature/JDK11
All checks were successful
IntegryManagementSystem_Multi/pipeline/head This commit looks good

This commit is contained in:
jenkins
2025-02-06 17:07:19 +01:00
13 changed files with 181 additions and 93 deletions

View File

@@ -0,0 +1,31 @@
package it.integry.ems.migration.model;
import it.integry.ems.migration._base.BaseMigration;
import it.integry.ems.migration._base.MigrationModelInterface;
public class Migration_20250205190829 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("PICKING", "RETTIFICA_GIACENZE", "FLAG_ENABLE_MOVIMENTO_FISCALE", "N",
"Flag che abilita o meno la generazione automatica di un movimento fiscale quando viene effettuata una rettifica giacenze", false, "SI_NO", false, false,
false, false, false, null, false, "SELECT 'S' UNION ALL SELECT 'N'");
createSetupQuery("COD_DTIP", "COD_DTIP", "SELECT COD_DTIP FROM DTB_TIPI ORDER BY 1");
createSetup("PICKING", "RETTIFICA_GIACENZE", "TIPO_MOVIMENTO_FISCALE", null,
"Indica il tipo documento del movimento fiscale da utilizzare", false, "COD_DTIP", false, false,
false, false, false, null, false, "SELECT COD_DTIP FROM DTB_TIPI ORDER BY 1");
}
@Override
public void down() throws Exception {
}
}

View File

@@ -14,6 +14,7 @@ public class Migration_20250206103823 extends BaseMigration implements Migration
createSetup("W_GANAG_RC", "SETUP", "CHECK_COD_FISC", "N", createSetup("W_GANAG_RC", "SETUP", "CHECK_COD_FISC", "N",
"Blocca se codice fiscale è esistente", false, "SI_NO", false, false, "Blocca se codice fiscale è esistente", false, "SI_NO", false, false,
false, false, false, null, false, "SELECT 'S' UNION ALL SELECT 'N'"); false, false, false, null, false, "SELECT 'S' UNION ALL SELECT 'N'");
createSetupQuery("SI_NO", "SI_NO", "SELECT 'S' UNION ALL SELECT 'N'"); createSetupQuery("SI_NO", "SI_NO", "SELECT 'S' UNION ALL SELECT 'N'");
createSetup("W_GANAG_RC", "SETUP", "CHECK_PART_IVA", "N", createSetup("W_GANAG_RC", "SETUP", "CHECK_PART_IVA", "N",
"Blocca se partita iva è esistente", false, "SI_NO", false, false, "Blocca se partita iva è esistente", false, "SI_NO", false, false,

View File

@@ -76,7 +76,7 @@ public class UtilityUser {
List<MtbDepo> depos = UtilityDB.executeSimpleQueryDTO(multiDBTransactionManager.getPrimaryConnection(), sql, MtbDepo.class); List<MtbDepo> depos = UtilityDB.executeSimpleQueryDTO(multiDBTransactionManager.getPrimaryConnection(), sql, MtbDepo.class);
if (depos == null || depos.isEmpty()) { if (depos == null || depos.isEmpty()) {
logger.info("Nessun deposito trovato per l'utente " + userDTO.getUsername()); logger.trace("Nessun deposito trovato per l'utente " + userDTO.getUsername());
return null; return null;
} }

View File

@@ -15,6 +15,7 @@ import org.kie.api.definition.type.PropertyReactive;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date; import java.util.Date;
import java.util.Objects; import java.util.Objects;
@@ -102,7 +103,7 @@ public class MtbColr extends EntityBase implements EquatableEntityInterface<MtbC
private Integer numColloRif; private Integer numColloRif;
@SqlField(value = "datetime_row", defaultObjectValue = CommonConstants.TIMESTAMP) @SqlField(value = "datetime_row", defaultObjectValue = CommonConstants.TIMESTAMP)
private Date datetimeRow; private LocalDateTime datetimeRow;
@SqlField(value = "cod_jcom", maxLength = 10) @SqlField(value = "cod_jcom", maxLength = 10)
private String codJcom; private String codJcom;
@@ -374,11 +375,11 @@ public class MtbColr extends EntityBase implements EquatableEntityInterface<MtbC
return this; return this;
} }
public Date getDatetimeRow() { public LocalDateTime getDatetimeRow() {
return datetimeRow; return datetimeRow;
} }
public MtbColr setDatetimeRow(Date datetimeRow) { public MtbColr setDatetimeRow(LocalDateTime datetimeRow) {
this.datetimeRow = datetimeRow; this.datetimeRow = datetimeRow;
return this; return this;
} }

View File

@@ -6,6 +6,7 @@ import it.integry.ems_model.entity.MtbColr;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date; import java.util.Date;
public class CaricoLavorazioneDTO { public class CaricoLavorazioneDTO {
@@ -62,7 +63,7 @@ public class CaricoLavorazioneDTO {
private Integer numColloRif; private Integer numColloRif;
@SqlField(value = "datetime_row", defaultObjectValue = CommonConstants.TIMESTAMP) @SqlField(value = "datetime_row", defaultObjectValue = CommonConstants.TIMESTAMP)
private Date datetimeRow; private LocalDateTime datetimeRow;
@SqlField("cod_jcom") @SqlField("cod_jcom")
private String codJcom; private String codJcom;
@@ -231,11 +232,11 @@ public class CaricoLavorazioneDTO {
this.numColloRif = numColloRif; this.numColloRif = numColloRif;
} }
public Date getDatetimeRow() { public LocalDateTime getDatetimeRow() {
return datetimeRow; return datetimeRow;
} }
public void setDatetimeRow(Date datetimeRow) { public void setDatetimeRow(LocalDateTime datetimeRow) {
this.datetimeRow = datetimeRow; this.datetimeRow = datetimeRow;
} }

View File

@@ -26,6 +26,7 @@ import java.math.RoundingMode;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.time.LocalDate; import java.time.LocalDate;
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;
@@ -151,7 +152,7 @@ public class BiolexchImportService {
String untMis = rs.getString(8); String untMis = rs.getString(8);
BigDecimal qtaCol = rs.getBigDecimal(9); BigDecimal qtaCol = rs.getBigDecimal(9);
BigDecimal numCnf = rs.getBigDecimal(10); BigDecimal numCnf = rs.getBigDecimal(10);
Date SSCCDataOraRiga = rs.getTimestamp(11); LocalDateTime SSCCDataOraRiga = rs.getTimestamp(11).toLocalDateTime();
String gestione = rs.getString(12); String gestione = rs.getString(12);
Date dataOrd = rs.getDate(13); Date dataOrd = rs.getDate(13);
Integer numOrd = rs.getInt(14); Integer numOrd = rs.getInt(14);

View File

@@ -1,6 +1,7 @@
package it.integry.ems.retail.pvmRetail.dto.save; package it.integry.ems.retail.pvmRetail.dto.save;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date; import java.util.Date;
public class ArtDTO { public class ArtDTO {
@@ -31,7 +32,7 @@ public class ArtDTO {
private String codAlis ; private String codAlis ;
private Date datetimeRow; private LocalDateTime datetimeRow;
public Integer getRigaOrd() { public Integer getRigaOrd() {
return rigaOrd; return rigaOrd;
@@ -139,11 +140,11 @@ public class ArtDTO {
return this; return this;
} }
public Date getDatetimeRow() { public LocalDateTime getDatetimeRow() {
return datetimeRow; return datetimeRow;
} }
public ArtDTO setDatetimeRow(Date datetimeRow) { public ArtDTO setDatetimeRow(LocalDateTime datetimeRow) {
this.datetimeRow = datetimeRow; this.datetimeRow = datetimeRow;
return this; return this;
} }

View File

@@ -25,7 +25,6 @@ import it.integry.ems_model.entity._enum.GestioneEnum;
import it.integry.ems_model.service.SetupGest; import it.integry.ems_model.service.SetupGest;
import it.integry.ems_model.types.OperationType; import it.integry.ems_model.types.OperationType;
import it.integry.ems_model.utility.*; import it.integry.ems_model.utility.*;
import org.apache.commons.lang3.time.DateUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope; import org.springframework.context.annotation.Scope;
import org.springframework.security.core.userdetails.UsernameNotFoundException; import org.springframework.security.core.userdetails.UsernameNotFoundException;
@@ -298,7 +297,7 @@ public class WMSAccettazioneService {
.setCodDtipDoc(insertUDCRowRequestDTO.getCodDtip()) .setCodDtipDoc(insertUDCRowRequestDTO.getCodDtip())
.setSerDoc(insertUDCRowRequestDTO.getSerDoc()) .setSerDoc(insertUDCRowRequestDTO.getSerDoc())
.setDatetimeRow(new Date()); .setDatetimeRow(UtilityLocalDate.getNowTime());
if (insertUDCRowRequestDTO.getCodMart() != null) { if (insertUDCRowRequestDTO.getCodMart() != null) {
@@ -347,7 +346,7 @@ public class WMSAccettazioneService {
.setPartitaMag(editUDCRowRequestDTO.getNewPartitaMag()) .setPartitaMag(editUDCRowRequestDTO.getNewPartitaMag())
.setDataScadPartita(editUDCRowRequestDTO.getNewDataScad()) .setDataScadPartita(editUDCRowRequestDTO.getNewDataScad())
.setUtente(userSession.getFullname()) .setUtente(userSession.getFullname())
.setDatetimeRow(new Date()); .setDatetimeRow(UtilityLocalDate.getNowTime());
MtbColt targetMtbColt = new MtbColt() MtbColt targetMtbColt = new MtbColt()
.setGestione(sourceMtbColr.getGestione()) .setGestione(sourceMtbColr.getGestione())
@@ -654,7 +653,7 @@ public class WMSAccettazioneService {
colloCarico.setMtbCols(new ArrayList<>()); colloCarico.setMtbCols(new ArrayList<>());
colloDest.setMtbCols(new ArrayList<>()); colloDest.setMtbCols(new ArrayList<>());
colloDest.setMtbColr(new ArrayList<>()); colloDest.setMtbColr(new ArrayList<>());
colloCarico.getMtbColr().get(0).setDatetimeRow(DateUtils.addMinutes(Calendar.getInstance().getTime(), 5)); colloCarico.getMtbColr().get(0).setDatetimeRow(UtilityLocalDate.getNowTime().plusMinutes(5));
wmsGenericService.spostaArtsTraUL(colloCarico, colloDest, false); wmsGenericService.spostaArtsTraUL(colloCarico, colloDest, false);
return colloCarico; return colloCarico;

View File

@@ -26,6 +26,7 @@ import it.integry.ems.retail.wms.generic.dto.ordine.SM2OrdineBancaleDTO;
import it.integry.ems.retail.wms.generic.dto.ordine.SM2OrdineSingoloDTO; import it.integry.ems.retail.wms.generic.dto.ordine.SM2OrdineSingoloDTO;
import it.integry.ems.retail.wms.generic.dto.picking_list.*; import it.integry.ems.retail.wms.generic.dto.picking_list.*;
import it.integry.ems.rules.completing.PackagesRules; import it.integry.ems.rules.completing.PackagesRules;
import it.integry.ems.service.AziendaService;
import it.integry.ems.service.EntityProcessor; import it.integry.ems.service.EntityProcessor;
import it.integry.ems.service.PrinterService; import it.integry.ems.service.PrinterService;
import it.integry.ems.sync.MultiDBTransaction.MultiDBTransactionManager; import it.integry.ems.sync.MultiDBTransaction.MultiDBTransactionManager;
@@ -62,11 +63,14 @@ public class WMSGenericService {
private final Logger logger = LogManager.getLogger(); private final Logger logger = LogManager.getLogger();
@Autowired @Autowired
SetupGest setupGest; private SetupGest setupGest;
@Autowired @Autowired
private MultiDBTransactionManager multiDBTransactionManager; private MultiDBTransactionManager multiDBTransactionManager;
@Autowired
private AziendaService aziendaService;
@Autowired @Autowired
private WMSGiacenzaService wmsGiacenzaService; private WMSGiacenzaService wmsGiacenzaService;
@@ -1207,6 +1211,7 @@ public class WMSGenericService {
boolean isPositiveUpdate = UtilityBigDecimal.lowerThan(sourceMtbColr.getQtaCol(), newQtaCol); boolean isPositiveUpdate = UtilityBigDecimal.lowerThan(sourceMtbColr.getQtaCol(), newQtaCol);
boolean isNegativeUpdate = UtilityBigDecimal.greaterThan(sourceMtbColr.getQtaCol(), newQtaCol); boolean isNegativeUpdate = UtilityBigDecimal.greaterThan(sourceMtbColr.getQtaCol(), newQtaCol);
boolean shouldCreateMovimentoFiscale = setupGest.getSetupBoolean(multiDBTransactionManager.getPrimaryConnection(), "PICKING", "RETTIFICA_GIACENZE", "FLAG_ENABLE_MOVIMENTO_FISCALE");
BigDecimal differenceQtaCol = newQtaCol.subtract(sourceMtbColr.getQtaCol()); BigDecimal differenceQtaCol = newQtaCol.subtract(sourceMtbColr.getQtaCol());
BigDecimal differenceNumCnf = newNumCnf.subtract(sourceMtbColr.getNumCnf()); BigDecimal differenceNumCnf = newNumCnf.subtract(sourceMtbColr.getNumCnf());
@@ -1221,11 +1226,51 @@ public class WMSGenericService {
MtbColr mtbColrToSave = null; MtbColr mtbColrToSave = null;
MtbColr mtbColrOrphan; MtbColr mtbColrOrphan;
if (isDocumentAttached || createNewCollo) { try {
if (isPositiveUpdate) { DtbDoct dtbDoctInv = null;
//Creo una UL L+ orfana che poi aggancio nel collo attuale
try { if (shouldCreateMovimentoFiscale && isDocumentAttached) {
String codDtipToUse = setupGest.getSetup(multiDBTransactionManager.getPrimaryConnection(), "PICKING", "RETTIFICA_GIACENZE", "TIPO_MOVIMENTO_FISCALE");
if (UtilityString.isNullOrEmpty(codDtipToUse))
throw new Exception("Per poter generare il movimento fiscale è necessario configurare anche la setup TIPO_MOVIMENTO_FISCALE");
String sqlCheckDocExists = Query.format("SELECT TOP 1 cod_anag, cod_dtip, ser_doc, data_doc, num_doc " +
" FROM " + DtbDoct.ENTITY +
" WHERE cod_mdep = {} AND data_doc = {} AND cod_dtip = {} " +
" ORDER BY num_doc DESC",
codMdep, UtilityLocalDate.getNow(), codDtipToUse);
dtbDoctInv = UtilityDB.executeSimpleQueryOnlyFirstRowDTO(multiDBTransactionManager.getPrimaryConnection(), sqlCheckDocExists, DtbDoct.class);
if (dtbDoctInv == null) {
String codAnagAziendale = aziendaService.retrieveInternalCodAnagFornitore();
dtbDoctInv = new DtbDoct(codAnagAziendale, codDtipToUse, new Date(), null, null)
.setCodMdep(codMdep);
dtbDoctInv.setOperation(OperationType.INSERT);
} else {
dtbDoctInv.setOperation(OperationType.NO_OP);
}
final DtbDocr dtbDocr = new DtbDocr()
.setCodMart(sourceMtbColr.getCodMart())
.setPartitaMag(sourceMtbColr.getPartitaMag())
.setQta(differenceQtaCol)
.setNumCnf(differenceNumCnf)
.setQtaCnf(qtaCnf);
dtbDocr.setOperation(OperationType.INSERT);
dtbDoctInv.getDtbDocr()
.add(dtbDocr);
entityProcessor.processEntity(dtbDoctInv, multiDBTransactionManager, true);
}
if (isDocumentAttached || createNewCollo) {
if (isPositiveUpdate) {
//Creo una UL L+ orfana che poi aggancio nel collo attuale
mtbColrOrphan = ((MtbColr) sourceMtbColr.clone()) mtbColrOrphan = ((MtbColr) sourceMtbColr.clone())
.setNumCollo(null) .setNumCollo(null)
@@ -1235,7 +1280,7 @@ public class WMSGenericService {
.setQtaCol(differenceQtaCol) .setQtaCol(differenceQtaCol)
.setNumCnf(differenceNumCnf) .setNumCnf(differenceNumCnf)
.setQtaCnf(qtaCnf) .setQtaCnf(qtaCnf)
.setDatetimeRow(new Date()) .setDatetimeRow(UtilityLocalDate.getNowTime())
.setCausale(MtbColr.Causale.RETTIFICA) .setCausale(MtbColr.Causale.RETTIFICA)
.setPesoNettoKg(null) .setPesoNettoKg(null)
.setPesoLordoKg(null); .setPesoLordoKg(null);
@@ -1250,6 +1295,14 @@ public class WMSGenericService {
mtbColtOrphan.setOperation(OperationType.INSERT); mtbColtOrphan.setOperation(OperationType.INSERT);
mtbColtOrphan.getMtbColr().add(mtbColrOrphan); mtbColtOrphan.getMtbColr().add(mtbColrOrphan);
if (dtbDoctInv != null)
mtbColtOrphan
.setDataDoc(dtbDoctInv.getDataDoc())
.setNumDoc(dtbDoctInv.getNumDoc())
.setSerDoc(dtbDoctInv.getSerDoc())
.setCodAnag(dtbDoctInv.getCodAnag())
.setCodDtip(dtbDoctInv.getCodDtip());
entityProcessor.processEntity(mtbColtOrphan, true, multiDBTransactionManager); entityProcessor.processEntity(mtbColtOrphan, true, multiDBTransactionManager);
@@ -1257,8 +1310,7 @@ public class WMSGenericService {
.setNumCollo(sourceMtbColr.getNumCollo()) .setNumCollo(sourceMtbColr.getNumCollo())
.setGestione(sourceMtbColr.getGestione()) .setGestione(sourceMtbColr.getGestione())
.setSerCollo(sourceMtbColr.getSerCollo()) .setSerCollo(sourceMtbColr.getSerCollo())
.setDataCollo(sourceMtbColr.getDataCollo()) .setDataCollo(sourceMtbColr.getDataCollo());
.setMtbColr(new ArrayList<MtbColr>());
mtbColrToSave = ((MtbColr) sourceMtbColr.clone()) mtbColrToSave = ((MtbColr) sourceMtbColr.clone())
.setNumCollo(null) .setNumCollo(null)
@@ -1275,7 +1327,7 @@ public class WMSGenericService {
.setCausale(MtbColr.Causale.RETTIFICA) .setCausale(MtbColr.Causale.RETTIFICA)
.setPesoNettoKg(null) .setPesoNettoKg(null)
.setPesoLordoKg(null) .setPesoLordoKg(null)
.setDatetimeRow(new Date()); .setDatetimeRow(UtilityLocalDate.getNowTime());
sourceMtbColt.setOperation(OperationType.UPDATE); sourceMtbColt.setOperation(OperationType.UPDATE);
mtbColrToSave.setOperation(OperationType.INSERT); mtbColrToSave.setOperation(OperationType.INSERT);
@@ -1286,17 +1338,12 @@ public class WMSGenericService {
entityProcessor.processEntity(sourceMtbColt, true, multiDBTransactionManager); entityProcessor.processEntity(sourceMtbColt, true, multiDBTransactionManager);
} catch (Exception ex) { if (returnRettifica) {
multiDBTransactionManager.rollbackAll(); mtbColrToSave = mtbColrOrphan;
throw ex; }
} } else if (isNegativeUpdate) {
if (returnRettifica) { //Creo una UL L- orfana che aggancerà il collo attuale
mtbColrToSave = mtbColrOrphan;
}
} else if (isNegativeUpdate) {
//Creo una UL L- orfana che aggancerà il collo attuale
try {
mtbColrOrphan = ((MtbColr) sourceMtbColr.clone()) mtbColrOrphan = ((MtbColr) sourceMtbColr.clone())
.setNumCollo(null) .setNumCollo(null)
@@ -1313,7 +1360,7 @@ public class WMSGenericService {
.setNumColloRif(sourceMtbColr.getNumCollo()) .setNumColloRif(sourceMtbColr.getNumCollo())
.setPesoNettoKg(null) .setPesoNettoKg(null)
.setPesoLordoKg(null) .setPesoLordoKg(null)
.setDatetimeRow(new Date()); .setDatetimeRow(UtilityLocalDate.getNowTime());
mtbColrOrphan.setOperation(OperationType.INSERT); mtbColrOrphan.setOperation(OperationType.INSERT);
@@ -1325,6 +1372,14 @@ public class WMSGenericService {
mtbColtOrphan.setOperation(OperationType.INSERT); mtbColtOrphan.setOperation(OperationType.INSERT);
mtbColtOrphan.getMtbColr().add(mtbColrOrphan); mtbColtOrphan.getMtbColr().add(mtbColrOrphan);
if (dtbDoctInv != null)
mtbColtOrphan
.setDataDoc(dtbDoctInv.getDataDoc())
.setNumDoc(dtbDoctInv.getNumDoc())
.setSerDoc(dtbDoctInv.getSerDoc())
.setCodAnag(dtbDoctInv.getCodAnag())
.setCodDtip(dtbDoctInv.getCodDtip());
entityProcessor.processEntity(mtbColtOrphan, true, multiDBTransactionManager); entityProcessor.processEntity(mtbColtOrphan, true, multiDBTransactionManager);
mtbColrToSave = ((MtbColr) sourceMtbColr.clone()) mtbColrToSave = ((MtbColr) sourceMtbColr.clone())
@@ -1334,54 +1389,57 @@ public class WMSGenericService {
.setPesoNettoKg(null) .setPesoNettoKg(null)
.setPesoLordoKg(null); .setPesoLordoKg(null);
} catch (Exception ex) { if (returnRettifica) {
multiDBTransactionManager.rollbackAll(); mtbColrToSave = mtbColrOrphan;
throw ex; }
} } else {
if (returnRettifica) { //Le quantita precenti e quella attuale sono uguali
mtbColrToSave = mtbColrOrphan;
} }
} else { } else {
//Le quantita precenti e quella attuale sono uguali MtbColt mtbColt = new MtbColt()
.setNumCollo(sourceMtbColr.getNumCollo())
.setDataCollo(sourceMtbColr.getDataCollo())
.setSerCollo(sourceMtbColr.getSerCollo())
.setGestione(sourceMtbColr.getGestione())
.setMtbColr(new ArrayList<>());
mtbColt.setOperation(OperationType.NO_OP);
mtbColrToSave = (MtbColr) sourceMtbColr.clone();
mtbColrToSave
.setRiga(null)
.setNumCnf(differenceNumCnf)
.setQtaCnf(qtaCnf)
.setQtaCol(differenceQtaCol)
.setCausale(MtbColr.Causale.RETTIFICA)
.setDatetimeRow(UtilityLocalDate.getNowTime())
.setPesoNettoKg(null)
.setPesoLordoKg(null)
.setOperation(OperationType.INSERT);
mtbColt.getMtbColr().add(mtbColrToSave);
entityProcessor.processEntity(mtbColt, true, multiDBTransactionManager);
mtbColrToSave = ((MtbColr) sourceMtbColr.clone())
.setQtaCol(newQtaCol)
.setNumCnf(newNumCnf)
.setQtaCnf(UtilityBigDecimal.divide(newQtaCol, newNumCnf))
.setPesoNettoKg(null)
.setPesoLordoKg(null);
} }
} else {
MtbColt mtbColt = new MtbColt()
.setNumCollo(sourceMtbColr.getNumCollo())
.setDataCollo(sourceMtbColr.getDataCollo())
.setSerCollo(sourceMtbColr.getSerCollo())
.setGestione(sourceMtbColr.getGestione())
.setMtbColr(new ArrayList<>());
mtbColt.setOperation(OperationType.NO_OP);
mtbColrToSave = (MtbColr) sourceMtbColr.clone(); if (mtbColrToSave != null) {
mtbColrToSave mtbColrToSave.setOperation(OperationType.SELECT_OBJECT);
.setRiga(null) mtbColrToSave.setOnlyPkMaster(false);
.setNumCnf(differenceNumCnf) mtbColrToSave.setCausale(null);
.setQtaCnf(qtaCnf) }
.setQtaCol(differenceQtaCol)
.setCausale(MtbColr.Causale.RETTIFICA)
.setDatetimeRow(new Date())
.setPesoNettoKg(null)
.setPesoLordoKg(null)
.setOperation(OperationType.INSERT);
mtbColt.getMtbColr().add(mtbColrToSave);
entityProcessor.processEntity(mtbColt, true, multiDBTransactionManager); } catch (Exception ex) {
multiDBTransactionManager.rollbackAll();
mtbColrToSave = ((MtbColr) sourceMtbColr.clone()) throw ex;
.setQtaCol(newQtaCol)
.setNumCnf(newNumCnf)
.setQtaCnf(UtilityBigDecimal.divide(newQtaCol, newNumCnf))
.setPesoNettoKg(null)
.setPesoLordoKg(null);
} }
if (mtbColrToSave != null) {
mtbColrToSave.setOperation(OperationType.SELECT_OBJECT);
mtbColrToSave.setOnlyPkMaster(false);
mtbColrToSave.setCausale(null);
}
return mtbColrToSave; return mtbColrToSave;
} }
@@ -1424,7 +1482,6 @@ public class WMSGenericService {
} }
Date datetimeRow = new Date();
for (ScaricoMateriaPrimaDTO scaricoMateriaPrimaDTO : scaricoMateriaPrimaDTOList) { for (ScaricoMateriaPrimaDTO scaricoMateriaPrimaDTO : scaricoMateriaPrimaDTOList) {
List<MtbColt> mtbColtsToInsert = new ArrayList<>(); List<MtbColt> mtbColtsToInsert = new ArrayList<>();
@@ -1552,7 +1609,7 @@ public class WMSGenericService {
.setDataColloRif(UtilityLocalDate.localDateToDate(giacInPosizioneItem.getDataCollo())) .setDataColloRif(UtilityLocalDate.localDateToDate(giacInPosizioneItem.getDataCollo()))
.setSerColloRif(giacInPosizioneItem.getSerCollo()) .setSerColloRif(giacInPosizioneItem.getSerCollo())
.setGestioneRif(giacInPosizioneItem.getGestione()) .setGestioneRif(giacInPosizioneItem.getGestione())
.setDatetimeRow(datetimeRow); .setDatetimeRow(UtilityLocalDate.getNowTime());
mtbColr.setOperation(OperationType.INSERT); mtbColr.setOperation(OperationType.INSERT);
mtbColtToInsert.getMtbColr().add(mtbColr); mtbColtToInsert.getMtbColr().add(mtbColr);
@@ -1577,7 +1634,6 @@ public class WMSGenericService {
private List<AnomalieDTO> scaricoMateriaPrimadaOrdine(String codMdep, String codJfas, boolean useRapportoMatPrima, List<ScaricoMateriaPrimaDaOrdineDTO> listScarichiOrdine) throws Exception { private List<AnomalieDTO> scaricoMateriaPrimadaOrdine(String codMdep, String codJfas, boolean useRapportoMatPrima, List<ScaricoMateriaPrimaDaOrdineDTO> listScarichiOrdine) throws Exception {
final List<AnomalieDTO> anomalieList = new ArrayList<>(); final List<AnomalieDTO> anomalieList = new ArrayList<>();
List<MtbColt> mtbColtsToInsert = new ArrayList<>(); List<MtbColt> mtbColtsToInsert = new ArrayList<>();
Date datetimeRow = new Date();
for (ScaricoMateriaPrimaDaOrdineDTO scaricoDaOrdine : listScarichiOrdine) { for (ScaricoMateriaPrimaDaOrdineDTO scaricoDaOrdine : listScarichiOrdine) {
String codJfasScarico = codJfas != null ? codJfas : scaricoDaOrdine.getCodJfas(); String codJfasScarico = codJfas != null ? codJfas : scaricoDaOrdine.getCodJfas();
@@ -1705,7 +1761,7 @@ public class WMSGenericService {
.setDataColloRif(UtilityLocalDate.localDateToDate(giacenza.getDataCollo())) .setDataColloRif(UtilityLocalDate.localDateToDate(giacenza.getDataCollo()))
.setSerColloRif(giacenza.getSerCollo()) .setSerColloRif(giacenza.getSerCollo())
.setGestioneRif(giacenza.getGestione()) .setGestioneRif(giacenza.getGestione())
.setDatetimeRow(datetimeRow); .setDatetimeRow(UtilityLocalDate.getNowTime());
mtbColr.setOperation(OperationType.INSERT); mtbColr.setOperation(OperationType.INSERT);
mtbColt.getMtbColr().add(mtbColr); mtbColt.getMtbColr().add(mtbColr);
@@ -2421,7 +2477,7 @@ public class WMSGenericService {
.setGestioneRif(inputMtbColr.getGestione()) .setGestioneRif(inputMtbColr.getGestione())
.setDataColloRif(UtilityLocalDate.localDateToDate(inputMtbColr.getDataCollo())) .setDataColloRif(UtilityLocalDate.localDateToDate(inputMtbColr.getDataCollo()))
.setSerColloRif(inputMtbColr.getSerCollo()) .setSerColloRif(inputMtbColr.getSerCollo())
.setDatetimeRow(new Date()) .setDatetimeRow(UtilityLocalDate.getNowTime())
.setNumCollo(null) .setNumCollo(null)
.setGestione(null) .setGestione(null)
.setDataCollo(null) .setDataCollo(null)
@@ -2742,8 +2798,6 @@ public class WMSGenericService {
if (UtilityBigDecimal.equalsOrLowerThan(qtaToTake, BigDecimal.ZERO)) continue; if (UtilityBigDecimal.equalsOrLowerThan(qtaToTake, BigDecimal.ZERO)) continue;
Date dateTimeRow = UtilityLocalDate.localDateToDate(maxDataCollo);
MtbColr mtbColr = new MtbColr() MtbColr mtbColr = new MtbColr()
.setCodMart(giacenza.getCodMart()) .setCodMart(giacenza.getCodMart())
.setCodJcom(giacenza.getCodJcom()) .setCodJcom(giacenza.getCodJcom())
@@ -2756,7 +2810,7 @@ public class WMSGenericService {
.setDataColloRif(UtilityLocalDate.localDateToDate(giacenza.getDataCollo())) .setDataColloRif(UtilityLocalDate.localDateToDate(giacenza.getDataCollo()))
.setSerColloRif(giacenza.getSerCollo()) .setSerColloRif(giacenza.getSerCollo())
.setGestioneRif(giacenza.getGestione()) .setGestioneRif(giacenza.getGestione())
.setDatetimeRow(dateTimeRow); .setDatetimeRow(UtilityLocalDate.localDateTimeFromLocalDate(maxDataCollo));
mtbColr.setOperation(OperationType.INSERT); mtbColr.setOperation(OperationType.INSERT);
mtbColt.getMtbColr().add(mtbColr); mtbColt.getMtbColr().add(mtbColr);

View File

@@ -164,7 +164,7 @@ public class WMSMagazzinoBufferService {
int totalNumCnf = magazzinoBufferVersamentoMaterialeRequestDTO.getNumCnfDaScaricare().intValue(); int totalNumCnf = magazzinoBufferVersamentoMaterialeRequestDTO.getNumCnfDaScaricare().intValue();
LocalDateTime startDateTime = UtilityLocalDate.localDateTimeFromDate(udsMtbColr.getDatetimeRow()); LocalDateTime startDateTime = udsMtbColr.getDatetimeRow();
LocalDateTime endDateTime = UtilityLocalDate.isNull(magazzinoBufferVersamentoMaterialeRequestDTO.getOraFineVersamento(),UtilityLocalDate.getNowTime()); LocalDateTime endDateTime = UtilityLocalDate.isNull(magazzinoBufferVersamentoMaterialeRequestDTO.getOraFineVersamento(),UtilityLocalDate.getNowTime());
long totalSeconds = ChronoUnit.SECONDS.between(startDateTime, endDateTime); long totalSeconds = ChronoUnit.SECONDS.between(startDateTime, endDateTime);
@@ -187,11 +187,11 @@ public class WMSMagazzinoBufferService {
for (int i = 0; i < totalNumCnf - 1; i++) { for (int i = 0; i < totalNumCnf - 1; i++) {
final MtbColr clone = (MtbColr) udsMtbColr.clone(); final MtbColr clone = (MtbColr) udsMtbColr.clone();
LocalDateTime dateTimeRow = UtilityLocalDate.localDateTimeFromDate(clone.getDatetimeRow()); LocalDateTime dateTimeRow = clone.getDatetimeRow();
dateTimeRow = dateTimeRow.plusSeconds((i + 1) * secondsPerSigleRow); dateTimeRow = dateTimeRow.plusSeconds((i + 1) * secondsPerSigleRow);
clone.setRiga(null) clone.setRiga(null)
.setDatetimeRow(UtilityLocalDate.localDateTimeToDate(dateTimeRow, null)) .setDatetimeRow(dateTimeRow)
.setOperation(OperationType.INSERT); .setOperation(OperationType.INSERT);
mtbColrsToSave.add(clone); mtbColrsToSave.add(clone);

View File

@@ -300,7 +300,7 @@ public class WMSLavorazioneService {
.setDataOrd(UtilityLocalDate.localDateFromDate(insertUDSRowRequestDTO.getDataOrd())) .setDataOrd(UtilityLocalDate.localDateFromDate(insertUDSRowRequestDTO.getDataOrd()))
.setNumOrd(insertUDSRowRequestDTO.getNumOrd()) .setNumOrd(insertUDSRowRequestDTO.getNumOrd())
.setRigaOrd(insertUDSRowRequestDTO.getRigaOrd()) .setRigaOrd(insertUDSRowRequestDTO.getRigaOrd())
.setDatetimeRow(new Date()) .setDatetimeRow(UtilityLocalDate.getNowTime())
.setCodJcom(insertUDSRowRequestDTO.getCodJcom()) .setCodJcom(insertUDSRowRequestDTO.getCodJcom())
.setMtbColrInfoProd(mtbColrInfoProd); .setMtbColrInfoProd(mtbColrInfoProd);
targetMtbColr.setOperation(OperationType.INSERT); targetMtbColr.setOperation(OperationType.INSERT);

View File

@@ -1,6 +1,5 @@
package it.integry.ems.retail.wms.lavorazione.service; package it.integry.ems.retail.wms.lavorazione.service;
import core.utility.UtilityDate;
import it.integry.ems.product.importaz.service.ProductServices; import it.integry.ems.product.importaz.service.ProductServices;
import it.integry.ems.retail.wms.exceptions.InvalidArticoloException; import it.integry.ems.retail.wms.exceptions.InvalidArticoloException;
import it.integry.ems.retail.wms.lavorazione.dto.RecuperaMaterialiRequestDTO; import it.integry.ems.retail.wms.lavorazione.dto.RecuperaMaterialiRequestDTO;
@@ -105,7 +104,7 @@ public class WMSMaterialiService {
.setQtaCnf(inputQtaCnf) .setQtaCnf(inputQtaCnf)
.setNumCnf(numCnfToSave) .setNumCnf(numCnfToSave)
.setDescrizione(UtilityString.isNull(mtbAart.getDescrizioneEstesa(), mtbAart.getDescrizione())) .setDescrizione(UtilityString.isNull(mtbAart.getDescrizioneEstesa(), mtbAart.getDescrizione()))
.setDatetimeRow(UtilityDate.getDateInstance()) .setDatetimeRow(UtilityLocalDate.getNowTime())
.setNumColloRif(request.getNumColloRif()) .setNumColloRif(request.getNumColloRif())
.setDataColloRif(UtilityLocalDate.localDateToDate(request.getDataColloRif())) .setDataColloRif(UtilityLocalDate.localDateToDate(request.getDataColloRif()))
.setGestioneRif(request.getGestioneRif()) .setGestioneRif(request.getGestioneRif())
@@ -152,7 +151,7 @@ public class WMSMaterialiService {
.setQtaCnf(inputQtaCnf) .setQtaCnf(inputQtaCnf)
.setNumCnf(numCnf) .setNumCnf(numCnf)
.setDescrizione(UtilityString.isNull(mtbAart.getDescrizioneEstesa(), mtbAart.getDescrizione())) .setDescrizione(UtilityString.isNull(mtbAart.getDescrizioneEstesa(), mtbAart.getDescrizione()))
.setDatetimeRow(UtilityDate.getDateInstance()) .setDatetimeRow(UtilityLocalDate.getNowTime())
.setNumColloRif(request.getNumColloRif()) .setNumColloRif(request.getNumColloRif())
.setDataColloRif(UtilityLocalDate.localDateToDate(request.getDataColloRif())) .setDataColloRif(UtilityLocalDate.localDateToDate(request.getDataColloRif()))
.setGestioneRif(request.getGestioneRif()) .setGestioneRif(request.getGestioneRif())
@@ -172,7 +171,7 @@ public class WMSMaterialiService {
.setQtaCnf(inputQtaCnf) .setQtaCnf(inputQtaCnf)
.setNumCnf(numCnfToSave) .setNumCnf(numCnfToSave)
.setDescrizione(UtilityString.isNull(mtbAart.getDescrizioneEstesa(), mtbAart.getDescrizione())) .setDescrizione(UtilityString.isNull(mtbAart.getDescrizioneEstesa(), mtbAart.getDescrizione()))
.setDatetimeRow(UtilityDate.getDateInstance()) .setDatetimeRow(UtilityLocalDate.getNowTime())
.setNumColloRif(request.getNumColloRif()) .setNumColloRif(request.getNumColloRif())
.setDataColloRif(UtilityLocalDate.localDateToDate(request.getDataColloRif())) .setDataColloRif(UtilityLocalDate.localDateToDate(request.getDataColloRif()))
.setGestioneRif(request.getGestioneRif()) .setGestioneRif(request.getGestioneRif())
@@ -228,7 +227,7 @@ public class WMSMaterialiService {
.setNumCnf(inputNumCnf) .setNumCnf(inputNumCnf)
.setQtaCnf(inputQtaCnf) .setQtaCnf(inputQtaCnf)
.setDescrizione(UtilityString.isNull(mtbAart.getDescrizioneEstesa(), mtbAart.getDescrizione())) .setDescrizione(UtilityString.isNull(mtbAart.getDescrizioneEstesa(), mtbAart.getDescrizione()))
.setDatetimeRow(UtilityDate.getDateInstance()) .setDatetimeRow(UtilityLocalDate.getNowTime())
.setNumColloRif(request.getNumColloRif()) .setNumColloRif(request.getNumColloRif())
.setDataColloRif(UtilityLocalDate.localDateToDate(request.getDataColloRif())) .setDataColloRif(UtilityLocalDate.localDateToDate(request.getDataColloRif()))
.setGestioneRif(request.getGestioneRif()) .setGestioneRif(request.getGestioneRif())

View File

@@ -310,7 +310,7 @@ public class WMSSpedizioneService {
.setNumCnf(insertUDSRowRequestDTO.getNumCnf()) .setNumCnf(insertUDSRowRequestDTO.getNumCnf())
.setDescrizione(mtbAart.getDescrizioneEstesa()) .setDescrizione(mtbAart.getDescrizioneEstesa())
.setUtente(userSession.getFullname()) .setUtente(userSession.getFullname())
.setDatetimeRow(new Date()); .setDatetimeRow(UtilityLocalDate.getNowTime());
targetMtbColr.setOperation(OperationType.INSERT); targetMtbColr.setOperation(OperationType.INSERT);
targetMtbColt.getMtbColr().add(targetMtbColr); targetMtbColt.getMtbColr().add(targetMtbColr);