Finish v1_12_1(130)
This commit is contained in:
commit
5b76092f58
@ -17,8 +17,8 @@ apply plugin: 'com.google.gms.google-services'
|
||||
|
||||
android {
|
||||
|
||||
def appVersionCode = 129
|
||||
def appVersionName = '1.12.0'
|
||||
def appVersionCode = 130
|
||||
def appVersionName = '1.12.1'
|
||||
|
||||
signingConfigs {
|
||||
release {
|
||||
|
||||
@ -31,7 +31,7 @@ public class CommonConst {
|
||||
};
|
||||
|
||||
public static String[] forErrors = {
|
||||
"syslogs@integry.it",
|
||||
// "syslogs@integry.it",
|
||||
"g.scorrano@integry.it",
|
||||
"v.castellana@integry.it"
|
||||
};
|
||||
|
||||
@ -23,10 +23,11 @@ import java.util.Random;
|
||||
import it.integry.integrywmsnative.core.CommonConst;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||
import it.integry.integrywmsnative.gest.vendita.dto.OrdineVenditaInevasoDTO;
|
||||
|
||||
public class ColliDataRecover {
|
||||
|
||||
private static class RecoverDTO {
|
||||
public static class RecoverDTO {
|
||||
private int id;
|
||||
private int numCollo;
|
||||
private String serCollo;
|
||||
@ -34,6 +35,8 @@ public class ColliDataRecover {
|
||||
private String gestioneCollo;
|
||||
private String filtro;
|
||||
|
||||
private List<OrdineVenditaInevasoDTO> testateOrdini;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
@ -87,6 +90,25 @@ public class ColliDataRecover {
|
||||
this.filtro = filtro;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<OrdineVenditaInevasoDTO> getTestateOrdini() {
|
||||
return testateOrdini;
|
||||
}
|
||||
|
||||
public RecoverDTO setTestateOrdini(List<OrdineVenditaInevasoDTO> testateOrdini) {
|
||||
this.testateOrdini = testateOrdini;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public MtbColt getMtbColt() {
|
||||
return new MtbColt()
|
||||
.setNumCollo(getNumCollo())
|
||||
.setSerCollo(getSerCollo())
|
||||
.setGestione(getGestioneCollo())
|
||||
.setDataCollo(getDataCollo())
|
||||
.setFiltroOrdini(getFiltro());
|
||||
}
|
||||
}
|
||||
|
||||
private static Context mContext;
|
||||
@ -115,18 +137,11 @@ public class ColliDataRecover {
|
||||
} else return null;
|
||||
}
|
||||
|
||||
public static MtbColt getSession(Integer sessionID) {
|
||||
public static RecoverDTO getSession(Integer sessionID) {
|
||||
|
||||
if(sessionID == null) return null;
|
||||
|
||||
RecoverDTO dto = getIfExists(sessionID);
|
||||
|
||||
return new MtbColt()
|
||||
.setNumCollo(dto.getNumCollo())
|
||||
.setSerCollo(dto.getSerCollo())
|
||||
.setGestione(dto.getGestioneCollo())
|
||||
.setDataCollo(dto.getDataCollo())
|
||||
.setFiltroOrdini(dto.getFiltro());
|
||||
return getIfExists(sessionID);
|
||||
}
|
||||
|
||||
private static RecoverDTO getIfExists(int id) {
|
||||
@ -138,7 +153,7 @@ public class ColliDataRecover {
|
||||
return recoverDTOOptional.isPresent() ? recoverDTOOptional.get() : null;
|
||||
}
|
||||
|
||||
public static int startNewSession(MtbColt mtbColtSession) {
|
||||
public static int startNewSession(MtbColt mtbColtSession, List<OrdineVenditaInevasoDTO> testateOrdini) {
|
||||
Integer newId = null;
|
||||
|
||||
while(newId == null) {
|
||||
@ -154,7 +169,8 @@ public class ColliDataRecover {
|
||||
.setNumCollo(mtbColtSession.getNumCollo())
|
||||
.setSerCollo(mtbColtSession.getSerCollo())
|
||||
.setGestioneCollo(mtbColtSession.getGestione())
|
||||
.setFiltro(mtbColtSession.getFiltroOrdini());
|
||||
.setFiltro(mtbColtSession.getFiltroOrdini())
|
||||
.setTestateOrdini(testateOrdini);
|
||||
|
||||
mtbColtsSessions.add(recoverDTO);
|
||||
updateLocalFile();
|
||||
|
||||
@ -0,0 +1,28 @@
|
||||
package it.integry.integrywmsnative.core.utility;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class UtilityBigDecimal {
|
||||
|
||||
public static boolean greaterThan(BigDecimal input, BigDecimal toCompareWith) {
|
||||
if(input == null) return false;
|
||||
if(toCompareWith == null) return false;
|
||||
|
||||
return input.compareTo(toCompareWith) > 0;
|
||||
}
|
||||
|
||||
public static boolean equalsTo(BigDecimal input, BigDecimal toCompareWith) {
|
||||
if(input == null) return false;
|
||||
if(toCompareWith == null) return false;
|
||||
|
||||
return input.compareTo(toCompareWith) == 0;
|
||||
}
|
||||
|
||||
public static boolean lowerThan(BigDecimal input, BigDecimal toCompareWith) {
|
||||
if(input == null) return false;
|
||||
if(toCompareWith == null) return false;
|
||||
|
||||
return input.compareTo(toCompareWith) < 0;
|
||||
}
|
||||
|
||||
}
|
||||
@ -2,6 +2,7 @@ package it.integry.integrywmsnative.core.utility;
|
||||
|
||||
import com.orhanobut.logger.Logger;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.StringWriter;
|
||||
import java.net.SocketException;
|
||||
@ -14,15 +15,15 @@ import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
|
||||
public class UtilityLogger {
|
||||
|
||||
public static void logMe(String message){
|
||||
public static void logMe(String message) {
|
||||
StackTraceElement[] stackTraceElements = Thread.currentThread().getStackTrace();
|
||||
|
||||
String caller = "UtilityLogger";
|
||||
|
||||
for(int i = 0; i < stackTraceElements.length; i++){
|
||||
for (int i = 0; i < stackTraceElements.length; i++) {
|
||||
|
||||
if(stackTraceElements[i].getMethodName().equalsIgnoreCase("logMe")){
|
||||
caller = stackTraceElements[i+1].getFileName() + "->" + stackTraceElements[i+1].getMethodName();
|
||||
if (stackTraceElements[i].getMethodName().equalsIgnoreCase("logMe")) {
|
||||
caller = stackTraceElements[i + 1].getFileName() + "->" + stackTraceElements[i + 1].getMethodName();
|
||||
}
|
||||
|
||||
}
|
||||
@ -39,8 +40,9 @@ public class UtilityLogger {
|
||||
}
|
||||
|
||||
public static void errorMe(Exception ex, String additionalText, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
if((!(ex instanceof SocketTimeoutException) && !(ex.getCause() instanceof SocketTimeoutException)) ||
|
||||
(!(ex instanceof SocketException) && !(ex.getCause() instanceof SocketException)) ) {
|
||||
if ((!(ex instanceof SocketTimeoutException) && !(ex.getCause() instanceof SocketTimeoutException)) ||
|
||||
(!(ex instanceof SocketException) && !(ex.getCause() instanceof SocketException)) ||
|
||||
(!(ex instanceof IOException) && !(ex.getCause() instanceof IOException))) {
|
||||
|
||||
String message = UtilityResources.readRawTextFile(R.raw.error_mail);
|
||||
|
||||
|
||||
@ -72,4 +72,10 @@ public class UtilityString {
|
||||
return Html.fromHtml(String.format(UtilityResources.getString(stringId),params));
|
||||
}
|
||||
|
||||
|
||||
public static boolean equalsIgnoreCase(String val1, String val2) {
|
||||
return (val1 == null && val2 == null) ||
|
||||
(val1 != null && val1.equalsIgnoreCase(val2));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -2,12 +2,15 @@ package it.integry.integrywmsnative.gest.accettazione_ordine_inevaso.viewmodel;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.app.ProgressDialog;
|
||||
|
||||
import androidx.databinding.ObservableArrayList;
|
||||
import androidx.databinding.ObservableField;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import android.text.SpannableString;
|
||||
|
||||
import com.annimon.stream.Optional;
|
||||
import com.annimon.stream.Stream;
|
||||
import com.tfb.fbtoast.FBToast;
|
||||
|
||||
@ -36,6 +39,7 @@ import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||
import it.integry.integrywmsnative.core.report.ReportManager;
|
||||
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.UtilityDate;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
||||
@ -88,7 +92,7 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
||||
this.init();
|
||||
}
|
||||
|
||||
private void init(){
|
||||
private void init() {
|
||||
|
||||
currentOrderBy = AccettazioneOrdineInevasoOrderBy.Enum.fromInt(SettingsManager.i().userSession.defaultOrdinamentoPickingAccettazione);
|
||||
|
||||
@ -97,7 +101,7 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
||||
mArticoliInColloBottomSheetViewModel.setOnItemEditedCallback(this::onRowEdited);
|
||||
|
||||
groupedOrdini = new ArrayList<>();
|
||||
for (OrdineAccettazioneDTO ordine : mOrders){
|
||||
for (OrdineAccettazioneDTO ordine : mOrders) {
|
||||
groupedOrdini.addAll(ordine.getOrdini());
|
||||
}
|
||||
|
||||
@ -115,9 +119,9 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
||||
.distinctBy(x -> x)
|
||||
.toList();
|
||||
|
||||
if(foundGestioni != null) {
|
||||
if (foundGestioni != null) {
|
||||
|
||||
if(foundGestioni.size() == 1) {
|
||||
if (foundGestioni.size() == 1) {
|
||||
defaultGestioneOfUL = foundGestioni.get(0) == GestioneEnum.PRODUZIONE ? GestioneEnum.LAVORAZIONE : foundGestioni.get(0);
|
||||
} else {
|
||||
DialogSimpleMessageHelper.makeErrorDialog(mActivity, new SpannableString(mActivity.getString(R.string.error_multiple_gest)), null, () -> {
|
||||
@ -134,7 +138,7 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
||||
}
|
||||
|
||||
|
||||
private void initRecyclerView(List<List<OrdineAccettazioneDTO.Riga>> groupedRighe){
|
||||
private void initRecyclerView(List<List<OrdineAccettazioneDTO.Riga>> groupedRighe) {
|
||||
//RecyclerView setup
|
||||
mActivity.bindings.accettazioneOrdineMainList.setHasFixedSize(true);
|
||||
|
||||
@ -152,8 +156,8 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
||||
mActivity.bindings.accettazioneOrdineMainList.setAdapter(mAdapter);
|
||||
}
|
||||
|
||||
public void refreshOrderBy(boolean forceHiddenCheck){
|
||||
switch (currentOrderBy){
|
||||
public void refreshOrderBy(boolean forceHiddenCheck) {
|
||||
switch (currentOrderBy) {
|
||||
case COD_ART_FOR:
|
||||
groupedRighe = helper.getOrdiniRaggruppatiPerCodArtForn(groupedOrdini, forceHiddenCheck);
|
||||
break;
|
||||
@ -186,7 +190,7 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
||||
}
|
||||
|
||||
public void removeListFilter() {
|
||||
for(int i = 0; i < groupedOrdini.size(); i++) {
|
||||
for (int i = 0; i < groupedOrdini.size(); i++) {
|
||||
groupedOrdini.get(i).setTempHidden(false);
|
||||
}
|
||||
|
||||
@ -194,9 +198,9 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
||||
mActivity.bindings.filteredArtsInListExpandableLayout.collapse(true);
|
||||
}
|
||||
|
||||
public void recoverUL(MtbColt recoveredMtbColt){
|
||||
public void recoverUL(MtbColt recoveredMtbColt) {
|
||||
|
||||
for(int i = 0; i < recoveredMtbColt.getMtbColr().size(); i++){
|
||||
for (int i = 0; i < recoveredMtbColt.getMtbColr().size(); i++) {
|
||||
|
||||
MtbColr currentMtbColr = recoveredMtbColt.getMtbColr().get(i);
|
||||
|
||||
@ -215,7 +219,7 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
||||
.toList();
|
||||
|
||||
|
||||
if(foundRows != null && foundRows.size() > 0){
|
||||
if (foundRows != null && foundRows.size() > 0) {
|
||||
OrdineAccettazioneDTO.Riga currentRow = foundRows.get(0);
|
||||
|
||||
currentRow.setHidden(false);
|
||||
@ -230,15 +234,13 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public RunnableArgs<BarcodeScanDTO> onScanSuccessfull = data -> {
|
||||
|
||||
Dialog progressDialog = UtilityProgress.createDefaultProgressDialog(mActivity);
|
||||
|
||||
BarcodeManager.disable();
|
||||
if(UtilityBarcode.isEtichettaAnonima(data)){
|
||||
if(!thereIsAnOpenedUL()) this.executeEtichettaAnonima(data, progressDialog);
|
||||
if (UtilityBarcode.isEtichettaAnonima(data)) {
|
||||
if (!thereIsAnOpenedUL()) this.executeEtichettaAnonima(data, progressDialog);
|
||||
else {
|
||||
DialogSimpleMessageHelper.makeErrorDialog(
|
||||
mActivity,
|
||||
@ -250,9 +252,9 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
||||
})
|
||||
.show();
|
||||
}
|
||||
} else if(UtilityBarcode.isEtichetta128(data)) {
|
||||
} else if (UtilityBarcode.isEtichetta128(data)) {
|
||||
this.executeEtichettaEan128(data, progressDialog);
|
||||
} else if(UtilityBarcode.isEanPeso(data)){
|
||||
} else if (UtilityBarcode.isEanPeso(data)) {
|
||||
this.executeEtichettaEanPeso(data, progressDialog);
|
||||
} else {
|
||||
this.loadArticolo(data.getStringValue(), null, progressDialog);
|
||||
@ -264,8 +266,8 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
||||
private void executeEtichettaAnonima(BarcodeScanDTO barcodeScanDTO, Dialog progressDialog) {
|
||||
ColliMagazzinoRESTConsumer.getBySSCC(barcodeScanDTO.getStringValue(), false, false, mtbColt -> {
|
||||
|
||||
if(mtbColt == null) {
|
||||
if(!UtilityBarcode.isEtichettaAnonimaOfCurrentYear(barcodeScanDTO.getStringValue())) {
|
||||
if (mtbColt == null) {
|
||||
if (!UtilityBarcode.isEtichettaAnonimaOfCurrentYear(barcodeScanDTO.getStringValue())) {
|
||||
UtilityExceptions.defaultException(mActivity, new Exception("Per continuare scansiona un'etichetta dell'anno corrente"), progressDialog, false);
|
||||
BarcodeManager.enable();
|
||||
} else {
|
||||
@ -292,12 +294,12 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
||||
|
||||
String barcodeProd = null;
|
||||
|
||||
if(ean128Model.Sscc != null) barcodeProd = ean128Model.Sscc;
|
||||
if(ean128Model.Gtin != null) barcodeProd = ean128Model.Gtin;
|
||||
if(ean128Model.Content != null) barcodeProd = ean128Model.Content;
|
||||
if (ean128Model.Sscc != null) barcodeProd = ean128Model.Sscc;
|
||||
if (ean128Model.Gtin != null) barcodeProd = ean128Model.Gtin;
|
||||
if (ean128Model.Content != null) barcodeProd = ean128Model.Content;
|
||||
|
||||
|
||||
if(!UtilityString.isNullOrEmpty(barcodeProd)) {
|
||||
if (!UtilityString.isNullOrEmpty(barcodeProd)) {
|
||||
if (barcodeProd.startsWith("0") || barcodeProd.startsWith("9")) {
|
||||
barcodeProd = barcodeProd.substring(1, barcodeProd.length());
|
||||
}
|
||||
@ -307,7 +309,7 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
||||
progressDialog.dismiss();
|
||||
BarcodeManager.enable();
|
||||
}
|
||||
}, ex-> {
|
||||
}, ex -> {
|
||||
UtilityExceptions.defaultException(mActivity, ex, progressDialog);
|
||||
BarcodeManager.enable();
|
||||
});
|
||||
@ -326,20 +328,19 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void loadArticolo(String barcodeProd, Ean128Model ean128Model, Dialog progressDialog) {
|
||||
if(barcodeProd.length() == 14) {
|
||||
if (barcodeProd.length() == 14) {
|
||||
// barcodeProd = UtilityBarcode.convertITF14toNeutral(barcodeProd);
|
||||
barcodeProd = UtilityBarcode.convertITF14toEAN13(barcodeProd);
|
||||
}
|
||||
|
||||
ArticoloRESTConsumer.getByBarcodeProd(barcodeProd, mtbAartList -> {
|
||||
|
||||
if(mtbAartList != null && mtbAartList.size() > 0) {
|
||||
if (mtbAartList != null && mtbAartList.size() > 0) {
|
||||
|
||||
if(!thereIsAnOpenedUL()){
|
||||
if (!thereIsAnOpenedUL()) {
|
||||
|
||||
if(SettingsManager.iDB().isFlagCanAutoOpenNewULAccettazione()) {
|
||||
if (SettingsManager.iDB().isFlagCanAutoOpenNewULAccettazione()) {
|
||||
this.createNewUL(null, null, progressDialog, false, () -> {
|
||||
BarcodeManager.enable();
|
||||
this.searchArtInList(mtbAartList.get(0), ean128Model);
|
||||
@ -382,13 +383,13 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
||||
(x.isHidden() != null && !x.isHidden()) && (x.isTempHidden() != null && !x.isTempHidden()))
|
||||
.toList();
|
||||
|
||||
if(foundRowsList.size() == 0) {
|
||||
if (foundRowsList.size() == 0) {
|
||||
showNoArtFoundDialog();
|
||||
} else if(foundRowsList.size() == 1) {
|
||||
} else if (foundRowsList.size() == 1) {
|
||||
onOrdineRowDispatch(foundRowsList.get(0), ean128Model);
|
||||
} else {
|
||||
for(int i = 0; i < groupedOrdini.size(); i++) {
|
||||
if(!foundRowsList.contains(groupedOrdini.get(i))) {
|
||||
for (int i = 0; i < groupedOrdini.size(); i++) {
|
||||
if (!foundRowsList.contains(groupedOrdini.get(i))) {
|
||||
groupedOrdini.get(i).setTempHidden(true);
|
||||
}
|
||||
}
|
||||
@ -433,7 +434,7 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
||||
|
||||
mActivity.bindings.accettazioneOrdineInevasoFab.close(true);
|
||||
|
||||
if (progress == null){
|
||||
if (progress == null) {
|
||||
progress = UtilityProgress.createDefaultProgressDialog(mActivity);
|
||||
}
|
||||
|
||||
@ -448,7 +449,8 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
||||
GestSetupRESTConsumer.getValue("PICKING", "SETUP", "DEFAULT_POSIZIONE_COLLI_ACCETTAZIONE", defaultPosAccettazioneDTO -> {
|
||||
|
||||
String defaultPosAccettazione = "";
|
||||
if(defaultPosAccettazioneDTO != null && !UtilityString.isNullOrEmpty(defaultPosAccettazioneDTO.value)) defaultPosAccettazione = defaultPosAccettazioneDTO.value;
|
||||
if (defaultPosAccettazioneDTO != null && !UtilityString.isNullOrEmpty(defaultPosAccettazioneDTO.value))
|
||||
defaultPosAccettazione = defaultPosAccettazioneDTO.value;
|
||||
|
||||
MtbColt mtbColt = new MtbColt();
|
||||
mtbColt
|
||||
@ -458,11 +460,11 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
||||
.setPosizione(defaultPosAccettazione)
|
||||
.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
||||
|
||||
if(customNumCollo != null) {
|
||||
if (customNumCollo != null) {
|
||||
mtbColt.setNumCollo(customNumCollo);
|
||||
}
|
||||
|
||||
if(!UtilityString.isNullOrEmpty(customSerCollo)) {
|
||||
if (!UtilityString.isNullOrEmpty(customSerCollo)) {
|
||||
mtbColt.setSerCollo(customSerCollo);
|
||||
}
|
||||
|
||||
@ -472,7 +474,7 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
||||
.distinct()
|
||||
.toList();
|
||||
|
||||
if(codAnags != null && codAnags.size() == 1){
|
||||
if (codAnags != null && codAnags.size() == 1) {
|
||||
mtbColt.setCodAnag(codAnags.get(0));
|
||||
}
|
||||
|
||||
@ -482,7 +484,7 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
||||
.distinct()
|
||||
.toList();
|
||||
|
||||
if(rifOrds != null && rifOrds.size() == 1){
|
||||
if (rifOrds != null && rifOrds.size() == 1) {
|
||||
mtbColt.setRifOrd(rifOrds.get(0));
|
||||
}
|
||||
|
||||
@ -492,7 +494,7 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
||||
.distinct()
|
||||
.toList();
|
||||
|
||||
if(numDataOrds != null && numDataOrds.size() == 1){
|
||||
if (numDataOrds != null && numDataOrds.size() == 1) {
|
||||
mtbColt.setNumOrd(mOrders.get(0).getNumero());
|
||||
mtbColt.setDataOrd(mOrders.get(0).getData());
|
||||
|
||||
@ -519,9 +521,9 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
||||
|
||||
finalProgress.dismiss();
|
||||
|
||||
FBToast.successToast(mActivity,mActivity.getResources().getString(R.string.data_saved) ,FBToast.LENGTH_SHORT);
|
||||
FBToast.successToast(mActivity, mActivity.getResources().getString(R.string.data_saved), FBToast.LENGTH_SHORT);
|
||||
|
||||
if(onComplete != null) onComplete.run();
|
||||
if (onComplete != null) onComplete.run();
|
||||
|
||||
}
|
||||
|
||||
@ -545,7 +547,7 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
||||
}
|
||||
|
||||
|
||||
private void setULToCurrentContext(MtbColt mtbColt){
|
||||
private void setULToCurrentContext(MtbColt mtbColt) {
|
||||
isFabVisible.set(false);
|
||||
mArticoliInColloBottomSheetViewModel.mtbColt.set(mtbColt);
|
||||
}
|
||||
@ -574,14 +576,14 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
||||
|
||||
@Override
|
||||
public void onColloClosed(Runnable onComplete, boolean shouldPrint) {
|
||||
if(thereIsAnOpenedUL()) {
|
||||
if (thereIsAnOpenedUL()) {
|
||||
|
||||
final Dialog progress = UtilityProgress.createDefaultProgressDialog(mActivity);
|
||||
progress.show();
|
||||
|
||||
if(thereIsAnyRowInUL()) {
|
||||
if (thereIsAnyRowInUL()) {
|
||||
updateDataFine(progress, () -> {
|
||||
if(shouldPrint) printCollo(progress, onComplete);
|
||||
if (shouldPrint) printCollo(progress, onComplete);
|
||||
else {
|
||||
postCloseOperations(onComplete);
|
||||
progress.dismiss();
|
||||
@ -592,7 +594,7 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
||||
}
|
||||
|
||||
} else {
|
||||
if(onComplete != null) onComplete.run();
|
||||
if (onComplete != null) onComplete.run();
|
||||
}
|
||||
|
||||
}
|
||||
@ -621,7 +623,7 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
||||
private void printCollo(Dialog progress, Runnable onComplete) {
|
||||
MtbColt currentMtbColt = mArticoliInColloBottomSheetViewModel.mtbColt.get();
|
||||
|
||||
if(currentMtbColt.getDisablePrint()){
|
||||
if (currentMtbColt.getDisablePrint()) {
|
||||
postCloseOperations(onComplete);
|
||||
progress.dismiss();
|
||||
return;
|
||||
@ -629,8 +631,8 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
||||
|
||||
PrinterRESTConsumer.getAvailablePrinters(SettingsManager.i().userSession.depo.getCodMdep(), PrinterRESTConsumer.Type.SECONDARIA, value -> {
|
||||
|
||||
if(value.size() > 0) {
|
||||
try{
|
||||
if (value.size() > 0) {
|
||||
try {
|
||||
|
||||
|
||||
ReportManager.getRightReportNameByGestione(GestioneEnum.ACQUISTO, reportName -> {
|
||||
@ -658,7 +660,7 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
||||
|
||||
}, ex -> UtilityExceptions.defaultException(mActivity, ex, progress)
|
||||
);
|
||||
} catch (Exception ex){
|
||||
} catch (Exception ex) {
|
||||
UtilityExceptions.defaultException(mActivity, ex, progress);
|
||||
}
|
||||
} else {
|
||||
@ -683,7 +685,7 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
||||
isFabVisible.set(true);
|
||||
|
||||
progress.dismiss();
|
||||
if(onComplete != null) onComplete.run();
|
||||
if (onComplete != null) onComplete.run();
|
||||
}, ex -> UtilityExceptions.defaultException(mActivity, ex, progress));
|
||||
}
|
||||
|
||||
@ -699,7 +701,6 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void postCloseOperations(Runnable onComplete) {
|
||||
|
||||
MtbColt mtbColt = (MtbColt) getColloRef().clone();
|
||||
@ -708,18 +709,18 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
||||
|
||||
isFabVisible.set(true);
|
||||
|
||||
if(mtbColt != null && mtbColt.getMtbColr() != null) {
|
||||
if (mtbColt != null && mtbColt.getMtbColr() != null) {
|
||||
for (int i = 0; i < mtbColt.getMtbColr().size(); i++) {
|
||||
|
||||
MtbColr currentRow = mtbColt.getMtbColr().get(i);
|
||||
|
||||
if(currentRow.getRigaOrd() != null) {
|
||||
if (currentRow.getRigaOrd() != null) {
|
||||
|
||||
for(int k = 0; k < this.groupedOrdini.size(); k++) {
|
||||
for (int k = 0; k < this.groupedOrdini.size(); k++) {
|
||||
|
||||
OrdineAccettazioneDTO.Riga x = this.groupedOrdini.get(k);
|
||||
|
||||
if(x.getQtaDaEvadere().floatValue() > 0 &&
|
||||
if (x.getQtaDaEvadere().floatValue() > 0 &&
|
||||
x.getMtbAart().getCodMart().equalsIgnoreCase(currentRow.getCodMart()) &&
|
||||
x.getCodJcom().equalsIgnoreCase(currentRow.getCodJcom()) &&
|
||||
x.getRigaOrd() == currentRow.getRigaOrd() &&
|
||||
@ -753,13 +754,13 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
||||
removeListFilter();
|
||||
refreshOrderBy(true);
|
||||
|
||||
if(onComplete != null) onComplete.run();
|
||||
if (onComplete != null) onComplete.run();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onOrdineRowDispatch(final OrdineAccettazioneDTO.Riga item, Ean128Model ean128Model) {
|
||||
if(getColloRef() != null){
|
||||
if (getColloRef() != null) {
|
||||
|
||||
List<MtbColr> currentMtbColrs = getColloRef().getMtbColr();
|
||||
|
||||
@ -777,14 +778,13 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
||||
float qtaEvasa = item.qtaRiservate + qtaEvasaInMtbColr;
|
||||
|
||||
|
||||
|
||||
BigDecimal qtaDaEvadere;
|
||||
|
||||
BigDecimal totalQtaDaEvadere = item.getQtaOrd().subtract(new BigDecimal(qtaEvasa)).subtract(item.getQtaEvasa());
|
||||
|
||||
BigDecimal qtaColliPedana = item.mtbAart.getColliPedana().multiply(item.mtbAart.getQtaCnf());
|
||||
|
||||
if(qtaColliPedana.floatValue() > 0 && qtaColliPedana.compareTo(totalQtaDaEvadere) <= 0) {
|
||||
if (qtaColliPedana.floatValue() > 0 && qtaColliPedana.compareTo(totalQtaDaEvadere) <= 0) {
|
||||
qtaDaEvadere = qtaColliPedana;
|
||||
} else {
|
||||
qtaDaEvadere = totalQtaDaEvadere;
|
||||
@ -799,15 +799,15 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
||||
.setQtaEvasa(new BigDecimal(qtaEvasa))
|
||||
.setCanPartitaMagBeChanged(true);
|
||||
|
||||
if(ean128Model != null){
|
||||
if(!UtilityString.isNullOrEmpty(ean128Model.BatchLot)) {
|
||||
if (ean128Model != null) {
|
||||
if (!UtilityString.isNullOrEmpty(ean128Model.BatchLot)) {
|
||||
dto.setBatchLot(ean128Model.BatchLot);
|
||||
}
|
||||
|
||||
try {
|
||||
if(!UtilityString.isNullOrEmpty(ean128Model.BestBefore)){
|
||||
if (!UtilityString.isNullOrEmpty(ean128Model.BestBefore)) {
|
||||
dto.setDataScad(UtilityDate.recognizeDate(ean128Model.BestBefore));
|
||||
} else if(!UtilityString.isNullOrEmpty(ean128Model.Expiry)) {
|
||||
} else if (!UtilityString.isNullOrEmpty(ean128Model.Expiry)) {
|
||||
dto.setDataScad(UtilityDate.recognizeDate(ean128Model.Expiry));
|
||||
}
|
||||
|
||||
@ -816,11 +816,11 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
||||
}
|
||||
|
||||
|
||||
if(ean128Model.Count != null && ean128Model.Count > 0) {
|
||||
if (ean128Model.Count != null && ean128Model.Count > 0) {
|
||||
//if(!UtilityString.isNullOrEmpty(ean128Model.Sscc)) {
|
||||
dto.setQtaTot(new BigDecimal(ean128Model.Count));
|
||||
|
||||
if(!item.getMtbAart().isFlagQtaCnfFissa()) {
|
||||
if (!item.getMtbAart().isFlagQtaCnfFissa()) {
|
||||
dto.setQtaCnf(new BigDecimal(ean128Model.Count));
|
||||
}
|
||||
//} else {
|
||||
@ -832,7 +832,7 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
||||
dto.setQtaTot(new BigDecimal(ean128Model.NetWeightKg));
|
||||
}
|
||||
|
||||
if(dto.getQtaTot() != null && dto.getQtaTot().floatValue() > 0 && dto.getNumCnf() != null && dto.getNumCnf() > 0) {
|
||||
if (dto.getQtaTot() != null && dto.getQtaTot().floatValue() > 0 && dto.getNumCnf() != null && dto.getNumCnf() > 0) {
|
||||
dto.setQtaCnf(dto.getQtaTot().divide(new BigDecimal(dto.getNumCnf())));
|
||||
}
|
||||
|
||||
@ -845,7 +845,7 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
||||
}
|
||||
}
|
||||
|
||||
private void onOrdineRowDispatched(OrdineAccettazioneDTO.Riga item, QuantityDTO quantityDTO, boolean closeLU){
|
||||
private void onOrdineRowDispatched(OrdineAccettazioneDTO.Riga item, QuantityDTO quantityDTO, boolean closeLU) {
|
||||
final Dialog progress = UtilityProgress.createDefaultProgressDialog(mActivity);
|
||||
|
||||
String gestioneRif = item.getGestioneOrdEnum() == GestioneEnum.PRODUZIONE ? "L" : item.getGestioneOrd();
|
||||
@ -863,7 +863,7 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
||||
.setCodJcom(item.getCodJcom())
|
||||
.setRigaOrd(item.getRigaOrd());
|
||||
|
||||
if(!item.getMtbAart().isFlagQtaCnfFissa()) {
|
||||
if (!item.getMtbAart().isFlagQtaCnfFissa()) {
|
||||
mtbColr.setQtaCnf(quantityDTO.qtaCnf.getBigDecimal());
|
||||
}
|
||||
|
||||
@ -896,7 +896,7 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
||||
FBToast.successToast(mActivity, mActivity.getResources().getString(R.string.data_saved), FBToast.LENGTH_SHORT);
|
||||
progress.dismiss();
|
||||
|
||||
if(closeLU) onColloClosed(null, true);
|
||||
if (closeLU) onColloClosed(null, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -908,7 +908,6 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
||||
}
|
||||
|
||||
|
||||
|
||||
private MtbColt getColloRef() {
|
||||
return mArticoliInColloBottomSheetViewModel.mtbColt.get();
|
||||
}
|
||||
@ -919,33 +918,37 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
||||
|
||||
private void onRowEdited(MtbColr oldValue, MtbColr newValue) {
|
||||
|
||||
if(getColloRef() != null) {
|
||||
|
||||
Dialog progress = UtilityProgress.createDefaultProgressDialog(mActivity);
|
||||
|
||||
MtbColr mtbColrToEditOfAccettazione = Stream.of(getColloRef().getMtbColr())
|
||||
.filter(x -> x.getQtaCol().compareTo(oldValue.getQtaCol()) == 0 &&
|
||||
x.getCodMart().equalsIgnoreCase(oldValue.getCodMart()) &&
|
||||
x.getPartitaMag().equalsIgnoreCase(oldValue.getPartitaMag()) &&
|
||||
x.getCodJcom().equalsIgnoreCase(oldValue.getCodJcom()))
|
||||
.findFirst()
|
||||
.get();
|
||||
|
||||
mtbColrToEditOfAccettazione
|
||||
.setQtaCol(newValue.getQtaCol());
|
||||
|
||||
ColliMagazzinoRESTConsumer.updateRiga(mtbColrToEditOfAccettazione, () -> {
|
||||
progress.dismiss();
|
||||
// if (getColloRef() != null) {
|
||||
//
|
||||
// Dialog progress = UtilityProgress.createDefaultProgressDialog(mActivity);
|
||||
//
|
||||
// Optional<MtbColr> optionalMtbColrToEditOfAccettazione = Stream.of(getColloRef().getMtbColr())
|
||||
// .filter(x -> UtilityBigDecimal.equalsTo(x.getQtaCol(), oldValue.getQtaCol()) &&
|
||||
// UtilityString.equalsIgnoreCase(x.getCodMart(), oldValue.getCodMart()) &&
|
||||
// UtilityString.equalsIgnoreCase(x.getPartitaMag(), oldValue.getPartitaMag()) &&
|
||||
// UtilityString.equalsIgnoreCase(x.getCodJcom(), oldValue.getCodJcom()))
|
||||
// .findFirst();
|
||||
//
|
||||
// if(optionalMtbColrToEditOfAccettazione.isPresent()) {
|
||||
// MtbColr mtbColrToEditOfAccettazione = optionalMtbColrToEditOfAccettazione.get();
|
||||
//
|
||||
// mtbColrToEditOfAccettazione
|
||||
// .setQtaCol(newValue.getQtaCol());
|
||||
//
|
||||
// ColliMagazzinoRESTConsumer.updateRiga(mtbColrToEditOfAccettazione, () -> {
|
||||
// progress.dismiss();
|
||||
// this.refreshOrderBy(false);
|
||||
// }, ex -> {
|
||||
// UtilityExceptions.defaultException(mActivity, ex, progress);
|
||||
// this.refreshOrderBy(false);
|
||||
// });
|
||||
//
|
||||
// }
|
||||
//
|
||||
// } else {
|
||||
//
|
||||
this.refreshOrderBy(false);
|
||||
}, ex -> {
|
||||
UtilityExceptions.defaultException(mActivity, ex, progress);
|
||||
this.refreshOrderBy(false);
|
||||
});
|
||||
|
||||
} else {
|
||||
|
||||
this.refreshOrderBy(false);
|
||||
}
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -19,6 +19,7 @@ import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.MainActivity;
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.class_router.interfaces.IOrdiniVendita;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.watcher.ServerStatusChecker;
|
||||
import it.integry.integrywmsnative.core.class_router.BaseCustomConfiguration;
|
||||
@ -145,10 +146,15 @@ public class MainFragment extends Fragment implements ITitledFragment, IScrollab
|
||||
private void cyclicRecover(Iterator<Integer> sessionsIterator, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
if(sessionsIterator.hasNext()) {
|
||||
Integer recoveredMtbColtID = sessionsIterator.next();
|
||||
MtbColt recoveredMtbColt = ColliDataRecover.getSession(recoveredMtbColtID);
|
||||
ColliDataRecover.RecoverDTO recoveredMtbColtDto = ColliDataRecover.getSession(recoveredMtbColtID);
|
||||
MtbColt recoveredMtbColt = recoveredMtbColtDto.getMtbColt();
|
||||
|
||||
if(recoveredMtbColt != null && (recoveredMtbColt.getGestioneEnum() == GestioneEnum.VENDITA || recoveredMtbColt.getGestioneEnum() == GestioneEnum.LAVORAZIONE) && !UtilityString.isNullOrEmpty(recoveredMtbColt.getFiltroOrdini())) {
|
||||
ColliMagazzinoRESTConsumer.distribuisciCollo(recoveredMtbColt, SettingsManager.iDB().getDefaultCriterioDistribuzione(),
|
||||
|
||||
IOrdiniVendita ordiniVendita = ClassRouter.getInstance(ClassRouter.PATH.ORDINI_VENDITA);
|
||||
|
||||
ColliMagazzinoRESTConsumer.updateDataFine(getActivity(), null, recoveredMtbColt, () -> {
|
||||
ordiniVendita.distribuisciCollo(null, recoveredMtbColt, recoveredMtbColtDto.getTestateOrdini(),
|
||||
mtbColts -> {
|
||||
ColliDataRecover.closeSession(recoveredMtbColtID);
|
||||
|
||||
@ -164,6 +170,7 @@ public class MainFragment extends Fragment implements ITitledFragment, IScrollab
|
||||
|
||||
cyclicRecover(sessionsIterator, onComplete, onFailed);
|
||||
});
|
||||
});
|
||||
} else {
|
||||
ColliDataRecover.closeSession(recoveredMtbColtID);
|
||||
cyclicRecover(sessionsIterator, onComplete, onFailed);
|
||||
|
||||
@ -89,7 +89,7 @@ public class ProdVersamentoMaterialViewModel {
|
||||
DialogScanOrCreateLU.make(mContext, false, false, true, false, mtbColt -> {
|
||||
if (mtbColt == null) {
|
||||
((IPoppableActivity) mContext).pop();
|
||||
} else if ((mtbColt.getGestioneEnum() == GestioneEnum.ACQUISTO || mtbColt.getGestioneEnum() == GestioneEnum.LAVORAZIONE) && mtbColt.getSegno().equals(+1)) {
|
||||
} 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) {
|
||||
DialogSimpleMessageHelper.makeWarningDialog(mContext,
|
||||
|
||||
@ -337,7 +337,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
}
|
||||
|
||||
public void recoverUL(MtbColt recoveredMtbColt){
|
||||
mtbColtSessionID = ColliDataRecover.startNewSession(recoveredMtbColt);
|
||||
mtbColtSessionID = ColliDataRecover.startNewSession(recoveredMtbColt, mTestateOrdini);
|
||||
setULToCurrentContext(recoveredMtbColt);
|
||||
refreshOrderBy(false);
|
||||
}
|
||||
@ -825,7 +825,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
mtbColt
|
||||
.setNumCollo(value.getNumCollo())
|
||||
.setDataCollo(value.getDataColloS());
|
||||
mtbColtSessionID = ColliDataRecover.startNewSession(mtbColt);
|
||||
mtbColtSessionID = ColliDataRecover.startNewSession(mtbColt, mTestateOrdini);
|
||||
|
||||
value
|
||||
.setDisablePrint(disablePrint)
|
||||
|
||||
@ -18,7 +18,7 @@ public class OrdiniVendita implements IOrdiniVendita {
|
||||
|
||||
@Override
|
||||
public void distribuisciCollo(Dialog progress, MtbColt mtbColt, List<OrdineVenditaInevasoDTO> testateOrdini, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
UtilityToast.showToast("Avviato metodo in BaseFeature");
|
||||
// UtilityToast.showToast("Avviato metodo in BaseFeature");
|
||||
|
||||
ColliMagazzinoRESTConsumer.distribuisciCollo(mtbColt, SettingsManager.iDB().getDefaultCriterioDistribuzione(),
|
||||
onComplete,
|
||||
|
||||
@ -18,7 +18,7 @@ public class OrdiniVendita implements IOrdiniVendita {
|
||||
|
||||
@Override
|
||||
public void distribuisciCollo(Dialog progress, MtbColt mtbColt, List<OrdineVenditaInevasoDTO> testateOrdini, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
UtilityToast.showToast("Avviato metodo in Frudis");
|
||||
// UtilityToast.showToast("Avviato metodo in Frudis");
|
||||
|
||||
ColliMagazzinoRESTConsumer.distribuisciCollo(mtbColt, SettingsManager.iDB().getDefaultCriterioDistribuzione(),
|
||||
onComplete,
|
||||
|
||||
@ -18,7 +18,7 @@ public class OrdiniVendita implements IOrdiniVendita {
|
||||
|
||||
@Override
|
||||
public void distribuisciCollo(Dialog progress, MtbColt mtbColt, List<OrdineVenditaInevasoDTO> testateOrdini, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
UtilityToast.showToast("Avviato metodo in BaseFeature");
|
||||
// UtilityToast.showToast("Avviato metodo in BaseFeature");
|
||||
|
||||
ColliMagazzinoRESTConsumer.distribuisciCollo(mtbColt, SettingsManager.iDB().getDefaultCriterioDistribuzione(),
|
||||
onComplete,
|
||||
|
||||
@ -17,7 +17,7 @@ public class OrdiniVendita implements IOrdiniVendita {
|
||||
|
||||
@Override
|
||||
public void distribuisciCollo(Dialog progress, MtbColt mtbColt, List<OrdineVenditaInevasoDTO> testateOrdini, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
UtilityToast.showToast("Avviato metodo in BaseFeature");
|
||||
// UtilityToast.showToast("Avviato metodo in BaseFeature");
|
||||
|
||||
ColliMagazzinoRESTConsumer.distribuisciCollo(mtbColt, SettingsManager.iDB().getDefaultCriterioDistribuzione(),
|
||||
onComplete,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user