|
@@ -3,6 +3,8 @@ package com.ruoyi.generator.service;
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.io.IoUtil;
|
|
|
import cn.hutool.core.lang.Dict;
|
|
|
+import cn.hutool.core.lang.Snowflake;
|
|
|
+import cn.hutool.core.util.IdUtil;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
@@ -222,6 +224,12 @@ public class GenTableServiceImpl implements IGenTableService {
|
|
|
Map<String, String> dataMap = new LinkedHashMap<>();
|
|
|
// 查询表信息
|
|
|
GenTable table = baseMapper.selectGenTableById(tableId);
|
|
|
+ Snowflake snowflake = IdUtil.getSnowflake();
|
|
|
+ List<Long> menuIds = new ArrayList<>();
|
|
|
+ for (int i = 0; i < 6; i++) {
|
|
|
+ menuIds.add(snowflake.nextId());
|
|
|
+ }
|
|
|
+ table.setMenuIds(menuIds);
|
|
|
// 设置主子表信息
|
|
|
setSubTable(table);
|
|
|
// 设置主键列信息
|
|
@@ -367,6 +375,12 @@ public class GenTableServiceImpl implements IGenTableService {
|
|
|
private void generatorCode(String tableName, ZipOutputStream zip) {
|
|
|
// 查询表信息
|
|
|
GenTable table = baseMapper.selectGenTableByName(tableName);
|
|
|
+ Snowflake snowflake = IdUtil.getSnowflake();
|
|
|
+ List<Long> menuIds = new ArrayList<>();
|
|
|
+ for (int i = 0; i < 6; i++) {
|
|
|
+ menuIds.add(snowflake.nextId());
|
|
|
+ }
|
|
|
+ table.setMenuIds(menuIds);
|
|
|
// 设置主子表信息
|
|
|
setSubTable(table);
|
|
|
// 设置主键列信息
|