学向勤中得,萤窗万卷书。这篇文章主要讲述flowable设计器自定义自己的人员选择器相关的知识,希望能为你提供帮助。
@OC](设计器自定义自己的人员、组选择器)
背景
很多外国的设计是不合适国内的使用习惯,就比方说人员选择器和组选择器,他们都是id和第一个名字,中国哪里能看的懂呀,所以我们自定义修改一下。
组选择器
@RestController
@RequestMapping("/app")
public class EditorGroupsResource
@Autowired
protected IdmIdentityService idmIdentityService;
@RequestMapping(value = "https://www.songbingjia.com/rest/editor-groups", method = RequestMethod.GET)
public ResultListDataRepresentation getGroups(@RequestParam(required = false, value = "https://www.songbingjia.com/android/filter") String filter)
if (StringUtils.isNotBlank(filter))
filter = filter.trim();
String sql = "select * from act_id_group where NAME_ like #name";
filter = "%" + filter + "%";
List< Group> groups = idmIdentityService.createNativeGroupQuery().sql(sql).parameter("name", filter).listPage(0, 10);
List< GroupRepresentation> result = new ArrayList< > ();
for (Group group : groups)
result.add(new GroupRepresentation(group));
return new ResultListDataRepresentation(result);
return null;
人员选择器
@RestController
@RequestMapping("/app")
public class EditorUsersResource
@Autowired
protected IdmIdentityService idmIdentityService;
@Autowired
protected ManagementService managementService;
@RequestMapping(value = "https://www.songbingjia.com/rest/editor-users", method = RequestMethod.GET)
public ResultListDataRepresentation getUsers(@RequestParam(value = "https://www.songbingjia.com/android/filter", required = false) String filter)
if (StringUtils.isNotBlank(filter))
filter = filter.trim();
String sql = "select * from act_id_user where ID_ like #id or LAST_ like #name";
filter = "%"+filter+"%";
List< User> matchingUsers = idmIdentityService.createNativeUserQuery().sql(sql).parameter("id",filter).parameter("name",filter).listPage(0, 10); List< UserRepresentation> userRepresentations = new ArrayList< > (matchingUsers.size());
for (User user : matchingUsers)
userRepresentations.add(new UserRepresentation(user));
return new ResultListDataRepresentation(userRepresentations);
return null;
实现效果
文章图片
【flowable设计器自定义自己的人员选择器】
文章图片
推荐阅读
- Springboot自动装配详解#yyds干货盘点#
- #yyds干货盘点# Java参数传递的前世今生
- flowable 获取自定义属性值
- #yyds干货盘点# 来,听我讲讲常用并发容器
- flowable BPMN的组件汉化
- #私藏项目实操分享# 对于 basis 管理员来说,ABAP Platform 意味着什么
- JDK ThreadPoolExecutor核心原理与实践
- flowable用户组的处理
- Ubuntu 下配置 Qt 的 FFmpeg 的开发环境