add roles to label
This commit is contained in:
parent
bb6579614e
commit
c1120d5745
2 changed files with 13 additions and 2 deletions
|
@ -191,7 +191,19 @@ public class LabelTypeService implements Serializable {
|
|||
}
|
||||
|
||||
public OptionalEntity<LabelType> getLabelType(final String id) {
|
||||
return labelTypeBhv.selectByPK(id);
|
||||
return labelTypeBhv.selectByPK(id).map(entity -> {
|
||||
final List<LabelToRole> wctrtmList = labelToRoleBhv.selectList(wctrtmCb -> {
|
||||
wctrtmCb.query().setLabelTypeId_Equal(entity.getId());
|
||||
});
|
||||
if (!wctrtmList.isEmpty()) {
|
||||
final List<String> roleTypeIds = new ArrayList<String>(wctrtmList.size());
|
||||
for (final LabelToRole mapping : wctrtmList) {
|
||||
roleTypeIds.add(mapping.getRoleTypeId());
|
||||
}
|
||||
entity.setRoleTypeIds(roleTypeIds.toArray(new String[roleTypeIds.size()]));
|
||||
}
|
||||
return entity;
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
|
||||
package org.codelibs.fess.app.web.admin.labeltype;
|
||||
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.codelibs.fess.Constants;
|
||||
|
|
Loading…
Add table
Reference in a new issue