Fix per fabbisogno linee

This commit is contained in:
Marco Elefante 2024-01-23 16:10:54 +01:00
parent 0ae1ac87d5
commit 707c852377
2 changed files with 15 additions and 12 deletions

View File

@ -70,17 +70,16 @@ public class ProdFabbisognoLineeProdViewModel {
this.sendOnLoadingStarted(); this.sendOnLoadingStarted();
this.mProdFabbisognoLineeProdRESTConsumer.loadFabbisogno(ordini, codMdep, jtbFasi -> { this.mProdFabbisognoLineeProdRESTConsumer.loadFabbisogno(ordini, codMdep, jtbFasi -> {
if (jtbFasi != null) { if (jtbFasi == null) jtbFasi = new ArrayList<>();
Stream.of(jtbFasi) Stream.of(jtbFasi)
.forEach(x -> { .forEach(x -> {
x.setDataInizio(dataInizio); x.setDataInizio(dataInizio);
x.setDataFine(dataFine); x.setDataFine(dataFine);
}); });
this.sendOnLoadingEnded(); this.sendOnLoadingEnded();
onComplete.run(jtbFasi); onComplete.run(jtbFasi);
} else {
this.mListener.onError(new NoOrdersScheduledException());
}
}, this::sendError); }, this::sendError);
} }

View File

@ -1269,6 +1269,9 @@ public class SpedizioneViewModel {
} }
public void createNewLU(Integer customNumCollo, String customSerCollo, Runnable onComplete) { public void createNewLU(Integer customNumCollo, String customSerCollo, Runnable onComplete) {
int causaleCollo = 0;
if (mDefaultGestioneOfUL == GestioneEnum.LAVORAZIONE && mDefaultSegnoCol == +1) causaleCollo = 1;
final List<CreateUDSRequestOrderDTO> orders = Stream.of(this.mTestateOrdini) final List<CreateUDSRequestOrderDTO> orders = Stream.of(this.mTestateOrdini)
.map(x -> new CreateUDSRequestOrderDTO() .map(x -> new CreateUDSRequestOrderDTO()
.setDataCons(x.getDataConsD() != null ? UtilityDate.toLocalDate(x.getDataConsD()) : null) .setDataCons(x.getDataConsD() != null ? UtilityDate.toLocalDate(x.getDataConsD()) : null)
@ -1282,6 +1285,7 @@ public class SpedizioneViewModel {
.setSegno(mDefaultSegnoCol) .setSegno(mDefaultSegnoCol)
.setNumCollo(customNumCollo) .setNumCollo(customNumCollo)
.setSerCollo(customSerCollo) .setSerCollo(customSerCollo)
.setCausaleCollo(causaleCollo)
.setOrders(orders); .setOrders(orders);
this.mColliScaricoRESTConsumer.createUDS(createUDSRequestDTO, createdUDS -> { this.mColliScaricoRESTConsumer.createUDS(createUDSRequestDTO, createdUDS -> {
@ -1517,7 +1521,7 @@ public class SpedizioneViewModel {
//.setPrintSSCC(shouldPrint) //.setPrintSSCC(shouldPrint)
.setOrderCodMdep(codMdep); .setOrderCodMdep(codMdep);
this.mColliSpedizioneRESTConsumer.closeUDS(closeUDSRequestDto, closeResponse -> { this.mColliScaricoRESTConsumer.closeUDS(closeUDSRequestDto, closeResponse -> {
onComplete.run(closeResponse.getGeneratedMtbColts()); onComplete.run(closeResponse.getGeneratedMtbColts());
}, this::sendError); }, this::sendError);