CREATE TABLE IF NOT EXISTS `blade_loading_manage` (
  `id` bigint(20) NOT NULL COMMENT '主键',
  `tenant_id` varchar(12) 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 '是否已删除',
  `loading_no` varchar(100) DEFAULT NULL COMMENT '配载单号',
  `loading_sub_nos` varchar(200) DEFAULT NULL COMMENT '配载子单号',
  `waybill_ids_json` varchar(4000) DEFAULT NULL COMMENT '运单ID集合',
  `project_id` bigint(20) DEFAULT NULL COMMENT '项目ID',
  `project_name` varchar(100) DEFAULT NULL COMMENT '项目名称',
  `customer_name` varchar(100) DEFAULT NULL COMMENT '客户名称',
  `transport_type` varchar(100) DEFAULT NULL COMMENT '运输类型',
  `cargo_type` varchar(100) DEFAULT NULL COMMENT '货物类型',
  `cargo_name` varchar(100) DEFAULT NULL COMMENT '货物名称',
  `vehicle_no` varchar(100) DEFAULT NULL COMMENT '车/船/航班/班列',
  `trailer_vehicle_no` varchar(100) DEFAULT NULL COMMENT '挂车车牌号',
  `driver_name` varchar(100) DEFAULT NULL COMMENT '司机',
  `driver_phone` varchar(50) DEFAULT NULL COMMENT '联系电话',
  `escort_name` varchar(100) DEFAULT NULL COMMENT '押运人',
  `escort_phone` varchar(50) DEFAULT NULL COMMENT '押运人手机号',
  `carrier_type` varchar(50) DEFAULT NULL COMMENT '承运类型',
  `carrier_name` varchar(100) DEFAULT NULL COMMENT '承运商',
  `departure_address` varchar(100) DEFAULT NULL COMMENT '发货地',
  `transit_address` varchar(200) DEFAULT NULL COMMENT '途经地',
  `arrival_address` varchar(100) DEFAULT NULL COMMENT '到货地',
  `original_no` varchar(100) DEFAULT NULL COMMENT '原始单号',
  `data_source` varchar(100) DEFAULT NULL COMMENT '数据来源',
  `start_date` date DEFAULT NULL COMMENT '开始日期',
  `end_date` date DEFAULT NULL COMMENT '结束日期',
  `plan_name` varchar(100) DEFAULT NULL COMMENT '计划名称',
  `batch_no` varchar(100) DEFAULT NULL COMMENT '运单批次号',
  `current_process_node` varchar(100) DEFAULT NULL COMMENT '当前过程节点',
  `mileage` decimal(18,2) DEFAULT NULL COMMENT '里程',
  `estimated_start_date` date DEFAULT NULL COMMENT '预计发货日期',
  `estimated_end_date` date DEFAULT NULL COMMENT '预计完成日期',
  `task_remark` varchar(500) DEFAULT NULL COMMENT '任务备注',
  `goods_json` text DEFAULT NULL COMMENT '货物信息',
  `route_json` text DEFAULT NULL COMMENT '路线信息',
  `task_info_json` text DEFAULT NULL COMMENT '任务信息',
  `dept_id` bigint(20) DEFAULT NULL COMMENT '所属组织ID',
  `dept_name` varchar(100) DEFAULT NULL COMMENT '所属组织',
  `business_status` varchar(100) DEFAULT NULL COMMENT '业务状态',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `uk_loading_manage_no` (`loading_no`) USING BTREE,
  KEY `idx_loading_manage_dept` (`dept_id`) USING BTREE,
  KEY `idx_loading_manage_create_time` (`create_time`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='配载管理';

INSERT IGNORE INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES
(2090000000000000700, 2090000000000000000, 'loading_manage', '配载管理', 'loading_manage', '/business/loading-manage', 'iconfont icon-caidanguanli', 70, 1, 0, 1, NULL, '', 0),
(2090000000000000701, 2090000000000000700, 'loading_manage_view', '查看', 'loading_manage_view', '', '', 1, 2, 0, 1, NULL, '', 0),
(2090000000000000702, 2090000000000000700, 'loading_manage_add', '新增', 'loading_manage_add', '', '', 2, 2, 0, 1, NULL, '', 0),
(2090000000000000703, 2090000000000000700, 'loading_manage_edit', '编辑', 'loading_manage_edit', '', '', 3, 2, 0, 1, NULL, '', 0),
(2090000000000000704, 2090000000000000700, 'loading_manage_delete', '删除', 'loading_manage_delete', '', '', 4, 2, 0, 1, NULL, '', 0),
(2090000000000000705, 2090000000000000700, 'loading_manage_export', '批量导出', 'loading_manage_export', '', '', 5, 2, 0, 1, NULL, '', 0),
(2090000000000000706, 2090000000000000700, 'loading_manage_copy', '复制', 'loading_manage_copy', '', '', 6, 2, 0, 1, NULL, '', 0),
(2090000000000000707, 2090000000000000700, 'loading_manage_reassign', '重新派单', 'loading_manage_reassign', '', '', 7, 2, 0, 1, NULL, '', 0),
(2090000000000000708, 2090000000000000700, 'loading_manage_cancel', '取消', 'loading_manage_cancel', '', '', 8, 2, 0, 1, NULL, '', 0),
(2090000000000000709, 2090000000000000700, 'loading_manage_complete', '完成', 'loading_manage_complete', '', '', 9, 2, 0, 1, NULL, '', 0),
(2090000000000000710, 2090000000000000700, 'loading_manage_batch_complete', '批量完成', 'loading_manage_batch_complete', '', '', 10, 2, 0, 1, NULL, '', 0);
