Fix descrizione riga UL in ContenutoBancaleActivity

This commit is contained in:
Giuseppe Scorrano 2024-01-23 18:19:03 +01:00
parent 0ae1ac87d5
commit 4f4dea9097
6 changed files with 20 additions and 42 deletions

View File

@ -25,8 +25,8 @@ android {
} }
} }
applicationVariants.all { variant -> applicationVariants.configureEach { variant ->
variant.outputs.all { output -> variant.outputs.configureEach { output ->
output.outputFileName = "android-release.apk" output.outputFileName = "android-release.apk"
} }
} }

View File

@ -7,6 +7,7 @@ import java.util.Date;
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum; import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
import it.integry.integrywmsnative.core.settings.SettingsManager; import it.integry.integrywmsnative.core.settings.SettingsManager;
import it.integry.integrywmsnative.core.utility.UtilityDate; import it.integry.integrywmsnative.core.utility.UtilityDate;
import it.integry.integrywmsnative.core.utility.UtilityString;
public class MtbColr extends EntityBase { public class MtbColr extends EntityBase {
@ -372,7 +373,7 @@ public class MtbColr extends EntityBase {
} }
public String getDescrizione() { public String getDescrizione() {
return descrizione; return UtilityString.isNull(descrizione, getMtbAart() != null ? UtilityString.isNull(getMtbAart().getDescrizioneEstesa(), getMtbAart().getDescrizione()) : null);
} }
public MtbColr setDescrizione(String descrizione) { public MtbColr setDescrizione(String descrizione) {

View File

@ -9,7 +9,6 @@ import java.util.List;
import javax.inject.Singleton; import javax.inject.Singleton;
import it.integry.integrywmsnative.core.expansion.RunnableArgs; import it.integry.integrywmsnative.core.expansion.RunnableArgs;
import it.integry.integrywmsnative.core.model.CommonModelConsts;
import it.integry.integrywmsnative.core.model.MtbDepo; import it.integry.integrywmsnative.core.model.MtbDepo;
@Singleton @Singleton
@ -28,27 +27,4 @@ public class DepositoRESTConsumer extends _BaseRESTConsumer {
}.getType(); }.getType();
this.systemRESTConsumer.processSql("SELECT * FROM mtb_depo", typeOfObjectsList, onComplete, onFailed); this.systemRESTConsumer.processSql("SELECT * FROM mtb_depo", typeOfObjectsList, onComplete, onFailed);
} }
public void getDepoByCodMdep(String codMdep, RunnableArgs<MtbDepo> onComplete, RunnableArgs<Exception> onFailed) {
MtbDepo mtbDepo = new MtbDepo();
mtbDepo.setCodMdep(codMdep);
mtbDepo.setOperation(CommonModelConsts.OPERATION.SELECT);
mtbDepo.setOnlyPkMaster(false);
this.entityRESTConsumer.selectEntity(mtbDepo, new ISimpleOperationCallback<>() {
@Override
public void onSuccess(List<MtbDepo> value) {
if (value != null && value.size() > 0) {
onComplete.run(value.get(0));
}
}
@Override
public void onFailed(Exception ex) {
onFailed.run(ex);
}
}, MtbDepo.class);
}
} }

View File

@ -121,11 +121,12 @@ public class EntityRESTConsumer extends _BaseRESTConsumer {
} }
@Deprecated
public <T extends EntityBase> void selectEntity(T entityToSave, final ISimpleOperationCallback<List<T>> callback, Class type) { public <T extends EntityBase> void selectEntity(T entityToSave, final ISimpleOperationCallback<List<T>> callback, Class type) {
EntityRESTConsumerService service = RESTBuilder.getService(EntityRESTConsumerService.class); EntityRESTConsumerService service = RESTBuilder.getService(EntityRESTConsumerService.class);
Call<ServiceRESTResponse<JsonObject>> request = service.processEntity(entityToSave); Call<ServiceRESTResponse<JsonObject>> request = service.processEntity(entityToSave);
request.enqueue(new Callback<ServiceRESTResponse<JsonObject>>() { request.enqueue(new Callback<>() {
@Override @Override
public void onResponse(Call<ServiceRESTResponse<JsonObject>> call, Response<ServiceRESTResponse<JsonObject>> response) { public void onResponse(Call<ServiceRESTResponse<JsonObject>> call, Response<ServiceRESTResponse<JsonObject>> response) {
if (response.isSuccessful()) { if (response.isSuccessful()) {

View File

@ -25,6 +25,7 @@ import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsume
import it.integry.integrywmsnative.core.rest.consumers.DepositoRESTConsumer; import it.integry.integrywmsnative.core.rest.consumers.DepositoRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer; import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
import it.integry.integrywmsnative.core.rest.model.uds.DeleteULRequestDTO; import it.integry.integrywmsnative.core.rest.model.uds.DeleteULRequestDTO;
import it.integry.integrywmsnative.core.settings.SettingsManager;
import it.integry.integrywmsnative.databinding.ActivityContenutoBancaleBinding; import it.integry.integrywmsnative.databinding.ActivityContenutoBancaleBinding;
import it.integry.integrywmsnative.gest.contenuto_bancale.ui.ContenutoBancaleListAdapter; import it.integry.integrywmsnative.gest.contenuto_bancale.ui.ContenutoBancaleListAdapter;
import it.integry.integrywmsnative.ui.SimpleDividerItemDecoration; import it.integry.integrywmsnative.ui.SimpleDividerItemDecoration;
@ -124,9 +125,10 @@ public class ContenutoBancaleActivity extends BaseActivity implements ContenutoB
} }
private void initColloInfo() { private void initColloInfo() {
mDepositoRESTConsumer.getDepoByCodMdep(mtbColt.get().getCodMdep(), depo -> { SettingsManager.iDB().getAvailableCodMdep().stream()
descrizioneDepo.set("(" + depo.getDescrizione() + ")"); .filter(x -> x.getCodMdep().equalsIgnoreCase(mtbColt.get().getCodMdep()))
}, this::onError); .findFirst()
.ifPresent(x -> descrizioneDepo.set("(" + x.getDescrizione() + ")"));
} }
private void initFab() { private void initFab() {
@ -138,7 +140,7 @@ public class ContenutoBancaleActivity extends BaseActivity implements ContenutoB
fabPopupMenu.setForceShowIcon(true); fabPopupMenu.setForceShowIcon(true);
fabPopupMenu.getMenuInflater().inflate(R.menu.contenuto_bancale_fab_menu, fabPopupMenu.getMenu()); fabPopupMenu.getMenuInflater().inflate(R.menu.contenuto_bancale_fab_menu, fabPopupMenu.getMenu());
if(mtbColt.get().isDocumentPresent()){ if (mtbColt.get().isDocumentPresent()) {
fabPopupMenu.getMenu().removeItem(R.id.delete_ul); fabPopupMenu.getMenu().removeItem(R.id.delete_ul);
} }

View File

@ -26,18 +26,16 @@ public class ListaBancaliViewModel {
public void dispatchMtbColt(MtbColt mtbColtToDispatch, boolean onlyResiduo, RunnableArgs<MtbColt> onComplete) { public void dispatchMtbColt(MtbColt mtbColtToDispatch, boolean onlyResiduo, RunnableArgs<MtbColt> onComplete) {
this.sendOnLoadingStarted(); this.sendOnLoadingStarted();
new Thread(() -> { mColliMagazzinoRESTConsumer.getByTestata(mtbColtToDispatch, onlyResiduo, false, mtbColt -> {
mColliMagazzinoRESTConsumer.getByTestata(mtbColtToDispatch, onlyResiduo, false, mtbColt -> { this.sendOnLoadingEnded();
this.sendOnLoadingEnded();
ObservableArrayList<MtbColr> mtbColrObservableArrayList = new ObservableArrayList<>(); ObservableArrayList<MtbColr> mtbColrObservableArrayList = new ObservableArrayList<>();
if(mtbColt != null && mtbColt.getMtbColr() != null) mtbColrObservableArrayList.addAll(mtbColt.getMtbColr()); if (mtbColt != null && mtbColt.getMtbColr() != null)
mtbColtToDispatch.setMtbColr(mtbColrObservableArrayList); mtbColrObservableArrayList.addAll(mtbColt.getMtbColr());
mtbColtToDispatch.setMtbColr(mtbColrObservableArrayList);
onComplete.run(mtbColtToDispatch); onComplete.run(mtbColtToDispatch);
}, this::sendError); }, this::sendError);
}).start();
} }