1.设置设备查看权限(每个公司只能查看自己购买的设备,未完善)

2.添加设备信息模块,可以选择设备查看详情(未添加实时数据部分)
3.添加教学视频模块,拉取b站系列中的视频
4.初步调整ui
This commit is contained in:
2026-03-31 17:46:40 +08:00
parent 0e2d75c23c
commit 2b8d5cc126
334 changed files with 2303 additions and 28691 deletions

View File

@@ -0,0 +1,8 @@
-- ----------------------------
-- 设备表增加部门(公司)归属,用于数据权限隔离
-- ----------------------------
alter table device_info
add column dept_id bigint(20) default null comment '部门/公司ID' after device_id;
create index idx_device_info_dept_id on device_info (dept_id);

View File

@@ -0,0 +1,19 @@
-- ----------------------------
-- 设备示例数据(带 dept_id用于按公司/部门数据权限隔离演示)
-- 依赖device_info 表已包含 dept_id 字段
-- 说明dept_id 选用若依默认初始化部门:
-- 101 = 深圳总公司102 = 长沙分公司103 = 研发部门(深圳下级)105 = 测试部门(深圳下级)
-- ----------------------------
-- 建议先清理(可按需执行)
-- delete from device_info;
insert into device_info
(device_id, dept_id, device_name, device_code, device_status, device_image, model_spec, purchase_date, serial_number, install_address, responsible_person, warranty_start_date, warranty_end_date, del_flag, create_by, create_time, update_by, update_time, remark)
values
(20001, 101, 'WR-2000 焊接机器人A', 'WR20230517001', '0', '', 'WR-2000', '2023-05-17', 'WR20230517001', '深圳市南山区XX工厂', '张工', '2023-05-20', '2025-05-19', '0', 'admin', sysdate(), '', null, '深圳公司设备A'),
(20002, 101, 'WR-2000 焊接机器人B', 'WR20230517002', '3', '', 'WR-2000', '2023-06-02', 'WR20230602001', '深圳市宝安区XX车间', '李工', '2023-06-05', '2025-06-04', '0', 'admin', sysdate(), '', null, '深圳公司设备B(维护)'),
(20003, 102, 'WR-1800 焊接机器人C', 'WR20230701001', '2', '', 'WR-1800', '2023-07-01', 'WR20230701001', '长沙市XX工厂', '王工', '2023-07-03', '2025-07-02', '0', 'admin', sysdate(), '', null, '长沙公司设备C(停机)'),
(20004, 103, 'WR-2200 焊接机器人D', 'WR20230815001', '0', '', 'WR-2200', '2023-08-15', 'WR20230815001', '深圳研发试验线', '赵工', '2023-08-20', '2025-08-19', '0', 'admin', sysdate(), '', null, '深圳研发部门设备D'),
(20005, 105, 'WR-1600 焊接机器人E', 'WR20230909001', '1', '', 'WR-1600', '2023-09-09', 'WR20230909001', '深圳测试车间', '周工', '2023-09-10', '2025-09-09', '0', 'admin', sysdate(), '', null, '深圳测试部门设备E(故障)');

View File

@@ -0,0 +1,47 @@
-- ----------------------------
-- 教学视频表按产品原型分类Tab + 列表卡片)
-- Tab: 全部视频 / 基础教学 / 常见问题 / 故障排除
-- 列表展示: 封面、时长、标题、播放量、发布日期
-- ----------------------------
drop table if exists teaching_video;
create table teaching_video (
video_id bigint(20) not null auto_increment comment '视频ID',
category_code varchar(32) not null comment '分类编码(ALL/BASIC/FAQ/TROUBLE)',
title varchar(120) not null comment '视频标题',
summary varchar(255) default '' comment '视频简介(列表摘要)',
cover_url varchar(512) default '' comment '封面URL',
video_url varchar(512) default '' comment '视频URL',
duration_seconds int(11) default 0 comment '时长(秒)',
view_count bigint(20) default 0 comment '播放量',
publish_date date default null comment '发布日期',
sort_num int(11) default 0 comment '排序(越大越靠前)',
status char(1) default '0' comment '状态(0上架 1下架)',
del_flag char(1) default '0' comment '删除标志(0存在 2删除)',
create_by varchar(64) default '' comment '创建者',
create_time datetime comment '创建时间',
update_by varchar(64) default '' comment '更新者',
update_time datetime comment '更新时间',
remark varchar(500) default null comment '备注',
primary key (video_id),
key idx_teaching_video_category (category_code),
key idx_teaching_video_status (status),
key idx_teaching_video_publish (publish_date),
key idx_teaching_video_sort (sort_num)
) engine=innodb auto_increment=10001 comment = '教学视频表';
-- ----------------------------
-- 示例数据(用于测试列表/分类筛选/详情)
-- 说明cover_url/video_url 先用占位字符串,前端可替换为真实地址或通过文件上传生成
-- ----------------------------
insert into teaching_video
(video_id, category_code, title, summary, cover_url, video_url, duration_seconds, view_count, publish_date, sort_num, status, del_flag, create_by, create_time, update_by, update_time, remark)
values
(10001, 'BASIC', '焊接机器人基础操作教程', '从开机自检到基础示教,快速掌握焊接机器人上手流程。', '/profile/teaching/cover/basic_01.jpg', 'https://example.com/video/basic_01.mp4', 755, 1200, '2022-10-12', 90, '0', '0', 'admin', sysdate(), '', null, '原型同款:基础教学'),
(10002, 'BASIC', '焊接电流电压与工艺参数设置', '讲解电流/电压/送丝速度等关键参数对焊缝成形的影响。', '/profile/teaching/cover/basic_02.jpg', 'https://example.com/video/basic_02.mp4', 1005, 980, '2022-11-06', 80, '0', '0', 'admin', sysdate(), '', null, null),
(10003, 'FAQ', '高级编程技巧与路径优化', '常见焊接路径规划思路与示教编程技巧,提升效率与一致性。', '/profile/teaching/cover/faq_01.jpg', 'https://example.com/video/faq_01.mp4', 1531, 860, '2022-07-28', 70, '0', '0', 'admin', sysdate(), '', null, '原型同款25:31'),
(10004, 'BASIC', '焊接机器人日常维护全面指南', '保养点检、易损件更换、维护周期建议,减少停机风险。', '/profile/teaching/cover/basic_03.jpg', '/profile/teaching/video/basic_03.mp4', 1127, 540, '2022-06-15', 60, '0', '0', 'admin', sysdate(), '', null, '原型同款18:47'),
(10005, 'TROUBLE','常见故障快速诊断与解决方案', '焊接异常、报警代码、通信中断等问题的排查路径与处理建议。', '/profile/teaching/cover/trouble_01.jpg', '/profile/teaching/video/trouble_01.mp4', 1270, 760, '2022-05-03', 50, '0', '0', 'admin', sysdate(), '', null, '原型同款21:10'),
(10006, 'FAQ', '焊接质量评估与参数调优', '从外观到强度,介绍常用评估指标与参数调优策略。', '/profile/teaching/cover/faq_02.jpg', '/profile/teaching/video/faq_02.mp4', 1005, 420, '2022-03-13', 40, '0', '0', 'admin', sysdate(), '', null, '原型同款16:45');

View File

@@ -0,0 +1,15 @@
-- ----------------------------
-- 教学视频表扩展:支持外部视频源(B站)同步
-- ----------------------------
alter table teaching_video
add column source_type varchar(32) default null comment '视频来源类型(BILIBILI等)' after video_id,
add column source_key varchar(64) default null comment '来源唯一键(B站bvid等)' after source_type,
add column source_url varchar(512) default null comment '来源原始链接' after source_key,
add column sync_status char(1) default '0' comment '同步状态(0正常 1失败)' after remark,
add column sync_time datetime default null comment '最近同步时间' after sync_status,
add column sync_error varchar(500) default null comment '最近同步错误' after sync_time;
create unique index uk_teaching_video_source on teaching_video (source_type, source_key);
create index idx_teaching_video_sync_time on teaching_video (sync_time);

View File

@@ -0,0 +1,13 @@
-- ----------------------------
-- 可选创建B站教学视频同步定时任务若依任务调度
-- 使用前请确保已:
-- 1) 执行 teaching_video_bilibili_source_20260331.sql 配置同步源
-- 2) 执行 teaching_video_bilibili_extend_20260331.sql 扩展教学视频表
--
-- invoke_target: biliVideoSyncTask.syncAll()
-- cron_expression: 每小时第5分钟执行一次可自行调整
-- ----------------------------
insert into sys_job (job_id, job_name, job_group, invoke_target, cron_expression, misfire_policy, concurrent, status, create_by, create_time, update_by, update_time, remark)
values (10, 'B站教学视频同步', 'DEFAULT', 'biliVideoSyncTask.syncAll()', '0 5 * * * ?', '3', '1', '0', 'admin', sysdate(), '', null, '同步B站合集/系列到教学视频表');

View File

@@ -0,0 +1,33 @@
-- ----------------------------
-- B站合集(Series/Season) 同步源配置表
-- 说明以UP主mid + season_id为主B站“合集/系列”常见公开接口形态)
-- ----------------------------
drop table if exists teaching_video_source;
create table teaching_video_source (
source_id bigint(20) not null auto_increment comment '源ID',
source_type varchar(32) not null comment '来源类型(BILIBILI)',
mid bigint(20) default null comment 'UP主mid',
season_id bigint(20) default null comment '合集/系列season_id',
category_code varchar(32) default 'BASIC' comment '落库分类(默认BASIC)',
enabled char(1) default '0' comment '启用(0启用 1停用)',
sort_num int(11) default 0 comment '排序',
last_sync_time datetime default null comment '最近同步时间',
last_sync_status char(1) default '0' comment '最近同步状态(0正常 1失败)',
last_sync_error varchar(500) default null comment '最近同步错误',
create_by varchar(64) default '' comment '创建者',
create_time datetime comment '创建时间',
update_by varchar(64) default '' comment '更新者',
update_time datetime comment '更新时间',
remark varchar(500) default null comment '备注',
primary key (source_id),
key idx_video_source_enabled (enabled),
key idx_video_source_sort (sort_num)
) engine=innodb auto_increment=1 comment = '教学视频外部源配置表';
-- 示例:请把 mid/season_id 替换为你公司维护的合集
insert into teaching_video_source
(source_type, mid, season_id, category_code, enabled, sort_num, create_by, create_time, remark)
values
('BILIBILI', 37974444, 240490, 'BASIC', '0', 10, 'admin', sysdate(), '示例同步B站合集(需替换mid/season_id)');