diff --git a/ruoyi-modules/ruoyi-generator/src/main/java/org/dromara/generator/service/GenTableServiceImpl.java b/ruoyi-modules/ruoyi-generator/src/main/java/org/dromara/generator/service/GenTableServiceImpl.java index c4c79b0ba..3e7bdf7bb 100644 --- a/ruoyi-modules/ruoyi-generator/src/main/java/org/dromara/generator/service/GenTableServiceImpl.java +++ b/ruoyi-modules/ruoyi-generator/src/main/java/org/dromara/generator/service/GenTableServiceImpl.java @@ -8,7 +8,6 @@ import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.dynamic.datasource.annotation.DSTransactional; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import lombok.RequiredArgsConstructor; @@ -28,6 +27,7 @@ import org.dromara.common.core.utils.file.FileUtils; import org.dromara.common.json.utils.JsonUtils; import org.dromara.common.mybatis.core.page.PageQuery; import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.utils.IdGeneratorUtil; import org.dromara.generator.constant.GenConstants; import org.dromara.generator.domain.GenTable; import org.dromara.generator.domain.GenTableColumn; @@ -60,7 +60,6 @@ public class GenTableServiceImpl implements IGenTableService { private final GenTableMapper baseMapper; private final GenTableColumnMapper genTableColumnMapper; - private final IdentifierGenerator identifierGenerator; private static final String[] TABLE_IGNORE = new String[]{"sj_", "flow_", "gen_"}; @@ -322,7 +321,7 @@ public class GenTableServiceImpl implements IGenTableService { GenTable table = baseMapper.selectGenTableById(tableId); List menuIds = new ArrayList<>(); for (int i = 0; i < 6; i++) { - menuIds.add(identifierGenerator.nextId(null).longValue()); + menuIds.add(IdGeneratorUtil.nextLongId()); } table.setMenuIds(menuIds); // 设置主键列信息 @@ -468,7 +467,7 @@ public class GenTableServiceImpl implements IGenTableService { GenTable table = baseMapper.selectGenTableById(tableId); List menuIds = new ArrayList<>(); for (int i = 0; i < 6; i++) { - menuIds.add(identifierGenerator.nextId(null).longValue()); + menuIds.add(IdGeneratorUtil.nextLongId()); } table.setMenuIds(menuIds); // 设置主键列信息 diff --git a/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/service/impl/FlwTaskServiceImpl.java b/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/service/impl/FlwTaskServiceImpl.java index b3e789bdb..9b1c504b4 100644 --- a/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/service/impl/FlwTaskServiceImpl.java +++ b/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/service/impl/FlwTaskServiceImpl.java @@ -9,7 +9,6 @@ import cn.hutool.core.util.StrUtil; import com.baomidou.lock.annotation.Lock4j; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import lombok.RequiredArgsConstructor; @@ -27,6 +26,7 @@ import org.dromara.common.core.validate.EditGroup; import org.dromara.common.json.utils.JsonUtils; import org.dromara.common.mybatis.core.page.PageQuery; import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.utils.IdGeneratorUtil; import org.dromara.common.satoken.utils.LoginHelper; import org.dromara.warm.flow.core.FlowEngine; import org.dromara.warm.flow.core.dto.FlowParams; @@ -86,7 +86,6 @@ public class FlwTaskServiceImpl implements IFlwTaskService { private final FlowInstanceMapper flowInstanceMapper; private final FlowTaskMapper flowTaskMapper; private final FlowHisTaskMapper flowHisTaskMapper; - private final IdentifierGenerator identifierGenerator; private final UserService userService; private final FlwTaskMapper flwTaskMapper; private final FlwCategoryMapper flwCategoryMapper; @@ -332,7 +331,7 @@ public class FlwTaskServiceImpl implements IFlwTaskService { flowNode.setNodeCode(flowHisTask.getTargetNodeCode()); flowNode.setNodeName(flowHisTask.getTargetNodeName()); //生成新的任务id - long taskId = identifierGenerator.nextId(null).longValue(); + long taskId = IdGeneratorUtil.nextLongId(); task.setId(taskId); task.setNodeName("【抄送】" + task.getNodeName()); Date updateTime = new Date(flowHisTask.getUpdateTime().getTime() - 1000);