Gestito parametro data collo in scarico da collo
This commit is contained in:
@@ -4,6 +4,7 @@ import it.integry.ems_model.entity.DtbOrdr;
|
||||
import it.integry.ems_model.entity.MtbColt;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
public class ScaricoMateriaPrimaDaColloDTO {
|
||||
|
||||
@@ -12,6 +13,7 @@ public class ScaricoMateriaPrimaDaColloDTO {
|
||||
private String codMdep;
|
||||
private MtbColt sourceUl;
|
||||
private BigDecimal quantity;
|
||||
private LocalDateTime dataVers;
|
||||
private DtbOrdr order;
|
||||
private boolean createNewUl = false;
|
||||
private Integer idLotto;
|
||||
@@ -43,6 +45,15 @@ public class ScaricoMateriaPrimaDaColloDTO {
|
||||
return this;
|
||||
}
|
||||
|
||||
public LocalDateTime getDataVers() {
|
||||
return dataVers;
|
||||
}
|
||||
|
||||
public ScaricoMateriaPrimaDaColloDTO setDataVers(LocalDateTime dataVers) {
|
||||
this.dataVers = dataVers;
|
||||
return this;
|
||||
}
|
||||
|
||||
public DtbOrdr getOrder() {
|
||||
return order;
|
||||
}
|
||||
|
||||
@@ -2861,27 +2861,32 @@ public class WMSGenericService {
|
||||
}
|
||||
}
|
||||
|
||||
LocalDate maxDataCollo = UtilityLocalDate.getNow();
|
||||
LocalDate dataCollo = UtilityLocalDate.getNow();
|
||||
|
||||
if (mtbColt == null || scarico.isCreateNewUl()) {
|
||||
String queryMaxDataCollo = "SELECT MAX(data_collo)" +
|
||||
" FROM mtb_colt" +
|
||||
" WHERE segno = 1 " +
|
||||
" AND data_ord = " + UtilityDB.valueToString(order.getDataOrd()) +
|
||||
" AND num_ord = " + UtilityDB.valueToString(order.getNumOrd()) +
|
||||
" AND gestione = " + UtilityDB.valueToString(order.getGestione());
|
||||
if (scarico.getDataVers() != null) {
|
||||
dataCollo = scarico.getDataVers().toLocalDate();
|
||||
} else {
|
||||
String queryMaxDataCollo = "SELECT MAX(data_collo)" +
|
||||
" FROM mtb_colt" +
|
||||
" WHERE segno = 1 " +
|
||||
" AND data_ord = " + UtilityDB.valueToString(order != null ? order.getDataOrd() : null) +
|
||||
" AND num_ord = " + UtilityDB.valueToString(order != null ? order.getNumOrd() : null) +
|
||||
" AND gestione = " + UtilityDB.valueToString(order != null ? order.getGestione() : null);
|
||||
|
||||
Date dateMaxDataCollo = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(multiDBTransactionManager.getPrimaryConnection(), queryMaxDataCollo);
|
||||
Date dateMaxDataCollo = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(multiDBTransactionManager.getPrimaryConnection(), queryMaxDataCollo);
|
||||
|
||||
if (dateMaxDataCollo != null) {
|
||||
maxDataCollo = UtilityLocalDate.localDateFromDate(dateMaxDataCollo);
|
||||
if (dateMaxDataCollo != null) {
|
||||
dataCollo = UtilityLocalDate.localDateFromDate(dateMaxDataCollo);
|
||||
}
|
||||
}
|
||||
|
||||
mtbColt = WMSUtility.createInternalMovement(codMdep)
|
||||
mtbColt = WMSUtility.createInternalMovement(codMdep, dataCollo)
|
||||
.setDataOrd(order != null ? UtilityLocalDate.localDateFromDate(order.getDataOrd()) : null)
|
||||
.setNumOrd(order != null ? order.getNumOrd() : null)
|
||||
.setCodJfas(order != null ? order.getCodJfas() : null)
|
||||
.setIdLotto(scarico.getIdLotto())
|
||||
.setDataVers(scarico.getDataVers())
|
||||
.setCodAnag(codAnag)
|
||||
.setSegno(-1);
|
||||
|
||||
@@ -2910,7 +2915,7 @@ public class WMSGenericService {
|
||||
.setDataColloRif(giacenza.getDataCollo())
|
||||
.setSerColloRif(giacenza.getSerCollo())
|
||||
.setGestioneRif(giacenza.getGestione())
|
||||
.setDatetimeRow(UtilityLocalDate.localDateTimeFromLocalDate(maxDataCollo))
|
||||
.setDatetimeRow(UtilityLocalDate.localDateTimeFromLocalDate(dataCollo))
|
||||
.setBarcodeUlOut(sourceBarcodeUl)
|
||||
.setCodMdepOut(giacenza.getCodMdep())
|
||||
.setPosizioneOut(giacenza.getPosizione());
|
||||
|
||||
Reference in New Issue
Block a user