diff --git a/jeecg-module-supervision/src/main/java/org/jeecg/modules/bg/fixcontact/constant/FixContactConstant.java b/jeecg-module-supervision/src/main/java/org/jeecg/modules/bg/fixcontact/constant/FixContactConstant.java index 834f1cb..fce2931 100644 --- a/jeecg-module-supervision/src/main/java/org/jeecg/modules/bg/fixcontact/constant/FixContactConstant.java +++ b/jeecg-module-supervision/src/main/java/org/jeecg/modules/bg/fixcontact/constant/FixContactConstant.java @@ -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"; } /** 业务状态 */ diff --git a/jeecg-module-supervision/src/main/java/org/jeecg/modules/bg/fixcontact/flow/FixContactFlow.java b/jeecg-module-supervision/src/main/java/org/jeecg/modules/bg/fixcontact/flow/FixContactFlow.java index 0ac095a..8c318b4 100644 --- a/jeecg-module-supervision/src/main/java/org/jeecg/modules/bg/fixcontact/flow/FixContactFlow.java +++ b/jeecg-module-supervision/src/main/java/org/jeecg/modules/bg/fixcontact/flow/FixContactFlow.java @@ -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 leaderList = this.getUsersByDeptAndRole(deptId, FixContactConstant.RoleCode.DEPT_LEADER_ROLE_CODE); + List 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 getLeaderApproveUserList(DelegateExecution execution) { + List 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 数据解析方法(配合流程表单设计器使用) // ===================================================================