Commit 3b8dee4963df6ddaa11baa11a8dbcd01cb298f2f
1 parent
cc27652f
BPM:完善相关的代码注释
Showing
8 changed files
with
31 additions
and
29 deletions
yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/enums/task/BpmTaskStatustEnum.java renamed to yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/enums/task/BpmTaskStatusEnum.java
| @@ -11,7 +11,7 @@ import lombok.Getter; | @@ -11,7 +11,7 @@ import lombok.Getter; | ||
| 11 | */ | 11 | */ |
| 12 | @Getter | 12 | @Getter |
| 13 | @AllArgsConstructor | 13 | @AllArgsConstructor |
| 14 | -public enum BpmTaskStatustEnum { | 14 | +public enum BpmTaskStatusEnum { |
| 15 | 15 | ||
| 16 | RUNNING(1, "审批中"), | 16 | RUNNING(1, "审批中"), |
| 17 | APPROVE(2, "审批通过"), | 17 | APPROVE(2, "审批通过"), |
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/BpmTaskController.java
| @@ -93,7 +93,7 @@ public class BpmTaskController { | @@ -93,7 +93,7 @@ public class BpmTaskController { | ||
| 93 | @GetMapping("manager-page") | 93 | @GetMapping("manager-page") |
| 94 | @Operation(summary = "获取全部任务的分页", description = "用于【流程任务】菜单") | 94 | @Operation(summary = "获取全部任务的分页", description = "用于【流程任务】菜单") |
| 95 | @PreAuthorize("@ss.hasPermission('bpm:task:mananger-query')") | 95 | @PreAuthorize("@ss.hasPermission('bpm:task:mananger-query')") |
| 96 | - public CommonResult<PageResult<BpmTaskRespVO>> getDoneTaskPage(@Valid BpmTaskPageReqVO pageVO) { | 96 | + public CommonResult<PageResult<BpmTaskRespVO>> getTaskManagerPage(@Valid BpmTaskPageReqVO pageVO) { |
| 97 | PageResult<HistoricTaskInstance> pageResult = taskService.getTaskPage(getLoginUserId(), pageVO); | 97 | PageResult<HistoricTaskInstance> pageResult = taskService.getTaskPage(getLoginUserId(), pageVO); |
| 98 | if (CollUtil.isEmpty(pageResult.getList())) { | 98 | if (CollUtil.isEmpty(pageResult.getList())) { |
| 99 | return success(PageResult.empty()); | 99 | return success(PageResult.empty()); |
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/dal/dataobject/oa/BpmOALeaveDO.java
| 1 | package cn.iocoder.yudao.module.bpm.dal.dataobject.oa; | 1 | package cn.iocoder.yudao.module.bpm.dal.dataobject.oa; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | 3 | import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; |
| 4 | -import cn.iocoder.yudao.module.bpm.enums.task.BpmTaskStatustEnum; | 4 | +import cn.iocoder.yudao.module.bpm.enums.task.BpmTaskStatusEnum; |
| 5 | import com.baomidou.mybatisplus.annotation.TableId; | 5 | import com.baomidou.mybatisplus.annotation.TableId; |
| 6 | import com.baomidou.mybatisplus.annotation.TableName; | 6 | import com.baomidou.mybatisplus.annotation.TableName; |
| 7 | import lombok.*; | 7 | import lombok.*; |
| @@ -57,7 +57,7 @@ public class BpmOALeaveDO extends BaseDO { | @@ -57,7 +57,7 @@ public class BpmOALeaveDO extends BaseDO { | ||
| 57 | /** | 57 | /** |
| 58 | * 审批结果 | 58 | * 审批结果 |
| 59 | * | 59 | * |
| 60 | - * 枚举 {@link BpmTaskStatustEnum} | 60 | + * 枚举 {@link BpmTaskStatusEnum} |
| 61 | * 考虑到简单,所以直接复用了 BpmProcessInstanceStatusEnum 枚举,也可以自己定义一个枚举哈 | 61 | * 考虑到简单,所以直接复用了 BpmProcessInstanceStatusEnum 枚举,也可以自己定义一个枚举哈 |
| 62 | */ | 62 | */ |
| 63 | private Integer status; | 63 | private Integer status; |
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/framework/flowable/core/candidate/BpmTaskCandidateInvoker.java
| @@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil; | @@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil; | ||
| 4 | import cn.hutool.core.lang.Assert; | 4 | import cn.hutool.core.lang.Assert; |
| 5 | import cn.hutool.core.util.StrUtil; | 5 | import cn.hutool.core.util.StrUtil; |
| 6 | import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; | 6 | import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; |
| 7 | +import cn.iocoder.yudao.framework.datapermission.core.annotation.DataPermission; | ||
| 7 | import cn.iocoder.yudao.module.bpm.framework.flowable.core.enums.BpmTaskCandidateStrategyEnum; | 8 | import cn.iocoder.yudao.module.bpm.framework.flowable.core.enums.BpmTaskCandidateStrategyEnum; |
| 8 | import cn.iocoder.yudao.module.bpm.framework.flowable.core.util.BpmnModelUtils; | 9 | import cn.iocoder.yudao.module.bpm.framework.flowable.core.util.BpmnModelUtils; |
| 9 | import cn.iocoder.yudao.module.system.api.user.AdminUserApi; | 10 | import cn.iocoder.yudao.module.system.api.user.AdminUserApi; |
| @@ -77,6 +78,7 @@ public class BpmTaskCandidateInvoker { | @@ -77,6 +78,7 @@ public class BpmTaskCandidateInvoker { | ||
| 77 | * @param execution 执行任务 | 78 | * @param execution 执行任务 |
| 78 | * @return 用户编号集合 | 79 | * @return 用户编号集合 |
| 79 | */ | 80 | */ |
| 81 | + @DataPermission(enable = false) // 忽略数据权限,避免因为过滤,导致找不到候选人 | ||
| 80 | public Set<Long> calculateUsers(DelegateExecution execution) { | 82 | public Set<Long> calculateUsers(DelegateExecution execution) { |
| 81 | Integer strategy = BpmnModelUtils.parseCandidateStrategy(execution.getCurrentFlowElement()); | 83 | Integer strategy = BpmnModelUtils.parseCandidateStrategy(execution.getCurrentFlowElement()); |
| 82 | String param = BpmnModelUtils.parseCandidateParam(execution.getCurrentFlowElement()); | 84 | String param = BpmnModelUtils.parseCandidateParam(execution.getCurrentFlowElement()); |
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/oa/BpmOALeaveServiceImpl.java
| @@ -9,7 +9,7 @@ import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.BpmOALeaveCreateReqVO; | @@ -9,7 +9,7 @@ import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.BpmOALeaveCreateReqVO; | ||
| 9 | import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.BpmOALeavePageReqVO; | 9 | import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.BpmOALeavePageReqVO; |
| 10 | import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOALeaveDO; | 10 | import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOALeaveDO; |
| 11 | import cn.iocoder.yudao.module.bpm.dal.mysql.oa.BpmOALeaveMapper; | 11 | import cn.iocoder.yudao.module.bpm.dal.mysql.oa.BpmOALeaveMapper; |
| 12 | -import cn.iocoder.yudao.module.bpm.enums.task.BpmTaskStatustEnum; | 12 | +import cn.iocoder.yudao.module.bpm.enums.task.BpmTaskStatusEnum; |
| 13 | import jakarta.annotation.Resource; | 13 | import jakarta.annotation.Resource; |
| 14 | import org.springframework.stereotype.Service; | 14 | import org.springframework.stereotype.Service; |
| 15 | import org.springframework.transaction.annotation.Transactional; | 15 | import org.springframework.transaction.annotation.Transactional; |
| @@ -48,7 +48,7 @@ public class BpmOALeaveServiceImpl implements BpmOALeaveService { | @@ -48,7 +48,7 @@ public class BpmOALeaveServiceImpl implements BpmOALeaveService { | ||
| 48 | // 插入 OA 请假单 | 48 | // 插入 OA 请假单 |
| 49 | long day = LocalDateTimeUtil.between(createReqVO.getStartTime(), createReqVO.getEndTime()).toDays(); | 49 | long day = LocalDateTimeUtil.between(createReqVO.getStartTime(), createReqVO.getEndTime()).toDays(); |
| 50 | BpmOALeaveDO leave = BeanUtils.toBean(createReqVO, BpmOALeaveDO.class) | 50 | BpmOALeaveDO leave = BeanUtils.toBean(createReqVO, BpmOALeaveDO.class) |
| 51 | - .setUserId(userId).setDay(day).setStatus(BpmTaskStatustEnum.RUNNING.getStatus()); | 51 | + .setUserId(userId).setDay(day).setStatus(BpmTaskStatusEnum.RUNNING.getStatus()); |
| 52 | leaveMapper.insert(leave); | 52 | leaveMapper.insert(leave); |
| 53 | 53 | ||
| 54 | // 发起 BPM 流程 | 54 | // 发起 BPM 流程 |
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/task/BpmTaskServiceImpl.java
| @@ -17,7 +17,7 @@ import cn.iocoder.yudao.module.bpm.convert.task.BpmTaskConvert; | @@ -17,7 +17,7 @@ import cn.iocoder.yudao.module.bpm.convert.task.BpmTaskConvert; | ||
| 17 | import cn.iocoder.yudao.module.bpm.enums.task.BpmCommentTypeEnum; | 17 | import cn.iocoder.yudao.module.bpm.enums.task.BpmCommentTypeEnum; |
| 18 | import cn.iocoder.yudao.module.bpm.enums.task.BpmDeleteReasonEnum; | 18 | import cn.iocoder.yudao.module.bpm.enums.task.BpmDeleteReasonEnum; |
| 19 | import cn.iocoder.yudao.module.bpm.enums.task.BpmTaskSignTypeEnum; | 19 | import cn.iocoder.yudao.module.bpm.enums.task.BpmTaskSignTypeEnum; |
| 20 | -import cn.iocoder.yudao.module.bpm.enums.task.BpmTaskStatustEnum; | 20 | +import cn.iocoder.yudao.module.bpm.enums.task.BpmTaskStatusEnum; |
| 21 | import cn.iocoder.yudao.module.bpm.framework.flowable.core.enums.BpmConstants; | 21 | import cn.iocoder.yudao.module.bpm.framework.flowable.core.enums.BpmConstants; |
| 22 | import cn.iocoder.yudao.module.bpm.service.definition.BpmModelService; | 22 | import cn.iocoder.yudao.module.bpm.service.definition.BpmModelService; |
| 23 | import cn.iocoder.yudao.module.bpm.service.message.BpmMessageService; | 23 | import cn.iocoder.yudao.module.bpm.service.message.BpmMessageService; |
| @@ -202,7 +202,7 @@ public class BpmTaskServiceImpl implements BpmTaskService { | @@ -202,7 +202,7 @@ public class BpmTaskServiceImpl implements BpmTaskService { | ||
| 202 | 202 | ||
| 203 | // 情况三:审批普通的任务。大多数情况下,都是这样 | 203 | // 情况三:审批普通的任务。大多数情况下,都是这样 |
| 204 | // 3.1 更新 task 状态、原因 | 204 | // 3.1 更新 task 状态、原因 |
| 205 | - updateTaskStatusAndReason(task.getId(), BpmTaskStatustEnum.APPROVE.getStatus(), reqVO.getReason()); | 205 | + updateTaskStatusAndReason(task.getId(), BpmTaskStatusEnum.APPROVE.getStatus(), reqVO.getReason()); |
| 206 | // 3.2 添加评论 | 206 | // 3.2 添加评论 |
| 207 | taskService.addComment(task.getId(), task.getProcessInstanceId(), BpmCommentTypeEnum.APPROVE.getType(), | 207 | taskService.addComment(task.getId(), task.getProcessInstanceId(), BpmCommentTypeEnum.APPROVE.getType(), |
| 208 | BpmCommentTypeEnum.APPROVE.formatComment(reqVO.getReason())); | 208 | BpmCommentTypeEnum.APPROVE.formatComment(reqVO.getReason())); |
| @@ -230,14 +230,14 @@ public class BpmTaskServiceImpl implements BpmTaskService { | @@ -230,14 +230,14 @@ public class BpmTaskServiceImpl implements BpmTaskService { | ||
| 230 | */ | 230 | */ |
| 231 | private void approveAfterSignTask(Task task, BpmTaskApproveReqVO reqVO) { | 231 | private void approveAfterSignTask(Task task, BpmTaskApproveReqVO reqVO) { |
| 232 | // 更新父 task 状态 + 原因 | 232 | // 更新父 task 状态 + 原因 |
| 233 | - updateTaskStatusAndReason(task.getId(), BpmTaskStatustEnum.APPROVING.getStatus(), reqVO.getReason()); | 233 | + updateTaskStatusAndReason(task.getId(), BpmTaskStatusEnum.APPROVING.getStatus(), reqVO.getReason()); |
| 234 | 234 | ||
| 235 | // 2. 激活子任务 | 235 | // 2. 激活子任务 |
| 236 | List<Task> childrenTaskList = getTaskListByParentTaskId(task.getId()); | 236 | List<Task> childrenTaskList = getTaskListByParentTaskId(task.getId()); |
| 237 | for (Task childrenTask : childrenTaskList) { | 237 | for (Task childrenTask : childrenTaskList) { |
| 238 | taskService.resolveTask(childrenTask.getId()); | 238 | taskService.resolveTask(childrenTask.getId()); |
| 239 | // 更新子 task 状态 | 239 | // 更新子 task 状态 |
| 240 | - updateTaskStatus(childrenTask.getId(), BpmTaskStatustEnum.RUNNING.getStatus()); | 240 | + updateTaskStatus(childrenTask.getId(), BpmTaskStatusEnum.RUNNING.getStatus()); |
| 241 | } | 241 | } |
| 242 | } | 242 | } |
| 243 | 243 | ||
| @@ -261,7 +261,7 @@ public class BpmTaskServiceImpl implements BpmTaskService { | @@ -261,7 +261,7 @@ public class BpmTaskServiceImpl implements BpmTaskService { | ||
| 261 | // 1.2 只处理加签的父任务 | 261 | // 1.2 只处理加签的父任务 |
| 262 | Task parentTask = validateTaskExist(parentTaskId); | 262 | Task parentTask = validateTaskExist(parentTaskId); |
| 263 | String scopeType = parentTask.getScopeType(); | 263 | String scopeType = parentTask.getScopeType(); |
| 264 | - if (BpmTaskSignTypeEnum.of(scopeType) == null){ | 264 | + if (BpmTaskSignTypeEnum.of(scopeType) == null) { |
| 265 | return; | 265 | return; |
| 266 | } | 266 | } |
| 267 | 267 | ||
| @@ -275,17 +275,17 @@ public class BpmTaskServiceImpl implements BpmTaskService { | @@ -275,17 +275,17 @@ public class BpmTaskServiceImpl implements BpmTaskService { | ||
| 275 | // 3.1.1 owner 重新赋值给父任务的 assignee,这样它就可以被审批 | 275 | // 3.1.1 owner 重新赋值给父任务的 assignee,这样它就可以被审批 |
| 276 | taskService.resolveTask(parentTaskId); | 276 | taskService.resolveTask(parentTaskId); |
| 277 | // 3.1.2 更新流程任务 status | 277 | // 3.1.2 更新流程任务 status |
| 278 | - updateTaskStatus(parentTaskId, BpmTaskStatustEnum.RUNNING.getStatus()); | 278 | + updateTaskStatus(parentTaskId, BpmTaskStatusEnum.RUNNING.getStatus()); |
| 279 | // 3.2 情况二:处理向【向后】加签 | 279 | // 3.2 情况二:处理向【向后】加签 |
| 280 | } else if (BpmTaskSignTypeEnum.AFTER.getType().equals(scopeType)) { | 280 | } else if (BpmTaskSignTypeEnum.AFTER.getType().equals(scopeType)) { |
| 281 | // 只有 parentTask 处于 APPROVING 的情况下,才可以继续 complete 完成 | 281 | // 只有 parentTask 处于 APPROVING 的情况下,才可以继续 complete 完成 |
| 282 | // 否则,一个未审批的 parentTask 任务,在加签出来的任务都被减签的情况下,就直接完成审批,这样会存在问题 | 282 | // 否则,一个未审批的 parentTask 任务,在加签出来的任务都被减签的情况下,就直接完成审批,这样会存在问题 |
| 283 | Integer status = (Integer) parentTask.getTaskLocalVariables().get(BpmConstants.TASK_VARIABLE_STATUS); | 283 | Integer status = (Integer) parentTask.getTaskLocalVariables().get(BpmConstants.TASK_VARIABLE_STATUS); |
| 284 | - if (ObjectUtil.notEqual(status, BpmTaskStatustEnum.APPROVING.getStatus())) { | 284 | + if (ObjectUtil.notEqual(status, BpmTaskStatusEnum.APPROVING.getStatus())) { |
| 285 | return; | 285 | return; |
| 286 | } | 286 | } |
| 287 | // 3.2.2 完成自己(因为它已经没有子任务,所以也可以完成) | 287 | // 3.2.2 完成自己(因为它已经没有子任务,所以也可以完成) |
| 288 | - updateTaskStatus(parentTaskId, BpmTaskStatustEnum.APPROVE.getStatus()); | 288 | + updateTaskStatus(parentTaskId, BpmTaskStatusEnum.APPROVE.getStatus()); |
| 289 | taskService.complete(parentTaskId); | 289 | taskService.complete(parentTaskId); |
| 290 | } | 290 | } |
| 291 | 291 | ||
| @@ -311,7 +311,7 @@ public class BpmTaskServiceImpl implements BpmTaskService { | @@ -311,7 +311,7 @@ public class BpmTaskServiceImpl implements BpmTaskService { | ||
| 311 | // 底层调用 TaskHelper.changeTaskAssignee(task, task.getOwner()):将 owner 设置为 assignee | 311 | // 底层调用 TaskHelper.changeTaskAssignee(task, task.getOwner()):将 owner 设置为 assignee |
| 312 | taskService.resolveTask(task.getId()); | 312 | taskService.resolveTask(task.getId()); |
| 313 | // 2.2 更新 task 状态 + 原因 | 313 | // 2.2 更新 task 状态 + 原因 |
| 314 | - updateTaskStatusAndReason(task.getId(), BpmTaskStatustEnum.RUNNING.getStatus(), reqVO.getReason()); | 314 | + updateTaskStatusAndReason(task.getId(), BpmTaskStatusEnum.RUNNING.getStatus(), reqVO.getReason()); |
| 315 | } | 315 | } |
| 316 | 316 | ||
| 317 | @Override | 317 | @Override |
| @@ -326,7 +326,7 @@ public class BpmTaskServiceImpl implements BpmTaskService { | @@ -326,7 +326,7 @@ public class BpmTaskServiceImpl implements BpmTaskService { | ||
| 326 | } | 326 | } |
| 327 | 327 | ||
| 328 | // 2.1 更新流程实例为不通过 | 328 | // 2.1 更新流程实例为不通过 |
| 329 | - updateTaskStatusAndReason(task.getId(), BpmTaskStatustEnum.REJECT.getStatus(), reqVO.getReason()); | 329 | + updateTaskStatusAndReason(task.getId(), BpmTaskStatusEnum.REJECT.getStatus(), reqVO.getReason()); |
| 330 | // 2.2 添加评论 | 330 | // 2.2 添加评论 |
| 331 | taskService.addComment(task.getId(), task.getProcessInstanceId(), BpmCommentTypeEnum.REJECT.getType(), | 331 | taskService.addComment(task.getId(), task.getProcessInstanceId(), BpmCommentTypeEnum.REJECT.getType(), |
| 332 | BpmCommentTypeEnum.REJECT.formatComment(reqVO.getReason())); | 332 | BpmCommentTypeEnum.REJECT.formatComment(reqVO.getReason())); |
| @@ -378,7 +378,7 @@ public class BpmTaskServiceImpl implements BpmTaskService { | @@ -378,7 +378,7 @@ public class BpmTaskServiceImpl implements BpmTaskService { | ||
| 378 | log.error("[updateTaskStatusWhenCreated][taskId({}) 已经有状态({})]", task.getId(), status); | 378 | log.error("[updateTaskStatusWhenCreated][taskId({}) 已经有状态({})]", task.getId(), status); |
| 379 | return; | 379 | return; |
| 380 | } | 380 | } |
| 381 | - updateTaskStatus(task.getId(), BpmTaskStatustEnum.RUNNING.getStatus()); | 381 | + updateTaskStatus(task.getId(), BpmTaskStatusEnum.RUNNING.getStatus()); |
| 382 | } | 382 | } |
| 383 | 383 | ||
| 384 | @Override | 384 | @Override |
| @@ -392,11 +392,11 @@ public class BpmTaskServiceImpl implements BpmTaskService { | @@ -392,11 +392,11 @@ public class BpmTaskServiceImpl implements BpmTaskService { | ||
| 392 | 392 | ||
| 393 | // 2. 更新 task 状态 + 原因 | 393 | // 2. 更新 task 状态 + 原因 |
| 394 | Integer status = (Integer) task.getTaskLocalVariables().get(BpmConstants.TASK_VARIABLE_STATUS); | 394 | Integer status = (Integer) task.getTaskLocalVariables().get(BpmConstants.TASK_VARIABLE_STATUS); |
| 395 | - if (BpmTaskStatustEnum.isEndStatus(status)) { | 395 | + if (BpmTaskStatusEnum.isEndStatus(status)) { |
| 396 | log.error("[updateTaskStatusWhenCanceled][taskId({}) 处于结果({}),无需进行更新]", taskId, status); | 396 | log.error("[updateTaskStatusWhenCanceled][taskId({}) 处于结果({}),无需进行更新]", taskId, status); |
| 397 | return; | 397 | return; |
| 398 | } | 398 | } |
| 399 | - updateTaskStatusAndReason(taskId, BpmTaskStatustEnum.CANCEL.getStatus(), BpmDeleteReasonEnum.CANCEL_BY_SYSTEM.getReason()); | 399 | + updateTaskStatusAndReason(taskId, BpmTaskStatusEnum.CANCEL.getStatus(), BpmDeleteReasonEnum.CANCEL_BY_SYSTEM.getReason()); |
| 400 | // 补充说明:由于 Task 被删除成 HistoricTask 后,无法通过 taskService.addComment 添加理由,所以无法存储具体的取消理由 | 400 | // 补充说明:由于 Task 被删除成 HistoricTask 后,无法通过 taskService.addComment 添加理由,所以无法存储具体的取消理由 |
| 401 | } | 401 | } |
| 402 | 402 | ||
| @@ -525,7 +525,7 @@ public class BpmTaskServiceImpl implements BpmTaskService { | @@ -525,7 +525,7 @@ public class BpmTaskServiceImpl implements BpmTaskService { | ||
| 525 | taskService.addComment(task.getId(), currentTask.getProcessInstanceId(), BpmCommentTypeEnum.RETURN.getType(), | 525 | taskService.addComment(task.getId(), currentTask.getProcessInstanceId(), BpmCommentTypeEnum.RETURN.getType(), |
| 526 | BpmCommentTypeEnum.RETURN.formatComment(reqVO.getReason())); | 526 | BpmCommentTypeEnum.RETURN.formatComment(reqVO.getReason())); |
| 527 | // 2.2 更新 task 状态 + 原因 | 527 | // 2.2 更新 task 状态 + 原因 |
| 528 | - updateTaskStatusAndReason(task.getId(), BpmTaskStatustEnum.RETURN.getStatus(), reqVO.getReason()); | 528 | + updateTaskStatusAndReason(task.getId(), BpmTaskStatusEnum.RETURN.getStatus(), reqVO.getReason()); |
| 529 | }); | 529 | }); |
| 530 | 530 | ||
| 531 | // 3. 执行驳回 | 531 | // 3. 执行驳回 |
| @@ -562,7 +562,7 @@ public class BpmTaskServiceImpl implements BpmTaskService { | @@ -562,7 +562,7 @@ public class BpmTaskServiceImpl implements BpmTaskService { | ||
| 562 | taskService.delegateTask(taskId, reqVO.getDelegateUserId().toString()); | 562 | taskService.delegateTask(taskId, reqVO.getDelegateUserId().toString()); |
| 563 | // 3.3 更新 task 状态。 | 563 | // 3.3 更新 task 状态。 |
| 564 | // 为什么不更新原因?因为原因目前主要给审批通过、不通过时使用 | 564 | // 为什么不更新原因?因为原因目前主要给审批通过、不通过时使用 |
| 565 | - updateTaskStatus(taskId, BpmTaskStatustEnum.DELEGATE.getStatus()); | 565 | + updateTaskStatus(taskId, BpmTaskStatusEnum.DELEGATE.getStatus()); |
| 566 | } | 566 | } |
| 567 | 567 | ||
| 568 | @Override | 568 | @Override |
| @@ -616,7 +616,7 @@ public class BpmTaskServiceImpl implements BpmTaskService { | @@ -616,7 +616,7 @@ public class BpmTaskServiceImpl implements BpmTaskService { | ||
| 616 | taskService.saveTask(taskEntity); | 616 | taskService.saveTask(taskEntity); |
| 617 | // 2.6 更新 task 状态为 WAIT,只有在向前加签的时候 | 617 | // 2.6 更新 task 状态为 WAIT,只有在向前加签的时候 |
| 618 | if (reqVO.getType().equals(BpmTaskSignTypeEnum.BEFORE.getType())) { | 618 | if (reqVO.getType().equals(BpmTaskSignTypeEnum.BEFORE.getType())) { |
| 619 | - updateTaskStatus(taskEntity.getId(), BpmTaskStatustEnum.WAIT.getStatus()); | 619 | + updateTaskStatus(taskEntity.getId(), BpmTaskStatusEnum.WAIT.getStatus()); |
| 620 | } | 620 | } |
| 621 | 621 | ||
| 622 | // 3. 创建加签任务 | 622 | // 3. 创建加签任务 |
| @@ -703,7 +703,7 @@ public class BpmTaskServiceImpl implements BpmTaskService { | @@ -703,7 +703,7 @@ public class BpmTaskServiceImpl implements BpmTaskService { | ||
| 703 | 703 | ||
| 704 | // 3. 向后前签,设置子任务的状态为 WAIT,因为需要等父任务审批完 | 704 | // 3. 向后前签,设置子任务的状态为 WAIT,因为需要等父任务审批完 |
| 705 | if (BpmTaskSignTypeEnum.AFTER.getType().equals(parentTask.getScopeType())) { | 705 | if (BpmTaskSignTypeEnum.AFTER.getType().equals(parentTask.getScopeType())) { |
| 706 | - updateTaskStatus(task.getId(), BpmTaskStatustEnum.WAIT.getStatus()); | 706 | + updateTaskStatus(task.getId(), BpmTaskStatusEnum.WAIT.getStatus()); |
| 707 | } | 707 | } |
| 708 | } | 708 | } |
| 709 | 709 | ||
| @@ -727,7 +727,7 @@ public class BpmTaskServiceImpl implements BpmTaskService { | @@ -727,7 +727,7 @@ public class BpmTaskServiceImpl implements BpmTaskService { | ||
| 727 | childTaskList.add(task); | 727 | childTaskList.add(task); |
| 728 | // 2.2 更新子任务为已取消 | 728 | // 2.2 更新子任务为已取消 |
| 729 | String cancelReason = StrUtil.format("任务被取消,原因:由于[{}]操作[减签],", cancelUser.getNickname()); | 729 | String cancelReason = StrUtil.format("任务被取消,原因:由于[{}]操作[减签],", cancelUser.getNickname()); |
| 730 | - childTaskList.forEach(childTask -> updateTaskStatusAndReason(childTask.getId(), BpmTaskStatustEnum.CANCEL.getStatus(), cancelReason)); | 730 | + childTaskList.forEach(childTask -> updateTaskStatusAndReason(childTask.getId(), BpmTaskStatusEnum.CANCEL.getStatus(), cancelReason)); |
| 731 | // 2.2 删除任务和所有子任务 | 731 | // 2.2 删除任务和所有子任务 |
| 732 | taskService.deleteTasks(convertList(childTaskList, Task::getId)); | 732 | taskService.deleteTasks(convertList(childTaskList, Task::getId)); |
| 733 | 733 |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/util/CrmAuditStatusUtils.java
| 1 | package cn.iocoder.yudao.module.crm.util; | 1 | package cn.iocoder.yudao.module.crm.util; |
| 2 | 2 | ||
| 3 | import cn.hutool.core.lang.Assert; | 3 | import cn.hutool.core.lang.Assert; |
| 4 | -import cn.iocoder.yudao.module.bpm.enums.task.BpmTaskStatustEnum; | 4 | +import cn.iocoder.yudao.module.bpm.enums.task.BpmTaskStatusEnum; |
| 5 | import cn.iocoder.yudao.module.crm.enums.common.CrmAuditStatusEnum; | 5 | import cn.iocoder.yudao.module.crm.enums.common.CrmAuditStatusEnum; |
| 6 | 6 | ||
| 7 | /** | 7 | /** |
| @@ -17,9 +17,9 @@ public class CrmAuditStatusUtils { | @@ -17,9 +17,9 @@ public class CrmAuditStatusUtils { | ||
| 17 | * @param bpmResult BPM 审批结果 | 17 | * @param bpmResult BPM 审批结果 |
| 18 | */ | 18 | */ |
| 19 | public static Integer convertBpmResultToAuditStatus(Integer bpmResult) { | 19 | public static Integer convertBpmResultToAuditStatus(Integer bpmResult) { |
| 20 | - Integer auditStatus = BpmTaskStatustEnum.APPROVE.getStatus().equals(bpmResult) ? CrmAuditStatusEnum.APPROVE.getStatus() | ||
| 21 | - : BpmTaskStatustEnum.REJECT.getStatus().equals(bpmResult) ? CrmAuditStatusEnum.REJECT.getStatus() | ||
| 22 | - : BpmTaskStatustEnum.CANCEL.getStatus().equals(bpmResult) ? BpmTaskStatustEnum.CANCEL.getStatus() : null; | 20 | + Integer auditStatus = BpmTaskStatusEnum.APPROVE.getStatus().equals(bpmResult) ? CrmAuditStatusEnum.APPROVE.getStatus() |
| 21 | + : BpmTaskStatusEnum.REJECT.getStatus().equals(bpmResult) ? CrmAuditStatusEnum.REJECT.getStatus() | ||
| 22 | + : BpmTaskStatusEnum.CANCEL.getStatus().equals(bpmResult) ? BpmTaskStatusEnum.CANCEL.getStatus() : null; | ||
| 23 | Assert.notNull(auditStatus, "BPM 审批结果({}) 转换失败", bpmResult); | 23 | Assert.notNull(auditStatus, "BPM 审批结果({}) 转换失败", bpmResult); |
| 24 | return auditStatus; | 24 | return auditStatus; |
| 25 | } | 25 | } |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.java
| @@ -99,7 +99,7 @@ public class AuthController { | @@ -99,7 +99,7 @@ public class AuthController { | ||
| 99 | // 1.1 获得用户信息 | 99 | // 1.1 获得用户信息 |
| 100 | AdminUserDO user = userService.getUser(getLoginUserId()); | 100 | AdminUserDO user = userService.getUser(getLoginUserId()); |
| 101 | if (user == null) { | 101 | if (user == null) { |
| 102 | - return null; | 102 | + return success(null); |
| 103 | } | 103 | } |
| 104 | 104 | ||
| 105 | // 1.2 获得角色列表 | 105 | // 1.2 获得角色列表 |