From 89fedc91f2b016714895fa7223014ebf28247f98 Mon Sep 17 00:00:00 2001 From: zhouz <> Date: Wed, 15 Jul 2026 16:55:07 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E7=BC=96=E7=A0=81?= =?UTF-8?q?=E8=A7=84=E5=88=99=E5=92=8C=E6=B5=81=E6=B0=B4=E5=8F=B7=E6=AE=B5?= =?UTF-8?q?DO?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dal/dataobject/codegen/CodeRuleDO.java | 76 +++++++++++++++++++ .../dataobject/codegen/CodeSequenceDO.java | 45 +++++++++++ 2 files changed, 121 insertions(+) create mode 100644 nl-module-base/nl-module-base-server/src/main/java/cn/code/nl/module/base/dal/dataobject/codegen/CodeRuleDO.java create mode 100644 nl-module-base/nl-module-base-server/src/main/java/cn/code/nl/module/base/dal/dataobject/codegen/CodeSequenceDO.java diff --git a/nl-module-base/nl-module-base-server/src/main/java/cn/code/nl/module/base/dal/dataobject/codegen/CodeRuleDO.java b/nl-module-base/nl-module-base-server/src/main/java/cn/code/nl/module/base/dal/dataobject/codegen/CodeRuleDO.java new file mode 100644 index 00000000..b8a9fb4d --- /dev/null +++ b/nl-module-base/nl-module-base-server/src/main/java/cn/code/nl/module/base/dal/dataobject/codegen/CodeRuleDO.java @@ -0,0 +1,76 @@ +package cn.code.nl.module.base.dal.dataobject.codegen; + +import cn.code.nl.framework.mybatis.core.dataobject.BaseDO; +import cn.code.nl.module.base.service.codegen.dto.SegmentConfig; +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.Data; +import lombok.EqualsAndHashCode; + +import java.util.List; + +/** + * 编码规则定义 DO + * + * @author zhouz + */ +@TableName(value = "base_code_rule", autoResultMap = true) +@Data +@EqualsAndHashCode(callSuper = true) +public class CodeRuleDO extends BaseDO { + + /** + * 主键 + */ + @TableId + private Long id; + + /** + * 规则名称 + */ + private String ruleName; + + /** + * 规则编码(唯一标识) + */ + private String ruleCode; + + /** + * 分段配置(JSON数组) + */ + @TableField(typeHandler = JacksonTypeHandler.class) + private List segmentConfig; + + /** + * 分隔符 + */ + private String separator; + + /** + * 字母大小写:0=原样 1=全大写 2=全小写 + */ + private Integer letterCase; + + /** + * 固定总长度约束(0=不限制) + */ + private Integer totalLength; + + /** + * 序号策略:segment=号段预分配 lock=分布式锁实时 + */ + private String seqStrategy; + + /** + * 状态:0=启用 1=禁用 + */ + private Integer status; + + /** + * 备注 + */ + private String remark; + +} diff --git a/nl-module-base/nl-module-base-server/src/main/java/cn/code/nl/module/base/dal/dataobject/codegen/CodeSequenceDO.java b/nl-module-base/nl-module-base-server/src/main/java/cn/code/nl/module/base/dal/dataobject/codegen/CodeSequenceDO.java new file mode 100644 index 00000000..e9ef6c0d --- /dev/null +++ b/nl-module-base/nl-module-base-server/src/main/java/cn/code/nl/module/base/dal/dataobject/codegen/CodeSequenceDO.java @@ -0,0 +1,45 @@ +package cn.code.nl.module.base.dal.dataobject.codegen; + +import cn.code.nl.framework.mybatis.core.dataobject.BaseDO; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 编码流水号段记录 DO + * + * @author zhouz + */ +@TableName("base_code_sequence") +@Data +@EqualsAndHashCode(callSuper = true) +public class CodeSequenceDO extends BaseDO { + + /** + * 主键 + */ + @TableId + private Long id; + + /** + * 规则ID,关联 base_code_rule.id + */ + private Long ruleId; + + /** + * 重置维度键(如按天:20260715,全局:GLOBAL) + */ + private String resetKey; + + /** + * 当前已分配的最大序号 + */ + private Long currentValue; + + /** + * 序号最大值上限 + */ + private Long maxValue; + +}