Finish v1.17.9(229)
This commit is contained in:
commit
c3ee5519b4
@ -6,8 +6,8 @@ apply plugin: 'com.google.gms.google-services'
|
||||
|
||||
android {
|
||||
|
||||
def appVersionCode = 228
|
||||
def appVersionName = '1.17.8'
|
||||
def appVersionCode = 229
|
||||
def appVersionName = '1.17.9'
|
||||
|
||||
signingConfigs {
|
||||
release {
|
||||
|
||||
@ -37,13 +37,17 @@ public class BaseFragment extends Fragment {
|
||||
|
||||
|
||||
public void onLoadingStarted() {
|
||||
BarcodeManager.disable();
|
||||
this.openProgress();
|
||||
new Thread(() -> {
|
||||
BarcodeManager.disable();
|
||||
this.openProgress();
|
||||
}).start();
|
||||
}
|
||||
|
||||
public void onLoadingEnded() {
|
||||
this.closeProgress();
|
||||
BarcodeManager.enable();
|
||||
new Thread(() -> {
|
||||
this.closeProgress();
|
||||
BarcodeManager.enable();
|
||||
}).start();
|
||||
}
|
||||
|
||||
public void onError(Exception ex) {
|
||||
|
||||
@ -694,4 +694,30 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public void assegnaLottoSuColloScarico(MtbColt sourceMtbColt, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
MtbColt sourceMtbColtClone = (MtbColt) sourceMtbColt.clone();
|
||||
|
||||
for (int i = 0; i < sourceMtbColtClone.getMtbColr().size(); i++) {
|
||||
sourceMtbColtClone.getMtbColr().get(i)
|
||||
.setMtbAart(null)
|
||||
.setMtbPartitaMag(null);
|
||||
}
|
||||
|
||||
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||
colliMagazzinoRESTConsumerService.assegnaLottoSuColloScarico(sourceMtbColtClone).enqueue(new Callback<ServiceRESTResponse<MtbColt>>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<MtbColt>> call, Response<ServiceRESTResponse<MtbColt>> response) {
|
||||
analyzeAnswer(response, "assegnaLottoSuColloScarico", data -> {
|
||||
onComplete.run();
|
||||
}, onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<MtbColt>> call, Throwable t) {
|
||||
if (onFailed != null) onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -18,7 +18,7 @@ import retrofit2.http.Query;
|
||||
|
||||
public interface ColliMagazzinoRESTConsumerService {
|
||||
|
||||
@POST("SM2DistribuzioneRigheCollo")
|
||||
@POST("wms/distribuzioneRigheCollo")
|
||||
Call<ServiceRESTResponse<JsonObject>> distribuisciCollo(@Body DistribuzioneColloDTO distribuzioneCollo);
|
||||
|
||||
@POST("getColloByBarcode")
|
||||
@ -39,4 +39,7 @@ public interface ColliMagazzinoRESTConsumerService {
|
||||
@POST("wms/spostaArtsTraUL")
|
||||
Call<ServiceRESTResponse<Object>> spostaArtsTraUL(@Body SpostaArtsTraULRequestDTO spostaArtsTraULRequestDTO);
|
||||
|
||||
@POST("wms/assegnaLottoSuColloScarico")
|
||||
Call<ServiceRESTResponse<MtbColt>> assegnaLottoSuColloScarico(@Body MtbColt mtbColt);
|
||||
|
||||
}
|
||||
|
||||
@ -190,19 +190,19 @@ public class PickingLiberoFragment extends BaseFragment implements ITitledFragme
|
||||
|
||||
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
||||
BarcodeManager.disable();
|
||||
this.openProgress();
|
||||
this.onLoadingStarted();
|
||||
|
||||
this.mViewModel.processBarcodeDTO(data, () -> {
|
||||
BarcodeManager.enable();
|
||||
this.closeProgress();
|
||||
this.onLoadingEnded();
|
||||
});
|
||||
};
|
||||
|
||||
public void createNewLU() {
|
||||
this.openProgress();
|
||||
this.onLoadingStarted();
|
||||
|
||||
this.mViewModel.createNewLU(null, null, () -> {
|
||||
this.closeProgress();
|
||||
this.onLoadingEnded();
|
||||
});
|
||||
}
|
||||
|
||||
@ -225,16 +225,6 @@ public class PickingLiberoFragment extends BaseFragment implements ITitledFragme
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onLoadingStarted() {
|
||||
this.openProgress();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadingEnded() {
|
||||
this.closeProgress();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLUOpened(MtbColt mtbColt) {
|
||||
getActivity().runOnUiThread(() -> {
|
||||
|
||||
@ -477,48 +477,50 @@ public class PickingLiberoViewModel {
|
||||
|
||||
|
||||
public void saveNewRow(PickingObjectDTO pickingObjectDTO, BigDecimal numCnf, BigDecimal qtaCnf, BigDecimal qtaTot, String partitaMag, Date dataScad, boolean shouldCloseLU) {
|
||||
this.sendOnLoadingStarted();
|
||||
new Thread(this::sendOnLoadingStarted).start();
|
||||
|
||||
final MtbColr mtbColr = new MtbColr()
|
||||
.setCodMart(pickingObjectDTO.getMtbAart().getCodMart())
|
||||
.setPartitaMag(partitaMag)
|
||||
.setDataScadPartita(dataScad)
|
||||
.setQtaCol(qtaTot)
|
||||
.setQtaCnf(qtaCnf)
|
||||
.setNumCnf(numCnf)
|
||||
.setDescrizione(pickingObjectDTO.getMtbAart().getDescrizioneEstesa())
|
||||
.setDatetimeRow(UtilityDate.getDateInstance());
|
||||
|
||||
mtbColr.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
||||
final MtbColr mtbColr = new MtbColr()
|
||||
.setCodMart(pickingObjectDTO.getMtbAart().getCodMart())
|
||||
.setPartitaMag(partitaMag)
|
||||
.setDataScadPartita(dataScad)
|
||||
.setQtaCol(qtaTot)
|
||||
.setQtaCnf(qtaCnf)
|
||||
.setNumCnf(numCnf)
|
||||
.setDescrizione(pickingObjectDTO.getMtbAart().getDescrizioneEstesa())
|
||||
.setDatetimeRow(UtilityDate.getDateInstance());
|
||||
|
||||
MtbColt cloneMtbColt = (MtbColt) mCurrentMtbColt.clone();
|
||||
cloneMtbColt.setOperation(CommonModelConsts.OPERATION.UPDATE);
|
||||
mtbColr.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
||||
|
||||
cloneMtbColt.setMtbColr(new ObservableArrayList<>());
|
||||
cloneMtbColt.getMtbColr().add((MtbColr) mtbColr.clone());
|
||||
MtbColt cloneMtbColt = (MtbColt) mCurrentMtbColt.clone();
|
||||
cloneMtbColt.setOperation(CommonModelConsts.OPERATION.UPDATE);
|
||||
|
||||
if (UtilityBigDecimal.equalsTo(numCnf, BigDecimal.ZERO) && UtilityBigDecimal.equalsTo(qtaTot, BigDecimal.ZERO)) {
|
||||
this.sendOnLoadingEnded();
|
||||
return;
|
||||
}
|
||||
cloneMtbColt.setMtbColr(new ObservableArrayList<>());
|
||||
cloneMtbColt.getMtbColr().add((MtbColr) mtbColr.clone());
|
||||
|
||||
mColliMagazzinoRESTConsumer.saveCollo(cloneMtbColt, value -> {
|
||||
mtbColr
|
||||
.setDataCollo(value.getDataColloS())
|
||||
.setNumCollo(value.getNumCollo())
|
||||
.setGestione(value.getGestione())
|
||||
.setSerCollo(value.getSerCollo())
|
||||
.setRiga(value.getMtbColr().get(value.getMtbColr().size() - 1).getRiga())
|
||||
.setUntMis(pickingObjectDTO.getMtbAart().getUntMis())
|
||||
.setMtbAart(pickingObjectDTO.getMtbAart());
|
||||
if (UtilityBigDecimal.equalsTo(numCnf, BigDecimal.ZERO) && UtilityBigDecimal.equalsTo(qtaTot, BigDecimal.ZERO)) {
|
||||
this.sendOnLoadingEnded();
|
||||
return;
|
||||
}
|
||||
|
||||
mCurrentMtbColt.getMtbColr().add(mtbColr);
|
||||
mColliMagazzinoRESTConsumer.saveCollo(cloneMtbColt, value -> {
|
||||
mtbColr
|
||||
.setDataCollo(value.getDataColloS())
|
||||
.setNumCollo(value.getNumCollo())
|
||||
.setGestione(value.getGestione())
|
||||
.setSerCollo(value.getSerCollo())
|
||||
.setRiga(value.getMtbColr().get(value.getMtbColr().size() - 1).getRiga())
|
||||
.setUntMis(pickingObjectDTO.getMtbAart().getUntMis())
|
||||
.setMtbAart(pickingObjectDTO.getMtbAart());
|
||||
|
||||
this.sendOnRowSaved();
|
||||
this.sendOnLoadingEnded();
|
||||
mCurrentMtbColt.getMtbColr().add(mtbColr);
|
||||
|
||||
this.sendOnRowSaved();
|
||||
this.sendOnLoadingEnded();
|
||||
|
||||
if (shouldCloseLU) closeLU(null);
|
||||
}, this::sendError);
|
||||
|
||||
if (shouldCloseLU) closeLU(null);
|
||||
}, this::sendError);
|
||||
}
|
||||
|
||||
|
||||
@ -710,12 +712,15 @@ public class PickingLiberoViewModel {
|
||||
if (onComplete != null) onComplete.run();
|
||||
});
|
||||
} else {
|
||||
mColliMagazzinoRESTConsumer.updateDataFine(mCurrentMtbColt, () -> {
|
||||
this.sendLUClosed();
|
||||
this.sendOnLoadingEnded();
|
||||
|
||||
this.mCurrentMtbColt = null;
|
||||
if (onComplete != null) onComplete.run();
|
||||
this.mColliMagazzinoRESTConsumer.assegnaLottoSuColloScarico(mCurrentMtbColt, () -> {
|
||||
this.mColliMagazzinoRESTConsumer.updateDataFine(mCurrentMtbColt, () -> {
|
||||
this.sendLUClosed();
|
||||
this.sendOnLoadingEnded();
|
||||
|
||||
this.mCurrentMtbColt = null;
|
||||
if (onComplete != null) onComplete.run();
|
||||
}, this::sendError);
|
||||
}, this::sendError);
|
||||
}
|
||||
}, this::sendError);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user