xiangpei
2025-03-05 0dc45111f75bf924d65cec00019f70c405e05225
flowable/src/main/java/com/ycl/service/common/TaskCommonService.java
@@ -11,6 +11,7 @@
import com.ycl.domain.vo.FormDetailVO;
import com.ycl.flow.FindNextNodeUtil;
import com.ycl.service.ISysFormService;
import com.ycl.system.service.ISysDeptService;
import com.ycl.system.service.ISysDictDataService;
import com.ycl.system.service.ISysDictTypeService;
import com.ycl.system.service.ISysUserService;
@@ -47,6 +48,7 @@
    private final TaskService taskService;
    private final HistoryService historyService;
    private final ISysUserService sysUserService;
    private final ISysDeptService deptService;
    private final ISysDictTypeService sysDictDService;
    /**
@@ -110,7 +112,7 @@
        formDetailVO.setCanJump(this.checkHasExeProperty(currentElement.getExtensionElements().get("properties"), ProcessConstants.EXTENSION_PROPERTY_CAN_JUMP_TEXT));
        formDetailVO.setCanWait(this.checkHasExeProperty(currentElement.getExtensionElements().get("properties"), ProcessConstants.EXTENSION_PROPERTY_CAN_WAIT_TEXT));
        formDetailVO.setCanHangup(this.checkHasExeProperty(currentElement.getExtensionElements().get("properties"), ProcessConstants.EXTENSION_PROPERTY_CAN_HANGUP_TEXT));
        formDetailVO.setUserTask(currentElement);
        defKeys.add(formDetailVO);
        this.beforeNodeInfo(currentElement, defKeys);
@@ -180,7 +182,9 @@
                        formDetailVO.setBeforeNodeName(incomingFlow.getSourceFlowElement().getName());
                        formDetailVO.setCanJump(this.checkHasExeProperty(currentElement.getExtensionElements().get("properties"), ProcessConstants.EXTENSION_PROPERTY_CAN_JUMP_TEXT));
                        formDetailVO.setCanWait(this.checkHasExeProperty(currentElement.getExtensionElements().get("properties"), ProcessConstants.EXTENSION_PROPERTY_CAN_WAIT_TEXT));
                        formDetailVO.setUserTask((UserTask) incomingFlow.getSourceFlowElement());
                        defKeys.add(formDetailVO);
                        continue;
                    } else {
                        beforeNodeInfo(incomingFlow.getSourceFlowElement(), defKeys);
                    }
@@ -196,7 +200,9 @@
                        formDetailVO.setBeforeNodeName(incomingFlow.getSourceFlowElement().getName());
                        formDetailVO.setCanJump(this.checkHasExeProperty(currentElement.getExtensionElements().get("properties"), ProcessConstants.EXTENSION_PROPERTY_CAN_JUMP_TEXT));
                        formDetailVO.setCanWait(this.checkHasExeProperty(currentElement.getExtensionElements().get("properties"), ProcessConstants.EXTENSION_PROPERTY_CAN_WAIT_TEXT));
                        formDetailVO.setUserTask((UserTask) incomingFlow.getSourceFlowElement());
                        defKeys.add(formDetailVO);
                        continue;
                    } else {
                        beforeNodeInfo(incomingFlow.getSourceFlowElement(), defKeys);
                    }
@@ -207,7 +213,7 @@
    /**
     * 获取当前节点的上一节点id,不反悔当前节点信息,如果前面是并行,那么会返回多个
     * 获取当前节点的上一节点id,不返回当前节点信息,如果前面是并行,那么会返回多个
     *
     * @param processDefId     流程定义id
     * @param currentNodeDefId 当前节点定义id
@@ -317,14 +323,17 @@
     * @return
     */
    public List<String> getCurrentUserGroups() {
        String deptId = "dept:" + SecurityUtils.getLoginUser().getDeptId();
        List<String> roleIds;
        if (CollectionUtils.isEmpty(SecurityUtils.getLoginUser().getUser().getRoles())) {
            roleIds = new ArrayList<>(1);
        } else {
            roleIds = SecurityUtils.getLoginUser().getUser().getRoles().stream().map(role -> role.getRoleId() + "").collect(Collectors.toList());
        }
        roleIds.add(deptId);
        if (Objects.nonNull(SecurityUtils.getLoginUser().getDeptId())) {
            List<Long> deptIds = deptService.getChildIds(SecurityUtils.getLoginUser().getDeptId());
            List<String> deptIdList = deptIds.stream().map(id -> "dept:" + id).collect(Collectors.toList());
            roleIds.addAll(deptIdList);
        }
        return roleIds;
    }