Aggiornato filtro ordine in caso di recupera UL.
This commit is contained in:
parent
a0c85b3fcb
commit
473b9f22fb
12
.idea/deploymentTargetDropDown.xml
generated
12
.idea/deploymentTargetDropDown.xml
generated
@ -1,6 +1,18 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="deploymentTargetDropDown">
|
<component name="deploymentTargetDropDown">
|
||||||
|
<runningDeviceTargetSelectedWithDropDown>
|
||||||
|
<Target>
|
||||||
|
<type value="RUNNING_DEVICE_TARGET" />
|
||||||
|
<deviceKey>
|
||||||
|
<Key>
|
||||||
|
<type value="SERIAL_NUMBER" />
|
||||||
|
<value value="7da0808" />
|
||||||
|
</Key>
|
||||||
|
</deviceKey>
|
||||||
|
</Target>
|
||||||
|
</runningDeviceTargetSelectedWithDropDown>
|
||||||
|
<timeTargetWasSelectedWithDropDown value="2022-03-28T14:25:54.077010500Z" />
|
||||||
<runningDeviceTargetsSelectedWithDialog>
|
<runningDeviceTargetsSelectedWithDialog>
|
||||||
<Target>
|
<Target>
|
||||||
<type value="RUNNING_DEVICE_TARGET" />
|
<type value="RUNNING_DEVICE_TARGET" />
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
package it.integry.integrywmsnative.core.model;
|
package it.integry.integrywmsnative.core.model;
|
||||||
|
|
||||||
|
import android.text.TextUtils;
|
||||||
|
|
||||||
import androidx.databinding.ObservableArrayList;
|
import androidx.databinding.ObservableArrayList;
|
||||||
|
|
||||||
import com.annimon.stream.Optional;
|
import com.annimon.stream.Optional;
|
||||||
@ -8,6 +10,7 @@ import com.annimon.stream.Stream;
|
|||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -574,9 +577,41 @@ public class MtbColt extends EntityBase {
|
|||||||
String xmlPrefix = "{\"whereCond\": \"";
|
String xmlPrefix = "{\"whereCond\": \"";
|
||||||
String xmlSuffix = "\"}";
|
String xmlSuffix = "\"}";
|
||||||
|
|
||||||
StringBuilder whereCond = new StringBuilder();
|
// StringBuilder whereCond = new StringBuilder();
|
||||||
|
String whereCond;
|
||||||
|
List<String> conditions = new ArrayList<>();
|
||||||
|
String existingFilter;
|
||||||
|
if (this.filtroOrdini != null) {
|
||||||
|
existingFilter = this.filtroOrdini;
|
||||||
|
existingFilter = existingFilter.replace(xmlPrefix, "").replace(xmlSuffix, "");
|
||||||
|
conditions.add(existingFilter);
|
||||||
|
} else {
|
||||||
|
existingFilter = "";
|
||||||
|
}
|
||||||
|
|
||||||
if (filtroOrdineDtos != null && filtroOrdineDtos.size() > 0) {
|
|
||||||
|
for (FiltroOrdineDTO filtroOrdineDTO : filtroOrdineDtos) {
|
||||||
|
try {
|
||||||
|
String condition = (String.format("(d.g = %s AND d.d = %s and d.n = %s",
|
||||||
|
UtilityDB.valueToString(filtroOrdineDTO.getGestioneOrd()),
|
||||||
|
UtilityDB.valueToString(UtilityDate.formatDate(filtroOrdineDTO.getDataOrdD(), UtilityDate.COMMONS_DATE_FORMATS.YMD_SLASH)),
|
||||||
|
UtilityDB.valueToString(filtroOrdineDTO.getNumOrd())));
|
||||||
|
|
||||||
|
if (!UtilityString.isNullOrEmpty(filtroOrdineDTO.getDataConsS())) {
|
||||||
|
condition += (String.format(" AND dr.dc = %s",
|
||||||
|
UtilityDB.valueToString(UtilityDate.formatDate(filtroOrdineDTO.getDataConsD(), UtilityDate.COMMONS_DATE_FORMATS.YMD_SLASH))));
|
||||||
|
}
|
||||||
|
|
||||||
|
condition += ")";
|
||||||
|
if (!existingFilter.contains(condition)) {
|
||||||
|
conditions.add(condition);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*if (filtroOrdineDtos != null && filtroOrdineDtos.size() > 0) {
|
||||||
|
|
||||||
for (int i = 0; i < filtroOrdineDtos.size(); i++) {
|
for (int i = 0; i < filtroOrdineDtos.size(); i++) {
|
||||||
FiltroOrdineDTO x = filtroOrdineDtos.get(i);
|
FiltroOrdineDTO x = filtroOrdineDtos.get(i);
|
||||||
@ -602,7 +637,8 @@ public class MtbColt extends EntityBase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}*/
|
||||||
|
whereCond = TextUtils.join(" OR ", conditions);
|
||||||
|
|
||||||
this.filtroOrdini = xmlPrefix + whereCond + xmlSuffix;
|
this.filtroOrdini = xmlPrefix + whereCond + xmlSuffix;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user