!102 feat(fixcontact): 新增所领导审批流程变量与表达式方法并修复领导查询

Merge pull request !102 from wsm/feature/fix_contact_select_ld
This commit is contained in:
wsm
2026-08-04 02:29:26 +00:00
committed by Gitee
2 changed files with 36 additions and 3 deletions
@@ -38,6 +38,10 @@ public final class FixContactConstant {
public static final String TEM_IMPL_WORKER = "tem_impl_worker";
/** 部门经办人(流程变量,前端写入) */
public static final String SUB_APPROVE_USER = "sub_approve_user";
/** 是否需要所领导审批(流程变量,前端写入) */
public static final String IS_NEED_LEADER_APPROVE = "is_need_leader_approve";
/** 所领导审批人(流程变量,前端写入,逗号分隔多人) */
public static final String LEADER_APPROVE_USER = "leader_approve_user";
}
/** 业务状态 */
@@ -39,7 +39,7 @@ public class FixContactFlow {
// ===================================================================
private FixedContact20260730 getFixedContact(DelegateExecution execution) {
Object businessKey = execution.getVariable("businessKey");
Object businessKey = execution.getVariable("business_id");
if (businessKey == null || StringUtils.isBlank(businessKey.toString())) {
log.error("【定点联系-流程表达式】未获取到有效的业务表单ID, processInstanceId: {}, businessKey: {}",
@@ -268,10 +268,10 @@ public class FixContactFlow {
execution.getProcessInstanceId());
return Collections.emptyList();
}
List<String> leaderList = this.getUsersByDeptAndRole(deptId, FixContactConstant.RoleCode.DEPT_LEADER_ROLE_CODE);
List<String> leaderList = this.getUsersByDeptAndRole(deptId, FixContactConstant.RoleCode.DEPT_LEADER_ID);
if (CollectionUtils.isEmpty(leaderList)) {
log.warn("【定点联系-流程表达式】部门: {} 下未配置角色为 {} 的用户,领导列表为空",
deptId, FixContactConstant.RoleCode.DEPT_LEADER_ROLE_CODE);
deptId, FixContactConstant.RoleCode.DEPT_LEADER_ID);
return Collections.emptyList();
}
log.info("【定点联系-流程表达式】查询到部门: {} 的领导列表: {}", deptId, leaderList);
@@ -383,6 +383,35 @@ public class FixContactFlow {
.count();
}
// ${fixContactFlow.getIsNeedLeaderApprove(execution)}
public String getIsNeedLeaderApprove(DelegateExecution execution) {
String value = this.getVar(execution, FixContactConstant.FlowVarName.IS_NEED_LEADER_APPROVE);
log.info("【定点联系-流程表达式】读取是否需要所领导审批, processInstanceId: {}, value: {}",
execution.getProcessInstanceId(), value);
return value;
}
// ${fixContactFlow.getLeaderApproveUser(execution)}
public String getLeaderApproveUser(DelegateExecution execution) {
String value = this.getVar(execution, FixContactConstant.FlowVarName.LEADER_APPROVE_USER);
log.info("【定点联系-流程表达式】读取所领导审批人, processInstanceId: {}, value: {}",
execution.getProcessInstanceId(), value);
return value;
}
// ${fixContactFlow.getLeaderApproveUserList(execution)}
public List<String> getLeaderApproveUserList(DelegateExecution execution) {
List<String> userList = this.getVarAsList(execution, FixContactConstant.FlowVarName.LEADER_APPROVE_USER);
log.info("【定点联系-流程表达式】读取所领导审批人列表, count: {}, processInstanceId: {}",
userList.size(), execution.getProcessInstanceId());
return userList;
}
// ${fixContactFlow.getLeaderApproveUserListCount(execution)}
public int getLeaderApproveUserListCount(DelegateExecution execution) {
return this.getLeaderApproveUserList(execution).size();
}
// ===================================================================
// JSON 数据解析方法(配合流程表单设计器使用)
// ===================================================================