mirror of
https://gitcode.com/ageerle/ruoyi-ai.git
synced 2026-04-18 14:23:39 +00:00
Compare commits
4 Commits
5264b47c2f
...
951ee6bd8a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
951ee6bd8a | ||
|
|
5b6605c345 | ||
|
|
5db116ec88 | ||
|
|
645c754dd0 |
@@ -16,9 +16,9 @@ spring:
|
|||||||
master:
|
master:
|
||||||
type: ${spring.datasource.type}
|
type: ${spring.datasource.type}
|
||||||
driverClassName: com.mysql.cj.jdbc.Driver
|
driverClassName: com.mysql.cj.jdbc.Driver
|
||||||
url: jdbc:mysql://127.0.0.1:3306/ruoyi-ai?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
|
url: jdbc:mysql://127.0.0.1:3306/ruoyistore?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
|
||||||
username: root
|
username: root
|
||||||
password: 123456
|
password: root
|
||||||
|
|
||||||
hikari:
|
hikari:
|
||||||
# 最大连接池数量
|
# 最大连接池数量
|
||||||
|
|||||||
@@ -162,7 +162,7 @@ tenant:
|
|||||||
- sys_user_role
|
- sys_user_role
|
||||||
|
|
||||||
knowledge-role:
|
knowledge-role:
|
||||||
enable: true
|
enable: false
|
||||||
|
|
||||||
# MyBatisPlus配置
|
# MyBatisPlus配置
|
||||||
# https://baomidou.com/config/
|
# https://baomidou.com/config/
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import lombok.EqualsAndHashCode;
|
|||||||
import org.ruoyi.core.domain.BaseEntity;
|
import org.ruoyi.core.domain.BaseEntity;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 聊天模型对象 chat_model
|
* 聊天模型对象 chat_model
|
||||||
@@ -80,5 +81,10 @@ public class ChatModel extends BaseEntity {
|
|||||||
*/
|
*/
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 模型能力
|
||||||
|
*/
|
||||||
|
private String modelCapability;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,14 +5,14 @@ import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
|||||||
import com.alibaba.excel.annotation.ExcelProperty;
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
import io.github.linpeilie.annotations.AutoMapper;
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.Getter;
|
||||||
import org.ruoyi.common.sensitive.annotation.Sensitive;
|
import org.ruoyi.common.sensitive.annotation.Sensitive;
|
||||||
import org.ruoyi.common.sensitive.core.SensitiveStrategy;
|
import org.ruoyi.common.sensitive.core.SensitiveStrategy;
|
||||||
import org.ruoyi.domain.ChatModel;
|
import org.ruoyi.domain.ChatModel;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -96,4 +96,138 @@ public class ChatModelVo implements Serializable {
|
|||||||
@ExcelProperty(value = "备注")
|
@ExcelProperty(value = "备注")
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 模型能力
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "模型能力")
|
||||||
|
private String modelCapability;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 模型能力列表
|
||||||
|
*/
|
||||||
|
private List<Ability> modelAbilities = getModelAbilities();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 模型能力类,类似枚举的静态内部类
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
public static final class Ability {
|
||||||
|
// 获取能力名称
|
||||||
|
private final String name;
|
||||||
|
private final String description;
|
||||||
|
|
||||||
|
// 静态字段存储默认能力(类似枚举常量)
|
||||||
|
public static final Ability IMAGE = new Ability("IMAGE", "图片理解");
|
||||||
|
public static final Ability VIDEO = new Ability("VIDEO", "视频理解");
|
||||||
|
public static final Ability SPEECH = new Ability("SPEECH", "语音理解");
|
||||||
|
|
||||||
|
// 动态扩展能力存储
|
||||||
|
private static final java.util.Map<String, Ability> EXTENDED_ABILITIES = new java.util.HashMap<>();
|
||||||
|
|
||||||
|
// 私有构造确保受限
|
||||||
|
private Ability(String name, String description) {
|
||||||
|
this.name = name;
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 静态工厂方法(类似枚举valueOf)
|
||||||
|
public static Ability valueOf(String name) {
|
||||||
|
// 先检查默认能力
|
||||||
|
switch (name) {
|
||||||
|
case "IMAGE": return IMAGE;
|
||||||
|
case "VIDEO": return VIDEO;
|
||||||
|
case "SPEECH": return SPEECH;
|
||||||
|
default:
|
||||||
|
// 检查扩展能力
|
||||||
|
Ability ability = EXTENDED_ABILITIES.get(name);
|
||||||
|
if (ability != null) return ability;
|
||||||
|
throw new IllegalArgumentException("Unknown ability: " + name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 动态注册新能力(后期从数据库调用)
|
||||||
|
public static synchronized Ability registerAbility(String name, String description) {
|
||||||
|
if (name == null || name.trim().isEmpty()) {
|
||||||
|
throw new IllegalArgumentException("Ability name cannot be empty");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 避免重复注册
|
||||||
|
if (EXTENDED_ABILITIES.containsKey(name)) {
|
||||||
|
return EXTENDED_ABILITIES.get(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查是否与默认能力冲突
|
||||||
|
try {
|
||||||
|
valueOf(name);
|
||||||
|
throw new IllegalArgumentException("Ability already exists as default: " + name);
|
||||||
|
} catch (IllegalArgumentException e) {
|
||||||
|
// 正常情况,继续注册
|
||||||
|
}
|
||||||
|
|
||||||
|
Ability newAbility = new Ability(name, description);
|
||||||
|
EXTENDED_ABILITIES.put(name, newAbility);
|
||||||
|
return newAbility;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取所有能力(默认+扩展)
|
||||||
|
public static java.util.Set<Ability> getAllAbilities() {
|
||||||
|
java.util.Map<String, Ability> all = new java.util.HashMap<>();
|
||||||
|
all.put(IMAGE.name, IMAGE);
|
||||||
|
all.put(VIDEO.name, VIDEO);
|
||||||
|
all.put(SPEECH.name, SPEECH);
|
||||||
|
all.putAll(EXTENDED_ABILITIES);
|
||||||
|
return java.util.Collections.unmodifiableSet((java.util.Set<? extends Ability>) all.values());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (this == o) return true;
|
||||||
|
if (o == null || getClass() != o.getClass()) return false;
|
||||||
|
Ability ability = (Ability) o;
|
||||||
|
return name.equals(ability.name);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return name.hashCode();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将 modelCapability 字符串转换为 Ability 列表
|
||||||
|
* @return Ability 列表
|
||||||
|
*/
|
||||||
|
public java.util.List<Ability> getModelAbilities() {
|
||||||
|
if (modelCapability == null || modelCapability.trim().isEmpty()) {
|
||||||
|
return java.util.Collections.emptyList();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 解析 JSON 格式的字符串数组
|
||||||
|
String trimmed = modelCapability.trim();
|
||||||
|
if (!trimmed.startsWith("[") || !trimmed.endsWith("]")) {
|
||||||
|
throw new IllegalArgumentException("Invalid modelCapability format: " + modelCapability);
|
||||||
|
}
|
||||||
|
|
||||||
|
String content = trimmed.substring(1, trimmed.length() - 1).trim();
|
||||||
|
if (content.isEmpty()) {
|
||||||
|
return java.util.Collections.emptyList();
|
||||||
|
}
|
||||||
|
|
||||||
|
java.util.List<Ability> abilities = new java.util.ArrayList<>();
|
||||||
|
String[] items = content.split(",");
|
||||||
|
for (String item : items) {
|
||||||
|
String cleanedItem = item.trim();
|
||||||
|
if (cleanedItem.startsWith("\"") && cleanedItem.endsWith("\"") && cleanedItem.length() >= 2) {
|
||||||
|
String abilityName = cleanedItem.substring(1, cleanedItem.length() - 1);
|
||||||
|
abilities.add(Ability.valueOf(abilityName));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return abilities;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -16,6 +16,15 @@ import java.util.List;
|
|||||||
public interface ISysDictTypeService {
|
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);
|
TableDataInfo<SysDictTypeVo> selectPageDictTypeList(SysDictTypeBo dictType, PageQuery pageQuery);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.ruoyi.common.core.constant.CacheConstants;
|
import org.ruoyi.common.core.constant.CacheConstants;
|
||||||
import org.ruoyi.common.core.constant.CacheNames;
|
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.exception.ServiceException;
|
||||||
import org.ruoyi.common.core.service.DictService;
|
import org.ruoyi.common.core.service.DictService;
|
||||||
import org.ruoyi.common.core.utils.MapstructUtils;
|
import org.ruoyi.common.core.utils.MapstructUtils;
|
||||||
@@ -50,6 +51,18 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService, DictService
|
|||||||
private final SysDictTypeMapper baseMapper;
|
private final SysDictTypeMapper baseMapper;
|
||||||
private final SysDictDataMapper dictDataMapper;
|
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
|
@Override
|
||||||
public TableDataInfo<SysDictTypeVo> selectPageDictTypeList(SysDictTypeBo dictType, PageQuery pageQuery) {
|
public TableDataInfo<SysDictTypeVo> selectPageDictTypeList(SysDictTypeBo dictType, PageQuery pageQuery) {
|
||||||
LambdaQueryWrapper<SysDictType> lqw = buildQueryWrapper(dictType);
|
LambdaQueryWrapper<SysDictType> lqw = buildQueryWrapper(dictType);
|
||||||
|
|||||||
@@ -27,10 +27,18 @@ import org.ruoyi.service.IKnowledgeAttachService;
|
|||||||
import org.ruoyi.service.IKnowledgeFragmentService;
|
import org.ruoyi.service.IKnowledgeFragmentService;
|
||||||
import org.ruoyi.service.IKnowledgeInfoService;
|
import org.ruoyi.service.IKnowledgeInfoService;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 知识库管理
|
* 知识库管理
|
||||||
@@ -60,7 +68,9 @@ public class KnowledgeController extends BaseController {
|
|||||||
if (!StpUtil.isLogin()) {
|
if (!StpUtil.isLogin()) {
|
||||||
throw new SecurityException("请先去登录!");
|
throw new SecurityException("请先去登录!");
|
||||||
}
|
}
|
||||||
|
if (!Objects.equals(LoginHelper.getUserId(), 1L)) {
|
||||||
bo.setUid(LoginHelper.getUserId());
|
bo.setUid(LoginHelper.getUserId());
|
||||||
|
}
|
||||||
return knowledgeInfoService.queryPageList(bo, pageQuery);
|
return knowledgeInfoService.queryPageList(bo, pageQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -72,13 +82,15 @@ public class KnowledgeController extends BaseController {
|
|||||||
if (!StpUtil.isLogin()) {
|
if (!StpUtil.isLogin()) {
|
||||||
throw new SecurityException("请先去登录!");
|
throw new SecurityException("请先去登录!");
|
||||||
}
|
}
|
||||||
LoginUser loginUser = LoginHelper.getLoginUser();
|
|
||||||
|
|
||||||
// 管理员跳过权限
|
// 管理员跳过权限
|
||||||
if (loginUser.getUserId().equals(1L) || !knowledgeRoleConfig.getEnable()) {
|
if (Objects.equals(LoginHelper.getUserId(), 1L)) {
|
||||||
|
return knowledgeInfoService.queryPageList(bo, pageQuery);
|
||||||
|
} else if (!knowledgeRoleConfig.getEnable()) {
|
||||||
bo.setUid(LoginHelper.getUserId());
|
bo.setUid(LoginHelper.getUserId());
|
||||||
return knowledgeInfoService.queryPageList(bo, pageQuery);
|
return knowledgeInfoService.queryPageList(bo, pageQuery);
|
||||||
} else {
|
} else {
|
||||||
|
// TODO 自己创建的知识库+角色分配的知识库
|
||||||
return knowledgeInfoService.queryPageListByRole(pageQuery);
|
return knowledgeInfoService.queryPageListByRole(pageQuery);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,105 @@
|
|||||||
|
package org.ruoyi.system.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.ruoyi.common.idempotent.annotation.RepeatSubmit;
|
||||||
|
import org.ruoyi.common.log.annotation.Log;
|
||||||
|
import org.ruoyi.common.web.core.BaseController;
|
||||||
|
import org.ruoyi.core.page.PageQuery;
|
||||||
|
import org.ruoyi.common.core.domain.R;
|
||||||
|
import org.ruoyi.common.core.validate.AddGroup;
|
||||||
|
import org.ruoyi.common.core.validate.EditGroup;
|
||||||
|
import org.ruoyi.common.log.enums.BusinessType;
|
||||||
|
import org.ruoyi.common.excel.utils.ExcelUtil;
|
||||||
|
import org.ruoyi.system.domain.vo.StoreEmployeeVo;
|
||||||
|
import org.ruoyi.system.domain.bo.StoreEmployeeBo;
|
||||||
|
import org.ruoyi.system.service.StoreEmployeeService;
|
||||||
|
import org.ruoyi.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 员工分配
|
||||||
|
*
|
||||||
|
* @author ageerle
|
||||||
|
* @date Mon Aug 18 21:33:27 CST 2025
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/store/storeEmployee")
|
||||||
|
public class StoreEmployeeController extends BaseController {
|
||||||
|
|
||||||
|
private final StoreEmployeeService storeEmployeeService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询员工分配列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("store:storeEmployee:list")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo<StoreEmployeeVo> list(StoreEmployeeBo bo, PageQuery pageQuery) {
|
||||||
|
return storeEmployeeService.queryPageList(bo, pageQuery);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出员工分配列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("store:storeEmployee:export")
|
||||||
|
@Log(title = "员工分配", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(StoreEmployeeBo bo, HttpServletResponse response) {
|
||||||
|
List<StoreEmployeeVo> list = storeEmployeeService.queryList(bo);
|
||||||
|
ExcelUtil.exportExcel(list, "员工分配", StoreEmployeeVo.class, response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取员工分配详细信息
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("store:storeEmployee:query")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public R<StoreEmployeeVo> getInfo(@NotNull(message = "主键不能为空")
|
||||||
|
@PathVariable Long id) {
|
||||||
|
return R.ok(storeEmployeeService.queryById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增员工分配
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("store:storeEmployee:add")
|
||||||
|
@Log(title = "员工分配", businessType = BusinessType.INSERT)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PostMapping()
|
||||||
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody StoreEmployeeBo bo) {
|
||||||
|
return toAjax(storeEmployeeService.insertByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改员工分配
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("store:storeEmployee:edit")
|
||||||
|
@Log(title = "员工分配", businessType = BusinessType.UPDATE)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PutMapping()
|
||||||
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody StoreEmployeeBo bo) {
|
||||||
|
return toAjax(storeEmployeeService.updateByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除员工分配
|
||||||
|
*
|
||||||
|
* @param ids 主键串
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("store:storeEmployee:remove")
|
||||||
|
@Log(title = "员工分配", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||||
|
@PathVariable Long[] ids) {
|
||||||
|
return toAjax(storeEmployeeService.deleteWithValidByIds(List.of(ids), true));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
package org.ruoyi.system.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import lombok.Data;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 员工分配对象 store_employee
|
||||||
|
*
|
||||||
|
* @author ageerle
|
||||||
|
* @date Mon Aug 18 21:33:27 CST 2025
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("store_employee")
|
||||||
|
public class StoreEmployee implements Serializable {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键ID
|
||||||
|
*/
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 门店ID
|
||||||
|
*/
|
||||||
|
private Long storeId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 员工ID
|
||||||
|
*/
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 职位
|
||||||
|
*/
|
||||||
|
private String roleInStore;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分配时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime assignTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 门店类型
|
||||||
|
*/
|
||||||
|
private String isPrimary;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分配到期时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime expireTime;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
package org.ruoyi.system.domain.bo;
|
||||||
|
|
||||||
|
import org.ruoyi.system.domain.StoreEmployee;
|
||||||
|
import org.ruoyi.core.domain.BaseEntity;
|
||||||
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import org.ruoyi.common.core.validate.AddGroup;
|
||||||
|
import org.ruoyi.common.core.validate.EditGroup;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import org.ruoyi.common.core.validate.AddGroup;
|
||||||
|
import org.ruoyi.common.core.validate.EditGroup;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 员工分配业务对象 store_employee
|
||||||
|
*
|
||||||
|
* @author ageerle
|
||||||
|
* @date Mon Aug 18 21:33:27 CST 2025
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
|
||||||
|
@AutoMapper(target = StoreEmployee.class, reverseConvertGenerate = false)
|
||||||
|
public class StoreEmployeeBo implements Serializable {
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 门店ID
|
||||||
|
*/
|
||||||
|
@NotNull(message = "门店ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private Long storeId;
|
||||||
|
/**
|
||||||
|
* 员工ID
|
||||||
|
*/
|
||||||
|
@NotNull(message = "员工ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private Long userId;
|
||||||
|
/**
|
||||||
|
* 职位
|
||||||
|
*/
|
||||||
|
private String roleInStore;
|
||||||
|
/**
|
||||||
|
* 分配时间
|
||||||
|
*/
|
||||||
|
@NotNull(message = "分配时间不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private LocalDateTime assignTime;
|
||||||
|
/**
|
||||||
|
* 门店类型
|
||||||
|
*/
|
||||||
|
private String isPrimary;
|
||||||
|
/**
|
||||||
|
* 分配到期时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime expireTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
package org.ruoyi.system.domain.vo;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import org.ruoyi.common.excel.annotation.ExcelDictFormat;
|
||||||
|
import org.ruoyi.common.excel.convert.ExcelDictConvert;
|
||||||
|
import org.ruoyi.system.domain.StoreEmployee;
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 员工分配视图对象 store_employee
|
||||||
|
*
|
||||||
|
* @author ageerle
|
||||||
|
* @date Mon Aug 18 21:33:27 CST 2025
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
@AutoMapper(target = StoreEmployee.class)
|
||||||
|
public class StoreEmployeeVo implements Serializable {
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 门店ID
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "门店ID")
|
||||||
|
private Long storeId;
|
||||||
|
/**
|
||||||
|
* 员工ID
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "员工ID")
|
||||||
|
private Long userId;
|
||||||
|
/**
|
||||||
|
* 职位
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "职位", converter = ExcelDictConvert.class)
|
||||||
|
@ExcelDictFormat(dictType = "title_name")
|
||||||
|
private String roleInStore;
|
||||||
|
/**
|
||||||
|
* 分配时间
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "分配时间")
|
||||||
|
private LocalDateTime assignTime;
|
||||||
|
/**
|
||||||
|
* 门店类型
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "门店类型", converter = ExcelDictConvert.class)
|
||||||
|
@ExcelDictFormat(dictType = "store_type")
|
||||||
|
private String isPrimary;
|
||||||
|
/**
|
||||||
|
* 分配到期时间
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "分配到期时间")
|
||||||
|
private LocalDateTime expireTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package org.ruoyi.system.mapper;
|
||||||
|
|
||||||
|
import org.ruoyi.system.domain.StoreEmployee;
|
||||||
|
import org.ruoyi.system.domain.vo.StoreEmployeeVo;
|
||||||
|
import org.ruoyi.core.mapper.BaseMapperPlus;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 员工分配Mapper接口
|
||||||
|
*
|
||||||
|
* @author ageerle
|
||||||
|
* @date Mon Aug 18 21:33:27 CST 2025
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface StoreEmployeeMapper extends BaseMapperPlus<StoreEmployee, StoreEmployeeVo> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
package org.ruoyi.system.service;
|
||||||
|
|
||||||
|
import org.ruoyi.system.domain.vo.StoreEmployeeVo;
|
||||||
|
import org.ruoyi.system.domain.bo.StoreEmployeeBo;
|
||||||
|
import org.ruoyi.core.page.TableDataInfo;
|
||||||
|
import org.ruoyi.core.page.PageQuery;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 员工分配Service接口
|
||||||
|
*
|
||||||
|
* @author ageerle
|
||||||
|
* @date Mon Aug 18 21:33:27 CST 2025
|
||||||
|
*/
|
||||||
|
public interface StoreEmployeeService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询员工分配
|
||||||
|
*/
|
||||||
|
StoreEmployeeVo queryById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询员工分配列表
|
||||||
|
*/
|
||||||
|
TableDataInfo<StoreEmployeeVo> queryPageList(StoreEmployeeBo bo, PageQuery pageQuery);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询员工分配列表
|
||||||
|
*/
|
||||||
|
List<StoreEmployeeVo> queryList(StoreEmployeeBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增员工分配
|
||||||
|
*/
|
||||||
|
Boolean insertByBo(StoreEmployeeBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改员工分配
|
||||||
|
*/
|
||||||
|
Boolean updateByBo(StoreEmployeeBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验并批量删除员工分配信息
|
||||||
|
*/
|
||||||
|
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||||
|
}
|
||||||
@@ -0,0 +1,109 @@
|
|||||||
|
package org.ruoyi.system.service.impl;
|
||||||
|
|
||||||
|
import org.ruoyi.common.core.utils.MapstructUtils;
|
||||||
|
import org.ruoyi.core.page.TableDataInfo;
|
||||||
|
import org.ruoyi.core.page.PageQuery;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.ruoyi.system.domain.bo.StoreEmployeeBo;
|
||||||
|
import org.ruoyi.system.domain.vo.StoreEmployeeVo;
|
||||||
|
import org.ruoyi.system.domain.StoreEmployee;
|
||||||
|
import org.ruoyi.system.mapper.StoreEmployeeMapper;
|
||||||
|
import org.ruoyi.system.service.StoreEmployeeService;
|
||||||
|
import org.ruoyi.common.core.utils.StringUtils;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 员工分配Service业务层处理
|
||||||
|
*
|
||||||
|
* @author ageerle
|
||||||
|
* @date Mon Aug 18 21:33:27 CST 2025
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Service
|
||||||
|
public class StoreEmployeeServiceImpl implements StoreEmployeeService {
|
||||||
|
|
||||||
|
private final StoreEmployeeMapper baseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询员工分配
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public StoreEmployeeVo queryById(Long id) {
|
||||||
|
return baseMapper.selectVoById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询员工分配列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public TableDataInfo<StoreEmployeeVo> queryPageList(StoreEmployeeBo bo, PageQuery pageQuery) {
|
||||||
|
LambdaQueryWrapper<StoreEmployee> lqw = buildQueryWrapper(bo);
|
||||||
|
Page<StoreEmployeeVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||||
|
return TableDataInfo.build(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询员工分配列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<StoreEmployeeVo> queryList(StoreEmployeeBo bo) {
|
||||||
|
LambdaQueryWrapper<StoreEmployee> lqw = buildQueryWrapper(bo);
|
||||||
|
return baseMapper.selectVoList(lqw);
|
||||||
|
}
|
||||||
|
|
||||||
|
private LambdaQueryWrapper<StoreEmployee> buildQueryWrapper(StoreEmployeeBo bo) {
|
||||||
|
LambdaQueryWrapper<StoreEmployee> lqw = Wrappers.lambdaQuery();
|
||||||
|
lqw.eq(bo.getStoreId() != null, StoreEmployee::getStoreId, bo.getStoreId());
|
||||||
|
lqw.eq(bo.getUserId() != null, StoreEmployee::getUserId, bo.getUserId());
|
||||||
|
return lqw;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增员工分配
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean insertByBo(StoreEmployeeBo bo) {
|
||||||
|
StoreEmployee add = MapstructUtils.convert(bo, StoreEmployee. class);
|
||||||
|
validEntityBeforeSave(add);
|
||||||
|
boolean flag = baseMapper.insert(add) > 0;
|
||||||
|
if (flag) {
|
||||||
|
bo.setId(add.getId());
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改员工分配
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean updateByBo(StoreEmployeeBo bo) {
|
||||||
|
StoreEmployee update = MapstructUtils.convert(bo, StoreEmployee. class);
|
||||||
|
validEntityBeforeSave(update);
|
||||||
|
return baseMapper.updateById(update) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存前的数据校验
|
||||||
|
*/
|
||||||
|
private void validEntityBeforeSave(StoreEmployee entity) {
|
||||||
|
//TODO 做一些数据校验,如唯一约束
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除员工分配
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
|
if (isValid) {
|
||||||
|
//TODO 做一些业务上的校验,判断是否需要校验
|
||||||
|
}
|
||||||
|
return baseMapper.deleteBatchIds(ids) > 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
-- 菜单 SQL
|
||||||
|
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||||
|
values(1957435675864506368, '员工分配', '2000', '1', 'storeEmployee', 'store/storeEmployee/index', 1, 0, 'C', '0', '0', 'store:storeEmployee:list', '#', 103, 1, sysdate(), null, null, '员工分配菜单');
|
||||||
|
|
||||||
|
-- 按钮 SQL
|
||||||
|
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||||
|
values(1957435675864506369, '员工分配查询', 1957435675864506368, '1', '#', '', 1, 0, 'F', '0', '0', 'store:storeEmployee:query', '#', 103, 1, sysdate(), null, null, '');
|
||||||
|
|
||||||
|
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||||
|
values(1957435675864506370, '员工分配新增', 1957435675864506368, '2', '#', '', 1, 0, 'F', '0', '0', 'store:storeEmployee:add', '#', 103, 1, sysdate(), null, null, '');
|
||||||
|
|
||||||
|
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||||
|
values(1957435675864506371, '员工分配修改', 1957435675864506368, '3', '#', '', 1, 0, 'F', '0', '0', 'store:storeEmployee:edit', '#', 103, 1, sysdate(), null, null, '');
|
||||||
|
|
||||||
|
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||||
|
values(1957435675864506372, '员工分配删除', 1957435675864506368, '4', '#', '', 1, 0, 'F', '0', '0', 'store:storeEmployee:remove', '#', 103, 1, sysdate(), null, null, '');
|
||||||
|
|
||||||
|
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||||
|
values(1957435675864506373, '员工分配导出', 1957435675864506368, '5', '#', '', 1, 0, 'F', '0', '0', 'store:storeEmployee:export', '#', 103, 1, sysdate(), null, null, '');
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="org.ruoyi.system.mapper.StoreEmployeeMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -31,6 +31,14 @@ public class SysDictTypeController extends BaseController {
|
|||||||
|
|
||||||
private final ISysDictTypeService dictTypeService;
|
private final ISysDictTypeService dictTypeService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有字典类型列表
|
||||||
|
*/
|
||||||
|
|
||||||
|
@GetMapping("/all")
|
||||||
|
public TableDataInfo<SysDictTypeVo> all(SysDictTypeBo dictType, PageQuery pageQuery) {
|
||||||
|
return dictTypeService.selectAll(dictType);
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 查询字典类型列表
|
* 查询字典类型列表
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -2496,11 +2496,56 @@ CREATE TABLE prompt_template
|
|||||||
ROW_FORMAT = Dynamic;
|
ROW_FORMAT = Dynamic;
|
||||||
|
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `dev_schema_group`;
|
||||||
|
create table dev_schema_group
|
||||||
|
(
|
||||||
|
id bigint auto_increment comment '主键' primary key,
|
||||||
|
name varchar(100) null comment '分组名称',
|
||||||
|
code varchar(100) null comment '分组编码',
|
||||||
|
icon varchar(100) null comment '图标',
|
||||||
|
remark varchar(500) null comment '备注',
|
||||||
|
del_flag char default '0' null comment '删除标志(0代表存在 2代表删除)',
|
||||||
|
create_dept bigint null comment '创建部门',
|
||||||
|
create_by bigint null comment '创建者',
|
||||||
|
create_time datetime null comment '创建时间',
|
||||||
|
update_by bigint null comment '更新者',
|
||||||
|
update_time datetime null comment '更新时间'
|
||||||
|
) ENGINE = InnoDB
|
||||||
|
CHARACTER SET = utf8mb4
|
||||||
|
COLLATE = utf8mb4_general_ci COMMENT = '数据模型分组表';
|
||||||
|
|
||||||
|
INSERT INTO dev_schema_group (id, name, code, icon, remark, del_flag, create_dept, create_by, create_time, update_by, update_time) VALUES
|
||||||
|
(1944240213530648567, '系统管理', 'system', 'eos-icons:system-group', '系统默认分组', '0', null, null, '2025-07-13 11:37:28', 1, '2025-07-13 18:42:48');
|
||||||
|
INSERT INTO dev_schema_group (id, name, code, icon, remark, del_flag, create_dept, create_by, create_time, update_by, update_time) VALUES
|
||||||
|
(1944240213530648577, '运营管理', 'operator', 'icon-park-outline:appointment', '运营管理', '0', null, null, '2025-07-13 11:39:24', 1, '2025-07-13 18:42:31');
|
||||||
|
INSERT INTO dev_schema_group (id, name, code, icon, remark, del_flag, create_dept, create_by, create_time, update_by, update_time) VALUES
|
||||||
|
(1944346023254429697, '在线开发', 'dev', 'carbon:development', '在线开发', '0', null, null, '2025-07-13 18:39:51', 1, '2025-07-13 18:42:07');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `dev_schema`;
|
||||||
|
create table dev_schema
|
||||||
|
(
|
||||||
|
id bigint auto_increment comment '主键' primary key,
|
||||||
|
schema_group_id bigint null comment '分组ID',
|
||||||
|
name varchar(100) null comment '模型名称',
|
||||||
|
code varchar(100) null comment '模型编码',
|
||||||
|
table_name varchar(100) null comment '表名',
|
||||||
|
remark varchar(500) null comment '备注',
|
||||||
|
del_flag char default '0' null comment '删除标志(0代表存在 2代表删除)',
|
||||||
|
create_dept bigint null comment '创建部门',
|
||||||
|
create_by bigint null comment '创建者',
|
||||||
|
create_time datetime null comment '创建时间',
|
||||||
|
update_by bigint null comment '更新者',
|
||||||
|
update_time datetime null comment '更新时间'
|
||||||
|
) ENGINE = InnoDB
|
||||||
|
CHARACTER SET = utf8mb4
|
||||||
|
COLLATE = utf8mb4_general_ci COMMENT = '数据模型表';
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `dev_schema_field`;
|
DROP TABLE IF EXISTS `dev_schema_field`;
|
||||||
create table dev_schema_field
|
create table dev_schema_field
|
||||||
(
|
(
|
||||||
id bigint auto_increment comment '主键'
|
id bigint auto_increment comment '主键' primary key,
|
||||||
primary key,
|
|
||||||
schema_id bigint null comment '模型ID',
|
schema_id bigint null comment '模型ID',
|
||||||
schema_name varchar(64) null comment '模型名称',
|
schema_name varchar(64) null comment '模型名称',
|
||||||
name varchar(100) null comment '字段名称',
|
name varchar(100) null comment '字段名称',
|
||||||
@@ -2513,17 +2558,6 @@ create table dev_schema_field
|
|||||||
default_value varchar(200) null comment '默认值',
|
default_value varchar(200) null comment '默认值',
|
||||||
length int null comment '字段长度',
|
length int null comment '字段长度',
|
||||||
scale int null comment '小数位数',
|
scale int null comment '小数位数',
|
||||||
sort int null comment '排序',
|
|
||||||
status char default '0' null comment '状态(0正常 1停用)',
|
|
||||||
extend_json text null comment '扩展配置',
|
|
||||||
remark varchar(500) null comment '备注',
|
|
||||||
del_flag char default '0' null comment '删除标志(0代表存在 2代表删除)',
|
|
||||||
tenant_id varchar(20) default '000000' null comment '租户编号',
|
|
||||||
create_dept bigint null comment '创建部门',
|
|
||||||
create_by bigint null comment '创建者',
|
|
||||||
create_time datetime null comment '创建时间',
|
|
||||||
update_by bigint null comment '更新者',
|
|
||||||
update_time datetime null comment '更新时间',
|
|
||||||
is_list char default '1' null comment '是否列表显示(0否 1是)',
|
is_list char default '1' null comment '是否列表显示(0否 1是)',
|
||||||
is_query char default '1' null comment '是否查询字段(0否 1是)',
|
is_query char default '1' null comment '是否查询字段(0否 1是)',
|
||||||
is_insert char default '1' null comment '是否插入字段(0否 1是)',
|
is_insert char default '1' null comment '是否插入字段(0否 1是)',
|
||||||
@@ -2531,125 +2565,23 @@ create table dev_schema_field
|
|||||||
query_type varchar(200) default null comment '查询方式(EQ等于、NE不等于、GT大于、LT小于、LIKE模糊、BETWEEN范围)',
|
query_type varchar(200) default null comment '查询方式(EQ等于、NE不等于、GT大于、LT小于、LIKE模糊、BETWEEN范围)',
|
||||||
html_type varchar(200) default 'input' null comment '显示类型(input输入框、textarea文本域、select下拉框、checkbox复选框、radio单选框、datetime日期控件、image图片上传、upload文件上传、editor富文本编辑器)',
|
html_type varchar(200) default 'input' null comment '显示类型(input输入框、textarea文本域、select下拉框、checkbox复选框、radio单选框、datetime日期控件、image图片上传、upload文件上传、editor富文本编辑器)',
|
||||||
dict_type varchar(200) default '' null comment '字典类型',
|
dict_type varchar(200) default '' null comment '字典类型',
|
||||||
constraint fk_schema_field_schema
|
|
||||||
foreign key (schema_id) references dev_schema (id)
|
|
||||||
on delete cascade
|
|
||||||
) comment '数据模型字段表';
|
|
||||||
|
|
||||||
create index idx_html_type
|
|
||||||
on dev_schema_field (html_type);
|
|
||||||
|
|
||||||
create index idx_is_list
|
|
||||||
on dev_schema_field (is_list);
|
|
||||||
|
|
||||||
create index idx_is_query
|
|
||||||
on dev_schema_field (is_query);
|
|
||||||
|
|
||||||
create index idx_query_type
|
|
||||||
on dev_schema_field (query_type);
|
|
||||||
|
|
||||||
create index idx_schema_field_code
|
|
||||||
on dev_schema_field (code);
|
|
||||||
|
|
||||||
create index idx_schema_field_schema_id
|
|
||||||
on dev_schema_field (schema_id);
|
|
||||||
|
|
||||||
create index idx_schema_field_status
|
|
||||||
on dev_schema_field (status);
|
|
||||||
|
|
||||||
create index idx_schema_field_tenant
|
|
||||||
on dev_schema_field (tenant_id);
|
|
||||||
|
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `dev_schema`;
|
|
||||||
create table dev_schema
|
|
||||||
(
|
|
||||||
id bigint auto_increment comment '主键'
|
|
||||||
primary key,
|
|
||||||
schema_group_id bigint null comment '分组ID',
|
|
||||||
name varchar(100) null comment '模型名称',
|
|
||||||
code varchar(100) null comment '模型编码',
|
|
||||||
table_name varchar(100) null comment '表名',
|
|
||||||
comment varchar(500) null comment '表注释',
|
|
||||||
engine varchar(50) default 'InnoDB' null comment '存储引擎',
|
|
||||||
list_keys text null comment '列表字段',
|
|
||||||
search_form_keys text null comment '搜索表单字段',
|
|
||||||
designer longtext null comment '表单设计',
|
|
||||||
status char default '0' null comment '状态(0正常 1停用)',
|
|
||||||
sort int null comment '排序',
|
sort int null comment '排序',
|
||||||
remark varchar(500) null comment '备注',
|
|
||||||
del_flag char default '0' null comment '删除标志(0代表存在 2代表删除)',
|
del_flag char default '0' null comment '删除标志(0代表存在 2代表删除)',
|
||||||
tenant_id varchar(20) default '000000' null comment '租户编号',
|
|
||||||
create_dept bigint null comment '创建部门',
|
create_dept bigint null comment '创建部门',
|
||||||
create_by bigint null comment '创建者',
|
create_by bigint null comment '创建者',
|
||||||
create_time datetime null comment '创建时间',
|
create_time datetime null comment '创建时间',
|
||||||
update_by bigint null comment '更新者',
|
update_by bigint null comment '更新者',
|
||||||
update_time datetime null comment '更新时间',
|
update_time datetime null comment '更新时间',
|
||||||
constraint fk_schema_group
|
remark varchar(500) null comment '备注'
|
||||||
foreign key (schema_group_id) references dev_schema_group (id)
|
) ENGINE = InnoDB
|
||||||
on delete set null
|
CHARACTER SET = utf8mb4
|
||||||
)
|
COLLATE = utf8mb4_general_ci COMMENT = '数据模型字段表';
|
||||||
comment '数据模型表';
|
|
||||||
|
|
||||||
create index idx_schema_code
|
|
||||||
on dev_schema (code);
|
|
||||||
|
|
||||||
create index idx_schema_group_id
|
|
||||||
on dev_schema (schema_group_id);
|
|
||||||
|
|
||||||
create index idx_schema_status
|
|
||||||
on dev_schema (status);
|
|
||||||
|
|
||||||
create index idx_schema_table_name
|
|
||||||
on dev_schema (table_name);
|
|
||||||
|
|
||||||
create index idx_schema_tenant
|
|
||||||
on dev_schema (tenant_id);
|
|
||||||
|
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `dev_schema_group`;
|
|
||||||
create table dev_schema_group
|
|
||||||
(
|
|
||||||
id bigint auto_increment comment '主键'
|
|
||||||
primary key,
|
|
||||||
name varchar(100) null comment '分组名称',
|
|
||||||
code varchar(100) null comment '分组编码',
|
|
||||||
icon varchar(100) null comment '图标',
|
|
||||||
sort int null comment '排序',
|
|
||||||
status char default '0' null comment '状态(0正常 1停用)',
|
|
||||||
remark varchar(500) null comment '备注',
|
|
||||||
del_flag char default '0' null comment '删除标志(0代表存在 2代表删除)',
|
|
||||||
tenant_id varchar(20) default '000000' null comment '租户编号',
|
|
||||||
create_dept bigint null comment '创建部门',
|
|
||||||
create_by bigint null comment '创建者',
|
|
||||||
create_time datetime null comment '创建时间',
|
|
||||||
update_by bigint null comment '更新者',
|
|
||||||
update_time datetime null comment '更新时间'
|
|
||||||
)
|
|
||||||
comment '数据模型分组表';
|
|
||||||
|
|
||||||
create index idx_schema_group_code
|
|
||||||
on dev_schema_group (code);
|
|
||||||
|
|
||||||
create index idx_schema_group_status
|
|
||||||
on dev_schema_group (status);
|
|
||||||
|
|
||||||
create index idx_schema_group_tenant
|
|
||||||
on dev_schema_group (tenant_id);
|
|
||||||
|
|
||||||
|
|
||||||
INSERT INTO dev_schema_group (id, name, code, icon, sort, status, remark, del_flag, tenant_id, create_dept, create_by, create_time, update_by, update_time) VALUES (1944240213530648567, '系统管理', 'system', 'eos-icons:system-group', 2, '0', '系统默认分组', '0', '000000', null, null, '2025-07-13 11:37:28', 1, '2025-07-13 18:42:48');
|
|
||||||
INSERT INTO dev_schema_group (id, name, code, icon, sort, status, remark, del_flag, tenant_id, create_dept, create_by, create_time, update_by, update_time) VALUES (1944240213530648577, '运营管理', 'operator', 'icon-park-outline:appointment', 1, '0', null, '0', '000000', null, null, '2025-07-13 11:39:24', 1, '2025-07-13 18:42:31');
|
|
||||||
INSERT INTO dev_schema_group (id, name, code, icon, sort, status, remark, del_flag, tenant_id, create_dept, create_by, create_time, update_by, update_time) VALUES (1944346023254429697, '在线开发', 'dev', 'carbon:development', 3, '0', null, '0', '000000', null, null, '2025-07-13 18:39:51', 1, '2025-07-13 18:42:07');
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `knowledge_role`;
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Table structure for knowledge_role
|
-- Table structure for knowledge_role
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
DROP TABLE IF EXISTS `knowledge_role`;
|
|
||||||
CREATE TABLE `knowledge_role` (
|
CREATE TABLE `knowledge_role` (
|
||||||
`id` bigint NOT NULL COMMENT '知识库角色id',
|
`id` bigint NOT NULL COMMENT '知识库角色id',
|
||||||
`name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '知识库角色name',
|
`name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '知识库角色name',
|
||||||
@@ -2664,10 +2596,10 @@ CREATE TABLE `knowledge_role` (
|
|||||||
PRIMARY KEY (`id`) USING BTREE
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '知识库角色表' ROW_FORMAT = DYNAMIC;
|
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '知识库角色表' ROW_FORMAT = DYNAMIC;
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `knowledge_role_group`;
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Table structure for knowledge_role_group
|
-- Table structure for knowledge_role_group
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
DROP TABLE IF EXISTS `knowledge_role_group`;
|
|
||||||
CREATE TABLE `knowledge_role_group` (
|
CREATE TABLE `knowledge_role_group` (
|
||||||
`id` bigint NOT NULL COMMENT '知识库角色组id',
|
`id` bigint NOT NULL COMMENT '知识库角色组id',
|
||||||
`name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '知识库角色组name',
|
`name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '知识库角色组name',
|
||||||
|
|||||||
3
script/sql/update/20250808.sql
Normal file
3
script/sql/update/20250808.sql
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
-- 聊天模型表添加模型能力字段
|
||||||
|
alter table chat_model
|
||||||
|
add model_capability varchar(255) default '[]' not null comment '模型能力';
|
||||||
@@ -74,7 +74,7 @@ SET FOREIGN_KEY_CHECKS = 1;
|
|||||||
|
|
||||||
|
|
||||||
-- 菜单
|
-- 菜单
|
||||||
INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_dept`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1946483381643743233, '知识库角色管理', 1775500307898949634, '12', 'knowledgeRole', 'system/knowledgeRole/index', NULL, 1, 0, 'C', '0', '0', NULL, 'ri:user-3-fill', 103, 1, '2025-07-19 16:41:17', NULL, NULL, '知识库角色管理');
|
INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_dept`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1946483381643743233, '知识库角色管理', 1775500307898949634, '12', 'knowledgeRole', 'operator/knowledgeRole/index', NULL, 1, 0, 'C', '0', '0', NULL, 'ri:user-3-fill', 103, 1, '2025-07-19 16:41:17', NULL, NULL, '知识库角色管理');
|
||||||
|
|
||||||
-- 用户表添加字段
|
-- 用户表添加字段
|
||||||
ALTER TABLE sys_user
|
ALTER TABLE sys_user
|
||||||
|
|||||||
Reference in New Issue
Block a user