lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/service/impl/ProductMixServiceImpl.java
@@ -29,8 +29,10 @@ }else{ //需要权限过滤 String productIds = loginUser.getProductionIds(); List<String> productIdList = Arrays.asList(productIds.split(",")); rawData = permissionStreamNewService.loadProductMix(loginUser.getId(),productIdList); if (productIds != null && !productIds.isEmpty()) { List<String> productIdList = Arrays.asList(productIds.split(",")); rawData = permissionStreamNewService.loadProductMix(loginUser.getId(),productIdList); } } TreeBuilder builder = new TreeBuilder(); TreeBuilder.CleanResult cleanResult = builder.preprocessData(rawData); lxzn-module-dnc/src/main/java/org/jeecg/modules/dncFlow/controller/DispatchFileController.java
@@ -21,6 +21,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.lang.reflect.InvocationTargetException; import java.util.Arrays; /** @@ -86,6 +87,18 @@ return dispatchFileService.auditDispatchFile(dispatchFileFlowTaskVo); } /** * 批量审批操作 * @param dispatchFileFlowTaskVo * @return */ @AutoLog(value = "nc程序与电子图版签派-批量审批操作") @ApiOperation(value="nc程序与电子图版签派-批量审批操作", notes="nc程序与电子图版签派-批量审批操作") @PostMapping(value = "/approvalBatch") public Result<?> approvalBatch(@RequestBody DispatchFileFlowTaskVo dispatchFileFlowTaskVo) throws InvocationTargetException, IllegalAccessException { return dispatchFileService.auditBatchDispatchFile(dispatchFileFlowTaskVo); } @ApiOperation(value = "获取工作流历史任务", response = FlowTaskDto.class) @GetMapping(value = "/queryHisTaskList") lxzn-module-dnc/src/main/java/org/jeecg/modules/dncFlow/service/IDispatchFileService.java
@@ -5,6 +5,8 @@ import org.jeecg.modules.dncFlow.entity.DispatchFile; import org.jeecg.modules.dncFlow.vo.DispatchFileFlowTaskVo; import java.lang.reflect.InvocationTargetException; /** * @Description: nc程序与电子图版签派 * @Author: jeecg-boot @@ -34,6 +36,12 @@ Result<?> auditDispatchFile(DispatchFileFlowTaskVo dispatchFileFlowTaskVo); /** * 批量审批操作 * @param dispatchFileFlowTaskVo * @return */ Result<?> auditBatchDispatchFile(DispatchFileFlowTaskVo dispatchFileFlowTaskVo) throws InvocationTargetException, IllegalAccessException; /** * 查询审签基本信息 * @param id */ lxzn-module-dnc/src/main/java/org/jeecg/modules/dncFlow/service/impl/DispatchFileServiceImpl.java
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.apache.commons.beanutils.BeanUtils; import org.apache.shiro.SecurityUtils; import org.flowable.common.engine.api.FlowableException; import org.flowable.engine.TaskService; @@ -37,6 +38,7 @@ import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import java.lang.reflect.InvocationTargetException; import java.util.*; /** @@ -230,6 +232,7 @@ * @return */ @Override @Transactional public Result<?> auditDispatchFile(DispatchFileFlowTaskVo dispatchFileFlowTaskVo) { try { // 参数校验 @@ -302,6 +305,36 @@ } /** * 批量审批操作 * @param dispatchFileFlowTaskVo * @return */ @Override @Transactional public Result<?> auditBatchDispatchFile(DispatchFileFlowTaskVo dispatchFileFlowTaskVo) throws InvocationTargetException, IllegalAccessException { if (dispatchFileFlowTaskVo.getTaskIds()==null || dispatchFileFlowTaskVo.getTaskIds().isEmpty()) { return Result.error(CommonCode.INVALID_PARAM.toString()); } if (dispatchFileFlowTaskVo.getTaskIds().contains(",")){ String[] taskIds = dispatchFileFlowTaskVo.getTaskIds().split(","); for (String taskId : taskIds) { FlowMyBusiness flowMyBusiness=flowMyBusinessService.getOne(new QueryWrapper<FlowMyBusiness>().eq("task_id",taskId)); DispatchFileFlowTaskVo dispatchFileFlowTaskVoNew=new DispatchFileFlowTaskVo(); BeanUtils.copyProperties(dispatchFileFlowTaskVoNew, dispatchFileFlowTaskVo); dispatchFileFlowTaskVoNew.setTaskId(taskId); dispatchFileFlowTaskVoNew.setDataId(flowMyBusiness.getDataId()); dispatchFileFlowTaskVoNew.setInstanceId(flowMyBusiness.getProcessInstanceId()); if (dispatchFileFlowTaskVo.getTargetKey().equals("task_prepare")){ reStartDispatchFile(dispatchFileFlowTaskVoNew); }else { auditDispatchFile(dispatchFileFlowTaskVoNew); } } } return Result.OK("操作成功"); } /** * 查询审签基本信息 * @param id */ lxzn-module-dnc/src/main/java/org/jeecg/modules/dncFlow/vo/DispatchFileFlowTaskVo.java
@@ -34,4 +34,9 @@ * false:定型不通过 */ private Boolean stereotype; /** * taskIds */ private String taskIds; } lxzn-module-flowable/src/main/java/org/jeecg/modules/flowable/controller/AssignStreamFlowController.java
@@ -67,6 +67,12 @@ return Result.OK(pageList); } @ApiOperation(value = "通过传入TaskIds判断是否在同一节点") @GetMapping(value = "/isSameNode") public Result isSameNode(@RequestParam(name = "taskIds") String taskIds) { return flowTaskService.isSameNode(taskIds); } @ApiOperation(value = "获取待办列表", response = FlowTaskDto.class) @GetMapping(value = "/todoList") public Result todoList(@ApiParam(value = "当前页码", required = true) @RequestParam (name="pageNum", defaultValue="1") Integer pageNum, lxzn-module-flowable/src/main/java/org/jeecg/modules/flowable/service/IFlowTaskService.java
@@ -113,6 +113,13 @@ */ Result todoList(Integer pageNum, Integer pageSize); /** * 通过传入TaskIds判断是否在同一节点 * @param taskIds * @return */ Result isSameNode(String taskIds); /** * 已办任务列表 lxzn-module-flowable/src/main/java/org/jeecg/modules/flowable/service/impl/FlowTaskServiceImpl.java
@@ -916,6 +916,63 @@ return Result.OK(); } /** * 判断多个任务是否处于同一流程节点 * @param taskIds 逗号分隔的任务ID字符串 * @return 统一结果封装 */ @Override public Result isSameNode(String taskIds) { // 1. 参数校验 if (StringUtils.isBlank(taskIds)) { return Result.error("任务ID不能为空"); } // 2. 分割任务ID String[] taskIdArray = taskIds.split(","); if (taskIdArray.length == 0) { return Result.error("未提供有效的任务ID"); } // 3. 单任务直接返回true if (taskIdArray.length == 1) { return Result.ok(true); } // 4. 多任务检查逻辑 String referenceNodeId = null; String currentNodeId = null; for (String taskId : taskIdArray) { // 4.1 查询任务实例 Task task = taskService.createTaskQuery() .taskId(taskId.trim()) .singleResult(); // 4.2 任务不存在处理 if (task == null) { return Result.error("任务不存在: " + taskId); } // 4.3 获取节点标识(TaskDefinitionKey) currentNodeId = task.getTaskDefinitionKey(); // 4.4 首次遍历初始化参考节点 if (referenceNodeId == null) { referenceNodeId = currentNodeId; continue; } // 4.5 节点不一致直接返回 if (!referenceNodeId.equals(currentNodeId)) { return Result.ok("节点不一致"); } } // 5. 所有任务节点一致 return Result.ok(currentNodeId); } /** * 代办任务列表 *