Fix in Picking Vendita.
This commit is contained in:
parent
82e21ccacb
commit
bd13ad93de
@ -4,9 +4,12 @@ import com.annimon.stream.Stream;
|
|||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
|
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.CommonConst;
|
import it.integry.integrywmsnative.core.CommonConst;
|
||||||
@ -290,6 +293,26 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer{
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void getMultipleByTestate(List<MtbColt> testate, boolean onlyResiduo, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
ArrayList<MtbColt> resultMtbColt = new ArrayList<>();
|
||||||
|
cyclicGetMultipleByTestate(testate.iterator(), onlyResiduo, resultMtbColt, () -> {
|
||||||
|
onComplete.run(resultMtbColt);
|
||||||
|
}, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private static void cyclicGetMultipleByTestate(@NotNull Iterator<MtbColt> sourceMtbColts, boolean onlyResiduo, ArrayList<MtbColt> resultMtbColt, Runnable onComplete, RunnableArgs<Exception> onAbort) {
|
||||||
|
if(sourceMtbColts.hasNext()){
|
||||||
|
getByTestata(sourceMtbColts.next(), onlyResiduo, false, mtbColt -> {
|
||||||
|
resultMtbColt.add(mtbColt);
|
||||||
|
cyclicGetMultipleByTestate(sourceMtbColts, onlyResiduo, resultMtbColt, onComplete, onAbort);
|
||||||
|
}, onAbort);
|
||||||
|
} else {
|
||||||
|
onComplete.run();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void getByTestata(MtbColt testata, boolean onlyResiduo, boolean throwExcIfNull, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
public static void getByTestata(MtbColt testata, boolean onlyResiduo, boolean throwExcIfNull, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
String ssccString = null;
|
String ssccString = null;
|
||||||
|
|||||||
@ -697,8 +697,14 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
|||||||
private void loadMatchedRows(List<PickingObjectDTO> matchedRows) {
|
private void loadMatchedRows(List<PickingObjectDTO> matchedRows) {
|
||||||
if(matchedRows == null || matchedRows.size() == 0) {
|
if(matchedRows == null || matchedRows.size() == 0) {
|
||||||
DialogCommon.showNoArtFoundDialog(mActivity, null);
|
DialogCommon.showNoArtFoundDialog(mActivity, null);
|
||||||
} else if(matchedRows.size() == 1) {
|
} else {
|
||||||
|
for(int i = 0; i < mPickingList.size(); i++) {
|
||||||
|
if(!matchedRows.contains(mPickingList.get(i))) {
|
||||||
|
mPickingList.get(i).setTempHidden(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(matchedRows.size() == 1) {
|
||||||
|
|
||||||
if (matchedRows.get(0).getTempPickData() != null &&
|
if (matchedRows.get(0).getTempPickData() != null &&
|
||||||
matchedRows.get(0).getTempPickData().getSourceMtbColt() != null) {
|
matchedRows.get(0).getTempPickData().getSourceMtbColt() != null) {
|
||||||
@ -722,18 +728,12 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
|||||||
onOrdineRowDispatch(matchedRows.get(0));
|
onOrdineRowDispatch(matchedRows.get(0));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for(int i = 0; i < mPickingList.size(); i++) {
|
|
||||||
if(!matchedRows.contains(mPickingList.get(i))) {
|
|
||||||
mPickingList.get(i).setTempHidden(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
applyFilter("");
|
applyFilter("");
|
||||||
refreshOrderBy(false);
|
refreshOrderBy(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public void createNewUL() {
|
public void createNewUL() {
|
||||||
@ -867,8 +867,15 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
|||||||
IOrdiniVendita ordiniVendita = ClassRouter.getIstance(ClassRouter.PATH.ORDINI_VENDITA);
|
IOrdiniVendita ordiniVendita = ClassRouter.getIstance(ClassRouter.PATH.ORDINI_VENDITA);
|
||||||
|
|
||||||
ordiniVendita.distribuisciCollo(progress, cloneMtbColt, mTestateOrdini, mtbColts -> {
|
ordiniVendita.distribuisciCollo(progress, cloneMtbColt, mTestateOrdini, mtbColts -> {
|
||||||
|
|
||||||
if(mtbColtSessionID != null) ColliDataRecover.closeSession(mtbColtSessionID);
|
if(mtbColtSessionID != null) ColliDataRecover.closeSession(mtbColtSessionID);
|
||||||
onComplete.run(mtbColts);
|
|
||||||
|
ColliMagazzinoRESTConsumer.getMultipleByTestate(mtbColts, true, mtbColtsReloaded -> {
|
||||||
|
onComplete.run(mtbColtsReloaded);
|
||||||
|
}, ex -> {
|
||||||
|
UtilityExceptions.defaultException(mActivity, ex, progress);
|
||||||
|
});
|
||||||
|
|
||||||
}, ex -> {
|
}, ex -> {
|
||||||
UtilityExceptions.defaultException(mActivity, ex, progress);
|
UtilityExceptions.defaultException(mActivity, ex, progress);
|
||||||
});
|
});
|
||||||
@ -981,26 +988,15 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
|||||||
mArticoliInColloBottomSheetViewModel.mtbColt.set(null);
|
mArticoliInColloBottomSheetViewModel.mtbColt.set(null);
|
||||||
isFabVisible.set(true);
|
isFabVisible.set(true);
|
||||||
|
|
||||||
if(mtbColt != null && mtbColt.getMtbColr() != null) {
|
|
||||||
|
|
||||||
List<MtbColr> mtbColrs = mtbColt.getMtbColr();
|
for(int i = 0; i < this.mPickingList.size(); i++) {
|
||||||
|
|
||||||
for (int i = 0; i < mtbColrs.size(); i++) {
|
for(int k = 0; k < this.mPickingList.get(i).getWithdrawRows().size(); k++) {
|
||||||
|
|
||||||
MtbColr x = mtbColt.getMtbColr().get(i);
|
MtbColr withdrawRow = this.mPickingList.get(i).getWithdrawRows().get(k);
|
||||||
|
|
||||||
Stream.of(this.mPickingList)
|
this.mPickingList.get(i).setQtaCollo(this.mPickingList.get(i).getQtaCollo().subtract(withdrawRow.getQtaCol()));
|
||||||
.filter(currentRow ->
|
this.mPickingList.get(i).setQtaOrd(this.mPickingList.get(i).getQtaOrd().subtract(withdrawRow.getQtaCol()));
|
||||||
x.getCodMart().equalsIgnoreCase(currentRow.getCodMart()) &&
|
|
||||||
((x.getCodJcom() == null && currentRow.getCodJcom() == null) || (x.getCodJcom() != null && x.getCodJcom().equalsIgnoreCase(currentRow.getCodJcom()))) &&
|
|
||||||
(!SettingsManager.iDB().isEnableCheckPartitaMagCheckPickingV() || (SettingsManager.iDB().isEnableCheckPartitaMagCheckPickingV() && ((x.getPartitaMag() == null && currentRow.getPartitaMag() == null) || (x.getPartitaMag() != null && x.getPartitaMag().equalsIgnoreCase(currentRow.getPartitaMag()))))) &&
|
|
||||||
((x.getNumColloRif() == null && currentRow.getNumCollo() == null) || (x.getNumColloRif() != null && x.getNumColloRif().equals(currentRow.getNumCollo())))
|
|
||||||
)
|
|
||||||
|
|
||||||
.forEach(currentRow -> {
|
|
||||||
currentRow.setQtaCollo(currentRow.getQtaCollo().subtract(x.getQtaCol()));
|
|
||||||
currentRow.setQtaOrd(currentRow.getQtaOrd().subtract(x.getQtaCol()));
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -57,19 +57,32 @@
|
|||||||
android:textAllCaps="true"
|
android:textAllCaps="true"
|
||||||
android:textSize="16sp"/>
|
android:textSize="16sp"/>
|
||||||
|
|
||||||
<Button
|
<!--<Button-->
|
||||||
|
<!--android:id="@+id/articoli_in_collo_close_collo"-->
|
||||||
|
<!--android:layout_width="wrap_content"-->
|
||||||
|
<!--android:layout_height="wrap_content"-->
|
||||||
|
<!--android:text="@string/action_close_ul"-->
|
||||||
|
<!--android:textSize="16sp"-->
|
||||||
|
<!--android:layout_alignParentEnd="true"-->
|
||||||
|
<!--android:theme="@style/white_button"-->
|
||||||
|
<!--android:drawableEnd="@drawable/ic_close_red_24dp"-->
|
||||||
|
<!--android:drawablePadding="8dp"-->
|
||||||
|
<!--android:onClick="@{() -> viewModel.closeCurrentUL()}"-->
|
||||||
|
<!--android:drawableTint="@color/red_600"-->
|
||||||
|
<!--android:textColor="@color/red_600"/>-->
|
||||||
|
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/articoli_in_collo_close_collo"
|
android:id="@+id/articoli_in_collo_close_collo"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/action_close_ul"
|
style="@style/Button.DangerOutline"
|
||||||
android:textSize="16sp"
|
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentEnd="true"
|
||||||
android:theme="@style/white_button"
|
android:layout_marginLeft="8dp"
|
||||||
android:drawableEnd="@drawable/ic_close_red_24dp"
|
android:layout_marginRight="8dp"
|
||||||
android:drawablePadding="8dp"
|
android:text="@string/action_close_ul"
|
||||||
android:onClick="@{() -> viewModel.closeCurrentUL()}"
|
android:onClick="@{() -> viewModel.closeCurrentUL()}"
|
||||||
android:drawableTint="@color/red_600"
|
app:strokeColor="@color/red_600"/>
|
||||||
android:textColor="@color/red_600"/>
|
|
||||||
|
|
||||||
<!--<android.support.v7.widget.AppCompatButton-->
|
<!--<android.support.v7.widget.AppCompatButton-->
|
||||||
<!--android:id="@+id/articoli_in_collo_close_collo"-->
|
<!--android:id="@+id/articoli_in_collo_close_collo"-->
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user