Fix date in recupero materiale

This commit is contained in:
Giuseppe Scorrano 2024-05-21 12:14:03 +02:00
parent e45a980ce3
commit 56e5603256
8 changed files with 33 additions and 22 deletions

View File

@ -1,6 +1,6 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="app" type="AndroidRunConfigurationType" factoryName="Android App">
<module name="WMS_Native.app.main" />
<module name="WMS.app.main" />
<option name="DEPLOY" value="true" />
<option name="DEPLOY_APK_FROM_BUNDLE" value="false" />
<option name="DEPLOY_AS_INSTANT" value="false" />

View File

@ -261,6 +261,11 @@ public class MtbColr extends EntityBase {
return this;
}
public MtbColr setDataColloRif(LocalDate dataColloRif) {
this.dataColloRif = UtilityDate.formatDate(dataColloRif, UtilityDate.COMMONS_DATE_FORMATS.DMY_TIME_SLASH);
return this;
}
public BigDecimal getQtaCnf() {
return qtaCnf;
}

View File

@ -10,6 +10,7 @@ import com.annimon.stream.Stream;
import org.jetbrains.annotations.Nullable;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@ -170,6 +171,11 @@ public class MtbColt extends EntityBase {
return this;
}
public MtbColt setDataCollo(LocalDate dataCollo) {
this.dataCollo = UtilityDate.formatDate(dataCollo, UtilityDate.COMMONS_DATE_FORMATS.DMY_TIME_SLASH);
return this;
}
public String getSerCollo() {
return serCollo;
}

View File

@ -90,7 +90,7 @@ public class LoginViewModel {
this.mSystemRESTConsumer.getAvailableCodMdeps(availableCodMdeps -> {
SettingsManager.iDB().setAvailableCodMdep(availableCodMdeps);
if (availableCodMdeps == null || availableCodMdeps.size() == 0) {
if (availableCodMdeps == null || availableCodMdeps.isEmpty()) {
this.sendError(new InvalidUserDepositException());
return;
}

View File

@ -3,13 +3,12 @@ package it.integry.integrywmsnative.gest.prod_recupero_materiale;
import androidx.databinding.ObservableArrayList;
import androidx.lifecycle.MutableLiveData;
import com.annimon.stream.Stream;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import javax.inject.Inject;
@ -93,14 +92,14 @@ public class ProdRecuperoMaterialeViewModel {
private HistoryVersamentoProdULDTO getHistoryElementFromMtbColt(MtbColt mtbColt) {
List<HistoryVersamentoProdULDTO> filteredItems = Stream.of(this.mUlList.getValue())
List<HistoryVersamentoProdULDTO> filteredItems = this.mUlList.getValue().stream()
.filter(x -> Objects.equals(x.getNumColloRif(), mtbColt.getNumCollo()) &&
x.getDataColloRif().equals(mtbColt.getDataColloS()) &&
x.getDataColloRif().equals(UtilityDate.toLocalDate(mtbColt.getDataColloD())) &&
x.getSerColloRif().equalsIgnoreCase(mtbColt.getSerCollo()) &&
x.getGestioneRif().equalsIgnoreCase(mtbColt.getGestione()))
.toList();
.collect(Collectors.toList());
if (filteredItems != null && filteredItems.size() > 0) {
if (!filteredItems.isEmpty()) {
return filteredItems.get(0);
}

View File

@ -2,6 +2,7 @@ package it.integry.integrywmsnative.gest.prod_recupero_materiale.dto;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.time.LocalDate;
import java.util.Date;
import java.util.List;
@ -11,7 +12,7 @@ import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
public class HistoryVersamentoProdULDTO {
private String gestione;
private String dataCollo;
private LocalDate dataCollo;
private String serCollo;
private Integer numCollo;
private String segno;
@ -28,7 +29,7 @@ public class HistoryVersamentoProdULDTO {
private String descrizioneArt;
private String untMis;
private String gestioneRif;
private String dataColloRif;
private LocalDate dataColloRif;
private String serColloRif;
private Integer numColloRif;
@ -50,11 +51,11 @@ public class HistoryVersamentoProdULDTO {
return this;
}
public String getDataCollo() {
public LocalDate getDataCollo() {
return dataCollo;
}
public HistoryVersamentoProdULDTO setDataCollo(String dataCollo) {
public HistoryVersamentoProdULDTO setDataCollo(LocalDate dataCollo) {
this.dataCollo = dataCollo;
return this;
}
@ -203,11 +204,11 @@ public class HistoryVersamentoProdULDTO {
return this;
}
public String getDataColloRif() {
public LocalDate getDataColloRif() {
return dataColloRif;
}
public HistoryVersamentoProdULDTO setDataColloRif(String dataColloRif) {
public HistoryVersamentoProdULDTO setDataColloRif(LocalDate dataColloRif) {
this.dataColloRif = dataColloRif;
return this;
}

View File

@ -1,16 +1,16 @@
package it.integry.integrywmsnative.gest.prod_recupero_materiale.dto;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.Date;
import it.integry.integrywmsnative.core.model.MtbAart;
import it.integry.integrywmsnative.core.utility.UtilityDate;
public class HistoryVersamentoProdULRestDTO {
private String gestione;
private String dataCollo;
private LocalDate dataCollo;
private String serCollo;
private Integer numCollo;
private String segno;
@ -27,7 +27,7 @@ public class HistoryVersamentoProdULRestDTO {
private String descrizioneArt;
private String untMis;
private String gestioneRif;
private String dataColloRif;
private LocalDate dataColloRif;
private String serColloRif;
private Integer numColloRif;
@ -55,11 +55,11 @@ public class HistoryVersamentoProdULRestDTO {
return this;
}
public String getDataCollo() {
public LocalDate getDataCollo() {
return dataCollo;
}
public HistoryVersamentoProdULRestDTO setDataCollo(String dataCollo) {
public HistoryVersamentoProdULRestDTO setDataCollo(LocalDate dataCollo) {
this.dataCollo = dataCollo;
return this;
}
@ -208,11 +208,11 @@ public class HistoryVersamentoProdULRestDTO {
return this;
}
public String getDataColloRif() {
public LocalDate getDataColloRif() {
return dataColloRif;
}
public HistoryVersamentoProdULRestDTO setDataColloRif(String dataColloRif) {
public HistoryVersamentoProdULRestDTO setDataColloRif(LocalDate dataColloRif) {
this.dataColloRif = dataColloRif;
return this;
}

View File

@ -264,7 +264,7 @@ public class ProdRecuperMaterialeRESTConsumer extends _BaseRESTConsumer {
});
if (newUlList.size() > 0) {
if (!newUlList.isEmpty()) {
List<String> codMarts = Stream.of(newUlList)
.map(HistoryVersamentoProdULDTO::getCodMart)
.withoutNulls()