Finish v1.36.01(394)
This commit is contained in:
commit
9db04fcd02
@ -10,8 +10,8 @@ apply plugin: 'com.google.gms.google-services'
|
|||||||
|
|
||||||
android {
|
android {
|
||||||
|
|
||||||
def appVersionCode = 393
|
def appVersionCode = 394
|
||||||
def appVersionName = '1.36.00'
|
def appVersionName = '1.36.01'
|
||||||
|
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
release {
|
release {
|
||||||
|
|||||||
@ -182,8 +182,11 @@ public class MainApplicationModule {
|
|||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
ColliMagazzinoRESTConsumer provideColliMagazzinoRESTConsumer(SystemRESTConsumer systemRESTConsumer, ArticoloRESTConsumer articoloRESTConsumer, EntityRESTConsumer entityRESTConsumer) {
|
ColliMagazzinoRESTConsumer provideColliMagazzinoRESTConsumer(SystemRESTConsumer systemRESTConsumer,
|
||||||
return new ColliMagazzinoRESTConsumer(systemRESTConsumer, articoloRESTConsumer, entityRESTConsumer);
|
ArticoloRESTConsumer articoloRESTConsumer,
|
||||||
|
EntityRESTConsumer entityRESTConsumer,
|
||||||
|
SettingsManager settingsManager) {
|
||||||
|
return new ColliMagazzinoRESTConsumer(systemRESTConsumer, articoloRESTConsumer, entityRESTConsumer, settingsManager);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@ -272,8 +275,8 @@ public class MainApplicationModule {
|
|||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
ColliLavorazioneRESTConsumer provideColliLavorazioneRESTConsumer() {
|
ColliLavorazioneRESTConsumer provideColliLavorazioneRESTConsumer(SettingsManager settingsManager) {
|
||||||
return new ColliLavorazioneRESTConsumer();
|
return new ColliLavorazioneRESTConsumer(settingsManager);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
|
|||||||
@ -1,10 +1,14 @@
|
|||||||
package it.integry.integrywmsnative.core.rest.consumers;
|
package it.integry.integrywmsnative.core.rest.consumers;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
||||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.interfaces.ColliCaricoRESTConsumerInterface;
|
import it.integry.integrywmsnative.core.rest.consumers.interfaces.ColliCaricoRESTConsumerInterface;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.interfaces.ColliScaricoRESTConsumerInterface;
|
import it.integry.integrywmsnative.core.rest.consumers.interfaces.ColliScaricoRESTConsumerInterface;
|
||||||
@ -18,6 +22,7 @@ import it.integry.integrywmsnative.core.rest.model.udc.EditUDCRowRequestDTO;
|
|||||||
import it.integry.integrywmsnative.core.rest.model.udc.EditUDCRowResponseDTO;
|
import it.integry.integrywmsnative.core.rest.model.udc.EditUDCRowResponseDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.uds.CloseUDSRequestDTO;
|
import it.integry.integrywmsnative.core.rest.model.uds.CloseUDSRequestDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.uds.CloseUDSResponseDTO;
|
import it.integry.integrywmsnative.core.rest.model.uds.CloseUDSResponseDTO;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.uds.CreateUDSFromArtRequestDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.uds.CreateUDSRequestDTO;
|
import it.integry.integrywmsnative.core.rest.model.uds.CreateUDSRequestDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.uds.CreateUDSResponseDTO;
|
import it.integry.integrywmsnative.core.rest.model.uds.CreateUDSResponseDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.uds.DeleteUDSRowRequestDTO;
|
import it.integry.integrywmsnative.core.rest.model.uds.DeleteUDSRowRequestDTO;
|
||||||
@ -27,6 +32,7 @@ import it.integry.integrywmsnative.core.rest.model.uds.InsertUDCRowRequestDTO;
|
|||||||
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDCRowResponseDTO;
|
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDCRowResponseDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDSRowRequestDTO;
|
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDSRowRequestDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDSRowResponseDTO;
|
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDSRowResponseDTO;
|
||||||
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.Callback;
|
import retrofit2.Callback;
|
||||||
import retrofit2.Response;
|
import retrofit2.Response;
|
||||||
@ -35,6 +41,12 @@ import retrofit2.Response;
|
|||||||
public class ColliLavorazioneRESTConsumer extends _BaseRESTConsumer implements ColliCaricoRESTConsumerInterface, ColliScaricoRESTConsumerInterface {
|
public class ColliLavorazioneRESTConsumer extends _BaseRESTConsumer implements ColliCaricoRESTConsumerInterface, ColliScaricoRESTConsumerInterface {
|
||||||
|
|
||||||
|
|
||||||
|
private final SettingsManager settingsManager;
|
||||||
|
|
||||||
|
public ColliLavorazioneRESTConsumer(SettingsManager settingsManager) {
|
||||||
|
this.settingsManager = settingsManager;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void createUDC(CreateUDCRequestDTO createUDCRequestDTO, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
public void createUDC(CreateUDCRequestDTO createUDCRequestDTO, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = RESTBuilder.getService(ColliLavorazioneRESTConsumerService.class);
|
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = RESTBuilder.getService(ColliLavorazioneRESTConsumerService.class);
|
||||||
@ -213,4 +225,43 @@ public class ColliLavorazioneRESTConsumer extends _BaseRESTConsumer implements C
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void createColloScaricoDaArticolo(MtbAart mtbAart,
|
||||||
|
String partitaMag,
|
||||||
|
MtbDepoPosizione posizione,
|
||||||
|
BigDecimal qta, BigDecimal qtaCnf, BigDecimal numCnf,
|
||||||
|
BigDecimal pesoNettoKg, BigDecimal pesoLordoKg,
|
||||||
|
Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
|
CreateUDSFromArtRequestDTO createUDSFromArtRequestDTO = new CreateUDSFromArtRequestDTO()
|
||||||
|
.setCodMart(mtbAart.getCodMart())
|
||||||
|
.setCodMdep(settingsManager.getSettings().getUserSession().getDepo().getCodMdep())
|
||||||
|
.setPartitaMag(partitaMag)
|
||||||
|
.setPosizione(posizione != null ? posizione.getPosizione() : null)
|
||||||
|
.setQta(qta)
|
||||||
|
.setQtaCnf(qtaCnf)
|
||||||
|
.setNumCnf(numCnf)
|
||||||
|
.setPesoLordoKg(pesoLordoKg)
|
||||||
|
.setPesoNettoKg(pesoNettoKg);
|
||||||
|
|
||||||
|
if (posizione != null && posizione.isFlagLineaProduzione()) {
|
||||||
|
createUDSFromArtRequestDTO
|
||||||
|
.setCodJfas(posizione.getPosizione());
|
||||||
|
}
|
||||||
|
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = RESTBuilder.getService(ColliLavorazioneRESTConsumerService.class);
|
||||||
|
|
||||||
|
colliLavorazioneRESTConsumerService.createUDSFromArt(createUDSFromArtRequestDTO)
|
||||||
|
.enqueue(new Callback<>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
|
||||||
|
analyzeAnswer(response, "lavorazione/createUDSFromArt", data -> onComplete.run(), onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
|
||||||
|
onFailed.run(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,6 +10,7 @@ import it.integry.integrywmsnative.core.rest.model.udc.EditUDCRowRequestDTO;
|
|||||||
import it.integry.integrywmsnative.core.rest.model.udc.EditUDCRowResponseDTO;
|
import it.integry.integrywmsnative.core.rest.model.udc.EditUDCRowResponseDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.uds.CloseUDSRequestDTO;
|
import it.integry.integrywmsnative.core.rest.model.uds.CloseUDSRequestDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.uds.CloseUDSResponseDTO;
|
import it.integry.integrywmsnative.core.rest.model.uds.CloseUDSResponseDTO;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.uds.CreateUDSFromArtRequestDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.uds.CreateUDSRequestDTO;
|
import it.integry.integrywmsnative.core.rest.model.uds.CreateUDSRequestDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.uds.CreateUDSResponseDTO;
|
import it.integry.integrywmsnative.core.rest.model.uds.CreateUDSResponseDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.uds.DeleteUDSRowRequestDTO;
|
import it.integry.integrywmsnative.core.rest.model.uds.DeleteUDSRowRequestDTO;
|
||||||
@ -55,4 +56,7 @@ public interface ColliLavorazioneRESTConsumerService {
|
|||||||
@POST("wms/lavorazione/deleteUDCRow")
|
@POST("wms/lavorazione/deleteUDCRow")
|
||||||
Call<ServiceRESTResponse<Void>> deleteUDCRow(@Body DeleteUDCRowRequestDTO deleteUDCRowRequestDTO);
|
Call<ServiceRESTResponse<Void>> deleteUDCRow(@Body DeleteUDCRowRequestDTO deleteUDCRowRequestDTO);
|
||||||
|
|
||||||
|
@POST("wms/lavorazione/createUDSFromArt")
|
||||||
|
Call<ServiceRESTResponse<Void>> createUDSFromArt(@Body CreateUDSFromArtRequestDTO createUDSFromArtRequestDTO);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -50,13 +50,16 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
private final SystemRESTConsumer mSystemRESTConsumer;
|
private final SystemRESTConsumer mSystemRESTConsumer;
|
||||||
private final ArticoloRESTConsumer mArticoloRESTConsumer;
|
private final ArticoloRESTConsumer mArticoloRESTConsumer;
|
||||||
private final EntityRESTConsumer mEntityRESTConsumer;
|
private final EntityRESTConsumer mEntityRESTConsumer;
|
||||||
|
private final SettingsManager mSettingsManager;
|
||||||
|
|
||||||
public ColliMagazzinoRESTConsumer(SystemRESTConsumer systemRESTConsumer,
|
public ColliMagazzinoRESTConsumer(SystemRESTConsumer systemRESTConsumer,
|
||||||
ArticoloRESTConsumer articoloRESTConsumer,
|
ArticoloRESTConsumer articoloRESTConsumer,
|
||||||
EntityRESTConsumer entityRESTConsumer) {
|
EntityRESTConsumer entityRESTConsumer,
|
||||||
|
SettingsManager settingsManager) {
|
||||||
this.mSystemRESTConsumer = systemRESTConsumer;
|
this.mSystemRESTConsumer = systemRESTConsumer;
|
||||||
this.mArticoloRESTConsumer = articoloRESTConsumer;
|
this.mArticoloRESTConsumer = articoloRESTConsumer;
|
||||||
this.mEntityRESTConsumer = entityRESTConsumer;
|
this.mEntityRESTConsumer = entityRESTConsumer;
|
||||||
|
this.mSettingsManager = settingsManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void saveCollo(MtbColt mtbColtToSave, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
public void saveCollo(MtbColt mtbColtToSave, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
@ -171,6 +174,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
saveCollo(newMtbColt, onComplete, onFailed);
|
saveCollo(newMtbColt, onComplete, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void createColliScaricoDaOrdineLavorazione(MtbColt sourceMtbColt, MtbColr sourceMtbColr, MtbDepoPosizione posizione, List<OrdineLavorazioneDTO> ordini, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
public void createColliScaricoDaOrdineLavorazione(MtbColt sourceMtbColt, MtbColr sourceMtbColr, MtbDepoPosizione posizione, List<OrdineLavorazioneDTO> ordini, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
MtbColt newMtbColt = new MtbColt()
|
MtbColt newMtbColt = new MtbColt()
|
||||||
@ -302,6 +306,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
public void fillMtbAartsOfMtbColts(List<MtbColt> mtbColts, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
public void fillMtbAartsOfMtbColts(List<MtbColt> mtbColts, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
fillMtbAartsOfMtbColtsStatic(mtbColts, onComplete, onFailed);
|
fillMtbAartsOfMtbColtsStatic(mtbColts, onComplete, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void fillMtbAartsOfMtbColtsStatic(List<MtbColt> mtbColts, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
public static void fillMtbAartsOfMtbColtsStatic(List<MtbColt> mtbColts, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
List<String> codMarts = new ArrayList<>();
|
List<String> codMarts = new ArrayList<>();
|
||||||
|
|
||||||
@ -651,7 +656,6 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void canULBeDeleted(MtbColt mtbColt, RunnableArgs<Boolean> onComplete, RunnableArgs<Exception> onFailed) {
|
public void canULBeDeleted(MtbColt mtbColt, RunnableArgs<Boolean> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
CanULBeDeletedRequestDTO canULBeDeletedRequestDTO = new CanULBeDeletedRequestDTO()
|
CanULBeDeletedRequestDTO canULBeDeletedRequestDTO = new CanULBeDeletedRequestDTO()
|
||||||
.setMtbColt(mtbColt);
|
.setMtbColt(mtbColt);
|
||||||
@ -710,5 +714,4 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,108 @@
|
|||||||
|
package it.integry.integrywmsnative.core.rest.model.uds;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
public class CreateUDSFromArtRequestDTO {
|
||||||
|
|
||||||
|
private String codMart;
|
||||||
|
private String partitaMag;
|
||||||
|
private String codMdep;
|
||||||
|
private String posizione;
|
||||||
|
private String codJfas;
|
||||||
|
private BigDecimal qta;
|
||||||
|
private BigDecimal qtaCnf;
|
||||||
|
private BigDecimal numCnf;
|
||||||
|
private BigDecimal pesoNettoKg;
|
||||||
|
private BigDecimal pesoLordoKg;
|
||||||
|
|
||||||
|
|
||||||
|
public String getCodMart() {
|
||||||
|
return codMart;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CreateUDSFromArtRequestDTO setCodMart(String codMart) {
|
||||||
|
this.codMart = codMart;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPartitaMag() {
|
||||||
|
return partitaMag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CreateUDSFromArtRequestDTO setPartitaMag(String partitaMag) {
|
||||||
|
this.partitaMag = partitaMag;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodMdep() {
|
||||||
|
return codMdep;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CreateUDSFromArtRequestDTO setCodMdep(String codMdep) {
|
||||||
|
this.codMdep = codMdep;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPosizione() {
|
||||||
|
return posizione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CreateUDSFromArtRequestDTO setPosizione(String posizione) {
|
||||||
|
this.posizione = posizione;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodJfas() {
|
||||||
|
return codJfas;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CreateUDSFromArtRequestDTO setCodJfas(String codJfas) {
|
||||||
|
this.codJfas = codJfas;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getQta() {
|
||||||
|
return qta;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CreateUDSFromArtRequestDTO setQta(BigDecimal qta) {
|
||||||
|
this.qta = qta;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getQtaCnf() {
|
||||||
|
return qtaCnf;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CreateUDSFromArtRequestDTO setQtaCnf(BigDecimal qtaCnf) {
|
||||||
|
this.qtaCnf = qtaCnf;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getNumCnf() {
|
||||||
|
return numCnf;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CreateUDSFromArtRequestDTO setNumCnf(BigDecimal numCnf) {
|
||||||
|
this.numCnf = numCnf;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getPesoNettoKg() {
|
||||||
|
return pesoNettoKg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CreateUDSFromArtRequestDTO setPesoNettoKg(BigDecimal pesoNettoKg) {
|
||||||
|
this.pesoNettoKg = pesoNettoKg;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getPesoLordoKg() {
|
||||||
|
return pesoLordoKg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CreateUDSFromArtRequestDTO setPesoLordoKg(BigDecimal pesoLordoKg) {
|
||||||
|
this.pesoLordoKg = pesoLordoKg;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -165,6 +165,8 @@ public class MainAccettazioneBollaElencoFragment extends BaseFragment implements
|
|||||||
//TODO: Filter here
|
//TODO: Filter here
|
||||||
|
|
||||||
this.mBolleInevaseMutableData.clear();
|
this.mBolleInevaseMutableData.clear();
|
||||||
|
|
||||||
|
if(tmpList != null)
|
||||||
this.mBolleInevaseMutableData.addAll(convertDataModelToListModel(tmpList));
|
this.mBolleInevaseMutableData.addAll(convertDataModelToListModel(tmpList));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -184,12 +186,13 @@ public class MainAccettazioneBollaElencoFragment extends BaseFragment implements
|
|||||||
|
|
||||||
|
|
||||||
private List<MainAccettazioneBolleElencoListModel> convertDataModelToListModel(List<TestataBollaAccettazioneDTO> dataList) {
|
private List<MainAccettazioneBolleElencoListModel> convertDataModelToListModel(List<TestataBollaAccettazioneDTO> dataList) {
|
||||||
|
if(dataList == null)
|
||||||
|
return null;
|
||||||
|
|
||||||
final Comparator<TestataBollaAccettazioneDTO> comparer = Comparator.comparing(TestataBollaAccettazioneDTO::getListino)
|
final Comparator<TestataBollaAccettazioneDTO> comparer = Comparator.comparing(TestataBollaAccettazioneDTO::getListino)
|
||||||
.thenComparing(TestataBollaAccettazioneDTO::getRagSoc)
|
.thenComparing(TestataBollaAccettazioneDTO::getRagSoc)
|
||||||
.thenComparing(TestataBollaAccettazioneDTO::getNumDoc);
|
.thenComparing(TestataBollaAccettazioneDTO::getNumDoc);
|
||||||
|
|
||||||
|
|
||||||
return Stream.of(dataList)
|
return Stream.of(dataList)
|
||||||
.sorted(comparer)
|
.sorted(comparer)
|
||||||
.map(x -> {
|
.map(x -> {
|
||||||
|
|||||||
@ -374,7 +374,7 @@ public class AccettazioneOrdiniPickingViewModel {
|
|||||||
.map(x -> new CreateUDCRequestOrderDTO()
|
.map(x -> new CreateUDCRequestOrderDTO()
|
||||||
.setDataCons(x.getDataConsD() != null ? UtilityDate.toLocalDate(x.getDataConsD()) : null)
|
.setDataCons(x.getDataConsD() != null ? UtilityDate.toLocalDate(x.getDataConsD()) : null)
|
||||||
.setDataOrd(UtilityDate.toLocalDate(x.getDataD()))
|
.setDataOrd(UtilityDate.toLocalDate(x.getDataD()))
|
||||||
.setGestione(x.getGestione())
|
.setGestione(x.getGestioneEnum() == GestioneEnum.PRODUZIONE ? GestioneEnum.LAVORAZIONE.getText() : x.getGestione())
|
||||||
.setNumOrd(x.getNumero()))
|
.setNumOrd(x.getNumero()))
|
||||||
.toList();
|
.toList();
|
||||||
|
|
||||||
|
|||||||
@ -45,7 +45,9 @@ public class ProdRecuperoMaterialeViewModel {
|
|||||||
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public ProdRecuperoMaterialeViewModel(ProdRecuperMaterialeRESTConsumer prodRecuperMaterialeRESTConsumer, ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer, PrinterRESTConsumer printerRESTConsumer) {
|
public ProdRecuperoMaterialeViewModel(ProdRecuperMaterialeRESTConsumer prodRecuperMaterialeRESTConsumer,
|
||||||
|
ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer,
|
||||||
|
PrinterRESTConsumer printerRESTConsumer) {
|
||||||
this.mProdRecuperMaterialeRESTConsumer = prodRecuperMaterialeRESTConsumer;
|
this.mProdRecuperMaterialeRESTConsumer = prodRecuperMaterialeRESTConsumer;
|
||||||
this.mColliMagazzinoRESTConsumer = colliMagazzinoRESTConsumer;
|
this.mColliMagazzinoRESTConsumer = colliMagazzinoRESTConsumer;
|
||||||
this.mPrinterRESTConsumer = printerRESTConsumer;
|
this.mPrinterRESTConsumer = printerRESTConsumer;
|
||||||
@ -53,27 +55,25 @@ public class ProdRecuperoMaterialeViewModel {
|
|||||||
|
|
||||||
public void init(String codJfas) {
|
public void init(String codJfas) {
|
||||||
this.sendOnLoadingStarted();
|
this.sendOnLoadingStarted();
|
||||||
new Thread(() -> {
|
|
||||||
|
|
||||||
mProdRecuperMaterialeRESTConsumer.loadLastULVersate(codJfas, ulList -> {
|
mProdRecuperMaterialeRESTConsumer.loadLastULVersate(codJfas, ulList -> {
|
||||||
this.mUlList.setValue(ulList);
|
this.mUlList.setValue(ulList);
|
||||||
|
|
||||||
this.sendOnLoadingEnded();
|
this.sendOnLoadingEnded();
|
||||||
}, this::sendError);
|
}, this::sendError);
|
||||||
|
|
||||||
}).start();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void processBarcodeDTO(BarcodeScanDTO data) {
|
public void processBarcodeDTO(BarcodeScanDTO data) {
|
||||||
if (UtilityBarcode.isEtichettaAnonima(data) || UtilityBarcode.isEtichetta128(data)) {
|
if (UtilityBarcode.isEtichettaAnonima(data) || UtilityBarcode.isEtichetta128(data)) {
|
||||||
this.executeEtichettaUL(data);
|
this.executeEtichettaLU(data.getStringValue());
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void executeEtichettaUL(BarcodeScanDTO barcodeScanDTO) {
|
private void executeEtichettaLU(String sscc) {
|
||||||
this.sendOnLoadingStarted();
|
this.sendOnLoadingStarted();
|
||||||
|
|
||||||
this.mColliMagazzinoRESTConsumer.getBySSCC(barcodeScanDTO.getStringValue(), true, false, mtbColt -> {
|
this.mColliMagazzinoRESTConsumer.getBySSCC(sscc, true, false, mtbColt -> {
|
||||||
this.sendOnLoadingEnded();
|
this.sendOnLoadingEnded();
|
||||||
|
|
||||||
if (mtbColt != null) {
|
if (mtbColt != null) {
|
||||||
@ -116,7 +116,7 @@ public class ProdRecuperoMaterialeViewModel {
|
|||||||
|
|
||||||
if (!UtilityBigDecimal.equalsTo(qtaDaEvadere, BigDecimal.ZERO)) {
|
if (!UtilityBigDecimal.equalsTo(qtaDaEvadere, BigDecimal.ZERO)) {
|
||||||
|
|
||||||
if(item.getMtbAart().isFlagQtaCnfFissaBoolean())
|
if (item.getMtbAart().isFlagQtaCnfFissaBoolean())
|
||||||
numCnfDaEvadere = UtilityBigDecimal.divide(qtaDaEvadere, item.getQtaCnf());
|
numCnfDaEvadere = UtilityBigDecimal.divide(qtaDaEvadere, item.getQtaCnf());
|
||||||
else numCnfDaEvadere = item.getNumCnf();
|
else numCnfDaEvadere = item.getNumCnf();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,17 +18,23 @@ import com.annimon.stream.Stream;
|
|||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.math.RoundingMode;
|
import java.math.RoundingMode;
|
||||||
|
import java.time.LocalDate;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.MainApplication;
|
import it.integry.integrywmsnative.MainApplication;
|
||||||
import it.integry.integrywmsnative.R;
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.barcode_reader.BarcodeCallbackDTO;
|
||||||
|
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||||
import it.integry.integrywmsnative.core.di.BindableString;
|
import it.integry.integrywmsnative.core.di.BindableString;
|
||||||
import it.integry.integrywmsnative.core.expansion.BaseFragment;
|
import it.integry.integrywmsnative.core.expansion.BaseFragment;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgss;
|
||||||
import it.integry.integrywmsnative.core.interfaces.ITitledFragment;
|
import it.integry.integrywmsnative.core.interfaces.ITitledFragment;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
|
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||||
@ -39,20 +45,27 @@ import it.integry.integrywmsnative.databinding.FragmentProdVersamentoMaterialeBi
|
|||||||
import it.integry.integrywmsnative.gest.prod_versamento_materiale.dto.OrdineLavorazioneDTO;
|
import it.integry.integrywmsnative.gest.prod_versamento_materiale.dto.OrdineLavorazioneDTO;
|
||||||
import it.integry.integrywmsnative.gest.prod_versamento_materiale.dto.VersamentoMerceOrdineLavListModel;
|
import it.integry.integrywmsnative.gest.prod_versamento_materiale.dto.VersamentoMerceOrdineLavListModel;
|
||||||
import it.integry.integrywmsnative.gest.prod_versamento_materiale.ui.ChooseOrdsLavFromListAdapter;
|
import it.integry.integrywmsnative.gest.prod_versamento_materiale.ui.ChooseOrdsLavFromListAdapter;
|
||||||
|
import it.integry.integrywmsnative.gest.spedizione.model.PickedQuantityDTO;
|
||||||
|
import it.integry.integrywmsnative.gest.spedizione.model.PickingObjectDTO;
|
||||||
import it.integry.integrywmsnative.view.dialogs.DialogCommon;
|
import it.integry.integrywmsnative.view.dialogs.DialogCommon;
|
||||||
import it.integry.integrywmsnative.view.dialogs.DialogConsts;
|
import it.integry.integrywmsnative.view.dialogs.DialogConsts;
|
||||||
import it.integry.integrywmsnative.view.dialogs.ask_position_of_lu.DialogAskPositionOfLUView;
|
import it.integry.integrywmsnative.view.dialogs.ask_position_of_lu.DialogAskPositionOfLUView;
|
||||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||||
import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCreateLUView;
|
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2DTO;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2View;
|
||||||
|
|
||||||
public class ProdVersamentoMaterialeFragment extends BaseFragment implements ProdVersamentoMaterialeViewModel.Listener, ITitledFragment {
|
public class ProdVersamentoMaterialeFragment extends BaseFragment implements ProdVersamentoMaterialeViewModel.Listener, ITitledFragment {
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
ProdVersamentoMaterialeViewModel mViewModel;
|
ProdVersamentoMaterialeViewModel mViewModel;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
DialogInputQuantityV2View mDialogInputQuantityV2View;
|
||||||
|
|
||||||
private FragmentProdVersamentoMaterialeBinding mBinding;
|
private FragmentProdVersamentoMaterialeBinding mBinding;
|
||||||
|
|
||||||
private final ObservableField<MtbColt> mCurrentMtbColt = new ObservableField<>();
|
private final ObservableField<MtbColt> mCurrentMtbColt = new ObservableField<>();
|
||||||
|
private final ObservableField<Boolean> mCurrentMtbColtSet = new ObservableField<>(false);
|
||||||
private final ObservableArrayList<VersamentoMerceOrdineLavListModel> mCurrentOrders = new ObservableArrayList<>();
|
private final ObservableArrayList<VersamentoMerceOrdineLavListModel> mCurrentOrders = new ObservableArrayList<>();
|
||||||
|
|
||||||
public final BindableString codPrimaryArt = new BindableString();
|
public final BindableString codPrimaryArt = new BindableString();
|
||||||
@ -62,6 +75,8 @@ public class ProdVersamentoMaterialeFragment extends BaseFragment implements Pro
|
|||||||
public final ObservableField<Boolean> fabVisible = new ObservableField<>(false);
|
public final ObservableField<Boolean> fabVisible = new ObservableField<>(false);
|
||||||
|
|
||||||
|
|
||||||
|
private int barcodeScannerIstanceID = -1;
|
||||||
|
|
||||||
public ProdVersamentoMaterialeFragment() {
|
public ProdVersamentoMaterialeFragment() {
|
||||||
// Required empty public constructor
|
// Required empty public constructor
|
||||||
}
|
}
|
||||||
@ -98,12 +113,15 @@ public class ProdVersamentoMaterialeFragment extends BaseFragment implements Pro
|
|||||||
this.mViewModel.init(SettingsManager.iDB().isFlagVersamentoDirettoProduzione());
|
this.mViewModel.init(SettingsManager.iDB().isFlagVersamentoDirettoProduzione());
|
||||||
|
|
||||||
this.initView();
|
this.initView();
|
||||||
this.openLU();
|
this.initBarcodeReader();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initView() {
|
private void initView() {
|
||||||
this.mViewModel.getOpenedOrderLavMutableLiveList().observe(getViewLifecycleOwner(), this::refreshList);
|
this.mViewModel.getOpenedOrderLavMutableLiveList().observe(getViewLifecycleOwner(), this::refreshList);
|
||||||
this.mViewModel.getMtbColtMutableLiveData().observe(getViewLifecycleOwner(), this.mCurrentMtbColt::set);
|
this.mViewModel.getMtbColtMutableLiveData().observe(getViewLifecycleOwner(), value -> {
|
||||||
|
this.mCurrentMtbColt.set(value);
|
||||||
|
this.mCurrentMtbColtSet.set(true);
|
||||||
|
});
|
||||||
|
|
||||||
this.mViewModel.getMtbColrMutableLiveData().observe(getViewLifecycleOwner(), firstMtbColr -> {
|
this.mViewModel.getMtbColrMutableLiveData().observe(getViewLifecycleOwner(), firstMtbColr -> {
|
||||||
codPrimaryArt.set(firstMtbColr.getCodMart());
|
codPrimaryArt.set(firstMtbColr.getCodMart());
|
||||||
@ -173,36 +191,45 @@ public class ProdVersamentoMaterialeFragment extends BaseFragment implements Pro
|
|||||||
.toList();
|
.toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void openLU() {
|
|
||||||
DialogScanOrCreateLUView.newInstance(false, false, true, false, true, (mtbColt, created) -> {
|
|
||||||
if (mtbColt == null) {
|
|
||||||
popMe();
|
|
||||||
} else if ((mtbColt.getGestioneEnum() == GestioneEnum.ACQUISTO || mtbColt.getGestioneEnum() == GestioneEnum.LAVORAZIONE || mtbColt.getGestioneEnum() == GestioneEnum.VENDITA) && mtbColt.getSegno().equals(+1)) {
|
|
||||||
|
|
||||||
if (mtbColt.getMtbColr() == null || mtbColt.getMtbColr().size() == 0) {
|
private void initBarcodeReader() {
|
||||||
DialogSimpleMessageView.makeWarningDialog(
|
barcodeScannerIstanceID = BarcodeManager.addCallback(new BarcodeCallbackDTO()
|
||||||
new SpannableString(Html.fromHtml("E' stata scansionata una UL già vuota")),
|
.setOnScanSuccessful(mViewModel::processBarcodeDTO)
|
||||||
null, this::openLU)
|
.setOnScanFailed(this::onError));
|
||||||
.show((requireActivity()).getSupportFragmentManager(), "tag");
|
|
||||||
|
|
||||||
} else {
|
BarcodeManager.enable();
|
||||||
mViewModel.setMtbColt(mtbColt);
|
|
||||||
choosePosition();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
// private void openLU() {
|
||||||
this.onError(new Exception("Sono accettate solamente UL di <b>Acquisto</b> o <b>Lavorazione</b> di <b>CARICO</b>"));
|
// DialogScanOrCreateLUView.newInstance(false, false, true, false, true, (mtbColt, created) -> {
|
||||||
}
|
// if (mtbColt == null) {
|
||||||
}).show(requireActivity().getSupportFragmentManager(), "tag");
|
// popMe();
|
||||||
}
|
// } else if ((mtbColt.getGestioneEnum() == GestioneEnum.ACQUISTO || mtbColt.getGestioneEnum() == GestioneEnum.LAVORAZIONE || mtbColt.getGestioneEnum() == GestioneEnum.VENDITA) && mtbColt.getSegno().equals(+1)) {
|
||||||
|
//
|
||||||
|
// if (mtbColt.getMtbColr() == null || mtbColt.getMtbColr().size() == 0) {
|
||||||
|
// DialogSimpleMessageView.makeWarningDialog(
|
||||||
|
// new SpannableString(Html.fromHtml("E' stata scansionata una UL già vuota")),
|
||||||
|
// null, this::openLU)
|
||||||
|
// .show((requireActivity()).getSupportFragmentManager(), "tag");
|
||||||
|
//
|
||||||
|
// } else {
|
||||||
|
// mViewModel.setMtbColt(mtbColt);
|
||||||
|
// choosePosition();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// } else {
|
||||||
|
// this.onError(new Exception("Sono accettate solamente UL di <b>Acquisto</b> o <b>Lavorazione</b> di <b>CARICO</b>"));
|
||||||
|
// }
|
||||||
|
// }).show(requireActivity().getSupportFragmentManager(), "tag");
|
||||||
|
// }
|
||||||
|
|
||||||
private void choosePosition() {
|
private void choosePosition(RunnableArgs<MtbDepoPosizione> onComplete) {
|
||||||
DialogAskPositionOfLUView.makeBase(false, (status, mtbDepoPosizione) -> {
|
DialogAskPositionOfLUView.makeBase(false, (status, mtbDepoPosizione) -> {
|
||||||
|
|
||||||
if (status == DialogConsts.Results.ABORT) {
|
if (status == DialogConsts.Results.ABORT) {
|
||||||
popMe();
|
popMe();
|
||||||
} else {
|
} else {
|
||||||
mViewModel.setPosizione(mtbDepoPosizione);
|
onComplete.run(mtbDepoPosizione);
|
||||||
}
|
}
|
||||||
|
|
||||||
}, this::onError)
|
}, this::onError)
|
||||||
@ -315,6 +342,12 @@ public class ProdVersamentoMaterialeFragment extends BaseFragment implements Pro
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public ObservableField<Boolean> isCurrentMtbColtSettedObservable() {
|
||||||
|
return mCurrentMtbColtSet;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreateActionBar(AppCompatTextView titleText, Context context) {
|
public void onCreateActionBar(AppCompatTextView titleText, Context context) {
|
||||||
titleText.setText(context.getText(R.string.prod_versamento_materiale_title_fragment).toString());
|
titleText.setText(context.getText(R.string.prod_versamento_materiale_title_fragment).toString());
|
||||||
@ -322,7 +355,47 @@ public class ProdVersamentoMaterialeFragment extends BaseFragment implements Pro
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void requestLUOpen() {
|
public void requestLUOpen() {
|
||||||
this.openLU();
|
// this.openLU();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onRequestChoosePosition(RunnableArgs<MtbDepoPosizione> onComplete) {
|
||||||
|
choosePosition(onComplete);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onItemDispatched(PickingObjectDTO pickingObjectDTO, MtbAart mtbAart, BigDecimal initialNumCnf, BigDecimal initialQtaCnf, BigDecimal initialQtaTot, BigDecimal totalQtaAvailable, BigDecimal totalNumCnfAvailable, BigDecimal qtaCnfAvailable, BigDecimal totalQtaToBeTaken, BigDecimal totalNumCnfToBeTaken, BigDecimal qtaCnfToBeTaken, String partitaMag, LocalDate dataScad, boolean canOverflowOrderQuantity, boolean canPartitaMagBeChanged, RunnableArgss<PickedQuantityDTO, Boolean> onComplete) {
|
||||||
|
DialogInputQuantityV2DTO dialogInputQuantityV2DTO = new DialogInputQuantityV2DTO()
|
||||||
|
.setMtbAart(mtbAart)
|
||||||
|
.setInitialNumCnf(initialNumCnf)
|
||||||
|
.setInitialQtaCnf(initialQtaCnf)
|
||||||
|
.setInitialQtaTot(initialQtaTot)
|
||||||
|
.setTotalQtaAvailable(totalQtaAvailable)
|
||||||
|
.setTotalNumCnfAvailable(totalNumCnfAvailable)
|
||||||
|
.setQtaCnfAvailable(qtaCnfAvailable)
|
||||||
|
.setTotalQtaToBeTaken(totalQtaToBeTaken)
|
||||||
|
.setTotalNumCnfToBeTaken(totalNumCnfToBeTaken)
|
||||||
|
.setQtaCnfToBeTaken(qtaCnfToBeTaken)
|
||||||
|
.setPartitaMag(partitaMag)
|
||||||
|
.setDataScad(dataScad)
|
||||||
|
.setCanOverflowOrderQuantity(canOverflowOrderQuantity)
|
||||||
|
.setCanPartitaMagBeChanged(canPartitaMagBeChanged);
|
||||||
|
|
||||||
|
if (!mDialogInputQuantityV2View.isVisible())
|
||||||
|
mDialogInputQuantityV2View.setDialogInputQuantityV2DTO(dialogInputQuantityV2DTO)
|
||||||
|
.setOnComplete((resultDTO, shouldCloseLU) -> {
|
||||||
|
PickedQuantityDTO pickedQuantityDTO = new PickedQuantityDTO()
|
||||||
|
.setNumCnf(resultDTO.getNumCnf())
|
||||||
|
.setQtaCnf(resultDTO.getQtaCnf())
|
||||||
|
.setQtaTot(resultDTO.getQtaTot())
|
||||||
|
.setPartitaMag(resultDTO.getPartitaMag())
|
||||||
|
.setDataScad(resultDTO.getDataScad());
|
||||||
|
|
||||||
|
this.onLoadingStarted();
|
||||||
|
onComplete.run(pickedQuantityDTO, shouldCloseLU);
|
||||||
|
})
|
||||||
|
.setOnAbort(this::onLoadingEnded)
|
||||||
|
.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -2,15 +2,24 @@ package it.integry.integrywmsnative.gest.prod_versamento_materiale;
|
|||||||
|
|
||||||
import dagger.Module;
|
import dagger.Module;
|
||||||
import dagger.Provides;
|
import dagger.Provides;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.ColliLavorazioneRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.MesRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.MesRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.PosizioniRESTConsumer;
|
||||||
|
|
||||||
@Module(subcomponents = ProdVersamentoMaterialeComponent.class)
|
@Module(subcomponents = ProdVersamentoMaterialeComponent.class)
|
||||||
public class ProdVersamentoMaterialeModule {
|
public class ProdVersamentoMaterialeModule {
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
ProdVersamentoMaterialeViewModel providesProdVersamentoMaterialeViewModel(ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer, MesRESTConsumer mesRESTConsumer) {
|
ProdVersamentoMaterialeViewModel providesProdVersamentoMaterialeViewModel(PosizioniRESTConsumer posizioniRESTConsumer,
|
||||||
return new ProdVersamentoMaterialeViewModel(colliMagazzinoRESTConsumer, mesRESTConsumer);
|
ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer,
|
||||||
|
ColliLavorazioneRESTConsumer colliLavorazioneRESTConsumer,
|
||||||
|
MesRESTConsumer mesRESTConsumer,
|
||||||
|
BarcodeRESTConsumer barcodeRESTConsumer,
|
||||||
|
ArticoloRESTConsumer articoloRESTConsumer) {
|
||||||
|
return new ProdVersamentoMaterialeViewModel(posizioniRESTConsumer, colliMagazzinoRESTConsumer, colliLavorazioneRESTConsumer, mesRESTConsumer, barcodeRESTConsumer, articoloRESTConsumer);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,28 +2,53 @@ package it.integry.integrywmsnative.gest.prod_versamento_materiale;
|
|||||||
|
|
||||||
import androidx.lifecycle.MutableLiveData;
|
import androidx.lifecycle.MutableLiveData;
|
||||||
|
|
||||||
|
import com.annimon.stream.Stream;
|
||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDate;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||||
|
import it.integry.integrywmsnative.core.exception.NoLUFoundException;
|
||||||
|
import it.integry.integrywmsnative.core.exception.NoResultFromBarcodeException;
|
||||||
|
import it.integry.integrywmsnative.core.exception.TooManyLUFoundInMonoLUPositionException;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgss;
|
||||||
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingListener;
|
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingListener;
|
||||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
||||||
|
import it.integry.integrywmsnative.core.model.dto.PickDataDTO;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.ColliLavorazioneRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.MesRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.MesRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.PosizioniRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.Ean128Model;
|
||||||
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
|
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
import it.integry.integrywmsnative.gest.prod_versamento_materiale.dto.OrdineLavorazioneDTO;
|
import it.integry.integrywmsnative.gest.prod_versamento_materiale.dto.OrdineLavorazioneDTO;
|
||||||
|
import it.integry.integrywmsnative.gest.spedizione.exceptions.InvalidPesoKGException;
|
||||||
|
import it.integry.integrywmsnative.gest.spedizione.model.PickedQuantityDTO;
|
||||||
|
import it.integry.integrywmsnative.gest.spedizione.model.PickingObjectDTO;
|
||||||
|
|
||||||
public class ProdVersamentoMaterialeViewModel {
|
public class ProdVersamentoMaterialeViewModel {
|
||||||
|
|
||||||
|
private final PosizioniRESTConsumer mPosizioniRESTConsumer;
|
||||||
private final ColliMagazzinoRESTConsumer mColliMagazzinoRESTConsumer;
|
private final ColliMagazzinoRESTConsumer mColliMagazzinoRESTConsumer;
|
||||||
|
private final ColliLavorazioneRESTConsumer mColliLavorazioneRESTConsumer;
|
||||||
private final MesRESTConsumer mMesRESTConsumer;
|
private final MesRESTConsumer mMesRESTConsumer;
|
||||||
|
private final BarcodeRESTConsumer mBarcodeRESTConsumer;
|
||||||
|
private final ArticoloRESTConsumer mArticoloRESTConsumer;
|
||||||
|
|
||||||
private boolean mFlagVersamentoDirettoProduzione;
|
private boolean mFlagVersamentoDirettoProduzione;
|
||||||
|
|
||||||
@ -35,9 +60,18 @@ public class ProdVersamentoMaterialeViewModel {
|
|||||||
private Listener mListener;
|
private Listener mListener;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public ProdVersamentoMaterialeViewModel(ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer, MesRESTConsumer mesRESTConsumer) {
|
public ProdVersamentoMaterialeViewModel(PosizioniRESTConsumer posizioniRESTConsumer,
|
||||||
|
ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer,
|
||||||
|
ColliLavorazioneRESTConsumer colliLavorazioneRESTConsumer,
|
||||||
|
MesRESTConsumer mesRESTConsumer,
|
||||||
|
BarcodeRESTConsumer barcodeRESTConsumer,
|
||||||
|
ArticoloRESTConsumer articoloRESTConsumer) {
|
||||||
|
this.mPosizioniRESTConsumer = posizioniRESTConsumer;
|
||||||
this.mColliMagazzinoRESTConsumer = colliMagazzinoRESTConsumer;
|
this.mColliMagazzinoRESTConsumer = colliMagazzinoRESTConsumer;
|
||||||
|
this.mColliLavorazioneRESTConsumer = colliLavorazioneRESTConsumer;
|
||||||
this.mMesRESTConsumer = mesRESTConsumer;
|
this.mMesRESTConsumer = mesRESTConsumer;
|
||||||
|
this.mBarcodeRESTConsumer = barcodeRESTConsumer;
|
||||||
|
this.mArticoloRESTConsumer = articoloRESTConsumer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -46,8 +80,213 @@ public class ProdVersamentoMaterialeViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void setMtbColt(MtbColt mtbColt) {
|
public void processBarcodeDTO(BarcodeScanDTO barcodeScanDTO) {
|
||||||
|
if (UtilityBarcode.isEtichettaPosizione(barcodeScanDTO)) {
|
||||||
|
this.executeEtichettaPosizione(barcodeScanDTO);
|
||||||
|
} else if (UtilityBarcode.isEtichettaAnonima(barcodeScanDTO)) {
|
||||||
|
this.executeEtichettaLU(barcodeScanDTO.getStringValue());
|
||||||
|
} else if (UtilityBarcode.isEtichetta128(barcodeScanDTO)) {
|
||||||
|
this.executeEtichettaEan128(barcodeScanDTO);
|
||||||
|
} else if (UtilityBarcode.isEan13(barcodeScanDTO)) {
|
||||||
|
// this.executeEAN13(barcodeScanDTO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void executeEtichettaPosizione(BarcodeScanDTO barcodeScanDTO) {
|
||||||
|
|
||||||
|
MtbDepoPosizione foundPosizione = Stream.of(SettingsManager.iDB().getAvailablePosizioni())
|
||||||
|
.filter(x -> x.getPosizione().equalsIgnoreCase(barcodeScanDTO.getStringValue()))
|
||||||
|
.single();
|
||||||
|
this.executePosizione(foundPosizione);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void executePosizione(MtbDepoPosizione posizione) {
|
||||||
|
this.mPosizioniRESTConsumer.getBancaliInPosizione(posizione, mtbColtList -> {
|
||||||
|
|
||||||
|
if (mtbColtList == null || mtbColtList.size() == 0) {
|
||||||
|
this.sendError(new NoLUFoundException());
|
||||||
|
} else if (mtbColtList.size() == 1) {
|
||||||
|
this.mColliMagazzinoRESTConsumer.getByTestata(mtbColtList.get(0), true, false, mtbColt -> {
|
||||||
|
this.onLUOpened(mtbColt);
|
||||||
|
}, this::sendError);
|
||||||
|
} else {
|
||||||
|
this.sendError(new TooManyLUFoundInMonoLUPositionException());
|
||||||
|
}
|
||||||
|
|
||||||
|
}, this::sendError);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void executeEtichettaLU(String sscc) {
|
||||||
|
this.mColliMagazzinoRESTConsumer.getBySSCC(sscc, true, false, mtbColt -> {
|
||||||
|
|
||||||
|
this.onLUOpened(mtbColt);
|
||||||
|
|
||||||
|
}, this::sendError);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void executeEtichettaEan128(BarcodeScanDTO barcodeScanDTO) {
|
||||||
|
mBarcodeRESTConsumer.decodeEan128(barcodeScanDTO, ean128Model -> {
|
||||||
|
|
||||||
|
String barcodeProd = null;
|
||||||
|
|
||||||
|
if (!UtilityString.isNullOrEmpty(ean128Model.Sscc)) barcodeProd = ean128Model.Sscc;
|
||||||
|
if (!UtilityString.isNullOrEmpty(ean128Model.Gtin)) barcodeProd = ean128Model.Gtin;
|
||||||
|
if (!UtilityString.isNullOrEmpty(ean128Model.Content))
|
||||||
|
barcodeProd = ean128Model.Content;
|
||||||
|
|
||||||
|
|
||||||
|
if (!UtilityString.isNullOrEmpty(barcodeProd)) {
|
||||||
|
|
||||||
|
if (!UtilityString.isNullOrEmpty(ean128Model.Sscc)) {
|
||||||
|
this.executeEtichettaLU(ean128Model.Sscc);
|
||||||
|
} else if (!UtilityString.isNullOrEmpty(barcodeProd)) {
|
||||||
|
this.loadArticolo(barcodeProd, ean128Model);
|
||||||
|
} else {
|
||||||
|
this.sendError(new NoLUFoundException());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} else {
|
||||||
|
//EAN 128 non completo o comunque mancano i riferimenti al prodotto
|
||||||
|
this.sendError(new NoLUFoundException());
|
||||||
|
}
|
||||||
|
}, this::sendError);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void loadArticolo(String barcodeProd, Ean128Model ean128Model) {
|
||||||
|
mArticoloRESTConsumer.searchByBarcode(barcodeProd, mtbAartList -> {
|
||||||
|
if (mtbAartList != null && mtbAartList.size() > 0) {
|
||||||
|
MtbAart articolo = mtbAartList.get(0);
|
||||||
|
this.dispatchArt(articolo, ean128Model);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
this.sendError(new NoResultFromBarcodeException(barcodeProd));
|
||||||
|
}
|
||||||
|
|
||||||
|
}, this::sendError);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void dispatchArt(MtbAart mtbAart, Ean128Model ean128Model) {
|
||||||
|
PickingObjectDTO pickingObjectDTO = new PickingObjectDTO()
|
||||||
|
.setMtbAart(mtbAart)
|
||||||
|
.setTempPickData(PickDataDTO.fromEan128(ean128Model));
|
||||||
|
|
||||||
|
BigDecimal numCnfDaPrelevare = null;
|
||||||
|
BigDecimal qtaColDaPrelevare = null;
|
||||||
|
BigDecimal qtaCnfDaPrelevare = null;
|
||||||
|
|
||||||
|
BigDecimal initialNumCnf;
|
||||||
|
BigDecimal initialQtaCnf;
|
||||||
|
BigDecimal initialQtaTot;
|
||||||
|
|
||||||
|
String partitaMag = null;
|
||||||
|
LocalDate dataScad = null;
|
||||||
|
|
||||||
|
if (pickingObjectDTO.getTempPickData() != null && pickingObjectDTO.getTempPickData().getManualPickDTO() != null) {
|
||||||
|
//Oppure le info del barcode scansionato
|
||||||
|
PickDataDTO.ManualPickDTO manualPickDTO = pickingObjectDTO.getTempPickData().getManualPickDTO();
|
||||||
|
|
||||||
|
qtaColDaPrelevare = manualPickDTO.getQtaTot();
|
||||||
|
numCnfDaPrelevare = manualPickDTO.getNumCnf();
|
||||||
|
|
||||||
|
if (mtbAart.isFlagQtaCnfFissaBoolean()) {
|
||||||
|
qtaCnfDaPrelevare = mtbAart.getQtaCnf();
|
||||||
|
|
||||||
|
if (manualPickDTO.isEanPeso()) {
|
||||||
|
if (mtbAart.getUntMisRifPeso() == MtbAart.UntMisRifPesoEnum.M) {
|
||||||
|
if (UtilityBigDecimal.equalsTo(mtbAart.getPesoKg(), BigDecimal.ZERO)) {
|
||||||
|
this.sendError(new InvalidPesoKGException());
|
||||||
|
} else {
|
||||||
|
qtaColDaPrelevare = UtilityBigDecimal.divide(qtaColDaPrelevare, mtbAart.getPesoKg());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} else if (qtaColDaPrelevare != null && numCnfDaPrelevare != null) {
|
||||||
|
qtaCnfDaPrelevare = UtilityBigDecimal.divide(qtaColDaPrelevare, numCnfDaPrelevare);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (qtaColDaPrelevare != null && numCnfDaPrelevare == null) {
|
||||||
|
if (!mtbAart.isFlagQtaCnfFissaBoolean()) {
|
||||||
|
numCnfDaPrelevare = UtilityBigDecimal.divideAndRoundToInteger(qtaColDaPrelevare, mtbAart.getQtaCnf());
|
||||||
|
if (UtilityBigDecimal.equalsTo(numCnfDaPrelevare, BigDecimal.ZERO))
|
||||||
|
numCnfDaPrelevare = BigDecimal.ONE;
|
||||||
|
qtaCnfDaPrelevare = UtilityBigDecimal.divide(qtaColDaPrelevare, numCnfDaPrelevare);
|
||||||
|
} else {
|
||||||
|
numCnfDaPrelevare = UtilityBigDecimal.divideToInteger(qtaColDaPrelevare, mtbAart.getQtaCnf());
|
||||||
|
}
|
||||||
|
|
||||||
|
} else if (numCnfDaPrelevare != null && qtaColDaPrelevare == null) {
|
||||||
|
qtaCnfDaPrelevare = mtbAart.getQtaCnf();
|
||||||
|
qtaColDaPrelevare = UtilityBigDecimal.multiply(numCnfDaPrelevare, qtaCnfDaPrelevare);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (manualPickDTO.getMtbPartitaMag() != null) {
|
||||||
|
partitaMag = manualPickDTO.getMtbPartitaMag().getPartitaMag();
|
||||||
|
dataScad = manualPickDTO.getMtbPartitaMag().getDataScad();
|
||||||
|
}
|
||||||
|
|
||||||
|
initialNumCnf = numCnfDaPrelevare;
|
||||||
|
initialQtaCnf = qtaCnfDaPrelevare;
|
||||||
|
initialQtaTot = qtaColDaPrelevare;
|
||||||
|
} else {
|
||||||
|
initialNumCnf = BigDecimal.ONE;
|
||||||
|
initialQtaCnf = mtbAart.getQtaCnf();
|
||||||
|
initialQtaTot = UtilityBigDecimal.multiply(initialNumCnf, initialQtaCnf);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (numCnfDaPrelevare == null && qtaColDaPrelevare == null && initialNumCnf == null && initialQtaTot == null) {
|
||||||
|
initialNumCnf = BigDecimal.ONE;
|
||||||
|
initialQtaCnf = mtbAart.getQtaCnf();
|
||||||
|
initialQtaTot = UtilityBigDecimal.multiply(initialNumCnf, initialQtaCnf);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
this.sendOnItemDispatched(
|
||||||
|
pickingObjectDTO,
|
||||||
|
mtbAart,
|
||||||
|
initialNumCnf,
|
||||||
|
initialQtaCnf,
|
||||||
|
initialQtaTot,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
partitaMag,
|
||||||
|
dataScad,
|
||||||
|
false,
|
||||||
|
true,
|
||||||
|
(pickedQuantityDTO, shouldCloseLU) -> {
|
||||||
|
|
||||||
|
this.sendRequestChoosePosition(mtbDepoPosizione -> {
|
||||||
|
|
||||||
|
mColliLavorazioneRESTConsumer.createColloScaricoDaArticolo(mtbAart,
|
||||||
|
pickedQuantityDTO.getPartitaMag(),
|
||||||
|
mtbDepoPosizione,
|
||||||
|
pickedQuantityDTO.getQtaTot(),
|
||||||
|
pickedQuantityDTO.getQtaCnf(),
|
||||||
|
pickedQuantityDTO.getNumCnf(),
|
||||||
|
null, null,
|
||||||
|
this::sendOnDataSaved,
|
||||||
|
this::sendError);
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void onLUOpened(MtbColt mtbColt) {
|
||||||
this.mtbColtMutableLiveData.setValue(mtbColt);
|
this.mtbColtMutableLiveData.setValue(mtbColt);
|
||||||
|
this.sendRequestChoosePosition(this::setPosizione);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -77,7 +316,7 @@ public class ProdVersamentoMaterialeViewModel {
|
|||||||
mtbDepoPosizione.getPosizione(),
|
mtbDepoPosizione.getPosizione(),
|
||||||
getIdMaterialeFromCollo(mtbColt),
|
getIdMaterialeFromCollo(mtbColt),
|
||||||
ordini -> {
|
ordini -> {
|
||||||
if(ordini == null || ordini.isEmpty())
|
if (ordini == null || ordini.isEmpty())
|
||||||
this.sendError(new Exception("Nessun ordine compatibile con " + getIdMaterialeFromCollo(mtbColt) + " sulla linea " + mtbDepoPosizione.getPosizione()), true);
|
this.sendError(new Exception("Nessun ordine compatibile con " + getIdMaterialeFromCollo(mtbColt) + " sulla linea " + mtbDepoPosizione.getPosizione()), true);
|
||||||
else {
|
else {
|
||||||
setCurrentOrders(ordini, mtbColt.getMtbColr().get(0));
|
setCurrentOrders(ordini, mtbColt.getMtbColr().get(0));
|
||||||
@ -104,7 +343,6 @@ public class ProdVersamentoMaterialeViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private String getIdMaterialeFromCollo(MtbColt mtbColt) {
|
private String getIdMaterialeFromCollo(MtbColt mtbColt) {
|
||||||
MtbAart articolo = mtbColt.getMtbColr().get(0).getMtbAart();
|
MtbAart articolo = mtbColt.getMtbColr().get(0).getMtbAart();
|
||||||
return UtilityString.isNullOrEmpty(articolo.getIdArtEqui()) ? articolo.getCodMart() : articolo.getIdArtEqui();
|
return UtilityString.isNullOrEmpty(articolo.getIdArtEqui()) ? articolo.getCodMart() : articolo.getIdArtEqui();
|
||||||
@ -139,7 +377,6 @@ public class ProdVersamentoMaterialeViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void save(List<OrdineLavorazioneDTO> selectedOrders) {
|
public void save(List<OrdineLavorazioneDTO> selectedOrders) {
|
||||||
this.sendOnLoadingStarted();
|
this.sendOnLoadingStarted();
|
||||||
|
|
||||||
@ -154,16 +391,6 @@ public class ProdVersamentoMaterialeViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public MutableLiveData<MtbColt> getMtbColtMutableLiveData() {
|
public MutableLiveData<MtbColt> getMtbColtMutableLiveData() {
|
||||||
return mtbColtMutableLiveData;
|
return mtbColtMutableLiveData;
|
||||||
}
|
}
|
||||||
@ -186,6 +413,10 @@ public class ProdVersamentoMaterialeViewModel {
|
|||||||
if (this.mListener != null) mListener.requestLUOpen();
|
if (this.mListener != null) mListener.requestLUOpen();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void sendRequestChoosePosition(RunnableArgs<MtbDepoPosizione> onComplete) {
|
||||||
|
if (this.mListener != null) mListener.onRequestChoosePosition(onComplete);
|
||||||
|
}
|
||||||
|
|
||||||
private void sendOnLoadingStarted() {
|
private void sendOnLoadingStarted() {
|
||||||
if (this.mListener != null) mListener.onLoadingStarted();
|
if (this.mListener != null) mListener.onLoadingStarted();
|
||||||
}
|
}
|
||||||
@ -194,6 +425,40 @@ public class ProdVersamentoMaterialeViewModel {
|
|||||||
if (this.mListener != null) mListener.onLoadingEnded();
|
if (this.mListener != null) mListener.onLoadingEnded();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void sendOnItemDispatched(PickingObjectDTO pickingObjectDTO,
|
||||||
|
MtbAart mtbAart,
|
||||||
|
BigDecimal initialNumCnf,
|
||||||
|
BigDecimal initialQtaCnf,
|
||||||
|
BigDecimal initialQtaTot,
|
||||||
|
BigDecimal totalQtaAvailable,
|
||||||
|
BigDecimal totalNumCnfAvailable,
|
||||||
|
BigDecimal qtaCnfAvailable,
|
||||||
|
BigDecimal totalQtaToBeTaken,
|
||||||
|
BigDecimal totalNumCnfToBeTaken,
|
||||||
|
BigDecimal qtaCnfToBeTaken,
|
||||||
|
String partitaMag,
|
||||||
|
LocalDate dataScad,
|
||||||
|
boolean canOverflowOrderQuantity,
|
||||||
|
boolean canPartitaMagBeChanged,
|
||||||
|
RunnableArgss<PickedQuantityDTO, Boolean> onComplete) {
|
||||||
|
if (this.mListener != null) mListener.onItemDispatched(pickingObjectDTO,
|
||||||
|
mtbAart,
|
||||||
|
initialNumCnf,
|
||||||
|
initialQtaCnf,
|
||||||
|
initialQtaTot,
|
||||||
|
totalQtaAvailable,
|
||||||
|
totalNumCnfAvailable,
|
||||||
|
qtaCnfAvailable,
|
||||||
|
totalQtaToBeTaken,
|
||||||
|
totalNumCnfToBeTaken,
|
||||||
|
qtaCnfToBeTaken,
|
||||||
|
partitaMag,
|
||||||
|
dataScad,
|
||||||
|
canOverflowOrderQuantity,
|
||||||
|
canPartitaMagBeChanged,
|
||||||
|
onComplete);
|
||||||
|
}
|
||||||
|
|
||||||
private void sendWarning(String warningText, Runnable action) {
|
private void sendWarning(String warningText, Runnable action) {
|
||||||
if (this.mListener != null) mListener.onWarning(warningText, action);
|
if (this.mListener != null) mListener.onWarning(warningText, action);
|
||||||
}
|
}
|
||||||
@ -214,6 +479,25 @@ public class ProdVersamentoMaterialeViewModel {
|
|||||||
|
|
||||||
void requestLUOpen();
|
void requestLUOpen();
|
||||||
|
|
||||||
|
void onRequestChoosePosition(RunnableArgs<MtbDepoPosizione> onComplete);
|
||||||
|
|
||||||
|
void onItemDispatched(PickingObjectDTO pickingObjectDTO,
|
||||||
|
MtbAart mtbAart,
|
||||||
|
BigDecimal initialNumCnf,
|
||||||
|
BigDecimal initialQtaCnf,
|
||||||
|
BigDecimal initialQtaTot,
|
||||||
|
BigDecimal totalQtaAvailable,
|
||||||
|
BigDecimal totalNumCnfAvailable,
|
||||||
|
BigDecimal qtaCnfAvailable,
|
||||||
|
BigDecimal totalQtaToBeTaken,
|
||||||
|
BigDecimal totalNumCnfToBeTaken,
|
||||||
|
BigDecimal qtaCnfToBeTaken,
|
||||||
|
String partitaMag,
|
||||||
|
LocalDate dataScad,
|
||||||
|
boolean canOverflowOrderQuantity,
|
||||||
|
boolean canPartitaMagBeChanged,
|
||||||
|
RunnableArgss<PickedQuantityDTO, Boolean> onComplete);
|
||||||
|
|
||||||
void onError(Exception ex, boolean requestClose);
|
void onError(Exception ex, boolean requestClose);
|
||||||
|
|
||||||
void onWarning(String warningText, Runnable action);
|
void onWarning(String warningText, Runnable action);
|
||||||
|
|||||||
@ -21,19 +21,47 @@
|
|||||||
app:cardCornerRadius="12dp"
|
app:cardCornerRadius="12dp"
|
||||||
app:cardElevation="0dp">
|
app:cardElevation="0dp">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:reverse_visibility="@{view.isCurrentMtbColtSettedObservable()}"
|
||||||
|
tools:visibility="visible"
|
||||||
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
<androidx.appcompat.widget.LinearLayoutCompat
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:layout_marginTop="16dp"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:gravity="center_horizontal">
|
||||||
|
|
||||||
|
|
||||||
|
<ProgressBar
|
||||||
|
android:id="@+id/progressBar"
|
||||||
|
style="?android:attr/progressBarStyle"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
android:id="@+id/title_text"
|
style="@style/MaterialAlertDialog.Material3.Body.Text"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_marginStart="4dp"
|
||||||
|
android:layout_marginEnd="12dp"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:text="Scansiona un codice a barre per iniziare" />
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
style="@style/TextViewMaterial.Dialog.HeadlineText"
|
android:orientation="vertical"
|
||||||
android:text="@string/distribute_ul"
|
app:visibility="@{view.isCurrentMtbColtSettedObservable()}"
|
||||||
android:gravity="center_horizontal"/>
|
tools:visibility="gone">
|
||||||
|
|
||||||
<androidx.appcompat.widget.LinearLayoutCompat
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
buildscript {
|
buildscript {
|
||||||
ext {
|
ext {
|
||||||
kotlin_version = '1.9.0'
|
kotlin_version = '1.9.0'
|
||||||
agp_version = '8.1.1'
|
agp_version = '8.1.2'
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user