Files
tms-erp-api/doc/sql/transport/blade_exception_disposal_20260812.sql
b2894lxlx 2441fb3023 1、新增应付明细
2、新增应收明细
3、新增异常处置
4、新增风险处置
5、新增在途追踪
6、修复业务模块bug
2026-08-13 00:01:10 +08:00

68 lines
4.6 KiB
SQL

-- 在途管理 / 异常处置
CREATE TABLE IF NOT EXISTS `blade_exception_disposal` (
`id` bigint(20) NOT NULL COMMENT '主键',
`tenant_id` varchar(12) NOT NULL DEFAULT '000000' COMMENT '租户ID',
`create_user` bigint(20) DEFAULT NULL COMMENT '创建人',
`create_dept` bigint(20) DEFAULT NULL COMMENT '创建部门',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_user` bigint(20) DEFAULT NULL COMMENT '修改人',
`update_time` datetime DEFAULT NULL COMMENT '修改时间',
`status` int(11) DEFAULT '1' COMMENT '状态',
`is_deleted` int(11) DEFAULT '0' COMMENT '是否已删除',
`waybill_id` bigint(20) DEFAULT NULL COMMENT '运单ID',
`waybill_no` varchar(100) DEFAULT NULL COMMENT '运单号',
`loading_or_master_no` varchar(100) DEFAULT NULL COMMENT '配载单号/总单号',
`project_id` bigint(20) DEFAULT NULL COMMENT '项目ID',
`project_name` varchar(100) DEFAULT NULL COMMENT '项目',
`vehicle_no` varchar(100) DEFAULT NULL COMMENT '车牌号',
`reporter_id` bigint(20) DEFAULT NULL COMMENT '上报人ID',
`reporter_name` varchar(100) DEFAULT NULL COMMENT '上报人',
`report_time` datetime DEFAULT NULL COMMENT '上报时间',
`exception_type` varchar(100) DEFAULT NULL COMMENT '异常类型',
`exception_reason` varchar(200) DEFAULT NULL COMMENT '异常原因',
`report_description` varchar(500) DEFAULT NULL COMMENT '上报说明',
`carrier_id` bigint(20) DEFAULT NULL COMMENT '承运商ID',
`carrier_name` varchar(100) DEFAULT NULL COMMENT '承运商',
`scene_photos` text DEFAULT NULL COMMENT '现场照片',
`latest_follow_content` varchar(500) DEFAULT NULL COMMENT '最新跟进说明',
`disposal_status` varchar(30) NOT NULL DEFAULT 'pending' COMMENT '处置状态',
`dept_id` bigint(20) DEFAULT NULL COMMENT '所属组织ID',
`dept_name` varchar(100) DEFAULT NULL COMMENT '所属组织',
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_exception_disposal_waybill` (`waybill_id`, `waybill_no`) USING BTREE,
KEY `idx_exception_disposal_status` (`disposal_status`) USING BTREE,
KEY `idx_exception_disposal_report_time` (`report_time`) USING BTREE,
KEY `idx_exception_disposal_create_time` (`create_time`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='异常处置';
CREATE TABLE IF NOT EXISTS `blade_exception_disposal_follow_record` (
`id` bigint(20) NOT NULL COMMENT '主键',
`tenant_id` varchar(12) NOT NULL DEFAULT '000000' COMMENT '租户ID',
`create_user` bigint(20) DEFAULT NULL COMMENT '创建人',
`create_dept` bigint(20) DEFAULT NULL COMMENT '创建部门',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_user` bigint(20) DEFAULT NULL COMMENT '修改人',
`update_time` datetime DEFAULT NULL COMMENT '修改时间',
`status` int(11) DEFAULT '1' COMMENT '状态',
`is_deleted` int(11) DEFAULT '0' COMMENT '是否已删除',
`disposal_id` bigint(20) NOT NULL COMMENT '异常处置ID',
`follow_content` varchar(500) NOT NULL COMMENT '跟进说明',
`follow_user` bigint(20) DEFAULT NULL COMMENT '跟进人',
`follow_user_name` varchar(100) DEFAULT NULL COMMENT '跟进人姓名',
`follow_time` datetime DEFAULT NULL COMMENT '跟进时间',
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_exception_follow_disposal` (`disposal_id`) USING BTREE,
KEY `idx_exception_follow_time` (`follow_time`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='异常处置跟进记录';
INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`)
VALUES
(2090000000000002000, 0, 'transit_manage', '在途管理', 'transit_manage', '/transit', 'iconfont icon-caidanguanli', 90, 1, 0, 1, NULL, '', 0),
(2090000000000002001, 2090000000000002000, 'exception_disposal', '异常处置', 'exception_disposal', '/transit/exception-disposal', 'iconfont icon-caidanguanli', 1, 1, 0, 1, NULL, '', 0),
(2090000000000002002, 2090000000000002001, 'exception_disposal_view', '查看', 'exception_disposal_view', '', '', 1, 2, 0, 1, NULL, '', 0),
(2090000000000002003, 2090000000000002001, 'exception_disposal_follow', '跟进', 'exception_disposal_follow', '', '', 2, 2, 0, 1, NULL, '', 0),
(2090000000000002004, 2090000000000002001, 'exception_disposal_complete', '完成', 'exception_disposal_complete', '', '', 3, 2, 0, 1, NULL, '', 0),
(2090000000000002005, 2090000000000002001, 'exception_disposal_batch_complete', '批量完成', 'exception_disposal_batch_complete', '', '', 4, 2, 0, 1, NULL, '', 0)
ON DUPLICATE KEY UPDATE `name` = VALUES(`name`), `path` = VALUES(`path`), `is_deleted` = 0;