增加订单复选搜索

This commit is contained in:
wuweihua
2026-10-22 17:40:57 +08:00
parent 23236ec141
commit 4ec28de073
5 changed files with 144 additions and 19 deletions
@@ -3415,7 +3415,7 @@ public class PrcPriceSetServiceImpl implements IPrcPriceSetService
}
PrcPriceSetVersion effect = null;
PrcPriceSetVersion pending = null;
PrcPriceSetVersion best = null;
List<PrcPriceSetVersion> ranked = new ArrayList<PrcPriceSetVersion>();
for (PrcPriceSetVersion v : list)
{
if (v == null || v.getPsvId() == null)
@@ -3434,15 +3434,58 @@ public class PrcPriceSetServiceImpl implements IPrcPriceSetService
{
pending = v;
}
if (best == null || (v.getVersionSeq() != null && best.getVersionSeq() != null
&& v.getVersionSeq().intValue() > best.getVersionSeq().intValue())
|| (best.getVersionSeq() == null && v.getVersionSeq() != null))
}
if (effect != null)
{
ranked.add(effect);
}
if (pending != null && (effect == null || !pending.getPsvId().equals(effect.getPsvId())))
{
ranked.add(pending);
}
list.stream()
.filter(v -> v != null && v.getPsvId() != null)
.filter(v -> excludePsvId == null || !excludePsvId.equals(v.getPsvId()))
.sorted((a, b) -> {
int sa = a.getVersionSeq() == null ? 0 : a.getVersionSeq().intValue();
int sb = b.getVersionSeq() == null ? 0 : b.getVersionSeq().intValue();
return Integer.compare(sb, sa);
})
.forEach(v -> {
boolean exists = false;
for (PrcPriceSetVersion r : ranked)
{
if (r.getPsvId().equals(v.getPsvId()))
{
exists = true;
break;
}
}
if (!exists)
{
ranked.add(v);
}
});
for (PrcPriceSetVersion cand : ranked)
{
if (versionHasSetProducts(cand.getPsvId()))
{
best = v;
return cand.getPsvId();
}
}
PrcPriceSetVersion pick = effect != null ? effect : (pending != null ? pending : best);
return pick == null ? null : pick.getPsvId();
return ranked.isEmpty() ? null : ranked.get(0).getPsvId();
}
private boolean versionHasSetProducts(Long psvId)
{
if (psvId == null)
{
return false;
}
PrcPriceSetProduct pq = new PrcPriceSetProduct();
pq.setPsvId(psvId);
List<PrcPriceSetProduct> products = setProductMapper.selectPrcPriceSetProductList(pq);
return products != null && !products.isEmpty();
}
/**