12 Commits

Author SHA1 Message Date
evo
98f7e3ada2 Merge pull request #174 from MuSan-Li/feature_202500819_fix_merge
feat: 合并代码 删除不需要的文件
2025-08-19 12:44:59 +08:00
l90215
50d9e0e843 feat: 合并代码 删除不需要的文件 2025-08-19 12:43:34 +08:00
evo
2871cf7630 Merge pull request #171 from fy53888/main
修改字典功能 和模板生成id 太长19位 改为1,2,3
2025-08-19 12:33:40 +08:00
fy53888
951ee6bd8a 修改字典下拉带查找功能 2025-08-19 09:48:35 +08:00
fy53888
5b6605c345 备分一下2 2025-08-18 22:04:15 +08:00
fy53888
5db116ec88 备分一下2 2025-08-18 22:03:51 +08:00
fy53888
645c754dd0 备分一下 2025-08-18 19:56:26 +08:00
fy53888
5264b47c2f 修改字典功能 和模板生成id 太长19位 改为1,2,3 2025-08-17 09:14:19 +08:00
fy53888
579beb6833 修复后端生成类型 Integer 出错的问题 2025-08-09 22:03:31 +08:00
fy53888
22c0c733f6 更新获取Java类型后端生成類型 Integer出錯的問 2025-08-09 22:01:29 +08:00
fy53888
9f4a2256b4 更新后端生成類型 Integer出錯的問 2025-08-09 21:56:16 +08:00
fy53888
5a4d76ac09 更新后端生成類型 Integer出錯的問題 2025-08-09 21:55:23 +08:00
7 changed files with 42 additions and 2 deletions

View File

@@ -16,6 +16,15 @@ import java.util.List;
public interface ISysDictTypeService {
/**
* Select all dictionary types based on the specified conditions
*
* @param dictType The business object containing query conditions for dictionary types
* @return TableDataInfo containing a list of SysDictTypeVo objects that match the query criteria
*/
TableDataInfo<SysDictTypeVo> selectAll(SysDictTypeBo dictType);
TableDataInfo<SysDictTypeVo> selectPageDictTypeList(SysDictTypeBo dictType, PageQuery pageQuery);
/**

View File

@@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.RequiredArgsConstructor;
import org.ruoyi.common.core.constant.CacheConstants;
import org.ruoyi.common.core.constant.CacheNames;
import org.ruoyi.common.core.constant.HttpStatus;
import org.ruoyi.common.core.exception.ServiceException;
import org.ruoyi.common.core.service.DictService;
import org.ruoyi.common.core.utils.MapstructUtils;
@@ -50,6 +51,18 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService, DictService
private final SysDictTypeMapper baseMapper;
private final SysDictDataMapper dictDataMapper;
@Override
public TableDataInfo<SysDictTypeVo> selectAll(SysDictTypeBo dictType) {
LambdaQueryWrapper<SysDictType> lqw = buildQueryWrapper(dictType);
// 2. 查询所有数据(不分页)
List<SysDictTypeVo> list = baseMapper.selectVoList(lqw);
TableDataInfo<SysDictTypeVo> rspData = new TableDataInfo<>();
rspData.setCode(HttpStatus.SUCCESS); // 200
rspData.setMsg("查询成功");
rspData.setRows(list);
rspData.setTotal(list.size()); // 总数为列表大小
return rspData;
}
@Override
public TableDataInfo<SysDictTypeVo> selectPageDictTypeList(SysDictTypeBo dictType, PageQuery pageQuery) {
LambdaQueryWrapper<SysDictType> lqw = buildQueryWrapper(dictType);

View File

@@ -43,6 +43,11 @@ public class SchemaVo implements Serializable {
* 表名
*/
private String tableName;
/**
* 字典
*/
private String dictType;
/**
* 表注释

View File

@@ -249,7 +249,7 @@ public class GenTableServiceImpl implements IGenTableService {
column.put("javaField", javaField);
column.put("capJavaField", toCamelCase(field.getCode(), true));
// 布尔值属性(兼容两种格式)
// 布尔值dictType属性(兼容两种格式)
boolean isPk = "1".equals(field.getIsPk());
boolean isRequired = "1".equals(field.getIsRequired());
boolean isInsert = "1".equals(field.getIsInsert());

View File

@@ -207,6 +207,7 @@ public class SchemaFieldServiceImpl implements SchemaFieldService {
Map<String, Object> result = new HashMap<>();
result.put("schemaGroupCode", schemaGroupVo.getCode());
result.put("tableName", schema.getTableName());
result.put("dictType",schema.getDictType());
result.put("tableComment", schema.getComment());
result.put("className", toCamelCase(schema.getTableName(), true));
result.put("tableCamelName", StrUtil.toCamelCase(schema.getTableName()));
@@ -222,6 +223,8 @@ public class SchemaFieldServiceImpl implements SchemaFieldService {
if (pkField != null) {
Map<String, Object> pkColumn = new HashMap<>();
pkColumn.put("columnName", pkField.getCode());
pkColumn.put("dictType", pkField.getDictType());
pkColumn.put("columnComment", pkField.getName());
pkColumn.put("javaField", StrUtil.toCamelCase(pkField.getCode()));
pkColumn.put("javaType", getJavaType(pkField.getType()));
@@ -233,6 +236,7 @@ public class SchemaFieldServiceImpl implements SchemaFieldService {
for (SchemaFieldVo field : fields) {
Map<String, Object> column = new HashMap<>();
column.put("columnName", field.getCode());
column.put("dictType", field.getDictType());
column.put("columnComment", field.getName());
column.put("javaField", StrUtil.toCamelCase(field.getCode()));
column.put("javaType", getJavaType(field.getType()));
@@ -279,6 +283,7 @@ public class SchemaFieldServiceImpl implements SchemaFieldService {
field.setDefaultValue((String) columnInfo.get("columnDefault"));
field.setComment((String) columnInfo.get("columnComment"));
field.setName((String) columnInfo.get("columnComment"));
field.setDictType(StrUtil.toCamelCase((String) columnInfo.get("dictType")));
field.setCode(StrUtil.toCamelCase((String) columnInfo.get("columnName")));
field.setType((String) columnInfo.get("dataType"));
field.setLength(Integer.valueOf(String.valueOf(columnInfo.get("columnSize"))));

View File

@@ -29,7 +29,7 @@ public class ${ClassName} implements Serializable {
@Version
#end
#if($column.isPk==1)
@TableId(value = "$column.columnName")
@TableId(value = "${column.columnName}", type = IdType.AUTO)
#end
private $column.javaType $column.javaField;

View File

@@ -31,6 +31,14 @@ public class SysDictTypeController extends BaseController {
private final ISysDictTypeService dictTypeService;
/**
* 查询所有字典类型列表
*/
@GetMapping("/all")
public TableDataInfo<SysDictTypeVo> all(SysDictTypeBo dictType, PageQuery pageQuery) {
return dictTypeService.selectAll(dictType);
}
/**
* 查询字典类型列表
*/