In accettazione bolla è possibile configurare la richiesta di stampa, versamento automatico o il tipo collo
This commit is contained in:
parent
eeb06e105e
commit
99f21b19f1
10
.idea/deploymentTargetDropDown.xml
generated
10
.idea/deploymentTargetDropDown.xml
generated
@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="deploymentTargetDropDown">
|
||||
<value>
|
||||
<entry key="app">
|
||||
<State />
|
||||
</entry>
|
||||
</value>
|
||||
</component>
|
||||
</project>
|
||||
@ -7,6 +7,7 @@ public class CreateUDCRequestDTO {
|
||||
private String codMdep;
|
||||
private Integer numCollo;
|
||||
private String serCollo;
|
||||
private String codAnag;
|
||||
private String codTcol;
|
||||
|
||||
private String annotazioni;
|
||||
@ -41,6 +42,15 @@ public class CreateUDCRequestDTO {
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodAnag() {
|
||||
return codAnag;
|
||||
}
|
||||
|
||||
public CreateUDCRequestDTO setCodAnag(String codAnag) {
|
||||
this.codAnag = codAnag;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodTcol() {
|
||||
return codTcol;
|
||||
}
|
||||
|
||||
@ -62,6 +62,10 @@ public class DBSettingsModel {
|
||||
private String commessaMagazzino;
|
||||
private boolean flagGeneraDocumentoSpedizione = false;
|
||||
private boolean flagIsInventarioCacheEnabled = false;
|
||||
private boolean flagAskPrintUlAccettazioneBolla = false;
|
||||
private boolean flagAskTipoColloAccettazioneBolla = false;
|
||||
private boolean flagAskVersamentoAutomaticoAccettazioneBolla = false;
|
||||
private boolean flagCanAddUnknownItemsAccettazioneBolla = false;
|
||||
|
||||
public boolean isFlagSpedizioneEnableFakeGiacenza() {
|
||||
return flagSpedizioneEnableFakeGiacenza;
|
||||
@ -486,4 +490,40 @@ public class DBSettingsModel {
|
||||
this.flagIsInventarioCacheEnabled = flagIsInventarioCacheEnabled;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagAskPrintUlAccettazioneBolla() {
|
||||
return flagAskPrintUlAccettazioneBolla;
|
||||
}
|
||||
|
||||
public DBSettingsModel setFlagAskPrintUlAccettazioneBolla(boolean flagAskPrintUlAccettazioneBolla) {
|
||||
this.flagAskPrintUlAccettazioneBolla = flagAskPrintUlAccettazioneBolla;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagAskTipoColloAccettazioneBolla() {
|
||||
return flagAskTipoColloAccettazioneBolla;
|
||||
}
|
||||
|
||||
public DBSettingsModel setFlagAskTipoColloAccettazioneBolla(boolean flagAskTipoColloAccettazioneBolla) {
|
||||
this.flagAskTipoColloAccettazioneBolla = flagAskTipoColloAccettazioneBolla;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagAskVersamentoAutomaticoAccettazioneBolla() {
|
||||
return flagAskVersamentoAutomaticoAccettazioneBolla;
|
||||
}
|
||||
|
||||
public DBSettingsModel setFlagAskVersamentoAutomaticoAccettazioneBolla(boolean flagAskVersamentoAutomaticoAccettazioneBolla) {
|
||||
this.flagAskVersamentoAutomaticoAccettazioneBolla = flagAskVersamentoAutomaticoAccettazioneBolla;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagCanAddUnknownItemsAccettazioneBolla() {
|
||||
return flagCanAddUnknownItemsAccettazioneBolla;
|
||||
}
|
||||
|
||||
public DBSettingsModel setFlagCanAddUnknownItemsAccettazioneBolla(boolean flagCanAddUnknownItemsAccettazioneBolla) {
|
||||
this.flagCanAddUnknownItemsAccettazioneBolla = flagCanAddUnknownItemsAccettazioneBolla;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@ -388,6 +388,23 @@ public class SettingsManager {
|
||||
.setGestName("PICKING")
|
||||
.setSection("SPEDIZIONE")
|
||||
.setKeySection("GENERA_DOC"));
|
||||
stbGestSetupList.add(new StbGestSetup()
|
||||
.setGestName("PICKING")
|
||||
.setSection("ACCETTAZIONE_BOLLA")
|
||||
.setKeySection("FLAG_ASK_PRINT_UL"));
|
||||
stbGestSetupList.add(new StbGestSetup()
|
||||
.setGestName("PICKING")
|
||||
.setSection("ACCETTAZIONE_BOLLA")
|
||||
.setKeySection("FLAG_ASK_TIPO_COLLO"));
|
||||
stbGestSetupList.add(new StbGestSetup()
|
||||
.setGestName("PICKING")
|
||||
.setSection("ACCETTAZIONE_BOLLA")
|
||||
.setKeySection("FLAG_ASK_VERSAMENTO_AUTOMATICO"));
|
||||
stbGestSetupList.add(new StbGestSetup()
|
||||
.setGestName("PICKING")
|
||||
.setSection("ACCETTAZIONE_BOLLA")
|
||||
.setKeySection("FLAG_CAN_ADD_UNKNOWN_ITEMS"));
|
||||
|
||||
String codMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep();
|
||||
|
||||
mGestSetupRESTConsumer.getValues(codMdep, stbGestSetupList, list -> {
|
||||
@ -429,6 +446,10 @@ public class SettingsManager {
|
||||
dbSettingsModelIstance.setCommessaMagazzino(getValueFromList(list, "SETUP", "COMMESSA_MAGAZZINO", String.class, CommonConst.Config.COMMESSA_MAG));
|
||||
dbSettingsModelIstance.setFlagGeneraDocumentoSpedizione(getValueFromList(list, "SPEDIZIONE", "GENERA_DOC", Boolean.class, Boolean.FALSE));
|
||||
dbSettingsModelIstance.setFlagIsInventarioCacheEnabled(getValueFromList(list, "INVENTARIO", "ENABLE_OFFLINE_CACHE", Boolean.class, Boolean.FALSE));
|
||||
dbSettingsModelIstance.setFlagAskPrintUlAccettazioneBolla(getValueFromList(list, "ACCETTAZIONE_BOLLA", "FLAG_ASK_PRINT_UL", Boolean.class, Boolean.FALSE));
|
||||
dbSettingsModelIstance.setFlagAskTipoColloAccettazioneBolla(getValueFromList(list, "ACCETTAZIONE_BOLLA", "FLAG_ASK_TIPO_COLLO", Boolean.class, Boolean.FALSE));
|
||||
dbSettingsModelIstance.setFlagAskVersamentoAutomaticoAccettazioneBolla(getValueFromList(list, "ACCETTAZIONE_BOLLA", "FLAG_ASK_VERSAMENTO_AUTOMATICO", Boolean.class, Boolean.FALSE));
|
||||
dbSettingsModelIstance.setFlagCanAddUnknownItemsAccettazioneBolla(getValueFromList(list, "ACCETTAZIONE_BOLLA", "FLAG_CAN_ADD_UNKNOWN_ITEMS", Boolean.class, Boolean.FALSE));
|
||||
|
||||
String notePerdita = getValueFromList(list, "DOC_INTERNI", "NOTE_PERDITA", String.class);
|
||||
if (notePerdita != null)
|
||||
|
||||
@ -11,6 +11,7 @@ import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
@ -89,6 +90,7 @@ public class AccettazioneBollaPickingViewModel {
|
||||
|
||||
private MtbColt mCurrentMtbColt = null;
|
||||
private GestioneEnum defaultGestioneOfUL = null;
|
||||
private String defaultCodAnag = null;
|
||||
|
||||
private final List<HistoryMtbAartDTO> mHistoryUsedAarts = new ArrayList<>();
|
||||
|
||||
@ -109,8 +111,8 @@ public class AccettazioneBollaPickingViewModel {
|
||||
this.mColliLavorazioneRESTConsumer = colliLavorazioneRESTConsumer;
|
||||
}
|
||||
|
||||
public void init(List<TestataBollaAccettazioneDTO> orders, List<SitBollaAccettazioneDTO> sitArts, boolean useQtaOrd) {
|
||||
this.mBolle = orders;
|
||||
public void init(List<TestataBollaAccettazioneDTO> bolle, List<SitBollaAccettazioneDTO> sitArts, boolean useQtaOrd) {
|
||||
this.mBolle = bolle;
|
||||
this.mUseQtaBolla = useQtaOrd;
|
||||
|
||||
List<SitBollaAccettazioneDTO> mSitArts = Stream.of(sitArts)
|
||||
@ -123,6 +125,12 @@ public class AccettazioneBollaPickingViewModel {
|
||||
|
||||
defaultGestioneOfUL = GestioneEnum.ACQUISTO;
|
||||
|
||||
var availableCodAnags = bolle.stream()
|
||||
.map(TestataBollaAccettazioneDTO::getCodAnag)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
defaultCodAnag = availableCodAnags.size() == 1 ? availableCodAnags.get(0) : null;
|
||||
|
||||
switch (defaultGestioneOfUL) {
|
||||
case ACQUISTO -> this.mColliCaricoRESTConsumer = mColliAccettazioneRESTConsumer;
|
||||
case LAVORAZIONE -> this.mColliCaricoRESTConsumer = mColliLavorazioneRESTConsumer;
|
||||
@ -311,7 +319,6 @@ public class AccettazioneBollaPickingViewModel {
|
||||
if (mtbAartList != null && mtbAartList.size() > 0) {
|
||||
this.searchArtFromAnag(mtbAartList.get(0), pickData, onComplete);
|
||||
} else {
|
||||
// this.sendError(new NoResultFromBarcodeException(barcodeProd));
|
||||
onComplete.run();
|
||||
this.sendOnUnknownBarcodeScanned(barcodeProd);
|
||||
}
|
||||
@ -354,7 +361,7 @@ public class AccettazioneBollaPickingViewModel {
|
||||
|
||||
|
||||
public void createNewLU(Integer customNumCollo, String customSerCollo, boolean disablePrint, Runnable onComplete) {
|
||||
this.sendOnInfoAggiuntiveRequest((additionalNotes, tCol) -> {
|
||||
this.manageInfoAggiuntiveRequest((additionalNotes, tCol) -> {
|
||||
|
||||
|
||||
final CreateUDCRequestDTO createUDCRequestDTO = new CreateUDCRequestDTO()
|
||||
@ -362,7 +369,8 @@ public class AccettazioneBollaPickingViewModel {
|
||||
.setAnnotazioni(additionalNotes)
|
||||
.setCodTcol(tCol != null ? tCol.getCodTcol() : null)
|
||||
.setNumCollo(customNumCollo)
|
||||
.setSerCollo(customSerCollo);
|
||||
.setSerCollo(customSerCollo)
|
||||
.setCodAnag(defaultCodAnag);
|
||||
|
||||
this.mColliCaricoRESTConsumer.createUDC(createUDCRequestDTO, createdUDS -> {
|
||||
this.mCurrentMtbColt = createdUDS;
|
||||
@ -377,6 +385,14 @@ public class AccettazioneBollaPickingViewModel {
|
||||
});
|
||||
}
|
||||
|
||||
private void manageInfoAggiuntiveRequest(RunnableArgss<String, MtbTCol> onComplete) {
|
||||
if(!SettingsManager.iDB().isFlagAskTipoColloAccettazioneBolla()) {
|
||||
onComplete.run(null, null);
|
||||
return;
|
||||
}
|
||||
|
||||
this.sendOnInfoAggiuntiveRequest(onComplete);
|
||||
}
|
||||
|
||||
public void dispatchOrdineRow(final PickingObjectDTO pickingObjectDTO) {
|
||||
if (this.mCurrentMtbColt == null) return;
|
||||
@ -698,31 +714,35 @@ public class AccettazioneBollaPickingViewModel {
|
||||
mColliCaricoRESTConsumer.closeUDC(closeUDCRequestDTO, closeUDCResponse -> {
|
||||
|
||||
Runnable onVersamentoCompleted = () -> {
|
||||
if (!mCurrentMtbColt.getDisablePrint()) {
|
||||
printCollo(this::postCloseOperations);
|
||||
} else {
|
||||
postCloseOperations();
|
||||
}
|
||||
managePrintCollo(this::postCloseOperations);
|
||||
|
||||
this.sendLUClosed();
|
||||
this.sendOnLoadingEnded();
|
||||
};
|
||||
|
||||
sendVersamentoAutomaticoULRequest(response -> {
|
||||
if (response) {
|
||||
versaAutomaticamenteUL(onVersamentoCompleted);
|
||||
} else {
|
||||
onVersamentoCompleted.run();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
manageVersamentoAutomatico(onVersamentoCompleted);
|
||||
}, this::sendError);
|
||||
}
|
||||
}, this::sendError);
|
||||
}
|
||||
|
||||
public void versaAutomaticamenteUL(Runnable onComplete) {
|
||||
private void manageVersamentoAutomatico(Runnable onComplete) {
|
||||
|
||||
if(!SettingsManager.iDB().isFlagAskVersamentoAutomaticoAccettazioneBolla()) {
|
||||
onComplete.run();
|
||||
return;
|
||||
}
|
||||
|
||||
sendVersamentoAutomaticoULRequest(response -> {
|
||||
if (response) {
|
||||
versaAutomaticamenteUL(onComplete);
|
||||
} else {
|
||||
onComplete.run();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void versaAutomaticamenteUL(Runnable onComplete) {
|
||||
if (mCurrentMtbColt == null) return;
|
||||
|
||||
mColliMagazzinoRESTConsumer.versamentoAutomaticoUL(mCurrentMtbColt, versamentoResult -> {
|
||||
@ -730,6 +750,14 @@ public class AccettazioneBollaPickingViewModel {
|
||||
}, this::sendError);
|
||||
}
|
||||
|
||||
private void managePrintCollo(Runnable onComplete) {
|
||||
if(!mCurrentMtbColt.getDisablePrint() || !SettingsManager.iDB().isFlagAskPrintUlAccettazioneBolla()) {
|
||||
onComplete.run();
|
||||
return;
|
||||
}
|
||||
|
||||
printCollo(onComplete);
|
||||
}
|
||||
|
||||
private void printCollo(Runnable onComplete) {
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user