diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/workflow/convert/package-info.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/workflow/convert/package-info.java new file mode 100644 index 000000000..39eb68b9b --- /dev/null +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/workflow/convert/package-info.java @@ -0,0 +1,6 @@ +/** + * 提供 POJO 类的实体转换 + * + * 目前使用 MapStruct 框架 + */ +package cn.iocoder.yudao.adminserver.modules.workflow.convert; diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/workflow/convert/《芋道 Spring Boot 对象转换 MapStruct 入门》.md b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/workflow/convert/《芋道 Spring Boot 对象转换 MapStruct 入门》.md new file mode 100644 index 000000000..8153487b7 --- /dev/null +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/workflow/convert/《芋道 Spring Boot 对象转换 MapStruct 入门》.md @@ -0,0 +1 @@ + diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/workflow/dal/dataobject/form/WfForm.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/workflow/dal/dataobject/form/WfForm.java new file mode 100644 index 000000000..e182f62b9 --- /dev/null +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/workflow/dal/dataobject/form/WfForm.java @@ -0,0 +1,49 @@ +package cn.iocoder.yudao.adminserver.modules.workflow.dal.dataobject.form; + +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; +import lombok.*; + +import java.util.List; + +/** + * 工作流的表单定义 + * 用于工作流的申请表单,需要动态配置的场景 + * + * @author 芋道源码 + */ +@TableName(value = "wf_form", autoResultMap = true) +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class WfForm extends BaseDO { + + /** + * 编号 + */ + @TableId + private Long id; + /** + * 表单名 + */ + private String name; + /** + * 表单配置 + * + * 目前直接将 https://github.com/JakHuang/form-generator 生成的 JSON 串,直接保存 + * 定义:https://github.com/JakHuang/form-generator/issues/46 + */ + @TableField(typeHandler = JacksonTypeHandler.class) + private List fields; + /** + * 备注 + */ + private String remark; + +} diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/workflow/dal/dataobject/form/WfFormData.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/workflow/dal/dataobject/form/WfFormData.java new file mode 100644 index 000000000..639f0d717 --- /dev/null +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/workflow/dal/dataobject/form/WfFormData.java @@ -0,0 +1,51 @@ +package cn.iocoder.yudao.adminserver.modules.workflow.dal.dataobject.form; + +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; +import lombok.*; + +import java.util.List; +import java.util.Map; + +/** + * 工作流的表单结果 + * 用户每次填写工作流的申请表单时,会保存一条记录到该表】 + * + * @author 芋道源码 + */ +@TableName(value = "wf_form", autoResultMap = true) +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class WfFormData extends BaseDO { + + /** + * 编号 + */ + private Long id; + /** + * 表单编号 + * + * 关联 {@link WfForm#getId()} + */ + private Long formId; + /** + * 表单配置 + * + * 冗余 {@link WfForm#getFields()} + * 主要考虑,表单是可以修改的 + */ + @TableField(typeHandler = JacksonTypeHandler.class) + private List fields; + /** + * 表单值 + */ + @TableField(typeHandler = JacksonTypeHandler.class) + private Map values; + +} diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/workflow/dal/dataobject/leave/package-info.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/workflow/dal/dataobject/leave/package-info.java new file mode 100644 index 000000000..e96ebce32 --- /dev/null +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/workflow/dal/dataobject/leave/package-info.java @@ -0,0 +1,4 @@ +/** + * TODO 芋艿:实现请假流程,接入工作流 + */ +package cn.iocoder.yudao.adminserver.modules.workflow.dal.dataobject.leave; diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/workflow/dal/dataobject/process/package-info.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/workflow/dal/dataobject/process/package-info.java new file mode 100644 index 000000000..801d02f45 --- /dev/null +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/workflow/dal/dataobject/process/package-info.java @@ -0,0 +1,4 @@ +/** + * TODO 芋艿:工作流的定义 + */ +package cn.iocoder.yudao.adminserver.modules.workflow.dal.dataobject.process; diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/workflow/dal/dataobject/task/package-info.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/workflow/dal/dataobject/task/package-info.java new file mode 100644 index 000000000..005f29ff0 --- /dev/null +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/workflow/dal/dataobject/task/package-info.java @@ -0,0 +1,4 @@ +/** + * TODO 芋艿:工作流创建后的定义 + */ +package cn.iocoder.yudao.adminserver.modules.workflow.dal.dataobject.task; diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/workflow/package-info.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/workflow/package-info.java new file mode 100644 index 000000000..290a72903 --- /dev/null +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/workflow/package-info.java @@ -0,0 +1,7 @@ +/** + * workflow 包下,我们放工作流的功能,基于 activiti 7 版本实现。 + * 例如说:流程定义、表单配置、审核中心(我的申请、我的待办、我的已办)等等 + * + * 缩写:wf 。嘿嘿,实在想不到合适的缩写了! + */ +package cn.iocoder.yudao.adminserver.modules.workflow; diff --git a/yudao-core-service/src/main/java/cn/iocoder/yudao/coreservice/modules/infra/dal/dataobject/logger/InfApiAccessLogDO.java b/yudao-core-service/src/main/java/cn/iocoder/yudao/coreservice/modules/infra/dal/dataobject/logger/InfApiAccessLogDO.java index bd7554405..eb8725fb9 100644 --- a/yudao-core-service/src/main/java/cn/iocoder/yudao/coreservice/modules/infra/dal/dataobject/logger/InfApiAccessLogDO.java +++ b/yudao-core-service/src/main/java/cn/iocoder/yudao/coreservice/modules/infra/dal/dataobject/logger/InfApiAccessLogDO.java @@ -27,7 +27,7 @@ public class InfApiAccessLogDO extends BaseDO { * 编号 */ @TableId - private Integer id; + private Long id; /** * 链路追踪编号 * diff --git a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/LoginUser.java b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/LoginUser.java index e8d601254..7ccdf852c 100644 --- a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/LoginUser.java +++ b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/LoginUser.java @@ -89,6 +89,8 @@ public class LoginUser implements UserDetails { @JsonIgnore// 避免序列化 public Collection getAuthorities() { List list = new ArrayList<>(1); + // 设置 ROLE_ACTIVITI_USER 角色,保证 activiti7 在 Security 验证时,可以通过。参考 https://juejin.cn/post/6972369247041224712 文章 + // TODO 芋艿:这里估计得优化下 list.add(new SimpleGrantedAuthority("ROLE_ACTIVITI_USER")); return list; }