diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/workflow/vo/TodoTaskRespVO.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/workflow/vo/TodoTaskRespVO.java index 685324b1b..11af4e8e1 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/workflow/vo/TodoTaskRespVO.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/workflow/vo/TodoTaskRespVO.java @@ -2,7 +2,6 @@ package cn.iocoder.yudao.adminserver.modules.activiti.controller.workflow.vo; import io.swagger.annotations.ApiModel; import lombok.Data; -import lombok.EqualsAndHashCode; import lombok.ToString; @ApiModel("待办任务 Response VO") @@ -10,6 +9,8 @@ import lombok.ToString; @ToString public class TodoTaskRespVO { + // TODO @jason:swagger 注解。这样接口文档才完整哈 + private String id; /** diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/service/oa/ReportBackEndProcessor.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/service/oa/ReportBackEndProcessor.java index ad361d7e0..8c24803d1 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/service/oa/ReportBackEndProcessor.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/service/oa/ReportBackEndProcessor.java @@ -9,13 +9,13 @@ import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; +// TODO @jason:类注释 @Component public class ReportBackEndProcessor implements ExecutionListener { @Resource private OaLeaveMapper leaveMapper; - @Override @Transactional(rollbackFor = Exception.class) public void notify(DelegateExecution delegateExecution) { diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/service/oa/impl/OaLeaveServiceImpl.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/service/oa/impl/OaLeaveServiceImpl.java index 694e8044b..0b4b1b9e0 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/service/oa/impl/OaLeaveServiceImpl.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/service/oa/impl/OaLeaveServiceImpl.java @@ -52,6 +52,7 @@ public class OALeaveServiceImpl implements OALeaveService { // 插入 OA 请假单 OALeaveDO leave = OALeaveConvert.INSTANCE.convert(createReqVO); leave.setStatus(1); + // TODO @jason:应该是存储 userId?? leave.setUserId(SecurityFrameworkUtils.getLoginUser().getUsername()); leaveMapper.insert(leave); diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/service/workflow/TaskService.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/service/workflow/TaskService.java index f49a31166..7fefd0ee2 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/service/workflow/TaskService.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/service/workflow/TaskService.java @@ -6,6 +6,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult; import java.util.List; // TODO @芋艿:前缀,注释 +// TODO @json:类和方法的注释。咱是开源项目,有注释,大家才能更容易读懂 public interface TaskService { PageResult getTodoTaskPage(TodoTaskPageReqVO pageReqVO); diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/service/workflow/impl/TaskServiceImpl.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/service/workflow/impl/TaskServiceImpl.java index bf7ba2cde..0907ae467 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/service/workflow/impl/TaskServiceImpl.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/service/workflow/impl/TaskServiceImpl.java @@ -5,7 +5,6 @@ import cn.iocoder.yudao.adminserver.modules.activiti.controller.workflow.vo.*; import cn.iocoder.yudao.adminserver.modules.activiti.convert.workflow.TaskConvert; import cn.iocoder.yudao.adminserver.modules.activiti.service.workflow.TaskService; import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.framework.security.core.LoginUser; import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import org.activiti.api.runtime.shared.query.Page; import org.activiti.api.runtime.shared.query.Pageable; @@ -42,11 +41,6 @@ public class TaskServiceImpl implements TaskService { @Resource private RepositoryService repositoryService; - - public TaskServiceImpl() { - - } - @Override public PageResult getTodoTaskPage(TodoTaskPageReqVO pageReqVO) { // TODO @jason:封装一个方法,用于转换成 activiti 的分页对象 @@ -129,9 +123,11 @@ public class TaskServiceImpl implements TaskService { List steps = new ArrayList<>(); finished.forEach(instance -> { TaskStepVO stepVO = TaskConvert.INSTANCE.convert(instance); - stepVO.setStatus(1); + stepVO.setStatus(1); // TODO @jason:1 这个 magic number 要枚举起来。 + // TODO @jason:可以考虑把 comments 读取后,在统一调用 convert 拼接。另外 Comment 是废弃的类,有没其它可以使用的哈? List comments = activitiTaskService.getTaskComments(instance.getTaskId()); if (!CollUtil.isEmpty(comments)) { + // TODO @jason:IDEA 在 t.getFullMessage() 有提示告警,可以解决下。 stepVO.setComment(Optional.ofNullable(comments.get(0)).map(t->t.getFullMessage()).orElse("")); } steps.add(stepVO); diff --git a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/util/SecurityFrameworkUtils.java b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/util/SecurityFrameworkUtils.java index 7fe9d95e7..44344a5cf 100644 --- a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/util/SecurityFrameworkUtils.java +++ b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/util/SecurityFrameworkUtils.java @@ -101,6 +101,7 @@ public class SecurityFrameworkUtils { WebFrameworkUtils.setLoginUserType(request, loginUser.getUserType()); // TODO @jason:使用 userId 会不会更合适哈? // TODO @芋道源码 该值被赋值给 user task 中assignee , username 显示更直白一点 + // TODO @jason:有办法设置 userId,然后 activiti 有地方读取到 username 么?毕竟 username 只是 User 的登陆账号,并不能绝对像 userId 代表一个用户 org.activiti.engine.impl.identity.Authentication.setAuthenticatedUserId(loginUser.getUsername()); }