..
This commit is contained in:
+41
@@ -0,0 +1,41 @@
|
||||
package com.budwk.app.flow.handler;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.exception.BaseException;
|
||||
import com.budwk.app.flow.engine.AssignmentHandler;
|
||||
import com.budwk.app.flow.engine.core.Execution;
|
||||
import com.budwk.app.flow.engine.core.ServiceContext;
|
||||
import com.budwk.app.flow.engine.model.TaskModel;
|
||||
import com.budwk.app.sys.models.Sys_user;
|
||||
import com.budwk.app.sys.models.Sys_user_role;
|
||||
import com.budwk.app.web.controllers.open.commons.service.CommonService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 获取协会审批人根据流程变量参数(clubId) 必传
|
||||
*/
|
||||
public class FlowClubPresidentByArgsAssignmentHandler implements AssignmentHandler {
|
||||
@Override
|
||||
public List<String> assign(TaskModel model, Execution execution) {
|
||||
String clubId = execution.getArgs().getStr("clubId");
|
||||
if (StrUtil.isBlank(clubId)) {
|
||||
throw new BaseException("参数 clubId 不能为空");
|
||||
}
|
||||
|
||||
CommonService commonService = ServiceContext.find(CommonService.class);
|
||||
List<Sys_user> users = commonService.findUserInfoByRoleCode(Sys_user_role::getClubId, clubId, RoleConstant.CLUB_PRESIDENT);
|
||||
return users.stream().map(Sys_user::getId).toList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return "获取协会会长(根据args中的clubId)";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return AssignmentHandler.super.getOrder();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user