潘志宝
9 天以前 9d5be382e52f9ac57199d5ef75cc23f925a4cdb0
iailab-module-bpm/iailab-module-bpm-biz/src/main/java/com/iailab/module/bpm/controller/admin/task/BpmProcessInstanceController.java
@@ -4,14 +4,10 @@
import com.iailab.framework.common.pojo.CommonResult;
import com.iailab.framework.common.pojo.PageResult;
import com.iailab.framework.common.util.number.NumberUtils;
import com.iailab.module.bpm.controller.admin.task.vo.instance.BpmProcessInstanceCancelReqVO;
import com.iailab.module.bpm.controller.admin.task.vo.instance.BpmProcessInstanceCreateReqVO;
import com.iailab.module.bpm.controller.admin.task.vo.instance.BpmProcessInstancePageReqVO;
import com.iailab.module.bpm.controller.admin.task.vo.instance.BpmProcessInstanceRespVO;
import com.iailab.module.bpm.controller.admin.task.vo.instance.*;
import com.iailab.module.bpm.convert.task.BpmProcessInstanceConvert;
import com.iailab.module.bpm.dal.dataobject.definition.BpmCategoryDO;
import com.iailab.module.bpm.dal.dataobject.definition.BpmProcessDefinitionInfoDO;
import com.iailab.module.bpm.framework.flowable.core.util.BpmnModelUtils;
import com.iailab.module.bpm.service.definition.BpmCategoryService;
import com.iailab.module.bpm.service.definition.BpmProcessDefinitionService;
import com.iailab.module.bpm.service.task.BpmProcessInstanceService;
@@ -39,6 +35,7 @@
import static com.iailab.framework.common.util.collection.CollectionUtils.convertList;
import static com.iailab.framework.common.util.collection.CollectionUtils.convertSet;
import static com.iailab.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
@Tag(name = "管理后台 - 流程实例") // 流程实例,通过流程定义创建的一次“申请”
@RestController
@@ -131,15 +128,13 @@
                processInstance.getProcessDefinitionId());
        BpmProcessDefinitionInfoDO processDefinitionInfo = processDefinitionService.getProcessDefinitionInfo(
                processInstance.getProcessDefinitionId());
        String bpmnXml = BpmnModelUtils.getBpmnXml(
                processDefinitionService.getProcessDefinitionBpmnModel(processInstance.getProcessDefinitionId()));
        AdminUserRespDTO startUser = adminUserApi.getUser(NumberUtils.parseLong(processInstance.getStartUserId())).getCheckedData();
        DeptRespDTO dept = null;
        if (startUser != null) {
        if (startUser != null && startUser.getDeptId() != null) {
            dept = deptApi.getDept(startUser.getDeptId()).getCheckedData();
        }
        return success(BpmProcessInstanceConvert.INSTANCE.buildProcessInstance(processInstance,
                processDefinition, processDefinitionInfo, bpmnXml, startUser, dept));
                processDefinition, processDefinitionInfo, startUser, dept));
    }
    @DeleteMapping("/cancel-by-start-user")
@@ -160,4 +155,19 @@
        return success(true);
    }
    @GetMapping("/get-approval-detail")
    @Operation(summary = "获得审批详情")
    @Parameter(name = "id", description = "流程实例的编号", required = true)
    @PreAuthorize("@ss.hasPermission('bpm:process-instance:query')")
    public CommonResult<BpmApprovalDetailRespVO> getApprovalDetail(@Valid BpmApprovalDetailReqVO reqVO) {
        return success(processInstanceService.getApprovalDetail(getLoginUserId(), reqVO));
    }
    @GetMapping("/get-bpmn-model-view")
    @Operation(summary = "获取流程实例的 BPMN 模型视图", description = "在【流程详细】界面中,进行调用")
    @Parameter(name = "id", description = "流程实例的编号", required = true)
    public CommonResult<BpmProcessInstanceBpmnModelViewRespVO> getProcessInstanceBpmnModelView(@RequestParam(value = "id") String id) {
        return success(processInstanceService.getProcessInstanceBpmnModelView(id));
    }
}