From cc44920da3d40b8248b67560026e891afdd1a6ab Mon Sep 17 00:00:00 2001 From: lyh <925863403@qq.com> Date: 星期四, 08 五月 2025 17:57:14 +0800 Subject: [PATCH] 1.查询可以被引用的部件接口开发完成 2.借用部件(可批量) 开发完成 3.修改原有新增、修改部件接口 完成 4.修改原有删除文档与导入文档接口 完成 5.修改工作流问题 --- lxzn-module-flowable/src/main/java/org/jeecg/modules/flowable/service/impl/FlowTaskServiceImpl.java | 43 +++++++++++++++++++++++++++++++++++++++---- 1 files changed, 39 insertions(+), 4 deletions(-) diff --git a/lxzn-module-flowable/src/main/java/org/jeecg/modules/flowable/service/impl/FlowTaskServiceImpl.java b/lxzn-module-flowable/src/main/java/org/jeecg/modules/flowable/service/impl/FlowTaskServiceImpl.java index e4f7eb4..6b715e9 100644 --- a/lxzn-module-flowable/src/main/java/org/jeecg/modules/flowable/service/impl/FlowTaskServiceImpl.java +++ b/lxzn-module-flowable/src/main/java/org/jeecg/modules/flowable/service/impl/FlowTaskServiceImpl.java @@ -668,6 +668,29 @@ flowTaskVo.setTaskId(business.getTaskId()); return findReturnTaskList(flowTaskVo); } + + /** + * 缁撴潫娴佺▼ + * @param processInstanceId 娴佺▼瀹炰緥 ID + * @param deleteReason 瀹氫箟鍒犻櫎鍘熷洜 + */ + public Result<?> end(String processInstanceId, String deleteReason) { + try { + // 寮哄埗缁撴潫娴佺▼瀹炰緥 + runtimeService.deleteProcessInstance(processInstanceId, deleteReason); + // 鍒犻櫎鍏宠仈娴佺▼鐨勪笟鍔� + FlowMyBusiness flowMyBusiness=flowMyBusinessService.getFlowMyBusiness(processInstanceId); + flowMyBusinessService.removeById(flowMyBusiness.getId()); + System.out.println("Process instance with ID " + processInstanceId + " has been forcefully ended."); + } catch (Exception e) { + System.err.println("Failed to force end process instance: " + e.getMessage()); + } + + // 鍏抽棴娴佺▼寮曟搸 + processEngine.close(); + return Result.OK("娴佺▼宸茬粨鏉�"); + } + /** * 鑾峰彇鎵�鏈夊彲鍥為��鐨勮妭鐐� * @@ -1039,18 +1062,30 @@ Page page = new Page(pageNum, pageSize); String username = iFlowThirdService.getLoginUser().getUsername(); flowMyBusinessDto.setCurrentUser(username); - IPage<FlowTaskDto> flowTaskDtoIPage = flowMyBusinessService.getPageListMyBusiness(page,flowMyBusinessDto); - flowTaskDtoIPage.getRecords().forEach(flowTaskDto -> { + List<FlowTaskDto> list = flowMyBusinessService.ListMyBusiness(flowMyBusinessDto); + list.forEach(flowTaskDto -> { // 娴佺▼鍙戣捣浜轰俊鎭� HistoricProcessInstance historicProcessInstance = historyService.createHistoricProcessInstanceQuery() .processInstanceId(flowTaskDto.getProcInsId()) .singleResult(); SysUser startUser = iFlowThirdService.getUserByUsername(historicProcessInstance.getStartUserId()); - flowTaskDto.setStartUserId(startUser.getUsername()); - flowTaskDto.setStartUserName(startUser.getRealname()); + if (startUser!=null){ + flowTaskDto.setStartUserId(startUser.getUsername()); + flowTaskDto.setStartUserName(startUser.getRealname()); + } List<String> departNamesByUsername = iFlowThirdService.getDepartNamesByUsername(historicProcessInstance.getStartUserId()); flowTaskDto.setStartDeptName(CollUtil.join(departNamesByUsername,"锛�")); + if (flowTaskDto.getTodoUsers() == null){ + flowTaskDto.setTodoUsers(""); + }else { + //鍘婚櫎[] + flowTaskDto.setTodoUsers(flowTaskDto.getTodoUsers().replaceAll("\\[", "").replaceAll("\\]", "")); + flowTaskDto.setTodoUsers(flowTaskDto.getTodoUsers().replaceAll("\"", "")); + } }); + IPage<FlowTaskDto> flowTaskDtoIPage = new Page<>(); + flowTaskDtoIPage.setRecords(list); + flowTaskDtoIPage.setTotal(page.getTotal()); return Result.OK(flowTaskDtoIPage); } -- Gitblit v1.9.3