mirror of
https://gitcode.com/ageerle/ruoyi-ai.git
synced 2026-04-17 22:03:39 +00:00
Compare commits
12 Commits
5ac785c570
...
98f7e3ada2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
98f7e3ada2 | ||
|
|
50d9e0e843 | ||
|
|
2871cf7630 | ||
|
|
951ee6bd8a | ||
|
|
5b6605c345 | ||
|
|
5db116ec88 | ||
|
|
645c754dd0 | ||
|
|
5264b47c2f | ||
|
|
579beb6833 | ||
|
|
22c0c733f6 | ||
|
|
9f4a2256b4 | ||
|
|
5a4d76ac09 |
@@ -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);
|
||||
|
||||
/**
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -43,6 +43,11 @@ public class SchemaVo implements Serializable {
|
||||
* 表名
|
||||
*/
|
||||
private String tableName;
|
||||
/**
|
||||
* 字典
|
||||
*/
|
||||
private String dictType;
|
||||
|
||||
|
||||
/**
|
||||
* 表注释
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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"))));
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
/**
|
||||
* 查询字典类型列表
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user