Compare commits
2 Commits
9a3547b70b
...
ab8be1a832
| Author | SHA1 | Date | |
|---|---|---|---|
| ab8be1a832 | |||
| 917e9a517a |
@@ -0,0 +1,89 @@
|
||||
-- ====================================================
|
||||
-- 定时任务表
|
||||
-- ====================================================
|
||||
DROP TABLE IF EXISTS `tb_crontab_task`;
|
||||
CREATE TABLE `tb_crontab_task` (
|
||||
`id` VARCHAR(64) NOT NULL COMMENT '主键ID',
|
||||
`task_id` VARCHAR(64) NOT NULL COMMENT '任务ID',
|
||||
`task_name` VARCHAR(100) NOT NULL COMMENT '任务名称',
|
||||
`task_group` VARCHAR(50) NOT NULL DEFAULT 'DEFAULT' COMMENT '任务分组',
|
||||
`meta_id` VARCHAR(64) NOT NULL COMMENT '任务元数据ID',
|
||||
`default_recipient` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '是否使用默认接收人(0:否 1:是)',
|
||||
`bean_name` VARCHAR(100) NOT NULL COMMENT 'Bean名称',
|
||||
`method_name` VARCHAR(100) NOT NULL COMMENT '方法名称',
|
||||
`method_params` VARCHAR(500) DEFAULT NULL COMMENT '方法参数',
|
||||
`cron_expression` VARCHAR(100) NOT NULL COMMENT 'Cron表达式',
|
||||
`status` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '任务状态(0:暂停 1:运行中)',
|
||||
`description` VARCHAR(500) DEFAULT NULL COMMENT '任务描述',
|
||||
`concurrent` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '是否允许并发执行(0:否 1:是)',
|
||||
`misfire_policy` TINYINT(1) NOT NULL DEFAULT 1 COMMENT '错过执行策略(1:立即执行 2:执行一次 3:放弃执行)',
|
||||
`creator` VARCHAR(64) DEFAULT NULL COMMENT '创建者',
|
||||
`updater` VARCHAR(64) DEFAULT NULL COMMENT '更新者',
|
||||
`create_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_time` DATETIME DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`delete_time` DATETIME DEFAULT NULL COMMENT '删除时间',
|
||||
`deleted` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '是否删除(0:否 1:是)',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_task_name` (`task_name`),
|
||||
KEY `idx_bean_name` (`bean_name`),
|
||||
KEY `idx_status` (`status`),
|
||||
KEY `idx_deleted` (`deleted`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='定时任务配置表';
|
||||
|
||||
-- ====================================================
|
||||
-- 定时任务执行日志表
|
||||
-- ====================================================
|
||||
DROP TABLE IF EXISTS `tb_crontab_log`;
|
||||
CREATE TABLE `tb_crontab_log` (
|
||||
`id` VARCHAR(64) NOT NULL COMMENT '主键ID',
|
||||
`task_id` VARCHAR(64) NOT NULL COMMENT '任务ID',
|
||||
`task_name` VARCHAR(100) NOT NULL COMMENT '任务名称',
|
||||
`task_group` VARCHAR(50) NOT NULL DEFAULT 'DEFAULT' COMMENT '任务分组',
|
||||
`bean_name` VARCHAR(100) NOT NULL COMMENT 'Bean名称',
|
||||
`method_name` VARCHAR(100) NOT NULL COMMENT '方法名称',
|
||||
`method_params` VARCHAR(500) DEFAULT NULL COMMENT '方法参数',
|
||||
`execute_status` TINYINT(1) NOT NULL COMMENT '执行状态(0:失败 1:成功)',
|
||||
`execute_message` TEXT DEFAULT NULL COMMENT '执行结果信息',
|
||||
`exception_info` TEXT DEFAULT NULL COMMENT '异常信息',
|
||||
`start_time` DATETIME NOT NULL COMMENT '开始时间',
|
||||
`end_time` DATETIME DEFAULT NULL COMMENT '结束时间',
|
||||
`execute_duration` INT DEFAULT NULL COMMENT '执行时长(毫秒)',
|
||||
`create_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_time` DATETIME DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`delete_time` DATETIME DEFAULT NULL COMMENT '删除时间',
|
||||
`deleted` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '是否删除(0:否 1:是)',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_task_id` (`task_id`),
|
||||
KEY `idx_task_name` (`task_name`),
|
||||
KEY `idx_execute_status` (`execute_status`),
|
||||
KEY `idx_start_time` (`start_time`),
|
||||
KEY `idx_deleted` (`deleted`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='定时任务执行日志表';
|
||||
|
||||
-- ====================================================
|
||||
-- 定时任务元数据表(存储爬虫任务的元数据配置)
|
||||
-- ====================================================
|
||||
DROP TABLE IF EXISTS `tb_crontab_task_meta`;
|
||||
CREATE TABLE `tb_crontab_task_meta` (
|
||||
`id` VARCHAR(64) NOT NULL COMMENT '主键ID',
|
||||
`meta_id` VARCHAR(64) NOT NULL COMMENT '元数据ID',
|
||||
`name` VARCHAR(100) NOT NULL COMMENT '任务名称',
|
||||
`description` VARCHAR(500) DEFAULT NULL COMMENT '任务描述',
|
||||
`category` VARCHAR(50) NOT NULL COMMENT '任务分类(如:人民日报新闻爬取)',
|
||||
`bean_name` VARCHAR(100) NOT NULL COMMENT 'Bean名称(执行器类名)',
|
||||
`method_name` VARCHAR(100) NOT NULL COMMENT '执行方法名',
|
||||
`script_path` VARCHAR(255) DEFAULT NULL COMMENT 'Python脚本路径(相对于basePath)',
|
||||
`param_schema` TEXT DEFAULT NULL COMMENT '参数模板(JSON格式,定义参数名、类型、描述、默认值等)',
|
||||
`auto_publish` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '是否自动发布',
|
||||
`sort_order` INT DEFAULT 0 COMMENT '排序号',
|
||||
`creator` VARCHAR(64) DEFAULT NULL COMMENT '创建者',
|
||||
`updater` VARCHAR(64) DEFAULT NULL COMMENT '更新者',
|
||||
`create_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_time` DATETIME DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`delete_time` DATETIME DEFAULT NULL COMMENT '删除时间',
|
||||
`deleted` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '是否删除(0:否 1:是)',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uk_meta_id` (`meta_id`),
|
||||
KEY `idx_category` (`category`),
|
||||
KEY `idx_deleted` (`deleted`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='定时任务元数据表';
|
||||
@@ -1,12 +1,12 @@
|
||||
-- =============================
|
||||
-- 智能客服系统业务模块
|
||||
-- 智能客服系统业务模块(工单系统)
|
||||
-- 支持:微信小程序客户咨询、智能问答、工单管理、CRM集成
|
||||
-- =============================
|
||||
CREATE SCHEMA IF NOT EXISTS customer_service;
|
||||
CREATE SCHEMA IF NOT EXISTS workcase;
|
||||
|
||||
-- 客户信息表
|
||||
DROP TABLE IF EXISTS customer_service.tb_customer CASCADE;
|
||||
CREATE TABLE customer_service.tb_customer (
|
||||
DROP TABLE IF EXISTS workcase.tb_customer CASCADE;
|
||||
CREATE TABLE workcase.tb_customer (
|
||||
optsn VARCHAR(50) NOT NULL, -- 流水号
|
||||
customer_id VARCHAR(50) NOT NULL, -- 客户ID
|
||||
customer_no VARCHAR(100), -- 客户编号
|
||||
@@ -45,16 +45,16 @@ CREATE TABLE customer_service.tb_customer (
|
||||
UNIQUE (email)
|
||||
);
|
||||
|
||||
CREATE INDEX idx_customer_type ON customer_service.tb_customer(customer_type) WHERE deleted = false;
|
||||
CREATE INDEX idx_customer_level ON customer_service.tb_customer(customer_level) WHERE deleted = false;
|
||||
CREATE INDEX idx_customer_wechat ON customer_service.tb_customer(wechat_openid) WHERE deleted = false;
|
||||
CREATE INDEX idx_customer_type ON workcase.tb_customer(customer_type) WHERE deleted = false;
|
||||
CREATE INDEX idx_customer_level ON workcase.tb_customer(customer_level) WHERE deleted = false;
|
||||
CREATE INDEX idx_customer_wechat ON workcase.tb_customer(wechat_openid) WHERE deleted = false;
|
||||
|
||||
COMMENT ON TABLE customer_service.tb_customer IS '客户信息表';
|
||||
COMMENT ON COLUMN customer_service.tb_customer.customer_level IS '客户等级:vip/important/normal/potential';
|
||||
COMMENT ON TABLE workcase.tb_customer IS '客户信息表';
|
||||
COMMENT ON COLUMN workcase.tb_customer.customer_level IS '客户等级:vip/important/normal/potential';
|
||||
|
||||
-- 会话表
|
||||
DROP TABLE IF EXISTS customer_service.tb_conversation CASCADE;
|
||||
CREATE TABLE customer_service.tb_conversation (
|
||||
DROP TABLE IF EXISTS workcase.tb_conversation CASCADE;
|
||||
CREATE TABLE workcase.tb_conversation (
|
||||
optsn VARCHAR(50) NOT NULL, -- 流水号
|
||||
conversation_id VARCHAR(50) NOT NULL, -- 会话ID
|
||||
customer_id VARCHAR(50) NOT NULL, -- 客户ID
|
||||
@@ -81,19 +81,19 @@ CREATE TABLE customer_service.tb_conversation (
|
||||
deleted BOOLEAN NOT NULL DEFAULT false, -- 是否删除
|
||||
PRIMARY KEY (conversation_id),
|
||||
UNIQUE (optsn),
|
||||
FOREIGN KEY (customer_id) REFERENCES customer_service.tb_customer(customer_id)
|
||||
FOREIGN KEY (customer_id) REFERENCES workcase.tb_customer(customer_id)
|
||||
);
|
||||
|
||||
CREATE INDEX idx_conv_customer ON customer_service.tb_conversation(customer_id, session_start_time DESC) WHERE deleted = false;
|
||||
CREATE INDEX idx_conv_status ON customer_service.tb_conversation(conversation_status) WHERE deleted = false;
|
||||
CREATE INDEX idx_conv_agent ON customer_service.tb_conversation(agent_id) WHERE deleted = false;
|
||||
CREATE INDEX idx_conv_customer ON workcase.tb_conversation(customer_id, session_start_time DESC) WHERE deleted = false;
|
||||
CREATE INDEX idx_conv_status ON workcase.tb_conversation(conversation_status) WHERE deleted = false;
|
||||
CREATE INDEX idx_conv_agent ON workcase.tb_conversation(agent_id) WHERE deleted = false;
|
||||
|
||||
COMMENT ON TABLE customer_service.tb_conversation IS '会话表';
|
||||
COMMENT ON COLUMN customer_service.tb_conversation.conversation_type IS '会话类型:ai/human/transfer';
|
||||
COMMENT ON TABLE workcase.tb_conversation IS '会话表';
|
||||
COMMENT ON COLUMN workcase.tb_conversation.conversation_type IS '会话类型:ai/human/transfer';
|
||||
|
||||
-- 会话消息表
|
||||
DROP TABLE IF EXISTS customer_service.tb_conversation_message CASCADE;
|
||||
CREATE TABLE customer_service.tb_conversation_message (
|
||||
DROP TABLE IF EXISTS workcase.tb_conversation_message CASCADE;
|
||||
CREATE TABLE workcase.tb_conversation_message (
|
||||
optsn VARCHAR(50) NOT NULL, -- 流水号
|
||||
message_id VARCHAR(50) NOT NULL, -- 消息ID
|
||||
conversation_id VARCHAR(50) NOT NULL, -- 所属会话ID
|
||||
@@ -117,18 +117,18 @@ CREATE TABLE customer_service.tb_conversation_message (
|
||||
deleted BOOLEAN NOT NULL DEFAULT false, -- 是否删除
|
||||
PRIMARY KEY (message_id),
|
||||
UNIQUE (optsn),
|
||||
FOREIGN KEY (conversation_id) REFERENCES customer_service.tb_conversation(conversation_id)
|
||||
FOREIGN KEY (conversation_id) REFERENCES workcase.tb_conversation(conversation_id)
|
||||
);
|
||||
|
||||
CREATE INDEX idx_msg_conversation ON customer_service.tb_conversation_message(conversation_id, create_time) WHERE deleted = false;
|
||||
CREATE INDEX idx_msg_sender ON customer_service.tb_conversation_message(sender_id) WHERE deleted = false;
|
||||
CREATE INDEX idx_msg_conversation ON workcase.tb_conversation_message(conversation_id, create_time) WHERE deleted = false;
|
||||
CREATE INDEX idx_msg_sender ON workcase.tb_conversation_message(sender_id) WHERE deleted = false;
|
||||
|
||||
COMMENT ON TABLE customer_service.tb_conversation_message IS '会话消息表';
|
||||
COMMENT ON COLUMN customer_service.tb_conversation_message.sentiment IS '情感分析:positive/neutral/negative';
|
||||
COMMENT ON TABLE workcase.tb_conversation_message IS '会话消息表';
|
||||
COMMENT ON COLUMN workcase.tb_conversation_message.sentiment IS '情感分析:positive/neutral/negative';
|
||||
|
||||
-- 工单表
|
||||
DROP TABLE IF EXISTS customer_service.tb_ticket CASCADE;
|
||||
CREATE TABLE customer_service.tb_ticket (
|
||||
DROP TABLE IF EXISTS workcase.tb_ticket CASCADE;
|
||||
CREATE TABLE workcase.tb_ticket (
|
||||
optsn VARCHAR(50) NOT NULL, -- 流水号
|
||||
ticket_id VARCHAR(50) NOT NULL, -- 工单ID
|
||||
ticket_no VARCHAR(100) NOT NULL, -- 工单编号
|
||||
@@ -166,21 +166,21 @@ CREATE TABLE customer_service.tb_ticket (
|
||||
PRIMARY KEY (ticket_id),
|
||||
UNIQUE (optsn),
|
||||
UNIQUE (ticket_no),
|
||||
FOREIGN KEY (customer_id) REFERENCES customer_service.tb_customer(customer_id)
|
||||
FOREIGN KEY (customer_id) REFERENCES workcase.tb_customer(customer_id)
|
||||
);
|
||||
|
||||
CREATE INDEX idx_ticket_customer ON customer_service.tb_ticket(customer_id) WHERE deleted = false;
|
||||
CREATE INDEX idx_ticket_status ON customer_service.tb_ticket(ticket_status) WHERE deleted = false;
|
||||
CREATE INDEX idx_ticket_assigned ON customer_service.tb_ticket(assigned_to) WHERE deleted = false;
|
||||
CREATE INDEX idx_ticket_priority ON customer_service.tb_ticket(priority) WHERE deleted = false;
|
||||
CREATE INDEX idx_ticket_sla ON customer_service.tb_ticket(sla_deadline) WHERE deleted = false AND is_overdue = false;
|
||||
CREATE INDEX idx_ticket_customer ON workcase.tb_ticket(customer_id) WHERE deleted = false;
|
||||
CREATE INDEX idx_ticket_status ON workcase.tb_ticket(ticket_status) WHERE deleted = false;
|
||||
CREATE INDEX idx_ticket_assigned ON workcase.tb_ticket(assigned_to) WHERE deleted = false;
|
||||
CREATE INDEX idx_ticket_priority ON workcase.tb_ticket(priority) WHERE deleted = false;
|
||||
CREATE INDEX idx_ticket_sla ON workcase.tb_ticket(sla_deadline) WHERE deleted = false AND is_overdue = false;
|
||||
|
||||
COMMENT ON TABLE customer_service.tb_ticket IS '工单表';
|
||||
COMMENT ON COLUMN customer_service.tb_ticket.ticket_type IS '工单类型:consultation/complaint/suggestion/repair/installation/other';
|
||||
COMMENT ON TABLE workcase.tb_ticket IS '工单表';
|
||||
COMMENT ON COLUMN workcase.tb_ticket.ticket_type IS '工单类型:consultation/complaint/suggestion/repair/installation/other';
|
||||
|
||||
-- 工单处理记录表
|
||||
DROP TABLE IF EXISTS customer_service.tb_ticket_log CASCADE;
|
||||
CREATE TABLE customer_service.tb_ticket_log (
|
||||
DROP TABLE IF EXISTS workcase.tb_ticket_log CASCADE;
|
||||
CREATE TABLE workcase.tb_ticket_log (
|
||||
optsn VARCHAR(50) NOT NULL, -- 流水号
|
||||
log_id VARCHAR(50) NOT NULL, -- 日志ID
|
||||
ticket_id VARCHAR(50) NOT NULL, -- 工单ID
|
||||
@@ -195,16 +195,16 @@ CREATE TABLE customer_service.tb_ticket_log (
|
||||
create_time TIMESTAMPTZ NOT NULL DEFAULT now(), -- 创建时间
|
||||
PRIMARY KEY (log_id),
|
||||
UNIQUE (optsn),
|
||||
FOREIGN KEY (ticket_id) REFERENCES customer_service.tb_ticket(ticket_id)
|
||||
FOREIGN KEY (ticket_id) REFERENCES workcase.tb_ticket(ticket_id)
|
||||
);
|
||||
|
||||
CREATE INDEX idx_ticket_log_ticket ON customer_service.tb_ticket_log(ticket_id, create_time DESC);
|
||||
CREATE INDEX idx_ticket_log_ticket ON workcase.tb_ticket_log(ticket_id, create_time DESC);
|
||||
|
||||
COMMENT ON TABLE customer_service.tb_ticket_log IS '工单处理记录表';
|
||||
COMMENT ON TABLE workcase.tb_ticket_log IS '工单处理记录表';
|
||||
|
||||
-- FAQ表(常见问题)
|
||||
DROP TABLE IF EXISTS customer_service.tb_faq CASCADE;
|
||||
CREATE TABLE customer_service.tb_faq (
|
||||
DROP TABLE IF EXISTS workcase.tb_faq CASCADE;
|
||||
CREATE TABLE workcase.tb_faq (
|
||||
optsn VARCHAR(50) NOT NULL, -- 流水号
|
||||
faq_id VARCHAR(50) NOT NULL, -- FAQ ID
|
||||
knowledge_id VARCHAR(50), -- 关联知识库ID
|
||||
@@ -229,14 +229,14 @@ CREATE TABLE customer_service.tb_faq (
|
||||
UNIQUE (optsn)
|
||||
);
|
||||
|
||||
CREATE INDEX idx_faq_category ON customer_service.tb_faq(category) WHERE deleted = false;
|
||||
CREATE INDEX idx_faq_published ON customer_service.tb_faq(is_published) WHERE deleted = false AND is_published = true;
|
||||
CREATE INDEX idx_faq_category ON workcase.tb_faq(category) WHERE deleted = false;
|
||||
CREATE INDEX idx_faq_published ON workcase.tb_faq(is_published) WHERE deleted = false AND is_published = true;
|
||||
|
||||
COMMENT ON TABLE customer_service.tb_faq IS 'FAQ常见问题表';
|
||||
COMMENT ON TABLE workcase.tb_faq IS 'FAQ常见问题表';
|
||||
|
||||
-- 客服评价表
|
||||
DROP TABLE IF EXISTS customer_service.tb_service_evaluation CASCADE;
|
||||
CREATE TABLE customer_service.tb_service_evaluation (
|
||||
DROP TABLE IF EXISTS workcase.tb_service_evaluation CASCADE;
|
||||
CREATE TABLE workcase.tb_service_evaluation (
|
||||
optsn VARCHAR(50) NOT NULL, -- 流水号
|
||||
evaluation_id VARCHAR(50) NOT NULL, -- 评价ID
|
||||
customer_id VARCHAR(50) NOT NULL, -- 客户ID
|
||||
@@ -253,17 +253,17 @@ CREATE TABLE customer_service.tb_service_evaluation (
|
||||
deleted BOOLEAN NOT NULL DEFAULT false, -- 是否删除
|
||||
PRIMARY KEY (evaluation_id),
|
||||
UNIQUE (optsn),
|
||||
FOREIGN KEY (customer_id) REFERENCES customer_service.tb_customer(customer_id)
|
||||
FOREIGN KEY (customer_id) REFERENCES workcase.tb_customer(customer_id)
|
||||
);
|
||||
|
||||
CREATE INDEX idx_eval_customer ON customer_service.tb_service_evaluation(customer_id) WHERE deleted = false;
|
||||
CREATE INDEX idx_eval_rating ON customer_service.tb_service_evaluation(rating) WHERE deleted = false;
|
||||
CREATE INDEX idx_eval_customer ON workcase.tb_service_evaluation(customer_id) WHERE deleted = false;
|
||||
CREATE INDEX idx_eval_rating ON workcase.tb_service_evaluation(rating) WHERE deleted = false;
|
||||
|
||||
COMMENT ON TABLE customer_service.tb_service_evaluation IS '客服评价表';
|
||||
COMMENT ON TABLE workcase.tb_service_evaluation IS '客服评价表';
|
||||
|
||||
-- CRM集成配置表
|
||||
DROP TABLE IF EXISTS customer_service.tb_crm_config CASCADE;
|
||||
CREATE TABLE customer_service.tb_crm_config (
|
||||
DROP TABLE IF EXISTS workcase.tb_crm_config CASCADE;
|
||||
CREATE TABLE workcase.tb_crm_config (
|
||||
optsn VARCHAR(50) NOT NULL, -- 流水号
|
||||
config_id VARCHAR(50) NOT NULL, -- 配置ID
|
||||
crm_system VARCHAR(50) NOT NULL, -- CRM系统名称
|
||||
@@ -286,4 +286,4 @@ CREATE TABLE customer_service.tb_crm_config (
|
||||
UNIQUE (optsn)
|
||||
);
|
||||
|
||||
COMMENT ON TABLE customer_service.tb_crm_config IS 'CRM集成配置表';
|
||||
COMMENT ON TABLE workcase.tb_crm_config IS 'CRM集成配置表';
|
||||
@@ -0,0 +1,9 @@
|
||||
package org.xyzh.api.agent;
|
||||
|
||||
/**
|
||||
* Agent服务接口
|
||||
* 用于知识库和文档管理
|
||||
*/
|
||||
public interface AgentService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package org.xyzh.api.agent.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.xyzh.common.dto.BaseDTO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
|
||||
/**
|
||||
* 知识库DTO
|
||||
* 用于创建和更新知识库
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "知识库DTO")
|
||||
public class KnowledgeBaseDTO extends BaseDTO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "知识库ID(更新时需要)")
|
||||
private String knowledgeId;
|
||||
|
||||
@Schema(description = "智能体ID")
|
||||
private String agentId;
|
||||
|
||||
@Schema(description = "知识库名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "知识库类型:bidding-招投标/customer_service-客服/internal-内部协同")
|
||||
private String kbType;
|
||||
|
||||
@Schema(description = "访问级别:public-公开/private-私有/internal-内部")
|
||||
private String accessLevel;
|
||||
|
||||
@Schema(description = "知识库描述")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "存储路径")
|
||||
private String storagePath;
|
||||
|
||||
@Schema(description = "当前版本号")
|
||||
private String version;
|
||||
|
||||
@Schema(description = "知识库配置")
|
||||
private JsonNode config;
|
||||
|
||||
@Schema(description = "服务类型")
|
||||
private String serviceType;
|
||||
|
||||
@Schema(description = "状态:active-激活/inactive-停用/archived-归档")
|
||||
private String status;
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package org.xyzh.api.agent.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.xyzh.common.dto.BaseDTO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
|
||||
/**
|
||||
* 知识文档片段DTO
|
||||
* 用于创建和更新知识文档片段
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "知识文档片段DTO")
|
||||
public class KnowledgeChunkDTO extends BaseDTO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "片段ID(更新时需要)")
|
||||
private String chunkId;
|
||||
|
||||
@Schema(description = "所属文档ID")
|
||||
private String docId;
|
||||
|
||||
@Schema(description = "所属知识库ID")
|
||||
private String knowledgeId;
|
||||
|
||||
@Schema(description = "片段索引")
|
||||
private Integer chunkIndex;
|
||||
|
||||
@Schema(description = "片段内容")
|
||||
private String content;
|
||||
|
||||
@Schema(description = "片段类型:text-文本/table-表格/image-图片")
|
||||
private String chunkType;
|
||||
|
||||
@Schema(description = "根chunk ID")
|
||||
private String rootChunkId;
|
||||
|
||||
@Schema(description = "是否当前版本", defaultValue = "true")
|
||||
private Boolean isCurrent;
|
||||
|
||||
@Schema(description = "位置信息")
|
||||
private JsonNode positionInfo;
|
||||
|
||||
@Schema(description = "片段元数据")
|
||||
private JsonNode metadata;
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package org.xyzh.api.agent.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.xyzh.common.dto.BaseDTO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 知识文档DTO
|
||||
* 用于创建和更新知识文档
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "知识文档DTO")
|
||||
public class KnowledgeDocumentDTO extends BaseDTO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "文档ID(更新时需要)")
|
||||
private String docId;
|
||||
|
||||
@Schema(description = "所属知识库ID")
|
||||
private String knowledgeId;
|
||||
|
||||
@Schema(description = "文档标题")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "文档类型:text-文本/pdf/word/excel/image/video")
|
||||
private String docType;
|
||||
|
||||
@Schema(description = "文档分类")
|
||||
private String category;
|
||||
|
||||
@Schema(description = "文档内容(文本类型)")
|
||||
private String content;
|
||||
|
||||
@Schema(description = "关联文件ID")
|
||||
private String fileId;
|
||||
|
||||
@Schema(description = "文件路径")
|
||||
private String filePath;
|
||||
|
||||
@Schema(description = "文件大小")
|
||||
private Long fileSize;
|
||||
|
||||
@Schema(description = "MIME类型")
|
||||
private String mimeType;
|
||||
|
||||
@Schema(description = "根文档ID")
|
||||
private String rootDocId;
|
||||
|
||||
@Schema(description = "文档标签")
|
||||
private List<String> tags;
|
||||
|
||||
@Schema(description = "来源URL")
|
||||
private String sourceUrl;
|
||||
|
||||
@Schema(description = "服务类型")
|
||||
private String serviceType;
|
||||
|
||||
@Schema(description = "文档元数据")
|
||||
private JsonNode metadata;
|
||||
|
||||
@Schema(description = "状态:active-激活/inactive-停用/archived-归档")
|
||||
private String status;
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package org.xyzh.api.agent.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.xyzh.common.vo.BaseVO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 知识库VO
|
||||
* 用于前端展示知识库信息
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "知识库VO")
|
||||
public class KnowledgeBaseVO extends BaseVO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "知识库ID")
|
||||
private String knowledgeId;
|
||||
|
||||
@Schema(description = "智能体ID")
|
||||
private String agentId;
|
||||
|
||||
@Schema(description = "智能体名称")
|
||||
private String agentName;
|
||||
|
||||
@Schema(description = "知识库名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "知识库类型")
|
||||
private String kbType;
|
||||
|
||||
@Schema(description = "知识库类型名称")
|
||||
private String kbTypeName;
|
||||
|
||||
@Schema(description = "访问级别")
|
||||
private String accessLevel;
|
||||
|
||||
@Schema(description = "访问级别名称")
|
||||
private String accessLevelName;
|
||||
|
||||
@Schema(description = "知识库描述")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "存储路径")
|
||||
private String storagePath;
|
||||
|
||||
@Schema(description = "当前版本号")
|
||||
private String version;
|
||||
|
||||
@Schema(description = "知识库配置")
|
||||
private JsonNode config;
|
||||
|
||||
@Schema(description = "服务类型")
|
||||
private String serviceType;
|
||||
|
||||
@Schema(description = "部门名称")
|
||||
private String deptName;
|
||||
|
||||
@Schema(description = "状态")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "状态名称")
|
||||
private String statusName;
|
||||
|
||||
@Schema(description = "状态颜色")
|
||||
private String statusColor;
|
||||
|
||||
@Schema(description = "文档总数")
|
||||
private Long documentCount;
|
||||
|
||||
@Schema(description = "已向量化文档数")
|
||||
private Long embeddedDocCount;
|
||||
|
||||
@Schema(description = "chunk总数")
|
||||
private Long chunkCount;
|
||||
|
||||
@Schema(description = "总存储大小(字节)")
|
||||
private Long totalSize;
|
||||
|
||||
@Schema(description = "总存储大小格式化显示")
|
||||
private String totalSizeFormatted;
|
||||
|
||||
@Schema(description = "最后同步时间", format = "date-time")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date lastSyncTime;
|
||||
|
||||
@Schema(description = "创建者姓名")
|
||||
private String creatorName;
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package org.xyzh.api.agent.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.xyzh.common.vo.BaseVO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 知识文档片段VO
|
||||
* 用于前端展示知识文档片段信息
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "知识文档片段VO")
|
||||
public class KnowledgeChunkVO extends BaseVO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "片段ID")
|
||||
private String chunkId;
|
||||
|
||||
@Schema(description = "所属文档ID")
|
||||
private String docId;
|
||||
|
||||
@Schema(description = "文档标题")
|
||||
private String docTitle;
|
||||
|
||||
@Schema(description = "所属知识库ID")
|
||||
private String knowledgeId;
|
||||
|
||||
@Schema(description = "知识库名称")
|
||||
private String knowledgeName;
|
||||
|
||||
@Schema(description = "片段索引")
|
||||
private Integer chunkIndex;
|
||||
|
||||
@Schema(description = "片段内容")
|
||||
private String content;
|
||||
|
||||
@Schema(description = "内容长度")
|
||||
private Integer contentLength;
|
||||
|
||||
@Schema(description = "片段类型")
|
||||
private String chunkType;
|
||||
|
||||
@Schema(description = "片段类型名称")
|
||||
private String chunkTypeName;
|
||||
|
||||
@Schema(description = "版本号")
|
||||
private Integer version;
|
||||
|
||||
@Schema(description = "根chunk ID")
|
||||
private String rootChunkId;
|
||||
|
||||
@Schema(description = "是否当前版本", defaultValue = "false")
|
||||
private Boolean isCurrent;
|
||||
|
||||
@Schema(description = "位置信息")
|
||||
private JsonNode positionInfo;
|
||||
|
||||
@Schema(description = "片段元数据")
|
||||
private JsonNode metadata;
|
||||
|
||||
@Schema(description = "部门名称")
|
||||
private String deptName;
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
package org.xyzh.api.agent.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.xyzh.common.vo.BaseVO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 知识文档VO
|
||||
* 用于前端展示知识文档信息
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "知识文档VO")
|
||||
public class KnowledgeDocumentVO extends BaseVO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "文档ID")
|
||||
private String docId;
|
||||
|
||||
@Schema(description = "所属知识库ID")
|
||||
private String knowledgeId;
|
||||
|
||||
@Schema(description = "知识库名称")
|
||||
private String knowledgeName;
|
||||
|
||||
@Schema(description = "文档标题")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "文档类型")
|
||||
private String docType;
|
||||
|
||||
@Schema(description = "文档类型名称")
|
||||
private String docTypeName;
|
||||
|
||||
@Schema(description = "文档分类")
|
||||
private String category;
|
||||
|
||||
@Schema(description = "文档内容")
|
||||
private String content;
|
||||
|
||||
@Schema(description = "内容摘要")
|
||||
private String contentSummary;
|
||||
|
||||
@Schema(description = "关联文件ID")
|
||||
private String fileId;
|
||||
|
||||
@Schema(description = "文件路径")
|
||||
private String filePath;
|
||||
|
||||
@Schema(description = "文件下载URL")
|
||||
private String fileUrl;
|
||||
|
||||
@Schema(description = "文件大小")
|
||||
private Long fileSize;
|
||||
|
||||
@Schema(description = "文件大小格式化显示")
|
||||
private String fileSizeFormatted;
|
||||
|
||||
@Schema(description = "MIME类型")
|
||||
private String mimeType;
|
||||
|
||||
@Schema(description = "版本号")
|
||||
private Integer version;
|
||||
|
||||
@Schema(description = "根文档ID")
|
||||
private String rootDocId;
|
||||
|
||||
@Schema(description = "文档标签")
|
||||
private List<String> tags;
|
||||
|
||||
@Schema(description = "关键词")
|
||||
private List<String> keywords;
|
||||
|
||||
@Schema(description = "向量化状态")
|
||||
private String embeddingStatus;
|
||||
|
||||
@Schema(description = "向量化状态名称")
|
||||
private String embeddingStatusName;
|
||||
|
||||
@Schema(description = "使用的向量化模型")
|
||||
private String embeddingModel;
|
||||
|
||||
@Schema(description = "切片数量")
|
||||
private Integer chunkCount;
|
||||
|
||||
@Schema(description = "文档元数据")
|
||||
private JsonNode metadata;
|
||||
|
||||
@Schema(description = "来源URL")
|
||||
private String sourceUrl;
|
||||
|
||||
@Schema(description = "服务类型")
|
||||
private String serviceType;
|
||||
|
||||
@Schema(description = "部门名称")
|
||||
private String deptName;
|
||||
|
||||
@Schema(description = "状态")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "状态名称")
|
||||
private String statusName;
|
||||
|
||||
@Schema(description = "创建者姓名")
|
||||
private String creatorName;
|
||||
|
||||
@Schema(description = "更新者姓名")
|
||||
private String updaterName;
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
package org.xyzh;
|
||||
|
||||
public class Main {
|
||||
public static void main(String[] args) {
|
||||
System.out.println("Hello world!");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package org.xyzh.api.bidding;
|
||||
|
||||
public interface BiddingService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package org.xyzh.api.bidding.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.xyzh.common.dto.BaseDTO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
/**
|
||||
* 投标文件DTO
|
||||
* 用于创建和更新投标文件
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "投标文件DTO")
|
||||
public class BidResponseDTO extends BaseDTO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "响应文件ID(更新时需要)")
|
||||
private String responseId;
|
||||
|
||||
@Schema(description = "所属项目ID")
|
||||
private String projectId;
|
||||
|
||||
@Schema(description = "响应类型:technical-技术标/commercial-商务标/comprehensive-综合标")
|
||||
private String responseType;
|
||||
|
||||
@Schema(description = "文档名称")
|
||||
private String docName;
|
||||
|
||||
@Schema(description = "文档大纲")
|
||||
private String outline;
|
||||
|
||||
@Schema(description = "文档内容")
|
||||
private String content;
|
||||
|
||||
@Schema(description = "生成方式:ai-AI生成/template-模板生成/manual-人工编写")
|
||||
private String generationMethod;
|
||||
|
||||
@Schema(description = "使用的模板ID")
|
||||
private String templateId;
|
||||
|
||||
@Schema(description = "使用的AI模型")
|
||||
private String aiModel;
|
||||
|
||||
@Schema(description = "生成状态:draft-草稿/reviewing-审核中/approved-已批准/rejected-已拒绝/submitted-已提交")
|
||||
private String generationStatus;
|
||||
|
||||
@Schema(description = "版本号")
|
||||
private String version;
|
||||
|
||||
@Schema(description = "父版本ID")
|
||||
private String parentVersionId;
|
||||
|
||||
@Schema(description = "审核意见")
|
||||
private String reviewComments;
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package org.xyzh.api.bidding.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.xyzh.common.dto.BaseDTO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
/**
|
||||
* 招标文档DTO
|
||||
* 用于创建和更新招标文档
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "招标文档DTO")
|
||||
public class BiddingDocumentDTO extends BaseDTO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "文档ID(更新时需要)")
|
||||
private String docId;
|
||||
|
||||
@Schema(description = "所属项目ID")
|
||||
private String projectId;
|
||||
|
||||
@Schema(description = "文档类型:tender-招标文件/technical-技术标/commercial-商务标/clarification-澄清文件/other-其他")
|
||||
private String docType;
|
||||
|
||||
@Schema(description = "文档名称")
|
||||
private String docName;
|
||||
|
||||
@Schema(description = "关联文件ID")
|
||||
private String fileId;
|
||||
|
||||
@Schema(description = "文件路径")
|
||||
private String filePath;
|
||||
|
||||
@Schema(description = "文件大小")
|
||||
private Long fileSize;
|
||||
|
||||
@Schema(description = "MIME类型")
|
||||
private String mimeType;
|
||||
|
||||
@Schema(description = "版本号")
|
||||
private String version;
|
||||
|
||||
@Schema(description = "语言")
|
||||
private String language;
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package org.xyzh.api.bidding.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.xyzh.common.dto.BaseDTO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 招标项目DTO
|
||||
* 用于创建和更新招标项目
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "招标项目DTO")
|
||||
public class BiddingProjectDTO extends BaseDTO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "项目ID(更新时需要)")
|
||||
private String projectId;
|
||||
|
||||
@Schema(description = "项目编号")
|
||||
private String projectNo;
|
||||
|
||||
@Schema(description = "项目名称")
|
||||
private String projectName;
|
||||
|
||||
@Schema(description = "项目类型:public-公开招标/invitation-邀请招标/competitive_negotiation-竞争性谈判")
|
||||
private String projectType;
|
||||
|
||||
@Schema(description = "所属行业")
|
||||
private String industry;
|
||||
|
||||
@Schema(description = "来源平台")
|
||||
private String sourcePlatform;
|
||||
|
||||
@Schema(description = "来源URL")
|
||||
private String sourceUrl;
|
||||
|
||||
@Schema(description = "发布日期", format = "date-time")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date publishDate;
|
||||
|
||||
@Schema(description = "投标截止日期", format = "date-time")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date deadline;
|
||||
|
||||
@Schema(description = "开标日期", format = "date-time")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date openingDate;
|
||||
|
||||
@Schema(description = "预算金额")
|
||||
private BigDecimal budgetAmount;
|
||||
|
||||
@Schema(description = "货币单位")
|
||||
private String currency;
|
||||
|
||||
@Schema(description = "项目状态")
|
||||
private String projectStatus;
|
||||
|
||||
@Schema(description = "中标状态")
|
||||
private String winningStatus;
|
||||
|
||||
@Schema(description = "中标金额")
|
||||
private BigDecimal winningAmount;
|
||||
|
||||
@Schema(description = "客户名称")
|
||||
private String clientName;
|
||||
|
||||
@Schema(description = "客户联系方式")
|
||||
private String clientContact;
|
||||
|
||||
@Schema(description = "联系人")
|
||||
private String contactPerson;
|
||||
|
||||
@Schema(description = "项目地点")
|
||||
private String projectLocation;
|
||||
|
||||
@Schema(description = "项目描述")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "关键词")
|
||||
private List<String> keywords;
|
||||
|
||||
@Schema(description = "负责人")
|
||||
private String responsibleUser;
|
||||
|
||||
@Schema(description = "团队成员")
|
||||
private List<String> teamMembers;
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package org.xyzh.api.bidding.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.xyzh.common.dto.BaseDTO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 招标要素DTO
|
||||
* 用于创建和更新招标要素
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "招标要素DTO")
|
||||
public class BiddingRequirementDTO extends BaseDTO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "要素ID(更新时需要)")
|
||||
private String reqId;
|
||||
|
||||
@Schema(description = "所属项目ID")
|
||||
private String projectId;
|
||||
|
||||
@Schema(description = "来源文档ID")
|
||||
private String docId;
|
||||
|
||||
@Schema(description = "要素类别:commercial-商务要素/technical-技术参数/veto-否决项/qualification-资质要求/delivery-交付要求/payment-付款条件/scoring-评分标准")
|
||||
private String reqCategory;
|
||||
|
||||
@Schema(description = "要素名称")
|
||||
private String reqName;
|
||||
|
||||
@Schema(description = "要素内容")
|
||||
private String reqContent;
|
||||
|
||||
@Schema(description = "要素值")
|
||||
private String reqValue;
|
||||
|
||||
@Schema(description = "是否必填", defaultValue = "false")
|
||||
private Boolean isMandatory;
|
||||
|
||||
@Schema(description = "是否为否决项", defaultValue = "false")
|
||||
private Boolean isVeto;
|
||||
|
||||
@Schema(description = "优先级")
|
||||
private Integer priority;
|
||||
|
||||
@Schema(description = "提取方式:ai-AI提取/manual-人工录入")
|
||||
private String extractionMethod;
|
||||
|
||||
@Schema(description = "置信度分数")
|
||||
private BigDecimal confidenceScore;
|
||||
|
||||
@Schema(description = "来源位置")
|
||||
private JsonNode sourceLocation;
|
||||
|
||||
@Schema(description = "合规状态:compliant-符合/non_compliant-不符合/pending-待确认")
|
||||
private String complianceStatus;
|
||||
|
||||
@Schema(description = "响应内容")
|
||||
private String responseContent;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String notes;
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package org.xyzh.api.bidding.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.xyzh.common.dto.BaseDTO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 项目流程节点DTO
|
||||
* 用于创建和更新流程节点
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "项目流程节点DTO")
|
||||
public class ProcessNodeDTO extends BaseDTO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "流程节点ID(更新时需要)")
|
||||
private String processId;
|
||||
|
||||
@Schema(description = "所属项目ID")
|
||||
private String projectId;
|
||||
|
||||
@Schema(description = "节点名称")
|
||||
private String nodeName;
|
||||
|
||||
@Schema(description = "节点类型:collection-文件收集/analysis-需求分析/preparation-文件准备/review-内部审核/submission-投标提交/opening-开标/result-结果通知")
|
||||
private String nodeType;
|
||||
|
||||
@Schema(description = "节点顺序")
|
||||
private Integer nodeOrder;
|
||||
|
||||
@Schema(description = "节点状态:pending-待处理/in_progress-进行中/completed-已完成/skipped-已跳过")
|
||||
private String nodeStatus;
|
||||
|
||||
@Schema(description = "计划开始时间", format = "date-time")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date plannedStartTime;
|
||||
|
||||
@Schema(description = "计划结束时间", format = "date-time")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date plannedEndTime;
|
||||
|
||||
@Schema(description = "实际开始时间", format = "date-time")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date actualStartTime;
|
||||
|
||||
@Schema(description = "实际结束时间", format = "date-time")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date actualEndTime;
|
||||
|
||||
@Schema(description = "负责人")
|
||||
private String responsibleUser;
|
||||
|
||||
@Schema(description = "参与人员")
|
||||
private List<String> participants;
|
||||
|
||||
@Schema(description = "节点备注")
|
||||
private String notes;
|
||||
|
||||
@Schema(description = "附件ID数组")
|
||||
private List<String> attachments;
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
package org.xyzh.api.bidding.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.xyzh.common.vo.BaseVO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 投标文件VO
|
||||
* 用于前端展示投标文件信息
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "投标文件VO")
|
||||
public class BidResponseVO extends BaseVO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "响应文件ID")
|
||||
private String responseId;
|
||||
|
||||
@Schema(description = "所属项目ID")
|
||||
private String projectId;
|
||||
|
||||
@Schema(description = "项目名称")
|
||||
private String projectName;
|
||||
|
||||
@Schema(description = "响应类型")
|
||||
private String responseType;
|
||||
|
||||
@Schema(description = "响应类型名称(中文)")
|
||||
private String responseTypeName;
|
||||
|
||||
@Schema(description = "文档名称")
|
||||
private String docName;
|
||||
|
||||
@Schema(description = "文档大纲")
|
||||
private String outline;
|
||||
|
||||
@Schema(description = "文档内容")
|
||||
private String content;
|
||||
|
||||
@Schema(description = "内容字数")
|
||||
private Integer contentWordCount;
|
||||
|
||||
@Schema(description = "生成方式")
|
||||
private String generationMethod;
|
||||
|
||||
@Schema(description = "生成方式名称")
|
||||
private String generationMethodName;
|
||||
|
||||
@Schema(description = "使用的模板ID")
|
||||
private String templateId;
|
||||
|
||||
@Schema(description = "使用的模板名称")
|
||||
private String templateName;
|
||||
|
||||
@Schema(description = "使用的AI模型")
|
||||
private String aiModel;
|
||||
|
||||
@Schema(description = "生成状态")
|
||||
private String generationStatus;
|
||||
|
||||
@Schema(description = "生成状态名称")
|
||||
private String generationStatusName;
|
||||
|
||||
@Schema(description = "生成状态颜色标签")
|
||||
private String statusColor;
|
||||
|
||||
@Schema(description = "关联文件ID")
|
||||
private String fileId;
|
||||
|
||||
@Schema(description = "文件路径")
|
||||
private String filePath;
|
||||
|
||||
@Schema(description = "文件下载URL")
|
||||
private String fileUrl;
|
||||
|
||||
@Schema(description = "版本号")
|
||||
private String version;
|
||||
|
||||
@Schema(description = "父版本ID")
|
||||
private String parentVersionId;
|
||||
|
||||
@Schema(description = "是否有历史版本", defaultValue = "false")
|
||||
private Boolean hasHistory;
|
||||
|
||||
@Schema(description = "审核意见")
|
||||
private String reviewComments;
|
||||
|
||||
@Schema(description = "创建者姓名")
|
||||
private String creatorName;
|
||||
|
||||
@Schema(description = "更新者姓名")
|
||||
private String updaterName;
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
package org.xyzh.api.bidding.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.xyzh.common.vo.BaseVO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 招标文档VO
|
||||
* 用于前端展示招标文档信息
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "招标文档VO")
|
||||
public class BiddingDocumentVO extends BaseVO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "文档ID")
|
||||
private String docId;
|
||||
|
||||
@Schema(description = "所属项目ID")
|
||||
private String projectId;
|
||||
|
||||
@Schema(description = "项目名称")
|
||||
private String projectName;
|
||||
|
||||
@Schema(description = "文档类型")
|
||||
private String docType;
|
||||
|
||||
@Schema(description = "文档类型名称(中文)")
|
||||
private String docTypeName;
|
||||
|
||||
@Schema(description = "文档名称")
|
||||
private String docName;
|
||||
|
||||
@Schema(description = "关联文件ID")
|
||||
private String fileId;
|
||||
|
||||
@Schema(description = "文件路径")
|
||||
private String filePath;
|
||||
|
||||
@Schema(description = "文件下载URL")
|
||||
private String fileUrl;
|
||||
|
||||
@Schema(description = "文件大小")
|
||||
private Long fileSize;
|
||||
|
||||
@Schema(description = "文件大小格式化显示")
|
||||
private String fileSizeFormatted;
|
||||
|
||||
@Schema(description = "MIME类型")
|
||||
private String mimeType;
|
||||
|
||||
@Schema(description = "文件类型图标")
|
||||
private String fileIcon;
|
||||
|
||||
@Schema(description = "版本号")
|
||||
private String version;
|
||||
|
||||
@Schema(description = "语言")
|
||||
private String language;
|
||||
|
||||
@Schema(description = "页数")
|
||||
private Integer pageCount;
|
||||
|
||||
@Schema(description = "解析状态")
|
||||
private String parseStatus;
|
||||
|
||||
@Schema(description = "解析状态名称")
|
||||
private String parseStatusName;
|
||||
|
||||
@Schema(description = "解析结果")
|
||||
private JsonNode parseResult;
|
||||
|
||||
@Schema(description = "提取的结构化数据")
|
||||
private JsonNode extractionData;
|
||||
|
||||
@Schema(description = "AI分析结果")
|
||||
private String aiAnalysis;
|
||||
|
||||
@Schema(description = "上传日期", format = "date-time")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date uploadDate;
|
||||
|
||||
@Schema(description = "创建者姓名")
|
||||
private String creatorName;
|
||||
}
|
||||
@@ -0,0 +1,135 @@
|
||||
package org.xyzh.api.bidding.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.xyzh.common.vo.BaseVO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 招标项目VO
|
||||
* 用于前端展示招标项目详细信息
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "招标项目VO")
|
||||
public class BiddingProjectVO extends BaseVO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "项目ID")
|
||||
private String projectId;
|
||||
|
||||
@Schema(description = "项目编号")
|
||||
private String projectNo;
|
||||
|
||||
@Schema(description = "项目名称")
|
||||
private String projectName;
|
||||
|
||||
@Schema(description = "项目类型")
|
||||
private String projectType;
|
||||
|
||||
@Schema(description = "项目类型名称(中文)")
|
||||
private String projectTypeName;
|
||||
|
||||
@Schema(description = "所属行业")
|
||||
private String industry;
|
||||
|
||||
@Schema(description = "来源平台")
|
||||
private String sourcePlatform;
|
||||
|
||||
@Schema(description = "来源URL")
|
||||
private String sourceUrl;
|
||||
|
||||
@Schema(description = "发布日期", format = "date-time")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date publishDate;
|
||||
|
||||
@Schema(description = "投标截止日期", format = "date-time")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date deadline;
|
||||
|
||||
@Schema(description = "开标日期", format = "date-time")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date openingDate;
|
||||
|
||||
@Schema(description = "距离截止日期剩余天数")
|
||||
private Long daysUntilDeadline;
|
||||
|
||||
@Schema(description = "预算金额")
|
||||
private BigDecimal budgetAmount;
|
||||
|
||||
@Schema(description = "货币单位")
|
||||
private String currency;
|
||||
|
||||
@Schema(description = "预算金额格式化显示")
|
||||
private String budgetAmountFormatted;
|
||||
|
||||
@Schema(description = "项目状态")
|
||||
private String projectStatus;
|
||||
|
||||
@Schema(description = "项目状态名称(中文)")
|
||||
private String projectStatusName;
|
||||
|
||||
@Schema(description = "中标状态")
|
||||
private String winningStatus;
|
||||
|
||||
@Schema(description = "中标状态名称(中文)")
|
||||
private String winningStatusName;
|
||||
|
||||
@Schema(description = "中标金额")
|
||||
private BigDecimal winningAmount;
|
||||
|
||||
@Schema(description = "中标金额格式化显示")
|
||||
private String winningAmountFormatted;
|
||||
|
||||
@Schema(description = "客户名称")
|
||||
private String clientName;
|
||||
|
||||
@Schema(description = "客户联系方式")
|
||||
private String clientContact;
|
||||
|
||||
@Schema(description = "联系人")
|
||||
private String contactPerson;
|
||||
|
||||
@Schema(description = "项目地点")
|
||||
private String projectLocation;
|
||||
|
||||
@Schema(description = "项目描述")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "关键词")
|
||||
private List<String> keywords;
|
||||
|
||||
@Schema(description = "负责人ID")
|
||||
private String responsibleUser;
|
||||
|
||||
@Schema(description = "负责人姓名")
|
||||
private String responsibleUserName;
|
||||
|
||||
@Schema(description = "团队成员")
|
||||
private List<String> teamMembers;
|
||||
|
||||
@Schema(description = "团队成员姓名列表")
|
||||
private List<String> teamMemberNames;
|
||||
|
||||
@Schema(description = "部门名称")
|
||||
private String deptName;
|
||||
|
||||
@Schema(description = "文档数量")
|
||||
private Integer documentCount;
|
||||
|
||||
@Schema(description = "要素数量")
|
||||
private Integer requirementCount;
|
||||
|
||||
@Schema(description = "否决项数量")
|
||||
private Integer vetoCount;
|
||||
|
||||
@Schema(description = "投标文件数量")
|
||||
private Integer responseCount;
|
||||
|
||||
@Schema(description = "完成进度(百分比)")
|
||||
private Integer progressPercentage;
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
package org.xyzh.api.bidding.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.xyzh.common.vo.BaseVO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 招标要素VO
|
||||
* 用于前端展示招标要素信息
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "招标要素VO")
|
||||
public class BiddingRequirementVO extends BaseVO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "要素ID")
|
||||
private String reqId;
|
||||
|
||||
@Schema(description = "所属项目ID")
|
||||
private String projectId;
|
||||
|
||||
@Schema(description = "项目名称")
|
||||
private String projectName;
|
||||
|
||||
@Schema(description = "来源文档ID")
|
||||
private String docId;
|
||||
|
||||
@Schema(description = "来源文档名称")
|
||||
private String docName;
|
||||
|
||||
@Schema(description = "要素类别")
|
||||
private String reqCategory;
|
||||
|
||||
@Schema(description = "要素类别名称(中文)")
|
||||
private String reqCategoryName;
|
||||
|
||||
@Schema(description = "要素名称")
|
||||
private String reqName;
|
||||
|
||||
@Schema(description = "要素内容")
|
||||
private String reqContent;
|
||||
|
||||
@Schema(description = "要素值")
|
||||
private String reqValue;
|
||||
|
||||
@Schema(description = "是否必填", defaultValue = "false")
|
||||
private Boolean isMandatory;
|
||||
|
||||
@Schema(description = "是否为否决项", defaultValue = "false")
|
||||
private Boolean isVeto;
|
||||
|
||||
@Schema(description = "优先级")
|
||||
private Integer priority;
|
||||
|
||||
@Schema(description = "优先级标签(高/中/低)")
|
||||
private String priorityLabel;
|
||||
|
||||
@Schema(description = "提取方式")
|
||||
private String extractionMethod;
|
||||
|
||||
@Schema(description = "提取方式名称")
|
||||
private String extractionMethodName;
|
||||
|
||||
@Schema(description = "置信度分数")
|
||||
private BigDecimal confidenceScore;
|
||||
|
||||
@Schema(description = "置信度百分比")
|
||||
private Integer confidencePercentage;
|
||||
|
||||
@Schema(description = "来源位置")
|
||||
private JsonNode sourceLocation;
|
||||
|
||||
@Schema(description = "来源位置描述")
|
||||
private String sourceLocationDesc;
|
||||
|
||||
@Schema(description = "合规状态")
|
||||
private String complianceStatus;
|
||||
|
||||
@Schema(description = "合规状态名称")
|
||||
private String complianceStatusName;
|
||||
|
||||
@Schema(description = "合规状态标签颜色")
|
||||
private String complianceStatusColor;
|
||||
|
||||
@Schema(description = "响应内容")
|
||||
private String responseContent;
|
||||
|
||||
@Schema(description = "是否已响应", defaultValue = "false")
|
||||
private Boolean hasResponse;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String notes;
|
||||
|
||||
@Schema(description = "创建者姓名")
|
||||
private String creatorName;
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
package org.xyzh.api.bidding.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.xyzh.common.vo.BaseVO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 项目流程节点VO
|
||||
* 用于前端展示流程节点信息
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "项目流程节点VO")
|
||||
public class ProcessNodeVO extends BaseVO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "流程节点ID")
|
||||
private String processId;
|
||||
|
||||
@Schema(description = "所属项目ID")
|
||||
private String projectId;
|
||||
|
||||
@Schema(description = "项目名称")
|
||||
private String projectName;
|
||||
|
||||
@Schema(description = "节点名称")
|
||||
private String nodeName;
|
||||
|
||||
@Schema(description = "节点类型")
|
||||
private String nodeType;
|
||||
|
||||
@Schema(description = "节点类型名称")
|
||||
private String nodeTypeName;
|
||||
|
||||
@Schema(description = "节点顺序")
|
||||
private Integer nodeOrder;
|
||||
|
||||
@Schema(description = "节点状态")
|
||||
private String nodeStatus;
|
||||
|
||||
@Schema(description = "节点状态名称")
|
||||
private String nodeStatusName;
|
||||
|
||||
@Schema(description = "节点状态颜色")
|
||||
private String statusColor;
|
||||
|
||||
@Schema(description = "节点图标")
|
||||
private String nodeIcon;
|
||||
|
||||
@Schema(description = "计划开始时间", format = "date-time")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date plannedStartTime;
|
||||
|
||||
@Schema(description = "计划结束时间", format = "date-time")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date plannedEndTime;
|
||||
|
||||
@Schema(description = "实际开始时间", format = "date-time")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date actualStartTime;
|
||||
|
||||
@Schema(description = "实际结束时间", format = "date-time")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date actualEndTime;
|
||||
|
||||
@Schema(description = "计划耗时(天)")
|
||||
private Integer plannedDuration;
|
||||
|
||||
@Schema(description = "实际耗时(天)")
|
||||
private Integer actualDuration;
|
||||
|
||||
@Schema(description = "是否延期", defaultValue = "false")
|
||||
private Boolean isDelayed;
|
||||
|
||||
@Schema(description = "延期天数")
|
||||
private Integer delayedDays;
|
||||
|
||||
@Schema(description = "负责人ID")
|
||||
private String responsibleUser;
|
||||
|
||||
@Schema(description = "负责人姓名")
|
||||
private String responsibleUserName;
|
||||
|
||||
@Schema(description = "参与人员ID列表")
|
||||
private List<String> participants;
|
||||
|
||||
@Schema(description = "参与人员姓名列表")
|
||||
private List<String> participantNames;
|
||||
|
||||
@Schema(description = "节点备注")
|
||||
private String notes;
|
||||
|
||||
@Schema(description = "附件ID数组")
|
||||
private List<String> attachments;
|
||||
|
||||
@Schema(description = "附件数量")
|
||||
private Integer attachmentCount;
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package org.xyzh.api.bidding.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.xyzh.common.vo.BaseVO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 招标项目列表VO(简化版)
|
||||
* 用于前端列表展示
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "招标项目列表VO")
|
||||
public class ProjectListVO extends BaseVO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "项目ID")
|
||||
private String projectId;
|
||||
|
||||
@Schema(description = "项目编号")
|
||||
private String projectNo;
|
||||
|
||||
@Schema(description = "项目名称")
|
||||
private String projectName;
|
||||
|
||||
@Schema(description = "项目类型")
|
||||
private String projectType;
|
||||
|
||||
@Schema(description = "项目类型名称")
|
||||
private String projectTypeName;
|
||||
|
||||
@Schema(description = "所属行业")
|
||||
private String industry;
|
||||
|
||||
@Schema(description = "投标截止日期", format = "date-time")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date deadline;
|
||||
|
||||
@Schema(description = "距离截止日期剩余天数")
|
||||
private Long daysUntilDeadline;
|
||||
|
||||
@Schema(description = "是否即将截止(<3天)", defaultValue = "false")
|
||||
private Boolean isUrgent;
|
||||
|
||||
@Schema(description = "预算金额格式化显示")
|
||||
private String budgetAmountFormatted;
|
||||
|
||||
@Schema(description = "项目状态")
|
||||
private String projectStatus;
|
||||
|
||||
@Schema(description = "项目状态名称")
|
||||
private String projectStatusName;
|
||||
|
||||
@Schema(description = "中标状态")
|
||||
private String winningStatus;
|
||||
|
||||
@Schema(description = "客户名称")
|
||||
private String clientName;
|
||||
|
||||
@Schema(description = "负责人姓名")
|
||||
private String responsibleUserName;
|
||||
|
||||
@Schema(description = "完成进度(百分比)")
|
||||
private Integer progressPercentage;
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package org.xyzh.api.bidding.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.xyzh.common.vo.BaseVO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 项目统计VO
|
||||
* 用于前端展示项目统计数据
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "项目统计VO")
|
||||
public class ProjectStatisticsVO extends BaseVO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "总项目数")
|
||||
private Long totalProjects;
|
||||
|
||||
@Schema(description = "进行中的项目数")
|
||||
private Long ongoingProjects;
|
||||
|
||||
@Schema(description = "已提交的项目数")
|
||||
private Long submittedProjects;
|
||||
|
||||
@Schema(description = "已中标的项目数")
|
||||
private Long wonProjects;
|
||||
|
||||
@Schema(description = "未中标的项目数")
|
||||
private Long lostProjects;
|
||||
|
||||
@Schema(description = "中标率(百分比)")
|
||||
private BigDecimal winRate;
|
||||
|
||||
@Schema(description = "即将截止的项目数(<3天)")
|
||||
private Long urgentProjects;
|
||||
|
||||
@Schema(description = "总预算金额")
|
||||
private BigDecimal totalBudget;
|
||||
|
||||
@Schema(description = "总中标金额")
|
||||
private BigDecimal totalWinningAmount;
|
||||
|
||||
@Schema(description = "按状态分组统计")
|
||||
private Map<String, Long> projectsByStatus;
|
||||
|
||||
@Schema(description = "按类型分组统计")
|
||||
private Map<String, Long> projectsByType;
|
||||
|
||||
@Schema(description = "按行业分组统计")
|
||||
private Map<String, Long> projectsByIndustry;
|
||||
|
||||
@Schema(description = "按月份分组统计(最近12个月)")
|
||||
private Map<String, Long> projectsByMonth;
|
||||
|
||||
@Schema(description = "按负责人分组统计")
|
||||
private Map<String, Long> projectsByUser;
|
||||
|
||||
@Schema(description = "平均项目周期(天)")
|
||||
private Integer avgProjectCycle;
|
||||
|
||||
@Schema(description = "最近7天新增项目数")
|
||||
private Long recentNewProjects;
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
package org.xyzh;
|
||||
|
||||
public class Main {
|
||||
public static void main(String[] args) {
|
||||
System.out.println("Hello world!");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package org.xyzh.api.crontab;
|
||||
|
||||
/**
|
||||
* 定时任务服务接口
|
||||
* 用于定时任务管理
|
||||
*/
|
||||
public interface CrontabService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package org.xyzh.api.crontab.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.xyzh.common.dto.BaseDTO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 定时任务执行日志DTO
|
||||
* 用于记录任务执行情况
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "定时任务执行日志DTO")
|
||||
public class TbCrontabLogDTO extends BaseDTO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "任务ID")
|
||||
private String taskId;
|
||||
|
||||
@Schema(description = "任务名称")
|
||||
private String taskName;
|
||||
|
||||
@Schema(description = "任务分组")
|
||||
private String taskGroup;
|
||||
|
||||
@Schema(description = "Bean名称")
|
||||
private String beanName;
|
||||
|
||||
@Schema(description = "方法名称")
|
||||
private String methodName;
|
||||
|
||||
@Schema(description = "方法参数")
|
||||
private String methodParams;
|
||||
|
||||
@Schema(description = "执行状态:0-失败/1-成功")
|
||||
private Integer executeStatus;
|
||||
|
||||
@Schema(description = "执行结果信息")
|
||||
private String executeMessage;
|
||||
|
||||
@Schema(description = "异常信息")
|
||||
private String exceptionInfo;
|
||||
|
||||
@Schema(description = "开始时间", format = "date-time")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date startTime;
|
||||
|
||||
@Schema(description = "结束时间", format = "date-time")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date endTime;
|
||||
|
||||
@Schema(description = "执行时长(毫秒)")
|
||||
private Integer executeDuration;
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package org.xyzh.api.crontab.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.xyzh.common.dto.BaseDTO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
/**
|
||||
* 定时任务DTO
|
||||
* 用于创建和更新定时任务
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "定时任务DTO")
|
||||
public class TbCrontabTaskDTO extends BaseDTO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "任务ID(更新时需要)")
|
||||
private String taskId;
|
||||
|
||||
@Schema(description = "任务名称")
|
||||
private String taskName;
|
||||
|
||||
@Schema(description = "任务分组", defaultValue = "DEFAULT")
|
||||
private String taskGroup;
|
||||
|
||||
@Schema(description = "任务元数据ID")
|
||||
private String metaId;
|
||||
|
||||
@Schema(description = "是否使用默认接收人", defaultValue = "false")
|
||||
private Boolean defaultRecipient;
|
||||
|
||||
@Schema(description = "Bean名称")
|
||||
private String beanName;
|
||||
|
||||
@Schema(description = "方法名称")
|
||||
private String methodName;
|
||||
|
||||
@Schema(description = "方法参数")
|
||||
private String methodParams;
|
||||
|
||||
@Schema(description = "Cron表达式")
|
||||
private String cronExpression;
|
||||
|
||||
@Schema(description = "任务状态:0-暂停/1-运行中", defaultValue = "0")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "任务描述")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "是否允许并发执行", defaultValue = "false")
|
||||
private Boolean concurrent;
|
||||
|
||||
@Schema(description = "错过执行策略:1-立即执行/2-执行一次/3-放弃执行", defaultValue = "1")
|
||||
private Integer misfirePolicy;
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package org.xyzh.api.crontab.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.xyzh.common.dto.BaseDTO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
/**
|
||||
* 定时任务元数据DTO
|
||||
* 用于创建和更新任务元数据配置
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "定时任务元数据DTO")
|
||||
public class TbCrontabTaskMetaDTO extends BaseDTO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "元数据ID(更新时需要)")
|
||||
private String metaId;
|
||||
|
||||
@Schema(description = "任务名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "任务描述")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "任务分类")
|
||||
private String category;
|
||||
|
||||
@Schema(description = "Bean名称(执行器类名)")
|
||||
private String beanName;
|
||||
|
||||
@Schema(description = "执行方法名")
|
||||
private String methodName;
|
||||
|
||||
@Schema(description = "Python脚本路径")
|
||||
private String scriptPath;
|
||||
|
||||
@Schema(description = "参数模板(JSON格式)")
|
||||
private String paramSchema;
|
||||
|
||||
@Schema(description = "是否自动发布", defaultValue = "false")
|
||||
private Boolean autoPublish;
|
||||
|
||||
@Schema(description = "排序号", defaultValue = "0")
|
||||
private Integer sortOrder;
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package org.xyzh.api.crontab.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.xyzh.common.vo.BaseVO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 定时任务执行日志VO
|
||||
* 用于前端展示任务执行日志
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "定时任务执行日志VO")
|
||||
public class CrontabLogVO extends BaseVO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "日志ID")
|
||||
private String logId;
|
||||
|
||||
@Schema(description = "任务ID")
|
||||
private String taskId;
|
||||
|
||||
@Schema(description = "任务名称")
|
||||
private String taskName;
|
||||
|
||||
@Schema(description = "任务分组")
|
||||
private String taskGroup;
|
||||
|
||||
@Schema(description = "Bean名称")
|
||||
private String beanName;
|
||||
|
||||
@Schema(description = "方法名称")
|
||||
private String methodName;
|
||||
|
||||
@Schema(description = "方法参数")
|
||||
private String methodParams;
|
||||
|
||||
@Schema(description = "执行状态:0-失败/1-成功")
|
||||
private Integer executeStatus;
|
||||
|
||||
@Schema(description = "执行状态名称")
|
||||
private String executeStatusName;
|
||||
|
||||
@Schema(description = "执行状态颜色")
|
||||
private String executeStatusColor;
|
||||
|
||||
@Schema(description = "执行结果信息")
|
||||
private String executeMessage;
|
||||
|
||||
@Schema(description = "异常信息")
|
||||
private String exceptionInfo;
|
||||
|
||||
@Schema(description = "是否有异常", defaultValue = "false")
|
||||
private Boolean hasException;
|
||||
|
||||
@Schema(description = "开始时间", format = "date-time")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date startTime;
|
||||
|
||||
@Schema(description = "结束时间", format = "date-time")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date endTime;
|
||||
|
||||
@Schema(description = "执行时长(毫秒)")
|
||||
private Integer executeDuration;
|
||||
|
||||
@Schema(description = "执行时长格式化显示")
|
||||
private String executeDurationFormatted;
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package org.xyzh.api.crontab.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.xyzh.common.vo.BaseVO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 定时任务列表VO
|
||||
* 用于前端列表展示(简化版)
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "定时任务列表VO")
|
||||
public class CrontabTaskListVO extends BaseVO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "任务ID")
|
||||
private String taskId;
|
||||
|
||||
@Schema(description = "任务名称")
|
||||
private String taskName;
|
||||
|
||||
@Schema(description = "任务分组")
|
||||
private String taskGroup;
|
||||
|
||||
@Schema(description = "Cron表达式")
|
||||
private String cronExpression;
|
||||
|
||||
@Schema(description = "Cron表达式描述")
|
||||
private String cronDescription;
|
||||
|
||||
@Schema(description = "任务状态")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "任务状态名称")
|
||||
private String statusName;
|
||||
|
||||
@Schema(description = "下次执行时间", format = "date-time")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date nextExecuteTime;
|
||||
|
||||
@Schema(description = "最后执行时间", format = "date-time")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date lastExecuteTime;
|
||||
|
||||
@Schema(description = "最后执行状态")
|
||||
private Integer lastExecuteStatus;
|
||||
|
||||
@Schema(description = "创建者姓名")
|
||||
private String creatorName;
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package org.xyzh.api.crontab.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.xyzh.common.vo.BaseVO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
/**
|
||||
* 定时任务元数据VO
|
||||
* 用于前端展示任务元数据信息
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "定时任务元数据VO")
|
||||
public class CrontabTaskMetaVO extends BaseVO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "元数据ID")
|
||||
private String metaId;
|
||||
|
||||
@Schema(description = "任务名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "任务描述")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "任务分类")
|
||||
private String category;
|
||||
|
||||
@Schema(description = "Bean名称(执行器类名)")
|
||||
private String beanName;
|
||||
|
||||
@Schema(description = "执行方法名")
|
||||
private String methodName;
|
||||
|
||||
@Schema(description = "Python脚本路径")
|
||||
private String scriptPath;
|
||||
|
||||
@Schema(description = "参数模板(JSON格式)")
|
||||
private String paramSchema;
|
||||
|
||||
@Schema(description = "是否自动发布", defaultValue = "false")
|
||||
private Boolean autoPublish;
|
||||
|
||||
@Schema(description = "排序号")
|
||||
private Integer sortOrder;
|
||||
|
||||
@Schema(description = "关联的任务数量")
|
||||
private Integer taskCount;
|
||||
|
||||
@Schema(description = "创建者姓名")
|
||||
private String creatorName;
|
||||
|
||||
@Schema(description = "更新者姓名")
|
||||
private String updaterName;
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
package org.xyzh.api.crontab.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.xyzh.common.vo.BaseVO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 定时任务VO
|
||||
* 用于前端展示定时任务信息
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "定时任务VO")
|
||||
public class CrontabTaskVO extends BaseVO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "任务ID")
|
||||
private String taskId;
|
||||
|
||||
@Schema(description = "任务名称")
|
||||
private String taskName;
|
||||
|
||||
@Schema(description = "任务分组")
|
||||
private String taskGroup;
|
||||
|
||||
@Schema(description = "任务元数据ID")
|
||||
private String metaId;
|
||||
|
||||
@Schema(description = "元数据名称")
|
||||
private String metaName;
|
||||
|
||||
@Schema(description = "是否使用默认接收人", defaultValue = "false")
|
||||
private Boolean defaultRecipient;
|
||||
|
||||
@Schema(description = "Bean名称")
|
||||
private String beanName;
|
||||
|
||||
@Schema(description = "方法名称")
|
||||
private String methodName;
|
||||
|
||||
@Schema(description = "方法参数")
|
||||
private String methodParams;
|
||||
|
||||
@Schema(description = "Cron表达式")
|
||||
private String cronExpression;
|
||||
|
||||
@Schema(description = "Cron表达式描述(中文)")
|
||||
private String cronDescription;
|
||||
|
||||
@Schema(description = "任务状态")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "任务状态名称")
|
||||
private String statusName;
|
||||
|
||||
@Schema(description = "任务描述")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "是否允许并发执行", defaultValue = "false")
|
||||
private Boolean concurrent;
|
||||
|
||||
@Schema(description = "错过执行策略")
|
||||
private Integer misfirePolicy;
|
||||
|
||||
@Schema(description = "错过执行策略名称")
|
||||
private String misfirePolicyName;
|
||||
|
||||
@Schema(description = "下次执行时间", format = "date-time")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date nextExecuteTime;
|
||||
|
||||
@Schema(description = "最后执行时间", format = "date-time")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date lastExecuteTime;
|
||||
|
||||
@Schema(description = "最后执行状态:0-失败/1-成功")
|
||||
private Integer lastExecuteStatus;
|
||||
|
||||
@Schema(description = "创建者姓名")
|
||||
private String creatorName;
|
||||
|
||||
@Schema(description = "更新者姓名")
|
||||
private String updaterName;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package org.xyzh.api.message;
|
||||
|
||||
/**
|
||||
* Message服务接口
|
||||
* 用于消息管理
|
||||
*/
|
||||
public interface MessageService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package org.xyzh.api.message.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import java.util.Date;
|
||||
import org.xyzh.common.vo.BaseVO;
|
||||
|
||||
/**
|
||||
* 用户消息接收记录VO
|
||||
* 用于前端展示用户消息信息
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "用户消息接收记录VO")
|
||||
public class MessageReceiverVO extends BaseVO {
|
||||
|
||||
@Schema(description = "消息ID")
|
||||
private String messageId;
|
||||
|
||||
@Schema(description = "消息标题")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "消息内容")
|
||||
private String content;
|
||||
|
||||
@Schema(description = "消息类型")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "消息类型名称")
|
||||
private String typeName;
|
||||
|
||||
@Schema(description = "用户ID")
|
||||
private String userId;
|
||||
|
||||
@Schema(description = "用户姓名")
|
||||
private String userName;
|
||||
|
||||
@Schema(description = "接收渠道")
|
||||
private String channel;
|
||||
|
||||
@Schema(description = "渠道名称")
|
||||
private String channelName;
|
||||
|
||||
@Schema(description = "消息状态:unread-未读/read-已读/handled-已处理/deleted-已删除")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "状态名称")
|
||||
private String statusName;
|
||||
|
||||
@Schema(description = "状态颜色")
|
||||
private String statusColor;
|
||||
|
||||
@Schema(description = "阅读时间", format = "date-time")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date readTime;
|
||||
|
||||
@Schema(description = "处理时间", format = "date-time")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date handleTime;
|
||||
|
||||
@Schema(description = "服务类型")
|
||||
private String serviceType;
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
package org.xyzh.api.system.service;
|
||||
|
||||
import org.xyzh.api.system.vo.AclVO;
|
||||
import org.xyzh.common.core.domain.ResultDomain;
|
||||
import org.xyzh.common.core.page.PageRequest;
|
||||
import org.xyzh.common.dto.sys.TbSysAclDTO;
|
||||
import org.xyzh.common.dto.sys.TbSysAclPolicyDTO;
|
||||
|
||||
/**
|
||||
* @description 访问控制列表服务接口
|
||||
* @filename AclService.java
|
||||
* @author yslg
|
||||
* @copyright yslg
|
||||
* @since 2025-12-05
|
||||
*/
|
||||
public interface AclService {
|
||||
|
||||
// ================= ACL 管理 =================
|
||||
/**
|
||||
* @description 插入访问控制列表
|
||||
* @param aclDTO 访问控制列表DTO
|
||||
* @return ResultDomain<TbSysAclDTO> 插入结果
|
||||
* @author yslg
|
||||
* @since 2025-12-05
|
||||
*/
|
||||
ResultDomain<TbSysAclDTO> insertAcl(TbSysAclDTO aclDTO);
|
||||
|
||||
/**
|
||||
* @description 更新访问控制列表
|
||||
* @param aclDTO 访问控制列表DTO
|
||||
* @return ResultDomain<TbSysAclDTO> 更新结果
|
||||
* @author yslg
|
||||
* @since 2025-12-05
|
||||
*/
|
||||
ResultDomain<TbSysAclDTO> updateAcl(TbSysAclDTO aclDTO);
|
||||
|
||||
/**
|
||||
* @description 删除访问控制列表
|
||||
* @param aclDTO 访问控制列表DTO
|
||||
* @return ResultDomain<Boolean> 删除结果
|
||||
* @author yslg
|
||||
* @since 2025-12-05
|
||||
*/
|
||||
ResultDomain<Boolean> deleteAcl(TbSysAclDTO aclDTO);
|
||||
|
||||
/**
|
||||
* @description 根据条件查询访问控制列表分页数据
|
||||
* @param pageRequest 分页请求
|
||||
* @return ResultDomain<AclVO> 分页结果
|
||||
* @author yslg
|
||||
* @since 2025-12-05
|
||||
*/
|
||||
ResultDomain<AclVO> getAclPage(PageRequest<AclVO> pageRequest);
|
||||
|
||||
/**
|
||||
* @description 根据条件查询访问控制列表
|
||||
* @param filter 过滤条件
|
||||
* @return ResultDomain<AclVO> 查询结果
|
||||
* @author yslg
|
||||
* @since 2025-12-05
|
||||
*/
|
||||
ResultDomain<AclVO> getAclList(AclVO filter);
|
||||
|
||||
/**
|
||||
* @description 根据对象ID查询访问控制列表
|
||||
* @param objectId 对象ID
|
||||
* @return ResultDomain<AclVO> 查询结果
|
||||
* @author yslg
|
||||
* @since 2025-12-05
|
||||
*/
|
||||
ResultDomain<AclVO> getAclByObjectId(String objectId);
|
||||
|
||||
// ================= ACL Policy 管理 =================
|
||||
/**
|
||||
* @description 插入访问控制策略
|
||||
* @param aclPolicyDTO 访问控制策略DTO
|
||||
* @return ResultDomain<TbSysAclPolicyDTO> 插入结果
|
||||
* @author yslg
|
||||
* @since 2025-12-05
|
||||
*/
|
||||
ResultDomain<TbSysAclPolicyDTO> insertAclPolicy(TbSysAclPolicyDTO aclPolicyDTO);
|
||||
|
||||
/**
|
||||
* @description 更新访问控制策略
|
||||
* @param aclPolicyDTO 访问控制策略DTO
|
||||
* @return ResultDomain<TbSysAclPolicyDTO> 更新结果
|
||||
* @author yslg
|
||||
* @since 2025-12-05
|
||||
*/
|
||||
ResultDomain<TbSysAclPolicyDTO> updateAclPolicy(TbSysAclPolicyDTO aclPolicyDTO);
|
||||
|
||||
/**
|
||||
* @description 删除访问控制策略
|
||||
* @param aclPolicyDTO 访问控制策略DTO
|
||||
* @return ResultDomain<Boolean> 删除结果
|
||||
* @author yslg
|
||||
* @since 2025-12-05
|
||||
*/
|
||||
ResultDomain<Boolean> deleteAclPolicy(TbSysAclPolicyDTO aclPolicyDTO);
|
||||
|
||||
/**
|
||||
* @description 根据条件查询访问控制策略分页数据
|
||||
* @param pageRequest 分页请求
|
||||
* @return ResultDomain<AclVO> 分页结果
|
||||
* @author yslg
|
||||
* @since 2025-12-05
|
||||
*/
|
||||
ResultDomain<AclVO> getAclPolicyPage(PageRequest<AclVO> pageRequest);
|
||||
|
||||
/**
|
||||
* @description 根据条件查询访问控制策略列表
|
||||
* @param filter 过滤条件
|
||||
* @return ResultDomain<AclVO> 查询结果
|
||||
* @author yslg
|
||||
* @since 2025-12-05
|
||||
*/
|
||||
ResultDomain<AclVO> getAclPolicyList(AclVO filter);
|
||||
}
|
||||
@@ -154,60 +154,6 @@ public interface DeptRoleService {
|
||||
*/
|
||||
ResultDomain<UserDeptRoleVO> getRoleListByUserId(String userId);
|
||||
|
||||
// ================= 部门角色关联管理 =================
|
||||
/**
|
||||
* @description 插入部门角色关联
|
||||
* @param deptRoleDTO 部门角色DTO
|
||||
* @return ResultDomain<TbSysDeptRoleDTO> 插入结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<TbSysDeptRoleDTO> insertDeptRole(TbSysDeptRoleDTO deptRoleDTO);
|
||||
|
||||
/**
|
||||
* @description 更新部门角色关联
|
||||
* @param deptRoleDTO 部门角色DTO
|
||||
* @return ResultDomain<TbSysDeptRoleDTO> 更新结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<TbSysDeptRoleDTO> updateDeptRole(TbSysDeptRoleDTO deptRoleDTO);
|
||||
|
||||
/**
|
||||
* @description 根据ID删除部门角色关联
|
||||
* @param deptRoleDTO 部门角色DTO
|
||||
* @return ResultDomain<Boolean> 删除结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<Boolean> deleteDeptRole(TbSysDeptRoleDTO deptRoleDTO);
|
||||
|
||||
/**
|
||||
* @description 根据ID查询部门角色关联
|
||||
* @param filter 部门角色VO
|
||||
* @return ResultDomain<UserDeptRoleVO> 查询结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<UserDeptRoleVO> getDeptRole(UserDeptRoleVO filter);
|
||||
|
||||
/**
|
||||
* @description 根据条件查询部门角色关联列表
|
||||
* @param filter 部门角色VO
|
||||
* @return ResultDomain<UserDeptRoleVO> 查询结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<UserDeptRoleVO> getDeptRoleList(UserDeptRoleVO filter);
|
||||
|
||||
/**
|
||||
* @description 根据条件查询部门角色关联分页列表
|
||||
* @param pageRequest 部门角色VO
|
||||
* @return ResultDomain<UserDeptRoleVO> 查询结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<UserDeptRoleVO> getDeptRolePage(PageRequest<UserDeptRoleVO> pageRequest);
|
||||
|
||||
// ==================== 角色权限关联 ================================
|
||||
/**
|
||||
|
||||
@@ -4,7 +4,6 @@ import org.xyzh.api.system.vo.PermissionVO;
|
||||
import org.xyzh.common.core.domain.ResultDomain;
|
||||
import org.xyzh.common.dto.sys.TbSysModuleDTO;
|
||||
import org.xyzh.common.dto.sys.TbSysPermissionDTO;
|
||||
import org.xyzh.common.dto.sys.TbSysRolePermissionDTO;
|
||||
import org.xyzh.common.core.page.PageRequest;
|
||||
|
||||
/**
|
||||
|
||||
@@ -24,9 +24,6 @@ public class UserDeptRoleVO extends BaseVO {
|
||||
@Schema(description = "用户ID")
|
||||
private String userId;
|
||||
|
||||
@Schema(description = "用户名")
|
||||
private String username;
|
||||
|
||||
@Schema(description = "密码")
|
||||
private String password;
|
||||
|
||||
@@ -49,18 +46,12 @@ public class UserDeptRoleVO extends BaseVO {
|
||||
@Schema(description = "头像")
|
||||
private String avatar;
|
||||
|
||||
@Schema(description = "用户名")
|
||||
private String username;
|
||||
|
||||
@Schema(description = "性别")
|
||||
private Integer gender;
|
||||
|
||||
@Schema(description = "姓")
|
||||
private String familyName;
|
||||
|
||||
@Schema(description = "名")
|
||||
private String givenName;
|
||||
|
||||
@Schema(description = "全名")
|
||||
private String fullName;
|
||||
|
||||
@Schema(description = "等级")
|
||||
private Integer level;
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
package org.xyzh.api.workcase;
|
||||
|
||||
/**
|
||||
* 工单服务接口
|
||||
* 用于客服工单管理
|
||||
*/
|
||||
public interface WorkcaseService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package org.xyzh.api.workcase.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.xyzh.common.dto.BaseDTO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 会话DTO
|
||||
* 用于创建和更新会话
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "会话DTO")
|
||||
public class TbConversationDTO extends BaseDTO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "会话ID(更新时需要)")
|
||||
private String conversationId;
|
||||
|
||||
@Schema(description = "客户ID")
|
||||
private String customerId;
|
||||
|
||||
@Schema(description = "会话类型:ai-AI客服/human-人工客服/transfer-转接", defaultValue = "ai")
|
||||
private String conversationType;
|
||||
|
||||
@Schema(description = "渠道:wechat-微信/web-网页/app-应用/phone-电话", defaultValue = "wechat")
|
||||
private String channel;
|
||||
|
||||
@Schema(description = "智能体ID或客服人员ID")
|
||||
private String agentId;
|
||||
|
||||
@Schema(description = "座席类型:ai-AI/human-人工", defaultValue = "ai")
|
||||
private String agentType;
|
||||
|
||||
@Schema(description = "会话开始时间", format = "date-time")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date sessionStartTime;
|
||||
|
||||
@Schema(description = "会话结束时间", format = "date-time")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date sessionEndTime;
|
||||
|
||||
@Schema(description = "会话时长(秒)")
|
||||
private Integer durationSeconds;
|
||||
|
||||
@Schema(description = "消息数量", defaultValue = "0")
|
||||
private Integer messageCount;
|
||||
|
||||
@Schema(description = "会话状态:active-进行中/closed-已结束/transferred-已转接/timeout-超时", defaultValue = "active")
|
||||
private String conversationStatus;
|
||||
|
||||
@Schema(description = "满意度评分(1-5星)")
|
||||
private Integer satisfactionRating;
|
||||
|
||||
@Schema(description = "满意度反馈")
|
||||
private String satisfactionFeedback;
|
||||
|
||||
@Schema(description = "会话摘要(AI生成)")
|
||||
private String summary;
|
||||
|
||||
@Schema(description = "会话标签")
|
||||
private List<String> tags;
|
||||
|
||||
@Schema(description = "会话元数据")
|
||||
private JsonNode metadata;
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
package org.xyzh.api.workcase.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.xyzh.common.dto.BaseDTO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 客户信息DTO
|
||||
* 用于创建和更新客户信息
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "客户信息DTO")
|
||||
public class TbCustomerDTO extends BaseDTO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "客户ID(更新时需要)")
|
||||
private String customerId;
|
||||
|
||||
@Schema(description = "客户编号")
|
||||
private String customerNo;
|
||||
|
||||
@Schema(description = "客户姓名")
|
||||
private String customerName;
|
||||
|
||||
@Schema(description = "客户类型:individual-个人/enterprise-企业", defaultValue = "individual")
|
||||
private String customerType;
|
||||
|
||||
@Schema(description = "公司名称")
|
||||
private String companyName;
|
||||
|
||||
@Schema(description = "电话")
|
||||
private String phone;
|
||||
|
||||
@Schema(description = "邮箱")
|
||||
private String email;
|
||||
|
||||
@Schema(description = "微信OpenID")
|
||||
private String wechatOpenid;
|
||||
|
||||
@Schema(description = "微信UnionID")
|
||||
private String wechatUnionid;
|
||||
|
||||
@Schema(description = "头像URL")
|
||||
private String avatar;
|
||||
|
||||
@Schema(description = "性别:0-未知/1-男/2-女", defaultValue = "0")
|
||||
private Integer gender;
|
||||
|
||||
@Schema(description = "地址")
|
||||
private String address;
|
||||
|
||||
@Schema(description = "客户等级:vip/important/normal/potential", defaultValue = "normal")
|
||||
private String customerLevel;
|
||||
|
||||
@Schema(description = "客户来源:wechat-微信/web-网站/phone-电话/referral-推荐")
|
||||
private String customerSource;
|
||||
|
||||
@Schema(description = "客户标签数组")
|
||||
private List<String> tags;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String notes;
|
||||
|
||||
@Schema(description = "CRM系统客户ID")
|
||||
private String crmCustomerId;
|
||||
|
||||
@Schema(description = "最后联系时间", format = "date-time")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date lastContactTime;
|
||||
|
||||
@Schema(description = "咨询总次数", defaultValue = "0")
|
||||
private Integer totalConsultations;
|
||||
|
||||
@Schema(description = "订单总数", defaultValue = "0")
|
||||
private Integer totalOrders;
|
||||
|
||||
@Schema(description = "总消费金额", defaultValue = "0")
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
@Schema(description = "满意度评分(1-5)")
|
||||
private BigDecimal satisfactionScore;
|
||||
|
||||
@Schema(description = "状态:active-活跃/inactive-非活跃/blacklist-黑名单", defaultValue = "active")
|
||||
private String status;
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
package org.xyzh.api.workcase.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.xyzh.common.dto.BaseDTO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 工单DTO
|
||||
* 用于创建和更新工单
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "工单DTO")
|
||||
public class TbTicketDTO extends BaseDTO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "工单ID(更新时需要)")
|
||||
private String ticketId;
|
||||
|
||||
@Schema(description = "工单编号")
|
||||
private String ticketNo;
|
||||
|
||||
@Schema(description = "客户ID")
|
||||
private String customerId;
|
||||
|
||||
@Schema(description = "关联会话ID")
|
||||
private String conversationId;
|
||||
|
||||
@Schema(description = "工单类型:consultation-咨询/complaint-投诉/suggestion-建议/repair-维修/installation-安装/other-其他")
|
||||
private String ticketType;
|
||||
|
||||
@Schema(description = "工单分类")
|
||||
private String ticketCategory;
|
||||
|
||||
@Schema(description = "优先级:urgent-紧急/high-高/normal-普通/low-低", defaultValue = "normal")
|
||||
private String priority;
|
||||
|
||||
@Schema(description = "工单标题")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "问题描述")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "附件ID数组")
|
||||
private List<String> attachments;
|
||||
|
||||
@Schema(description = "工单来源:ai-AI生成/manual-人工创建/system-系统自动", defaultValue = "ai")
|
||||
private String ticketSource;
|
||||
|
||||
@Schema(description = "分配给(处理人)")
|
||||
private String assignedTo;
|
||||
|
||||
@Schema(description = "分配部门")
|
||||
private String assignedDept;
|
||||
|
||||
@Schema(description = "工单状态:pending-待处理/processing-处理中/resolved-已解决/closed-已关闭/cancelled-已取消", defaultValue = "pending")
|
||||
private String ticketStatus;
|
||||
|
||||
@Schema(description = "解决方案")
|
||||
private String resolution;
|
||||
|
||||
@Schema(description = "解决时间", format = "date-time")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date resolutionTime;
|
||||
|
||||
@Schema(description = "关闭时间", format = "date-time")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date closeTime;
|
||||
|
||||
@Schema(description = "首次响应时间", format = "date-time")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date responseTime;
|
||||
|
||||
@Schema(description = "SLA截止时间", format = "date-time")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date slaDeadline;
|
||||
|
||||
@Schema(description = "是否逾期", defaultValue = "false")
|
||||
private Boolean isOverdue;
|
||||
|
||||
@Schema(description = "客户评分(1-5星)")
|
||||
private Integer customerRating;
|
||||
|
||||
@Schema(description = "客户反馈")
|
||||
private String customerFeedback;
|
||||
|
||||
@Schema(description = "CRM系统工单ID")
|
||||
private String crmTicketId;
|
||||
|
||||
@Schema(description = "同步状态:pending-待同步/synced-已同步/failed-失败", defaultValue = "pending")
|
||||
private String syncStatus;
|
||||
|
||||
@Schema(description = "工单标签")
|
||||
private List<String> tags;
|
||||
|
||||
@Schema(description = "工单元数据")
|
||||
private JsonNode metadata;
|
||||
}
|
||||
@@ -0,0 +1,108 @@
|
||||
package org.xyzh.api.workcase.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.xyzh.common.vo.BaseVO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 会话VO
|
||||
* 用于前端展示会话信息
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "会话VO")
|
||||
public class ConversationVO extends BaseVO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "会话ID")
|
||||
private String conversationId;
|
||||
|
||||
@Schema(description = "客户ID")
|
||||
private String customerId;
|
||||
|
||||
@Schema(description = "客户姓名")
|
||||
private String customerName;
|
||||
|
||||
@Schema(description = "客户头像")
|
||||
private String customerAvatar;
|
||||
|
||||
@Schema(description = "会话类型")
|
||||
private String conversationType;
|
||||
|
||||
@Schema(description = "会话类型名称")
|
||||
private String conversationTypeName;
|
||||
|
||||
@Schema(description = "渠道")
|
||||
private String channel;
|
||||
|
||||
@Schema(description = "渠道名称")
|
||||
private String channelName;
|
||||
|
||||
@Schema(description = "智能体ID或客服人员ID")
|
||||
private String agentId;
|
||||
|
||||
@Schema(description = "座席名称")
|
||||
private String agentName;
|
||||
|
||||
@Schema(description = "座席类型")
|
||||
private String agentType;
|
||||
|
||||
@Schema(description = "座席类型名称")
|
||||
private String agentTypeName;
|
||||
|
||||
@Schema(description = "会话开始时间", format = "date-time")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date sessionStartTime;
|
||||
|
||||
@Schema(description = "会话结束时间", format = "date-time")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date sessionEndTime;
|
||||
|
||||
@Schema(description = "会话时长(秒)")
|
||||
private Integer durationSeconds;
|
||||
|
||||
@Schema(description = "会话时长格式化显示")
|
||||
private String durationFormatted;
|
||||
|
||||
@Schema(description = "消息数量")
|
||||
private Integer messageCount;
|
||||
|
||||
@Schema(description = "会话状态")
|
||||
private String conversationStatus;
|
||||
|
||||
@Schema(description = "会话状态名称")
|
||||
private String conversationStatusName;
|
||||
|
||||
@Schema(description = "会话状态颜色")
|
||||
private String statusColor;
|
||||
|
||||
@Schema(description = "满意度评分(1-5星)")
|
||||
private Integer satisfactionRating;
|
||||
|
||||
@Schema(description = "满意度反馈")
|
||||
private String satisfactionFeedback;
|
||||
|
||||
@Schema(description = "会话摘要")
|
||||
private String summary;
|
||||
|
||||
@Schema(description = "会话标签")
|
||||
private List<String> tags;
|
||||
|
||||
@Schema(description = "会话元数据")
|
||||
private JsonNode metadata;
|
||||
|
||||
@Schema(description = "最后一条消息内容")
|
||||
private String lastMessageContent;
|
||||
|
||||
@Schema(description = "最后一条消息时间", format = "date-time")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date lastMessageTime;
|
||||
|
||||
@Schema(description = "创建者姓名")
|
||||
private String creatorName;
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
package org.xyzh.api.workcase.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.xyzh.common.vo.BaseVO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 客户信息VO
|
||||
* 用于前端展示客户信息
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "客户信息VO")
|
||||
public class CustomerVO extends BaseVO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "客户ID")
|
||||
private String customerId;
|
||||
|
||||
@Schema(description = "客户编号")
|
||||
private String customerNo;
|
||||
|
||||
@Schema(description = "客户姓名")
|
||||
private String customerName;
|
||||
|
||||
@Schema(description = "客户类型")
|
||||
private String customerType;
|
||||
|
||||
@Schema(description = "客户类型名称")
|
||||
private String customerTypeName;
|
||||
|
||||
@Schema(description = "公司名称")
|
||||
private String companyName;
|
||||
|
||||
@Schema(description = "电话")
|
||||
private String phone;
|
||||
|
||||
@Schema(description = "邮箱")
|
||||
private String email;
|
||||
|
||||
@Schema(description = "微信OpenID")
|
||||
private String wechatOpenid;
|
||||
|
||||
@Schema(description = "头像URL")
|
||||
private String avatar;
|
||||
|
||||
@Schema(description = "性别")
|
||||
private Integer gender;
|
||||
|
||||
@Schema(description = "性别名称")
|
||||
private String genderName;
|
||||
|
||||
@Schema(description = "地址")
|
||||
private String address;
|
||||
|
||||
@Schema(description = "客户等级")
|
||||
private String customerLevel;
|
||||
|
||||
@Schema(description = "客户等级名称")
|
||||
private String customerLevelName;
|
||||
|
||||
@Schema(description = "客户来源")
|
||||
private String customerSource;
|
||||
|
||||
@Schema(description = "客户来源名称")
|
||||
private String customerSourceName;
|
||||
|
||||
@Schema(description = "客户标签")
|
||||
private List<String> tags;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String notes;
|
||||
|
||||
@Schema(description = "CRM系统客户ID")
|
||||
private String crmCustomerId;
|
||||
|
||||
@Schema(description = "最后联系时间", format = "date-time")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date lastContactTime;
|
||||
|
||||
@Schema(description = "咨询总次数")
|
||||
private Integer totalConsultations;
|
||||
|
||||
@Schema(description = "订单总数")
|
||||
private Integer totalOrders;
|
||||
|
||||
@Schema(description = "总消费金额")
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
@Schema(description = "满意度评分")
|
||||
private BigDecimal satisfactionScore;
|
||||
|
||||
@Schema(description = "状态")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "状态名称")
|
||||
private String statusName;
|
||||
|
||||
@Schema(description = "状态颜色")
|
||||
private String statusColor;
|
||||
|
||||
@Schema(description = "创建者姓名")
|
||||
private String creatorName;
|
||||
|
||||
@Schema(description = "更新者姓名")
|
||||
private String updaterName;
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package org.xyzh.api.workcase.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.xyzh.common.vo.BaseVO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 工单列表VO
|
||||
* 用于前端列表展示(简化版)
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "工单列表VO")
|
||||
public class TicketListVO extends BaseVO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "工单ID")
|
||||
private String ticketId;
|
||||
|
||||
@Schema(description = "工单编号")
|
||||
private String ticketNo;
|
||||
|
||||
@Schema(description = "客户姓名")
|
||||
private String customerName;
|
||||
|
||||
@Schema(description = "工单标题")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "工单类型名称")
|
||||
private String ticketTypeName;
|
||||
|
||||
@Schema(description = "优先级")
|
||||
private String priority;
|
||||
|
||||
@Schema(description = "优先级名称")
|
||||
private String priorityName;
|
||||
|
||||
@Schema(description = "工单状态")
|
||||
private String ticketStatus;
|
||||
|
||||
@Schema(description = "工单状态名称")
|
||||
private String ticketStatusName;
|
||||
|
||||
@Schema(description = "处理人姓名")
|
||||
private String assignedToName;
|
||||
|
||||
@Schema(description = "SLA截止时间", format = "date-time")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date slaDeadline;
|
||||
|
||||
@Schema(description = "是否逾期", defaultValue = "false")
|
||||
private Boolean isOverdue;
|
||||
|
||||
@Schema(description = "创建者姓名")
|
||||
private String creatorName;
|
||||
}
|
||||
@@ -0,0 +1,151 @@
|
||||
package org.xyzh.api.workcase.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.xyzh.common.vo.BaseVO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 工单VO
|
||||
* 用于前端展示工单信息
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "工单VO")
|
||||
public class TicketVO extends BaseVO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "工单ID")
|
||||
private String ticketId;
|
||||
|
||||
@Schema(description = "工单编号")
|
||||
private String ticketNo;
|
||||
|
||||
@Schema(description = "客户ID")
|
||||
private String customerId;
|
||||
|
||||
@Schema(description = "客户姓名")
|
||||
private String customerName;
|
||||
|
||||
@Schema(description = "客户电话")
|
||||
private String customerPhone;
|
||||
|
||||
@Schema(description = "关联会话ID")
|
||||
private String conversationId;
|
||||
|
||||
@Schema(description = "工单类型")
|
||||
private String ticketType;
|
||||
|
||||
@Schema(description = "工单类型名称")
|
||||
private String ticketTypeName;
|
||||
|
||||
@Schema(description = "工单分类")
|
||||
private String ticketCategory;
|
||||
|
||||
@Schema(description = "优先级")
|
||||
private String priority;
|
||||
|
||||
@Schema(description = "优先级名称")
|
||||
private String priorityName;
|
||||
|
||||
@Schema(description = "优先级颜色")
|
||||
private String priorityColor;
|
||||
|
||||
@Schema(description = "工单标题")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "问题描述")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "附件ID数组")
|
||||
private List<String> attachments;
|
||||
|
||||
@Schema(description = "附件数量")
|
||||
private Integer attachmentCount;
|
||||
|
||||
@Schema(description = "工单来源")
|
||||
private String ticketSource;
|
||||
|
||||
@Schema(description = "工单来源名称")
|
||||
private String ticketSourceName;
|
||||
|
||||
@Schema(description = "分配给(处理人ID)")
|
||||
private String assignedTo;
|
||||
|
||||
@Schema(description = "处理人姓名")
|
||||
private String assignedToName;
|
||||
|
||||
@Schema(description = "分配部门")
|
||||
private String assignedDept;
|
||||
|
||||
@Schema(description = "分配部门名称")
|
||||
private String assignedDeptName;
|
||||
|
||||
@Schema(description = "工单状态")
|
||||
private String ticketStatus;
|
||||
|
||||
@Schema(description = "工单状态名称")
|
||||
private String ticketStatusName;
|
||||
|
||||
@Schema(description = "工单状态颜色")
|
||||
private String statusColor;
|
||||
|
||||
@Schema(description = "解决方案")
|
||||
private String resolution;
|
||||
|
||||
@Schema(description = "解决时间", format = "date-time")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date resolutionTime;
|
||||
|
||||
@Schema(description = "关闭时间", format = "date-time")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date closeTime;
|
||||
|
||||
@Schema(description = "首次响应时间", format = "date-time")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date responseTime;
|
||||
|
||||
@Schema(description = "SLA截止时间", format = "date-time")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date slaDeadline;
|
||||
|
||||
@Schema(description = "是否逾期", defaultValue = "false")
|
||||
private Boolean isOverdue;
|
||||
|
||||
@Schema(description = "距离SLA截止的剩余时间(分钟)")
|
||||
private Integer slaRemainingMinutes;
|
||||
|
||||
@Schema(description = "客户评分(1-5星)")
|
||||
private Integer customerRating;
|
||||
|
||||
@Schema(description = "客户反馈")
|
||||
private String customerFeedback;
|
||||
|
||||
@Schema(description = "CRM系统工单ID")
|
||||
private String crmTicketId;
|
||||
|
||||
@Schema(description = "同步状态")
|
||||
private String syncStatus;
|
||||
|
||||
@Schema(description = "同步状态名称")
|
||||
private String syncStatusName;
|
||||
|
||||
@Schema(description = "工单标签")
|
||||
private List<String> tags;
|
||||
|
||||
@Schema(description = "工单元数据")
|
||||
private JsonNode metadata;
|
||||
|
||||
@Schema(description = "处理记录数量")
|
||||
private Integer logCount;
|
||||
|
||||
@Schema(description = "创建者姓名")
|
||||
private String creatorName;
|
||||
|
||||
@Schema(description = "更新者姓名")
|
||||
private String updaterName;
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package org.xyzh.system.controller;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
@@ -36,6 +37,7 @@ public class DeptRoleController {
|
||||
* @since 2025-11-10
|
||||
*/
|
||||
@PostMapping("/dept")
|
||||
@PreAuthorize("@ss.hasPermi('system:dept:create')")
|
||||
public ResultDomain<TbSysDeptDTO> createDept(@RequestBody TbSysDeptDTO deptDTO) {
|
||||
return deptRoleService.insertDept(deptDTO);
|
||||
}
|
||||
@@ -49,6 +51,7 @@ public class DeptRoleController {
|
||||
* @since 2025-11-10
|
||||
*/
|
||||
@PutMapping("/dept")
|
||||
@PreAuthorize("@ss.hasPermi('system:dept:edit')")
|
||||
public ResultDomain<TbSysDeptDTO> updateDept(@RequestBody TbSysDeptDTO deptDTO) {
|
||||
return deptRoleService.updateDept(deptDTO);
|
||||
}
|
||||
@@ -61,6 +64,7 @@ public class DeptRoleController {
|
||||
* @since 2025-11-10
|
||||
*/
|
||||
@DeleteMapping("/dept")
|
||||
@PreAuthorize("@ss.hasPermi('system:dept:delete')")
|
||||
public ResultDomain<Boolean> deleteDept(@RequestBody TbSysDeptDTO deptDTO) {
|
||||
return deptRoleService.deleteDept(deptDTO);
|
||||
}
|
||||
@@ -73,6 +77,7 @@ public class DeptRoleController {
|
||||
* @since 2025-11-10
|
||||
*/
|
||||
@GetMapping("/dept/page")
|
||||
@PreAuthorize("@ss.hasPermi('system:dept:view')")
|
||||
public ResultDomain<UserDeptRoleVO> getDeptPage(@RequestBody PageRequest<UserDeptRoleVO> pageRequest) {
|
||||
return deptRoleService.getDeptPage(pageRequest);
|
||||
}
|
||||
@@ -85,6 +90,7 @@ public class DeptRoleController {
|
||||
* @since 2025-11-10
|
||||
*/
|
||||
@GetMapping("/dept/list")
|
||||
@PreAuthorize("@ss.hasPermi('system:dept:view')")
|
||||
public ResultDomain<UserDeptRoleVO> getDeptList(@RequestBody UserDeptRoleVO filter) {
|
||||
return deptRoleService.getDeptList(filter);
|
||||
}
|
||||
@@ -98,6 +104,7 @@ public class DeptRoleController {
|
||||
* @since 2025-11-10
|
||||
*/
|
||||
@PostMapping("/role")
|
||||
@PreAuthorize("@ss.hasPermi('system:role:create')")
|
||||
public ResultDomain<TbSysRoleDTO> createRole(@RequestBody TbSysRoleDTO roleDTO) {
|
||||
return deptRoleService.insertRole(roleDTO);
|
||||
}
|
||||
@@ -110,6 +117,7 @@ public class DeptRoleController {
|
||||
* @since 2025-11-10
|
||||
*/
|
||||
@PutMapping("/role")
|
||||
@PreAuthorize("@ss.hasPermi('system:role:edit')")
|
||||
public ResultDomain<TbSysRoleDTO> updateRole(@RequestBody TbSysRoleDTO roleDTO) {
|
||||
return deptRoleService.updateRole(roleDTO);
|
||||
}
|
||||
@@ -122,6 +130,7 @@ public class DeptRoleController {
|
||||
* @since 2025-11-10
|
||||
*/
|
||||
@DeleteMapping("/role")
|
||||
@PreAuthorize("@ss.hasPermi('system:role:delete')")
|
||||
public ResultDomain<Boolean> deleteRole(@RequestBody TbSysRoleDTO roleDTO) {
|
||||
return deptRoleService.deleteRole(roleDTO);
|
||||
}
|
||||
@@ -134,6 +143,7 @@ public class DeptRoleController {
|
||||
* @since 2025-11-10
|
||||
*/
|
||||
@GetMapping("/role/page")
|
||||
@PreAuthorize("@ss.hasPermi('system:role:view')")
|
||||
public ResultDomain<UserDeptRoleVO> getRolePage(@RequestBody PageRequest<UserDeptRoleVO> pageRequest) {
|
||||
return deptRoleService.getRolePage(pageRequest);
|
||||
}
|
||||
@@ -146,35 +156,11 @@ public class DeptRoleController {
|
||||
* @since 2025-11-10
|
||||
*/
|
||||
@GetMapping("/role/list")
|
||||
@PreAuthorize("@ss.hasPermi('system:role:view')")
|
||||
public ResultDomain<UserDeptRoleVO> getRoleList(@RequestBody UserDeptRoleVO filter) {
|
||||
return deptRoleService.getRoleList(filter);
|
||||
}
|
||||
|
||||
// ================= 部门角色信息相关接口 ==================
|
||||
/**
|
||||
* @description 根据条件查询部门角色关联分页列表
|
||||
* @param PageRequest<UserDeptRoleVO> pageRequest 分页请求
|
||||
* @return ResultDomain<UserDeptRoleVO> 分页列表
|
||||
* @author yslg
|
||||
* @since 2025-11-10
|
||||
*/
|
||||
@GetMapping("/deptRole/page")
|
||||
public ResultDomain<UserDeptRoleVO> getDeptRolePage(@RequestBody PageRequest<UserDeptRoleVO> pageRequest) {
|
||||
return deptRoleService.getDeptRolePage(pageRequest);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 根据条件查询部门角色关联列表
|
||||
* @param filter 部门角色VO
|
||||
* @return ResultDomain<UserDeptRoleVO> 部门角色关联列表
|
||||
* @author yslg
|
||||
* @since 2025-11-10
|
||||
*/
|
||||
@GetMapping("/deptRole/list")
|
||||
public ResultDomain<UserDeptRoleVO> getDeptRoleList(@RequestBody UserDeptRoleVO filter) {
|
||||
return deptRoleService.getDeptRoleList(filter);
|
||||
}
|
||||
|
||||
// ================== 角色权限相关接口 ==================
|
||||
/**
|
||||
* @description 给一个角色设置权限
|
||||
@@ -184,6 +170,7 @@ public class DeptRoleController {
|
||||
* @since 2025-11-11
|
||||
*/
|
||||
@PostMapping("/rolePermission/bind")
|
||||
@PreAuthorize("@ss.hasPermi('system:permission:manage')")
|
||||
public ResultDomain<PermissionVO> getRolePermission(@RequestBody PermissionVO permissionVO) {
|
||||
return deptRoleService.setRolePermission(permissionVO);
|
||||
}
|
||||
@@ -196,6 +183,7 @@ public class DeptRoleController {
|
||||
* @since 2025-11-11
|
||||
*/
|
||||
@PostMapping("/rolePermission/list")
|
||||
@PreAuthorize("@ss.hasPermi('system:permission:view')")
|
||||
public ResultDomain<PermissionVO> getRolePermissionList(@RequestBody PermissionVO permissionVO) {
|
||||
return deptRoleService.getRolePermissionList(permissionVO);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package org.xyzh.system.controller;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
@@ -35,6 +36,7 @@ public class PermissionController {
|
||||
* @since 2025-11-10
|
||||
*/
|
||||
@PostMapping("/module")
|
||||
@PreAuthorize("@ss.hasPermi('system:permission:manage')")
|
||||
public ResultDomain<TbSysModuleDTO> createModule(@RequestBody TbSysModuleDTO moduleDTO) {
|
||||
return modulePermissionService.insertModule(moduleDTO);
|
||||
}
|
||||
@@ -47,6 +49,7 @@ public class PermissionController {
|
||||
* @since 2025-11-10
|
||||
*/
|
||||
@PutMapping("/moudule")
|
||||
@PreAuthorize("@ss.hasPermi('system:permission:manage')")
|
||||
public ResultDomain<TbSysModuleDTO> updateModule(@RequestBody TbSysModuleDTO moduleDTO) {
|
||||
return modulePermissionService.updateModule(moduleDTO);
|
||||
}
|
||||
@@ -59,6 +62,7 @@ public class PermissionController {
|
||||
* @since 2025-11-10
|
||||
*/
|
||||
@DeleteMapping("/module")
|
||||
@PreAuthorize("@ss.hasPermi('system:permission:manage')")
|
||||
public ResultDomain<Boolean> deleteModule(@RequestBody TbSysModuleDTO moduleDTO) {
|
||||
return modulePermissionService.deleteModule(moduleDTO);
|
||||
}
|
||||
@@ -71,6 +75,7 @@ public class PermissionController {
|
||||
* @since 2025-11-10
|
||||
*/
|
||||
@PostMapping("/module/page")
|
||||
@PreAuthorize("@ss.hasPermi('system:permission:view')")
|
||||
public ResultDomain<PermissionVO> getModulePage(@RequestBody PageRequest<PermissionVO> pageRequest) {
|
||||
return modulePermissionService.getModulePage(pageRequest);
|
||||
}
|
||||
@@ -83,6 +88,7 @@ public class PermissionController {
|
||||
* @since 2025-11-10
|
||||
*/
|
||||
@PostMapping("/module/list")
|
||||
@PreAuthorize("@ss.hasPermi('system:permission:view')")
|
||||
public ResultDomain<PermissionVO> getModuleList(@RequestBody PermissionVO filter) {
|
||||
return modulePermissionService.getModuleList(filter);
|
||||
}
|
||||
@@ -96,6 +102,7 @@ public class PermissionController {
|
||||
* @since 2025-11-10
|
||||
*/
|
||||
@PostMapping
|
||||
@PreAuthorize("@ss.hasPermi('system:permission:manage')")
|
||||
public ResultDomain<TbSysPermissionDTO> createPermission(@RequestBody TbSysPermissionDTO permissionDTO) {
|
||||
return modulePermissionService.insertPermission(permissionDTO);
|
||||
}
|
||||
@@ -108,6 +115,7 @@ public class PermissionController {
|
||||
* @since 2025-11-10
|
||||
*/
|
||||
@PutMapping
|
||||
@PreAuthorize("@ss.hasPermi('system:permission:manage')")
|
||||
public ResultDomain<TbSysPermissionDTO> updatePermission(@RequestBody TbSysPermissionDTO permissionDTO) {
|
||||
return modulePermissionService.updatePermission(permissionDTO);
|
||||
}
|
||||
@@ -120,6 +128,7 @@ public class PermissionController {
|
||||
* @since 2025-11-10
|
||||
*/
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@ss.hasPermi('system:permission:manage')")
|
||||
public ResultDomain<Boolean> deletePermission(@RequestBody TbSysPermissionDTO permissionDTO) {
|
||||
return modulePermissionService.deletePermission(permissionDTO);
|
||||
}
|
||||
@@ -132,6 +141,7 @@ public class PermissionController {
|
||||
* @since 2025-11-10
|
||||
*/
|
||||
@PostMapping("/page")
|
||||
@PreAuthorize("@ss.hasPermi('system:permission:view')")
|
||||
public ResultDomain<PermissionVO> getModulePermissionPage(@RequestBody PageRequest<PermissionVO> pageRequest) {
|
||||
return modulePermissionService.getModulePermissionPage(pageRequest);
|
||||
}
|
||||
@@ -144,6 +154,7 @@ public class PermissionController {
|
||||
* @since 2025-11-10
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
@PreAuthorize("@ss.hasPermi('system:permission:view')")
|
||||
public ResultDomain<PermissionVO> getModulePermissionList(@RequestBody PermissionVO filter) {
|
||||
return modulePermissionService.getModulePermissionList(filter);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package org.xyzh.system.controller;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
@@ -28,26 +29,31 @@ public class SysConfigController {
|
||||
// ================= 系统配置相关接口 =================
|
||||
|
||||
@PostMapping
|
||||
@PreAuthorize("@ss.hasPermi('config:config:edit')")
|
||||
public ResultDomain<TbSysConfigDTO> createConfig(@RequestBody TbSysConfigDTO configDTO) {
|
||||
return sysConfigService.insertConfig(configDTO);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@PreAuthorize("@ss.hasPermi('config:config:edit')")
|
||||
public ResultDomain<TbSysConfigDTO> updateConfig(@RequestBody TbSysConfigDTO configDTO) {
|
||||
return sysConfigService.updateConfig(configDTO);
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@ss.hasPermi('config:config:edit')")
|
||||
public ResultDomain<Boolean> deleteConfig(@RequestBody TbSysConfigDTO configDTO) {
|
||||
return sysConfigService.deleteConfig(configDTO);
|
||||
}
|
||||
|
||||
@PostMapping("/page")
|
||||
@PreAuthorize("@ss.hasPermi('config:config:view')")
|
||||
public ResultDomain<SysConfigVO> getConfigPage(@RequestBody PageRequest<SysConfigVO> pageRequest) {
|
||||
return sysConfigService.getConfigPage(pageRequest);
|
||||
}
|
||||
|
||||
@PostMapping("/list")
|
||||
@PreAuthorize("@ss.hasPermi('config:config:view')")
|
||||
public ResultDomain<SysConfigVO> getConfigList(@RequestBody SysConfigVO filter) {
|
||||
return sysConfigService.getConfigList(filter);
|
||||
}
|
||||
|
||||
@@ -31,31 +31,31 @@ public class UserController {
|
||||
// ================= 用户相关接口 =================
|
||||
|
||||
@PostMapping
|
||||
@PreAuthorize("hasAuthority('system:user:create')")
|
||||
@PreAuthorize("@ss.hasPermi('system:user:create')")
|
||||
public ResultDomain<TbSysUserDTO> createUser(@RequestBody SysUserVO userVO) {
|
||||
return sysUserService.insertUser(userVO);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@PreAuthorize("hasAuthority('system:user:update')")
|
||||
@PreAuthorize("@ss.hasPermi('system:user:edit')")
|
||||
public ResultDomain<TbSysUserDTO> updateUser(@RequestBody SysUserVO userVO) {
|
||||
return sysUserService.updateUser(userVO);
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@PreAuthorize("hasAuthority('system:user:delete')")
|
||||
@PreAuthorize("@ss.hasPermi('system:user:delete')")
|
||||
public ResultDomain<Boolean> deleteUser(@RequestBody TbSysUserDTO userDTO) {
|
||||
return sysUserService.deleteUser(userDTO);
|
||||
}
|
||||
|
||||
@PostMapping("/page")
|
||||
@PreAuthorize("hasAuthority('system:user:query')")
|
||||
@PreAuthorize("@ss.hasPermi('system:user:view')")
|
||||
public ResultDomain<SysUserVO> getUserPage(@RequestBody PageRequest<SysUserVO> pageRequest) {
|
||||
return sysUserService.getUserPage(pageRequest);
|
||||
}
|
||||
|
||||
@PostMapping("/list")
|
||||
@PreAuthorize("hasAuthority('system:user:query')")
|
||||
@PreAuthorize("@ss.hasPermi('system:user:view')")
|
||||
public ResultDomain<SysUserVO> getUserList(@RequestBody SysUserVO filter) {
|
||||
return sysUserService.getUserList(filter);
|
||||
}
|
||||
@@ -63,13 +63,13 @@ public class UserController {
|
||||
// ================= 用户信息相关接口 ==================
|
||||
|
||||
@PutMapping("/info")
|
||||
@PreAuthorize("hasAuthority('system:userinfo:update')")
|
||||
@PreAuthorize("@ss.hasPermi('system:user:edit')")
|
||||
public ResultDomain<TbSysUserInfoDTO> updateUserInfo(@RequestBody TbSysUserInfoDTO userInfoDTO) {
|
||||
return sysUserService.updateUserInfo(userInfoDTO);
|
||||
}
|
||||
|
||||
@GetMapping("/info/{userId}")
|
||||
@PreAuthorize("hasAuthority('system:userinfo:read')")
|
||||
@PreAuthorize("@ss.hasPermi('system:user:view')")
|
||||
public ResultDomain<SysUserVO> getUserInfo(@PathVariable("userId") String userId) {
|
||||
return sysUserService.getUserInfo(userId);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package org.xyzh.system.controller;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
@@ -26,37 +27,44 @@ public class ViewController {
|
||||
|
||||
// ================= 视图相关接口 =================
|
||||
@PostMapping
|
||||
@PreAuthorize("@ss.hasPermi('system:permission:manage')")
|
||||
public ResultDomain<TbSysViewDTO> createView(@RequestBody TbSysViewDTO viewDTO) {
|
||||
return viewService.insertView(viewDTO);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@PreAuthorize("@ss.hasPermi('system:permission:manage')")
|
||||
public ResultDomain<TbSysViewDTO> updateView(@RequestBody TbSysViewDTO viewDTO) {
|
||||
return viewService.updateView(viewDTO);
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@ss.hasPermi('system:permission:manage')")
|
||||
public ResultDomain<Boolean> deleteView(@RequestBody TbSysViewDTO viewDTO) {
|
||||
return viewService.deleteView(viewDTO);
|
||||
}
|
||||
|
||||
@PostMapping("/page")
|
||||
@PreAuthorize("@ss.hasPermi('system:permission:view')")
|
||||
public ResultDomain<PermissionVO> getViewPage(@RequestBody PageRequest<PermissionVO> pageRequest) {
|
||||
return viewService.getViewPage(pageRequest);
|
||||
}
|
||||
|
||||
@PostMapping("/list")
|
||||
@PreAuthorize("@ss.hasPermi('system:permission:view')")
|
||||
public ResultDomain<PermissionVO> getViewList(@RequestBody PermissionVO filter) {
|
||||
return viewService.getViewList(filter);
|
||||
}
|
||||
|
||||
// ================= 视图权限相关接口 ==================
|
||||
@PostMapping("/permission/bind")
|
||||
@PreAuthorize("@ss.hasPermi('system:permission:manage')")
|
||||
public ResultDomain<PermissionVO> bindViewPermission(@RequestBody PermissionVO permissionVO) {
|
||||
return viewService.setViewPermissions(permissionVO);
|
||||
}
|
||||
|
||||
@PostMapping("/permission/list")
|
||||
@PreAuthorize("@ss.hasPermi('system:permission:view')")
|
||||
public ResultDomain<PermissionVO> getViewPermissions(@RequestBody PermissionVO permissionVO) {
|
||||
return viewService.getViewPermissionList(permissionVO);
|
||||
}
|
||||
|
||||
@@ -1,88 +0,0 @@
|
||||
package org.xyzh.system.mapper.dept;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.xyzh.api.system.vo.PermissionVO;
|
||||
import org.xyzh.common.core.page.PageParam;
|
||||
import org.xyzh.common.dto.sys.TbSysDeptRoleDTO;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @description 系统部门角色关系Mapper接口
|
||||
* @filename TbSysDeptRoleMapper.java
|
||||
* @author yslg
|
||||
* @copyright yslg
|
||||
* @since 2025-11-07
|
||||
*/
|
||||
@Mapper
|
||||
public interface TbSysDeptRoleMapper extends BaseMapper<TbSysDeptRoleDTO> {
|
||||
|
||||
/**
|
||||
* @description 插入系统部门角色关系
|
||||
* @param deptRoleDTO 系统部门角色关系DTO
|
||||
* @return int 插入结果
|
||||
* @author yslg
|
||||
* @since 2025-11-07
|
||||
*/
|
||||
int insertDeptRole(TbSysDeptRoleDTO deptRoleDTO);
|
||||
|
||||
/**
|
||||
* @description 更新系统部门角色关系
|
||||
* @param deptRoleDTO 系统部门角色关系DTO
|
||||
* @return int 更新结果
|
||||
* @author yslg
|
||||
* @since 2025-11-07
|
||||
*/
|
||||
int updateDeptRole(TbSysDeptRoleDTO deptRoleDTO);
|
||||
|
||||
/**
|
||||
* @description 删除系统部门角色关系
|
||||
* @param deptRoleDTO 系统部门角色关系DTO
|
||||
* @return int 删除结果
|
||||
* @author yslg
|
||||
* @since 2025-11-07
|
||||
*/
|
||||
int deleteDeptRole(TbSysDeptRoleDTO deptRoleDTO);
|
||||
|
||||
/**
|
||||
* @description 根据部门ID查询系统部门角色关系
|
||||
* @param deptId 部门ID
|
||||
* @param roleId 角色ID
|
||||
* @return UserDeptRoleVO 用户部门角色VO
|
||||
* @author yslg
|
||||
* @since 2025-11-07
|
||||
*/
|
||||
PermissionVO getDeptRoleByDeptId(String deptId, String roleId);
|
||||
|
||||
/**
|
||||
* @description 根据条件查询系统部门角色关系列表
|
||||
* @param filter 系统部门角色关系DTO
|
||||
* @return List<UserDeptRoleVO> 用户部门角色VO列表
|
||||
* @author yslg
|
||||
* @since 2025-11-07
|
||||
*/
|
||||
List<PermissionVO> getDeptRoleByFilter(@Param("filter") TbSysDeptRoleDTO filter);
|
||||
|
||||
/**
|
||||
* @description 根据条件查询系统部门角色关系分页列表
|
||||
* @param filter 系统部门角色关系DTO
|
||||
* @param pageParam 分页参数
|
||||
* @return List<UserDeptRoleVO> 用户部门角色VO列表
|
||||
* @author yslg
|
||||
* @since 2025-11-07
|
||||
*/
|
||||
List<PermissionVO> getDeptRolePageByFilter(@Param("filter") TbSysDeptRoleDTO filter, @Param("pageParam") PageParam pageParam);
|
||||
|
||||
/**
|
||||
* @description 根据条件查询系统部门角色关系数量
|
||||
* @param filter 系统部门角色关系DTO
|
||||
* @return int 系统部门角色关系数量
|
||||
* @author yslg
|
||||
* @since 2025-11-07
|
||||
*/
|
||||
int getDeptRoleCount(TbSysDeptRoleDTO filter);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.xyzh.system.mapper.permission;
|
||||
package org.xyzh.system.mapper.view;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -0,0 +1,281 @@
|
||||
package org.xyzh.system.service.impl;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import org.apache.dubbo.config.annotation.DubboService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.xyzh.api.system.service.AclService;
|
||||
import org.xyzh.api.system.vo.AclVO;
|
||||
import org.xyzh.common.core.domain.ResultDomain;
|
||||
import org.xyzh.common.core.page.PageDomain;
|
||||
import org.xyzh.common.core.page.PageParam;
|
||||
import org.xyzh.common.core.page.PageRequest;
|
||||
import org.xyzh.common.dto.sys.TbSysAclDTO;
|
||||
import org.xyzh.common.dto.sys.TbSysAclPolicyDTO;
|
||||
import org.xyzh.common.utils.IDUtils;
|
||||
import org.xyzh.common.utils.StringUtils;
|
||||
import org.xyzh.system.mapper.acl.TbSysAclMapper;
|
||||
import org.xyzh.system.mapper.acl.TbSysAclPolicyMapper;
|
||||
|
||||
/**
|
||||
* @description 访问控制列表服务实现类
|
||||
* @filename AclServiceImpl.java
|
||||
* @author yslg
|
||||
* @copyright yslg
|
||||
* @since 2025-12-05
|
||||
*/
|
||||
@DubboService(
|
||||
version = "1.0.0",
|
||||
group = "system",
|
||||
timeout = 3000,
|
||||
retries = 0
|
||||
)
|
||||
public class AclServiceImpl implements AclService {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(AclServiceImpl.class);
|
||||
private static final String MSG_ACL_PARAM_REQUIRED = "访问控制列表参数不能为空";
|
||||
private static final String MSG_ACL_ID_REQUIRED = "访问控制列表ID不能为空";
|
||||
private static final String MSG_POLICY_PARAM_REQUIRED = "访问控制策略参数不能为空";
|
||||
private static final String MSG_POLICY_ID_REQUIRED = "访问控制策略ID不能为空";
|
||||
private static final String MSG_PAGE_PARAM_REQUIRED = "分页参数不能为空";
|
||||
|
||||
@Resource
|
||||
private TbSysAclMapper aclMapper;
|
||||
|
||||
@Resource
|
||||
private TbSysAclPolicyMapper aclPolicyMapper;
|
||||
|
||||
// ================= ACL 管理 =================
|
||||
@Override
|
||||
public ResultDomain<TbSysAclDTO> insertAcl(TbSysAclDTO aclDTO) {
|
||||
if (aclDTO == null) {
|
||||
return ResultDomain.failure(MSG_ACL_PARAM_REQUIRED);
|
||||
}
|
||||
if (StringUtils.isBlank(aclDTO.getAclId())) {
|
||||
aclDTO.setAclId(IDUtils.generateID());
|
||||
}
|
||||
if (aclDTO.getCreateTime() == null) {
|
||||
aclDTO.setCreateTime(new Date());
|
||||
}
|
||||
if (aclDTO.getDeleted() == null) {
|
||||
aclDTO.setDeleted(false);
|
||||
}
|
||||
if (aclDTO.getAllow() == null) {
|
||||
aclDTO.setAllow(true);
|
||||
}
|
||||
if (aclDTO.getIncludeDescendants() == null) {
|
||||
aclDTO.setIncludeDescendants(false);
|
||||
}
|
||||
|
||||
int rows = aclMapper.insertAcl(aclDTO);
|
||||
if (rows > 0) {
|
||||
logger.info("新增访问控制列表成功, aclId={}", aclDTO.getAclId());
|
||||
return ResultDomain.success("新增访问控制列表成功", aclDTO);
|
||||
}
|
||||
logger.warn("新增访问控制列表失败, aclId={}", aclDTO.getAclId());
|
||||
return ResultDomain.failure("新增访问控制列表失败");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbSysAclDTO> updateAcl(TbSysAclDTO aclDTO) {
|
||||
if (aclDTO == null || StringUtils.isBlank(aclDTO.getAclId())) {
|
||||
return ResultDomain.failure(MSG_ACL_ID_REQUIRED);
|
||||
}
|
||||
aclDTO.setUpdateTime(new Date());
|
||||
|
||||
int rows = aclMapper.updateAcl(aclDTO);
|
||||
if (rows > 0) {
|
||||
logger.info("更新访问控制列表成功, aclId={}", aclDTO.getAclId());
|
||||
return ResultDomain.success("更新访问控制列表成功", aclDTO);
|
||||
}
|
||||
logger.warn("更新访问控制列表失败, aclId={}", aclDTO.getAclId());
|
||||
return ResultDomain.failure("更新访问控制列表失败");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<Boolean> deleteAcl(TbSysAclDTO aclDTO) {
|
||||
if (aclDTO == null || StringUtils.isBlank(aclDTO.getAclId())) {
|
||||
return ResultDomain.failure(MSG_ACL_ID_REQUIRED);
|
||||
}
|
||||
aclDTO.setDeleteTime(new Date());
|
||||
|
||||
int rows = aclMapper.deleteAcl(aclDTO);
|
||||
if (rows > 0) {
|
||||
logger.info("删除访问控制列表成功, aclId={}", aclDTO.getAclId());
|
||||
return ResultDomain.success("删除访问控制列表成功", true);
|
||||
}
|
||||
logger.warn("删除访问控制列表失败, aclId={}", aclDTO.getAclId());
|
||||
return ResultDomain.failure("删除访问控制列表失败");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<AclVO> getAclPage(PageRequest<AclVO> pageRequest) {
|
||||
if (pageRequest == null) {
|
||||
return ResultDomain.failure(MSG_PAGE_PARAM_REQUIRED);
|
||||
}
|
||||
|
||||
AclVO filter = pageRequest.getFilter();
|
||||
if (filter == null) {
|
||||
filter = new AclVO();
|
||||
}
|
||||
|
||||
// 转换为 DTO
|
||||
TbSysAclDTO aclDTO = new TbSysAclDTO();
|
||||
aclDTO.setAclId(filter.getAclId());
|
||||
aclDTO.setObjectType(filter.getObjectType());
|
||||
aclDTO.setObjectId(filter.getObjectId());
|
||||
aclDTO.setPrincipalType(filter.getPrincipalType());
|
||||
aclDTO.setPrincipalId(filter.getPrincipalId());
|
||||
aclDTO.setPrincipalDeptId(filter.getPrincipalDeptId());
|
||||
|
||||
// 获取总数
|
||||
int total = aclMapper.getAclCount(aclDTO);
|
||||
|
||||
// 分页查询
|
||||
PageParam pageParam = pageRequest.getPageParam();
|
||||
List<AclVO> list = aclMapper.getAclPageByFilter(aclDTO, pageParam);
|
||||
|
||||
pageParam.setTotal(total);
|
||||
PageDomain<AclVO> pageDomain = new PageDomain<>(pageParam, list);
|
||||
return ResultDomain.success("查询成功", pageDomain);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<AclVO> getAclList(AclVO filter) {
|
||||
if (filter == null) {
|
||||
filter = new AclVO();
|
||||
}
|
||||
|
||||
// 转换为 DTO
|
||||
TbSysAclDTO aclDTO = new TbSysAclDTO();
|
||||
aclDTO.setAclId(filter.getAclId());
|
||||
aclDTO.setObjectType(filter.getObjectType());
|
||||
aclDTO.setObjectId(filter.getObjectId());
|
||||
aclDTO.setPrincipalType(filter.getPrincipalType());
|
||||
aclDTO.setPrincipalId(filter.getPrincipalId());
|
||||
aclDTO.setPrincipalDeptId(filter.getPrincipalDeptId());
|
||||
|
||||
List<AclVO> list = aclMapper.getAclByFilter(aclDTO);
|
||||
return ResultDomain.success("查询成功", list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<AclVO> getAclByObjectId(String objectId) {
|
||||
if (StringUtils.isBlank(objectId)) {
|
||||
return ResultDomain.failure("对象ID不能为空");
|
||||
}
|
||||
|
||||
List<AclVO> list = aclMapper.getAclByObjectId(objectId);
|
||||
return ResultDomain.success("查询成功", list);
|
||||
}
|
||||
|
||||
// ================= ACL Policy 管理 =================
|
||||
@Override
|
||||
public ResultDomain<TbSysAclPolicyDTO> insertAclPolicy(TbSysAclPolicyDTO aclPolicyDTO) {
|
||||
if (aclPolicyDTO == null) {
|
||||
return ResultDomain.failure(MSG_POLICY_PARAM_REQUIRED);
|
||||
}
|
||||
if (StringUtils.isBlank(aclPolicyDTO.getPolicyId())) {
|
||||
aclPolicyDTO.setPolicyId(IDUtils.generateID());
|
||||
}
|
||||
if (aclPolicyDTO.getCreateTime() == null) {
|
||||
aclPolicyDTO.setCreateTime(new Date());
|
||||
}
|
||||
if (aclPolicyDTO.getDeleted() == null) {
|
||||
aclPolicyDTO.setDeleted(false);
|
||||
}
|
||||
if (aclPolicyDTO.getDefaultAllow() == null) {
|
||||
aclPolicyDTO.setDefaultAllow(true);
|
||||
}
|
||||
if (aclPolicyDTO.getApplyToChildren() == null) {
|
||||
aclPolicyDTO.setApplyToChildren(true);
|
||||
}
|
||||
|
||||
int rows = aclPolicyMapper.insertAclPolicy(aclPolicyDTO);
|
||||
if (rows > 0) {
|
||||
logger.info("新增访问控制策略成功, policyId={}", aclPolicyDTO.getPolicyId());
|
||||
return ResultDomain.success("新增访问控制策略成功", aclPolicyDTO);
|
||||
}
|
||||
logger.warn("新增访问控制策略失败, policyId={}", aclPolicyDTO.getPolicyId());
|
||||
return ResultDomain.failure("新增访问控制策略失败");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbSysAclPolicyDTO> updateAclPolicy(TbSysAclPolicyDTO aclPolicyDTO) {
|
||||
if (aclPolicyDTO == null || StringUtils.isBlank(aclPolicyDTO.getPolicyId())) {
|
||||
return ResultDomain.failure(MSG_POLICY_ID_REQUIRED);
|
||||
}
|
||||
aclPolicyDTO.setUpdateTime(new Date());
|
||||
|
||||
int rows = aclPolicyMapper.updateAclPolicy(aclPolicyDTO);
|
||||
if (rows > 0) {
|
||||
logger.info("更新访问控制策略成功, policyId={}", aclPolicyDTO.getPolicyId());
|
||||
return ResultDomain.success("更新访问控制策略成功", aclPolicyDTO);
|
||||
}
|
||||
logger.warn("更新访问控制策略失败, policyId={}", aclPolicyDTO.getPolicyId());
|
||||
return ResultDomain.failure("更新访问控制策略失败");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<Boolean> deleteAclPolicy(TbSysAclPolicyDTO aclPolicyDTO) {
|
||||
if (aclPolicyDTO == null || StringUtils.isBlank(aclPolicyDTO.getPolicyId())) {
|
||||
return ResultDomain.failure(MSG_POLICY_ID_REQUIRED);
|
||||
}
|
||||
aclPolicyDTO.setDeleteTime(new Date());
|
||||
|
||||
int rows = aclPolicyMapper.deleteAclPolicy(aclPolicyDTO);
|
||||
if (rows > 0) {
|
||||
logger.info("删除访问控制策略成功, policyId={}", aclPolicyDTO.getPolicyId());
|
||||
return ResultDomain.success("删除访问控制策略成功", true);
|
||||
}
|
||||
logger.warn("删除访问控制策略失败, policyId={}", aclPolicyDTO.getPolicyId());
|
||||
return ResultDomain.failure("删除访问控制策略失败");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<AclVO> getAclPolicyPage(PageRequest<AclVO> pageRequest) {
|
||||
if (pageRequest == null) {
|
||||
return ResultDomain.failure(MSG_PAGE_PARAM_REQUIRED);
|
||||
}
|
||||
|
||||
AclVO filter = pageRequest.getFilter();
|
||||
if (filter == null) {
|
||||
filter = new AclVO();
|
||||
}
|
||||
|
||||
// 转换为 DTO
|
||||
TbSysAclPolicyDTO aclPolicyDTO = new TbSysAclPolicyDTO();
|
||||
aclPolicyDTO.setPolicyId(filter.getPolicyId());
|
||||
aclPolicyDTO.setName(filter.getPolicyName());
|
||||
aclPolicyDTO.setObjectType(filter.getPolicyObjectType());
|
||||
|
||||
// 获取总数
|
||||
int total = aclPolicyMapper.getAclPolicyCount(aclPolicyDTO);
|
||||
|
||||
// 分页查询
|
||||
PageParam pageParam = pageRequest.getPageParam();
|
||||
List<AclVO> list = aclPolicyMapper.getAclPolicyPageByFilter(aclPolicyDTO, pageParam);
|
||||
|
||||
pageParam.setTotal(total);
|
||||
PageDomain<AclVO> pageDomain = new PageDomain<>(pageParam, list);
|
||||
return ResultDomain.success("查询成功", pageDomain);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<AclVO> getAclPolicyList(AclVO filter) {
|
||||
if (filter == null) {
|
||||
filter = new AclVO();
|
||||
}
|
||||
|
||||
// 转换为 DTO
|
||||
TbSysAclPolicyDTO aclPolicyDTO = new TbSysAclPolicyDTO();
|
||||
aclPolicyDTO.setPolicyId(filter.getPolicyId());
|
||||
aclPolicyDTO.setName(filter.getPolicyName());
|
||||
aclPolicyDTO.setObjectType(filter.getPolicyObjectType());
|
||||
|
||||
List<AclVO> list = aclPolicyMapper.getAclPolicyByFilter(aclPolicyDTO);
|
||||
return ResultDomain.success("查询成功", list);
|
||||
}
|
||||
}
|
||||
@@ -24,7 +24,6 @@ import org.xyzh.common.dto.sys.TbSysUserRoleDTO;
|
||||
import org.xyzh.common.utils.IDUtils;
|
||||
import org.xyzh.common.utils.StringUtils;
|
||||
import org.xyzh.system.mapper.dept.TbSysDeptMapper;
|
||||
import org.xyzh.system.mapper.dept.TbSysDeptRoleMapper;
|
||||
import org.xyzh.system.mapper.role.TbSysRoleMapper;
|
||||
import org.xyzh.system.mapper.role.TbSysRolePermissionMapper;
|
||||
import org.xyzh.system.mapper.user.TbSysUserRoleMapper;
|
||||
@@ -56,9 +55,6 @@ public class DeptRoleServiceImpl implements DeptRoleService {
|
||||
@Resource
|
||||
private TbSysRoleMapper roleMapper;
|
||||
|
||||
@Resource
|
||||
private TbSysDeptRoleMapper deptRoleMapper;
|
||||
|
||||
@Resource
|
||||
private TbSysUserRoleMapper userRoleMapper;
|
||||
|
||||
@@ -286,96 +282,6 @@ public class DeptRoleServiceImpl implements DeptRoleService {
|
||||
return ResultDomain.success("根据用户获取角色成功", roleList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbSysDeptRoleDTO> insertDeptRole(TbSysDeptRoleDTO deptRoleDTO) {
|
||||
if (deptRoleDTO == null || StringUtils.isBlank(deptRoleDTO.getDeptId()) || StringUtils.isBlank(deptRoleDTO.getRoleId())) {
|
||||
return ResultDomain.failure(MSG_DEPT_ROLE_ID_REQUIRED);
|
||||
}
|
||||
if (deptRoleDTO.getCreateTime() == null) {
|
||||
deptRoleDTO.setCreateTime(new Date());
|
||||
}
|
||||
if (deptRoleDTO.getDeleted() == null) {
|
||||
deptRoleDTO.setDeleted(false);
|
||||
}
|
||||
int rows = deptRoleMapper.insertDeptRole(deptRoleDTO);
|
||||
if (rows > 0) {
|
||||
logger.info("新增部门角色关联成功, deptId={}, roleId={}", deptRoleDTO.getDeptId(), deptRoleDTO.getRoleId());
|
||||
return ResultDomain.success("新增部门角色关联成功", deptRoleDTO);
|
||||
}
|
||||
logger.warn("新增部门角色关联失败, deptId={}, roleId={}", deptRoleDTO.getDeptId(), deptRoleDTO.getRoleId());
|
||||
return ResultDomain.failure("新增部门角色关联失败");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbSysDeptRoleDTO> updateDeptRole(TbSysDeptRoleDTO deptRoleDTO) {
|
||||
if (deptRoleDTO == null || StringUtils.isBlank(deptRoleDTO.getDeptId()) || StringUtils.isBlank(deptRoleDTO.getRoleId())) {
|
||||
return ResultDomain.failure(MSG_DEPT_ROLE_ID_REQUIRED);
|
||||
}
|
||||
deptRoleDTO.setUpdateTime(new Date());
|
||||
int rows = deptRoleMapper.updateDeptRole(deptRoleDTO);
|
||||
if (rows > 0) {
|
||||
logger.info("更新部门角色关联成功, deptId={}, roleId={}", deptRoleDTO.getDeptId(), deptRoleDTO.getRoleId());
|
||||
return ResultDomain.success("更新部门角色关联成功", deptRoleDTO);
|
||||
}
|
||||
logger.warn("更新部门角色关联失败, deptId={}, roleId={}", deptRoleDTO.getDeptId(), deptRoleDTO.getRoleId());
|
||||
return ResultDomain.failure("更新部门角色关联失败");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<Boolean> deleteDeptRole(TbSysDeptRoleDTO deptRoleDTO) {
|
||||
if (deptRoleDTO == null || StringUtils.isBlank(deptRoleDTO.getDeptId()) || StringUtils.isBlank(deptRoleDTO.getRoleId())) {
|
||||
return ResultDomain.failure(MSG_DEPT_ROLE_ID_REQUIRED);
|
||||
}
|
||||
int rows = deptRoleMapper.deleteDeptRole(deptRoleDTO);
|
||||
if (rows > 0) {
|
||||
logger.info("删除部门角色关联成功, deptId={}, roleId={}", deptRoleDTO.getDeptId(), deptRoleDTO.getRoleId());
|
||||
return ResultDomain.success("删除部门角色关联成功", Boolean.TRUE);
|
||||
}
|
||||
logger.warn("删除部门角色关联失败, deptId={}, roleId={}", deptRoleDTO.getDeptId(), deptRoleDTO.getRoleId());
|
||||
return ResultDomain.failure("删除部门角色关联失败");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<UserDeptRoleVO> getDeptRole(UserDeptRoleVO filter) {
|
||||
TbSysDeptRoleDTO dto = UserDeptRoleVO.toDeptRoleDTO(filter);
|
||||
if (dto == null) {
|
||||
return ResultDomain.failure(MSG_QUERY_PARAM_REQUIRED);
|
||||
}
|
||||
List<PermissionVO> permissionList = deptRoleMapper.getDeptRoleByFilter(dto);
|
||||
if (permissionList == null || permissionList.isEmpty()) {
|
||||
return ResultDomain.failure("未找到部门角色关联");
|
||||
}
|
||||
UserDeptRoleVO result = UserDeptRoleVO.fromPermission(permissionList.get(0));
|
||||
return ResultDomain.success("获取部门角色关联成功", result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<UserDeptRoleVO> getDeptRoleList(UserDeptRoleVO filter) {
|
||||
TbSysDeptRoleDTO dto = UserDeptRoleVO.toDeptRoleDTO(filter);
|
||||
List<PermissionVO> permissionList = deptRoleMapper.getDeptRoleByFilter(dto);
|
||||
List<UserDeptRoleVO> result = (permissionList == null || permissionList.isEmpty()) ?
|
||||
java.util.Collections.emptyList() :
|
||||
permissionList.stream().map(UserDeptRoleVO::fromPermission).filter(java.util.Objects::nonNull).toList();
|
||||
return ResultDomain.success("获取部门角色关联列表成功", result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<UserDeptRoleVO> getDeptRolePage(PageRequest<UserDeptRoleVO> pageRequest) {
|
||||
if (pageRequest == null) {
|
||||
return ResultDomain.failure(MSG_PAGE_PARAM_REQUIRED);
|
||||
}
|
||||
PageParam pageParam = pageRequest.getPageParam();
|
||||
TbSysDeptRoleDTO filter = UserDeptRoleVO.toDeptRoleDTO(pageRequest.getFilter());
|
||||
int total = deptRoleMapper.getDeptRoleCount(filter);
|
||||
pageParam.setTotal(total);
|
||||
pageParam.setTotalPages(pageParam.getPageSize() == 0 ? 0 : (int) Math.ceil((double) total / pageParam.getPageSize()));
|
||||
List<PermissionVO> permissionList = deptRoleMapper.getDeptRolePageByFilter(filter, pageParam);
|
||||
List<UserDeptRoleVO> data = (permissionList == null || permissionList.isEmpty()) ?
|
||||
java.util.Collections.emptyList() :
|
||||
permissionList.stream().map(UserDeptRoleVO::fromPermission).filter(java.util.Objects::nonNull).toList();
|
||||
PageDomain<UserDeptRoleVO> pageDomain = new PageDomain<>(pageParam, data);
|
||||
return ResultDomain.success("分页查询部门角色关联成功", pageDomain);
|
||||
}
|
||||
@Override
|
||||
public ResultDomain<PermissionVO> setRolePermission(PermissionVO permissionVO) {
|
||||
if (permissionVO == null || StringUtils.isBlank(permissionVO.getRoleId())) {
|
||||
|
||||
@@ -18,8 +18,8 @@ import org.xyzh.common.dto.sys.TbSysViewDTO;
|
||||
import org.xyzh.common.dto.sys.TbSysViewPermissionDTO;
|
||||
import org.xyzh.common.utils.IDUtils;
|
||||
import org.xyzh.common.utils.StringUtils;
|
||||
import org.xyzh.system.mapper.permission.TbSysViewPermissionMapper;
|
||||
import org.xyzh.system.mapper.view.TbSysViewMapper;
|
||||
import org.xyzh.system.mapper.view.TbSysViewPermissionMapper;
|
||||
|
||||
/**
|
||||
* @description 视图服务实现类
|
||||
|
||||
@@ -1,203 +0,0 @@
|
||||
<?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.xyzh.system.mapper.dept.TbSysDeptRoleMapper">
|
||||
|
||||
<!-- 结果映射 -->
|
||||
<resultMap id="BaseResultMap" type="org.xyzh.common.dto.sys.TbSysDeptRoleDTO">
|
||||
<!-- 部门角色关系字段 -->
|
||||
<id column="dept_id" property="deptId" jdbcType="VARCHAR"/>
|
||||
<id column="role_id" property="roleId" jdbcType="VARCHAR"/>
|
||||
<!-- 基础字段 -->
|
||||
<result column="optsn" property="optsn" jdbcType="VARCHAR"/>
|
||||
<result column="creator" property="creator" jdbcType="VARCHAR"/>
|
||||
<result column="updater" property="updater" jdbcType="VARCHAR"/>
|
||||
<result column="dept_path" property="deptPath" jdbcType="VARCHAR"/>
|
||||
<result column="remark" property="remark" jdbcType="VARCHAR"/>
|
||||
<result column="create_time" property="createTime" jdbcType="DATE"/>
|
||||
<result column="update_time" property="updateTime" jdbcType="DATE"/>
|
||||
<result column="delete_time" property="deleteTime" jdbcType="DATE"/>
|
||||
<result column="deleted" property="deleted" jdbcType="Boolean"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- VO结果映射(用于前端展示) -->
|
||||
<resultMap id="PermissionVOResultMap" type="org.xyzh.api.system.vo.PermissionVO">
|
||||
<!-- 部门字段 -->
|
||||
<result column="dept_id" property="deptId" jdbcType="VARCHAR"/>
|
||||
<result column="dept_name" property="deptName" jdbcType="VARCHAR"/>
|
||||
<result column="parent_id" property="deptParentId" jdbcType="VARCHAR"/>
|
||||
<result column="dept_description" property="deptDescription" jdbcType="VARCHAR"/>
|
||||
<!-- 角色字段 -->
|
||||
<result column="role_id" property="roleId" jdbcType="VARCHAR"/>
|
||||
<result column="role_name" property="roleName" jdbcType="VARCHAR"/>
|
||||
<result column="role_description" property="roleDescription" jdbcType="VARCHAR"/>
|
||||
<result column="scope" property="roleScope" jdbcType="VARCHAR"/>
|
||||
<result column="owner_dept_id" property="roleOwnerDeptId" jdbcType="VARCHAR"/>
|
||||
<result column="role_status" property="roleStatus" jdbcType="Boolean"/>
|
||||
<!-- BaseVO 基础字段 -->
|
||||
<result column="optsn" property="optsn" jdbcType="VARCHAR"/>
|
||||
<result column="creator" property="creator" jdbcType="VARCHAR"/>
|
||||
<result column="updater" property="updater" jdbcType="VARCHAR"/>
|
||||
<result column="dept_path" property="deptPath" jdbcType="VARCHAR"/>
|
||||
<result column="remark" property="remark" jdbcType="VARCHAR"/>
|
||||
<result column="create_time" property="createTime" jdbcType="DATE"/>
|
||||
<result column="update_time" property="updateTime" jdbcType="DATE"/>
|
||||
<result column="delete_time" property="deleteTime" jdbcType="DATE"/>
|
||||
<result column="deleted" property="deleted" jdbcType="Boolean"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 基础列 -->
|
||||
<sql id="Base_Column_List">
|
||||
dept_id, role_id,
|
||||
optsn, creator, updater, dept_path, remark, create_time, update_time, delete_time, deleted
|
||||
</sql>
|
||||
|
||||
<!-- 插入系统部门角色关系(必填 + 可选字段动态列,仅修改 insert) -->
|
||||
<insert id="insertDeptRole" parameterType="org.xyzh.common.dto.sys.TbSysDeptRoleDTO">
|
||||
INSERT INTO sys.tb_sys_dept_role
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<!-- 必填字段:dept_id, role_id, optsn -->
|
||||
dept_id,
|
||||
role_id,
|
||||
optsn,
|
||||
<!-- 可选字段:根据是否有值动态拼接 -->
|
||||
<if test="creator != null and creator != ''">creator,</if>
|
||||
<if test="deptPath != null and deptPath != ''">dept_path,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="deleteTime != null">delete_time,</if>
|
||||
<if test="deleted != null">deleted,</if>
|
||||
</trim>
|
||||
VALUES
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<!-- 必填字段值 -->
|
||||
#{deptId},
|
||||
#{roleId},
|
||||
#{optsn},
|
||||
<!-- 可选字段值 -->
|
||||
<if test="creator != null and creator != ''">#{creator},</if>
|
||||
<if test="deptPath != null and deptPath != ''">#{deptPath},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="deleteTime != null">#{deleteTime},</if>
|
||||
<if test="deleted != null">#{deleted},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<!-- 更新系统部门角色关系 -->
|
||||
<update id="updateDeptRole" parameterType="org.xyzh.common.dto.sys.TbSysDeptRoleDTO">
|
||||
UPDATE sys.tb_sys_dept_role
|
||||
<set>
|
||||
<if test="updater != null and updater != ''">
|
||||
updater = #{updater},
|
||||
</if>
|
||||
<if test="deptPath != null and deptPath != ''">
|
||||
dept_path = #{deptPath},
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
remark = #{remark},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime},
|
||||
</if>
|
||||
</set>
|
||||
WHERE dept_id = #{deptId} AND role_id = #{roleId}
|
||||
<if test="deleted != null">
|
||||
AND deleted = #{deleted}
|
||||
</if>
|
||||
</update>
|
||||
|
||||
<!-- 删除系统部门角色关系 -->
|
||||
<update id="deleteDeptRole" parameterType="org.xyzh.common.dto.sys.TbSysDeptRoleDTO">
|
||||
UPDATE sys.tb_sys_dept_role
|
||||
SET deleted = true,
|
||||
delete_time = NOW()
|
||||
WHERE dept_id = #{deptId} AND role_id = #{roleId}
|
||||
</update>
|
||||
|
||||
<!-- 根据部门ID和角色ID查询系统部门角色关系 -->
|
||||
<select id="getDeptRoleByDeptId" resultMap="PermissionVOResultMap">
|
||||
SELECT
|
||||
dr.dept_id, dr.role_id,
|
||||
d.dept_id, d.name AS dept_name, d.parent_id, d.description AS dept_description,
|
||||
r.role_id, r.name AS role_name, r.description AS role_description, r.scope, r.owner_dept_id, r.status AS role_status,
|
||||
dr.optsn, dr.creator, dr.updater, dr.dept_path, dr.remark, dr.create_time, dr.update_time, dr.delete_time, dr.deleted
|
||||
FROM sys.tb_sys_dept_role dr
|
||||
LEFT JOIN sys.tb_sys_dept d ON dr.dept_id = d.dept_id AND (d.deleted IS NULL OR d.deleted = false)
|
||||
LEFT JOIN sys.tb_sys_role r ON dr.role_id = r.role_id AND (r.deleted IS NULL OR r.deleted = false)
|
||||
WHERE dr.dept_id = #{deptId} AND dr.role_id = #{roleId}
|
||||
AND (dr.deleted IS NULL OR dr.deleted = false)
|
||||
</select>
|
||||
|
||||
<!-- 根据条件查询系统部门角色关系列表 -->
|
||||
<select id="getDeptRoleByFilter" resultMap="PermissionVOResultMap" parameterType="org.xyzh.common.dto.sys.TbSysDeptRoleDTO">
|
||||
SELECT DISTINCT
|
||||
dr.dept_id, dr.role_id,
|
||||
d.dept_id, d.name AS dept_name, d.parent_id, d.description AS dept_description,
|
||||
r.role_id, r.name AS role_name, r.description AS role_description, r.scope, r.owner_dept_id, r.status AS role_status,
|
||||
dr.optsn, dr.creator, dr.updater, dr.dept_path, dr.remark, dr.create_time, dr.update_time, dr.delete_time, dr.deleted
|
||||
FROM sys.tb_sys_dept_role dr
|
||||
LEFT JOIN sys.tb_sys_dept d ON dr.dept_id = d.dept_id AND (d.deleted IS NULL OR d.deleted = false)
|
||||
LEFT JOIN sys.tb_sys_role r ON dr.role_id = r.role_id AND (r.deleted IS NULL OR r.deleted = false)
|
||||
<where>
|
||||
<if test="filter.deptId != null and filter.deptId != ''">
|
||||
AND dr.dept_id = #{filter.deptId}
|
||||
</if>
|
||||
<if test="filter.roleId != null and filter.roleId != ''">
|
||||
AND dr.role_id = #{filter.roleId}
|
||||
</if>
|
||||
<if test="filter.deptPath != null and filter.deptPath != ''">
|
||||
AND dr.dept_path LIKE CONCAT(#{filter.deptPath}, '%')
|
||||
</if>
|
||||
AND (dr.deleted IS NULL OR dr.deleted = false)
|
||||
</where>
|
||||
ORDER BY dr.create_time DESC
|
||||
</select>
|
||||
|
||||
<!-- 根据条件查询系统部门角色关系分页列表 -->
|
||||
<select id="getDeptRolePageByFilter" resultMap="PermissionVOResultMap">
|
||||
SELECT DISTINCT
|
||||
dr.dept_id, dr.role_id,
|
||||
d.dept_id, d.name AS dept_name, d.parent_id, d.description AS dept_description,
|
||||
r.role_id, r.name AS role_name, r.description AS role_description, r.scope, r.owner_dept_id, r.status AS role_status,
|
||||
dr.optsn, dr.creator, dr.updater, dr.dept_path, dr.remark, dr.create_time, dr.update_time, dr.delete_time, dr.deleted
|
||||
FROM sys.tb_sys_dept_role dr
|
||||
LEFT JOIN sys.tb_sys_dept d ON dr.dept_id = d.dept_id AND (d.deleted IS NULL OR d.deleted = false)
|
||||
LEFT JOIN sys.tb_sys_role r ON dr.role_id = r.role_id AND (r.deleted IS NULL OR r.deleted = false)
|
||||
<where>
|
||||
<if test="filter.deptId != null and filter.deptId != ''">
|
||||
AND dr.dept_id = #{filter.deptId}
|
||||
</if>
|
||||
<if test="filter.roleId != null and filter.roleId != ''">
|
||||
AND dr.role_id = #{filter.roleId}
|
||||
</if>
|
||||
<if test="filter.deptPath != null and filter.deptPath != ''">
|
||||
AND dr.dept_path LIKE CONCAT(#{filter.deptPath}, '%')
|
||||
</if>
|
||||
AND (dr.deleted IS NULL OR dr.deleted = false)
|
||||
</where>
|
||||
ORDER BY dr.create_time DESC
|
||||
LIMIT #{pageParam.pageSize} OFFSET #{pageParam.offset}
|
||||
</select>
|
||||
|
||||
<!-- 根据条件查询系统部门角色关系数量 -->
|
||||
<select id="getDeptRoleCount" resultType="java.lang.Integer" parameterType="org.xyzh.common.dto.sys.TbSysDeptRoleDTO">
|
||||
SELECT COUNT(1)
|
||||
FROM sys.tb_sys_dept_role
|
||||
<where>
|
||||
<if test="filter.deptId != null and filter.deptId != ''">
|
||||
AND dept_id = #{filter.deptId}
|
||||
</if>
|
||||
<if test="filter.roleId != null and filter.roleId != ''">
|
||||
AND role_id = #{filter.roleId}
|
||||
</if>
|
||||
<if test="filter.deptPath != null and filter.deptPath != ''">
|
||||
AND dept_path LIKE CONCAT(#{filter.deptPath}, '%')
|
||||
</if>
|
||||
AND (deleted IS NULL OR deleted = false)
|
||||
</where>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?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.xyzh.system.mapper.permission.TbSysViewPermissionMapper">
|
||||
<mapper namespace="org.xyzh.system.mapper.view.TbSysViewPermissionMapper">
|
||||
|
||||
<!-- 结果映射 -->
|
||||
<resultMap id="BaseResultMap" type="org.xyzh.common.dto.sys.TbSysViewPermissionDTO">
|
||||
Reference in New Issue
Block a user