Sostituiti controlli su size == 0 con isEmpty() sulle liste
This commit is contained in:
parent
d4a7dee121
commit
998b1057e0
@ -85,7 +85,7 @@ public class BarcodeManager {
|
|||||||
|
|
||||||
private static BarcodeCallbackDTO getValidCallback() {
|
private static BarcodeCallbackDTO getValidCallback() {
|
||||||
|
|
||||||
if (mBarcodeCallbacksStacktrace.size() > 0) {
|
if (!mBarcodeCallbacksStacktrace.isEmpty()) {
|
||||||
return mBarcodeCallbacksStacktrace.get(mBarcodeCallbacksStacktrace.size() - 1);
|
return mBarcodeCallbacksStacktrace.get(mBarcodeCallbacksStacktrace.size() - 1);
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
@ -106,7 +106,7 @@ public class BarcodeManager {
|
|||||||
|
|
||||||
int newID = -1;
|
int newID = -1;
|
||||||
|
|
||||||
if (mBarcodeCallbacksStacktrace.size() > 0) {
|
if (!mBarcodeCallbacksStacktrace.isEmpty()) {
|
||||||
newID = mBarcodeCallbacksStacktrace.get(mBarcodeCallbacksStacktrace.size() - 1).getID() + 1;
|
newID = mBarcodeCallbacksStacktrace.get(mBarcodeCallbacksStacktrace.size() - 1).getID() + 1;
|
||||||
} else {
|
} else {
|
||||||
newID = 1;
|
newID = 1;
|
||||||
|
|||||||
@ -30,7 +30,7 @@ public class DataCache {
|
|||||||
|
|
||||||
Object foundDataCache = null;
|
Object foundDataCache = null;
|
||||||
|
|
||||||
if(dataCacheTemp != null && dataCacheTemp.size() > 0) {
|
if(dataCacheTemp != null && !dataCacheTemp.isEmpty()) {
|
||||||
foundDataCache = dataCacheTemp.get(0).getItem();
|
foundDataCache = dataCacheTemp.get(0).getItem();
|
||||||
dataCacheList.remove(dataCacheTemp.get(0));
|
dataCacheList.remove(dataCacheTemp.get(0));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -46,7 +46,7 @@ public class ColliDataRecoverService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean thereIsAnExistantSession() {
|
public boolean thereIsAnExistantSession() {
|
||||||
return mtbColtsSessions != null && mtbColtsSessions.size() > 0;
|
return mtbColtsSessions != null && !mtbColtsSessions.isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Integer> getAllSessionIDs() {
|
public List<Integer> getAllSessionIDs() {
|
||||||
|
|||||||
@ -354,7 +354,7 @@ public class Converters {
|
|||||||
view.addTextChangedListener(watcher);
|
view.addTextChangedListener(watcher);
|
||||||
}
|
}
|
||||||
BigDecimal newValue = bindableBigDecimal.get();
|
BigDecimal newValue = bindableBigDecimal.get();
|
||||||
BigDecimal viewValue = view.getText().toString().trim().length() > 0 ? new BigDecimal(view.getText().toString()) : null;
|
BigDecimal viewValue = !view.getText().toString().trim().isEmpty() ? new BigDecimal(view.getText().toString()) : null;
|
||||||
|
|
||||||
if (!UtilityBigDecimal.equalsTo(viewValue, newValue)) {
|
if (!UtilityBigDecimal.equalsTo(viewValue, newValue)) {
|
||||||
view.setText(UtilityNumber.decimalToString(newValue));
|
view.setText(UtilityNumber.decimalToString(newValue));
|
||||||
@ -381,7 +381,7 @@ public class Converters {
|
|||||||
view.addTextChangedListener(watcher);
|
view.addTextChangedListener(watcher);
|
||||||
}
|
}
|
||||||
Integer newValue = bindableInteger.get();
|
Integer newValue = bindableInteger.get();
|
||||||
Integer viewValue = view.getText().toString().trim().length() > 0 ? Integer.valueOf(view.getText().toString()) : Integer.valueOf(0);
|
Integer viewValue = !view.getText().toString().trim().isEmpty() ? Integer.valueOf(view.getText().toString()) : Integer.valueOf(0);
|
||||||
|
|
||||||
if (!(viewValue.compareTo(newValue) == 0)) {
|
if (!(viewValue.compareTo(newValue) == 0)) {
|
||||||
view.setText(newValue.toString());
|
view.setText(newValue.toString());
|
||||||
@ -432,7 +432,7 @@ public class Converters {
|
|||||||
view.addTextChangedListener(watcher);
|
view.addTextChangedListener(watcher);
|
||||||
}
|
}
|
||||||
Integer newValue = observableInteger.get();
|
Integer newValue = observableInteger.get();
|
||||||
Integer viewValue = view.getText().toString().trim().length() > 0 ? Integer.valueOf(view.getText().toString()) : Integer.valueOf(0);
|
Integer viewValue = !view.getText().toString().trim().isEmpty() ? Integer.valueOf(view.getText().toString()) : Integer.valueOf(0);
|
||||||
|
|
||||||
if (!viewValue.equals(newValue) && newValue != null) {
|
if (!viewValue.equals(newValue) && newValue != null) {
|
||||||
view.setText(newValue.toString());
|
view.setText(newValue.toString());
|
||||||
@ -459,7 +459,7 @@ public class Converters {
|
|||||||
view.addTextChangedListener(watcher);
|
view.addTextChangedListener(watcher);
|
||||||
}
|
}
|
||||||
Long newValue = observableLong.get();
|
Long newValue = observableLong.get();
|
||||||
Long viewValue = view.getText().toString().trim().length() > 0 ? Long.valueOf(view.getText().toString()) : Long.valueOf(0);
|
Long viewValue = !view.getText().toString().trim().isEmpty() ? Long.valueOf(view.getText().toString()) : Long.valueOf(0);
|
||||||
|
|
||||||
if (!viewValue.equals(newValue) && newValue != null) {
|
if (!viewValue.equals(newValue) && newValue != null) {
|
||||||
view.setText(newValue.toString());
|
view.setText(newValue.toString());
|
||||||
|
|||||||
@ -66,19 +66,19 @@ public class Ean128Service {
|
|||||||
|
|
||||||
switch (aiModel.AI) {
|
switch (aiModel.AI) {
|
||||||
case SSCC -> {
|
case SSCC -> {
|
||||||
if (aiValue.length() > 0 && (aiValue.charAt(0) == '0' || aiValue.charAt(0) == '9')) {
|
if (!aiValue.isEmpty() && (aiValue.charAt(0) == '0' || aiValue.charAt(0) == '9')) {
|
||||||
aiValue = new StringBuilder(aiValue.substring(1));
|
aiValue = new StringBuilder(aiValue.substring(1));
|
||||||
}
|
}
|
||||||
model.Sscc = aiValue.toString();
|
model.Sscc = aiValue.toString();
|
||||||
}
|
}
|
||||||
case GTIN -> {
|
case GTIN -> {
|
||||||
if (aiValue.length() > 0 && (aiValue.charAt(0) == '0' || aiValue.charAt(0) == '9')) {
|
if (!aiValue.isEmpty() && (aiValue.charAt(0) == '0' || aiValue.charAt(0) == '9')) {
|
||||||
aiValue = new StringBuilder(aiValue.substring(1));
|
aiValue = new StringBuilder(aiValue.substring(1));
|
||||||
}
|
}
|
||||||
model.Gtin = aiValue.toString();
|
model.Gtin = aiValue.toString();
|
||||||
}
|
}
|
||||||
case CONTENT -> {
|
case CONTENT -> {
|
||||||
if (aiValue.length() > 0 && (aiValue.charAt(0) == '0' || aiValue.charAt(0) == '9')) {
|
if (!aiValue.isEmpty() && (aiValue.charAt(0) == '0' || aiValue.charAt(0) == '9')) {
|
||||||
aiValue = new StringBuilder(aiValue.substring(1));
|
aiValue = new StringBuilder(aiValue.substring(1));
|
||||||
}
|
}
|
||||||
model.Content = aiValue.toString();
|
model.Content = aiValue.toString();
|
||||||
|
|||||||
@ -327,7 +327,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
|
|
||||||
ArticoloRESTConsumer.getByCodMartsStatic(codMarts, arts -> {
|
ArticoloRESTConsumer.getByCodMartsStatic(codMarts, arts -> {
|
||||||
|
|
||||||
if (arts != null && arts.size() > 0) {
|
if (arts != null && !arts.isEmpty()) {
|
||||||
for (MtbColt mtbColt : mtbColts) {
|
for (MtbColt mtbColt : mtbColts) {
|
||||||
for (MtbColr mtbColr : mtbColt.getMtbColr()) {
|
for (MtbColr mtbColr : mtbColt.getMtbColr()) {
|
||||||
|
|
||||||
@ -336,7 +336,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
List<MtbAart> mtbAartStream = Stream.of(arts)
|
List<MtbAart> mtbAartStream = Stream.of(arts)
|
||||||
.filter(x -> x.getCodMart().equalsIgnoreCase(mtbColr.getCodMart())).toList();
|
.filter(x -> x.getCodMart().equalsIgnoreCase(mtbColr.getCodMart())).toList();
|
||||||
|
|
||||||
if (mtbAartStream != null && mtbAartStream.size() > 0) {
|
if (mtbAartStream != null && !mtbAartStream.isEmpty()) {
|
||||||
foundMtbAart = mtbAartStream.get(0);
|
foundMtbAart = mtbAartStream.get(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -392,7 +392,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
public void onResponse(Call<ServiceRESTResponse<MtbColt>> call, Response<ServiceRESTResponse<MtbColt>> response) {
|
public void onResponse(Call<ServiceRESTResponse<MtbColt>> call, Response<ServiceRESTResponse<MtbColt>> response) {
|
||||||
analyzeAnswer(response, "getColloInGiac", mtbColt -> {
|
analyzeAnswer(response, "getColloInGiac", mtbColt -> {
|
||||||
|
|
||||||
if (mtbColt != null && mtbColt.getMtbColr() != null && mtbColt.getMtbColr().size() > 0) {
|
if (mtbColt != null && mtbColt.getMtbColr() != null && !mtbColt.getMtbColr().isEmpty()) {
|
||||||
List<MtbColt> mtbColtList = new ArrayList<>();
|
List<MtbColt> mtbColtList = new ArrayList<>();
|
||||||
mtbColtList.add(mtbColt);
|
mtbColtList.add(mtbColt);
|
||||||
fillMtbAartsOfMtbColts(mtbColtList, mtbColts -> onComplete.run(mtbColts.get(0)), onFailed);
|
fillMtbAartsOfMtbColts(mtbColtList, mtbColts -> onComplete.run(mtbColts.get(0)), onFailed);
|
||||||
|
|||||||
@ -190,7 +190,7 @@ public class SettingsManager {
|
|||||||
mSystemRESTConsumer.getAvailableCodMdeps(availableCodMdeps -> {
|
mSystemRESTConsumer.getAvailableCodMdeps(availableCodMdeps -> {
|
||||||
dbSettingsModelIstance.setAvailableCodMdep(availableCodMdeps);
|
dbSettingsModelIstance.setAvailableCodMdep(availableCodMdeps);
|
||||||
|
|
||||||
if (availableCodMdeps == null || availableCodMdeps.size() == 0) {
|
if (availableCodMdeps == null || availableCodMdeps.isEmpty()) {
|
||||||
onFailed.run(new Exception(mContext.getText(R.string.no_codmdep_available).toString()));
|
onFailed.run(new Exception(mContext.getText(R.string.no_codmdep_available).toString()));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -51,7 +51,7 @@ public class PermissionsHelper {
|
|||||||
boolean allGranted = Stream.of(grantResults).allMatch(x -> x == PackageManager.PERMISSION_GRANTED);
|
boolean allGranted = Stream.of(grantResults).allMatch(x -> x == PackageManager.PERMISSION_GRANTED);
|
||||||
|
|
||||||
// If request is cancelled, the result arrays are empty.
|
// If request is cancelled, the result arrays are empty.
|
||||||
if (grantResults.size() > 0 && allGranted) {
|
if (!grantResults.isEmpty() && allGranted) {
|
||||||
onPermissionsConfirmed.run();
|
onPermissionsConfirmed.run();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -88,7 +88,7 @@ public class UtilityLogger {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return callerNew.length() > 0 ? callerNew.toString() : caller;
|
return !callerNew.isEmpty() ? callerNew.toString() : caller;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -37,7 +37,7 @@ public class UtilityPosizione {
|
|||||||
List<MtbDepoPosizione> tmpList = Stream.of(availablePosizioni)
|
List<MtbDepoPosizione> tmpList = Stream.of(availablePosizioni)
|
||||||
.filter(x -> x.getPosizione().equalsIgnoreCase(posizione)).toList();
|
.filter(x -> x.getPosizione().equalsIgnoreCase(posizione)).toList();
|
||||||
|
|
||||||
if(tmpList.size() > 0) return tmpList.get(0);
|
if(!tmpList.isEmpty()) return tmpList.get(0);
|
||||||
else return null;
|
else return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -377,7 +377,7 @@ public class AccettazioneBollaPickingActivity extends BaseActivity implements Ac
|
|||||||
//Calc Num CNF
|
//Calc Num CNF
|
||||||
BigDecimal numCnfEvasa = BigDecimal.ZERO;
|
BigDecimal numCnfEvasa = BigDecimal.ZERO;
|
||||||
|
|
||||||
if (x.getWithdrawMtbColrs().size() > 0) {
|
if (!x.getWithdrawMtbColrs().isEmpty()) {
|
||||||
numCnfEvasa = Stream.of(x.getWithdrawMtbColrs())
|
numCnfEvasa = Stream.of(x.getWithdrawMtbColrs())
|
||||||
.map(MtbColr::getNumCnf)
|
.map(MtbColr::getNumCnf)
|
||||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
@ -386,7 +386,7 @@ public class AccettazioneBollaPickingActivity extends BaseActivity implements Ac
|
|||||||
//Calc qta col
|
//Calc qta col
|
||||||
BigDecimal qtaEvasa = BigDecimal.ZERO;
|
BigDecimal qtaEvasa = BigDecimal.ZERO;
|
||||||
|
|
||||||
if (x.getWithdrawMtbColrs().size() > 0) {
|
if (!x.getWithdrawMtbColrs().isEmpty()) {
|
||||||
qtaEvasa = Stream.of(x.getWithdrawMtbColrs())
|
qtaEvasa = Stream.of(x.getWithdrawMtbColrs())
|
||||||
.map(MtbColr::getQtaCol)
|
.map(MtbColr::getQtaCol)
|
||||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
|||||||
@ -286,7 +286,7 @@ public class AccettazioneBollaPickingViewModel {
|
|||||||
private void loadArticolo(String barcodeProd, PickDataDTO pickData, Runnable onComplete) {
|
private void loadArticolo(String barcodeProd, PickDataDTO pickData, Runnable onComplete) {
|
||||||
this.mArticoloRESTConsumer.searchByBarcode(barcodeProd, mtbAartList -> {
|
this.mArticoloRESTConsumer.searchByBarcode(barcodeProd, mtbAartList -> {
|
||||||
|
|
||||||
if (mtbAartList != null && mtbAartList.size() > 0) {
|
if (mtbAartList != null && !mtbAartList.isEmpty()) {
|
||||||
this.searchArtFromAnag(mtbAartList.get(0), pickData, onComplete);
|
this.searchArtFromAnag(mtbAartList.get(0), pickData, onComplete);
|
||||||
} else {
|
} else {
|
||||||
this.manageUnknownBarcode(barcodeProd, onComplete);
|
this.manageUnknownBarcode(barcodeProd, onComplete);
|
||||||
@ -310,7 +310,7 @@ public class AccettazioneBollaPickingViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void loadMatchedRows(List<PickingObjectDTO> matchedRows, MtbAart mtbAart, PickDataDTO pickDataDTO) {
|
private void loadMatchedRows(List<PickingObjectDTO> matchedRows, MtbAart mtbAart, PickDataDTO pickDataDTO) {
|
||||||
if (matchedRows == null || matchedRows.size() == 0) {
|
if (matchedRows == null || matchedRows.isEmpty()) {
|
||||||
manageNoArtFound(mtbAart, pickDataDTO);
|
manageNoArtFound(mtbAart, pickDataDTO);
|
||||||
} else if (matchedRows.size() == 1) {
|
} else if (matchedRows.size() == 1) {
|
||||||
this.manageDispatchBollaRow(matchedRows.get(0));
|
this.manageDispatchBollaRow(matchedRows.get(0));
|
||||||
|
|||||||
@ -414,14 +414,14 @@ public class AccettazioneOrdiniPickingActivity extends BaseActivity implements A
|
|||||||
//Calc Num CNF
|
//Calc Num CNF
|
||||||
BigDecimal numCnfEvasa = BigDecimal.ZERO;
|
BigDecimal numCnfEvasa = BigDecimal.ZERO;
|
||||||
|
|
||||||
if (x.getWithdrawMtbColrs().size() > 0) {
|
if (!x.getWithdrawMtbColrs().isEmpty()) {
|
||||||
numCnfEvasa = Stream.of(x.getWithdrawMtbColrs()).map(MtbColr::getNumCnf).reduce(BigDecimal.ZERO, BigDecimal::add);
|
numCnfEvasa = Stream.of(x.getWithdrawMtbColrs()).map(MtbColr::getNumCnf).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Calc qta col
|
//Calc qta col
|
||||||
BigDecimal qtaEvasa = BigDecimal.ZERO;
|
BigDecimal qtaEvasa = BigDecimal.ZERO;
|
||||||
|
|
||||||
if (x.getWithdrawMtbColrs().size() > 0) {
|
if (!x.getWithdrawMtbColrs().isEmpty()) {
|
||||||
qtaEvasa = Stream.of(x.getWithdrawMtbColrs()).map(MtbColr::getQtaCol).reduce(BigDecimal.ZERO, BigDecimal::add);
|
qtaEvasa = Stream.of(x.getWithdrawMtbColrs()).map(MtbColr::getQtaCol).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -472,14 +472,14 @@ public class AccettazioneOrdiniPickingActivity extends BaseActivity implements A
|
|||||||
//Calc Num CNF
|
//Calc Num CNF
|
||||||
BigDecimal numCnfEvasa = BigDecimal.ZERO;
|
BigDecimal numCnfEvasa = BigDecimal.ZERO;
|
||||||
|
|
||||||
if (x.getWithdrawMtbColrs().size() > 0) {
|
if (!x.getWithdrawMtbColrs().isEmpty()) {
|
||||||
numCnfEvasa = Stream.of(x.getWithdrawMtbColrs()).map(MtbColr::getNumCnf).reduce(BigDecimal.ZERO, BigDecimal::add);
|
numCnfEvasa = Stream.of(x.getWithdrawMtbColrs()).map(MtbColr::getNumCnf).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Calc qta col
|
//Calc qta col
|
||||||
BigDecimal qtaEvasa = BigDecimal.ZERO;
|
BigDecimal qtaEvasa = BigDecimal.ZERO;
|
||||||
|
|
||||||
if (x.getWithdrawMtbColrs().size() > 0) {
|
if (!x.getWithdrawMtbColrs().isEmpty()) {
|
||||||
qtaEvasa = Stream.of(x.getWithdrawMtbColrs()).map(MtbColr::getQtaCol).reduce(BigDecimal.ZERO, BigDecimal::add);
|
qtaEvasa = Stream.of(x.getWithdrawMtbColrs()).map(MtbColr::getQtaCol).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -527,14 +527,14 @@ public class AccettazioneOrdiniPickingActivity extends BaseActivity implements A
|
|||||||
//Calc Num CNF
|
//Calc Num CNF
|
||||||
BigDecimal numCnfEvasa = BigDecimal.ZERO;
|
BigDecimal numCnfEvasa = BigDecimal.ZERO;
|
||||||
|
|
||||||
if (x.getWithdrawMtbColrs().size() > 0) {
|
if (!x.getWithdrawMtbColrs().isEmpty()) {
|
||||||
numCnfEvasa = Stream.of(x.getWithdrawMtbColrs()).map(MtbColr::getNumCnf).reduce(BigDecimal.ZERO, BigDecimal::add);
|
numCnfEvasa = Stream.of(x.getWithdrawMtbColrs()).map(MtbColr::getNumCnf).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Calc qta col
|
//Calc qta col
|
||||||
BigDecimal qtaEvasa = BigDecimal.ZERO;
|
BigDecimal qtaEvasa = BigDecimal.ZERO;
|
||||||
|
|
||||||
if (x.getWithdrawMtbColrs().size() > 0) {
|
if (!x.getWithdrawMtbColrs().isEmpty()) {
|
||||||
qtaEvasa = Stream.of(x.getWithdrawMtbColrs()).map(MtbColr::getQtaCol).reduce(BigDecimal.ZERO, BigDecimal::add);
|
qtaEvasa = Stream.of(x.getWithdrawMtbColrs()).map(MtbColr::getQtaCol).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -583,14 +583,14 @@ public class AccettazioneOrdiniPickingActivity extends BaseActivity implements A
|
|||||||
//Calc Num CNF
|
//Calc Num CNF
|
||||||
BigDecimal numCnfEvasa = BigDecimal.ZERO;
|
BigDecimal numCnfEvasa = BigDecimal.ZERO;
|
||||||
|
|
||||||
if (x.getWithdrawMtbColrs().size() > 0) {
|
if (!x.getWithdrawMtbColrs().isEmpty()) {
|
||||||
numCnfEvasa = Stream.of(x.getWithdrawMtbColrs()).map(MtbColr::getNumCnf).reduce(BigDecimal.ZERO, BigDecimal::add);
|
numCnfEvasa = Stream.of(x.getWithdrawMtbColrs()).map(MtbColr::getNumCnf).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Calc qta col
|
//Calc qta col
|
||||||
BigDecimal qtaEvasa = BigDecimal.ZERO;
|
BigDecimal qtaEvasa = BigDecimal.ZERO;
|
||||||
|
|
||||||
if (x.getWithdrawMtbColrs().size() > 0) {
|
if (!x.getWithdrawMtbColrs().isEmpty()) {
|
||||||
qtaEvasa = Stream.of(x.getWithdrawMtbColrs()).map(MtbColr::getQtaCol).reduce(BigDecimal.ZERO, BigDecimal::add);
|
qtaEvasa = Stream.of(x.getWithdrawMtbColrs()).map(MtbColr::getQtaCol).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -369,7 +369,7 @@ public class AccettazioneOrdiniPickingViewModel {
|
|||||||
private void loadArticolo(String barcodeProd, PickDataDTO pickData, Runnable onComplete) {
|
private void loadArticolo(String barcodeProd, PickDataDTO pickData, Runnable onComplete) {
|
||||||
this.mArticoloRESTConsumer.searchByBarcode(barcodeProd, mtbAartList -> {
|
this.mArticoloRESTConsumer.searchByBarcode(barcodeProd, mtbAartList -> {
|
||||||
|
|
||||||
if (mtbAartList != null && mtbAartList.size() > 0) {
|
if (mtbAartList != null && !mtbAartList.isEmpty()) {
|
||||||
this.searchArtFromAnag(mtbAartList.get(0), pickData, onComplete);
|
this.searchArtFromAnag(mtbAartList.get(0), pickData, onComplete);
|
||||||
} else {
|
} else {
|
||||||
this.sendError(new NoResultFromBarcodeException(barcodeProd));
|
this.sendError(new NoResultFromBarcodeException(barcodeProd));
|
||||||
|
|||||||
@ -208,13 +208,13 @@ public class OrdiniUscitaElencoViewModel {
|
|||||||
private void executeEtichettaLU(String SSCC, RunnableArgs<List<OrdiniUscitaElencoDTO>> onComplete) {
|
private void executeEtichettaLU(String SSCC, RunnableArgs<List<OrdiniUscitaElencoDTO>> onComplete) {
|
||||||
this.mColliMagazzinoRESTConsumer.getBySSCC(SSCC, true, false, mtbColt -> {
|
this.mColliMagazzinoRESTConsumer.getBySSCC(SSCC, true, false, mtbColt -> {
|
||||||
|
|
||||||
if (mtbColt != null && mtbColt.getMtbColr() != null && mtbColt.getMtbColr().size() > 0) {
|
if (mtbColt != null && mtbColt.getMtbColr() != null && !mtbColt.getMtbColr().isEmpty()) {
|
||||||
|
|
||||||
if (mtbColt.getGestioneEnum() == GestioneEnum.ACQUISTO || mtbColt.getGestioneEnum() == GestioneEnum.LAVORAZIONE) {
|
if (mtbColt.getGestioneEnum() == GestioneEnum.ACQUISTO || mtbColt.getGestioneEnum() == GestioneEnum.LAVORAZIONE) {
|
||||||
//GET BY COMMESSA COLLO
|
//GET BY COMMESSA COLLO
|
||||||
this.mOrdiniUscitaElencoRESTConsumer.getOrdiniFromCommessaCollo(mCurrentCodMdep, mtbColt, orderList -> {
|
this.mOrdiniUscitaElencoRESTConsumer.getOrdiniFromCommessaCollo(mCurrentCodMdep, mtbColt, orderList -> {
|
||||||
|
|
||||||
if (orderList != null && orderList.size() > 0) {
|
if (orderList != null && !orderList.isEmpty()) {
|
||||||
List<Integer> numOrds = Stream.of(orderList)
|
List<Integer> numOrds = Stream.of(orderList)
|
||||||
.map(DtbOrdt::getNumOrd)
|
.map(DtbOrdt::getNumOrd)
|
||||||
.toList();
|
.toList();
|
||||||
|
|||||||
@ -247,12 +247,12 @@ public class PickingLiberoFragment extends BaseFragment implements ITitledFragme
|
|||||||
initAdapter();
|
initAdapter();
|
||||||
|
|
||||||
thereIsAnOpenedUL.set(true);
|
thereIsAnOpenedUL.set(true);
|
||||||
thereIsAnyRowInUL.set(mtbColt.getMtbColr().size() > 0, true);
|
thereIsAnyRowInUL.set(!mtbColt.getMtbColr().isEmpty(), true);
|
||||||
|
|
||||||
mtbColt.getMtbColr().addOnListChangedCallback(new OnListGeneralChangedCallback() {
|
mtbColt.getMtbColr().addOnListChangedCallback(new OnListGeneralChangedCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onChanged(ObservableList sender) {
|
public void onChanged(ObservableList sender) {
|
||||||
thereIsAnyRowInUL.set(mtbColt.getMtbColr().size() > 0, true);
|
thereIsAnyRowInUL.set(!mtbColt.getMtbColr().isEmpty(), true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -215,7 +215,7 @@ public class PickingLiberoViewModel {
|
|||||||
private void executePosizione(MtbDepoPosizione posizione, MtbAart articolo, Runnable onComplete) {
|
private void executePosizione(MtbDepoPosizione posizione, MtbAart articolo, Runnable onComplete) {
|
||||||
this.mPosizioniRESTConsumer.getBancaliInPosizione(posizione, mtbColtList -> {
|
this.mPosizioniRESTConsumer.getBancaliInPosizione(posizione, mtbColtList -> {
|
||||||
|
|
||||||
if (mtbColtList == null || mtbColtList.size() == 0) {
|
if (mtbColtList == null || mtbColtList.isEmpty()) {
|
||||||
if (articolo != null) {
|
if (articolo != null) {
|
||||||
this.dispatchArt(articolo, null);
|
this.dispatchArt(articolo, null);
|
||||||
} else {
|
} else {
|
||||||
@ -298,7 +298,7 @@ public class PickingLiberoViewModel {
|
|||||||
|
|
||||||
private void loadArticolo(String barcodeProd, Ean128Model ean128Model, Runnable onComplete) {
|
private void loadArticolo(String barcodeProd, Ean128Model ean128Model, Runnable onComplete) {
|
||||||
mArticoloRESTConsumer.searchByBarcode(barcodeProd, mtbAartList -> {
|
mArticoloRESTConsumer.searchByBarcode(barcodeProd, mtbAartList -> {
|
||||||
if (mtbAartList != null && mtbAartList.size() > 0) {
|
if (mtbAartList != null && !mtbAartList.isEmpty()) {
|
||||||
MtbAart articolo = mtbAartList.get(0);
|
MtbAart articolo = mtbAartList.get(0);
|
||||||
MtbDepoPosizione posizione = UtilityPosizione.getFromCache(articolo.getPosizione());
|
MtbDepoPosizione posizione = UtilityPosizione.getFromCache(articolo.getPosizione());
|
||||||
|
|
||||||
@ -730,7 +730,7 @@ public class PickingLiberoViewModel {
|
|||||||
|
|
||||||
MtbColr mtbColrRif = null;
|
MtbColr mtbColrRif = null;
|
||||||
|
|
||||||
if (mtbColrRifs != null && mtbColrRifs.size() > 0) {
|
if (mtbColrRifs != null && !mtbColrRifs.isEmpty()) {
|
||||||
//TODO: Da capire se è necessario controllare anche il cod_jcom
|
//TODO: Da capire se è necessario controllare anche il cod_jcom
|
||||||
mtbColrRif = Stream.of(mtbColrRifs)
|
mtbColrRif = Stream.of(mtbColrRifs)
|
||||||
.filter(x -> UtilityString.equalsIgnoreCase(x.getCodMart(), mtbColrToUpdate.getCodMart()) &&
|
.filter(x -> UtilityString.equalsIgnoreCase(x.getCodMart(), mtbColrToUpdate.getCodMart()) &&
|
||||||
|
|||||||
@ -332,7 +332,7 @@ public class PickingResiViewModel {
|
|||||||
private void executeEtichettaLU(String SSCC, Runnable onComplete) {
|
private void executeEtichettaLU(String SSCC, Runnable onComplete) {
|
||||||
mColliMagazzinoRESTConsumer.getBySSCC(SSCC, true, false, mtbColt -> {
|
mColliMagazzinoRESTConsumer.getBySSCC(SSCC, true, false, mtbColt -> {
|
||||||
|
|
||||||
if (mtbColt != null && mtbColt.getMtbColr() != null && mtbColt.getMtbColr().size() > 0) {
|
if (mtbColt != null && mtbColt.getMtbColr() != null && !mtbColt.getMtbColr().isEmpty()) {
|
||||||
if (mtbColt.getSegno() != -1) {
|
if (mtbColt.getSegno() != -1) {
|
||||||
searchArtFromUL(mtbColt, onComplete);
|
searchArtFromUL(mtbColt, onComplete);
|
||||||
} else this.sendError(new InvalidLUException());
|
} else this.sendError(new InvalidLUException());
|
||||||
@ -420,7 +420,7 @@ public class PickingResiViewModel {
|
|||||||
|
|
||||||
|
|
||||||
private void loadMatchedRows(List<WithdrawableDtbDocr> matchedRows) {
|
private void loadMatchedRows(List<WithdrawableDtbDocr> matchedRows) {
|
||||||
if (matchedRows == null || matchedRows.size() == 0) {
|
if (matchedRows == null || matchedRows.isEmpty()) {
|
||||||
this.sendError(new NoResultFromBarcodeException());
|
this.sendError(new NoResultFromBarcodeException());
|
||||||
} else if (matchedRows.size() == 1) {
|
} else if (matchedRows.size() == 1) {
|
||||||
WithdrawableDtbDocr matchedItem = matchedRows.get(0);
|
WithdrawableDtbDocr matchedItem = matchedRows.get(0);
|
||||||
@ -464,7 +464,7 @@ public class PickingResiViewModel {
|
|||||||
MtbColr mtbColrToDispatch = withdrawableDtbDocr.getTempPickData() != null &&
|
MtbColr mtbColrToDispatch = withdrawableDtbDocr.getTempPickData() != null &&
|
||||||
withdrawableDtbDocr.getTempPickData().getSourceMtbColt() != null &&
|
withdrawableDtbDocr.getTempPickData().getSourceMtbColt() != null &&
|
||||||
withdrawableDtbDocr.getTempPickData().getSourceMtbColt().getMtbColr() != null &&
|
withdrawableDtbDocr.getTempPickData().getSourceMtbColt().getMtbColr() != null &&
|
||||||
withdrawableDtbDocr.getTempPickData().getSourceMtbColt().getMtbColr().size() > 0 ?
|
!withdrawableDtbDocr.getTempPickData().getSourceMtbColt().getMtbColr().isEmpty() ?
|
||||||
withdrawableDtbDocr.getTempPickData().getSourceMtbColt().getMtbColr().get(0) : null;
|
withdrawableDtbDocr.getTempPickData().getSourceMtbColt().getMtbColr().get(0) : null;
|
||||||
|
|
||||||
BigDecimal totalAvailableQtaCol;
|
BigDecimal totalAvailableQtaCol;
|
||||||
@ -553,7 +553,7 @@ public class PickingResiViewModel {
|
|||||||
MtbColr mtbColrToDispatch = withdrawableDtbDocr.getTempPickData() != null &&
|
MtbColr mtbColrToDispatch = withdrawableDtbDocr.getTempPickData() != null &&
|
||||||
withdrawableDtbDocr.getTempPickData().getSourceMtbColt() != null &&
|
withdrawableDtbDocr.getTempPickData().getSourceMtbColt() != null &&
|
||||||
withdrawableDtbDocr.getTempPickData().getSourceMtbColt().getMtbColr() != null &&
|
withdrawableDtbDocr.getTempPickData().getSourceMtbColt().getMtbColr() != null &&
|
||||||
withdrawableDtbDocr.getTempPickData().getSourceMtbColt().getMtbColr().size() > 0 ?
|
!withdrawableDtbDocr.getTempPickData().getSourceMtbColt().getMtbColr().isEmpty() ?
|
||||||
withdrawableDtbDocr.getTempPickData().getSourceMtbColt().getMtbColr().get(0) : null;
|
withdrawableDtbDocr.getTempPickData().getSourceMtbColt().getMtbColr().get(0) : null;
|
||||||
|
|
||||||
if (mtbColrToDispatch != null) {
|
if (mtbColrToDispatch != null) {
|
||||||
@ -593,7 +593,7 @@ public class PickingResiViewModel {
|
|||||||
boolean shouldPrint = true;
|
boolean shouldPrint = true;
|
||||||
|
|
||||||
//Se è l'unico articolo del collo (controllo se è uguale a 0 perché ancora non è stato aggiunto nella lista delle righe)
|
//Se è l'unico articolo del collo (controllo se è uguale a 0 perché ancora non è stato aggiunto nella lista delle righe)
|
||||||
if (shouldCloseLU && mCurrentMtbColt.getMtbColr().size() == 0) {
|
if (shouldCloseLU && mCurrentMtbColt.getMtbColr().isEmpty()) {
|
||||||
shouldPrint = false;
|
shouldPrint = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -56,7 +56,7 @@ public class PickingResiRESTConsumer {
|
|||||||
Type typeOfObjectsList = new TypeToken<ArrayList<WithdrawableDtbDocr>>() {}.getType();
|
Type typeOfObjectsList = new TypeToken<ArrayList<WithdrawableDtbDocr>>() {}.getType();
|
||||||
this.mSystemRestConsumer.<ArrayList<WithdrawableDtbDocr>>processSql(sql, typeOfObjectsList, values -> {
|
this.mSystemRestConsumer.<ArrayList<WithdrawableDtbDocr>>processSql(sql, typeOfObjectsList, values -> {
|
||||||
|
|
||||||
if(values != null && values.size() > 0){
|
if(values != null && !values.isEmpty()){
|
||||||
List<String> codMarts = Stream.of(values)
|
List<String> codMarts = Stream.of(values)
|
||||||
.map(DtbDocr::getCodMart)
|
.map(DtbDocr::getCodMart)
|
||||||
.withoutNulls()
|
.withoutNulls()
|
||||||
@ -65,7 +65,7 @@ public class PickingResiRESTConsumer {
|
|||||||
|
|
||||||
mArticoloRESTConsumer.getByCodMarts(codMarts, arts -> {
|
mArticoloRESTConsumer.getByCodMarts(codMarts, arts -> {
|
||||||
|
|
||||||
if(arts != null && arts.size() > 0) {
|
if(arts != null && !arts.isEmpty()) {
|
||||||
for (DtbDocr value : values) {
|
for (DtbDocr value : values) {
|
||||||
|
|
||||||
MtbAart foundMtbAart = null;
|
MtbAart foundMtbAart = null;
|
||||||
@ -73,7 +73,7 @@ public class PickingResiRESTConsumer {
|
|||||||
List<MtbAart> mtbAartStream = Stream.of(arts)
|
List<MtbAart> mtbAartStream = Stream.of(arts)
|
||||||
.filter(x -> x.getCodMart().equalsIgnoreCase(value.getCodMart())).toList();
|
.filter(x -> x.getCodMart().equalsIgnoreCase(value.getCodMart())).toList();
|
||||||
|
|
||||||
if(mtbAartStream != null && mtbAartStream.size() > 0){
|
if(mtbAartStream != null && !mtbAartStream.isEmpty()){
|
||||||
foundMtbAart = mtbAartStream.get(0);
|
foundMtbAart = mtbAartStream.get(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -99,7 +99,7 @@ public class ProdDettaglioLineaViewModel {
|
|||||||
|
|
||||||
private void checkOrdersCompatibility(MtbColt mtbColt, Runnable onComplete) {
|
private void checkOrdersCompatibility(MtbColt mtbColt, Runnable onComplete) {
|
||||||
mesRESTConsumer.getOrdiniLavorazioneMateriale(lineaProd.getValue().getCodJfas(), getIdMaterialeFromCollo(mtbColt), ordini -> {
|
mesRESTConsumer.getOrdiniLavorazioneMateriale(lineaProd.getValue().getCodJfas(), getIdMaterialeFromCollo(mtbColt), ordini -> {
|
||||||
if (ordini != null && ordini.size() > 0) {
|
if (ordini != null && !ordini.isEmpty()) {
|
||||||
onComplete.run();
|
onComplete.run();
|
||||||
} else {
|
} else {
|
||||||
this.mListener.confirmInconsistentDeposit(onComplete);
|
this.mListener.confirmInconsistentDeposit(onComplete);
|
||||||
|
|||||||
@ -70,7 +70,7 @@ public class DialogAskMagazzinoProssimitaAdapter extends ArrayAdapter<JtbFasi> i
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (prefix == null || prefix.length() == 0) {
|
if (prefix == null || prefix.isEmpty()) {
|
||||||
synchronized (lock) {
|
synchronized (lock) {
|
||||||
results.values = mDatasetAllItems;
|
results.values = mDatasetAllItems;
|
||||||
results.count = mDatasetAllItems.size();
|
results.count = mDatasetAllItems.size();
|
||||||
|
|||||||
@ -287,7 +287,7 @@ public class ProdRecuperoMaterialeRESTConsumer extends _BaseRESTConsumer {
|
|||||||
List<MtbAart> mtbAartStream = Stream.of(arts)
|
List<MtbAart> mtbAartStream = Stream.of(arts)
|
||||||
.filter(x -> x.getCodMart().equalsIgnoreCase(value.getCodMart())).toList();
|
.filter(x -> x.getCodMart().equalsIgnoreCase(value.getCodMart())).toList();
|
||||||
|
|
||||||
if (mtbAartStream != null && mtbAartStream.size() > 0) {
|
if (mtbAartStream != null && !mtbAartStream.isEmpty()) {
|
||||||
foundMtbAart = mtbAartStream.get(0);
|
foundMtbAart = mtbAartStream.get(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -255,12 +255,12 @@ public class ProdVersamentoMaterialeFragment extends BaseFragment implements Pro
|
|||||||
.mapToInt(x -> x.getOriginalOrdineLavorazione().getHrNum())
|
.mapToInt(x -> x.getOriginalOrdineLavorazione().getHrNum())
|
||||||
.sum();
|
.sum();
|
||||||
|
|
||||||
if (selectedOrders.size() > 0 && totalHr <= 0) {
|
if (!selectedOrders.isEmpty() && totalHr <= 0) {
|
||||||
this.onError(new Exception("Il totale delle <b>risorse umane</b> è pari a 0"));
|
this.onError(new Exception("Il totale delle <b>risorse umane</b> è pari a 0"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
fabVisible.set(selectedOrders.size() > 0);
|
fabVisible.set(!selectedOrders.isEmpty());
|
||||||
|
|
||||||
for (VersamentoMerceOrdineLavListModel versamentoMerceOrdineLavListModel : this.mCurrentOrders) {
|
for (VersamentoMerceOrdineLavListModel versamentoMerceOrdineLavListModel : this.mCurrentOrders) {
|
||||||
versamentoMerceOrdineLavListModel.setNumCnfBigDecimal(BigDecimal.ZERO);
|
versamentoMerceOrdineLavListModel.setNumCnfBigDecimal(BigDecimal.ZERO);
|
||||||
@ -304,7 +304,7 @@ public class ProdVersamentoMaterialeFragment extends BaseFragment implements Pro
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (selectedOrders.size() > 0) {
|
if (!selectedOrders.isEmpty()) {
|
||||||
VersamentoMerceOrdineLavListModel majorOrder =
|
VersamentoMerceOrdineLavListModel majorOrder =
|
||||||
Stream.of(selectedOrders)
|
Stream.of(selectedOrders)
|
||||||
.max((o1, o2) -> Integer.compare(o1.getOriginalOrdineLavorazione().getHrNum(), o2.getOriginalOrdineLavorazione().getHrNum())).get();
|
.max((o1, o2) -> Integer.compare(o1.getOriginalOrdineLavorazione().getHrNum(), o2.getOriginalOrdineLavorazione().getHrNum())).get();
|
||||||
@ -334,7 +334,7 @@ public class ProdVersamentoMaterialeFragment extends BaseFragment implements Pro
|
|||||||
.map(VersamentoMerceOrdineLavListModel::getOriginalOrdineLavorazione)
|
.map(VersamentoMerceOrdineLavListModel::getOriginalOrdineLavorazione)
|
||||||
.toList();
|
.toList();
|
||||||
|
|
||||||
if (selectedOrders.size() > 0) {
|
if (!selectedOrders.isEmpty()) {
|
||||||
this.mViewModel.save(selectedOrders);
|
this.mViewModel.save(selectedOrders);
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(requireActivity(), "Nessun ordine selezionato!", Toast.LENGTH_SHORT).show();
|
Toast.makeText(requireActivity(), "Nessun ordine selezionato!", Toast.LENGTH_SHORT).show();
|
||||||
|
|||||||
@ -106,7 +106,7 @@ public class ProdVersamentoMaterialeViewModel {
|
|||||||
private void executePosizione(MtbDepoPosizione posizione) {
|
private void executePosizione(MtbDepoPosizione posizione) {
|
||||||
this.mPosizioniRESTConsumer.getBancaliInPosizione(posizione, mtbColtList -> {
|
this.mPosizioniRESTConsumer.getBancaliInPosizione(posizione, mtbColtList -> {
|
||||||
|
|
||||||
if (mtbColtList == null || mtbColtList.size() == 0) {
|
if (mtbColtList == null || mtbColtList.isEmpty()) {
|
||||||
this.sendError(new NoLUFoundException());
|
this.sendError(new NoLUFoundException());
|
||||||
} else if (mtbColtList.size() == 1) {
|
} else if (mtbColtList.size() == 1) {
|
||||||
this.mColliMagazzinoRESTConsumer.getByTestata(mtbColtList.get(0), true, false, mtbColt -> {
|
this.mColliMagazzinoRESTConsumer.getByTestata(mtbColtList.get(0), true, false, mtbColt -> {
|
||||||
@ -172,7 +172,7 @@ public class ProdVersamentoMaterialeViewModel {
|
|||||||
|
|
||||||
private void loadArticolo(String barcodeProd, Ean128Model ean128Model) {
|
private void loadArticolo(String barcodeProd, Ean128Model ean128Model) {
|
||||||
mArticoloRESTConsumer.searchByBarcode(barcodeProd, mtbAartList -> {
|
mArticoloRESTConsumer.searchByBarcode(barcodeProd, mtbAartList -> {
|
||||||
if (mtbAartList != null && mtbAartList.size() > 0) {
|
if (mtbAartList != null && !mtbAartList.isEmpty()) {
|
||||||
MtbAart articolo = mtbAartList.get(0);
|
MtbAart articolo = mtbAartList.get(0);
|
||||||
this.dispatchArt(articolo, ean128Model);
|
this.dispatchArt(articolo, ean128Model);
|
||||||
|
|
||||||
|
|||||||
@ -76,7 +76,7 @@ public class ProdVersamentoMaterialeInBufferFragment extends BaseFragment implem
|
|||||||
mtbColt.getGestioneEnum() == GestioneEnum.VENDITA) &&
|
mtbColt.getGestioneEnum() == GestioneEnum.VENDITA) &&
|
||||||
mtbColt.getSegno() == 1) {
|
mtbColt.getSegno() == 1) {
|
||||||
|
|
||||||
if (mtbColt.getMtbColr() == null || mtbColt.getMtbColr().size() == 0) {
|
if (mtbColt.getMtbColr() == null || mtbColt.getMtbColr().isEmpty()) {
|
||||||
DialogSimpleMessageView.makeWarningDialog(
|
DialogSimpleMessageView.makeWarningDialog(
|
||||||
new SpannableString(Html.fromHtml("E' stata scansionata una UL già vuota")),
|
new SpannableString(Html.fromHtml("E' stata scansionata una UL già vuota")),
|
||||||
null, this::openLU)
|
null, this::openLU)
|
||||||
|
|||||||
@ -109,9 +109,9 @@ public class PVOrdineAcquistoEditActivity extends BaseActivity implements PVOrdi
|
|||||||
|
|
||||||
this.mViewModel.getArticoli().observe(this, articoli -> {
|
this.mViewModel.getArticoli().observe(this, articoli -> {
|
||||||
mBinding.countArtOrd.setText(String.valueOf(articoli.size()));
|
mBinding.countArtOrd.setText(String.valueOf(articoli.size()));
|
||||||
mBinding.pvOrdineExport.setVisibility(articoli.size() > 0 ? View.INVISIBLE : View.GONE);
|
mBinding.pvOrdineExport.setVisibility(!articoli.isEmpty() ? View.INVISIBLE : View.GONE);
|
||||||
mBinding.closeActivityFab.close(false);
|
mBinding.closeActivityFab.close(false);
|
||||||
mBinding.scanArtSpinner.setVisibility(articoli.size() > 0 ? View.GONE : View.VISIBLE);
|
mBinding.scanArtSpinner.setVisibility(!articoli.isEmpty() ? View.GONE : View.VISIBLE);
|
||||||
|
|
||||||
if (ordine.isOrderNewProducts() && articoli.isEmpty() && isOrderNewProdsForced()) {
|
if (ordine.isOrderNewProducts() && articoli.isEmpty() && isOrderNewProdsForced()) {
|
||||||
this.mViewModel.orderNewProducts();
|
this.mViewModel.orderNewProducts();
|
||||||
|
|||||||
@ -187,7 +187,7 @@ public class PVOrdiniAcquistoGrigliaFragment extends BaseFragment implements ITi
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void setOrdini(List<OrdineWrapper> ordini) {
|
private void setOrdini(List<OrdineWrapper> ordini) {
|
||||||
mBinding.ordiniAApertiMainList.setVisibility(ordini != null && ordini.size() > 0 ? View.VISIBLE : View.GONE);
|
mBinding.ordiniAApertiMainList.setVisibility(ordini != null && !ordini.isEmpty() ? View.VISIBLE : View.GONE);
|
||||||
mBinding.ordiniAEmptyView.setVisibility(ordini == null || ordini.size() <= 0 ? View.VISIBLE : View.GONE);
|
mBinding.ordiniAEmptyView.setVisibility(ordini == null || ordini.size() <= 0 ? View.VISIBLE : View.GONE);
|
||||||
refreshRenderedOrdini(ordini);
|
refreshRenderedOrdini(ordini);
|
||||||
mAdapter.updateItems(mRenderedOrderList);
|
mAdapter.updateItems(mRenderedOrderList);
|
||||||
|
|||||||
@ -369,7 +369,7 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
boolean anyLUPresent = x.getMtbColts() != null && x.getMtbColts().size() > 0;
|
boolean anyLUPresent = x.getMtbColts() != null && !x.getMtbColts().isEmpty();
|
||||||
|
|
||||||
spedizioneListModel.setActive(mEnableFakeGiacenza || anyLUPresent);
|
spedizioneListModel.setActive(mEnableFakeGiacenza || anyLUPresent);
|
||||||
|
|
||||||
@ -422,7 +422,7 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
|||||||
|
|
||||||
cloneModel.setGroupTitle(String.format("%s: %s", getString(R.string.position_text), UtilityString.isNullOrEmpty(mtbColtToPick.getPosizione()) ? "N.A." : mtbColtToPick.getPosizione()));
|
cloneModel.setGroupTitle(String.format("%s: %s", getString(R.string.position_text), UtilityString.isNullOrEmpty(mtbColtToPick.getPosizione()) ? "N.A." : mtbColtToPick.getPosizione()));
|
||||||
|
|
||||||
MtbColr mtbColrToDispatch = mtbColtToPick.getMtbColr() != null && mtbColtToPick.getMtbColr().size() > 0 ? mtbColtToPick.getMtbColr().get(0) : null;
|
MtbColr mtbColrToDispatch = mtbColtToPick.getMtbColr() != null && !mtbColtToPick.getMtbColr().isEmpty() ? mtbColtToPick.getMtbColr().get(0) : null;
|
||||||
if (mtbColrToDispatch != null) {
|
if (mtbColrToDispatch != null) {
|
||||||
if (!UtilityString.isNullOrEmpty(mtbColrToDispatch.getPartitaMag()))
|
if (!UtilityString.isNullOrEmpty(mtbColrToDispatch.getPartitaMag()))
|
||||||
cloneModel.setSubDescrizione1(String.format(getString(R.string.batch_lot_text), mtbColrToDispatch.getPartitaMag()));
|
cloneModel.setSubDescrizione1(String.format(getString(R.string.batch_lot_text), mtbColrToDispatch.getPartitaMag()));
|
||||||
@ -539,7 +539,7 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
boolean anyLUPresent = x.getMtbColts() != null && x.getMtbColts().size() > 0;
|
boolean anyLUPresent = x.getMtbColts() != null && !x.getMtbColts().isEmpty();
|
||||||
|
|
||||||
spedizioneListModel.setActive(mEnableFakeGiacenza || anyLUPresent);
|
spedizioneListModel.setActive(mEnableFakeGiacenza || anyLUPresent);
|
||||||
|
|
||||||
@ -595,7 +595,7 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
|||||||
SpedizioneListModel cloneModel = (SpedizioneListModel) spedizioneListModel.clone();
|
SpedizioneListModel cloneModel = (SpedizioneListModel) spedizioneListModel.clone();
|
||||||
|
|
||||||
|
|
||||||
MtbColr mtbColrToDispatch = mtbColtToPick.getMtbColr() != null && mtbColtToPick.getMtbColr().size() > 0 ? mtbColtToPick.getMtbColr().get(0) : null;
|
MtbColr mtbColrToDispatch = mtbColtToPick.getMtbColr() != null && !mtbColtToPick.getMtbColr().isEmpty() ? mtbColtToPick.getMtbColr().get(0) : null;
|
||||||
if (mtbColrToDispatch != null) {
|
if (mtbColrToDispatch != null) {
|
||||||
if (!UtilityString.isNullOrEmpty(mtbColrToDispatch.getPartitaMag()))
|
if (!UtilityString.isNullOrEmpty(mtbColrToDispatch.getPartitaMag()))
|
||||||
cloneModel.setSubDescrizione1(String.format(getString(R.string.batch_lot_text), mtbColrToDispatch.getPartitaMag()));
|
cloneModel.setSubDescrizione1(String.format(getString(R.string.batch_lot_text), mtbColrToDispatch.getPartitaMag()));
|
||||||
|
|||||||
@ -614,7 +614,7 @@ public class SpedizioneViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
mColliMagazzinoRESTConsumer.getByTestata(mtbColtList.get(0), true, false, mtbColt -> {
|
mColliMagazzinoRESTConsumer.getByTestata(mtbColtList.get(0), true, false, mtbColt -> {
|
||||||
if (mtbColt != null && mtbColt.getMtbColr() != null && mtbColt.getMtbColr().size() > 0) {
|
if (mtbColt != null && mtbColt.getMtbColr() != null && !mtbColt.getMtbColr().isEmpty()) {
|
||||||
|
|
||||||
boolean codMdepIsValid = SettingsManager.iDB().getAvailableCodMdep().stream()
|
boolean codMdepIsValid = SettingsManager.iDB().getAvailableCodMdep().stream()
|
||||||
.anyMatch(x -> x.getCodMdep().equalsIgnoreCase(mtbColt.getCodMdep()));
|
.anyMatch(x -> x.getCodMdep().equalsIgnoreCase(mtbColt.getCodMdep()));
|
||||||
@ -636,7 +636,7 @@ public class SpedizioneViewModel {
|
|||||||
private void executeEtichettaLU(String SSCC, Runnable onComplete) {
|
private void executeEtichettaLU(String SSCC, Runnable onComplete) {
|
||||||
mColliMagazzinoRESTConsumer.getBySSCC(SSCC, true, false, mtbColt -> {
|
mColliMagazzinoRESTConsumer.getBySSCC(SSCC, true, false, mtbColt -> {
|
||||||
|
|
||||||
if (mtbColt != null && mtbColt.getMtbColr() != null && mtbColt.getMtbColr().size() > 0) {
|
if (mtbColt != null && mtbColt.getMtbColr() != null && !mtbColt.getMtbColr().isEmpty()) {
|
||||||
if (mtbColt.getSegno() != -1) {
|
if (mtbColt.getSegno() != -1) {
|
||||||
|
|
||||||
boolean codMdepIsValid = SettingsManager.iDB().getAvailableCodMdep().stream()
|
boolean codMdepIsValid = SettingsManager.iDB().getAvailableCodMdep().stream()
|
||||||
@ -1135,7 +1135,7 @@ public class SpedizioneViewModel {
|
|||||||
private void loadProductLotStatus(String codMart, String partitaMag, RunnableArgs<StatoArticoloDTO> onComplete) {
|
private void loadProductLotStatus(String codMart, String partitaMag, RunnableArgs<StatoArticoloDTO> onComplete) {
|
||||||
this.sendOnLoadingStarted();
|
this.sendOnLoadingStarted();
|
||||||
this.mArticoloRESTConsumer.getStatoPartita(codMart, partitaMag, stati -> {
|
this.mArticoloRESTConsumer.getStatoPartita(codMart, partitaMag, stati -> {
|
||||||
onComplete.run(stati.size() > 0 ? stati.get(0) : null);
|
onComplete.run(!stati.isEmpty() ? stati.get(0) : null);
|
||||||
}, this::sendError);
|
}, this::sendError);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1306,7 +1306,7 @@ public class SpedizioneViewModel {
|
|||||||
|
|
||||||
MtbColr mtbColrRif = null;
|
MtbColr mtbColrRif = null;
|
||||||
|
|
||||||
if (mtbColrRifs != null && mtbColrRifs.size() > 0) {
|
if (mtbColrRifs != null && !mtbColrRifs.isEmpty()) {
|
||||||
//TODO: Da capire se è necessario controllare anche il cod_jcom
|
//TODO: Da capire se è necessario controllare anche il cod_jcom
|
||||||
Optional<MtbColr> optionalMtbColr =
|
Optional<MtbColr> optionalMtbColr =
|
||||||
mtbColrRifs.stream()
|
mtbColrRifs.stream()
|
||||||
@ -1407,10 +1407,10 @@ public class SpedizioneViewModel {
|
|||||||
final MtbColr mtbColrToDispatch = pickingObjectDTO.getTempPickData() != null &&
|
final MtbColr mtbColrToDispatch = pickingObjectDTO.getTempPickData() != null &&
|
||||||
pickingObjectDTO.getTempPickData().getSourceMtbColt() != null &&
|
pickingObjectDTO.getTempPickData().getSourceMtbColt() != null &&
|
||||||
pickingObjectDTO.getTempPickData().getSourceMtbColt().getMtbColr() != null &&
|
pickingObjectDTO.getTempPickData().getSourceMtbColt().getMtbColr() != null &&
|
||||||
pickingObjectDTO.getTempPickData().getSourceMtbColt().getMtbColr().size() > 0 ?
|
!pickingObjectDTO.getTempPickData().getSourceMtbColt().getMtbColr().isEmpty() ?
|
||||||
pickingObjectDTO.getTempPickData().getSourceMtbColt().getMtbColr().get(0) : null;
|
pickingObjectDTO.getTempPickData().getSourceMtbColt().getMtbColr().get(0) : null;
|
||||||
|
|
||||||
boolean shouldPrint = !shouldCloseLU || mCurrentMtbColt.getMtbColr().size() != 0;
|
boolean shouldPrint = !shouldCloseLU || !mCurrentMtbColt.getMtbColr().isEmpty();
|
||||||
|
|
||||||
//Se è l'unico articolo del collo (controllo se è uguale a 0 perché ancora non è stato aggiunto nella lista delle righe)
|
//Se è l'unico articolo del collo (controllo se è uguale a 0 perché ancora non è stato aggiunto nella lista delle righe)
|
||||||
if (UtilityBigDecimal.equalsTo(numCnf, BigDecimal.ZERO) && UtilityBigDecimal.equalsTo(qtaTot, BigDecimal.ZERO)) {
|
if (UtilityBigDecimal.equalsTo(numCnf, BigDecimal.ZERO) && UtilityBigDecimal.equalsTo(qtaTot, BigDecimal.ZERO)) {
|
||||||
|
|||||||
@ -197,7 +197,7 @@ public class UltimeConsegneClienteFragment extends BaseFragment implements Ultim
|
|||||||
.forEach(x -> x.setSelected(false));
|
.forEach(x -> x.setSelected(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (selectedOrders != null && selectedOrders.size() > 0) {
|
if (selectedOrders != null && !selectedOrders.isEmpty()) {
|
||||||
mBindings.mainFab.show();
|
mBindings.mainFab.show();
|
||||||
} else {
|
} else {
|
||||||
mBindings.mainFab.hide();
|
mBindings.mainFab.hide();
|
||||||
|
|||||||
@ -92,7 +92,7 @@ public class UltimeConsegneClienteViewModel {
|
|||||||
private void executeEtichettaLU(String SSCC, RunnableArgs<List<OrdiniUscitaElencoDTO>> onComplete) {
|
private void executeEtichettaLU(String SSCC, RunnableArgs<List<OrdiniUscitaElencoDTO>> onComplete) {
|
||||||
this.mColliMagazzinoRESTConsumer.getBySSCC(SSCC, true, false, mtbColt -> {
|
this.mColliMagazzinoRESTConsumer.getBySSCC(SSCC, true, false, mtbColt -> {
|
||||||
|
|
||||||
if(mtbColt != null && mtbColt.getMtbColr() != null && mtbColt.getMtbColr().size() > 0) {
|
if(mtbColt != null && mtbColt.getMtbColr() != null && !mtbColt.getMtbColr().isEmpty()) {
|
||||||
|
|
||||||
// if(mtbColt.getGestioneEnum() == GestioneEnum.ACQUISTO || mtbColt.getGestioneEnum() == GestioneEnum.LAVORAZIONE) {
|
// if(mtbColt.getGestioneEnum() == GestioneEnum.ACQUISTO || mtbColt.getGestioneEnum() == GestioneEnum.LAVORAZIONE) {
|
||||||
// //GET BY COMMESSA COLLO
|
// //GET BY COMMESSA COLLO
|
||||||
|
|||||||
@ -199,7 +199,7 @@ public class UltimiArriviFornitoreFragment extends BaseFragment implements ITitl
|
|||||||
.forEach(x -> x.setSelected(false));
|
.forEach(x -> x.setSelected(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (selectedOrders != null && selectedOrders.size() > 0) {
|
if (selectedOrders != null && !selectedOrders.isEmpty()) {
|
||||||
mBindings.mainFab.show();
|
mBindings.mainFab.show();
|
||||||
} else {
|
} else {
|
||||||
mBindings.mainFab.hide();
|
mBindings.mainFab.hide();
|
||||||
|
|||||||
@ -93,7 +93,7 @@ public class UltimiArriviFornitoreViewModel {
|
|||||||
private void executeEtichettaLU(String SSCC, Runnable onComplete) {
|
private void executeEtichettaLU(String SSCC, Runnable onComplete) {
|
||||||
this.mColliMagazzinoRESTConsumer.getBySSCC(SSCC, true, false, mtbColt -> {
|
this.mColliMagazzinoRESTConsumer.getBySSCC(SSCC, true, false, mtbColt -> {
|
||||||
|
|
||||||
if(mtbColt != null && mtbColt.getMtbColr() != null && mtbColt.getMtbColr().size() > 0) {
|
if(mtbColt != null && mtbColt.getMtbColr() != null && !mtbColt.getMtbColr().isEmpty()) {
|
||||||
if(mtbColt.getSegno() > 0) {
|
if(mtbColt.getSegno() > 0) {
|
||||||
|
|
||||||
this.sendOnMtbColtScanned(mtbColt);
|
this.sendOnMtbColtScanned(mtbColt);
|
||||||
|
|||||||
@ -45,7 +45,7 @@ public class UltimiArriviFornitoreRESTConsumer {
|
|||||||
public void getUltimeConsegneFornitori(String codMdep, String codAnag, List<MtbAart> mtbAarts, int limitConsegnePerCli, int limitDays, RunnableArgs<ArrayList<DocumentoResoDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
public void getUltimeConsegneFornitori(String codMdep, String codAnag, List<MtbAart> mtbAarts, int limitConsegnePerCli, int limitDays, RunnableArgs<ArrayList<DocumentoResoDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
String codMarts = null;
|
String codMarts = null;
|
||||||
|
|
||||||
if (mtbAarts != null && mtbAarts.size() > 0) {
|
if (mtbAarts != null && !mtbAarts.isEmpty()) {
|
||||||
codMarts = StringUtils.join(Stream.of(mtbAarts)
|
codMarts = StringUtils.join(Stream.of(mtbAarts)
|
||||||
.map(MtbAart::getCodMart)
|
.map(MtbAart::getCodMart)
|
||||||
.toList(), "|");
|
.toList(), "|");
|
||||||
|
|||||||
@ -130,7 +130,7 @@ public class VersamentoMerceViewModel {
|
|||||||
private void executePosizioneMonocollo(Runnable onComplete, MtbDepoPosizione foundPosizione) {
|
private void executePosizioneMonocollo(Runnable onComplete, MtbDepoPosizione foundPosizione) {
|
||||||
this.mPosizioniRESTConsumer.getBancaliInPosizione(foundPosizione, mtbColtList -> {
|
this.mPosizioniRESTConsumer.getBancaliInPosizione(foundPosizione, mtbColtList -> {
|
||||||
|
|
||||||
if (mtbColtList == null || mtbColtList.size() == 0) {
|
if (mtbColtList == null || mtbColtList.isEmpty()) {
|
||||||
this.sendError(new NoLUFoundException());
|
this.sendError(new NoLUFoundException());
|
||||||
} else if (mtbColtList.size() == 1) {
|
} else if (mtbColtList.size() == 1) {
|
||||||
mColliMagazzinoRESTConsumer.getByTestata(mtbColtList.get(0), true, false, mtbColt -> {
|
mColliMagazzinoRESTConsumer.getByTestata(mtbColtList.get(0), true, false, mtbColt -> {
|
||||||
|
|||||||
@ -247,7 +247,7 @@ public class StatusBarAlert {
|
|||||||
break label48;
|
break label48;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (var9.size() != 0) {
|
if (!var9.isEmpty()) {
|
||||||
break label48;
|
break label48;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -124,7 +124,7 @@ public class DialogAskCliente_Page1ViewModel implements IDialogAskClienteViewMod
|
|||||||
List<DialogAskClienteClienteDTO> resultCodAnag = Stream.of(availableClienti)
|
List<DialogAskClienteClienteDTO> resultCodAnag = Stream.of(availableClienti)
|
||||||
.filter(x -> barcode.equalsIgnoreCase(x.getCodAnag()))
|
.filter(x -> barcode.equalsIgnoreCase(x.getCodAnag()))
|
||||||
.toList();
|
.toList();
|
||||||
if (resultCodAnag.size() > 0) {
|
if (!resultCodAnag.isEmpty()) {
|
||||||
return resultCodAnag.get(0);
|
return resultCodAnag.get(0);
|
||||||
} else return null;
|
} else return null;
|
||||||
}
|
}
|
||||||
@ -133,7 +133,7 @@ public class DialogAskCliente_Page1ViewModel implements IDialogAskClienteViewMod
|
|||||||
List<DialogAskClienteClienteDTO> resultCodJcom = Stream.of(availableClienti)
|
List<DialogAskClienteClienteDTO> resultCodJcom = Stream.of(availableClienti)
|
||||||
.filter(x -> x.getCodJcoms().contains(barcode))
|
.filter(x -> x.getCodJcoms().contains(barcode))
|
||||||
.toList();
|
.toList();
|
||||||
if (resultCodJcom.size() > 0) {
|
if (!resultCodJcom.isEmpty()) {
|
||||||
return resultCodJcom.get(0);
|
return resultCodJcom.get(0);
|
||||||
} else return null;
|
} else return null;
|
||||||
}
|
}
|
||||||
@ -182,7 +182,7 @@ public class DialogAskCliente_Page1ViewModel implements IDialogAskClienteViewMod
|
|||||||
|
|
||||||
|
|
||||||
private boolean validateCliente() {
|
private boolean validateCliente() {
|
||||||
if (SettingsManager.iDB().isFlagPickLiberoAllowEmptyCliente() && mBinding.inputCliente.getEditText().getText().toString().trim().length() == 0) {
|
if (SettingsManager.iDB().isFlagPickLiberoAllowEmptyCliente() && mBinding.inputCliente.getEditText().getText().toString().trim().isEmpty()) {
|
||||||
return true;
|
return true;
|
||||||
} else return getCurrentCliente() != null;
|
} else return getCurrentCliente() != null;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -72,7 +72,7 @@ public class DialogAskCliente_Page1_Cliente_ArrayAdapter extends ArrayAdapter<Di
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (prefix == null || prefix.length() == 0) {
|
if (prefix == null || prefix.isEmpty()) {
|
||||||
synchronized (lock) {
|
synchronized (lock) {
|
||||||
results.values = mDatasetAllItems;
|
results.values = mDatasetAllItems;
|
||||||
results.count = mDatasetAllItems.size();
|
results.count = mDatasetAllItems.size();
|
||||||
|
|||||||
@ -67,7 +67,7 @@ public class DialogAskCliente_Page1_Commessa_ArrayAdapter extends ArrayAdapter<S
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (prefix == null || prefix.length() == 0) {
|
if (prefix == null || prefix.isEmpty()) {
|
||||||
synchronized (lock) {
|
synchronized (lock) {
|
||||||
results.values = mDatasetAllItems;
|
results.values = mDatasetAllItems;
|
||||||
results.count = mDatasetAllItems.size();
|
results.count = mDatasetAllItems.size();
|
||||||
|
|||||||
@ -53,7 +53,7 @@ public class DialogAskCliente_Page2ViewModel implements IDialogAskClienteViewMod
|
|||||||
: null;
|
: null;
|
||||||
|
|
||||||
|
|
||||||
if (filteredDestinatari == null || filteredDestinatari.size() == 0) {
|
if (filteredDestinatari == null || filteredDestinatari.isEmpty()) {
|
||||||
mOnConfirm.run();
|
mOnConfirm.run();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -89,7 +89,7 @@ public class DialogAskCliente_Page2_ArrayAdapter extends ArrayAdapter<DialogAskC
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (prefix == null || prefix.length() == 0) {
|
if (prefix == null || prefix.isEmpty()) {
|
||||||
synchronized (lock) {
|
synchronized (lock) {
|
||||||
results.values = mDatasetAllItems;
|
results.values = mDatasetAllItems;
|
||||||
results.count = mDatasetAllItems.size();
|
results.count = mDatasetAllItems.size();
|
||||||
|
|||||||
@ -49,9 +49,9 @@ public class DialogBasketLU_Page1_ViewModel extends DialogBasketLU_BaseViewModel
|
|||||||
|
|
||||||
ColliMagazzinoRESTConsumer.retrieveBasketColli(mtbColts -> {
|
ColliMagazzinoRESTConsumer.retrieveBasketColli(mtbColts -> {
|
||||||
availableMtbColts = mtbColts;
|
availableMtbColts = mtbColts;
|
||||||
if(mtbColts != null && mtbColts.size() > 0) initRecyclerView(availableMtbColts);
|
if(mtbColts != null && !mtbColts.isEmpty()) initRecyclerView(availableMtbColts);
|
||||||
|
|
||||||
mBinding.emptyView.setVisibility(mtbColts != null && mtbColts.size() > 0 ? View.GONE : View.VISIBLE);
|
mBinding.emptyView.setVisibility(mtbColts != null && !mtbColts.isEmpty() ? View.GONE : View.VISIBLE);
|
||||||
}, ex -> {
|
}, ex -> {
|
||||||
mBinding.emptyView.setVisibility(View.VISIBLE);
|
mBinding.emptyView.setVisibility(View.VISIBLE);
|
||||||
});
|
});
|
||||||
|
|||||||
@ -46,8 +46,8 @@ public class DialogBasketLU_Page2_ViewModel extends DialogBasketLU_BaseViewModel
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPreShow() {
|
public void onPreShow() {
|
||||||
if(mMtbColt != null && mMtbColt.getMtbColr() != null && mMtbColt.getMtbColr().size() > 0) initRecyclerView(mMtbColt.getMtbColr());
|
if(mMtbColt != null && mMtbColt.getMtbColr() != null && !mMtbColt.getMtbColr().isEmpty()) initRecyclerView(mMtbColt.getMtbColr());
|
||||||
mBinding.emptyView.setVisibility(mMtbColt != null && mMtbColt.getMtbColr() != null && mMtbColt.getMtbColr().size() > 0 ? View.GONE : View.VISIBLE);
|
mBinding.emptyView.setVisibility(mMtbColt != null && mMtbColt.getMtbColr() != null && !mMtbColt.getMtbColr().isEmpty() ? View.GONE : View.VISIBLE);
|
||||||
|
|
||||||
mBinding.buttonAbort.setOnClickListener(v -> {
|
mBinding.buttonAbort.setOnClickListener(v -> {
|
||||||
previous();
|
previous();
|
||||||
|
|||||||
@ -296,7 +296,7 @@ public class DialogChooseArtsFromMtbColrList extends BaseDialogFragment implemen
|
|||||||
private void loadArticolo(String barcodeProd, Ean128Model ean128Model) {
|
private void loadArticolo(String barcodeProd, Ean128Model ean128Model) {
|
||||||
this.articoloRESTConsumer.searchByBarcode(barcodeProd, mtbAartList -> {
|
this.articoloRESTConsumer.searchByBarcode(barcodeProd, mtbAartList -> {
|
||||||
|
|
||||||
if (mtbAartList != null && mtbAartList.size() > 0) {
|
if (mtbAartList != null && !mtbAartList.isEmpty()) {
|
||||||
MtbAart articolo = mtbAartList.get(0);
|
MtbAart articolo = mtbAartList.get(0);
|
||||||
this.mBindings.mainSearch.setQuery(articolo.getCodMart(), false);
|
this.mBindings.mainSearch.setQuery(articolo.getCodMart(), false);
|
||||||
|
|
||||||
@ -320,7 +320,7 @@ public class DialogChooseArtsFromMtbColrList extends BaseDialogFragment implemen
|
|||||||
!x.isHidden())
|
!x.isHidden())
|
||||||
.toList();
|
.toList();
|
||||||
|
|
||||||
if (foundRowsList.size() == 0) {
|
if (foundRowsList.isEmpty()) {
|
||||||
DialogCommon.showNoArtFoundDialog(mContext, null);
|
DialogCommon.showNoArtFoundDialog(mContext, null);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
|||||||
@ -347,8 +347,8 @@ public class DialogInputLUProdView extends BaseDialogFragment implements DialogI
|
|||||||
|
|
||||||
|
|
||||||
this.mViewModel.getLineeProd().observe(getViewLifecycleOwner(), lineeProd -> {
|
this.mViewModel.getLineeProd().observe(getViewLifecycleOwner(), lineeProd -> {
|
||||||
this.enabledLineeProd.set(lineeProd != null && lineeProd.size() > 0);
|
this.enabledLineeProd.set(lineeProd != null && !lineeProd.isEmpty());
|
||||||
this.mViewModel.setLineeProdRequired(lineeProd != null && lineeProd.size() > 0);
|
this.mViewModel.setLineeProdRequired(lineeProd != null && !lineeProd.isEmpty());
|
||||||
|
|
||||||
lineeProdArrayAdapter = new DialogInputLULineeProdAdapter(getActivity(), R.layout.array_adapter_single_item, lineeProd);
|
lineeProdArrayAdapter = new DialogInputLULineeProdAdapter(getActivity(), R.layout.array_adapter_single_item, lineeProd);
|
||||||
mBindings.filledExposedDropdownCodJfas.setAdapter(lineeProdArrayAdapter);
|
mBindings.filledExposedDropdownCodJfas.setAdapter(lineeProdArrayAdapter);
|
||||||
|
|||||||
@ -129,7 +129,7 @@ public class DialogScanArtViewModel {
|
|||||||
private void executeEtichettaLU(String SSCC, RunnableArgssss<DialogConsts.Results, MtbAart, Ean128Model, List<MtbColr>> onComplete) {
|
private void executeEtichettaLU(String SSCC, RunnableArgssss<DialogConsts.Results, MtbAart, Ean128Model, List<MtbColr>> onComplete) {
|
||||||
mColliMagazzinoRESTConsumer.getBySSCC(SSCC, true, false, mtbColt -> {
|
mColliMagazzinoRESTConsumer.getBySSCC(SSCC, true, false, mtbColt -> {
|
||||||
|
|
||||||
if (mtbColt != null && mtbColt.getMtbColr() != null && mtbColt.getMtbColr().size() > 0) {
|
if (mtbColt != null && mtbColt.getMtbColr() != null && !mtbColt.getMtbColr().isEmpty()) {
|
||||||
if (mtbColt.getSegno() != -1) {
|
if (mtbColt.getSegno() != -1) {
|
||||||
onComplete.run(DialogConsts.Results.YES, null, null, mtbColt.getMtbColr());
|
onComplete.run(DialogConsts.Results.YES, null, null, mtbColt.getMtbColr());
|
||||||
} else this.sendError(new InvalidLUException());
|
} else this.sendError(new InvalidLUException());
|
||||||
@ -164,7 +164,7 @@ public class DialogScanArtViewModel {
|
|||||||
private void executePosizione(MtbDepoPosizione posizione, MtbAart articolo, RunnableArgssss<DialogConsts.Results, MtbAart, Ean128Model, List<MtbColr>> onComplete) {
|
private void executePosizione(MtbDepoPosizione posizione, MtbAart articolo, RunnableArgssss<DialogConsts.Results, MtbAart, Ean128Model, List<MtbColr>> onComplete) {
|
||||||
this.mPosizioniRESTConsumer.getBancaliInPosizione(posizione, mtbColtList -> {
|
this.mPosizioniRESTConsumer.getBancaliInPosizione(posizione, mtbColtList -> {
|
||||||
|
|
||||||
if (mtbColtList == null || mtbColtList.size() == 0) {
|
if (mtbColtList == null || mtbColtList.isEmpty()) {
|
||||||
this.sendError(new NoLUFoundException());
|
this.sendError(new NoLUFoundException());
|
||||||
} else if (mtbColtList.size() == 1) {
|
} else if (mtbColtList.size() == 1) {
|
||||||
this.mColliMagazzinoRESTConsumer.getByTestata(mtbColtList.get(0), true, false, mtbColt -> {
|
this.mColliMagazzinoRESTConsumer.getByTestata(mtbColtList.get(0), true, false, mtbColt -> {
|
||||||
@ -180,7 +180,7 @@ public class DialogScanArtViewModel {
|
|||||||
|
|
||||||
private void loadArticolo(@NotNull String barcodeProd, Ean128Model ean128Model, RunnableArgssss<DialogConsts.Results, MtbAart, Ean128Model, List<MtbColr>> onComplete) {
|
private void loadArticolo(@NotNull String barcodeProd, Ean128Model ean128Model, RunnableArgssss<DialogConsts.Results, MtbAart, Ean128Model, List<MtbColr>> onComplete) {
|
||||||
this.mArticoloRESTConsumer.searchByBarcode(barcodeProd, mtbAartList -> {
|
this.mArticoloRESTConsumer.searchByBarcode(barcodeProd, mtbAartList -> {
|
||||||
if (mtbAartList != null && mtbAartList.size() > 0) {
|
if (mtbAartList != null && !mtbAartList.isEmpty()) {
|
||||||
|
|
||||||
MtbAart firstArt = mtbAartList.get(0);
|
MtbAart firstArt = mtbAartList.get(0);
|
||||||
MtbDepoPosizione firstArtPosition = UtilityPosizione.getFromCache(firstArt.getPosizione());
|
MtbDepoPosizione firstArtPosition = UtilityPosizione.getFromCache(firstArt.getPosizione());
|
||||||
|
|||||||
@ -95,7 +95,7 @@ public class DialogScanOrCreateLUViewModel {
|
|||||||
private void executePosizione(MtbDepoPosizione posizione, Runnable onComplete) {
|
private void executePosizione(MtbDepoPosizione posizione, Runnable onComplete) {
|
||||||
this.mPosizioniRESTConsumer.getBancaliInPosizione(posizione, mtbColtList -> {
|
this.mPosizioniRESTConsumer.getBancaliInPosizione(posizione, mtbColtList -> {
|
||||||
|
|
||||||
if (mtbColtList == null || mtbColtList.size() == 0) {
|
if (mtbColtList == null || mtbColtList.isEmpty()) {
|
||||||
this.sendError(new NoLUFoundException());
|
this.sendError(new NoLUFoundException());
|
||||||
} else if (mtbColtList.size() == 1) {
|
} else if (mtbColtList.size() == 1) {
|
||||||
this.mColliMagazzinoRESTConsumer.getByTestata(mtbColtList.get(0), mShouldCheckResiduo, false, mtbColt -> {
|
this.mColliMagazzinoRESTConsumer.getByTestata(mtbColtList.get(0), mShouldCheckResiduo, false, mtbColt -> {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user