Fix su gestione P in caso di creazione UDC in accettazione ordini produzione
This commit is contained in:
parent
ebc0d22e9f
commit
bea30a5400
@ -13,6 +13,7 @@ import javax.inject.Singleton;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.model.JtbComt;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityQuery;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
|
||||
@Singleton
|
||||
public class CommessaRESTConsumer extends _BaseRESTConsumer {
|
||||
@ -26,6 +27,8 @@ public class CommessaRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
public void getJtbComts(List<String> itemsToFind, RunnableArgs<List<JtbComt>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
var whereCondMap = Stream.of(itemsToFind)
|
||||
.withoutNulls()
|
||||
.filter(x -> !UtilityString.isNullOrEmpty(x))
|
||||
.map(x -> {
|
||||
HashMap<String, Object> vars = new HashMap<>();
|
||||
vars.put("cod_jcom", x);
|
||||
@ -33,6 +36,11 @@ public class CommessaRESTConsumer extends _BaseRESTConsumer {
|
||||
})
|
||||
.toList();
|
||||
|
||||
if(whereCondMap.isEmpty()) {
|
||||
onComplete.run(new ArrayList<>());
|
||||
return;
|
||||
}
|
||||
|
||||
var whereCond = " WHERE " + UtilityQuery.concatFieldListInWhereCond(whereCondMap);
|
||||
|
||||
Type typeOfObjectsList = new TypeToken<ArrayList<JtbComt>>() {}.getType();
|
||||
|
||||
@ -371,11 +371,23 @@ public class AccettazioneOrdiniPickingViewModel {
|
||||
this.sendOnInfoAggiuntiveRequest((additionalNotes, tCol) -> {
|
||||
|
||||
final List<CreateUDCRequestOrderDTO> orders = Stream.of(this.mOrders)
|
||||
.map(x -> new CreateUDCRequestOrderDTO()
|
||||
.setDataCons(x.getDataConsD() != null ? UtilityDate.toLocalDate(x.getDataConsD()) : null)
|
||||
.setDataOrd(UtilityDate.toLocalDate(x.getDataD()))
|
||||
.setGestione(x.getGestioneEnum() == GestioneEnum.PRODUZIONE ? GestioneEnum.LAVORAZIONE.getText() : x.getGestione())
|
||||
.setNumOrd(x.getNumero()))
|
||||
.map(x -> {
|
||||
final CreateUDCRequestOrderDTO createUDCRequestOrderDTO = new CreateUDCRequestOrderDTO()
|
||||
.setDataCons(x.getDataConsD() != null ? UtilityDate.toLocalDate(x.getDataConsD()) : null)
|
||||
.setDataOrd(UtilityDate.toLocalDate(x.getDataD()))
|
||||
.setNumOrd(x.getNumero());
|
||||
|
||||
if(x.getGestioneEnum() == GestioneEnum.PRODUZIONE) {
|
||||
if(x.isOrdTrasf())
|
||||
createUDCRequestOrderDTO.setGestione(GestioneEnum.ACQUISTO.getText());
|
||||
else
|
||||
createUDCRequestOrderDTO.setGestione(GestioneEnum.LAVORAZIONE.getText());
|
||||
} else {
|
||||
createUDCRequestOrderDTO.setGestione(x.getGestione());
|
||||
}
|
||||
|
||||
return createUDCRequestOrderDTO;
|
||||
})
|
||||
.toList();
|
||||
|
||||
final CreateUDCRequestDTO createUDCRequestDTO = new CreateUDCRequestDTO()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user