From 722eaf3513bf1a51a8dcb675d2816d1f0655a726 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sun, 31 Oct 2021 09:55:12 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=B8=8B=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E6=B5=81=E7=9A=84=E5=8C=85=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../workflow/convert/package-info.java | 6 +++ ...‹é“ Spring Boot å¯¹è±¡è½¬æ¢ MapStruct 入门》.md | 1 + .../workflow/dal/dataobject/form/WfForm.java | 49 ++++++++++++++++++ .../dal/dataobject/form/WfFormData.java | 51 +++++++++++++++++++ .../dal/dataobject/leave/package-info.java | 4 ++ .../dal/dataobject/process/package-info.java | 4 ++ .../dal/dataobject/task/package-info.java | 4 ++ .../modules/workflow/package-info.java | 7 +++ .../dataobject/logger/InfApiAccessLogDO.java | 2 +- .../framework/security/core/LoginUser.java | 2 + 10 files changed, 129 insertions(+), 1 deletion(-) create mode 100644 yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/workflow/convert/package-info.java create mode 100644 yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/workflow/convert/ã€ŠèŠ‹é“ Spring Boot å¯¹è±¡è½¬æ¢ MapStruct 入门》.md create mode 100644 yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/workflow/dal/dataobject/form/WfForm.java create mode 100644 yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/workflow/dal/dataobject/form/WfFormData.java create mode 100644 yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/workflow/dal/dataobject/leave/package-info.java create mode 100644 yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/workflow/dal/dataobject/process/package-info.java create mode 100644 yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/workflow/dal/dataobject/task/package-info.java create mode 100644 yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/workflow/package-info.java 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; }