Просмотр исходного кода

Merge branch 'fix/ScriptObject' into 'wrdp'

修复ActionListWithPersonWithUnitObject

See merge request o2oa/o2oa!1895
o2null 5 лет назад
Родитель
Сommit
56ecb8d1f1

+ 3 - 4
o2server/x_organization_assemble_express/src/main/java/com/x/organization/assemble/express/jaxrs/identity/ActionListWithPersonWithUnitObject.java

@@ -64,12 +64,11 @@ class ActionListWithPersonWithUnitObject extends BaseAction {
 		Root<Identity> root = cq.from(Identity.class);
 		Predicate p = cb.disjunction();
 		for (Pair o : cartesian) {
-			p = cb.or(cb.and(cb.equal(root.get(Identity_.unit), o.getUnit()),
+			p = cb.or(p, cb.and(cb.equal(root.get(Identity_.unit), o.getUnit()),
 					cb.equal(root.get(Identity_.person), o.getPerson())));
 		}
-		List<String> identityIds = em.createQuery(cq.select(root.get(Identity_.id)).where(p))
-				.getResultList().stream().distinct().collect(Collectors.toList());
-		identityIds = ListTools.trim(identityIds, true, true);
+		List<String> identityIds = em.createQuery(cq.select(root.get(Identity_.id)).where(p)).getResultList().stream()
+				.distinct().collect(Collectors.toList());
 		List<Identity> list = business.identity().pick(identityIds);
 		for (Identity o : list) {
 			wos.add(this.convert(business, o, Wo.class));